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.
- package/CHANGELOG.md +136 -113
- package/dist/browser.bundle.js +1 -1
- package/dist/browser.bundle.js.map +1 -1
- package/dist/cjs/cli/codegen_templates/component_server.js +4 -3
- package/dist/cjs/cli/codegen_templates/component_server.js.map +2 -2
- package/dist/cjs/cli/codegen_templates/server.js +24 -12
- package/dist/cjs/cli/codegen_templates/server.js.map +2 -2
- package/dist/cjs/cli/convexExport.js +1 -1
- package/dist/cjs/cli/convexExport.js.map +1 -1
- package/dist/cjs/cli/index.js +2 -32
- package/dist/cjs/cli/index.js.map +2 -2
- package/dist/cjs/cli/lib/api.js +11 -5
- package/dist/cjs/cli/lib/api.js.map +2 -2
- package/dist/cjs/cli/lib/convexExport.js +12 -1
- package/dist/cjs/cli/lib/convexExport.js.map +2 -2
- package/dist/cjs/cli/lib/dashboard.js.map +2 -2
- package/dist/cjs/cli/lib/generatedFunctionLogsApi.js.map +1 -1
- package/dist/cjs/cli/lib/localDeployment/upgrade.js +23 -188
- package/dist/cjs/cli/lib/localDeployment/upgrade.js.map +3 -3
- package/dist/cjs/cli/lib/login.js +12 -8
- package/dist/cjs/cli/lib/login.js.map +2 -2
- package/dist/cjs/cli/lib/mcp/tools/index.js.map +1 -1
- package/dist/cjs/cli/login.js +52 -7
- package/dist/cjs/cli/login.js.map +2 -2
- package/dist/cjs/cli/mcp.js +60 -63
- package/dist/cjs/cli/mcp.js.map +2 -2
- package/dist/cjs/index.js +1 -1
- package/dist/cjs/index.js.map +1 -1
- package/dist/cjs/react/ConvexAuthState.js +30 -32
- package/dist/cjs/react/ConvexAuthState.js.map +2 -2
- package/dist/cjs/server/impl/actions_impl.js +12 -0
- package/dist/cjs/server/impl/actions_impl.js.map +2 -2
- package/dist/cjs/server/index.js +3 -0
- package/dist/cjs/server/index.js.map +2 -2
- package/dist/cjs/server/schema.js +69 -1
- package/dist/cjs/server/schema.js.map +2 -2
- package/dist/cjs-types/cli/codegen_templates/component_server.d.ts.map +1 -1
- package/dist/cjs-types/cli/codegen_templates/server.d.ts +1 -0
- package/dist/cjs-types/cli/codegen_templates/server.d.ts.map +1 -1
- package/dist/cjs-types/cli/lib/api.d.ts.map +1 -1
- package/dist/cjs-types/cli/lib/convexExport.d.ts +1 -0
- package/dist/cjs-types/cli/lib/convexExport.d.ts.map +1 -1
- package/dist/cjs-types/cli/lib/dashboard.d.ts.map +1 -1
- package/dist/cjs-types/cli/lib/generatedFunctionLogsApi.d.ts +2 -0
- package/dist/cjs-types/cli/lib/generatedFunctionLogsApi.d.ts.map +1 -1
- package/dist/cjs-types/cli/lib/localDeployment/upgrade.d.ts +2 -0
- package/dist/cjs-types/cli/lib/localDeployment/upgrade.d.ts.map +1 -1
- package/dist/cjs-types/cli/lib/login.d.ts +5 -0
- package/dist/cjs-types/cli/lib/login.d.ts.map +1 -1
- package/dist/cjs-types/cli/lib/mcp/tools/index.d.ts +1 -1
- package/dist/cjs-types/cli/lib/mcp/tools/index.d.ts.map +1 -1
- package/dist/cjs-types/cli/login.d.ts.map +1 -1
- package/dist/cjs-types/cli/mcp.d.ts +3 -0
- package/dist/cjs-types/cli/mcp.d.ts.map +1 -1
- package/dist/cjs-types/index.d.ts +1 -1
- package/dist/cjs-types/index.d.ts.map +1 -1
- package/dist/cjs-types/react/ConvexAuthState.d.ts.map +1 -1
- package/dist/cjs-types/server/impl/actions_impl.d.ts.map +1 -1
- package/dist/cjs-types/server/index.d.ts +2 -2
- package/dist/cjs-types/server/index.d.ts.map +1 -1
- package/dist/cjs-types/server/schema.d.ts +83 -5
- package/dist/cjs-types/server/schema.d.ts.map +1 -1
- package/dist/cli.bundle.cjs +23775 -18752
- package/dist/cli.bundle.cjs.map +4 -4
- package/dist/esm/cli/codegen_templates/component_server.js +8 -4
- package/dist/esm/cli/codegen_templates/component_server.js.map +2 -2
- package/dist/esm/cli/codegen_templates/server.js +22 -11
- package/dist/esm/cli/codegen_templates/server.js.map +2 -2
- package/dist/esm/cli/convexExport.js +1 -1
- package/dist/esm/cli/convexExport.js.map +1 -1
- package/dist/esm/cli/index.js +2 -32
- package/dist/esm/cli/index.js.map +2 -2
- package/dist/esm/cli/lib/api.js +11 -5
- package/dist/esm/cli/lib/api.js.map +2 -2
- package/dist/esm/cli/lib/convexExport.js +16 -3
- package/dist/esm/cli/lib/convexExport.js.map +2 -2
- package/dist/esm/cli/lib/dashboard.js.map +2 -2
- package/dist/esm/cli/lib/localDeployment/upgrade.js +22 -190
- package/dist/esm/cli/lib/localDeployment/upgrade.js.map +2 -2
- package/dist/esm/cli/lib/login.js +11 -8
- package/dist/esm/cli/lib/login.js.map +2 -2
- package/dist/esm/cli/lib/mcp/tools/index.js.map +1 -1
- package/dist/esm/cli/login.js +54 -10
- package/dist/esm/cli/login.js.map +2 -2
- package/dist/esm/cli/mcp.js +60 -67
- package/dist/esm/cli/mcp.js.map +2 -2
- package/dist/esm/index.js +1 -1
- package/dist/esm/index.js.map +1 -1
- package/dist/esm/react/ConvexAuthState.js +31 -32
- package/dist/esm/react/ConvexAuthState.js.map +2 -2
- package/dist/esm/server/impl/actions_impl.js +11 -0
- package/dist/esm/server/impl/actions_impl.js.map +2 -2
- package/dist/esm/server/index.js +2 -1
- package/dist/esm/server/index.js.map +2 -2
- package/dist/esm/server/schema.js +67 -0
- package/dist/esm/server/schema.js.map +2 -2
- package/dist/esm-types/cli/codegen_templates/component_server.d.ts.map +1 -1
- package/dist/esm-types/cli/codegen_templates/server.d.ts +1 -0
- package/dist/esm-types/cli/codegen_templates/server.d.ts.map +1 -1
- package/dist/esm-types/cli/lib/api.d.ts.map +1 -1
- package/dist/esm-types/cli/lib/convexExport.d.ts +1 -0
- package/dist/esm-types/cli/lib/convexExport.d.ts.map +1 -1
- package/dist/esm-types/cli/lib/dashboard.d.ts.map +1 -1
- package/dist/esm-types/cli/lib/generatedFunctionLogsApi.d.ts +2 -0
- package/dist/esm-types/cli/lib/generatedFunctionLogsApi.d.ts.map +1 -1
- package/dist/esm-types/cli/lib/localDeployment/upgrade.d.ts +2 -0
- package/dist/esm-types/cli/lib/localDeployment/upgrade.d.ts.map +1 -1
- package/dist/esm-types/cli/lib/login.d.ts +5 -0
- package/dist/esm-types/cli/lib/login.d.ts.map +1 -1
- package/dist/esm-types/cli/lib/mcp/tools/index.d.ts +1 -1
- package/dist/esm-types/cli/lib/mcp/tools/index.d.ts.map +1 -1
- package/dist/esm-types/cli/login.d.ts.map +1 -1
- package/dist/esm-types/cli/mcp.d.ts +3 -0
- package/dist/esm-types/cli/mcp.d.ts.map +1 -1
- package/dist/esm-types/index.d.ts +1 -1
- package/dist/esm-types/index.d.ts.map +1 -1
- package/dist/esm-types/react/ConvexAuthState.d.ts.map +1 -1
- package/dist/esm-types/server/impl/actions_impl.d.ts.map +1 -1
- package/dist/esm-types/server/index.d.ts +2 -2
- package/dist/esm-types/server/index.d.ts.map +1 -1
- package/dist/esm-types/server/schema.d.ts +83 -5
- package/dist/esm-types/server/schema.d.ts.map +1 -1
- package/dist/react.bundle.js +31 -33
- package/dist/react.bundle.js.map +2 -2
- package/package.json +5 -6
- package/src/cli/codegen_templates/component_server.ts +12 -6
- package/src/cli/codegen_templates/server.ts +36 -19
- package/src/cli/convexExport.ts +1 -1
- package/src/cli/index.ts +2 -35
- package/src/cli/lib/api.ts +11 -5
- package/src/cli/lib/convexExport.ts +21 -0
- package/src/cli/lib/dashboard.ts +2 -0
- package/src/cli/lib/generatedFunctionLogsApi.ts +2 -0
- package/src/cli/lib/localDeployment/upgrade.ts +34 -207
- package/src/cli/lib/login.ts +20 -9
- package/src/cli/lib/mcp/tools/index.ts +1 -1
- package/src/cli/login.ts +88 -13
- package/src/cli/mcp.ts +64 -72
- package/src/index.ts +1 -1
- package/src/react/ConvexAuthState.tsx +15 -7
- package/src/server/impl/actions_impl.ts +23 -0
- package/src/server/index.ts +7 -1
- package/src/server/schema.ts +178 -1
- package/dist/cjs-types/browser/http_client.test.d.ts +0 -2
- package/dist/cjs-types/browser/http_client.test.d.ts.map +0 -1
- package/dist/cjs-types/browser/query_options.test.d.ts +0 -2
- package/dist/cjs-types/browser/query_options.test.d.ts.map +0 -1
- package/dist/cjs-types/browser/simple_client.test.d.ts +0 -2
- package/dist/cjs-types/browser/simple_client.test.d.ts.map +0 -1
- package/dist/cjs-types/browser/sync/client.test.d.ts +0 -5
- package/dist/cjs-types/browser/sync/client.test.d.ts.map +0 -1
- package/dist/cjs-types/browser/sync/client_node.test.d.ts +0 -2
- package/dist/cjs-types/browser/sync/client_node.test.d.ts.map +0 -1
- package/dist/cjs-types/browser/sync/client_node_test_helpers.d.ts +0 -44
- package/dist/cjs-types/browser/sync/client_node_test_helpers.d.ts.map +0 -1
- package/dist/cjs-types/browser/sync/local_state.test.d.ts +0 -2
- package/dist/cjs-types/browser/sync/local_state.test.d.ts.map +0 -1
- package/dist/cjs-types/browser/sync/optimistic_query_set.test.d.ts +0 -2
- package/dist/cjs-types/browser/sync/optimistic_query_set.test.d.ts.map +0 -1
- package/dist/cjs-types/browser/sync/paginated_query_client.test.d.ts +0 -2
- package/dist/cjs-types/browser/sync/paginated_query_client.test.d.ts.map +0 -1
- package/dist/cjs-types/browser/sync/protocol.test.d.ts +0 -5
- package/dist/cjs-types/browser/sync/protocol.test.d.ts.map +0 -1
- package/dist/cjs-types/browser/sync/request_manager.test.d.ts +0 -2
- package/dist/cjs-types/browser/sync/request_manager.test.d.ts.map +0 -1
- package/dist/cjs-types/bundler/fs.test.d.ts +0 -2
- package/dist/cjs-types/bundler/fs.test.d.ts.map +0 -1
- package/dist/cjs-types/bundler/index.test.d.ts +0 -2
- package/dist/cjs-types/bundler/index.test.d.ts.map +0 -1
- package/dist/cjs-types/cli/codegen_templates/api.test.d.ts +0 -2
- package/dist/cjs-types/cli/codegen_templates/api.test.d.ts.map +0 -1
- package/dist/cjs-types/cli/codegen_templates/common.test.d.ts +0 -2
- package/dist/cjs-types/cli/codegen_templates/common.test.d.ts.map +0 -1
- package/dist/cjs-types/cli/codegen_templates/templates.test.d.ts +0 -2
- package/dist/cjs-types/cli/codegen_templates/templates.test.d.ts.map +0 -1
- package/dist/cjs-types/cli/codegen_templates/validator_helpers.test.d.ts +0 -2
- package/dist/cjs-types/cli/codegen_templates/validator_helpers.test.d.ts.map +0 -1
- package/dist/cjs-types/cli/configure.test.d.ts +0 -2
- package/dist/cjs-types/cli/configure.test.d.ts.map +0 -1
- package/dist/cjs-types/cli/deploymentCreate.test.d.ts +0 -2
- package/dist/cjs-types/cli/deploymentCreate.test.d.ts.map +0 -1
- package/dist/cjs-types/cli/deploymentSelect.test.d.ts +0 -2
- package/dist/cjs-types/cli/deploymentSelect.test.d.ts.map +0 -1
- package/dist/cjs-types/cli/deploymentSelection.test.d.ts +0 -2
- package/dist/cjs-types/cli/deploymentSelection.test.d.ts.map +0 -1
- package/dist/cjs-types/cli/deploymentToken.test.d.ts +0 -2
- package/dist/cjs-types/cli/deploymentToken.test.d.ts.map +0 -1
- package/dist/cjs-types/cli/dev.test.d.ts +0 -2
- package/dist/cjs-types/cli/dev.test.d.ts.map +0 -1
- package/dist/cjs-types/cli/envDefault.test.d.ts +0 -2
- package/dist/cjs-types/cli/envDefault.test.d.ts.map +0 -1
- package/dist/cjs-types/cli/lib/aiFiles/agentsmd.test.d.ts +0 -2
- package/dist/cjs-types/cli/lib/aiFiles/agentsmd.test.d.ts.map +0 -1
- package/dist/cjs-types/cli/lib/aiFiles/claudemd.test.d.ts +0 -2
- package/dist/cjs-types/cli/lib/aiFiles/claudemd.test.d.ts.map +0 -1
- package/dist/cjs-types/cli/lib/aiFiles/guidelinesmd.test.d.ts +0 -2
- package/dist/cjs-types/cli/lib/aiFiles/guidelinesmd.test.d.ts.map +0 -1
- package/dist/cjs-types/cli/lib/aiFiles/index.test.d.ts +0 -2
- package/dist/cjs-types/cli/lib/aiFiles/index.test.d.ts.map +0 -1
- package/dist/cjs-types/cli/lib/aiFiles/integration.test.d.ts +0 -2
- package/dist/cjs-types/cli/lib/aiFiles/integration.test.d.ts.map +0 -1
- package/dist/cjs-types/cli/lib/aiFiles/prompt.test.d.ts +0 -2
- package/dist/cjs-types/cli/lib/aiFiles/prompt.test.d.ts.map +0 -1
- package/dist/cjs-types/cli/lib/aiFiles/state.test.d.ts +0 -2
- package/dist/cjs-types/cli/lib/aiFiles/state.test.d.ts.map +0 -1
- package/dist/cjs-types/cli/lib/aiFiles/utils.test.d.ts +0 -2
- package/dist/cjs-types/cli/lib/aiFiles/utils.test.d.ts.map +0 -1
- package/dist/cjs-types/cli/lib/codegen.test.d.ts +0 -2
- package/dist/cjs-types/cli/lib/codegen.test.d.ts.map +0 -1
- package/dist/cjs-types/cli/lib/components.test.d.ts +0 -2
- package/dist/cjs-types/cli/lib/components.test.d.ts.map +0 -1
- package/dist/cjs-types/cli/lib/config.test.d.ts +0 -2
- package/dist/cjs-types/cli/lib/config.test.d.ts.map +0 -1
- package/dist/cjs-types/cli/lib/deployment.test.d.ts +0 -2
- package/dist/cjs-types/cli/lib/deployment.test.d.ts.map +0 -1
- package/dist/cjs-types/cli/lib/deploymentSelector.test.d.ts +0 -2
- package/dist/cjs-types/cli/lib/deploymentSelector.test.d.ts.map +0 -1
- package/dist/cjs-types/cli/lib/env.test.d.ts +0 -2
- package/dist/cjs-types/cli/lib/env.test.d.ts.map +0 -1
- package/dist/cjs-types/cli/lib/expiration.test.d.ts +0 -2
- package/dist/cjs-types/cli/lib/expiration.test.d.ts.map +0 -1
- package/dist/cjs-types/cli/lib/extractDeploymentNameForWorkOS.test.d.ts +0 -2
- package/dist/cjs-types/cli/lib/extractDeploymentNameForWorkOS.test.d.ts.map +0 -1
- package/dist/cjs-types/cli/lib/formatEnvValueForDotfile.test.d.ts +0 -2
- package/dist/cjs-types/cli/lib/formatEnvValueForDotfile.test.d.ts.map +0 -1
- package/dist/cjs-types/cli/lib/formatTargetedDeployment.test.d.ts +0 -2
- package/dist/cjs-types/cli/lib/formatTargetedDeployment.test.d.ts.map +0 -1
- package/dist/cjs-types/cli/lib/fsUtils.test.d.ts +0 -2
- package/dist/cjs-types/cli/lib/fsUtils.test.d.ts.map +0 -1
- package/dist/cjs-types/cli/lib/generateDocs.test.d.ts +0 -2
- package/dist/cjs-types/cli/lib/generateDocs.test.d.ts.map +0 -1
- package/dist/cjs-types/cli/lib/indexes.test.d.ts +0 -2
- package/dist/cjs-types/cli/lib/indexes.test.d.ts.map +0 -1
- package/dist/cjs-types/cli/lib/localDeployment/run.test.d.ts +0 -2
- package/dist/cjs-types/cli/lib/localDeployment/run.test.d.ts.map +0 -1
- package/dist/cjs-types/cli/lib/localDeployment/secrets.test.d.ts +0 -2
- package/dist/cjs-types/cli/lib/localDeployment/secrets.test.d.ts.map +0 -1
- package/dist/cjs-types/cli/lib/run.test.d.ts +0 -2
- package/dist/cjs-types/cli/lib/run.test.d.ts.map +0 -1
- package/dist/cjs-types/cli/lib/runTestFunction.test.d.ts +0 -2
- package/dist/cjs-types/cli/lib/runTestFunction.test.d.ts.map +0 -1
- package/dist/cjs-types/cli/lib/typecheck.test.d.ts +0 -2
- package/dist/cjs-types/cli/lib/typecheck.test.d.ts.map +0 -1
- package/dist/cjs-types/cli/lib/updates.test.d.ts +0 -2
- package/dist/cjs-types/cli/lib/updates.test.d.ts.map +0 -1
- package/dist/cjs-types/cli/lib/utils/hash.test.d.ts +0 -2
- package/dist/cjs-types/cli/lib/utils/hash.test.d.ts.map +0 -1
- package/dist/cjs-types/cli/lib/utils/utils.test.d.ts +0 -2
- package/dist/cjs-types/cli/lib/utils/utils.test.d.ts.map +0 -1
- package/dist/cjs-types/cli/lib/versionApi.test.d.ts +0 -2
- package/dist/cjs-types/cli/lib/versionApi.test.d.ts.map +0 -1
- package/dist/cjs-types/cli/lib/workos/environmentApi.test.d.ts +0 -2
- package/dist/cjs-types/cli/lib/workos/environmentApi.test.d.ts.map +0 -1
- package/dist/cjs-types/cli/lib/workos/workos.test.d.ts +0 -2
- package/dist/cjs-types/cli/lib/workos/workos.test.d.ts.map +0 -1
- package/dist/cjs-types/common/index.test.d.ts +0 -2
- package/dist/cjs-types/common/index.test.d.ts.map +0 -1
- package/dist/cjs-types/nextjs/nextjs.test.d.ts +0 -2
- package/dist/cjs-types/nextjs/nextjs.test.d.ts.map +0 -1
- package/dist/cjs-types/react/ConvexAuthState.test.d.ts +0 -2
- package/dist/cjs-types/react/ConvexAuthState.test.d.ts.map +0 -1
- package/dist/cjs-types/react/auth_helpers.test.d.ts +0 -2
- package/dist/cjs-types/react/auth_helpers.test.d.ts.map +0 -1
- package/dist/cjs-types/react/auth_websocket.test.d.ts +0 -2
- package/dist/cjs-types/react/auth_websocket.test.d.ts.map +0 -1
- package/dist/cjs-types/react/client.test.d.ts +0 -2
- package/dist/cjs-types/react/client.test.d.ts.map +0 -1
- package/dist/cjs-types/react/client_provided_base_client.test.d.ts +0 -2
- package/dist/cjs-types/react/client_provided_base_client.test.d.ts.map +0 -1
- package/dist/cjs-types/react/queries_observer.test.d.ts +0 -2
- package/dist/cjs-types/react/queries_observer.test.d.ts.map +0 -1
- package/dist/cjs-types/react/react_node.test.d.ts +0 -2
- package/dist/cjs-types/react/react_node.test.d.ts.map +0 -1
- package/dist/cjs-types/react/use_paginated_query.test.d.ts +0 -2
- package/dist/cjs-types/react/use_paginated_query.test.d.ts.map +0 -1
- package/dist/cjs-types/react/use_queries.test.d.ts +0 -5
- package/dist/cjs-types/react/use_queries.test.d.ts.map +0 -1
- package/dist/cjs-types/react/use_query.test.d.ts +0 -5
- package/dist/cjs-types/react/use_query.test.d.ts.map +0 -1
- package/dist/cjs-types/react/use_query_object_options.test.d.ts +0 -5
- package/dist/cjs-types/react/use_query_object_options.test.d.ts.map +0 -1
- package/dist/cjs-types/react/use_query_result.test.d.ts +0 -5
- package/dist/cjs-types/react/use_query_result.test.d.ts.map +0 -1
- package/dist/cjs-types/react-auth0/ConvexProviderWithAuth0.test.d.ts +0 -2
- package/dist/cjs-types/react-auth0/ConvexProviderWithAuth0.test.d.ts.map +0 -1
- package/dist/cjs-types/react-clerk/ConvexProviderWithClerk.test.d.ts +0 -2
- package/dist/cjs-types/react-clerk/ConvexProviderWithClerk.test.d.ts.map +0 -1
- package/dist/cjs-types/server/api.intersect.test.d.ts +0 -2
- package/dist/cjs-types/server/api.intersect.test.d.ts.map +0 -1
- package/dist/cjs-types/server/api.test.d.ts +0 -2
- package/dist/cjs-types/server/api.test.d.ts.map +0 -1
- package/dist/cjs-types/server/audit_logging.test.d.ts +0 -2
- package/dist/cjs-types/server/audit_logging.test.d.ts.map +0 -1
- package/dist/cjs-types/server/components/index.test.d.ts +0 -2
- package/dist/cjs-types/server/components/index.test.d.ts.map +0 -1
- package/dist/cjs-types/server/cron.test.d.ts +0 -2
- package/dist/cjs-types/server/cron.test.d.ts.map +0 -1
- package/dist/cjs-types/server/data_model.test.d.ts +0 -2
- package/dist/cjs-types/server/data_model.test.d.ts.map +0 -1
- package/dist/cjs-types/server/database.test.d.ts +0 -2
- package/dist/cjs-types/server/database.test.d.ts.map +0 -1
- package/dist/cjs-types/server/database_api.test.d.ts +0 -2
- package/dist/cjs-types/server/database_api.test.d.ts.map +0 -1
- package/dist/cjs-types/server/filter_builder.test.d.ts +0 -2
- package/dist/cjs-types/server/filter_builder.test.d.ts.map +0 -1
- package/dist/cjs-types/server/impl/filter_builder_impl.test.d.ts +0 -2
- package/dist/cjs-types/server/impl/filter_builder_impl.test.d.ts.map +0 -1
- package/dist/cjs-types/server/impl/query_impl.test.d.ts +0 -2
- package/dist/cjs-types/server/impl/query_impl.test.d.ts.map +0 -1
- package/dist/cjs-types/server/pagination.test.d.ts +0 -2
- package/dist/cjs-types/server/pagination.test.d.ts.map +0 -1
- package/dist/cjs-types/server/query.test.d.ts +0 -2
- package/dist/cjs-types/server/query.test.d.ts.map +0 -1
- package/dist/cjs-types/server/registration.test.d.ts +0 -2
- package/dist/cjs-types/server/registration.test.d.ts.map +0 -1
- package/dist/cjs-types/server/router.test.d.ts +0 -2
- package/dist/cjs-types/server/router.test.d.ts.map +0 -1
- package/dist/cjs-types/server/scheduler.test.d.ts +0 -2
- package/dist/cjs-types/server/scheduler.test.d.ts.map +0 -1
- package/dist/cjs-types/server/schema.test.d.ts +0 -2
- package/dist/cjs-types/server/schema.test.d.ts.map +0 -1
- package/dist/cjs-types/test/fake_watch.d.ts +0 -16
- package/dist/cjs-types/test/fake_watch.d.ts.map +0 -1
- package/dist/cjs-types/test/type_testing.d.ts +0 -9
- package/dist/cjs-types/test/type_testing.d.ts.map +0 -1
- package/dist/cjs-types/type_utils.test.d.ts +0 -2
- package/dist/cjs-types/type_utils.test.d.ts.map +0 -1
- package/dist/cjs-types/values/size.test.d.ts +0 -2
- package/dist/cjs-types/values/size.test.d.ts.map +0 -1
- package/dist/cjs-types/values/validator.test.d.ts +0 -2
- package/dist/cjs-types/values/validator.test.d.ts.map +0 -1
- package/dist/cjs-types/values/value.test.d.ts +0 -2
- package/dist/cjs-types/values/value.test.d.ts.map +0 -1
- package/dist/esm-types/browser/http_client.test.d.ts +0 -2
- package/dist/esm-types/browser/http_client.test.d.ts.map +0 -1
- package/dist/esm-types/browser/query_options.test.d.ts +0 -2
- package/dist/esm-types/browser/query_options.test.d.ts.map +0 -1
- package/dist/esm-types/browser/simple_client.test.d.ts +0 -2
- package/dist/esm-types/browser/simple_client.test.d.ts.map +0 -1
- package/dist/esm-types/browser/sync/client.test.d.ts +0 -5
- package/dist/esm-types/browser/sync/client.test.d.ts.map +0 -1
- package/dist/esm-types/browser/sync/client_node.test.d.ts +0 -2
- package/dist/esm-types/browser/sync/client_node.test.d.ts.map +0 -1
- package/dist/esm-types/browser/sync/client_node_test_helpers.d.ts +0 -44
- package/dist/esm-types/browser/sync/client_node_test_helpers.d.ts.map +0 -1
- package/dist/esm-types/browser/sync/local_state.test.d.ts +0 -2
- package/dist/esm-types/browser/sync/local_state.test.d.ts.map +0 -1
- package/dist/esm-types/browser/sync/optimistic_query_set.test.d.ts +0 -2
- package/dist/esm-types/browser/sync/optimistic_query_set.test.d.ts.map +0 -1
- package/dist/esm-types/browser/sync/paginated_query_client.test.d.ts +0 -2
- package/dist/esm-types/browser/sync/paginated_query_client.test.d.ts.map +0 -1
- package/dist/esm-types/browser/sync/protocol.test.d.ts +0 -5
- package/dist/esm-types/browser/sync/protocol.test.d.ts.map +0 -1
- package/dist/esm-types/browser/sync/request_manager.test.d.ts +0 -2
- package/dist/esm-types/browser/sync/request_manager.test.d.ts.map +0 -1
- package/dist/esm-types/bundler/fs.test.d.ts +0 -2
- package/dist/esm-types/bundler/fs.test.d.ts.map +0 -1
- package/dist/esm-types/bundler/index.test.d.ts +0 -2
- package/dist/esm-types/bundler/index.test.d.ts.map +0 -1
- package/dist/esm-types/cli/codegen_templates/api.test.d.ts +0 -2
- package/dist/esm-types/cli/codegen_templates/api.test.d.ts.map +0 -1
- package/dist/esm-types/cli/codegen_templates/common.test.d.ts +0 -2
- package/dist/esm-types/cli/codegen_templates/common.test.d.ts.map +0 -1
- package/dist/esm-types/cli/codegen_templates/templates.test.d.ts +0 -2
- package/dist/esm-types/cli/codegen_templates/templates.test.d.ts.map +0 -1
- package/dist/esm-types/cli/codegen_templates/validator_helpers.test.d.ts +0 -2
- package/dist/esm-types/cli/codegen_templates/validator_helpers.test.d.ts.map +0 -1
- package/dist/esm-types/cli/configure.test.d.ts +0 -2
- package/dist/esm-types/cli/configure.test.d.ts.map +0 -1
- package/dist/esm-types/cli/deploymentCreate.test.d.ts +0 -2
- package/dist/esm-types/cli/deploymentCreate.test.d.ts.map +0 -1
- package/dist/esm-types/cli/deploymentSelect.test.d.ts +0 -2
- package/dist/esm-types/cli/deploymentSelect.test.d.ts.map +0 -1
- package/dist/esm-types/cli/deploymentSelection.test.d.ts +0 -2
- package/dist/esm-types/cli/deploymentSelection.test.d.ts.map +0 -1
- package/dist/esm-types/cli/deploymentToken.test.d.ts +0 -2
- package/dist/esm-types/cli/deploymentToken.test.d.ts.map +0 -1
- package/dist/esm-types/cli/dev.test.d.ts +0 -2
- package/dist/esm-types/cli/dev.test.d.ts.map +0 -1
- package/dist/esm-types/cli/envDefault.test.d.ts +0 -2
- package/dist/esm-types/cli/envDefault.test.d.ts.map +0 -1
- package/dist/esm-types/cli/lib/aiFiles/agentsmd.test.d.ts +0 -2
- package/dist/esm-types/cli/lib/aiFiles/agentsmd.test.d.ts.map +0 -1
- package/dist/esm-types/cli/lib/aiFiles/claudemd.test.d.ts +0 -2
- package/dist/esm-types/cli/lib/aiFiles/claudemd.test.d.ts.map +0 -1
- package/dist/esm-types/cli/lib/aiFiles/guidelinesmd.test.d.ts +0 -2
- package/dist/esm-types/cli/lib/aiFiles/guidelinesmd.test.d.ts.map +0 -1
- package/dist/esm-types/cli/lib/aiFiles/index.test.d.ts +0 -2
- package/dist/esm-types/cli/lib/aiFiles/index.test.d.ts.map +0 -1
- package/dist/esm-types/cli/lib/aiFiles/integration.test.d.ts +0 -2
- package/dist/esm-types/cli/lib/aiFiles/integration.test.d.ts.map +0 -1
- package/dist/esm-types/cli/lib/aiFiles/prompt.test.d.ts +0 -2
- package/dist/esm-types/cli/lib/aiFiles/prompt.test.d.ts.map +0 -1
- package/dist/esm-types/cli/lib/aiFiles/state.test.d.ts +0 -2
- package/dist/esm-types/cli/lib/aiFiles/state.test.d.ts.map +0 -1
- package/dist/esm-types/cli/lib/aiFiles/utils.test.d.ts +0 -2
- package/dist/esm-types/cli/lib/aiFiles/utils.test.d.ts.map +0 -1
- package/dist/esm-types/cli/lib/codegen.test.d.ts +0 -2
- package/dist/esm-types/cli/lib/codegen.test.d.ts.map +0 -1
- package/dist/esm-types/cli/lib/components.test.d.ts +0 -2
- package/dist/esm-types/cli/lib/components.test.d.ts.map +0 -1
- package/dist/esm-types/cli/lib/config.test.d.ts +0 -2
- package/dist/esm-types/cli/lib/config.test.d.ts.map +0 -1
- package/dist/esm-types/cli/lib/deployment.test.d.ts +0 -2
- package/dist/esm-types/cli/lib/deployment.test.d.ts.map +0 -1
- package/dist/esm-types/cli/lib/deploymentSelector.test.d.ts +0 -2
- package/dist/esm-types/cli/lib/deploymentSelector.test.d.ts.map +0 -1
- package/dist/esm-types/cli/lib/env.test.d.ts +0 -2
- package/dist/esm-types/cli/lib/env.test.d.ts.map +0 -1
- package/dist/esm-types/cli/lib/expiration.test.d.ts +0 -2
- package/dist/esm-types/cli/lib/expiration.test.d.ts.map +0 -1
- package/dist/esm-types/cli/lib/extractDeploymentNameForWorkOS.test.d.ts +0 -2
- package/dist/esm-types/cli/lib/extractDeploymentNameForWorkOS.test.d.ts.map +0 -1
- package/dist/esm-types/cli/lib/formatEnvValueForDotfile.test.d.ts +0 -2
- package/dist/esm-types/cli/lib/formatEnvValueForDotfile.test.d.ts.map +0 -1
- package/dist/esm-types/cli/lib/formatTargetedDeployment.test.d.ts +0 -2
- package/dist/esm-types/cli/lib/formatTargetedDeployment.test.d.ts.map +0 -1
- package/dist/esm-types/cli/lib/fsUtils.test.d.ts +0 -2
- package/dist/esm-types/cli/lib/fsUtils.test.d.ts.map +0 -1
- package/dist/esm-types/cli/lib/generateDocs.test.d.ts +0 -2
- package/dist/esm-types/cli/lib/generateDocs.test.d.ts.map +0 -1
- package/dist/esm-types/cli/lib/indexes.test.d.ts +0 -2
- package/dist/esm-types/cli/lib/indexes.test.d.ts.map +0 -1
- package/dist/esm-types/cli/lib/localDeployment/run.test.d.ts +0 -2
- package/dist/esm-types/cli/lib/localDeployment/run.test.d.ts.map +0 -1
- package/dist/esm-types/cli/lib/localDeployment/secrets.test.d.ts +0 -2
- package/dist/esm-types/cli/lib/localDeployment/secrets.test.d.ts.map +0 -1
- package/dist/esm-types/cli/lib/run.test.d.ts +0 -2
- package/dist/esm-types/cli/lib/run.test.d.ts.map +0 -1
- package/dist/esm-types/cli/lib/runTestFunction.test.d.ts +0 -2
- package/dist/esm-types/cli/lib/runTestFunction.test.d.ts.map +0 -1
- package/dist/esm-types/cli/lib/typecheck.test.d.ts +0 -2
- package/dist/esm-types/cli/lib/typecheck.test.d.ts.map +0 -1
- package/dist/esm-types/cli/lib/updates.test.d.ts +0 -2
- package/dist/esm-types/cli/lib/updates.test.d.ts.map +0 -1
- package/dist/esm-types/cli/lib/utils/hash.test.d.ts +0 -2
- package/dist/esm-types/cli/lib/utils/hash.test.d.ts.map +0 -1
- package/dist/esm-types/cli/lib/utils/utils.test.d.ts +0 -2
- package/dist/esm-types/cli/lib/utils/utils.test.d.ts.map +0 -1
- package/dist/esm-types/cli/lib/versionApi.test.d.ts +0 -2
- package/dist/esm-types/cli/lib/versionApi.test.d.ts.map +0 -1
- package/dist/esm-types/cli/lib/workos/environmentApi.test.d.ts +0 -2
- package/dist/esm-types/cli/lib/workos/environmentApi.test.d.ts.map +0 -1
- package/dist/esm-types/cli/lib/workos/workos.test.d.ts +0 -2
- package/dist/esm-types/cli/lib/workos/workos.test.d.ts.map +0 -1
- package/dist/esm-types/common/index.test.d.ts +0 -2
- package/dist/esm-types/common/index.test.d.ts.map +0 -1
- package/dist/esm-types/nextjs/nextjs.test.d.ts +0 -2
- package/dist/esm-types/nextjs/nextjs.test.d.ts.map +0 -1
- package/dist/esm-types/react/ConvexAuthState.test.d.ts +0 -2
- package/dist/esm-types/react/ConvexAuthState.test.d.ts.map +0 -1
- package/dist/esm-types/react/auth_helpers.test.d.ts +0 -2
- package/dist/esm-types/react/auth_helpers.test.d.ts.map +0 -1
- package/dist/esm-types/react/auth_websocket.test.d.ts +0 -2
- package/dist/esm-types/react/auth_websocket.test.d.ts.map +0 -1
- package/dist/esm-types/react/client.test.d.ts +0 -2
- package/dist/esm-types/react/client.test.d.ts.map +0 -1
- package/dist/esm-types/react/client_provided_base_client.test.d.ts +0 -2
- package/dist/esm-types/react/client_provided_base_client.test.d.ts.map +0 -1
- package/dist/esm-types/react/queries_observer.test.d.ts +0 -2
- package/dist/esm-types/react/queries_observer.test.d.ts.map +0 -1
- package/dist/esm-types/react/react_node.test.d.ts +0 -2
- package/dist/esm-types/react/react_node.test.d.ts.map +0 -1
- package/dist/esm-types/react/use_paginated_query.test.d.ts +0 -2
- package/dist/esm-types/react/use_paginated_query.test.d.ts.map +0 -1
- package/dist/esm-types/react/use_queries.test.d.ts +0 -5
- package/dist/esm-types/react/use_queries.test.d.ts.map +0 -1
- package/dist/esm-types/react/use_query.test.d.ts +0 -5
- package/dist/esm-types/react/use_query.test.d.ts.map +0 -1
- package/dist/esm-types/react/use_query_object_options.test.d.ts +0 -5
- package/dist/esm-types/react/use_query_object_options.test.d.ts.map +0 -1
- package/dist/esm-types/react/use_query_result.test.d.ts +0 -5
- package/dist/esm-types/react/use_query_result.test.d.ts.map +0 -1
- package/dist/esm-types/react-auth0/ConvexProviderWithAuth0.test.d.ts +0 -2
- package/dist/esm-types/react-auth0/ConvexProviderWithAuth0.test.d.ts.map +0 -1
- package/dist/esm-types/react-clerk/ConvexProviderWithClerk.test.d.ts +0 -2
- package/dist/esm-types/react-clerk/ConvexProviderWithClerk.test.d.ts.map +0 -1
- package/dist/esm-types/server/api.intersect.test.d.ts +0 -2
- package/dist/esm-types/server/api.intersect.test.d.ts.map +0 -1
- package/dist/esm-types/server/api.test.d.ts +0 -2
- package/dist/esm-types/server/api.test.d.ts.map +0 -1
- package/dist/esm-types/server/audit_logging.test.d.ts +0 -2
- package/dist/esm-types/server/audit_logging.test.d.ts.map +0 -1
- package/dist/esm-types/server/components/index.test.d.ts +0 -2
- package/dist/esm-types/server/components/index.test.d.ts.map +0 -1
- package/dist/esm-types/server/cron.test.d.ts +0 -2
- package/dist/esm-types/server/cron.test.d.ts.map +0 -1
- package/dist/esm-types/server/data_model.test.d.ts +0 -2
- package/dist/esm-types/server/data_model.test.d.ts.map +0 -1
- package/dist/esm-types/server/database.test.d.ts +0 -2
- package/dist/esm-types/server/database.test.d.ts.map +0 -1
- package/dist/esm-types/server/database_api.test.d.ts +0 -2
- package/dist/esm-types/server/database_api.test.d.ts.map +0 -1
- package/dist/esm-types/server/filter_builder.test.d.ts +0 -2
- package/dist/esm-types/server/filter_builder.test.d.ts.map +0 -1
- package/dist/esm-types/server/impl/filter_builder_impl.test.d.ts +0 -2
- package/dist/esm-types/server/impl/filter_builder_impl.test.d.ts.map +0 -1
- package/dist/esm-types/server/impl/query_impl.test.d.ts +0 -2
- package/dist/esm-types/server/impl/query_impl.test.d.ts.map +0 -1
- package/dist/esm-types/server/pagination.test.d.ts +0 -2
- package/dist/esm-types/server/pagination.test.d.ts.map +0 -1
- package/dist/esm-types/server/query.test.d.ts +0 -2
- package/dist/esm-types/server/query.test.d.ts.map +0 -1
- package/dist/esm-types/server/registration.test.d.ts +0 -2
- package/dist/esm-types/server/registration.test.d.ts.map +0 -1
- package/dist/esm-types/server/router.test.d.ts +0 -2
- package/dist/esm-types/server/router.test.d.ts.map +0 -1
- package/dist/esm-types/server/scheduler.test.d.ts +0 -2
- package/dist/esm-types/server/scheduler.test.d.ts.map +0 -1
- package/dist/esm-types/server/schema.test.d.ts +0 -2
- package/dist/esm-types/server/schema.test.d.ts.map +0 -1
- package/dist/esm-types/test/fake_watch.d.ts +0 -16
- package/dist/esm-types/test/fake_watch.d.ts.map +0 -1
- package/dist/esm-types/test/type_testing.d.ts +0 -9
- package/dist/esm-types/test/type_testing.d.ts.map +0 -1
- package/dist/esm-types/type_utils.test.d.ts +0 -2
- package/dist/esm-types/type_utils.test.d.ts.map +0 -1
- package/dist/esm-types/values/size.test.d.ts +0 -2
- package/dist/esm-types/values/size.test.d.ts.map +0 -1
- package/dist/esm-types/values/validator.test.d.ts +0 -2
- package/dist/esm-types/values/validator.test.d.ts.map +0 -1
- package/dist/esm-types/values/value.test.d.ts +0 -2
- package/dist/esm-types/values/value.test.d.ts.map +0 -1
- package/src/browser/http_client.test.ts +0 -202
- package/src/browser/query_options.test.ts +0 -43
- package/src/browser/simple_client.test.ts +0 -104
- package/src/browser/sync/client.test.ts +0 -44
- package/src/browser/sync/client_node.test.ts +0 -1207
- package/src/browser/sync/client_node_test_helpers.ts +0 -200
- package/src/browser/sync/local_state.test.ts +0 -128
- package/src/browser/sync/optimistic_query_set.test.ts +0 -253
- package/src/browser/sync/paginated_query_client.test.ts +0 -597
- package/src/browser/sync/protocol.test.ts +0 -14
- package/src/browser/sync/request_manager.test.ts +0 -273
- package/src/bundler/fs.test.ts +0 -86
- package/src/bundler/index.test.ts +0 -210
- package/src/bundler/test_fixtures/js/project01/bar.js +0 -4
- package/src/bundler/test_fixtures/js/project01/file with spaces.js +0 -1
- package/src/bundler/test_fixtures/js/project01/foo.js +0 -9
- package/src/bundler/test_fixtures/js/project_with_https/https.js +0 -9
- package/src/bundler/test_fixtures/js/project_with_https_not_at_top_level/default.js +0 -3
- package/src/bundler/test_fixtures/js/project_with_https_not_at_top_level/more_code/https.js +0 -5
- package/src/bundler/test_fixtures/js/project_with_https_without_router/https.js +0 -1
- package/src/bundler/test_fixtures/js/project_with_node_shims/uses_node_shims.js +0 -4
- package/src/cli/codegen_templates/api.test.ts +0 -18
- package/src/cli/codegen_templates/common.test.ts +0 -52
- package/src/cli/codegen_templates/templates.test.ts +0 -16
- package/src/cli/codegen_templates/validator_helpers.test.ts +0 -31
- package/src/cli/configure.test.ts +0 -138
- package/src/cli/deploymentCreate.test.ts +0 -1376
- package/src/cli/deploymentSelect.test.ts +0 -1291
- package/src/cli/deploymentSelection.test.ts +0 -2546
- package/src/cli/deploymentToken.test.ts +0 -397
- package/src/cli/dev.test.ts +0 -157
- package/src/cli/envDefault.test.ts +0 -495
- package/src/cli/lib/__snapshots__/formatTargetedDeployment.test.ts.snap +0 -94
- package/src/cli/lib/aiFiles/agentsmd.test.ts +0 -133
- package/src/cli/lib/aiFiles/claudemd.test.ts +0 -92
- package/src/cli/lib/aiFiles/guidelinesmd.test.ts +0 -50
- package/src/cli/lib/aiFiles/index.test.ts +0 -986
- package/src/cli/lib/aiFiles/integration.test.ts +0 -692
- package/src/cli/lib/aiFiles/prompt.test.ts +0 -202
- package/src/cli/lib/aiFiles/state.test.ts +0 -305
- package/src/cli/lib/aiFiles/utils.test.ts +0 -50
- package/src/cli/lib/codegen.test.ts +0 -49
- package/src/cli/lib/components.test.ts +0 -227
- package/src/cli/lib/config.test.ts +0 -1026
- package/src/cli/lib/deployment.test.ts +0 -85
- package/src/cli/lib/deploymentSelector.test.ts +0 -107
- package/src/cli/lib/env.test.ts +0 -60
- package/src/cli/lib/expiration.test.ts +0 -159
- package/src/cli/lib/extractDeploymentNameForWorkOS.test.ts +0 -30
- package/src/cli/lib/formatEnvValueForDotfile.test.ts +0 -294
- package/src/cli/lib/formatTargetedDeployment.test.ts +0 -281
- package/src/cli/lib/fsUtils.test.ts +0 -67
- package/src/cli/lib/generateDocs.test.ts +0 -326
- package/src/cli/lib/indexes.test.ts +0 -77
- package/src/cli/lib/localDeployment/run.test.ts +0 -104
- package/src/cli/lib/localDeployment/secrets.test.ts +0 -53
- package/src/cli/lib/run.test.ts +0 -54
- package/src/cli/lib/runTestFunction.test.ts +0 -84
- package/src/cli/lib/typecheck.test.ts +0 -71
- package/src/cli/lib/updates.test.ts +0 -157
- package/src/cli/lib/utils/hash.test.ts +0 -25
- package/src/cli/lib/utils/utils.test.ts +0 -340
- package/src/cli/lib/versionApi.test.ts +0 -471
- package/src/cli/lib/workos/environmentApi.test.ts +0 -107
- package/src/cli/lib/workos/workos.test.ts +0 -242
- package/src/common/README.md +0 -2
- package/src/common/index.test.ts +0 -35
- package/src/nextjs/nextjs.test.tsx +0 -94
- package/src/react/ConvexAuthState.test.tsx +0 -702
- package/src/react/auth_helpers.test.tsx +0 -45
- package/src/react/auth_websocket.test.tsx +0 -1177
- package/src/react/client.test.tsx +0 -261
- package/src/react/client_provided_base_client.test.tsx +0 -174
- package/src/react/queries_observer.test.ts +0 -176
- package/src/react/react_node.test.ts +0 -78
- package/src/react/use_paginated_query.test.tsx +0 -1420
- package/src/react/use_queries.test.ts +0 -140
- package/src/react/use_query.test.ts +0 -71
- package/src/react/use_query_object_options.test.ts +0 -51
- package/src/react/use_query_result.test.ts +0 -75
- package/src/react-auth0/ConvexProviderWithAuth0.test.tsx +0 -17
- package/src/react-clerk/ConvexProviderWithClerk.test.tsx +0 -18
- package/src/server/README.md +0 -15
- package/src/server/api.intersect.test.ts +0 -109
- package/src/server/api.test.ts +0 -447
- package/src/server/audit_logging.test.ts +0 -131
- package/src/server/components/index.test.ts +0 -48
- package/src/server/cron.test.ts +0 -58
- package/src/server/data_model.test.ts +0 -221
- package/src/server/database.test.ts +0 -184
- package/src/server/database_api.test.ts +0 -439
- package/src/server/filter_builder.test.ts +0 -102
- package/src/server/impl/filter_builder_impl.test.ts +0 -13
- package/src/server/impl/query_impl.test.ts +0 -46
- package/src/server/pagination.test.ts +0 -49
- package/src/server/query.test.ts +0 -112
- package/src/server/registration.test.ts +0 -589
- package/src/server/router.test.ts +0 -148
- package/src/server/scheduler.test.ts +0 -31
- package/src/server/schema.test.ts +0 -983
- package/src/test/fake_watch.ts +0 -54
- package/src/test/type_testing.ts +0 -21
- package/src/type_utils.test.ts +0 -62
- package/src/values/size.test.ts +0 -95
- package/src/values/validator.test.ts +0 -619
- package/src/values/value.test.ts +0 -232
- package/src/vendor/README.md +0 -18
- 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
|
|
28
|
-
const
|
|
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 =
|
|
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 {
|
|
5
|
-
"mappings": ";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,oBAAuB;AACvB,
|
|
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
|
|
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
|
|
35
|
-
const
|
|
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
|
-
` :
|
|
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 =
|
|
45
|
-
` :
|
|
46
|
-
export const env: 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
|
-
` :
|
|
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": ";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,oBAAuB;AACvB,+BAAgD;
|
|
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": ";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,oBAAuB;AACvB,+BAAgD;AAUhD,MAAM,oBAAkC;AAAA,EACtC,CAAC,oBAAoB,EAAE,MAAM,SAAS,OAAO,oBAAoB,CAAC;AAAA,EAClE,CAAC,mBAAmB,EAAE,MAAM,SAAS,OAAO,oBAAoB,CAAC;AACnE;AAKO,SAAS,oBAAoB,SAAqC;AACvE,SAAO,CAAC,GAAG,mBAAmB,GAAG,OAAO;AAC1C;AAEA,MAAM,gBAAgB;AAAA;AAAA;AAAA;AAAA;AAAA;AAOf,SAAS,cAAc;AAAA,EAC5B;AAAA,EACA;AACF,GAQG;AACD,QAAM,iBACJ,YAAY,SAAY,SAAY,oBAAoB,OAAO;AACjE,QAAM,SAAS,mBAAmB;AAClC,QAAM,eAAe,SAAS,qBAAqB,cAAe,IAAI;AACtE,QAAM,aAAa,SACf;AAAA,EACJ,aAAa;AAAA;AAAA,IAGT;AAAA;AAAA;AAKJ,QAAM,YAAY,SACd;AAAA,EACJ,aAAa;AAAA;AAAA,IAGT;AAAA;AAAA;AAGJ,QAAM,YAAY,SACd;AAAA,EACJ,aAAa;AAAA;AAAA,IAGT;AAAA;AAAA;AAIJ,MAAI,CAAC,eAAe;AAElB,UAAM,YAAY;AAAA,UAChB;AAAA,MACA;AAAA,IACF,CAAC;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,MAaC,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,EA2EhB,UAAU;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;AAgDR,UAAM,WAAW;AAAA,UACf;AAAA,MACA;AAAA,IACF,CAAC;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;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAoFH,SAAS;AAAA;AAGP,WAAO;AAAA,MACL,KAAK;AAAA,MACL,IAAI;AAAA,IACN;AAAA,EACF,OAAO;AAEL,UAAM,WAAW,OAAG;AAAA,MAClB;AAAA,IACF,CAAC;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAsBH,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,EA2EZ,SAAS;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;AAgDP,WAAO;AAAA,MACL,IAAI;AAAA,IACN;AAAA,EACF;AACF;AAEO,SAAS,qBAAqB,SAA+B;AAClE,QAAM,QAAkB,CAAC;AACzB,aAAW,CAAC,MAAM,IAAI,KAAK,SAAS;AAClC,UAAM,aAAS,yCAAe,KAAK,KAAK;AACxC,QAAI,SAAS,aAAS,0CAAgB,QAAQ,KAAK,IAAI;AACvD,QAAI,KAAK,UAAU;AACjB,gBAAU;AAAA,IACZ;AACA,UAAM,KAAK,cAAc,IAAI,KAAK,MAAM,GAAG;AAAA,EAC7C;AACA,SAAO;AAAA,EACP,aAAa;AAAA;AAAA,EAEb,MAAM,KAAK,IAAI,CAAC;AAAA;AAElB;",
|
|
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/
|
|
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/
|
|
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
|
}
|
package/dist/cjs/cli/index.js
CHANGED
|
@@ -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 =
|
|
34
|
-
const HARD_MINIMUM_NODE_MINOR_VERSION =
|
|
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 =
|
|
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;
|
|
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
|
}
|
package/dist/cjs/cli/lib/api.js
CHANGED
|
@@ -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.
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
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")) {
|