vercel 62.5.0 → 62.7.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/README.md +2 -0
- package/dist/chunks/{add-SUDX7R63.js → add-OXHI3PVM.js} +1 -1
- package/dist/chunks/{add-UNQJB3SM.js → add-P3FNSVMN.js} +1 -1
- package/dist/chunks/{add-HN4OXQLM.js → add-WUT6QU2J.js} +1 -1
- package/dist/chunks/{build-BRMOQZHW.js → build-J6VW3KHT.js} +1 -1
- package/dist/chunks/{chunk-B3MYIRFE.js → chunk-2KSNNB4B.js} +1 -1
- package/dist/chunks/{chunk-QMTPSHRV.js → chunk-3XLK5ZPD.js} +5 -5
- package/dist/chunks/{chunk-TEYG3UZQ.js → chunk-3ZMD36SU.js} +1 -1
- package/dist/chunks/{chunk-TG6SMD7D.js → chunk-46UCIIJN.js} +1 -1
- package/dist/chunks/{chunk-XMV7OSFJ.js → chunk-4H5LPD3T.js} +1 -1
- package/dist/chunks/{chunk-PQV3QNDG.js → chunk-4KQBTIMZ.js} +1 -1
- package/dist/chunks/{chunk-QCOPZAUC.js → chunk-4QSVBLAS.js} +1 -1
- package/dist/chunks/{chunk-WNG72BRT.js → chunk-5AXNGQJC.js} +1 -1
- package/dist/chunks/{chunk-DOWDSQPG.js → chunk-5JN3FWV2.js} +1 -1
- package/dist/chunks/{chunk-PY6YO4MR.js → chunk-5M45EBVX.js} +2 -2
- package/dist/chunks/{chunk-X7F3567X.js → chunk-5ZQF5WIO.js} +1 -1
- package/dist/chunks/{chunk-6LOW7CGD.js → chunk-6DJ6PMEK.js} +1 -1
- package/dist/chunks/{chunk-NDZOUAFO.js → chunk-6EW4BCMR.js} +1 -1
- package/dist/chunks/{chunk-RHUAFRZX.js → chunk-A73N3QKT.js} +1 -1
- package/dist/chunks/{chunk-CAAD55US.js → chunk-AEEEEOYS.js} +1 -1
- package/dist/chunks/chunk-APSIFBD4.js +7 -0
- package/dist/chunks/{chunk-MCOJUSDV.js → chunk-B2L2QTXT.js} +1 -1
- package/dist/chunks/{chunk-ZXDS7NJI.js → chunk-BHBNTQRT.js} +1 -1
- package/dist/chunks/{chunk-OYWYHFXV.js → chunk-CF2PIWRO.js} +1 -1
- package/dist/chunks/{chunk-733ZK37Y.js → chunk-CR2ZQBDU.js} +1 -1
- package/dist/chunks/{chunk-5CSWEE7J.js → chunk-CRITS7IX.js} +1 -1
- package/dist/chunks/{chunk-4BRFG5HP.js → chunk-DGH5CD6D.js} +1 -1
- package/dist/chunks/{chunk-PD3ZD52Q.js → chunk-ECMWDZTJ.js} +4 -4
- package/dist/chunks/{chunk-AMSFO2VK.js → chunk-EQ24OC5G.js} +1 -1
- package/dist/chunks/{chunk-D6JBONML.js → chunk-FAJB3JV5.js} +1 -1
- package/dist/chunks/chunk-FB3U3RAM.js +9 -0
- package/dist/chunks/{chunk-72YTT324.js → chunk-FEEG5UU2.js} +1 -1
- package/dist/chunks/{chunk-5NSYN7IO.js → chunk-FQJCWZ4C.js} +1 -1
- package/dist/chunks/{chunk-LGFCHU75.js → chunk-GMTLVRN7.js} +1 -1
- package/dist/chunks/{chunk-UXAYYF6I.js → chunk-GUTZ45DE.js} +1 -1
- package/dist/chunks/{chunk-5QVOIOPN.js → chunk-I5JR7PIO.js} +1 -1
- package/dist/chunks/{chunk-ST2X5QRA.js → chunk-IEKUTNKT.js} +1 -1
- package/dist/chunks/{chunk-L57FNGBV.js → chunk-K2RQEX7N.js} +1 -1
- package/dist/chunks/{chunk-O552UV4H.js → chunk-KXMVFT2K.js} +1 -1
- package/dist/chunks/{chunk-ZX2JOGOA.js → chunk-LCH3SUJ7.js} +1 -1
- package/dist/chunks/{chunk-HVJERSGE.js → chunk-LWQVT6YW.js} +1 -1
- package/dist/chunks/chunk-LXNMVWYO.js +9 -0
- package/dist/chunks/{chunk-MQW6DKD2.js → chunk-LYKPLTZ7.js} +1 -1
- package/dist/chunks/chunk-M3HO5CTQ.js +7 -0
- package/dist/chunks/{chunk-WJZV7BI4.js → chunk-M4IVLSNQ.js} +1 -1
- package/dist/chunks/{chunk-ILR6YA2A.js → chunk-M5NWE7EO.js} +1 -1
- package/dist/chunks/{chunk-3J2P52OU.js → chunk-MCBO6LL7.js} +2 -2
- package/dist/chunks/{chunk-2FQCZE6S.js → chunk-MIG67KZ2.js} +1 -1
- package/dist/chunks/{chunk-4WS3D23J.js → chunk-NM67DIPQ.js} +1 -1
- package/dist/chunks/{chunk-W6M24BQ4.js → chunk-NYFB3EYC.js} +1 -1
- package/dist/chunks/chunk-O3UY73UQ.js +7 -0
- package/dist/chunks/chunk-ONPJXQQ6.js +10 -0
- package/dist/chunks/chunk-ORJGSUQT.js +9 -0
- package/dist/chunks/{chunk-HRQQ2N5B.js → chunk-PE7QZUY7.js} +1 -1
- package/dist/chunks/{chunk-MR423MWE.js → chunk-Q2YQSMIB.js} +6 -6
- package/dist/chunks/{chunk-C7SLCL3Z.js → chunk-Q7AYTXUR.js} +1 -1
- package/dist/chunks/{chunk-EPBZNTIJ.js → chunk-QZ2G3AMY.js} +1 -1
- package/dist/chunks/{chunk-P3ZZVBZQ.js → chunk-RMZJP32R.js} +1 -1
- package/dist/chunks/{chunk-P3YADO62.js → chunk-RSLPLRVK.js} +1 -1
- package/dist/chunks/{chunk-AJT64XO2.js → chunk-RYMRVMGD.js} +2 -2
- package/dist/chunks/{chunk-MHKDLJEI.js → chunk-SMC4MGY5.js} +1 -1
- package/dist/chunks/{chunk-ZFYW4CEL.js → chunk-SR5XEF7L.js} +1 -1
- package/dist/chunks/{chunk-PTKSYVXM.js → chunk-TAT5WGDZ.js} +1 -1
- package/dist/chunks/{chunk-GXNSAACA.js → chunk-THB7KY2N.js} +1 -1
- package/dist/chunks/{chunk-TNGDWVMX.js → chunk-UKMRJIIZ.js} +1 -1
- package/dist/chunks/{chunk-MUJP4VPF.js → chunk-UKVEXM5O.js} +1 -1
- package/dist/chunks/{chunk-MJWC4W6J.js → chunk-ULHETT7U.js} +1 -1
- package/dist/chunks/{chunk-2E6XILZC.js → chunk-UOZHC2ZG.js} +1 -1
- package/dist/chunks/{chunk-RERUTI3O.js → chunk-V426AGVC.js} +2 -2
- package/dist/chunks/{chunk-6ALOD3OE.js → chunk-V6Y6UK6B.js} +2 -4
- package/dist/chunks/{chunk-DWPCZHDT.js → chunk-VWBJWUYQ.js} +1 -1
- package/dist/chunks/{chunk-TN4IR2LY.js → chunk-WNTA7DCC.js} +1 -1
- package/dist/chunks/{chunk-VMHUBZRU.js → chunk-XQQ7DTQG.js} +1 -1
- package/dist/chunks/{chunk-UKC3NSS6.js → chunk-YEWZFZ2O.js} +1 -1
- package/dist/chunks/{chunk-P4BGC5RL.js → chunk-YGMOJBSP.js} +2 -2
- package/dist/chunks/{chunk-65Z5UPUC.js → chunk-YKOIVWZI.js} +1 -1
- package/dist/chunks/{chunk-X7U35FBE.js → chunk-YTIANIL7.js} +1 -1
- package/dist/chunks/chunk-YUDKK2QJ.js +7 -0
- package/dist/chunks/{chunk-DQXGNNPB.js → chunk-YZBYL3SH.js} +1 -1
- package/dist/chunks/{chunk-4AY4YYKS.js → chunk-ZN37NQM4.js} +1 -1
- package/dist/chunks/{chunk-W45NZSSK.js → chunk-ZNQI6M3S.js} +1 -1
- package/dist/chunks/{clear-M6LODAMD.js → clear-VMJVLPVR.js} +1 -1
- package/dist/chunks/{compile-vercel-config-NBX5UWHW.js → compile-vercel-config-YCLXPL5H.js} +1 -1
- package/dist/chunks/{config-Q3TRA4NK.js → config-JPX6NJMJ.js} +1 -1
- package/dist/chunks/{config-YQ7FIAFK.js → config-YMUUPO3R.js} +1 -1
- package/dist/chunks/config-validator.mjs +1 -1
- package/dist/chunks/{connect-git-provider-67DJOI6X.js → connect-git-provider-KLSBCSD2.js} +1 -1
- package/dist/chunks/{delete-KSZ7R5V6.js → delete-E7J4B5E5.js} +1 -1
- package/dist/chunks/{delete-NRWKSTCN.js → delete-EEY7M6XT.js} +1 -1
- package/dist/chunks/{detect-services-MWYUJZJZ.js → detect-services-E2TWAKQS.js} +1 -1
- package/dist/chunks/{disable-BUGWQUS7.js → disable-5TKY6JK2.js} +1 -1
- package/dist/chunks/{discard-J5O3C753.js → discard-ALSOF66H.js} +1 -1
- package/dist/chunks/{edit-DMOIBVEP.js → edit-2M3KEE3H.js} +1 -1
- package/dist/chunks/{edit-YRWAXGEI.js → edit-ISUCMYNW.js} +1 -1
- package/dist/chunks/{enable-IL27VHSU.js → enable-2QTTTYQD.js} +1 -1
- package/dist/chunks/{exec-GYSSNCNK.js → exec-XIQJ2A3J.js} +1 -1
- package/dist/chunks/{export-HBUUGMGE.js → export-PV2NDS7C.js} +1 -1
- package/dist/chunks/{future-BXETJ6CT.js → future-SQS5POAL.js} +1 -1
- package/dist/chunks/{generate-cert-for-deploy-K5QDHEEQ.js → generate-cert-for-deploy-4EJRA7MS.js} +1 -1
- package/dist/chunks/{image-M2XIQYXT.js → image-6GL2UOA2.js} +1 -1
- package/dist/chunks/{import-builders-UGIWTKRS.js → import-builders-KAZMYQCR.js} +1 -1
- package/dist/chunks/{inspect-SUEMHSB6.js → inspect-3HGROSZO.js} +1 -1
- package/dist/chunks/{inspect-XANEFWYN.js → inspect-FK6GC5JZ.js} +1 -1
- package/dist/chunks/{inspect-TDHISMRV.js → inspect-LZMU7RIU.js} +1 -1
- package/dist/chunks/{inspect-HASOG2PB.js → inspect-ORVORGUM.js} +1 -1
- package/dist/chunks/{inspect-OGUGKPVK.js → inspect-UNL54246.js} +1 -1
- package/dist/chunks/{list-32NXD7OW.js → list-EWJI2WSQ.js} +1 -1
- package/dist/chunks/{list-Q566PTT4.js → list-FVUIZPC7.js} +1 -1
- package/dist/chunks/{list-Z6DRFZ7F.js → list-WOUJM4WR.js} +1 -1
- package/dist/chunks/{login-GPCBSMHV.js → login-IJLY5XTT.js} +1 -1
- package/dist/chunks/{login-A6R3RQIW.js → login-JREQ7SLY.js} +1 -1
- package/dist/chunks/{logs-L33R4G67.js → logs-Z7IMGFO2.js} +1 -1
- package/dist/chunks/{ls-VSK2ZFSY.js → ls-4COX4SMJ.js} +1 -1
- package/dist/chunks/{ls-6CYMQBX3.js → ls-6CD2OQGA.js} +1 -1
- package/dist/chunks/{ls-CTIACPC5.js → ls-6DOYSBQM.js} +1 -1
- package/dist/chunks/{ls-DUCIK4E6.js → ls-AHT2FRGM.js} +1 -1
- package/dist/chunks/{ls-R442RADW.js → ls-LXBUE4LZ.js} +1 -1
- package/dist/chunks/{ls-JPL3AFIM.js → ls-RBWPVJ5G.js} +1 -1
- package/dist/chunks/{ls-GDR45ANC.js → ls-W5SJUIHD.js} +1 -1
- package/dist/chunks/{mutate-MUWQVZKM.js → mutate-TVUHBRBK.js} +1 -1
- package/dist/chunks/{notifications-YKGIFXKO.js → notifications-OXOSD6UK.js} +1 -1
- package/dist/chunks/{open-OJAIEDS5.js → open-SWPHB54M.js} +1 -1
- package/dist/chunks/{openapi-Y4NWAKUM.js → openapi-32XHDVJL.js} +1 -1
- package/dist/chunks/{permissions-LWKZBBU7.js → permissions-A4WMGETJ.js} +1 -1
- package/dist/chunks/{prompt-missing-credentials-O3GGMOZH.js → prompt-missing-credentials-6IXO6VND.js} +1 -1
- package/dist/chunks/{publish-JHNLZT6K.js → publish-2CS4RYJW.js} +1 -1
- package/dist/chunks/pull-WWUH4M5V.js +7 -0
- package/dist/chunks/{purchase-domain-if-available-CJK3G4DT.js → purchase-domain-if-available-TAXCYIV7.js} +1 -1
- package/dist/chunks/{push-MUMGVOSY.js → push-OPRW7M4I.js} +1 -1
- package/dist/chunks/{query-2TTSDOFF.js → query-22PGP7BC.js} +1 -1
- package/dist/chunks/{reauthenticate-S47X66LM.js → reauthenticate-LMR25CIE.js} +1 -1
- package/dist/chunks/{reorder-NGBZWNZH.js → reorder-Y3NMEA2S.js} +1 -1
- package/dist/chunks/{reply-5WF5YHOM.js → reply-YEZHST2Q.js} +1 -1
- package/dist/chunks/{resolve-MPZBUK5V.js → resolve-QC37E2EB.js} +1 -1
- package/dist/chunks/{restore-NVY4A3T3.js → restore-RMQVGYQB.js} +1 -1
- package/dist/chunks/{rm-ZO5JP3GF.js → rm-42U6SPVV.js} +1 -1
- package/dist/chunks/{rm-HFJCOK2D.js → rm-43MPIHP3.js} +1 -1
- package/dist/chunks/{rm-QXQ2AD4R.js → rm-4MSUYUEP.js} +1 -1
- package/dist/chunks/{rm-DB5K2RI7.js → rm-DPHE34CD.js} +1 -1
- package/dist/chunks/{rm-SMKVHN75.js → rm-JHWXYHJY.js} +1 -1
- package/dist/chunks/{routes-KO5NFCCJ.js → routes-2GTCE542.js} +1 -1
- package/dist/chunks/{rule-inspect-VZARLRS3.js → rule-inspect-7LIPL5YY.js} +1 -1
- package/dist/chunks/{rules-G2WFYCPB.js → rules-6KWBVUF2.js} +1 -1
- package/dist/chunks/{schema-SVYU72YU.js → schema-OUFU5V7Z.js} +1 -1
- package/dist/chunks/{schema-G6BOZBNB.js → schema-S2DE7S5N.js} +1 -1
- package/dist/chunks/{select-org-2W67WKBG.js → select-org-EL66MG67.js} +1 -1
- package/dist/chunks/{set-ILVKMTUD.js → set-VXSNREF4.js} +1 -1
- package/dist/chunks/setup-and-link-I7SGZNGO.js +7 -0
- package/dist/chunks/{tags-C34XXMYO.js → tags-AGLQDT3Z.js} +1 -1
- package/dist/chunks/{types-MATC4UQL.js → types-GQNKYZJH.js} +1 -1
- package/dist/chunks/{update-IVWOZO4P.js → update-TI3YRVQT.js} +1 -1
- package/dist/commands/build/index.js +7 -7
- package/dist/commands/deploy/index.js +44 -28
- package/dist/commands/dev/index.js +8 -8
- 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 +35 -39
- package/dist/index.js +6 -5
- package/dist/internal-build.js +1 -1
- package/dist/version.mjs +1 -1
- package/package.json +54 -53
- package/dist/chunks/chunk-2Z47VG5H.js +0 -9
- package/dist/chunks/chunk-EA3BJUUK.js +0 -7
- package/dist/chunks/chunk-EJNFKH6Y.js +0 -10
- package/dist/chunks/chunk-NTRM6VO6.js +0 -9
- package/dist/chunks/chunk-SX64OM5A.js +0 -7
- package/dist/chunks/pull-E4K6BVQW.js +0 -7
- package/dist/chunks/setup-and-link-VFCYLLB5.js +0 -7
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { createRequire as __createRequire } from 'node:module';
|
|
2
|
+
import { fileURLToPath as __fileURLToPath } from 'node:url';
|
|
3
|
+
import { dirname as __dirname_ } from 'node:path';
|
|
4
|
+
const require = __createRequire(import.meta.url);
|
|
5
|
+
const __filename = __fileURLToPath(import.meta.url);
|
|
6
|
+
const __dirname = __dirname_(__filename);
|
|
7
|
+
import{readJSONFile}from"./chunk-RMZJP32R.js";import{getScope,writeToConfigFile}from"./chunk-THB7KY2N.js";import{require_types}from"./chunk-GHM7V3GG.js";import{getArgs}from"./chunk-LYKPLTZ7.js";import{humanizePath}from"./chunk-PPCFQQSU.js";import{CantFindConfig,CantParseJSONFile,DeprecatedNowJson,WorkingDirectoryDoesNotExist}from"./chunk-NM67DIPQ.js";import{cliErrorFromUnknown,output_manager_default,recordCliError}from"./chunk-Q2YQSMIB.js";import{require_dist}from"./chunk-QGIQK47P.js";import{__commonJS,__toESM}from"./chunk-6L236MNA.js";var require_epipebomb=__commonJS({"../../node_modules/.pnpm/epipebomb@1.0.0/node_modules/epipebomb/epipebomb.js"(exports,module){module.exports=epipeBomb;function epipeBomb(stream,callback){stream==null&&(stream=process.stdout),callback==null&&(callback=process.exit);function epipeFilter(err){if(err.code==="EPIPE")return callback();stream.listeners("error").length<=1&&(stream.removeAllListeners(),stream.emit("error",err),stream.on("error",epipeFilter))}stream.on("error",epipeFilter)}}});var sentry;async function getSentry(){if(!sentry){let[SentryModule,{SENTRY_DSN},{default:pkg}]=await Promise.all([import("./cjs-GOQHXIHX.js"),import("./constants-G4UYVLOF.js"),import("./pkg-YFU67U7I.js")]),Sentry="init"in SentryModule?SentryModule:SentryModule.default;Sentry.init({dsn:SENTRY_DSN,release:`vercel-cli@${pkg.version}`,environment:"stable",autoSessionTracking:!1}),sentry=Sentry}return sentry}function isOutputDebugEnabled(debugFlag){return debugFlag===!0||process.env.VERCEL_CLI_DEBUG==="1"}var import_epipebomb=__toESM(require_epipebomb(),1),SILENCED_ERRORS=["DeprecationWarning: The `punycode` module is deprecated. Please use a userland alternative instead."],installed=!1;function installProcessGuards(){if(installed)return;installed=!0;let originalError=console.error;console.error=msg=>{SILENCED_ERRORS.some(error=>typeof msg=="string"&&msg.includes(error))||originalError(msg)},(0,import_epipebomb.default)()}var import_error_utils=__toESM(require_dist(),1);async function reportError(sentry2,client,error){if(ignoreError(error))return;let user,team,scopeError;try{({user,team}=await getScope(client))}catch(err){(0,import_error_utils.isError)(err)&&(scopeError=err)}sentry2.withScope(scope=>{if(user){let spec={email:user.email,id:user.id,username:user.username,name:user.name};scope.setUser(spec)}team&&scope.setTag("currentTeam",team.id),scopeError&&scope.setExtra("scopeError",{name:scopeError.name,message:scopeError.message,stack:scopeError.stack});let args,argsError;try{args=getArgs(process.argv.slice(2),{})}catch(err){(0,import_error_utils.isError)(err)&&(argsError=err)}if(args){let flags=["--env","--build-env","--token"];for(let flag of flags)args[flag]&&(args[flag]="REDACTED");args._.length>=4&&args._[0].startsWith("secret")&&args._[1]==="add"&&(args._[3]="REDACTED"),scope.setExtra("args",args)}else{let msg="Unable to parse args";argsError&&(msg+=`: ${argsError}`),scope.setExtra("args",msg)}scope.setExtra("node",{execPath:process.execPath,version:process.version,platform:process.platform}),sentry2.captureException(error)});let sentryClient=sentry2.getCurrentHub().getClient();sentryClient&&await sentryClient.close()}function ignoreError(error){return(0,import_error_utils.isError)(error)&&error.message.includes("uv_cwd")}var fatalErrorHandlerSymbol=Symbol.for("vercel.cli.fatal-error-handler");async function exitWithUnexpectedError(error){let handler=globalThis[fatalErrorHandlerSymbol];if(typeof handler=="function")try{await handler(error)}catch{}process.exit(1)}async function handleUnexpectedError(client,err){let{message}=err;return message.includes("sentry")&&message.includes("ENOTFOUND")?(output_manager_default.debug(`Sentry is not reachable: ${err}`),!1):(output_manager_default.error(`An unexpected error occurred!
|
|
8
|
+
${err.stack}`),await reportError(await getSentry(),client,err),!0)}function registerUnexpectedErrorHandlers(getClient){process.on("unhandledRejection",async err=>{recordCliError(cliErrorFromUnknown(err)),err?err instanceof Error?await handleUnexpectedError(getClient(),err):(output_manager_default.error(`An unexpected rejection occurred
|
|
9
|
+
${err}`),await reportError(await getSentry(),getClient(),err)):output_manager_default.error("An unexpected empty rejection occurred"),await exitWithUnexpectedError(err)}),process.on("uncaughtException",async error=>{await handleUnexpectedError(getClient(),error)&&await exitWithUnexpectedError(error)})}var import_types=__toESM(require_types(),1);import path from"path";var import_error_utils2=__toESM(require_dist(),1);var config;async function earlyGetConfig(configFile){if(config)return config;let localPath;try{localPath=process.cwd()}catch(err){if((0,import_error_utils2.isErrnoException)(err)&&err.code==="ENOENT")return new WorkingDirectoryDoesNotExist;throw err}if(configFile){let localFilePath=path.resolve(localPath,configFile);output_manager_default.debug(`Found config in provided --local-config path ${localFilePath}`);let localConfig=await readJSONFile(localFilePath);return localConfig instanceof CantParseJSONFile?localConfig:localConfig===null?new CantFindConfig([humanizePath(localFilePath)]):(config=localConfig,config[import_types.fileNameSymbol]=configFile,config)}let vercelFilePath=path.resolve(localPath,"vercel.json"),nowFilePath=path.resolve(localPath,"now.json"),[vercelConfig,nowConfig]=await Promise.all([readJSONFile(vercelFilePath),readJSONFile(nowFilePath)]);return vercelConfig instanceof CantParseJSONFile?vercelConfig:nowConfig instanceof CantParseJSONFile?nowConfig:vercelConfig!==null?(output_manager_default.debug(`Found config in file "${vercelFilePath}"`),config=vercelConfig,config[import_types.fileNameSymbol]="vercel.json",config):nowConfig!==null?new DeprecatedNowJson(nowFilePath):new CantFindConfig([vercelFilePath].map(humanizePath))}var fallbackReason;function recordDirectBuildFallback(reason){fallbackReason=reason}function getDirectBuildFallbackAttributes(){return fallbackReason===void 0?void 0:{directBuild:"false",fallbackReason}}function checkTelemetryStatus({config:config2}){config2.telemetry||process.env.VERCEL_TELEMETRY_DISABLED||(output_manager_default.note("The Vercel CLI now collects telemetry regarding usage of the CLI."),output_manager_default.log("This information is used to shape the CLI roadmap and prioritize features."),output_manager_default.log("You can learn more, including how to opt-out if you'd not like to participate in this program, by visiting the following URL:"),output_manager_default.log("https://vercel.com/docs/cli/about-telemetry"),config2.telemetry={enabled:!0},writeToConfigFile(config2))}export{getSentry,isOutputDebugEnabled,installProcessGuards,reportError,exitWithUnexpectedError,handleUnexpectedError,registerUnexpectedErrorHandlers,earlyGetConfig,recordDirectBuildFallback,getDirectBuildFallbackAttributes,checkTelemetryStatus};
|
|
@@ -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{APIError,InvalidToken,MissingUser}from"./chunk-
|
|
7
|
+
import{APIError,InvalidToken,MissingUser}from"./chunk-NM67DIPQ.js";import{output_manager_default}from"./chunk-Q2YQSMIB.js";async function getUser(client){return client.user?client.user:(client.userPromise||(client.userPromise=fetchUser(client).finally(()=>{client.userPromise=void 0})),client.userPromise)}async function fetchUser(client){try{let res=await client.fetch("/v2/user",{useCurrentTeam:!1});if(!res.user)throw new MissingUser;if(client.authConfig.userId!==res.user.id){client.updateAuthConfig({userId:res.user.id});try{client.persistAuthConfig()}catch{output_manager_default.debug("Failed to persist cached userId to auth config.")}}return client.telemetryEventStore.updateUserId(res.user.id),client.user=res.user,res.user}catch(error){if(error instanceof APIError&&error.status===403){if(client.user=void 0,client.userPromise=void 0,client.authConfig.userId){client.updateAuthConfig({userId:void 0});try{client.persistAuthConfig()}catch{output_manager_default.debug("Failed to persist cached userId to auth config.")}}throw new InvalidToken(client.authConfig.tokenSource)}throw error}}export{getUser};
|
|
@@ -8,19 +8,19 @@ import{require_dist}from"./chunk-QGIQK47P.js";import{require_escape_string_regex
|
|
|
8
8
|
`],["r","\r"],["t"," "],["b","\b"],["f","\f"],["v","\v"],["0","\0"],["\\","\\"],["e","\x1B"],["a","\x07"]]);function unescape(c){return c[0]==="u"&&c.length===5||c[0]==="x"&&c.length===3?String.fromCharCode(parseInt(c.slice(1),16)):ESCAPES.get(c)||c}function parseArguments(name,args){let results=[],chunks=args.trim().split(/\s*,\s*/g),matches;for(let chunk of chunks)if(!isNaN(chunk))results.push(Number(chunk));else if(matches=chunk.match(STRING_REGEX))results.push(matches[2].replace(ESCAPE_REGEX,(m,escape,chr)=>escape?unescape(escape):chr));else throw new Error(`Invalid Chalk template style argument: ${chunk} (in style '${name}')`);return results}function parseStyle(style){STYLE_REGEX.lastIndex=0;let results=[],matches;for(;(matches=STYLE_REGEX.exec(style))!==null;){let name=matches[1];if(matches[2]){let args=parseArguments(name,matches[2]);results.push([name].concat(args))}else results.push([name])}return results}function buildStyle(chalk4,styles){let enabled={};for(let layer of styles)for(let style of layer.styles)enabled[style[0]]=layer.inverse?null:style.slice(1);let current=chalk4;for(let styleName of Object.keys(enabled))if(Array.isArray(enabled[styleName])){if(!(styleName in current))throw new Error(`Unknown Chalk style: ${styleName}`);enabled[styleName].length>0?current=current[styleName].apply(current,enabled[styleName]):current=current[styleName]}return current}module.exports=(chalk4,tmp)=>{let styles=[],chunks=[],chunk=[];if(tmp.replace(TEMPLATE_REGEX,(m,escapeChar,inverse,style,close,chr)=>{if(escapeChar)chunk.push(unescape(escapeChar));else if(style){let str=chunk.join("");chunk=[],chunks.push(styles.length===0?str:buildStyle(chalk4,styles)(str)),styles.push({inverse,styles:parseStyle(style)})}else if(close){if(styles.length===0)throw new Error("Found extraneous } in Chalk template literal");chunks.push(buildStyle(chalk4,styles)(chunk.join(""))),chunk=[],styles.pop()}else chunk.push(chr)}),chunks.push(chunk.join("")),styles.length>0){let errMsg=`Chalk template literal is missing ${styles.length} closing bracket${styles.length===1?"":"s"} (\`}\`)`;throw new Error(errMsg)}return chunks.join("")}}});var require_chalk=__commonJS({"../../node_modules/.pnpm/chalk@2.4.2/node_modules/chalk/index.js"(exports,module){"use strict";var escapeStringRegexp=require_escape_string_regexp(),ansiStyles=require_ansi_styles(),stdoutColor=require_supports_color2().stdout,template=require_templates(),isSimpleWindowsTerm=process.platform==="win32"&&!(process.env.TERM||"").toLowerCase().startsWith("xterm"),levelMapping=["ansi","ansi","ansi256","ansi16m"],skipModels=new Set(["gray"]),styles=Object.create(null);function applyOptions(obj,options){options=options||{};let scLevel=stdoutColor?stdoutColor.level:0;obj.level=options.level===void 0?scLevel:options.level,obj.enabled="enabled"in options?options.enabled:obj.level>0}function Chalk(options){if(!this||!(this instanceof Chalk)||this.template){let chalk4={};return applyOptions(chalk4,options),chalk4.template=function(){let args=[].slice.call(arguments);return chalkTag.apply(null,[chalk4.template].concat(args))},Object.setPrototypeOf(chalk4,Chalk.prototype),Object.setPrototypeOf(chalk4.template,chalk4),chalk4.template.constructor=Chalk,chalk4.template}applyOptions(this,options)}isSimpleWindowsTerm&&(ansiStyles.blue.open="\x1B[94m");for(let key of Object.keys(ansiStyles))ansiStyles[key].closeRe=new RegExp(escapeStringRegexp(ansiStyles[key].close),"g"),styles[key]={get(){let codes=ansiStyles[key];return build.call(this,this._styles?this._styles.concat(codes):[codes],this._empty,key)}};styles.visible={get(){return build.call(this,this._styles||[],!0,"visible")}};ansiStyles.color.closeRe=new RegExp(escapeStringRegexp(ansiStyles.color.close),"g");for(let model of Object.keys(ansiStyles.color.ansi))skipModels.has(model)||(styles[model]={get(){let level=this.level;return function(){let codes={open:ansiStyles.color[levelMapping[level]][model].apply(null,arguments),close:ansiStyles.color.close,closeRe:ansiStyles.color.closeRe};return build.call(this,this._styles?this._styles.concat(codes):[codes],this._empty,model)}}});ansiStyles.bgColor.closeRe=new RegExp(escapeStringRegexp(ansiStyles.bgColor.close),"g");for(let model of Object.keys(ansiStyles.bgColor.ansi)){if(skipModels.has(model))continue;let bgModel="bg"+model[0].toUpperCase()+model.slice(1);styles[bgModel]={get(){let level=this.level;return function(){let codes={open:ansiStyles.bgColor[levelMapping[level]][model].apply(null,arguments),close:ansiStyles.bgColor.close,closeRe:ansiStyles.bgColor.closeRe};return build.call(this,this._styles?this._styles.concat(codes):[codes],this._empty,model)}}}}var proto=Object.defineProperties(()=>{},styles);function build(_styles,_empty,key){let builder=function(){return applyStyle.apply(builder,arguments)};builder._styles=_styles,builder._empty=_empty;let self=this;return Object.defineProperty(builder,"level",{enumerable:!0,get(){return self.level},set(level){self.level=level}}),Object.defineProperty(builder,"enabled",{enumerable:!0,get(){return self.enabled},set(enabled){self.enabled=enabled}}),builder.hasGrey=this.hasGrey||key==="gray"||key==="grey",builder.__proto__=proto,builder}function applyStyle(){let args=arguments,argsLen=args.length,str=String(arguments[0]);if(argsLen===0)return"";if(argsLen>1)for(let a=1;a<argsLen;a++)str+=" "+args[a];if(!this.enabled||this.level<=0||!str)return this._empty?"":str;let originalDim=ansiStyles.dim.open;isSimpleWindowsTerm&&this.hasGrey&&(ansiStyles.dim.open="");for(let code of this._styles.slice().reverse())str=code.open+str.replace(code.closeRe,code.open)+code.close,str=str.replace(/\r?\n/g,`${code.close}$&${code.open}`);return ansiStyles.dim.open=originalDim,str}function chalkTag(chalk4,strings){if(!Array.isArray(strings))return[].slice.call(arguments,1).join(" ");let args=[].slice.call(arguments,2),parts=[strings.raw[0]];for(let i=1;i<strings.length;i++)parts.push(String(args[i-1]).replace(/[{}\\]/g,"\\$&")),parts.push(String(strings.raw[i]));return template(chalk4,parts.join(""))}Object.defineProperties(Chalk.prototype,styles);module.exports=Chalk();module.exports.supportsColor=stdoutColor;module.exports.default=module.exports}});var require_mimic_fn=__commonJS({"../../node_modules/.pnpm/mimic-fn@1.2.0/node_modules/mimic-fn/index.js"(exports,module){"use strict";module.exports=(to,from)=>{for(let prop of Object.getOwnPropertyNames(from).concat(Object.getOwnPropertySymbols(from)))Object.defineProperty(to,prop,Object.getOwnPropertyDescriptor(from,prop));return to}}});var require_onetime=__commonJS({"../../node_modules/.pnpm/onetime@2.0.1/node_modules/onetime/index.js"(exports,module){"use strict";var mimicFn=require_mimic_fn();module.exports=(fn,opts)=>{if(opts===!0)throw new TypeError("The second argument is now an options object");if(typeof fn!="function")throw new TypeError("Expected a function");opts=opts||{};let ret,called=!1,fnName=fn.displayName||fn.name||"<anonymous>",onetime=function(){if(called){if(opts.throw===!0)throw new Error(`Function \`${fnName}\` can only be called once`);return ret}return called=!0,ret=fn.apply(this,arguments),fn=null,ret};return mimicFn(onetime,fn),onetime}}});var require_signals=__commonJS({"../../node_modules/.pnpm/signal-exit@3.0.7/node_modules/signal-exit/signals.js"(exports,module){module.exports=["SIGABRT","SIGALRM","SIGHUP","SIGINT","SIGTERM"];process.platform!=="win32"&&module.exports.push("SIGVTALRM","SIGXCPU","SIGXFSZ","SIGUSR2","SIGTRAP","SIGSYS","SIGQUIT","SIGIOT");process.platform==="linux"&&module.exports.push("SIGIO","SIGPOLL","SIGPWR","SIGSTKFLT","SIGUNUSED")}});var require_signal_exit=__commonJS({"../../node_modules/.pnpm/signal-exit@3.0.7/node_modules/signal-exit/index.js"(exports,module){var process2=global.process,processOk=function(process3){return process3&&typeof process3=="object"&&typeof process3.removeListener=="function"&&typeof process3.emit=="function"&&typeof process3.reallyExit=="function"&&typeof process3.listeners=="function"&&typeof process3.kill=="function"&&typeof process3.pid=="number"&&typeof process3.on=="function"};processOk(process2)?(assert=__require("assert"),signals=require_signals(),isWin=/^win/i.test(process2.platform),EE=__require("events"),typeof EE!="function"&&(EE=EE.EventEmitter),process2.__signal_exit_emitter__?emitter=process2.__signal_exit_emitter__:(emitter=process2.__signal_exit_emitter__=new EE,emitter.count=0,emitter.emitted={}),emitter.infinite||(emitter.setMaxListeners(1/0),emitter.infinite=!0),module.exports=function(cb,opts){if(!processOk(global.process))return function(){};assert.equal(typeof cb,"function","a callback must be provided for exit handler"),loaded===!1&&load();var ev="exit";opts&&opts.alwaysLast&&(ev="afterexit");var remove=function(){emitter.removeListener(ev,cb),emitter.listeners("exit").length===0&&emitter.listeners("afterexit").length===0&&unload()};return emitter.on(ev,cb),remove},unload=function(){!loaded||!processOk(global.process)||(loaded=!1,signals.forEach(function(sig){try{process2.removeListener(sig,sigListeners[sig])}catch{}}),process2.emit=originalProcessEmit,process2.reallyExit=originalProcessReallyExit,emitter.count-=1)},module.exports.unload=unload,emit=function(event,code,signal){emitter.emitted[event]||(emitter.emitted[event]=!0,emitter.emit(event,code,signal))},sigListeners={},signals.forEach(function(sig){sigListeners[sig]=function(){if(processOk(global.process)){var listeners=process2.listeners(sig);listeners.length===emitter.count&&(unload(),emit("exit",null,sig),emit("afterexit",null,sig),isWin&&sig==="SIGHUP"&&(sig="SIGINT"),process2.kill(process2.pid,sig))}}}),module.exports.signals=function(){return signals},loaded=!1,load=function(){loaded||!processOk(global.process)||(loaded=!0,emitter.count+=1,signals=signals.filter(function(sig){try{return process2.on(sig,sigListeners[sig]),!0}catch{return!1}}),process2.emit=processEmit,process2.reallyExit=processReallyExit)},module.exports.load=load,originalProcessReallyExit=process2.reallyExit,processReallyExit=function(code){processOk(global.process)&&(process2.exitCode=code||0,emit("exit",process2.exitCode,null),emit("afterexit",process2.exitCode,null),originalProcessReallyExit.call(process2,process2.exitCode))},originalProcessEmit=process2.emit,processEmit=function(ev,arg){if(ev==="exit"&&processOk(global.process)){arg!==void 0&&(process2.exitCode=arg);var ret=originalProcessEmit.apply(this,arguments);return emit("exit",process2.exitCode,null),emit("afterexit",process2.exitCode,null),ret}else return originalProcessEmit.apply(this,arguments)}):module.exports=function(){return function(){}};var assert,signals,isWin,EE,emitter,unload,emit,sigListeners,loaded,load,originalProcessReallyExit,processReallyExit,originalProcessEmit,processEmit}});var require_restore_cursor=__commonJS({"../../node_modules/.pnpm/restore-cursor@2.0.0/node_modules/restore-cursor/index.js"(exports,module){"use strict";var onetime=require_onetime(),signalExit=require_signal_exit();module.exports=onetime(()=>{signalExit(()=>{process.stderr.write("\x1B[?25h")},{alwaysLast:!0})})}});var require_cli_cursor=__commonJS({"../../node_modules/.pnpm/cli-cursor@2.1.0/node_modules/cli-cursor/index.js"(exports){"use strict";var restoreCursor=require_restore_cursor(),hidden=!1;exports.show=stream=>{let s=stream||process.stderr;s.isTTY&&(hidden=!1,s.write("\x1B[?25h"))};exports.hide=stream=>{let s=stream||process.stderr;s.isTTY&&(restoreCursor(),hidden=!0,s.write("\x1B[?25l"))};exports.toggle=(force,stream)=>{force!==void 0&&(hidden=force),hidden?exports.show(stream):exports.hide(stream)}}});var require_log_symbols=__commonJS({"../../node_modules/.pnpm/log-symbols@2.2.0/node_modules/log-symbols/index.js"(exports,module){"use strict";var chalk4=require_chalk(),isSupported=process.platform!=="win32"||process.env.CI||process.env.TERM==="xterm-256color",main={info:chalk4.blue("\u2139"),success:chalk4.green("\u2714"),warning:chalk4.yellow("\u26A0"),error:chalk4.red("\u2716")},fallbacks={info:chalk4.blue("i"),success:chalk4.green("\u221A"),warning:chalk4.yellow("\u203C"),error:chalk4.red("\xD7")};module.exports=isSupported?main:fallbacks}});var require_ansi_regex=__commonJS({"../../node_modules/.pnpm/ansi-regex@4.1.1/node_modules/ansi-regex/index.js"(exports,module){"use strict";module.exports=options=>{options=Object.assign({onlyFirst:!1},options);let pattern=["[\\u001B\\u009B][[\\]()#;?]*(?:(?:(?:(?:;[-a-zA-Z\\d\\/#&.:=?%@~_]+)*|[a-zA-Z\\d]+(?:;[-a-zA-Z\\d\\/#&.:=?%@~_]*)*)?\\u0007)","(?:(?:\\d{1,4}(?:;\\d{0,4})*)?[\\dA-PR-TZcf-ntqry=><~]))"].join("|");return new RegExp(pattern,options.onlyFirst?void 0:"g")}}});var require_strip_ansi=__commonJS({"../../node_modules/.pnpm/strip-ansi@5.2.0/node_modules/strip-ansi/index.js"(exports,module){"use strict";var ansiRegex=require_ansi_regex(),stripAnsi=string=>typeof string=="string"?string.replace(ansiRegex(),""):string;module.exports=stripAnsi;module.exports.default=stripAnsi}});var require_clone=__commonJS({"../../node_modules/.pnpm/clone@1.0.4/node_modules/clone/clone.js"(exports,module){var clone=function(){"use strict";function clone2(parent,circular,depth,prototype){var filter;typeof circular=="object"&&(depth=circular.depth,prototype=circular.prototype,filter=circular.filter,circular=circular.circular);var allParents=[],allChildren=[],useBuffer=typeof Buffer<"u";typeof circular>"u"&&(circular=!0),typeof depth>"u"&&(depth=1/0);function _clone(parent2,depth2){if(parent2===null)return null;if(depth2==0)return parent2;var child,proto;if(typeof parent2!="object")return parent2;if(clone2.__isArray(parent2))child=[];else if(clone2.__isRegExp(parent2))child=new RegExp(parent2.source,__getRegExpFlags(parent2)),parent2.lastIndex&&(child.lastIndex=parent2.lastIndex);else if(clone2.__isDate(parent2))child=new Date(parent2.getTime());else{if(useBuffer&&Buffer.isBuffer(parent2))return Buffer.allocUnsafe?child=Buffer.allocUnsafe(parent2.length):child=new Buffer(parent2.length),parent2.copy(child),child;typeof prototype>"u"?(proto=Object.getPrototypeOf(parent2),child=Object.create(proto)):(child=Object.create(prototype),proto=prototype)}if(circular){var index=allParents.indexOf(parent2);if(index!=-1)return allChildren[index];allParents.push(parent2),allChildren.push(child)}for(var i in parent2){var attrs;proto&&(attrs=Object.getOwnPropertyDescriptor(proto,i)),!(attrs&&attrs.set==null)&&(child[i]=_clone(parent2[i],depth2-1))}return child}return _clone(parent,depth)}clone2.clonePrototype=function(parent){if(parent===null)return null;var c=function(){};return c.prototype=parent,new c};function __objToStr(o){return Object.prototype.toString.call(o)}clone2.__objToStr=__objToStr;function __isDate(o){return typeof o=="object"&&__objToStr(o)==="[object Date]"}clone2.__isDate=__isDate;function __isArray(o){return typeof o=="object"&&__objToStr(o)==="[object Array]"}clone2.__isArray=__isArray;function __isRegExp(o){return typeof o=="object"&&__objToStr(o)==="[object RegExp]"}clone2.__isRegExp=__isRegExp;function __getRegExpFlags(re){var flags="";return re.global&&(flags+="g"),re.ignoreCase&&(flags+="i"),re.multiline&&(flags+="m"),flags}return clone2.__getRegExpFlags=__getRegExpFlags,clone2}();typeof module=="object"&&module.exports&&(module.exports=clone)}});var require_defaults=__commonJS({"../../node_modules/.pnpm/defaults@1.0.4/node_modules/defaults/index.js"(exports,module){var clone=require_clone();module.exports=function(options,defaults){return options=options||{},Object.keys(defaults).forEach(function(key){typeof options[key]>"u"&&(options[key]=clone(defaults[key]))}),options}}});var require_combining=__commonJS({"../../node_modules/.pnpm/wcwidth@1.0.1/node_modules/wcwidth/combining.js"(exports,module){module.exports=[[768,879],[1155,1158],[1160,1161],[1425,1469],[1471,1471],[1473,1474],[1476,1477],[1479,1479],[1536,1539],[1552,1557],[1611,1630],[1648,1648],[1750,1764],[1767,1768],[1770,1773],[1807,1807],[1809,1809],[1840,1866],[1958,1968],[2027,2035],[2305,2306],[2364,2364],[2369,2376],[2381,2381],[2385,2388],[2402,2403],[2433,2433],[2492,2492],[2497,2500],[2509,2509],[2530,2531],[2561,2562],[2620,2620],[2625,2626],[2631,2632],[2635,2637],[2672,2673],[2689,2690],[2748,2748],[2753,2757],[2759,2760],[2765,2765],[2786,2787],[2817,2817],[2876,2876],[2879,2879],[2881,2883],[2893,2893],[2902,2902],[2946,2946],[3008,3008],[3021,3021],[3134,3136],[3142,3144],[3146,3149],[3157,3158],[3260,3260],[3263,3263],[3270,3270],[3276,3277],[3298,3299],[3393,3395],[3405,3405],[3530,3530],[3538,3540],[3542,3542],[3633,3633],[3636,3642],[3655,3662],[3761,3761],[3764,3769],[3771,3772],[3784,3789],[3864,3865],[3893,3893],[3895,3895],[3897,3897],[3953,3966],[3968,3972],[3974,3975],[3984,3991],[3993,4028],[4038,4038],[4141,4144],[4146,4146],[4150,4151],[4153,4153],[4184,4185],[4448,4607],[4959,4959],[5906,5908],[5938,5940],[5970,5971],[6002,6003],[6068,6069],[6071,6077],[6086,6086],[6089,6099],[6109,6109],[6155,6157],[6313,6313],[6432,6434],[6439,6440],[6450,6450],[6457,6459],[6679,6680],[6912,6915],[6964,6964],[6966,6970],[6972,6972],[6978,6978],[7019,7027],[7616,7626],[7678,7679],[8203,8207],[8234,8238],[8288,8291],[8298,8303],[8400,8431],[12330,12335],[12441,12442],[43014,43014],[43019,43019],[43045,43046],[64286,64286],[65024,65039],[65056,65059],[65279,65279],[65529,65531],[68097,68099],[68101,68102],[68108,68111],[68152,68154],[68159,68159],[119143,119145],[119155,119170],[119173,119179],[119210,119213],[119362,119364],[917505,917505],[917536,917631],[917760,917999]]}});var require_wcwidth=__commonJS({"../../node_modules/.pnpm/wcwidth@1.0.1/node_modules/wcwidth/index.js"(exports,module){"use strict";var defaults=require_defaults(),combining=require_combining(),DEFAULTS={nul:0,control:0};module.exports=function(str){return wcswidth(str,DEFAULTS)};module.exports.config=function(opts){return opts=defaults(opts||{},DEFAULTS),function(str){return wcswidth(str,opts)}};function wcswidth(str,opts){if(typeof str!="string")return wcwidth(str,opts);for(var s=0,i=0;i<str.length;i++){var n=wcwidth(str.charCodeAt(i),opts);if(n<0)return-1;s+=n}return s}function wcwidth(ucs,opts){return ucs===0?opts.nul:ucs<32||ucs>=127&&ucs<160?opts.control:bisearch(ucs)?0:1+(ucs>=4352&&(ucs<=4447||ucs==9001||ucs==9002||ucs>=11904&&ucs<=42191&&ucs!=12351||ucs>=44032&&ucs<=55203||ucs>=63744&&ucs<=64255||ucs>=65040&&ucs<=65049||ucs>=65072&&ucs<=65135||ucs>=65280&&ucs<=65376||ucs>=65504&&ucs<=65510||ucs>=131072&&ucs<=196605||ucs>=196608&&ucs<=262141))}function bisearch(ucs){var min=0,max=combining.length-1,mid;if(ucs<combining[0][0]||ucs>combining[max][1])return!1;for(;max>=min;)if(mid=Math.floor((min+max)/2),ucs>combining[mid][1])min=mid+1;else if(ucs<combining[mid][0])max=mid-1;else return!0;return!1}}});var require_ora=__commonJS({"../../node_modules/.pnpm/ora@3.4.0/node_modules/ora/index.js"(exports,module){"use strict";var chalk4=require_chalk(),cliCursor=require_cli_cursor(),cliSpinners=require_cli_spinners(),logSymbols=require_log_symbols(),stripAnsi=require_strip_ansi(),wcwidth=require_wcwidth(),TEXT=Symbol("text"),PREFIX_TEXT=Symbol("prefixText"),Ora=class{constructor(options){typeof options=="string"&&(options={text:options}),this.options=Object.assign({text:"",color:"cyan",stream:process.stderr},options),this.spinner=this.options.spinner,this.color=this.options.color,this.hideCursor=this.options.hideCursor!==!1,this.interval=this.options.interval||this.spinner.interval||100,this.stream=this.options.stream,this.id=null,this.isEnabled=typeof this.options.isEnabled=="boolean"?this.options.isEnabled:this.stream&&this.stream.isTTY&&!process.env.CI,this.text=this.options.text,this.prefixText=this.options.prefixText,this.linesToClear=0,this.indent=this.options.indent}get indent(){return this._indent}set indent(indent=0){if(!(indent>=0&&Number.isInteger(indent)))throw new Error("The `indent` option must be an integer from 0 and up");this._indent=indent}get spinner(){return this._spinner}set spinner(spinner){if(this.frameIndex=0,typeof spinner=="object"){if(spinner.frames===void 0)throw new Error("The given spinner must have a `frames` property");this._spinner=spinner}else if(process.platform==="win32")this._spinner=cliSpinners.line;else if(spinner===void 0)this._spinner=cliSpinners.dots;else if(cliSpinners[spinner])this._spinner=cliSpinners[spinner];else throw new Error(`There is no built-in spinner named '${spinner}'. See https://github.com/sindresorhus/cli-spinners/blob/master/spinners.json for a full list.`)}get text(){return this[TEXT]}get prefixText(){return this[PREFIX_TEXT]}get isSpinning(){return this.id!==null}updateLineCount(){let columns=this.stream.columns||80,fullPrefixText=typeof this[PREFIX_TEXT]=="string"?this[PREFIX_TEXT]+"-":"";this.lineCount=stripAnsi(fullPrefixText+"--"+this[TEXT]).split(`
|
|
9
9
|
`).reduce((count,line)=>count+Math.max(1,Math.ceil(wcwidth(line)/columns)),0)}set text(value){this[TEXT]=value,this.updateLineCount()}set prefixText(value){this[PREFIX_TEXT]=value,this.updateLineCount()}frame(){let{frames}=this.spinner,frame=frames[this.frameIndex];this.color&&(frame=chalk4[this.color](frame)),this.frameIndex=++this.frameIndex%frames.length;let fullPrefixText=typeof this.prefixText=="string"?this.prefixText+" ":"",fullText=typeof this.text=="string"?" "+this.text:"";return fullPrefixText+frame+fullText}clear(){if(!this.isEnabled||!this.stream.isTTY)return this;for(let i=0;i<this.linesToClear;i++)i>0&&this.stream.moveCursor(0,-1),this.stream.clearLine(),this.stream.cursorTo(this.indent);return this.linesToClear=0,this}render(){return this.clear(),this.stream.write(this.frame()),this.linesToClear=this.lineCount,this}start(text){return text&&(this.text=text),this.isEnabled?this.isSpinning?this:(this.hideCursor&&cliCursor.hide(this.stream),this.render(),this.id=setInterval(this.render.bind(this),this.interval),this):(this.stream.write(`- ${this.text}
|
|
10
10
|
`),this)}stop(){return this.isEnabled?(clearInterval(this.id),this.id=null,this.frameIndex=0,this.clear(),this.hideCursor&&cliCursor.show(this.stream),this):this}succeed(text){return this.stopAndPersist({symbol:logSymbols.success,text})}fail(text){return this.stopAndPersist({symbol:logSymbols.error,text})}warn(text){return this.stopAndPersist({symbol:logSymbols.warning,text})}info(text){return this.stopAndPersist({symbol:logSymbols.info,text})}stopAndPersist(options={}){let prefixText=options.prefixText||this.prefixText,fullPrefixText=typeof prefixText=="string"?prefixText+" ":"",text=options.text||this.text,fullText=typeof text=="string"?" "+text:"";return this.stop(),this.stream.write(`${fullPrefixText}${options.symbol||" "}${fullText}
|
|
11
|
-
`),this}},oraFactory=function(opts){return new Ora(opts)};module.exports=oraFactory;module.exports.default=oraFactory;module.exports.promise=(action,options)=>{if(typeof action.then!="function")throw new TypeError("Parameter `action` must be a Promise");let spinner=new Ora(options);return spinner.start(),action.then(()=>{spinner.succeed()},()=>{spinner.fail()}),spinner}}});var require_build_utils=__commonJS({"cjs-dependency:@vercel/build-utils"(exports,module){module.exports=__require("@vercel/build-utils")}});var import_chalk=__toESM(require_source(),1),link=import_chalk.default.cyan.underline,link_default=link;var import_ansi_escapes=__toESM(require_ansi_escapes(),1);function eraseLines(numberOfLines){return import_ansi_escapes.default.eraseLines(numberOfLines)}
|
|
12
|
-
`)?result:result.trimStart()}var import_chalk3=__toESM(require_source(),1),ansiEscapes2=__toESM(require_ansi_escapes(),1),import_supports_hyperlinks=__toESM(require_supports_hyperlinks(),1);var import_ora=__toESM(require_ora(),1),import_chalk2=__toESM(require_source(),1);function wait(opts,delay=300){let text=opts.text,spinner=null;if(typeof text!="string")throw new Error('"text" is required for Ora spinner');let timeout=setTimeout(()=>{spinner=(0,import_ora.default)(opts),spinner.text=import_chalk2.default.gray(text),spinner.color="gray",spinner.start()},delay),stop=()=>{clearTimeout(timeout),spinner&&(spinner.stop(),spinner=null,process.stderr.write(eraseLines(1)))};return stop.text=text,Object.defineProperty(stop,"text",{get(){return text},set(v){text=v,spinner&&(spinner.text=import_chalk2.default.gray(v))}}),stop}var import_error_utils=__toESM(require_dist(),1);import{inspect}from"util";var chars={tick:process.platform==="win32"?"\u221A":"\u2714",cross:process.platform==="win32"?"\u2613":"\u2718",fatal:process.platform==="win32"?"x":"\u2717",warning:"!"},chars_default=chars;var IS_TEST=process.env.NODE_ENV==="test",defaultChalkColorLevel=0,Output=class{constructor(stream,options={}){this.isDebugEnabled=()=>this.debugEnabled;this.print=str=>{this.colorDisabled&&(str=removeEmoji(str)),this.stopSpinner(),this.stream.write(str)};this.log=(str,color=import_chalk3.default.grey)=>{this.print(`${color(">")} ${str}
|
|
11
|
+
`),this}},oraFactory=function(opts){return new Ora(opts)};module.exports=oraFactory;module.exports.default=oraFactory;module.exports.promise=(action,options)=>{if(typeof action.then!="function")throw new TypeError("Parameter `action` must be a Promise");let spinner=new Ora(options);return spinner.start(),action.then(()=>{spinner.succeed()},()=>{spinner.fail()}),spinner}}});var require_build_utils=__commonJS({"cjs-dependency:@vercel/build-utils"(exports,module){module.exports=__require("@vercel/build-utils")}});var import_chalk=__toESM(require_source(),1),link=import_chalk.default.cyan.underline,link_default=link;var import_ansi_escapes=__toESM(require_ansi_escapes(),1);function eraseLines(numberOfLines){return import_ansi_escapes.default.eraseLines(numberOfLines)}var emojiLabels={notice:"\u{1F4DD}",tip:"\u{1F4A1}",warning:"\u2757\uFE0F",link:"\u{1F517}",inspect:"\u{1F50D}",success:"\u2705",locked:"\u{1F512}",loading:"\u23F3"},stripEmojiRegex=new RegExp(Object.values(emojiLabels).join("|"),"gi");function emoji(label){return emojiLabels[label]}function prependEmoji(message,emoji2){return emoji2&&process.stdout.isTTY?`${emoji2} ${message}`:message}function removeEmoji(message){let result=message.replace(stripEmojiRegex,"");return result.startsWith(`
|
|
12
|
+
`)?result:result.trimStart()}function toValueWithArgs(valFn,...args){return typeof valFn=="function"?valFn(...args):valFn}var captureStackTrace=Error.captureStackTrace,Diagnostic=class Diagnostic2 extends Error{name="Diagnostic";docs;fix;sources;get why(){return this.message}constructor(init,captureFrom=Diagnostic2){super(init.why,{cause:init.cause}),this.fix=init.fix,this.docs=init.docs,this.sources=init.sources,captureStackTrace?.(this,captureFrom)}toJSON(){return{name:this.name,why:this.why,fix:this.fix,docs:this.docs,sources:this.sources,cause:this.cause,stack:this.stack}}};function deriveDocs(docsBase,code){return typeof docsBase=="string"?`${docsBase}/${code.toLowerCase()}`:docsBase?.(code)}function defineDiagnostics(options){let reporters=options.reporters??[],result={},{docsBase}=options;for(let code of Object.keys(options.codes)){let def=options.codes[code],docs=def.docs===!1?void 0:def.docs||deriveDocs(docsBase,code),handle=(params={},reporterOptions={})=>{let diagnostic=new Diagnostic({why:toValueWithArgs(def.why,params),fix:toValueWithArgs(def.fix,params),docs,cause:params.cause,sources:params.sources},handle);diagnostic.name=code;for(let reporter of reporters)reporter(diagnostic,reporterOptions);return diagnostic};result[code]=handle}return result}var UNCLASSIFIED_ERROR_CODE="UNCLASSIFIED_ERROR",MAX_SCANNED_OUTPUT_LENGTH=64*1024,recorded;function stringProperty(value,key){if(typeof value=="object"&&value!==null&&key in value){let property=value[key];if(typeof property=="string")return property}}function numberProperty(value,key){if(typeof value=="object"&&value!==null&&key in value){let property=value[key];if(typeof property=="number")return property}}function cliErrorFromUnknown(err,{includeMessage=!1}={}){let code=err instanceof Diagnostic&&err.name!=="Diagnostic"?err.name:stringProperty(err,"code");return{status:numberProperty(err,"status"),code:code??(err instanceof Error&&err.name!=="Error"&&err.name!=="Diagnostic"?err.name:void 0),slug:stringProperty(err,"slug"),action:stringProperty(err,"action"),serverMessage:includeMessage?stringProperty(err,"serverMessage")??stringProperty(err,"message"):void 0}}function recordCliError(details,{override=!1}={}){recorded&&!override&&(recorded.code||!details.code)||(recorded=details)}function recordCliErrorFromOutput(chunk){if(typeof chunk!="string"||chunk.length>MAX_SCANNED_OUTPUT_LENGTH||!chunk.includes('"reason"'))return;let text=chunk.trim();if(!text.startsWith("{"))return;let payload;try{payload=JSON.parse(text)}catch{return}let status=stringProperty(payload,"status"),reason=stringProperty(payload,"reason");(status==="error"||status==="action_required")&&reason&&recordCliError({code:reason})}function takeCliError(){let details=recorded;return recorded=void 0,details}var import_chalk3=__toESM(require_source(),1),ansiEscapes2=__toESM(require_ansi_escapes(),1),import_supports_hyperlinks=__toESM(require_supports_hyperlinks(),1);var import_ora=__toESM(require_ora(),1),import_chalk2=__toESM(require_source(),1);function wait(opts,delay=300){let text=opts.text,spinner=null;if(typeof text!="string")throw new Error('"text" is required for Ora spinner');let timeout=setTimeout(()=>{spinner=(0,import_ora.default)(opts),spinner.text=import_chalk2.default.gray(text),spinner.color="gray",spinner.start()},delay),stop=()=>{clearTimeout(timeout),spinner&&(spinner.stop(),spinner=null,process.stderr.write(eraseLines(1)))};return stop.text=text,Object.defineProperty(stop,"text",{get(){return text},set(v){text=v,spinner&&(spinner.text=import_chalk2.default.gray(v))}}),stop}var import_error_utils=__toESM(require_dist(),1);import{inspect}from"util";var chars={tick:process.platform==="win32"?"\u221A":"\u2714",cross:process.platform==="win32"?"\u2613":"\u2718",fatal:process.platform==="win32"?"x":"\u2717",warning:"!"},chars_default=chars;var IS_TEST=process.env.NODE_ENV==="test",defaultChalkColorLevel=0,Output=class{constructor(stream,options={}){this.isDebugEnabled=()=>this.debugEnabled;this.print=str=>{this.colorDisabled&&(str=removeEmoji(str)),this.stopSpinner(),this.stream.write(str)};this.log=(str,color=import_chalk3.default.grey)=>{this.print(`${color(">")} ${str}
|
|
13
13
|
`)};this.dim=(str,color=import_chalk3.default.grey)=>{this.print(`${color(`> ${str}`)}
|
|
14
14
|
`)};this.warn=(str,slug=null,link3=null,action="Learn More")=>{let details=slug?`https://err.sh/vercel/${slug}`:link3;this.print(import_chalk3.default.yellow(import_chalk3.default.bold("WARNING! ")+str+(details?`
|
|
15
15
|
${action}: ${link_default(details)}`:""))),this.print(`
|
|
16
|
-
`)};this.note=str=>{this.log(import_chalk3.default`{yellow.bold NOTE:} ${str}`)};this.error=(str,slug,link3,action="Learn More")=>{this.print(`${import_chalk3.default.red("Error:")} ${str}
|
|
16
|
+
`)};this.note=str=>{this.log(import_chalk3.default`{yellow.bold NOTE:} ${str}`)};this.error=(str,slug,link3,action="Learn More")=>{recordCliError({slug}),this.print(`${import_chalk3.default.red("Error:")} ${str}
|
|
17
17
|
`);let details=slug?`https://err.sh/vercel/${slug}`:link3;details&&this.print(`${import_chalk3.default.bold(action)}: ${link_default(details)}
|
|
18
|
-
`)};this.fatal=str=>{this.print(`${import_chalk3.default.red(chars_default.fatal)} ${str.replace(/\n/g,`
|
|
18
|
+
`)};this.fatal=str=>{recordCliError({}),this.print(`${import_chalk3.default.red(chars_default.fatal)} ${str.replace(/\n/g,`
|
|
19
19
|
`)}
|
|
20
20
|
`)};this.warning=str=>{this.print(`${import_chalk3.default.yellow(chars_default.warning)} ${str.replace(/\n/g,`
|
|
21
21
|
`)}
|
|
22
|
-
`)};this.prettyError=err=>{if(err instanceof Diagnostic){let code=err.name&&err.name!=="Diagnostic"?err.name:void 0,str=code?`${import_chalk3.default.dim(`[${code}]`)} ${(0,import_error_utils.errorToString)(err)}`:(0,import_error_utils.errorToString)(err);err.fix&&(str+=`
|
|
22
|
+
`)};this.prettyError=err=>{if(recordCliError(cliErrorFromUnknown(err)),err instanceof Diagnostic){let code=err.name&&err.name!=="Diagnostic"?err.name:void 0,str=code?`${import_chalk3.default.dim(`[${code}]`)} ${(0,import_error_utils.errorToString)(err)}`:(0,import_error_utils.errorToString)(err);err.fix&&(str+=`
|
|
23
23
|
${import_chalk3.default.bold("Fix:")} ${err.fix}`);let action=err.action;return this.error(str,void 0,err.docs,action??"Learn More")}return this.error((0,import_error_utils.errorToString)(err),void 0,err.link,err.action)};this.ready=str=>{this.print(`${import_chalk3.default.cyan("> Ready!")} ${str}
|
|
24
24
|
`)};this.success=str=>{this.print(`${import_chalk3.default.cyan("> Success!")} ${str}
|
|
25
25
|
`)};this.debug=debug=>{this.debugEnabled&&this.log(`${import_chalk3.default.bold("[debug]")} ${import_chalk3.default.gray(`[${new Date().toISOString()}]`)} ${debugToString(debug)}`)};this.spinner=(message,delay=300)=>{if(this.debugEnabled){this.debug(`Spinner invoked (${message}) with a ${delay}ms delay`);return}IS_TEST||!this.stream.isTTY?this.print(`${message}
|
|
26
|
-
`):(this.spinnerMessage=message,this._spinner?this._spinner.text=message:this._spinner=wait({text:message,stream:this.stream},delay))};this.stopSpinner=()=>{if(this.debugEnabled&&this.spinnerMessage){let msg=`Spinner stopped (${this.spinnerMessage})`;this.spinnerMessage="",this.debug(msg)}this._spinner&&(this._spinner(),this._spinner=null,this.spinnerMessage="")};this.time=async(label,fn)=>{let promise=typeof fn=="function"?fn():fn;if(this.debugEnabled){let startLabel=typeof label=="function"?label():label;this.debug(startLabel);let start=Date.now(),r=await promise,endLabel=typeof label=="function"?label(r):label,duration=Date.now()-start,durationPretty=duration<1e3?`${duration}ms`:`${(duration/1e3).toFixed(2)}s`;return this.debug(`${endLabel} ${import_chalk3.default.gray(`[${durationPretty}]`)}`),r}return promise};this.link=(text,url,{fallback,color=import_chalk3.default.cyan}={})=>this.supportsHyperlink?ansiEscapes2.link(color?color(text):text,url):fallback===!1?link_default(text):typeof fallback=="function"?fallback():`${text} (${link_default(url)})`;this.spinnerMessage="",this._spinner=null,this.initialize({...options,stream})}initialize({stream,debug:debugEnabled,supportsHyperlink,noColor}={}){stream!==void 0&&(this.stream=stream),debugEnabled!==void 0&&(this.debugEnabled=debugEnabled),supportsHyperlink===void 0?this.supportsHyperlink=(0,import_supports_hyperlinks.supportsHyperlink)(this.stream):this.supportsHyperlink=supportsHyperlink,noColor!==void 0&&(this.colorDisabled=getNoColor(noColor),this.colorDisabled?(defaultChalkColorLevel=import_chalk3.default.level,import_chalk3.default.level=0):import_chalk3.default.level=defaultChalkColorLevel)}};function getNoColor(noColorArg){return!!(process.env.FORCE_COLOR==="0"||process.env.NO_COLOR==="1"||noColorArg)}function debugToString(debug){return typeof debug=="string"?debug:inspect(debug)}var output=new Output(process.stderr,{debug:!1}),output_manager_default=output;export{link_default,require_signal_exit,eraseLines,Diagnostic,defineDiagnostics,emoji,prependEmoji,chars_default,output_manager_default,require_build_utils};
|
|
26
|
+
`):(this.spinnerMessage=message,this._spinner?this._spinner.text=message:this._spinner=wait({text:message,stream:this.stream},delay))};this.stopSpinner=()=>{if(this.debugEnabled&&this.spinnerMessage){let msg=`Spinner stopped (${this.spinnerMessage})`;this.spinnerMessage="",this.debug(msg)}this._spinner&&(this._spinner(),this._spinner=null,this.spinnerMessage="")};this.time=async(label,fn)=>{let promise=typeof fn=="function"?fn():fn;if(this.debugEnabled){let startLabel=typeof label=="function"?label():label;this.debug(startLabel);let start=Date.now(),r=await promise,endLabel=typeof label=="function"?label(r):label,duration=Date.now()-start,durationPretty=duration<1e3?`${duration}ms`:`${(duration/1e3).toFixed(2)}s`;return this.debug(`${endLabel} ${import_chalk3.default.gray(`[${durationPretty}]`)}`),r}return promise};this.link=(text,url,{fallback,color=import_chalk3.default.cyan}={})=>this.supportsHyperlink?ansiEscapes2.link(color?color(text):text,url):fallback===!1?link_default(text):typeof fallback=="function"?fallback():`${text} (${link_default(url)})`;this.spinnerMessage="",this._spinner=null,this.initialize({...options,stream})}initialize({stream,debug:debugEnabled,supportsHyperlink,noColor}={}){stream!==void 0&&(this.stream=stream),debugEnabled!==void 0&&(this.debugEnabled=debugEnabled),supportsHyperlink===void 0?this.supportsHyperlink=(0,import_supports_hyperlinks.supportsHyperlink)(this.stream):this.supportsHyperlink=supportsHyperlink,noColor!==void 0&&(this.colorDisabled=getNoColor(noColor),this.colorDisabled?(defaultChalkColorLevel=import_chalk3.default.level,import_chalk3.default.level=0):import_chalk3.default.level=defaultChalkColorLevel)}};function getNoColor(noColorArg){return!!(process.env.FORCE_COLOR==="0"||process.env.NO_COLOR==="1"||noColorArg)}function debugToString(debug){return typeof debug=="string"?debug:inspect(debug)}var output=new Output(process.stderr,{debug:!1}),output_manager_default=output;export{link_default,require_signal_exit,eraseLines,Diagnostic,defineDiagnostics,emoji,prependEmoji,chars_default,UNCLASSIFIED_ERROR_CODE,cliErrorFromUnknown,recordCliError,recordCliErrorFromOutput,takeCliError,output_manager_default,require_build_utils};
|
|
@@ -4,5 +4,5 @@ import { dirname as __dirname_ } from 'node:path';
|
|
|
4
4
|
const require = __createRequire(import.meta.url);
|
|
5
5
|
const __filename = __fileURLToPath(import.meta.url);
|
|
6
6
|
const __dirname = __dirname_(__filename);
|
|
7
|
-
import{require_ms}from"./chunk-QTKJC2O5.js";import{output_manager_default}from"./chunk-
|
|
7
|
+
import{require_ms}from"./chunk-QTKJC2O5.js";import{output_manager_default}from"./chunk-Q2YQSMIB.js";import{__toESM}from"./chunk-6L236MNA.js";var import_ms=__toESM(require_ms(),1);function parseTimeFlag(input){let milliseconds=(0,import_ms.default)(input);if(milliseconds!==void 0)return new Date(Date.now()-milliseconds);let date=new Date(input);if(isNaN(date.getTime()))throw new Error(`Invalid time format "${input}". Use relative (1h, 30m, 2d, 1w) or ISO 8601 datetime.`);return date}function resolveTimeRange(since="1h",until){let startTime=parseTimeFlag(since),endTime=until?parseTimeFlag(until):new Date;return{startTime,endTime}}function validateAllProjectMutualExclusivity(all,project){return all&&project?{valid:!1,code:"MUTUAL_EXCLUSIVITY",message:"Cannot specify both --all and --project. Use one or the other."}:{valid:!0}}function validateTimeBound(input){if(!input)return{valid:!0,value:void 0};try{return{valid:!0,value:parseTimeFlag(input)}}catch(err){return{valid:!1,code:"INVALID_TIME",message:err.message}}}function validateTimeOrder(since,until){return since&&until&&since.getTime()>until.getTime()?{valid:!1,code:"INVALID_TIME_RANGE",message:"`--since` must be earlier than `--until`."}:{valid:!0}}function normalizeRepeatableStringFilters(filters){if(!filters||filters.length===0)return[];let normalized=filters.flatMap(filter=>filter.split(",")).map(filter=>filter.trim()).filter(Boolean);return[...new Set(normalized)]}function validateIntegerRangeWithDefault(value,opts){return value===void 0?{valid:!0,value:opts.defaultValue}:Number.isNaN(value)?{valid:!1,code:"INVALID_LIMIT",message:`Please provide a number for flag \`${opts.flag}\`.`}:!Number.isInteger(value)||value<opts.min||value>opts.max?{valid:!1,code:"INVALID_LIMIT",message:`\`${opts.flag}\` must be an integer between ${opts.min} and ${opts.max}.`}:{valid:!0,value}}function validateOptionalIntegerRange(value,opts){return value===void 0?{valid:!0,value:void 0}:Number.isNaN(value)?{valid:!1,code:opts.code||"INVALID_LIMIT",message:`Please provide a number for flag \`${opts.flag}\`.`}:!Number.isInteger(value)||value<opts.min||value>opts.max?{valid:!1,code:opts.code||"INVALID_LIMIT",message:`\`${opts.flag}\` must be an integer between ${opts.min} and ${opts.max}.`}:{valid:!0,value}}function formatJsonError(code,message){return`${JSON.stringify({error:{code,message}},null,2)}
|
|
8
8
|
`}function writeJsonError(client,code,message){client.stdout.write(formatJsonError(code,message))}var USAGE_ERROR_CODES=new Set(["CONFLICTING_CONTENT","INVALID_AGGREGATION","INVALID_ARGUMENTS","INVALID_ATTACHMENT","INVALID_GRANULARITY","INVALID_GROUP_BY","INVALID_LIMIT","INVALID_RULE_TYPE","INVALID_STATUS","INVALID_THREAD","INVALID_TIME","INVALID_TIME_RANGE","MESSAGE_WITH_MULTIPLE_THREADS","MISSING_ARGUMENT","MISSING_ARGUMENTS","MISSING_CONTENT","MISSING_FLAG","MISSING_THREAD","MUTUAL_EXCLUSIVITY"]);function getExitCodeForErrorCode(code){return USAGE_ERROR_CODES.has(code)?2:1}function outputError(client,jsonOutput,code,message){return jsonOutput?writeJsonError(client,code,message):output_manager_default.error(message),getExitCodeForErrorCode(code)}function handleValidationError(result,jsonOutput,client){return outputError(client,jsonOutput,result.code,result.message)}export{parseTimeFlag,resolveTimeRange,validateAllProjectMutualExclusivity,validateTimeBound,validateTimeOrder,normalizeRepeatableStringFilters,validateIntegerRangeWithDefault,validateOptionalIntegerRange,writeJsonError,getExitCodeForErrorCode,outputError,handleValidationError};
|
|
@@ -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{emitAlertsScopeError,resolveAlertsScope}from"./chunk-
|
|
7
|
+
import{emitAlertsScopeError,resolveAlertsScope}from"./chunk-CR2ZQBDU.js";import{getExitCodeForErrorCode,handleValidationError,validateAllProjectMutualExclusivity}from"./chunk-Q7AYTXUR.js";import{isJSONObject}from"./chunk-ECMWDZTJ.js";import{AGENT_REASON,buildCommandWithGlobalFlags,getExitCodeForReason,outputAgentError}from"./chunk-ONPJXQQ6.js";import{getScope}from"./chunk-THB7KY2N.js";import{getProjectByNameOrId}from"./chunk-3XLK5ZPD.js";import{ProjectNotFound,isAPIError}from"./chunk-NM67DIPQ.js";import{output_manager_default}from"./chunk-Q2YQSMIB.js";async function resolveRulesTeam(client,jsonOutput){let{team}=await getScope(client,{resolveLocalScope:!0});return team?{teamId:team.id}:emitAlertsScopeError(client,jsonOutput,"NO_TEAM","No team context found. Run `vercel switch` to select a team, use `--scope <team>`, or link a team project.",{reason:AGENT_REASON.MISSING_SCOPE,hint:"Alert rules belong to a team. Select the team before retrying.",next:[{command:buildCommandWithGlobalFlags(client.argv,"teams switch"),when:"Select a team"},{command:buildCommandWithGlobalFlags(client.argv,"whoami"),when:"Inspect the current scope"}]})}async function resolveRulesProject(client,projectNameOrId,jsonOutput,command){let teamScope=await resolveRulesTeam(client,jsonOutput);if(typeof teamScope=="number")return teamScope;try{let project=await getProjectByNameOrId(client,projectNameOrId,teamScope.teamId);return project instanceof ProjectNotFound?emitAlertsScopeError(client,jsonOutput,"PROJECT_NOT_FOUND",`Project "${projectNameOrId}" was not found in the selected team.`,{reason:AGENT_REASON.NOT_FOUND,next:[{command:buildCommandWithGlobalFlags(client.argv,`${command} --project <name_or_id>`),when:"Retry with a valid project"}]}):{...teamScope,projectId:project.id,projectName:project.name}}catch(error){if(!isAPIError(error))throw error;return emitAlertsScopeError(client,jsonOutput,error.code||"API_ERROR",error.serverMessage||`API error (${error.status}).`,{reason:error.status===401?"not_authorized":error.status===403?"forbidden":AGENT_REASON.API_ERROR})}}async function parseRulesFlagsAndScope(client,flags,jsonOutput,command="alerts rules ls"){let mutual=validateAllProjectMutualExclusivity(flags["--all"],flags["--project"]);if(!mutual.valid)return outputAgentError(client,{status:"error",reason:AGENT_REASON.INVALID_ARGUMENTS,message:mutual.message,next:[{command:buildCommandWithGlobalFlags(client.argv,"alerts rules --help"),when:"Use either `--project` or `--all`, not both"}]},2),handleValidationError(mutual,jsonOutput,client);if(flags["--all"])return resolveRulesTeam(client,jsonOutput);if(flags["--project"])return resolveRulesProject(client,flags["--project"],jsonOutput,command);let linkedScope=await resolveAlertsScope(client,{jsonOutput,command});if(typeof linkedScope=="number")return linkedScope;let teamScope=await resolveRulesTeam(client,jsonOutput);return typeof teamScope=="number"?teamScope:linkedScope.teamId===teamScope.teamId?linkedScope:teamScope}import{readFileSync}from"fs";import{resolve}from"path";function rulesCollectionPath(teamId,options={}){let query=new URLSearchParams({teamId});return options.limit!==void 0&&query.set("limit",String(options.limit)),options.cursor&&query.set("cursor",options.cursor),options.projectId&&query.set("projectId",options.projectId),options.type&&query.set("type",options.type),`/alerts/v3/alert-rules?${query.toString()}`}function rulesItemPath(teamId,ruleId){let query=new URLSearchParams({teamId});return`/alerts/v3/alert-rules/${encodeURIComponent(ruleId)}?${query.toString()}`}function ruleNotificationsPath(teamId,ruleId){let query=new URLSearchParams({teamId});return`/alerts/v3/alert-rules/${encodeURIComponent(ruleId)}/notifications?${query.toString()}`}function rulesNotificationsPath(teamId,options={}){let query=new URLSearchParams({teamId});return options.limit!==void 0&&query.set("limit",String(options.limit)),options.cursor&&query.set("cursor",options.cursor),`/alerts/v3/alert-rules/notifications?${query.toString()}`}function rulesNotificationLinksPath(teamId,ruleId){let query=new URLSearchParams({teamId});return`/alerts/v3/alert-rules/${encodeURIComponent(ruleId)}/notifications/links?${query.toString()}`}function rulesSchemaPath(teamId,type){let query=new URLSearchParams({teamId});return type&&query.set("type",type),`/alerts/v3/alert-rules/schema?${query.toString()}`}async function fetchRule(client,scope,ruleId){return(await client.fetch(rulesItemPath(scope.teamId,ruleId))).rule}function getIssues(error){return Array.isArray(error.issues)?error.issues.filter(issue=>isJSONObject(issue)&&typeof issue.path=="string"&&typeof issue.message=="string"):[]}function outputRulesError(client,jsonOutput,code,message,options={}){let issues=options.issues??[],issueSummary=issues.slice(0,5).map(issue=>`${issue.path||"body"}: ${issue.message}`).join("; "),exitCode=options.reason!==void 0?getExitCodeForReason(options.reason):getExitCodeForErrorCode(code);return outputAgentError(client,{status:"error",reason:options.reason??AGENT_REASON.INVALID_ARGUMENTS,message,hint:options.hint??(issueSummary||void 0)},exitCode),jsonOutput?client.stdout.write(`${JSON.stringify({error:{code,message,...issues.length?{issues}:{}}},null,2)}
|
|
8
8
|
`):output_manager_default.fatal([message,...issues.map(issue=>` ${issue.path}: ${issue.message}`)].join(`
|
|
9
9
|
`)),exitCode}function handleRulesApiError(client,err,jsonOutput){let message=err.status===401?"You do not have access to alert rules in this team. Ensure your role can manage Alert Rules, or pass --token and --scope.":err.status===403?err.serverMessage||"You do not have permission to manage alert rules in this team.":err.status>=500?`The alert rules endpoint failed (${err.status}). Re-run with --debug and share the x-vercel-id from the failed request.`:err.serverMessage||`API error (${err.status}).`;return outputRulesError(client,jsonOutput,err.code||"API_ERROR",message,{reason:err.status===401?"not_authorized":err.status===403?"forbidden":err.status===404?AGENT_REASON.NOT_FOUND:err.status===429?"rate_limited":AGENT_REASON.API_ERROR,issues:getIssues(err),hint:err.status===401||err.status===403?"Confirm the team with `vercel whoami`; use --scope <team-slug> if the rule belongs to another team.":void 0})}var LEGACY_BODY_FIELDS=["alertTypes","customAlert","queryJsonString"];function readRuleBody(client,bodyPath,jsonOutput){let raw;try{raw=readFileSync(resolve(client.cwd,bodyPath),"utf8")}catch{return outputRulesError(client,jsonOutput,"INVALID_ARGUMENTS",`Could not read --body file: ${bodyPath}`)}let parsed;try{parsed=JSON.parse(raw)}catch{return outputRulesError(client,jsonOutput,"INVALID_ARGUMENTS","Invalid JSON in --body file.")}return isJSONObject(parsed)?LEGACY_BODY_FIELDS.some(field=>Object.hasOwn(parsed,field))?outputRulesError(client,jsonOutput,"LEGACY_ALERT_RULE_BODY","This body uses the previous alert-rules shape. Rewrite it using the current schema.",{hint:"Run `vercel alerts rules schema --type built-in` for examples."}):parsed:outputRulesError(client,jsonOutput,"INVALID_ARGUMENTS","The --body file must contain a JSON object.")}function getBodyType(body){return body.type==="built-in"||body.type==="custom"?body.type:void 0}function emitRulesArgParseError(client,err,recoverWithProjectFlag){let message=err instanceof Error?err.message:String(err),projectFlagMissingArg=message.includes("--project")&&message.includes("requires argument");outputAgentError(client,{status:"error",reason:AGENT_REASON.INVALID_ARGUMENTS,message:projectFlagMissingArg?"`--project` requires a project name or id (for example `--project my-app`).":message,next:[{command:buildCommandWithGlobalFlags(client.argv,projectFlagMissingArg?recoverWithProjectFlag:"alerts rules --help"),when:projectFlagMissingArg?"Retry with a project name or id":"See valid `alerts rules` subcommands"}]},2)}export{resolveRulesTeam,resolveRulesProject,parseRulesFlagsAndScope,rulesCollectionPath,rulesItemPath,ruleNotificationsPath,rulesNotificationsPath,rulesNotificationLinksPath,rulesSchemaPath,fetchRule,outputRulesError,handleRulesApiError,readRuleBody,getBodyType,emitRulesArgParseError};
|
|
@@ -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_json_parse_better_errors}from"./chunk-N6CNMMSZ.js";import{require_lib}from"./chunk-
|
|
7
|
+
import{require_json_parse_better_errors}from"./chunk-N6CNMMSZ.js";import{require_lib}from"./chunk-3XLK5ZPD.js";import{CantParseJSONFile}from"./chunk-NM67DIPQ.js";import{require_dist}from"./chunk-QGIQK47P.js";import{__toESM}from"./chunk-6L236MNA.js";var import_fs_extra=__toESM(require_lib(),1);var import_json_parse_better_errors=__toESM(require_json_parse_better_errors(),1),import_error_utils=__toESM(require_dist(),1);async function readJSONFile(file){let content=await readFileSafe(file);if(content===null)return content;try{return(0,import_json_parse_better_errors.default)(content)}catch(error){return new CantParseJSONFile(file,(0,import_error_utils.errorToString)(error))}}async function readFileSafe(file){try{return await import_fs_extra.default.readFile(file,"utf8")}catch{return null}}export{readJSONFile};
|
|
@@ -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{getEnvTargetPlaceholder}from"./chunk-
|
|
7
|
+
import{getEnvTargetPlaceholder}from"./chunk-LWQVT6YW.js";import{projectOption,yesOption}from"./chunk-5IPBCD7K.js";import{packageName}from"./chunk-FI772UVH.js";var buildCommand={name:"build",aliases:[],description:"Build the project.",arguments:[],options:[{name:"prod",description:"Build a production deployment",shorthand:null,type:Boolean,deprecated:!1},{name:"target",shorthand:null,type:String,argument:"TARGET",deprecated:!1,description:"Specify the target environment"},{name:"output",description:"Directory where built assets will be written to",shorthand:null,argument:"DIR",type:String,deprecated:!1},{...yesOption,description:"Skip the confirmation prompt about pulling environment variables and project settings when not found locally"},{name:"standalone",description:"Create a standalone build with all dependencies inlined into function output folders",shorthand:null,type:Boolean,deprecated:!1},{name:"id",description:"Deployment ID to pull environment variables from (e.g. dpl_xxx)",shorthand:null,type:String,argument:"ID",deprecated:!1},projectOption],examples:[{name:"Build the project",value:`${packageName} build`},{name:"Build the project in a specific directory",value:`${packageName} build --cwd ./path-to-project`},{name:"Build with deployment-scoped environment variables",value:`${packageName} build --id dpl_xxx`}]};var pullCommand={name:"pull",aliases:[],description:"Pull Environment Variables and project settings into .vercel",arguments:[{name:"project-path",required:!1}],options:[{name:"environment",description:"Deployment environment [development]",argument:"TARGET",shorthand:null,type:String,deprecated:!1},{name:"git-branch",description:"Specify the Git branch to pull specific Environment Variables for",argument:"NAME",shorthand:null,type:String,deprecated:!1},{name:"prod",shorthand:null,type:Boolean,deprecated:!1},{...yesOption,description:"Skip questions when setting up new project using default scope and settings"},projectOption],examples:[{name:"Pull the latest Environment Variables and Project Settings from the cloud",value:`${packageName} pull`},{name:"Pull the latest Environment Variables and Project Settings from the cloud targeting a directory",value:`${packageName} pull ./path-to-project`},{name:"Pull for a specific environment",value:`${packageName} pull --environment=${getEnvTargetPlaceholder()}`},{name:"Pull for a preview feature branch",value:`${packageName} pull --environment=preview --git-branch=feature-branch`},{name:"Pull Environment Variables into an application env file with `vercel env pull`",value:`${packageName} env pull`}]};export{buildCommand,pullCommand};
|