vercel 59.23.2 → 59.24.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-7Y2KUKBS.js +8 -0
- package/dist/chunks/{add-Z3CJT63N.js → add-AH7CCGI4.js} +1 -1
- package/dist/chunks/add-PZQFNEK6.js +8 -0
- package/dist/chunks/build-J2L7FBF6.js +7 -0
- package/dist/chunks/{chunk-6LE44WCK.js → chunk-5H3QCVK5.js} +1 -1
- package/dist/chunks/{chunk-GRDPI246.js → chunk-66KGIWDY.js} +1 -1
- package/dist/chunks/{chunk-UXCTETFN.js → chunk-6NPXWN5F.js} +1 -1
- package/dist/chunks/{chunk-UWZ5VIIQ.js → chunk-6QNPNUTJ.js} +1 -1
- package/dist/chunks/{chunk-UUM2N6IG.js → chunk-7DNHVDK2.js} +1 -1
- package/dist/chunks/{chunk-JGPECEYY.js → chunk-7S6R3LL4.js} +1 -1
- package/dist/chunks/{chunk-WDVSYGZS.js → chunk-B6RDQTJF.js} +1 -1
- package/dist/chunks/{chunk-6C7LA5RA.js → chunk-BG25VOLN.js} +1 -1
- package/dist/chunks/{chunk-TOGR3HUB.js → chunk-BK7VICZ5.js} +1 -1
- package/dist/chunks/{chunk-GHULCYAR.js → chunk-C5KVTG2O.js} +1 -1
- package/dist/chunks/{chunk-QI3JSWD6.js → chunk-DBABUG2N.js} +1 -1
- package/dist/chunks/{chunk-HOYHUMBD.js → chunk-DPTTW6AM.js} +1 -1
- package/dist/chunks/{chunk-T4AZ3U7O.js → chunk-EUJWN3RB.js} +1 -1
- package/dist/chunks/{chunk-E4X2DH4K.js → chunk-F4PQSGJG.js} +1 -1
- package/dist/chunks/{chunk-2HEC5TDU.js → chunk-FXYCV7SI.js} +1 -1
- package/dist/chunks/{chunk-ZKWM4JBE.js → chunk-HW4QHETG.js} +1 -1
- package/dist/chunks/{chunk-VIR3KDCQ.js → chunk-I46LFJJG.js} +1 -1
- package/dist/chunks/{chunk-SOQ5DE44.js → chunk-J7DOWLLD.js} +1 -1
- package/dist/chunks/{chunk-4YVA7TSY.js → chunk-JPIB7NB6.js} +1 -1
- package/dist/chunks/{chunk-32QBGZ2Z.js → chunk-K2MXVUWY.js} +1 -1
- package/dist/chunks/{chunk-PS645CWM.js → chunk-KE3S2RRY.js} +1 -1
- package/dist/chunks/{chunk-2SLHYWMC.js → chunk-KF62ZVXT.js} +1 -1
- package/dist/chunks/{chunk-TJKM3345.js → chunk-KJ6MUEGB.js} +1 -1
- package/dist/chunks/{chunk-GR3DLKYP.js → chunk-LAKQ6JG3.js} +1 -1
- package/dist/chunks/{chunk-X4X5RB2V.js → chunk-LL2XUFCY.js} +1 -1
- package/dist/chunks/{chunk-ABSRS5KC.js → chunk-LN7DRS3D.js} +1 -1
- package/dist/chunks/chunk-MHDVUE2Q.js +7 -0
- package/dist/chunks/{chunk-RRQTVE2P.js → chunk-MKY5IBKK.js} +1 -1
- package/dist/chunks/{chunk-GGNZLN4R.js → chunk-MQO32DYF.js} +1 -1
- package/dist/chunks/{chunk-GL2AUBAI.js → chunk-MV6LWP5R.js} +1 -1
- package/dist/chunks/{chunk-64NJHVA3.js → chunk-NOYJJRDK.js} +4 -4
- package/dist/chunks/{chunk-M6A7UH4U.js → chunk-NWL3VI5O.js} +2 -2
- package/dist/chunks/{chunk-UGXNE4YE.js → chunk-OI5JAHZK.js} +1 -1
- package/dist/chunks/{chunk-Z6LKARXP.js → chunk-P5EKTDOS.js} +1 -1
- package/dist/chunks/chunk-P7GPJFZ7.js +22 -0
- package/dist/chunks/chunk-PGF7MQK6.js +9 -0
- package/dist/chunks/{chunk-DL665Q3Z.js → chunk-QHKY2XXG.js} +1 -1
- package/dist/chunks/{chunk-Z7PBDQNR.js → chunk-QRBAWXHP.js} +5 -5
- package/dist/chunks/{chunk-73G2MHUX.js → chunk-QYFRPNL2.js} +1 -1
- package/dist/chunks/chunk-RINZXCDJ.js +19 -0
- package/dist/chunks/{chunk-FZH7RIRX.js → chunk-RSHNACJX.js} +2 -2
- package/dist/chunks/{chunk-NZKBBY2A.js → chunk-RYVVD7GM.js} +1 -1
- package/dist/chunks/{chunk-EHTHHCNG.js → chunk-RYZ5FAUA.js} +1 -0
- package/dist/chunks/{chunk-6SA6SOHU.js → chunk-SKAUCH5L.js} +1 -1
- package/dist/chunks/{chunk-V5DCSHYJ.js → chunk-SM5JI6QM.js} +1 -1
- package/dist/chunks/chunk-SQXB2UM4.js +10 -0
- package/dist/chunks/{chunk-66RYR2GI.js → chunk-SURYRPWO.js} +1 -1
- package/dist/chunks/{chunk-EQP3SW72.js → chunk-T4LZS75P.js} +1 -1
- package/dist/chunks/{chunk-ZDORSGCG.js → chunk-U2EJBAGE.js} +1 -1
- package/dist/chunks/{chunk-SFTXBTMI.js → chunk-U7RBKXKN.js} +1 -1
- package/dist/chunks/{chunk-NYOQMU3P.js → chunk-V3YAU6ES.js} +3 -3
- package/dist/chunks/{chunk-KXYR43H5.js → chunk-V62NLRIZ.js} +1 -1
- package/dist/chunks/{chunk-J5X5YRBH.js → chunk-VXPEFLJ6.js} +1 -1
- package/dist/chunks/{chunk-KBKN7EI7.js → chunk-WTMSMKT5.js} +1 -1
- package/dist/chunks/{chunk-7B5NNJ2P.js → chunk-WVXO435I.js} +1 -1
- package/dist/chunks/{chunk-YGJO25LP.js → chunk-X3KGMGDA.js} +1 -1
- package/dist/chunks/{chunk-4WSAOLBH.js → chunk-XQQGQ55A.js} +1 -1
- package/dist/chunks/{chunk-FB5TMOLQ.js → chunk-XU5QGRSL.js} +1 -1
- package/dist/chunks/{chunk-GTJ2OLYI.js → chunk-YOQFHAWX.js} +1 -1
- package/dist/chunks/clear-K7ORVDOX.js +8 -0
- package/dist/chunks/{compile-vercel-config-ZFMPTU47.js → compile-vercel-config-JNODRT2C.js} +1 -1
- package/dist/chunks/{config-HLVJQKP7.js → config-JTA2VZHH.js} +1 -1
- package/dist/chunks/config-RWVPD75M.js +8 -0
- package/dist/chunks/{connect-git-provider-P3SGOW6X.js → connect-git-provider-VYU65KTS.js} +1 -1
- package/dist/chunks/delete-2TO7EK2C.js +10 -0
- package/dist/chunks/delete-KB2GQRD2.js +9 -0
- package/dist/chunks/{detect-projects-WLAFT5HC.js → detect-projects-BTDKBOU4.js} +1 -1
- package/dist/chunks/{detect-services-YYT3LUUX.js → detect-services-S4EMRGXM.js} +1 -1
- package/dist/chunks/disable-OECXCINH.js +7 -0
- package/dist/chunks/discard-TQ2BYSPA.js +14 -0
- package/dist/chunks/edit-GJY2Q7DK.js +8 -0
- package/dist/chunks/edit-OARSMUGS.js +9 -0
- package/dist/chunks/enable-CHWCHWYK.js +7 -0
- package/dist/chunks/{export-QCBAQNTT.js → export-ZKRSU23G.js} +1 -1
- package/dist/chunks/future-7RNP7ZP6.js +7 -0
- package/dist/chunks/{generate-cert-for-deploy-U7JF3HF3.js → generate-cert-for-deploy-SNWO4UCL.js} +1 -1
- package/dist/chunks/image-XJJMFNS3.js +7 -0
- package/dist/chunks/{import-builders-IFZM44NL.js → import-builders-BJTHQZFZ.js} +1 -1
- package/dist/chunks/{inspect-CPOFKE4X.js → inspect-GUUFDCF6.js} +1 -1
- package/dist/chunks/inspect-KL6E4NYB.js +13 -0
- package/dist/chunks/{inspect-EMWJLBAW.js → inspect-OFHABZ6D.js} +1 -1
- package/dist/chunks/inspect-PAQAACPV.js +9 -0
- package/dist/chunks/{inspect-IVJOEZC4.js → inspect-SZ4HH7QY.js} +1 -1
- package/dist/chunks/{list-ZE2VPPXI.js → list-O5E5ZYAN.js} +1 -1
- package/dist/chunks/list-R3UBCTNJ.js +11 -0
- package/dist/chunks/{list-KYZNCXBM.js → list-W2TEW25J.js} +1 -1
- package/dist/chunks/{login-RMAISH4F.js → login-FA3ZCLNA.js} +1 -1
- package/dist/chunks/login-NN7X6ATG.js +9 -0
- package/dist/chunks/{logs-3LTU2N25.js → logs-XXEVORNG.js} +1 -1
- package/dist/chunks/{ls-HWUYP3XY.js → ls-6DBJ4O2U.js} +1 -1
- package/dist/chunks/{ls-DU5QTKKA.js → ls-GNZ5XC5V.js} +1 -1
- package/dist/chunks/{ls-Y4QR3I6O.js → ls-I7TEWFFI.js} +1 -1
- package/dist/chunks/{ls-4M2OBNG6.js → ls-OC2YVP7U.js} +1 -1
- package/dist/chunks/{ls-P6LKMT33.js → ls-Q6TGKOW6.js} +1 -1
- package/dist/chunks/{ls-AKGRKWHM.js → ls-WTAMOBVG.js} +1 -1
- package/dist/chunks/{ls-7O63WIES.js → ls-X53N2CIG.js} +1 -1
- package/dist/chunks/{mutate-KOAALPIL.js → mutate-TYDZXN6D.js} +1 -1
- package/dist/chunks/notifications-ISH6L4LN.js +7 -0
- package/dist/chunks/open-NP6JK7D3.js +7 -0
- package/dist/chunks/{openapi-DKMCRF2V.js → openapi-QJEB6PRW.js} +1 -1
- package/dist/chunks/permissions-CDHSBRVG.js +7 -0
- package/dist/chunks/{prompt-missing-credentials-QY4MZDT6.js → prompt-missing-credentials-FX2H3SHO.js} +1 -1
- package/dist/chunks/{publish-YXVJXBQT.js → publish-JZHSWOHM.js} +1 -1
- package/dist/chunks/pull-MCOEV5HI.js +7 -0
- package/dist/chunks/{purchase-domain-if-available-74ZYVVBE.js → purchase-domain-if-available-G7SE7C2F.js} +1 -1
- package/dist/chunks/push-XSQNASL2.js +7 -0
- package/dist/chunks/{query-PHAGR43V.js → query-3GCRJN4Q.js} +1 -1
- package/dist/chunks/reauthenticate-QYJGKCGV.js +7 -0
- package/dist/chunks/reorder-DHP3CTN2.js +10 -0
- package/dist/chunks/reply-WKPVJAWP.js +9 -0
- package/dist/chunks/resolve-QF5SMBPD.js +12 -0
- package/dist/chunks/{restore-MO4B2EQV.js → restore-A5UQIGNA.js} +1 -1
- package/dist/chunks/{rm-SZ4HWA4R.js → rm-FIZ56DQC.js} +1 -1
- package/dist/chunks/{rm-GMG2DZOV.js → rm-L5KYP6JP.js} +1 -1
- package/dist/chunks/rm-MRIJKX4E.js +8 -0
- package/dist/chunks/rm-VQ2ESDWM.js +8 -0
- package/dist/chunks/rm-WEOLZ2OC.js +8 -0
- package/dist/chunks/routes-IPGKJ2E4.js +1 -1
- package/dist/chunks/{rule-inspect-JKAXOBII.js → rule-inspect-WY667VBH.js} +1 -1
- package/dist/chunks/rules-7PJ5PHRB.js +7 -0
- package/dist/chunks/{schema-5CZLK6NI.js → schema-HCHBRZFG.js} +1 -1
- package/dist/chunks/{schema-S2ZAREKF.js → schema-KWNBTTXA.js} +1 -1
- package/dist/chunks/select-org-JEXIDHLI.js +7 -0
- package/dist/chunks/{set-PIKLGKT6.js → set-BRG2L4NA.js} +1 -1
- package/dist/chunks/setup-and-link-R6IRKMYF.js +7 -0
- package/dist/chunks/tags-Y5KMBUYT.js +7 -0
- package/dist/chunks/{types-H3B56MH6.js → types-L37GS4JI.js} +1 -1
- package/dist/chunks/{update-5HE4X45O.js → update-GITCTREW.js} +1 -1
- package/dist/commands/build/index.js +1 -1
- package/dist/commands/deploy/index.js +4 -4
- package/dist/commands/dev/index.js +2 -2
- package/dist/commands/env/index.js +1 -1
- package/dist/commands/link/index.js +1 -1
- package/dist/commands/list/index.js +1 -1
- package/dist/commands-bulk.js +97 -89
- package/dist/help.js +1 -1
- package/dist/index.js +2 -2
- package/dist/version.mjs +1 -1
- package/package.json +20 -20
- package/dist/chunks/add-JVSHQKWC.js +0 -8
- package/dist/chunks/add-UKFIETLE.js +0 -8
- package/dist/chunks/build-SMQYQX23.js +0 -7
- package/dist/chunks/chunk-5YA32S6K.js +0 -7
- package/dist/chunks/chunk-BX5KDMLT.js +0 -10
- package/dist/chunks/chunk-LKI6FRNM.js +0 -19
- package/dist/chunks/chunk-TBBU37TD.js +0 -9
- package/dist/chunks/chunk-WHYH7DVI.js +0 -20
- package/dist/chunks/clear-6IXTTZO6.js +0 -8
- package/dist/chunks/config-XXHMPW46.js +0 -8
- package/dist/chunks/delete-52QKO73X.js +0 -10
- package/dist/chunks/delete-6VOUZDIR.js +0 -9
- package/dist/chunks/disable-7FGR2S56.js +0 -7
- package/dist/chunks/discard-XKPTY3DC.js +0 -14
- package/dist/chunks/edit-A3HJCNPW.js +0 -8
- package/dist/chunks/edit-A7WGTO6K.js +0 -9
- package/dist/chunks/enable-NGKLGHJ2.js +0 -7
- package/dist/chunks/future-BB7OE645.js +0 -7
- package/dist/chunks/image-DU7GJZR2.js +0 -7
- package/dist/chunks/inspect-PHUMEO4A.js +0 -9
- package/dist/chunks/inspect-Q7OVSWFO.js +0 -13
- package/dist/chunks/list-G4JM2TYX.js +0 -11
- package/dist/chunks/login-AVVJFLSC.js +0 -9
- package/dist/chunks/notifications-3RDFNJSD.js +0 -7
- package/dist/chunks/open-VD4F6MAO.js +0 -7
- package/dist/chunks/permissions-AE5JO26V.js +0 -7
- package/dist/chunks/pull-QLC2CV4J.js +0 -7
- package/dist/chunks/push-TMPPU5NU.js +0 -7
- package/dist/chunks/reauthenticate-O6C2AW3J.js +0 -7
- package/dist/chunks/reorder-OAJ3NXQQ.js +0 -10
- package/dist/chunks/reply-Q3JFRFA3.js +0 -9
- package/dist/chunks/resolve-XXJVOXNE.js +0 -12
- package/dist/chunks/rm-63LFH6NA.js +0 -8
- package/dist/chunks/rm-F2XD2XKB.js +0 -8
- package/dist/chunks/rm-P6KA5RSP.js +0 -8
- package/dist/chunks/rules-6TZ6GSKT.js +0 -7
- package/dist/chunks/select-org-F2A5JJFH.js +0 -7
- package/dist/chunks/setup-and-link-O5QSQ5K2.js +0 -7
- package/dist/chunks/tags-C3HWJLJ4.js +0 -7
|
@@ -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_lib}from"./chunk-
|
|
7
|
+
import{require_lib}from"./chunk-NOYJJRDK.js";import{humanizePath}from"./chunk-PPCFQQSU.js";import{output_manager_default}from"./chunk-EWWFNMPZ.js";import{require_source}from"./chunk-U7KCDTCH.js";import{__toESM}from"./chunk-6L236MNA.js";var import_fs_extra=__toESM(require_lib(),1),import_chalk=__toESM(require_source(),1);import{homedir}from"os";import{resolve,sep}from"path";async function validateRootDirectory(cwd,path,errorSuffix=""){let pathStat=await(0,import_fs_extra.lstat)(path).catch(()=>null),suffix=errorSuffix?` ${errorSuffix}`:"";if(!pathStat)return output_manager_default.error(`The provided path ${import_chalk.default.cyan(`\u201C${humanizePath(path)}\u201D`)} does not exist.${suffix}`),!1;if(!pathStat.isDirectory())return output_manager_default.error(`The provided path ${import_chalk.default.cyan(`\u201C${humanizePath(path)}\u201D`)} is a file, but expected a directory.${suffix}`),!1;let base=resolve(cwd),target=resolve(path);return target!==base&&!target.startsWith(base+sep)?(output_manager_default.error(`The provided path ${import_chalk.default.cyan(`\u201C${humanizePath(path)}\u201D`)} is outside of the project.${suffix}`),!1):!0}async function validatePaths(client,paths){if(paths.length>1)return output_manager_default.error("Can't deploy more than one path."),{valid:!1,exitCode:1};let path=paths[0],pathStat=await(0,import_fs_extra.lstat)(path).catch(()=>null);return pathStat?pathStat.isDirectory()?path===homedir()&&!await client.input.confirm("You are deploying your home directory. Do you want to continue?",!1)?(output_manager_default.print(`Canceled
|
|
8
8
|
`),{valid:!1,exitCode:0}):{valid:!0,path}:(output_manager_default.prettyError({message:"Support for single file deployments has been removed.",link:"https://vercel.link/no-single-file-deployments"}),{valid:!1,exitCode:1}):(output_manager_default.error(`Could not find ${import_chalk.default.cyan(`\u201C${humanizePath(path)}\u201D`)}`),{valid:!1,exitCode:1})}export{validateRootDirectory,validatePaths};
|
|
@@ -0,0 +1,22 @@
|
|
|
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{require_open}from"./chunk-ULLWCOYC.js";import{getTeams}from"./chunk-I46LFJJG.js";import{deviceAccessTokenRequest,deviceAuthorizationRequest,isOAuthError,processDeviceAuthorizationResponse,processTokenResponse}from"./chunk-5XJNPXQK.js";import{printError}from"./chunk-PGF7MQK6.js";import{humanizePath}from"./chunk-PPCFQQSU.js";import{getUser}from"./chunk-SM5JI6QM.js";import{getCommandName}from"./chunk-FI772UVH.js";import{emoji,output_manager_default}from"./chunk-EWWFNMPZ.js";import{require_ansi_escapes}from"./chunk-7HL2RPUO.js";import{require_source}from"./chunk-U7KCDTCH.js";import{__toESM}from"./chunk-6L236MNA.js";var import_chalk=__toESM(require_source(),1),open=__toESM(require_open(),1),import_ansi_escapes=__toESM(require_ansi_escapes(),1);import readline from"node:readline";import{KNOWN_AGENTS}from"@vercel/detect-agent";async function updateCurrentTeamAfterLogin(client,ssoTeamId){if(ssoTeamId)client.config.currentTeam=ssoTeamId;else{let user=null;try{user=await getUser(client)}catch{return output_manager_default.error("Failed to fetch the logged in user. Please try again."),1}user.version==="northstar"&&user.defaultTeamId?client.config.currentTeam=user.defaultTeamId:delete client.config.currentTeam}}function getSignupVerificationUrl(verificationUriComplete,email){let deviceUrl=new URL(verificationUriComplete),signupUrl=new URL("/signup",deviceUrl.origin);return signupUrl.searchParams.set("email",email),signupUrl.searchParams.set("autoSubmit","1"),signupUrl.searchParams.set("next",`${deviceUrl.pathname}${deviceUrl.search}`),signupUrl.toString()}async function performDeviceCodeFlow(client,options){let deviceAuthorizationResponse=await deviceAuthorizationRequest({refresh_token:options?.refreshToken,acr_values:options?.acrValues});output_manager_default.debug(`'Device Authorization response:', ${await deviceAuthorizationResponse.clone().text()}`);let[deviceAuthorizationError,deviceAuthorization]=await processDeviceAuthorizationResponse(deviceAuthorizationResponse);if(deviceAuthorizationError)return options?.fallbackToLoginOnStepUpFailure&&options.refreshToken&&isOAuthError(deviceAuthorizationError)&&(deviceAuthorizationError.code==="invalid_grant"||deviceAuthorizationError.code==="invalid_scope")?(output_manager_default.debug(`Step-up device authorization failed: ${deviceAuthorizationError.cause.message}`),output_manager_default.log("Couldn't refresh the saved login. Starting a new login."),performDeviceCodeFlow(client,options.teamId?{teamId:options.teamId}:void 0)):(printError(isOAuthError(deviceAuthorizationError)?deviceAuthorizationError.cause:deviceAuthorizationError),null);let{device_code,user_code,verification_uri,expiresAt,interval}=deviceAuthorization,{verification_uri_complete}=deviceAuthorization;if(options?.teamId){let url=new URL(verification_uri_complete);url.searchParams.set("team_id",options.teamId),verification_uri_complete=url.toString()}let isCursorAgent=client.agentName===KNOWN_AGENTS.CURSOR||client.agentName===KNOWN_AGENTS.CURSOR_CLI,shouldSkipBrowser=process.env.CI&&!isCursorAgent,browserUrl=verification_uri_complete;if(options?.signupEmail?(browserUrl=getSignupVerificationUrl(verification_uri_complete,options.signupEmail),output_manager_default.log(`
|
|
8
|
+
Visit ${import_chalk.default.bold(output_manager_default.link(new URL(browserUrl).host+"/signup",browserUrl,{color:!1,fallback:()=>browserUrl}))} to create your account with ${import_chalk.default.bold(options.signupEmail)} (device code ${import_chalk.default.bold(user_code)}).
|
|
9
|
+
`)):output_manager_default.log(`
|
|
10
|
+
Visit ${import_chalk.default.bold(output_manager_default.link(verification_uri.replace("https://",""),verification_uri_complete,{color:!1,fallback:()=>verification_uri_complete}))}${output_manager_default.supportsHyperlink?` and enter ${import_chalk.default.bold(user_code)}`:""}
|
|
11
|
+
`),!shouldSkipBrowser)try{(await open.default(browserUrl)).on("error",error=>{output_manager_default.debug(`Failed to open browser: ${error}`)})}catch(error){output_manager_default.debug(`Failed to open browser: ${error}`),client.isAgent&&client.nonInteractive&&(output_manager_default.log(`
|
|
12
|
+
${import_chalk.default.yellow("\u26A0")} ${import_chalk.default.bold("Browser could not be opened automatically.")}
|
|
13
|
+
`),output_manager_default.log(`Please ask the user to manually visit the URL above and complete the authentication process.
|
|
14
|
+
`))}let rl=readline.createInterface({input:process.stdin,output:process.stdout}).on("SIGINT",()=>{process.exit(0)});output_manager_default.spinner("Waiting for authentication...");let intervalMs=interval*1e3,result=null,flowError=new Error("Timed out waiting for authentication. Please try again.");async function pollForToken(){for(;Date.now()<expiresAt;){let[tokenResponseError,tokenResponse]=await deviceAccessTokenRequest({device_code});if(tokenResponseError){if(tokenResponseError.message.includes("timeout")){intervalMs*=2,output_manager_default.debug(`Connection timeout. Slowing down, polling every ${intervalMs/1e3}s...`),await wait(intervalMs);continue}return tokenResponseError}output_manager_default.debug(`'Device Access Token response:', ${await tokenResponse.clone().text()}`);let[tokensError,tokens]=await processTokenResponse(tokenResponse);if(isOAuthError(tokensError)){let{code}=tokensError;switch(code){case"authorization_pending":await wait(intervalMs);continue;case"slow_down":intervalMs+=5*1e3,output_manager_default.debug(`Authorization server requests to slow down. Polling every ${intervalMs/1e3}s...`),await wait(intervalMs);continue;default:return tokensError.cause}}if(tokensError)return tokensError;output_manager_default.print((0,import_ansi_escapes.eraseLines)(2)),result={access_token:tokens.access_token,expires_in:tokens.expires_in,refresh_token:tokens.refresh_token};return}}return flowError=await pollForToken(),output_manager_default.stopSpinner(),rl.close(),flowError?(printError(flowError),null):result}async function login(client,telemetry,standalone=!0){let tokens=await performDeviceCodeFlow(client);return tokens?(await saveDeviceCodeTokens(client,tokens),standalone?output_manager_default.print(`
|
|
15
|
+
${import_chalk.default.cyan("Congratulations!")} You are now signed in.
|
|
16
|
+
|
|
17
|
+
To deploy something, run ${getCommandName()}.
|
|
18
|
+
To set up the Vercel plugin and connect your coding agents to the AI Gateway, run ${getCommandName("setup")}.
|
|
19
|
+
|
|
20
|
+
${emoji("tip")} To deploy every commit automatically,
|
|
21
|
+
connect a Git Repository (${import_chalk.default.bold(output_manager_default.link("vercel.link/git","https://vercel.link/git",{color:!1}))}).
|
|
22
|
+
`):output_manager_default.success("Logged in."),telemetry.trackState("success"),0):(telemetry.trackState("error"),1)}async function saveDeviceCodeTokens(client,tokens){let previousTeamId=client.config.currentTeam;if(client.updateAuthConfig({token:tokens.access_token,userId:void 0,expiresAt:Math.floor(Date.now()/1e3)+tokens.expires_in,refreshToken:tokens.refresh_token}),previousTeamId){let isMember=!0;try{isMember=(await getTeams(client)).some(team=>team.id===previousTeamId)}catch{}isMember||(output_manager_default.warn("Your previously selected team is no longer accessible; switching to your default scope."),client.updateConfig({currentTeam:void 0}),await updateCurrentTeamAfterLogin(client))}else client.updateConfig({currentTeam:void 0}),await updateCurrentTeamAfterLogin(client);client.persistAuthConfig(),client.writeToConfigFile(),output_manager_default.debug(`Saved credentials in "${humanizePath(client.getGlobalPathConfig())}"`)}async function wait(intervalMs){await new Promise(resolve=>setTimeout(resolve,intervalMs))}export{getSignupVerificationUrl,performDeviceCodeFlow,login,saveDeviceCodeTokens};
|
|
@@ -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{buildCorrectedCommand,isArgumentError}from"./chunk-EUJWN3RB.js";import{getErrorRecovery,shouldEmitNonInteractiveCommandError,trackAgentError,writeAgentError}from"./chunk-SQXB2UM4.js";import{parseRetryAfterHeaderAsMillis,require_bytes}from"./chunk-RINZXCDJ.js";import{getCommandName}from"./chunk-FI772UVH.js";import{output_manager_default}from"./chunk-EWWFNMPZ.js";import{pkg_default}from"./chunk-AVSPFBLM.js";import{require_source}from"./chunk-U7KCDTCH.js";import{__toESM}from"./chunk-6L236MNA.js";var import_chalk=__toESM(require_source(),1);var import_bytes=__toESM(require_bytes(),1);async function responseError(res,fallbackMessage=null,parsedBody={}){let message="",bodyError;if(res.status>=400&&res.status<500){let body;try{body=await res.json()}catch{body=parsedBody}bodyError=body.error||body.err||{},message=bodyError.message}message||(message=fallbackMessage===null?"Response Error":fallbackMessage);let err=new Error(`${message} (${res.status})`);if(err.status=res.status,err.serverMessage=message,bodyError)for(let field of Object.keys(bodyError))field!=="message"&&(err[field]=bodyError[field]);if(res.status===429||res.status===503){let parsed=parseRetryAfterHeaderAsMillis(res.headers.get("Retry-After"));err.retryAfterMs=parsed??(res.status===429?0:void 0)}return err}function toEnumerableError(err){let enumerable={};enumerable.name=err.name;for(let key of Object.getOwnPropertyNames(err))enumerable[key]=err[key];return enumerable}function printError(error2,client){typeof error2=="string"&&(error2=new Error(error2));let apiError=error2,{message,stack,status,code,sizeLimit}=apiError,argumentError=isArgumentError(error2)?error2:void 0,suggestion=argumentError?.suggestedOption&&argumentError.invalidOption,correction=suggestion&&client&&argumentError?buildCorrectedCommand(client.argv,argumentError.invalidOption,argumentError.suggestedOption,argumentError.flagsSpecification):void 0,recovery=getErrorRecovery(apiError,client),reason=status===403?"forbidden":status===402?"payment_required":status===401?"not_authorized":status===429?"rate_limited":code==="ARG_UNKNOWN_OPTION"?"invalid_arguments":"api_error",hint=argumentError?.allowedOptions?`Vercel CLI ${pkg_default.version} accepts: ${argumentError.allowedOptions.join(", ")}.${suggestion?` Did you mean ${argumentError.suggestedOption}?`:""}`:recovery.hint;if(client&&(status||argumentError?.allowedOptions)){let payload={...recovery,status:"error",reason,message:apiError.serverMessage||message,hint,...argumentError?.allowedOptions&&{allowedOptions:argumentError.allowedOptions,suggestedOption:argumentError.suggestedOption,cliVersion:pkg_default.version},...correction&&{next:[{command:correction,when:correction.includes("<")?"Replace placeholders with the intended values, then run the corrected command":"Run the corrected command"}]}};if(shouldEmitNonInteractiveCommandError(client)){output_manager_default.stopSpinner(),writeAgentError(client,payload);return}trackAgentError(client,payload)}if(hint){output_manager_default.stopSpinner(),output_manager_default.fatal(apiError.serverMessage||message||"The request failed."),output_manager_default.print(` ${hint}
|
|
8
|
+
`),correction&&output_manager_default.print(` ${correction}
|
|
9
|
+
`);return}output_manager_default.debug(`handling error: ${stack}`),message!=="User force closed the prompt with 0 null"&&(status===403?output_manager_default.error(message||`Authentication error. Run ${getCommandName("login")} to log-in again.`):status===429?output_manager_default.error(message):code==="size_limit_exceeded"?output_manager_default.error(`File size limit exceeded (${(0,import_bytes.default)(sizeLimit)})`):message?output_manager_default.prettyError(apiError):status===500?output_manager_default.error("Unexpected server error. Please retry."):code==="USER_ABORT"?output_manager_default.log("Canceled"):output_manager_default.error(`Unexpected error. Please try again later. (${message})`))}export{responseError,toEnumerableError,printError};
|
|
@@ -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{parseArguments}from"./chunk-
|
|
7
|
+
import{parseArguments}from"./chunk-EUJWN3RB.js";import{VERCEL_DIR}from"./chunk-NOYJJRDK.js";import{ConflictingConfigFiles,DeprecatedNowJson,InvalidLocalConfig}from"./chunk-RINZXCDJ.js";import path from"path";import{existsSync}from"fs";function getLocalPathConfig(prefix){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");return existsSync(compiledConfigPath)?compiledConfigPath:vercelConfigPath}export{getLocalPathConfig};
|