@vercel/cli-support 66.6.0 → 68.0.0-snapshot-c9dfd83f2293
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/chunks/add-NIIHCHGH.js +8 -0
- package/dist/chunks/add-ORZO4EJ7.js +8 -0
- package/dist/chunks/add-SKRNSMC6.js +8 -0
- package/dist/chunks/{alerts-72Q42HNT.js → alerts-MNMZH6BO.js} +1 -1
- package/dist/chunks/build-P7KKWO4O.js +7 -0
- package/dist/chunks/{chunk-ZZD5W5KT.js → chunk-23FY4PR3.js} +1 -1
- package/dist/chunks/{chunk-YTRKHRL3.js → chunk-27FVSW45.js} +1 -1
- package/dist/chunks/{chunk-IIK6GUVI.js → chunk-2BK7SZQA.js} +1 -1
- package/dist/chunks/{chunk-WJX5PGNN.js → chunk-2DH6LTUI.js} +1 -1
- package/dist/chunks/{chunk-D2TVI7KK.js → chunk-2HFP22IP.js} +4 -4
- package/dist/chunks/{chunk-7AVHDJSP.js → chunk-2KXLL3DX.js} +4 -4
- package/dist/chunks/{chunk-YEDS2UMW.js → chunk-2ZN4JRDA.js} +1 -1
- package/dist/chunks/{chunk-DJZBJC2A.js → chunk-3AFEVHHY.js} +1 -1
- package/dist/chunks/{chunk-FOFX7LHS.js → chunk-3OPLG6HM.js} +1 -1
- package/dist/chunks/{chunk-Q66LJNIV.js → chunk-3RFQ2NXZ.js} +1 -1
- package/dist/chunks/{chunk-F4UEGELU.js → chunk-3VNS4D7V.js} +1 -1
- package/dist/chunks/{chunk-XAGG5BJT.js → chunk-43XDA7ST.js} +1 -1
- package/dist/chunks/{chunk-OXS5VO4X.js → chunk-4D5DAM3D.js} +1 -1
- package/dist/chunks/chunk-4Z6R5KHZ.js +78 -0
- package/dist/chunks/{chunk-5KSBRQI2.js → chunk-5727HGA6.js} +1 -1
- package/dist/chunks/{chunk-6GE4V7MW.js → chunk-572VGS6P.js} +2 -2
- package/dist/chunks/{chunk-O7GNYVVM.js → chunk-5OGPMRRQ.js} +2 -2
- package/dist/chunks/{chunk-UUBPAYTG.js → chunk-5RMIM4S2.js} +1 -1
- package/dist/chunks/chunk-67GZ5REA.js +7 -0
- package/dist/chunks/{chunk-VHSAI6FS.js → chunk-6FEMU5YF.js} +1 -1
- package/dist/chunks/chunk-6JTZZSFH.js +7 -0
- package/dist/chunks/{chunk-UDZJCD5W.js → chunk-6KNWKZR4.js} +1 -1
- package/dist/chunks/{chunk-ZKNEIE44.js → chunk-6NC2JFUQ.js} +1 -1
- package/dist/chunks/{chunk-5O4AXCN7.js → chunk-6OJVCMG5.js} +1 -1
- package/dist/chunks/{chunk-X7KKWUPS.js → chunk-6WBEU34Y.js} +1 -1
- package/dist/chunks/{chunk-NBTFAXL4.js → chunk-6Z5REGCM.js} +1 -1
- package/dist/chunks/{chunk-VPSR2O55.js → chunk-7AAYWDIZ.js} +3 -3
- package/dist/chunks/{chunk-WIF4VGYZ.js → chunk-7GJ37QPL.js} +1 -1
- package/dist/chunks/chunk-7HQZRU25.js +10 -0
- package/dist/chunks/{chunk-XECELSF5.js → chunk-7JU5RJ3H.js} +1 -1
- package/dist/chunks/{chunk-KSGN5OCV.js → chunk-7K5ZWVDL.js} +1 -1
- package/dist/chunks/{chunk-UQZZX2J7.js → chunk-7OZ7OKPS.js} +1 -1
- package/dist/chunks/{chunk-PFOOPXTN.js → chunk-7RABG6HV.js} +2 -2
- package/dist/chunks/{chunk-AMH5MXDW.js → chunk-7WDSOKOY.js} +1 -1
- package/dist/chunks/{chunk-ELM2KPYX.js → chunk-A4LOQ3UK.js} +1 -1
- package/dist/chunks/{chunk-SYJXONEV.js → chunk-A6CMQOL7.js} +1 -1
- package/dist/chunks/chunk-AOPFMMUK.js +13 -0
- package/dist/chunks/{chunk-2OMI3IUW.js → chunk-AVXX4Q6S.js} +1 -1
- package/dist/chunks/{chunk-YEUIG3JC.js → chunk-AZVSMIPP.js} +1 -1
- package/dist/chunks/{chunk-XLYO5QNG.js → chunk-B7IUFV5P.js} +2 -2
- package/dist/chunks/{chunk-IF6GA273.js → chunk-BGIGZUFG.js} +1 -1
- package/dist/chunks/{chunk-YLLFLPNA.js → chunk-BHL2HM6I.js} +1 -1
- package/dist/chunks/{chunk-YIOMTAUF.js → chunk-BKFRN6C2.js} +1 -1
- package/dist/chunks/chunk-BS32OUOC.js +7 -0
- package/dist/chunks/{chunk-YJNMDXEG.js → chunk-BUBVZ6SQ.js} +1 -1
- package/dist/chunks/{chunk-VZ4URN3U.js → chunk-BYBELFCP.js} +1 -1
- package/dist/chunks/{chunk-B7GCRM5I.js → chunk-BYYNR34Q.js} +1 -1
- package/dist/chunks/{chunk-5TMHRECT.js → chunk-CAJ2OUSR.js} +1 -1
- package/dist/chunks/chunk-CDJ25IKC.js +7 -0
- package/dist/chunks/chunk-CJMNUD2I.js +12 -0
- package/dist/chunks/chunk-CSNP5RIM.js +11 -0
- package/dist/chunks/{chunk-REJLEESP.js → chunk-CTMTO2W4.js} +1 -1
- package/dist/chunks/{chunk-K3MGQQEP.js → chunk-D5JQZXL7.js} +1 -1
- package/dist/chunks/{chunk-6PDKIOAO.js → chunk-DEFA6XAB.js} +1 -1
- package/dist/chunks/{chunk-OE26EQSH.js → chunk-DEX4QU4S.js} +1 -1
- package/dist/chunks/{chunk-W2L24GM7.js → chunk-DMA77UYG.js} +1 -1
- package/dist/chunks/{chunk-LM3YPF3K.js → chunk-DOOBZO4W.js} +1 -1
- package/dist/chunks/chunk-DORCX7UB.js +7 -0
- package/dist/chunks/{chunk-C335SWOB.js → chunk-DUSMVY4N.js} +1 -1
- package/dist/chunks/{chunk-XDYVJWGX.js → chunk-E5A7E7X6.js} +1 -1
- package/dist/chunks/{chunk-GLCSWIB4.js → chunk-E7IN2DGU.js} +1 -1
- package/dist/chunks/chunk-EYRBV6RM.js +25 -0
- package/dist/chunks/{chunk-AKOYIH3A.js → chunk-F4KY2TOK.js} +1 -1
- package/dist/chunks/{chunk-DZ77BIEV.js → chunk-F4ZKTFQH.js} +1 -1
- package/dist/chunks/chunk-F7X6O4ZC.js +7 -0
- package/dist/chunks/{chunk-TSNRTRIM.js → chunk-FB37TFVF.js} +1 -1
- package/dist/chunks/{chunk-BCAI7MED.js → chunk-FGWYM3SF.js} +1 -1
- package/dist/chunks/{chunk-SYVWRGFQ.js → chunk-FGXULLNK.js} +1 -1
- package/dist/chunks/{chunk-T7GKQYWA.js → chunk-FXLZM6Q7.js} +1 -1
- package/dist/chunks/{chunk-JBYROCAC.js → chunk-FYM5EUNW.js} +1 -1
- package/dist/chunks/{chunk-RVIJRFVD.js → chunk-G24EKATW.js} +1 -1
- package/dist/chunks/chunk-GQXKF3PR.js +7 -0
- package/dist/chunks/{chunk-2G2SALNN.js → chunk-H2QMSLKJ.js} +1 -1
- package/dist/chunks/{chunk-33HVDSWP.js → chunk-HMJR6RVF.js} +1 -1
- package/dist/chunks/{chunk-S4AANAHX.js → chunk-HQ3ZFXXQ.js} +1 -1
- package/dist/chunks/chunk-HYGWJQN6.js +8 -0
- package/dist/chunks/chunk-I4O53MKV.js +8 -0
- package/dist/chunks/{chunk-TOTTVS5P.js → chunk-ID663OJ7.js} +1 -1
- package/dist/chunks/{chunk-FFN3EGSF.js → chunk-IKNAOU5O.js} +1 -1
- package/dist/chunks/{chunk-CINNNQDJ.js → chunk-INIZJZ3O.js} +1 -1
- package/dist/chunks/{chunk-LNZEYUEC.js → chunk-IVZNPSHU.js} +1 -1
- package/dist/chunks/{chunk-YOAQNRBN.js → chunk-IY7OKDHU.js} +3 -3
- package/dist/chunks/{chunk-2D5PTFAY.js → chunk-J7POLUHY.js} +1 -1
- package/dist/chunks/{chunk-6CJFPT4F.js → chunk-JDDPCL3K.js} +1 -1
- package/dist/chunks/chunk-JR25PLC7.js +13 -0
- package/dist/chunks/chunk-JV3YIOCO.js +7 -0
- package/dist/chunks/{chunk-RBW62SOU.js → chunk-JXE7GYE3.js} +1 -1
- package/dist/chunks/{chunk-EFP3LK4G.js → chunk-K5SM5NIY.js} +1 -1
- package/dist/chunks/chunk-K6KS5GZD.js +16 -0
- package/dist/chunks/chunk-K7TSWIKR.js +12 -0
- package/dist/chunks/{chunk-FEJD7MRH.js → chunk-KA2KG3SY.js} +1 -1
- package/dist/chunks/{chunk-GUGP6OY2.js → chunk-KFBA2MAV.js} +1 -1
- package/dist/chunks/{table-W6LOHWWF.js → chunk-KG526MHL.js} +1 -1
- package/dist/chunks/chunk-KHMNANEN.js +7 -0
- package/dist/chunks/chunk-KVXEYKIX.js +7 -0
- package/dist/chunks/{chunk-F37XFLFP.js → chunk-L3YEI2RW.js} +1 -1
- package/dist/chunks/{chunk-54FY6GJ5.js → chunk-L46V6VL3.js} +1 -1
- package/dist/chunks/chunk-LD25KYMI.js +30 -0
- package/dist/chunks/{chunk-ANIA2G6F.js → chunk-LDDXXDN5.js} +1 -1
- package/dist/chunks/{chunk-M7FED5YP.js → chunk-M2Q2DUHO.js} +1 -1
- package/dist/chunks/{chunk-5ZCSFPWG.js → chunk-MDRI27KN.js} +1 -1
- package/dist/chunks/{chunk-2AU6O6Z5.js → chunk-MJ77FDK2.js} +1 -1
- package/dist/chunks/{chunk-GHNHUSVK.js → chunk-MMMJO2M3.js} +1 -1
- package/dist/chunks/chunk-N4PID4SD.js +7 -0
- package/dist/chunks/chunk-N6MNUNZ4.js +37 -0
- package/dist/chunks/chunk-NMY2YZ6M.js +8 -0
- package/dist/chunks/{chunk-QRG24GJG.js → chunk-NOAZDAOU.js} +1 -1
- package/dist/chunks/{chunk-ZJNDLFZ7.js → chunk-OOPF73RV.js} +1 -1
- package/dist/chunks/{chunk-YRKW42CD.js → chunk-OQXHBPPS.js} +1 -1
- package/dist/chunks/{chunk-SQCVI2EG.js → chunk-OVWS4CFW.js} +1 -1
- package/dist/chunks/{chunk-WAFBTC45.js → chunk-PHPJS2G2.js} +1 -1
- package/dist/chunks/{chunk-TNQUCTJH.js → chunk-PPCZYUSO.js} +1 -1
- package/dist/chunks/chunk-PZL7NSDA.js +24 -0
- package/dist/chunks/{chunk-OISNKAC6.js → chunk-Q45SQL44.js} +2 -2
- package/dist/chunks/{chunk-XDWAUOFO.js → chunk-Q4XCBBWK.js} +1 -1
- package/dist/chunks/chunk-Q7HFUXJ4.js +10 -0
- package/dist/chunks/chunk-QFE3RPMA.js +19 -0
- package/dist/chunks/{chunk-L5PIUIUM.js → chunk-QFSIUMC6.js} +1 -1
- package/dist/chunks/{chunk-CSCUVSJM.js → chunk-QG5UBKDA.js} +1 -1
- package/dist/chunks/{chunk-KLYFOXYH.js → chunk-QGS3ERDZ.js} +3 -3
- package/dist/chunks/{chunk-3UZE566G.js → chunk-QSL6AG2B.js} +1 -1
- package/dist/chunks/chunk-QU74BFN2.js +10 -0
- package/dist/chunks/{chunk-ACN6DBTC.js → chunk-R3QHEJL6.js} +1 -1
- package/dist/chunks/{chunk-BDXK4TCN.js → chunk-RHFNVIFD.js} +1 -1
- package/dist/chunks/chunk-RPYIWRSN.js +7 -0
- package/dist/chunks/{chunk-AP6DZGTK.js → chunk-RYSO5U3E.js} +1 -1
- package/dist/chunks/{chunk-N6JHFCWC.js → chunk-S7Y24A5X.js} +1 -1
- package/dist/chunks/chunk-SGNDE4YS.js +7 -0
- package/dist/chunks/{chunk-OF32Z3UP.js → chunk-SHJ3XTD3.js} +1 -1
- package/dist/chunks/{chunk-R33HJGYA.js → chunk-SHL6BPBV.js} +1 -1
- package/dist/chunks/{chunk-GLIQ4KNY.js → chunk-SQ62IODX.js} +1 -1
- package/dist/chunks/{chunk-PIDEH4SJ.js → chunk-T44RB754.js} +1 -1
- package/dist/chunks/{chunk-DHKWTBF6.js → chunk-T4DOV5S4.js} +1 -1
- package/dist/chunks/chunk-T5JHWXS5.js +8 -0
- package/dist/chunks/{chunk-TJUZVODP.js → chunk-TLKBGAOL.js} +1 -1
- package/dist/chunks/{chunk-ZA5O22ZY.js → chunk-TOCPUQ6N.js} +1 -1
- package/dist/chunks/{chunk-CJZE7647.js → chunk-U5SZQUYO.js} +1 -1
- package/dist/chunks/chunk-UAS3WUFB.js +11 -0
- package/dist/chunks/chunk-VIOIR6II.js +7 -0
- package/dist/chunks/{chunk-3A3GU62R.js → chunk-VMRFCU6F.js} +1 -1
- package/dist/chunks/{chunk-Y77DXGGN.js → chunk-VQZ773A2.js} +1 -1
- package/dist/chunks/chunk-VWKA6RKB.js +7 -0
- package/dist/chunks/{chunk-FCTTEFC5.js → chunk-WAOS5OCB.js} +1 -1
- package/dist/chunks/chunk-WBEPIG4S.js +31 -0
- package/dist/chunks/{chunk-AFHZC47H.js → chunk-WBXM3W44.js} +1 -1
- package/dist/chunks/{chunk-MINTHN6C.js → chunk-WEL2Y6OH.js} +1 -1
- package/dist/chunks/{chunk-RDDIWY3O.js → chunk-WGU2IQPY.js} +3 -3
- package/dist/chunks/{chunk-DOMBKOLJ.js → chunk-WLD4SGKM.js} +1 -1
- package/dist/chunks/{chunk-6FYPSSL4.js → chunk-X6JQI64G.js} +1 -1
- package/dist/chunks/{chunk-L75A5BMY.js → chunk-X755TPX6.js} +1 -1
- package/dist/chunks/{chunk-QZKRVE44.js → chunk-XQZBXQZ2.js} +1 -1
- package/dist/chunks/{chunk-AB4WXRCO.js → chunk-Y3V4JYK6.js} +1 -1
- package/dist/chunks/{chunk-LKW6GVP2.js → chunk-Y4YBQUQM.js} +1 -1
- package/dist/chunks/{chunk-I5KIA2XV.js → chunk-YBAGKQXC.js} +1 -1
- package/dist/chunks/{chunk-3OZCZF4N.js → chunk-YFOBGEOW.js} +1 -1
- package/dist/chunks/{chunk-E4VPDMRQ.js → chunk-YJJCELMY.js} +1 -1
- package/dist/chunks/chunk-YLXXGQQQ.js +7 -0
- package/dist/chunks/{chunk-BMIYC2MH.js → chunk-YN3HZJXW.js} +1 -1
- package/dist/chunks/chunk-YNMTP26U.js +7 -0
- package/dist/chunks/chunk-YTSGFU5T.js +7 -0
- package/dist/chunks/{chunk-Z2PTPD6J.js → chunk-YTSUDTAK.js} +1 -1
- package/dist/chunks/{chunk-QZJOKECY.js → chunk-YYDI5Q5K.js} +2 -2
- package/dist/chunks/{chunk-DOBV3XLO.js → chunk-Z3YQZSU4.js} +1 -1
- package/dist/chunks/chunk-Z643WTC4.js +15 -0
- package/dist/chunks/{chunk-D2E4COIY.js → chunk-ZBZQEDZY.js} +1 -1
- package/dist/chunks/chunk-ZRFDZO7Y.js +7 -0
- package/dist/chunks/chunk-ZSEFELXB.js +23 -0
- package/dist/chunks/{chunk-UECFEOOH.js → chunk-ZXSZH7N5.js} +1 -1
- package/dist/chunks/clear-B3I7ZYEY.js +8 -0
- package/dist/chunks/cli-embedded-NR5F35LW.js +87 -0
- package/dist/chunks/compile-vercel-config-ZQMPTEM6.js +7 -0
- package/dist/chunks/config-4GZY5MR4.js +7 -0
- package/dist/chunks/config-ZY22VRFX.js +8 -0
- package/dist/chunks/config-validator.mjs +1 -1
- package/dist/chunks/{connect-git-provider-CIRRFPI2.js → connect-git-provider-WGKVFXW2.js} +1 -1
- package/dist/chunks/create-project-BTOHPKZB.js +7 -0
- package/dist/chunks/delete-K2HS7YCM.js +10 -0
- package/dist/chunks/delete-RVTGE4BU.js +9 -0
- package/dist/chunks/describe-5ZCOXUID.js +25 -0
- package/dist/chunks/detect-projects-AZXG6BRD.js +7 -0
- package/dist/chunks/detect-services-FLNYWWJS.js +7 -0
- package/dist/chunks/disable-AS6DQMHM.js +7 -0
- package/dist/chunks/discard-PYU5CG67.js +14 -0
- package/dist/chunks/edit-HSMIPVPN.js +9 -0
- package/dist/chunks/edit-RLRJSNZY.js +8 -0
- package/dist/chunks/enable-JPWR5EPC.js +7 -0
- package/dist/chunks/{engine-D8YAsQS_-WNPHYRQF.js → engine-C8wCzkw--PYVABGU4.js} +1 -1
- package/dist/chunks/esm-5GQXHN7C.js +9 -0
- package/dist/chunks/esm-FJCIOBBV.js +7 -0
- package/dist/chunks/{esm-FSME24KA.js → esm-IYH32MTQ.js} +1 -1
- package/dist/chunks/esm-LEQXRLFV.js +9 -0
- package/dist/chunks/esm-NHCCFW7Z.js +7 -0
- package/dist/chunks/esm-QQ3MUOW4.js +7 -0
- package/dist/chunks/esm-T655CG6O.js +7 -0
- package/dist/chunks/{exec-ALB7WFEF.js → exec-PCSP64LR.js} +1 -1
- package/dist/chunks/{export-TOSUN6JO.js → export-6WFWSAO4.js} +2 -3
- package/dist/chunks/future-QLQMHIPL.js +7 -0
- package/dist/chunks/generate-cert-for-deploy-JKVOVQ3B.js +7 -0
- package/dist/chunks/image-POIJ2G2Y.js +7 -0
- package/dist/chunks/import-builders-YF5MX6ZA.js +7 -0
- package/dist/chunks/{inspect-SX3QQUEQ.js → inspect-4CURZZPU.js} +1 -1
- package/dist/chunks/{inspect-DFYVVIJW.js → inspect-BAYMK22S.js} +1 -1
- package/dist/chunks/inspect-JTBMNWWI.js +13 -0
- package/dist/chunks/{inspect-GBH7FAW6.js → inspect-TBQRBTX3.js} +1 -1
- package/dist/chunks/inspect-W4WSFBOF.js +9 -0
- package/dist/chunks/{inspect-4Y2OD5MI.js → inspect-YKSWSH3T.js} +1 -1
- package/dist/chunks/{list-HD6KXAIG.js → list-E65OFWSS.js} +1 -1
- package/dist/chunks/list-EWYN3F4Y.js +12 -0
- package/dist/chunks/{list-MW2FV253.js → list-ZHES2WYK.js} +1 -1
- package/dist/chunks/{list-4RRL326Z.js → list-ZWJDFJNY.js} +1 -1
- package/dist/chunks/login-JAKNSTW3.js +9 -0
- package/dist/chunks/login-JRGX6HGZ.js +7 -0
- package/dist/chunks/logs-3DPLX3CB.js +7 -0
- package/dist/chunks/{ls-VFE7PE25.js → ls-5YLM3ICH.js} +1 -1
- package/dist/chunks/ls-6HPMZVYA.js +11 -0
- package/dist/chunks/{ls-RKOM46KV.js → ls-FWOTN6V6.js} +1 -1
- package/dist/chunks/{ls-I767MTW4.js → ls-MW3WIHH5.js} +1 -1
- package/dist/chunks/{ls-Q4WGEEBZ.js → ls-RAVFLQTQ.js} +1 -1
- package/dist/chunks/ls-SY2FW3WA.js +8 -0
- package/dist/chunks/{ls-TLEAYYXQ.js → ls-ZX5FNEK2.js} +1 -1
- package/dist/chunks/migrate-experimental-services-XYUCY2G6.js +7 -0
- package/dist/chunks/mutate-4KTZMM3X.js +9 -0
- package/dist/chunks/{native-self-update-JDTL3IBF.js → native-self-update-Q3EN6NZK.js} +1 -1
- package/dist/chunks/notifications-LBZ7KWGS.js +7 -0
- package/dist/chunks/open-PXLVSFII.js +7 -0
- package/dist/chunks/{openapi-NEYEIRF2.js → openapi-6RKKA6JG.js} +1 -1
- package/dist/chunks/permissions-DQ5AF6XL.js +7 -0
- package/dist/chunks/{plugin-offer-NPJAEILN.js → plugin-offer-VU3R572E.js} +1 -1
- package/dist/chunks/prompt-missing-credentials-AJH3HM36.js +7 -0
- package/dist/chunks/publish-QJJL3IHG.js +15 -0
- package/dist/chunks/pull-3PQHXMPB.js +7 -0
- package/dist/chunks/purchase-domain-if-available-IFCQ4QFP.js +7 -0
- package/dist/chunks/push-4VIQFKP3.js +7 -0
- package/dist/chunks/query-BQ4HYVQ7.js +7 -0
- package/dist/chunks/raw-query-VA6VVMR4.js +8 -0
- package/dist/chunks/reauthenticate-2SMCQQHF.js +7 -0
- package/dist/chunks/{remove-IEEZGRB2.js → remove-CSIMGLLS.js} +1 -1
- package/dist/chunks/reorder-ERRB7OJL.js +10 -0
- package/dist/chunks/reply-XCBWXFWS.js +9 -0
- package/dist/chunks/repo-root-DZ6WFHMP.js +7 -0
- package/dist/chunks/resolve-VWGZ632M.js +12 -0
- package/dist/chunks/resolve-agent-team-NWELD5FN.js +7 -0
- package/dist/chunks/{resolve-deployment-framework-preset-4TKUU6AH.js → resolve-deployment-framework-preset-BLMQLCIN.js} +1 -1
- package/dist/chunks/restore-SXZUZGZE.js +16 -0
- package/dist/chunks/rm-5TRC5YND.js +8 -0
- package/dist/chunks/rm-IQ33QTQ2.js +8 -0
- package/dist/chunks/rm-KURYLLD6.js +8 -0
- package/dist/chunks/rm-WCE3ISB2.js +8 -0
- package/dist/chunks/rm-XMWM76JA.js +8 -0
- package/dist/chunks/routes-SBMN6SDF.js +7 -0
- package/dist/chunks/rule-inspect-USW6K7Y7.js +8 -0
- package/dist/chunks/schema-2G5VJ7EY.js +14 -0
- package/dist/chunks/{schema-L5VCG6FJ.js → schema-LRRKG2KJ.js} +1 -1
- package/dist/chunks/select-org-JG6GRWTS.js +7 -0
- package/dist/chunks/{serving-aOQsBok0-OL36TMZU.js → serving-C1mhZQqH-73TMEGEB.js} +1 -1
- package/dist/chunks/set-4JTH62JO.js +7 -0
- package/dist/chunks/{set-6U4QIX7A.js → set-BS5KCRE4.js} +1 -1
- package/dist/chunks/setup-and-link-GY4O7UJP.js +7 -0
- package/dist/chunks/{skills-ZMFZGPQL.js → skills-SUGA6D3G.js} +4 -19
- package/dist/chunks/table-SCLK33K7.js +7 -0
- package/dist/chunks/tags-B7MKMQKJ.js +7 -0
- package/dist/chunks/{types-CVLZCTL2.js → types-YFDB4QZA.js} +1 -1
- package/dist/chunks/{update-A727QN7H.js → update-LWRCCEXG.js} +1 -1
- package/dist/chunks/usage-HABW5VJ7.js +15 -0
- package/dist/chunks/validate-config-LDOYJ4LL.js +7 -0
- package/dist/commands/build/index.js +1 -1
- package/dist/commands/deploy/index.js +28 -25
- package/dist/commands/dev/index.js +7 -7
- package/dist/commands/env/index.js +12 -11
- package/dist/commands/link/index.js +3 -3
- package/dist/commands/list/index.js +1 -1
- package/dist/commands/project/index.js +4 -4
- package/dist/commands/tunnel/index.js +1 -1
- package/dist/commands-account.js +18 -12
- package/dist/commands-ai.js +18 -11
- package/dist/commands-blob.js +6 -6
- package/dist/commands-core.js +34 -48
- package/dist/commands-deployments.js +12 -11
- package/dist/commands-flags.js +27 -22
- package/dist/commands-integrations.js +7 -10
- package/dist/commands-observability.js +38 -28
- package/dist/commands-routing.js +6 -7
- package/dist/help.js +1 -1
- package/dist/index.js +6 -6
- package/dist/internal-build-worker.js +1 -1
- package/dist/internal-build.js +1 -1
- package/dist/package.json +43 -43
- package/dist/version.mjs +1 -1
- package/package.json +44 -44
- package/dist/chunks/add-563RV6JX.js +0 -8
- package/dist/chunks/add-HRB6XY33.js +0 -8
- package/dist/chunks/add-IUTGTBA4.js +0 -8
- package/dist/chunks/build-OMIYCGMR.js +0 -7
- package/dist/chunks/chunk-2GBU6ULJ.js +0 -7
- package/dist/chunks/chunk-2RRZCRWX.js +0 -7
- package/dist/chunks/chunk-4SS6W6JK.js +0 -11
- package/dist/chunks/chunk-5J4E2W4F.js +0 -12
- package/dist/chunks/chunk-76DSBD4X.js +0 -7
- package/dist/chunks/chunk-7W565DJB.js +0 -8
- package/dist/chunks/chunk-AIXEVICT.js +0 -37
- package/dist/chunks/chunk-AM46JVVN.js +0 -7
- package/dist/chunks/chunk-BULSRTQE.js +0 -7
- package/dist/chunks/chunk-C35SG42R.js +0 -7
- package/dist/chunks/chunk-CFJBDBYH.js +0 -7
- package/dist/chunks/chunk-DDPH26ZO.js +0 -7
- package/dist/chunks/chunk-EAQAV7UZ.js +0 -8
- package/dist/chunks/chunk-EFFJUYYS.js +0 -31
- package/dist/chunks/chunk-GOI2VVI7.js +0 -19
- package/dist/chunks/chunk-GYUNOFDD.js +0 -10
- package/dist/chunks/chunk-H2KNSYPR.js +0 -16
- package/dist/chunks/chunk-KDCODXVL.js +0 -25
- package/dist/chunks/chunk-KMTHGHJV.js +0 -8
- package/dist/chunks/chunk-KQ6X77WP.js +0 -7
- package/dist/chunks/chunk-KRP4EMD2.js +0 -10
- package/dist/chunks/chunk-NLK7NGVP.js +0 -7
- package/dist/chunks/chunk-OCR5CRTH.js +0 -10
- package/dist/chunks/chunk-PKR32I2N.js +0 -30
- package/dist/chunks/chunk-QGHAD5A5.js +0 -12
- package/dist/chunks/chunk-SPVOJ3HW.js +0 -7
- package/dist/chunks/chunk-SXW2G4WD.js +0 -10
- package/dist/chunks/chunk-TC4E2TFA.js +0 -8
- package/dist/chunks/chunk-TUB3APDV.js +0 -7
- package/dist/chunks/chunk-UG3FZ5Q7.js +0 -7
- package/dist/chunks/chunk-VF7XWPXA.js +0 -7
- package/dist/chunks/chunk-VKVH7LHB.js +0 -7
- package/dist/chunks/chunk-VUUU4KDL.js +0 -7
- package/dist/chunks/chunk-W3ZH27MN.js +0 -13
- package/dist/chunks/chunk-X47GV5HM.js +0 -15
- package/dist/chunks/chunk-XBHAU2M3.js +0 -9
- package/dist/chunks/chunk-XR2J7PQN.js +0 -12
- package/dist/chunks/chunk-YI7NKOCU.js +0 -23
- package/dist/chunks/chunk-Z2KANBOU.js +0 -69
- package/dist/chunks/chunk-Z7WZVEPP.js +0 -7
- package/dist/chunks/clear-TH6G33QK.js +0 -8
- package/dist/chunks/cli-embedded-FD3CAPRY.js +0 -84
- package/dist/chunks/compile-vercel-config-24IXPM4W.js +0 -7
- package/dist/chunks/config-2SBML7OY.js +0 -8
- package/dist/chunks/config-BCKJNJPS.js +0 -7
- package/dist/chunks/create-project-I7UXVWIR.js +0 -7
- package/dist/chunks/delete-RGHXL4JH.js +0 -9
- package/dist/chunks/delete-ZV4SHUTR.js +0 -10
- package/dist/chunks/describe-442UUQIF.js +0 -25
- package/dist/chunks/detect-projects-NBZSMQ5C.js +0 -7
- package/dist/chunks/detect-services-CRZW6FKM.js +0 -7
- package/dist/chunks/disable-MYGA6HVS.js +0 -7
- package/dist/chunks/discard-I5TKYCDJ.js +0 -14
- package/dist/chunks/edit-KGCUTTOZ.js +0 -8
- package/dist/chunks/edit-ZRNGGRVL.js +0 -9
- package/dist/chunks/enable-NODSFDKF.js +0 -7
- package/dist/chunks/esm-CF5UHWPM.js +0 -7
- package/dist/chunks/esm-EYOXGOVF.js +0 -7
- package/dist/chunks/esm-IUATPKKB.js +0 -9
- package/dist/chunks/esm-L6OKDFWP.js +0 -7
- package/dist/chunks/esm-ORQC2ZSA.js +0 -7
- package/dist/chunks/esm-PYIZNQIK.js +0 -9
- package/dist/chunks/future-RXI2OW2C.js +0 -7
- package/dist/chunks/generate-cert-for-deploy-7BX47IPD.js +0 -7
- package/dist/chunks/image-6A2EJP4N.js +0 -7
- package/dist/chunks/import-builders-I4JB6BA6.js +0 -7
- package/dist/chunks/inspect-STKCC3MC.js +0 -9
- package/dist/chunks/inspect-VFUV7BDM.js +0 -13
- package/dist/chunks/list-6ENV2ZGG.js +0 -12
- package/dist/chunks/login-O6NLJ42W.js +0 -7
- package/dist/chunks/login-U5VDJURN.js +0 -9
- package/dist/chunks/logs-X3KGHA3J.js +0 -7
- package/dist/chunks/ls-HRSD6VNW.js +0 -8
- package/dist/chunks/ls-OLJMGFTV.js +0 -11
- package/dist/chunks/migrate-experimental-services-7ZYHE5WA.js +0 -7
- package/dist/chunks/mutate-BJXJON5E.js +0 -9
- package/dist/chunks/notifications-F3NRNUHQ.js +0 -7
- package/dist/chunks/open-JK42ZTLB.js +0 -7
- package/dist/chunks/permissions-3AQO3DCH.js +0 -7
- package/dist/chunks/prompt-missing-credentials-AHAH27TZ.js +0 -7
- package/dist/chunks/publish-7SCXBVZR.js +0 -15
- package/dist/chunks/pull-LAPD5XJG.js +0 -7
- package/dist/chunks/purchase-domain-if-available-7MI52MFD.js +0 -7
- package/dist/chunks/push-BCSGQBAM.js +0 -7
- package/dist/chunks/query-U72BDMAK.js +0 -7
- package/dist/chunks/raw-query-4UAW7M5Q.js +0 -8
- package/dist/chunks/reauthenticate-HGOLSK2M.js +0 -7
- package/dist/chunks/reorder-YL6L6IWC.js +0 -10
- package/dist/chunks/reply-7Y5TN5UV.js +0 -9
- package/dist/chunks/resolve-C62436YM.js +0 -12
- package/dist/chunks/resolve-agent-team-SR3ALPCH.js +0 -7
- package/dist/chunks/restore-Z63JM5CN.js +0 -16
- package/dist/chunks/rm-C6QSHEA2.js +0 -8
- package/dist/chunks/rm-DDKE62T7.js +0 -8
- package/dist/chunks/rm-IUB55CCM.js +0 -8
- package/dist/chunks/rm-NZX43GMQ.js +0 -8
- package/dist/chunks/rm-UBUI7JNY.js +0 -8
- package/dist/chunks/routes-TME3VYIF.js +0 -7
- package/dist/chunks/rule-inspect-KF4BLH4K.js +0 -8
- package/dist/chunks/schema-P7DFLXCG.js +0 -14
- package/dist/chunks/select-org-MBBMOUK2.js +0 -7
- package/dist/chunks/set-SCKMJ7LZ.js +0 -7
- package/dist/chunks/setup-and-link-5TPDTJIN.js +0 -7
- package/dist/chunks/tags-7M2EW6LU.js +0 -7
- package/dist/chunks/usage-HT5JXVAA.js +0 -13
- package/dist/chunks/validate-config-Q77XESW5.js +0 -7
|
@@ -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{did_you_mean_default}from"./chunk-DWZBL4NK.js";import{param}from"./chunk-3G3FQYMW.js";import{buildCorrectedCommand,suggestCorrection}from"./chunk-
|
|
7
|
+
import{did_you_mean_default}from"./chunk-DWZBL4NK.js";import{param}from"./chunk-3G3FQYMW.js";import{buildCorrectedCommand,suggestCorrection}from"./chunk-INIZJZ3O.js";import{shouldEmitNonInteractiveCommandError,writeAgentError}from"./chunk-CSNP5RIM.js";import{getCommandNamePlain}from"./chunk-B4KA3ZH2.js";import{output_manager_default,recordCliError}from"./chunk-RYSO5U3E.js";import{getFlagsSpecification}from"./chunk-DORCX7UB.js";function handleCommandTypo({command,availableCommands,threshold=.7,helpCommand="--help",client}){if(!command||command.startsWith("-"))return!1;let visibleCommands=availableCommands.filter(command2=>!command2.hidden),commandNames=visibleCommands.flatMap(({name,aliases})=>[name,...aliases]),correction=suggestCorrection(command,commandNames),suggestion=correction??did_you_mean_default(command,commandNames,threshold);if(suggestion){if(client){let definition=visibleCommands.find(candidate=>candidate.name===correction||candidate.aliases.some(alias=>alias===correction)),corrected=correction?buildCorrectedCommand(client.argv,command,correction,getFlagsSpecification(definition?.options??[])):void 0,payload={status:"error",reason:"unknown_command",message:`Unknown command "${command}". Did you mean "${suggestion}"?`,hint:corrected?"Use the suggested command after replacing any placeholders with the intended values.":`Accepted commands: ${commandNames.join(", ")}.`,...corrected&&{next:[{command:corrected,when:"Run the corrected command; replace any placeholders first"}]}};return shouldEmitNonInteractiveCommandError(client)?writeAgentError(client,payload):(recordCliError({code:payload.reason}),output_manager_default.fatal(payload.message),corrected&&output_manager_default.print(` ${corrected}
|
|
8
8
|
`),output_manager_default.print(`
|
|
9
9
|
See all commands:
|
|
10
10
|
${getCommandNamePlain(helpCommand)}
|
|
@@ -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_strip_ansi}from"./chunk-
|
|
7
|
+
import{require_strip_ansi}from"./chunk-BS32OUOC.js";import{__toESM}from"./chunk-BZENIQ7N.js";var import_strip_ansi=__toESM(require_strip_ansi(),1),CONTROL_CHARACTERS=/[\u0000-\u001F\u007F-\u009F]/g,FORMAT_CHARACTERS=/[\u200B-\u200F\u202A-\u202E\u2060-\u2069\uFEFF]/g;function remoteText(value){return(0,import_strip_ansi.default)(value).replace(/\r?\n/g,"\\n").replace(CONTROL_CHARACTERS,"").replace(FORMAT_CHARACTERS,"")}export{CONTROL_CHARACTERS,FORMAT_CHARACTERS,remoteText};
|
|
@@ -4,4 +4,4 @@ import { dirname as __dirname_ } from 'node:path';
|
|
|
4
4
|
const require = __createRequire(import.meta.url);
|
|
5
5
|
const __filename = __fileURLToPath(import.meta.url);
|
|
6
6
|
const __dirname = __dirname_(__filename);
|
|
7
|
-
import{packageName}from"./chunk-B4KA3ZH2.js";import{environmentOption,formatOption,jsonOption,projectOption}from"./chunk-
|
|
7
|
+
import{packageName}from"./chunk-B4KA3ZH2.js";import{environmentOption,formatOption,jsonOption,projectOption}from"./chunk-DORCX7UB.js";var RULE_ENVIRONMENTS=["any","preview","production"],ruleEnvironmentOption={...environmentOption,description:"Environment the rule applies to (required): production, preview, or any"},lsSubcommand={name:"ls",aliases:["list"],description:"List the Vercel tracing sampling rules for a project",arguments:[],options:[formatOption,jsonOption,projectOption],examples:[{name:"List the sampling rules for the linked project",value:`${packageName} traces config ls`},{name:"List the sampling rules as JSON",value:`${packageName} traces config ls --json`}]},setSubcommand={name:"set",aliases:[],description:"Enable Vercel tracing and add or replace one sampling rule. The rate is a whole percentage from 1 to 100.",arguments:[{name:"rate",required:!0},{name:"requestPath",required:!1}],options:[ruleEnvironmentOption,formatOption,jsonOption,projectOption],examples:[{name:"Trace a quarter of production traffic",value:`${packageName} traces config set 25 --environment production`},{name:"Trace every preview request to one path prefix",value:`${packageName} traces config set 100 /api --environment preview`},{name:"Trace one percent of traffic in every environment",value:`${packageName} traces config set 1 --environment any`}]},rmSubcommand={descriptionTone:"normal",name:"remove",aliases:["rm","delete"],description:"Remove Vercel tracing sampling rules. Without a path prefix, every rule for the environment is removed. Removing the final rule disables tracing.",arguments:[{name:"requestPath",required:!1}],options:[ruleEnvironmentOption,{name:"default",shorthand:null,type:Boolean,deprecated:!1,description:"Remove only the rule that has no path prefix, keeping the per-path rules"},formatOption,jsonOption,projectOption],examples:[{name:"Remove one rule by environment and path prefix",value:`${packageName} traces config remove /api --environment production`},{name:"Remove every rule for production",value:`${packageName} traces config remove --environment production`},{name:"Remove only the production rule that covers all paths",value:`${packageName} traces config remove --environment production --default`}]},tracesConfigCommand={name:"config",aliases:[],description:"Manage Vercel tracing sampling rules for a project.",arguments:[],subcommands:[lsSubcommand,setSubcommand,rmSubcommand],options:[],examples:[{name:"List the sampling rules for the linked project",value:`${packageName} traces config ls`},{name:"Trace a quarter of production traffic",value:`${packageName} traces config set 25 --environment production`},{name:"Remove every rule for production",value:`${packageName} traces config remove --environment production`}]};export{RULE_ENVIRONMENTS,lsSubcommand,setSubcommand,rmSubcommand,tracesConfigCommand};
|
|
@@ -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{getGlobalPathConfig}from"./chunk-
|
|
7
|
+
import{getGlobalPathConfig}from"./chunk-ZRFDZO7Y.js";import{output_manager_default}from"./chunk-RYSO5U3E.js";var OPENAPI_URL="https://openapi.vercel.sh/",CACHE_FILE="openapi-spec.json",CACHE_TTL_MS=864e5,FETCH_TIMEOUT_MS=1e4,MAX_OPENAPI_SPEC_BYTES=52428800,VERCEL_CLI_ROOT_DISPLAY_KEY="__root__";async function readSpecResponse(response,url,maxBytes=52428800){let contentLength=response.headers.get("content-length");if(contentLength){let bytes=Number(contentLength);if(Number.isFinite(bytes)&&bytes>maxBytes)throw new Error(`OpenAPI spec from ${url} exceeds the ${maxBytes} byte limit.`)}if(!response.body)throw new Error(`OpenAPI spec from ${url} returned an empty response.`);let reader=response.body.getReader(),chunks=[],totalBytes=0;for(;;){let{done,value}=await reader.read();if(done)break;if(value){if(totalBytes+=value.byteLength,totalBytes>maxBytes)throw await reader.cancel(),new Error(`OpenAPI spec from ${url} exceeds the ${maxBytes} byte limit.`);chunks.push(value)}}let buffer=new Uint8Array(totalBytes),offset=0;for(let chunk of chunks)buffer.set(chunk,offset),offset+=chunk.byteLength;return JSON.parse(new TextDecoder().decode(buffer))}import{join}from"path";import{readFile,writeFile,mkdir}from"fs/promises";var OpenApiCache=class{constructor(){this.spec=null;this.cachePath=join(getGlobalPathConfig(),CACHE_FILE)}get isLoaded(){return this.spec!==null}async load(forceRefresh=!1){return this.loadSpec(forceRefresh)}async loadSpec(forceRefresh=!1){if(!forceRefresh){let cached=await this.readCache(this.cachePath);if(cached&&!this.isExpired(cached.fetchedAt))return output_manager_default.debug("Using cached OpenAPI spec"),this.spec=cached.spec,!0}try{return output_manager_default.debug("Fetching OpenAPI spec from "+OPENAPI_URL),this.spec=await this.fetchSpec(OPENAPI_URL),await this.saveCache(this.cachePath,this.spec),!0}catch(err){output_manager_default.debug(`Failed to fetch OpenAPI spec: ${err}`);let stale=await this.readCache(this.cachePath);return stale?(output_manager_default.debug("Using stale cached OpenAPI spec"),this.spec=stale.spec,!0):!1}}async loadWithSpinner(forceRefresh=!1){output_manager_default.spinner(forceRefresh?"Refreshing API endpoints...":"Loading API endpoints...");let success=await this.load(forceRefresh);return output_manager_default.stopSpinner(),success}getEndpoints(){this.ensureLoaded();let endpoints=this.extractEndpoints();return this.sortEndpoints(endpoints)}getBodyFields(endpoint){if(this.ensureLoaded(),!endpoint.requestBody?.content)return[];let jsonContent=endpoint.requestBody.content["application/json"];if(!jsonContent?.schema)return[];let schema=this.resolveSchemaRef(jsonContent.schema);if(!schema?.properties)return[];let requiredFields=new Set(schema.required||[]),fields=[];for(let[name,propSchema]of Object.entries(schema.properties)){let resolvedProp=this.resolveSchemaRef(propSchema),enumValues=resolvedProp?.enum||propSchema.enum;if(!enumValues&&(resolvedProp?.type==="array"||propSchema.type==="array")){let items=resolvedProp?.items||propSchema.items;items&&(enumValues=this.resolveSchemaRef(items)?.enum||items.enum)}fields.push({name,required:requiredFields.has(name),description:resolvedProp?.description||propSchema.description,type:resolvedProp?.type||propSchema.type,enumValues})}return fields.sort((a,b)=>a.required!==b.required?a.required?-1:1:a.name.localeCompare(b.name)),fields}getDisplayColumns(endpoint){this.ensureLoaded();let pathItem=this.spec.paths[endpoint.path];if(!pathItem)return null;let operation=pathItem[endpoint.method.toLowerCase()];if(!operation?.responses)return null;let ok=operation.responses[200]||operation.responses[201];if(!ok)return null;let jsonContent=ok.content?.["application/json"];return jsonContent?.schema?this.findDisplayColumns(jsonContent.schema):null}findDisplayColumns(schema){let xCli=schema["x-vercel-cli"];if(xCli?.displayColumns)return xCli.displayColumns;for(let key of["oneOf","allOf","anyOf"]){let variants=schema[key];if(variants)for(let sub of variants){let found=this.findDisplayColumns(sub);if(found)return found}}return null}ensureLoaded(){if(!this.spec)throw new Error("OpenAPI spec not loaded. Call load() or loadWithSpinner() first.")}async readCache(cachePath){try{let content=await readFile(cachePath,"utf-8"),cached=JSON.parse(content);return this.validateSpec(cached.spec,cachePath),cached}catch{return null}}async saveCache(cachePath,spec){let cached={fetchedAt:Date.now(),spec},dir=join(cachePath,"..");await mkdir(dir,{recursive:!0}),await writeFile(cachePath,JSON.stringify(cached)),output_manager_default.debug("Saved OpenAPI spec to cache")}async fetchSpec(url){let controller=new AbortController,timeoutId=setTimeout(()=>controller.abort(),1e4);try{let response=await fetch(url,{signal:controller.signal});if(!response.ok)throw new Error(`Failed to fetch OpenAPI spec: ${response.status}`);let spec=await readSpecResponse(response,url);return this.validateSpec(spec,url),spec}finally{clearTimeout(timeoutId)}}validateSpec(spec,url){if(!spec||typeof spec!="object")throw new Error(`Invalid OpenAPI spec from ${url}: expected a JSON object.`);if(typeof spec.openapi!="string"||!spec.openapi.startsWith("3."))throw new Error(`Invalid OpenAPI spec from ${url}: expected an OpenAPI 3.x document with an "openapi" field.`);if(!spec.paths||typeof spec.paths!="object")throw new Error(`Invalid OpenAPI spec from ${url}: expected a "paths" object.`);for(let path of Object.keys(spec.paths))if(!path.startsWith("/")||path.startsWith("//"))throw new Error(`Invalid OpenAPI spec from ${url}: path "${path}" must be a relative API path.`)}isExpired(fetchedAt){return Date.now()-fetchedAt>864e5}sortEndpoints(endpoints){return endpoints.sort((a,b)=>{let pathCompare=a.path.localeCompare(b.path);return pathCompare!==0?pathCompare:a.method.localeCompare(b.method)})}extractEndpoints(){let endpoints=[];for(let[path,pathItem]of Object.entries(this.spec.paths)){let methods=["get","post","put","patch","delete"];for(let method of methods){let operation=pathItem[method];if(operation){let pathParams=pathItem.parameters||[],opParams=operation.parameters||[],allParams=[...pathParams,...opParams];endpoints.push({path,method:method.toUpperCase(),summary:operation.summary||pathItem.summary||"",description:operation.description||pathItem.description||"",operationId:operation.operationId||"",tags:operation.tags||[],parameters:allParams,requestBody:operation.requestBody})}}}return endpoints}resolveSchemaRef(schema,spec=this.spec){if(schema){if(schema.$ref){let match=schema.$ref.match(/^#\/components\/schemas\/(.+)$/);if(match&&spec.components?.schemas){let resolved=spec.components.schemas[match[1]];return this.resolveSchemaRef(resolved,spec)}return}if(schema.allOf&&schema.allOf.length>0){let merged={type:"object",properties:{},required:[]};for(let subSchema of schema.allOf){let resolved=this.resolveSchemaRef(subSchema,spec);resolved&&(resolved.properties&&(merged.properties={...merged.properties,...resolved.properties}),resolved.required&&(merged.required=[...merged.required||[],...resolved.required]))}return merged}return schema}}};async function matchesCliApiTag(tagHint){if(!tagHint||tagHint.startsWith("-")||tagHint.includes("/"))return!1;let cache=new OpenApiCache;if(!await cache.load())return!1;let endpoints=cache.getEndpoints(),lower=tagHint.toLowerCase();return endpoints.some(ep=>ep.tags.some(t=>t.toLowerCase()===lower))}async function resolveOpenApiTagForProjectsCli(){return await matchesCliApiTag("projects")?"projects":await matchesCliApiTag("project")?"project":null}async function resolveOpenApiTagForTeamsCli(){return await matchesCliApiTag("teams")?"teams":await matchesCliApiTag("team")?"team":null}export{OPENAPI_URL,CACHE_FILE,CACHE_TTL_MS,FETCH_TIMEOUT_MS,MAX_OPENAPI_SPEC_BYTES,VERCEL_CLI_ROOT_DISPLAY_KEY,readSpecResponse,OpenApiCache,matchesCliApiTag,resolveOpenApiTagForProjectsCli,resolveOpenApiTagForTeamsCli};
|
|
@@ -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{canPrompt}from"./chunk-IQ7FPAI4.js";import{require_lib}from"./chunk-4Z6R5KHZ.js";import{AGENT_REASON,AGENT_STATUS,outputActionRequired}from"./chunk-CSNP5RIM.js";import{humanizePath}from"./chunk-QFE3RPMA.js";import{output_manager_default}from"./chunk-RYSO5U3E.js";import{require_source}from"./chunk-NB2WLB3J.js";import{__toESM}from"./chunk-BZENIQ7N.js";var import_fs_extra=__toESM(require_lib(),1),import_chalk=__toESM(require_source(),1);import{homedir}from"os";import{resolve,sep}from"path";import{realpath as realpathCallback}from"node:fs";import*as fs from"node:fs/promises";import{promisify}from"node:util";var realpathInJavaScript=promisify(realpathCallback);async function validateRootDirectory(cwd,path,errorSuffix=""){let pathStat=await(0,import_fs_extra.lstat)(path).catch(()=>null),suffix=errorSuffix?` ${errorSuffix}`:"";return pathStat?pathStat.isDirectory()?await resolvesInside(cwd,path)?!0:(output_manager_default.error(`The provided path ${import_chalk.default.cyan(`\u201C${humanizePath(path)}\u201D`)} is outside of the project.${suffix}`),!1):(output_manager_default.error(`The provided path ${import_chalk.default.cyan(`\u201C${humanizePath(path)}\u201D`)} is a file, but expected a directory.${suffix}`),!1):(output_manager_default.error(`The provided path ${import_chalk.default.cyan(`\u201C${humanizePath(path)}\u201D`)} does not exist.${suffix}`),!1)}async function validatePaths(client,paths,{allowFiles=!1}={}){if(paths.length>1)return output_manager_default.error("Can't deploy more than one path."),{valid:!1,exitCode:1};let path=paths[0],pathStat=await(0,import_fs_extra.lstat)(path).catch(()=>null);if(!pathStat)return output_manager_default.error(`Could not find ${import_chalk.default.cyan(`\u201C${humanizePath(path)}\u201D`)}`),{valid:!1,exitCode:1};let isFile=pathStat.isFile();if(!pathStat.isDirectory()&&!(allowFiles&&isFile))return output_manager_default.fatal(allowFiles?"Deploy a regular file or directory. Symbolic links and special files are not supported as deployment paths.":"This command requires a directory. Use `vercel <file>` to deploy a single file."),{valid:!1,exitCode:1};let refusal=await confirmHomeDirectory(client,path);return refusal||{valid:!0,path,isFile}}async function validateUploadRoot(client,path,repoRoot){if(!repoRoot||repoRoot===path)return{valid:!0,path};let[resolvedRoot,resolvedPath]=await Promise.all([resolveLinks(repoRoot),resolveLinks(path)]);return resolvedRoot===resolvedPath?{valid:!0,path:repoRoot}:rootContains(repoRoot,path,resolvedRoot,resolvedPath)?await confirmHomeDirectory(client,repoRoot,`The repository link ${humanizePath(resolve(repoRoot,".vercel","repo.json"))} makes your home directory the directory to deploy.`)??{valid:!0,path:repoRoot}:(output_manager_default.error(repoRootOutsideMessage("deploy",path,repoRoot)),{valid:!1,exitCode:1})}async function repoRootContains(repoRoot,path){let[resolvedRoot,resolvedPath]=await Promise.all([resolveLinks(repoRoot),resolveLinks(path)]);return rootContains(repoRoot,path,resolvedRoot,resolvedPath)}function rootContains(repoRoot,path,resolvedRoot,resolvedPath){return isInside(repoRoot,path)||isInside(resolvedRoot,resolvedPath)}function repoRootOutsideMessage(action,path,repoRoot){return`Can't ${action} ${humanizePath(path)}. Git reports the repository root ${humanizePath(repoRoot)}, which does not contain this directory. Check \`core.worktree\` in the Git configuration and the \`GIT_WORK_TREE\` environment variable.`}async function resolvesInside(directory,path){let[base,target]=await Promise.all([resolveExisting(directory),resolveExisting(path)]);return base!==null&&target!==null&&isInside(base,target)}async function resolvesToDirectoryInside(directory,path){return!!(await fs.stat(path).catch(()=>null))?.isDirectory()&&await resolvesInside(directory,path)}async function resolveExisting(path){try{return await fs.realpath(path)}catch{return realpathInJavaScript(path).catch(()=>null)}}async function confirmHomeDirectory(client,path,cause){if(!await isHomeDirectory(path))return null;if(!canPrompt(client)){let message=`Can't deploy your home directory without interactive confirmation. ${cause?`${cause} Run`:"Run from your project directory, or run"} in a terminal to confirm deploying your home directory.`;return outputActionRequired(client,{status:AGENT_STATUS.ACTION_REQUIRED,reason:AGENT_REASON.INTERACTIVE_CONFIRMATION_REQUIRED,message,userActionRequired:!0},2),output_manager_default.error(message),{valid:!1,exitCode:2}}return cause&&output_manager_default.warning(cause),await client.input.confirm("You are deploying your home directory. Do you want to continue?",!1)?null:(output_manager_default.print(`Canceled
|
|
8
|
+
`),{valid:!1,exitCode:0})}async function isHomeDirectory(path){let home=homedir();return path===home||await resolveLinks(path)===await resolveLinks(home)}function resolveLinks(path){return fs.realpath(path).catch(()=>path)}function isInside(directory,path){let base=resolve(directory),target=resolve(path);return target===base||target.startsWith(base.endsWith(sep)?base:base+sep)}export{validateRootDirectory,validatePaths,validateUploadRoot,repoRootContains,repoRootOutsideMessage,resolvesInside,resolvesToDirectoryInside};
|
|
@@ -4,4 +4,4 @@ import { dirname as __dirname_ } from 'node:path';
|
|
|
4
4
|
const require = __createRequire(import.meta.url);
|
|
5
5
|
const __filename = __fileURLToPath(import.meta.url);
|
|
6
6
|
const __dirname = __dirname_(__filename);
|
|
7
|
-
import{CertConfigurationError,CertError,DomainNotFound,TooManyRequests}from"./chunk-
|
|
7
|
+
import{CertConfigurationError,CertError,DomainNotFound,TooManyRequests}from"./chunk-QFE3RPMA.js";function mapCertError(error,cns){let errorCode=error.code;if(errorCode==="too_many_requests"){let retryAfter=typeof error.retryAfterMs=="number"?error.retryAfterMs:0;return new TooManyRequests("certificates",retryAfter)}return errorCode==="not_found"?new DomainNotFound(error.domain):errorCode==="configuration_error"?new CertConfigurationError({cns:cns||error.cns||[],message:error.message,external:error.external,helpUrl:error.helpUrl,type:error.statusCode===449?"http-01":"dns-01"}):errorCode==="bad_domains"||errorCode==="challenge_still_pending"||errorCode==="common_name_domain_name_mismatch"||errorCode==="conflicting_caa_record"||errorCode==="domain_not_verified"||errorCode==="invalid_cn"||errorCode==="invalid_domain"||errorCode==="rate_limited"||errorCode==="should_share_root_domain"||errorCode==="unauthorized_request_error"||errorCode==="unsupported_challenge_priority"||errorCode==="wildcard_not_allowed"||errorCode==="validation_running"||errorCode==="dns_error"||errorCode==="challenge_error"||errorCode==="txt_record_not_found"?new CertError({cns:cns||error.cns||[],code:errorCode,message:error.message,helpUrl:error.helpUrl}):null}export{mapCertError};
|
|
@@ -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{formatErrorJson,handleApiError}from"./chunk-
|
|
7
|
+
import{formatErrorJson,handleApiError}from"./chunk-DUSMVY4N.js";import{isAPIError}from"./chunk-QFE3RPMA.js";import{output_manager_default}from"./chunk-RYSO5U3E.js";var OBSERVABILITY_METRICS_PATH="/metrics/v1",METRIC_CATALOG_PAGE_SIZE=250;async function fetchMetricCatalog(client,accountId,kind,search,activeSince){let metrics=[],cursor=null;do{let searchParams=new URLSearchParams({limit:String(METRIC_CATALOG_PAGE_SIZE),kind});search&&searchParams.set("search",search),activeSince&&searchParams.set("activeSince",activeSince),cursor&&searchParams.set("cursor",cursor);let response=await client.fetch(`${OBSERVABILITY_METRICS_PATH}?${searchParams}`,{accountId,bailOn429:!0});metrics.push(...response.metrics.map(metric=>({id:metric.id,description:metric.description,dimensions:metric.dimensions,unit:metric.unit,aggregations:metric.aggregations}))),cursor=response.pagination.hasMore?response.pagination.nextCursor:null}while(cursor);return metrics.filter(metric=>(kind==="all"||(kind==="system"?metric.id.startsWith("vercel."):!metric.id.startsWith("vercel.")))&&(!search||metric.id.startsWith(search))).sort((left,right)=>left.id.localeCompare(right.id))}async function fetchCatalogMetricDetail(client,accountId,metricId,kind,activeSince){let metrics=await fetchMetricCatalog(client,accountId,kind,metricId,activeSince),exactMetric=metrics.find(metric=>metric.id===metricId);return exactMetric?[exactMetric]:metrics}async function fetchSchemaOrExit(client,jsonOutput,operation,accountId){try{return await operation()}catch(err){if(isAPIError(err))return handleApiError(err,jsonOutput,client,{401:{code:"SCHEMA_UNAUTHORIZED",message:"The metrics schema API request was not authorized. Run `vercel login` to authenticate and `vercel switch` to select a team, then try again."},403:{code:"SCHEMA_UNAUTHORIZED",message:"The metrics schema API request was not authorized. Run `vercel login` to authenticate and `vercel switch` to select a team, then try again."}},accountId?.startsWith("team_")?{scope:accountId}:{});let message=err instanceof Error?`Failed to fetch metrics schema: ${err.message}`:`Failed to fetch metrics schema: ${String(err)}`;return jsonOutput?client.stdout.write(formatErrorJson("SCHEMA_FETCH_FAILED",message)):output_manager_default.error(message),1}}function fetchCatalogMetricDetailOrExit(client,accountId,jsonOutput,metricId,kind,activeSince){return fetchSchemaOrExit(client,jsonOutput,()=>fetchCatalogMetricDetail(client,accountId,metricId,kind,activeSince),accountId)}function fetchMetricCatalogListOrExit(client,accountId,jsonOutput){return fetchSchemaOrExit(client,jsonOutput,()=>fetchMetricCatalog(client,accountId,"all").then(metrics=>metrics.map(({id,description})=>({id,description}))),accountId)}export{OBSERVABILITY_METRICS_PATH,fetchCatalogMetricDetailOrExit,fetchMetricCatalogListOrExit};
|
|
@@ -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_string_width}from"./chunk-
|
|
7
|
+
import{require_string_width}from"./chunk-67GZ5REA.js";import{__commonJS,__require,__toESM}from"./chunk-BZENIQ7N.js";var require_debug=__commonJS({"../../node_modules/.pnpm/cli-table3@0.6.3/node_modules/cli-table3/src/debug.js"(exports,module){var messages=[],level=0,debug=(msg,min)=>{level>=min&&messages.push(msg)};debug.WARN=1;debug.INFO=2;debug.DEBUG=3;debug.reset=()=>{messages=[]};debug.setDebugLevel=v=>{level=v};debug.warn=msg=>debug(msg,debug.WARN);debug.info=msg=>debug(msg,debug.INFO);debug.debug=msg=>debug(msg,debug.DEBUG);debug.debugMessages=()=>messages;module.exports=debug}});var require_utils=__commonJS({"../../node_modules/.pnpm/cli-table3@0.6.3/node_modules/cli-table3/src/utils.js"(exports,module){var stringWidth=require_string_width();function codeRegex(capture){return capture?/\u001b\[((?:\d*;){0,5}\d*)m/g:/\u001b\[(?:\d*;){0,5}\d*m/g}function strlen(str){let code=codeRegex();return(""+str).replace(code,"").split(`
|
|
8
8
|
`).reduce(function(memo,s){return stringWidth(s)>memo?stringWidth(s):memo},0)}function repeat(str,times){return Array(times+1).join(str)}function pad(str,len,pad2,dir){let length=strlen(str);if(len+1>=length){let padlen=len-length;switch(dir){case"right":{str=repeat(pad2,padlen)+str;break}case"center":{let right=Math.ceil(padlen/2),left=padlen-right;str=repeat(pad2,left)+str+repeat(pad2,right);break}default:{str=str+repeat(pad2,padlen);break}}}return str}var codeCache={};function addToCodeCache(name,on,off){on="\x1B["+on+"m",off="\x1B["+off+"m",codeCache[on]={set:name,to:!0},codeCache[off]={set:name,to:!1},codeCache[name]={on,off}}addToCodeCache("bold",1,22);addToCodeCache("italics",3,23);addToCodeCache("underline",4,24);addToCodeCache("inverse",7,27);addToCodeCache("strikethrough",9,29);function updateState(state,controlChars){let controlCode=controlChars[1]?parseInt(controlChars[1].split(";")[0]):0;if(controlCode>=30&&controlCode<=39||controlCode>=90&&controlCode<=97){state.lastForegroundAdded=controlChars[0];return}if(controlCode>=40&&controlCode<=49||controlCode>=100&&controlCode<=107){state.lastBackgroundAdded=controlChars[0];return}if(controlCode===0){for(let i in state)Object.prototype.hasOwnProperty.call(state,i)&&delete state[i];return}let info=codeCache[controlChars[0]];info&&(state[info.set]=info.to)}function readState(line){let code=codeRegex(!0),controlChars=code.exec(line),state={};for(;controlChars!==null;)updateState(state,controlChars),controlChars=code.exec(line);return state}function unwindState(state,ret){let lastBackgroundAdded=state.lastBackgroundAdded,lastForegroundAdded=state.lastForegroundAdded;return delete state.lastBackgroundAdded,delete state.lastForegroundAdded,Object.keys(state).forEach(function(key){state[key]&&(ret+=codeCache[key].off)}),lastBackgroundAdded&&lastBackgroundAdded!="\x1B[49m"&&(ret+="\x1B[49m"),lastForegroundAdded&&lastForegroundAdded!="\x1B[39m"&&(ret+="\x1B[39m"),ret}function rewindState(state,ret){let lastBackgroundAdded=state.lastBackgroundAdded,lastForegroundAdded=state.lastForegroundAdded;return delete state.lastBackgroundAdded,delete state.lastForegroundAdded,Object.keys(state).forEach(function(key){state[key]&&(ret=codeCache[key].on+ret)}),lastBackgroundAdded&&lastBackgroundAdded!="\x1B[49m"&&(ret=lastBackgroundAdded+ret),lastForegroundAdded&&lastForegroundAdded!="\x1B[39m"&&(ret=lastForegroundAdded+ret),ret}function truncateWidth(str,desiredLength){if(str.length===strlen(str))return str.substr(0,desiredLength);for(;strlen(str)>desiredLength;)str=str.slice(0,-1);return str}function truncateWidthWithAnsi(str,desiredLength){let code=codeRegex(!0),split=str.split(codeRegex()),splitIndex=0,retLen=0,ret="",myArray,state={};for(;retLen<desiredLength;){myArray=code.exec(str);let toAdd=split[splitIndex];if(splitIndex++,retLen+strlen(toAdd)>desiredLength&&(toAdd=truncateWidth(toAdd,desiredLength-retLen)),ret+=toAdd,retLen+=strlen(toAdd),retLen<desiredLength){if(!myArray)break;ret+=myArray[0],updateState(state,myArray)}}return unwindState(state,ret)}function truncate(str,desiredLength,truncateChar){return truncateChar=truncateChar||"\u2026",strlen(str)<=desiredLength?str:(desiredLength-=strlen(truncateChar),truncateWidthWithAnsi(str,desiredLength)+truncateChar)}function defaultOptions(){return{chars:{top:"\u2500","top-mid":"\u252C","top-left":"\u250C","top-right":"\u2510",bottom:"\u2500","bottom-mid":"\u2534","bottom-left":"\u2514","bottom-right":"\u2518",left:"\u2502","left-mid":"\u251C",mid:"\u2500","mid-mid":"\u253C",right:"\u2502","right-mid":"\u2524",middle:"\u2502"},truncate:"\u2026",colWidths:[],rowHeights:[],colAligns:[],rowAligns:[],style:{"padding-left":1,"padding-right":1,head:["red"],border:["grey"],compact:!1},head:[]}}function mergeOptions(options,defaults){options=options||{},defaults=defaults||defaultOptions();let ret=Object.assign({},defaults,options);return ret.chars=Object.assign({},defaults.chars,options.chars),ret.style=Object.assign({},defaults.style,options.style),ret}function wordWrap(maxLength,input){let lines=[],split=input.split(/(\s+)/g),line=[],lineLength=0,whitespace;for(let i=0;i<split.length;i+=2){let word=split[i],newLength=lineLength+strlen(word);lineLength>0&&whitespace&&(newLength+=whitespace.length),newLength>maxLength?(lineLength!==0&&lines.push(line.join("")),line=[word],lineLength=strlen(word)):(line.push(whitespace||"",word),lineLength=newLength),whitespace=split[i+1]}return lineLength&&lines.push(line.join("")),lines}function textWrap(maxLength,input){let lines=[],line="";function pushLine(str,ws){for(line.length&&ws&&(line+=ws),line+=str;line.length>maxLength;)lines.push(line.slice(0,maxLength)),line=line.slice(maxLength)}let split=input.split(/(\s+)/g);for(let i=0;i<split.length;i+=2)pushLine(split[i],i&&split[i-1]);return line.length&&lines.push(line),lines}function multiLineWordWrap(maxLength,input,wrapOnWordBoundary=!0){let output=[];input=input.split(`
|
|
9
9
|
`);let handler=wrapOnWordBoundary?wordWrap:textWrap;for(let i=0;i<input.length;i++)output.push.apply(output,handler(maxLength,input[i]));return output}function colorizeLines(input){let state={},output=[];for(let i=0;i<input.length;i++){let line=rewindState(state,input[i]);state=readState(line);let temp=Object.assign({},state);output.push(unwindState(temp,line))}return output}function hyperlink(url,text){let OSC="\x1B]",BEL="\x07",SEP=";";return[OSC,"8",SEP,SEP,url||text,BEL,text,OSC,"8",SEP,SEP,BEL].join("")}module.exports={strlen,repeat,pad,truncate,mergeOptions,wordWrap:multiLineWordWrap,colorizeLines,hyperlink}}});var require_styles=__commonJS({"../../node_modules/.pnpm/@colors+colors@1.5.0/node_modules/@colors/colors/lib/styles.js"(exports,module){var styles={};module.exports=styles;var codes={reset:[0,0],bold:[1,22],dim:[2,22],italic:[3,23],underline:[4,24],inverse:[7,27],hidden:[8,28],strikethrough:[9,29],black:[30,39],red:[31,39],green:[32,39],yellow:[33,39],blue:[34,39],magenta:[35,39],cyan:[36,39],white:[37,39],gray:[90,39],grey:[90,39],brightRed:[91,39],brightGreen:[92,39],brightYellow:[93,39],brightBlue:[94,39],brightMagenta:[95,39],brightCyan:[96,39],brightWhite:[97,39],bgBlack:[40,49],bgRed:[41,49],bgGreen:[42,49],bgYellow:[43,49],bgBlue:[44,49],bgMagenta:[45,49],bgCyan:[46,49],bgWhite:[47,49],bgGray:[100,49],bgGrey:[100,49],bgBrightRed:[101,49],bgBrightGreen:[102,49],bgBrightYellow:[103,49],bgBrightBlue:[104,49],bgBrightMagenta:[105,49],bgBrightCyan:[106,49],bgBrightWhite:[107,49],blackBG:[40,49],redBG:[41,49],greenBG:[42,49],yellowBG:[43,49],blueBG:[44,49],magentaBG:[45,49],cyanBG:[46,49],whiteBG:[47,49]};Object.keys(codes).forEach(function(key){var val=codes[key],style=styles[key]=[];style.open="\x1B["+val[0]+"m",style.close="\x1B["+val[1]+"m"})}});var require_has_flag=__commonJS({"../../node_modules/.pnpm/@colors+colors@1.5.0/node_modules/@colors/colors/lib/system/has-flag.js"(exports,module){"use strict";module.exports=function(flag,argv){argv=argv||process.argv;var terminatorPos=argv.indexOf("--"),prefix=/^-{1,2}/.test(flag)?"":"--",pos=argv.indexOf(prefix+flag);return pos!==-1&&(terminatorPos===-1?!0:pos<terminatorPos)}}});var require_supports_colors=__commonJS({"../../node_modules/.pnpm/@colors+colors@1.5.0/node_modules/@colors/colors/lib/system/supports-colors.js"(exports,module){"use strict";var os=__require("os"),hasFlag=require_has_flag(),env=process.env,forceColor=void 0;hasFlag("no-color")||hasFlag("no-colors")||hasFlag("color=false")?forceColor=!1:(hasFlag("color")||hasFlag("colors")||hasFlag("color=true")||hasFlag("color=always"))&&(forceColor=!0);"FORCE_COLOR"in env&&(forceColor=env.FORCE_COLOR.length===0||parseInt(env.FORCE_COLOR,10)!==0);function translateLevel(level){return level===0?!1:{level,hasBasic:!0,has256:level>=2,has16m:level>=3}}function supportsColor(stream){if(forceColor===!1)return 0;if(hasFlag("color=16m")||hasFlag("color=full")||hasFlag("color=truecolor"))return 3;if(hasFlag("color=256"))return 2;if(stream&&!stream.isTTY&&forceColor!==!0)return 0;var min=forceColor?1:0;if(process.platform==="win32"){var osRelease=os.release().split(".");return Number(process.versions.node.split(".")[0])>=8&&Number(osRelease[0])>=10&&Number(osRelease[2])>=10586?Number(osRelease[2])>=14931?3:2:1}if("CI"in env)return["TRAVIS","CIRCLECI","APPVEYOR","GITLAB_CI"].some(function(sign){return sign in env})||env.CI_NAME==="codeship"?1:min;if("TEAMCITY_VERSION"in env)return/^(9\.(0*[1-9]\d*)\.|\d{2,}\.)/.test(env.TEAMCITY_VERSION)?1:0;if("TERM_PROGRAM"in env){var version=parseInt((env.TERM_PROGRAM_VERSION||"").split(".")[0],10);switch(env.TERM_PROGRAM){case"iTerm.app":return version>=3?3:2;case"Hyper":return 3;case"Apple_Terminal":return 2}}return/-256(color)?$/i.test(env.TERM)?2:/^screen|^xterm|^vt100|^rxvt|color|ansi|cygwin|linux/i.test(env.TERM)||"COLORTERM"in env?1:(env.TERM==="dumb",min)}function getSupportLevel(stream){var level=supportsColor(stream);return translateLevel(level)}module.exports={supportsColor:getSupportLevel,stdout:getSupportLevel(process.stdout),stderr:getSupportLevel(process.stderr)}}});var require_trap=__commonJS({"../../node_modules/.pnpm/@colors+colors@1.5.0/node_modules/@colors/colors/lib/custom/trap.js"(exports,module){module.exports=function(text,options){var result="";text=text||"Run the trap, drop the bass",text=text.split("");var trap={a:["@","\u0104","\u023A","\u0245","\u0394","\u039B","\u0414"],b:["\xDF","\u0181","\u0243","\u026E","\u03B2","\u0E3F"],c:["\xA9","\u023B","\u03FE"],d:["\xD0","\u018A","\u0500","\u0501","\u0502","\u0503"],e:["\xCB","\u0115","\u018E","\u0258","\u03A3","\u03BE","\u04BC","\u0A6C"],f:["\u04FA"],g:["\u0262"],h:["\u0126","\u0195","\u04A2","\u04BA","\u04C7","\u050A"],i:["\u0F0F"],j:["\u0134"],k:["\u0138","\u04A0","\u04C3","\u051E"],l:["\u0139"],m:["\u028D","\u04CD","\u04CE","\u0520","\u0521","\u0D69"],n:["\xD1","\u014B","\u019D","\u0376","\u03A0","\u048A"],o:["\xD8","\xF5","\xF8","\u01FE","\u0298","\u047A","\u05DD","\u06DD","\u0E4F"],p:["\u01F7","\u048E"],q:["\u09CD"],r:["\xAE","\u01A6","\u0210","\u024C","\u0280","\u042F"],s:["\xA7","\u03DE","\u03DF","\u03E8"],t:["\u0141","\u0166","\u0373"],u:["\u01B1","\u054D"],v:["\u05D8"],w:["\u0428","\u0460","\u047C","\u0D70"],x:["\u04B2","\u04FE","\u04FC","\u04FD"],y:["\xA5","\u04B0","\u04CB"],z:["\u01B5","\u0240"]};return text.forEach(function(c){c=c.toLowerCase();var chars=trap[c]||[" "],rand=Math.floor(Math.random()*chars.length);typeof trap[c]<"u"?result+=trap[c][rand]:result+=c}),result}}});var require_zalgo=__commonJS({"../../node_modules/.pnpm/@colors+colors@1.5.0/node_modules/@colors/colors/lib/custom/zalgo.js"(exports,module){module.exports=function(text,options){text=text||" he is here ";var soul={up:["\u030D","\u030E","\u0304","\u0305","\u033F","\u0311","\u0306","\u0310","\u0352","\u0357","\u0351","\u0307","\u0308","\u030A","\u0342","\u0313","\u0308","\u034A","\u034B","\u034C","\u0303","\u0302","\u030C","\u0350","\u0300","\u0301","\u030B","\u030F","\u0312","\u0313","\u0314","\u033D","\u0309","\u0363","\u0364","\u0365","\u0366","\u0367","\u0368","\u0369","\u036A","\u036B","\u036C","\u036D","\u036E","\u036F","\u033E","\u035B","\u0346","\u031A"],down:["\u0316","\u0317","\u0318","\u0319","\u031C","\u031D","\u031E","\u031F","\u0320","\u0324","\u0325","\u0326","\u0329","\u032A","\u032B","\u032C","\u032D","\u032E","\u032F","\u0330","\u0331","\u0332","\u0333","\u0339","\u033A","\u033B","\u033C","\u0345","\u0347","\u0348","\u0349","\u034D","\u034E","\u0353","\u0354","\u0355","\u0356","\u0359","\u035A","\u0323"],mid:["\u0315","\u031B","\u0300","\u0301","\u0358","\u0321","\u0322","\u0327","\u0328","\u0334","\u0335","\u0336","\u035C","\u035D","\u035E","\u035F","\u0360","\u0362","\u0338","\u0337","\u0361"," \u0489"]},all=[].concat(soul.up,soul.down,soul.mid);function randomNumber(range){var r=Math.floor(Math.random()*range);return r}function isChar(character){var bool=!1;return all.filter(function(i){bool=i===character}),bool}function heComes(text2,options2){var result="",counts,l;options2=options2||{},options2.up=typeof options2.up<"u"?options2.up:!0,options2.mid=typeof options2.mid<"u"?options2.mid:!0,options2.down=typeof options2.down<"u"?options2.down:!0,options2.size=typeof options2.size<"u"?options2.size:"maxi",text2=text2.split("");for(l in text2)if(!isChar(l)){switch(result=result+text2[l],counts={up:0,down:0,mid:0},options2.size){case"mini":counts.up=randomNumber(8),counts.mid=randomNumber(2),counts.down=randomNumber(8);break;case"maxi":counts.up=randomNumber(16)+3,counts.mid=randomNumber(4)+1,counts.down=randomNumber(64)+3;break;default:counts.up=randomNumber(8)+1,counts.mid=randomNumber(6)/2,counts.down=randomNumber(8)+1;break}var arr=["up","mid","down"];for(var d in arr)for(var index=arr[d],i=0;i<=counts[index];i++)options2[index]&&(result=result+soul[index][randomNumber(soul[index].length)])}return result}return heComes(text,options)}}});var require_america=__commonJS({"../../node_modules/.pnpm/@colors+colors@1.5.0/node_modules/@colors/colors/lib/maps/america.js"(exports,module){module.exports=function(colors){return function(letter,i,exploded){if(letter===" ")return letter;switch(i%3){case 0:return colors.red(letter);case 1:return colors.white(letter);case 2:return colors.blue(letter)}}}}});var require_zebra=__commonJS({"../../node_modules/.pnpm/@colors+colors@1.5.0/node_modules/@colors/colors/lib/maps/zebra.js"(exports,module){module.exports=function(colors){return function(letter,i,exploded){return i%2===0?letter:colors.inverse(letter)}}}});var require_rainbow=__commonJS({"../../node_modules/.pnpm/@colors+colors@1.5.0/node_modules/@colors/colors/lib/maps/rainbow.js"(exports,module){module.exports=function(colors){var rainbowColors=["red","yellow","green","blue","magenta"];return function(letter,i,exploded){return letter===" "?letter:colors[rainbowColors[i++%rainbowColors.length]](letter)}}}});var require_random=__commonJS({"../../node_modules/.pnpm/@colors+colors@1.5.0/node_modules/@colors/colors/lib/maps/random.js"(exports,module){module.exports=function(colors){var available=["underline","inverse","grey","yellow","red","green","blue","white","cyan","magenta","brightYellow","brightRed","brightGreen","brightBlue","brightWhite","brightCyan","brightMagenta"];return function(letter,i,exploded){return letter===" "?letter:colors[available[Math.round(Math.random()*(available.length-2))]](letter)}}}});var require_colors=__commonJS({"../../node_modules/.pnpm/@colors+colors@1.5.0/node_modules/@colors/colors/lib/colors.js"(exports,module){var colors={};module.exports=colors;colors.themes={};var util=__require("util"),ansiStyles=colors.styles=require_styles(),defineProps=Object.defineProperties,newLineRegex=new RegExp(/[\r\n]+/g);colors.supportsColor=require_supports_colors().supportsColor;typeof colors.enabled>"u"&&(colors.enabled=colors.supportsColor()!==!1);colors.enable=function(){colors.enabled=!0};colors.disable=function(){colors.enabled=!1};colors.stripColors=colors.strip=function(str){return(""+str).replace(/\x1B\[\d+m/g,"")};var stylize=colors.stylize=function(str,style){if(!colors.enabled)return str+"";var styleMap=ansiStyles[style];return!styleMap&&style in colors?colors[style](str):styleMap.open+str+styleMap.close},matchOperatorsRe=/[|\\{}()[\]^$+*?.]/g,escapeStringRegexp=function(str){if(typeof str!="string")throw new TypeError("Expected a string");return str.replace(matchOperatorsRe,"\\$&")};function build(_styles){var builder=function builder2(){return applyStyle.apply(builder2,arguments)};return builder._styles=_styles,builder.__proto__=proto,builder}var styles=function(){var ret={};return ansiStyles.grey=ansiStyles.gray,Object.keys(ansiStyles).forEach(function(key){ansiStyles[key].closeRe=new RegExp(escapeStringRegexp(ansiStyles[key].close),"g"),ret[key]={get:function(){return build(this._styles.concat(key))}}}),ret}(),proto=defineProps(function(){},styles);function applyStyle(){var args=Array.prototype.slice.call(arguments),str=args.map(function(arg){return arg!=null&&arg.constructor===String?arg:util.inspect(arg)}).join(" ");if(!colors.enabled||!str)return str;for(var newLinesPresent=str.indexOf(`
|
|
10
10
|
`)!=-1,nestedStyles=this._styles,i=nestedStyles.length;i--;){var code=ansiStyles[nestedStyles[i]];str=code.open+str.replace(code.closeRe,code.open)+code.close,newLinesPresent&&(str=str.replace(newLineRegex,function(match){return code.close+match+code.open}))}return str}colors.setTheme=function(theme){if(typeof theme=="string"){console.log("colors.setTheme now only accepts an object, not a string. If you are trying to set a theme from a file, it is now your (the caller's) responsibility to require the file. The old syntax looked like colors.setTheme(__dirname + '/../themes/generic-logging.js'); The new syntax looks like colors.setTheme(require(__dirname + '/../themes/generic-logging.js'));");return}for(var style in theme)(function(style2){colors[style2]=function(str){if(typeof theme[style2]=="object"){var out=str;for(var i in theme[style2])out=colors[theme[style2][i]](out);return out}return colors[theme[style2]](str)}})(style)};function init(){var ret={};return Object.keys(styles).forEach(function(name){ret[name]={get:function(){return build([name])}}}),ret}var sequencer=function(map2,str){var exploded=str.split("");return exploded=exploded.map(map2),exploded.join("")};colors.trap=require_trap();colors.zalgo=require_zalgo();colors.maps={};colors.maps.america=require_america()(colors);colors.maps.zebra=require_zebra()(colors);colors.maps.rainbow=require_rainbow()(colors);colors.maps.random=require_random()(colors);for(map in colors.maps)(function(map2){colors[map2]=function(str){return sequencer(colors.maps[map2],str)}})(map);var map;defineProps(colors,init())}});var require_safe=__commonJS({"../../node_modules/.pnpm/@colors+colors@1.5.0/node_modules/@colors/colors/safe.js"(exports,module){var colors=require_colors();module.exports=colors}});var require_cell=__commonJS({"../../node_modules/.pnpm/cli-table3@0.6.3/node_modules/cli-table3/src/cell.js"(exports,module){var{info,debug}=require_debug(),utils=require_utils(),Cell=class _Cell{constructor(options){this.setOptions(options),this.x=null,this.y=null}setOptions(options){["boolean","number","string"].indexOf(typeof options)!==-1&&(options={content:""+options}),options=options||{},this.options=options;let content=options.content;if(["boolean","number","string"].indexOf(typeof content)!==-1)this.content=String(content);else if(!content)this.content=this.options.href||"";else throw new Error("Content needs to be a primitive, got: "+typeof content);this.colSpan=options.colSpan||1,this.rowSpan=options.rowSpan||1,this.options.href&&Object.defineProperty(this,"href",{get(){return this.options.href}})}mergeTableOptions(tableOptions,cells){this.cells=cells;let optionsChars=this.options.chars||{},tableChars=tableOptions.chars,chars=this.chars={};CHAR_NAMES.forEach(function(name){setOption(optionsChars,tableChars,name,chars)}),this.truncate=this.options.truncate||tableOptions.truncate;let style=this.options.style=this.options.style||{},tableStyle=tableOptions.style;setOption(style,tableStyle,"padding-left",this),setOption(style,tableStyle,"padding-right",this),this.head=style.head||tableStyle.head,this.border=style.border||tableStyle.border,this.fixedWidth=tableOptions.colWidths[this.x],this.lines=this.computeLines(tableOptions),this.desiredWidth=utils.strlen(this.content)+this.paddingLeft+this.paddingRight,this.desiredHeight=this.lines.length}computeLines(tableOptions){let tableWordWrap=tableOptions.wordWrap||tableOptions.textWrap,{wordWrap=tableWordWrap}=this.options;if(this.fixedWidth&&wordWrap){if(this.fixedWidth-=this.paddingLeft+this.paddingRight,this.colSpan){let i=1;for(;i<this.colSpan;)this.fixedWidth+=tableOptions.colWidths[this.x+i],i++}let{wrapOnWordBoundary:tableWrapOnWordBoundary=!0}=tableOptions,{wrapOnWordBoundary=tableWrapOnWordBoundary}=this.options;return this.wrapLines(utils.wordWrap(this.fixedWidth,this.content,wrapOnWordBoundary))}return this.wrapLines(this.content.split(`
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { createRequire as __createRequire } from 'node:module';
|
|
2
|
+
import { fileURLToPath as __fileURLToPath } from 'node:url';
|
|
3
|
+
import { dirname as __dirname_ } from 'node:path';
|
|
4
|
+
const require = __createRequire(import.meta.url);
|
|
5
|
+
const __filename = __fileURLToPath(import.meta.url);
|
|
6
|
+
const __dirname = __dirname_(__filename);
|
|
7
|
+
import{writeProjectSettings}from"./chunk-I4O53MKV.js";import{repoRootContains,repoRootOutsideMessage,resolvesToDirectoryInside}from"./chunk-T5JHWXS5.js";import{stamp_default}from"./chunk-A2RZZQEP.js";import{envPullCommandLogic}from"./chunk-PZL7NSDA.js";import{parseTarget,warnDeprecatedProdFlag}from"./chunk-IVZNPSHU.js";import{ensureLink}from"./chunk-Q7HFUXJ4.js";import{pullCommand}from"./chunk-G24EKATW.js";import{TelemetryClient}from"./chunk-EYRBV6RM.js";import{VERCEL_DIR,VERCEL_DIR_PROJECT,describePullPathFix,getWriteCheckRoot,inspectWritableFile,jsonNextStep,printEnvFileSymlinkError,printUnsafeWritePathError,runWithJsonOutput,toEnvFileSymlinkError,writeJsonFailure,writeJsonResult,writeJsonUsageError}from"./chunk-4Z6R5KHZ.js";import{printAlignedLabel}from"./chunk-M2Q2DUHO.js";import{printError}from"./chunk-HMJR6RVF.js";import{parseArguments}from"./chunk-INIZJZ3O.js";import{AGENT_REASON,AGENT_STATUS}from"./chunk-CSNP5RIM.js";import{EnvFileSymlinkError,UnsafeWritePathError,humanizePath}from"./chunk-QFE3RPMA.js";import{emoji,output_manager_default,prependEmoji}from"./chunk-RYSO5U3E.js";import{help}from"./chunk-5727HGA6.js";import{getFlagsSpecification}from"./chunk-DORCX7UB.js";import{require_source}from"./chunk-NB2WLB3J.js";import{__toESM}from"./chunk-BZENIQ7N.js";var import_chalk=__toESM(require_source(),1);import{join}from"node:path";var PullTelemetryClient=class extends TelemetryClient{trackCliArgumentProjectPath(value){value&&this.trackCliArgument({arg:"projectPath",value:this.redactedValue})}trackCliOptionEnvironment(environment){environment&&this.trackCliOption({option:"environment",value:this.redactedTargetName(environment)})}trackCliOptionGitBranch(gitBranch){gitBranch&&this.trackCliOption({option:"git-branch",value:this.redactedValue})}trackCliFlagProd(isProduction){isProduction&&this.trackCliFlag("prod")}trackCliFlagYes(yes){yes&&this.trackCliFlag("yes")}trackCliFlagJson(json){json&&this.trackCliFlag("json")}};function getEnvFilename(environment){return join(VERCEL_DIR,`.env.${environment}.local`)}async function pullAllEnvFiles(environment,client,link,flags,cwd){return await envPullCommandLogic(client,getEnvFilename(environment),!!flags["--yes"],environment,link,flags["--git-branch"],cwd,"vercel-cli:pull")}async function main(client){let parsedArgs=null,flagsSpecification=getFlagsSpecification(pullCommand.options);try{parsedArgs=parseArguments(client.argv.slice(2),flagsSpecification)}catch(error){return client.argv.includes("--json")?writeJsonUsageError(client,error):(printError(error),2)}let telemetryClient=new PullTelemetryClient({opts:{store:client.telemetryEventStore}});if(parsedArgs.flags["--help"])return telemetryClient.trackCliFlagHelp("pull"),output_manager_default.print(help(pullCommand,{stream:client.stderr,columns:client.stderr.columns})),0;let cwd=parsedArgs.args[1]||client.cwd,autoConfirm=!!parsedArgs.flags["--yes"],isProduction=!!parsedArgs.flags["--prod"];warnDeprecatedProdFlag(client,parsedArgs.flags);let environment=parseTarget({flagName:"environment",flags:parsedArgs.flags})||"development";telemetryClient.trackCliArgumentProjectPath(parsedArgs.args[1]),telemetryClient.trackCliFlagYes(autoConfirm),telemetryClient.trackCliFlagProd(isProduction),telemetryClient.trackCliOptionGitBranch(parsedArgs.flags["--git-branch"]),telemetryClient.trackCliOptionEnvironment(parsedArgs.flags["--environment"]),telemetryClient.trackCliOptionProject(parsedArgs.flags["--project"]),telemetryClient.trackCliFlagJson(parsedArgs.flags["--json"]);let json=!!parsedArgs.flags["--json"],flags=parsedArgs.flags,run=()=>pullCommandLogic(client,cwd,autoConfirm,environment,flags,flags["--project"],{json});return json?runWithJsonOutput(client,run):run()}async function pullCommandLogic(client,cwd,autoConfirm,environment,flags,projectNameOrId,{json=!1}={}){let link=await ensureLink("pull",client,cwd,{autoConfirm,pullEnv:!1,projectName:projectNameOrId,failIfNotFound:!!projectNameOrId,skipOwnerLookup:!0,allowConfigExecution:!1});if(typeof link=="number")return link;let{project,org,repoRoot}=link,currentDirectory;if(repoRoot){if(!await repoRootContains(repoRoot,cwd))return output_manager_default.error(repoRootOutsideMessage("pull into",cwd,repoRoot)),1;if(currentDirectory=join(repoRoot,project.rootDirectory||""),project.rootDirectory&&!await resolvesToDirectoryInside(repoRoot,currentDirectory)){output_manager_default.fatal("Can't pull the project. Its Root Directory does not resolve to a directory in the repository."),printAlignedLabel("Repository",humanizePath(repoRoot));let{isPlainPath}=await import("./repo-root-DZ6WFHMP.js");return isPlainPath(project.rootDirectory)&&printAlignedLabel("Root Directory",project.rootDirectory),output_manager_default.print(`
|
|
8
|
+
Check the Root Directory in the Project Settings and the symbolic links in that path.
|
|
9
|
+
`),1}}else currentDirectory=cwd;client.config.currentTeam=org.type==="team"?org.id:void 0;let root=getWriteCheckRoot(client.cwd,currentDirectory,repoRoot),envFilename=getEnvFilename(environment),settingsPath=join(currentDirectory,VERCEL_DIR,VERCEL_DIR_PROJECT),envFile;try{await inspectWritableFile(join(currentDirectory,envFilename),root).catch(err=>{throw toEnvFileSymlinkError(err,envFilename)}),await inspectWritableFile(settingsPath,root),envFile=await pullAllEnvFiles(environment,client,link,flags,currentDirectory)}catch(err){if(!(err instanceof EnvFileSymlinkError||err instanceof UnsafeWritePathError))throw err;let fix=describePullPathFix(err),rerun=jsonNextStep(client,["pull",...cwd!==client.cwd?[cwd]:[],"--environment",environment,...flags["--git-branch"]?["--git-branch",flags["--git-branch"]]:[],...projectNameOrId?["--project",projectNameOrId]:[],...autoConfirm?["--yes"]:[]],fix.when);if(json)return writeJsonFailure(client,{status:AGENT_STATUS.ACTION_REQUIRED,message:err.message,next:[rerun],...err instanceof EnvFileSymlinkError?{reason:AGENT_REASON.ENV_FILE_SYMLINK,data:{path:err.meta.path,kind:err.meta.kind}}:{reason:AGENT_REASON.UNSAFE_WRITE_PATH,data:{path:err.meta.path,problem:err.meta.problem}}},1);let recoveries=[{instruction:`${fix.instruction}, then run`,command:rerun.command}];return err instanceof EnvFileSymlinkError?printEnvFileSymlinkError(err,recoveries):printUnsafeWritePathError(err,recoveries),1}if(output_manager_default.print(`
|
|
10
|
+
`),output_manager_default.log("Downloading project settings"),await writeProjectSettings(currentDirectory,project,org,typeof repoRoot=="string",root),json)return writeJsonResult(client,{envFile:envFile?{path:envFile.path,variables:envFile.variables}:null,projectSettings:{path:settingsPath},outcome:"pulled",...envFile?.secretNotReturnedWarning?{warnings:[{reason:"secret_not_returned",message:envFile.secretNotReturnedWarning}]}:{},next:[jsonNextStep(client,["env","list","--environment",environment,...projectNameOrId?["--project",projectNameOrId]:[]],"List the Environment Variables")]});let settingsStamp=stamp_default();return output_manager_default.print(`${prependEmoji(`Downloaded project settings to ${import_chalk.default.bold(humanizePath(settingsPath))} ${import_chalk.default.gray(settingsStamp())}`,emoji("success"))}
|
|
11
|
+
`),0}export{main,pullCommandLogic};
|
|
@@ -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{assertOrgIdMatchesAppTeam,findProjectsFromPath,getConfigFilePath,getLinkFromDir,getOrgSlug,getRepoLink,getUser,getVercelDirectory,introspectToken,isOwnerLookupUnavailableError,resolveAppFromToken}from"./chunk-4Z6R5KHZ.js";import{require_ms}from"./chunk-MXTC4ZAQ.js";import{parseArguments}from"./chunk-INIZJZ3O.js";import{getTeamByIdOrSlug}from"./chunk-CSNP5RIM.js";import{require_cli_config}from"./chunk-4SAVH3H7.js";import{InvalidToken,TeamDeleted}from"./chunk-QFE3RPMA.js";import{output_manager_default}from"./chunk-RYSO5U3E.js";import{require_build_utils}from"./chunk-5MDNVAE6.js";import{__toESM}from"./chunk-BZENIQ7N.js";var import_cli_config=__toESM(require_cli_config(),1),import_ms=__toESM(require_ms(),1);var TEAM_SLUG_TTL_MS=(0,import_ms.default)("1d");function getCachedTeamSlug(config,teamId,now=Date.now()){let saved=config.cachedTeamSlugs?.[teamId];if(!isSavedTeamSlug(saved))return;let age=now-saved.savedAt;return age>=0&&age<TEAM_SLUG_TTL_MS?saved.slug:void 0}function setCachedTeamSlug(client,teamId,slug){if(getCachedTeamSlug(client.config,teamId)===slug)return;let saved={slug,savedAt:Date.now()};updateCachedTeamSlugs(client,slugs=>({...slugs,[teamId]:saved}))}function forgetCachedTeamSlug(client,teamId){let slugs=client.config.cachedTeamSlugs;!slugs||!(teamId in slugs)||updateCachedTeamSlugs(client,saved=>{let rest={...saved};return delete rest[teamId],rest})}function isSavedTeamSlug(value){return typeof value=="object"&&value!==null&&typeof value.slug=="string"&&typeof value.savedAt=="number"}function updateCachedTeamSlugs(client,update){try{let configPath=getConfigFilePath(),savedConfig=(0,import_cli_config.readGlobalConfigFile)(configPath),cachedTeamSlugs=update(savedConfig.cachedTeamSlugs??{}),config={...savedConfig,cachedTeamSlugs};(0,import_cli_config.writeGlobalConfigFile)(configPath,config),client.config.cachedTeamSlugs=cachedTeamSlugs}catch{output_manager_default.debug("Failed to persist cached team slugs.")}}var import_build_utils=__toESM(require_build_utils(),1);import{relative}from"path";async function getScope(client,opts={}){let{user,app,token}=await getPrincipal(client),defaultTeamId=user?.version==="northstar"&&!client.ignoresSavedTeam?user.defaultTeamId:void 0,appTeamId=!user&&app?token?.team?.id:void 0;if(!user&&app&&opts.getTeam===!1)throw new Error("App principal scope resolution requires a team lookup.");!user&&app&&(client.ignoresSavedTeam&&appTeamId&&assertOrgIdMatchesAppTeam(client,appTeamId),client.config.currentTeam=appTeamId),!client.config.currentTeam&&defaultTeamId&&(client.config.currentTeam=defaultTeamId),client.isTeamUnchosen()&&await client.chooseTeam({ask:opts.chooseTeam!==!1});let teamId=client.config.currentTeam||defaultTeamId,team=teamId&&opts.getTeam!==!1?await getTeam(client,teamId).catch(err=>{let appTeam=token?.team;if(opts.allowOwnerLookupFallback&&!user&&app&&appTeam?.id===teamId&&isOwnerLookupUnavailableError(err))return output_manager_default.debug(`Can't read team ${teamId}; using its token's team`),{id:appTeam.id,slug:appTeam.slug||appTeam.id,name:appTeam.name};throw err}):null,contextName=team?.slug||user?.username||user?.email;if(!contextName)throw new Error("Unable to determine context name");return opts.resolveLocalScope?resolveLocalScopeContext(client,{user,app,team}):{contextName,team,user,app}}async function getContextName(client,opts={}){let teamId=client.config.currentTeam,cachedSlug=teamId&&!client.authConfig.tokenSource?getCachedTeamSlug(client.config,teamId):void 0;if(cachedSlug&&!(opts.resolveLocalScope&&await hasLocalScope(client)))return output_manager_default.debug(`Using saved name "${cachedSlug}" for team ${teamId}`),cachedSlug;let scope;try{scope=opts.resolveLocalScope?await getScope(client,{resolveLocalScope:!0}):await getScope(client)}catch(err){let currentTeam=client.config.currentTeam;if(opts.allowOwnerLookupFallback&¤tTeam&&isOwnerLookupUnavailableError(err))return output_manager_default.debug(`Can't read team ${currentTeam}; using its token's name`),getOrgSlug(client,{id:currentTeam});throw err}let{contextName,team}=scope;return team&&!client.authConfig.tokenSource&&setCachedTeamSlug(client,team.id,team.slug),contextName}async function hasLocalScope(client){if(detectExplicitScope(client))return!1;let{localOrgId,isCrossTeamRepo}=await findLocalLink(client);return!!localOrgId||isCrossTeamRepo}async function getPrincipal(client){try{return{user:await getUser(client),app:null,token:null}}catch(err){if(!(err instanceof InvalidToken))throw err;let token=await introspectToken(client).catch(()=>null),app=token?resolveAppFromToken(token):null;if(!app)throw err;return{user:null,app,token}}}async function resolveLocalScopeContext(client,{user,app,team}){let explicitScopeProvided=detectExplicitScope(client)||client.ignoresSavedTeam&&!!(0,import_build_utils.getPlatformEnv)("ORG_ID"),globalTeamId=client.config.currentTeam,{localOrgId,linkedRepo,isCrossTeamRepo}=await findLocalLink(client),isAppPrincipal=!user&&!!app,effectiveLocalOrgId=isAppPrincipal?void 0:localOrgId,scopeMismatch=!!(effectiveLocalOrgId&&globalTeamId&&globalTeamId!==effectiveLocalOrgId);!isAppPrincipal&&!explicitScopeProvided&&!effectiveLocalOrgId&&isCrossTeamRepo&&output_manager_default.warn("This repository has projects across multiple teams. Use `--scope` to specify which team, or `cd` into a project directory.");let resolvedTeam=!explicitScopeProvided&&effectiveLocalOrgId?await applyLocalOrg(client,effectiveLocalOrgId):team,{org,contextName}=resolveOrg(resolvedTeam,user);return{org,contextName,user,team:resolvedTeam,app,globalTeam:team,linkedRepo,isCrossTeamRepo,localOrgId:effectiveLocalOrgId,scopeMismatch,explicitScopeProvided}}async function applyLocalOrg(client,localOrgId){return client.config.currentTeam=localOrgId.startsWith("team_")?localOrgId:void 0,client.config.currentTeam?await getTeamByIdOrSlug(client,client.config.currentTeam):null}async function getTeam(client,teamId){let team=await getTeamByIdOrSlug(client,teamId);if(!team)throw new TeamDeleted;return team}function resolveOrg(team,user){if(team)return{org:{type:"team",id:team.id,slug:team.slug},contextName:team.slug};if(user)return{org:{type:"user",id:user.id,slug:user.username},contextName:user.username||user.email};throw new Error("Unable to determine scope: no team or personal account is available for this token. Use `--scope` to specify a team.")}async function getLocalOrgId(client){return(await findLocalLink(client)).localOrgId}async function findLocalLink(client){let[projectLink,repoLink]=await Promise.all([findProjectLink(client),findRepoLink(client)]);return{localOrgId:findLocalOrgId(client.cwd,projectLink,repoLink),linkedRepo:repoLink?.repoConfig?{repoConfig:repoLink.repoConfig,rootPath:repoLink.rootPath}:null,isCrossTeamRepo:detectCrossTeamRepo(repoLink?.repoConfig)}}async function findProjectLink(client){try{return await getLinkFromDir(getVercelDirectory(client.cwd))}catch{return null}}async function findRepoLink(client){try{return await getRepoLink(client,client.cwd)}catch{return null}}function findLocalOrgId(cwd,projectLink,repoLink){if(projectLink)return projectLink.orgId;if(repoLink?.repoConfig)return findRepoOrgId(repoLink.repoConfig,relative(repoLink.rootPath,cwd))}function findRepoOrgId(repoConfig,pathFromRepoRoot){let matchedProjects=findProjectsFromPath(repoConfig.projects,pathFromRepoRoot),projects=matchedProjects.length===0&&pathFromRepoRoot===""?repoConfig.projects:matchedProjects,orgIds=new Set(projects.map(p=>p.orgId??repoConfig.orgId??""));if(orgIds.size!==1)return;let[orgId]=orgIds;return orgId||void 0}function scopeFlagPassed(argv){for(let index=0;index<argv.length;index++){let arg=argv[index];if(arg==="--")break;if(arg==="--scope"||arg==="--team"||arg.startsWith("--scope=")||arg.startsWith("--team=")||arg==="-S"||arg==="-T"||isGroupedScopeFlag(argv,index))return!0}return!1}function isGroupedScopeFlag(argv,index){let value=argv[index+1];return/^-[A-Za-z]+[ST]$/.test(argv[index])&&argv[index].length>2&&value!==void 0&&value!==""&&!value.startsWith("-")}function detectExplicitScope(client){return scopeFlagPassed(client.argv)||!!client.localConfig?.scope}function hasExplicitScopeValue(client){if(client.localConfig?.scope)return!0;if(!scopeFlagPassed(client.argv))return!1;let{flags}=parseArguments(client.argv.slice(2),{},{permissive:!0});return!!(flags["--scope"]||flags["--team"])}function detectCrossTeamRepo(repoConfig){if(!repoConfig?.projects||repoConfig.projects.length<2)return!1;let orgIds=new Set;for(let project of repoConfig.projects){let orgId=project.orgId??repoConfig.orgId;orgId&&orgIds.add(orgId)}return orgIds.size>1}export{getCachedTeamSlug,forgetCachedTeamSlug,getScope,getContextName,resolveOrg,getLocalOrgId,scopeFlagPassed,isGroupedScopeFlag,detectExplicitScope,hasExplicitScopeValue};
|
|
@@ -4,6 +4,6 @@ import { dirname as __dirname_ } from 'node:path';
|
|
|
4
4
|
const require = __createRequire(import.meta.url);
|
|
5
5
|
const __filename = __fileURLToPath(import.meta.url);
|
|
6
6
|
const __dirname = __dirname_(__filename);
|
|
7
|
-
import{getDeployment}from"./chunk-
|
|
7
|
+
import{getDeployment}from"./chunk-6Z5REGCM.js";import{getScope}from"./chunk-VIOIR6II.js";import{require_dist}from"./chunk-4Z6R5KHZ.js";import{toNodeReadable}from"./chunk-MY4MONOH.js";import{output_manager_default}from"./chunk-RYSO5U3E.js";import{require_ansi_escapes}from"./chunk-YHPPP3SF.js";import{__commonJS,__require,__toESM}from"./chunk-BZENIQ7N.js";var require_parser=__commonJS({"../../node_modules/.pnpm/jsonlines@0.1.1/node_modules/jsonlines/lib/parser.js"(exports,module){var Transform=__require("stream").Transform;function Parser(options){if(!(this instanceof Parser))throw new TypeError("Cannot call a class as a function");options=options||{},Transform.call(this,{objectMode:!0}),this._memory="",this._emitInvalidLines=options.emitInvalidLines||!1}Parser.prototype=Object.create(Transform.prototype);Parser.prototype._handleLines=function(lines,cb){for(var i=0;i<lines.length;i++)if(lines[i]!==""){var err=null,json=null;try{json=JSON.parse(lines[i])}catch(_err){_err.source=lines[i],err=_err}if(err)if(this._emitInvalidLines)this.emit("invalid-line",err);else return cb(err);else this.push(json)}cb(null)};Parser.prototype._transform=function(chunk,encoding,cb){var lines=(this._memory+chunk.toString()).split(`
|
|
8
8
|
`);this._memory=lines.pop(),this._handleLines(lines,cb)};Parser.prototype._flush=function(cb){if(!this._memory)return cb(null);var line=this._memory;this._memory="",this._handleLines([line],cb)};module.exports=Parser}});var require_stringifier=__commonJS({"../../node_modules/.pnpm/jsonlines@0.1.1/node_modules/jsonlines/lib/stringifier.js"(exports,module){var Transform=__require("stream").Transform;function Stringifier(){if(!(this instanceof Stringifier))throw new TypeError("Cannot call a class as a function");Transform.call(this,{objectMode:!0})}Stringifier.prototype=Object.create(Transform.prototype);Stringifier.prototype._transform=function(data,_,cb){var value;try{value=JSON.stringify(data)}catch(err){return err.source=data,cb(err)}cb(null,value+`
|
|
9
9
|
`)};module.exports=Stringifier}});var require_jsonlines=__commonJS({"../../node_modules/.pnpm/jsonlines@0.1.1/node_modules/jsonlines/index.js"(exports){var Parser=require_parser(),Stringifier=require_stringifier();exports.parse=function(options){return new Parser(options)};exports.stringify=function(){return new Stringifier}}});var import_async_retry=__toESM(require_dist(),1),import_jsonlines=__toESM(require_jsonlines(),1),import_ansi_escapes=__toESM(require_ansi_escapes(),1);import{URLSearchParams}from"url";async function printEvents(client,urlOrDeploymentId,{mode,onEvent,onAliasAssigned,quiet,findOpts},abortController){let{log,debug}=output_manager_default,scope=mode==="deploy"?await getScope(client):null,o=0;await(0,import_async_retry.default)(async(bail,attemptNumber)=>{if(abortController?.signal.aborted)return;attemptNumber>1&&debug("Retrying events");let query=new URLSearchParams({direction:findOpts.direction,follow:findOpts.follow?"1":"",format:"lines"});findOpts.limit&&query.set("limit",String(findOpts.limit)),findOpts.since&&query.set("since",String(findOpts.since)),findOpts.until&&query.set("until",String(findOpts.until));let eventsUrl=`/v3/now/deployments/${urlOrDeploymentId}/events?${query}`;try{let eventsRes=await client.fetch(eventsUrl,{json:!1,signal:abortController?.signal});if(eventsRes.ok){let readable=toNodeReadable(eventsRes.body);return new Promise((resolve,reject)=>{let stream=readable.pipe(import_jsonlines.default.parse()),poller;mode==="deploy"&&(poller=function startPoller(){return setTimeout(async()=>{try{if((await getDeployment(client,scope.contextName,urlOrDeploymentId)).readyState==="READY"){stream.end(),finish();return}poller=startPoller()}catch(err2){stream.end(),finish(err2)}},5e3)}());let finishCalled=!1;function finish(err2){finishCalled||(finishCalled=!0,clearTimeout(poller),err2?reject(err2):resolve())}let latestLogDate=0,onData=data=>{if(data.type==="alias-assigned"){data.deploymentId===urlOrDeploymentId&&onAliasAssigned?.(data);return}let{event,payload,date}=data;event==="state"&&payload.value==="READY"?mode==="deploy"&&(stream.end(),finish()):(latestLogDate=Math.max(latestLogDate,date),onEvent(data))},onErrorCalled=!1,onError=err2=>{if(finishCalled||onErrorCalled)return;if(err2.name==="AbortError"){finish();return}onErrorCalled=!0,o++;let errorMessage=`Deployment event stream error: ${err2.message}`;if(!findOpts.follow){log(errorMessage);return}debug(errorMessage),clearTimeout(poller),stream.destroy(err2);let retryFindOpts={...findOpts,since:latestLogDate},retryTimeout=setTimeout(()=>{abortController?.signal.removeEventListener("abort",onAbort),!abortController?.signal.aborted&&printEvents(client,urlOrDeploymentId,{mode,onEvent,onAliasAssigned,quiet,findOpts:retryFindOpts},abortController).then(resolve,reject)},2e3);onAliasAssigned&&retryTimeout.unref?.();let onAbort=()=>{clearTimeout(retryTimeout),finish()};abortController?.signal.addEventListener("abort",onAbort,{once:!0})};stream.on("end",finish),stream.on("data",onData),stream.on("error",onError),readable.on("error",onError)})}let err=new Error(`Deployment events status ${eventsRes.status}`);if(eventsRes.status<500)bail(err);else throw err}catch(err){if(err instanceof Error&&err.name==="AbortError")return;throw err}},{retries:4,unref:!!onAliasAssigned,onRetry:err=>{!quiet&&o&&(process.stdout.write((0,import_ansi_escapes.eraseLines)(o+1)),o=0),log(`Deployment events polling error: ${err.message}`)}})}var events_default=printEvents;export{events_default};
|
|
@@ -4,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{toGranularityMsFromDuration}from"./chunk-
|
|
7
|
+
import{toGranularityMsFromDuration}from"./chunk-R3QHEJL6.js";var VALUE_ALIAS="value",COUNT_ALIAS="__seriesCount";function alignTimeRangeToStep(startTime,endTime,stepMs){return{startTime:new Date(Math.floor(startTime.getTime()/stepMs)*stepMs),endTime:new Date(Math.ceil(endTime.getTime()/stepMs)*stepMs)}}function alignTimeRangeToGranularity(startTime,endTime,granularity){return alignTimeRangeToStep(startTime,endTime,toGranularityMsFromDuration(granularity))}function createCanonicalMetricsRequest(options){let metrics={[VALUE_ALIAS]:options.selection},rankMetric=VALUE_ALIAS;return options.groupBy.length>0&&options.orderBy==="count"&&options.selection.aggregation!=="count"&&(metrics[COUNT_ALIAS]={metric:options.metric,aggregation:"count"},rankMetric=COUNT_ALIAS),{scope:{ownerId:options.scope.ownerId,...options.scope.type==="project"?{projectIds:options.scope.projectIds}:{}},timeRange:{start:options.startTime.toISOString(),end:options.endTime.toISOString()},bucketSeconds:toGranularityMsFromDuration(options.granularity)/1e3,...options.groupBy.length>0?{groupBy:options.groupBy}:{},...options.filter?{filter:options.filter}:{},metrics,outputs:[VALUE_ALIAS],...options.groupBy.length>0?{seriesSelection:{limit:options.limit,mode:"exact",rankBy:[{metric:rankMetric,direction:options.orderDirection??"desc"}]}}:{}}}function canonicalResponseToMetricsResponse(response,rollupColumn,orderBy,orderDirection){let toRow=point=>({...point.dimensions,[rollupColumn]:point.values[VALUE_ALIAS]??null});return{...response.series?{data:response.series.map(point=>({timestamp:point.timestamp,...toRow(point)}))}:{},summary:response.summary.map(toRow),statistics:{rowsRead:response.meta.statistics.rowsRead,bytesRead:response.meta.statistics.bytesRead,dbTimeSeconds:response.meta.statistics.databaseElapsedMs/1e3,engineTimeSeconds:response.meta.statistics.elapsedMs/1e3,queryTable:[...new Set(response.meta.sources.map(source=>source.id))].sort().join(",")},...orderBy?{orderBy}:{},...orderDirection?{orderDirection}:{}}}var FILTER_DEPRECATION_WARNING="OData support in --query is deprecated and will be removed soon. KQL will be the only supported filter syntax.";function usesODataSyntax(filters){return filters?.some(filter=>{let unquoted=filter.replace(/"(?:\\.|[^"\\])*"|'(?:''|[^'])*'/g,"");return/\s(?:eq|ne|gt|ge|lt|le|in)\s/i.test(unquoted)||/\b(?:contains|startswith|endswith)\s*\(/i.test(unquoted)})??!1}export{alignTimeRangeToStep,alignTimeRangeToGranularity,createCanonicalMetricsRequest,canonicalResponseToMetricsResponse,FILTER_DEPRECATION_WARNING,usesODataSyntax};
|
|
@@ -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{js_yaml_default}from"./chunk-V6Y6UK6B.js";import{require_minimatch}from"./chunk-CTMTO2W4.js";import{remoteText}from"./chunk-SQ62IODX.js";import{__toESM}from"./chunk-BZENIQ7N.js";import{existsSync,readFileSync}from"node:fs";import{homedir}from"node:os";import{dirname,join,parse,relative}from"node:path";var import_minimatch=__toESM(require_minimatch(),1);function findWorkspaceRootCandidates(startDir){let{root}=parse(startDir),candidates=[],dir=startDir;for(let i=0;i<64;i++){let type=workspaceTypeOf(dir);if(type&&candidates.unshift({dir,type}),dir===root)break;let parent=dirname(dir);if(parent===dir)break;dir=parent}return candidates}function workspaceTypeOf(dir){if(existsSync(join(dir,"pnpm-workspace.yaml")))return"pnpm";let pkgPath=join(dir,"package.json");if(existsSync(pkgPath))try{let pkg=JSON.parse(readFileSync(pkgPath,"utf8")),{workspaces}=pkg;if(Array.isArray(workspaces)&&workspaces.length>0||workspaces&&typeof workspaces=="object"&&Array.isArray(workspaces.packages)&&workspaces.packages.length>0)return"npm"}catch{}return null}function readWorkspacePatterns(candidate){try{if(candidate.type==="pnpm"){let packages2=js_yaml_default.load(readFileSync(join(candidate.dir,"pnpm-workspace.yaml"),"utf8"))?.packages;return Array.isArray(packages2)?packages2.filter(p=>typeof p=="string"):null}let pkg=JSON.parse(readFileSync(join(candidate.dir,"package.json"),"utf8")),{workspaces}=pkg,packages=Array.isArray(workspaces)?workspaces:workspaces?.packages;return Array.isArray(packages)?packages.filter(p=>typeof p=="string"):null}catch{return null}}function workspaceClaims(candidate,memberDir){let rel=normalizeRelative(relative(candidate.dir,memberDir));if(rel==="")return!1;let patterns=readWorkspacePatterns(candidate);if(!patterns||patterns.length===0)return!1;let positives=[],negatives=[];for(let pattern of patterns)pattern.startsWith("!")?negatives.push(normalizeRelative(pattern.slice(1))):positives.push(normalizeRelative(pattern));let matches=pattern=>(0,import_minimatch.default)(rel,pattern,{dot:!1});return!positives.some(matches)||negatives.some(matches)?!1:existsSync(join(memberDir,"package.json"))}function resolvePerDirectoryLinkRoot(anchorDir,rootDirectorySetting){let repoRoot=anchorDir;for(let candidate of findWorkspaceRootCandidates(anchorDir))if(workspaceClaims(candidate,anchorDir)){repoRoot=candidate.dir;break}let linkLocation=normalizeRelative(relative(repoRoot,anchorDir)),setting=typeof rootDirectorySetting=="string"?normalizeRelative(rootDirectorySetting):"";if(linkLocation===""){let gitRoot=setting!==""&&!existsSync(join(anchorDir,setting))?findEnclosingGitRoot(anchorDir):null;return gitRoot&&normalizeRelative(relative(gitRoot,anchorDir))===setting?{repoRoot,resolvedRootDirectory:"",ignoreRootDirectory:!0,advisory:`Ignoring the Root Directory ${quote(setting,setting)} of the project linked in "${anchorDir}": it is the path of this directory in its Git repository, and ${quote(join(anchorDir,setting),setting)} does not exist. The build uses the linked directory. To correct this, link the project from "${gitRoot}", or clear the Root Directory in the Project Settings and pull them again.`}:{repoRoot,resolvedRootDirectory:""}}return setting===""?{repoRoot,resolvedRootDirectory:linkLocation}:existsSync(join(anchorDir,setting))?{repoRoot,resolvedRootDirectory:normalizeRelative(relative(repoRoot,join(anchorDir,setting)))}:{repoRoot,resolvedRootDirectory:linkLocation,advisory:`Ignoring "rootDirectory" setting ${quote(setting,setting)} for the project linked in "${anchorDir}": ${quote(join(anchorDir,setting),setting)} does not exist, so the build will use the linked directory "${linkLocation}" instead. Remove the "rootDirectory" setting, or configure it at the repository root.`}}function findEnclosingGitRoot(dir){if(existsSync(join(dir,".git")))return null;let home=homedir(),current=dir;for(let i=0;i<64;i++){let parent=dirname(current);if(parent===current||parent===home)return null;if(existsSync(join(parent,".git")))return parent;current=parent}return null}var PLAIN_PATH=/^[\p{L}\p{N}_.@-]+(?:\/[\p{L}\p{N}_.@-]+)*\/?$/u;function isPlainPath(value){return typeof value=="string"&&value.length<=256&&PLAIN_PATH.test(value)}function quote(text,setting){return isPlainPath(setting)?`"${text}"`:remoteText(JSON.stringify(text))}function normalizeRelative(p){let normalized=p.replace(/\\/g,"/").replace(/^\.\//,"").replace(/^\/+/,"").replace(/\/+$/,"");return normalized==="."?"":normalized}export{findWorkspaceRootCandidates,resolvePerDirectoryLinkRoot,isPlainPath};
|
|
@@ -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{isAPIError}from"./chunk-
|
|
7
|
+
import{isAPIError}from"./chunk-QFE3RPMA.js";var NO_SERVER_MESSAGE="Response Error";function apiServerMessage(error){let message=isAPIError(error)?error.serverMessage:void 0;return message&&message!==NO_SERVER_MESSAGE?message:void 0}export{apiServerMessage};
|
|
@@ -0,0 +1,31 @@
|
|
|
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{isDeploying}from"./chunk-ZFRNVIHI.js";import{events_default}from"./chunk-VMRFCU6F.js";import{PROJECT_EXPIRATION_TIMEFRAMES}from"./chunk-LDDXXDN5.js";import{sanitizeForTerminal}from"./chunk-5RMIM4S2.js";import{suggestNextCommands}from"./chunk-7WDSOKOY.js";import{getOrCreateDeploymentProtectionToken,isProtected}from"./chunk-572VGS6P.js";import{progress}from"./chunk-U56NHYAH.js";import{getProductionUrl}from"./chunk-VT6RIZJH.js";import{isPublicSuffix}from"./chunk-KG526MHL.js";import{deprecatedArchiveSplitTgz}from"./chunk-Z3YQZSU4.js";import{TelemetryClient}from"./chunk-EYRBV6RM.js";import{isJSONObject,printIndications,require_dist as require_dist2,require_dist2 as require_dist3,sleep,startTrace}from"./chunk-4Z6R5KHZ.js";import{printAlignedLabel}from"./chunk-M2Q2DUHO.js";import{getProjectByNameOrId}from"./chunk-3AFEVHHY.js";import{ua_default}from"./chunk-MTZYPCZ7.js";import{fetch,getFetchDispatcher}from"./chunk-MY4MONOH.js";import{require_ms}from"./chunk-MXTC4ZAQ.js";import{responseError}from"./chunk-HMJR6RVF.js";import{AGENT_REASON,withGlobalFlags}from"./chunk-CSNP5RIM.js";import{require_types}from"./chunk-AW33SRYY.js";import{APIError,BuildError,ProjectNotFound,require_bytes}from"./chunk-QFE3RPMA.js";import{emoji,eraseLines,link_default,output_manager_default,prependEmoji}from"./chunk-RYSO5U3E.js";import{require_dist}from"./chunk-MCYG7CCE.js";import{quoteArg}from"./chunk-DORCX7UB.js";import{require_source}from"./chunk-NB2WLB3J.js";import{require_strip_ansi}from"./chunk-BS32OUOC.js";import{__toESM}from"./chunk-BZENIQ7N.js";var import_chalk=__toESM(require_source(),1);function printPrebuiltFilePathMapIgnoreWarning(message,telemetry){telemetry.trackPrebuiltFilePathMapWouldFailClosed(),printPrebuiltWarning(message)}function printPrebuiltWarning(message){let[first="",...rest]=message.split(`
|
|
8
|
+
`),lines=[`${import_chalk.default.yellow("!")} ${first}`,...rest.map(line=>line&&!/^\s/.test(line)?` ${line}`:line)];output_manager_default.print(`${lines.join(`
|
|
9
|
+
`)}
|
|
10
|
+
`)}var PREBUILT_REFERENCE_SKIPPED="PREBUILT_REFERENCE_SKIPPED";function reportSkippedPrebuiltReferences(message){return printPrebuiltWarning(message),{reason:AGENT_REASON.PREBUILT_REFERENCE_SKIPPED,message}}var import_types=__toESM(require_types(),1);var DeployTelemetryClient=class extends TelemetryClient{trackCliArgumentProjectPath(projectPaths){projectPaths&&this.trackCliArgument({arg:"project-path",value:this.redactedValue})}trackCliOptionArchive(format){if(format){let allowedFormat=[...import_types.VALID_ARCHIVE_FORMATS,deprecatedArchiveSplitTgz].includes(format)?format:this.redactedValue;this.trackCliOption({option:"archive",value:allowedFormat})}}trackCliFlagTurbo(turbo){turbo&&this.trackCliFlag("turbo")}trackCliOptionBuildEnv(buildEnv){buildEnv&&buildEnv.length>0&&this.trackCliOption({option:"build-env",value:this.redactedValue})}trackCliOptionEnv(env){env&&env.length>0&&this.trackCliOption({option:"env",value:this.redactedValue})}trackCliOptionMeta(meta){meta&&meta.length>0&&this.trackCliOption({option:"meta",value:this.redactedValue})}trackCliOptionDeployment(deployment){deployment&&this.trackCliOption({option:"deployment",value:this.redactedValue})}trackCliOptionId(id){id&&this.trackCliOption({option:"id",value:this.redactedValue})}trackCliOptionName(name){name&&this.trackCliOption({option:"name",value:this.redactedValue})}trackCliOptionRegions(regions){regions&&this.trackCliOption({option:"regions",value:this.redactedValue})}trackCliOptionDeleteProjectAfter(duration){duration&&this.trackCliOption({option:"delete-project-after",value:Object.hasOwn(PROJECT_EXPIRATION_TIMEFRAMES,duration)?duration:this.redactedValue})}trackCliOptionTarget(target){target&&this.trackCliOption({option:"target",value:this.redactedTargetName(target)})}trackCliOptionEnvironment(environment){environment&&this.trackCliOption({option:"environment",value:this.redactedTargetName(environment)})}trackCliFlagConfirm(flag){flag&&this.trackCliFlag("confirm")}trackCliFlagForce(flag){flag&&this.trackCliFlag("force")}trackCliFlagLogs(flag){flag&&this.trackCliFlag("logs")}trackCliFlagNoLogs(flag){flag&&this.trackCliFlag("no-logs")}trackCliFlagGuidance(flag){flag&&this.trackCliFlag("guidance")}trackCliFlagNoClipboard(flag){flag&&this.trackCliFlag("no-clipboard")}trackCliFlagNoWait(flag){flag&&this.trackCliFlag("no-wait")}trackCliFlagDry(flag){flag&&this.trackCliFlag("dry")}trackCliFlagCreateIfMissing(flag){flag&&this.trackCliFlag("create-if-missing")}trackCliFlagVerify(flag){flag&&this.trackCliFlag("verify")}trackCliFlagPrebuilt(flag){flag&&this.trackCliFlag("prebuilt")}trackCliSubcommandInit(actual){this.trackCliSubcommand({subcommand:"init",value:actual})}trackCliSubcommandContinue(actual){this.trackCliSubcommand({subcommand:"continue",value:actual})}trackCliSubcommandDescribe(actual){this.trackCliSubcommand({subcommand:"describe",value:actual})}trackCliFlagProd(flag){flag&&this.trackCliFlag("prod")}trackCliFlagTemporary(flag){flag&&this.trackCliFlag("temporary")}trackTargetEnvironment(target){super.trackTargetEnvironment(target==="production"?"production":"preview")}trackCliFlagPublic(flag){flag&&this.trackCliFlag("public")}trackCliFlagSkipDomain(flag){flag&&this.trackCliFlag("skip-domain")}trackCliFlagWithCache(flag){flag&&this.trackCliFlag("with-cache")}trackCliFlagYes(flag){flag&&this.trackCliFlag("yes")}trackCliFlagJson(flag){flag&&this.trackCliFlag("json")}trackCliOptionFormat(format){format&&this.trackCliOption({option:"format",value:format})}trackDeploymentId(id){id&&this.trackCommandOutput({key:"deployment-id",value:id})}trackPrebuiltFilePathMapWouldFailClosed(){this.trackCommandOutput({key:"prebuilt-filepathmap-would-fail-closed",value:"TRUE"})}};function getDeploymentEnvironment(deployment){return deployment.customEnvironment?.slug?deployment.customEnvironment.slug:deployment.target==="production"?"production":"preview"}function getDeploymentEnvironmentLabel(deployment){let environment=getDeploymentEnvironment(deployment);return environment==="production"?"Production":environment==="preview"?"Preview":environment}var import_client=__toESM(require_dist3(),1),import_error_utils=__toESM(require_dist(),1),import_bytes=__toESM(require_bytes(),1),import_chalk2=__toESM(require_source(),1);function printInspectUrl(inspectorUrl){inspectorUrl&&printAlignedLabel("Inspect",import_chalk2.default.cyan(inspectorUrl))}function processDeployment(options){return options.now._client.withTrace("vc.cli.deploy",trace=>deploy(options,trace))}async function deploy({org,projectName,isSettingUpProject,archive,skipAutoDetectionConfirmation,noWait,withFullLogs,anonymous,manual,jsonOutput,linkedProject,lookUpLinkedProject,firstDeployment,gitMetadata,...args},trace){let{now,path,requestBody,force,withCache,quiet,prebuilt,vercelOutputDir,rootDirectory,bulkRedirectsPath,servePageAtRoot}=args,client=now._client,telemetry=new DeployTelemetryClient({opts:{store:client.telemetryEventStore}}),aliasedRowWillPrint=!noWait&&requestBody.autoAssignCustomDomains!==!1,{env={}}=requestBody;await client.ensureAuthorized();let token=now._token;if(!token)throw new Error("Missing authentication token");let aliasAssignedController=new AbortController,onAliasAssigned=event=>{aliasAssignedController.abort(event)},clientOptions={teamId:now.currentTeam??void 0,apiUrl:now._apiUrl,token,getAuthHeaders:client.getAuthHeaders,debug:output_manager_default.isDebugEnabled(),userAgent:ua_default,path,force,withCache,prebuilt,vercelOutputDir,rootDirectory,skipAutoDetectionConfirmation,archive,dispatcher:getFetchDispatcher(),projectName,bulkRedirectsPath,manual,servePageAtRoot,aliasAssignedSignal:aliasAssignedController.signal,firstDeployment},deployingSpinnerVal=isSettingUpProject?"Setting up project":`Deploying ${import_chalk2.default.bold(org.slug?`${org.slug}/${projectName}`:projectName)}`;output_manager_default.spinner(deployingSpinnerVal,0);let indications=[],prebuiltFilePathMapWarning,cliWarnings=now.cliWarnings??=[],attachPrebuiltWarnings=payload=>(prebuiltFilePathMapWarning&&Object.assign(payload,{warning:prebuiltFilePathMapWarning}),Object.assign(payload,{cliWarnings}),payload),abortController;function stopSpinner(){abortController?.abort(),output_manager_default.stopSpinner()}let linkedProjectLookup=lookUpLinkedProject?.().then(project2=>({project:project2}),error=>({error})),rollingRelease=linkedProject?.rollingRelease,project=linkedProjectLookup?void 0:linkedProject,latestLogMessage="";async function resolveProject(){if(!linkedProjectLookup)return getProjectByNameOrId(client,projectName);let result=await linkedProjectLookup;if("error"in result)throw result.error;return result.project}let step,startStep=(name,attrs)=>{step?.span.stop(),step=name?startTrace(trace,name,attrs):void 0};try{startStep("vc.cli.deploy.collect_files");let deploymentOptions=Promise.resolve(gitMetadata).then(gitMetadata2=>({...requestBody,...gitMetadata2===void 0?{}:{gitMetadata:gitMetadata2}}));for await(let event of(0,import_client.createDeployment)(clientOptions,deploymentOptions)){if(event.type==="warning"&&"code"in event&&event.code==="PREBUILT_FILEPATHMAP_IGNORED"){let message=String(event.payload);prebuiltFilePathMapWarning={code:"PREBUILT_FILEPATHMAP_IGNORED",message},printPrebuiltFilePathMapIgnoreWarning(message,telemetry),client.stderr.isTTY&&output_manager_default.spinner(deployingSpinnerVal,0);continue}if(event.type==="warning"&&"code"in event&&event.code===PREBUILT_REFERENCE_SKIPPED){let message=String(event.payload);cliWarnings.some(warning=>warning.message===message)||(cliWarnings.push(reportSkippedPrebuiltReferences(message)),client.stderr.isTTY&&output_manager_default.spinner(deployingSpinnerVal,0));continue}if((event.type==="error"||event.type==="canceled"||event.type==="blocked"||event.type==="checks-v2-failed"||event.type==="checks-conclusion-failed")&&(trace?.span.setAttributes({error:"true"}),step?.span.setAttributes({error:"true"})),["tip","notice","warning"].includes(event.type)&&indications.push(event),event.type==="hashes-calculated"&&startStep("vc.cli.deploy.upload"),event.type==="ready"&&startStep("vc.cli.deploy.alias"),event.type==="file-count"){let{total,missing,uploads}=event.payload;output_manager_default.debug(`Total files ${total.size}, ${missing.length} changed`);let missingSize=missing.map(sha=>{let file=total.get(sha);return file?.data?.length??file?.size??0}).reduce((a,b)=>a+b,0),totalSizeHuman=import_bytes.default.format(missingSize,{decimalPlaces:1});step?.span.setAttributes({file_count:String(missing.length),byte_count:String(missingSize)});let nextStep=0,stepSize=now._client.stderr.isTTY?0:.25,updateProgress=()=>{let uploadedBytes=uploads.reduce((acc,e)=>acc+e.bytesUploaded,0),bar=progress(uploadedBytes,missingSize);if(!bar)output_manager_default.spinner(deployingSpinnerVal,0);else{let uploadedHuman=import_bytes.default.format(uploadedBytes,{decimalPlaces:1,fixedDecimals:!0});uploadedBytes/missingSize>=nextStep&&(output_manager_default.spinner(`Uploading ${import_chalk2.default.reset(`[${bar}] (${uploadedHuman}/${totalSizeHuman})`)}`,0),nextStep+=stepSize)}};uploads.forEach(e=>e.on("progress",updateProgress)),updateProgress()}if(event.type==="file-uploaded"){let{file}=event.payload;output_manager_default.debug(`Uploaded: ${file.names.join(" ")} (${(0,import_bytes.default)(file.data?.length??file.size??0)})`)}if(event.type==="created"){startStep("vc.cli.deploy.build");let deployment=event.payload;if(now.url=deployment.url,stopSpinner(),!anonymous){printInspectUrl(deployment.inspectorUrl);let isProdDeployment=deployment.target==="production",previewUrl=`https://${deployment.url}`,isBlocked=deployment.readyState==="BLOCKED";!isBlocked&&isProdDeployment&&requestBody.target!=="production"&&indications.push({type:"notice",payload:"This is your project\u2019s first deployment, so it was assigned to production. Future deployments will be preview deployments unless you use --prod.",link:"https://vercel.com/docs/deployments/environments"}),isBlocked||(printAlignedLabel(getDeploymentEnvironmentLabel(deployment),import_chalk2.default.cyan(previewUrl),isProdDeployment&&!aliasedRowWillPrint?{gutter:"\u25B2"}:{}),!jsonOutput&&(quiet||process.env.FORCE_TTY==="1")&&process.stdout.write(`https://${event.payload.url}`))}if(noWait)return deployment.indications=indications,attachPrebuiltWarnings(deployment);if(latestLogMessage=deployment.readyState==="QUEUED"?"Queued\u2026":"Building\u2026",withFullLogs&&!anonymous){let{displayBuildLogs}=await import("./logs-3DPLX3CB.js"),promise;({abortController,promise}=displayBuildLogs(client,deployment,!0,onAliasAssigned)),promise.catch(error=>output_manager_default.warn(`Failed to read build logs: ${error}`))}else if(!anonymous){let{parseLogLines}=await import("./logs-3DPLX3CB.js");abortController=new AbortController,events_default(client,deployment.id,{mode:"logs",onAliasAssigned,onEvent:event2=>{if(!event2.created)return;let message=parseLogLines(event2)[0];message&&(latestLogMessage=message,output_manager_default.spinner(latestLogMessage,0))},quiet:!1,findOpts:{direction:"forward",follow:!0}},abortController).catch(error=>output_manager_default.warn(`Failed to read build logs: ${error}`))}output_manager_default.spinner(latestLogMessage,0)}if(event.type==="building"&&!withFullLogs&&output_manager_default.spinner(latestLogMessage||"Building\u2026",0),event.type==="canceled"||event.type==="blocked")return stopSpinner(),attachPrebuiltWarnings(event.payload);if(project===void 0&&(!linkedProjectLookup||event.type==="ready")&&(project=await resolveProject(),rollingRelease=project?.rollingRelease),event.type==="ready"&&rollingRelease)return output_manager_default.spinner("Releasing\u2026",0),stopSpinner(),event.payload.indications=indications,attachPrebuiltWarnings(event.payload);if(event.type==="ready"&&!withFullLogs){let v1ChecksPending=event.payload.checksState&&event.payload.checksState!=="completed",v2ChecksPending=event.payload.checks?.["deployment-alias"]?.state==="pending";if(output_manager_default.stopSpinner(),!anonymous&&!output_manager_default.spinnersHidden){process.stderr.write(eraseLines(2));let isProdDeployment=event.payload.target==="production",previewUrl=`https://${event.payload.url}`;printAlignedLabel(getDeploymentEnvironmentLabel(event.payload),import_chalk2.default.cyan(previewUrl),isProdDeployment&&!aliasedRowWillPrint?{gutter:"\u25B2"}:{})}v1ChecksPending||v2ChecksPending?output_manager_default.spinner("Running Checks\u2026",0):output_manager_default.spinner("Completing\u2026",0)}if(event.type==="checks-running"&&!withFullLogs&&output_manager_default.spinner("Running Checks\u2026",0),event.type==="checks-conclusion-failed"||event.type==="checks-v2-failed")return stopSpinner(),attachPrebuiltWarnings(event.payload);if(event.type==="error"){if(stopSpinner(),!archive){let maybeError=handleErrorSolvableWithArchive(event.payload);if(maybeError)throw maybeError}let error=await now.handleDeploymentError(event.payload,{env});if(error.code==="missing_project_settings"||error.code==="forbidden")return error;throw error}if(event.type==="alias-assigned"){if(stopSpinner(),event.payload.target==="production"&&event.payload.alias&&event.payload.alias.length>0){let prodUrl=`https://${event.payload.alias[0]}`;anonymous&&output_manager_default.print(`
|
|
11
|
+
`),printAlignedLabel(anonymous?"Temporary":"Aliased",import_chalk2.default.cyan(prodUrl),{gutter:"\u25B2"}),anonymous&&!jsonOutput&&(quiet||process.env.FORCE_TTY==="1")&&process.stdout.write(prodUrl)}return event.payload.indications=indications,attachPrebuiltWarnings(event.payload)}}}catch(err){throw step?.span.setAttributes({error:"true"}),stopSpinner(),err}finally{startStep()}}var archiveSuggestionText="Try using `--archive=tgz` to limit the amount of files you upload.",UploadErrorMissingArchive=class extends Error{constructor(){super(...arguments);this.link="https://vercel.com/docs/cli/deploy#archive"}};function handleErrorSolvableWithArchive(error){if((0,import_error_utils.isErrorLike)(error)){let isUploadRateLimit="errorName"in error&&typeof error.errorName=="string"&&error.errorName.startsWith("api-upload-"),isTooManyFilesLimit="code"in error&&error.code==="too_many_files",isEntityTooLarge=/entity too large|payload too large/i.test(error.message);if(isUploadRateLimit||isTooManyFilesLimit||isEntityTooLarge)return new UploadErrorMissingArchive(`${error.message}
|
|
12
|
+
${archiveSuggestionText}`)}}var import_async_retry=__toESM(require_dist2(),1),import_ms=__toESM(require_ms(),1);import qs from"querystring";import{parse as parseUrl}from"url";var import_bytes2=__toESM(require_bytes(),1),import_chalk3=__toESM(require_source(),1);var Now=class{constructor({client,url=null,currentTeam=null,forceNew=!1,withCache=!1}){this.cliWarnings=[];this.url=url,this._client=client,this._forceNew=forceNew,this._withCache=withCache,this._onRetry=this._onRetry.bind(this),this.currentTeam=currentTeam}get _apiUrl(){return this._client.apiUrl}get _token(){return this._client.authConfig.token}async create(path,{nowConfig={},name,project,prebuilt=!1,anonymous=!1,vercelOutputDir,rootDirectory,meta,gitMetadata,regions,quiet=!1,env,build,buildMachine,forceNew=!1,withCache=!1,target=null,projectSettings,skipAutoDetectionConfirmation,noWait,withFullLogs,autoAssignCustomDomains,agentName,manual,jsonOutput=!1,servePageAtRoot,linkedProject,lookUpLinkedProject,firstDeployment},org,isSettingUpProject,archive){let requestBody={...nowConfig,env,build,buildMachine,name,project,meta,regions,target:target||void 0,projectSettings,source:"cli",actor:agentName,autoAssignCustomDomains};delete requestBody.scope,delete requestBody.github,delete requestBody.public;let deployment=await processDeployment({now:this,path,requestBody,gitMetadata,quiet,force:forceNew,withCache,org,projectName:name,isSettingUpProject,archive,skipAutoDetectionConfirmation,prebuilt,anonymous,vercelOutputDir,rootDirectory,noWait,withFullLogs,bulkRedirectsPath:nowConfig.bulkRedirectsPath,manual,jsonOutput,servePageAtRoot,linkedProject,lookUpLinkedProject,firstDeployment});if(deployment&&deployment.warnings){let sizeExceeded=0,{log,warn}=output_manager_default;deployment.warnings.forEach(warning=>{if(warning.reason==="size_limit_exceeded"){let{sha,limit}=warning;warn(`Skipping file ${sha} (size exceeded ${(0,import_bytes2.default)(limit)})`),sizeExceeded++}else warning.reason==="node_version_not_found"&&warn(`Requested node version ${warning.wanted} is not available`)}),sizeExceeded>0&&(warn(`${sizeExceeded} of the files exceeded the limit for your plan.`),log(`Please upgrade your plan here: ${import_chalk3.default.cyan("https://vercel.com/account/plan")}`))}return deployment}async handleDeploymentError(error,{env}){if(error.status===429){if(error.code==="builds_rate_limited"){let err2=new Error(error.message);return err2.status=error.status,err2.code=error.code,err2.retryAfterMs="never",err2.ctaLabel=error.ctaLabel,err2.ctaUrl=error.ctaUrl,err2.action=error.action,err2.link=error.link,err2}let msg="You have been creating deployments at a very fast pace. ";if(error.limit&&error.limit.reset){let{reset}=error.limit,difference=reset-Date.now();msg+=`Please retry in ${(0,import_ms.default)(difference,{long:!0})}.`}else msg+="Please slow down.";let err=Object.create(APIError.prototype);return err.message=msg,err.status=error.status,err.retryAfterMs="never",err}if(error.status===400&&error.code==="cert_missing")return responseError(error,null,error);if(error.status===400&&error.code==="missing_files")return this._missing=error.missing||[],error;if(error.status===404&&error.code==="not_found")return error;if(error.status>=400&&error.status<500){let err=new Error,{code}=error;if(code==="env_value_invalid_type"){let{key}=error;err.message=`The env key ${key} has an invalid type: ${typeof env[key]}. Please supply a String or a Number (https://err.sh/vercel/env-value-invalid-type)`}else Object.assign(err,error);return err}return error.id&&error.id.startsWith("bld_")?new BuildError({message:"Build failed",meta:{entrypoint:error.entrypoint}}):error.errorCode==="BUILD_FAILED"||error.errorCode==="UNEXPECTED_ERROR"||error.errorCode?.includes("BUILD_UTILS_SPAWN_")?new BuildError({message:error.errorMessage,meta:{}}):new Error(error.message||error.errorMessage)}retry(fn,{retries=3,maxTimeout=1/0}={}){return(0,import_async_retry.default)(fn,{retries,maxTimeout,onRetry:this._onRetry})}_onRetry(err){output_manager_default.debug(`Retrying: ${err}
|
|
13
|
+
${err.stack}`)}async _fetch(_url,opts={}){if(opts.useCurrentTeam!==!1&&this.currentTeam){let parsedUrl=parseUrl(_url,!0),query=parsedUrl.query;query.teamId=this.currentTeam,_url=`${parsedUrl.pathname}?${qs.stringify(query)}`,delete opts.useCurrentTeam}opts.headers=new globalThis.Headers(opts.headers),opts.headers.set("accept","application/json"),opts.headers.set("user-agent",ua_default);let body;isJSONObject(opts.body)?(body=JSON.stringify(opts.body),opts.headers.set("content-type","application/json; charset=utf8")):body=opts.body;let headers=opts.headers,res=await this._client.fetchWithAuthHeaders(opts.method||"GET",`${this._apiUrl}${_url}`,body,authHeaders=>{let attemptHeaders=new globalThis.Headers(headers);for(let[name,value]of Object.entries(authHeaders))attemptHeaders.set(name,value);return output_manager_default.time(`${opts.method||"GET"} ${this._apiUrl}${_url} ${opts.body||""}`,fetch(`${this._apiUrl}${_url}`,{...opts,headers:attemptHeaders,body}))});return printIndications(res),res}async fetch(url,opts={}){return this.retry(async bail=>{opts.json!==!1&&opts.body&&typeof opts.body=="object"&&(opts=Object.assign({},opts,{body:JSON.stringify(opts.body),headers:Object.assign({},opts.headers,{"Content-Type":"application/json"})}));let res=await this._fetch(url,opts);if(res.ok)return opts.json===!1?res:res.headers.get("content-type")?res.headers.get("content-type")?.includes("application/json")?res.json():res:null;let err=await responseError(res);if(typeof err.retryAfterMs=="number"){let randomSkewMs=3e4*Math.random();throw await sleep(err.retryAfterMs+randomSkewMs),err}if(res.status>=400&&res.status<500)return bail(err);throw err},opts.retry)}};var import_bytes3=__toESM(require_bytes(),1),import_strip_ansi=__toESM(require_strip_ansi(),1),import_error_utils2=__toESM(require_dist(),1);var TIMEOUT_MS=3e4,PROTECTION_CHECK_TIMEOUT_MS=1e4,MAX_REDIRECTS=5,REDIRECT_STATUSES=new Set([301,302,303,307,308]),TITLE_SEARCH_LENGTH=64*1024,TITLE_MAX_LENGTH=200;async function verifyDeployment(client,url,{project,org,protectionEnabled,deploymentUrl}){let verifiedUrl=url;try{let res=await request(url);if((res.status===401||res.status===403)&&protectionEnabled&&project&&org&&deploymentUrl&&isPlatformUrl(deploymentUrl)&&await areBlockedByDeploymentProtection([url,deploymentUrl])){let bypassToken=await getBypassToken(client,project,org);bypassToken&&(await res.body?.cancel(),verifiedUrl=deploymentUrl,res=await request(deploymentUrl,bypassToken))}return await readVerification(verifiedUrl,res)}catch(err){let cause=err instanceof Error&&err.cause instanceof Error?`: ${err.cause.message}`:"";return{url:verifiedUrl,ok:!1,statusCode:null,size:null,title:null,error:`${(0,import_error_utils2.errorToString)(err)}${cause}`}}}function isPlatformUrl(url){let{protocol,hostname}=new URL(url);return protocol==="https:"&&isPublicSuffix(hostname)}async function areBlockedByDeploymentProtection(urls){let origins=new Set(urls.map(url=>new URL(url).origin));for(let origin of origins)if(!await isBlockedByDeploymentProtection(origin))return!1;return!0}async function isBlockedByDeploymentProtection(origin){try{return await isProtected(origin,void 0,PROTECTION_CHECK_TIMEOUT_MS)}catch(err){return output_manager_default.debug(`Could not check Deployment Protection: ${err}`),!1}}async function request(url,bypassToken){let deploymentOrigin=new URL(url).origin,signal=AbortSignal.timeout(TIMEOUT_MS),current=url;for(let redirects=0;;redirects++){let headers={};bypassToken&&new URL(current).origin===deploymentOrigin&&(headers["x-vercel-protection-bypass"]=bypassToken);let res=await fetch(current,{headers,redirect:"manual",signal}),location=res.headers.get("location");if(!REDIRECT_STATUSES.has(res.status)||!location)return res;if(await res.body?.cancel(),redirects===MAX_REDIRECTS)throw new Error(`Too many redirects (more than ${MAX_REDIRECTS})`);current=new URL(location,current).href}}async function getBypassToken(client,{id,accountId},org){try{let project=await getProjectByNameOrId(client,id,accountId);return project instanceof ProjectNotFound?null:await getOrCreateDeploymentProtectionToken(client,{status:"linked",project,org})}catch(err){return output_manager_default.debug(`Could not get a protection bypass secret: ${err}`),null}}async function readVerification(url,res){let isHtml=(res.headers.get("content-type")??"").includes("text/html"),decoder=new TextDecoder,size=0,head="",reader=res.body?.getReader();if(reader)for(;;){let{done,value}=await reader.read();if(done)break;size+=value.byteLength,isHtml&&head.length<TITLE_SEARCH_LENGTH&&(head+=decoder.decode(value,{stream:!0}))}return{url,ok:res.ok,statusCode:res.status,size,title:isHtml?parseTitle(head):null,error:null}}function formatVerificationSummary({statusCode,size,title}){return[statusCode,size===null?null:import_bytes3.default.format(size,{decimalPlaces:1,unitSeparator:" "}),title===null?null:`"${title}"`].filter(part=>part!==null).join(", ")}function formatVerificationFailure({url,statusCode,error}){return statusCode===null?`Couldn't load ${url}: ${error}`:`${url} returned ${statusCode}.`}var HTML_ENTITIES={"&":"&","<":"<",">":">",""":'"',"'":"'","'":"'"};function parseTitle(html){let match=/<title[^>]*>([\s\S]*?)<\/title>/i.exec(html);if(!match)return null;let title=Array.from((0,import_strip_ansi.default)(match[1]).replace(/&(?:amp|lt|gt|quot|#39|#x27);/g,entity=>HTML_ENTITIES[entity])).map(char=>char<" "||char==="\x7F"?" ":char).join("").replace(/\s+/g," ").trim();return title?title.slice(0,TITLE_MAX_LENGTH):null}var import_chalk4=__toESM(require_source(),1),import_strip_ansi2=__toESM(require_strip_ansi(),1);function bareDuration(stamp){return(0,import_strip_ansi2.default)(stamp).replace(/^\[|\]$/g,"")}async function printDeploymentStatus(client,{readyState,alias,aliasAssigned,aliasError,indications,aliasWarning,url,target},deployStamp,noWait,guidanceMode,isInit,gitConnectCommand,protectionNames,verification){indications=indications||[];let isStillBuilding=!1;if(noWait&&isDeploying(readyState)){isStillBuilding=!0;let message=isInit?"Deployment is awaiting continuation\u2026":"Note: Deployment is still processing\u2026";output_manager_default.print(prependEmoji(message,emoji("notice"))+`
|
|
14
|
+
`)}if(!isStillBuilding&&readyState!=="READY")return output_manager_default.error("Your deployment failed. Please retry later. More: https://err.sh/vercel/deployment-error"),1;if(!isStillBuilding&&readyState==="READY"){let duration=bareDuration(deployStamp());output_manager_default.print(`
|
|
15
|
+
${import_chalk4.default.green("\u2713")} ${import_chalk4.default.bold("Ready")} ${import_chalk4.default.dim(`in ${duration}`)}
|
|
16
|
+
`)}verification?.ok?output_manager_default.print(`${import_chalk4.default.green("\u2713")} ${import_chalk4.default.bold("Verified")} ${verification.url} ${import_chalk4.default.dim(`(${formatVerificationSummary(verification)})`)}
|
|
17
|
+
`):verification&&output_manager_default.error(formatVerificationFailure(verification)),protectionNames?.length&&output_manager_default.print(`
|
|
18
|
+
${import_chalk4.default.yellow("!")} Deployment Protection is on for this project (${protectionNames.join(", ")}). Use ${import_chalk4.default.cyan("`vercel curl`")} to access it.
|
|
19
|
+
`),aliasError&&output_manager_default.warn(`Failed to assign aliases${aliasError.message?`: ${aliasError.message}`:""}`),aliasWarning?.message&&indications.push({type:"warning",payload:aliasWarning.message,link:aliasWarning.link,action:aliasWarning.action});let newline=`
|
|
20
|
+
`;for(let indication of indications){let message=prependEmoji(import_chalk4.default.dim(indication.payload),emoji(indication.type))+newline,link="";indication.link&&(link=import_chalk4.default.dim(`${indication.action||"Learn More"}: ${link_default(indication.link)}`)+newline),output_manager_default.print(message+link)}if(gitConnectCommand||guidanceMode){output_manager_default.print(`
|
|
21
|
+
`);let nextCommands=[];if(gitConnectCommand&&nextCommands.push({description:"Automatically deploy changes on every push by connecting Git",command:gitConnectCommand}),readyState==="READY"){let productionUrl=getProductionUrl({target,alias,aliasAssigned,aliasError});verification?.ok||nextCommands.push({description:productionUrl?"Check the production response":"Check the deployment response",command:withGlobalFlags(client,`curl ${productionUrl??`https://${url}`}`,{preserveProject:!0})}),nextCommands.push({description:"View build logs",command:withGlobalFlags(client,`inspect ${url} --logs`,{preserveProject:!0})},{description:"Create a new deployment from the same source",command:withGlobalFlags(client,`redeploy ${url}`,{preserveProject:!0})}),target!=="production"&&nextCommands.push({description:"Deploy the current project to production",command:withGlobalFlags(client,"deploy --prod",{preserveProject:!0})})}else nextCommands.push({description:"Check deployment status",command:withGlobalFlags(client,`inspect ${url}`,{preserveProject:!0})});suggestNextCommands(nextCommands)}return verification&&!verification.ok?1:0}var import_chalk5=__toESM(require_source(),1);var BLOCKED_DEPLOYMENT_REASON="deployment_blocked";function isBlockedDeployment(deployment){return deployment?.readyState==="BLOCKED"}function getBlockKind(deployment){switch(deployment.seatBlock?.blockCode){case"TEAM_ACCESS_REQUIRED":return"team_access";case"COMMIT_AUTHOR_REQUIRED":return"commit_author";default:return"other"}}function getTeamMembersUrl(teamSlug){return teamSlug?`https://vercel.com/${encodeURIComponent(teamSlug)}/~/settings/members`:null}function getBlockedDeploymentInviteCommand(client){let teamId=client.config.currentTeam;return withGlobalFlags(client,`teams invite <EMAIL>${teamId?` --scope ${quoteArg(teamId)}`:""}`)}function getBlockedDeploymentMessage(deployment){let causes={team_access:"The commit author doesn't have access to this team.",commit_author:"Vercel couldn't match the commit author to a Vercel account.",other:"Deployment was blocked."};return`Can't build deployment ${deployment.id}. ${causes[getBlockKind(deployment)]}`}function getBlockedDeploymentDetails(deployment,teamSlug){return{readyStateReason:deployment.readyStateReason??null,errorLink:deployment.errorLink??null,blockCode:deployment.seatBlock?.blockCode??null,teamMembersUrl:getBlockKind(deployment)==="team_access"?getTeamMembersUrl(teamSlug):null}}function getBlockedDeploymentNext(client,deployment,retryCommand){let next=[],kind=getBlockKind(deployment);if(kind==="team_access"?next.push({command:getBlockedDeploymentInviteCommand(client),when:"Only after the user approves: invite the commit author to the team"}):kind==="other"&&next.push({command:withGlobalFlags(client,`inspect ${deployment.id}`),when:"See why the deployment was blocked"}),retryCommand){let when={team_access:"Deploy again once the commit author has team access, or from a commit by a team member",commit_author:"Deploy again once the commit author's Git account is connected to a Vercel account with access to this team, or from a commit by a team member",other:"Deploy again once the cause of the block is resolved"};next.push({command:retryCommand,when:when[kind]})}return next}function stripControlCharacters(text){return sanitizeForTerminal(text).replace(/[\u0000-\u001f\u007f]+/g," ")}function printBlockedDeployment(client,deployment,teamSlug){let{readyStateReason,errorLink,blockCode,teamMembersUrl}=getBlockedDeploymentDetails(deployment,teamSlug);output_manager_default.print(`
|
|
22
|
+
`),output_manager_default.error(getBlockedDeploymentMessage(deployment));let rows=[];readyStateReason&&rows.push(["Vercel",stripControlCharacters(readyStateReason).trim()]),blockCode&&rows.push(["Block Code",stripControlCharacters(blockCode)]),errorLink&&rows.push(["Docs",stripControlCharacters(errorLink)]),rows.push(["Deployment ID",deployment.id]);let width=Math.max(...rows.map(([label])=>label.length))+2;for(let[label,value]of rows)output_manager_default.print(` ${import_chalk5.default.dim(label.padEnd(width))}${value}
|
|
23
|
+
`);let kind=getBlockKind(deployment);kind==="team_access"?(output_manager_default.print(`
|
|
24
|
+
A blocked deployment can't be redeployed. Give the commit author access, then deploy again:
|
|
25
|
+
`),teamMembersUrl&&output_manager_default.print(` ${teamMembersUrl}
|
|
26
|
+
`),output_manager_default.print(` ${getBlockedDeploymentInviteCommand(client)}
|
|
27
|
+
`)):kind==="commit_author"?output_manager_default.print(`
|
|
28
|
+
A blocked deployment can't be redeployed. Connect the commit author's Git account to a Vercel account with access to this team, then deploy again, or deploy from a commit by a team member.
|
|
29
|
+
`):output_manager_default.print(`
|
|
30
|
+
A blocked deployment can't be redeployed. Resolve the cause above${errorLink?" (see Docs)":""}, then deploy again.
|
|
31
|
+
`)}export{printPrebuiltFilePathMapIgnoreWarning,PREBUILT_REFERENCE_SKIPPED,reportSkippedPrebuiltReferences,DeployTelemetryClient,getDeploymentEnvironment,getDeploymentEnvironmentLabel,UploadErrorMissingArchive,Now,verifyDeployment,formatVerificationFailure,printDeploymentStatus,BLOCKED_DEPLOYMENT_REASON,isBlockedDeployment,getBlockKind,getTeamMembersUrl,getBlockedDeploymentMessage,getBlockedDeploymentDetails,getBlockedDeploymentNext,stripControlCharacters,printBlockedDeployment};
|
|
@@ -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{emitAlertsScopeError,resolveAlertsScope}from"./chunk-
|
|
7
|
+
import{emitAlertsScopeError,resolveAlertsScope}from"./chunk-QG5UBKDA.js";import{handleValidationError,validateAllProjectMutualExclusivity}from"./chunk-OOPF73RV.js";import{getScope}from"./chunk-VIOIR6II.js";import{getProjectByNameOrId}from"./chunk-3AFEVHHY.js";import{AGENT_REASON,buildCommandWithGlobalFlags,outputAgentError}from"./chunk-CSNP5RIM.js";import{ProjectNotFound,isAPIError}from"./chunk-QFE3RPMA.js";async function resolveRulesTeam(client,jsonOutput){let scope;try{scope=await getScope(client,{resolveLocalScope:!0})}catch(err){if(isAPIError(err)&&(err.status===403||err.status===404))return emitAlertsScopeError(client,jsonOutput,err.code||"API_ERROR",err.serverMessage||`API error (${err.status}).`,{reason:AGENT_REASON.MISSING_SCOPE,hint:"The selected team could not be loaded. Select a team you can access, or pass --scope <team-slug>.",next:[{command:buildCommandWithGlobalFlags(client.argv,"teams switch"),when:"Select a team"},{command:buildCommandWithGlobalFlags(client.argv,"whoami"),when:"Inspect the current scope"}]});throw err}let{team}=scope;return team?{teamId:team.id}:emitAlertsScopeError(client,jsonOutput,"NO_TEAM","No team context found. Run `vercel switch` to select a team, use `--scope <team>`, or link a team project.",{reason:AGENT_REASON.MISSING_SCOPE,hint:"Monitors belong to a team. Select the team before retrying.",next:[{command:buildCommandWithGlobalFlags(client.argv,"teams switch"),when:"Select a team"},{command:buildCommandWithGlobalFlags(client.argv,"whoami"),when:"Inspect the current scope"}]})}async function resolveRulesProject(client,projectNameOrId,jsonOutput,command){let teamScope=await resolveRulesTeam(client,jsonOutput);if(typeof teamScope=="number")return teamScope;try{let project=await getProjectByNameOrId(client,projectNameOrId,teamScope.teamId);return project instanceof ProjectNotFound?emitAlertsScopeError(client,jsonOutput,"PROJECT_NOT_FOUND",`Project "${projectNameOrId}" was not found in the selected team.`,{reason:AGENT_REASON.NOT_FOUND,next:[{command:buildCommandWithGlobalFlags(client.argv,`${command} --project <name_or_id>`),when:"Retry with a valid project"}]}):{...teamScope,projectId:project.id,projectName:project.name}}catch(error){if(!isAPIError(error))throw error;return emitAlertsScopeError(client,jsonOutput,error.code||"API_ERROR",error.serverMessage||`API error (${error.status}).`,{reason:error.status===401?"not_authorized":error.status===403?"forbidden":AGENT_REASON.API_ERROR})}}async function parseRulesFlagsAndScope(client,flags,jsonOutput,command="monitors ls"){let mutual=validateAllProjectMutualExclusivity(flags["--all"],flags["--project"]);if(!mutual.valid)return outputAgentError(client,{status:"error",reason:AGENT_REASON.INVALID_ARGUMENTS,message:mutual.message,next:[{command:buildCommandWithGlobalFlags(client.argv,"monitors --help"),when:"Use either `--project` or `--all`, not both"}]},2),handleValidationError(mutual,jsonOutput,client);if(flags["--all"])return resolveRulesTeam(client,jsonOutput);if(flags["--project"])return resolveRulesProject(client,flags["--project"],jsonOutput,command);let linkedScope=await resolveAlertsScope(client,{jsonOutput,command});if(typeof linkedScope=="number")return linkedScope;let teamScope=await resolveRulesTeam(client,jsonOutput);return typeof teamScope=="number"?teamScope:linkedScope.teamId===teamScope.teamId?linkedScope:teamScope}export{resolveRulesTeam,resolveRulesProject,parseRulesFlagsAndScope};
|
|
@@ -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{resolveProjectContext}from"./chunk-
|
|
7
|
+
import{resolveProjectContext}from"./chunk-JV3YIOCO.js";import{parseArguments}from"./chunk-INIZJZ3O.js";import{AGENT_REASON,AGENT_STATUS,outputAgentError}from"./chunk-CSNP5RIM.js";import{getCommandName,getCommandNamePlain}from"./chunk-B4KA3ZH2.js";import{output_manager_default}from"./chunk-RYSO5U3E.js";import{getFlagsSpecification,getGlobalFlagsFromArgs}from"./chunk-DORCX7UB.js";function parseSubcommandArguments(argv,command){let flagsSpecification=getFlagsSpecification(command.options);return parseArguments(argv,flagsSpecification)}function validateRequiredArguments(args,required){for(let i=0;i<required.length;i++)if(!args[i])return`Missing required argument: ${required[i]}`;return null}async function requireProjectContext(client,command,projectName){let link=await resolveProjectContext({client,projectNameOrId:projectName,allowOwnerLookupFallback:!0});if(link.status==="error")return link.exitCode;if(link.status==="not_linked"){if(client.nonInteractive)if(command==="redirects"){let linkCmd=getCommandNamePlain("link");outputAgentError(client,{status:AGENT_STATUS.ERROR,reason:AGENT_REASON.NOT_LINKED,message:`Your codebase isn't linked to a project on Vercel. Run ${linkCmd} to begin.`,next:[{command:linkCmd}]},1)}else{let flags=getGlobalFlagsFromArgs(client.argv.slice(2)),cmd=getCommandNamePlain(`link ${flags.join(" ")}`.trim());return outputAgentError(client,{status:AGENT_STATUS.ERROR,reason:AGENT_REASON.NOT_LINKED,userActionRequired:!0,message:`Your codebase is not linked to a Vercel project. Run link first, then retry ${command} commands.`,next:[{command:cmd,when:"to link this directory to a project"}]},1),1}return output_manager_default.error(`Your codebase isn't linked to a project on Vercel. Run ${getCommandName("link")} to begin.`),1}return client.config.currentTeam=link.org.type==="team"?link.org.id:void 0,link}export{parseSubcommandArguments,validateRequiredArguments,requireProjectContext};
|
|
@@ -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{outputError}from"./chunk-
|
|
7
|
+
import{outputError}from"./chunk-OOPF73RV.js";import{require_execa}from"./chunk-M32HBBPK.js";import{getContextName}from"./chunk-VIOIR6II.js";import{getLinkedProject,getOrgSlug,isOwnerLookupUnavailableError}from"./chunk-4Z6R5KHZ.js";import{getProjectByNameOrId}from"./chunk-3AFEVHHY.js";import{require_lib}from"./chunk-LUX4PBJL.js";import{require_ms}from"./chunk-MXTC4ZAQ.js";import{AGENT_REASON,buildCommandWithGlobalFlags,getTeamByIdOrSlug,outputAgentError}from"./chunk-CSNP5RIM.js";import{validateJsonOutput}from"./chunk-KA2KG3SY.js";import{ProjectNotFound,isAPIError,require_bytes}from"./chunk-QFE3RPMA.js";import{packageName}from"./chunk-B4KA3ZH2.js";import{output_manager_default}from"./chunk-RYSO5U3E.js";import{__toESM}from"./chunk-BZENIQ7N.js";function emitVcrScopeError(client,jsonOutput,code,message,agent){return outputAgentError(client,{status:"error",reason:agent.reason,message,hint:agent.hint,next:agent.next},1),outputError(client,jsonOutput,code,message)}async function resolveVcrScope(client,opts){if(opts.project){let contextName=await getContextName(client,{allowOwnerLookupFallback:!0}),teamId=client.config.currentTeam;if(!teamId){let msg="No team context found. Run `vercel switch` to select a team, or use `vercel link` in a project directory.";return emitVcrScopeError(client,opts.jsonOutput,"NO_TEAM",msg,{reason:AGENT_REASON.MISSING_SCOPE,hint:"Select a team scope before using --project with vcr.",next:[{command:buildCommandWithGlobalFlags(client.argv,"whoami"),when:"See current user and team"},{command:buildCommandWithGlobalFlags(client.argv,"teams switch"),when:"Switch to a team that owns the project"}]})}let teamSlug;try{teamSlug=(await getTeamByIdOrSlug(client,teamId)).slug}catch(err){if(!isOwnerLookupUnavailableError(err))throw err;teamSlug=contextName}let projectResult;try{projectResult=await getProjectByNameOrId(client,opts.project,teamId)}catch(err){if(isAPIError(err)){let msg=err.serverMessage||(err.status===403?`You do not have permission to access project "${opts.project}" in team "${teamSlug}".`:`API error (${err.status}).`),reason=err.status===401?"not_authorized":err.status===403?"forbidden":AGENT_REASON.API_ERROR;return emitVcrScopeError(client,opts.jsonOutput,err.code||"API_ERROR",msg,{reason,next:[{command:buildCommandWithGlobalFlags(client.argv,"vcr ls --project <name_or_id>"),when:"Retry with a project you can access (replace <name_or_id>)"}]})}throw err}if(projectResult instanceof ProjectNotFound){let msg=`Project "${opts.project}" was not found in team "${teamSlug}".`;return emitVcrScopeError(client,opts.jsonOutput,"PROJECT_NOT_FOUND",msg,{reason:AGENT_REASON.NOT_FOUND,next:[{command:buildCommandWithGlobalFlags(client.argv,"project ls"),when:"List projects in the current team to pick a name"}]})}return{teamId,teamSlug,projectId:projectResult.id,projectName:projectResult.name}}let linkedProject=await getLinkedProject(client,{allowOwnerLookupFallback:!0,allowProjectLookupFallback:!0,fallbackRequiresProjectName:!0});if(linkedProject.status==="error")return linkedProject.exitCode;if(linkedProject.status==="not_linked"){let msg="No linked project found. Run `vercel link` to link a project, or pass --project <name>.";return emitVcrScopeError(client,opts.jsonOutput,"NOT_LINKED",msg,{reason:AGENT_REASON.NOT_LINKED,hint:"Agents should pass --project when no .vercel link exists in --cwd.",next:[{command:buildCommandWithGlobalFlags(client.argv,"link"),when:"Link this directory to a Vercel project"},{command:buildCommandWithGlobalFlags(client.argv,"vcr ls --project <name_or_id>"),when:"List repositories for a project without linking (replace <name_or_id>)"}]})}return{teamId:linkedProject.org.id,teamSlug:await getOrgSlug(client,linkedProject.org),projectId:linkedProject.project.id,projectName:linkedProject.project.name}}var import_ms=__toESM(require_ms(),1),import_bytes=__toESM(require_bytes(),1);function formatBytes(size){return typeof size!="number"||Number.isNaN(size)?"-":import_bytes.default.format(size,{decimalPlaces:1})??"-"}function formatRelativeTime(iso){let time=new Date(iso).getTime();return Number.isNaN(time)?"-":`${(0,import_ms.default)(Date.now()-time)} ago`}function formatDigest(digest){return digest?digest.replace(/^sha256:/,"").slice(0,12):"-"}function formatImageStatus(status){switch(status){case"ready":return"Ready";case"preparing":return"Preparing";case"unoptimized":return"Ready (unoptimized)";default:return"-"}}var VCR_REGISTRY="vcr.vercel.com";function formatImageReference(teamSlug,projectName,repositoryName,digest){return digest?`${VCR_REGISTRY}/${teamSlug}/${projectName}/${repositoryName}@${digest}`:"-"}function formatTagReference(teamSlug,projectName,repositoryName,tag){return tag?`${VCR_REGISTRY}/${teamSlug}/${projectName}/${repositoryName}:${tag}`:"-"}function validateVcrJsonOutput(client,flags){let fr=validateJsonOutput(flags);return fr.valid?{jsonOutput:fr.jsonOutput}:(outputAgentError(client,{status:"error",reason:AGENT_REASON.INVALID_ARGUMENTS,message:fr.error},2),output_manager_default.error(fr.error),2)}function validateVcrChoice(client,flag,value,choices,jsonOutput){if(value===void 0||choices.includes(value))return;let message=`Invalid value for ${flag}: "${value}". Must be one of: ${choices.join(", ")}.`;return outputAgentError(client,{status:"error",reason:AGENT_REASON.INVALID_ARGUMENTS,message},2),outputError(client,jsonOutput,"INVALID_ARGUMENTS",message)}function requireVcrRepository(client,repository,jsonOutput,usage){if(!repository)return outputAgentError(client,{status:"error",reason:AGENT_REASON.MISSING_ARGUMENTS,message:`Missing repository. Example: ${packageName} ${usage}`,next:[{command:buildCommandWithGlobalFlags(client.argv,"vcr ls"),when:"List repositories to pick a name or id"}]},2),outputError(client,jsonOutput,"MISSING_ARGUMENTS",`Usage: \`vercel ${usage}\``)}function requireVcrRepositoryAndTag(client,repository,tag,jsonOutput,usage){if(!(repository&&tag))return outputAgentError(client,{status:"error",reason:AGENT_REASON.MISSING_ARGUMENTS,message:`Missing arguments. Example: ${packageName} ${usage}`,next:[{command:buildCommandWithGlobalFlags(client.argv,"vcr tag ls <repository>"),when:"List tags to pick a tag (replace <repository>)"}]},2),outputError(client,jsonOutput,"MISSING_ARGUMENTS",`Usage: \`vercel ${usage}\``)}function requireVcrRepositoryAndImageId(client,repository,imageId,jsonOutput,usage){if(!(repository&&imageId))return outputAgentError(client,{status:"error",reason:AGENT_REASON.MISSING_ARGUMENTS,message:`Missing arguments. Example: ${packageName} ${usage}`,next:[{command:buildCommandWithGlobalFlags(client.argv,"vcr image ls <repository>"),when:"List images to pick an image id (replace <repository>)"}]},2),outputError(client,jsonOutput,"MISSING_ARGUMENTS",`Usage: \`vercel ${usage}\``)}var import_which=__toESM(require_lib(),1),import_execa=__toESM(require_execa(),1);var VCR_ENGINES=["docker","podman","buildah"],VCR_LOGIN_USERNAME="oidc";function resolveRegistry(){return process.env.VERCEL_VCR_REGISTRY||VCR_REGISTRY}var REGISTRY_HOST_PATTERN=/^([a-z0-9-]+(?:\.[a-z0-9-]+)*)(?::\d{1,5})?$/iu;function isSupportedRegistry(registry){let host=REGISTRY_HOST_PATTERN.exec(registry)?.[1]?.toLowerCase();return host?host==="vercel.com"||host.endsWith(".vercel.com"):!1}function isEngineInstalled(engine){return import_which.default.sync(engine,{nothrow:!0})!==null}function splitPassthrough(argv){let idx=argv.indexOf("--");return idx===-1?{own:argv.slice(2),passthrough:[]}:{own:argv.slice(2,idx),passthrough:argv.slice(idx+1)}}async function isBuildxAvailable(){let result=await(0,import_execa.default)("docker",["buildx","version"],{reject:!1,stdio:"ignore"});return result instanceof Error?!1:result.exitCode===0}function pushCompressionArgs(engine){return engine==="docker"?[]:["--compression-format","zstd","--compression-level","3"]}var AUTH_FAILURE=/\b(?:unauthorized|denied|forbidden)\b\s*:|authentication required|access to the resource is denied|\b(?:401 unauthorized|403 forbidden)\b/i,CREDENTIAL_STORE_CONFLICT=/already exists in the keychain|errSecDuplicateItem/i;function stderrTail(stderr){return stderr.trim().split(`
|
|
8
8
|
`).slice(-5).join(`
|
|
9
|
-
`)}async function engineLogin(engine,registry,token){let result=await(0,import_execa.default)(engine,["login",registry,"--username",VCR_LOGIN_USERNAME,"--password-stdin"],{input:token,reject:!1});return result instanceof Error&&typeof result.exitCode!="number"?{exitCode:1,stderr:result.message}:{exitCode:typeof result.exitCode=="number"?result.exitCode:1,stderr:result.stderr??""}}async function engineLogout(engine,registry){await(0,import_execa.default)(engine,["logout",registry],{reject:!1,stdio:"ignore"})}async function runEngine(engine,args,opts){if(opts.captureStderr){let subprocess=(0,import_execa.default)(engine,args,{cwd:opts.cwd,stdio:["inherit","inherit","pipe"],reject:!1});subprocess.stderr?.pipe(process.stderr);let result2=await subprocess;return result2 instanceof Error&&typeof result2.exitCode!="number"?{exitCode:1,stderr:result2
|
|
10
|
-
${tail}`:""}`;return outputAgentError(client,{status:"error",reason:"command_failed",message},1),outputError(client,!1,"COMMAND_FAILED",message)}function reportEnginePushFailure(client,engine,verb,result){if(AUTH_FAILURE.test(result.stderr)){let message=`Push to ${resolveRegistry()} was rejected. Your registry credentials may be missing or expired.`;return outputAgentError(client,{status:"error",reason:"not_authorized",message,next:[{command:buildCommandWithGlobalFlags(client.argv,`vcr login ${engine}`),when:"Refresh registry credentials (valid ~12 hours)"}]},1),outputError(client,!1,"NOT_AUTHORIZED",message)}return reportEngineCommandFailure(client,engine,verb,result)}function emitVcrArgParseError(client,err,recoverTemplate){let msg=err instanceof Error?err.message:String(err),projectFlagMissingArg=msg.includes("--project")&&msg.includes("requires argument");outputAgentError(client,{status:"error",reason:AGENT_REASON.INVALID_ARGUMENTS,message:projectFlagMissingArg?"`--project` requires a project name or id (for example `--project my-app`).":msg,next:[{command:buildCommandWithGlobalFlags(client.argv,recoverTemplate),when:projectFlagMissingArg?"Re-run with a project name or id (replace placeholder)":"See valid usage"}]},2)}export{resolveVcrScope,formatBytes,formatRelativeTime,formatDigest,formatImageStatus,formatImageReference,formatTagReference,validateVcrJsonOutput,validateVcrChoice,requireVcrRepository,requireVcrRepositoryAndTag,requireVcrRepositoryAndImageId,VCR_ENGINES,VCR_LOGIN_USERNAME,resolveRegistry,isEngineInstalled,splitPassthrough,isBuildxAvailable,pushCompressionArgs,AUTH_FAILURE,CREDENTIAL_STORE_CONFLICT,stderrTail,engineLogin,engineLogout,runEngine,handleVcrApiError,reportEngineCommandFailure,reportEnginePushFailure,emitVcrArgParseError};
|
|
9
|
+
`)}async function engineLogin(engine,registry,token){let result=await(0,import_execa.default)(engine,["login",registry,"--username",VCR_LOGIN_USERNAME,"--password-stdin"],{input:token,reject:!1});return result instanceof Error&&typeof result.exitCode!="number"?{exitCode:1,stderr:result.message}:{exitCode:typeof result.exitCode=="number"?result.exitCode:1,stderr:result.stderr??""}}async function engineLogout(engine,registry){await(0,import_execa.default)(engine,["logout",registry],{reject:!1,stdio:"ignore"})}function engineFailureMessage(result){return result.signal?`terminated by ${result.signal}`:`failed to start (${typeof result.code=="string"?result.code:"unknown error"})`}async function runEngine(engine,args,opts){if(opts.captureStderr){let subprocess=(0,import_execa.default)(engine,args,{cwd:opts.cwd,stdio:["inherit","inherit","pipe"],reject:!1});subprocess.stderr?.pipe(process.stderr);let result2=await subprocess;return result2 instanceof Error&&typeof result2.exitCode!="number"?{exitCode:1,stderr:engineFailureMessage(result2)}:{exitCode:typeof result2.exitCode=="number"?result2.exitCode:1,stderr:result2.stderr??""}}let result=await(0,import_execa.default)(engine,args,{cwd:opts.cwd,stdio:"inherit",reject:!1});return result instanceof Error&&typeof result.exitCode!="number"?{exitCode:1,stderr:engineFailureMessage(result)}:{exitCode:typeof result.exitCode=="number"?result.exitCode:1,stderr:""}}var NOT_AUTHORIZED_MESSAGE="You do not have access to the container registry in this scope. Ensure your role can manage the project, or pass --token and --scope.",NOT_AUTHORIZED_HINT="Confirm team scope with whoami; use --scope <team-slug> if the repository lives under another team.",genericMessage=err=>err.serverMessage||`API error (${err.status}).`,STATUS_INFO={401:{reason:"not_authorized",message:()=>NOT_AUTHORIZED_MESSAGE,hint:NOT_AUTHORIZED_HINT,suggestWhoami:!0},403:{reason:"forbidden",message:()=>NOT_AUTHORIZED_MESSAGE,hint:NOT_AUTHORIZED_HINT,suggestWhoami:!0},404:{reason:AGENT_REASON.NOT_FOUND,message:genericMessage},409:{reason:"conflict",message:genericMessage},429:{reason:"rate_limited",message:genericMessage}};function resolveStatusInfo(err){return STATUS_INFO[err.status]?STATUS_INFO[err.status]:err.status>=500?{reason:AGENT_REASON.API_ERROR,message:()=>`The container registry endpoint failed (${err.status}). Re-run with --debug and share the x-vercel-id from the failed request.`}:{reason:AGENT_REASON.API_ERROR,message:genericMessage}}function handleVcrApiError(client,err,jsonOutput,opts={}){let info=resolveStatusInfo(err),message=info.message(err),next=[];return info.suggestWhoami&&next.push({command:buildCommandWithGlobalFlags(client.argv,"whoami"),when:"See current user and team"}),opts.retry&&next.push(opts.retry),outputAgentError(client,{status:"error",reason:info.reason,message,...info.hint?{hint:info.hint}:{},...next.length>0?{next}:{}},1),outputError(client,jsonOutput,err.code||"API_ERROR",message)}function reportEngineCommandFailure(client,engine,verb,result){let tail=stderrTail(result.stderr),message=`\`${engine} ${verb}\` failed (exit code ${result.exitCode}).${tail?`
|
|
10
|
+
${tail}`:""}`;return outputAgentError(client,{status:"error",reason:"command_failed",message},1),outputError(client,!1,"COMMAND_FAILED",message)}function reportEnginePushFailure(client,engine,verb,result){if(AUTH_FAILURE.test(result.stderr)){let message=`Push to ${resolveRegistry()} was rejected. Your registry credentials may be missing or expired.`;return outputAgentError(client,{status:"error",reason:"not_authorized",message,next:[{command:buildCommandWithGlobalFlags(client.argv,`vcr login ${engine}`),when:"Refresh registry credentials (valid ~12 hours)"}]},1),outputError(client,!1,"NOT_AUTHORIZED",message)}return reportEngineCommandFailure(client,engine,verb,result)}function emitVcrArgParseError(client,err,recoverTemplate){let msg=err instanceof Error?err.message:String(err),projectFlagMissingArg=msg.includes("--project")&&msg.includes("requires argument");outputAgentError(client,{status:"error",reason:AGENT_REASON.INVALID_ARGUMENTS,message:projectFlagMissingArg?"`--project` requires a project name or id (for example `--project my-app`).":msg,next:[{command:buildCommandWithGlobalFlags(client.argv,recoverTemplate),when:projectFlagMissingArg?"Re-run with a project name or id (replace placeholder)":"See valid usage"}]},2)}export{resolveVcrScope,formatBytes,formatRelativeTime,formatDigest,formatImageStatus,formatImageReference,formatTagReference,validateVcrJsonOutput,validateVcrChoice,requireVcrRepository,requireVcrRepositoryAndTag,requireVcrRepositoryAndImageId,VCR_ENGINES,VCR_LOGIN_USERNAME,resolveRegistry,isSupportedRegistry,isEngineInstalled,splitPassthrough,isBuildxAvailable,pushCompressionArgs,AUTH_FAILURE,CREDENTIAL_STORE_CONFLICT,stderrTail,engineLogin,engineLogout,runEngine,handleVcrApiError,reportEngineCommandFailure,reportEnginePushFailure,emitVcrArgParseError};
|