vercel 61.1.0 → 62.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/chunks/{add-H5XUOIW4.js → add-HANL3P77.js} +1 -1
- package/dist/chunks/{add-KDIVCEEY.js → add-XNYC3JIL.js} +1 -1
- package/dist/chunks/{add-2QHHI447.js → add-XUAM4VOK.js} +1 -1
- package/dist/chunks/{build-EFC6AC3A.js → build-ZBS6SOT7.js} +1 -1
- package/dist/chunks/{chunk-ARM6TNWM.js → chunk-2RQFMCPJ.js} +1 -1
- package/dist/chunks/{chunk-3PU3JKJU.js → chunk-35QWU4NB.js} +2 -2
- package/dist/chunks/{chunk-5VEVDIX4.js → chunk-3R66O72V.js} +1 -1
- package/dist/chunks/{chunk-HNQC4E2A.js → chunk-4NICAS7W.js} +1 -1
- package/dist/chunks/chunk-4O5TQSWD.js +7 -0
- package/dist/chunks/{chunk-7QZ3V4GA.js → chunk-5VWK73R6.js} +2 -2
- package/dist/chunks/{chunk-EXTNOWQX.js → chunk-64JYKBGN.js} +1 -1
- package/dist/chunks/{chunk-5E6XT7UP.js → chunk-6JU3QZ3O.js} +1 -1
- package/dist/chunks/{chunk-LIQM7J3Q.js → chunk-6MR2VYMC.js} +1 -1
- package/dist/chunks/{chunk-G6DJSRIM.js → chunk-7I23VXBQ.js} +1 -1
- package/dist/chunks/{chunk-SUQDXU5Q.js → chunk-7JFK53D4.js} +1 -1
- package/dist/chunks/{chunk-METJ7TPN.js → chunk-7NSHIG54.js} +1 -1
- package/dist/chunks/{chunk-QKSHLX2T.js → chunk-7PQBWGSI.js} +1 -1
- package/dist/chunks/{chunk-UJRKHDLO.js → chunk-7RT22KMX.js} +1 -1
- package/dist/chunks/{chunk-HNGB3J6J.js → chunk-7T4CJ6MJ.js} +1 -1
- package/dist/chunks/{chunk-C7FA3F6Y.js → chunk-7VSX264O.js} +1 -1
- package/dist/chunks/{chunk-PK44ANGQ.js → chunk-A752WDCH.js} +1 -1
- package/dist/chunks/{chunk-HWPICTAW.js → chunk-ACCZWEKL.js} +1 -1
- package/dist/chunks/{chunk-VCLA7W76.js → chunk-AIMMAROX.js} +2 -2
- package/dist/chunks/{chunk-7K5WQAIL.js → chunk-B7YJLE3P.js} +1 -1
- package/dist/chunks/{chunk-6UV6HXVD.js → chunk-BKNROJQU.js} +1 -1
- package/dist/chunks/{chunk-R4XQKQFD.js → chunk-C3XFIO5L.js} +1 -1
- package/dist/chunks/{chunk-3Y2HZ7ZE.js → chunk-CQ3RAERR.js} +1 -1
- package/dist/chunks/{chunk-GT6CQWQC.js → chunk-CS4QF4YI.js} +1 -1
- package/dist/chunks/{chunk-EMDAZAWN.js → chunk-CVX5X5RI.js} +1 -1
- package/dist/chunks/{chunk-DQKTW6TS.js → chunk-DECRXYX6.js} +1 -1
- package/dist/chunks/{chunk-VRDAMDMZ.js → chunk-FWN57YF7.js} +1 -1
- package/dist/chunks/{chunk-UZCUQNR2.js → chunk-G43DZJ2Z.js} +1 -1
- package/dist/chunks/{chunk-NQKUT3UM.js → chunk-GR76JFDX.js} +1 -1
- package/dist/chunks/{chunk-IJMVTAUG.js → chunk-I327YWUE.js} +1 -1
- package/dist/chunks/{chunk-ZXE4XYIV.js → chunk-ILFUNCJZ.js} +1 -1
- package/dist/chunks/chunk-J6OPPI3A.js +63 -0
- package/dist/chunks/{chunk-B3CNVVZG.js → chunk-JK5Z72G5.js} +1 -1
- package/dist/chunks/{chunk-J4GDZSR6.js → chunk-JLOCNOBV.js} +1 -1
- package/dist/chunks/{chunk-LN3L5MUD.js → chunk-JRU6AGXG.js} +1 -1
- package/dist/chunks/{chunk-HQ3OQQIJ.js → chunk-JVCUTKAX.js} +1 -1
- package/dist/chunks/{chunk-MOZORTXV.js → chunk-K6GIN2TC.js} +1 -1
- package/dist/chunks/{chunk-ZQAKHK55.js → chunk-KOSM3DYE.js} +1 -1
- package/dist/chunks/{chunk-H24CDOLQ.js → chunk-LCWCTL6L.js} +1 -1
- package/dist/chunks/{chunk-TAIDD65X.js → chunk-M7ZGWERO.js} +1 -1
- package/dist/chunks/{chunk-I3JY5FFO.js → chunk-N5Q4IX3H.js} +1 -1
- package/dist/chunks/{chunk-6H37RZR4.js → chunk-N7XPPYQQ.js} +1 -1
- package/dist/chunks/{chunk-OT7KL3CN.js → chunk-NESZV33T.js} +1 -1
- package/dist/chunks/chunk-NKC536ZX.js +9 -0
- package/dist/chunks/{chunk-YIWCEDDM.js → chunk-NT67T6DL.js} +1 -1
- package/dist/chunks/{chunk-UIYOY4VY.js → chunk-NXJLJLEM.js} +1 -1
- package/dist/chunks/{chunk-WWIZKLDF.js → chunk-NYUESPV2.js} +1 -1
- package/dist/chunks/{chunk-7IU5MZY3.js → chunk-OGVFR4VL.js} +1 -1
- package/dist/chunks/{chunk-XGGZRQRW.js → chunk-PV5YI2ZZ.js} +1 -1
- package/dist/chunks/{chunk-QS4HMEHM.js → chunk-QAPUB4EX.js} +1 -1
- package/dist/chunks/{chunk-CMMKTIUX.js → chunk-QMBXEDTG.js} +1 -1
- package/dist/chunks/{chunk-GBPKXYFF.js → chunk-RBYCFVJN.js} +3 -3
- package/dist/chunks/{chunk-6BWY63F2.js → chunk-RFWCEREA.js} +1 -1
- package/dist/chunks/{chunk-FMIOMNT4.js → chunk-S2LBGLRE.js} +1 -1
- package/dist/chunks/{chunk-FUYYSBG6.js → chunk-T4QWSTWE.js} +1 -1
- package/dist/chunks/{chunk-ELOOLQEA.js → chunk-TBLJVTTQ.js} +1 -1
- package/dist/chunks/{chunk-WKZ6JSGZ.js → chunk-TKBORMUF.js} +1 -1
- package/dist/chunks/{chunk-LYGUPV4A.js → chunk-ULYAF4N3.js} +1 -1
- package/dist/chunks/{chunk-FPGLRLJB.js → chunk-V6BHS2M2.js} +1 -1
- package/dist/chunks/{chunk-2UNDQZGO.js → chunk-VDOJERIW.js} +1 -1
- package/dist/chunks/{chunk-P7YEHZCP.js → chunk-W7PVS44H.js} +1 -1
- package/dist/chunks/{chunk-LRARKX6U.js → chunk-X47XV2WG.js} +1 -1
- package/dist/chunks/{chunk-JT3YGQNY.js → chunk-X5OINFLV.js} +1 -1
- package/dist/chunks/{chunk-Y2TKN7DM.js → chunk-XF5HR3BJ.js} +1 -1
- package/dist/chunks/{chunk-APMYUYG3.js → chunk-Y3A7ZJNX.js} +1 -1
- package/dist/chunks/chunk-Z26EOSNI.js +7 -0
- package/dist/chunks/{chunk-MDPHTALV.js → chunk-Z5PMK6F2.js} +4 -4
- package/dist/chunks/{chunk-GS56NXBA.js → chunk-Z6TGFLIO.js} +2 -2
- package/dist/chunks/chunk-ZNFC3CZF.js +7 -0
- package/dist/chunks/{chunk-3QIFLB5M.js → chunk-ZOIPWLUF.js} +1 -1
- package/dist/chunks/{chunk-5XUEYLPX.js → chunk-ZUYWATU5.js} +1 -1
- package/dist/chunks/{clear-XPCPE7IB.js → clear-UYIYBIU7.js} +1 -1
- package/dist/chunks/{compile-vercel-config-T3UH6HUK.js → compile-vercel-config-SRYQK624.js} +1 -1
- package/dist/chunks/{config-57JYCPQE.js → config-6AXT6WNO.js} +1 -1
- package/dist/chunks/{config-RUQTGUAU.js → config-EDC5XGQX.js} +1 -1
- package/dist/chunks/config-validator.mjs +1 -1
- package/dist/chunks/{constants-G4UYVLOF.js → constants-NCE2LWSS.js} +1 -1
- package/dist/chunks/{delete-AQLS65EZ.js → delete-GYK2QMZA.js} +1 -1
- package/dist/chunks/{delete-YEG4PO32.js → delete-PIASS7TQ.js} +1 -1
- package/dist/chunks/{detect-services-O5R4LQYE.js → detect-services-QNPD7J6F.js} +1 -1
- package/dist/chunks/{disable-2IMTXHPN.js → disable-SFNXBFOL.js} +1 -1
- package/dist/chunks/{discard-LGTYXVWA.js → discard-QX7SXCDX.js} +1 -1
- package/dist/chunks/{edit-5SAXFIIQ.js → edit-4U3ZERPO.js} +1 -1
- package/dist/chunks/{edit-FLQUQJRB.js → edit-PNIFJF2H.js} +1 -1
- package/dist/chunks/{enable-ZU4EEGQU.js → enable-HZFCTROZ.js} +1 -1
- package/dist/chunks/{export-YJLMAKU6.js → export-QOTSGWFE.js} +1 -1
- package/dist/chunks/{future-GCRZEKNU.js → future-GS7ZLJ3N.js} +1 -1
- package/dist/chunks/{generate-cert-for-deploy-C2MZFJSD.js → generate-cert-for-deploy-L5NMXX37.js} +1 -1
- package/dist/chunks/{image-TBIQVQTJ.js → image-PY2GZYQD.js} +1 -1
- package/dist/chunks/{import-builders-VIQ3AQKA.js → import-builders-WWYNSGXV.js} +1 -1
- package/dist/chunks/{inspect-DYSG64DM.js → inspect-DKJC7ORF.js} +1 -1
- package/dist/chunks/{inspect-BCJ4576B.js → inspect-EHEMDPJD.js} +1 -1
- package/dist/chunks/{inspect-EJGQIBO6.js → inspect-IIF3N5Z2.js} +1 -1
- package/dist/chunks/{inspect-UBQLT7TK.js → inspect-NIRGPMGV.js} +1 -1
- package/dist/chunks/{inspect-ZY7JD2NB.js → inspect-QQJAYYMO.js} +1 -1
- package/dist/chunks/{list-RSBMDKH3.js → list-4MCOLKTO.js} +1 -1
- package/dist/chunks/{list-ACZ53KGA.js → list-4TZ6QS5J.js} +1 -1
- package/dist/chunks/{list-KILCIYI3.js → list-MMQAS2OQ.js} +1 -1
- package/dist/chunks/{login-XLBBDBF5.js → login-5QOABZRX.js} +1 -1
- package/dist/chunks/{login-LEHHYIMB.js → login-ZAAIOSQ4.js} +1 -1
- package/dist/chunks/{logs-GGM6OIP5.js → logs-KWMWFGLA.js} +1 -1
- package/dist/chunks/{ls-PMZQBH7M.js → ls-42F5OUPY.js} +1 -1
- package/dist/chunks/{ls-UANS2YOR.js → ls-43NFH2L6.js} +1 -1
- package/dist/chunks/{ls-CXCMINIH.js → ls-HKXEYGZT.js} +1 -1
- package/dist/chunks/{ls-EYIOIUW4.js → ls-ID2DGRGG.js} +1 -1
- package/dist/chunks/{ls-7RJVN7NA.js → ls-KAIRQI27.js} +1 -1
- package/dist/chunks/{ls-TZZHYEUP.js → ls-KCE6GJZL.js} +1 -1
- package/dist/chunks/{ls-E52ZQKU2.js → ls-L454FAKC.js} +1 -1
- package/dist/chunks/{mutate-LDKQTMVQ.js → mutate-QK3U73PH.js} +1 -1
- package/dist/chunks/{notifications-TNNPHJ2A.js → notifications-2QARJQFZ.js} +1 -1
- package/dist/chunks/{open-XULXWO4J.js → open-PORNBO4I.js} +1 -1
- package/dist/chunks/{openapi-VOEHNJDC.js → openapi-6L7RIFOR.js} +1 -1
- package/dist/chunks/{permissions-BJCB363U.js → permissions-EYOTCJGO.js} +1 -1
- package/dist/chunks/{prompt-missing-credentials-XYATS6AR.js → prompt-missing-credentials-N7ETDDXW.js} +1 -1
- package/dist/chunks/{publish-RHYABJG2.js → publish-JTCJ6Z5K.js} +1 -1
- package/dist/chunks/pull-FNJGDSP2.js +7 -0
- package/dist/chunks/{purchase-domain-if-available-METET7NV.js → purchase-domain-if-available-IIEFQGPX.js} +1 -1
- package/dist/chunks/{push-K6JZXF3F.js → push-LBPCQFBD.js} +1 -1
- package/dist/chunks/{query-IRE2AHWJ.js → query-CBEGOTEI.js} +1 -1
- package/dist/chunks/{reauthenticate-SKNZW44L.js → reauthenticate-3H5Q2ZWD.js} +1 -1
- package/dist/chunks/{reorder-XA4D4ETX.js → reorder-LLR3OV6E.js} +1 -1
- package/dist/chunks/{reply-2J6FSDE3.js → reply-3CDS6LPX.js} +1 -1
- package/dist/chunks/{resolve-LPG666BQ.js → resolve-XQ6UPCSZ.js} +1 -1
- package/dist/chunks/{restore-AUJYHVXJ.js → restore-U4EWQAAZ.js} +1 -1
- package/dist/chunks/rm-3FAU5JLM.js +8 -0
- package/dist/chunks/{rm-K72H7VZV.js → rm-7OBAUU4F.js} +1 -1
- package/dist/chunks/{rm-ZQVXKO7U.js → rm-WEMHKTUL.js} +1 -1
- package/dist/chunks/{rm-OWKRDHCM.js → rm-XGXSPQIY.js} +1 -1
- package/dist/chunks/{rm-RKSFOTDA.js → rm-XW6CPP6J.js} +1 -1
- package/dist/chunks/{rule-inspect-GLIMHHLI.js → rule-inspect-I6WJTC7O.js} +1 -1
- package/dist/chunks/{rules-DKX7ZITE.js → rules-TMEV52OR.js} +1 -1
- package/dist/chunks/{schema-4I7CTH47.js → schema-4R7CRVMR.js} +1 -1
- package/dist/chunks/schema-W3ZXTSRT.js +14 -0
- package/dist/chunks/{select-org-6HKDVPLO.js → select-org-37C26F7T.js} +1 -1
- package/dist/chunks/set-FOMKZDT2.js +7 -0
- package/dist/chunks/setup-and-link-QI6PHWVL.js +7 -0
- package/dist/chunks/{tags-COAUKFHG.js → tags-BTMFM3XQ.js} +1 -1
- package/dist/chunks/{types-JMTJJVOR.js → types-UN5J66MI.js} +1 -1
- package/dist/chunks/{update-J5LPVY6R.js → update-CA3E2G46.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 +3 -3
- 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 +731 -680
- package/dist/help.js +1 -1
- package/dist/index.js +4 -3
- package/dist/root-help-commands.mjs +1 -0
- package/dist/vc.js +66 -9
- package/dist/version.mjs +1 -1
- package/package.json +54 -54
- package/dist/chunks/chunk-46JKXCHX.js +0 -7
- package/dist/chunks/chunk-FCQ4OFIG.js +0 -7
- package/dist/chunks/chunk-IZPS6TSQ.js +0 -9
- package/dist/chunks/chunk-RYZ5FAUA.js +0 -131
- package/dist/chunks/chunk-XYPCSFQH.js +0 -7
- package/dist/chunks/pull-Z7HGCSCC.js +0 -7
- package/dist/chunks/rm-RUYNLXQI.js +0 -8
- package/dist/chunks/schema-DR4YJJXD.js +0 -14
- package/dist/chunks/set-5B652FAX.js +0 -7
- package/dist/chunks/setup-and-link-YJDTNH73.js +0 -7
|
@@ -1,7 +0,0 @@
|
|
|
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{getGlobalPathConfig}from"./chunk-3Y2HZ7ZE.js";import{require_load_json_file}from"./chunk-RCTYVKM5.js";import{require_types}from"./chunk-GHM7V3GG.js";import{inspectTokenRequest,processInspectTokenResponse}from"./chunk-5XJNPXQK.js";import{parseArguments}from"./chunk-H24CDOLQ.js";import{DEFAULT_VERCEL_CONFIG_FILENAME,VERCEL_CONFIG_EXTENSIONS,VERCEL_DIR,findProjectsFromPath,getLinkFromDir,getRepoLink,getVercelDirectory}from"./chunk-MDPHTALV.js";import{humanizePath}from"./chunk-PPCFQQSU.js";import{require_cli_config}from"./chunk-BRK4OB4B.js";import{getUser}from"./chunk-SM5JI6QM.js";import{getTeamByIdOrSlug}from"./chunk-VOZEB6PD.js";import{ConflictingConfigFiles,DeprecatedNowJson,InvalidLocalConfig,InvalidToken,NowError,TeamDeleted}from"./chunk-RINZXCDJ.js";import{output_manager_default}from"./chunk-EWWFNMPZ.js";import{require_dist}from"./chunk-QGIQK47P.js";import{require_source}from"./chunk-U7KCDTCH.js";import{__toESM}from"./chunk-6L236MNA.js";var import_chalk=__toESM(require_source(),1);function highlight(text){return import_chalk.default.bold.underline(text)}var VERCEL_API_ORIGIN="https://api.vercel.com";async function introspectToken(client){let token=client.authConfig.token;if(!token)throw new Error("No token to introspect");if(new URL(client.apiUrl).origin!==VERCEL_API_ORIGIN)throw new Error("Token introspection is unavailable for custom API origins");let[error,introspection]=await processInspectTokenResponse(await inspectTokenRequest(token));if(error)throw error;return introspection}function isAppPrincipalEnabled(){return!!process.env.APP_PRINCIPAL_ENABLED}function resolveAppFromToken(token){return!token.active||!token.client_id?null:{id:token.client_id,name:token.client_name}}async function resolveAppTokenScope(client,scope){let token=await introspectToken(client).catch(()=>null),app=token?resolveAppFromToken(token):null,team=token?.team;return!app||!team||team.id!==scope&&team.slug!==scope?!1:(client.config.currentTeam=team.id,!0)}import{relative}from"path";var import_cli_config=__toESM(require_cli_config(),1);var import_load_json_file=__toESM(require_load_json_file(),1),config=__toESM(require_cli_config(),1),import_error_utils=__toESM(require_dist(),1),import_types=__toESM(require_types(),1);import{join,basename,dirname}from"path";import{accessSync,constants}from"fs";import{persistCliAuthConfig,readCliAuthConfig}from"@vercel/cli-auth/credentials-store.js";import path from"path";import{existsSync}from"fs";function getLocalPathConfig(prefix,useCompiledConfig=!0){let customPath=parseArguments(process.argv.slice(2),{},{permissive:!0}).flags["--local-config"];if(customPath){if(typeof customPath!="string")throw new InvalidLocalConfig(customPath);return path.resolve(process.cwd(),customPath)}let vercelConfigPath=path.join(prefix,"vercel.json"),vercelTomlPath=path.join(prefix,"vercel.toml"),nowConfigPath=path.join(prefix,"now.json"),vercelConfigExists=existsSync(vercelConfigPath),vercelTomlExists=existsSync(vercelTomlPath),nowConfigExists=existsSync(nowConfigPath),foundConfigs=[];if(vercelConfigExists&&foundConfigs.push(vercelConfigPath),vercelTomlExists&&foundConfigs.push(vercelTomlPath),nowConfigExists)throw new DeprecatedNowJson(nowConfigPath);if(foundConfigs.length>1)throw new ConflictingConfigFiles(foundConfigs);let compiledConfigPath=path.join(prefix,VERCEL_DIR,"vercel.json"),compiledConfigExists=existsSync(compiledConfigPath);return useCompiledConfig&&compiledConfigExists?compiledConfigPath:vercelConfigPath}var VERCEL_DIR2=getGlobalPathConfig(),CONFIG_FILE_PATH=config.getConfigFilePath(VERCEL_DIR2),AUTH_CONFIG_FILE_PATH=config.getAuthConfigFilePath(VERCEL_DIR2),readConfigFile=()=>config.readGlobalConfigFile(CONFIG_FILE_PATH),writeToConfigFile=stuff=>{try{config.writeGlobalConfigFile(CONFIG_FILE_PATH,stuff)}catch(err){throw(0,import_error_utils.isErrnoException)(err)&&((0,import_error_utils.isErrnoException)(err)&&err.code==="EPERM"?(output_manager_default.error(`Not able to create ${highlight(CONFIG_FILE_PATH)} (operation not permitted).`),process.exit(1)):err.code==="EBADF"&&(output_manager_default.error(`Not able to create ${highlight(CONFIG_FILE_PATH)} (bad file descriptor).`),process.exit(1))),err}},readAuthConfigFile=_globalConfig=>({...config.getDefaultAuthConfig(),...readCliAuthConfig(VERCEL_DIR2)}),persistAuthConfig=(authConfig,_globalConfig)=>{try{return persistCliAuthConfig(VERCEL_DIR2,authConfig)}catch(err){let wrappedError=new Error(`Not able to create ${humanizePath(AUTH_CONFIG_FILE_PATH)} (${(0,import_error_utils.errorToStringFriendly)(err)}).`);throw wrappedError.cause=err,wrappedError}};function getConfigFilePath2(){return CONFIG_FILE_PATH}function getAuthConfigFilePath2(){return AUTH_CONFIG_FILE_PATH}function readLocalConfig(prefix=process.cwd()){let config2,target="";try{target=getLocalPathConfig(prefix)}catch(err){if(err instanceof NowError)output_manager_default.error(err.message),process.exit(1);else throw err}if(!target)return;try{accessSync(target,constants.F_OK),config2=import_load_json_file.default.sync(target)}catch(err){if(!((0,import_error_utils.isErrnoException)(err)&&err.code==="ENOENT"))if((0,import_error_utils.isError)(err)&&err.name==="JSONError")output_manager_default.error(err.message),process.exit(1);else if((0,import_error_utils.isErrnoException)(err)){let code=err.code?` (${err.code})`:"";output_manager_default.error(`Failed to read config file: ${target}${code}`),process.exit(1)}else output_manager_default.prettyError(err),process.exit(1)}if(!config2)return;if(basename(target)==="vercel.json"&&basename(dirname(target))===VERCEL_DIR){let workPath=dirname(dirname(target)),sourceFile=null;for(let ext of VERCEL_CONFIG_EXTENSIONS){let configPath=join(workPath,`vercel.${ext}`);try{accessSync(configPath,constants.F_OK),sourceFile=basename(configPath);break}catch{}}if(!sourceFile){let tomlPath=join(workPath,"vercel.toml");try{accessSync(tomlPath,constants.F_OK),sourceFile="vercel.toml"}catch{}}config2[import_types.fileNameSymbol]=sourceFile||DEFAULT_VERCEL_CONFIG_FILENAME}else config2[import_types.fileNameSymbol]=basename(target);return config2}function isEligibleForNativeBinaryAutoOptIn(client){return client.teams?.some(team=>team.slug==="vercel")===!0}function autoOptInNativeBinary(client){let envOverride=process.env.VERCEL_CLI_USE_NATIVE_BINARY;if(!(envOverride==="false"||envOverride==="0"||typeof client.config.useNativeBinary=="boolean"||client.config.nativeBinaryAutoOptIn===!0||!isEligibleForNativeBinaryAutoOptIn(client)))try{let configPath=getConfigFilePath2(),savedConfig=(0,import_cli_config.readGlobalConfigFile)(configPath);if(typeof savedConfig.useNativeBinary=="boolean"||savedConfig.nativeBinaryAutoOptIn===!0)return;let config2={...savedConfig,nativeBinaryAutoOptIn:!0};(0,import_cli_config.writeGlobalConfigFile)(configPath,config2),client.config={...client.config,nativeBinaryAutoOptIn:!0}}catch{output_manager_default.debug("Failed to persist automatic native binary enrollment.")}}async function getScope(client,opts={}){let{user,app,token}=await getPrincipal(client);user&&autoOptInNativeBinary(client);let defaultTeamId=user?.version==="northstar"?user.defaultTeamId:void 0,appTeamId=!user&&app?token?.team?.id:void 0;if(!user&&app&&opts.getTeam===!1)throw new Error("App principal scope resolution requires a team lookup.");!user&&app&&(client.config.currentTeam=appTeamId),!client.config.currentTeam&&defaultTeamId&&(client.config.currentTeam=defaultTeamId);let teamId=client.config.currentTeam||defaultTeamId,team=teamId&&opts.getTeam!==!1?await getTeam(client,teamId):null,contextName=team?.slug||user?.username||user?.email;if(!contextName)throw new Error("Unable to determine context name");return opts.resolveLocalScope?resolveLocalScopeContext(client,{user,app,team}):{contextName,team,user,app}}async function getPrincipal(client){if(!isAppPrincipalEnabled())return{user:await getUser(client),app:null,token:null};let[userResult,tokenResult]=await Promise.allSettled([getUser(client),introspectToken(client)]),token=tokenResult.status==="fulfilled"?tokenResult.value:null,app=token?resolveAppFromToken(token):null;if(userResult.status==="rejected"&&!(app&&userResult.reason instanceof InvalidToken))throw userResult.reason;return{user:userResult.status==="fulfilled"?userResult.value:null,app,token}}async function resolveLocalScopeContext(client,{user,app,team}){let explicitScopeProvided=detectExplicitScope(client),globalTeamId=client.config.currentTeam,{localOrgId,linkedRepo,isCrossTeamRepo}=await findLocalLink(client),isAppPrincipal=!user&&!!app,effectiveLocalOrgId=isAppPrincipal?void 0:localOrgId,scopeMismatch=!!(effectiveLocalOrgId&&globalTeamId&&globalTeamId!==effectiveLocalOrgId);!isAppPrincipal&&!explicitScopeProvided&&!effectiveLocalOrgId&&isCrossTeamRepo&&output_manager_default.warn("This repository has projects across multiple teams. Use `--scope` to specify which team, or `cd` into a project directory.");let resolvedTeam=!explicitScopeProvided&&effectiveLocalOrgId?await applyLocalOrg(client,effectiveLocalOrgId):team,{org,contextName}=resolveOrg(resolvedTeam,user);return{org,contextName,user,team:resolvedTeam,app,globalTeam:team,linkedRepo,isCrossTeamRepo,scopeMismatch,explicitScopeProvided}}async function applyLocalOrg(client,localOrgId){return client.config.currentTeam=localOrgId.startsWith("team_")?localOrgId:void 0,client.config.currentTeam?await getTeamByIdOrSlug(client,client.config.currentTeam):null}async function getTeam(client,teamId){let team=await getTeamByIdOrSlug(client,teamId);if(!team)throw new TeamDeleted;return team}function resolveOrg(team,user){if(team)return{org:{type:"team",id:team.id,slug:team.slug},contextName:team.slug};if(user)return{org:{type:"user",id:user.id,slug:user.username},contextName:user.username||user.email};throw new Error("Unable to determine scope: no team or personal account is available for this token. Use `--scope` to specify a team.")}async function findLocalLink(client){let[projectLink,repoLink]=await Promise.all([findProjectLink(client),findRepoLink(client)]);return{localOrgId:findLocalOrgId(client.cwd,projectLink,repoLink),linkedRepo:repoLink?.repoConfig?{repoConfig:repoLink.repoConfig,rootPath:repoLink.rootPath}:null,isCrossTeamRepo:detectCrossTeamRepo(repoLink?.repoConfig)}}async function findProjectLink(client){try{return await getLinkFromDir(getVercelDirectory(client.cwd))}catch{return null}}async function findRepoLink(client){try{return await getRepoLink(client,client.cwd)}catch{return null}}function findLocalOrgId(cwd,projectLink,repoLink){if(projectLink)return projectLink.orgId;if(repoLink?.repoConfig)return findRepoOrgId(repoLink.repoConfig,relative(repoLink.rootPath,cwd))}function findRepoOrgId(repoConfig,pathFromRepoRoot){let projects=findProjectsFromPath(repoConfig.projects,pathFromRepoRoot),orgIds=new Set(projects.map(p=>p.orgId??repoConfig.orgId??""));if(orgIds.size!==1)return;let[orgId]=orgIds;return orgId||void 0}function detectExplicitScope(client){let argv=client.argv;for(let arg of argv){if(arg==="--")break;if(arg==="--scope"||arg==="--team"||arg.startsWith("--scope=")||arg.startsWith("--team=")||arg==="-S"||arg==="-T")return!0}return!!client.localConfig?.scope}function detectCrossTeamRepo(repoConfig){if(!repoConfig?.projects||repoConfig.projects.length<2)return!1;let orgIds=new Set;for(let project of repoConfig.projects){let orgId=project.orgId??repoConfig.orgId;orgId&&orgIds.add(orgId)}return orgIds.size>1}export{highlight,isAppPrincipalEnabled,resolveAppTokenScope,getScope,detectExplicitScope,getLocalPathConfig,readConfigFile,writeToConfigFile,readAuthConfigFile,persistAuthConfig,getConfigFilePath2 as getConfigFilePath,getAuthConfigFilePath2 as getAuthConfigFilePath,readLocalConfig};
|
|
@@ -1,7 +0,0 @@
|
|
|
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{tracesConfigCommand}from"./chunk-5VEVDIX4.js";import{deploymentOption,projectOption,protectionBypassOption,yesOption}from"./chunk-XGGZRQRW.js";import{packageName}from"./chunk-FI772UVH.js";var spanQueryOptions=[{...projectOption,shorthand:"p"},{name:"environment",shorthand:null,type:String,deprecated:!1,description:"Environment: production or preview (case-insensitive)"},{name:"service",shorthand:null,type:String,deprecated:!1,description:"Filter by service name"},{name:"name",shorthand:null,type:String,deprecated:!1,description:"Filter by span name"},{name:"kind",shorthand:null,type:String,deprecated:!1,description:"Filter by span kind: unspecified (0), internal (1), server (2), client (3), producer (4), consumer (5)"},{name:"status",shorthand:null,type:String,deprecated:!1,description:"Status: error, ok, or unset (case-insensitive)"},{name:"deployment-id",shorthand:null,type:String,deprecated:!1,description:"Filter by deployment ID"},{name:"request-id",shorthand:null,type:String,deprecated:!1,description:"Filter by request ID. Some IDs return 404 in traces get. Reuse --scope and --project. See traces get --help."},{name:"trace-id",shorthand:null,type:String,deprecated:!1,description:"Filter by trace ID"},{name:"span-id",shorthand:null,type:String,deprecated:!1,description:"Filter by span ID"},{name:"root",shorthand:null,type:Boolean,deprecated:!1,description:"Show root spans only"},{name:"since",shorthand:null,type:String,deprecated:!1,description:"Start time: 30m, ISO timestamp, or YYYY-MM-DD UTC (default: 1h)"},{name:"until",shorthand:null,type:String,deprecated:!1,description:"End time: same formats as --since (default: now)"}];var requestIdLookupHelp={title:"Request-ID lookup",body:["A request ID in search results does not guarantee traces get can retrieve the trace. Lookup requires a matching root span in the same project within 30 minutes after the request-ID timestamp.","","If no matching root is found, lookup returns 404. Use the same --scope and --project for search and get."]},getSubcommand={name:"get",aliases:[],default:!0,description:"Fetch a captured trace by request id.",helpSections:[requestIdLookupHelp],arguments:[{name:"requestId",required:!1}],options:[{name:"json",shorthand:null,type:Boolean,deprecated:!1,description:"Print the raw trace JSON to stdout instead of the markdown summary."},{name:"project",shorthand:null,type:String,argument:"NAME|ID",deprecated:!1,description:"Project name or id to fetch the trace from (overrides the linked project)."},{name:"open",shorthand:null,type:Boolean,deprecated:!1,description:"Open the trace in the Vercel Dashboard instead of printing it."},{name:"view",shorthand:null,type:String,argument:"timeline|tree|waterfall",deprecated:!1,description:"Dashboard view to open. Only valid with --open. Defaults to timeline."}],examples:[{name:"Fetch a trace by request id",value:`${packageName} traces get req_1234567890`},{name:"Print the raw trace JSON",value:`${packageName} traces get req_1234567890 --json`},{name:"`get` is the default \u2014 this is equivalent to the above",value:`${packageName} traces req_1234567890`},{name:"Fetch a trace from a specific team and project",value:`${packageName} traces get req_1234567890 --scope my-team --project my-app`},{name:"Open the trace in the Vercel Dashboard",value:`${packageName} traces get req_1234567890 --open`},{name:"Open the trace in the Vercel Dashboard with the waterfall view",value:`${packageName} traces get req_1234567890 --open --view waterfall`}]},createSubcommand={name:"create",aliases:[],description:"Capture a session trace for a request (alias for `vercel curl --trace`).",arguments:[{name:"path",required:!0}],options:[deploymentOption,protectionBypassOption,{name:"json",shorthand:null,type:Boolean,deprecated:!1,description:"Emit { response, requestId } as JSON on stdout"},{...yesOption,description:"Skip the production confirmation prompt (e.g. in non-interactive mode)"}],examples:[{name:"Capture a session trace for a request",value:`${packageName} traces create /api/hello`},{name:"Target a specific deployment",value:`${packageName} traces create /api/status --deployment https://your-project-abc123.vercel.app`},{name:"Pass curl flags after the separator",value:`${packageName} traces create /api/test -- --request POST --data '{"name": "John"}'`}]},searchSubcommand={name:"search",aliases:[],description:"Search project spans. Results are newest first. Duration filters do not sort results.",helpSections:[{title:"Table columns",body:["Available: span.startTime, span.duration, span.name, span.status.code, service.name, environment, request.id, trace.id, span.id, parent.id, span.kind","Default: all except environment, request.id, and span.kind."]},{title:"KQL filters",body:["Fields: project.id, environment, service.name, deployment.id, request.id, user.id, session.id","Span fields: span.name, span.kind, span.id, parent.id, span.isRoot, span.status.code, span.duration","Trace fields: trace.id, trace.state","","Other fields search span attributes first, then resource attributes.","","span.duration uses milliseconds.","span.kind uses the numeric values shown under --kind.","span.status.code uses Error, Ok, or Unset.","Use field:value filters. Plain text search is not supported.","Use NOT to exclude values. End a value with * to match a prefix.","Wrap values with spaces in double quotes. Keep the full query in single quotes."]}],arguments:[],options:[...spanQueryOptions,{name:"limit",shorthand:"n",type:Number,deprecated:!1,description:"Maximum number of spans (default: 100)"},{name:"query",shorthand:"q",type:String,deprecated:!1,description:"Filter spans using KQL"},{name:"columns",shorthand:null,argument:"LIST",type:String,deprecated:!1,description:"Columns to show, in order. Separate names with commas. Cannot be used with --json or --non-interactive."},{name:"json",shorthand:"j",type:Boolean,deprecated:!1,description:"Output one JSON object per line"}],examples:[{name:"Find production errors for one service",value:`${packageName} traces search --environment production --service checkout-api --status error --since 1h`},{name:"Use KQL and output JSON Lines",value:`${packageName} traces search --query 'http.route:"/api/checkout"' --kind server --json`},{name:"Exclude span names starting with app/lib/fetch-api",value:`${packageName} traces search --query 'NOT span.name:app/lib/fetch-api*'`},{name:"Exclude exact span names",value:`${packageName} traces search --query 'NOT span.name:("GET /screenshot/v2" OR "middleware GET")'`},{name:"Find spans longer than 2 seconds",value:`${packageName} traces search --query 'span.duration > 2000' --columns span.startTime,span.duration,span.name,span.kind,span.status.code`}]},tracesCommand={name:"traces",aliases:[],description:"Fetch and search traces captured for a Vercel project.",arguments:[{name:"requestId",required:!1}],subcommands:[getSubcommand,searchSubcommand,createSubcommand,tracesConfigCommand],options:[],examples:[{name:"Fetch a trace by request id",value:`${packageName} traces get req_1234567890`},{name:"Print the raw trace JSON",value:`${packageName} traces get req_1234567890 --json`},{name:"Capture a session trace for a request",value:`${packageName} traces create /api/hello`},{name:"Search recent spans",value:`${packageName} traces search --status error`},{name:"List the trace sampling rules for a project",value:`${packageName} traces config ls`}]};export{getSubcommand,createSubcommand,searchSubcommand,tracesCommand};
|