vercel 59.14.0 → 59.15.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/chunks/add-7XFD2OHW.js +8 -0
- package/dist/chunks/add-HZC7AUBY.js +8 -0
- package/dist/chunks/add-PYUNJZ6K.js +8 -0
- package/dist/chunks/build-EFKQ6BND.js +7 -0
- package/dist/chunks/chunk-2B2MN3U5.js +8 -0
- package/dist/chunks/chunk-2H77IRPI.js +9 -0
- package/dist/chunks/chunk-2I64AYHG.js +7 -0
- package/dist/chunks/chunk-2PPXY24N.js +20 -0
- package/dist/chunks/chunk-2S6PE6GB.js +7 -0
- package/dist/chunks/{chunk-PIMIVJYK.js → chunk-3FMJYJUR.js} +7 -32
- package/dist/chunks/chunk-3IAQUNQH.js +7 -0
- package/dist/chunks/chunk-3QHJYVCY.js +7 -0
- package/dist/chunks/chunk-3QT7VOE3.js +7 -0
- package/dist/chunks/chunk-3TXEXPUW.js +7 -0
- package/dist/chunks/chunk-4MZK6JT6.js +7 -0
- package/dist/chunks/chunk-4NE5IQ25.js +7 -0
- package/dist/chunks/chunk-4PNSSS3L.js +7 -0
- package/dist/chunks/chunk-4QX77CP7.js +7 -0
- package/dist/chunks/chunk-57GHYR4Y.js +25 -0
- package/dist/chunks/chunk-5QQNYN4N.js +7 -0
- package/dist/chunks/chunk-5XJNPXQK.js +7 -0
- package/dist/chunks/chunk-6L236MNA.js +7 -0
- package/dist/chunks/chunk-6PFC3KWQ.js +7 -0
- package/dist/chunks/chunk-6QKS6QK7.js +7 -0
- package/dist/chunks/chunk-6RIQPTJA.js +8 -0
- package/dist/chunks/chunk-6TAQ6OWD.js +13 -0
- package/dist/chunks/chunk-6YAADRQB.js +9 -0
- package/dist/chunks/chunk-75CPY75D.js +15 -0
- package/dist/chunks/chunk-7HL2RPUO.js +7 -0
- package/dist/chunks/chunk-7PNYOSDU.js +9 -0
- package/dist/chunks/chunk-7R5FEXZ5.js +7 -0
- package/dist/chunks/chunk-7RMCBXBB.js +62 -0
- package/dist/chunks/chunk-7RR7MIMT.js +7 -0
- package/dist/chunks/chunk-7T6TL3GQ.js +7 -0
- package/dist/chunks/chunk-ADUYPK2G.js +13 -0
- package/dist/chunks/chunk-AFPOIDM5.js +7 -0
- package/dist/chunks/chunk-AM46JVVN.js +7 -0
- package/dist/chunks/chunk-AVSPFBLM.js +7 -0
- package/dist/chunks/chunk-B4ATVYZW.js +7 -0
- package/dist/chunks/chunk-BATE73HA.js +9 -0
- package/dist/chunks/{chunk-64IF634X.js → chunk-BRK4OB4B.js} +1 -12
- package/dist/chunks/chunk-BVH2AEFE.js +7 -0
- package/dist/chunks/chunk-CN2QZO4U.js +7 -0
- package/dist/chunks/chunk-COQGD2EI.js +8 -0
- package/dist/chunks/chunk-CUAIEGNE.js +7 -0
- package/dist/chunks/chunk-CVKB54WW.js +7 -0
- package/dist/chunks/{chunk-A3NYPUKZ.js → chunk-CZSOZKHX.js} +1 -11
- package/dist/chunks/chunk-D4MW3RDW.js +7 -0
- package/dist/chunks/chunk-DFVNL5ML.js +7 -0
- package/dist/chunks/chunk-EE3FVJLV.js +16 -0
- package/dist/chunks/chunk-EGMJRU5P.js +28 -0
- package/dist/chunks/chunk-ENBTTYJR.js +7 -0
- package/dist/chunks/chunk-ENS6KX2F.js +7 -0
- package/dist/chunks/chunk-EOBD4ZEG.js +8 -0
- package/dist/chunks/chunk-EOCTK4EA.js +7 -0
- package/dist/chunks/chunk-EQ52F4LH.js +7 -0
- package/dist/chunks/chunk-ETV3C2CV.js +7 -0
- package/dist/chunks/chunk-EVZRQGNK.js +7 -0
- package/dist/chunks/chunk-F2ZWW2IO.js +8 -0
- package/dist/chunks/chunk-FAW6NBLQ.js +7 -0
- package/dist/chunks/chunk-FI772UVH.js +7 -0
- package/dist/chunks/chunk-FKCOBJFH.js +7 -0
- package/dist/chunks/chunk-FVGESGJI.js +45 -0
- package/dist/chunks/chunk-G5FC5ZCO.js +9 -0
- package/dist/chunks/chunk-G6CTAHKY.js +39 -0
- package/dist/chunks/chunk-G7Y77DFH.js +7 -0
- package/dist/chunks/chunk-GHAY4PSD.js +7 -0
- package/dist/chunks/chunk-GHM7V3GG.js +7 -0
- package/dist/chunks/chunk-GRNTLNC7.js +7 -0
- package/dist/chunks/chunk-GTRGQIY2.js +10 -0
- package/dist/chunks/chunk-GU6VIFR5.js +7 -0
- package/dist/chunks/{constants-YMCRE6IG.js → chunk-GZNDA6SV.js} +2 -9
- package/dist/chunks/chunk-HBFPLBTX.js +10 -0
- package/dist/chunks/chunk-HEGJZJO7.js +7 -0
- package/dist/chunks/chunk-HSJ6AHWG.js +12 -0
- package/dist/chunks/chunk-HTC6KO2B.js +7 -0
- package/dist/chunks/chunk-HVUHCRZB.js +18 -0
- package/dist/chunks/chunk-HZZ5L472.js +7 -0
- package/dist/chunks/chunk-IVSSTHB6.js +7 -0
- package/dist/chunks/chunk-IVWPQYIH.js +7 -0
- package/dist/chunks/chunk-J3U3L45Y.js +7 -0
- package/dist/chunks/chunk-JAJW3P42.js +7 -0
- package/dist/chunks/chunk-JEIMW3CO.js +7 -0
- package/dist/chunks/chunk-JIYY3B4C.js +7 -0
- package/dist/chunks/chunk-JKTQV2QJ.js +7 -0
- package/dist/chunks/chunk-JTVVBRW7.js +7 -0
- package/dist/chunks/chunk-JYAUUIR4.js +7 -0
- package/dist/chunks/chunk-JZRMH5UA.js +7 -0
- package/dist/chunks/chunk-K2RAW5DI.js +10 -0
- package/dist/chunks/chunk-K3KJZLBD.js +7 -0
- package/dist/chunks/chunk-KK4AJES5.js +36 -0
- package/dist/chunks/chunk-KKS7XWEX.js +7 -0
- package/dist/chunks/chunk-KNEWCUWF.js +14 -0
- package/dist/chunks/chunk-KO733OJG.js +9 -0
- package/dist/chunks/chunk-L243RUIR.js +19 -0
- package/dist/chunks/chunk-L3JDEHCQ.js +7 -0
- package/dist/chunks/chunk-LDM3SQAU.js +13 -0
- package/dist/chunks/chunk-LNPMDXBJ.js +7 -0
- package/dist/chunks/chunk-M2W3HKV3.js +23 -0
- package/dist/chunks/chunk-M2XARQBF.js +9 -0
- package/dist/chunks/chunk-M5AV545M.js +7 -0
- package/dist/chunks/chunk-MAVRGZQP.js +7 -0
- package/dist/chunks/chunk-MBL6TXEJ.js +7 -0
- package/dist/chunks/chunk-MEAY2K5Z.js +11 -0
- package/dist/chunks/chunk-MY4MONOH.js +7 -0
- package/dist/chunks/chunk-N3N5UHIL.js +7 -0
- package/dist/chunks/chunk-N3ZZ7FHQ.js +7 -0
- package/dist/chunks/chunk-N6CNMMSZ.js +7 -0
- package/dist/chunks/chunk-NBVY237X.js +7 -0
- package/dist/chunks/chunk-NGNOUPWS.js +25 -0
- package/dist/chunks/chunk-NHTF332K.js +7 -0
- package/dist/chunks/chunk-NNP5NITU.js +15 -0
- package/dist/chunks/chunk-NS4FH2TY.js +11 -0
- package/dist/chunks/chunk-NUGLE4QY.js +11 -0
- package/dist/chunks/chunk-NWFHHUKZ.js +7 -0
- package/dist/chunks/chunk-O7G3CZ42.js +7 -0
- package/dist/chunks/chunk-OD6RZ3XZ.js +8 -0
- package/dist/chunks/chunk-OHDEHZLX.js +7 -0
- package/dist/chunks/chunk-OK3S6KFX.js +16 -0
- package/dist/chunks/chunk-OKZDOANA.js +23 -0
- package/dist/chunks/chunk-OSCCYU74.js +7 -0
- package/dist/chunks/chunk-OUHPDA7Q.js +7 -0
- package/dist/chunks/chunk-P2O5DOYE.js +7 -0
- package/dist/chunks/chunk-PHW54NU5.js +13 -0
- package/dist/chunks/chunk-PPCFQQSU.js +7 -0
- package/dist/chunks/chunk-QGIGNMII.js +8 -0
- package/dist/chunks/chunk-QGIQK47P.js +7 -0
- package/dist/chunks/chunk-QHJLRTVY.js +7 -0
- package/dist/chunks/{chunk-2473DUBR.js → chunk-QR7QPUFN.js} +1 -9
- package/dist/chunks/chunk-QTKJC2O5.js +7 -0
- package/dist/chunks/chunk-R2TGGVCT.js +19 -0
- package/dist/chunks/chunk-RAIBQIKB.js +7 -0
- package/dist/chunks/chunk-RCTYVKM5.js +16 -0
- package/dist/chunks/chunk-RKAUVPOQ.js +86 -0
- package/dist/chunks/chunk-S5CEIACD.js +7 -0
- package/dist/chunks/chunk-SGWVKRSR.js +8 -0
- package/dist/chunks/chunk-SOJCELXH.js +7 -0
- package/dist/chunks/chunk-SXUEGVWB.js +7 -0
- package/dist/chunks/{chunk-GGPE5377.js → chunk-T3GQAMBJ.js} +1 -9
- package/dist/chunks/chunk-T52FMXWC.js +7 -0
- package/dist/chunks/chunk-TG2RCYTH.js +7 -0
- package/dist/chunks/chunk-TJCIHDPZ.js +9 -0
- package/dist/chunks/chunk-TKBXN4H3.js +9 -0
- package/dist/chunks/chunk-TRTEXGVN.js +7 -0
- package/dist/chunks/chunk-TXELFFNK.js +15 -0
- package/dist/chunks/chunk-U56NHYAH.js +7 -0
- package/dist/chunks/chunk-U7KCDTCH.js +12 -0
- package/dist/chunks/chunk-UETTIYUQ.js +8 -0
- package/dist/chunks/chunk-UGMZQZJE.js +24 -0
- package/dist/chunks/chunk-ULLWCOYC.js +7 -0
- package/dist/chunks/chunk-UXTHEQVJ.js +21 -0
- package/dist/chunks/chunk-VLZ47RWM.js +44 -0
- package/dist/chunks/chunk-WKZ6JSGZ.js +7 -0
- package/dist/chunks/chunk-WPS6JZF6.js +7 -0
- package/dist/chunks/chunk-WRILLB46.js +7 -0
- package/dist/chunks/chunk-WUZD4KBL.js +7 -0
- package/dist/chunks/chunk-XCJDGQO7.js +7 -0
- package/dist/chunks/{pkg-56KRLZ5K.js → chunk-XD2LZRBS.js} +1 -7
- package/dist/chunks/chunk-XFVGX5HG.js +7 -0
- package/dist/chunks/chunk-XHOGOH6N.js +7 -0
- package/dist/chunks/{update-route-version-E3V47KNI.js → chunk-XPXOV5UO.js} +1 -7
- package/dist/chunks/chunk-XQ73QIQ3.js +7 -0
- package/dist/chunks/chunk-XSVBYDYI.js +8 -0
- package/dist/chunks/chunk-YKZLKOOD.js +12 -0
- package/dist/chunks/chunk-YMVDWVMO.js +7 -0
- package/dist/chunks/chunk-YPTLSODC.js +7 -0
- package/dist/chunks/chunk-YV6CTDHR.js +7 -0
- package/dist/chunks/chunk-Z6Y55QJW.js +23 -0
- package/dist/chunks/chunk-ZDX75YNZ.js +7 -0
- package/dist/chunks/chunk-ZIPVX7LD.js +7 -0
- package/dist/chunks/chunk-ZKYS7EAB.js +7 -0
- package/dist/chunks/chunk-ZT6KDLLY.js +20 -0
- package/dist/chunks/chunk-ZXE4XYIV.js +7 -0
- package/dist/chunks/chunk-ZZQRMRWD.js +20 -0
- package/dist/chunks/cjs-GOQHXIHX.js +54 -0
- package/dist/chunks/clear-5NQAVWIF.js +8 -0
- package/dist/chunks/compile-vercel-config-6J2XUFRK.js +7 -0
- package/dist/chunks/config-CKYRXZXL.js +7 -0
- package/dist/chunks/config-VNUY4RJ4.js +8 -0
- package/dist/chunks/connect-git-provider-GIU5WZ52.js +7 -0
- package/dist/chunks/constants-G4UYVLOF.js +7 -0
- package/dist/chunks/create-project-SRQGD4JY.js +7 -0
- package/dist/chunks/delete-GTXXCSKQ.js +10 -0
- package/dist/chunks/delete-HRJEO4MI.js +9 -0
- package/dist/chunks/detect-projects-2GNCZ4CS.js +7 -0
- package/dist/chunks/detect-services-GHILEGNU.js +7 -0
- package/dist/chunks/disable-RWCRVG5O.js +7 -0
- package/dist/chunks/discard-SHFIYCJU.js +14 -0
- package/dist/chunks/edit-DMO3NSO2.js +9 -0
- package/dist/chunks/edit-EVQI2RSS.js +8 -0
- package/dist/chunks/enable-AWDU6STD.js +7 -0
- package/dist/chunks/esm-7HVUFWMN.js +7 -0
- package/dist/chunks/esm-BZBEM7YA.js +7 -0
- package/dist/chunks/esm-CXICLFA3.js +9 -0
- package/dist/chunks/esm-HDEHVK7I.js +9 -0
- package/dist/chunks/esm-NQRLKALI.js +20 -0
- package/dist/chunks/esm-SZZI53W7.js +7 -0
- package/dist/chunks/esm-WGJFGCLK.js +7 -0
- package/dist/chunks/exec-4AISDHUV.js +16372 -0
- package/dist/chunks/export-IQKTA4RS.js +19 -0
- package/dist/chunks/fetch-proxy-AEAWC6MD.js +7 -0
- package/dist/chunks/future-E2FHKPJN.js +7 -0
- package/dist/chunks/generate-cert-for-deploy-VKOWC4PZ.js +7 -0
- package/dist/chunks/image-LDFYNOCA.js +7 -0
- package/dist/chunks/import-builders-P7CXSX2D.js +7 -0
- package/dist/chunks/inspect-3N47ODIH.js +15 -0
- package/dist/chunks/inspect-53SGDDAH.js +20 -0
- package/dist/chunks/inspect-5INZDUQS.js +19 -0
- package/dist/chunks/inspect-WMT2M335.js +9 -0
- package/dist/chunks/inspect-Y6BUCOUV.js +13 -0
- package/dist/chunks/list-BIAPHKFM.js +11 -0
- package/dist/chunks/list-DMOCRRSE.js +16 -0
- package/dist/chunks/list-K5J7OULR.js +10 -0
- package/dist/chunks/login-DEAEVUHM.js +7 -0
- package/dist/chunks/login-SRVNHI4Y.js +9 -0
- package/dist/chunks/logs-GK7CJBYY.js +7 -0
- package/dist/chunks/ls-7ZX6DCJW.js +12 -0
- package/dist/chunks/ls-AJWN5ZR4.js +12 -0
- package/dist/chunks/ls-BFJWCRLZ.js +12 -0
- package/dist/chunks/ls-KGIE6HCO.js +12 -0
- package/dist/chunks/ls-UVKTHBTE.js +8 -0
- package/dist/chunks/ls-WEG45IOC.js +8 -0
- package/dist/chunks/native-self-update-KOJVRMHR.js +7 -0
- package/dist/chunks/open-OEWPI5G6.js +7 -0
- package/dist/chunks/openapi-MO5HYMHR.js +7 -0
- package/dist/chunks/permissions-EPQBQFE3.js +7 -0
- package/dist/chunks/pkg-YFU67U7I.js +7 -0
- package/dist/chunks/prompt-missing-credentials-IUHLYSQU.js +7 -0
- package/dist/chunks/publish-JG7MEPWT.js +15 -0
- package/dist/chunks/pull-MRKXG6TO.js +7 -0
- package/dist/chunks/purchase-domain-if-available-O5ARXEZ5.js +7 -0
- package/dist/chunks/push-XOXJDFYO.js +7 -0
- package/dist/chunks/query-AL7C6WV2.js +12 -0
- package/dist/chunks/reauthenticate-SH4XR7NH.js +7 -0
- package/dist/chunks/reorder-5DMRFDBY.js +10 -0
- package/dist/chunks/reply-WSRNZWFD.js +9 -0
- package/dist/chunks/repo-info-to-url-SK3VX6UL.js +7 -0
- package/dist/chunks/resolve-YJUXQVOZ.js +12 -0
- package/dist/chunks/resolve-deployment-framework-preset-XF3NJIDS.js +7 -0
- package/dist/chunks/restore-QT3DBGKU.js +16 -0
- package/dist/chunks/rm-MHPIUEZ5.js +8 -0
- package/dist/chunks/rm-MVZFU6RG.js +8 -0
- package/dist/chunks/rm-PXR4J2US.js +8 -0
- package/dist/chunks/rm-WB2AIP3N.js +8 -0
- package/dist/chunks/rm-XRP6MRUT.js +8 -0
- package/dist/chunks/routes-5DERZV5M.js +7 -0
- package/dist/chunks/rule-inspect-TT3DRGCS.js +8 -0
- package/dist/chunks/rules-B5GW4KJH.js +7 -0
- package/dist/chunks/schema-JY5QTZOG.js +14 -0
- package/dist/chunks/schema-KCNKVFT3.js +44 -0
- package/dist/chunks/select-org-KSCYSESV.js +7 -0
- package/dist/chunks/set-7BANEWEL.js +7 -0
- package/dist/chunks/setup-and-link-ZAV3EFGC.js +7 -0
- package/dist/chunks/slugify-O5DBATYT.js +7 -0
- package/dist/chunks/stamp-OX4YO3KY.js +7 -0
- package/dist/chunks/tags-VZR66NUC.js +7 -0
- package/dist/chunks/types-LRXQEDYI.js +14 -0
- package/dist/chunks/update-RBFNNSWE.js +8 -0
- package/dist/chunks/update-route-version-XZAFPQJC.js +7 -0
- package/dist/chunks/utils-B5ZTMQKY.js +58 -0
- package/dist/chunks/vlt-builder-importer-YVCYYRVV.js +11 -0
- package/dist/commands/build/index.js +24 -4925
- package/dist/commands/deploy/index.js +43 -2875
- package/dist/commands/dev/index.js +56 -23857
- package/dist/commands/env/index.js +26 -3411
- package/dist/commands/link/index.js +4 -284
- package/dist/commands/list/index.js +6 -566
- package/dist/commands-bulk.js +1187 -87691
- package/dist/help.js +1 -8
- package/dist/index.js +19 -2591
- package/dist/version.mjs +1 -1
- package/package.json +50 -51
- package/dist/chunks/add-EQZRT4XL.js +0 -221
- package/dist/chunks/add-KMDROZC3.js +0 -196
- package/dist/chunks/add-QPJ3XMBV.js +0 -145
- package/dist/chunks/build-W4HPTAOB.js +0 -251
- package/dist/chunks/chunk-26CU4Q3C.js +0 -598
- package/dist/chunks/chunk-2HSQ7YUK.js +0 -93
- package/dist/chunks/chunk-2JIX6UMI.js +0 -4626
- package/dist/chunks/chunk-2LCFOK66.js +0 -1536
- package/dist/chunks/chunk-332LMJLZ.js +0 -16014
- package/dist/chunks/chunk-3HZLXCVL.js +0 -137
- package/dist/chunks/chunk-3VM7HWF6.js +0 -104
- package/dist/chunks/chunk-3ZE5CFVM.js +0 -346
- package/dist/chunks/chunk-4IALDGB7.js +0 -22
- package/dist/chunks/chunk-4KD5BYHB.js +0 -127
- package/dist/chunks/chunk-4TUMNBEE.js +0 -231
- package/dist/chunks/chunk-4WG2MYCI.js +0 -163
- package/dist/chunks/chunk-57RHXXXG.js +0 -150
- package/dist/chunks/chunk-5AJPMLDV.js +0 -28
- package/dist/chunks/chunk-5EIV6LPQ.js +0 -305
- package/dist/chunks/chunk-5NF5HOBJ.js +0 -1854
- package/dist/chunks/chunk-653QRQAD.js +0 -417
- package/dist/chunks/chunk-67CRVWDF.js +0 -81
- package/dist/chunks/chunk-6E6KPBXY.js +0 -43
- package/dist/chunks/chunk-75VENWDN.js +0 -1892
- package/dist/chunks/chunk-7MRDIPJY.js +0 -107
- package/dist/chunks/chunk-7NRNFV77.js +0 -875
- package/dist/chunks/chunk-7Q45OKWR.js +0 -149
- package/dist/chunks/chunk-AHU7WNL2.js +0 -24
- package/dist/chunks/chunk-AINIBIP4.js +0 -39
- package/dist/chunks/chunk-AJ5HUOWB.js +0 -14059
- package/dist/chunks/chunk-AKLTIZCU.js +0 -46
- package/dist/chunks/chunk-AQ6P3IGG.js +0 -49
- package/dist/chunks/chunk-B5NH7SLK.js +0 -324
- package/dist/chunks/chunk-B5XLQKHI.js +0 -849
- package/dist/chunks/chunk-BEQV3X2L.js +0 -86
- package/dist/chunks/chunk-CAHP7UGE.js +0 -79
- package/dist/chunks/chunk-CFDDM4TX.js +0 -13618
- package/dist/chunks/chunk-CJV7J7B5.js +0 -314
- package/dist/chunks/chunk-CV5YC2EN.js +0 -867
- package/dist/chunks/chunk-CXFY6A6W.js +0 -255
- package/dist/chunks/chunk-D5SMZXVO.js +0 -233
- package/dist/chunks/chunk-E336ZXPP.js +0 -43
- package/dist/chunks/chunk-EDMW7SBH.js +0 -246
- package/dist/chunks/chunk-EFYMIIER.js +0 -40
- package/dist/chunks/chunk-EKPSCRJZ.js +0 -26
- package/dist/chunks/chunk-EOZFDJSY.js +0 -18
- package/dist/chunks/chunk-EWBCSDTM.js +0 -1708
- package/dist/chunks/chunk-EZKW5YJ2.js +0 -177
- package/dist/chunks/chunk-F2QLCXCF.js +0 -2399
- package/dist/chunks/chunk-FGDKMNEN.js +0 -21
- package/dist/chunks/chunk-FRVG4OW3.js +0 -7438
- package/dist/chunks/chunk-FVF4UHDM.js +0 -1288
- package/dist/chunks/chunk-G5FBSUL4.js +0 -822
- package/dist/chunks/chunk-GDOUDU6O.js +0 -74
- package/dist/chunks/chunk-GGP5R3FU.js +0 -129
- package/dist/chunks/chunk-GVNCVKCI.js +0 -68
- package/dist/chunks/chunk-GY5I4AYD.js +0 -122
- package/dist/chunks/chunk-GZLPFESR.js +0 -48
- package/dist/chunks/chunk-HB4UKFDO.js +0 -1295
- package/dist/chunks/chunk-HD4DR3DA.js +0 -818
- package/dist/chunks/chunk-HKHXKSXQ.js +0 -152
- package/dist/chunks/chunk-HM24ZWQL.js +0 -174
- package/dist/chunks/chunk-HRXRELD3.js +0 -338
- package/dist/chunks/chunk-IB5L4LKZ.js +0 -1082
- package/dist/chunks/chunk-IIMSID24.js +0 -104
- package/dist/chunks/chunk-J7JKZM4T.js +0 -58
- package/dist/chunks/chunk-JC2O346E.js +0 -137
- package/dist/chunks/chunk-JSD4EZL3.js +0 -34
- package/dist/chunks/chunk-JZXJZX7O.js +0 -257
- package/dist/chunks/chunk-K3RED3VO.js +0 -566
- package/dist/chunks/chunk-KFWQ3EFH.js +0 -151
- package/dist/chunks/chunk-KW7BS25T.js +0 -466
- package/dist/chunks/chunk-KXDWXXJH.js +0 -70
- package/dist/chunks/chunk-LERVNZTD.js +0 -90
- package/dist/chunks/chunk-LYAAQDNS.js +0 -242
- package/dist/chunks/chunk-M5I6INNF.js +0 -61
- package/dist/chunks/chunk-N6HP5BLI.js +0 -18190
- package/dist/chunks/chunk-ND5CF2H3.js +0 -53
- package/dist/chunks/chunk-NFU4XJIR.js +0 -120
- package/dist/chunks/chunk-NW34PW6V.js +0 -1772
- package/dist/chunks/chunk-OAMU5QO6.js +0 -18
- package/dist/chunks/chunk-OCIZ6ZYA.js +0 -253
- package/dist/chunks/chunk-ORQZKIIB.js +0 -2914
- package/dist/chunks/chunk-P3SKP5WM.js +0 -27
- package/dist/chunks/chunk-P4QNYOFB.js +0 -96
- package/dist/chunks/chunk-P7VSBDR4.js +0 -827
- package/dist/chunks/chunk-PEC3CQSK.js +0 -90
- package/dist/chunks/chunk-PMSMUMUO.js +0 -30
- package/dist/chunks/chunk-PNGVSHR3.js +0 -40
- package/dist/chunks/chunk-POOO7W47.js +0 -916
- package/dist/chunks/chunk-PRWJUY5U.js +0 -848
- package/dist/chunks/chunk-Q2DGFCO7.js +0 -579
- package/dist/chunks/chunk-RBF2NPUP.js +0 -577
- package/dist/chunks/chunk-RBIFXFZX.js +0 -52
- package/dist/chunks/chunk-RDTRWLWB.js +0 -11441
- package/dist/chunks/chunk-RN6V5ODW.js +0 -114
- package/dist/chunks/chunk-RNSMTWA6.js +0 -122
- package/dist/chunks/chunk-RTJASENB.js +0 -59
- package/dist/chunks/chunk-RVBZ64EQ.js +0 -52
- package/dist/chunks/chunk-S7KYDPEM.js +0 -1564
- package/dist/chunks/chunk-SLPSPYVR.js +0 -334
- package/dist/chunks/chunk-SM3F3PYJ.js +0 -522
- package/dist/chunks/chunk-TO7QZGYK.js +0 -105
- package/dist/chunks/chunk-TSBUHSN7.js +0 -3495
- package/dist/chunks/chunk-TSFWMUCY.js +0 -506
- package/dist/chunks/chunk-TZ2YI2VH.js +0 -87
- package/dist/chunks/chunk-UG2WOB5L.js +0 -150
- package/dist/chunks/chunk-UNKHOYMF.js +0 -559
- package/dist/chunks/chunk-UOVWUSLG.js +0 -2099
- package/dist/chunks/chunk-V4RMJKQP.js +0 -36
- package/dist/chunks/chunk-VGIMO3ZK.js +0 -17
- package/dist/chunks/chunk-VGKSIKCC.js +0 -92
- package/dist/chunks/chunk-VP5Y3SZG.js +0 -106
- package/dist/chunks/chunk-VXYGCOKL.js +0 -28
- package/dist/chunks/chunk-W7FGI2GZ.js +0 -233
- package/dist/chunks/chunk-WGGABYO5.js +0 -31
- package/dist/chunks/chunk-XDGOOW3K.js +0 -60
- package/dist/chunks/chunk-XFF5TGRA.js +0 -303
- package/dist/chunks/chunk-XNIZGCN5.js +0 -58
- package/dist/chunks/chunk-XPJLPUKO.js +0 -117
- package/dist/chunks/chunk-XUAWTW4W.js +0 -467
- package/dist/chunks/chunk-YPQSDAEW.js +0 -29
- package/dist/chunks/chunk-YS76T533.js +0 -270
- package/dist/chunks/chunk-ZDU2NODC.js +0 -104
- package/dist/chunks/chunk-ZW6HETRE.js +0 -97
- package/dist/chunks/cjs-DV4RM7XU.js +0 -20743
- package/dist/chunks/clear-4IACMLFU.js +0 -141
- package/dist/chunks/compile-vercel-config-PQQ3OCLV.js +0 -33
- package/dist/chunks/config-BQQKMQBP.js +0 -168
- package/dist/chunks/config-OCPNHXQL.js +0 -127
- package/dist/chunks/delete-HRKIYPCO.js +0 -159
- package/dist/chunks/delete-P2UL3KTU.js +0 -226
- package/dist/chunks/detect-projects-ODNU4PK2.js +0 -18
- package/dist/chunks/detect-services-U7QGT7VO.js +0 -40
- package/dist/chunks/disable-3NYMICQ3.js +0 -198
- package/dist/chunks/discard-RNVEJUK3.js +0 -145
- package/dist/chunks/edit-63S2RQHR.js +0 -162
- package/dist/chunks/edit-CTENFZ7H.js +0 -647
- package/dist/chunks/enable-WILWXAHV.js +0 -204
- package/dist/chunks/exec-4IPHZ55G.js +0 -1291
- package/dist/chunks/export-YHGV3EPK.js +0 -177
- package/dist/chunks/fetch-proxy-R3JZNXBZ.js +0 -99
- package/dist/chunks/image-MWKS2YMB.js +0 -75
- package/dist/chunks/import-builders-H55X5VYD.js +0 -39
- package/dist/chunks/inspect-JTJMK6TO.js +0 -596
- package/dist/chunks/inspect-KBIPLMGR.js +0 -216
- package/dist/chunks/inspect-OP26FDBY.js +0 -171
- package/dist/chunks/inspect-SW4UMWTB.js +0 -175
- package/dist/chunks/inspect-WPLZPVBO.js +0 -145
- package/dist/chunks/list-HE7DWAWH.js +0 -387
- package/dist/chunks/list-OUG7WCT7.js +0 -404
- package/dist/chunks/list-QUSEURJZ.js +0 -426
- package/dist/chunks/login-MIIQJVF3.js +0 -233
- package/dist/chunks/ls-24N3DUK4.js +0 -183
- package/dist/chunks/ls-3Y7KEFKT.js +0 -175
- package/dist/chunks/ls-75F5HIJ5.js +0 -188
- package/dist/chunks/ls-REN6X2X5.js +0 -204
- package/dist/chunks/ls-W4STUDXK.js +0 -223
- package/dist/chunks/ls-Z4CTSD6C.js +0 -210
- package/dist/chunks/open-ARMCLPBK.js +0 -116
- package/dist/chunks/permissions-JKI67F62.js +0 -99
- package/dist/chunks/publish-SMSQ7OX2.js +0 -155
- package/dist/chunks/pull-4QZJZELD.js +0 -45
- package/dist/chunks/push-T6IYQY2J.js +0 -191
- package/dist/chunks/query-CP3JK5LW.js +0 -725
- package/dist/chunks/reorder-RAWKFGLV.js +0 -412
- package/dist/chunks/reply-235UHUD4.js +0 -176
- package/dist/chunks/resolve-5KCLN7QV.js +0 -237
- package/dist/chunks/resolve-deployment-framework-preset-NPE6RLV3.js +0 -36
- package/dist/chunks/restore-D24WAUAN.js +0 -252
- package/dist/chunks/rm-DBQDXSOC.js +0 -162
- package/dist/chunks/rm-G5INO77R.js +0 -148
- package/dist/chunks/rm-NLKSEKZ5.js +0 -195
- package/dist/chunks/rm-QV76CJA4.js +0 -322
- package/dist/chunks/rm-TZ4PDDUK.js +0 -147
- package/dist/chunks/routes-QVMBXOSX.js +0 -24
- package/dist/chunks/rule-inspect-76MC7I2D.js +0 -123
- package/dist/chunks/rules-IDUXVTPG.js +0 -89
- package/dist/chunks/schema-AV6BHGKY.js +0 -237
- package/dist/chunks/schema-QJVQTNB4.js +0 -381
- package/dist/chunks/set-L5NFQSCF.js +0 -250
- package/dist/chunks/setup-and-link-USSVDKCM.js +0 -65
- package/dist/chunks/stamp-AA7R3MZS.js +0 -16
- package/dist/chunks/tags-2NLUU4EC.js +0 -69
- package/dist/chunks/types-4GAJ7XQQ.js +0 -116
- package/dist/chunks/update-WGLBB65M.js +0 -224
- package/dist/chunks/vlt-builder-importer-USCFHWPL.js +0 -322
|
@@ -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{emitVcrArgParseError,handleVcrApiError,resolveVcrScope,validateVcrJsonOutput}from"./chunk-GTRGQIY2.js";import{outputError}from"./chunk-6RIQPTJA.js";import"./chunk-D4MW3RDW.js";import{addSubcommand}from"./chunk-3QT7VOE3.js";import"./chunk-O7G3CZ42.js";import"./chunk-N3N5UHIL.js";import"./chunk-YMVDWVMO.js";import"./chunk-HBFPLBTX.js";import"./chunk-2I64AYHG.js";import"./chunk-SOJCELXH.js";import"./chunk-QTKJC2O5.js";import{AGENT_REASON}from"./chunk-ENBTTYJR.js";import{buildCommandWithGlobalFlags,outputAgentError}from"./chunk-NS4FH2TY.js";import"./chunk-5QQNYN4N.js";import{parseArguments}from"./chunk-HTC6KO2B.js";import"./chunk-5XJNPXQK.js";import{printError}from"./chunk-LNPMDXBJ.js";import"./chunk-MY4MONOH.js";import"./chunk-VLZ47RWM.js";import"./chunk-F2ZWW2IO.js";import"./chunk-B4ATVYZW.js";import"./chunk-PPCFQQSU.js";import{getFlagsSpecification}from"./chunk-JAJW3P42.js";import"./chunk-XSVBYDYI.js";import"./chunk-EVZRQGNK.js";import{isAPIError}from"./chunk-R2TGGVCT.js";import{packageName}from"./chunk-FI772UVH.js";import"./chunk-XFVGX5HG.js";import{output_manager_default}from"./chunk-Z6Y55QJW.js";import"./chunk-QGIQK47P.js";import"./chunk-AVSPFBLM.js";import"./chunk-XCJDGQO7.js";import"./chunk-YPTLSODC.js";import"./chunk-7HL2RPUO.js";import"./chunk-U7KCDTCH.js";import"./chunk-N3ZZ7FHQ.js";import"./chunk-GU6VIFR5.js";import"./chunk-6L236MNA.js";async function add(client,argv,telemetry){let parsedArgs;try{parsedArgs=parseArguments(argv,getFlagsSpecification(addSubcommand.options))}catch(err){return emitVcrArgParseError(client,err,"vcr add <name> --project <name-or-id>"),printError(err),1}let fr=validateVcrJsonOutput(client,parsedArgs.flags);if(typeof fr=="number")return fr;let name=parsedArgs.args[0],project=parsedArgs.flags["--project"];if(telemetry.trackCliOptionProject(project),telemetry.trackCliOptionFormat(parsedArgs.flags["--format"]),!name)return outputAgentError(client,{status:"error",reason:AGENT_REASON.MISSING_ARGUMENTS,message:`Missing repository name. Example: ${packageName} vcr add <name>`,next:[{command:buildCommandWithGlobalFlags(client.argv,"vcr add <name>"),when:"Replace <name> with the repository name to create"}]},1),outputError(client,fr.jsonOutput,"MISSING_ARGUMENTS","Usage: `vercel vcr add <name>`");let scope=await resolveVcrScope(client,{project,jsonOutput:fr.jsonOutput});if(typeof scope=="number")return scope;let path=`/v1/vcr/repository?teamId=${encodeURIComponent(scope.teamId)}`;output_manager_default.spinner("Creating repository...");try{let created=await client.fetch(path,{method:"POST",body:{projectId:scope.projectId,name}});return fr.jsonOutput?client.stdout.write(`${JSON.stringify(created,null,2)}
|
|
8
|
+
`):output_manager_default.success(`Created repository ${created.repository?.name??name}`),0}catch(err){if(isAPIError(err))return handleVcrApiError(client,err,fr.jsonOutput,{retry:{command:buildCommandWithGlobalFlags(client.argv,"vcr ls"),when:"List existing repositories (a name conflict means it already exists)"}});throw err}finally{output_manager_default.stopSpinner()}}export{add as default};
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { createRequire as __createRequire } from 'node:module';
|
|
2
|
+
import { fileURLToPath as __fileURLToPath } from 'node:url';
|
|
3
|
+
import { dirname as __dirname_ } from 'node:path';
|
|
4
|
+
const require = __createRequire(import.meta.url);
|
|
5
|
+
const __filename = __fileURLToPath(import.meta.url);
|
|
6
|
+
const __dirname = __dirname_(__filename);
|
|
7
|
+
import{parseTeamRefs,require_async_sema,teamRefBody}from"./chunk-S5CEIACD.js";import{repositoryPermissionsPath}from"./chunk-DFVNL5ML.js";import{emitVcrArgParseError,resolveVcrScope,validateVcrJsonOutput}from"./chunk-GTRGQIY2.js";import{outputError}from"./chunk-6RIQPTJA.js";import"./chunk-D4MW3RDW.js";import{permissionsAddSubcommand}from"./chunk-YMVDWVMO.js";import"./chunk-HBFPLBTX.js";import"./chunk-2I64AYHG.js";import"./chunk-SOJCELXH.js";import"./chunk-QTKJC2O5.js";import{AGENT_REASON}from"./chunk-ENBTTYJR.js";import{buildCommandWithGlobalFlags,outputAgentError}from"./chunk-NS4FH2TY.js";import"./chunk-5QQNYN4N.js";import{parseArguments}from"./chunk-HTC6KO2B.js";import"./chunk-5XJNPXQK.js";import{printError}from"./chunk-LNPMDXBJ.js";import"./chunk-MY4MONOH.js";import"./chunk-VLZ47RWM.js";import"./chunk-F2ZWW2IO.js";import"./chunk-B4ATVYZW.js";import"./chunk-PPCFQQSU.js";import{getFlagsSpecification}from"./chunk-JAJW3P42.js";import"./chunk-XSVBYDYI.js";import"./chunk-EVZRQGNK.js";import{isAPIError}from"./chunk-R2TGGVCT.js";import{packageName}from"./chunk-FI772UVH.js";import"./chunk-XFVGX5HG.js";import{output_manager_default}from"./chunk-Z6Y55QJW.js";import"./chunk-QGIQK47P.js";import"./chunk-AVSPFBLM.js";import"./chunk-XCJDGQO7.js";import"./chunk-YPTLSODC.js";import"./chunk-7HL2RPUO.js";import"./chunk-U7KCDTCH.js";import"./chunk-N3ZZ7FHQ.js";import"./chunk-GU6VIFR5.js";import{__toESM}from"./chunk-6L236MNA.js";var import_async_sema=__toESM(require_async_sema(),1);var USAGE="vcr permissions <repository> add <team>[,<team>...]";async function add(client,argv,telemetry){let parsedArgs;try{parsedArgs=parseArguments(argv,getFlagsSpecification(permissionsAddSubcommand.options))}catch(err){return emitVcrArgParseError(client,err,USAGE),printError(err),1}let fr=validateVcrJsonOutput(client,parsedArgs.flags);if(typeof fr=="number")return fr;let repository=parsedArgs.args[0],teamRefs=parseTeamRefs(parsedArgs.args.slice(2)),project=parsedArgs.flags["--project"];if(telemetry.trackCliOptionProject(project),telemetry.trackCliOptionFormat(parsedArgs.flags["--format"]),teamRefs.length===0)return outputAgentError(client,{status:"error",reason:AGENT_REASON.MISSING_ARGUMENTS,message:`Missing team. Example: ${packageName} vcr permissions ${repository} add team_1a2b3c4d`,next:[{command:buildCommandWithGlobalFlags(client.argv,USAGE),when:"Replace <team> with a team id or slug (comma-separate multiple teams)"}]},1),outputError(client,fr.jsonOutput,"MISSING_ARGUMENTS",`Usage: \`vercel ${USAGE}\``);let scope=await resolveVcrScope(client,{project,jsonOutput:fr.jsonOutput});if(typeof scope=="number")return scope;let path=repositoryPermissionsPath(scope,repository),added=[],failed=[];output_manager_default.spinner(`Sharing ${repository} with ${teamRefs.length===1?teamRefs[0]:`${teamRefs.length} teams`}...`);let sema=new import_async_sema.default(10),results;try{results=await Promise.all(teamRefs.map(async team=>{await sema.acquire();try{let result=await client.fetch(path,{method:"POST",body:teamRefBody(team)});return{ok:!0,team,permission:result.permission}}catch(err){if(!isAPIError(err))throw err;let message=err.serverMessage||`API error (${err.status}).`;return{ok:!1,team,failure:{team,code:err.code||"API_ERROR",message}}}finally{sema.release()}}))}finally{output_manager_default.stopSpinner()}for(let result of results)result.ok?(added.push(result.permission),fr.jsonOutput||output_manager_default.success(`Shared ${repository} with ${result.permission?.teamSlug??result.team}`)):(failed.push(result.failure),fr.jsonOutput||output_manager_default.error(`Failed to share ${repository} with ${result.team}: ${result.failure.message}`));return failed.length>0&&outputAgentError(client,{status:"error",reason:AGENT_REASON.API_ERROR,message:`Failed to share ${repository} with ${failed.map(f=>`${f.team} (${f.message})`).join(", ")}`},1),fr.jsonOutput&&client.stdout.write(`${JSON.stringify({permissions:added,failed},null,2)}
|
|
8
|
+
`),failed.length>0?1:0}export{add as default};
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { createRequire as __createRequire } from 'node:module';
|
|
2
|
+
import { fileURLToPath as __fileURLToPath } from 'node:url';
|
|
3
|
+
import { dirname as __dirname_ } from 'node:path';
|
|
4
|
+
const require = __createRequire(import.meta.url);
|
|
5
|
+
const __filename = __fileURLToPath(import.meta.url);
|
|
6
|
+
const __dirname = __dirname_(__filename);
|
|
7
|
+
import{printRuleMutationReceipt}from"./chunk-G6CTAHKY.js";import{emitRulesArgParseError,getBodyType,handleRulesApiError,outputRulesError,readRuleBody,resolveRulesProject,resolveRulesTeam,rulesCollectionPath}from"./chunk-TKBXN4H3.js";import"./chunk-7PNYOSDU.js";import"./chunk-AFPOIDM5.js";import"./chunk-6PFC3KWQ.js";import"./chunk-GZNDA6SV.js";import"./chunk-WRILLB46.js";import"./chunk-6RIQPTJA.js";import"./chunk-GHAY4PSD.js";import"./chunk-2PPXY24N.js";import"./chunk-TRTEXGVN.js";import"./chunk-T3GQAMBJ.js";import"./chunk-J3U3L45Y.js";import"./chunk-ZIPVX7LD.js";import"./chunk-NHTF332K.js";import"./chunk-MBL6TXEJ.js";import{validateJsonOutput}from"./chunk-D4MW3RDW.js";import"./chunk-P2O5DOYE.js";import{rulesAddSubcommand}from"./chunk-FKCOBJFH.js";import"./chunk-GHM7V3GG.js";import"./chunk-QR7QPUFN.js";import"./chunk-QTKJC2O5.js";import"./chunk-ENBTTYJR.js";import"./chunk-6TAQ6OWD.js";import"./chunk-WPS6JZF6.js";import"./chunk-NS4FH2TY.js";import"./chunk-5QQNYN4N.js";import"./chunk-RCTYVKM5.js";import{parseArguments}from"./chunk-HTC6KO2B.js";import"./chunk-5XJNPXQK.js";import{printError}from"./chunk-LNPMDXBJ.js";import"./chunk-MY4MONOH.js";import"./chunk-BRK4OB4B.js";import"./chunk-VLZ47RWM.js";import"./chunk-F2ZWW2IO.js";import"./chunk-B4ATVYZW.js";import"./chunk-PPCFQQSU.js";import"./chunk-OSCCYU74.js";import{getFlagsSpecification}from"./chunk-JAJW3P42.js";import"./chunk-XSVBYDYI.js";import"./chunk-EVZRQGNK.js";import{isAPIError}from"./chunk-R2TGGVCT.js";import"./chunk-FI772UVH.js";import"./chunk-XFVGX5HG.js";import{output_manager_default}from"./chunk-Z6Y55QJW.js";import"./chunk-QGIQK47P.js";import"./chunk-AVSPFBLM.js";import"./chunk-XCJDGQO7.js";import"./chunk-YPTLSODC.js";import"./chunk-7HL2RPUO.js";import"./chunk-U7KCDTCH.js";import"./chunk-N3ZZ7FHQ.js";import"./chunk-GU6VIFR5.js";import"./chunk-6L236MNA.js";function applyScopeFlag(client,body,type,scope,flags,jsonOutput){if(Object.hasOwn(body,"ruleScope"))return flags["--project"]||flags["--all"]?outputRulesError(client,jsonOutput,"SCOPE_CONFLICT","Specify rule scope either in the body or with --project/--all, not both."):void 0;if(flags["--project"]){body.ruleScope=type==="custom"?{type:"project",projectId:scope.projectId}:{type:"include",projectIds:[scope.projectId]};return}if(flags["--all"]){if(type==="custom")return outputRulesError(client,jsonOutput,"INVALID_SCOPE","Custom alert rules must target one project. Use --project <name-or-id>.");body.ruleScope={type:"all"};return}return outputRulesError(client,jsonOutput,"MISSING_SCOPE","Missing rule scope. Add ruleScope to the body, or pass --project or --all.")}async function resolveCreateScope(client,flags,jsonOutput){return flags["--project"]&&flags["--all"]?outputRulesError(client,jsonOutput,"MUTUAL_EXCLUSIVITY","Cannot specify both --all and --project. Use one or the other."):flags["--project"]?resolveRulesProject(client,flags["--project"],jsonOutput,"alerts rules add"):resolveRulesTeam(client,jsonOutput)}async function add(client,argv){let parsedArgs;try{parsedArgs=parseArguments(argv,getFlagsSpecification(rulesAddSubcommand.options))}catch(error){return emitRulesArgParseError(client,error,"alerts rules add --project <name-or-id> --body <path>"),printError(error),1}let flags=parsedArgs.flags,format=validateJsonOutput(flags);if(!format.valid)return outputRulesError(client,!1,"INVALID_ARGUMENTS",format.error);if(!flags["--body"])return outputRulesError(client,format.jsonOutput,"MISSING_ARGUMENTS","Missing required flag: --body <PATH>.");let body=readRuleBody(client,flags["--body"],format.jsonOutput);if(typeof body=="number")return body;let type=getBodyType(body);if(!type)return outputRulesError(client,format.jsonOutput,"INVALID_RULE_TYPE","Create body must set type to built-in or custom.");if(Object.hasOwn(body,"ruleScope")&&(flags["--project"]||flags["--all"]))return outputRulesError(client,format.jsonOutput,"SCOPE_CONFLICT","Specify rule scope either in the body or with --project/--all, not both.");if(type==="custom"&&flags["--all"])return outputRulesError(client,format.jsonOutput,"INVALID_SCOPE","Custom alert rules must target one project. Use --project <name-or-id>.");let scope=await resolveCreateScope(client,flags,format.jsonOutput);if(typeof scope=="number")return scope;let scopeError=applyScopeFlag(client,body,type,scope,flags,format.jsonOutput);if(scopeError!==void 0)return scopeError;output_manager_default.spinner("Creating alert rule\u2026");try{let response=await client.fetch(rulesCollectionPath(scope.teamId),{method:"POST",body});return format.jsonOutput?client.stdout.write(`${JSON.stringify(response,null,2)}
|
|
8
|
+
`):printRuleMutationReceipt("Created",response.rule,client.argv),0}catch(error){if(isAPIError(error))return handleRulesApiError(client,error,format.jsonOutput);throw error}finally{output_manager_default.stopSpinner()}}export{add as default};
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { createRequire as __createRequire } from 'node:module';
|
|
2
|
+
import { fileURLToPath as __fileURLToPath } from 'node:url';
|
|
3
|
+
import { dirname as __dirname_ } from 'node:path';
|
|
4
|
+
const require = __createRequire(import.meta.url);
|
|
5
|
+
const __filename = __fileURLToPath(import.meta.url);
|
|
6
|
+
const __dirname = __dirname_(__filename);
|
|
7
|
+
import{DEFAULT_TAG,buildRepositoryReference,parseNameArg,validateImageParts}from"./chunk-HEGJZJO7.js";import{VCR_ENGINES,emitVcrArgParseError,isBuildxAvailable,isEngineInstalled,pushCompressionArgs,reportEngineCommandFailure,reportEnginePushFailure,resolveRegistry,resolveVcrScope,runEngine,splitPassthrough,validateVcrChoice}from"./chunk-GTRGQIY2.js";import{outputError}from"./chunk-6RIQPTJA.js";import"./chunk-D4MW3RDW.js";import{buildSubcommand}from"./chunk-3QT7VOE3.js";import"./chunk-O7G3CZ42.js";import"./chunk-N3N5UHIL.js";import"./chunk-YMVDWVMO.js";import"./chunk-HBFPLBTX.js";import"./chunk-2I64AYHG.js";import"./chunk-SOJCELXH.js";import"./chunk-QTKJC2O5.js";import{AGENT_REASON}from"./chunk-ENBTTYJR.js";import{buildCommandWithGlobalFlags,outputAgentError}from"./chunk-NS4FH2TY.js";import"./chunk-5QQNYN4N.js";import{parseArguments}from"./chunk-HTC6KO2B.js";import"./chunk-5XJNPXQK.js";import{printError}from"./chunk-LNPMDXBJ.js";import"./chunk-MY4MONOH.js";import"./chunk-VLZ47RWM.js";import"./chunk-F2ZWW2IO.js";import"./chunk-B4ATVYZW.js";import"./chunk-PPCFQQSU.js";import{getFlagsSpecification}from"./chunk-JAJW3P42.js";import"./chunk-XSVBYDYI.js";import"./chunk-EVZRQGNK.js";import"./chunk-R2TGGVCT.js";import"./chunk-FI772UVH.js";import"./chunk-XFVGX5HG.js";import{output_manager_default}from"./chunk-Z6Y55QJW.js";import"./chunk-QGIQK47P.js";import"./chunk-AVSPFBLM.js";import"./chunk-XCJDGQO7.js";import"./chunk-YPTLSODC.js";import"./chunk-7HL2RPUO.js";import"./chunk-U7KCDTCH.js";import"./chunk-N3ZZ7FHQ.js";import"./chunk-GU6VIFR5.js";import"./chunk-6L236MNA.js";var DEFAULT_PLATFORM="linux/amd64";async function build(client,telemetry){let{own,passthrough}=splitPassthrough(client.argv),parsedArgs;try{parsedArgs=parseArguments(own,getFlagsSpecification(buildSubcommand.options))}catch(err){return emitVcrArgParseError(client,err,"vcr build <engine> [path] [name[:tag]]"),printError(err),1}let[engineArg,pathArg,nameArg]=parsedArgs.args.slice(2),project=parsedArgs.flags["--project"],platform=parsedArgs.flags["--platform"],push=!!parsedArgs.flags["--push"];if(telemetry.trackCliArgumentEngine(engineArg),telemetry.trackCliArgumentPath(pathArg),telemetry.trackCliArgumentName(nameArg),telemetry.trackCliOptionProject(project),telemetry.trackCliOptionPlatform(platform),telemetry.trackCliFlagPush(push),!engineArg){let message=`Missing engine. Choose one of: ${VCR_ENGINES.join(", ")}.`;return outputAgentError(client,{status:"error",reason:AGENT_REASON.MISSING_ARGUMENTS,message,next:[{command:buildCommandWithGlobalFlags(client.argv,"vcr build docker"),when:"Replace docker with the container tool you use"}]},1),outputError(client,!1,"MISSING_ARGUMENTS",message)}let choiceError=validateVcrChoice(client,"engine",engineArg,VCR_ENGINES,!1);if(typeof choiceError=="number")return choiceError;let engine=engineArg;if(!isEngineInstalled(engine)){let message=`\`${engine}\` is not installed or not on your PATH. Install it and try again.`;return outputAgentError(client,{status:"error",reason:"engine_not_found",message},1),outputError(client,!1,"ENGINE_NOT_FOUND",message)}let scope=await resolveVcrScope(client,{project,jsonOutput:!1});if(typeof scope=="number")return scope;let parsed=parseNameArg(nameArg,scope.projectName);if("error"in parsed)return outputAgentError(client,{status:"error",reason:AGENT_REASON.INVALID_ARGUMENTS,message:parsed.error},1),outputError(client,!1,"INVALID_ARGUMENTS",parsed.error);let validationError=validateImageParts(parsed);if(validationError)return outputAgentError(client,{status:"error",reason:AGENT_REASON.INVALID_ARGUMENTS,message:validationError},1),outputError(client,!1,"INVALID_ARGUMENTS",validationError);let ref=`${buildRepositoryReference({registry:resolveRegistry(),teamSlug:scope.teamSlug,projectName:scope.projectName,repository:parsed.repository})}:${parsed.tag??DEFAULT_TAG}`,contextPath=pathArg??".",buildPlatform=platform??DEFAULT_PLATFORM;if(push&&engine==="docker"&&await isBuildxAvailable()){let outputSpec=`type=image,name=${ref},push=true,oci-mediatypes=true,compression=zstd,compression-level=3,force-compression=true`,engineArgs2=["buildx","build","--platform",buildPlatform,"--output",outputSpec,...passthrough,contextPath];output_manager_default.log(`Running: ${engine} ${engineArgs2.join(" ")}`);let result2=await runEngine(engine,engineArgs2,{cwd:client.cwd,captureStderr:!0});return result2.exitCode!==0?reportEnginePushFailure(client,engine,"buildx build",result2):(output_manager_default.success(`Built and pushed ${ref} (zstd compression)`),0)}push&&engine==="docker"&&output_manager_default.warn("Docker Buildx is not available; building and pushing without zstd compression. Install Buildx for smaller, faster image pushes.");let engineArgs=["build","--platform",buildPlatform,"--tag",ref,...passthrough,contextPath];output_manager_default.log(`Running: ${engine} ${engineArgs.join(" ")}`);let result=await runEngine(engine,engineArgs,{cwd:client.cwd});if(result.exitCode!==0)return reportEngineCommandFailure(client,engine,"build",result);if(!push)return output_manager_default.success(`Built ${ref}`),output_manager_default.log(`Push it with \`${buildCommandWithGlobalFlags(client.argv,`vcr push ${engine}${nameArg?` ${nameArg}`:""}`)}\`.`),0;let pushArgs=["push",...pushCompressionArgs(engine),ref];output_manager_default.log(`Running: ${engine} ${pushArgs.join(" ")}`);let pushResult=await runEngine(engine,pushArgs,{cwd:client.cwd,captureStderr:!0});if(pushResult.exitCode!==0)return reportEnginePushFailure(client,engine,"push",pushResult);let compressed=engine!=="docker";return output_manager_default.success(`Built and pushed ${ref}${compressed?" (zstd compression)":""}`),0}export{build as default};
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { createRequire as __createRequire } from 'node:module';
|
|
2
|
+
import { fileURLToPath as __fileURLToPath } from 'node:url';
|
|
3
|
+
import { dirname as __dirname_ } from 'node:path';
|
|
4
|
+
const require = __createRequire(import.meta.url);
|
|
5
|
+
const __filename = __fileURLToPath(import.meta.url);
|
|
6
|
+
const __dirname = __dirname_(__filename);
|
|
7
|
+
import{noBorderChars,require_cli_table3}from"./chunk-6TAQ6OWD.js";import{require_dist}from"./chunk-57GHYR4Y.js";import{globalCommandOptions}from"./chunk-JAJW3P42.js";import{require_source}from"./chunk-U7KCDTCH.js";import{__toESM}from"./chunk-6L236MNA.js";var import_chalk=__toESM(require_source(),1),import_constants=__toESM(require_dist(),1),import_cli_table3=__toESM(require_cli_table3(),1);var INDENT=" ".repeat(2),NEWLINE=`
|
|
8
|
+
`,tableOptions={chars:noBorderChars,style:{"padding-left":0,"padding-right":0}};function wordWrap(text,maxWidth){let _tableOptions=Object.assign({},tableOptions,{colWidths:[maxWidth],style:{"padding-left":INDENT.length}}),table=new import_cli_table3.default(_tableOptions);return table.push([{content:text,wordWrap:!0}]),table.toString()}function lineToString(line){let string="";for(let i=0;i<line.length;i++)if(i===line.length-1)string+=line[i];else{let curr=line[i],next=line[i+1];string+=curr,curr.trim()!==""&&next.trim()!==""&&(string+=" ")}return string}function outputArrayToString(outputArray){return outputArray.filter(line=>line!==null).join(NEWLINE)}function buildCommandSynopsisLine(command,parent){let line=[INDENT,import_constants.LOGO,import_chalk.default.bold(import_constants.NAME)];parent&&line.push(import_chalk.default.bold(parent.name)),line.push(import_chalk.default.bold(command.name));let args=command.arguments.slice(0);if(args.length===0&&command.subcommands&&command.subcommands.length>0&&args.push({name:"command",required:!command.subcommands.some(subcommand=>subcommand.default)}),args.length>0)for(let argument of args){let{name}=argument;argument.multiple&&(name+=" ..."),line.push(argument.required?name:`[${name}]`)}return command.options.length>0&&line.push("[options]"),line.push(NEWLINE),lineToString(line)}function buildCommandOptionLines(commandOptions,options,sectionTitle){let filteredCommandOptions=commandOptions.filter(option=>!option.deprecated&&option.description!==void 0);if(filteredCommandOptions.length===0)return null;filteredCommandOptions.sort((a,b)=>a.name<b.name?-1:a.name>b.name?1:0);let maxWidthOfUnwrappedColumns=0,rows=[];for(let option of filteredCommandOptions){let shorthandCell=option.shorthand?`${INDENT}-${option.shorthand},`:"",longhandCell=`${INDENT}--${option.name}`;option.argument&&(longhandCell+=` <${option.argument}>`),longhandCell+=INDENT;let widthOfUnwrappedColumns=shorthandCell.length+longhandCell.length;maxWidthOfUnwrappedColumns=Math.max(widthOfUnwrappedColumns,maxWidthOfUnwrappedColumns),rows.push([shorthandCell,longhandCell,{content:option.description,wordWrap:!0}])}let finalColumnWidth=options.columns-maxWidthOfUnwrappedColumns,table=new import_cli_table3.default(Object.assign({},tableOptions,{colWidths:[null,null,finalColumnWidth]}));return table.push(...rows),[`${INDENT}${import_chalk.default.dim(sectionTitle)}:`,NEWLINE,NEWLINE,table.toString(),NEWLINE,NEWLINE].join("")}function buildSubcommandLines(subcommands,options){if(!subcommands)return null;let maxWidthOfUnwrappedColumns=0,rows=[];for(let command of subcommands){if(command.hidden)continue;let nameCell=`${INDENT}${command.name}`,argsCell=INDENT;argsCell+=command.arguments.map(arg=>arg.required?arg.name:`[${arg.name}]`).join(" "),argsCell+=INDENT;let widthOfUnwrappedColumns=nameCell.length+argsCell.length;maxWidthOfUnwrappedColumns=Math.max(widthOfUnwrappedColumns,maxWidthOfUnwrappedColumns),rows.push([nameCell,argsCell,{content:command.default?`${command.description} ${import_chalk.default.bold("(default)")}`:command.description,wordWrap:!0}])}let rightMargin=INDENT.repeat(4).length,finalColumnWidth=options.columns-maxWidthOfUnwrappedColumns-rightMargin,table=new import_cli_table3.default(Object.assign({},tableOptions,{colWidths:[null,null,finalColumnWidth]}));return rows.length===0?null:(table.push(...rows),[`${INDENT}${import_chalk.default.dim("Commands")}:`,NEWLINE,NEWLINE,table.toString(),NEWLINE,NEWLINE].join(""))}function buildCommandExampleLines(command){if(!command.examples?.length)return null;let outputArray=[`${INDENT}${import_chalk.default.dim("Examples:")}`,""];for(let example of command.examples){let nameLine=[INDENT];nameLine.push(import_chalk.default.gray("-")),nameLine.push(example.name),outputArray.push(lineToString(nameLine)),outputArray.push("");let buildValueLine=value=>lineToString([INDENT,INDENT,import_chalk.default.cyan(`$ ${value}`)]);if(Array.isArray(example.value))for(let line of example.value)outputArray.push(buildValueLine(line));else outputArray.push(buildValueLine(example.value));outputArray.push("")}return outputArrayToString(outputArray)}function buildCommandDocumentationLines(command,options){if(options.omitDocumentation)return null;let documentation=command.documentation??options.parent?.documentation;return documentation?outputArrayToString([`${INDENT}${import_chalk.default.dim(`${documentation.label}:`)}`,"",lineToString([INDENT,INDENT,import_chalk.default.cyan(documentation.url)]),""]):null}function buildDescriptionLine(command,options){return`${wordWrap(command.description,options.columns)}${NEWLINE}`}function buildHelpOutput(command,options){let filteredGlobalOptions=command.disabledGlobalOptions?globalCommandOptions.filter(opt=>!command.disabledGlobalOptions?.includes(opt.name)):globalCommandOptions,outputArray=["",buildCommandSynopsisLine(command,options.parent),buildDescriptionLine(command,options),buildSubcommandLines(command.subcommands,options),buildCommandOptionLines(command.options,options,"Options"),buildCommandOptionLines(filteredGlobalOptions,options,"Global Options"),buildCommandExampleLines(command),buildCommandDocumentationLines(command,options),""];return outputArrayToString(outputArray)}function help(command,options){return buildHelpOutput(command,{...options,columns:options.columns??80})}export{buildCommandDocumentationLines,help};
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { createRequire as __createRequire } from 'node:module';
|
|
2
|
+
import { fileURLToPath as __fileURLToPath } from 'node:url';
|
|
3
|
+
import { dirname as __dirname_ } from 'node:path';
|
|
4
|
+
const require = __createRequire(import.meta.url);
|
|
5
|
+
const __filename = __fileURLToPath(import.meta.url);
|
|
6
|
+
const __dirname = __dirname_(__filename);
|
|
7
|
+
import{require_figures}from"./chunk-OHDEHZLX.js";import{Separator,ValidationError,createPrompt,isBackspaceKey,isDownKey,isEnterKey,isNumberKey,isUpKey,makeTheme,require_source,useKeypress,useMemo,usePagination,usePrefix,useRef,useState}from"./chunk-M2W3HKV3.js";import{require_ansi_escapes}from"./chunk-7HL2RPUO.js";import{__toESM}from"./chunk-6L236MNA.js";var import_chalk=__toESM(require_source(),1),import_figures=__toESM(require_figures(),1),import_ansi_escapes=__toESM(require_ansi_escapes(),1),selectTheme={icon:{cursor:import_figures.default.pointer},style:{disabled:text=>import_chalk.default.dim(`- ${text}`)}};function isSelectable(item){return!Separator.isSeparator(item)&&!item.disabled}var esm_default=createPrompt((config,done)=>{let{choices:items,loop=!0,pageSize=7}=config,firstRender=useRef(!0),theme=makeTheme(selectTheme,config.theme),prefix=usePrefix({theme}),[status,setStatus]=useState("pending"),searchTimeoutRef=useRef(void 0),bounds=useMemo(()=>{let first=items.findIndex(isSelectable),last=items.length-1-[...items].reverse().findIndex(isSelectable);if(first<0)throw new ValidationError("[select prompt] No selectable choices. All choices are disabled.");return{first,last}},[items]),defaultItemIndex=useMemo(()=>"default"in config?items.findIndex(item=>isSelectable(item)&&item.value===config.default):-1,[config.default,items]),[active,setActive]=useState(defaultItemIndex===-1?bounds.first:defaultItemIndex),selectedChoice=items[active];useKeypress((key,rl)=>{if(clearTimeout(searchTimeoutRef.current),isEnterKey(key))setStatus("done"),done(selectedChoice.value);else if(isUpKey(key)||isDownKey(key)){if(rl.clearLine(0),loop||isUpKey(key)&&active!==bounds.first||isDownKey(key)&&active!==bounds.last){let offset=isUpKey(key)?-1:1,next=active;do next=(next+offset+items.length)%items.length;while(!isSelectable(items[next]));setActive(next)}}else if(isNumberKey(key)){rl.clearLine(0);let position=Number(key.name)-1,item=items[position];item!=null&&isSelectable(item)&&setActive(position)}else if(isBackspaceKey(key))rl.clearLine(0);else{let searchTerm=rl.line.toLowerCase(),matchIndex=items.findIndex(item=>Separator.isSeparator(item)||!isSelectable(item)?!1:String(item.name||item.value).toLowerCase().startsWith(searchTerm));matchIndex>=0&&setActive(matchIndex),searchTimeoutRef.current=setTimeout(()=>{rl.clearLine(0)},700)}});let message=theme.style.message(config.message),helpTip;firstRender.current&&items.length<=pageSize&&(firstRender.current=!1,helpTip=theme.style.help("(Use arrow keys)"));let page=usePagination({items,active,renderItem({item,isActive}){if(Separator.isSeparator(item))return` ${item.separator}`;let line=item.name||item.value;if(item.disabled){let disabledLabel=typeof item.disabled=="string"?item.disabled:"(disabled)";return theme.style.disabled(`${line} ${disabledLabel}`)}let color=isActive?theme.style.highlight:x=>x,cursor=isActive?theme.icon.cursor:" ";return color(`${cursor} ${line}`)},pageSize,loop,theme});if(status==="done"){let answer=selectedChoice.name||String(selectedChoice.value);return`${prefix} ${message} ${theme.style.answer(answer)}`}let choiceDescription=selectedChoice.description?`
|
|
8
|
+
${selectedChoice.description}`:"";return`${[prefix,message,helpTip].filter(Boolean).join(" ")}
|
|
9
|
+
${page}${choiceDescription}${import_ansi_escapes.default.cursorHide}`});export{esm_default};
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { createRequire as __createRequire } from 'node:module';
|
|
2
|
+
import { fileURLToPath as __fileURLToPath } from 'node:url';
|
|
3
|
+
import { dirname as __dirname_ } from 'node:path';
|
|
4
|
+
const require = __createRequire(import.meta.url);
|
|
5
|
+
const __filename = __fileURLToPath(import.meta.url);
|
|
6
|
+
const __dirname = __dirname_(__filename);
|
|
7
|
+
import{require_once}from"./chunk-SOJCELXH.js";import{__commonJS}from"./chunk-6L236MNA.js";var require_end_of_stream=__commonJS({"../../node_modules/.pnpm/end-of-stream@1.4.1/node_modules/end-of-stream/index.js"(exports,module){var once=require_once(),noop=function(){},isRequest=function(stream){return stream.setHeader&&typeof stream.abort=="function"},isChildProcess=function(stream){return stream.stdio&&Array.isArray(stream.stdio)&&stream.stdio.length===3},eos=function(stream,opts,callback){if(typeof opts=="function")return eos(stream,null,opts);opts||(opts={}),callback=once(callback||noop);var ws=stream._writableState,rs=stream._readableState,readable=opts.readable||opts.readable!==!1&&stream.readable,writable=opts.writable||opts.writable!==!1&&stream.writable,onlegacyfinish=function(){stream.writable||onfinish()},onfinish=function(){writable=!1,readable||callback.call(stream)},onend=function(){readable=!1,writable||callback.call(stream)},onexit=function(exitCode){callback.call(stream,exitCode?new Error("exited with error code: "+exitCode):null)},onerror=function(err){callback.call(stream,err)},onclose=function(){if(readable&&!(rs&&rs.ended))return callback.call(stream,new Error("premature close"));if(writable&&!(ws&&ws.ended))return callback.call(stream,new Error("premature close"))},onrequest=function(){stream.req.on("finish",onfinish)};return isRequest(stream)?(stream.on("complete",onfinish),stream.on("abort",onclose),stream.req?onrequest():stream.on("request",onrequest)):writable&&!ws&&(stream.on("end",onlegacyfinish),stream.on("close",onlegacyfinish)),isChildProcess(stream)&&stream.on("exit",onexit),stream.on("end",onend),stream.on("finish",onfinish),opts.error!==!1&&stream.on("error",onerror),stream.on("close",onclose),function(){stream.removeListener("complete",onfinish),stream.removeListener("abort",onclose),stream.removeListener("request",onrequest),stream.req&&stream.req.removeListener("finish",onfinish),stream.removeListener("end",onlegacyfinish),stream.removeListener("close",onlegacyfinish),stream.removeListener("finish",onfinish),stream.removeListener("exit",onexit),stream.removeListener("end",onend),stream.removeListener("error",onerror),stream.removeListener("close",onclose)}};module.exports=eos}});export{require_end_of_stream};
|
|
@@ -0,0 +1,20 @@
|
|
|
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{require_dist as require_dist2}from"./chunk-TRTEXGVN.js";import{sleep}from"./chunk-T3GQAMBJ.js";import{highlight}from"./chunk-J3U3L45Y.js";import{getGlobalPathConfig}from"./chunk-ZIPVX7LD.js";import{getLocalPathConfig}from"./chunk-NHTF332K.js";import{PromptBackError,PromptCanceledError}from"./chunk-P2O5DOYE.js";import{require_types}from"./chunk-GHM7V3GG.js";import{DEFAULT_VERCEL_CONFIG_FILENAME,VERCEL_CONFIG_EXTENSIONS}from"./chunk-QR7QPUFN.js";import{require_load_json_file}from"./chunk-RCTYVKM5.js";import{parseArguments}from"./chunk-HTC6KO2B.js";import{isOAuthError,processTokenResponse,refreshTokenRequest,ua_default}from"./chunk-5XJNPXQK.js";import{fetch}from"./chunk-MY4MONOH.js";import{require_cli_config}from"./chunk-BRK4OB4B.js";import{VERCEL_DIR}from"./chunk-VLZ47RWM.js";import{humanizePath}from"./chunk-PPCFQQSU.js";import{APIError,NowError}from"./chunk-R2TGGVCT.js";import{emoji,link_default,output_manager_default,prependEmoji}from"./chunk-Z6Y55QJW.js";import{require_dist}from"./chunk-QGIQK47P.js";import{pkg_default}from"./chunk-AVSPFBLM.js";import{require_source}from"./chunk-U7KCDTCH.js";import{__toESM}from"./chunk-6L236MNA.js";var import_load_json_file=__toESM(require_load_json_file(),1),config=__toESM(require_cli_config(),1),import_error_utils=__toESM(require_dist(),1),import_types=__toESM(require_types(),1);import{join,basename,dirname}from"path";import{accessSync,constants}from"fs";import{persistCliAuthConfig,readCliAuthConfig}from"@vercel/cli-auth/credentials-store.js";var VERCEL_DIR2=getGlobalPathConfig(),CONFIG_FILE_PATH=config.getConfigFilePath(VERCEL_DIR2),AUTH_CONFIG_FILE_PATH=config.getAuthConfigFilePath(VERCEL_DIR2),readConfigFile=()=>config.readGlobalConfigFile(CONFIG_FILE_PATH),writeToConfigFile=stuff=>{try{config.writeGlobalConfigFile(CONFIG_FILE_PATH,stuff)}catch(err){throw(0,import_error_utils.isErrnoException)(err)&&((0,import_error_utils.isErrnoException)(err)&&err.code==="EPERM"?(output_manager_default.error(`Not able to create ${highlight(CONFIG_FILE_PATH)} (operation not permitted).`),process.exit(1)):err.code==="EBADF"&&(output_manager_default.error(`Not able to create ${highlight(CONFIG_FILE_PATH)} (bad file descriptor).`),process.exit(1))),err}},readAuthConfigFile=_globalConfig=>({...config.getDefaultAuthConfig(),...readCliAuthConfig(VERCEL_DIR2)}),persistAuthConfig=(authConfig,_globalConfig)=>{try{return persistCliAuthConfig(VERCEL_DIR2,authConfig)}catch(err){let wrappedError=new Error(`Not able to create ${humanizePath(AUTH_CONFIG_FILE_PATH)} (${(0,import_error_utils.errorToStringFriendly)(err)}).`);throw wrappedError.cause=err,wrappedError}};function getConfigFilePath2(){return CONFIG_FILE_PATH}function getAuthConfigFilePath2(){return AUTH_CONFIG_FILE_PATH}function readLocalConfig(prefix=process.cwd()){let config2,target="";try{target=getLocalPathConfig(prefix)}catch(err){if(err instanceof NowError)output_manager_default.error(err.message),process.exit(1);else throw err}if(!target)return;try{accessSync(target,constants.F_OK),config2=import_load_json_file.default.sync(target)}catch(err){if(!((0,import_error_utils.isErrnoException)(err)&&err.code==="ENOENT"))if((0,import_error_utils.isError)(err)&&err.name==="JSONError")output_manager_default.error(err.message),process.exit(1);else if((0,import_error_utils.isErrnoException)(err)){let code=err.code?` (${err.code})`:"";output_manager_default.error(`Failed to read config file: ${target}${code}`),process.exit(1)}else output_manager_default.prettyError(err),process.exit(1)}if(!config2)return;if(basename(target)==="vercel.json"&&basename(dirname(target))===VERCEL_DIR){let workPath=dirname(dirname(target)),sourceFile=null;for(let ext of VERCEL_CONFIG_EXTENSIONS){let configPath=join(workPath,`vercel.${ext}`);try{accessSync(configPath,constants.F_OK),sourceFile=basename(configPath);break}catch{}}if(!sourceFile){let tomlPath=join(workPath,"vercel.toml");try{accessSync(tomlPath,constants.F_OK),sourceFile="vercel.toml"}catch{}}config2[import_types.fileNameSymbol]=sourceFile||DEFAULT_VERCEL_CONFIG_FILENAME}else config2[import_types.fileNameSymbol]=basename(target);return config2}var import_chalk2=__toESM(require_source(),1),import_cli_config=__toESM(require_cli_config(),1),import_async_retry=__toESM(require_dist2(),1);import{join as join2,resolve}from"node:path";import{EventEmitter}from"events";import{URL}from"url";async function responseError(res,fallbackMessage=null,parsedBody={}){let bodyError;if(!res.ok){let body;try{body=await res.json()}catch{body=parsedBody}bodyError=body.error||body.err||body}let msg=bodyError?.message||fallbackMessage||"Response Error";return new APIError(msg,res,bodyError)}var import_chalk=__toESM(require_source(),1);function printIndications(res){let indications=new Set(["warning","notice","tip"]),regex=/^x-(?:vercel|now)-(warning|notice|tip)-(.*)$/;for(let[name,payload]of res.headers){let match=name.match(regex);if(match){let[,type,identifier]=match,action=res.headers.get(`x-vercel-action-${identifier}`),link=res.headers.get(`x-vercel-link-${identifier}`);if(indications.has(type)){let newline=`
|
|
8
|
+
`,message=prependEmoji(import_chalk.default.dim(payload),emoji(type))+newline,finalLink="";link&&(finalLink=import_chalk.default.dim(`${action||"Learn More"}: ${link_default(link)}`)+newline),output_manager_default.print(message+finalLink)}}}}function sharedPromise(fn){let promise=null;return function(...args){return promise||(promise=fn.apply(this,args),promise.finally(()=>{promise=null})),promise}}var import_error_utils2=__toESM(require_dist(),1);var DOMAINS_API_PATH=/^\/v\d+\/(?:domains|registrar)(?:\/|$)/,isSAMLError=v=>v&&v.saml,isJSONObject=v=>v&&typeof v=="object"&&v.constructor===Object;function isValidAccessToken(authConfig){if(!authConfig.token)return!1;if(typeof authConfig.expiresAt!="number")return!0;let nowInSeconds=Math.floor(Date.now()/1e3);return authConfig.expiresAt>=nowInSeconds}function hasRefreshToken(authConfig){return"refreshToken"in authConfig}var Client=class extends EventEmitter{constructor(opts){super();this._argv=[];this._loggedTokenSource=!1;this.escapePromptCancellationDepth=0;this.promptBackNavigationDepth=0;this.reauthenticate=sharedPromise(async function(error){let{default:reauthenticate}=await import("./reauthenticate-SH4XR7NH.js");if(typeof await reauthenticate(this,error)=="number")throw error instanceof APIError?output_manager_default.prettyError(error):output_manager_default.error(`Failed to re-authenticate for ${(0,import_chalk2.bold)(error.scope)} scope`),error});this._onRetry=error=>{output_manager_default.debug(`Retrying: ${error}
|
|
9
|
+
${error.stack}`)};this.setArgv(opts.argv),this.apiUrl=opts.apiUrl,this.authConfig=opts.authConfig,this.stdin=opts.stdin,this.stdout=opts.stdout,this.stderr=opts.stderr,this.config=opts.config,this.localConfig=opts.localConfig,this.localConfigPath=opts.localConfigPath,this.requestIdCounter=1,this.telemetryEventStore=opts.telemetryEventStore,this.isAgent=opts.isAgent??!1,this.agentName=opts.agentName,this.nonInteractive=opts.nonInteractive??this.isAgent,this.dangerouslySkipPermissions=opts.dangerouslySkipPermissions??!1;let theme={prefix:(0,import_chalk2.gray)("?"),style:{answer:import_chalk2.gray}};this.input={text:async opts2=>{let{default:input}=await import("./esm-7HVUFWMN.js");return this.runPrompt(input({theme,...opts2},{input:this.stdin,output:this.stderr}))},password:async opts2=>{let{default:password}=await import("./esm-BZBEM7YA.js");return this.runPrompt(password({theme,...opts2},{input:this.stdin,output:this.stderr}))},checkbox:async opts2=>{let{default:checkbox}=await import("./esm-CXICLFA3.js");return this.runPrompt(checkbox({theme,...opts2},{input:this.stdin,output:this.stderr}))},expand:async opts2=>{let{default:expand}=await import("./esm-HDEHVK7I.js");return this.runPrompt(expand({theme,...opts2},{input:this.stdin,output:this.stderr}))},confirm:async(message,default_value)=>{let{default:confirm}=await import("./esm-SZZI53W7.js");return this.runPrompt(confirm({theme,message,default:default_value},{input:this.stdin,output:this.stderr}))},select:async opts2=>{let{default:select}=await import("./esm-WGJFGCLK.js");return this.runPrompt(select({theme,...opts2},{input:this.stdin,output:this.stderr}))},search:async opts2=>{let{default:search}=await import("./esm-NQRLKALI.js");return this.runPrompt(search({theme,...opts2},{input:this.stdin,output:this.stderr}))}}}async withEscapePromptCancellation(run){this.escapePromptCancellationDepth++;try{return await run()}finally{this.escapePromptCancellationDepth--}}async withPromptBackNavigation(run){this.promptBackNavigationDepth++;try{return await run()}finally{this.promptBackNavigationDepth--}}runPrompt(prompt){let escapeCancellationEnabled=this.escapePromptCancellationDepth>0,backNavigationEnabled=this.promptBackNavigationDepth>0;if(!escapeCancellationEnabled&&!backNavigationEnabled||!this.stdin.isTTY||!prompt.cancel)return prompt;let cancellation,onKeypress=(_input,key)=>{key?.name==="escape"&&escapeCancellationEnabled&&!cancellation?(cancellation="escape",prompt.cancel?.()):key?.name==="up"&&backNavigationEnabled&&!cancellation&&(cancellation="back",prompt.cancel?.())};return this.stdin.on("keypress",onKeypress),prompt.catch(error=>{throw cancellation==="escape"?new PromptCanceledError:cancellation==="back"?new PromptBackError:error}).finally(()=>{this.stdin.off("keypress",onKeypress)})}get argv(){return this._argv}setArgv(argvOrFirst,...rest){let argv=Array.isArray(argvOrFirst)?argvOrFirst:[argvOrFirst,...rest];this._argv=argv,this._parsedArgsCache=void 0}getParsedArgs(){return this._parsedArgsCache||(this._parsedArgsCache=parseArguments(this.argv.slice(2),{},{permissive:!0})),this._parsedArgsCache}retry(fn,{retries=3,maxTimeout=1/0}={}){return(0,import_async_retry.default)(fn,{retries,maxTimeout,onRetry:this._onRetry})}async ensureAuthorized(){let{authConfig}=this;if(isValidAccessToken(authConfig)){this._loggedTokenSource||(authConfig.tokenSource==="flag"?output_manager_default.debug("Using token from `--token` argument, skipping token refresh."):authConfig.tokenSource==="env"?output_manager_default.debug("Using token from VERCEL_TOKEN environment variable, skipping token refresh."):output_manager_default.debug("Valid access token, skipping token refresh."),this._loggedTokenSource=!0);return}if(!hasRefreshToken(authConfig)){output_manager_default.debug("No refresh token found, emptying auth config."),this.emptyAuthConfig(),this.persistAuthConfig();return}let tokenResponse=await refreshTokenRequest({refresh_token:authConfig.refreshToken}),[tokensError,tokens]=await processTokenResponse(tokenResponse);if(isOAuthError(tokensError)&&tokensError.code==="invalid_grant"&&!authConfig.tokenSource&&this.stdin.isTTY&&!this.nonInteractive){output_manager_default.debug(`Stored session refresh failed: ${tokensError.cause.message}`),output_manager_default.log("Couldn't refresh the saved login. Starting a new login.");let{performDeviceCodeFlow}=await import("./future-E2FHKPJN.js"),recoveredTokens=await performDeviceCodeFlow(this);if(recoveredTokens){this.updateAuthConfig({token:recoveredTokens.access_token,userId:void 0,expiresAt:Math.floor(Date.now()/1e3)+recoveredTokens.expires_in,refreshToken:recoveredTokens.refresh_token}),this.persistAuthConfig();return}}if(tokensError){output_manager_default.debug("Error refreshing token, emptying auth config."),this.emptyAuthConfig(),this.persistAuthConfig();return}this.updateAuthConfig({token:tokens.access_token,expiresAt:Math.floor(Date.now()/1e3)+tokens.expires_in}),tokens.refresh_token&&this.updateAuthConfig({refreshToken:tokens.refresh_token}),this.persistAuthConfig(),this.writeToConfigFile(),output_manager_default.debug("Tokens refreshed successfully.")}getGlobalPathConfig(){let confFlag=this.getParsedArgs().flags["--global-config"];return typeof confFlag=="string"?resolve(this.cwd,confFlag):(0,import_cli_config.getGlobalPathConfig)()}async readConfig(fileName,schema){let filePath=join2(this.getGlobalPathConfig(),fileName);return(0,import_cli_config.readConfigFile)(filePath,schema)}async maybeReadConfig(fileName,schema){try{return await this.readConfig(fileName,schema)}catch{return null}}async writeConfig(fileName,schema,value){let filePath=join2(this.getGlobalPathConfig(),fileName);(0,import_cli_config.writeConfigFile)(filePath,schema,value)}updateConfig(config2){this.config={...this.config,...config2}}writeToConfigFile(){writeToConfigFile(this.config)}updateAuthConfig(authConfig){authConfig.token&&authConfig.token!==this.authConfig.token&&(this.user=void 0,this.userPromise=void 0,this.teams=void 0,this.teamsPromise=void 0),this.authConfig={...this.authConfig,...authConfig}}emptyAuthConfig(){this.user=void 0,this.userPromise=void 0,this.teams=void 0,this.teamsPromise=void 0,this.authConfig=this.authConfig.skipWrite?{skipWrite:!0}:{}}persistAuthConfig(){persistAuthConfig(this.authConfig,this.config)}async confirmMutatingOperation(url,method){if(!((method||"GET").toUpperCase()==="DELETE"))return!0;if(this.isAgent&&this.dangerouslySkipPermissions){let agentInfo=this.agentName?` (${this.agentName})`:"";output_manager_default.print(`
|
|
10
|
+
`),output_manager_default.print((0,import_chalk2.bgRed)((0,import_chalk2.white)((0,import_chalk2.bold)(" \u26A0 WARNING ")))+(0,import_chalk2.red)((0,import_chalk2.bold)(` AGENT MODE - DELETE CONFIRMATION BYPASSED
|
|
11
|
+
`))),output_manager_default.print((0,import_chalk2.yellow)(` An AI agent${agentInfo} is executing a ${(0,import_chalk2.bold)("DELETE")} request with --dangerously-skip-permissions flag.
|
|
12
|
+
`)),output_manager_default.print((0,import_chalk2.yellow)(` This operation will delete data: ${(0,import_chalk2.bold)(url)}
|
|
13
|
+
`)),output_manager_default.print((0,import_chalk2.yellow)(` The --dangerously-skip-permissions flag has bypassed the confirmation prompt.
|
|
14
|
+
|
|
15
|
+
`))}if(this.dangerouslySkipPermissions)return!0;if(!this.stdin.isTTY)return output_manager_default.error(`DELETE operations require confirmation. Use ${(0,import_chalk2.bold)("--dangerously-skip-permissions")} to skip confirmation in non-interactive mode.`),!1;let message=`You are about to perform a ${(0,import_chalk2.red)((0,import_chalk2.bold)("DELETE"))} operation on:
|
|
16
|
+
${(0,import_chalk2.bold)(url)}
|
|
17
|
+
|
|
18
|
+
Are you sure you want to proceed?`;output_manager_default.print(`
|
|
19
|
+
`);let confirmed=await this.input.confirm(message,!1);return output_manager_default.print(`
|
|
20
|
+
`),confirmed||output_manager_default.log("Operation canceled by user."),confirmed}async _fetch(_url,opts={}){let url=new URL(_url,this.apiUrl);(opts.accountId||opts.useCurrentTeam!==!1)&&(opts.accountId?opts.accountId.startsWith("team_")?url.searchParams.set("teamId",opts.accountId):url.searchParams.delete("teamId"):opts.useCurrentTeam!==!1&&this.config.currentTeam&&!url.searchParams.has("teamId")&&url.searchParams.set("teamId",this.config.currentTeam));let headers=new globalThis.Headers(opts.headers);headers.set("user-agent",ua_default),DOMAINS_API_PATH.test(url.pathname)&&headers.set("x-vercel-cli-version",pkg_default.version),this.agentName&&headers.set("x-ai-agent",this.agentName),headers.set("x-vercel-cli-session-id",this.telemetryEventStore.currentSessionId),headers.set("x-vercel-cli-invocation-id",this.telemetryEventStore.currentInvocationId),await this.ensureAuthorized(),this.authConfig.token&&headers.set("authorization",`Bearer ${this.authConfig.token}`);let body;isJSONObject(opts.body)?(body=JSON.stringify(opts.body),headers.set("content-type","application/json; charset=utf-8")):body=opts.body;let requestId=this.requestIdCounter++;return output_manager_default.time(res=>res?`#${requestId} \u2190 ${res.status} ${res.statusText}: ${res.headers.get("x-vercel-id")}`:`#${requestId} \u2192 ${opts.method||"GET"} ${url.href}`,fetch(url,{...opts,headers,body}))}fetch(url,opts={}){return this.retry(async bail=>{let res;try{res=await this._fetch(url,opts)}catch(err){if(err instanceof Error&&err.name==="AbortError")return bail(err);throw err}if(printIndications(res),!res.ok){if(opts.redirect==="manual"&&res.status>=300&&res.status<400)return res;let error=await responseError(res);if(isSAMLError(error)&&error.teamId)try{await this.reauthenticate(error)}catch(reauthError){return bail((0,import_error_utils2.normalizeError)(reauthError))}else{if(res.status===429&&opts.bailOn429)return bail(error);if(typeof error.retryAfterMs=="number"){let randomSkewMs=3e4*Math.random();await sleep(error.retryAfterMs+randomSkewMs)}else if(res.status>=400&&res.status<500)return bail(error)}throw error}if(opts.json===!1)return res;let contentType=res.headers.get("content-type");return contentType?contentType.includes("application/json")?res.json():res:null},opts.retry)}async*fetchPaginated(url,opts){let endpoint=typeof url=="string"?new URL(url,this.apiUrl):new URL(url.href);endpoint.searchParams.has("limit")||endpoint.searchParams.set("limit","100");let next;do{next&&(await sleep(100),endpoint.searchParams.set("until",String(next)));let res=await this.fetch(endpoint.href,opts);yield res,next=res.pagination?.next}while(next)}get cwd(){return process.cwd()}set cwd(v){process.chdir(v)}};export{printIndications,readConfigFile,writeToConfigFile,readAuthConfigFile,persistAuthConfig,getConfigFilePath2 as getConfigFilePath,getAuthConfigFilePath2 as getAuthConfigFilePath,readLocalConfig,isJSONObject,Client};
|
|
@@ -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
|
+
function parseThreadArg(arg){if(!/^https?:\/\//i.test(arg))return{id:arg};let url;try{url=new URL(arg)}catch{return}let segments=url.pathname.split("/").filter(Boolean),cIndex=segments.lastIndexOf("c");if(cIndex!==-1&&cIndex+1<segments.length){let id=safeDecode(segments[cIndex+1]);return id?{id,teamSlug:cIndex>1?safeDecode(segments[0]):void 0}:void 0}}function safeDecode(segment){try{return decodeURIComponent(segment)||void 0}catch{return}}export{parseThreadArg};
|
|
@@ -4,18 +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
|
|
8
|
-
require_source
|
|
9
|
-
} from "./chunk-S7KYDPEM.js";
|
|
10
|
-
import {
|
|
11
|
-
__toESM
|
|
12
|
-
} from "./chunk-TZ2YI2VH.js";
|
|
13
|
-
|
|
14
|
-
// src/help.ts
|
|
15
|
-
var import_chalk = __toESM(require_source(), 1);
|
|
16
|
-
var packageName = "vercel";
|
|
17
|
-
var logo = "\u25B2";
|
|
18
|
-
var help = () => `
|
|
7
|
+
import{require_source}from"./chunk-U7KCDTCH.js";import{__toESM}from"./chunk-6L236MNA.js";var import_chalk=__toESM(require_source(),1),packageName="vercel",logo="\u25B2",help=()=>`
|
|
19
8
|
${import_chalk.default.bold(`${logo} ${packageName}`)} [options] <command | path>
|
|
20
9
|
|
|
21
10
|
${import_chalk.default.dim("For deploy command help, run `vercel deploy --help`")}
|
|
@@ -24,9 +13,7 @@ var help = () => `
|
|
|
24
13
|
|
|
25
14
|
${import_chalk.default.dim("Basic")}
|
|
26
15
|
|
|
27
|
-
deploy [path] Performs a deployment ${import_chalk.default.bold(
|
|
28
|
-
"(default)"
|
|
29
|
-
)}
|
|
16
|
+
deploy [path] Performs a deployment ${import_chalk.default.bold("(default)")}
|
|
30
17
|
build Build the project locally into './vercel/output'
|
|
31
18
|
cache [cmd] Manages cache for your current Project
|
|
32
19
|
dev Start a local development server
|
|
@@ -104,19 +91,13 @@ var help = () => `
|
|
|
104
91
|
-v, --version Output the version number
|
|
105
92
|
--changelog Show the 5 latest Vercel product updates
|
|
106
93
|
--cwd Current working directory
|
|
107
|
-
-A ${import_chalk.default.bold.underline("FILE")}, --local-config=${import_chalk.default.bold.underline(
|
|
108
|
-
|
|
109
|
-
)} Path to the local ${"`vercel.json`"} file
|
|
110
|
-
-Q ${import_chalk.default.bold.underline("DIR")}, --global-config=${import_chalk.default.bold.underline(
|
|
111
|
-
"DIR"
|
|
112
|
-
)} Path to the global ${"`.vercel`"} directory
|
|
94
|
+
-A ${import_chalk.default.bold.underline("FILE")}, --local-config=${import_chalk.default.bold.underline("FILE")} Path to the local \`vercel.json\` file
|
|
95
|
+
-Q ${import_chalk.default.bold.underline("DIR")}, --global-config=${import_chalk.default.bold.underline("DIR")} Path to the global \`.vercel\` directory
|
|
113
96
|
-d, --debug Debug mode [off]
|
|
114
97
|
--no-color No color mode [off]
|
|
115
98
|
--non-interactive Run without interactive prompts (default when agent detected)
|
|
116
99
|
-S, --scope Set a custom scope
|
|
117
|
-
-t ${import_chalk.default.underline("TOKEN")}, --token=${import_chalk.default.underline(
|
|
118
|
-
"TOKEN"
|
|
119
|
-
)} Login token
|
|
100
|
+
-t ${import_chalk.default.underline("TOKEN")}, --token=${import_chalk.default.underline("TOKEN")} Login token
|
|
120
101
|
|
|
121
102
|
${import_chalk.default.dim("Examples:")}
|
|
122
103
|
|
|
@@ -132,9 +113,7 @@ var help = () => `
|
|
|
132
113
|
|
|
133
114
|
${import_chalk.default.cyan(`$ ${packageName} -e NODE_ENV=production`)}
|
|
134
115
|
|
|
135
|
-
${import_chalk.default.gray("\u2013")} Show the usage information for the sub command ${import_chalk.default.dim(
|
|
136
|
-
"`list`"
|
|
137
|
-
)}
|
|
116
|
+
${import_chalk.default.gray("\u2013")} Show the usage information for the sub command ${import_chalk.default.dim("`list`")}
|
|
138
117
|
|
|
139
118
|
${import_chalk.default.cyan(`$ ${packageName} help list`)}
|
|
140
119
|
|
|
@@ -145,8 +124,4 @@ var help = () => `
|
|
|
145
124
|
${import_chalk.default.gray("\u2013")} Search Vercel product updates
|
|
146
125
|
|
|
147
126
|
${import_chalk.default.cyan(`$ ${packageName} changelog search "AI SDK"`)}
|
|
148
|
-
`;
|
|
149
|
-
|
|
150
|
-
export {
|
|
151
|
-
help
|
|
152
|
-
};
|
|
127
|
+
`;export{help};
|
|
@@ -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{sleep}from"./chunk-T3GQAMBJ.js";import{stamp_default}from"./chunk-XPXOV5UO.js";import{param}from"./chunk-SXUEGVWB.js";import{getScope}from"./chunk-5QQNYN4N.js";import{require_pluralize}from"./chunk-VLZ47RWM.js";import{APIError,DomainNotAvailable,DomainNotFound,DomainPaymentError,InvalidDomain,TLDNotSupportedViaCLI,UnexpectedDomainPurchaseError,UnsupportedTLD,UserAborted,isAPIError}from"./chunk-R2TGGVCT.js";import{eraseLines,output_manager_default}from"./chunk-Z6Y55QJW.js";import{require_source}from"./chunk-U7KCDTCH.js";import{__toESM}from"./chunk-6L236MNA.js";var import_chalk2=__toESM(require_source(),1),import_pluralize=__toESM(require_pluralize(),1);async function getDomainPrice(client,name){try{return await client.fetch(`/v1/registrar/domains/${name}/price`)}catch(err){if(isAPIError(err)){if(err.code==="tld_not_supported")return new UnsupportedTLD(name);if(err.status<500)return err}throw err}}async function getDomainStatus(client,domain){return client.fetch(`/v1/registrar/domains/${encodeURIComponent(domain)}/availability`)}async function getOrder(client,orderId){let{team}=await getScope(client),teamParam=team?`?teamId=${team.slug}`:"";try{return await client.fetch(`/v1/registrar/orders/${orderId}${teamParam}`)}catch(err){if(isAPIError(err)){if(err.code==="not_found")return null;if(err.status<500)return err}throw err}}var pollForOrder=async(client,orderId,timeoutMs=1e4)=>{let startTime=Date.now();for(;Date.now()-startTime<timeoutMs;){let order=await getOrder(client,orderId);if(order!==null&&(order.status==="completed"||order.status==="failed"))return order;await sleep(500)}return null};var import_chalk=__toESM(require_source(),1);async function getDomain(client,contextName,domainName){output_manager_default.spinner(`Fetching domain ${domainName} under ${import_chalk.default.bold(contextName)}`);try{let{domain}=await client.fetch(`/v5/domains/${domainName}`);return domain}catch(err){if(isAPIError(err)&&err.status<500)return err;throw err}}async function purchaseDomain(client,name,expectedPrice,years,autoRenew=!0,contactInformation){let{team,contextName}=await getScope(client),teamParam=team?`?teamId=${team.slug}`:"";try{let{orderId}=await client.fetch(`/v1/registrar/domains/${name}/buy${teamParam}`,{body:{expectedPrice,autoRenew,years,contactInformation},method:"POST"}),order=await pollForOrder(client,orderId);if(order===null)return new UnexpectedDomainPurchaseError(name);if(order.status==="completed"&&order.domains.find(domain2=>domain2.domainName===name)?.status==="completed"){let domain2=await getDomain(client,contextName,name);if(domain2 instanceof APIError)throw domain2;return domain2}return order.error?.code==="payment-failed"?new DomainPaymentError:new UnexpectedDomainPurchaseError(name)}catch(err){if(isAPIError(err)){if(err.code==="invalid_domain")return new InvalidDomain(name);if(err.code==="domain_not_available")return new DomainNotAvailable(name);if(err.code==="internal_server_error")return new UnexpectedDomainPurchaseError(name);if(err.code==="tld_not_supported")return new UnsupportedTLD(name);if(err.code==="additional_contact_info_required")return new TLDNotSupportedViaCLI(name)}throw err}}async function collectContactInformation(client){output_manager_default.log(""),output_manager_default.log("Please provide contact information for domain registration:");let firstName=await client.input.text({message:"First name:",validate:val=>val.length>0||"First name is required"}),lastName=await client.input.text({message:"Last name:",validate:val=>val.length>0||"Last name is required"}),email=await client.input.text({message:"Email:",validate:val=>val.length===0?"Email is required":/^[^\s@]+@[^\s@]+\.[^\s@]+$/.test(val)?!0:"Invalid email format"}),phone=await client.input.text({message:"Phone (include country code, e.g., +15551234567):",validate:val=>val.length===0?"Phone is required":/^\+\d{10,15}$/.test(val)?!0:"Phone must start with + and contain 10-15 digits"}),address1=await client.input.text({message:"Address:",validate:val=>val.length>0||"Address is required"}),city=await client.input.text({message:"City:",validate:val=>val.length>0||"City is required"}),state=await client.input.text({message:"State/Province:",validate:val=>val.length>0||"State/Province is required"}),zip=await client.input.text({message:"Postal/ZIP code:",validate:val=>val.length>0||"Postal/ZIP code is required"}),country=await client.input.text({message:"Country code (2 letters, e.g., US):",validate:val=>val.length===0?"Country code is required":/^[A-Z]{2}$/i.test(val)?!0:"Country code must be 2 letters"}),companyName=await client.input.text({message:"Company name (optional):"});return{firstName,lastName,email,phone,address1,city,state,zip,country:country.toUpperCase(),companyName:companyName||void 0}}var isTTY=process.stdout.isTTY;async function purchaseDomainIfAvailable(client,domain,contextName){output_manager_default.spinner(`Checking status of ${import_chalk2.default.bold(domain)}`);let buyDomainStamp=stamp_default(),{available}=await getDomainStatus(client,domain);if(available){if(!isTTY)return new DomainNotFound(domain);output_manager_default.debug(`Domain ${domain} is available to be purchased`);let domainPrice=await getDomainPrice(client,domain).finally(()=>{output_manager_default.stopSpinner()});if(domainPrice instanceof UnsupportedTLD)return domainPrice;if(domainPrice instanceof Error)throw domainPrice;let{purchasePrice,years}=domainPrice;if(purchasePrice===null)return output_manager_default.error(`The domain ${param(domain)} is ${import_chalk2.default.underline("unavailable")}! ${buyDomainStamp()}`),new DomainNotAvailable(domain);if(output_manager_default.log(`Domain not found, but you can buy it under ${import_chalk2.default.bold(contextName)}! ${buyDomainStamp()}`),!await client.input.confirm(`Buy ${import_chalk2.default.underline(domain)} for ${import_chalk2.default.bold(`$${purchasePrice}`)} (${(0,import_pluralize.default)("yr",years,!0)})?`,!1))return output_manager_default.print(eraseLines(1)),new UserAborted;output_manager_default.print(eraseLines(1));let contactInformation=await collectContactInformation(client),result=await purchaseDomain(client,domain,purchasePrice,years,!0,contactInformation);return result instanceof Error?result:!0}return output_manager_default.debug(`Domain ${domain} is not available to be purchased`),!1}export{getDomainPrice,getDomainStatus,pollForOrder,purchaseDomain,collectContactInformation,purchaseDomainIfAvailable};
|
|
@@ -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{projectOption,yesOption}from"./chunk-JAJW3P42.js";import{packageName}from"./chunk-FI772UVH.js";var listSubcommand={name:"list",aliases:["ls"],description:"List all routing rules for the current project. These routes apply to all deployments and environments.",arguments:[],options:[projectOption,{name:"search",description:"Search by name, description, source, or destination",shorthand:"s",type:String,argument:"QUERY",deprecated:!1},{name:"filter",description:"Filter by type: rewrite, redirect, set_status, transform",shorthand:"f",type:String,argument:"TYPE",deprecated:!1},{name:"production",description:"List routes from the live production version",shorthand:null,type:Boolean,deprecated:!1},{name:"version-id",description:"List routes from a specific version ID",shorthand:null,type:String,argument:"VERSION_ID",deprecated:!1},{name:"diff",description:"Compare staged changes against production. Use with --version-id to compare a specific version.",shorthand:null,type:Boolean,deprecated:!1},{name:"expand",description:"Show expanded details for each route",shorthand:"e",type:Boolean,deprecated:!1}],examples:[{name:"List all routes",value:`${packageName} routes list`},{name:"Search for routes",value:`${packageName} routes list --search "api"`},{name:"Filter by type",value:`${packageName} routes list --filter rewrite`},{name:"Show staged changes",value:`${packageName} routes list --diff`},{name:"Show live production routes",value:`${packageName} routes list --production`},{name:"Show expanded details",value:`${packageName} routes list --expand`}]},listVersionsSubcommand={name:"list-versions",aliases:["ls-versions"],description:"List all versions of routing rules",arguments:[],options:[projectOption,{name:"count",description:"Number of versions to fetch (default: 20, max: 100)",shorthand:null,type:Number,argument:"NUMBER",deprecated:!1}],examples:[{name:"List route versions",value:`${packageName} routes list-versions`},{name:"List more versions",value:`${packageName} routes list-versions --count 50`}]},inspectSubcommand={name:"inspect",aliases:[],description:"Show detailed information about a specific route",arguments:[{name:"name-or-id",required:!0}],options:[projectOption,{name:"diff",description:"Compare staged changes against production for this route",shorthand:null,type:Boolean,deprecated:!1}],examples:[{name:"Inspect a route by name",value:`${packageName} routes inspect "API rewrite"`},{name:"Inspect a route by ID",value:`${packageName} routes inspect abc123`},{name:"Show staged changes for a route",value:`${packageName} routes inspect "My route" --diff`}]},addSubcommand={name:"add",aliases:[],description:"Add a new routing rule to the project",arguments:[{name:"name",required:!1}],options:[projectOption,{name:"src",description:"Path pattern (required in non-interactive mode)",shorthand:null,type:String,argument:"PATTERN",deprecated:!1},{name:"src-syntax",description:"Path syntax: regex (default), path-to-regexp, equals",shorthand:null,type:String,argument:"TYPE",deprecated:!1},{name:"action",description:"Action type: rewrite, redirect, or set-status (required with --dest/--status)",shorthand:null,type:String,argument:"TYPE",deprecated:!1},{name:"dest",description:"Destination URL for rewrite or redirect",shorthand:null,type:String,argument:"URL",deprecated:!1},{name:"status",description:"Status code (301/302/307/308 for redirect, or any for set-status)",shorthand:null,type:Number,argument:"CODE",deprecated:!1},{name:"set-response-header",description:"Set response header: key=value (repeatable)",shorthand:null,type:[String],argument:"HEADER",deprecated:!1},{name:"append-response-header",description:"Append to response header: key=value (repeatable)",shorthand:null,type:[String],argument:"HEADER",deprecated:!1},{name:"delete-response-header",description:"Delete response header: key (repeatable)",shorthand:null,type:[String],argument:"KEY",deprecated:!1},{name:"set-request-header",description:"Set request header: key=value (repeatable)",shorthand:null,type:[String],argument:"HEADER",deprecated:!1},{name:"append-request-header",description:"Append to request header: key=value (repeatable)",shorthand:null,type:[String],argument:"HEADER",deprecated:!1},{name:"delete-request-header",description:"Delete request header: key (repeatable)",shorthand:null,type:[String],argument:"KEY",deprecated:!1},{name:"set-request-query",description:"Set query parameter: key=value (repeatable)",shorthand:null,type:[String],argument:"PARAM",deprecated:!1},{name:"append-request-query",description:"Append to query parameter: key=value (repeatable)",shorthand:null,type:[String],argument:"PARAM",deprecated:!1},{name:"delete-request-query",description:"Delete query parameter: key (repeatable)",shorthand:null,type:[String],argument:"KEY",deprecated:!1},{name:"has",description:"Condition that must match: type:key or type:key:value (repeatable)",shorthand:null,type:[String],argument:"CONDITION",deprecated:!1},{name:"missing",description:'"Does not have" condition: type:key or type:key:value (repeatable)',shorthand:null,type:[String],argument:"CONDITION",deprecated:!1},{name:"description",description:"Route description (max 1024 chars)",shorthand:null,type:String,argument:"TEXT",deprecated:!1},{name:"disabled",description:"Create route in disabled state",shorthand:null,type:Boolean,deprecated:!1},{name:"ai",description:"Generate route from a natural language description (AI-powered)",shorthand:null,type:String,argument:"PROMPT",deprecated:!1},{name:"position",description:"Position: start, end, after:<id>, before:<id>",shorthand:null,type:String,argument:"POSITION",deprecated:!1},{name:"yes",description:"Skip confirmation prompts",shorthand:"y",type:Boolean,deprecated:!1}],examples:[{name:"Interactive mode",value:`${packageName} routes add`},{name:"Create with AI",value:`${packageName} routes add --ai "Rewrite /api/* to https://backend.internal/*"`},{name:"Add a rewrite",value:`${packageName} routes add "API Proxy" --src "/api/:path*" --src-syntax path-to-regexp --action rewrite --dest "https://api.example.com/:path*" --yes`},{name:"Add a redirect",value:`${packageName} routes add "Old Blog" --src "/blog" --src-syntax equals --action redirect --dest "/articles" --status 301 --yes`},{name:"Add CORS headers",value:`${packageName} routes add "CORS" --src "^/api/.*$" --set-response-header "Access-Control-Allow-Origin=*" --yes`},{name:"Block access (set status)",value:`${packageName} routes add "Block Admin" --src "^/admin/.*$" --action set-status --status 403 --yes`},{name:"Conditional redirect",value:`${packageName} routes add "Auth Required" --src "/protected/:path*" --src-syntax path-to-regexp --action redirect --dest "/login" --status 307 --missing "cookie:session" --yes`},{name:"Rewrite with request headers",value:`${packageName} routes add "Backend Proxy" --src "/backend/:path*" --src-syntax path-to-regexp --action rewrite --dest "https://internal.example.com/:path*" --set-request-header "X-Forwarded-Host=myapp.com" --yes`},{name:"Add route at start",value:`${packageName} routes add "Priority Route" --src "/priority" --src-syntax equals --action rewrite --dest "/handler" --position start --yes`}]},publishSubcommand={name:"publish",aliases:[],description:"Publish staged routing changes to production",arguments:[],options:[projectOption,{...yesOption,description:"Skip the confirmation prompt when publishing"}],examples:[{name:"Publish staged changes",value:`${packageName} routes publish`},{name:"Publish without confirmation",value:`${packageName} routes publish --yes`}]},restoreSubcommand={name:"restore",aliases:[],description:"Restore a previous routing version to production",arguments:[{name:"version-id",required:!0}],options:[projectOption,{...yesOption,description:"Skip the confirmation prompt when restoring"}],examples:[{name:"Restore a previous version",value:`${packageName} routes restore <version-id>`},{name:"Restore without confirmation",value:`${packageName} routes restore <version-id> --yes`}]},discardSubcommand={name:"discard-staging",aliases:[],description:"Discard staged routing changes",arguments:[],options:[projectOption,{...yesOption,description:"Skip the confirmation prompt when discarding"}],examples:[{name:"Discard staged changes",value:`${packageName} routes discard-staging`},{name:"Discard without confirmation",value:`${packageName} routes discard-staging --yes`}]},deleteSubcommand={name:"delete",aliases:["rm"],description:"Delete one or more routing rules",arguments:[{name:"name-or-id",required:!0,multiple:!0}],options:[projectOption,{...yesOption,description:"Skip the confirmation prompt when deleting"}],examples:[{name:"Delete a route by name",value:`${packageName} routes delete "Old Redirect"`},{name:"Delete a route by ID",value:`${packageName} routes delete abc123`},{name:"Delete multiple routes",value:`${packageName} routes delete "Route A" "Route B"`},{name:"Delete without confirmation",value:`${packageName} routes delete "Old Route" --yes`}]},enableSubcommand={name:"enable",aliases:[],description:"Enable a disabled routing rule",arguments:[{name:"name-or-id",required:!0}],options:[projectOption],examples:[{name:"Enable a route by name",value:`${packageName} routes enable "API Proxy"`},{name:"Enable a route by ID",value:`${packageName} routes enable abc123`}]},disableSubcommand={name:"disable",aliases:[],description:"Disable a routing rule without deleting it",arguments:[{name:"name-or-id",required:!0}],options:[projectOption],examples:[{name:"Disable a route by name",value:`${packageName} routes disable "API Proxy"`},{name:"Disable a route by ID",value:`${packageName} routes disable abc123`}]},reorderSubcommand={name:"reorder",aliases:["move"],description:"Move a routing rule to a different position",arguments:[{name:"name-or-id",required:!0}],options:[projectOption,{name:"position",description:"Target position: start, end, a number (1-based), before:<id>, after:<id>",shorthand:null,type:String,argument:"POSITION",deprecated:!1},{name:"first",description:"Move to the first position (highest priority)",shorthand:null,type:Boolean,deprecated:!1},{name:"last",description:"Move to the last position (lowest priority)",shorthand:null,type:Boolean,deprecated:!1},{...yesOption,description:"Skip the confirmation prompt when reordering"}],examples:[{name:"Move to first position",value:`${packageName} routes reorder "Catch All" --first`},{name:"Move to last position",value:`${packageName} routes reorder "Catch All" --last`},{name:"Move to a specific position",value:`${packageName} routes reorder "API Proxy" --position 3`},{name:"Move after another route",value:`${packageName} routes reorder "API Proxy" --position after:route-id-123`},{name:"Interactive reorder (prompts for position)",value:`${packageName} routes reorder "API Proxy"`}]},editSubcommand={name:"edit",aliases:[],description:"Edit an existing routing rule",arguments:[{name:"name-or-id",required:!0}],options:[projectOption,{name:"name",description:"Change route name",shorthand:null,type:String,argument:"NAME",deprecated:!1},{name:"description",description:'Change description (use "" to clear)',shorthand:null,type:String,argument:"TEXT",deprecated:!1},{name:"src",description:"Change source path pattern",shorthand:null,type:String,argument:"PATTERN",deprecated:!1},{name:"src-syntax",description:"Change path syntax: regex, path-to-regexp, equals",shorthand:null,type:String,argument:"TYPE",deprecated:!1},{name:"action",description:"Set action type: rewrite, redirect, or set-status (required when switching types)",shorthand:null,type:String,argument:"TYPE",deprecated:!1},{name:"dest",description:"Set destination URL",shorthand:null,type:String,argument:"URL",deprecated:!1},{name:"status",description:"Set status code",shorthand:null,type:Number,argument:"CODE",deprecated:!1},{name:"no-dest",description:"Remove destination",shorthand:null,type:Boolean,deprecated:!1},{name:"no-status",description:"Remove status code",shorthand:null,type:Boolean,deprecated:!1},{name:"set-response-header",description:"Set response header: key=value (repeatable)",shorthand:null,type:[String],argument:"HEADER",deprecated:!1},{name:"append-response-header",description:"Append to response header: key=value (repeatable)",shorthand:null,type:[String],argument:"HEADER",deprecated:!1},{name:"delete-response-header",description:"Delete response header: key (repeatable)",shorthand:null,type:[String],argument:"KEY",deprecated:!1},{name:"set-request-header",description:"Set request header: key=value (repeatable)",shorthand:null,type:[String],argument:"HEADER",deprecated:!1},{name:"append-request-header",description:"Append to request header: key=value (repeatable)",shorthand:null,type:[String],argument:"HEADER",deprecated:!1},{name:"delete-request-header",description:"Delete request header: key (repeatable)",shorthand:null,type:[String],argument:"KEY",deprecated:!1},{name:"set-request-query",description:"Set query parameter: key=value (repeatable)",shorthand:null,type:[String],argument:"PARAM",deprecated:!1},{name:"append-request-query",description:"Append to query parameter: key=value (repeatable)",shorthand:null,type:[String],argument:"PARAM",deprecated:!1},{name:"delete-request-query",description:"Delete query parameter: key (repeatable)",shorthand:null,type:[String],argument:"KEY",deprecated:!1},{name:"has",description:"Add a has condition: type:key or type:key:value (repeatable)",shorthand:null,type:[String],argument:"CONDITION",deprecated:!1},{name:"missing",description:'Add a "does not have" condition: type:key or type:key:value (repeatable)',shorthand:null,type:[String],argument:"CONDITION",deprecated:!1},{name:"clear-conditions",description:"Remove all has/does-not-have conditions",shorthand:null,type:Boolean,deprecated:!1},{name:"clear-headers",description:"Remove all response headers",shorthand:null,type:Boolean,deprecated:!1},{name:"clear-transforms",description:"Remove all transforms (request headers, request query)",shorthand:null,type:Boolean,deprecated:!1},{name:"ai",description:"Describe changes using natural language (AI-powered)",shorthand:null,type:String,argument:"PROMPT",deprecated:!1},{...yesOption,description:"Skip confirmation prompts"}],examples:[{name:"Interactive mode",value:`${packageName} routes edit "API Proxy"`},{name:"Edit with AI",value:`${packageName} routes edit "API Proxy" --ai "Add CORS headers and change status to 308"`},{name:"Change destination",value:`${packageName} routes edit "API Proxy" --dest "https://new-api.example.com/:path*"`},{name:"Switch to redirect",value:`${packageName} routes edit "Old Route" --action redirect --dest "/new" --status 301`},{name:"Add a response header",value:`${packageName} routes edit "My Route" --set-response-header "Cache-Control=public, max-age=3600"`},{name:"Clear all conditions and add new ones",value:`${packageName} routes edit "My Route" --clear-conditions --has "header:Authorization"`}]},exportSubcommand={name:"export",aliases:[],description:"Export routes to a vercel.json or vercel.ts file",arguments:[{name:"name-or-id",required:!1}],options:[projectOption,{name:"output",description:"Output file format: .json (default) or .ts",shorthand:"o",type:String,argument:"json|ts",deprecated:!1}],examples:[{name:"Export as vercel.json format",value:`${packageName} routes export`},{name:"Export as vercel.ts format",value:`${packageName} routes export --output ts`},{name:"Export a specific route",value:`${packageName} routes export "API Proxy"`},{name:"Export to a file",value:`${packageName} routes export > routes.json`}]},routesCommand={name:"routes",aliases:[],description:"Manage routing rules for a project. Routes managed at the project level apply to all deployments and environments.",arguments:[],subcommands:[listSubcommand,listVersionsSubcommand,inspectSubcommand,addSubcommand,editSubcommand,deleteSubcommand,enableSubcommand,disableSubcommand,reorderSubcommand,exportSubcommand,publishSubcommand,restoreSubcommand,discardSubcommand],options:[],examples:[]};export{listSubcommand,listVersionsSubcommand,inspectSubcommand,addSubcommand,publishSubcommand,restoreSubcommand,discardSubcommand,deleteSubcommand,enableSubcommand,disableSubcommand,reorderSubcommand,editSubcommand,exportSubcommand,routesCommand};
|
|
@@ -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{tagsAggregateCommand}from"./chunk-O7G3CZ42.js";import{imageAggregateCommand}from"./chunk-N3N5UHIL.js";import{permissionsAggregateCommand}from"./chunk-YMVDWVMO.js";import{formatOption,jsonOption,limitOption,projectOption,yesOption}from"./chunk-JAJW3P42.js";import{packageName}from"./chunk-FI772UVH.js";var projectScopeOption={...projectOption,shorthand:"p",description:"Project name or ID (defaults to the linked project)."},nextOption={name:"next",shorthand:null,type:String,deprecated:!1,description:"Continue from a previous response",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 (defaults to 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:String,deprecated:!1,description:"Set the repository visibility: `true` for public, `false` for private.",argument:"BOOLEAN",choices:["true","false"]},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:"add",aliases:["create"],description:"Create a container registry repository",arguments:[{name:"name",required:!0}],options:[projectScopeOption,formatOption,jsonOption],examples:[{name:"Create a repository",value:`${packageName} vcr add my-repository`}]},configSubcommand={name:"config",aliases:[],description:"Configure a container registry repository, such as the repository's visibility",arguments:[{name:"repository",required:!0}],options:[publicOption,projectScopeOption,formatOption,jsonOption],examples:[{name:"Make a repository public",value:`${packageName} vcr config my-repository --public true`},{name:"Make a repository private",value:`${packageName} vcr config my-repository --public false`}]},removeSubcommand={name:"rm",aliases:["remove","delete"],description:"Delete a container registry repository",arguments:[{name:"repository",required:!0}],options:[projectScopeOption,yesOption,formatOption,jsonOption],examples:[{name:"Delete a repository",value:`${packageName} vcr rm my-repository`},{name:"Delete a repository without the confirmation prompt",value:`${packageName} vcr rm 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 flags 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 add 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{getCommandName}from"./chunk-FI772UVH.js";import{output_manager_default}from"./chunk-Z6Y55QJW.js";import{require_source}from"./chunk-U7KCDTCH.js";import{__toESM}from"./chunk-6L236MNA.js";var import_chalk=__toESM(require_source(),1);function validateLsArgs(options){let{commandName,args,maxArgs=0,exitCode=1,usageString}=options;if(args.length>maxArgs){let usage=usageString||getCommandName(commandName);return output_manager_default.error(`Invalid number of arguments. Usage: ${import_chalk.default.cyan(usage)}`),exitCode}return 0}export{validateLsArgs};
|
|
@@ -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-6L236MNA.js";var require_fast_deep_equal=__commonJS({"../../node_modules/.pnpm/fast-deep-equal@3.1.3/node_modules/fast-deep-equal/index.js"(exports,module){"use strict";module.exports=function equal(a,b){if(a===b)return!0;if(a&&b&&typeof a=="object"&&typeof b=="object"){if(a.constructor!==b.constructor)return!1;var length,i,keys;if(Array.isArray(a)){if(length=a.length,length!=b.length)return!1;for(i=length;i--!==0;)if(!equal(a[i],b[i]))return!1;return!0}if(a.constructor===RegExp)return a.source===b.source&&a.flags===b.flags;if(a.valueOf!==Object.prototype.valueOf)return a.valueOf()===b.valueOf();if(a.toString!==Object.prototype.toString)return a.toString()===b.toString();if(keys=Object.keys(a),length=keys.length,length!==Object.keys(b).length)return!1;for(i=length;i--!==0;)if(!Object.prototype.hasOwnProperty.call(b,keys[i]))return!1;for(i=length;i--!==0;){var key=keys[i];if(!equal(a[key],b[key]))return!1}return!0}return a!==a&&b!==b}}});export{require_fast_deep_equal};
|
|
@@ -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{TelemetryClient}from"./chunk-57GHYR4Y.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})}trackCliSubcommandDelete(actual){this.trackCliSubcommand({subcommand:"delete",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})}trackCliSubcommandEdit(actual){this.trackCliSubcommand({subcommand:"edit",value:actual})}},RoutesAddTelemetryClient=class extends TelemetryClient{trackCliArgumentName(name){name&&this.trackCliArgument({arg:"name",value:this.redactedValue})}trackCliFlagYes(flag){flag&&this.trackCliFlag("yes")}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};
|
|
@@ -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{require_dist2 as require_dist}from"./chunk-7RMCBXBB.js";import{require_frameworks}from"./chunk-KK4AJES5.js";import{__toESM}from"./chunk-6L236MNA.js";var import_frameworks=__toESM(require_frameworks(),1),import_fs_detectors=__toESM(require_dist(),1);import{join}from"path";async function detectProjects(cwd){let fs=new import_fs_detectors.LocalFileSystemDetector(cwd),workspaces=await(0,import_fs_detectors.getWorkspaces)({fs}),detectedProjects=new Map,packagePaths=(await Promise.all(workspaces.map(workspace=>(0,import_fs_detectors.getWorkspacePackagePaths)({fs,workspace})))).flat();return packagePaths.length===0&&packagePaths.push("/"),await Promise.all(packagePaths.map(async p=>{let frameworks=await(0,import_fs_detectors.detectFrameworks)({fs:fs.chdir(join(".",p)),frameworkList:import_frameworks.frameworkList});frameworks.length!==0&&detectedProjects.set(p.slice(1),frameworks)})),detectedProjects}export{detectProjects};
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { createRequire as __createRequire } from 'node:module';
|
|
2
|
+
import { fileURLToPath as __fileURLToPath } from 'node:url';
|
|
3
|
+
import { dirname as __dirname_ } from 'node:path';
|
|
4
|
+
const require = __createRequire(import.meta.url);
|
|
5
|
+
const __filename = __fileURLToPath(import.meta.url);
|
|
6
|
+
const __dirname = __dirname_(__filename);
|
|
7
|
+
import{STANDARD_ENVIRONMENTS}from"./chunk-YV6CTDHR.js";import{require_lib}from"./chunk-FI772UVH.js";import{output_manager_default}from"./chunk-Z6Y55QJW.js";import{require_source}from"./chunk-U7KCDTCH.js";import{__toESM}from"./chunk-6L236MNA.js";var import_chalk=__toESM(require_source(),1);var import_title=__toESM(require_lib(),1);function formatEnvironment(orgSlug,projectSlug,environment){let projectUrl=`https://vercel.com/${orgSlug}/${projectSlug}`,boldName=import_chalk.default.bold(STANDARD_ENVIRONMENTS.includes(environment.slug)?(0,import_title.default)(environment.slug):environment.slug);return output_manager_default.link(boldName,`${projectUrl}/settings/environments/${environment.slug}`,{fallback:()=>boldName,color:!1})}export{formatEnvironment};
|
|
@@ -0,0 +1,25 @@
|
|
|
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{require_load_json_file,require_pify}from"./chunk-RCTYVKM5.js";import{isNativeBinaryInstall}from"./chunk-7T6TL3GQ.js";import{require_graceful_fs}from"./chunk-F2ZWW2IO.js";import{require_build_utils}from"./chunk-XFVGX5HG.js";import{output_manager_default,require_signal_exit}from"./chunk-Z6Y55QJW.js";import{__commonJS,__require,__toESM}from"./chunk-6L236MNA.js";var require_dist=__commonJS({"../../internals/constants/dist/index.js"(exports){"use strict";Object.defineProperty(exports,"__esModule",{value:!0});exports.TITLE=exports.NAME=exports.LOGO=exports.PROJECT_ENV_TARGET=void 0;exports.PROJECT_ENV_TARGET=["production","preview","development"];exports.LOGO="\u25B2";exports.NAME="vercel";exports.TITLE="Vercel"}});var require_imurmurhash=__commonJS({"../../node_modules/.pnpm/imurmurhash@0.1.4/node_modules/imurmurhash/imurmurhash.js"(exports,module){(function(){var cache;function MurmurHash3(key,seed){var m=this instanceof MurmurHash3?this:cache;if(m.reset(seed),typeof key=="string"&&key.length>0&&m.hash(key),m!==this)return m}MurmurHash3.prototype.hash=function(key){var h1,k1,i,top,len;switch(len=key.length,this.len+=len,k1=this.k1,i=0,this.rem){case 0:k1^=len>i?key.charCodeAt(i++)&65535:0;case 1:k1^=len>i?(key.charCodeAt(i++)&65535)<<8:0;case 2:k1^=len>i?(key.charCodeAt(i++)&65535)<<16:0;case 3:k1^=len>i?(key.charCodeAt(i)&255)<<24:0,k1^=len>i?(key.charCodeAt(i++)&65280)>>8:0}if(this.rem=len+this.rem&3,len-=this.rem,len>0){for(h1=this.h1;k1=k1*11601+(k1&65535)*3432906752&4294967295,k1=k1<<15|k1>>>17,k1=k1*13715+(k1&65535)*461832192&4294967295,h1^=k1,h1=h1<<13|h1>>>19,h1=h1*5+3864292196&4294967295,!(i>=len);)k1=key.charCodeAt(i++)&65535^(key.charCodeAt(i++)&65535)<<8^(key.charCodeAt(i++)&65535)<<16,top=key.charCodeAt(i++),k1^=(top&255)<<24^(top&65280)>>8;switch(k1=0,this.rem){case 3:k1^=(key.charCodeAt(i+2)&65535)<<16;case 2:k1^=(key.charCodeAt(i+1)&65535)<<8;case 1:k1^=key.charCodeAt(i)&65535}this.h1=h1}return this.k1=k1,this},MurmurHash3.prototype.result=function(){var k1,h1;return k1=this.k1,h1=this.h1,k1>0&&(k1=k1*11601+(k1&65535)*3432906752&4294967295,k1=k1<<15|k1>>>17,k1=k1*13715+(k1&65535)*461832192&4294967295,h1^=k1),h1^=this.len,h1^=h1>>>16,h1=h1*51819+(h1&65535)*2246770688&4294967295,h1^=h1>>>13,h1=h1*44597+(h1&65535)*3266445312&4294967295,h1^=h1>>>16,h1>>>0},MurmurHash3.prototype.reset=function(seed){return this.h1=typeof seed=="number"?seed:0,this.rem=this.k1=this.len=0,this},cache=new MurmurHash3,typeof module<"u"?module.exports=MurmurHash3:this.MurmurHash3=MurmurHash3})()}});var require_write_file_atomic=__commonJS({"../../node_modules/.pnpm/write-file-atomic@2.4.3/node_modules/write-file-atomic/index.js"(exports,module){"use strict";module.exports=writeFile;module.exports.sync=writeFileSync2;module.exports._getTmpname=getTmpname;module.exports._cleanupOnExit=cleanupOnExit;var fs=require_graceful_fs(),MurmurHash3=require_imurmurhash(),onExit=require_signal_exit(),path=__require("path"),activeFiles={},threadId=function(){try{var workerThreads=__require("worker_threads");return workerThreads.threadId}catch{return 0}}(),invocations=0;function getTmpname(filename){return filename+"."+MurmurHash3(__filename).hash(String(process.pid)).hash(String(threadId)).hash(String(++invocations)).result()}function cleanupOnExit(tmpfile){return function(){try{fs.unlinkSync(typeof tmpfile=="function"?tmpfile():tmpfile)}catch{}}}function writeFile(filename,data,options,callback){options?options instanceof Function?(callback=options,options={}):typeof options=="string"&&(options={encoding:options}):options={};var Promise2=options.Promise||global.Promise,truename,fd,tmpfile,removeOnExitHandler=onExit(cleanupOnExit(()=>tmpfile)),absoluteName=path.resolve(filename);new Promise2(function(resolve){activeFiles[absoluteName]||(activeFiles[absoluteName]=[]),activeFiles[absoluteName].push(resolve),activeFiles[absoluteName].length===1&&resolve()}).then(function(){return new Promise2(function(resolve){fs.realpath(filename,function(_,realname){truename=realname||filename,tmpfile=getTmpname(truename),resolve()})})}).then(function(){return new Promise2(function(resolve){options.mode&&options.chown?resolve():fs.stat(truename,function(err,stats){err||!stats||(options=Object.assign({},options),options.mode==null&&(options.mode=stats.mode),options.chown==null&&process.getuid&&(options.chown={uid:stats.uid,gid:stats.gid})),resolve()})})}).then(function(){return new Promise2(function(resolve,reject){fs.open(tmpfile,"w",options.mode,function(err,_fd){fd=_fd,err?reject(err):resolve()})})}).then(function(){return new Promise2(function(resolve,reject){Buffer.isBuffer(data)?fs.write(fd,data,0,data.length,0,function(err){err?reject(err):resolve()}):data!=null?fs.write(fd,String(data),0,String(options.encoding||"utf8"),function(err){err?reject(err):resolve()}):resolve()})}).then(function(){return new Promise2(function(resolve,reject){options.fsync!==!1?fs.fsync(fd,function(err){err?fs.close(fd,()=>reject(err)):fs.close(fd,resolve)}):fs.close(fd,resolve)})}).then(function(){if(fd=null,options.chown)return new Promise2(function(resolve,reject){fs.chown(tmpfile,options.chown.uid,options.chown.gid,function(err){err?reject(err):resolve()})})}).then(function(){if(options.mode)return new Promise2(function(resolve,reject){fs.chmod(tmpfile,options.mode,function(err){err?reject(err):resolve()})})}).then(function(){return new Promise2(function(resolve,reject){fs.rename(tmpfile,truename,function(err){err?reject(err):resolve()})})}).then(function(){removeOnExitHandler(),callback()},function(err){return new Promise2(resolve=>fd?fs.close(fd,resolve):resolve()).then(()=>{removeOnExitHandler(),fs.unlink(tmpfile,function(){callback(err)})})}).then(function(){activeFiles[absoluteName].shift(),activeFiles[absoluteName].length>0?activeFiles[absoluteName][0]():delete activeFiles[absoluteName]})}function writeFileSync2(filename,data,options){typeof options=="string"?options={encoding:options}:options||(options={});try{filename=fs.realpathSync(filename)}catch{}var tmpfile=getTmpname(filename);if(!options.mode||!options.chown)try{var stats=fs.statSync(filename);options=Object.assign({},options),options.mode||(options.mode=stats.mode),!options.chown&&process.getuid&&(options.chown={uid:stats.uid,gid:stats.gid})}catch{}var fd,cleanup=cleanupOnExit(tmpfile),removeOnExitHandler=onExit(cleanup);try{fd=fs.openSync(tmpfile,"w",options.mode),Buffer.isBuffer(data)?fs.writeSync(fd,data,0,data.length,0):data!=null&&fs.writeSync(fd,String(data),0,String(options.encoding||"utf8")),options.fsync!==!1&&fs.fsyncSync(fd),fs.closeSync(fd),options.chown&&fs.chownSync(tmpfile,options.chown.uid,options.chown.gid),options.mode&&fs.chmodSync(tmpfile,options.mode),fs.renameSync(tmpfile,filename),removeOnExitHandler()}catch(err){if(fd)try{fs.closeSync(fd)}catch{}throw removeOnExitHandler(),cleanup(),err}}}});var require_is_plain_obj=__commonJS({"../../node_modules/.pnpm/is-plain-obj@1.1.0/node_modules/is-plain-obj/index.js"(exports,module){"use strict";var toString=Object.prototype.toString;module.exports=function(x){var prototype;return toString.call(x)==="[object Object]"&&(prototype=Object.getPrototypeOf(x),prototype===null||prototype===Object.getPrototypeOf({}))}}});var require_sort_keys=__commonJS({"../../node_modules/.pnpm/sort-keys@1.1.2/node_modules/sort-keys/index.js"(exports,module){"use strict";var isPlainObj=require_is_plain_obj();module.exports=function(obj,opts){if(!isPlainObj(obj))throw new TypeError("Expected a plain object");opts=opts||{},typeof opts=="function"&&(opts={compare:opts});var deep=opts.deep,seenInput=[],seenOutput=[],sortKeys=function(x){var seenIndex=seenInput.indexOf(x);if(seenIndex!==-1)return seenOutput[seenIndex];var ret={},keys=Object.keys(x).sort(opts.compare);seenInput.push(x),seenOutput.push(ret);for(var i=0;i<keys.length;i++){var key=keys[i],val=x[key];ret[key]=deep&&isPlainObj(val)?sortKeys(val):val}return ret};return sortKeys(obj)}}});var require_pify2=__commonJS({"../../node_modules/.pnpm/pify@3.0.0/node_modules/pify/index.js"(exports,module){"use strict";var processFn=(fn,opts)=>function(){let P=opts.promiseModule,args=new Array(arguments.length);for(let i=0;i<arguments.length;i++)args[i]=arguments[i];return new P((resolve,reject)=>{opts.errorFirst?args.push(function(err,result){if(opts.multiArgs){let results=new Array(arguments.length-1);for(let i=1;i<arguments.length;i++)results[i-1]=arguments[i];err?(results.unshift(err),reject(results)):resolve(results)}else err?reject(err):resolve(result)}):args.push(function(result){if(opts.multiArgs){let results=new Array(arguments.length-1);for(let i=0;i<arguments.length;i++)results[i]=arguments[i];resolve(results)}else resolve(result)}),fn.apply(this,args)})};module.exports=(obj,opts)=>{opts=Object.assign({exclude:[/.+(Sync|Stream)$/],errorFirst:!0,promiseModule:Promise},opts);let filter=key=>{let match=pattern=>typeof pattern=="string"?key===pattern:pattern.test(key);return opts.include?opts.include.some(match):!opts.exclude.some(match)},ret;typeof obj=="function"?ret=function(){return opts.excludeMain?obj.apply(this,arguments):processFn(obj,opts).apply(this,arguments)}:ret=Object.create(Object.getPrototypeOf(obj));for(let key in obj){let x=obj[key];ret[key]=typeof x=="function"&&filter(key)?processFn(x,opts):x}return ret}}});var require_make_dir=__commonJS({"../../node_modules/.pnpm/make-dir@1.3.0/node_modules/make-dir/index.js"(exports,module){"use strict";var fs=__require("fs"),path=__require("path"),pify=require_pify2(),defaults={mode:511&~process.umask(),fs},checkPath=pth=>{if(process.platform==="win32"&&/[<>:"|?*]/.test(pth.replace(path.parse(pth).root,""))){let err=new Error(`Path contains invalid characters: ${pth}`);throw err.code="EINVAL",err}};module.exports=(input,opts)=>Promise.resolve().then(()=>{checkPath(input),opts=Object.assign({},defaults,opts);let mkdir=pify(opts.fs.mkdir),stat=pify(opts.fs.stat),make=pth=>mkdir(pth,opts.mode).then(()=>pth).catch(err=>{if(err.code==="ENOENT"){if(err.message.includes("null bytes")||path.dirname(pth)===pth)throw err;return make(path.dirname(pth)).then(()=>make(pth))}return stat(pth).then(stats=>stats.isDirectory()?pth:Promise.reject()).catch(()=>{throw err})});return make(path.resolve(input))});module.exports.sync=(input,opts)=>{checkPath(input),opts=Object.assign({},defaults,opts);let make=pth=>{try{opts.fs.mkdirSync(pth,opts.mode)}catch(err){if(err.code==="ENOENT"){if(err.message.includes("null bytes")||path.dirname(pth)===pth)throw err;return make(path.dirname(pth)),make(pth)}try{if(!opts.fs.statSync(pth).isDirectory())throw new Error("The path is not a directory")}catch{throw err}}return pth};return make(path.resolve(input))}}});var require_detect_indent=__commonJS({"../../node_modules/.pnpm/detect-indent@5.0.0/node_modules/detect-indent/index.js"(exports,module){"use strict";var INDENT_RE=/^(?:( )+|\t+)/;function getMostUsed(indents){let result=0,maxUsed=0,maxWeight=0;for(let entry of indents){let key=entry[0],val=entry[1],u=val[0],w=val[1];(u>maxUsed||u===maxUsed&&w>maxWeight)&&(maxUsed=u,maxWeight=w,result=Number(key))}return result}module.exports=str=>{if(typeof str!="string")throw new TypeError("Expected a string");let tabs=0,spaces=0,prev=0,indents=new Map,current,isIndent;for(let line of str.split(/\n/g)){if(!line)continue;let indent2,matches=line.match(INDENT_RE);matches?(indent2=matches[0].length,matches[1]?spaces++:tabs++):indent2=0;let diff=indent2-prev;prev=indent2,diff?(isIndent=diff>0,current=indents.get(isIndent?diff:-diff),current?current[0]++:(current=[1,0],indents.set(diff,current))):current&&(current[1]+=Number(isIndent))}let amount=getMostUsed(indents),type,indent;return amount?spaces>=tabs?(type="space",indent=" ".repeat(amount)):(type="tab",indent=" ".repeat(amount)):(type=null,indent=""),{amount,type,indent}}}});var require_write_json_file=__commonJS({"../../node_modules/.pnpm/write-json-file@2.2.0/node_modules/write-json-file/index.js"(exports,module){"use strict";var path=__require("path"),fs=require_graceful_fs(),writeFileAtomic=require_write_file_atomic(),sortKeys=require_sort_keys(),makeDir=require_make_dir(),pify=require_pify(),detectIndent=require_detect_indent(),init=(fn,fp,data,opts)=>{if(!fp)throw new TypeError("Expected a filepath");if(data===void 0)throw new TypeError("Expected data to stringify");return opts=Object.assign({indent:" ",sortKeys:!1},opts),opts.sortKeys&&(data=sortKeys(data,{deep:!0,compare:typeof opts.sortKeys=="function"&&opts.sortKeys})),fn(fp,data,opts)},readFile=fp=>pify(fs.readFile)(fp,"utf8").catch(()=>{}),main=(fp,data,opts)=>(opts.detectIndent?readFile(fp):Promise.resolve()).then(str=>{let indent=str?detectIndent(str).indent:opts.indent,json=JSON.stringify(data,opts.replacer,indent);return pify(writeFileAtomic)(fp,`${json}
|
|
8
|
+
`,{mode:opts.mode})}),mainSync=(fp,data,opts)=>{let indent=opts.indent;if(opts.detectIndent)try{let file=fs.readFileSync(fp,"utf8");indent=detectIndent(file).indent}catch(err){if(err.code!=="ENOENT")throw err}let json=JSON.stringify(data,opts.replacer,indent);return writeFileAtomic.sync(fp,`${json}
|
|
9
|
+
`,{mode:opts.mode})};module.exports=(fp,data,opts)=>makeDir(path.dirname(fp),{fs}).then(()=>init(main,fp,data,opts));module.exports.sync=(fp,data,opts)=>{makeDir.sync(path.dirname(fp),{fs}),init(mainSync,fp,data,opts)}}});import{randomUUID as randomUUID2}from"node:crypto";import os from"node:os";var import_constants=__toESM(require_dist(),1),import_build_utils=__toESM(require_build_utils(),1);import{spawn}from"node:child_process";var import_load_json_file=__toESM(require_load_json_file(),1),import_write_json_file=__toESM(require_write_json_file(),1);import{randomUUID}from"node:crypto";import{mkdirSync,renameSync,rmSync,writeFileSync}from"node:fs";import{dirname}from"node:path";var DEFAULT_CLI_SESSION_INACTIVITY_TIMEOUT_MS=30*60*1e3,DEFAULT_CLI_SESSION_MAX_LIFETIME_MS=24*60*60*1e3;function isPersistedCliSession(value){if(!value||typeof value!="object")return!1;let session=value;return typeof session.id=="string"&&typeof session.createdAt=="number"&&Number.isFinite(session.createdAt)&&typeof session.lastSeenAt=="number"&&Number.isFinite(session.lastSeenAt)}function isPersistedCliDevice(value){return!value||typeof value!="object"?!1:typeof value.id=="string"}function readPersistedCliSession(filePath){try{let session=import_load_json_file.default.sync(filePath);return isPersistedCliSession(session)?session:null}catch{return null}}function writePersistedCliSession(filePath,session){let temporaryPath=`${filePath}.${process.pid}.${randomUUID()}.tmp`;try{mkdirSync(dirname(filePath),{recursive:!0}),writeFileSync(temporaryPath,`${JSON.stringify(session,null,2)}
|
|
10
|
+
`,{flag:"wx",mode:384}),renameSync(temporaryPath,filePath)}catch{}finally{try{rmSync(temporaryPath,{force:!0})}catch{}}}function readPersistedCliDevice(filePath){try{let device=import_load_json_file.default.sync(filePath);return isPersistedCliDevice(device)?device:null}catch{return null}}function writePersistedCliDevice(filePath,device){try{mkdirSync(dirname(filePath),{recursive:!0}),import_write_json_file.default.sync(filePath,device,{indent:2})}catch{}}function getOrCreatePersistedCliSession(opts){let now=opts.now?.()??Date.now(),inactivityTimeoutMs=opts.inactivityTimeoutMs??DEFAULT_CLI_SESSION_INACTIVITY_TIMEOUT_MS,maxLifetimeMs=opts.maxLifetimeMs??DEFAULT_CLI_SESSION_MAX_LIFETIME_MS,existing=readPersistedCliSession(opts.filePath),session=existing&&now-existing.lastSeenAt<=inactivityTimeoutMs&&now-existing.createdAt<=maxLifetimeMs?{...existing,lastSeenAt:now}:{id:randomUUID(),createdAt:now,lastSeenAt:now};return writePersistedCliSession(opts.filePath,session),session}function touchPersistedCliSession(opts,session){let nextSession={...session,lastSeenAt:opts.now?.()??Date.now()};return writePersistedCliSession(opts.filePath,nextSession),nextSession}function getOrCreatePersistedCliDevice(opts){let existing=readPersistedCliDevice(opts.filePath);if(existing)return existing;let device={id:randomUUID()};return writePersistedCliDevice(opts.filePath,device),device}var LogLabel="['telemetry']:",MAX_ERROR_SERVER_MESSAGE_LENGTH=500,TelemetryClient=class{constructor({opts}){this.redactedValue="[REDACTED]";this.noValueToTriggerPrompt="[TRIGGER_PROMPT]";this.redactedArgumentsLength=args=>args&&args.length===1?"ONE":args.length>1?"MANY":"NONE";this.redactedTargetName=target=>import_constants.PROJECT_ENV_TARGET.includes(target)?target:this.redactedValue;this.isDebug=opts.isDebug||!1,this.store=opts.store}track(eventData){this.isDebug&&output_manager_default.debug(`${LogLabel} ${eventData.key}:${eventData.value}`);let event={id:randomUUID2(),eventTime:Date.now(),...eventData};this.store.add(event)}trackCliCommand(eventData){this.track({key:`command:${eventData.command}`,value:eventData.value})}trackCliSubcommand(eventData){this.track({key:`subcommand:${eventData.subcommand}`,value:eventData.value})}trackCliArgument(eventData){eventData.value&&this.track({key:`argument:${eventData.arg}`,value:eventData.value})}trackCliOption(eventData){this.track({key:`option:${eventData.option}`,value:eventData.value})}trackTargetEnvironment(targetEnvironment){this.track({key:"target_environment",value:targetEnvironment})}trackCommandOutput(eventData){this.track({key:`output:${eventData.key}`,value:eventData.value})}trackCliFlag(flag){this.track({key:`flag:${flag}`,value:"TRUE"})}trackOidcTokenRefresh(count){this.track({key:"oidc-token-refresh",value:`${count}`})}trackCPUs(){this.track({key:"cpu_count",value:String(os.cpus().length)})}trackAgenticUse(agent){agent&&this.track({key:"agent",value:agent})}trackPlatform(){this.track({key:"platform",value:os.platform()})}trackArch(){this.track({key:"arch",value:os.arch()})}trackCI(ciVendorName){ciVendorName&&this.track({key:"ci",value:ciVendorName})}trackStdinIsTTY(isTTY){this.track({key:"stdin_is_tty",value:isTTY?"true":"false"})}trackVersion(version){version&&this.track({key:"version",value:version})}trackDefaultDeploy(){this.track({key:"default-deploy",value:"TRUE"})}trackProjectId(projectId){projectId&&this.track({key:"project_id",value:projectId})}trackInvocationId(invocationId){invocationId&&this.track({key:"invocation_id",value:invocationId})}trackDeviceId(deviceId){deviceId&&this.track({key:"device_id",value:deviceId})}trackVercelPluginActiveSession(){this.track({key:"vercel_plugin_active_session",value:"TRUE"})}trackVercelPluginVersion(version){version&&this.track({key:"vercel_plugin_version",value:version})}trackErrorStatus(status){typeof status<"u"&&this.track({key:"error_status",value:String(status)})}trackErrorCode(code){code&&this.track({key:"error_code",value:code})}trackErrorSlug(slug){slug&&this.track({key:"error_slug",value:slug})}trackErrorAction(action){action&&this.track({key:"error_action",value:action})}trackErrorServerMessage(serverMessage){if(serverMessage){let normalizedServerMessage=serverMessage.trim().replace(/\s+/g," ");this.track({key:"error_server_message",value:normalizedServerMessage.slice(0,MAX_ERROR_SERVER_MESSAGE_LENGTH)})}}trackExtension(){this.track({key:"extension",value:this.redactedValue})}trackLoginState(state){state==="started"&&(this.loginAttempt=randomUUID2()),this.loginAttempt&&this.track({key:`login:attempt:${this.loginAttempt}`,value:state}),state!=="started"&&(this.loginAttempt=void 0)}trackCliFlagHelp(command,subcommands){let subcommand;subcommands&&(subcommand=Array.isArray(subcommands)?subcommands[0]:subcommands),this.track({key:"flag:help",value:subcommand?`${command}:${subcommand}`:command})}trackCliOptionFormat(format){if(format){let allowedFormat=["json"].includes(format)?format:this.redactedValue;this.trackCliOption({option:"format",value:allowedFormat})}}trackCliOptionProject(value){value&&(Array.isArray(value)&&value.length===0||this.trackCliOption({option:"project",value:this.redactedValue}))}},TelemetryEventStore=class{constructor(opts){this.teamId="NO_TEAM_ID";this.userId="NO_USER_ID";this.projectId="NO_PROJECT_ID";this.isDebug=opts?.isDebug||!1,this.events=[],this.config=opts?.config,this.cliDeviceOptions=opts?.cliDevice,this.cliSessionOptions=opts?.cliSession,this.invocationId=randomUUID2(),this.deviceId=randomUUID2(),this.cliDeviceOptions&&(this.cliDevice=getOrCreatePersistedCliDevice(this.cliDeviceOptions),this.deviceId=this.cliDevice.id),this.cliSessionOptions?(this.cliSession=getOrCreatePersistedCliSession(this.cliSessionOptions),this.sessionId=this.cliSession.id):this.sessionId=randomUUID2()}add(event){event.sessionId=this.sessionId,event.teamId=this.teamId,event.userId=this.userId,event.projectId=this.projectId,this.events.push(event)}updateTeamId(teamId){teamId&&(this.teamId=teamId)}updateUserId(userId){userId&&(this.userId=userId)}updateProjectId(projectId){projectId&&(this.projectId=projectId)}get hasUserId(){return this.userId!=="NO_USER_ID"}get currentProjectId(){return this.projectId}get currentInvocationId(){return this.invocationId}get currentDeviceId(){return this.deviceId}get currentSessionId(){return this.sessionId}get readonlyEvents(){return Array.from(this.events)}reset(){this.events=[]}get enabled(){return process.env.VERCEL_TELEMETRY_DISABLED?!1:this.config?.enabled??!0}async save(){if(this.cliSession&&this.cliSessionOptions&&(this.cliSession=touchPersistedCliSession(this.cliSessionOptions,this.cliSession)),this.isDebug){output_manager_default.log(`${LogLabel} Flushing Events`);for(let event of this.events)event.teamId=this.teamId,event.userId=this.userId,event.projectId=this.projectId,output_manager_default.log(JSON.stringify(event));return}if(this.enabled){let sessionId=this.events[0].sessionId;if(!sessionId){output_manager_default.debug("Unable to send metrics: no session ID");return}let events=this.events.map(event=>{delete event.sessionId,delete event.teamId,delete event.userId,delete event.projectId;let{eventTime,...rest}=event;return{event_time:eventTime,team_id:this.teamId,user_id:this.userId,project_id:this.projectId,...rest}}),payload={headers:{"Client-id":"vercel-cli","x-vercel-cli-topic-id":"generic","x-vercel-cli-session-id":sessionId},body:events};await this.sendToSubprocess(payload,output_manager_default.debugEnabled)}}async sendToSubprocess(payload,outputDebugEnabled){let flushArgs=["telemetry","flush",JSON.stringify(payload)],nodeBinaryPath,script;if(isNativeBinaryInstall())nodeBinaryPath=process.execPath,script=flushArgs;else{let args=[process.execPath,process.argv[0],process.argv[1]];args[0]===args[1]&&args.shift(),nodeBinaryPath=args[0],script=[...args.slice(1),...flushArgs]}let env=(0,import_build_utils.cloneEnv)(process.env,{VERCEL_TELEMETRY_DISABLED:"1"});if(outputDebugEnabled)return new Promise(resolve=>{let childProcess=spawn(nodeBinaryPath,script,{env,stdio:["ignore","pipe","pipe"]});childProcess.stderr.on("data",data=>output_manager_default.debug(data.toString())),childProcess.stdout.on("data",data=>output_manager_default.debug(data.toString())),childProcess.on("error",d=>{output_manager_default.debug(d)});let timeout=setTimeout(()=>{output_manager_default.debug("Telemetry subprocess killed due to timeout"),childProcess.kill()},2e3);childProcess.on("exit",code=>{output_manager_default.debug(`Telemetry subprocess exited with code ${code}`),childProcess.unref(),timeout.unref(),resolve()})});spawn(nodeBinaryPath,script,{stdio:"ignore",env,windowsHide:!0,detached:!0}).unref()}};export{require_dist,TelemetryClient,TelemetryEventStore};
|
|
11
|
+
/*! Bundled license information:
|
|
12
|
+
|
|
13
|
+
imurmurhash/imurmurhash.js:
|
|
14
|
+
(**
|
|
15
|
+
* @preserve
|
|
16
|
+
* JS Implementation of incremental MurmurHash3 (r150) (as of May 10, 2013)
|
|
17
|
+
*
|
|
18
|
+
* @author <a href="mailto:jensyt@gmail.com">Jens Taylor</a>
|
|
19
|
+
* @see http://github.com/homebrewing/brauhaus-diff
|
|
20
|
+
* @author <a href="mailto:gary.court@gmail.com">Gary Court</a>
|
|
21
|
+
* @see http://github.com/garycourt/murmurhash-js
|
|
22
|
+
* @author <a href="mailto:aappleby@gmail.com">Austin Appleby</a>
|
|
23
|
+
* @see http://sites.google.com/site/murmurhash/
|
|
24
|
+
*)
|
|
25
|
+
*/
|
|
@@ -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{inspectTokenRequest,processInspectTokenResponse}from"./chunk-5XJNPXQK.js";import{findProjectsFromPath,getLinkFromDir,getRepoLink,getVercelDirectory}from"./chunk-VLZ47RWM.js";import{getTeamByIdOrSlug,getUser}from"./chunk-EVZRQGNK.js";import{InvalidToken,TeamDeleted}from"./chunk-R2TGGVCT.js";import{output_manager_default}from"./chunk-Z6Y55QJW.js";var VERCEL_API_ORIGIN="https://api.vercel.com";async function introspectToken(client){let token=client.authConfig.token;if(!token)throw new Error("No token to introspect");if(new URL(client.apiUrl).origin!==VERCEL_API_ORIGIN)throw new Error("Token introspection is unavailable for custom API origins");let[error,introspection]=await processInspectTokenResponse(await inspectTokenRequest(token));if(error)throw error;return introspection}function isAppPrincipalEnabled(){return!!process.env.APP_PRINCIPAL_ENABLED}function resolveAppFromToken(token){return!token.active||!token.client_id?null:{id:token.client_id,name:token.client_name}}async function resolveAppTokenScope(client,scope){let token=await introspectToken(client).catch(()=>null),app=token?resolveAppFromToken(token):null,team=token?.team;return!app||!team||team.id!==scope&&team.slug!==scope?!1:(client.config.currentTeam=team.id,!0)}import{relative}from"path";async function getScope(client,opts={}){let{user,app,token}=await getPrincipal(client),defaultTeamId=user?.version==="northstar"?user.defaultTeamId:void 0,appTeamId=!user&&app?token?.team?.id:void 0;if(!user&&app&&opts.getTeam===!1)throw new Error("App principal scope resolution requires a team lookup.");!user&&app&&(client.config.currentTeam=appTeamId),!client.config.currentTeam&&defaultTeamId&&(client.config.currentTeam=defaultTeamId);let teamId=client.config.currentTeam||defaultTeamId,team=teamId&&opts.getTeam!==!1?await getTeam(client,teamId):null,contextName=team?.slug||user?.username||user?.email;if(!contextName)throw new Error("Unable to determine context name");return opts.resolveLocalScope?resolveLocalScopeContext(client,{user,app,team}):{contextName,team,user,app}}async function getPrincipal(client){if(!isAppPrincipalEnabled())return{user:await getUser(client),app:null,token:null};let[userResult,tokenResult]=await Promise.allSettled([getUser(client),introspectToken(client)]),token=tokenResult.status==="fulfilled"?tokenResult.value:null,app=token?resolveAppFromToken(token):null;if(userResult.status==="rejected"&&!(app&&userResult.reason instanceof InvalidToken))throw userResult.reason;return{user:userResult.status==="fulfilled"?userResult.value:null,app,token}}async function resolveLocalScopeContext(client,{user,app,team}){let explicitScopeProvided=detectExplicitScope(client),globalTeamId=client.config.currentTeam,{localOrgId,linkedRepo,isCrossTeamRepo}=await findLocalLink(client),isAppPrincipal=!user&&!!app,effectiveLocalOrgId=isAppPrincipal?void 0:localOrgId,scopeMismatch=!!(effectiveLocalOrgId&&globalTeamId&&globalTeamId!==effectiveLocalOrgId);!isAppPrincipal&&!explicitScopeProvided&&!effectiveLocalOrgId&&isCrossTeamRepo&&output_manager_default.warn("This repository has projects across multiple teams. Use `--scope` to specify which team, or `cd` into a project directory.");let resolvedTeam=!explicitScopeProvided&&effectiveLocalOrgId?await applyLocalOrg(client,effectiveLocalOrgId):team,{org,contextName}=resolveOrg(resolvedTeam,user);return{org,contextName,user,team:resolvedTeam,app,globalTeam:team,linkedRepo,isCrossTeamRepo,scopeMismatch,explicitScopeProvided}}async function applyLocalOrg(client,localOrgId){return client.config.currentTeam=localOrgId.startsWith("team_")?localOrgId:void 0,client.config.currentTeam?await getTeamByIdOrSlug(client,client.config.currentTeam):null}async function getTeam(client,teamId){let team=await getTeamByIdOrSlug(client,teamId);if(!team)throw new TeamDeleted;return team}function resolveOrg(team,user){if(team)return{org:{type:"team",id:team.id,slug:team.slug},contextName:team.slug};if(user)return{org:{type:"user",id:user.id,slug:user.username},contextName:user.username||user.email};throw new Error("Unable to determine scope: no team or personal account is available for this token. Use `--scope` to specify a team.")}async function findLocalLink(client){let[projectLink,repoLink]=await Promise.all([findProjectLink(client),findRepoLink(client)]);return{localOrgId:findLocalOrgId(client.cwd,projectLink,repoLink),linkedRepo:repoLink?.repoConfig?{repoConfig:repoLink.repoConfig,rootPath:repoLink.rootPath}:null,isCrossTeamRepo:detectCrossTeamRepo(repoLink?.repoConfig)}}async function findProjectLink(client){try{return await getLinkFromDir(getVercelDirectory(client.cwd))}catch{return null}}async function findRepoLink(client){try{return await getRepoLink(client,client.cwd)}catch{return null}}function findLocalOrgId(cwd,projectLink,repoLink){if(projectLink)return projectLink.orgId;if(repoLink?.repoConfig)return findRepoOrgId(repoLink.repoConfig,relative(repoLink.rootPath,cwd))}function findRepoOrgId(repoConfig,pathFromRepoRoot){let projects=findProjectsFromPath(repoConfig.projects,pathFromRepoRoot),orgIds=new Set(projects.map(p=>p.orgId??repoConfig.orgId??""));if(orgIds.size!==1)return;let[orgId]=orgIds;return orgId||void 0}function detectExplicitScope(client){let argv=client.argv;for(let arg of argv){if(arg==="--")break;if(arg==="--scope"||arg==="--team"||arg.startsWith("--scope=")||arg.startsWith("--team=")||arg==="-S"||arg==="-T")return!0}return!!client.localConfig?.scope}function detectCrossTeamRepo(repoConfig){if(!repoConfig?.projects||repoConfig.projects.length<2)return!1;let orgIds=new Set;for(let project of repoConfig.projects){let orgId=project.orgId??repoConfig.orgId;orgId&&orgIds.add(orgId)}return orgIds.size>1}export{isAppPrincipalEnabled,resolveAppTokenScope,getScope,detectExplicitScope};
|
|
@@ -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{fetch}from"./chunk-MY4MONOH.js";import{pkg_default}from"./chunk-AVSPFBLM.js";import os from"os";var ua_default=`${pkg_default.name} ${pkg_default.version} node-${process.version} ${os.platform()} (${os.arch()})`;import{hostname}from"os";var VERCEL_ISSUER=new URL("https://vercel.com"),VERCEL_CLI_CLIENT_ID="cl_HYyOPBNtFMfHhaUn9L4QPfTZz6TP47bp",userAgent=`${hostname()} @ ${ua_default}`,_as;async function as(){if(!_as){let discoveryResponse=await discoveryEndpointRequest(VERCEL_ISSUER),[discoveryResponseError,as2]=await processDiscoveryEndpointResponse(discoveryResponse);if(discoveryResponseError)throw discoveryResponseError;_as=as2}return _as}async function discoveryEndpointRequest(issuer){return await fetch(new URL(".well-known/openid-configuration",issuer),{headers:{"Content-Type":"application/json","user-agent":userAgent}})}async function processDiscoveryEndpointResponse(response){let json=await response.json();if(!response.ok)return[new Error("Discovery endpoint request failed")];if(typeof json!="object"||json===null||!canParseURL(json.issuer)||!canParseURL(json.device_authorization_endpoint)||!canParseURL(json.token_endpoint)||!canParseURL(json.revocation_endpoint)||!canParseURL(json.jwks_uri)||!canParseURL(json.introspection_endpoint))return[new TypeError("Invalid discovery response")];let issuer=new URL(json.issuer);return issuer.href!==VERCEL_ISSUER.href?[new Error("Issuer mismatch")]:[null,{issuer,device_authorization_endpoint:new URL(json.device_authorization_endpoint),token_endpoint:new URL(json.token_endpoint),revocation_endpoint:new URL(json.revocation_endpoint),jwks_uri:new URL(json.jwks_uri),introspection_endpoint:new URL(json.introspection_endpoint)}]}async function deviceAuthorizationRequest(options){let body=new URLSearchParams({client_id:VERCEL_CLI_CLIENT_ID});return options?.refresh_token?(body.set("refresh_token",options.refresh_token),options.acr_values&&body.set("acr_values",options.acr_values)):body.set("scope","openid offline_access"),await fetch((await as()).device_authorization_endpoint,{method:"POST",headers:{"Content-Type":"application/x-www-form-urlencoded","user-agent":userAgent},body})}async function processDeviceAuthorizationResponse(response){let json=await response.json();return response.ok?typeof json!="object"||json===null?[new TypeError("Expected response to be an object")]:!("device_code"in json)||typeof json.device_code!="string"?[new TypeError("Expected `device_code` to be a string")]:!("user_code"in json)||typeof json.user_code!="string"?[new TypeError("Expected `user_code` to be a string")]:!("verification_uri"in json)||typeof json.verification_uri!="string"||!canParseURL(json.verification_uri)?[new TypeError("Expected `verification_uri` to be a string")]:!("verification_uri_complete"in json)||typeof json.verification_uri_complete!="string"||!canParseURL(json.verification_uri_complete)?[new TypeError("Expected `verification_uri_complete` to be a string")]:!("expires_in"in json)||typeof json.expires_in!="number"?[new TypeError("Expected `expires_in` to be a number")]:!("interval"in json)||typeof json.interval!="number"?[new TypeError("Expected `interval` to be a number")]:[null,{device_code:json.device_code,user_code:json.user_code,verification_uri:json.verification_uri,verification_uri_complete:json.verification_uri_complete,expiresAt:Date.now()+json.expires_in*1e3,interval:json.interval}]:[new OAuthError("Device authorization request failed",json)]}async function deviceAccessTokenRequest(options){try{return[null,await fetch((await as()).token_endpoint,{method:"POST",headers:{"Content-Type":"application/x-www-form-urlencoded","user-agent":userAgent},body:new URLSearchParams({client_id:VERCEL_CLI_CLIENT_ID,grant_type:"urn:ietf:params:oauth:grant-type:device_code",...options}),signal:AbortSignal.timeout(10*1e3)})]}catch(error){return error instanceof Error?[error]:[new Error("An unknown error occurred. See the logs for details.",{cause:error})]}}async function processTokenResponse(response){let json=await response.json();return response.ok?typeof json!="object"||json===null?[new TypeError("Expected response to be an object")]:!("access_token"in json)||typeof json.access_token!="string"?[new TypeError("Expected `access_token` to be a string")]:!("token_type"in json)||json.token_type!=="Bearer"?[new TypeError('Expected `token_type` to be "Bearer"')]:!("expires_in"in json)||typeof json.expires_in!="number"?[new TypeError("Expected `expires_in` to be a number")]:"refresh_token"in json&&(typeof json.refresh_token!="string"||!json.refresh_token)?[new TypeError("Expected `refresh_token` to be a string")]:"scope"in json&&typeof json.scope!="string"?[new TypeError("Expected `scope` to be a string")]:[null,json]:[new OAuthError("Device access token request failed",json)]}async function revocationRequest(options){return await fetch((await as()).revocation_endpoint,{method:"POST",headers:{"Content-Type":"application/x-www-form-urlencoded","user-agent":userAgent},body:new URLSearchParams({...options,client_id:VERCEL_CLI_CLIENT_ID})})}async function processRevocationResponse(response){if(response.ok)return[null,null];let json=await response.json();return[new OAuthError("Revocation request failed",json)]}async function refreshTokenRequest(options){return await fetch((await as()).token_endpoint,{method:"POST",headers:{"Content-Type":"application/x-www-form-urlencoded","user-agent":userAgent},body:new URLSearchParams({client_id:VERCEL_CLI_CLIENT_ID,grant_type:"refresh_token",...options})})}function processOAuthErrorResponse(json){return typeof json!="object"||json===null?new TypeError("Expected response to be an object"):!("error"in json)||typeof json.error!="string"?new TypeError("Expected `error` to be a string"):"error_description"in json&&typeof json.error_description!="string"?new TypeError("Expected `error_description` to be a string"):"error_uri"in json&&typeof json.error_uri!="string"?new TypeError("Expected `error_uri` to be a string"):json}var OAuthError=class extends Error{constructor(message,response){var __super=(...args)=>{super(...args)};let error=processOAuthErrorResponse(response);if(error instanceof TypeError){let message2=`Unexpected server response: ${JSON.stringify(response)}`;__super(message2),this.cause=new Error(message2,{cause:error}),this.code="server_error";return}let cause=error.error;error.error_description&&(cause+=`: ${error.error_description}`),error.error_uri&&(cause+=` (${error.error_uri})`),__super(message,{cause}),this.cause=new Error(cause),this.code=error.error}};function isOAuthError(error){return error instanceof OAuthError}function canParseURL(url){try{return!!new URL(url)}catch{return!1}}async function inspectTokenRequest(token){return fetch((await as()).introspection_endpoint,{method:"POST",headers:{"Content-Type":"application/x-www-form-urlencoded","user-agent":userAgent},body:new URLSearchParams({token})})}async function processInspectTokenResponse(response){try{let token=await response.json();if(!token||typeof token!="object"||!("active"in token))throw new IntrospectionError("Invalid token introspection response");return[null,token]}catch(cause){return[new IntrospectionError("Could not introspect token.",{cause})]}}var IntrospectionError=class extends Error{constructor(){super(...arguments);this.name="IntrospectionError"}};export{ua_default,deviceAuthorizationRequest,processDeviceAuthorizationResponse,deviceAccessTokenRequest,processTokenResponse,revocationRequest,processRevocationResponse,refreshTokenRequest,isOAuthError,inspectTokenRequest,processInspectTokenResponse};
|