convex 1.43.0 → 1.45.0-alpha.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 (631) hide show
  1. package/CHANGELOG.md +136 -113
  2. package/dist/browser.bundle.js +1 -1
  3. package/dist/browser.bundle.js.map +1 -1
  4. package/dist/cjs/cli/codegen_templates/component_server.js +4 -3
  5. package/dist/cjs/cli/codegen_templates/component_server.js.map +2 -2
  6. package/dist/cjs/cli/codegen_templates/server.js +24 -12
  7. package/dist/cjs/cli/codegen_templates/server.js.map +2 -2
  8. package/dist/cjs/cli/convexExport.js +1 -1
  9. package/dist/cjs/cli/convexExport.js.map +1 -1
  10. package/dist/cjs/cli/index.js +2 -32
  11. package/dist/cjs/cli/index.js.map +2 -2
  12. package/dist/cjs/cli/lib/api.js +11 -5
  13. package/dist/cjs/cli/lib/api.js.map +2 -2
  14. package/dist/cjs/cli/lib/convexExport.js +12 -1
  15. package/dist/cjs/cli/lib/convexExport.js.map +2 -2
  16. package/dist/cjs/cli/lib/dashboard.js.map +2 -2
  17. package/dist/cjs/cli/lib/generatedFunctionLogsApi.js.map +1 -1
  18. package/dist/cjs/cli/lib/localDeployment/upgrade.js +23 -188
  19. package/dist/cjs/cli/lib/localDeployment/upgrade.js.map +3 -3
  20. package/dist/cjs/cli/lib/login.js +12 -8
  21. package/dist/cjs/cli/lib/login.js.map +2 -2
  22. package/dist/cjs/cli/lib/mcp/tools/index.js.map +1 -1
  23. package/dist/cjs/cli/login.js +52 -7
  24. package/dist/cjs/cli/login.js.map +2 -2
  25. package/dist/cjs/cli/mcp.js +60 -63
  26. package/dist/cjs/cli/mcp.js.map +2 -2
  27. package/dist/cjs/index.js +1 -1
  28. package/dist/cjs/index.js.map +1 -1
  29. package/dist/cjs/react/ConvexAuthState.js +30 -32
  30. package/dist/cjs/react/ConvexAuthState.js.map +2 -2
  31. package/dist/cjs/server/impl/actions_impl.js +12 -0
  32. package/dist/cjs/server/impl/actions_impl.js.map +2 -2
  33. package/dist/cjs/server/index.js +3 -0
  34. package/dist/cjs/server/index.js.map +2 -2
  35. package/dist/cjs/server/schema.js +69 -1
  36. package/dist/cjs/server/schema.js.map +2 -2
  37. package/dist/cjs-types/cli/codegen_templates/component_server.d.ts.map +1 -1
  38. package/dist/cjs-types/cli/codegen_templates/server.d.ts +1 -0
  39. package/dist/cjs-types/cli/codegen_templates/server.d.ts.map +1 -1
  40. package/dist/cjs-types/cli/lib/api.d.ts.map +1 -1
  41. package/dist/cjs-types/cli/lib/convexExport.d.ts +1 -0
  42. package/dist/cjs-types/cli/lib/convexExport.d.ts.map +1 -1
  43. package/dist/cjs-types/cli/lib/dashboard.d.ts.map +1 -1
  44. package/dist/cjs-types/cli/lib/generatedFunctionLogsApi.d.ts +2 -0
  45. package/dist/cjs-types/cli/lib/generatedFunctionLogsApi.d.ts.map +1 -1
  46. package/dist/cjs-types/cli/lib/localDeployment/upgrade.d.ts +2 -0
  47. package/dist/cjs-types/cli/lib/localDeployment/upgrade.d.ts.map +1 -1
  48. package/dist/cjs-types/cli/lib/login.d.ts +5 -0
  49. package/dist/cjs-types/cli/lib/login.d.ts.map +1 -1
  50. package/dist/cjs-types/cli/lib/mcp/tools/index.d.ts +1 -1
  51. package/dist/cjs-types/cli/lib/mcp/tools/index.d.ts.map +1 -1
  52. package/dist/cjs-types/cli/login.d.ts.map +1 -1
  53. package/dist/cjs-types/cli/mcp.d.ts +3 -0
  54. package/dist/cjs-types/cli/mcp.d.ts.map +1 -1
  55. package/dist/cjs-types/index.d.ts +1 -1
  56. package/dist/cjs-types/index.d.ts.map +1 -1
  57. package/dist/cjs-types/react/ConvexAuthState.d.ts.map +1 -1
  58. package/dist/cjs-types/server/impl/actions_impl.d.ts.map +1 -1
  59. package/dist/cjs-types/server/index.d.ts +2 -2
  60. package/dist/cjs-types/server/index.d.ts.map +1 -1
  61. package/dist/cjs-types/server/schema.d.ts +83 -5
  62. package/dist/cjs-types/server/schema.d.ts.map +1 -1
  63. package/dist/cli.bundle.cjs +23775 -18752
  64. package/dist/cli.bundle.cjs.map +4 -4
  65. package/dist/esm/cli/codegen_templates/component_server.js +8 -4
  66. package/dist/esm/cli/codegen_templates/component_server.js.map +2 -2
  67. package/dist/esm/cli/codegen_templates/server.js +22 -11
  68. package/dist/esm/cli/codegen_templates/server.js.map +2 -2
  69. package/dist/esm/cli/convexExport.js +1 -1
  70. package/dist/esm/cli/convexExport.js.map +1 -1
  71. package/dist/esm/cli/index.js +2 -32
  72. package/dist/esm/cli/index.js.map +2 -2
  73. package/dist/esm/cli/lib/api.js +11 -5
  74. package/dist/esm/cli/lib/api.js.map +2 -2
  75. package/dist/esm/cli/lib/convexExport.js +16 -3
  76. package/dist/esm/cli/lib/convexExport.js.map +2 -2
  77. package/dist/esm/cli/lib/dashboard.js.map +2 -2
  78. package/dist/esm/cli/lib/localDeployment/upgrade.js +22 -190
  79. package/dist/esm/cli/lib/localDeployment/upgrade.js.map +2 -2
  80. package/dist/esm/cli/lib/login.js +11 -8
  81. package/dist/esm/cli/lib/login.js.map +2 -2
  82. package/dist/esm/cli/lib/mcp/tools/index.js.map +1 -1
  83. package/dist/esm/cli/login.js +54 -10
  84. package/dist/esm/cli/login.js.map +2 -2
  85. package/dist/esm/cli/mcp.js +60 -67
  86. package/dist/esm/cli/mcp.js.map +2 -2
  87. package/dist/esm/index.js +1 -1
  88. package/dist/esm/index.js.map +1 -1
  89. package/dist/esm/react/ConvexAuthState.js +31 -32
  90. package/dist/esm/react/ConvexAuthState.js.map +2 -2
  91. package/dist/esm/server/impl/actions_impl.js +11 -0
  92. package/dist/esm/server/impl/actions_impl.js.map +2 -2
  93. package/dist/esm/server/index.js +2 -1
  94. package/dist/esm/server/index.js.map +2 -2
  95. package/dist/esm/server/schema.js +67 -0
  96. package/dist/esm/server/schema.js.map +2 -2
  97. package/dist/esm-types/cli/codegen_templates/component_server.d.ts.map +1 -1
  98. package/dist/esm-types/cli/codegen_templates/server.d.ts +1 -0
  99. package/dist/esm-types/cli/codegen_templates/server.d.ts.map +1 -1
  100. package/dist/esm-types/cli/lib/api.d.ts.map +1 -1
  101. package/dist/esm-types/cli/lib/convexExport.d.ts +1 -0
  102. package/dist/esm-types/cli/lib/convexExport.d.ts.map +1 -1
  103. package/dist/esm-types/cli/lib/dashboard.d.ts.map +1 -1
  104. package/dist/esm-types/cli/lib/generatedFunctionLogsApi.d.ts +2 -0
  105. package/dist/esm-types/cli/lib/generatedFunctionLogsApi.d.ts.map +1 -1
  106. package/dist/esm-types/cli/lib/localDeployment/upgrade.d.ts +2 -0
  107. package/dist/esm-types/cli/lib/localDeployment/upgrade.d.ts.map +1 -1
  108. package/dist/esm-types/cli/lib/login.d.ts +5 -0
  109. package/dist/esm-types/cli/lib/login.d.ts.map +1 -1
  110. package/dist/esm-types/cli/lib/mcp/tools/index.d.ts +1 -1
  111. package/dist/esm-types/cli/lib/mcp/tools/index.d.ts.map +1 -1
  112. package/dist/esm-types/cli/login.d.ts.map +1 -1
  113. package/dist/esm-types/cli/mcp.d.ts +3 -0
  114. package/dist/esm-types/cli/mcp.d.ts.map +1 -1
  115. package/dist/esm-types/index.d.ts +1 -1
  116. package/dist/esm-types/index.d.ts.map +1 -1
  117. package/dist/esm-types/react/ConvexAuthState.d.ts.map +1 -1
  118. package/dist/esm-types/server/impl/actions_impl.d.ts.map +1 -1
  119. package/dist/esm-types/server/index.d.ts +2 -2
  120. package/dist/esm-types/server/index.d.ts.map +1 -1
  121. package/dist/esm-types/server/schema.d.ts +83 -5
  122. package/dist/esm-types/server/schema.d.ts.map +1 -1
  123. package/dist/react.bundle.js +31 -33
  124. package/dist/react.bundle.js.map +2 -2
  125. package/package.json +5 -6
  126. package/src/cli/codegen_templates/component_server.ts +12 -6
  127. package/src/cli/codegen_templates/server.ts +36 -19
  128. package/src/cli/convexExport.ts +1 -1
  129. package/src/cli/index.ts +2 -35
  130. package/src/cli/lib/api.ts +11 -5
  131. package/src/cli/lib/convexExport.ts +21 -0
  132. package/src/cli/lib/dashboard.ts +2 -0
  133. package/src/cli/lib/generatedFunctionLogsApi.ts +2 -0
  134. package/src/cli/lib/localDeployment/upgrade.ts +34 -207
  135. package/src/cli/lib/login.ts +20 -9
  136. package/src/cli/lib/mcp/tools/index.ts +1 -1
  137. package/src/cli/login.ts +88 -13
  138. package/src/cli/mcp.ts +64 -72
  139. package/src/index.ts +1 -1
  140. package/src/react/ConvexAuthState.tsx +15 -7
  141. package/src/server/impl/actions_impl.ts +23 -0
  142. package/src/server/index.ts +7 -1
  143. package/src/server/schema.ts +178 -1
  144. package/dist/cjs-types/browser/http_client.test.d.ts +0 -2
  145. package/dist/cjs-types/browser/http_client.test.d.ts.map +0 -1
  146. package/dist/cjs-types/browser/query_options.test.d.ts +0 -2
  147. package/dist/cjs-types/browser/query_options.test.d.ts.map +0 -1
  148. package/dist/cjs-types/browser/simple_client.test.d.ts +0 -2
  149. package/dist/cjs-types/browser/simple_client.test.d.ts.map +0 -1
  150. package/dist/cjs-types/browser/sync/client.test.d.ts +0 -5
  151. package/dist/cjs-types/browser/sync/client.test.d.ts.map +0 -1
  152. package/dist/cjs-types/browser/sync/client_node.test.d.ts +0 -2
  153. package/dist/cjs-types/browser/sync/client_node.test.d.ts.map +0 -1
  154. package/dist/cjs-types/browser/sync/client_node_test_helpers.d.ts +0 -44
  155. package/dist/cjs-types/browser/sync/client_node_test_helpers.d.ts.map +0 -1
  156. package/dist/cjs-types/browser/sync/local_state.test.d.ts +0 -2
  157. package/dist/cjs-types/browser/sync/local_state.test.d.ts.map +0 -1
  158. package/dist/cjs-types/browser/sync/optimistic_query_set.test.d.ts +0 -2
  159. package/dist/cjs-types/browser/sync/optimistic_query_set.test.d.ts.map +0 -1
  160. package/dist/cjs-types/browser/sync/paginated_query_client.test.d.ts +0 -2
  161. package/dist/cjs-types/browser/sync/paginated_query_client.test.d.ts.map +0 -1
  162. package/dist/cjs-types/browser/sync/protocol.test.d.ts +0 -5
  163. package/dist/cjs-types/browser/sync/protocol.test.d.ts.map +0 -1
  164. package/dist/cjs-types/browser/sync/request_manager.test.d.ts +0 -2
  165. package/dist/cjs-types/browser/sync/request_manager.test.d.ts.map +0 -1
  166. package/dist/cjs-types/bundler/fs.test.d.ts +0 -2
  167. package/dist/cjs-types/bundler/fs.test.d.ts.map +0 -1
  168. package/dist/cjs-types/bundler/index.test.d.ts +0 -2
  169. package/dist/cjs-types/bundler/index.test.d.ts.map +0 -1
  170. package/dist/cjs-types/cli/codegen_templates/api.test.d.ts +0 -2
  171. package/dist/cjs-types/cli/codegen_templates/api.test.d.ts.map +0 -1
  172. package/dist/cjs-types/cli/codegen_templates/common.test.d.ts +0 -2
  173. package/dist/cjs-types/cli/codegen_templates/common.test.d.ts.map +0 -1
  174. package/dist/cjs-types/cli/codegen_templates/templates.test.d.ts +0 -2
  175. package/dist/cjs-types/cli/codegen_templates/templates.test.d.ts.map +0 -1
  176. package/dist/cjs-types/cli/codegen_templates/validator_helpers.test.d.ts +0 -2
  177. package/dist/cjs-types/cli/codegen_templates/validator_helpers.test.d.ts.map +0 -1
  178. package/dist/cjs-types/cli/configure.test.d.ts +0 -2
  179. package/dist/cjs-types/cli/configure.test.d.ts.map +0 -1
  180. package/dist/cjs-types/cli/deploymentCreate.test.d.ts +0 -2
  181. package/dist/cjs-types/cli/deploymentCreate.test.d.ts.map +0 -1
  182. package/dist/cjs-types/cli/deploymentSelect.test.d.ts +0 -2
  183. package/dist/cjs-types/cli/deploymentSelect.test.d.ts.map +0 -1
  184. package/dist/cjs-types/cli/deploymentSelection.test.d.ts +0 -2
  185. package/dist/cjs-types/cli/deploymentSelection.test.d.ts.map +0 -1
  186. package/dist/cjs-types/cli/deploymentToken.test.d.ts +0 -2
  187. package/dist/cjs-types/cli/deploymentToken.test.d.ts.map +0 -1
  188. package/dist/cjs-types/cli/dev.test.d.ts +0 -2
  189. package/dist/cjs-types/cli/dev.test.d.ts.map +0 -1
  190. package/dist/cjs-types/cli/envDefault.test.d.ts +0 -2
  191. package/dist/cjs-types/cli/envDefault.test.d.ts.map +0 -1
  192. package/dist/cjs-types/cli/lib/aiFiles/agentsmd.test.d.ts +0 -2
  193. package/dist/cjs-types/cli/lib/aiFiles/agentsmd.test.d.ts.map +0 -1
  194. package/dist/cjs-types/cli/lib/aiFiles/claudemd.test.d.ts +0 -2
  195. package/dist/cjs-types/cli/lib/aiFiles/claudemd.test.d.ts.map +0 -1
  196. package/dist/cjs-types/cli/lib/aiFiles/guidelinesmd.test.d.ts +0 -2
  197. package/dist/cjs-types/cli/lib/aiFiles/guidelinesmd.test.d.ts.map +0 -1
  198. package/dist/cjs-types/cli/lib/aiFiles/index.test.d.ts +0 -2
  199. package/dist/cjs-types/cli/lib/aiFiles/index.test.d.ts.map +0 -1
  200. package/dist/cjs-types/cli/lib/aiFiles/integration.test.d.ts +0 -2
  201. package/dist/cjs-types/cli/lib/aiFiles/integration.test.d.ts.map +0 -1
  202. package/dist/cjs-types/cli/lib/aiFiles/prompt.test.d.ts +0 -2
  203. package/dist/cjs-types/cli/lib/aiFiles/prompt.test.d.ts.map +0 -1
  204. package/dist/cjs-types/cli/lib/aiFiles/state.test.d.ts +0 -2
  205. package/dist/cjs-types/cli/lib/aiFiles/state.test.d.ts.map +0 -1
  206. package/dist/cjs-types/cli/lib/aiFiles/utils.test.d.ts +0 -2
  207. package/dist/cjs-types/cli/lib/aiFiles/utils.test.d.ts.map +0 -1
  208. package/dist/cjs-types/cli/lib/codegen.test.d.ts +0 -2
  209. package/dist/cjs-types/cli/lib/codegen.test.d.ts.map +0 -1
  210. package/dist/cjs-types/cli/lib/components.test.d.ts +0 -2
  211. package/dist/cjs-types/cli/lib/components.test.d.ts.map +0 -1
  212. package/dist/cjs-types/cli/lib/config.test.d.ts +0 -2
  213. package/dist/cjs-types/cli/lib/config.test.d.ts.map +0 -1
  214. package/dist/cjs-types/cli/lib/deployment.test.d.ts +0 -2
  215. package/dist/cjs-types/cli/lib/deployment.test.d.ts.map +0 -1
  216. package/dist/cjs-types/cli/lib/deploymentSelector.test.d.ts +0 -2
  217. package/dist/cjs-types/cli/lib/deploymentSelector.test.d.ts.map +0 -1
  218. package/dist/cjs-types/cli/lib/env.test.d.ts +0 -2
  219. package/dist/cjs-types/cli/lib/env.test.d.ts.map +0 -1
  220. package/dist/cjs-types/cli/lib/expiration.test.d.ts +0 -2
  221. package/dist/cjs-types/cli/lib/expiration.test.d.ts.map +0 -1
  222. package/dist/cjs-types/cli/lib/extractDeploymentNameForWorkOS.test.d.ts +0 -2
  223. package/dist/cjs-types/cli/lib/extractDeploymentNameForWorkOS.test.d.ts.map +0 -1
  224. package/dist/cjs-types/cli/lib/formatEnvValueForDotfile.test.d.ts +0 -2
  225. package/dist/cjs-types/cli/lib/formatEnvValueForDotfile.test.d.ts.map +0 -1
  226. package/dist/cjs-types/cli/lib/formatTargetedDeployment.test.d.ts +0 -2
  227. package/dist/cjs-types/cli/lib/formatTargetedDeployment.test.d.ts.map +0 -1
  228. package/dist/cjs-types/cli/lib/fsUtils.test.d.ts +0 -2
  229. package/dist/cjs-types/cli/lib/fsUtils.test.d.ts.map +0 -1
  230. package/dist/cjs-types/cli/lib/generateDocs.test.d.ts +0 -2
  231. package/dist/cjs-types/cli/lib/generateDocs.test.d.ts.map +0 -1
  232. package/dist/cjs-types/cli/lib/indexes.test.d.ts +0 -2
  233. package/dist/cjs-types/cli/lib/indexes.test.d.ts.map +0 -1
  234. package/dist/cjs-types/cli/lib/localDeployment/run.test.d.ts +0 -2
  235. package/dist/cjs-types/cli/lib/localDeployment/run.test.d.ts.map +0 -1
  236. package/dist/cjs-types/cli/lib/localDeployment/secrets.test.d.ts +0 -2
  237. package/dist/cjs-types/cli/lib/localDeployment/secrets.test.d.ts.map +0 -1
  238. package/dist/cjs-types/cli/lib/run.test.d.ts +0 -2
  239. package/dist/cjs-types/cli/lib/run.test.d.ts.map +0 -1
  240. package/dist/cjs-types/cli/lib/runTestFunction.test.d.ts +0 -2
  241. package/dist/cjs-types/cli/lib/runTestFunction.test.d.ts.map +0 -1
  242. package/dist/cjs-types/cli/lib/typecheck.test.d.ts +0 -2
  243. package/dist/cjs-types/cli/lib/typecheck.test.d.ts.map +0 -1
  244. package/dist/cjs-types/cli/lib/updates.test.d.ts +0 -2
  245. package/dist/cjs-types/cli/lib/updates.test.d.ts.map +0 -1
  246. package/dist/cjs-types/cli/lib/utils/hash.test.d.ts +0 -2
  247. package/dist/cjs-types/cli/lib/utils/hash.test.d.ts.map +0 -1
  248. package/dist/cjs-types/cli/lib/utils/utils.test.d.ts +0 -2
  249. package/dist/cjs-types/cli/lib/utils/utils.test.d.ts.map +0 -1
  250. package/dist/cjs-types/cli/lib/versionApi.test.d.ts +0 -2
  251. package/dist/cjs-types/cli/lib/versionApi.test.d.ts.map +0 -1
  252. package/dist/cjs-types/cli/lib/workos/environmentApi.test.d.ts +0 -2
  253. package/dist/cjs-types/cli/lib/workos/environmentApi.test.d.ts.map +0 -1
  254. package/dist/cjs-types/cli/lib/workos/workos.test.d.ts +0 -2
  255. package/dist/cjs-types/cli/lib/workos/workos.test.d.ts.map +0 -1
  256. package/dist/cjs-types/common/index.test.d.ts +0 -2
  257. package/dist/cjs-types/common/index.test.d.ts.map +0 -1
  258. package/dist/cjs-types/nextjs/nextjs.test.d.ts +0 -2
  259. package/dist/cjs-types/nextjs/nextjs.test.d.ts.map +0 -1
  260. package/dist/cjs-types/react/ConvexAuthState.test.d.ts +0 -2
  261. package/dist/cjs-types/react/ConvexAuthState.test.d.ts.map +0 -1
  262. package/dist/cjs-types/react/auth_helpers.test.d.ts +0 -2
  263. package/dist/cjs-types/react/auth_helpers.test.d.ts.map +0 -1
  264. package/dist/cjs-types/react/auth_websocket.test.d.ts +0 -2
  265. package/dist/cjs-types/react/auth_websocket.test.d.ts.map +0 -1
  266. package/dist/cjs-types/react/client.test.d.ts +0 -2
  267. package/dist/cjs-types/react/client.test.d.ts.map +0 -1
  268. package/dist/cjs-types/react/client_provided_base_client.test.d.ts +0 -2
  269. package/dist/cjs-types/react/client_provided_base_client.test.d.ts.map +0 -1
  270. package/dist/cjs-types/react/queries_observer.test.d.ts +0 -2
  271. package/dist/cjs-types/react/queries_observer.test.d.ts.map +0 -1
  272. package/dist/cjs-types/react/react_node.test.d.ts +0 -2
  273. package/dist/cjs-types/react/react_node.test.d.ts.map +0 -1
  274. package/dist/cjs-types/react/use_paginated_query.test.d.ts +0 -2
  275. package/dist/cjs-types/react/use_paginated_query.test.d.ts.map +0 -1
  276. package/dist/cjs-types/react/use_queries.test.d.ts +0 -5
  277. package/dist/cjs-types/react/use_queries.test.d.ts.map +0 -1
  278. package/dist/cjs-types/react/use_query.test.d.ts +0 -5
  279. package/dist/cjs-types/react/use_query.test.d.ts.map +0 -1
  280. package/dist/cjs-types/react/use_query_object_options.test.d.ts +0 -5
  281. package/dist/cjs-types/react/use_query_object_options.test.d.ts.map +0 -1
  282. package/dist/cjs-types/react/use_query_result.test.d.ts +0 -5
  283. package/dist/cjs-types/react/use_query_result.test.d.ts.map +0 -1
  284. package/dist/cjs-types/react-auth0/ConvexProviderWithAuth0.test.d.ts +0 -2
  285. package/dist/cjs-types/react-auth0/ConvexProviderWithAuth0.test.d.ts.map +0 -1
  286. package/dist/cjs-types/react-clerk/ConvexProviderWithClerk.test.d.ts +0 -2
  287. package/dist/cjs-types/react-clerk/ConvexProviderWithClerk.test.d.ts.map +0 -1
  288. package/dist/cjs-types/server/api.intersect.test.d.ts +0 -2
  289. package/dist/cjs-types/server/api.intersect.test.d.ts.map +0 -1
  290. package/dist/cjs-types/server/api.test.d.ts +0 -2
  291. package/dist/cjs-types/server/api.test.d.ts.map +0 -1
  292. package/dist/cjs-types/server/audit_logging.test.d.ts +0 -2
  293. package/dist/cjs-types/server/audit_logging.test.d.ts.map +0 -1
  294. package/dist/cjs-types/server/components/index.test.d.ts +0 -2
  295. package/dist/cjs-types/server/components/index.test.d.ts.map +0 -1
  296. package/dist/cjs-types/server/cron.test.d.ts +0 -2
  297. package/dist/cjs-types/server/cron.test.d.ts.map +0 -1
  298. package/dist/cjs-types/server/data_model.test.d.ts +0 -2
  299. package/dist/cjs-types/server/data_model.test.d.ts.map +0 -1
  300. package/dist/cjs-types/server/database.test.d.ts +0 -2
  301. package/dist/cjs-types/server/database.test.d.ts.map +0 -1
  302. package/dist/cjs-types/server/database_api.test.d.ts +0 -2
  303. package/dist/cjs-types/server/database_api.test.d.ts.map +0 -1
  304. package/dist/cjs-types/server/filter_builder.test.d.ts +0 -2
  305. package/dist/cjs-types/server/filter_builder.test.d.ts.map +0 -1
  306. package/dist/cjs-types/server/impl/filter_builder_impl.test.d.ts +0 -2
  307. package/dist/cjs-types/server/impl/filter_builder_impl.test.d.ts.map +0 -1
  308. package/dist/cjs-types/server/impl/query_impl.test.d.ts +0 -2
  309. package/dist/cjs-types/server/impl/query_impl.test.d.ts.map +0 -1
  310. package/dist/cjs-types/server/pagination.test.d.ts +0 -2
  311. package/dist/cjs-types/server/pagination.test.d.ts.map +0 -1
  312. package/dist/cjs-types/server/query.test.d.ts +0 -2
  313. package/dist/cjs-types/server/query.test.d.ts.map +0 -1
  314. package/dist/cjs-types/server/registration.test.d.ts +0 -2
  315. package/dist/cjs-types/server/registration.test.d.ts.map +0 -1
  316. package/dist/cjs-types/server/router.test.d.ts +0 -2
  317. package/dist/cjs-types/server/router.test.d.ts.map +0 -1
  318. package/dist/cjs-types/server/scheduler.test.d.ts +0 -2
  319. package/dist/cjs-types/server/scheduler.test.d.ts.map +0 -1
  320. package/dist/cjs-types/server/schema.test.d.ts +0 -2
  321. package/dist/cjs-types/server/schema.test.d.ts.map +0 -1
  322. package/dist/cjs-types/test/fake_watch.d.ts +0 -16
  323. package/dist/cjs-types/test/fake_watch.d.ts.map +0 -1
  324. package/dist/cjs-types/test/type_testing.d.ts +0 -9
  325. package/dist/cjs-types/test/type_testing.d.ts.map +0 -1
  326. package/dist/cjs-types/type_utils.test.d.ts +0 -2
  327. package/dist/cjs-types/type_utils.test.d.ts.map +0 -1
  328. package/dist/cjs-types/values/size.test.d.ts +0 -2
  329. package/dist/cjs-types/values/size.test.d.ts.map +0 -1
  330. package/dist/cjs-types/values/validator.test.d.ts +0 -2
  331. package/dist/cjs-types/values/validator.test.d.ts.map +0 -1
  332. package/dist/cjs-types/values/value.test.d.ts +0 -2
  333. package/dist/cjs-types/values/value.test.d.ts.map +0 -1
  334. package/dist/esm-types/browser/http_client.test.d.ts +0 -2
  335. package/dist/esm-types/browser/http_client.test.d.ts.map +0 -1
  336. package/dist/esm-types/browser/query_options.test.d.ts +0 -2
  337. package/dist/esm-types/browser/query_options.test.d.ts.map +0 -1
  338. package/dist/esm-types/browser/simple_client.test.d.ts +0 -2
  339. package/dist/esm-types/browser/simple_client.test.d.ts.map +0 -1
  340. package/dist/esm-types/browser/sync/client.test.d.ts +0 -5
  341. package/dist/esm-types/browser/sync/client.test.d.ts.map +0 -1
  342. package/dist/esm-types/browser/sync/client_node.test.d.ts +0 -2
  343. package/dist/esm-types/browser/sync/client_node.test.d.ts.map +0 -1
  344. package/dist/esm-types/browser/sync/client_node_test_helpers.d.ts +0 -44
  345. package/dist/esm-types/browser/sync/client_node_test_helpers.d.ts.map +0 -1
  346. package/dist/esm-types/browser/sync/local_state.test.d.ts +0 -2
  347. package/dist/esm-types/browser/sync/local_state.test.d.ts.map +0 -1
  348. package/dist/esm-types/browser/sync/optimistic_query_set.test.d.ts +0 -2
  349. package/dist/esm-types/browser/sync/optimistic_query_set.test.d.ts.map +0 -1
  350. package/dist/esm-types/browser/sync/paginated_query_client.test.d.ts +0 -2
  351. package/dist/esm-types/browser/sync/paginated_query_client.test.d.ts.map +0 -1
  352. package/dist/esm-types/browser/sync/protocol.test.d.ts +0 -5
  353. package/dist/esm-types/browser/sync/protocol.test.d.ts.map +0 -1
  354. package/dist/esm-types/browser/sync/request_manager.test.d.ts +0 -2
  355. package/dist/esm-types/browser/sync/request_manager.test.d.ts.map +0 -1
  356. package/dist/esm-types/bundler/fs.test.d.ts +0 -2
  357. package/dist/esm-types/bundler/fs.test.d.ts.map +0 -1
  358. package/dist/esm-types/bundler/index.test.d.ts +0 -2
  359. package/dist/esm-types/bundler/index.test.d.ts.map +0 -1
  360. package/dist/esm-types/cli/codegen_templates/api.test.d.ts +0 -2
  361. package/dist/esm-types/cli/codegen_templates/api.test.d.ts.map +0 -1
  362. package/dist/esm-types/cli/codegen_templates/common.test.d.ts +0 -2
  363. package/dist/esm-types/cli/codegen_templates/common.test.d.ts.map +0 -1
  364. package/dist/esm-types/cli/codegen_templates/templates.test.d.ts +0 -2
  365. package/dist/esm-types/cli/codegen_templates/templates.test.d.ts.map +0 -1
  366. package/dist/esm-types/cli/codegen_templates/validator_helpers.test.d.ts +0 -2
  367. package/dist/esm-types/cli/codegen_templates/validator_helpers.test.d.ts.map +0 -1
  368. package/dist/esm-types/cli/configure.test.d.ts +0 -2
  369. package/dist/esm-types/cli/configure.test.d.ts.map +0 -1
  370. package/dist/esm-types/cli/deploymentCreate.test.d.ts +0 -2
  371. package/dist/esm-types/cli/deploymentCreate.test.d.ts.map +0 -1
  372. package/dist/esm-types/cli/deploymentSelect.test.d.ts +0 -2
  373. package/dist/esm-types/cli/deploymentSelect.test.d.ts.map +0 -1
  374. package/dist/esm-types/cli/deploymentSelection.test.d.ts +0 -2
  375. package/dist/esm-types/cli/deploymentSelection.test.d.ts.map +0 -1
  376. package/dist/esm-types/cli/deploymentToken.test.d.ts +0 -2
  377. package/dist/esm-types/cli/deploymentToken.test.d.ts.map +0 -1
  378. package/dist/esm-types/cli/dev.test.d.ts +0 -2
  379. package/dist/esm-types/cli/dev.test.d.ts.map +0 -1
  380. package/dist/esm-types/cli/envDefault.test.d.ts +0 -2
  381. package/dist/esm-types/cli/envDefault.test.d.ts.map +0 -1
  382. package/dist/esm-types/cli/lib/aiFiles/agentsmd.test.d.ts +0 -2
  383. package/dist/esm-types/cli/lib/aiFiles/agentsmd.test.d.ts.map +0 -1
  384. package/dist/esm-types/cli/lib/aiFiles/claudemd.test.d.ts +0 -2
  385. package/dist/esm-types/cli/lib/aiFiles/claudemd.test.d.ts.map +0 -1
  386. package/dist/esm-types/cli/lib/aiFiles/guidelinesmd.test.d.ts +0 -2
  387. package/dist/esm-types/cli/lib/aiFiles/guidelinesmd.test.d.ts.map +0 -1
  388. package/dist/esm-types/cli/lib/aiFiles/index.test.d.ts +0 -2
  389. package/dist/esm-types/cli/lib/aiFiles/index.test.d.ts.map +0 -1
  390. package/dist/esm-types/cli/lib/aiFiles/integration.test.d.ts +0 -2
  391. package/dist/esm-types/cli/lib/aiFiles/integration.test.d.ts.map +0 -1
  392. package/dist/esm-types/cli/lib/aiFiles/prompt.test.d.ts +0 -2
  393. package/dist/esm-types/cli/lib/aiFiles/prompt.test.d.ts.map +0 -1
  394. package/dist/esm-types/cli/lib/aiFiles/state.test.d.ts +0 -2
  395. package/dist/esm-types/cli/lib/aiFiles/state.test.d.ts.map +0 -1
  396. package/dist/esm-types/cli/lib/aiFiles/utils.test.d.ts +0 -2
  397. package/dist/esm-types/cli/lib/aiFiles/utils.test.d.ts.map +0 -1
  398. package/dist/esm-types/cli/lib/codegen.test.d.ts +0 -2
  399. package/dist/esm-types/cli/lib/codegen.test.d.ts.map +0 -1
  400. package/dist/esm-types/cli/lib/components.test.d.ts +0 -2
  401. package/dist/esm-types/cli/lib/components.test.d.ts.map +0 -1
  402. package/dist/esm-types/cli/lib/config.test.d.ts +0 -2
  403. package/dist/esm-types/cli/lib/config.test.d.ts.map +0 -1
  404. package/dist/esm-types/cli/lib/deployment.test.d.ts +0 -2
  405. package/dist/esm-types/cli/lib/deployment.test.d.ts.map +0 -1
  406. package/dist/esm-types/cli/lib/deploymentSelector.test.d.ts +0 -2
  407. package/dist/esm-types/cli/lib/deploymentSelector.test.d.ts.map +0 -1
  408. package/dist/esm-types/cli/lib/env.test.d.ts +0 -2
  409. package/dist/esm-types/cli/lib/env.test.d.ts.map +0 -1
  410. package/dist/esm-types/cli/lib/expiration.test.d.ts +0 -2
  411. package/dist/esm-types/cli/lib/expiration.test.d.ts.map +0 -1
  412. package/dist/esm-types/cli/lib/extractDeploymentNameForWorkOS.test.d.ts +0 -2
  413. package/dist/esm-types/cli/lib/extractDeploymentNameForWorkOS.test.d.ts.map +0 -1
  414. package/dist/esm-types/cli/lib/formatEnvValueForDotfile.test.d.ts +0 -2
  415. package/dist/esm-types/cli/lib/formatEnvValueForDotfile.test.d.ts.map +0 -1
  416. package/dist/esm-types/cli/lib/formatTargetedDeployment.test.d.ts +0 -2
  417. package/dist/esm-types/cli/lib/formatTargetedDeployment.test.d.ts.map +0 -1
  418. package/dist/esm-types/cli/lib/fsUtils.test.d.ts +0 -2
  419. package/dist/esm-types/cli/lib/fsUtils.test.d.ts.map +0 -1
  420. package/dist/esm-types/cli/lib/generateDocs.test.d.ts +0 -2
  421. package/dist/esm-types/cli/lib/generateDocs.test.d.ts.map +0 -1
  422. package/dist/esm-types/cli/lib/indexes.test.d.ts +0 -2
  423. package/dist/esm-types/cli/lib/indexes.test.d.ts.map +0 -1
  424. package/dist/esm-types/cli/lib/localDeployment/run.test.d.ts +0 -2
  425. package/dist/esm-types/cli/lib/localDeployment/run.test.d.ts.map +0 -1
  426. package/dist/esm-types/cli/lib/localDeployment/secrets.test.d.ts +0 -2
  427. package/dist/esm-types/cli/lib/localDeployment/secrets.test.d.ts.map +0 -1
  428. package/dist/esm-types/cli/lib/run.test.d.ts +0 -2
  429. package/dist/esm-types/cli/lib/run.test.d.ts.map +0 -1
  430. package/dist/esm-types/cli/lib/runTestFunction.test.d.ts +0 -2
  431. package/dist/esm-types/cli/lib/runTestFunction.test.d.ts.map +0 -1
  432. package/dist/esm-types/cli/lib/typecheck.test.d.ts +0 -2
  433. package/dist/esm-types/cli/lib/typecheck.test.d.ts.map +0 -1
  434. package/dist/esm-types/cli/lib/updates.test.d.ts +0 -2
  435. package/dist/esm-types/cli/lib/updates.test.d.ts.map +0 -1
  436. package/dist/esm-types/cli/lib/utils/hash.test.d.ts +0 -2
  437. package/dist/esm-types/cli/lib/utils/hash.test.d.ts.map +0 -1
  438. package/dist/esm-types/cli/lib/utils/utils.test.d.ts +0 -2
  439. package/dist/esm-types/cli/lib/utils/utils.test.d.ts.map +0 -1
  440. package/dist/esm-types/cli/lib/versionApi.test.d.ts +0 -2
  441. package/dist/esm-types/cli/lib/versionApi.test.d.ts.map +0 -1
  442. package/dist/esm-types/cli/lib/workos/environmentApi.test.d.ts +0 -2
  443. package/dist/esm-types/cli/lib/workos/environmentApi.test.d.ts.map +0 -1
  444. package/dist/esm-types/cli/lib/workos/workos.test.d.ts +0 -2
  445. package/dist/esm-types/cli/lib/workos/workos.test.d.ts.map +0 -1
  446. package/dist/esm-types/common/index.test.d.ts +0 -2
  447. package/dist/esm-types/common/index.test.d.ts.map +0 -1
  448. package/dist/esm-types/nextjs/nextjs.test.d.ts +0 -2
  449. package/dist/esm-types/nextjs/nextjs.test.d.ts.map +0 -1
  450. package/dist/esm-types/react/ConvexAuthState.test.d.ts +0 -2
  451. package/dist/esm-types/react/ConvexAuthState.test.d.ts.map +0 -1
  452. package/dist/esm-types/react/auth_helpers.test.d.ts +0 -2
  453. package/dist/esm-types/react/auth_helpers.test.d.ts.map +0 -1
  454. package/dist/esm-types/react/auth_websocket.test.d.ts +0 -2
  455. package/dist/esm-types/react/auth_websocket.test.d.ts.map +0 -1
  456. package/dist/esm-types/react/client.test.d.ts +0 -2
  457. package/dist/esm-types/react/client.test.d.ts.map +0 -1
  458. package/dist/esm-types/react/client_provided_base_client.test.d.ts +0 -2
  459. package/dist/esm-types/react/client_provided_base_client.test.d.ts.map +0 -1
  460. package/dist/esm-types/react/queries_observer.test.d.ts +0 -2
  461. package/dist/esm-types/react/queries_observer.test.d.ts.map +0 -1
  462. package/dist/esm-types/react/react_node.test.d.ts +0 -2
  463. package/dist/esm-types/react/react_node.test.d.ts.map +0 -1
  464. package/dist/esm-types/react/use_paginated_query.test.d.ts +0 -2
  465. package/dist/esm-types/react/use_paginated_query.test.d.ts.map +0 -1
  466. package/dist/esm-types/react/use_queries.test.d.ts +0 -5
  467. package/dist/esm-types/react/use_queries.test.d.ts.map +0 -1
  468. package/dist/esm-types/react/use_query.test.d.ts +0 -5
  469. package/dist/esm-types/react/use_query.test.d.ts.map +0 -1
  470. package/dist/esm-types/react/use_query_object_options.test.d.ts +0 -5
  471. package/dist/esm-types/react/use_query_object_options.test.d.ts.map +0 -1
  472. package/dist/esm-types/react/use_query_result.test.d.ts +0 -5
  473. package/dist/esm-types/react/use_query_result.test.d.ts.map +0 -1
  474. package/dist/esm-types/react-auth0/ConvexProviderWithAuth0.test.d.ts +0 -2
  475. package/dist/esm-types/react-auth0/ConvexProviderWithAuth0.test.d.ts.map +0 -1
  476. package/dist/esm-types/react-clerk/ConvexProviderWithClerk.test.d.ts +0 -2
  477. package/dist/esm-types/react-clerk/ConvexProviderWithClerk.test.d.ts.map +0 -1
  478. package/dist/esm-types/server/api.intersect.test.d.ts +0 -2
  479. package/dist/esm-types/server/api.intersect.test.d.ts.map +0 -1
  480. package/dist/esm-types/server/api.test.d.ts +0 -2
  481. package/dist/esm-types/server/api.test.d.ts.map +0 -1
  482. package/dist/esm-types/server/audit_logging.test.d.ts +0 -2
  483. package/dist/esm-types/server/audit_logging.test.d.ts.map +0 -1
  484. package/dist/esm-types/server/components/index.test.d.ts +0 -2
  485. package/dist/esm-types/server/components/index.test.d.ts.map +0 -1
  486. package/dist/esm-types/server/cron.test.d.ts +0 -2
  487. package/dist/esm-types/server/cron.test.d.ts.map +0 -1
  488. package/dist/esm-types/server/data_model.test.d.ts +0 -2
  489. package/dist/esm-types/server/data_model.test.d.ts.map +0 -1
  490. package/dist/esm-types/server/database.test.d.ts +0 -2
  491. package/dist/esm-types/server/database.test.d.ts.map +0 -1
  492. package/dist/esm-types/server/database_api.test.d.ts +0 -2
  493. package/dist/esm-types/server/database_api.test.d.ts.map +0 -1
  494. package/dist/esm-types/server/filter_builder.test.d.ts +0 -2
  495. package/dist/esm-types/server/filter_builder.test.d.ts.map +0 -1
  496. package/dist/esm-types/server/impl/filter_builder_impl.test.d.ts +0 -2
  497. package/dist/esm-types/server/impl/filter_builder_impl.test.d.ts.map +0 -1
  498. package/dist/esm-types/server/impl/query_impl.test.d.ts +0 -2
  499. package/dist/esm-types/server/impl/query_impl.test.d.ts.map +0 -1
  500. package/dist/esm-types/server/pagination.test.d.ts +0 -2
  501. package/dist/esm-types/server/pagination.test.d.ts.map +0 -1
  502. package/dist/esm-types/server/query.test.d.ts +0 -2
  503. package/dist/esm-types/server/query.test.d.ts.map +0 -1
  504. package/dist/esm-types/server/registration.test.d.ts +0 -2
  505. package/dist/esm-types/server/registration.test.d.ts.map +0 -1
  506. package/dist/esm-types/server/router.test.d.ts +0 -2
  507. package/dist/esm-types/server/router.test.d.ts.map +0 -1
  508. package/dist/esm-types/server/scheduler.test.d.ts +0 -2
  509. package/dist/esm-types/server/scheduler.test.d.ts.map +0 -1
  510. package/dist/esm-types/server/schema.test.d.ts +0 -2
  511. package/dist/esm-types/server/schema.test.d.ts.map +0 -1
  512. package/dist/esm-types/test/fake_watch.d.ts +0 -16
  513. package/dist/esm-types/test/fake_watch.d.ts.map +0 -1
  514. package/dist/esm-types/test/type_testing.d.ts +0 -9
  515. package/dist/esm-types/test/type_testing.d.ts.map +0 -1
  516. package/dist/esm-types/type_utils.test.d.ts +0 -2
  517. package/dist/esm-types/type_utils.test.d.ts.map +0 -1
  518. package/dist/esm-types/values/size.test.d.ts +0 -2
  519. package/dist/esm-types/values/size.test.d.ts.map +0 -1
  520. package/dist/esm-types/values/validator.test.d.ts +0 -2
  521. package/dist/esm-types/values/validator.test.d.ts.map +0 -1
  522. package/dist/esm-types/values/value.test.d.ts +0 -2
  523. package/dist/esm-types/values/value.test.d.ts.map +0 -1
  524. package/src/browser/http_client.test.ts +0 -202
  525. package/src/browser/query_options.test.ts +0 -43
  526. package/src/browser/simple_client.test.ts +0 -104
  527. package/src/browser/sync/client.test.ts +0 -44
  528. package/src/browser/sync/client_node.test.ts +0 -1207
  529. package/src/browser/sync/client_node_test_helpers.ts +0 -200
  530. package/src/browser/sync/local_state.test.ts +0 -128
  531. package/src/browser/sync/optimistic_query_set.test.ts +0 -253
  532. package/src/browser/sync/paginated_query_client.test.ts +0 -597
  533. package/src/browser/sync/protocol.test.ts +0 -14
  534. package/src/browser/sync/request_manager.test.ts +0 -273
  535. package/src/bundler/fs.test.ts +0 -86
  536. package/src/bundler/index.test.ts +0 -210
  537. package/src/bundler/test_fixtures/js/project01/bar.js +0 -4
  538. package/src/bundler/test_fixtures/js/project01/file with spaces.js +0 -1
  539. package/src/bundler/test_fixtures/js/project01/foo.js +0 -9
  540. package/src/bundler/test_fixtures/js/project_with_https/https.js +0 -9
  541. package/src/bundler/test_fixtures/js/project_with_https_not_at_top_level/default.js +0 -3
  542. package/src/bundler/test_fixtures/js/project_with_https_not_at_top_level/more_code/https.js +0 -5
  543. package/src/bundler/test_fixtures/js/project_with_https_without_router/https.js +0 -1
  544. package/src/bundler/test_fixtures/js/project_with_node_shims/uses_node_shims.js +0 -4
  545. package/src/cli/codegen_templates/api.test.ts +0 -18
  546. package/src/cli/codegen_templates/common.test.ts +0 -52
  547. package/src/cli/codegen_templates/templates.test.ts +0 -16
  548. package/src/cli/codegen_templates/validator_helpers.test.ts +0 -31
  549. package/src/cli/configure.test.ts +0 -138
  550. package/src/cli/deploymentCreate.test.ts +0 -1376
  551. package/src/cli/deploymentSelect.test.ts +0 -1291
  552. package/src/cli/deploymentSelection.test.ts +0 -2546
  553. package/src/cli/deploymentToken.test.ts +0 -397
  554. package/src/cli/dev.test.ts +0 -157
  555. package/src/cli/envDefault.test.ts +0 -495
  556. package/src/cli/lib/__snapshots__/formatTargetedDeployment.test.ts.snap +0 -94
  557. package/src/cli/lib/aiFiles/agentsmd.test.ts +0 -133
  558. package/src/cli/lib/aiFiles/claudemd.test.ts +0 -92
  559. package/src/cli/lib/aiFiles/guidelinesmd.test.ts +0 -50
  560. package/src/cli/lib/aiFiles/index.test.ts +0 -986
  561. package/src/cli/lib/aiFiles/integration.test.ts +0 -692
  562. package/src/cli/lib/aiFiles/prompt.test.ts +0 -202
  563. package/src/cli/lib/aiFiles/state.test.ts +0 -305
  564. package/src/cli/lib/aiFiles/utils.test.ts +0 -50
  565. package/src/cli/lib/codegen.test.ts +0 -49
  566. package/src/cli/lib/components.test.ts +0 -227
  567. package/src/cli/lib/config.test.ts +0 -1026
  568. package/src/cli/lib/deployment.test.ts +0 -85
  569. package/src/cli/lib/deploymentSelector.test.ts +0 -107
  570. package/src/cli/lib/env.test.ts +0 -60
  571. package/src/cli/lib/expiration.test.ts +0 -159
  572. package/src/cli/lib/extractDeploymentNameForWorkOS.test.ts +0 -30
  573. package/src/cli/lib/formatEnvValueForDotfile.test.ts +0 -294
  574. package/src/cli/lib/formatTargetedDeployment.test.ts +0 -281
  575. package/src/cli/lib/fsUtils.test.ts +0 -67
  576. package/src/cli/lib/generateDocs.test.ts +0 -326
  577. package/src/cli/lib/indexes.test.ts +0 -77
  578. package/src/cli/lib/localDeployment/run.test.ts +0 -104
  579. package/src/cli/lib/localDeployment/secrets.test.ts +0 -53
  580. package/src/cli/lib/run.test.ts +0 -54
  581. package/src/cli/lib/runTestFunction.test.ts +0 -84
  582. package/src/cli/lib/typecheck.test.ts +0 -71
  583. package/src/cli/lib/updates.test.ts +0 -157
  584. package/src/cli/lib/utils/hash.test.ts +0 -25
  585. package/src/cli/lib/utils/utils.test.ts +0 -340
  586. package/src/cli/lib/versionApi.test.ts +0 -471
  587. package/src/cli/lib/workos/environmentApi.test.ts +0 -107
  588. package/src/cli/lib/workos/workos.test.ts +0 -242
  589. package/src/common/README.md +0 -2
  590. package/src/common/index.test.ts +0 -35
  591. package/src/nextjs/nextjs.test.tsx +0 -94
  592. package/src/react/ConvexAuthState.test.tsx +0 -702
  593. package/src/react/auth_helpers.test.tsx +0 -45
  594. package/src/react/auth_websocket.test.tsx +0 -1177
  595. package/src/react/client.test.tsx +0 -261
  596. package/src/react/client_provided_base_client.test.tsx +0 -174
  597. package/src/react/queries_observer.test.ts +0 -176
  598. package/src/react/react_node.test.ts +0 -78
  599. package/src/react/use_paginated_query.test.tsx +0 -1420
  600. package/src/react/use_queries.test.ts +0 -140
  601. package/src/react/use_query.test.ts +0 -71
  602. package/src/react/use_query_object_options.test.ts +0 -51
  603. package/src/react/use_query_result.test.ts +0 -75
  604. package/src/react-auth0/ConvexProviderWithAuth0.test.tsx +0 -17
  605. package/src/react-clerk/ConvexProviderWithClerk.test.tsx +0 -18
  606. package/src/server/README.md +0 -15
  607. package/src/server/api.intersect.test.ts +0 -109
  608. package/src/server/api.test.ts +0 -447
  609. package/src/server/audit_logging.test.ts +0 -131
  610. package/src/server/components/index.test.ts +0 -48
  611. package/src/server/cron.test.ts +0 -58
  612. package/src/server/data_model.test.ts +0 -221
  613. package/src/server/database.test.ts +0 -184
  614. package/src/server/database_api.test.ts +0 -439
  615. package/src/server/filter_builder.test.ts +0 -102
  616. package/src/server/impl/filter_builder_impl.test.ts +0 -13
  617. package/src/server/impl/query_impl.test.ts +0 -46
  618. package/src/server/pagination.test.ts +0 -49
  619. package/src/server/query.test.ts +0 -112
  620. package/src/server/registration.test.ts +0 -589
  621. package/src/server/router.test.ts +0 -148
  622. package/src/server/scheduler.test.ts +0 -31
  623. package/src/server/schema.test.ts +0 -983
  624. package/src/test/fake_watch.ts +0 -54
  625. package/src/test/type_testing.ts +0 -21
  626. package/src/type_utils.test.ts +0 -62
  627. package/src/values/size.test.ts +0 -95
  628. package/src/values/validator.test.ts +0 -619
  629. package/src/values/value.test.ts +0 -232
  630. package/src/vendor/README.md +0 -18
  631. package/src/vendor/jwt-decode/README.md +0 -1
@@ -24,8 +24,9 @@ module.exports = __toCommonJS(component_server_exports);
24
24
  var import_common = require("./common.js");
25
25
  var import_server = require("./server.js");
26
26
  function componentServerTS(isRoot, envVars) {
27
- const hasEnv = !!envVars && envVars.length > 0;
28
- const envInterface = hasEnv ? (0, import_server.generateEnvInterface)(envVars) : "";
27
+ const emittedEnvVars = envVars === void 0 ? void 0 : (0, import_server.withPlatformEnvVars)(envVars);
28
+ const hasEnv = emittedEnvVars !== void 0;
29
+ const envInterface = hasEnv ? (0, import_server.generateEnvInterface)(emittedEnvVars) : "";
29
30
  const result = `
30
31
  ${(0, import_common.header)(
31
32
  "Generated utilities for implementing server-side Convex query and mutation functions."
@@ -128,7 +129,7 @@ function componentServerTS(isRoot, envVars) {
128
129
  * @returns The wrapped function. Import this function from \`convex/http.js\` and route it to hook it up.
129
130
  */
130
131
  export const httpAction: HttpActionBuilder = httpActionGeneric;
131
- ${hasEnv ? "export const env: Env = process.env as unknown as Env;" : envVars === void 0 ? "export const env: Record<string, string | undefined> = process.env as unknown as Record<string, string | undefined>;" : ""}
132
+ ${hasEnv ? "export const env: Env = (globalThis as unknown as { process: { env: Env } }).process.env;" : "export const env: Record<string, string | undefined> = (globalThis as unknown as { process: { env: Record<string, string | undefined> } }).process.env;"}
132
133
 
133
134
  /**
134
135
  * A set of services for use within Convex query functions.
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../../../src/cli/codegen_templates/component_server.ts"],
4
- "sourcesContent": ["import { header } from \"./common.js\";\nimport { EnvVarMeta, generateEnvInterface } from \"./server.js\";\n\nexport function componentServerTS(\n isRoot: boolean,\n // - undefined: not yet known (initial codegen). Emits an untyped `env` stub.\n // - non-empty array: emit typed `Env` interface and typed `env` export.\n // - empty array: no env vars declared. Omit `env` from generated code.\n envVars: EnvVarMeta[] | undefined,\n): string {\n const hasEnv = !!envVars && envVars.length > 0;\n const envInterface = hasEnv ? generateEnvInterface(envVars!) : \"\";\n\n const result = `\n ${header(\n \"Generated utilities for implementing server-side Convex query and mutation functions.\",\n )}\n import type {\n ActionBuilder,\n ${isRoot ? \"AnyComponents,\" : \"\"}\n HttpActionBuilder,\n MutationBuilder,\n QueryBuilder,\n GenericActionCtx,\n GenericMutationCtx,\n GenericQueryCtx,\n GenericDatabaseReader,\n GenericDatabaseWriter,\n } from \"convex/server\";\n import {\n actionGeneric,\n httpActionGeneric,\n queryGeneric,\n mutationGeneric,\n internalActionGeneric,\n internalMutationGeneric,\n internalQueryGeneric,\n ${isRoot ? \"componentsGeneric,\" : \"\"}\n } from \"convex/server\";\n import type { DataModel } from \"./dataModel.js\";\n ${envInterface}\n\n /**\n * Define a query in this Convex app's public API.\n *\n * This function will be allowed to read your Convex database and will be accessible from the client.\n *\n * @param func - The query function. It receives a {@link QueryCtx} as its first argument.\n * @returns The wrapped query. Include this as an \\`export\\` to name it and make it accessible.\n */\n export const query: QueryBuilder<DataModel, \"public\"> = queryGeneric;\n\n /**\n * Define a query that is only accessible from other Convex functions (but not from the client).\n *\n * This function will be allowed to read from your Convex database. It will not be accessible from the client.\n *\n * @param func - The query function. It receives a {@link QueryCtx} as its first argument.\n * @returns The wrapped query. Include this as an \\`export\\` to name it and make it accessible.\n */\n export const internalQuery: QueryBuilder<DataModel, \"internal\"> = internalQueryGeneric;\n\n /**\n * Define a mutation in this Convex app's public API.\n *\n * This function will be allowed to modify your Convex database and will be accessible from the client.\n *\n * @param func - The mutation function. It receives a {@link MutationCtx} as its first argument.\n * @returns The wrapped mutation. Include this as an \\`export\\` to name it and make it accessible.\n */\n export const mutation: MutationBuilder<DataModel, \"public\"> = mutationGeneric;\n\n /**\n * Define a mutation that is only accessible from other Convex functions (but not from the client).\n *\n * This function will be allowed to modify your Convex database. It will not be accessible from the client.\n *\n * @param func - The mutation function. It receives a {@link MutationCtx} as its first argument.\n * @returns The wrapped mutation. Include this as an \\`export\\` to name it and make it accessible.\n */\n export const internalMutation: MutationBuilder<DataModel, \"internal\"> = internalMutationGeneric;\n\n /**\n * Define an action in this Convex app's public API.\n *\n * An action is a function which can execute any JavaScript code, including non-deterministic\n * code and code with side-effects, like calling third-party services.\n * They can be run in Convex's JavaScript environment or in Node.js using the \"use node\" directive.\n * They can interact with the database indirectly by calling queries and mutations using the {@link ActionCtx}.\n *\n * @param func - The action. It receives an {@link ActionCtx} as its first argument.\n * @returns The wrapped action. Include this as an \\`export\\` to name it and make it accessible.\n */\n export const action: ActionBuilder<DataModel, \"public\"> = actionGeneric;\n\n /**\n * Define an action that is only accessible from other Convex functions (but not from the client).\n *\n * @param func - The function. It receives an {@link ActionCtx} as its first argument.\n * @returns The wrapped function. Include this as an \\`export\\` to name it and make it accessible.\n */\n export const internalAction: ActionBuilder<DataModel, \"internal\"> = internalActionGeneric;\n\n /**\n * Define an HTTP action.\n *\n * The wrapped function will be used to respond to HTTP requests received\n * by a Convex deployment if the requests matches the path and method where\n * this action is routed. Be sure to route your httpAction in \\`convex/http.js\\`.\n *\n * @param func - The function. It receives an {@link ActionCtx} as its first argument\n * and a Fetch API \\`Request\\` object as its second.\n * @returns The wrapped function. Import this function from \\`convex/http.js\\` and route it to hook it up.\n */\n export const httpAction: HttpActionBuilder = httpActionGeneric;\n ${hasEnv ? \"export const env: Env = process.env as unknown as Env;\" : envVars === undefined ? \"export const env: Record<string, string | undefined> = process.env as unknown as Record<string, string | undefined>;\" : \"\"}\n\n /**\n * A set of services for use within Convex query functions.\n *\n * The query context is passed as the first argument to any Convex query\n * function run on the server.\n *\n * If you're using code generation, use the \\`QueryCtx\\` type in \\`convex/_generated/server.d.ts\\` instead.\n */\n export type QueryCtx = GenericQueryCtx<DataModel>;\n\n /**\n * A set of services for use within Convex mutation functions.\n *\n * The mutation context is passed as the first argument to any Convex mutation\n * function run on the server.\n *\n * If you're using code generation, use the \\`MutationCtx\\` type in \\`convex/_generated/server.d.ts\\` instead.\n */\n export type MutationCtx = GenericMutationCtx<DataModel>;\n\n /**\n * A set of services for use within Convex action functions.\n *\n * The action context is passed as the first argument to any Convex action\n * function run on the server.\n */\n export type ActionCtx = GenericActionCtx<DataModel>;\n\n /**\n * An interface to read from the database within Convex query functions.\n *\n * The two entry points are {@link DatabaseReader.get}, which fetches a single\n * document by its {@link Id}, or {@link DatabaseReader.query}, which starts\n * building a query.\n */\n export type DatabaseReader = GenericDatabaseReader<DataModel>;\n\n /**\n * An interface to read from and write to the database within Convex mutation\n * functions.\n *\n * Convex guarantees that all writes within a single mutation are\n * executed atomically, so you never have to worry about partial writes leaving\n * your data in an inconsistent state. See [the Convex Guide](https://docs.convex.dev/understanding/convex-fundamentals/functions#atomicity-and-optimistic-concurrency-control)\n * for the guarantees Convex provides your functions.\n */\n export type DatabaseWriter = GenericDatabaseWriter<DataModel>;\n ${\n isRoot\n ? `\n /**\n * Load the API for calling functions from this Convex deployment's components.\n */\n export const components: AnyComponents = componentsGeneric();`\n : \"\"\n }\n `;\n return result;\n}\n"],
5
- "mappings": ";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,oBAAuB;AACvB,oBAAiD;AAE1C,SAAS,kBACd,QAIA,SACQ;AACR,QAAM,SAAS,CAAC,CAAC,WAAW,QAAQ,SAAS;AAC7C,QAAM,eAAe,aAAS,oCAAqB,OAAQ,IAAI;AAE/D,QAAM,SAAS;AAAA,QACb;AAAA,IACA;AAAA,EACF,CAAC;AAAA;AAAA;AAAA,MAGG,SAAS,mBAAmB,EAAE;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,MAkB9B,SAAS,uBAAuB,EAAE;AAAA;AAAA;AAAA,IAGpC,YAAY;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,IA2EZ,SAAS,2DAA2D,YAAY,SAAY,yHAAyH,EAAE;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,IAkDvN,SACI;AAAA;AAAA;AAAA;AAAA,mEAKA,EACN;AAAA;AAEA,SAAO;AACT;",
4
+ "sourcesContent": ["import { header } from \"./common.js\";\nimport {\n EnvVarMeta,\n generateEnvInterface,\n withPlatformEnvVars,\n} from \"./server.js\";\n\nexport function componentServerTS(\n isRoot: boolean,\n // - undefined: not yet known (initial codegen). Emits an untyped `env` stub.\n // - array (empty or not): emit a typed `Env` interface and typed `env`\n // export. The interface always includes the platform-provided env vars.\n envVars: EnvVarMeta[] | undefined,\n): string {\n const emittedEnvVars =\n envVars === undefined ? undefined : withPlatformEnvVars(envVars);\n const hasEnv = emittedEnvVars !== undefined;\n const envInterface = hasEnv ? generateEnvInterface(emittedEnvVars!) : \"\";\n\n const result = `\n ${header(\n \"Generated utilities for implementing server-side Convex query and mutation functions.\",\n )}\n import type {\n ActionBuilder,\n ${isRoot ? \"AnyComponents,\" : \"\"}\n HttpActionBuilder,\n MutationBuilder,\n QueryBuilder,\n GenericActionCtx,\n GenericMutationCtx,\n GenericQueryCtx,\n GenericDatabaseReader,\n GenericDatabaseWriter,\n } from \"convex/server\";\n import {\n actionGeneric,\n httpActionGeneric,\n queryGeneric,\n mutationGeneric,\n internalActionGeneric,\n internalMutationGeneric,\n internalQueryGeneric,\n ${isRoot ? \"componentsGeneric,\" : \"\"}\n } from \"convex/server\";\n import type { DataModel } from \"./dataModel.js\";\n ${envInterface}\n\n /**\n * Define a query in this Convex app's public API.\n *\n * This function will be allowed to read your Convex database and will be accessible from the client.\n *\n * @param func - The query function. It receives a {@link QueryCtx} as its first argument.\n * @returns The wrapped query. Include this as an \\`export\\` to name it and make it accessible.\n */\n export const query: QueryBuilder<DataModel, \"public\"> = queryGeneric;\n\n /**\n * Define a query that is only accessible from other Convex functions (but not from the client).\n *\n * This function will be allowed to read from your Convex database. It will not be accessible from the client.\n *\n * @param func - The query function. It receives a {@link QueryCtx} as its first argument.\n * @returns The wrapped query. Include this as an \\`export\\` to name it and make it accessible.\n */\n export const internalQuery: QueryBuilder<DataModel, \"internal\"> = internalQueryGeneric;\n\n /**\n * Define a mutation in this Convex app's public API.\n *\n * This function will be allowed to modify your Convex database and will be accessible from the client.\n *\n * @param func - The mutation function. It receives a {@link MutationCtx} as its first argument.\n * @returns The wrapped mutation. Include this as an \\`export\\` to name it and make it accessible.\n */\n export const mutation: MutationBuilder<DataModel, \"public\"> = mutationGeneric;\n\n /**\n * Define a mutation that is only accessible from other Convex functions (but not from the client).\n *\n * This function will be allowed to modify your Convex database. It will not be accessible from the client.\n *\n * @param func - The mutation function. It receives a {@link MutationCtx} as its first argument.\n * @returns The wrapped mutation. Include this as an \\`export\\` to name it and make it accessible.\n */\n export const internalMutation: MutationBuilder<DataModel, \"internal\"> = internalMutationGeneric;\n\n /**\n * Define an action in this Convex app's public API.\n *\n * An action is a function which can execute any JavaScript code, including non-deterministic\n * code and code with side-effects, like calling third-party services.\n * They can be run in Convex's JavaScript environment or in Node.js using the \"use node\" directive.\n * They can interact with the database indirectly by calling queries and mutations using the {@link ActionCtx}.\n *\n * @param func - The action. It receives an {@link ActionCtx} as its first argument.\n * @returns The wrapped action. Include this as an \\`export\\` to name it and make it accessible.\n */\n export const action: ActionBuilder<DataModel, \"public\"> = actionGeneric;\n\n /**\n * Define an action that is only accessible from other Convex functions (but not from the client).\n *\n * @param func - The function. It receives an {@link ActionCtx} as its first argument.\n * @returns The wrapped function. Include this as an \\`export\\` to name it and make it accessible.\n */\n export const internalAction: ActionBuilder<DataModel, \"internal\"> = internalActionGeneric;\n\n /**\n * Define an HTTP action.\n *\n * The wrapped function will be used to respond to HTTP requests received\n * by a Convex deployment if the requests matches the path and method where\n * this action is routed. Be sure to route your httpAction in \\`convex/http.js\\`.\n *\n * @param func - The function. It receives an {@link ActionCtx} as its first argument\n * and a Fetch API \\`Request\\` object as its second.\n * @returns The wrapped function. Import this function from \\`convex/http.js\\` and route it to hook it up.\n */\n export const httpAction: HttpActionBuilder = httpActionGeneric;\n ${hasEnv ? \"export const env: Env = (globalThis as unknown as { process: { env: Env } }).process.env;\" : \"export const env: Record<string, string | undefined> = (globalThis as unknown as { process: { env: Record<string, string | undefined> } }).process.env;\"}\n\n /**\n * A set of services for use within Convex query functions.\n *\n * The query context is passed as the first argument to any Convex query\n * function run on the server.\n *\n * If you're using code generation, use the \\`QueryCtx\\` type in \\`convex/_generated/server.d.ts\\` instead.\n */\n export type QueryCtx = GenericQueryCtx<DataModel>;\n\n /**\n * A set of services for use within Convex mutation functions.\n *\n * The mutation context is passed as the first argument to any Convex mutation\n * function run on the server.\n *\n * If you're using code generation, use the \\`MutationCtx\\` type in \\`convex/_generated/server.d.ts\\` instead.\n */\n export type MutationCtx = GenericMutationCtx<DataModel>;\n\n /**\n * A set of services for use within Convex action functions.\n *\n * The action context is passed as the first argument to any Convex action\n * function run on the server.\n */\n export type ActionCtx = GenericActionCtx<DataModel>;\n\n /**\n * An interface to read from the database within Convex query functions.\n *\n * The two entry points are {@link DatabaseReader.get}, which fetches a single\n * document by its {@link Id}, or {@link DatabaseReader.query}, which starts\n * building a query.\n */\n export type DatabaseReader = GenericDatabaseReader<DataModel>;\n\n /**\n * An interface to read from and write to the database within Convex mutation\n * functions.\n *\n * Convex guarantees that all writes within a single mutation are\n * executed atomically, so you never have to worry about partial writes leaving\n * your data in an inconsistent state. See [the Convex Guide](https://docs.convex.dev/understanding/convex-fundamentals/functions#atomicity-and-optimistic-concurrency-control)\n * for the guarantees Convex provides your functions.\n */\n export type DatabaseWriter = GenericDatabaseWriter<DataModel>;\n ${\n isRoot\n ? `\n /**\n * Load the API for calling functions from this Convex deployment's components.\n */\n export const components: AnyComponents = componentsGeneric();`\n : \"\"\n }\n `;\n return result;\n}\n"],
5
+ "mappings": ";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,oBAAuB;AACvB,oBAIO;AAEA,SAAS,kBACd,QAIA,SACQ;AACR,QAAM,iBACJ,YAAY,SAAY,aAAY,mCAAoB,OAAO;AACjE,QAAM,SAAS,mBAAmB;AAClC,QAAM,eAAe,aAAS,oCAAqB,cAAe,IAAI;AAEtE,QAAM,SAAS;AAAA,QACb;AAAA,IACA;AAAA,EACF,CAAC;AAAA;AAAA;AAAA,MAGG,SAAS,mBAAmB,EAAE;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,MAkB9B,SAAS,uBAAuB,EAAE;AAAA;AAAA;AAAA,IAGpC,YAAY;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,IA2EZ,SAAS,8FAA8F,yJAAyJ;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,IAkDhQ,SACI;AAAA;AAAA;AAAA;AAAA,mEAKA,EACN;AAAA;AAEA,SAAO;AACT;",
6
6
  "names": []
7
7
  }
@@ -19,38 +19,50 @@ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: tru
19
19
  var server_exports = {};
20
20
  __export(server_exports, {
21
21
  generateEnvInterface: () => generateEnvInterface,
22
- serverCodegen: () => serverCodegen
22
+ serverCodegen: () => serverCodegen,
23
+ withPlatformEnvVars: () => withPlatformEnvVars
23
24
  });
24
25
  module.exports = __toCommonJS(server_exports);
25
26
  var import_common = require("./common.js");
26
27
  var import_validator_helpers = require("./validator_helpers.js");
28
+ const PLATFORM_ENV_VARS = [
29
+ ["CONVEX_CLOUD_URL", { type: "value", value: '{"type":"string"}' }],
30
+ ["CONVEX_SITE_URL", { type: "value", value: '{"type":"string"}' }]
31
+ ];
32
+ function withPlatformEnvVars(envVars) {
33
+ return [...PLATFORM_ENV_VARS, ...envVars];
34
+ }
27
35
  const ENV_DOCSTRING = `/**
28
- * Typesafe environment variables declared in \`convex.config.ts\`.
36
+ * Typesafe environment variables.
37
+ *
38
+ * This includes platform-provided env vars and any variables declared in
39
+ * \`convex.config.ts\`.
29
40
  */`;
30
41
  function serverCodegen({
31
42
  useTypeScript,
32
43
  envVars
33
44
  }) {
34
- const hasEnv = !!envVars && envVars.length > 0;
35
- const envInterface = hasEnv ? generateEnvInterface(envVars) : "";
45
+ const emittedEnvVars = envVars === void 0 ? void 0 : withPlatformEnvVars(envVars);
46
+ const hasEnv = emittedEnvVars !== void 0;
47
+ const envInterface = hasEnv ? generateEnvInterface(emittedEnvVars) : "";
36
48
  const envDeclDTS = hasEnv ? `
37
49
  ${ENV_DOCSTRING}
38
50
  export declare const env: Env;
39
- ` : envVars === void 0 ? `
51
+ ` : `
40
52
  export declare const env: Record<string, string | undefined>;
41
- ` : "";
53
+ `;
42
54
  const envDeclTS = hasEnv ? `
43
55
  ${ENV_DOCSTRING}
44
- export const env: Env = process.env as unknown as Env;
45
- ` : envVars === void 0 ? `
46
- export const env: Record<string, string | undefined> = process.env as unknown as Record<string, string | undefined>;
47
- ` : "";
56
+ export const env: Env = (globalThis as unknown as { process: { env: Env } }).process.env;
57
+ ` : `
58
+ export const env: Record<string, string | undefined> = (globalThis as unknown as { process: { env: Record<string, string | undefined> } }).process.env;
59
+ `;
48
60
  const envDeclJS = hasEnv ? `
49
61
  ${ENV_DOCSTRING}
50
62
  export const env = process.env;
51
- ` : envVars === void 0 ? `
63
+ ` : `
52
64
  export const env = process.env;
53
- ` : "";
65
+ `;
54
66
  if (!useTypeScript) {
55
67
  const serverDTS = `
56
68
  ${(0, import_common.header)(
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../../../src/cli/codegen_templates/server.ts"],
4
- "sourcesContent": ["import { header } from \"./common.js\";\nimport { parseValidator, validatorToType } from \"./validator_helpers.js\";\n\nexport type EnvVarMeta = [\n string,\n { type: \"value\"; value: string; optional?: boolean | undefined },\n];\n\nconst ENV_DOCSTRING = `/**\n * Typesafe environment variables declared in \\`convex.config.ts\\`.\n */`;\n\nexport function serverCodegen({\n useTypeScript,\n envVars,\n}: {\n useTypeScript: boolean;\n // - undefined: env var declarations not yet known (initial codegen before\n // server analysis). Emits an untyped `env` stub so imports don't break.\n // - non-empty array: emit a typed `Env` interface and typed `env` export.\n // - empty array: no env vars declared. Omit `env` from generated code.\n envVars: EnvVarMeta[] | undefined;\n}) {\n const hasEnv = !!envVars && envVars.length > 0;\n const envInterface = hasEnv ? generateEnvInterface(envVars!) : \"\";\n const envDeclDTS = hasEnv\n ? `\n${ENV_DOCSTRING}\nexport declare const env: Env;\n`\n : envVars === undefined\n ? `\nexport declare const env: Record<string, string | undefined>;\n`\n : \"\";\n const envDeclTS = hasEnv\n ? `\n${ENV_DOCSTRING}\nexport const env: Env = process.env as unknown as Env;\n`\n : envVars === undefined\n ? `\nexport const env: Record<string, string | undefined> = process.env as unknown as Record<string, string | undefined>;\n`\n : \"\";\n const envDeclJS = hasEnv\n ? `\n${ENV_DOCSTRING}\nexport const env = process.env;\n`\n : envVars === undefined\n ? `\nexport const env = process.env;\n`\n : \"\";\n\n if (!useTypeScript) {\n // Generate separate .js and .d.ts files\n const serverDTS = `\n ${header(\n \"Generated utilities for implementing server-side Convex query and mutation functions.\",\n )}\n import {\n ActionBuilder,\n HttpActionBuilder,\n MutationBuilder,\n QueryBuilder,\n GenericActionCtx,\n GenericMutationCtx,\n GenericQueryCtx,\n GenericDatabaseReader,\n GenericDatabaseWriter,\n } from \"convex/server\";\n import type { DataModel } from \"./dataModel.js\";\n ${envInterface}\n\n /**\n * Define a query in this Convex app's public API.\n *\n * This function will be allowed to read your Convex database and will be accessible from the client.\n *\n * @param func - The query function. It receives a {@link QueryCtx} as its first argument.\n * @returns The wrapped query. Include this as an \\`export\\` to name it and make it accessible.\n */\n export declare const query: QueryBuilder<DataModel, \"public\">;\n\n /**\n * Define a query that is only accessible from other Convex functions (but not from the client).\n *\n * This function will be allowed to read from your Convex database. It will not be accessible from the client.\n *\n * @param func - The query function. It receives a {@link QueryCtx} as its first argument.\n * @returns The wrapped query. Include this as an \\`export\\` to name it and make it accessible.\n */\n export declare const internalQuery: QueryBuilder<DataModel, \"internal\">;\n\n /**\n * Define a mutation in this Convex app's public API.\n *\n * This function will be allowed to modify your Convex database and will be accessible from the client.\n *\n * @param func - The mutation function. It receives a {@link MutationCtx} as its first argument.\n * @returns The wrapped mutation. Include this as an \\`export\\` to name it and make it accessible.\n */\n export declare const mutation: MutationBuilder<DataModel, \"public\">;\n\n /**\n * Define a mutation that is only accessible from other Convex functions (but not from the client).\n *\n * This function will be allowed to modify your Convex database. It will not be accessible from the client.\n *\n * @param func - The mutation function. It receives a {@link MutationCtx} as its first argument.\n * @returns The wrapped mutation. Include this as an \\`export\\` to name it and make it accessible.\n */\n export declare const internalMutation: MutationBuilder<DataModel, \"internal\">;\n\n /**\n * Define an action in this Convex app's public API.\n *\n * An action is a function which can execute any JavaScript code, including non-deterministic\n * code and code with side-effects, like calling third-party services.\n * They can be run in Convex's JavaScript environment or in Node.js using the \"use node\" directive.\n * They can interact with the database indirectly by calling queries and mutations using the {@link ActionCtx}.\n *\n * @param func - The action. It receives an {@link ActionCtx} as its first argument.\n * @returns The wrapped action. Include this as an \\`export\\` to name it and make it accessible.\n */\n export declare const action: ActionBuilder<DataModel, \"public\">;\n\n /**\n * Define an action that is only accessible from other Convex functions (but not from the client).\n *\n * @param func - The function. It receives an {@link ActionCtx} as its first argument.\n * @returns The wrapped function. Include this as an \\`export\\` to name it and make it accessible.\n */\n export declare const internalAction: ActionBuilder<DataModel, \"internal\">;\n\n /**\n * Define an HTTP action.\n *\n * The wrapped function will be used to respond to HTTP requests received\n * by a Convex deployment if the requests matches the path and method where\n * this action is routed. Be sure to route your httpAction in \\`convex/http.js\\`.\n *\n * @param func - The function. It receives an {@link ActionCtx} as its first argument\n * and a Fetch API \\`Request\\` object as its second.\n * @returns The wrapped function. Import this function from \\`convex/http.js\\` and route it to hook it up.\n */\n export declare const httpAction: HttpActionBuilder;\n${envDeclDTS}\n /**\n * A set of services for use within Convex query functions.\n *\n * The query context is passed as the first argument to any Convex query\n * function run on the server.\n *\n * This differs from the {@link MutationCtx} because all of the services are\n * read-only.\n */\n export type QueryCtx = GenericQueryCtx<DataModel>;\n\n /**\n * A set of services for use within Convex mutation functions.\n *\n * The mutation context is passed as the first argument to any Convex mutation\n * function run on the server.\n */\n export type MutationCtx = GenericMutationCtx<DataModel>;\n\n /**\n * A set of services for use within Convex action functions.\n *\n * The action context is passed as the first argument to any Convex action\n * function run on the server.\n */\n export type ActionCtx = GenericActionCtx<DataModel>;\n\n /**\n * An interface to read from the database within Convex query functions.\n *\n * The two entry points are {@link DatabaseReader.get}, which fetches a single\n * document by its {@link Id}, or {@link DatabaseReader.query}, which starts\n * building a query.\n */\n export type DatabaseReader = GenericDatabaseReader<DataModel>;\n\n /**\n * An interface to read from and write to the database within Convex mutation\n * functions.\n *\n * Convex guarantees that all writes within a single mutation are\n * executed atomically, so you never have to worry about partial writes leaving\n * your data in an inconsistent state. See [the Convex Guide](https://docs.convex.dev/understanding/convex-fundamentals/functions#atomicity-and-optimistic-concurrency-control)\n * for the guarantees Convex provides your functions.\n */\n export type DatabaseWriter = GenericDatabaseWriter<DataModel>;`;\n\n const serverJS = `\n ${header(\n \"Generated utilities for implementing server-side Convex query and mutation functions.\",\n )}\n import {\n actionGeneric,\n httpActionGeneric,\n queryGeneric,\n mutationGeneric,\n internalActionGeneric,\n internalMutationGeneric,\n internalQueryGeneric,\n } from \"convex/server\";\n\n /**\n * Define a query in this Convex app's public API.\n *\n * This function will be allowed to read your Convex database and will be accessible from the client.\n *\n * @param func - The query function. It receives a {@link QueryCtx} as its first argument.\n * @returns The wrapped query. Include this as an \\`export\\` to name it and make it accessible.\n */\n export const query = queryGeneric;\n\n /**\n * Define a query that is only accessible from other Convex functions (but not from the client).\n *\n * This function will be allowed to read from your Convex database. It will not be accessible from the client.\n *\n * @param func - The query function. It receives a {@link QueryCtx} as its first argument.\n * @returns The wrapped query. Include this as an \\`export\\` to name it and make it accessible.\n */\n export const internalQuery = internalQueryGeneric;\n\n /**\n * Define a mutation in this Convex app's public API.\n *\n * This function will be allowed to modify your Convex database and will be accessible from the client.\n *\n * @param func - The mutation function. It receives a {@link MutationCtx} as its first argument.\n * @returns The wrapped mutation. Include this as an \\`export\\` to name it and make it accessible.\n */\n export const mutation = mutationGeneric;\n\n /**\n * Define a mutation that is only accessible from other Convex functions (but not from the client).\n *\n * This function will be allowed to modify your Convex database. It will not be accessible from the client.\n *\n * @param func - The mutation function. It receives a {@link MutationCtx} as its first argument.\n * @returns The wrapped mutation. Include this as an \\`export\\` to name it and make it accessible.\n */\n export const internalMutation = internalMutationGeneric;\n\n /**\n * Define an action in this Convex app's public API.\n *\n * An action is a function which can execute any JavaScript code, including non-deterministic\n * code and code with side-effects, like calling third-party services.\n * They can be run in Convex's JavaScript environment or in Node.js using the \"use node\" directive.\n * They can interact with the database indirectly by calling queries and mutations using the {@link ActionCtx}.\n *\n * @param func - The action. It receives an {@link ActionCtx} as its first argument.\n * @returns The wrapped action. Include this as an \\`export\\` to name it and make it accessible.\n */\n export const action = actionGeneric;\n\n /**\n * Define an action that is only accessible from other Convex functions (but not from the client).\n *\n * @param func - The function. It receives an {@link ActionCtx} as its first argument.\n * @returns The wrapped function. Include this as an \\`export\\` to name it and make it accessible.\n */\n export const internalAction = internalActionGeneric;\n\n /**\n * Define an HTTP action.\n *\n * The wrapped function will be used to respond to HTTP requests received\n * by a Convex deployment if the requests matches the path and method where\n * this action is routed. Be sure to route your httpAction in \\`convex/http.js\\`.\n *\n * @param func - The function. It receives an {@link ActionCtx} as its first argument\n * and a Fetch API \\`Request\\` object as its second.\n * @returns The wrapped function. Import this function from \\`convex/http.js\\` and route it to hook it up.\n */\n export const httpAction = httpActionGeneric;\n${envDeclJS}\n `;\n\n return {\n DTS: serverDTS,\n JS: serverJS,\n };\n } else {\n // Generate combined .ts file\n const serverTS = `${header(\n \"Generated utilities for implementing server-side Convex query and mutation functions.\",\n )}\nimport {\n actionGeneric,\n httpActionGeneric,\n queryGeneric,\n mutationGeneric,\n internalActionGeneric,\n internalMutationGeneric,\n internalQueryGeneric,\n} from \"convex/server\";\nimport type {\n ActionBuilder,\n HttpActionBuilder,\n MutationBuilder,\n QueryBuilder,\n GenericActionCtx,\n GenericMutationCtx,\n GenericQueryCtx,\n GenericDatabaseReader,\n GenericDatabaseWriter,\n} from \"convex/server\";\nimport type { DataModel } from \"./dataModel.js\";\n${envInterface}\n\n/**\n * Define a query in this Convex app's public API.\n *\n * This function will be allowed to read your Convex database and will be accessible from the client.\n *\n * @param func - The query function. It receives a {@link QueryCtx} as its first argument.\n * @returns The wrapped query. Include this as an \\`export\\` to name it and make it accessible.\n */\nexport const query: QueryBuilder<DataModel, \"public\"> = queryGeneric;\n\n/**\n * Define a query that is only accessible from other Convex functions (but not from the client).\n *\n * This function will be allowed to read from your Convex database. It will not be accessible from the client.\n *\n * @param func - The query function. It receives a {@link QueryCtx} as its first argument.\n * @returns The wrapped query. Include this as an \\`export\\` to name it and make it accessible.\n */\nexport const internalQuery: QueryBuilder<DataModel, \"internal\"> = internalQueryGeneric;\n\n/**\n * Define a mutation in this Convex app's public API.\n *\n * This function will be allowed to modify your Convex database and will be accessible from the client.\n *\n * @param func - The mutation function. It receives a {@link MutationCtx} as its first argument.\n * @returns The wrapped mutation. Include this as an \\`export\\` to name it and make it accessible.\n */\nexport const mutation: MutationBuilder<DataModel, \"public\"> = mutationGeneric;\n\n/**\n * Define a mutation that is only accessible from other Convex functions (but not from the client).\n *\n * This function will be allowed to modify your Convex database. It will not be accessible from the client.\n *\n * @param func - The mutation function. It receives a {@link MutationCtx} as its first argument.\n * @returns The wrapped mutation. Include this as an \\`export\\` to name it and make it accessible.\n */\nexport const internalMutation: MutationBuilder<DataModel, \"internal\"> = internalMutationGeneric;\n\n/**\n * Define an action in this Convex app's public API.\n *\n * An action is a function which can execute any JavaScript code, including non-deterministic\n * code and code with side-effects, like calling third-party services.\n * They can be run in Convex's JavaScript environment or in Node.js using the \"use node\" directive.\n * They can interact with the database indirectly by calling queries and mutations using the {@link ActionCtx}.\n *\n * @param func - The action. It receives an {@link ActionCtx} as its first argument.\n * @returns The wrapped action. Include this as an \\`export\\` to name it and make it accessible.\n */\nexport const action: ActionBuilder<DataModel, \"public\"> = actionGeneric;\n\n/**\n * Define an action that is only accessible from other Convex functions (but not from the client).\n *\n * @param func - The function. It receives an {@link ActionCtx} as its first argument.\n * @returns The wrapped function. Include this as an \\`export\\` to name it and make it accessible.\n */\nexport const internalAction: ActionBuilder<DataModel, \"internal\"> = internalActionGeneric;\n\n/**\n * Define an HTTP action.\n *\n * The wrapped function will be used to respond to HTTP requests received\n * by a Convex deployment if the requests matches the path and method where\n * this action is routed. Be sure to route your httpAction in \\`convex/http.js\\`.\n *\n * @param func - The function. It receives an {@link ActionCtx} as its first argument\n * and a Fetch API \\`Request\\` object as its second.\n * @returns The wrapped function. Import this function from \\`convex/http.js\\` and route it to hook it up.\n */\nexport const httpAction: HttpActionBuilder = httpActionGeneric;\n${envDeclTS}\n/**\n * A set of services for use within Convex query functions.\n *\n * The query context is passed as the first argument to any Convex query\n * function run on the server.\n *\n * This differs from the {@link MutationCtx} because all of the services are\n * read-only.\n */\nexport type QueryCtx = GenericQueryCtx<DataModel>;\n\n/**\n * A set of services for use within Convex mutation functions.\n *\n * The mutation context is passed as the first argument to any Convex mutation\n * function run on the server.\n */\nexport type MutationCtx = GenericMutationCtx<DataModel>;\n\n/**\n * A set of services for use within Convex action functions.\n *\n * The action context is passed as the first argument to any Convex action\n * function run on the server.\n */\nexport type ActionCtx = GenericActionCtx<DataModel>;\n\n/**\n * An interface to read from the database within Convex query functions.\n *\n * The two entry points are {@link DatabaseReader.get}, which fetches a single\n * document by its {@link Id}, or {@link DatabaseReader.query}, which starts\n * building a query.\n */\nexport type DatabaseReader = GenericDatabaseReader<DataModel>;\n\n/**\n * An interface to read from and write to the database within Convex mutation\n * functions.\n *\n * Convex guarantees that all writes within a single mutation are\n * executed atomically, so you never have to worry about partial writes leaving\n * your data in an inconsistent state. See [the Convex Guide](https://docs.convex.dev/understanding/convex-fundamentals/functions#atomicity-and-optimistic-concurrency-control)\n * for the guarantees Convex provides your functions.\n */\nexport type DatabaseWriter = GenericDatabaseWriter<DataModel>;`;\n\n return {\n TS: serverTS,\n };\n }\n}\n\nexport function generateEnvInterface(envVars: EnvVarMeta[]): string {\n const lines: string[] = [];\n for (const [name, decl] of envVars) {\n const parsed = parseValidator(decl.value);\n let tsType = parsed ? validatorToType(parsed, false) : \"unknown\";\n if (decl.optional) {\n tsType += \" | undefined\";\n }\n lines.push(` readonly ${name}: ${tsType};`);\n }\n return `\n${ENV_DOCSTRING}\ntype Env = {\n${lines.join(\"\\n\")}\n};`;\n}\n"],
5
- "mappings": "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",
4
+ "sourcesContent": ["import { header } from \"./common.js\";\nimport { parseValidator, validatorToType } from \"./validator_helpers.js\";\n\nexport type EnvVarMeta = [\n string,\n { type: \"value\"; value: string; optional?: boolean | undefined },\n];\n\n// Environment variables the platform always injects into every deployment,\n// independent of the user's `convex.config.ts` declarations. Both are always\n// present, so they're typed as required `string`.\nconst PLATFORM_ENV_VARS: EnvVarMeta[] = [\n [\"CONVEX_CLOUD_URL\", { type: \"value\", value: '{\"type\":\"string\"}' }],\n [\"CONVEX_SITE_URL\", { type: \"value\", value: '{\"type\":\"string\"}' }],\n];\n\n// Prepend the always-present platform env vars. Users can't declare env vars\n// with these names \u2014 the backend rejects overriding built-in system env vars \u2014\n// so there's no collision to worry about.\nexport function withPlatformEnvVars(envVars: EnvVarMeta[]): EnvVarMeta[] {\n return [...PLATFORM_ENV_VARS, ...envVars];\n}\n\nconst ENV_DOCSTRING = `/**\n * Typesafe environment variables.\n *\n * This includes platform-provided env vars and any variables declared in\n * \\`convex.config.ts\\`.\n */`;\n\nexport function serverCodegen({\n useTypeScript,\n envVars,\n}: {\n useTypeScript: boolean;\n // - undefined: env var declarations not yet known (initial codegen before\n // server analysis). Emits an untyped `env` stub so imports don't break.\n // - array (empty or not): emit a typed `Env` interface and typed `env`\n // export. The interface always includes the platform-provided env vars, so\n // an empty array still yields a typed `env` with just those.\n envVars: EnvVarMeta[] | undefined;\n}) {\n const emittedEnvVars =\n envVars === undefined ? undefined : withPlatformEnvVars(envVars);\n const hasEnv = emittedEnvVars !== undefined;\n const envInterface = hasEnv ? generateEnvInterface(emittedEnvVars!) : \"\";\n const envDeclDTS = hasEnv\n ? `\n${ENV_DOCSTRING}\nexport declare const env: Env;\n`\n : `\nexport declare const env: Record<string, string | undefined>;\n`;\n // Route through `globalThis` rather than the bare `process` global so the\n // generated file typechecks even in projects without `@types/node`.\n const envDeclTS = hasEnv\n ? `\n${ENV_DOCSTRING}\nexport const env: Env = (globalThis as unknown as { process: { env: Env } }).process.env;\n`\n : `\nexport const env: Record<string, string | undefined> = (globalThis as unknown as { process: { env: Record<string, string | undefined> } }).process.env;\n`;\n const envDeclJS = hasEnv\n ? `\n${ENV_DOCSTRING}\nexport const env = process.env;\n`\n : `\nexport const env = process.env;\n`;\n\n if (!useTypeScript) {\n // Generate separate .js and .d.ts files\n const serverDTS = `\n ${header(\n \"Generated utilities for implementing server-side Convex query and mutation functions.\",\n )}\n import {\n ActionBuilder,\n HttpActionBuilder,\n MutationBuilder,\n QueryBuilder,\n GenericActionCtx,\n GenericMutationCtx,\n GenericQueryCtx,\n GenericDatabaseReader,\n GenericDatabaseWriter,\n } from \"convex/server\";\n import type { DataModel } from \"./dataModel.js\";\n ${envInterface}\n\n /**\n * Define a query in this Convex app's public API.\n *\n * This function will be allowed to read your Convex database and will be accessible from the client.\n *\n * @param func - The query function. It receives a {@link QueryCtx} as its first argument.\n * @returns The wrapped query. Include this as an \\`export\\` to name it and make it accessible.\n */\n export declare const query: QueryBuilder<DataModel, \"public\">;\n\n /**\n * Define a query that is only accessible from other Convex functions (but not from the client).\n *\n * This function will be allowed to read from your Convex database. It will not be accessible from the client.\n *\n * @param func - The query function. It receives a {@link QueryCtx} as its first argument.\n * @returns The wrapped query. Include this as an \\`export\\` to name it and make it accessible.\n */\n export declare const internalQuery: QueryBuilder<DataModel, \"internal\">;\n\n /**\n * Define a mutation in this Convex app's public API.\n *\n * This function will be allowed to modify your Convex database and will be accessible from the client.\n *\n * @param func - The mutation function. It receives a {@link MutationCtx} as its first argument.\n * @returns The wrapped mutation. Include this as an \\`export\\` to name it and make it accessible.\n */\n export declare const mutation: MutationBuilder<DataModel, \"public\">;\n\n /**\n * Define a mutation that is only accessible from other Convex functions (but not from the client).\n *\n * This function will be allowed to modify your Convex database. It will not be accessible from the client.\n *\n * @param func - The mutation function. It receives a {@link MutationCtx} as its first argument.\n * @returns The wrapped mutation. Include this as an \\`export\\` to name it and make it accessible.\n */\n export declare const internalMutation: MutationBuilder<DataModel, \"internal\">;\n\n /**\n * Define an action in this Convex app's public API.\n *\n * An action is a function which can execute any JavaScript code, including non-deterministic\n * code and code with side-effects, like calling third-party services.\n * They can be run in Convex's JavaScript environment or in Node.js using the \"use node\" directive.\n * They can interact with the database indirectly by calling queries and mutations using the {@link ActionCtx}.\n *\n * @param func - The action. It receives an {@link ActionCtx} as its first argument.\n * @returns The wrapped action. Include this as an \\`export\\` to name it and make it accessible.\n */\n export declare const action: ActionBuilder<DataModel, \"public\">;\n\n /**\n * Define an action that is only accessible from other Convex functions (but not from the client).\n *\n * @param func - The function. It receives an {@link ActionCtx} as its first argument.\n * @returns The wrapped function. Include this as an \\`export\\` to name it and make it accessible.\n */\n export declare const internalAction: ActionBuilder<DataModel, \"internal\">;\n\n /**\n * Define an HTTP action.\n *\n * The wrapped function will be used to respond to HTTP requests received\n * by a Convex deployment if the requests matches the path and method where\n * this action is routed. Be sure to route your httpAction in \\`convex/http.js\\`.\n *\n * @param func - The function. It receives an {@link ActionCtx} as its first argument\n * and a Fetch API \\`Request\\` object as its second.\n * @returns The wrapped function. Import this function from \\`convex/http.js\\` and route it to hook it up.\n */\n export declare const httpAction: HttpActionBuilder;\n${envDeclDTS}\n /**\n * A set of services for use within Convex query functions.\n *\n * The query context is passed as the first argument to any Convex query\n * function run on the server.\n *\n * This differs from the {@link MutationCtx} because all of the services are\n * read-only.\n */\n export type QueryCtx = GenericQueryCtx<DataModel>;\n\n /**\n * A set of services for use within Convex mutation functions.\n *\n * The mutation context is passed as the first argument to any Convex mutation\n * function run on the server.\n */\n export type MutationCtx = GenericMutationCtx<DataModel>;\n\n /**\n * A set of services for use within Convex action functions.\n *\n * The action context is passed as the first argument to any Convex action\n * function run on the server.\n */\n export type ActionCtx = GenericActionCtx<DataModel>;\n\n /**\n * An interface to read from the database within Convex query functions.\n *\n * The two entry points are {@link DatabaseReader.get}, which fetches a single\n * document by its {@link Id}, or {@link DatabaseReader.query}, which starts\n * building a query.\n */\n export type DatabaseReader = GenericDatabaseReader<DataModel>;\n\n /**\n * An interface to read from and write to the database within Convex mutation\n * functions.\n *\n * Convex guarantees that all writes within a single mutation are\n * executed atomically, so you never have to worry about partial writes leaving\n * your data in an inconsistent state. See [the Convex Guide](https://docs.convex.dev/understanding/convex-fundamentals/functions#atomicity-and-optimistic-concurrency-control)\n * for the guarantees Convex provides your functions.\n */\n export type DatabaseWriter = GenericDatabaseWriter<DataModel>;`;\n\n const serverJS = `\n ${header(\n \"Generated utilities for implementing server-side Convex query and mutation functions.\",\n )}\n import {\n actionGeneric,\n httpActionGeneric,\n queryGeneric,\n mutationGeneric,\n internalActionGeneric,\n internalMutationGeneric,\n internalQueryGeneric,\n } from \"convex/server\";\n\n /**\n * Define a query in this Convex app's public API.\n *\n * This function will be allowed to read your Convex database and will be accessible from the client.\n *\n * @param func - The query function. It receives a {@link QueryCtx} as its first argument.\n * @returns The wrapped query. Include this as an \\`export\\` to name it and make it accessible.\n */\n export const query = queryGeneric;\n\n /**\n * Define a query that is only accessible from other Convex functions (but not from the client).\n *\n * This function will be allowed to read from your Convex database. It will not be accessible from the client.\n *\n * @param func - The query function. It receives a {@link QueryCtx} as its first argument.\n * @returns The wrapped query. Include this as an \\`export\\` to name it and make it accessible.\n */\n export const internalQuery = internalQueryGeneric;\n\n /**\n * Define a mutation in this Convex app's public API.\n *\n * This function will be allowed to modify your Convex database and will be accessible from the client.\n *\n * @param func - The mutation function. It receives a {@link MutationCtx} as its first argument.\n * @returns The wrapped mutation. Include this as an \\`export\\` to name it and make it accessible.\n */\n export const mutation = mutationGeneric;\n\n /**\n * Define a mutation that is only accessible from other Convex functions (but not from the client).\n *\n * This function will be allowed to modify your Convex database. It will not be accessible from the client.\n *\n * @param func - The mutation function. It receives a {@link MutationCtx} as its first argument.\n * @returns The wrapped mutation. Include this as an \\`export\\` to name it and make it accessible.\n */\n export const internalMutation = internalMutationGeneric;\n\n /**\n * Define an action in this Convex app's public API.\n *\n * An action is a function which can execute any JavaScript code, including non-deterministic\n * code and code with side-effects, like calling third-party services.\n * They can be run in Convex's JavaScript environment or in Node.js using the \"use node\" directive.\n * They can interact with the database indirectly by calling queries and mutations using the {@link ActionCtx}.\n *\n * @param func - The action. It receives an {@link ActionCtx} as its first argument.\n * @returns The wrapped action. Include this as an \\`export\\` to name it and make it accessible.\n */\n export const action = actionGeneric;\n\n /**\n * Define an action that is only accessible from other Convex functions (but not from the client).\n *\n * @param func - The function. It receives an {@link ActionCtx} as its first argument.\n * @returns The wrapped function. Include this as an \\`export\\` to name it and make it accessible.\n */\n export const internalAction = internalActionGeneric;\n\n /**\n * Define an HTTP action.\n *\n * The wrapped function will be used to respond to HTTP requests received\n * by a Convex deployment if the requests matches the path and method where\n * this action is routed. Be sure to route your httpAction in \\`convex/http.js\\`.\n *\n * @param func - The function. It receives an {@link ActionCtx} as its first argument\n * and a Fetch API \\`Request\\` object as its second.\n * @returns The wrapped function. Import this function from \\`convex/http.js\\` and route it to hook it up.\n */\n export const httpAction = httpActionGeneric;\n${envDeclJS}\n `;\n\n return {\n DTS: serverDTS,\n JS: serverJS,\n };\n } else {\n // Generate combined .ts file\n const serverTS = `${header(\n \"Generated utilities for implementing server-side Convex query and mutation functions.\",\n )}\nimport {\n actionGeneric,\n httpActionGeneric,\n queryGeneric,\n mutationGeneric,\n internalActionGeneric,\n internalMutationGeneric,\n internalQueryGeneric,\n} from \"convex/server\";\nimport type {\n ActionBuilder,\n HttpActionBuilder,\n MutationBuilder,\n QueryBuilder,\n GenericActionCtx,\n GenericMutationCtx,\n GenericQueryCtx,\n GenericDatabaseReader,\n GenericDatabaseWriter,\n} from \"convex/server\";\nimport type { DataModel } from \"./dataModel.js\";\n${envInterface}\n\n/**\n * Define a query in this Convex app's public API.\n *\n * This function will be allowed to read your Convex database and will be accessible from the client.\n *\n * @param func - The query function. It receives a {@link QueryCtx} as its first argument.\n * @returns The wrapped query. Include this as an \\`export\\` to name it and make it accessible.\n */\nexport const query: QueryBuilder<DataModel, \"public\"> = queryGeneric;\n\n/**\n * Define a query that is only accessible from other Convex functions (but not from the client).\n *\n * This function will be allowed to read from your Convex database. It will not be accessible from the client.\n *\n * @param func - The query function. It receives a {@link QueryCtx} as its first argument.\n * @returns The wrapped query. Include this as an \\`export\\` to name it and make it accessible.\n */\nexport const internalQuery: QueryBuilder<DataModel, \"internal\"> = internalQueryGeneric;\n\n/**\n * Define a mutation in this Convex app's public API.\n *\n * This function will be allowed to modify your Convex database and will be accessible from the client.\n *\n * @param func - The mutation function. It receives a {@link MutationCtx} as its first argument.\n * @returns The wrapped mutation. Include this as an \\`export\\` to name it and make it accessible.\n */\nexport const mutation: MutationBuilder<DataModel, \"public\"> = mutationGeneric;\n\n/**\n * Define a mutation that is only accessible from other Convex functions (but not from the client).\n *\n * This function will be allowed to modify your Convex database. It will not be accessible from the client.\n *\n * @param func - The mutation function. It receives a {@link MutationCtx} as its first argument.\n * @returns The wrapped mutation. Include this as an \\`export\\` to name it and make it accessible.\n */\nexport const internalMutation: MutationBuilder<DataModel, \"internal\"> = internalMutationGeneric;\n\n/**\n * Define an action in this Convex app's public API.\n *\n * An action is a function which can execute any JavaScript code, including non-deterministic\n * code and code with side-effects, like calling third-party services.\n * They can be run in Convex's JavaScript environment or in Node.js using the \"use node\" directive.\n * They can interact with the database indirectly by calling queries and mutations using the {@link ActionCtx}.\n *\n * @param func - The action. It receives an {@link ActionCtx} as its first argument.\n * @returns The wrapped action. Include this as an \\`export\\` to name it and make it accessible.\n */\nexport const action: ActionBuilder<DataModel, \"public\"> = actionGeneric;\n\n/**\n * Define an action that is only accessible from other Convex functions (but not from the client).\n *\n * @param func - The function. It receives an {@link ActionCtx} as its first argument.\n * @returns The wrapped function. Include this as an \\`export\\` to name it and make it accessible.\n */\nexport const internalAction: ActionBuilder<DataModel, \"internal\"> = internalActionGeneric;\n\n/**\n * Define an HTTP action.\n *\n * The wrapped function will be used to respond to HTTP requests received\n * by a Convex deployment if the requests matches the path and method where\n * this action is routed. Be sure to route your httpAction in \\`convex/http.js\\`.\n *\n * @param func - The function. It receives an {@link ActionCtx} as its first argument\n * and a Fetch API \\`Request\\` object as its second.\n * @returns The wrapped function. Import this function from \\`convex/http.js\\` and route it to hook it up.\n */\nexport const httpAction: HttpActionBuilder = httpActionGeneric;\n${envDeclTS}\n/**\n * A set of services for use within Convex query functions.\n *\n * The query context is passed as the first argument to any Convex query\n * function run on the server.\n *\n * This differs from the {@link MutationCtx} because all of the services are\n * read-only.\n */\nexport type QueryCtx = GenericQueryCtx<DataModel>;\n\n/**\n * A set of services for use within Convex mutation functions.\n *\n * The mutation context is passed as the first argument to any Convex mutation\n * function run on the server.\n */\nexport type MutationCtx = GenericMutationCtx<DataModel>;\n\n/**\n * A set of services for use within Convex action functions.\n *\n * The action context is passed as the first argument to any Convex action\n * function run on the server.\n */\nexport type ActionCtx = GenericActionCtx<DataModel>;\n\n/**\n * An interface to read from the database within Convex query functions.\n *\n * The two entry points are {@link DatabaseReader.get}, which fetches a single\n * document by its {@link Id}, or {@link DatabaseReader.query}, which starts\n * building a query.\n */\nexport type DatabaseReader = GenericDatabaseReader<DataModel>;\n\n/**\n * An interface to read from and write to the database within Convex mutation\n * functions.\n *\n * Convex guarantees that all writes within a single mutation are\n * executed atomically, so you never have to worry about partial writes leaving\n * your data in an inconsistent state. See [the Convex Guide](https://docs.convex.dev/understanding/convex-fundamentals/functions#atomicity-and-optimistic-concurrency-control)\n * for the guarantees Convex provides your functions.\n */\nexport type DatabaseWriter = GenericDatabaseWriter<DataModel>;`;\n\n return {\n TS: serverTS,\n };\n }\n}\n\nexport function generateEnvInterface(envVars: EnvVarMeta[]): string {\n const lines: string[] = [];\n for (const [name, decl] of envVars) {\n const parsed = parseValidator(decl.value);\n let tsType = parsed ? validatorToType(parsed, false) : \"unknown\";\n if (decl.optional) {\n tsType += \" | undefined\";\n }\n lines.push(` readonly ${name}: ${tsType};`);\n }\n return `\n${ENV_DOCSTRING}\ntype Env = {\n${lines.join(\"\\n\")}\n};`;\n}\n"],
5
+ "mappings": "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",
6
6
  "names": []
7
7
  }
@@ -58,7 +58,7 @@ const convexExport = new import_extra_typings.Command("export").summary("Export
58
58
  deploymentNotice,
59
59
  snapshotExportDashboardLink: (0, import_dashboard.deploymentDashboardUrlPage)(
60
60
  deployment.deploymentFields?.deploymentName ?? null,
61
- "/settings/snapshot-export"
61
+ "/settings/snapshots"
62
62
  )
63
63
  });
64
64
  });
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../../src/cli/convexExport.ts"],
4
- "sourcesContent": ["import { Command } from \"@commander-js/extra-typings\";\nimport { chalkStderr } from \"chalk\";\nimport { ensureHasConvexDependency } from \"./lib/utils/utils.js\";\nimport { oneoffContext } from \"../bundler/context.js\";\nimport { loadSelectedDeploymentCredentials } from \"./lib/api.js\";\nimport { deploymentDashboardUrlPage } from \"./lib/dashboard.js\";\nimport { actionDescription } from \"./lib/command.js\";\nimport { exportFromDeployment } from \"./lib/convexExport.js\";\nimport { getDeploymentSelection } from \"./lib/deploymentSelection.js\";\nexport const convexExport = new Command(\"export\")\n .summary(\"Export data from your deployment to a ZIP file\")\n .description(\n [\n \"Export data, and optionally file storage, from your Convex deployment to a ZIP file.\",\n \"\",\n \"\u2022 Export to a directory: `npx convex export --path dir/`\",\n \"\u2022 Export to a ZIP file: `npx convex export --path snapshot.zip`\",\n \"\u2022 Include file storage: `npx convex export --include-file-storage --path dir/`\",\n \"\",\n \"By default, this exports from your dev deployment.\",\n \"\",\n \"See the data export guide (https://docs.convex.dev/database/import-export/export) for details and use cases.\",\n ].join(\"\\n\"),\n )\n .allowExcessArguments(false)\n .addExportOptions()\n .addDeploymentSelectionOptions(actionDescription(\"Export data from\"))\n .showHelpAfterError()\n .action(async (options) => {\n const ctx = await oneoffContext(options);\n await ensureHasConvexDependency(ctx, \"export\");\n\n const deploymentSelection = await getDeploymentSelection(ctx, options);\n const deployment = await loadSelectedDeploymentCredentials(\n ctx,\n deploymentSelection,\n );\n\n const deploymentNotice = options.prod\n ? ` in your ${chalkStderr.bold(\"prod\")} deployment`\n : \"\";\n await exportFromDeployment(ctx, {\n ...options,\n deploymentUrl: deployment.url,\n adminKey: deployment.adminKey,\n deploymentNotice,\n snapshotExportDashboardLink: deploymentDashboardUrlPage(\n deployment.deploymentFields?.deploymentName ?? null,\n \"/settings/snapshot-export\",\n ),\n });\n });\n"],
4
+ "sourcesContent": ["import { Command } from \"@commander-js/extra-typings\";\nimport { chalkStderr } from \"chalk\";\nimport { ensureHasConvexDependency } from \"./lib/utils/utils.js\";\nimport { oneoffContext } from \"../bundler/context.js\";\nimport { loadSelectedDeploymentCredentials } from \"./lib/api.js\";\nimport { deploymentDashboardUrlPage } from \"./lib/dashboard.js\";\nimport { actionDescription } from \"./lib/command.js\";\nimport { exportFromDeployment } from \"./lib/convexExport.js\";\nimport { getDeploymentSelection } from \"./lib/deploymentSelection.js\";\nexport const convexExport = new Command(\"export\")\n .summary(\"Export data from your deployment to a ZIP file\")\n .description(\n [\n \"Export data, and optionally file storage, from your Convex deployment to a ZIP file.\",\n \"\",\n \"\u2022 Export to a directory: `npx convex export --path dir/`\",\n \"\u2022 Export to a ZIP file: `npx convex export --path snapshot.zip`\",\n \"\u2022 Include file storage: `npx convex export --include-file-storage --path dir/`\",\n \"\",\n \"By default, this exports from your dev deployment.\",\n \"\",\n \"See the data export guide (https://docs.convex.dev/database/import-export/export) for details and use cases.\",\n ].join(\"\\n\"),\n )\n .allowExcessArguments(false)\n .addExportOptions()\n .addDeploymentSelectionOptions(actionDescription(\"Export data from\"))\n .showHelpAfterError()\n .action(async (options) => {\n const ctx = await oneoffContext(options);\n await ensureHasConvexDependency(ctx, \"export\");\n\n const deploymentSelection = await getDeploymentSelection(ctx, options);\n const deployment = await loadSelectedDeploymentCredentials(\n ctx,\n deploymentSelection,\n );\n\n const deploymentNotice = options.prod\n ? ` in your ${chalkStderr.bold(\"prod\")} deployment`\n : \"\";\n await exportFromDeployment(ctx, {\n ...options,\n deploymentUrl: deployment.url,\n adminKey: deployment.adminKey,\n deploymentNotice,\n snapshotExportDashboardLink: deploymentDashboardUrlPage(\n deployment.deploymentFields?.deploymentName ?? null,\n \"/settings/snapshots\",\n ),\n });\n });\n"],
5
5
  "mappings": ";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,2BAAwB;AACxB,mBAA4B;AAC5B,mBAA0C;AAC1C,qBAA8B;AAC9B,iBAAkD;AAClD,uBAA2C;AAC3C,qBAAkC;AAClC,0BAAqC;AACrC,iCAAuC;AAChC,MAAM,eAAe,IAAI,6BAAQ,QAAQ,EAC7C,QAAQ,gDAAgD,EACxD;AAAA,EACC;AAAA,IACE;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,EACF,EAAE,KAAK,IAAI;AACb,EACC,qBAAqB,KAAK,EAC1B,iBAAiB,EACjB,kCAA8B,kCAAkB,kBAAkB,CAAC,EACnE,mBAAmB,EACnB,OAAO,OAAO,YAAY;AACzB,QAAM,MAAM,UAAM,8BAAc,OAAO;AACvC,YAAM,wCAA0B,KAAK,QAAQ;AAE7C,QAAM,sBAAsB,UAAM,mDAAuB,KAAK,OAAO;AACrE,QAAM,aAAa,UAAM;AAAA,IACvB;AAAA,IACA;AAAA,EACF;AAEA,QAAM,mBAAmB,QAAQ,OAC7B,YAAY,yBAAY,KAAK,MAAM,CAAC,gBACpC;AACJ,YAAM,0CAAqB,KAAK;AAAA,IAC9B,GAAG;AAAA,IACH,eAAe,WAAW;AAAA,IAC1B,UAAU,WAAW;AAAA,IACrB;AAAA,IACA,iCAA6B;AAAA,MAC3B,WAAW,kBAAkB,kBAAkB;AAAA,MAC/C;AAAA,IACF;AAAA,EACF,CAAC;AACH,CAAC;",
6
6
  "names": []
7
7
  }
@@ -30,9 +30,8 @@ var import_node_net = __toESM(require("node:net"), 1);
30
30
  var import_undici = require("undici");
31
31
  var import_log = require("../bundler/log.js");
32
32
  var import_program = require("./program.js");
33
- const HARD_MINIMUM_NODE_MAJOR_VERSION = 16;
34
- const HARD_MINIMUM_NODE_MINOR_VERSION = 15;
35
- const SOFT_MINIMUM_NODE_MAJOR_VERSION = 20;
33
+ const HARD_MINIMUM_NODE_MAJOR_VERSION = 20;
34
+ const HARD_MINIMUM_NODE_MINOR_VERSION = 0;
36
35
  function logToStderr(...args) {
37
36
  process.stderr.write(`${(0, import_util.format)(...args)}
38
37
  `);
@@ -76,35 +75,6 @@ async function main() {
76
75
  );
77
76
  process.exit(1);
78
77
  }
79
- if (majorVersion < SOFT_MINIMUM_NODE_MAJOR_VERSION) {
80
- logToStderr(
81
- import_chalk.chalkStderr.yellow(
82
- `Warning: Your Node version ${nodeVersion} is below the recommended minimum of Node v${SOFT_MINIMUM_NODE_MAJOR_VERSION}.x. Convex may work but could behave unexpectedly.`
83
- )
84
- );
85
- logToStderr(
86
- import_chalk.chalkStderr.gray(
87
- `We recommend upgrading Node to v${SOFT_MINIMUM_NODE_MAJOR_VERSION} or newer.`
88
- )
89
- );
90
- logToStderr(
91
- import_chalk.chalkStderr.gray(
92
- `You can use ${import_chalk.chalkStderr.bold(
93
- "nvm"
94
- )} (https://github.com/nvm-sh/nvm#installing-and-updating) to manage different versions of Node.`
95
- )
96
- );
97
- logToStderr(
98
- import_chalk.chalkStderr.gray(
99
- "After installing `nvm`, install the latest version of Node with " + import_chalk.chalkStderr.bold("`nvm install node`.")
100
- )
101
- );
102
- logToStderr(
103
- import_chalk.chalkStderr.gray(
104
- "Then, activate the installed version in your terminal with " + import_chalk.chalkStderr.bold("`nvm use`.")
105
- )
106
- );
107
- }
108
78
  const program = (0, import_program.buildProgram)();
109
79
  try {
110
80
  await program.parseAsync(process.argv);
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../../src/cli/index.ts"],
4
- "sourcesContent": ["import { chalkStderr } from \"chalk\";\nimport * as Sentry from \"@sentry/node\";\nimport { initSentry } from \"./lib/utils/sentry.js\";\nimport { format } from \"util\";\nimport dns from \"node:dns\";\nimport net from \"node:net\";\nimport { setGlobalDispatcher, EnvHttpProxyAgent } from \"undici\";\nimport { logVerbose } from \"../bundler/log.js\";\nimport { buildProgram } from \"./program.js\";\n\nconst HARD_MINIMUM_NODE_MAJOR_VERSION = 16;\nconst HARD_MINIMUM_NODE_MINOR_VERSION = 15;\nconst SOFT_MINIMUM_NODE_MAJOR_VERSION = 20;\n\n// console.error before it started being red by default in Node.js v20\nfunction logToStderr(...args: unknown[]) {\n process.stderr.write(`${format(...args)}\\n`);\n}\n\nasync function main() {\n const nodeVersion = process.versions.node;\n const majorVersion = parseInt(nodeVersion.split(\".\")[0], 10);\n const minorVersion = parseInt(nodeVersion.split(\".\")[1], 10);\n\n const proxy = process.env.HTTPS_PROXY || process.env.HTTP_PROXY;\n if (proxy) {\n setGlobalDispatcher(new EnvHttpProxyAgent());\n logVerbose(`[proxy-bootstrap] Using proxy: ${proxy}`);\n }\n\n // Use ipv4 first for 127.0.0.1 in tests\n dns.setDefaultResultOrder(\"ipv4first\");\n\n // Increase the timeout from default 250ms for high latency situations,\n // see https://github.com/nodejs/node/issues/54359.\n if (majorVersion >= 20) {\n // While we use Node.js v18 types\n (net as any).setDefaultAutoSelectFamilyAttemptTimeout?.(1000);\n }\n\n initSentry();\n\n if (\n majorVersion < HARD_MINIMUM_NODE_MAJOR_VERSION ||\n (majorVersion === HARD_MINIMUM_NODE_MAJOR_VERSION &&\n minorVersion < HARD_MINIMUM_NODE_MINOR_VERSION)\n ) {\n logToStderr(\n chalkStderr.red(\n `Your Node version ${nodeVersion} is too old. Convex requires at least Node v${HARD_MINIMUM_NODE_MAJOR_VERSION}.${HARD_MINIMUM_NODE_MINOR_VERSION}`,\n ),\n );\n logToStderr(\n chalkStderr.gray(\n `You can use ${chalkStderr.bold(\n \"nvm\",\n )} (https://github.com/nvm-sh/nvm#installing-and-updating) to manage different versions of Node.`,\n ),\n );\n logToStderr(\n chalkStderr.gray(\n \"After installing `nvm`, install the latest version of Node with \" +\n chalkStderr.bold(\"`nvm install node`.\"),\n ),\n );\n logToStderr(\n chalkStderr.gray(\n \"Then, activate the installed version in your terminal with \" +\n chalkStderr.bold(\"`nvm use`.\"),\n ),\n );\n process.exit(1);\n }\n\n if (majorVersion < SOFT_MINIMUM_NODE_MAJOR_VERSION) {\n logToStderr(\n chalkStderr.yellow(\n `Warning: Your Node version ${nodeVersion} is below the recommended minimum of Node v${SOFT_MINIMUM_NODE_MAJOR_VERSION}.x. Convex may work but could behave unexpectedly.`,\n ),\n );\n logToStderr(\n chalkStderr.gray(\n `We recommend upgrading Node to v${SOFT_MINIMUM_NODE_MAJOR_VERSION} or newer.`,\n ),\n );\n logToStderr(\n chalkStderr.gray(\n `You can use ${chalkStderr.bold(\n \"nvm\",\n )} (https://github.com/nvm-sh/nvm#installing-and-updating) to manage different versions of Node.`,\n ),\n );\n logToStderr(\n chalkStderr.gray(\n \"After installing `nvm`, install the latest version of Node with \" +\n chalkStderr.bold(\"`nvm install node`.\"),\n ),\n );\n logToStderr(\n chalkStderr.gray(\n \"Then, activate the installed version in your terminal with \" +\n chalkStderr.bold(\"`nvm use`.\"),\n ),\n );\n }\n\n const program = buildProgram();\n\n // Run the command and be sure to flush Sentry before exiting.\n try {\n await program.parseAsync(process.argv);\n } catch (e) {\n Sentry.captureException(e);\n process.exitCode = 1;\n // This is too early to use `logError`, so just log directly.\n // eslint-disable-next-line no-console\n console.error(chalkStderr.red(\"Unexpected Error: \" + e));\n } finally {\n await Sentry.close();\n }\n // When stdout is a pipe, Node buffers writes and `process.exit()` does not\n // wait for them to flush \u2014 drain first so piped output isn't truncated.\n await Promise.all([\n new Promise<void>((resolve) => process.stdout.write(\"\", () => resolve())),\n new Promise<void>((resolve) => process.stderr.write(\"\", () => resolve())),\n ]);\n process.exit();\n}\nvoid main();\n"],
5
- "mappings": ";;;;;;;;;;;;;;;;;;;;;;;AAAA,mBAA4B;AAC5B,aAAwB;AACxB,oBAA2B;AAC3B,kBAAuB;AACvB,sBAAgB;AAChB,sBAAgB;AAChB,oBAAuD;AACvD,iBAA2B;AAC3B,qBAA6B;AAE7B,MAAM,kCAAkC;AACxC,MAAM,kCAAkC;AACxC,MAAM,kCAAkC;AAGxC,SAAS,eAAe,MAAiB;AACvC,UAAQ,OAAO,MAAM,OAAG,oBAAO,GAAG,IAAI,CAAC;AAAA,CAAI;AAC7C;AAEA,eAAe,OAAO;AACpB,QAAM,cAAc,QAAQ,SAAS;AACrC,QAAM,eAAe,SAAS,YAAY,MAAM,GAAG,EAAE,CAAC,GAAG,EAAE;AAC3D,QAAM,eAAe,SAAS,YAAY,MAAM,GAAG,EAAE,CAAC,GAAG,EAAE;AAE3D,QAAM,QAAQ,QAAQ,IAAI,eAAe,QAAQ,IAAI;AACrD,MAAI,OAAO;AACT,2CAAoB,IAAI,gCAAkB,CAAC;AAC3C,+BAAW,kCAAkC,KAAK,EAAE;AAAA,EACtD;AAGA,kBAAAA,QAAI,sBAAsB,WAAW;AAIrC,MAAI,gBAAgB,IAAI;AAEtB,IAAC,gBAAAC,QAAY,2CAA2C,GAAI;AAAA,EAC9D;AAEA,gCAAW;AAEX,MACE,eAAe,mCACd,iBAAiB,mCAChB,eAAe,iCACjB;AACA;AAAA,MACE,yBAAY;AAAA,QACV,qBAAqB,WAAW,+CAA+C,+BAA+B,IAAI,+BAA+B;AAAA,MACnJ;AAAA,IACF;AACA;AAAA,MACE,yBAAY;AAAA,QACV,eAAe,yBAAY;AAAA,UACzB;AAAA,QACF,CAAC;AAAA,MACH;AAAA,IACF;AACA;AAAA,MACE,yBAAY;AAAA,QACV,qEACE,yBAAY,KAAK,qBAAqB;AAAA,MAC1C;AAAA,IACF;AACA;AAAA,MACE,yBAAY;AAAA,QACV,gEACE,yBAAY,KAAK,YAAY;AAAA,MACjC;AAAA,IACF;AACA,YAAQ,KAAK,CAAC;AAAA,EAChB;AAEA,MAAI,eAAe,iCAAiC;AAClD;AAAA,MACE,yBAAY;AAAA,QACV,8BAA8B,WAAW,8CAA8C,+BAA+B;AAAA,MACxH;AAAA,IACF;AACA;AAAA,MACE,yBAAY;AAAA,QACV,mCAAmC,+BAA+B;AAAA,MACpE;AAAA,IACF;AACA;AAAA,MACE,yBAAY;AAAA,QACV,eAAe,yBAAY;AAAA,UACzB;AAAA,QACF,CAAC;AAAA,MACH;AAAA,IACF;AACA;AAAA,MACE,yBAAY;AAAA,QACV,qEACE,yBAAY,KAAK,qBAAqB;AAAA,MAC1C;AAAA,IACF;AACA;AAAA,MACE,yBAAY;AAAA,QACV,gEACE,yBAAY,KAAK,YAAY;AAAA,MACjC;AAAA,IACF;AAAA,EACF;AAEA,QAAM,cAAU,6BAAa;AAG7B,MAAI;AACF,UAAM,QAAQ,WAAW,QAAQ,IAAI;AAAA,EACvC,SAAS,GAAG;AACV,WAAO,iBAAiB,CAAC;AACzB,YAAQ,WAAW;AAGnB,YAAQ,MAAM,yBAAY,IAAI,uBAAuB,CAAC,CAAC;AAAA,EACzD,UAAE;AACA,UAAM,OAAO,MAAM;AAAA,EACrB;AAGA,QAAM,QAAQ,IAAI;AAAA,IAChB,IAAI,QAAc,CAAC,YAAY,QAAQ,OAAO,MAAM,IAAI,MAAM,QAAQ,CAAC,CAAC;AAAA,IACxE,IAAI,QAAc,CAAC,YAAY,QAAQ,OAAO,MAAM,IAAI,MAAM,QAAQ,CAAC,CAAC;AAAA,EAC1E,CAAC;AACD,UAAQ,KAAK;AACf;AACA,KAAK,KAAK;",
4
+ "sourcesContent": ["import { chalkStderr } from \"chalk\";\nimport * as Sentry from \"@sentry/node\";\nimport { initSentry } from \"./lib/utils/sentry.js\";\nimport { format } from \"util\";\nimport dns from \"node:dns\";\nimport net from \"node:net\";\nimport { setGlobalDispatcher, EnvHttpProxyAgent } from \"undici\";\nimport { logVerbose } from \"../bundler/log.js\";\nimport { buildProgram } from \"./program.js\";\n\nconst HARD_MINIMUM_NODE_MAJOR_VERSION = 20;\nconst HARD_MINIMUM_NODE_MINOR_VERSION = 0;\n\n// console.error before it started being red by default in Node.js v20\nfunction logToStderr(...args: unknown[]) {\n process.stderr.write(`${format(...args)}\\n`);\n}\n\nasync function main() {\n const nodeVersion = process.versions.node;\n const majorVersion = parseInt(nodeVersion.split(\".\")[0], 10);\n const minorVersion = parseInt(nodeVersion.split(\".\")[1], 10);\n\n const proxy = process.env.HTTPS_PROXY || process.env.HTTP_PROXY;\n if (proxy) {\n setGlobalDispatcher(new EnvHttpProxyAgent());\n logVerbose(`[proxy-bootstrap] Using proxy: ${proxy}`);\n }\n\n // Use ipv4 first for 127.0.0.1 in tests\n dns.setDefaultResultOrder(\"ipv4first\");\n\n // Increase the timeout from default 250ms for high latency situations,\n // see https://github.com/nodejs/node/issues/54359.\n if (majorVersion >= 20) {\n // While we use Node.js v18 types\n (net as any).setDefaultAutoSelectFamilyAttemptTimeout?.(1000);\n }\n\n initSentry();\n\n if (\n majorVersion < HARD_MINIMUM_NODE_MAJOR_VERSION ||\n (majorVersion === HARD_MINIMUM_NODE_MAJOR_VERSION &&\n minorVersion < HARD_MINIMUM_NODE_MINOR_VERSION)\n ) {\n logToStderr(\n chalkStderr.red(\n `Your Node version ${nodeVersion} is too old. Convex requires at least Node v${HARD_MINIMUM_NODE_MAJOR_VERSION}.${HARD_MINIMUM_NODE_MINOR_VERSION}`,\n ),\n );\n logToStderr(\n chalkStderr.gray(\n `You can use ${chalkStderr.bold(\n \"nvm\",\n )} (https://github.com/nvm-sh/nvm#installing-and-updating) to manage different versions of Node.`,\n ),\n );\n logToStderr(\n chalkStderr.gray(\n \"After installing `nvm`, install the latest version of Node with \" +\n chalkStderr.bold(\"`nvm install node`.\"),\n ),\n );\n logToStderr(\n chalkStderr.gray(\n \"Then, activate the installed version in your terminal with \" +\n chalkStderr.bold(\"`nvm use`.\"),\n ),\n );\n process.exit(1);\n }\n\n const program = buildProgram();\n\n // Run the command and be sure to flush Sentry before exiting.\n try {\n await program.parseAsync(process.argv);\n } catch (e) {\n Sentry.captureException(e);\n process.exitCode = 1;\n // This is too early to use `logError`, so just log directly.\n // eslint-disable-next-line no-console\n console.error(chalkStderr.red(\"Unexpected Error: \" + e));\n } finally {\n await Sentry.close();\n }\n // When stdout is a pipe, Node buffers writes and `process.exit()` does not\n // wait for them to flush \u2014 drain first so piped output isn't truncated.\n await Promise.all([\n new Promise<void>((resolve) => process.stdout.write(\"\", () => resolve())),\n new Promise<void>((resolve) => process.stderr.write(\"\", () => resolve())),\n ]);\n process.exit();\n}\nvoid main();\n"],
5
+ "mappings": ";;;;;;;;;;;;;;;;;;;;;;;AAAA,mBAA4B;AAC5B,aAAwB;AACxB,oBAA2B;AAC3B,kBAAuB;AACvB,sBAAgB;AAChB,sBAAgB;AAChB,oBAAuD;AACvD,iBAA2B;AAC3B,qBAA6B;AAE7B,MAAM,kCAAkC;AACxC,MAAM,kCAAkC;AAGxC,SAAS,eAAe,MAAiB;AACvC,UAAQ,OAAO,MAAM,OAAG,oBAAO,GAAG,IAAI,CAAC;AAAA,CAAI;AAC7C;AAEA,eAAe,OAAO;AACpB,QAAM,cAAc,QAAQ,SAAS;AACrC,QAAM,eAAe,SAAS,YAAY,MAAM,GAAG,EAAE,CAAC,GAAG,EAAE;AAC3D,QAAM,eAAe,SAAS,YAAY,MAAM,GAAG,EAAE,CAAC,GAAG,EAAE;AAE3D,QAAM,QAAQ,QAAQ,IAAI,eAAe,QAAQ,IAAI;AACrD,MAAI,OAAO;AACT,2CAAoB,IAAI,gCAAkB,CAAC;AAC3C,+BAAW,kCAAkC,KAAK,EAAE;AAAA,EACtD;AAGA,kBAAAA,QAAI,sBAAsB,WAAW;AAIrC,MAAI,gBAAgB,IAAI;AAEtB,IAAC,gBAAAC,QAAY,2CAA2C,GAAI;AAAA,EAC9D;AAEA,gCAAW;AAEX,MACE,eAAe,mCACd,iBAAiB,mCAChB,eAAe,iCACjB;AACA;AAAA,MACE,yBAAY;AAAA,QACV,qBAAqB,WAAW,+CAA+C,+BAA+B,IAAI,+BAA+B;AAAA,MACnJ;AAAA,IACF;AACA;AAAA,MACE,yBAAY;AAAA,QACV,eAAe,yBAAY;AAAA,UACzB;AAAA,QACF,CAAC;AAAA,MACH;AAAA,IACF;AACA;AAAA,MACE,yBAAY;AAAA,QACV,qEACE,yBAAY,KAAK,qBAAqB;AAAA,MAC1C;AAAA,IACF;AACA;AAAA,MACE,yBAAY;AAAA,QACV,gEACE,yBAAY,KAAK,YAAY;AAAA,MACjC;AAAA,IACF;AACA,YAAQ,KAAK,CAAC;AAAA,EAChB;AAEA,QAAM,cAAU,6BAAa;AAG7B,MAAI;AACF,UAAM,QAAQ,WAAW,QAAQ,IAAI;AAAA,EACvC,SAAS,GAAG;AACV,WAAO,iBAAiB,CAAC;AACzB,YAAQ,WAAW;AAGnB,YAAQ,MAAM,yBAAY,IAAI,uBAAuB,CAAC,CAAC;AAAA,EACzD,UAAE;AACA,UAAM,OAAO,MAAM;AAAA,EACrB;AAGA,QAAM,QAAQ,IAAI;AAAA,IAChB,IAAI,QAAc,CAAC,YAAY,QAAQ,OAAO,MAAM,IAAI,MAAM,QAAQ,CAAC,CAAC;AAAA,IACxE,IAAI,QAAc,CAAC,YAAY,QAAQ,OAAO,MAAM,IAAI,MAAM,QAAQ,CAAC,CAAC;AAAA,EAC1E,CAAC;AACD,UAAQ,KAAK;AACf;AACA,KAAK,KAAK;",
6
6
  "names": ["dns", "net"]
7
7
  }
@@ -150,11 +150,17 @@ async function validateDeploymentSelectionForExistingDeployment(ctx, deploymentS
150
150
  }
151
151
  async function hasAccessToProject(ctx, selector) {
152
152
  try {
153
- await (0, import_utils.bigBrainAPIMaybeThrows)({
154
- ctx,
155
- path: `teams/${selector.teamSlug}/projects/${selector.projectSlug}/deployments`,
156
- method: "GET"
157
- });
153
+ await (0, import_utils.typedPlatformClient)(ctx, { throw: true }).GET(
154
+ "/teams/{team_id_or_slug}/projects/{project_slug}",
155
+ {
156
+ params: {
157
+ path: {
158
+ team_id_or_slug: selector.teamSlug,
159
+ project_slug: selector.projectSlug
160
+ }
161
+ }
162
+ }
163
+ );
158
164
  return true;
159
165
  } catch (err) {
160
166
  if (err instanceof import_utils.ThrowingFetchError && (err.serverErrorData?.code === "TeamNotFound" || err.serverErrorData?.code === "ProjectNotFound")) {