vercel 63.1.0 → 63.1.2

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.
Files changed (133) hide show
  1. package/dist/chunks/{add-FNCCXJZO.js → add-LFJBSEHE.js} +1 -1
  2. package/dist/chunks/{add-CCFBYKZH.js → add-WX7XBOMM.js} +1 -1
  3. package/dist/chunks/{add-LU5TSLJU.js → add-YAWFEGID.js} +1 -1
  4. package/dist/chunks/{build-PUIFBQKZ.js → build-FIPVJJWA.js} +1 -1
  5. package/dist/chunks/{chunk-VLSSMFTF.js → chunk-26KRNEYD.js} +1 -1
  6. package/dist/chunks/{chunk-IMC63GXI.js → chunk-2GTCIOCB.js} +1 -1
  7. package/dist/chunks/{chunk-SZRSBECO.js → chunk-46XQIXL7.js} +1 -1
  8. package/dist/chunks/chunk-5DXCVG5U.js +10 -0
  9. package/dist/chunks/{chunk-HWYHRPWP.js → chunk-67N2NJCF.js} +1 -1
  10. package/dist/chunks/{chunk-OB5XGIDM.js → chunk-6LZ72MNE.js} +1 -1
  11. package/dist/chunks/{chunk-SKTP7MSL.js → chunk-7I57HOA6.js} +1 -1
  12. package/dist/chunks/{chunk-36EFWYTN.js → chunk-7Z4JCYS6.js} +1 -1
  13. package/dist/chunks/{chunk-6TEFVB2U.js → chunk-ACGKBCXE.js} +1 -1
  14. package/dist/chunks/{chunk-WJ4VNTE3.js → chunk-AVRYIQRF.js} +1 -1
  15. package/dist/chunks/{chunk-7SGM233C.js → chunk-BW64GZ3E.js} +1 -1
  16. package/dist/chunks/{chunk-RV77ZW7T.js → chunk-DJDT2SUM.js} +1 -1
  17. package/dist/chunks/{chunk-D7KEDMBF.js → chunk-DO4GPDKO.js} +1 -1
  18. package/dist/chunks/{chunk-EDVP7QUI.js → chunk-EGZIRI5B.js} +1 -1
  19. package/dist/chunks/{chunk-IFNTXDX2.js → chunk-G2JKENQU.js} +1 -1
  20. package/dist/chunks/{chunk-MT4MO7DT.js → chunk-G64N3I5W.js} +1 -1
  21. package/dist/chunks/{chunk-YAPHSZJ7.js → chunk-GNY6U33Z.js} +2 -2
  22. package/dist/chunks/{chunk-X5GP2FBT.js → chunk-HVNIW32A.js} +1 -1
  23. package/dist/chunks/{chunk-Y35RMGOU.js → chunk-I4NK2P2D.js} +1 -1
  24. package/dist/chunks/{chunk-MZ6DNAVL.js → chunk-IADIPNJO.js} +1 -1
  25. package/dist/chunks/{chunk-SWJYZETA.js → chunk-IOJYYPUF.js} +3 -3
  26. package/dist/chunks/{chunk-XKDY4OFQ.js → chunk-IVUYULMP.js} +1 -1
  27. package/dist/chunks/{chunk-JYFYL3ON.js → chunk-JV4URBEA.js} +1 -1
  28. package/dist/chunks/{chunk-BIFAR2CO.js → chunk-L3S26YTM.js} +1 -1
  29. package/dist/chunks/{chunk-ZH4DW3T3.js → chunk-LZAGJ3QI.js} +1 -1
  30. package/dist/chunks/{chunk-TUJ3WXOZ.js → chunk-ME6DBVQG.js} +1 -1
  31. package/dist/chunks/{chunk-PLG4UIV4.js → chunk-ME75ZZW7.js} +1 -1
  32. package/dist/chunks/{chunk-JORUFFOD.js → chunk-MHQ2MW2B.js} +3 -3
  33. package/dist/chunks/{chunk-FU7KGU6V.js → chunk-MJR564B4.js} +1 -1
  34. package/dist/chunks/{chunk-RIPCUZO6.js → chunk-MS576PZ7.js} +1 -1
  35. package/dist/chunks/{chunk-6OUBLFZ2.js → chunk-MYY36NBW.js} +1 -1
  36. package/dist/chunks/{chunk-GAG42XNF.js → chunk-NUPLQVP3.js} +1 -1
  37. package/dist/chunks/{chunk-OPVNMCAF.js → chunk-OBRNACWW.js} +1 -1
  38. package/dist/chunks/{chunk-6BE4D57F.js → chunk-OKS442LQ.js} +1 -1
  39. package/dist/chunks/{chunk-7V2F5IUY.js → chunk-Q3SWLXLO.js} +1 -1
  40. package/dist/chunks/{chunk-PR7SYJVT.js → chunk-Q7ZF7MBI.js} +1 -1
  41. package/dist/chunks/{chunk-KCQERNQX.js → chunk-QCG6Q33G.js} +1 -1
  42. package/dist/chunks/{chunk-NUITF4GR.js → chunk-R4TMZGV5.js} +1 -1
  43. package/dist/chunks/{chunk-A6RRKSD3.js → chunk-RZTGPQFR.js} +1 -1
  44. package/dist/chunks/{chunk-AHSMFZWH.js → chunk-TAAV7L3T.js} +1 -1
  45. package/dist/chunks/{chunk-3TJDVDDJ.js → chunk-TEHMKMPG.js} +1 -1
  46. package/dist/chunks/{chunk-R6OWQQMZ.js → chunk-UPXIQO57.js} +1 -1
  47. package/dist/chunks/{chunk-KG3OGJ3U.js → chunk-VUILLFZ6.js} +1 -1
  48. package/dist/chunks/{chunk-T6GXMIXO.js → chunk-WDJFZM7U.js} +1 -1
  49. package/dist/chunks/{chunk-K5GYV5CW.js → chunk-WJEAGH4K.js} +1 -1
  50. package/dist/chunks/{chunk-3YQVBYQD.js → chunk-WKTIAVGU.js} +1 -1
  51. package/dist/chunks/{chunk-T3PAZMDW.js → chunk-WXWBB7LP.js} +1 -1
  52. package/dist/chunks/{chunk-I7FGFRN3.js → chunk-YCV465P5.js} +1 -1
  53. package/dist/chunks/{chunk-ZQBMRI57.js → chunk-YDRNDY2V.js} +2 -2
  54. package/dist/chunks/{clear-E6TSPA67.js → clear-ZEWRQLJR.js} +1 -1
  55. package/dist/chunks/{compile-vercel-config-2HBWORW5.js → compile-vercel-config-66TMMPL5.js} +1 -1
  56. package/dist/chunks/{config-MTH57FUD.js → config-LDTDOVVC.js} +1 -1
  57. package/dist/chunks/{config-NWNQSZNZ.js → config-V7SAJGMS.js} +1 -1
  58. package/dist/chunks/{delete-NIPKCWUT.js → delete-5WC3BAXY.js} +1 -1
  59. package/dist/chunks/{delete-MZ4LAS3L.js → delete-QVG74P23.js} +1 -1
  60. package/dist/chunks/{detect-projects-3CQ6ANGU.js → detect-projects-FTGWHOTA.js} +1 -1
  61. package/dist/chunks/{detect-services-5CVG24CL.js → detect-services-QPBLJZGR.js} +1 -1
  62. package/dist/chunks/{disable-YZATFLNR.js → disable-MJP72BUH.js} +1 -1
  63. package/dist/chunks/{discard-B5IFVCDR.js → discard-GHJO6HJ7.js} +1 -1
  64. package/dist/chunks/{edit-EDTBD7PX.js → edit-ELV6KOAC.js} +1 -1
  65. package/dist/chunks/{edit-3PKYF5FY.js → edit-MCMKL3PG.js} +1 -1
  66. package/dist/chunks/{enable-AKGADEKU.js → enable-NJV7TP3E.js} +1 -1
  67. package/dist/chunks/{export-NKCN63SF.js → export-OFXKWFKJ.js} +1 -1
  68. package/dist/chunks/{future-AQR2QP74.js → future-TTQX6P2J.js} +1 -1
  69. package/dist/chunks/{generate-cert-for-deploy-UNRGDROB.js → generate-cert-for-deploy-H5CIDNMW.js} +1 -1
  70. package/dist/chunks/{image-IQJVHHAW.js → image-2V2VJOSJ.js} +1 -1
  71. package/dist/chunks/{import-builders-4K4WE66I.js → import-builders-K3AX56WJ.js} +1 -1
  72. package/dist/chunks/{inspect-4DASZGPR.js → inspect-3YVNC464.js} +1 -1
  73. package/dist/chunks/{inspect-2UUTLI4H.js → inspect-7YQ3GVZK.js} +1 -1
  74. package/dist/chunks/{inspect-FVB5P54P.js → inspect-SEHUG246.js} +1 -1
  75. package/dist/chunks/{inspect-IU2VMHWZ.js → inspect-SLCLHRCE.js} +1 -1
  76. package/dist/chunks/{inspect-GKZFZINR.js → inspect-ZNSHEHOX.js} +1 -1
  77. package/dist/chunks/{list-TL7VBVR5.js → list-AKLXWJVE.js} +1 -1
  78. package/dist/chunks/{list-OYT6T3TA.js → list-QWTJ5GEV.js} +1 -1
  79. package/dist/chunks/{list-5LMFTD7U.js → list-TFJSUTGX.js} +1 -1
  80. package/dist/chunks/{login-PFAKA6JO.js → login-2RXKHHR7.js} +1 -1
  81. package/dist/chunks/{login-UWL7N6ZS.js → login-DTYYE77N.js} +1 -1
  82. package/dist/chunks/{logs-4FOJKWAW.js → logs-RI5TPLZS.js} +1 -1
  83. package/dist/chunks/{ls-VNOGQ64O.js → ls-62IGNDVX.js} +1 -1
  84. package/dist/chunks/{ls-H7YO6MS5.js → ls-KPDMEX3M.js} +1 -1
  85. package/dist/chunks/{ls-VFV23YCF.js → ls-O6RYA4QE.js} +1 -1
  86. package/dist/chunks/{ls-B3D7XA2S.js → ls-PDGT4IYT.js} +1 -1
  87. package/dist/chunks/{ls-SJDE4U7I.js → ls-RT2GW7GQ.js} +1 -1
  88. package/dist/chunks/{ls-SXE2THDP.js → ls-SWSNZDIB.js} +1 -1
  89. package/dist/chunks/{ls-6TRT3UFZ.js → ls-XBWZZIZW.js} +1 -1
  90. package/dist/chunks/{mutate-IGC37SCR.js → mutate-4QF5LX5H.js} +1 -1
  91. package/dist/chunks/{notifications-47EDEA5C.js → notifications-EZWNVZIY.js} +1 -1
  92. package/dist/chunks/{open-NP444BUR.js → open-ZOCLC6EL.js} +1 -1
  93. package/dist/chunks/{openapi-LW24FRTC.js → openapi-WDPDBK6G.js} +1 -1
  94. package/dist/chunks/{permissions-CP57O3II.js → permissions-WZ74DZVX.js} +1 -1
  95. package/dist/chunks/{prompt-missing-credentials-C3OIQONK.js → prompt-missing-credentials-EU3KK3J4.js} +1 -1
  96. package/dist/chunks/{publish-5TK3IVYM.js → publish-M6VGADUV.js} +1 -1
  97. package/dist/chunks/{pull-FCQKXYBD.js → pull-HE4HZUJO.js} +1 -1
  98. package/dist/chunks/{purchase-domain-if-available-QBDRKJZ5.js → purchase-domain-if-available-YK7ZK4OQ.js} +1 -1
  99. package/dist/chunks/{push-SIR5XTJN.js → push-AXG4E43Q.js} +1 -1
  100. package/dist/chunks/{query-IEBWCCMJ.js → query-LSTTTOQM.js} +1 -1
  101. package/dist/chunks/{reauthenticate-XSNRCXPC.js → reauthenticate-S6DCF7RS.js} +1 -1
  102. package/dist/chunks/{reorder-TPLZXSRB.js → reorder-4G2JILHR.js} +1 -1
  103. package/dist/chunks/{reply-BCDQQ6I2.js → reply-MDSF5FRG.js} +1 -1
  104. package/dist/chunks/{resolve-VKJAE7KO.js → resolve-JFM5IA7H.js} +1 -1
  105. package/dist/chunks/{restore-TZAXCNLL.js → restore-DGXZYLLN.js} +1 -1
  106. package/dist/chunks/{rm-TTZBAVUG.js → rm-3CXFYPYT.js} +1 -1
  107. package/dist/chunks/{rm-A2NTZ4EJ.js → rm-56YVF7VJ.js} +1 -1
  108. package/dist/chunks/{rm-DPVWWH4Q.js → rm-72VFNBSP.js} +1 -1
  109. package/dist/chunks/{rm-V4M46PRZ.js → rm-OAN2XZOH.js} +1 -1
  110. package/dist/chunks/{rm-53HZ5XOQ.js → rm-WFK724PU.js} +1 -1
  111. package/dist/chunks/{rule-inspect-5QXLEJZA.js → rule-inspect-C6FZRTXY.js} +1 -1
  112. package/dist/chunks/{rules-2SBYOL6R.js → rules-5EKUX5OX.js} +1 -1
  113. package/dist/chunks/{schema-OGGOD3HX.js → schema-6LPADSVE.js} +1 -1
  114. package/dist/chunks/{schema-PGGJZ2AT.js → schema-LM6XGKQS.js} +1 -1
  115. package/dist/chunks/{select-org-VBP5DCYP.js → select-org-MARKOFHY.js} +1 -1
  116. package/dist/chunks/{set-6BCSH3I3.js → set-MTKMZ2YS.js} +1 -1
  117. package/dist/chunks/{setup-and-link-FPGTZUH6.js → setup-and-link-KMD3ZLHN.js} +1 -1
  118. package/dist/chunks/{tags-77REB4BF.js → tags-SXRDMEPO.js} +1 -1
  119. package/dist/chunks/{types-4C5N66YA.js → types-K73TDN7C.js} +1 -1
  120. package/dist/chunks/{update-7BNVIJWB.js → update-QSNT3MDG.js} +1 -1
  121. package/dist/commands/build/index.js +1 -1
  122. package/dist/commands/deploy/index.js +6 -6
  123. package/dist/commands/dev/index.js +2 -2
  124. package/dist/commands/env/index.js +1 -1
  125. package/dist/commands/link/index.js +1 -1
  126. package/dist/commands/list/index.js +1 -1
  127. package/dist/commands-bulk.js +28 -28
  128. package/dist/index.js +2 -2
  129. package/dist/internal-build.js +1 -1
  130. package/dist/root-help-commands.mjs +1 -1
  131. package/dist/version.mjs +1 -1
  132. package/package.json +56 -56
  133. package/dist/chunks/chunk-5YQP44VL.js +0 -10
@@ -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{printProjectNotFoundError}from"./chunk-3YQVBYQD.js";import{performDeviceCodeFlow}from"./chunk-I7FGFRN3.js";import{param}from"./chunk-3G3FQYMW.js";import{buildCommandWithYes,outputActionRequired}from"./chunk-5YQP44VL.js";import{detectExplicitScope}from"./chunk-HWYHRPWP.js";import{getLinkedProject,resolveProjectCwd}from"./chunk-SWJYZETA.js";import{isAPIError}from"./chunk-YIIPBH2D.js";import{getCommandName,getCommandNamePlain}from"./chunk-JESNVRVR.js";import{output_manager_default}from"./chunk-75IAMKGV.js";import{URLSearchParams}from"url";var RECOVERABLE_CHALLENGE_CODES=new Set(["challenge_required","challenge_required_email_otp","user_auth_required"]);async function withEnvChallengeRecovery(client,fn){let hadStoredSession=!!(client.authConfig.token||client.authConfig.refreshToken);try{return await fn()}catch(error){if(!isAPIError(error))throw error;let isRecoverableChallenge=RECOVERABLE_CHALLENGE_CODES.has(error.code),isRejectedStoredSession=hadStoredSession&&error.invalidToken===!0;if(!isRecoverableChallenge&&!isRejectedStoredSession||client.authConfig.tokenSource||!client.stdin.isTTY||client.nonInteractive)throw error;output_manager_default.stopSpinner(),output_manager_default.log("Sensitive Environment Variables require fresh authentication.");let refreshToken=client.authConfig.refreshToken,acrValues=getAcrValuesFromWWWAuthenticate(error.wwwAuthenticate),tokens=isRecoverableChallenge&&refreshToken&&acrValues?await performDeviceCodeFlow(client,{refreshToken,acrValues,fallbackToLoginOnStepUpFailure:!0}):await performDeviceCodeFlow(client);if(!tokens)throw error;return client.updateAuthConfig({token:tokens.access_token,userId:void 0,expiresAt:Math.floor(Date.now()/1e3)+tokens.expires_in,refreshToken:tokens.refresh_token}),client.persistAuthConfig(),await fn()}}function getAcrValuesFromWWWAuthenticate(header){if(!header)return;let bearerIndex=header.toLowerCase().indexOf("bearer");if(bearerIndex===-1)return;let match=header.slice(bearerIndex+6).match(/(?:^|[,\s])acr_values=(?:"((?:\\.|[^"\\])*)"|([^,\s]+))/i);return match?.[1]?.replace(/\\(.)/g,"$1")??match?.[2]}async function getEnvRecords(client,projectId,source,{target,gitBranch,decrypt}={}){output_manager_default.debug(`Fetching Environment Variables of project ${projectId} and target ${target}`);let query=new URLSearchParams;if(target){let targetParam="target";target!=="production"&&target!=="preview"&&target!=="development"&&(targetParam="customEnvironmentId"),query.set(targetParam,target)}gitBranch&&query.set("gitBranch",gitBranch),decrypt&&query.set("decrypt",decrypt.toString()),source&&query.set("source",source);let url=`/v10/projects/${projectId}/env?${query}`;return withEnvChallengeRecovery(client,()=>client.fetch(url))}async function pullEnvRecords(client,projectIdOrDeploymentId,source,{target,gitBranch}={}){output_manager_default.debug(`Fetching Environment Variables of ${projectIdOrDeploymentId} and target ${target}`);let query=new URLSearchParams,url=`/v3/env/pull/${projectIdOrDeploymentId}`;return projectIdOrDeploymentId.startsWith("dpl_")||target&&(url+=`/${encodeURIComponent(target)}`,gitBranch&&(url+=`/${encodeURIComponent(gitBranch)}`)),source&&query.set("source",source),Array.from(query).length>0&&(url+=`?${query}`),withEnvChallengeRecovery(client,()=>client.fetch(url))}var parseEnv=env=>{if(!env)return{};if(typeof env=="string"&&(env=[env]),Array.isArray(env)){let startingDict={};return env.reduce((o,e)=>{let key,value,equalsSign=e.indexOf("=");return equalsSign===-1?key=e:(key=e.slice(0,equalsSign),value=e.slice(equalsSign+1)),o[key]=value,o},startingDict)}return env};async function ensureLink(commandName,client,cwd,opts={}){opts.singleFile||(cwd=await resolveProjectCwd(cwd));let link=opts.link,nonInteractive=opts.nonInteractive??client.nonInteractive??!1;if(opts.nonInteractive=nonInteractive,link||(opts.forceDelete?link={status:"not_linked",org:null,project:null}:link=await getLinkedProject(client,{cwd,projectName:opts.projectName,projectNameIsExplicit:!!(opts.projectName&&opts.failIfNotFound),scopeIsExplicit:detectExplicitScope(client),allowOwnerLookupFallback:opts.allowOwnerLookupFallback,skipOwnerLookup:opts.skipOwnerLookup,skipRemoteLookup:opts.skipRemoteLookup,skipProjectRootResolution:!!opts.singleFile}),opts.link=link),link.status==="linked"&&opts.forceDelete||link.status==="not_linked"){if(link.status==="not_linked"&&opts.failIfNotFound&&opts.projectName)return await printProjectNotFoundError(client,opts.projectName,commandName,link.orgId),1;if(link.status==="not_linked"&&opts.requireExistingLink)return output_manager_default.error(`Project is not linked. Run ${getCommandName("link")} first.`),1;let{default:setupAndLink}=await import("./setup-and-link-FPGTZUH6.js");if(link=await setupAndLink(client,cwd,opts),link.status==="not_linked")return 0}return link.status==="error"?(link.reason==="HEADLESS"&&(nonInteractive?outputActionRequired(client,{status:"action_required",reason:"confirmation_required",message:`Command ${getCommandNamePlain(commandName)} requires confirmation. Use option --yes to confirm.`,next:[{command:buildCommandWithYes(client.argv),when:"Confirm and run"}]},link.exitCode):output_manager_default.error(`Command ${getCommandName(commandName)} requires confirmation. Use option ${param("--yes")} to confirm.`)),nonInteractive&&process.exit(link.exitCode),link.exitCode):link}export{getEnvRecords,pullEnvRecords,parseEnv,ensureLink};
7
+ import{printProjectNotFoundError}from"./chunk-WKTIAVGU.js";import{performDeviceCodeFlow}from"./chunk-YCV465P5.js";import{param}from"./chunk-3G3FQYMW.js";import{buildCommandWithYes,outputActionRequired}from"./chunk-5DXCVG5U.js";import{detectExplicitScope}from"./chunk-67N2NJCF.js";import{getLinkedProject,resolveProjectCwd}from"./chunk-IOJYYPUF.js";import{isAPIError}from"./chunk-YIIPBH2D.js";import{getCommandName,getCommandNamePlain}from"./chunk-JESNVRVR.js";import{output_manager_default}from"./chunk-75IAMKGV.js";import{URLSearchParams}from"url";var RECOVERABLE_CHALLENGE_CODES=new Set(["challenge_required","challenge_required_email_otp","user_auth_required"]);async function withEnvChallengeRecovery(client,fn){let hadStoredSession=!!(client.authConfig.token||client.authConfig.refreshToken);try{return await fn()}catch(error){if(!isAPIError(error))throw error;let isRecoverableChallenge=RECOVERABLE_CHALLENGE_CODES.has(error.code),isRejectedStoredSession=hadStoredSession&&error.invalidToken===!0;if(!isRecoverableChallenge&&!isRejectedStoredSession||client.authConfig.tokenSource||!client.stdin.isTTY||client.nonInteractive)throw error;output_manager_default.stopSpinner(),output_manager_default.log("Sensitive Environment Variables require fresh authentication.");let refreshToken=client.authConfig.refreshToken,acrValues=getAcrValuesFromWWWAuthenticate(error.wwwAuthenticate),tokens=isRecoverableChallenge&&refreshToken&&acrValues?await performDeviceCodeFlow(client,{refreshToken,acrValues,fallbackToLoginOnStepUpFailure:!0}):await performDeviceCodeFlow(client);if(!tokens)throw error;return client.updateAuthConfig({token:tokens.access_token,userId:void 0,expiresAt:Math.floor(Date.now()/1e3)+tokens.expires_in,refreshToken:tokens.refresh_token}),client.persistAuthConfig(),await fn()}}function getAcrValuesFromWWWAuthenticate(header){if(!header)return;let bearerIndex=header.toLowerCase().indexOf("bearer");if(bearerIndex===-1)return;let match=header.slice(bearerIndex+6).match(/(?:^|[,\s])acr_values=(?:"((?:\\.|[^"\\])*)"|([^,\s]+))/i);return match?.[1]?.replace(/\\(.)/g,"$1")??match?.[2]}async function getEnvRecords(client,projectId,source,{target,gitBranch,decrypt}={}){output_manager_default.debug(`Fetching Environment Variables of project ${projectId} and target ${target}`);let query=new URLSearchParams;if(target){let targetParam="target";target!=="production"&&target!=="preview"&&target!=="development"&&(targetParam="customEnvironmentId"),query.set(targetParam,target)}gitBranch&&query.set("gitBranch",gitBranch),decrypt&&query.set("decrypt",decrypt.toString()),source&&query.set("source",source);let url=`/v10/projects/${projectId}/env?${query}`;return withEnvChallengeRecovery(client,()=>client.fetch(url))}async function pullEnvRecords(client,projectIdOrDeploymentId,source,{target,gitBranch}={}){output_manager_default.debug(`Fetching Environment Variables of ${projectIdOrDeploymentId} and target ${target}`);let query=new URLSearchParams,url=`/v3/env/pull/${projectIdOrDeploymentId}`;return projectIdOrDeploymentId.startsWith("dpl_")||target&&(url+=`/${encodeURIComponent(target)}`,gitBranch&&(url+=`/${encodeURIComponent(gitBranch)}`)),source&&query.set("source",source),Array.from(query).length>0&&(url+=`?${query}`),withEnvChallengeRecovery(client,()=>client.fetch(url))}var parseEnv=env=>{if(!env)return{};if(typeof env=="string"&&(env=[env]),Array.isArray(env)){let startingDict={};return env.reduce((o,e)=>{let key,value,equalsSign=e.indexOf("=");return equalsSign===-1?key=e:(key=e.slice(0,equalsSign),value=e.slice(equalsSign+1)),o[key]=value,o},startingDict)}return env};async function ensureLink(commandName,client,cwd,opts={}){opts.singleFile||(cwd=await resolveProjectCwd(cwd));let link=opts.link,nonInteractive=opts.nonInteractive??client.nonInteractive??!1;if(opts.nonInteractive=nonInteractive,link||(opts.forceDelete?link={status:"not_linked",org:null,project:null}:link=await getLinkedProject(client,{cwd,projectName:opts.projectName,projectNameIsExplicit:!!(opts.projectName&&opts.failIfNotFound),scopeIsExplicit:detectExplicitScope(client),allowOwnerLookupFallback:opts.allowOwnerLookupFallback,skipOwnerLookup:opts.skipOwnerLookup,skipRemoteLookup:opts.skipRemoteLookup,skipProjectRootResolution:!!opts.singleFile}),opts.link=link),link.status==="linked"&&opts.forceDelete||link.status==="not_linked"){if(link.status==="not_linked"&&opts.failIfNotFound&&opts.projectName)return await printProjectNotFoundError(client,opts.projectName,commandName,link.orgId),1;if(link.status==="not_linked"&&opts.requireExistingLink)return output_manager_default.error(`Project is not linked. Run ${getCommandName("link")} first.`),1;let{default:setupAndLink}=await import("./setup-and-link-KMD3ZLHN.js");if(link=await setupAndLink(client,cwd,opts),link.status==="not_linked")return 0}return link.status==="error"?(link.reason==="HEADLESS"&&(nonInteractive?outputActionRequired(client,{status:"action_required",reason:"confirmation_required",message:`Command ${getCommandNamePlain(commandName)} requires confirmation. Use option --yes to confirm.`,next:[{command:buildCommandWithYes(client.argv),when:"Confirm and run"}]},link.exitCode):output_manager_default.error(`Command ${getCommandName(commandName)} requires confirmation. Use option ${param("--yes")} to confirm.`)),nonInteractive&&process.exit(link.exitCode),link.exitCode):link}export{getEnvRecords,pullEnvRecords,parseEnv,ensureLink};