@vercel/cli-support 66.6.0-snapshot-62deef8da0a0 → 67.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/chunks/add-PULH4LLG.js +8 -0
- package/dist/chunks/add-SWKAAP2V.js +8 -0
- package/dist/chunks/add-U3ILHW5T.js +8 -0
- package/dist/chunks/{alerts-72Q42HNT.js → alerts-GXY7LZWX.js} +1 -1
- package/dist/chunks/build-UNR3B22D.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-2BI5SSHB.js +7 -0
- 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-7AVHDJSP.js → chunk-2KXLL3DX.js} +4 -4
- package/dist/chunks/{chunk-DZ77BIEV.js → chunk-2OMMOXFL.js} +1 -1
- package/dist/chunks/{chunk-6PDKIOAO.js → chunk-2TJQY7PH.js} +1 -1
- package/dist/chunks/{chunk-DJZBJC2A.js → chunk-3AFEVHHY.js} +1 -1
- package/dist/chunks/{chunk-YOAQNRBN.js → chunk-3C6BMAGB.js} +2 -2
- 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-QZJOKECY.js → chunk-4GYDXPNC.js} +2 -2
- package/dist/chunks/{chunk-H2KNSYPR.js → chunk-55FPQ5MM.js} +1 -1
- package/dist/chunks/{chunk-RBW62SOU.js → chunk-55WV4RRW.js} +1 -1
- package/dist/chunks/{chunk-5KSBRQI2.js → chunk-5727HGA6.js} +1 -1
- package/dist/chunks/{chunk-D2TVI7KK.js → chunk-5CFLIIMP.js} +4 -4
- package/dist/chunks/chunk-5DHOC47O.js +13 -0
- package/dist/chunks/{chunk-CSCUVSJM.js → chunk-5GKIRBHJ.js} +1 -1
- package/dist/chunks/{chunk-YLLFLPNA.js → chunk-5QMXW5KS.js} +1 -1
- package/dist/chunks/{chunk-UUBPAYTG.js → chunk-5RMIM4S2.js} +1 -1
- package/dist/chunks/{chunk-NLK7NGVP.js → chunk-5ZL2RRO3.js} +1 -1
- package/dist/chunks/chunk-67GZ5REA.js +7 -0
- package/dist/chunks/chunk-6D44CCJA.js +23 -0
- package/dist/chunks/{chunk-VHSAI6FS.js → chunk-6FEMU5YF.js} +1 -1
- 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-SYVWRGFQ.js → chunk-6UWBCYEW.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-742MHFPK.js +31 -0
- package/dist/chunks/chunk-7HQZRU25.js +10 -0
- package/dist/chunks/{chunk-QZKRVE44.js → chunk-7J7SOUFS.js} +1 -1
- package/dist/chunks/{chunk-XECELSF5.js → chunk-7JU5RJ3H.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-OISNKAC6.js → chunk-7W4GWVUP.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-6GE4V7MW.js → chunk-ANT2GN7F.js} +2 -2
- package/dist/chunks/{chunk-YEUIG3JC.js → chunk-AZVSMIPP.js} +1 -1
- package/dist/chunks/{chunk-Y77DXGGN.js → chunk-B6YVE4WJ.js} +1 -1
- package/dist/chunks/chunk-B7IB5CTS.js +7 -0
- package/dist/chunks/{chunk-XLYO5QNG.js → chunk-B7IUFV5P.js} +2 -2
- 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-FOFX7LHS.js → chunk-C3KNFAVK.js} +1 -1
- package/dist/chunks/{chunk-OE26EQSH.js → chunk-C7TNFTTK.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-CO5LKOMH.js +7 -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-LM3YPF3K.js → chunk-DOOBZO4W.js} +1 -1
- package/dist/chunks/chunk-DORCX7UB.js +7 -0
- 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-N6JHFCWC.js → chunk-EM4OX47A.js} +1 -1
- package/dist/chunks/{chunk-VPSR2O55.js → chunk-EOUT7E7U.js} +3 -3
- package/dist/chunks/chunk-EYRBV6RM.js +25 -0
- package/dist/chunks/{chunk-AKOYIH3A.js → chunk-F4KY2TOK.js} +1 -1
- package/dist/chunks/{chunk-TSNRTRIM.js → chunk-FB37TFVF.js} +1 -1
- package/dist/chunks/chunk-FFHV7BRT.js +7 -0
- package/dist/chunks/{chunk-ACN6DBTC.js → chunk-FHUDTYY7.js} +1 -1
- package/dist/chunks/{chunk-T7GKQYWA.js → chunk-FXLZM6Q7.js} +1 -1
- package/dist/chunks/{chunk-RVIJRFVD.js → chunk-G24EKATW.js} +1 -1
- package/dist/chunks/{chunk-3A3GU62R.js → chunk-G2CDEA2E.js} +1 -1
- package/dist/chunks/chunk-GQXKF3PR.js +7 -0
- package/dist/chunks/{chunk-KSGN5OCV.js → chunk-GT3JH2FU.js} +1 -1
- package/dist/chunks/{chunk-FFN3EGSF.js → chunk-GWYQXFBP.js} +1 -1
- package/dist/chunks/{chunk-BCAI7MED.js → chunk-H75TYZ4K.js} +1 -1
- package/dist/chunks/{chunk-W2L24GM7.js → chunk-HT445TYO.js} +1 -1
- package/dist/chunks/{chunk-DOMBKOLJ.js → chunk-HZRU7VS6.js} +1 -1
- package/dist/chunks/{chunk-TOTTVS5P.js → chunk-ID663OJ7.js} +1 -1
- package/dist/chunks/{chunk-ZA5O22ZY.js → chunk-IGJBSAFY.js} +1 -1
- package/dist/chunks/{chunk-CINNNQDJ.js → chunk-INIZJZ3O.js} +1 -1
- package/dist/chunks/chunk-IPORRCTF.js +12 -0
- package/dist/chunks/{chunk-LNZEYUEC.js → chunk-IVZNPSHU.js} +1 -1
- package/dist/chunks/{chunk-6CJFPT4F.js → chunk-JDDPCL3K.js} +1 -1
- package/dist/chunks/{chunk-R33HJGYA.js → chunk-JYGOOFIW.js} +1 -1
- package/dist/chunks/{chunk-FEJD7MRH.js → chunk-KA2KG3SY.js} +1 -1
- package/dist/chunks/{chunk-JBYROCAC.js → chunk-KC5BRLPR.js} +1 -1
- package/dist/chunks/{table-W6LOHWWF.js → chunk-KG526MHL.js} +1 -1
- package/dist/chunks/{chunk-QGHAD5A5.js → chunk-KHDRQS6I.js} +1 -1
- package/dist/chunks/{chunk-L5PIUIUM.js → chunk-KJUFWRZP.js} +1 -1
- package/dist/chunks/chunk-L3DJOYTO.js +11 -0
- package/dist/chunks/{chunk-54FY6GJ5.js → chunk-L46V6VL3.js} +1 -1
- package/dist/chunks/{chunk-ANIA2G6F.js → chunk-LDDXXDN5.js} +1 -1
- package/dist/chunks/{chunk-2AU6O6Z5.js → chunk-LIQLOS7B.js} +1 -1
- package/dist/chunks/chunk-LYQECLRR.js +10 -0
- 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-GUGP6OY2.js → chunk-ME52HBX7.js} +1 -1
- package/dist/chunks/{chunk-XAGG5BJT.js → chunk-MFOBJA6M.js} +1 -1
- package/dist/chunks/{chunk-GHNHUSVK.js → chunk-MMMJO2M3.js} +1 -1
- package/dist/chunks/chunk-MNDFF42B.js +30 -0
- package/dist/chunks/{chunk-AFHZC47H.js → chunk-MPOK5ZI5.js} +1 -1
- package/dist/chunks/{chunk-WAFBTC45.js → chunk-N3IQO5HN.js} +1 -1
- package/dist/chunks/{chunk-2G2SALNN.js → chunk-NBRW54IL.js} +1 -1
- package/dist/chunks/chunk-NJFXR3FN.js +77 -0
- package/dist/chunks/chunk-NMY2YZ6M.js +8 -0
- package/dist/chunks/chunk-NTSJNYRU.js +11 -0
- package/dist/chunks/{chunk-EFP3LK4G.js → chunk-OBBFWQJ3.js} +1 -1
- package/dist/chunks/{chunk-SQCVI2EG.js → chunk-OOAIU7WR.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-PHK4OYIZ.js +8 -0
- package/dist/chunks/{chunk-IF6GA273.js → chunk-PKCEKIQP.js} +1 -1
- package/dist/chunks/{chunk-33HVDSWP.js → chunk-PYHNDBNH.js} +1 -1
- package/dist/chunks/chunk-QFE3RPMA.js +19 -0
- package/dist/chunks/{chunk-S4AANAHX.js → chunk-QKK5BAZO.js} +1 -1
- package/dist/chunks/{chunk-RDDIWY3O.js → chunk-QPX6N5CV.js} +3 -3
- package/dist/chunks/{chunk-3UZE566G.js → chunk-QSL6AG2B.js} +1 -1
- package/dist/chunks/{chunk-BDXK4TCN.js → chunk-RHFNVIFD.js} +1 -1
- package/dist/chunks/chunk-RNHPL4C7.js +13 -0
- package/dist/chunks/chunk-RPYIWRSN.js +7 -0
- package/dist/chunks/{chunk-AP6DZGTK.js → chunk-RYSO5U3E.js} +1 -1
- package/dist/chunks/{chunk-2OMI3IUW.js → chunk-S6QZTDZ3.js} +1 -1
- package/dist/chunks/{chunk-5O4AXCN7.js → chunk-SGFMVYFR.js} +1 -1
- package/dist/chunks/chunk-SGNDE4YS.js +7 -0
- 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-TNQUCTJH.js → chunk-THMCHMVZ.js} +1 -1
- package/dist/chunks/{chunk-TJUZVODP.js → chunk-TLKBGAOL.js} +1 -1
- package/dist/chunks/{chunk-E4VPDMRQ.js → chunk-TRDAU3LX.js} +1 -1
- package/dist/chunks/chunk-TVTGVWCV.js +8 -0
- package/dist/chunks/{chunk-CJZE7647.js → chunk-U5SZQUYO.js} +1 -1
- package/dist/chunks/chunk-UEFDCTG6.js +7 -0
- package/dist/chunks/{chunk-OXS5VO4X.js → chunk-URJT7V4L.js} +1 -1
- package/dist/chunks/chunk-UT3HLSJV.js +8 -0
- package/dist/chunks/chunk-V5TIFXUP.js +15 -0
- package/dist/chunks/chunk-VGSSSQFT.js +7 -0
- package/dist/chunks/{chunk-OF32Z3UP.js → chunk-VT7UAUY6.js} +1 -1
- package/dist/chunks/{chunk-QRG24GJG.js → chunk-VWFFYVJ2.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-2D5PTFAY.js → chunk-WOXLDQR3.js} +1 -1
- package/dist/chunks/{chunk-WIF4VGYZ.js → chunk-X3LOIVIS.js} +1 -1
- package/dist/chunks/{chunk-MINTHN6C.js → chunk-X4ECSRFL.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-C335SWOB.js → chunk-X7TIJWNO.js} +1 -1
- package/dist/chunks/chunk-XTCRLS6X.js +10 -0
- package/dist/chunks/{chunk-KLYFOXYH.js → chunk-XUMXJUE4.js} +3 -3
- package/dist/chunks/{chunk-XDWAUOFO.js → chunk-XXLU5IHA.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-YEDS2UMW.js → chunk-YBKH3IDY.js} +1 -1
- package/dist/chunks/{chunk-3OZCZF4N.js → chunk-YFOBGEOW.js} +1 -1
- package/dist/chunks/chunk-YKIKCZQ4.js +37 -0
- package/dist/chunks/chunk-YLXXGQQQ.js +7 -0
- package/dist/chunks/chunk-YMVS467I.js +7 -0
- package/dist/chunks/{chunk-BMIYC2MH.js → chunk-YN3HZJXW.js} +1 -1
- package/dist/chunks/chunk-YTSGFU5T.js +7 -0
- package/dist/chunks/{chunk-Z2PTPD6J.js → chunk-YTSUDTAK.js} +1 -1
- package/dist/chunks/{chunk-DOBV3XLO.js → chunk-Z3YQZSU4.js} +1 -1
- package/dist/chunks/{chunk-O7GNYVVM.js → chunk-Z5HRQ3IQ.js} +2 -2
- package/dist/chunks/{chunk-D2E4COIY.js → chunk-ZBZQEDZY.js} +1 -1
- package/dist/chunks/{chunk-F37XFLFP.js → chunk-ZNEXVCPE.js} +1 -1
- package/dist/chunks/chunk-ZRFDZO7Y.js +7 -0
- package/dist/chunks/{chunk-UECFEOOH.js → chunk-ZXSZH7N5.js} +1 -1
- package/dist/chunks/clear-ZYFF7TKK.js +8 -0
- package/dist/chunks/cli-embedded-NR5F35LW.js +87 -0
- package/dist/chunks/compile-vercel-config-PM32YSEA.js +7 -0
- package/dist/chunks/config-BOZHXFS2.js +8 -0
- package/dist/chunks/config-PEQFEYH3.js +7 -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-5ZT5D2ZC.js +9 -0
- package/dist/chunks/delete-QOXGYAV7.js +10 -0
- package/dist/chunks/describe-PB4P77HZ.js +25 -0
- package/dist/chunks/detect-projects-YFNBW57H.js +7 -0
- package/dist/chunks/detect-services-ZN2R3RDF.js +7 -0
- package/dist/chunks/disable-UB445BYJ.js +7 -0
- package/dist/chunks/discard-EDFRCWQJ.js +14 -0
- package/dist/chunks/edit-RZUR2MEI.js +9 -0
- package/dist/chunks/edit-ZWAA6ERV.js +8 -0
- package/dist/chunks/enable-YTPIGKFW.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-GAUHNKEC.js} +2 -3
- package/dist/chunks/future-5CMQQWD5.js +7 -0
- package/dist/chunks/generate-cert-for-deploy-UIPNZXKH.js +7 -0
- package/dist/chunks/image-6E4KXK2L.js +7 -0
- package/dist/chunks/import-builders-XWE653DS.js +7 -0
- package/dist/chunks/{inspect-GBH7FAW6.js → inspect-6R3QRA5N.js} +1 -1
- package/dist/chunks/{inspect-4Y2OD5MI.js → inspect-CAFSMVCJ.js} +1 -1
- package/dist/chunks/{inspect-SX3QQUEQ.js → inspect-D7ABHU5K.js} +1 -1
- package/dist/chunks/{inspect-DFYVVIJW.js → inspect-INPZEWQW.js} +1 -1
- package/dist/chunks/inspect-MTGXZZ56.js +9 -0
- package/dist/chunks/inspect-RAXMU5ZB.js +13 -0
- package/dist/chunks/{list-HD6KXAIG.js → list-FIHRZBUS.js} +1 -1
- package/dist/chunks/list-JBJW5CJ5.js +12 -0
- package/dist/chunks/{list-4RRL326Z.js → list-VMOJ7VVX.js} +1 -1
- package/dist/chunks/{list-MW2FV253.js → list-ZVDEIXDS.js} +1 -1
- package/dist/chunks/login-H2G7BS6W.js +7 -0
- package/dist/chunks/login-LKMOWVCB.js +9 -0
- package/dist/chunks/logs-VXZM4UHP.js +7 -0
- package/dist/chunks/{ls-RKOM46KV.js → ls-C6AD24SN.js} +1 -1
- package/dist/chunks/{ls-TLEAYYXQ.js → ls-F7VCPUQX.js} +1 -1
- package/dist/chunks/{ls-VFE7PE25.js → ls-GDKBTL2S.js} +1 -1
- package/dist/chunks/ls-HDEMDHPT.js +8 -0
- package/dist/chunks/ls-JQ27BRGL.js +11 -0
- package/dist/chunks/{ls-Q4WGEEBZ.js → ls-LAGLNA5S.js} +1 -1
- package/dist/chunks/{ls-I767MTW4.js → ls-Z6MWIX4Y.js} +1 -1
- package/dist/chunks/migrate-experimental-services-EDKYGFQN.js +7 -0
- package/dist/chunks/mutate-QQV7STKJ.js +9 -0
- package/dist/chunks/{native-self-update-JDTL3IBF.js → native-self-update-Q3EN6NZK.js} +1 -1
- package/dist/chunks/notifications-RS7NVKX3.js +7 -0
- package/dist/chunks/open-FJ2GR5YN.js +7 -0
- package/dist/chunks/{openapi-NEYEIRF2.js → openapi-TMDHCYVN.js} +1 -1
- package/dist/chunks/permissions-5A7V4SB3.js +7 -0
- package/dist/chunks/{plugin-offer-NPJAEILN.js → plugin-offer-EVN7NAJK.js} +1 -1
- package/dist/chunks/prompt-missing-credentials-KI75QVSM.js +7 -0
- package/dist/chunks/publish-XSPN4TNJ.js +15 -0
- package/dist/chunks/pull-6UMQJKSF.js +7 -0
- package/dist/chunks/purchase-domain-if-available-CT4I2TPX.js +7 -0
- package/dist/chunks/push-KY26BHB6.js +7 -0
- package/dist/chunks/query-RISEG5SJ.js +7 -0
- package/dist/chunks/raw-query-VVRMDGD2.js +8 -0
- package/dist/chunks/reauthenticate-OSPJ3JEZ.js +7 -0
- package/dist/chunks/{remove-IEEZGRB2.js → remove-2IJXYNP5.js} +1 -1
- package/dist/chunks/reorder-V7HLFPNM.js +10 -0
- package/dist/chunks/reply-DBWSTVHX.js +9 -0
- package/dist/chunks/repo-root-DZ6WFHMP.js +7 -0
- package/dist/chunks/resolve-NNJNHWK7.js +12 -0
- package/dist/chunks/resolve-agent-team-SDRK736H.js +7 -0
- package/dist/chunks/{resolve-deployment-framework-preset-4TKUU6AH.js → resolve-deployment-framework-preset-BLMQLCIN.js} +1 -1
- package/dist/chunks/restore-JLS3DHVR.js +16 -0
- package/dist/chunks/rm-44NX26ZY.js +8 -0
- package/dist/chunks/rm-6K2ZAQ26.js +8 -0
- package/dist/chunks/rm-KX2MW3CD.js +8 -0
- package/dist/chunks/rm-TADMPEWP.js +8 -0
- package/dist/chunks/rm-YCOVLR77.js +8 -0
- package/dist/chunks/routes-SBMN6SDF.js +7 -0
- package/dist/chunks/rule-inspect-4OICMTIG.js +8 -0
- package/dist/chunks/{schema-L5VCG6FJ.js → schema-JVSAUVFJ.js} +1 -1
- package/dist/chunks/schema-NPCCNUH2.js +14 -0
- package/dist/chunks/select-org-PQVCQGYR.js +7 -0
- package/dist/chunks/{serving-aOQsBok0-OL36TMZU.js → serving-C1mhZQqH-73TMEGEB.js} +1 -1
- package/dist/chunks/{set-6U4QIX7A.js → set-GBB3DG2V.js} +1 -1
- package/dist/chunks/set-XADF6YK4.js +7 -0
- package/dist/chunks/setup-and-link-CBVABGTY.js +7 -0
- package/dist/chunks/{skills-ZMFZGPQL.js → skills-VPLIJJQG.js} +4 -19
- package/dist/chunks/table-SCLK33K7.js +7 -0
- package/dist/chunks/tags-PVI45KIL.js +7 -0
- package/dist/chunks/{types-CVLZCTL2.js → types-MTNJRJKG.js} +1 -1
- package/dist/chunks/{update-A727QN7H.js → update-KIOGBNX7.js} +1 -1
- package/dist/chunks/usage-XTWSFFZT.js +15 -0
- package/dist/chunks/validate-config-IREIABSK.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 +11 -10
- 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 +16 -10
- package/dist/commands-ai.js +17 -10
- package/dist/commands-blob.js +6 -6
- package/dist/commands-core.js +15 -16
- package/dist/commands-deployments.js +12 -11
- package/dist/commands-flags.js +25 -20
- package/dist/commands-integrations.js +3 -3
- package/dist/commands-observability.js +38 -28
- package/dist/commands-routing.js +4 -4
- 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 +42 -42
- package/dist/version.mjs +1 -1
- package/package.json +43 -43
- 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-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-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-OCR5CRTH.js +0 -10
- package/dist/chunks/chunk-PKR32I2N.js +0 -30
- 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
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
import { createRequire as __createRequire } from 'node:module';
|
|
2
|
-
import { fileURLToPath as __fileURLToPath } from 'node:url';
|
|
3
|
-
import { dirname as __dirname_ } from 'node:path';
|
|
4
|
-
const require = __createRequire(import.meta.url);
|
|
5
|
-
const __filename = __fileURLToPath(import.meta.url);
|
|
6
|
-
const __dirname = __dirname_(__filename);
|
|
7
|
-
import{CAN_MAX,ChannelPath,HttpError,forbidden,unauthorized}from"./chunk-KMTHGHJV.js";var PERMISSIONS=["read","post","react","label","sync","manage"],InvalidCan=class extends Error{code="invalid_can";constructor(message2){super(message2),this.name="InvalidCan"}},IMPLIES={read:[],post:[],react:["read"],label:["read"],sync:["read"],manage:["read","post","react","label","sync"]},ORDER=new Map(PERMISSIONS.map((permission,index)=>[permission,index])),SHAPE="write *, a channel, or a channel and its subtree (feedback/)";function parsePattern(pattern){if(pattern==="*")return{kind:"all"};if(pattern.includes("*")){let before=pattern.slice(0,pattern.indexOf("*")).replace(/\/+$/,"");throw new InvalidCan(`invalid channel pattern ${pattern}: ${before===""?"write * for every channel":ChannelPath.safeParse(before).success?`write ${before}/ for ${before} and its subtree`:SHAPE}`)}let subtree=pattern.endsWith("/"),path=subtree?pattern.slice(0,-1):pattern;if(!ChannelPath.safeParse(path).success)throw new InvalidCan(`invalid channel pattern ${pattern||"(empty)"}: ${SHAPE}`);return subtree?{kind:"subtree",path}:{kind:"exact",path}}var key=pattern=>pattern.kind==="all"?"*":pattern.kind==="subtree"?`${pattern.path}/`:pattern.path;function expand(grant){let out=new Set,add=permission=>{if(!ORDER.has(permission))throw new InvalidCan(`unknown permission ${String(permission)}: use ${PERMISSIONS.join(", ")}`);if(!out.has(permission)){out.add(permission);for(let implied of IMPLIES[permission])add(implied)}};for(let permission of grant==="all"?PERMISSIONS:grant)add(permission);return out}var NOTHING=new Set;function compile(entries){let all=null,exact=new Map,subtrees=[];for(let[pattern,permissions]of entries)pattern.kind==="all"?all=permissions:pattern.kind==="exact"?exact.set(pattern.path,permissions):subtrees.push([pattern.path,permissions]);return subtrees.sort((a,b)=>b[0].length-a[0].length),{all,exact,subtrees}}var under=(channel,path)=>channel===path||channel.startsWith(`${path}/`);function resolve(rules,channel,subtreeOnly=!1){if(!subtreeOnly){let exact=rules.exact.get(channel);if(exact)return exact}for(let[path,permissions]of rules.subtrees)if(under(channel,path))return permissions;return rules.all??NOTHING}var at=(rules,pattern)=>pattern.kind==="all"?rules.all??NOTHING:resolve(rules,pattern.path,pattern.kind==="subtree"),equal=(a,b)=>a.size===b.size&&[...a].every(permission=>b.has(permission));function parent(rules,pattern){if(pattern.kind==="exact")return resolve(rules,pattern.path,!0);if(pattern.kind==="subtree"){for(let[path,permissions]of rules.subtrees)if(path!==pattern.path&&under(pattern.path,path))return permissions}return rules.all??NOTHING}function canonical(entries){let rules=compile(entries);return compile(entries.filter(([pattern,permissions])=>pattern.kind==="all"?permissions.size>0:!equal(permissions,parent(rules,pattern))))}function entriesOf(can){return can==="all"||Array.isArray(can)?[[{kind:"all"},expand(can)]]:Object.entries(can).map(([pattern,grant])=>[parsePattern(pattern),expand(grant)])}var entriesIn=rules=>[...rules.all?[[{kind:"all"},rules.all]]:[],...rules.subtrees.map(([path,permissions])=>[{kind:"subtree",path},permissions]),...[...rules.exact].map(([path,permissions])=>[{kind:"exact",path},permissions])],RULES=Symbol("board.access"),READABLE_MAX=4096,isAccess=value=>typeof value=="object"&&RULES in value;function fromRules(rules){let entries=entriesIn(rules),everywhere=permission=>(rules.all?.has(permission)??!1)&&entries.every(([,permissions])=>permissions.has(permission)),uniform=rules.exact.size===0&&rules.subtrees.length===0?rules.all?.has("read")??!1:null,readable=new Map,compiled={[RULES]:rules,can:(permission,channel)=>resolve(rules,channel).has(permission),readable(channel){if(uniform!==null)return uniform;let found=readable.get(channel);return found===void 0&&(readable.size>=READABLE_MAX&&readable.clear(),readable.set(channel,found=resolve(rules,channel).has("read"))),found},readsAll:everywhere("read"),everywhere,anywhere:permission=>entries.some(([,permissions])=>permissions.has(permission)),at:(permission,pattern)=>at(rules,parsePattern(pattern)).has(permission),narrow(scope){let other=isAccess(scope)?scope[RULES]:canonical(entriesOf(scope)),patterns=new Map([["*",{kind:"all"}]]);for(let[pattern]of[...entries,...entriesIn(other)])patterns.set(key(pattern),pattern);return fromRules(canonical([...patterns.values()].map(pattern=>{let theirs=at(other,pattern);return[pattern,new Set([...at(rules,pattern)].filter(permission=>theirs.has(permission)))]})))},summary(){let named=entries.map(([pattern,permissions])=>[key(pattern),permissions]);named.sort(([a],[b])=>a==="*"?-1:b==="*"?1:a.localeCompare(b));let out={};for(let[name,permissions]of named)out[name]=[...permissions].sort((a,b)=>ORDER.get(a)-ORDER.get(b));return out}};return Object.freeze(compiled)}function compileAccess(can){return fromRules(canonical(entriesOf(can)))}var FULL_ACCESS=compileAccess("all"),NO_ACCESS=compileAccess([]);var RANK=new Map(["principal","group","everyone"].map((level,index)=>[level,index])),namedIn=can=>entriesOf(can);function closest(matched){let byPattern=new Map;for(let grant of matched)for(let[pattern,permissions]of namedIn(grant.can)){let name=key(pattern),found=byPattern.get(name);if(!found||RANK.get(grant.level)<RANK.get(found.level))byPattern.set(name,{pattern,level:grant.level,permissions:new Set(permissions),sources:[grant.source]});else if(found.level===grant.level){for(let permission of permissions)found.permissions.add(permission);found.sources.includes(grant.source)||found.sources.push(grant.source)}}return byPattern}function combine(matched){return fromRules(canonical([...closest(matched).values()].map(({pattern,permissions})=>[pattern,permissions])))}function decide(matched,channel){let covering=[...closest(matched).values()].filter(({pattern})=>pattern.kind==="all"?!0:pattern.kind==="exact"?pattern.path===channel:under(channel,pattern.path)),specificity=({pattern})=>pattern.kind==="exact"?1/0:pattern.kind==="subtree"?pattern.path.length:-1,[winner,...beaten]=covering.sort((a,b)=>specificity(b)-specificity(a));return winner?{pattern:key(winner.pattern),over:beaten.map(({pattern})=>key(pattern)),level:winner.level,sources:winner.sources,permissions:[...winner.permissions].sort((a,b)=>ORDER.get(a)-ORDER.get(b))}:{pattern:null,over:[],level:null,sources:[],permissions:[]}}function canText(access){let entries=Object.entries(access.summary()).map(([pattern,permissions])=>`${pattern}=${permissions.join(",")}`);return entries.length>0?entries.join(";"):"*="}function parseCan(header,name="x-board-can"){if(header.length>4e3)throw new InvalidCan(`${name} is longer than ${CAN_MAX} characters`);let out={},entries=header.split(";").map(entry=>entry.trim());if(entries.every(entry=>entry===""))throw new InvalidCan(`${name} is empty: write pattern=permissions, like dev/=read,post`);for(let entry of entries){if(entry==="")continue;let split=entry.indexOf("=");if(split<0)throw new InvalidCan(`${name} entry ${entry} needs =: write pattern=permissions, like dev/=read,post`);let pattern=entry.slice(0,split).trim(),list=entry.slice(split+1).trim();if(Object.hasOwn(out,pattern))throw new InvalidCan(`${name} lists ${pattern} twice`);parsePattern(pattern);let permissions=list===""?[]:list.split(",").map(permission=>permission.trim());if(permissions.length===1&&permissions[0]==="all"){out[pattern]="all";continue}for(let permission of permissions)if(!ORDER.has(permission))throw new InvalidCan(`${name}: unknown permission ${permission||"(empty)"}: use ${PERMISSIONS.join(", ")}, or all`);out[pattern]=permissions}return out}function levelOf(principal,facts){let{caller}=facts;switch(principal.kind){case"everyone":return"everyone";case"all-users":return caller.kind==="user"&&facts.member===!0?"group":null;case"user":return caller.kind==="user"&&caller.userId===principal.userId?"principal":null;case"all-projects":return caller.kind==="project"&&facts.teamProject===!0&&principal.environments.includes(caller.environment)?"group":null;case"project":return caller.kind==="project"&&caller.projectId===principal.projectId&&(principal.teamId===void 0||caller.teamId===void 0||caller.teamId===principal.teamId)&&principal.environments.includes(caller.environment)?"principal":null;case"github":{if(caller.kind!=="github")return null;let same=principal.repositoryId!==void 0?caller.repositoryId===principal.repositoryId:caller.repository===principal.repository,workflow=principal.workflow===void 0||caller.ref!==void 0&&caller.workflowRef===`${caller.repository}/${principal.workflow}@${caller.ref}`,branch=principal.branch===void 0||caller.ref===`refs/heads/${principal.branch}`,event=principal.event===void 0||caller.event===principal.event;return same&&workflow&&branch&&event?"principal":null}case"app":return caller.kind==="app"&&caller.clientId===principal.clientId?"principal":null;case"all-apps":return caller.kind==="app"&&facts.teamApp===!0?"group":null;case"oidc":return caller.kind==="oidc"&&caller.issuer===principal.issuer&&Object.entries(principal.claims).every(([name,allowed])=>{let value=caller.claims[name];return value===void 0?!1:typeof allowed=="string"?String(value)===allowed:allowed.includes(String(value))})?"principal":null}}var RANK2={principal:0,group:1,everyone:2};function matchedFor(facts,own=!1){let matched=[];for(let grant of facts.grants){let best=null;for(let principal of grant.principals){if(own&&principal.kind==="everyone")continue;let level=levelOf(principal,facts);level!==null&&(best===null||RANK2[level]<RANK2[best])&&(best=level)}best!==null&&matched.push({level:best,can:grant.can,source:{grant}})}return matched}function admits(facts,matched=matchedFor(facts)){return facts.caller.kind==="user"&&facts.member===!0?!0:matched.some(found=>found.level!=="everyone")}function limited(access,facts){let out=facts.cap===void 0?access:access.narrow({"*":[...facts.cap]});return facts.can!==void 0&&(out=out.narrow(compileAccess(facts.can))),out}function grantAccess(facts){let matched=matchedFor(facts);return admits(facts,matched)?{caller:limited(combine(matched),facts),own:limited(combine(matchedFor(facts,!0)),facts)}:null}function explainGrants(facts,channel){let matched=matchedFor(facts);if(!admits(facts,matched))return{pattern:null,over:[],level:null,grants:[],capped:!1,permissions:[]};let decision=decide(matched,channel),cap=facts.cap===void 0?null:compileAccess({"*":[...facts.cap]}),capped=cap?decision.permissions.filter(permission=>cap.can(permission,channel)):[...decision.permissions],token=facts.can===void 0?null:compileAccess(facts.can);return{pattern:decision.pattern,over:[...decision.over],level:decision.level,grants:decision.sources.map(source=>source.grant),capped:capped.length<decision.permissions.length,permissions:token?capped.filter(permission=>token.can(permission,channel)):capped}}var VERCEL_ISSUER=/^https:\/\/oidc\.vercel\.com(?:\/[a-z0-9-]+)?$/;var issuerName=iss=>{let url=new URL(iss);return`${url.host}${url.pathname.replace(/\/+$/,"")}`.replace(/[%:]/g,char=>char==="%"?"%25":"%3A")},subFits=sub=>!/[\s+\]]/.test(sub);function trustedIssuers(issuers){let named=new Map;for(let iss of issuers){let name=issuerName(iss),other=named.get(name);if(other!==void 0&&other!==iss)throw new Error(`oidc issuers ${other} and ${iss} name the same principals, oidc:${name}:<sub>: pin one of them`);named.set(name,iss)}return new Set(issuers)}var DEFAULT_CAN=Object.freeze({"*":Object.freeze(["read","post","react","label"])});function privateHost(host){let name=host.toLowerCase().replace(/\.$/,"");return name.startsWith("[")||/^\d+(\.\d+){3}$/.test(name)||/^\d+$/.test(name)||!name.includes(".")||name==="localhost"?!0:/\.(localhost|local|internal|home|lan|corp|intranet)$/.test(name)}var userIdOf=id=>id.split(":").slice(2).join(":");function callerFacts(principal,facts,team){let claims=facts?.claims??{};return principal.kind==="person"?{caller:{kind:"user",userId:userIdOf(principal.id)},member:!0}:facts?.issuer==="vercel"?{caller:{kind:"project",projectId:String(claims.project_id??""),environment:String(claims.environment??""),...typeof claims.owner_id=="string"?{teamId:claims.owner_id}:{}},teamProject:team!==null&&claims.owner_id===team}:facts?.issuer==="github"?{caller:{kind:"github",repository:String(claims.repository??""),...claims.repository_id!==void 0?{repositoryId:String(claims.repository_id)}:{},...claims.workflow_ref!==void 0?{workflowRef:String(claims.workflow_ref)}:{},...claims.ref!==void 0?{ref:String(claims.ref)}:{},...claims.event_name!==void 0?{event:String(claims.event_name)}:{}}}:facts?.issuer==="oidc"?{caller:{kind:"oidc",issuer:facts.iss,claims}}:null}function verifiedIssuers(base,granted){let taken=new Set(base.map(issuerName)),issuers=[...base];for(let issuer of granted){if(base.includes(issuer))continue;let url=URL.parse(issuer);if(url?.protocol!=="https:"||privateHost(url.hostname))continue;let name=issuerName(issuer);taken.has(name)||(taken.add(name),issuers.push(issuer))}return issuers}var grantIssuers=grants=>[...new Set(grants.flatMap(grant=>grant.principals.flatMap(principal=>principal.kind==="oidc"?[principal.issuer]:[])))],notGranted=(who,grant)=>new HttpError(403,"forbidden",`this token can't use this board: no grant lets in ${who}`,{hint:`Grant it: vb grants create ${grant}`});function createAuthority(options){async function factsFor(principal,facts,team,snapshot){let grants=snapshot??(options.grants?await options.grants():[]),known=callerFacts(principal,facts,team);return{grants,facts:known?{...known,grants}:null}}async function byGrants(principal,facts,snapshot){let claims=facts?.claims??{},own=facts?.issuer==="vercel"?await options.project():null,environment=String(claims.environment??""),here=boardEnvironment(),ownDeployment=own!==null&&own.id!==null&&claims.project_id===own.id;if(ownDeployment&&here!==null&&environment===here)return{fixed:FULL_ACCESS};if(!facts)throw forbidden("this token can't use this board");let{grants,facts:found}=await factsFor(principal,facts,own?.teamId??null,snapshot);if(found&&admits(found))return{facts:found};if(facts.issuer==="oidc"&&!grantIssuers(grants).includes(facts.iss))throw unauthorized(`untrusted issuer: ${facts.iss}`);if(facts.issuer==="oidc")throw forbidden("this token can't use this board: no grant lets in its claims");if(facts.issuer==="github"){let repository=String(claims.repository??"");throw notGranted(repository||"its repository",`--github ${repository||"<OWNER/REPO>"}`)}let project=String(claims.project_id??"")||"<PROJECT_ID>",grant2=`--project ${project} --environment ${environment||"<ENVIRONMENT>"}`;throw ownDeployment?new HttpError(403,"forbidden",`this token can't use this board: it runs in ${here??"no Vercel environment"}, and its ${environment||"unnamed"} deployments need a grant`,{hint:`Grant them: vb grants create ${grant2}`}):notGranted(`project ${project} in ${environment||"no environment"}`,grant2)}async function resolve2(principal,snapshot){let hosted=principal.facts?.issuer==="host";if(principal.id.startsWith("board:")||principal.kind==="external"&&!hosted)return{fixed:FULL_ACCESS};if(hosted){if(!options.hosts)throw forbidden("this token can't use this board: its board no longer takes a host's principals");let{exp}=principal.facts.claims;if(typeof exp=="number"&&exp*1e3<=Date.now())throw unauthorized("token expired")}if(principal.kind==="person"){if(!options.grants)return{fixed:FULL_ACCESS};let{facts}=await factsFor(principal,null,null,snapshot);return{facts}}return byGrants(principal,(hosted?void 0:principal.facts)??factsFromId(principal.id),snapshot)}async function grant(principal,snapshot){let resolved=await resolve2(principal,snapshot),scope=principal.scope===void 0?void 0:parseCan(principal.scope);if("fixed"in resolved)return scope===void 0?resolved.fixed:resolved.fixed.narrow(scope);let decided=grantAccess({...resolved.facts,...scope!==void 0?{can:scope}:{}});if(!decided)throw forbidden("this token can't use this board");return decided.caller}async function accessNow(principal,snapshot){try{return await grant(principal,snapshot)}catch(error){let status=error.status;if(status===401||status===403)return null;throw error}}return{grant,accessNow,resolve:resolve2}}var boardEnvironment=()=>process.env.VERCEL_TARGET_ENV||process.env.VERCEL_ENV||null;function factsFromId(id){let deployment=id.match(/^vercel:project:([^:]+):([^:]+)$/);return deployment?{issuer:"vercel",iss:"",claims:{project_id:deployment[1],environment:deployment[2]}}:null}var TOKENS=Symbol("board.oidcTokens"),LOGINS=Symbol("board.logins"),namesByLogin=authenticate=>LOGINS in authenticate,verifiedTokens=new WeakSet;function markVerified(principal){return verifiedTokens.add(principal),principal}var verifiesTokens=authenticate=>TOKENS in authenticate,fromTokens=principal=>verifiedTokens.has(principal),PRINCIPAL_ID=/^[a-z][a-z0-9-]*:[a-z][a-z0-9-]*:[^\s+\]]{1,200}$/,KINDS=["person","deployment","workflow","external"];function hostPrincipal(value){let fail=why=>{throw new TypeError(`authenticate returned an invalid principal: ${why}`)};(typeof value!="object"||value===null)&&fail("not an object"),(typeof value.id!="string"||!PRINCIPAL_ID.test(value.id)||value.id.startsWith("board:"))&&fail(`id must look like \`vercel:user:<id>\`, got ${JSON.stringify(value.id)}`),KINDS.includes(value.kind)||fail(`kind must be one of ${KINDS.join(", ")}`),(typeof value.handle!="string"||!/^\S{1,64}$/.test(value.handle))&&fail("handle must be 1-64 characters, no spaces");let expiresAt=value.expiresAt??null;if(expiresAt!==null&&(!(expiresAt instanceof Date)||Number.isNaN(expiresAt.getTime()))&&fail("expiresAt must be a Date or null"),expiresAt!==null&&expiresAt.getTime()<=Date.now())throw unauthorized("token expired");let claims=expiresAt===null?{}:{exp:Math.floor(expiresAt.getTime()/1e3)};return{id:value.id,kind:value.kind,handle:value.handle,expiresAt,facts:{issuer:"host",iss:"",claims}}}var JOSEError=class extends Error{static code="ERR_JOSE_GENERIC";code="ERR_JOSE_GENERIC";constructor(message2,options){super(message2,options),this.name=this.constructor.name,Error.captureStackTrace?.(this,this.constructor)}},JWTClaimValidationFailed=class extends JOSEError{static code="ERR_JWT_CLAIM_VALIDATION_FAILED";code="ERR_JWT_CLAIM_VALIDATION_FAILED";claim;reason;payload;constructor(message2,payload,claim="unspecified",reason="unspecified"){super(message2,{cause:{claim,reason,payload}}),this.claim=claim,this.reason=reason,this.payload=payload}},JWTExpired=class extends JOSEError{static code="ERR_JWT_EXPIRED";code="ERR_JWT_EXPIRED";claim;reason;payload;constructor(message2,payload,claim="unspecified",reason="unspecified"){super(message2,{cause:{claim,reason,payload}}),this.claim=claim,this.reason=reason,this.payload=payload}},JOSEAlgNotAllowed=class extends JOSEError{static code="ERR_JOSE_ALG_NOT_ALLOWED";code="ERR_JOSE_ALG_NOT_ALLOWED"},JOSENotSupported=class extends JOSEError{static code="ERR_JOSE_NOT_SUPPORTED";code="ERR_JOSE_NOT_SUPPORTED"};var JWSInvalid=class extends JOSEError{static code="ERR_JWS_INVALID";code="ERR_JWS_INVALID"},JWTInvalid=class extends JOSEError{static code="ERR_JWT_INVALID";code="ERR_JWT_INVALID"};var JWKSInvalid=class extends JOSEError{static code="ERR_JWKS_INVALID";code="ERR_JWKS_INVALID"},JWKSNoMatchingKey=class extends JOSEError{static code="ERR_JWKS_NO_MATCHING_KEY";code="ERR_JWKS_NO_MATCHING_KEY";constructor(message2="no applicable key found in the JSON Web Key Set",options){super(message2,options)}},JWKSMultipleMatchingKeys=class extends JOSEError{[Symbol.asyncIterator]=async function*(){};static code="ERR_JWKS_MULTIPLE_MATCHING_KEYS";code="ERR_JWKS_MULTIPLE_MATCHING_KEYS";constructor(message2="multiple matching keys found in the JSON Web Key Set",options){super(message2,options)}},JWKSTimeout=class extends JOSEError{static code="ERR_JWKS_TIMEOUT";code="ERR_JWKS_TIMEOUT";constructor(message2="request timed out",options){super(message2,options)}},JWSSignatureVerificationFailed=class extends JOSEError{static code="ERR_JWS_SIGNATURE_VERIFICATION_FAILED";code="ERR_JWS_SIGNATURE_VERIFICATION_FAILED";constructor(message2="signature verification failed",options){super(message2,options)}};function table(entries){let out={__proto__:null};for(let alg in entries)out[alg]={...entries[alg],alg};return out}var sig=[["verify"],["sign"]];function hmac(bits){let subtle={name:"HMAC",hash:`SHA-${bits}`};return{kty:["oct"],secret:!0,subtle,signing:subtle,usages:sig}}function rsa(bits,saltLength){let subtle={name:saltLength?"RSA-PSS":"RSASSA-PKCS1-v1_5",hash:`SHA-${bits}`};return{kty:["RSA"],subtle,signing:saltLength?{...subtle,saltLength}:subtle,usages:sig,minRsaBits:2048}}function ecdsa(crv,bits){return{kty:["EC"],crv,subtle:{name:"ECDSA",namedCurve:crv},signing:{name:"ECDSA",hash:`SHA-${bits}`},usages:sig}}function eddsa(){let subtle={name:"Ed25519"};return{kty:["OKP"],crv:"Ed25519",subtle,signing:subtle,usages:sig}}function mldsa(parameterSet){let subtle={name:`ML-DSA-${parameterSet}`};return{kty:["AKP"],subtle,signing:subtle,usages:sig}}var JWS=table({HS256:hmac(256),HS384:hmac(384),HS512:hmac(512),RS256:rsa(256),RS384:rsa(384),RS512:rsa(512),PS256:rsa(256,32),PS384:rsa(384,48),PS512:rsa(512,64),ES256:ecdsa("P-256",256),ES384:ecdsa("P-384",384),ES512:ecdsa("P-521",512),EdDSA:eddsa(),Ed25519:eddsa(),"ML-DSA-44":mldsa(44),"ML-DSA-65":mldsa(65),"ML-DSA-87":mldsa(87)});function jwsAlgorithm(alg){let entry=typeof alg=="string"?JWS[alg]:void 0;if(!entry)throw new JOSENotSupported(`alg ${alg} is not supported either by JOSE or your javascript runtime`);return entry}var encoder=new TextEncoder,decoder=new TextDecoder,strictDecoder=new TextDecoder("utf-8",{fatal:!0}),UINT32_RANGE=2**32;function concat(...buffers){let size=buffers.reduce((acc,{length})=>acc+length,0),buf=new Uint8Array(size),i=0;for(let buffer of buffers)buf.set(buffer,i),i+=buffer.length;return buf}var NON_ASCII=/[^\x00-\x7f]/;function encode(string){if(typeof string=="string"&&string.length>=128){if(NON_ASCII.test(string))throw new TypeError("non-ASCII string encountered in encode()");return encoder.encode(string)}let bytes=new Uint8Array(string.length);for(let i=0;i<string.length;i++){let code=string.charCodeAt(i);if(code>127)throw new TypeError("non-ASCII string encountered in encode()");bytes[i]=code}return bytes}function decodeBase64(encoded,url=!1){if(Uint8Array.fromBase64)return Uint8Array.fromBase64(encoded,{alphabet:url?"base64url":"base64"});if(url){if(encoded.includes("+")||encoded.includes("/"))throw new TypeError("Invalid base64url");encoded=encoded.replace(/-/g,"+").replace(/_/g,"/")}let binary=atob(encoded),bytes=new Uint8Array(binary.length);for(let i=0;i<binary.length;i++)bytes[i]=binary.charCodeAt(i);return bytes}var invalid="The input to be decoded is not correctly encoded.";function decode(input){try{return decodeBase64(typeof input=="string"?input:decoder.decode(input),!0)}catch(cause){throw new TypeError(invalid,{cause})}}function isObject(input){if(typeof input!="object"||input===null||Object.prototype.toString.call(input)!=="[object Object]")return!1;let prototype=Object.getPrototypeOf(input);return prototype===null||Object.getPrototypeOf(prototype)===null}function isJwkSet(input){return isObject(input)&&Array.isArray(input.keys)&&Array.from(input.keys).every(isObject)}function isDisjoint(...headers){let parameters=new Set;for(let header of headers)if(header)for(let parameter of Object.keys(header)){if(parameters.has(parameter))return!1;parameters.add(parameter)}return!0}function decodeBase64url(value,label,ErrorClass){try{return decode(value)}catch(cause){throw new ErrorClass(`Failed to base64url decode the ${label}`,{cause})}}function encodeAsciiMember(value,label,ErrorClass){try{return encode(value)}catch(cause){throw new ErrorClass(`The ${label} is not a valid base64url string`,{cause})}}function parseJoseHeader(encodedProtectedHeader,ErrorClass,message2){let parsed;try{parsed=JSON.parse(strictDecoder.decode(decode(encodedProtectedHeader)))}catch(cause){throw new ErrorClass(message2,{cause})}if(!isObject(parsed))throw new ErrorClass(message2);return parsed}var JWS_RECOGNIZED={__proto__:null,b64:!0};function validateAlgorithms(option,algorithms){if(algorithms!==void 0&&(!Array.isArray(algorithms)||algorithms.some(s=>typeof s!="string")))throw new TypeError(`"${option}" option must be an array of strings`);return algorithms===void 0?void 0:new Set(algorithms)}function validateCrit(Err,recognizedDefault,recognizedOption,protectedHeader,joseHeader){if(joseHeader.crit!==void 0&&protectedHeader?.crit===void 0)throw new Err('"crit" (Critical) Header Parameter MUST be integrity protected');if(!protectedHeader||protectedHeader.crit===void 0)return[];if(!Array.isArray(protectedHeader.crit)||protectedHeader.crit.length===0||protectedHeader.crit.some(input=>typeof input!="string"||input.length===0))throw new Err('"crit" (Critical) Header Parameter MUST be an array of non-empty strings when present');let recognized=recognizedOption===void 0?recognizedDefault:{__proto__:null,...recognizedOption,...recognizedDefault};for(let parameter of protectedHeader.crit){if(!(parameter in recognized))throw new JOSENotSupported(`Extension Header Parameter "${parameter}" is not recognized`);if(!Object.hasOwn(joseHeader,parameter)||joseHeader[parameter]===void 0)throw new Err(`Extension Header Parameter "${parameter}" is missing`);if(recognized[parameter]&&(!Object.hasOwn(protectedHeader,parameter)||protectedHeader[parameter]===void 0))throw new Err(`Extension Header Parameter "${parameter}" MUST be integrity protected`)}return protectedHeader.crit}function validateB64(protectedHeader,extensions){if(extensions.includes("b64")){let b64=protectedHeader.b64;if(typeof b64!="boolean")throw new JWSInvalid('The "b64" (base64url-encode payload) Header Parameter must be a boolean');return b64}return!0}var tag=key2=>key2[Symbol.toStringTag],jwkMatchesOp=(entry,key2,usage)=>{let{alg}=entry;if(key2.use!==void 0){let expected=usage==="sign"||usage==="verify"?"sig":"enc";if(key2.use!==expected)throw new TypeError(`Invalid key for this operation, its "use" must be "${expected}" when present`)}if(key2.alg!==void 0&&key2.alg!==alg)throw new TypeError(`Invalid key for this operation, its "alg" must be "${alg}" when present`);if(Array.isArray(key2.key_ops)){let expectedKeyOp=usage==="encrypt"||usage==="decrypt"?entry.ops?.[usage==="encrypt"?0:1]:usage;if(expectedKeyOp&&!key2.key_ops.includes(expectedKeyOp))throw new TypeError(`Invalid key for this operation, its "key_ops" must include "${expectedKeyOp}" when present`)}};async function prepareKey(entry,key2,usage){let{alg,secret}=entry,requiresPrivateKey=usage==="decrypt"||usage==="sign";if(secret&&key2 instanceof Uint8Array)return key2;let normalized,keyObject;if(isObject(key2)){if(normalized=normalizeJwk(key2),typeof normalized.kty!="string")throw invalidKeyType(alg,key2,secret);if(!(secret?normalized.kty==="oct"&&typeof normalized.k=="string":normalized.kty!=="oct"&&(requiresPrivateKey?normalized.kty==="AKP"&&typeof normalized.priv=="string"||typeof normalized.d=="string":normalized.d===void 0&&normalized.priv===void 0)))throw new TypeError(secret?'JSON Web Key for symmetric algorithms must have JWK "kty" (Key Type) equal to "oct" and the JWK "k" (Key Value) present':`JSON Web Key for this operation must be a ${requiresPrivateKey?"private":"public"} JWK`);if(jwkMatchesOp(entry,normalized,usage),normalized.kty==="oct")return decode(normalized.k);if(!Object.isFrozen(key2)){let{key_ops}=key2;Array.isArray(key_ops)&&Object.freeze(key_ops),Object.freeze(key2)}}else{if(!isKeyLike(key2))throw invalidKeyType(alg,key2,secret);let expectedType=secret?"secret":requiresPrivateKey?"private":"public";if(key2.type!==expectedType&&(secret||["secret","public","private"].includes(key2.type)))throw new TypeError(`${tag(key2)} instances must be of type "${expectedType}" for the ${alg} algorithm`);if(isCryptoKey(key2))return key2;if(keyObject=key2,keyObject.type==="secret")return keyObject.export()}cache||=new WeakMap;let cacheKey=key2,cached=cache.get(cacheKey);if(cached?.[alg])return cached[alg];if(cached||cache.set(cacheKey,cached={}),keyObject&&typeof keyObject.toCryptoKey=="function"){let isPublic=keyObject.type==="public",crv=nist[keyObject.asymmetricKeyDetails?.namedCurve],params=entry.resolve?.({crv,asymmetricKeyType:keyObject.asymmetricKeyType})??entry.subtle;return cached[alg]=keyObject.toCryptoKey(params,isPublic,entry.usages[isPublic?0:1])}return normalized??=keyObject.export({format:"jwk"}),normalized.alg=alg,cached[alg]=await jwkToKey(entry,normalized)}var cache,nist={__proto__:null,prime256v1:"P-256",secp384r1:"P-384",secp521r1:"P-521"};var isCryptoKey=key2=>{if(key2?.[Symbol.toStringTag]==="CryptoKey")return!0;try{return key2 instanceof CryptoKey}catch{return!1}},isKeyObject=key2=>key2?.[Symbol.toStringTag]==="KeyObject",isKeyLike=key2=>isCryptoKey(key2)||isKeyObject(key2);function message(msg,actual,...types){if(types.length>2){let last=types.pop();msg+=`one of type ${types.join(", ")}, or ${last}.`}else types.length===2?msg+=`one of type ${types[0]} or ${types[1]}.`:msg+=`of type ${types[0]}.`;return actual==null?msg+=` Received ${actual}`:typeof actual=="function"&&actual.name?msg+=` Received function ${actual.name}`:typeof actual=="object"&&actual!=null&&actual.constructor?.name&&(msg+=` Received an instance of ${actual.constructor.name}`),msg}function invalidKeyType(alg,actual,secret){let types=["CryptoKey","KeyObject","JSON Web Key"];return secret&&types.push("Uint8Array"),new TypeError(message(`Key for the ${alg} algorithm must be `,actual,...types))}var unusable=(name,prop="algorithm.name")=>new TypeError(`CryptoKey does not support this operation, its ${prop} must be ${name}`);function checkUsage(key2,usage){if(usage&&!key2.usages.includes(usage))throw new TypeError(`CryptoKey does not support this operation, its usages must include ${usage}.`)}function checkModulusLength(alg,key2){let{modulusLength}=key2.algorithm;if(typeof modulusLength!="number"||modulusLength<2048)throw new TypeError(`${alg} requires key modulusLength to be 2048 bits or larger`)}function checkCryptoKey(key2,expected,usage){let algorithm=key2.algorithm;if(algorithm.name!==expected.name)throw unusable(expected.name);if(expected.hash&&algorithm.hash?.name!==expected.hash)throw unusable(expected.hash,"algorithm.hash");if(expected.namedCurve&&algorithm.namedCurve!==expected.namedCurve)throw unusable(expected.namedCurve,"algorithm.namedCurve");if(expected.length!==void 0&&algorithm.length!==expected.length)throw unusable(expected.length,"algorithm.length");checkUsage(key2,usage)}function snapshotJwk(jwk){return{__proto__:null,...jwk}}function normalizeJwk(jwk){let normalized=snapshotJwk(jwk);if(normalized.ext!==void 0&&typeof normalized.ext!="boolean")throw new TypeError('"ext" (Extractable) Parameter must be a boolean');if(normalized.key_ops!==void 0){let value=normalized.key_ops,keyOps=Array.isArray(value)?[...value]:void 0;if(!keyOps||keyOps.some(operation=>typeof operation!="string")||new Set(keyOps).size!==keyOps.length)throw new TypeError('"key_ops" (Key Operations) Parameter must be an array of unique strings');normalized.key_ops=keyOps}return normalized}async function jwkToKey(entry,jwk,extractable){if(!entry.kty.includes(jwk.kty))throw new JOSENotSupported('Invalid or unsupported JWK "alg" (Algorithm) Parameter value');let algorithm=entry.resolve?.({kty:jwk.kty,crv:jwk.crv})??entry.subtle,isPrivate=!!(jwk.d||jwk.priv),keyData={...jwk,ext:extractable??jwk.ext};return keyData.kty!=="AKP"&&delete keyData.alg,delete keyData.use,crypto.subtle.importKey("jwk",keyData,algorithm,keyData.ext??!isPrivate,jwk.key_ops??entry.usages[isPrivate?1:0])}async function rawKey(key2,expected,usage,extractable=!1){return key2 instanceof Uint8Array&&(key2=await crypto.subtle.importKey("raw",key2,expected,extractable,[usage])),checkCryptoKey(key2,expected,usage),key2}function prepareVerify(options){return[options&&validateAlgorithms("algorithms",options.algorithms),options?.crit]}function parseProtectedHeader(encodedProtectedHeader){return encodedProtectedHeader===void 0?{}:parseJoseHeader(encodedProtectedHeader,JWSInvalid,"JWS Protected Header is invalid")}function encodeCompactUnencodedPayload(payload){try{return encode(payload)}catch(cause){throw new JWSInvalid("JWS Compact Serialization payload must use only ASCII characters",{cause})}}async function verifySignature(jws,shared,key2,encodeUnencodedPayload,parsedProtected){let{protected:encodedProtectedHeader,header,payload:inputPayload}=jws,protectedHeader=parsedProtected??parseProtectedHeader(encodedProtectedHeader);if(!isDisjoint(protectedHeader,header))throw new JWSInvalid("JWS Protected and JWS Unprotected Header Parameter names must be disjoint");let joseHeader={...protectedHeader,...header},b64=validateB64(protectedHeader,validateCrit(JWSInvalid,JWS_RECOGNIZED,shared[1],protectedHeader,joseHeader)),{alg}=joseHeader;if(typeof alg!="string"||!alg)throw new JWSInvalid('JWS "alg" (Algorithm) Header Parameter missing or invalid');if(shared[0]&&!shared[0].has(alg))throw new JOSEAlgNotAllowed('"alg" (Algorithm) Header Parameter value not allowed');if(b64){if(typeof inputPayload!="string")throw new JWSInvalid("JWS Payload must be a string")}else if(typeof inputPayload!="string"&&!(inputPayload instanceof Uint8Array))throw new JWSInvalid("JWS Payload must be a string or an Uint8Array instance");let signingPayload=b64||typeof inputPayload!="string"?inputPayload:encodeUnencodedPayload(inputPayload),resolvedKey=!1;typeof key2=="function"&&(key2=await key2(protectedHeader,jws),resolvedKey=!0);let entry=jwsAlgorithm(alg),signingInput=concat(encodedProtectedHeader!==void 0?encode(encodedProtectedHeader):new Uint8Array,encode("."),typeof signingPayload=="string"?shared[2]??=encodeAsciiMember(signingPayload,"payload",JWSInvalid):signingPayload),signature=decodeBase64url(jws.signature,"signature",JWSInvalid),verificationKey=await prepareKey(entry,key2,"verify"),cryptoKey=await rawKey(verificationKey,entry.subtle,"verify");entry.minRsaBits&&checkModulusLength(entry.alg,cryptoKey);let verified=!1;try{verified=await crypto.subtle.verify(entry.signing,cryptoKey,signature,signingInput)}catch(cause){throw new JWSSignatureVerificationFailed(void 0,{cause})}if(!verified)throw new JWSSignatureVerificationFailed;let result={payload:typeof signingPayload=="string"?decodeBase64url(signingPayload,"payload",JWSInvalid):signingPayload};return encodedProtectedHeader!==void 0&&(result.protectedHeader=protectedHeader),header!==void 0&&(result.unprotectedHeader=header),resolvedKey?[{...result,key:verificationKey},b64]:[result,b64]}async function verifyCompact(jws,shared,key2){if(jws instanceof Uint8Array&&(jws=decoder.decode(jws)),typeof jws!="string")throw new JWSInvalid("Compact JWS must be a string or Uint8Array");let{0:protectedHeader,1:payload,2:signature,length}=jws.split(".");if(length!==3)throw new JWSInvalid("Invalid Compact JWS");return verifySignature({payload,protected:protectedHeader,signature},shared,key2,encodeCompactUnencodedPayload)}var epoch=date=>Math.floor(date.getTime()/1e3),multipliers={s:1,m:60,h:3600,d:86400,w:604800,y:31557600},REGEX=/^(\+|\-)? ?(\d+|\d+\.\d+) ?(seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|weeks?|w|years?|yrs?|y)(?: (ago|from now))?$/i,checkFailed="check_failed";function invalidDuration(){throw new TypeError("Invalid time period format")}function secs(str){typeof str!="string"&&invalidDuration();let matched=REGEX.exec(str);(!matched||matched[4]&&matched[1])&&invalidDuration();let value=parseFloat(matched[2]),durationSeconds=Math.round(value*multipliers[matched[3][0].toLowerCase()]);return Number.isFinite(durationSeconds)||invalidDuration(),matched[1]==="-"||matched[4]==="ago"?-durationSeconds:durationSeconds}function validateInput(label,input){if(!Number.isFinite(input))throw new TypeError(`Invalid ${label} input`);return input}var normalizeTyp=value=>{let normalized=value.toLowerCase();return value.includes("/")?normalized:`application/${normalized}`},checkAudiencePresence=(audPayload,audOption)=>typeof audPayload=="string"?audOption.includes(audPayload):Array.isArray(audPayload)?audOption.some(aud=>audPayload.includes(aud)):!1;function validateNumericDate(claimsSet,claim,required=!1){let value=claimsSet[claim];if(!(value===void 0&&!required)){if(typeof value!="number")throw new JWTClaimValidationFailed(`"${claim}" claim must be a number`,claimsSet,claim,"invalid");return value}}function unexpectedClaim(claimsSet,claim){throw new JWTClaimValidationFailed(`unexpected "${claim}" claim value`,claimsSet,claim,checkFailed)}function validateClaimsSet(protectedHeader,claimsSetBytes,options={}){let claimsSet;try{claimsSet=JSON.parse(strictDecoder.decode(claimsSetBytes))}catch(cause){throw new JWTInvalid("JWT Claims Set must be a top-level JSON object",{cause})}if(!isObject(claimsSet))throw new JWTInvalid("JWT Claims Set must be a top-level JSON object");let{typ}=options;if(typ!==void 0&&(typeof protectedHeader.typ!="string"||normalizeTyp(protectedHeader.typ)!==normalizeTyp(typ)))throw new JWTClaimValidationFailed('unexpected "typ" JWT header value',claimsSet,"typ",checkFailed);let{requiredClaims=[],issuer,subject,audience,maxTokenAge}=options,presenceCheck=[...requiredClaims];maxTokenAge!==void 0&&presenceCheck.push("iat"),audience!==void 0&&presenceCheck.push("aud"),subject!==void 0&&presenceCheck.push("sub"),issuer!==void 0&&presenceCheck.push("iss");for(let claim of new Set(presenceCheck.reverse()))if(!Object.hasOwn(claimsSet,claim))throw new JWTClaimValidationFailed(`missing required "${claim}" claim`,claimsSet,claim,"missing");issuer!==void 0&&!(Array.isArray(issuer)?issuer:[issuer]).includes(claimsSet.iss)&&unexpectedClaim(claimsSet,"iss"),subject!==void 0&&claimsSet.sub!==subject&&unexpectedClaim(claimsSet,"sub"),audience!==void 0&&!checkAudiencePresence(claimsSet.aud,typeof audience=="string"?[audience]:audience)&&unexpectedClaim(claimsSet,"aud");let{clockTolerance}=options,tolerance=0;if(typeof clockTolerance=="string")tolerance=secs(clockTolerance);else if(clockTolerance!==void 0){if(typeof clockTolerance!="number")throw new TypeError("Invalid clockTolerance option type");tolerance=clockTolerance}validateInput("clockTolerance option",tolerance);let{currentDate}=options,now=validateInput("currentDate option",epoch(currentDate===void 0?new Date:currentDate)),iat=validateNumericDate(claimsSet,"iat",maxTokenAge!==void 0),nbf=validateNumericDate(claimsSet,"nbf");if(nbf!==void 0&&nbf>now+tolerance)throw new JWTClaimValidationFailed('"nbf" claim timestamp check failed',claimsSet,"nbf",checkFailed);let exp=validateNumericDate(claimsSet,"exp");if(exp!==void 0&&exp<=now-tolerance)throw new JWTExpired('"exp" claim timestamp check failed',claimsSet,"exp",checkFailed);if(maxTokenAge!==void 0){let age=now-iat,max=validateInput("maxTokenAge option",typeof maxTokenAge=="number"?maxTokenAge:secs(maxTokenAge));if(age-tolerance>max)throw new JWTExpired('"iat" claim timestamp check failed (too far in the past)',claimsSet,"iat",checkFailed);if(age<-tolerance)throw new JWTClaimValidationFailed('"iat" claim timestamp check failed (it should be in the past)',claimsSet,"iat",checkFailed)}return claimsSet}async function jwtVerify(jwt,key2,options){let[verified,b64]=await verifyCompact(jwt,prepareVerify(options),key2);if(!b64)throw new JWTInvalid("JWTs MUST NOT use unencoded payload");let payload=validateClaimsSet(verified.protectedHeader,verified.payload,options);return{...verified,payload}}function isUsableJWK(jwk,entry,alg,kid){let{kty,key_ops:keyOps,ext,kid:jwkKid,alg:jwkAlg,use,crv}=jwk;return(ext===void 0||typeof ext=="boolean")&&(keyOps===void 0||Array.isArray(keyOps)&&keyOps.every((operation,index)=>typeof operation=="string"&&keyOps.indexOf(operation)===index)&&keyOps.includes("verify"))&&entry.kty.includes(kty)&&(kid===void 0||typeof kid=="string"&&kid===jwkKid)&&(jwkAlg===void 0?kty!=="AKP":alg===jwkAlg)&&(use===void 0||use==="sig")&&(!entry.crv||crv===entry.crv)}async function importWithAlgCache(cache2,jwk,entry){let cached=cache2.get(jwk)||cache2.set(jwk,{}).get(jwk),{alg}=entry;if(cached[alg]===void 0){let pending=jwkToKey(entry,jwk,!0).then(key2=>{if(key2.type!=="public")throw new JWKSInvalid("JSON Web Key Set members must be public keys");return cached[alg]=key2,key2}).catch(error=>{throw cached[alg]===pending&&delete cached[alg],error});cached[alg]=pending}return cached[alg]}function createLocalJWKSet(jwks){let snapshot;try{snapshot=structuredClone(jwks)}catch(cause){throw new JWKSInvalid("JSON Web Key Set malformed",{cause})}if(!isJwkSet(snapshot))throw new JWKSInvalid("JSON Web Key Set malformed");let metadata=snapshot.keys.map(jwk=>{let normalized=snapshotJwk(jwk);return Array.isArray(normalized.key_ops)&&(normalized.key_ops=[...normalized.key_ops]),normalized}),cached=new WeakMap;return Object.defineProperty(async(protectedHeader,token)=>{let{alg,kid}={...protectedHeader,...token?.header},entry=typeof alg=="string"?JWS[alg]:void 0;if(!entry||entry.secret)throw new JOSENotSupported('Unsupported "alg" value for a JSON Web Key Set');let candidates=snapshot.keys.filter((_,index)=>isUsableJWK(metadata[index],entry,alg,kid)),{0:jwk,length}=candidates;if(!length)throw new JWKSNoMatchingKey;if(length!==1){let error=new JWKSMultipleMatchingKeys;throw error[Symbol.asyncIterator]=async function*(){for(let jwk2 of candidates)try{yield await importWithAlgCache(cached,jwk2,entry)}catch{}},error}return importWithAlgCache(cached,jwk,entry)},"jwks",{value:()=>structuredClone(snapshot)})}function isCloudflareWorkers(){return typeof WebSocketPair<"u"||typeof navigator<"u"&&navigator.userAgent==="Cloudflare-Workers"||typeof EdgeRuntime<"u"&&EdgeRuntime==="vercel"}var USER_AGENT;(typeof navigator>"u"||!navigator.userAgent?.startsWith?.("Mozilla/5.0 "))&&(USER_AGENT="jose/v6.2.14");var customFetch=Symbol();async function fetchJwks(url,headers,signal,fetchImpl=fetch){let response=await fetchImpl(url,{method:"GET",signal,redirect:"manual",headers}).catch(err=>{throw err.name==="TimeoutError"?new JWKSTimeout(void 0,{cause:err}):err});if(response.status!==200)throw new JOSEError("Expected 200 OK from the JSON Web Key Set HTTP response");try{return await response.json()}catch(cause){throw new JOSEError("Failed to parse the JSON Web Key Set HTTP response as JSON",{cause})}}var jwksCache=Symbol();function isFreshFor(timestamp,duration){return Number.isFinite(timestamp)&&Date.now()<timestamp+duration}function validateDuration(value,fallback,option){if(Number.isNaN(value))throw new TypeError(`"${option}" option must not be NaN`);return typeof value=="number"?value:fallback}function createRemoteJWKSet(url,options){if(!(url instanceof URL))throw new TypeError("url must be an instance of URL");let href=new URL(url.href).href,opts=options??{},timeoutOption=opts.timeoutDuration;if(typeof timeoutOption=="number"&&(!Number.isInteger(timeoutOption)||timeoutOption<0))throw new TypeError('"timeoutDuration" option must be a non-negative integer');let timeoutDuration=typeof timeoutOption=="number"?timeoutOption:5e3,cooldownDuration=validateDuration(opts.cooldownDuration,3e4,"cooldownDuration"),cacheMaxAge=validateDuration(opts.cacheMaxAge,6e5,"cacheMaxAge"),headers=new Headers(opts.headers);USER_AGENT&&!headers.has("User-Agent")&&headers.set("User-Agent",USER_AGENT),headers.has("accept")||headers.set("accept","application/json, application/jwk-set+json");let fetchImpl=opts[customFetch],cache2=opts[jwksCache],jwksTimestamp,pendingFetch,reloadSequence=0,appliedSequence=0,local;if(cache2&&typeof cache2=="object"){let{uat,jwks}=cache2;isFreshFor(uat,cacheMaxAge)&&isJwkSet(jwks)&&(jwksTimestamp=uat,local=createLocalJWKSet(jwks))}let reload=async()=>{if(pendingFetch&&isCloudflareWorkers()&&(pendingFetch=void 0),!pendingFetch){let sequence=++reloadSequence,current=pendingFetch=fetchJwks(href,headers,AbortSignal.timeout(timeoutDuration),fetchImpl).then(json=>{let next=createLocalJWKSet(json);if(sequence<=appliedSequence)return;local=next;let updatedAt=Date.now();cache2&&(cache2.uat=updatedAt,cache2.jwks=json),jwksTimestamp=updatedAt,appliedSequence=sequence}).finally(()=>{pendingFetch===current&&(pendingFetch=void 0)})}await pendingFetch};return Object.defineProperties(async(protectedHeader,token)=>{(!local||!isFreshFor(jwksTimestamp,cacheMaxAge))&&await reload();try{return await local(protectedHeader,token)}catch(err){if(err instanceof JWKSNoMatchingKey&&!isFreshFor(jwksTimestamp,cooldownDuration))return await reload(),local(protectedHeader,token);throw err}},{coolingDown:{get:()=>isFreshFor(jwksTimestamp,cooldownDuration),enumerable:!0},fresh:{get:()=>isFreshFor(jwksTimestamp,cacheMaxAge),enumerable:!0},reload:{value:reload,enumerable:!0},reloading:{get:()=>!!pendingFetch,enumerable:!0},jwks:{value:()=>local?.jwks(),enumerable:!0}})}function decodeJwt(jwt){if(typeof jwt!="string")throw new JWTInvalid("JWTs must use Compact JWS serialization, JWT must be a string");let{1:encodedPayload,length}=jwt.split(".");if(length===5)throw new JWTInvalid("Only JWTs using Compact JWS serialization can be decoded");if(length!==3)throw new JWTInvalid("Invalid JWT");if(!encodedPayload)throw new JWTInvalid("JWTs must contain a payload");let claimsSetBytes;try{claimsSetBytes=decode(encodedPayload)}catch(cause){throw new JWTInvalid("Failed to base64url decode the payload",{cause})}let claimsSet;try{claimsSet=JSON.parse(strictDecoder.decode(claimsSetBytes))}catch(cause){throw new JWTInvalid("Failed to parse the decoded payload as JSON",{cause})}if(!isObject(claimsSet))throw new JWTInvalid("Invalid JWT Claims Set");return claimsSet}export{PERMISSIONS,InvalidCan,parsePattern,compileAccess,FULL_ACCESS,canText,parseCan,explainGrants,VERCEL_ISSUER,issuerName,subFits,trustedIssuers,DEFAULT_CAN,privateHost,verifiedIssuers,grantIssuers,createAuthority,TOKENS,namesByLogin,markVerified,verifiesTokens,fromTokens,hostPrincipal,jwtVerify,createRemoteJWKSet,decodeJwt};
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
import { createRequire as __createRequire } from 'node:module';
|
|
2
|
-
import { fileURLToPath as __fileURLToPath } from 'node:url';
|
|
3
|
-
import { dirname as __dirname_ } from 'node:path';
|
|
4
|
-
const require = __createRequire(import.meta.url);
|
|
5
|
-
const __filename = __fileURLToPath(import.meta.url);
|
|
6
|
-
const __dirname = __dirname_(__filename);
|
|
7
|
-
import{VERCEL_DIR,VERCEL_DIR_PROJECT,require_lib}from"./chunk-Z2KANBOU.js";import{require_dist}from"./chunk-MCYG7CCE.js";import{__toESM}from"./chunk-BZENIQ7N.js";var import_fs_extra=__toESM(require_lib(),1);import{join}from"path";var import_error_utils=__toESM(require_dist(),1);async function writeProjectSettings(cwd,project,org,isRepoLinked){let analyticsId;project.analytics?.id&&(!project.analytics.disabledAt||project.analytics.enabledAt&&project.analytics.enabledAt>project.analytics.disabledAt)&&(analyticsId=project.analytics.id);let projectLinkAndSettings={projectId:isRepoLinked?void 0:project.id,orgId:isRepoLinked?void 0:org.id,projectName:isRepoLinked?void 0:project.name,settings:{createdAt:project.createdAt,framework:project.framework,devCommand:project.devCommand,installCommand:project.installCommand,buildCommand:project.buildCommand,outputDirectory:project.outputDirectory,rootDirectory:project.rootDirectory,directoryListing:project.directoryListing,nodeVersion:project.nodeVersion,vercelFlags:project.vercelFlags,analyticsId}},path=join(cwd,VERCEL_DIR,VERCEL_DIR_PROJECT);return await(0,import_fs_extra.outputJSON)(path,projectLinkAndSettings,{spaces:2})}async function readProjectSettings(vercelDir){try{return JSON.parse(await(0,import_fs_extra.readFile)(join(vercelDir,VERCEL_DIR_PROJECT),"utf8"))}catch(err){if((0,import_error_utils.isErrnoException)(err)&&err.code&&["ENOENT","ENOTDIR"].includes(err.code)||(0,import_error_utils.isError)(err)&&err.name==="SyntaxError")return null;throw err}}function pickOverrides(vercelConfig){let overrides={};for(let prop of["buildCommand","devCommand","framework","ignoreCommand","installCommand","outputDirectory"])typeof vercelConfig[prop]<"u"&&(prop==="ignoreCommand"?overrides.commandForIgnoringBuildStep=vercelConfig[prop]:overrides[prop]=vercelConfig[prop]);return overrides}export{writeProjectSettings,readProjectSettings,pickOverrides};
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
import { createRequire as __createRequire } from 'node:module';
|
|
2
|
-
import { fileURLToPath as __fileURLToPath } from 'node:url';
|
|
3
|
-
import { dirname as __dirname_ } from 'node:path';
|
|
4
|
-
const require = __createRequire(import.meta.url);
|
|
5
|
-
const __filename = __fileURLToPath(import.meta.url);
|
|
6
|
-
const __dirname = __dirname_(__filename);
|
|
7
|
-
import{getOrCreateDeploymentProtectionToken}from"./chunk-6GE4V7MW.js";import{getProtectionForProductionDomain,readEnabledProtection}from"./chunk-B7GCRM5I.js";import{ensureLink}from"./chunk-SXW2G4WD.js";import{toHost}from"./chunk-NBTFAXL4.js";import{getTeams}from"./chunk-DOMBKOLJ.js";import{curlCommand}from"./chunk-XR2J7PQN.js";import{printError}from"./chunk-33HVDSWP.js";import{help}from"./chunk-5KSBRQI2.js";import{detectExplicitScope,getScope}from"./chunk-NLK7NGVP.js";import{TelemetryClient}from"./chunk-KDCODXVL.js";import{getLinkedProject,getUser,introspectToken,resolveAppFromToken}from"./chunk-Z2KANBOU.js";import{getGlobalPathConfig}from"./chunk-UG3FZ5Q7.js";import{parseArguments}from"./chunk-CINNNQDJ.js";import{InvalidToken,isAPIError}from"./chunk-GOI2VVI7.js";import{cmd,getCommandName}from"./chunk-B4KA3ZH2.js";import{output_manager_default}from"./chunk-AP6DZGTK.js";import{require_dist}from"./chunk-MCYG7CCE.js";import{getFlagsSpecification}from"./chunk-CFJBDBYH.js";import{require_source}from"./chunk-NB2WLB3J.js";import{__toESM}from"./chunk-BZENIQ7N.js";import{spawn as spawn2}from"child_process";var SECRET_HEADER=/^((?:x-vercel-protection-bypass|cookie):\s*).+$/i,redactSecretHeader=arg=>arg.replace(SECRET_HEADER,"$1[REDACTED]"),requoteArgs=arg=>arg.includes(" ")?arg.includes('"')?`'${arg}'`:`"${arg}"`:arg;var CurlTelemetryClient=class extends TelemetryClient{trackCliArgumentPath(path){if(path){let value=path.startsWith("/")?"slash":"no-slash";this.trackCliArgument({arg:"path",value})}}trackCliOptionDeployment(deploymentId){if(deploymentId){let value=deploymentId.startsWith("http://")||deploymentId.startsWith("https://")?"url":deploymentId.startsWith("dpl_")?"dpl_":"no-prefix";this.trackCliOption({option:"deployment",value})}}trackCliOptionProtectionBypass(secret){secret&&this.trackCliOption({option:"protection-bypass",value:this.redactedValue})}trackCliFlagYes(yes){yes&&this.trackCliFlag("yes")}trackCliFlagTrace(trace2){trace2&&this.trackCliFlag("trace")}trackCliFlagJson(json){json&&this.trackCliFlag("json")}trackCliFlagYesOnProduction(value){value&&this.trackCliFlag("yes-on-production")}};var import_chalk=__toESM(require_source(),1),import_error_utils=__toESM(require_dist(),1);async function getDeploymentAccounts(client){if(detectExplicitScope(client))return client.config.currentTeam?[client.config.currentTeam]:[];let currentTeam=client.config.currentTeam;try{return(await getTeams(client)).filter(team=>!team.limited).map(team=>team.id).sort((a,b)=>+(b===currentTeam)-+(a===currentTeam))}catch(err){if(!(err instanceof InvalidToken))throw err;let token=await introspectToken(client).catch(()=>null);if(token&&resolveAppFromToken(token))return token.team?[token.team.id]:[];if(currentTeam)return[currentTeam];throw err}}async function resolveDeployment(client,selector,accountId){let hostOrId=selector.includes(".")?toHost(selector):selector,endpoint=`/v13/deployments/${encodeURIComponent(hostOrId)}`,lookup=async accountId2=>{try{let deployment2=await client.fetch(endpoint,{useCurrentTeam:!1,...accountId2?{accountId:accountId2}:{},bailOn429:!0});return deployment2?{...deployment2,ownerId:deployment2.ownerId??deployment2.team?.id}:null}catch(err){if(!isAPIError(err)||err.status!==403&&err.status!==404)throw err;return output_manager_default.debug(`Deployment lookup failed for ${hostOrId}: ${err}`),null}};if(accountId||detectExplicitScope(client))return lookup(accountId??client.config.currentTeam);let deployment=await lookup();if(deployment?.projectId&&deployment.ownerId)return deployment;let accounts;try{accounts=await getDeploymentAccounts(client)}catch(err){if(deployment?.url)return deployment;throw err}for(let account of accounts){let scoped=await lookup(account);if(scoped?.projectId&&scoped.ownerId)return scoped;deployment??=scoped}return deployment}async function getDeploymentUrlById(client,deploymentIdOrUrl,accountId){try{if(deploymentIdOrUrl.startsWith("http://")||deploymentIdOrUrl.startsWith("https://"))try{return new URL(deploymentIdOrUrl).origin}catch{return output_manager_default.debug(`Invalid deployment URL provided: ${deploymentIdOrUrl}`),null}if(deploymentIdOrUrl.includes("vercel.app"))return`https://${deploymentIdOrUrl}`;let fullDeploymentId=deploymentIdOrUrl;fullDeploymentId.startsWith("dpl_")||(fullDeploymentId=`dpl_${deploymentIdOrUrl}`);let deployment=await resolveDeployment(client,fullDeploymentId,accountId);return!deployment||!deployment.url?null:`https://${deployment.url}`}catch(error){return output_manager_default.debug(`Failed to fetch deployment by ID: ${error}`),null}}function looksLikeHostname(path){let firstSegment=path.split("/")[0];return firstSegment.includes(".")&&!firstSegment.startsWith(".")}function orgFromOwner(id,slug=id){return{type:id.startsWith("team_")?"team":"user",id,slug}}var VC_STRING_FLAGS=new Set(["--deployment","--protection-bypass"]),VC_IGNORED_STRING_FLAGS=new Set(["--scope","--team"]),VC_IGNORED_BOOLEAN_FLAGS=new Set(["--debug"]),VC_BOOLEAN_FLAGS=new Set(["--yes","--help","--trace","--json"]);function flagName(arg){let eqIdx=arg.indexOf("=");return eqIdx===-1?arg:arg.slice(0,eqIdx)}function flagValue(args,index){let arg=args[index],eqIdx=arg.indexOf("=");if(eqIdx!==-1)return arg.slice(eqIdx+1);let next=args[index+1];return next&&!next.startsWith("-")?next:void 0}function getCurlLikeArgs(rawArgs,commandName){if(rawArgs[0]===commandName)return rawArgs.slice(1);let commandIndex=0;for(;commandIndex<rawArgs.length;){let arg=rawArgs[commandIndex];if(VC_IGNORED_BOOLEAN_FLAGS.has(flagName(arg))){commandIndex++;continue}if(!VC_IGNORED_STRING_FLAGS.has(flagName(arg)))break;commandIndex++,!arg.includes("=")&&commandIndex<rawArgs.length&&commandIndex++}return rawArgs[commandIndex]===commandName?rawArgs.slice(commandIndex+1):[...rawArgs]}function parseCurlLikeArgs(rawArgs,commandName){let result={target:void 0,deployment:void 0,protectionBypass:void 0,yes:!1,help:!1,trace:!1,json:!1,toolFlags:[]},args=getCurlLikeArgs(rawArgs,commandName),separatorIndex=args.indexOf("--"),beforeSeparator=separatorIndex===-1?args:args.slice(0,separatorIndex),afterSeparator=separatorIndex===-1?[]:args.slice(separatorIndex+1);for(let i=0;i<beforeSeparator.length;i++){let arg=beforeSeparator[i],name=flagName(arg);if(VC_STRING_FLAGS.has(name)){let value=flagValue(beforeSeparator,i);!arg.includes("=")&&value!==void 0&&i++,name==="--deployment"?result.deployment=value:result.protectionBypass=value;continue}if(!VC_IGNORED_BOOLEAN_FLAGS.has(name)){if(VC_IGNORED_STRING_FLAGS.has(name)){let value=flagValue(beforeSeparator,i);!arg.includes("=")&&value!==void 0&&i++;continue}if(VC_BOOLEAN_FLAGS.has(name)){name==="--yes"?result.yes=!0:name==="--trace"?result.trace=!0:name==="--json"?result.json=!0:result.help=!0;continue}if(!result.target&&name==="--url"){let value=flagValue(beforeSeparator,i);!arg.includes("=")&&value!==void 0&&i++,result.target=value;continue}!result.target&&!arg.startsWith("-")?result.target=arg:result.toolFlags.push(arg)}}return result.toolFlags.push(...afterSeparator),result}function setupCurlLikeCommand(client,command,telemetryClient,options={}){let{print}=output_manager_default;if(options.allowFullUrl){let parsed=parseCurlLikeArgs(options.args??client.argv.slice(2),command.name);if(parsed.help)return print(help(command,{stream:client.stderr,columns:client.stderr.columns})),0;let path2=parsed.target;if(telemetryClient.trackCliArgumentPath(path2),parsed.deployment&&telemetryClient.trackCliOptionDeployment(parsed.deployment),parsed.protectionBypass&&telemetryClient.trackCliOptionProtectionBypass(parsed.protectionBypass),!path2)return output_manager_default.error(`${getCommandName(`${command.name} <url|path>`)} requires a URL or API path (e.g., 'https://example.vercel.app/api/hello' or '/api/hello')`),print(help(command,{stream:client.stderr,columns:client.stderr.columns})),2;let isFullUrl2=path2.startsWith("http://")||path2.startsWith("https://");return!isFullUrl2&&looksLikeHostname(path2)&&(isFullUrl2=!0),output_manager_default.debug(`${command.name} options (${parsed.toolFlags.length} args): ${JSON.stringify(parsed.toolFlags)}`),{path:isFullUrl2&&!path2.startsWith("http")?`https://${path2}`:path2,isFullUrl:isFullUrl2,deploymentFlag:parsed.deployment,protectionBypassFlag:parsed.protectionBypass,toolFlags:parsed.toolFlags,yes:parsed.yes,trace:parsed.trace,json:parsed.json}}let parsedArgs=null,flagsSpecification=getFlagsSpecification(command.options);try{parsedArgs=parseArguments(client.argv.slice(2),flagsSpecification)}catch(err){return printError(err),2}let{flags}=parsedArgs;if(parsedArgs.flags["--help"])return print(help(command,{stream:client.stderr,columns:client.stderr.columns})),0;parsedArgs.args[0]===command.name&&parsedArgs.args.shift();let separatorIndex=process.argv.indexOf("--"),path=parsedArgs.args[0];telemetryClient.trackCliArgumentPath(path);let deploymentFlag=flags["--deployment"];deploymentFlag&&telemetryClient.trackCliOptionDeployment(deploymentFlag);let protectionBypassFlag=flags["--protection-bypass"];if(protectionBypassFlag&&telemetryClient.trackCliOptionProtectionBypass(protectionBypassFlag),!path||path==="--"||path.startsWith("-"))return options.allowFullUrl?output_manager_default.error(`${getCommandName(`${command.name} <url|path>`)} requires a URL or API path (e.g., 'https://example.vercel.app/api/hello' or '/api/hello')`):output_manager_default.error(`${getCommandName(`${command.name} <path>`)} requires an API path (e.g., '/' or '/api/hello' or 'api/hello')`),print(help(command,{stream:client.stderr,columns:client.stderr.columns})),1;let isFullUrl=path.startsWith("http://")||path.startsWith("https://");if(!isFullUrl&&looksLikeHostname(path)&&(isFullUrl=!0),isFullUrl&&!options.allowFullUrl)return output_manager_default.error("The <path> argument must be a relative API path (e.g., '/' or '/api/hello'), not a full URL."),output_manager_default.print("To target a specific deployment within the currently linked project, use the --deployment <id|url> option."),print(help(command,{stream:client.stderr,columns:client.stderr.columns})),1;let toolFlags=separatorIndex!==-1?process.argv.slice(separatorIndex+1):[];return output_manager_default.debug(`${command.name} options (${toolFlags.length} args): ${JSON.stringify(toolFlags)}`),{path:isFullUrl&&!path.startsWith("http")?`https://${path}`:path,isFullUrl,deploymentFlag,protectionBypassFlag,toolFlags,yes:!!flags["--yes"],trace:!!flags["--trace"],json:!!flags["--json"]}}async function resolveProjectFromUrl(client,url){let host=toHost(url);try{let deployment=await resolveDeployment(client,host);if(deployment){let link=await linkFromDeployment(client,deployment);if(link)return link}}catch(err){if(output_manager_default.debug(`Deployment lookup failed for ${host}: ${err}`),isAPIError(err)&&err.status===429)return null}try{let aliasUrl=`/now/aliases/${encodeURIComponent(host)}`;try{let alias=await client.fetch(aliasUrl,{useCurrentTeam:!1,...detectExplicitScope(client)?{accountId:client.config.currentTeam}:{}});if(alias.projectId&&alias.ownerId)return{status:"linked",project:await client.fetch(`/v9/projects/${encodeURIComponent(alias.projectId)}`,{accountId:alias.ownerId}),org:orgFromOwner(alias.ownerId)}}catch(err){output_manager_default.debug(`User alias lookup failed for ${host}: ${err}`)}for(let accountId of await getDeploymentAccounts(client))try{let alias=await client.fetch(aliasUrl,{accountId}),projectId=alias.projectId,ownerId=alias.ownerId||accountId;if(projectId)return{status:"linked",project:await client.fetch(`/v9/projects/${encodeURIComponent(projectId)}`,{accountId:ownerId}),org:orgFromOwner(ownerId)}}catch(err){output_manager_default.debug(`Alias lookup failed for ${host} in ${accountId}: ${err}`)}}catch(err){output_manager_default.debug(`Team lookup failed for ${host}: ${err}`)}return null}async function getFullUrlAndToken(client,fullUrl,protectionBypassFlag){if(protectionBypassFlag)return{fullUrl,deploymentProtectionToken:protectionBypassFlag,link:null};if(process.env.VERCEL_AUTOMATION_BYPASS_SECRET)return output_manager_default.debug("Using protection bypass secret from environment variable"),{fullUrl,deploymentProtectionToken:process.env.VERCEL_AUTOMATION_BYPASS_SECRET,link:null};let link=await resolveProjectFromUrl(client,fullUrl),deploymentProtectionToken=null;if(link)try{deploymentProtectionToken=await getOrCreateDeploymentProtectionToken(client,link,{readinessUrl:fullUrl})}catch(err){output_manager_default.debug(`Failed to get deployment protection bypass token: ${err}`)}return{fullUrl,deploymentProtectionToken,link}}async function linkFromDeployment(client,deployment){return!deployment.projectId||!deployment.ownerId?null:{status:"linked",project:await client.fetch(`/v9/projects/${encodeURIComponent(deployment.projectId)}`,{accountId:deployment.ownerId}),org:orgFromOwner(deployment.ownerId)}}async function resolveTargetProject(client,deployment,deploymentFlag){try{let link=await linkFromDeployment(client,deployment);return link||output_manager_default.warn(`Deployment "${deploymentFlag}" is missing project metadata; proceeding without an automatic protection bypass token.`),link}catch(err){return output_manager_default.debug(`Failed to resolve deployment project: ${err}`),output_manager_default.warn(`Failed to load project for deployment "${deploymentFlag}"; proceeding without an automatic protection bypass token.`),null}}async function tryGetDeployment(client,selector){try{return await resolveDeployment(client,selector)}catch(err){return output_manager_default.debug(`Failed to resolve deployment: ${err}`),null}}async function tryLinkFromSelector(client,selector){try{let deployment=await resolveDeployment(client,selector);return deployment?await linkFromDeployment(client,deployment):null}catch(err){return output_manager_default.debug(`Failed to resolve trace project context: ${err}`),null}}async function getLinkedProjectOrNull(client){try{let linked=await getLinkedProject(client,{cwd:client.cwd});return linked.status==="linked"?linked:null}catch(err){return output_manager_default.debug(`Failed to load linked project: ${err}`),null}}function hasAutomationBypassToken(project){return Object.values(project.protectionBypass??{}).some(token=>token.scope==="automation-bypass")}async function getDeploymentUrlAndToken(client,commandName,path,options){let{deploymentFlag,protectionBypassFlag,autoConfirm,resolveProjectForTrace}=options,suppliedProtectionBypass=deploymentFlag?protectionBypassFlag??(process.env.VERCEL_AUTOMATION_BYPASS_SECRET||void 0):protectionBypassFlag,link=null,createProtectionBypassIfMissing=!deploymentFlag,baseUrl;if(deploymentFlag){let requestedBaseUrl=deploymentFlag.startsWith("http://")||deploymentFlag.startsWith("https://")||deploymentFlag.includes("vercel.app")?await getDeploymentUrlById(client,deploymentFlag):null,deploymentSelector=deploymentFlag.includes(".")||deploymentFlag.startsWith("dpl_")?deploymentFlag:`dpl_${deploymentFlag}`;if(suppliedProtectionBypass!==void 0){if(baseUrl=requestedBaseUrl??await getDeploymentUrlById(client,deploymentFlag)??"",!baseUrl)return output_manager_default.error(`No deployment found for ID "${deploymentFlag}"`),1;resolveProjectForTrace&&(link=await tryLinkFromSelector(client,deploymentSelector)??await getLinkedProjectOrNull(client))}else{let deployment=await tryGetDeployment(client,deploymentSelector);if(baseUrl=requestedBaseUrl??(deployment?.url?`https://${deployment.url}`:""),!baseUrl)return output_manager_default.error(`No deployment found for ID "${deploymentFlag}"`),1;deployment?(link=await resolveTargetProject(client,deployment,deploymentFlag),link&&!hasAutomationBypassToken(link.project)&&(createProtectionBypassIfMissing=(await getLinkedProjectOrNull(client))?.project.id===link.project.id)):output_manager_default.warn(`Could not resolve project information for deployment "${deploymentFlag}"; proceeding without an automatic protection bypass token.`)}}else{try{await getScope(client)}catch(err){if((0,import_error_utils.isErrnoException)(err)&&(err.code==="NOT_AUTHORIZED"||err.code==="TEAM_DELETED"))return output_manager_default.error(err.message),1;throw err}let ensuredLink;try{ensuredLink=await ensureLink(commandName,client,client.cwd,{autoConfirm})}catch(err){if((0,import_error_utils.isErrnoException)(err)&&err.code==="NOT_AUTHORIZED")return output_manager_default.error(err.message),1;throw err}if(typeof ensuredLink=="number")return ensuredLink;link=ensuredLink;let{project}=ensuredLink;if(!project.targets&&!project.latestDeployments){let linkedProject=await getLinkedProject(client,{cwd:client.cwd});if(linkedProject.status!=="linked")return output_manager_default.error("This command requires a linked project. Please run:"),output_manager_default.print(" vercel link"),1;if(!linkedProject.project||!linkedProject.org)return output_manager_default.error("Failed to get project information"),1;project=linkedProject.project}let preferredAlias=project.targets?.production?.alias?.[0],backupAlias=project.latestDeployments?.[0]?.url,target=preferredAlias||backupAlias;if(!target)throw new Error("No deployment URL found for the project");baseUrl=`https://${target}`}let fullUrl=`${baseUrl}${path.startsWith("/")?path:`/${path}`}`;output_manager_default.debug(`${import_chalk.default.cyan("Target URL:")} ${import_chalk.default.bold(fullUrl)}`);let deploymentProtectionToken=suppliedProtectionBypass??null;if(suppliedProtectionBypass===void 0&&link?.project.id)try{deploymentProtectionToken=await getOrCreateDeploymentProtectionToken(client,link,{createIfMissing:createProtectionBypassIfMissing,readinessUrl:fullUrl})}catch(err){return output_manager_default.error(`Failed to get deployment protection bypass token: ${err instanceof Error?err.message:String(err)}`),1}return{fullUrl,deploymentProtectionToken,link}}function traceCurl(root){let span=root?.child("vc.cli.curl"),finished=!1;return code=>{finished||(finished=!0,code!==0&&span?.setAttributes({error:"true"}),span?.stop())}}var import_error_utils2=__toESM(require_dist(),1);import{spawn}from"child_process";import{tmpdir}from"os";import{join as join2}from"path";import{mkdtemp,readFile as readFile2,rm}from"fs/promises";async function confirmProduction(client,{deploymentTarget,yes,isTTY}){return deploymentTarget!=="production"||yes?"proceed":isTTY?await client.input.confirm("You are about to capture a trace against a production deployment. Continue?",!1)?"proceed":"declined":(output_manager_default.error("Use --yes to capture traces on production from non-interactive contexts."),"non-tty-no-yes")}import{createHash}from"crypto";import{chmod,mkdir,readFile,unlink,writeFile}from"fs/promises";import{dirname,join}from"path";var FALLBACK_TTL_MS=5*60*1e3,EXPIRY_BUFFER_MS=30*1e3,CACHE_SCHEMA_VERSION=1;function resolveCacheDir(override){return override||join(getGlobalPathConfig(),"cache","traces")}function cacheFilename(teamId,host){let key=`${teamId??""}:${host}`;return`${createHash("sha256").update(key).digest("hex")}.json`}function cachePath(cacheDir,teamId,host){return join(cacheDir,cacheFilename(teamId,host))}async function readCache(path){let raw;try{raw=await readFile(path,"utf8")}catch{return null}try{let parsed=JSON.parse(raw);return!parsed||typeof parsed.token!="string"||typeof parsed.expiresAt!="number"||parsed.schemaVersion!==CACHE_SCHEMA_VERSION?null:parsed}catch{return output_manager_default.debug(`Trace cookie cache file is corrupt at ${path}; re-issuing.`),null}}async function writeCache(path,entry){await mkdir(dirname(path),{recursive:!0}),await writeFile(path,JSON.stringify(entry),{mode:384}),await chmod(path,384)}async function issueToken(client,{teamId,projectId,hostname}){let body=JSON.stringify({projectId,hostname}),response=await client.fetch("/v1/projects/traces/session",{method:"POST",body,headers:{"Content-Type":"application/json"},accountId:teamId});if(!response?.token)throw new Error("Trace session response is missing a token");let expiresAt=typeof response.expiresAt=="number"?response.expiresAt:Date.now()+FALLBACK_TTL_MS;return{token:response.token,expiresAt}}async function getTraceSessionToken({client,teamId,projectId,host,evictedToken,cacheDir}){let dir=resolveCacheDir(cacheDir),hostname=toHost(host),path=cachePath(dir,teamId,hostname),cached=await readCache(path);if(cached&&evictedToken&&cached.token===evictedToken)await unlink(path).catch(()=>{});else if(cached&&Date.now()<cached.expiresAt-EXPIRY_BUFFER_MS)return{token:cached.token,expiresAt:cached.expiresAt,fromCache:!0};let issued=await issueToken(client,{teamId,projectId,hostname});try{await writeCache(path,{token:issued.token,expiresAt:issued.expiresAt,schemaVersion:CACHE_SCHEMA_VERSION})}catch(err){output_manager_default.debug(`Failed to write trace cookie cache: ${err}`)}return{token:issued.token,expiresAt:issued.expiresAt,fromCache:!1}}var TRACE_COOKIE_NAME="_vercel_tracing",SESSION_COOKIE_NAME="_vercel_session";async function lookupDeployment(client,fullUrl,accountId){let deployment=await resolveDeployment(client,fullUrl,accountId);if(!deployment)throw new Error("Deployment not found");return deployment}function resolveTeamId(link,deployment){if(link?.org.type==="team")return link.org.id;if(deployment.ownerId?.startsWith("team_"))return deployment.ownerId}function extractVercelId(headerDump){let lines=headerDump.split(/\r?\n/),lastValue;for(let line of lines){let idx=line.indexOf(":");if(idx===-1)continue;line.slice(0,idx).trim().toLowerCase()==="x-vercel-id"&&(lastValue=line.slice(idx+1).trim())}if(!lastValue)return;let sepIdx=lastValue.lastIndexOf("::");return sepIdx===-1?lastValue:lastValue.slice(sepIdx+2)}function extractFinalStatus(headerDump){let lines=headerDump.split(/\r?\n/),lastStatus;for(let line of lines){let match=line.match(/^HTTP\/[\d.]+\s+(\d{3})/);match&&(lastStatus=Number(match[1]))}return lastStatus}async function runCurlAndCaptureHeaders(client,curlFlags,json){let tmpDir=await mkdtemp(join2(tmpdir(),"vc-curl-trace-")),headerFile=join2(tmpDir,"headers"),flags=["--dump-header",headerFile,...curlFlags];try{let{exitCode,capturedBody}=await new Promise(resolve=>{let finishTrace=traceCurl(client.telemetryEventStore.enabled?client.rootSpan:void 0),child=spawn("curl",flags,{stdio:json?["inherit","pipe","inherit"]:"inherit",shell:!1}),buf="";json&&child.stdout&&(child.stdout.setEncoding("utf8"),child.stdout.on("data",chunk=>{buf+=chunk})),child.on("error",err=>{finishTrace(1),err.code==="ENOENT"?output_manager_default.error("curl command not found. Please install curl."):output_manager_default.error(`Failed to execute curl: ${err.message}`),resolve({exitCode:1,capturedBody:buf})}),child.on("close",code=>{finishTrace(code),resolve({exitCode:code??1,capturedBody:buf})})}),headerDump="";try{headerDump=await readFile2(headerFile,"utf8")}catch(err){output_manager_default.debug(`Failed to read curl header dump: ${err}`)}return{exitCode,headerDump,capturedBody}}finally{await rm(tmpDir,{recursive:!0,force:!0}).catch(()=>{})}}async function trace(client,{fullUrl,link,curlFlags,json,yes,telemetry}){telemetry.trackCliFlagTrace(!0),json&&telemetry.trackCliFlagJson(!0);let accountId=link?.org.id,deployment;try{deployment=await lookupDeployment(client,fullUrl,accountId)}catch(err){return output_manager_default.error(`Failed to look up deployment for tracing: ${err instanceof Error?err.message:String(err)}`),1}let projectId=link?.project.id??deployment.projectId;if(!projectId)return output_manager_default.error("Could not resolve project for trace session. Run `vercel link` and retry."),1;let teamId=resolveTeamId(link,deployment),userId;try{userId=client.authConfig.userId??(await getUser(client)).id}catch(err){return output_manager_default.error(`Failed to resolve user for trace session: ${(0,import_error_utils2.errorToString)(err)}`),1}let deploymentTarget=deployment.target==="production"?"production":"preview",confirmation=await confirmProduction(client,{deploymentTarget,yes,isTTY:!!client.stdin.isTTY});if(confirmation==="non-tty-no-yes")return 1;if(confirmation==="declined")return output_manager_default.log("Trace cancelled."),0;deploymentTarget==="production"&&yes&&telemetry.trackCliFlagYesOnProduction(!0);let session;try{session=await getTraceSessionToken({client,teamId,projectId,host:fullUrl})}catch(err){return output_manager_default.error(`Failed to acquire trace session: ${err instanceof Error?err.message:String(err)}`),1}let{exitCode,headerDump,capturedBody}=await runCurlWithCookie(client,session.token,userId,curlFlags,json);if(session.fromCache&&extractFinalStatus(headerDump)===401&&exitCode===0){output_manager_default.debug("Trace cookie returned 401; evicting cache and retrying.");let refreshed;try{refreshed=await getTraceSessionToken({client,teamId,projectId,host:fullUrl,evictedToken:session.token})}catch(err){return output_manager_default.error(`Failed to refresh trace session after 401: ${err instanceof Error?err.message:String(err)}`),1}({exitCode,headerDump,capturedBody}=await runCurlWithCookie(client,refreshed.token,userId,curlFlags,json))}let requestId=extractVercelId(headerDump);return json?(client.stdout.write(`${JSON.stringify({response:capturedBody,requestId:requestId??null},null,2)}
|
|
8
|
-
`),requestId?exitCode:exitCode===0?1:exitCode):requestId?(client.stderr.write(`
|
|
9
|
-
Run \`vercel traces inspect ${requestId}\` to fetch the trace.
|
|
10
|
-
`),exitCode):(output_manager_default.error("Trace cookie was set but the response did not include an x-vercel-id header."),exitCode===0?1:exitCode)}async function runCurlWithCookie(client,token,userId,curlFlags,json){let flagsWithCookie=["--header",`Cookie: ${TRACE_COOKIE_NAME}=${token}; ${SESSION_COOKIE_NAME}=${userId}`,...curlFlags];return output_manager_default.debug(`Executing: curl ${flagsWithCookie.map(redactSecretHeader).map(requoteArgs).join(" ")}`),runCurlAndCaptureHeaders(client,flagsWithCookie,json)}async function curl(client){return runCurl(client,{})}async function runCurl(client,{forceTrace=!1,args}){let telemetryClient=new CurlTelemetryClient({opts:{store:client.telemetryEventStore}}),setup=setupCurlLikeCommand(client,curlCommand,telemetryClient,{allowFullUrl:!0,args});if(typeof setup=="number")return setup;let{path,isFullUrl,deploymentFlag,protectionBypassFlag,toolFlags,json:jsonFlag}=setup,unsupportedFlag=toolFlags.find(escapesRedirectLimit);if(unsupportedFlag)return output_manager_default.error(`${cmd(unsupportedFlag)} is not supported by ${getCommandName("curl")}.`),2;let traceFlag=forceTrace||setup.trace,result=isFullUrl?await getFullUrlAndToken(client,path,protectionBypassFlag):await getDeploymentUrlAndToken(client,"curl",path,{deploymentFlag,protectionBypassFlag,autoConfirm:setup.yes,resolveProjectForTrace:traceFlag});if(typeof result=="number")return result;let{fullUrl,deploymentProtectionToken}=result,curlFlags=[...toolFlags];return deploymentProtectionToken&&(curlFlags.unshift("--header",`x-vercel-protection-bypass: ${deploymentProtectionToken}`),curlFlags.push("--max-redirs","0")),curlFlags.unshift("--url",fullUrl),traceFlag?trace(client,{fullUrl,link:result.link??null,curlFlags,json:jsonFlag,yes:setup.yes,telemetry:telemetryClient}):(output_manager_default.debug(`Executing: curl ${curlFlags.map(redactSecretHeader).map(requoteArgs).join(" ")}`),deploymentProtectionToken&&bypassesProtection(result.link,fullUrl)&&(output_manager_default.warning("This request bypasses Deployment Protection, so its response doesn't show whether the URL is public."),output_manager_default.print(`
|
|
11
|
-
To check public access:
|
|
12
|
-
${cmd(`curl ${shellQuote(fullUrl)}`)}
|
|
13
|
-
`)),new Promise(resolve=>{let finishTrace=traceCurl(client.telemetryEventStore.enabled?client.rootSpan:void 0),curlProcess=spawn2("curl",curlFlags,{stdio:"inherit",shell:!1});curlProcess.on("error",err=>{finishTrace(1),"code"in err&&err.code==="ENOENT"?(output_manager_default.error("curl command not found. Please install curl."),resolve(1)):(output_manager_default.error(`Failed to execute curl: ${err.message}`),resolve(1))}),curlProcess.on("close",code=>{finishTrace(code),resolve(code??1)})}))}function bypassesProtection(link,url){if(!link)return!0;let methods=readEnabledProtection(link.project),productionDomain=link.project.targets?.production?.alias?.[0];return(productionDomain&&toHost(url).toLowerCase()===productionDomain?getProtectionForProductionDomain(methods):methods).length>0}var CURL_SHORT_OPTIONS_WITH_VALUE="EKCbcdDFPHhmoUQreXYytzTuAw";function escapesRedirectLimit(flag){if(flag==="--"||flag==="--next"||flag==="--config")return!0;if(!flag.startsWith("-")||flag.startsWith("--"))return!1;for(let option of flag.slice(1)){if(option===":"||option==="K")return!0;if(CURL_SHORT_OPTIONS_WITH_VALUE.includes(option))return!1}return!1}function shellQuote(value){return/^[\w./:@%+=,-]+$/.test(value)?value:`'${value.replace(/'/g,"'\\''")}'`}export{redactSecretHeader,requoteArgs,setupCurlLikeCommand,getDeploymentUrlAndToken,curl,runCurl};
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
import { createRequire as __createRequire } from 'node:module';
|
|
2
|
-
import { fileURLToPath as __fileURLToPath } from 'node:url';
|
|
3
|
-
import { dirname as __dirname_ } from 'node:path';
|
|
4
|
-
const require = __createRequire(import.meta.url);
|
|
5
|
-
const __filename = __fileURLToPath(import.meta.url);
|
|
6
|
-
const __dirname = __dirname_(__filename);
|
|
7
|
-
import{getNativePackageName}from"./chunk-T7GKQYWA.js";import{HOMEBREW_UPGRADE_COMMAND,execPackageManager,getUpdateCommandInfo,getUpgradePackageManager,isGlobal,packageManagerInvocation,trustedUpgradeDirectory,trustedUpgradeEnvironment}from"./chunk-KQ6X77WP.js";import{require_semver}from"./chunk-BPUANOGW.js";import{withDirectoryLock}from"./chunk-TABMJZVW.js";import{progress}from"./chunk-U56NHYAH.js";import{require_ci_info}from"./chunk-KDCODXVL.js";import{getInstallRoot,isNativeBinaryInstall}from"./chunk-NWGBDBZI.js";import{getCachedUsername,require_lib}from"./chunk-Z2KANBOU.js";import{pkg_default}from"./chunk-BOJDM3O7.js";import{output_manager_default}from"./chunk-AP6DZGTK.js";import{__commonJS,__require,__toESM}from"./chunk-BZENIQ7N.js";var require_lib2=__commonJS({"../../node_modules/.pnpm/os-paths@4.4.0/node_modules/os-paths/src/lib/index.js"(exports,module){"use strict";var os=__require("os"),paths=__require("path"),isWinOS=/^win/i.test(process.platform);function normalize_path(path){return paths.normalize(paths.join(path,"."))}var base=()=>{let{env}=process,object={};return object.home=()=>normalize_path(os.homedir?os.homedir():env.HOME),object.temp=()=>normalize_path(os.tmpdir?os.tmpdir():env.TMPDIR||env.TEMP||env.TMP),object},windows=()=>{let{env}=process,object={};return object.home=()=>normalize_path(os.homedir?os.homedir():env.USERPROFILE||paths.join(env.HOMEDRIVE,env.HOMEPATH)||env.HOME),object.temp=()=>normalize_path(os.tmpdir?os.tmpdir():env.TEMP||env.TMP||paths.join(env.LOCALAPPDATA||env.SystemRoot||env.windir,"Temp")),object},_OSPaths=class __OSPaths{constructor(){let OSPaths=function(){return new __OSPaths};this._fn=OSPaths;let extension=isWinOS?windows():base();return Object.keys(extension).forEach(key=>{this._fn[key]=extension[key]}),this._fn}};module.exports=new _OSPaths}});var require_lib3=__commonJS({"../../node_modules/.pnpm/xdg-portable@7.3.0/node_modules/xdg-portable/src/lib/index.js"(exports,module){"use strict";var path=__require("path"),osPaths=require_lib2(),linux=()=>{let object={};return object.cache=()=>process.env.XDG_CACHE_HOME||path.join(osPaths.home()||osPaths.temp(),".cache"),object.config=()=>process.env.XDG_CONFIG_HOME||path.join(osPaths.home()||osPaths.temp(),".config"),object.data=()=>process.env.XDG_DATA_HOME||path.join(osPaths.home()||osPaths.temp(),".local","share"),object.runtime=()=>process.env.XDG_RUNTIME_DIR||void 0,object.state=()=>process.env.XDG_STATE_HOME||path.join(osPaths.home()||osPaths.temp(),".local","state"),object},macos=()=>{let object={};return object.cache=()=>process.env.XDG_CACHE_HOME||path.join(path.join(osPaths.home()||osPaths.temp(),"Library"),"Caches"),object.config=()=>process.env.XDG_CONFIG_HOME||path.join(path.join(osPaths.home()||osPaths.temp(),"Library"),"Preferences"),object.data=()=>process.env.XDG_DATA_HOME||path.join(path.join(osPaths.home()||osPaths.temp(),"Library"),"Application Support"),object.runtime=()=>process.env.XDG_RUNTIME_DIR||void 0,object.state=()=>process.env.XDG_STATE_HOME||path.join(path.join(osPaths.home()||osPaths.temp(),"Library"),"State"),object},windows=()=>{let object={};return object.cache=()=>{let localAppData=process.env.LOCALAPPDATA||path.join(osPaths.home()||osPaths.temp(),"AppData","Local");return process.env.XDG_CACHE_HOME||path.join(localAppData,"xdg.cache")},object.config=()=>{let appData=process.env.APPDATA||path.join(osPaths.home()||osPaths.temp(),"AppData","Roaming");return process.env.XDG_CONFIG_HOME||path.join(appData,"xdg.config")},object.data=()=>{let appData=process.env.APPDATA||path.join(osPaths.home()||osPaths.temp(),"AppData","Roaming");return process.env.XDG_DATA_HOME||path.join(appData,"xdg.data")},object.runtime=()=>process.env.XDG_RUNTIME_DIR||void 0,object.state=()=>{let localAppData=process.env.LOCALAPPDATA||path.join(osPaths.home()||osPaths.temp(),"AppData","Local");return process.env.XDG_STATE_HOME||path.join(localAppData,"xdg.state")},object},_XDGPortable=()=>{let XDGPortable=function(){return _XDGPortable()},extension={};return/^darwin$/i.test(process.platform)?extension=macos():/^win/i.test(process.platform)?extension=windows():extension=linux(),extension.configDirs=()=>{let dirs=[];return dirs.push(extension.config()),process.env.XDG_CONFIG_DIRS&&dirs.push(...process.env.XDG_CONFIG_DIRS.split(path.delimiter)),dirs},extension.dataDirs=()=>{let dirs=[];return dirs.push(extension.data()),process.env.XDG_DATA_DIRS&&dirs.push(...process.env.XDG_DATA_DIRS.split(path.delimiter)),dirs},Object.keys(extension).forEach(key=>{XDGPortable[key]=extension[key]}),XDGPortable};module.exports=_XDGPortable()}});var require_xdg_app_paths=__commonJS({"../../node_modules/.pnpm/xdg-app-paths@5.1.0/node_modules/xdg-app-paths/index.js"(exports,module){"use strict";var path=__require("path"),os=__require("os"),xdg=require_lib3(),isWinOS=/^win/i.test(process.platform);function _normalizeOptions(options,isolated){if(options=options||{},typeof options!="object"&&(options={isolated:options}),options.isolated=options.isolated===void 0||options.isolated===null?isolated:options.isolated,typeof options.isolated!="boolean")throw new TypeError(`Expected boolean for "isolated" argument, got ${typeof options.isolated}`);return options}var base=(name,isolated)=>{let object={};return object.cache=(options={isolated:null})=>(options=_normalizeOptions(options,isolated),path.join(xdg.cache(),options.isolated?name:"")),object.config=(options={isolated:null})=>(options=_normalizeOptions(options,isolated),path.join(xdg.config(),options.isolated?name:"")),object.data=(options={isolated:null})=>(options=_normalizeOptions(options,isolated),path.join(xdg.data(),options.isolated?name:"")),object.runtime=(options={isolated:null})=>(options=_normalizeOptions(options,isolated),xdg.runtime()?path.join(xdg.runtime(),options.isolated?name:""):void 0),object.state=(options={isolated:null})=>(options=_normalizeOptions(options,isolated),path.join(xdg.state(),options.isolated?name:"")),object.configDirs=(options={isolated:null})=>(options=_normalizeOptions(options,isolated),xdg.configDirs().map(s=>path.join(s,options.isolated?name:""))),object.dataDirs=(options={isolated:null})=>(options=_normalizeOptions(options,isolated),xdg.dataDirs().map(s=>path.join(s,options.isolated?name:""))),object},windows=(name,isolated)=>{let{env}=process,homedir=os.homedir(),tmpdir=os.tmpdir(),appData=env.APPDATA||path.join(homedir||tmpdir,"AppData","Roaming"),localAppData=env.LOCALAPPDATA||path.join(homedir||tmpdir,"AppData","Local"),object={};return object.cache=(options={isolated:null})=>(options=_normalizeOptions(options,isolated),!options.isolated||env.XDG_CACHE_HOME?path.join(xdg.cache(),options.isolated?name:""):path.join(localAppData,options.isolated?name:"","Cache")),object.config=(options={isolated:null})=>(options=_normalizeOptions(options,isolated),!options.isolated||env.XDG_CONFIG_HOME?path.join(xdg.config(),options.isolated?name:""):path.join(appData,options.isolated?name:"","Config")),object.data=(options={isolated:null})=>(options=_normalizeOptions(options,isolated),!options.isolated||env.XDG_DATA_HOME?path.join(xdg.data(),options.isolated?name:""):path.join(appData,options.isolated?name:"","Data")),object.runtime=(options={isolated:null})=>(options=_normalizeOptions(options,isolated),xdg.runtime()?path.join(xdg.runtime(),options.isolated?name:""):void 0),object.state=(options={isolated:null})=>(options=_normalizeOptions(options,isolated),!options.isolated||env.XDG_STATE_HOME?path.join(xdg.state(),options.isolated?name:""):path.join(localAppData,options.isolated?name:"","State")),object.configDirs=(options={isolated:null})=>{options=_normalizeOptions(options,isolated);let dirs=[object.config(options)];return env.XDG_CONFIG_DIRS&&dirs.push(...env.XDG_CONFIG_DIRS.split(path.delimiter).map(s=>path.join(s,options.isolated?name:""))),dirs},object.dataDirs=(options={isolated:null})=>{options=_normalizeOptions(options,isolated);let dirs=[object.data(options)];return env.XDG_DATA_DIRS&&dirs.push(...env.XDG_DATA_DIRS.split(path.delimiter).map(s=>path.join(s,options.isolated?name:""))),dirs},object},_XDGAppPaths=class __XDGAppPaths{constructor(options={name:null,suffix:null,isolated:!0}){let XDGAppPaths2=function(options2={name:null,suffix:null,isolated:!0}){return new __XDGAppPaths(options2)};this._fn=XDGAppPaths2,options=options||{},typeof options!="object"&&(options={name:options});let name=options.name||"";if(typeof name!="string")throw new TypeError(`Expected string for "name" argument, got ${typeof name}`);let suffix=options.suffix||"";if(typeof suffix!="string")throw new TypeError(`Expected string for "suffix" argument, got ${typeof suffix}`);let isolated=options.isolated===void 0||options.isolated===null?!0:options.isolated;if(typeof isolated!="boolean")throw new TypeError(`Expected boolean for "isolated" argument, got ${typeof isolated}`);name||(name=path.parse(process.pkg?process.execPath:__require.main?__require.main.filename:process.argv[0]).name),suffix&&(name+=suffix),this._fn.$name=()=>name,this._fn.$isolated=()=>isolated;let extension=isWinOS?windows(name,isolated):base(name,isolated);return Object.keys(extension).forEach(key=>{this._fn[key]=extension[key]}),this._fn}};module.exports=new _XDGAppPaths}});var require_fetch_dist_tags=__commonJS({"src/util/get-latest-version/fetch-dist-tags.cjs"(exports,module){"use strict";var https=__require("https");function fetchDistTags(name,options){let timeout=options&&options.timeout||3e3,agent=new https.Agent({keepAlive:!0,maxSockets:15}),headers={accept:"application/vnd.npm.install-v1+json; q=1.0, application/json; q=0.8, */*"},url=`https://registry.npmjs.org/-/package/${name}/dist-tags`;return new Promise(resolve2=>{let timer=setTimeout(()=>{req.destroy(),resolve2(void 0)},timeout),req=https.get(url,{agent,headers},res=>{let buf="";res.on("data",chunk=>{buf+=chunk}),res.on("end",()=>{clearTimeout(timer);try{if(res.statusCode&&res.statusCode>=400){resolve2(void 0);return}resolve2(JSON.parse(buf))}catch{resolve2(void 0)}})});req.on("error",()=>{clearTimeout(timer),resolve2(void 0)})})}module.exports={fetchDistTags}}});function getWhoamiCachedAnswer(args,authConfig){return args.includes("--cached")?getCachedUsername(authConfig):void 0}var import_semver=__toESM(require_semver(),1);import{spawn}from"child_process";function renderUpgradeProgress(current,total,phase){let bar=progress(current,total);output_manager_default.spinner(bar?`Upgrading Vercel CLI [${bar}] (${current}/${total})${phase?` ${phase}`:""}`:phase||"Upgrading Vercel CLI\u2026",0)}function execFileStdout(command,args,cwd,env=trustedUpgradeEnvironment){return execPackageManager(command,args,{cwd,env,timeout:15e3})}function parseVersionOutput(stdout){for(let line of[stdout.trim(),...stdout.trim().split(`
|
|
8
|
-
`).reverse()])try{let value=JSON.parse(line),parsed=Array.isArray(value)&&value.length===1?value[0]:value,version=typeof parsed=="string"?parsed:typeof parsed?.data=="string"?parsed.data:void 0;if(version&&import_semver.default.valid(version))return version}catch{let version=line.trim();if(import_semver.default.valid(version))return version}}async function getLatestPackageVersion(packageManager,installArgs,cwd,global,env,bypassMinReleaseAge=!0){let packageSpecifier=installArgs.find(arg=>arg.endsWith("@latest"));if(!packageSpecifier)return;let manager=getUpgradePackageManager(packageManager),queryArgs=[...manager.metadataArgs(packageSpecifier),...bypassMinReleaseAge?manager.releaseAgeBypassArgs:[]];try{let stdout=await execFileStdout(packageManager,queryArgs,cwd,env);return parseVersionOutput(stdout)}catch(error){output_manager_default.debug(`Failed to resolve the latest Vercel CLI version: ${error instanceof Error?error.message:String(error)}`);return}}async function getInstalledPackageVersion(packageManager,installArgs,cwd,global){let packageSpecifier=installArgs.find(arg=>arg.endsWith("@latest"));if(!packageSpecifier)return;let packageName=packageSpecifier.slice(0,-7);try{let stdout=await execFileStdout(packageManager,["list",packageName,"--depth=0","--json",...global?["--global"]:[]],cwd),parsed=JSON.parse(stdout),projects=Array.isArray(parsed)?parsed:[parsed];for(let project of projects){let version=project?.dependencies?.[packageName]?.version??project?.devDependencies?.[packageName]?.version??project?.optionalDependencies?.[packageName]?.version;if(typeof version=="string"&&import_semver.default.valid(version))return version}}catch(error){output_manager_default.debug(`Failed to read the installed Vercel CLI version: ${error instanceof Error?error.message:String(error)}`)}}function isVersionCurrent(current,latest){return import_semver.default.valid(current)&&import_semver.default.valid(latest)?import_semver.default.gte(current,latest):current===latest}function pinPackageVersion(args,version){return args.map(arg=>arg.endsWith("@latest")?`${arg.slice(0,-6)}${version}`:arg)}async function getMinReleaseAgeContext(packageManager,cwd,global){let setting=packageManager==="pnpm"?"minimumReleaseAge":"min-release-age";try{let raw=(await execFileStdout(packageManager,["config","get",setting,"--json",...global?["--global"]:[]],cwd)).trim(),value=raw===""||raw==="undefined"?void 0:JSON.parse(raw);if(!(value==null||value===""||value==="undefined")){let age=typeof value=="number"||typeof value=="string"&&value.trim()!==""?Number(value):NaN;if(!Number.isFinite(age)||age<0)return`Could not determine ${packageManager}'s configured minimum release age.`;let minutes=packageManager==="pnpm"?age:age*1440,duration=minutes>0&&minutes%60===0?`${minutes/60} ${minutes===60?"hour":"hours"}`:`${minutes} ${minutes===1?"minute":"minutes"}`;return`${packageManager} ${setting} is configured to ${duration}.`}if(packageManager==="pnpm"){let version=parseVersionOutput(await execFileStdout(packageManager,["--version"],cwd));if(version&&!import_semver.default.prerelease(version)&&import_semver.default.gte(version,"11.0.0"))return`pnpm ${version} defaults to a minimum release age of 24 hours (1440 minutes); no explicit minimumReleaseAge setting was reported.`}return`${packageManager} did not report a configured minimum release age.`}catch{return`Could not determine ${packageManager}'s configured minimum release age.`}}function isMinReleaseAgeError(packageManager,stdout,stderr){let installerOutput=`${stdout}
|
|
9
|
-
${stderr}`;return packageManager==="pnpm"?installerOutput.includes("ERR_PNPM_NO_MATURE_MATCHING_VERSION")||installerOutput.includes("ERR_PNPM_NO_MATCHING_VERSION")&&installerOutput.includes("satisfies the specs but was released at"):packageManager==="npm"?/\bETARGET\b/.test(installerOutput)&&installerOutput.includes("with a date before")||/min-release-age cannot be provided/i.test(installerOutput):!1}function setMinReleaseAgeBypass(client,enabled){client.config={...client.config,updates:{...client.config.updates,bypassMinReleaseAge:enabled}},client.writeToConfigFile()}async function executeHomebrewUpgrade(env=trustedUpgradeEnvironment){let[brew,...args]=HOMEBREW_UPGRADE_COMMAND.split(" ");output_manager_default.debug(`Executing: ${HOMEBREW_UPGRADE_COMMAND}`);let result=await new Promise(resolve2=>{let settled=!1,brewProcess=spawn(brew,args,{cwd:trustedUpgradeDirectory,env:{...env},stdio:"inherit",shell:!1});brewProcess.on("error",spawnError=>{settled||(settled=!0,resolve2({code:1,spawnError}))}),brewProcess.on("close",code=>{settled||(settled=!0,resolve2({code:code??1}))})});return result.spawnError?(output_manager_default.error(`Failed to run Homebrew: ${result.spawnError.message}`),output_manager_default.log(`You can try running the command manually: ${HOMEBREW_UPGRADE_COMMAND}`),1):(result.code!==0&&(output_manager_default.error(`Homebrew upgrade failed with exit code ${result.code}`),output_manager_default.log(`You can try running the command manually: ${HOMEBREW_UPGRADE_COMMAND}`)),result.code)}function executeAutomaticUpgrade(client,env=trustedUpgradeEnvironment){return executeUpgrade("latest",client,!1,!0,env,"package-manager")}async function executeUpgrade(targetVersion,client,bypassMinReleaseAge=!1,explicitTarget=!1,env=trustedUpgradeEnvironment,releaseAgePolicy="newest",outcome){let totalSteps=targetVersion?2:3;renderUpgradeProgress(0,totalSteps,"Resolving installer\u2026");let{command:updateCommand,global,packageManager}=await getUpdateCommandInfo(env).catch(error=>{throw output_manager_default.stopSpinner(),error}),[command,...args]=updateCommand.split(" "),cwd=global?trustedUpgradeDirectory:process.cwd(),bypassArgs=getUpgradePackageManager(packageManager).releaseAgeBypassArgs;if(bypassMinReleaseAge&&bypassArgs.length===0)return output_manager_default.stopSpinner(),output_manager_default.error(`Minimum release-age bypass is not supported for ${packageManager}. Run the upgrade without --bypass-min-release-age, or configure release-age settings in ${packageManager} directly.`),1;bypassMinReleaseAge&&client&&client.config.updates?.bypassMinReleaseAge!==!0&&setMinReleaseAgeBypass(client,!0);let versionBefore=pkg_default.version,installLatestTag=explicitTarget&&targetVersion==="latest",resolvedTargetVersion=installLatestTag?void 0:targetVersion;if(targetVersion||(renderUpgradeProgress(1,totalSteps,"Checking for updates\u2026"),resolvedTargetVersion=await getLatestPackageVersion(packageManager,args,cwd,global,env,releaseAgePolicy==="newest")),!resolvedTargetVersion&&!installLatestTag)return output_manager_default.stopSpinner(),output_manager_default.error("Failed to resolve the latest Vercel CLI version."),1;if(!explicitTarget&&resolvedTargetVersion&&isVersionCurrent(versionBefore,resolvedTargetVersion))return renderUpgradeProgress(totalSteps,totalSteps),output_manager_default.stopSpinner(),output_manager_default.log(`No upgrade available. Vercel CLI is already up to date (v${versionBefore}).`),0;let installArgs=resolvedTargetVersion?pinPackageVersion(args,resolvedTargetVersion):args,shouldBypass=releaseAgePolicy==="newest"&&bypassArgs.length>0&&(bypassMinReleaseAge||client?.config.updates?.bypassMinReleaseAge===!0);shouldBypass&&(installArgs=[...installArgs,...bypassArgs]);let runInstall=currentArgs=>{let installCommand=[command,...currentArgs].join(" ");return output_manager_default.debug(`Executing: ${installCommand} (cwd: ${cwd})`),new Promise(resolve2=>{let stdout=[],stderr=[],invocation;try{invocation=packageManagerInvocation(command,currentArgs,env)}catch(spawnError){resolve2({code:1,stdout:"",stderr:"",spawnError});return}let upgradeProcess=spawn(invocation.file,invocation.args,{cwd,env:{...env},stdio:["inherit","pipe","pipe"],shell:!1,windowsVerbatimArguments:invocation.windowsVerbatimArguments});upgradeProcess.stdout?.on("data",data=>{stdout.push(Uint8Array.from(data)),output_manager_default.debug(`[upgrade stdout] ${data.toString().trimEnd()}`)}),upgradeProcess.stderr?.on("data",data=>{stderr.push(Uint8Array.from(data)),output_manager_default.debug(`[upgrade stderr] ${data.toString().trimEnd()}`)});let settled=!1;upgradeProcess.on("error",spawnError=>{settled||(settled=!0,resolve2({code:1,stdout:"",stderr:"",spawnError}))}),upgradeProcess.on("close",code=>{settled||(settled=!0,resolve2({code:code??1,stdout:Buffer.concat(stdout).toString(),stderr:Buffer.concat(stderr).toString()}))})})};renderUpgradeProgress(targetVersion?1:2,totalSteps,"Installing\u2026");let result=await runInstall(installArgs),usedAllowedRelease=!1;if(result.code!==0&&!result.spawnError&&releaseAgePolicy==="newest"&&!shouldBypass&&bypassArgs.length>0&&isMinReleaseAgeError(packageManager,result.stdout,result.stderr)){let context=await getMinReleaseAgeContext(packageManager,cwd,global);output_manager_default.stopSpinner();let blockedMessage=`The package manager blocked this Vercel CLI release because of its minimum release-age setting. ${context}`;if(!client||client.nonInteractive||!client.stdin.isTTY)return output_manager_default.error(`${blockedMessage}
|
|
10
|
-
To install the newest release allowed by your settings:
|
|
11
|
-
vc upgrade latest
|
|
12
|
-
To bypass the minimum release age for this and future foreground upgrades:
|
|
13
|
-
vc upgrade --bypass-min-release-age`),outcome&&(outcome.releaseAgeBlocked=!0),1;output_manager_default.print(`! ${blockedMessage}
|
|
14
|
-
`);let action=await client.input.select({message:"Which upgrade option?",choices:[{name:"Install the newest release allowed by my settings",value:"allowed"},{name:"Bypass the minimum release age for this and future foreground upgrades",value:"bypass"},{name:"Cancel",value:"cancel"}],default:"allowed"});if(action==="allowed")resolvedTargetVersion=void 0,installArgs=args,usedAllowedRelease=!0;else if(action==="bypass")setMinReleaseAgeBypass(client,!0),output_manager_default.log("To restore release-age checks, run `vc upgrade --no-bypass-min-release-age`."),installArgs=[...installArgs,...bypassArgs];else return output_manager_default.log("Upgrade canceled."),0;renderUpgradeProgress(targetVersion?1:2,totalSteps,"Installing\u2026"),result=await runInstall(installArgs)}return result.spawnError?(output_manager_default.stopSpinner(),output_manager_default.error(`Failed to execute upgrade command: ${result.spawnError.message}`),output_manager_default.log(`You can try running the command manually: ${[command,...installArgs].join(" ")}`),1):result.code!==0?(output_manager_default.stopSpinner(),result.stdout&&output_manager_default.print(result.stdout),result.stderr&&output_manager_default.print(result.stderr),output_manager_default.error(`Upgrade failed with exit code ${result.code}`),output_manager_default.log(`You can try running the command manually: ${[command,...installArgs].join(" ")}`),result.code):usedAllowedRelease&&(resolvedTargetVersion=await getInstalledPackageVersion(packageManager,args,cwd,global),resolvedTargetVersion===versionBefore)?(output_manager_default.stopSpinner(),output_manager_default.log(`Vercel CLI remains at v${versionBefore} under your package manager settings.`),0):(renderUpgradeProgress(totalSteps,totalSteps),output_manager_default.stopSpinner(),output_manager_default.success(resolvedTargetVersion?`Upgraded Vercel CLI to v${resolvedTargetVersion}.`:"Upgraded Vercel CLI."),0)}var import_semver2=__toESM(require_semver(),1),import_ci_info=__toESM(require_ci_info(),1),import_xdg_app_paths=__toESM(require_xdg_app_paths(),1),import_fs_extra=__toESM(require_lib(),1);import{randomUUID}from"node:crypto";import{mkdir,rename,rm,writeFile}from"node:fs/promises";import{dirname,isAbsolute,relative,resolve}from"node:path";import{spawn as spawn2}from"node:child_process";var NATIVE_UPDATE_CHILD_ENV="VERCEL_NATIVE_UPDATE_CHILD",NATIVE_UPDATE_VERSION_ENV="VERCEL_NATIVE_UPDATE_VERSION",NATIVE_UPDATE_SELECT_PRODUCTION_ENV="VERCEL_NATIVE_UPDATE_SELECT_PRODUCTION";function isNativeUpdateChild(){return process.env[NATIVE_UPDATE_CHILD_ENV]==="1"}function spawnDetachedUpdate(env){let child=spawn2(process.execPath,["version","check"],{detached:!0,stdio:"ignore",windowsHide:!0,env});child.on("error",()=>{}),child.unref()}function spawnNativeUpdateCheck(){let env={...process.env,[NATIVE_UPDATE_CHILD_ENV]:"1",[NATIVE_UPDATE_SELECT_PRODUCTION_ENV]:"0"};delete env[NATIVE_UPDATE_VERSION_ENV],spawnDetachedUpdate(env)}function spawnNativeUpdateChild(version,selectProduction){spawnDetachedUpdate({...process.env,[NATIVE_UPDATE_CHILD_ENV]:"1",[NATIVE_UPDATE_VERSION_ENV]:version,[NATIVE_UPDATE_SELECT_PRODUCTION_ENV]:selectProduction?"1":"0"})}var NATIVE_UPDATE_CHECK_INTERVAL=1e3*60*60*24,NATIVE_UPDATE_DISCOVERY_LEASE=1e3*60;function isNativeAutoUpdateEnabled(config){return config.updates?.auto!==!1}var CACHE_LOCK_RETRY_MS=10,CACHE_LOCK_ABANDONED_MS=1e4;function getNativeUpdateCacheFile(cacheDir=(0,import_xdg_app_paths.default)("com.vercel.cli").cache()){let packageName=getNativePackageName().replaceAll("/","-");return resolve(cacheDir,"package-updates",`${packageName}-latest.json`)}function readNativeUpdateCache(cacheDir){try{let cache=(0,import_fs_extra.readJSONSync)(getNativeUpdateCacheFile(cacheDir));if(typeof cache?.expireAt=="number"&&(cache.version===void 0||typeof cache.version=="string"&&import_semver2.default.valid(cache.version)))return cache}catch{}}async function atomicWriteCache(cacheDir,cache){let cacheFile=getNativeUpdateCacheFile(cacheDir);await mkdir(dirname(cacheFile),{recursive:!0});let temporary=`${cacheFile}.tmp-${randomUUID()}`;await writeFile(temporary,`${JSON.stringify(cache)}
|
|
15
|
-
`);try{await rename(temporary,cacheFile)}catch(error){throw await rm(temporary,{force:!0}),error}}async function withNativeUpdateCacheLock(cacheDir,action,{waitMs=5e3}={}){let lock=`${getNativeUpdateCacheFile(cacheDir)}.lock`;await withDirectoryLock(lock,action,{waitMs,retryMs:CACHE_LOCK_RETRY_MS,abandonedAfterMs:CACHE_LOCK_ABANDONED_MS,busyMessage:path=>`Timed out waiting for the native update cache. If no Vercel update is running, remove the lock at ${path} and retry.`})}async function cacheNativeUpdateVersion(version,{cacheDir=(0,import_xdg_app_paths.default)("com.vercel.cli").cache(),now=Date.now(),selectProduction=!1}={}){await withNativeUpdateCacheLock(cacheDir,async()=>{let existing=readNativeUpdateCache(cacheDir),keepNewerExisting=!!(existing?.version&&import_semver2.default.gt(existing.version,version)),nextVersion=keepNewerExisting?existing?.version:version,shouldSelectProduction=selectProduction||existing?.selectProduction===!0,staged=shouldSelectProduction?!1:keepNewerExisting||existing?.version===version?existing?.staged===!0:!1;await atomicWriteCache(cacheDir,{expireAt:now+NATIVE_UPDATE_CHECK_INTERVAL,selectProduction:shouldSelectProduction,staged,version:nextVersion})})}async function cacheNativeUpdateDiscoveryAttempt({cacheDir=(0,import_xdg_app_paths.default)("com.vercel.cli").cache(),now=Date.now()}={}){await withNativeUpdateCacheLock(cacheDir,async()=>{let existing=readNativeUpdateCache(cacheDir);await atomicWriteCache(cacheDir,{...existing,discoveryStartedAt:now,expireAt:now+NATIVE_UPDATE_CHECK_INTERVAL,staged:existing?.selectProduction===!0?existing.staged===!0:!0})})}async function restoreNativeUpdateAfterDiscoveryFailure({cacheDir=(0,import_xdg_app_paths.default)("com.vercel.cli").cache()}={}){await withNativeUpdateCacheLock(cacheDir,async()=>{let cache=readNativeUpdateCache(cacheDir);cache?.version&&await atomicWriteCache(cacheDir,{...cache,discoveryStartedAt:void 0,staged:!1})})}async function markNativeUpdateStaged(version,{cacheDir=(0,import_xdg_app_paths.default)("com.vercel.cli").cache(),selectedProduction=!1}={}){await withNativeUpdateCacheLock(cacheDir,async()=>{let cache=readNativeUpdateCache(cacheDir);cache?.version===version&&(cache.selectProduction!==!0||selectedProduction)&&await atomicWriteCache(cacheDir,{...cache,discoveryStartedAt:void 0,selectProduction:!1,staged:!0})})}function isWithinInstallRoot(executablePath,installRoot){let pathFromRoot=relative(resolve(installRoot),resolve(executablePath));return pathFromRoot!==""&&pathFromRoot!==".."&&!pathFromRoot.startsWith(`..${process.platform==="win32"?"\\":"/"}`)&&!isAbsolute(pathFromRoot)}function scheduleNativeAutoUpdate(client,exitCode,{cacheDir=(0,import_xdg_app_paths.default)("com.vercel.cli").cache(),executablePath=process.execPath,installRoot=getInstallRoot(),now=Date.now()}={}){if(exitCode!==0||import_ci_info.default.isCI||client.isAgent||client.nonInteractive||isNativeUpdateChild()||!isNativeBinaryInstall()||!isWithinInstallRoot(executablePath,installRoot))return;let cache=readNativeUpdateCache(cacheDir);if(!isNativeAutoUpdateEnabled(client.config)&&cache?.selectProduction!==!0)return;if(!cache?.expireAt||cache.expireAt<=now){spawnNativeUpdateCheck();return}let abandonedDiscovery=!!(cache.version&&cache.staged===!0&&cache.discoveryStartedAt&&cache.discoveryStartedAt+NATIVE_UPDATE_DISCOVERY_LEASE<=now);cache.version&&(cache.staged!==!0||abandonedDiscovery)&&spawnNativeUpdateChild(cache.version,cache.selectProduction===!0)}var import_ci_info2=__toESM(require_ci_info(),1);function isAutoUpdateEnabled(config){return config.updates?.auto===!0}function hasAutoUpdatePreference(config){return typeof config.updates?.auto=="boolean"}function setAutoUpdate(client,enabled){client.config={...client.config,updates:{...client.config.updates,auto:enabled}},client.writeToConfigFile()}async function canAutoUpdate(client,exitCode,command){return isNativeBinaryInstall()||!isAutoUpdateEnabled(client.config)||exitCode!==0||import_ci_info2.default.isCI||client.nonInteractive||client.isAgent||command==="upgrade"?!1:isGlobal()}export{require_xdg_app_paths,require_fetch_dist_tags,getWhoamiCachedAnswer,pinPackageVersion,setMinReleaseAgeBypass,executeHomebrewUpgrade,executeAutomaticUpgrade,executeUpgrade,NATIVE_UPDATE_VERSION_ENV,NATIVE_UPDATE_SELECT_PRODUCTION_ENV,isNativeUpdateChild,spawnNativeUpdateChild,isNativeAutoUpdateEnabled,cacheNativeUpdateVersion,cacheNativeUpdateDiscoveryAttempt,restoreNativeUpdateAfterDiscoveryFailure,markNativeUpdateStaged,scheduleNativeAutoUpdate,isAutoUpdateEnabled,hasAutoUpdatePreference,setAutoUpdate,canAutoUpdate};
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
import { createRequire as __createRequire } from 'node:module';
|
|
2
|
-
import { fileURLToPath as __fileURLToPath } from 'node:url';
|
|
3
|
-
import { dirname as __dirname_ } from 'node:path';
|
|
4
|
-
const require = __createRequire(import.meta.url);
|
|
5
|
-
const __filename = __fileURLToPath(import.meta.url);
|
|
6
|
-
const __dirname = __dirname_(__filename);
|
|
7
|
-
import{writeProjectSettings}from"./chunk-VUUU4KDL.js";import{jsonNextStep,runWithJsonOutput,writeJsonResult,writeJsonUsageError}from"./chunk-EAQAV7UZ.js";import{stamp_default}from"./chunk-A2RZZQEP.js";import{envPullCommandLogic}from"./chunk-YI7NKOCU.js";import{parseTarget,warnDeprecatedProdFlag}from"./chunk-LNZEYUEC.js";import{ensureLink}from"./chunk-SXW2G4WD.js";import{pullCommand}from"./chunk-RVIJRFVD.js";import{printError}from"./chunk-33HVDSWP.js";import{help}from"./chunk-5KSBRQI2.js";import{TelemetryClient}from"./chunk-KDCODXVL.js";import{VERCEL_DIR,VERCEL_DIR_PROJECT,humanizePath}from"./chunk-Z2KANBOU.js";import{parseArguments}from"./chunk-CINNNQDJ.js";import{emoji,output_manager_default,prependEmoji}from"./chunk-AP6DZGTK.js";import{getFlagsSpecification}from"./chunk-CFJBDBYH.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")}};async function pullAllEnvFiles(environment,client,link,flags,cwd){let environmentFile=`.env.${environment}.local`;return await envPullCommandLogic(client,join(".vercel",environmentFile),!!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});if(typeof link=="number")return link;let{project,org,repoRoot}=link,currentDirectory;repoRoot?currentDirectory=join(repoRoot,project.rootDirectory||""):currentDirectory=cwd,client.config.currentTeam=org.type==="team"?org.id:void 0;let envFile=await pullAllEnvFiles(environment,client,link,flags,currentDirectory);output_manager_default.print(`
|
|
8
|
-
`),output_manager_default.log("Downloading project settings"),await writeProjectSettings(currentDirectory,project,org,typeof repoRoot=="string");let settingsPath=join(currentDirectory,VERCEL_DIR,VERCEL_DIR_PROJECT);if(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"))}
|
|
9
|
-
`),0}export{main,pullCommandLogic};
|