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,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{parseSubcommandArguments}from"./chunk-
|
|
7
|
+
import{parseSubcommandArguments}from"./chunk-NEFDNROD.js";import{printError}from"./chunk-G4T7VBGN.js";import{AGENT_REASON,AGENT_STATUS,buildCommandWithYes,outputAgentError,withGlobalFlags}from"./chunk-DGYHWXD2.js";import{getGlobalFlagsFromArgs}from"./chunk-AWMQGOS2.js";import{getCommandNamePlain}from"./chunk-JESNVRVR.js";import{output_manager_default}from"./chunk-XP3FT56R.js";import{require_source}from"./chunk-NB2WLB3J.js";import{__toESM}from"./chunk-BZENIQ7N.js";var ROUTE_TYPE_LABELS={rewrite:"Rewrite",redirect:"Redirect",set_status:"Set Status",transform:"Transform"};function getRouteTypeLabel(rule){return rule.routeType?ROUTE_TYPE_LABELS[rule.routeType]??"-":"-"}var SRC_SYNTAX_LABELS={equals:"Exact Match","path-to-regexp":"Pattern",regex:"Regex"};function getSrcSyntaxLabel(rule){let syntax=rule.srcSyntax??"regex";return SRC_SYNTAX_LABELS[syntax]}function isTargetTransform(transform){return"target"in transform}var import_chalk=__toESM(require_source(),1);function withGlobalFlags2(client,commandTemplate){return withGlobalFlags(client,commandTemplate,{preserveProject:!0})}function shellQuoteRouteIdentifierForSuggestion(identifier){return identifier.includes(" ")?identifier.includes("'")?identifier.includes('"')?`"${identifier.replace(/"/g,'\\"')}"`:`"${identifier}"`:`'${identifier}'`:identifier}async function parseSubcommandArgs(argv,command,client){let parsedArgs;try{parsedArgs=parseSubcommandArguments(argv,command)}catch(err){if(client?.nonInteractive){let rawMessage=err instanceof Error?err.message:String(err),flags=getGlobalFlagsFromArgs(client.argv.slice(2),{preserveProject:!0}),message=rawMessage,next=[{command:getCommandNamePlain(`routes ${command.name} ${flags.join(" ")}`.trim()),when:"fix flags and retry"}],aiIdx=argv.indexOf("--ai");return(aiIdx!==-1&&(aiIdx===argv.length-1||argv[aiIdx+1]!==void 0&&argv[aiIdx+1].startsWith("-"))||/option requires argument.*--ai|--ai.*requires argument/i.test(rawMessage))&&(command.name==="add"||command.name==="update")&&(message=command.name==="add"?'--ai requires a description. Example: routes add --ai <description> --yes --non-interactive. Replace <description> with your text; use shell quotes if it contains spaces (e.g. --ai "Redirect /old to /new").':"--ai requires a description. Example: routes update <name-or-id> --ai <description> --yes --non-interactive. Replace placeholders; use shell quotes for <description> if it contains spaces.",next=[{command:withGlobalFlags2(client,command.name==="add"?"routes add --ai <description> --yes":"routes update <name-or-id> --ai <description> --yes"),when:"replace <description> with your text (quote it in the shell if it contains spaces), then run"},{command:getCommandNamePlain(`routes ${command.name} --help ${flags.join(" ")}`.trim()),when:"see all flags"}]),outputAgentError(client,{status:AGENT_STATUS.ERROR,reason:AGENT_REASON.INVALID_ARGUMENTS,message,next},2),2}return printError(err),2}return parsedArgs}async function confirmAction(client,skipConfirmation,message,details){return skipConfirmation?!0:client.nonInteractive?(outputAgentError(client,{status:AGENT_STATUS.ERROR,reason:AGENT_REASON.CONFIRMATION_REQUIRED,message:`${message} Re-run with --yes to confirm.`,next:[{command:buildCommandWithYes(client.argv),when:"re-run with --yes to confirm"}]}),process.exit(1),!1):(details&&output_manager_default.print(` ${details}
|
|
8
8
|
`),await client.input.confirm(message,!1))}function formatCondition(condition){let parts=[import_chalk.default.gray(`[${condition.type}]`)];if(condition.key&&parts.push(import_chalk.default.cyan(condition.key)),condition.value!==void 0){let formatted=typeof condition.value=="string"?condition.value:JSON.stringify(condition.value);parts.push(condition.key?`= ${formatted}`:formatted)}return parts.join(" ")}var TRANSFORM_TYPE_LABELS={"request.headers":"Request Header","request.query":"Request Query","response.headers":"Response Header","request.path":"Request Path"},TRANSFORM_OP_LABELS={set:"set",append:"append",delete:"delete"};function formatTransform(transform,includeType=!0){let opLabel=TRANSFORM_OP_LABELS[transform.op]??transform.op,key=isTargetTransform(transform)?typeof transform.target.key=="string"?transform.target.key:JSON.stringify(transform.target.key):"path",parts=[];if(includeType){let typeLabel=TRANSFORM_TYPE_LABELS[transform.type]??transform.type;parts.push(import_chalk.default.gray(`[${typeLabel}]`))}if(parts.push(import_chalk.default.yellow(opLabel),import_chalk.default.cyan(key)),transform.args!==void 0&&transform.op!=="delete"){let argsStr=Array.isArray(transform.args)?transform.args.join(", "):transform.args;parts.push(`= ${argsStr}`)}return parts.join(" ")}function parsePosition(position){if(position==="start")return{placement:"start"};if(position==="end")return{placement:"end"};if(position.startsWith("after:")){let referenceId=position.slice(6);if(!referenceId)throw new Error('Position "after:" requires a route ID');return{placement:"after",referenceId}}if(position.startsWith("before:")){let referenceId=position.slice(7);if(!referenceId)throw new Error('Position "before:" requires a route ID');return{placement:"before",referenceId}}throw new Error(`Invalid position: "${position}". Use: start, end, after:<id>, or before:<id>`)}async function offerAutoPromote(client,projectId,version,hadExistingStagingVersion,opts){let{default:updateRouteVersion}=await import("./update-route-version-KWK5S4UW.js"),{default:stamp}=await import("./stamp-TKONNIJ5.js");if(output_manager_default.print(`
|
|
9
9
|
${import_chalk.default.gray(`This change is staged. Run ${import_chalk.default.cyan(withGlobalFlags2(client,"routes publish"))} to make it live, or ${import_chalk.default.cyan(withGlobalFlags2(client,"routes discard-staging"))} to undo.`)}
|
|
10
10
|
`),!hadExistingStagingVersion&&!opts.skipPrompts){if(output_manager_default.print(`
|
|
@@ -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_cjs}from"./chunk-
|
|
7
|
+
import{require_cjs}from"./chunk-DUT4U5YY.js";import{CONTACT_FIELDS,billingFieldsUsed,collectContactInformation,getBillingContact,getDomainPrice,getDomainStatus,mergeContact,missingContactFields,purchaseDomain,readContactFlags}from"./chunk-76SVVWPH.js";import{stamp_default}from"./chunk-A2RZZQEP.js";import{canPrompt}from"./chunk-IQ7FPAI4.js";import{buySubcommand}from"./chunk-TPNOSQZ3.js";import{printError}from"./chunk-G4T7VBGN.js";import{require_strip_ansi}from"./chunk-BS32OUOC.js";import{param}from"./chunk-3G3FQYMW.js";import{TelemetryClient}from"./chunk-2PKEEQ5W.js";import{getScope,scopeFlagPassed}from"./chunk-B4UE4LVE.js";import{AGENT_ACTION,AGENT_REASON,AGENT_STATUS,buildCommandWithGlobalFlags,getExitCodeForReason,outputActionRequired,outputAgentError}from"./chunk-DGYHWXD2.js";import{parseArguments}from"./chunk-VOCZ34ON.js";import{quoteArg}from"./chunk-F53OKXYI.js";import{getFlagsSpecification,getGlobalFlagsFromArgs,validateJsonOutput}from"./chunk-AWMQGOS2.js";import{DomainChargeOutcomeUnknown,DomainPriceChanged,isAPIError}from"./chunk-6VH56CX2.js";import{getCommandName,getCommandNamePlain}from"./chunk-JESNVRVR.js";import{output_manager_default,require_build_utils}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),import_strip_ansi=__toESM(require_strip_ansi(),1),import_tldts=__toESM(require_cjs(),1),import_error_utils=__toESM(require_dist(),1);var DomainsBuyTelemetryClient=class extends TelemetryClient{trackCliArgumentDomain(v){v&&this.trackCliArgument({arg:"domain",value:this.redactedValue})}trackCliOptionAmount(v){this.trackRedactedCliOption("amount",v)}trackCliFlagUseBillingDetails(v){v&&this.trackCliFlag("use-billing-details")}trackCliOptionFirstName(v){this.trackRedactedCliOption("first-name",v)}trackCliOptionLastName(v){this.trackRedactedCliOption("last-name",v)}trackCliOptionEmail(v){this.trackRedactedCliOption("email",v)}trackCliOptionPhone(v){this.trackRedactedCliOption("phone",v)}trackCliOptionAddress(v){this.trackRedactedCliOption("address",v)}trackCliOptionCity(v){this.trackRedactedCliOption("city",v)}trackCliOptionState(v){this.trackRedactedCliOption("state",v)}trackCliOptionZip(v){this.trackRedactedCliOption("zip",v)}trackCliOptionCountry(v){this.trackRedactedCliOption("country",v)}trackCliOptionCompany(v){this.trackRedactedCliOption("company",v)}trackCliFlagAutoRenew(v){v&&this.trackCliFlag("auto-renew")}trackCliFlagNoAutoRenew(v){v&&this.trackCliFlag("no-auto-renew")}trackCliFlagJson(v){v&&this.trackCliFlag("json")}};var import_build_utils=__toESM(require_build_utils(),1);async function getWebhook(client,webhookId){return await client.fetch(`/v1/webhooks/${encodeURIComponent(webhookId)}`)}var TEAM_BUDGET={scope:"team"},BUDGET_THRESHOLD_PERCENTS=[50,75,100],PAUSE_AT_PERCENT=100;function buildThresholds({pause,webhookUrl}){return BUDGET_THRESHOLD_PERCENTS.map(percent=>({percent,sendNotifications:!0,triggerWebhook:!!webhookUrl,pauseUsage:percent===PAUSE_AT_PERCENT?!!pause:!1}))}function thresholdsForSet({existing,pause,pauseSpecified,webhookUrl,webhookSpecified}){if(!existing?.length)return buildThresholds({pause,webhookUrl});let next=existing.map(threshold=>({...threshold}));if(pauseSpecified&&(next=applyPauseToThresholds(next,pause)),webhookSpecified){let triggerWebhook=!!webhookUrl;next=next.map(threshold=>({...threshold,triggerWebhook}))}return next}function hasPauseThreshold(thresholds){return thresholds.some(threshold=>threshold.percent===PAUSE_AT_PERCENT)}function pausePercentsOutside100(thresholds){return thresholds.filter(threshold=>threshold.pauseUsage&&threshold.percent!==PAUSE_AT_PERCENT).map(threshold=>threshold.percent)}function applyPauseToThresholds(thresholds,pause){return pause?thresholds.map(threshold=>({...threshold,pauseUsage:threshold.percent===PAUSE_AT_PERCENT})):thresholds.map(threshold=>({...threshold,pauseUsage:!1}))}function budgetAmountDollars(budget){let n=Number(budget.amount);return Number.isFinite(n)?n:0}function spendDollars(spend){return spend?.currentSpend==null?null:spend.currentSpend/100}function percentUsed(spent,amount){return spent!==null&&amount>0?Math.round(spent/amount*100):null}function spendPayload(spent,amount){return{currentSpend:spent,percentUsed:amount===null?null:percentUsed(spent,amount),unit:"usd"}}var NO_RETRY={retries:0};function budgetPauses(budget){return budget.thresholds.some(t=>t.pauseUsage)}function budgetStatePayload(state){return{id:state.id,teamId:state.teamId,scope:state.scope,amount:state.amount,amountUnit:state.amountUnit,status:state.status,pause:state.pause,webhookId:state.webhookId,webhookUrl:state.webhookUrl,webhookStatus:state.webhookStatus,thresholds:state.thresholds}}function setSavedReceipt({team,reloaded,webhookSecret,amount,scope}){let secret=webhookSecret?{webhookSecret}:{};return reloaded?{ok:!0,saved:!0,reloaded:!0,teamSlug:team.slug,...budgetStatePayload(reloaded),...secret}:{ok:!0,saved:!0,reloaded:!1,teamId:team.id,teamSlug:team.slug,scope,amount,amountUnit:"usd",...secret}}function removeReceipt({team,alreadyAbsent,disabled,scope}){return{ok:!0,alreadyAbsent,disabled,teamId:team.id,teamSlug:team.slug,scope}}function selectorQuery(selector){return new URLSearchParams({scope:selector.scope}).toString()}function matchesSelector(budget,selector){return(budget.scope??selector.scope)===selector.scope}function resolvedBudgetScope(budget,selector=TEAM_BUDGET){return budget.scope??selector.scope}async function toBudgetState(client,budget,selector=TEAM_BUDGET){let webhook=await resolveBudgetWebhook(client,budget);return{id:budget.id,teamId:budget.ownerId,scope:resolvedBudgetScope(budget,selector),amount:budgetAmountDollars(budget),amountUnit:"usd",status:budget.status,pause:budgetPauses(budget),webhookId:webhook.webhookId,webhookUrl:webhook.webhookUrl,webhookStatus:webhook.webhookStatus,thresholds:budget.thresholds.map(threshold=>({...threshold}))}}async function resolveBudgetWebhook(client,budget){if(!budget.webhookId)return{webhookId:null,webhookUrl:null,webhookStatus:"absent"};try{let webhook=await getWebhook(client,budget.webhookId);return{webhookId:budget.webhookId,webhookUrl:webhook.url,webhookStatus:"resolved"}}catch{return{webhookId:budget.webhookId,webhookUrl:null,webhookStatus:"unavailable"}}}function formatUsdWhole(dollars){return`$${dollars.toLocaleString("en-US",{maximumFractionDigits:0})}`}function formatUsd(dollars){return`$${dollars.toLocaleString("en-US",{minimumFractionDigits:2,maximumFractionDigits:2})}`}async function listBudgets(client,selector=TEAM_BUDGET){let{data}=await client.fetch(`/v1/budgets?${selectorQuery(selector)}`,{method:"GET"});return data??[]}async function findBudget(client,selector=TEAM_BUDGET){let budgets=(await listBudgets(client,selector)).filter(budget=>matchesSelector(budget,selector));return budgets.find(b=>b.status==="active")??budgets[0]}async function setBudget(client,input){let selector={scope:input.scope};return client.fetch("/v1/budgets",{method:"POST",retry:{retries:0},body:{amount:input.amount,thresholds:input.thresholds,scope:selector.scope,...input.webhookUrl?{webhookUrl:input.webhookUrl}:{}}})}async function removeBudget(client,budgetId){await client.fetch(`/v1/budgets/${encodeURIComponent(budgetId)}`,{method:"DELETE"})}async function getTeamSpend(client,teamId,selector=TEAM_BUDGET,{retry}={}){let params=new URLSearchParams;selector.scope!=="team"&¶ms.set("scope",selector.scope);let qs=params.toString(),{data}=await client.fetch(`/teams/${encodeURIComponent(teamId)}/spend${qs?`?${qs}`:""}`,{method:"GET",...retry?{retry}:{}});return data??{currentSpend:null,avgSpend:null}}async function listBudgetAlerts(client,selector=TEAM_BUDGET,query={},{retry}={}){let params=new URLSearchParams(selectorQuery(selector));for(let[key,value]of Object.entries(query))value!==void 0&¶ms.set(key,String(value));let page=await client.fetch(`/v1/budgets/alerts?${params}`,{method:"GET",...retry?{retry}:{}});return{data:page.data??[],nextCursor:page.nextCursor}}var AMOUNT_PATTERN=/^\d+(\.\d{1,2})?$/,REASON_BY_CODE={UNSUPPORTED_TLD:AGENT_REASON.TLD_NOT_SUPPORTED,UNSUPPORTED_TLD_VIA_CLI:AGENT_REASON.TLD_NOT_SUPPORTED,INVALID_DOMAIN:AGENT_REASON.INVALID_DOMAIN,DOMAIN_NOT_AVAILABLE:AGENT_REASON.DOMAIN_NOT_AVAILABLE,DOMAIN_PAYMENT_ERROR:AGENT_REASON.PAYMENT_FAILED};function chargeFailureReason(err){let code=err.code;return typeof code=="string"&&REASON_BY_CODE[code]||AGENT_REASON.API_ERROR}function parseAmount(raw){if(raw===void 0)return;let value=raw.trim();return!AMOUNT_PATTERN.test(value)||Number(value)<=0?new Error(`Invalid --amount "${raw}". Use the price in USD, such as 20.00.`):Number(value)}function amountMatchesPrice(amount,price){return Math.round(amount*100)===Math.round(price*100)}function formatAmountArg(price){return price.toFixed(2)}function formatTerm(years){return`${years} ${years===1?"year":"years"}`}function canPromptForCharge(client,json){return canPrompt(client)&&!process.env.CI&&!json}function chargeFlagWithValue(argv,flags){for(let arg of argv){if(arg==="--")break;let name=arg.split("=")[0];if(arg.includes("=")&&flags.includes(name))return`${name} doesn't take a value. Pass it on its own, or leave it out${name==="--auto-renew"?" and pass --no-auto-renew":""}.`}}function chargeTeamStatus(client,teamId){let orgId=(0,import_build_utils.getPlatformEnv)("ORG_ID");return orgId&&orgId!==teamId?"conflict":scopeFlagPassed(client.argv)||orgId===teamId?"named":"unnamed"}function printChargeRecovery(headline,instruction,command){output_manager_default.fatal(`${headline}
|
|
8
8
|
|
|
9
9
|
${instruction}:
|
|
10
10
|
${command}`)}function writeChargeAction(client,json,payload){outputActionRequired(client,payload,1),json&&client.stdout.write(`${JSON.stringify(payload,null,2)}
|
|
@@ -14,4 +14,4 @@ ${opts.apiMessage}`:payload.message;return opts.recovery?printChargeRecovery(hea
|
|
|
14
14
|
`),0):(client.stdout.write(`${domainName}
|
|
15
15
|
`),output_manager_default.success(`Domain ${param(domainName)} purchased ${purchaseStamp()}`),output_manager_default.log(`Charged ${formatUsd(purchasePrice)} for ${formatTerm(years)}. Registered to ${contactInformation.firstName} ${contactInformation.lastName} (${contactInformation.email}).`),output_manager_default.note(`You may now use your domain as an alias to your deployments. Run ${getCommandName("alias --help")}`),0)}function requireApproval(client,opts){let{domain,price,renewalPrice,years,billing,autoRenew}=opts,shown=billingFieldsUsed(opts.fromFlags,billing),shownFields=CONTACT_FIELDS.filter(({field})=>shown[field]),hasBilling=shownFields.length>0,useBilling=opts.useBilling||hasBilling,missing=missingContactFields(mergeContact(opts.fromFlags,useBilling?billing:{})),missingFlags=missing.map(flagFor),missingNow=missingContactFields(mergeContact(opts.fromFlags,opts.useBilling?billing:{})),needs=[...opts.amount===void 0?["an approved price (--amount)"]:[],...autoRenew===void 0?["an auto-renew choice (--auto-renew or --no-auto-renew)"]:[],...missingNow.length>0?["registrant details"]:[]],headline=`Can't buy ${domain} without ${needs.join(" and ")} in non-interactive mode.`,every=years===1?"year":formatTerm(years),renewal=autoRenew===void 0?`Auto-renew isn't chosen: --auto-renew renews it every ${every} (currently ${formatUsd(renewalPrice)}), --no-auto-renew lets it expire.`:autoRenew?`Then it auto-renews every ${every} (currently ${formatUsd(renewalPrice)}).`:"Auto-renew is off.",priceLine=`Price: ${formatUsd(price)} for ${formatTerm(years)}, charged to ${opts.contextName}. ${renewal}`,stillNeeded=missingFlags.length>0?`Still needed: ${missingFlags.join(", ")}.`:"",next=(autoRenew===void 0?[!0,!1]:[autoRenew]).map(renews=>({command:buildBuyCommand(client,domain,{team:opts.team,amount:price,useBilling,contact:opts.fromFlags,missing,autoRenew:renews,json:opts.json}),when:`Only after a human approves: charges ${formatUsd(price)} now${renews?` and renews every ${every} (currently ${formatUsd(renewalPrice)})`:", with no renewal"}`}));writeChargeAction(client,opts.json,{status:AGENT_STATUS.ACTION_REQUIRED,reason:opts.amount===void 0||autoRenew===void 0?AGENT_REASON.CONFIRMATION_REQUIRED:AGENT_REASON.MISSING_REQUIREMENTS,action:AGENT_ACTION.CONFIRMATION_REQUIRED,message:[headline,priceLine,hasBilling?`The team's billing info has the registrant ${shownFields.map(({label})=>label.toLowerCase()).join(", ")} (data.billingDetails). Confirm them with the user; --use-billing-details uses them, and any contact option you pass replaces them.`:"",stillNeeded].filter(Boolean).join(" "),userActionRequired:!0,hint:"Show the user the price, renewal terms, and registrant details, and get their approval before running next[]. Domain registrations are non-refundable.",data:{domain,...opts.team&&{team:opts.team},amount:price,currency:"USD",years,autoRenew:autoRenew??null,renewalAmount:renewalPrice,...hasBilling&&{billingDetails:shown}},missing:[...opts.amount===void 0?["--amount"]:[],...autoRenew===void 0?["--auto-renew|--no-auto-renew"]:[],...useBilling&&!opts.useBilling?["--use-billing-details"]:[],...missingFlags],next});let billingRows=hasBilling?[`From ${opts.contextName}'s billing info:`,...shownFields.map(({field,label})=>` ${label.padEnd(10)}${(0,import_strip_ansi.default)(shown[field])}`)]:[];return printChargeRecovery([headline,priceLine,...billingRows,stillNeeded].filter(Boolean).join(`
|
|
16
16
|
`),next.length>1?"Once a person approves the price, details, and auto-renew choice, run one of":"Once a person approves the price and details, run",next.map(({command})=>command).join(`
|
|
17
|
-
`)),1}async function removeAliasById(client,id){return client.fetch(`/now/aliases/${id}`,{method:"DELETE"})}function isDomainExternal(domain){return domain.serviceType!=="zeit.world"}async function deleteCertById(client,id){return client.fetch(`/v5/certs/${id}`,{method:"DELETE"})}async function getDomains(client,next,limit=20){let domainUrl=`/v5/domains?limit=${limit}`;return next&&(domainUrl+=`&until=${next}`),await client.fetch(domainUrl)}function teamMemberLabel(member){return member.username||member.email||member.uid}function fetchMembers(client,teamId,opts){let query=new URLSearchParams({limit:"100"});opts.search&&query.set("search",opts.search);for(let id of opts.userIds??[])query.append("filterByUserIds",id);return client.fetch(`/v2/teams/${encodeURIComponent(teamId)}/members?${query}`).then(res=>res.members??[])}async function getTeamMemberByIdentifier(client,teamId,identifier){let needle=identifier.toLowerCase(),match=(await fetchMembers(client,teamId,{search:identifier})).find(member=>member.uid===identifier||member.email?.toLowerCase()===needle||member.username?.toLowerCase()===needle);return match||((await fetchMembers(client,teamId,{userIds:[identifier]})).find(member=>member.uid===identifier)??null)}async function getTeamMembersByIds(client,teamId,uids){let chunks=[];for(let i=0;i<uids.length;i+=20)chunks.push(uids.slice(i,i+20));let pages=await Promise.all(chunks.map(userIds=>fetchMembers(client,teamId,{userIds})));return new Map(pages.flat().map(member=>[member.uid,member]))}export{removeAliasById,isDomainExternal,getWebhook,TEAM_BUDGET,thresholdsForSet,hasPauseThreshold,pausePercentsOutside100,budgetAmountDollars,budgetPauses,budgetStatePayload,setSavedReceipt,removeReceipt,toBudgetState,formatUsdWhole,formatUsd,listBudgets,findBudget,setBudget,removeBudget,getTeamSpend,chargeFailureReason,parseAmount,amountMatchesPrice,formatAmountArg,formatTerm,canPromptForCharge,printChargeRecovery,writeChargeAction,reportUsageError,reportChargeFailure,reportUnknownOutcome,refuseUnnamedTeam,reportPriceChanged,buy,deleteCertById,getDomains,teamMemberLabel,getTeamMemberByIdentifier,getTeamMembersByIds};
|
|
17
|
+
`)),1}async function removeAliasById(client,id){return client.fetch(`/now/aliases/${id}`,{method:"DELETE"})}function isDomainExternal(domain){return domain.serviceType!=="zeit.world"}async function deleteCertById(client,id){return client.fetch(`/v5/certs/${id}`,{method:"DELETE"})}async function getDomains(client,next,limit=20){let domainUrl=`/v5/domains?limit=${limit}`;return next&&(domainUrl+=`&until=${next}`),await client.fetch(domainUrl)}function teamMemberLabel(member){return member.username||member.email||member.uid}function fetchMembers(client,teamId,opts){let query=new URLSearchParams({limit:"100"});opts.search&&query.set("search",opts.search);for(let id of opts.userIds??[])query.append("filterByUserIds",id);return client.fetch(`/v2/teams/${encodeURIComponent(teamId)}/members?${query}`).then(res=>res.members??[])}async function getTeamMemberByIdentifier(client,teamId,identifier){let needle=identifier.toLowerCase(),match=(await fetchMembers(client,teamId,{search:identifier})).find(member=>member.uid===identifier||member.email?.toLowerCase()===needle||member.username?.toLowerCase()===needle);return match||((await fetchMembers(client,teamId,{userIds:[identifier]})).find(member=>member.uid===identifier)??null)}async function getTeamMembersByIds(client,teamId,uids){let chunks=[];for(let i=0;i<uids.length;i+=20)chunks.push(uids.slice(i,i+20));let pages=await Promise.all(chunks.map(userIds=>fetchMembers(client,teamId,{userIds})));return new Map(pages.flat().map(member=>[member.uid,member]))}export{removeAliasById,isDomainExternal,getWebhook,TEAM_BUDGET,thresholdsForSet,hasPauseThreshold,pausePercentsOutside100,budgetAmountDollars,spendDollars,percentUsed,spendPayload,NO_RETRY,budgetPauses,budgetStatePayload,setSavedReceipt,removeReceipt,toBudgetState,formatUsdWhole,formatUsd,listBudgets,findBudget,setBudget,removeBudget,getTeamSpend,listBudgetAlerts,chargeFailureReason,parseAmount,amountMatchesPrice,formatAmountArg,formatTerm,canPromptForCharge,printChargeRecovery,writeChargeAction,reportUsageError,reportChargeFailure,reportUnknownOutcome,refuseUnnamedTeam,reportPriceChanged,buy,deleteCertById,getDomains,teamMemberLabel,getTeamMemberByIdentifier,getTeamMembersByIds};
|
|
@@ -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,projectOption}from"./chunk-
|
|
7
|
+
import{formatOption,jsonOption,limitOption,projectOption}from"./chunk-AWMQGOS2.js";import{packageName}from"./chunk-JESNVRVR.js";var projectScopeOption={...projectOption,shorthand:"p",description:"Project name or ID (default: 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};
|
|
@@ -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{getScope}from"./chunk-
|
|
7
|
+
import{getScope}from"./chunk-B4UE4LVE.js";import{sleep}from"./chunk-KNLGWGUE.js";import{DomainChargeOutcomeUnknown,DomainNotAvailable,DomainPaymentError,DomainPriceChanged,DomainPurchaseRefundFailed,DomainPurchaseRefunded,InvalidDomain,TLDNotSupportedViaCLI,UnexpectedDomainPurchaseError,UnsupportedTLD,isAPIError}from"./chunk-6VH56CX2.js";import{output_manager_default}from"./chunk-XP3FT56R.js";async function getDomainPrice(client,name){try{return await client.fetch(`/v1/registrar/domains/${name}/price`)}catch(err){if(isAPIError(err)){if(err.code==="tld_not_supported")return new UnsupportedTLD(name);if(err.status<500)return err}throw err}}async function getDomainStatus(client,domain){return client.fetch(`/v1/registrar/domains/${encodeURIComponent(domain)}/availability`)}function getOrderOutcome(order,domain){let item=order.domains.find(d=>d.domainName===domain);return order.status==="completed"&&item?.status==="completed"?"completed":order.error?.code==="payment-failed"?"payment_failed":item?.status==="refund-failed"?"refund_failed":item?.status==="refunded"?"refunded":item?.status==="failed"?"failed":"unknown"}async function getOrder(client,orderId){let{team}=await getScope(client),teamParam=team?`?teamId=${team.slug}`:"";try{return await client.fetch(`/v1/registrar/orders/${orderId}${teamParam}`)}catch(err){if(isAPIError(err)){if(err.code==="not_found")return null;if(err.status<500)return err}throw err}}var pollForOrder=async(client,orderId,timeoutMs=1e4)=>{let startTime=Date.now();for(;Date.now()-startTime<timeoutMs;){let order=await getOrder(client,orderId);if(order!==null&&(order.status==="completed"||order.status==="failed"))return order;await sleep(500)}return null};async function purchaseDomain(client,name,expectedPrice,years,autoRenew=!0,contactInformation){let{team}=await getScope(client),teamParam=team?`?teamId=${team.slug}`:"",orderId;try{({orderId}=await client.fetch(`/v1/registrar/domains/${name}/buy${teamParam}`,{body:{expectedPrice,autoRenew,years,contactInformation},method:"POST",retry:{retries:0},bailOn429:!0}))}catch(err){if(isAPIError(err)&&err.status<500){if(err.code==="invalid_domain")return new InvalidDomain(name);if(err.code==="domain_not_available")return new DomainNotAvailable(name);if(err.code==="tld_not_supported")return new UnsupportedTLD(name);if(err.code==="additional_contact_info_required")return new TLDNotSupportedViaCLI(name);if(err.code==="expected_price_mismatch")return new DomainPriceChanged(name);throw err}return new DomainChargeOutcomeUnknown(name,"buy")}let order;try{order=await pollForOrder(client,orderId)}catch{order=null}if(order===null)return new DomainChargeOutcomeUnknown(name,"buy");switch(getOrderOutcome(order,name)){case"completed":return{orderId};case"payment_failed":return new DomainPaymentError;case"refund_failed":return new DomainPurchaseRefundFailed(name);case"refunded":return new DomainPurchaseRefunded(name);case"failed":return new UnexpectedDomainPurchaseError(name);case"unknown":return new DomainChargeOutcomeUnknown(name,"buy")}}var CONTACT_FIELDS=[{field:"firstName",flag:"--first-name",label:"First name",prompt:"First name:",validate:val=>val.length>0||"First name is required"},{field:"lastName",flag:"--last-name",label:"Last name",prompt:"Last name:",validate:val=>val.length>0||"Last name is required"},{field:"email",flag:"--email",label:"Email",prompt:"Email:",validate:val=>val.length===0?"Email is required":/^[^\s@]+@[^\s@]+\.[^\s@]+$/.test(val)?!0:"Invalid email format"},{field:"phone",flag:"--phone",label:"Phone",prompt:"Phone (include country code, e.g., +15551234567):",validate:val=>val.length===0?"Phone is required":/^\+\d{10,15}$/.test(val)?!0:"Phone must start with + and contain 10-15 digits"},{field:"address1",flag:"--address",label:"Address",prompt:"Address:",validate:val=>val.length>0||"Address is required"},{field:"city",flag:"--city",label:"City",prompt:"City:",validate:val=>val.length>0||"City is required"},{field:"state",flag:"--state",label:"State",prompt:"State/Province:",validate:val=>val.length>0||"State/Province is required"},{field:"zip",flag:"--zip",label:"ZIP",prompt:"Postal/ZIP code:",validate:val=>val.length>0||"Postal/ZIP code is required"},{field:"country",flag:"--country",label:"Country",prompt:"Country code (2 letters, e.g., US):",validate:val=>val.length===0?"Country code is required":/^[A-Z]{2}$/i.test(val)?!0:"Country code must be 2 letters"},{field:"companyName",flag:"--company",label:"Company",prompt:"Company name (optional):"}],ADDRESS_FIELDS=new Set(["address1","city","state","zip","country"]);function readContactFlags(flags){let contact={};for(let{field,flag,validate}of CONTACT_FIELDS){let raw=flags[flag];if(typeof raw!="string")continue;let value=raw.trim(),result=validate?validate(value):!0;if(result!==!0)return`Invalid ${flag}. ${result}.`;contact[field]=field==="country"?value.toUpperCase():value}return contact}function getBillingContact(team){let billing=team?.billing;if(!billing)return{};let address=billing.address,line1=address?.line1?.trim(),line2=address?.line2?.trim(),country=address?.country?.trim().toUpperCase(),rawState=address?.state?.trim(),state=country&&rawState?.toUpperCase().startsWith(`${country}-`)?rawState.slice(country.length+1):rawState,candidates={email:billing.email,address1:line1&&line2?`${line1}, ${line2}`:line1,city:address?.city,state:country==="US"&&!/^[A-Z]{2}$/i.test(state??"")?"":state,zip:address?.postalCode,country},contact={};for(let{field,validate}of CONTACT_FIELDS){let value=candidates[field]?.trim();value&&(!validate||validate(value)===!0)&&(contact[field]=value)}return contact}function mergeContact(fromFlags,billing){let ownAddress=[...ADDRESS_FIELDS].some(field=>fromFlags[field]!==void 0&&billing[field]!==void 0),merged={};for(let{field}of CONTACT_FIELDS){let fallback=ownAddress&&ADDRESS_FIELDS.has(field)?void 0:billing[field],value=fromFlags[field]??fallback;value!==void 0&&(merged[field]=value)}return merged}function billingFieldsUsed(fromFlags,billing){let merged=mergeContact(fromFlags,billing),used={};for(let{field}of CONTACT_FIELDS)fromFlags[field]===void 0&&merged[field]!==void 0&&(used[field]=merged[field]);return used}function missingContactFields(contact){return CONTACT_FIELDS.filter(({field,validate})=>validate&&!contact[field]).map(({field})=>field)}async function collectContactInformation(client,{provided={},defaults={}}={}){let contact={...provided},pending=CONTACT_FIELDS.filter(({field})=>!(field in provided));pending.length>0&&(output_manager_default.log(""),output_manager_default.log("Please provide contact information for domain registration:"));for(let{field,prompt,validate}of pending){let value=await client.input.text({message:prompt,default:defaults[field],validate});value&&(contact[field]=value)}return{...contact,country:contact.country.toUpperCase(),companyName:contact.companyName||void 0}}export{getDomainPrice,getDomainStatus,getOrderOutcome,pollForOrder,purchaseDomain,CONTACT_FIELDS,readContactFlags,getBillingContact,mergeContact,billingFieldsUsed,missingContactFields,collectContactInformation};
|
|
@@ -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{outputError}from"./chunk-
|
|
7
|
+
import{outputError}from"./chunk-RW3X523R.js";import{require_execa}from"./chunk-BUJITHGZ.js";import{getScope}from"./chunk-B4UE4LVE.js";import{require_ms}from"./chunk-MXTC4ZAQ.js";import{AGENT_REASON,buildCommandWithGlobalFlags,outputAgentError}from"./chunk-DGYHWXD2.js";import{getLinkedProject,getProjectByNameOrId}from"./chunk-KNLGWGUE.js";import{validateJsonOutput}from"./chunk-AWMQGOS2.js";import{require_lib}from"./chunk-FUX6LKNP.js";import{ProjectNotFound,isAPIError,require_bytes}from"./chunk-6VH56CX2.js";import{packageName}from"./chunk-JESNVRVR.js";import{output_manager_default}from"./chunk-XP3FT56R.js";import{__toESM}from"./chunk-BZENIQ7N.js";function emitVcrScopeError(client,jsonOutput,code,message,agent){return outputAgentError(client,{status:"error",reason:agent.reason,message,hint:agent.hint,next:agent.next},1),outputError(client,jsonOutput,code,message)}async function resolveVcrScope(client,opts){if(opts.project){let{team}=await getScope(client);if(!team){let msg="No team context found. Run `vercel switch` to select a team, or use `vercel link` in a project directory.";return emitVcrScopeError(client,opts.jsonOutput,"NO_TEAM",msg,{reason:AGENT_REASON.MISSING_SCOPE,hint:"Select a team scope before using --project with vcr.",next:[{command:buildCommandWithGlobalFlags(client.argv,"whoami"),when:"See current user and team"},{command:buildCommandWithGlobalFlags(client.argv,"teams switch"),when:"Switch to a team that owns the project"}]})}let projectResult;try{projectResult=await getProjectByNameOrId(client,opts.project,team.id)}catch(err){if(isAPIError(err)){let msg=err.serverMessage||(err.status===403?`You do not have permission to access project "${opts.project}" in team "${team.slug}".`:`API error (${err.status}).`),reason=err.status===401?"not_authorized":err.status===403?"forbidden":AGENT_REASON.API_ERROR;return emitVcrScopeError(client,opts.jsonOutput,err.code||"API_ERROR",msg,{reason,next:[{command:buildCommandWithGlobalFlags(client.argv,"vcr ls --project <name_or_id>"),when:"Retry with a project you can access (replace <name_or_id>)"}]})}throw err}if(projectResult instanceof ProjectNotFound){let msg=`Project "${opts.project}" was not found in team "${team.slug}".`;return emitVcrScopeError(client,opts.jsonOutput,"PROJECT_NOT_FOUND",msg,{reason:AGENT_REASON.NOT_FOUND,next:[{command:buildCommandWithGlobalFlags(client.argv,"project ls"),when:"List projects in the current team to pick a name"}]})}return{teamId:team.id,teamSlug:team.slug,projectId:projectResult.id,projectName:projectResult.name}}let linkedProject=await getLinkedProject(client);if(linkedProject.status==="error")return linkedProject.exitCode;if(linkedProject.status==="not_linked"){let msg="No linked project found. Run `vercel link` to link a project, or pass --project <name>.";return emitVcrScopeError(client,opts.jsonOutput,"NOT_LINKED",msg,{reason:AGENT_REASON.NOT_LINKED,hint:"Agents should pass --project when no .vercel link exists in --cwd.",next:[{command:buildCommandWithGlobalFlags(client.argv,"link"),when:"Link this directory to a Vercel project"},{command:buildCommandWithGlobalFlags(client.argv,"vcr ls --project <name_or_id>"),when:"List repositories for a project without linking (replace <name_or_id>)"}]})}return{teamId:linkedProject.org.id,teamSlug:linkedProject.org.slug,projectId:linkedProject.project.id,projectName:linkedProject.project.name}}var import_ms=__toESM(require_ms(),1),import_bytes=__toESM(require_bytes(),1);function formatBytes(size){return typeof size!="number"||Number.isNaN(size)?"-":import_bytes.default.format(size,{decimalPlaces:1})??"-"}function formatRelativeTime(iso){let time=new Date(iso).getTime();return Number.isNaN(time)?"-":`${(0,import_ms.default)(Date.now()-time)} ago`}function formatDigest(digest){return digest?digest.replace(/^sha256:/,"").slice(0,12):"-"}function formatImageStatus(status){switch(status){case"ready":return"Ready";case"preparing":return"Preparing";case"unoptimized":return"Ready (unoptimized)";default:return"-"}}var VCR_REGISTRY="vcr.vercel.com";function formatImageReference(teamSlug,projectName,repositoryName,digest){return digest?`${VCR_REGISTRY}/${teamSlug}/${projectName}/${repositoryName}@${digest}`:"-"}function formatTagReference(teamSlug,projectName,repositoryName,tag){return tag?`${VCR_REGISTRY}/${teamSlug}/${projectName}/${repositoryName}:${tag}`:"-"}function validateVcrJsonOutput(client,flags){let fr=validateJsonOutput(flags);return fr.valid?{jsonOutput:fr.jsonOutput}:(outputAgentError(client,{status:"error",reason:AGENT_REASON.INVALID_ARGUMENTS,message:fr.error},2),output_manager_default.error(fr.error),2)}function validateVcrChoice(client,flag,value,choices,jsonOutput){if(value===void 0||choices.includes(value))return;let message=`Invalid value for ${flag}: "${value}". Must be one of: ${choices.join(", ")}.`;return outputAgentError(client,{status:"error",reason:AGENT_REASON.INVALID_ARGUMENTS,message},2),outputError(client,jsonOutput,"INVALID_ARGUMENTS",message)}function requireVcrRepository(client,repository,jsonOutput,usage){if(!repository)return outputAgentError(client,{status:"error",reason:AGENT_REASON.MISSING_ARGUMENTS,message:`Missing repository. Example: ${packageName} ${usage}`,next:[{command:buildCommandWithGlobalFlags(client.argv,"vcr ls"),when:"List repositories to pick a name or id"}]},2),outputError(client,jsonOutput,"MISSING_ARGUMENTS",`Usage: \`vercel ${usage}\``)}function requireVcrRepositoryAndTag(client,repository,tag,jsonOutput,usage){if(!(repository&&tag))return outputAgentError(client,{status:"error",reason:AGENT_REASON.MISSING_ARGUMENTS,message:`Missing arguments. Example: ${packageName} ${usage}`,next:[{command:buildCommandWithGlobalFlags(client.argv,"vcr tag ls <repository>"),when:"List tags to pick a tag (replace <repository>)"}]},2),outputError(client,jsonOutput,"MISSING_ARGUMENTS",`Usage: \`vercel ${usage}\``)}function requireVcrRepositoryAndImageId(client,repository,imageId,jsonOutput,usage){if(!(repository&&imageId))return outputAgentError(client,{status:"error",reason:AGENT_REASON.MISSING_ARGUMENTS,message:`Missing arguments. Example: ${packageName} ${usage}`,next:[{command:buildCommandWithGlobalFlags(client.argv,"vcr image ls <repository>"),when:"List images to pick an image id (replace <repository>)"}]},2),outputError(client,jsonOutput,"MISSING_ARGUMENTS",`Usage: \`vercel ${usage}\``)}var import_which=__toESM(require_lib(),1),import_execa=__toESM(require_execa(),1);var VCR_ENGINES=["docker","podman","buildah"],VCR_LOGIN_USERNAME="oidc";function resolveRegistry(){return process.env.VERCEL_VCR_REGISTRY||VCR_REGISTRY}function isEngineInstalled(engine){return import_which.default.sync(engine,{nothrow:!0})!==null}function splitPassthrough(argv){let idx=argv.indexOf("--");return idx===-1?{own:argv.slice(2),passthrough:[]}:{own:argv.slice(2,idx),passthrough:argv.slice(idx+1)}}async function isBuildxAvailable(){let result=await(0,import_execa.default)("docker",["buildx","version"],{reject:!1,stdio:"ignore"});return result instanceof Error?!1:result.exitCode===0}function pushCompressionArgs(engine){return engine==="docker"?[]:["--compression-format","zstd","--compression-level","3"]}var AUTH_FAILURE=/\b(?:unauthorized|denied|forbidden)\b\s*:|authentication required|access to the resource is denied|\b(?:401 unauthorized|403 forbidden)\b/i,CREDENTIAL_STORE_CONFLICT=/already exists in the keychain|errSecDuplicateItem/i;function stderrTail(stderr){return stderr.trim().split(`
|
|
8
8
|
`).slice(-5).join(`
|
|
9
9
|
`)}async function engineLogin(engine,registry,token){let result=await(0,import_execa.default)(engine,["login",registry,"--username",VCR_LOGIN_USERNAME,"--password-stdin"],{input:token,reject:!1});return result instanceof Error&&typeof result.exitCode!="number"?{exitCode:1,stderr:result.message}:{exitCode:typeof result.exitCode=="number"?result.exitCode:1,stderr:result.stderr??""}}async function engineLogout(engine,registry){await(0,import_execa.default)(engine,["logout",registry],{reject:!1,stdio:"ignore"})}async function runEngine(engine,args,opts){if(opts.captureStderr){let subprocess=(0,import_execa.default)(engine,args,{cwd:opts.cwd,stdio:["inherit","inherit","pipe"],reject:!1});subprocess.stderr?.pipe(process.stderr);let result2=await subprocess;return result2 instanceof Error&&typeof result2.exitCode!="number"?{exitCode:1,stderr:result2.message}:{exitCode:typeof result2.exitCode=="number"?result2.exitCode:1,stderr:result2.stderr??""}}let result=await(0,import_execa.default)(engine,args,{cwd:opts.cwd,stdio:"inherit",reject:!1});return result instanceof Error&&typeof result.exitCode!="number"?{exitCode:1,stderr:result.message}:{exitCode:typeof result.exitCode=="number"?result.exitCode:1,stderr:""}}var NOT_AUTHORIZED_MESSAGE="You do not have access to the container registry in this scope. Ensure your role can manage the project, or pass --token and --scope.",NOT_AUTHORIZED_HINT="Confirm team scope with whoami; use --scope <team-slug> if the repository lives under another team.",genericMessage=err=>err.serverMessage||`API error (${err.status}).`,STATUS_INFO={401:{reason:"not_authorized",message:()=>NOT_AUTHORIZED_MESSAGE,hint:NOT_AUTHORIZED_HINT,suggestWhoami:!0},403:{reason:"forbidden",message:()=>NOT_AUTHORIZED_MESSAGE,hint:NOT_AUTHORIZED_HINT,suggestWhoami:!0},404:{reason:AGENT_REASON.NOT_FOUND,message:genericMessage},409:{reason:"conflict",message:genericMessage},429:{reason:"rate_limited",message:genericMessage}};function resolveStatusInfo(err){return STATUS_INFO[err.status]?STATUS_INFO[err.status]:err.status>=500?{reason:AGENT_REASON.API_ERROR,message:()=>`The container registry endpoint failed (${err.status}). Re-run with --debug and share the x-vercel-id from the failed request.`}:{reason:AGENT_REASON.API_ERROR,message:genericMessage}}function handleVcrApiError(client,err,jsonOutput,opts={}){let info=resolveStatusInfo(err),message=info.message(err),next=[];return info.suggestWhoami&&next.push({command:buildCommandWithGlobalFlags(client.argv,"whoami"),when:"See current user and team"}),opts.retry&&next.push(opts.retry),outputAgentError(client,{status:"error",reason:info.reason,message,...info.hint?{hint:info.hint}:{},...next.length>0?{next}:{}},1),outputError(client,jsonOutput,err.code||"API_ERROR",message)}function reportEngineCommandFailure(client,engine,verb,result){let tail=stderrTail(result.stderr),message=`\`${engine} ${verb}\` failed (exit code ${result.exitCode}).${tail?`
|
|
10
10
|
${tail}`:""}`;return outputAgentError(client,{status:"error",reason:"command_failed",message},1),outputError(client,!1,"COMMAND_FAILED",message)}function reportEnginePushFailure(client,engine,verb,result){if(AUTH_FAILURE.test(result.stderr)){let message=`Push to ${resolveRegistry()} was rejected. Your registry credentials may be missing or expired.`;return outputAgentError(client,{status:"error",reason:"not_authorized",message,next:[{command:buildCommandWithGlobalFlags(client.argv,`vcr login ${engine}`),when:"Refresh registry credentials (valid ~12 hours)"}]},1),outputError(client,!1,"NOT_AUTHORIZED",message)}return reportEngineCommandFailure(client,engine,verb,result)}function emitVcrArgParseError(client,err,recoverTemplate){let msg=err instanceof Error?err.message:String(err),projectFlagMissingArg=msg.includes("--project")&&msg.includes("requires argument");outputAgentError(client,{status:"error",reason:AGENT_REASON.INVALID_ARGUMENTS,message:projectFlagMissingArg?"`--project` requires a project name or id (for example `--project my-app`).":msg,next:[{command:buildCommandWithGlobalFlags(client.argv,recoverTemplate),when:projectFlagMissingArg?"Re-run with a project name or id (replace placeholder)":"See valid usage"}]},2)}export{resolveVcrScope,formatBytes,formatRelativeTime,formatDigest,formatImageStatus,formatImageReference,formatTagReference,validateVcrJsonOutput,validateVcrChoice,requireVcrRepository,requireVcrRepositoryAndTag,requireVcrRepositoryAndImageId,VCR_ENGINES,VCR_LOGIN_USERNAME,resolveRegistry,isEngineInstalled,splitPassthrough,isBuildxAvailable,pushCompressionArgs,AUTH_FAILURE,CREDENTIAL_STORE_CONFLICT,stderrTail,engineLogin,engineLogout,runEngine,handleVcrApiError,reportEngineCommandFailure,reportEnginePushFailure,emitVcrArgParseError};
|
|
@@ -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{getSubcommand}from"./chunk-ETV3C2CV.js";import{monitorsCommand,monitorsNotificationsAggregateCommand}from"./chunk-QZX7VG2V.js";import{TelemetryClient}from"./chunk-2PKEEQ5W.js";import{AGENT_REASON,buildCommandWithGlobalFlags,outputAgentError}from"./chunk-DGYHWXD2.js";import{takeCommand}from"./chunk-VOCZ34ON.js";import{getFlagsSpecification,warnDeprecatedSubcommand}from"./chunk-AWMQGOS2.js";import{output_manager_default}from"./chunk-XP3FT56R.js";var MonitorsTelemetryClient=class extends TelemetryClient{trackCliSubcommandLs(actual){this.trackCliSubcommand({subcommand:"ls",value:actual})}trackCliSubcommandSchema(actual){this.trackCliSubcommand({subcommand:"schema",value:actual})}trackCliSubcommandAdd(actual){this.trackCliSubcommand({subcommand:"add",value:actual})}trackCliSubcommandInspect(actual){this.trackCliSubcommand({subcommand:"inspect",value:actual})}trackCliSubcommandRemove(actual){this.trackCliSubcommand({subcommand:"remove",value:actual})}trackCliSubcommandUpdate(actual){this.trackCliSubcommand({subcommand:"update",value:actual})}trackCliSubcommandNotifications(actual){this.trackCliSubcommand({subcommand:"notifications",value:actual})}trackCliOptionType(v){v&&v.length>0&&this.trackCliOption({option:"type",value:v.join(",")})}trackCliFlagAll(v){v&&this.trackCliFlag("all")}trackCliFlagJson(v){v&&this.trackCliFlag("json")}};var MONITORS_CONFIG={ls:["ls","list"],schema:["schema"],add:["add","create"],inspect:["inspect","get"],remove:["remove","rm","delete"],update:["update","patch"],notifications:["notifications"]},monitorsRoutingFlags=getFlagsSpecification([...monitorsCommand.subcommands,...monitorsNotificationsAggregateCommand.subcommands].flatMap(command=>[...command.options]));async function runMonitors(client,argv,api){let{command,args:argsWithoutCommand}=takeCommand(argv,monitorsRoutingFlags),found=command?getSubcommand([command],MONITORS_CONFIG):void 0;if(command&&found?.subcommand==null)return outputAgentError(client,{status:"error",reason:AGENT_REASON.INVALID_ARGUMENTS,message:`Unknown "monitors" subcommand "${command}".`,next:[{command:buildCommandWithGlobalFlags(client.argv,"monitors --help"),when:"Show valid monitors subcommands"}]},2),output_manager_default.error(`Unknown "monitors" subcommand "${command}". Run \`vercel monitors --help\`.`),2;let resolved=found?.subcommand??"ls",original=found?.subcommandOriginal??"ls",args=found?argsWithoutCommand:argv,telemetry=new MonitorsTelemetryClient({opts:{store:client.telemetryEventStore}});switch(resolved){case"ls":return telemetry.trackCliSubcommandLs(original),(await import("./ls-5ZEAKKPQ.js")).default(client,args,api,telemetry);case"schema":return telemetry.trackCliSubcommandSchema(original),(await import("./schema-BEUO7G52.js")).default(client,args,api);case"add":return telemetry.trackCliSubcommandAdd(original),original==="create"&&warnDeprecatedSubcommand(client,"monitors create","monitors add"),(await import("./add-A524QQ2H.js")).default(client,args,api);case"inspect":return telemetry.trackCliSubcommandInspect(original),original==="get"&&warnDeprecatedSubcommand(client,"monitors get","monitors inspect"),(await import("./rule-inspect-BOETGPFO.js")).default(client,args,api);case"remove":return telemetry.trackCliSubcommandRemove(original),original==="delete"&&warnDeprecatedSubcommand(client,"monitors delete","monitors remove"),(await import("./rm-BPILSPUI.js")).default(client,args,api);case"update":return telemetry.trackCliSubcommandUpdate(original),original==="patch"&&warnDeprecatedSubcommand(client,"monitors patch","monitors update"),(await import("./update-25CKNOY5.js")).default(client,args,api);case"notifications":return(await import("./notifications-KFZ333V5.js")).default(client,args,api,telemetry);default:return output_manager_default.error(`Unhandled monitors subcommand: ${String(resolved)}`),1}}export{monitorsRoutingFlags,runMonitors};
|