From 0e70cb130623920b6b3e0aba985907cd4ec12010 Mon Sep 17 00:00:00 2001 From: Ian Macartney Date: Tue, 11 Nov 2025 11:05:39 -0800 Subject: [PATCH 01/23] update configs --- commonjs.json | 8 --- esm.json | 8 --- node10stubs.mjs | 86 -------------------------- package.json | 143 ++++++++++++-------------------------------- tsconfig.build.json | 9 +++ 5 files changed, 47 insertions(+), 207 deletions(-) delete mode 100644 commonjs.json delete mode 100644 esm.json delete mode 100644 node10stubs.mjs create mode 100644 tsconfig.build.json diff --git a/commonjs.json b/commonjs.json deleted file mode 100644 index 29e7d92..0000000 --- a/commonjs.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "extends": "./tsconfig.json", - "include": ["src/**/*"], - "exclude": ["src/**/*.test.*", "../src/package.json"], - "compilerOptions": { - "outDir": "./dist/commonjs" - } -} diff --git a/esm.json b/esm.json deleted file mode 100644 index f984cc5..0000000 --- a/esm.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "extends": "./tsconfig.json", - "include": ["src/**/*"], - "exclude": ["src/**/*.test.*", "../src/package.json"], - "compilerOptions": { - "outDir": "./dist/esm" - } -} diff --git a/node10stubs.mjs b/node10stubs.mjs deleted file mode 100644 index 6a76782..0000000 --- a/node10stubs.mjs +++ /dev/null @@ -1,86 +0,0 @@ -import fs from "fs/promises"; -import path from "path"; - -async function findPackageJson(directory) { - const packagePath = path.join(directory, "package.json"); - try { - await fs.access(packagePath); - return packagePath; - } catch (error) { - const parentDir = path.dirname(directory); - if (parentDir === directory) { - throw new Error("package.json not found"); - } - return findPackageJson(parentDir); - } -} - -async function processSubPackages(packageJsonPath, exports, cleanup = false) { - const baseDir = path.dirname(packageJsonPath); - - for (const [subDir, _] of Object.entries(exports)) { - // package.json is already right where Node10 resolution would expect it. - if (subDir.endsWith("package.json")) continue; - // No need for Node10 resolution for component.config.ts - if (subDir.endsWith("convex.config.js")) continue; - // . just works with Node10 resolution - if (subDir === ".") continue; - console.log(subDir); - - const newDir = path.join(baseDir, subDir); - const newPackageJsonPath = path.join(newDir, "package.json"); - - if (cleanup) { - try { - await fs.rm(newDir, { recursive: true, force: true }); - } catch (error) { - console.error(`Failed to remove ${newDir}:`, error.message); - } - } else { - const newPackageJson = { - main: `../dist/commonjs/${subDir}/index.js`, - module: `../dist/esm/${subDir}/index.js`, - types: `../dist/commonjs/${subDir}/index.d.ts`, - }; - - await fs.mkdir(newDir, { recursive: true }); - await fs.writeFile( - newPackageJsonPath, - JSON.stringify(newPackageJson, null, 2), - ); - } - } -} - -async function main() { - try { - const isCleanup = process.argv.includes("--cleanup"); - const isAddFiles = process.argv.includes("--addFiles"); - const packageJsonPath = await findPackageJson(process.cwd()); - const packageJson = JSON.parse(await fs.readFile(packageJsonPath, "utf-8")); - - if (!packageJson.exports) { - throw new Error("exports not found in package.json"); - } - - if (isAddFiles) { - return; - } - - await processSubPackages(packageJsonPath, packageJson.exports, isCleanup); - - if (isCleanup) { - console.log( - "Node10 module resolution compatibility stub directories removed.", - ); - } else { - console.log( - "Node10 module resolution compatibility stub directories created", - ); - } - } catch (error) { - console.error("Error:", error.message); - } -} - -main(); diff --git a/package.json b/package.json index 0347c27..9ad28c2 100644 --- a/package.json +++ b/package.json @@ -18,143 +18,76 @@ ], "type": "module", "scripts": { - "build": "npm run build:esm && npm run build:cjs", - "build:esm": "tsc --project ./esm.json && tsc-alias -p ./esm.json && npm run build:esm:generatePackageJson", - "build:cjs": "tsc --project ./commonjs.json && npm run build:cjs:generatePackageJson", - "build:esm:generatePackageJson": "echo '{\\n \"type\": \"module\"\\n}' > dist/esm/package.json", - "build:cjs:generatePackageJson": "echo '{\\n \"type\": \"commonjs\"\\n}' > dist/commonjs/package.json", - "build:watch": "chokidar 'tsconfig*.json' 'src/**/*.{ts,tsx}' -c 'npm run build' --initial", - "typecheck": "tsc --noEmit", - "prepack": "node node10stubs.mjs", - "prepublishOnly": "npm run build", - "postpack": "node node10stubs.mjs --cleanup", + "build": "tsc --project ./tsconfig.build.json && tsc-alias -p ./tsconfig.build.json", + "clean": "rm -rf dist *.tsbuildinfo", + "dev": "run-p -r 'dev:*'", + "dev:backend": "convex dev --typecheck-components", + "dev:build": "chokidar 'tsconfig*.json' 'src/**/*.ts' -i '**/*.test.ts' -c 'convex codegen --component-dir ./src/component && npm run build' --initial", + "predev": "npm run dev:backend -- --until-success", + "typecheck": "tsc --noEmit && tsc -p examples/next && tsc -p examples/react && tsc -p examples/tanstack", + "lint": "eslint .", + "prepare": "npm run build", "generate": "concurrently \"cd examples/next && npm run generate\" \"cd examples/react && npm run generate\" \"cd examples/tanstack && npm run generate\"", - "test": "vitest run", + "test": "vitest run --typecheck", "test:debug": "vitest --inspect-brk --no-file-parallelism", - "test:coverage": "vitest run --coverage --coverage.reporter=text" + "test:coverage": "vitest run --coverage --coverage.reporter=text", + "alpha": "npm run clean && npm ci && run-p test lint typecheck && npm version prerelease --preid alpha && npm publish --tag alpha && git push --tags", + "release": "npm run clean && npm ci && run-p test lint typecheck && npm version patch && npm publish && git push --tags", + "version": "pbcopy <<<$npm_package_version; vim CHANGELOG.md && prettier -w CHANGELOG.md && git add CHANGELOG.md" }, "files": [ "dist", - "src", - "react", - "plugins" + "src" ], "exports": { "./package.json": "./package.json", ".": { - "import": { - "@convex-dev/component-source": "./src/client/index.ts", - "types": "./dist/esm/client/index.d.ts", - "default": "./dist/esm/client/index.js" - }, - "require": { - "@convex-dev/component-source": "./src/client/index.ts", - "types": "./dist/commonjs/client/index.d.ts", - "default": "./dist/commonjs/client/index.js" - } + "types": "./dist/client/index.d.ts", + "default": "./dist/client/index.js" }, "./adapter": { - "import": { - "@convex-dev/component-source": "./src/component/adapter.ts", - "types": "./dist/esm/component/adapter.d.ts", - "default": "./dist/esm/component/adapter.js" - }, - "require": { - "@convex-dev/component-source": "./src/component/adapter.ts", - "types": "./dist/commonjs/component/adapter.d.ts", - "default": "./dist/commonjs/component/adapter.js" - } + "types": "./dist/component/adapter.d.ts", + "default": "./dist/component/adapter.js" }, "./client/plugins": { - "import": { - "@convex-dev/component-source": "./src/client/plugins/index.ts", - "types": "./dist/esm/client/plugins/index.d.ts", - "default": "./dist/esm/client/plugins/index.js" - }, - "require": { - "@convex-dev/component-source": "./src/client/plugins/index.ts", - "types": "./dist/commonjs/client/plugins/index.d.ts", - "default": "./dist/commonjs/client/plugins/index.js" - } + "types": "./dist/client/plugins/index.d.ts", + "default": "./dist/client/plugins/index.js" }, "./nextjs": { - "import": { - "@convex-dev/component-source": "./src/nextjs/index.ts", - "types": "./dist/esm/nextjs/index.d.ts", - "default": "./dist/esm/nextjs/index.js" - }, - "require": { - "@convex-dev/component-source": "./src/nextjs/index.ts", - "types": "./dist/commonjs/nextjs/index.d.ts", - "default": "./dist/commonjs/nextjs/index.js" - } + "types": "./dist/nextjs/index.d.ts", + "default": "./dist/nextjs/index.js" }, "./plugins": { - "import": { - "@convex-dev/component-source": "./src/plugins/index.ts", - "types": "./dist/esm/plugins/index.d.ts", - "default": "./dist/esm/plugins/index.js" - }, - "require": { - "@convex-dev/component-source": "./src/plugins/index.ts", - "types": "./dist/commonjs/plugins/index.d.ts", - "default": "./dist/commonjs/plugins/index.js" - } + "types": "./dist/plugins/index.d.ts", + "default": "./dist/plugins/index.js" }, "./react": { - "import": { - "@convex-dev/component-source": "./src/react/index.tsx", - "types": "./dist/esm/react/index.d.ts", - "default": "./dist/esm/react/index.js" - }, - "require": { - "@convex-dev/component-source": "./src/react/index.tsx", - "types": "./dist/commonjs/react/index.d.ts", - "default": "./dist/commonjs/react/index.js" - } + "types": "./dist/react/index.d.ts", + "default": "./dist/react/index.js" }, "./react-start": { - "import": { - "@convex-dev/component-source": "./src/react-start/index.ts", - "types": "./dist/esm/react-start/index.d.ts", - "default": "./dist/esm/react-start/index.js" - }, - "require": { - "@convex-dev/component-source": "./src/react-start/index.ts", - "types": "./dist/commonjs/react-start/index.d.ts", - "default": "./dist/commonjs/react-start/index.js" - } + "types": "./dist/react-start/index.d.ts", + "default": "./dist/react-start/index.js" }, "./utils": { - "import": { - "@convex-dev/component-source": "./src/utils/index.ts", - "types": "./dist/esm/utils/index.d.ts", - "default": "./dist/esm/utils/index.js" - }, - "require": { - "@convex-dev/component-source": "./src/utils/index.ts", - "types": "./dist/commonjs/utils/index.d.ts", - "default": "./dist/commonjs/utils/index.js" - } + "types": "./dist/utils/index.d.ts", + "default": "./dist/utils/index.js" }, "./convex.config": { - "import": { - "@convex-dev/component-source": "./src/component/convex.config.ts", - "types": "./dist/esm/component/convex.config.d.ts", - "default": "./dist/esm/component/convex.config.js" - } + "types": "./dist/component/convex.config.d.ts", + "default": "./dist/component/convex.config.js" } }, "typesVersions": { "*": { "next-js": [ - "./dist/esm/nextjs/index.d.ts" + "./dist/nextjs/index.d.ts" ] } }, "peerDependencies": { "better-auth": "1.3.27", - "convex": ">=1.28.2 <1.35.0", + "convex": "^1.28.2", "react": "^18.3.1 || ^19.0.0", "react-dom": "^18.3.1 || ^19.0.0" }, @@ -170,6 +103,7 @@ "@types/semver": "^7.7.0", "chokidar-cli": "^3.0.0", "concurrently": "^9.2.0", + "convex": "1.29.0", "convex-test": "^0.0.33", "eslint": "^9.9.1", "globals": "^15.9.0", @@ -180,9 +114,8 @@ "typescript-eslint": "^8.4.0", "vitest": "^3.2.2" }, - "main": "./dist/commonjs/client/index.js", - "types": "./dist/commonjs/client/index.d.ts", - "module": "./dist/esm/client/index.js", + "types": "./dist/client/index.d.ts", + "module": "./dist/client/index.js", "dependencies": { "common-tags": "^1.8.2", "convex-helpers": "^0.1.95", diff --git a/tsconfig.build.json b/tsconfig.build.json new file mode 100644 index 0000000..2322d88 --- /dev/null +++ b/tsconfig.build.json @@ -0,0 +1,9 @@ +{ + "extends": "./tsconfig.json", + "include": ["src/**/*"], + "exclude": ["src/**/*.test.*", "./src/test.ts"], + "compilerOptions": { + "module": "ESNext", + "moduleResolution": "Bundler" + } +} From 6beefe2abd7384b20e97933047beb9947d6db755 Mon Sep 17 00:00:00 2001 From: Ian Macartney Date: Tue, 11 Nov 2025 11:20:18 -0800 Subject: [PATCH 02/23] codegen ts --- examples/react/convex/_generated/api.d.ts | 2260 +---------------- examples/react/convex/_generated/server.d.ts | 16 +- examples/react/convex/_generated/server.js | 13 +- examples/react/package-lock.json | 35 +- examples/tanstack/package-lock.json | 39 +- package.json | 8 + src/component/_generated/api.d.ts | 2145 ---------------- src/component/_generated/api.js | 23 - src/component/_generated/api.ts | 52 + src/component/_generated/component.ts | 2131 ++++++++++++++++ .../{dataModel.d.ts => dataModel.ts} | 0 src/component/_generated/server.js | 90 - .../_generated/{server.d.ts => server.ts} | 54 +- 13 files changed, 2305 insertions(+), 4561 deletions(-) delete mode 100644 src/component/_generated/api.d.ts delete mode 100644 src/component/_generated/api.js create mode 100644 src/component/_generated/api.ts create mode 100644 src/component/_generated/component.ts rename src/component/_generated/{dataModel.d.ts => dataModel.ts} (100%) delete mode 100644 src/component/_generated/server.js rename src/component/_generated/{server.d.ts => server.ts} (79%) diff --git a/examples/react/convex/_generated/api.d.ts b/examples/react/convex/_generated/api.d.ts index de09af3..2b5bc88 100644 --- a/examples/react/convex/_generated/api.d.ts +++ b/examples/react/convex/_generated/api.d.ts @@ -25,14 +25,6 @@ import type { FunctionReference, } from "convex/server"; -/** - * A utility for referencing Convex functions in your app's API. - * - * Usage: - * ```js - * const myFunctionReference = api.myModule.myFunction; - * ``` - */ declare const fullApi: ApiFromModules<{ auth: typeof auth; email: typeof email; @@ -45,2244 +37,34 @@ declare const fullApi: ApiFromModules<{ todos: typeof todos; util: typeof util; }>; -declare const fullApiWithMounts: typeof fullApi; +/** + * A utility for referencing Convex functions in your app's public API. + * + * Usage: + * ```js + * const myFunctionReference = api.myModule.myFunction; + * ``` + */ export declare const api: FilterApi< - typeof fullApiWithMounts, + typeof fullApi, FunctionReference >; + +/** + * A utility for referencing Convex functions in your app's internal API. + * + * Usage: + * ```js + * const myFunctionReference = internal.myModule.myFunction; + * ``` + */ export declare const internal: FilterApi< - typeof fullApiWithMounts, + typeof fullApi, FunctionReference >; export declare const components: { - betterAuth: { - adapter: { - create: FunctionReference< - "mutation", - "internal", - { - input: - | { - data: { - createdAt: number; - displayUsername?: null | string; - email: string; - emailVerified: boolean; - image?: null | string; - isAnonymous?: null | boolean; - name: string; - phoneNumber?: null | string; - phoneNumberVerified?: null | boolean; - twoFactorEnabled?: null | boolean; - updatedAt: number; - userId?: null | string; - username?: null | string; - }; - model: "user"; - } - | { - data: { - createdAt: number; - expiresAt: number; - ipAddress?: null | string; - token: string; - updatedAt: number; - userAgent?: null | string; - userId: string; - }; - model: "session"; - } - | { - data: { - accessToken?: null | string; - accessTokenExpiresAt?: null | number; - accountId: string; - createdAt: number; - idToken?: null | string; - password?: null | string; - providerId: string; - refreshToken?: null | string; - refreshTokenExpiresAt?: null | number; - scope?: null | string; - updatedAt: number; - userId: string; - }; - model: "account"; - } - | { - data: { - createdAt: number; - expiresAt: number; - identifier: string; - updatedAt: number; - value: string; - }; - model: "verification"; - } - | { - data: { backupCodes: string; secret: string; userId: string }; - model: "twoFactor"; - } - | { - data: { - aaguid?: null | string; - backedUp: boolean; - counter: number; - createdAt?: null | number; - credentialID: string; - deviceType: string; - name?: null | string; - publicKey: string; - transports?: null | string; - userId: string; - }; - model: "passkey"; - } - | { - data: { - clientId?: null | string; - clientSecret?: null | string; - createdAt?: null | number; - disabled?: null | boolean; - icon?: null | string; - metadata?: null | string; - name?: null | string; - redirectURLs?: null | string; - type?: null | string; - updatedAt?: null | number; - userId?: null | string; - }; - model: "oauthApplication"; - } - | { - data: { - accessToken?: null | string; - accessTokenExpiresAt?: null | number; - clientId?: null | string; - createdAt?: null | number; - refreshToken?: null | string; - refreshTokenExpiresAt?: null | number; - scopes?: null | string; - updatedAt?: null | number; - userId?: null | string; - }; - model: "oauthAccessToken"; - } - | { - data: { - clientId?: null | string; - consentGiven?: null | boolean; - createdAt?: null | number; - scopes?: null | string; - updatedAt?: null | number; - userId?: null | string; - }; - model: "oauthConsent"; - } - | { - data: { - createdAt: number; - privateKey: string; - publicKey: string; - }; - model: "jwks"; - } - | { - data: { - count?: null | number; - key?: null | string; - lastRequest?: null | number; - }; - model: "rateLimit"; - } - | { - data: { count: number; key: string; lastRequest: number }; - model: "ratelimit"; - }; - onCreateHandle?: string; - select?: Array; - }, - any - >; - deleteMany: FunctionReference< - "mutation", - "internal", - { - input: - | { - model: "user"; - where?: Array<{ - connector?: "AND" | "OR"; - field: - | "name" - | "email" - | "emailVerified" - | "image" - | "createdAt" - | "updatedAt" - | "twoFactorEnabled" - | "isAnonymous" - | "username" - | "displayUsername" - | "phoneNumber" - | "phoneNumberVerified" - | "userId" - | "_id"; - operator?: - | "lt" - | "lte" - | "gt" - | "gte" - | "eq" - | "in" - | "not_in" - | "ne" - | "contains" - | "starts_with" - | "ends_with"; - value: - | string - | number - | boolean - | Array - | Array - | null; - }>; - } - | { - model: "session"; - where?: Array<{ - connector?: "AND" | "OR"; - field: - | "expiresAt" - | "token" - | "createdAt" - | "updatedAt" - | "ipAddress" - | "userAgent" - | "userId" - | "_id"; - operator?: - | "lt" - | "lte" - | "gt" - | "gte" - | "eq" - | "in" - | "not_in" - | "ne" - | "contains" - | "starts_with" - | "ends_with"; - value: - | string - | number - | boolean - | Array - | Array - | null; - }>; - } - | { - model: "account"; - where?: Array<{ - connector?: "AND" | "OR"; - field: - | "accountId" - | "providerId" - | "userId" - | "accessToken" - | "refreshToken" - | "idToken" - | "accessTokenExpiresAt" - | "refreshTokenExpiresAt" - | "scope" - | "password" - | "createdAt" - | "updatedAt" - | "_id"; - operator?: - | "lt" - | "lte" - | "gt" - | "gte" - | "eq" - | "in" - | "not_in" - | "ne" - | "contains" - | "starts_with" - | "ends_with"; - value: - | string - | number - | boolean - | Array - | Array - | null; - }>; - } - | { - model: "verification"; - where?: Array<{ - connector?: "AND" | "OR"; - field: - | "identifier" - | "value" - | "expiresAt" - | "createdAt" - | "updatedAt" - | "_id"; - operator?: - | "lt" - | "lte" - | "gt" - | "gte" - | "eq" - | "in" - | "not_in" - | "ne" - | "contains" - | "starts_with" - | "ends_with"; - value: - | string - | number - | boolean - | Array - | Array - | null; - }>; - } - | { - model: "twoFactor"; - where?: Array<{ - connector?: "AND" | "OR"; - field: "secret" | "backupCodes" | "userId" | "_id"; - operator?: - | "lt" - | "lte" - | "gt" - | "gte" - | "eq" - | "in" - | "not_in" - | "ne" - | "contains" - | "starts_with" - | "ends_with"; - value: - | string - | number - | boolean - | Array - | Array - | null; - }>; - } - | { - model: "passkey"; - where?: Array<{ - connector?: "AND" | "OR"; - field: - | "name" - | "publicKey" - | "userId" - | "credentialID" - | "counter" - | "deviceType" - | "backedUp" - | "transports" - | "createdAt" - | "aaguid" - | "_id"; - operator?: - | "lt" - | "lte" - | "gt" - | "gte" - | "eq" - | "in" - | "not_in" - | "ne" - | "contains" - | "starts_with" - | "ends_with"; - value: - | string - | number - | boolean - | Array - | Array - | null; - }>; - } - | { - model: "oauthApplication"; - where?: Array<{ - connector?: "AND" | "OR"; - field: - | "name" - | "icon" - | "metadata" - | "clientId" - | "clientSecret" - | "redirectURLs" - | "type" - | "disabled" - | "userId" - | "createdAt" - | "updatedAt" - | "_id"; - operator?: - | "lt" - | "lte" - | "gt" - | "gte" - | "eq" - | "in" - | "not_in" - | "ne" - | "contains" - | "starts_with" - | "ends_with"; - value: - | string - | number - | boolean - | Array - | Array - | null; - }>; - } - | { - model: "oauthAccessToken"; - where?: Array<{ - connector?: "AND" | "OR"; - field: - | "accessToken" - | "refreshToken" - | "accessTokenExpiresAt" - | "refreshTokenExpiresAt" - | "clientId" - | "userId" - | "scopes" - | "createdAt" - | "updatedAt" - | "_id"; - operator?: - | "lt" - | "lte" - | "gt" - | "gte" - | "eq" - | "in" - | "not_in" - | "ne" - | "contains" - | "starts_with" - | "ends_with"; - value: - | string - | number - | boolean - | Array - | Array - | null; - }>; - } - | { - model: "oauthConsent"; - where?: Array<{ - connector?: "AND" | "OR"; - field: - | "clientId" - | "userId" - | "scopes" - | "createdAt" - | "updatedAt" - | "consentGiven" - | "_id"; - operator?: - | "lt" - | "lte" - | "gt" - | "gte" - | "eq" - | "in" - | "not_in" - | "ne" - | "contains" - | "starts_with" - | "ends_with"; - value: - | string - | number - | boolean - | Array - | Array - | null; - }>; - } - | { - model: "jwks"; - where?: Array<{ - connector?: "AND" | "OR"; - field: "publicKey" | "privateKey" | "createdAt" | "_id"; - operator?: - | "lt" - | "lte" - | "gt" - | "gte" - | "eq" - | "in" - | "not_in" - | "ne" - | "contains" - | "starts_with" - | "ends_with"; - value: - | string - | number - | boolean - | Array - | Array - | null; - }>; - } - | { - model: "rateLimit"; - where?: Array<{ - connector?: "AND" | "OR"; - field: "key" | "count" | "lastRequest" | "_id"; - operator?: - | "lt" - | "lte" - | "gt" - | "gte" - | "eq" - | "in" - | "not_in" - | "ne" - | "contains" - | "starts_with" - | "ends_with"; - value: - | string - | number - | boolean - | Array - | Array - | null; - }>; - } - | { - model: "ratelimit"; - where?: Array<{ - connector?: "AND" | "OR"; - field: "key" | "count" | "lastRequest" | "_id"; - operator?: - | "lt" - | "lte" - | "gt" - | "gte" - | "eq" - | "in" - | "not_in" - | "ne" - | "contains" - | "starts_with" - | "ends_with"; - value: - | string - | number - | boolean - | Array - | Array - | null; - }>; - }; - onDeleteHandle?: string; - paginationOpts: { - cursor: string | null; - endCursor?: string | null; - id?: number; - maximumBytesRead?: number; - maximumRowsRead?: number; - numItems: number; - }; - }, - any - >; - deleteOne: FunctionReference< - "mutation", - "internal", - { - input: - | { - model: "user"; - where?: Array<{ - connector?: "AND" | "OR"; - field: - | "name" - | "email" - | "emailVerified" - | "image" - | "createdAt" - | "updatedAt" - | "twoFactorEnabled" - | "isAnonymous" - | "username" - | "displayUsername" - | "phoneNumber" - | "phoneNumberVerified" - | "userId" - | "_id"; - operator?: - | "lt" - | "lte" - | "gt" - | "gte" - | "eq" - | "in" - | "not_in" - | "ne" - | "contains" - | "starts_with" - | "ends_with"; - value: - | string - | number - | boolean - | Array - | Array - | null; - }>; - } - | { - model: "session"; - where?: Array<{ - connector?: "AND" | "OR"; - field: - | "expiresAt" - | "token" - | "createdAt" - | "updatedAt" - | "ipAddress" - | "userAgent" - | "userId" - | "_id"; - operator?: - | "lt" - | "lte" - | "gt" - | "gte" - | "eq" - | "in" - | "not_in" - | "ne" - | "contains" - | "starts_with" - | "ends_with"; - value: - | string - | number - | boolean - | Array - | Array - | null; - }>; - } - | { - model: "account"; - where?: Array<{ - connector?: "AND" | "OR"; - field: - | "accountId" - | "providerId" - | "userId" - | "accessToken" - | "refreshToken" - | "idToken" - | "accessTokenExpiresAt" - | "refreshTokenExpiresAt" - | "scope" - | "password" - | "createdAt" - | "updatedAt" - | "_id"; - operator?: - | "lt" - | "lte" - | "gt" - | "gte" - | "eq" - | "in" - | "not_in" - | "ne" - | "contains" - | "starts_with" - | "ends_with"; - value: - | string - | number - | boolean - | Array - | Array - | null; - }>; - } - | { - model: "verification"; - where?: Array<{ - connector?: "AND" | "OR"; - field: - | "identifier" - | "value" - | "expiresAt" - | "createdAt" - | "updatedAt" - | "_id"; - operator?: - | "lt" - | "lte" - | "gt" - | "gte" - | "eq" - | "in" - | "not_in" - | "ne" - | "contains" - | "starts_with" - | "ends_with"; - value: - | string - | number - | boolean - | Array - | Array - | null; - }>; - } - | { - model: "twoFactor"; - where?: Array<{ - connector?: "AND" | "OR"; - field: "secret" | "backupCodes" | "userId" | "_id"; - operator?: - | "lt" - | "lte" - | "gt" - | "gte" - | "eq" - | "in" - | "not_in" - | "ne" - | "contains" - | "starts_with" - | "ends_with"; - value: - | string - | number - | boolean - | Array - | Array - | null; - }>; - } - | { - model: "passkey"; - where?: Array<{ - connector?: "AND" | "OR"; - field: - | "name" - | "publicKey" - | "userId" - | "credentialID" - | "counter" - | "deviceType" - | "backedUp" - | "transports" - | "createdAt" - | "aaguid" - | "_id"; - operator?: - | "lt" - | "lte" - | "gt" - | "gte" - | "eq" - | "in" - | "not_in" - | "ne" - | "contains" - | "starts_with" - | "ends_with"; - value: - | string - | number - | boolean - | Array - | Array - | null; - }>; - } - | { - model: "oauthApplication"; - where?: Array<{ - connector?: "AND" | "OR"; - field: - | "name" - | "icon" - | "metadata" - | "clientId" - | "clientSecret" - | "redirectURLs" - | "type" - | "disabled" - | "userId" - | "createdAt" - | "updatedAt" - | "_id"; - operator?: - | "lt" - | "lte" - | "gt" - | "gte" - | "eq" - | "in" - | "not_in" - | "ne" - | "contains" - | "starts_with" - | "ends_with"; - value: - | string - | number - | boolean - | Array - | Array - | null; - }>; - } - | { - model: "oauthAccessToken"; - where?: Array<{ - connector?: "AND" | "OR"; - field: - | "accessToken" - | "refreshToken" - | "accessTokenExpiresAt" - | "refreshTokenExpiresAt" - | "clientId" - | "userId" - | "scopes" - | "createdAt" - | "updatedAt" - | "_id"; - operator?: - | "lt" - | "lte" - | "gt" - | "gte" - | "eq" - | "in" - | "not_in" - | "ne" - | "contains" - | "starts_with" - | "ends_with"; - value: - | string - | number - | boolean - | Array - | Array - | null; - }>; - } - | { - model: "oauthConsent"; - where?: Array<{ - connector?: "AND" | "OR"; - field: - | "clientId" - | "userId" - | "scopes" - | "createdAt" - | "updatedAt" - | "consentGiven" - | "_id"; - operator?: - | "lt" - | "lte" - | "gt" - | "gte" - | "eq" - | "in" - | "not_in" - | "ne" - | "contains" - | "starts_with" - | "ends_with"; - value: - | string - | number - | boolean - | Array - | Array - | null; - }>; - } - | { - model: "jwks"; - where?: Array<{ - connector?: "AND" | "OR"; - field: "publicKey" | "privateKey" | "createdAt" | "_id"; - operator?: - | "lt" - | "lte" - | "gt" - | "gte" - | "eq" - | "in" - | "not_in" - | "ne" - | "contains" - | "starts_with" - | "ends_with"; - value: - | string - | number - | boolean - | Array - | Array - | null; - }>; - } - | { - model: "rateLimit"; - where?: Array<{ - connector?: "AND" | "OR"; - field: "key" | "count" | "lastRequest" | "_id"; - operator?: - | "lt" - | "lte" - | "gt" - | "gte" - | "eq" - | "in" - | "not_in" - | "ne" - | "contains" - | "starts_with" - | "ends_with"; - value: - | string - | number - | boolean - | Array - | Array - | null; - }>; - } - | { - model: "ratelimit"; - where?: Array<{ - connector?: "AND" | "OR"; - field: "key" | "count" | "lastRequest" | "_id"; - operator?: - | "lt" - | "lte" - | "gt" - | "gte" - | "eq" - | "in" - | "not_in" - | "ne" - | "contains" - | "starts_with" - | "ends_with"; - value: - | string - | number - | boolean - | Array - | Array - | null; - }>; - }; - onDeleteHandle?: string; - }, - any - >; - findMany: FunctionReference< - "query", - "internal", - { - limit?: number; - model: - | "user" - | "session" - | "account" - | "verification" - | "twoFactor" - | "passkey" - | "oauthApplication" - | "oauthAccessToken" - | "oauthConsent" - | "jwks" - | "rateLimit" - | "ratelimit"; - offset?: number; - paginationOpts: { - cursor: string | null; - endCursor?: string | null; - id?: number; - maximumBytesRead?: number; - maximumRowsRead?: number; - numItems: number; - }; - sortBy?: { direction: "asc" | "desc"; field: string }; - where?: Array<{ - connector?: "AND" | "OR"; - field: string; - operator?: - | "lt" - | "lte" - | "gt" - | "gte" - | "eq" - | "in" - | "not_in" - | "ne" - | "contains" - | "starts_with" - | "ends_with"; - value: - | string - | number - | boolean - | Array - | Array - | null; - }>; - }, - any - >; - findOne: FunctionReference< - "query", - "internal", - { - model: - | "user" - | "session" - | "account" - | "verification" - | "twoFactor" - | "passkey" - | "oauthApplication" - | "oauthAccessToken" - | "oauthConsent" - | "jwks" - | "rateLimit" - | "ratelimit"; - select?: Array; - where?: Array<{ - connector?: "AND" | "OR"; - field: string; - operator?: - | "lt" - | "lte" - | "gt" - | "gte" - | "eq" - | "in" - | "not_in" - | "ne" - | "contains" - | "starts_with" - | "ends_with"; - value: - | string - | number - | boolean - | Array - | Array - | null; - }>; - }, - any - >; - migrationRemoveUserId: FunctionReference< - "mutation", - "internal", - { userId: string }, - any - >; - updateMany: FunctionReference< - "mutation", - "internal", - { - input: - | { - model: "user"; - update: { - createdAt?: number; - displayUsername?: null | string; - email?: string; - emailVerified?: boolean; - image?: null | string; - isAnonymous?: null | boolean; - name?: string; - phoneNumber?: null | string; - phoneNumberVerified?: null | boolean; - twoFactorEnabled?: null | boolean; - updatedAt?: number; - userId?: null | string; - username?: null | string; - }; - where?: Array<{ - connector?: "AND" | "OR"; - field: - | "name" - | "email" - | "emailVerified" - | "image" - | "createdAt" - | "updatedAt" - | "twoFactorEnabled" - | "isAnonymous" - | "username" - | "displayUsername" - | "phoneNumber" - | "phoneNumberVerified" - | "userId" - | "_id"; - operator?: - | "lt" - | "lte" - | "gt" - | "gte" - | "eq" - | "in" - | "not_in" - | "ne" - | "contains" - | "starts_with" - | "ends_with"; - value: - | string - | number - | boolean - | Array - | Array - | null; - }>; - } - | { - model: "session"; - update: { - createdAt?: number; - expiresAt?: number; - ipAddress?: null | string; - token?: string; - updatedAt?: number; - userAgent?: null | string; - userId?: string; - }; - where?: Array<{ - connector?: "AND" | "OR"; - field: - | "expiresAt" - | "token" - | "createdAt" - | "updatedAt" - | "ipAddress" - | "userAgent" - | "userId" - | "_id"; - operator?: - | "lt" - | "lte" - | "gt" - | "gte" - | "eq" - | "in" - | "not_in" - | "ne" - | "contains" - | "starts_with" - | "ends_with"; - value: - | string - | number - | boolean - | Array - | Array - | null; - }>; - } - | { - model: "account"; - update: { - accessToken?: null | string; - accessTokenExpiresAt?: null | number; - accountId?: string; - createdAt?: number; - idToken?: null | string; - password?: null | string; - providerId?: string; - refreshToken?: null | string; - refreshTokenExpiresAt?: null | number; - scope?: null | string; - updatedAt?: number; - userId?: string; - }; - where?: Array<{ - connector?: "AND" | "OR"; - field: - | "accountId" - | "providerId" - | "userId" - | "accessToken" - | "refreshToken" - | "idToken" - | "accessTokenExpiresAt" - | "refreshTokenExpiresAt" - | "scope" - | "password" - | "createdAt" - | "updatedAt" - | "_id"; - operator?: - | "lt" - | "lte" - | "gt" - | "gte" - | "eq" - | "in" - | "not_in" - | "ne" - | "contains" - | "starts_with" - | "ends_with"; - value: - | string - | number - | boolean - | Array - | Array - | null; - }>; - } - | { - model: "verification"; - update: { - createdAt?: number; - expiresAt?: number; - identifier?: string; - updatedAt?: number; - value?: string; - }; - where?: Array<{ - connector?: "AND" | "OR"; - field: - | "identifier" - | "value" - | "expiresAt" - | "createdAt" - | "updatedAt" - | "_id"; - operator?: - | "lt" - | "lte" - | "gt" - | "gte" - | "eq" - | "in" - | "not_in" - | "ne" - | "contains" - | "starts_with" - | "ends_with"; - value: - | string - | number - | boolean - | Array - | Array - | null; - }>; - } - | { - model: "twoFactor"; - update: { - backupCodes?: string; - secret?: string; - userId?: string; - }; - where?: Array<{ - connector?: "AND" | "OR"; - field: "secret" | "backupCodes" | "userId" | "_id"; - operator?: - | "lt" - | "lte" - | "gt" - | "gte" - | "eq" - | "in" - | "not_in" - | "ne" - | "contains" - | "starts_with" - | "ends_with"; - value: - | string - | number - | boolean - | Array - | Array - | null; - }>; - } - | { - model: "passkey"; - update: { - aaguid?: null | string; - backedUp?: boolean; - counter?: number; - createdAt?: null | number; - credentialID?: string; - deviceType?: string; - name?: null | string; - publicKey?: string; - transports?: null | string; - userId?: string; - }; - where?: Array<{ - connector?: "AND" | "OR"; - field: - | "name" - | "publicKey" - | "userId" - | "credentialID" - | "counter" - | "deviceType" - | "backedUp" - | "transports" - | "createdAt" - | "aaguid" - | "_id"; - operator?: - | "lt" - | "lte" - | "gt" - | "gte" - | "eq" - | "in" - | "not_in" - | "ne" - | "contains" - | "starts_with" - | "ends_with"; - value: - | string - | number - | boolean - | Array - | Array - | null; - }>; - } - | { - model: "oauthApplication"; - update: { - clientId?: null | string; - clientSecret?: null | string; - createdAt?: null | number; - disabled?: null | boolean; - icon?: null | string; - metadata?: null | string; - name?: null | string; - redirectURLs?: null | string; - type?: null | string; - updatedAt?: null | number; - userId?: null | string; - }; - where?: Array<{ - connector?: "AND" | "OR"; - field: - | "name" - | "icon" - | "metadata" - | "clientId" - | "clientSecret" - | "redirectURLs" - | "type" - | "disabled" - | "userId" - | "createdAt" - | "updatedAt" - | "_id"; - operator?: - | "lt" - | "lte" - | "gt" - | "gte" - | "eq" - | "in" - | "not_in" - | "ne" - | "contains" - | "starts_with" - | "ends_with"; - value: - | string - | number - | boolean - | Array - | Array - | null; - }>; - } - | { - model: "oauthAccessToken"; - update: { - accessToken?: null | string; - accessTokenExpiresAt?: null | number; - clientId?: null | string; - createdAt?: null | number; - refreshToken?: null | string; - refreshTokenExpiresAt?: null | number; - scopes?: null | string; - updatedAt?: null | number; - userId?: null | string; - }; - where?: Array<{ - connector?: "AND" | "OR"; - field: - | "accessToken" - | "refreshToken" - | "accessTokenExpiresAt" - | "refreshTokenExpiresAt" - | "clientId" - | "userId" - | "scopes" - | "createdAt" - | "updatedAt" - | "_id"; - operator?: - | "lt" - | "lte" - | "gt" - | "gte" - | "eq" - | "in" - | "not_in" - | "ne" - | "contains" - | "starts_with" - | "ends_with"; - value: - | string - | number - | boolean - | Array - | Array - | null; - }>; - } - | { - model: "oauthConsent"; - update: { - clientId?: null | string; - consentGiven?: null | boolean; - createdAt?: null | number; - scopes?: null | string; - updatedAt?: null | number; - userId?: null | string; - }; - where?: Array<{ - connector?: "AND" | "OR"; - field: - | "clientId" - | "userId" - | "scopes" - | "createdAt" - | "updatedAt" - | "consentGiven" - | "_id"; - operator?: - | "lt" - | "lte" - | "gt" - | "gte" - | "eq" - | "in" - | "not_in" - | "ne" - | "contains" - | "starts_with" - | "ends_with"; - value: - | string - | number - | boolean - | Array - | Array - | null; - }>; - } - | { - model: "jwks"; - update: { - createdAt?: number; - privateKey?: string; - publicKey?: string; - }; - where?: Array<{ - connector?: "AND" | "OR"; - field: "publicKey" | "privateKey" | "createdAt" | "_id"; - operator?: - | "lt" - | "lte" - | "gt" - | "gte" - | "eq" - | "in" - | "not_in" - | "ne" - | "contains" - | "starts_with" - | "ends_with"; - value: - | string - | number - | boolean - | Array - | Array - | null; - }>; - } - | { - model: "rateLimit"; - update: { - count?: null | number; - key?: null | string; - lastRequest?: null | number; - }; - where?: Array<{ - connector?: "AND" | "OR"; - field: "key" | "count" | "lastRequest" | "_id"; - operator?: - | "lt" - | "lte" - | "gt" - | "gte" - | "eq" - | "in" - | "not_in" - | "ne" - | "contains" - | "starts_with" - | "ends_with"; - value: - | string - | number - | boolean - | Array - | Array - | null; - }>; - } - | { - model: "ratelimit"; - update: { count?: number; key?: string; lastRequest?: number }; - where?: Array<{ - connector?: "AND" | "OR"; - field: "key" | "count" | "lastRequest" | "_id"; - operator?: - | "lt" - | "lte" - | "gt" - | "gte" - | "eq" - | "in" - | "not_in" - | "ne" - | "contains" - | "starts_with" - | "ends_with"; - value: - | string - | number - | boolean - | Array - | Array - | null; - }>; - }; - onUpdateHandle?: string; - paginationOpts: { - cursor: string | null; - endCursor?: string | null; - id?: number; - maximumBytesRead?: number; - maximumRowsRead?: number; - numItems: number; - }; - }, - any - >; - updateOne: FunctionReference< - "mutation", - "internal", - { - input: - | { - model: "user"; - update: { - createdAt?: number; - displayUsername?: null | string; - email?: string; - emailVerified?: boolean; - image?: null | string; - isAnonymous?: null | boolean; - name?: string; - phoneNumber?: null | string; - phoneNumberVerified?: null | boolean; - twoFactorEnabled?: null | boolean; - updatedAt?: number; - userId?: null | string; - username?: null | string; - }; - where?: Array<{ - connector?: "AND" | "OR"; - field: - | "name" - | "email" - | "emailVerified" - | "image" - | "createdAt" - | "updatedAt" - | "twoFactorEnabled" - | "isAnonymous" - | "username" - | "displayUsername" - | "phoneNumber" - | "phoneNumberVerified" - | "userId" - | "_id"; - operator?: - | "lt" - | "lte" - | "gt" - | "gte" - | "eq" - | "in" - | "not_in" - | "ne" - | "contains" - | "starts_with" - | "ends_with"; - value: - | string - | number - | boolean - | Array - | Array - | null; - }>; - } - | { - model: "session"; - update: { - createdAt?: number; - expiresAt?: number; - ipAddress?: null | string; - token?: string; - updatedAt?: number; - userAgent?: null | string; - userId?: string; - }; - where?: Array<{ - connector?: "AND" | "OR"; - field: - | "expiresAt" - | "token" - | "createdAt" - | "updatedAt" - | "ipAddress" - | "userAgent" - | "userId" - | "_id"; - operator?: - | "lt" - | "lte" - | "gt" - | "gte" - | "eq" - | "in" - | "not_in" - | "ne" - | "contains" - | "starts_with" - | "ends_with"; - value: - | string - | number - | boolean - | Array - | Array - | null; - }>; - } - | { - model: "account"; - update: { - accessToken?: null | string; - accessTokenExpiresAt?: null | number; - accountId?: string; - createdAt?: number; - idToken?: null | string; - password?: null | string; - providerId?: string; - refreshToken?: null | string; - refreshTokenExpiresAt?: null | number; - scope?: null | string; - updatedAt?: number; - userId?: string; - }; - where?: Array<{ - connector?: "AND" | "OR"; - field: - | "accountId" - | "providerId" - | "userId" - | "accessToken" - | "refreshToken" - | "idToken" - | "accessTokenExpiresAt" - | "refreshTokenExpiresAt" - | "scope" - | "password" - | "createdAt" - | "updatedAt" - | "_id"; - operator?: - | "lt" - | "lte" - | "gt" - | "gte" - | "eq" - | "in" - | "not_in" - | "ne" - | "contains" - | "starts_with" - | "ends_with"; - value: - | string - | number - | boolean - | Array - | Array - | null; - }>; - } - | { - model: "verification"; - update: { - createdAt?: number; - expiresAt?: number; - identifier?: string; - updatedAt?: number; - value?: string; - }; - where?: Array<{ - connector?: "AND" | "OR"; - field: - | "identifier" - | "value" - | "expiresAt" - | "createdAt" - | "updatedAt" - | "_id"; - operator?: - | "lt" - | "lte" - | "gt" - | "gte" - | "eq" - | "in" - | "not_in" - | "ne" - | "contains" - | "starts_with" - | "ends_with"; - value: - | string - | number - | boolean - | Array - | Array - | null; - }>; - } - | { - model: "twoFactor"; - update: { - backupCodes?: string; - secret?: string; - userId?: string; - }; - where?: Array<{ - connector?: "AND" | "OR"; - field: "secret" | "backupCodes" | "userId" | "_id"; - operator?: - | "lt" - | "lte" - | "gt" - | "gte" - | "eq" - | "in" - | "not_in" - | "ne" - | "contains" - | "starts_with" - | "ends_with"; - value: - | string - | number - | boolean - | Array - | Array - | null; - }>; - } - | { - model: "passkey"; - update: { - aaguid?: null | string; - backedUp?: boolean; - counter?: number; - createdAt?: null | number; - credentialID?: string; - deviceType?: string; - name?: null | string; - publicKey?: string; - transports?: null | string; - userId?: string; - }; - where?: Array<{ - connector?: "AND" | "OR"; - field: - | "name" - | "publicKey" - | "userId" - | "credentialID" - | "counter" - | "deviceType" - | "backedUp" - | "transports" - | "createdAt" - | "aaguid" - | "_id"; - operator?: - | "lt" - | "lte" - | "gt" - | "gte" - | "eq" - | "in" - | "not_in" - | "ne" - | "contains" - | "starts_with" - | "ends_with"; - value: - | string - | number - | boolean - | Array - | Array - | null; - }>; - } - | { - model: "oauthApplication"; - update: { - clientId?: null | string; - clientSecret?: null | string; - createdAt?: null | number; - disabled?: null | boolean; - icon?: null | string; - metadata?: null | string; - name?: null | string; - redirectURLs?: null | string; - type?: null | string; - updatedAt?: null | number; - userId?: null | string; - }; - where?: Array<{ - connector?: "AND" | "OR"; - field: - | "name" - | "icon" - | "metadata" - | "clientId" - | "clientSecret" - | "redirectURLs" - | "type" - | "disabled" - | "userId" - | "createdAt" - | "updatedAt" - | "_id"; - operator?: - | "lt" - | "lte" - | "gt" - | "gte" - | "eq" - | "in" - | "not_in" - | "ne" - | "contains" - | "starts_with" - | "ends_with"; - value: - | string - | number - | boolean - | Array - | Array - | null; - }>; - } - | { - model: "oauthAccessToken"; - update: { - accessToken?: null | string; - accessTokenExpiresAt?: null | number; - clientId?: null | string; - createdAt?: null | number; - refreshToken?: null | string; - refreshTokenExpiresAt?: null | number; - scopes?: null | string; - updatedAt?: null | number; - userId?: null | string; - }; - where?: Array<{ - connector?: "AND" | "OR"; - field: - | "accessToken" - | "refreshToken" - | "accessTokenExpiresAt" - | "refreshTokenExpiresAt" - | "clientId" - | "userId" - | "scopes" - | "createdAt" - | "updatedAt" - | "_id"; - operator?: - | "lt" - | "lte" - | "gt" - | "gte" - | "eq" - | "in" - | "not_in" - | "ne" - | "contains" - | "starts_with" - | "ends_with"; - value: - | string - | number - | boolean - | Array - | Array - | null; - }>; - } - | { - model: "oauthConsent"; - update: { - clientId?: null | string; - consentGiven?: null | boolean; - createdAt?: null | number; - scopes?: null | string; - updatedAt?: null | number; - userId?: null | string; - }; - where?: Array<{ - connector?: "AND" | "OR"; - field: - | "clientId" - | "userId" - | "scopes" - | "createdAt" - | "updatedAt" - | "consentGiven" - | "_id"; - operator?: - | "lt" - | "lte" - | "gt" - | "gte" - | "eq" - | "in" - | "not_in" - | "ne" - | "contains" - | "starts_with" - | "ends_with"; - value: - | string - | number - | boolean - | Array - | Array - | null; - }>; - } - | { - model: "jwks"; - update: { - createdAt?: number; - privateKey?: string; - publicKey?: string; - }; - where?: Array<{ - connector?: "AND" | "OR"; - field: "publicKey" | "privateKey" | "createdAt" | "_id"; - operator?: - | "lt" - | "lte" - | "gt" - | "gte" - | "eq" - | "in" - | "not_in" - | "ne" - | "contains" - | "starts_with" - | "ends_with"; - value: - | string - | number - | boolean - | Array - | Array - | null; - }>; - } - | { - model: "rateLimit"; - update: { - count?: null | number; - key?: null | string; - lastRequest?: null | number; - }; - where?: Array<{ - connector?: "AND" | "OR"; - field: "key" | "count" | "lastRequest" | "_id"; - operator?: - | "lt" - | "lte" - | "gt" - | "gte" - | "eq" - | "in" - | "not_in" - | "ne" - | "contains" - | "starts_with" - | "ends_with"; - value: - | string - | number - | boolean - | Array - | Array - | null; - }>; - } - | { - model: "ratelimit"; - update: { count?: number; key?: string; lastRequest?: number }; - where?: Array<{ - connector?: "AND" | "OR"; - field: "key" | "count" | "lastRequest" | "_id"; - operator?: - | "lt" - | "lte" - | "gt" - | "gte" - | "eq" - | "in" - | "not_in" - | "ne" - | "contains" - | "starts_with" - | "ends_with"; - value: - | string - | number - | boolean - | Array - | Array - | null; - }>; - }; - onUpdateHandle?: string; - }, - any - >; - }; - adapterTest: { - count: FunctionReference<"query", "internal", any, any>; - create: FunctionReference<"mutation", "internal", any, any>; - delete: FunctionReference<"mutation", "internal", any, any>; - deleteMany: FunctionReference<"mutation", "internal", any, any>; - findMany: FunctionReference<"query", "internal", any, any>; - findOne: FunctionReference<"query", "internal", any, any>; - update: FunctionReference<"mutation", "internal", any, any>; - updateMany: FunctionReference<"mutation", "internal", any, any>; - }; - }; - resend: { - lib: { - cancelEmail: FunctionReference< - "mutation", - "internal", - { emailId: string }, - null - >; - cleanupAbandonedEmails: FunctionReference< - "mutation", - "internal", - { olderThan?: number }, - null - >; - cleanupOldEmails: FunctionReference< - "mutation", - "internal", - { olderThan?: number }, - null - >; - createManualEmail: FunctionReference< - "mutation", - "internal", - { - from: string; - headers?: Array<{ name: string; value: string }>; - replyTo?: Array; - subject: string; - to: string; - }, - string - >; - get: FunctionReference< - "query", - "internal", - { emailId: string }, - { - complained: boolean; - createdAt: number; - errorMessage?: string; - finalizedAt: number; - from: string; - headers?: Array<{ name: string; value: string }>; - html?: string; - opened: boolean; - replyTo: Array; - resendId?: string; - segment: number; - status: - | "waiting" - | "queued" - | "cancelled" - | "sent" - | "delivered" - | "delivery_delayed" - | "bounced" - | "failed"; - subject: string; - text?: string; - to: string; - } | null - >; - getStatus: FunctionReference< - "query", - "internal", - { emailId: string }, - { - complained: boolean; - errorMessage: string | null; - opened: boolean; - status: - | "waiting" - | "queued" - | "cancelled" - | "sent" - | "delivered" - | "delivery_delayed" - | "bounced" - | "failed"; - } | null - >; - handleEmailEvent: FunctionReference< - "mutation", - "internal", - { event: any }, - null - >; - sendEmail: FunctionReference< - "mutation", - "internal", - { - from: string; - headers?: Array<{ name: string; value: string }>; - html?: string; - options: { - apiKey: string; - initialBackoffMs: number; - onEmailEvent?: { fnHandle: string }; - retryAttempts: number; - testMode: boolean; - }; - replyTo?: Array; - subject: string; - text?: string; - to: string; - }, - string - >; - updateManualEmail: FunctionReference< - "mutation", - "internal", - { - emailId: string; - errorMessage?: string; - resendId?: string; - status: - | "waiting" - | "queued" - | "cancelled" - | "sent" - | "delivered" - | "delivery_delayed" - | "bounced" - | "failed"; - }, - null - >; - }; - }; + betterAuth: import("@convex-dev/better-auth/_generated/component.js").ComponentApi<"betterAuth">; + resend: import("@convex-dev/resend/_generated/component.js").ComponentApi<"resend">; }; diff --git a/examples/react/convex/_generated/server.d.ts b/examples/react/convex/_generated/server.d.ts index b5c6828..bec05e6 100644 --- a/examples/react/convex/_generated/server.d.ts +++ b/examples/react/convex/_generated/server.d.ts @@ -10,7 +10,6 @@ import { ActionBuilder, - AnyComponents, HttpActionBuilder, MutationBuilder, QueryBuilder, @@ -19,15 +18,9 @@ import { GenericQueryCtx, GenericDatabaseReader, GenericDatabaseWriter, - FunctionReference, } from "convex/server"; import type { DataModel } from "./dataModel.js"; -type GenericCtx = - | GenericActionCtx - | GenericMutationCtx - | GenericQueryCtx; - /** * Define a query in this Convex app's public API. * @@ -92,11 +85,12 @@ export declare const internalAction: ActionBuilder; /** * Define an HTTP action. * - * This function will be used to respond to HTTP requests received by a Convex - * deployment if the requests matches the path and method where this action - * is routed. Be sure to route your action in `convex/http.js`. + * The wrapped function will be used to respond to HTTP requests received + * by a Convex deployment if the requests matches the path and method where + * this action is routed. Be sure to route your httpAction in `convex/http.js`. * - * @param func - The function. It receives an {@link ActionCtx} as its first argument. + * @param func - The function. It receives an {@link ActionCtx} as its first argument + * and a Fetch API `Request` object as its second. * @returns The wrapped function. Import this function from `convex/http.js` and route it to hook it up. */ export declare const httpAction: HttpActionBuilder; diff --git a/examples/react/convex/_generated/server.js b/examples/react/convex/_generated/server.js index 4a21df4..bf3d25a 100644 --- a/examples/react/convex/_generated/server.js +++ b/examples/react/convex/_generated/server.js @@ -16,7 +16,6 @@ import { internalActionGeneric, internalMutationGeneric, internalQueryGeneric, - componentsGeneric, } from "convex/server"; /** @@ -81,10 +80,14 @@ export const action = actionGeneric; export const internalAction = internalActionGeneric; /** - * Define a Convex HTTP action. + * Define an HTTP action. * - * @param func - The function. It receives an {@link ActionCtx} as its first argument, and a `Request` object - * as its second. - * @returns The wrapped endpoint function. Route a URL path to this function in `convex/http.js`. + * The wrapped function will be used to respond to HTTP requests received + * by a Convex deployment if the requests matches the path and method where + * this action is routed. Be sure to route your httpAction in `convex/http.js`. + * + * @param func - The function. It receives an {@link ActionCtx} as its first argument + * and a Fetch API `Request` object as its second. + * @returns The wrapped function. Import this function from `convex/http.js` and route it to hook it up. */ export const httpAction = httpActionGeneric; diff --git a/examples/react/package-lock.json b/examples/react/package-lock.json index 326574f..fa294f1 100644 --- a/examples/react/package-lock.json +++ b/examples/react/package-lock.json @@ -48,12 +48,14 @@ }, "../..": { "name": "@convex-dev/better-auth", - "version": "0.9.2", + "version": "0.9.7", "license": "Apache-2.0", "dependencies": { "common-tags": "^1.8.2", "convex-helpers": "^0.1.95", + "jose": "^6.1.0", "remeda": "^2.32.0", + "semver": "^7.7.3", "type-fest": "^4.39.1", "zod": "^3.24.4" }, @@ -69,19 +71,20 @@ "@types/semver": "^7.7.0", "chokidar-cli": "^3.0.0", "concurrently": "^9.2.0", + "convex": "1.29.0", "convex-test": "^0.0.33", "eslint": "^9.9.1", "globals": "^15.9.0", "next": "^15.1.8", "prettier": "3.2.5", - "semver": "^7.7.2", + "tsc-alias": "^1.8.16", "typescript": "5.8.3", "typescript-eslint": "^8.4.0", "vitest": "^3.2.2" }, "peerDependencies": { "better-auth": "1.3.27", - "convex": "^1.26.2", + "convex": "^1.28.2", "react": "^18.3.1 || ^19.0.0", "react-dom": "^18.3.1 || ^19.0.0" } @@ -89,6 +92,7 @@ "../../node_modules/better-auth": { "version": "1.3.8", "license": "MIT", + "peer": true, "dependencies": { "@better-auth/utils": "0.2.6", "@better-fetch/fetch": "^1.1.18", @@ -179,6 +183,7 @@ "integrity": "sha512-2BCOP7TN8M+gVDj7/ht3hsaO/B/n5oDbiAyyvnRlNOs+u1o+JWNYTQrmpuNp1/Wq2gcFrI01JAW+paEKDMx/CA==", "dev": true, "license": "MIT", + "peer": true, "dependencies": { "@babel/code-frame": "^7.27.1", "@babel/generator": "^7.28.3", @@ -2354,6 +2359,7 @@ "integrity": "sha512-0dLEBsA1kI3OezMBF8nSsb7Nk19ZnsyE1LLhB8r27KbgU5H4pvuqZLdtE+aUkJVoXgTVuA+iLIwmZ0TuK4tx6A==", "devOptional": true, "license": "MIT", + "peer": true, "dependencies": { "@types/prop-types": "*", "csstype": "^3.0.2" @@ -2365,6 +2371,7 @@ "integrity": "sha512-MEe3UeoENYVFXzoXEWsvcpg6ZvlrFNlOQ7EOsvhI3CfAXwzPfO8Qwuxd40nepsYKqyyVQnTdEfv68q91yLcKrQ==", "devOptional": true, "license": "MIT", + "peer": true, "peerDependencies": { "@types/react": "^18.0.0" } @@ -2415,6 +2422,7 @@ "integrity": "sha512-r1XG74QgShUgXph1BYseJ+KZd17bKQib/yF3SR+demvytiRXrwd12Blnz5eYGm8tXaeRdd4x88MlfwldHoudGg==", "dev": true, "license": "MIT", + "peer": true, "dependencies": { "@typescript-eslint/scope-manager": "8.42.0", "@typescript-eslint/types": "8.42.0", @@ -2667,6 +2675,7 @@ "integrity": "sha512-NZyJarBfL7nWwIq+FDL6Zp/yHEhePMNnnJ0y3qfieCrmNvYct8uvtiV41UvlSe6apAfk0fY1FbWx+NwfmpvtTg==", "dev": true, "license": "MIT", + "peer": true, "bin": { "acorn": "bin/acorn" }, @@ -2844,6 +2853,7 @@ } ], "license": "MIT", + "peer": true, "dependencies": { "caniuse-lite": "^1.0.30001737", "electron-to-chromium": "^1.5.211", @@ -3028,6 +3038,7 @@ "resolved": "https://registry.npmjs.org/convex-helpers/-/convex-helpers-0.1.104.tgz", "integrity": "sha512-7CYvx7T3K6n+McDTK4ZQaQNNGBzq5aWezpjzsKbOxPXx7oNcTP9wrpef3JxeXWFzkByJv5hRCjseh9B7eNJ7Ig==", "license": "Apache-2.0", + "peer": true, "bin": { "convex-helpers": "bin.cjs" }, @@ -3535,6 +3546,7 @@ "integrity": "sha512-QePbBFMJFjgmlE+cXAlbHZbHpdFVS2E/6vzCy7aKlebddvl1vadiC4JFV5u/wqTkNUwEV8WrQi257jf5f06hrg==", "dev": true, "license": "MIT", + "peer": true, "dependencies": { "@eslint-community/eslint-utils": "^4.8.0", "@eslint-community/regexpp": "^4.12.1", @@ -5786,6 +5798,7 @@ "resolved": "https://registry.npmjs.org/react/-/react-18.3.1.tgz", "integrity": "sha512-wS+hAgJShR0KhEvPJArfuPVN1+Hz1t0Y6n5jLrGQbkb4urgPE/0Rve+1kMB1v/oWgHgm4WIcV+i7F2pTVj+2iQ==", "license": "MIT", + "peer": true, "dependencies": { "loose-envify": "^1.1.0" }, @@ -5798,6 +5811,7 @@ "resolved": "https://registry.npmjs.org/react-dom/-/react-dom-18.3.1.tgz", "integrity": "sha512-5m4nQKp+rZRb09LNH59GM4BxTh9251/ylbKIbpe7TpGxfJ+9kv6BLkLBXIjjspbgbnIBNqlI23tRnTWT0snUIw==", "license": "MIT", + "peer": true, "dependencies": { "loose-envify": "^1.1.0", "scheduler": "^0.23.2" @@ -6573,6 +6587,7 @@ "resolved": "https://registry.npmjs.org/picomatch/-/picomatch-4.0.3.tgz", "integrity": "sha512-5gTmgEY/sqK6gFXLIsQNH19lWb4ebPDLA4SdLP7dsWkIXHWlG66oPuVvXSGFPppYZz8ZDZq0dYYrbHfBCVUb1Q==", "license": "MIT", + "peer": true, "engines": { "node": ">=12" }, @@ -6731,6 +6746,7 @@ "integrity": "sha512-CWBzXQrc/qOkhidw1OzBTQuYRbfyxDXJMVJ1XNwUHGROVmuaeiEm3OslpZ1RV96d7SKKjZKrSJu3+t/xlw3R9A==", "devOptional": true, "license": "Apache-2.0", + "peer": true, "bin": { "tsc": "bin/tsc", "tsserver": "bin/tsserver" @@ -6868,6 +6884,7 @@ "resolved": "https://registry.npmjs.org/vite/-/vite-7.1.4.tgz", "integrity": "sha512-X5QFK4SGynAeeIt+A7ZWnApdUyHYm+pzv/8/A57LqSGcI88U6R6ipOs3uCesdc6yl7nl+zNO0t8LmqAdXcQihw==", "license": "MIT", + "peer": true, "dependencies": { "esbuild": "^0.25.0", "fdir": "^6.5.0", @@ -6959,6 +6976,7 @@ "resolved": "https://registry.npmjs.org/picomatch/-/picomatch-4.0.3.tgz", "integrity": "sha512-5gTmgEY/sqK6gFXLIsQNH19lWb4ebPDLA4SdLP7dsWkIXHWlG66oPuVvXSGFPppYZz8ZDZq0dYYrbHfBCVUb1Q==", "license": "MIT", + "peer": true, "engines": { "node": ">=12" }, @@ -7100,17 +7118,6 @@ "funding": { "url": "https://github.com/sponsors/sindresorhus" } - }, - "node_modules/zod": { - "version": "4.1.8", - "resolved": "https://registry.npmjs.org/zod/-/zod-4.1.8.tgz", - "integrity": "sha512-5R1P+WwQqmmMIEACyzSvo4JXHY5WiAFHRMg+zBZKgKS+Q1viRa0C1hmUKtHltoIFKtIdki3pRxkmpP74jnNYHQ==", - "license": "MIT", - "optional": true, - "peer": true, - "funding": { - "url": "https://github.com/sponsors/colinhacks" - } } } } diff --git a/examples/tanstack/package-lock.json b/examples/tanstack/package-lock.json index ee22871..221c447 100644 --- a/examples/tanstack/package-lock.json +++ b/examples/tanstack/package-lock.json @@ -53,12 +53,14 @@ }, "../..": { "name": "@convex-dev/better-auth", - "version": "0.9.2", + "version": "0.9.7", "license": "Apache-2.0", "dependencies": { "common-tags": "^1.8.2", "convex-helpers": "^0.1.95", + "jose": "^6.1.0", "remeda": "^2.32.0", + "semver": "^7.7.3", "type-fest": "^4.39.1", "zod": "^3.24.4" }, @@ -74,12 +76,12 @@ "@types/semver": "^7.7.0", "chokidar-cli": "^3.0.0", "concurrently": "^9.2.0", + "convex": "1.29.0", "convex-test": "^0.0.33", "eslint": "^9.9.1", "globals": "^15.9.0", "next": "^15.1.8", "prettier": "3.2.5", - "semver": "^7.7.2", "tsc-alias": "^1.8.16", "typescript": "5.8.3", "typescript-eslint": "^8.4.0", @@ -87,7 +89,7 @@ }, "peerDependencies": { "better-auth": "1.3.27", - "convex": "^1.26.2", + "convex": "^1.28.2", "react": "^18.3.1 || ^19.0.0", "react-dom": "^18.3.1 || ^19.0.0" } @@ -95,6 +97,7 @@ "../../node_modules/better-auth": { "version": "1.2.12", "license": "MIT", + "peer": true, "dependencies": { "@better-auth/utils": "0.2.5", "@better-fetch/fetch": "^1.1.18", @@ -145,6 +148,7 @@ "../../node_modules/react": { "version": "19.1.0", "license": "MIT", + "peer": true, "engines": { "node": ">=0.10.0" } @@ -152,6 +156,7 @@ "../../node_modules/react-dom": { "version": "19.1.0", "license": "MIT", + "peer": true, "dependencies": { "scheduler": "^0.26.0" }, @@ -212,6 +217,7 @@ "resolved": "https://registry.npmjs.org/@babel/core/-/core-7.28.4.tgz", "integrity": "sha512-2BCOP7TN8M+gVDj7/ht3hsaO/B/n5oDbiAyyvnRlNOs+u1o+JWNYTQrmpuNp1/Wq2gcFrI01JAW+paEKDMx/CA==", "license": "MIT", + "peer": true, "dependencies": { "@babel/code-frame": "^7.27.1", "@babel/generator": "^7.28.3", @@ -1235,7 +1241,6 @@ "integrity": "sha512-0pPkgz9dY+bijgistcTTJ5mR+ocqRXLuhXHYdzoMmmoJ2C9S46RCm2GMUbatPEUK9Yjy26IrAy8D/M00lLkv+Q==", "license": "MIT", "optional": true, - "peer": true, "dependencies": { "@jridgewell/gen-mapping": "^0.3.5", "@jridgewell/trace-mapping": "^0.3.25" @@ -2885,6 +2890,7 @@ "resolved": "https://registry.npmjs.org/@tanstack/query-core/-/query-core-5.90.2.tgz", "integrity": "sha512-k/TcR3YalnzibscALLwxeiLUub6jN5EDLwKDiO7q5f4ICEoptJ+n9+7vcEFy5/x/i6Q+Lb/tXrsKCggf5uQJXQ==", "license": "MIT", + "peer": true, "funding": { "type": "github", "url": "https://github.com/sponsors/tannerlinsley" @@ -2905,6 +2911,7 @@ "resolved": "https://registry.npmjs.org/@tanstack/react-query/-/react-query-5.90.2.tgz", "integrity": "sha512-CLABiR+h5PYfOWr/z+vWFt5VsOA2ekQeRQBFSKlcoW6Ndx/f8rfyVmq4LbgOM4GG2qtxAxjLYLOpCNTYm4uKzw==", "license": "MIT", + "peer": true, "dependencies": { "@tanstack/query-core": "5.90.2" }, @@ -2938,6 +2945,7 @@ "resolved": "https://registry.npmjs.org/@tanstack/react-router/-/react-router-1.132.33.tgz", "integrity": "sha512-o/uOh/EfCRr5u2SyY6aHJCIREZKTyXsiztMnZGSWjT055J99IaQm7zUwq9ZeK841hsZ7fhgMjLh8my75SOdobA==", "license": "MIT", + "peer": true, "dependencies": { "@tanstack/history": "1.132.31", "@tanstack/react-store": "^0.7.0", @@ -3102,6 +3110,7 @@ "resolved": "https://registry.npmjs.org/@tanstack/router-core/-/router-core-1.132.33.tgz", "integrity": "sha512-7EwXqlcBsIbDfb8MjhpZp0yaZHE6Jl+TBHtQ3WErramBB5PLFtYVDB1fiJnZMCftHXJNWXMAz4640VTcCQsXow==", "license": "MIT", + "peer": true, "dependencies": { "@tanstack/history": "1.132.31", "@tanstack/store": "^0.7.0", @@ -3677,6 +3686,7 @@ } ], "license": "MIT", + "peer": true, "dependencies": { "caniuse-lite": "^1.0.30001737", "electron-to-chromium": "^1.5.211", @@ -3695,8 +3705,7 @@ "resolved": "https://registry.npmjs.org/buffer-from/-/buffer-from-1.1.2.tgz", "integrity": "sha512-E+XQCRwSbaaiChtv6k6Dwgc+bx+Bs6vuKJHHl5kox/BaKbhiXzqQOwK4cO22yElGp2OCmjwVhT3HmxgyPGnJfQ==", "license": "MIT", - "optional": true, - "peer": true + "optional": true }, "node_modules/caniuse-lite": { "version": "1.0.30001741", @@ -4053,7 +4062,8 @@ "version": "3.1.3", "resolved": "https://registry.npmjs.org/csstype/-/csstype-3.1.3.tgz", "integrity": "sha512-M1uQkMl8rQK/szD0LNhtqxIPLpimGm8sOBwU7lLnCpSbTyY3yeU1Vc7l4KT5zT4s/yOxHH5O7tIuuLOCnLADRw==", - "license": "MIT" + "license": "MIT", + "peer": true }, "node_modules/date-fns": { "version": "2.30.0", @@ -5645,6 +5655,7 @@ "resolved": "https://registry.npmjs.org/seroval/-/seroval-1.3.2.tgz", "integrity": "sha512-RbcPH1n5cfwKrru7v7+zrZvjLurgHhGyso3HTyGtRivGWgYjbOmGuivCQaORNELjNONoK35nj28EoWul9sb1zQ==", "license": "MIT", + "peer": true, "engines": { "node": ">=10" } @@ -5719,7 +5730,6 @@ "integrity": "sha512-uBHU3L3czsIyYXKX88fdrGovxdSCoTGDRZ6SYXtSRxLZUzHg5P/66Ht6uoUlHu9EZod+inXhKo3qQgwXUT/y1w==", "license": "MIT", "optional": true, - "peer": true, "dependencies": { "buffer-from": "^1.0.0", "source-map": "^0.6.0" @@ -5731,7 +5741,6 @@ "integrity": "sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g==", "license": "BSD-3-Clause", "optional": true, - "peer": true, "engines": { "node": ">=0.10.0" } @@ -5874,7 +5883,6 @@ "integrity": "sha512-+6erLbBm0+LROX2sPXlUYx/ux5PyE9K/a92Wrt6oA+WDAoFTdpHE5tCYCI5PNzq2y8df4rA+QgHLJuR4jNymsg==", "license": "BSD-2-Clause", "optional": true, - "peer": true, "dependencies": { "@jridgewell/source-map": "^0.3.3", "acorn": "^8.14.0", @@ -5893,14 +5901,14 @@ "resolved": "https://registry.npmjs.org/commander/-/commander-2.20.3.tgz", "integrity": "sha512-GpVkmM8vF2vQUkj2LvZmD35JxeJOLCwJ9cUkugyk2nuhbv3+mJvpLYYt+0+USMxE+oj+ey/lJEnhZw75x/OMcQ==", "license": "MIT", - "optional": true, - "peer": true + "optional": true }, "node_modules/tiny-invariant": { "version": "1.3.3", "resolved": "https://registry.npmjs.org/tiny-invariant/-/tiny-invariant-1.3.3.tgz", "integrity": "sha512-+FbBPE1o9QAYvviau/qC5SE3caw21q3xkvWKBtja5vgqOWIHHJ3ioaq1VPfn/Szqctz2bU/oYeKd9/z5BL+PVg==", - "license": "MIT" + "license": "MIT", + "peer": true }, "node_modules/tiny-warning": { "version": "1.0.3", @@ -5946,6 +5954,7 @@ "resolved": "https://registry.npmjs.org/picomatch/-/picomatch-4.0.3.tgz", "integrity": "sha512-5gTmgEY/sqK6gFXLIsQNH19lWb4ebPDLA4SdLP7dsWkIXHWlG66oPuVvXSGFPppYZz8ZDZq0dYYrbHfBCVUb1Q==", "license": "MIT", + "peer": true, "engines": { "node": ">=12" }, @@ -6055,6 +6064,7 @@ "integrity": "sha512-p1diW6TqL9L07nNxvRMM7hMMw4c5XOo/1ibL4aAIGmSAt9slTE1Xgw5KWuof2uTOvCg9BY7ZRi+GaF+7sfgPeQ==", "devOptional": true, "license": "Apache-2.0", + "peer": true, "bin": { "tsc": "bin/tsc", "tsserver": "bin/tsserver" @@ -6208,6 +6218,7 @@ "resolved": "https://registry.npmjs.org/vite/-/vite-7.1.9.tgz", "integrity": "sha512-4nVGliEpxmhCL8DslSAUdxlB6+SMrhB0a1v5ijlh1xB1nEPuy1mxaHxysVucLHuWryAxLWg6a5ei+U4TLn/rFg==", "license": "MIT", + "peer": true, "dependencies": { "esbuild": "^0.25.0", "fdir": "^6.5.0", @@ -6319,6 +6330,7 @@ "resolved": "https://registry.npmjs.org/picomatch/-/picomatch-4.0.3.tgz", "integrity": "sha512-5gTmgEY/sqK6gFXLIsQNH19lWb4ebPDLA4SdLP7dsWkIXHWlG66oPuVvXSGFPppYZz8ZDZq0dYYrbHfBCVUb1Q==", "license": "MIT", + "peer": true, "engines": { "node": ">=12" }, @@ -6504,6 +6516,7 @@ "resolved": "https://registry.npmjs.org/zod/-/zod-3.25.76.tgz", "integrity": "sha512-gzUt/qt81nXsFGKIFcC3YnfEAx5NkunCfnDlvuBSSFS02bcXu4Lmea0AFIUwbLWxWPx3d9p8S5QoaujKcNQxcQ==", "license": "MIT", + "peer": true, "funding": { "url": "https://github.com/sponsors/colinhacks" } diff --git a/package.json b/package.json index 9ad28c2..6c5f5de 100644 --- a/package.json +++ b/package.json @@ -73,6 +73,13 @@ "types": "./dist/utils/index.d.ts", "default": "./dist/utils/index.js" }, + "./_generated/component.js": { + "types": "./dist/component/_generated/component.d.ts" + }, + "./convex.config.js": { + "types": "./dist/component/convex.config.d.ts", + "default": "./dist/component/convex.config.js" + }, "./convex.config": { "types": "./dist/component/convex.config.d.ts", "default": "./dist/component/convex.config.js" @@ -108,6 +115,7 @@ "eslint": "^9.9.1", "globals": "^15.9.0", "next": "^15.1.8", + "npm-run-all2": "8.0.4", "prettier": "3.2.5", "tsc-alias": "^1.8.16", "typescript": "5.8.3", diff --git a/src/component/_generated/api.d.ts b/src/component/_generated/api.d.ts deleted file mode 100644 index d07a282..0000000 --- a/src/component/_generated/api.d.ts +++ /dev/null @@ -1,2145 +0,0 @@ -/* eslint-disable */ -/** - * Generated `api` utility. - * - * THIS CODE IS AUTOMATICALLY GENERATED. - * - * To regenerate, run `npx convex dev`. - * @module - */ - -import type * as adapter from "../adapter.js"; -import type * as adapterTest from "../adapterTest.js"; - -import type { - ApiFromModules, - FilterApi, - FunctionReference, -} from "convex/server"; - -/** - * A utility for referencing Convex functions in your app's API. - * - * Usage: - * ```js - * const myFunctionReference = api.myModule.myFunction; - * ``` - */ -declare const fullApi: ApiFromModules<{ - adapter: typeof adapter; - adapterTest: typeof adapterTest; -}>; -export type Mounts = { - adapter: { - create: FunctionReference< - "mutation", - "public", - { - input: - | { - data: { - createdAt: number; - displayUsername?: null | string; - email: string; - emailVerified: boolean; - image?: null | string; - isAnonymous?: null | boolean; - name: string; - phoneNumber?: null | string; - phoneNumberVerified?: null | boolean; - twoFactorEnabled?: null | boolean; - updatedAt: number; - userId?: null | string; - username?: null | string; - }; - model: "user"; - } - | { - data: { - createdAt: number; - expiresAt: number; - ipAddress?: null | string; - token: string; - updatedAt: number; - userAgent?: null | string; - userId: string; - }; - model: "session"; - } - | { - data: { - accessToken?: null | string; - accessTokenExpiresAt?: null | number; - accountId: string; - createdAt: number; - idToken?: null | string; - password?: null | string; - providerId: string; - refreshToken?: null | string; - refreshTokenExpiresAt?: null | number; - scope?: null | string; - updatedAt: number; - userId: string; - }; - model: "account"; - } - | { - data: { - createdAt: number; - expiresAt: number; - identifier: string; - updatedAt: number; - value: string; - }; - model: "verification"; - } - | { - data: { backupCodes: string; secret: string; userId: string }; - model: "twoFactor"; - } - | { - data: { - aaguid?: null | string; - backedUp: boolean; - counter: number; - createdAt?: null | number; - credentialID: string; - deviceType: string; - name?: null | string; - publicKey: string; - transports?: null | string; - userId: string; - }; - model: "passkey"; - } - | { - data: { - clientId?: null | string; - clientSecret?: null | string; - createdAt?: null | number; - disabled?: null | boolean; - icon?: null | string; - metadata?: null | string; - name?: null | string; - redirectURLs?: null | string; - type?: null | string; - updatedAt?: null | number; - userId?: null | string; - }; - model: "oauthApplication"; - } - | { - data: { - accessToken?: null | string; - accessTokenExpiresAt?: null | number; - clientId?: null | string; - createdAt?: null | number; - refreshToken?: null | string; - refreshTokenExpiresAt?: null | number; - scopes?: null | string; - updatedAt?: null | number; - userId?: null | string; - }; - model: "oauthAccessToken"; - } - | { - data: { - clientId?: null | string; - consentGiven?: null | boolean; - createdAt?: null | number; - scopes?: null | string; - updatedAt?: null | number; - userId?: null | string; - }; - model: "oauthConsent"; - } - | { - data: { - createdAt: number; - privateKey: string; - publicKey: string; - }; - model: "jwks"; - } - | { - data: { - count?: null | number; - key?: null | string; - lastRequest?: null | number; - }; - model: "rateLimit"; - } - | { - data: { count: number; key: string; lastRequest: number }; - model: "ratelimit"; - }; - onCreateHandle?: string; - select?: Array; - }, - any - >; - deleteMany: FunctionReference< - "mutation", - "public", - { - input: - | { - model: "user"; - where?: Array<{ - connector?: "AND" | "OR"; - field: - | "name" - | "email" - | "emailVerified" - | "image" - | "createdAt" - | "updatedAt" - | "twoFactorEnabled" - | "isAnonymous" - | "username" - | "displayUsername" - | "phoneNumber" - | "phoneNumberVerified" - | "userId" - | "_id"; - operator?: - | "lt" - | "lte" - | "gt" - | "gte" - | "eq" - | "in" - | "not_in" - | "ne" - | "contains" - | "starts_with" - | "ends_with"; - value: - | string - | number - | boolean - | Array - | Array - | null; - }>; - } - | { - model: "session"; - where?: Array<{ - connector?: "AND" | "OR"; - field: - | "expiresAt" - | "token" - | "createdAt" - | "updatedAt" - | "ipAddress" - | "userAgent" - | "userId" - | "_id"; - operator?: - | "lt" - | "lte" - | "gt" - | "gte" - | "eq" - | "in" - | "not_in" - | "ne" - | "contains" - | "starts_with" - | "ends_with"; - value: - | string - | number - | boolean - | Array - | Array - | null; - }>; - } - | { - model: "account"; - where?: Array<{ - connector?: "AND" | "OR"; - field: - | "accountId" - | "providerId" - | "userId" - | "accessToken" - | "refreshToken" - | "idToken" - | "accessTokenExpiresAt" - | "refreshTokenExpiresAt" - | "scope" - | "password" - | "createdAt" - | "updatedAt" - | "_id"; - operator?: - | "lt" - | "lte" - | "gt" - | "gte" - | "eq" - | "in" - | "not_in" - | "ne" - | "contains" - | "starts_with" - | "ends_with"; - value: - | string - | number - | boolean - | Array - | Array - | null; - }>; - } - | { - model: "verification"; - where?: Array<{ - connector?: "AND" | "OR"; - field: - | "identifier" - | "value" - | "expiresAt" - | "createdAt" - | "updatedAt" - | "_id"; - operator?: - | "lt" - | "lte" - | "gt" - | "gte" - | "eq" - | "in" - | "not_in" - | "ne" - | "contains" - | "starts_with" - | "ends_with"; - value: - | string - | number - | boolean - | Array - | Array - | null; - }>; - } - | { - model: "twoFactor"; - where?: Array<{ - connector?: "AND" | "OR"; - field: "secret" | "backupCodes" | "userId" | "_id"; - operator?: - | "lt" - | "lte" - | "gt" - | "gte" - | "eq" - | "in" - | "not_in" - | "ne" - | "contains" - | "starts_with" - | "ends_with"; - value: - | string - | number - | boolean - | Array - | Array - | null; - }>; - } - | { - model: "passkey"; - where?: Array<{ - connector?: "AND" | "OR"; - field: - | "name" - | "publicKey" - | "userId" - | "credentialID" - | "counter" - | "deviceType" - | "backedUp" - | "transports" - | "createdAt" - | "aaguid" - | "_id"; - operator?: - | "lt" - | "lte" - | "gt" - | "gte" - | "eq" - | "in" - | "not_in" - | "ne" - | "contains" - | "starts_with" - | "ends_with"; - value: - | string - | number - | boolean - | Array - | Array - | null; - }>; - } - | { - model: "oauthApplication"; - where?: Array<{ - connector?: "AND" | "OR"; - field: - | "name" - | "icon" - | "metadata" - | "clientId" - | "clientSecret" - | "redirectURLs" - | "type" - | "disabled" - | "userId" - | "createdAt" - | "updatedAt" - | "_id"; - operator?: - | "lt" - | "lte" - | "gt" - | "gte" - | "eq" - | "in" - | "not_in" - | "ne" - | "contains" - | "starts_with" - | "ends_with"; - value: - | string - | number - | boolean - | Array - | Array - | null; - }>; - } - | { - model: "oauthAccessToken"; - where?: Array<{ - connector?: "AND" | "OR"; - field: - | "accessToken" - | "refreshToken" - | "accessTokenExpiresAt" - | "refreshTokenExpiresAt" - | "clientId" - | "userId" - | "scopes" - | "createdAt" - | "updatedAt" - | "_id"; - operator?: - | "lt" - | "lte" - | "gt" - | "gte" - | "eq" - | "in" - | "not_in" - | "ne" - | "contains" - | "starts_with" - | "ends_with"; - value: - | string - | number - | boolean - | Array - | Array - | null; - }>; - } - | { - model: "oauthConsent"; - where?: Array<{ - connector?: "AND" | "OR"; - field: - | "clientId" - | "userId" - | "scopes" - | "createdAt" - | "updatedAt" - | "consentGiven" - | "_id"; - operator?: - | "lt" - | "lte" - | "gt" - | "gte" - | "eq" - | "in" - | "not_in" - | "ne" - | "contains" - | "starts_with" - | "ends_with"; - value: - | string - | number - | boolean - | Array - | Array - | null; - }>; - } - | { - model: "jwks"; - where?: Array<{ - connector?: "AND" | "OR"; - field: "publicKey" | "privateKey" | "createdAt" | "_id"; - operator?: - | "lt" - | "lte" - | "gt" - | "gte" - | "eq" - | "in" - | "not_in" - | "ne" - | "contains" - | "starts_with" - | "ends_with"; - value: - | string - | number - | boolean - | Array - | Array - | null; - }>; - } - | { - model: "rateLimit"; - where?: Array<{ - connector?: "AND" | "OR"; - field: "key" | "count" | "lastRequest" | "_id"; - operator?: - | "lt" - | "lte" - | "gt" - | "gte" - | "eq" - | "in" - | "not_in" - | "ne" - | "contains" - | "starts_with" - | "ends_with"; - value: - | string - | number - | boolean - | Array - | Array - | null; - }>; - } - | { - model: "ratelimit"; - where?: Array<{ - connector?: "AND" | "OR"; - field: "key" | "count" | "lastRequest" | "_id"; - operator?: - | "lt" - | "lte" - | "gt" - | "gte" - | "eq" - | "in" - | "not_in" - | "ne" - | "contains" - | "starts_with" - | "ends_with"; - value: - | string - | number - | boolean - | Array - | Array - | null; - }>; - }; - onDeleteHandle?: string; - paginationOpts: { - cursor: string | null; - endCursor?: string | null; - id?: number; - maximumBytesRead?: number; - maximumRowsRead?: number; - numItems: number; - }; - }, - any - >; - deleteOne: FunctionReference< - "mutation", - "public", - { - input: - | { - model: "user"; - where?: Array<{ - connector?: "AND" | "OR"; - field: - | "name" - | "email" - | "emailVerified" - | "image" - | "createdAt" - | "updatedAt" - | "twoFactorEnabled" - | "isAnonymous" - | "username" - | "displayUsername" - | "phoneNumber" - | "phoneNumberVerified" - | "userId" - | "_id"; - operator?: - | "lt" - | "lte" - | "gt" - | "gte" - | "eq" - | "in" - | "not_in" - | "ne" - | "contains" - | "starts_with" - | "ends_with"; - value: - | string - | number - | boolean - | Array - | Array - | null; - }>; - } - | { - model: "session"; - where?: Array<{ - connector?: "AND" | "OR"; - field: - | "expiresAt" - | "token" - | "createdAt" - | "updatedAt" - | "ipAddress" - | "userAgent" - | "userId" - | "_id"; - operator?: - | "lt" - | "lte" - | "gt" - | "gte" - | "eq" - | "in" - | "not_in" - | "ne" - | "contains" - | "starts_with" - | "ends_with"; - value: - | string - | number - | boolean - | Array - | Array - | null; - }>; - } - | { - model: "account"; - where?: Array<{ - connector?: "AND" | "OR"; - field: - | "accountId" - | "providerId" - | "userId" - | "accessToken" - | "refreshToken" - | "idToken" - | "accessTokenExpiresAt" - | "refreshTokenExpiresAt" - | "scope" - | "password" - | "createdAt" - | "updatedAt" - | "_id"; - operator?: - | "lt" - | "lte" - | "gt" - | "gte" - | "eq" - | "in" - | "not_in" - | "ne" - | "contains" - | "starts_with" - | "ends_with"; - value: - | string - | number - | boolean - | Array - | Array - | null; - }>; - } - | { - model: "verification"; - where?: Array<{ - connector?: "AND" | "OR"; - field: - | "identifier" - | "value" - | "expiresAt" - | "createdAt" - | "updatedAt" - | "_id"; - operator?: - | "lt" - | "lte" - | "gt" - | "gte" - | "eq" - | "in" - | "not_in" - | "ne" - | "contains" - | "starts_with" - | "ends_with"; - value: - | string - | number - | boolean - | Array - | Array - | null; - }>; - } - | { - model: "twoFactor"; - where?: Array<{ - connector?: "AND" | "OR"; - field: "secret" | "backupCodes" | "userId" | "_id"; - operator?: - | "lt" - | "lte" - | "gt" - | "gte" - | "eq" - | "in" - | "not_in" - | "ne" - | "contains" - | "starts_with" - | "ends_with"; - value: - | string - | number - | boolean - | Array - | Array - | null; - }>; - } - | { - model: "passkey"; - where?: Array<{ - connector?: "AND" | "OR"; - field: - | "name" - | "publicKey" - | "userId" - | "credentialID" - | "counter" - | "deviceType" - | "backedUp" - | "transports" - | "createdAt" - | "aaguid" - | "_id"; - operator?: - | "lt" - | "lte" - | "gt" - | "gte" - | "eq" - | "in" - | "not_in" - | "ne" - | "contains" - | "starts_with" - | "ends_with"; - value: - | string - | number - | boolean - | Array - | Array - | null; - }>; - } - | { - model: "oauthApplication"; - where?: Array<{ - connector?: "AND" | "OR"; - field: - | "name" - | "icon" - | "metadata" - | "clientId" - | "clientSecret" - | "redirectURLs" - | "type" - | "disabled" - | "userId" - | "createdAt" - | "updatedAt" - | "_id"; - operator?: - | "lt" - | "lte" - | "gt" - | "gte" - | "eq" - | "in" - | "not_in" - | "ne" - | "contains" - | "starts_with" - | "ends_with"; - value: - | string - | number - | boolean - | Array - | Array - | null; - }>; - } - | { - model: "oauthAccessToken"; - where?: Array<{ - connector?: "AND" | "OR"; - field: - | "accessToken" - | "refreshToken" - | "accessTokenExpiresAt" - | "refreshTokenExpiresAt" - | "clientId" - | "userId" - | "scopes" - | "createdAt" - | "updatedAt" - | "_id"; - operator?: - | "lt" - | "lte" - | "gt" - | "gte" - | "eq" - | "in" - | "not_in" - | "ne" - | "contains" - | "starts_with" - | "ends_with"; - value: - | string - | number - | boolean - | Array - | Array - | null; - }>; - } - | { - model: "oauthConsent"; - where?: Array<{ - connector?: "AND" | "OR"; - field: - | "clientId" - | "userId" - | "scopes" - | "createdAt" - | "updatedAt" - | "consentGiven" - | "_id"; - operator?: - | "lt" - | "lte" - | "gt" - | "gte" - | "eq" - | "in" - | "not_in" - | "ne" - | "contains" - | "starts_with" - | "ends_with"; - value: - | string - | number - | boolean - | Array - | Array - | null; - }>; - } - | { - model: "jwks"; - where?: Array<{ - connector?: "AND" | "OR"; - field: "publicKey" | "privateKey" | "createdAt" | "_id"; - operator?: - | "lt" - | "lte" - | "gt" - | "gte" - | "eq" - | "in" - | "not_in" - | "ne" - | "contains" - | "starts_with" - | "ends_with"; - value: - | string - | number - | boolean - | Array - | Array - | null; - }>; - } - | { - model: "rateLimit"; - where?: Array<{ - connector?: "AND" | "OR"; - field: "key" | "count" | "lastRequest" | "_id"; - operator?: - | "lt" - | "lte" - | "gt" - | "gte" - | "eq" - | "in" - | "not_in" - | "ne" - | "contains" - | "starts_with" - | "ends_with"; - value: - | string - | number - | boolean - | Array - | Array - | null; - }>; - } - | { - model: "ratelimit"; - where?: Array<{ - connector?: "AND" | "OR"; - field: "key" | "count" | "lastRequest" | "_id"; - operator?: - | "lt" - | "lte" - | "gt" - | "gte" - | "eq" - | "in" - | "not_in" - | "ne" - | "contains" - | "starts_with" - | "ends_with"; - value: - | string - | number - | boolean - | Array - | Array - | null; - }>; - }; - onDeleteHandle?: string; - }, - any - >; - findMany: FunctionReference< - "query", - "public", - { - limit?: number; - model: - | "user" - | "session" - | "account" - | "verification" - | "twoFactor" - | "passkey" - | "oauthApplication" - | "oauthAccessToken" - | "oauthConsent" - | "jwks" - | "rateLimit" - | "ratelimit"; - offset?: number; - paginationOpts: { - cursor: string | null; - endCursor?: string | null; - id?: number; - maximumBytesRead?: number; - maximumRowsRead?: number; - numItems: number; - }; - sortBy?: { direction: "asc" | "desc"; field: string }; - where?: Array<{ - connector?: "AND" | "OR"; - field: string; - operator?: - | "lt" - | "lte" - | "gt" - | "gte" - | "eq" - | "in" - | "not_in" - | "ne" - | "contains" - | "starts_with" - | "ends_with"; - value: - | string - | number - | boolean - | Array - | Array - | null; - }>; - }, - any - >; - findOne: FunctionReference< - "query", - "public", - { - model: - | "user" - | "session" - | "account" - | "verification" - | "twoFactor" - | "passkey" - | "oauthApplication" - | "oauthAccessToken" - | "oauthConsent" - | "jwks" - | "rateLimit" - | "ratelimit"; - select?: Array; - where?: Array<{ - connector?: "AND" | "OR"; - field: string; - operator?: - | "lt" - | "lte" - | "gt" - | "gte" - | "eq" - | "in" - | "not_in" - | "ne" - | "contains" - | "starts_with" - | "ends_with"; - value: - | string - | number - | boolean - | Array - | Array - | null; - }>; - }, - any - >; - migrationRemoveUserId: FunctionReference< - "mutation", - "public", - { userId: string }, - any - >; - updateMany: FunctionReference< - "mutation", - "public", - { - input: - | { - model: "user"; - update: { - createdAt?: number; - displayUsername?: null | string; - email?: string; - emailVerified?: boolean; - image?: null | string; - isAnonymous?: null | boolean; - name?: string; - phoneNumber?: null | string; - phoneNumberVerified?: null | boolean; - twoFactorEnabled?: null | boolean; - updatedAt?: number; - userId?: null | string; - username?: null | string; - }; - where?: Array<{ - connector?: "AND" | "OR"; - field: - | "name" - | "email" - | "emailVerified" - | "image" - | "createdAt" - | "updatedAt" - | "twoFactorEnabled" - | "isAnonymous" - | "username" - | "displayUsername" - | "phoneNumber" - | "phoneNumberVerified" - | "userId" - | "_id"; - operator?: - | "lt" - | "lte" - | "gt" - | "gte" - | "eq" - | "in" - | "not_in" - | "ne" - | "contains" - | "starts_with" - | "ends_with"; - value: - | string - | number - | boolean - | Array - | Array - | null; - }>; - } - | { - model: "session"; - update: { - createdAt?: number; - expiresAt?: number; - ipAddress?: null | string; - token?: string; - updatedAt?: number; - userAgent?: null | string; - userId?: string; - }; - where?: Array<{ - connector?: "AND" | "OR"; - field: - | "expiresAt" - | "token" - | "createdAt" - | "updatedAt" - | "ipAddress" - | "userAgent" - | "userId" - | "_id"; - operator?: - | "lt" - | "lte" - | "gt" - | "gte" - | "eq" - | "in" - | "not_in" - | "ne" - | "contains" - | "starts_with" - | "ends_with"; - value: - | string - | number - | boolean - | Array - | Array - | null; - }>; - } - | { - model: "account"; - update: { - accessToken?: null | string; - accessTokenExpiresAt?: null | number; - accountId?: string; - createdAt?: number; - idToken?: null | string; - password?: null | string; - providerId?: string; - refreshToken?: null | string; - refreshTokenExpiresAt?: null | number; - scope?: null | string; - updatedAt?: number; - userId?: string; - }; - where?: Array<{ - connector?: "AND" | "OR"; - field: - | "accountId" - | "providerId" - | "userId" - | "accessToken" - | "refreshToken" - | "idToken" - | "accessTokenExpiresAt" - | "refreshTokenExpiresAt" - | "scope" - | "password" - | "createdAt" - | "updatedAt" - | "_id"; - operator?: - | "lt" - | "lte" - | "gt" - | "gte" - | "eq" - | "in" - | "not_in" - | "ne" - | "contains" - | "starts_with" - | "ends_with"; - value: - | string - | number - | boolean - | Array - | Array - | null; - }>; - } - | { - model: "verification"; - update: { - createdAt?: number; - expiresAt?: number; - identifier?: string; - updatedAt?: number; - value?: string; - }; - where?: Array<{ - connector?: "AND" | "OR"; - field: - | "identifier" - | "value" - | "expiresAt" - | "createdAt" - | "updatedAt" - | "_id"; - operator?: - | "lt" - | "lte" - | "gt" - | "gte" - | "eq" - | "in" - | "not_in" - | "ne" - | "contains" - | "starts_with" - | "ends_with"; - value: - | string - | number - | boolean - | Array - | Array - | null; - }>; - } - | { - model: "twoFactor"; - update: { - backupCodes?: string; - secret?: string; - userId?: string; - }; - where?: Array<{ - connector?: "AND" | "OR"; - field: "secret" | "backupCodes" | "userId" | "_id"; - operator?: - | "lt" - | "lte" - | "gt" - | "gte" - | "eq" - | "in" - | "not_in" - | "ne" - | "contains" - | "starts_with" - | "ends_with"; - value: - | string - | number - | boolean - | Array - | Array - | null; - }>; - } - | { - model: "passkey"; - update: { - aaguid?: null | string; - backedUp?: boolean; - counter?: number; - createdAt?: null | number; - credentialID?: string; - deviceType?: string; - name?: null | string; - publicKey?: string; - transports?: null | string; - userId?: string; - }; - where?: Array<{ - connector?: "AND" | "OR"; - field: - | "name" - | "publicKey" - | "userId" - | "credentialID" - | "counter" - | "deviceType" - | "backedUp" - | "transports" - | "createdAt" - | "aaguid" - | "_id"; - operator?: - | "lt" - | "lte" - | "gt" - | "gte" - | "eq" - | "in" - | "not_in" - | "ne" - | "contains" - | "starts_with" - | "ends_with"; - value: - | string - | number - | boolean - | Array - | Array - | null; - }>; - } - | { - model: "oauthApplication"; - update: { - clientId?: null | string; - clientSecret?: null | string; - createdAt?: null | number; - disabled?: null | boolean; - icon?: null | string; - metadata?: null | string; - name?: null | string; - redirectURLs?: null | string; - type?: null | string; - updatedAt?: null | number; - userId?: null | string; - }; - where?: Array<{ - connector?: "AND" | "OR"; - field: - | "name" - | "icon" - | "metadata" - | "clientId" - | "clientSecret" - | "redirectURLs" - | "type" - | "disabled" - | "userId" - | "createdAt" - | "updatedAt" - | "_id"; - operator?: - | "lt" - | "lte" - | "gt" - | "gte" - | "eq" - | "in" - | "not_in" - | "ne" - | "contains" - | "starts_with" - | "ends_with"; - value: - | string - | number - | boolean - | Array - | Array - | null; - }>; - } - | { - model: "oauthAccessToken"; - update: { - accessToken?: null | string; - accessTokenExpiresAt?: null | number; - clientId?: null | string; - createdAt?: null | number; - refreshToken?: null | string; - refreshTokenExpiresAt?: null | number; - scopes?: null | string; - updatedAt?: null | number; - userId?: null | string; - }; - where?: Array<{ - connector?: "AND" | "OR"; - field: - | "accessToken" - | "refreshToken" - | "accessTokenExpiresAt" - | "refreshTokenExpiresAt" - | "clientId" - | "userId" - | "scopes" - | "createdAt" - | "updatedAt" - | "_id"; - operator?: - | "lt" - | "lte" - | "gt" - | "gte" - | "eq" - | "in" - | "not_in" - | "ne" - | "contains" - | "starts_with" - | "ends_with"; - value: - | string - | number - | boolean - | Array - | Array - | null; - }>; - } - | { - model: "oauthConsent"; - update: { - clientId?: null | string; - consentGiven?: null | boolean; - createdAt?: null | number; - scopes?: null | string; - updatedAt?: null | number; - userId?: null | string; - }; - where?: Array<{ - connector?: "AND" | "OR"; - field: - | "clientId" - | "userId" - | "scopes" - | "createdAt" - | "updatedAt" - | "consentGiven" - | "_id"; - operator?: - | "lt" - | "lte" - | "gt" - | "gte" - | "eq" - | "in" - | "not_in" - | "ne" - | "contains" - | "starts_with" - | "ends_with"; - value: - | string - | number - | boolean - | Array - | Array - | null; - }>; - } - | { - model: "jwks"; - update: { - createdAt?: number; - privateKey?: string; - publicKey?: string; - }; - where?: Array<{ - connector?: "AND" | "OR"; - field: "publicKey" | "privateKey" | "createdAt" | "_id"; - operator?: - | "lt" - | "lte" - | "gt" - | "gte" - | "eq" - | "in" - | "not_in" - | "ne" - | "contains" - | "starts_with" - | "ends_with"; - value: - | string - | number - | boolean - | Array - | Array - | null; - }>; - } - | { - model: "rateLimit"; - update: { - count?: null | number; - key?: null | string; - lastRequest?: null | number; - }; - where?: Array<{ - connector?: "AND" | "OR"; - field: "key" | "count" | "lastRequest" | "_id"; - operator?: - | "lt" - | "lte" - | "gt" - | "gte" - | "eq" - | "in" - | "not_in" - | "ne" - | "contains" - | "starts_with" - | "ends_with"; - value: - | string - | number - | boolean - | Array - | Array - | null; - }>; - } - | { - model: "ratelimit"; - update: { count?: number; key?: string; lastRequest?: number }; - where?: Array<{ - connector?: "AND" | "OR"; - field: "key" | "count" | "lastRequest" | "_id"; - operator?: - | "lt" - | "lte" - | "gt" - | "gte" - | "eq" - | "in" - | "not_in" - | "ne" - | "contains" - | "starts_with" - | "ends_with"; - value: - | string - | number - | boolean - | Array - | Array - | null; - }>; - }; - onUpdateHandle?: string; - paginationOpts: { - cursor: string | null; - endCursor?: string | null; - id?: number; - maximumBytesRead?: number; - maximumRowsRead?: number; - numItems: number; - }; - }, - any - >; - updateOne: FunctionReference< - "mutation", - "public", - { - input: - | { - model: "user"; - update: { - createdAt?: number; - displayUsername?: null | string; - email?: string; - emailVerified?: boolean; - image?: null | string; - isAnonymous?: null | boolean; - name?: string; - phoneNumber?: null | string; - phoneNumberVerified?: null | boolean; - twoFactorEnabled?: null | boolean; - updatedAt?: number; - userId?: null | string; - username?: null | string; - }; - where?: Array<{ - connector?: "AND" | "OR"; - field: - | "name" - | "email" - | "emailVerified" - | "image" - | "createdAt" - | "updatedAt" - | "twoFactorEnabled" - | "isAnonymous" - | "username" - | "displayUsername" - | "phoneNumber" - | "phoneNumberVerified" - | "userId" - | "_id"; - operator?: - | "lt" - | "lte" - | "gt" - | "gte" - | "eq" - | "in" - | "not_in" - | "ne" - | "contains" - | "starts_with" - | "ends_with"; - value: - | string - | number - | boolean - | Array - | Array - | null; - }>; - } - | { - model: "session"; - update: { - createdAt?: number; - expiresAt?: number; - ipAddress?: null | string; - token?: string; - updatedAt?: number; - userAgent?: null | string; - userId?: string; - }; - where?: Array<{ - connector?: "AND" | "OR"; - field: - | "expiresAt" - | "token" - | "createdAt" - | "updatedAt" - | "ipAddress" - | "userAgent" - | "userId" - | "_id"; - operator?: - | "lt" - | "lte" - | "gt" - | "gte" - | "eq" - | "in" - | "not_in" - | "ne" - | "contains" - | "starts_with" - | "ends_with"; - value: - | string - | number - | boolean - | Array - | Array - | null; - }>; - } - | { - model: "account"; - update: { - accessToken?: null | string; - accessTokenExpiresAt?: null | number; - accountId?: string; - createdAt?: number; - idToken?: null | string; - password?: null | string; - providerId?: string; - refreshToken?: null | string; - refreshTokenExpiresAt?: null | number; - scope?: null | string; - updatedAt?: number; - userId?: string; - }; - where?: Array<{ - connector?: "AND" | "OR"; - field: - | "accountId" - | "providerId" - | "userId" - | "accessToken" - | "refreshToken" - | "idToken" - | "accessTokenExpiresAt" - | "refreshTokenExpiresAt" - | "scope" - | "password" - | "createdAt" - | "updatedAt" - | "_id"; - operator?: - | "lt" - | "lte" - | "gt" - | "gte" - | "eq" - | "in" - | "not_in" - | "ne" - | "contains" - | "starts_with" - | "ends_with"; - value: - | string - | number - | boolean - | Array - | Array - | null; - }>; - } - | { - model: "verification"; - update: { - createdAt?: number; - expiresAt?: number; - identifier?: string; - updatedAt?: number; - value?: string; - }; - where?: Array<{ - connector?: "AND" | "OR"; - field: - | "identifier" - | "value" - | "expiresAt" - | "createdAt" - | "updatedAt" - | "_id"; - operator?: - | "lt" - | "lte" - | "gt" - | "gte" - | "eq" - | "in" - | "not_in" - | "ne" - | "contains" - | "starts_with" - | "ends_with"; - value: - | string - | number - | boolean - | Array - | Array - | null; - }>; - } - | { - model: "twoFactor"; - update: { - backupCodes?: string; - secret?: string; - userId?: string; - }; - where?: Array<{ - connector?: "AND" | "OR"; - field: "secret" | "backupCodes" | "userId" | "_id"; - operator?: - | "lt" - | "lte" - | "gt" - | "gte" - | "eq" - | "in" - | "not_in" - | "ne" - | "contains" - | "starts_with" - | "ends_with"; - value: - | string - | number - | boolean - | Array - | Array - | null; - }>; - } - | { - model: "passkey"; - update: { - aaguid?: null | string; - backedUp?: boolean; - counter?: number; - createdAt?: null | number; - credentialID?: string; - deviceType?: string; - name?: null | string; - publicKey?: string; - transports?: null | string; - userId?: string; - }; - where?: Array<{ - connector?: "AND" | "OR"; - field: - | "name" - | "publicKey" - | "userId" - | "credentialID" - | "counter" - | "deviceType" - | "backedUp" - | "transports" - | "createdAt" - | "aaguid" - | "_id"; - operator?: - | "lt" - | "lte" - | "gt" - | "gte" - | "eq" - | "in" - | "not_in" - | "ne" - | "contains" - | "starts_with" - | "ends_with"; - value: - | string - | number - | boolean - | Array - | Array - | null; - }>; - } - | { - model: "oauthApplication"; - update: { - clientId?: null | string; - clientSecret?: null | string; - createdAt?: null | number; - disabled?: null | boolean; - icon?: null | string; - metadata?: null | string; - name?: null | string; - redirectURLs?: null | string; - type?: null | string; - updatedAt?: null | number; - userId?: null | string; - }; - where?: Array<{ - connector?: "AND" | "OR"; - field: - | "name" - | "icon" - | "metadata" - | "clientId" - | "clientSecret" - | "redirectURLs" - | "type" - | "disabled" - | "userId" - | "createdAt" - | "updatedAt" - | "_id"; - operator?: - | "lt" - | "lte" - | "gt" - | "gte" - | "eq" - | "in" - | "not_in" - | "ne" - | "contains" - | "starts_with" - | "ends_with"; - value: - | string - | number - | boolean - | Array - | Array - | null; - }>; - } - | { - model: "oauthAccessToken"; - update: { - accessToken?: null | string; - accessTokenExpiresAt?: null | number; - clientId?: null | string; - createdAt?: null | number; - refreshToken?: null | string; - refreshTokenExpiresAt?: null | number; - scopes?: null | string; - updatedAt?: null | number; - userId?: null | string; - }; - where?: Array<{ - connector?: "AND" | "OR"; - field: - | "accessToken" - | "refreshToken" - | "accessTokenExpiresAt" - | "refreshTokenExpiresAt" - | "clientId" - | "userId" - | "scopes" - | "createdAt" - | "updatedAt" - | "_id"; - operator?: - | "lt" - | "lte" - | "gt" - | "gte" - | "eq" - | "in" - | "not_in" - | "ne" - | "contains" - | "starts_with" - | "ends_with"; - value: - | string - | number - | boolean - | Array - | Array - | null; - }>; - } - | { - model: "oauthConsent"; - update: { - clientId?: null | string; - consentGiven?: null | boolean; - createdAt?: null | number; - scopes?: null | string; - updatedAt?: null | number; - userId?: null | string; - }; - where?: Array<{ - connector?: "AND" | "OR"; - field: - | "clientId" - | "userId" - | "scopes" - | "createdAt" - | "updatedAt" - | "consentGiven" - | "_id"; - operator?: - | "lt" - | "lte" - | "gt" - | "gte" - | "eq" - | "in" - | "not_in" - | "ne" - | "contains" - | "starts_with" - | "ends_with"; - value: - | string - | number - | boolean - | Array - | Array - | null; - }>; - } - | { - model: "jwks"; - update: { - createdAt?: number; - privateKey?: string; - publicKey?: string; - }; - where?: Array<{ - connector?: "AND" | "OR"; - field: "publicKey" | "privateKey" | "createdAt" | "_id"; - operator?: - | "lt" - | "lte" - | "gt" - | "gte" - | "eq" - | "in" - | "not_in" - | "ne" - | "contains" - | "starts_with" - | "ends_with"; - value: - | string - | number - | boolean - | Array - | Array - | null; - }>; - } - | { - model: "rateLimit"; - update: { - count?: null | number; - key?: null | string; - lastRequest?: null | number; - }; - where?: Array<{ - connector?: "AND" | "OR"; - field: "key" | "count" | "lastRequest" | "_id"; - operator?: - | "lt" - | "lte" - | "gt" - | "gte" - | "eq" - | "in" - | "not_in" - | "ne" - | "contains" - | "starts_with" - | "ends_with"; - value: - | string - | number - | boolean - | Array - | Array - | null; - }>; - } - | { - model: "ratelimit"; - update: { count?: number; key?: string; lastRequest?: number }; - where?: Array<{ - connector?: "AND" | "OR"; - field: "key" | "count" | "lastRequest" | "_id"; - operator?: - | "lt" - | "lte" - | "gt" - | "gte" - | "eq" - | "in" - | "not_in" - | "ne" - | "contains" - | "starts_with" - | "ends_with"; - value: - | string - | number - | boolean - | Array - | Array - | null; - }>; - }; - onUpdateHandle?: string; - }, - any - >; - }; - adapterTest: { - count: FunctionReference<"query", "public", any, any>; - create: FunctionReference<"mutation", "public", any, any>; - delete: FunctionReference<"mutation", "public", any, any>; - deleteMany: FunctionReference<"mutation", "public", any, any>; - findMany: FunctionReference<"query", "public", any, any>; - findOne: FunctionReference<"query", "public", any, any>; - update: FunctionReference<"mutation", "public", any, any>; - updateMany: FunctionReference<"mutation", "public", any, any>; - }; -}; -// For now fullApiWithMounts is only fullApi which provides -// jump-to-definition in component client code. -// Use Mounts for the same type without the inference. -declare const fullApiWithMounts: typeof fullApi; - -export declare const api: FilterApi< - typeof fullApiWithMounts, - FunctionReference ->; -export declare const internal: FilterApi< - typeof fullApiWithMounts, - FunctionReference ->; - -export declare const components: {}; diff --git a/src/component/_generated/api.js b/src/component/_generated/api.js deleted file mode 100644 index 44bf985..0000000 --- a/src/component/_generated/api.js +++ /dev/null @@ -1,23 +0,0 @@ -/* eslint-disable */ -/** - * Generated `api` utility. - * - * THIS CODE IS AUTOMATICALLY GENERATED. - * - * To regenerate, run `npx convex dev`. - * @module - */ - -import { anyApi, componentsGeneric } from "convex/server"; - -/** - * A utility for referencing Convex functions in your app's API. - * - * Usage: - * ```js - * const myFunctionReference = api.myModule.myFunction; - * ``` - */ -export const api = anyApi; -export const internal = anyApi; -export const components = componentsGeneric(); diff --git a/src/component/_generated/api.ts b/src/component/_generated/api.ts new file mode 100644 index 0000000..ca6b01b --- /dev/null +++ b/src/component/_generated/api.ts @@ -0,0 +1,52 @@ +/* eslint-disable */ +/** + * Generated `api` utility. + * + * THIS CODE IS AUTOMATICALLY GENERATED. + * + * To regenerate, run `npx convex dev`. + * @module + */ + +import type * as adapter from "../adapter.js"; +import type * as adapterTest from "../adapterTest.js"; + +import type { + ApiFromModules, + FilterApi, + FunctionReference, +} from "convex/server"; +import { anyApi, componentsGeneric } from "convex/server"; + +const fullApi: ApiFromModules<{ + adapter: typeof adapter; + adapterTest: typeof adapterTest; +}> = anyApi as any; + +/** + * A utility for referencing Convex functions in your app's public API. + * + * Usage: + * ```js + * const myFunctionReference = api.myModule.myFunction; + * ``` + */ +export const api: FilterApi< + typeof fullApi, + FunctionReference +> = anyApi as any; + +/** + * A utility for referencing Convex functions in your app's internal API. + * + * Usage: + * ```js + * const myFunctionReference = internal.myModule.myFunction; + * ``` + */ +export const internal: FilterApi< + typeof fullApi, + FunctionReference +> = anyApi as any; + +export const components = componentsGeneric() as unknown as {}; diff --git a/src/component/_generated/component.ts b/src/component/_generated/component.ts new file mode 100644 index 0000000..08e2f34 --- /dev/null +++ b/src/component/_generated/component.ts @@ -0,0 +1,2131 @@ +/* eslint-disable */ +/** + * Generated `ComponentApi` utility. + * + * THIS CODE IS AUTOMATICALLY GENERATED. + * + * To regenerate, run `npx convex dev`. + * @module + */ + +import type { FunctionReference } from "convex/server"; + +/** + * A utility for referencing a Convex component's exposed API. + * + * Useful when expecting a parameter like `components.myComponent`. + * Usage: + * ```ts + * async function myFunction(ctx: QueryCtx, component: ComponentApi) { + * return ctx.runQuery(component.someFile.someQuery, { ...args }); + * } + * ``` + */ +export type ComponentApi = + { + adapter: { + create: FunctionReference< + "mutation", + "internal", + { + input: + | { + data: { + createdAt: number; + displayUsername?: null | string; + email: string; + emailVerified: boolean; + image?: null | string; + isAnonymous?: null | boolean; + name: string; + phoneNumber?: null | string; + phoneNumberVerified?: null | boolean; + twoFactorEnabled?: null | boolean; + updatedAt: number; + userId?: null | string; + username?: null | string; + }; + model: "user"; + } + | { + data: { + createdAt: number; + expiresAt: number; + ipAddress?: null | string; + token: string; + updatedAt: number; + userAgent?: null | string; + userId: string; + }; + model: "session"; + } + | { + data: { + accessToken?: null | string; + accessTokenExpiresAt?: null | number; + accountId: string; + createdAt: number; + idToken?: null | string; + password?: null | string; + providerId: string; + refreshToken?: null | string; + refreshTokenExpiresAt?: null | number; + scope?: null | string; + updatedAt: number; + userId: string; + }; + model: "account"; + } + | { + data: { + createdAt: number; + expiresAt: number; + identifier: string; + updatedAt: number; + value: string; + }; + model: "verification"; + } + | { + data: { backupCodes: string; secret: string; userId: string }; + model: "twoFactor"; + } + | { + data: { + aaguid?: null | string; + backedUp: boolean; + counter: number; + createdAt?: null | number; + credentialID: string; + deviceType: string; + name?: null | string; + publicKey: string; + transports?: null | string; + userId: string; + }; + model: "passkey"; + } + | { + data: { + clientId?: null | string; + clientSecret?: null | string; + createdAt?: null | number; + disabled?: null | boolean; + icon?: null | string; + metadata?: null | string; + name?: null | string; + redirectURLs?: null | string; + type?: null | string; + updatedAt?: null | number; + userId?: null | string; + }; + model: "oauthApplication"; + } + | { + data: { + accessToken?: null | string; + accessTokenExpiresAt?: null | number; + clientId?: null | string; + createdAt?: null | number; + refreshToken?: null | string; + refreshTokenExpiresAt?: null | number; + scopes?: null | string; + updatedAt?: null | number; + userId?: null | string; + }; + model: "oauthAccessToken"; + } + | { + data: { + clientId?: null | string; + consentGiven?: null | boolean; + createdAt?: null | number; + scopes?: null | string; + updatedAt?: null | number; + userId?: null | string; + }; + model: "oauthConsent"; + } + | { + data: { + createdAt: number; + privateKey: string; + publicKey: string; + }; + model: "jwks"; + } + | { + data: { + count?: null | number; + key?: null | string; + lastRequest?: null | number; + }; + model: "rateLimit"; + } + | { + data: { count: number; key: string; lastRequest: number }; + model: "ratelimit"; + }; + onCreateHandle?: string; + select?: Array; + }, + any, + Name + >; + deleteMany: FunctionReference< + "mutation", + "internal", + { + input: + | { + model: "user"; + where?: Array<{ + connector?: "AND" | "OR"; + field: + | "name" + | "email" + | "emailVerified" + | "image" + | "createdAt" + | "updatedAt" + | "twoFactorEnabled" + | "isAnonymous" + | "username" + | "displayUsername" + | "phoneNumber" + | "phoneNumberVerified" + | "userId" + | "_id"; + operator?: + | "lt" + | "lte" + | "gt" + | "gte" + | "eq" + | "in" + | "not_in" + | "ne" + | "contains" + | "starts_with" + | "ends_with"; + value: + | string + | number + | boolean + | Array + | Array + | null; + }>; + } + | { + model: "session"; + where?: Array<{ + connector?: "AND" | "OR"; + field: + | "expiresAt" + | "token" + | "createdAt" + | "updatedAt" + | "ipAddress" + | "userAgent" + | "userId" + | "_id"; + operator?: + | "lt" + | "lte" + | "gt" + | "gte" + | "eq" + | "in" + | "not_in" + | "ne" + | "contains" + | "starts_with" + | "ends_with"; + value: + | string + | number + | boolean + | Array + | Array + | null; + }>; + } + | { + model: "account"; + where?: Array<{ + connector?: "AND" | "OR"; + field: + | "accountId" + | "providerId" + | "userId" + | "accessToken" + | "refreshToken" + | "idToken" + | "accessTokenExpiresAt" + | "refreshTokenExpiresAt" + | "scope" + | "password" + | "createdAt" + | "updatedAt" + | "_id"; + operator?: + | "lt" + | "lte" + | "gt" + | "gte" + | "eq" + | "in" + | "not_in" + | "ne" + | "contains" + | "starts_with" + | "ends_with"; + value: + | string + | number + | boolean + | Array + | Array + | null; + }>; + } + | { + model: "verification"; + where?: Array<{ + connector?: "AND" | "OR"; + field: + | "identifier" + | "value" + | "expiresAt" + | "createdAt" + | "updatedAt" + | "_id"; + operator?: + | "lt" + | "lte" + | "gt" + | "gte" + | "eq" + | "in" + | "not_in" + | "ne" + | "contains" + | "starts_with" + | "ends_with"; + value: + | string + | number + | boolean + | Array + | Array + | null; + }>; + } + | { + model: "twoFactor"; + where?: Array<{ + connector?: "AND" | "OR"; + field: "secret" | "backupCodes" | "userId" | "_id"; + operator?: + | "lt" + | "lte" + | "gt" + | "gte" + | "eq" + | "in" + | "not_in" + | "ne" + | "contains" + | "starts_with" + | "ends_with"; + value: + | string + | number + | boolean + | Array + | Array + | null; + }>; + } + | { + model: "passkey"; + where?: Array<{ + connector?: "AND" | "OR"; + field: + | "name" + | "publicKey" + | "userId" + | "credentialID" + | "counter" + | "deviceType" + | "backedUp" + | "transports" + | "createdAt" + | "aaguid" + | "_id"; + operator?: + | "lt" + | "lte" + | "gt" + | "gte" + | "eq" + | "in" + | "not_in" + | "ne" + | "contains" + | "starts_with" + | "ends_with"; + value: + | string + | number + | boolean + | Array + | Array + | null; + }>; + } + | { + model: "oauthApplication"; + where?: Array<{ + connector?: "AND" | "OR"; + field: + | "name" + | "icon" + | "metadata" + | "clientId" + | "clientSecret" + | "redirectURLs" + | "type" + | "disabled" + | "userId" + | "createdAt" + | "updatedAt" + | "_id"; + operator?: + | "lt" + | "lte" + | "gt" + | "gte" + | "eq" + | "in" + | "not_in" + | "ne" + | "contains" + | "starts_with" + | "ends_with"; + value: + | string + | number + | boolean + | Array + | Array + | null; + }>; + } + | { + model: "oauthAccessToken"; + where?: Array<{ + connector?: "AND" | "OR"; + field: + | "accessToken" + | "refreshToken" + | "accessTokenExpiresAt" + | "refreshTokenExpiresAt" + | "clientId" + | "userId" + | "scopes" + | "createdAt" + | "updatedAt" + | "_id"; + operator?: + | "lt" + | "lte" + | "gt" + | "gte" + | "eq" + | "in" + | "not_in" + | "ne" + | "contains" + | "starts_with" + | "ends_with"; + value: + | string + | number + | boolean + | Array + | Array + | null; + }>; + } + | { + model: "oauthConsent"; + where?: Array<{ + connector?: "AND" | "OR"; + field: + | "clientId" + | "userId" + | "scopes" + | "createdAt" + | "updatedAt" + | "consentGiven" + | "_id"; + operator?: + | "lt" + | "lte" + | "gt" + | "gte" + | "eq" + | "in" + | "not_in" + | "ne" + | "contains" + | "starts_with" + | "ends_with"; + value: + | string + | number + | boolean + | Array + | Array + | null; + }>; + } + | { + model: "jwks"; + where?: Array<{ + connector?: "AND" | "OR"; + field: "publicKey" | "privateKey" | "createdAt" | "_id"; + operator?: + | "lt" + | "lte" + | "gt" + | "gte" + | "eq" + | "in" + | "not_in" + | "ne" + | "contains" + | "starts_with" + | "ends_with"; + value: + | string + | number + | boolean + | Array + | Array + | null; + }>; + } + | { + model: "rateLimit"; + where?: Array<{ + connector?: "AND" | "OR"; + field: "key" | "count" | "lastRequest" | "_id"; + operator?: + | "lt" + | "lte" + | "gt" + | "gte" + | "eq" + | "in" + | "not_in" + | "ne" + | "contains" + | "starts_with" + | "ends_with"; + value: + | string + | number + | boolean + | Array + | Array + | null; + }>; + } + | { + model: "ratelimit"; + where?: Array<{ + connector?: "AND" | "OR"; + field: "key" | "count" | "lastRequest" | "_id"; + operator?: + | "lt" + | "lte" + | "gt" + | "gte" + | "eq" + | "in" + | "not_in" + | "ne" + | "contains" + | "starts_with" + | "ends_with"; + value: + | string + | number + | boolean + | Array + | Array + | null; + }>; + }; + onDeleteHandle?: string; + paginationOpts: { + cursor: string | null; + endCursor?: string | null; + id?: number; + maximumBytesRead?: number; + maximumRowsRead?: number; + numItems: number; + }; + }, + any, + Name + >; + deleteOne: FunctionReference< + "mutation", + "internal", + { + input: + | { + model: "user"; + where?: Array<{ + connector?: "AND" | "OR"; + field: + | "name" + | "email" + | "emailVerified" + | "image" + | "createdAt" + | "updatedAt" + | "twoFactorEnabled" + | "isAnonymous" + | "username" + | "displayUsername" + | "phoneNumber" + | "phoneNumberVerified" + | "userId" + | "_id"; + operator?: + | "lt" + | "lte" + | "gt" + | "gte" + | "eq" + | "in" + | "not_in" + | "ne" + | "contains" + | "starts_with" + | "ends_with"; + value: + | string + | number + | boolean + | Array + | Array + | null; + }>; + } + | { + model: "session"; + where?: Array<{ + connector?: "AND" | "OR"; + field: + | "expiresAt" + | "token" + | "createdAt" + | "updatedAt" + | "ipAddress" + | "userAgent" + | "userId" + | "_id"; + operator?: + | "lt" + | "lte" + | "gt" + | "gte" + | "eq" + | "in" + | "not_in" + | "ne" + | "contains" + | "starts_with" + | "ends_with"; + value: + | string + | number + | boolean + | Array + | Array + | null; + }>; + } + | { + model: "account"; + where?: Array<{ + connector?: "AND" | "OR"; + field: + | "accountId" + | "providerId" + | "userId" + | "accessToken" + | "refreshToken" + | "idToken" + | "accessTokenExpiresAt" + | "refreshTokenExpiresAt" + | "scope" + | "password" + | "createdAt" + | "updatedAt" + | "_id"; + operator?: + | "lt" + | "lte" + | "gt" + | "gte" + | "eq" + | "in" + | "not_in" + | "ne" + | "contains" + | "starts_with" + | "ends_with"; + value: + | string + | number + | boolean + | Array + | Array + | null; + }>; + } + | { + model: "verification"; + where?: Array<{ + connector?: "AND" | "OR"; + field: + | "identifier" + | "value" + | "expiresAt" + | "createdAt" + | "updatedAt" + | "_id"; + operator?: + | "lt" + | "lte" + | "gt" + | "gte" + | "eq" + | "in" + | "not_in" + | "ne" + | "contains" + | "starts_with" + | "ends_with"; + value: + | string + | number + | boolean + | Array + | Array + | null; + }>; + } + | { + model: "twoFactor"; + where?: Array<{ + connector?: "AND" | "OR"; + field: "secret" | "backupCodes" | "userId" | "_id"; + operator?: + | "lt" + | "lte" + | "gt" + | "gte" + | "eq" + | "in" + | "not_in" + | "ne" + | "contains" + | "starts_with" + | "ends_with"; + value: + | string + | number + | boolean + | Array + | Array + | null; + }>; + } + | { + model: "passkey"; + where?: Array<{ + connector?: "AND" | "OR"; + field: + | "name" + | "publicKey" + | "userId" + | "credentialID" + | "counter" + | "deviceType" + | "backedUp" + | "transports" + | "createdAt" + | "aaguid" + | "_id"; + operator?: + | "lt" + | "lte" + | "gt" + | "gte" + | "eq" + | "in" + | "not_in" + | "ne" + | "contains" + | "starts_with" + | "ends_with"; + value: + | string + | number + | boolean + | Array + | Array + | null; + }>; + } + | { + model: "oauthApplication"; + where?: Array<{ + connector?: "AND" | "OR"; + field: + | "name" + | "icon" + | "metadata" + | "clientId" + | "clientSecret" + | "redirectURLs" + | "type" + | "disabled" + | "userId" + | "createdAt" + | "updatedAt" + | "_id"; + operator?: + | "lt" + | "lte" + | "gt" + | "gte" + | "eq" + | "in" + | "not_in" + | "ne" + | "contains" + | "starts_with" + | "ends_with"; + value: + | string + | number + | boolean + | Array + | Array + | null; + }>; + } + | { + model: "oauthAccessToken"; + where?: Array<{ + connector?: "AND" | "OR"; + field: + | "accessToken" + | "refreshToken" + | "accessTokenExpiresAt" + | "refreshTokenExpiresAt" + | "clientId" + | "userId" + | "scopes" + | "createdAt" + | "updatedAt" + | "_id"; + operator?: + | "lt" + | "lte" + | "gt" + | "gte" + | "eq" + | "in" + | "not_in" + | "ne" + | "contains" + | "starts_with" + | "ends_with"; + value: + | string + | number + | boolean + | Array + | Array + | null; + }>; + } + | { + model: "oauthConsent"; + where?: Array<{ + connector?: "AND" | "OR"; + field: + | "clientId" + | "userId" + | "scopes" + | "createdAt" + | "updatedAt" + | "consentGiven" + | "_id"; + operator?: + | "lt" + | "lte" + | "gt" + | "gte" + | "eq" + | "in" + | "not_in" + | "ne" + | "contains" + | "starts_with" + | "ends_with"; + value: + | string + | number + | boolean + | Array + | Array + | null; + }>; + } + | { + model: "jwks"; + where?: Array<{ + connector?: "AND" | "OR"; + field: "publicKey" | "privateKey" | "createdAt" | "_id"; + operator?: + | "lt" + | "lte" + | "gt" + | "gte" + | "eq" + | "in" + | "not_in" + | "ne" + | "contains" + | "starts_with" + | "ends_with"; + value: + | string + | number + | boolean + | Array + | Array + | null; + }>; + } + | { + model: "rateLimit"; + where?: Array<{ + connector?: "AND" | "OR"; + field: "key" | "count" | "lastRequest" | "_id"; + operator?: + | "lt" + | "lte" + | "gt" + | "gte" + | "eq" + | "in" + | "not_in" + | "ne" + | "contains" + | "starts_with" + | "ends_with"; + value: + | string + | number + | boolean + | Array + | Array + | null; + }>; + } + | { + model: "ratelimit"; + where?: Array<{ + connector?: "AND" | "OR"; + field: "key" | "count" | "lastRequest" | "_id"; + operator?: + | "lt" + | "lte" + | "gt" + | "gte" + | "eq" + | "in" + | "not_in" + | "ne" + | "contains" + | "starts_with" + | "ends_with"; + value: + | string + | number + | boolean + | Array + | Array + | null; + }>; + }; + onDeleteHandle?: string; + }, + any, + Name + >; + findMany: FunctionReference< + "query", + "internal", + { + limit?: number; + model: + | "user" + | "session" + | "account" + | "verification" + | "twoFactor" + | "passkey" + | "oauthApplication" + | "oauthAccessToken" + | "oauthConsent" + | "jwks" + | "rateLimit" + | "ratelimit"; + offset?: number; + paginationOpts: { + cursor: string | null; + endCursor?: string | null; + id?: number; + maximumBytesRead?: number; + maximumRowsRead?: number; + numItems: number; + }; + sortBy?: { direction: "asc" | "desc"; field: string }; + where?: Array<{ + connector?: "AND" | "OR"; + field: string; + operator?: + | "lt" + | "lte" + | "gt" + | "gte" + | "eq" + | "in" + | "not_in" + | "ne" + | "contains" + | "starts_with" + | "ends_with"; + value: + | string + | number + | boolean + | Array + | Array + | null; + }>; + }, + any, + Name + >; + findOne: FunctionReference< + "query", + "internal", + { + model: + | "user" + | "session" + | "account" + | "verification" + | "twoFactor" + | "passkey" + | "oauthApplication" + | "oauthAccessToken" + | "oauthConsent" + | "jwks" + | "rateLimit" + | "ratelimit"; + select?: Array; + where?: Array<{ + connector?: "AND" | "OR"; + field: string; + operator?: + | "lt" + | "lte" + | "gt" + | "gte" + | "eq" + | "in" + | "not_in" + | "ne" + | "contains" + | "starts_with" + | "ends_with"; + value: + | string + | number + | boolean + | Array + | Array + | null; + }>; + }, + any, + Name + >; + migrationRemoveUserId: FunctionReference< + "mutation", + "internal", + { userId: string }, + any, + Name + >; + updateMany: FunctionReference< + "mutation", + "internal", + { + input: + | { + model: "user"; + update: { + createdAt?: number; + displayUsername?: null | string; + email?: string; + emailVerified?: boolean; + image?: null | string; + isAnonymous?: null | boolean; + name?: string; + phoneNumber?: null | string; + phoneNumberVerified?: null | boolean; + twoFactorEnabled?: null | boolean; + updatedAt?: number; + userId?: null | string; + username?: null | string; + }; + where?: Array<{ + connector?: "AND" | "OR"; + field: + | "name" + | "email" + | "emailVerified" + | "image" + | "createdAt" + | "updatedAt" + | "twoFactorEnabled" + | "isAnonymous" + | "username" + | "displayUsername" + | "phoneNumber" + | "phoneNumberVerified" + | "userId" + | "_id"; + operator?: + | "lt" + | "lte" + | "gt" + | "gte" + | "eq" + | "in" + | "not_in" + | "ne" + | "contains" + | "starts_with" + | "ends_with"; + value: + | string + | number + | boolean + | Array + | Array + | null; + }>; + } + | { + model: "session"; + update: { + createdAt?: number; + expiresAt?: number; + ipAddress?: null | string; + token?: string; + updatedAt?: number; + userAgent?: null | string; + userId?: string; + }; + where?: Array<{ + connector?: "AND" | "OR"; + field: + | "expiresAt" + | "token" + | "createdAt" + | "updatedAt" + | "ipAddress" + | "userAgent" + | "userId" + | "_id"; + operator?: + | "lt" + | "lte" + | "gt" + | "gte" + | "eq" + | "in" + | "not_in" + | "ne" + | "contains" + | "starts_with" + | "ends_with"; + value: + | string + | number + | boolean + | Array + | Array + | null; + }>; + } + | { + model: "account"; + update: { + accessToken?: null | string; + accessTokenExpiresAt?: null | number; + accountId?: string; + createdAt?: number; + idToken?: null | string; + password?: null | string; + providerId?: string; + refreshToken?: null | string; + refreshTokenExpiresAt?: null | number; + scope?: null | string; + updatedAt?: number; + userId?: string; + }; + where?: Array<{ + connector?: "AND" | "OR"; + field: + | "accountId" + | "providerId" + | "userId" + | "accessToken" + | "refreshToken" + | "idToken" + | "accessTokenExpiresAt" + | "refreshTokenExpiresAt" + | "scope" + | "password" + | "createdAt" + | "updatedAt" + | "_id"; + operator?: + | "lt" + | "lte" + | "gt" + | "gte" + | "eq" + | "in" + | "not_in" + | "ne" + | "contains" + | "starts_with" + | "ends_with"; + value: + | string + | number + | boolean + | Array + | Array + | null; + }>; + } + | { + model: "verification"; + update: { + createdAt?: number; + expiresAt?: number; + identifier?: string; + updatedAt?: number; + value?: string; + }; + where?: Array<{ + connector?: "AND" | "OR"; + field: + | "identifier" + | "value" + | "expiresAt" + | "createdAt" + | "updatedAt" + | "_id"; + operator?: + | "lt" + | "lte" + | "gt" + | "gte" + | "eq" + | "in" + | "not_in" + | "ne" + | "contains" + | "starts_with" + | "ends_with"; + value: + | string + | number + | boolean + | Array + | Array + | null; + }>; + } + | { + model: "twoFactor"; + update: { + backupCodes?: string; + secret?: string; + userId?: string; + }; + where?: Array<{ + connector?: "AND" | "OR"; + field: "secret" | "backupCodes" | "userId" | "_id"; + operator?: + | "lt" + | "lte" + | "gt" + | "gte" + | "eq" + | "in" + | "not_in" + | "ne" + | "contains" + | "starts_with" + | "ends_with"; + value: + | string + | number + | boolean + | Array + | Array + | null; + }>; + } + | { + model: "passkey"; + update: { + aaguid?: null | string; + backedUp?: boolean; + counter?: number; + createdAt?: null | number; + credentialID?: string; + deviceType?: string; + name?: null | string; + publicKey?: string; + transports?: null | string; + userId?: string; + }; + where?: Array<{ + connector?: "AND" | "OR"; + field: + | "name" + | "publicKey" + | "userId" + | "credentialID" + | "counter" + | "deviceType" + | "backedUp" + | "transports" + | "createdAt" + | "aaguid" + | "_id"; + operator?: + | "lt" + | "lte" + | "gt" + | "gte" + | "eq" + | "in" + | "not_in" + | "ne" + | "contains" + | "starts_with" + | "ends_with"; + value: + | string + | number + | boolean + | Array + | Array + | null; + }>; + } + | { + model: "oauthApplication"; + update: { + clientId?: null | string; + clientSecret?: null | string; + createdAt?: null | number; + disabled?: null | boolean; + icon?: null | string; + metadata?: null | string; + name?: null | string; + redirectURLs?: null | string; + type?: null | string; + updatedAt?: null | number; + userId?: null | string; + }; + where?: Array<{ + connector?: "AND" | "OR"; + field: + | "name" + | "icon" + | "metadata" + | "clientId" + | "clientSecret" + | "redirectURLs" + | "type" + | "disabled" + | "userId" + | "createdAt" + | "updatedAt" + | "_id"; + operator?: + | "lt" + | "lte" + | "gt" + | "gte" + | "eq" + | "in" + | "not_in" + | "ne" + | "contains" + | "starts_with" + | "ends_with"; + value: + | string + | number + | boolean + | Array + | Array + | null; + }>; + } + | { + model: "oauthAccessToken"; + update: { + accessToken?: null | string; + accessTokenExpiresAt?: null | number; + clientId?: null | string; + createdAt?: null | number; + refreshToken?: null | string; + refreshTokenExpiresAt?: null | number; + scopes?: null | string; + updatedAt?: null | number; + userId?: null | string; + }; + where?: Array<{ + connector?: "AND" | "OR"; + field: + | "accessToken" + | "refreshToken" + | "accessTokenExpiresAt" + | "refreshTokenExpiresAt" + | "clientId" + | "userId" + | "scopes" + | "createdAt" + | "updatedAt" + | "_id"; + operator?: + | "lt" + | "lte" + | "gt" + | "gte" + | "eq" + | "in" + | "not_in" + | "ne" + | "contains" + | "starts_with" + | "ends_with"; + value: + | string + | number + | boolean + | Array + | Array + | null; + }>; + } + | { + model: "oauthConsent"; + update: { + clientId?: null | string; + consentGiven?: null | boolean; + createdAt?: null | number; + scopes?: null | string; + updatedAt?: null | number; + userId?: null | string; + }; + where?: Array<{ + connector?: "AND" | "OR"; + field: + | "clientId" + | "userId" + | "scopes" + | "createdAt" + | "updatedAt" + | "consentGiven" + | "_id"; + operator?: + | "lt" + | "lte" + | "gt" + | "gte" + | "eq" + | "in" + | "not_in" + | "ne" + | "contains" + | "starts_with" + | "ends_with"; + value: + | string + | number + | boolean + | Array + | Array + | null; + }>; + } + | { + model: "jwks"; + update: { + createdAt?: number; + privateKey?: string; + publicKey?: string; + }; + where?: Array<{ + connector?: "AND" | "OR"; + field: "publicKey" | "privateKey" | "createdAt" | "_id"; + operator?: + | "lt" + | "lte" + | "gt" + | "gte" + | "eq" + | "in" + | "not_in" + | "ne" + | "contains" + | "starts_with" + | "ends_with"; + value: + | string + | number + | boolean + | Array + | Array + | null; + }>; + } + | { + model: "rateLimit"; + update: { + count?: null | number; + key?: null | string; + lastRequest?: null | number; + }; + where?: Array<{ + connector?: "AND" | "OR"; + field: "key" | "count" | "lastRequest" | "_id"; + operator?: + | "lt" + | "lte" + | "gt" + | "gte" + | "eq" + | "in" + | "not_in" + | "ne" + | "contains" + | "starts_with" + | "ends_with"; + value: + | string + | number + | boolean + | Array + | Array + | null; + }>; + } + | { + model: "ratelimit"; + update: { count?: number; key?: string; lastRequest?: number }; + where?: Array<{ + connector?: "AND" | "OR"; + field: "key" | "count" | "lastRequest" | "_id"; + operator?: + | "lt" + | "lte" + | "gt" + | "gte" + | "eq" + | "in" + | "not_in" + | "ne" + | "contains" + | "starts_with" + | "ends_with"; + value: + | string + | number + | boolean + | Array + | Array + | null; + }>; + }; + onUpdateHandle?: string; + paginationOpts: { + cursor: string | null; + endCursor?: string | null; + id?: number; + maximumBytesRead?: number; + maximumRowsRead?: number; + numItems: number; + }; + }, + any, + Name + >; + updateOne: FunctionReference< + "mutation", + "internal", + { + input: + | { + model: "user"; + update: { + createdAt?: number; + displayUsername?: null | string; + email?: string; + emailVerified?: boolean; + image?: null | string; + isAnonymous?: null | boolean; + name?: string; + phoneNumber?: null | string; + phoneNumberVerified?: null | boolean; + twoFactorEnabled?: null | boolean; + updatedAt?: number; + userId?: null | string; + username?: null | string; + }; + where?: Array<{ + connector?: "AND" | "OR"; + field: + | "name" + | "email" + | "emailVerified" + | "image" + | "createdAt" + | "updatedAt" + | "twoFactorEnabled" + | "isAnonymous" + | "username" + | "displayUsername" + | "phoneNumber" + | "phoneNumberVerified" + | "userId" + | "_id"; + operator?: + | "lt" + | "lte" + | "gt" + | "gte" + | "eq" + | "in" + | "not_in" + | "ne" + | "contains" + | "starts_with" + | "ends_with"; + value: + | string + | number + | boolean + | Array + | Array + | null; + }>; + } + | { + model: "session"; + update: { + createdAt?: number; + expiresAt?: number; + ipAddress?: null | string; + token?: string; + updatedAt?: number; + userAgent?: null | string; + userId?: string; + }; + where?: Array<{ + connector?: "AND" | "OR"; + field: + | "expiresAt" + | "token" + | "createdAt" + | "updatedAt" + | "ipAddress" + | "userAgent" + | "userId" + | "_id"; + operator?: + | "lt" + | "lte" + | "gt" + | "gte" + | "eq" + | "in" + | "not_in" + | "ne" + | "contains" + | "starts_with" + | "ends_with"; + value: + | string + | number + | boolean + | Array + | Array + | null; + }>; + } + | { + model: "account"; + update: { + accessToken?: null | string; + accessTokenExpiresAt?: null | number; + accountId?: string; + createdAt?: number; + idToken?: null | string; + password?: null | string; + providerId?: string; + refreshToken?: null | string; + refreshTokenExpiresAt?: null | number; + scope?: null | string; + updatedAt?: number; + userId?: string; + }; + where?: Array<{ + connector?: "AND" | "OR"; + field: + | "accountId" + | "providerId" + | "userId" + | "accessToken" + | "refreshToken" + | "idToken" + | "accessTokenExpiresAt" + | "refreshTokenExpiresAt" + | "scope" + | "password" + | "createdAt" + | "updatedAt" + | "_id"; + operator?: + | "lt" + | "lte" + | "gt" + | "gte" + | "eq" + | "in" + | "not_in" + | "ne" + | "contains" + | "starts_with" + | "ends_with"; + value: + | string + | number + | boolean + | Array + | Array + | null; + }>; + } + | { + model: "verification"; + update: { + createdAt?: number; + expiresAt?: number; + identifier?: string; + updatedAt?: number; + value?: string; + }; + where?: Array<{ + connector?: "AND" | "OR"; + field: + | "identifier" + | "value" + | "expiresAt" + | "createdAt" + | "updatedAt" + | "_id"; + operator?: + | "lt" + | "lte" + | "gt" + | "gte" + | "eq" + | "in" + | "not_in" + | "ne" + | "contains" + | "starts_with" + | "ends_with"; + value: + | string + | number + | boolean + | Array + | Array + | null; + }>; + } + | { + model: "twoFactor"; + update: { + backupCodes?: string; + secret?: string; + userId?: string; + }; + where?: Array<{ + connector?: "AND" | "OR"; + field: "secret" | "backupCodes" | "userId" | "_id"; + operator?: + | "lt" + | "lte" + | "gt" + | "gte" + | "eq" + | "in" + | "not_in" + | "ne" + | "contains" + | "starts_with" + | "ends_with"; + value: + | string + | number + | boolean + | Array + | Array + | null; + }>; + } + | { + model: "passkey"; + update: { + aaguid?: null | string; + backedUp?: boolean; + counter?: number; + createdAt?: null | number; + credentialID?: string; + deviceType?: string; + name?: null | string; + publicKey?: string; + transports?: null | string; + userId?: string; + }; + where?: Array<{ + connector?: "AND" | "OR"; + field: + | "name" + | "publicKey" + | "userId" + | "credentialID" + | "counter" + | "deviceType" + | "backedUp" + | "transports" + | "createdAt" + | "aaguid" + | "_id"; + operator?: + | "lt" + | "lte" + | "gt" + | "gte" + | "eq" + | "in" + | "not_in" + | "ne" + | "contains" + | "starts_with" + | "ends_with"; + value: + | string + | number + | boolean + | Array + | Array + | null; + }>; + } + | { + model: "oauthApplication"; + update: { + clientId?: null | string; + clientSecret?: null | string; + createdAt?: null | number; + disabled?: null | boolean; + icon?: null | string; + metadata?: null | string; + name?: null | string; + redirectURLs?: null | string; + type?: null | string; + updatedAt?: null | number; + userId?: null | string; + }; + where?: Array<{ + connector?: "AND" | "OR"; + field: + | "name" + | "icon" + | "metadata" + | "clientId" + | "clientSecret" + | "redirectURLs" + | "type" + | "disabled" + | "userId" + | "createdAt" + | "updatedAt" + | "_id"; + operator?: + | "lt" + | "lte" + | "gt" + | "gte" + | "eq" + | "in" + | "not_in" + | "ne" + | "contains" + | "starts_with" + | "ends_with"; + value: + | string + | number + | boolean + | Array + | Array + | null; + }>; + } + | { + model: "oauthAccessToken"; + update: { + accessToken?: null | string; + accessTokenExpiresAt?: null | number; + clientId?: null | string; + createdAt?: null | number; + refreshToken?: null | string; + refreshTokenExpiresAt?: null | number; + scopes?: null | string; + updatedAt?: null | number; + userId?: null | string; + }; + where?: Array<{ + connector?: "AND" | "OR"; + field: + | "accessToken" + | "refreshToken" + | "accessTokenExpiresAt" + | "refreshTokenExpiresAt" + | "clientId" + | "userId" + | "scopes" + | "createdAt" + | "updatedAt" + | "_id"; + operator?: + | "lt" + | "lte" + | "gt" + | "gte" + | "eq" + | "in" + | "not_in" + | "ne" + | "contains" + | "starts_with" + | "ends_with"; + value: + | string + | number + | boolean + | Array + | Array + | null; + }>; + } + | { + model: "oauthConsent"; + update: { + clientId?: null | string; + consentGiven?: null | boolean; + createdAt?: null | number; + scopes?: null | string; + updatedAt?: null | number; + userId?: null | string; + }; + where?: Array<{ + connector?: "AND" | "OR"; + field: + | "clientId" + | "userId" + | "scopes" + | "createdAt" + | "updatedAt" + | "consentGiven" + | "_id"; + operator?: + | "lt" + | "lte" + | "gt" + | "gte" + | "eq" + | "in" + | "not_in" + | "ne" + | "contains" + | "starts_with" + | "ends_with"; + value: + | string + | number + | boolean + | Array + | Array + | null; + }>; + } + | { + model: "jwks"; + update: { + createdAt?: number; + privateKey?: string; + publicKey?: string; + }; + where?: Array<{ + connector?: "AND" | "OR"; + field: "publicKey" | "privateKey" | "createdAt" | "_id"; + operator?: + | "lt" + | "lte" + | "gt" + | "gte" + | "eq" + | "in" + | "not_in" + | "ne" + | "contains" + | "starts_with" + | "ends_with"; + value: + | string + | number + | boolean + | Array + | Array + | null; + }>; + } + | { + model: "rateLimit"; + update: { + count?: null | number; + key?: null | string; + lastRequest?: null | number; + }; + where?: Array<{ + connector?: "AND" | "OR"; + field: "key" | "count" | "lastRequest" | "_id"; + operator?: + | "lt" + | "lte" + | "gt" + | "gte" + | "eq" + | "in" + | "not_in" + | "ne" + | "contains" + | "starts_with" + | "ends_with"; + value: + | string + | number + | boolean + | Array + | Array + | null; + }>; + } + | { + model: "ratelimit"; + update: { count?: number; key?: string; lastRequest?: number }; + where?: Array<{ + connector?: "AND" | "OR"; + field: "key" | "count" | "lastRequest" | "_id"; + operator?: + | "lt" + | "lte" + | "gt" + | "gte" + | "eq" + | "in" + | "not_in" + | "ne" + | "contains" + | "starts_with" + | "ends_with"; + value: + | string + | number + | boolean + | Array + | Array + | null; + }>; + }; + onUpdateHandle?: string; + }, + any, + Name + >; + }; + adapterTest: { + count: FunctionReference<"query", "internal", any, any, Name>; + create: FunctionReference<"mutation", "internal", any, any, Name>; + delete: FunctionReference<"mutation", "internal", any, any, Name>; + deleteMany: FunctionReference<"mutation", "internal", any, any, Name>; + findMany: FunctionReference<"query", "internal", any, any, Name>; + findOne: FunctionReference<"query", "internal", any, any, Name>; + update: FunctionReference<"mutation", "internal", any, any, Name>; + updateMany: FunctionReference<"mutation", "internal", any, any, Name>; + }; + }; diff --git a/src/component/_generated/dataModel.d.ts b/src/component/_generated/dataModel.ts similarity index 100% rename from src/component/_generated/dataModel.d.ts rename to src/component/_generated/dataModel.ts diff --git a/src/component/_generated/server.js b/src/component/_generated/server.js deleted file mode 100644 index 4a21df4..0000000 --- a/src/component/_generated/server.js +++ /dev/null @@ -1,90 +0,0 @@ -/* eslint-disable */ -/** - * Generated utilities for implementing server-side Convex query and mutation functions. - * - * THIS CODE IS AUTOMATICALLY GENERATED. - * - * To regenerate, run `npx convex dev`. - * @module - */ - -import { - actionGeneric, - httpActionGeneric, - queryGeneric, - mutationGeneric, - internalActionGeneric, - internalMutationGeneric, - internalQueryGeneric, - componentsGeneric, -} from "convex/server"; - -/** - * Define a query in this Convex app's public API. - * - * This function will be allowed to read your Convex database and will be accessible from the client. - * - * @param func - The query function. It receives a {@link QueryCtx} as its first argument. - * @returns The wrapped query. Include this as an `export` to name it and make it accessible. - */ -export const query = queryGeneric; - -/** - * Define a query that is only accessible from other Convex functions (but not from the client). - * - * This function will be allowed to read from your Convex database. It will not be accessible from the client. - * - * @param func - The query function. It receives a {@link QueryCtx} as its first argument. - * @returns The wrapped query. Include this as an `export` to name it and make it accessible. - */ -export const internalQuery = internalQueryGeneric; - -/** - * Define a mutation in this Convex app's public API. - * - * This function will be allowed to modify your Convex database and will be accessible from the client. - * - * @param func - The mutation function. It receives a {@link MutationCtx} as its first argument. - * @returns The wrapped mutation. Include this as an `export` to name it and make it accessible. - */ -export const mutation = mutationGeneric; - -/** - * Define a mutation that is only accessible from other Convex functions (but not from the client). - * - * This function will be allowed to modify your Convex database. It will not be accessible from the client. - * - * @param func - The mutation function. It receives a {@link MutationCtx} as its first argument. - * @returns The wrapped mutation. Include this as an `export` to name it and make it accessible. - */ -export const internalMutation = internalMutationGeneric; - -/** - * Define an action in this Convex app's public API. - * - * An action is a function which can execute any JavaScript code, including non-deterministic - * code and code with side-effects, like calling third-party services. - * They can be run in Convex's JavaScript environment or in Node.js using the "use node" directive. - * They can interact with the database indirectly by calling queries and mutations using the {@link ActionCtx}. - * - * @param func - The action. It receives an {@link ActionCtx} as its first argument. - * @returns The wrapped action. Include this as an `export` to name it and make it accessible. - */ -export const action = actionGeneric; - -/** - * Define an action that is only accessible from other Convex functions (but not from the client). - * - * @param func - The function. It receives an {@link ActionCtx} as its first argument. - * @returns The wrapped function. Include this as an `export` to name it and make it accessible. - */ -export const internalAction = internalActionGeneric; - -/** - * Define a Convex HTTP action. - * - * @param func - The function. It receives an {@link ActionCtx} as its first argument, and a `Request` object - * as its second. - * @returns The wrapped endpoint function. Route a URL path to this function in `convex/http.js`. - */ -export const httpAction = httpActionGeneric; diff --git a/src/component/_generated/server.d.ts b/src/component/_generated/server.ts similarity index 79% rename from src/component/_generated/server.d.ts rename to src/component/_generated/server.ts index b5c6828..24994e4 100644 --- a/src/component/_generated/server.d.ts +++ b/src/component/_generated/server.ts @@ -8,9 +8,8 @@ * @module */ -import { +import type { ActionBuilder, - AnyComponents, HttpActionBuilder, MutationBuilder, QueryBuilder, @@ -19,15 +18,18 @@ import { GenericQueryCtx, GenericDatabaseReader, GenericDatabaseWriter, - FunctionReference, +} from "convex/server"; +import { + actionGeneric, + httpActionGeneric, + queryGeneric, + mutationGeneric, + internalActionGeneric, + internalMutationGeneric, + internalQueryGeneric, } from "convex/server"; import type { DataModel } from "./dataModel.js"; -type GenericCtx = - | GenericActionCtx - | GenericMutationCtx - | GenericQueryCtx; - /** * Define a query in this Convex app's public API. * @@ -36,7 +38,7 @@ type GenericCtx = * @param func - The query function. It receives a {@link QueryCtx} as its first argument. * @returns The wrapped query. Include this as an `export` to name it and make it accessible. */ -export declare const query: QueryBuilder; +export const query: QueryBuilder = queryGeneric; /** * Define a query that is only accessible from other Convex functions (but not from the client). @@ -46,7 +48,8 @@ export declare const query: QueryBuilder; * @param func - The query function. It receives a {@link QueryCtx} as its first argument. * @returns The wrapped query. Include this as an `export` to name it and make it accessible. */ -export declare const internalQuery: QueryBuilder; +export const internalQuery: QueryBuilder = + internalQueryGeneric; /** * Define a mutation in this Convex app's public API. @@ -56,7 +59,7 @@ export declare const internalQuery: QueryBuilder; * @param func - The mutation function. It receives a {@link MutationCtx} as its first argument. * @returns The wrapped mutation. Include this as an `export` to name it and make it accessible. */ -export declare const mutation: MutationBuilder; +export const mutation: MutationBuilder = mutationGeneric; /** * Define a mutation that is only accessible from other Convex functions (but not from the client). @@ -66,7 +69,8 @@ export declare const mutation: MutationBuilder; * @param func - The mutation function. It receives a {@link MutationCtx} as its first argument. * @returns The wrapped mutation. Include this as an `export` to name it and make it accessible. */ -export declare const internalMutation: MutationBuilder; +export const internalMutation: MutationBuilder = + internalMutationGeneric; /** * Define an action in this Convex app's public API. @@ -79,7 +83,7 @@ export declare const internalMutation: MutationBuilder; * @param func - The action. It receives an {@link ActionCtx} as its first argument. * @returns The wrapped action. Include this as an `export` to name it and make it accessible. */ -export declare const action: ActionBuilder; +export const action: ActionBuilder = actionGeneric; /** * Define an action that is only accessible from other Convex functions (but not from the client). @@ -87,19 +91,26 @@ export declare const action: ActionBuilder; * @param func - The function. It receives an {@link ActionCtx} as its first argument. * @returns The wrapped function. Include this as an `export` to name it and make it accessible. */ -export declare const internalAction: ActionBuilder; +export const internalAction: ActionBuilder = + internalActionGeneric; /** * Define an HTTP action. * - * This function will be used to respond to HTTP requests received by a Convex - * deployment if the requests matches the path and method where this action - * is routed. Be sure to route your action in `convex/http.js`. + * The wrapped function will be used to respond to HTTP requests received + * by a Convex deployment if the requests matches the path and method where + * this action is routed. Be sure to route your httpAction in `convex/http.js`. * - * @param func - The function. It receives an {@link ActionCtx} as its first argument. + * @param func - The function. It receives an {@link ActionCtx} as its first argument + * and a Fetch API `Request` object as its second. * @returns The wrapped function. Import this function from `convex/http.js` and route it to hook it up. */ -export declare const httpAction: HttpActionBuilder; +export const httpAction: HttpActionBuilder = httpActionGeneric; + +type GenericCtx = + | GenericActionCtx + | GenericMutationCtx + | GenericQueryCtx; /** * A set of services for use within Convex query functions. @@ -107,8 +118,7 @@ export declare const httpAction: HttpActionBuilder; * The query context is passed as the first argument to any Convex query * function run on the server. * - * This differs from the {@link MutationCtx} because all of the services are - * read-only. + * If you're using code generation, use the `QueryCtx` type in `convex/_generated/server.d.ts` instead. */ export type QueryCtx = GenericQueryCtx; @@ -117,6 +127,8 @@ export type QueryCtx = GenericQueryCtx; * * The mutation context is passed as the first argument to any Convex mutation * function run on the server. + * + * If you're using code generation, use the `MutationCtx` type in `convex/_generated/server.d.ts` instead. */ export type MutationCtx = GenericMutationCtx; From 87c4e575d3a038762a8ca4d54f3f0de08642bf4c Mon Sep 17 00:00:00 2001 From: Ian Macartney Date: Tue, 11 Nov 2025 11:21:12 -0800 Subject: [PATCH 03/23] cursor-rules --- .cursor/rules/convex_rules.mdc | 374 +++++++++++++++++---------------- 1 file changed, 195 insertions(+), 179 deletions(-) diff --git a/.cursor/rules/convex_rules.mdc b/.cursor/rules/convex_rules.mdc index a598d39..1d98480 100644 --- a/.cursor/rules/convex_rules.mdc +++ b/.cursor/rules/convex_rules.mdc @@ -1,90 +1,103 @@ --- description: Guidelines and best practices for building Convex projects, including database schema design, queries, mutations, and real-world examples -globs: **/*.{ts,tsx,js,jsx} +globs: **/*.ts,**/*.tsx,**/*.js,**/*.jsx --- # Convex guidelines ## Function guidelines ### New function syntax - ALWAYS use the new function syntax for Convex functions. For example: - ```typescript - import { query } from "./_generated/server"; - import { v } from "convex/values"; - export const f = query({ - args: {}, - returns: v.null(), - handler: async (ctx, args) => { - // Function body - }, - }); - ``` +```typescript +import { query } from "./_generated/server"; +import { v } from "convex/values"; +export const f = query({ + args: {}, + returns: v.null(), + handler: async (ctx, args) => { + // Function body + }, +}); +``` ### Http endpoint syntax - HTTP endpoints are defined in `convex/http.ts` and require an `httpAction` decorator. For example: - ```typescript - import { httpRouter } from "convex/server"; - import { httpAction } from "./_generated/server"; - const http = httpRouter(); - http.route({ - path: "/echo", - method: "POST", - handler: httpAction(async (ctx, req) => { - const body = await req.bytes(); - return new Response(body, { status: 200 }); - }), - }); - ``` +```typescript +import { httpRouter } from "convex/server"; +import { httpAction } from "./_generated/server"; +const http = httpRouter(); +http.route({ + path: "/echo", + method: "POST", + handler: httpAction(async (ctx, req) => { + const body = await req.bytes(); + return new Response(body, { status: 200 }); + }), +}); +``` - HTTP endpoints are always registered at the exact path you specify in the `path` field. For example, if you specify `/api/someRoute`, the endpoint will be registered at `/api/someRoute`. ### Validators - Below is an example of an array validator: - ```typescript - import { mutation } from "./_generated/server"; - import { v } from "convex/values"; - - export default mutation({ - args: { - simpleArray: v.array(v.union(v.string(), v.number())), - }, - handler: async (ctx, args) => { - //... - }, - }); - ``` +```typescript +import { mutation } from "./_generated/server"; +import { v } from "convex/values"; + +export default mutation({ +args: { + simpleArray: v.array(v.union(v.string(), v.number())), +}, +handler: async (ctx, args) => { + //... +}, +}); +``` - Below is an example of a schema with validators that codify a discriminated union type: - ```typescript - import { defineSchema, defineTable } from "convex/server"; - import { v } from "convex/values"; - - export default defineSchema({ - results: defineTable( - v.union( - v.object({ - kind: v.literal("error"), - errorMessage: v.string(), - }), - v.object({ - kind: v.literal("success"), - value: v.number(), - }), - ), - ) - }); - ``` +```typescript +import { defineSchema, defineTable } from "convex/server"; +import { v } from "convex/values"; + +export default defineSchema({ + results: defineTable( + v.union( + v.object({ + kind: v.literal("error"), + errorMessage: v.string(), + }), + v.object({ + kind: v.literal("success"), + value: v.number(), + }), + ), + ) +}); +``` - Always use the `v.null()` validator when returning a null value. Below is an example query that returns a null value: - ```typescript - import { query } from "./_generated/server"; - import { v } from "convex/values"; - - export const exampleQuery = query({ - args: {}, - returns: v.null(), - handler: async (ctx, args) => { - console.log("This query returns a null value"); - return null; - }, - }); - ``` +```typescript +import { query } from "./_generated/server"; +import { v } from "convex/values"; + +export const exampleQuery = query({ + args: {}, + returns: v.null(), + handler: async (ctx, args) => { + console.log("This query returns a null value"); + return null; + }, +}); +``` +- Here are the valid Convex types along with their respective validators: +Convex Type | TS/JS type | Example Usage | Validator for argument validation and schemas | Notes | +| ----------- | ------------| -----------------------| -----------------------------------------------| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------| +| Id | string | `doc._id` | `v.id(tableName)` | | +| Null | null | `null` | `v.null()` | JavaScript's `undefined` is not a valid Convex value. Functions the return `undefined` or do not return will return `null` when called from a client. Use `null` instead. | +| Int64 | bigint | `3n` | `v.int64()` | Int64s only support BigInts between -2^63 and 2^63-1. Convex supports `bigint`s in most modern browsers. | +| Float64 | number | `3.1` | `v.number()` | Convex supports all IEEE-754 double-precision floating point numbers (such as NaNs). Inf and NaN are JSON serialized as strings. | +| Boolean | boolean | `true` | `v.boolean()` | +| String | string | `"abc"` | `v.string()` | Strings are stored as UTF-8 and must be valid Unicode sequences. Strings must be smaller than the 1MB total size limit when encoded as UTF-8. | +| Bytes | ArrayBuffer | `new ArrayBuffer(8)` | `v.bytes()` | Convex supports first class bytestrings, passed in as `ArrayBuffer`s. Bytestrings must be smaller than the 1MB total size limit for Convex types. | +| Array | Array | `[1, 3.2, "abc"]` | `v.array(values)` | Arrays can have at most 8192 values. | +| Object | Object | `{a: "abc"}` | `v.object({property: value})` | Convex only supports "plain old JavaScript objects" (objects that do not have a custom prototype). Objects can have at most 1024 entries. Field names must be nonempty and not start with "$" or "_". | +| Record | Record | `{"a": "1", "b": "2"}` | `v.record(keys, values)` | Records are objects at runtime, but can have dynamic keys. Keys must be only ASCII characters, nonempty, and not start with "$" or "_". | ### Function registration - Use `internalQuery`, `internalMutation`, and `internalAction` to register internal functions. These functions are private and aren't part of an app's API. They can only be called by other Convex functions. These functions are always imported from `./_generated/server`. @@ -101,24 +114,24 @@ globs: **/*.{ts,tsx,js,jsx} - Try to use as few calls from actions to queries and mutations as possible. Queries and mutations are transactions, so splitting logic up into multiple calls introduces the risk of race conditions. - All of these calls take in a `FunctionReference`. Do NOT try to pass the callee function directly into one of these calls. - When using `ctx.runQuery`, `ctx.runMutation`, or `ctx.runAction` to call a function in the same file, specify a type annotation on the return value to work around TypeScript circularity limitations. For example, - ``` - export const f = query({ - args: { name: v.string() }, - returns: v.string(), - handler: async (ctx, args) => { - return "Hello " + args.name; - }, - }); - - export const g = query({ - args: {}, - returns: v.null(), - handler: async (ctx, args) => { - const result: string = await ctx.runQuery(api.example.f, { name: "Bob" }); - return null; - }, - }); - ``` +``` +export const f = query({ + args: { name: v.string() }, + returns: v.string(), + handler: async (ctx, args) => { + return "Hello " + args.name; + }, +}); + +export const g = query({ + args: {}, + returns: v.null(), + handler: async (ctx, args) => { + const result: string = await ctx.runQuery(api.example.f, { name: "Bob" }); + return null; + }, +}); +``` ### Function references - Function references are pointers to registered Convex functions. @@ -137,21 +150,24 @@ globs: **/*.{ts,tsx,js,jsx} - Paginated queries are queries that return a list of results in incremental pages. - You can define pagination using the following syntax: - ```ts - import { v } from "convex/values"; - import { query, mutation } from "./_generated/server"; - import { paginationOptsValidator } from "convex/server"; - export const listWithExtraArg = query({ - args: { paginationOpts: paginationOptsValidator, author: v.string() }, - handler: async (ctx, args) => { - return await ctx.db - .query("messages") - .filter((q) => q.eq(q.field("author"), args.author)) - .order("desc") - .paginate(args.paginationOpts); - }, - }); - ``` +```ts +import { v } from "convex/values"; +import { query, mutation } from "./_generated/server"; +import { paginationOptsValidator } from "convex/server"; +export const listWithExtraArg = query({ + args: { paginationOpts: paginationOptsValidator, author: v.string() }, + handler: async (ctx, args) => { + return await ctx.db + .query("messages") + .filter((q) => q.eq(q.field("author"), args.author)) + .order("desc") + .paginate(args.paginationOpts); + }, +}); +``` +Note: `paginationOpts` is an object with the following properties: +- `numItems`: the maximum number of documents to return (the validator is `v.number()`) +- `cursor`: the cursor to use to fetch the next page of documents (the validator is `v.union(v.string(), v.null())`) - A query that ends in `.paginate()` returns an object that has the following properties: - page (contains an array of documents that you fetches) - isDone (a boolean that represents whether or not this is the last page of documents) @@ -165,33 +181,33 @@ globs: **/*.{ts,tsx,js,jsx} ## Schema guidelines - Always define your schema in `convex/schema.ts`. - Always import the schema definition functions from `convex/server`: -- System fields are automatically added to all documents and are prefixed with an underscore. +- System fields are automatically added to all documents and are prefixed with an underscore. The two system fields that are automatically added to all documents are `_creationTime` which has the validator `v.number()` and `_id` which has the validator `v.id(tableName)`. - Always include all index fields in the index name. For example, if an index is defined as `["field1", "field2"]`, the index name should be "by_field1_and_field2". - Index fields must be queried in the same order they are defined. If you want to be able to query by "field1" then "field2" and by "field2" then "field1", you must create separate indexes. ## Typescript guidelines - You can use the helper typescript type `Id` imported from './_generated/dataModel' to get the type of the id for a given table. For example if there is a table called 'users' you can use `Id<'users'>` to get the type of the id for that table. - If you need to define a `Record` make sure that you correctly provide the type of the key and value in the type. For example a validator `v.record(v.id('users'), v.string())` would have the type `Record, string>`. Below is an example of using `Record` with an `Id` type in a query: - ```ts - import { query } from "./_generated/server"; - import { Doc, Id } from "./_generated/dataModel"; - - export const exampleQuery = query({ - args: { userIds: v.array(v.id("users")) }, - returns: v.record(v.id("users"), v.string()), - handler: async (ctx, args) => { - const idToUsername: Record, string> = {}; - for (const userId of args.userIds) { - const user = await ctx.db.get(userId); - if (user) { - users[user._id] = user.username; - } - } - - return idToUsername; - }, - }); - ``` +```ts +import { query } from "./_generated/server"; +import { Doc, Id } from "./_generated/dataModel"; + +export const exampleQuery = query({ + args: { userIds: v.array(v.id("users")) }, + returns: v.record(v.id("users"), v.string()), + handler: async (ctx, args) => { + const idToUsername: Record, string> = {}; + for (const userId of args.userIds) { + const user = await ctx.db.get(userId); + if (user) { + idToUsername[user._id] = user.username; + } + } + + return idToUsername; + }, +}); +``` - Be strict with types, particularly around id's of documents. For example, if a function takes in an id for a document in the 'users' table, take in `Id<'users'>` rather than `string`. - Always use `as const` for string literals in discriminated union types. - When using the `Array` type, make sure to always define your arrays as `const array: Array = [...];` @@ -227,46 +243,46 @@ const messages = await ctx.db - Always add `"use node";` to the top of files containing actions that use Node.js built-in modules. - Never use `ctx.db` inside of an action. Actions don't have access to the database. - Below is an example of the syntax for an action: - ```ts - import { action } from "./_generated/server"; - - export const exampleAction = action({ - args: {}, - returns: v.null(), - handler: async (ctx, args) => { - console.log("This action does not return anything"); - return null; - }, - }); - ``` +```ts +import { action } from "./_generated/server"; + +export const exampleAction = action({ + args: {}, + returns: v.null(), + handler: async (ctx, args) => { + console.log("This action does not return anything"); + return null; + }, +}); +``` ## Scheduling guidelines ### Cron guidelines - Only use the `crons.interval` or `crons.cron` methods to schedule cron jobs. Do NOT use the `crons.hourly`, `crons.daily`, or `crons.weekly` helpers. - Both cron methods take in a FunctionReference. Do NOT try to pass the function directly into one of these methods. - Define crons by declaring the top-level `crons` object, calling some methods on it, and then exporting it as default. For example, - ```ts - import { cronJobs } from "convex/server"; - import { internal } from "./_generated/api"; - import { internalAction } from "./_generated/server"; - - const empty = internalAction({ - args: {}, - returns: v.null(), - handler: async (ctx, args) => { - console.log("empty"); - }, - }); - - const crons = cronJobs(); - - // Run `internal.crons.empty` every two hours. - crons.interval("delete inactive users", { hours: 2 }, internal.crons.empty, {}); - - export default crons; - ``` +```ts +import { cronJobs } from "convex/server"; +import { internal } from "./_generated/api"; +import { internalAction } from "./_generated/server"; + +const empty = internalAction({ + args: {}, + returns: v.null(), + handler: async (ctx, args) => { + console.log("empty"); + }, +}); + +const crons = cronJobs(); + +// Run `internal.crons.empty` every two hours. +crons.interval("delete inactive users", { hours: 2 }, internal.crons.empty, {}); + +export default crons; +``` - You can register Convex functions within `crons.ts` just like any other file. -- If a cron calls an internal function, always import the `internal` object from '_generated/api`, even if the internal function is registered in the same file. +- If a cron calls an internal function, always import the `internal` object from '_generated/api', even if the internal function is registered in the same file. ## File storage guidelines @@ -275,28 +291,28 @@ const messages = await ctx.db - Do NOT use the deprecated `ctx.storage.getMetadata` call for loading a file's metadata. Instead, query the `_storage` system table. For example, you can use `ctx.db.system.get` to get an `Id<"_storage">`. - ``` - import { query } from "./_generated/server"; - import { Id } from "./_generated/dataModel"; - - type FileMetadata = { - _id: Id<"_storage">; - _creationTime: number; - contentType?: string; - sha256: string; - size: number; - } - - export const exampleQuery = query({ - args: { fileId: v.id("_storage") }, - returns: v.null(); - handler: async (ctx, args) => { - const metadata: FileMetadata | null = await ctx.db.system.get(args.fileId); - console.log(metadata); - return null; - }, - }); - ``` +``` +import { query } from "./_generated/server"; +import { Id } from "./_generated/dataModel"; + +type FileMetadata = { + _id: Id<"_storage">; + _creationTime: number; + contentType?: string; + sha256: string; + size: number; +} + +export const exampleQuery = query({ + args: { fileId: v.id("_storage") }, + returns: v.null(), + handler: async (ctx, args) => { + const metadata: FileMetadata | null = await ctx.db.system.get(args.fileId); + console.log(metadata); + return null; + }, +}); +``` - Convex storage stores items as `Blob` objects. You must convert all items to/from a `Blob` when using Convex storage. From 9dd2c976ab3e19b1ee005863b04864def51b6534 Mon Sep 17 00:00:00 2001 From: Ian Macartney Date: Tue, 11 Nov 2025 11:21:36 -0800 Subject: [PATCH 04/23] lint --- eslint.config.js | 15 +++---------- examples/next/convex/polyfills.ts | 4 ++-- examples/next/package-lock.json | 21 +++++++++++++++++-- examples/react/convex/polyfills.ts | 4 ++-- examples/react/src/SignIn.tsx | 6 +++--- .../src/components/DefaultCatchBoundary.tsx | 2 +- 6 files changed, 30 insertions(+), 22 deletions(-) diff --git a/eslint.config.js b/eslint.config.js index 3fc2f4e..762e64e 100644 --- a/eslint.config.js +++ b/eslint.config.js @@ -1,18 +1,11 @@ import globals from "globals"; import pluginJs from "@eslint/js"; import tseslint from "typescript-eslint"; -import { dirname } from "path"; -import { fileURLToPath } from "url"; export default [ - { files: ["src/**/*.{js,mjs,cjs,ts,tsx}"] }, + { files: ["src/**/*.{ts,tsx}"] }, { - ignores: [ - "dist/**", - "eslint.config.js", - "**/_generated/", - "node10stubs.mjs", - ], + ignores: ["dist/**", "**/_generated/", "**/*.{mjs,cjs,js}"], }, { languageOptions: { @@ -21,9 +14,7 @@ export default [ parserOptions: { project: true, - // __dirname is not defined, so do not attempt to use it - AI WHY ARE - // YOU STILL AUTOCOMPLETINT WITH __dirname STOP IT - tsconfigRootDir: dirname(fileURLToPath(import.meta.url)), + tsconfigRootDir: import.meta.dirname, }, }, }, diff --git a/examples/next/convex/polyfills.ts b/examples/next/convex/polyfills.ts index 5be025c..b15135f 100644 --- a/examples/next/convex/polyfills.ts +++ b/examples/next/convex/polyfills.ts @@ -5,12 +5,12 @@ if (typeof MessageChannel === "undefined") { onmessageerror: ((ev: MessageEvent) => void) | undefined; close() {} - // eslint-disable-next-line @typescript-eslint/no-unused-vars + postMessage(_message: unknown, _transfer: Transferable[] = []) {} start() {} addEventListener() {} removeEventListener() {} - // eslint-disable-next-line @typescript-eslint/no-unused-vars + dispatchEvent(_event: Event): boolean { return false; } diff --git a/examples/next/package-lock.json b/examples/next/package-lock.json index e5acf29..836da3f 100644 --- a/examples/next/package-lock.json +++ b/examples/next/package-lock.json @@ -47,11 +47,12 @@ }, "../..": { "name": "@convex-dev/better-auth", - "version": "0.9.6", + "version": "0.9.7", "license": "Apache-2.0", "dependencies": { "common-tags": "^1.8.2", "convex-helpers": "^0.1.95", + "jose": "^6.1.0", "remeda": "^2.32.0", "semver": "^7.7.3", "type-fest": "^4.39.1", @@ -69,10 +70,12 @@ "@types/semver": "^7.7.0", "chokidar-cli": "^3.0.0", "concurrently": "^9.2.0", + "convex": "1.29.0", "convex-test": "^0.0.33", "eslint": "^9.9.1", "globals": "^15.9.0", "next": "^15.1.8", + "npm-run-all2": "8.0.4", "prettier": "3.2.5", "tsc-alias": "^1.8.16", "typescript": "5.8.3", @@ -81,7 +84,7 @@ }, "peerDependencies": { "better-auth": "1.3.27", - "convex": "^1.28.0", + "convex": "^1.28.2", "react": "^18.3.1 || ^19.0.0", "react-dom": "^18.3.1 || ^19.0.0" } @@ -89,6 +92,7 @@ "../../node_modules/better-auth": { "version": "1.2.12", "license": "MIT", + "peer": true, "dependencies": { "@better-auth/utils": "0.2.5", "@better-fetch/fetch": "^1.1.18", @@ -205,6 +209,7 @@ "resolved": "https://registry.npmjs.org/@babel/core/-/core-7.28.0.tgz", "integrity": "sha512-UlLAnTPrFdNGoFtbSXwcGFQBtQZJCNjaN6hQNP3UPvuNXT1i82N26KL3dZeIpNalWywr9IuQuncaAfUaS1g6sQ==", "license": "MIT", + "peer": true, "dependencies": { "@ampproject/remapping": "^2.2.0", "@babel/code-frame": "^7.27.1", @@ -3121,6 +3126,7 @@ "integrity": "sha512-3MyiDfrfLeK06bi/g9DqJxP5pV74LNv4rFTyvGDmT3x2p1yp1lOd+qYZfiRPIOf/oON+WRZR5wxxuF85qOar+w==", "dev": true, "license": "MIT", + "peer": true, "dependencies": { "@typescript-eslint/scope-manager": "8.35.1", "@typescript-eslint/types": "8.35.1", @@ -3650,6 +3656,7 @@ "integrity": "sha512-NZyJarBfL7nWwIq+FDL6Zp/yHEhePMNnnJ0y3qfieCrmNvYct8uvtiV41UvlSe6apAfk0fY1FbWx+NwfmpvtTg==", "dev": true, "license": "MIT", + "peer": true, "bin": { "acorn": "bin/acorn" }, @@ -4102,6 +4109,7 @@ } ], "license": "MIT", + "peer": true, "dependencies": { "caniuse-lite": "^1.0.30001726", "electron-to-chromium": "^1.5.173", @@ -4477,6 +4485,7 @@ "resolved": "https://registry.npmjs.org/convex-helpers/-/convex-helpers-0.1.100.tgz", "integrity": "sha512-In5VPKKlQdnv9WHpIKLXnLEKyHxaJYI0BXWTDJ27Ao6XUfpeiGPDGhOdqZ8y0DqTcQlDgmtSTmmttUv1fPWbdg==", "license": "Apache-2.0", + "peer": true, "bin": { "convex-helpers": "bin.cjs" }, @@ -5148,6 +5157,7 @@ "integrity": "sha512-zmxXPNMOXmwm9E0yQLi5uqXHs7uq2UIiqEKo3Gq+3fwo1XrJ+hijAZImyF7hclW3E6oHz43Yk3RP8at6OTKflQ==", "dev": true, "license": "MIT", + "peer": true, "dependencies": { "@eslint-community/eslint-utils": "^4.2.0", "@eslint-community/regexpp": "^4.12.1", @@ -5322,6 +5332,7 @@ "integrity": "sha512-whOE1HFo/qJDyX4SnXzP4N6zOWn79WhnCUY/iDR0mPfQZO8wcYE4JClzI2oZrhBnnMUCBCHZhO6VQyoBU95mZA==", "dev": true, "license": "MIT", + "peer": true, "dependencies": { "@rtsao/scc": "^1.1.0", "array-includes": "^3.1.9", @@ -5645,6 +5656,7 @@ "resolved": "https://registry.npmjs.org/express/-/express-5.1.0.tgz", "integrity": "sha512-DT9ck5YIRU+8GYzzU5kT3eHGA5iL+1Zd0EutOmTE9Dtk+Tvuzd23VBU+ec7HPNSTxXYO55gPV/hq4pSBJDjFpA==", "license": "MIT", + "peer": true, "dependencies": { "accepts": "^2.0.0", "body-parser": "^2.2.0", @@ -8837,6 +8849,7 @@ "resolved": "https://registry.npmjs.org/react/-/react-19.1.0.tgz", "integrity": "sha512-FS+XFBNvn3GTAWq26joslQgWNoFu08F4kl0J4CgdNKADkdSGXQyTCnKteIAJy96Br6YbpEU1LSzV5dYtjMkMDg==", "license": "MIT", + "peer": true, "engines": { "node": ">=0.10.0" } @@ -8846,6 +8859,7 @@ "resolved": "https://registry.npmjs.org/react-dom/-/react-dom-19.1.0.tgz", "integrity": "sha512-Xs1hdnE+DyKgeHJeJznQmYMIBG3TKIHJJT95Q58nHLSrElKlGQqDTR2HQ9fx5CN/Gk6Vh/kupBTDLU11/nDk/g==", "license": "MIT", + "peer": true, "dependencies": { "scheduler": "^0.26.0" }, @@ -10244,6 +10258,7 @@ "integrity": "sha512-M7BAV6Rlcy5u+m6oPhAPFgJTzAioX/6B0DxyvDlo9l8+T3nLKbrczg2WLUyzd45L8RqfUMyGPzekbMvX2Ldkwg==", "dev": true, "license": "MIT", + "peer": true, "engines": { "node": ">=12" }, @@ -10489,6 +10504,7 @@ "integrity": "sha512-p1diW6TqL9L07nNxvRMM7hMMw4c5XOo/1ibL4aAIGmSAt9slTE1Xgw5KWuof2uTOvCg9BY7ZRi+GaF+7sfgPeQ==", "devOptional": true, "license": "Apache-2.0", + "peer": true, "bin": { "tsc": "bin/tsc", "tsserver": "bin/tsserver" @@ -10973,6 +10989,7 @@ "resolved": "https://registry.npmjs.org/zod/-/zod-3.25.71.tgz", "integrity": "sha512-BsBc/NPk7h8WsUWYWYL+BajcJPY8YhjelaWu2NMLuzgraKAz4Lb4/6K11g9jpuDetjMiqhZ6YaexFLOC0Ogi3Q==", "license": "MIT", + "peer": true, "funding": { "url": "https://github.com/sponsors/colinhacks" } diff --git a/examples/react/convex/polyfills.ts b/examples/react/convex/polyfills.ts index 5be025c..b15135f 100644 --- a/examples/react/convex/polyfills.ts +++ b/examples/react/convex/polyfills.ts @@ -5,12 +5,12 @@ if (typeof MessageChannel === "undefined") { onmessageerror: ((ev: MessageEvent) => void) | undefined; close() {} - // eslint-disable-next-line @typescript-eslint/no-unused-vars + postMessage(_message: unknown, _transfer: Transferable[] = []) {} start() {} addEventListener() {} removeEventListener() {} - // eslint-disable-next-line @typescript-eslint/no-unused-vars + dispatchEvent(_event: Event): boolean { return false; } diff --git a/examples/react/src/SignIn.tsx b/examples/react/src/SignIn.tsx index 35d8f53..fc72379 100644 --- a/examples/react/src/SignIn.tsx +++ b/examples/react/src/SignIn.tsx @@ -35,7 +35,7 @@ export default function SignIn() { onRequest: () => { setOtpLoading(true); }, - onSuccess: (ctx) => { + onSuccess: (_ctx) => { setOtpLoading(false); }, onError: (ctx) => { @@ -177,9 +177,9 @@ export default function SignIn() { onSubmit={(e) => { e.preventDefault(); if (signInMethod === "password") { - handleSignIn(); + void handleSignIn(); } else if (otpSent) { - handleOtpSignIn(); + void handleOtpSignIn(); } }} className="grid gap-4" diff --git a/examples/tanstack/src/components/DefaultCatchBoundary.tsx b/examples/tanstack/src/components/DefaultCatchBoundary.tsx index 15f3166..5332cf8 100644 --- a/examples/tanstack/src/components/DefaultCatchBoundary.tsx +++ b/examples/tanstack/src/components/DefaultCatchBoundary.tsx @@ -22,7 +22,7 @@ export function DefaultCatchBoundary({ error }: ErrorComponentProps) {