vercel 65.1.0 → 65.3.1
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-5YZQTIQM.js +8 -0
- package/dist/chunks/add-A524QQ2H.js +8 -0
- package/dist/chunks/add-V4JMUHKO.js +8 -0
- package/dist/chunks/build-K2PVDJZ4.js +7 -0
- package/dist/chunks/{chunk-DRT6ITIC.js → chunk-22FDWPWY.js} +1 -1
- package/dist/chunks/{chunk-SSULKPUE.js → chunk-2ACMWVTB.js} +1 -1
- package/dist/chunks/{chunk-F2LZJWGH.js → chunk-2H3SB5RP.js} +1 -1
- package/dist/chunks/{chunk-DQYCNHTR.js → chunk-2U7DJZSQ.js} +1 -1
- package/dist/chunks/{chunk-H2FI64HG.js → chunk-2WYYGGEO.js} +1 -1
- package/dist/chunks/{chunk-572TYS62.js → chunk-3ADDGPEN.js} +1 -1
- package/dist/chunks/{chunk-PRAWMNTU.js → chunk-3AYYFYZG.js} +1 -1
- package/dist/chunks/{chunk-F5QCUTBE.js → chunk-3JGBBS6V.js} +1 -1
- package/dist/chunks/{chunk-YEYZP3IH.js → chunk-3KKFLKQG.js} +1 -1
- package/dist/chunks/{chunk-S3QPCSQR.js → chunk-43GBAKL2.js} +1 -1
- package/dist/chunks/{chunk-5A46JI25.js → chunk-4UGHFESV.js} +1 -1
- package/dist/chunks/{chunk-IZWASLQ6.js → chunk-5IASAERQ.js} +1 -1
- package/dist/chunks/{chunk-FDAMQA44.js → chunk-6ISAISGD.js} +1 -1
- package/dist/chunks/{chunk-Y5RR6CRP.js → chunk-6KVHNQW4.js} +2 -2
- package/dist/chunks/{chunk-PXGJGWVA.js → chunk-76KGQU2G.js} +1 -1
- package/dist/chunks/{chunk-6HEPFWGT.js → chunk-76SVVWPH.js} +1 -1
- package/dist/chunks/{chunk-IC27IY7N.js → chunk-7BGKE3JW.js} +1 -1
- package/dist/chunks/chunk-7HV7O6DM.js +7 -0
- package/dist/chunks/{chunk-CVDK3IYT.js → chunk-7L2K4OKM.js} +1 -1
- package/dist/chunks/{chunk-3PMDNDOO.js → chunk-7Y46LB43.js} +1 -1
- package/dist/chunks/{chunk-CBXS6UFD.js → chunk-7Z3WUAO5.js} +1 -1
- package/dist/chunks/{chunk-4YDPE5DC.js → chunk-ABZEMNDR.js} +1 -1
- package/dist/chunks/{chunk-JB7ZP4L4.js → chunk-APZULWJC.js} +1 -1
- package/dist/chunks/chunk-AWMQGOS2.js +7 -0
- package/dist/chunks/{chunk-VWIHFPW2.js → chunk-B4UE4LVE.js} +1 -1
- package/dist/chunks/{chunk-JBUFVCTP.js → chunk-BBKEP7RO.js} +1 -1
- package/dist/chunks/{chunk-FQ5EU3ML.js → chunk-BL3HBRF6.js} +1 -1
- package/dist/chunks/{chunk-5Q7PEC6C.js → chunk-CEMPU323.js} +1 -1
- package/dist/chunks/{chunk-KINNDNJ3.js → chunk-COM5YCHF.js} +1 -1
- package/dist/chunks/{chunk-6KF43YYP.js → chunk-D2BZMGHP.js} +1 -1
- package/dist/chunks/{chunk-GENXRXFN.js → chunk-DGYHWXD2.js} +1 -1
- package/dist/chunks/{chunk-DWJRJK7I.js → chunk-DUT4U5YY.js} +1 -1
- package/dist/chunks/{chunk-Y3J6UDPB.js → chunk-E2SADN6I.js} +1 -1
- package/dist/chunks/{chunk-E432NQGO.js → chunk-E6CO6TUM.js} +1 -1
- package/dist/chunks/{chunk-CKZLNL5F.js → chunk-F2SWJEYV.js} +1 -1
- package/dist/chunks/{chunk-W6RCABNS.js → chunk-FDNYYENK.js} +1 -1
- package/dist/chunks/{chunk-6RCYHBTM.js → chunk-G4T7VBGN.js} +1 -1
- package/dist/chunks/chunk-GG5RME4X.js +7 -0
- package/dist/chunks/{chunk-SDDKXGMK.js → chunk-GVTXA6HG.js} +1 -1
- package/dist/chunks/chunk-GYVJIIYL.js +7 -0
- package/dist/chunks/{chunk-MTTYJO4W.js → chunk-IA3MXJRC.js} +1 -1
- package/dist/chunks/{chunk-THRWLZ3N.js → chunk-IEPW2YRH.js} +1 -1
- package/dist/chunks/{chunk-4B45V3VM.js → chunk-IGDG5CWT.js} +1 -1
- package/dist/chunks/{chunk-FDYDTFFM.js → chunk-IKQTP764.js} +1 -1
- package/dist/chunks/{chunk-VT3QK5IV.js → chunk-IUXSJWL3.js} +1 -1
- package/dist/chunks/{chunk-IWVEHRIU.js → chunk-IVSC7ZFJ.js} +1 -1
- package/dist/chunks/{chunk-HBLBUOZ7.js → chunk-KH6565YH.js} +1 -1
- package/dist/chunks/{chunk-5WTGQDJ7.js → chunk-KNLGWGUE.js} +6 -6
- package/dist/chunks/{chunk-6A4CDEBQ.js → chunk-L4NSF346.js} +1 -1
- package/dist/chunks/{chunk-KKRTKV62.js → chunk-LCHECISY.js} +1 -1
- package/dist/chunks/chunk-LJBUJ23M.js +7 -0
- package/dist/chunks/{chunk-CV333GGZ.js → chunk-LKLH6DZP.js} +1 -1
- package/dist/chunks/{chunk-YJXE7NJC.js → chunk-LRYGNQ6C.js} +1 -1
- package/dist/chunks/{chunk-PA2A2V5Y.js → chunk-LT3UK4K6.js} +1 -1
- package/dist/chunks/{chunk-NHRZRW54.js → chunk-LUBUI5GF.js} +1 -1
- package/dist/chunks/{chunk-L3T6AEPG.js → chunk-NEFDNROD.js} +1 -1
- package/dist/chunks/{chunk-EKLONFSU.js → chunk-NQWGRKF4.js} +1 -1
- package/dist/chunks/{chunk-CGSHQ7QM.js → chunk-NTZ5WWYV.js} +1 -1
- package/dist/chunks/{chunk-NFEG7ONP.js → chunk-OCQPXOTX.js} +1 -1
- package/dist/chunks/{chunk-WFAZDFAR.js → chunk-OGPENBY2.js} +1 -1
- package/dist/chunks/{chunk-JXLPHMKT.js → chunk-OKEBIUKZ.js} +1 -1
- package/dist/chunks/{chunk-4CKX6KUQ.js → chunk-OMCGXRSA.js} +4 -4
- package/dist/chunks/{chunk-J52VRTEQ.js → chunk-OQCMRU3J.js} +2 -2
- package/dist/chunks/{chunk-HO6ECDO3.js → chunk-OQPXJCMK.js} +1 -1
- package/dist/chunks/{chunk-MG7CRSO5.js → chunk-OWOWPOIE.js} +1 -1
- package/dist/chunks/{chunk-PDY2YXG7.js → chunk-PFNYWWLI.js} +1 -1
- package/dist/chunks/{chunk-UYOFNAH5.js → chunk-PFPJLIFF.js} +1 -1
- package/dist/chunks/{chunk-PCLWLNZC.js → chunk-Q5ODLDCU.js} +1 -1
- package/dist/chunks/{chunk-GENZ5QV5.js → chunk-QB7F3UAP.js} +1 -1
- package/dist/chunks/{chunk-AMUAIMYY.js → chunk-QMCHGGDX.js} +2 -2
- package/dist/chunks/{chunk-I26SSWTS.js → chunk-QZX7VG2V.js} +1 -1
- package/dist/chunks/{chunk-W4FODG6F.js → chunk-RRREFECI.js} +1 -1
- package/dist/chunks/{chunk-VPH6RJ5P.js → chunk-RUXO73ON.js} +1 -1
- package/dist/chunks/chunk-RW3X523R.js +8 -0
- package/dist/chunks/{chunk-FGEWQYON.js → chunk-S4SJ7GIZ.js} +1 -1
- package/dist/chunks/{chunk-3V6MUBCO.js → chunk-S5IWVPYT.js} +1 -1
- package/dist/chunks/{chunk-M5WBBJRW.js → chunk-SKYDLHEZ.js} +1 -1
- package/dist/chunks/{chunk-PBC276AK.js → chunk-SXOSF4O6.js} +1 -1
- package/dist/chunks/chunk-TO5PJDEN.js +7 -0
- package/dist/chunks/chunk-TPNOSQZ3.js +15 -0
- package/dist/chunks/{chunk-JP2W5MLV.js → chunk-TZFDVQ72.js} +1 -1
- package/dist/chunks/{chunk-CWQJK5IX.js → chunk-UJSW56GS.js} +1 -1
- package/dist/chunks/{chunk-XRRGT7CM.js → chunk-UKQMYTWW.js} +1 -1
- package/dist/chunks/{chunk-CS532HK4.js → chunk-ULHNMQ7C.js} +1 -1
- package/dist/chunks/{chunk-JY4EKLND.js → chunk-UNEGQPD3.js} +1 -1
- package/dist/chunks/{chunk-J2RX4B5S.js → chunk-URPEIX6M.js} +1 -1
- package/dist/chunks/chunk-V7BEC3E4.js +10 -0
- package/dist/chunks/{chunk-PWNCGM6A.js → chunk-VMMMBWD3.js} +1 -1
- package/dist/chunks/chunk-VOCZ34ON.js +7 -0
- package/dist/chunks/chunk-VQSLPYAF.js +7 -0
- package/dist/chunks/chunk-VT6RIZJH.js +7 -0
- package/dist/chunks/{chunk-PF6O7LHL.js → chunk-WBF36MYT.js} +1 -1
- package/dist/chunks/{chunk-K4AZWWRJ.js → chunk-WCWP4GBR.js} +1 -1
- package/dist/chunks/{chunk-VG2AJII6.js → chunk-WGXKX24Q.js} +1 -1
- package/dist/chunks/{chunk-YPKKC232.js → chunk-X4762EE4.js} +1 -1
- package/dist/chunks/{chunk-IPZHE3OU.js → chunk-XB4SKARZ.js} +1 -1
- package/dist/chunks/{chunk-L3FAM6KS.js → chunk-XXXRTHTP.js} +1 -1
- package/dist/chunks/{chunk-7MQHQTCJ.js → chunk-XZV4BFM5.js} +1 -1
- package/dist/chunks/{chunk-RX2VZBEZ.js → chunk-Y6AGOERS.js} +1 -1
- package/dist/chunks/{chunk-ZPXMOZ4S.js → chunk-YHQ7PPXP.js} +1 -1
- package/dist/chunks/{chunk-QWE7OFE7.js → chunk-YK7XLFU2.js} +1 -1
- package/dist/chunks/{chunk-ESCYLPN6.js → chunk-YN3C5BL5.js} +1 -1
- package/dist/chunks/{chunk-L6TM45P4.js → chunk-ZH6KHD55.js} +2 -2
- package/dist/chunks/clear-ZS4KQ7OT.js +8 -0
- package/dist/chunks/compile-vercel-config-3IYM2CHC.js +7 -0
- package/dist/chunks/config-N2SBVW4T.js +8 -0
- package/dist/chunks/config-ZFIC7N4D.js +7 -0
- package/dist/chunks/config-validator.mjs +1 -1
- package/dist/chunks/delete-2ZE2NVHI.js +10 -0
- package/dist/chunks/delete-AL57HZDQ.js +9 -0
- package/dist/chunks/{detect-projects-NLAYKNQX.js → detect-projects-OD4JEAW2.js} +1 -1
- package/dist/chunks/detect-services-MOXTX5XG.js +7 -0
- package/dist/chunks/disable-MKI3BKNH.js +7 -0
- package/dist/chunks/discard-SI4H7ST3.js +14 -0
- package/dist/chunks/edit-DNWH6SPE.js +8 -0
- package/dist/chunks/edit-WYNWDFUJ.js +9 -0
- package/dist/chunks/enable-J6MMYPYF.js +7 -0
- package/dist/chunks/{export-5G7MAWTT.js → export-MHSH7QCX.js} +1 -1
- package/dist/chunks/{select-org-IAA5ZTIS.js → future-FFOGTKMF.js} +1 -1
- package/dist/chunks/generate-cert-for-deploy-YZKNGAEQ.js +7 -0
- package/dist/chunks/image-7METSS6F.js +7 -0
- package/dist/chunks/import-builders-GM2SERWV.js +7 -0
- package/dist/chunks/{inspect-5PNUHNL2.js → inspect-A7WJQQZO.js} +1 -1
- package/dist/chunks/{inspect-BNOMQCB4.js → inspect-DI434TAM.js} +1 -1
- package/dist/chunks/inspect-H2Q7XOWN.js +13 -0
- package/dist/chunks/inspect-H5JC2XKI.js +9 -0
- package/dist/chunks/{inspect-NWAB6AGM.js → inspect-IAWVHJXQ.js} +1 -1
- package/dist/chunks/list-ELEUTZWJ.js +12 -0
- package/dist/chunks/{list-3Q5CBGFH.js → list-INRPH25K.js} +1 -1
- package/dist/chunks/{list-JF2OEQON.js → list-WWU734RK.js} +1 -1
- package/dist/chunks/login-R5NQRPQC.js +7 -0
- package/dist/chunks/login-ZF2TLCQB.js +9 -0
- package/dist/chunks/logs-UD7FEXZ7.js +7 -0
- package/dist/chunks/ls-5ZEAKKPQ.js +8 -0
- package/dist/chunks/ls-IXRLAJ4L.js +11 -0
- package/dist/chunks/{ls-GCFLDDFZ.js → ls-LIGIBVAT.js} +1 -1
- package/dist/chunks/{ls-MERY5XTJ.js → ls-MCQ2NS65.js} +1 -1
- package/dist/chunks/{ls-RO7VUFMS.js → ls-S5E2NQMI.js} +1 -1
- package/dist/chunks/{ls-DVHKDVJJ.js → ls-V2ZSIVO3.js} +1 -1
- package/dist/chunks/{ls-RWBJBEIJ.js → ls-VXH4QYF5.js} +1 -1
- package/dist/chunks/mutate-OQWOKLIW.js +9 -0
- package/dist/chunks/notifications-KFZ333V5.js +7 -0
- package/dist/chunks/open-HH6K7ZRC.js +7 -0
- package/dist/chunks/openapi-JGYEFJJV.js +7 -0
- package/dist/chunks/permissions-ZSHKMXBZ.js +7 -0
- package/dist/chunks/{plugin-offer-E4DLD4HU.js → plugin-offer-Z6FCPQFD.js} +1 -1
- package/dist/chunks/prompt-missing-credentials-KOA7C4QC.js +7 -0
- package/dist/chunks/publish-FPNQ2US4.js +15 -0
- package/dist/chunks/pull-7OGOIKB3.js +7 -0
- package/dist/chunks/purchase-domain-if-available-F4LKHVBD.js +7 -0
- package/dist/chunks/push-NY3SIK2C.js +7 -0
- package/dist/chunks/{query-RW2DLTO5.js → query-JGPO7TNY.js} +1 -1
- package/dist/chunks/reauthenticate-OZRQFR66.js +7 -0
- package/dist/chunks/reorder-4J2STFUS.js +10 -0
- package/dist/chunks/reply-EO4NTTPW.js +9 -0
- package/dist/chunks/resolve-RPHHRPNM.js +12 -0
- package/dist/chunks/resolve-agent-team-KX77HEAF.js +7 -0
- package/dist/chunks/restore-TEA6TSVK.js +16 -0
- package/dist/chunks/rm-BPILSPUI.js +8 -0
- package/dist/chunks/rm-F6XVUDBM.js +8 -0
- package/dist/chunks/rm-JCPXV2FN.js +8 -0
- package/dist/chunks/rm-LPQRGX7N.js +8 -0
- package/dist/chunks/rm-WHUGT6TE.js +8 -0
- package/dist/chunks/{routes-KHBSGELO.js → routes-P6LKQCWH.js} +1 -1
- package/dist/chunks/rule-inspect-BOETGPFO.js +8 -0
- package/dist/chunks/{schema-JCJF3AUI.js → schema-BEUO7G52.js} +1 -1
- package/dist/chunks/schema-YOEAK4VX.js +14 -0
- package/dist/chunks/select-org-OMLGQEKK.js +7 -0
- package/dist/chunks/set-5XY27S7R.js +7 -0
- package/dist/chunks/setup-and-link-A7M3QT52.js +7 -0
- package/dist/chunks/{skills-U52S6GRY.js → skills-4J2NC2QI.js} +2 -2
- package/dist/chunks/tags-ZXZQEXOV.js +7 -0
- package/dist/chunks/{types-LKCU7WSY.js → types-SK6J2HFE.js} +1 -1
- package/dist/chunks/{update-DUSQP2H7.js → update-25CKNOY5.js} +1 -1
- package/dist/commands/build/index.js +1 -1
- package/dist/commands/deploy/index.js +5 -5
- package/dist/commands/dev/index.js +7 -7
- package/dist/commands/env/index.js +2 -2
- package/dist/commands/link/index.js +1 -1
- package/dist/commands/list/index.js +1 -1
- package/dist/commands/project/index.js +2 -2
- package/dist/commands-account.js +82 -58
- package/dist/commands-ai.js +3 -3
- package/dist/commands-blob.js +2 -2
- package/dist/commands-core.js +8 -8
- package/dist/commands-deployments.js +2 -2
- package/dist/commands-flags.js +14 -14
- package/dist/commands-integrations.js +4 -4
- package/dist/commands-observability.js +38 -9
- package/dist/commands-routing.js +9 -9
- package/dist/index.js +4 -4
- package/dist/internal-build.js +1 -1
- package/dist/root-help-commands.mjs +1 -1
- package/dist/vc.js +95 -5
- package/dist/version.mjs +1 -1
- package/package.json +58 -56
- package/dist/chunks/add-G44L5OSZ.js +0 -8
- package/dist/chunks/add-JATTZAMX.js +0 -8
- package/dist/chunks/add-QMLQDEWM.js +0 -8
- package/dist/chunks/build-ODRPV34E.js +0 -7
- package/dist/chunks/chunk-2N5LDFMR.js +0 -10
- package/dist/chunks/chunk-64XCYUH7.js +0 -7
- package/dist/chunks/chunk-67NIX52O.js +0 -7
- package/dist/chunks/chunk-6CXJXQ6W.js +0 -8
- package/dist/chunks/chunk-D3M2JG5C.js +0 -7
- package/dist/chunks/chunk-DHYND2QH.js +0 -7
- package/dist/chunks/chunk-K246KRFS.js +0 -7
- package/dist/chunks/chunk-NFUAFRIC.js +0 -7
- package/dist/chunks/chunk-NNH2H4LZ.js +0 -15
- package/dist/chunks/chunk-QO7CBCML.js +0 -7
- package/dist/chunks/chunk-WSD53RLA.js +0 -7
- package/dist/chunks/clear-REFHHJJB.js +0 -8
- package/dist/chunks/compile-vercel-config-Q7JGV2RD.js +0 -7
- package/dist/chunks/config-DQ23X4AJ.js +0 -7
- package/dist/chunks/config-GKMT3G67.js +0 -8
- package/dist/chunks/delete-5H7AMGTE.js +0 -10
- package/dist/chunks/delete-MIDLGXPG.js +0 -9
- package/dist/chunks/detect-services-CNIBYXAN.js +0 -7
- package/dist/chunks/disable-45GKGBKT.js +0 -7
- package/dist/chunks/discard-ZHC6DXON.js +0 -14
- package/dist/chunks/edit-N6D2VXVA.js +0 -9
- package/dist/chunks/edit-TVSUOODD.js +0 -8
- package/dist/chunks/enable-SXFQAYFU.js +0 -7
- package/dist/chunks/future-3BZKO5JV.js +0 -7
- package/dist/chunks/generate-cert-for-deploy-YAJHY6TW.js +0 -7
- package/dist/chunks/image-W5TWCF3B.js +0 -7
- package/dist/chunks/import-builders-PK2EHZ43.js +0 -7
- package/dist/chunks/inspect-IS5SYBTI.js +0 -9
- package/dist/chunks/inspect-O5IKZFOG.js +0 -13
- package/dist/chunks/list-OVHNSNGA.js +0 -12
- package/dist/chunks/login-3BXNN3JH.js +0 -7
- package/dist/chunks/login-5FKYBEVP.js +0 -9
- package/dist/chunks/logs-ALPOUQZZ.js +0 -7
- package/dist/chunks/ls-4WMW65WV.js +0 -8
- package/dist/chunks/ls-YOXQDZ7X.js +0 -11
- package/dist/chunks/mutate-TGIOOZVQ.js +0 -9
- package/dist/chunks/notifications-J24CW3SD.js +0 -7
- package/dist/chunks/open-5U4GN2S4.js +0 -7
- package/dist/chunks/openapi-CZCUACZA.js +0 -7
- package/dist/chunks/permissions-B2RJ4FS6.js +0 -7
- package/dist/chunks/prompt-missing-credentials-WWEM2TVX.js +0 -7
- package/dist/chunks/publish-BK3BK3PV.js +0 -15
- package/dist/chunks/pull-CSFLO6P5.js +0 -7
- package/dist/chunks/purchase-domain-if-available-7VAJB3SY.js +0 -7
- package/dist/chunks/push-ENXU4VFN.js +0 -7
- package/dist/chunks/reauthenticate-QKPBNAAH.js +0 -7
- package/dist/chunks/reorder-XXOCBKOR.js +0 -10
- package/dist/chunks/reply-IJ4UMSYT.js +0 -9
- package/dist/chunks/resolve-FHUXU6TQ.js +0 -12
- package/dist/chunks/resolve-agent-team-3432OTOK.js +0 -7
- package/dist/chunks/restore-V2KCZWP3.js +0 -16
- package/dist/chunks/rm-5CDEDJXM.js +0 -8
- package/dist/chunks/rm-FN3G7ARM.js +0 -8
- package/dist/chunks/rm-MPREW2CR.js +0 -8
- package/dist/chunks/rm-VDEXQXNO.js +0 -8
- package/dist/chunks/rm-XUEOPXWC.js +0 -8
- package/dist/chunks/rule-inspect-27A23NWG.js +0 -8
- package/dist/chunks/schema-CE2N7SZP.js +0 -14
- package/dist/chunks/set-YP4JEPJQ.js +0 -7
- package/dist/chunks/setup-and-link-HS4GH2QQ.js +0 -7
- package/dist/chunks/tags-7WRBB2U4.js +0 -7
|
@@ -4,4 +4,4 @@ import { dirname as __dirname_ } from 'node:path';
|
|
|
4
4
|
const require = __createRequire(import.meta.url);
|
|
5
5
|
const __filename = __fileURLToPath(import.meta.url);
|
|
6
6
|
const __dirname = __dirname_(__filename);
|
|
7
|
-
import{environmentOption,formatOption,jsonOption,projectOption,sinceOption,untilOption}from"./chunk-
|
|
7
|
+
import{environmentOption,formatOption,jsonOption,projectOption,sinceOption,untilOption}from"./chunk-AWMQGOS2.js";import{packageName}from"./chunk-JESNVRVR.js";var schemaSubcommand={name:"schema",aliases:[],description:"List available metrics or inspect a specific metric.",arguments:[{name:"metric-or-prefix",required:!1}],options:[formatOption,jsonOption],examples:[{name:"List all metrics",value:`${packageName} metrics schema`},{name:"Show metric details",value:`${packageName} metrics schema vercel.function_invocation`},{name:"Schema as JSON for agents",value:`${packageName} metrics schema vercel.request.count --json`}]},metricsCommand={name:"metrics",aliases:[],description:"Query observability metrics for your Vercel project or team.",arguments:[{name:"metric-id",required:!1}],subcommands:[{name:"query",aliases:[],description:"",default:!0,hidden:!0,arguments:[],options:[],examples:[]},schemaSubcommand],options:[{name:"aggregation",shorthand:null,deprecatedShorthand:"a",type:String,deprecated:!1,description:"Aggregation function (default: sum for counts/bytes/currency, avg for durations/memory/ratios)",argument:"FN"},{name:"group-by",shorthand:null,type:[String],deprecated:!1,description:"Dimensions to group by (repeatable)",argument:"DIM"},{name:"limit",shorthand:null,deprecatedShorthand:"l",type:Number,deprecated:!1,description:"Max groups per time bucket (default: 10)",argument:"N"},{name:"order-by",shorthand:null,type:String,deprecated:!1,description:"Order grouped results by value or count (default: count, or value when count is unsupported)",argument:"value|count"},{name:"order",shorthand:null,type:String,deprecated:!1,description:"Order direction for grouped results: asc or desc (default: desc)",argument:"asc|desc"},{name:"filter",shorthand:null,deprecatedShorthand:"f",type:[String],deprecated:!1,get description(){return process.env.FF_LEGACY_METRICS?"OData filter expression (repeatable, ANDed together)":"KQL filter expression (repeatable, ANDed together)"},argument:"EXPR"},{...environmentOption,description:"Limit the query to one environment, such as production or preview"},{name:"prod",shorthand:null,type:Boolean,deprecated:!0,description:"Deprecated alias for `--environment production`"},{...sinceOption,description:`${sinceOption.description} (default: 1h ago)`},untilOption,{name:"granularity",shorthand:null,deprecatedShorthand:"g",type:String,deprecated:!1,description:"Time bucket size: 5m, 15m, 1h, 1d (default: auto)",argument:"SIZE"},{name:"bucket-timezone",shorthand:null,type:String,deprecated:!1,description:"IANA timezone for calendar bucket alignment only; does not shift --since/--until or output timestamps (e.g., Europe/Paris)",argument:"ZONE"},{...projectOption,shorthand:"p"},{name:"all",shorthand:null,type:Boolean,deprecated:!1,description:"Query across all projects for the team"},formatOption,jsonOption],get examples(){let canonical=!process.env.FF_LEGACY_METRICS,httpStatus=canonical?"httpStatus":"http_status",errorCode=canonical?"errorCode":"error_code",aiProvider=canonical?"aiProvider":"ai_provider",aiGatewayCostMetric=canonical?"vercel.ai_gateway.request.cost":"vercel.ai_gateway_request.cost",pageViewMetric=canonical?"vercel.analytics.page_view.count":"vercel.analytics_pageview.count",visitorId=canonical?"visitorId":"visitor_id",projectId=canonical?"projectId":"project_id",statusFilter=canonical?"httpStatus >= 500":"http_status ge 500",routeFilter=canonical?`'route:"/api"'`:`"contains(request_path, '/api')"`;return[{name:"5xx errors by error code in the last hour",value:`${packageName} metrics vercel.function_invocation.count --filter "${statusFilter}" --group-by ${errorCode} --since 1h`},{name:"Function invocations by HTTP status code",value:`${packageName} metrics vercel.function_invocation.count --group-by ${httpStatus} --since 6h`},{name:"Function duration by route",value:`${packageName} metrics vercel.function_invocation.function_duration_ms --aggregation avg --group-by route --since 1h`},{name:"AI Gateway costs by provider",value:`${packageName} metrics ${aiGatewayCostMetric} --aggregation sum --group-by ${aiProvider} --since 7d`},{name:"Core Web Vitals (LCP) by route",value:`${packageName} metrics vercel.speed_insights.lcp_ms --aggregation p75 --environment production --group-by route --since 7d`},{name:"Routes with the lowest p75 LCP",value:`${packageName} metrics vercel.speed_insights.lcp_ms --aggregation p75 --environment production --group-by route --since 7d --order-by value --order asc`},{name:canonical?"Daily pageviews":"Daily pageviews with a Paris-aligned bucket",value:canonical?`${packageName} metrics ${pageViewMetric} --since 7d --granularity 1d`:`${packageName} metrics ${pageViewMetric} --since 7d --granularity 1d --bucket-timezone Europe/Paris`},{name:"Visitors time series from the top 5 countries",value:`${packageName} metrics ${pageViewMetric} --aggregation unique/${visitorId} --group-by country --since 1d --granularity 1h --limit 5`},{name:"List available metrics",value:`${packageName} metrics schema`},{name:"Function executions matching an API route",value:`${packageName} metrics vercel.function_invocation.count --filter ${routeFilter} --group-by route --since 1h`},{name:"Function executions matching multiple filters",value:`${packageName} metrics vercel.function_invocation.count --filter "${statusFilter}" --filter ${routeFilter} --since 1h`},{name:"Show schema for a metric prefix",value:`${packageName} metrics schema vercel.request`},{name:"Team-wide function executions by project",value:`${packageName} metrics --all vercel.function_invocation.count --group-by ${projectId} --since 24h`}]}};export{schemaSubcommand,metricsCommand};
|
|
@@ -4,4 +4,4 @@ import { dirname as __dirname_ } from 'node:path';
|
|
|
4
4
|
const require = __createRequire(import.meta.url);
|
|
5
5
|
const __filename = __fileURLToPath(import.meta.url);
|
|
6
6
|
const __dirname = __dirname_(__filename);
|
|
7
|
-
import{emitAlertsScopeError,resolveAlertsScope}from"./chunk-
|
|
7
|
+
import{emitAlertsScopeError,resolveAlertsScope}from"./chunk-2WYYGGEO.js";import{handleValidationError,validateAllProjectMutualExclusivity}from"./chunk-RW3X523R.js";import{getScope}from"./chunk-B4UE4LVE.js";import{AGENT_REASON,buildCommandWithGlobalFlags,outputAgentError}from"./chunk-DGYHWXD2.js";import{getProjectByNameOrId}from"./chunk-KNLGWGUE.js";import{ProjectNotFound,isAPIError}from"./chunk-6VH56CX2.js";async function resolveRulesTeam(client,jsonOutput){let scope;try{scope=await getScope(client,{resolveLocalScope:!0})}catch(err){if(isAPIError(err)&&(err.status===403||err.status===404))return emitAlertsScopeError(client,jsonOutput,err.code||"API_ERROR",err.serverMessage||`API error (${err.status}).`,{reason:AGENT_REASON.MISSING_SCOPE,hint:"The selected team could not be loaded. Select a team you can access, or pass --scope <team-slug>.",next:[{command:buildCommandWithGlobalFlags(client.argv,"teams switch"),when:"Select a team"},{command:buildCommandWithGlobalFlags(client.argv,"whoami"),when:"Inspect the current scope"}]});throw err}let{team}=scope;return team?{teamId:team.id}:emitAlertsScopeError(client,jsonOutput,"NO_TEAM","No team context found. Run `vercel switch` to select a team, use `--scope <team>`, or link a team project.",{reason:AGENT_REASON.MISSING_SCOPE,hint:"Monitors belong to a team. Select the team before retrying.",next:[{command:buildCommandWithGlobalFlags(client.argv,"teams switch"),when:"Select a team"},{command:buildCommandWithGlobalFlags(client.argv,"whoami"),when:"Inspect the current scope"}]})}async function resolveRulesProject(client,projectNameOrId,jsonOutput,command){let teamScope=await resolveRulesTeam(client,jsonOutput);if(typeof teamScope=="number")return teamScope;try{let project=await getProjectByNameOrId(client,projectNameOrId,teamScope.teamId);return project instanceof ProjectNotFound?emitAlertsScopeError(client,jsonOutput,"PROJECT_NOT_FOUND",`Project "${projectNameOrId}" was not found in the selected team.`,{reason:AGENT_REASON.NOT_FOUND,next:[{command:buildCommandWithGlobalFlags(client.argv,`${command} --project <name_or_id>`),when:"Retry with a valid project"}]}):{...teamScope,projectId:project.id,projectName:project.name}}catch(error){if(!isAPIError(error))throw error;return emitAlertsScopeError(client,jsonOutput,error.code||"API_ERROR",error.serverMessage||`API error (${error.status}).`,{reason:error.status===401?"not_authorized":error.status===403?"forbidden":AGENT_REASON.API_ERROR})}}async function parseRulesFlagsAndScope(client,flags,jsonOutput,command="monitors ls"){let mutual=validateAllProjectMutualExclusivity(flags["--all"],flags["--project"]);if(!mutual.valid)return outputAgentError(client,{status:"error",reason:AGENT_REASON.INVALID_ARGUMENTS,message:mutual.message,next:[{command:buildCommandWithGlobalFlags(client.argv,"monitors --help"),when:"Use either `--project` or `--all`, not both"}]},2),handleValidationError(mutual,jsonOutput,client);if(flags["--all"])return resolveRulesTeam(client,jsonOutput);if(flags["--project"])return resolveRulesProject(client,flags["--project"],jsonOutput,command);let linkedScope=await resolveAlertsScope(client,{jsonOutput,command});if(typeof linkedScope=="number")return linkedScope;let teamScope=await resolveRulesTeam(client,jsonOutput);return typeof teamScope=="number"?teamScope:linkedScope.teamId===teamScope.teamId?linkedScope:teamScope}export{resolveRulesTeam,resolveRulesProject,parseRulesFlagsAndScope};
|
|
@@ -4,5 +4,5 @@ import { dirname as __dirname_ } from 'node:path';
|
|
|
4
4
|
const require = __createRequire(import.meta.url);
|
|
5
5
|
const __filename = __fileURLToPath(import.meta.url);
|
|
6
6
|
const __dirname = __dirname_(__filename);
|
|
7
|
-
import{sleep}from"./chunk-
|
|
7
|
+
import{sleep}from"./chunk-KNLGWGUE.js";import{output_manager_default}from"./chunk-XP3FT56R.js";import{require_source}from"./chunk-NB2WLB3J.js";import{__toESM}from"./chunk-BZENIQ7N.js";var import_chalk=__toESM(require_source(),1);async function createDeploymentProtectionToken(client,projectId,orgId){if(!client.authConfig.token)throw output_manager_default.debug("No auth token available, skipping deployment protection token"),new Error("Authentication required to create protection bypass token");try{let response=await client.fetch(`/v1/projects/${projectId}/protection-bypass`,{method:"PATCH",body:"{}",headers:{"Content-Type":"application/json"},accountId:orgId}),{protectionBypass}=response;return output_manager_default.log("You require a deployment protection bypass token to access this deployment... Generating one now..."),output_manager_default.log(`Successfully generated deployment protection bypass token for project ${import_chalk.default.bold(projectId)}
|
|
8
8
|
`),output_manager_default.debug(`Protection Bypass Response: ${protectionBypass}`),await sleep(1e3),getAutomationBypassToken(protectionBypass)}catch(error){throw output_manager_default.debug(`Failed to generate deployment protection bypass token: ${error}`),output_manager_default.note('To bypass deployment protection, create a "Protection Bypass for Automation" secret in your project settings:'),output_manager_default.log(` 1. Visit ${import_chalk.default.cyan("https://vercel.com/dashboard")}`),output_manager_default.log(" 2. Go to your project settings \u2192 Deployment Protection"),output_manager_default.log(' 3. Generate a "Protection Bypass for Automation" secret'),output_manager_default.log(` 4. Use it with ${import_chalk.default.cyan("--protection-bypass")} flag or set ${import_chalk.default.cyan("VERCEL_AUTOMATION_BYPASS_SECRET")} env var`),output_manager_default.log(""),new Error("Failed to create deployment protection bypass token")}}function getAutomationBypassToken(protectionBypass){if(!protectionBypass)throw new Error("No protection bypass tokens found");let token=Object.keys(protectionBypass).find(key=>protectionBypass[key].scope==="automation-bypass");if(!token)throw new Error("No automation bypass token found in protection bypass settings");return token}async function getOrCreateDeploymentProtectionToken(client,{project,org},{createIfMissing=!0}={}){if(process.env.VERCEL_AUTOMATION_BYPASS_SECRET)return output_manager_default.debug("Using protection bypass secret from environment variable"),process.env.VERCEL_AUTOMATION_BYPASS_SECRET;if(project.protectionBypass&&Object.values(project.protectionBypass).length){let protectionBypass;try{protectionBypass=getAutomationBypassToken(project.protectionBypass)}catch(error){if(!createIfMissing)return output_manager_default.debug(`No existing automation bypass token found for project ${project.id}`),null;throw error}if(protectionBypass)return output_manager_default.debug(`Using existing protection bypass token from project settings: ${protectionBypass}`),protectionBypass}return createIfMissing?await createDeploymentProtectionToken(client,project.id,org.id):(output_manager_default.debug(`Not creating an automation bypass token for project ${project.id}`),null)}export{getOrCreateDeploymentProtectionToken};
|
|
@@ -4,7 +4,7 @@ import { dirname as __dirname_ } from 'node:path';
|
|
|
4
4
|
const require = __createRequire(import.meta.url);
|
|
5
5
|
const __filename = __fileURLToPath(import.meta.url);
|
|
6
6
|
const __dirname = __dirname_(__filename);
|
|
7
|
-
import{require_strip_ansi}from"./chunk-BS32OUOC.js";import{agentErrorMetadata,buildCommandWithGlobalFlags,clientObservabilityPlanRecovery,getErrorRecovery,trackAgentError}from"./chunk-
|
|
7
|
+
import{require_strip_ansi}from"./chunk-BS32OUOC.js";import{agentErrorMetadata,buildCommandWithGlobalFlags,clientObservabilityPlanRecovery,getErrorRecovery,trackAgentError}from"./chunk-DGYHWXD2.js";import{isAPIError}from"./chunk-6VH56CX2.js";import{output_manager_default}from"./chunk-XP3FT56R.js";import{__toESM}from"./chunk-BZENIQ7N.js";var import_strip_ansi=__toESM(require_strip_ansi(),1);function getRollupColumnName(metric,aggregation){return`${metric}_${aggregation}`.replace(/[./]/g,"_")}function getResolvedOrderMetadata(query,response){let orderBy=query.orderBy??(response.orderBy?"count":void 0),orderDirection=response.orderDirection??query.orderDirection;return{...orderBy?{orderBy}:{},...orderDirection?{orderDirection}:{}}}function formatQueryJson(query,response){let orderMetadata=getResolvedOrderMetadata(query,response),queryWithResponseMetadata={...query,...orderMetadata};return JSON.stringify({query:queryWithResponseMetadata,summary:response.summary??[],data:response.data??[],...orderMetadata},null,2)}function formatErrorJson(code,message,allowedValues,recovery={}){let error={code,message};return allowedValues&&allowedValues.length>0&&(error.allowedValues=allowedValues),JSON.stringify({error:{...error,...recovery}},null,2)}function projectSelectorFromArgv(argv){let args=argv.slice(2);for(let i=0;i<args.length;i++){let arg=args[i];if(arg.startsWith("--project="))return arg.slice(10);if(arg==="--project"&&i+1<args.length)return args[i+1]}}function hintRestatesCommand(hint,steps){if(!steps?.length)return!1;let plain=(0,import_strip_ansi.default)(hint).replace(/`/g,"").trim();return steps.some(step=>{let command=step.command.trim();return command===plain||command.startsWith(`${plain} `)})}function handleApiError(err,jsonOutput,client,overrides={},target={}){let code,message,override=overrides[err.status];if(override)code=override.code||err.code||"BAD_REQUEST",message=override.message;else switch(err.status){case 402:code=err.code||"PAYMENT_REQUIRED",message=err.serverMessage||"This feature requires an Observability Plus subscription.";break;case 429:code=err.code||"RATE_LIMITED",message=err.serverMessage||"You have reached the metrics query rate limit. Please wait and try again. If you need a higher limit, request one from your Vercel account team.";break;case 403:code="FORBIDDEN",message=err.serverMessage&&err.serverMessage!=="Response Error"?err.serverMessage:"You do not have permission to query metrics for this project/team.";break;case 500:code="INTERNAL_ERROR",message="An internal error occurred. Please try again later.";break;case 504:code="TIMEOUT",message="The query timed out. Try a shorter time range or fewer groups.";break;case 400:code=err.code||"BAD_REQUEST",message=err.serverMessage||`API error (${err.status})`;break;default:code=err.code||"BAD_REQUEST",message=err.serverMessage||`API error (${err.status})`}let billing=err.status===402?clientObservabilityPlanRecovery(client,err,message,target.projectName??projectSelectorFromArgv(client.argv),target.scope):void 0,recovery={...getErrorRecovery({...err,serverMessage:message},client),...billing&&{hint:billing.hint}},next=billing?.command?[{command:buildCommandWithGlobalFlags(client.argv.filter(arg=>!/^(?:--yes|--force|-y)(?:=|$)/.test(arg)),billing.command,void 0,{excludeFlags:billing.excludeFlags,preserveProject:billing.preserveProject}),when:billing.when}]:void 0;recovery.hint&&hintRestatesCommand(recovery.hint,next)&&delete recovery.hint;let details={...recovery,...next&&{next},...agentErrorMetadata(client)};if(trackAgentError(client,{reason:err.status===403?"forbidden":err.status===402?"payment_required":err.status===429?"rate_limited":code,...recovery}),jsonOutput||client.nonInteractive)client.stdout.write(formatErrorJson(code,message,err.allowedValues,details));else{output_manager_default.fatal(message),recovery.hint&&output_manager_default.print(` ${recovery.hint}
|
|
8
8
|
`);for(let step of next??[])output_manager_default.print(` ${step.command}
|
|
9
9
|
`);err.allowedValues&&err.allowedValues.length>0&&output_manager_default.print(`
|
|
10
10
|
Available values: ${err.allowedValues.join(", ")}
|
|
@@ -4,6 +4,6 @@ import { dirname as __dirname_ } from 'node:path';
|
|
|
4
4
|
const require = __createRequire(import.meta.url);
|
|
5
5
|
const __filename = __fileURLToPath(import.meta.url);
|
|
6
6
|
const __dirname = __dirname_(__filename);
|
|
7
|
-
import{getErrorRecovery,shouldEmitNonInteractiveCommandError,trackAgentError,writeAgentError}from"./chunk-
|
|
7
|
+
import{getErrorRecovery,shouldEmitNonInteractiveCommandError,trackAgentError,writeAgentError}from"./chunk-DGYHWXD2.js";import{buildCorrectedCommand,isArgumentError}from"./chunk-VOCZ34ON.js";import{parseRetryAfterHeaderAsMillis,require_bytes}from"./chunk-6VH56CX2.js";import{getCommandName}from"./chunk-JESNVRVR.js";import{cliErrorFromUnknown,output_manager_default,recordCliError}from"./chunk-XP3FT56R.js";import{pkg_default}from"./chunk-OO572JUC.js";import{require_source}from"./chunk-NB2WLB3J.js";import{__toESM}from"./chunk-BZENIQ7N.js";var import_chalk=__toESM(require_source(),1);var import_bytes=__toESM(require_bytes(),1);async function responseError(res,fallbackMessage=null,parsedBody={}){let message="",bodyError;if(res.status>=400&&res.status<500){let body;try{body=await res.json()}catch{body=parsedBody}bodyError=body.error||body.err||{},message=bodyError.message}message||(message=fallbackMessage===null?"Response Error":fallbackMessage);let err=new Error(`${message} (${res.status})`);if(err.status=res.status,err.serverMessage=message,bodyError)for(let field of Object.keys(bodyError))field!=="message"&&(err[field]=bodyError[field]);if(res.status===429||res.status===503){let parsed=parseRetryAfterHeaderAsMillis(res.headers.get("Retry-After"));err.retryAfterMs=parsed??(res.status===429?0:void 0)}return err}var MAX_SERIALIZED_ERROR_DEPTH=5;function isPlainObject(value){let proto=Object.getPrototypeOf(value);return proto===null||proto===Object.prototype}function toJsonSafe(value,ancestors,depth){if(typeof value=="bigint")return value.toString();if(!(typeof value=="function"||typeof value=="symbol")){if(value===null||typeof value!="object")return value;if(ancestors.has(value))return"[Circular]";if(depth>=MAX_SERIALIZED_ERROR_DEPTH)return"[Truncated]";if(value instanceof Error)return serializeError(value,ancestors,depth+1);if(!Array.isArray(value)&&!isPlainObject(value))return`[${value.constructor?.name||"Object"}]`;ancestors.add(value);try{if(Array.isArray(value))return value.map(item=>toJsonSafe(item,ancestors,depth+1));let copy={};for(let[key,child]of Object.entries(value))copy[key]=toJsonSafe(child,ancestors,depth+1);return copy}finally{ancestors.delete(value)}}}function serializeError(err,ancestors,depth){ancestors.add(err);try{let enumerable={name:err.name};for(let key of Object.getOwnPropertyNames(err))enumerable[key]=toJsonSafe(err[key],ancestors,depth);return enumerable}finally{ancestors.delete(err)}}function toEnumerableError(err){return err===null||typeof err!="object"?{name:"Error",message:String(err)}:serializeError(err,new WeakSet,0)}function printError(error2,client){typeof error2=="string"&&(error2=new Error(error2)),recordCliError(cliErrorFromUnknown(error2));let apiError=error2,{message,stack,status,code,sizeLimit}=apiError,argumentError=isArgumentError(error2)?error2:void 0,suggestion=argumentError?.suggestedOption&&argumentError.invalidOption,correction=suggestion&&client&&argumentError?buildCorrectedCommand(client.argv,argumentError.invalidOption,argumentError.suggestedOption,argumentError.flagsSpecification):void 0,recovery=getErrorRecovery(apiError,client),reason=status===403?"forbidden":status===402?"payment_required":status===401?"not_authorized":status===429?"rate_limited":argumentError?"invalid_arguments":"api_error",hint=argumentError?.allowedOptions?`Vercel CLI ${pkg_default.version} accepts: ${argumentError.allowedOptions.join(", ")}.${suggestion?` Did you mean ${argumentError.suggestedOption}?`:""}`:recovery.hint;if(client&&(status||argumentError?.allowedOptions)){let payload={...recovery,status:"error",reason,message:apiError.serverMessage||message,hint,...argumentError?.allowedOptions&&{allowedOptions:argumentError.allowedOptions,suggestedOption:argumentError.suggestedOption,cliVersion:pkg_default.version},...correction&&{next:[{command:correction,when:correction.includes("<")?"Replace placeholders with the intended values, then run the corrected command":"Run the corrected command"}]}};if(shouldEmitNonInteractiveCommandError(client)){output_manager_default.stopSpinner(),writeAgentError(client,payload);return}trackAgentError(client,payload)}if(hint){output_manager_default.stopSpinner(),output_manager_default.fatal(apiError.serverMessage||message||"The request failed."),output_manager_default.print(` ${hint}
|
|
8
8
|
`),correction&&output_manager_default.print(` ${correction}
|
|
9
9
|
`);return}output_manager_default.debug(`handling error: ${stack}`),message!=="User force closed the prompt with 0 null"&&(status===403?output_manager_default.error(message||`Authentication error. Run ${getCommandName("login")} to log-in again.`):status===429?output_manager_default.error(message):code==="size_limit_exceeded"?output_manager_default.error(`File size limit exceeded (${(0,import_bytes.default)(sizeLimit)})`):message?output_manager_default.prettyError(apiError):status===500?output_manager_default.error("Unexpected server error. Please retry."):code==="USER_ABORT"?output_manager_default.log("Canceled"):output_manager_default.error(`Unexpected error. Please try again later. (${message})`))}export{responseError,toEnumerableError,printError};
|
|
@@ -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{getProductionUrl}from"./chunk-VT6RIZJH.js";import{output_manager_default}from"./chunk-XP3FT56R.js";var PROTECTION_METHODS=[{setting:"ssoProtection",id:"vercel_authentication",name:"Vercel Authentication"},{setting:"passwordProtection",id:"password",name:"Password Protection"}];async function getEnabledProtection(client,project){try{let settings=await client.fetch(`/v9/projects/${encodeURIComponent(project.id)}`,{accountId:project.accountId});return PROTECTION_METHODS.filter(method=>settings[method.setting]).map(method=>({...method,deploymentType:readDeploymentType(settings[method.setting])}))}catch(err){return output_manager_default.debug(`Could not read Deployment Protection settings: ${err}`),null}}function readDeploymentType(setting){if(setting&&typeof setting=="object"&&"deploymentType"in setting){let{deploymentType}=setting;return typeof deploymentType=="string"?deploymentType:void 0}}var PRODUCTION_DOMAINS_PUBLIC=new Set(["all_except_custom_domains","prod_deployment_urls_and_all_previews","preview"]),PRODUCTION_DEPLOYMENTS_PUBLIC=new Set(["preview"]);function getProtectionForDeployment(methods,deployment){if(!methods)return[];if(deployment.target!=="production")return methods;let publicScopes=getProductionUrl(deployment)?PRODUCTION_DOMAINS_PUBLIC:PRODUCTION_DEPLOYMENTS_PUBLIC;return methods.filter(method=>!method.deploymentType||!publicScopes.has(method.deploymentType))}export{getEnabledProtection,getProtectionForDeployment};
|
|
@@ -4,4 +4,4 @@ import { dirname as __dirname_ } from 'node:path';
|
|
|
4
4
|
const require = __createRequire(import.meta.url);
|
|
5
5
|
const __filename = __fileURLToPath(import.meta.url);
|
|
6
6
|
const __dirname = __dirname_(__filename);
|
|
7
|
-
import{environmentOption,formatOption,jsonOption,projectOption}from"./chunk-
|
|
7
|
+
import{environmentOption,formatOption,jsonOption,projectOption}from"./chunk-AWMQGOS2.js";import{packageName}from"./chunk-JESNVRVR.js";var RULE_ENVIRONMENTS=["any","preview","production"],ruleEnvironmentOption={...environmentOption,description:"Environment the rule applies to (required): production, preview, or any"},lsSubcommand={name:"ls",aliases:["list"],description:"List the Vercel tracing sampling rules for a project",arguments:[],options:[formatOption,jsonOption,projectOption],examples:[{name:"List the sampling rules for the linked project",value:`${packageName} traces config ls`},{name:"List the sampling rules as JSON",value:`${packageName} traces config ls --json`}]},setSubcommand={name:"set",aliases:[],description:"Enable Vercel tracing and add or replace one sampling rule. The rate is a whole percentage from 1 to 100.",arguments:[{name:"rate",required:!0},{name:"requestPath",required:!1}],options:[ruleEnvironmentOption,formatOption,jsonOption,projectOption],examples:[{name:"Trace a quarter of production traffic",value:`${packageName} traces config set 25 --environment production`},{name:"Trace every preview request to one path prefix",value:`${packageName} traces config set 100 /api --environment preview`},{name:"Trace one percent of traffic in every environment",value:`${packageName} traces config set 1 --environment any`}]},rmSubcommand={name:"remove",aliases:["rm","delete"],description:"Remove Vercel tracing sampling rules. Without a path prefix, every rule for the environment is removed. Removing the final rule disables tracing.",arguments:[{name:"requestPath",required:!1}],options:[ruleEnvironmentOption,{name:"default",shorthand:null,type:Boolean,deprecated:!1,description:"Remove only the rule that has no path prefix, keeping the per-path rules"},formatOption,jsonOption,projectOption],examples:[{name:"Remove one rule by environment and path prefix",value:`${packageName} traces config remove /api --environment production`},{name:"Remove every rule for production",value:`${packageName} traces config remove --environment production`},{name:"Remove only the production rule that covers all paths",value:`${packageName} traces config remove --environment production --default`}]},tracesConfigCommand={name:"config",aliases:[],description:"Manage Vercel tracing sampling rules for a project.",arguments:[],subcommands:[lsSubcommand,setSubcommand,rmSubcommand],options:[],examples:[{name:"List the sampling rules for the linked project",value:`${packageName} traces config ls`},{name:"Trace a quarter of production traffic",value:`${packageName} traces config set 25 --environment production`},{name:"Remove every rule for production",value:`${packageName} traces config remove --environment production`}]};export{RULE_ENVIRONMENTS,lsSubcommand,setSubcommand,rmSubcommand,tracesConfigCommand};
|
|
@@ -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_strip_ansi}from"./chunk-BS32OUOC.js";import{__toESM}from"./chunk-BZENIQ7N.js";var import_strip_ansi=__toESM(require_strip_ansi(),1),CONTROL_CHARACTERS=/[\u0000-\u001F\u007F-\u009F]/g,FORMAT_CHARACTERS=/[\u200B-\u200F\u202A-\u202E\u2060-\u2069\uFEFF]/g;function remoteText(value){return(0,import_strip_ansi.default)(value).replace(/\r?\n/g,"\\n").replace(CONTROL_CHARACTERS,"").replace(FORMAT_CHARACTERS,"")}export{remoteText};
|
|
@@ -4,5 +4,5 @@ import { dirname as __dirname_ } from 'node:path';
|
|
|
4
4
|
const require = __createRequire(import.meta.url);
|
|
5
5
|
const __filename = __fileURLToPath(import.meta.url);
|
|
6
6
|
const __dirname = __dirname_(__filename);
|
|
7
|
-
import{did_you_mean_default}from"./chunk-DWZBL4NK.js";import{param}from"./chunk-3G3FQYMW.js";import{shouldEmitNonInteractiveCommandError,writeAgentError}from"./chunk-
|
|
7
|
+
import{did_you_mean_default}from"./chunk-DWZBL4NK.js";import{param}from"./chunk-3G3FQYMW.js";import{shouldEmitNonInteractiveCommandError,writeAgentError}from"./chunk-DGYHWXD2.js";import{buildCorrectedCommand,suggestCorrection}from"./chunk-VOCZ34ON.js";import{getFlagsSpecification}from"./chunk-AWMQGOS2.js";import{output_manager_default}from"./chunk-XP3FT56R.js";function handleCommandTypo({command,availableCommands,threshold=.7,client}){if(!command||command.startsWith("-"))return!1;let visibleCommands=availableCommands.filter(command2=>!command2.hidden),commandNames=visibleCommands.flatMap(({name,aliases})=>[name,...aliases]),correction=suggestCorrection(command,commandNames),suggestion=correction??did_you_mean_default(command,commandNames,threshold);if(suggestion){if(client){let definition=visibleCommands.find(candidate=>candidate.name===correction||candidate.aliases.some(alias=>alias===correction)),corrected=correction?buildCorrectedCommand(client.argv,command,correction,getFlagsSpecification(definition?.options??[])):void 0,payload={status:"error",reason:"unknown_command",message:`Unknown command "${command}". Did you mean "${suggestion}"?`,hint:corrected?"Use the suggested command after replacing any placeholders with the intended values.":`Accepted commands: ${commandNames.join(", ")}.`,...corrected&&{next:[{command:corrected,when:"Run the corrected command; replace any placeholders first"}]}};return shouldEmitNonInteractiveCommandError(client)?writeAgentError(client,payload):(output_manager_default.fatal(payload.message),output_manager_default.print(` ${corrected??payload.hint}
|
|
8
8
|
`)),!0}return output_manager_default.error(`${param(command)} is not a valid target directory or subcommand. Did you mean ${param(suggestion)}?`),!0}return!1}export{handleCommandTypo};
|
|
@@ -4,4 +4,4 @@ import { dirname as __dirname_ } from 'node:path';
|
|
|
4
4
|
const require = __createRequire(import.meta.url);
|
|
5
5
|
const __filename = __fileURLToPath(import.meta.url);
|
|
6
6
|
const __dirname = __dirname_(__filename);
|
|
7
|
-
import{AGENT_REASON,AGENT_STATUS,shouldEmitNonInteractiveCommandError,writeAgentError}from"./chunk-
|
|
7
|
+
import{AGENT_REASON,AGENT_STATUS,shouldEmitNonInteractiveCommandError,writeAgentError}from"./chunk-DGYHWXD2.js";import{output_manager_default}from"./chunk-XP3FT56R.js";function getRenamedOption(flags,name,oldName,{json=!1}={}){let value=flags[name],oldValue=flags[oldName];if(value!==void 0&&oldValue!==void 0)return{error:`Can't use ${name} with ${oldName}.`};if(value!==void 0&&value.trim()==="")return{error:`${name} can't be empty.`};if(oldValue===void 0)return{value};let message=`${oldName} is deprecated. Use ${name}.`;return json?{value:oldValue,warning:{reason:AGENT_REASON.DEPRECATED,message}}:(output_manager_default.warning(message),{value:oldValue})}function reportRenamedOptionError(client,message,{json=!1}={}){return json||shouldEmitNonInteractiveCommandError(client)?writeAgentError(client,{status:AGENT_STATUS.ERROR,reason:AGENT_REASON.INVALID_ARGUMENTS,message}):output_manager_default.error(message),2}function renameOptionInArgs(args,oldName,name){let end=args.indexOf("--");return args.map((arg,index)=>(end===-1||index<end)&&(arg===oldName||arg.startsWith(`${oldName}=`))?`${name}${arg.slice(oldName.length)}`:arg)}export{getRenamedOption,reportRenamedOptionError,renameOptionInArgs};
|
|
@@ -4,4 +4,4 @@ import { dirname as __dirname_ } from 'node:path';
|
|
|
4
4
|
const require = __createRequire(import.meta.url);
|
|
5
5
|
const __filename = __fileURLToPath(import.meta.url);
|
|
6
6
|
const __dirname = __dirname_(__filename);
|
|
7
|
-
import{formatOption,jsonOption,limitOption,nextCursorOption,projectOption,sinceOption,untilOption}from"./chunk-
|
|
7
|
+
import{formatOption,jsonOption,limitOption,nextCursorOption,projectOption,sinceOption,untilOption}from"./chunk-AWMQGOS2.js";import{packageName}from"./chunk-JESNVRVR.js";var typesSubcommand={name:"types",aliases:[],description:"List available event types with descriptions.",arguments:[],options:[formatOption,jsonOption],examples:[{name:"List all event types",value:`${packageName} activity types`},{name:"Output JSON",value:`${packageName} activity types --json`}]},activityCommand={name:"activity",aliases:[],description:"List user activity events.",arguments:[],subcommands:[{name:"ls",aliases:["list"],description:"",default:!0,hidden:!0,arguments:[],options:[],examples:[]},typesSubcommand],options:[{name:"type",shorthand:null,type:[String],argument:"TYPE",deprecated:!1,description:"Filter by event type. Repeatable and comma-separated (e.g. --type deployment --type project-created or --type deployment,project-created)."},sinceOption,untilOption,{...projectOption,shorthand:"p",description:"Filter by project (overrides auto-detected linked project)."},{name:"all",shorthand:"a",type:Boolean,deprecated:!1,description:"Show all team events (ignore linked project auto-scoping)."},limitOption,nextCursorOption,formatOption,jsonOption],examples:[{name:"List events for the linked project",value:`${packageName} activity`},{name:"Filter events by multiple types",value:`${packageName} activity --type deployment --type project-created --since 7d`},{name:"Filter events by comma-separated types",value:`${packageName} activity --type deployment,project-created --since 7d`},{name:"List all team events",value:`${packageName} activity --all --since 30d`},{name:"Output JSON",value:`${packageName} activity --json | jq '.events[]'`},{name:"List activity event types",value:`${packageName} activity types`}]};export{typesSubcommand,activityCommand};
|
|
@@ -4,4 +4,4 @@ import { dirname as __dirname_ } from 'node:path';
|
|
|
4
4
|
const require = __createRequire(import.meta.url);
|
|
5
5
|
const __filename = __fileURLToPath(import.meta.url);
|
|
6
6
|
const __dirname = __dirname_(__filename);
|
|
7
|
-
import{warnDeprecatedInput}from"./chunk-
|
|
7
|
+
import{warnDeprecatedInput}from"./chunk-AWMQGOS2.js";var VALUE_LIKE=/^(on|off|true|false|yes|no|1|0|enabled?|disabled?)$/i;function negationOf(name){return`--no-${name.slice(2)}`}function readOnOffOption(client,flags,names){let typed=name=>name!==void 0&&flags[name]===!0,onNames=[names.on,names.oldOn].filter(typed),offNames=[names.off,names.oldOff].filter(typed);return onNames.length>0&&offNames.length>0?{error:`Can't use ${onNames[0]} with ${offNames[0]}.`}:(names.oldOn&&onNames.includes(names.oldOn)&&warnDeprecatedInput(client,names.oldOn,names.on),names.oldOff&&offNames.includes(names.oldOff)&&warnDeprecatedInput(client,names.oldOff,names.off),{value:onNames.length>0?!0:offNames.length>0?!1:void 0})}function rewriteLegacyOnOffValues(args,options,client){let legacyOptions=options.filter(option=>option.legacyValues),out=[],legacy=new Map,end=args.indexOf("--");for(let i=0;i<args.length;i++){let token=args[i];if(end!==-1&&i>=end){out.push(token);continue}let option=legacyOptions.find(candidate=>token===`--${candidate.name}`||token.startsWith(`--${candidate.name}=`));if(!option?.legacyValues){out.push(token);continue}let name=`--${option.name}`,negation=negationOf(name),{on,off}=option.legacyValues,invalid={error:`${name} doesn't take a value. Use ${name} or ${negation}.`};if(token===name){let next=args[i+1];if(next===void 0||end!==-1&&i+1>=end)out.push(token);else if(next===on||next===off)out.push(next===on?name:negation),legacy.set(name,next),client&&warnDeprecatedInput(client,`${name} ${next}`,next===on?name:negation),i++;else{if(VALUE_LIKE.test(next))return invalid;out.push(token)}continue}let value=token.slice(name.length+1);if(value==="true"||value==="false")out.push(value==="true"?name:negation);else if(value===on||value===off)out.push(value===on?name:negation),legacy.set(name,value),client&&warnDeprecatedInput(client,token,value===on?name:negation);else return invalid}return{args:out,legacy}}function getFalseValueWarnings(args,options){let booleans=new Set(options.filter(option=>option.type===Boolean&&!option.legacyValues&&!option.rejectsValue&&option.name!=="non-interactive").map(option=>option.name)),warnings=new Set;for(let token of args){if(token==="--")break;let match=/^--([^=]+)=(.*)$/.exec(token);if(!match||!booleans.has(match[1])||!/^false$/i.test(match[2]))continue;let name=`--${match[1]}`;warnings.add(match[1].startsWith("no-")?`${token} turns ${name} on. Leave out ${name} to turn it off.`:`${token} turns ${name} on. Use ${negationOf(name)} to turn it off.`)}return[...warnings]}export{readOnOffOption,rewriteLegacyOnOffValues,getFalseValueWarnings};
|
|
@@ -4,4 +4,4 @@ import { dirname as __dirname_ } from 'node:path';
|
|
|
4
4
|
const require = __createRequire(import.meta.url);
|
|
5
5
|
const __filename = __fileURLToPath(import.meta.url);
|
|
6
6
|
const __dirname = __dirname_(__filename);
|
|
7
|
-
import{confirmOption,projectOption,yesOption}from"./chunk-
|
|
7
|
+
import{confirmOption,projectOption,yesOption}from"./chunk-AWMQGOS2.js";import{packageName}from"./chunk-JESNVRVR.js";var addSubcommand={name:"add",aliases:[],description:"Add projects to an existing repository link created by link --repo",arguments:[],options:[{...yesOption,description:"Skip questions when adding projects with default team and settings"}],examples:[{name:"Add projects to an existing repository link",value:`${packageName} link add`}]},linkCommand={name:"link",aliases:[],description:"Link a local directory to a Vercel project",runsWithoutSubcommand:!0,arguments:[],subcommands:[addSubcommand],options:[{name:"repo",description:"Link multiple projects from the Git repository (alpha; per-directory project links take precedence)",shorthand:null,deprecatedShorthand:"r",type:Boolean,deprecated:!1},{...projectOption,shorthand:"p",description:"Set the project name or ID to link; required for non-interactive existing-project links"},{name:"team",description:"Set the team ID or slug; use with --project for non-interactive links",shorthand:null,argument:"TEAM_ID_OR_SLUG",type:String,deprecated:!1},{...yesOption,description:"Skip questions when setting up with default team and settings"},confirmOption],examples:[{name:"Link current directory to a Vercel project",value:`${packageName} link`},{name:"Link current directory with default options and skip questions",value:`${packageName} link --yes`},{name:"Link to an existing project in CI or agent mode",value:`${packageName} link --yes --team <team-id> --project <project-name-or-id>`},{name:"Link a specific directory to a Vercel project",value:`${packageName} link --cwd /path/to/project`},{name:"Link multiple projects from the current Git repository",value:`${packageName} link --repo`},{name:"Add additional projects to an existing repository link",value:`${packageName} link add`}]};export{addSubcommand,linkCommand};
|
|
@@ -4,4 +4,4 @@ import { dirname as __dirname_ } from 'node:path';
|
|
|
4
4
|
const require = __createRequire(import.meta.url);
|
|
5
5
|
const __filename = __fileURLToPath(import.meta.url);
|
|
6
6
|
const __dirname = __dirname_(__filename);
|
|
7
|
-
import{purchaseDomainIfAvailable}from"./chunk-
|
|
7
|
+
import{purchaseDomainIfAvailable}from"./chunk-WCWP4GBR.js";import{addDomain,getDomainByName,require_cjs}from"./chunk-DUT4U5YY.js";import{mapCertError}from"./chunk-HCRD3JFL.js";import{require_dist as require_dist2}from"./chunk-KNLGWGUE.js";import{DomainNotFound,DomainPermissionDenied,InvalidDomain,NowError,isAPIError}from"./chunk-6VH56CX2.js";import{output_manager_default}from"./chunk-XP3FT56R.js";import{require_dist}from"./chunk-RM3ZDRYE.js";import{require_source}from"./chunk-NB2WLB3J.js";import{__toESM}from"./chunk-BZENIQ7N.js";var import_chalk=__toESM(require_source(),1);var import_async_retry=__toESM(require_dist2(),1);var import_error_utils=__toESM(require_dist(),1);async function issueCert(client,cns){return(0,import_async_retry.default)(async bail=>{try{return await client.fetch("/v3/certs",{method:"POST",body:{domains:cns}})}catch(err){if(isAPIError(err)&&err.code==="configuration_error")throw err;if((0,import_error_utils.isError)(err))bail(err);else throw err}},{retries:3,minTimeout:5e3,maxTimeout:15e3})}async function createCertForCns(client,cns,context){output_manager_default.spinner(`Issuing a certificate for ${import_chalk.default.bold(cns.join(", "))}`);try{return await issueCert(client,cns)}catch(err){if(isAPIError(err)){if(err.code==="forbidden")return new DomainPermissionDenied(err.domain,context);let mappedError=mapCertError(err,cns);if(mappedError)return mappedError}throw err}finally{output_manager_default.stopSpinner()}}var import_tldts=__toESM(require_cjs(),1);async function maybeGetDomainByName(client,contextName,domainName){let maybeDomain=await getDomainByName(client,contextName,domainName);return maybeDomain instanceof DomainPermissionDenied?maybeDomain:maybeDomain instanceof DomainNotFound?null:maybeDomain}function isWildcardAlias(alias){return alias.startsWith("*.")}function extractDomain(alias){return isWildcardAlias(alias)?alias.slice(2):alias}async function setupDomain(client,alias,contextName){let aliasDomain=extractDomain(alias);output_manager_default.debug(`Trying to fetch domain ${aliasDomain} by name`);let info=await maybeGetDomainByName(client,contextName,aliasDomain);if(info instanceof DomainPermissionDenied)return info;if(info){let{name:domain2}=info;return output_manager_default.debug(`Domain ${domain2} found for the given context`),info}output_manager_default.debug(`The domain ${aliasDomain} was not found, trying to purchase it`);let purchased=await purchaseDomainIfAvailable(client,aliasDomain,contextName);if(purchased instanceof NowError)return purchased;if(!purchased){output_manager_default.debug(`Domain ${aliasDomain} is not available to be purchased. Trying to add it`);let parsedDomain=(0,import_tldts.parse)(aliasDomain);if(!parsedDomain.domain)return new InvalidDomain(alias);let{domain:domain2}=parsedDomain;output_manager_default.debug(`Adding ${domain2}`);let addResult=await addDomain(client,domain2,contextName);return addResult instanceof NowError||output_manager_default.debug(`Domain ${domain2} successfully added and automatically verified`),addResult}output_manager_default.debug(`The domain ${aliasDomain} was successfully purchased`);let purchasedDomain=await maybeGetDomainByName(client,contextName,aliasDomain),{name:domain}=purchasedDomain;return output_manager_default.debug(`Domain ${domain} was purchased and it is automatically verified`),maybeGetDomainByName(client,contextName,domain)}export{createCertForCns,isWildcardAlias,extractDomain,setupDomain};
|
|
@@ -4,5 +4,5 @@ import { dirname as __dirname_ } from 'node:path';
|
|
|
4
4
|
const require = __createRequire(import.meta.url);
|
|
5
5
|
const __filename = __fileURLToPath(import.meta.url);
|
|
6
6
|
const __dirname = __dirname_(__filename);
|
|
7
|
-
import{noBorderChars,require_cli_table3}from"./chunk-773GOZIR.js";import{require_dist}from"./chunk-PUKYAALC.js";import{getShortFlags,globalCommandOptions}from"./chunk-
|
|
7
|
+
import{noBorderChars,require_cli_table3}from"./chunk-773GOZIR.js";import{require_dist}from"./chunk-PUKYAALC.js";import{getShortFlags,globalCommandOptions}from"./chunk-AWMQGOS2.js";import{require_source}from"./chunk-NB2WLB3J.js";import{__toESM}from"./chunk-BZENIQ7N.js";var import_chalk=__toESM(require_source(),1),import_constants=__toESM(require_dist(),1),import_cli_table3=__toESM(require_cli_table3(),1);var INDENT=" ".repeat(2),NEWLINE=`
|
|
8
8
|
`,tableOptions={chars:noBorderChars,style:{"padding-left":0,"padding-right":0}};function wordWrap(text,maxWidth){let _tableOptions=Object.assign({},tableOptions,{colWidths:[maxWidth],style:{"padding-left":INDENT.length}}),table=new import_cli_table3.default(_tableOptions);return table.push([{content:text,wordWrap:!0}]),table.toString()}function lineToString(line){let string="";for(let i=0;i<line.length;i++)if(i===line.length-1)string+=line[i];else{let curr=line[i],next=line[i+1];string+=curr,curr.trim()!==""&&next.trim()!==""&&(string+=" ")}return string}function outputArrayToString(outputArray){return outputArray.filter(line=>line!==null).join(NEWLINE)}var commandPaths=new WeakMap;function registerCommandPaths(roots){let visit=(command,parentPath)=>{let path=[...parentPath,command.name];commandPaths.has(command)||commandPaths.set(command,path);for(let subcommand of command.subcommands??[])visit(subcommand,path)};for(let root of roots)visit(root,[])}function getCommandPath(command,parent){let registered=commandPaths.get(command);return registered||(parent?[parent.name,command.name]:[command.name])}function buildCommandSynopsisLine(command,parent){let line=[INDENT,import_constants.LOGO,import_chalk.default.bold(import_constants.NAME)];for(let name of getCommandPath(command,parent))line.push(import_chalk.default.bold(name));let args=command.arguments.slice(0);if(args.length===0&&command.subcommands&&command.subcommands.length>0&&args.push({name:"command",required:!command.subcommands.some(subcommand=>subcommand.default)}),args.length>0)for(let argument of args){let{name}=argument;argument.multiple&&(name+=" ..."),line.push(argument.required?name:`[${name}]`)}return command.options.length>0&&line.push("[options]"),line.push(NEWLINE),lineToString(line)}function buildCommandOptionLines(commandOptions,options,sectionTitle){let filteredCommandOptions=commandOptions.filter(option=>!option.deprecated&&option.description!==void 0);if(filteredCommandOptions.length===0)return null;filteredCommandOptions.sort((a,b)=>a.name<b.name?-1:a.name>b.name?1:0);let maxWidthOfUnwrappedColumns=0,rows=[];for(let option of filteredCommandOptions){let shorthandCell=option.shorthand?`${INDENT}-${option.shorthand},`:"",longhandCell=`${INDENT}--${option.name}`;option.argument&&(longhandCell+=` <${option.argument}>`),longhandCell+=INDENT;let widthOfUnwrappedColumns=shorthandCell.length+longhandCell.length;maxWidthOfUnwrappedColumns=Math.max(widthOfUnwrappedColumns,maxWidthOfUnwrappedColumns),rows.push([shorthandCell,longhandCell,{content:option.description,wordWrap:!0}])}let finalColumnWidth=options.columns-maxWidthOfUnwrappedColumns,table=new import_cli_table3.default(Object.assign({},tableOptions,{colWidths:[null,null,finalColumnWidth]}));return table.push(...rows),[`${INDENT}${import_chalk.default.dim(sectionTitle)}:`,NEWLINE,NEWLINE,table.toString(),NEWLINE,NEWLINE].join("")}function buildSubcommandLines(subcommands,options,title="Commands"){if(!subcommands)return null;let maxWidthOfUnwrappedColumns=0,rows=[];for(let command of subcommands){if(command.hidden)continue;let nameCell=`${INDENT}${command.name}`,argsCell=INDENT;argsCell+=command.arguments.map(arg=>arg.required?arg.name:`[${arg.name}]`).join(" "),argsCell+=INDENT;let widthOfUnwrappedColumns=nameCell.length+argsCell.length;maxWidthOfUnwrappedColumns=Math.max(widthOfUnwrappedColumns,maxWidthOfUnwrappedColumns),rows.push([nameCell,argsCell,{content:command.default?`${command.summary??command.description} ${import_chalk.default.bold("(default)")}`:command.summary??command.description,wordWrap:!0}])}let rightMargin=INDENT.repeat(4).length,finalColumnWidth=options.columns-maxWidthOfUnwrappedColumns-rightMargin,table=new import_cli_table3.default(Object.assign({},tableOptions,{colWidths:[null,null,finalColumnWidth]}));return rows.length===0?null:(table.push(...rows),[`${INDENT}${import_chalk.default.dim(title)}:`,NEWLINE,NEWLINE,table.toString(),NEWLINE,NEWLINE].join(""))}function buildCommandExampleLines(command){if(!command.examples?.length)return null;let outputArray=[`${INDENT}${import_chalk.default.dim("Examples:")}`,""];for(let example of command.examples){let nameLine=[INDENT];nameLine.push(import_chalk.default.gray("-")),nameLine.push(example.name),outputArray.push(lineToString(nameLine)),outputArray.push("");let buildValueLine=value=>lineToString([INDENT,INDENT,import_chalk.default.cyan(`$ ${value}`)]);if(Array.isArray(example.value))for(let line of example.value)outputArray.push(buildValueLine(line));else outputArray.push(buildValueLine(example.value));outputArray.push("")}return outputArrayToString(outputArray)}function buildCommandDocumentationLines(command,options){if(options.omitDocumentation)return null;let documentation=command.documentation??options.parent?.documentation;return documentation?outputArrayToString([`${INDENT}${import_chalk.default.dim(`${documentation.label}:`)}`,"",lineToString([INDENT,INDENT,import_chalk.default.cyan(documentation.url)]),""]):null}function buildDescriptionLine(command,options){return`${wordWrap(command.description,options.columns)}${NEWLINE}`}function buildHelpOutput(command,options){let filteredGlobalOptions=command.disabledGlobalOptions?globalCommandOptions.filter(opt=>!command.disabledGlobalOptions?.includes(opt.name)):globalCommandOptions,sections=command.helpSections??[],buildSection=section=>outputArrayToString([`${INDENT}${import_chalk.default.dim(`${section.title}:`)}`,"",...section.body.map(line=>line===""?"":wordWrap(line,options.columns)),""]),outputArray=["",buildCommandSynopsisLine(command,options.parent),buildDescriptionLine(command,options),buildSubcommandLines(command.subcommands,options,command.subcommandsTitle),buildCommandOptionLines(command.options,options,"Options"),...sections.filter(section=>section.placement==="afterOptions").map(buildSection),buildCommandOptionLines(filteredGlobalOptions,options,"Global Options"),buildCommandExampleLines(command),...sections.filter(section=>section.placement!=="afterOptions").map(buildSection),buildCommandDocumentationLines(command,options),""];return outputArrayToString(outputArray)}function help(command,options){return buildHelpOutput(command,{...options,columns:options.columns??80})}function findOption(token,options){return token.startsWith("--")?options.find(candidate=>candidate.name===token.slice(2)):options.find(candidate=>getShortFlags(candidate).includes(token))}function subtreeOptions(command){return[...command.options,...(command.subcommands??[]).flatMap(subtreeOptions)]}function isSubcommandOf(command,token){return token!==void 0&&(command.subcommands??[]).some(subcommand=>subcommand.name===token||subcommand.aliases.includes(token))}function optionTakesValue(token,walkedOptions,command,nextToken){let walked=findOption(token,walkedOptions);if(walked)return walked.type!==Boolean;let below=findOption(token,subtreeOptions(command)),global=findOption(token,globalCommandOptions);return below&&below.type!==Boolean&&(!global||global.type!==Boolean||!isSubcommandOf(command,nextToken))?!0:global!==void 0&&global.type!==Boolean}function resolveHelpTarget(root,tokens){let command=root,ancestors=[],typedPath=[],options=[...root.options],groupArguments=0,unknownSegment;for(let i=0;i<tokens.length;i++){let token=tokens[i];if(token==="--")break;if(token.startsWith("-")){!token.includes("=")&&optionTakesValue(token,options,command,tokens[i+1])&&i++;continue}let subcommand=command.subcommands?.find(candidate=>candidate.name===token||candidate.aliases.includes(token));if(!subcommand){if(command.argumentsBeforeSubcommand&&groupArguments<command.arguments.length){groupArguments++;continue}command.subcommands?.length&&command.arguments.length===0&&!command.runsWithoutSubcommand&&!command.subcommands.some(candidate=>candidate.default)&&(unknownSegment=token);break}ancestors.push(command),typedPath.push(token),options.push(...subcommand.options),command=subcommand,groupArguments=0}let parent=ancestors[ancestors.length-1];for(let i=ancestors.length-1;i>=0;i--)if(ancestors[i].documentation){parent=ancestors[i];break}return{command,parent,typedPath,unknownSegment}}export{registerCommandPaths,buildCommandDocumentationLines,help,resolveHelpTarget};
|