@vercel/cli-support 66.6.0 → 68.0.0-snapshot-c9dfd83f2293
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/chunks/add-NIIHCHGH.js +8 -0
- package/dist/chunks/add-ORZO4EJ7.js +8 -0
- package/dist/chunks/add-SKRNSMC6.js +8 -0
- package/dist/chunks/{alerts-72Q42HNT.js → alerts-MNMZH6BO.js} +1 -1
- package/dist/chunks/build-P7KKWO4O.js +7 -0
- package/dist/chunks/{chunk-ZZD5W5KT.js → chunk-23FY4PR3.js} +1 -1
- package/dist/chunks/{chunk-YTRKHRL3.js → chunk-27FVSW45.js} +1 -1
- package/dist/chunks/{chunk-IIK6GUVI.js → chunk-2BK7SZQA.js} +1 -1
- package/dist/chunks/{chunk-WJX5PGNN.js → chunk-2DH6LTUI.js} +1 -1
- package/dist/chunks/{chunk-D2TVI7KK.js → chunk-2HFP22IP.js} +4 -4
- package/dist/chunks/{chunk-7AVHDJSP.js → chunk-2KXLL3DX.js} +4 -4
- package/dist/chunks/{chunk-YEDS2UMW.js → chunk-2ZN4JRDA.js} +1 -1
- package/dist/chunks/{chunk-DJZBJC2A.js → chunk-3AFEVHHY.js} +1 -1
- package/dist/chunks/{chunk-FOFX7LHS.js → chunk-3OPLG6HM.js} +1 -1
- package/dist/chunks/{chunk-Q66LJNIV.js → chunk-3RFQ2NXZ.js} +1 -1
- package/dist/chunks/{chunk-F4UEGELU.js → chunk-3VNS4D7V.js} +1 -1
- package/dist/chunks/{chunk-XAGG5BJT.js → chunk-43XDA7ST.js} +1 -1
- package/dist/chunks/{chunk-OXS5VO4X.js → chunk-4D5DAM3D.js} +1 -1
- package/dist/chunks/chunk-4Z6R5KHZ.js +78 -0
- package/dist/chunks/{chunk-5KSBRQI2.js → chunk-5727HGA6.js} +1 -1
- package/dist/chunks/{chunk-6GE4V7MW.js → chunk-572VGS6P.js} +2 -2
- package/dist/chunks/{chunk-O7GNYVVM.js → chunk-5OGPMRRQ.js} +2 -2
- package/dist/chunks/{chunk-UUBPAYTG.js → chunk-5RMIM4S2.js} +1 -1
- package/dist/chunks/chunk-67GZ5REA.js +7 -0
- package/dist/chunks/{chunk-VHSAI6FS.js → chunk-6FEMU5YF.js} +1 -1
- package/dist/chunks/chunk-6JTZZSFH.js +7 -0
- package/dist/chunks/{chunk-UDZJCD5W.js → chunk-6KNWKZR4.js} +1 -1
- package/dist/chunks/{chunk-ZKNEIE44.js → chunk-6NC2JFUQ.js} +1 -1
- package/dist/chunks/{chunk-5O4AXCN7.js → chunk-6OJVCMG5.js} +1 -1
- package/dist/chunks/{chunk-X7KKWUPS.js → chunk-6WBEU34Y.js} +1 -1
- package/dist/chunks/{chunk-NBTFAXL4.js → chunk-6Z5REGCM.js} +1 -1
- package/dist/chunks/{chunk-VPSR2O55.js → chunk-7AAYWDIZ.js} +3 -3
- package/dist/chunks/{chunk-WIF4VGYZ.js → chunk-7GJ37QPL.js} +1 -1
- package/dist/chunks/chunk-7HQZRU25.js +10 -0
- package/dist/chunks/{chunk-XECELSF5.js → chunk-7JU5RJ3H.js} +1 -1
- package/dist/chunks/{chunk-KSGN5OCV.js → chunk-7K5ZWVDL.js} +1 -1
- package/dist/chunks/{chunk-UQZZX2J7.js → chunk-7OZ7OKPS.js} +1 -1
- package/dist/chunks/{chunk-PFOOPXTN.js → chunk-7RABG6HV.js} +2 -2
- package/dist/chunks/{chunk-AMH5MXDW.js → chunk-7WDSOKOY.js} +1 -1
- package/dist/chunks/{chunk-ELM2KPYX.js → chunk-A4LOQ3UK.js} +1 -1
- package/dist/chunks/{chunk-SYJXONEV.js → chunk-A6CMQOL7.js} +1 -1
- package/dist/chunks/chunk-AOPFMMUK.js +13 -0
- package/dist/chunks/{chunk-2OMI3IUW.js → chunk-AVXX4Q6S.js} +1 -1
- package/dist/chunks/{chunk-YEUIG3JC.js → chunk-AZVSMIPP.js} +1 -1
- package/dist/chunks/{chunk-XLYO5QNG.js → chunk-B7IUFV5P.js} +2 -2
- package/dist/chunks/{chunk-IF6GA273.js → chunk-BGIGZUFG.js} +1 -1
- package/dist/chunks/{chunk-YLLFLPNA.js → chunk-BHL2HM6I.js} +1 -1
- package/dist/chunks/{chunk-YIOMTAUF.js → chunk-BKFRN6C2.js} +1 -1
- package/dist/chunks/chunk-BS32OUOC.js +7 -0
- package/dist/chunks/{chunk-YJNMDXEG.js → chunk-BUBVZ6SQ.js} +1 -1
- package/dist/chunks/{chunk-VZ4URN3U.js → chunk-BYBELFCP.js} +1 -1
- package/dist/chunks/{chunk-B7GCRM5I.js → chunk-BYYNR34Q.js} +1 -1
- package/dist/chunks/{chunk-5TMHRECT.js → chunk-CAJ2OUSR.js} +1 -1
- package/dist/chunks/chunk-CDJ25IKC.js +7 -0
- package/dist/chunks/chunk-CJMNUD2I.js +12 -0
- package/dist/chunks/chunk-CSNP5RIM.js +11 -0
- package/dist/chunks/{chunk-REJLEESP.js → chunk-CTMTO2W4.js} +1 -1
- package/dist/chunks/{chunk-K3MGQQEP.js → chunk-D5JQZXL7.js} +1 -1
- package/dist/chunks/{chunk-6PDKIOAO.js → chunk-DEFA6XAB.js} +1 -1
- package/dist/chunks/{chunk-OE26EQSH.js → chunk-DEX4QU4S.js} +1 -1
- package/dist/chunks/{chunk-W2L24GM7.js → chunk-DMA77UYG.js} +1 -1
- package/dist/chunks/{chunk-LM3YPF3K.js → chunk-DOOBZO4W.js} +1 -1
- package/dist/chunks/chunk-DORCX7UB.js +7 -0
- package/dist/chunks/{chunk-C335SWOB.js → chunk-DUSMVY4N.js} +1 -1
- package/dist/chunks/{chunk-XDYVJWGX.js → chunk-E5A7E7X6.js} +1 -1
- package/dist/chunks/{chunk-GLCSWIB4.js → chunk-E7IN2DGU.js} +1 -1
- package/dist/chunks/chunk-EYRBV6RM.js +25 -0
- package/dist/chunks/{chunk-AKOYIH3A.js → chunk-F4KY2TOK.js} +1 -1
- package/dist/chunks/{chunk-DZ77BIEV.js → chunk-F4ZKTFQH.js} +1 -1
- package/dist/chunks/chunk-F7X6O4ZC.js +7 -0
- package/dist/chunks/{chunk-TSNRTRIM.js → chunk-FB37TFVF.js} +1 -1
- package/dist/chunks/{chunk-BCAI7MED.js → chunk-FGWYM3SF.js} +1 -1
- package/dist/chunks/{chunk-SYVWRGFQ.js → chunk-FGXULLNK.js} +1 -1
- package/dist/chunks/{chunk-T7GKQYWA.js → chunk-FXLZM6Q7.js} +1 -1
- package/dist/chunks/{chunk-JBYROCAC.js → chunk-FYM5EUNW.js} +1 -1
- package/dist/chunks/{chunk-RVIJRFVD.js → chunk-G24EKATW.js} +1 -1
- package/dist/chunks/chunk-GQXKF3PR.js +7 -0
- package/dist/chunks/{chunk-2G2SALNN.js → chunk-H2QMSLKJ.js} +1 -1
- package/dist/chunks/{chunk-33HVDSWP.js → chunk-HMJR6RVF.js} +1 -1
- package/dist/chunks/{chunk-S4AANAHX.js → chunk-HQ3ZFXXQ.js} +1 -1
- package/dist/chunks/chunk-HYGWJQN6.js +8 -0
- package/dist/chunks/chunk-I4O53MKV.js +8 -0
- package/dist/chunks/{chunk-TOTTVS5P.js → chunk-ID663OJ7.js} +1 -1
- package/dist/chunks/{chunk-FFN3EGSF.js → chunk-IKNAOU5O.js} +1 -1
- package/dist/chunks/{chunk-CINNNQDJ.js → chunk-INIZJZ3O.js} +1 -1
- package/dist/chunks/{chunk-LNZEYUEC.js → chunk-IVZNPSHU.js} +1 -1
- package/dist/chunks/{chunk-YOAQNRBN.js → chunk-IY7OKDHU.js} +3 -3
- package/dist/chunks/{chunk-2D5PTFAY.js → chunk-J7POLUHY.js} +1 -1
- package/dist/chunks/{chunk-6CJFPT4F.js → chunk-JDDPCL3K.js} +1 -1
- package/dist/chunks/chunk-JR25PLC7.js +13 -0
- package/dist/chunks/chunk-JV3YIOCO.js +7 -0
- package/dist/chunks/{chunk-RBW62SOU.js → chunk-JXE7GYE3.js} +1 -1
- package/dist/chunks/{chunk-EFP3LK4G.js → chunk-K5SM5NIY.js} +1 -1
- package/dist/chunks/chunk-K6KS5GZD.js +16 -0
- package/dist/chunks/chunk-K7TSWIKR.js +12 -0
- package/dist/chunks/{chunk-FEJD7MRH.js → chunk-KA2KG3SY.js} +1 -1
- package/dist/chunks/{chunk-GUGP6OY2.js → chunk-KFBA2MAV.js} +1 -1
- package/dist/chunks/{table-W6LOHWWF.js → chunk-KG526MHL.js} +1 -1
- package/dist/chunks/chunk-KHMNANEN.js +7 -0
- package/dist/chunks/chunk-KVXEYKIX.js +7 -0
- package/dist/chunks/{chunk-F37XFLFP.js → chunk-L3YEI2RW.js} +1 -1
- package/dist/chunks/{chunk-54FY6GJ5.js → chunk-L46V6VL3.js} +1 -1
- package/dist/chunks/chunk-LD25KYMI.js +30 -0
- package/dist/chunks/{chunk-ANIA2G6F.js → chunk-LDDXXDN5.js} +1 -1
- package/dist/chunks/{chunk-M7FED5YP.js → chunk-M2Q2DUHO.js} +1 -1
- package/dist/chunks/{chunk-5ZCSFPWG.js → chunk-MDRI27KN.js} +1 -1
- package/dist/chunks/{chunk-2AU6O6Z5.js → chunk-MJ77FDK2.js} +1 -1
- package/dist/chunks/{chunk-GHNHUSVK.js → chunk-MMMJO2M3.js} +1 -1
- package/dist/chunks/chunk-N4PID4SD.js +7 -0
- package/dist/chunks/chunk-N6MNUNZ4.js +37 -0
- package/dist/chunks/chunk-NMY2YZ6M.js +8 -0
- package/dist/chunks/{chunk-QRG24GJG.js → chunk-NOAZDAOU.js} +1 -1
- package/dist/chunks/{chunk-ZJNDLFZ7.js → chunk-OOPF73RV.js} +1 -1
- package/dist/chunks/{chunk-YRKW42CD.js → chunk-OQXHBPPS.js} +1 -1
- package/dist/chunks/{chunk-SQCVI2EG.js → chunk-OVWS4CFW.js} +1 -1
- package/dist/chunks/{chunk-WAFBTC45.js → chunk-PHPJS2G2.js} +1 -1
- package/dist/chunks/{chunk-TNQUCTJH.js → chunk-PPCZYUSO.js} +1 -1
- package/dist/chunks/chunk-PZL7NSDA.js +24 -0
- package/dist/chunks/{chunk-OISNKAC6.js → chunk-Q45SQL44.js} +2 -2
- package/dist/chunks/{chunk-XDWAUOFO.js → chunk-Q4XCBBWK.js} +1 -1
- package/dist/chunks/chunk-Q7HFUXJ4.js +10 -0
- package/dist/chunks/chunk-QFE3RPMA.js +19 -0
- package/dist/chunks/{chunk-L5PIUIUM.js → chunk-QFSIUMC6.js} +1 -1
- package/dist/chunks/{chunk-CSCUVSJM.js → chunk-QG5UBKDA.js} +1 -1
- package/dist/chunks/{chunk-KLYFOXYH.js → chunk-QGS3ERDZ.js} +3 -3
- package/dist/chunks/{chunk-3UZE566G.js → chunk-QSL6AG2B.js} +1 -1
- package/dist/chunks/chunk-QU74BFN2.js +10 -0
- package/dist/chunks/{chunk-ACN6DBTC.js → chunk-R3QHEJL6.js} +1 -1
- package/dist/chunks/{chunk-BDXK4TCN.js → chunk-RHFNVIFD.js} +1 -1
- package/dist/chunks/chunk-RPYIWRSN.js +7 -0
- package/dist/chunks/{chunk-AP6DZGTK.js → chunk-RYSO5U3E.js} +1 -1
- package/dist/chunks/{chunk-N6JHFCWC.js → chunk-S7Y24A5X.js} +1 -1
- package/dist/chunks/chunk-SGNDE4YS.js +7 -0
- package/dist/chunks/{chunk-OF32Z3UP.js → chunk-SHJ3XTD3.js} +1 -1
- package/dist/chunks/{chunk-R33HJGYA.js → chunk-SHL6BPBV.js} +1 -1
- package/dist/chunks/{chunk-GLIQ4KNY.js → chunk-SQ62IODX.js} +1 -1
- package/dist/chunks/{chunk-PIDEH4SJ.js → chunk-T44RB754.js} +1 -1
- package/dist/chunks/{chunk-DHKWTBF6.js → chunk-T4DOV5S4.js} +1 -1
- package/dist/chunks/chunk-T5JHWXS5.js +8 -0
- package/dist/chunks/{chunk-TJUZVODP.js → chunk-TLKBGAOL.js} +1 -1
- package/dist/chunks/{chunk-ZA5O22ZY.js → chunk-TOCPUQ6N.js} +1 -1
- package/dist/chunks/{chunk-CJZE7647.js → chunk-U5SZQUYO.js} +1 -1
- package/dist/chunks/chunk-UAS3WUFB.js +11 -0
- package/dist/chunks/chunk-VIOIR6II.js +7 -0
- package/dist/chunks/{chunk-3A3GU62R.js → chunk-VMRFCU6F.js} +1 -1
- package/dist/chunks/{chunk-Y77DXGGN.js → chunk-VQZ773A2.js} +1 -1
- package/dist/chunks/chunk-VWKA6RKB.js +7 -0
- package/dist/chunks/{chunk-FCTTEFC5.js → chunk-WAOS5OCB.js} +1 -1
- package/dist/chunks/chunk-WBEPIG4S.js +31 -0
- package/dist/chunks/{chunk-AFHZC47H.js → chunk-WBXM3W44.js} +1 -1
- package/dist/chunks/{chunk-MINTHN6C.js → chunk-WEL2Y6OH.js} +1 -1
- package/dist/chunks/{chunk-RDDIWY3O.js → chunk-WGU2IQPY.js} +3 -3
- package/dist/chunks/{chunk-DOMBKOLJ.js → chunk-WLD4SGKM.js} +1 -1
- package/dist/chunks/{chunk-6FYPSSL4.js → chunk-X6JQI64G.js} +1 -1
- package/dist/chunks/{chunk-L75A5BMY.js → chunk-X755TPX6.js} +1 -1
- package/dist/chunks/{chunk-QZKRVE44.js → chunk-XQZBXQZ2.js} +1 -1
- package/dist/chunks/{chunk-AB4WXRCO.js → chunk-Y3V4JYK6.js} +1 -1
- package/dist/chunks/{chunk-LKW6GVP2.js → chunk-Y4YBQUQM.js} +1 -1
- package/dist/chunks/{chunk-I5KIA2XV.js → chunk-YBAGKQXC.js} +1 -1
- package/dist/chunks/{chunk-3OZCZF4N.js → chunk-YFOBGEOW.js} +1 -1
- package/dist/chunks/{chunk-E4VPDMRQ.js → chunk-YJJCELMY.js} +1 -1
- package/dist/chunks/chunk-YLXXGQQQ.js +7 -0
- package/dist/chunks/{chunk-BMIYC2MH.js → chunk-YN3HZJXW.js} +1 -1
- package/dist/chunks/chunk-YNMTP26U.js +7 -0
- package/dist/chunks/chunk-YTSGFU5T.js +7 -0
- package/dist/chunks/{chunk-Z2PTPD6J.js → chunk-YTSUDTAK.js} +1 -1
- package/dist/chunks/{chunk-QZJOKECY.js → chunk-YYDI5Q5K.js} +2 -2
- package/dist/chunks/{chunk-DOBV3XLO.js → chunk-Z3YQZSU4.js} +1 -1
- package/dist/chunks/chunk-Z643WTC4.js +15 -0
- package/dist/chunks/{chunk-D2E4COIY.js → chunk-ZBZQEDZY.js} +1 -1
- package/dist/chunks/chunk-ZRFDZO7Y.js +7 -0
- package/dist/chunks/chunk-ZSEFELXB.js +23 -0
- package/dist/chunks/{chunk-UECFEOOH.js → chunk-ZXSZH7N5.js} +1 -1
- package/dist/chunks/clear-B3I7ZYEY.js +8 -0
- package/dist/chunks/cli-embedded-NR5F35LW.js +87 -0
- package/dist/chunks/compile-vercel-config-ZQMPTEM6.js +7 -0
- package/dist/chunks/config-4GZY5MR4.js +7 -0
- package/dist/chunks/config-ZY22VRFX.js +8 -0
- package/dist/chunks/config-validator.mjs +1 -1
- package/dist/chunks/{connect-git-provider-CIRRFPI2.js → connect-git-provider-WGKVFXW2.js} +1 -1
- package/dist/chunks/create-project-BTOHPKZB.js +7 -0
- package/dist/chunks/delete-K2HS7YCM.js +10 -0
- package/dist/chunks/delete-RVTGE4BU.js +9 -0
- package/dist/chunks/describe-5ZCOXUID.js +25 -0
- package/dist/chunks/detect-projects-AZXG6BRD.js +7 -0
- package/dist/chunks/detect-services-FLNYWWJS.js +7 -0
- package/dist/chunks/disable-AS6DQMHM.js +7 -0
- package/dist/chunks/discard-PYU5CG67.js +14 -0
- package/dist/chunks/edit-HSMIPVPN.js +9 -0
- package/dist/chunks/edit-RLRJSNZY.js +8 -0
- package/dist/chunks/enable-JPWR5EPC.js +7 -0
- package/dist/chunks/{engine-D8YAsQS_-WNPHYRQF.js → engine-C8wCzkw--PYVABGU4.js} +1 -1
- package/dist/chunks/esm-5GQXHN7C.js +9 -0
- package/dist/chunks/esm-FJCIOBBV.js +7 -0
- package/dist/chunks/{esm-FSME24KA.js → esm-IYH32MTQ.js} +1 -1
- package/dist/chunks/esm-LEQXRLFV.js +9 -0
- package/dist/chunks/esm-NHCCFW7Z.js +7 -0
- package/dist/chunks/esm-QQ3MUOW4.js +7 -0
- package/dist/chunks/esm-T655CG6O.js +7 -0
- package/dist/chunks/{exec-ALB7WFEF.js → exec-PCSP64LR.js} +1 -1
- package/dist/chunks/{export-TOSUN6JO.js → export-6WFWSAO4.js} +2 -3
- package/dist/chunks/future-QLQMHIPL.js +7 -0
- package/dist/chunks/generate-cert-for-deploy-JKVOVQ3B.js +7 -0
- package/dist/chunks/image-POIJ2G2Y.js +7 -0
- package/dist/chunks/import-builders-YF5MX6ZA.js +7 -0
- package/dist/chunks/{inspect-SX3QQUEQ.js → inspect-4CURZZPU.js} +1 -1
- package/dist/chunks/{inspect-DFYVVIJW.js → inspect-BAYMK22S.js} +1 -1
- package/dist/chunks/inspect-JTBMNWWI.js +13 -0
- package/dist/chunks/{inspect-GBH7FAW6.js → inspect-TBQRBTX3.js} +1 -1
- package/dist/chunks/inspect-W4WSFBOF.js +9 -0
- package/dist/chunks/{inspect-4Y2OD5MI.js → inspect-YKSWSH3T.js} +1 -1
- package/dist/chunks/{list-HD6KXAIG.js → list-E65OFWSS.js} +1 -1
- package/dist/chunks/list-EWYN3F4Y.js +12 -0
- package/dist/chunks/{list-MW2FV253.js → list-ZHES2WYK.js} +1 -1
- package/dist/chunks/{list-4RRL326Z.js → list-ZWJDFJNY.js} +1 -1
- package/dist/chunks/login-JAKNSTW3.js +9 -0
- package/dist/chunks/login-JRGX6HGZ.js +7 -0
- package/dist/chunks/logs-3DPLX3CB.js +7 -0
- package/dist/chunks/{ls-VFE7PE25.js → ls-5YLM3ICH.js} +1 -1
- package/dist/chunks/ls-6HPMZVYA.js +11 -0
- package/dist/chunks/{ls-RKOM46KV.js → ls-FWOTN6V6.js} +1 -1
- package/dist/chunks/{ls-I767MTW4.js → ls-MW3WIHH5.js} +1 -1
- package/dist/chunks/{ls-Q4WGEEBZ.js → ls-RAVFLQTQ.js} +1 -1
- package/dist/chunks/ls-SY2FW3WA.js +8 -0
- package/dist/chunks/{ls-TLEAYYXQ.js → ls-ZX5FNEK2.js} +1 -1
- package/dist/chunks/migrate-experimental-services-XYUCY2G6.js +7 -0
- package/dist/chunks/mutate-4KTZMM3X.js +9 -0
- package/dist/chunks/{native-self-update-JDTL3IBF.js → native-self-update-Q3EN6NZK.js} +1 -1
- package/dist/chunks/notifications-LBZ7KWGS.js +7 -0
- package/dist/chunks/open-PXLVSFII.js +7 -0
- package/dist/chunks/{openapi-NEYEIRF2.js → openapi-6RKKA6JG.js} +1 -1
- package/dist/chunks/permissions-DQ5AF6XL.js +7 -0
- package/dist/chunks/{plugin-offer-NPJAEILN.js → plugin-offer-VU3R572E.js} +1 -1
- package/dist/chunks/prompt-missing-credentials-AJH3HM36.js +7 -0
- package/dist/chunks/publish-QJJL3IHG.js +15 -0
- package/dist/chunks/pull-3PQHXMPB.js +7 -0
- package/dist/chunks/purchase-domain-if-available-IFCQ4QFP.js +7 -0
- package/dist/chunks/push-4VIQFKP3.js +7 -0
- package/dist/chunks/query-BQ4HYVQ7.js +7 -0
- package/dist/chunks/raw-query-VA6VVMR4.js +8 -0
- package/dist/chunks/reauthenticate-2SMCQQHF.js +7 -0
- package/dist/chunks/{remove-IEEZGRB2.js → remove-CSIMGLLS.js} +1 -1
- package/dist/chunks/reorder-ERRB7OJL.js +10 -0
- package/dist/chunks/reply-XCBWXFWS.js +9 -0
- package/dist/chunks/repo-root-DZ6WFHMP.js +7 -0
- package/dist/chunks/resolve-VWGZ632M.js +12 -0
- package/dist/chunks/resolve-agent-team-NWELD5FN.js +7 -0
- package/dist/chunks/{resolve-deployment-framework-preset-4TKUU6AH.js → resolve-deployment-framework-preset-BLMQLCIN.js} +1 -1
- package/dist/chunks/restore-SXZUZGZE.js +16 -0
- package/dist/chunks/rm-5TRC5YND.js +8 -0
- package/dist/chunks/rm-IQ33QTQ2.js +8 -0
- package/dist/chunks/rm-KURYLLD6.js +8 -0
- package/dist/chunks/rm-WCE3ISB2.js +8 -0
- package/dist/chunks/rm-XMWM76JA.js +8 -0
- package/dist/chunks/routes-SBMN6SDF.js +7 -0
- package/dist/chunks/rule-inspect-USW6K7Y7.js +8 -0
- package/dist/chunks/schema-2G5VJ7EY.js +14 -0
- package/dist/chunks/{schema-L5VCG6FJ.js → schema-LRRKG2KJ.js} +1 -1
- package/dist/chunks/select-org-JG6GRWTS.js +7 -0
- package/dist/chunks/{serving-aOQsBok0-OL36TMZU.js → serving-C1mhZQqH-73TMEGEB.js} +1 -1
- package/dist/chunks/set-4JTH62JO.js +7 -0
- package/dist/chunks/{set-6U4QIX7A.js → set-BS5KCRE4.js} +1 -1
- package/dist/chunks/setup-and-link-GY4O7UJP.js +7 -0
- package/dist/chunks/{skills-ZMFZGPQL.js → skills-SUGA6D3G.js} +4 -19
- package/dist/chunks/table-SCLK33K7.js +7 -0
- package/dist/chunks/tags-B7MKMQKJ.js +7 -0
- package/dist/chunks/{types-CVLZCTL2.js → types-YFDB4QZA.js} +1 -1
- package/dist/chunks/{update-A727QN7H.js → update-LWRCCEXG.js} +1 -1
- package/dist/chunks/usage-HABW5VJ7.js +15 -0
- package/dist/chunks/validate-config-LDOYJ4LL.js +7 -0
- package/dist/commands/build/index.js +1 -1
- package/dist/commands/deploy/index.js +28 -25
- package/dist/commands/dev/index.js +7 -7
- package/dist/commands/env/index.js +12 -11
- package/dist/commands/link/index.js +3 -3
- package/dist/commands/list/index.js +1 -1
- package/dist/commands/project/index.js +4 -4
- package/dist/commands/tunnel/index.js +1 -1
- package/dist/commands-account.js +18 -12
- package/dist/commands-ai.js +18 -11
- package/dist/commands-blob.js +6 -6
- package/dist/commands-core.js +34 -48
- package/dist/commands-deployments.js +12 -11
- package/dist/commands-flags.js +27 -22
- package/dist/commands-integrations.js +7 -10
- package/dist/commands-observability.js +38 -28
- package/dist/commands-routing.js +6 -7
- package/dist/help.js +1 -1
- package/dist/index.js +6 -6
- package/dist/internal-build-worker.js +1 -1
- package/dist/internal-build.js +1 -1
- package/dist/package.json +43 -43
- package/dist/version.mjs +1 -1
- package/package.json +44 -44
- package/dist/chunks/add-563RV6JX.js +0 -8
- package/dist/chunks/add-HRB6XY33.js +0 -8
- package/dist/chunks/add-IUTGTBA4.js +0 -8
- package/dist/chunks/build-OMIYCGMR.js +0 -7
- package/dist/chunks/chunk-2GBU6ULJ.js +0 -7
- package/dist/chunks/chunk-2RRZCRWX.js +0 -7
- package/dist/chunks/chunk-4SS6W6JK.js +0 -11
- package/dist/chunks/chunk-5J4E2W4F.js +0 -12
- package/dist/chunks/chunk-76DSBD4X.js +0 -7
- package/dist/chunks/chunk-7W565DJB.js +0 -8
- package/dist/chunks/chunk-AIXEVICT.js +0 -37
- package/dist/chunks/chunk-AM46JVVN.js +0 -7
- package/dist/chunks/chunk-BULSRTQE.js +0 -7
- package/dist/chunks/chunk-C35SG42R.js +0 -7
- package/dist/chunks/chunk-CFJBDBYH.js +0 -7
- package/dist/chunks/chunk-DDPH26ZO.js +0 -7
- package/dist/chunks/chunk-EAQAV7UZ.js +0 -8
- package/dist/chunks/chunk-EFFJUYYS.js +0 -31
- package/dist/chunks/chunk-GOI2VVI7.js +0 -19
- package/dist/chunks/chunk-GYUNOFDD.js +0 -10
- package/dist/chunks/chunk-H2KNSYPR.js +0 -16
- package/dist/chunks/chunk-KDCODXVL.js +0 -25
- package/dist/chunks/chunk-KMTHGHJV.js +0 -8
- package/dist/chunks/chunk-KQ6X77WP.js +0 -7
- package/dist/chunks/chunk-KRP4EMD2.js +0 -10
- package/dist/chunks/chunk-NLK7NGVP.js +0 -7
- package/dist/chunks/chunk-OCR5CRTH.js +0 -10
- package/dist/chunks/chunk-PKR32I2N.js +0 -30
- package/dist/chunks/chunk-QGHAD5A5.js +0 -12
- package/dist/chunks/chunk-SPVOJ3HW.js +0 -7
- package/dist/chunks/chunk-SXW2G4WD.js +0 -10
- package/dist/chunks/chunk-TC4E2TFA.js +0 -8
- package/dist/chunks/chunk-TUB3APDV.js +0 -7
- package/dist/chunks/chunk-UG3FZ5Q7.js +0 -7
- package/dist/chunks/chunk-VF7XWPXA.js +0 -7
- package/dist/chunks/chunk-VKVH7LHB.js +0 -7
- package/dist/chunks/chunk-VUUU4KDL.js +0 -7
- package/dist/chunks/chunk-W3ZH27MN.js +0 -13
- package/dist/chunks/chunk-X47GV5HM.js +0 -15
- package/dist/chunks/chunk-XBHAU2M3.js +0 -9
- package/dist/chunks/chunk-XR2J7PQN.js +0 -12
- package/dist/chunks/chunk-YI7NKOCU.js +0 -23
- package/dist/chunks/chunk-Z2KANBOU.js +0 -69
- package/dist/chunks/chunk-Z7WZVEPP.js +0 -7
- package/dist/chunks/clear-TH6G33QK.js +0 -8
- package/dist/chunks/cli-embedded-FD3CAPRY.js +0 -84
- package/dist/chunks/compile-vercel-config-24IXPM4W.js +0 -7
- package/dist/chunks/config-2SBML7OY.js +0 -8
- package/dist/chunks/config-BCKJNJPS.js +0 -7
- package/dist/chunks/create-project-I7UXVWIR.js +0 -7
- package/dist/chunks/delete-RGHXL4JH.js +0 -9
- package/dist/chunks/delete-ZV4SHUTR.js +0 -10
- package/dist/chunks/describe-442UUQIF.js +0 -25
- package/dist/chunks/detect-projects-NBZSMQ5C.js +0 -7
- package/dist/chunks/detect-services-CRZW6FKM.js +0 -7
- package/dist/chunks/disable-MYGA6HVS.js +0 -7
- package/dist/chunks/discard-I5TKYCDJ.js +0 -14
- package/dist/chunks/edit-KGCUTTOZ.js +0 -8
- package/dist/chunks/edit-ZRNGGRVL.js +0 -9
- package/dist/chunks/enable-NODSFDKF.js +0 -7
- package/dist/chunks/esm-CF5UHWPM.js +0 -7
- package/dist/chunks/esm-EYOXGOVF.js +0 -7
- package/dist/chunks/esm-IUATPKKB.js +0 -9
- package/dist/chunks/esm-L6OKDFWP.js +0 -7
- package/dist/chunks/esm-ORQC2ZSA.js +0 -7
- package/dist/chunks/esm-PYIZNQIK.js +0 -9
- package/dist/chunks/future-RXI2OW2C.js +0 -7
- package/dist/chunks/generate-cert-for-deploy-7BX47IPD.js +0 -7
- package/dist/chunks/image-6A2EJP4N.js +0 -7
- package/dist/chunks/import-builders-I4JB6BA6.js +0 -7
- package/dist/chunks/inspect-STKCC3MC.js +0 -9
- package/dist/chunks/inspect-VFUV7BDM.js +0 -13
- package/dist/chunks/list-6ENV2ZGG.js +0 -12
- package/dist/chunks/login-O6NLJ42W.js +0 -7
- package/dist/chunks/login-U5VDJURN.js +0 -9
- package/dist/chunks/logs-X3KGHA3J.js +0 -7
- package/dist/chunks/ls-HRSD6VNW.js +0 -8
- package/dist/chunks/ls-OLJMGFTV.js +0 -11
- package/dist/chunks/migrate-experimental-services-7ZYHE5WA.js +0 -7
- package/dist/chunks/mutate-BJXJON5E.js +0 -9
- package/dist/chunks/notifications-F3NRNUHQ.js +0 -7
- package/dist/chunks/open-JK42ZTLB.js +0 -7
- package/dist/chunks/permissions-3AQO3DCH.js +0 -7
- package/dist/chunks/prompt-missing-credentials-AHAH27TZ.js +0 -7
- package/dist/chunks/publish-7SCXBVZR.js +0 -15
- package/dist/chunks/pull-LAPD5XJG.js +0 -7
- package/dist/chunks/purchase-domain-if-available-7MI52MFD.js +0 -7
- package/dist/chunks/push-BCSGQBAM.js +0 -7
- package/dist/chunks/query-U72BDMAK.js +0 -7
- package/dist/chunks/raw-query-4UAW7M5Q.js +0 -8
- package/dist/chunks/reauthenticate-HGOLSK2M.js +0 -7
- package/dist/chunks/reorder-YL6L6IWC.js +0 -10
- package/dist/chunks/reply-7Y5TN5UV.js +0 -9
- package/dist/chunks/resolve-C62436YM.js +0 -12
- package/dist/chunks/resolve-agent-team-SR3ALPCH.js +0 -7
- package/dist/chunks/restore-Z63JM5CN.js +0 -16
- package/dist/chunks/rm-C6QSHEA2.js +0 -8
- package/dist/chunks/rm-DDKE62T7.js +0 -8
- package/dist/chunks/rm-IUB55CCM.js +0 -8
- package/dist/chunks/rm-NZX43GMQ.js +0 -8
- package/dist/chunks/rm-UBUI7JNY.js +0 -8
- package/dist/chunks/routes-TME3VYIF.js +0 -7
- package/dist/chunks/rule-inspect-KF4BLH4K.js +0 -8
- package/dist/chunks/schema-P7DFLXCG.js +0 -14
- package/dist/chunks/select-org-MBBMOUK2.js +0 -7
- package/dist/chunks/set-SCKMJ7LZ.js +0 -7
- package/dist/chunks/setup-and-link-5TPDTJIN.js +0 -7
- package/dist/chunks/tags-7M2EW6LU.js +0 -7
- package/dist/chunks/usage-HT5JXVAA.js +0 -13
- package/dist/chunks/validate-config-Q77XESW5.js +0 -7
|
@@ -4,4 +4,4 @@ import { dirname as __dirname_ } from 'node:path';
|
|
|
4
4
|
const require = __createRequire(import.meta.url);
|
|
5
5
|
const __filename = __fileURLToPath(import.meta.url);
|
|
6
6
|
const __dirname = __dirname_(__filename);
|
|
7
|
-
import{TelemetryClient}from"./chunk-
|
|
7
|
+
import{TelemetryClient}from"./chunk-EYRBV6RM.js";var RoutesTelemetryClient=class extends TelemetryClient{trackCliSubcommandList(actual){this.trackCliSubcommand({subcommand:"list",value:actual})}trackCliSubcommandListVersions(actual){this.trackCliSubcommand({subcommand:"list-versions",value:actual})}trackCliSubcommandInspect(actual){this.trackCliSubcommand({subcommand:"inspect",value:actual})}trackCliSubcommandAdd(actual){this.trackCliSubcommand({subcommand:"add",value:actual})}trackCliSubcommandPublish(actual){this.trackCliSubcommand({subcommand:"publish",value:actual})}trackCliSubcommandRestore(actual){this.trackCliSubcommand({subcommand:"restore",value:actual})}trackCliSubcommandDiscardStaging(actual){this.trackCliSubcommand({subcommand:"discard-staging",value:actual})}trackCliSubcommandRemove(actual){this.trackCliSubcommand({subcommand:"remove",value:actual})}trackCliSubcommandExport(actual){this.trackCliSubcommand({subcommand:"export",value:actual})}trackCliSubcommandEnable(actual){this.trackCliSubcommand({subcommand:"enable",value:actual})}trackCliSubcommandDisable(actual){this.trackCliSubcommand({subcommand:"disable",value:actual})}trackCliSubcommandReorder(actual){this.trackCliSubcommand({subcommand:"reorder",value:actual})}trackCliSubcommandMove(actual){this.trackCliSubcommand({subcommand:"move",value:actual})}trackCliSubcommandUpdate(actual){this.trackCliSubcommand({subcommand:"update",value:actual})}},RoutesAddTelemetryClient=class extends TelemetryClient{trackCliArgumentName(name){name&&this.trackCliArgument({arg:"name",value:this.redactedValue})}trackCliFlagYes(flag){flag&&this.trackCliFlag("yes")}trackCliFlagNoEnable(flag){flag&&this.trackCliFlag("no-enable")}trackCliFlagDisabled(flag){flag&&this.trackCliFlag("disabled")}trackCliOptionSrc(src){src&&this.trackCliOption({option:"src",value:this.redactedValue})}trackCliOptionSrcSyntax(syntax){syntax&&this.trackCliOption({option:"src-syntax",value:syntax})}trackCliOptionAction(action){action&&this.trackCliOption({option:"action",value:action})}trackCliOptionDest(dest){dest&&this.trackCliOption({option:"dest",value:this.redactedValue})}trackCliOptionStatus(status){status!==void 0&&this.trackCliOption({option:"status",value:String(status)})}trackCliOptionPosition(position){if(position){let placement=position.split(":")[0];this.trackCliOption({option:"position",value:placement})}}trackCliOptionDescription(description){description&&this.trackCliOption({option:"description",value:this.redactedValue})}trackCliOptionSetResponseHeader(headers){headers&&headers.length>0&&this.trackCliOption({option:"set-response-header",value:this.redactedValue})}trackCliOptionAppendResponseHeader(headers){headers&&headers.length>0&&this.trackCliOption({option:"append-response-header",value:this.redactedValue})}trackCliOptionDeleteResponseHeader(headers){headers&&headers.length>0&&this.trackCliOption({option:"delete-response-header",value:this.redactedValue})}trackCliOptionSetRequestHeader(headers){headers&&headers.length>0&&this.trackCliOption({option:"set-request-header",value:this.redactedValue})}trackCliOptionAppendRequestHeader(headers){headers&&headers.length>0&&this.trackCliOption({option:"append-request-header",value:this.redactedValue})}trackCliOptionDeleteRequestHeader(headers){headers&&headers.length>0&&this.trackCliOption({option:"delete-request-header",value:this.redactedValue})}trackCliOptionSetRequestQuery(params){params&¶ms.length>0&&this.trackCliOption({option:"set-request-query",value:this.redactedValue})}trackCliOptionAppendRequestQuery(params){params&¶ms.length>0&&this.trackCliOption({option:"append-request-query",value:this.redactedValue})}trackCliOptionDeleteRequestQuery(params){params&¶ms.length>0&&this.trackCliOption({option:"delete-request-query",value:this.redactedValue})}trackCliOptionHas(conditions){conditions&&conditions.length>0&&this.trackCliOption({option:"has",value:this.redactedValue})}trackCliOptionMissing(conditions){conditions&&conditions.length>0&&this.trackCliOption({option:"missing",value:this.redactedValue})}trackCliOptionAi(prompt){prompt&&this.trackCliOption({option:"ai",value:this.redactedValue})}trackCliActionType(actionType){this.trackCliOption({option:"action-type",value:actionType})}trackCliFlagHasConditions(hasConditions){hasConditions&&this.trackCliFlag("has-conditions")}trackCliFlagMissingConditions(hasMissingConditions){hasMissingConditions&&this.trackCliFlag("missing-conditions")}trackCliFlagResponseHeaders(hasResponseHeaders){hasResponseHeaders&&this.trackCliFlag("response-headers")}trackCliFlagRequestTransforms(hasRequestTransforms){hasRequestTransforms&&this.trackCliFlag("request-transforms")}},RoutesEditTelemetryClient=class extends TelemetryClient{trackCliArgumentNameOrId(id){id&&this.trackCliArgument({arg:"name-or-id",value:this.redactedValue})}trackCliFlagYes(flag){flag&&this.trackCliFlag("yes")}trackCliFlagNoDest(flag){flag&&this.trackCliFlag("no-dest")}trackCliFlagNoStatus(flag){flag&&this.trackCliFlag("no-status")}trackCliFlagClearConditions(flag){flag&&this.trackCliFlag("clear-conditions")}trackCliFlagClearHeaders(flag){flag&&this.trackCliFlag("clear-headers")}trackCliFlagClearTransforms(flag){flag&&this.trackCliFlag("clear-transforms")}trackCliOptionName(name){name&&this.trackCliOption({option:"name",value:this.redactedValue})}trackCliOptionDescription(desc){desc&&this.trackCliOption({option:"description",value:this.redactedValue})}trackCliOptionSrc(src){src&&this.trackCliOption({option:"src",value:this.redactedValue})}trackCliOptionSrcSyntax(syntax){syntax&&this.trackCliOption({option:"src-syntax",value:syntax})}trackCliOptionAction(action){action&&this.trackCliOption({option:"action",value:action})}trackCliOptionDest(dest){dest&&this.trackCliOption({option:"dest",value:this.redactedValue})}trackCliOptionStatus(status){status!==void 0&&this.trackCliOption({option:"status",value:String(status)})}trackCliOptionSetResponseHeader(h){h&&h.length>0&&this.trackCliOption({option:"set-response-header",value:this.redactedValue})}trackCliOptionAppendResponseHeader(h){h&&h.length>0&&this.trackCliOption({option:"append-response-header",value:this.redactedValue})}trackCliOptionDeleteResponseHeader(h){h&&h.length>0&&this.trackCliOption({option:"delete-response-header",value:this.redactedValue})}trackCliOptionSetRequestHeader(h){h&&h.length>0&&this.trackCliOption({option:"set-request-header",value:this.redactedValue})}trackCliOptionAppendRequestHeader(h){h&&h.length>0&&this.trackCliOption({option:"append-request-header",value:this.redactedValue})}trackCliOptionDeleteRequestHeader(h){h&&h.length>0&&this.trackCliOption({option:"delete-request-header",value:this.redactedValue})}trackCliOptionSetRequestQuery(p){p&&p.length>0&&this.trackCliOption({option:"set-request-query",value:this.redactedValue})}trackCliOptionAppendRequestQuery(p){p&&p.length>0&&this.trackCliOption({option:"append-request-query",value:this.redactedValue})}trackCliOptionDeleteRequestQuery(p){p&&p.length>0&&this.trackCliOption({option:"delete-request-query",value:this.redactedValue})}trackCliOptionHas(conditions){conditions&&conditions.length>0&&this.trackCliOption({option:"has",value:this.redactedValue})}trackCliOptionMissing(conditions){conditions&&conditions.length>0&&this.trackCliOption({option:"missing",value:this.redactedValue})}trackCliOptionAi(prompt){prompt&&this.trackCliOption({option:"ai",value:this.redactedValue})}};export{RoutesTelemetryClient,RoutesAddTelemetryClient,RoutesEditTelemetryClient};
|
|
@@ -4,4 +4,4 @@ import { dirname as __dirname_ } from 'node:path';
|
|
|
4
4
|
const require = __createRequire(import.meta.url);
|
|
5
5
|
const __filename = __fileURLToPath(import.meta.url);
|
|
6
6
|
const __dirname = __dirname_(__filename);
|
|
7
|
-
import{outputError}from"./chunk-
|
|
7
|
+
import{outputError}from"./chunk-OOPF73RV.js";import{canPrompt}from"./chunk-IQ7FPAI4.js";import{readFileSync}from"node:fs";function readAllStandardInput(stdin){return stdin.isTTY?Promise.resolve(""):new Promise(resolve=>{let chunks=[],timer=setTimeout(()=>{chunks.length===0&&(cleanup(),resolve(""))},500),onData=chunk=>{chunks.push(String(chunk))},onEnd=()=>{cleanup(),resolve(chunks.join(""))};function cleanup(){clearTimeout(timer),stdin.off("data",onData),stdin.off("end",onEnd)}stdin.setEncoding("utf8"),stdin.on("data",onData),stdin.on("end",onEnd)})}async function resolveMessageContent(client,flags,jsonOutput){if(flags.message!==void 0&&flags.file!==void 0)return outputError(client,jsonOutput,"CONFLICTING_CONTENT","Use either --message or --file, not both.");if(flags.message!==void 0)return flags.message;if(flags.file!==void 0){if(flags.file==="-"){let piped2=await readAllStandardInput(client.stdin);return piped2||outputError(client,jsonOutput,"MISSING_CONTENT","No content received on stdin for `--file -`.")}try{return readFileSync(flags.file,"utf8")}catch(err){return outputError(client,jsonOutput,"FILE_READ_ERROR",`Could not read ${flags.file}: ${err instanceof Error?err.message:String(err)}`)}}let piped=await readAllStandardInput(client.stdin);if(piped)return piped;if(!flags.hasAttachments){if(canPrompt(client)&&!jsonOutput){let text=await client.input.text({message:"Comment message:"});if(text)return text}return outputError(client,jsonOutput,"MISSING_CONTENT",'No content provided. Pass --message <text>, --file <path>, or pipe stdin (e.g. `echo "LGTM" | vercel comments reply <thread>`).')}}export{resolveMessageContent};
|
|
@@ -4,4 +4,4 @@ import { dirname as __dirname_ } from 'node:path';
|
|
|
4
4
|
const require = __createRequire(import.meta.url);
|
|
5
5
|
const __filename = __fileURLToPath(import.meta.url);
|
|
6
6
|
const __dirname = __dirname_(__filename);
|
|
7
|
-
import{warnDeprecatedInput}from"./chunk-
|
|
7
|
+
import{warnDeprecatedInput}from"./chunk-KA2KG3SY.js";var VALUE_LIKE=/^(on|off|true|false|yes|no|1|0|enabled?|disabled?)$/i;function negationOf(name){return`--no-${name.slice(2)}`}function readOnOffOption(client,flags,names){let typed=name=>name!==void 0&&flags[name]===!0,onNames=[names.on,names.oldOn].filter(typed),offNames=[names.off,names.oldOff].filter(typed);return onNames.length>0&&offNames.length>0?{error:`Can't use ${onNames[0]} with ${offNames[0]}.`}:(names.oldOn&&onNames.includes(names.oldOn)&&warnDeprecatedInput(client,names.oldOn,names.on),names.oldOff&&offNames.includes(names.oldOff)&&warnDeprecatedInput(client,names.oldOff,names.off),{value:onNames.length>0?!0:offNames.length>0?!1:void 0})}function rewriteLegacyOnOffValues(args,options,client){let legacyOptions=options.filter(option=>option.legacyValues),out=[],legacy=new Map,end=args.indexOf("--");for(let i=0;i<args.length;i++){let token=args[i];if(end!==-1&&i>=end){out.push(token);continue}let option=legacyOptions.find(candidate=>token===`--${candidate.name}`||token.startsWith(`--${candidate.name}=`));if(!option?.legacyValues){out.push(token);continue}let name=`--${option.name}`,negation=negationOf(name),{on,off}=option.legacyValues,invalid={error:`${name} doesn't take a value. Use ${name} or ${negation}.`};if(token===name){let next=args[i+1];if(next===void 0||end!==-1&&i+1>=end)out.push(token);else if(next===on||next===off)out.push(next===on?name:negation),legacy.set(name,next),client&&warnDeprecatedInput(client,`${name} ${next}`,next===on?name:negation),i++;else{if(VALUE_LIKE.test(next))return invalid;out.push(token)}continue}let value=token.slice(name.length+1);if(value==="true"||value==="false")out.push(value==="true"?name:negation);else if(value===on||value===off)out.push(value===on?name:negation),legacy.set(name,value),client&&warnDeprecatedInput(client,token,value===on?name:negation);else return invalid}return{args:out,legacy}}function getFalseValueWarnings(args,options){let booleans=new Set(options.filter(option=>option.type===Boolean&&!option.legacyValues&&!option.rejectsValue&&option.name!=="non-interactive").map(option=>option.name)),warnings=new Set;for(let token of args){if(token==="--")break;let match=/^--([^=]+)=(.*)$/.exec(token);if(!match||!booleans.has(match[1])||!/^false$/i.test(match[2]))continue;let name=`--${match[1]}`;warnings.add(match[1].startsWith("no-")?`${token} turns ${name} on. Leave out ${name} to turn it off.`:`${token} turns ${name} on. Use ${negationOf(name)} to turn it off.`)}return[...warnings]}export{readOnOffOption,rewriteLegacyOnOffValues,getFalseValueWarnings};
|
|
@@ -4,4 +4,4 @@ import { dirname as __dirname_ } from 'node:path';
|
|
|
4
4
|
const require = __createRequire(import.meta.url);
|
|
5
5
|
const __filename = __fileURLToPath(import.meta.url);
|
|
6
6
|
const __dirname = __dirname_(__filename);
|
|
7
|
-
import{resolveProjectContext}from"./chunk-
|
|
7
|
+
import{resolveProjectContext}from"./chunk-JV3YIOCO.js";import{detectExplicitScope}from"./chunk-VIOIR6II.js";import{getProjectByNameOrId}from"./chunk-3AFEVHHY.js";import{printError}from"./chunk-HMJR6RVF.js";import{AGENT_REASON,AGENT_STATUS,buildCommandWithGlobalFlags,getErrorRecovery,getExitCodeForReason,outputActionRequired,outputAgentError}from"./chunk-CSNP5RIM.js";import{ProjectNotFound,isAPIError}from"./chunk-QFE3RPMA.js";import{output_manager_default}from"./chunk-RYSO5U3E.js";function tracingErrorMessage(err){return isAPIError(err)?err.serverMessage||err.message:err instanceof Error?err.message:String(err)}function tracingErrorReason(err){let status=isAPIError(err)?err.status:void 0;return status===403?AGENT_REASON.PERMISSION_DENIED:status===404?AGENT_REASON.NOT_FOUND:status===429?AGENT_REASON.RATE_LIMITED:AGENT_REASON.API_ERROR}function handleTracingApiError(client,err){if(client.nonInteractive){let apiError=isAPIError(err)?err:void 0;outputAgentError(client,{status:AGENT_STATUS.ERROR,reason:tracingErrorReason(err),message:tracingErrorMessage(err),...apiError?.status===429&&getErrorRecovery(apiError,client)})}return isAPIError(err)&&err.status===403?(output_manager_default.error(tracingErrorMessage(err)),1):(printError(err),1)}function configError(client,reason,message){return outputAgentError(client,{status:AGENT_STATUS.ERROR,reason,message}),output_manager_default.error(message),getExitCodeForReason(reason)}function invalidArguments(client,message){return configError(client,AGENT_REASON.INVALID_ARGUMENTS,message)}function missingEnvironment(client,message){return outputActionRequired(client,{status:AGENT_STATUS.ACTION_REQUIRED,reason:AGENT_REASON.MISSING_ENVIRONMENT,message}),output_manager_default.error(message),getExitCodeForReason(AGENT_REASON.MISSING_ENVIRONMENT)}function ruleNotFound(client,message){return configError(client,AGENT_REASON.NOT_FOUND,message)}function confirmationRequired(client,message,next){return outputAgentError(client,{status:AGENT_STATUS.ERROR,reason:AGENT_REASON.CONFIRMATION_REQUIRED,message,userActionRequired:!0,next}),output_manager_default.error(message),1}var MISSING_BOTH_MESSAGE="No linked project found. Run `vercel link`, pass --cwd to a linked dir, or use --scope <team> and --project <name>.";async function resolveScope({client,flags={},linkedProject}){let flagScope=flags.scope?.trim()||void 0,flagProject=flags.project?.trim()||void 0;if(linkedProject.status==="linked"){if(!flagScope&&!flagProject)return{teamId:linkedProject.org.id,projectId:linkedProject.project.id,projectName:linkedProject.project.name};let teamId=flagScope?client.config.currentTeam:linkedProject.org.id;if(!teamId)return{reason:AGENT_REASON.NOT_FOUND,message:`Team not found: ${flagScope}`};let project=await getProjectByNameOrId(client,flagProject??linkedProject.project.id,teamId);return project instanceof ProjectNotFound?{reason:AGENT_REASON.NOT_FOUND,message:`Project not found: ${flagProject}`}:{teamId,projectId:project.id,projectName:project.name}}if(flagScope&&flagProject){let teamId=client.config.currentTeam;if(!teamId)return{reason:AGENT_REASON.NOT_FOUND,message:`Team not found: ${flagScope}`};let project=await getProjectByNameOrId(client,flagProject,teamId);return project instanceof ProjectNotFound?{reason:AGENT_REASON.NOT_FOUND,message:`Project not found: ${flagProject}`}:{teamId,projectId:project.id,projectName:project.name}}return{reason:AGENT_REASON.NOT_LINKED,message:MISSING_BOTH_MESSAGE}}async function resolveConfigScope(client,flags){let link=await resolveProjectContext({client,projectNameOrId:flags.project});return link.status==="error"?{exitCode:link.exitCode}:link.status==="not_linked"?(outputActionRequired(client,{status:AGENT_STATUS.ACTION_REQUIRED,reason:AGENT_REASON.NOT_LINKED,message:MISSING_BOTH_MESSAGE,hint:"Link a project or pass --scope and --project.",next:[{command:buildCommandWithGlobalFlags(client.argv,"link"),when:"link this directory to a project"}]}),output_manager_default.error(MISSING_BOTH_MESSAGE),{exitCode:1}):flags.project===void 0&&detectExplicitScope(client)&&link.org.id!==client.config.currentTeam?{exitCode:invalidArguments(client,`The linked project ${link.project.name} belongs to ${link.org.slug||link.org.id}, which is not the scope that was passed. Pass --project <name> to act on a project in that scope.`)}:{teamId:link.org.id,teamSlug:link.org.slug,projectId:link.project.id,projectName:link.project.name}}export{tracingErrorMessage,tracingErrorReason,handleTracingApiError,invalidArguments,missingEnvironment,ruleNotFound,confirmationRequired,resolveScope,resolveConfigScope};
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { createRequire as __createRequire } from 'node:module';
|
|
2
|
+
import { fileURLToPath as __fileURLToPath } from 'node:url';
|
|
3
|
+
import { dirname as __dirname_ } from 'node:path';
|
|
4
|
+
const require = __createRequire(import.meta.url);
|
|
5
|
+
const __filename = __fileURLToPath(import.meta.url);
|
|
6
|
+
const __dirname = __dirname_(__filename);
|
|
7
|
+
import{CAN_MAX,ChannelPath,HttpError,forbidden,unauthorized}from"./chunk-NMY2YZ6M.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];if(value===void 0)return!1;let given=String(value);return(typeof allowed=="string"?[allowed]:allowed).some(one=>{let prefix=name==="sub"?subPrefix(one):null;return prefix===null?given===one:given.startsWith(prefix)})})?"principal":null}}function subPrefix(value){if(!value.endsWith("*"))return null;let prefix=value.slice(0,-1);return/.[:/]$/.test(prefix)&&!prefix.includes("*")?prefix: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};
|
|
@@ -4,4 +4,4 @@ import { dirname as __dirname_ } from 'node:path';
|
|
|
4
4
|
const require = __createRequire(import.meta.url);
|
|
5
5
|
const __filename = __fileURLToPath(import.meta.url);
|
|
6
6
|
const __dirname = __dirname_(__filename);
|
|
7
|
-
import{permissionsAggregateCommand}from"./chunk-
|
|
7
|
+
import{permissionsAggregateCommand}from"./chunk-JDDPCL3K.js";import{tagsAggregateCommand}from"./chunk-23FY4PR3.js";import{imageAggregateCommand}from"./chunk-6FEMU5YF.js";import{packageName}from"./chunk-B4KA3ZH2.js";import{formatOption,jsonOption,limitOption,projectOption,yesOption}from"./chunk-DORCX7UB.js";var projectScopeOption={...projectOption,shorthand:"p",description:"Project name or ID (default: linked project)."},nextOption={name:"next",shorthand:null,type:String,deprecated:!1,description:"Show the next page using the cursor from the previous output",argument:"CURSOR"},cursorOption={name:"cursor",shorthand:"c",type:String,deprecated:!0,description:"Cursor from a previous page to continue listing from",argument:"STRING"},platformOption={name:"platform",shorthand:null,type:String,deprecated:!1,description:"Target platform for the build (default: linux/amd64).",argument:"PLATFORM"},pushOption={name:"push",shorthand:null,type:Boolean,deprecated:!1,description:"Push the image after building. With Docker this builds and pushes in one step (Buildx enables zstd compression); Podman and Buildah build, then push with zstd compression."},publicOption={name:"public",shorthand:null,type:Boolean,deprecated:!1,description:"Make the repository public.",legacyValues:{on:"true",off:"false"}},noPublicOption={name:"no-public",shorthand:null,type:Boolean,deprecated:!1,description:"Make the repository private."},listSubcommand={name:"ls",aliases:["list"],description:"List container registry repositories for a project",arguments:[],options:[projectScopeOption,limitOption,nextOption,cursorOption,formatOption,jsonOption],examples:[{name:"List repositories in the linked project",value:`${packageName} vcr ls`},{name:"List repositories for a specific project as JSON",value:`${packageName} vcr ls --project my-app --json`}]},inspectSubcommand={name:"inspect",aliases:["get"],description:"Show details for a single repository",arguments:[{name:"repository",required:!0}],options:[projectScopeOption,formatOption,jsonOption],examples:[{name:"Inspect a repository by name",value:`${packageName} vcr inspect my-repository`}]},addSubcommand={name:"create",aliases:["add"],description:"Create a container registry repository",arguments:[{name:"name",required:!0}],options:[projectScopeOption,formatOption,jsonOption],examples:[{name:"Create a repository",value:`${packageName} vcr create my-repository`}]},configSubcommand={name:"update",aliases:["config"],description:"Update a container registry repository, such as the repository's visibility",arguments:[{name:"repository",required:!0}],options:[publicOption,noPublicOption,projectScopeOption,formatOption,jsonOption],examples:[{name:"Make a repository public",value:`${packageName} vcr update my-repository --public`},{name:"Make a repository private",value:`${packageName} vcr update my-repository --no-public`}]},removeSubcommand={name:"delete",aliases:["rm","del","remove"],description:"Delete a container registry repository",arguments:[{name:"repository",required:!0}],options:[projectScopeOption,yesOption,formatOption,jsonOption],examples:[{name:"Delete a repository",value:`${packageName} vcr delete my-repository`},{name:"Delete a repository without the confirmation prompt",value:`${packageName} vcr delete my-repository --yes`}]},loginSubcommand={name:"login",aliases:[],description:"Authenticate a container tool (docker, podman, or buildah) with the Vercel Container Registry",arguments:[{name:"engine",required:!0}],options:[projectScopeOption,formatOption,jsonOption],examples:[{name:"Log in with Docker",value:`${packageName} vcr login docker`},{name:"Log in with Podman",value:`${packageName} vcr login podman`},{name:"Log in with Buildah",value:`${packageName} vcr login buildah`},{name:"Log in for a specific project",value:`${packageName} vcr login docker --project my-app`}]},buildSubcommand={name:"build",aliases:[],description:"Build a container image tagged for the Vercel Container Registry by shelling out to your container tool (docker, podman, or buildah)",arguments:[{name:"engine",required:!0},{name:"path",required:!1},{name:"name",required:!1}],options:[projectScopeOption,platformOption,pushOption],examples:[{name:"Build the current directory into the linked project (repository defaults to the project name, tag to latest)",value:`${packageName} vcr build docker`},{name:"Build and push in one step (Docker Buildx enables zstd compression)",value:`${packageName} vcr build docker --push`},{name:"Build a specific context path with a repository and tag",value:`${packageName} vcr build docker ./app my-api:1.2.3`},{name:"Pass extra options through to the container tool",value:`${packageName} vcr build docker . -- --no-cache --build-arg KEY=value`}]},pushSubcommand={name:"push",aliases:[],description:"Push a container image to the Vercel Container Registry by shelling out to your container tool (docker, podman, or buildah)",arguments:[{name:"engine",required:!0},{name:"name",required:!1}],options:[projectScopeOption],examples:[{name:"Push the linked project image (repository defaults to the project name, tag to latest)",value:`${packageName} vcr push docker`},{name:"Push a specific repository and tag",value:`${packageName} vcr push docker my-api:1.2.3`}]},vcrCommand={name:"vcr",aliases:[],description:"Manage Vercel Container Registry repositories and images (see `vcr image`).",arguments:[],subcommands:[listSubcommand,inspectSubcommand,addSubcommand,configSubcommand,removeSubcommand,loginSubcommand,buildSubcommand,pushSubcommand,tagsAggregateCommand,imageAggregateCommand,permissionsAggregateCommand],options:[],examples:[{name:"List repositories in the linked project",value:`${packageName} vcr ls`},{name:"Create a repository",value:`${packageName} vcr create my-app`},{name:"List images in a repository",value:`${packageName} vcr image ls my-app`}]};export{listSubcommand,inspectSubcommand,addSubcommand,configSubcommand,removeSubcommand,loginSubcommand,buildSubcommand,pushSubcommand,vcrCommand};
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { createRequire as __createRequire } from 'node:module';
|
|
2
|
+
import { fileURLToPath as __fileURLToPath } from 'node:url';
|
|
3
|
+
import { dirname as __dirname_ } from 'node:path';
|
|
4
|
+
const require = __createRequire(import.meta.url);
|
|
5
|
+
const __filename = __fileURLToPath(import.meta.url);
|
|
6
|
+
const __dirname = __dirname_(__filename);
|
|
7
|
+
import{ORGANIZATION_ID_PREFIX,OrganizationResponseError,getOrganization,isPrefixedId,listOrganizations}from"./chunk-AVXX4Q6S.js";import{isAPIError}from"./chunk-QFE3RPMA.js";import{getCommandName}from"./chunk-B4KA3ZH2.js";async function findOrganization(client,value){if(value.startsWith(ORGANIZATION_ID_PREFIX)&&!isPrefixedId(value,ORGANIZATION_ID_PREFIX))return{error:"Provide a valid organization ID."};let organization;try{organization=value.startsWith(ORGANIZATION_ID_PREFIX)?await getOrganization(client,value):(await listOrganizations(client)).organizations.find(org=>org.slug===value)}catch(err){if(isAPIError(err)&&err.status===404)organization=void 0;else{if(isAPIError(err)||err instanceof OrganizationResponseError)return{error:err.message};throw err}}return organization?{value:{id:organization.organizationId,slug:organization.slug}}:{error:`Couldn't find organization ${value}. List yours with ${getCommandName("organizations list")}.`}}export{findOrganization};
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { createRequire as __createRequire } from 'node:module';
|
|
2
|
+
import { fileURLToPath as __fileURLToPath } from 'node:url';
|
|
3
|
+
import { dirname as __dirname_ } from 'node:path';
|
|
4
|
+
const require = __createRequire(import.meta.url);
|
|
5
|
+
const __filename = __fileURLToPath(import.meta.url);
|
|
6
|
+
const __dirname = __dirname_(__filename);
|
|
7
|
+
import{__commonJS}from"./chunk-BZENIQ7N.js";var require_balanced_match=__commonJS({"../../node_modules/.pnpm/balanced-match@1.0.2/node_modules/balanced-match/index.js"(exports,module){"use strict";module.exports=balanced;function balanced(a,b,str){a instanceof RegExp&&(a=maybeMatch(a,str)),b instanceof RegExp&&(b=maybeMatch(b,str));var r=range(a,b,str);return r&&{start:r[0],end:r[1],pre:str.slice(0,r[0]),body:str.slice(r[0]+a.length,r[1]),post:str.slice(r[1]+b.length)}}function maybeMatch(reg,str){var m=str.match(reg);return m?m[0]:null}balanced.range=range;function range(a,b,str){var begs,beg,left,right,result,ai=str.indexOf(a),bi=str.indexOf(b,ai+1),i=ai;if(ai>=0&&bi>0){if(a===b)return[ai,bi];for(begs=[],left=str.length;i>=0&&!result;)i==ai?(begs.push(i),ai=str.indexOf(a,i+1)):begs.length==1?result=[begs.pop(),bi]:(beg=begs.pop(),beg<left&&(left=beg,right=bi),bi=str.indexOf(b,i+1)),i=ai<bi&&ai>=0?ai:bi;begs.length&&(result=[left,right])}return result}}});export{require_balanced_match};
|
|
@@ -4,7 +4,7 @@ import { dirname as __dirname_ } from 'node:path';
|
|
|
4
4
|
const require = __createRequire(import.meta.url);
|
|
5
5
|
const __filename = __fileURLToPath(import.meta.url);
|
|
6
6
|
const __dirname = __dirname_(__filename);
|
|
7
|
-
import{ROOT_HELP_GROUPS}from"./chunk-
|
|
7
|
+
import{ROOT_HELP_GROUPS}from"./chunk-RHFNVIFD.js";import{buildCommandExampleLines,buildCommandOptionLines,createHelpTheme,helpColumns,helpLiterals,helpRows,helpSection,helpUsage}from"./chunk-5727HGA6.js";import{globalCommandOptions}from"./chunk-DORCX7UB.js";var ROOT_HELP_EXAMPLES=[{name:"Deploy the current directory",value:"vercel"},{name:"Deploy a linked project without prompts",value:"vercel deploy --yes --non-interactive"},{name:"Show help for a command",value:"vercel domains --help"},{name:"Find the command for a task and show its help page",value:'vercel help search "add a domain" --with-help'}];function help(commands,columns=80,theme=createHelpTheme()){columns=helpColumns(columns);let sections=Object.keys(ROOT_HELP_GROUPS).flatMap(group=>{let rows=commands.filter(command=>command.group===group);return rows.length?[helpSection(group,helpRows(rows.map(command=>({syntax:helpLiterals(command.names),description:`${command.description}${command.default?" (default)":""}`})),columns,theme),theme)]:[]});return[`${helpUsage(theme)} ${theme.reference("vercel")} [options] [command | path]`,...sections,buildCommandOptionLines([...globalCommandOptions,{name:"changelog",shorthand:null,type:Boolean,deprecated:!1,description:"Show the 5 latest Vercel product updates"}],{columns,theme},"Global Options"),buildCommandExampleLines({examples:ROOT_HELP_EXAMPLES},columns,theme)].filter(Boolean).join(`
|
|
8
8
|
|
|
9
9
|
`)+`
|
|
10
10
|
`}export{ROOT_HELP_EXAMPLES,help};
|
|
@@ -4,7 +4,7 @@ import { dirname as __dirname_ } from 'node:path';
|
|
|
4
4
|
const require = __createRequire(import.meta.url);
|
|
5
5
|
const __filename = __fileURLToPath(import.meta.url);
|
|
6
6
|
const __dirname = __dirname_(__filename);
|
|
7
|
-
import{humanizeReference,renderAlertTable}from"./chunk-
|
|
7
|
+
import{humanizeReference,renderAlertTable}from"./chunk-MMMJO2M3.js";import{truncateEnd,truncateMiddle}from"./chunk-ID663OJ7.js";import{formatDate}from"./chunk-HRR57QNP.js";import{printAlignedLabel}from"./chunk-M2Q2DUHO.js";import{buildCommandWithGlobalFlags}from"./chunk-CSNP5RIM.js";import{output_manager_default}from"./chunk-RYSO5U3E.js";import{quoteArg}from"./chunk-DORCX7UB.js";import{require_source}from"./chunk-NB2WLB3J.js";import{__toESM}from"./chunk-BZENIQ7N.js";var import_chalk=__toESM(require_source(),1);function formatBoolean(value){return value?"yes":"no"}function formatOperator(operator){return{gt:">",gte:">=",lt:"<",lte:"<="}[operator]??operator}function formatPublicRuleScope(rule){let scope=rule.ruleScope;return scope.type==="all"?"all projects":scope.type==="project"?`project: ${scope.projectId}`:`${scope.type}: ${scope.projectIds.join(", ")}`}function formatMetricSelection(metric){let modifiers=[metric.per?`per ${metric.per}`:void 0,metric.normalize?`normalize ${metric.normalize}`:void 0,metric.dimensions?.length?`dimensions ${metric.dimensions.join(", ")}`:void 0].filter(Boolean);return`${metric.aggregation} ${metric.metric}${modifiers.length?` (${modifiers.join("; ")})`:""}`}function formatCustomTrigger(trigger){let minimum=trigger.minimum?`; minimum ${trigger.minimum.output} >= ${trigger.minimum.threshold}`:"";return trigger.type==="anomaly"?`${trigger.output} ${formatAnomalyDirection(trigger)} anomaly at ${trigger.standardDeviations} standard deviations${minimum}`:`${trigger.output} ${formatOperator(trigger.operator)} ${trigger.threshold}${minimum}`}function formatAnomalyDirection(trigger){return trigger.direction==="below"?"drop":"spike"}function formatCustomCondition(rule){if(!rule.querySupported)return"Query unavailable via API";let query=rule.evaluation.query,output=query.outputs[0];return`${query.formulas?.[output]?`${output} = ${query.formulas[output]}`:query.metrics[output]?formatMetricSelection(query.metrics[output]):output}; ${formatCustomTrigger(rule.trigger)}; ${rule.evaluation.window}`}function formatBuiltInCondition(rule){return`${rule.triggers.mode==="all"?"all triggers":rule.triggers.items.map(trigger=>humanizeReference(trigger.type)).join(", ")}; minimum ${rule.matchMinimumSeverityLevel}`}function formatRuleCondition(rule){return rule.type==="built-in"?formatBuiltInCondition(rule):formatCustomCondition(rule)}function printRules(rules){let rows=[["Name","Monitor ID","Type","Scope","Condition"].map(header=>import_chalk.default.cyan(header)),...rules.map(rule=>[import_chalk.default.bold(truncateEnd(rule.name,36)),import_chalk.default.dim(rule.id),rule.isDefault?`${rule.type} (default)`:rule.type,truncateMiddle(formatPublicRuleScope(rule),38),truncateEnd(formatRuleCondition(rule),72)])];output_manager_default.print(`
|
|
8
8
|
${renderAlertTable(rows,2)}
|
|
9
9
|
`)}function commonRows(rule){return[["Name",rule.name],["Monitor ID",rule.id],["Type",rule.type],["Scope",formatPublicRuleScope(rule)],["Default",formatBoolean(rule.isDefault)],...rule.createdAt?[["Created",formatDate(rule.createdAt)]]:[],...rule.updatedAt?[["Updated",formatDate(rule.updatedAt)]]:[]]}function notificationRows(rule){return[["Team owner notifications",formatBoolean(rule.notificationSettings.enableTeamOwnerNotifications)],...rule.notificationSettings.incidentIoRoutingKey?[["Incident.io routing key",rule.notificationSettings.incidentIoRoutingKey]]:[]]}function printBuiltInRule(rule){output_manager_default.print(`${import_chalk.default.cyan("Built-in conditions")}
|
|
10
10
|
|
|
@@ -25,7 +25,7 @@ ${import_chalk.default.cyan("Metrics")}
|
|
|
25
25
|
`),output_manager_default.print(`
|
|
26
26
|
${import_chalk.default.cyan("Trigger")}
|
|
27
27
|
|
|
28
|
-
`),output_manager_default.print(`${renderAlertTable([["Type",rule.trigger.type],["Output",rule.trigger.output],...rule.trigger.type==="threshold"?[["Operator",rule.trigger.operator],["Threshold",String(rule.trigger.threshold)]]:[["Standard Deviations",String(rule.trigger.standardDeviations)]],...rule.trigger.minimum?[["Minimum Output",rule.trigger.minimum.output],["Minimum Threshold",String(rule.trigger.minimum.threshold)]]:[]],3)}
|
|
28
|
+
`),output_manager_default.print(`${renderAlertTable([["Type",rule.trigger.type],["Output",rule.trigger.output],...rule.trigger.type==="threshold"?[["Operator",rule.trigger.operator],["Threshold",String(rule.trigger.threshold)]]:[["Direction",rule.trigger.direction==="below"?"below baseline (drop)":"above baseline (spike)"],["Standard Deviations",String(rule.trigger.standardDeviations)]],...rule.trigger.minimum?[["Minimum Output",rule.trigger.minimum.output],["Minimum Threshold",String(rule.trigger.minimum.threshold)]]:[]],3)}
|
|
29
29
|
`)}function printRule(rule){output_manager_default.print(`
|
|
30
30
|
${import_chalk.default.bold("Monitor")} ${import_chalk.default.cyan(rule.id)}
|
|
31
31
|
${renderAlertTable(commonRows(rule),3)}
|
|
@@ -4,4 +4,4 @@ import { dirname as __dirname_ } from 'node:path';
|
|
|
4
4
|
const require = __createRequire(import.meta.url);
|
|
5
5
|
const __filename = __fileURLToPath(import.meta.url);
|
|
6
6
|
const __dirname = __dirname_(__filename);
|
|
7
|
-
import{confirmOption,deploymentOption,environmentOption,forceOption,formatOption,jsonOption,projectOption,targetOption,yesOption}from"./chunk-
|
|
7
|
+
import{confirmOption,deploymentOption,environmentOption,forceOption,formatOption,jsonOption,projectOption,targetOption,yesOption}from"./chunk-DORCX7UB.js";var deprecatedArchiveSplitTgz="split-tgz",initSubcommand={name:"init",aliases:[],description:"Create a manual deployment that can be continued later",hidden:!0,arguments:[],options:[{...forceOption,deprecatedShorthand:"f",description:"Force a new deployment even if nothing has changed"},{name:"with-cache",shorthand:null,type:Boolean,deprecated:!1,description:'Retain build cache when using "--force"'},{name:"env",shorthand:null,type:[String],argument:"KEY=VALUE",deprecated:!1,description:"Specify environment variables during run-time (e.g. `--env KEY1=value1 --env KEY2=value2`)"},{name:"build-env",shorthand:null,type:[String],argument:"KEY=VALUE",deprecated:!1,description:"Specify environment variables during build-time (e.g. `--build-env KEY1=value1 --build-env KEY2=value2`)"},{name:"meta",shorthand:null,deprecatedShorthand:"m",type:[String],argument:"KEY=VALUE",deprecated:!1,description:"Specify metadata for the deployment (e.g. `--meta KEY1=value1 --meta KEY2=value2`)"},{name:"regions",shorthand:null,type:String,argument:"REGION",deprecated:!1,description:"Set default regions to enable the deployment on"},{name:"prod",shorthand:null,type:Boolean,deprecated:!1,description:"Create a production deployment (shorthand for `--environment production`)"},{name:"archive",shorthand:null,type:String,argument:"FORMAT",deprecated:!1,description:"Compress the deployment code into an archive before uploading it"},{name:"skip-domain",shorthand:null,type:Boolean,deprecated:!1,description:"Disable the automatic promotion (aliasing) of the relevant domains to a new production deployment. You can use `vc promote` to complete the domain-assignment process later"},{...yesOption,description:"Use default options to skip all prompts"},{...environmentOption,shorthand:null,description:"Environment to deploy to: production, preview, or a custom environment"},targetOption,formatOption,jsonOption,confirmOption,projectOption],examples:[{name:"Create a manual deployment",value:"vercel deploy init"},{name:"Create a manual production deployment",value:"vercel deploy init --prod"}]},continueSubcommand={name:"continue",aliases:[],description:"Continue a manual deployment by uploading build outputs",hidden:!0,arguments:[],options:[{...deploymentOption,description:"The deployment ID to continue (e.g. dpl_xxx)"},{name:"id",shorthand:null,type:String,deprecated:!0},{name:"archive",shorthand:null,type:String,argument:"FORMAT",deprecated:!1,description:"Compress the deployment code into an archive before uploading it"},{name:"error",shorthand:null,type:String,argument:"MESSAGE",deprecated:!1,description:"Mark the deployment as errored with a message"}],examples:[{name:"Continue a deployment by ID",value:"vercel deploy continue --deployment dpl_xxx"}]},describeSubcommand={name:"describe",aliases:[],description:"Prepare deployment functions for provisioning in your AWS account",hidden:!0,arguments:[],options:[{...deploymentOption,description:"Deployment ID used with vercel build --deployment (required)"},{name:"id",shorthand:null,type:String,deprecated:!0},{name:"aws-account-id",shorthand:null,type:String,argument:"AWS_ACCOUNT",deprecated:!1,description:"12-digit AWS account ID for provisioning (required)"},jsonOption],examples:[{name:"Prepare a deployment for provisioning",value:"vercel deploy describe --deployment dpl_xxx --aws-account-id 123456789012"},{name:"Return artifact paths as JSON",value:"vercel deploy describe --deployment dpl_xxx --aws-account-id 123456789012 --json"}],helpSections:[{title:"Notes",body:["Uses the team in .vercel/project.json. Run vercel build --deployment first.","Writes descriptor.json, function ZIPs, and runtime layers to .vercel/<DEPLOYMENT>/. Keep these artifacts private.","Preserves the original build in .vercel/<DEPLOYMENT>/build/ and replaces .vercel/output with a code-free continuation.","Does not create AWS resources. Provision the described functions before running vercel deploy continue --deployment <DEPLOYMENT>.","Edge Functions and service outputs are not supported."]}]},deployCommand={name:"deploy",aliases:[],description:"Deploy your project to Vercel. Use `--temporary` to create a temporary deployment without logging in. The `deploy` command is the default command for the Vercel CLI, and can be omitted (`vc deploy my-app` equals `vc my-app`). Use `--dry` to inspect the detected framework preset and source files without deploying.",arguments:[{name:"project-path",required:!1}],subcommands:[initSubcommand,continueSubcommand,describeSubcommand],options:[{...forceOption,deprecatedShorthand:"f",description:"Force a new deployment even if nothing has changed"},{name:"with-cache",shorthand:null,type:Boolean,deprecated:!1,description:'Retain build cache when using "--force"'},{name:"env",shorthand:null,type:[String],argument:"KEY=VALUE",deprecated:!1,description:"Specify environment variables during run-time (e.g. `--env KEY1=value1 --env KEY2=value2`)"},{name:"build-env",shorthand:null,type:[String],argument:"KEY=VALUE",deprecated:!1,description:"Specify environment variables during build-time (e.g. `--build-env KEY1=value1 --build-env KEY2=value2`)"},{name:"turbo",shorthand:null,type:Boolean,deprecated:!1,description:"Use a Turbo build machine for this deployment"},{name:"meta",shorthand:null,deprecatedShorthand:"m",type:[String],argument:"KEY=VALUE",deprecated:!1,description:"Specify metadata for the deployment (e.g. `--meta KEY1=value1 --meta KEY2=value2`)"},{name:"regions",shorthand:null,type:String,argument:"REGION",deprecated:!1,description:"Set default regions to enable the deployment on"},{name:"prebuilt",shorthand:null,type:Boolean,deprecated:!1,description:"Use in combination with `vc build`. Deploy an existing build"},{name:"prod",shorthand:null,type:Boolean,deprecated:!1,description:"Create a production deployment (shorthand for `--environment production`)"},{name:"temporary",shorthand:null,type:Boolean,deprecated:!1,description:"Create a temporary deployment without logging in. When logged in, use `--delete-project-after` instead"},{name:"delete-project-after",shorthand:null,type:String,argument:"DURATION",deprecated:!1,description:"Create a temporary project that is deleted automatically after 1h, 1d, 1w, 2w, or 30d. Only applies when the deploy creates the project"},{name:"archive",shorthand:null,type:String,argument:"FORMAT",deprecated:!1,description:"Compress the deployment code into an archive before uploading it"},{name:"no-wait",shorthand:null,type:Boolean,deprecated:!1,description:"Don't wait for the deployment to finish"},{name:"verify",shorthand:null,type:Boolean,deprecated:!1,description:"Load the deployment URL once it is ready and report the status code, size, and page title, even with Deployment Protection on (creates the project's Protection Bypass for Automation secret if missing). Exits 1 if the load fails. Can't be used with --no-wait or --dry"},{name:"dry",shorthand:null,type:Boolean,deprecated:!1,description:"Inspect the detected framework preset and source files without uploading or creating a deployment. Non-TTY output includes every file as JSON"},{name:"create-if-missing",shorthand:null,type:Boolean,deprecated:!1,description:"Create the --project if it doesn't exist yet. Needed only when --project names a new project with --yes or in non-interactive mode. Can't be used with --dry"},{name:"skip-domain",shorthand:null,type:Boolean,deprecated:!1,description:"Disable the automatic promotion (aliasing) of the relevant domains to a new production deployment. You can use `vc promote` to complete the domain-assignment process later"},{...yesOption,description:"Use default options to skip all prompts"},{name:"logs",shorthand:null,deprecatedShorthand:"l",type:Boolean,deprecated:!1,description:"Print the build logs"},{name:"guidance",shorthand:null,type:Boolean,deprecated:!1,description:"Receive command suggestions once deployment is complete"},{name:"no-logs",shorthand:null,type:Boolean,deprecated:!0,description:"Do not print the build logs"},{name:"name",shorthand:"n",type:String,deprecated:!0},{name:"no-clipboard",shorthand:null,type:Boolean,deprecated:!0},{...environmentOption,shorthand:null,description:"Environment to deploy to: production, preview, or a custom environment"},targetOption,formatOption,jsonOption,confirmOption,{...projectOption,description:"Project name or ID to deploy to, without linking this directory (default: linked project). A missing name is created; with --yes or in non-interactive mode, add --create-if-missing"}],examples:[{name:"Deploy the current directory",value:"vercel"},{name:"Deploy a single HTML file",value:"vercel ./index.html"},{name:"Deploy a custom path",value:"vercel /usr/src/project"},{name:"Deploy to production and check that the URL loads",value:"vercel deploy --prod --verify"},{name:"Deploy with run-time Environment Variables",value:"vercel --env NODE_ENV=production"},{name:"Deploy with prebuilt outputs",value:["vercel build","vercel deploy --prebuilt"]},{name:"Deploy using a Turbo build machine",value:"vercel deploy --turbo"},{name:"Inspect deployment inputs without deploying",value:"vercel deploy --dry"},{name:"Get every deployment file as JSON",value:"vercel deploy --dry --json"},{name:"Write Deployment URL to a file",value:"vercel > deployment-url.txt"}]};export{deprecatedArchiveSplitTgz,initSubcommand,continueSubcommand,describeSubcommand,deployCommand};
|
|
@@ -0,0 +1,15 @@
|
|
|
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-FXLZM6Q7.js";import{HOMEBREW_UPGRADE_COMMAND,execPackageManager,findTrustedExecutable,getUpdateCommandInfo,getUpgradePackageManager,isGlobal,packageManagerInvocation,requireTrustedUpgradeDirectory,trustedUpgradeEnvironment,withEnvironmentOverrides}from"./chunk-KVXEYKIX.js";import{withDirectoryLock}from"./chunk-TABMJZVW.js";import{progress}from"./chunk-U56NHYAH.js";import{getInstallRoot,isNativeBinaryInstall}from"./chunk-NWGBDBZI.js";import{require_semver}from"./chunk-BPUANOGW.js";import{require_ci_info}from"./chunk-EYRBV6RM.js";import{getCachedUsername,require_lib}from"./chunk-4Z6R5KHZ.js";import{pkg_default}from"./chunk-BOJDM3O7.js";import{output_manager_default}from"./chunk-RYSO5U3E.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 packageManagerEnvironment(packageManager,env){return withEnvironmentOverrides(env,getUpgradePackageManager(packageManager).env)}async function requireExecutable(name,env){let executable=await findTrustedExecutable(name,env);if(!executable)throw new Error(`${name} is not in a directory that PATH names in full`);return executable}async function execFileStdout(packageManager,args,cwd,env=trustedUpgradeEnvironment){return execPackageManager(await requireExecutable(packageManager,env),args,{cwd,env:packageManagerEnvironment(packageManager,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(" "),cwd=requireTrustedUpgradeDirectory();output_manager_default.debug(`Executing: ${HOMEBREW_UPGRADE_COMMAND}`);let executable=await requireExecutable(brew,env).catch(error=>error),result=await new Promise(resolve2=>{if(typeof executable!="string"){resolve2({code:1,spawnError:executable});return}let settled=!1,brewProcess=spawn(executable,args,{cwd,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?requireTrustedUpgradeDirectory():process.cwd(),executable=await requireExecutable(command,env).catch(error=>error),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{if(typeof executable!="string")throw executable;invocation=packageManagerInvocation(executable,currentArgs,env)}catch(spawnError){resolve2({code:1,stdout:"",stderr:"",spawnError});return}let upgradeProcess=spawn(invocation.file,invocation.args,{cwd,env:packageManagerEnvironment(packageManager,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};
|
|
@@ -4,4 +4,4 @@ import { dirname as __dirname_ } from 'node:path';
|
|
|
4
4
|
const require = __createRequire(import.meta.url);
|
|
5
5
|
const __filename = __fileURLToPath(import.meta.url);
|
|
6
6
|
const __dirname = __dirname_(__filename);
|
|
7
|
-
import{external_exports}from"./chunk-2AMO2VMV.js";import{PaginationError}from"./chunk-
|
|
7
|
+
import{external_exports}from"./chunk-2AMO2VMV.js";import{PaginationError}from"./chunk-7RABG6HV.js";var positionSchema=external_exports.object({cursor:external_exports.string().min(1).optional(),offset:external_exports.number().int().min(0)});function encodeListCursor(position){return Buffer.from(JSON.stringify(position)).toString("base64url")}function decodeListCursor(value){try{let decoded=JSON.parse(Buffer.from(value,"base64url").toString()),parsed=positionSchema.safeParse(decoded);return parsed.success?parsed.data:void 0}catch{return}}function sliceList(items,start,limit){if(start.cursor!==void 0)return;let end=start.offset+limit;return{items:items.slice(start.offset,end),next:end<items.length?encodeListCursor({offset:end}):null}}async function collectList(fetchPage,start,limit,{maxPages=100}={}){let items=[],seen=new Set,position=start;for(let pages=0;pages<maxPages;pages++){let page=await fetchPage(position.cursor),remaining=page.items.slice(position.offset),taken=remaining.slice(0,limit-items.length);if(items.push(...taken),taken.length<remaining.length){let offset=position.offset+taken.length;return{items,next:encodeListCursor({cursor:position.cursor,offset})}}if(!page.cursor)return{items,next:null};if(seen.has(page.cursor))throw new PaginationError("Pagination returned a cursor it already returned. The list is incomplete.");if(seen.add(page.cursor),position={cursor:page.cursor,offset:0},items.length===limit)return{items,next:encodeListCursor(position)}}return{items,next:encodeListCursor(position)}}export{decodeListCursor,sliceList,collectList};
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { createRequire as __createRequire } from 'node:module';
|
|
2
|
+
import { fileURLToPath as __fileURLToPath } from 'node:url';
|
|
3
|
+
import { dirname as __dirname_ } from 'node:path';
|
|
4
|
+
const require = __createRequire(import.meta.url);
|
|
5
|
+
const __filename = __fileURLToPath(import.meta.url);
|
|
6
|
+
const __dirname = __dirname_(__filename);
|
|
7
|
+
import{parseArguments}from"./chunk-INIZJZ3O.js";import{require_cli_config}from"./chunk-4SAVH3H7.js";import{__toESM}from"./chunk-BZENIQ7N.js";var config=__toESM(require_cli_config(),1);import path from"node:path";var INVOCATION_CWD=Symbol.for("vercel.cli.invocation-cwd"),startupCwd=process.cwd();function getInvocationCwd(){let cwd=Reflect.get(globalThis,INVOCATION_CWD);return typeof cwd=="string"?cwd:startupCwd}function getGlobalPathConfig2(argvSlice=process.argv.slice(2),cwd=getInvocationCwd()){let confFlag=parseArguments(argvSlice,{},{permissive:!0}).flags["--global-config"];return confFlag?path.resolve(cwd,confFlag):config.getGlobalPathConfig()}export{getInvocationCwd,getGlobalPathConfig2 as getGlobalPathConfig};
|
|
@@ -0,0 +1,23 @@
|
|
|
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{isGuidanceEnabled}from"./chunk-TAAWMNNL.js";import{jsonNextStep,writeJsonFailure}from"./chunk-4Z6R5KHZ.js";import{ua_default}from"./chunk-MTZYPCZ7.js";import{fetch}from"./chunk-MY4MONOH.js";import{AGENT_REASON,AGENT_STATUS,getExitCodeForReason,omitGlobalFlagsFromArgs}from"./chunk-CSNP5RIM.js";import{output_manager_default}from"./chunk-RYSO5U3E.js";import{remoteText}from"./chunk-SQ62IODX.js";import{require_source}from"./chunk-NB2WLB3J.js";import{__toESM}from"./chunk-BZENIQ7N.js";var import_chalk=__toESM(require_source(),1);function styledCommand(step){return step.template?step.command:import_chalk.default.cyan(step.command)}function formatNextSteps(steps){if(steps.length===0)return"";if(steps.length===1)return`
|
|
8
|
+
${steps[0].label}:
|
|
9
|
+
${styledCommand(steps[0])}
|
|
10
|
+
`;let list=steps.map(step=>` ${step.label}:
|
|
11
|
+
${styledCommand(step)}`).join(`
|
|
12
|
+
|
|
13
|
+
`);return`
|
|
14
|
+
${import_chalk.default.bold("Next steps:")}
|
|
15
|
+
${list}
|
|
16
|
+
`}function printNextSteps(steps){steps.length>0&&output_manager_default.print(formatNextSteps(steps))}var VercelContentError=class extends Error{constructor(reason,message,options={}){super(message);this.reason=reason;this.options=options;this.name="VercelContentError"}};async function requestVercelContent(url,accept){try{return await fetch(url,{headers:{accept,"user-agent":ua_default}})}catch{throw new VercelContentError(AGENT_REASON.NETWORK_ERROR,"Couldn't reach vercel.com. Check your internet connection.")}}function unexpectedResponse(messages,status){return new VercelContentError(AGENT_REASON.API_ERROR,messages.unexpected,status===void 0?{}:{data:{status}})}function responseError(response,messages){return response.status===429?new VercelContentError(AGENT_REASON.RATE_LIMITED,messages.rateLimited,{retryable:!0}):unexpectedResponse(messages,response.status)}async function readJson(response,messages){try{return await response.json()}catch{throw unexpectedResponse(messages)}}async function fetchMarkdown(url,messages,notFound){let response=await requestVercelContent(url,"text/markdown");if(response.status===404)throw notFound();if(!response.ok)throw responseError(response,messages);try{return await response.text()}catch{throw unexpectedResponse(messages)}}function markdownForStdout(client,markdown){let text=client.stdout.isTTY?markdown.split(`
|
|
17
|
+
`).map(line=>line.split(" ").map(remoteText).join(" ")).join(`
|
|
18
|
+
`):markdown;return text.endsWith(`
|
|
19
|
+
`)?text:`${text}
|
|
20
|
+
`}var MAX_SEARCH_QUERY_LENGTH=200;function createFailureReporter(client,state){let rerun={label:"Run the command again",args:omitGlobalFlagsFromArgs(client.argv.slice(2)),literal:!0},nextStep=recovery=>{let step=jsonNextStep(client,recovery.args,recovery.when);return recovery.literal?step:{...step,command:step.command.replace(/'(<[a-z]+>)'/g,"$1")}},fail=(reason,message,options={})=>{output_manager_default.stopSpinner();let exitCode=getExitCodeForReason(reason),{recovery}=options;if(state.json()){let next=recovery?[nextStep(recovery)]:void 0;return writeJsonFailure(client,{status:AGENT_STATUS.ERROR,reason,message,...next?{next}:{},...options.data?{data:options.data}:{},...options.retryable?{retryable:!0}:{},...state.warnings.length?{warnings:state.warnings}:{}},exitCode)}return output_manager_default.fatal(message),recovery&&output_manager_default.print(`
|
|
21
|
+
${recovery.label}:
|
|
22
|
+
${nextStep(recovery).command}
|
|
23
|
+
`),exitCode};return{fail,usageError:(message,reason=AGENT_REASON.INVALID_ARGUMENTS)=>fail(reason,message,{recovery:{label:"See all options",args:state.helpArgs()}}),nextStep,failWithError:(error,notFound)=>{let recovery=error.reason===AGENT_REASON.RATE_LIMITED?{...rerun,label:"Wait a few seconds, then run it again"}:error.reason===AGENT_REASON.NETWORK_ERROR?rerun:error.reason===AGENT_REASON.NOT_FOUND?notFound:error.reason===AGENT_REASON.API_ERROR?{label:"Check the Vercel status",args:["health"]}:void 0;return fail(error.reason,error.message,{...error.options,recovery})}}}var SEARCH_LABELS={docs:"Search the docs",kb:"Search Knowledge Base guides",templates:"Search templates"},QUERY_PLACEHOLDER="<query>";function relatedSearches(client,from,query){if(!isGuidanceEnabled(client,void 0,!0))return[];let carried=query?.trim(),usable=carried&&carried.length<=MAX_SEARCH_QUERY_LENGTH&&!carried.startsWith("-")?carried:void 0;return Object.keys(SEARCH_LABELS).filter(command=>command!==from).map(command=>{let step=jsonNextStep(client,[command,"search",usable??QUERY_PLACEHOLDER]);return{label:SEARCH_LABELS[command],argv:step.argv,template:!usable,command:usable?step.command:step.command.replace(`'${QUERY_PLACEHOLDER}'`,QUERY_PLACEHOLDER)}})}export{printNextSteps,VercelContentError,requestVercelContent,unexpectedResponse,responseError,readJson,fetchMarkdown,markdownForStdout,MAX_SEARCH_QUERY_LENGTH,createFailureReporter,relatedSearches};
|
|
@@ -4,4 +4,4 @@ import { dirname as __dirname_ } from 'node:path';
|
|
|
4
4
|
const require = __createRequire(import.meta.url);
|
|
5
5
|
const __filename = __fileURLToPath(import.meta.url);
|
|
6
6
|
const __dirname = __dirname_(__filename);
|
|
7
|
-
import{Diagnostic,init_dist}from"./chunk-
|
|
7
|
+
import{Diagnostic,init_dist}from"./chunk-RYSO5U3E.js";init_dist();var FIX_BY_CODE={missing_build_script:"Add a `build` script to your `package.json`, or set a Build Command in your Project Settings.",MISSING_DOTENV_VARS:"Define the missing variables in your `.env` file, or pull them with `vercel env pull`.",MAX_LAMBDA_SIZE_EXCEEDED:"Reduce the function bundle \u2014 trim dependencies or included files, or split the function.",NODE_DEPENDENCY_SYNC_FAILED:"Install your dependencies (e.g. `npm install`) and confirm they resolve, then retry.",INSTALL_COMMAND_FAILED:"Fix the dependency error logged above, then retry.",CONFLICTING_CONFIG_FILES:"Keep a single configuration file \u2014 remove the extra `vercel.json`/`now.json`.",CANT_PARSE_JSON_FILE:"Fix the JSON syntax error at the location shown above, then retry."};function toDiagnostic(err,{syscall,fixes={},fallback}){if(err instanceof Diagnostic)return err;let source=err,message=typeof source?.message=="string"?source.message:String(err),isSyscall=typeof source?.errno=="number"||typeof source?.syscall=="string",code=typeof source?.code=="string"?source.code:void 0,docs=typeof source?.link=="string"?source.link:void 0,action=typeof source?.action=="string"?source.action:void 0,fix=code?Object.hasOwn(fixes,code)?fixes[code]:Object.hasOwn(FIX_BY_CODE,code)?FIX_BY_CODE[code]:void 0:void 0,diagnostic=isSyscall&&syscall?syscall(message,err):!code&&fallback?fallback(message,err):new Diagnostic({why:message,fix,docs,cause:err});return code&&!(isSyscall&&syscall)&&(diagnostic.name=code),docs&&(diagnostic.docs=docs),action&&(diagnostic.action=action),diagnostic}export{FIX_BY_CODE,toDiagnostic};
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { createRequire as __createRequire } from 'node:module';
|
|
2
|
+
import { fileURLToPath as __fileURLToPath } from 'node:url';
|
|
3
|
+
import { dirname as __dirname_ } from 'node:path';
|
|
4
|
+
const require = __createRequire(import.meta.url);
|
|
5
|
+
const __filename = __fileURLToPath(import.meta.url);
|
|
6
|
+
const __dirname = __dirname_(__filename);
|
|
7
|
+
import{repositoryPermissionsClearPath}from"./chunk-DFVNL5ML.js";import{emitVcrArgParseError,handleVcrApiError,requireVcrRepository,resolveVcrScope,validateVcrJsonOutput}from"./chunk-WGU2IQPY.js";import"./chunk-OOPF73RV.js";import"./chunk-M32HBBPK.js";import"./chunk-D3M2JG5C.js";import"./chunk-GD7AV7BO.js";import{permissionsClearSubcommand}from"./chunk-JDDPCL3K.js";import"./chunk-VIOIR6II.js";import"./chunk-4Z6R5KHZ.js";import"./chunk-M2Q2DUHO.js";import"./chunk-4HR3I3ML.js";import"./chunk-3AFEVHHY.js";import"./chunk-LUX4PBJL.js";import"./chunk-MTZYPCZ7.js";import"./chunk-OPORM35X.js";import"./chunk-D6REP5QQ.js";import"./chunk-FBYA6LLM.js";import"./chunk-MY4MONOH.js";import"./chunk-ZRFDZO7Y.js";import"./chunk-MXTC4ZAQ.js";import{printError}from"./chunk-HMJR6RVF.js";import{parseArguments}from"./chunk-INIZJZ3O.js";import{AGENT_REASON,buildCommandWithYes,outputAgentError}from"./chunk-CSNP5RIM.js";import"./chunk-KA2KG3SY.js";import"./chunk-AW33SRYY.js";import"./chunk-4SAVH3H7.js";import"./chunk-4NTBYNFR.js";import{isAPIError}from"./chunk-QFE3RPMA.js";import"./chunk-B4KA3ZH2.js";import"./chunk-BOJDM3O7.js";import{output_manager_default}from"./chunk-RYSO5U3E.js";import"./chunk-BLUPZPAS.js";import"./chunk-5MDNVAE6.js";import"./chunk-7HQZRU25.js";import"./chunk-YTSGFU5T.js";import"./chunk-7EJQLVWX.js";import"./chunk-SCV7XEEO.js";import"./chunk-MCYG7CCE.js";import"./chunk-YHPPP3SF.js";import"./chunk-SQ62IODX.js";import{getFlagsSpecification}from"./chunk-DORCX7UB.js";import"./chunk-2BKALEOP.js";import"./chunk-NB2WLB3J.js";import"./chunk-ISWW3DKF.js";import"./chunk-BRQUZ5NC.js";import"./chunk-67GZ5REA.js";import"./chunk-BS32OUOC.js";import"./chunk-BZENIQ7N.js";async function clear(client,argv,telemetry){let parsedArgs;try{parsedArgs=parseArguments(argv,getFlagsSpecification(permissionsClearSubcommand.options))}catch(err){return emitVcrArgParseError(client,err,"vcr permissions <repository> clear"),printError(err),2}let fr=validateVcrJsonOutput(client,parsedArgs.flags);if(typeof fr=="number")return fr;let repository=parsedArgs.args[0],project=parsedArgs.flags["--project"],skipConfirmation=!!parsedArgs.flags["--yes"];telemetry.trackCliOptionProject(project),telemetry.trackCliFlagYes(parsedArgs.flags["--yes"]),telemetry.trackCliOptionFormat(parsedArgs.flags["--format"]);let missingRepository=requireVcrRepository(client,repository,fr.jsonOutput,"vcr permissions <repository> clear");if(typeof missingRepository=="number")return missingRepository;let scope=await resolveVcrScope(client,{project,jsonOutput:fr.jsonOutput});if(typeof scope=="number")return scope;if(!skipConfirmation&&(outputAgentError(client,{status:"error",reason:AGENT_REASON.CONFIRMATION_REQUIRED,message:"Clearing repository permissions removes access for every team. Re-run with --yes.",next:[{command:buildCommandWithYes(client.argv)}]},1),!await client.input.confirm(`Remove access to ${repository} for all teams? They will no longer be able to pull its images.`,!1)))return output_manager_default.log("Canceled"),0;let path=repositoryPermissionsClearPath(scope,repository);output_manager_default.spinner("Clearing repository permissions...");try{return await client.fetch(path,{method:"DELETE"}),fr.jsonOutput?client.stdout.write(`${JSON.stringify({repository,cleared:!0},null,2)}
|
|
8
|
+
`):output_manager_default.success(`Cleared repository permissions for ${repository}`),0}catch(err){if(isAPIError(err))return handleVcrApiError(client,err,fr.jsonOutput);throw err}finally{output_manager_default.stopSpinner()}}export{clear as default};
|