@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
|
@@ -4,4 +4,4 @@ import { dirname as __dirname_ } from 'node:path';
|
|
|
4
4
|
const require = __createRequire(import.meta.url);
|
|
5
5
|
const __filename = __fileURLToPath(import.meta.url);
|
|
6
6
|
const __dirname = __dirname_(__filename);
|
|
7
|
-
import{require_dist,require_dist2}from"./chunk-7L2K4OKM.js";import{require_types}from"./chunk-4N6LMERQ.js";import{require_build_utils}from"./chunk-XP3FT56R.js";import{__commonJS,__toESM}from"./chunk-BZENIQ7N.js";var require_dist3=__commonJS({"../../internals/service-topology/dist/index.js"(exports,module){"use strict";var __defProp=Object.defineProperty,__getOwnPropDesc=Object.getOwnPropertyDescriptor,__getOwnPropNames=Object.getOwnPropertyNames,__hasOwnProp=Object.prototype.hasOwnProperty,__export=(target,all)=>{for(var name in all)__defProp(target,name,{get:all[name],enumerable:!0})},__copyProps=(to,from,except,desc)=>{if(from&&typeof from=="object"||typeof from=="function")for(let key of __getOwnPropNames(from))!__hasOwnProp.call(to,key)&&key!==except&&__defProp(to,key,{get:()=>from[key],enumerable:!(desc=__getOwnPropDesc(from,key))||desc.enumerable});return to},__toCommonJS=mod=>__copyProps(__defProp({},"__esModule",{value:!0}),mod),src_exports={};__export(src_exports,{INTERNAL_SERVICE_PREFIX:()=>import_fs_detectors2.INTERNAL_SERVICE_PREFIX,autoDetectServices:()=>import_fs_detectors2.autoDetectServices,detectDaemons:()=>import_fs_detectors2.detectDaemons,detectServices:()=>import_fs_detectors2.detectServices,generateServiceRewrites:()=>import_fs_detectors2.generateServiceRewrites,generateServicesRoutes:()=>import_fs_detectors2.generateServicesRoutes,getInternalServiceCronPath:()=>import_fs_detectors2.getInternalServiceCronPath,getInternalServiceCronPathPrefix:()=>import_fs_detectors2.getInternalServiceCronPathPrefix,getInternalServiceFunctionPath:()=>import_fs_detectors2.getInternalServiceFunctionPath,getInternalServiceWorkerPath:()=>import_fs_detectors2.getInternalServiceWorkerPath,getInternalServiceWorkerPathPrefix:()=>import_fs_detectors2.getInternalServiceWorkerPathPrefix,hasLegacyServicesConfig:()=>import_fs_detectors2.hasLegacyServicesConfig,isExperimentalService:()=>import_fs_detectors2.isExperimentalService,isExperimentalServiceV2:()=>import_fs_detectors2.isExperimentalServiceV2,isRouteOwningBuilder:()=>import_fs_detectors2.isRouteOwningBuilder,isStaticBuild:()=>import_fs_detectors2.isStaticBuild,migrateExperimentalServices:()=>import_fs_detectors2.migrateExperimentalServices,planExperimentalServicesMigration:()=>import_fs_detectors2.planExperimentalServicesMigration,resolveAllConfiguredServices:()=>import_fs_detectors2.resolveAllConfiguredServices,resolveAllConfiguredServicesV2:()=>import_fs_detectors2.resolveAllConfiguredServicesV2,resolveConfiguredServiceV2:()=>import_fs_detectors2.resolveConfiguredServiceV2,validateServiceConfigV2:()=>import_fs_detectors2.validateServiceConfigV2});module.exports=__toCommonJS(src_exports);var import_fs_detectors2=require_dist2()}});var import_routing_utils=__toESM(require_dist(),1),import_build_utils=__toESM(require_build_utils(),1),import_types=__toESM(require_types(),1),import_fs_detectors=__toESM(require_dist2(),1);import{getConfigValidator}from"./config-validator.mjs";var imagesSchema={type:"object",additionalProperties:!1,required:["sizes"],properties:{contentDispositionType:{enum:["inline","attachment"]},contentSecurityPolicy:{type:"string",minLength:1,maxLength:256},dangerouslyAllowSVG:{type:"boolean"},domains:{type:"array",minItems:0,maxItems:50,items:{type:"string",minLength:1,maxLength:256}},formats:{type:"array",minItems:1,maxItems:4,items:{enum:["image/avif","image/webp","image/jpeg","image/png"]}},localPatterns:{type:"array",minItems:0,maxItems:25,items:{type:"object",additionalProperties:!1,properties:{pathname:{type:"string",minLength:1,maxLength:256},search:{type:"string",minLength:0,maxLength:256}}}},minimumCacheTTL:{type:"integer",minimum:1,maximum:31536e4},qualities:{type:"array",minItems:1,maxItems:20,items:{type:"integer",minimum:1,maximum:100}},remotePatterns:{type:"array",minItems:0,maxItems:50,items:{type:"object",additionalProperties:!1,required:["hostname"],properties:{protocol:{enum:["http","https"]},hostname:{type:"string",minLength:1,maxLength:256},port:{type:"string",minLength:0,maxLength:5},pathname:{type:"string",minLength:1,maxLength:256},search:{type:"string",minLength:0,maxLength:256}}}},sizes:{type:"array",minItems:1,maxItems:50,items:{type:"number"}}}},cronsSchema={type:"array",minItems:0,items:{type:"object",additionalProperties:!1,required:["path","schedule"],properties:{path:{type:"string",minLength:1,maxLength:512,pattern:"^/.*"},schedule:{type:"string",minLength:9,maxLength:256}}}},scheduleNameSchema={type:"string",minLength:1,maxLength:256,pattern:"^[0-9A-Za-z][0-9A-Za-z._-]*$"},scheduleDefinitionSchema={type:"object",additionalProperties:!1,required:["schedule"],properties:{schedule:{type:"string",minLength:9,maxLength:256},timezone:{type:"string",minLength:1,maxLength:50,description:"IANA timezone for cron evaluation. Defaults to UTC."},jitter:{type:"integer",minimum:1,maximum:15},path:{description:"Deployment path to invoke over HTTP, like `crons[].path`. Must start with `/`.",type:"string",maxLength:512,pattern:"^/"},requestMethod:{description:"HTTP method used to invoke `path`. Only valid with `path`. Defaults to `POST`.",enum:["GET","POST"]},function:{type:"string",minLength:1},service:{description:"Service that owns `function`, from `services`. When set, `function` is the path within that service. Only valid with `function`.",type:"string",minLength:1,maxLength:64,pattern:"^[a-z]([a-z_-]*[a-z])?$"},topic:{type:"string",minLength:1,maxLength:256,pattern:"^[A-Za-z0-9_-]+$"},command:{description:"Command to run for each firing. Only valid with a Dockerfile or Containerfile entrypoint.",type:"array",minItems:1,items:[{type:"string",pattern:"\\S"}],additionalItems:{type:"string"}},root:{description:"Directory of the service that runs `command`. `entrypoint` is relative to it. Only valid with `command`.",type:"string",minLength:1,maxLength:512},entrypoint:{type:"string",minLength:1,maxLength:512}},dependencies:{requestMethod:["path"],service:["function"],command:["entrypoint","root"],root:["command"]},oneOf:[{required:["path"]},{required:["function"]},{required:["topic"]},{required:["entrypoint"]}]},maxSchedules=100,schedulesSchema={type:"object",maxProperties:maxSchedules,propertyNames:scheduleNameSchema,additionalProperties:scheduleDefinitionSchema},experimentalServicesMountSchema={oneOf:[{type:"string",minLength:1,maxLength:512},{type:"object",additionalProperties:!1,properties:{path:{type:"string",minLength:1,maxLength:512},subdomain:{type:"string",minLength:1,maxLength:63}},anyOf:[{required:["path"]},{required:["subdomain"]}]}]},staticExperimentalServiceScheduleSchema={type:"string",minLength:9,maxLength:256,not:{const:"<dynamic>"}},experimentalServiceScheduleSchema={oneOf:[{type:"string",minLength:9,maxLength:256},{type:"array",minItems:1,items:staticExperimentalServiceScheduleSchema}]},experimentalServiceQueueTopicSchema={type:"object",additionalProperties:!1,required:["topic"],properties:{topic:{type:"string",minLength:1,maxLength:256},retryAfterSeconds:{type:"integer",minimum:1,maximum:86400},initialDelaySeconds:{type:"integer",minimum:0,maximum:86400}}},experimentalServiceTopicsSchema={oneOf:[{type:"array",minItems:1,items:{type:"string",minLength:1,maxLength:256}},{type:"array",minItems:1,items:experimentalServiceQueueTopicSchema}]},envVarNamesSchema={pattern:"^[A-Za-z_][A-Za-z0-9_]*$",maxLength:256},getExperimentalServicesCommonProperties=()=>({entrypoint:{type:"string",minLength:1,maxLength:512},root:{type:"string",minLength:1,maxLength:512},workspace:{type:"string",minLength:1,maxLength:512},framework:{type:"string",minLength:1,maxLength:256},builder:{type:"string",minLength:1,maxLength:256},runtime:{type:"string",minLength:1,maxLength:256},buildCommand:{type:"string",minLength:1,maxLength:2048},installCommand:{type:"string",minLength:1,maxLength:2048},preDeployCommand:{type:"string",minLength:1,maxLength:2048},command:{oneOf:[{type:"string",minLength:1,maxLength:2048},{type:"array",minItems:1,items:{type:"string",minLength:1,maxLength:2048}}]},memory:{type:"integer",minimum:128,maximum:10240},maxDuration:(0,import_build_utils.getMaxDurationSchema)(),includeFiles:{oneOf:[{type:"string",minLength:1},{type:"array",items:{type:"string",minLength:1}}]},excludeFiles:{oneOf:[{type:"string",minLength:1},{type:"array",items:{type:"string",minLength:1}}]}}),experimentalServicesRoutableProperties={mount:experimentalServicesMountSchema,routePrefix:{type:"string",minLength:1,maxLength:512},subdomain:{type:"string",minLength:1,maxLength:63}},getExperimentalServicesServiceConfigSchema=()=>({oneOf:[{type:"object",additionalProperties:!1,properties:{...getExperimentalServicesCommonProperties(),...experimentalServicesRoutableProperties,type:{enum:["web"]}}},{type:"object",additionalProperties:!1,required:["type","trigger","schedule"],properties:{...getExperimentalServicesCommonProperties(),type:{const:"job"},trigger:{const:"schedule"},schedule:experimentalServiceScheduleSchema}},{type:"object",additionalProperties:!1,required:["type","trigger","topics"],properties:{...getExperimentalServicesCommonProperties(),type:{const:"job"},trigger:{const:"queue"},topics:experimentalServiceTopicsSchema,consumer:{type:"string",minLength:1,maxLength:256}}},{type:"object",additionalProperties:!1,required:["type","trigger","entrypoint"],properties:{...getExperimentalServicesCommonProperties(),type:{const:"job"},trigger:{const:"workflow"}}},{type:"object",additionalProperties:!1,required:["type"],properties:{...getExperimentalServicesCommonProperties(),type:{const:"worker"},topics:{type:"array",items:{type:"string",minLength:1,maxLength:256},minItems:1},consumer:{type:"string",minLength:1,maxLength:256}}},{type:"object",additionalProperties:!1,required:["type","schedule"],properties:{...getExperimentalServicesCommonProperties(),type:{const:"cron"},schedule:experimentalServiceScheduleSchema}}]}),getExperimentalServicesSchema=()=>({type:"object",propertyNames:{pattern:"^[a-zA-Z]([a-zA-Z0-9_-]*[a-zA-Z0-9])?$",maxLength:64},additionalProperties:getExperimentalServicesServiceConfigSchema()}),experimentalServiceGroupsSchema={type:"object",propertyNames:{pattern:"^[a-zA-Z]([a-zA-Z0-9_-]*[a-zA-Z0-9])?$",maxLength:64},additionalProperties:{type:"array",items:{type:"string",minLength:1,maxLength:256}}},servicesPathSchema={type:"string",minLength:1,maxLength:512},servicesCommandSchema={type:"string",minLength:1,maxLength:2048},servicesBindingSchema={type:"object",additionalProperties:!1,required:["service","format","env"],properties:{type:{description:"Optional binding type marker. Currently the only supported type is `service`. When present this must be `service`.",const:"service"},service:{type:"string",minLength:1,maxLength:64,pattern:import_build_utils.SERVICE_NAME_PATTERN},format:{const:"url"},env:{type:"string",...envVarNamesSchema}}},servicesBindingsSchema={type:"array",maxItems:100,items:servicesBindingSchema},getServicesServiceConfigSchema=()=>({type:"object",additionalProperties:!1,required:["root"],properties:{root:servicesPathSchema,framework:{type:"string",minLength:1,maxLength:256},runtime:{type:"string",minLength:1,maxLength:256},entrypoint:servicesPathSchema,command:{oneOf:[{type:"string"},{type:"array",items:{type:"string"}}]},installCommand:servicesCommandSchema,buildCommand:servicesCommandSchema,devCommand:servicesCommandSchema,ignoreCommand:servicesCommandSchema,outputDirectory:servicesPathSchema,bindings:servicesBindingsSchema,functions:(0,import_build_utils.getFunctionsSchema)(),headers:import_routing_utils.headersSchema,redirects:import_routing_utils.redirectsSchema,rewrites:import_routing_utils.rewritesSchema,routes:import_routing_utils.routesSchema,cleanUrls:import_routing_utils.cleanUrlsSchema,trailingSlash:import_routing_utils.trailingSlashSchema}}),daemonConfigSchema={type:"object",additionalProperties:!1,required:["root","entrypoint"],anyOf:[{required:["instances"]},{required:["replicas"]}],properties:{root:servicesPathSchema,entrypoint:servicesPathSchema,command:{type:"array",minItems:1,maxItems:128,items:{type:"string",minLength:1,maxLength:4096}},instances:{type:"object",additionalProperties:{type:"integer",minimum:0}},replicas:{description:"Deprecated. Use `instances`. Ignored when `instances` is set.",deprecated:!0,type:"object",additionalProperties:{type:"integer",minimum:0}},resources:{type:"object",additionalProperties:!1,required:["requests"],properties:{requests:{type:"object",additionalProperties:!1,required:["memory"],properties:{memory:{enum:["1Gi","2Gi","4Gi","8Gi"]}}}}},terminationGracePeriodSeconds:{type:"integer",minimum:0},livenessProbe:{type:"object",additionalProperties:!1,required:["httpGet"],properties:{httpGet:{type:"object",additionalProperties:!1,required:["port"],properties:{path:{type:"string",minLength:1},port:{type:"integer",minimum:1,maximum:65535},host:{type:"string",minLength:1},scheme:{enum:["HTTP","HTTPS"]},httpHeaders:{type:"array",items:{type:"object",additionalProperties:!1,required:["name","value"],properties:{name:{type:"string",minLength:1},value:{type:"string"}}}}}},initialDelaySeconds:{type:"integer",minimum:0,maximum:86400},periodSeconds:{type:"integer",minimum:1,maximum:86400},timeoutSeconds:{type:"integer",minimum:1,maximum:86400},successThreshold:{type:"integer",minimum:1,maximum:10},failureThreshold:{type:"integer",minimum:1,maximum:10}}},bindings:{...servicesBindingsSchema,items:{...servicesBindingSchema,required:["type",...servicesBindingSchema.required]}}}},getServicesSchema=()=>({type:"object",propertyNames:{pattern:import_build_utils.SERVICE_NAME_PATTERN,maxLength:64},additionalProperties:getServicesServiceConfigSchema()}),maxDaemons=100,daemonsSchema={type:"object",maxProperties:maxDaemons,propertyNames:{pattern:import_build_utils.DAEMON_NAME_PATTERN,maxLength:64},additionalProperties:daemonConfigSchema},proxySchema={type:"object",additionalProperties:!1,required:["entrypoint"],properties:{entrypoint:{type:"string",minLength:1},matcher:{oneOf:[{type:"string",minLength:1},{type:"array",minItems:1,items:{type:"string",minLength:1}}]}}};function buildVercelConfigSchema(){return{type:"object",additionalProperties:!0,properties:{builds:import_build_utils.buildsSchema,routes:import_routing_utils.routesSchema,cleanUrls:import_routing_utils.cleanUrlsSchema,headers:import_routing_utils.headersSchema,redirects:import_routing_utils.redirectsSchema,rewrites:import_routing_utils.rewritesSchema,trailingSlash:import_routing_utils.trailingSlashSchema,functions:(0,import_build_utils.getFunctionsSchema)(),images:imagesSchema,crons:cronsSchema,schedules:schedulesSchema,bunVersion:{type:"string"},proxy:proxySchema,experimentalServices:getExperimentalServicesSchema(),experimentalServiceGroups:experimentalServiceGroupsSchema,services:getServicesSchema(),experimentalServicesV2:getServicesSchema(),daemons:daemonsSchema}}}var isDockerfilePath=path=>/(docker|container)file/i.test(path.split(/[\\/]/).pop()??"");function validateConfig(config){let validate=getConfigValidator(buildVercelConfigSchema);if(!validate(config)&&validate.errors&&validate.errors[0]){let error=validate.errors[0],fileName=config[import_types.fileNameSymbol]||"vercel.json",niceError=(0,import_build_utils.getPrettyError)(error);return niceError.message=`Invalid ${fileName} - ${niceError.message}`,niceError}let serviceNames=new Set([...Object.keys(config.services??{}),...Object.keys(config.daemons??{})]),invalidCommand=message=>new import_build_utils.NowBuildError({code:"INVALID_SCHEDULE_COMMAND",message:`Invalid ${config[import_types.fileNameSymbol]||"vercel.json"} - ${message}`});for(let[name,schedule]of Object.entries(config.schedules??{})){let path=`schedules.${name}`;if("command"in schedule){if(!isDockerfilePath(schedule.entrypoint))return invalidCommand(`\`${path}.command\` requires a Dockerfile or Containerfile \`entrypoint\`.`);if(name.length>64||!new RegExp(import_build_utils.SERVICE_NAME_PATTERN).test(name))return invalidCommand(`\`${path}\` runs a command, so its name must be a valid service name: lowercase letters, \`-\` and \`_\`, at most 64 characters.`);if(serviceNames.has(name))return invalidCommand(`\`${path}\` runs a command as service "${name}", which is already the name of a service or daemon.`)}if(schedule.timezone!==void 0)try{if(!/^[A-Za-z][A-Za-z0-9_+/-]*$/.test(schedule.timezone))throw new RangeError("Expected a named timezone");new Intl.DateTimeFormat("en-US",{timeZone:schedule.timezone})}catch{return new import_build_utils.NowBuildError({code:"INVALID_SCHEDULE_TIMEZONE",message:`Invalid ${config[import_types.fileNameSymbol]||"vercel.json"} - \`schedules.${name}.timezone\` must be a valid IANA timezone, such as "America/New_York". Omit it to use UTC.`})}}let functionMaps=[config.functions,...Object.values(config.services??{}).map(service=>service.functions),...Object.values(config.experimentalServicesV2??{}).map(service=>service.functions)];for(let functions of functionMaps)for(let[pattern,fn]of Object.entries(functions??{})){let regions=[...new Set(fn.regions)];if(fn.affinity?.mode==="strict"&&(regions.includes("all")||regions.length>1))return new import_build_utils.NowBuildError({code:"INVALID_FUNCTION_AFFINITY_REGIONS",message:`Function affinity mode "strict" requires at most one statically configured region. Update \`functions[${JSON.stringify(pattern)}].regions\` to contain a single region.`,link:"https://vercel.com/docs/concepts/projects/project-configuration#functions"})}if(config.proxy){let proxyError=(0,import_fs_detectors.validateProxyConfig)(config.proxy);if(proxyError)return new import_build_utils.NowBuildError({code:proxyError.code.toUpperCase(),message:proxyError.message})}if(config.functions&&config.builds)return new import_build_utils.NowBuildError({code:"FUNCTIONS_AND_BUILDS",message:"The `functions` property cannot be used in conjunction with the `builds` property. Please remove one of them.",link:"https://vercel.link/functions-and-builds"});if(config.proxy&&config.builds)return new import_build_utils.NowBuildError({code:"PROXY_AND_BUILDS",message:"The `proxy` property cannot be used with the `builds` property. Remove `builds` to use an explicit proxy entrypoint."});let hasExperimentalServices=!!config.experimentalServices;if(hasExperimentalServices&&config.builds)return new import_build_utils.NowBuildError({code:"EXPERIMENTAL_SERVICES_AND_BUILDS",message:"The `experimentalServices` property cannot be used in conjunction with the `builds` property. Please remove one of them."});if(hasExperimentalServices&&config.functions)return new import_build_utils.NowBuildError({code:"EXPERIMENTAL_SERVICES_AND_FUNCTIONS",message:"The `experimentalServices` property cannot be used in conjunction with the `functions` property. Please remove one of them."});if(config.experimentalServiceGroups&&!config.experimentalServices)return new import_build_utils.NowBuildError({code:"SERVICE_GROUPS_WITHOUT_SERVICES",message:"The `experimentalServiceGroups` property requires `experimentalServices` to be defined. Service groups reference services by name."});let hasServices=config.services!=null,hasExperimentalServicesV2=config.experimentalServicesV2!=null;if(hasServices&&hasExperimentalServicesV2)return new import_build_utils.NowBuildError({code:"SERVICES_AND_EXPERIMENTAL_SERVICES_V2",message:"The `services` property cannot be used in conjunction with its deprecated alias `experimentalServicesV2`. Please use only `services`."});let servicesConfig=config.services??config.experimentalServicesV2,servicesConfigKey=hasServices?"services":"experimentalServicesV2",servicesErrorCodePrefix=hasServices?"SERVICES":"EXPERIMENTAL_SERVICES_V2";if(servicesConfig&&hasExperimentalServices)return new import_build_utils.NowBuildError({code:`${servicesErrorCodePrefix}_AND_EXPERIMENTAL_SERVICES`,message:`The \`${servicesConfigKey}\` property cannot be used in conjunction with the \`experimentalServices\` property. Please use only one services configuration.`});if(servicesConfig&&config.builds)return new import_build_utils.NowBuildError({code:`${servicesErrorCodePrefix}_AND_BUILDS`,message:`The \`${servicesConfigKey}\` property cannot be used in conjunction with the \`builds\` property. Please remove one of them.`});if(servicesConfig){let ambiguousTopLevel=[];if(config.functions!=null&&ambiguousTopLevel.push("functions"),config.installCommand!=null&&ambiguousTopLevel.push("installCommand"),config.buildCommand!=null&&ambiguousTopLevel.push("buildCommand"),config.devCommand!=null&&ambiguousTopLevel.push("devCommand"),config.ignoreCommand!=null&&ambiguousTopLevel.push("ignoreCommand"),config.outputDirectory!=null&&ambiguousTopLevel.push("outputDirectory"),config.framework!=null&&ambiguousTopLevel.push("framework"),ambiguousTopLevel.length>0){let count=ambiguousTopLevel.length,fields=ambiguousTopLevel.map(field=>`\`${field}\``).join(", ");return new import_build_utils.NowBuildError({code:`${servicesErrorCodePrefix}_AND_TOP_LEVEL_BUILD_SETTINGS`,message:`The top-level ${count>1?"properties":"property"} ${fields} cannot be used with \`${servicesConfigKey}\` because the owning service is ambiguous. Move ${count>1?"them":"it"} under the relevant service in \`${servicesConfigKey}\`.`})}}if(config.daemons){let daemonError=validateDaemons(config,config.daemons);if(daemonError)return daemonError}if(servicesConfig){let serviceNames2=new Set(Object.keys(servicesConfig));for(let[serviceName,serviceConfig]of Object.entries(servicesConfig))for(let binding of serviceConfig.bindings??[])if(!serviceNames2.has(binding.service))return new import_build_utils.NowBuildError({code:`${servicesErrorCodePrefix}_BINDING_UNKNOWN_SERVICE`,message:`Service "${serviceName}" declares a binding to unknown service "${binding.service}". Add "${binding.service}" to \`${servicesConfigKey}\` or fix the binding.`})}return null}function validateDaemons(config,daemons){let invalid=message=>new import_build_utils.NowBuildError({code:"INVALID_DAEMON",message}),daemonNames=new Set(Object.keys(daemons));for(let[name,daemon]of Object.entries(daemons))if(!isDockerfilePath(daemon.entrypoint))return invalid(`Daemon "${name}" must set \`entrypoint\` to a Dockerfile or Containerfile.`);let services={...config.experimentalServicesV2,...config.services},isDaemonTarget=name=>daemonNames.has(name)&&!Object.prototype.hasOwnProperty.call(services,name);for(let[name,service]of Object.entries(services)){let binding=service.bindings?.find(binding2=>isDaemonTarget(binding2.service));if(binding)return invalid(`Service "${name}" cannot bind to daemon "${binding.service}" because daemons do not receive traffic.`)}for(let[name,daemon]of Object.entries(daemons)){let envs=new Set;for(let binding of daemon.bindings??[]){if(!Object.prototype.hasOwnProperty.call(services,binding.service))return invalid(`Daemon "${name}" declares a binding to unknown service "${binding.service}". Add "${binding.service}" to \`services\` or fix the binding.`);if(envs.has(binding.env))return invalid(`Daemon "${name}" declares more than one binding for the environment variable "${binding.env}".`);envs.add(binding.env)}}let destinations=[...config.rewrites??[],...config.routes??[],...Object.values(services).flatMap(service=>[...service.rewrites??[],...service.routes??[]])].map(entry=>"destination"in entry?entry.destination:void 0);for(let destination of destinations)if(typeof destination=="object"&&destination!==null&&isDaemonTarget(destination.service))return invalid(`Rewrites and routes cannot target daemon "${destination.service}" because daemons do not receive traffic.`);return null}export{require_dist3 as require_dist,validateConfig};
|
|
7
|
+
import{require_dist,require_dist2}from"./chunk-HVDGNAPM.js";import{require_types}from"./chunk-VLYVVC3P.js";import{require_build_utils}from"./chunk-DWOJP4ST.js";import{__commonJS,__toESM}from"./chunk-BZENIQ7N.js";var require_dist3=__commonJS({"../../internals/service-topology/dist/index.js"(exports,module){"use strict";var __defProp=Object.defineProperty,__getOwnPropDesc=Object.getOwnPropertyDescriptor,__getOwnPropNames=Object.getOwnPropertyNames,__hasOwnProp=Object.prototype.hasOwnProperty,__export=(target,all)=>{for(var name in all)__defProp(target,name,{get:all[name],enumerable:!0})},__copyProps=(to,from,except,desc)=>{if(from&&typeof from=="object"||typeof from=="function")for(let key of __getOwnPropNames(from))!__hasOwnProp.call(to,key)&&key!==except&&__defProp(to,key,{get:()=>from[key],enumerable:!(desc=__getOwnPropDesc(from,key))||desc.enumerable});return to},__toCommonJS=mod=>__copyProps(__defProp({},"__esModule",{value:!0}),mod),src_exports={};__export(src_exports,{INTERNAL_SERVICE_PREFIX:()=>import_fs_detectors2.INTERNAL_SERVICE_PREFIX,autoDetectServices:()=>import_fs_detectors2.autoDetectServices,detectDaemons:()=>import_fs_detectors2.detectDaemons,detectServices:()=>import_fs_detectors2.detectServices,generateServiceRewrites:()=>import_fs_detectors2.generateServiceRewrites,generateServicesRoutes:()=>import_fs_detectors2.generateServicesRoutes,getInternalServiceCronPath:()=>import_fs_detectors2.getInternalServiceCronPath,getInternalServiceCronPathPrefix:()=>import_fs_detectors2.getInternalServiceCronPathPrefix,getInternalServiceFunctionPath:()=>import_fs_detectors2.getInternalServiceFunctionPath,getInternalServiceWorkerPath:()=>import_fs_detectors2.getInternalServiceWorkerPath,getInternalServiceWorkerPathPrefix:()=>import_fs_detectors2.getInternalServiceWorkerPathPrefix,hasLegacyServicesConfig:()=>import_fs_detectors2.hasLegacyServicesConfig,isExperimentalService:()=>import_fs_detectors2.isExperimentalService,isExperimentalServiceV2:()=>import_fs_detectors2.isExperimentalServiceV2,isRouteOwningBuilder:()=>import_fs_detectors2.isRouteOwningBuilder,isStaticBuild:()=>import_fs_detectors2.isStaticBuild,migrateExperimentalServices:()=>import_fs_detectors2.migrateExperimentalServices,planExperimentalServicesMigration:()=>import_fs_detectors2.planExperimentalServicesMigration,resolveAllConfiguredServices:()=>import_fs_detectors2.resolveAllConfiguredServices,resolveAllConfiguredServicesV2:()=>import_fs_detectors2.resolveAllConfiguredServicesV2,resolveConfiguredServiceV2:()=>import_fs_detectors2.resolveConfiguredServiceV2,validateServiceConfigV2:()=>import_fs_detectors2.validateServiceConfigV2});module.exports=__toCommonJS(src_exports);var import_fs_detectors2=require_dist2()}});var import_routing_utils=__toESM(require_dist(),1),import_build_utils=__toESM(require_build_utils(),1),import_types=__toESM(require_types(),1),import_fs_detectors=__toESM(require_dist2(),1);import{getConfigValidator}from"./config-validator.mjs";var imagesSchema={type:"object",additionalProperties:!1,required:["sizes"],properties:{contentDispositionType:{enum:["inline","attachment"]},contentSecurityPolicy:{type:"string",minLength:1,maxLength:256},dangerouslyAllowSVG:{type:"boolean"},domains:{type:"array",minItems:0,maxItems:50,items:{type:"string",minLength:1,maxLength:256}},formats:{type:"array",minItems:1,maxItems:4,items:{enum:["image/avif","image/webp","image/jpeg","image/png"]}},localPatterns:{type:"array",minItems:0,maxItems:25,items:{type:"object",additionalProperties:!1,properties:{pathname:{type:"string",minLength:1,maxLength:256},search:{type:"string",minLength:0,maxLength:256}}}},minimumCacheTTL:{type:"integer",minimum:1,maximum:31536e4},qualities:{type:"array",minItems:1,maxItems:20,items:{type:"integer",minimum:1,maximum:100}},remotePatterns:{type:"array",minItems:0,maxItems:50,items:{type:"object",additionalProperties:!1,required:["hostname"],properties:{protocol:{enum:["http","https"]},hostname:{type:"string",minLength:1,maxLength:256},port:{type:"string",minLength:0,maxLength:5},pathname:{type:"string",minLength:1,maxLength:256},search:{type:"string",minLength:0,maxLength:256}}}},sizes:{type:"array",minItems:1,maxItems:50,items:{type:"number"}}}},cronsSchema={type:"array",minItems:0,items:{type:"object",additionalProperties:!1,required:["path","schedule"],properties:{path:{type:"string",minLength:1,maxLength:512,pattern:"^/.*"},schedule:{type:"string",minLength:9,maxLength:256}}}},scheduleNameSchema={type:"string",minLength:1,maxLength:256,pattern:"^[0-9A-Za-z][0-9A-Za-z._-]*$"},scheduleDefinitionSchema={type:"object",additionalProperties:!1,required:["schedule"],properties:{schedule:{type:"string",minLength:9,maxLength:256},timezone:{type:"string",minLength:1,maxLength:50,description:"IANA timezone for cron evaluation. Defaults to UTC."},jitter:{type:"integer",minimum:1,maximum:15},path:{description:"Deployment path to invoke over HTTP, like `crons[].path`. Must start with `/`.",type:"string",maxLength:512,pattern:"^/"},requestMethod:{description:"HTTP method used to invoke `path`. Only valid with `path`. Defaults to `POST`.",enum:["GET","POST"]},function:{type:"string",minLength:1},service:{description:"Service that owns `function`, from `services`. When set, `function` is the path within that service. Only valid with `function`.",type:"string",minLength:1,maxLength:64,pattern:"^[a-z]([a-z_-]*[a-z])?$"},topic:{type:"string",minLength:1,maxLength:256,pattern:"^[A-Za-z0-9_-]+$"},command:{description:"Command to run for each firing. Only valid with a Dockerfile or Containerfile entrypoint.",type:"array",minItems:1,items:[{type:"string",pattern:"\\S"}],additionalItems:{type:"string"}},root:{description:"Directory of the service that runs `command`. `entrypoint` is relative to it. Only valid with `command`.",type:"string",minLength:1,maxLength:512},entrypoint:{type:"string",minLength:1,maxLength:512}},dependencies:{requestMethod:["path"],service:["function"],command:["entrypoint","root"],root:["command"]},oneOf:[{required:["path"]},{required:["function"]},{required:["topic"]},{required:["entrypoint"]}]},maxSchedules=100,schedulesSchema={type:"object",maxProperties:maxSchedules,propertyNames:scheduleNameSchema,additionalProperties:scheduleDefinitionSchema},experimentalServicesMountSchema={oneOf:[{type:"string",minLength:1,maxLength:512},{type:"object",additionalProperties:!1,properties:{path:{type:"string",minLength:1,maxLength:512},subdomain:{type:"string",minLength:1,maxLength:63}},anyOf:[{required:["path"]},{required:["subdomain"]}]}]},staticExperimentalServiceScheduleSchema={type:"string",minLength:9,maxLength:256,not:{const:"<dynamic>"}},experimentalServiceScheduleSchema={oneOf:[{type:"string",minLength:9,maxLength:256},{type:"array",minItems:1,items:staticExperimentalServiceScheduleSchema}]},experimentalServiceQueueTopicSchema={type:"object",additionalProperties:!1,required:["topic"],properties:{topic:{type:"string",minLength:1,maxLength:256},retryAfterSeconds:{type:"integer",minimum:1,maximum:86400},initialDelaySeconds:{type:"integer",minimum:0,maximum:86400}}},experimentalServiceTopicsSchema={oneOf:[{type:"array",minItems:1,items:{type:"string",minLength:1,maxLength:256}},{type:"array",minItems:1,items:experimentalServiceQueueTopicSchema}]},envVarNamesSchema={pattern:"^[A-Za-z_][A-Za-z0-9_]*$",maxLength:256},getExperimentalServicesCommonProperties=()=>({entrypoint:{type:"string",minLength:1,maxLength:512},root:{type:"string",minLength:1,maxLength:512},workspace:{type:"string",minLength:1,maxLength:512},framework:{type:"string",minLength:1,maxLength:256},builder:{type:"string",minLength:1,maxLength:256},runtime:{type:"string",minLength:1,maxLength:256},buildCommand:{type:"string",minLength:1,maxLength:2048},installCommand:{type:"string",minLength:1,maxLength:2048},preDeployCommand:{type:"string",minLength:1,maxLength:2048},command:{oneOf:[{type:"string",minLength:1,maxLength:2048},{type:"array",minItems:1,items:{type:"string",minLength:1,maxLength:2048}}]},memory:{type:"integer",minimum:128,maximum:10240},maxDuration:(0,import_build_utils.getMaxDurationSchema)(),includeFiles:{oneOf:[{type:"string",minLength:1},{type:"array",items:{type:"string",minLength:1}}]},excludeFiles:{oneOf:[{type:"string",minLength:1},{type:"array",items:{type:"string",minLength:1}}]}}),experimentalServicesRoutableProperties={mount:experimentalServicesMountSchema,routePrefix:{type:"string",minLength:1,maxLength:512},subdomain:{type:"string",minLength:1,maxLength:63}},getExperimentalServicesServiceConfigSchema=()=>({oneOf:[{type:"object",additionalProperties:!1,properties:{...getExperimentalServicesCommonProperties(),...experimentalServicesRoutableProperties,type:{enum:["web"]}}},{type:"object",additionalProperties:!1,required:["type","trigger","schedule"],properties:{...getExperimentalServicesCommonProperties(),type:{const:"job"},trigger:{const:"schedule"},schedule:experimentalServiceScheduleSchema}},{type:"object",additionalProperties:!1,required:["type","trigger","topics"],properties:{...getExperimentalServicesCommonProperties(),type:{const:"job"},trigger:{const:"queue"},topics:experimentalServiceTopicsSchema,consumer:{type:"string",minLength:1,maxLength:256}}},{type:"object",additionalProperties:!1,required:["type","trigger","entrypoint"],properties:{...getExperimentalServicesCommonProperties(),type:{const:"job"},trigger:{const:"workflow"}}},{type:"object",additionalProperties:!1,required:["type"],properties:{...getExperimentalServicesCommonProperties(),type:{const:"worker"},topics:{type:"array",items:{type:"string",minLength:1,maxLength:256},minItems:1},consumer:{type:"string",minLength:1,maxLength:256}}},{type:"object",additionalProperties:!1,required:["type","schedule"],properties:{...getExperimentalServicesCommonProperties(),type:{const:"cron"},schedule:experimentalServiceScheduleSchema}}]}),getExperimentalServicesSchema=()=>({type:"object",propertyNames:{pattern:"^[a-zA-Z]([a-zA-Z0-9_-]*[a-zA-Z0-9])?$",maxLength:64},additionalProperties:getExperimentalServicesServiceConfigSchema()}),experimentalServiceGroupsSchema={type:"object",propertyNames:{pattern:"^[a-zA-Z]([a-zA-Z0-9_-]*[a-zA-Z0-9])?$",maxLength:64},additionalProperties:{type:"array",items:{type:"string",minLength:1,maxLength:256}}},servicesPathSchema={type:"string",minLength:1,maxLength:512},servicesCommandSchema={type:"string",minLength:1,maxLength:2048},servicesBindingSchema={type:"object",additionalProperties:!1,required:["service","format","env"],properties:{type:{description:"Optional binding type marker. Currently the only supported type is `service`. When present this must be `service`.",const:"service"},service:{type:"string",minLength:1,maxLength:64,pattern:import_build_utils.SERVICE_NAME_PATTERN},format:{const:"url"},env:{type:"string",...envVarNamesSchema}}},servicesBindingsSchema={type:"array",maxItems:100,items:servicesBindingSchema},getServicesServiceConfigSchema=()=>({type:"object",additionalProperties:!1,required:["root"],properties:{root:servicesPathSchema,framework:{type:"string",minLength:1,maxLength:256},runtime:{type:"string",minLength:1,maxLength:256},entrypoint:servicesPathSchema,command:{oneOf:[{type:"string"},{type:"array",items:{type:"string"}}]},installCommand:servicesCommandSchema,buildCommand:servicesCommandSchema,devCommand:servicesCommandSchema,ignoreCommand:servicesCommandSchema,outputDirectory:servicesPathSchema,bindings:servicesBindingsSchema,functions:(0,import_build_utils.getFunctionsSchema)(),headers:import_routing_utils.headersSchema,redirects:import_routing_utils.redirectsSchema,rewrites:import_routing_utils.rewritesSchema,routes:import_routing_utils.routesSchema,cleanUrls:import_routing_utils.cleanUrlsSchema,trailingSlash:import_routing_utils.trailingSlashSchema}}),daemonConfigSchema={type:"object",additionalProperties:!1,required:["root","entrypoint"],anyOf:[{required:["instances"]},{required:["replicas"]}],properties:{root:servicesPathSchema,entrypoint:servicesPathSchema,command:{type:"array",minItems:1,maxItems:128,items:{type:"string",minLength:1,maxLength:4096}},instances:{type:"object",additionalProperties:{type:"integer",minimum:0}},replicas:{description:"Deprecated. Use `instances`. Ignored when `instances` is set.",deprecated:!0,type:"object",additionalProperties:{type:"integer",minimum:0}},resources:{type:"object",additionalProperties:!1,required:["requests"],properties:{requests:{type:"object",additionalProperties:!1,required:["memory"],properties:{memory:{enum:["1Gi","2Gi","4Gi","8Gi"]}}}}},terminationGracePeriodSeconds:{type:"integer",minimum:0},livenessProbe:{type:"object",additionalProperties:!1,required:["httpGet"],properties:{httpGet:{type:"object",additionalProperties:!1,required:["port"],properties:{path:{type:"string",minLength:1},port:{type:"integer",minimum:1,maximum:65535},host:{type:"string",minLength:1},scheme:{enum:["HTTP","HTTPS"]},httpHeaders:{type:"array",items:{type:"object",additionalProperties:!1,required:["name","value"],properties:{name:{type:"string",minLength:1},value:{type:"string"}}}}}},initialDelaySeconds:{type:"integer",minimum:0,maximum:86400},periodSeconds:{type:"integer",minimum:1,maximum:86400},timeoutSeconds:{type:"integer",minimum:1,maximum:86400},successThreshold:{type:"integer",minimum:1,maximum:10},failureThreshold:{type:"integer",minimum:1,maximum:10}}},bindings:{...servicesBindingsSchema,items:{...servicesBindingSchema,required:["type",...servicesBindingSchema.required]}}}},getServicesSchema=()=>({type:"object",propertyNames:{pattern:import_build_utils.SERVICE_NAME_PATTERN,maxLength:64},additionalProperties:getServicesServiceConfigSchema()}),maxDaemons=100,daemonsSchema={type:"object",maxProperties:maxDaemons,propertyNames:{pattern:import_build_utils.DAEMON_NAME_PATTERN,maxLength:64},additionalProperties:daemonConfigSchema},proxySchema={type:"object",additionalProperties:!1,required:["entrypoint"],properties:{entrypoint:{type:"string",minLength:1},matcher:{oneOf:[{type:"string",minLength:1},{type:"array",minItems:1,items:{type:"string",minLength:1}}]}}};function buildVercelConfigSchema(){return{type:"object",additionalProperties:!0,properties:{builds:import_build_utils.buildsSchema,routes:import_routing_utils.routesSchema,cleanUrls:import_routing_utils.cleanUrlsSchema,headers:import_routing_utils.headersSchema,redirects:import_routing_utils.redirectsSchema,rewrites:import_routing_utils.rewritesSchema,trailingSlash:import_routing_utils.trailingSlashSchema,functions:(0,import_build_utils.getFunctionsSchema)(),images:imagesSchema,crons:cronsSchema,schedules:schedulesSchema,bunVersion:{type:"string"},proxy:proxySchema,experimentalServices:getExperimentalServicesSchema(),experimentalServiceGroups:experimentalServiceGroupsSchema,services:getServicesSchema(),experimentalServicesV2:getServicesSchema(),daemons:daemonsSchema}}}var isDockerfilePath=path=>/(docker|container)file/i.test(path.split(/[\\/]/).pop()??"");function validateConfig(config){let validate=getConfigValidator(buildVercelConfigSchema);if(!validate(config)&&validate.errors&&validate.errors[0]){let error=validate.errors[0],fileName=config[import_types.fileNameSymbol]||"vercel.json",niceError=(0,import_build_utils.getPrettyError)(error);return niceError.message=`Invalid ${fileName} - ${niceError.message}`,niceError}let serviceNames=new Set([...Object.keys(config.services??{}),...Object.keys(config.daemons??{})]),invalidCommand=message=>new import_build_utils.NowBuildError({code:"INVALID_SCHEDULE_COMMAND",message:`Invalid ${config[import_types.fileNameSymbol]||"vercel.json"} - ${message}`});for(let[name,schedule]of Object.entries(config.schedules??{})){let path=`schedules.${name}`;if("command"in schedule){if(!isDockerfilePath(schedule.entrypoint))return invalidCommand(`\`${path}.command\` requires a Dockerfile or Containerfile \`entrypoint\`.`);if(name.length>64||!new RegExp(import_build_utils.SERVICE_NAME_PATTERN).test(name))return invalidCommand(`\`${path}\` runs a command, so its name must be a valid service name: lowercase letters, \`-\` and \`_\`, at most 64 characters.`);if(serviceNames.has(name))return invalidCommand(`\`${path}\` runs a command as service "${name}", which is already the name of a service or daemon.`)}if(schedule.timezone!==void 0)try{if(!/^[A-Za-z][A-Za-z0-9_+/-]*$/.test(schedule.timezone))throw new RangeError("Expected a named timezone");new Intl.DateTimeFormat("en-US",{timeZone:schedule.timezone})}catch{return new import_build_utils.NowBuildError({code:"INVALID_SCHEDULE_TIMEZONE",message:`Invalid ${config[import_types.fileNameSymbol]||"vercel.json"} - \`schedules.${name}.timezone\` must be a valid IANA timezone, such as "America/New_York". Omit it to use UTC.`})}}let functionMaps=[config.functions,...Object.values(config.services??{}).map(service=>service.functions),...Object.values(config.experimentalServicesV2??{}).map(service=>service.functions)];for(let functions of functionMaps)for(let[pattern,fn]of Object.entries(functions??{})){let regions=[...new Set(fn.regions)];if(fn.affinity?.mode==="strict"&&(regions.includes("all")||regions.length>1))return new import_build_utils.NowBuildError({code:"INVALID_FUNCTION_AFFINITY_REGIONS",message:`Function affinity mode "strict" requires at most one statically configured region. Update \`functions[${JSON.stringify(pattern)}].regions\` to contain a single region.`,link:"https://vercel.com/docs/concepts/projects/project-configuration#functions"})}if(config.proxy){let proxyError=(0,import_fs_detectors.validateProxyConfig)(config.proxy);if(proxyError)return new import_build_utils.NowBuildError({code:proxyError.code.toUpperCase(),message:proxyError.message})}if(config.functions&&config.builds)return new import_build_utils.NowBuildError({code:"FUNCTIONS_AND_BUILDS",message:"The `functions` property cannot be used in conjunction with the `builds` property. Please remove one of them.",link:"https://vercel.link/functions-and-builds"});if(config.proxy&&config.builds)return new import_build_utils.NowBuildError({code:"PROXY_AND_BUILDS",message:"The `proxy` property cannot be used with the `builds` property. Remove `builds` to use an explicit proxy entrypoint."});let hasExperimentalServices=!!config.experimentalServices;if(hasExperimentalServices&&config.builds)return new import_build_utils.NowBuildError({code:"EXPERIMENTAL_SERVICES_AND_BUILDS",message:"The `experimentalServices` property cannot be used in conjunction with the `builds` property. Please remove one of them."});if(hasExperimentalServices&&config.functions)return new import_build_utils.NowBuildError({code:"EXPERIMENTAL_SERVICES_AND_FUNCTIONS",message:"The `experimentalServices` property cannot be used in conjunction with the `functions` property. Please remove one of them."});if(config.experimentalServiceGroups&&!config.experimentalServices)return new import_build_utils.NowBuildError({code:"SERVICE_GROUPS_WITHOUT_SERVICES",message:"The `experimentalServiceGroups` property requires `experimentalServices` to be defined. Service groups reference services by name."});let hasServices=config.services!=null,hasExperimentalServicesV2=config.experimentalServicesV2!=null;if(hasServices&&hasExperimentalServicesV2)return new import_build_utils.NowBuildError({code:"SERVICES_AND_EXPERIMENTAL_SERVICES_V2",message:"The `services` property cannot be used in conjunction with its deprecated alias `experimentalServicesV2`. Please use only `services`."});let servicesConfig=config.services??config.experimentalServicesV2,servicesConfigKey=hasServices?"services":"experimentalServicesV2",servicesErrorCodePrefix=hasServices?"SERVICES":"EXPERIMENTAL_SERVICES_V2";if(servicesConfig&&hasExperimentalServices)return new import_build_utils.NowBuildError({code:`${servicesErrorCodePrefix}_AND_EXPERIMENTAL_SERVICES`,message:`The \`${servicesConfigKey}\` property cannot be used in conjunction with the \`experimentalServices\` property. Please use only one services configuration.`});if(servicesConfig&&config.builds)return new import_build_utils.NowBuildError({code:`${servicesErrorCodePrefix}_AND_BUILDS`,message:`The \`${servicesConfigKey}\` property cannot be used in conjunction with the \`builds\` property. Please remove one of them.`});if(servicesConfig){let ambiguousTopLevel=[];if(config.functions!=null&&ambiguousTopLevel.push("functions"),config.installCommand!=null&&ambiguousTopLevel.push("installCommand"),config.buildCommand!=null&&ambiguousTopLevel.push("buildCommand"),config.devCommand!=null&&ambiguousTopLevel.push("devCommand"),config.ignoreCommand!=null&&ambiguousTopLevel.push("ignoreCommand"),config.outputDirectory!=null&&ambiguousTopLevel.push("outputDirectory"),config.framework!=null&&ambiguousTopLevel.push("framework"),ambiguousTopLevel.length>0){let count=ambiguousTopLevel.length,fields=ambiguousTopLevel.map(field=>`\`${field}\``).join(", ");return new import_build_utils.NowBuildError({code:`${servicesErrorCodePrefix}_AND_TOP_LEVEL_BUILD_SETTINGS`,message:`The top-level ${count>1?"properties":"property"} ${fields} cannot be used with \`${servicesConfigKey}\` because the owning service is ambiguous. Move ${count>1?"them":"it"} under the relevant service in \`${servicesConfigKey}\`.`})}}if(config.daemons){let daemonError=validateDaemons(config,config.daemons);if(daemonError)return daemonError}if(servicesConfig){let serviceNames2=new Set(Object.keys(servicesConfig));for(let[serviceName,serviceConfig]of Object.entries(servicesConfig))for(let binding of serviceConfig.bindings??[])if(!serviceNames2.has(binding.service))return new import_build_utils.NowBuildError({code:`${servicesErrorCodePrefix}_BINDING_UNKNOWN_SERVICE`,message:`Service "${serviceName}" declares a binding to unknown service "${binding.service}". Add "${binding.service}" to \`${servicesConfigKey}\` or fix the binding.`})}return null}function validateDaemons(config,daemons){let invalid=message=>new import_build_utils.NowBuildError({code:"INVALID_DAEMON",message}),daemonNames=new Set(Object.keys(daemons));for(let[name,daemon]of Object.entries(daemons))if(!isDockerfilePath(daemon.entrypoint))return invalid(`Daemon "${name}" must set \`entrypoint\` to a Dockerfile or Containerfile.`);let services={...config.experimentalServicesV2,...config.services},isDaemonTarget=name=>daemonNames.has(name)&&!Object.prototype.hasOwnProperty.call(services,name);for(let[name,service]of Object.entries(services)){let binding=service.bindings?.find(binding2=>isDaemonTarget(binding2.service));if(binding)return invalid(`Service "${name}" cannot bind to daemon "${binding.service}" because daemons do not receive traffic.`)}for(let[name,daemon]of Object.entries(daemons)){let envs=new Set;for(let binding of daemon.bindings??[]){if(!Object.prototype.hasOwnProperty.call(services,binding.service))return invalid(`Daemon "${name}" declares a binding to unknown service "${binding.service}". Add "${binding.service}" to \`services\` or fix the binding.`);if(envs.has(binding.env))return invalid(`Daemon "${name}" declares more than one binding for the environment variable "${binding.env}".`);envs.add(binding.env)}}let destinations=[...config.rewrites??[],...config.routes??[],...Object.values(services).flatMap(service=>[...service.rewrites??[],...service.routes??[]])].map(entry=>"destination"in entry?entry.destination:void 0);for(let destination of destinations)if(typeof destination=="object"&&destination!==null&&isDaemonTarget(destination.service))return invalid(`Rewrites and routes cannot target daemon "${destination.service}" because daemons do not receive traffic.`);return null}export{require_dist3 as require_dist,validateConfig};
|
|
@@ -4,7 +4,7 @@ import { dirname as __dirname_ } from 'node:path';
|
|
|
4
4
|
const require = __createRequire(import.meta.url);
|
|
5
5
|
const __filename = __fileURLToPath(import.meta.url);
|
|
6
6
|
const __dirname = __dirname_(__filename);
|
|
7
|
-
import{getResolvedOrderMetadata,getRollupColumnName}from"./chunk-CC6FLKIP.js";import{formatGranularity}from"./chunk-IVSSTHB6.js";import{ellipsizeMiddle}from"./chunk-ID663OJ7.js";import{elapsed}from"./chunk-Q7D7RGXM.js";import{indent_default}from"./chunk-GZNDA6SV.js";import{table}from"./chunk-773GOZIR.js";import{require_ms}from"./chunk-MXTC4ZAQ.js";import{require_source}from"./chunk-NB2WLB3J.js";import{__toESM}from"./chunk-BZENIQ7N.js";var CANONICAL_AGGREGATIONS=["count","sum","avg","min","max","p50","p75","p90","p95","p99","stddev"];function isCanonicalAggregation(aggregation){return CANONICAL_AGGREGATIONS.includes(aggregation)}var DURATION_UNITS=new Set(["nanoseconds","microseconds","milliseconds","seconds","minutes","hours","days"]);function normalizeMetricUnit(unit){return unit.trim().toLowerCase().replace(/[_\s]+/g," ")}function getPreferredCustomMetricAggregation(unit){let normalizedUnit=normalizeMetricUnit(unit);return DURATION_UNITS.has(normalizedUnit)?"p75":normalizedUnit==="percent"?"avg":"sum"}function getDefaultCustomMetricAggregation(unit,aggregations){let preferredAggregation=getPreferredCustomMetricAggregation(unit);return aggregations?.includes(preferredAggregation)?preferredAggregation:aggregations?.includes("sum")?"sum":aggregations?.find(isCanonicalAggregation)}var import_ms=__toESM(require_ms(),1),MINUTE_MS=60*1e3,HOUR_MS=60*MINUTE_MS,DAY_MS=24*HOUR_MS;function toGranularityDuration(input){let milliseconds=(0,import_ms.default)(input);if(milliseconds===void 0)throw new Error(`Invalid granularity format "${input}". Use 1m, 5m, 15m, 1h, 4h, 1d.`);return milliseconds>=DAY_MS?{days:milliseconds/DAY_MS}:milliseconds>=HOUR_MS?{hours:milliseconds/HOUR_MS}:{minutes:milliseconds/MINUTE_MS}}function toGranularityMs(input){let milliseconds=(0,import_ms.default)(input);if(milliseconds===void 0)throw new Error(`Invalid granularity format "${input}".`);return milliseconds}var GRANULARITY_THRESHOLDS=[[1*HOUR_MS,"1m","1m"],[2*HOUR_MS,"5m","5m"],[12*HOUR_MS,"15m","5m"],[3*DAY_MS,"1h","1h"],[30*DAY_MS,"4h","4h"]],FALLBACK_GRANULARITY="1d";function getAutoGranularity(rangeMs){for(let[maxRange,defaultG]of GRANULARITY_THRESHOLDS)if(rangeMs<=maxRange)return defaultG;return FALLBACK_GRANULARITY}function getMinGranularity(rangeMs){for(let[maxRange,,minG]of GRANULARITY_THRESHOLDS)if(rangeMs<=maxRange)return minG;return FALLBACK_GRANULARITY}function computeGranularity(rangeMs,explicit){if(!explicit){let auto=getAutoGranularity(rangeMs);return{duration:toGranularityDuration(auto),adjusted:!1}}let minG=getMinGranularity(rangeMs),explicitMs=toGranularityMs(explicit),minMs=toGranularityMs(minG);if(explicitMs<minMs){let rangeDays=Math.round(rangeMs/DAY_MS),rangeHours=Math.round(rangeMs/HOUR_MS),rangeLabel=rangeDays>=1?`${rangeDays}-day`:`${rangeHours}-hour`;return{duration:toGranularityDuration(minG),adjusted:!0,notice:`Granularity adjusted from ${explicit} to ${minG} for a ${rangeLabel} time range.`}}return{duration:toGranularityDuration(explicit),adjusted:!1}}function toGranularityMsFromDuration(duration){return"minutes"in duration?duration.minutes*MINUTE_MS:"hours"in duration?duration.hours*HOUR_MS:duration.days*DAY_MS}var import_chalk=__toESM(require_source(),1);var GROUP_KEY_DELIMITER="",MAX_SPARKLINE_LENGTH=120,DURATION_SCALE_MS={seconds:1e3,minutes:6e4,hours:36e5,days:864e5},BYTE_SCALE={bytes:1,kilobytes:1e3,megabytes:1e6,gigabytes:1e9,terabytes:1e12,petabytes:1e15},COMPACT_NUMBER_FORMATTER=new Intl.NumberFormat("en-US",{notation:"compact",compactDisplay:"short"}),TWO_FRACTION_NUMBER_FORMATTER=new Intl.NumberFormat("en-US",{maximumFractionDigits:2}),TWO_SIGNIFICANT_NUMBER_FORMATTER=new Intl.NumberFormat("en-US",{minimumSignificantDigits:2,maximumSignificantDigits:2,maximumFractionDigits:2}),PERCENTAGE_FORMATTER=new Intl.NumberFormat("en-US",{style:"unit",unit:"percent",unitDisplay:"narrow",maximumFractionDigits:1}),USD_FORMATTER=new Intl.NumberFormat("en-US",{style:"currency",currency:"USD",minimumFractionDigits:2,maximumFractionDigits:2}),BLOCKS=["\u2581","\u2582","\u2583","\u2584","\u2585","\u2586","\u2587","\u2588"],MISSING_CHAR="\xB7";function isAggregationWithDimension(aggregation){let[,dimension]=aggregation.split("/");return!!dimension}function toGroupKey(groupValues){return groupValues.length===0?"":groupValues.join(GROUP_KEY_DELIMITER)}function pad2(n){return String(n).padStart(2,"0")}function pad4(n){return String(n).padStart(4,"0")}function formatHumanMinute(date){return`${pad4(date.getUTCFullYear())}-${pad2(date.getUTCMonth()+1)}-${pad2(date.getUTCDate())} ${pad2(date.getUTCHours())}:${pad2(date.getUTCMinutes())}`}function formatPeriodBound(input){let date=new Date(input);return isNaN(date.getTime())?input:formatHumanMinute(date)}function formatPeriodSpan(startInput,endInput){let start=Date.parse(startInput),durationMs=Date.parse(endInput)-start;return!Number.isFinite(durationMs)||durationMs<=0?null:elapsed(durationMs)}function getStatColumns(aggregation){return aggregation==="sum"||aggregation==="count"?["total","avg","min","max"]:["avg","min","max"]}function toNumericValue(value){if(value==null)return null;if(typeof value=="number")return Number.isFinite(value)?value:null;let parsed=Number(value);return Number.isFinite(parsed)?parsed:null}function isNonNullNumber(value){return value!==null}function isPointWithValue(point){return point.value!==null}function getOrCreate(map,key,make){let existing=map.get(key);if(existing!==void 0)return existing;let created=make();return map.set(key,created),created}function getGroupFieldValue(row,field){let value=row[field];return value==null||value===""?"(not set)":String(value)}function normalizeTimestampToIso(timestamp){let parsed=Date.parse(timestamp);return isNaN(parsed)?null:new Date(parsed).toISOString()}function formatStatCell(column,stats,periodStart,periodEnd,formatValue){switch(column){case"total":return formatValue(stats.total);case"avg":return formatValue(stats.avg,{preserveFractionalCount:!0});case"min":{let ts=formatMinMaxTimestamp(new Date(stats.min.timestamp),periodStart,periodEnd);return`${formatValue(stats.min.value)} at ${ts}`}case"max":{let ts=formatMinMaxTimestamp(new Date(stats.max.timestamp),periodStart,periodEnd);return`${formatValue(stats.max.value)} at ${ts}`}}}function buildExpectedTimestamps(periodStart,periodEnd,granularityMs){let start=Date.parse(periodStart),end=Date.parse(periodEnd);if(isNaN(start)||isNaN(end)||granularityMs<=0||end<=start)return[];let timestamps=[];for(let current=start;current<end;current+=granularityMs)timestamps.push(new Date(current).toISOString());return timestamps}function buildObservedTimestamps(observedTimestamps,granularityMs){let timestamps=[...observedTimestamps].map(timestamp=>Date.parse(timestamp)).filter(Number.isFinite).sort((a,b)=>a-b);if(timestamps.length===0||granularityMs<=0)return[];let start=timestamps[0],end=timestamps[timestamps.length-1]+granularityMs;return buildExpectedTimestamps(new Date(start).toISOString(),new Date(end).toISOString(),granularityMs)}function buildSeriesTimestamps(periodStart,periodEnd,granularityMs,observedTimestamps){let expectedTimestamps=buildExpectedTimestamps(periodStart,periodEnd,granularityMs);return observedTimestamps.size===0||expectedTimestamps.some(timestamp=>observedTimestamps.has(timestamp))?expectedTimestamps:buildObservedTimestamps(observedTimestamps,granularityMs)}function formatCount(n){return Math.round(n).toLocaleString("en-US")}function formatDecimal(n){if(!Number.isFinite(n))return String(n);if(n===0||Object.is(n,-0))return"0";let sign=n<0?"-":"",abs=Math.abs(n);if(abs>=1)return`${sign}${abs.toFixed(1)}`;let exponent=Math.floor(Math.log10(abs)),decimals=Math.min(20,Math.max(2,-exponent+1)),trimmed=abs.toFixed(decimals).replace(/(\.\d*?[1-9])0+$/,"$1").replace(/\.0+$/,"").replace(/\.$/,"");return`${sign}${trimmed}`}function formatDuration(durationMs){let durationSeconds=durationMs/1e3;return durationMs<1e3?`${durationMs.toFixed(0)}ms`:durationMs<5e3?`${Math.round(durationSeconds*100)/100}s`:durationSeconds<60?`${durationSeconds.toFixed(0)}s`:durationSeconds<3600?`${(durationSeconds/60).toFixed(0)}m`:`${(durationSeconds/3600).toFixed(0)}h`}function formatBytes(bytes){if(bytes===0)return"0 Bytes";let units=["Bytes","KB","MB","GB","TB","PB"],absoluteBytes=Math.abs(bytes),unitIndex=Math.min(units.length-1,Math.max(0,Math.floor(Math.log(absoluteBytes)/Math.log(1e3)))),value=bytes/1e3**unitIndex;return(unitIndex===1||unitIndex===2)&&(value=Math.round(value),Math.abs(value)===1e3&&unitIndex<units.length-1&&(value/=1e3,unitIndex+=1)),`${TWO_FRACTION_NUMBER_FORMATTER.format(value)} ${units[unitIndex]}`}function formatMetricValue(value,baseUnit,aggregation,opts){let formatCountValue=()=>opts?.preserveFractionalCount&&!Number.isInteger(value)?formatDecimal(value):formatCount(value);if(isAggregationWithDimension(aggregation)||aggregation==="count")return formatCountValue();let unit=normalizeMetricUnit(baseUnit??"units");if(aggregation==="percent"||unit==="percent")return PERCENTAGE_FORMATTER.format(value);if(aggregation==="unique")return COMPACT_NUMBER_FORMATTER.format(value);let withRateSuffix=formatted2=>aggregation==="persecond"?`${formatted2}/s`:formatted2;if(unit==="milliseconds")return withRateSuffix(formatDuration(value));let durationScale=DURATION_SCALE_MS[unit];if(durationScale)return withRateSuffix(formatDuration(value*durationScale));if(unit==="nanoseconds"||unit==="microseconds"){let suffix=unit==="nanoseconds"?" ns":" \xB5s",formatted2=TWO_FRACTION_NUMBER_FORMATTER.format(value);return withRateSuffix(`${formatted2}${suffix}`)}let byteScale=BYTE_SCALE[unit];if(byteScale)return withRateSuffix(formatBytes(value*byteScale));if(unit==="gigabyte hour"||unit==="gigabyte hours"){let formatted2=TWO_SIGNIFICANT_NUMBER_FORMATTER.format(value);return withRateSuffix(`${formatted2} GB-hrs`)}if(unit==="usd"||unit==="us dollars"||unit==="dollars")return withRateSuffix(USD_FORMATTER.format(value));if(unit==="count"&&aggregation==="sum")return formatCountValue();let formatted=COMPACT_NUMBER_FORMATTER.format(value),unitLabel=baseUnit?.trim();return withRateSuffix(!unitLabel||unit==="units"||unit==="count"||unit==="ratio"?formatted:`${formatted} ${unitLabel}`)}function formatMinMaxTimestamp(date,periodStart,periodEnd){return periodStart.getUTCFullYear()===periodEnd.getUTCFullYear()&&periodStart.getUTCMonth()===periodEnd.getUTCMonth()&&periodStart.getUTCDate()===periodEnd.getUTCDate()?`${pad2(date.getUTCHours())}:${pad2(date.getUTCMinutes())}`:periodStart.getUTCFullYear()===periodEnd.getUTCFullYear()?`${pad2(date.getUTCMonth()+1)}-${pad2(date.getUTCDate())} ${pad2(date.getUTCHours())}:${pad2(date.getUTCMinutes())}`:`${pad4(date.getUTCFullYear())}-${pad2(date.getUTCMonth()+1)}-${pad2(date.getUTCDate())} ${pad2(date.getUTCHours())}:${pad2(date.getUTCMinutes())}`}function extractGroupedSeries(data,groupBy,rollupColumn,periodStart,periodEnd,granularityMs){let groups=[],groupValues=new Map,valueByGroup=new Map,observedTimestamps=new Set;for(let row of data){let values=groupBy.map(field=>getGroupFieldValue(row,field)),key=toGroupKey(values);groupValues.has(key)||(groups.push(key),groupValues.set(key,values));let groupMap=getOrCreate(valueByGroup,key,()=>new Map),rawTimestamp=row.timestamp;if(rawTimestamp.length===0)continue;let timestamp=normalizeTimestampToIso(rawTimestamp);if(!timestamp)continue;observedTimestamps.add(timestamp);let numeric=toNumericValue(row[rollupColumn]);groupMap.set(timestamp,numeric)}let expectedTimestamps=buildSeriesTimestamps(periodStart,periodEnd,granularityMs,observedTimestamps),series=new Map;for(let key of groups){let byTimestamp=valueByGroup.get(key);if(!byTimestamp)continue;let points=expectedTimestamps.map(timestamp=>({timestamp,value:byTimestamp.has(timestamp)?byTimestamp.get(timestamp)??null:null}));series.set(key,points)}return{groups,series,groupValues}}function computeGroupStats(points){let present=points.filter(isPointWithValue);if(present.length===0)return{total:0,avg:0,min:{value:0,timestamp:""},max:{value:0,timestamp:""},count:0,allMissing:!0};let total=0,min=present[0],max=present[0];for(let point of present)total+=point.value,point.value<min.value&&(min=point),point.value>max.value&&(max=point);return{total,avg:total/present.length,min:{value:min.value,timestamp:min.timestamp},max:{value:max.value,timestamp:max.timestamp},count:present.length,allMissing:!1}}var MAX_GROUP_VALUE_LENGTH=60;function downsample(values,maxLen){if(maxLen<=0)return[];if(values.length<=maxLen)return[...values];let result=[];for(let i=0;i<maxLen;i++){let start=Math.floor(i*values.length/maxLen),end=Math.floor((i+1)*values.length/maxLen),bucket=values.slice(start,Math.max(start+1,end)),nullCount=bucket.filter(value=>value===null).length;if(nullCount===bucket.length||nullCount>bucket.length/2){result.push(null);continue}let present=bucket.filter(isNonNullNumber),avg=present.reduce((sum,value)=>sum+value,0)/present.length;result.push(avg)}return result}function generateSparkline(values){let sampled=downsample(values,MAX_SPARKLINE_LENGTH);if(sampled.length===0)return"";let present=sampled.filter(isNonNullNumber);if(present.length===0)return sampled.map(()=>MISSING_CHAR).join("");let min=Math.min(...present),max=Math.max(...present);if(min===max){let block=min===0?BLOCKS[0]:BLOCKS[BLOCKS.length-1];return sampled.map(value=>value===null?MISSING_CHAR:block).join("")}let range=max-min;return sampled.map(value=>{if(value===null)return MISSING_CHAR;let ratio=(value-min)/range,index=Math.max(0,Math.min(BLOCKS.length-1,Math.round(ratio*(BLOCKS.length-1))));return BLOCKS[index]}).join("")}function formatMetadataHeader(opts){let periodSpan=opts.compact?formatPeriodSpan(opts.periodStart,opts.periodEnd):null,rows=[];return opts.compact||rows.push({key:"Metric",value:`${opts.metric} ${opts.aggregation}`}),rows.push({key:"Period",value:`${formatPeriodBound(opts.periodStart)} to ${formatPeriodBound(opts.periodEnd)} (UTC)${periodSpan?` ${periodSpan}`:""}`},{key:"Interval",value:"days"in opts.granularity?`${formatGranularity(opts.granularity)} (${opts.bucketTimezone??"UTC"})`:formatGranularity(opts.granularity)}),typeof opts.periodUnique=="number"&&rows.push({key:"Unique (period)",value:formatCount(opts.periodUnique)}),!opts.compact&&opts.filter&&rows.push({key:"Filter",value:opts.filter}),!opts.compact&&opts.orderBy&&opts.orderDirection&&rows.push({key:"Order By",value:`${opts.orderBy} ${opts.orderDirection}${opts.orderBy==="count"?" (default)":""}`}),opts.scope.type==="project"?rows.push({key:"Project",value:`${opts.projectName??opts.scope.projectIds[0]} (${opts.teamName??opts.scope.ownerId})`}):rows.push({key:"Team",value:`${opts.teamName??opts.scope.ownerId} (all projects)`}),!opts.compact&&typeof opts.groupCount=="number"&&rows.push({key:"Groups",value:String(opts.groupCount)}),rows.map(row=>`> ${import_chalk.default.gray(`${row.key}:`)} ${row.value}`).join(`
|
|
7
|
+
import{getResolvedOrderMetadata,getRollupColumnName}from"./chunk-AIRQFG5A.js";import{formatGranularity}from"./chunk-IVSSTHB6.js";import{indent_default}from"./chunk-GZNDA6SV.js";import{ellipsizeMiddle}from"./chunk-ID663OJ7.js";import{table}from"./chunk-5SIC5273.js";import{elapsed}from"./chunk-Q7D7RGXM.js";import{require_ms}from"./chunk-MXTC4ZAQ.js";import{require_source}from"./chunk-NB2WLB3J.js";import{__toESM}from"./chunk-BZENIQ7N.js";var CANONICAL_AGGREGATIONS=["count","sum","avg","min","max","p50","p75","p90","p95","p99","stddev"];function isCanonicalAggregation(aggregation){return CANONICAL_AGGREGATIONS.includes(aggregation)}var DURATION_UNITS=new Set(["nanoseconds","microseconds","milliseconds","seconds","minutes","hours","days"]);function normalizeMetricUnit(unit){return unit.trim().toLowerCase().replace(/[_\s]+/g," ")}function getPreferredCustomMetricAggregation(unit){let normalizedUnit=normalizeMetricUnit(unit);return DURATION_UNITS.has(normalizedUnit)?"p75":normalizedUnit==="percent"?"avg":"sum"}function getDefaultCustomMetricAggregation(unit,aggregations){let preferredAggregation=getPreferredCustomMetricAggregation(unit);return aggregations?.includes(preferredAggregation)?preferredAggregation:aggregations?.includes("sum")?"sum":aggregations?.find(isCanonicalAggregation)}var import_ms=__toESM(require_ms(),1),MINUTE_MS=60*1e3,HOUR_MS=60*MINUTE_MS,DAY_MS=24*HOUR_MS;function toGranularityDuration(input){let milliseconds=(0,import_ms.default)(input);if(milliseconds===void 0)throw new Error(`Invalid granularity format "${input}". Use 1m, 5m, 15m, 1h, 4h, 1d.`);return milliseconds>=DAY_MS?{days:milliseconds/DAY_MS}:milliseconds>=HOUR_MS?{hours:milliseconds/HOUR_MS}:{minutes:milliseconds/MINUTE_MS}}function toGranularityMs(input){let milliseconds=(0,import_ms.default)(input);if(milliseconds===void 0)throw new Error(`Invalid granularity format "${input}".`);return milliseconds}var GRANULARITY_THRESHOLDS=[[1*HOUR_MS,"1m","1m"],[2*HOUR_MS,"5m","5m"],[12*HOUR_MS,"15m","5m"],[3*DAY_MS,"1h","1h"],[30*DAY_MS,"4h","4h"]],FALLBACK_GRANULARITY="1d";function getAutoGranularity(rangeMs){for(let[maxRange,defaultG]of GRANULARITY_THRESHOLDS)if(rangeMs<=maxRange)return defaultG;return FALLBACK_GRANULARITY}function getMinGranularity(rangeMs){for(let[maxRange,,minG]of GRANULARITY_THRESHOLDS)if(rangeMs<=maxRange)return minG;return FALLBACK_GRANULARITY}function computeGranularity(rangeMs,explicit){if(!explicit){let auto=getAutoGranularity(rangeMs);return{duration:toGranularityDuration(auto),adjusted:!1}}let minG=getMinGranularity(rangeMs),explicitMs=toGranularityMs(explicit),minMs=toGranularityMs(minG);if(explicitMs<minMs){let rangeDays=Math.round(rangeMs/DAY_MS),rangeHours=Math.round(rangeMs/HOUR_MS),rangeLabel=rangeDays>=1?`${rangeDays}-day`:`${rangeHours}-hour`;return{duration:toGranularityDuration(minG),adjusted:!0,notice:`Granularity adjusted from ${explicit} to ${minG} for a ${rangeLabel} time range.`}}return{duration:toGranularityDuration(explicit),adjusted:!1}}function toGranularityMsFromDuration(duration){return"minutes"in duration?duration.minutes*MINUTE_MS:"hours"in duration?duration.hours*HOUR_MS:duration.days*DAY_MS}var import_chalk=__toESM(require_source(),1);var GROUP_KEY_DELIMITER="",MAX_SPARKLINE_LENGTH=120,DURATION_SCALE_MS={seconds:1e3,minutes:6e4,hours:36e5,days:864e5},BYTE_SCALE={bytes:1,kilobytes:1e3,megabytes:1e6,gigabytes:1e9,terabytes:1e12,petabytes:1e15},COMPACT_NUMBER_FORMATTER=new Intl.NumberFormat("en-US",{notation:"compact",compactDisplay:"short"}),TWO_FRACTION_NUMBER_FORMATTER=new Intl.NumberFormat("en-US",{maximumFractionDigits:2}),TWO_SIGNIFICANT_NUMBER_FORMATTER=new Intl.NumberFormat("en-US",{minimumSignificantDigits:2,maximumSignificantDigits:2,maximumFractionDigits:2}),PERCENTAGE_FORMATTER=new Intl.NumberFormat("en-US",{style:"unit",unit:"percent",unitDisplay:"narrow",maximumFractionDigits:1}),USD_FORMATTER=new Intl.NumberFormat("en-US",{style:"currency",currency:"USD",minimumFractionDigits:2,maximumFractionDigits:2}),BLOCKS=["\u2581","\u2582","\u2583","\u2584","\u2585","\u2586","\u2587","\u2588"],MISSING_CHAR="\xB7";function isAggregationWithDimension(aggregation){let[,dimension]=aggregation.split("/");return!!dimension}function toGroupKey(groupValues){return groupValues.length===0?"":groupValues.join(GROUP_KEY_DELIMITER)}function pad2(n){return String(n).padStart(2,"0")}function pad4(n){return String(n).padStart(4,"0")}function formatHumanMinute(date){return`${pad4(date.getUTCFullYear())}-${pad2(date.getUTCMonth()+1)}-${pad2(date.getUTCDate())} ${pad2(date.getUTCHours())}:${pad2(date.getUTCMinutes())}`}function formatPeriodBound(input){let date=new Date(input);return isNaN(date.getTime())?input:formatHumanMinute(date)}function formatPeriodSpan(startInput,endInput){let start=Date.parse(startInput),durationMs=Date.parse(endInput)-start;return!Number.isFinite(durationMs)||durationMs<=0?null:elapsed(durationMs)}function getStatColumns(aggregation){return aggregation==="sum"||aggregation==="count"?["total","avg","min","max"]:["avg","min","max"]}function toNumericValue(value){if(value==null)return null;if(typeof value=="number")return Number.isFinite(value)?value:null;let parsed=Number(value);return Number.isFinite(parsed)?parsed:null}function isNonNullNumber(value){return value!==null}function isPointWithValue(point){return point.value!==null}function getOrCreate(map,key,make){let existing=map.get(key);if(existing!==void 0)return existing;let created=make();return map.set(key,created),created}function getGroupFieldValue(row,field){let value=row[field];return value==null||value===""?"(not set)":String(value)}function normalizeTimestampToIso(timestamp){let parsed=Date.parse(timestamp);return isNaN(parsed)?null:new Date(parsed).toISOString()}function formatStatCell(column,stats,periodStart,periodEnd,formatValue){switch(column){case"total":return formatValue(stats.total);case"avg":return formatValue(stats.avg,{preserveFractionalCount:!0});case"min":{let ts=formatMinMaxTimestamp(new Date(stats.min.timestamp),periodStart,periodEnd);return`${formatValue(stats.min.value)} at ${ts}`}case"max":{let ts=formatMinMaxTimestamp(new Date(stats.max.timestamp),periodStart,periodEnd);return`${formatValue(stats.max.value)} at ${ts}`}}}function buildExpectedTimestamps(periodStart,periodEnd,granularityMs){let start=Date.parse(periodStart),end=Date.parse(periodEnd);if(isNaN(start)||isNaN(end)||granularityMs<=0||end<=start)return[];let timestamps=[];for(let current=start;current<end;current+=granularityMs)timestamps.push(new Date(current).toISOString());return timestamps}function buildObservedTimestamps(observedTimestamps,granularityMs){let timestamps=[...observedTimestamps].map(timestamp=>Date.parse(timestamp)).filter(Number.isFinite).sort((a,b)=>a-b);if(timestamps.length===0||granularityMs<=0)return[];let start=timestamps[0],end=timestamps[timestamps.length-1]+granularityMs;return buildExpectedTimestamps(new Date(start).toISOString(),new Date(end).toISOString(),granularityMs)}function buildSeriesTimestamps(periodStart,periodEnd,granularityMs,observedTimestamps){let expectedTimestamps=buildExpectedTimestamps(periodStart,periodEnd,granularityMs);return observedTimestamps.size===0||expectedTimestamps.some(timestamp=>observedTimestamps.has(timestamp))?expectedTimestamps:buildObservedTimestamps(observedTimestamps,granularityMs)}function formatCount(n){return Math.round(n).toLocaleString("en-US")}function formatDecimal(n){if(!Number.isFinite(n))return String(n);if(n===0||Object.is(n,-0))return"0";let sign=n<0?"-":"",abs=Math.abs(n);if(abs>=1)return`${sign}${abs.toFixed(1)}`;let exponent=Math.floor(Math.log10(abs)),decimals=Math.min(20,Math.max(2,-exponent+1)),trimmed=abs.toFixed(decimals).replace(/(\.\d*?[1-9])0+$/,"$1").replace(/\.0+$/,"").replace(/\.$/,"");return`${sign}${trimmed}`}function formatDuration(durationMs){let durationSeconds=durationMs/1e3;return durationMs<1e3?`${durationMs.toFixed(0)}ms`:durationMs<5e3?`${Math.round(durationSeconds*100)/100}s`:durationSeconds<60?`${durationSeconds.toFixed(0)}s`:durationSeconds<3600?`${(durationSeconds/60).toFixed(0)}m`:`${(durationSeconds/3600).toFixed(0)}h`}function formatBytes(bytes){if(bytes===0)return"0 Bytes";let units=["Bytes","KB","MB","GB","TB","PB"],absoluteBytes=Math.abs(bytes),unitIndex=Math.min(units.length-1,Math.max(0,Math.floor(Math.log(absoluteBytes)/Math.log(1e3)))),value=bytes/1e3**unitIndex;return(unitIndex===1||unitIndex===2)&&(value=Math.round(value),Math.abs(value)===1e3&&unitIndex<units.length-1&&(value/=1e3,unitIndex+=1)),`${TWO_FRACTION_NUMBER_FORMATTER.format(value)} ${units[unitIndex]}`}function formatMetricValue(value,baseUnit,aggregation,opts){let formatCountValue=()=>opts?.preserveFractionalCount&&!Number.isInteger(value)?formatDecimal(value):formatCount(value);if(isAggregationWithDimension(aggregation)||aggregation==="count")return formatCountValue();let unit=normalizeMetricUnit(baseUnit??"units");if(aggregation==="percent"||unit==="percent")return PERCENTAGE_FORMATTER.format(value);if(aggregation==="unique")return COMPACT_NUMBER_FORMATTER.format(value);let withRateSuffix=formatted2=>aggregation==="persecond"?`${formatted2}/s`:formatted2;if(unit==="milliseconds")return withRateSuffix(formatDuration(value));let durationScale=DURATION_SCALE_MS[unit];if(durationScale)return withRateSuffix(formatDuration(value*durationScale));if(unit==="nanoseconds"||unit==="microseconds"){let suffix=unit==="nanoseconds"?" ns":" \xB5s",formatted2=TWO_FRACTION_NUMBER_FORMATTER.format(value);return withRateSuffix(`${formatted2}${suffix}`)}let byteScale=BYTE_SCALE[unit];if(byteScale)return withRateSuffix(formatBytes(value*byteScale));if(unit==="gigabyte hour"||unit==="gigabyte hours"){let formatted2=TWO_SIGNIFICANT_NUMBER_FORMATTER.format(value);return withRateSuffix(`${formatted2} GB-hrs`)}if(unit==="usd"||unit==="us dollars"||unit==="dollars")return withRateSuffix(USD_FORMATTER.format(value));if(unit==="count"&&aggregation==="sum")return formatCountValue();let formatted=COMPACT_NUMBER_FORMATTER.format(value),unitLabel=baseUnit?.trim();return withRateSuffix(!unitLabel||unit==="units"||unit==="count"||unit==="ratio"?formatted:`${formatted} ${unitLabel}`)}function formatMinMaxTimestamp(date,periodStart,periodEnd){return periodStart.getUTCFullYear()===periodEnd.getUTCFullYear()&&periodStart.getUTCMonth()===periodEnd.getUTCMonth()&&periodStart.getUTCDate()===periodEnd.getUTCDate()?`${pad2(date.getUTCHours())}:${pad2(date.getUTCMinutes())}`:periodStart.getUTCFullYear()===periodEnd.getUTCFullYear()?`${pad2(date.getUTCMonth()+1)}-${pad2(date.getUTCDate())} ${pad2(date.getUTCHours())}:${pad2(date.getUTCMinutes())}`:`${pad4(date.getUTCFullYear())}-${pad2(date.getUTCMonth()+1)}-${pad2(date.getUTCDate())} ${pad2(date.getUTCHours())}:${pad2(date.getUTCMinutes())}`}function extractGroupedSeries(data,groupBy,rollupColumn,periodStart,periodEnd,granularityMs){let groups=[],groupValues=new Map,valueByGroup=new Map,observedTimestamps=new Set;for(let row of data){let values=groupBy.map(field=>getGroupFieldValue(row,field)),key=toGroupKey(values);groupValues.has(key)||(groups.push(key),groupValues.set(key,values));let groupMap=getOrCreate(valueByGroup,key,()=>new Map),rawTimestamp=row.timestamp;if(rawTimestamp.length===0)continue;let timestamp=normalizeTimestampToIso(rawTimestamp);if(!timestamp)continue;observedTimestamps.add(timestamp);let numeric=toNumericValue(row[rollupColumn]);groupMap.set(timestamp,numeric)}let expectedTimestamps=buildSeriesTimestamps(periodStart,periodEnd,granularityMs,observedTimestamps),series=new Map;for(let key of groups){let byTimestamp=valueByGroup.get(key);if(!byTimestamp)continue;let points=expectedTimestamps.map(timestamp=>({timestamp,value:byTimestamp.has(timestamp)?byTimestamp.get(timestamp)??null:null}));series.set(key,points)}return{groups,series,groupValues}}function computeGroupStats(points){let present=points.filter(isPointWithValue);if(present.length===0)return{total:0,avg:0,min:{value:0,timestamp:""},max:{value:0,timestamp:""},count:0,allMissing:!0};let total=0,min=present[0],max=present[0];for(let point of present)total+=point.value,point.value<min.value&&(min=point),point.value>max.value&&(max=point);return{total,avg:total/present.length,min:{value:min.value,timestamp:min.timestamp},max:{value:max.value,timestamp:max.timestamp},count:present.length,allMissing:!1}}var MAX_GROUP_VALUE_LENGTH=60;function downsample(values,maxLen){if(maxLen<=0)return[];if(values.length<=maxLen)return[...values];let result=[];for(let i=0;i<maxLen;i++){let start=Math.floor(i*values.length/maxLen),end=Math.floor((i+1)*values.length/maxLen),bucket=values.slice(start,Math.max(start+1,end)),nullCount=bucket.filter(value=>value===null).length;if(nullCount===bucket.length||nullCount>bucket.length/2){result.push(null);continue}let present=bucket.filter(isNonNullNumber),avg=present.reduce((sum,value)=>sum+value,0)/present.length;result.push(avg)}return result}function generateSparkline(values){let sampled=downsample(values,MAX_SPARKLINE_LENGTH);if(sampled.length===0)return"";let present=sampled.filter(isNonNullNumber);if(present.length===0)return sampled.map(()=>MISSING_CHAR).join("");let min=Math.min(...present),max=Math.max(...present);if(min===max){let block=min===0?BLOCKS[0]:BLOCKS[BLOCKS.length-1];return sampled.map(value=>value===null?MISSING_CHAR:block).join("")}let range=max-min;return sampled.map(value=>{if(value===null)return MISSING_CHAR;let ratio=(value-min)/range,index=Math.max(0,Math.min(BLOCKS.length-1,Math.round(ratio*(BLOCKS.length-1))));return BLOCKS[index]}).join("")}function formatMetadataHeader(opts){let periodSpan=opts.compact?formatPeriodSpan(opts.periodStart,opts.periodEnd):null,rows=[];return opts.compact||rows.push({key:"Metric",value:`${opts.metric} ${opts.aggregation}`}),rows.push({key:"Period",value:`${formatPeriodBound(opts.periodStart)} to ${formatPeriodBound(opts.periodEnd)} (UTC)${periodSpan?` ${periodSpan}`:""}`},{key:"Interval",value:"days"in opts.granularity?`${formatGranularity(opts.granularity)} (${opts.bucketTimezone??"UTC"})`:formatGranularity(opts.granularity)}),typeof opts.periodUnique=="number"&&rows.push({key:"Unique (period)",value:formatCount(opts.periodUnique)}),!opts.compact&&opts.filter&&rows.push({key:"Filter",value:opts.filter}),!opts.compact&&opts.orderBy&&opts.orderDirection&&rows.push({key:"Order By",value:`${opts.orderBy} ${opts.orderDirection}${opts.orderBy==="count"?" (default)":""}`}),opts.scope.type==="project"?rows.push({key:"Project",value:`${opts.projectName??opts.scope.projectIds[0]} (${opts.teamName??opts.scope.ownerId})`}):rows.push({key:"Team",value:`${opts.teamName??opts.scope.ownerId} (all projects)`}),!opts.compact&&typeof opts.groupCount=="number"&&rows.push({key:"Groups",value:String(opts.groupCount)}),rows.map(row=>`> ${import_chalk.default.gray(`${row.key}:`)} ${row.value}`).join(`
|
|
8
8
|
`)}function formatSummaryTable(opts){let statColumns=getStatColumns(opts.aggregation),header=[...opts.groupByFields,...statColumns],rows=[header.map(name=>import_chalk.default.bold(import_chalk.default.cyan(name)))];for(let row of opts.rows){let nextRow=row.groupValues.map(v=>ellipsizeMiddle(v,MAX_GROUP_VALUE_LENGTH,opts.ansiAwareGroupValues));if(row.stats.allMissing){nextRow.push(...statColumns.map(()=>"--")),rows.push(nextRow);continue}nextRow.push(...statColumns.map(column=>formatStatCell(column,row.stats,opts.periodStart,opts.periodEnd,opts.formatValue))),rows.push(nextRow)}let centeredColumns=new Set(["min","max"]),align=header.map(col=>centeredColumns.has(col)?"c":"r");return indent_default(table(rows,{align,hsep:2}),2)}function formatSparklineSection(groupRows,sparklines,groupByFields,compact=!1){if(groupRows.length===0){let sparkline=sparklines[0],chart2=sparkline?indent_default(sparkline,2):"";return compact?chart2:["sparklines:",chart2].filter(Boolean).join(`
|
|
9
9
|
`)}let rows=[[...groupByFields,compact?"":"sparkline"].map(name=>import_chalk.default.bold(import_chalk.default.cyan(name))),...groupRows.map((groupValues,index)=>[...groupValues.map(v=>ellipsizeMiddle(v,MAX_GROUP_VALUE_LENGTH,compact)),sparklines[index]??""])],align=groupByFields.map(()=>"r");align.push("l");let chart=indent_default(table(rows,{align,hsep:2}),2);return compact?chart:`sparklines:
|
|
10
10
|
${chart}`}function formatText(response,opts){let rollupColumn=getRollupColumnName(opts.metric,opts.aggregation),formatValue=(value,formatOptions)=>formatMetricValue(value,opts.metricUnit,opts.aggregation,formatOptions),granularityMs=toGranularityMsFromDuration(opts.granularity),orderMetadata=getResolvedOrderMetadata(opts,response),{groups,series,groupValues}=extractGroupedSeries(response.data??[],opts.groupBy,rollupColumn,opts.periodStart,opts.periodEnd,granularityMs),periodUnique;if(isAggregationWithDimension(opts.aggregation)&&opts.groupBy.length===0){let summaryValue=toNumericValue(response.summary?.[0]?.[rollupColumn]);summaryValue!==null&&(periodUnique=summaryValue)}let metadata=formatMetadataHeader({metric:opts.metric,aggregation:opts.aggregation,periodStart:opts.periodStart,periodEnd:opts.periodEnd,granularity:opts.granularity,periodUnique,bucketTimezone:opts.bucketTimezone,filter:opts.filter,...opts.groupBy.length>0?orderMetadata:{},scope:opts.scope,projectName:opts.projectName,teamName:opts.teamName,groupCount:opts.groupBy.length>0?groups.length:void 0,compact:opts.presentation?.compact});if(groups.length===0)return`${metadata}
|
|
@@ -4,4 +4,4 @@ import { dirname as __dirname_ } from 'node:path';
|
|
|
4
4
|
const require = __createRequire(import.meta.url);
|
|
5
5
|
const __filename = __fileURLToPath(import.meta.url);
|
|
6
6
|
const __dirname = __dirname_(__filename);
|
|
7
|
-
import{isNativeBinaryInstall}from"./chunk-NWGBDBZI.js";import{require_lib}from"./chunk-
|
|
7
|
+
import{isNativeBinaryInstall}from"./chunk-NWGBDBZI.js";import{require_lib}from"./chunk-VLYVVC3P.js";import{packageName}from"./chunk-JESNVRVR.js";import{__toESM}from"./chunk-BZENIQ7N.js";var import_fs_extra=__toESM(require_lib(),1);import{join as join2,sep}from"path";import{execFile}from"child_process";import{tmpdir}from"node:os";import{resolve}from"node:path";var trustedUpgradeEnvironment=Object.freeze({...process.env}),trustedUpgradeDirectory=resolve(tmpdir());import{join}from"path";var packageManagers={npm:{metadataArgs:specifier=>["view",specifier,"version","--json","--global"],installArgs:specifier=>["i","-g",specifier],releaseAgeBypassArgs:["--min-release-age=0"],globalDetection:{args:["root","-g"],packageDir:(root,pkg)=>join(root,pkg)}},pnpm:{metadataArgs:specifier=>["view",specifier,"version","--json"],installArgs:specifier=>["i","-g",specifier],releaseAgeBypassArgs:["--config.minimumReleaseAge=0"],globalDetection:{args:pkg=>["list","-g",pkg,"--depth=0","--json"],packageDir:(output,pkg)=>{try{let projects=JSON.parse(output),path=(Array.isArray(projects)?projects[0]:projects)?.dependencies?.[pkg]?.path;return typeof path=="string"?path:void 0}catch{return}}}},yarn:{metadataArgs:specifier=>["info",specifier.endsWith("@latest")?specifier.slice(0,-7):specifier,"version","--json"],installArgs:specifier=>["global","add",specifier],releaseAgeBypassArgs:[],globalDetection:{args:["--silent","global","dir"],packageDir:(root,pkg)=>join(root,"node_modules",pkg)}},bun:{metadataArgs:specifier=>["info",specifier,"version","--json","--global"],installArgs:specifier=>["add","-g",specifier],releaseAgeBypassArgs:[],globalDetection:{args:["pm","bin","-g"],binaryNames:["vercel","vc"]}}};function getUpgradePackageManager(name){return packageManagers[name]}var UnsupportedUpgradeInstallError=class extends Error{},HOMEBREW_UPGRADE_COMMAND="brew upgrade vercel",HomebrewInstallError=class extends UnsupportedUpgradeInstallError{constructor(){super(`This Vercel CLI was installed with Homebrew. Update it with \`${HOMEBREW_UPGRADE_COMMAND}\`.`)}};async function isHomebrewInstall(){return isNativeBinaryInstall()?(await(0,import_fs_extra.realpath)(process.execPath).catch(()=>process.execPath)).includes(`${sep}Caskroom${sep}vercel${sep}`):!1}var globalCliTypes=["npm","pnpm","yarn","bun"];function throwIfAborted(signal){if(signal?.aborted)throw signal.reason instanceof Error?signal.reason:new Error("Package manager detection was aborted")}async function getPackageManagerGlobalRoot(cliType,pkg,env=trustedUpgradeEnvironment,signal){try{let detectionArgs=getUpgradePackageManager(cliType).globalDetection.args;return(await new Promise((resolve2,reject)=>{execFile(cliType,typeof detectionArgs=="function"?detectionArgs(pkg):detectionArgs,{encoding:"utf8",windowsHide:!0,cwd:trustedUpgradeDirectory,timeout:15e3,env:{...env},signal},(error,stdout2)=>{error?reject(error):resolve2(stdout2)})})).trim()||null}catch{return throwIfAborted(signal),null}}async function detectGlobalPackageManager(installPath,pkg,cliTypes=globalCliTypes,env=trustedUpgradeEnvironment,signal){for(let cliType of cliTypes){throwIfAborted(signal);let root=await getPackageManagerGlobalRoot(cliType,pkg,env,signal);if(!root)continue;let detection=getUpgradePackageManager(cliType).globalDetection;if(detection.packageDir)try{let packageDir=detection.packageDir(root,pkg);if(!packageDir)continue;let resolvedPackageDir=await(0,import_fs_extra.realpath)(packageDir);if(installPath===resolvedPackageDir||installPath.startsWith(resolvedPackageDir+sep))return cliType}catch{}for(let binary of detection.binaryNames||[])try{let target=await(0,import_fs_extra.realpath)(join2(root,binary));if(target===installPath||target.startsWith(installPath+sep)||installPath.startsWith(target+sep))return cliType;let entrypoint=await(0,import_fs_extra.realpath)(process.argv[1]);if(!isNativeBinaryInstall()&&target===entrypoint)return cliType}catch{}}return null}async function resolveInstall(env=trustedUpgradeEnvironment,signal){if(throwIfAborted(signal),await isHomebrewInstall())throw new HomebrewInstallError;let nativeExecutable=isNativeBinaryInstall()&&env.VERCEL_CLI_PACKAGE_EXECUTABLE,resolvedNativeExecutable=nativeExecutable&&await(0,import_fs_extra.realpath)(nativeExecutable).catch(()=>null),entrypoint=resolvedNativeExecutable&&resolvedNativeExecutable===await(0,import_fs_extra.realpath)(process.execPath).catch(()=>null)?env.VERCEL_CLI_PACKAGE_ENTRYPOINT:process.argv[1],installPath=entrypoint&&await(0,import_fs_extra.realpath)(entrypoint).catch(()=>null);if(!installPath)throw new UnsupportedUpgradeInstallError("Could not resolve this Vercel CLI installation. Update it with the package manager that installed it.");let packageManager=await detectGlobalPackageManager(installPath,packageName,globalCliTypes,env,signal);if(!packageManager)throw new UnsupportedUpgradeInstallError("Could not detect a supported global npm, pnpm, Yarn, or Bun installation of Vercel CLI. Update it with the package manager that installed it.");return{packageManager,global:!0,assumed:!1}}async function isGlobal(){if(await isHomebrewInstall())return!0;try{return await resolveInstall(),!0}catch{return!1}}async function getUpdateCommandInfo(env=trustedUpgradeEnvironment,signal){let{packageManager}=await resolveInstall(env,signal),args=getUpgradePackageManager(packageManager).installArgs(`${packageName}@latest`),allowBuild=pnpmAllowBuildFlag(packageManager,"esbuild");return{command:`${packageManager} ${args.join(" ")}${allowBuild}`,global:!0,packageManager,assumed:!1}}function pnpmAllowBuildFlag(cliType,pkg){return cliType==="pnpm"?` --allow-build=${pkg}`:""}async function getUpdateCommand(){return await isHomebrewInstall()?HOMEBREW_UPGRADE_COMMAND:(await getUpdateCommandInfo()).command}export{trustedUpgradeEnvironment,trustedUpgradeDirectory,getUpgradePackageManager,HOMEBREW_UPGRADE_COMMAND,isHomebrewInstall,isGlobal,getUpdateCommandInfo,getUpdateCommand};
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { createRequire as __createRequire } from 'node:module';
|
|
2
|
+
import { fileURLToPath as __fileURLToPath } from 'node:url';
|
|
3
|
+
import { dirname as __dirname_ } from 'node:path';
|
|
4
|
+
const require = __createRequire(import.meta.url);
|
|
5
|
+
const __filename = __fileURLToPath(import.meta.url);
|
|
6
|
+
const __dirname = __dirname_(__filename);
|
|
7
|
+
import{repositoryPermissionsClearPath}from"./chunk-DFVNL5ML.js";import{emitVcrArgParseError,handleVcrApiError,requireVcrRepository,resolveVcrScope,validateVcrJsonOutput}from"./chunk-4HJGSSSZ.js";import"./chunk-XSQVCDSD.js";import"./chunk-RCUDI7OF.js";import"./chunk-GD7AV7BO.js";import{permissionsClearSubcommand}from"./chunk-QNL22LAW.js";import{printError}from"./chunk-VQ755MPP.js";import"./chunk-WICRM2JL.js";import"./chunk-MXTC4ZAQ.js";import{AGENT_REASON,buildCommandWithYes,outputAgentError}from"./chunk-XE24Y6NM.js";import"./chunk-EPO7P734.js";import"./chunk-VLYVVC3P.js";import"./chunk-26QK3I2S.js";import"./chunk-55H6G46X.js";import"./chunk-4NTBYNFR.js";import{parseArguments}from"./chunk-F22QLVTX.js";import"./chunk-F53OKXYI.js";import"./chunk-7SAEZ4NC.js";import"./chunk-LUX4PBJL.js";import"./chunk-OPORM35X.js";import"./chunk-4SAVH3H7.js";import{isAPIError}from"./chunk-YCJHUYBJ.js";import"./chunk-JESNVRVR.js";import{output_manager_default}from"./chunk-DWOJP4ST.js";import"./chunk-BLUPZPAS.js";import"./chunk-RM3ZDRYE.js";import"./chunk-D3AHZ5LI.js";import"./chunk-2GHZGOWT.js";import"./chunk-YHPPP3SF.js";import"./chunk-OO572JUC.js";import{getFlagsSpecification}from"./chunk-A2UZ2O7H.js";import"./chunk-2BKALEOP.js";import"./chunk-NB2WLB3J.js";import"./chunk-ISWW3DKF.js";import"./chunk-BRQUZ5NC.js";import"./chunk-FBYA6LLM.js";import"./chunk-SCV7XEEO.js";import"./chunk-MY4MONOH.js";import"./chunk-BZENIQ7N.js";async function clear(client,argv,telemetry){let parsedArgs;try{parsedArgs=parseArguments(argv,getFlagsSpecification(permissionsClearSubcommand.options))}catch(err){return emitVcrArgParseError(client,err,"vcr permissions <repository> clear"),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 permissions <repository> clear");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:"Clearing repository permissions removes access for every team. Re-run with --yes.",next:[{command:buildCommandWithYes(client.argv)}]},1),!await client.input.confirm(`Remove access to ${repository} for all teams? They will no longer be able to pull its images.`,!1)))return output_manager_default.log("Canceled"),0;let path=repositoryPermissionsClearPath(scope,repository);output_manager_default.spinner("Clearing repository permissions...");try{return await client.fetch(path,{method:"DELETE"}),fr.jsonOutput?client.stdout.write(`${JSON.stringify({repository,cleared:!0},null,2)}
|
|
8
|
+
`):output_manager_default.success(`Cleared repository permissions for ${repository}`),0}catch(err){if(isAPIError(err))return handleVcrApiError(client,err,fr.jsonOutput);throw err}finally{output_manager_default.stopSpinner()}}export{clear as default};
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { createRequire as __createRequire } from 'node:module';
|
|
2
|
+
import { fileURLToPath as __fileURLToPath } from 'node:url';
|
|
3
|
+
import { dirname as __dirname_ } from 'node:path';
|
|
4
|
+
const require = __createRequire(import.meta.url);
|
|
5
|
+
const __filename = __fileURLToPath(import.meta.url);
|
|
6
|
+
const __dirname = __dirname_(__filename);
|
|
7
|
+
import{compileVercelConfig,findSourceVercelConfigFile,getVercelConfigPath,normalizeConfig}from"./chunk-I2WEQWCA.js";import{DEFAULT_VERCEL_CONFIG_FILENAME,VERCEL_CONFIG_EXTENSIONS}from"./chunk-VLYVVC3P.js";import"./chunk-26QK3I2S.js";import"./chunk-55H6G46X.js";import"./chunk-4NTBYNFR.js";import"./chunk-F22QLVTX.js";import"./chunk-F53OKXYI.js";import"./chunk-7SAEZ4NC.js";import"./chunk-LUX4PBJL.js";import"./chunk-OPORM35X.js";import"./chunk-4SAVH3H7.js";import"./chunk-YCJHUYBJ.js";import"./chunk-JESNVRVR.js";import"./chunk-DWOJP4ST.js";import"./chunk-BLUPZPAS.js";import"./chunk-RM3ZDRYE.js";import"./chunk-D3AHZ5LI.js";import"./chunk-2GHZGOWT.js";import"./chunk-YHPPP3SF.js";import"./chunk-OO572JUC.js";import"./chunk-A2UZ2O7H.js";import"./chunk-2BKALEOP.js";import"./chunk-NB2WLB3J.js";import"./chunk-ISWW3DKF.js";import"./chunk-BRQUZ5NC.js";import"./chunk-MY4MONOH.js";import"./chunk-BZENIQ7N.js";export{DEFAULT_VERCEL_CONFIG_FILENAME,VERCEL_CONFIG_EXTENSIONS,compileVercelConfig,findSourceVercelConfigFile,getVercelConfigPath,normalizeConfig};
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { createRequire as __createRequire } from 'node:module';
|
|
2
|
+
import { fileURLToPath as __fileURLToPath } from 'node:url';
|
|
3
|
+
import { dirname as __dirname_ } from 'node:path';
|
|
4
|
+
const require = __createRequire(import.meta.url);
|
|
5
|
+
const __filename = __fileURLToPath(import.meta.url);
|
|
6
|
+
const __dirname = __dirname_(__filename);
|
|
7
|
+
import{repositoryPath}from"./chunk-DFVNL5ML.js";import{emitVcrArgParseError,handleVcrApiError,requireVcrRepository,resolveVcrScope,validateVcrJsonOutput}from"./chunk-4HJGSSSZ.js";import{outputError}from"./chunk-XSQVCDSD.js";import{readOnOffOption,rewriteLegacyOnOffValues}from"./chunk-RMW2FDXS.js";import"./chunk-RCUDI7OF.js";import"./chunk-GD7AV7BO.js";import{configSubcommand}from"./chunk-HMWDOAWO.js";import"./chunk-QNL22LAW.js";import"./chunk-UWMPVTXG.js";import"./chunk-5CZNUB7Y.js";import{printError}from"./chunk-VQ755MPP.js";import"./chunk-WICRM2JL.js";import"./chunk-MXTC4ZAQ.js";import{AGENT_REASON,buildCommandWithGlobalFlags,outputAgentError}from"./chunk-XE24Y6NM.js";import"./chunk-EPO7P734.js";import"./chunk-VLYVVC3P.js";import"./chunk-26QK3I2S.js";import"./chunk-55H6G46X.js";import"./chunk-4NTBYNFR.js";import{parseArguments}from"./chunk-F22QLVTX.js";import"./chunk-F53OKXYI.js";import"./chunk-7SAEZ4NC.js";import"./chunk-LUX4PBJL.js";import"./chunk-OPORM35X.js";import"./chunk-4SAVH3H7.js";import{isAPIError}from"./chunk-YCJHUYBJ.js";import"./chunk-JESNVRVR.js";import{output_manager_default}from"./chunk-DWOJP4ST.js";import"./chunk-BLUPZPAS.js";import"./chunk-RM3ZDRYE.js";import"./chunk-D3AHZ5LI.js";import"./chunk-2GHZGOWT.js";import"./chunk-YHPPP3SF.js";import"./chunk-OO572JUC.js";import{getFlagsSpecification}from"./chunk-A2UZ2O7H.js";import"./chunk-2BKALEOP.js";import"./chunk-NB2WLB3J.js";import"./chunk-ISWW3DKF.js";import"./chunk-BRQUZ5NC.js";import"./chunk-FBYA6LLM.js";import"./chunk-SCV7XEEO.js";import"./chunk-MY4MONOH.js";import"./chunk-BZENIQ7N.js";var USAGE="vcr update <repository> --public";async function config(client,argv,telemetry){let rewritten=rewriteLegacyOnOffValues(argv,configSubcommand.options,client),parsedArgs;try{parsedArgs=parseArguments("error"in rewritten?argv:rewritten.args,getFlagsSpecification(configSubcommand.options))}catch(err){return emitVcrArgParseError(client,err,USAGE),printError(err),2}let fr=validateVcrJsonOutput(client,parsedArgs.flags);if(typeof fr=="number")return fr;if("error"in rewritten)return outputAgentError(client,{status:"error",reason:AGENT_REASON.INVALID_ARGUMENTS,message:rewritten.error},2),outputError(client,fr.jsonOutput,"INVALID_ARGUMENTS",rewritten.error);let repository=parsedArgs.args[0],project=parsedArgs.flags["--project"],visibility=readOnOffOption(client,parsedArgs.flags,{on:"--public",off:"--no-public"});if("error"in visibility){let err=new Error(visibility.error);return emitVcrArgParseError(client,err,USAGE),outputError(client,fr.jsonOutput,"INVALID_ARGUMENTS",visibility.error)}let desiredPublic=visibility.value;telemetry.trackCliOptionProject(project),telemetry.trackCliOptionFormat(parsedArgs.flags["--format"]),telemetry.trackCliOptionPublic(rewritten.legacy.get("--public")),rewritten.legacy.has("--public")||(telemetry.trackCliFlagPublic(parsedArgs.flags["--public"]),telemetry.trackCliFlagNoPublic(parsedArgs.flags["--no-public"]));let missingRepository=requireVcrRepository(client,repository,fr.jsonOutput,USAGE);if(typeof missingRepository=="number")return missingRepository;if(parsedArgs.args.length>1){let message="`vcr update` takes one repository. Pass --public or --no-public without a value.";return outputAgentError(client,{status:"error",reason:AGENT_REASON.INVALID_ARGUMENTS,message,next:[{command:buildCommandWithGlobalFlags(client.argv,USAGE),when:"Re-run with one repository"}]},2),outputError(client,fr.jsonOutput,"INVALID_ARGUMENTS",message)}if(desiredPublic===void 0){let message="Missing a setting to change. Pass --public to make the repository public, or --no-public to make it private.";return outputAgentError(client,{status:"error",reason:AGENT_REASON.MISSING_ARGUMENTS,message,next:[{command:buildCommandWithGlobalFlags(client.argv,USAGE),when:"Re-run with --public or --no-public"}]},2),outputError(client,fr.jsonOutput,"MISSING_ARGUMENTS",message)}let scope=await resolveVcrScope(client,{project,jsonOutput:fr.jsonOutput});if(typeof scope=="number")return scope;let path=repositoryPath(scope,repository);output_manager_default.spinner("Updating repository...");try{let updated=await client.fetch(path,{method:"PATCH",body:{public:desiredPublic}});if(fr.jsonOutput)client.stdout.write(`${JSON.stringify(updated,null,2)}
|
|
8
|
+
`);else{let isPublic=updated.repository?.public??desiredPublic;output_manager_default.success(`Repository ${updated.repository?.name??repository} is now ${isPublic?"public":"private"}`)}return 0}catch(err){if(isAPIError(err))return handleVcrApiError(client,err,fr.jsonOutput,{retry:{command:buildCommandWithGlobalFlags(client.argv,"vcr ls"),when:"List repositories to confirm the name or id"}});throw err}finally{output_manager_default.stopSpinner()}}export{config as default};
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { createRequire as __createRequire } from 'node:module';
|
|
2
|
+
import { fileURLToPath as __fileURLToPath } from 'node:url';
|
|
3
|
+
import { dirname as __dirname_ } from 'node:path';
|
|
4
|
+
const require = __createRequire(import.meta.url);
|
|
5
|
+
const __filename = __fileURLToPath(import.meta.url);
|
|
6
|
+
const __dirname = __dirname_(__filename);
|
|
7
|
+
import{getSubcommand}from"./chunk-ETV3C2CV.js";import{getCommandAliases}from"./chunk-WDUHDLUA.js";import"./chunk-O7COT3YB.js";import{tracesCommand}from"./chunk-2FHZYQPY.js";import{lsSubcommand,rmSubcommand,setSubcommand,tracesConfigCommand}from"./chunk-M7LUSXMG.js";import"./chunk-C6IITJ5S.js";import"./chunk-TZT3VYZ3.js";import"./chunk-HMWDOAWO.js";import"./chunk-QNL22LAW.js";import"./chunk-UWMPVTXG.js";import"./chunk-5CZNUB7Y.js";import"./chunk-AUY363W7.js";import"./chunk-OTYF3ZZW.js";import"./chunk-3H36RI7C.js";import"./chunk-BGWS5R5R.js";import"./chunk-UJQ6PBRF.js";import"./chunk-LFOWP74R.js";import"./chunk-GVPVWHFK.js";import"./chunk-N5CXIFE2.js";import"./chunk-FNA4MIOH.js";import"./chunk-JALVF3C2.js";import"./chunk-VWHIWUGJ.js";import{help}from"./chunk-SLDWAIO3.js";import"./chunk-67GZ5REA.js";import"./chunk-BS32OUOC.js";import{TelemetryClient}from"./chunk-5WYPJ2T5.js";import"./chunk-2EYYB6YN.js";import"./chunk-NWGBDBZI.js";import"./chunk-EPO7P734.js";import"./chunk-4NTBYNFR.js";import{warnDeprecatedSubcommand}from"./chunk-7SAEZ4NC.js";import"./chunk-4SAVH3H7.js";import"./chunk-JESNVRVR.js";import{output_manager_default}from"./chunk-DWOJP4ST.js";import"./chunk-BLUPZPAS.js";import"./chunk-RM3ZDRYE.js";import"./chunk-D3AHZ5LI.js";import"./chunk-2GHZGOWT.js";import"./chunk-YHPPP3SF.js";import"./chunk-OO572JUC.js";import"./chunk-PUKYAALC.js";import"./chunk-A2UZ2O7H.js";import"./chunk-2BKALEOP.js";import"./chunk-NB2WLB3J.js";import"./chunk-ISWW3DKF.js";import"./chunk-BRQUZ5NC.js";import"./chunk-BZENIQ7N.js";var TracesConfigTelemetryClient=class extends TelemetryClient{trackCliSubcommandLs(actual){this.trackCliSubcommand({subcommand:"ls",value:actual})}trackCliSubcommandSet(actual){this.trackCliSubcommand({subcommand:"set",value:actual})}trackCliSubcommandRemove(actual){this.trackCliSubcommand({subcommand:"remove",value:actual})}};var COMMAND_CONFIG={ls:getCommandAliases(lsSubcommand),set:getCommandAliases(setSubcommand),remove:getCommandAliases(rmSubcommand)},SUBCOMMAND_METADATA={ls:lsSubcommand,set:setSubcommand,remove:rmSubcommand};async function config(client,{args,needHelp,subcommandOriginal,telemetry}){let{subcommand:action,subcommandOriginal:actionOriginal}=getSubcommand(args,COMMAND_CONFIG),actionMetadata=typeof action=="string"?SUBCOMMAND_METADATA[action]:void 0;function printHelp(command){return output_manager_default.print(help(command,{stream:client.stderr,parent:tracesCommand,columns:client.stderr.columns})),needHelp?0:2}if(needHelp)return telemetry.trackCliFlagHelp("traces",subcommandOriginal),printHelp(actionMetadata||tracesConfigCommand);telemetry.trackCliSubcommandConfig(subcommandOriginal);let configTelemetry=new TracesConfigTelemetryClient({opts:{store:client.telemetryEventStore}});switch(action){case"ls":return configTelemetry.trackCliSubcommandLs(actionOriginal),(await import("./ls-FOKMPVIB.js")).default(client);case"set":return configTelemetry.trackCliSubcommandSet(actionOriginal),(await import("./set-KWOZNGRL.js")).default(client);case"remove":return configTelemetry.trackCliSubcommandRemove(actionOriginal),actionOriginal==="delete"&&warnDeprecatedSubcommand(client,"traces config delete","traces config remove"),(await import("./rm-PFZYHXEN.js")).default(client);default:return printHelp(tracesConfigCommand)}}export{config as default};
|
|
@@ -4,4 +4,4 @@ import { dirname as __dirname_ } from 'node:path';
|
|
|
4
4
|
const require = __createRequire(import.meta.url);
|
|
5
5
|
const __filename = __fileURLToPath(import.meta.url);
|
|
6
6
|
const __dirname = __dirname_(__filename);
|
|
7
|
-
import{buildRepoUrl,checkExistsAndConnect,connectGitProvider,disconnectGitProvider,formatProvider,parseRepoUrl,printRemoteUrls,selectAndParseRemoteUrl,selectRemoteUrl}from"./chunk-
|
|
7
|
+
import{buildRepoUrl,checkExistsAndConnect,connectGitProvider,disconnectGitProvider,formatProvider,parseRepoUrl,printRemoteUrls,selectAndParseRemoteUrl,selectRemoteUrl}from"./chunk-J6L5MDTX.js";import"./chunk-EAUDC24V.js";import"./chunk-RRDNKB2X.js";import"./chunk-MVGTMPMI.js";import"./chunk-SACGQMVQ.js";import"./chunk-67GZ5REA.js";import"./chunk-BS32OUOC.js";import"./chunk-YCJHUYBJ.js";import"./chunk-JESNVRVR.js";import"./chunk-DWOJP4ST.js";import"./chunk-BLUPZPAS.js";import"./chunk-RM3ZDRYE.js";import"./chunk-D3AHZ5LI.js";import"./chunk-2GHZGOWT.js";import"./chunk-YHPPP3SF.js";import"./chunk-OO572JUC.js";import"./chunk-2BKALEOP.js";import"./chunk-NB2WLB3J.js";import"./chunk-ISWW3DKF.js";import"./chunk-BRQUZ5NC.js";import"./chunk-BZENIQ7N.js";export{buildRepoUrl,checkExistsAndConnect,connectGitProvider,disconnectGitProvider,formatProvider,parseRepoUrl,printRemoteUrls,selectAndParseRemoteUrl,selectRemoteUrl};
|
|
@@ -0,0 +1,9 @@
|
|
|
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{deleteMessage,handleCommentsParseError,resolveCommentsScope,threadNotFoundMessage,toApiErrorParts}from"./chunk-3NG2EYQ5.js";import"./chunk-36NK2Z3C.js";import{outputError}from"./chunk-XSQVCDSD.js";import"./chunk-SDOPVIKJ.js";import{canPrompt}from"./chunk-IQ7FPAI4.js";import{deleteSubcommand}from"./chunk-OTYF3ZZW.js";import"./chunk-VQ755MPP.js";import"./chunk-WICRM2JL.js";import"./chunk-MXTC4ZAQ.js";import"./chunk-XE24Y6NM.js";import"./chunk-EPO7P734.js";import"./chunk-VLYVVC3P.js";import"./chunk-26QK3I2S.js";import"./chunk-55H6G46X.js";import"./chunk-4NTBYNFR.js";import{parseArguments}from"./chunk-F22QLVTX.js";import"./chunk-F53OKXYI.js";import{validateJsonOutput}from"./chunk-7SAEZ4NC.js";import"./chunk-LUX4PBJL.js";import"./chunk-OPORM35X.js";import"./chunk-4SAVH3H7.js";import{isAPIError}from"./chunk-YCJHUYBJ.js";import"./chunk-JESNVRVR.js";import{output_manager_default}from"./chunk-DWOJP4ST.js";import"./chunk-BLUPZPAS.js";import"./chunk-RM3ZDRYE.js";import"./chunk-D3AHZ5LI.js";import"./chunk-2GHZGOWT.js";import"./chunk-YHPPP3SF.js";import"./chunk-OO572JUC.js";import{getFlagsSpecification}from"./chunk-A2UZ2O7H.js";import"./chunk-2BKALEOP.js";import{require_source}from"./chunk-NB2WLB3J.js";import"./chunk-ISWW3DKF.js";import"./chunk-BRQUZ5NC.js";import"./chunk-MY4MONOH.js";import{__toESM}from"./chunk-BZENIQ7N.js";var import_chalk=__toESM(require_source(),1);async function deleteCommentMessage(client,telemetry){let parsedArgs,flagsSpecification=getFlagsSpecification(deleteSubcommand.options);try{parsedArgs=parseArguments(client.argv.slice(2),flagsSpecification)}catch(err){return handleCommentsParseError(err,"delete")}let formatResult=validateJsonOutput(parsedArgs.flags);if(!formatResult.valid)return output_manager_default.error(formatResult.error),2;let jsonOutput=formatResult.jsonOutput,yes=!!parsedArgs.flags["--yes"];telemetry.trackCliOptionFormat(parsedArgs.flags["--format"]),telemetry.trackCliFlagYes(parsedArgs.flags["--yes"]);let[threadInput,messageId]=parsedArgs.args.slice(2);if(telemetry.trackCliArgumentThread(threadInput),telemetry.trackCliArgumentMessageId(messageId),!threadInput||!messageId)return outputError(client,jsonOutput,"MISSING_ARGUMENT","Usage: `vercel comments delete <thread> <message-id>` \u2014 message IDs are shown in `vercel comments inspect`.");let threadRef=parseThreadArg(threadInput);if(!threadRef)return outputError(client,jsonOutput,"INVALID_THREAD",`Could not extract a thread ID from "${threadInput}".`);let threadId=threadRef.id,scope=await resolveCommentsScope(client,{project:parsedArgs.flags["--project"],requireProject:!1,jsonOutput,urlTeamSlug:threadRef.teamSlug});if(typeof scope=="number")return scope;if(!yes){if(!canPrompt(client)||jsonOutput)return outputError(client,jsonOutput,"CONFIRMATION_REQUIRED","Pass --yes to delete the message non-interactively.");if(!await client.input.confirm(`${import_chalk.default.red("Delete")} message ${messageId} from ${threadId} in team ${scope.teamSlug??scope.teamId}? This cannot be undone.`,!1))return output_manager_default.log("Canceled."),0}telemetry.trackCliOptionProject(parsedArgs.flags["--project"]);try{let result=await deleteMessage(client,scope.teamId,threadId,messageId);return jsonOutput?(client.stdout.write(`${JSON.stringify(result,null,2)}
|
|
8
|
+
`),0):(output_manager_default.print(`${import_chalk.default.green("\u2713")} Deleted message ${messageId}
|
|
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}}export{deleteCommentMessage as default};
|
|
@@ -0,0 +1,10 @@
|
|
|
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{getRouteTypeLabel,getRoutes,offerAutoPromote,parseSubcommandArgs,resolveRoutes,withGlobalFlags}from"./chunk-TGOGYSBO.js";import{requireProjectContext}from"./chunk-L4XLDN6T.js";import"./chunk-36NK2Z3C.js";import"./chunk-SDOPVIKJ.js";import{stamp_default}from"./chunk-A2RZZQEP.js";import"./chunk-Q7D7RGXM.js";import{deleteSubcommand}from"./chunk-O7COT3YB.js";import"./chunk-VQ755MPP.js";import"./chunk-WICRM2JL.js";import"./chunk-MXTC4ZAQ.js";import{AGENT_REASON,AGENT_STATUS,outputAgentError}from"./chunk-XE24Y6NM.js";import"./chunk-EPO7P734.js";import"./chunk-VLYVVC3P.js";import"./chunk-26QK3I2S.js";import"./chunk-55H6G46X.js";import"./chunk-4NTBYNFR.js";import"./chunk-F22QLVTX.js";import"./chunk-F53OKXYI.js";import"./chunk-7SAEZ4NC.js";import"./chunk-LUX4PBJL.js";import"./chunk-OPORM35X.js";import"./chunk-4SAVH3H7.js";import"./chunk-YCJHUYBJ.js";import"./chunk-JESNVRVR.js";import{output_manager_default}from"./chunk-DWOJP4ST.js";import"./chunk-BLUPZPAS.js";import"./chunk-RM3ZDRYE.js";import"./chunk-D3AHZ5LI.js";import"./chunk-2GHZGOWT.js";import"./chunk-YHPPP3SF.js";import"./chunk-OO572JUC.js";import"./chunk-A2UZ2O7H.js";import"./chunk-2BKALEOP.js";import{require_source}from"./chunk-NB2WLB3J.js";import"./chunk-ISWW3DKF.js";import"./chunk-BRQUZ5NC.js";import"./chunk-MY4MONOH.js";import{__toESM}from"./chunk-BZENIQ7N.js";var import_chalk=__toESM(require_source(),1);async function deleteRoutes(client,projectId,routeIds,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:"DELETE",headers:{"Content-Type":"application/json"},body:JSON.stringify({routeIds})})}async function deleteRoute(client,argv){let parsed=await parseSubcommandArgs(argv,deleteSubcommand,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"];if(args.length===0)return client.nonInteractive&&outputAgentError(client,{status:AGENT_STATUS.ERROR,reason:AGENT_REASON.MISSING_ARGUMENTS,message:"At least one route name or ID is required.",next:[{command:withGlobalFlags(client,"routes remove <name-or-id> --yes"),when:"pass one or more ids/names and --yes to skip confirm"}]},2),output_manager_default.error(`At least one route name or ID is required. Usage: ${withGlobalFlags(client,"routes remove <name-or-id> [...]")}`),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:AGENT_STATUS.ERROR,reason:AGENT_REASON.NOT_FOUND,message:"No routes found in this project."},1),output_manager_default.error("No routes found in this project."),1;let resolved=await resolveRoutes(client,routes,args);if(!resolved)return 1;output_manager_default.print(`
|
|
8
|
+
`),output_manager_default.log(`The following ${resolved.length===1?"route":`${resolved.length} routes`} will be removed:`);for(let route of resolved){let typeLabels=getRouteTypeLabel(route);output_manager_default.print(` ${import_chalk.default.red("\xD7")} ${route.name} ${import_chalk.default.gray(`(${route.route.src})`)} ${import_chalk.default.gray(`[${typeLabels}]`)}
|
|
9
|
+
`)}if(output_manager_default.print(`
|
|
10
|
+
`),!skipConfirmation&&(client.nonInteractive&&outputAgentError(client,{status:AGENT_STATUS.ERROR,reason:AGENT_REASON.CONFIRMATION_REQUIRED,message:"Removing routes requires confirmation. Pass --yes to skip the prompt in non-interactive mode.",next:[{command:withGlobalFlags(client,`routes remove ${args.join(" ")} --yes`),when:"re-run with --yes to confirm without prompt"}]},1),!await client.input.confirm(`Remove ${resolved.length===1?"this route":`these ${resolved.length} routes`}?`,!1)))return output_manager_default.log("Aborted."),0;let deleteStamp=stamp_default();output_manager_default.spinner(`Removing ${resolved.length===1?"route":`${resolved.length} routes`}`);try{let{deletedCount,version}=await deleteRoutes(client,project.id,resolved.map(r=>r.id),{teamId});return output_manager_default.log(`${import_chalk.default.cyan("Removed")} ${deletedCount} ${deletedCount===1?"route":"routes"} ${import_chalk.default.gray(deleteStamp())}`),await offerAutoPromote(client,project.id,version,!!existingStagingVersion,{teamId,skipPrompts:skipConfirmation}),0}catch(e){let error=e;return client.nonInteractive&&outputAgentError(client,{status:AGENT_STATUS.ERROR,reason:AGENT_REASON.API_ERROR,message:"Failed to remove routes for this project. See hint for error details.",hint:error.message||"Retry with the same command once transient issues are resolved."},1),output_manager_default.error(error.message||"Failed to remove routes"),1}}export{deleteRoute as default};
|
|
@@ -4,4 +4,4 @@ import { dirname as __dirname_ } from 'node:path';
|
|
|
4
4
|
const require = __createRequire(import.meta.url);
|
|
5
5
|
const __filename = __fileURLToPath(import.meta.url);
|
|
6
6
|
const __dirname = __dirname_(__filename);
|
|
7
|
-
import{detectProjects}from"./chunk-
|
|
7
|
+
import{detectProjects}from"./chunk-VUQWLLNI.js";import"./chunk-HVDGNAPM.js";import"./chunk-OCR5CRTH.js";import"./chunk-6Y2ZL5XJ.js";import"./chunk-7EJQLVWX.js";import"./chunk-RM3ZDRYE.js";import"./chunk-SCV7XEEO.js";import"./chunk-BZENIQ7N.js";export{detectProjects};
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { createRequire as __createRequire } from 'node:module';
|
|
2
|
+
import { fileURLToPath as __fileURLToPath } from 'node:url';
|
|
3
|
+
import { dirname as __dirname_ } from 'node:path';
|
|
4
|
+
const require = __createRequire(import.meta.url);
|
|
5
|
+
const __filename = __fileURLToPath(import.meta.url);
|
|
6
|
+
const __dirname = __dirname_(__filename);
|
|
7
|
+
import{getServicesConfigWriteBlocker,isExperimentalServicesEnabled,loadVercelConfig,tryDetectServices,writeServicesConfig}from"./chunk-R3BEQTZZ.js";import"./chunk-ZQUVDDPB.js";import"./chunk-HVDGNAPM.js";import"./chunk-OCR5CRTH.js";import"./chunk-6Y2ZL5XJ.js";import"./chunk-QDPYU6KS.js";import"./chunk-25565AGS.js";import"./chunk-I2WEQWCA.js";import"./chunk-7EJQLVWX.js";import"./chunk-U4Z2MMOF.js";import"./chunk-VLYVVC3P.js";import"./chunk-26QK3I2S.js";import"./chunk-55H6G46X.js";import"./chunk-4NTBYNFR.js";import"./chunk-F22QLVTX.js";import"./chunk-F53OKXYI.js";import"./chunk-7SAEZ4NC.js";import"./chunk-LUX4PBJL.js";import"./chunk-OPORM35X.js";import"./chunk-4SAVH3H7.js";import"./chunk-YCJHUYBJ.js";import"./chunk-JESNVRVR.js";import"./chunk-DWOJP4ST.js";import"./chunk-BLUPZPAS.js";import"./chunk-RM3ZDRYE.js";import"./chunk-D3AHZ5LI.js";import"./chunk-2GHZGOWT.js";import"./chunk-YHPPP3SF.js";import"./chunk-OO572JUC.js";import"./chunk-A2UZ2O7H.js";import"./chunk-2BKALEOP.js";import"./chunk-NB2WLB3J.js";import"./chunk-ISWW3DKF.js";import"./chunk-BRQUZ5NC.js";import"./chunk-SCV7XEEO.js";import"./chunk-MY4MONOH.js";import"./chunk-BZENIQ7N.js";export{getServicesConfigWriteBlocker,isExperimentalServicesEnabled,loadVercelConfig,tryDetectServices,writeServicesConfig};
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { createRequire as __createRequire } from 'node:module';
|
|
2
|
+
import { fileURLToPath as __fileURLToPath } from 'node:url';
|
|
3
|
+
import { dirname as __dirname_ } from 'node:path';
|
|
4
|
+
const require = __createRequire(import.meta.url);
|
|
5
|
+
const __filename = __fileURLToPath(import.meta.url);
|
|
6
|
+
const __dirname = __dirname_(__filename);
|
|
7
|
+
import{editRoute}from"./chunk-AM46JVVN.js";import{getRouteVersions}from"./chunk-BVH2AEFE.js";import{getRoutes,offerAutoPromote,parseSubcommandArgs,resolveRoute,withGlobalFlags}from"./chunk-TGOGYSBO.js";import{requireProjectContext}from"./chunk-L4XLDN6T.js";import"./chunk-36NK2Z3C.js";import"./chunk-SDOPVIKJ.js";import{stamp_default}from"./chunk-A2RZZQEP.js";import"./chunk-Q7D7RGXM.js";import{disableSubcommand}from"./chunk-O7COT3YB.js";import"./chunk-VQ755MPP.js";import"./chunk-WICRM2JL.js";import"./chunk-MXTC4ZAQ.js";import{outputAgentError}from"./chunk-XE24Y6NM.js";import"./chunk-EPO7P734.js";import"./chunk-VLYVVC3P.js";import"./chunk-26QK3I2S.js";import"./chunk-55H6G46X.js";import"./chunk-4NTBYNFR.js";import"./chunk-F22QLVTX.js";import"./chunk-F53OKXYI.js";import"./chunk-7SAEZ4NC.js";import"./chunk-LUX4PBJL.js";import"./chunk-OPORM35X.js";import"./chunk-4SAVH3H7.js";import"./chunk-YCJHUYBJ.js";import"./chunk-JESNVRVR.js";import{output_manager_default}from"./chunk-DWOJP4ST.js";import"./chunk-BLUPZPAS.js";import"./chunk-RM3ZDRYE.js";import"./chunk-D3AHZ5LI.js";import"./chunk-2GHZGOWT.js";import"./chunk-YHPPP3SF.js";import"./chunk-OO572JUC.js";import"./chunk-A2UZ2O7H.js";import"./chunk-2BKALEOP.js";import{require_source}from"./chunk-NB2WLB3J.js";import"./chunk-ISWW3DKF.js";import"./chunk-BRQUZ5NC.js";import"./chunk-MY4MONOH.js";import{__toESM}from"./chunk-BZENIQ7N.js";var import_chalk=__toESM(require_source(),1);async function disable(client,argv){let parsed=await parseSubcommandArgs(argv,disableSubcommand,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}=parsed,identifier=args[0];if(!identifier)return client.nonInteractive&&outputAgentError(client,{status:"error",reason:"missing_arguments",message:"Route name or ID is required.",next:[{command:withGlobalFlags(client,"routes disable <name-or-id>"),when:"replace <name-or-id>"},{command:withGlobalFlags(client,"routes list"),when:"list routes"}]},2),output_manager_default.error(`Route name or ID is required. Usage: ${withGlobalFlags(client,"routes disable <name-or-id>")}`),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;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;if(route.enabled===!1)return output_manager_default.log(`Route "${route.name}" is already disabled.`),0;let disableStamp=stamp_default();output_manager_default.spinner(`Disabling route "${route.name}"`);try{let{version}=await editRoute(client,project.id,route.id,{route:{name:route.name,description:route.description,enabled:!1,srcSyntax:route.srcSyntax,route:route.route}},{teamId});return output_manager_default.log(`${import_chalk.default.cyan("Disabled")} route "${route.name}" ${import_chalk.default.gray(disableStamp())}`),await offerAutoPromote(client,project.id,version,!!existingStagingVersion,{teamId}),0}catch(e){let error=e;return client.nonInteractive&&outputAgentError(client,{status:"error",reason:"api_error",message:error.message||"Failed to disable route"},1),output_manager_default.error(error.message||"Failed to disable route"),1}}export{disable as default};
|
|
@@ -0,0 +1,14 @@
|
|
|
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-TGOGYSBO.js";import{requireProjectContext}from"./chunk-L4XLDN6T.js";import"./chunk-36NK2Z3C.js";import"./chunk-SDOPVIKJ.js";import{stamp_default}from"./chunk-A2RZZQEP.js";import"./chunk-Q7D7RGXM.js";import{discardSubcommand}from"./chunk-O7COT3YB.js";import"./chunk-VQ755MPP.js";import"./chunk-WICRM2JL.js";import"./chunk-MXTC4ZAQ.js";import{outputAgentError}from"./chunk-XE24Y6NM.js";import"./chunk-EPO7P734.js";import"./chunk-VLYVVC3P.js";import"./chunk-26QK3I2S.js";import"./chunk-55H6G46X.js";import"./chunk-4NTBYNFR.js";import"./chunk-F22QLVTX.js";import"./chunk-F53OKXYI.js";import"./chunk-7SAEZ4NC.js";import"./chunk-LUX4PBJL.js";import"./chunk-OPORM35X.js";import"./chunk-4SAVH3H7.js";import"./chunk-YCJHUYBJ.js";import"./chunk-JESNVRVR.js";import{output_manager_default}from"./chunk-DWOJP4ST.js";import"./chunk-BLUPZPAS.js";import"./chunk-RM3ZDRYE.js";import"./chunk-D3AHZ5LI.js";import"./chunk-2GHZGOWT.js";import"./chunk-YHPPP3SF.js";import"./chunk-OO572JUC.js";import"./chunk-A2UZ2O7H.js";import"./chunk-2BKALEOP.js";import{require_source}from"./chunk-NB2WLB3J.js";import"./chunk-ISWW3DKF.js";import"./chunk-BRQUZ5NC.js";import"./chunk-MY4MONOH.js";import{__toESM}from"./chunk-BZENIQ7N.js";var import_chalk=__toESM(require_source(),1);async function discard(client,argv){let parsed=await parseSubcommandArgs(argv,discardSubcommand,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}),stagingVersion=versions.find(v=>v.isStaging);if(!stagingVersion)return output_manager_default.warn(`No staged changes to discard. Make changes first with ${import_chalk.default.cyan(withGlobalFlags(client,"routes add"))}.`),0;output_manager_default.spinner("Fetching staged changes");let{routes:diffRoutes}=await getRoutes(client,project.id,{teamId,versionId:stagingVersion.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 discarded:")}
|
|
9
|
+
|
|
10
|
+
`),printDiffSummary(changedRoutes),output_manager_default.print(`
|
|
11
|
+
`)):output_manager_default.print(`
|
|
12
|
+
${import_chalk.default.gray("No changes detected in staging version.")}
|
|
13
|
+
|
|
14
|
+
`),!await confirmAction(client,parsed.flags["--yes"],"Discard all staged changes?","This action cannot be undone."))return output_manager_default.log("Canceled"),0;let updateStamp=stamp_default();output_manager_default.spinner("Discarding staged changes");try{return await updateRouteVersion(client,project.id,stagingVersion.id,"discard",{teamId}),output_manager_default.log(`${import_chalk.default.cyan("Success!")} Staged changes discarded ${import_chalk.default.gray(updateStamp())}`),0}catch(e){let msg=e.message||"Failed to discard staged changes";return client.nonInteractive?(outputAgentError(client,{status:"error",reason:"api_error",message:msg,next:[{command:withGlobalFlags(client,"routes discard --yes")}]}),process.exit(1),1):(output_manager_default.error(msg),1)}}export{discard as default};
|
|
@@ -0,0 +1,9 @@
|
|
|
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-DSY2S2YT.js";import{parseThreadArg}from"./chunk-2S6PE6GB.js";import{handleCommentsParseError,resolveCommentsScope,threadNotFoundMessage,toApiErrorParts,updateMessage}from"./chunk-3NG2EYQ5.js";import"./chunk-36NK2Z3C.js";import{outputError}from"./chunk-XSQVCDSD.js";import"./chunk-SDOPVIKJ.js";import"./chunk-IQ7FPAI4.js";import{editSubcommand}from"./chunk-OTYF3ZZW.js";import"./chunk-VQ755MPP.js";import"./chunk-WICRM2JL.js";import"./chunk-MXTC4ZAQ.js";import"./chunk-XE24Y6NM.js";import"./chunk-EPO7P734.js";import"./chunk-VLYVVC3P.js";import"./chunk-26QK3I2S.js";import"./chunk-55H6G46X.js";import"./chunk-4NTBYNFR.js";import{parseArguments}from"./chunk-F22QLVTX.js";import"./chunk-F53OKXYI.js";import{validateJsonOutput}from"./chunk-7SAEZ4NC.js";import"./chunk-LUX4PBJL.js";import"./chunk-OPORM35X.js";import"./chunk-4SAVH3H7.js";import{isAPIError}from"./chunk-YCJHUYBJ.js";import"./chunk-JESNVRVR.js";import{output_manager_default}from"./chunk-DWOJP4ST.js";import"./chunk-BLUPZPAS.js";import"./chunk-RM3ZDRYE.js";import"./chunk-D3AHZ5LI.js";import"./chunk-2GHZGOWT.js";import"./chunk-YHPPP3SF.js";import"./chunk-OO572JUC.js";import{getFlagsSpecification}from"./chunk-A2UZ2O7H.js";import"./chunk-2BKALEOP.js";import{require_source}from"./chunk-NB2WLB3J.js";import"./chunk-ISWW3DKF.js";import"./chunk-BRQUZ5NC.js";import"./chunk-MY4MONOH.js";import{__toESM}from"./chunk-BZENIQ7N.js";var import_chalk=__toESM(require_source(),1);async function edit(client,telemetry){let parsedArgs,flagsSpecification=getFlagsSpecification(editSubcommand.options);try{parsedArgs=parseArguments(client.argv.slice(2),flagsSpecification)}catch(err){return handleCommentsParseError(err,"update")}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"]);let[threadInput,messageId]=parsedArgs.args.slice(2);if(telemetry.trackCliArgumentThread(threadInput),telemetry.trackCliArgumentMessageId(messageId),!threadInput||!messageId)return outputError(client,jsonOutput,"MISSING_ARGUMENT","Usage: `vercel comments update <thread> <message-id> --message <text>` \u2014 message IDs are shown in `vercel comments inspect`.");let threadRef=parseThreadArg(threadInput);if(!threadRef)return outputError(client,jsonOutput,"INVALID_THREAD",`Could not extract a thread ID from "${threadInput}".`);let threadId=threadRef.id,content=await resolveMessageContent(client,{message:parsedArgs.flags["--message"],file:parsedArgs.flags["--file"]},jsonOutput);if(typeof content=="number")return content;if(content===void 0)return outputError(client,jsonOutput,"MISSING_CONTENT","Pass the new content with --message <text> or --file <path>.");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;try{let message=await updateMessage(client,scope.teamId,threadId,messageId,{markdown:content});return jsonOutput?(client.stdout.write(`${JSON.stringify(message,null,2)}
|
|
8
|
+
`),0):(output_manager_default.print(`${import_chalk.default.green("\u2713")} Updated message ${messageId}
|
|
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}}export{edit as default};
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { createRequire as __createRequire } from 'node:module';
|
|
2
|
+
import { fileURLToPath as __fileURLToPath } from 'node:url';
|
|
3
|
+
import { dirname as __dirname_ } from 'node:path';
|
|
4
|
+
const require = __createRequire(import.meta.url);
|
|
5
|
+
const __filename = __fileURLToPath(import.meta.url);
|
|
6
|
+
const __dirname = __dirname_(__filename);
|
|
7
|
+
import{editRoute}from"./chunk-AM46JVVN.js";import{applyFlagMutations,cloneRoute,convertRouteToCurrentRoute,generateRoute,generatedRouteToAddInput,hasAnyTransformFlags,populateRouteEnv,printGeneratedRoutePreview,printRouteConfig,routingRuleToCurrentRoute,runInteractiveEditLoop}from"./chunk-KWKEBKUR.js";import{getRouteVersions}from"./chunk-BVH2AEFE.js";import{getRoutes,offerAutoPromote,parseSubcommandArgs,resolveRoute,shellQuoteRouteIdentifierForSuggestion,withGlobalFlags}from"./chunk-TGOGYSBO.js";import{requireProjectContext}from"./chunk-L4XLDN6T.js";import"./chunk-36NK2Z3C.js";import"./chunk-SDOPVIKJ.js";import{stamp_default}from"./chunk-A2RZZQEP.js";import"./chunk-Q7D7RGXM.js";import{editSubcommand}from"./chunk-O7COT3YB.js";import"./chunk-VQ755MPP.js";import"./chunk-WICRM2JL.js";import"./chunk-MXTC4ZAQ.js";import{outputAgentError}from"./chunk-XE24Y6NM.js";import"./chunk-EPO7P734.js";import"./chunk-VLYVVC3P.js";import"./chunk-26QK3I2S.js";import"./chunk-55H6G46X.js";import"./chunk-4NTBYNFR.js";import"./chunk-F22QLVTX.js";import"./chunk-F53OKXYI.js";import"./chunk-7SAEZ4NC.js";import"./chunk-LUX4PBJL.js";import"./chunk-OPORM35X.js";import"./chunk-4SAVH3H7.js";import"./chunk-YCJHUYBJ.js";import"./chunk-JESNVRVR.js";import{output_manager_default}from"./chunk-DWOJP4ST.js";import"./chunk-BLUPZPAS.js";import"./chunk-RM3ZDRYE.js";import"./chunk-D3AHZ5LI.js";import"./chunk-2GHZGOWT.js";import"./chunk-YHPPP3SF.js";import"./chunk-OO572JUC.js";import"./chunk-A2UZ2O7H.js";import"./chunk-2BKALEOP.js";import{require_source}from"./chunk-NB2WLB3J.js";import"./chunk-ISWW3DKF.js";import"./chunk-BRQUZ5NC.js";import"./chunk-MY4MONOH.js";import{__toESM}from"./chunk-BZENIQ7N.js";var import_chalk=__toESM(require_source(),1);async function edit(client,argv){let parsed=await parseSubcommandArgs(argv,editSubcommand,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],{RoutesEditTelemetryClient}=await import("./routes-XKEWEA3P.js"),telemetry=new RoutesEditTelemetryClient({opts:{store:client.telemetryEventStore}});if(telemetry.trackCliArgumentNameOrId(identifier),telemetry.trackCliFlagYes(skipConfirmation),telemetry.trackCliOptionName(flags["--name"]),telemetry.trackCliOptionDescription(flags["--description"]),telemetry.trackCliOptionSrc(flags["--src"]),telemetry.trackCliOptionSrcSyntax(flags["--src-syntax"]),telemetry.trackCliOptionAction(flags["--action"]),telemetry.trackCliOptionDest(flags["--dest"]),telemetry.trackCliOptionStatus(flags["--status"]),telemetry.trackCliFlagNoDest(flags["--no-dest"]),telemetry.trackCliFlagNoStatus(flags["--no-status"]),telemetry.trackCliFlagClearConditions(flags["--clear-conditions"]),telemetry.trackCliFlagClearHeaders(flags["--clear-headers"]),telemetry.trackCliFlagClearTransforms(flags["--clear-transforms"]),telemetry.trackCliOptionSetResponseHeader(flags["--set-response-header"]),telemetry.trackCliOptionAppendResponseHeader(flags["--append-response-header"]),telemetry.trackCliOptionDeleteResponseHeader(flags["--delete-response-header"]),telemetry.trackCliOptionSetRequestHeader(flags["--set-request-header"]),telemetry.trackCliOptionAppendRequestHeader(flags["--append-request-header"]),telemetry.trackCliOptionDeleteRequestHeader(flags["--delete-request-header"]),telemetry.trackCliOptionSetRequestQuery(flags["--set-request-query"]),telemetry.trackCliOptionAppendRequestQuery(flags["--append-request-query"]),telemetry.trackCliOptionDeleteRequestQuery(flags["--delete-request-query"]),telemetry.trackCliOptionHas(flags["--has"]),telemetry.trackCliOptionMissing(flags["--missing"]),telemetry.trackCliOptionAi(flags["--ai"]),!identifier)return client.nonInteractive&&outputAgentError(client,{status:"error",reason:"missing_arguments",message:"Route name or ID is required as the first argument after routes update.",next:[{command:withGlobalFlags(client,"routes update <name-or-id>"),when:"replace <name-or-id> with route name or id from routes list"},{command:withGlobalFlags(client,"routes list"),when:"to list routes"}]},2),output_manager_default.error(`Route name or ID is required. Usage: ${withGlobalFlags(client,"routes update <name-or-id>")}`),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.",next:[{command:withGlobalFlags(client,"routes add --ai <description> --yes"),when:"add a route first (or use full options)"}]},1),output_manager_default.error("No routes found in this project."),1;let originalRoute=await resolveRoute(client,routes,identifier);if(!originalRoute)return client.nonInteractive&&outputAgentError(client,{status:"error",reason:"not_found",message:`No route found matching "${identifier}".`,next:[{command:withGlobalFlags(client,"routes list"),when:"to list routes and pick an exact name or id"},{command:withGlobalFlags(client,"routes update <name-or-id>"),when:"retry with a unique name or id"}]},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 aiPrompt=flags["--ai"];if(aiPrompt){let usedConflicts=["--name","--description","--src","--src-syntax","--action","--dest","--status","--no-dest","--no-status","--has","--missing","--set-response-header","--append-response-header","--delete-response-header","--set-request-header","--append-request-header","--delete-request-header","--set-request-query","--append-request-query","--delete-request-query","--clear-conditions","--clear-headers","--clear-transforms"].filter(f=>flags[f]!==void 0);return usedConflicts.length>0?(client.nonInteractive&&outputAgentError(client,{status:"error",reason:"invalid_arguments",message:`Cannot use --ai with ${usedConflicts.join(", ")}. Use --ai alone to describe changes.`,next:[{command:withGlobalFlags(client,`routes update ${shellQuoteRouteIdentifierForSuggestion(identifier)} --ai <description> --yes`),when:"use only --ai with route id/name already set"}]},2),output_manager_default.error(`Cannot use --ai with ${usedConflicts.join(", ")}. Use --ai alone to describe changes.`),2):await handleAIEdit(client,project.id,teamId,originalRoute,aiPrompt,skipConfirmation,existingStagingVersion)}let route=cloneRoute(originalRoute);if(flags["--name"]!==void 0||flags["--description"]!==void 0||flags["--src"]!==void 0||flags["--src-syntax"]!==void 0||flags["--action"]!==void 0||flags["--dest"]!==void 0||flags["--status"]!==void 0||flags["--no-dest"]!==void 0||flags["--no-status"]!==void 0||flags["--has"]!==void 0||flags["--missing"]!==void 0||flags["--clear-conditions"]!==void 0||flags["--clear-headers"]!==void 0||flags["--clear-transforms"]!==void 0||hasAnyTransformFlags(flags)){let error=applyFlagMutations(route,flags);if(error)return client.nonInteractive&&outputAgentError(client,{status:"error",reason:"invalid_arguments",message:error,next:[{command:withGlobalFlags(client,`routes update ${shellQuoteRouteIdentifierForSuggestion(identifier)} ...`),when:"fix options per message; see routes update --help"}]},2),output_manager_default.error(error),2}else{if(!client.stdin.isTTY||client.nonInteractive)return client.nonInteractive&&outputAgentError(client,{status:"error",reason:"missing_arguments",message:"No update options provided. In non-interactive mode pass options such as --name, --src, --dest, --action, header options, or --ai <description> --yes.",next:[{command:withGlobalFlags(client,`routes update ${shellQuoteRouteIdentifierForSuggestion(identifier)} --dest <dest> --yes`),when:"example: set destination; see routes update --help"}],hint:"Run vercel routes update --help for all options."},2),output_manager_default.error(`No update options provided. When running non-interactively, use options like --name, --dest, --src, etc. Run ${withGlobalFlags(client,"routes update --help")} for all options.`),2;if(output_manager_default.log(`
|
|
8
|
+
Editing route "${originalRoute.name}"`),printRouteConfig(route),await client.input.select({message:"How would you like to update this route?",choices:[{name:"Describe changes (AI-powered)",value:"ai"},{name:"Edit manually (field by field)",value:"manual"}]})==="ai")return telemetry.trackCliOptionAi("interactive"),await handleAIEdit(client,project.id,teamId,originalRoute,void 0,skipConfirmation,existingStagingVersion);await runInteractiveEditLoop(client,route)}if(populateRouteEnv(route.route,route.srcSyntax),JSON.stringify(route)===JSON.stringify(originalRoute))return output_manager_default.log("No changes made."),0;let editStamp=stamp_default();output_manager_default.spinner(`Updating route "${route.name}"`);try{let{version}=await editRoute(client,project.id,originalRoute.id,{route:{name:route.name,description:route.description,enabled:route.enabled,srcSyntax:route.srcSyntax,route:route.route}},{teamId});return output_manager_default.log(`${import_chalk.default.cyan("Updated")} route "${route.name}" ${import_chalk.default.gray(editStamp())}`),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 update route"),1}}async function handleAIEdit(client,projectId,teamId,originalRoute,aiPrompt,skipConfirmation,existingStagingVersion){let currentRoute=routingRuleToCurrentRoute(originalRoute),prompt=aiPrompt,currentGenerated;for(;;){prompt||(prompt=await client.input.text({message:"Describe what you'd like to change:",validate:val=>val?val.length>2e3?"Description must be 2000 characters or less":!0:"A description is required"})),output_manager_default.spinner("Generating updated route...");let errorMessage;try{let result=await generateRoute(client,projectId,{prompt,currentRoute},{teamId});result.error?errorMessage=result.error:result.route?currentGenerated=result.route:errorMessage="Could not apply changes. Try rephrasing."}catch(e){errorMessage=e.message||"Failed to generate updated route"}if(currentGenerated)break;if(output_manager_default.error(errorMessage),skipConfirmation||!client.stdin.isTTY)return 1;if(await client.input.select({message:"What would you like to do?",choices:[{name:"Try again with a different description",value:"retry"},{name:"Cancel",value:"cancel"}]})==="cancel")return output_manager_default.log("No changes made."),0;prompt=void 0}if(printGeneratedRoutePreview(currentGenerated),skipConfirmation)return await applyAIEdit(client,projectId,teamId,originalRoute,currentGenerated,existingStagingVersion,skipConfirmation);if(!client.stdin.isTTY)return output_manager_default.error(`Cannot interactively confirm route changes in a non-TTY environment. Use ${withGlobalFlags(client,'routes update <name-or-id> --ai "..." --yes')} to skip confirmation.`),1;for(;;){let choice=await client.input.select({message:"What would you like to do?",choices:[{name:"Confirm changes",value:"confirm"},{name:"Edit again with AI",value:"ai-edit"},{name:"Edit manually",value:"manual"},{name:"Discard",value:"discard"}],pageSize:4,loop:!1});if(choice==="confirm")return await applyAIEdit(client,projectId,teamId,originalRoute,currentGenerated,existingStagingVersion,skipConfirmation);if(choice==="ai-edit"){let editPrompt=await client.input.text({message:"Describe what you'd like to change:",validate:val=>val?val.length>2e3?"Description must be 2000 characters or less":!0:"A description is required"});output_manager_default.spinner("Updating route...");try{let editResult=await generateRoute(client,projectId,{prompt:editPrompt,currentRoute:convertRouteToCurrentRoute(currentGenerated)},{teamId});if(editResult.error){output_manager_default.error(editResult.error),output_manager_default.log("Keeping previous route:"),printGeneratedRoutePreview(currentGenerated);continue}if(!editResult.route){output_manager_default.error("Could not apply changes. Try rephrasing."),output_manager_default.log("Keeping previous route:"),printGeneratedRoutePreview(currentGenerated);continue}currentGenerated=editResult.route,printGeneratedRoutePreview(currentGenerated)}catch(e){let error=e;output_manager_default.error(error.message||"Failed to update route"),output_manager_default.log("Keeping previous route:"),printGeneratedRoutePreview(currentGenerated)}continue}if(choice==="manual"){let routeInput=generatedRouteToAddInput(currentGenerated),manualRoute=cloneRoute(originalRoute);manualRoute.name=routeInput.name,manualRoute.description=routeInput.description,manualRoute.srcSyntax=routeInput.srcSyntax,manualRoute.route=routeInput.route,await runInteractiveEditLoop(client,manualRoute),populateRouteEnv(manualRoute.route,manualRoute.srcSyntax);let editStamp=stamp_default();output_manager_default.spinner(`Updating route "${manualRoute.name}"`);try{let{version}=await editRoute(client,projectId,originalRoute.id,{route:{name:manualRoute.name,description:manualRoute.description,enabled:manualRoute.enabled,srcSyntax:manualRoute.srcSyntax,route:manualRoute.route}},{teamId});return output_manager_default.log(`${import_chalk.default.cyan("Updated")} route "${manualRoute.name}" ${import_chalk.default.gray(editStamp())}`),await offerAutoPromote(client,projectId,version,!!existingStagingVersion,{teamId,skipPrompts:skipConfirmation}),0}catch(e){let error=e;return output_manager_default.error(error.message||"Failed to update route"),1}}return output_manager_default.log("No changes made."),0}}async function applyAIEdit(client,projectId,teamId,originalRoute,generated,existingStagingVersion,skipConfirmation){let routeInput=generatedRouteToAddInput(generated);populateRouteEnv(routeInput.route,routeInput.srcSyntax);let editStamp=stamp_default();output_manager_default.spinner(`Updating route "${routeInput.name}"`);try{let{version}=await editRoute(client,projectId,originalRoute.id,{route:{name:routeInput.name,description:routeInput.description,enabled:originalRoute.enabled,srcSyntax:routeInput.srcSyntax,route:routeInput.route}},{teamId});return output_manager_default.log(`${import_chalk.default.cyan("Updated")} route "${routeInput.name}" ${import_chalk.default.gray(editStamp())}`),await offerAutoPromote(client,projectId,version,!!existingStagingVersion,{teamId,skipPrompts:skipConfirmation}),0}catch(e){let error=e;return output_manager_default.error(error.message||"Failed to update route"),1}}export{edit as default};
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { createRequire as __createRequire } from 'node:module';
|
|
2
|
+
import { fileURLToPath as __fileURLToPath } from 'node:url';
|
|
3
|
+
import { dirname as __dirname_ } from 'node:path';
|
|
4
|
+
const require = __createRequire(import.meta.url);
|
|
5
|
+
const __filename = __fileURLToPath(import.meta.url);
|
|
6
|
+
const __dirname = __dirname_(__filename);
|
|
7
|
+
import{editRoute}from"./chunk-AM46JVVN.js";import{getRouteVersions}from"./chunk-BVH2AEFE.js";import{getRoutes,offerAutoPromote,parseSubcommandArgs,resolveRoute,withGlobalFlags}from"./chunk-TGOGYSBO.js";import{requireProjectContext}from"./chunk-L4XLDN6T.js";import"./chunk-36NK2Z3C.js";import"./chunk-SDOPVIKJ.js";import{stamp_default}from"./chunk-A2RZZQEP.js";import"./chunk-Q7D7RGXM.js";import{enableSubcommand}from"./chunk-O7COT3YB.js";import"./chunk-VQ755MPP.js";import"./chunk-WICRM2JL.js";import"./chunk-MXTC4ZAQ.js";import{outputAgentError}from"./chunk-XE24Y6NM.js";import"./chunk-EPO7P734.js";import"./chunk-VLYVVC3P.js";import"./chunk-26QK3I2S.js";import"./chunk-55H6G46X.js";import"./chunk-4NTBYNFR.js";import"./chunk-F22QLVTX.js";import"./chunk-F53OKXYI.js";import"./chunk-7SAEZ4NC.js";import"./chunk-LUX4PBJL.js";import"./chunk-OPORM35X.js";import"./chunk-4SAVH3H7.js";import"./chunk-YCJHUYBJ.js";import"./chunk-JESNVRVR.js";import{output_manager_default}from"./chunk-DWOJP4ST.js";import"./chunk-BLUPZPAS.js";import"./chunk-RM3ZDRYE.js";import"./chunk-D3AHZ5LI.js";import"./chunk-2GHZGOWT.js";import"./chunk-YHPPP3SF.js";import"./chunk-OO572JUC.js";import"./chunk-A2UZ2O7H.js";import"./chunk-2BKALEOP.js";import{require_source}from"./chunk-NB2WLB3J.js";import"./chunk-ISWW3DKF.js";import"./chunk-BRQUZ5NC.js";import"./chunk-MY4MONOH.js";import{__toESM}from"./chunk-BZENIQ7N.js";var import_chalk=__toESM(require_source(),1);async function enable(client,argv){let parsed=await parseSubcommandArgs(argv,enableSubcommand,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}=parsed,identifier=args[0];if(!identifier)return client.nonInteractive&&outputAgentError(client,{status:"error",reason:"missing_arguments",message:"Route name or ID is required.",next:[{command:withGlobalFlags(client,"routes enable <name-or-id>"),when:"replace <name-or-id>"},{command:withGlobalFlags(client,"routes list"),when:"list routes"}]},2),output_manager_default.error(`Route name or ID is required. Usage: ${withGlobalFlags(client,"routes enable <name-or-id>")}`),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.",next:[{command:withGlobalFlags(client,"routes add --help"),when:"add routes first"}]},1),output_manager_default.error("No routes found in this project."),1;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;if(route.enabled!==!1)return output_manager_default.log(`Route "${route.name}" is already enabled.`),0;let enableStamp=stamp_default();output_manager_default.spinner(`Enabling route "${route.name}"`);try{let{version}=await editRoute(client,project.id,route.id,{route:{name:route.name,description:route.description,enabled:!0,srcSyntax:route.srcSyntax,route:route.route}},{teamId});return output_manager_default.log(`${import_chalk.default.cyan("Enabled")} route "${route.name}" ${import_chalk.default.gray(enableStamp())}`),await offerAutoPromote(client,project.id,version,!!existingStagingVersion,{teamId}),0}catch(e){let error=e;return client.nonInteractive&&outputAgentError(client,{status:"error",reason:"api_error",message:error.message||"Failed to enable route"},1),output_manager_default.error(error.message||"Failed to enable route"),1}}export{enable as default};
|
|
@@ -4,7 +4,7 @@ import { dirname as __dirname_ } from 'node:path';
|
|
|
4
4
|
const require = __createRequire(import.meta.url);
|
|
5
5
|
const __filename = __fileURLToPath(import.meta.url);
|
|
6
6
|
const __dirname = __dirname_(__filename);
|
|
7
|
-
import{require_execa}from"./chunk-
|
|
7
|
+
import{require_execa}from"./chunk-RCUDI7OF.js";import"./chunk-GD7AV7BO.js";import{require_dist as require_dist3}from"./chunk-JALVF3C2.js";import{require_lib}from"./chunk-LUX4PBJL.js";import"./chunk-OPORM35X.js";import{output_manager_default,require_build_utils}from"./chunk-DWOJP4ST.js";import"./chunk-BLUPZPAS.js";import{require_dist as require_dist2}from"./chunk-RM3ZDRYE.js";import"./chunk-D3AHZ5LI.js";import"./chunk-2GHZGOWT.js";import"./chunk-YHPPP3SF.js";import"./chunk-2BKALEOP.js";import"./chunk-NB2WLB3J.js";import"./chunk-ISWW3DKF.js";import"./chunk-BRQUZ5NC.js";import"./chunk-FBYA6LLM.js";import"./chunk-SCV7XEEO.js";import{toNodeReadable}from"./chunk-MY4MONOH.js";import{__commonJS as __commonJS2,__require,__toESM as __toESM3}from"./chunk-BZENIQ7N.js";var require_dist4=__commonJS2({"../../node_modules/.pnpm/@edge-runtime+node-utils@2.3.0/node_modules/@edge-runtime/node-utils/dist/index.js"(exports,module){"use strict";var __create2=Object.create,__defProp2=Object.defineProperty,__getOwnPropDesc2=Object.getOwnPropertyDescriptor,__getOwnPropNames2=Object.getOwnPropertyNames,__getProtoOf2=Object.getPrototypeOf,__hasOwnProp2=Object.prototype.hasOwnProperty,__commonJS=(cb,mod)=>function(){return mod||(0,cb[__getOwnPropNames2(cb)[0]])((mod={exports:{}}).exports,mod),mod.exports},__export2=(target,all)=>{for(var name in all)__defProp2(target,name,{get:all[name],enumerable:!0})},__copyProps2=(to,from,except,desc)=>{if(from&&typeof from=="object"||typeof from=="function")for(let key of __getOwnPropNames2(from))!__hasOwnProp2.call(to,key)&&key!==except&&__defProp2(to,key,{get:()=>from[key],enumerable:!(desc=__getOwnPropDesc2(from,key))||desc.enumerable});return to},__toESM2=(mod,isNodeMode,target)=>(target=mod!=null?__create2(__getProtoOf2(mod)):{},__copyProps2(isNodeMode||!mod||!mod.__esModule?__defProp2(target,"default",{value:mod,enumerable:!0}):target,mod)),__toCommonJS2=mod=>__copyProps2(__defProp2({},"__esModule",{value:!0}),mod),require_console_js_text=__commonJS({"../primitives/dist/console.js.text.js"(exports2,module2){"use strict";module2.exports=`"use strict";
|
|
8
8
|
var __create = Object.create;
|
|
9
9
|
var __defProp = Object.defineProperty;
|
|
10
10
|
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
@@ -4,7 +4,7 @@ import { dirname as __dirname_ } from 'node:path';
|
|
|
4
4
|
const require = __createRequire(import.meta.url);
|
|
5
5
|
const __filename = __fileURLToPath(import.meta.url);
|
|
6
6
|
const __dirname = __dirname_(__filename);
|
|
7
|
-
import{getRoutes,parseSubcommandArgs,withGlobalFlags}from"./chunk-
|
|
7
|
+
import{getRoutes,parseSubcommandArgs,withGlobalFlags}from"./chunk-TGOGYSBO.js";import{requireProjectContext}from"./chunk-L4XLDN6T.js";import"./chunk-36NK2Z3C.js";import"./chunk-SDOPVIKJ.js";import{exportSubcommand}from"./chunk-O7COT3YB.js";import"./chunk-VQ755MPP.js";import"./chunk-WICRM2JL.js";import"./chunk-MXTC4ZAQ.js";import{outputAgentError}from"./chunk-XE24Y6NM.js";import"./chunk-EPO7P734.js";import"./chunk-VLYVVC3P.js";import"./chunk-26QK3I2S.js";import"./chunk-55H6G46X.js";import"./chunk-4NTBYNFR.js";import"./chunk-F22QLVTX.js";import"./chunk-F53OKXYI.js";import"./chunk-7SAEZ4NC.js";import"./chunk-LUX4PBJL.js";import"./chunk-OPORM35X.js";import"./chunk-4SAVH3H7.js";import"./chunk-YCJHUYBJ.js";import"./chunk-JESNVRVR.js";import{output_manager_default}from"./chunk-DWOJP4ST.js";import"./chunk-BLUPZPAS.js";import"./chunk-RM3ZDRYE.js";import"./chunk-D3AHZ5LI.js";import"./chunk-2GHZGOWT.js";import"./chunk-YHPPP3SF.js";import"./chunk-OO572JUC.js";import"./chunk-A2UZ2O7H.js";import"./chunk-2BKALEOP.js";import"./chunk-NB2WLB3J.js";import"./chunk-ISWW3DKF.js";import"./chunk-BRQUZ5NC.js";import"./chunk-MY4MONOH.js";import"./chunk-BZENIQ7N.js";function cleanRoute(route){let cleaned={};for(let[key,value]of Object.entries(route))value!==void 0&&(key==="middlewarePath"||key==="middlewareRawSrc"||key==="middleware"||key==="check"||key==="important"||(cleaned[key]=value));return cleaned}function routesToVercelJson(rules){let config={routes:rules.filter(r=>r.enabled!==!1).map(r=>cleanRoute(r.route))};return JSON.stringify(config,null,2)}function routesToVercelTs(rules){let routeEntries=rules.filter(r=>r.enabled!==!1).map(r=>{let cleaned=cleanRoute(r.route),indented=JSON.stringify(cleaned,null,2).split(`
|
|
8
8
|
`).map((line,i)=>i===0?line:` ${line}`).join(`
|
|
9
9
|
`);return r.description?` // ${r.description.replace(/\n/g," ")}
|
|
10
10
|
${indented}`:` ${indented}`});return`import type { VercelConfig } from '@vercel/config/v1';
|