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,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{formatErrorJson,handleApiError}from"./chunk-G5FC5ZCO.js";import{isAPIError}from"./chunk-R2TGGVCT.js";import{output_manager_default}from"./chunk-Z6Y55QJW.js";var OBSERVABILITY_METRICS_PATH="/metrics/v1",METRIC_CATALOG_PAGE_SIZE=250;function toMetricDetail(metric){return{id:metric.id,description:metric.description,dimensions:metric.dimensions,unit:metric.unit,aggregations:metric.aggregations,defaultAggregation:metric.defaultAggregation}}function getDefaultAggregation(detail,metricId){return detail.find(metric=>metric.id===metricId)?.defaultAggregation}async function fetchMetricList(client,accountId){let{metrics}=await client.fetch("/v2/observability/schema",{accountId});return metrics}async function fetchMetricCatalog(client,accountId,kind,search,activeSince){let metrics=[],cursor=null;do{let searchParams=new URLSearchParams({limit:String(METRIC_CATALOG_PAGE_SIZE),kind});search&&searchParams.set("search",search),activeSince&&searchParams.set("activeSince",activeSince),cursor&&searchParams.set("cursor",cursor);let response=await client.fetch(`${OBSERVABILITY_METRICS_PATH}?${searchParams}`,{accountId,bailOn429:!0});metrics.push(...response.metrics.map(metric=>({id:metric.id,description:metric.description,dimensions:metric.dimensions,unit:metric.unit,aggregations:metric.aggregations}))),cursor=response.pagination.hasMore?response.pagination.nextCursor:null}while(cursor);return metrics.filter(metric=>(kind==="all"||(kind==="system"?metric.id.startsWith("vercel."):!metric.id.startsWith("vercel.")))&&(!search||metric.id.startsWith(search))).sort((left,right)=>left.id.localeCompare(right.id))}function fetchCustomMetricCatalog(client,accountId,search,activeSince){return fetchMetricCatalog(client,accountId,"custom",search,activeSince)}async function fetchCatalogMetricDetail(client,accountId,metricId,kind,activeSince){let metrics=await fetchMetricCatalog(client,accountId,kind,metricId,activeSince),exactMetric=metrics.find(metric=>metric.id===metricId);return exactMetric?[exactMetric]:metrics}async function fetchMetricDetail(client,accountId,metricId){return(await client.fetch(`/v2/observability/schema/${encodeURIComponent(metricId)}`,{accountId})).map(toMetricDetail)}async function fetchSchemaOrExit(client,jsonOutput,operation){try{return await operation()}catch(err){if(isAPIError(err))return handleApiError(err,jsonOutput,client,{401:{code:"SCHEMA_UNAUTHORIZED",message:"The metrics schema API request was not authorized. Run `vercel login` to authenticate and `vercel switch` to select a team, then try again."},403:{code:"SCHEMA_UNAUTHORIZED",message:"The metrics schema API request was not authorized. Run `vercel login` to authenticate and `vercel switch` to select a team, then try again."}});let message=err instanceof Error?`Failed to fetch metrics schema: ${err.message}`:`Failed to fetch metrics schema: ${String(err)}`;return jsonOutput?client.stdout.write(formatErrorJson("SCHEMA_FETCH_FAILED",message)):output_manager_default.error(message),1}}function fetchCustomMetricDetailOrExit(client,accountId,jsonOutput,metricId){return fetchSchemaOrExit(client,jsonOutput,()=>fetchCatalogMetricDetail(client,accountId,metricId,"custom"))}function fetchCatalogMetricDetailOrExit(client,accountId,jsonOutput,metricId,kind,activeSince){return fetchSchemaOrExit(client,jsonOutput,()=>fetchCatalogMetricDetail(client,accountId,metricId,kind,activeSince))}function fetchMetricCatalogListOrExit(client,accountId,jsonOutput){return fetchSchemaOrExit(client,jsonOutput,()=>fetchMetricCatalog(client,accountId,"all").then(metrics=>metrics.map(({id,description})=>({id,description}))))}function fetchCombinedMetricListOrExit(client,accountId,jsonOutput){return fetchSchemaOrExit(client,jsonOutput,async()=>{let[platformMetrics,customMetrics]=await Promise.all([fetchMetricList(client,accountId),fetchCustomMetricCatalog(client,accountId).catch(()=>[])]);return[...platformMetrics.filter(metric=>metric.id.startsWith("vercel.")),...customMetrics.map(({id,description})=>({id,description}))].sort((left,right)=>left.id.localeCompare(right.id))})}async function fetchMetricDetailOrExit(client,accountId,metricId,jsonOutput){return fetchSchemaOrExit(client,jsonOutput,()=>fetchMetricDetail(client,accountId,metricId))}export{OBSERVABILITY_METRICS_PATH,getDefaultAggregation,fetchCustomMetricDetailOrExit,fetchCatalogMetricDetailOrExit,fetchMetricCatalogListOrExit,fetchCombinedMetricListOrExit,fetchMetricDetailOrExit};
|
|
@@ -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{formatOption,jsonOption,limitOption,projectOption}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"},TAGS_SORT_BY_CHOICES=["updatedAt","tag"],TAGS_SORT_ORDER_CHOICES=["asc","desc"],tagsLsSubcommand={name:"ls",aliases:["list"],description:"List a repository's tags",arguments:[{name:"repository",required:!0}],options:[projectScopeOption,{name:"sort-by",shorthand:null,type:String,deprecated:!1,description:"Field to sort tags by (default: updatedAt)",argument:"FIELD",choices:TAGS_SORT_BY_CHOICES},{name:"sort-order",shorthand:null,type:String,deprecated:!1,description:"Sort direction (default: desc)",argument:"ORDER",choices:TAGS_SORT_ORDER_CHOICES},limitOption,nextOption,cursorOption,formatOption,jsonOption],examples:[{name:"List a repository's tags",value:`${packageName} vcr tag ls my-app`}]},tagsInspectSubcommand={name:"inspect",aliases:["get"],description:"Show details for a single tag",arguments:[{name:"repository",required:!0},{name:"tag",required:!0}],options:[projectScopeOption,formatOption,jsonOption],examples:[{name:"Inspect a tag by name",value:`${packageName} vcr tag inspect my-app latest`}]},tagsAggregateCommand={name:"tag",aliases:["tags"],description:"List or inspect a repository's tags",arguments:[],subcommands:[tagsLsSubcommand,tagsInspectSubcommand],options:[],examples:[]};export{TAGS_SORT_BY_CHOICES,TAGS_SORT_ORDER_CHOICES,tagsLsSubcommand,tagsInspectSubcommand,tagsAggregateCommand};
|
|
@@ -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{isNativeBinaryInstall}from"./chunk-7T6TL3GQ.js";import{require_lib}from"./chunk-VLZ47RWM.js";import{packageName}from"./chunk-FI772UVH.js";import{require_build_utils}from"./chunk-XFVGX5HG.js";import{__toESM}from"./chunk-6L236MNA.js";var import_fs_extra=__toESM(require_lib(),1),import_build_utils=__toESM(require_build_utils(),1);import{sep,dirname,join,resolve}from"path";import{execFile}from"child_process";import{promisify}from"util";var nativePackageName="@vercel/vc-native",execFileAsync=promisify(execFile),globalRootQueries={npm:{args:["root","-g"],packageDir:(root,pkg)=>join(root,pkg)},pnpm:{args:["root","-g"],packageDir:(root,pkg)=>join(root,pkg)},yarn:{args:["global","dir"],packageDir:(root,pkg)=>join(root,"node_modules",pkg)}};async function getPackageManagerGlobalRoot(cliType){try{let{stdout}=await execFileAsync(cliType,globalRootQueries[cliType].args,{encoding:"utf8",windowsHide:!0});return stdout.trim()||null}catch{return null}}async function detectGlobalCliType(installPath,pkg){for(let cliType of Object.keys(globalRootQueries)){let root=await getPackageManagerGlobalRoot(cliType);if(!root)continue;let resolvedPackageDir;try{resolvedPackageDir=await(0,import_fs_extra.realpath)(globalRootQueries[cliType].packageDir(root,pkg))}catch{continue}if(installPath===resolvedPackageDir||installPath.startsWith(resolvedPackageDir+sep))return cliType}return null}async function getConfigPrefix(){let paths=[process.env.npm_config_userconfig||process.env.NPM_CONFIG_USERCONFIG,join(process.env.HOME||"/",".npmrc"),process.env.npm_config_globalconfig||process.env.NPM_CONFIG_GLOBALCONFIG].filter(Boolean);for(let configPath of paths){if(!configPath)continue;let content=await(0,import_fs_extra.readFile)(configPath).then(buffer=>buffer.toString()).catch(()=>null);if(content){let[prefix]=content.split(`
|
|
8
|
+
`).map(line=>line&&line.trim()).filter(line=>line&&line.startsWith("prefix")).map(line=>line.slice(line.indexOf("=")+1).trim());if(prefix)return prefix}}return null}async function isPnpmHomeInstall(installPath){let pnpmHome=process.env.PNPM_HOME;if(!pnpmHome)return!1;let candidates=[pnpmHome];try{candidates.push(await(0,import_fs_extra.realpath)(pnpmHome))}catch{}let entrypoint=process.argv[1];for(let home of candidates){let prefix=home.endsWith(sep)?home:home+sep;if(entrypoint?.startsWith(prefix)||installPath.startsWith(prefix))return!0}return!1}function isGlobalByPath(installPath){return!!(dirname(process.argv[0])===dirname(process.argv[1])||installPath.includes(["","yarn","global","node_modules",""].join(sep))||installPath.includes(["","pnpm","global",""].join(sep))||installPath.includes(["","pnpm","store",""].join(sep))&&installPath.includes(sep+"links"+sep)||installPath.includes(["","fnm","node-versions",""].join(sep)))}async function isGlobalByPrefix(installPath){let defaultPath=process.platform==="win32"?process.env.APPDATA:"/usr/local/lib",prefixPath=process.env.PREFIX||process.env.npm_config_prefix||process.env.NPM_CONFIG_PREFIX||await getConfigPrefix()||defaultPath;if(!prefixPath)return!0;try{return installPath.startsWith(await(0,import_fs_extra.realpath)(prefixPath))}catch{return!0}}function asPackageManager(cliType){return cliType==="npm"||cliType==="pnpm"||cliType==="yarn"||cliType==="bun"||cliType==="vlt"?cliType:"npm"}async function resolveInstall(){let pkg=isNativeBinaryInstall()?nativePackageName:packageName,installPath=await(0,import_fs_extra.realpath)(resolve(__dirname));if(await isPnpmHomeInstall(installPath))return{packageManager:"pnpm",global:!0,assumed:!1};let globalCliType=await detectGlobalCliType(installPath,pkg);if(globalCliType)return{packageManager:globalCliType,global:!0,assumed:!1};let lockfileCliType;try{let entrypoint=await(0,import_fs_extra.realpath)(process.argv[1]),{cliType,lockfilePath}=await(0,import_build_utils.scanParentDirs)(dirname(dirname(entrypoint)));lockfilePath&&(lockfileCliType=cliType)}catch{}if(!lockfileCliType)return{packageManager:"npm",global:!0,assumed:!0};let packageManager=asPackageManager(lockfileCliType);return{packageManager,global:isGlobalByPath(installPath)||await isGlobalByPrefix(installPath),assumed:packageManager!==lockfileCliType}}async function isGlobal(){try{return(await resolveInstall()).global}catch{return!0}}async function getUpdateCommandInfo(){let nativeInstall=isNativeBinaryInstall(),pkgAndVersion=`${nativeInstall?nativePackageName:packageName}@latest`;if(nativeInstall){let segments=process.execPath.split(sep),packageManager2="npm";segments.includes("pnpm")||segments.includes(".pnpm")?packageManager2="pnpm":(segments.includes("yarn")||segments.includes(".yarn"))&&(packageManager2="yarn");let install2=packageManager2==="yarn"?"global add":"i -g",force=packageManager2==="npm"?" --force":"",allowBuild2=pnpmAllowBuildFlag(packageManager2,nativePackageName);return{command:`${packageManager2} ${install2} ${pkgAndVersion}${force}${allowBuild2}`,global:!0,packageManager:packageManager2,assumed:packageManager2==="npm"}}let{packageManager,global,assumed}=await resolveInstall(),yarn=packageManager==="yarn",install=yarn?"add":"i";global&&(install=yarn?"global add":"i -g");let allowBuild=global?pnpmAllowBuildFlag(packageManager,"esbuild"):"";return{command:`${packageManager} ${install} ${pkgAndVersion}${allowBuild}`,global,packageManager,assumed}}function pnpmAllowBuildFlag(cliType,pkg){return cliType==="pnpm"?` --allow-build=${pkg}`:""}async function getUpdateCommand(){return(await getUpdateCommandInfo()).command}export{isGlobal,getUpdateCommandInfo,getUpdateCommand};
|
|
@@ -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_escape_string_regexp}from"./chunk-XCJDGQO7.js";import{__commonJS}from"./chunk-6L236MNA.js";var require_figures=__commonJS({"../../node_modules/.pnpm/figures@3.2.0/node_modules/figures/index.js"(exports,module){"use strict";var escapeStringRegexp=require_escape_string_regexp(),{platform}=process,main={tick:"\u2714",cross:"\u2716",star:"\u2605",square:"\u2587",squareSmall:"\u25FB",squareSmallFilled:"\u25FC",play:"\u25B6",circle:"\u25EF",circleFilled:"\u25C9",circleDotted:"\u25CC",circleDouble:"\u25CE",circleCircle:"\u24DE",circleCross:"\u24E7",circlePipe:"\u24BE",circleQuestionMark:"?\u20DD",bullet:"\u25CF",dot:"\u2024",line:"\u2500",ellipsis:"\u2026",pointer:"\u276F",pointerSmall:"\u203A",info:"\u2139",warning:"\u26A0",hamburger:"\u2630",smiley:"\u32E1",mustache:"\u0DF4",heart:"\u2665",nodejs:"\u2B22",arrowUp:"\u2191",arrowDown:"\u2193",arrowLeft:"\u2190",arrowRight:"\u2192",radioOn:"\u25C9",radioOff:"\u25EF",checkboxOn:"\u2612",checkboxOff:"\u2610",checkboxCircleOn:"\u24E7",checkboxCircleOff:"\u24BE",questionMarkPrefix:"?\u20DD",oneHalf:"\xBD",oneThird:"\u2153",oneQuarter:"\xBC",oneFifth:"\u2155",oneSixth:"\u2159",oneSeventh:"\u2150",oneEighth:"\u215B",oneNinth:"\u2151",oneTenth:"\u2152",twoThirds:"\u2154",twoFifths:"\u2156",threeQuarters:"\xBE",threeFifths:"\u2157",threeEighths:"\u215C",fourFifths:"\u2158",fiveSixths:"\u215A",fiveEighths:"\u215D",sevenEighths:"\u215E"},windows={tick:"\u221A",cross:"\xD7",star:"*",square:"\u2588",squareSmall:"[ ]",squareSmallFilled:"[\u2588]",play:"\u25BA",circle:"( )",circleFilled:"(*)",circleDotted:"( )",circleDouble:"( )",circleCircle:"(\u25CB)",circleCross:"(\xD7)",circlePipe:"(\u2502)",circleQuestionMark:"(?)",bullet:"*",dot:".",line:"\u2500",ellipsis:"...",pointer:">",pointerSmall:"\xBB",info:"i",warning:"\u203C",hamburger:"\u2261",smiley:"\u263A",mustache:"\u250C\u2500\u2510",heart:main.heart,nodejs:"\u2666",arrowUp:main.arrowUp,arrowDown:main.arrowDown,arrowLeft:main.arrowLeft,arrowRight:main.arrowRight,radioOn:"(*)",radioOff:"( )",checkboxOn:"[\xD7]",checkboxOff:"[ ]",checkboxCircleOn:"(\xD7)",checkboxCircleOff:"( )",questionMarkPrefix:"\uFF1F",oneHalf:"1/2",oneThird:"1/3",oneQuarter:"1/4",oneFifth:"1/5",oneSixth:"1/6",oneSeventh:"1/7",oneEighth:"1/8",oneNinth:"1/9",oneTenth:"1/10",twoThirds:"2/3",twoFifths:"2/5",threeQuarters:"3/4",threeFifths:"3/5",threeEighths:"3/8",fourFifths:"4/5",fiveSixths:"5/6",fiveEighths:"5/8",sevenEighths:"7/8"};platform==="linux"&&(main.questionMarkPrefix="?");var figures=platform==="win32"?windows:main,fn=string=>{if(figures===main)return string;for(let[key,value]of Object.entries(main))value!==figures[key]&&(string=string.replace(new RegExp(escapeStringRegexp(value),"g"),figures[key]));return string};module.exports=Object.assign(fn,figures);module.exports.main=main;module.exports.windows=windows}});export{require_figures};
|
|
@@ -0,0 +1,16 @@
|
|
|
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{getResolvedOrderMetadata,getRollupColumnName}from"./chunk-G5FC5ZCO.js";import{formatGranularity}from"./chunk-IVSSTHB6.js";import{indent_default}from"./chunk-GZNDA6SV.js";import{ellipsizeMiddle}from"./chunk-MBL6TXEJ.js";import{elapsed}from"./chunk-JZRMH5UA.js";import{require_ms}from"./chunk-QTKJC2O5.js";import{table}from"./chunk-6TAQ6OWD.js";import{require_source}from"./chunk-U7KCDTCH.js";import{__toESM}from"./chunk-6L236MNA.js";var import_ms=__toESM(require_ms(),1),MINUTE_MS=60*1e3,HOUR_MS=60*MINUTE_MS,DAY_MS=24*HOUR_MS;function toGranularityDuration(input){let milliseconds=(0,import_ms.default)(input);if(milliseconds===void 0)throw new Error(`Invalid granularity format "${input}". Use 1m, 5m, 15m, 1h, 4h, 1d.`);return milliseconds>=DAY_MS?{days:milliseconds/DAY_MS}:milliseconds>=HOUR_MS?{hours:milliseconds/HOUR_MS}:{minutes:milliseconds/MINUTE_MS}}function toGranularityMs(input){let milliseconds=(0,import_ms.default)(input);if(milliseconds===void 0)throw new Error(`Invalid granularity format "${input}".`);return milliseconds}var GRANULARITY_THRESHOLDS=[[1*HOUR_MS,"1m","1m"],[2*HOUR_MS,"5m","5m"],[12*HOUR_MS,"15m","5m"],[3*DAY_MS,"1h","1h"],[30*DAY_MS,"4h","4h"]],FALLBACK_GRANULARITY="1d";function getAutoGranularity(rangeMs){for(let[maxRange,defaultG]of GRANULARITY_THRESHOLDS)if(rangeMs<=maxRange)return defaultG;return FALLBACK_GRANULARITY}function getMinGranularity(rangeMs){for(let[maxRange,,minG]of GRANULARITY_THRESHOLDS)if(rangeMs<=maxRange)return minG;return FALLBACK_GRANULARITY}function computeGranularity(rangeMs,explicit){if(!explicit){let auto=getAutoGranularity(rangeMs);return{duration:toGranularityDuration(auto),adjusted:!1}}let minG=getMinGranularity(rangeMs),explicitMs=toGranularityMs(explicit),minMs=toGranularityMs(minG);if(explicitMs<minMs){let rangeDays=Math.round(rangeMs/DAY_MS),rangeHours=Math.round(rangeMs/HOUR_MS),rangeLabel=rangeDays>=1?`${rangeDays}-day`:`${rangeHours}-hour`;return{duration:toGranularityDuration(minG),adjusted:!0,notice:`Granularity adjusted from ${explicit} to ${minG} for a ${rangeLabel} time range.`}}return{duration:toGranularityDuration(explicit),adjusted:!1}}function toGranularityMsFromDuration(duration){return"minutes"in duration?duration.minutes*MINUTE_MS:"hours"in duration?duration.hours*HOUR_MS:duration.days*DAY_MS}var CANONICAL_AGGREGATIONS=["count","sum","avg","min","max","p50","p75","p90","p95","p99","stddev"];function isCanonicalAggregation(aggregation){return CANONICAL_AGGREGATIONS.includes(aggregation)}var DURATION_UNITS=new Set(["nanoseconds","microseconds","milliseconds","seconds","minutes","hours","days"]);function normalizeMetricUnit(unit){return unit.trim().toLowerCase().replace(/[_\s]+/g," ")}function getPreferredCustomMetricAggregation(unit){let normalizedUnit=normalizeMetricUnit(unit);return DURATION_UNITS.has(normalizedUnit)?"p75":normalizedUnit==="percent"?"avg":"sum"}function getDefaultCustomMetricAggregation(unit,aggregations){let preferredAggregation=getPreferredCustomMetricAggregation(unit);return aggregations?.includes(preferredAggregation)?preferredAggregation:aggregations?.includes("sum")?"sum":aggregations?.find(isCanonicalAggregation)}var import_chalk=__toESM(require_source(),1);var GROUP_KEY_DELIMITER="",MAX_SPARKLINE_LENGTH=120,DURATION_SCALE_MS={seconds:1e3,minutes:6e4,hours:36e5,days:864e5},BYTE_SCALE={bytes:1,kilobytes:1e3,megabytes:1e6,gigabytes:1e9,terabytes:1e12,petabytes:1e15},COMPACT_NUMBER_FORMATTER=new Intl.NumberFormat("en-US",{notation:"compact",compactDisplay:"short"}),TWO_FRACTION_NUMBER_FORMATTER=new Intl.NumberFormat("en-US",{maximumFractionDigits:2}),TWO_SIGNIFICANT_NUMBER_FORMATTER=new Intl.NumberFormat("en-US",{minimumSignificantDigits:2,maximumSignificantDigits:2,maximumFractionDigits:2}),PERCENTAGE_FORMATTER=new Intl.NumberFormat("en-US",{style:"unit",unit:"percent",unitDisplay:"narrow",maximumFractionDigits:1}),USD_FORMATTER=new Intl.NumberFormat("en-US",{style:"currency",currency:"USD",minimumFractionDigits:2,maximumFractionDigits:2}),BLOCKS=["\u2581","\u2582","\u2583","\u2584","\u2585","\u2586","\u2587","\u2588"],MISSING_CHAR="\xB7";function isAggregationWithDimension(aggregation){let[,dimension]=aggregation.split("/");return!!dimension}function toGroupKey(groupValues){return groupValues.length===0?"":groupValues.join(GROUP_KEY_DELIMITER)}function pad2(n){return String(n).padStart(2,"0")}function pad4(n){return String(n).padStart(4,"0")}function formatHumanMinute(date){return`${pad4(date.getUTCFullYear())}-${pad2(date.getUTCMonth()+1)}-${pad2(date.getUTCDate())} ${pad2(date.getUTCHours())}:${pad2(date.getUTCMinutes())}`}function formatPeriodBound(input){let date=new Date(input);return isNaN(date.getTime())?input:formatHumanMinute(date)}function formatPeriodSpan(startInput,endInput){let start=Date.parse(startInput),durationMs=Date.parse(endInput)-start;return!Number.isFinite(durationMs)||durationMs<=0?null:elapsed(durationMs)}function getStatColumns(aggregation){return aggregation==="sum"||aggregation==="count"?["total","avg","min","max"]:["avg","min","max"]}function toNumericValue(value){if(value==null)return null;if(typeof value=="number")return Number.isFinite(value)?value:null;let parsed=Number(value);return Number.isFinite(parsed)?parsed:null}function isNonNullNumber(value){return value!==null}function isPointWithValue(point){return point.value!==null}function getOrCreate(map,key,make){let existing=map.get(key);if(existing!==void 0)return existing;let created=make();return map.set(key,created),created}function getGroupFieldValue(row,field){let value=row[field];return value==null||value===""?"(not set)":String(value)}function normalizeTimestampToIso(timestamp){let parsed=Date.parse(timestamp);return isNaN(parsed)?null:new Date(parsed).toISOString()}function formatStatCell(column,stats,periodStart,periodEnd,formatValue){switch(column){case"total":return formatValue(stats.total);case"avg":return formatValue(stats.avg,{preserveFractionalCount:!0});case"min":{let ts=formatMinMaxTimestamp(new Date(stats.min.timestamp),periodStart,periodEnd);return`${formatValue(stats.min.value)} at ${ts}`}case"max":{let ts=formatMinMaxTimestamp(new Date(stats.max.timestamp),periodStart,periodEnd);return`${formatValue(stats.max.value)} at ${ts}`}}}function buildExpectedTimestamps(periodStart,periodEnd,granularityMs){let start=Date.parse(periodStart),end=Date.parse(periodEnd);if(isNaN(start)||isNaN(end)||granularityMs<=0||end<=start)return[];let timestamps=[];for(let current=start;current<end;current+=granularityMs)timestamps.push(new Date(current).toISOString());return timestamps}function buildObservedTimestamps(observedTimestamps,granularityMs){let timestamps=[...observedTimestamps].map(timestamp=>Date.parse(timestamp)).filter(Number.isFinite).sort((a,b)=>a-b);if(timestamps.length===0||granularityMs<=0)return[];let start=timestamps[0],end=timestamps[timestamps.length-1]+granularityMs;return buildExpectedTimestamps(new Date(start).toISOString(),new Date(end).toISOString(),granularityMs)}function buildSeriesTimestamps(periodStart,periodEnd,granularityMs,observedTimestamps){let expectedTimestamps=buildExpectedTimestamps(periodStart,periodEnd,granularityMs);return observedTimestamps.size===0||expectedTimestamps.some(timestamp=>observedTimestamps.has(timestamp))?expectedTimestamps:buildObservedTimestamps(observedTimestamps,granularityMs)}function formatCount(n){return Math.round(n).toLocaleString("en-US")}function formatDecimal(n){if(!Number.isFinite(n))return String(n);if(n===0||Object.is(n,-0))return"0";let sign=n<0?"-":"",abs=Math.abs(n);if(abs>=1)return`${sign}${abs.toFixed(1)}`;let exponent=Math.floor(Math.log10(abs)),decimals=Math.min(20,Math.max(2,-exponent+1)),trimmed=abs.toFixed(decimals).replace(/(\.\d*?[1-9])0+$/,"$1").replace(/\.0+$/,"").replace(/\.$/,"");return`${sign}${trimmed}`}function formatDuration(durationMs){let durationSeconds=durationMs/1e3;return durationMs<1e3?`${durationMs.toFixed(0)}ms`:durationMs<5e3?`${Math.round(durationSeconds*100)/100}s`:durationSeconds<60?`${durationSeconds.toFixed(0)}s`:durationSeconds<3600?`${(durationSeconds/60).toFixed(0)}m`:`${(durationSeconds/3600).toFixed(0)}h`}function formatBytes(bytes){if(bytes===0)return"0 Bytes";let units=["Bytes","KB","MB","GB","TB","PB"],absoluteBytes=Math.abs(bytes),unitIndex=Math.min(units.length-1,Math.max(0,Math.floor(Math.log(absoluteBytes)/Math.log(1e3)))),value=bytes/1e3**unitIndex;return(unitIndex===1||unitIndex===2)&&(value=Math.round(value),Math.abs(value)===1e3&&unitIndex<units.length-1&&(value/=1e3,unitIndex+=1)),`${TWO_FRACTION_NUMBER_FORMATTER.format(value)} ${units[unitIndex]}`}function formatMetricValue(value,baseUnit,aggregation,opts){let formatCountValue=()=>opts?.preserveFractionalCount&&!Number.isInteger(value)?formatDecimal(value):formatCount(value);if(isAggregationWithDimension(aggregation)||aggregation==="count")return formatCountValue();let unit=normalizeMetricUnit(baseUnit??"units");if(aggregation==="percent"||unit==="percent")return PERCENTAGE_FORMATTER.format(value);if(aggregation==="unique")return COMPACT_NUMBER_FORMATTER.format(value);let withRateSuffix=formatted2=>aggregation==="persecond"?`${formatted2}/s`:formatted2;if(unit==="milliseconds")return withRateSuffix(formatDuration(value));let durationScale=DURATION_SCALE_MS[unit];if(durationScale)return withRateSuffix(formatDuration(value*durationScale));if(unit==="nanoseconds"||unit==="microseconds"){let suffix=unit==="nanoseconds"?" ns":" \xB5s",formatted2=TWO_FRACTION_NUMBER_FORMATTER.format(value);return withRateSuffix(`${formatted2}${suffix}`)}let byteScale=BYTE_SCALE[unit];if(byteScale)return withRateSuffix(formatBytes(value*byteScale));if(unit==="gigabyte hour"||unit==="gigabyte hours"){let formatted2=TWO_SIGNIFICANT_NUMBER_FORMATTER.format(value);return withRateSuffix(`${formatted2} GB-hrs`)}if(unit==="usd"||unit==="us dollars"||unit==="dollars")return withRateSuffix(USD_FORMATTER.format(value));if(unit==="count"&&aggregation==="sum")return formatCountValue();let formatted=COMPACT_NUMBER_FORMATTER.format(value),unitLabel=baseUnit?.trim();return withRateSuffix(!unitLabel||unit==="units"||unit==="count"||unit==="ratio"?formatted:`${formatted} ${unitLabel}`)}function formatMinMaxTimestamp(date,periodStart,periodEnd){return periodStart.getUTCFullYear()===periodEnd.getUTCFullYear()&&periodStart.getUTCMonth()===periodEnd.getUTCMonth()&&periodStart.getUTCDate()===periodEnd.getUTCDate()?`${pad2(date.getUTCHours())}:${pad2(date.getUTCMinutes())}`:periodStart.getUTCFullYear()===periodEnd.getUTCFullYear()?`${pad2(date.getUTCMonth()+1)}-${pad2(date.getUTCDate())} ${pad2(date.getUTCHours())}:${pad2(date.getUTCMinutes())}`:`${pad4(date.getUTCFullYear())}-${pad2(date.getUTCMonth()+1)}-${pad2(date.getUTCDate())} ${pad2(date.getUTCHours())}:${pad2(date.getUTCMinutes())}`}function extractGroupedSeries(data,groupBy,rollupColumn,periodStart,periodEnd,granularityMs){let groups=[],groupValues=new Map,valueByGroup=new Map,observedTimestamps=new Set;for(let row of data){let values=groupBy.map(field=>getGroupFieldValue(row,field)),key=toGroupKey(values);groupValues.has(key)||(groups.push(key),groupValues.set(key,values));let groupMap=getOrCreate(valueByGroup,key,()=>new Map),rawTimestamp=row.timestamp;if(rawTimestamp.length===0)continue;let timestamp=normalizeTimestampToIso(rawTimestamp);if(!timestamp)continue;observedTimestamps.add(timestamp);let numeric=toNumericValue(row[rollupColumn]);groupMap.set(timestamp,numeric)}let expectedTimestamps=buildSeriesTimestamps(periodStart,periodEnd,granularityMs,observedTimestamps),series=new Map;for(let key of groups){let byTimestamp=valueByGroup.get(key);if(!byTimestamp)continue;let points=expectedTimestamps.map(timestamp=>({timestamp,value:byTimestamp.has(timestamp)?byTimestamp.get(timestamp)??null:null}));series.set(key,points)}return{groups,series,groupValues}}function computeGroupStats(points){let present=points.filter(isPointWithValue);if(present.length===0)return{total:0,avg:0,min:{value:0,timestamp:""},max:{value:0,timestamp:""},count:0,allMissing:!0};let total=0,min=present[0],max=present[0];for(let point of present)total+=point.value,point.value<min.value&&(min=point),point.value>max.value&&(max=point);return{total,avg:total/present.length,min:{value:min.value,timestamp:min.timestamp},max:{value:max.value,timestamp:max.timestamp},count:present.length,allMissing:!1}}var MAX_GROUP_VALUE_LENGTH=60;function downsample(values,maxLen){if(maxLen<=0)return[];if(values.length<=maxLen)return[...values];let result=[];for(let i=0;i<maxLen;i++){let start=Math.floor(i*values.length/maxLen),end=Math.floor((i+1)*values.length/maxLen),bucket=values.slice(start,Math.max(start+1,end)),nullCount=bucket.filter(value=>value===null).length;if(nullCount===bucket.length||nullCount>bucket.length/2){result.push(null);continue}let present=bucket.filter(isNonNullNumber),avg=present.reduce((sum,value)=>sum+value,0)/present.length;result.push(avg)}return result}function generateSparkline(values){let sampled=downsample(values,MAX_SPARKLINE_LENGTH);if(sampled.length===0)return"";let present=sampled.filter(isNonNullNumber);if(present.length===0)return sampled.map(()=>MISSING_CHAR).join("");let min=Math.min(...present),max=Math.max(...present);if(min===max){let block=min===0?BLOCKS[0]:BLOCKS[BLOCKS.length-1];return sampled.map(value=>value===null?MISSING_CHAR:block).join("")}let range=max-min;return sampled.map(value=>{if(value===null)return MISSING_CHAR;let ratio=(value-min)/range,index=Math.max(0,Math.min(BLOCKS.length-1,Math.round(ratio*(BLOCKS.length-1))));return BLOCKS[index]}).join("")}function formatMetadataHeader(opts){let periodSpan=opts.compact?formatPeriodSpan(opts.periodStart,opts.periodEnd):null,rows=[];return opts.compact||rows.push({key:"Metric",value:`${opts.metric} ${opts.aggregation}`}),rows.push({key:"Period",value:`${formatPeriodBound(opts.periodStart)} to ${formatPeriodBound(opts.periodEnd)} (UTC)${periodSpan?` ${periodSpan}`:""}`},{key:"Interval",value:"days"in opts.granularity?`${formatGranularity(opts.granularity)} (${opts.bucketTimezone??"UTC"})`:formatGranularity(opts.granularity)}),typeof opts.periodUnique=="number"&&rows.push({key:"Unique (period)",value:formatCount(opts.periodUnique)}),!opts.compact&&opts.filter&&rows.push({key:"Filter",value:opts.filter}),!opts.compact&&opts.orderBy&&opts.orderDirection&&rows.push({key:"Order By",value:`${opts.orderBy} ${opts.orderDirection}${opts.orderBy==="count"?" (default)":""}`}),opts.scope.type==="project"?rows.push({key:"Project",value:`${opts.projectName??opts.scope.projectIds[0]} (${opts.teamName??opts.scope.ownerId})`}):rows.push({key:"Team",value:`${opts.teamName??opts.scope.ownerId} (all projects)`}),!opts.compact&&typeof opts.groupCount=="number"&&rows.push({key:"Groups",value:String(opts.groupCount)}),rows.map(row=>`> ${import_chalk.default.gray(`${row.key}:`)} ${row.value}`).join(`
|
|
8
|
+
`)}function formatSummaryTable(opts){let statColumns=getStatColumns(opts.aggregation),header=[...opts.groupByFields,...statColumns],rows=[header.map(name=>import_chalk.default.bold(import_chalk.default.cyan(name)))];for(let row of opts.rows){let nextRow=row.groupValues.map(v=>ellipsizeMiddle(v,MAX_GROUP_VALUE_LENGTH,opts.ansiAwareGroupValues));if(row.stats.allMissing){nextRow.push(...statColumns.map(()=>"--")),rows.push(nextRow);continue}nextRow.push(...statColumns.map(column=>formatStatCell(column,row.stats,opts.periodStart,opts.periodEnd,opts.formatValue))),rows.push(nextRow)}let centeredColumns=new Set(["min","max"]),align=header.map(col=>centeredColumns.has(col)?"c":"r");return indent_default(table(rows,{align,hsep:2}),2)}function formatSparklineSection(groupRows,sparklines,groupByFields,compact=!1){if(groupRows.length===0){let sparkline=sparklines[0],chart2=sparkline?indent_default(sparkline,2):"";return compact?chart2:["sparklines:",chart2].filter(Boolean).join(`
|
|
9
|
+
`)}let rows=[[...groupByFields,compact?"":"sparkline"].map(name=>import_chalk.default.bold(import_chalk.default.cyan(name))),...groupRows.map((groupValues,index)=>[...groupValues.map(v=>ellipsizeMiddle(v,MAX_GROUP_VALUE_LENGTH,compact)),sparklines[index]??""])],align=groupByFields.map(()=>"r");align.push("l");let chart=indent_default(table(rows,{align,hsep:2}),2);return compact?chart:`sparklines:
|
|
10
|
+
${chart}`}function formatText(response,opts){let rollupColumn=getRollupColumnName(opts.metric,opts.aggregation),formatValue=(value,formatOptions)=>formatMetricValue(value,opts.metricUnit,opts.aggregation,formatOptions),granularityMs=toGranularityMsFromDuration(opts.granularity),orderMetadata=getResolvedOrderMetadata(opts,response),{groups,series,groupValues}=extractGroupedSeries(response.data??[],opts.groupBy,rollupColumn,opts.periodStart,opts.periodEnd,granularityMs),periodUnique;if(isAggregationWithDimension(opts.aggregation)&&opts.groupBy.length===0){let summaryValue=toNumericValue(response.summary?.[0]?.[rollupColumn]);summaryValue!==null&&(periodUnique=summaryValue)}let metadata=formatMetadataHeader({metric:opts.metric,aggregation:opts.aggregation,periodStart:opts.periodStart,periodEnd:opts.periodEnd,granularity:opts.granularity,periodUnique,bucketTimezone:opts.bucketTimezone,filter:opts.filter,...opts.groupBy.length>0?orderMetadata:{},scope:opts.scope,projectName:opts.projectName,teamName:opts.teamName,groupCount:opts.groupBy.length>0?groups.length:void 0,compact:opts.presentation?.compact});if(groups.length===0)return`${metadata}
|
|
11
|
+
|
|
12
|
+
No data found for this period.
|
|
13
|
+
`;let summaryRows=[],groupRows=[],sparklineRows=[];for(let key of groups){let points=series.get(key)??[],values=points.map(point=>point.value),displayGroupValues=(groupValues.get(key)??[]).map((value,index)=>{let field=opts.groupBy[index];return opts.presentation?.formatGroupValue?.(field,value)??value});summaryRows.push({groupValues:displayGroupValues,stats:computeGroupStats(points)}),groupRows.push(displayGroupValues),sparklineRows.push(generateSparkline(values))}let summaryTable=formatSummaryTable({rows:summaryRows,groupByFields:opts.groupBy,aggregation:opts.aggregation,periodStart:new Date(opts.periodStart),periodEnd:new Date(opts.periodEnd),formatValue,ansiAwareGroupValues:opts.presentation?.compact}),groupedOutput=opts.groupBy.length>0,sparklineSection=formatSparklineSection(groupedOutput?groupRows:[],sparklineRows,opts.groupBy,opts.presentation?.compact);return`${[metadata,summaryTable,sparklineSection].join(`
|
|
14
|
+
|
|
15
|
+
`)}
|
|
16
|
+
`}export{computeGranularity,toGranularityMsFromDuration,isCanonicalAggregation,getDefaultCustomMetricAggregation,generateSparkline,formatText};
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { createRequire as __createRequire } from 'node:module';
|
|
2
|
+
import { fileURLToPath as __fileURLToPath } from 'node:url';
|
|
3
|
+
import { dirname as __dirname_ } from 'node:path';
|
|
4
|
+
const require = __createRequire(import.meta.url);
|
|
5
|
+
const __filename = __fileURLToPath(import.meta.url);
|
|
6
|
+
const __dirname = __dirname_(__filename);
|
|
7
|
+
import{resolveProjectContext}from"./chunk-ENS6KX2F.js";import{performDeviceCodeFlow}from"./chunk-L243RUIR.js";import{require_frameworks}from"./chunk-KK4AJES5.js";import{require_json_parse_better_errors}from"./chunk-N6CNMMSZ.js";import{ensureLink,parseEnv}from"./chunk-HZZ5L472.js";import{pullSubcommand}from"./chunk-K3KJZLBD.js";import{param}from"./chunk-SXUEGVWB.js";import{STANDARD_ENVIRONMENTS,formatProject}from"./chunk-YV6CTDHR.js";import{parseTarget}from"./chunk-GRNTLNC7.js";import{getDeployment}from"./chunk-G7Y77DFH.js";import{buildCommandWithYes,getPreservedArgsForEnvPull,outputActionRequired,outputAgentError}from"./chunk-NS4FH2TY.js";import{TelemetryClient}from"./chunk-57GHYR4Y.js";import{parseArguments}from"./chunk-HTC6KO2B.js";import{printError}from"./chunk-LNPMDXBJ.js";import{addToGitIgnore,require_lib}from"./chunk-VLZ47RWM.js";import{getFlagsSpecification}from"./chunk-JAJW3P42.js";import{printAlignedLabel}from"./chunk-XSVBYDYI.js";import{isAPIError}from"./chunk-R2TGGVCT.js";import{getCommandName,getCommandNamePlain}from"./chunk-FI772UVH.js";import{output_manager_default}from"./chunk-Z6Y55QJW.js";import{require_dist}from"./chunk-QGIQK47P.js";import{require_source}from"./chunk-U7KCDTCH.js";import{__toESM}from"./chunk-6L236MNA.js";var import_chalk2=__toESM(require_source(),1),import_fs_extra2=__toESM(require_lib(),1);import{closeSync,openSync,readSync}from"fs";import{resolve}from"path";import{URLSearchParams}from"url";var RECOVERABLE_CHALLENGE_CODES=new Set(["challenge_required","challenge_required_email_otp","user_auth_required"]);async function withEnvChallengeRecovery(client,fn){let hadStoredSession=!!(client.authConfig.token||client.authConfig.refreshToken);try{return await fn()}catch(error){if(!isAPIError(error))throw error;let isRecoverableChallenge=RECOVERABLE_CHALLENGE_CODES.has(error.code),isRejectedStoredSession=hadStoredSession&&error.invalidToken===!0;if(!isRecoverableChallenge&&!isRejectedStoredSession||client.authConfig.tokenSource||!client.stdin.isTTY||client.nonInteractive)throw error;output_manager_default.stopSpinner(),output_manager_default.log("Sensitive Environment Variables require fresh authentication.");let refreshToken=client.authConfig.refreshToken,acrValues=getAcrValuesFromWWWAuthenticate(error.wwwAuthenticate),tokens=isRecoverableChallenge&&refreshToken&&acrValues?await performDeviceCodeFlow(client,{refreshToken,acrValues,fallbackToLoginOnStepUpFailure:!0}):await performDeviceCodeFlow(client);if(!tokens)throw error;return client.updateAuthConfig({token:tokens.access_token,userId:void 0,expiresAt:Math.floor(Date.now()/1e3)+tokens.expires_in,refreshToken:tokens.refresh_token}),client.persistAuthConfig(),await fn()}}function getAcrValuesFromWWWAuthenticate(header){if(!header)return;let bearerIndex=header.toLowerCase().indexOf("bearer");if(bearerIndex===-1)return;let match=header.slice(bearerIndex+6).match(/(?:^|[,\s])acr_values=(?:"((?:\\.|[^"\\])*)"|([^,\s]+))/i);return match?.[1]?.replace(/\\(.)/g,"$1")??match?.[2]}async function getEnvRecords(client,projectId,source,{target,gitBranch,decrypt}={}){output_manager_default.debug(`Fetching Environment Variables of project ${projectId} and target ${target}`);let query=new URLSearchParams;if(target){let targetParam="target";target!=="production"&&target!=="preview"&&target!=="development"&&(targetParam="customEnvironmentId"),query.set(targetParam,target)}gitBranch&&query.set("gitBranch",gitBranch),decrypt&&query.set("decrypt",decrypt.toString()),source&&query.set("source",source);let url=`/v10/projects/${projectId}/env?${query}`;return withEnvChallengeRecovery(client,()=>client.fetch(url))}async function pullEnvRecords(client,projectIdOrDeploymentId,source,{target,gitBranch}={}){output_manager_default.debug(`Fetching Environment Variables of ${projectIdOrDeploymentId} and target ${target}`);let query=new URLSearchParams,url=`/v3/env/pull/${projectIdOrDeploymentId}`;return projectIdOrDeploymentId.startsWith("dpl_")||target&&(url+=`/${encodeURIComponent(target)}`,gitBranch&&(url+=`/${encodeURIComponent(gitBranch)}`)),source&&query.set("source",source),Array.from(query).length>0&&(url+=`?${query}`),withEnvChallengeRecovery(client,()=>client.fetch(url))}var import_fs_extra=__toESM(require_lib(),1);var import_chalk=__toESM(require_source(),1);async function createEnvObject(envPath){let envArr=(await(0,import_fs_extra.readFile)(envPath,"utf-8")).replace(/"/g,"").split(/\r?\n|\r/).filter(line=>/^[^#]/.test(line)).filter(line=>/=/i.test(line)),parsedEnv=parseEnv(envArr);if(Object.keys(parsedEnv).length===0){output_manager_default.debug("Failed to parse env file.");return}return parsedEnv}function findChanges(oldEnv,newEnv){let added=[],changed=[];for(let key of Object.keys(newEnv))oldEnv[key]===void 0?added.push(key):oldEnv[key]!==newEnv[key]&&changed.push(key),delete oldEnv[key];let removed=Object.keys(oldEnv);return{added,changed,removed}}function buildDeltaString(oldEnv,newEnv){let{added,changed,removed}=findChanges(oldEnv,newEnv),deltaString="";return deltaString+=import_chalk.default.green(addDeltaSection("+",changed,!0)),deltaString+=import_chalk.default.green(addDeltaSection("+",added)),deltaString+=import_chalk.default.red(addDeltaSection("-",removed)),deltaString&&import_chalk.default.gray(` Changes:
|
|
8
|
+
`)+deltaString+`
|
|
9
|
+
`}function addDeltaSection(prefix,arr,changed=!1){return arr.length===0?"":arr.sort().map(item=>` ${prefix} ${item}${changed?" (Updated)":""}`).join(`
|
|
10
|
+
`)+`
|
|
11
|
+
`}var VERCEL_OIDC_TOKEN="VERCEL_OIDC_TOKEN",SENSITIVE_ENV_VALUE_PLACEHOLDER="[SENSITIVE]";var import_frameworks=__toESM(require_frameworks(),1);import{readFile as readFile2}from"node:fs/promises";import{join}from"node:path";var SERVER_ONLY_KEY_PATTERNS=["access_token","refresh_token","client_secret","webhook_secret","api_key","private_key","service_account","service_role","database_url","database_uri","db_url","postgres_url","postgres_uri","mysql_url","mongo_url","mongo_uri","redis_url","redis_uri","amqp_url","kafka_url","elasticsearch_url","password","passwd","pwd","secret","private","key","apikey","auth","token","jwt","signature","cert","pem","salt","bearer","credential","credentials","creds"],SAFE_KEY_HINT_TOKENS=["public","publishable","anon"],WELL_KNOWN_SECRET_NAMES=new Set(["DATABASE_URL","DATABASE_URL_UNPOOLED","POSTGRES_URL","POSTGRES_URL_NON_POOLING","POSTGRES_URL_NO_SSL","POSTGRES_URL_UNPOOLED","POSTGRES_PRISMA_URL","MONGODB_URI","MONGODB_URL","MONGO_URI","MONGO_URL","MYSQL_URL","MYSQL_URI","REDIS_URL","REDIS_TLS_URL","KV_URL","KV_REST_API_URL","UPSTASH_REDIS_REST_URL","GOOGLE_APPLICATION_CREDENTIALS","AWS_ACCESS_KEY_ID"]),SECRET_SEGMENT_PATTERN=/(?:^|[_-])(SECRET|PASSWORD|PASSWD|PASSPHRASE|PWD|PGPASSWORD|TOKEN|CREDENTIAL|JWT|DSN|APIKEY|PRIVATEKEY|SALT|PEPPER|MNEMONIC|PEM|CIPHER)S?(?:[_-]|$)/i,EXPLICIT_SECRET_TOKEN_PATTERN=/(?:^|[_-])(SECRET|PASSWORD|PASSWD|PASSPHRASE|PWD|PGPASSWORD|TOKEN|CREDENTIAL|MNEMONIC|PRIVATEKEY|APIKEY)S?(?:[_-]|$)/i,SECRET_COMPOUND_PATTERNS=[/(?:^|[_-])(?:API|PRIVATE|SIGNING|ENCRYPTION|SESSION|COOKIE|CSRF|HMAC|ACCESS|APP|WRITE)[_-]?(?:KEY|SECRET)S?(?:[_-]|$)/i,/(?:^|[_-])(?:ACCESS|REFRESH|BEARER|AUTH)[_-]?TOKENS?(?:[_-]|$)/i,/(?:^|[_-])(?:WEBHOOK|SIGNING)[_-]?SECRETS?(?:[_-]|$)/i,/(?:^|[_-])SERVICE[_-]?(?:ROLE(?:[_-]?KEYS?)?|ACCOUNTS?)(?:[_-]|$)/i],NON_CREDENTIAL_KEY_TOKENS=new Set(["PUBLIC","PUBLISHABLE","ANON","PRIMARY","PARTITION","FOREIGN","SORT","HASH","COMPOSITE","INDEX","UNIQUE","NATURAL","SURROGATE","CACHE","IDEMPOTENCY","LOOKUP","ROW","SHARD","CLUSTER","LICENSE","LICENCE","PRODUCT","TRANSLATION","TRANSLATIONS","I18N","LOCALE","RBAC","ACL","ROLE","ROLES","PERMISSION","PERMISSIONS","SCOPE","SCOPES","POLICY","POLICIES"]),GENERIC_KEY_SUFFIX_PATTERN=/(?:^|[_-])([A-Z0-9]+)[_-]KEYS?$/i,GENERIC_KEY_PREFIX_PATTERN=/^KEYS?[_-]([A-Z0-9]+)(?:[_-]|$)/i,DB_URL_PATTERN=/(?:^|_)(?:DATABASE|POSTGRES|MONGO|MONGODB|MYSQL|REDIS|NEON|PLANETSCALE|TURSO|RDS)(?:_[A-Z0-9_]*)?_(?:URL|URI)(?:_[A-Z0-9_]+)?$/i,SECRET_VALUE_PATTERNS=[/gh[opsru]_[A-Za-z0-9_]{20,}/,/github_pat_[A-Za-z0-9_]{20,}/,/glpat-[A-Za-z0-9_-]{20,}/,/(?:sk|rk)_(?:live|test)_[A-Za-z0-9]{20,}/,/whsec_[A-Za-z0-9]{20,}/,/xox[abprs]-[A-Za-z0-9-]{20,}/,/xapp-[A-Za-z0-9-]{20,}/,/\b(?:AKIA|ASIA)[A-Z0-9]{16}\b/,/\bAIza[A-Za-z0-9_-]{30,}/,/sk-ant-[A-Za-z0-9_-]{20,}/,/sk-(?:proj|svcacct|admin)-[A-Za-z0-9_-]{20,}/,/\bsk-[A-Za-z0-9]{32,}\b/,/shp(?:at|ss|ca)_[a-fA-F0-9]{32}/,/npm_[A-Za-z0-9]{30,}/,/\bhf_[A-Za-z0-9_]{30,}/,/nvapi-[A-Za-z0-9_-]{40,}/,/SG\.[A-Za-z0-9_-]{22}\.[A-Za-z0-9_-]{43}/,/key-[a-f0-9]{32}/,/glsa_[A-Za-z0-9_]{32}_[a-f0-9]{8}/,/pscale_pw_[A-Za-z0-9_-]{20,}/,/\bre_[A-Za-z0-9_]{30,}/,/dop_v1_[a-f0-9]{64}/,/sntrys_[A-Za-z0-9_-]{30,}/,/FlyV1 [A-Za-z0-9_-]{20,}/,/AccountKey=[A-Za-z0-9+/]{40,}=*/,/-----BEGIN [A-Z0-9 ]*PRIVATE KEY[A-Z0-9 ]*-----/,/-----BEGIN PGP MESSAGE-----/,/\beyJ[A-Za-z0-9_-]{10,}\.eyJ[A-Za-z0-9_-]{10,}\.[A-Za-z0-9_-]{8,}\b/,/[a-zA-Z][a-zA-Z0-9+.-]*:\/\/[A-Za-z0-9_.%-]*:[^@\s/]+(?<!\.\.)@/,/\bBearer\s+[A-Za-z0-9_+=/.-]{20,}/i,/(?:password|passwd|pwd|secret|token|api[_-]?key|access[_-]?token|refresh[_-]?token|private[_-]?key|auth)\s*[=:]\s*["']?[A-Za-z0-9_+=/.-]{12,}/i];function tokenize(key){return new Set(key.split(/(?<=[a-z])(?=[A-Z])/).flatMap(part=>part.split(/[_\-.]+/)).map(token=>token.toLowerCase()).filter(Boolean))}function hasSafeKeyHint(key){let tokens=tokenize(key);return SAFE_KEY_HINT_TOKENS.some(token=>tokens.has(token))}function hasGenericKeySuffix(key){let precedingToken=GENERIC_KEY_SUFFIX_PATTERN.exec(key)?.[1]?.toUpperCase();return!!(precedingToken&&!NON_CREDENTIAL_KEY_TOKENS.has(precedingToken))}function hasGenericKeyPrefix(key){let followingToken=GENERIC_KEY_PREFIX_PATTERN.exec(key)?.[1]?.toUpperCase();return!!(followingToken&&!NON_CREDENTIAL_KEY_TOKENS.has(followingToken))}function getMatchingServerOnlyKey(key){let normalized=key.replace(/(?<=[a-z])(?=[A-Z])/g,"_").toLowerCase().replace(/[-.]+/g,"_");for(let pattern of SERVER_ONLY_KEY_PATTERNS)if(pattern.includes("_")&&normalized.includes(pattern))return pattern;let tokens=tokenize(key);return SERVER_ONLY_KEY_PATTERNS.find(pattern=>!pattern.includes("_")&&tokens.has(pattern))??null}function looksLikeSecret(key){return!key||hasSafeKeyHint(key)?!1:WELL_KNOWN_SECRET_NAMES.has(key.toUpperCase())||SECRET_SEGMENT_PATTERN.test(key)||SECRET_COMPOUND_PATTERNS.some(pattern=>pattern.test(key))||DB_URL_PATTERN.test(key)?!0:hasGenericKeySuffix(key)||hasGenericKeyPrefix(key)}function looksLikeSecretValue(value){let trimmed=value.trim();return!!(trimmed&&SECRET_VALUE_PATTERNS.some(pattern=>pattern.test(trimmed)))}function shouldConfirmRotationBeforeDelete(env){return env.type==="system"?!1:EXPLICIT_SECRET_TOKEN_PATTERN.test(env.key)?!0:env.hasPublicPrefix||hasSafeKeyHint(env.key)?!1:looksLikeSecret(env.key)}function isFlagsSecretNeedingSplit(env){return env.key!=="FLAGS_SECRET"||env.type!=="plain"&&env.type!=="encrypted"?!1:env.targets.length+(env.customEnvironmentIds?.length??0)>1}function getEnvValueWarnings(value){let warnings=[],normalized=value.replace(/\n$/,"");return/^[ \t]+/.test(normalized)&&warnings.push({message:"starts with whitespace",requiresConfirmation:!1}),/[ \t]+$/.test(normalized)&&warnings.push({message:"ends with whitespace",requiresConfirmation:!1}),(normalized.includes("\r")||normalized.includes(`
|
|
12
|
+
`))&&warnings.push({message:"contains newlines",requiresConfirmation:!1}),value.includes("\0")&&warnings.push({message:"contains null characters",requiresConfirmation:!1}),value===""&&warnings.push({message:"is empty",requiresConfirmation:!0}),value.length>2&&(value.startsWith('"')&&value.endsWith('"')||value.startsWith("'")&&value.endsWith("'"))&&warnings.push({message:"includes surrounding quotes (these will be stored literally)",requiresConfirmation:!1}),warnings}function formatWarnings(warnings){if(warnings.length===0)return null;let messages=warnings.map(w=>w.message),startsIdx=messages.indexOf("starts with whitespace"),endsIdx=messages.indexOf("ends with whitespace");if(startsIdx!==-1&&endsIdx!==-1&&(messages.splice(Math.max(startsIdx,endsIdx),1),messages[Math.min(startsIdx,endsIdx)]="starts and ends with whitespace"),messages.length===1)return`Value ${messages[0]}`;if(messages.length===2)return`Value ${messages[0]} and ${messages[1]}`;let last=messages.pop();return`Value ${messages.join(", ")}, and ${last}`}var API_PUBLIC_PREFIXES=["NEXT_PUBLIC_","VUE_APP_","REACT_APP_","GATSBY_","GRIDSOME_","NUXT_PUBLIC_","STORYBOOK_","VITE_","PUBLIC_","EXPO_PUBLIC_","NG_APP_","REDWOOD_ENV_"],PUBLIC_PREFIXES=[...new Set([...API_PUBLIC_PREFIXES,...import_frameworks.frameworkList.map(f=>f.envPrefix).filter(prefix=>!!prefix)])];function hasOnlyWhitespaceWarnings(warnings){return warnings.length>0&&warnings.every(w=>w.message==="starts with whitespace"||w.message==="ends with whitespace")}function trimValue(value){return value.replace(/\n$/,"").trim()}function normalizeStdinEnvValue(value){let valueWithoutTrailingNewline=value;if(value.endsWith(`\r
|
|
13
|
+
`))valueWithoutTrailingNewline=value.slice(0,-2);else if(value.endsWith(`
|
|
14
|
+
`))valueWithoutTrailingNewline=value.slice(0,-1);else return{value,strippedTrailingNewline:!1};return valueWithoutTrailingNewline.includes(`
|
|
15
|
+
`)||valueWithoutTrailingNewline.includes("\r")?{value,strippedTrailingNewline:!1}:{value:valueWithoutTrailingNewline,strippedTrailingNewline:!0}}function getPublicPrefix(key){let upperKey=key.toUpperCase();return PUBLIC_PREFIXES.find(p=>upperKey.startsWith(p))||null}function getFrameworkPublicPrefix(frameworkSlug,key){let prefix=import_frameworks.frameworkList.find(framework=>framework.slug===frameworkSlug)?.envPrefix;return prefix&&key.toUpperCase().startsWith(prefix.toUpperCase())?prefix:null}function getApiPublicPrefix(key){let upperKey=key.toUpperCase();return API_PUBLIC_PREFIXES.find(prefix=>upperKey.startsWith(prefix))??null}function parseSvelteKitPublicEnvVarPrefix(config){if(!config.includes("publicPrefix"))return{status:"ready",prefix:null};let match=/publicPrefix:\s*(?:'(?<single>[^']*)'|"(?<double>[^"]*)"|`(?<template>[^`$]*)`)/.exec(config),prefix=match?.groups?.single??match?.groups?.double??match?.groups?.template;return prefix===void 0?{status:"unavailable"}:{status:"ready",prefix}}async function getLocalSvelteKitPublicPrefixes(cwd,rootDirectory){let projectRoot=rootDirectory?join(cwd,rootDirectory):cwd,config;try{config=await readFile2(join(projectRoot,"svelte.config.js"),"utf8")}catch{return}let parsed=parseSvelteKitPublicEnvVarPrefix(config);if(parsed.status!=="unavailable")return[parsed.prefix??"PUBLIC_","VITE_"]}function removePublicPrefix(key){let prefix=getPublicPrefix(key);return prefix?key.slice(prefix.length):key}async function validateEnvValue(opts){let finalValue=opts.initialValue,alreadyConfirmed=!1;if(opts.skipConfirm){let valueWarnings=getEnvValueWarnings(finalValue),warningMessage=formatWarnings(valueWarnings);warningMessage&&opts.showWarning(warningMessage)}else{let valueAccepted=!1;for(;!valueAccepted;){let valueWarnings=getEnvValueWarnings(finalValue),warningMessage=formatWarnings(valueWarnings);if(!warningMessage){valueAccepted=!0;break}opts.showWarning(warningMessage);let choices=hasOnlyWhitespaceWarnings(valueWarnings)?[{name:"Leave as is",value:"c"},{name:"Re-enter",value:"r"},{name:"Trim whitespace",value:"t"}]:[{name:"Leave as is",value:"c"},{name:"Re-enter",value:"r"}],action=await opts.selectAction(choices);action==="c"?(valueAccepted=!0,valueWarnings.some(w=>w.requiresConfirmation)&&(alreadyConfirmed=!0)):action==="t"?(finalValue=trimValue(finalValue),opts.showLog("Trimmed whitespace")):finalValue=await opts.promptForValue()}}return{finalValue,alreadyConfirmed}}function getEnvKeyWarnings(key){let warnings=[],matchingPrefix=getPublicPrefix(key);if(matchingPrefix){let nameWithoutPrefix=key.slice(matchingPrefix.length);looksLikeSecret(nameWithoutPrefix)&&getMatchingServerOnlyKey(nameWithoutPrefix)?warnings.push({message:`\`${matchingPrefix}\` exposes \`${key}\` to anyone visiting your site`,requiresConfirmation:!0}):warnings.push({message:`\`${matchingPrefix}\` exposes this value to anyone visiting your site`,requiresConfirmation:!1})}return warnings}var ENV_VISIBILITY_DEPRECATION_MESSAGE="`--visibility` is deprecated. Use `--type` instead.";function invalidTypeOptionError(optionName,value){if(!(value==="config"||value==="secret"))return value==="sensitive"?`The \`${optionName}\` flag accepts \`config\` or \`secret\`. Use \`--type secret\` or the legacy \`--sensitive\` flag.`:value==="plain"||value==="encrypted"?`The \`${optionName}\` flag accepts \`config\` or \`secret\`. Use \`--type config\` for readable values.`:`The \`${optionName}\` flag must be either \`config\` or \`secret\`.`}function resolveEnvVarTypeOption(options){let usedDeprecatedVisibility=options.visibility!==void 0;if(options.type!==void 0){let error=invalidTypeOptionError("--type",options.type);if(error)return{usedDeprecatedVisibility,error,errorReason:"invalid_type"}}if(options.visibility!==void 0){let error=invalidTypeOptionError("--visibility",options.visibility);if(error)return{usedDeprecatedVisibility,error,errorReason:"invalid_visibility"}}return options.type!==void 0&&options.visibility!==void 0&&options.type!==options.visibility?{usedDeprecatedVisibility,error:`\`--type ${options.type}\` conflicts with \`--visibility ${options.visibility}\`. \`--visibility\` is a deprecated alias of \`--type\`; remove it.`,errorReason:"conflicting_type_visibility"}:options.type!==void 0?{explicitVisibility:options.type,source:"type",usedDeprecatedVisibility}:options.visibility!==void 0?{explicitVisibility:options.visibility,source:"visibility",usedDeprecatedVisibility}:{usedDeprecatedVisibility}}function isSecretEnvVar(env){return env.type==="sensitive"||env.visibility==="secret"}function formatVisibilityLabel(visibility,type){let resolved=visibility??visibilityFromEnvType(type);if(resolved==="config")return"Config";if(resolved==="secret")return"Secret"}function visibilityFromEnvType(type){if(type==="sensitive")return"secret";if(type==="plain"||type==="encrypted")return"config"}function hasNonDevelopmentTarget(envTargets){return envTargets.some(target=>target!=="development")}function getPublicPrefixSecretVisibilityError(key,options){let publicPrefix=getApiPublicPrefix(key);if(!publicPrefix||!(options.visibility==="secret"||options.type==="sensitive"))return null;let privateKey=key.slice(publicPrefix.length);return options.context==="update"?`\`${publicPrefix}\` exposes this value to anyone visiting your site, so \`${key}\` cannot be a Secret. To keep it private, add \`${privateKey}\` as a Secret, then remove \`${key}\`. If the value is safe to expose, keep it as Config.`:`\`${publicPrefix}\` exposes this value to anyone visiting your site, so \`${key}\` cannot be a Secret. To keep it private, rename the variable to \`${privateKey}\` and keep the Secret type. If the value is safe to expose, use \`--type config\`.`}function shouldOmitInferredVisibility(key,envTargets,teamSensitivePolicyOn){return!getApiPublicPrefix(key)||!hasNonDevelopmentTarget(envTargets)?!1:teamSensitivePolicyOn}function resolveEnvVarVisibility(options){if(options.explicitVisibility!==void 0){if(options.explicitVisibility!=="config"&&options.explicitVisibility!=="secret"){let optionName=options.explicitOptionSource==="visibility"?"--visibility":"--type";return{error:options.explicitVisibility==="sensitive"?`The \`${optionName}\` flag accepts \`config\` or \`secret\`. Use \`--type secret\` or the legacy \`--sensitive\` flag.`:options.explicitVisibility==="plain"||options.explicitVisibility==="encrypted"?`The \`${optionName}\` flag accepts \`config\` or \`secret\`. Use \`--type config\` for readable values.`:`The \`${optionName}\` flag must be either \`config\` or \`secret\`.`}}let publicPrefixError2=getPublicPrefixSecretVisibilityError(options.key,{visibility:options.explicitVisibility,type:options.type,context:options.context});return publicPrefixError2?{error:publicPrefixError2}:{visibility:options.explicitVisibility}}let inferred=visibilityFromEnvType(options.type);if(inferred===void 0)return{};if(shouldOmitInferredVisibility(options.key,options.envTargets,options.teamSensitivePolicyOn))return{};let publicPrefixError=getPublicPrefixSecretVisibilityError(options.key,{visibility:inferred,type:options.type,context:options.context});return publicPrefixError?{error:publicPrefixError}:{visibility:inferred}}function getUnavailableSecretValuesMessage(environment,count){let values=count===1?"value":"values";return environment==="development"?`${count} Development Secret ${values} ${count===1?"was":"were"} not returned by Vercel.`:`${count} Secret ${values} cannot be pulled from the \`${environment}\` Environment.`}function getLocalSecretFallbackMessage(count){return` Define ${count===1?"it":"them"} in a local .env file.`}var CONTENTS_HEADER="# Created by Vercel CLI";function updateOidcTokenContents(existing,token){let assignment=`${VERCEL_OIDC_TOKEN}="${escapeValue(token)}"`,oidcAssignment=new RegExp(`^(\\uFEFF?)[\\t ]*(?:export[\\t ]+)?${VERCEL_OIDC_TOKEN}[\\t ]*=[^\\r\\n]*(\\r\\n|\\n|\\r|$)`,"gm"),tokenWritten=!1,withoutDuplicates=existing.replace(oidcAssignment,(_match,byteOrderMark,lineEnding2)=>token!==void 0&&!tokenWritten?(tokenWritten=!0,`${byteOrderMark}${assignment}${lineEnding2}`):byteOrderMark);if(token===void 0||tokenWritten)return withoutDuplicates;let lineEnding=withoutDuplicates.match(/\r\n|\n|\r/)?.[0]??`
|
|
16
|
+
`,hasTrailingLineEnding=/(?:\r\n|\n|\r)$/.test(withoutDuplicates),hasTrailingBlankLine=/(?:\r\n|\n|\r){2}$/.test(withoutDuplicates),separator=withoutDuplicates.length===0||hasTrailingBlankLine?"":hasTrailingLineEnding?lineEnding:`${lineEnding}${lineEnding}`;return`${withoutDuplicates}${separator}${CONTENTS_HEADER}${lineEnding}${assignment}${lineEnding}`}function escapeValue(value){return value?value.replace(/\n/g,"\\n").replace(/\r/g,"\\r"):""}var import_error_utils=__toESM(require_dist(),1);var import_json_parse_better_errors=__toESM(require_json_parse_better_errors(),1);var EnvPullTelemetryClient=class extends TelemetryClient{trackCliArgumentFilename(filename){filename&&this.trackCliArgument({arg:"filename",value:this.redactedValue})}trackCliOptionEnvironment(environment){environment&&this.trackCliOption({option:"environment",value:STANDARD_ENVIRONMENTS.includes(environment)?environment:this.redactedValue})}trackCliOptionGitBranch(gitBranch){gitBranch&&this.trackCliOption({option:"git-branch",value:this.redactedValue})}trackCliFlagYes(yes){yes&&this.trackCliFlag("yes")}trackCliOptionId(id){id&&this.trackCliOption({option:"id",value:this.redactedValue})}};var CONTENTS_PREFIX=`# Created by Vercel CLI
|
|
17
|
+
`;function printEnvPullWarning(message){output_manager_default.print(`${import_chalk2.default.yellow("!")} ${message}
|
|
18
|
+
`)}function readHeadSync(path,length){let buffer=Buffer.alloc(length),fd=openSync(path,"r");try{readSync(fd,buffer,0,buffer.length,null)}finally{closeSync(fd)}return buffer.toString()}function tryReadHeadSync(path,length){try{return readHeadSync(path,length)}catch(err){if(!(0,import_error_utils.isErrnoException)(err)||err.code!=="ENOENT")throw err}}var VARIABLES_TO_IGNORE=["VERCEL_ANALYTICS_ID","VERCEL_SPEED_INSIGHTS_ID","VERCEL_WEB_ANALYTICS_ID"],SENSITIVE_PLACEHOLDER=SENSITIVE_ENV_VALUE_PLACEHOLDER;async function getRedactedSensitiveKeys(client,projectId,source,target,gitBranch,records){let emptyKeys=Object.keys(records).filter(key=>!records[key]);if(!projectId||emptyKeys.length===0)return new Set;try{let{envs}=await getEnvRecords(client,projectId,source,{target,gitBranch}),sensitiveKeys=new Set(envs.filter(isSecretEnvVar).map(env=>env.key));return new Set(emptyKeys.filter(key=>sensitiveKeys.has(key)))}catch{return new Set}}async function pull(client,argv,source="vercel-cli:env:pull",options={}){let telemetryClient=new EnvPullTelemetryClient({opts:{store:client.telemetryEventStore}}),parsedArgs,flagsSpecification=getFlagsSpecification(pullSubcommand.options);try{parsedArgs=parseArguments(argv,flagsSpecification)}catch(err){return printError(err),1}let{args,flags:opts}=parsedArgs;if(args.length>1)return output_manager_default.error(`Invalid number of arguments. Usage: ${getCommandName("env pull <file>")}`),1;let[rawFilename]=args,filename=rawFilename||".env.local",skipConfirmation=opts["--yes"],gitBranch=opts["--git-branch"];telemetryClient.trackCliArgumentFilename(args[0]),telemetryClient.trackCliFlagYes(skipConfirmation),telemetryClient.trackCliOptionGitBranch(gitBranch),telemetryClient.trackCliOptionEnvironment(opts["--environment"]),telemetryClient.trackCliOptionId(opts["--id"]),telemetryClient.trackCliOptionProject(opts["--project"]);let link=await resolveProjectContext({client,projectNameOrId:opts["--project"]});if(link.status==="error")return link.exitCode;if(link.status==="not_linked"){if(client.nonInteractive){let preserved=getPreservedArgsForEnvPull(client.argv),linkArgv=[...client.argv.slice(0,2),"link","--scope","<scope>",...preserved];outputAgentError(client,{status:"error",reason:"not_linked",message:`Your codebase isn't linked to a project on Vercel. Run \`${getCommandNamePlain("link")}\` to begin. Use \`--yes\` for non-interactive; use \`--scope\` or \`--project\` to specify team or project.`,next:[{command:buildCommandWithYes(linkArgv)},{command:buildCommandWithYes(client.argv)}]},1)}if(!client.nonInteractive&&client.stdin.isTTY&&!skipConfirmation){let ensuredLink=await ensureLink("env pull",client,client.cwd,{link,pullEnv:!1});if(typeof ensuredLink=="number")return ensuredLink;link=ensuredLink}else return output_manager_default.error(`Your codebase isn\u2019t linked to a project on Vercel. Run ${getCommandName("link")} to begin.`),1}client.config.currentTeam=link.org.type==="team"?link.org.id:void 0;let deploymentId=opts["--id"];if(deploymentId&&opts["--project"]){let deployment=await getDeployment(client,link.org.slug,deploymentId);if(deployment.projectId&&deployment.projectId!==link.project.id)return output_manager_default.error(`Deployment ${import_chalk2.default.bold(deploymentId)} does not belong to project ${import_chalk2.default.bold(link.project.name)}.`),1}let environment=parseTarget({flagName:"environment",flags:opts})||"development";return await envPullCommandLogic(client,filename,!!skipConfirmation,environment,link,gitBranch,client.cwd,source,deploymentId,options),0}async function envPullCommandLogic(client,filename,skipConfirmation,environment,link,gitBranch,cwd,source,deploymentId,{oidcTokenOnly=!1}={}){let fullPath=resolve(cwd,filename),head=tryReadHeadSync(fullPath,Buffer.byteLength(CONTENTS_PREFIX)),exists=typeof head<"u";if(head===CONTENTS_PREFIX&&!oidcTokenOnly)output_manager_default.log(`Overwriting existing ${import_chalk2.default.bold(filename)} file`);else if(exists&&!skipConfirmation&&!oidcTokenOnly){if(client.nonInteractive){let preserved=getPreservedArgsForEnvPull(client.argv).filter(arg=>arg!=="--yes"&&arg!=="-y"),suffix=preserved.length>0?` ${preserved.join(" ")}`:"";outputActionRequired(client,{status:"action_required",reason:"env_file_exists",message:`File ${param(filename)} already exists and was not created by Vercel CLI. Use --yes to overwrite or specify a different filename.`,next:[{command:getCommandNamePlain(`env pull ${filename} --yes${suffix}`),when:"Overwrite this file"},{command:getCommandNamePlain(`env pull <filename>${suffix}`),when:"Use a different filename"}]})}if(!await client.input.confirm(`Found existing file ${param(filename)}. Do you want to overwrite?`,!1)){output_manager_default.log("Canceled");return}}let projectSlugLink=formatProject(link.org.slug,link.project.name),downloadMessage=oidcTokenOnly?`Downloading a fresh \`${import_chalk2.default.cyan(VERCEL_OIDC_TOKEN)}\` for ${projectSlugLink}`:gitBranch?`Downloading \`${import_chalk2.default.cyan(environment)}\` environment variables for ${projectSlugLink} and any overrides for branch ${import_chalk2.default.cyan(gitBranch)}`:`Downloading \`${import_chalk2.default.cyan(environment)}\` environment variables for ${projectSlugLink}`;output_manager_default.log(downloadMessage),output_manager_default.spinner("Downloading");let pullId=deploymentId||link.project.id,pullResult=await pullEnvRecords(client,pullId,source,{target:environment||"development",gitBranch}),records=deploymentId?pullResult.buildEnv:pullResult.env,deltaString="",oldEnv;exists&&!oidcTokenOnly&&(oldEnv=await createEnvObject(fullPath));let contents,fileChanged=!0,keptLocalKeys=[],preservedLocalSecretKeys=[],redactedSecretCount=0,placeholderSecretCount=0;if(oidcTokenOnly){let existingContents=exists?await(0,import_fs_extra2.readFile)(fullPath,"utf8"):"";contents=updateOidcTokenContents(existingContents,records[VERCEL_OIDC_TOKEN]||void 0),fileChanged=contents!==existingContents}else{let sensitiveKeys=await getRedactedSensitiveKeys(client,deploymentId?void 0:link.project.id,source,environment,gitBranch,records);redactedSecretCount=sensitiveKeys.size;let mergedRecords={...records};for(let key of sensitiveKeys){let localValue=oldEnv?.[key];localValue&&localValue!==SENSITIVE_PLACEHOLDER?(mergedRecords[key]=localValue,preservedLocalSecretKeys.push(key)):(mergedRecords[key]=SENSITIVE_PLACEHOLDER,placeholderSecretCount++)}if(oldEnv)for(let[key,value]of Object.entries(oldEnv))!(key in mergedRecords)&&key!==VERCEL_OIDC_TOKEN&&!VARIABLES_TO_IGNORE.includes(key)&&(mergedRecords[key]=value,keptLocalKeys.push(key));if(contents=CONTENTS_PREFIX+Object.keys(mergedRecords).sort().filter(key=>!VARIABLES_TO_IGNORE.includes(key)).map(key=>`${key}="${escapeValue2(mergedRecords[key])}"`).join(`
|
|
19
|
+
`)+`
|
|
20
|
+
`,oldEnv){let newEnv=(0,import_json_parse_better_errors.default)(JSON.stringify(mergedRecords).replace(/\\"/g,""));deltaString=buildDeltaString(oldEnv,newEnv)}}if(fileChanged&&await(0,import_fs_extra2.outputFile)(fullPath,contents,"utf8"),deltaString?output_manager_default.print(`
|
|
21
|
+
`+deltaString):oldEnv&&exists&&output_manager_default.log("No changes found."),keptLocalKeys.length>0&&output_manager_default.log(`Kept ${keptLocalKeys.sort().map(key=>import_chalk2.default.bold(key)).join(", ")} (defined locally, not found in the ${import_chalk2.default.cyan(environment)} Environment)`),redactedSecretCount>0){let preservedMessage=preservedLocalSecretKeys.length>0?` Kept ${preservedLocalSecretKeys.length} existing local ${preservedLocalSecretKeys.length===1?"value":"values"}.`:"",placeholderMessage=placeholderSecretCount>0?` Wrote "${SENSITIVE_PLACEHOLDER}" ${placeholderSecretCount===1?"as a placeholder":"as placeholders"} for the remaining ${placeholderSecretCount===1?"value":"values"}; replace ${placeholderSecretCount===1?"it":"them"} with local-only values.`:"";printEnvPullWarning(`${getUnavailableSecretValuesMessage(environment,redactedSecretCount)}${preservedMessage}${placeholderMessage}`)}let isGitIgnoreUpdated=!1,fileExistsAfterPull=exists||contents.length>0;if(filename===".env.local"&&fileExistsAfterPull){let rootPath=link.repoRoot??cwd;isGitIgnoreUpdated=await addToGitIgnore(rootPath,".env*")}if(!fileChanged&&!isGitIgnoreUpdated){output_manager_default.stopSpinner();return}if(output_manager_default.print(`
|
|
22
|
+
`),!fileChanged){printAlignedLabel("Updated",`.gitignore for ${filename}`,{gutter:"\u2713"});return}printAlignedLabel(exists?"Updated":"Created",`${filename} file${isGitIgnoreUpdated?" and added it to .gitignore":""}`,{gutter:"\u2713"})}function escapeValue2(value){return value?value.replace(new RegExp(`
|
|
23
|
+
`,"g"),"\\n").replace(new RegExp("\r","g"),"\\r"):""}export{getEnvRecords,pullEnvRecords,createEnvObject,VERCEL_OIDC_TOKEN,SENSITIVE_ENV_VALUE_PLACEHOLDER,looksLikeSecret,looksLikeSecretValue,shouldConfirmRotationBeforeDelete,isFlagsSecretNeedingSplit,normalizeStdinEnvValue,getPublicPrefix,getFrameworkPublicPrefix,getApiPublicPrefix,getLocalSvelteKitPublicPrefixes,removePublicPrefix,validateEnvValue,getEnvKeyWarnings,ENV_VISIBILITY_DEPRECATION_MESSAGE,resolveEnvVarTypeOption,isSecretEnvVar,formatVisibilityLabel,getPublicPrefixSecretVisibilityError,resolveEnvVarVisibility,getUnavailableSecretValuesMessage,getLocalSecretFallbackMessage,SENSITIVE_PLACEHOLDER,pull,envPullCommandLogic};
|
|
@@ -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_ansi_regex=__commonJS({"../../node_modules/.pnpm/ansi-regex@5.0.1/node_modules/ansi-regex/index.js"(exports,module){"use strict";module.exports=({onlyFirst=!1}={})=>{let pattern=["[\\u001B\\u009B][[\\]()#;?]*(?:(?:(?:(?:;[-a-zA-Z\\d\\/#&.:=?%@~_]+)*|[a-zA-Z\\d]+(?:;[-a-zA-Z\\d\\/#&.:=?%@~_]*)*)?\\u0007)","(?:(?:\\d{1,4}(?:;\\d{0,4})*)?[\\dA-PR-TZcf-ntqry=><~]))"].join("|");return new RegExp(pattern,onlyFirst?void 0:"g")}}});var require_strip_ansi=__commonJS({"../../node_modules/.pnpm/strip-ansi@6.0.1/node_modules/strip-ansi/index.js"(exports,module){"use strict";var ansiRegex=require_ansi_regex();module.exports=string=>typeof string=="string"?string.replace(ansiRegex(),""):string}});export{require_strip_ansi};
|
|
@@ -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 getCommandFlags(argv,excludeFlags=[]){let flags=Object.keys(argv).filter(key=>!excludeFlags.includes(key)).map(key=>`${key}${typeof argv[key]!="boolean"?" "+argv[key]:""}`);return flags.length>0?` ${flags.join(" ")}`:""}export{getCommandFlags};
|
|
@@ -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
|
+
var PromptCanceledError=class extends Error{constructor(){super("Prompt canceled"),this.name="PromptCanceledError"}},PromptBackError=class extends Error{constructor(){super("Prompt back"),this.name="PromptBackError"}};function isPromptBackError(error){return error instanceof PromptBackError}function isPromptCanceledError(error){return error instanceof PromptCanceledError?!0:error instanceof Error&&error.message.includes("User force closed the prompt")}export{PromptCanceledError,PromptBackError,isPromptBackError,isPromptCanceledError};
|
|
@@ -0,0 +1,13 @@
|
|
|
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_string_width}from"./chunk-WPS6JZF6.js";import{require_strip_ansi}from"./chunk-OSCCYU74.js";import{require_ansi_styles}from"./chunk-GU6VIFR5.js";import{__commonJS,__require}from"./chunk-6L236MNA.js";var require_lib=__commonJS({"../../node_modules/.pnpm/mute-stream@1.0.0/node_modules/mute-stream/lib/index.js"(exports,module){var Stream=__require("stream"),MuteStream=class extends Stream{#isTTY=null;constructor(opts={}){super(opts),this.writable=this.readable=!0,this.muted=!1,this.on("pipe",this._onpipe),this.replace=opts.replace,this._prompt=opts.prompt||null,this._hadControl=!1}#destSrc(key,def){return this._dest?this._dest[key]:this._src?this._src[key]:def}#proxy(method,...args){typeof this._dest?.[method]=="function"&&this._dest[method](...args),typeof this._src?.[method]=="function"&&this._src[method](...args)}get isTTY(){return this.#isTTY!==null?this.#isTTY:this.#destSrc("isTTY",!1)}set isTTY(val){this.#isTTY=val}get rows(){return this.#destSrc("rows")}get columns(){return this.#destSrc("columns")}mute(){this.muted=!0}unmute(){this.muted=!1}_onpipe(src){this._src=src}pipe(dest,options){return this._dest=dest,super.pipe(dest,options)}pause(){if(this._src)return this._src.pause()}resume(){if(this._src)return this._src.resume()}write(c){if(this.muted){if(!this.replace)return!0;if(c.match(/^\u001b/))return c.indexOf(this._prompt)===0&&(c=c.slice(this._prompt.length),c=c.replace(/./g,this.replace),c=this._prompt+c),this._hadControl=!0,this.emit("data",c);this._prompt&&this._hadControl&&c.indexOf(this._prompt)===0&&(this._hadControl=!1,this.emit("data",this._prompt),c=c.slice(this._prompt.length)),c=c.toString().replace(/./g,this.replace)}this.emit("data",c)}end(c){this.muted&&(c&&this.replace?c=c.toString().replace(/./g,this.replace):c=null),c&&this.emit("data",c),this.emit("end")}destroy(...args){return this.#proxy("destroy",...args)}destroySoon(...args){return this.#proxy("destroySoon",...args)}close(...args){return this.#proxy("close",...args)}};module.exports=MuteStream}});var require_cli_width=__commonJS({"../../node_modules/.pnpm/cli-width@4.1.0/node_modules/cli-width/index.js"(exports,module){"use strict";module.exports=cliWidth;function normalizeOpts(options){let defaultOpts={defaultWidth:0,output:process.stdout,tty:__require("tty")};return options?(Object.keys(defaultOpts).forEach(function(key){options[key]||(options[key]=defaultOpts[key])}),options):defaultOpts}function cliWidth(options){let opts=normalizeOpts(options);if(opts.output.getWindowSize)return opts.output.getWindowSize()[0]||opts.defaultWidth;if(opts.tty.getWindowSize)return opts.tty.getWindowSize()[1]||opts.defaultWidth;if(opts.output.columns)return opts.output.columns;if(process.env.CLI_WIDTH){let width=parseInt(process.env.CLI_WIDTH,10);if(!isNaN(width)&&width!==0)return width}return opts.defaultWidth}}});var require_wrap_ansi=__commonJS({"../../node_modules/.pnpm/wrap-ansi@6.2.0/node_modules/wrap-ansi/index.js"(exports,module){"use strict";var stringWidth=require_string_width(),stripAnsi=require_strip_ansi(),ansiStyles=require_ansi_styles(),ESCAPES=new Set(["\x1B","\x9B"]),END_CODE=39,wrapAnsi=code=>`${ESCAPES.values().next().value}[${code}m`,wordLengths=string=>string.split(" ").map(character=>stringWidth(character)),wrapWord=(rows,word,columns)=>{let characters=[...word],isInsideEscape=!1,visible=stringWidth(stripAnsi(rows[rows.length-1]));for(let[index,character]of characters.entries()){let characterLength=stringWidth(character);if(visible+characterLength<=columns?rows[rows.length-1]+=character:(rows.push(character),visible=0),ESCAPES.has(character))isInsideEscape=!0;else if(isInsideEscape&&character==="m"){isInsideEscape=!1;continue}isInsideEscape||(visible+=characterLength,visible===columns&&index<characters.length-1&&(rows.push(""),visible=0))}!visible&&rows[rows.length-1].length>0&&rows.length>1&&(rows[rows.length-2]+=rows.pop())},stringVisibleTrimSpacesRight=str=>{let words=str.split(" "),last=words.length;for(;last>0&&!(stringWidth(words[last-1])>0);)last--;return last===words.length?str:words.slice(0,last).join(" ")+words.slice(last).join("")},exec=(string,columns,options={})=>{if(options.trim!==!1&&string.trim()==="")return"";let pre="",ret="",escapeCode,lengths=wordLengths(string),rows=[""];for(let[index,word]of string.split(" ").entries()){options.trim!==!1&&(rows[rows.length-1]=rows[rows.length-1].trimLeft());let rowLength=stringWidth(rows[rows.length-1]);if(index!==0&&(rowLength>=columns&&(options.wordWrap===!1||options.trim===!1)&&(rows.push(""),rowLength=0),(rowLength>0||options.trim===!1)&&(rows[rows.length-1]+=" ",rowLength++)),options.hard&&lengths[index]>columns){let remainingColumns=columns-rowLength,breaksStartingThisLine=1+Math.floor((lengths[index]-remainingColumns-1)/columns);Math.floor((lengths[index]-1)/columns)<breaksStartingThisLine&&rows.push(""),wrapWord(rows,word,columns);continue}if(rowLength+lengths[index]>columns&&rowLength>0&&lengths[index]>0){if(options.wordWrap===!1&&rowLength<columns){wrapWord(rows,word,columns);continue}rows.push("")}if(rowLength+lengths[index]>columns&&options.wordWrap===!1){wrapWord(rows,word,columns);continue}rows[rows.length-1]+=word}options.trim!==!1&&(rows=rows.map(stringVisibleTrimSpacesRight)),pre=rows.join(`
|
|
8
|
+
`);for(let[index,character]of[...pre].entries()){if(ret+=character,ESCAPES.has(character)){let code2=parseFloat(/\d[^m]*/.exec(pre.slice(index,index+4)));escapeCode=code2===END_CODE?null:code2}let code=ansiStyles.codes.get(Number(escapeCode));escapeCode&&code&&(pre[index+1]===`
|
|
9
|
+
`?ret+=wrapAnsi(code):character===`
|
|
10
|
+
`&&(ret+=wrapAnsi(escapeCode)))}return ret};module.exports=(string,columns,options)=>String(string).normalize().replace(/\r\n/g,`
|
|
11
|
+
`).split(`
|
|
12
|
+
`).map(line=>exec(line,columns,options)).join(`
|
|
13
|
+
`)}});import process2 from"node:process";function isUnicodeSupported(){return process2.platform!=="win32"?process2.env.TERM!=="linux":!!process2.env.WT_SESSION||!!process2.env.TERMINUS_SUBLIME||process2.env.ConEmuTask==="{cmd::Cmder}"||process2.env.TERM_PROGRAM==="Terminus-Sublime"||process2.env.TERM_PROGRAM==="vscode"||process2.env.TERM==="xterm-256color"||process2.env.TERM==="alacritty"||process2.env.TERMINAL_EMULATOR==="JetBrains-JediTerm"}var common={circleQuestionMark:"(?)",questionMarkPrefix:"(?)",square:"\u2588",squareDarkShade:"\u2593",squareMediumShade:"\u2592",squareLightShade:"\u2591",squareTop:"\u2580",squareBottom:"\u2584",squareLeft:"\u258C",squareRight:"\u2590",squareCenter:"\u25A0",bullet:"\u25CF",dot:"\u2024",ellipsis:"\u2026",pointerSmall:"\u203A",triangleUp:"\u25B2",triangleUpSmall:"\u25B4",triangleDown:"\u25BC",triangleDownSmall:"\u25BE",triangleLeftSmall:"\u25C2",triangleRightSmall:"\u25B8",home:"\u2302",heart:"\u2665",musicNote:"\u266A",musicNoteBeamed:"\u266B",arrowUp:"\u2191",arrowDown:"\u2193",arrowLeft:"\u2190",arrowRight:"\u2192",arrowLeftRight:"\u2194",arrowUpDown:"\u2195",almostEqual:"\u2248",notEqual:"\u2260",lessOrEqual:"\u2264",greaterOrEqual:"\u2265",identical:"\u2261",infinity:"\u221E",subscriptZero:"\u2080",subscriptOne:"\u2081",subscriptTwo:"\u2082",subscriptThree:"\u2083",subscriptFour:"\u2084",subscriptFive:"\u2085",subscriptSix:"\u2086",subscriptSeven:"\u2087",subscriptEight:"\u2088",subscriptNine:"\u2089",oneHalf:"\xBD",oneThird:"\u2153",oneQuarter:"\xBC",oneFifth:"\u2155",oneSixth:"\u2159",oneEighth:"\u215B",twoThirds:"\u2154",twoFifths:"\u2156",threeQuarters:"\xBE",threeFifths:"\u2157",threeEighths:"\u215C",fourFifths:"\u2158",fiveSixths:"\u215A",fiveEighths:"\u215D",sevenEighths:"\u215E",line:"\u2500",lineBold:"\u2501",lineDouble:"\u2550",lineDashed0:"\u2504",lineDashed1:"\u2505",lineDashed2:"\u2508",lineDashed3:"\u2509",lineDashed4:"\u254C",lineDashed5:"\u254D",lineDashed6:"\u2574",lineDashed7:"\u2576",lineDashed8:"\u2578",lineDashed9:"\u257A",lineDashed10:"\u257C",lineDashed11:"\u257E",lineDashed12:"\u2212",lineDashed13:"\u2013",lineDashed14:"\u2010",lineDashed15:"\u2043",lineVertical:"\u2502",lineVerticalBold:"\u2503",lineVerticalDouble:"\u2551",lineVerticalDashed0:"\u2506",lineVerticalDashed1:"\u2507",lineVerticalDashed2:"\u250A",lineVerticalDashed3:"\u250B",lineVerticalDashed4:"\u254E",lineVerticalDashed5:"\u254F",lineVerticalDashed6:"\u2575",lineVerticalDashed7:"\u2577",lineVerticalDashed8:"\u2579",lineVerticalDashed9:"\u257B",lineVerticalDashed10:"\u257D",lineVerticalDashed11:"\u257F",lineDownLeft:"\u2510",lineDownLeftArc:"\u256E",lineDownBoldLeftBold:"\u2513",lineDownBoldLeft:"\u2512",lineDownLeftBold:"\u2511",lineDownDoubleLeftDouble:"\u2557",lineDownDoubleLeft:"\u2556",lineDownLeftDouble:"\u2555",lineDownRight:"\u250C",lineDownRightArc:"\u256D",lineDownBoldRightBold:"\u250F",lineDownBoldRight:"\u250E",lineDownRightBold:"\u250D",lineDownDoubleRightDouble:"\u2554",lineDownDoubleRight:"\u2553",lineDownRightDouble:"\u2552",lineUpLeft:"\u2518",lineUpLeftArc:"\u256F",lineUpBoldLeftBold:"\u251B",lineUpBoldLeft:"\u251A",lineUpLeftBold:"\u2519",lineUpDoubleLeftDouble:"\u255D",lineUpDoubleLeft:"\u255C",lineUpLeftDouble:"\u255B",lineUpRight:"\u2514",lineUpRightArc:"\u2570",lineUpBoldRightBold:"\u2517",lineUpBoldRight:"\u2516",lineUpRightBold:"\u2515",lineUpDoubleRightDouble:"\u255A",lineUpDoubleRight:"\u2559",lineUpRightDouble:"\u2558",lineUpDownLeft:"\u2524",lineUpBoldDownBoldLeftBold:"\u252B",lineUpBoldDownBoldLeft:"\u2528",lineUpDownLeftBold:"\u2525",lineUpBoldDownLeftBold:"\u2529",lineUpDownBoldLeftBold:"\u252A",lineUpDownBoldLeft:"\u2527",lineUpBoldDownLeft:"\u2526",lineUpDoubleDownDoubleLeftDouble:"\u2563",lineUpDoubleDownDoubleLeft:"\u2562",lineUpDownLeftDouble:"\u2561",lineUpDownRight:"\u251C",lineUpBoldDownBoldRightBold:"\u2523",lineUpBoldDownBoldRight:"\u2520",lineUpDownRightBold:"\u251D",lineUpBoldDownRightBold:"\u2521",lineUpDownBoldRightBold:"\u2522",lineUpDownBoldRight:"\u251F",lineUpBoldDownRight:"\u251E",lineUpDoubleDownDoubleRightDouble:"\u2560",lineUpDoubleDownDoubleRight:"\u255F",lineUpDownRightDouble:"\u255E",lineDownLeftRight:"\u252C",lineDownBoldLeftBoldRightBold:"\u2533",lineDownLeftBoldRightBold:"\u252F",lineDownBoldLeftRight:"\u2530",lineDownBoldLeftBoldRight:"\u2531",lineDownBoldLeftRightBold:"\u2532",lineDownLeftRightBold:"\u252E",lineDownLeftBoldRight:"\u252D",lineDownDoubleLeftDoubleRightDouble:"\u2566",lineDownDoubleLeftRight:"\u2565",lineDownLeftDoubleRightDouble:"\u2564",lineUpLeftRight:"\u2534",lineUpBoldLeftBoldRightBold:"\u253B",lineUpLeftBoldRightBold:"\u2537",lineUpBoldLeftRight:"\u2538",lineUpBoldLeftBoldRight:"\u2539",lineUpBoldLeftRightBold:"\u253A",lineUpLeftRightBold:"\u2536",lineUpLeftBoldRight:"\u2535",lineUpDoubleLeftDoubleRightDouble:"\u2569",lineUpDoubleLeftRight:"\u2568",lineUpLeftDoubleRightDouble:"\u2567",lineUpDownLeftRight:"\u253C",lineUpBoldDownBoldLeftBoldRightBold:"\u254B",lineUpDownBoldLeftBoldRightBold:"\u2548",lineUpBoldDownLeftBoldRightBold:"\u2547",lineUpBoldDownBoldLeftRightBold:"\u254A",lineUpBoldDownBoldLeftBoldRight:"\u2549",lineUpBoldDownLeftRight:"\u2540",lineUpDownBoldLeftRight:"\u2541",lineUpDownLeftBoldRight:"\u253D",lineUpDownLeftRightBold:"\u253E",lineUpBoldDownBoldLeftRight:"\u2542",lineUpDownLeftBoldRightBold:"\u253F",lineUpBoldDownLeftBoldRight:"\u2543",lineUpBoldDownLeftRightBold:"\u2544",lineUpDownBoldLeftBoldRight:"\u2545",lineUpDownBoldLeftRightBold:"\u2546",lineUpDoubleDownDoubleLeftDoubleRightDouble:"\u256C",lineUpDoubleDownDoubleLeftRight:"\u256B",lineUpDownLeftDoubleRightDouble:"\u256A",lineCross:"\u2573",lineBackslash:"\u2572",lineSlash:"\u2571"},specialMainSymbols={tick:"\u2714",info:"\u2139",warning:"\u26A0",cross:"\u2718",squareSmall:"\u25FB",squareSmallFilled:"\u25FC",circle:"\u25EF",circleFilled:"\u25C9",circleDotted:"\u25CC",circleDouble:"\u25CE",circleCircle:"\u24DE",circleCross:"\u24E7",circlePipe:"\u24BE",radioOn:"\u25C9",radioOff:"\u25EF",checkboxOn:"\u2612",checkboxOff:"\u2610",checkboxCircleOn:"\u24E7",checkboxCircleOff:"\u24BE",pointer:"\u276F",triangleUpOutline:"\u25B3",triangleLeft:"\u25C0",triangleRight:"\u25B6",lozenge:"\u25C6",lozengeOutline:"\u25C7",hamburger:"\u2630",smiley:"\u32E1",mustache:"\u0DF4",star:"\u2605",play:"\u25B6",nodejs:"\u2B22",oneSeventh:"\u2150",oneNinth:"\u2151",oneTenth:"\u2152"},specialFallbackSymbols={tick:"\u221A",info:"i",warning:"\u203C",cross:"\xD7",squareSmall:"\u25A1",squareSmallFilled:"\u25A0",circle:"( )",circleFilled:"(*)",circleDotted:"( )",circleDouble:"( )",circleCircle:"(\u25CB)",circleCross:"(\xD7)",circlePipe:"(\u2502)",radioOn:"(*)",radioOff:"( )",checkboxOn:"[\xD7]",checkboxOff:"[ ]",checkboxCircleOn:"(\xD7)",checkboxCircleOff:"( )",pointer:">",triangleUpOutline:"\u2206",triangleLeft:"\u25C4",triangleRight:"\u25BA",lozenge:"\u2666",lozengeOutline:"\u25CA",hamburger:"\u2261",smiley:"\u263A",mustache:"\u250C\u2500\u2510",star:"\u2736",play:"\u25BA",nodejs:"\u2666",oneSeventh:"1/7",oneNinth:"1/9",oneTenth:"1/10"},mainSymbols={...common,...specialMainSymbols},fallbackSymbols={...common,...specialFallbackSymbols},shouldUseMain=isUnicodeSupported(),figures=shouldUseMain?mainSymbols:fallbackSymbols,esm_default=figures,replacements=Object.entries(specialMainSymbols);var signals=[];signals.push("SIGHUP","SIGINT","SIGTERM");process.platform!=="win32"&&signals.push("SIGALRM","SIGABRT","SIGVTALRM","SIGXCPU","SIGXFSZ","SIGUSR2","SIGTRAP","SIGSYS","SIGQUIT","SIGIOT");process.platform==="linux"&&signals.push("SIGIO","SIGPOLL","SIGPWR","SIGSTKFLT");var processOk=process4=>!!process4&&typeof process4=="object"&&typeof process4.removeListener=="function"&&typeof process4.emit=="function"&&typeof process4.reallyExit=="function"&&typeof process4.listeners=="function"&&typeof process4.kill=="function"&&typeof process4.pid=="number"&&typeof process4.on=="function",kExitEmitter=Symbol.for("signal-exit emitter"),global=globalThis,ObjectDefineProperty=Object.defineProperty.bind(Object),Emitter=class{emitted={afterExit:!1,exit:!1};listeners={afterExit:[],exit:[]};count=0;id=Math.random();constructor(){if(global[kExitEmitter])return global[kExitEmitter];ObjectDefineProperty(global,kExitEmitter,{value:this,writable:!1,enumerable:!1,configurable:!1})}on(ev,fn){this.listeners[ev].push(fn)}removeListener(ev,fn){let list=this.listeners[ev],i=list.indexOf(fn);i!==-1&&(i===0&&list.length===1?list.length=0:list.splice(i,1))}emit(ev,code,signal){if(this.emitted[ev])return!1;this.emitted[ev]=!0;let ret=!1;for(let fn of this.listeners[ev])ret=fn(code,signal)===!0||ret;return ev==="exit"&&(ret=this.emit("afterExit",code,signal)||ret),ret}},SignalExitBase=class{},signalExitWrap=handler=>({onExit(cb,opts){return handler.onExit(cb,opts)},load(){return handler.load()},unload(){return handler.unload()}}),SignalExitFallback=class extends SignalExitBase{onExit(){return()=>{}}load(){}unload(){}},SignalExit=class extends SignalExitBase{#hupSig=process3.platform==="win32"?"SIGINT":"SIGHUP";#emitter=new Emitter;#process;#originalProcessEmit;#originalProcessReallyExit;#sigListeners={};#loaded=!1;constructor(process4){super(),this.#process=process4,this.#sigListeners={};for(let sig of signals)this.#sigListeners[sig]=()=>{let listeners=this.#process.listeners(sig),{count}=this.#emitter,p=process4;if(typeof p.__signal_exit_emitter__=="object"&&typeof p.__signal_exit_emitter__.count=="number"&&(count+=p.__signal_exit_emitter__.count),listeners.length===count){this.unload();let ret=this.#emitter.emit("exit",null,sig),s=sig==="SIGHUP"?this.#hupSig:sig;ret||process4.kill(process4.pid,s)}};this.#originalProcessReallyExit=process4.reallyExit,this.#originalProcessEmit=process4.emit}onExit(cb,opts){if(!processOk(this.#process))return()=>{};this.#loaded===!1&&this.load();let ev=opts?.alwaysLast?"afterExit":"exit";return this.#emitter.on(ev,cb),()=>{this.#emitter.removeListener(ev,cb),this.#emitter.listeners.exit.length===0&&this.#emitter.listeners.afterExit.length===0&&this.unload()}}load(){if(!this.#loaded){this.#loaded=!0,this.#emitter.count+=1;for(let sig of signals)try{let fn=this.#sigListeners[sig];fn&&this.#process.on(sig,fn)}catch{}this.#process.emit=(ev,...a)=>this.#processEmit(ev,...a),this.#process.reallyExit=code=>this.#processReallyExit(code)}}unload(){this.#loaded&&(this.#loaded=!1,signals.forEach(sig=>{let listener=this.#sigListeners[sig];if(!listener)throw new Error("Listener not defined for signal: "+sig);try{this.#process.removeListener(sig,listener)}catch{}}),this.#process.emit=this.#originalProcessEmit,this.#process.reallyExit=this.#originalProcessReallyExit,this.#emitter.count-=1)}#processReallyExit(code){return processOk(this.#process)?(this.#process.exitCode=code||0,this.#emitter.emit("exit",this.#process.exitCode,null),this.#originalProcessReallyExit.call(this.#process,this.#process.exitCode)):0}#processEmit(ev,...args){let og=this.#originalProcessEmit;if(ev==="exit"&&processOk(this.#process)){typeof args[0]=="number"&&(this.#process.exitCode=args[0]);let ret=og.call(this.#process,ev,...args);return this.#emitter.emit("exit",this.#process.exitCode,null),ret}else return og.call(this.#process,ev,...args)}},process3=globalThis.process,{onExit,load,unload}=signalExitWrap(processOk(process3)?new SignalExit(process3):new SignalExitFallback);export{require_cli_width,require_wrap_ansi,require_lib,onExit,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{homedir}from"os";import{resolve}from"path";function humanizePath(path){let resolved=resolve(path),_homedir=homedir();return resolved.indexOf(_homedir)===0?`~${resolved.slice(_homedir.length)}`:resolved}export{humanizePath};
|
|
@@ -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{loginCommand}from"./chunk-JKTQV2QJ.js";import{login}from"./chunk-L243RUIR.js";import{help}from"./chunk-2B2MN3U5.js";import{TelemetryClient}from"./chunk-57GHYR4Y.js";import{parseArguments}from"./chunk-HTC6KO2B.js";import{printError}from"./chunk-LNPMDXBJ.js";import{getFlagsSpecification}from"./chunk-JAJW3P42.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 LoginTelemetryClient=class extends TelemetryClient{trackState(...args){this.trackLoginState(...args)}};async function login2(client,options){let parsedArgs=null,flagsSpecification=getFlagsSpecification(loginCommand.options),telemetry=new LoginTelemetryClient({opts:{store:client.telemetryEventStore}});try{options.shouldParseArgs&&(parsedArgs=parseArguments(client.argv.slice(2),flagsSpecification))}catch(error){return printError(error),1}if(parsedArgs?.flags["--help"])return telemetry.trackCliFlagHelp("login"),output_manager_default.print(help(loginCommand,{columns:client.stderr.columns})),0;if(parsedArgs?.flags["--token"])return output_manager_default.error('`--token` may not be used with the "login" command'),2;if(options.shouldParseArgs&&parsedArgs){let obsoleteFlags=Object.keys(parsedArgs.flags).filter(flag=>{let flagKey=flag.replace("--",""),option=loginCommand.options.find(o=>o.name===flagKey);if(!(!option||typeof option=="number"))return"deprecated"in option&&option.deprecated});if(obsoleteFlags.length){let flags=obsoleteFlags.map(f=>import_chalk.default.bold(f)).join(", ");output_manager_default.warn(`The following flags are deprecated: ${flags}`)}let obsoleteArguments=parsedArgs.args.slice(1);if(obsoleteArguments.length){let args=obsoleteArguments.map(a=>import_chalk.default.bold(a)).join(", ");output_manager_default.warn(`The following arguments are deprecated: ${args}`)}(obsoleteArguments.length||obsoleteFlags.length)&&output_manager_default.print(`Read more in our ${output_manager_default.link("changelog","https://vercel.com/changelog/new-vercel-cli-login-flow")}.
|
|
8
|
+
`)}return telemetry.trackState("started"),await login(client,telemetry,options.shouldParseArgs)}export{login2 as login};
|
|
@@ -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,__require}from"./chunk-6L236MNA.js";var require_dist=__commonJS({"../error-utils/dist/index.js"(exports,module){"use strict";var __create=Object.create,__defProp=Object.defineProperty,__getOwnPropDesc=Object.getOwnPropertyDescriptor,__getOwnPropNames=Object.getOwnPropertyNames,__getProtoOf=Object.getPrototypeOf,__hasOwnProp=Object.prototype.hasOwnProperty,__export=(target,all)=>{for(var name in all)__defProp(target,name,{get:all[name],enumerable:!0})},__copyProps=(to,from,except,desc)=>{if(from&&typeof from=="object"||typeof from=="function")for(let key of __getOwnPropNames(from))!__hasOwnProp.call(to,key)&&key!==except&&__defProp(to,key,{get:()=>from[key],enumerable:!(desc=__getOwnPropDesc(from,key))||desc.enumerable});return to},__toESM=(mod,isNodeMode,target)=>(target=mod!=null?__create(__getProtoOf(mod)):{},__copyProps(isNodeMode||!mod||!mod.__esModule?__defProp(target,"default",{value:mod,enumerable:!0}):target,mod)),__toCommonJS=mod=>__copyProps(__defProp({},"__esModule",{value:!0}),mod),src_exports={};__export(src_exports,{errorToString:()=>errorToString,errorToStringFriendly:()=>errorToStringFriendly,getSystemErrorMessage:()=>getSystemErrorMessage,isErrnoException:()=>isErrnoException,isError:()=>isError,isErrorLike:()=>isErrorLike,isObject:()=>isObject,isSpawnError:()=>isSpawnError,normalizeError:()=>normalizeError});module.exports=__toCommonJS(src_exports);var import_node_util=__toESM(__require("node:util")),isObject=obj=>typeof obj=="object"&&obj!==null,isError=error=>import_node_util.default.types.isNativeError(error),isErrnoException=error=>isError(error)&&"code"in error,nativeGetSystemErrorMessage=import_node_util.default.getSystemErrorMessage,getSystemErrorMessageFallback=errno=>import_node_util.default.getSystemErrorMap().get(errno)?.[1]??`Unknown system error ${errno}`,isErrorLike=error=>isObject(error)&&"message"in error,errorToString=(error,fallback)=>isError(error)||isErrorLike(error)?error.message:typeof error=="string"?error:fallback??"An unknown error has ocurred.",getSystemErrorMessage=nativeGetSystemErrorMessage??getSystemErrorMessageFallback,errorToStringFriendly=(error,fallback)=>isErrnoException(error)&&typeof error.errno=="number"?getSystemErrorMessage(error.errno):errorToString(error,fallback),normalizeError=error=>{if(isError(error))return error;let errorMessage=errorToString(error);return isErrorLike(error)?Object.assign(new Error(errorMessage),error):new Error(errorMessage)};function isSpawnError(v){return isErrnoException(v)&&"spawnargs"in v}}});export{require_dist};
|
|
@@ -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
|
+
async function createProject(client,settings){let{vercelAuth,v0,...rest}=settings;return await client.fetch("/v1/projects",{method:"POST",body:{...rest,...vercelAuth==="none"?{ssoProtection:null}:void 0,...v0?{v0:!0}:void 0}})}export{createProject};
|
|
@@ -4,12 +4,4 @@ import { dirname as __dirname_ } from 'node:path';
|
|
|
4
4
|
const require = __createRequire(import.meta.url);
|
|
5
5
|
const __filename = __fileURLToPath(import.meta.url);
|
|
6
6
|
const __dirname = __dirname_(__filename);
|
|
7
|
-
|
|
8
|
-
// src/util/can-prompt.ts
|
|
9
|
-
function canPrompt(client) {
|
|
10
|
-
return Boolean(client.stdin.isTTY) && !client.nonInteractive;
|
|
11
|
-
}
|
|
12
|
-
|
|
13
|
-
export {
|
|
14
|
-
canPrompt
|
|
15
|
-
};
|
|
7
|
+
var VERCEL_CONFIG_EXTENSIONS=["ts","mts","js","mjs","cjs"],DEFAULT_VERCEL_CONFIG_FILENAME="Vercel config";export{VERCEL_CONFIG_EXTENSIONS,DEFAULT_VERCEL_CONFIG_FILENAME};
|
|
@@ -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_ms=__commonJS({"../../node_modules/.pnpm/ms@2.1.2/node_modules/ms/index.js"(exports,module){var s=1e3,m=s*60,h=m*60,d=h*24,w=d*7,y=d*365.25;module.exports=function(val,options){options=options||{};var type=typeof val;if(type==="string"&&val.length>0)return parse(val);if(type==="number"&&isFinite(val))return options.long?fmtLong(val):fmtShort(val);throw new Error("val is not a non-empty string or a valid number. val="+JSON.stringify(val))};function parse(str){if(str=String(str),!(str.length>100)){var match=/^(-?(?:\d+)?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|weeks?|w|years?|yrs?|y)?$/i.exec(str);if(match){var n=parseFloat(match[1]),type=(match[2]||"ms").toLowerCase();switch(type){case"years":case"year":case"yrs":case"yr":case"y":return n*y;case"weeks":case"week":case"w":return n*w;case"days":case"day":case"d":return n*d;case"hours":case"hour":case"hrs":case"hr":case"h":return n*h;case"minutes":case"minute":case"mins":case"min":case"m":return n*m;case"seconds":case"second":case"secs":case"sec":case"s":return n*s;case"milliseconds":case"millisecond":case"msecs":case"msec":case"ms":return n;default:return}}}}function fmtShort(ms){var msAbs=Math.abs(ms);return msAbs>=d?Math.round(ms/d)+"d":msAbs>=h?Math.round(ms/h)+"h":msAbs>=m?Math.round(ms/m)+"m":msAbs>=s?Math.round(ms/s)+"s":ms+"ms"}function fmtLong(ms){var msAbs=Math.abs(ms);return msAbs>=d?plural(ms,msAbs,d,"day"):msAbs>=h?plural(ms,msAbs,h,"hour"):msAbs>=m?plural(ms,msAbs,m,"minute"):msAbs>=s?plural(ms,msAbs,s,"second"):ms+" ms"}function plural(ms,msAbs,n,name){var isPlural=msAbs>=n*1.5;return Math.round(ms/n)+" "+name+(isPlural?"s":"")}}});export{require_ms};
|
|
@@ -0,0 +1,19 @@
|
|
|
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{require_build_utils}from"./chunk-XFVGX5HG.js";import{require_dist}from"./chunk-QGIQK47P.js";import{require_source}from"./chunk-U7KCDTCH.js";import{__commonJS,__toESM}from"./chunk-6L236MNA.js";var require_bytes=__commonJS({"../../node_modules/.pnpm/bytes@3.0.0/node_modules/bytes/index.js"(exports,module){"use strict";module.exports=bytes2;module.exports.format=format;module.exports.parse=parse;var formatThousandsRegExp=/\B(?=(\d{3})+(?!\d))/g,formatDecimalsRegExp=/(?:\.0*|(\.[^0]+)0+)$/,map={b:1,kb:1024,mb:1<<20,gb:1<<30,tb:(1<<30)*1024},parseRegExp=/^((-|\+)?(\d+(?:\.\d+)?)) *(kb|mb|gb|tb)$/i;function bytes2(value,options){return typeof value=="string"?parse(value):typeof value=="number"?format(value,options):null}function format(value,options){if(!Number.isFinite(value))return null;var mag=Math.abs(value),thousandsSeparator=options&&options.thousandsSeparator||"",unitSeparator=options&&options.unitSeparator||"",decimalPlaces=options&&options.decimalPlaces!==void 0?options.decimalPlaces:2,fixedDecimals=!!(options&&options.fixedDecimals),unit=options&&options.unit||"";(!unit||!map[unit.toLowerCase()])&&(mag>=map.tb?unit="TB":mag>=map.gb?unit="GB":mag>=map.mb?unit="MB":mag>=map.kb?unit="KB":unit="B");var val=value/map[unit.toLowerCase()],str=val.toFixed(decimalPlaces);return fixedDecimals||(str=str.replace(formatDecimalsRegExp,"$1")),thousandsSeparator&&(str=str.replace(formatThousandsRegExp,thousandsSeparator)),str+unitSeparator+unit}function parse(val){if(typeof val=="number"&&!isNaN(val))return val;if(typeof val!="string")return null;var results=parseRegExp.exec(val),floatValue,unit="b";return results?(floatValue=parseFloat(results[1]),unit=results[4].toLowerCase()):(floatValue=parseInt(val,10),unit="b"),Math.floor(map[unit]*floatValue)}}});var NowError=class extends Error{constructor({code:code2,message,meta}){super(message);this.code=code2,this.meta=meta}};var import_chalk=__toESM(require_source(),1);function code(cmd,{backticks=!0}={}){let tick=backticks?import_chalk.default.gray("`"):"";return`${tick}${import_chalk.default.bold(cmd)}${tick}`}var import_bytes=__toESM(require_bytes(),1),import_build_utils=__toESM(require_build_utils(),1);var import_chalk2=__toESM(require_source(),1),import_error_utils=__toESM(require_dist(),1),APIError=class extends Error{constructor(message,response,body){super();if(this.message=`${message} (${response.status})`,this.status=response.status,this.serverMessage=message,this.wwwAuthenticate=response.headers.get("WWW-Authenticate")??void 0,body)for(let field of Object.keys(body))field!=="message"&&(this[field]=body[field]);if(response.status===429||response.status===503){let parsed=parseRetryAfterHeaderAsMillis(response.headers.get("Retry-After"));this.retryAfterMs=parsed??(response.status===429?0:void 0)}}};function parseRetryAfterHeaderAsMillis(header){if(!header)return;let retryAfterMs=Number(header)*1e3;if(Number.isNaN(retryAfterMs)){if(retryAfterMs=Date.parse(header),Number.isNaN(retryAfterMs))return;retryAfterMs=retryAfterMs-Date.now()}return Math.max(retryAfterMs,0)}function isAPIError(v){return(0,import_error_utils.isError)(v)&&"status"in v}var TeamDeleted=class extends NowError{constructor(){super({code:"TEAM_DELETED",message:`Your team was deleted or you were removed from the team. You can switch to a different one using ${getCommandName("switch")}.`,meta:{}})}},InvalidToken=class extends NowError{constructor(tokenSource){let message;tokenSource==="flag"?message="The token provided via `--token` argument is not valid. Please provide a valid token.":tokenSource==="env"?message="The token provided via VERCEL_TOKEN environment variable is not valid. Please provide a valid token.":message=`The specified token is not valid. Use ${getCommandName("login")} to generate a new token.`,super({code:"NOT_AUTHORIZED",message,meta:{}})}},MissingUser=class extends NowError{constructor(){super({code:"MISSING_USER",message:"Not able to load user, missing from response",meta:{}})}},DomainAlreadyExists=class extends NowError{constructor(domain){super({code:"DOMAIN_ALREADY_EXISTS",meta:{domain},message:`The domain ${domain} already exists under a different context.`})}},DomainPermissionDenied=class extends NowError{constructor(domain,context){super({code:"DOMAIN_PERMISSION_DENIED",meta:{domain,context},message:`You don't have access to the domain ${domain} under ${context}.`})}},DomainExternal=class extends NowError{constructor(domain){super({code:"DOMAIN_EXTERNAL",meta:{domain},message:`The domain ${domain} must point to zeit.world.`})}},SourceNotFound=class extends NowError{constructor(){super({code:"SOURCE_NOT_FOUND",meta:{},message:"Not able to purchase. Please add a payment method using the dashboard."})}};var DomainNotFound=class extends NowError{constructor(domain,contextName){super({code:"DOMAIN_NOT_FOUND",meta:{domain},message:`Domain not found by "${domain}"${contextName?` under ${import_chalk2.default.bold(contextName)}`:""}.`})}},DomainNotVerified=class extends NowError{constructor(domain){super({code:"DOMAIN_NOT_VERIFIED",meta:{domain},message:`The domain ${domain} is not verified.`})}},DomainVerificationFailed=class extends NowError{constructor({domain,nsVerification,txtVerification,purchased=!1}){super({code:"DOMAIN_VERIFICATION_FAILED",meta:{domain,nsVerification,txtVerification,purchased},message:`We can't verify the domain ${domain}. Both Name Servers and DNS TXT verifications failed.`})}},InvalidDomain=class extends NowError{constructor(domain,message){super({code:"INVALID_DOMAIN",meta:{domain},message:message||`The domain ${domain} is not valid.`})}},NotDomainOwner=class extends NowError{constructor(message){super({code:"NOT_DOMAIN_OWNER",meta:{},message})}},InvalidDeploymentId=class extends NowError{constructor(id,message){super({code:"INVALID_DEPLOYMENT_ID",meta:{id},message:message||`The deployment id "${id}" is not valid.`})}},UnsupportedTLD=class extends NowError{constructor(domain){super({code:"UNSUPPORTED_TLD",meta:{domain},message:`The TLD for domain name ${domain} is not supported.`})}},TLDNotSupportedViaCLI=class extends NowError{constructor(domain){super({code:"UNSUPPORTED_TLD_VIA_CLI",meta:{domain},message:`Purchased for the TLD for domain name ${domain} are not supported via the CLI. Use the REST API or the dashboard to purchase.`})}},DomainNotAvailable=class extends NowError{constructor(domain){super({code:"DOMAIN_NOT_AVAILABLE",meta:{domain},message:`The domain ${domain} is not available to be purchased.`})}};var UnexpectedDomainPurchaseError=class extends NowError{constructor(domain){super({code:"UNEXPECTED_DOMAIN_PURCHASE_ERROR",meta:{domain},message:"An unexpected error happened while purchasing."})}},UnexpectedDomainTransferError=class extends NowError{constructor(domain){super({code:"UNEXPECTED_DOMAIN_TRANSFER_ERROR",meta:{domain},message:"An unexpected error happened while transferring."})}},DomainPaymentError=class extends NowError{constructor(){super({code:"DOMAIN_PAYMENT_ERROR",meta:{},message:"Your card was declined."})}},DomainPurchasePending=class extends NowError{constructor(domain){super({code:"DOMAIN_PURCHASE_PENDING",meta:{domain},message:`The domain purchase for ${domain} is pending.`})}},UserAborted=class extends NowError{constructor(){super({code:"USER_ABORTED",meta:{},message:"The user canceled the operation."})}},CertNotFound=class extends NowError{constructor(id){super({code:"CERT_NOT_FOUND",meta:{id},message:`The cert ${id} can't be found.`})}},CertsPermissionDenied=class extends NowError{constructor(context,domain){super({code:"CERTS_PERMISSION_DENIED",meta:{domain},message:`You don't have access to ${domain}'s certs under ${context}.`})}},CertOrderNotFound=class extends NowError{constructor(cns){super({code:"CERT_ORDER_NOT_FOUND",meta:{cns},message:`No cert order could be found for cns ${cns.join(" ,")}`})}},TooManyRequests=class extends NowError{constructor(api,retryAfterMs){super({code:"TOO_MANY_REQUESTS",meta:{api,retryAfterMs},message:"Rate limited. Too many requests to the same endpoint."})}},CertError=class extends NowError{constructor({cns,code:code2,message,helpUrl}){super({code:"CERT_ERROR",meta:{cns,code:code2,helpUrl},message})}},CertConfigurationError=class extends NowError{constructor({cns,message,external,type,helpUrl}){super({code:"CERT_CONFIGURATION_ERROR",meta:{cns,helpUrl,external,type},message})}},DeploymentNotFound=class extends NowError{constructor({context,id=""}){super({code:"DEPLOYMENT_NOT_FOUND",meta:{id,context},message:`Can't find the deployment "${id}" under the context "${context}"`})}},DeploymentNotReady=class extends NowError{constructor({url=""}){super({code:"DEPLOYMENT_NOT_READY",meta:{url},message:`The deployment https://${url} is not ready.`})}},DeploymentFailedAliasImpossible=class extends NowError{constructor(){super({code:"DEPLOYMENT_FAILED_ALIAS_IMPOSSIBLE",meta:{},message:"The deployment build has failed and cannot be aliased"})}},DeploymentPermissionDenied=class extends NowError{constructor(id,context){super({code:"DEPLOYMENT_PERMISSION_DENIED",meta:{id,context},message:`You don't have access to the deployment ${id} under ${context}.`})}},InvalidAlias=class extends NowError{constructor(alias){super({code:"INVALID_ALIAS",meta:{alias},message:`The given alias ${alias} is not valid`})}},AliasInUse=class extends NowError{constructor(alias){super({code:"ALIAS_IN_USE",meta:{alias},message:"The alias is already in use"})}},CertMissing=class extends NowError{constructor(domain){super({code:"CERT_MISSING",meta:{domain},message:`The certificate for domain ${domain} is missing`})}},CantParseJSONFile=class extends NowError{constructor(file,parseErrorLocation){let message=`Can't parse json file ${file}: ${parseErrorLocation}`;super({code:"CANT_PARSE_JSON_FILE",meta:{file,parseErrorLocation},message})}},ConflictingConfigFiles=class extends import_build_utils.NowBuildError{constructor(files,message,link){super({code:"CONFLICTING_CONFIG_FILES",message:message||"Multiple config files found. Please use only one configuration file.",link:link||"https://vercel.link/combining-old-and-new-config"});this.files=files}},DeprecatedNowJson=class extends import_build_utils.NowBuildError{constructor(_file){super({code:"DEPRECATED_NOW_JSON",message:"The `now.json` file is deprecated and no longer supported. Please rename it to `vercel.json`.",link:"https://vercel.com/docs/projects/project-configuration"})}},CantFindConfig=class extends NowError{constructor(paths){super({code:"CANT_FIND_CONFIG",meta:{paths},message:"Can't find a configuration file in the given locations."})}},WorkingDirectoryDoesNotExist=class extends NowError{constructor(){super({code:"CWD_DOES_NOT_EXIST",meta:{},message:"The current working directory does not exist."})}};var NoAliasInConfig=class extends NowError{constructor(){super({code:"NO_ALIAS_IN_CONFIG",meta:{},message:"There is no alias set up in config file."})}},InvalidAliasInConfig=class extends NowError{constructor(value){super({code:"INVALID_ALIAS_IN_CONFIG",meta:{value},message:"Invalid alias option in configuration."})}};var DNSPermissionDenied=class extends NowError{constructor(domain){super({code:"DNS_PERMISSION_DENIED",meta:{domain},message:`You don't have access to the DNS records of ${domain}.`})}},DNSInvalidPort=class extends NowError{constructor(){super({code:"DNS_INVALID_PORT",meta:{},message:"Invalid <port> parameter. A number was expected"})}},DNSInvalidType=class extends NowError{constructor(type){super({code:"DNS_INVALID_TYPE",meta:{type},message:`Invalid <type> parameter "${type}". Expected one of A, AAAA, ALIAS, CAA, CNAME, MX, SRV, TXT`})}},DNSConflictingRecord=class extends NowError{constructor(record){super({code:"DNS_CONFLICTING_RECORD",meta:{record},message:` A conflicting record exists "${record}".`})}},DomainRemovalConflict=class extends NowError{constructor({aliases,certs,message,pendingAsyncPurchase,resolvable,suffix,transferring}){super({code:"domain_removal_conflict",meta:{aliases,certs,pendingAsyncPurchase,suffix,transferring,resolvable},message})}},DomainMoveConflict=class extends NowError{constructor({message,pendingAsyncPurchase,resolvable,suffix}){super({code:"domain_move_conflict",meta:{pendingAsyncPurchase,resolvable,suffix},message})}};var InvalidMoveDestination=class extends NowError{constructor(destination){super({code:"INVALID_MOVE_DESTINATION",message:`Invalid move destination "${destination}"`,meta:{destination}})}};var LambdaSizeExceededError=class extends NowError{constructor(size,maxLambdaSize){super({code:"MAX_LAMBDA_SIZE_EXCEEDED",message:`The lambda function size (${(0,import_bytes.default)(size).toLowerCase()}) exceeds the maximum size limit (${(0,import_bytes.default)(maxLambdaSize).toLowerCase()}).`,meta:{size,maxLambdaSize}})}},MissingDotenvVarsError=class extends NowError{constructor(type,missing){let message;missing.length===1?message=`Env var ${JSON.stringify(missing[0])} is not defined in ${code(type)} file`:message=[`The following env vars are not defined in ${code(type)} file:`,...missing.map(name=>` - ${JSON.stringify(name)}`)].join(`
|
|
8
|
+
`),message+=`
|
|
9
|
+
Read more: https://err.sh/vercel/missing-env-file`,super({code:"MISSING_DOTENV_VARS",message,meta:{type,missing}})}},DeploymentsRateLimited=class extends NowError{constructor(message){super({code:"DEPLOYMENTS_RATE_LIMITED",meta:{},message})}},BuildsRateLimited=class extends NowError{constructor(message,meta={}){super({code:"BUILDS_RATE_LIMITED",meta,message})}},ProjectNotFound=class extends NowError{constructor(nameOrId){super({code:"PROJECT_NOT_FOUND",meta:{},message:`There is no project for "${nameOrId}"`})}},LinkRequiredError=class extends NowError{constructor(message="No project is linked in this directory. Run `vercel link` or pass a project name."){super({code:"LINK_REQUIRED",meta:{},message})}},AliasDomainConfigured=class extends NowError{constructor({message}){super({code:"DOMAIN_CONFIGURED",meta:{},message})}},MissingBuildScript=class extends NowError{constructor({message}){super({code:"MISSING_BUILD_SCRIPT",meta:{},message})}},ConflictingFilePath=class extends NowError{constructor({message}){super({code:"CONFLICTING_FILE_PATH",meta:{},message})}},ConflictingPathSegment=class extends NowError{constructor({message}){super({code:"CONFLICTING_PATH_SEGMENT",meta:{},message})}},BuildError=class extends NowError{constructor({message,meta}){super({code:"BUILD_ERROR",meta,message})}},SchemaValidationFailed=class extends NowError{constructor(message,keyword,dataPath,params){super({code:"SCHEMA_VALIDATION_FAILED",meta:{message,keyword,dataPath,params},message:"Schema verification failed"})}},InvalidLocalConfig=class extends NowError{constructor(value){super({code:"INVALID_LOCAL_CONFIG",meta:{value},message:`Invalid local config parameter [${value.map(localConfig=>`"${localConfig}"`).join(", ")}]. A string was expected.`})}};export{require_bytes,NowError,code,APIError,parseRetryAfterHeaderAsMillis,isAPIError,TeamDeleted,InvalidToken,MissingUser,DomainAlreadyExists,DomainPermissionDenied,DomainExternal,SourceNotFound,DomainNotFound,DomainNotVerified,DomainVerificationFailed,InvalidDomain,NotDomainOwner,InvalidDeploymentId,UnsupportedTLD,TLDNotSupportedViaCLI,DomainNotAvailable,UnexpectedDomainPurchaseError,UnexpectedDomainTransferError,DomainPaymentError,DomainPurchasePending,UserAborted,CertNotFound,CertsPermissionDenied,CertOrderNotFound,TooManyRequests,CertError,CertConfigurationError,DeploymentNotFound,DeploymentNotReady,DeploymentFailedAliasImpossible,DeploymentPermissionDenied,InvalidAlias,AliasInUse,CertMissing,CantParseJSONFile,ConflictingConfigFiles,DeprecatedNowJson,CantFindConfig,WorkingDirectoryDoesNotExist,NoAliasInConfig,InvalidAliasInConfig,DNSPermissionDenied,DNSInvalidPort,DNSInvalidType,DNSConflictingRecord,DomainRemovalConflict,DomainMoveConflict,InvalidMoveDestination,LambdaSizeExceededError,MissingDotenvVarsError,DeploymentsRateLimited,BuildsRateLimited,ProjectNotFound,LinkRequiredError,AliasDomainConfigured,MissingBuildScript,ConflictingFilePath,ConflictingPathSegment,BuildError,SchemaValidationFailed,InvalidLocalConfig};
|
|
10
|
+
/*! Bundled license information:
|
|
11
|
+
|
|
12
|
+
bytes/index.js:
|
|
13
|
+
(*!
|
|
14
|
+
* bytes
|
|
15
|
+
* Copyright(c) 2012-2014 TJ Holowaychuk
|
|
16
|
+
* Copyright(c) 2015 Jed Watson
|
|
17
|
+
* MIT Licensed
|
|
18
|
+
*)
|
|
19
|
+
*/
|
|
@@ -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{getGlobalPathConfig}from"./chunk-ZIPVX7LD.js";import{output_manager_default}from"./chunk-Z6Y55QJW.js";var OPENAPI_URL="https://openapi.vercel.sh/",SSO_API_URL="https://vercel.com/sso-api",CACHE_FILE="openapi-spec.json",CACHE_TTL_MS=864e5,FETCH_TIMEOUT_MS=1e4,MAX_OPENAPI_SPEC_BYTES=52428800,VERCEL_CLI_ROOT_DISPLAY_KEY="__root__";async function readSpecResponse(response,url,maxBytes=52428800){let contentLength=response.headers.get("content-length");if(contentLength){let bytes=Number(contentLength);if(Number.isFinite(bytes)&&bytes>maxBytes)throw new Error(`OpenAPI spec from ${url} exceeds the ${maxBytes} byte limit.`)}if(!response.body)throw new Error(`OpenAPI spec from ${url} returned an empty response.`);let reader=response.body.getReader(),chunks=[],totalBytes=0;for(;;){let{done,value}=await reader.read();if(done)break;if(value){if(totalBytes+=value.byteLength,totalBytes>maxBytes)throw await reader.cancel(),new Error(`OpenAPI spec from ${url} exceeds the ${maxBytes} byte limit.`);chunks.push(value)}}let buffer=new Uint8Array(totalBytes),offset=0;for(let chunk of chunks)buffer.set(chunk,offset),offset+=chunk.byteLength;return JSON.parse(new TextDecoder().decode(buffer))}var ALLOWED_SPEC_HOSTS=["vercel.sh","vercel.tools"];function assertAllowedSpecUrl(specUrl){let parsedUrl=new URL(specUrl);if(parsedUrl.protocol!=="https:")throw new Error("OpenAPI spec URL must use https");if(!ALLOWED_SPEC_HOSTS.some(host=>isHostOrSubdomain(parsedUrl,host)))throw new Error("OpenAPI spec URL must be on an allowed origin.");return parsedUrl}function isHostOrSubdomain(url,host){return url.hostname===host||url.hostname.endsWith(`.${host}`)}import{join}from"path";import{readFile,writeFile,mkdir}from"fs/promises";var OpenApiCache=class{constructor(options){this.spec=null;this.error=null;this.cachePath=join(getGlobalPathConfig(),CACHE_FILE),this.specUrl=options?.specUrl,this.fetchSpecUrl=options?.fetchSpecUrl}get isLoaded(){return this.spec!==null}get loadError(){return this.error}async load(forceRefresh=!1){return this.loadSpec(forceRefresh)}async loadSpec(forceRefresh=!1){if(this.error=null,this.specUrl)return this.loadCustomSpec(this.specUrl);if(!forceRefresh){let cached=await this.readCache(this.cachePath);if(cached&&!this.isExpired(cached.fetchedAt))return output_manager_default.debug("Using cached OpenAPI spec"),this.spec=cached.spec,!0}try{return output_manager_default.debug("Fetching OpenAPI spec from "+OPENAPI_URL),this.spec=await this.fetchSpec(OPENAPI_URL),await this.saveCache(this.cachePath,this.spec),!0}catch(err){output_manager_default.debug(`Failed to fetch OpenAPI spec: ${err}`);let stale=await this.readCache(this.cachePath);return stale?(output_manager_default.debug("Using stale cached OpenAPI spec"),this.spec=stale.spec,!0):!1}}async loadCustomSpec(specUrl){try{assertAllowedSpecUrl(specUrl),output_manager_default.debug("Fetching OpenAPI spec from "+specUrl);let spec=this.fetchSpecUrl?await this.fetchSpecUrl(specUrl):await this.fetchSpec(specUrl);return spec?(this.validateSpec(spec,specUrl),this.spec=spec,!!this.spec):(this.error=`Could not load OpenAPI spec from ${specUrl}.`,!1)}catch(err){let message=err instanceof Error?err.message:String(err);return this.error=message,output_manager_default.debug(`Failed to fetch OpenAPI spec from ${specUrl}: ${message}`),!1}}async loadWithSpinner(forceRefresh=!1){output_manager_default.spinner(forceRefresh?"Refreshing API endpoints...":"Loading API endpoints...");let success=await this.load(forceRefresh);return output_manager_default.stopSpinner(),success}getEndpoints(){this.ensureLoaded();let endpoints=this.extractEndpoints();return this.sortEndpoints(endpoints)}getBodyFields(endpoint){if(this.ensureLoaded(),!endpoint.requestBody?.content)return[];let jsonContent=endpoint.requestBody.content["application/json"];if(!jsonContent?.schema)return[];let schema=this.resolveSchemaRef(jsonContent.schema);if(!schema?.properties)return[];let requiredFields=new Set(schema.required||[]),fields=[];for(let[name,propSchema]of Object.entries(schema.properties)){let resolvedProp=this.resolveSchemaRef(propSchema),enumValues=resolvedProp?.enum||propSchema.enum;if(!enumValues&&(resolvedProp?.type==="array"||propSchema.type==="array")){let items=resolvedProp?.items||propSchema.items;items&&(enumValues=this.resolveSchemaRef(items)?.enum||items.enum)}fields.push({name,required:requiredFields.has(name),description:resolvedProp?.description||propSchema.description,type:resolvedProp?.type||propSchema.type,enumValues})}return fields.sort((a,b)=>a.required!==b.required?a.required?-1:1:a.name.localeCompare(b.name)),fields}getDisplayColumns(endpoint){this.ensureLoaded();let pathItem=this.spec.paths[endpoint.path];if(!pathItem)return null;let operation=pathItem[endpoint.method.toLowerCase()];if(!operation?.responses)return null;let ok=operation.responses[200]||operation.responses[201];if(!ok)return null;let jsonContent=ok.content?.["application/json"];return jsonContent?.schema?this.findDisplayColumns(jsonContent.schema):null}findDisplayColumns(schema){let xCli=schema["x-vercel-cli"];if(xCli?.displayColumns)return xCli.displayColumns;for(let key of["oneOf","allOf","anyOf"]){let variants=schema[key];if(variants)for(let sub of variants){let found=this.findDisplayColumns(sub);if(found)return found}}return null}ensureLoaded(){if(!this.spec)throw new Error("OpenAPI spec not loaded. Call load() or loadWithSpinner() first.")}async readCache(cachePath){try{let content=await readFile(cachePath,"utf-8");return JSON.parse(content)}catch{return null}}async saveCache(cachePath,spec){let cached={fetchedAt:Date.now(),spec},dir=join(cachePath,"..");await mkdir(dir,{recursive:!0}),await writeFile(cachePath,JSON.stringify(cached)),output_manager_default.debug("Saved OpenAPI spec to cache")}async fetchSpec(url){let controller=new AbortController,timeoutId=setTimeout(()=>controller.abort(),1e4);try{let response=await fetch(url,{signal:controller.signal});if(!response.ok)throw new Error(`Failed to fetch OpenAPI spec: ${response.status}`);let spec=await readSpecResponse(response,url);return this.validateSpec(spec,url),spec}finally{clearTimeout(timeoutId)}}validateSpec(spec,url){if(!spec||typeof spec!="object")throw new Error(`Invalid OpenAPI spec from ${url}: expected a JSON object.`);if(typeof spec.openapi!="string"||!spec.openapi.startsWith("3."))throw new Error(`Invalid OpenAPI spec from ${url}: expected an OpenAPI 3.x document with an "openapi" field.`);if(!spec.paths||typeof spec.paths!="object")throw new Error(`Invalid OpenAPI spec from ${url}: expected a "paths" object.`);for(let path of Object.keys(spec.paths))if(!path.startsWith("/")||path.startsWith("//"))throw new Error(`Invalid OpenAPI spec from ${url}: path "${path}" must be a relative API path.`)}isExpired(fetchedAt){return Date.now()-fetchedAt>864e5}sortEndpoints(endpoints){return endpoints.sort((a,b)=>{let pathCompare=a.path.localeCompare(b.path);return pathCompare!==0?pathCompare:a.method.localeCompare(b.method)})}extractEndpoints(){let endpoints=[];for(let[path,pathItem]of Object.entries(this.spec.paths)){let methods=["get","post","put","patch","delete"];for(let method of methods){let operation=pathItem[method];if(operation){let pathParams=pathItem.parameters||[],opParams=operation.parameters||[],allParams=[...pathParams,...opParams];endpoints.push({path,method:method.toUpperCase(),summary:operation.summary||pathItem.summary||"",description:operation.description||pathItem.description||"",operationId:operation.operationId||"",tags:operation.tags||[],parameters:allParams,requestBody:operation.requestBody})}}}return endpoints}resolveSchemaRef(schema,spec=this.spec){if(schema){if(schema.$ref){let match=schema.$ref.match(/^#\/components\/schemas\/(.+)$/);if(match&&spec.components?.schemas){let resolved=spec.components.schemas[match[1]];return this.resolveSchemaRef(resolved,spec)}return}if(schema.allOf&&schema.allOf.length>0){let merged={type:"object",properties:{},required:[]};for(let subSchema of schema.allOf){let resolved=this.resolveSchemaRef(subSchema,spec);resolved&&(resolved.properties&&(merged.properties={...merged.properties,...resolved.properties}),resolved.required&&(merged.required=[...merged.required||[],...resolved.required]))}return merged}return schema}}};async function matchesCliApiTag(tagHint){if(!tagHint||tagHint.startsWith("-")||tagHint.includes("/"))return!1;let cache=new OpenApiCache;if(!await cache.load())return!1;let endpoints=cache.getEndpoints(),lower=tagHint.toLowerCase();return endpoints.some(ep=>ep.tags.some(t=>t.toLowerCase()===lower))}async function resolveOpenApiTagForProjectsCli(){return await matchesCliApiTag("projects")?"projects":await matchesCliApiTag("project")?"project":null}async function resolveOpenApiTagForTeamsCli(){return await matchesCliApiTag("teams")?"teams":await matchesCliApiTag("team")?"team":null}export{OPENAPI_URL,SSO_API_URL,CACHE_FILE,CACHE_TTL_MS,FETCH_TIMEOUT_MS,MAX_OPENAPI_SPEC_BYTES,VERCEL_CLI_ROOT_DISPLAY_KEY,readSpecResponse,assertAllowedSpecUrl,OpenApiCache,matchesCliApiTag,resolveOpenApiTagForProjectsCli,resolveOpenApiTagForTeamsCli};
|
|
@@ -0,0 +1,16 @@
|
|
|
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_graceful_fs}from"./chunk-F2ZWW2IO.js";import{__commonJS,__require}from"./chunk-6L236MNA.js";var require_strip_bom=__commonJS({"../../node_modules/.pnpm/strip-bom@3.0.0/node_modules/strip-bom/index.js"(exports,module){"use strict";module.exports=x=>{if(typeof x!="string")throw new TypeError("Expected a string, got "+typeof x);return x.charCodeAt(0)===65279?x.slice(1):x}}});var require_is_arrayish=__commonJS({"../../node_modules/.pnpm/is-arrayish@0.2.1/node_modules/is-arrayish/index.js"(exports,module){"use strict";module.exports=function(obj){return obj?obj instanceof Array||Array.isArray(obj)||obj.length>=0&&obj.splice instanceof Function:!1}}});var require_error_ex=__commonJS({"../../node_modules/.pnpm/error-ex@1.3.4/node_modules/error-ex/index.js"(exports,module){"use strict";var util=__require("util"),isArrayish=require_is_arrayish(),errorEx=function(name,properties){(!name||name.constructor!==String)&&(properties=name||{},name=Error.name);var errorExError=function ErrorEXError(message){if(!this)return new ErrorEXError(message);message=message instanceof Error?message.message:message||this.message,Error.call(this,message),Error.captureStackTrace(this,errorExError),this.name=name,Object.defineProperty(this,"message",{configurable:!0,enumerable:!1,get:function(){var newMessage=message.split(/\r?\n/g);for(var key in properties)if(properties.hasOwnProperty(key)){var modifier=properties[key];"message"in modifier&&(newMessage=modifier.message(this[key],newMessage)||newMessage,isArrayish(newMessage)||(newMessage=[newMessage]))}return newMessage.join(`
|
|
8
|
+
`)},set:function(v){message=v}});var overwrittenStack=null,stackDescriptor=Object.getOwnPropertyDescriptor(this,"stack"),stackGetter=stackDescriptor.get,stackValue=stackDescriptor.value;delete stackDescriptor.value,delete stackDescriptor.writable,stackDescriptor.set=function(newstack){overwrittenStack=newstack},stackDescriptor.get=function(){var stack=(overwrittenStack||(stackGetter?stackGetter.call(this):stackValue)).split(/\r?\n+/g);overwrittenStack||(stack[0]=this.name+": "+this.message);var lineCount=1;for(var key in properties)if(properties.hasOwnProperty(key)){var modifier=properties[key];if("line"in modifier){var line=modifier.line(this[key]);line&&stack.splice(lineCount++,0," "+line)}"stack"in modifier&&modifier.stack(this[key],stack)}return stack.join(`
|
|
9
|
+
`)},Object.defineProperty(this,"stack",stackDescriptor)};return Object.setPrototypeOf?(Object.setPrototypeOf(errorExError.prototype,Error.prototype),Object.setPrototypeOf(errorExError,Error)):util.inherits(errorExError,Error),errorExError};errorEx.append=function(str,def){return{message:function(v,message){return v=v||def,v&&(message[0]+=" "+str.replace("%s",v.toString())),message}}};errorEx.line=function(str,def){return{line:function(v){return v=v||def,v?str.replace("%s",v.toString()):null}}};module.exports=errorEx}});var require_unicode=__commonJS({"../../node_modules/.pnpm/parse-json@3.0.0/node_modules/parse-json/vendor/unicode.js"(exports,module){var Uni=module.exports;module.exports.isWhiteSpace=function(x){return x===" "||x==="\xA0"||x==="\uFEFF"||x>=" "&&x<="\r"||x==="\u1680"||x==="\u180E"||x>="\u2000"&&x<="\u200A"||x==="\u2028"||x==="\u2029"||x==="\u202F"||x==="\u205F"||x==="\u3000"};module.exports.isWhiteSpaceJSON=function(x){return x===" "||x===" "||x===`
|
|
10
|
+
`||x==="\r"};module.exports.isLineTerminator=function(x){return x===`
|
|
11
|
+
`||x==="\r"||x==="\u2028"||x==="\u2029"};module.exports.isLineTerminatorJSON=function(x){return x===`
|
|
12
|
+
`||x==="\r"};module.exports.isIdentifierStart=function(x){return x==="$"||x==="_"||x>="A"&&x<="Z"||x>="a"&&x<="z"||x>="\x80"&&Uni.NonAsciiIdentifierStart.test(x)};module.exports.isIdentifierPart=function(x){return x==="$"||x==="_"||x>="A"&&x<="Z"||x>="a"&&x<="z"||x>="0"&&x<="9"||x>="\x80"&&Uni.NonAsciiIdentifierPart.test(x)};module.exports.NonAsciiIdentifierStart=/[\xAA\xB5\xBA\xC0-\xD6\xD8-\xF6\xF8-\u02C1\u02C6-\u02D1\u02E0-\u02E4\u02EC\u02EE\u0370-\u0374\u0376\u0377\u037A-\u037D\u0386\u0388-\u038A\u038C\u038E-\u03A1\u03A3-\u03F5\u03F7-\u0481\u048A-\u0527\u0531-\u0556\u0559\u0561-\u0587\u05D0-\u05EA\u05F0-\u05F2\u0620-\u064A\u066E\u066F\u0671-\u06D3\u06D5\u06E5\u06E6\u06EE\u06EF\u06FA-\u06FC\u06FF\u0710\u0712-\u072F\u074D-\u07A5\u07B1\u07CA-\u07EA\u07F4\u07F5\u07FA\u0800-\u0815\u081A\u0824\u0828\u0840-\u0858\u08A0\u08A2-\u08AC\u0904-\u0939\u093D\u0950\u0958-\u0961\u0971-\u0977\u0979-\u097F\u0985-\u098C\u098F\u0990\u0993-\u09A8\u09AA-\u09B0\u09B2\u09B6-\u09B9\u09BD\u09CE\u09DC\u09DD\u09DF-\u09E1\u09F0\u09F1\u0A05-\u0A0A\u0A0F\u0A10\u0A13-\u0A28\u0A2A-\u0A30\u0A32\u0A33\u0A35\u0A36\u0A38\u0A39\u0A59-\u0A5C\u0A5E\u0A72-\u0A74\u0A85-\u0A8D\u0A8F-\u0A91\u0A93-\u0AA8\u0AAA-\u0AB0\u0AB2\u0AB3\u0AB5-\u0AB9\u0ABD\u0AD0\u0AE0\u0AE1\u0B05-\u0B0C\u0B0F\u0B10\u0B13-\u0B28\u0B2A-\u0B30\u0B32\u0B33\u0B35-\u0B39\u0B3D\u0B5C\u0B5D\u0B5F-\u0B61\u0B71\u0B83\u0B85-\u0B8A\u0B8E-\u0B90\u0B92-\u0B95\u0B99\u0B9A\u0B9C\u0B9E\u0B9F\u0BA3\u0BA4\u0BA8-\u0BAA\u0BAE-\u0BB9\u0BD0\u0C05-\u0C0C\u0C0E-\u0C10\u0C12-\u0C28\u0C2A-\u0C33\u0C35-\u0C39\u0C3D\u0C58\u0C59\u0C60\u0C61\u0C85-\u0C8C\u0C8E-\u0C90\u0C92-\u0CA8\u0CAA-\u0CB3\u0CB5-\u0CB9\u0CBD\u0CDE\u0CE0\u0CE1\u0CF1\u0CF2\u0D05-\u0D0C\u0D0E-\u0D10\u0D12-\u0D3A\u0D3D\u0D4E\u0D60\u0D61\u0D7A-\u0D7F\u0D85-\u0D96\u0D9A-\u0DB1\u0DB3-\u0DBB\u0DBD\u0DC0-\u0DC6\u0E01-\u0E30\u0E32\u0E33\u0E40-\u0E46\u0E81\u0E82\u0E84\u0E87\u0E88\u0E8A\u0E8D\u0E94-\u0E97\u0E99-\u0E9F\u0EA1-\u0EA3\u0EA5\u0EA7\u0EAA\u0EAB\u0EAD-\u0EB0\u0EB2\u0EB3\u0EBD\u0EC0-\u0EC4\u0EC6\u0EDC-\u0EDF\u0F00\u0F40-\u0F47\u0F49-\u0F6C\u0F88-\u0F8C\u1000-\u102A\u103F\u1050-\u1055\u105A-\u105D\u1061\u1065\u1066\u106E-\u1070\u1075-\u1081\u108E\u10A0-\u10C5\u10C7\u10CD\u10D0-\u10FA\u10FC-\u1248\u124A-\u124D\u1250-\u1256\u1258\u125A-\u125D\u1260-\u1288\u128A-\u128D\u1290-\u12B0\u12B2-\u12B5\u12B8-\u12BE\u12C0\u12C2-\u12C5\u12C8-\u12D6\u12D8-\u1310\u1312-\u1315\u1318-\u135A\u1380-\u138F\u13A0-\u13F4\u1401-\u166C\u166F-\u167F\u1681-\u169A\u16A0-\u16EA\u16EE-\u16F0\u1700-\u170C\u170E-\u1711\u1720-\u1731\u1740-\u1751\u1760-\u176C\u176E-\u1770\u1780-\u17B3\u17D7\u17DC\u1820-\u1877\u1880-\u18A8\u18AA\u18B0-\u18F5\u1900-\u191C\u1950-\u196D\u1970-\u1974\u1980-\u19AB\u19C1-\u19C7\u1A00-\u1A16\u1A20-\u1A54\u1AA7\u1B05-\u1B33\u1B45-\u1B4B\u1B83-\u1BA0\u1BAE\u1BAF\u1BBA-\u1BE5\u1C00-\u1C23\u1C4D-\u1C4F\u1C5A-\u1C7D\u1CE9-\u1CEC\u1CEE-\u1CF1\u1CF5\u1CF6\u1D00-\u1DBF\u1E00-\u1F15\u1F18-\u1F1D\u1F20-\u1F45\u1F48-\u1F4D\u1F50-\u1F57\u1F59\u1F5B\u1F5D\u1F5F-\u1F7D\u1F80-\u1FB4\u1FB6-\u1FBC\u1FBE\u1FC2-\u1FC4\u1FC6-\u1FCC\u1FD0-\u1FD3\u1FD6-\u1FDB\u1FE0-\u1FEC\u1FF2-\u1FF4\u1FF6-\u1FFC\u2071\u207F\u2090-\u209C\u2102\u2107\u210A-\u2113\u2115\u2119-\u211D\u2124\u2126\u2128\u212A-\u212D\u212F-\u2139\u213C-\u213F\u2145-\u2149\u214E\u2160-\u2188\u2C00-\u2C2E\u2C30-\u2C5E\u2C60-\u2CE4\u2CEB-\u2CEE\u2CF2\u2CF3\u2D00-\u2D25\u2D27\u2D2D\u2D30-\u2D67\u2D6F\u2D80-\u2D96\u2DA0-\u2DA6\u2DA8-\u2DAE\u2DB0-\u2DB6\u2DB8-\u2DBE\u2DC0-\u2DC6\u2DC8-\u2DCE\u2DD0-\u2DD6\u2DD8-\u2DDE\u2E2F\u3005-\u3007\u3021-\u3029\u3031-\u3035\u3038-\u303C\u3041-\u3096\u309D-\u309F\u30A1-\u30FA\u30FC-\u30FF\u3105-\u312D\u3131-\u318E\u31A0-\u31BA\u31F0-\u31FF\u3400-\u4DB5\u4E00-\u9FCC\uA000-\uA48C\uA4D0-\uA4FD\uA500-\uA60C\uA610-\uA61F\uA62A\uA62B\uA640-\uA66E\uA67F-\uA697\uA6A0-\uA6EF\uA717-\uA71F\uA722-\uA788\uA78B-\uA78E\uA790-\uA793\uA7A0-\uA7AA\uA7F8-\uA801\uA803-\uA805\uA807-\uA80A\uA80C-\uA822\uA840-\uA873\uA882-\uA8B3\uA8F2-\uA8F7\uA8FB\uA90A-\uA925\uA930-\uA946\uA960-\uA97C\uA984-\uA9B2\uA9CF\uAA00-\uAA28\uAA40-\uAA42\uAA44-\uAA4B\uAA60-\uAA76\uAA7A\uAA80-\uAAAF\uAAB1\uAAB5\uAAB6\uAAB9-\uAABD\uAAC0\uAAC2\uAADB-\uAADD\uAAE0-\uAAEA\uAAF2-\uAAF4\uAB01-\uAB06\uAB09-\uAB0E\uAB11-\uAB16\uAB20-\uAB26\uAB28-\uAB2E\uABC0-\uABE2\uAC00-\uD7A3\uD7B0-\uD7C6\uD7CB-\uD7FB\uF900-\uFA6D\uFA70-\uFAD9\uFB00-\uFB06\uFB13-\uFB17\uFB1D\uFB1F-\uFB28\uFB2A-\uFB36\uFB38-\uFB3C\uFB3E\uFB40\uFB41\uFB43\uFB44\uFB46-\uFBB1\uFBD3-\uFD3D\uFD50-\uFD8F\uFD92-\uFDC7\uFDF0-\uFDFB\uFE70-\uFE74\uFE76-\uFEFC\uFF21-\uFF3A\uFF41-\uFF5A\uFF66-\uFFBE\uFFC2-\uFFC7\uFFCA-\uFFCF\uFFD2-\uFFD7\uFFDA-\uFFDC]/;module.exports.NonAsciiIdentifierPart=/[\xAA\xB5\xBA\xC0-\xD6\xD8-\xF6\xF8-\u02C1\u02C6-\u02D1\u02E0-\u02E4\u02EC\u02EE\u0300-\u0374\u0376\u0377\u037A-\u037D\u0386\u0388-\u038A\u038C\u038E-\u03A1\u03A3-\u03F5\u03F7-\u0481\u0483-\u0487\u048A-\u0527\u0531-\u0556\u0559\u0561-\u0587\u0591-\u05BD\u05BF\u05C1\u05C2\u05C4\u05C5\u05C7\u05D0-\u05EA\u05F0-\u05F2\u0610-\u061A\u0620-\u0669\u066E-\u06D3\u06D5-\u06DC\u06DF-\u06E8\u06EA-\u06FC\u06FF\u0710-\u074A\u074D-\u07B1\u07C0-\u07F5\u07FA\u0800-\u082D\u0840-\u085B\u08A0\u08A2-\u08AC\u08E4-\u08FE\u0900-\u0963\u0966-\u096F\u0971-\u0977\u0979-\u097F\u0981-\u0983\u0985-\u098C\u098F\u0990\u0993-\u09A8\u09AA-\u09B0\u09B2\u09B6-\u09B9\u09BC-\u09C4\u09C7\u09C8\u09CB-\u09CE\u09D7\u09DC\u09DD\u09DF-\u09E3\u09E6-\u09F1\u0A01-\u0A03\u0A05-\u0A0A\u0A0F\u0A10\u0A13-\u0A28\u0A2A-\u0A30\u0A32\u0A33\u0A35\u0A36\u0A38\u0A39\u0A3C\u0A3E-\u0A42\u0A47\u0A48\u0A4B-\u0A4D\u0A51\u0A59-\u0A5C\u0A5E\u0A66-\u0A75\u0A81-\u0A83\u0A85-\u0A8D\u0A8F-\u0A91\u0A93-\u0AA8\u0AAA-\u0AB0\u0AB2\u0AB3\u0AB5-\u0AB9\u0ABC-\u0AC5\u0AC7-\u0AC9\u0ACB-\u0ACD\u0AD0\u0AE0-\u0AE3\u0AE6-\u0AEF\u0B01-\u0B03\u0B05-\u0B0C\u0B0F\u0B10\u0B13-\u0B28\u0B2A-\u0B30\u0B32\u0B33\u0B35-\u0B39\u0B3C-\u0B44\u0B47\u0B48\u0B4B-\u0B4D\u0B56\u0B57\u0B5C\u0B5D\u0B5F-\u0B63\u0B66-\u0B6F\u0B71\u0B82\u0B83\u0B85-\u0B8A\u0B8E-\u0B90\u0B92-\u0B95\u0B99\u0B9A\u0B9C\u0B9E\u0B9F\u0BA3\u0BA4\u0BA8-\u0BAA\u0BAE-\u0BB9\u0BBE-\u0BC2\u0BC6-\u0BC8\u0BCA-\u0BCD\u0BD0\u0BD7\u0BE6-\u0BEF\u0C01-\u0C03\u0C05-\u0C0C\u0C0E-\u0C10\u0C12-\u0C28\u0C2A-\u0C33\u0C35-\u0C39\u0C3D-\u0C44\u0C46-\u0C48\u0C4A-\u0C4D\u0C55\u0C56\u0C58\u0C59\u0C60-\u0C63\u0C66-\u0C6F\u0C82\u0C83\u0C85-\u0C8C\u0C8E-\u0C90\u0C92-\u0CA8\u0CAA-\u0CB3\u0CB5-\u0CB9\u0CBC-\u0CC4\u0CC6-\u0CC8\u0CCA-\u0CCD\u0CD5\u0CD6\u0CDE\u0CE0-\u0CE3\u0CE6-\u0CEF\u0CF1\u0CF2\u0D02\u0D03\u0D05-\u0D0C\u0D0E-\u0D10\u0D12-\u0D3A\u0D3D-\u0D44\u0D46-\u0D48\u0D4A-\u0D4E\u0D57\u0D60-\u0D63\u0D66-\u0D6F\u0D7A-\u0D7F\u0D82\u0D83\u0D85-\u0D96\u0D9A-\u0DB1\u0DB3-\u0DBB\u0DBD\u0DC0-\u0DC6\u0DCA\u0DCF-\u0DD4\u0DD6\u0DD8-\u0DDF\u0DF2\u0DF3\u0E01-\u0E3A\u0E40-\u0E4E\u0E50-\u0E59\u0E81\u0E82\u0E84\u0E87\u0E88\u0E8A\u0E8D\u0E94-\u0E97\u0E99-\u0E9F\u0EA1-\u0EA3\u0EA5\u0EA7\u0EAA\u0EAB\u0EAD-\u0EB9\u0EBB-\u0EBD\u0EC0-\u0EC4\u0EC6\u0EC8-\u0ECD\u0ED0-\u0ED9\u0EDC-\u0EDF\u0F00\u0F18\u0F19\u0F20-\u0F29\u0F35\u0F37\u0F39\u0F3E-\u0F47\u0F49-\u0F6C\u0F71-\u0F84\u0F86-\u0F97\u0F99-\u0FBC\u0FC6\u1000-\u1049\u1050-\u109D\u10A0-\u10C5\u10C7\u10CD\u10D0-\u10FA\u10FC-\u1248\u124A-\u124D\u1250-\u1256\u1258\u125A-\u125D\u1260-\u1288\u128A-\u128D\u1290-\u12B0\u12B2-\u12B5\u12B8-\u12BE\u12C0\u12C2-\u12C5\u12C8-\u12D6\u12D8-\u1310\u1312-\u1315\u1318-\u135A\u135D-\u135F\u1380-\u138F\u13A0-\u13F4\u1401-\u166C\u166F-\u167F\u1681-\u169A\u16A0-\u16EA\u16EE-\u16F0\u1700-\u170C\u170E-\u1714\u1720-\u1734\u1740-\u1753\u1760-\u176C\u176E-\u1770\u1772\u1773\u1780-\u17D3\u17D7\u17DC\u17DD\u17E0-\u17E9\u180B-\u180D\u1810-\u1819\u1820-\u1877\u1880-\u18AA\u18B0-\u18F5\u1900-\u191C\u1920-\u192B\u1930-\u193B\u1946-\u196D\u1970-\u1974\u1980-\u19AB\u19B0-\u19C9\u19D0-\u19D9\u1A00-\u1A1B\u1A20-\u1A5E\u1A60-\u1A7C\u1A7F-\u1A89\u1A90-\u1A99\u1AA7\u1B00-\u1B4B\u1B50-\u1B59\u1B6B-\u1B73\u1B80-\u1BF3\u1C00-\u1C37\u1C40-\u1C49\u1C4D-\u1C7D\u1CD0-\u1CD2\u1CD4-\u1CF6\u1D00-\u1DE6\u1DFC-\u1F15\u1F18-\u1F1D\u1F20-\u1F45\u1F48-\u1F4D\u1F50-\u1F57\u1F59\u1F5B\u1F5D\u1F5F-\u1F7D\u1F80-\u1FB4\u1FB6-\u1FBC\u1FBE\u1FC2-\u1FC4\u1FC6-\u1FCC\u1FD0-\u1FD3\u1FD6-\u1FDB\u1FE0-\u1FEC\u1FF2-\u1FF4\u1FF6-\u1FFC\u200C\u200D\u203F\u2040\u2054\u2071\u207F\u2090-\u209C\u20D0-\u20DC\u20E1\u20E5-\u20F0\u2102\u2107\u210A-\u2113\u2115\u2119-\u211D\u2124\u2126\u2128\u212A-\u212D\u212F-\u2139\u213C-\u213F\u2145-\u2149\u214E\u2160-\u2188\u2C00-\u2C2E\u2C30-\u2C5E\u2C60-\u2CE4\u2CEB-\u2CF3\u2D00-\u2D25\u2D27\u2D2D\u2D30-\u2D67\u2D6F\u2D7F-\u2D96\u2DA0-\u2DA6\u2DA8-\u2DAE\u2DB0-\u2DB6\u2DB8-\u2DBE\u2DC0-\u2DC6\u2DC8-\u2DCE\u2DD0-\u2DD6\u2DD8-\u2DDE\u2DE0-\u2DFF\u2E2F\u3005-\u3007\u3021-\u302F\u3031-\u3035\u3038-\u303C\u3041-\u3096\u3099\u309A\u309D-\u309F\u30A1-\u30FA\u30FC-\u30FF\u3105-\u312D\u3131-\u318E\u31A0-\u31BA\u31F0-\u31FF\u3400-\u4DB5\u4E00-\u9FCC\uA000-\uA48C\uA4D0-\uA4FD\uA500-\uA60C\uA610-\uA62B\uA640-\uA66F\uA674-\uA67D\uA67F-\uA697\uA69F-\uA6F1\uA717-\uA71F\uA722-\uA788\uA78B-\uA78E\uA790-\uA793\uA7A0-\uA7AA\uA7F8-\uA827\uA840-\uA873\uA880-\uA8C4\uA8D0-\uA8D9\uA8E0-\uA8F7\uA8FB\uA900-\uA92D\uA930-\uA953\uA960-\uA97C\uA980-\uA9C0\uA9CF-\uA9D9\uAA00-\uAA36\uAA40-\uAA4D\uAA50-\uAA59\uAA60-\uAA76\uAA7A\uAA7B\uAA80-\uAAC2\uAADB-\uAADD\uAAE0-\uAAEF\uAAF2-\uAAF6\uAB01-\uAB06\uAB09-\uAB0E\uAB11-\uAB16\uAB20-\uAB26\uAB28-\uAB2E\uABC0-\uABEA\uABEC\uABED\uABF0-\uABF9\uAC00-\uD7A3\uD7B0-\uD7C6\uD7CB-\uD7FB\uF900-\uFA6D\uFA70-\uFAD9\uFB00-\uFB06\uFB13-\uFB17\uFB1D-\uFB28\uFB2A-\uFB36\uFB38-\uFB3C\uFB3E\uFB40\uFB41\uFB43\uFB44\uFB46-\uFBB1\uFBD3-\uFD3D\uFD50-\uFD8F\uFD92-\uFDC7\uFDF0-\uFDFB\uFE00-\uFE0F\uFE20-\uFE26\uFE33\uFE34\uFE4D-\uFE4F\uFE70-\uFE74\uFE76-\uFEFC\uFF10-\uFF19\uFF21-\uFF3A\uFF3F\uFF41-\uFF5A\uFF66-\uFFBE\uFFC2-\uFFC7\uFFCA-\uFFCF\uFFD2-\uFFD7\uFFDA-\uFFDC]/}});var require_parse=__commonJS({"../../node_modules/.pnpm/parse-json@3.0.0/node_modules/parse-json/vendor/parse.js"(exports,module){var Uni=require_unicode();function isHexDigit(x){return x>="0"&&x<="9"||x>="A"&&x<="F"||x>="a"&&x<="f"}function isOctDigit(x){return x>="0"&&x<="7"}function isDecDigit(x){return x>="0"&&x<="9"}var unescapeMap={"'":"'",'"':'"',"\\":"\\",b:"\b",f:"\f",n:`
|
|
13
|
+
`,r:"\r",t:" ",v:"\v","/":"/"};function formatError(input,msg,position,lineno,column,json5){var result=msg+" at "+(lineno+1)+":"+(column+1),tmppos=position-column-1,srcline="",underline="",isLineTerminator=json5?Uni.isLineTerminator:Uni.isLineTerminatorJSON;for(tmppos<position-70&&(tmppos=position-70);;){var chr=input[++tmppos];if(isLineTerminator(chr)||tmppos===input.length){position>=tmppos&&(underline+="^");break}if(srcline+=chr,position===tmppos?underline+="^":position>tmppos&&(underline+=input[tmppos]===" "?" ":" "),srcline.length>78)break}return result+`
|
|
14
|
+
`+srcline+`
|
|
15
|
+
`+underline}function parse(input,options){var json5=!(options.mode==="json"||options.legacy),isLineTerminator=json5?Uni.isLineTerminator:Uni.isLineTerminatorJSON,isWhiteSpace=json5?Uni.isWhiteSpace:Uni.isWhiteSpaceJSON,length=input.length,lineno=0,linestart=0,position=0,stack=[],tokenStart=function(){},tokenEnd=function(v){return v};options._tokenize&&function(){var start=null;tokenStart=function(){if(start!==null)throw Error("internal error, token overlap");start=position},tokenEnd=function(v,type){if(start!=position){var hash={raw:input.substr(start,position-start),type,stack:stack.slice(0)};v!==void 0&&(hash.value=v),options._tokenize.call(null,hash)}return start=null,v}}();function fail(msg){var column=position-linestart;if(!msg)if(position<length){var token="'"+JSON.stringify(input[position]).replace(/^"|"$/g,"").replace(/'/g,"\\'").replace(/\\"/g,'"')+"'";msg||(msg="Unexpected token "+token)}else msg||(msg="Unexpected end of input");var error=SyntaxError(formatError(input,msg,position,lineno,column,json5));throw error.row=lineno+1,error.column=column+1,error}function newline(chr){chr==="\r"&&input[position]===`
|
|
16
|
+
`&&position++,linestart=position,lineno++}function parseGeneric(){for(var result;position<length;){tokenStart();var chr=input[position++];return chr==='"'||chr==="'"&&json5?tokenEnd(parseString(chr),"literal"):chr==="{"?(tokenEnd(void 0,"separator"),parseObject()):chr==="["?(tokenEnd(void 0,"separator"),parseArray()):chr==="-"||chr==="."||isDecDigit(chr)||json5&&(chr==="+"||chr==="I"||chr==="N")?tokenEnd(parseNumber(),"literal"):chr==="n"?(parseKeyword("null"),tokenEnd(null,"literal")):chr==="t"?(parseKeyword("true"),tokenEnd(!0,"literal")):chr==="f"?(parseKeyword("false"),tokenEnd(!1,"literal")):(position--,tokenEnd(void 0))}}function parseKey(){for(var result;position<length;){tokenStart();var chr=input[position++];if(chr==='"'||chr==="'"&&json5)return tokenEnd(parseString(chr),"key");if(chr==="{")return tokenEnd(void 0,"separator"),parseObject();if(chr==="[")return tokenEnd(void 0,"separator"),parseArray();if(chr==="."||isDecDigit(chr))return tokenEnd(parseNumber(!0),"key");if(json5&&Uni.isIdentifierStart(chr)||chr==="\\"&&input[position]==="u"){var rollback=position-1,result=parseIdentifier();return result===void 0?(position=rollback,tokenEnd(void 0)):tokenEnd(result,"key")}else return position--,tokenEnd(void 0)}}function skipWhiteSpace(){for(tokenStart();position<length;){var chr=input[position++];if(isLineTerminator(chr))position--,tokenEnd(void 0,"whitespace"),tokenStart(),position++,newline(chr),tokenEnd(void 0,"newline"),tokenStart();else if(!isWhiteSpace(chr))if(chr==="/"&&json5&&(input[position]==="/"||input[position]==="*"))position--,tokenEnd(void 0,"whitespace"),tokenStart(),position++,skipComment(input[position++]==="*"),tokenEnd(void 0,"comment"),tokenStart();else{position--;break}}return tokenEnd(void 0,"whitespace")}function skipComment(multi){for(;position<length;){var chr=input[position++];if(isLineTerminator(chr)){if(!multi){position--;return}newline(chr)}else if(chr==="*"&&multi&&input[position]==="/"){position++;return}}multi&&fail("Unclosed multiline comment")}function parseKeyword(keyword){for(var _pos=position,len=keyword.length,i=1;i<len;i++)(position>=length||keyword[i]!=input[position])&&(position=_pos-1,fail()),position++}function parseObject(){for(var result=options.null_prototype?Object.create(null):{},empty_object={},is_non_empty=!1;position<length;){skipWhiteSpace();var item1=parseKey();skipWhiteSpace(),tokenStart();var chr=input[position++];if(tokenEnd(void 0,"separator"),chr==="}"&&item1===void 0)return!json5&&is_non_empty&&(position--,fail("Trailing comma in object")),result;if(chr===":"&&item1!==void 0){skipWhiteSpace(),stack.push(item1);var item2=parseGeneric();stack.pop(),item2===void 0&&fail("No value found for key "+item1),typeof item1!="string"&&(!json5||typeof item1!="number")&&fail("Wrong key type: "+item1),(item1 in empty_object||empty_object[item1]!=null)&&options.reserved_keys!=="replace"?options.reserved_keys==="throw"&&fail("Reserved key: "+item1):(typeof options.reviver=="function"&&(item2=options.reviver.call(null,item1,item2)),item2!==void 0&&(is_non_empty=!0,Object.defineProperty(result,item1,{value:item2,enumerable:!0,configurable:!0,writable:!0}))),skipWhiteSpace(),tokenStart();var chr=input[position++];if(tokenEnd(void 0,"separator"),chr===",")continue;if(chr==="}")return result;fail()}else position--,fail()}fail()}function parseArray(){for(var result=[];position<length;){skipWhiteSpace(),stack.push(result.length);var item=parseGeneric();stack.pop(),skipWhiteSpace(),tokenStart();var chr=input[position++];if(tokenEnd(void 0,"separator"),item!==void 0&&(typeof options.reviver=="function"&&(item=options.reviver.call(null,String(result.length),item)),item===void 0?(result.length++,item=!0):result.push(item)),chr===",")item===void 0&&fail("Elisions are not supported");else{if(chr==="]")return!json5&&item===void 0&&result.length&&(position--,fail("Trailing comma in array")),result;position--,fail()}}}function parseNumber(){position--;var start=position,chr=input[position++],t,to_num=function(is_octal2){var str=input.substr(start,position-start);if(is_octal2)var result=parseInt(str.replace(/^0o?/,""),8);else var result=Number(str);if(Number.isNaN(result))position--,fail('Bad numeric literal - "'+input.substr(start,position-start+1)+'"');else if(!json5&&!str.match(/^-?(0|[1-9][0-9]*)(\.[0-9]+)?(e[+-]?[0-9]+)?$/i))position--,fail('Non-json numeric literal - "'+input.substr(start,position-start+1)+'"');else return result};if((chr==="-"||chr==="+"&&json5)&&(chr=input[position++]),chr==="N"&&json5)return parseKeyword("NaN"),NaN;if(chr==="I"&&json5)return parseKeyword("Infinity"),to_num();if(chr>="1"&&chr<="9"){for(;position<length&&isDecDigit(input[position]);)position++;chr=input[position++]}if(chr==="0"){chr=input[position++];var is_octal=chr==="o"||chr==="O"||isOctDigit(chr),is_hex=chr==="x"||chr==="X";if(json5&&(is_octal||is_hex)){for(;position<length&&(is_hex?isHexDigit:isOctDigit)(input[position]);)position++;var sign=1;return input[start]==="-"?(sign=-1,start++):input[start]==="+"&&start++,sign*to_num(is_octal)}}if(chr==="."){for(;position<length&&isDecDigit(input[position]);)position++;chr=input[position++]}if(chr==="e"||chr==="E"){for(chr=input[position++],(chr==="-"||chr==="+")&&position++;position<length&&isDecDigit(input[position]);)position++;chr=input[position++]}return position--,to_num()}function parseIdentifier(){position--;for(var result="";position<length;){var chr=input[position++];if(chr==="\\"&&input[position]==="u"&&isHexDigit(input[position+1])&&isHexDigit(input[position+2])&&isHexDigit(input[position+3])&&isHexDigit(input[position+4])&&(chr=String.fromCharCode(parseInt(input.substr(position+1,4),16)),position+=5),result.length)if(Uni.isIdentifierPart(chr))result+=chr;else return position--,result;else if(Uni.isIdentifierStart(chr))result+=chr;else return}fail()}function parseString(endChar){for(var result="";position<length;){var chr=input[position++];if(chr===endChar)return result;if(chr==="\\")if(position>=length&&fail(),chr=input[position++],unescapeMap[chr]&&(json5||chr!="v"&&chr!="'"))result+=unescapeMap[chr];else if(json5&&isLineTerminator(chr))newline(chr);else if(chr==="u"||chr==="x"&&json5){for(var off=chr==="u"?4:2,i=0;i<off;i++)position>=length&&fail(),isHexDigit(input[position])||fail("Bad escape sequence"),position++;result+=String.fromCharCode(parseInt(input.substr(position-off,off),16))}else if(json5&&isOctDigit(chr)){if(chr<"4"&&isOctDigit(input[position])&&isOctDigit(input[position+1]))var digits=3;else if(isOctDigit(input[position]))var digits=2;else var digits=1;position+=digits-1,result+=String.fromCharCode(parseInt(input.substr(position-digits,digits),8))}else json5?result+=chr:(position--,fail());else isLineTerminator(chr)?fail():(!json5&&chr.charCodeAt(0)<32&&(position--,fail("Unexpected control character")),result+=chr)}fail()}skipWhiteSpace();var return_value=parseGeneric();if(return_value!==void 0||position<length){if(skipWhiteSpace(),position>=length)return typeof options.reviver=="function"&&(return_value=options.reviver.call(null,"",return_value)),return_value;fail()}else fail(position?"No data, only a whitespace":"No data, empty input")}module.exports.parse=function(input,options){if(typeof options=="function"&&(options={reviver:options}),input!==void 0){typeof input!="string"&&(input=String(input)),options==null&&(options={}),options.reserved_keys==null&&(options.reserved_keys="ignore"),(options.reserved_keys==="throw"||options.reserved_keys==="ignore")&&options.null_prototype==null&&(options.null_prototype=!0);try{return parse(input,options)}catch(err){if(err instanceof SyntaxError&&err.row!=null&&err.column!=null){var old_err=err;err=SyntaxError(old_err.message),err.column=old_err.column,err.row=old_err.row}throw err}}};module.exports.tokenize=function(input,options){options==null&&(options={}),options._tokenize=function(smth){options._addstack&&smth.stack.unshift.apply(smth.stack,options._addstack),tokens.push(smth)};var tokens=[];return tokens.data=module.exports.parse(input,options),tokens}}});var require_parse_json=__commonJS({"../../node_modules/.pnpm/parse-json@3.0.0/node_modules/parse-json/index.js"(exports,module){"use strict";var errorEx=require_error_ex(),fallback=require_parse();function appendPosition(message){let posRe=/ at (\d+:\d+) in/,numbers=posRe.exec(message);return message.replace(posRe," in")+":"+numbers[1]}var JSONError=errorEx("JSONError",{fileName:errorEx.append("in %s"),appendPosition:{message:(shouldAppend,original)=>(shouldAppend&&(original[0]=appendPosition(original[0])),original)}});module.exports=(input,reviver,filename)=>{typeof reviver=="string"&&(filename=reviver,reviver=null);try{try{return JSON.parse(input,reviver)}catch(err){throw fallback.parse(input,{mode:"json",reviver}),err}}catch(err){let jsonErr=new JSONError(err);throw filename&&(jsonErr.fileName=filename,jsonErr.appendPosition=!0),jsonErr}}}});var require_pify=__commonJS({"../../node_modules/.pnpm/pify@2.3.0/node_modules/pify/index.js"(exports,module){"use strict";var processFn=function(fn,P,opts){return function(){for(var that=this,args=new Array(arguments.length),i=0;i<arguments.length;i++)args[i]=arguments[i];return new P(function(resolve,reject){args.push(function(err,result){if(err)reject(err);else if(opts.multiArgs){for(var results=new Array(arguments.length-1),i2=1;i2<arguments.length;i2++)results[i2-1]=arguments[i2];resolve(results)}else resolve(result)}),fn.apply(that,args)})}},pify=module.exports=function(obj,P,opts){typeof P!="function"&&(opts=P,P=Promise),opts=opts||{},opts.exclude=opts.exclude||[/.+Sync$/];var filter=function(key){var match=function(pattern){return typeof pattern=="string"?key===pattern:pattern.test(key)};return opts.include?opts.include.some(match):!opts.exclude.some(match)},ret=typeof obj=="function"?function(){return opts.excludeMain?obj.apply(this,arguments):processFn(obj,P,opts).apply(this,arguments)}:{};return Object.keys(obj).reduce(function(ret2,key){var x=obj[key];return ret2[key]=typeof x=="function"&&filter(key)?processFn(x,P,opts):x,ret2},ret)};pify.all=pify}});var require_load_json_file=__commonJS({"../../node_modules/.pnpm/load-json-file@3.0.0/node_modules/load-json-file/index.js"(exports,module){"use strict";var path=__require("path"),fs=require_graceful_fs(),stripBom=require_strip_bom(),parseJson=require_parse_json(),pify=require_pify(),parse=(data,fp)=>parseJson(stripBom(data),path.relative(".",fp));module.exports=fp=>pify(fs.readFile)(fp,"utf8").then(data=>parse(data,fp));module.exports.sync=fp=>parse(fs.readFileSync(fp,"utf8"),fp)}});export{require_pify,require_load_json_file};
|