@vercel/cli-support 67.0.0 → 68.0.0-snapshot-224301946cd2
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-SWKAAP2V.js → add-4KBCK23F.js} +1 -1
- package/dist/chunks/{add-PULH4LLG.js → add-XAXZ7GQY.js} +1 -1
- package/dist/chunks/add-YQUNDDNA.js +8 -0
- package/dist/chunks/{alerts-GXY7LZWX.js → alerts-DUTGB7DI.js} +1 -1
- package/dist/chunks/{build-UNR3B22D.js → build-TM2QAMXR.js} +1 -1
- package/dist/chunks/{chunk-5CFLIIMP.js → chunk-2HFP22IP.js} +1 -1
- package/dist/chunks/{chunk-6D44CCJA.js → chunk-35VK27MF.js} +4 -3
- package/dist/chunks/{chunk-C7TNFTTK.js → chunk-3BTI6JHC.js} +1 -1
- package/dist/chunks/{chunk-URJT7V4L.js → chunk-4D5DAM3D.js} +1 -1
- package/dist/chunks/chunk-5UG4YYEX.js +12 -0
- package/dist/chunks/{chunk-KC5BRLPR.js → chunk-5ZYYUQZI.js} +1 -1
- package/dist/chunks/{chunk-742MHFPK.js → chunk-67D4BIBH.js} +2 -2
- package/dist/chunks/{chunk-YBKH3IDY.js → chunk-6YBVHJRH.js} +1 -1
- package/dist/chunks/{chunk-EOUT7E7U.js → chunk-7AAYWDIZ.js} +2 -2
- package/dist/chunks/{chunk-X3LOIVIS.js → chunk-7GJ37QPL.js} +1 -1
- package/dist/chunks/{chunk-GT3JH2FU.js → chunk-7K5ZWVDL.js} +1 -1
- package/dist/chunks/{chunk-S6QZTDZ3.js → chunk-AVXX4Q6S.js} +1 -1
- package/dist/chunks/{chunk-XUMXJUE4.js → chunk-AYWB3MO2.js} +1 -1
- package/dist/chunks/{chunk-THMCHMVZ.js → chunk-BBOOWC7X.js} +1 -1
- package/dist/chunks/{chunk-EM4OX47A.js → chunk-BCFKN4Q3.js} +1 -1
- package/dist/chunks/{chunk-5QMXW5KS.js → chunk-BHL2HM6I.js} +1 -1
- package/dist/chunks/chunk-BLVC5EJT.js +23 -0
- package/dist/chunks/{chunk-QKK5BAZO.js → chunk-BUAK2QUA.js} +1 -1
- package/dist/chunks/{chunk-NJFXR3FN.js → chunk-C6GEVMTF.js} +14 -13
- package/dist/chunks/{chunk-NTSJNYRU.js → chunk-CSNP5RIM.js} +2 -2
- package/dist/chunks/{chunk-KJUFWRZP.js → chunk-CV3QFGDU.js} +1 -1
- package/dist/chunks/{chunk-UT3HLSJV.js → chunk-DC4FJRL3.js} +1 -1
- package/dist/chunks/{chunk-HT445TYO.js → chunk-DMA77UYG.js} +1 -1
- package/dist/chunks/{chunk-X7TIJWNO.js → chunk-DUSMVY4N.js} +1 -1
- package/dist/chunks/{chunk-SGFMVYFR.js → chunk-EBUW6R7N.js} +1 -1
- package/dist/chunks/{chunk-LYQECLRR.js → chunk-F2JP7O2U.js} +2 -2
- package/dist/chunks/{chunk-MNDFF42B.js → chunk-FB25ZRYC.js} +2 -2
- package/dist/chunks/{chunk-5DHOC47O.js → chunk-FHBZCMSG.js} +3 -3
- package/dist/chunks/{chunk-H75TYZ4K.js → chunk-G5JCTGL2.js} +1 -1
- package/dist/chunks/{chunk-G2CDEA2E.js → chunk-HLZRBOYG.js} +1 -1
- package/dist/chunks/{chunk-PYHNDBNH.js → chunk-HMJR6RVF.js} +1 -1
- package/dist/chunks/{chunk-CO5LKOMH.js → chunk-HS3PNMBX.js} +1 -1
- package/dist/chunks/chunk-HX6UHVQP.js +12 -0
- package/dist/chunks/{chunk-XTCRLS6X.js → chunk-IHHF75BQ.js} +1 -1
- package/dist/chunks/{chunk-GWYQXFBP.js → chunk-IIGT4EZU.js} +1 -1
- package/dist/chunks/{chunk-PHK4OYIZ.js → chunk-IXBJGZ54.js} +1 -1
- package/dist/chunks/chunk-J4OACK47.js +16 -0
- package/dist/chunks/{chunk-XXLU5IHA.js → chunk-JJ63FWHZ.js} +1 -1
- package/dist/chunks/{chunk-3C6BMAGB.js → chunk-JOJOC2KU.js} +2 -2
- package/dist/chunks/{chunk-MPOK5ZI5.js → chunk-JUVJDLOW.js} +1 -1
- package/dist/chunks/{chunk-QPX6N5CV.js → chunk-K6DILXMH.js} +1 -1
- package/dist/chunks/{chunk-UEFDCTG6.js → chunk-KHMNANEN.js} +1 -1
- package/dist/chunks/{chunk-L3DJOYTO.js → chunk-KHUD5ZTN.js} +1 -1
- package/dist/chunks/{chunk-WOXLDQR3.js → chunk-KOZYKNZR.js} +1 -1
- package/dist/chunks/{chunk-55WV4RRW.js → chunk-KSV7UCFB.js} +1 -1
- package/dist/chunks/{chunk-OBBFWQJ3.js → chunk-KW3MMVVQ.js} +1 -1
- package/dist/chunks/{chunk-RNHPL4C7.js → chunk-LM4457HA.js} +3 -3
- package/dist/chunks/{chunk-NBRW54IL.js → chunk-MTFTT7ZW.js} +1 -1
- package/dist/chunks/{chunk-7W4GWVUP.js → chunk-N3FO2Y5F.js} +1 -1
- package/dist/chunks/{chunk-FFHV7BRT.js → chunk-N4PID4SD.js} +1 -1
- package/dist/chunks/{chunk-VWFFYVJ2.js → chunk-NOAZDAOU.js} +1 -1
- package/dist/chunks/{chunk-V5TIFXUP.js → chunk-NZ5UWYC5.js} +1 -1
- package/dist/chunks/{chunk-Z5HRQ3IQ.js → chunk-O4Y26S64.js} +1 -1
- package/dist/chunks/{chunk-LIQLOS7B.js → chunk-OCJG4DNX.js} +1 -1
- package/dist/chunks/chunk-OXRKY2TM.js +7 -0
- package/dist/chunks/{chunk-2OMMOXFL.js → chunk-P43CQDVR.js} +1 -1
- package/dist/chunks/{chunk-ME52HBX7.js → chunk-PGHOMVQA.js} +1 -1
- package/dist/chunks/{chunk-N3IQO5HN.js → chunk-PHPJS2G2.js} +1 -1
- package/dist/chunks/{chunk-FHUDTYY7.js → chunk-R3QHEJL6.js} +1 -1
- package/dist/chunks/{chunk-7J7SOUFS.js → chunk-R47H4HYG.js} +1 -1
- package/dist/chunks/{chunk-C3KNFAVK.js → chunk-S5C6NG55.js} +1 -1
- package/dist/chunks/{chunk-OOAIU7WR.js → chunk-SDD6ZLJY.js} +1 -1
- package/dist/chunks/{chunk-VT7UAUY6.js → chunk-SHJ3XTD3.js} +1 -1
- package/dist/chunks/{chunk-JYGOOFIW.js → chunk-SHL6BPBV.js} +1 -1
- package/dist/chunks/{chunk-5GKIRBHJ.js → chunk-SOTBQFIW.js} +1 -1
- package/dist/chunks/{chunk-YMVS467I.js → chunk-TBLZ7V7D.js} +1 -1
- package/dist/chunks/{chunk-X4ECSRFL.js → chunk-TO5AR7IO.js} +1 -1
- package/dist/chunks/{chunk-IGJBSAFY.js → chunk-TOCPUQ6N.js} +1 -1
- package/dist/chunks/chunk-UNRBMQCQ.js +7 -0
- package/dist/chunks/{chunk-TVTGVWCV.js → chunk-UZHCQFUQ.js} +1 -1
- package/dist/chunks/{chunk-ZNEXVCPE.js → chunk-VLVOTIOJ.js} +1 -1
- package/dist/chunks/{chunk-YKIKCZQ4.js → chunk-VQYHDGDM.js} +1 -1
- package/dist/chunks/{chunk-B6YVE4WJ.js → chunk-VQZ773A2.js} +1 -1
- package/dist/chunks/{chunk-TRDAU3LX.js → chunk-WHOGPAL6.js} +1 -1
- package/dist/chunks/{chunk-HZRU7VS6.js → chunk-WLD4SGKM.js} +1 -1
- package/dist/chunks/{chunk-MFOBJA6M.js → chunk-WQWM7JF5.js} +1 -1
- package/dist/chunks/{chunk-2TJQY7PH.js → chunk-X5TIKXI7.js} +1 -1
- package/dist/chunks/{chunk-ANT2GN7F.js → chunk-YKQZ2FIY.js} +1 -1
- package/dist/chunks/{chunk-2BI5SSHB.js → chunk-YNMTP26U.js} +1 -1
- package/dist/chunks/{chunk-PKCEKIQP.js → chunk-YTVFHGBY.js} +1 -1
- package/dist/chunks/chunk-YYC2AOHC.js +7 -0
- package/dist/chunks/{chunk-4GYDXPNC.js → chunk-YYDI5Q5K.js} +1 -1
- package/dist/chunks/{chunk-6UWBCYEW.js → chunk-ZQVD57V5.js} +1 -1
- package/dist/chunks/{clear-ZYFF7TKK.js → clear-RYDN2BJI.js} +1 -1
- package/dist/chunks/{compile-vercel-config-PM32YSEA.js → compile-vercel-config-52MEHYDA.js} +1 -1
- package/dist/chunks/{config-PEQFEYH3.js → config-QQSZ7AL4.js} +1 -1
- package/dist/chunks/{config-BOZHXFS2.js → config-TLW5QWPA.js} +1 -1
- package/dist/chunks/{delete-5ZT5D2ZC.js → delete-D6Y47HSU.js} +1 -1
- package/dist/chunks/{delete-QOXGYAV7.js → delete-WKZ4QCNM.js} +1 -1
- package/dist/chunks/{describe-PB4P77HZ.js → describe-JMZNU7JT.js} +2 -2
- package/dist/chunks/{detect-projects-YFNBW57H.js → detect-projects-AZXG6BRD.js} +1 -1
- package/dist/chunks/detect-services-UAV2B7PV.js +7 -0
- package/dist/chunks/disable-VCOBD3ZT.js +7 -0
- package/dist/chunks/{discard-EDFRCWQJ.js → discard-VIOUKDUY.js} +1 -1
- package/dist/chunks/edit-4FEVCMD4.js +8 -0
- package/dist/chunks/{edit-RZUR2MEI.js → edit-JR3XPTH4.js} +1 -1
- package/dist/chunks/enable-7UPZVKQK.js +7 -0
- package/dist/chunks/{export-GAUHNKEC.js → export-ZSGAZXLV.js} +1 -1
- package/dist/chunks/{future-5CMQQWD5.js → future-2GW5PLR5.js} +1 -1
- package/dist/chunks/{generate-cert-for-deploy-UIPNZXKH.js → generate-cert-for-deploy-KY4ZCRAK.js} +1 -1
- package/dist/chunks/{image-6E4KXK2L.js → image-HXRCOQ7V.js} +1 -1
- package/dist/chunks/{import-builders-XWE653DS.js → import-builders-MXKADD3S.js} +1 -1
- package/dist/chunks/{inspect-MTGXZZ56.js → inspect-5L542UG5.js} +1 -1
- package/dist/chunks/{inspect-RAXMU5ZB.js → inspect-6DHUE7A7.js} +1 -1
- package/dist/chunks/{inspect-6R3QRA5N.js → inspect-AMCI2LLR.js} +1 -1
- package/dist/chunks/{inspect-D7ABHU5K.js → inspect-J6KVRJ7Y.js} +1 -1
- package/dist/chunks/{inspect-INPZEWQW.js → inspect-MJ7CCOKD.js} +1 -1
- package/dist/chunks/{inspect-CAFSMVCJ.js → inspect-YKSWSH3T.js} +1 -1
- package/dist/chunks/{list-FIHRZBUS.js → list-6NRT47ES.js} +1 -1
- package/dist/chunks/{list-JBJW5CJ5.js → list-H26ESLWR.js} +1 -1
- package/dist/chunks/{list-VMOJ7VVX.js → list-HFAZSMP4.js} +1 -1
- package/dist/chunks/{list-ZVDEIXDS.js → list-ZHES2WYK.js} +1 -1
- package/dist/chunks/{login-LKMOWVCB.js → login-FB6OZIZ4.js} +1 -1
- package/dist/chunks/{login-H2G7BS6W.js → login-MECBM76Z.js} +1 -1
- package/dist/chunks/{logs-VXZM4UHP.js → logs-CP7YB73H.js} +1 -1
- package/dist/chunks/{ls-LAGLNA5S.js → ls-32OVVPZW.js} +1 -1
- package/dist/chunks/{ls-HDEMDHPT.js → ls-5MH6K27B.js} +1 -1
- package/dist/chunks/{ls-Z6MWIX4Y.js → ls-GJZPC64P.js} +1 -1
- package/dist/chunks/{ls-GDKBTL2S.js → ls-OHOMEI5T.js} +1 -1
- package/dist/chunks/{ls-C6AD24SN.js → ls-RQVX47DY.js} +1 -1
- package/dist/chunks/{ls-F7VCPUQX.js → ls-WG2IUBOR.js} +1 -1
- package/dist/chunks/{ls-JQ27BRGL.js → ls-XYTMV3AK.js} +1 -1
- package/dist/chunks/{migrate-experimental-services-EDKYGFQN.js → migrate-experimental-services-T7T24F2S.js} +1 -1
- package/dist/chunks/{mutate-QQV7STKJ.js → mutate-A2NBCRWB.js} +1 -1
- package/dist/chunks/{notifications-RS7NVKX3.js → notifications-DNYXKQTM.js} +1 -1
- package/dist/chunks/{open-FJ2GR5YN.js → open-WMRSBVLE.js} +1 -1
- package/dist/chunks/{openapi-TMDHCYVN.js → openapi-6RKKA6JG.js} +1 -1
- package/dist/chunks/{permissions-5A7V4SB3.js → permissions-NKB64XKD.js} +1 -1
- package/dist/chunks/{plugin-offer-EVN7NAJK.js → plugin-offer-PVANAUW2.js} +1 -1
- package/dist/chunks/{prompt-missing-credentials-KI75QVSM.js → prompt-missing-credentials-UZPXAUPC.js} +1 -1
- package/dist/chunks/{publish-XSPN4TNJ.js → publish-LDWJ2ON7.js} +1 -1
- package/dist/chunks/{pull-6UMQJKSF.js → pull-YVO5O2XN.js} +1 -1
- package/dist/chunks/{purchase-domain-if-available-CT4I2TPX.js → purchase-domain-if-available-CRDIL367.js} +1 -1
- package/dist/chunks/{push-KY26BHB6.js → push-JLMYKMPG.js} +1 -1
- package/dist/chunks/{query-RISEG5SJ.js → query-B5QW26OE.js} +1 -1
- package/dist/chunks/{raw-query-VVRMDGD2.js → raw-query-EVKRAAOJ.js} +1 -1
- package/dist/chunks/{reauthenticate-OSPJ3JEZ.js → reauthenticate-RWWFUE42.js} +1 -1
- package/dist/chunks/{remove-2IJXYNP5.js → remove-CSIMGLLS.js} +1 -1
- package/dist/chunks/{reorder-V7HLFPNM.js → reorder-ZZJLSJTV.js} +1 -1
- package/dist/chunks/{reply-DBWSTVHX.js → reply-EH2GBOMD.js} +1 -1
- package/dist/chunks/{resolve-NNJNHWK7.js → resolve-46WA2PXL.js} +1 -1
- package/dist/chunks/{resolve-agent-team-SDRK736H.js → resolve-agent-team-52A4CIIC.js} +1 -1
- package/dist/chunks/{restore-JLS3DHVR.js → restore-WYZSU2PQ.js} +1 -1
- package/dist/chunks/{rm-KX2MW3CD.js → rm-3HIT2KQT.js} +1 -1
- package/dist/chunks/{rm-44NX26ZY.js → rm-5EFXXQSK.js} +1 -1
- package/dist/chunks/{rm-TADMPEWP.js → rm-R5B4BV3M.js} +1 -1
- package/dist/chunks/{rm-YCOVLR77.js → rm-X46AUZBU.js} +1 -1
- package/dist/chunks/{rm-6K2ZAQ26.js → rm-XF6JNRVC.js} +1 -1
- package/dist/chunks/{rule-inspect-4OICMTIG.js → rule-inspect-HLLGCACM.js} +1 -1
- package/dist/chunks/{schema-JVSAUVFJ.js → schema-CBYGIMPL.js} +1 -1
- package/dist/chunks/{schema-NPCCNUH2.js → schema-NCH5NN2G.js} +1 -1
- package/dist/chunks/{select-org-PQVCQGYR.js → select-org-GTYZJQR3.js} +1 -1
- package/dist/chunks/{set-XADF6YK4.js → set-5EFQ6HAY.js} +1 -1
- package/dist/chunks/{set-GBB3DG2V.js → set-BS5KCRE4.js} +1 -1
- package/dist/chunks/{setup-and-link-CBVABGTY.js → setup-and-link-ROS22SLK.js} +1 -1
- package/dist/chunks/{skills-VPLIJJQG.js → skills-SUGA6D3G.js} +1 -1
- package/dist/chunks/{tags-PVI45KIL.js → tags-Z4NNOYPB.js} +1 -1
- package/dist/chunks/{types-MTNJRJKG.js → types-YFDB4QZA.js} +1 -1
- package/dist/chunks/{update-KIOGBNX7.js → update-GKWIBCQG.js} +1 -1
- package/dist/chunks/{usage-XTWSFFZT.js → usage-G6S4RCCK.js} +1 -1
- package/dist/chunks/{validate-config-IREIABSK.js → validate-config-LDOYJ4LL.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 +3 -3
- package/dist/commands/env/index.js +3 -3
- package/dist/commands/link/index.js +2 -2
- package/dist/commands/list/index.js +1 -1
- package/dist/commands/project/index.js +1 -1
- package/dist/commands/tunnel/index.js +1 -1
- package/dist/commands-account.js +7 -7
- package/dist/commands-ai.js +3 -3
- package/dist/commands-blob.js +4 -4
- package/dist/commands-core.js +31 -44
- package/dist/commands-deployments.js +1 -1
- package/dist/commands-flags.js +3 -3
- package/dist/commands-integrations.js +16 -19
- package/dist/commands-observability.js +9 -8
- package/dist/commands-routing.js +4 -5
- package/dist/index.js +5 -5
- package/dist/internal-build.js +1 -1
- package/dist/package.json +42 -42
- package/dist/root-help-commands.mjs +1 -1
- package/dist/version.mjs +1 -1
- package/package.json +44 -44
- package/dist/chunks/add-U3ILHW5T.js +0 -8
- package/dist/chunks/chunk-55FPQ5MM.js +0 -16
- package/dist/chunks/chunk-5ZL2RRO3.js +0 -7
- package/dist/chunks/chunk-AM46JVVN.js +0 -7
- package/dist/chunks/chunk-B7IB5CTS.js +0 -7
- package/dist/chunks/chunk-IPORRCTF.js +0 -12
- package/dist/chunks/chunk-KHDRQS6I.js +0 -12
- package/dist/chunks/chunk-VGSSSQFT.js +0 -7
- package/dist/chunks/detect-services-ZN2R3RDF.js +0 -7
- package/dist/chunks/disable-UB445BYJ.js +0 -7
- package/dist/chunks/edit-ZWAA6ERV.js +0 -8
- package/dist/chunks/enable-YTPIGKFW.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{buildCommandWithGlobalFlags}from"./chunk-
|
|
7
|
+
import{buildCommandWithGlobalFlags}from"./chunk-CSNP5RIM.js";import{getCommandName,packageName}from"./chunk-B4KA3ZH2.js";function scopedBudgetCommand(client,owner,subcommand){return getCommandName(scopedBudgetSubcommand(client,owner,subcommand))}function scopedBudgetSubcommand(client,owner,subcommand){return buildCommandWithGlobalFlags(client.argv,owner.type==="organization"?subcommand:`--scope ${owner.slug} ${subcommand}`,packageName,{prependGlobalFlags:!0,excludeFlags:["--scope","-S","--team","-T"]}).slice(packageName.length+1)}export{scopedBudgetCommand};
|
|
@@ -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{require_dist}from"./chunk-
|
|
7
|
+
import{require_dist}from"./chunk-7AAYWDIZ.js";import{__commonJS}from"./chunk-BZENIQ7N.js";var require_dist2=__commonJS({"../service-topology/dist/index.js"(exports,module){"use strict";var __defProp=Object.defineProperty,__getOwnPropDesc=Object.getOwnPropertyDescriptor,__getOwnPropNames=Object.getOwnPropertyNames,__hasOwnProp=Object.prototype.hasOwnProperty,__export=(target,all)=>{for(var name in all)__defProp(target,name,{get:all[name],enumerable:!0})},__copyProps=(to,from,except,desc)=>{if(from&&typeof from=="object"||typeof from=="function")for(let key of __getOwnPropNames(from))!__hasOwnProp.call(to,key)&&key!==except&&__defProp(to,key,{get:()=>from[key],enumerable:!(desc=__getOwnPropDesc(from,key))||desc.enumerable});return to},__toCommonJS=mod=>__copyProps(__defProp({},"__esModule",{value:!0}),mod),src_exports={};__export(src_exports,{INTERNAL_SERVICE_PREFIX:()=>import_fs_detectors.INTERNAL_SERVICE_PREFIX,autoDetectServices:()=>import_fs_detectors.autoDetectServices,detectDaemons:()=>import_fs_detectors.detectDaemons,detectServices:()=>import_fs_detectors.detectServices,generateServiceRewrites:()=>import_fs_detectors.generateServiceRewrites,generateServicesRoutes:()=>import_fs_detectors.generateServicesRoutes,getInternalServiceCronPath:()=>import_fs_detectors.getInternalServiceCronPath,getInternalServiceCronPathPrefix:()=>import_fs_detectors.getInternalServiceCronPathPrefix,getInternalServiceFunctionPath:()=>import_fs_detectors.getInternalServiceFunctionPath,getInternalServiceWorkerPath:()=>import_fs_detectors.getInternalServiceWorkerPath,getInternalServiceWorkerPathPrefix:()=>import_fs_detectors.getInternalServiceWorkerPathPrefix,hasLegacyServicesConfig:()=>import_fs_detectors.hasLegacyServicesConfig,isExperimentalService:()=>import_fs_detectors.isExperimentalService,isExperimentalServiceV2:()=>import_fs_detectors.isExperimentalServiceV2,isRouteOwningBuilder:()=>import_fs_detectors.isRouteOwningBuilder,isStaticBuild:()=>import_fs_detectors.isStaticBuild,migrateExperimentalServices:()=>import_fs_detectors.migrateExperimentalServices,planExperimentalServicesMigration:()=>import_fs_detectors.planExperimentalServicesMigration,resolveAllConfiguredServices:()=>import_fs_detectors.resolveAllConfiguredServices,resolveAllConfiguredServicesV2:()=>import_fs_detectors.resolveAllConfiguredServicesV2,resolveConfiguredServiceV2:()=>import_fs_detectors.resolveConfiguredServiceV2,validateServiceConfigV2:()=>import_fs_detectors.validateServiceConfigV2});module.exports=__toCommonJS(src_exports);var import_fs_detectors=require_dist()}});export{require_dist2 as require_dist};
|
|
@@ -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{decodeListCursor}from"./chunk-ZBZQEDZY.js";import{external_exports}from"./chunk-2AMO2VMV.js";import{parseListLimit}from"./chunk-7RABG6HV.js";import{AGENT_ACTION,AGENT_REASON,AGENT_STATUS,getExitCodeForReason,outputActionRequired,outputAgentError}from"./chunk-
|
|
7
|
+
import{decodeListCursor}from"./chunk-ZBZQEDZY.js";import{external_exports}from"./chunk-2AMO2VMV.js";import{parseListLimit}from"./chunk-7RABG6HV.js";import{AGENT_ACTION,AGENT_REASON,AGENT_STATUS,getExitCodeForReason,outputActionRequired,outputAgentError}from"./chunk-CSNP5RIM.js";import{validateJsonOutput}from"./chunk-KA2KG3SY.js";import{isAPIError}from"./chunk-QFE3RPMA.js";import{getCommandName,getCommandNamePlain}from"./chunk-B4KA3ZH2.js";import{output_manager_default}from"./chunk-RYSO5U3E.js";import{getGlobalFlagsFromArgs}from"./chunk-DORCX7UB.js";import{require_source}from"./chunk-NB2WLB3J.js";import{__toESM}from"./chunk-BZENIQ7N.js";var OrganizationResponseError=class extends Error{};function handleOrganizationApiError(client,err,failed){if(!isAPIError(err)){output_manager_default.debug(`Organization request failed: ${err}`);let cause=err instanceof OrganizationResponseError?err.message:"";return report(client,{reason:AGENT_REASON.API_ERROR,message:`Failed to ${failed.action}.${cause?` ${cause}`:""}`})}let remote=stripControlCharacters(err.serverMessage||"");if(err.status===404)return report(client,{reason:AGENT_REASON.NOT_FOUND,message:failed.notFound??`Couldn't ${failed.action}. It wasn't found.`});if(err.status===403)return report(client,{reason:AGENT_REASON.PERMISSION_DENIED,message:`You can't ${failed.action}.`,remote,action:err.action,resource:typeof err.resource=="string"?err.resource:void 0});let plan=typeof err.code=="string"&&PLAN_CAUSES[err.code];if(plan)return report(client,{reason:AGENT_REASON.PLAN_LIMIT,message:`Can't ${failed.action}. ${plan}.`,remote});if(err.status===409){let conflict=typeof err.code=="string"&&CONFLICT_CAUSES[err.code];return report(client,{reason:AGENT_REASON.CONFLICT,message:`Can't ${failed.action}. ${conflict||"It conflicts with the current state of the organization or team"}.`,remote})}return err.status===429?report(client,{reason:AGENT_REASON.RATE_LIMITED,message:"Too many requests to the Vercel API. Try again later."}):report(client,{reason:AGENT_REASON.API_ERROR,message:`Failed to ${failed.action}.`,remote})}var CONFLICT_CAUSES={already_exists:"Another organization uses this slug",slug_conflict:"Another team uses this slug",team_already_in_organization:"The team already belongs to an organization",team_organization_transfer_in_progress:"The team is already moving to an organization"},PLAN_CAUSES={invalid_billing_plan:"The team's billing plan doesn't allow it",child_team_limit_reached:"The organization has reached its limit of enterprise child teams",team_already_enterprise:"An existing Enterprise team can't become an enterprise child team"};function stripControlCharacters(text){return text.replace(/[\u0000-\u001f\u007f-\u009f]/g," ").trim()}function report(client,failure){let payload={status:AGENT_STATUS.ERROR,reason:failure.reason,message:failure.message};return failure.remote&&(payload.data={remoteMessage:failure.remote}),failure.action&&(payload.action=failure.action),failure.resource&&(payload.resource=failure.resource),outputAgentError(client,payload,1),output_manager_default.error(failure.message),failure.remote&&output_manager_default.log(` Vercel API: ${failure.remote}`),1}var organizationSchema=external_exports.looseObject({organizationId:external_exports.string(),slug:external_exports.string(),name:external_exports.string().optional(),teamId:external_exports.string(),teamCount:external_exports.number(),createdAt:external_exports.string(),updatedAt:external_exports.string()}),teamSchema=external_exports.looseObject({organizationId:external_exports.string(),teamId:external_exports.string(),ssoMode:external_exports.string(),billingPlan:external_exports.string().optional(),createdAt:external_exports.string(),updatedAt:external_exports.string()}),teamsSchema=external_exports.object({teams:external_exports.array(teamSchema.extend({slug:external_exports.string(),name:external_exports.string().nullable(),avatar:external_exports.string().nullable()})),cursor:external_exports.string().nullable().optional()});async function request(client,path,schema,options={}){let fetchOptions={...options,useCurrentTeam:!1};options.method&&options.method!=="GET"&&(fetchOptions.retry={retries:0},fetchOptions.bailOn429=!0);let data=await client.fetch(`/v1/organizations${path}`,fetchOptions),result=schema.safeParse(data);if(!result.success){let paths=[...new Set(result.error.issues.map(issue=>issue.path.length?issue.path.join("."):"<root>"))].slice(0,5);throw new OrganizationResponseError(`The Organizations API returned an invalid response at ${paths.join(", ")}.`)}return result.data}function listOrganizations(client){return request(client,"",external_exports.object({organizations:external_exports.array(organizationSchema)}))}function getOrganization(client,id){return request(client,`/${encodeURIComponent(id)}`,organizationSchema)}function createOrganization(client,rootTeamId,body){let query=new URLSearchParams({teamId:rootTeamId});return request(client,`?${query}`,organizationSchema,{method:"POST",body})}function updateOrganization(client,id,slug){return request(client,`/${encodeURIComponent(id)}`,organizationSchema,{method:"PATCH",body:{slug}})}function listOrganizationTeams(client,id,cursor){let query=cursor===void 0?"":`?${new URLSearchParams({cursor})}`;return request(client,`/${encodeURIComponent(id)}/teams${query}`,teamsSchema)}function addOrganizationTeam(client,id,body){return request(client,`/${encodeURIComponent(id)}/teams`,teamSchema,{method:"POST",body})}var import_chalk=__toESM(require_source(),1);var idSchema=external_exports.string().max(256).regex(/^[a-zA-Z0-9_-]+$/),slugSchema=external_exports.string().min(1).max(48).regex(/^[a-z0-9](?:[a-z0-9-]*[a-z0-9])?$/),nameSchema=external_exports.string().min(1).max(256).refine(value=>value.trim().length>0&&!/[\x00-\x1f\x7f]/.test(value)),billingPlanSchema=external_exports.enum(["platform","enterprise"]),ORGANIZATION_ID_PREFIX="org_",TEAM_ID_PREFIX="team_";function isPrefixedId(value,prefix){return value.startsWith(prefix)&&value.length>prefix.length&&idSchema.safeParse(value).success}var SLUG_MESSAGE="Provide --slug with 1-48 lowercase letters, numbers, or hyphens, beginning and ending with a letter or number.",NAME_MESSAGE="Provide --name with 1-256 characters and no control characters.",PLAN_MESSAGE="Use --billing-plan platform or --billing-plan enterprise.";function organizationsSuggestion(subcommand,argv){let globalFlags=getGlobalFlagsFromArgs(argv.slice(2)),full=globalFlags.length?`${subcommand} ${globalFlags.join(" ")}`:subcommand;return getCommandNamePlain(full)}function missingArgument(client,options){let next=[];return options.suggestList&&next.push({command:organizationsSuggestion("organizations list",client.argv),when:"List organizations to find an ID"}),next.push({command:organizationsSuggestion(options.usage,client.argv)}),outputActionRequired(client,{status:AGENT_STATUS.ACTION_REQUIRED,action:AGENT_ACTION.MISSING_ARGUMENTS,reason:options.reason,message:options.message,next}),output_manager_default.error(options.message),output_manager_default.log(`Usage: ${import_chalk.default.cyan(getCommandName(options.usage))}`),getExitCodeForReason(options.reason)}function invalidArgument(client,message){return outputAgentError(client,{status:AGENT_STATUS.ERROR,reason:AGENT_REASON.INVALID_ARGUMENTS,message}),output_manager_default.error(message),2}function invalidArgumentCount(client,usage){let message=`Too many arguments. Usage: ${getCommandNamePlain(usage)}`;return outputAgentError(client,{status:AGENT_STATUS.ERROR,reason:AGENT_REASON.INVALID_ARGUMENTS,message}),output_manager_default.error(`Invalid number of arguments. Usage: ${import_chalk.default.cyan(getCommandName(usage))}`),2}function validate(client,schema,value,options){if(value===void 0)return{status:"error",exitCode:missingArgument(client,{...options,reason:AGENT_REASON.MISSING_ARGUMENTS})};let parsed=schema.safeParse(value);return parsed.success?{status:"ok",value:parsed.data}:{status:"error",exitCode:invalidArgument(client,options.message)}}function validateOptional(client,schema,value,message){if(value===void 0)return{status:"ok",value:void 0};let parsed=schema.safeParse(value);return parsed.success?{status:"ok",value:parsed.data}:{status:"error",exitCode:invalidArgument(client,message)}}function outputFormat(client,flags){let format=validateJsonOutput(flags);return format.valid?{status:"ok",value:format.jsonOutput}:{status:"error",exitCode:invalidArgument(client,format.error)}}function noArguments(client,args,usage){return args.length?{status:"error",exitCode:invalidArgumentCount(client,usage)}:{status:"ok",value:void 0}}function unknownCommand(client,group,segment){let path=getCommandNamePlain(group),message=segment?`Unknown command ${segment} for ${path}.`:`Missing command for ${path}.`;return outputAgentError(client,{status:AGENT_STATUS.ERROR,reason:segment?"unknown_command":"missing_command",message,next:[{command:`${path} --help`,when:"See all commands"}]}),output_manager_default.error(message),output_manager_default.log(`
|
|
8
8
|
See all commands:
|
|
9
9
|
${path} --help`),2}function listWindow(client,flags){let limit;try{limit=parseListLimit(flags["--limit"])}catch(err){let message=err instanceof Error?err.message:String(err);return{status:"error",exitCode:invalidArgument(client,message)}}let next=flags["--next"];if(next===void 0)return{status:"ok",value:{limit,start:{offset:0}}};let start=decodeListCursor(next);return start?{status:"ok",value:{limit,start}}:{status:"error",exitCode:invalidArgument(client,"Provide --next with the cursor from the previous page.")}}export{OrganizationResponseError,handleOrganizationApiError,listOrganizations,getOrganization,createOrganization,updateOrganization,listOrganizationTeams,addOrganizationTeam,slugSchema,nameSchema,billingPlanSchema,ORGANIZATION_ID_PREFIX,TEAM_ID_PREFIX,isPrefixedId,SLUG_MESSAGE,NAME_MESSAGE,PLAN_MESSAGE,missingArgument,invalidArgument,invalidArgumentCount,validate,validateOptional,outputFormat,noArguments,unknownCommand,listWindow};
|
|
@@ -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{apiServerMessage}from"./chunk-WAOS5OCB.js";import{parseSubcommandArguments,requireProjectContext}from"./chunk-
|
|
7
|
+
import{apiServerMessage}from"./chunk-WAOS5OCB.js";import{parseSubcommandArguments,requireProjectContext}from"./chunk-TO5AR7IO.js";import{generateSparkline}from"./chunk-R3QHEJL6.js";import{stamp_default}from"./chunk-A2RZZQEP.js";import{resolveProjectContext}from"./chunk-UNRBMQCQ.js";import{table}from"./chunk-U5SZQUYO.js";import{getScope}from"./chunk-YYC2AOHC.js";import{printError}from"./chunk-HMJR6RVF.js";import{AGENT_REASON,AGENT_STATUS,buildCommandWithGlobalFlags,buildCommandWithYes,clientObservabilityPlanRecovery,getExitCodeForReason,outputAgentError,shouldEmitNonInteractiveCommandError,teamCache,writeAgentError}from"./chunk-CSNP5RIM.js";import{isAPIError}from"./chunk-QFE3RPMA.js";import{getCommandName,getCommandNamePlain,packageName}from"./chunk-B4KA3ZH2.js";import{output_manager_default}from"./chunk-RYSO5U3E.js";import{getGlobalFlagsFromArgs,quoteArg}from"./chunk-DORCX7UB.js";import{require_source}from"./chunk-NB2WLB3J.js";import{__toESM}from"./chunk-BZENIQ7N.js";var PROJECT_TIER_RANK={priority:1,critical:2};function hasProjectTier(project,tier){let rank=project?.tier===void 0?void 0:PROJECT_TIER_RANK[project.tier];return rank!==void 0&&rank>=PROJECT_TIER_RANK[tier]}function projectScope(project,teamId,teamSlug){return{type:"project",projectId:project.id,teamId,...teamSlug?{teamSlug}:{},displayName:project.name,...project.tier?{tier:project.tier}:{}}}function isPriorityScope(scope){return scope.type==="team"||hasProjectTier(scope,"priority")}function firewallConfigUrl(scope,path=""){let query=new URLSearchParams;return scope.type==="project"?(query.set("projectId",scope.projectId),scope.teamId&&query.set("teamId",scope.teamId),`/v1/security/firewall/config${path}?${query.toString()}`):(query.set("teamId",scope.teamId),`/v1/security/firewall/team-config${path}?${query.toString()}`)}var import_chalk=__toESM(require_source(),1);var ACTION_COLORS={allow:import_chalk.default.blue,deny:import_chalk.default.red,challenge:import_chalk.default.yellow,log:import_chalk.default.magenta,rate_limit:import_chalk.default.cyan,"rate-limit":import_chalk.default.cyan,bypass:import_chalk.default.green};function labelForAction(action){return action==="rate_limit"||action==="rate-limit"?"Rate Limited":action.split(/[-_]/).filter(Boolean).map(word=>word.charAt(0).toUpperCase()+word.slice(1)).join(" ")}var MONTHS=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"];function formatCount(n){return n>=1e6?`${(n/1e6).toFixed(1)}M`:n>=1e3?`${(n/1e3).toFixed(1)}k`:String(Math.round(n))}function pad2(n){return String(n).padStart(2,"0")}function formatUtcTime(ms,withDate){let d=new Date(ms),hm=`${pad2(d.getUTCHours())}:${pad2(d.getUTCMinutes())}`;return withDate?`${MONTHS[d.getUTCMonth()]} ${d.getUTCDate()} ${hm}`:hm}function relativeTime(ts){let diff=Date.now()-ts;return diff<6e4?"just now":diff<36e5?`${Math.floor(diff/6e4)}m ago`:diff<864e5?`${Math.floor(diff/36e5)}h ago`:`${Math.floor(diff/864e5)}d ago`}function formatUtcDateTime(ms){return`${formatUtcTime(ms,!0)} UTC (${relativeTime(ms)})`}function colorizeDetail(detail){return detail.split(" \xB7 ").map(part=>{let color=ACTION_COLORS[part.toLowerCase().replace(/ /g,"_")];return color?color(part):part}).join(" \xB7 ")}function windowNeedsDate(startMs,endMs){return endMs-startMs>25*36e5}function granularityLabel(granularity){return"minutes"in granularity?`${granularity.minutes}m`:"hours"in granularity?`${granularity.hours}h`:`${granularity.days}d`}function formatActionTrendTable(series){let allTs=new Set;for(let s of series)for(let p of s.timeseries)allTs.add(p.timestamp);let axis=[...allTs].sort(),hasAnyTraffic=series.some(s=>s.total>0||s.timeseries.some(p=>p.value>0));if(series.length===0||axis.length===0||!hasAnyTraffic)return import_chalk.default.dim(" No request data for this period.");let startMs=new Date(axis[0]).getTime(),endMs=new Date(axis[axis.length-1]).getTime(),needsDate=windowNeedsDate(startMs,endMs),rows=[["Action","Trend","Total","Peak","Peak at"].map(h=>import_chalk.default.bold(import_chalk.default.cyan(h)))];for(let s of series){let byTs=new Map(s.timeseries.map(p=>[p.timestamp,p.value])),values=axis.map(t=>byTs.get(t)??0),peak=0,peakTs="";for(let i=0;i<axis.length;i++)values[i]>peak&&(peak=values[i],peakTs=axis[i]);let plain=x=>x,color=s.total>0?ACTION_COLORS[s.action]??plain:import_chalk.default.dim,trend=s.total>0?plain:import_chalk.default.dim;rows.push([color(labelForAction(s.action)),trend(generateSparkline(values)),formatCount(s.total),peak>0?formatCount(peak):"--",peak>0?formatUtcTime(new Date(peakTs).getTime(),needsDate):"--"])}return table(rows,{align:["l","l","r","r","r"],hsep:3}).split(`
|
|
8
8
|
`).map(line=>` ${line}`.trimEnd()).join(`
|
|
9
9
|
`)}var FIREWALL_O11Y_ALERT_TYPES=["botId_anomaly","firewallSystemRule_anomaly","firewallCustomRule_anomaly"],FIREWALL_ANOMALY_TYPE="firewall_anomaly",SYS_DOS_MITIGATION_RULE_ID="sys_dos_mitigation",SYSTEM_RULE_ANOMALY_TYPE="firewallSystemRule_anomaly",FIREWALL_ACTIVITY_PLAN_MESSAGE="Traffic and alerts need Observability Plus.",FIREWALL_ALERTS_PARTIAL_ERROR_MESSAGE="Couldn't load every alert source.";function reduceAttackAnomaly(anomaly){return Object.keys(anomaly.affectedHostMap).reduce((acc,host)=>{acc.hosts.push(host);let challenged=anomaly.affectedHostMap[host].ddosAlerts?.["sys_dos_mitigation:challenge"]?.totalReqs||0,denied=anomaly.affectedHostMap[host].ddosAlerts?.["sys_dos_mitigation:deny"]?.totalReqs||0;return acc.challenged+=challenged,acc.denied+=denied,acc.count+=challenged+denied,acc},{hosts:[],challenged:0,denied:0,count:0})}function hostsFromAnomaly(anomaly){return Object.entries(anomaly.affectedHostMap).map(([host,data])=>{let challenged=data.ddosAlerts?.["sys_dos_mitigation:challenge"]?.totalReqs||0,denied=data.ddosAlerts?.["sys_dos_mitigation:deny"]?.totalReqs||0;return{name:host,count:challenged+denied}}).filter(row=>row.count>0).sort((a,b)=>b.count-a.count)}function mapAttackAnomaly(anomaly){let reduced=reduceAttackAnomaly(anomaly),parts=["System rule"];return reduced.denied>0&&parts.push(labelForAction("deny")),reduced.challenged>0&&parts.push(labelForAction("challenge")),{id:`${anomaly.ownerId}-${anomaly.projectId}-${anomaly.startTime}`,title:"DDoS Mitigation",type:FIREWALL_ANOMALY_TYPE,startedAt:anomaly.startTime,resolvedAt:anomaly.endTime||void 0,count:reduced.count,detail:parts.join(" \xB7 "),action:reduced.denied>=reduced.challenged?"deny":"challenge",ruleId:SYS_DOS_MITIGATION_RULE_ID,host:reduced.hosts[0]}}function mapO11yAlert(alert){if(!alert.startedAt)return null;let action=alert.data?.action,ruleId=alert.data?.ruleId,detailParts=[alert.type,action?labelForAction(action):void 0,ruleId].filter(Boolean);return{id:alert.id||`${alert.type}-${alert.startedAt}`,title:alert.title||alert.type||"Firewall alert",type:alert.type||"unknown",startedAt:alert.startedAt,resolvedAt:alert.resolvedAt,count:alert.data?.count,detail:detailParts.filter(p=>p!==alert.title).join(" \xB7 ")||void 0,action,ruleId,path:alert.data?.path}}var ATTACK_STATUS_MAX_DAYS=7;async function getAttackStatus(client,opts){let query=new URLSearchParams;if(query.set("projectId",opts.projectId),query.set("teamId",opts.teamId),opts.sinceDays!==void 0){let sinceDays=Math.min(ATTACK_STATUS_MAX_DAYS,Math.max(1,Math.ceil(opts.sinceDays)));query.set("since",String(sinceDays))}return client.fetch(`/v1/security/firewall/attack-status?${query.toString()}`,{accountId:opts.teamId,signal:opts.signal})}var O11Y_ALERTS_LIMIT=200;async function getFirewallO11yAlerts(client,opts){let query=new URLSearchParams;query.set("teamId",opts.teamId),query.set("projectId",opts.projectId),query.set("from",opts.from.toISOString()),query.set("to",opts.to.toISOString()),query.set("limit",String(O11Y_ALERTS_LIMIT));for(let type of FIREWALL_O11Y_ALERT_TYPES)query.append("types",type);return(await client.fetch(`/alerts/v3/groups?${query.toString()}`,{accountId:opts.teamId,signal:opts.signal})).flatMap(g=>g.alerts??[]).map(mapO11yAlert).filter(a=>a!==null)}var ALERTS_TIMEOUT_MS=2e4;function sourceFailureReason(err){return isAPIError(err)&&err.status===408||err instanceof Error&&(err.name==="TimeoutError"||err.name==="AbortError")?"timed out":isAPIError(err)&&err.status===402?"needs Observability Plus":isAPIError(err)&&typeof err.status=="number"?`HTTP ${err.status}`:err instanceof Error&&err.message?err.message:"unknown error"}function resolveAlertsWindow(opts){let now=Date.now(),to=opts.to??new Date(now),from=opts.from??new Date(to.getTime()-864e5*(opts.sinceDays??1)),sinceDays=opts.sinceDays??Math.max(1,Math.ceil((now-from.getTime())/864e5));return{from,to,sinceDays}}function classifyAlertSourceError(err){if(isAPIError(err)&&(err.status===401||err.status===403))throw err;return isAPIError(err)&&err.status===402?{reason:"plan",message:FIREWALL_ACTIVITY_PLAN_MESSAGE}:{reason:"error",message:apiServerMessage(err)||!isAPIError(err)&&err instanceof Error&&err.message||FIREWALL_ALERTS_PARTIAL_ERROR_MESSAGE}}async function getFirewallAlertsDetailed(client,opts){let{from,to,sinceDays}=resolveAlertsWindow(opts),timeoutMs=opts.timeoutMs??ALERTS_TIMEOUT_MS,signal=AbortSignal.timeout(timeoutMs),[o11yResult,attackResult]=await Promise.allSettled([getFirewallO11yAlerts(client,{...opts,from,to,signal}),getAttackStatus(client,{...opts,sinceDays,signal})]),errors=[],o11yAlerts=[],o11y;o11yResult.status==="fulfilled"?o11yAlerts=o11yResult.value:(o11y=classifyAlertSourceError(o11yResult.reason),errors.push({source:"alerts",message:sourceFailureReason(o11yResult.reason)}));let mappedAttacks=[],attackStatus;attackResult.status==="fulfilled"?mappedAttacks=(attackResult.value.anomalies||[]).map(mapAttackAnomaly):(attackStatus=classifyAlertSourceError(attackResult.reason),errors.push({source:"attackStatus",message:sourceFailureReason(attackResult.reason)}));let resolvedCutoff=from.getTime();return{alerts:mappedAttacks.concat(o11yAlerts.filter(a=>!a.resolvedAt||a.resolvedAt>resolvedCutoff)).sort((a,b)=>!a.resolvedAt&&b.resolvedAt?-1:a.resolvedAt&&!b.resolvedAt?1:b.startedAt-a.startedAt),o11y,attackStatus,errors}}function alertsIncompleteMessage(errors){return`Attack count and alerts may be incomplete: ${errors.map(e=>`${e.source==="alerts"?"alerts":"attack history"} ${e.message}`).join("; ")}.`}function countAttacksMitigated(alerts,windowStartMs,windowEndMs){return alerts.filter(alert=>isAttackAlert(alert)&&alertOverlapsWindow(alert,windowStartMs,windowEndMs)).length}function alertOverlapsWindow(alert,windowStartMs,windowEndMs){return alert.startedAt<=windowEndMs&&(alert.resolvedAt??Number.POSITIVE_INFINITY)>=windowStartMs}function isAttackAlert(alert){return alert.type===FIREWALL_ANOMALY_TYPE?!0:alert.type===SYSTEM_RULE_ANOMALY_TYPE&&alert.ruleId===SYS_DOS_MITIGATION_RULE_ID}var O11Y_ALERT_ID_PREFIX="al_",INSPECT_FALLBACK_DAYS=7;function isO11yAlertId(id){return id.startsWith(O11Y_ALERT_ID_PREFIX)}function parseLegacyAlertStartTime(id){let match=id.match(/-(\d{13})$/);return match?Number(match[1]):void 0}function daysCovering(startMs,endMs){return Math.max(1,Math.ceil((endMs-startMs)/864e5))}function mapGroupAsAlert(group,alertId){let nested=(group.alerts??[]).map(mapO11yAlert).filter(a=>a!==null),hit=nested.find(a=>a.id===alertId)??nested[0];if(hit)return hit;let startedAt=group.recordedStartedAt;return startedAt?mapO11yAlert({id:alertId,title:group.title,type:group.type,startedAt,resolvedAt:group.recordedResolvedAt,data:group.alerts?.[0]?.data}):null}async function getO11yAlertById(client,opts){let query=new URLSearchParams;query.set("teamId",opts.teamId),query.set("projectId",opts.projectId);try{let group=await client.fetch(`/alerts/v3/groups/${encodeURIComponent(opts.alertId)}?${query.toString()}`,{accountId:opts.teamId,signal:opts.signal});return mapGroupAsAlert(group,opts.alertId)}catch(err){if(isAPIError(err)&&err.status===404)return null;throw err}}async function findFirewallAlert(client,opts){let timeoutMs=opts.timeoutMs??ALERTS_TIMEOUT_MS,budget=()=>AbortSignal.timeout(timeoutMs),now=Date.now();if(isO11yAlertId(opts.alertId)){let fromGroup2=await getO11yAlertById(client,{...opts,signal:budget()});if(fromGroup2)return{alert:fromGroup2};let from=new Date(now-864e5*INSPECT_FALLBACK_DAYS),hit=(await getFirewallO11yAlerts(client,{projectId:opts.projectId,teamId:opts.teamId,from,to:new Date(now),signal:budget()})).find(a=>a.id===opts.alertId);return hit?{alert:hit}:null}let startTime=parseLegacyAlertStartTime(opts.alertId),sinceDays=startTime?daysCovering(startTime,now)+1:INSPECT_FALLBACK_DAYS,anomaly=((await getAttackStatus(client,{projectId:opts.projectId,teamId:opts.teamId,sinceDays,signal:budget()}).catch(err=>{if(isAPIError(err)&&(err.status===401||err.status===403))throw err;return{anomalies:[]}})).anomalies||[]).find(a=>`${a.ownerId}-${a.projectId}-${a.startTime}`===opts.alertId);if(anomaly)return{alert:mapAttackAnomaly(anomaly),hosts:hostsFromAnomaly(anomaly)};let fromGroup=await getO11yAlertById(client,{...opts,signal:budget()}).catch(err=>{if(isAPIError(err)&&(err.status===401||err.status===403))throw err;return null});return fromGroup?{alert:fromGroup}:null}function aiBotsGroupAction(action){return action==="allow"?"off":action}var AI_BOTS_CATEGORY_ACTIONS=["allow","log","deny"];function getAiBotsCategories(ruleset,catalogGroups){return[...new Set([...Object.keys(catalogGroups??{}),...Object.keys(ruleset?.ruleGroups??{})])].sort().map(ruleGroupId=>({id:ruleGroupId.replace(/_/g,"-"),ruleGroupId,name:catalogGroups?.[ruleGroupId]?.name??formatCategoryName(ruleGroupId)}))}function formatCategoryName(ruleGroupId){return ruleGroupId.split("_").map(word=>word==="ai"?"AI":word[0].toUpperCase()+word.slice(1)).join(" ")}function getAiBotsCategoryAction(ruleset,ruleGroupId){if(!ruleset?.active)return"allow";let group=ruleset.ruleGroups?.[ruleGroupId];return group?.active===!1?"allow":group?.action??ruleset.action??"log"}function getAiBotsCategoryActionAfterEdit(ruleset,ruleGroupId){return getAiBotsCategoryAction({...ruleset,active:!0},ruleGroupId)}function getAiBotsCategoryActionForEdit(ruleset,ruleGroupId){return ruleset?.ruleGroups?.[ruleGroupId]?getAiBotsCategoryActionAfterEdit(ruleset,ruleGroupId):getAiBotsCategoryAction(ruleset,ruleGroupId)}function hasAiBotsCategories(ruleset){return Object.keys(ruleset?.ruleGroups??{}).length>0}function getAiBotsCategoryDetails(ruleset){if(hasAiBotsCategories(ruleset))return getAiBotsCategories(ruleset).map(category=>({...category,action:getAiBotsCategoryAction(ruleset,category.ruleGroupId)}))}function aiBotsJsonStatus(ruleset){let categories=getAiBotsCategoryDetails(ruleset);return{enabled:ruleset?.active??!1,action:categories?null:ruleset?.action??null,...categories?{categories}:{}}}var MANAGED_BOT_RULE_IDS=["bot-protection","ai-bots","bot-id"],ALIASES={"bot-protection":"bot-protection","bot protection":"bot-protection",bot_protection:"bot-protection",bot_filter:"bot-protection",managed_bot_protection:"bot-protection",managed_bot_filter:"bot-protection","ai-bots":"ai-bots","ai bots":"ai-bots",ai_bots:"ai-bots",managed_ai_bots:"ai-bots","bot-id":"bot-id",botid:"bot-id",bot_id:"bot-id"},ACTIONS={"bot-protection":["off","log","challenge"],"ai-bots":["allow","log","challenge","deny"],"bot-id":["basic","deep-analysis"]},NAMES={"bot-protection":"Bot Protection","ai-bots":"AI Bots","bot-id":"BotID"},WAF_RULE_IDS={"bot-protection":"managed_bot_protection","ai-bots":"managed_ai_bots"};function managedBotRuleName(id){return NAMES[id]}function resolveManagedBotRuleId(identifier){if(identifier)return ALIASES[identifier.trim().toLowerCase()]}function managedBotActions(id,category){return category?AI_BOTS_CATEGORY_ACTIONS:ACTIONS[id]}function formatManagedBotAction(action){return action==="deep-analysis"?"Deep Analysis":action.charAt(0).toUpperCase()+action.slice(1)}function getBotProtectionConfig(managedRules){return managedRules?.bot_filter??managedRules?.bot_protection}function currentBotProtectionAction(config){let ruleset=getBotProtectionConfig(config?.managedRules);return ruleset?.active?ruleset.action??"log":"off"}function currentAiBotsAction(config){let ruleset=config?.managedRules?.ai_bots;return ruleset?.active?ruleset.action==="challenge"?"challenge":ruleset.action==="deny"?"deny":"log":"allow"}function currentBotIdAction(config){return config?.botIdEnabled?"deep-analysis":"basic"}function getManagedBotRule(config,id){let categories=id==="ai-bots"?getAiBotsCategoryDetails(config?.managedRules?.ai_bots):void 0,action=categories?null:id==="bot-protection"?currentBotProtectionAction(config):id==="ai-bots"?currentAiBotsAction(config):currentBotIdAction(config);return{id,name:NAMES[id],action,wafRuleId:WAF_RULE_IDS[id],...categories?{categories}:{}}}function getManagedBotRules(config){return MANAGED_BOT_RULE_IDS.map(id=>getManagedBotRule(config,id))}function parseManagedBotAction(id,raw,category){let action=raw.trim().toLowerCase().replace(/\s+/g,"-"),valid=managedBotActions(id,category);return valid.includes(action)?{action}:{error:`Invalid action "${raw}" for ${category?.name??NAMES[id]}. Use ${valid.join(", ")}.`}}function buildManagedBotPatch(id,action,category){if(category)return{action:"managedRuleGroup.update",id:"ai_bots",value:{[category.ruleGroupId]:action==="allow"?{active:!1}:{active:!0,action}}};if(id==="bot-id")return{action:"botId.toggle",value:action==="deep-analysis"};let patchId=id==="bot-protection"?"bot_protection":"ai_bots";return action==="off"||action==="allow"?{action:"managedRules.update",id:patchId,value:{active:!1}}:{action:"managedRules.update",id:patchId,value:{active:!0,action}}}function suggestedManagedBotAction(rule){return rule.id==="bot-protection"?rule.action==="challenge"?"log":"challenge":rule.id==="ai-bots"?rule.action==="deny"?"allow":"deny":rule.action==="deep-analysis"?"basic":"deep-analysis"}function managedBotTrafficWarning(id,to,categoryName){if(id==="ai-bots"&&to==="deny")return categoryName?`Deny blocks known ${categoryName} traffic when published.`:"AI Bots deny blocks known AI crawlers from this project.";if(id==="bot-protection"&&to==="challenge")return"Bot Protection challenge will present a verification page to non-browser traffic."}function managedBotJson(rule){return{id:rule.id,name:rule.name,action:rule.action,wafRuleId:rule.wafRuleId??null,...rule.categories?{categories:rule.categories}:{}}}function suggestsManagedRulesetsList(rule){return rule.id==="ai-bots"&&!rule.categories?.[0]}function suggestedManagedBotEditCommand(rule,via="rules"){let rulesets=via==="managed-rulesets"&&rule.id!=="bot-id",base=rulesets?"firewall managed-rulesets update":"firewall rules update",category=rule.categories?.[0];if(suggestsManagedRulesetsList(rule))return rulesets?"firewall managed-rulesets list":`${base} ai-bots`;let action=suggestedManagedBotAction(category?{...rule,action:category.action}:rule),group=category?` ${rulesets?"--group":"--category"} ${category.id}`:"";return`${base} ${rule.id}${group} --action ${rulesets&&action==="allow"?aiBotsGroupAction(action):action}`}function aiBotsEnableWarning(ruleset,categories,edited){if(ruleset?.active)return;let changes=categories.flatMap(category=>{if(category.id===edited.id)return[];let action=getAiBotsCategoryActionAfterEdit(ruleset,category.ruleGroupId);return action==="allow"?[]:[`${category.name} action will be set to ${formatManagedBotAction(action)}`]});if(changes.length!==0)return`Publishing turns AI Bots ${ruleset?"back on":"on"}, so ${changes.join(" and ")}.`}async function listFirewallConfigs(client,scope){return client.fetch(firewallConfigUrl(scope))}async function activateFirewallConfig(client,scope,configVersion){return client.fetch(firewallConfigUrl(scope,`/${configVersion}/activate`),{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({})})}var import_chalk2=__toESM(require_source(),1);var PRIORITY_PROJECT_ENABLE_COMMAND="project priority enable",BUY_PRO_COMMAND="buy pro";function withGlobalFlags(client,commandTemplate,scope,options={}){let template=scope?.type==="team"?`${commandTemplate} --team-level`:commandTemplate;return buildCommandWithGlobalFlags(client.argv,template,void 0,{globalFlags:"all",preserveProject:options.preserveProject??!0,excludeFlags:options.excludeFlags})}async function resolveFirewallScope(client,flags,opts){let json=!!opts?.json&&!client.nonInteractive;if(flags["--team-level"]&&flags["--project"]){let message="Cannot specify both --team-level and --project. Use one or the other.";return json?failFirewall(client,{json,message,reason:AGENT_REASON.INVALID_ARGUMENTS}):client.nonInteractive?(outputAgentError(client,{status:AGENT_STATUS.ERROR,reason:AGENT_REASON.INVALID_ARGUMENTS,message},2),2):(output_manager_default.error(message),2)}if(flags["--team-level"]){let{team}=await getScope(client);if(!team){let message="Team-level firewall requires a team scope. Personal accounts are not supported. Run `vercel switch` to select a team or pass --scope <team>.";return json?failFirewall(client,{json,message,reason:AGENT_REASON.MISSING_SCOPE}):client.nonInteractive?(outputAgentError(client,{status:AGENT_STATUS.ERROR,reason:AGENT_REASON.MISSING_SCOPE,message},1),1):(output_manager_default.error(message),1)}return{type:"team",teamId:team.id,displayName:team.slug}}let link=json?await requireProjectContextJson(client,flags["--project"]):await requireProjectContext(client,"firewall",flags["--project"]);if(typeof link=="number")return link;let{project,org}=link;return{type:"project",projectId:project.id,teamId:org.type==="team"?org.id:void 0,teamSlug:org.type==="team"?org.slug:void 0,displayName:project.name,tier:project.tier}}async function requireProjectContextJson(client,projectName){let link;try{link=await resolveProjectContext({client,projectNameOrId:projectName,projectNotFoundHandling:"return",quiet:!0})}catch(e){return failFirewallApi(client,e,{fallback:"Failed to resolve the project",permissionAction:"read project settings",projectName:projectName??"the linked project",json:!0})}return link.status==="error"?failFirewall(client,{json:!0,message:"VERCEL_ORG_ID and VERCEL_PROJECT_ID don't name a project you can access. Set both, or unset both and pass --project <name>.",reason:AGENT_REASON.PROJECT_NOT_FOUND}):link.status==="not_linked"?failFirewall(client,{json:!0,message:projectName?`Project ${quoteArg(projectName)} wasn't found in the current scope. Check --project, or pass --scope <team>.`:"Your codebase isn't linked to a project on Vercel. Run link first, or pass --project <name>.",reason:projectName?AGENT_REASON.PROJECT_NOT_FOUND:AGENT_REASON.NOT_LINKED,fix:projectName?void 0:{command:"link",hint:`Run ${getCommandName("link")} to link this directory.`,when:"to link this directory to a project"}}):(client.config.currentTeam=link.org.type==="team"?link.org.id:void 0,link)}function mentionsPriorityProject(message){return/priority\s+project/i.test(message)||/priority\s+tier/i.test(message)}function teamPlan(scope){return scope.teamId?teamCache.get(scope.teamId)?.billing?.plan:void 0}function priorityTeam(scope){let cached=scope.teamId?teamCache.get(scope.teamId):void 0;if(scope.type==="team")return{id:scope.teamId,slug:scope.displayName,name:cached?.name??null,scopeArg:scope.displayName};if(!scope.teamId)return null;let slug=scope.teamSlug??cached?.slug??null;return{id:scope.teamId,slug,name:cached?.name??null,scopeArg:slug??scope.teamId}}function teamLabel(team){return team.name&&team.name!==team.slug?`${team.slug} (${team.name})`:team.slug}function styledCommand(command,plain){return plain?getCommandNamePlain(command):getCommandName(command)}function priorityProjectFix(scope){let excludeFlags=["--non-interactive","--project","--yes","--scope","--team"],project=scope.type==="project"?{id:scope.projectId,name:scope.displayName}:null,team=priorityTeam(scope),plan=teamPlan(scope)??null,data={project,team:team&&{id:team.id,slug:team.slug,name:team.name},plan},projectToken=project?quoteArg(project.name):"<project>",scopeFlag=team?` --scope ${quoteArg(team.scopeArg)}`:"",enable=`${PRIORITY_PROJECT_ENABLE_COMMAND} ${projectToken}${scopeFlag}`;if(!team){let hint="Priority projects are only available on team accounts. Use --scope to specify one.";return{command:"",hint,plainHint:hint,when:hint,excludeFlags,preserveProject:!1,reason:AGENT_REASON.MISSING_SCOPE,data}}if(plan==="hobby"||plan==="oss"){let upgrade=`${BUY_PRO_COMMAND}${scopeFlag}`,hint=plain2=>`Priority Projects are only available on Pro or Enterprise team plans. Upgrade with ${styledCommand(upgrade,plain2)}, then run ${styledCommand(enable,plain2)}.`;return{command:upgrade,hint:hint(!1),plainHint:hint(!0),when:"a person has approved upgrading the plan",excludeFlags,preserveProject:!1,reason:AGENT_REASON.PLAN_UPGRADE_REQUIRED,scope:team.scopeArg,data}}let shown=styledCommand(enable,!1),plain=styledCommand(enable,!0),placeholder="Replace <project> with a project on this team.";return{command:enable,hint:project?shown:`${shown} ${placeholder}`,plainHint:project?plain:`${plain} ${placeholder}`,when:project?"user runs this command in an interactive terminal":"Replace <project> with a project on this team.",excludeFlags,preserveProject:!1,reason:AGENT_REASON.PLAN_UPGRADE_REQUIRED,scope:team.scopeArg,data}}function mapFirewallApiError(e,scope,fallback){let err=e;return scope.type==="team"&&err.status===403?err.code==="plan_not_supported"?`Team-level firewall requires an Enterprise plan (current team: "${scope.displayName}"). Pass --scope <team> or run \`vercel switch\` to target a different team.`:`You need to be a team owner to manage the team-level firewall for "${scope.displayName}".${err.message?` (${err.message})`:""}`:err.message||fallback}function priorityProjectMessage(scope,fix){let team=fix.data.team,label=team?.slug!=null?teamLabel({slug:team.slug,name:team.name}):void 0;return scope.type==="project"?label?`This rule requires a Priority project for ${scope.displayName} on team ${label}.`:`This rule requires a Priority project. ${fix.hint}`:label?`This rule requires a Priority project on team ${label}.`:"This rule requires a Priority project."}function failPriorityProjectGate(client,error,scope,opts){let serverMessage=apiServerMessage(error);if(!serverMessage||!mentionsPriorityProject(serverMessage))return null;let fix=priorityProjectFix(scope),message=opts?.message?fix.command?opts.message:`${opts.message} ${fix.hint}`:priorityProjectMessage(scope,fix),payload={status:AGENT_STATUS.ERROR,reason:fix.reason,message,userActionRequired:!0,hint:fix.plainHint,retryable:!1,...fix.scope?{scope:fix.scope}:{},data:fix.data,...fix.command?{next:[{command:buildCommandWithGlobalFlags(client.argv,fix.command,packageName,{globalFlags:"all",preserveProject:!1,excludeFlags:fix.excludeFlags}),when:fix.when}]}:{}};return shouldEmitNonInteractiveCommandError(client)&&outputAgentError(client,payload,1),opts?.json?(output_manager_default.stopSpinner(),writeAgentError(client,payload),1):(output_manager_default.error(message),fix.command&&output_manager_default.log(fix.hint),1)}function failOwaspPlanGate(client,error,scope,json){let message=apiServerMessage(error);if(!message)return null;if(/OWASP Core Ruleset must be enabled/i.test(message)){let dashboard=scope.type==="project"&&scope.teamSlug?`https://vercel.com/${scope.teamSlug}/${scope.displayName}/firewall`:scope.type==="team"?"the team's Firewall page":"the project's Firewall page";return failFirewall(client,{json,message:`OWASP Core Ruleset isn't on this team's plan yet. Add it from ${dashboard} in the dashboard (Managed Rulesets \u2192 Add to Plan).`,reason:AGENT_REASON.PLAN_UPGRADE_REQUIRED})}return scope.type==="project"&&/OWASP (Core Ruleset|rules) requires? a Priority project/i.test(message)?failPriorityProjectGate(client,error,scope,{json,message:`OWASP Core Ruleset requires a Priority project for ${scope.displayName}.`}):/OWASP (Core Ruleset is|rules are) not available/i.test(message)?failFirewall(client,{json,message:scope.type==="team"?"Team-level OWASP Core Ruleset requires an Enterprise plan.":"OWASP Core Ruleset requires an Enterprise plan.",reason:AGENT_REASON.PLAN_UPGRADE_REQUIRED}):null}function getRulePayload(flags){let legacy=flags["--json"];return legacy!==void 0&&flags["--data"]!==void 0?(output_manager_default.error("Can't use --data with --json."),2):(legacy!==void 0&&output_manager_default.warning("--json is deprecated for rule payloads. Use --data."),flags["--data"]??legacy)}async function parseSubcommandArgs(argv,command,client,commandPath){let parsedArgs,fullPath=commandPath||command.name;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});return outputAgentError(client,{status:AGENT_STATUS.ERROR,reason:AGENT_REASON.INVALID_ARGUMENTS,message:rawMessage,next:[{command:getCommandNamePlain(`firewall ${fullPath} ${flags.join(" ")}`.trim()),when:"fix options and retry"}]},2),2}return printError(err),2}return parsedArgs}async function confirmAction(client,skipConfirmation,message,details){return skipConfirmation?!0:client.nonInteractive||!client.stdin.isTTY?(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}
|
|
10
10
|
`),await client.input.confirm(message,!1))}function firewallPermissionMessage(action,projectName){return`You don't have permission to ${action} for ${projectName}. Ask a team owner to grant access.`}function failFirewall(client,opts){let reason=opts.reason??AGENT_REASON.INVALID_ARGUMENTS,exitCode=getExitCodeForReason(reason);if(client.nonInteractive||opts.json){let payload={status:AGENT_STATUS.ERROR,reason,message:opts.message,...opts.fix?.hint?{hint:opts.fix.hint}:{},next:[...opts.fix?.command?[{command:withGlobalFlags(client,opts.fix.command,void 0,{excludeFlags:opts.fix.excludeFlags,preserveProject:opts.fix.preserveProject}),...opts.fix.when?{when:opts.fix.when}:{}}]:[],...opts.nextCommand?[{command:withGlobalFlags(client,opts.nextCommand)}]:[]]};return client.nonInteractive?outputAgentError(client,payload,exitCode):(output_manager_default.stopSpinner(),writeAgentError(client,payload)),exitCode}return output_manager_default.error(opts.message),opts.fix&&output_manager_default.log(opts.fix.hint),exitCode}function failFirewallObservabilityPlan(client,error,projectName){let message=apiServerMessage(error)??FIREWALL_ACTIVITY_PLAN_MESSAGE,fix=clientObservabilityPlanRecovery(client,error,message,projectName);return failFirewall(client,{message,fix,reason:AGENT_REASON.API_ERROR})}function refuseManagedBotMutation(client,scope,identifier,verb){if(scope.type!=="project")return null;let id=resolveManagedBotRuleId(identifier);if(!id)return null;let command=`firewall rules update ${id} --action <action>`;return failFirewall(client,{message:`Can't ${verb} "${identifier}". That's a managed bot rule.`,reason:AGENT_REASON.INVALID_ARGUMENTS,fix:{command,hint:`Use ${import_chalk2.default.cyan(withGlobalFlags(client,command,scope))} to change it.`,when:"change the managed bot rule instead"}})}function isRetryableApiError(error){return isAPIError(error)&&(error.status>=500||error.status===429)}function failFirewallApi(client,e,opts){if(isAPIError(e)&&(e.status===401||e.status===403))return failFirewall(client,{message:firewallPermissionMessage(opts.permissionAction,opts.projectName),reason:AGENT_REASON.PERMISSION_DENIED,json:opts.json});if(e instanceof Error&&(e.name==="TimeoutError"||e.name==="AbortError")){let job=opts.timeoutJob??"firewall data";return failFirewall(client,{message:`Timed out waiting for ${job}. Re-run the command \u2014 the next try is usually faster.`,nextCommand:opts.nextCommand,reason:AGENT_REASON.API_ERROR,json:opts.json})}let msg=e instanceof Error&&e.message?e.message:opts.fallback;return failFirewall(client,{message:msg,nextCommand:isRetryableApiError(e)?opts.nextCommand:void 0,reason:AGENT_REASON.API_ERROR,json:opts.json})}function outputJson(client,data){output_manager_default.stopSpinner(),client.stdout.write(JSON.stringify(data,null,2)+`
|