convex 1.48.0-alpha.0 → 1.48.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.
Files changed (353) hide show
  1. package/CHANGELOG.md +28 -4
  2. package/README.md +1 -1
  3. package/dist/browser.bundle.js +1 -1
  4. package/dist/browser.bundle.js.map +1 -1
  5. package/dist/cjs/bundler/context.js +5 -7
  6. package/dist/cjs/bundler/context.js.map +2 -2
  7. package/dist/cjs/bundler/fs.js +6 -47
  8. package/dist/cjs/bundler/fs.js.map +2 -2
  9. package/dist/cjs/cli/aiFiles.js +26 -4
  10. package/dist/cjs/cli/aiFiles.js.map +2 -2
  11. package/dist/cjs/cli/configure.js +2 -15
  12. package/dist/cjs/cli/configure.js.map +2 -2
  13. package/dist/cjs/cli/env.js +6 -3
  14. package/dist/cjs/cli/env.js.map +2 -2
  15. package/dist/cjs/cli/envDefault.js +5 -2
  16. package/dist/cjs/cli/envDefault.js.map +2 -2
  17. package/dist/cjs/cli/lib/aiFiles/guidelinesmd.js +2 -1
  18. package/dist/cjs/cli/lib/aiFiles/guidelinesmd.js.map +2 -2
  19. package/dist/cjs/cli/lib/aiFiles/index.js +13 -2
  20. package/dist/cjs/cli/lib/aiFiles/index.js.map +2 -2
  21. package/dist/cjs/cli/lib/aiFiles/skills.js +6 -5
  22. package/dist/cjs/cli/lib/aiFiles/skills.js.map +2 -2
  23. package/dist/cjs/cli/lib/aiFiles/state.js +1 -1
  24. package/dist/cjs/cli/lib/aiFiles/state.js.map +1 -1
  25. package/dist/cjs/cli/lib/components.js +12 -2
  26. package/dist/cjs/cli/lib/components.js.map +2 -2
  27. package/dist/cjs/cli/lib/deployApi/startPush.js +42 -1
  28. package/dist/cjs/cli/lib/deployApi/startPush.js.map +2 -2
  29. package/dist/cjs/cli/lib/deployment.js +0 -2
  30. package/dist/cjs/cli/lib/deployment.js.map +2 -2
  31. package/dist/cjs/cli/lib/deploymentSelection.js +18 -27
  32. package/dist/cjs/cli/lib/deploymentSelection.js.map +2 -2
  33. package/dist/cjs/cli/lib/env.js +9 -1
  34. package/dist/cjs/cli/lib/env.js.map +2 -2
  35. package/dist/cjs/cli/lib/envvars.js +0 -32
  36. package/dist/cjs/cli/lib/envvars.js.map +2 -2
  37. package/dist/cjs/cli/lib/fsUtils.js +1 -1
  38. package/dist/cjs/cli/lib/fsUtils.js.map +2 -2
  39. package/dist/cjs/cli/lib/generateDocs.js +1 -1
  40. package/dist/cjs/cli/lib/generateDocs.js.map +1 -1
  41. package/dist/cjs/cli/lib/localDeployment/dashboard.js +11 -1
  42. package/dist/cjs/cli/lib/localDeployment/dashboard.js.map +2 -2
  43. package/dist/cjs/cli/lib/localDeployment/download.js +16 -1
  44. package/dist/cjs/cli/lib/localDeployment/download.js.map +2 -2
  45. package/dist/cjs/cli/lib/localDeployment/utils.js +4 -0
  46. package/dist/cjs/cli/lib/localDeployment/utils.js.map +2 -2
  47. package/dist/cjs/cli/lib/login.js +4 -28
  48. package/dist/cjs/cli/lib/login.js.map +2 -2
  49. package/dist/cjs/cli/lib/mcp/requestContext.js +1 -5
  50. package/dist/cjs/cli/lib/mcp/requestContext.js.map +2 -2
  51. package/dist/cjs/cli/lib/utils/aiAgent.js +32 -0
  52. package/dist/cjs/cli/lib/utils/aiAgent.js.map +7 -0
  53. package/dist/cjs/cli/lib/utils/utils.js +9 -18
  54. package/dist/cjs/cli/lib/utils/utils.js.map +2 -2
  55. package/dist/cjs/cli/login.js +114 -213
  56. package/dist/cjs/cli/login.js.map +3 -3
  57. package/dist/cjs/cli/logout.js +12 -113
  58. package/dist/cjs/cli/logout.js.map +3 -3
  59. package/dist/cjs/cli/mcp.js +10 -43
  60. package/dist/cjs/cli/mcp.js.map +3 -3
  61. package/dist/cjs/cli/program.js +1 -2
  62. package/dist/cjs/cli/program.js.map +2 -2
  63. package/dist/cjs/index.js +1 -1
  64. package/dist/cjs/index.js.map +1 -1
  65. package/dist/cjs/server/authentication.js.map +1 -1
  66. package/dist/cjs/server/components/index.js.map +2 -2
  67. package/dist/cjs/server/impl/authentication_impl.js +15 -1
  68. package/dist/cjs/server/impl/authentication_impl.js.map +2 -2
  69. package/dist/cjs/server/impl/registration_impl.js +1 -1
  70. package/dist/cjs/server/impl/registration_impl.js.map +2 -2
  71. package/dist/cjs/server/index.js.map +2 -2
  72. package/dist/cjs/server/meta.js.map +1 -1
  73. package/dist/cjs/server/registration.js.map +1 -1
  74. package/dist/cjs/server/schema.js +0 -2
  75. package/dist/cjs/server/schema.js.map +2 -2
  76. package/dist/cjs/server/storage.js.map +1 -1
  77. package/dist/cjs-types/bundler/context.d.ts +0 -5
  78. package/dist/cjs-types/bundler/context.d.ts.map +1 -1
  79. package/dist/cjs-types/bundler/fs.d.ts +2 -7
  80. package/dist/cjs-types/bundler/fs.d.ts.map +1 -1
  81. package/dist/cjs-types/cli/aiFiles.d.ts.map +1 -1
  82. package/dist/cjs-types/cli/configure.d.ts.map +1 -1
  83. package/dist/cjs-types/cli/env.d.ts.map +1 -1
  84. package/dist/cjs-types/cli/envDefault.d.ts.map +1 -1
  85. package/dist/cjs-types/cli/lib/aiFiles/guidelinesmd.d.ts +3 -1
  86. package/dist/cjs-types/cli/lib/aiFiles/guidelinesmd.d.ts.map +1 -1
  87. package/dist/cjs-types/cli/lib/aiFiles/index.d.ts +11 -1
  88. package/dist/cjs-types/cli/lib/aiFiles/index.d.ts.map +1 -1
  89. package/dist/cjs-types/cli/lib/aiFiles/skills.d.ts +4 -1
  90. package/dist/cjs-types/cli/lib/aiFiles/skills.d.ts.map +1 -1
  91. package/dist/cjs-types/cli/lib/components.d.ts.map +1 -1
  92. package/dist/cjs-types/cli/lib/deployApi/startPush.d.ts +13 -0
  93. package/dist/cjs-types/cli/lib/deployApi/startPush.d.ts.map +1 -1
  94. package/dist/cjs-types/cli/lib/deployment.d.ts +0 -2
  95. package/dist/cjs-types/cli/lib/deployment.d.ts.map +1 -1
  96. package/dist/cjs-types/cli/lib/deploymentSelection.d.ts +1 -2
  97. package/dist/cjs-types/cli/lib/deploymentSelection.d.ts.map +1 -1
  98. package/dist/cjs-types/cli/lib/env.d.ts +1 -0
  99. package/dist/cjs-types/cli/lib/env.d.ts.map +1 -1
  100. package/dist/cjs-types/cli/lib/envvars.d.ts +0 -6
  101. package/dist/cjs-types/cli/lib/envvars.d.ts.map +1 -1
  102. package/dist/cjs-types/cli/lib/fsUtils.d.ts +0 -1
  103. package/dist/cjs-types/cli/lib/fsUtils.d.ts.map +1 -1
  104. package/dist/cjs-types/cli/lib/localDeployment/dashboard.d.ts +6 -0
  105. package/dist/cjs-types/cli/lib/localDeployment/dashboard.d.ts.map +1 -1
  106. package/dist/cjs-types/cli/lib/localDeployment/download.d.ts.map +1 -1
  107. package/dist/cjs-types/cli/lib/localDeployment/utils.d.ts +1 -0
  108. package/dist/cjs-types/cli/lib/localDeployment/utils.d.ts.map +1 -1
  109. package/dist/cjs-types/cli/lib/login.d.ts +1 -3
  110. package/dist/cjs-types/cli/lib/login.d.ts.map +1 -1
  111. package/dist/cjs-types/cli/lib/mcp/requestContext.d.ts.map +1 -1
  112. package/dist/cjs-types/cli/lib/mcp/tools/insights.d.ts +2 -2
  113. package/dist/cjs-types/cli/lib/utils/aiAgent.d.ts +8 -0
  114. package/dist/cjs-types/cli/lib/utils/aiAgent.d.ts.map +1 -0
  115. package/dist/cjs-types/cli/lib/utils/utils.d.ts +0 -5
  116. package/dist/cjs-types/cli/lib/utils/utils.d.ts.map +1 -1
  117. package/dist/cjs-types/cli/login.d.ts +0 -21
  118. package/dist/cjs-types/cli/login.d.ts.map +1 -1
  119. package/dist/cjs-types/cli/logout.d.ts +1 -8
  120. package/dist/cjs-types/cli/logout.d.ts.map +1 -1
  121. package/dist/cjs-types/cli/mcp.d.ts.map +1 -1
  122. package/dist/cjs-types/cli/program.d.ts.map +1 -1
  123. package/dist/cjs-types/index.d.ts +1 -1
  124. package/dist/cjs-types/index.d.ts.map +1 -1
  125. package/dist/cjs-types/server/authentication.d.ts +65 -0
  126. package/dist/cjs-types/server/authentication.d.ts.map +1 -1
  127. package/dist/cjs-types/server/components/index.d.ts +6 -0
  128. package/dist/cjs-types/server/components/index.d.ts.map +1 -1
  129. package/dist/cjs-types/server/impl/authentication_impl.d.ts +2 -1
  130. package/dist/cjs-types/server/impl/authentication_impl.d.ts.map +1 -1
  131. package/dist/cjs-types/server/index.d.ts +2 -2
  132. package/dist/cjs-types/server/index.d.ts.map +1 -1
  133. package/dist/cjs-types/server/meta.d.ts +8 -0
  134. package/dist/cjs-types/server/meta.d.ts.map +1 -1
  135. package/dist/cjs-types/server/registration.d.ts +5 -3
  136. package/dist/cjs-types/server/registration.d.ts.map +1 -1
  137. package/dist/cjs-types/server/schema.d.ts +0 -2
  138. package/dist/cjs-types/server/schema.d.ts.map +1 -1
  139. package/dist/cjs-types/server/storage.d.ts +28 -25
  140. package/dist/cjs-types/server/storage.d.ts.map +1 -1
  141. package/dist/cli.bundle.cjs +1379 -2142
  142. package/dist/cli.bundle.cjs.map +4 -4
  143. package/dist/esm/bundler/context.js +5 -7
  144. package/dist/esm/bundler/context.js.map +2 -2
  145. package/dist/esm/bundler/fs.js +6 -47
  146. package/dist/esm/bundler/fs.js.map +2 -2
  147. package/dist/esm/cli/aiFiles.js +26 -4
  148. package/dist/esm/cli/aiFiles.js.map +2 -2
  149. package/dist/esm/cli/configure.js +2 -15
  150. package/dist/esm/cli/configure.js.map +2 -2
  151. package/dist/esm/cli/env.js +6 -3
  152. package/dist/esm/cli/env.js.map +2 -2
  153. package/dist/esm/cli/envDefault.js +5 -2
  154. package/dist/esm/cli/envDefault.js.map +2 -2
  155. package/dist/esm/cli/lib/aiFiles/guidelinesmd.js +2 -1
  156. package/dist/esm/cli/lib/aiFiles/guidelinesmd.js.map +2 -2
  157. package/dist/esm/cli/lib/aiFiles/index.js +13 -2
  158. package/dist/esm/cli/lib/aiFiles/index.js.map +2 -2
  159. package/dist/esm/cli/lib/aiFiles/skills.js +6 -5
  160. package/dist/esm/cli/lib/aiFiles/skills.js.map +2 -2
  161. package/dist/esm/cli/lib/aiFiles/state.js +1 -1
  162. package/dist/esm/cli/lib/aiFiles/state.js.map +1 -1
  163. package/dist/esm/cli/lib/components.js +15 -2
  164. package/dist/esm/cli/lib/components.js.map +2 -2
  165. package/dist/esm/cli/lib/deployApi/startPush.js +39 -0
  166. package/dist/esm/cli/lib/deployApi/startPush.js.map +2 -2
  167. package/dist/esm/cli/lib/deployment.js +2 -2
  168. package/dist/esm/cli/lib/deployment.js.map +2 -2
  169. package/dist/esm/cli/lib/deploymentSelection.js +20 -35
  170. package/dist/esm/cli/lib/deploymentSelection.js.map +2 -2
  171. package/dist/esm/cli/lib/env.js +9 -1
  172. package/dist/esm/cli/lib/env.js.map +2 -2
  173. package/dist/esm/cli/lib/envvars.js +1 -35
  174. package/dist/esm/cli/lib/envvars.js.map +2 -2
  175. package/dist/esm/cli/lib/fsUtils.js +1 -1
  176. package/dist/esm/cli/lib/fsUtils.js.map +2 -2
  177. package/dist/esm/cli/lib/generateDocs.js +1 -1
  178. package/dist/esm/cli/lib/generateDocs.js.map +1 -1
  179. package/dist/esm/cli/lib/localDeployment/dashboard.js +9 -0
  180. package/dist/esm/cli/lib/localDeployment/dashboard.js.map +2 -2
  181. package/dist/esm/cli/lib/localDeployment/download.js +16 -1
  182. package/dist/esm/cli/lib/localDeployment/download.js.map +2 -2
  183. package/dist/esm/cli/lib/localDeployment/utils.js +3 -0
  184. package/dist/esm/cli/lib/localDeployment/utils.js.map +2 -2
  185. package/dist/esm/cli/lib/login.js +4 -36
  186. package/dist/esm/cli/lib/login.js.map +2 -2
  187. package/dist/esm/cli/lib/mcp/requestContext.js +1 -5
  188. package/dist/esm/cli/lib/mcp/requestContext.js.map +2 -2
  189. package/dist/esm/cli/lib/utils/aiAgent.js +10 -0
  190. package/dist/esm/cli/lib/utils/aiAgent.js.map +7 -0
  191. package/dist/esm/cli/lib/utils/utils.js +9 -16
  192. package/dist/esm/cli/lib/utils/utils.js.map +2 -2
  193. package/dist/esm/cli/login.js +112 -225
  194. package/dist/esm/cli/login.js.map +3 -3
  195. package/dist/esm/cli/logout.js +13 -110
  196. package/dist/esm/cli/logout.js.map +2 -2
  197. package/dist/esm/cli/mcp.js +10 -34
  198. package/dist/esm/cli/mcp.js.map +2 -2
  199. package/dist/esm/cli/program.js +1 -2
  200. package/dist/esm/cli/program.js.map +2 -2
  201. package/dist/esm/index.js +1 -1
  202. package/dist/esm/index.js.map +1 -1
  203. package/dist/esm/server/components/index.js.map +2 -2
  204. package/dist/esm/server/impl/authentication_impl.js +13 -0
  205. package/dist/esm/server/impl/authentication_impl.js.map +2 -2
  206. package/dist/esm/server/impl/registration_impl.js +2 -2
  207. package/dist/esm/server/impl/registration_impl.js.map +2 -2
  208. package/dist/esm/server/index.js.map +2 -2
  209. package/dist/esm/server/schema.js +0 -2
  210. package/dist/esm/server/schema.js.map +2 -2
  211. package/dist/esm-types/bundler/context.d.ts +0 -5
  212. package/dist/esm-types/bundler/context.d.ts.map +1 -1
  213. package/dist/esm-types/bundler/fs.d.ts +2 -7
  214. package/dist/esm-types/bundler/fs.d.ts.map +1 -1
  215. package/dist/esm-types/cli/aiFiles.d.ts.map +1 -1
  216. package/dist/esm-types/cli/configure.d.ts.map +1 -1
  217. package/dist/esm-types/cli/env.d.ts.map +1 -1
  218. package/dist/esm-types/cli/envDefault.d.ts.map +1 -1
  219. package/dist/esm-types/cli/lib/aiFiles/guidelinesmd.d.ts +3 -1
  220. package/dist/esm-types/cli/lib/aiFiles/guidelinesmd.d.ts.map +1 -1
  221. package/dist/esm-types/cli/lib/aiFiles/index.d.ts +11 -1
  222. package/dist/esm-types/cli/lib/aiFiles/index.d.ts.map +1 -1
  223. package/dist/esm-types/cli/lib/aiFiles/skills.d.ts +4 -1
  224. package/dist/esm-types/cli/lib/aiFiles/skills.d.ts.map +1 -1
  225. package/dist/esm-types/cli/lib/components.d.ts.map +1 -1
  226. package/dist/esm-types/cli/lib/deployApi/startPush.d.ts +13 -0
  227. package/dist/esm-types/cli/lib/deployApi/startPush.d.ts.map +1 -1
  228. package/dist/esm-types/cli/lib/deployment.d.ts +0 -2
  229. package/dist/esm-types/cli/lib/deployment.d.ts.map +1 -1
  230. package/dist/esm-types/cli/lib/deploymentSelection.d.ts +1 -2
  231. package/dist/esm-types/cli/lib/deploymentSelection.d.ts.map +1 -1
  232. package/dist/esm-types/cli/lib/env.d.ts +1 -0
  233. package/dist/esm-types/cli/lib/env.d.ts.map +1 -1
  234. package/dist/esm-types/cli/lib/envvars.d.ts +0 -6
  235. package/dist/esm-types/cli/lib/envvars.d.ts.map +1 -1
  236. package/dist/esm-types/cli/lib/fsUtils.d.ts +0 -1
  237. package/dist/esm-types/cli/lib/fsUtils.d.ts.map +1 -1
  238. package/dist/esm-types/cli/lib/localDeployment/dashboard.d.ts +6 -0
  239. package/dist/esm-types/cli/lib/localDeployment/dashboard.d.ts.map +1 -1
  240. package/dist/esm-types/cli/lib/localDeployment/download.d.ts.map +1 -1
  241. package/dist/esm-types/cli/lib/localDeployment/utils.d.ts +1 -0
  242. package/dist/esm-types/cli/lib/localDeployment/utils.d.ts.map +1 -1
  243. package/dist/esm-types/cli/lib/login.d.ts +1 -3
  244. package/dist/esm-types/cli/lib/login.d.ts.map +1 -1
  245. package/dist/esm-types/cli/lib/mcp/requestContext.d.ts.map +1 -1
  246. package/dist/esm-types/cli/lib/mcp/tools/insights.d.ts +2 -2
  247. package/dist/esm-types/cli/lib/utils/aiAgent.d.ts +8 -0
  248. package/dist/esm-types/cli/lib/utils/aiAgent.d.ts.map +1 -0
  249. package/dist/esm-types/cli/lib/utils/utils.d.ts +0 -5
  250. package/dist/esm-types/cli/lib/utils/utils.d.ts.map +1 -1
  251. package/dist/esm-types/cli/login.d.ts +0 -21
  252. package/dist/esm-types/cli/login.d.ts.map +1 -1
  253. package/dist/esm-types/cli/logout.d.ts +1 -8
  254. package/dist/esm-types/cli/logout.d.ts.map +1 -1
  255. package/dist/esm-types/cli/mcp.d.ts.map +1 -1
  256. package/dist/esm-types/cli/program.d.ts.map +1 -1
  257. package/dist/esm-types/index.d.ts +1 -1
  258. package/dist/esm-types/index.d.ts.map +1 -1
  259. package/dist/esm-types/server/authentication.d.ts +65 -0
  260. package/dist/esm-types/server/authentication.d.ts.map +1 -1
  261. package/dist/esm-types/server/components/index.d.ts +6 -0
  262. package/dist/esm-types/server/components/index.d.ts.map +1 -1
  263. package/dist/esm-types/server/impl/authentication_impl.d.ts +2 -1
  264. package/dist/esm-types/server/impl/authentication_impl.d.ts.map +1 -1
  265. package/dist/esm-types/server/index.d.ts +2 -2
  266. package/dist/esm-types/server/index.d.ts.map +1 -1
  267. package/dist/esm-types/server/meta.d.ts +8 -0
  268. package/dist/esm-types/server/meta.d.ts.map +1 -1
  269. package/dist/esm-types/server/registration.d.ts +5 -3
  270. package/dist/esm-types/server/registration.d.ts.map +1 -1
  271. package/dist/esm-types/server/schema.d.ts +0 -2
  272. package/dist/esm-types/server/schema.d.ts.map +1 -1
  273. package/dist/esm-types/server/storage.d.ts +28 -25
  274. package/dist/esm-types/server/storage.d.ts.map +1 -1
  275. package/dist/react.bundle.js +1 -1
  276. package/dist/react.bundle.js.map +1 -1
  277. package/package.json +3 -2
  278. package/schemas/convex.schema.json +1 -2
  279. package/src/bundler/context.ts +5 -9
  280. package/src/bundler/fs.ts +5 -54
  281. package/src/cli/aiFiles.ts +30 -4
  282. package/src/cli/configure.ts +2 -18
  283. package/src/cli/env.ts +4 -1
  284. package/src/cli/envDefault.ts +4 -1
  285. package/src/cli/lib/aiFiles/guidelinesmd.ts +7 -2
  286. package/src/cli/lib/aiFiles/index.ts +23 -3
  287. package/src/cli/lib/aiFiles/skills.ts +11 -7
  288. package/src/cli/lib/aiFiles/state.ts +1 -1
  289. package/src/cli/lib/components.ts +18 -3
  290. package/src/cli/lib/deployApi/startPush.ts +64 -0
  291. package/src/cli/lib/deployment.ts +2 -2
  292. package/src/cli/lib/deploymentSelection.ts +18 -37
  293. package/src/cli/lib/env.ts +13 -2
  294. package/src/cli/lib/envvars.ts +1 -43
  295. package/src/cli/lib/fsUtils.ts +2 -5
  296. package/src/cli/lib/generateDocs.ts +1 -1
  297. package/src/cli/lib/localDeployment/dashboard.ts +19 -0
  298. package/src/cli/lib/localDeployment/download.ts +17 -1
  299. package/src/cli/lib/localDeployment/utils.ts +4 -0
  300. package/src/cli/lib/login.ts +3 -47
  301. package/src/cli/lib/mcp/requestContext.ts +1 -7
  302. package/src/cli/lib/utils/aiAgent.ts +15 -0
  303. package/src/cli/lib/utils/utils.ts +15 -19
  304. package/src/cli/login.ts +168 -293
  305. package/src/cli/logout.ts +17 -142
  306. package/src/cli/mcp.ts +11 -48
  307. package/src/cli/program.ts +0 -2
  308. package/src/index.ts +1 -1
  309. package/src/server/authentication.ts +79 -0
  310. package/src/server/components/index.ts +11 -0
  311. package/src/server/impl/authentication_impl.ts +15 -1
  312. package/src/server/impl/registration_impl.ts +2 -2
  313. package/src/server/index.ts +6 -0
  314. package/src/server/meta.ts +0 -8
  315. package/src/server/registration.ts +5 -2
  316. package/src/server/schema.ts +0 -2
  317. package/src/server/storage.ts +29 -42
  318. package/dist/cjs/cli/account.js +0 -237
  319. package/dist/cjs/cli/account.js.map +0 -7
  320. package/dist/cjs/cli/lib/deployKeyWarning.js +0 -43
  321. package/dist/cjs/cli/lib/deployKeyWarning.js.map +0 -7
  322. package/dist/cjs/cli/lib/profileManagement.js +0 -196
  323. package/dist/cjs/cli/lib/profileManagement.js.map +0 -7
  324. package/dist/cjs/cli/lib/profiles.js +0 -333
  325. package/dist/cjs/cli/lib/profiles.js.map +0 -7
  326. package/dist/cjs-types/cli/account.d.ts +0 -6
  327. package/dist/cjs-types/cli/account.d.ts.map +0 -1
  328. package/dist/cjs-types/cli/lib/deployKeyWarning.d.ts +0 -3
  329. package/dist/cjs-types/cli/lib/deployKeyWarning.d.ts.map +0 -1
  330. package/dist/cjs-types/cli/lib/profileManagement.d.ts +0 -10
  331. package/dist/cjs-types/cli/lib/profileManagement.d.ts.map +0 -1
  332. package/dist/cjs-types/cli/lib/profiles.d.ts +0 -59
  333. package/dist/cjs-types/cli/lib/profiles.d.ts.map +0 -1
  334. package/dist/esm/cli/account.js +0 -221
  335. package/dist/esm/cli/account.js.map +0 -7
  336. package/dist/esm/cli/lib/deployKeyWarning.js +0 -27
  337. package/dist/esm/cli/lib/deployKeyWarning.js.map +0 -7
  338. package/dist/esm/cli/lib/profileManagement.js +0 -179
  339. package/dist/esm/cli/lib/profileManagement.js.map +0 -7
  340. package/dist/esm/cli/lib/profiles.js +0 -288
  341. package/dist/esm/cli/lib/profiles.js.map +0 -7
  342. package/dist/esm-types/cli/account.d.ts +0 -6
  343. package/dist/esm-types/cli/account.d.ts.map +0 -1
  344. package/dist/esm-types/cli/lib/deployKeyWarning.d.ts +0 -3
  345. package/dist/esm-types/cli/lib/deployKeyWarning.d.ts.map +0 -1
  346. package/dist/esm-types/cli/lib/profileManagement.d.ts +0 -10
  347. package/dist/esm-types/cli/lib/profileManagement.d.ts.map +0 -1
  348. package/dist/esm-types/cli/lib/profiles.d.ts +0 -59
  349. package/dist/esm-types/cli/lib/profiles.d.ts.map +0 -1
  350. package/src/cli/account.ts +0 -320
  351. package/src/cli/lib/deployKeyWarning.ts +0 -43
  352. package/src/cli/lib/profileManagement.ts +0 -262
  353. package/src/cli/lib/profiles.ts +0 -398
@@ -1,237 +0,0 @@
1
- "use strict";
2
- var __create = Object.create;
3
- var __defProp = Object.defineProperty;
4
- var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
5
- var __getOwnPropNames = Object.getOwnPropertyNames;
6
- var __getProtoOf = Object.getPrototypeOf;
7
- var __hasOwnProp = Object.prototype.hasOwnProperty;
8
- var __export = (target, all) => {
9
- for (var name in all)
10
- __defProp(target, name, { get: all[name], enumerable: true });
11
- };
12
- var __copyProps = (to, from, except, desc) => {
13
- if (from && typeof from === "object" || typeof from === "function") {
14
- for (let key of __getOwnPropNames(from))
15
- if (!__hasOwnProp.call(to, key) && key !== except)
16
- __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
17
- }
18
- return to;
19
- };
20
- var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
21
- // If the importer is in node compatibility mode or this is not an ESM
22
- // file that has been converted to a CommonJS file using a Babel-
23
- // compatible transform (i.e. "__esModule" has not been set), then set
24
- // "default" to the CommonJS "module.exports" for node compatibility.
25
- isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
26
- mod
27
- ));
28
- var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
29
- var account_exports = {};
30
- __export(account_exports, {
31
- account: () => account,
32
- handleNoAccessToConfiguredProject: () => handleNoAccessToConfiguredProject
33
- });
34
- module.exports = __toCommonJS(account_exports);
35
- var import_extra_typings = require("@commander-js/extra-typings");
36
- var import_path = __toESM(require("path"), 1);
37
- var import_login = require("./login.js");
38
- var import_logout = require("./logout.js");
39
- var import_context = require("../bundler/context.js");
40
- var import_log = require("../bundler/log.js");
41
- var import_envvars = require("./lib/envvars.js");
42
- var import_login2 = require("./lib/login.js");
43
- var import_profiles = require("./lib/profiles.js");
44
- var import_profileManagement = require("./lib/profileManagement.js");
45
- var import_deployKeyWarning = require("./lib/deployKeyWarning.js");
46
- var import_prompts = require("./lib/utils/prompts.js");
47
- async function profileContext() {
48
- const ctx = await (0, import_context.oneoffContext)({ skipAuth: true });
49
- (0, import_envvars.loadProjectEnvironmentVariables)();
50
- return ctx;
51
- }
52
- const profileList = new import_extra_typings.Command("list").description(
53
- "List saved accounts, credential status, and directory selections"
54
- ).allowExcessArguments(false).action(async () => {
55
- const ctx = await profileContext();
56
- const settings = await (0, import_profiles.readProfileSettings)(ctx);
57
- const selected = await (0, import_profiles.getProfileSelection)(ctx);
58
- const names = /* @__PURE__ */ new Set([
59
- ...(0, import_profiles.savedProfileNames)(ctx),
60
- ...Object.values(settings.directories ?? {}),
61
- ...settings.defaultProfile === void 0 ? [] : [settings.defaultProfile],
62
- ...selected === null ? [] : [selected.name]
63
- ]);
64
- (0, import_deployKeyWarning.warnIfDeployKeyOverridesLogin)(
65
- ctx,
66
- typeof settings.accessToken === "string" || (0, import_profiles.savedProfileNames)(ctx).length > 0
67
- );
68
- if (names.size === 0) {
69
- (0, import_log.logMessage)(
70
- typeof settings.accessToken === "string" ? await (0, import_login2.isAuthorizedHeader)(ctx, `Bearer ${settings.accessToken}`) ? "Logged in without a named account. Name this login with `npx convex login --account personal --select`." : "Your saved login is no longer valid. Run `npx convex login --account <name>`." : "No saved accounts. Run `npx convex login --account <name>`."
71
- );
72
- return;
73
- }
74
- if (selected !== null)
75
- (0, import_log.logMessage)(`Selected account: ${selected.name} (${selected.source})`);
76
- if (settings.defaultProfile !== void 0)
77
- (0, import_log.logMessage)(`Default account: ${settings.defaultProfile}`);
78
- for (const name of [...names].sort()) {
79
- const credentials = await (0, import_profiles.readProfileCredentials)(
80
- ctx,
81
- { name, source: "saved accounts" },
82
- true
83
- );
84
- const valid = credentials !== null && await (0, import_login2.isAuthorizedHeader)(ctx, `Bearer ${credentials.accessToken}`);
85
- const label = `${name}${credentials?.email ? ` (${credentials.email})` : ""}`;
86
- const status = credentials === null ? " \u26A0\uFE0F Not logged in" : valid ? "" : " \u26A0\uFE0F Invalid credentials";
87
- (0, import_log.logOutput)(`${label}${status}`);
88
- for (const [directory, profile] of Object.entries(
89
- settings.directories ?? {}
90
- )) {
91
- if (profile === name) (0, import_log.logOutput)(` ${directory}`);
92
- }
93
- }
94
- });
95
- const accountSelect = new import_extra_typings.Command("select").description("Use a saved account in this directory and its subdirectories").argument("<account>", "Account name, such as work or personal").option(
96
- "--force",
97
- "Select this account even if deployment access cannot be verified"
98
- ).allowExcessArguments(false).action(async (name, options) => {
99
- const ctx = await profileContext();
100
- if (!await (0, import_profileManagement.bindProfileToDirectory)(ctx, name, options.force)) {
101
- await ctx.crash({
102
- exitCode: 1,
103
- errorType: "fatal",
104
- printedMessage: null
105
- });
106
- }
107
- });
108
- const profileDefault = new import_extra_typings.Command("default").description(
109
- "Show or set the default account for directories without a directory selection"
110
- ).argument("[account]", "Account name").allowExcessArguments(false).action(async (name) => {
111
- const ctx = await profileContext();
112
- if (name === void 0) {
113
- const settings = await (0, import_profiles.readProfileSettings)(ctx);
114
- (0, import_log.logOutput)(
115
- settings.defaultProfile === void 0 ? "No default account is set." : `Default account: ${settings.defaultProfile}`
116
- );
117
- return;
118
- }
119
- await (0, import_profiles.updateProfileSettings)(ctx, async (settings) => {
120
- const credentials = await (0, import_profiles.readProfileCredentials)(ctx, {
121
- name,
122
- source: "account default"
123
- });
124
- settings.defaultProfile = name;
125
- settings.accessToken = credentials.accessToken;
126
- });
127
- (0, import_log.logFinishedStep)(`Default account: ${name}`);
128
- });
129
- const accountDeselect = new import_extra_typings.Command("deselect").description(
130
- "Clear this directory's account selection, inheriting its parent's selection or the default"
131
- ).allowExcessArguments(false).action(async () => {
132
- const ctx = await profileContext();
133
- const directory = import_path.default.resolve(process.cwd());
134
- const removed = await (0, import_profiles.updateProfileSettings)(ctx, (settings) => {
135
- if (settings.directories && Object.hasOwn(settings.directories, directory)) {
136
- delete settings.directories[directory];
137
- return true;
138
- }
139
- return false;
140
- });
141
- if (removed)
142
- (0, import_log.logFinishedStep)(`Removed the directory selection for ${directory}.`);
143
- else (0, import_log.logMessage)(`No directory selection is saved for ${directory}.`);
144
- const selected = await (0, import_profiles.getProfileSelection)(ctx);
145
- if (selected !== null)
146
- (0, import_log.logMessage)(`Selected account: ${selected.name} (${selected.source})`);
147
- });
148
- const profileSettings = new import_extra_typings.Command("settings").summary("Show or change account settings").description(
149
- "Show or change account settings.\n\nRenewing an account login revokes its replaced personal access token unless another saved login uses it. To keep replaced tokens active, run:\n\n `npx convex@latest account settings revoke-replaced-tokens false`"
150
- ).argument("[name]", "revoke-replaced-tokens").argument("[value]", "true or false").allowExcessArguments(false).action(async (name, value, _options, cmd) => {
151
- const ctx = await profileContext();
152
- const settings = await (0, import_profiles.readProfileSettings)(ctx);
153
- if (name === void 0 && value === void 0) {
154
- (0, import_log.logOutput)(
155
- `revoke-replaced-tokens: ${settings.revokeReplacedTokens ?? true}`
156
- );
157
- return;
158
- }
159
- if (name !== "revoke-replaced-tokens" || value !== "true" && value !== "false") {
160
- cmd.error(
161
- "Usage: npx convex account settings revoke-replaced-tokens <true|false>"
162
- );
163
- }
164
- await (0, import_profiles.updateProfileSettings)(ctx, (settings2) => {
165
- settings2.revokeReplacedTokens = value === "true";
166
- });
167
- (0, import_log.logFinishedStep)(`Set revoke-replaced-tokens to ${value}.`);
168
- });
169
- const account = new import_extra_typings.Command("account").summary("Manage saved accounts and their directory selections").description(
170
- "Manage saved accounts and their directory selections.\n\nSave logins for multiple Convex accounts under names such as work and personal. `npx convex@latest account login` and `npx convex@latest account logout` are aliases for the top-level login and logout commands, with the same options. Select the appropriate account for each personal, work, or client project.\n\nIn your personal project directory, save an account:\n\n `npx convex@latest login --account personal --select`\n\nIn your work project directory, log in with your work account and check its teams:\n\n `npx convex@latest login --account work --select`\n `npx convex@latest login status`\n\nChoose the appropriate account in the browser; sign out of the dashboard first if it is using another account. Upgrade each project's `convex` dependency to a version that supports saved accounts, then run `npx convex dev` to develop with its selected account.\n\n`login --account` saves credentials without changing directory selections. Add `--select` to select the account for this directory and its subdirectories after checking deployment access. The first saved account becomes the default if no other account is saved. To select a saved account in another directory, run `npx convex@latest account select work`. Run `npx convex@latest account deselect` to remove this directory's selection and inherit its parent or default. Run `npx convex@latest account default` to show the default, or `npx convex@latest account default work` to change it. The closest directory selection wins. Selections use absolute paths, so select the account again after moving a project.\n\nThe first account name is assigned to your existing login if you are already logged in, and becomes the default for directories without a selection. Use `--force` to authenticate another account instead, keeping the existing login as the default. Names start with a lowercase letter or number and contain only lowercase letters, numbers, hyphens, and underscores.\n\n`CONVEX_ACCOUNT` in the shell or project env file overrides directory selections and the default account. Deployment and project keys take priority over saved accounts.\n\nUse `npx convex@latest logout --account work` to remove one account's credentials, or `npx convex@latest logout --all` to remove all saved credentials. Logout preserves directory selections; a logged-out account requires login before use.\n\nAfter saving accounts, use `npx convex@latest` for login, logout, and account commands in every project directory on this machine. Plain `npx convex` can run the older version installed in that project. Specifying `@latest` runs the latest published CLI without updating the project's dependency.\n\nOlder CLIs ignore directory selections and `CONVEX_ACCOUNT`, using the shared login instead (normally the default account). Upgrade the project's `convex` dependency to use saved accounts with project commands such as `npx convex dev` and `npx convex deploy`.\n\nLogging in with an older CLI can change the shared login independently of your saved accounts, or discard account settings if the shared login has been removed. Logging out with an older CLI deletes directory selections and the default selection but leaves named account credentials behind. Recreate any lost selections with `npx convex@latest account select <name>` and `npx convex@latest account default <name>`.\n\nRenewing an account login can revoke its previous token and interrupt running CLI processes of any version that still use it. Restart those commands after renewing the login, or keep replaced tokens active with `npx convex@latest account settings revoke-replaced-tokens false`."
171
- ).addCommand(profileList).addCommand(accountSelect).addCommand(profileDefault).addCommand(accountDeselect).addCommand(profileSettings).addCommand((0, import_login.createLoginCommand)()).addCommand((0, import_logout.createLogoutCommand)()).addHelpCommand(false);
172
- async function handleNoAccessToConfiguredProject(ctx, target, envFile) {
173
- const auth = ctx.bigBrainAuth();
174
- const current = auth?.kind === "accessToken" ? auth.profile?.name : void 0;
175
- const project = target.kind === "deploymentName" ? `deployment "${target.deploymentName}"` : target.kind === "teamAndProjectSlugs" ? `project "${target.teamSlug}/${target.projectSlug}"` : "the configured project";
176
- (0, import_log.logWarning)(
177
- `${current ? `Account "${current}"` : "Your account"} cannot access ${project}. It may belong to another account.`
178
- );
179
- const alternatives = [];
180
- if (target.kind !== "projectDeployKey") {
181
- for (const name2 of (0, import_profiles.savedProfileNames)(ctx)) {
182
- if (name2 === current) continue;
183
- const credentials = await (0, import_profiles.readProfileCredentials)(ctx, {
184
- name: name2,
185
- source: "saved accounts"
186
- });
187
- if (await (0, import_profileManagement.projectAccess)(credentials.accessToken, target) === "yes")
188
- alternatives.push(name2);
189
- }
190
- }
191
- if (!process.stdin.isTTY) {
192
- const selection2 = await (0, import_profiles.getProfileSelection)(ctx, { envFile });
193
- const overrideHint = selection2?.source.startsWith("CONVEX_ACCOUNT") ? ` Update or unset CONVEX_ACCOUNT (${selection2.source}) before retrying.` : "";
194
- return await ctx.crash({
195
- exitCode: 1,
196
- errorType: "fatal",
197
- printedMessage: `${alternatives.length > 0 ? `A saved account can access it: ${alternatives.map((name2) => `\`npx convex account select ${name2}\``).join(" or ")}.` : "Log in to its account with `npx convex login --account <name> --select`."}${overrideHint} To select a different project, run \`npx convex dev --configure\` (this changes CONVEX_DEPLOYMENT).`
198
- });
199
- }
200
- const choice = await (0, import_prompts.promptOptions)(ctx, {
201
- message: "Which account should this project use?",
202
- choices: [
203
- ...alternatives.map((name2) => ({
204
- name: `Use account "${name2}"`,
205
- value: { kind: "use", name: name2 }
206
- })),
207
- { name: "Log in to another account", value: { kind: "login" } },
208
- {
209
- name: "Configure a different project (changes CONVEX_DEPLOYMENT)",
210
- value: { kind: "chooseProject" }
211
- }
212
- ]
213
- });
214
- if (choice.kind === "chooseProject") return "chooseProject";
215
- const name = choice.kind === "use" ? choice.name : await (0, import_prompts.promptString)(ctx, {
216
- message: "Account name (for example, work):"
217
- });
218
- await (0, import_profiles.validateProfileName)(ctx, name);
219
- if (choice.kind === "login") {
220
- const selection2 = { name, source: "account recovery" };
221
- await (0, import_login2.performLogin)(ctx, { profile: selection2 });
222
- await (0, import_profiles.initializeDefaultProfile)(ctx, selection2, false);
223
- }
224
- if (!await (0, import_profileManagement.bindProfileToDirectory)(ctx, name, false, target))
225
- return "chooseProject";
226
- const selection = await (0, import_profiles.getProfileSelection)(ctx, { envFile });
227
- if (selection?.name !== name) {
228
- return await ctx.crash({
229
- exitCode: 1,
230
- errorType: "invalid filesystem or env vars",
231
- printedMessage: `Remove the account override from ${selection?.source} before retrying.`
232
- });
233
- }
234
- ctx._updateBigBrainAuth(await (0, import_profiles.readProfileAuth)(ctx, selection));
235
- return "retry";
236
- }
237
- //# sourceMappingURL=account.js.map
@@ -1,7 +0,0 @@
1
- {
2
- "version": 3,
3
- "sources": ["../../../src/cli/account.ts"],
4
- "sourcesContent": ["import { Command } from \"@commander-js/extra-typings\";\nimport path from \"path\";\nimport { createLoginCommand } from \"./login.js\";\nimport { createLogoutCommand } from \"./logout.js\";\nimport { Context, oneoffContext } from \"../bundler/context.js\";\nimport {\n logFinishedStep,\n logMessage,\n logOutput,\n logWarning,\n} from \"../bundler/log.js\";\nimport { loadProjectEnvironmentVariables } from \"./lib/envvars.js\";\nimport { isAuthorizedHeader, performLogin } from \"./lib/login.js\";\nimport {\n getProfileSelection,\n initializeDefaultProfile,\n readProfileAuth,\n readProfileCredentials,\n readProfileSettings,\n savedProfileNames,\n validateProfileName,\n updateProfileSettings,\n} from \"./lib/profiles.js\";\nimport {\n bindProfileToDirectory,\n projectAccess,\n} from \"./lib/profileManagement.js\";\nimport { warnIfDeployKeyOverridesLogin } from \"./lib/deployKeyWarning.js\";\nimport { ProjectSelection } from \"./lib/deploymentSelection.js\";\nimport { promptOptions, promptString } from \"./lib/utils/prompts.js\";\n\nasync function profileContext() {\n const ctx = await oneoffContext({ skipAuth: true });\n loadProjectEnvironmentVariables();\n return ctx;\n}\n\nconst profileList = new Command(\"list\")\n .description(\n \"List saved accounts, credential status, and directory selections\",\n )\n .allowExcessArguments(false)\n .action(async () => {\n const ctx = await profileContext();\n const settings = await readProfileSettings(ctx);\n const selected = await getProfileSelection(ctx);\n const names = new Set([\n ...savedProfileNames(ctx),\n ...Object.values(settings.directories ?? {}),\n ...(settings.defaultProfile === undefined\n ? []\n : [settings.defaultProfile]),\n ...(selected === null ? [] : [selected.name]),\n ]);\n warnIfDeployKeyOverridesLogin(\n ctx,\n typeof settings.accessToken === \"string\" ||\n savedProfileNames(ctx).length > 0,\n );\n if (names.size === 0) {\n logMessage(\n typeof settings.accessToken === \"string\"\n ? (await isAuthorizedHeader(ctx, `Bearer ${settings.accessToken}`))\n ? \"Logged in without a named account. Name this login with `npx convex login --account personal --select`.\"\n : \"Your saved login is no longer valid. Run `npx convex login --account <name>`.\"\n : \"No saved accounts. Run `npx convex login --account <name>`.\",\n );\n return;\n }\n if (selected !== null)\n logMessage(`Selected account: ${selected.name} (${selected.source})`);\n if (settings.defaultProfile !== undefined)\n logMessage(`Default account: ${settings.defaultProfile}`);\n for (const name of [...names].sort()) {\n const credentials = await readProfileCredentials(\n ctx,\n { name, source: \"saved accounts\" },\n true,\n );\n const valid =\n credentials !== null &&\n (await isAuthorizedHeader(ctx, `Bearer ${credentials.accessToken}`));\n const label = `${name}${credentials?.email ? ` (${credentials.email})` : \"\"}`;\n const status =\n credentials === null\n ? \" \u26A0\uFE0F Not logged in\"\n : valid\n ? \"\"\n : \" \u26A0\uFE0F Invalid credentials\";\n logOutput(`${label}${status}`);\n for (const [directory, profile] of Object.entries(\n settings.directories ?? {},\n )) {\n if (profile === name) logOutput(` ${directory}`);\n }\n }\n });\n\nconst accountSelect = new Command(\"select\")\n .description(\"Use a saved account in this directory and its subdirectories\")\n .argument(\"<account>\", \"Account name, such as work or personal\")\n .option(\n \"--force\",\n \"Select this account even if deployment access cannot be verified\",\n )\n .allowExcessArguments(false)\n .action(async (name, options) => {\n const ctx = await profileContext();\n if (!(await bindProfileToDirectory(ctx, name, options.force))) {\n await ctx.crash({\n exitCode: 1,\n errorType: \"fatal\",\n printedMessage: null,\n });\n }\n });\n\nconst profileDefault = new Command(\"default\")\n .description(\n \"Show or set the default account for directories without a directory selection\",\n )\n .argument(\"[account]\", \"Account name\")\n .allowExcessArguments(false)\n .action(async (name) => {\n const ctx = await profileContext();\n if (name === undefined) {\n const settings = await readProfileSettings(ctx);\n logOutput(\n settings.defaultProfile === undefined\n ? \"No default account is set.\"\n : `Default account: ${settings.defaultProfile}`,\n );\n return;\n }\n await updateProfileSettings(ctx, async (settings) => {\n const credentials = await readProfileCredentials(ctx, {\n name,\n source: \"account default\",\n });\n settings.defaultProfile = name;\n settings.accessToken = credentials!.accessToken;\n });\n logFinishedStep(`Default account: ${name}`);\n });\n\nconst accountDeselect = new Command(\"deselect\")\n .description(\n \"Clear this directory's account selection, inheriting its parent's selection or the default\",\n )\n .allowExcessArguments(false)\n .action(async () => {\n const ctx = await profileContext();\n const directory = path.resolve(process.cwd());\n const removed = await updateProfileSettings(ctx, (settings) => {\n if (\n settings.directories &&\n Object.hasOwn(settings.directories, directory)\n ) {\n delete settings.directories[directory];\n return true;\n }\n return false;\n });\n if (removed)\n logFinishedStep(`Removed the directory selection for ${directory}.`);\n else logMessage(`No directory selection is saved for ${directory}.`);\n const selected = await getProfileSelection(ctx);\n if (selected !== null)\n logMessage(`Selected account: ${selected.name} (${selected.source})`);\n });\n\nconst profileSettings = new Command(\"settings\")\n .summary(\"Show or change account settings\")\n .description(\n \"Show or change account settings.\\n\\n\" +\n \"Renewing an account login revokes its replaced personal access token unless another saved login uses it. To keep replaced tokens active, run:\\n\\n\" +\n \" `npx convex@latest account settings revoke-replaced-tokens false`\",\n )\n .argument(\"[name]\", \"revoke-replaced-tokens\")\n .argument(\"[value]\", \"true or false\")\n .allowExcessArguments(false)\n .action(async (name, value, _options, cmd) => {\n const ctx = await profileContext();\n const settings = await readProfileSettings(ctx);\n if (name === undefined && value === undefined) {\n logOutput(\n `revoke-replaced-tokens: ${settings.revokeReplacedTokens ?? true}`,\n );\n return;\n }\n if (\n name !== \"revoke-replaced-tokens\" ||\n (value !== \"true\" && value !== \"false\")\n ) {\n cmd.error(\n \"Usage: npx convex account settings revoke-replaced-tokens <true|false>\",\n );\n }\n await updateProfileSettings(ctx, (settings) => {\n settings.revokeReplacedTokens = value === \"true\";\n });\n logFinishedStep(`Set revoke-replaced-tokens to ${value}.`);\n });\n\nexport const account = new Command(\"account\")\n .summary(\"Manage saved accounts and their directory selections\")\n .description(\n \"Manage saved accounts and their directory selections.\\n\\n\" +\n \"Save logins for multiple Convex accounts under names such as work and personal. `npx convex@latest account login` and `npx convex@latest account logout` are aliases for the top-level login and logout commands, with the same options. Select the appropriate account for each personal, work, or client project.\\n\\n\" +\n \"In your personal project directory, save an account:\\n\\n\" +\n \" `npx convex@latest login --account personal --select`\\n\\n\" +\n \"In your work project directory, log in with your work account and check its teams:\\n\\n\" +\n \" `npx convex@latest login --account work --select`\\n\" +\n \" `npx convex@latest login status`\\n\\n\" +\n \"Choose the appropriate account in the browser; sign out of the dashboard first if it is using another account. Upgrade each project's `convex` dependency to a version that supports saved accounts, then run `npx convex dev` to develop with its selected account.\\n\\n\" +\n \"`login --account` saves credentials without changing directory selections. Add `--select` to select the account for this directory and its subdirectories after checking deployment access. The first saved account becomes the default if no other account is saved. To select a saved account in another directory, run `npx convex@latest account select work`. Run `npx convex@latest account deselect` to remove this directory's selection and inherit its parent or default. Run `npx convex@latest account default` to show the default, or `npx convex@latest account default work` to change it. The closest directory selection wins. Selections use absolute paths, so select the account again after moving a project.\\n\\n\" +\n \"The first account name is assigned to your existing login if you are already logged in, and becomes the default for directories without a selection. Use `--force` to authenticate another account instead, keeping the existing login as the default. Names start with a lowercase letter or number and contain only lowercase letters, numbers, hyphens, and underscores.\\n\\n\" +\n \"`CONVEX_ACCOUNT` in the shell or project env file overrides directory selections and the default account. Deployment and project keys take priority over saved accounts.\\n\\n\" +\n \"Use `npx convex@latest logout --account work` to remove one account's credentials, or `npx convex@latest logout --all` to remove all saved credentials. Logout preserves directory selections; a logged-out account requires login before use.\\n\\n\" +\n \"After saving accounts, use `npx convex@latest` for login, logout, and account commands in every project directory on this machine. Plain `npx convex` can run the older version installed in that project. Specifying `@latest` runs the latest published CLI without updating the project's dependency.\\n\\n\" +\n \"Older CLIs ignore directory selections and `CONVEX_ACCOUNT`, using the shared login instead (normally the default account). Upgrade the project's `convex` dependency to use saved accounts with project commands such as `npx convex dev` and `npx convex deploy`.\\n\\n\" +\n \"Logging in with an older CLI can change the shared login independently of your saved accounts, or discard account settings if the shared login has been removed. Logging out with an older CLI deletes directory selections and the default selection but leaves named account credentials behind. Recreate any lost selections with `npx convex@latest account select <name>` and `npx convex@latest account default <name>`.\\n\\n\" +\n \"Renewing an account login can revoke its previous token and interrupt running CLI processes of any version that still use it. Restart those commands after renewing the login, or keep replaced tokens active with `npx convex@latest account settings revoke-replaced-tokens false`.\",\n )\n .addCommand(profileList)\n .addCommand(accountSelect)\n .addCommand(profileDefault)\n .addCommand(accountDeselect)\n .addCommand(profileSettings)\n .addCommand(createLoginCommand())\n .addCommand(createLogoutCommand())\n .addHelpCommand(false);\n\nexport async function handleNoAccessToConfiguredProject(\n ctx: Context,\n target: ProjectSelection,\n envFile?: string,\n): Promise<\"retry\" | \"chooseProject\"> {\n const auth = ctx.bigBrainAuth();\n const current = auth?.kind === \"accessToken\" ? auth.profile?.name : undefined;\n const project =\n target.kind === \"deploymentName\"\n ? `deployment \"${target.deploymentName}\"`\n : target.kind === \"teamAndProjectSlugs\"\n ? `project \"${target.teamSlug}/${target.projectSlug}\"`\n : \"the configured project\";\n logWarning(\n `${current ? `Account \"${current}\"` : \"Your account\"} cannot access ${project}. It may belong to another account.`,\n );\n const alternatives: string[] = [];\n if (target.kind !== \"projectDeployKey\") {\n for (const name of savedProfileNames(ctx)) {\n if (name === current) continue;\n const credentials = await readProfileCredentials(ctx, {\n name,\n source: \"saved accounts\",\n });\n if ((await projectAccess(credentials!.accessToken, target)) === \"yes\")\n alternatives.push(name);\n }\n }\n if (!process.stdin.isTTY) {\n const selection = await getProfileSelection(ctx, { envFile });\n const overrideHint = selection?.source.startsWith(\"CONVEX_ACCOUNT\")\n ? ` Update or unset CONVEX_ACCOUNT (${selection.source}) before retrying.`\n : \"\";\n return await ctx.crash({\n exitCode: 1,\n errorType: \"fatal\",\n printedMessage: `${\n alternatives.length > 0\n ? `A saved account can access it: ${alternatives.map((name) => `\\`npx convex account select ${name}\\``).join(\" or \")}.`\n : \"Log in to its account with `npx convex login --account <name> --select`.\"\n }${overrideHint} To select a different project, run \\`npx convex dev --configure\\` (this changes CONVEX_DEPLOYMENT).`,\n });\n }\n type Choice =\n | { kind: \"use\"; name: string }\n | { kind: \"login\" }\n | { kind: \"chooseProject\" };\n const choice = await promptOptions<Choice>(ctx, {\n message: \"Which account should this project use?\",\n choices: [\n ...alternatives.map((name) => ({\n name: `Use account \"${name}\"`,\n value: { kind: \"use\", name } as const,\n })),\n { name: \"Log in to another account\", value: { kind: \"login\" } as const },\n {\n name: \"Configure a different project (changes CONVEX_DEPLOYMENT)\",\n value: { kind: \"chooseProject\" } as const,\n },\n ],\n });\n if (choice.kind === \"chooseProject\") return \"chooseProject\";\n const name =\n choice.kind === \"use\"\n ? choice.name\n : await promptString(ctx, {\n message: \"Account name (for example, work):\",\n });\n await validateProfileName(ctx, name);\n if (choice.kind === \"login\") {\n const selection = { name, source: \"account recovery\" };\n await performLogin(ctx, { profile: selection });\n await initializeDefaultProfile(ctx, selection, false);\n }\n if (!(await bindProfileToDirectory(ctx, name, false, target)))\n return \"chooseProject\";\n const selection = await getProfileSelection(ctx, { envFile });\n if (selection?.name !== name) {\n return await ctx.crash({\n exitCode: 1,\n errorType: \"invalid filesystem or env vars\",\n printedMessage: `Remove the account override from ${selection?.source} before retrying.`,\n });\n }\n ctx._updateBigBrainAuth(await readProfileAuth(ctx, selection));\n return \"retry\";\n}\n"],
5
- "mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,2BAAwB;AACxB,kBAAiB;AACjB,mBAAmC;AACnC,oBAAoC;AACpC,qBAAuC;AACvC,iBAKO;AACP,qBAAgD;AAChD,IAAAA,gBAAiD;AACjD,sBASO;AACP,+BAGO;AACP,8BAA8C;AAE9C,qBAA4C;AAE5C,eAAe,iBAAiB;AAC9B,QAAM,MAAM,UAAM,8BAAc,EAAE,UAAU,KAAK,CAAC;AAClD,sDAAgC;AAChC,SAAO;AACT;AAEA,MAAM,cAAc,IAAI,6BAAQ,MAAM,EACnC;AAAA,EACC;AACF,EACC,qBAAqB,KAAK,EAC1B,OAAO,Y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AC7B,MAAM,gBAAgBA,KAAI;AAAA,QAC1B,OAAO,EAAE,MAAM,OAAO,MAAAA,MAAK;AAAA,MAC7B,EAAE;AAAA,MACF,EAAE,MAAM,6BAA6B,OAAO,EAAE,MAAM,QAAQ,EAAW;AAAA,MACvE;AAAA,QACE,MAAM;AAAA,QACN,OAAO,EAAE,MAAM,gBAAgB;AAAA,MACjC;AAAA,IACF;AAAA,EACF,CAAC;AACD,MAAI,OAAO,SAAS,gBAAiB,QAAO;AAC5C,QAAM,OACJ,OAAO,SAAS,QACZ,OAAO,OACP,UAAM,6BAAa,KAAK;AAAA,IACtB,SAAS;AAAA,EACX,CAAC;AACP,YAAM,qCAAoB,KAAK,IAAI;AACnC,MAAI,OAAO,SAAS,SAAS;AAC3B,UAAMC,aAAY,EAAE,MAAM,QAAQ,mBAAmB;AACrD,cAAM,4BAAa,KAAK,EAAE,SAASA,WAAU,CAAC;AAC9C,cAAM,0CAAyB,KAAKA,YAAW,KAAK;AAAA,EACtD;AACA,MAAI,CAAE,UAAM,iDAAuB,KAAK,MAAM,OAAO,MAAM;AACzD,WAAO;AACT,QAAM,YAAY,UAAM,qCAAoB,KAAK,EAAE,QAAQ,CAAC;AAC5D,MAAI,WAAW,SAAS,MAAM;AAC5B,WAAO,MAAM,IAAI,MAAM;AAAA,MACrB,UAAU;AAAA,MACV,WAAW;AAAA,MACX,gBAAgB,oCAAoC,WAAW,MAAM;AAAA,IACvE,CAAC;AAAA,EACH;AACA,MAAI,oBAAoB,UAAM,iCAAgB,KAAK,SAAS,CAAC;AAC7D,SAAO;AACT;",
6
- "names": ["import_login", "path", "settings", "name", "selection"]
7
- }
@@ -1,43 +0,0 @@
1
- "use strict";
2
- var __defProp = Object.defineProperty;
3
- var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
- var __getOwnPropNames = Object.getOwnPropertyNames;
5
- var __hasOwnProp = Object.prototype.hasOwnProperty;
6
- var __export = (target, all) => {
7
- for (var name in all)
8
- __defProp(target, name, { get: all[name], enumerable: true });
9
- };
10
- var __copyProps = (to, from, except, desc) => {
11
- if (from && typeof from === "object" || typeof from === "function") {
12
- for (let key of __getOwnPropNames(from))
13
- if (!__hasOwnProp.call(to, key) && key !== except)
14
- __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
15
- }
16
- return to;
17
- };
18
- var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
19
- var deployKeyWarning_exports = {};
20
- __export(deployKeyWarning_exports, {
21
- warnIfDeployKeyOverridesLogin: () => warnIfDeployKeyOverridesLogin
22
- });
23
- module.exports = __toCommonJS(deployKeyWarning_exports);
24
- var import_log = require("../../bundler/log.js");
25
- var import_deployment = require("./deployment.js");
26
- var import_envvars = require("./envvars.js");
27
- var import_utils = require("./utils/utils.js");
28
- const warnedContexts = /* @__PURE__ */ new WeakSet();
29
- function warnIfDeployKeyOverridesLogin(ctx, hasAccount) {
30
- if (!hasAccount || warnedContexts.has(ctx) || process.env.CONVEX_OVERRIDE_ACCESS_TOKEN)
31
- return;
32
- const key = (0, import_utils.readDeployKeyFromEnv)((name) => process.env[name]);
33
- if (key === void 0 || key === import_utils.IGNORED_DEPLOY_KEY || (0, import_deployment.isPreviewDeployKey)(key))
34
- return;
35
- const { envVarName, source } = (0, import_envvars.getDeployKeySource)(key);
36
- const type = (0, import_deployment.deploymentTypeFromAdminKey)(key);
37
- const target = (0, import_deployment.isDeploymentKey)(key) ? `${type === "prod" ? "production" : type} deployment "${(0, import_deployment.deploymentNameFromAdminKey)(key)}"` : (0, import_deployment.isProjectKey)(key) ? "the project selected by the key" : "the deployment selected by the key";
38
- (0, import_log.logWarning)(
39
- `WARNING: ${envVarName} in ${source} overrides your Convex account for deployment commands. They target ${target}. Remove ${envVarName} to use the selected account.`
40
- );
41
- warnedContexts.add(ctx);
42
- }
43
- //# sourceMappingURL=deployKeyWarning.js.map
@@ -1,7 +0,0 @@
1
- {
2
- "version": 3,
3
- "sources": ["../../../../src/cli/lib/deployKeyWarning.ts"],
4
- "sourcesContent": ["import { Context } from \"../../bundler/context.js\";\nimport { logWarning } from \"../../bundler/log.js\";\nimport {\n deploymentNameFromAdminKey,\n deploymentTypeFromAdminKey,\n isDeploymentKey,\n isPreviewDeployKey,\n isProjectKey,\n} from \"./deployment.js\";\nimport { getDeployKeySource } from \"./envvars.js\";\nimport { IGNORED_DEPLOY_KEY, readDeployKeyFromEnv } from \"./utils/utils.js\";\n\nconst warnedContexts = new WeakSet<Context>();\n\nexport function warnIfDeployKeyOverridesLogin(\n ctx: Context,\n hasAccount: boolean,\n) {\n if (\n !hasAccount ||\n warnedContexts.has(ctx) ||\n process.env.CONVEX_OVERRIDE_ACCESS_TOKEN\n )\n return;\n const key = readDeployKeyFromEnv((name) => process.env[name]);\n if (\n key === undefined ||\n key === IGNORED_DEPLOY_KEY ||\n isPreviewDeployKey(key)\n )\n return;\n const { envVarName, source } = getDeployKeySource(key);\n const type = deploymentTypeFromAdminKey(key);\n const target = isDeploymentKey(key)\n ? `${type === \"prod\" ? \"production\" : type} deployment \"${deploymentNameFromAdminKey(key)}\"`\n : isProjectKey(key)\n ? \"the project selected by the key\"\n : \"the deployment selected by the key\";\n logWarning(\n `WARNING: ${envVarName} in ${source} overrides your Convex account for deployment commands. They target ${target}. Remove ${envVarName} to use the selected account.`,\n );\n warnedContexts.add(ctx);\n}\n"],
5
- "mappings": ";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AACA,iBAA2B;AAC3B,wBAMO;AACP,qBAAmC;AACnC,mBAAyD;AAEzD,MAAM,iBAAiB,oBAAI,QAAiB;AAErC,SAAS,8BACd,KACA,YACA;AACA,MACE,CAAC,cACD,eAAe,IAAI,GAAG,KACtB,QAAQ,IAAI;AAEZ;AACF,QAAM,UAAM,mCAAqB,CAAC,SAAS,QAAQ,IAAI,IAAI,CAAC;AAC5D,MACE,QAAQ,UACR,QAAQ,uCACR,sCAAmB,GAAG;AAEtB;AACF,QAAM,EAAE,YAAY,OAAO,QAAI,mCAAmB,GAAG;AACrD,QAAM,WAAO,8CAA2B,GAAG;AAC3C,QAAM,aAAS,mCAAgB,GAAG,IAC9B,GAAG,SAAS,SAAS,eAAe,IAAI,oBAAgB,8CAA2B,GAAG,CAAC,UACvF,gCAAa,GAAG,IACd,oCACA;AACN;AAAA,IACE,YAAY,UAAU,OAAO,MAAM,uEAAuE,MAAM,YAAY,UAAU;AAAA,EACxI;AACA,iBAAe,IAAI,GAAG;AACxB;",
6
- "names": []
7
- }
@@ -1,196 +0,0 @@
1
- "use strict";
2
- var __defProp = Object.defineProperty;
3
- var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
- var __getOwnPropNames = Object.getOwnPropertyNames;
5
- var __hasOwnProp = Object.prototype.hasOwnProperty;
6
- var __export = (target, all) => {
7
- for (var name in all)
8
- __defProp(target, name, { get: all[name], enumerable: true });
9
- };
10
- var __copyProps = (to, from, except, desc) => {
11
- if (from && typeof from === "object" || typeof from === "function") {
12
- for (let key of __getOwnPropNames(from))
13
- if (!__hasOwnProp.call(to, key) && key !== except)
14
- __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
15
- }
16
- return to;
17
- };
18
- var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
19
- var profileManagement_exports = {};
20
- __export(profileManagement_exports, {
21
- bindProfileToDirectory: () => bindProfileToDirectory,
22
- deploymentAccess: () => deploymentAccess,
23
- profileApi: () => profileApi,
24
- profileLoginMetadata: () => profileLoginMetadata,
25
- projectAccess: () => projectAccess,
26
- revokeReplacedProfileToken: () => revokeReplacedProfileToken
27
- });
28
- module.exports = __toCommonJS(profileManagement_exports);
29
- var import_log = require("../../bundler/log.js");
30
- var import_config = require("./config.js");
31
- var import_version = require("../version.js");
32
- var import_deployment = require("./deployment.js");
33
- var import_utils = require("./utils/utils.js");
34
- var import_prompts = require("./utils/prompts.js");
35
- var import_envvars = require("./envvars.js");
36
- var import_profiles = require("./profiles.js");
37
- async function profileApi(token, pathname, body) {
38
- return await fetch(`${import_config.provisionHost}${pathname}`, {
39
- method: body === void 0 ? "GET" : "POST",
40
- headers: {
41
- Authorization: `Bearer ${token}`,
42
- "Convex-Client": `npm-cli-${import_version.version}`,
43
- ...body === void 0 ? {} : { "Content-Type": "application/json" }
44
- },
45
- ...body === void 0 ? {} : { body: JSON.stringify(body) },
46
- signal: AbortSignal.timeout(1e4)
47
- });
48
- }
49
- async function deploymentAccess(token, deploymentName) {
50
- try {
51
- const response = await profileApi(
52
- token,
53
- `/v1/deployments/${encodeURIComponent(deploymentName)}`
54
- );
55
- if (response.ok) return "yes";
56
- return [401, 403, 404].includes(response.status) ? "no" : "unknown";
57
- } catch {
58
- return "unknown";
59
- }
60
- }
61
- async function projectAccess(token, target) {
62
- if (target.kind === "deploymentName")
63
- return deploymentAccess(token, target.deploymentName);
64
- if (target.kind !== "teamAndProjectSlugs") return "unknown";
65
- try {
66
- const response = await profileApi(
67
- token,
68
- `/v1/teams/${encodeURIComponent(target.teamSlug)}/projects/${encodeURIComponent(target.projectSlug)}`
69
- );
70
- if (response.ok) return "yes";
71
- return [401, 403, 404].includes(response.status) ? "no" : "unknown";
72
- } catch {
73
- return "unknown";
74
- }
75
- }
76
- function configuredCloudDeployment() {
77
- const configured = process.env[import_utils.CONVEX_DEPLOYMENT_ENV_VAR_NAME]?.trim();
78
- if (!configured || (0, import_deployment.getDeploymentTypeFromConfiguredDeployment)(configured) === "local")
79
- return null;
80
- const name = (0, import_deployment.stripDeploymentTypePrefix)(configured);
81
- return (0, import_deployment.isAnonymousDeployment)(name) ? null : name;
82
- }
83
- async function bindProfileToDirectory(ctx, name, force = false, target) {
84
- const credentials = await (0, import_profiles.readProfileCredentials)(ctx, {
85
- name,
86
- source: "account selection"
87
- });
88
- (0, import_envvars.loadProjectEnvironmentVariables)();
89
- const deployment = configuredCloudDeployment();
90
- const selectedTarget = target ?? (deployment === null ? null : {
91
- kind: "deploymentName",
92
- deploymentName: deployment,
93
- deploymentType: null
94
- });
95
- if (!force && selectedTarget !== null) {
96
- const label = selectedTarget.kind === "teamAndProjectSlugs" ? `project "${selectedTarget.teamSlug}/${selectedTarget.projectSlug}"` : `deployment "${selectedTarget.kind === "deploymentName" ? selectedTarget.deploymentName : "configured"}"`;
97
- const access = await projectAccess(
98
- credentials.accessToken,
99
- selectedTarget
100
- );
101
- if (access !== "yes") {
102
- (0, import_log.logWarning)(
103
- access === "no" ? `Account "${name}" cannot access ${label}.` : `Could not verify whether account "${name}" can access ${label}.`
104
- );
105
- if (!process.stdin.isTTY || !await (0, import_prompts.promptYesNo)(ctx, {
106
- message: `Use account "${name}" here anyway?`,
107
- default: false
108
- })) {
109
- (0, import_log.logMessage)(
110
- `Directory selection unchanged. To select this account anyway, run \`npx convex account select ${name} --force\`.`
111
- );
112
- return false;
113
- }
114
- }
115
- }
116
- await (0, import_profiles.writeProfileDirectory)(ctx, name);
117
- return true;
118
- }
119
- async function profileLoginMetadata(ctx, profile, loginToken, previous) {
120
- let identity = null;
121
- try {
122
- const response = await profileApi(loginToken, "/api/dashboard/profile");
123
- if (response.ok) {
124
- const data = await response.json();
125
- if ((typeof data.id === "number" || typeof data.id === "string") && typeof data.email === "string") {
126
- identity = { memberId: String(data.id), email: data.email };
127
- }
128
- }
129
- } catch {
130
- }
131
- const sameAccount = previous !== null && (previous.memberId === void 0 || identity === null) ? await tokensBelongToSameAccount(previous.accessToken, loginToken) : null;
132
- if (previous !== null && (previous.memberId === void 0 || identity === null ? sameAccount !== true : identity.memberId !== previous.memberId)) {
133
- return await ctx.crash({
134
- exitCode: 1,
135
- errorType: "fatal",
136
- printedMessage: sameAccount === null && (previous.memberId === void 0 || identity === null) ? `Could not verify the identity of saved account "${profile.name}". To replace this saved login, run \`npx convex logout --account ${profile.name}\` followed by \`npx convex login --account ${profile.name}\`. Choose the intended account when logging in.` : `The login does not match saved account "${profile.name}". Log in with the matching account, or choose another name with \`npx convex login --account <name>\`.`
137
- });
138
- }
139
- return {
140
- ...identity ?? (previous?.memberId === void 0 ? {} : { memberId: previous.memberId, email: previous.email })
141
- };
142
- }
143
- async function tokensBelongToSameAccount(older, newer) {
144
- try {
145
- const responses = await Promise.all(
146
- [older, newer].map(
147
- (token) => profileApi(token, "/v1/list_personal_access_tokens?limit=100")
148
- )
149
- );
150
- if (responses.some((response) => !response.ok)) return null;
151
- const lists = await Promise.all(
152
- responses.map((response) => response.json())
153
- );
154
- if (lists.some(
155
- (list) => !Array.isArray(list.items) || list.items.length === 0
156
- ))
157
- return null;
158
- const ids = new Set(
159
- lists[0].items.map((token) => String(token.id))
160
- );
161
- if (lists[1].items.some((token) => ids.has(String(token.id))))
162
- return true;
163
- return lists.some((list) => list.pagination?.hasMore !== false) ? null : false;
164
- } catch {
165
- return null;
166
- }
167
- }
168
- async function revokeReplacedProfileToken(ctx, previous, accessToken) {
169
- if (previous === void 0 || previous === accessToken) return;
170
- const settings = await (0, import_profiles.readProfileSettings)(ctx);
171
- if (settings.revokeReplacedTokens === false || settings.accessToken === previous)
172
- return;
173
- for (const name of (0, import_profiles.savedProfileNames)(ctx)) {
174
- const token = (0, import_profiles.readProfileToken)(ctx, name);
175
- if (token === null) {
176
- (0, import_log.logWarning)(
177
- `The new login was saved, but account "${name}" could not be read. Skipping revocation of the replaced token.`
178
- );
179
- return;
180
- }
181
- if (token === previous) return;
182
- }
183
- try {
184
- const response = await profileApi(
185
- accessToken,
186
- "/v1/delete_personal_access_token",
187
- { id: previous }
188
- );
189
- if (response.ok) return;
190
- } catch {
191
- }
192
- (0, import_log.logWarning)(
193
- "The new login was saved, but the replaced token could not be revoked. You can remove it in the dashboard's account settings."
194
- );
195
- }
196
- //# sourceMappingURL=profileManagement.js.map
@@ -1,7 +0,0 @@
1
- {
2
- "version": 3,
3
- "sources": ["../../../../src/cli/lib/profileManagement.ts"],
4
- "sourcesContent": ["import { ProjectSelection } from \"./deploymentSelection.js\";\nimport { Context } from \"../../bundler/context.js\";\nimport { logMessage, logWarning } from \"../../bundler/log.js\";\nimport { provisionHost } from \"./config.js\";\nimport { version } from \"../version.js\";\nimport {\n isAnonymousDeployment,\n getDeploymentTypeFromConfiguredDeployment,\n stripDeploymentTypePrefix,\n} from \"./deployment.js\";\nimport { CONVEX_DEPLOYMENT_ENV_VAR_NAME } from \"./utils/utils.js\";\nimport { promptYesNo } from \"./utils/prompts.js\";\nimport { loadProjectEnvironmentVariables } from \"./envvars.js\";\nimport {\n ProfileCredentials,\n ProfileSelection,\n readProfileCredentials,\n readProfileSettings,\n readProfileToken,\n savedProfileNames,\n writeProfileDirectory,\n} from \"./profiles.js\";\n\nexport async function profileApi(\n token: string,\n pathname: string,\n body?: unknown,\n) {\n return await fetch(`${provisionHost}${pathname}`, {\n method: body === undefined ? \"GET\" : \"POST\",\n headers: {\n Authorization: `Bearer ${token}`,\n \"Convex-Client\": `npm-cli-${version}`,\n ...(body === undefined ? {} : { \"Content-Type\": \"application/json\" }),\n },\n ...(body === undefined ? {} : { body: JSON.stringify(body) }),\n signal: AbortSignal.timeout(10_000),\n });\n}\n\nexport async function deploymentAccess(\n token: string,\n deploymentName: string,\n): Promise<\"yes\" | \"no\" | \"unknown\"> {\n try {\n const response = await profileApi(\n token,\n `/v1/deployments/${encodeURIComponent(deploymentName)}`,\n );\n if (response.ok) return \"yes\";\n return [401, 403, 404].includes(response.status) ? \"no\" : \"unknown\";\n } catch {\n return \"unknown\";\n }\n}\n\nexport async function projectAccess(\n token: string,\n target: ProjectSelection,\n): Promise<\"yes\" | \"no\" | \"unknown\"> {\n if (target.kind === \"deploymentName\")\n return deploymentAccess(token, target.deploymentName);\n if (target.kind !== \"teamAndProjectSlugs\") return \"unknown\";\n try {\n const response = await profileApi(\n token,\n `/v1/teams/${encodeURIComponent(target.teamSlug)}/projects/${encodeURIComponent(target.projectSlug)}`,\n );\n if (response.ok) return \"yes\";\n return [401, 403, 404].includes(response.status) ? \"no\" : \"unknown\";\n } catch {\n return \"unknown\";\n }\n}\n\nfunction configuredCloudDeployment(): string | null {\n const configured = process.env[CONVEX_DEPLOYMENT_ENV_VAR_NAME]?.trim();\n if (\n !configured ||\n getDeploymentTypeFromConfiguredDeployment(configured) === \"local\"\n )\n return null;\n const name = stripDeploymentTypePrefix(configured);\n return isAnonymousDeployment(name) ? null : name;\n}\n\nexport async function bindProfileToDirectory(\n ctx: Context,\n name: string,\n force = false,\n target?: ProjectSelection,\n): Promise<boolean> {\n const credentials = await readProfileCredentials(ctx, {\n name,\n source: \"account selection\",\n });\n loadProjectEnvironmentVariables();\n const deployment = configuredCloudDeployment();\n const selectedTarget =\n target ??\n (deployment === null\n ? null\n : {\n kind: \"deploymentName\" as const,\n deploymentName: deployment,\n deploymentType: null,\n });\n if (!force && selectedTarget !== null) {\n const label =\n selectedTarget.kind === \"teamAndProjectSlugs\"\n ? `project \"${selectedTarget.teamSlug}/${selectedTarget.projectSlug}\"`\n : `deployment \"${selectedTarget.kind === \"deploymentName\" ? selectedTarget.deploymentName : \"configured\"}\"`;\n const access = await projectAccess(\n credentials!.accessToken,\n selectedTarget,\n );\n if (access !== \"yes\") {\n logWarning(\n access === \"no\"\n ? `Account \"${name}\" cannot access ${label}.`\n : `Could not verify whether account \"${name}\" can access ${label}.`,\n );\n if (\n !process.stdin.isTTY ||\n !(await promptYesNo(ctx, {\n message: `Use account \"${name}\" here anyway?`,\n default: false,\n }))\n ) {\n logMessage(\n `Directory selection unchanged. To select this account anyway, run \\`npx convex account select ${name} --force\\`.`,\n );\n return false;\n }\n }\n }\n await writeProfileDirectory(ctx, name);\n return true;\n}\n\nexport async function profileLoginMetadata(\n ctx: Context,\n profile: ProfileSelection,\n loginToken: string,\n previous: ProfileCredentials | null,\n): Promise<Omit<ProfileCredentials, \"accessToken\">> {\n let identity: { memberId: string; email: string } | null = null;\n try {\n const response = await profileApi(loginToken, \"/api/dashboard/profile\");\n if (response.ok) {\n const data = await response.json();\n if (\n (typeof data.id === \"number\" || typeof data.id === \"string\") &&\n typeof data.email === \"string\"\n ) {\n identity = { memberId: String(data.id), email: data.email };\n }\n }\n } catch {\n // Older authentication tokens can be valid without access to the dashboard profile API.\n }\n const sameAccount =\n previous !== null && (previous.memberId === undefined || identity === null)\n ? await tokensBelongToSameAccount(previous.accessToken, loginToken)\n : null;\n if (\n previous !== null &&\n (previous.memberId === undefined || identity === null\n ? sameAccount !== true\n : identity.memberId !== previous.memberId)\n ) {\n return await ctx.crash({\n exitCode: 1,\n errorType: \"fatal\",\n printedMessage:\n sameAccount === null &&\n (previous.memberId === undefined || identity === null)\n ? `Could not verify the identity of saved account \"${profile.name}\". To replace this saved login, run \\`npx convex logout --account ${profile.name}\\` followed by \\`npx convex login --account ${profile.name}\\`. Choose the intended account when logging in.`\n : `The login does not match saved account \"${profile.name}\". Log in with the matching account, or choose another name with \\`npx convex login --account <name>\\`.`,\n });\n }\n return {\n ...(identity ??\n (previous?.memberId === undefined\n ? {}\n : { memberId: previous.memberId, email: previous.email })),\n };\n}\n\nasync function tokensBelongToSameAccount(\n older: string,\n newer: string,\n): Promise<boolean | null> {\n try {\n const responses = await Promise.all(\n [older, newer].map((token) =>\n profileApi(token, \"/v1/list_personal_access_tokens?limit=100\"),\n ),\n );\n if (responses.some((response) => !response.ok)) return null;\n const lists = await Promise.all(\n responses.map((response) => response.json()),\n );\n if (\n lists.some(\n (list) => !Array.isArray(list.items) || list.items.length === 0,\n )\n )\n return null;\n const ids = new Set(\n lists[0].items.map((token: { id: unknown }) => String(token.id)),\n );\n if (\n lists[1].items.some((token: { id: unknown }) => ids.has(String(token.id)))\n )\n return true;\n // Disjoint partial pages cannot establish that the accounts differ.\n return lists.some((list) => list.pagination?.hasMore !== false)\n ? null\n : false;\n } catch {\n return null;\n }\n}\n\nexport async function revokeReplacedProfileToken(\n ctx: Context,\n previous: string | undefined,\n accessToken: string,\n) {\n if (previous === undefined || previous === accessToken) return;\n const settings = await readProfileSettings(ctx);\n if (\n settings.revokeReplacedTokens === false ||\n settings.accessToken === previous\n )\n return;\n for (const name of savedProfileNames(ctx)) {\n const token = readProfileToken(ctx, name);\n if (token === null) {\n logWarning(\n `The new login was saved, but account \"${name}\" could not be read. Skipping revocation of the replaced token.`,\n );\n return;\n }\n if (token === previous) return;\n }\n try {\n // The API verifies token ownership using the newly authenticated account.\n const response = await profileApi(\n accessToken,\n \"/v1/delete_personal_access_token\",\n { id: previous },\n );\n if (response.ok) return;\n } catch {\n // The new credentials are already saved, so a failed revocation can be retried in the dashboard.\n }\n logWarning(\n \"The new login was saved, but the replaced token could not be revoked. You can remove it in the dashboard's account settings.\",\n );\n}\n"],
5
- "mappings": ";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAEA,iBAAuC;AACvC,oBAA8B;AAC9B,qBAAwB;AACxB,wBAIO;AACP,mBAA+C;AAC/C,qBAA4B;AAC5B,qBAAgD;AAChD,sBAQO;AAEP,eAAsB,WACpB,OACA,UACA,MACA;AACA,SAAO,MAAM,MAAM,GAAG,2BAAa,GAAG,QAAQ,IAAI;AAAA,IAChD,QAAQ,SAAS,SAAY,QAAQ;AAAA,IACrC,SAAS;AAAA,MACP,eAAe,UAAU,KAAK;AAAA,MAC9B,iBAAiB,WAAW,sBAAO;AAAA,MACnC,GAAI,SAAS,SAAY,CAAC,IAAI,EAAE,gBAAgB,mBAAmB;AAAA,IACrE;AAAA,IACA,GAAI,SAAS,SAAY,CAAC,IAAI,EAAE,MAAM,KAAK,UAAU,IAAI,EAAE;AAAA,IAC3D,QAAQ,YAAY,QAAQ,GAAM;AAAA,EACpC,CAAC;AACH;AAEA,eAAsB,iBACpB,OACA,gBACmC;AACnC,MAAI;AACF,UAAM,WAAW,MAAM;AAAA,MACrB;AAAA,MACA,mBAAmB,mBAAmB,cAAc,CAAC;AAAA,IACvD;AACA,QAAI,SAAS,GAAI,QAAO;AACxB,WAAO,CAAC,KAAK,KAAK,GAAG,EAAE,SAAS,SAAS,MA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