@vercel/cli-support 68.0.0-snapshot-224301946cd2 → 68.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/chunks/{add-XAXZ7GQY.js → add-4ZXS4RRN.js} +1 -1
- package/dist/chunks/{add-YQUNDDNA.js → add-G2LGF4HL.js} +1 -1
- package/dist/chunks/{add-4KBCK23F.js → add-RH3RQPGP.js} +1 -1
- package/dist/chunks/alerts-3352VWDL.js +8 -0
- package/dist/chunks/{build-TM2QAMXR.js → build-3UFKTTS5.js} +1 -1
- package/dist/chunks/chunk-22ZRVWYP.js +16 -0
- package/dist/chunks/{chunk-IIGT4EZU.js → chunk-2FUGD6J7.js} +1 -1
- package/dist/chunks/{chunk-WQWM7JF5.js → chunk-37P7O3AQ.js} +1 -1
- package/dist/chunks/{chunk-CSNP5RIM.js → chunk-3ARTWVQV.js} +1 -1
- package/dist/chunks/{chunk-2HFP22IP.js → chunk-3SF3ILIT.js} +1 -1
- package/dist/chunks/{chunk-7AAYWDIZ.js → chunk-46ISU3XI.js} +2 -2
- package/dist/chunks/{chunk-JOJOC2KU.js → chunk-47E5IB3C.js} +1 -1
- package/dist/chunks/chunk-4F73GVJZ.js +7 -0
- package/dist/chunks/{chunk-SDD6ZLJY.js → chunk-4FBOQLPZ.js} +1 -1
- package/dist/chunks/{chunk-YYC2AOHC.js → chunk-4SWS7RKX.js} +1 -1
- package/dist/chunks/{chunk-KSV7UCFB.js → chunk-5A3DDLQR.js} +1 -1
- package/dist/chunks/{chunk-BHL2HM6I.js → chunk-5U2YLD56.js} +1 -1
- package/dist/chunks/{chunk-OCJG4DNX.js → chunk-5WYJSLCF.js} +1 -1
- package/dist/chunks/{chunk-7K5ZWVDL.js → chunk-6DBLXAJI.js} +1 -1
- package/dist/chunks/{chunk-SHJ3XTD3.js → chunk-6TEYSBCT.js} +1 -1
- package/dist/chunks/chunk-6UJIJLQC.js +13 -0
- package/dist/chunks/{chunk-UZHCQFUQ.js → chunk-76NL3ZRJ.js} +1 -1
- package/dist/chunks/{chunk-PGHOMVQA.js → chunk-7SLMNM55.js} +1 -1
- package/dist/chunks/{chunk-TBLZ7V7D.js → chunk-AMZ7AUYX.js} +1 -1
- package/dist/chunks/{chunk-KW3MMVVQ.js → chunk-ATSAMHUZ.js} +1 -1
- package/dist/chunks/{chunk-OXRKY2TM.js → chunk-AVCLYJNC.js} +1 -1
- package/dist/chunks/{chunk-FHBZCMSG.js → chunk-AW5KOUD7.js} +1 -1
- package/dist/chunks/{chunk-WLD4SGKM.js → chunk-BIABM3FB.js} +1 -1
- package/dist/chunks/{chunk-4D5DAM3D.js → chunk-CEA5NDJC.js} +1 -1
- package/dist/chunks/{chunk-3VNS4D7V.js → chunk-CTBSRTJW.js} +1 -1
- package/dist/chunks/{chunk-IHHF75BQ.js → chunk-D2JNI6UB.js} +1 -1
- package/dist/chunks/{chunk-IXBJGZ54.js → chunk-D6NVKMRP.js} +1 -1
- package/dist/chunks/{chunk-6YBVHJRH.js → chunk-D6O5O3CW.js} +1 -1
- package/dist/chunks/{chunk-BUAK2QUA.js → chunk-DDZEKNQR.js} +1 -1
- package/dist/chunks/{chunk-YNMTP26U.js → chunk-DGLE44KA.js} +1 -1
- package/dist/chunks/{chunk-VQZ773A2.js → chunk-DH4A4QMD.js} +1 -1
- package/dist/chunks/{chunk-NZ5UWYC5.js → chunk-DNONVY2L.js} +1 -1
- package/dist/chunks/{chunk-F2JP7O2U.js → chunk-DTCQWGHE.js} +2 -2
- package/dist/chunks/{chunk-JJ63FWHZ.js → chunk-DXFP22OK.js} +1 -1
- package/dist/chunks/{chunk-S5C6NG55.js → chunk-E3AML3VR.js} +1 -1
- package/dist/chunks/{chunk-CV3QFGDU.js → chunk-EHAS6SQB.js} +1 -1
- package/dist/chunks/{chunk-VLVOTIOJ.js → chunk-EMTZZXMH.js} +1 -1
- package/dist/chunks/{chunk-SOTBQFIW.js → chunk-FTNLCQC6.js} +1 -1
- package/dist/chunks/{chunk-7GJ37QPL.js → chunk-GRRVPFSB.js} +1 -1
- package/dist/chunks/{chunk-EBUW6R7N.js → chunk-GXWBL6YV.js} +1 -1
- package/dist/chunks/{chunk-YKQZ2FIY.js → chunk-H24KFNPB.js} +1 -1
- package/dist/chunks/{chunk-35VK27MF.js → chunk-H3ZSF2P3.js} +1 -1
- package/dist/chunks/{chunk-YTVFHGBY.js → chunk-HR4ID3MU.js} +1 -1
- package/dist/chunks/{chunk-AYWB3MO2.js → chunk-HYAIA5YC.js} +3 -3
- package/dist/chunks/{chunk-SHL6BPBV.js → chunk-J3U2QD2L.js} +1 -1
- package/dist/chunks/{chunk-VQYHDGDM.js → chunk-J5SINMVO.js} +1 -1
- package/dist/chunks/{chunk-UNRBMQCQ.js → chunk-JCHZRW4N.js} +1 -1
- package/dist/chunks/{chunk-NOAZDAOU.js → chunk-KIDGOY4F.js} +1 -1
- package/dist/chunks/chunk-KLBSCTLL.js +7 -0
- package/dist/chunks/{chunk-5ZYYUQZI.js → chunk-KNNIA3PS.js} +1 -1
- package/dist/chunks/{chunk-DC4FJRL3.js → chunk-KXMFGDO4.js} +1 -1
- package/dist/chunks/chunk-L74PQVPL.js +7 -0
- package/dist/chunks/{chunk-KOZYKNZR.js → chunk-MDXG7T7M.js} +1 -1
- package/dist/chunks/{chunk-JUVJDLOW.js → chunk-MGKNSTU4.js} +1 -1
- package/dist/chunks/{chunk-FB25ZRYC.js → chunk-MWFHS4HV.js} +1 -1
- package/dist/chunks/{chunk-K6DILXMH.js → chunk-MYVALJ4D.js} +1 -1
- package/dist/chunks/{chunk-YYDI5Q5K.js → chunk-N3ZNAMGR.js} +1 -1
- package/dist/chunks/{chunk-BCFKN4Q3.js → chunk-NMIB4JYP.js} +1 -1
- package/dist/chunks/{chunk-N3FO2Y5F.js → chunk-O3GQG2ML.js} +1 -1
- package/dist/chunks/{chunk-67D4BIBH.js → chunk-O3YZLVC6.js} +2 -2
- package/dist/chunks/{chunk-DUSMVY4N.js → chunk-OZKP3WKT.js} +1 -1
- package/dist/chunks/{chunk-3BTI6JHC.js → chunk-PAHYNO73.js} +1 -1
- package/dist/chunks/{chunk-HX6UHVQP.js → chunk-PX3V7X3Q.js} +1 -1
- package/dist/chunks/{chunk-BLVC5EJT.js → chunk-Q4R34AVE.js} +1 -1
- package/dist/chunks/{chunk-R3QHEJL6.js → chunk-Q6YPC3GK.js} +1 -1
- package/dist/chunks/{chunk-WHOGPAL6.js → chunk-QHGPFYWQ.js} +1 -1
- package/dist/chunks/{chunk-DMA77UYG.js → chunk-QPNTR3PA.js} +1 -1
- package/dist/chunks/{chunk-PHPJS2G2.js → chunk-R43H4T4L.js} +1 -1
- package/dist/chunks/{chunk-R47H4HYG.js → chunk-S6TAO4MD.js} +1 -1
- package/dist/chunks/{chunk-KHUD5ZTN.js → chunk-TGIIE2L3.js} +1 -1
- package/dist/chunks/chunk-TSIKSHYG.js +7 -0
- package/dist/chunks/{chunk-HS3PNMBX.js → chunk-TU54LHNW.js} +1 -1
- package/dist/chunks/{chunk-KHMNANEN.js → chunk-U43WXZBP.js} +1 -1
- package/dist/chunks/{chunk-HMJR6RVF.js → chunk-UPDIZCP3.js} +1 -1
- package/dist/chunks/{chunk-ZQVD57V5.js → chunk-V3YNYCRV.js} +2 -2
- package/dist/chunks/{chunk-P43CQDVR.js → chunk-VBANKZWM.js} +1 -1
- package/dist/chunks/{chunk-TOCPUQ6N.js → chunk-VJNTVPUV.js} +1 -1
- package/dist/chunks/{chunk-BBOOWC7X.js → chunk-WHEA5VLX.js} +1 -1
- package/dist/chunks/{chunk-O4Y26S64.js → chunk-XC25DYA7.js} +1 -1
- package/dist/chunks/{chunk-AVXX4Q6S.js → chunk-XE4SLG5H.js} +1 -1
- package/dist/chunks/{chunk-X5TIKXI7.js → chunk-XHBZITV4.js} +1 -1
- package/dist/chunks/{chunk-TO5AR7IO.js → chunk-YOKTRWQX.js} +1 -1
- package/dist/chunks/{chunk-HLZRBOYG.js → chunk-Z3XKNZDP.js} +1 -1
- package/dist/chunks/{chunk-MTFTT7ZW.js → chunk-Z436ZYLV.js} +1 -1
- package/dist/chunks/{chunk-5UG4YYEX.js → chunk-ZBOTJT5S.js} +1 -1
- package/dist/chunks/chunk-ZGM4K3B5.js +7 -0
- package/dist/chunks/{chunk-C6GEVMTF.js → chunk-ZHGKJCQ2.js} +8 -8
- package/dist/chunks/{clear-RYDN2BJI.js → clear-GL4SZ2XR.js} +1 -1
- package/dist/chunks/{compile-vercel-config-52MEHYDA.js → compile-vercel-config-HMKEDWC4.js} +1 -1
- package/dist/chunks/config-KSQQQMQQ.js +7 -0
- package/dist/chunks/{config-TLW5QWPA.js → config-U4GLPYDY.js} +1 -1
- package/dist/chunks/config-validator.mjs +1 -1
- package/dist/chunks/{delete-D6Y47HSU.js → delete-D2WLQHVB.js} +1 -1
- package/dist/chunks/delete-O2VWRQC3.js +10 -0
- package/dist/chunks/{describe-JMZNU7JT.js → describe-N36SISDN.js} +1 -1
- package/dist/chunks/{detect-projects-AZXG6BRD.js → detect-projects-I7NEHWSM.js} +1 -1
- package/dist/chunks/{detect-services-UAV2B7PV.js → detect-services-4ONC2DH3.js} +1 -1
- package/dist/chunks/disable-EHRVY24G.js +7 -0
- package/dist/chunks/discard-QW5TMTXX.js +14 -0
- package/dist/chunks/{edit-JR3XPTH4.js → edit-IZR537PS.js} +1 -1
- package/dist/chunks/edit-WM6KJPSI.js +8 -0
- package/dist/chunks/enable-5Z72O3NI.js +7 -0
- package/dist/chunks/{export-ZSGAZXLV.js → export-IWVMWM2H.js} +1 -1
- package/dist/chunks/{future-2GW5PLR5.js → future-3AUPMPY7.js} +1 -1
- package/dist/chunks/{generate-cert-for-deploy-KY4ZCRAK.js → generate-cert-for-deploy-OZWVIWOO.js} +1 -1
- package/dist/chunks/image-EFBQXTAP.js +7 -0
- package/dist/chunks/{import-builders-MXKADD3S.js → import-builders-2G4KVI4T.js} +1 -1
- package/dist/chunks/{inspect-5L542UG5.js → inspect-47FM3OWG.js} +1 -1
- package/dist/chunks/{inspect-AMCI2LLR.js → inspect-6J5DGZZ4.js} +1 -1
- package/dist/chunks/{inspect-MJ7CCOKD.js → inspect-6Y672OQ3.js} +1 -1
- package/dist/chunks/inspect-ALC2J4BF.js +8 -0
- package/dist/chunks/{inspect-J6KVRJ7Y.js → inspect-QT3QEFBW.js} +1 -1
- package/dist/chunks/{inspect-6DHUE7A7.js → inspect-SW2I7D6E.js} +1 -1
- package/dist/chunks/{list-HFAZSMP4.js → list-2CMCXXP4.js} +1 -1
- package/dist/chunks/{list-H26ESLWR.js → list-BIFH4KO5.js} +1 -1
- package/dist/chunks/{list-6NRT47ES.js → list-CXXDI5UV.js} +1 -1
- package/dist/chunks/list-TGDHJKDT.js +8 -0
- package/dist/chunks/{login-FB6OZIZ4.js → login-IUQDG334.js} +1 -1
- package/dist/chunks/{login-MECBM76Z.js → login-WYDX5KZN.js} +1 -1
- package/dist/chunks/{logs-CP7YB73H.js → logs-E3RZLAT2.js} +1 -1
- package/dist/chunks/{ls-RQVX47DY.js → ls-4DNFF35I.js} +1 -1
- package/dist/chunks/{ls-32OVVPZW.js → ls-7D73WVOF.js} +1 -1
- package/dist/chunks/{ls-GJZPC64P.js → ls-C75Z5FBX.js} +1 -1
- package/dist/chunks/{ls-OHOMEI5T.js → ls-ERDQLUT2.js} +1 -1
- package/dist/chunks/{ls-WG2IUBOR.js → ls-GC5MX2HZ.js} +1 -1
- package/dist/chunks/{ls-XYTMV3AK.js → ls-IQUZ6GWG.js} +1 -1
- package/dist/chunks/{ls-5MH6K27B.js → ls-YTKJRKD3.js} +1 -1
- package/dist/chunks/{migrate-experimental-services-T7T24F2S.js → migrate-experimental-services-GPGYPN66.js} +1 -1
- package/dist/chunks/{mutate-A2NBCRWB.js → mutate-YJNE2733.js} +1 -1
- package/dist/chunks/{notifications-DNYXKQTM.js → notifications-2HU4L7WA.js} +1 -1
- package/dist/chunks/{open-WMRSBVLE.js → open-MA7QGJKO.js} +1 -1
- package/dist/chunks/{openapi-6RKKA6JG.js → openapi-POBVCXS3.js} +1 -1
- package/dist/chunks/{permissions-NKB64XKD.js → permissions-AU5M5A6G.js} +1 -1
- package/dist/chunks/{plugin-offer-PVANAUW2.js → plugin-offer-E53UQXXX.js} +1 -1
- package/dist/chunks/{prompt-missing-credentials-UZPXAUPC.js → prompt-missing-credentials-7F7MUAWK.js} +1 -1
- package/dist/chunks/publish-G7NQESCE.js +15 -0
- package/dist/chunks/{pull-YVO5O2XN.js → pull-4LISUHDN.js} +1 -1
- package/dist/chunks/{purchase-domain-if-available-CRDIL367.js → purchase-domain-if-available-QH2OHRLZ.js} +1 -1
- package/dist/chunks/{push-JLMYKMPG.js → push-BG7UEIKY.js} +1 -1
- package/dist/chunks/{query-B5QW26OE.js → query-QCIU5IB4.js} +1 -1
- package/dist/chunks/{raw-query-EVKRAAOJ.js → raw-query-QHFSKN55.js} +1 -1
- package/dist/chunks/{reauthenticate-RWWFUE42.js → reauthenticate-U2LOFDFP.js} +1 -1
- package/dist/chunks/remove-IB7C6LII.js +9 -0
- package/dist/chunks/reorder-E5UYNMML.js +10 -0
- package/dist/chunks/{reply-EH2GBOMD.js → reply-DSDFBUAX.js} +1 -1
- package/dist/chunks/{resolve-46WA2PXL.js → resolve-VK5QTUII.js} +1 -1
- package/dist/chunks/{resolve-agent-team-52A4CIIC.js → resolve-agent-team-D7RFR6WL.js} +1 -1
- package/dist/chunks/restore-IVNZOVU3.js +16 -0
- package/dist/chunks/{rm-5EFXXQSK.js → rm-GYS4DS2Z.js} +1 -1
- package/dist/chunks/{rm-3HIT2KQT.js → rm-L2KCHMLS.js} +1 -1
- package/dist/chunks/{rm-R5B4BV3M.js → rm-LWEITUDD.js} +1 -1
- package/dist/chunks/{rm-X46AUZBU.js → rm-PAI3WZXJ.js} +1 -1
- package/dist/chunks/{rm-XF6JNRVC.js → rm-PDJE63VV.js} +1 -1
- package/dist/chunks/{rule-inspect-HLLGCACM.js → rule-inspect-LQISNCBT.js} +1 -1
- package/dist/chunks/{schema-CBYGIMPL.js → schema-ZIK2W4AX.js} +1 -1
- package/dist/chunks/{schema-NCH5NN2G.js → schema-ZOPJJLJC.js} +1 -1
- package/dist/chunks/{select-org-GTYZJQR3.js → select-org-EKDOS2CQ.js} +1 -1
- package/dist/chunks/set-B5MPNYXG.js +8 -0
- package/dist/chunks/{set-5EFQ6HAY.js → set-MC2CLSA2.js} +1 -1
- package/dist/chunks/{setup-and-link-ROS22SLK.js → setup-and-link-FHHZAU65.js} +1 -1
- package/dist/chunks/{skills-SUGA6D3G.js → skills-X5MN3OH2.js} +1 -1
- package/dist/chunks/{tags-Z4NNOYPB.js → tags-WRVKKRN7.js} +1 -1
- package/dist/chunks/{types-YFDB4QZA.js → types-PC3JIYPX.js} +1 -1
- package/dist/chunks/{update-GKWIBCQG.js → update-QDIZFM4T.js} +1 -1
- package/dist/chunks/{usage-G6S4RCCK.js → usage-JUP36KHN.js} +1 -1
- package/dist/chunks/{validate-config-LDOYJ4LL.js → validate-config-K42CVRCZ.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 +5 -5
- package/dist/commands/env/index.js +1 -1
- package/dist/commands/link/index.js +1 -1
- package/dist/commands/list/index.js +1 -1
- package/dist/commands/project/index.js +62 -51
- package/dist/commands/tunnel/index.js +1 -1
- package/dist/commands-account.js +6 -6
- package/dist/commands-ai.js +2 -2
- package/dist/commands-blob.js +1 -1
- package/dist/commands-core.js +6 -6
- package/dist/commands-deployments.js +1 -1
- package/dist/commands-flags.js +8 -8
- package/dist/commands-integrations.js +1 -1
- package/dist/commands-observability.js +2 -2
- package/dist/commands-routing.js +2 -2
- package/dist/index.js +4 -4
- package/dist/internal-build.js +1 -1
- package/dist/package.json +41 -41
- package/dist/version.mjs +1 -1
- package/package.json +43 -43
- package/dist/chunks/alerts-DUTGB7DI.js +0 -8
- package/dist/chunks/chunk-2BK7SZQA.js +0 -7
- package/dist/chunks/chunk-G5JCTGL2.js +0 -7
- package/dist/chunks/chunk-GQXKF3PR.js +0 -7
- package/dist/chunks/chunk-J4OACK47.js +0 -16
- package/dist/chunks/chunk-LM4457HA.js +0 -13
- package/dist/chunks/chunk-N4PID4SD.js +0 -7
- package/dist/chunks/config-QQSZ7AL4.js +0 -7
- package/dist/chunks/delete-WKZ4QCNM.js +0 -10
- package/dist/chunks/disable-VCOBD3ZT.js +0 -7
- package/dist/chunks/discard-VIOUKDUY.js +0 -14
- package/dist/chunks/edit-4FEVCMD4.js +0 -8
- package/dist/chunks/enable-7UPZVKQK.js +0 -7
- package/dist/chunks/image-HXRCOQ7V.js +0 -7
- package/dist/chunks/inspect-YKSWSH3T.js +0 -8
- package/dist/chunks/list-ZHES2WYK.js +0 -8
- package/dist/chunks/publish-LDWJ2ON7.js +0 -15
- package/dist/chunks/remove-CSIMGLLS.js +0 -9
- package/dist/chunks/reorder-ZZJLSJTV.js +0 -10
- package/dist/chunks/restore-WYZSU2PQ.js +0 -16
- package/dist/chunks/set-BS5KCRE4.js +0 -8
|
@@ -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{findOrganization}from"./chunk-
|
|
7
|
+
import{findOrganization}from"./chunk-DGLE44KA.js";import{TEAM_BUDGET,listBudgetProducts}from"./chunk-CTBSRTJW.js";import{BUDGET_SCOPES,OPTION_SCOPES,isBudgetScope}from"./chunk-L74PQVPL.js";import{getProjectByNameOrId}from"./chunk-3AFEVHHY.js";import{getTeamByIdOrSlug}from"./chunk-3ARTWVQV.js";import{ProjectNotFound,isAPIError}from"./chunk-QFE3RPMA.js";import{getCommandName}from"./chunk-B4KA3ZH2.js";import{output_manager_default}from"./chunk-RYSO5U3E.js";async function resolveBudgetTeam(client){let id=await client.resolveCurrentTeam();if(!id)return output_manager_default.error("No team selected. Use `vercel --scope <team-slug> budget \u2026` or run `vercel switch` first."),null;try{let team=await getTeamByIdOrSlug(client,id);return{id:team.id,slug:team.slug}}catch{return{id,slug:id}}}var SCOPE_OPTIONS={organization:{noun:"an organization slug or ID",resolve:async(_client,organization)=>({value:organizationTarget(organization)})},project:{noun:"a project name or ID",resolve:resolveProject},product:{noun:"a product name or ID",resolve:resolveProduct}};function parseBudgetScopeOptions(opts){let given=OPTION_SCOPES.filter(scope2=>opts[`--${scope2}`]!==void 0);if(given.length>1)return{error:`Can't use --${given[0]} with --${given[1]}.`};if(given.length===0)return{value:null};let scope=given[0],value=opts[`--${scope}`]?.trim();return value?{value:{scope,value}}:{error:`Provide ${SCOPE_OPTIONS[scope].noun} with --${scope}.`}}function parseBudgetFilterOptions(opts){let scope=parseBudgetScopeOptions(opts);if("error"in scope)return scope;let values=(opts["--type"]??[]).flatMap(value=>value.split(",")).map(value=>value.trim());if(values.length===0)return{value:{input:scope.value,types:null}};let unknown=values.find(value=>!isBudgetScope(value));return unknown!==void 0?{error:`Unknown budget type "${unknown}". Expected one of: ${BUDGET_SCOPES.join(", ")}.`}:scope.value?{error:`Can't use --type with --${scope.value.scope}.`}:{value:{input:null,types:BUDGET_SCOPES.filter(type=>values.includes(type))}}}function scopeOptionArgs(input){return input?` --${input.scope} ${quoteArg(input.value)}`:""}function quoteArg(arg){return/\s/.test(arg)?JSON.stringify(arg):arg}function teamTarget(team){return{selector:TEAM_BUDGET,args:"",where:`on team ${team.slug}`,pauses:`all projects on team ${team.slug}`,json:{scope:"team",scopeId:team.id,name:team.slug}}}async function resolveBudgetTarget(client,team,input,{readOnly=!1}={}){return input?SCOPE_OPTIONS[input.scope].resolve(client,team,input.value,readOnly):{value:teamTarget(team)}}function typeFilter(team,types){if(!types)return{selector:void 0,args:"",where:`on team ${team.slug}`,json:{scope:null,scopeId:null,name:null}};let[first]=types;return{selector:{scope:types},args:types.includes("team")||first===void 0?"":` --${first} <${first.toUpperCase()}>`,where:`on team ${team.slug} (type ${types.join(", ")})`,json:{type:types}}}async function resolveBudgetFilter(client,team,{input,types}){return input?resolveBudgetTarget(client,team,input,{readOnly:!0}):{value:typeFilter(team,types)}}async function resolveBudgetOwner(client,input){if(input?.scope==="organization")return resolveOrganization(client,input.value);let team=await resolveBudgetTeam(client);return team?{value:{...team,type:"team"}}:null}async function resolveOrganization(client,value){let found=await findOrganization(client,value);return"error"in found?{error:found.error,usage:!1}:{value:{type:"organization",...found.value}}}function organizationTarget(organization){return{selector:{scope:"organization",orgId:organization.id},args:` --organization ${organization.slug}`,where:`on organization ${organization.slug}`,pauses:null,json:{scope:"organization",scopeId:organization.id,name:organization.slug}}}var PROJECT_ID=/^prj_[A-Za-z0-9]+$/;async function resolveProject(client,team,name,readOnly){let project;try{project=await getProjectByNameOrId(client,name,team.id)}catch(err){if(isAPIError(err))return{error:err.message,usage:!1};throw err}return project instanceof ProjectNotFound&&readOnly&&PROJECT_ID.test(name)?{value:{selector:{scope:"project",scopeId:name},args:` --project ${name}`,where:`on project ${name}`,pauses:`project ${name}`,json:{scope:"project",scopeId:name,name:null}}}:project instanceof ProjectNotFound?{error:`Project "${name}" was not found on team ${team.slug}.`,usage:!1}:{value:{selector:{scope:"project",scopeId:project.id},args:` --project ${project.name}`,where:`on project ${project.name}`,pauses:`project ${project.name}`,json:{scope:"project",scopeId:project.id,name:project.name}}}}var MAX_PRODUCT_SUGGESTIONS=5,PRODUCT_ID=/^prod_[a-z0-9]+$/;async function resolveProduct(client,team,name){let products;try{products=await listBudgetProducts(client)}catch(err){if(isAPIError(err))return{error:err.message,usage:!1};throw err}let lower=name.toLowerCase(),product=products.find(p=>p.id===name)??products.find(p=>p.name.toLowerCase()===lower);if(!product&&PRODUCT_ID.test(name))return{value:{selector:{scope:"product",scopeId:name},args:` --product ${name}`,where:`on product ${name}`,pauses:null,json:{scope:"product",scopeId:name,name:null}}};if(!product){if(products.length===0)return{error:`Team ${team.slug} has no products that can have a budget.`,usage:!0};let similar=products.filter(p=>p.name.toLowerCase().includes(lower)),hint=similar.length>0&&similar.length<=MAX_PRODUCT_SUGGESTIONS?`Did you mean ${similar.map(p=>`"${p.name}"`).join(", ")}?`:`Products that can have one: ${products.map(p=>p.name).sort((a,b)=>a.localeCompare(b)).join(", ")}.`;return{error:`Product "${name}" can't have a budget on team ${team.slug}. ${hint}`,usage:!0}}return{value:{selector:{scope:"product",scopeId:product.id},args:` --product ${product.id}`,where:`on product ${product.name}`,pauses:product.pausable?`${product.name} usage`:null,json:{scope:"product",scopeId:product.id,name:product.name}}}}function rejectUnexpectedArgs(args,command){return args.length===0?!1:(output_manager_default.error(`Unexpected argument "${args[0]}". ${getCommandName(command)} takes options only.`),!0)}function trackScopeOptions(telemetry,opts){for(let scope of OPTION_SCOPES){let method=`trackCliOption${capitalize(scope)}`;telemetry[method](opts[`--${scope}`])}}function capitalize(value){return`${value[0].toUpperCase()}${value.slice(1)}`}export{parseBudgetScopeOptions,parseBudgetFilterOptions,scopeOptionArgs,resolveBudgetTarget,typeFilter,resolveBudgetFilter,resolveBudgetOwner,organizationTarget,rejectUnexpectedArgs,trackScopeOptions};
|
|
@@ -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{buildCorrectedCommand,isArgumentError}from"./chunk-INIZJZ3O.js";import{buildInvalidTokenAgentError,getErrorRecovery,getFlagExperimentConflict,isInvalidTokenApiError,isInvalidTokenError,shouldEmitNonInteractiveCommandError,trackAgentError,withGlobalFlags,writeAgentError}from"./chunk-
|
|
7
|
+
import{buildCorrectedCommand,isArgumentError}from"./chunk-INIZJZ3O.js";import{buildInvalidTokenAgentError,getErrorRecovery,getFlagExperimentConflict,isInvalidTokenApiError,isInvalidTokenError,shouldEmitNonInteractiveCommandError,trackAgentError,withGlobalFlags,writeAgentError}from"./chunk-3ARTWVQV.js";import{parseRetryAfterHeaderAsMillis,require_bytes}from"./chunk-QFE3RPMA.js";import{getCommandName,getCommandNamePlain}from"./chunk-B4KA3ZH2.js";import{pkg_default}from"./chunk-BOJDM3O7.js";import{cliErrorFromUnknown,output_manager_default,recordCliError}from"./chunk-RYSO5U3E.js";import{require_source}from"./chunk-NB2WLB3J.js";import{__toESM}from"./chunk-BZENIQ7N.js";var import_chalk=__toESM(require_source(),1);var import_bytes=__toESM(require_bytes(),1);async function responseError(res,fallbackMessage=null,parsedBody={}){let message="",bodyError;if(res.status>=400&&res.status<500){let body;try{body=await res.json()}catch{body=parsedBody}bodyError=body.error||body.err||{},message=bodyError.message}message||(message=fallbackMessage===null?"Response Error":fallbackMessage);let err=new Error(`${message} (${res.status})`);if(err.status=res.status,err.serverMessage=message,bodyError)for(let field of Object.keys(bodyError))field!=="message"&&(err[field]=bodyError[field]);if(res.status===429||res.status===503){let parsed=parseRetryAfterHeaderAsMillis(res.headers.get("Retry-After"));err.retryAfterMs=parsed??(res.status===429?0:void 0)}return err}var MAX_SERIALIZED_ERROR_DEPTH=5;function isPlainObject(value){let proto=Object.getPrototypeOf(value);return proto===null||proto===Object.prototype}function toJsonSafe(value,ancestors,depth){if(typeof value=="bigint")return value.toString();if(!(typeof value=="function"||typeof value=="symbol")){if(value===null||typeof value!="object")return value;if(ancestors.has(value))return"[Circular]";if(depth>=MAX_SERIALIZED_ERROR_DEPTH)return"[Truncated]";if(value instanceof Error)return serializeError(value,ancestors,depth+1);if(!Array.isArray(value)&&!isPlainObject(value))return`[${value.constructor?.name||"Object"}]`;ancestors.add(value);try{if(Array.isArray(value))return value.map(item=>toJsonSafe(item,ancestors,depth+1));let copy={};for(let[key,child]of Object.entries(value))copy[key]=toJsonSafe(child,ancestors,depth+1);return copy}finally{ancestors.delete(value)}}}function serializeError(err,ancestors,depth){ancestors.add(err);try{let enumerable={name:err.name};for(let key of Object.getOwnPropertyNames(err))enumerable[key]=toJsonSafe(err[key],ancestors,depth);return enumerable}finally{ancestors.delete(err)}}function toEnumerableError(err){return err===null||typeof err!="object"?{name:"Error",message:String(err)}:serializeError(err,new WeakSet,0)}function printError(error2,client){if(typeof error2=="string"&&(error2=new Error(error2)),recordCliError(cliErrorFromUnknown(error2)),client&&shouldEmitNonInteractiveCommandError(client)&&isInvalidTokenError(error2)){output_manager_default.stopSpinner(),writeAgentError(client,buildInvalidTokenAgentError(client));return}let apiError=error2,{message,stack,status,code,sizeLimit}=apiError,argumentError=isArgumentError(error2)?error2:void 0,suggestion=argumentError?.suggestedOption&&argumentError.invalidOption,correction=suggestion&&client&&argumentError?buildCorrectedCommand(client.argv,argumentError.invalidOption,argumentError.suggestedOption,argumentError.flagsSpecification):void 0,recovery=getErrorRecovery(apiError,client),statusReason=isInvalidTokenApiError(error2)?"login_required":status===403?"forbidden":status===402?"payment_required":status===401?"not_authorized":status===429?"rate_limited":argumentError?"invalid_arguments":"api_error",conflict=getFlagExperimentConflict(apiError),reason=conflict?"conflict":statusReason,conflictCommand=conflict&&(client?withGlobalFlags(client,conflict.commandTemplate,{preserveProject:!0}):getCommandNamePlain(conflict.commandTemplate)),hint=conflictCommand?`An experiment uses this flag. To see the experiment, run \`${conflictCommand}\`.`:argumentError?.allowedOptions?`Vercel CLI ${pkg_default.version} accepts: ${argumentError.allowedOptions.join(", ")}.${suggestion?` Did you mean ${argumentError.suggestedOption}?`:""}`:recovery.hint;if(client&&(status||argumentError?.allowedOptions)){let payload={...recovery,status:"error",reason,message:conflict?.message??(apiError.serverMessage||message),hint,...conflict&&conflictCommand&&{data:{remoteMessage:conflict.remoteMessage},next:[{command:conflictCommand,when:conflict.commandTemplate.includes("<")?"Replace <experiment> with the experiment that uses the flag, then run the command":"To see the experiment that uses the flag"}]},...argumentError?.allowedOptions&&{allowedOptions:argumentError.allowedOptions,suggestedOption:argumentError.suggestedOption,cliVersion:pkg_default.version},...correction&&{next:[{command:correction,when:correction.includes("<")?"Replace placeholders with the intended values, then run the corrected command":"Run the corrected command"}]}};if(shouldEmitNonInteractiveCommandError(client)){output_manager_default.stopSpinner(),writeAgentError(client,payload);return}trackAgentError(client,payload)}if(conflict){output_manager_default.stopSpinner(),output_manager_default.fatal(conflict.message),conflict.remoteMessage&&output_manager_default.print(` Flags API: ${conflict.remoteMessage}
|
|
8
8
|
`),output_manager_default.print(`
|
|
9
9
|
To see the experiment, run:
|
|
10
10
|
${conflictCommand}
|
|
@@ -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{formatUsd}from"./chunk-
|
|
7
|
+
import{formatUsd}from"./chunk-CTBSRTJW.js";import{DEFAULT_ORDER_WAIT,DEFAULT_ORDER_WAIT_MS}from"./chunk-DXFP22OK.js";import{canPrompt}from"./chunk-IQ7FPAI4.js";import{quoteShellArg}from"./chunk-7RABG6HV.js";import{getTeams}from"./chunk-BIABM3FB.js";import{scopeFlagPassed}from"./chunk-4SWS7RKX.js";import{printAlignedLabel}from"./chunk-M2Q2DUHO.js";import{require_ms}from"./chunk-MXTC4ZAQ.js";import{parseArguments}from"./chunk-INIZJZ3O.js";import{AGENT_ACTION,AGENT_REASON,AGENT_STATUS,buildCommandWithGlobalFlags,getExitCodeForReason,outputActionRequired,outputAgentError,shouldEmitNonInteractiveCommandError,writeActionRequired,writeAgentError}from"./chunk-3ARTWVQV.js";import{wantsMachineReadableOutput}from"./chunk-KA2KG3SY.js";import{packageName}from"./chunk-B4KA3ZH2.js";import{output_manager_default}from"./chunk-RYSO5U3E.js";import{require_build_utils}from"./chunk-5MDNVAE6.js";import{stripSensitiveAuthArgs}from"./chunk-DORCX7UB.js";import{__toESM}from"./chunk-BZENIQ7N.js";var import_build_utils2=__toESM(require_build_utils(),1);import{createHash,randomUUID}from"node:crypto";var import_build_utils=__toESM(require_build_utils(),1),import_ms=__toESM(require_ms(),1);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)}
|
|
@@ -24,4 +24,4 @@ Check the order:
|
|
|
24
24
|
${command}
|
|
25
25
|
`),{approved:!1,exitCode:opts.exitCode}}function approvalArgsFor(approval){return approval.digest===void 0?approval.approvalArgs:[...approval.approvalArgs,"--effects-digest",approval.digest]}async function printPreview(approval,agent){for(let[label,value]of await approval.rows(agent))printAlignedLabel(label,value);output_manager_default.print(`
|
|
26
26
|
${approval.effects.map(line=>` ${line}
|
|
27
|
-
`).join("")}`)}async function deprecateYes(client,approval){let message=`--yes is deprecated for this command. Use ${approval.approvalHint??buildApprovalArgs(approval.approvalArgs,await isTeamMissing(client,approval)?approval.scopeHint:void 0).join(" ")}.`;return wantsMachineReadableOutput(void 0,client.argv)||output_manager_default.warning(message),{reason:AGENT_REASON.DEPRECATED,message}}function buildApprovalCommand(argv,approvalArgs,scope){let{before,after}=splitTypedArgs(argv);return[packageName,...before.map(quoteShellArg),...buildApprovalArgs(approvalArgs,scope),...after.map(quoteShellArg)].join(" ")}function buildApprovalArgv(argv,approvalArgs,scope){let{before,after}=splitTypedArgs(argv);return[packageName,...before,...approvalArgs,...scope===void 0?[]:["--scope",scope],...after]}function splitTypedArgs(argv){let args=stripSensitiveAuthArgs(argv.slice(2)),kept=[];for(let i=0;i<args.length;i++){let arg=args[i];if(arg==="--"){kept.push(...args.slice(i));break}if(LEGACY_CONSENT_FLAGS.has(arg))continue;let name=arg.split("=")[0];if(APPROVAL_OPTIONS.has(name)){arg.includes("=")||i++;continue}kept.push(arg)}let delimiter=kept.indexOf("--");return{before:delimiter===-1?kept:kept.slice(0,delimiter),after:delimiter===-1?[]:kept.slice(delimiter)}}function buildApprovalArgs(approvalArgs,scope){let quoted=approvalArgs.map(quoteShellArg);return scope===void 0?quoted:[...quoted,"--scope",scope==="<TEAM>"?scope:quoteShellArg(scope)]}async function isTeamMissing(client,approval){return approval.teamForApproval&&!await isTeamExplicit(client)}async function isTeamExplicit(client){let{flags}=parseArguments(client.argv.slice(2),{},{permissive:!0});if(flags["--scope"]||flags["--team"])return!0;let team=await client.resolveCurrentTeam({ask:!1});if(!team)return!1;let orgId=(0,import_build_utils2.getPlatformEnv)("ORG_ID");if(orgId)return orgId===team;try{let teams=await getTeams(client);return teams.length===1&&teams[0].id===team}catch(err){return output_manager_default.debug(`Couldn't list teams: ${err}`),!1}}function isAgentRun(client){if(!client.isAgent)return!1;let{argv}=client,index=argv.indexOf("--non-interactive");return!((argv.includes("--non-interactive=false")||argv.includes("--no-non-interactive")||index!==-1&&argv[index+1]==="false")&&client.stdin.isTTY)}function canPromptForApproval(client){return!isAgentRun(client)&&canPrompt(client)}async function withTeam(team,target,agent){return team===void 0||agent&&typeof team=="function"?target:`${typeof team=="function"?await team():team}/${target}`}function track(client,approval,outcome){client.telemetryEventStore?.add({id:randomUUID(),eventTime:Date.now(),key:"approval",value:`${approval.consequence}:${outcome}`})}function capitalize(text){return text.charAt(0).toUpperCase()+text.slice(1)}export{chargeFailureReason,parseAmount,amountMatchesPrice,formatAmountArg,formatTerm,canPromptForCharge,chargeFlagWithValue,printChargeRecovery,writeChargeAction,reportUsageError,reportChargeFailure,orderStatusStep,reportUnknownOutcome,parseOrderWait,reportOrderPending,refuseUnnamedTeam,reportPriceChanged,requireApproval,effectsDigest,buildApprovalCommand,canPromptForApproval};
|
|
27
|
+
`).join("")}`)}async function deprecateYes(client,approval){let message=`--yes is deprecated for this command. Use ${approval.approvalHint??buildApprovalArgs(approval.approvalArgs,await isTeamMissing(client,approval)?approval.scopeHint:void 0).join(" ")}.`;return wantsMachineReadableOutput(void 0,client.argv)||output_manager_default.warning(message),{reason:AGENT_REASON.DEPRECATED,message}}function buildApprovalCommand(argv,approvalArgs,scope){let{before,after}=splitTypedArgs(argv);return[packageName,...before.map(quoteShellArg),...buildApprovalArgs(approvalArgs,scope),...after.map(quoteShellArg)].join(" ")}function buildApprovalArgv(argv,approvalArgs,scope){let{before,after}=splitTypedArgs(argv);return[packageName,...before,...approvalArgs,...scope===void 0?[]:["--scope",scope],...after]}function splitTypedArgs(argv){let args=stripSensitiveAuthArgs(argv.slice(2)),kept=[];for(let i=0;i<args.length;i++){let arg=args[i];if(arg==="--"){kept.push(...args.slice(i));break}if(LEGACY_CONSENT_FLAGS.has(arg))continue;let name=arg.split("=")[0];if(APPROVAL_OPTIONS.has(name)){arg.includes("=")||i++;continue}kept.push(arg)}let delimiter=kept.indexOf("--");return{before:delimiter===-1?kept:kept.slice(0,delimiter),after:delimiter===-1?[]:kept.slice(delimiter)}}function buildApprovalArgs(approvalArgs,scope){let quoted=approvalArgs.map(quoteShellArg);return scope===void 0?quoted:[...quoted,"--scope",scope==="<TEAM>"?scope:quoteShellArg(scope)]}async function isTeamMissing(client,approval){return approval.teamForApproval&&!await isTeamExplicit(client)}async function isTeamExplicit(client){let{flags}=parseArguments(client.argv.slice(2),{},{permissive:!0});if(flags["--scope"]||flags["--team"])return!0;let team=await client.resolveCurrentTeam({ask:!1});if(!team)return!1;let orgId=(0,import_build_utils2.getPlatformEnv)("ORG_ID");if(orgId)return orgId===team;try{let teams=await getTeams(client);return teams.length===1&&teams[0].id===team}catch(err){return output_manager_default.debug(`Couldn't list teams: ${err}`),!1}}function isAgentRun(client){if(!client.isAgent)return!1;let{argv}=client,index=argv.indexOf("--non-interactive");return!((argv.includes("--non-interactive=false")||argv.includes("--no-non-interactive")||index!==-1&&argv[index+1]==="false")&&client.stdin.isTTY)}function canPromptForApproval(client){return!isAgentRun(client)&&canPrompt(client)}async function withTeam(team,target,agent){return team===void 0||agent&&typeof team=="function"?target:`${typeof team=="function"?await team():team}/${target}`}function track(client,approval,outcome){client.telemetryEventStore?.add({id:randomUUID(),eventTime:Date.now(),key:"approval",value:`${approval.consequence}:${outcome}`})}function capitalize(text){return text.charAt(0).toUpperCase()+text.slice(1)}export{chargeFailureReason,parseAmount,amountMatchesPrice,formatAmountArg,formatTerm,canPromptForCharge,chargeFlagWithValue,printChargeRecovery,writeChargeAction,reportUsageError,reportChargeFailure,orderStatusStep,reportUnknownOutcome,parseOrderWait,reportOrderPending,refuseUnnamedTeam,reportPriceChanged,requireApproval,effectsDigest,buildApprovalCommand,isTeamExplicit,canPromptForApproval};
|
|
@@ -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{ensureLink}from"./chunk-
|
|
7
|
+
import{ensureLink}from"./chunk-DTCQWGHE.js";import{getTeams}from"./chunk-BIABM3FB.js";import{scopeFlagPassed}from"./chunk-4SWS7RKX.js";import{getLinkedProject,getUser,resolveProjectCwd}from"./chunk-ZHGKJCQ2.js";import{getProjectByNameOrId}from"./chunk-3AFEVHHY.js";import{parseArguments}from"./chunk-INIZJZ3O.js";import{argvHasNonInteractive}from"./chunk-3ARTWVQV.js";import{LinkRequiredError,ProjectNotFound}from"./chunk-QFE3RPMA.js";import{output_manager_default}from"./chunk-RYSO5U3E.js";import{require_build_utils}from"./chunk-5MDNVAE6.js";import{__toESM}from"./chunk-BZENIQ7N.js";async function getProjectByCwdOrLink({autoConfirm,nonInteractive,client,commandName,cwd,projectNameOrId,forReadOnlyCommand,skipOwnerLookup}){if(projectNameOrId){let project=await getProjectByNameOrId(client,projectNameOrId);if(project instanceof ProjectNotFound)throw project;return project}let effectiveNonInteractive=nonInteractive??client.nonInteractive??argvHasNonInteractive(client.argv);if(forReadOnlyCommand&&effectiveNonInteractive){let resolvedCwd=await resolveProjectCwd(cwd??client.cwd),link=await getLinkedProject(client,{cwd:resolvedCwd,skipOwnerLookup});if(link.status==="linked"&&link.project)return link.project;if(link.status==="error"){let err=new Error("Link project error");throw err.code="ERR_LINK_PROJECT",err}throw new LinkRequiredError}let linkedProject=await ensureLink(commandName,client,cwd??client.cwd,{autoConfirm,nonInteractive,skipOwnerLookup});if(typeof linkedProject=="number"){let err=new Error("Link project error");throw err.code="ERR_LINK_PROJECT",err}return linkedProject.project}var import_build_utils=__toESM(require_build_utils(),1);async function isTeamExplicit(client){if(scopeFlagPassed(client.argv)){let{flags}=parseArguments(client.argv.slice(2),{},{permissive:!0});if(flags["--scope"]||flags["--team"])return!0}let team=await client.resolveCurrentTeam({ask:!1});if(!team&&client.isTeamUnchosen())return!1;let orgId=(0,import_build_utils.getPlatformEnv)("ORG_ID");try{if(!team)return orgId?orgId===(await getUser(client)).id:(await getTeams(client)).length===0;if(orgId)return orgId===team;let teams=await getTeams(client);return teams.length===1&&teams[0].id===team}catch(err){return output_manager_default.debug(`Couldn't check the scope: ${err}`),!1}}export{getProjectByCwdOrLink,isTeamExplicit};
|
|
@@ -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{formatErrorJson,handleApiError}from"./chunk-
|
|
7
|
+
import{formatErrorJson,handleApiError}from"./chunk-OZKP3WKT.js";import{isAPIError}from"./chunk-QFE3RPMA.js";import{output_manager_default}from"./chunk-RYSO5U3E.js";var OBSERVABILITY_METRICS_PATH="/metrics/v1",METRIC_CATALOG_PAGE_SIZE=250;async function fetchMetricCatalog(client,accountId,kind,search,activeSince){let metrics=[],cursor=null;do{let searchParams=new URLSearchParams({limit:String(METRIC_CATALOG_PAGE_SIZE),kind});search&&searchParams.set("search",search),activeSince&&searchParams.set("activeSince",activeSince),cursor&&searchParams.set("cursor",cursor);let response=await client.fetch(`${OBSERVABILITY_METRICS_PATH}?${searchParams}`,{accountId,bailOn429:!0});metrics.push(...response.metrics.map(metric=>({id:metric.id,description:metric.description,dimensions:metric.dimensions,unit:metric.unit,aggregations:metric.aggregations}))),cursor=response.pagination.hasMore?response.pagination.nextCursor:null}while(cursor);return metrics.filter(metric=>(kind==="all"||(kind==="system"?metric.id.startsWith("vercel."):!metric.id.startsWith("vercel.")))&&(!search||metric.id.startsWith(search))).sort((left,right)=>left.id.localeCompare(right.id))}async function fetchCatalogMetricDetail(client,accountId,metricId,kind,activeSince){let metrics=await fetchMetricCatalog(client,accountId,kind,metricId,activeSince),exactMetric=metrics.find(metric=>metric.id===metricId);return exactMetric?[exactMetric]:metrics}async function fetchSchemaOrExit(client,jsonOutput,operation,accountId){try{return await operation()}catch(err){if(isAPIError(err))return handleApiError(err,jsonOutput,client,{401:{code:"SCHEMA_UNAUTHORIZED",message:"The metrics schema API request was not authorized. Run `vercel login` to authenticate and `vercel switch` to select a team, then try again."},403:{code:"SCHEMA_UNAUTHORIZED",message:"The metrics schema API request was not authorized. Run `vercel login` to authenticate and `vercel switch` to select a team, then try again."}},accountId?.startsWith("team_")?{scope:accountId}:{});let message=err instanceof Error?`Failed to fetch metrics schema: ${err.message}`:`Failed to fetch metrics schema: ${String(err)}`;return jsonOutput?client.stdout.write(formatErrorJson("SCHEMA_FETCH_FAILED",message)):output_manager_default.error(message),1}}function fetchCatalogMetricDetailOrExit(client,accountId,jsonOutput,metricId,kind,activeSince){return fetchSchemaOrExit(client,jsonOutput,()=>fetchCatalogMetricDetail(client,accountId,metricId,kind,activeSince),accountId)}function fetchMetricCatalogListOrExit(client,accountId,jsonOutput){return fetchSchemaOrExit(client,jsonOutput,()=>fetchMetricCatalog(client,accountId,"all").then(metrics=>metrics.map(({id,description})=>({id,description}))),accountId)}export{OBSERVABILITY_METRICS_PATH,fetchCatalogMetricDetailOrExit,fetchMetricCatalogListOrExit};
|