convex 1.45.0 → 1.46.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 +48 -6
- package/dist/browser.bundle.js +1 -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/cli/codegen.js +2 -0
- package/dist/cjs/cli/codegen.js.map +2 -2
- package/dist/cjs/cli/deploy.js +1 -0
- package/dist/cjs/cli/deploy.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/lib/checkForLargeIndexDeletion.js +101 -60
- package/dist/cjs/cli/lib/checkForLargeIndexDeletion.js.map +2 -2
- package/dist/cjs/cli/lib/checkForSlowSchemaValidation.js +107 -0
- package/dist/cjs/cli/lib/checkForSlowSchemaValidation.js.map +7 -0
- package/dist/cjs/cli/lib/codegen.js.map +2 -2
- package/dist/cjs/cli/lib/components.js +12 -0
- package/dist/cjs/cli/lib/components.js.map +2 -2
- package/dist/cjs/cli/lib/deploy2.js +29 -2
- package/dist/cjs/cli/lib/deploy2.js.map +2 -2
- package/dist/cjs/cli/lib/deployApi/evaluateSchema.js +73 -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 +1 -0
- package/dist/cjs/cli/lib/dev.js.map +2 -2
- package/dist/cjs/cli/lib/generatedFunctionLogsApi.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/run.js +1 -0
- package/dist/cjs/cli/lib/run.js.map +2 -2
- package/dist/cjs/cli/lib/utils/utils.js +36 -29
- package/dist/cjs/cli/lib/utils/utils.js.map +2 -2
- 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.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/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 +50 -3
- package/dist/cjs/server/schema.js.map +2 -2
- package/dist/cjs/values/validator.js +1 -1
- package/dist/cjs/values/validator.js.map +2 -2
- package/dist/cjs/values/validators.js +81 -25
- package/dist/cjs/values/validators.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/cli/codegen.d.ts.map +1 -1
- package/dist/cjs-types/cli/docs.d.ts.map +1 -1
- package/dist/cjs-types/cli/lib/checkForLargeIndexDeletion.d.ts +26 -5
- package/dist/cjs-types/cli/lib/checkForLargeIndexDeletion.d.ts.map +1 -1
- package/dist/cjs-types/cli/lib/checkForSlowSchemaValidation.d.ts +14 -0
- package/dist/cjs-types/cli/lib/checkForSlowSchemaValidation.d.ts.map +1 -0
- package/dist/cjs-types/cli/lib/codegen.d.ts +1 -0
- package/dist/cjs-types/cli/lib/codegen.d.ts.map +1 -1
- package/dist/cjs-types/cli/lib/components.d.ts +1 -0
- package/dist/cjs-types/cli/lib/components.d.ts.map +1 -1
- package/dist/cjs-types/cli/lib/deploy2.d.ts +6 -0
- package/dist/cjs-types/cli/lib/deploy2.d.ts.map +1 -1
- package/dist/cjs-types/cli/lib/deployApi/evaluateSchema.d.ts +453 -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.map +1 -1
- package/dist/cjs-types/cli/lib/generatedFunctionLogsApi.d.ts +2 -0
- package/dist/cjs-types/cli/lib/generatedFunctionLogsApi.d.ts.map +1 -1
- package/dist/cjs-types/cli/lib/localDeployment/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/run.d.ts.map +1 -1
- package/dist/cjs-types/cli/lib/utils/utils.d.ts +5 -5
- 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 +4 -4
- 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/index.d.ts +1 -1
- package/dist/cjs-types/server/index.d.ts.map +1 -1
- package/dist/cjs-types/server/meta.d.ts.map +1 -1
- package/dist/cjs-types/server/registration.d.ts +7 -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 +1 -0
- package/dist/cjs-types/server/schema.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/cli.bundle.cjs +347 -133
- 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/cli/codegen.js +2 -0
- package/dist/esm/cli/codegen.js.map +2 -2
- package/dist/esm/cli/deploy.js +1 -0
- package/dist/esm/cli/deploy.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/lib/checkForLargeIndexDeletion.js +100 -60
- package/dist/esm/cli/lib/checkForLargeIndexDeletion.js.map +2 -2
- package/dist/esm/cli/lib/checkForSlowSchemaValidation.js +85 -0
- package/dist/esm/cli/lib/checkForSlowSchemaValidation.js.map +7 -0
- package/dist/esm/cli/lib/codegen.js.map +2 -2
- package/dist/esm/cli/lib/components.js +12 -0
- package/dist/esm/cli/lib/components.js.map +2 -2
- package/dist/esm/cli/lib/deploy2.js +30 -2
- package/dist/esm/cli/lib/deploy2.js.map +2 -2
- package/dist/esm/cli/lib/deployApi/evaluateSchema.js +46 -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 +1 -0
- package/dist/esm/cli/lib/dev.js.map +2 -2
- 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/run.js +1 -0
- package/dist/esm/cli/lib/run.js.map +2 -2
- package/dist/esm/cli/lib/utils/utils.js +36 -30
- package/dist/esm/cli/lib/utils/utils.js.map +2 -2
- 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.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/index.js.map +2 -2
- package/dist/esm/server/schema.js +50 -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 +81 -25
- package/dist/esm/values/validators.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/cli/codegen.d.ts.map +1 -1
- package/dist/esm-types/cli/docs.d.ts.map +1 -1
- package/dist/esm-types/cli/lib/checkForLargeIndexDeletion.d.ts +26 -5
- package/dist/esm-types/cli/lib/checkForLargeIndexDeletion.d.ts.map +1 -1
- package/dist/esm-types/cli/lib/checkForSlowSchemaValidation.d.ts +14 -0
- package/dist/esm-types/cli/lib/checkForSlowSchemaValidation.d.ts.map +1 -0
- package/dist/esm-types/cli/lib/codegen.d.ts +1 -0
- package/dist/esm-types/cli/lib/codegen.d.ts.map +1 -1
- package/dist/esm-types/cli/lib/components.d.ts +1 -0
- package/dist/esm-types/cli/lib/components.d.ts.map +1 -1
- package/dist/esm-types/cli/lib/deploy2.d.ts +6 -0
- package/dist/esm-types/cli/lib/deploy2.d.ts.map +1 -1
- package/dist/esm-types/cli/lib/deployApi/evaluateSchema.d.ts +453 -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.map +1 -1
- package/dist/esm-types/cli/lib/generatedFunctionLogsApi.d.ts +2 -0
- package/dist/esm-types/cli/lib/generatedFunctionLogsApi.d.ts.map +1 -1
- package/dist/esm-types/cli/lib/localDeployment/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/run.d.ts.map +1 -1
- package/dist/esm-types/cli/lib/utils/utils.d.ts +5 -5
- 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 +4 -4
- 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/index.d.ts +1 -1
- package/dist/esm-types/server/index.d.ts.map +1 -1
- package/dist/esm-types/server/meta.d.ts.map +1 -1
- package/dist/esm-types/server/registration.d.ts +7 -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 +1 -0
- package/dist/esm-types/server/schema.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/react.bundle.js +1 -1
- package/dist/react.bundle.js.map +2 -2
- package/package.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/cli/codegen.ts +1 -0
- package/src/cli/deploy.ts +1 -0
- package/src/cli/docs.ts +3 -44
- package/src/cli/lib/checkForLargeIndexDeletion.ts +154 -82
- package/src/cli/lib/checkForSlowSchemaValidation.ts +130 -0
- package/src/cli/lib/codegen.ts +1 -0
- package/src/cli/lib/components.ts +17 -0
- package/src/cli/lib/deploy2.ts +56 -1
- package/src/cli/lib/deployApi/evaluateSchema.ts +62 -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 +1 -0
- package/src/cli/lib/generatedFunctionLogsApi.ts +2 -0
- 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/run.ts +1 -0
- package/src/cli/lib/utils/utils.ts +63 -35
- 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 +13 -4
- package/src/server/impl/meta_impl.ts +8 -1
- package/src/server/impl/scheduler_impl.ts +13 -6
- package/src/server/index.ts +1 -0
- package/src/server/meta.ts +25 -0
- package/src/server/registration.ts +28 -7
- package/src/server/scheduler.ts +22 -7
- package/src/server/schema.ts +55 -0
- package/src/values/validator.ts +3 -1
- package/src/values/validators.ts +84 -26
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "convex",
|
|
3
3
|
"description": "Client for the Convex Cloud",
|
|
4
|
-
"version": "1.
|
|
4
|
+
"version": "1.46.0",
|
|
5
5
|
"author": "Convex, Inc. <no-reply@convex.dev>",
|
|
6
6
|
"homepage": "https://convex.dev",
|
|
7
7
|
"repository": {
|
|
@@ -222,8 +222,8 @@
|
|
|
222
222
|
"@types/babel__code-frame": "^7.0.6",
|
|
223
223
|
"@types/deep-equal": "1.0.4",
|
|
224
224
|
"@types/node": "^18.17.0",
|
|
225
|
-
"@types/react": "^
|
|
226
|
-
"@types/react-dom": "^
|
|
225
|
+
"@types/react": "^19.2.4",
|
|
226
|
+
"@types/react-dom": "^19.2.3",
|
|
227
227
|
"@types/semver": "^7.3.13",
|
|
228
228
|
"@types/serve-handler": "~6.1.4",
|
|
229
229
|
"@types/ws": "^8.5.13",
|
|
@@ -258,8 +258,8 @@
|
|
|
258
258
|
"openapi-typescript-helpers": "~0.1.0",
|
|
259
259
|
"openid-client": "^5.3.1",
|
|
260
260
|
"ora": "^9.0.0",
|
|
261
|
-
"react": "^
|
|
262
|
-
"react-dom": "^
|
|
261
|
+
"react": "^19.2.4",
|
|
262
|
+
"react-dom": "^19.2.4",
|
|
263
263
|
"semver": "^7.6.0",
|
|
264
264
|
"serve-handler": "~6.1.6",
|
|
265
265
|
"shx": "~0.4.0",
|
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
import {
|
|
2
|
-
FunctionReference,
|
|
3
2
|
FunctionReturnType,
|
|
4
3
|
OptionalRestArgs,
|
|
5
4
|
getFunctionName,
|
|
5
|
+
FunctionReference,
|
|
6
|
+
FunctionReference_future,
|
|
6
7
|
} from "../server/api.js";
|
|
7
8
|
import { parseArgs, validateDeploymentUrl } from "../common/index.js";
|
|
8
9
|
import { version } from "../index.js";
|
|
@@ -68,7 +69,9 @@ export class ConvexHttpClient {
|
|
|
68
69
|
private fetch?: typeof globalThis.fetch | undefined;
|
|
69
70
|
private logger: Logger;
|
|
70
71
|
private mutationQueue: Array<{
|
|
71
|
-
mutation:
|
|
72
|
+
mutation:
|
|
73
|
+
| FunctionReference<"mutation">
|
|
74
|
+
| FunctionReference_future<"mutation">;
|
|
72
75
|
args: FunctionArgs<any>;
|
|
73
76
|
resolve: (value: any) => void;
|
|
74
77
|
reject: (error: any) => void;
|
|
@@ -223,7 +226,11 @@ export class ConvexHttpClient {
|
|
|
223
226
|
*
|
|
224
227
|
* @deprecated This API is experimental: it may change or disappear.
|
|
225
228
|
*/
|
|
226
|
-
async consistentQuery<
|
|
229
|
+
async consistentQuery<
|
|
230
|
+
Query extends
|
|
231
|
+
| FunctionReference<"query">
|
|
232
|
+
| FunctionReference_future<"query">,
|
|
233
|
+
>(
|
|
227
234
|
query: Query,
|
|
228
235
|
...args: OptionalRestArgs<Query>
|
|
229
236
|
): Promise<FunctionReturnType<Query>> {
|
|
@@ -267,7 +274,11 @@ export class ConvexHttpClient {
|
|
|
267
274
|
* the arguments will be `{}`.
|
|
268
275
|
* @returns A promise of the query's result.
|
|
269
276
|
*/
|
|
270
|
-
async query<
|
|
277
|
+
async query<
|
|
278
|
+
Query extends
|
|
279
|
+
| FunctionReference<"query">
|
|
280
|
+
| FunctionReference_future<"query">,
|
|
281
|
+
>(
|
|
271
282
|
query: Query,
|
|
272
283
|
...args: OptionalRestArgs<Query>
|
|
273
284
|
): Promise<FunctionReturnType<Query>> {
|
|
@@ -275,7 +286,11 @@ export class ConvexHttpClient {
|
|
|
275
286
|
return await this.queryInner(query, queryArgs, {});
|
|
276
287
|
}
|
|
277
288
|
|
|
278
|
-
private async queryInner<
|
|
289
|
+
private async queryInner<
|
|
290
|
+
Query extends
|
|
291
|
+
| FunctionReference<"query">
|
|
292
|
+
| FunctionReference_future<"query">,
|
|
293
|
+
>(
|
|
279
294
|
query: Query,
|
|
280
295
|
queryArgs: FunctionArgs<Query>,
|
|
281
296
|
options: { timestampPromise?: Promise<string> },
|
|
@@ -339,7 +354,11 @@ export class ConvexHttpClient {
|
|
|
339
354
|
}
|
|
340
355
|
}
|
|
341
356
|
|
|
342
|
-
private async mutationInner<
|
|
357
|
+
private async mutationInner<
|
|
358
|
+
Mutation extends
|
|
359
|
+
| FunctionReference<"mutation">
|
|
360
|
+
| FunctionReference_future<"mutation">,
|
|
361
|
+
>(
|
|
343
362
|
mutation: Mutation,
|
|
344
363
|
mutationArgs: FunctionArgs<Mutation>,
|
|
345
364
|
): Promise<FunctionReturnType<Mutation>> {
|
|
@@ -408,7 +427,11 @@ export class ConvexHttpClient {
|
|
|
408
427
|
this.isProcessingQueue = false;
|
|
409
428
|
}
|
|
410
429
|
|
|
411
|
-
private enqueueMutation<
|
|
430
|
+
private enqueueMutation<
|
|
431
|
+
Mutation extends
|
|
432
|
+
| FunctionReference<"mutation">
|
|
433
|
+
| FunctionReference_future<"mutation">,
|
|
434
|
+
>(
|
|
412
435
|
mutation: Mutation,
|
|
413
436
|
args: FunctionArgs<Mutation>,
|
|
414
437
|
): Promise<FunctionReturnType<Mutation>> {
|
|
@@ -427,7 +450,11 @@ export class ConvexHttpClient {
|
|
|
427
450
|
* @param options - An optional object containing
|
|
428
451
|
* @returns A promise of the mutation's result.
|
|
429
452
|
*/
|
|
430
|
-
async mutation<
|
|
453
|
+
async mutation<
|
|
454
|
+
Mutation extends
|
|
455
|
+
| FunctionReference<"mutation">
|
|
456
|
+
| FunctionReference_future<"mutation">,
|
|
457
|
+
>(
|
|
431
458
|
mutation: Mutation,
|
|
432
459
|
...args: ArgsAndOptions<Mutation, HttpMutationOptions>
|
|
433
460
|
): Promise<FunctionReturnType<Mutation>> {
|
|
@@ -450,7 +477,11 @@ export class ConvexHttpClient {
|
|
|
450
477
|
* the arguments will be `{}`.
|
|
451
478
|
* @returns A promise of the action's result.
|
|
452
479
|
*/
|
|
453
|
-
async action<
|
|
480
|
+
async action<
|
|
481
|
+
Action extends
|
|
482
|
+
| FunctionReference<"action">
|
|
483
|
+
| FunctionReference_future<"action">,
|
|
484
|
+
>(
|
|
454
485
|
action: Action,
|
|
455
486
|
...args: OptionalRestArgs<Action>
|
|
456
487
|
): Promise<FunctionReturnType<Action>> {
|
|
@@ -513,7 +544,9 @@ export class ConvexHttpClient {
|
|
|
513
544
|
* @internal
|
|
514
545
|
*/
|
|
515
546
|
async function<
|
|
516
|
-
AnyFunction extends
|
|
547
|
+
AnyFunction extends
|
|
548
|
+
| FunctionReference<"query" | "mutation" | "action">
|
|
549
|
+
| FunctionReference_future<"query" | "mutation" | "action">,
|
|
517
550
|
>(
|
|
518
551
|
anyFunction: AnyFunction | string,
|
|
519
552
|
componentPath?: string,
|
|
@@ -1,5 +1,9 @@
|
|
|
1
1
|
// Inspired by https://tanstack.com/query/v5/docs/framework/react/guides/query-options
|
|
2
|
-
import type {
|
|
2
|
+
import type {
|
|
3
|
+
FunctionArgs,
|
|
4
|
+
FunctionReference,
|
|
5
|
+
FunctionReference_future,
|
|
6
|
+
} from "../server/api.js";
|
|
3
7
|
|
|
4
8
|
/**
|
|
5
9
|
* Options for a Convex query: the query function reference and its arguments.
|
|
@@ -8,7 +12,9 @@ import type { FunctionArgs, FunctionReference } from "../server/api.js";
|
|
|
8
12
|
*
|
|
9
13
|
* @public
|
|
10
14
|
*/
|
|
11
|
-
export type QueryOptions<
|
|
15
|
+
export type QueryOptions<
|
|
16
|
+
Query extends FunctionReference<"query"> | FunctionReference_future<"query">,
|
|
17
|
+
> = {
|
|
12
18
|
/**
|
|
13
19
|
* The query function to run.
|
|
14
20
|
*/
|
|
@@ -40,8 +46,8 @@ export type QueryOptions<Query extends FunctionReference<"query">> = {
|
|
|
40
46
|
* @returns The same object, typed as `QueryOptions<Query>`.
|
|
41
47
|
* @internal
|
|
42
48
|
*/
|
|
43
|
-
export function convexQueryOptions<
|
|
44
|
-
|
|
45
|
-
): QueryOptions<Query> {
|
|
49
|
+
export function convexQueryOptions<
|
|
50
|
+
Query extends FunctionReference<"query"> | FunctionReference_future<"query">,
|
|
51
|
+
>(options: QueryOptions<Query>): QueryOptions<Query> {
|
|
46
52
|
return options;
|
|
47
53
|
}
|
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
import { validateDeploymentUrl } from "../common/index.js";
|
|
2
2
|
import {
|
|
3
3
|
FunctionArgs,
|
|
4
|
-
FunctionReference,
|
|
5
4
|
FunctionReturnType,
|
|
6
5
|
PaginationResult,
|
|
6
|
+
FunctionReference,
|
|
7
|
+
FunctionReference_future,
|
|
7
8
|
} from "../server/index.js";
|
|
8
9
|
import { getFunctionName } from "../server/api.js";
|
|
9
10
|
import { AuthTokenFetcher } from "./sync/authentication_manager.js";
|
|
@@ -184,14 +185,18 @@ export class ConvexClient {
|
|
|
184
185
|
*
|
|
185
186
|
* @return an {@link Unsubscribe} function to stop calling the onUpdate function.
|
|
186
187
|
*/
|
|
187
|
-
onUpdate<
|
|
188
|
+
onUpdate<
|
|
189
|
+
Query extends
|
|
190
|
+
| FunctionReference<"query">
|
|
191
|
+
| FunctionReference_future<"query">,
|
|
192
|
+
>(
|
|
188
193
|
query: Query,
|
|
189
194
|
args: FunctionArgs<Query>,
|
|
190
195
|
callback: (result: FunctionReturnType<Query>) => unknown,
|
|
191
196
|
onError?: (e: Error) => unknown,
|
|
192
|
-
): Unsubscribe<Query
|
|
197
|
+
): Unsubscribe<FunctionReturnType<Query>> {
|
|
193
198
|
if (this.disabled) {
|
|
194
|
-
return this.createDisabledUnsubscribe<Query
|
|
199
|
+
return this.createDisabledUnsubscribe<FunctionReturnType<Query>>();
|
|
195
200
|
}
|
|
196
201
|
|
|
197
202
|
// BaseConvexClient takes care of deduplicating queries subscriptions...
|
|
@@ -227,7 +232,7 @@ export class ConvexClient {
|
|
|
227
232
|
}
|
|
228
233
|
|
|
229
234
|
const unsubscribeProps: RemoveCallSignature<
|
|
230
|
-
Unsubscribe<Query
|
|
235
|
+
Unsubscribe<FunctionReturnType<Query>>
|
|
231
236
|
> = {
|
|
232
237
|
unsubscribe: () => {
|
|
233
238
|
if (this.closed) {
|
|
@@ -241,7 +246,7 @@ export class ConvexClient {
|
|
|
241
246
|
getQueryLogs: () => this.client.localQueryLogs(queryToken),
|
|
242
247
|
};
|
|
243
248
|
const ret = unsubscribeProps.unsubscribe as Unsubscribe<
|
|
244
|
-
Query
|
|
249
|
+
FunctionReturnType<Query>
|
|
245
250
|
>;
|
|
246
251
|
Object.assign(ret, unsubscribeProps);
|
|
247
252
|
return ret;
|
|
@@ -262,7 +267,11 @@ export class ConvexClient {
|
|
|
262
267
|
*
|
|
263
268
|
* @return an {@link Unsubscribe} function to stop calling the callback.
|
|
264
269
|
*/
|
|
265
|
-
onPaginatedUpdate_experimental<
|
|
270
|
+
onPaginatedUpdate_experimental<
|
|
271
|
+
Query extends
|
|
272
|
+
| FunctionReference<"query">
|
|
273
|
+
| FunctionReference_future<"query">,
|
|
274
|
+
>(
|
|
266
275
|
query: Query,
|
|
267
276
|
args: FunctionArgs<Query>,
|
|
268
277
|
options: { initialNumItems: number },
|
|
@@ -487,7 +496,11 @@ export class ConvexClient {
|
|
|
487
496
|
* @param options - A {@link MutationOptions} options object for the mutation.
|
|
488
497
|
* @returns A promise of the mutation's result.
|
|
489
498
|
*/
|
|
490
|
-
async mutation<
|
|
499
|
+
async mutation<
|
|
500
|
+
Mutation extends
|
|
501
|
+
| FunctionReference<"mutation">
|
|
502
|
+
| FunctionReference_future<"mutation">,
|
|
503
|
+
>(
|
|
491
504
|
mutation: Mutation,
|
|
492
505
|
args: FunctionArgs<Mutation>,
|
|
493
506
|
options?: MutationOptions,
|
|
@@ -504,7 +517,11 @@ export class ConvexClient {
|
|
|
504
517
|
* @param args - An arguments object for the action.
|
|
505
518
|
* @returns A promise of the action's result.
|
|
506
519
|
*/
|
|
507
|
-
async action<
|
|
520
|
+
async action<
|
|
521
|
+
Action extends
|
|
522
|
+
| FunctionReference<"action">
|
|
523
|
+
| FunctionReference_future<"action">,
|
|
524
|
+
>(
|
|
508
525
|
action: Action,
|
|
509
526
|
args: FunctionArgs<Action>,
|
|
510
527
|
): Promise<Awaited<FunctionReturnType<Action>>> {
|
|
@@ -520,13 +537,17 @@ export class ConvexClient {
|
|
|
520
537
|
* @param args - An arguments object for the query.
|
|
521
538
|
* @returns A promise of the query's result.
|
|
522
539
|
*/
|
|
523
|
-
async query<
|
|
540
|
+
async query<
|
|
541
|
+
Query extends
|
|
542
|
+
| FunctionReference<"query">
|
|
543
|
+
| FunctionReference_future<"query">,
|
|
544
|
+
>(
|
|
524
545
|
query: Query,
|
|
525
|
-
args: Query
|
|
526
|
-
): Promise<Awaited<Query
|
|
546
|
+
args: FunctionArgs<Query>,
|
|
547
|
+
): Promise<Awaited<FunctionReturnType<Query>>> {
|
|
527
548
|
if (this.disabled) throw new Error("ConvexClient is disabled");
|
|
528
549
|
const value = this.client.localQueryResult(getFunctionName(query), args) as
|
|
529
|
-
| Awaited<Query
|
|
550
|
+
| Awaited<FunctionReturnType<Query>>
|
|
530
551
|
| undefined;
|
|
531
552
|
if (value !== undefined) return Promise.resolve(value);
|
|
532
553
|
|
|
@@ -583,7 +604,7 @@ type QueryInfo = {
|
|
|
583
604
|
queryToken: QueryToken | PaginatedQueryToken;
|
|
584
605
|
hasEverRun: boolean;
|
|
585
606
|
// query, args and paginationOptions are just here for debugging, the queryToken is authoritative
|
|
586
|
-
query: FunctionReference<"query">;
|
|
607
|
+
query: FunctionReference<"query"> | FunctionReference_future<"query">;
|
|
587
608
|
args: any;
|
|
588
609
|
paginationOptions: { initialNumItems: number; id: number } | undefined;
|
|
589
610
|
};
|
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
import { Value } from "../../values/index.js";
|
|
2
2
|
import {
|
|
3
3
|
FunctionArgs,
|
|
4
|
-
FunctionReference,
|
|
5
4
|
FunctionReturnType,
|
|
6
5
|
OptionalRestArgs,
|
|
6
|
+
FunctionReference,
|
|
7
|
+
FunctionReference_future,
|
|
7
8
|
} from "../../server/api.js";
|
|
8
9
|
|
|
9
10
|
/**
|
|
@@ -25,7 +26,11 @@ export interface OptimisticLocalStore {
|
|
|
25
26
|
* @returns The query result or `undefined` if the query is not currently
|
|
26
27
|
* in the client.
|
|
27
28
|
*/
|
|
28
|
-
getQuery<
|
|
29
|
+
getQuery<
|
|
30
|
+
Query extends
|
|
31
|
+
| FunctionReference<"query">
|
|
32
|
+
| FunctionReference_future<"query">,
|
|
33
|
+
>(
|
|
29
34
|
query: Query,
|
|
30
35
|
...args: OptionalRestArgs<Query>
|
|
31
36
|
): undefined | FunctionReturnType<Query>;
|
|
@@ -46,7 +51,11 @@ export interface OptimisticLocalStore {
|
|
|
46
51
|
* - `args` - The arguments object for the query.
|
|
47
52
|
* - `value` The query result or `undefined` if the query is loading.
|
|
48
53
|
*/
|
|
49
|
-
getAllQueries<
|
|
54
|
+
getAllQueries<
|
|
55
|
+
Query extends
|
|
56
|
+
| FunctionReference<"query">
|
|
57
|
+
| FunctionReference_future<"query">,
|
|
58
|
+
>(
|
|
50
59
|
query: Query,
|
|
51
60
|
): {
|
|
52
61
|
args: FunctionArgs<Query>;
|
|
@@ -66,7 +75,11 @@ export interface OptimisticLocalStore {
|
|
|
66
75
|
* @param value - The new value to set the query to or `undefined` to remove
|
|
67
76
|
* it from the client.
|
|
68
77
|
*/
|
|
69
|
-
setQuery<
|
|
78
|
+
setQuery<
|
|
79
|
+
Query extends
|
|
80
|
+
| FunctionReference<"query">
|
|
81
|
+
| FunctionReference_future<"query">,
|
|
82
|
+
>(
|
|
70
83
|
query: Query,
|
|
71
84
|
args: FunctionArgs<Query>,
|
|
72
85
|
value: undefined | FunctionReturnType<Query>,
|
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
import {
|
|
2
2
|
FunctionArgs,
|
|
3
|
-
FunctionReference,
|
|
4
3
|
FunctionReturnType,
|
|
5
4
|
OptionalRestArgs,
|
|
6
5
|
getFunctionName,
|
|
6
|
+
FunctionReference,
|
|
7
|
+
FunctionReference_future,
|
|
7
8
|
} from "../../server/api.js";
|
|
8
9
|
import { parseArgs } from "../../common/index.js";
|
|
9
10
|
import { Value } from "../../values/index.js";
|
|
@@ -40,7 +41,11 @@ class OptimisticLocalStoreImpl implements OptimisticLocalStore {
|
|
|
40
41
|
this.modifiedQueries = [];
|
|
41
42
|
}
|
|
42
43
|
|
|
43
|
-
getQuery<
|
|
44
|
+
getQuery<
|
|
45
|
+
Query extends
|
|
46
|
+
| FunctionReference<"query">
|
|
47
|
+
| FunctionReference_future<"query">,
|
|
48
|
+
>(
|
|
44
49
|
query: Query,
|
|
45
50
|
...args: OptionalRestArgs<Query>
|
|
46
51
|
): undefined | FunctionReturnType<Query> {
|
|
@@ -55,7 +60,11 @@ class OptimisticLocalStoreImpl implements OptimisticLocalStore {
|
|
|
55
60
|
return OptimisticLocalStoreImpl.queryValue(queryResult.result);
|
|
56
61
|
}
|
|
57
62
|
|
|
58
|
-
getAllQueries<
|
|
63
|
+
getAllQueries<
|
|
64
|
+
Query extends
|
|
65
|
+
| FunctionReference<"query">
|
|
66
|
+
| FunctionReference_future<"query">,
|
|
67
|
+
>(
|
|
59
68
|
query: Query,
|
|
60
69
|
): {
|
|
61
70
|
args: FunctionArgs<Query>;
|
|
@@ -77,7 +86,11 @@ class OptimisticLocalStoreImpl implements OptimisticLocalStore {
|
|
|
77
86
|
return queriesWithName;
|
|
78
87
|
}
|
|
79
88
|
|
|
80
|
-
setQuery<
|
|
89
|
+
setQuery<
|
|
90
|
+
QueryReference extends
|
|
91
|
+
| FunctionReference<"query">
|
|
92
|
+
| FunctionReference_future<"query">,
|
|
93
|
+
>(
|
|
81
94
|
queryReference: QueryReference,
|
|
82
95
|
args: FunctionArgs<QueryReference>,
|
|
83
96
|
value: undefined | FunctionReturnType<QueryReference>,
|
package/src/cli/codegen.ts
CHANGED
|
@@ -68,6 +68,7 @@ export const codegen = new Command("codegen")
|
|
|
68
68
|
debugNodeApis: false,
|
|
69
69
|
systemUdfs: !!options.systemUdfs,
|
|
70
70
|
largeIndexDeletionCheck: "no verification" as const, // `codegen` is a read-only operation
|
|
71
|
+
warnOnSlowSchemaValidation: false, // ditto: a codegen dry run never deploys
|
|
71
72
|
codegenOnlyThisComponent: options.componentDir,
|
|
72
73
|
};
|
|
73
74
|
|
package/src/cli/deploy.ts
CHANGED
|
@@ -333,6 +333,7 @@ async function deployToNewPreviewDeployment(
|
|
|
333
333
|
liveComponentSources: false,
|
|
334
334
|
pushAllModules: !!options.pushAllModules,
|
|
335
335
|
largeIndexDeletionCheck: "no verification", // fine for preview deployments
|
|
336
|
+
warnOnSlowSchemaValidation: true,
|
|
336
337
|
message: options.message,
|
|
337
338
|
};
|
|
338
339
|
showSpinner(`Deploying to ${previewUrl}...`);
|
package/src/cli/docs.ts
CHANGED
|
@@ -1,59 +1,18 @@
|
|
|
1
1
|
import { Command } from "@commander-js/extra-typings";
|
|
2
2
|
import { chalkStderr } from "chalk";
|
|
3
3
|
import open from "open";
|
|
4
|
-
import { Context, oneoffContext } from "../bundler/context.js";
|
|
5
4
|
import { logMessage } from "../bundler/log.js";
|
|
6
|
-
import {
|
|
7
|
-
BIG_BRAIN_URL,
|
|
8
|
-
bigBrainFetch,
|
|
9
|
-
deprecationCheckWarning,
|
|
10
|
-
} from "./lib/utils/utils.js";
|
|
11
|
-
import {
|
|
12
|
-
getDeploymentSelection,
|
|
13
|
-
deploymentNameFromSelection,
|
|
14
|
-
} from "./lib/deploymentSelection.js";
|
|
15
5
|
|
|
16
6
|
export const docs = new Command("docs")
|
|
17
7
|
.description("Open the docs in the browser")
|
|
18
8
|
.allowExcessArguments(false)
|
|
19
9
|
.option("--no-open", "Print docs URL instead of opening it in your browser")
|
|
20
10
|
.action(async (options) => {
|
|
21
|
-
|
|
22
|
-
url: undefined,
|
|
23
|
-
adminKey: undefined,
|
|
24
|
-
envFile: undefined,
|
|
25
|
-
});
|
|
26
|
-
const deploymentSelection = await getDeploymentSelection(ctx, {
|
|
27
|
-
url: undefined,
|
|
28
|
-
adminKey: undefined,
|
|
29
|
-
envFile: undefined,
|
|
30
|
-
});
|
|
31
|
-
const configuredDeployment =
|
|
32
|
-
deploymentNameFromSelection(deploymentSelection);
|
|
33
|
-
if (configuredDeployment === null) {
|
|
34
|
-
await openDocs(ctx, options.open);
|
|
35
|
-
return;
|
|
36
|
-
}
|
|
37
|
-
const getCookieUrl = new URL(
|
|
38
|
-
`get_cookie/${configuredDeployment}`,
|
|
39
|
-
BIG_BRAIN_URL,
|
|
40
|
-
);
|
|
41
|
-
const fetch = bigBrainFetch(ctx);
|
|
42
|
-
try {
|
|
43
|
-
const res = await fetch(getCookieUrl);
|
|
44
|
-
deprecationCheckWarning(ctx, res);
|
|
45
|
-
const { cookie } = await res.json();
|
|
46
|
-
await openDocs(ctx, options.open, cookie);
|
|
47
|
-
} catch {
|
|
48
|
-
await openDocs(ctx, options.open);
|
|
49
|
-
}
|
|
11
|
+
await openDocs(options.open);
|
|
50
12
|
});
|
|
51
13
|
|
|
52
|
-
async function openDocs(
|
|
53
|
-
|
|
54
|
-
if (cookie !== undefined) {
|
|
55
|
-
docsUrl += "/?t=" + cookie;
|
|
56
|
-
}
|
|
14
|
+
async function openDocs(toOpen: boolean) {
|
|
15
|
+
const docsUrl = "https://docs.convex.dev/?utm_source=convex-cli";
|
|
57
16
|
if (toOpen) {
|
|
58
17
|
await open(docsUrl);
|
|
59
18
|
logMessage(chalkStderr.green("Docs have launched! Check your browser."));
|