vercel 64.1.0 → 64.3.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/chunks/{add-JH6ALI3H.js → add-5RV75RPG.js} +1 -1
- package/dist/chunks/{add-XZJ4G2MM.js → add-RFCYPSPS.js} +1 -1
- package/dist/chunks/{add-GEAC4RAQ.js → add-UXOTAL3N.js} +1 -1
- package/dist/chunks/{build-3T6EUCCK.js → build-SE3QLNVF.js} +1 -1
- package/dist/chunks/{chunk-SD757OFS.js → chunk-26Z4U6G4.js} +2 -2
- package/dist/chunks/{chunk-XEQT373M.js → chunk-2B3A3MOX.js} +1 -1
- package/dist/chunks/{chunk-RZGWCQP7.js → chunk-2FHICLHJ.js} +1 -1
- package/dist/chunks/{chunk-AG5QQNJ3.js → chunk-2UMWTCY7.js} +1 -1
- package/dist/chunks/{chunk-Z6UFAIEX.js → chunk-444RE4Z5.js} +1 -1
- package/dist/chunks/{chunk-5VWJIYJE.js → chunk-6GIP2YPX.js} +1 -1
- package/dist/chunks/{chunk-PJMVU4JC.js → chunk-6HOVHRWJ.js} +3 -3
- package/dist/chunks/chunk-6ZRULOO3.js +7 -0
- package/dist/chunks/{chunk-JGPRCZC2.js → chunk-7GFRZWLE.js} +1 -1
- package/dist/chunks/{chunk-BAJDLMZS.js → chunk-A63VVXW2.js} +1 -1
- package/dist/chunks/{chunk-RFEREQPS.js → chunk-AA434KXY.js} +1 -1
- package/dist/chunks/{chunk-YNIW7DTL.js → chunk-AALI66ML.js} +1 -1
- package/dist/chunks/{chunk-DW3TSGVC.js → chunk-AQUDXMFH.js} +1 -1
- package/dist/chunks/chunk-BAT6SDBJ.js +10 -0
- package/dist/chunks/chunk-BTCKMXWW.js +7 -0
- package/dist/chunks/{chunk-VM6TZGLE.js → chunk-CMKLX4DC.js} +1 -1
- package/dist/chunks/{chunk-MYCQIZU6.js → chunk-CN3IVZJO.js} +1 -1
- package/dist/chunks/{chunk-JSBEAHKA.js → chunk-CYV3X62I.js} +1 -1
- package/dist/chunks/{chunk-EO7GUARB.js → chunk-DNDBPLLI.js} +1 -1
- package/dist/chunks/{chunk-WQIGKVBV.js → chunk-DNTQK2SW.js} +1 -1
- package/dist/chunks/{chunk-37QGCN6P.js → chunk-E6R2QOOR.js} +1 -1
- package/dist/chunks/{chunk-Z4OH72VZ.js → chunk-ELDHGU6N.js} +1 -1
- package/dist/chunks/{chunk-DYQXJCHO.js → chunk-EVQJ7SCV.js} +1 -1
- package/dist/chunks/{chunk-JAQM6UXY.js → chunk-EXPLBM7J.js} +1 -1
- package/dist/chunks/{chunk-VRWPRZJY.js → chunk-FLBI6DY2.js} +1 -1
- package/dist/chunks/{chunk-ASU72O2R.js → chunk-G2IJOQR3.js} +1 -1
- package/dist/chunks/{chunk-UBKETNGO.js → chunk-GCSAJUL6.js} +1 -1
- package/dist/chunks/{chunk-XXDVZWWM.js → chunk-GF7EG5IA.js} +1 -1
- package/dist/chunks/{chunk-ELI3L2UX.js → chunk-GJP22N6R.js} +1 -1
- package/dist/chunks/{chunk-JNPG7MVL.js → chunk-GLJH35MJ.js} +1 -1
- package/dist/chunks/{chunk-TBLIJ2PS.js → chunk-GNV6PG6W.js} +1 -1
- package/dist/chunks/{chunk-M7GT3ZPT.js → chunk-GVVIFYQE.js} +1 -1
- package/dist/chunks/{chunk-JESE5FPO.js → chunk-GWZ4VPU3.js} +2 -2
- package/dist/chunks/{chunk-NJINP2WU.js → chunk-H3KYG32S.js} +2 -2
- package/dist/chunks/chunk-H7CRPXOA.js +14 -0
- package/dist/chunks/{chunk-JEPRHNQU.js → chunk-HJRAWEA2.js} +1 -1
- package/dist/chunks/{chunk-NFJPCOTV.js → chunk-HTLGLTKD.js} +2 -2
- package/dist/chunks/{chunk-E6UKNYFF.js → chunk-HVUJNVPS.js} +1 -1
- package/dist/chunks/{chunk-J53D7SLS.js → chunk-IIC2A4YN.js} +1 -1
- package/dist/chunks/{chunk-N7Q2IESO.js → chunk-IJCCFLCQ.js} +1 -1
- package/dist/chunks/{chunk-QYDG63GL.js → chunk-IL7X6EKK.js} +1 -1
- package/dist/chunks/{chunk-XD2LZRBS.js → chunk-IQ7FPAI4.js} +1 -1
- package/dist/chunks/{chunk-QJKJBD2M.js → chunk-ITKS32PG.js} +1 -1
- package/dist/chunks/{chunk-J2LAZELI.js → chunk-IVIZLWZQ.js} +1 -1
- package/dist/chunks/{chunk-YCXZZSW6.js → chunk-IYCHAIFZ.js} +1 -1
- package/dist/chunks/{chunk-UFXKCETS.js → chunk-J6O6JW2K.js} +1 -1
- package/dist/chunks/{chunk-G6B6TVAE.js → chunk-JCTXRR4A.js} +1 -1
- package/dist/chunks/{chunk-IDGWQE4B.js → chunk-JV6IPUGX.js} +1 -1
- package/dist/chunks/{chunk-JJSDRKX4.js → chunk-KGXW36FQ.js} +2 -2
- package/dist/chunks/{chunk-GSOPJJO5.js → chunk-KKCBFBJK.js} +1 -1
- package/dist/chunks/{chunk-FWFTX2WE.js → chunk-KKQL4AKH.js} +1 -1
- package/dist/chunks/{chunk-JNJOUMGF.js → chunk-KUGXOLL7.js} +1 -1
- package/dist/chunks/{chunk-JLXG2XWW.js → chunk-LD5U73LA.js} +1 -1
- package/dist/chunks/{chunk-75IAMKGV.js → chunk-M774HRX5.js} +2 -2
- package/dist/chunks/{chunk-5IPBCD7K.js → chunk-MI7W4QMV.js} +1 -1
- package/dist/chunks/{chunk-THSHYFA6.js → chunk-MMPQC2N6.js} +1 -1
- package/dist/chunks/{chunk-FIIHB66A.js → chunk-MV4WHUIC.js} +1 -1
- package/dist/chunks/{chunk-SYEKOJHT.js → chunk-MZ3QGJH3.js} +1 -1
- package/dist/chunks/{chunk-ZKDWPKO2.js → chunk-MZLQY2EQ.js} +1 -1
- package/dist/chunks/{chunk-OGCVOINQ.js → chunk-OCOVCC5Q.js} +1 -1
- package/dist/chunks/{chunk-ZUCSA4IW.js → chunk-OJKZ7EV3.js} +1 -1
- package/dist/chunks/{chunk-67NNB6S6.js → chunk-OUTCLR64.js} +1 -1
- package/dist/chunks/chunk-Q5ZGA2RO.js +7 -0
- package/dist/chunks/{chunk-OZ47SVXA.js → chunk-QAETJRKX.js} +1 -1
- package/dist/chunks/{chunk-7YRPMVZK.js → chunk-QC3HEGFD.js} +1 -1
- package/dist/chunks/{chunk-YBOS65VB.js → chunk-QC5AMRWR.js} +1 -1
- package/dist/chunks/{chunk-MJD6WHG4.js → chunk-QCWV7FML.js} +1 -1
- package/dist/chunks/{chunk-FBJWLH2A.js → chunk-TCYAAWLB.js} +1 -1
- package/dist/chunks/{chunk-MFIVZXHH.js → chunk-TDDZGUU6.js} +1 -1
- package/dist/chunks/{chunk-S7XZC23O.js → chunk-TPVAPVQC.js} +1 -1
- package/dist/chunks/{chunk-KELSPU2J.js → chunk-U3NQZJQ4.js} +8 -8
- package/dist/chunks/{chunk-GRTIWUV2.js → chunk-UCAE5Z5L.js} +1 -1
- package/dist/chunks/{chunk-L5FUUGYX.js → chunk-UGMTKOTN.js} +1 -1
- package/dist/chunks/{chunk-OJZEOWK2.js → chunk-VRWLNWNE.js} +1 -1
- package/dist/chunks/{chunk-R5K37TXM.js → chunk-VVAZC5IO.js} +1 -1
- package/dist/chunks/chunk-W3TGCMRW.js +9 -0
- package/dist/chunks/{chunk-UDQYOGSQ.js → chunk-WGOQGKS5.js} +1 -1
- package/dist/chunks/{chunk-3EYOQC4R.js → chunk-WYI4VNXT.js} +1 -1
- package/dist/chunks/{chunk-YI5G2A3V.js → chunk-XJXX4QXA.js} +1 -1
- package/dist/chunks/{chunk-YIIPBH2D.js → chunk-XSDAUM4F.js} +1 -1
- package/dist/chunks/{chunk-ZMBDYOVN.js → chunk-XW4ZWX3I.js} +1 -1
- package/dist/chunks/{chunk-2JBVMF2Y.js → chunk-Y24OSBXP.js} +1 -1
- package/dist/chunks/{chunk-A5R2HHNK.js → chunk-YROIQRYI.js} +1 -1
- package/dist/chunks/{chunk-4ZICRXI5.js → chunk-YS542RHZ.js} +1 -1
- package/dist/chunks/{chunk-KAJM2NEI.js → chunk-YUYCSDCO.js} +1 -1
- package/dist/chunks/{chunk-3AVG55SO.js → chunk-ZBDLYNUF.js} +1 -1
- package/dist/chunks/{chunk-HAVEFTOO.js → chunk-ZE53XHAY.js} +1 -1
- package/dist/chunks/{chunk-WLK5BBNP.js → chunk-ZLWTPS5T.js} +1 -1
- package/dist/chunks/{chunk-5UEBA6N6.js → chunk-ZQKDO5PL.js} +1 -1
- package/dist/chunks/{chunk-WPQN5UKR.js → chunk-ZQME5XUJ.js} +1 -1
- package/dist/chunks/{chunk-WHVT7UXE.js → chunk-ZVLDGT4O.js} +1 -1
- package/dist/chunks/{chunk-N7L3XLWC.js → chunk-ZZ3LJ22B.js} +1 -1
- package/dist/chunks/{clear-XCZCETRU.js → clear-2VHJFFMM.js} +1 -1
- package/dist/chunks/{compile-vercel-config-NQKOGOPH.js → compile-vercel-config-ADKZDUAU.js} +1 -1
- package/dist/chunks/{config-CIM647OM.js → config-6YWGF4CO.js} +1 -1
- package/dist/chunks/{config-P42IQJDF.js → config-VAOXMKVX.js} +1 -1
- package/dist/chunks/{connect-git-provider-VJYXBRYG.js → connect-git-provider-2JIBL3ST.js} +1 -1
- package/dist/chunks/{delete-MVJ3NENU.js → delete-FEUSV3JO.js} +1 -1
- package/dist/chunks/{delete-KJMVCQ7C.js → delete-YW2NH7VG.js} +1 -1
- package/dist/chunks/{detect-services-UYQZT6MU.js → detect-services-A2B6KJO5.js} +1 -1
- package/dist/chunks/{disable-666GPFHE.js → disable-KA6PS2CZ.js} +1 -1
- package/dist/chunks/{discard-RUQPJMOG.js → discard-ZNUPAJTQ.js} +1 -1
- package/dist/chunks/{edit-IIM7GKC2.js → edit-D7VE55ZF.js} +1 -1
- package/dist/chunks/{edit-NRJCMP4B.js → edit-YTYYBVZN.js} +1 -1
- package/dist/chunks/{enable-FVXIP7NX.js → enable-Q4OCTJIJ.js} +1 -1
- package/dist/chunks/{exec-QZXH5RXR.js → exec-NMRO6DIZ.js} +2 -2
- package/dist/chunks/{export-VPGLK5KL.js → export-UX6JVWOD.js} +1 -1
- package/dist/chunks/{future-MDYFVS3M.js → future-6UTK4EFE.js} +1 -1
- package/dist/chunks/{generate-cert-for-deploy-MWXVKKFQ.js → generate-cert-for-deploy-WDKFR34X.js} +1 -1
- package/dist/chunks/{image-URNV2ABR.js → image-IL7IN7MD.js} +1 -1
- package/dist/chunks/{import-builders-FC5ESQ34.js → import-builders-FX2XXVRT.js} +1 -1
- package/dist/chunks/{inspect-LYGYBYV3.js → inspect-E2HPGMNI.js} +1 -1
- package/dist/chunks/{inspect-P4XEVJW5.js → inspect-F6NLCWHN.js} +1 -1
- package/dist/chunks/{inspect-6KZERH2F.js → inspect-UNZR445S.js} +1 -1
- package/dist/chunks/{inspect-OBNVJRYC.js → inspect-UPXTGUJQ.js} +1 -1
- package/dist/chunks/{inspect-G5NDWTDB.js → inspect-YAMAGNIW.js} +1 -1
- package/dist/chunks/{list-5YBZG374.js → list-FDYB6GHF.js} +1 -1
- package/dist/chunks/{list-ICJMKLOR.js → list-G4E6RG3V.js} +1 -1
- package/dist/chunks/{list-AV5CMKBK.js → list-GDI5O246.js} +1 -1
- package/dist/chunks/{login-SUBW6IFU.js → login-HU5OFS7T.js} +1 -1
- package/dist/chunks/{login-5VKAY2R5.js → login-XYYNIAMM.js} +1 -1
- package/dist/chunks/{logs-BJL37R5U.js → logs-EWXTZN4W.js} +1 -1
- package/dist/chunks/{ls-QGJPVPLK.js → ls-3GNX6IPE.js} +1 -1
- package/dist/chunks/{ls-TXKT6RCY.js → ls-A3HIPTF5.js} +1 -1
- package/dist/chunks/{ls-3Y2X26EY.js → ls-A4NEYMKP.js} +1 -1
- package/dist/chunks/{ls-SOTQGCPD.js → ls-CGZ3NL5R.js} +1 -1
- package/dist/chunks/{ls-AKUJ4VUV.js → ls-MO3R46TQ.js} +1 -1
- package/dist/chunks/{ls-EJ4THXVR.js → ls-SZKDUJHV.js} +1 -1
- package/dist/chunks/{ls-VEWJPLJC.js → ls-TCB7UUPP.js} +1 -1
- package/dist/chunks/{mutate-Y4KO4NAJ.js → mutate-BQAP2S7A.js} +1 -1
- package/dist/chunks/{notifications-J3SMCQX5.js → notifications-TDSFYYNB.js} +1 -1
- package/dist/chunks/{open-COGMMSHS.js → open-YPOEUM3S.js} +1 -1
- package/dist/chunks/{openapi-TP6GEZGZ.js → openapi-BQSQNXQE.js} +1 -1
- package/dist/chunks/{permissions-43WFISAY.js → permissions-6LOJKL5W.js} +1 -1
- package/dist/chunks/{prompt-missing-credentials-5AQVXSFB.js → prompt-missing-credentials-IGTCFUA6.js} +1 -1
- package/dist/chunks/{publish-4NSLHSHF.js → publish-CATCXJZG.js} +1 -1
- package/dist/chunks/pull-CXUNHWAO.js +7 -0
- package/dist/chunks/{purchase-domain-if-available-S43PVX5Y.js → purchase-domain-if-available-4YKWAHH5.js} +1 -1
- package/dist/chunks/{push-2NBXVOX2.js → push-KZZE3AQ3.js} +1 -1
- package/dist/chunks/{query-DI4FF2ZM.js → query-GHFOZV7K.js} +1 -1
- package/dist/chunks/{reauthenticate-Z62FFYZH.js → reauthenticate-W7QIXLZ3.js} +1 -1
- package/dist/chunks/{reorder-P4AXRPMF.js → reorder-XU55LOZ5.js} +1 -1
- package/dist/chunks/{reply-ULZRH7KA.js → reply-B2XOCSZD.js} +1 -1
- package/dist/chunks/{resolve-3IS44LUW.js → resolve-H4BZ2QI3.js} +1 -1
- package/dist/chunks/{resolve-agent-team-DDBPICVE.js → resolve-agent-team-43HZCPF3.js} +1 -1
- package/dist/chunks/{restore-WM4EZHD4.js → restore-AJLS2N6C.js} +1 -1
- package/dist/chunks/{rm-4XX3UUUF.js → rm-2TR2KBDP.js} +1 -1
- package/dist/chunks/{rm-7Z6GJ4O2.js → rm-IGY6LD6H.js} +1 -1
- package/dist/chunks/{rm-TRMBM6DD.js → rm-N6ZUA66Z.js} +1 -1
- package/dist/chunks/{rm-C455A2EH.js → rm-OI5VS7GG.js} +1 -1
- package/dist/chunks/{rm-53YK7N2N.js → rm-ZQUVOC3V.js} +1 -1
- package/dist/chunks/{routes-3RJGIZYJ.js → routes-TCMUHSJF.js} +1 -1
- package/dist/chunks/{rule-inspect-FMZTPH3S.js → rule-inspect-NLEABBTP.js} +1 -1
- package/dist/chunks/{rules-K7XMFMXG.js → rules-SVLVB6YB.js} +1 -1
- package/dist/chunks/{schema-5R44NJNE.js → schema-HWS2SOZS.js} +1 -1
- package/dist/chunks/{schema-PQZAACV2.js → schema-KG4RWQBC.js} +1 -1
- package/dist/chunks/{select-org-GGUGYGDL.js → select-org-AAB5RBSB.js} +1 -1
- package/dist/chunks/{set-SZPCOILW.js → set-AJEMEBZU.js} +1 -1
- package/dist/chunks/setup-and-link-6AIRWXXX.js +7 -0
- package/dist/chunks/{tags-YS7EQDJY.js → tags-O6R6VWPP.js} +1 -1
- package/dist/chunks/{types-FK3W7A2Y.js → types-Y3NJROKH.js} +1 -1
- package/dist/chunks/{update-QVYTOT35.js → update-C7XR7CHI.js} +1 -1
- package/dist/commands/build/index.js +1 -1
- package/dist/commands/deploy/index.js +4 -4
- package/dist/commands/dev/index.js +2 -2
- 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-bulk.js +776 -715
- package/dist/index.js +2 -2
- package/dist/internal-build.js +1 -1
- package/dist/root-help-commands.mjs +1 -1
- package/dist/version.mjs +1 -1
- package/package.json +58 -57
- package/dist/chunks/chunk-AR5T62PK.js +0 -7
- package/dist/chunks/chunk-AU42HSQ3.js +0 -7
- package/dist/chunks/chunk-CSIUJLB7.js +0 -9
- package/dist/chunks/chunk-FLQJAP2A.js +0 -14
- package/dist/chunks/chunk-FZIRYAXC.js +0 -10
- package/dist/chunks/chunk-QC47UKDR.js +0 -7
- package/dist/chunks/pull-MS2PVQUV.js +0 -7
- package/dist/chunks/setup-and-link-OAS7PYL6.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{getGlobalPathConfig}from"./chunk-
|
|
7
|
+
import{getGlobalPathConfig}from"./chunk-MV4WHUIC.js";import{output_manager_default}from"./chunk-M774HRX5.js";var OPENAPI_URL="https://openapi.vercel.sh/",SSO_API_URL="https://vercel.com/sso-api",CACHE_FILE="openapi-spec.json",CACHE_TTL_MS=864e5,FETCH_TIMEOUT_MS=1e4,MAX_OPENAPI_SPEC_BYTES=52428800,VERCEL_CLI_ROOT_DISPLAY_KEY="__root__";async function readSpecResponse(response,url,maxBytes=52428800){let contentLength=response.headers.get("content-length");if(contentLength){let bytes=Number(contentLength);if(Number.isFinite(bytes)&&bytes>maxBytes)throw new Error(`OpenAPI spec from ${url} exceeds the ${maxBytes} byte limit.`)}if(!response.body)throw new Error(`OpenAPI spec from ${url} returned an empty response.`);let reader=response.body.getReader(),chunks=[],totalBytes=0;for(;;){let{done,value}=await reader.read();if(done)break;if(value){if(totalBytes+=value.byteLength,totalBytes>maxBytes)throw await reader.cancel(),new Error(`OpenAPI spec from ${url} exceeds the ${maxBytes} byte limit.`);chunks.push(value)}}let buffer=new Uint8Array(totalBytes),offset=0;for(let chunk of chunks)buffer.set(chunk,offset),offset+=chunk.byteLength;return JSON.parse(new TextDecoder().decode(buffer))}var ALLOWED_SPEC_HOSTS=["vercel.sh","vercel.tools"];function assertAllowedSpecUrl(specUrl){let parsedUrl=new URL(specUrl);if(parsedUrl.protocol!=="https:")throw new Error("OpenAPI spec URL must use https");if(!ALLOWED_SPEC_HOSTS.some(host=>isHostOrSubdomain(parsedUrl,host)))throw new Error("OpenAPI spec URL must be on an allowed origin.");return parsedUrl}function isHostOrSubdomain(url,host){return url.hostname===host||url.hostname.endsWith(`.${host}`)}import{join}from"path";import{readFile,writeFile,mkdir}from"fs/promises";var OpenApiCache=class{constructor(options){this.spec=null;this.error=null;this.cachePath=join(getGlobalPathConfig(),CACHE_FILE),this.specUrl=options?.specUrl,this.fetchSpecUrl=options?.fetchSpecUrl}get isLoaded(){return this.spec!==null}get loadError(){return this.error}async load(forceRefresh=!1){return this.loadSpec(forceRefresh)}async loadSpec(forceRefresh=!1){if(this.error=null,this.specUrl)return this.loadCustomSpec(this.specUrl);if(!forceRefresh){let cached=await this.readCache(this.cachePath);if(cached&&!this.isExpired(cached.fetchedAt))return output_manager_default.debug("Using cached OpenAPI spec"),this.spec=cached.spec,!0}try{return output_manager_default.debug("Fetching OpenAPI spec from "+OPENAPI_URL),this.spec=await this.fetchSpec(OPENAPI_URL),await this.saveCache(this.cachePath,this.spec),!0}catch(err){output_manager_default.debug(`Failed to fetch OpenAPI spec: ${err}`);let stale=await this.readCache(this.cachePath);return stale?(output_manager_default.debug("Using stale cached OpenAPI spec"),this.spec=stale.spec,!0):!1}}async loadCustomSpec(specUrl){try{assertAllowedSpecUrl(specUrl),output_manager_default.debug("Fetching OpenAPI spec from "+specUrl);let spec=this.fetchSpecUrl?await this.fetchSpecUrl(specUrl):await this.fetchSpec(specUrl);return spec?(this.validateSpec(spec,specUrl),this.spec=spec,!!this.spec):(this.error=`Could not load OpenAPI spec from ${specUrl}.`,!1)}catch(err){let message=err instanceof Error?err.message:String(err);return this.error=message,output_manager_default.debug(`Failed to fetch OpenAPI spec from ${specUrl}: ${message}`),!1}}async loadWithSpinner(forceRefresh=!1){output_manager_default.spinner(forceRefresh?"Refreshing API endpoints...":"Loading API endpoints...");let success=await this.load(forceRefresh);return output_manager_default.stopSpinner(),success}getEndpoints(){this.ensureLoaded();let endpoints=this.extractEndpoints();return this.sortEndpoints(endpoints)}getBodyFields(endpoint){if(this.ensureLoaded(),!endpoint.requestBody?.content)return[];let jsonContent=endpoint.requestBody.content["application/json"];if(!jsonContent?.schema)return[];let schema=this.resolveSchemaRef(jsonContent.schema);if(!schema?.properties)return[];let requiredFields=new Set(schema.required||[]),fields=[];for(let[name,propSchema]of Object.entries(schema.properties)){let resolvedProp=this.resolveSchemaRef(propSchema),enumValues=resolvedProp?.enum||propSchema.enum;if(!enumValues&&(resolvedProp?.type==="array"||propSchema.type==="array")){let items=resolvedProp?.items||propSchema.items;items&&(enumValues=this.resolveSchemaRef(items)?.enum||items.enum)}fields.push({name,required:requiredFields.has(name),description:resolvedProp?.description||propSchema.description,type:resolvedProp?.type||propSchema.type,enumValues})}return fields.sort((a,b)=>a.required!==b.required?a.required?-1:1:a.name.localeCompare(b.name)),fields}getDisplayColumns(endpoint){this.ensureLoaded();let pathItem=this.spec.paths[endpoint.path];if(!pathItem)return null;let operation=pathItem[endpoint.method.toLowerCase()];if(!operation?.responses)return null;let ok=operation.responses[200]||operation.responses[201];if(!ok)return null;let jsonContent=ok.content?.["application/json"];return jsonContent?.schema?this.findDisplayColumns(jsonContent.schema):null}findDisplayColumns(schema){let xCli=schema["x-vercel-cli"];if(xCli?.displayColumns)return xCli.displayColumns;for(let key of["oneOf","allOf","anyOf"]){let variants=schema[key];if(variants)for(let sub of variants){let found=this.findDisplayColumns(sub);if(found)return found}}return null}ensureLoaded(){if(!this.spec)throw new Error("OpenAPI spec not loaded. Call load() or loadWithSpinner() first.")}async readCache(cachePath){try{let content=await readFile(cachePath,"utf-8");return JSON.parse(content)}catch{return null}}async saveCache(cachePath,spec){let cached={fetchedAt:Date.now(),spec},dir=join(cachePath,"..");await mkdir(dir,{recursive:!0}),await writeFile(cachePath,JSON.stringify(cached)),output_manager_default.debug("Saved OpenAPI spec to cache")}async fetchSpec(url){let controller=new AbortController,timeoutId=setTimeout(()=>controller.abort(),1e4);try{let response=await fetch(url,{signal:controller.signal});if(!response.ok)throw new Error(`Failed to fetch OpenAPI spec: ${response.status}`);let spec=await readSpecResponse(response,url);return this.validateSpec(spec,url),spec}finally{clearTimeout(timeoutId)}}validateSpec(spec,url){if(!spec||typeof spec!="object")throw new Error(`Invalid OpenAPI spec from ${url}: expected a JSON object.`);if(typeof spec.openapi!="string"||!spec.openapi.startsWith("3."))throw new Error(`Invalid OpenAPI spec from ${url}: expected an OpenAPI 3.x document with an "openapi" field.`);if(!spec.paths||typeof spec.paths!="object")throw new Error(`Invalid OpenAPI spec from ${url}: expected a "paths" object.`);for(let path of Object.keys(spec.paths))if(!path.startsWith("/")||path.startsWith("//"))throw new Error(`Invalid OpenAPI spec from ${url}: path "${path}" must be a relative API path.`)}isExpired(fetchedAt){return Date.now()-fetchedAt>864e5}sortEndpoints(endpoints){return endpoints.sort((a,b)=>{let pathCompare=a.path.localeCompare(b.path);return pathCompare!==0?pathCompare:a.method.localeCompare(b.method)})}extractEndpoints(){let endpoints=[];for(let[path,pathItem]of Object.entries(this.spec.paths)){let methods=["get","post","put","patch","delete"];for(let method of methods){let operation=pathItem[method];if(operation){let pathParams=pathItem.parameters||[],opParams=operation.parameters||[],allParams=[...pathParams,...opParams];endpoints.push({path,method:method.toUpperCase(),summary:operation.summary||pathItem.summary||"",description:operation.description||pathItem.description||"",operationId:operation.operationId||"",tags:operation.tags||[],parameters:allParams,requestBody:operation.requestBody})}}}return endpoints}resolveSchemaRef(schema,spec=this.spec){if(schema){if(schema.$ref){let match=schema.$ref.match(/^#\/components\/schemas\/(.+)$/);if(match&&spec.components?.schemas){let resolved=spec.components.schemas[match[1]];return this.resolveSchemaRef(resolved,spec)}return}if(schema.allOf&&schema.allOf.length>0){let merged={type:"object",properties:{},required:[]};for(let subSchema of schema.allOf){let resolved=this.resolveSchemaRef(subSchema,spec);resolved&&(resolved.properties&&(merged.properties={...merged.properties,...resolved.properties}),resolved.required&&(merged.required=[...merged.required||[],...resolved.required]))}return merged}return schema}}};async function matchesCliApiTag(tagHint){if(!tagHint||tagHint.startsWith("-")||tagHint.includes("/"))return!1;let cache=new OpenApiCache;if(!await cache.load())return!1;let endpoints=cache.getEndpoints(),lower=tagHint.toLowerCase();return endpoints.some(ep=>ep.tags.some(t=>t.toLowerCase()===lower))}async function resolveOpenApiTagForProjectsCli(){return await matchesCliApiTag("projects")?"projects":await matchesCliApiTag("project")?"project":null}async function resolveOpenApiTagForTeamsCli(){return await matchesCliApiTag("teams")?"teams":await matchesCliApiTag("team")?"team":null}export{OPENAPI_URL,SSO_API_URL,CACHE_FILE,CACHE_TTL_MS,FETCH_TIMEOUT_MS,MAX_OPENAPI_SPEC_BYTES,VERCEL_CLI_ROOT_DISPLAY_KEY,readSpecResponse,assertAllowedSpecUrl,OpenApiCache,matchesCliApiTag,resolveOpenApiTagForProjectsCli,resolveOpenApiTagForTeamsCli};
|
|
@@ -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{ellipsis}from"./chunk-F4KY2TOK.js";import{require_ms}from"./chunk-MXTC4ZAQ.js";import{ALIGNED_LABEL_WIDTH}from"./chunk-
|
|
7
|
+
import{ellipsis}from"./chunk-F4KY2TOK.js";import{require_ms}from"./chunk-MXTC4ZAQ.js";import{ALIGNED_LABEL_WIDTH}from"./chunk-IJCCFLCQ.js";import{require_source}from"./chunk-NB2WLB3J.js";import{__toESM}from"./chunk-BZENIQ7N.js";var import_chalk=__toESM(require_source(),1),import_ms=__toESM(require_ms(),1);function alignedRow(label,value){return` ${import_chalk.default.bold(label.padEnd(ALIGNED_LABEL_WIDTH))}${value}`}function actorLabel(actor){if(!actor)return"-";let base=actor.name||actor.username||actor.id;return actor.type==="app"?`${base} (app)`:base}function relativeAge(timestamp){if(!timestamp||!Number.isFinite(timestamp))return"-";let delta=Date.now()-timestamp;return delta<1e3?"now":(0,import_ms.default)(delta)}function displayPath(thread){let href=thread.context?.href;if(href)try{return new URL(href).pathname}catch{}return thread.context?.path||"/"}function truncate(text,max){return ellipsis(text.replace(/\s+/g," ").trim(),max)}function firstMessageText(thread){return thread.messages[0]?.text??""}function threadAge(thread){return relativeAge(thread.messages[0]?.timestamp)}function renderThreadSummary(thread,complete){let replies=thread.messageCount-1,rootAuthorId=complete?thread.messages[0]?.author.id:void 0,names=[],seen=new Set;for(let message of thread.messages){let{author}=message;author.id===rootAuthorId||seen.has(author.id)||(seen.add(author.id),names.push(actorLabel(author)))}let shown=names.slice(0,3),overflow=names.length-shown.length,participants=shown.length>0?`${shown.join(", ")}${overflow>0?` +${overflow} more`:""}`:void 0,lastTimestamp=thread.messages[thread.messages.length-1]?.timestamp,parts=[`\u2192 ${replies} ${replies===1?"reply":"replies"}`];return participants&&parts.push(participants),parts.push(`last ${relativeAge(lastTimestamp)} ago`),parts.join(" \xB7 ")}function renderThreadRow(thread,opts){let complete=thread.messageCount<=thread.messages.length,dot=thread.resolved?import_chalk.default.dim("\u25CB"):"\u25CF",author=complete?actorLabel(thread.messages[0]?.author):"\u2026",columns=[dot,thread.id,import_chalk.default.dim(threadAge(thread)),author,displayPath(thread)];opts.showBranch&&thread.branch&&columns.push(import_chalk.default.dim(thread.branch)),thread.isLocalhost&&columns.push(import_chalk.default.dim("localhost"));let lines=[` ${columns.join(" ")}`];if(complete){let excerpt=truncate(firstMessageText(thread),80);excerpt&&lines.push(` \u201C${excerpt}\u201D`)}else lines.push(import_chalk.default.dim(" (long thread \u2014 inspect for the full conversation)"));let selection=thread.context?.selection;selection&&lines.push(import_chalk.default.dim(` \u2192 selected: \u201C${truncate(selection,60)}\u201D`)),thread.messageCount>1&&lines.push(import_chalk.default.dim(` ${renderThreadSummary(thread,complete)}`));let meta=[],reactionCount=thread.messages.reduce((acc,message)=>acc+(message.reactions?.length??0),0);reactionCount>0&&meta.push(`${reactionCount} ${reactionCount===1?"reaction":"reactions"}`);let attachmentCount=thread.messages.reduce((acc,message)=>acc+(message.attachments?.length??0),0);return attachmentCount>0&&meta.push(`${attachmentCount} ${attachmentCount===1?"attachment":"attachments"}`),thread.resolved&&meta.push(`resolved by ${actorLabel(thread.resolvedBy)}`),meta.length>0&&lines.push(import_chalk.default.dim(` ${meta.join(" \xB7 ")}`)),lines.join(`
|
|
8
8
|
`)}function renderReactions(message){if(!(!message.reactions||message.reactions.length===0))return message.reactions.map(r=>`${r.emoji} ${r.name} \xB7 ${r.users.length}`).join(" ")}function renderMessage(message){let lines=[`${import_chalk.default.bold(actorLabel(message.author))} \xB7 ${relativeAge(message.timestamp)} ago \xB7 ${import_chalk.default.dim(message.id)}`];for(let textLine of message.text.split(`
|
|
9
9
|
`))lines.push(` ${textLine}`);for(let attachment of message.attachments??[]){let dimensions=attachment.width&&attachment.height?` (${attachment.width}\xD7${attachment.height})`:"";lines.push(`${import_chalk.default.dim(` \u2192 attachment ${attachment.filename}${dimensions}`)} ${import_chalk.default.cyan(attachment.url)}`)}let reactions=renderReactions(message);return reactions&&lines.push(` ${reactions}`),lines.join(`
|
|
10
10
|
`)}function renderThreadDetail(thread,messages,opts){let sections=[],status=thread.resolved?import_chalk.default.dim(`resolved by ${actorLabel(thread.resolvedBy)}`):"unresolved",headline=[import_chalk.default.bold(thread.id),status];thread.branch&&headline.push(import_chalk.default.dim(thread.branch)),thread.isLocalhost&&headline.push(import_chalk.default.dim("localhost")),sections.push(headline.join(" \xB7 "));let headerLines=[],path=displayPath(thread),pageTitle=thread.context?.pageTitle;headerLines.push(pageTitle?`${path} \u2014 \u201C${pageTitle}\u201D`:path),thread.context?.href&&headerLines.push(import_chalk.default.cyan(thread.context.href)),sections.push(headerLines.join(`
|
|
@@ -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{rulesAggregateCommand}from"./chunk-
|
|
7
|
+
import{rulesAggregateCommand}from"./chunk-W3TGCMRW.js";import{formatOption,jsonOption,limitOption,projectOption,sinceOption,untilOption}from"./chunk-MI7W4QMV.js";import{packageName}from"./chunk-JESNVRVR.js";var listSubcommand={name:"ls",aliases:["list"],description:"",default:!0,hidden:!0,arguments:[],options:[],examples:[]},inspectSubcommand={name:"inspect",aliases:[],description:"Show details for a single alert group",arguments:[{name:"groupId",required:!0}],options:[formatOption,jsonOption,{...projectOption,shorthand:"p",description:"Filter by project (overrides auto-detected linked project)."},{name:"all",shorthand:"a",type:Boolean,deprecated:!1,description:"Use team-wide scope (ignore linked project auto-scoping)."}],examples:[{name:"Inspect a group in the linked project",value:`${packageName} alerts inspect grp_abc123`},{name:"Inspect as JSON",value:`${packageName} alerts inspect grp_abc123 --json`}]},alertsCommand={name:"alerts",aliases:[],description:"List alert groups, inspect a group, or manage alert rules (see `alerts rules`).",arguments:[],subcommands:[listSubcommand,inspectSubcommand,rulesAggregateCommand],options:[{name:"type",shorthand:null,type:[String],argument:"TYPE",deprecated:!1,description:"Filter by alert type. Repeatable and comma-separated (for example --type usage_anomaly,error_anomaly)."},{...projectOption,shorthand:"p",description:"Filter by project (overrides auto-detected linked project)."},{name:"all",shorthand:"a",type:Boolean,deprecated:!1,description:"Show team-wide alerts (ignore linked project auto-scoping)."},{name:"ai",shorthand:null,type:Boolean,deprecated:!1,description:"Print AI-focused sections (title, resolved time, summary, key findings) instead of table output."},{...sinceOption,description:`${sinceOption.description} (default: 24h ago)`},untilOption,limitOption,formatOption,jsonOption],examples:[{name:"List alerts for the linked project",value:`${packageName} alerts`},{name:"List team-wide alerts",value:`${packageName} alerts --all`},{name:"Filter by type",value:`${packageName} alerts --type usage_anomaly --type error_anomaly`},{name:"Output JSON",value:`${packageName} alerts --json`},{name:"Custom time range",value:`${packageName} alerts --since 2026-03-01T00:00:00.000Z --until 2026-03-02T00:00:00.000Z`}]};export{listSubcommand,inspectSubcommand,alertsCommand};
|