convex 1.45.0 → 1.47.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 +105 -6
- package/dist/browser.bundle.js +7 -1
- package/dist/browser.bundle.js.map +2 -2
- package/dist/cjs/browser/http_client.js.map +2 -2
- package/dist/cjs/browser/query_options.js.map +2 -2
- package/dist/cjs/browser/simple_client.js.map +2 -2
- package/dist/cjs/browser/sync/optimistic_updates.js.map +1 -1
- package/dist/cjs/browser/sync/optimistic_updates_impl.js.map +2 -2
- package/dist/cjs/bundler/index.js +5 -4
- package/dist/cjs/bundler/index.js.map +2 -2
- package/dist/cjs/cli/codegen.js +0 -2
- package/dist/cjs/cli/codegen.js.map +2 -2
- package/dist/cjs/cli/configure.js +13 -4
- package/dist/cjs/cli/configure.js.map +2 -2
- package/dist/cjs/cli/deploy.js +28 -2
- package/dist/cjs/cli/deploy.js.map +2 -2
- package/dist/cjs/cli/deploymentSelect.js +2 -2
- package/dist/cjs/cli/deploymentSelect.js.map +2 -2
- package/dist/cjs/cli/dev.js +6 -0
- package/dist/cjs/cli/dev.js.map +2 -2
- package/dist/cjs/cli/docs.js +3 -36
- package/dist/cjs/cli/docs.js.map +2 -2
- package/dist/cjs/cli/env.js +10 -5
- package/dist/cjs/cli/env.js.map +2 -2
- package/dist/cjs/cli/envDefault.js +7 -2
- package/dist/cjs/cli/envDefault.js.map +2 -2
- package/dist/cjs/cli/generatedApi.js.map +1 -1
- package/dist/cjs/cli/lib/api.js +2 -0
- package/dist/cjs/cli/lib/api.js.map +2 -2
- package/dist/cjs/cli/lib/checkForLargeIndexBackfill.js +113 -0
- package/dist/cjs/cli/lib/checkForLargeIndexBackfill.js.map +7 -0
- package/dist/cjs/cli/lib/checkForLargeIndexDeletion.js +100 -70
- package/dist/cjs/cli/lib/checkForLargeIndexDeletion.js.map +2 -2
- package/dist/cjs/cli/lib/checkForSlowSchemaValidation.js +126 -0
- package/dist/cjs/cli/lib/checkForSlowSchemaValidation.js.map +7 -0
- package/dist/cjs/cli/lib/checkForStagedValidatorDeletion.js +90 -0
- package/dist/cjs/cli/lib/checkForStagedValidatorDeletion.js.map +7 -0
- package/dist/cjs/cli/lib/codegen.js.map +2 -2
- package/dist/cjs/cli/lib/command.js +2 -1
- package/dist/cjs/cli/lib/command.js.map +2 -2
- package/dist/cjs/cli/lib/components/definition/bundle.js +37 -11
- package/dist/cjs/cli/lib/components/definition/bundle.js.map +2 -2
- package/dist/cjs/cli/lib/components.js +56 -1
- package/dist/cjs/cli/lib/components.js.map +2 -2
- package/dist/cjs/cli/lib/config.js +56 -17
- package/dist/cjs/cli/lib/config.js.map +2 -2
- package/dist/cjs/cli/lib/deploy2.js +32 -3
- package/dist/cjs/cli/lib/deploy2.js.map +2 -2
- package/dist/cjs/cli/lib/deployApi/evaluateSchema.js +101 -0
- package/dist/cjs/cli/lib/deployApi/evaluateSchema.js.map +7 -0
- package/dist/cjs/cli/lib/deployApi/finishPush.js +1 -0
- package/dist/cjs/cli/lib/deployApi/finishPush.js.map +2 -2
- package/dist/cjs/cli/lib/deployApi/startPush.js +1 -1
- package/dist/cjs/cli/lib/deployApi/startPush.js.map +2 -2
- package/dist/cjs/cli/lib/dev.js +6 -0
- package/dist/cjs/cli/lib/dev.js.map +2 -2
- package/dist/cjs/cli/lib/formatValidationProgress.js +47 -0
- package/dist/cjs/cli/lib/formatValidationProgress.js.map +7 -0
- package/dist/cjs/cli/lib/generatedFunctionLogsApi.js.map +1 -1
- package/dist/cjs/cli/lib/indexes.js.map +1 -1
- package/dist/cjs/cli/lib/localDeployment/run.js +30 -1
- package/dist/cjs/cli/lib/localDeployment/run.js.map +2 -2
- package/dist/cjs/cli/lib/localDeployment/upgrade.js +6 -5
- package/dist/cjs/cli/lib/localDeployment/upgrade.js.map +2 -2
- package/dist/cjs/cli/lib/localDeployment/utils.js +5 -1
- package/dist/cjs/cli/lib/localDeployment/utils.js.map +2 -2
- package/dist/cjs/cli/lib/mcp/tools/env.js +10 -3
- package/dist/cjs/cli/lib/mcp/tools/env.js.map +2 -2
- package/dist/cjs/cli/lib/run.js +5 -0
- package/dist/cjs/cli/lib/run.js.map +2 -2
- package/dist/cjs/cli/lib/schemaEvaluation.js +62 -0
- package/dist/cjs/cli/lib/schemaEvaluation.js.map +7 -0
- package/dist/cjs/cli/lib/usageLimits.js +4 -2
- package/dist/cjs/cli/lib/usageLimits.js.map +2 -2
- package/dist/cjs/cli/lib/utils/mutex.js +9 -24
- package/dist/cjs/cli/lib/utils/mutex.js.map +2 -2
- package/dist/cjs/cli/lib/utils/utils.js +84 -47
- package/dist/cjs/cli/lib/utils/utils.js.map +2 -2
- package/dist/cjs/cli/projectCreate.js +1 -1
- package/dist/cjs/cli/projectCreate.js.map +1 -1
- package/dist/cjs/index.js +1 -1
- package/dist/cjs/index.js.map +1 -1
- package/dist/cjs/nextjs/index.js.map +2 -2
- package/dist/cjs/react/client.js.map +2 -2
- package/dist/cjs/react/hydration.js.map +2 -2
- package/dist/cjs/react/queries_observer.js.map +2 -2
- package/dist/cjs/react/use_paginated_query2.js.map +2 -2
- package/dist/cjs/react/use_queries.js.map +2 -2
- package/dist/cjs/server/api.js.map +2 -2
- package/dist/cjs/server/components/index.js.map +2 -2
- package/dist/cjs/server/cron.js +10 -10
- package/dist/cjs/server/cron.js.map +2 -2
- package/dist/cjs/server/impl/actions_impl.js +8 -3
- package/dist/cjs/server/impl/actions_impl.js.map +2 -2
- package/dist/cjs/server/impl/meta_impl.js +8 -2
- package/dist/cjs/server/impl/meta_impl.js.map +2 -2
- package/dist/cjs/server/impl/scheduler_impl.js.map +2 -2
- package/dist/cjs/server/impl/storage_impl.js +29 -0
- package/dist/cjs/server/impl/storage_impl.js.map +2 -2
- package/dist/cjs/server/index.js +1 -0
- 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/server/scheduler.js.map +1 -1
- package/dist/cjs/server/schema.js +72 -3
- package/dist/cjs/server/schema.js.map +2 -2
- package/dist/cjs/server/storage.js.map +1 -1
- package/dist/cjs/values/validator.js +1 -1
- package/dist/cjs/values/validator.js.map +2 -2
- package/dist/cjs/values/validators.js +82 -26
- package/dist/cjs/values/validators.js.map +2 -2
- package/dist/cjs/values/value.js +6 -0
- package/dist/cjs/values/value.js.map +2 -2
- package/dist/cjs-types/browser/http_client.d.ts +5 -5
- package/dist/cjs-types/browser/http_client.d.ts.map +1 -1
- package/dist/cjs-types/browser/query_options.d.ts +2 -2
- package/dist/cjs-types/browser/query_options.d.ts.map +1 -1
- package/dist/cjs-types/browser/simple_client.d.ts +6 -6
- package/dist/cjs-types/browser/simple_client.d.ts.map +1 -1
- package/dist/cjs-types/browser/sync/optimistic_updates.d.ts +4 -4
- package/dist/cjs-types/browser/sync/optimistic_updates.d.ts.map +1 -1
- package/dist/cjs-types/browser/sync/optimistic_updates_impl.d.ts.map +1 -1
- package/dist/cjs-types/bundler/index.d.ts +9 -2
- package/dist/cjs-types/bundler/index.d.ts.map +1 -1
- package/dist/cjs-types/cli/codegen.d.ts.map +1 -1
- package/dist/cjs-types/cli/configure.d.ts +6 -0
- package/dist/cjs-types/cli/configure.d.ts.map +1 -1
- package/dist/cjs-types/cli/deploy.d.ts +2 -0
- package/dist/cjs-types/cli/deploy.d.ts.map +1 -1
- package/dist/cjs-types/cli/deploymentCreate.d.ts +6 -6
- package/dist/cjs-types/cli/deploymentSelect.d.ts.map +1 -1
- package/dist/cjs-types/cli/dev.d.ts +1 -0
- package/dist/cjs-types/cli/dev.d.ts.map +1 -1
- package/dist/cjs-types/cli/docs.d.ts.map +1 -1
- package/dist/cjs-types/cli/env.d.ts.map +1 -1
- package/dist/cjs-types/cli/envDefault.d.ts.map +1 -1
- package/dist/cjs-types/cli/generatedApi.d.ts +1 -1
- package/dist/cjs-types/cli/generatedApi.d.ts.map +1 -1
- package/dist/cjs-types/cli/lib/api.d.ts.map +1 -1
- package/dist/cjs-types/cli/lib/checkForLargeIndexBackfill.d.ts +30 -0
- package/dist/cjs-types/cli/lib/checkForLargeIndexBackfill.d.ts.map +1 -0
- package/dist/cjs-types/cli/lib/checkForLargeIndexDeletion.d.ts +25 -6
- package/dist/cjs-types/cli/lib/checkForLargeIndexDeletion.d.ts.map +1 -1
- package/dist/cjs-types/cli/lib/checkForSlowSchemaValidation.d.ts +8 -0
- package/dist/cjs-types/cli/lib/checkForSlowSchemaValidation.d.ts.map +1 -0
- package/dist/cjs-types/cli/lib/checkForStagedValidatorDeletion.d.ts +17 -0
- package/dist/cjs-types/cli/lib/checkForStagedValidatorDeletion.d.ts.map +1 -0
- package/dist/cjs-types/cli/lib/codegen.d.ts +0 -2
- package/dist/cjs-types/cli/lib/codegen.d.ts.map +1 -1
- package/dist/cjs-types/cli/lib/command.d.ts +2 -0
- package/dist/cjs-types/cli/lib/command.d.ts.map +1 -1
- package/dist/cjs-types/cli/lib/components/definition/bundle.d.ts +13 -0
- package/dist/cjs-types/cli/lib/components/definition/bundle.d.ts.map +1 -1
- package/dist/cjs-types/cli/lib/components.d.ts +5 -0
- package/dist/cjs-types/cli/lib/components.d.ts.map +1 -1
- package/dist/cjs-types/cli/lib/config.d.ts +2 -1
- package/dist/cjs-types/cli/lib/config.d.ts.map +1 -1
- package/dist/cjs-types/cli/lib/deploy2.d.ts +8 -0
- package/dist/cjs-types/cli/lib/deploy2.d.ts.map +1 -1
- package/dist/cjs-types/cli/lib/deployApi/evaluateSchema.d.ts +897 -0
- package/dist/cjs-types/cli/lib/deployApi/evaluateSchema.d.ts.map +1 -0
- package/dist/cjs-types/cli/lib/deployApi/finishPush.d.ts +1 -2
- package/dist/cjs-types/cli/lib/deployApi/finishPush.d.ts.map +1 -1
- package/dist/cjs-types/cli/lib/dev.d.ts +1 -0
- package/dist/cjs-types/cli/lib/dev.d.ts.map +1 -1
- package/dist/cjs-types/cli/lib/formatValidationProgress.d.ts +8 -0
- package/dist/cjs-types/cli/lib/formatValidationProgress.d.ts.map +1 -0
- package/dist/cjs-types/cli/lib/generatedFunctionLogsApi.d.ts +2 -0
- package/dist/cjs-types/cli/lib/generatedFunctionLogsApi.d.ts.map +1 -1
- package/dist/cjs-types/cli/lib/localDeployment/run.d.ts +2 -0
- package/dist/cjs-types/cli/lib/localDeployment/run.d.ts.map +1 -1
- package/dist/cjs-types/cli/lib/localDeployment/upgrade.d.ts.map +1 -1
- package/dist/cjs-types/cli/lib/localDeployment/utils.d.ts +1 -0
- package/dist/cjs-types/cli/lib/localDeployment/utils.d.ts.map +1 -1
- package/dist/cjs-types/cli/lib/mcp/tools/env.d.ts +8 -5
- package/dist/cjs-types/cli/lib/mcp/tools/env.d.ts.map +1 -1
- package/dist/cjs-types/cli/lib/run.d.ts.map +1 -1
- package/dist/cjs-types/cli/lib/schemaEvaluation.d.ts +33 -0
- package/dist/cjs-types/cli/lib/schemaEvaluation.d.ts.map +1 -0
- package/dist/cjs-types/cli/lib/usageLimits.d.ts +1 -1
- package/dist/cjs-types/cli/lib/usageLimits.d.ts.map +1 -1
- package/dist/cjs-types/cli/lib/utils/mutex.d.ts +1 -3
- package/dist/cjs-types/cli/lib/utils/mutex.d.ts.map +1 -1
- package/dist/cjs-types/cli/lib/utils/utils.d.ts +15 -7
- package/dist/cjs-types/cli/lib/utils/utils.d.ts.map +1 -1
- package/dist/cjs-types/index.d.ts +1 -1
- package/dist/cjs-types/nextjs/index.d.ts +6 -6
- package/dist/cjs-types/nextjs/index.d.ts.map +1 -1
- package/dist/cjs-types/react/client.d.ts +15 -15
- package/dist/cjs-types/react/client.d.ts.map +1 -1
- package/dist/cjs-types/react/hydration.d.ts +3 -3
- package/dist/cjs-types/react/hydration.d.ts.map +1 -1
- package/dist/cjs-types/react/queries_observer.d.ts +9 -9
- package/dist/cjs-types/react/queries_observer.d.ts.map +1 -1
- package/dist/cjs-types/react/use_paginated_query2.d.ts.map +1 -1
- package/dist/cjs-types/react/use_queries.d.ts +14 -6
- package/dist/cjs-types/react/use_queries.d.ts.map +1 -1
- package/dist/cjs-types/server/api.d.ts +157 -7
- package/dist/cjs-types/server/api.d.ts.map +1 -1
- package/dist/cjs-types/server/components/index.d.ts +2 -2
- package/dist/cjs-types/server/components/index.d.ts.map +1 -1
- package/dist/cjs-types/server/cron.d.ts +21 -20
- package/dist/cjs-types/server/cron.d.ts.map +1 -1
- package/dist/cjs-types/server/impl/actions_impl.d.ts +22 -7
- package/dist/cjs-types/server/impl/actions_impl.d.ts.map +1 -1
- package/dist/cjs-types/server/impl/meta_impl.d.ts.map +1 -1
- package/dist/cjs-types/server/impl/scheduler_impl.d.ts.map +1 -1
- package/dist/cjs-types/server/impl/storage_impl.d.ts.map +1 -1
- package/dist/cjs-types/server/index.d.ts +2 -2
- package/dist/cjs-types/server/index.d.ts.map +1 -1
- package/dist/cjs-types/server/meta.d.ts +63 -0
- package/dist/cjs-types/server/meta.d.ts.map +1 -1
- package/dist/cjs-types/server/registration.d.ts +17 -7
- package/dist/cjs-types/server/registration.d.ts.map +1 -1
- package/dist/cjs-types/server/scheduler.d.ts +9 -7
- package/dist/cjs-types/server/scheduler.d.ts.map +1 -1
- package/dist/cjs-types/server/schema.d.ts +34 -0
- package/dist/cjs-types/server/schema.d.ts.map +1 -1
- package/dist/cjs-types/server/storage.d.ts.map +1 -1
- package/dist/cjs-types/values/validator.d.ts.map +1 -1
- package/dist/cjs-types/values/validators.d.ts +30 -0
- package/dist/cjs-types/values/validators.d.ts.map +1 -1
- package/dist/cjs-types/values/value.d.ts.map +1 -1
- package/dist/cli.bundle.cjs +2728 -1627
- package/dist/cli.bundle.cjs.map +4 -4
- package/dist/esm/browser/http_client.js.map +2 -2
- package/dist/esm/browser/query_options.js.map +2 -2
- package/dist/esm/browser/simple_client.js.map +2 -2
- package/dist/esm/browser/sync/optimistic_updates_impl.js.map +2 -2
- package/dist/esm/bundler/index.js +5 -4
- package/dist/esm/bundler/index.js.map +2 -2
- package/dist/esm/cli/codegen.js +0 -2
- package/dist/esm/cli/codegen.js.map +2 -2
- package/dist/esm/cli/configure.js +12 -4
- package/dist/esm/cli/configure.js.map +2 -2
- package/dist/esm/cli/deploy.js +28 -2
- package/dist/esm/cli/deploy.js.map +2 -2
- package/dist/esm/cli/deploymentSelect.js +6 -3
- package/dist/esm/cli/deploymentSelect.js.map +2 -2
- package/dist/esm/cli/dev.js +6 -0
- package/dist/esm/cli/dev.js.map +2 -2
- package/dist/esm/cli/docs.js +3 -43
- package/dist/esm/cli/docs.js.map +2 -2
- package/dist/esm/cli/env.js +11 -6
- package/dist/esm/cli/env.js.map +2 -2
- package/dist/esm/cli/envDefault.js +7 -2
- package/dist/esm/cli/envDefault.js.map +2 -2
- package/dist/esm/cli/lib/api.js +2 -0
- package/dist/esm/cli/lib/api.js.map +2 -2
- package/dist/esm/cli/lib/checkForLargeIndexBackfill.js +95 -0
- package/dist/esm/cli/lib/checkForLargeIndexBackfill.js.map +7 -0
- package/dist/esm/cli/lib/checkForLargeIndexDeletion.js +98 -69
- package/dist/esm/cli/lib/checkForLargeIndexDeletion.js.map +2 -2
- package/dist/esm/cli/lib/checkForSlowSchemaValidation.js +107 -0
- package/dist/esm/cli/lib/checkForSlowSchemaValidation.js.map +7 -0
- package/dist/esm/cli/lib/checkForStagedValidatorDeletion.js +68 -0
- package/dist/esm/cli/lib/checkForStagedValidatorDeletion.js.map +7 -0
- package/dist/esm/cli/lib/codegen.js.map +2 -2
- package/dist/esm/cli/lib/command.js +2 -1
- package/dist/esm/cli/lib/command.js.map +2 -2
- package/dist/esm/cli/lib/components/definition/bundle.js +37 -11
- package/dist/esm/cli/lib/components/definition/bundle.js.map +2 -2
- package/dist/esm/cli/lib/components.js +63 -1
- package/dist/esm/cli/lib/components.js.map +2 -2
- package/dist/esm/cli/lib/config.js +55 -17
- package/dist/esm/cli/lib/config.js.map +2 -2
- package/dist/esm/cli/lib/deploy2.js +33 -3
- package/dist/esm/cli/lib/deploy2.js.map +2 -2
- package/dist/esm/cli/lib/deployApi/evaluateSchema.js +72 -0
- package/dist/esm/cli/lib/deployApi/evaluateSchema.js.map +7 -0
- package/dist/esm/cli/lib/deployApi/finishPush.js +1 -1
- package/dist/esm/cli/lib/deployApi/finishPush.js.map +2 -2
- package/dist/esm/cli/lib/deployApi/startPush.js +1 -1
- package/dist/esm/cli/lib/deployApi/startPush.js.map +2 -2
- package/dist/esm/cli/lib/dev.js +6 -0
- package/dist/esm/cli/lib/dev.js.map +2 -2
- package/dist/esm/cli/lib/formatValidationProgress.js +24 -0
- package/dist/esm/cli/lib/formatValidationProgress.js.map +7 -0
- package/dist/esm/cli/lib/indexes.js.map +1 -1
- package/dist/esm/cli/lib/localDeployment/run.js +30 -2
- package/dist/esm/cli/lib/localDeployment/run.js.map +2 -2
- package/dist/esm/cli/lib/localDeployment/upgrade.js +4 -3
- package/dist/esm/cli/lib/localDeployment/upgrade.js.map +2 -2
- package/dist/esm/cli/lib/localDeployment/utils.js +3 -0
- package/dist/esm/cli/lib/localDeployment/utils.js.map +2 -2
- package/dist/esm/cli/lib/mcp/tools/env.js +10 -3
- package/dist/esm/cli/lib/mcp/tools/env.js.map +2 -2
- package/dist/esm/cli/lib/run.js +5 -0
- package/dist/esm/cli/lib/run.js.map +2 -2
- package/dist/esm/cli/lib/schemaEvaluation.js +39 -0
- package/dist/esm/cli/lib/schemaEvaluation.js.map +7 -0
- package/dist/esm/cli/lib/usageLimits.js +4 -2
- package/dist/esm/cli/lib/usageLimits.js.map +2 -2
- package/dist/esm/cli/lib/utils/mutex.js +9 -24
- package/dist/esm/cli/lib/utils/mutex.js.map +2 -2
- package/dist/esm/cli/lib/utils/utils.js +84 -49
- package/dist/esm/cli/lib/utils/utils.js.map +2 -2
- package/dist/esm/cli/projectCreate.js +1 -1
- package/dist/esm/cli/projectCreate.js.map +1 -1
- package/dist/esm/index.js +1 -1
- package/dist/esm/index.js.map +1 -1
- package/dist/esm/nextjs/index.js.map +2 -2
- package/dist/esm/react/client.js.map +2 -2
- package/dist/esm/react/hydration.js +3 -1
- package/dist/esm/react/hydration.js.map +2 -2
- package/dist/esm/react/queries_observer.js +3 -1
- package/dist/esm/react/queries_observer.js.map +2 -2
- package/dist/esm/react/use_paginated_query2.js +3 -1
- package/dist/esm/react/use_paginated_query2.js.map +2 -2
- package/dist/esm/react/use_queries.js.map +2 -2
- package/dist/esm/server/api.js.map +2 -2
- package/dist/esm/server/components/index.js.map +2 -2
- package/dist/esm/server/cron.js +13 -11
- package/dist/esm/server/cron.js.map +2 -2
- package/dist/esm/server/impl/actions_impl.js +7 -3
- package/dist/esm/server/impl/actions_impl.js.map +2 -2
- package/dist/esm/server/impl/meta_impl.js +9 -3
- package/dist/esm/server/impl/meta_impl.js.map +2 -2
- package/dist/esm/server/impl/scheduler_impl.js.map +2 -2
- package/dist/esm/server/impl/storage_impl.js +29 -0
- package/dist/esm/server/impl/storage_impl.js.map +2 -2
- package/dist/esm/server/index.js +4 -1
- package/dist/esm/server/index.js.map +2 -2
- package/dist/esm/server/schema.js +72 -3
- package/dist/esm/server/schema.js.map +2 -2
- package/dist/esm/values/validator.js +1 -1
- package/dist/esm/values/validator.js.map +2 -2
- package/dist/esm/values/validators.js +82 -26
- package/dist/esm/values/validators.js.map +2 -2
- package/dist/esm/values/value.js +6 -0
- package/dist/esm/values/value.js.map +2 -2
- package/dist/esm-types/browser/http_client.d.ts +5 -5
- package/dist/esm-types/browser/http_client.d.ts.map +1 -1
- package/dist/esm-types/browser/query_options.d.ts +2 -2
- package/dist/esm-types/browser/query_options.d.ts.map +1 -1
- package/dist/esm-types/browser/simple_client.d.ts +6 -6
- package/dist/esm-types/browser/simple_client.d.ts.map +1 -1
- package/dist/esm-types/browser/sync/optimistic_updates.d.ts +4 -4
- package/dist/esm-types/browser/sync/optimistic_updates.d.ts.map +1 -1
- package/dist/esm-types/browser/sync/optimistic_updates_impl.d.ts.map +1 -1
- package/dist/esm-types/bundler/index.d.ts +9 -2
- package/dist/esm-types/bundler/index.d.ts.map +1 -1
- package/dist/esm-types/cli/codegen.d.ts.map +1 -1
- package/dist/esm-types/cli/configure.d.ts +6 -0
- package/dist/esm-types/cli/configure.d.ts.map +1 -1
- package/dist/esm-types/cli/deploy.d.ts +2 -0
- package/dist/esm-types/cli/deploy.d.ts.map +1 -1
- package/dist/esm-types/cli/deploymentCreate.d.ts +6 -6
- package/dist/esm-types/cli/deploymentSelect.d.ts.map +1 -1
- package/dist/esm-types/cli/dev.d.ts +1 -0
- package/dist/esm-types/cli/dev.d.ts.map +1 -1
- package/dist/esm-types/cli/docs.d.ts.map +1 -1
- package/dist/esm-types/cli/env.d.ts.map +1 -1
- package/dist/esm-types/cli/envDefault.d.ts.map +1 -1
- package/dist/esm-types/cli/generatedApi.d.ts +1 -1
- package/dist/esm-types/cli/generatedApi.d.ts.map +1 -1
- package/dist/esm-types/cli/lib/api.d.ts.map +1 -1
- package/dist/esm-types/cli/lib/checkForLargeIndexBackfill.d.ts +30 -0
- package/dist/esm-types/cli/lib/checkForLargeIndexBackfill.d.ts.map +1 -0
- package/dist/esm-types/cli/lib/checkForLargeIndexDeletion.d.ts +25 -6
- package/dist/esm-types/cli/lib/checkForLargeIndexDeletion.d.ts.map +1 -1
- package/dist/esm-types/cli/lib/checkForSlowSchemaValidation.d.ts +8 -0
- package/dist/esm-types/cli/lib/checkForSlowSchemaValidation.d.ts.map +1 -0
- package/dist/esm-types/cli/lib/checkForStagedValidatorDeletion.d.ts +17 -0
- package/dist/esm-types/cli/lib/checkForStagedValidatorDeletion.d.ts.map +1 -0
- package/dist/esm-types/cli/lib/codegen.d.ts +0 -2
- package/dist/esm-types/cli/lib/codegen.d.ts.map +1 -1
- package/dist/esm-types/cli/lib/command.d.ts +2 -0
- package/dist/esm-types/cli/lib/command.d.ts.map +1 -1
- package/dist/esm-types/cli/lib/components/definition/bundle.d.ts +13 -0
- package/dist/esm-types/cli/lib/components/definition/bundle.d.ts.map +1 -1
- package/dist/esm-types/cli/lib/components.d.ts +5 -0
- package/dist/esm-types/cli/lib/components.d.ts.map +1 -1
- package/dist/esm-types/cli/lib/config.d.ts +2 -1
- package/dist/esm-types/cli/lib/config.d.ts.map +1 -1
- package/dist/esm-types/cli/lib/deploy2.d.ts +8 -0
- package/dist/esm-types/cli/lib/deploy2.d.ts.map +1 -1
- package/dist/esm-types/cli/lib/deployApi/evaluateSchema.d.ts +897 -0
- package/dist/esm-types/cli/lib/deployApi/evaluateSchema.d.ts.map +1 -0
- package/dist/esm-types/cli/lib/deployApi/finishPush.d.ts +1 -2
- package/dist/esm-types/cli/lib/deployApi/finishPush.d.ts.map +1 -1
- package/dist/esm-types/cli/lib/dev.d.ts +1 -0
- package/dist/esm-types/cli/lib/dev.d.ts.map +1 -1
- package/dist/esm-types/cli/lib/formatValidationProgress.d.ts +8 -0
- package/dist/esm-types/cli/lib/formatValidationProgress.d.ts.map +1 -0
- package/dist/esm-types/cli/lib/generatedFunctionLogsApi.d.ts +2 -0
- package/dist/esm-types/cli/lib/generatedFunctionLogsApi.d.ts.map +1 -1
- package/dist/esm-types/cli/lib/localDeployment/run.d.ts +2 -0
- package/dist/esm-types/cli/lib/localDeployment/run.d.ts.map +1 -1
- package/dist/esm-types/cli/lib/localDeployment/upgrade.d.ts.map +1 -1
- package/dist/esm-types/cli/lib/localDeployment/utils.d.ts +1 -0
- package/dist/esm-types/cli/lib/localDeployment/utils.d.ts.map +1 -1
- package/dist/esm-types/cli/lib/mcp/tools/env.d.ts +8 -5
- package/dist/esm-types/cli/lib/mcp/tools/env.d.ts.map +1 -1
- package/dist/esm-types/cli/lib/run.d.ts.map +1 -1
- package/dist/esm-types/cli/lib/schemaEvaluation.d.ts +33 -0
- package/dist/esm-types/cli/lib/schemaEvaluation.d.ts.map +1 -0
- package/dist/esm-types/cli/lib/usageLimits.d.ts +1 -1
- package/dist/esm-types/cli/lib/usageLimits.d.ts.map +1 -1
- package/dist/esm-types/cli/lib/utils/mutex.d.ts +1 -3
- package/dist/esm-types/cli/lib/utils/mutex.d.ts.map +1 -1
- package/dist/esm-types/cli/lib/utils/utils.d.ts +15 -7
- package/dist/esm-types/cli/lib/utils/utils.d.ts.map +1 -1
- package/dist/esm-types/index.d.ts +1 -1
- package/dist/esm-types/nextjs/index.d.ts +6 -6
- package/dist/esm-types/nextjs/index.d.ts.map +1 -1
- package/dist/esm-types/react/client.d.ts +15 -15
- package/dist/esm-types/react/client.d.ts.map +1 -1
- package/dist/esm-types/react/hydration.d.ts +3 -3
- package/dist/esm-types/react/hydration.d.ts.map +1 -1
- package/dist/esm-types/react/queries_observer.d.ts +9 -9
- package/dist/esm-types/react/queries_observer.d.ts.map +1 -1
- package/dist/esm-types/react/use_paginated_query2.d.ts.map +1 -1
- package/dist/esm-types/react/use_queries.d.ts +14 -6
- package/dist/esm-types/react/use_queries.d.ts.map +1 -1
- package/dist/esm-types/server/api.d.ts +157 -7
- package/dist/esm-types/server/api.d.ts.map +1 -1
- package/dist/esm-types/server/components/index.d.ts +2 -2
- package/dist/esm-types/server/components/index.d.ts.map +1 -1
- package/dist/esm-types/server/cron.d.ts +21 -20
- package/dist/esm-types/server/cron.d.ts.map +1 -1
- package/dist/esm-types/server/impl/actions_impl.d.ts +22 -7
- package/dist/esm-types/server/impl/actions_impl.d.ts.map +1 -1
- package/dist/esm-types/server/impl/meta_impl.d.ts.map +1 -1
- package/dist/esm-types/server/impl/scheduler_impl.d.ts.map +1 -1
- package/dist/esm-types/server/impl/storage_impl.d.ts.map +1 -1
- package/dist/esm-types/server/index.d.ts +2 -2
- package/dist/esm-types/server/index.d.ts.map +1 -1
- package/dist/esm-types/server/meta.d.ts +63 -0
- package/dist/esm-types/server/meta.d.ts.map +1 -1
- package/dist/esm-types/server/registration.d.ts +17 -7
- package/dist/esm-types/server/registration.d.ts.map +1 -1
- package/dist/esm-types/server/scheduler.d.ts +9 -7
- package/dist/esm-types/server/scheduler.d.ts.map +1 -1
- package/dist/esm-types/server/schema.d.ts +34 -0
- package/dist/esm-types/server/schema.d.ts.map +1 -1
- package/dist/esm-types/server/storage.d.ts.map +1 -1
- package/dist/esm-types/values/validator.d.ts.map +1 -1
- package/dist/esm-types/values/validators.d.ts +30 -0
- package/dist/esm-types/values/validators.d.ts.map +1 -1
- package/dist/esm-types/values/value.d.ts.map +1 -1
- package/dist/react.bundle.js +7 -1
- package/dist/react.bundle.js.map +2 -2
- package/package.json +9 -9
- package/schemas/convex.schema.json +5 -5
- package/src/browser/http_client.ts +43 -10
- package/src/browser/query_options.ts +11 -5
- package/src/browser/simple_client.ts +35 -14
- package/src/browser/sync/optimistic_updates.ts +17 -4
- package/src/browser/sync/optimistic_updates_impl.ts +17 -4
- package/src/bundler/index.ts +9 -4
- package/src/cli/codegen.ts +0 -1
- package/src/cli/configure.ts +27 -7
- package/src/cli/deploy.ts +37 -5
- package/src/cli/deploymentSelect.ts +7 -4
- package/src/cli/dev.ts +9 -0
- package/src/cli/docs.ts +3 -44
- package/src/cli/env.ts +12 -6
- package/src/cli/envDefault.ts +8 -2
- package/src/cli/generatedApi.ts +1 -1
- package/src/cli/lib/api.ts +5 -1
- package/src/cli/lib/checkForLargeIndexBackfill.ts +173 -0
- package/src/cli/lib/checkForLargeIndexDeletion.ts +150 -91
- package/src/cli/lib/checkForSlowSchemaValidation.ts +141 -0
- package/src/cli/lib/checkForStagedValidatorDeletion.ts +104 -0
- package/src/cli/lib/codegen.ts +0 -2
- package/src/cli/lib/command.ts +3 -0
- package/src/cli/lib/components/definition/bundle.ts +68 -14
- package/src/cli/lib/components.ts +84 -0
- package/src/cli/lib/config.ts +85 -18
- package/src/cli/lib/deploy2.ts +66 -2
- package/src/cli/lib/deployApi/evaluateSchema.ts +97 -0
- package/src/cli/lib/deployApi/finishPush.ts +1 -1
- package/src/cli/lib/deployApi/startPush.ts +1 -1
- package/src/cli/lib/dev.ts +15 -0
- package/src/cli/lib/formatValidationProgress.ts +35 -0
- package/src/cli/lib/generatedFunctionLogsApi.ts +2 -0
- package/src/cli/lib/indexes.ts +1 -1
- package/src/cli/lib/localDeployment/run.ts +44 -2
- package/src/cli/lib/localDeployment/upgrade.ts +4 -6
- package/src/cli/lib/localDeployment/utils.ts +6 -0
- package/src/cli/lib/mcp/tools/env.ts +17 -3
- package/src/cli/lib/run.ts +3 -0
- package/src/cli/lib/schemaEvaluation.ts +88 -0
- package/src/cli/lib/usageLimits.ts +2 -0
- package/src/cli/lib/utils/mutex.ts +9 -27
- package/src/cli/lib/utils/utils.ts +127 -56
- package/src/cli/projectCreate.ts +1 -1
- package/src/index.ts +1 -1
- package/src/nextjs/index.ts +19 -8
- package/src/react/client.ts +73 -30
- package/src/react/hydration.tsx +14 -6
- package/src/react/queries_observer.ts +19 -16
- package/src/react/use_paginated_query2.ts +10 -6
- package/src/react/use_queries.ts +23 -7
- package/src/server/api.ts +220 -14
- package/src/server/components/index.ts +4 -6
- package/src/server/cron.ts +34 -24
- package/src/server/impl/actions_impl.ts +39 -10
- package/src/server/impl/meta_impl.ts +8 -1
- package/src/server/impl/scheduler_impl.ts +13 -6
- package/src/server/impl/storage_impl.ts +30 -0
- package/src/server/index.ts +6 -1
- package/src/server/meta.ts +79 -0
- package/src/server/registration.ts +38 -7
- package/src/server/scheduler.ts +22 -7
- package/src/server/schema.ts +77 -0
- package/src/server/storage.ts +17 -0
- package/src/values/validator.ts +3 -1
- package/src/values/validators.ts +85 -27
- package/src/values/value.ts +9 -5
package/src/server/api.ts
CHANGED
|
@@ -42,6 +42,9 @@ export type FunctionType = "query" | "mutation" | "action";
|
|
|
42
42
|
* const result = useQuery(api.myModule.myFunction);
|
|
43
43
|
* ```
|
|
44
44
|
*
|
|
45
|
+
* If you want to accept a `FunctionReference` as a callback argument, prefer
|
|
46
|
+
* typing the callback parameter as {@link FunctionReference_future}.
|
|
47
|
+
*
|
|
45
48
|
* @typeParam Type - The type of the function ("query", "mutation", or "action").
|
|
46
49
|
* @typeParam Visibility - The visibility of the function ("public" or "internal").
|
|
47
50
|
* @typeParam Args - The arguments to this function. This is an object mapping
|
|
@@ -58,9 +61,179 @@ export type FunctionReference<
|
|
|
58
61
|
> = {
|
|
59
62
|
_type: Type;
|
|
60
63
|
_visibility: Visibility;
|
|
64
|
+
/**
|
|
65
|
+
* To read the arguments for a `FunctionReference`, prefer
|
|
66
|
+
* {@link FunctionArgs}.
|
|
67
|
+
*
|
|
68
|
+
* This slot will be removed in a future version.
|
|
69
|
+
*
|
|
70
|
+
* @deprecated
|
|
71
|
+
*/
|
|
61
72
|
_args: Args;
|
|
73
|
+
/**
|
|
74
|
+
* To read the return type of a `FunctionReference`, prefer
|
|
75
|
+
* {@link FunctionReturnType}.
|
|
76
|
+
*
|
|
77
|
+
* This slot will be removed in a future version.
|
|
78
|
+
*
|
|
79
|
+
* @deprecated
|
|
80
|
+
*/
|
|
62
81
|
_returnType: ReturnType;
|
|
63
82
|
_componentPath: ComponentPath;
|
|
83
|
+
/**
|
|
84
|
+
* To read the arguments or return type of a `FunctionReference`, prefer
|
|
85
|
+
* {@link FunctionArgs} and {@link FunctionReturnType}.
|
|
86
|
+
*/
|
|
87
|
+
// This phantom slot exists so that a `FunctionReference` can be checked
|
|
88
|
+
// against a `FunctionReference_future`. It changes nothing about how two
|
|
89
|
+
// `FunctionReference`s compare with each other.
|
|
90
|
+
//
|
|
91
|
+
// The slot models the function itself: it puts `Args` in a contravariant
|
|
92
|
+
// position and `ReturnType` in a covariant one, so the slot alone is enough
|
|
93
|
+
// to compare a reference the way TypeScript compares two functions.
|
|
94
|
+
//
|
|
95
|
+
// In that comparison the `keys` parameter has an important role. It carries
|
|
96
|
+
// the keys of `Args`, so that checking a `FunctionReference` against a
|
|
97
|
+
// `FunctionReference_future` also checks that every key the consumer passes
|
|
98
|
+
// is a key the function declares. TypeScript treats a surplus property as
|
|
99
|
+
// harmless, but a Convex argument validator rejects it, so this is what
|
|
100
|
+
// makes the comparison match the runtime. See `FunctionReferenceArgKeys`.
|
|
101
|
+
_fn?(args: Args, keys: FunctionReferenceArgKeys<Args>): ReturnType;
|
|
102
|
+
};
|
|
103
|
+
|
|
104
|
+
/**
|
|
105
|
+
* The keys of a reference's arguments.
|
|
106
|
+
*
|
|
107
|
+
* `0 extends 1 & Args` holds only when `Args` is `any`. That maps to `any`
|
|
108
|
+
* rather than `keyof any` so that an untyped reference neither imposes nor
|
|
109
|
+
* fails the key check in either direction. Arguments with an index signature,
|
|
110
|
+
* such as `EmptyObject` and `DefaultFunctionArgs`, map to `string`, which
|
|
111
|
+
* accepts every key and leaves the decision to the first parameter.
|
|
112
|
+
*/
|
|
113
|
+
type ArgKeys<Args> = 0 extends 1 & Args ? any : keyof Args;
|
|
114
|
+
|
|
115
|
+
/**
|
|
116
|
+
* The second parameter of `FunctionReference._fn`.
|
|
117
|
+
*
|
|
118
|
+
* Wrapping the keys in a function of a function puts them two parameters deep,
|
|
119
|
+
* so comparing this parameter contravariantly checks that every key the
|
|
120
|
+
* consumer passes is one the function declares. That is the check a Convex
|
|
121
|
+
* argument validator performs and an ordinary function-type comparison skips.
|
|
122
|
+
*
|
|
123
|
+
* The union with {@link UncheckedArgKeys} is what keeps two
|
|
124
|
+
* `FunctionReference`s comparing as they did before this slot existed. Every
|
|
125
|
+
* `FunctionReferenceArgKeys` is assignable to `UncheckedArgKeys`, so between
|
|
126
|
+
* two `FunctionReference`s the keys always relate and only `_args` decides.
|
|
127
|
+
* {@link FunctionReference_futureArgKeys} is not assignable to it, so a
|
|
128
|
+
* `FunctionReference` compared against a `FunctionReference_future` has to
|
|
129
|
+
* satisfy the real check.
|
|
130
|
+
*/
|
|
131
|
+
type FunctionReferenceArgKeys<Args> = 0 extends 1 & Args
|
|
132
|
+
? any
|
|
133
|
+
: ((keys: (key: ArgKeys<Args>) => void) => void) | UncheckedArgKeys;
|
|
134
|
+
|
|
135
|
+
/**
|
|
136
|
+
* A keys parameter that every {@link FunctionReferenceArgKeys} is assignable
|
|
137
|
+
* to, and that no {@link FunctionReference_futureArgKeys} is: `unknown` for
|
|
138
|
+
* the second parameter accepts the former's missing parameter and rejects the
|
|
139
|
+
* latter's `never`.
|
|
140
|
+
*/
|
|
141
|
+
type UncheckedArgKeys = (keys: never, unchecked?: unknown) => void;
|
|
142
|
+
|
|
143
|
+
/**
|
|
144
|
+
* The second parameter of `FunctionReference_future._fn`. The same shape as
|
|
145
|
+
* {@link FunctionReferenceArgKeys} plus a `guard` parameter that keeps it out
|
|
146
|
+
* of {@link UncheckedArgKeys}.
|
|
147
|
+
*/
|
|
148
|
+
type FunctionReference_futureArgKeys<Args> = 0 extends 1 & Args
|
|
149
|
+
? any
|
|
150
|
+
: (keys: (key: ArgKeys<Args>) => void, guard?: never) => void;
|
|
151
|
+
|
|
152
|
+
/**
|
|
153
|
+
* A reference to a Convex function whose arguments are checked closer to the
|
|
154
|
+
* way Convex checks them at runtime.
|
|
155
|
+
*
|
|
156
|
+
* Use this instead of {@link FunctionReference} when you accept someone else's
|
|
157
|
+
* Convex function as a callback and know which arguments you will pass it.
|
|
158
|
+
*
|
|
159
|
+
* A plain `FunctionReference` gets a couple things backwards: it accepts a
|
|
160
|
+
* function requiring arguments you never pass, and rejects a function
|
|
161
|
+
* accepting broader values than you pass. An ordinary TypeScript function type
|
|
162
|
+
* doesn't map perfectly either: it treats a surplus argument as harmless,
|
|
163
|
+
* where a Convex validator rejects it.
|
|
164
|
+
*
|
|
165
|
+
* This type melds regular TypeScript function reference behavior with top
|
|
166
|
+
* level checking of arguments to prevent surplus arguments from hitting
|
|
167
|
+
* runtime validation errors. The caveat: a surplus key inside a nested object,
|
|
168
|
+
* an array element, or one arm of a union passes the type check and fails the
|
|
169
|
+
* validator at runtime.
|
|
170
|
+
*
|
|
171
|
+
* ```ts
|
|
172
|
+
* import { FunctionReference_future } from "convex/server";
|
|
173
|
+
*
|
|
174
|
+
* declare function onComplete(
|
|
175
|
+
* fn: FunctionReference_future<
|
|
176
|
+
* "mutation",
|
|
177
|
+
* "internal",
|
|
178
|
+
* { taskId: string; force: boolean },
|
|
179
|
+
* null
|
|
180
|
+
* >,
|
|
181
|
+
* ): void;
|
|
182
|
+
*
|
|
183
|
+
* // Takes exactly `{ taskId: string; force: boolean }`.
|
|
184
|
+
* onComplete(internal.tasks.finish);
|
|
185
|
+
* // Takes `{ taskId: string | number; force?: boolean }`: calling it is safe.
|
|
186
|
+
* onComplete(internal.tasks.finishLoosely);
|
|
187
|
+
* // Requires a `reason` argument that `onComplete` never passes.
|
|
188
|
+
* onComplete(internal.tasks.finishWithReason);
|
|
189
|
+
* // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ rejected
|
|
190
|
+
* // Takes only `{ taskId: string }`: its validator would reject `force`.
|
|
191
|
+
* onComplete(internal.tasks.finishById);
|
|
192
|
+
* // ~~~~~~~~~~~~~~~~~~~~~~~~ rejected
|
|
193
|
+
* ```
|
|
194
|
+
*
|
|
195
|
+
* A value of this type is usable with `ctx.runMutation`,
|
|
196
|
+
* `ctx.scheduler.runAfter`, `createFunctionHandle`, and everything else in
|
|
197
|
+
* this package that takes a reference, all of which accept either kind.
|
|
198
|
+
*
|
|
199
|
+
* It is *not* assignable to a plain `FunctionReference`. Code that wants to
|
|
200
|
+
* accept both kinds should take
|
|
201
|
+
* `FunctionReference<...> | FunctionReference_future<...>` and read arguments
|
|
202
|
+
* and return types through {@link FunctionArgs} and {@link FunctionReturnType}.
|
|
203
|
+
*
|
|
204
|
+
* Argument checking here relies on `strictFunctionTypes` (implied by `strict`)
|
|
205
|
+
* and is skipped for projects that disable it. Everything else about the
|
|
206
|
+
* reference is compared exactly as `FunctionReference` compares it.
|
|
207
|
+
*
|
|
208
|
+
* @typeParam Type - The type of the function ("query", "mutation", or "action").
|
|
209
|
+
* @typeParam Visibility - The visibility of the function ("public" or "internal").
|
|
210
|
+
* @typeParam Args - The arguments the consumer of the reference will pass.
|
|
211
|
+
* @typeParam ReturnType - The return type of this function.
|
|
212
|
+
* @public
|
|
213
|
+
*/
|
|
214
|
+
export type FunctionReference_future<
|
|
215
|
+
Type extends FunctionType,
|
|
216
|
+
Visibility extends FunctionVisibility = "public",
|
|
217
|
+
Args extends DefaultFunctionArgs = any,
|
|
218
|
+
ReturnType = any,
|
|
219
|
+
ComponentPath = string | undefined,
|
|
220
|
+
> = {
|
|
221
|
+
_type: Type;
|
|
222
|
+
_visibility: Visibility;
|
|
223
|
+
_componentPath: ComponentPath;
|
|
224
|
+
// Declared as a *property* rather than a method: TypeScript compares method
|
|
225
|
+
// parameters bivariantly and would not check anything. The explicit
|
|
226
|
+
// `| undefined` is needed because an optional method on the source side
|
|
227
|
+
// (`FunctionReference._fn`) carries a real `undefined` in its type, which
|
|
228
|
+
// `exactOptionalPropertyTypes` would otherwise reject.
|
|
229
|
+
//
|
|
230
|
+
// Both parameters are compared contravariantly: the first checks that the
|
|
231
|
+
// consumer's arguments satisfy the function's, the second that the consumer
|
|
232
|
+
// passes no key the function does not declare. See
|
|
233
|
+
// `FunctionReference_futureArgKeys`.
|
|
234
|
+
_fn?:
|
|
235
|
+
| ((args: Args, keys: FunctionReference_futureArgKeys<Args>) => ReturnType)
|
|
236
|
+
| undefined;
|
|
64
237
|
};
|
|
65
238
|
|
|
66
239
|
/**
|
|
@@ -76,7 +249,9 @@ export type FunctionReference<
|
|
|
76
249
|
* @public
|
|
77
250
|
*/
|
|
78
251
|
export function getFunctionName(
|
|
79
|
-
functionReference:
|
|
252
|
+
functionReference:
|
|
253
|
+
| FunctionReference<any, any>
|
|
254
|
+
| FunctionReference_future<any, any>,
|
|
80
255
|
): string {
|
|
81
256
|
const address = getFunctionAddress(functionReference);
|
|
82
257
|
|
|
@@ -431,13 +606,33 @@ export type PartialApi<API> = {
|
|
|
431
606
|
export const anyApi: AnyApi = createApi() as any;
|
|
432
607
|
|
|
433
608
|
/**
|
|
434
|
-
* Given a {@link FunctionReference}
|
|
609
|
+
* Given a {@link FunctionReference} or {@link FunctionReference_future}, get
|
|
610
|
+
* the arguments of the function.
|
|
435
611
|
*
|
|
436
612
|
* This is represented as an object mapping argument names to values.
|
|
613
|
+
*
|
|
437
614
|
* @public
|
|
438
615
|
*/
|
|
439
|
-
export type FunctionArgs<
|
|
440
|
-
FuncRef
|
|
616
|
+
export type FunctionArgs<
|
|
617
|
+
FuncRef extends
|
|
618
|
+
| FunctionReference<any, any>
|
|
619
|
+
| FunctionReference_future<any, any>,
|
|
620
|
+
> = ExtractSignature<FuncRef>["args"];
|
|
621
|
+
|
|
622
|
+
// The arguments and return type a reference declares. A `FunctionReference`
|
|
623
|
+
// declares them in `_args` and `_returnType`, a `FunctionReference_future`
|
|
624
|
+
// only in its `_fn` slot. Reading the named slots first also covers a
|
|
625
|
+
// reference typed by an older copy of this package, which has no `_fn`.
|
|
626
|
+
type ExtractSignature<FuncRef> = FuncRef extends {
|
|
627
|
+
_args: infer Args;
|
|
628
|
+
_returnType: infer R;
|
|
629
|
+
}
|
|
630
|
+
? { args: Args; returnType: R }
|
|
631
|
+
: FuncRef extends {
|
|
632
|
+
_fn?: ((args: infer Args, keys: never) => infer R) | undefined;
|
|
633
|
+
}
|
|
634
|
+
? { args: Args; returnType: R }
|
|
635
|
+
: { args: any; returnType: any };
|
|
441
636
|
|
|
442
637
|
/**
|
|
443
638
|
* A tuple type of the (maybe optional) arguments to `FuncRef`.
|
|
@@ -447,10 +642,14 @@ export type FunctionArgs<FuncRef extends AnyFunctionReference> =
|
|
|
447
642
|
*
|
|
448
643
|
* @public
|
|
449
644
|
*/
|
|
450
|
-
export type OptionalRestArgs<
|
|
451
|
-
FuncRef
|
|
645
|
+
export type OptionalRestArgs<
|
|
646
|
+
FuncRef extends
|
|
647
|
+
| FunctionReference<any, any>
|
|
648
|
+
| FunctionReference_future<any, any>,
|
|
649
|
+
> =
|
|
650
|
+
FunctionArgs<FuncRef> extends EmptyObject
|
|
452
651
|
? [args?: EmptyObject]
|
|
453
|
-
: [args: FuncRef
|
|
652
|
+
: [args: FunctionArgs<FuncRef>];
|
|
454
653
|
|
|
455
654
|
/**
|
|
456
655
|
* A tuple type of the (maybe optional) arguments to `FuncRef`, followed by an options
|
|
@@ -462,19 +661,26 @@ export type OptionalRestArgs<FuncRef extends AnyFunctionReference> =
|
|
|
462
661
|
* @public
|
|
463
662
|
*/
|
|
464
663
|
export type ArgsAndOptions<
|
|
465
|
-
FuncRef extends
|
|
664
|
+
FuncRef extends
|
|
665
|
+
| FunctionReference<any, any>
|
|
666
|
+
| FunctionReference_future<any, any>,
|
|
466
667
|
Options,
|
|
467
|
-
> =
|
|
468
|
-
|
|
469
|
-
|
|
668
|
+
> =
|
|
669
|
+
FunctionArgs<FuncRef> extends EmptyObject
|
|
670
|
+
? [args?: EmptyObject, options?: Options]
|
|
671
|
+
: [args: FunctionArgs<FuncRef>, options?: Options];
|
|
470
672
|
|
|
471
673
|
/**
|
|
472
|
-
* Given a {@link FunctionReference}
|
|
674
|
+
* Given a {@link FunctionReference} or {@link FunctionReference_future}, get
|
|
675
|
+
* the return type of the function.
|
|
473
676
|
*
|
|
474
677
|
* @public
|
|
475
678
|
*/
|
|
476
|
-
export type FunctionReturnType<
|
|
477
|
-
FuncRef
|
|
679
|
+
export type FunctionReturnType<
|
|
680
|
+
FuncRef extends
|
|
681
|
+
| FunctionReference<any, any>
|
|
682
|
+
| FunctionReference_future<any, any>,
|
|
683
|
+
> = ExtractSignature<FuncRef>["returnType"];
|
|
478
684
|
|
|
479
685
|
type UndefinedToNull<T> = T extends void ? null : T;
|
|
480
686
|
|
|
@@ -3,6 +3,7 @@ import { version } from "../../index.js";
|
|
|
3
3
|
import {
|
|
4
4
|
AnyFunctionReference,
|
|
5
5
|
FunctionReference,
|
|
6
|
+
FunctionReference_future,
|
|
6
7
|
FunctionType,
|
|
7
8
|
} from "../api.js";
|
|
8
9
|
import { performAsyncSyscall } from "../impl/syscall.js";
|
|
@@ -66,12 +67,9 @@ export async function createFunctionHandle<
|
|
|
66
67
|
Args extends DefaultFunctionArgs,
|
|
67
68
|
ReturnType,
|
|
68
69
|
>(
|
|
69
|
-
functionReference:
|
|
70
|
-
Type,
|
|
71
|
-
"public" | "internal",
|
|
72
|
-
Args,
|
|
73
|
-
ReturnType
|
|
74
|
-
>,
|
|
70
|
+
functionReference:
|
|
71
|
+
| FunctionReference<Type, "public" | "internal", Args, ReturnType>
|
|
72
|
+
| FunctionReference_future<Type, "public" | "internal", Args, ReturnType>,
|
|
75
73
|
): Promise<FunctionHandle<Type, Args, ReturnType>> {
|
|
76
74
|
const address = getFunctionAddress(functionReference);
|
|
77
75
|
return await performAsyncSyscall("1.0/createFunctionHandle", {
|
package/src/server/cron.ts
CHANGED
|
@@ -1,9 +1,19 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import {
|
|
2
|
+
FunctionReference_future,
|
|
3
|
+
getFunctionName,
|
|
4
|
+
OptionalRestArgs,
|
|
5
|
+
} from "../server/api.js";
|
|
2
6
|
import { parseArgs } from "../common/index.js";
|
|
3
7
|
import { convexToJson, JSONValue, Value } from "../values/index.js";
|
|
4
8
|
import { getFunctionAddress } from "./components/paths.js";
|
|
5
9
|
import { SchedulableFunctionReference } from "./scheduler.js";
|
|
6
10
|
|
|
11
|
+
// Mirrors the constraint on `Scheduler.runAfter` and `Scheduler.runAt`, which
|
|
12
|
+
// is module-local to `scheduler.ts`.
|
|
13
|
+
type SchedulableFunctionReferenceCompat =
|
|
14
|
+
| SchedulableFunctionReference
|
|
15
|
+
| FunctionReference_future<"mutation" | "action", "public" | "internal">;
|
|
16
|
+
|
|
7
17
|
type CronSchedule = {
|
|
8
18
|
type: "cron";
|
|
9
19
|
cron: string;
|
|
@@ -238,8 +248,8 @@ function validatedOptionalMinuteOfHour(n: number | undefined) {
|
|
|
238
248
|
// call shapes apart by whether the second argument resolves to a function
|
|
239
249
|
// reference (the way the scheduler syscalls do) rather than a schedule object.
|
|
240
250
|
function isSchedulableFunctionReference(
|
|
241
|
-
arg: Hourly |
|
|
242
|
-
): arg is
|
|
251
|
+
arg: Hourly | SchedulableFunctionReferenceCompat,
|
|
252
|
+
): arg is SchedulableFunctionReferenceCompat {
|
|
243
253
|
try {
|
|
244
254
|
getFunctionAddress(arg);
|
|
245
255
|
return true;
|
|
@@ -280,7 +290,7 @@ export class Crons {
|
|
|
280
290
|
schedule(
|
|
281
291
|
cronIdentifier: string,
|
|
282
292
|
schedule: Schedule,
|
|
283
|
-
functionReference:
|
|
293
|
+
functionReference: SchedulableFunctionReferenceCompat,
|
|
284
294
|
args?: Record<string, Value>,
|
|
285
295
|
) {
|
|
286
296
|
const cronArgs = parseArgs(args);
|
|
@@ -304,11 +314,11 @@ export class Crons {
|
|
|
304
314
|
*
|
|
305
315
|
* @param identifier - A unique name for this scheduled job.
|
|
306
316
|
* @param schedule - The time between runs for this scheduled job.
|
|
307
|
-
* @param functionReference - A {@link FunctionReference}
|
|
308
|
-
* to schedule.
|
|
317
|
+
* @param functionReference - A {@link FunctionReference} or
|
|
318
|
+
* {@link FunctionReference_future} for the function to schedule.
|
|
309
319
|
* @param args - The arguments to the function.
|
|
310
320
|
*/
|
|
311
|
-
interval<FuncRef extends
|
|
321
|
+
interval<FuncRef extends SchedulableFunctionReferenceCompat>(
|
|
312
322
|
cronIdentifier: string,
|
|
313
323
|
schedule: Interval,
|
|
314
324
|
functionReference: FuncRef,
|
|
@@ -353,22 +363,22 @@ export class Crons {
|
|
|
353
363
|
* @param cronIdentifier - A unique name for this scheduled job.
|
|
354
364
|
* @param schedule - What minute (UTC) of each hour to run this function. May
|
|
355
365
|
* be omitted to let Convex pick a minute and spread runs across the hour.
|
|
356
|
-
* @param functionReference - A {@link FunctionReference}
|
|
357
|
-
* to schedule.
|
|
366
|
+
* @param functionReference - A {@link FunctionReference} or
|
|
367
|
+
* {@link FunctionReference_future} for the function to schedule.
|
|
358
368
|
* @param args - The arguments to the function.
|
|
359
369
|
*/
|
|
360
|
-
hourly<FuncRef extends
|
|
370
|
+
hourly<FuncRef extends SchedulableFunctionReferenceCompat>(
|
|
361
371
|
cronIdentifier: string,
|
|
362
372
|
functionReference: FuncRef,
|
|
363
373
|
...args: OptionalRestArgs<FuncRef>
|
|
364
374
|
): void;
|
|
365
|
-
hourly<FuncRef extends
|
|
375
|
+
hourly<FuncRef extends SchedulableFunctionReferenceCompat>(
|
|
366
376
|
cronIdentifier: string,
|
|
367
377
|
schedule: Hourly,
|
|
368
378
|
functionReference: FuncRef,
|
|
369
379
|
...args: OptionalRestArgs<FuncRef>
|
|
370
380
|
): void;
|
|
371
|
-
hourly<FuncRef extends
|
|
381
|
+
hourly<FuncRef extends SchedulableFunctionReferenceCompat>(
|
|
372
382
|
cronIdentifier: string,
|
|
373
383
|
scheduleOrFunctionReference: Hourly | FuncRef,
|
|
374
384
|
functionReferenceOrArg?: FuncRef | Record<string, Value>,
|
|
@@ -414,11 +424,11 @@ export class Crons {
|
|
|
414
424
|
*
|
|
415
425
|
* @param cronIdentifier - A unique name for this scheduled job.
|
|
416
426
|
* @param schedule - What time (UTC) each day to run this function.
|
|
417
|
-
* @param functionReference - A {@link FunctionReference}
|
|
418
|
-
* to schedule.
|
|
427
|
+
* @param functionReference - A {@link FunctionReference} or
|
|
428
|
+
* {@link FunctionReference_future} for the function to schedule.
|
|
419
429
|
* @param args - The arguments to the function.
|
|
420
430
|
*/
|
|
421
|
-
daily<FuncRef extends
|
|
431
|
+
daily<FuncRef extends SchedulableFunctionReferenceCompat>(
|
|
422
432
|
cronIdentifier: string,
|
|
423
433
|
schedule: Daily,
|
|
424
434
|
functionReference: FuncRef,
|
|
@@ -453,10 +463,10 @@ export class Crons {
|
|
|
453
463
|
*
|
|
454
464
|
* @param cronIdentifier - A unique name for this scheduled job.
|
|
455
465
|
* @param schedule - What day and time (UTC) each week to run this function.
|
|
456
|
-
* @param functionReference - A {@link FunctionReference}
|
|
457
|
-
* to schedule.
|
|
466
|
+
* @param functionReference - A {@link FunctionReference} or
|
|
467
|
+
* {@link FunctionReference_future} for the function to schedule.
|
|
458
468
|
*/
|
|
459
|
-
weekly<FuncRef extends
|
|
469
|
+
weekly<FuncRef extends SchedulableFunctionReferenceCompat>(
|
|
460
470
|
cronIdentifier: string,
|
|
461
471
|
schedule: Weekly,
|
|
462
472
|
functionReference: FuncRef,
|
|
@@ -495,11 +505,11 @@ export class Crons {
|
|
|
495
505
|
*
|
|
496
506
|
* @param cronIdentifier - A unique name for this scheduled job.
|
|
497
507
|
* @param schedule - What day and time (UTC) each month to run this function.
|
|
498
|
-
* @param functionReference - A {@link FunctionReference}
|
|
499
|
-
* to schedule.
|
|
508
|
+
* @param functionReference - A {@link FunctionReference} or
|
|
509
|
+
* {@link FunctionReference_future} for the function to schedule.
|
|
500
510
|
* @param args - The arguments to the function.
|
|
501
511
|
*/
|
|
502
|
-
monthly<FuncRef extends
|
|
512
|
+
monthly<FuncRef extends SchedulableFunctionReferenceCompat>(
|
|
503
513
|
cronIdentifier: string,
|
|
504
514
|
schedule: Monthly,
|
|
505
515
|
functionReference: FuncRef,
|
|
@@ -534,11 +544,11 @@ export class Crons {
|
|
|
534
544
|
*
|
|
535
545
|
* @param cronIdentifier - A unique name for this scheduled job.
|
|
536
546
|
* @param cron - Cron string like `"15 7 * * *"` (Every day at 7:15 UTC)
|
|
537
|
-
* @param functionReference - A {@link FunctionReference}
|
|
538
|
-
* to schedule.
|
|
547
|
+
* @param functionReference - A {@link FunctionReference} or
|
|
548
|
+
* {@link FunctionReference_future} for the function to schedule.
|
|
539
549
|
* @param args - The arguments to the function.
|
|
540
550
|
*/
|
|
541
|
-
cron<FuncRef extends
|
|
551
|
+
cron<FuncRef extends SchedulableFunctionReferenceCompat>(
|
|
542
552
|
cronIdentifier: string,
|
|
543
553
|
cron: CronString,
|
|
544
554
|
functionReference: FuncRef,
|
|
@@ -2,7 +2,10 @@ import { convexToJson, jsonToConvex, Value } from "../../values/index.js";
|
|
|
2
2
|
import { version } from "../../index.js";
|
|
3
3
|
import { performAsyncSyscall } from "./syscall.js";
|
|
4
4
|
import { parseArgs } from "../../common/index.js";
|
|
5
|
-
import {
|
|
5
|
+
import {
|
|
6
|
+
FunctionReference,
|
|
7
|
+
FunctionReference_future,
|
|
8
|
+
} from "../../server/api.js";
|
|
6
9
|
import { getFunctionAddress } from "../components/paths.js";
|
|
7
10
|
import { validateArg } from "./validate.js";
|
|
8
11
|
|
|
@@ -23,7 +26,9 @@ function syscallArgs(
|
|
|
23
26
|
export function setupActionCalls(requestId: string) {
|
|
24
27
|
return {
|
|
25
28
|
runQuery: async (
|
|
26
|
-
query:
|
|
29
|
+
query:
|
|
30
|
+
| FunctionReference<"query", "public" | "internal">
|
|
31
|
+
| FunctionReference_future<"query", "public" | "internal">,
|
|
27
32
|
args?: Record<string, Value>,
|
|
28
33
|
): Promise<any> => {
|
|
29
34
|
const result = await performAsyncSyscall(
|
|
@@ -33,7 +38,9 @@ export function setupActionCalls(requestId: string) {
|
|
|
33
38
|
return jsonToConvex(result);
|
|
34
39
|
},
|
|
35
40
|
runMutation: async (
|
|
36
|
-
mutation:
|
|
41
|
+
mutation:
|
|
42
|
+
| FunctionReference<"mutation", "public" | "internal">
|
|
43
|
+
| FunctionReference_future<"mutation", "public" | "internal">,
|
|
37
44
|
args?: Record<string, Value>,
|
|
38
45
|
): Promise<any> => {
|
|
39
46
|
const result = await performAsyncSyscall(
|
|
@@ -43,7 +50,9 @@ export function setupActionCalls(requestId: string) {
|
|
|
43
50
|
return jsonToConvex(result);
|
|
44
51
|
},
|
|
45
52
|
runAction: async (
|
|
46
|
-
action:
|
|
53
|
+
action:
|
|
54
|
+
| FunctionReference<"action", "public" | "internal">
|
|
55
|
+
| FunctionReference_future<"action", "public" | "internal">,
|
|
47
56
|
args?: Record<string, Value>,
|
|
48
57
|
): Promise<any> => {
|
|
49
58
|
const result = await performAsyncSyscall(
|
|
@@ -55,26 +64,46 @@ export function setupActionCalls(requestId: string) {
|
|
|
55
64
|
};
|
|
56
65
|
}
|
|
57
66
|
|
|
67
|
+
/**
|
|
68
|
+
* A Convex-managed service. The backend decides which names it accepts; this
|
|
69
|
+
* type lists the ones the current release knows about.
|
|
70
|
+
*/
|
|
71
|
+
export type ServiceName = "ai-gateway";
|
|
72
|
+
|
|
58
73
|
/**
|
|
59
74
|
* Get a short-lived credential for calling a Convex-managed service.
|
|
60
75
|
*
|
|
61
76
|
* This function can only be called while an action is running. The credential
|
|
62
77
|
* is scoped to the current deployment and should be sent as a bearer token.
|
|
63
|
-
*
|
|
64
|
-
*
|
|
78
|
+
* The action runtime caches and refreshes credentials as needed, so call
|
|
79
|
+
* this function whenever making a service request.
|
|
65
80
|
*
|
|
66
81
|
* @param service - The service the credential may access.
|
|
67
82
|
* @returns A JWT to send as `Authorization: Bearer <token>`. Keep it inside
|
|
68
83
|
* the action: don't return it to clients or store it in environment
|
|
69
84
|
* variables.
|
|
70
85
|
*/
|
|
71
|
-
export async function getServiceToken(service:
|
|
86
|
+
export async function getServiceToken(service: ServiceName): Promise<string> {
|
|
72
87
|
validateArg(service, 1, "getServiceToken", "service");
|
|
73
|
-
if (service !== "ai-gateway") {
|
|
74
|
-
throw new Error(`Unsupported service "${String(service)}"`);
|
|
75
|
-
}
|
|
76
88
|
return await performAsyncSyscall("1.0/createServiceToken", {
|
|
77
89
|
service,
|
|
78
90
|
version,
|
|
79
91
|
});
|
|
80
92
|
}
|
|
93
|
+
|
|
94
|
+
/**
|
|
95
|
+
* Get the base URL of a Convex-managed service.
|
|
96
|
+
*
|
|
97
|
+
* This function can only be called while an action is running. Pair it with
|
|
98
|
+
* {@link getServiceToken} to reach the service.
|
|
99
|
+
*
|
|
100
|
+
* @param service - The service to address.
|
|
101
|
+
* @returns The service's origin, without a trailing slash.
|
|
102
|
+
*/
|
|
103
|
+
export async function getServiceUrl(service: ServiceName): Promise<string> {
|
|
104
|
+
validateArg(service, 1, "getServiceUrl", "service");
|
|
105
|
+
return await performAsyncSyscall("1.0/getServiceUrl", {
|
|
106
|
+
service,
|
|
107
|
+
version,
|
|
108
|
+
});
|
|
109
|
+
}
|
|
@@ -8,7 +8,7 @@ import {
|
|
|
8
8
|
TransactionMetrics,
|
|
9
9
|
DeploymentMetadata,
|
|
10
10
|
} from "../meta.js";
|
|
11
|
-
import { performAsyncSyscall } from "./syscall.js";
|
|
11
|
+
import { performAsyncSyscall, performSyscall } from "./syscall.js";
|
|
12
12
|
|
|
13
13
|
async function getTransactionMetrics(): Promise<TransactionMetrics> {
|
|
14
14
|
let syscallJSON;
|
|
@@ -53,6 +53,11 @@ async function getDeploymentMetadata(): Promise<DeploymentMetadata> {
|
|
|
53
53
|
};
|
|
54
54
|
}
|
|
55
55
|
|
|
56
|
+
function getSnapshotTs(): bigint {
|
|
57
|
+
const syscallJSON = performSyscall("1.0/getSnapshotTs", {});
|
|
58
|
+
return jsonToConvex(syscallJSON) as bigint;
|
|
59
|
+
}
|
|
60
|
+
|
|
56
61
|
async function getRequestMetadata(): Promise<RequestMetadata> {
|
|
57
62
|
const { ip, userAgent, requestId, scheduledFunctionId, authToken } =
|
|
58
63
|
await performAsyncSyscall("1.0/getRequestMetadata", {});
|
|
@@ -70,6 +75,7 @@ export function setupQueryMeta(
|
|
|
70
75
|
}),
|
|
71
76
|
getTransactionMetrics,
|
|
72
77
|
getDeploymentMetadata,
|
|
78
|
+
getSnapshotTs,
|
|
73
79
|
};
|
|
74
80
|
}
|
|
75
81
|
|
|
@@ -85,6 +91,7 @@ export function setupMutationMeta(
|
|
|
85
91
|
getTransactionMetrics,
|
|
86
92
|
getDeploymentMetadata,
|
|
87
93
|
getRequestMetadata,
|
|
94
|
+
getSnapshotTs,
|
|
88
95
|
};
|
|
89
96
|
}
|
|
90
97
|
|
|
@@ -3,15 +3,22 @@ import { version } from "../../index.js";
|
|
|
3
3
|
import { performAsyncSyscall } from "./syscall.js";
|
|
4
4
|
import { parseArgs } from "../../common/index.js";
|
|
5
5
|
import { SchedulableFunctionReference, Scheduler } from "../scheduler.js";
|
|
6
|
+
import { FunctionReference_future } from "../api.js";
|
|
6
7
|
import { Id } from "../../values/value.js";
|
|
7
8
|
import { validateArg } from "./validate.js";
|
|
8
9
|
import { getFunctionAddress } from "../components/paths.js";
|
|
9
10
|
|
|
11
|
+
// Mirrors the constraint on `Scheduler.runAfter` and `Scheduler.runAt`, which
|
|
12
|
+
// is module-local to `scheduler.ts`.
|
|
13
|
+
type SchedulableFunctionReferenceCompat =
|
|
14
|
+
| SchedulableFunctionReference
|
|
15
|
+
| FunctionReference_future<"mutation" | "action", "public" | "internal">;
|
|
16
|
+
|
|
10
17
|
export function setupMutationScheduler(): Scheduler {
|
|
11
18
|
return {
|
|
12
19
|
runAfter: async (
|
|
13
20
|
delayMs: number,
|
|
14
|
-
functionReference:
|
|
21
|
+
functionReference: SchedulableFunctionReferenceCompat,
|
|
15
22
|
args?: Record<string, Value>,
|
|
16
23
|
) => {
|
|
17
24
|
const syscallArgs = runAfterSyscallArgs(delayMs, functionReference, args);
|
|
@@ -19,7 +26,7 @@ export function setupMutationScheduler(): Scheduler {
|
|
|
19
26
|
},
|
|
20
27
|
runAt: async (
|
|
21
28
|
ms_since_epoch_or_date: number | Date,
|
|
22
|
-
functionReference:
|
|
29
|
+
functionReference: SchedulableFunctionReferenceCompat,
|
|
23
30
|
args?: Record<string, Value>,
|
|
24
31
|
) => {
|
|
25
32
|
const syscallArgs = runAtSyscallArgs(
|
|
@@ -41,7 +48,7 @@ export function setupActionScheduler(requestId: string): Scheduler {
|
|
|
41
48
|
return {
|
|
42
49
|
runAfter: async (
|
|
43
50
|
delayMs: number,
|
|
44
|
-
functionReference:
|
|
51
|
+
functionReference: SchedulableFunctionReferenceCompat,
|
|
45
52
|
args?: Record<string, Value>,
|
|
46
53
|
) => {
|
|
47
54
|
const syscallArgs = {
|
|
@@ -52,7 +59,7 @@ export function setupActionScheduler(requestId: string): Scheduler {
|
|
|
52
59
|
},
|
|
53
60
|
runAt: async (
|
|
54
61
|
ms_since_epoch_or_date: number | Date,
|
|
55
|
-
functionReference:
|
|
62
|
+
functionReference: SchedulableFunctionReferenceCompat,
|
|
56
63
|
args?: Record<string, Value>,
|
|
57
64
|
) => {
|
|
58
65
|
const syscallArgs = {
|
|
@@ -74,7 +81,7 @@ export function setupActionScheduler(requestId: string): Scheduler {
|
|
|
74
81
|
|
|
75
82
|
function runAfterSyscallArgs(
|
|
76
83
|
delayMs: number,
|
|
77
|
-
functionReference:
|
|
84
|
+
functionReference: SchedulableFunctionReferenceCompat,
|
|
78
85
|
args?: Record<string, Value>,
|
|
79
86
|
) {
|
|
80
87
|
if (typeof delayMs !== "number") {
|
|
@@ -100,7 +107,7 @@ function runAfterSyscallArgs(
|
|
|
100
107
|
|
|
101
108
|
function runAtSyscallArgs(
|
|
102
109
|
ms_since_epoch_or_date: number | Date,
|
|
103
|
-
functionReference:
|
|
110
|
+
functionReference: SchedulableFunctionReferenceCompat,
|
|
104
111
|
args?: Record<string, Value>,
|
|
105
112
|
) {
|
|
106
113
|
let ts;
|