convex 1.40.0 → 1.41.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 +11 -0
- package/dist/browser.bundle.js +1 -1
- package/dist/browser.bundle.js.map +1 -1
- package/dist/cjs/cli/aiFiles.js +2 -2
- package/dist/cjs/cli/aiFiles.js.map +1 -1
- package/dist/cjs/cli/configure.js +1 -4
- package/dist/cjs/cli/configure.js.map +2 -2
- package/dist/cjs/cli/convexExport.js +3 -3
- package/dist/cjs/cli/convexExport.js.map +1 -1
- package/dist/cjs/cli/convexImport.js +2 -2
- package/dist/cjs/cli/convexImport.js.map +1 -1
- package/dist/cjs/cli/dashboard.js +19 -6
- package/dist/cjs/cli/dashboard.js.map +3 -3
- package/dist/cjs/cli/data.js +2 -2
- package/dist/cjs/cli/data.js.map +1 -1
- package/dist/cjs/cli/deploy.js +5 -5
- package/dist/cjs/cli/deploy.js.map +2 -2
- package/dist/cjs/cli/deploymentCreate.js +11 -5
- package/dist/cjs/cli/deploymentCreate.js.map +2 -2
- package/dist/cjs/cli/deploymentSelect.js +5 -5
- package/dist/cjs/cli/deploymentSelect.js.map +1 -1
- package/dist/cjs/cli/deploymentTokenCreate.js +5 -13
- package/dist/cjs/cli/deploymentTokenCreate.js.map +2 -2
- package/dist/cjs/cli/deploymentTokenDelete.js +4 -11
- package/dist/cjs/cli/deploymentTokenDelete.js.map +2 -2
- package/dist/cjs/cli/dev.js +6 -5
- package/dist/cjs/cli/dev.js.map +2 -2
- package/dist/cjs/cli/env.js +16 -16
- package/dist/cjs/cli/env.js.map +2 -2
- package/dist/cjs/cli/envDefault.js +10 -10
- package/dist/cjs/cli/envDefault.js.map +1 -1
- package/dist/cjs/cli/insights.js +3 -3
- package/dist/cjs/cli/insights.js.map +1 -1
- package/dist/cjs/cli/lib/aiFiles/skills.js +2 -2
- package/dist/cjs/cli/lib/aiFiles/skills.js.map +2 -2
- package/dist/cjs/cli/lib/command.js +1 -1
- package/dist/cjs/cli/lib/command.js.map +1 -1
- package/dist/cjs/cli/lib/deployment.js.map +1 -1
- package/dist/cjs/cli/lib/deploymentSelection.js +39 -0
- package/dist/cjs/cli/lib/deploymentSelection.js.map +2 -2
- package/dist/cjs/cli/lib/dev.js +31 -0
- package/dist/cjs/cli/lib/dev.js.map +2 -2
- package/dist/cjs/cli/lib/generateDocs.js +256 -0
- package/dist/cjs/cli/lib/generateDocs.js.map +7 -0
- package/dist/cjs/cli/lib/localDeployment/anonymous.js +24 -49
- package/dist/cjs/cli/lib/localDeployment/anonymous.js.map +3 -3
- package/dist/cjs/cli/lib/localDeployment/bigBrain.js +0 -9
- package/dist/cjs/cli/lib/localDeployment/bigBrain.js.map +2 -2
- package/dist/cjs/cli/lib/localDeployment/dashboard.js +30 -68
- package/dist/cjs/cli/lib/localDeployment/dashboard.js.map +2 -2
- package/dist/cjs/cli/lib/localDeployment/download.js +14 -1
- package/dist/cjs/cli/lib/localDeployment/download.js.map +2 -2
- package/dist/cjs/cli/lib/localDeployment/filePaths.js +33 -4
- package/dist/cjs/cli/lib/localDeployment/filePaths.js.map +2 -2
- package/dist/cjs/cli/lib/localDeployment/localDeployment.js +37 -126
- package/dist/cjs/cli/lib/localDeployment/localDeployment.js.map +3 -3
- package/dist/cjs/cli/lib/localDeployment/secrets.js +91 -0
- package/dist/cjs/cli/lib/localDeployment/secrets.js.map +7 -0
- package/dist/cjs/cli/lib/localDeployment/upgrade.js +43 -28
- package/dist/cjs/cli/lib/localDeployment/upgrade.js.map +3 -3
- package/dist/cjs/cli/lib/localDeployment/utils.js +0 -19
- package/dist/cjs/cli/lib/localDeployment/utils.js.map +3 -3
- package/dist/cjs/cli/lib/runTestFunction.js +3 -3
- package/dist/cjs/cli/lib/runTestFunction.js.map +1 -1
- package/dist/cjs/cli/run.js +5 -5
- package/dist/cjs/cli/run.js.map +1 -1
- package/dist/cjs/index.js +1 -1
- package/dist/cjs/index.js.map +1 -1
- package/dist/cjs/server/impl/registration_impl.js +0 -1
- package/dist/cjs/server/impl/registration_impl.js.map +2 -2
- package/dist/cjs/server/index.js.map +2 -2
- package/dist/cjs/server/meta.js.map +1 -1
- package/dist/cjs/server/registration.js.map +1 -1
- package/dist/cjs-types/cli/configure.d.ts +3 -2
- package/dist/cjs-types/cli/configure.d.ts.map +1 -1
- package/dist/cjs-types/cli/dashboard.d.ts.map +1 -1
- package/dist/cjs-types/cli/deploymentCreate.d.ts.map +1 -1
- package/dist/cjs-types/cli/deploymentTokenCreate.d.ts.map +1 -1
- package/dist/cjs-types/cli/deploymentTokenDelete.d.ts.map +1 -1
- package/dist/cjs-types/cli/dev.d.ts.map +1 -1
- package/dist/cjs-types/cli/lib/deployApi/definitionConfig.d.ts +4 -4
- package/dist/cjs-types/cli/lib/deployApi/startPush.d.ts +16 -16
- package/dist/cjs-types/cli/lib/deployment.d.ts +0 -2
- package/dist/cjs-types/cli/lib/deployment.d.ts.map +1 -1
- package/dist/cjs-types/cli/lib/deploymentSelection.d.ts +7 -0
- package/dist/cjs-types/cli/lib/deploymentSelection.d.ts.map +1 -1
- package/dist/cjs-types/cli/lib/dev.d.ts +2 -1
- package/dist/cjs-types/cli/lib/dev.d.ts.map +1 -1
- package/dist/cjs-types/cli/lib/generateDocs.d.ts +20 -0
- package/dist/cjs-types/cli/lib/generateDocs.d.ts.map +1 -0
- package/dist/cjs-types/cli/lib/generateDocs.test.d.ts +2 -0
- package/dist/cjs-types/cli/lib/generateDocs.test.d.ts.map +1 -0
- package/dist/cjs-types/cli/lib/localDeployment/anonymous.d.ts +1 -1
- package/dist/cjs-types/cli/lib/localDeployment/anonymous.d.ts.map +1 -1
- package/dist/cjs-types/cli/lib/localDeployment/bigBrain.d.ts +2 -4
- package/dist/cjs-types/cli/lib/localDeployment/bigBrain.d.ts.map +1 -1
- package/dist/cjs-types/cli/lib/localDeployment/dashboard.d.ts +9 -4
- package/dist/cjs-types/cli/lib/localDeployment/dashboard.d.ts.map +1 -1
- package/dist/cjs-types/cli/lib/localDeployment/download.d.ts +11 -1
- package/dist/cjs-types/cli/lib/localDeployment/download.d.ts.map +1 -1
- package/dist/cjs-types/cli/lib/localDeployment/filePaths.d.ts +16 -5
- package/dist/cjs-types/cli/lib/localDeployment/filePaths.d.ts.map +1 -1
- package/dist/cjs-types/cli/lib/localDeployment/localDeployment.d.ts +1 -9
- package/dist/cjs-types/cli/lib/localDeployment/localDeployment.d.ts.map +1 -1
- package/dist/cjs-types/cli/lib/localDeployment/secrets.d.ts +31 -0
- package/dist/cjs-types/cli/lib/localDeployment/secrets.d.ts.map +1 -0
- package/dist/cjs-types/cli/lib/localDeployment/secrets.test.d.ts +2 -0
- package/dist/cjs-types/cli/lib/localDeployment/secrets.test.d.ts.map +1 -0
- package/dist/cjs-types/cli/lib/localDeployment/upgrade.d.ts +6 -3
- package/dist/cjs-types/cli/lib/localDeployment/upgrade.d.ts.map +1 -1
- package/dist/cjs-types/cli/lib/localDeployment/utils.d.ts +0 -2
- package/dist/cjs-types/cli/lib/localDeployment/utils.d.ts.map +1 -1
- package/dist/cjs-types/cli/lib/versionApi.d.ts +2 -2
- package/dist/cjs-types/index.d.ts +1 -1
- package/dist/cjs-types/server/impl/registration_impl.d.ts.map +1 -1
- package/dist/cjs-types/server/index.d.ts +1 -1
- package/dist/cjs-types/server/index.d.ts.map +1 -1
- package/dist/cjs-types/server/meta.d.ts +16 -0
- package/dist/cjs-types/server/meta.d.ts.map +1 -1
- package/dist/cjs-types/server/registration.d.ts +11 -5
- package/dist/cjs-types/server/registration.d.ts.map +1 -1
- package/dist/cli.bundle.cjs +66405 -67923
- package/dist/cli.bundle.cjs.map +4 -4
- package/dist/esm/cli/aiFiles.js +2 -2
- package/dist/esm/cli/aiFiles.js.map +1 -1
- package/dist/esm/cli/configure.js +1 -4
- package/dist/esm/cli/configure.js.map +2 -2
- package/dist/esm/cli/convexExport.js +3 -3
- package/dist/esm/cli/convexExport.js.map +1 -1
- package/dist/esm/cli/convexImport.js +2 -2
- package/dist/esm/cli/convexImport.js.map +1 -1
- package/dist/esm/cli/dashboard.js +16 -3
- package/dist/esm/cli/dashboard.js.map +2 -2
- package/dist/esm/cli/data.js +2 -2
- package/dist/esm/cli/data.js.map +1 -1
- package/dist/esm/cli/deploy.js +5 -5
- package/dist/esm/cli/deploy.js.map +2 -2
- package/dist/esm/cli/deploymentCreate.js +13 -9
- package/dist/esm/cli/deploymentCreate.js.map +2 -2
- package/dist/esm/cli/deploymentSelect.js +5 -5
- package/dist/esm/cli/deploymentSelect.js.map +1 -1
- package/dist/esm/cli/deploymentTokenCreate.js +9 -15
- package/dist/esm/cli/deploymentTokenCreate.js.map +2 -2
- package/dist/esm/cli/deploymentTokenDelete.js +8 -16
- package/dist/esm/cli/deploymentTokenDelete.js.map +2 -2
- package/dist/esm/cli/dev.js +6 -5
- package/dist/esm/cli/dev.js.map +2 -2
- package/dist/esm/cli/env.js +16 -16
- package/dist/esm/cli/env.js.map +2 -2
- package/dist/esm/cli/envDefault.js +10 -10
- package/dist/esm/cli/envDefault.js.map +1 -1
- package/dist/esm/cli/insights.js +3 -3
- package/dist/esm/cli/insights.js.map +1 -1
- package/dist/esm/cli/lib/aiFiles/skills.js +2 -2
- package/dist/esm/cli/lib/aiFiles/skills.js.map +2 -2
- package/dist/esm/cli/lib/command.js +1 -1
- package/dist/esm/cli/lib/command.js.map +1 -1
- package/dist/esm/cli/lib/deployment.js.map +1 -1
- package/dist/esm/cli/lib/deploymentSelection.js +38 -0
- package/dist/esm/cli/lib/deploymentSelection.js.map +2 -2
- package/dist/esm/cli/lib/dev.js +31 -0
- package/dist/esm/cli/lib/dev.js.map +2 -2
- package/dist/esm/cli/lib/generateDocs.js +233 -0
- package/dist/esm/cli/lib/generateDocs.js.map +7 -0
- package/dist/esm/cli/lib/localDeployment/anonymous.js +30 -61
- package/dist/esm/cli/lib/localDeployment/anonymous.js.map +3 -3
- package/dist/esm/cli/lib/localDeployment/bigBrain.js +0 -8
- package/dist/esm/cli/lib/localDeployment/bigBrain.js.map +2 -2
- package/dist/esm/cli/lib/localDeployment/dashboard.js +36 -69
- package/dist/esm/cli/lib/localDeployment/dashboard.js.map +2 -2
- package/dist/esm/cli/lib/localDeployment/download.js +15 -2
- package/dist/esm/cli/lib/localDeployment/download.js.map +2 -2
- package/dist/esm/cli/lib/localDeployment/filePaths.js +29 -2
- package/dist/esm/cli/lib/localDeployment/filePaths.js.map +2 -2
- package/dist/esm/cli/lib/localDeployment/localDeployment.js +40 -134
- package/dist/esm/cli/lib/localDeployment/localDeployment.js.map +3 -3
- package/dist/esm/cli/lib/localDeployment/secrets.js +57 -0
- package/dist/esm/cli/lib/localDeployment/secrets.js.map +7 -0
- package/dist/esm/cli/lib/localDeployment/upgrade.js +45 -28
- package/dist/esm/cli/lib/localDeployment/upgrade.js.map +3 -3
- package/dist/esm/cli/lib/localDeployment/utils.js +0 -7
- package/dist/esm/cli/lib/localDeployment/utils.js.map +2 -2
- package/dist/esm/cli/lib/runTestFunction.js +3 -3
- package/dist/esm/cli/lib/runTestFunction.js.map +1 -1
- package/dist/esm/cli/run.js +5 -5
- package/dist/esm/cli/run.js.map +1 -1
- package/dist/esm/index.js +1 -1
- package/dist/esm/index.js.map +1 -1
- package/dist/esm/server/impl/registration_impl.js +0 -1
- package/dist/esm/server/impl/registration_impl.js.map +2 -2
- package/dist/esm/server/index.js.map +2 -2
- package/dist/esm-types/cli/configure.d.ts +3 -2
- package/dist/esm-types/cli/configure.d.ts.map +1 -1
- package/dist/esm-types/cli/dashboard.d.ts.map +1 -1
- package/dist/esm-types/cli/deploymentCreate.d.ts.map +1 -1
- package/dist/esm-types/cli/deploymentTokenCreate.d.ts.map +1 -1
- package/dist/esm-types/cli/deploymentTokenDelete.d.ts.map +1 -1
- package/dist/esm-types/cli/dev.d.ts.map +1 -1
- package/dist/esm-types/cli/lib/deployApi/definitionConfig.d.ts +4 -4
- package/dist/esm-types/cli/lib/deployApi/startPush.d.ts +16 -16
- package/dist/esm-types/cli/lib/deployment.d.ts +0 -2
- package/dist/esm-types/cli/lib/deployment.d.ts.map +1 -1
- package/dist/esm-types/cli/lib/deploymentSelection.d.ts +7 -0
- package/dist/esm-types/cli/lib/deploymentSelection.d.ts.map +1 -1
- package/dist/esm-types/cli/lib/dev.d.ts +2 -1
- package/dist/esm-types/cli/lib/dev.d.ts.map +1 -1
- package/dist/esm-types/cli/lib/generateDocs.d.ts +20 -0
- package/dist/esm-types/cli/lib/generateDocs.d.ts.map +1 -0
- package/dist/esm-types/cli/lib/generateDocs.test.d.ts +2 -0
- package/dist/esm-types/cli/lib/generateDocs.test.d.ts.map +1 -0
- package/dist/esm-types/cli/lib/localDeployment/anonymous.d.ts +1 -1
- package/dist/esm-types/cli/lib/localDeployment/anonymous.d.ts.map +1 -1
- package/dist/esm-types/cli/lib/localDeployment/bigBrain.d.ts +2 -4
- package/dist/esm-types/cli/lib/localDeployment/bigBrain.d.ts.map +1 -1
- package/dist/esm-types/cli/lib/localDeployment/dashboard.d.ts +9 -4
- package/dist/esm-types/cli/lib/localDeployment/dashboard.d.ts.map +1 -1
- package/dist/esm-types/cli/lib/localDeployment/download.d.ts +11 -1
- package/dist/esm-types/cli/lib/localDeployment/download.d.ts.map +1 -1
- package/dist/esm-types/cli/lib/localDeployment/filePaths.d.ts +16 -5
- package/dist/esm-types/cli/lib/localDeployment/filePaths.d.ts.map +1 -1
- package/dist/esm-types/cli/lib/localDeployment/localDeployment.d.ts +1 -9
- package/dist/esm-types/cli/lib/localDeployment/localDeployment.d.ts.map +1 -1
- package/dist/esm-types/cli/lib/localDeployment/secrets.d.ts +31 -0
- package/dist/esm-types/cli/lib/localDeployment/secrets.d.ts.map +1 -0
- package/dist/esm-types/cli/lib/localDeployment/secrets.test.d.ts +2 -0
- package/dist/esm-types/cli/lib/localDeployment/secrets.test.d.ts.map +1 -0
- package/dist/esm-types/cli/lib/localDeployment/upgrade.d.ts +6 -3
- package/dist/esm-types/cli/lib/localDeployment/upgrade.d.ts.map +1 -1
- package/dist/esm-types/cli/lib/localDeployment/utils.d.ts +0 -2
- package/dist/esm-types/cli/lib/localDeployment/utils.d.ts.map +1 -1
- package/dist/esm-types/cli/lib/versionApi.d.ts +2 -2
- package/dist/esm-types/index.d.ts +1 -1
- package/dist/esm-types/server/impl/registration_impl.d.ts.map +1 -1
- package/dist/esm-types/server/index.d.ts +1 -1
- package/dist/esm-types/server/index.d.ts.map +1 -1
- package/dist/esm-types/server/meta.d.ts +16 -0
- package/dist/esm-types/server/meta.d.ts.map +1 -1
- package/dist/esm-types/server/registration.d.ts +11 -5
- package/dist/esm-types/server/registration.d.ts.map +1 -1
- package/dist/react.bundle.js +1 -1
- package/dist/react.bundle.js.map +1 -1
- package/package.json +4 -2
- package/src/browser/sync/request_manager.test.ts +2 -2
- package/src/cli/aiFiles.ts +2 -2
- package/src/cli/configure.ts +4 -6
- package/src/cli/convexExport.ts +3 -3
- package/src/cli/convexImport.ts +2 -2
- package/src/cli/dashboard.ts +29 -3
- package/src/cli/data.ts +2 -2
- package/src/cli/deploy.ts +5 -5
- package/src/cli/deploymentCreate.test.ts +151 -24
- package/src/cli/deploymentCreate.ts +21 -11
- package/src/cli/deploymentSelect.ts +5 -5
- package/src/cli/deploymentSelection.test.ts +0 -3
- package/src/cli/deploymentToken.test.ts +34 -23
- package/src/cli/deploymentTokenCreate.ts +9 -21
- package/src/cli/deploymentTokenDelete.ts +8 -23
- package/src/cli/dev.ts +5 -4
- package/src/cli/env.ts +16 -16
- package/src/cli/envDefault.ts +10 -10
- package/src/cli/insights.ts +3 -3
- package/src/cli/lib/aiFiles/integration.test.ts +2 -0
- package/src/cli/lib/aiFiles/skills.ts +3 -3
- package/src/cli/lib/command.ts +2 -2
- package/src/cli/lib/deployment.ts +0 -5
- package/src/cli/lib/deploymentSelection.ts +67 -0
- package/src/cli/lib/dev.ts +39 -0
- package/src/cli/lib/generateDocs.test.ts +326 -0
- package/src/cli/lib/generateDocs.ts +393 -0
- package/src/cli/lib/localDeployment/anonymous.ts +48 -72
- package/src/cli/lib/localDeployment/bigBrain.ts +7 -15
- package/src/cli/lib/localDeployment/dashboard.ts +48 -80
- package/src/cli/lib/localDeployment/download.ts +34 -3
- package/src/cli/lib/localDeployment/filePaths.ts +66 -6
- package/src/cli/lib/localDeployment/localDeployment.ts +46 -184
- package/src/cli/lib/localDeployment/run.test.ts +6 -6
- package/src/cli/lib/localDeployment/secrets.test.ts +53 -0
- package/src/cli/lib/localDeployment/secrets.ts +93 -0
- package/src/cli/lib/localDeployment/tests/keygenFailure.mjs +9 -0
- package/src/cli/lib/localDeployment/tests/keygenSuccess.mjs +31 -0
- package/src/cli/lib/localDeployment/upgrade.ts +52 -38
- package/src/cli/lib/localDeployment/utils.ts +0 -10
- package/src/cli/lib/runTestFunction.ts +3 -3
- package/src/cli/run.ts +5 -5
- package/src/index.ts +1 -1
- package/src/server/impl/registration_impl.ts +0 -2
- package/src/server/index.ts +1 -0
- package/src/server/meta.ts +17 -0
- package/src/server/registration.test.ts +2 -35
- package/src/server/registration.ts +10 -19
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../../src/server/impl/registration_impl.ts"],
|
|
4
|
-
"sourcesContent": ["import {\n ConvexError,\n convexToJson,\n GenericValidator,\n jsonToConvex,\n v,\n Validator,\n Value,\n} from \"../../values/index.js\";\nimport { GenericDataModel } from \"../data_model.js\";\nimport {\n ActionBuilder,\n DefaultFunctionArgs,\n FunctionVisibility,\n GenericActionCtx,\n GenericMutationCtx,\n GenericQueryCtx,\n MutationBuilder,\n PublicHttpAction,\n QueryBuilder,\n RegisteredAction,\n RegisteredMutation,\n RegisteredQuery,\n} from \"../registration.js\";\nimport { setupActionCalls } from \"./actions_impl.js\";\nimport { setupActionVectorSearch } from \"./vector_search_impl.js\";\nimport { setupAuth } from \"./authentication_impl.js\";\nimport { setupReader, setupWriter } from \"./database_impl.js\";\nimport { QueryImpl, QueryInitializerImpl } from \"./query_impl.js\";\nimport {\n setupActionScheduler,\n setupMutationScheduler,\n} from \"./scheduler_impl.js\";\nimport {\n setupStorageActionWriter,\n setupStorageReader,\n setupStorageWriter,\n} from \"./storage_impl.js\";\nimport { parseArgs } from \"../../common/index.js\";\nimport { performAsyncSyscall } from \"./syscall.js\";\nimport { asObjectValidator } from \"../../values/validator.js\";\nimport { getFunctionAddress } from \"../components/paths.js\";\nimport {\n setupQueryMeta,\n setupMutationMeta,\n setupActionMeta,\n} from \"./meta_impl.js\";\n\nasync function invokeMutation<\n F extends (ctx: GenericMutationCtx<GenericDataModel>, ...args: any) => any,\n>(func: F, argsStr: string, visibility: FunctionVisibility) {\n // TODO(presley): Change the function signature and propagate the requestId from Rust.\n // Ok, to mock it out for now, since queries are only running in V8.\n const requestId = \"\";\n const args = jsonToConvex(JSON.parse(argsStr));\n const mutationCtx = {\n db: setupWriter(),\n auth: setupAuth(requestId),\n storage: setupStorageWriter(requestId),\n scheduler: setupMutationScheduler(),\n meta: setupMutationMeta(visibility),\n\n runQuery: (reference: any, args?: any, options?: any) =>\n runUdf(\"query\", reference, args, options?.transactionLimits),\n runSnapshotQuery: (reference: any, args?: any, options?: any) =>\n runUdf(\"snapshotQuery\", reference, args, options?.transactionLimits),\n runMutation: (reference: any, args?: any, options?: any) =>\n runUdf(\"mutation\", reference, args, options?.transactionLimits),\n };\n const result = await invokeFunction(func, mutationCtx, args as any);\n validateReturnValue(result);\n return JSON.stringify(convexToJson(result === undefined ? null : result));\n}\n\nexport function validateReturnValue(v: any) {\n if (v instanceof QueryInitializerImpl || v instanceof QueryImpl) {\n throw new Error(\n \"Return value is a Query. Results must be retrieved with `.collect()`, `.take(n), `.unique()`, or `.first()`.\",\n );\n }\n}\n\nexport async function invokeFunction<\n Ctx,\n Args extends any[],\n F extends (ctx: Ctx, ...args: Args) => any,\n>(func: F, ctx: Ctx, args: Args) {\n let result;\n try {\n result = await Promise.resolve(func(ctx, ...args));\n } catch (thrown: unknown) {\n throw serializeConvexErrorData(thrown);\n }\n return result;\n}\n\nfunction dontCallDirectly(\n funcType: string,\n handler: (ctx: any, args: any) => any,\n): unknown {\n return (ctx: any, args: any) => {\n globalThis.console.warn(\n \"Convex functions should not directly call other Convex functions. Consider calling a helper function instead. \" +\n `e.g. \\`export const foo = ${funcType}(...); await foo(ctx);\\` is not supported. ` +\n \"See https://docs.convex.dev/production/best-practices/#use-helper-functions-to-write-shared-code\",\n );\n return handler(ctx, args);\n };\n}\n\n// Keep in sync with node executor\nfunction serializeConvexErrorData(thrown: unknown) {\n if (\n typeof thrown === \"object\" &&\n thrown !== null &&\n Symbol.for(\"ConvexError\") in thrown\n ) {\n const error = thrown as ConvexError<any>;\n error.data = JSON.stringify(\n convexToJson(error.data === undefined ? null : error.data),\n );\n (error as any).ConvexErrorSymbol = Symbol.for(\"ConvexError\");\n return error;\n } else {\n return thrown;\n }\n}\n\n/**\n * Guard against Convex functions accidentally getting included in a browser bundle.\n * Convex functions may include secret logic or credentials that should not be\n * send to untrusted clients (browsers).\n */\nfunction assertNotBrowser() {\n if (\n typeof window === \"undefined\" ||\n (window as any).__convexAllowFunctionsInBrowser\n ) {\n return;\n }\n // JSDom doesn't count, developers are allowed to use JSDom in Convex functions.\n const isRealBrowser =\n Object.getOwnPropertyDescriptor(globalThis, \"window\")\n ?.get?.toString()\n .includes(\"[native code]\") ?? false;\n if (isRealBrowser) {\n // eslint-disable-next-line no-console\n console.error(\n \"Convex functions should not be imported in the browser. This will throw an error in future versions of `convex`. If this is a false negative, please report it to Convex support.\",\n );\n }\n}\n\ntype FunctionDefinition =\n | ((ctx: any, args: DefaultFunctionArgs) => any)\n | {\n args?: GenericValidator | Record<string, GenericValidator>;\n returns?: GenericValidator | Record<string, GenericValidator>;\n handler: (ctx: any, args: DefaultFunctionArgs) => any;\n };\n\nfunction strictReplacer(key: string, value: any) {\n if (value === undefined) {\n throw new Error(\n `A validator is undefined for field \"${key}\". ` +\n `This is often caused by circular imports. ` +\n `See https://docs.convex.dev/error#undefined-validator for details.`,\n );\n }\n return value;\n}\nfunction exportArgs(functionDefinition: FunctionDefinition) {\n return () => {\n let args: GenericValidator = v.any();\n if (\n typeof functionDefinition === \"object\" &&\n functionDefinition.args !== undefined\n ) {\n args = asObjectValidator(functionDefinition.args);\n }\n return JSON.stringify(args.json, strictReplacer);\n };\n}\n\nfunction exportReturns(functionDefinition: FunctionDefinition) {\n return () => {\n let returns: Validator<any, any, any> | undefined;\n if (\n typeof functionDefinition === \"object\" &&\n functionDefinition.returns !== undefined\n ) {\n returns = asObjectValidator(functionDefinition.returns);\n }\n return JSON.stringify(returns ? returns.json : null, strictReplacer);\n };\n}\n\n/**\n * Define a mutation in this Convex app's public API.\n *\n * You should generally use the `mutation` function from\n * `\"./_generated/server\"`.\n *\n * Mutations can read from and write to the database, and are accessible from\n * the client. They run **transactionally**, all database reads and writes\n * within a single mutation are atomic and isolated from other mutations.\n *\n * @example\n * ```typescript\n * import { mutation } from \"./_generated/server\";\n * import { v } from \"convex/values\";\n *\n * export const createTask = mutation({\n * args: { text: v.string() },\n * returns: v.id(\"tasks\"),\n * handler: async (ctx, args) => {\n * const taskId = await ctx.db.insert(\"tasks\", {\n * text: args.text,\n * completed: false,\n * });\n * return taskId;\n * },\n * });\n * ```\n *\n * **Best practice:** Always include `args` and `returns` validators on all\n * mutations. If the function doesn't return a value, use `returns: v.null()`.\n * Argument validation is critical for security since public mutations are\n * exposed to the internet.\n *\n * **Common mistake:** Mutations cannot call third-party APIs or use `fetch`.\n * They must be deterministic. Use actions for external API calls.\n *\n * **Common mistake:** Do not use `mutation` for sensitive internal functions\n * that should not be called by clients. Use `internalMutation` instead.\n *\n * @param func - The mutation function. It receives a {@link GenericMutationCtx} as its first argument.\n * @returns The wrapped mutation. Include this as an `export` to name it and make it accessible.\n *\n * @see https://docs.convex.dev/functions/mutation-functions\n * @public\n */\nexport const mutationGeneric: MutationBuilder<any, \"public\"> = ((\n functionDefinition: FunctionDefinition,\n) => {\n const handler = (\n typeof functionDefinition === \"function\"\n ? functionDefinition\n : functionDefinition.handler\n ) as (ctx: GenericMutationCtx<any>, args: any) => any;\n const func = dontCallDirectly(\"mutation\", handler) as RegisteredMutation<\n \"public\",\n any,\n any\n >;\n\n assertNotBrowser();\n func.isMutation = true;\n func.isPublic = true;\n func.invokeMutation = (argsStr) => invokeMutation(handler, argsStr, \"public\");\n func.exportArgs = exportArgs(functionDefinition);\n func.exportReturns = exportReturns(functionDefinition);\n func._handler = handler;\n return func;\n}) as MutationBuilder<any, \"public\">;\n\n/**\n * Define a mutation that is only accessible from other Convex functions (but not from the client).\n *\n * You should generally use the `internalMutation` function from\n * `\"./_generated/server\"`.\n *\n * Internal mutations can read from and write to the database but are **not**\n * exposed as part of your app's public API. They can only be called by other\n * Convex functions using `ctx.runMutation` or by the scheduler. Like public\n * mutations, they run transactionally.\n *\n * @example\n * ```typescript\n * import { internalMutation } from \"./_generated/server\";\n * import { v } from \"convex/values\";\n *\n * // This mutation can only be called from other Convex functions:\n * export const markTaskCompleted = internalMutation({\n * args: { taskId: v.id(\"tasks\") },\n * returns: v.null(),\n * handler: async (ctx, args) => {\n * await ctx.db.patch(\"tasks\", args.taskId, { completed: true });\n * return null;\n * },\n * });\n * ```\n *\n * **Best practice:** Use `internalMutation` for any mutation that should not\n * be directly callable by clients, such as write-back functions from actions\n * or scheduled background work. Reference it via the `internal` object:\n * `await ctx.runMutation(internal.myModule.markTaskCompleted, { taskId })`.\n *\n * @param func - The mutation function. It receives a {@link GenericMutationCtx} as its first argument.\n * @returns The wrapped mutation. Include this as an `export` to name it and make it accessible.\n *\n * @see https://docs.convex.dev/functions/internal-functions\n * @public\n */\nexport const internalMutationGeneric: MutationBuilder<any, \"internal\"> = ((\n functionDefinition: FunctionDefinition,\n) => {\n const handler = (\n typeof functionDefinition === \"function\"\n ? functionDefinition\n : functionDefinition.handler\n ) as (ctx: GenericMutationCtx<any>, args: any) => any;\n const func = dontCallDirectly(\n \"internalMutation\",\n handler,\n ) as RegisteredMutation<\"internal\", any, any>;\n\n assertNotBrowser();\n func.isMutation = true;\n func.isInternal = true;\n func.invokeMutation = (argsStr) =>\n invokeMutation(handler, argsStr, \"internal\");\n func.exportArgs = exportArgs(functionDefinition);\n func.exportReturns = exportReturns(functionDefinition);\n func._handler = handler;\n return func;\n}) as MutationBuilder<any, \"internal\">;\n\nasync function invokeQuery<\n F extends (ctx: GenericQueryCtx<GenericDataModel>, ...args: any) => any,\n>(func: F, argsStr: string, visibility: FunctionVisibility) {\n // TODO(presley): Change the function signature and propagate the requestId from Rust.\n // Ok, to mock it out for now, since queries are only running in V8.\n const requestId = \"\";\n const args = jsonToConvex(JSON.parse(argsStr));\n const queryCtx = {\n db: setupReader(),\n auth: setupAuth(requestId),\n storage: setupStorageReader(requestId),\n meta: setupQueryMeta(visibility),\n runQuery: (reference: any, args?: any, options?: any) =>\n runUdf(\"query\", reference, args, options?.transactionLimits),\n };\n const result = await invokeFunction(func, queryCtx, args as any);\n validateReturnValue(result);\n return JSON.stringify(convexToJson(result === undefined ? null : result));\n}\n\n/**\n * Define a query in this Convex app's public API.\n *\n * You should generally use the `query` function from\n * `\"./_generated/server\"`.\n *\n * Queries can read from the database and are accessible from the client. They\n * are **reactive**, when used with `useQuery` in React, the component\n * automatically re-renders whenever the underlying data changes. Queries\n * cannot modify the database.\n * Query results are automatically cached by the Convex client and kept\n * consistent via WebSocket subscriptions.\n *\n *\n * @example\n * ```typescript\n * import { query } from \"./_generated/server\";\n * import { v } from \"convex/values\";\n *\n * export const listTasks = query({\n * args: { completed: v.optional(v.boolean()) },\n * returns: v.array(v.object({\n * _id: v.id(\"tasks\"),\n * _creationTime: v.number(),\n * text: v.string(),\n * completed: v.boolean(),\n * })),\n * handler: async (ctx, args) => {\n * if (args.completed !== undefined) {\n * return await ctx.db\n * .query(\"tasks\")\n * .withIndex(\"by_completed\", (q) => q.eq(\"completed\", args.completed))\n * .collect();\n * }\n * return await ctx.db.query(\"tasks\").collect();\n * },\n * });\n * ```\n *\n * **Best practice:** Always include `args` and `returns` validators. Use\n * `.withIndex()` instead of `.filter()` for efficient database queries.\n * Queries should be fast since they run on every relevant data change.\n *\n * **Common mistake:** Queries are pure reads, they cannot write to the\n * database, call external APIs, or schedule functions. Use actions for HTTP\n * calls and mutations for database writes and scheduling.\n *\n * @param func - The query function. It receives a {@link GenericQueryCtx} as its first argument.\n * @returns The wrapped query. Include this as an `export` to name it and make it accessible.\n *\n * @see https://docs.convex.dev/functions/query-functions\n * @public\n */\nexport const queryGeneric: QueryBuilder<any, \"public\"> = ((\n functionDefinition: FunctionDefinition,\n) => {\n const handler = (\n typeof functionDefinition === \"function\"\n ? functionDefinition\n : functionDefinition.handler\n ) as (ctx: GenericQueryCtx<any>, args: any) => any;\n const func = dontCallDirectly(\"query\", handler) as RegisteredQuery<\n \"public\",\n any,\n any\n >;\n\n assertNotBrowser();\n func.isQuery = true;\n func.isPublic = true;\n func.invokeQuery = (argsStr) => invokeQuery(handler, argsStr, \"public\");\n func.exportArgs = exportArgs(functionDefinition);\n func.exportReturns = exportReturns(functionDefinition);\n func._handler = handler;\n return func;\n}) as QueryBuilder<any, \"public\">;\n\n/**\n * Define a query that is only accessible from other Convex functions (but not from the client).\n *\n * You should generally use the `internalQuery` function from\n * `\"./_generated/server\"`.\n *\n * Internal queries can read from the database but are **not** exposed as part\n * of your app's public API. They can only be called by other Convex functions\n * using `ctx.runQuery`. This is useful for loading data in actions or for\n * helper queries that shouldn't be client-facing.\n *\n * @example\n * ```typescript\n * import { internalQuery } from \"./_generated/server\";\n * import { v } from \"convex/values\";\n *\n * // Only callable from other Convex functions:\n * export const getUser = internalQuery({\n * args: { userId: v.id(\"users\") },\n * returns: v.union(\n * v.object({\n * _id: v.id(\"users\"),\n * _creationTime: v.number(),\n * name: v.string(),\n * email: v.string(),\n * }),\n * v.null(),\n * ),\n * handler: async (ctx, args) => {\n * return await ctx.db.get(\"users\", args.userId);\n * },\n * });\n * ```\n *\n * **Best practice:** Use `internalQuery` for data-loading in actions via\n * `ctx.runQuery(internal.myModule.getUser, { userId })`.\n *\n * @param func - The query function. It receives a {@link GenericQueryCtx} as its first argument.\n * @returns The wrapped query. Include this as an `export` to name it and make it accessible.\n *\n * @see https://docs.convex.dev/functions/internal-functions\n * @public\n */\nexport const internalQueryGeneric: QueryBuilder<any, \"internal\"> = ((\n functionDefinition: FunctionDefinition,\n) => {\n const handler = (\n typeof functionDefinition === \"function\"\n ? functionDefinition\n : functionDefinition.handler\n ) as (ctx: GenericQueryCtx<any>, args: any) => any;\n const func = dontCallDirectly(\"internalQuery\", handler) as RegisteredQuery<\n \"internal\",\n any,\n any\n >;\n\n assertNotBrowser();\n func.isQuery = true;\n func.isInternal = true;\n func.invokeQuery = (argsStr) =>\n invokeQuery(handler as any, argsStr, \"internal\");\n func.exportArgs = exportArgs(functionDefinition);\n func.exportReturns = exportReturns(functionDefinition);\n func._handler = handler;\n return func;\n}) as QueryBuilder<any, \"internal\">;\n\nasync function invokeAction<\n F extends (ctx: GenericActionCtx<GenericDataModel>, ...args: any) => any,\n>(func: F, requestId: string, argsStr: string, visibility: FunctionVisibility) {\n (globalThis as any).Convex?.setupPerformance?.();\n const args = jsonToConvex(JSON.parse(argsStr));\n const calls = setupActionCalls(requestId);\n const ctx = {\n ...calls,\n auth: setupAuth(requestId),\n scheduler: setupActionScheduler(requestId),\n storage: setupStorageActionWriter(requestId),\n vectorSearch: setupActionVectorSearch(requestId) as any,\n meta: setupActionMeta(visibility),\n };\n const result = await invokeFunction(func, ctx, args as any);\n return JSON.stringify(convexToJson(result === undefined ? null : result));\n}\n\n/**\n * Define an action in this Convex app's public API.\n *\n * Actions can call third-party APIs, use Node.js libraries, and perform other\n * side effects. Unlike queries and mutations, actions do **not** have direct\n * database access (`ctx.db` is not available). Instead, use `ctx.runQuery`\n * and `ctx.runMutation` to read and write data.\n *\n * You should generally use the `action` function from\n * `\"./_generated/server\"`.\n *\n * Actions are accessible from the client and run outside of the database\n * transaction, so they are not atomic. They are best for integrating with\n * external services.\n *\n * @example\n * ```typescript\n * // Add \"use node\"; at the top of the file if using Node.js built-in modules.\n * import { action } from \"./_generated/server\";\n * import { v } from \"convex/values\";\n * import { internal } from \"./_generated/api\";\n *\n * export const generateSummary = action({\n * args: { text: v.string() },\n * returns: v.string(),\n * handler: async (ctx, args) => {\n * // Call an external API:\n * const response = await fetch(\"https://api.example.com/summarize\", {\n * method: \"POST\",\n * body: JSON.stringify({ text: args.text }),\n * });\n * const { summary } = await response.json();\n *\n * // Write results back via a mutation:\n * await ctx.runMutation(internal.myModule.saveSummary, {\n * text: args.text,\n * summary,\n * });\n *\n * return summary;\n * },\n * });\n * ```\n *\n * **Best practice:** Minimize the number of `ctx.runQuery` and\n * `ctx.runMutation` calls from actions. Each call is a separate transaction,\n * so splitting logic across multiple calls introduces the risk of race\n * conditions. Try to batch reads/writes into single query/mutation calls.\n *\n * **`\"use node\"` runtime:** Actions run in Convex's default JavaScript\n * runtime, which supports `fetch` and most NPM packages. Only add\n * `\"use node\";` at the top of the file if a third-party library specifically\n * requires Node.js built-in APIs, it is a last resort, not the default.\n * Node.js actions have slower cold starts, and **only actions can be defined\n * in `\"use node\"` files** (no queries or mutations), so prefer the default\n * runtime whenever possible.\n *\n * **Common mistake:** Do not try to access `ctx.db` in an action, it is\n * not available. Use `ctx.runQuery` and `ctx.runMutation` instead.\n *\n * @param func - The function. It receives a {@link GenericActionCtx} as its first argument.\n * @returns The wrapped function. Include this as an `export` to name it and make it accessible.\n *\n * @see https://docs.convex.dev/functions/actions\n * @public\n */\nexport const actionGeneric: ActionBuilder<any, \"public\"> = ((\n functionDefinition: FunctionDefinition,\n) => {\n const handler = (\n typeof functionDefinition === \"function\"\n ? functionDefinition\n : functionDefinition.handler\n ) as (ctx: GenericActionCtx<any>, args: any) => any;\n const func = dontCallDirectly(\"action\", handler) as RegisteredAction<\n \"public\",\n any,\n any\n >;\n\n assertNotBrowser();\n func.isAction = true;\n func.isPublic = true;\n func.invokeAction = (requestId, argsStr) =>\n invokeAction(handler, requestId, argsStr, \"public\");\n func.exportArgs = exportArgs(functionDefinition);\n func.exportReturns = exportReturns(functionDefinition);\n func._handler = handler;\n return func;\n}) as ActionBuilder<any, \"public\">;\n\n/**\n * Define an action that is only accessible from other Convex functions (but not from the client).\n *\n * You should generally use the `internalAction` function from\n * `\"./_generated/server\"`.\n *\n * Internal actions behave like public actions (they can call external APIs and\n * use Node.js libraries) but are **not** exposed in your app's public API. They\n * can only be called by other Convex functions using `ctx.runAction` or via the\n * scheduler.\n *\n * @example\n * ```typescript\n * import { internalAction } from \"./_generated/server\";\n * import { v } from \"convex/values\";\n *\n * export const sendEmail = internalAction({\n * args: { to: v.string(), subject: v.string(), body: v.string() },\n * returns: v.null(),\n * handler: async (ctx, args) => {\n * // Call an external email service (fetch works in the default runtime):\n * await fetch(\"https://api.email-service.com/send\", {\n * method: \"POST\",\n * headers: { \"Content-Type\": \"application/json\" },\n * body: JSON.stringify(args),\n * });\n * return null;\n * },\n * });\n * ```\n *\n * **Best practice:** Use `internalAction` for background work scheduled from\n * mutations: `await ctx.scheduler.runAfter(0, internal.myModule.sendEmail, { ... })`.\n * Only use `ctx.runAction` from another action if you need to cross runtimes\n * (e.g., default Convex runtime to Node.js). Otherwise, extract shared code\n * into a helper function.\n *\n * **`\"use node\"` runtime:** Only add `\"use node\";` at the top of the file\n * as a last resort when a third-party library requires Node.js APIs. Node.js\n * actions have slower cold starts, and **only actions can be defined in\n * `\"use node\"` files** (no queries or mutations).\n *\n * @param func - The function. It receives a {@link GenericActionCtx} as its first argument.\n * @returns The wrapped function. Include this as an `export` to name it and make it accessible.\n *\n * @see https://docs.convex.dev/functions/internal-functions\n * @public\n */\nexport const internalActionGeneric: ActionBuilder<any, \"internal\"> = ((\n functionDefinition: FunctionDefinition,\n) => {\n const handler = (\n typeof functionDefinition === \"function\"\n ? functionDefinition\n : functionDefinition.handler\n ) as (ctx: GenericActionCtx<any>, args: any) => any;\n const func = dontCallDirectly(\"internalAction\", handler) as RegisteredAction<\n \"internal\",\n any,\n any\n >;\n\n assertNotBrowser();\n func.isAction = true;\n func.isInternal = true;\n func.invokeAction = (requestId, argsStr) =>\n invokeAction(handler, requestId, argsStr, \"internal\");\n func.exportArgs = exportArgs(functionDefinition);\n func.exportReturns = exportReturns(functionDefinition);\n func._handler = handler;\n return func;\n}) as ActionBuilder<any, \"internal\">;\n\nasync function invokeHttpAction<\n F extends (ctx: GenericActionCtx<GenericDataModel>, request: Request) => any,\n>(func: F, request: Request) {\n (globalThis as any).Convex?.setupPerformance?.();\n // TODO(presley): Change the function signature and propagate the requestId from Rust.\n // Ok, to mock it out for now, since http endpoints are only running in V8.\n const requestId = \"\";\n const calls = setupActionCalls(requestId);\n const ctx = {\n ...calls,\n auth: setupAuth(requestId),\n storage: setupStorageActionWriter(requestId),\n scheduler: setupActionScheduler(requestId),\n vectorSearch: setupActionVectorSearch(requestId) as any,\n meta: setupActionMeta(\"public\"),\n };\n return await invokeFunction(func, ctx, [request]);\n}\n\n/**\n * Define a Convex HTTP action.\n *\n * HTTP actions handle raw HTTP requests and return HTTP responses. They are\n * registered by routing URL paths to them in `convex/http.ts` using\n * {@link HttpRouter}. Like regular actions, they can call external APIs and\n * use `ctx.runQuery` / `ctx.runMutation` but do not have direct `ctx.db` access.\n *\n * @example\n * ```typescript\n * // convex/http.ts\n * import { httpRouter } from \"convex/server\";\n * import { httpAction } from \"./_generated/server\";\n *\n * const http = httpRouter();\n *\n * http.route({\n * path: \"/api/webhook\",\n * method: \"POST\",\n * handler: httpAction(async (ctx, request) => {\n * const body = await request.json();\n * // Process the webhook payload...\n * return new Response(JSON.stringify({ ok: true }), {\n * status: 200,\n * headers: { \"Content-Type\": \"application/json\" },\n * });\n * }),\n * });\n *\n * export default http;\n * ```\n *\n * **Best practice:** HTTP actions are registered at the exact path specified.\n * For example, `path: \"/api/webhook\"` registers at `/api/webhook`.\n *\n * @param func - The function. It receives a {@link GenericActionCtx} as its first argument, and a `Request` object\n * as its second.\n * @returns The wrapped function. Route a URL path to this function in `convex/http.ts`.\n *\n * @see https://docs.convex.dev/functions/http-actions\n * @public\n */\nexport const httpActionGeneric = (\n func: (\n ctx: GenericActionCtx<GenericDataModel>,\n request: Request,\n ) => Promise<Response>,\n): PublicHttpAction => {\n const q = dontCallDirectly(\"httpAction\", func) as PublicHttpAction;\n assertNotBrowser();\n q.isHttp = true;\n q.invokeHttpAction = (request) => invokeHttpAction(func as any, request);\n q._handler = func;\n return q;\n};\n\nasync function runUdf(\n udfType: \"query\" | \"mutation\" | \"snapshotQuery\",\n f: any,\n args?: Record<string, Value>,\n transactionLimits?: Record<string, number>,\n): Promise<any> {\n const queryArgs = parseArgs(args);\n const syscallArgs: Record<string, any> = {\n udfType,\n args: convexToJson(queryArgs),\n ...getFunctionAddress(f),\n };\n if (transactionLimits) {\n syscallArgs.transactionLimits = transactionLimits;\n }\n const result = await performAsyncSyscall(\"1.0/runUdf\", syscallArgs);\n return jsonToConvex(result);\n}\n"],
|
|
5
|
-
"mappings": ";AAAA;AAAA,EAEE;AAAA,EAEA;AAAA,EACA;AAAA,OAGK;AAgBP,SAAS,wBAAwB;AACjC,SAAS,+BAA+B;AACxC,SAAS,iBAAiB;AAC1B,SAAS,aAAa,mBAAmB;AACzC,SAAS,WAAW,4BAA4B;AAChD;AAAA,EACE;AAAA,EACA;AAAA,OACK;AACP;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,OACK;AACP,SAAS,iBAAiB;AAC1B,SAAS,2BAA2B;AACpC,SAAS,yBAAyB;AAClC,SAAS,0BAA0B;AACnC;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,OACK;AAEP,eAAe,eAEb,MAAS,SAAiB,YAAgC;AAG1D,QAAM,YAAY;AAClB,QAAM,OAAO,aAAa,KAAK,MAAM,OAAO,CAAC;AAC7C,QAAM,cAAc;AAAA,IAClB,IAAI,YAAY;AAAA,IAChB,MAAM,UAAU,SAAS;AAAA,IACzB,SAAS,mBAAmB,SAAS;AAAA,IACrC,WAAW,uBAAuB;AAAA,IAClC,MAAM,kBAAkB,UAAU;AAAA,IAElC,UAAU,CAAC,WAAgBA,OAAY,YACrC,OAAO,SAAS,WAAWA,OAAM,SAAS,iBAAiB;AAAA,IAC7D,
|
|
4
|
+
"sourcesContent": ["import {\n ConvexError,\n convexToJson,\n GenericValidator,\n jsonToConvex,\n v,\n Validator,\n Value,\n} from \"../../values/index.js\";\nimport { GenericDataModel } from \"../data_model.js\";\nimport {\n ActionBuilder,\n DefaultFunctionArgs,\n FunctionVisibility,\n GenericActionCtx,\n GenericMutationCtx,\n GenericQueryCtx,\n MutationBuilder,\n PublicHttpAction,\n QueryBuilder,\n RegisteredAction,\n RegisteredMutation,\n RegisteredQuery,\n} from \"../registration.js\";\nimport { setupActionCalls } from \"./actions_impl.js\";\nimport { setupActionVectorSearch } from \"./vector_search_impl.js\";\nimport { setupAuth } from \"./authentication_impl.js\";\nimport { setupReader, setupWriter } from \"./database_impl.js\";\nimport { QueryImpl, QueryInitializerImpl } from \"./query_impl.js\";\nimport {\n setupActionScheduler,\n setupMutationScheduler,\n} from \"./scheduler_impl.js\";\nimport {\n setupStorageActionWriter,\n setupStorageReader,\n setupStorageWriter,\n} from \"./storage_impl.js\";\nimport { parseArgs } from \"../../common/index.js\";\nimport { performAsyncSyscall } from \"./syscall.js\";\nimport { asObjectValidator } from \"../../values/validator.js\";\nimport { getFunctionAddress } from \"../components/paths.js\";\nimport {\n setupQueryMeta,\n setupMutationMeta,\n setupActionMeta,\n} from \"./meta_impl.js\";\n\nasync function invokeMutation<\n F extends (ctx: GenericMutationCtx<GenericDataModel>, ...args: any) => any,\n>(func: F, argsStr: string, visibility: FunctionVisibility) {\n // TODO(presley): Change the function signature and propagate the requestId from Rust.\n // Ok, to mock it out for now, since queries are only running in V8.\n const requestId = \"\";\n const args = jsonToConvex(JSON.parse(argsStr));\n const mutationCtx = {\n db: setupWriter(),\n auth: setupAuth(requestId),\n storage: setupStorageWriter(requestId),\n scheduler: setupMutationScheduler(),\n meta: setupMutationMeta(visibility),\n\n runQuery: (reference: any, args?: any, options?: any) =>\n runUdf(\"query\", reference, args, options?.transactionLimits),\n runMutation: (reference: any, args?: any, options?: any) =>\n runUdf(\"mutation\", reference, args, options?.transactionLimits),\n };\n const result = await invokeFunction(func, mutationCtx, args as any);\n validateReturnValue(result);\n return JSON.stringify(convexToJson(result === undefined ? null : result));\n}\n\nexport function validateReturnValue(v: any) {\n if (v instanceof QueryInitializerImpl || v instanceof QueryImpl) {\n throw new Error(\n \"Return value is a Query. Results must be retrieved with `.collect()`, `.take(n), `.unique()`, or `.first()`.\",\n );\n }\n}\n\nexport async function invokeFunction<\n Ctx,\n Args extends any[],\n F extends (ctx: Ctx, ...args: Args) => any,\n>(func: F, ctx: Ctx, args: Args) {\n let result;\n try {\n result = await Promise.resolve(func(ctx, ...args));\n } catch (thrown: unknown) {\n throw serializeConvexErrorData(thrown);\n }\n return result;\n}\n\nfunction dontCallDirectly(\n funcType: string,\n handler: (ctx: any, args: any) => any,\n): unknown {\n return (ctx: any, args: any) => {\n globalThis.console.warn(\n \"Convex functions should not directly call other Convex functions. Consider calling a helper function instead. \" +\n `e.g. \\`export const foo = ${funcType}(...); await foo(ctx);\\` is not supported. ` +\n \"See https://docs.convex.dev/production/best-practices/#use-helper-functions-to-write-shared-code\",\n );\n return handler(ctx, args);\n };\n}\n\n// Keep in sync with node executor\nfunction serializeConvexErrorData(thrown: unknown) {\n if (\n typeof thrown === \"object\" &&\n thrown !== null &&\n Symbol.for(\"ConvexError\") in thrown\n ) {\n const error = thrown as ConvexError<any>;\n error.data = JSON.stringify(\n convexToJson(error.data === undefined ? null : error.data),\n );\n (error as any).ConvexErrorSymbol = Symbol.for(\"ConvexError\");\n return error;\n } else {\n return thrown;\n }\n}\n\n/**\n * Guard against Convex functions accidentally getting included in a browser bundle.\n * Convex functions may include secret logic or credentials that should not be\n * send to untrusted clients (browsers).\n */\nfunction assertNotBrowser() {\n if (\n typeof window === \"undefined\" ||\n (window as any).__convexAllowFunctionsInBrowser\n ) {\n return;\n }\n // JSDom doesn't count, developers are allowed to use JSDom in Convex functions.\n const isRealBrowser =\n Object.getOwnPropertyDescriptor(globalThis, \"window\")\n ?.get?.toString()\n .includes(\"[native code]\") ?? false;\n if (isRealBrowser) {\n // eslint-disable-next-line no-console\n console.error(\n \"Convex functions should not be imported in the browser. This will throw an error in future versions of `convex`. If this is a false negative, please report it to Convex support.\",\n );\n }\n}\n\ntype FunctionDefinition =\n | ((ctx: any, args: DefaultFunctionArgs) => any)\n | {\n args?: GenericValidator | Record<string, GenericValidator>;\n returns?: GenericValidator | Record<string, GenericValidator>;\n handler: (ctx: any, args: DefaultFunctionArgs) => any;\n };\n\nfunction strictReplacer(key: string, value: any) {\n if (value === undefined) {\n throw new Error(\n `A validator is undefined for field \"${key}\". ` +\n `This is often caused by circular imports. ` +\n `See https://docs.convex.dev/error#undefined-validator for details.`,\n );\n }\n return value;\n}\nfunction exportArgs(functionDefinition: FunctionDefinition) {\n return () => {\n let args: GenericValidator = v.any();\n if (\n typeof functionDefinition === \"object\" &&\n functionDefinition.args !== undefined\n ) {\n args = asObjectValidator(functionDefinition.args);\n }\n return JSON.stringify(args.json, strictReplacer);\n };\n}\n\nfunction exportReturns(functionDefinition: FunctionDefinition) {\n return () => {\n let returns: Validator<any, any, any> | undefined;\n if (\n typeof functionDefinition === \"object\" &&\n functionDefinition.returns !== undefined\n ) {\n returns = asObjectValidator(functionDefinition.returns);\n }\n return JSON.stringify(returns ? returns.json : null, strictReplacer);\n };\n}\n\n/**\n * Define a mutation in this Convex app's public API.\n *\n * You should generally use the `mutation` function from\n * `\"./_generated/server\"`.\n *\n * Mutations can read from and write to the database, and are accessible from\n * the client. They run **transactionally**, all database reads and writes\n * within a single mutation are atomic and isolated from other mutations.\n *\n * @example\n * ```typescript\n * import { mutation } from \"./_generated/server\";\n * import { v } from \"convex/values\";\n *\n * export const createTask = mutation({\n * args: { text: v.string() },\n * returns: v.id(\"tasks\"),\n * handler: async (ctx, args) => {\n * const taskId = await ctx.db.insert(\"tasks\", {\n * text: args.text,\n * completed: false,\n * });\n * return taskId;\n * },\n * });\n * ```\n *\n * **Best practice:** Always include `args` and `returns` validators on all\n * mutations. If the function doesn't return a value, use `returns: v.null()`.\n * Argument validation is critical for security since public mutations are\n * exposed to the internet.\n *\n * **Common mistake:** Mutations cannot call third-party APIs or use `fetch`.\n * They must be deterministic. Use actions for external API calls.\n *\n * **Common mistake:** Do not use `mutation` for sensitive internal functions\n * that should not be called by clients. Use `internalMutation` instead.\n *\n * @param func - The mutation function. It receives a {@link GenericMutationCtx} as its first argument.\n * @returns The wrapped mutation. Include this as an `export` to name it and make it accessible.\n *\n * @see https://docs.convex.dev/functions/mutation-functions\n * @public\n */\nexport const mutationGeneric: MutationBuilder<any, \"public\"> = ((\n functionDefinition: FunctionDefinition,\n) => {\n const handler = (\n typeof functionDefinition === \"function\"\n ? functionDefinition\n : functionDefinition.handler\n ) as (ctx: GenericMutationCtx<any>, args: any) => any;\n const func = dontCallDirectly(\"mutation\", handler) as RegisteredMutation<\n \"public\",\n any,\n any\n >;\n\n assertNotBrowser();\n func.isMutation = true;\n func.isPublic = true;\n func.invokeMutation = (argsStr) => invokeMutation(handler, argsStr, \"public\");\n func.exportArgs = exportArgs(functionDefinition);\n func.exportReturns = exportReturns(functionDefinition);\n func._handler = handler;\n return func;\n}) as MutationBuilder<any, \"public\">;\n\n/**\n * Define a mutation that is only accessible from other Convex functions (but not from the client).\n *\n * You should generally use the `internalMutation` function from\n * `\"./_generated/server\"`.\n *\n * Internal mutations can read from and write to the database but are **not**\n * exposed as part of your app's public API. They can only be called by other\n * Convex functions using `ctx.runMutation` or by the scheduler. Like public\n * mutations, they run transactionally.\n *\n * @example\n * ```typescript\n * import { internalMutation } from \"./_generated/server\";\n * import { v } from \"convex/values\";\n *\n * // This mutation can only be called from other Convex functions:\n * export const markTaskCompleted = internalMutation({\n * args: { taskId: v.id(\"tasks\") },\n * returns: v.null(),\n * handler: async (ctx, args) => {\n * await ctx.db.patch(\"tasks\", args.taskId, { completed: true });\n * return null;\n * },\n * });\n * ```\n *\n * **Best practice:** Use `internalMutation` for any mutation that should not\n * be directly callable by clients, such as write-back functions from actions\n * or scheduled background work. Reference it via the `internal` object:\n * `await ctx.runMutation(internal.myModule.markTaskCompleted, { taskId })`.\n *\n * @param func - The mutation function. It receives a {@link GenericMutationCtx} as its first argument.\n * @returns The wrapped mutation. Include this as an `export` to name it and make it accessible.\n *\n * @see https://docs.convex.dev/functions/internal-functions\n * @public\n */\nexport const internalMutationGeneric: MutationBuilder<any, \"internal\"> = ((\n functionDefinition: FunctionDefinition,\n) => {\n const handler = (\n typeof functionDefinition === \"function\"\n ? functionDefinition\n : functionDefinition.handler\n ) as (ctx: GenericMutationCtx<any>, args: any) => any;\n const func = dontCallDirectly(\n \"internalMutation\",\n handler,\n ) as RegisteredMutation<\"internal\", any, any>;\n\n assertNotBrowser();\n func.isMutation = true;\n func.isInternal = true;\n func.invokeMutation = (argsStr) =>\n invokeMutation(handler, argsStr, \"internal\");\n func.exportArgs = exportArgs(functionDefinition);\n func.exportReturns = exportReturns(functionDefinition);\n func._handler = handler;\n return func;\n}) as MutationBuilder<any, \"internal\">;\n\nasync function invokeQuery<\n F extends (ctx: GenericQueryCtx<GenericDataModel>, ...args: any) => any,\n>(func: F, argsStr: string, visibility: FunctionVisibility) {\n // TODO(presley): Change the function signature and propagate the requestId from Rust.\n // Ok, to mock it out for now, since queries are only running in V8.\n const requestId = \"\";\n const args = jsonToConvex(JSON.parse(argsStr));\n const queryCtx = {\n db: setupReader(),\n auth: setupAuth(requestId),\n storage: setupStorageReader(requestId),\n meta: setupQueryMeta(visibility),\n runQuery: (reference: any, args?: any, options?: any) =>\n runUdf(\"query\", reference, args, options?.transactionLimits),\n };\n const result = await invokeFunction(func, queryCtx, args as any);\n validateReturnValue(result);\n return JSON.stringify(convexToJson(result === undefined ? null : result));\n}\n\n/**\n * Define a query in this Convex app's public API.\n *\n * You should generally use the `query` function from\n * `\"./_generated/server\"`.\n *\n * Queries can read from the database and are accessible from the client. They\n * are **reactive**, when used with `useQuery` in React, the component\n * automatically re-renders whenever the underlying data changes. Queries\n * cannot modify the database.\n * Query results are automatically cached by the Convex client and kept\n * consistent via WebSocket subscriptions.\n *\n *\n * @example\n * ```typescript\n * import { query } from \"./_generated/server\";\n * import { v } from \"convex/values\";\n *\n * export const listTasks = query({\n * args: { completed: v.optional(v.boolean()) },\n * returns: v.array(v.object({\n * _id: v.id(\"tasks\"),\n * _creationTime: v.number(),\n * text: v.string(),\n * completed: v.boolean(),\n * })),\n * handler: async (ctx, args) => {\n * if (args.completed !== undefined) {\n * return await ctx.db\n * .query(\"tasks\")\n * .withIndex(\"by_completed\", (q) => q.eq(\"completed\", args.completed))\n * .collect();\n * }\n * return await ctx.db.query(\"tasks\").collect();\n * },\n * });\n * ```\n *\n * **Best practice:** Always include `args` and `returns` validators. Use\n * `.withIndex()` instead of `.filter()` for efficient database queries.\n * Queries should be fast since they run on every relevant data change.\n *\n * **Common mistake:** Queries are pure reads, they cannot write to the\n * database, call external APIs, or schedule functions. Use actions for HTTP\n * calls and mutations for database writes and scheduling.\n *\n * @param func - The query function. It receives a {@link GenericQueryCtx} as its first argument.\n * @returns The wrapped query. Include this as an `export` to name it and make it accessible.\n *\n * @see https://docs.convex.dev/functions/query-functions\n * @public\n */\nexport const queryGeneric: QueryBuilder<any, \"public\"> = ((\n functionDefinition: FunctionDefinition,\n) => {\n const handler = (\n typeof functionDefinition === \"function\"\n ? functionDefinition\n : functionDefinition.handler\n ) as (ctx: GenericQueryCtx<any>, args: any) => any;\n const func = dontCallDirectly(\"query\", handler) as RegisteredQuery<\n \"public\",\n any,\n any\n >;\n\n assertNotBrowser();\n func.isQuery = true;\n func.isPublic = true;\n func.invokeQuery = (argsStr) => invokeQuery(handler, argsStr, \"public\");\n func.exportArgs = exportArgs(functionDefinition);\n func.exportReturns = exportReturns(functionDefinition);\n func._handler = handler;\n return func;\n}) as QueryBuilder<any, \"public\">;\n\n/**\n * Define a query that is only accessible from other Convex functions (but not from the client).\n *\n * You should generally use the `internalQuery` function from\n * `\"./_generated/server\"`.\n *\n * Internal queries can read from the database but are **not** exposed as part\n * of your app's public API. They can only be called by other Convex functions\n * using `ctx.runQuery`. This is useful for loading data in actions or for\n * helper queries that shouldn't be client-facing.\n *\n * @example\n * ```typescript\n * import { internalQuery } from \"./_generated/server\";\n * import { v } from \"convex/values\";\n *\n * // Only callable from other Convex functions:\n * export const getUser = internalQuery({\n * args: { userId: v.id(\"users\") },\n * returns: v.union(\n * v.object({\n * _id: v.id(\"users\"),\n * _creationTime: v.number(),\n * name: v.string(),\n * email: v.string(),\n * }),\n * v.null(),\n * ),\n * handler: async (ctx, args) => {\n * return await ctx.db.get(\"users\", args.userId);\n * },\n * });\n * ```\n *\n * **Best practice:** Use `internalQuery` for data-loading in actions via\n * `ctx.runQuery(internal.myModule.getUser, { userId })`.\n *\n * @param func - The query function. It receives a {@link GenericQueryCtx} as its first argument.\n * @returns The wrapped query. Include this as an `export` to name it and make it accessible.\n *\n * @see https://docs.convex.dev/functions/internal-functions\n * @public\n */\nexport const internalQueryGeneric: QueryBuilder<any, \"internal\"> = ((\n functionDefinition: FunctionDefinition,\n) => {\n const handler = (\n typeof functionDefinition === \"function\"\n ? functionDefinition\n : functionDefinition.handler\n ) as (ctx: GenericQueryCtx<any>, args: any) => any;\n const func = dontCallDirectly(\"internalQuery\", handler) as RegisteredQuery<\n \"internal\",\n any,\n any\n >;\n\n assertNotBrowser();\n func.isQuery = true;\n func.isInternal = true;\n func.invokeQuery = (argsStr) =>\n invokeQuery(handler as any, argsStr, \"internal\");\n func.exportArgs = exportArgs(functionDefinition);\n func.exportReturns = exportReturns(functionDefinition);\n func._handler = handler;\n return func;\n}) as QueryBuilder<any, \"internal\">;\n\nasync function invokeAction<\n F extends (ctx: GenericActionCtx<GenericDataModel>, ...args: any) => any,\n>(func: F, requestId: string, argsStr: string, visibility: FunctionVisibility) {\n (globalThis as any).Convex?.setupPerformance?.();\n const args = jsonToConvex(JSON.parse(argsStr));\n const calls = setupActionCalls(requestId);\n const ctx = {\n ...calls,\n auth: setupAuth(requestId),\n scheduler: setupActionScheduler(requestId),\n storage: setupStorageActionWriter(requestId),\n vectorSearch: setupActionVectorSearch(requestId) as any,\n meta: setupActionMeta(visibility),\n };\n const result = await invokeFunction(func, ctx, args as any);\n return JSON.stringify(convexToJson(result === undefined ? null : result));\n}\n\n/**\n * Define an action in this Convex app's public API.\n *\n * Actions can call third-party APIs, use Node.js libraries, and perform other\n * side effects. Unlike queries and mutations, actions do **not** have direct\n * database access (`ctx.db` is not available). Instead, use `ctx.runQuery`\n * and `ctx.runMutation` to read and write data.\n *\n * You should generally use the `action` function from\n * `\"./_generated/server\"`.\n *\n * Actions are accessible from the client and run outside of the database\n * transaction, so they are not atomic. They are best for integrating with\n * external services.\n *\n * @example\n * ```typescript\n * // Add \"use node\"; at the top of the file if using Node.js built-in modules.\n * import { action } from \"./_generated/server\";\n * import { v } from \"convex/values\";\n * import { internal } from \"./_generated/api\";\n *\n * export const generateSummary = action({\n * args: { text: v.string() },\n * returns: v.string(),\n * handler: async (ctx, args) => {\n * // Call an external API:\n * const response = await fetch(\"https://api.example.com/summarize\", {\n * method: \"POST\",\n * body: JSON.stringify({ text: args.text }),\n * });\n * const { summary } = await response.json();\n *\n * // Write results back via a mutation:\n * await ctx.runMutation(internal.myModule.saveSummary, {\n * text: args.text,\n * summary,\n * });\n *\n * return summary;\n * },\n * });\n * ```\n *\n * **Best practice:** Minimize the number of `ctx.runQuery` and\n * `ctx.runMutation` calls from actions. Each call is a separate transaction,\n * so splitting logic across multiple calls introduces the risk of race\n * conditions. Try to batch reads/writes into single query/mutation calls.\n *\n * **`\"use node\"` runtime:** Actions run in Convex's default JavaScript\n * runtime, which supports `fetch` and most NPM packages. Only add\n * `\"use node\";` at the top of the file if a third-party library specifically\n * requires Node.js built-in APIs, it is a last resort, not the default.\n * Node.js actions have slower cold starts, and **only actions can be defined\n * in `\"use node\"` files** (no queries or mutations), so prefer the default\n * runtime whenever possible.\n *\n * **Common mistake:** Do not try to access `ctx.db` in an action, it is\n * not available. Use `ctx.runQuery` and `ctx.runMutation` instead.\n *\n * @param func - The function. It receives a {@link GenericActionCtx} as its first argument.\n * @returns The wrapped function. Include this as an `export` to name it and make it accessible.\n *\n * @see https://docs.convex.dev/functions/actions\n * @public\n */\nexport const actionGeneric: ActionBuilder<any, \"public\"> = ((\n functionDefinition: FunctionDefinition,\n) => {\n const handler = (\n typeof functionDefinition === \"function\"\n ? functionDefinition\n : functionDefinition.handler\n ) as (ctx: GenericActionCtx<any>, args: any) => any;\n const func = dontCallDirectly(\"action\", handler) as RegisteredAction<\n \"public\",\n any,\n any\n >;\n\n assertNotBrowser();\n func.isAction = true;\n func.isPublic = true;\n func.invokeAction = (requestId, argsStr) =>\n invokeAction(handler, requestId, argsStr, \"public\");\n func.exportArgs = exportArgs(functionDefinition);\n func.exportReturns = exportReturns(functionDefinition);\n func._handler = handler;\n return func;\n}) as ActionBuilder<any, \"public\">;\n\n/**\n * Define an action that is only accessible from other Convex functions (but not from the client).\n *\n * You should generally use the `internalAction` function from\n * `\"./_generated/server\"`.\n *\n * Internal actions behave like public actions (they can call external APIs and\n * use Node.js libraries) but are **not** exposed in your app's public API. They\n * can only be called by other Convex functions using `ctx.runAction` or via the\n * scheduler.\n *\n * @example\n * ```typescript\n * import { internalAction } from \"./_generated/server\";\n * import { v } from \"convex/values\";\n *\n * export const sendEmail = internalAction({\n * args: { to: v.string(), subject: v.string(), body: v.string() },\n * returns: v.null(),\n * handler: async (ctx, args) => {\n * // Call an external email service (fetch works in the default runtime):\n * await fetch(\"https://api.email-service.com/send\", {\n * method: \"POST\",\n * headers: { \"Content-Type\": \"application/json\" },\n * body: JSON.stringify(args),\n * });\n * return null;\n * },\n * });\n * ```\n *\n * **Best practice:** Use `internalAction` for background work scheduled from\n * mutations: `await ctx.scheduler.runAfter(0, internal.myModule.sendEmail, { ... })`.\n * Only use `ctx.runAction` from another action if you need to cross runtimes\n * (e.g., default Convex runtime to Node.js). Otherwise, extract shared code\n * into a helper function.\n *\n * **`\"use node\"` runtime:** Only add `\"use node\";` at the top of the file\n * as a last resort when a third-party library requires Node.js APIs. Node.js\n * actions have slower cold starts, and **only actions can be defined in\n * `\"use node\"` files** (no queries or mutations).\n *\n * @param func - The function. It receives a {@link GenericActionCtx} as its first argument.\n * @returns The wrapped function. Include this as an `export` to name it and make it accessible.\n *\n * @see https://docs.convex.dev/functions/internal-functions\n * @public\n */\nexport const internalActionGeneric: ActionBuilder<any, \"internal\"> = ((\n functionDefinition: FunctionDefinition,\n) => {\n const handler = (\n typeof functionDefinition === \"function\"\n ? functionDefinition\n : functionDefinition.handler\n ) as (ctx: GenericActionCtx<any>, args: any) => any;\n const func = dontCallDirectly(\"internalAction\", handler) as RegisteredAction<\n \"internal\",\n any,\n any\n >;\n\n assertNotBrowser();\n func.isAction = true;\n func.isInternal = true;\n func.invokeAction = (requestId, argsStr) =>\n invokeAction(handler, requestId, argsStr, \"internal\");\n func.exportArgs = exportArgs(functionDefinition);\n func.exportReturns = exportReturns(functionDefinition);\n func._handler = handler;\n return func;\n}) as ActionBuilder<any, \"internal\">;\n\nasync function invokeHttpAction<\n F extends (ctx: GenericActionCtx<GenericDataModel>, request: Request) => any,\n>(func: F, request: Request) {\n (globalThis as any).Convex?.setupPerformance?.();\n // TODO(presley): Change the function signature and propagate the requestId from Rust.\n // Ok, to mock it out for now, since http endpoints are only running in V8.\n const requestId = \"\";\n const calls = setupActionCalls(requestId);\n const ctx = {\n ...calls,\n auth: setupAuth(requestId),\n storage: setupStorageActionWriter(requestId),\n scheduler: setupActionScheduler(requestId),\n vectorSearch: setupActionVectorSearch(requestId) as any,\n meta: setupActionMeta(\"public\"),\n };\n return await invokeFunction(func, ctx, [request]);\n}\n\n/**\n * Define a Convex HTTP action.\n *\n * HTTP actions handle raw HTTP requests and return HTTP responses. They are\n * registered by routing URL paths to them in `convex/http.ts` using\n * {@link HttpRouter}. Like regular actions, they can call external APIs and\n * use `ctx.runQuery` / `ctx.runMutation` but do not have direct `ctx.db` access.\n *\n * @example\n * ```typescript\n * // convex/http.ts\n * import { httpRouter } from \"convex/server\";\n * import { httpAction } from \"./_generated/server\";\n *\n * const http = httpRouter();\n *\n * http.route({\n * path: \"/api/webhook\",\n * method: \"POST\",\n * handler: httpAction(async (ctx, request) => {\n * const body = await request.json();\n * // Process the webhook payload...\n * return new Response(JSON.stringify({ ok: true }), {\n * status: 200,\n * headers: { \"Content-Type\": \"application/json\" },\n * });\n * }),\n * });\n *\n * export default http;\n * ```\n *\n * **Best practice:** HTTP actions are registered at the exact path specified.\n * For example, `path: \"/api/webhook\"` registers at `/api/webhook`.\n *\n * @param func - The function. It receives a {@link GenericActionCtx} as its first argument, and a `Request` object\n * as its second.\n * @returns The wrapped function. Route a URL path to this function in `convex/http.ts`.\n *\n * @see https://docs.convex.dev/functions/http-actions\n * @public\n */\nexport const httpActionGeneric = (\n func: (\n ctx: GenericActionCtx<GenericDataModel>,\n request: Request,\n ) => Promise<Response>,\n): PublicHttpAction => {\n const q = dontCallDirectly(\"httpAction\", func) as PublicHttpAction;\n assertNotBrowser();\n q.isHttp = true;\n q.invokeHttpAction = (request) => invokeHttpAction(func as any, request);\n q._handler = func;\n return q;\n};\n\nasync function runUdf(\n udfType: \"query\" | \"mutation\" | \"snapshotQuery\",\n f: any,\n args?: Record<string, Value>,\n transactionLimits?: Record<string, number>,\n): Promise<any> {\n const queryArgs = parseArgs(args);\n const syscallArgs: Record<string, any> = {\n udfType,\n args: convexToJson(queryArgs),\n ...getFunctionAddress(f),\n };\n if (transactionLimits) {\n syscallArgs.transactionLimits = transactionLimits;\n }\n const result = await performAsyncSyscall(\"1.0/runUdf\", syscallArgs);\n return jsonToConvex(result);\n}\n"],
|
|
5
|
+
"mappings": ";AAAA;AAAA,EAEE;AAAA,EAEA;AAAA,EACA;AAAA,OAGK;AAgBP,SAAS,wBAAwB;AACjC,SAAS,+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,OACb,SACA,GACA,MACA,mBACc;AACd,QAAM,YAAY,UAAU,IAAI;AAChC,QAAM,cAAmC;AAAA,IACvC;AAAA,IACA,MAAM,aAAa,SAAS;AAAA,IAC5B,GAAG,mBAAmB,CAAC;AAAA,EACzB;AACA,MAAI,mBAAmB;AACrB,gBAAY,oBAAoB;AAAA,EAClC;AACA,QAAM,SAAS,MAAM,oBAAoB,cAAc,WAAW;AAClE,SAAO,aAAa,MAAM;AAC5B;",
|
|
6
6
|
"names": ["args", "v"]
|
|
7
7
|
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../src/server/index.ts"],
|
|
4
|
-
"sourcesContent": ["/**\n * Utilities for implementing server-side Convex query and mutation functions.\n *\n * ## Usage\n *\n * ### Code Generation\n *\n * This module is typically used alongside generated server code.\n *\n * To generate the server code, run `npx convex dev` in your Convex project.\n * This will create a `convex/_generated/server.js` file with the following\n * functions, typed for your schema:\n * - [query](https://docs.convex.dev/generated-api/server#query)\n * - [mutation](https://docs.convex.dev/generated-api/server#mutation)\n *\n * If you aren't using TypeScript and code generation, you can use these untyped\n * functions instead:\n * - {@link queryGeneric}\n * - {@link mutationGeneric}\n *\n * ### Example\n *\n * Convex functions are defined by using either the `query` or\n * `mutation` wrappers.\n *\n * Queries receive a `db` that implements the {@link GenericDatabaseReader} interface.\n *\n * ```js\n * import { query } from \"./_generated/server\";\n *\n * export default query({\n * handler: async ({ db }, { arg1, arg2 }) => {\n * // Your (read-only) code here!\n * },\n * });\n * ```\n *\n * If your function needs to write to the database, such as inserting, updating,\n * or deleting documents, use `mutation` instead which provides a `db` that\n * implements the {@link GenericDatabaseWriter} interface.\n *\n * ```js\n * import { mutation } from \"./_generated/server\";\n *\n * export default mutation({\n * handler: async ({ db }, { arg1, arg2 }) => {\n * // Your mutation code here!\n * },\n * });\n * ```\n * @module\n */\n\nexport type {\n Auth,\n AuthConfig,\n AuthProvider,\n UserIdentity,\n UserIdentityAttributes,\n} from \"./authentication.js\";\nexport * from \"./database.js\";\nexport type {\n GenericDocument,\n GenericFieldPaths,\n GenericIndexFields,\n GenericTableIndexes,\n GenericSearchIndexConfig,\n GenericTableSearchIndexes,\n GenericVectorIndexConfig,\n GenericTableVectorIndexes,\n FieldTypeFromFieldPath,\n FieldTypeFromFieldPathInner,\n GenericTableInfo,\n DocumentByInfo,\n FieldPaths,\n Indexes,\n IndexNames,\n NamedIndex,\n SearchIndexes,\n SearchIndexNames,\n NamedSearchIndex,\n VectorIndexes,\n VectorIndexNames,\n NamedVectorIndex,\n GenericDataModel,\n AnyDataModel,\n TableNamesInDataModel,\n NamedTableInfo,\n DocumentByName,\n} from \"./data_model.js\";\n\nexport type {\n Expression,\n ExpressionOrValue,\n FilterBuilder,\n} from \"./filter_builder.js\";\nexport {\n actionGeneric,\n httpActionGeneric,\n mutationGeneric,\n queryGeneric,\n internalActionGeneric,\n internalMutationGeneric,\n internalQueryGeneric,\n} from \"./impl/registration_impl.js\";\nexport type {\n TransactionMetric,\n TransactionMetrics,\n FunctionMetadata,\n DeploymentMetadata,\n RequestMetadata,\n QueryMeta,\n MutationMeta,\n ActionMeta,\n} from \"./meta.js\";\nexport type { IndexRange, IndexRangeBuilder } from \"./index_range_builder.js\";\nexport * from \"./pagination.js\";\nexport type { OrderedQuery, Query, QueryInitializer } from \"./query.js\";\nexport type {\n ArgsArray,\n DefaultFunctionArgs,\n FunctionVisibility,\n ActionBuilder,\n MutationBuilder,\n MutationBuilderWithTable,\n QueryBuilder,\n QueryBuilderWithTable,\n HttpActionBuilder,\n GenericActionCtx,\n GenericMutationCtx,\n GenericMutationCtxWithTable,\n GenericQueryCtx,\n GenericQueryCtxWithTable,\n RegisteredAction,\n RegisteredMutation,\n RegisteredQuery,\n PublicHttpAction,\n UnvalidatedFunction,\n ValidatedFunction,\n ReturnValueForOptionalValidator,\n ArgsArrayForOptionalValidator,\n ArgsArrayToObject,\n DefaultArgsForOptionalValidator,\n} from \"./registration.js\";\nexport * from \"./search_filter_builder.js\";\nexport * from \"./storage.js\";\nexport type { Scheduler, SchedulableFunctionReference } from \"./scheduler.js\";\nexport { cronJobs } from \"./cron.js\";\nexport type { CronJob, Crons } from \"./cron.js\";\nexport type {\n SystemFields,\n IdField,\n WithoutSystemFields,\n WithOptionalSystemFields,\n SystemIndexes,\n IndexTiebreakerField,\n} from \"./system_fields.js\";\nexport { httpRouter, HttpRouter, ROUTABLE_HTTP_METHODS } from \"./router.js\";\nexport type {\n RoutableMethod,\n RouteSpec,\n RouteSpecWithPath,\n RouteSpecWithPathPrefix,\n} from \"./router.js\";\nexport {\n anyApi,\n getFunctionName,\n makeFunctionReference,\n filterApi,\n} from \"./api.js\";\nexport type {\n ApiFromModules,\n AnyApi,\n FilterApi,\n FunctionType,\n FunctionReference,\n FunctionArgs,\n OptionalRestArgs,\n PartialApi,\n ArgsAndOptions,\n FunctionReturnType,\n ValidatorTypeToReturnType,\n} from \"./api.js\";\nexport {\n defineApp,\n defineComponent,\n componentsGeneric,\n createFunctionHandle,\n type AnyChildComponents,\n type EnvDefinition,\n type EnvFromDefinition,\n type EnvFromAppDefinition,\n type AppDefinition,\n} from \"./components/index.js\";\n/**\n * @internal\n */\nexport { currentSystemUdfInComponent } from \"./components/index.js\";\nexport { getFunctionAddress } from \"./components/index.js\";\nexport type {\n ComponentDefinition,\n AnyComponents,\n FunctionHandle,\n} from \"./components/index.js\";\n\n/**\n * @internal\n */\nexport type { Index, SearchIndex, VectorIndex } from \"./schema.js\";\n\nexport { log } from \"./log.js\";\nexport type { AuditLogBody, AuditLogValue } from \"./audit_logging.js\";\n\nexport type {\n SearchIndexConfig,\n VectorIndexConfig,\n TableDefinition,\n SchemaDefinition,\n DefineSchemaOptions,\n GenericSchema,\n DataModelFromSchemaDefinition,\n SystemDataModel,\n SystemTableNames,\n} from \"./schema.js\";\nexport { defineTable, defineSchema } from \"./schema.js\";\n\nexport type {\n VectorSearch,\n VectorSearchQuery,\n VectorFilterBuilder,\n FilterExpression,\n} from \"./vector_search.js\";\n\n/**\n * @public\n */\nexport type { BetterOmit, Expand } from \"../type_utils.js\";\n"],
|
|
5
|
-
"mappings": ";AA4DA,cAAc;AAoCd;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,OACK;
|
|
4
|
+
"sourcesContent": ["/**\n * Utilities for implementing server-side Convex query and mutation functions.\n *\n * ## Usage\n *\n * ### Code Generation\n *\n * This module is typically used alongside generated server code.\n *\n * To generate the server code, run `npx convex dev` in your Convex project.\n * This will create a `convex/_generated/server.js` file with the following\n * functions, typed for your schema:\n * - [query](https://docs.convex.dev/generated-api/server#query)\n * - [mutation](https://docs.convex.dev/generated-api/server#mutation)\n *\n * If you aren't using TypeScript and code generation, you can use these untyped\n * functions instead:\n * - {@link queryGeneric}\n * - {@link mutationGeneric}\n *\n * ### Example\n *\n * Convex functions are defined by using either the `query` or\n * `mutation` wrappers.\n *\n * Queries receive a `db` that implements the {@link GenericDatabaseReader} interface.\n *\n * ```js\n * import { query } from \"./_generated/server\";\n *\n * export default query({\n * handler: async ({ db }, { arg1, arg2 }) => {\n * // Your (read-only) code here!\n * },\n * });\n * ```\n *\n * If your function needs to write to the database, such as inserting, updating,\n * or deleting documents, use `mutation` instead which provides a `db` that\n * implements the {@link GenericDatabaseWriter} interface.\n *\n * ```js\n * import { mutation } from \"./_generated/server\";\n *\n * export default mutation({\n * handler: async ({ db }, { arg1, arg2 }) => {\n * // Your mutation code here!\n * },\n * });\n * ```\n * @module\n */\n\nexport type {\n Auth,\n AuthConfig,\n AuthProvider,\n UserIdentity,\n UserIdentityAttributes,\n} from \"./authentication.js\";\nexport * from \"./database.js\";\nexport type {\n GenericDocument,\n GenericFieldPaths,\n GenericIndexFields,\n GenericTableIndexes,\n GenericSearchIndexConfig,\n GenericTableSearchIndexes,\n GenericVectorIndexConfig,\n GenericTableVectorIndexes,\n FieldTypeFromFieldPath,\n FieldTypeFromFieldPathInner,\n GenericTableInfo,\n DocumentByInfo,\n FieldPaths,\n Indexes,\n IndexNames,\n NamedIndex,\n SearchIndexes,\n SearchIndexNames,\n NamedSearchIndex,\n VectorIndexes,\n VectorIndexNames,\n NamedVectorIndex,\n GenericDataModel,\n AnyDataModel,\n TableNamesInDataModel,\n NamedTableInfo,\n DocumentByName,\n} from \"./data_model.js\";\n\nexport type {\n Expression,\n ExpressionOrValue,\n FilterBuilder,\n} from \"./filter_builder.js\";\nexport {\n actionGeneric,\n httpActionGeneric,\n mutationGeneric,\n queryGeneric,\n internalActionGeneric,\n internalMutationGeneric,\n internalQueryGeneric,\n} from \"./impl/registration_impl.js\";\nexport type {\n TransactionMetric,\n TransactionMetrics,\n TransactionLimits,\n FunctionMetadata,\n DeploymentMetadata,\n RequestMetadata,\n QueryMeta,\n MutationMeta,\n ActionMeta,\n} from \"./meta.js\";\nexport type { IndexRange, IndexRangeBuilder } from \"./index_range_builder.js\";\nexport * from \"./pagination.js\";\nexport type { OrderedQuery, Query, QueryInitializer } from \"./query.js\";\nexport type {\n ArgsArray,\n DefaultFunctionArgs,\n FunctionVisibility,\n ActionBuilder,\n MutationBuilder,\n MutationBuilderWithTable,\n QueryBuilder,\n QueryBuilderWithTable,\n HttpActionBuilder,\n GenericActionCtx,\n GenericMutationCtx,\n GenericMutationCtxWithTable,\n GenericQueryCtx,\n GenericQueryCtxWithTable,\n RegisteredAction,\n RegisteredMutation,\n RegisteredQuery,\n PublicHttpAction,\n UnvalidatedFunction,\n ValidatedFunction,\n ReturnValueForOptionalValidator,\n ArgsArrayForOptionalValidator,\n ArgsArrayToObject,\n DefaultArgsForOptionalValidator,\n} from \"./registration.js\";\nexport * from \"./search_filter_builder.js\";\nexport * from \"./storage.js\";\nexport type { Scheduler, SchedulableFunctionReference } from \"./scheduler.js\";\nexport { cronJobs } from \"./cron.js\";\nexport type { CronJob, Crons } from \"./cron.js\";\nexport type {\n SystemFields,\n IdField,\n WithoutSystemFields,\n WithOptionalSystemFields,\n SystemIndexes,\n IndexTiebreakerField,\n} from \"./system_fields.js\";\nexport { httpRouter, HttpRouter, ROUTABLE_HTTP_METHODS } from \"./router.js\";\nexport type {\n RoutableMethod,\n RouteSpec,\n RouteSpecWithPath,\n RouteSpecWithPathPrefix,\n} from \"./router.js\";\nexport {\n anyApi,\n getFunctionName,\n makeFunctionReference,\n filterApi,\n} from \"./api.js\";\nexport type {\n ApiFromModules,\n AnyApi,\n FilterApi,\n FunctionType,\n FunctionReference,\n FunctionArgs,\n OptionalRestArgs,\n PartialApi,\n ArgsAndOptions,\n FunctionReturnType,\n ValidatorTypeToReturnType,\n} from \"./api.js\";\nexport {\n defineApp,\n defineComponent,\n componentsGeneric,\n createFunctionHandle,\n type AnyChildComponents,\n type EnvDefinition,\n type EnvFromDefinition,\n type EnvFromAppDefinition,\n type AppDefinition,\n} from \"./components/index.js\";\n/**\n * @internal\n */\nexport { currentSystemUdfInComponent } from \"./components/index.js\";\nexport { getFunctionAddress } from \"./components/index.js\";\nexport type {\n ComponentDefinition,\n AnyComponents,\n FunctionHandle,\n} from \"./components/index.js\";\n\n/**\n * @internal\n */\nexport type { Index, SearchIndex, VectorIndex } from \"./schema.js\";\n\nexport { log } from \"./log.js\";\nexport type { AuditLogBody, AuditLogValue } from \"./audit_logging.js\";\n\nexport type {\n SearchIndexConfig,\n VectorIndexConfig,\n TableDefinition,\n SchemaDefinition,\n DefineSchemaOptions,\n GenericSchema,\n DataModelFromSchemaDefinition,\n SystemDataModel,\n SystemTableNames,\n} from \"./schema.js\";\nexport { defineTable, defineSchema } from \"./schema.js\";\n\nexport type {\n VectorSearch,\n VectorSearchQuery,\n VectorFilterBuilder,\n FilterExpression,\n} from \"./vector_search.js\";\n\n/**\n * @public\n */\nexport type { BetterOmit, Expand } from \"../type_utils.js\";\n"],
|
|
5
|
+
"mappings": ";AA4DA,cAAc;AAoCd;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,OACK;AAaP,cAAc;AA4Bd,cAAc;AACd,cAAc;AAEd,SAAS,gBAAgB;AAUzB,SAAS,YAAY,YAAY,6BAA6B;AAO9D;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,OACK;AAcP;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,OAMK;AAIP,SAAS,mCAAmC;AAC5C,SAAS,0BAA0B;AAYnC,SAAS,WAAW;AAcpB,SAAS,aAAa,oBAAoB;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
|
@@ -31,9 +31,10 @@ type ConfigureCmdOptions = {
|
|
|
31
31
|
/**
|
|
32
32
|
* As of writing, this is used by:
|
|
33
33
|
* - `npx convex dev`
|
|
34
|
-
* - `npx convex
|
|
34
|
+
* - `npx convex init`
|
|
35
35
|
*
|
|
36
|
-
* But is not used by `npx convex deploy`
|
|
36
|
+
* But is not used by `npx convex deploy`, `npx convex codegen`,
|
|
37
|
+
* `npx convex env`, or other commands.
|
|
37
38
|
*/
|
|
38
39
|
export declare function deploymentCredentialsOrConfigure(ctx: Context, deploymentSelection: DeploymentSelection, chosenConfiguration: ChosenConfiguration, cmdOptions: ConfigureCmdOptions): Promise<DeploymentCredentials & {
|
|
39
40
|
deploymentFields: {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"configure.d.ts","sourceRoot":"","sources":["../../../src/cli/configure.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,OAAO,EAAE,MAAM,uBAAuB,CAAC;AAQhD,OAAO,EACL,cAAc,EACd,cAAc,EAMf,MAAM,cAAc,CAAC;AA6BtB,OAAO,EACL,mBAAmB,EAGpB,MAAM,8BAA8B,CAAC;AAItC,KAAK,qBAAqB,GAAG;IAC3B,GAAG,EAAE,MAAM,CAAC;IACZ,QAAQ,EAAE,MAAM,CAAC;CAClB,CAAC;AAEF,KAAK,mBAAmB,GAEpB,KAAK,GAEL,UAAU,GAEV,KA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Ac,EAAE,MAAM,CAAC;IACvB,QAAQ,EAAE,MAAM,GAAG,IAAI,CAAC;IACxB,WAAW,EAAE,MAAM,GAAG,IAAI,CAAC;IAC3B,cAAc,EAAE,cAAc,CAAC;CAChC,EACD,aAAa,EAAE,MAAM,GAAG,IAAI,iBA2B7B"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"dashboard.d.ts","sourceRoot":"","sources":["../../../src/cli/dashboard.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,6BAA6B,CAAC;
|
|
1
|
+
{"version":3,"file":"dashboard.d.ts","sourceRoot":"","sources":["../../../src/cli/dashboard.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,6BAA6B,CAAC;AAWtD,eAAO,MAAM,SAAS;;;;;;;;;;MAoDlB,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"deploymentCreate.d.ts","sourceRoot":"","sources":["../../../src/cli/deploymentCreate.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,OAAO,EAAU,MAAM,6BAA6B,CAAC;AAC9D,OAAO,EAAE,OAAO,EAAiB,MAAM,uBAAuB,CAAC;AAO/D,OAAO,EACL,mBAAmB,
|
|
1
|
+
{"version":3,"file":"deploymentCreate.d.ts","sourceRoot":"","sources":["../../../src/cli/deploymentCreate.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,OAAO,EAAU,MAAM,6BAA6B,CAAC;AAC9D,OAAO,EAAE,OAAO,EAAiB,MAAM,uBAAuB,CAAC;AAO/D,OAAO,EACL,mBAAmB,EAKpB,MAAM,8BAA8B,CAAC;AAgCtC,eAAO,MAAM,gBAAgB;;;;;;;;;MAoNzB,CAAC;AAEL,wBAAsB,qBAAqB,CACzC,GAAG,EAAE,OAAO,EACZ,iBAAiB,EAAE,mBAAmB,EACtC,MAAM,EAAE,OAAO,EACf,cAAc,EAAE;IAAE,QAAQ,EAAE,MAAM,CAAC;IAAC,WAAW,EAAE,MAAM,CAAA;CAAE,GAAG,IAAI,GAC/D,OAAO,CAAC,IAAI,CAAC,CA2Gf;AAsZD,wBAAsB,qBAAqB,CAAC,GAAG,EAAE,OAAO,EAAE,MAAM,EAAE,MAAM;;;;KAYvE;AAED,KAAK,eAAe,GAAG,OAAO,CAC5B,UAAU,CAAC,OAAO,qBAAqB,CAAC,CACzC,CAAC,MAAM,CAAC,CAAC;AAEV,wBAAgB,oBAAoB,CAClC,gBAAgB,EAAE,eAAe,EAAE,EACnC,MAAM,EAAE,MAAM;;;;SAIf;AAuCD,wBAAsB,qBAAqB,CAAC,GAAG,EAAE,OAAO,EAAE,MAAM,EAAE,MAAM;;;KAYvE;AAED,KAAK,cAAc,GAAG,OAAO,CAAC,UAAU,CAAC,OAAO,qBAAqB,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC;AAEhF,wBAAgB,mBAAmB,CACjC,gBAAgB,EAAE,cAAc,EAAE,EAClC,SAAS,EAAE,MAAM;;;SAGlB"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"deploymentTokenCreate.d.ts","sourceRoot":"","sources":["../../../src/cli/deploymentTokenCreate.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,6BAA6B,CAAC;
|
|
1
|
+
{"version":3,"file":"deploymentTokenCreate.d.ts","sourceRoot":"","sources":["../../../src/cli/deploymentTokenCreate.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,6BAA6B,CAAC;AAgBtD,eAAO,MAAM,qBAAqB;;;;;;;;;;MA0F9B,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"deploymentTokenDelete.d.ts","sourceRoot":"","sources":["../../../src/cli/deploymentTokenDelete.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,6BAA6B,CAAC;
|
|
1
|
+
{"version":3,"file":"deploymentTokenDelete.d.ts","sourceRoot":"","sources":["../../../src/cli/deploymentTokenDelete.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,6BAA6B,CAAC;AAYtD,eAAO,MAAM,qBAAqB;;;;;;;;MA2E9B,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"dev.d.ts","sourceRoot":"","sources":["../../../src/cli/dev.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAU,MAAM,6BAA6B,CAAC;AAkB9D,eAAO,MAAM,GAAG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
|
1
|
+
{"version":3,"file":"dev.d.ts","sourceRoot":"","sources":["../../../src/cli/dev.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAU,MAAM,6BAA6B,CAAC;AAkB9D,eAAO,MAAM,GAAG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;MAqRZ,CAAC"}
|
|
@@ -77,6 +77,7 @@ export declare const appDefinitionConfig: z.ZodObject<{
|
|
|
77
77
|
source: string;
|
|
78
78
|
sourceMap?: string | undefined;
|
|
79
79
|
} | null;
|
|
80
|
+
udfServerVersion: string;
|
|
80
81
|
changedModules: {
|
|
81
82
|
path: string;
|
|
82
83
|
environment: "node" | "isolate";
|
|
@@ -88,7 +89,6 @@ export declare const appDefinitionConfig: z.ZodObject<{
|
|
|
88
89
|
path: string;
|
|
89
90
|
environment: "node" | "isolate";
|
|
90
91
|
}[];
|
|
91
|
-
udfServerVersion: string;
|
|
92
92
|
}, {
|
|
93
93
|
definition: {
|
|
94
94
|
path: string;
|
|
@@ -103,6 +103,7 @@ export declare const appDefinitionConfig: z.ZodObject<{
|
|
|
103
103
|
source: string;
|
|
104
104
|
sourceMap?: string | undefined;
|
|
105
105
|
} | null;
|
|
106
|
+
udfServerVersion: string;
|
|
106
107
|
changedModules: {
|
|
107
108
|
path: string;
|
|
108
109
|
environment: "node" | "isolate";
|
|
@@ -114,7 +115,6 @@ export declare const appDefinitionConfig: z.ZodObject<{
|
|
|
114
115
|
path: string;
|
|
115
116
|
environment: "node" | "isolate";
|
|
116
117
|
}[];
|
|
117
|
-
udfServerVersion: string;
|
|
118
118
|
}>;
|
|
119
119
|
export type AppDefinitionConfig = z.infer<typeof appDefinitionConfig>;
|
|
120
120
|
export declare const componentDefinitionConfig: z.ZodObject<{
|
|
@@ -189,8 +189,8 @@ export declare const componentDefinitionConfig: z.ZodObject<{
|
|
|
189
189
|
source: string;
|
|
190
190
|
sourceMap?: string | undefined;
|
|
191
191
|
}[];
|
|
192
|
-
definitionPath: string;
|
|
193
192
|
udfServerVersion: string;
|
|
193
|
+
definitionPath: string;
|
|
194
194
|
}, {
|
|
195
195
|
definition: {
|
|
196
196
|
path: string;
|
|
@@ -211,8 +211,8 @@ export declare const componentDefinitionConfig: z.ZodObject<{
|
|
|
211
211
|
source: string;
|
|
212
212
|
sourceMap?: string | undefined;
|
|
213
213
|
}[];
|
|
214
|
-
definitionPath: string;
|
|
215
214
|
udfServerVersion: string;
|
|
215
|
+
definitionPath: string;
|
|
216
216
|
}>;
|
|
217
217
|
export type ComponentDefinitionConfig = z.infer<typeof componentDefinitionConfig>;
|
|
218
218
|
//# sourceMappingURL=definitionConfig.d.ts.map
|
|
@@ -81,6 +81,7 @@ export declare const startPushRequest: z.ZodObject<{
|
|
|
81
81
|
source: string;
|
|
82
82
|
sourceMap?: string | undefined;
|
|
83
83
|
} | null;
|
|
84
|
+
udfServerVersion: string;
|
|
84
85
|
changedModules: {
|
|
85
86
|
path: string;
|
|
86
87
|
environment: "node" | "isolate";
|
|
@@ -92,7 +93,6 @@ export declare const startPushRequest: z.ZodObject<{
|
|
|
92
93
|
path: string;
|
|
93
94
|
environment: "node" | "isolate";
|
|
94
95
|
}[];
|
|
95
|
-
udfServerVersion: string;
|
|
96
96
|
}, {
|
|
97
97
|
definition: {
|
|
98
98
|
path: string;
|
|
@@ -107,6 +107,7 @@ export declare const startPushRequest: z.ZodObject<{
|
|
|
107
107
|
source: string;
|
|
108
108
|
sourceMap?: string | undefined;
|
|
109
109
|
} | null;
|
|
110
|
+
udfServerVersion: string;
|
|
110
111
|
changedModules: {
|
|
111
112
|
path: string;
|
|
112
113
|
environment: "node" | "isolate";
|
|
@@ -118,7 +119,6 @@ export declare const startPushRequest: z.ZodObject<{
|
|
|
118
119
|
path: string;
|
|
119
120
|
environment: "node" | "isolate";
|
|
120
121
|
}[];
|
|
121
|
-
udfServerVersion: string;
|
|
122
122
|
}>;
|
|
123
123
|
componentDefinitions: z.ZodArray<z.ZodObject<{
|
|
124
124
|
definitionPath: z.ZodString;
|
|
@@ -192,8 +192,8 @@ export declare const startPushRequest: z.ZodObject<{
|
|
|
192
192
|
source: string;
|
|
193
193
|
sourceMap?: string | undefined;
|
|
194
194
|
}[];
|
|
195
|
-
definitionPath: string;
|
|
196
195
|
udfServerVersion: string;
|
|
196
|
+
definitionPath: string;
|
|
197
197
|
}, {
|
|
198
198
|
definition: {
|
|
199
199
|
path: string;
|
|
@@ -214,8 +214,8 @@ export declare const startPushRequest: z.ZodObject<{
|
|
|
214
214
|
source: string;
|
|
215
215
|
sourceMap?: string | undefined;
|
|
216
216
|
}[];
|
|
217
|
-
definitionPath: string;
|
|
218
217
|
udfServerVersion: string;
|
|
218
|
+
definitionPath: string;
|
|
219
219
|
}>, "many">;
|
|
220
220
|
nodeDependencies: z.ZodArray<z.ZodObject<{
|
|
221
221
|
name: z.ZodString;
|
|
@@ -231,6 +231,10 @@ export declare const startPushRequest: z.ZodObject<{
|
|
|
231
231
|
}, "passthrough", z.ZodTypeAny, {
|
|
232
232
|
dryRun: boolean;
|
|
233
233
|
functions: string;
|
|
234
|
+
nodeDependencies: {
|
|
235
|
+
name: string;
|
|
236
|
+
version: string;
|
|
237
|
+
}[];
|
|
234
238
|
adminKey: string;
|
|
235
239
|
appDefinition: {
|
|
236
240
|
definition: {
|
|
@@ -246,6 +250,7 @@ export declare const startPushRequest: z.ZodObject<{
|
|
|
246
250
|
source: string;
|
|
247
251
|
sourceMap?: string | undefined;
|
|
248
252
|
} | null;
|
|
253
|
+
udfServerVersion: string;
|
|
249
254
|
changedModules: {
|
|
250
255
|
path: string;
|
|
251
256
|
environment: "node" | "isolate";
|
|
@@ -257,7 +262,6 @@ export declare const startPushRequest: z.ZodObject<{
|
|
|
257
262
|
path: string;
|
|
258
263
|
environment: "node" | "isolate";
|
|
259
264
|
}[];
|
|
260
|
-
udfServerVersion: string;
|
|
261
265
|
};
|
|
262
266
|
componentDefinitions: {
|
|
263
267
|
definition: {
|
|
@@ -279,17 +283,17 @@ export declare const startPushRequest: z.ZodObject<{
|
|
|
279
283
|
source: string;
|
|
280
284
|
sourceMap?: string | undefined;
|
|
281
285
|
}[];
|
|
282
|
-
definitionPath: string;
|
|
283
286
|
udfServerVersion: string;
|
|
284
|
-
|
|
285
|
-
nodeDependencies: {
|
|
286
|
-
name: string;
|
|
287
|
-
version: string;
|
|
287
|
+
definitionPath: string;
|
|
288
288
|
}[];
|
|
289
289
|
nodeVersion?: string | undefined;
|
|
290
290
|
}, {
|
|
291
291
|
dryRun: boolean;
|
|
292
292
|
functions: string;
|
|
293
|
+
nodeDependencies: {
|
|
294
|
+
name: string;
|
|
295
|
+
version: string;
|
|
296
|
+
}[];
|
|
293
297
|
adminKey: string;
|
|
294
298
|
appDefinition: {
|
|
295
299
|
definition: {
|
|
@@ -305,6 +309,7 @@ export declare const startPushRequest: z.ZodObject<{
|
|
|
305
309
|
source: string;
|
|
306
310
|
sourceMap?: string | undefined;
|
|
307
311
|
} | null;
|
|
312
|
+
udfServerVersion: string;
|
|
308
313
|
changedModules: {
|
|
309
314
|
path: string;
|
|
310
315
|
environment: "node" | "isolate";
|
|
@@ -316,7 +321,6 @@ export declare const startPushRequest: z.ZodObject<{
|
|
|
316
321
|
path: string;
|
|
317
322
|
environment: "node" | "isolate";
|
|
318
323
|
}[];
|
|
319
|
-
udfServerVersion: string;
|
|
320
324
|
};
|
|
321
325
|
componentDefinitions: {
|
|
322
326
|
definition: {
|
|
@@ -338,12 +342,8 @@ export declare const startPushRequest: z.ZodObject<{
|
|
|
338
342
|
source: string;
|
|
339
343
|
sourceMap?: string | undefined;
|
|
340
344
|
}[];
|
|
341
|
-
definitionPath: string;
|
|
342
345
|
udfServerVersion: string;
|
|
343
|
-
|
|
344
|
-
nodeDependencies: {
|
|
345
|
-
name: string;
|
|
346
|
-
version: string;
|
|
346
|
+
definitionPath: string;
|
|
347
347
|
}[];
|
|
348
348
|
nodeVersion?: string | undefined;
|
|
349
349
|
}>;
|
|
@@ -28,7 +28,6 @@ export declare function getTeamAndProjectFromPreviewAdminKey(ctx: Context, admin
|
|
|
28
28
|
teamSlug: string;
|
|
29
29
|
projectSlug: string;
|
|
30
30
|
}>;
|
|
31
|
-
export type OnDeploymentActivityFunc = (isOffline: boolean, wasOffline: boolean) => Promise<void>;
|
|
32
31
|
export type CleanupDeploymentFunc = () => Promise<void>;
|
|
33
32
|
export type DeploymentDetails = {
|
|
34
33
|
deploymentName: string;
|
|
@@ -36,6 +35,5 @@ export type DeploymentDetails = {
|
|
|
36
35
|
adminKey: string;
|
|
37
36
|
reference: string | null;
|
|
38
37
|
isDefault: boolean;
|
|
39
|
-
onActivity: OnDeploymentActivityFunc | null;
|
|
40
38
|
};
|
|
41
39
|
//# sourceMappingURL=deployment.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"deployment.d.ts","sourceRoot":"","sources":["../../../../src/cli/lib/deployment.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,OAAO,EAAE,MAAM,0BAA0B,CAAC;AAOnD,OAAO,EAAE,cAAc,EAAE,MAAM,UAAU,CAAC;AAK1C,wBAAgB,yBAAyB,CAAC,UAAU,EAAE,MAAM,UAE3D;AAGD,wBAAgB,yCAAyC,CAAC,GAAG,EAAE,MAAM,+CAUpE;AAED,wBAAgB,qBAAqB,CAAC,cAAc,EAAE,MAAM,WAE3D;AAED,wBAAgB,qBAA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AsB,iCAAiC,CACrD,GAAG,EAAE,OAAO,EACZ,QAAQ,EAAE,MAAM,mBAWjB;AAkBD,wBAAgB,kBAAkB,CAAC,QAAQ,EAAE,MAAM,WAQlD;AAED,wBAAgB,YAAY,CAAC,QAAQ,EAAE,MAAM,WAE5C;AAID,wBAAgB,eAAe,CAAC,QAAQ,EAAE,MAAM,WAE/C;AAUD,wBAAgB,0BAA0B,CAAC,QAAQ,EAAE,MAAM,kBAM1D;AAED,wBAAsB,oCAAoC,CACxD,GAAG,EAAE,OAAO,EACZ,QAAQ,EAAE,MAAM;;;GAajB;AAED,MAAM,MAAM,qBAAqB,GAAG,MAAM,OAAO,CAAC,IAAI,CAAC,CAAC;AACxD,MAAM,MAAM,iBAAiB,GAAG;IAC9B,cAAc,EAAE,MAAM,CAAC;IACvB,aAAa,EAAE,MAAM,CAAC;IACtB,QAAQ,EAAE,MAAM,CAAC;IACjB,SAAS,EAAE,MAAM,GAAG,IAAI,CAAC;IACzB,SAAS,EAAE,OAAO,CAAC;CACpB,CAAC"}
|
|
@@ -29,6 +29,13 @@ export declare function initializeBigBrainAuth(ctx: Context, initialArgs: {
|
|
|
29
29
|
}): Promise<void>;
|
|
30
30
|
export declare function updateBigBrainAuthAfterLogin(ctx: Context, accessToken: string): Promise<void>;
|
|
31
31
|
export declare function clearBigBrainAuth(ctx: Context): Promise<void>;
|
|
32
|
+
/** Crashes unless logged in with a personal access token (not a deploy key). */
|
|
33
|
+
export declare function ensureLoggedInWithAccessToken(ctx: Context, action: string): Promise<void>;
|
|
34
|
+
/**
|
|
35
|
+
* Crashes unless the auth can create a deployment: personal access tokens and
|
|
36
|
+
* project keys are accepted, deploy keys are not.
|
|
37
|
+
*/
|
|
38
|
+
export declare function ensureAuthCanCreateDeployment(ctx: Context): Promise<void>;
|
|
32
39
|
/**
|
|
33
40
|
* Our CLI has logic to select which deployment to act on.
|
|
34
41
|
*
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"deploymentSelection.d.ts","sourceRoot":"","sources":["../../../../src/cli/lib/deploymentSelection.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,sBAAsB,EAAE,MAAM,oCAAoC,CAAC;AAC5E,OAAO,EAAgB,OAAO,EAAE,MAAM,0BAA0B,CAAC;AAEjE,OAAO,EACL,6BAA6B,EAC7B,0BAA0B,EAC1B,gCAAgC,EAEhC,cAAc,EAIf,MAAM,UAAU,CAAC;
|
|
1
|
+
{"version":3,"file":"deploymentSelection.d.ts","sourceRoot":"","sources":["../../../../src/cli/lib/deploymentSelection.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,sBAAsB,EAAE,MAAM,oCAAoC,CAAC;AAC5E,OAAO,EAAgB,OAAO,EAAE,MAAM,0BAA0B,CAAC;AAEjE,OAAO,EACL,6BAA6B,EAC7B,0BAA0B,EAC1B,gCAAgC,EAEhC,cAAc,EAIf,MAAM,UAAU,CAAC;AAyClB;;;;;;;;;;;;;;;;;;;;GAoBG;AACH,wBAAsB,sBAAsB,CAC1C,GAAG,EAAE,OAAO,EACZ,WAAW,EAAE;IACX,GAAG,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;IACzB,QAAQ,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;IAC9B,OAAO,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;CAC9B,GACA,OAAO,CAAC,IAAI,CAAC,CAkEf;AAED,wBAAsB,4BAA4B,CAChD,GAAG,EAAE,OAAO,EACZ,WAAW,EAAE,MAAM,iBAcpB;AAED,wBAAsB,iBAAiB,CAAC,GAAG,EAAE,OAAO,iBAEnD;AAwDD,gFAAgF;AAChF,wBAAsB,6BAA6B,CACjD,GAAG,EAAE,OAAO,EACZ,MAAM,EAAE,MAAM,GACb,OAAO,CAAC,IAAI,CAAC,CAoBf;AAED;;;GAGG;AACH,wBAAsB,6BAA6B,CACjD,GAAG,EAAE,OAAO,GACX,OAAO,CAAC,IAAI,CAAC,CA2Bf;AAKD;;;;;;;;;;;;;;;;;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CAAC;CACtD,GACD;IACE,IAAI,EAAE,kBAAkB,CAAC;IACzB,gBAAgB,EAAE,MAAM,CAAC;CAC1B,CAAC;AAEN,wBAAsB,sBAAsB,CAC1C,GAAG,EAAE,OAAO,EACZ,OAAO,EAAE,0BAA0B,GAClC,OAAO,CAAC,mBAAmB,CAAC,CAa9B;AAifD;;;GAGG;AACH,eAAO,MAAM,2BAA2B,cAC3B,mBAAmB,KAC7B,MAAM,GAAG,IAEX,CAAC;AAEF,eAAO,MAAM,kCAAkC,cAClC,mBAAmB,KAC7B;IAAE,MAAM,MAAM,GAAG,IAAI,CAAC;IAAC,IAAI,EAAE,MAAM,GAAG,IAAI,CAAA;CAAE,GAAG,IAgCjD,CAAC;AAEF,eAAO,MAAM,+BAA+B,QAAO,OAMlD,CAAC;AAEF;;GAEG;AACH,wBAAsB,iBAAiB,CACrC,GAAG,EAAE,OAAO,EACZ,gBAAgB,EAAE,gBAAgB,GACjC,OAAO,CAAC,sBAAsB,CAAC,CA8DjC"}
|
|
@@ -7,6 +7,7 @@ export declare function devAgainstDeployment(ctx: OneoffCtx, credentials: {
|
|
|
7
7
|
adminKey: string;
|
|
8
8
|
deploymentName: string | null;
|
|
9
9
|
deploymentType?: DeploymentType;
|
|
10
|
+
backendVersion?: string | undefined;
|
|
10
11
|
}, devOptions: {
|
|
11
12
|
verbose: boolean;
|
|
12
13
|
typecheck: "enable" | "try" | "disable";
|
|
@@ -28,7 +29,7 @@ export declare function devAgainstDeployment(ctx: OneoffCtx, credentials: {
|
|
|
28
29
|
debugNodeApis: boolean;
|
|
29
30
|
liveComponentSources: boolean;
|
|
30
31
|
pushAllModules: boolean;
|
|
31
|
-
}): Promise<
|
|
32
|
+
}): Promise<undefined>;
|
|
32
33
|
export declare function watchAndPush(outerCtx: OneoffCtx, options: PushOptions, cmdOptions: {
|
|
33
34
|
run?: {
|
|
34
35
|
kind: "function";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"dev.d.ts","sourceRoot":"","sources":["../../../../src/cli/lib/dev.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,SAAS,EAAE,MAAM,0BAA0B,CAAC;AAarD,OAAO,EAAc,OAAO,EAAa,MAAM,WAAW,CAAC;AAC3D,OAAO,EAAE,WAAW,EAAE,MAAM,iBAAiB,CAAC;AAU9C,OAAO,EAAE,cAAc,EAAE,MAAM,UAAU,CAAC;
|
|
1
|
+
{"version":3,"file":"dev.d.ts","sourceRoot":"","sources":["../../../../src/cli/lib/dev.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,SAAS,EAAE,MAAM,0BAA0B,CAAC;AAarD,OAAO,EAAc,OAAO,EAAa,MAAM,WAAW,CAAC;AAC3D,OAAO,EAAE,WAAW,EAAE,MAAM,iBAAiB,CAAC;AAU9C,OAAO,EAAE,cAAc,EAAE,MAAM,UAAU,CAAC;AAU1C,wBAAsB,oBAAoB,CACxC,GAAG,EAAE,SAAS,EACd,WAAW,EAAE;IACX,GAAG,EAAE,MAAM,CAAC;IACZ,QAAQ,EAAE,MAAM,CAAC;IACjB,cAAc,EAAE,MAAM,GAAG,IAAI,CAAC;IAC9B,cAAc,CAAC,EAAE,cAAc,CAAC;IAChC,cAAc,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;CACrC,EACD,UAAU,EAAE;IACV,OAAO,EAAE,OAAO,CAAC;IACjB,SAAS,EAAE,QAAQ,GAAG,KAAK,GAAG,SAAS,CAAC;IACxC,mBAAmB,EAAE,OAAO,CAAC;IAC7B,OAAO,EAAE,OAAO,CAAC;IACjB,IAAI,EAAE,OAAO,CAAC;IACd,YAAY,EAAE,OAAO,CAAC;IACtB,GAAG,CAAC,EACA;QAAE,IAAI,EAAE,UAAU,CAAC;QAAC,IAAI,EAAE,MAAM,CAAC;QAAC,SAAS,CAAC,EAAE,MAAM,GAAG,SAAS,CAAA;KAAE,GAClE;QAAE,IAAI,EAAE,OAAO,CAAC;QAAC,OAAO,EAAE,MAAM,CAAA;KAAE,GAClC,SAAS,CAAC;IACd,QAAQ,EAAE,OAAO,CAAC;IAClB,WAAW,EAAE,OAAO,CAAC;IACrB,eAAe,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;IACrC,aAAa,EAAE,OAAO,CAAC;IACvB,oBAAoB,EAAE,OAAO,CAAC;IAC9B,cAAc,EAAE,OAAO,CAAC;CACzB,sBA+FF;AAED,wBAAsB,YAAY,CAChC,QAAQ,EAAE,SAAS,EACnB,OAAO,EAAE,WAAW,EACpB,UAAU,EAAE;IACV,GAAG,CAAC,EACA;QAAE,IAAI,EAAE,UAAU,CAAC;QAAC,IAAI,EAAE,MAAM,CAAC;QAAC,SAAS,CAAC,EAAE,MAAM,GAAG,SAAS,CAAA;KAAE,GAClE;QAAE,IAAI,EAAE,OAAO,CAAC;QAAC,OAAO,EAAE,MAAM,CAAA;KAAE,GAClC,SAAS,CAAC;IACd,IAAI,EAAE,OAAO,CAAC;IACd,YAAY,EAAE,OAAO,CAAC;IACtB,WAAW,EAAE,OAAO,CAAC;CACtB,iBA0RF;AAoND,wBAAgB,WAAW,CAAC,YAAY,EAAE,MAAM,GAAG,MAAM,CAKxD"}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import type { CommandUnknownOpts } from "@commander-js/extra-typings";
|
|
2
|
+
export type GeneratedDocs = Record<string, string>;
|
|
3
|
+
/**
|
|
4
|
+
* Generate Markdown reference docs for a Commander main command.
|
|
5
|
+
*
|
|
6
|
+
* Returns a map of file paths (relative, e.g. `env.mdx`) to Markdown
|
|
7
|
+
* contents. One file is generated for each visible main command (a direct
|
|
8
|
+
* child of the root); the root itself gets no page, so "Command Reference"
|
|
9
|
+
* is a sidebar section with no landing page. Descendant subcommands are
|
|
10
|
+
* rendered as sections inside their main command's file, with their heading
|
|
11
|
+
* level reflecting their depth: a direct subcommand (`env default`) is an
|
|
12
|
+
* `## h2`, a sub-subcommand (`env default set`) an `### h3`, and so on.
|
|
13
|
+
*
|
|
14
|
+
* Each page carries a `description` frontmatter equal to the command's
|
|
15
|
+
* summary; the `/cli` page reads these back via Docusaurus metadata to render
|
|
16
|
+
* the list of commands dynamically.
|
|
17
|
+
*/
|
|
18
|
+
export declare function generateDocs(root: CommandUnknownOpts): GeneratedDocs;
|
|
19
|
+
export declare function replaceBullets(text: string): string;
|
|
20
|
+
//# sourceMappingURL=generateDocs.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"generateDocs.d.ts","sourceRoot":"","sources":["../../../../src/cli/lib/generateDocs.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,6BAA6B,CAAC;AAEtE,MAAM,MAAM,aAAa,GAAG,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;AAQnD;;;;;;;;;;;;;;GAcG;AACH,wBAAgB,YAAY,CAAC,IAAI,EAAE,kBAAkB,GAAG,aAAa,CA2DpE;AAsOD,wBAAgB,cAAc,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,CAEnD"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"generateDocs.test.d.ts","sourceRoot":"","sources":["../../../../src/cli/lib/generateDocs.test.ts"],"names":[],"mappings":""}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { Context } from "../../../bundler/context.js";
|
|
2
2
|
import { LocalDeploymentKind } from "./filePaths.js";
|
|
3
3
|
import { LocalDeploymentConfig } from "./filePaths.js";
|
|
4
|
-
import { DeploymentDetails } from "
|
|
4
|
+
import { DeploymentDetails } from "../deployment.js";
|
|
5
5
|
export declare function handleAnonymousDeployment(ctx: Context, options: {
|
|
6
6
|
ports: {
|
|
7
7
|
cloud: number | undefined;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"anonymous.d.ts","sourceRoot":"","sources":["../../../../../src/cli/lib/localDeployment/anonymous.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,OAAO,EAAE,MAAM,6BAA6B,CAAC;
|
|
1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AsB,mBAAmB,CACvC,GAAG,EAAE,OAAO,EACZ,IAAI,EAAE;IACJ,cAAc,EAAE,MAAM,CAAC;IACvB,QAAQ,EAAE,MAAM,CAAC;IACjB,MAAM,EAAE,MAAM,CAAC;IACf,WAAW,EAAE,MAAM,GAAG,IAAI,CAAC;CAC5B,GACA,OAAO,CAAC;IACT,cAAc,EAAE,MAAM,CAAC;IACvB,aAAa,EAAE,MAAM,CAAC;IACtB,WAAW,EAAE,MAAM,CAAC;CACrB,CAAC,CAoFD;AAED,wBAAsB,cAAc,CAClC,GAAG,EAAE,OAAO,EACZ,aAAa,EAAE;IACb,cAAc,EAAE,mBAAmB,CAAC;IACpC,cAAc,EAAE,MAAM,CAAC;CACxB,EACD,aAAa,EAAE;IACb,cAAc,EAAE,mBAAmB,CAAC;IACpC,cAAc,EAAE,MAAM,CAAC;CACxB,iBAwBF"}
|
|
@@ -6,6 +6,7 @@ export declare function bigBrainStart(ctx: Context, data: {
|
|
|
6
6
|
instanceName: string | null;
|
|
7
7
|
}): Promise<{
|
|
8
8
|
deploymentName: string;
|
|
9
|
+
/** @deprecated */
|
|
9
10
|
adminKey: string;
|
|
10
11
|
projectId: number;
|
|
11
12
|
}>;
|
|
@@ -15,16 +16,13 @@ export declare function bigBrainPause(ctx: Context, data: {
|
|
|
15
16
|
}): Promise<void>;
|
|
16
17
|
export declare function bigBrainRecordActivity(ctx: Context, data: {
|
|
17
18
|
instanceName: string;
|
|
19
|
+
adminKey: string;
|
|
18
20
|
}): Promise<any>;
|
|
19
21
|
export declare function bigBrainEnableFeatureMetadata(ctx: Context): Promise<{
|
|
20
22
|
totalProjects: {
|
|
21
23
|
kind: "none" | "one" | "multiple";
|
|
22
24
|
};
|
|
23
25
|
}>;
|
|
24
|
-
export declare function bigBrainGenerateAdminKeyForAnonymousDeployment(ctx: Context, data: {
|
|
25
|
-
instanceName: string;
|
|
26
|
-
instanceSecret: string;
|
|
27
|
-
}): Promise<any>;
|
|
28
26
|
/** Whether a project already has a cloud dev deployment for this user. */
|
|
29
27
|
export declare function projectHasExistingCloudDev(ctx: Context, { projectSlug, teamSlug, }: {
|
|
30
28
|
projectSlug: string;
|