diff --git a/.vscode/launch.json b/.vscode/launch.json index df6fbc3c6..c0fcf73df 100644 --- a/.vscode/launch.json +++ b/.vscode/launch.json @@ -6,7 +6,7 @@ "configurations": [ { "name": "Debug CLI", - "program": "${workspaceFolder}/packages/cli/dist/index.js", + "program": "${workspaceFolder}/packages/cli/dist/index.mjs", "request": "launch", "skipFiles": ["/**"], "type": "node", diff --git a/.vscode/settings.json b/.vscode/settings.json index 6c4c331ee..535d2b8b4 100644 --- a/.vscode/settings.json +++ b/.vscode/settings.json @@ -1,3 +1,4 @@ { - "vitest.maximumConfigs": 20 + "vitest.maximumConfigs": 20, + "js/ts.tsdk.path": "node_modules/typescript/lib" } diff --git a/BREAKINGCHANGES.md b/BREAKINGCHANGES.md index f71db4ceb..96c3d629d 100644 --- a/BREAKINGCHANGES.md +++ b/BREAKINGCHANGES.md @@ -3,3 +3,4 @@ 1. non-optional to-one relation doesn't automatically filter parent read when evaluating access policies 1. `@omit` and `@password` attributes have been removed 1. SWR plugin is removed +1. `makeModelSchema()` no longer includes relation fields by default — use `include` or `select` options to opt in, mirroring ORM behaviour diff --git a/CLAUDE.md b/CLAUDE.md index 151cb5688..c033f44c9 100644 --- a/CLAUDE.md +++ b/CLAUDE.md @@ -79,6 +79,10 @@ This file provides guidance to Claude Code (claude.ai/code) when working with co - Always target the `dev` branch (not `main`) when creating PRs +## Git Workflow + +- Never commit or push changes unless explicitly asked to do so + ## Development Notes - Always run `zenstack generate` after modifying ZModel schemas diff --git a/README.md b/README.md index 871dc8a7a..b30a3f1cf 100644 --- a/README.md +++ b/README.md @@ -74,7 +74,7 @@ Alternatively, you can set it up manually: ```bash npm install -D @zenstackhq/cli -npm install @zenstackhq/orm +npm install @zenstackhq/schema @zenstackhq/orm ``` Then create a `zenstack` folder and a `schema.zmodel` file in it. diff --git a/package.json b/package.json index 68d3f32b9..4a242a447 100644 --- a/package.json +++ b/package.json @@ -2,7 +2,7 @@ "name": "zenstack-v3", "displayName": "ZenStack", "description": "ZenStack", - "version": "3.5.6", + "version": "3.6.0", "type": "module", "author": { "name": "ZenStack Team", @@ -14,7 +14,7 @@ "url": "https://github.com/zenstackhq/zenstack" }, "license": "MIT", - "packageManager": "pnpm@10.23.0", + "packageManager": "pnpm@10.33.0", "scripts": { "build": "turbo run build", "watch": "turbo run watch build", @@ -45,7 +45,7 @@ "npm-run-all": "^4.1.5", "prettier": "^3.5.3", "prisma": "catalog:", - "tsup": "^8.5.0", + "tsdown": "^0.21.8", "tsx": "^4.20.3", "turbo": "^2.5.4", "typescript": "catalog:", diff --git a/packages/auth-adapters/better-auth/package.json b/packages/auth-adapters/better-auth/package.json index 2eff6a514..8afb83455 100644 --- a/packages/auth-adapters/better-auth/package.json +++ b/packages/auth-adapters/better-auth/package.json @@ -2,7 +2,7 @@ "name": "@zenstackhq/better-auth", "displayName": "ZenStack Better Auth Adapter", "description": "ZenStack Better Auth Adapter. This adapter is modified from better-auth's Prisma adapter.", - "version": "3.5.6", + "version": "3.6.0", "type": "module", "author": { "name": "ZenStack Team", @@ -15,8 +15,8 @@ }, "license": "MIT", "scripts": { - "build": "tsc --noEmit && tsup-node", - "watch": "tsup-node --watch", + "build": "tsc --noEmit && tsdown", + "watch": "tsdown --watch", "lint": "eslint src --ext ts", "test": "vitest run", "pack": "pnpm pack" @@ -31,8 +31,8 @@ "exports": { ".": { "import": { - "types": "./dist/index.d.ts", - "default": "./dist/index.js" + "types": "./dist/index.d.mts", + "default": "./dist/index.mjs" }, "require": { "types": "./dist/index.d.cts", @@ -55,14 +55,16 @@ "better-auth": "^1.3.0" }, "devDependencies": { - "@better-auth/core": "1.4.19", - "better-auth": "1.4.19", "@better-auth/cli": "1.4.19", + "@better-auth/core": "1.4.19", "@types/tmp": "catalog:", "@zenstackhq/cli": "workspace:*", "@zenstackhq/eslint-config": "workspace:*", + "@zenstackhq/tsdown-config": "workspace:*", "@zenstackhq/typescript-config": "workspace:*", "@zenstackhq/vitest-config": "workspace:*", + "better-auth": "1.4.19", + "kysely": "catalog:", "tmp": "catalog:" }, "funding": "https://github.com/sponsors/zenstackhq" diff --git a/packages/auth-adapters/better-auth/test/cli-generate.test.ts b/packages/auth-adapters/better-auth/test/cli-generate.test.ts index 527710da9..0e41d7fe4 100644 --- a/packages/auth-adapters/better-auth/test/cli-generate.test.ts +++ b/packages/auth-adapters/better-auth/test/cli-generate.test.ts @@ -28,7 +28,7 @@ function generateSchema(configFile: string): string { * Helper function to verify schema with zenstack check */ function verifySchema(schemaPath: string) { - const cliPath = path.join(__dirname, '../../../cli/dist/index.js'); + const cliPath = path.join(__dirname, '../../../cli/dist/index.mjs'); const workDir = path.dirname(schemaPath); expect(fs.existsSync(schemaPath)).toBe(true); diff --git a/packages/auth-adapters/better-auth/tsdown.config.ts b/packages/auth-adapters/better-auth/tsdown.config.ts new file mode 100644 index 000000000..e0a6d5624 --- /dev/null +++ b/packages/auth-adapters/better-auth/tsdown.config.ts @@ -0,0 +1,3 @@ +import { createConfig } from '@zenstackhq/tsdown-config'; + +export default createConfig({ entry: { index: 'src/index.ts' } }); diff --git a/packages/auth-adapters/better-auth/tsup.config.ts b/packages/auth-adapters/better-auth/tsup.config.ts deleted file mode 100644 index 5a74a9dd1..000000000 --- a/packages/auth-adapters/better-auth/tsup.config.ts +++ /dev/null @@ -1,13 +0,0 @@ -import { defineConfig } from 'tsup'; - -export default defineConfig({ - entry: { - index: 'src/index.ts', - }, - outDir: 'dist', - splitting: false, - sourcemap: true, - clean: true, - dts: true, - format: ['cjs', 'esm'], -}); diff --git a/packages/cli/bin/cli b/packages/cli/bin/cli index 0277db328..7b43ae9d4 100755 --- a/packages/cli/bin/cli +++ b/packages/cli/bin/cli @@ -1,3 +1,3 @@ #!/usr/bin/env node -import '../dist/index.js'; +import '../dist/index.mjs'; diff --git a/packages/cli/package.json b/packages/cli/package.json index af9636e16..45f8c046f 100644 --- a/packages/cli/package.json +++ b/packages/cli/package.json @@ -2,7 +2,7 @@ "name": "@zenstackhq/cli", "displayName": "ZenStack CLI", "description": "FullStack database toolkit with built-in access control and automatic API generation.", - "version": "3.5.6", + "version": "3.6.0", "type": "module", "author": { "name": "ZenStack Team", @@ -30,8 +30,8 @@ "bin" ], "scripts": { - "build": "tsc --noEmit && tsup-node", - "watch": "tsup-node --watch", + "build": "tsc --noEmit && tsdown", + "watch": "tsdown --watch", "lint": "eslint src --ext ts", "test": "vitest run", "pack": "pnpm pack" @@ -73,6 +73,7 @@ "@types/tmp": "catalog:", "@zenstackhq/eslint-config": "workspace:*", "@zenstackhq/testtools": "workspace:*", + "@zenstackhq/tsdown-config": "workspace:*", "@zenstackhq/typescript-config": "workspace:*", "@zenstackhq/vitest-config": "workspace:*", "tmp": "catalog:" diff --git a/packages/cli/scripts/post-build.ts b/packages/cli/scripts/post-build.ts index 99d4e3fb8..bd74a7b3a 100644 --- a/packages/cli/scripts/post-build.ts +++ b/packages/cli/scripts/post-build.ts @@ -8,7 +8,7 @@ if (!token) { console.warn('TELEMETRY_TRACKING_TOKEN is not set.'); } -const filesToProcess = ['dist/index.js', 'dist/index.cjs']; +const filesToProcess = ['dist/index.mjs', 'dist/index.cjs']; const _dirname = path.dirname(fileURLToPath(import.meta.url)); for (const file of filesToProcess) { diff --git a/packages/cli/test/utils.ts b/packages/cli/test/utils.ts index 31a86dfb9..85d85559b 100644 --- a/packages/cli/test/utils.ts +++ b/packages/cli/test/utils.ts @@ -55,7 +55,10 @@ export function getTestDbUrl(provider: 'sqlite' | 'postgresql' | 'mysql', dbName } } -export function getDefaultPrelude(options?: { provider?: 'sqlite' | 'postgresql' | 'mysql', datasourceFields?: Record }) { +export function getDefaultPrelude(options?: { + provider?: 'sqlite' | 'postgresql' | 'mysql'; + datasourceFields?: Record; +}) { const provider = (options?.provider || getTestDbProvider()) ?? 'sqlite'; const dbName = getTestDbName(provider); let dbUrl: string; @@ -78,14 +81,16 @@ export function getDefaultPrelude(options?: { provider?: 'sqlite' | 'postgresql' ['provider', `'${provider}'`], ['url', `'${dbUrl}'`], ...Object.entries(options?.datasourceFields || {}).map(([k, v]) => { - const value = Array.isArray(v) ? `[${v.map(item => `'${item}'`).join(', ')}]` : `'${v}'`; + const value = Array.isArray(v) ? `[${v.map((item) => `'${item}'`).join(', ')}]` : `'${v}'`; return [k, value] as [string, string]; }), ]; - const formattedFields = fields.map(([name, value]) => { - return ` ${name} = ${value}`; - }).join('\n'); + const formattedFields = fields + .map(([name, value]) => { + return ` ${name} = ${value}`; + }) + .join('\n'); const ZMODEL_PRELUDE = `datasource db {\n${formattedFields}\n}`; return ZMODEL_PRELUDE; @@ -93,18 +98,24 @@ export function getDefaultPrelude(options?: { provider?: 'sqlite' | 'postgresql' export async function createProject( zmodel: string, - options?: { customPrelude?: boolean; provider?: 'sqlite' | 'postgresql' | 'mysql'; datasourceFields?: Record }, + options?: { + customPrelude?: boolean; + provider?: 'sqlite' | 'postgresql' | 'mysql'; + datasourceFields?: Record; + }, ) { const workDir = createTestProject(); fs.mkdirSync(path.join(workDir, 'zenstack'), { recursive: true }); const schemaPath = path.join(workDir, 'zenstack/schema.zmodel'); - const content = options?.customPrelude ? zmodel : `${getDefaultPrelude({ provider: options?.provider, datasourceFields: options?.datasourceFields })}\n\n${zmodel}`; + const content = options?.customPrelude + ? zmodel + : `${getDefaultPrelude({ provider: options?.provider, datasourceFields: options?.datasourceFields })}\n\n${zmodel}`; const schema = await formatDocument(content); fs.writeFileSync(schemaPath, schema); return { workDir, schema }; } export function runCli(command: string, cwd: string) { - const cli = path.join(__dirname, '../dist/index.js'); + const cli = path.join(__dirname, '../dist/index.mjs'); execSync(`node ${cli} ${command}`, { cwd }); } diff --git a/packages/cli/tsdown.config.ts b/packages/cli/tsdown.config.ts new file mode 100644 index 000000000..e0a6d5624 --- /dev/null +++ b/packages/cli/tsdown.config.ts @@ -0,0 +1,3 @@ +import { createConfig } from '@zenstackhq/tsdown-config'; + +export default createConfig({ entry: { index: 'src/index.ts' } }); diff --git a/packages/cli/tsup.config.ts b/packages/cli/tsup.config.ts deleted file mode 100644 index 4933cce22..000000000 --- a/packages/cli/tsup.config.ts +++ /dev/null @@ -1,18 +0,0 @@ -import { defineConfig } from 'tsup'; - -export default defineConfig({ - entry: { - index: 'src/index.ts', - }, - outDir: 'dist', - splitting: false, - sourcemap: true, - clean: true, - dts: true, - format: ['esm', 'cjs'], - esbuildOptions: (options) => { - options.logOverride = { - 'empty-import-meta': 'silent', - }; - }, -}); diff --git a/packages/clients/client-helpers/package.json b/packages/clients/client-helpers/package.json index f2abd1823..2b567225b 100644 --- a/packages/clients/client-helpers/package.json +++ b/packages/clients/client-helpers/package.json @@ -2,7 +2,7 @@ "name": "@zenstackhq/client-helpers", "displayName": "ZenStack Client Helpers", "description": "Helpers for implementing clients that consume ZenStack's CRUD service", - "version": "3.5.6", + "version": "3.6.0", "type": "module", "author": { "name": "ZenStack Team", @@ -15,8 +15,8 @@ }, "license": "MIT", "scripts": { - "build": "tsc --noEmit && tsup-node && pnpm test:typecheck", - "watch": "tsup-node --watch", + "build": "tsc --noEmit && tsdown && pnpm test:typecheck", + "watch": "tsdown --watch", "lint": "eslint src --ext ts", "test": "vitest run", "test:typecheck": "tsc --noEmit --project tsconfig.test.json", @@ -27,25 +27,25 @@ ], "exports": { ".": { - "types": "./dist/index.d.ts", - "default": "./dist/index.js" + "types": "./dist/index.d.mts", + "default": "./dist/index.mjs" }, "./fetch": { - "types": "./dist/fetch.d.ts", - "default": "./dist/fetch.js" + "types": "./dist/fetch.d.mts", + "default": "./dist/fetch.mjs" } }, "dependencies": { "@zenstackhq/common-helpers": "workspace:*", "@zenstackhq/schema": "workspace:*", + "@zenstackhq/orm": "workspace:*", "decimal.js": "catalog:", "superjson": "^2.2.3" }, "devDependencies": { + "@types/node": "catalog:", "@zenstackhq/eslint-config": "workspace:*", - "@zenstackhq/language": "workspace:*", - "@zenstackhq/orm": "workspace:*", - "@zenstackhq/sdk": "workspace:*", + "@zenstackhq/tsdown-config": "workspace:*", "@zenstackhq/typescript-config": "workspace:*", "@zenstackhq/vitest-config": "workspace:*" }, diff --git a/packages/clients/client-helpers/tsconfig.json b/packages/clients/client-helpers/tsconfig.json index 8ef64682a..a129f8b7f 100644 --- a/packages/clients/client-helpers/tsconfig.json +++ b/packages/clients/client-helpers/tsconfig.json @@ -1,4 +1,7 @@ { "extends": "@zenstackhq/typescript-config/base.json", + "compilerOptions": { + "lib": ["ESNext", "DOM"] + }, "include": ["src/**/*.ts"] } diff --git a/packages/clients/client-helpers/tsconfig.test.json b/packages/clients/client-helpers/tsconfig.test.json index 53cf6cf56..e88e9202a 100644 --- a/packages/clients/client-helpers/tsconfig.test.json +++ b/packages/clients/client-helpers/tsconfig.test.json @@ -2,6 +2,7 @@ "extends": "@zenstackhq/typescript-config/base.json", "include": ["src/**/*.ts", "test/**/*.ts"], "compilerOptions": { - "lib": ["ESNext"] + "lib": ["ESNext", "DOM"], + "types": ["node"] } } diff --git a/packages/clients/client-helpers/tsdown.config.ts b/packages/clients/client-helpers/tsdown.config.ts new file mode 100644 index 000000000..0cadaaeee --- /dev/null +++ b/packages/clients/client-helpers/tsdown.config.ts @@ -0,0 +1,9 @@ +import { createConfig } from '@zenstackhq/tsdown-config'; + +export default createConfig({ + entry: { + index: 'src/index.ts', + fetch: 'src/fetch.ts', + }, + format: ['esm'], +}); diff --git a/packages/clients/client-helpers/tsup.config.ts b/packages/clients/client-helpers/tsup.config.ts deleted file mode 100644 index 211b4d5bf..000000000 --- a/packages/clients/client-helpers/tsup.config.ts +++ /dev/null @@ -1,14 +0,0 @@ -import { defineConfig } from 'tsup'; - -export default defineConfig({ - entry: { - index: 'src/index.ts', - fetch: 'src/fetch.ts', - }, - outDir: 'dist', - splitting: false, - sourcemap: true, - clean: true, - dts: true, - format: ['esm'], -}); diff --git a/packages/clients/tanstack-query/package.json b/packages/clients/tanstack-query/package.json index e17777508..2e8260ac9 100644 --- a/packages/clients/tanstack-query/package.json +++ b/packages/clients/tanstack-query/package.json @@ -2,7 +2,7 @@ "name": "@zenstackhq/tanstack-query", "displayName": "ZenStack TanStack Query Integration", "description": "TanStack Query Client for consuming ZenStack v3's CRUD service", - "version": "3.5.6", + "version": "3.6.0", "type": "module", "author": { "name": "ZenStack Team", @@ -15,7 +15,7 @@ }, "license": "MIT", "scripts": { - "build": "pnpm build:general && pnpm build:svelte && pnpm test:generate && pnpm test:typecheck", + "build": "rimraf dist && pnpm build:general && pnpm build:svelte && pnpm test:generate && pnpm test:typecheck", "build:general": "tsc -p tsconfig.general.json", "build:svelte": "svelte-package -i src/svelte -o dist/svelte -t --tsconfig ./tsconfig.svelte.json", "watch:general": "tsc -p tsconfig.general.json -w", @@ -60,6 +60,7 @@ "decimal.js": "catalog:" }, "devDependencies": { + "@sveltejs/package": "^2.5.7", "@tanstack/query-core": "catalog:", "@tanstack/react-query": "catalog:", "@tanstack/svelte-query": "catalog:", @@ -77,9 +78,9 @@ "happy-dom": "^20.8.9", "nock": "^14.0.10", "react": "catalog:", + "rimraf": "^6.1.3", "svelte": "catalog:", - "vue": "catalog:", - "@sveltejs/package": "^2.5.7" + "vue": "catalog:" }, "peerDependencies": { "@tanstack/react-query": "^5.0.0", diff --git a/packages/clients/tanstack-query/tsconfig.general.json b/packages/clients/tanstack-query/tsconfig.general.json index ee76029c1..0eac1d9fa 100644 --- a/packages/clients/tanstack-query/tsconfig.general.json +++ b/packages/clients/tanstack-query/tsconfig.general.json @@ -3,7 +3,8 @@ "include": ["src/**/*.ts"], "exclude": ["src/svelte"], "compilerOptions": { - "lib": ["ESNext"], + "rootDir": "src", + "lib": ["ESNext", "DOM"], "outDir": "dist", "noEmit": false } diff --git a/packages/clients/tanstack-query/tsconfig.svelte.json b/packages/clients/tanstack-query/tsconfig.svelte.json index 7694ca962..c17a4ec12 100644 --- a/packages/clients/tanstack-query/tsconfig.svelte.json +++ b/packages/clients/tanstack-query/tsconfig.svelte.json @@ -2,7 +2,8 @@ "extends": "@zenstackhq/typescript-config/base.json", "include": ["src/svelte/**/*.ts"], "compilerOptions": { - "lib": ["ESNext"], + "rootDir": "src", + "lib": ["ESNext", "DOM"], "outDir": "dist", "noEmit": false } diff --git a/packages/clients/tanstack-query/tsconfig.test.json b/packages/clients/tanstack-query/tsconfig.test.json index 551979d5d..027f1fc59 100644 --- a/packages/clients/tanstack-query/tsconfig.test.json +++ b/packages/clients/tanstack-query/tsconfig.test.json @@ -2,7 +2,7 @@ "extends": "@zenstackhq/typescript-config/base.json", "include": ["src/**/*.ts", "test/**/*.ts", "test/**/*.tsx"], "compilerOptions": { - "lib": ["ESNext"], + "lib": ["ESNext", "DOM"], "jsx": "react" } } diff --git a/packages/common-helpers/package.json b/packages/common-helpers/package.json index 96089e43e..546d43610 100644 --- a/packages/common-helpers/package.json +++ b/packages/common-helpers/package.json @@ -2,7 +2,7 @@ "name": "@zenstackhq/common-helpers", "displayName": "ZenStack Common Helpers", "description": "ZenStack Common Helpers", - "version": "3.5.6", + "version": "3.6.0", "type": "module", "author": { "name": "ZenStack Team", @@ -15,8 +15,8 @@ }, "license": "MIT", "scripts": { - "build": "tsc --noEmit && tsup-node", - "watch": "tsup-node --watch", + "build": "tsc --noEmit && tsdown", + "watch": "tsdown --watch", "lint": "eslint src --ext ts", "test": "vitest run", "pack": "pnpm pack" @@ -28,8 +28,8 @@ "exports": { ".": { "import": { - "types": "./dist/index.d.ts", - "default": "./dist/index.js" + "types": "./dist/index.d.mts", + "default": "./dist/index.mjs" }, "require": { "types": "./dist/index.d.cts", @@ -38,8 +38,10 @@ } }, "devDependencies": { - "@zenstackhq/typescript-config": "workspace:*", + "@types/node": "catalog:", "@zenstackhq/eslint-config": "workspace:*", + "@zenstackhq/tsdown-config": "workspace:*", + "@zenstackhq/typescript-config": "workspace:*", "@zenstackhq/vitest-config": "workspace:*" }, "funding": "https://github.com/sponsors/zenstackhq" diff --git a/packages/common-helpers/tsconfig.json b/packages/common-helpers/tsconfig.json index 8ef64682a..e69d59520 100644 --- a/packages/common-helpers/tsconfig.json +++ b/packages/common-helpers/tsconfig.json @@ -1,4 +1,7 @@ { "extends": "@zenstackhq/typescript-config/base.json", + "compilerOptions": { + "types": ["node"] + }, "include": ["src/**/*.ts"] } diff --git a/packages/common-helpers/tsdown.config.ts b/packages/common-helpers/tsdown.config.ts new file mode 100644 index 000000000..e0a6d5624 --- /dev/null +++ b/packages/common-helpers/tsdown.config.ts @@ -0,0 +1,3 @@ +import { createConfig } from '@zenstackhq/tsdown-config'; + +export default createConfig({ entry: { index: 'src/index.ts' } }); diff --git a/packages/common-helpers/tsup.config.ts b/packages/common-helpers/tsup.config.ts deleted file mode 100644 index 5a74a9dd1..000000000 --- a/packages/common-helpers/tsup.config.ts +++ /dev/null @@ -1,13 +0,0 @@ -import { defineConfig } from 'tsup'; - -export default defineConfig({ - entry: { - index: 'src/index.ts', - }, - outDir: 'dist', - splitting: false, - sourcemap: true, - clean: true, - dts: true, - format: ['cjs', 'esm'], -}); diff --git a/packages/config/eslint-config/package.json b/packages/config/eslint-config/package.json index 7e04d806b..bd2a65596 100644 --- a/packages/config/eslint-config/package.json +++ b/packages/config/eslint-config/package.json @@ -1,6 +1,6 @@ { "name": "@zenstackhq/eslint-config", - "version": "3.5.6", + "version": "3.6.0", "type": "module", "private": true, "license": "MIT" diff --git a/packages/config/tsdown-config/package.json b/packages/config/tsdown-config/package.json new file mode 100644 index 000000000..07d66e436 --- /dev/null +++ b/packages/config/tsdown-config/package.json @@ -0,0 +1,19 @@ +{ + "name": "@zenstackhq/tsdown-config", + "version": "3.6.0", + "private": true, + "type": "module", + "license": "MIT", + "scripts": { + "build": "tsc" + }, + "devDependencies": { + "@zenstackhq/typescript-config": "workspace:*" + }, + "exports": { + ".": { + "types": "./dist/index.d.ts", + "default": "./dist/index.js" + } + } +} diff --git a/packages/config/tsdown-config/src/index.ts b/packages/config/tsdown-config/src/index.ts new file mode 100644 index 000000000..442b4f95c --- /dev/null +++ b/packages/config/tsdown-config/src/index.ts @@ -0,0 +1,17 @@ +import { defineConfig } from 'tsdown'; + +type Config = Parameters[0]; + +/** + * Creates a tsdown config with standard ZenStack package defaults: + * outDir: 'dist', sourcemap: true, format: ['cjs', 'esm'], dts: true + */ +export function createConfig(overrides: Config = {}): ReturnType { + return defineConfig({ + outDir: 'dist', + sourcemap: true, + format: ['cjs', 'esm'], + dts: true, + ...overrides, + }); +} diff --git a/packages/config/tsdown-config/tsconfig.json b/packages/config/tsdown-config/tsconfig.json new file mode 100644 index 000000000..cd4bddb1e --- /dev/null +++ b/packages/config/tsdown-config/tsconfig.json @@ -0,0 +1,9 @@ +{ + "extends": "@zenstackhq/typescript-config/base.json", + "compilerOptions": { + "outDir": "dist", + "rootDir": "src", + "noEmit": false + }, + "include": ["src/**/*"] +} diff --git a/packages/config/typescript-config/package.json b/packages/config/typescript-config/package.json index 3c63a0a57..25b955438 100644 --- a/packages/config/typescript-config/package.json +++ b/packages/config/typescript-config/package.json @@ -1,6 +1,6 @@ { "name": "@zenstackhq/typescript-config", - "version": "3.5.6", + "version": "3.6.0", "private": true, "license": "MIT" } diff --git a/packages/config/vitest-config/package.json b/packages/config/vitest-config/package.json index 31042b071..2f5275af1 100644 --- a/packages/config/vitest-config/package.json +++ b/packages/config/vitest-config/package.json @@ -1,7 +1,7 @@ { "name": "@zenstackhq/vitest-config", "type": "module", - "version": "3.5.6", + "version": "3.6.0", "private": true, "license": "MIT", "exports": { diff --git a/packages/create-zenstack/bin/cli b/packages/create-zenstack/bin/cli index 0277db328..7b43ae9d4 100755 --- a/packages/create-zenstack/bin/cli +++ b/packages/create-zenstack/bin/cli @@ -1,3 +1,3 @@ #!/usr/bin/env node -import '../dist/index.js'; +import '../dist/index.mjs'; diff --git a/packages/create-zenstack/package.json b/packages/create-zenstack/package.json index c91ddf496..cebc025cf 100644 --- a/packages/create-zenstack/package.json +++ b/packages/create-zenstack/package.json @@ -2,7 +2,7 @@ "name": "create-zenstack", "displayName": "Create ZenStack", "description": "Create a new ZenStack project", - "version": "3.5.6", + "version": "3.6.0", "type": "module", "author": { "name": "ZenStack Team", @@ -15,7 +15,7 @@ }, "license": "MIT", "scripts": { - "build": "tsc --noEmit && tsup-node", + "build": "tsc --noEmit && tsdown", "lint": "eslint src --ext ts", "pack": "pnpm pack" }, @@ -29,8 +29,8 @@ "exports": { ".": { "import": { - "types": "./dist/index.d.ts", - "default": "./dist/index.js" + "types": "./dist/index.d.mts", + "default": "./dist/index.mjs" }, "require": { "types": "./dist/index.d.cts", @@ -44,7 +44,9 @@ "ora": "^5.4.1" }, "devDependencies": { + "@types/node": "catalog:", "@zenstackhq/eslint-config": "workspace:*", + "@zenstackhq/tsdown-config": "workspace:*", "@zenstackhq/typescript-config": "workspace:*" }, "funding": "https://github.com/sponsors/zenstackhq" diff --git a/packages/create-zenstack/tsconfig.json b/packages/create-zenstack/tsconfig.json index 8ef64682a..e69d59520 100644 --- a/packages/create-zenstack/tsconfig.json +++ b/packages/create-zenstack/tsconfig.json @@ -1,4 +1,7 @@ { "extends": "@zenstackhq/typescript-config/base.json", + "compilerOptions": { + "types": ["node"] + }, "include": ["src/**/*.ts"] } diff --git a/packages/create-zenstack/tsdown.config.ts b/packages/create-zenstack/tsdown.config.ts new file mode 100644 index 000000000..e0a6d5624 --- /dev/null +++ b/packages/create-zenstack/tsdown.config.ts @@ -0,0 +1,3 @@ +import { createConfig } from '@zenstackhq/tsdown-config'; + +export default createConfig({ entry: { index: 'src/index.ts' } }); diff --git a/packages/create-zenstack/tsup.config.ts b/packages/create-zenstack/tsup.config.ts deleted file mode 100644 index 5a74a9dd1..000000000 --- a/packages/create-zenstack/tsup.config.ts +++ /dev/null @@ -1,13 +0,0 @@ -import { defineConfig } from 'tsup'; - -export default defineConfig({ - entry: { - index: 'src/index.ts', - }, - outDir: 'dist', - splitting: false, - sourcemap: true, - clean: true, - dts: true, - format: ['cjs', 'esm'], -}); diff --git a/packages/ide/vscode/package.json b/packages/ide/vscode/package.json index c40d900c4..39097e7e6 100644 --- a/packages/ide/vscode/package.json +++ b/packages/ide/vscode/package.json @@ -1,7 +1,7 @@ { "name": "zenstack-v3", "publisher": "zenstack", - "version": "3.5.6", + "version": "3.6.0", "displayName": "ZenStack V3 Language Tools", "description": "VSCode extension for ZenStack (v3) ZModel language", "private": true, @@ -10,8 +10,8 @@ "url": "https://github.com/zenstackhq/zenstack" }, "scripts": { - "build": "tsc --noEmit && tsup && tsx scripts/post-build.ts", - "watch": "tsup --watch", + "build": "tsc --noEmit && tsdown && tsx scripts/post-build.ts", + "watch": "tsdown --watch", "lint": "eslint src --ext ts", "vscode:publish": "pnpm build && vsce publish --no-dependencies --follow-symlinks", "vscode:package": "pnpm build && vsce package --no-dependencies --follow-symlinks" @@ -43,6 +43,7 @@ "devDependencies": { "@types/vscode": "^1.90.0", "@zenstackhq/eslint-config": "workspace:*", + "@zenstackhq/tsdown-config": "workspace:*", "@zenstackhq/typescript-config": "workspace:*", "dotenv": "^17.2.3" }, @@ -151,5 +152,5 @@ "activationEvents": [ "onLanguage:zmodel-v3" ], - "main": "./dist/extension.js" + "main": "./dist/extension.cjs" } diff --git a/packages/ide/vscode/scripts/post-build.ts b/packages/ide/vscode/scripts/post-build.ts index 24bfbe2ea..94c398428 100644 --- a/packages/ide/vscode/scripts/post-build.ts +++ b/packages/ide/vscode/scripts/post-build.ts @@ -9,8 +9,8 @@ if (!telemetryToken) { console.warn('Warning: VSCODE_TELEMETRY_TRACKING_TOKEN environment variable is not set, skipping token injection'); process.exit(0); } -const file = 'dist/extension.js'; +const file = 'dist/extension.cjs'; let content = fs.readFileSync(file, 'utf-8'); content = content.replace('', telemetryToken); fs.writeFileSync(file, content, 'utf-8'); -console.log('Telemetry token injected into dist/extension.js'); +console.log('Telemetry token injected into dist/extension.cjs'); diff --git a/packages/ide/vscode/tsdown.config.ts b/packages/ide/vscode/tsdown.config.ts new file mode 100644 index 000000000..0ff3d5daa --- /dev/null +++ b/packages/ide/vscode/tsdown.config.ts @@ -0,0 +1,14 @@ +import { createConfig } from '@zenstackhq/tsdown-config'; + +export default createConfig({ + entry: { + extension: 'src/extension/main.ts', + 'language-server': 'src/language-server/main.ts', + }, + sourcemap: false, + format: ['cjs'], + deps: { + neverBundle: ['vscode'], + alwaysBundle: [/^(?!vscode$)/], + }, +}); diff --git a/packages/ide/vscode/tsup.config.ts b/packages/ide/vscode/tsup.config.ts deleted file mode 100644 index 78380d7ec..000000000 --- a/packages/ide/vscode/tsup.config.ts +++ /dev/null @@ -1,14 +0,0 @@ -import { defineConfig } from 'tsup'; - -export default defineConfig({ - entry: { - extension: 'src/extension/main.ts', - 'language-server': 'src/language-server/main.ts', - }, - outDir: 'dist', - splitting: false, - clean: true, - format: ['cjs'], - noExternal: [/^(?!vscode$)/], - external: ['vscode'], -}); diff --git a/packages/language/package.json b/packages/language/package.json index c8617699b..da8588ece 100644 --- a/packages/language/package.json +++ b/packages/language/package.json @@ -2,7 +2,7 @@ "name": "@zenstackhq/language", "displayName": "ZenStack Language Tooling", "description": "ZenStack ZModel language specification", - "version": "3.5.6", + "version": "3.6.0", "type": "module", "author": { "name": "ZenStack Team", @@ -19,8 +19,8 @@ "res" ], "scripts": { - "build": "pnpm langium:generate && tsc --noEmit && tsup-node", - "watch": "tsup-node --watch", + "build": "pnpm langium:generate && tsx scripts/patch-generated-ast.ts && tsc --noEmit && tsdown", + "watch": "tsdown --watch", "lint": "eslint src --ext ts", "test": "vitest run", "langium:generate": "langium generate", @@ -30,8 +30,8 @@ "exports": { ".": { "import": { - "types": "./dist/index.d.ts", - "default": "./dist/index.js" + "types": "./dist/index.d.mts", + "default": "./dist/index.mjs" }, "require": { "types": "./dist/index.d.cts", @@ -40,8 +40,8 @@ }, "./ast": { "import": { - "types": "./dist/ast.d.ts", - "default": "./dist/ast.js" + "types": "./dist/ast.d.mts", + "default": "./dist/ast.mjs" }, "require": { "types": "./dist/ast.d.cts", @@ -50,8 +50,8 @@ }, "./utils": { "import": { - "types": "./dist/utils.d.ts", - "default": "./dist/utils.js" + "types": "./dist/utils.d.mts", + "default": "./dist/utils.mjs" }, "require": { "types": "./dist/utils.d.cts", @@ -60,8 +60,8 @@ }, "./factory": { "import": { - "types": "./dist/factory.d.ts", - "default": "./dist/factory.js" + "types": "./dist/factory.d.mts", + "default": "./dist/factory.mjs" }, "require": { "types": "./dist/factory.d.cts", @@ -84,6 +84,7 @@ "@types/pluralize": "^0.0.33", "@types/tmp": "catalog:", "@zenstackhq/eslint-config": "workspace:*", + "@zenstackhq/tsdown-config": "workspace:*", "@zenstackhq/typescript-config": "workspace:*", "@zenstackhq/vitest-config": "workspace:*", "glob": "^11.1.0", diff --git a/packages/language/scripts/patch-generated-ast.ts b/packages/language/scripts/patch-generated-ast.ts new file mode 100644 index 000000000..5f2e824ad --- /dev/null +++ b/packages/language/scripts/patch-generated-ast.ts @@ -0,0 +1,30 @@ +/** + * Post-processes src/generated/ast.ts after `langium generate` to inject runtime-only fields + * that cannot be expressed via `declare module` augmentation due to tsdown's module path rewriting. + */ + +import { readFileSync, writeFileSync } from 'fs'; +import { join } from 'path'; + +const astPath = join(import.meta.dirname, '../src/generated/ast.ts'); + +let content = readFileSync(astPath, 'utf8'); + +// Inject $resolvedParam into AttributeArg +if (!content.includes('$resolvedParam')) { + content = content.replace( + ' name?: RegularID;\n value: Expression;\n}\n\nexport const AttributeArg', + ' name?: RegularID;\n value: Expression;\n /** Resolved attribute param declaration */\n $resolvedParam?: AttributeParam;\n}\n\nexport const AttributeArg', + ); +} + +// Inject $allFields into DataModel +if (!content.includes('$allFields')) { + content = content.replace( + ' name: RegularID;\n}\n\nexport const DataModel', + ' name: RegularID;\n /** All fields including those marked with `@ignore` */\n $allFields?: DataField[];\n}\n\nexport const DataModel', + ); +} + +writeFileSync(astPath, content, 'utf8'); +console.log('Patched src/generated/ast.ts'); diff --git a/packages/language/src/ast.ts b/packages/language/src/ast.ts index 71d31d4d9..539eb089c 100644 --- a/packages/language/src/ast.ts +++ b/packages/language/src/ast.ts @@ -1,5 +1,5 @@ import type { AstNode } from 'langium'; -import { AbstractDeclaration, BinaryExpr, DataField, DataModel, type ExpressionType } from './generated/ast'; +import { AbstractDeclaration, BinaryExpr, DataModel, type ExpressionType } from './generated/ast'; export type { AstNode, Reference } from 'langium'; export * from './generated/ast'; @@ -37,27 +37,6 @@ export const BinaryExprOperatorPriority: Record '!': 5, }; -declare module './ast' { - interface AttributeArg { - /** - * Resolved attribute param declaration - */ - // @ts-ignore - $resolvedParam?: AttributeParam; - } - - export interface DataModel { - /** - * All fields including those marked with `@ignore` - */ - $allFields?: DataField[]; - } -} - -export interface InheritableNode extends AstNode { - $inheritedFrom?: DataModel; -} - export interface InheritableNode extends AstNode { $inheritedFrom?: DataModel; } diff --git a/packages/language/src/generated/ast.ts b/packages/language/src/generated/ast.ts index 527868d41..97431eccf 100644 --- a/packages/language/src/generated/ast.ts +++ b/packages/language/src/generated/ast.ts @@ -216,6 +216,8 @@ export interface AttributeArg extends langium.AstNode { readonly $type: 'AttributeArg'; name?: RegularID; value: Expression; + /** Resolved attribute param declaration */ + $resolvedParam?: AttributeParam; } export const AttributeArg = 'AttributeArg'; @@ -399,6 +401,8 @@ export interface DataModel extends langium.AstNode { isView: boolean; mixins: Array>; name: RegularID; + /** All fields including those marked with `@ignore` */ + $allFields?: DataField[]; } export const DataModel = 'DataModel'; diff --git a/packages/language/src/utils.ts b/packages/language/src/utils.ts index bdd8baa6a..c73522afc 100644 --- a/packages/language/src/utils.ts +++ b/packages/language/src/utils.ts @@ -128,14 +128,23 @@ export function mapBuiltinTypeToExpressionType(type: BuiltinType | ExpressionTyp } } +/** + * Determines if the given expression is an invocation of `auth` or a member access on the result of an `auth` invocation (e.g. `auth().role`). + */ export function isAuthOrAuthMemberAccess(expr: Expression): boolean { return isAuthInvocation(expr) || (isMemberAccessExpr(expr) && isAuthOrAuthMemberAccess(expr.operand)); } +/** + * Determines if the given expression is a reference to an enum field. + */ export function isEnumFieldReference(node: AstNode): node is ReferenceExpr { return isReferenceExpr(node) && isEnumField(node.target.ref); } +/** + * Determines if the given expression is a reference to a data field. + */ export function isDataFieldReference(node: AstNode): node is ReferenceExpr { return isReferenceExpr(node) && isDataField(node.target.ref); } @@ -154,10 +163,16 @@ export function isComputedField(field: DataField) { return hasAttribute(field, '@computed'); } +/** + * Determines if the given data model is a delegate model (i.e. marked with `@@delegate` attribute). + */ export function isDelegateModel(node: AstNode) { return isDataModel(node) && hasAttribute(node, '@@delegate'); } +/** + * Resolves the given reference and returns the target AST node. Throws an error if the reference is not resolved. + */ export function resolved(ref: Reference): T { if (!ref.ref) { throw new Error(`Reference not resolved: ${ref.$refText}`); @@ -165,6 +180,9 @@ export function resolved(ref: Reference): T { return ref.ref; } +/** + * Gets all base models and mixins of a data model or type def, recursively. + */ export function getRecursiveBases( decl: DataModel | TypeDef, includeDelegate = true, @@ -276,6 +294,9 @@ export function getUniqueFields(model: DataModel) { }); } +/** + * Finds the first ancestor of the given AST node that satisfies the given predicate function. Returns `undefined` if no such ancestor is found. + */ export function findUpAst(node: AstNode, predicate: (node: AstNode) => boolean): AstNode | undefined { let curr: AstNode | undefined = node; while (curr) { @@ -287,6 +308,9 @@ export function findUpAst(node: AstNode, predicate: (node: AstNode) => boolean): return undefined; } +/** + * Tries to get the literal value from the given expression. Returns `undefined` if the expression is not a literal or if the literal value cannot be determined. + */ export function getLiteral( expr: Expression | ConfigExpr | undefined, ): T | undefined { @@ -303,6 +327,9 @@ export function getLiteral( } } +/** + * Tries to get an object literal from the given expression. Returns `undefined` if the expression is not an object literal or if any of the field values cannot be determined. + */ export function getObjectLiteral(expr: Expression | ConfigExpr | undefined): T | undefined { if (!expr || !isObjectExpr(expr)) { return undefined; @@ -340,6 +367,9 @@ function getArray(expr: Expression | ConfigExpr | undefined) { return isArrayExpr(expr) || isConfigArrayExpr(expr) ? expr.items : undefined; } +/** + * Gets the value of the argument with the given name from the given attribute. Returns `undefined` if no such argument is found or if the argument value cannot be determined. + */ export function getAttributeArg( attr: DataModelAttribute | DataFieldAttribute | InternalAttribute, name: string, @@ -347,6 +377,9 @@ export function getAttributeArg( return attr.args.find((arg) => arg.$resolvedParam?.name === name)?.value; } +/** + * Gets the literal value of the argument with the given name from the given attribute. Returns `undefined` if no such argument is found or if the argument value cannot be determined or is not a literal. + */ export function getAttributeArgLiteral( attr: DataModelAttribute | DataFieldAttribute | InternalAttribute, name: string, @@ -359,6 +392,10 @@ export function getAttributeArgLiteral( return undefined; } +/** + * Gets the allowed expression contexts for the given function declaration by looking for `@@expressionContext` attribute. + * Returns an empty array if no such attribute is found or if the attribute value cannot be determined. + */ export function getFunctionExpressionContext(funcDecl: FunctionDecl) { const funcAllowedContext: ExpressionContext[] = []; const funcAttr = funcDecl.attributes.find((attr) => attr.decl.$refText === '@@@expressionContext'); @@ -375,6 +412,9 @@ export function getFunctionExpressionContext(funcDecl: FunctionDecl) { return funcAllowedContext; } +/** + * Gets the data field referenced by the given expression, if any. Returns `undefined` if the expression is not a reference to a data field. + */ export function getFieldReference(expr: Expression): DataField | undefined { if (isReferenceExpr(expr) && isDataField(expr.target.ref)) { return expr.target.ref; @@ -390,6 +430,9 @@ export function isCheckInvocation(node: AstNode) { return isInvocationExpr(node) && node.function.ref?.name === 'check'; } +/** + * Resolves the transitive imports of the given model and returns the list of imported models. The given model itself is not included in the result. + */ export function resolveTransitiveImports(documents: LangiumDocuments, model: Model) { return resolveTransitiveImportsInternal(documents, model); } @@ -421,6 +464,10 @@ function resolveTransitiveImportsInternal( return Array.from(models); } +/** + * Resolves the given import and returns the imported model. Returns `undefined` + * if the import cannot be resolved. + */ export function resolveImport(documents: LangiumDocuments, imp: ModelImport) { const resolvedUri = resolveImportUri(imp); try { @@ -441,6 +488,10 @@ export function resolveImport(documents: LangiumDocuments, imp: ModelImport) { return undefined; } +/** + * Resolves the given import and returns the URI of the imported model. + * Returns `undefined` if the import cannot be resolved. + */ export function resolveImportUri(imp: ModelImport) { if (!imp.path) { return undefined; @@ -463,11 +514,18 @@ export function getDataModelAndTypeDefs(model: Model, includeIgnored = false) { } } +/** + * Gets all declarations of the given model and its transitive imports. + */ export function getAllDeclarationsIncludingImports(documents: LangiumDocuments, model: Model) { const imports = resolveTransitiveImports(documents, model); return model.declarations.concat(...imports.map((imp) => imp.declarations)); } +/** + * Gets the model used for auth context, by looking for a model with `@@auth` attribute or a model named `User`. + * Returns `undefined` if no such model is found. + */ export function getAuthDecl(decls: (DataModel | TypeDef)[]) { let authModel = decls.find((d) => hasAttribute(d, '@@auth')); if (!authModel) { @@ -481,10 +539,16 @@ export function isBeforeInvocation(node: AstNode) { return isInvocationExpr(node) && node.function.ref?.name === 'before'; } +/** + * Determines if the given AST node is a collection predicate. + */ export function isCollectionPredicate(node: AstNode): node is BinaryExpr { return isBinaryExpr(node) && ['?', '!', '^'].includes(node.operator); } +/** + * Gets all data models and type defs from the given documents registry. + */ export function getAllLoadedDataModelsAndTypeDefs(langiumDocuments: LangiumDocuments) { return langiumDocuments.all .map((doc) => doc.parseResult.value as Model) @@ -492,10 +556,17 @@ export function getAllLoadedDataModelsAndTypeDefs(langiumDocuments: LangiumDocum .toArray(); } +/** + * Gets all data models from the given documents registry and the transitive imports of the given model. + */ export function getAllDataModelsIncludingImports(documents: LangiumDocuments, model: Model) { return getAllDeclarationsIncludingImports(documents, model).filter(isDataModel); } +/** + * Gets all data models and type defs from the given documents registry and the transitive imports + * of the given model. If `fromModel` is not provided, returns all loaded data models and type defs. + */ export function getAllLoadedAndReachableDataModelsAndTypeDefs( langiumDocuments: LangiumDocuments, fromModel?: DataModel, @@ -519,6 +590,10 @@ export function getAllLoadedAndReachableDataModelsAndTypeDefs( return allDataModels; } +/** + * Gets the containing data model of the given AST node, if any. + * Returns `undefined` if the node is not contained in a data model. + */ export function getContainingDataModel(node: AstNode): DataModel | undefined { let curr: AstNode | undefined = node.$container; while (curr) { @@ -530,10 +605,16 @@ export function getContainingDataModel(node: AstNode): DataModel | undefined { return undefined; } +/** + * Determines if the given AST node can contain members. + */ export function isMemberContainer(node: unknown): node is DataModel | TypeDef { return isDataModel(node) || isTypeDef(node); } +/** + * Gets all fields of a data model or type def, including inherited fields from base models and mixins. + */ export function getAllFields( decl: DataModel | TypeDef, includeIgnored = false, @@ -561,6 +642,10 @@ export function getAllFields( return fields; } +/** + * Gets all attributes of a data model or type def, including inherited attributes + * from base models and mixins. + */ export function getAllAttributes( decl: DataModel | TypeDef, seen: Set = new Set(), @@ -608,6 +693,9 @@ export function getDocument(node: AstNode): Langium return result as LangiumDocument; } +/** + * Gets the list of plugin documents from the given model. + */ export function getPluginDocuments(model: Model, schemaPath: string): string[] { // traverse plugins and collect "plugin.zmodel" documents const result: string[] = []; diff --git a/packages/language/src/validators/datamodel-validator.ts b/packages/language/src/validators/datamodel-validator.ts index d2fcd155d..0048bd20d 100644 --- a/packages/language/src/validators/datamodel-validator.ts +++ b/packages/language/src/validators/datamodel-validator.ts @@ -109,7 +109,27 @@ export default class DataModelValidator implements AstValidator { if (!hasAttribute(field, '@json')) { accept('error', 'Custom-typed field must have @json attribute', { node: field }); } + if (this.typeDefHasModelField(field.type.reference!.ref as TypeDef)) { + accept('error', 'Type used as JSON field type cannot have relation fields', { node: field }); + } + } + } + + private typeDefHasModelField(typeDef: TypeDef, visited = new Set()): boolean { + if (visited.has(typeDef)) return false; + visited.add(typeDef); + + for (const field of getAllFields(typeDef)) { + if (isDataModel(field.type.reference?.ref)) { + return true; + } + if (isTypeDef(field.type.reference?.ref)) { + if (this.typeDefHasModelField(field.type.reference.ref as TypeDef, visited)) { + return true; + } + } } + return false; } private validateAttributes(dm: DataModel, accept: ValidationAcceptor) { diff --git a/packages/language/src/validators/typedef-validator.ts b/packages/language/src/validators/typedef-validator.ts index 6ad35b0b0..63cc930f4 100644 --- a/packages/language/src/validators/typedef-validator.ts +++ b/packages/language/src/validators/typedef-validator.ts @@ -1,5 +1,5 @@ import type { ValidationAcceptor } from 'langium'; -import { isDataModel, type DataField, type TypeDef } from '../generated/ast'; +import { type DataField, type TypeDef } from '../generated/ast'; import { validateAttributeApplication } from './attribute-application-validator'; import { validateDuplicatedDeclarations, type AstValidator } from './common'; @@ -22,11 +22,6 @@ export default class TypeDefValidator implements AstValidator { } private validateField(field: DataField, accept: ValidationAcceptor): void { - if (isDataModel(field.type.reference?.ref)) { - accept('error', 'Type field cannot be a relation', { - node: field.type, - }); - } field.attributes.forEach((attr) => validateAttributeApplication(attr, accept)); } } diff --git a/packages/language/test/mixin.test.ts b/packages/language/test/mixin.test.ts index 1c4356d8b..dd79575eb 100644 --- a/packages/language/test/mixin.test.ts +++ b/packages/language/test/mixin.test.ts @@ -128,9 +128,13 @@ describe('Mixin Tests', () => { ); }); - it('does not allow relation fields in type', async () => { - await loadSchemaWithError( - ` + it('allows relation fields in type', async () => { + await loadSchema(` + datasource db { + provider = 'sqlite' + url = 'file:./dev.db' + } + model User { id Int @id @default(autoincrement()) } @@ -138,8 +142,89 @@ describe('Mixin Tests', () => { type T { u User } + `); + }); + + it('allows multiple models to mixin a type with relation fields', async () => { + await loadSchema(` + datasource db { + provider = 'sqlite' + url = 'file:./dev.db' + } + + type WithComments { + comments Comment[] + } + + model Post with WithComments { + id Int @id @default(autoincrement()) + } + + model Article with WithComments { + id Int @id @default(autoincrement()) + } + + model Comment { + id Int @id @default(autoincrement()) + post Post? @relation(fields: [postId], references: [id]) + postId Int? + article Article? @relation(fields: [articleId], references: [id]) + articleId Int? + } + `); + }); + + it('rejects type with relation fields when used as JSON field type', async () => { + await loadSchemaWithError( + ` + datasource db { + provider = 'sqlite' + url = 'file:./dev.db' + } + + model User { + id Int @id @default(autoincrement()) + } + + type WithRelation { + user User + } + + model Post { + id Int @id @default(autoincrement()) + metadata WithRelation @json + } + `, + 'Type used as JSON field type cannot have relation fields', + ); + }); + + it('rejects type with transitively-nested relation fields when used as JSON field type', async () => { + await loadSchemaWithError( + ` + datasource db { + provider = 'sqlite' + url = 'file:./dev.db' + } + + model User { + id Int @id @default(autoincrement()) + } + + type Inner { + user User + } + + type Outer { + inner Inner + } + + model Post { + id Int @id @default(autoincrement()) + metadata Outer @json + } `, - 'Type field cannot be a relation', + 'Type used as JSON field type cannot have relation fields', ); }); diff --git a/packages/language/tsdown.config.ts b/packages/language/tsdown.config.ts new file mode 100644 index 000000000..2857b82ef --- /dev/null +++ b/packages/language/tsdown.config.ts @@ -0,0 +1,10 @@ +import { createConfig } from '@zenstackhq/tsdown-config'; + +export default createConfig({ + entry: { + index: 'src/index.ts', + ast: 'src/ast.ts', + utils: 'src/utils.ts', + factory: 'src/factory/index.ts', + }, +}); diff --git a/packages/language/tsup.config.ts b/packages/language/tsup.config.ts deleted file mode 100644 index 48282a08c..000000000 --- a/packages/language/tsup.config.ts +++ /dev/null @@ -1,16 +0,0 @@ -import { defineConfig } from 'tsup'; - -export default defineConfig({ - entry: { - index: 'src/index.ts', - ast: 'src/ast.ts', - utils: 'src/utils.ts', - factory: 'src/factory/index.ts', - }, - outDir: 'dist', - splitting: false, - sourcemap: true, - clean: true, - dts: true, - format: ['esm', 'cjs'], -}); diff --git a/packages/orm/package.json b/packages/orm/package.json index e04da18d9..193d17719 100644 --- a/packages/orm/package.json +++ b/packages/orm/package.json @@ -2,7 +2,7 @@ "name": "@zenstackhq/orm", "displayName": "ZenStack ORM", "description": "ZenStack ORM", - "version": "3.5.6", + "version": "3.6.0", "type": "module", "author": { "name": "ZenStack Team", @@ -15,8 +15,8 @@ }, "license": "MIT", "scripts": { - "build": "tsc --noEmit && tsup-node", - "watch": "tsup-node --watch", + "build": "tsc --noEmit && tsdown", + "watch": "tsdown --watch", "lint": "eslint src --ext ts", "pack": "pnpm pack" }, @@ -27,8 +27,8 @@ "exports": { ".": { "import": { - "types": "./dist/index.d.ts", - "default": "./dist/index.js" + "types": "./dist/index.d.mts", + "default": "./dist/index.mjs" }, "require": { "types": "./dist/index.d.cts", @@ -37,8 +37,8 @@ }, "./schema": { "import": { - "types": "./dist/schema.d.ts", - "default": "./dist/schema.js" + "types": "./dist/schema.d.mts", + "default": "./dist/schema.mjs" }, "require": { "types": "./dist/schema.d.cts", @@ -47,8 +47,8 @@ }, "./dialects/sqlite": { "import": { - "types": "./dist/dialects/sqlite.d.ts", - "default": "./dist/dialects/sqlite.js" + "types": "./dist/dialects/sqlite.d.mts", + "default": "./dist/dialects/sqlite.mjs" }, "require": { "types": "./dist/dialects/sqlite.d.cts", @@ -57,8 +57,8 @@ }, "./dialects/postgres": { "import": { - "types": "./dist/dialects/postgres.d.ts", - "default": "./dist/dialects/postgres.js" + "types": "./dist/dialects/postgres.d.mts", + "default": "./dist/dialects/postgres.mjs" }, "require": { "types": "./dist/dialects/postgres.d.cts", @@ -67,8 +67,8 @@ }, "./dialects/mysql": { "import": { - "types": "./dist/dialects/mysql.d.ts", - "default": "./dist/dialects/mysql.js" + "types": "./dist/dialects/mysql.d.mts", + "default": "./dist/dialects/mysql.mjs" }, "require": { "types": "./dist/dialects/mysql.d.cts", @@ -77,8 +77,8 @@ }, "./dialects/sql.js": { "import": { - "types": "./dist/dialects/sql.js.d.ts", - "default": "./dist/dialects/sql.js.js" + "types": "./dist/dialects/sql.js.d.mts", + "default": "./dist/dialects/sql.js.mjs" }, "require": { "types": "./dist/dialects/sql.js.d.cts", @@ -87,8 +87,8 @@ }, "./helpers": { "import": { - "types": "./dist/helpers.d.ts", - "default": "./dist/helpers.js" + "types": "./dist/helpers.d.mts", + "default": "./dist/helpers.mjs" }, "require": { "types": "./dist/helpers.d.cts", @@ -144,6 +144,7 @@ "@types/sql.js": "^1.4.9", "@types/toposort": "^2.0.7", "@zenstackhq/eslint-config": "workspace:*", + "@zenstackhq/tsdown-config": "workspace:*", "@zenstackhq/typescript-config": "workspace:*", "@zenstackhq/vitest-config": "workspace:*", "tsx": "^4.19.2", diff --git a/packages/orm/src/client/client-impl.ts b/packages/orm/src/client/client-impl.ts index cabc8bb41..d96984aef 100644 --- a/packages/orm/src/client/client-impl.ts +++ b/packages/orm/src/client/client-impl.ts @@ -1,4 +1,5 @@ import { invariant, lowerCaseFirst } from '@zenstackhq/common-helpers'; +import type { ProcedureDef, SchemaDef } from '@zenstackhq/schema'; import type { QueryExecutor } from 'kysely'; import { CompiledQuery, @@ -11,7 +12,6 @@ import { type KyselyProps, } from 'kysely'; import z from 'zod'; -import type { ProcedureDef, SchemaDef } from '../schema'; import type { AnyKysely } from '../utils/kysely-utils'; import type { UnwrapTuplePromises } from '../utils/type-utils'; import { formatError } from '../utils/zod-utils'; diff --git a/packages/orm/src/client/contract.ts b/packages/orm/src/client/contract.ts index 4a451e203..29e2456e0 100644 --- a/packages/orm/src/client/contract.ts +++ b/packages/orm/src/client/contract.ts @@ -6,7 +6,7 @@ import { type RelationFields, type RelationFieldType, type SchemaDef, -} from '../schema'; +} from '@zenstackhq/schema'; import type { AnyKysely } from '../utils/kysely-utils'; import type { Simplify, UnwrapTuplePromises } from '../utils/type-utils'; import type { TRANSACTION_UNSUPPORTED_METHODS } from './constants'; diff --git a/packages/orm/src/client/crud-types.ts b/packages/orm/src/client/crud-types.ts index d29822209..6f82aaba1 100644 --- a/packages/orm/src/client/crud-types.ts +++ b/packages/orm/src/client/crud-types.ts @@ -34,7 +34,7 @@ import type { TypeDefFieldIsArray, TypeDefFieldIsOptional, UpdatedAtInfo, -} from '../schema'; +} from '@zenstackhq/schema'; import type { AtLeast, MapBaseType, @@ -116,13 +116,14 @@ type OptionsLevelOmit< Model extends GetModels, Field extends GetModelFields, Options extends QueryOptions, -> = Uncapitalize extends keyof Options['omit'] - ? Field extends keyof Options['omit'][Uncapitalize] - ? Options['omit'][Uncapitalize][Field] extends boolean - ? Options['omit'][Uncapitalize][Field] +> = + Uncapitalize extends keyof Options['omit'] + ? Field extends keyof Options['omit'][Uncapitalize] + ? Options['omit'][Uncapitalize][Field] extends boolean + ? Options['omit'][Uncapitalize][Field] + : undefined : undefined - : undefined - : undefined; + : undefined; type SchemaLevelOmit< Schema extends SchemaDef, @@ -159,25 +160,18 @@ type DelegateUnionResult< Depth extends readonly 0[] = [], > = Depth['length'] extends 10 // hard stop so generic SchemaDef never infinite-loops ? SubModel extends string - ? FlatModelResult & - { [K in GetModelDiscriminator]: SubModel } + ? FlatModelResult & { [K in GetModelDiscriminator]: SubModel } : never : SubModel extends string // typescript union distribution ? IsDelegateModel extends true - ? // sub-model is itself a delegate — recurse into its own sub-models so all - // concrete leaf types appear in the union, each picking up the accumulated - // discriminator overrides from both levels - DelegateUnionResult< - Schema, - SubModel, - Options, - GetSubModels, - Omit, - [...Depth, 0] - > & { [K in GetModelDiscriminator]: SubModel } - : // leaf model — produce a flat scalar result and fix the discriminator - FlatModelResult & - { [K in GetModelDiscriminator]: SubModel } + ? // sub-model is itself a delegate — recurse into its own sub-models so all + // concrete leaf types appear in the union, each picking up the accumulated + // discriminator overrides from both levels + DelegateUnionResult, Omit, [...Depth, 0]> & { + [K in GetModelDiscriminator]: SubModel; + } + : // leaf model — produce a flat scalar result and fix the discriminator + FlatModelResult & { [K in GetModelDiscriminator]: SubModel } : never; type ModelSelectResult< diff --git a/packages/orm/src/client/crud/dialects/base-dialect.ts b/packages/orm/src/client/crud/dialects/base-dialect.ts index b525ac486..c90f1f4d0 100644 --- a/packages/orm/src/client/crud/dialects/base-dialect.ts +++ b/packages/orm/src/client/crud/dialects/base-dialect.ts @@ -1,9 +1,9 @@ import { enumerate, invariant, isPlainObject, lowerCaseFirst } from '@zenstackhq/common-helpers'; +import type { BuiltinType, DataSourceProviderType, FieldDef, GetModels, ModelDef, SchemaDef } from '@zenstackhq/schema'; import type { AliasableExpression, Expression, ExpressionBuilder, ExpressionWrapper, SqlBool, ValueNode } from 'kysely'; import { expressionBuilder, sql, type SelectQueryBuilder } from 'kysely'; import { match, P } from 'ts-pattern'; import { AnyNullClass, DbNullClass, JsonNullClass } from '../../../common-types'; -import type { BuiltinType, DataSourceProviderType, FieldDef, GetModels, ModelDef, SchemaDef } from '../../../schema'; import type { OrArray } from '../../../utils/type-utils'; import { AggregateOperators, DELEGATE_JOINED_FIELD_PREFIX, LOGICAL_COMBINATORS } from '../../constants'; import type { @@ -252,12 +252,17 @@ export abstract class BaseCrudDialect { const [field, order] = orderByItems[j]!; const _order = negateOrderBy ? (order === 'asc' ? 'desc' : 'asc') : order; const op = j === i ? (_order === 'asc' ? '>=' : '<=') : '='; + // Fields inherited from a delegate base live on the base table, which is + // joined with its model name as alias. See buildSelectModel/buildDelegateJoin. + const fieldDef = requireField(this.schema, model, field); + const outerAlias = fieldDef.originModel ?? modelAlias; + const subSelectAlias = fieldDef.originModel ?? subQueryAlias; andFilters.push( this.eb( - this.eb.ref(`${modelAlias}.${field}`), + this.eb.ref(`${outerAlias}.${field}`), op, this.buildSelectModel(model, subQueryAlias) - .select(`${subQueryAlias}.${field}`) + .select(`${subSelectAlias}.${field}`) .where(cursorFilter), ), ); @@ -355,14 +360,17 @@ export abstract class BaseCrudDialect { field, joinAlias, ); - const filterResultField = tmpAlias(`${field}$flt`); - - const joinSelect = this.eb + const baseJoin = this.eb .selectFrom(`${fieldDef.type} as ${joinAlias}`) + .select(this.eb.lit(1).as('_')) .where(() => this.and(...joinPairs.map(([left, right]) => this.eb(this.eb.ref(left), '=', this.eb.ref(right)))), - ) - .select(() => this.eb.fn.count(this.eb.lit(1)).as(filterResultField)); + ); + + const existsSelect = (extraFilter?: () => Expression) => { + const q = extraFilter ? baseJoin.where(extraFilter) : baseJoin; + return this.buildExistsExpression(q); + }; const conditions: Expression[] = []; @@ -370,46 +378,30 @@ export abstract class BaseCrudDialect { if ('is' in payload) { if (payload.is === null) { // check if not found - conditions.push(this.eb(joinSelect, '=', 0)); + conditions.push(this.eb.not(existsSelect())); } else { - // check if found - conditions.push( - this.eb( - joinSelect.where(() => this.buildFilter(fieldDef.type, joinAlias, payload.is)), - '>', - 0, - ), - ); + // check if found that matches the filter + conditions.push(existsSelect(() => this.buildFilter(fieldDef.type, joinAlias, payload.is))); } } if ('isNot' in payload) { if (payload.isNot === null) { // check if found - conditions.push(this.eb(joinSelect, '>', 0)); + conditions.push(existsSelect()); } else { conditions.push( this.or( - // is null - this.eb(joinSelect, '=', 0), - // found one that matches the filter - this.eb( - joinSelect.where(() => this.buildFilter(fieldDef.type, joinAlias, payload.isNot)), - '=', - 0, - ), + // no related row + this.eb.not(existsSelect()), + // related row exists but doesn't match the filter + this.eb.not(existsSelect(() => this.buildFilter(fieldDef.type, joinAlias, payload.isNot))), ), ); } } } else { - conditions.push( - this.eb( - joinSelect.where(() => this.buildFilter(fieldDef.type, joinAlias, payload)), - '>', - 0, - ), - ); + conditions.push(existsSelect(() => this.buildFilter(fieldDef.type, joinAlias, payload))); } return this.and(...conditions); diff --git a/packages/orm/src/client/crud/dialects/index.ts b/packages/orm/src/client/crud/dialects/index.ts index fb9a7379f..8dd8d25ea 100644 --- a/packages/orm/src/client/crud/dialects/index.ts +++ b/packages/orm/src/client/crud/dialects/index.ts @@ -1,5 +1,5 @@ +import type { SchemaDef } from '@zenstackhq/schema'; import { match } from 'ts-pattern'; -import type { SchemaDef } from '../../../schema'; import type { ClientOptions } from '../../options'; import type { BaseCrudDialect } from './base-dialect'; import { MySqlCrudDialect } from './mysql'; diff --git a/packages/orm/src/client/crud/dialects/lateral-join-dialect-base.ts b/packages/orm/src/client/crud/dialects/lateral-join-dialect-base.ts index 9e7d0b959..e4c13fe58 100644 --- a/packages/orm/src/client/crud/dialects/lateral-join-dialect-base.ts +++ b/packages/orm/src/client/crud/dialects/lateral-join-dialect-base.ts @@ -1,6 +1,6 @@ import { invariant } from '@zenstackhq/common-helpers'; +import type { FieldDef, GetModels, SchemaDef } from '@zenstackhq/schema'; import { type AliasableExpression, type Expression, type ExpressionBuilder, type SelectQueryBuilder } from 'kysely'; -import type { FieldDef, GetModels, SchemaDef } from '../../../schema'; import { DELEGATE_JOINED_FIELD_PREFIX } from '../../constants'; import type { FindArgs, NullsOrder, SortOrder } from '../../crud-types'; import { diff --git a/packages/orm/src/client/crud/dialects/mysql.ts b/packages/orm/src/client/crud/dialects/mysql.ts index dff577204..012e755e9 100644 --- a/packages/orm/src/client/crud/dialects/mysql.ts +++ b/packages/orm/src/client/crud/dialects/mysql.ts @@ -1,4 +1,5 @@ import { invariant } from '@zenstackhq/common-helpers'; +import type { BuiltinType, FieldDef, SchemaDef } from '@zenstackhq/schema'; import Decimal from 'decimal.js'; import type { AliasableExpression, TableExpression } from 'kysely'; import { @@ -11,7 +12,6 @@ import { type SqlBool, } from 'kysely'; import { AnyNullClass, DbNullClass, JsonNullClass } from '../../../common-types'; -import type { BuiltinType, FieldDef, SchemaDef } from '../../../schema'; import type { NullsOrder, SortOrder } from '../../crud-types'; import { createInvalidInputError, createNotSupportedError } from '../../errors'; import type { ClientOptions } from '../../options'; @@ -166,15 +166,20 @@ export class MySqlCrudDialect extends LateralJoinDiale } private transformOutputDate(value: unknown) { - if (typeof value === 'string') { - // MySQL DateTime columns are returned as strings (non-ISO but parsable as JS Date), - // convert to ISO Date by appending 'Z' if not present - return new Date(!value.endsWith('Z') ? value + 'Z' : value); - } else if (value instanceof Date) { - return value; - } else { + if (typeof value !== 'string') { return value; } + + // MySQL `TIME` columns return bare time strings ("09:30:00") that `new Date` + // can't parse on their own — anchor at the Unix epoch. Detect by shape rather + // than the schema attribute so the runtime stays decoupled from `@db.*` + // (which is migration/db-push only): TIME starts with `HH:`, DATE/DATETIME + // values always start with `YYYY-`. + const anchored = /^\d{2}:/.test(value) ? `1970-01-01T${value}` : value; + + // MySQL DateTime columns are returned as strings (non-ISO but parsable as JS Date), + // convert to ISO Date by appending 'Z' if not present + return new Date(!anchored.endsWith('Z') ? anchored + 'Z' : anchored); } private transformOutputBytes(value: unknown) { diff --git a/packages/orm/src/client/crud/dialects/postgresql.ts b/packages/orm/src/client/crud/dialects/postgresql.ts index c5a0ea485..1faace74c 100644 --- a/packages/orm/src/client/crud/dialects/postgresql.ts +++ b/packages/orm/src/client/crud/dialects/postgresql.ts @@ -1,4 +1,5 @@ import { invariant } from '@zenstackhq/common-helpers'; +import type { BuiltinType, FieldDef, SchemaDef } from '@zenstackhq/schema'; import Decimal from 'decimal.js'; import { expressionBuilder, @@ -10,7 +11,6 @@ import { } from 'kysely'; import { parse as parsePostgresArray } from 'postgres-array'; import { AnyNullClass, DbNullClass, JsonNullClass } from '../../../common-types'; -import type { BuiltinType, FieldDef, SchemaDef } from '../../../schema'; import type { NullsOrder, SortOrder } from '../../crud-types'; import { createInvalidInputError } from '../../errors'; import type { ClientOptions } from '../../options'; @@ -256,18 +256,29 @@ export class PostgresCrudDialect extends LateralJoinDi } private transformOutputDate(value: unknown) { - if (typeof value === 'string') { - // PostgreSQL's jsonb_build_object serializes timestamp as ISO 8601 strings, - // we force interpret them as UTC dates here if the value does not carry timezone - // offset (this happens with "TIMESTAMP WITHOUT TIME ZONE" field type) - const normalized = this.hasTimezoneOffset(value) ? value : `${value}Z`; - const parsed = new Date(normalized); - return Number.isNaN(parsed.getTime()) - ? value // fallback to original value if parsing fails - : parsed; - } else { + if (typeof value !== 'string') { return value; } + + // PG `time` / `timetz` values come back as bare time strings ("09:30:00" or + // "09:30:00+00") that `new Date` can't parse on their own — anchor at the + // Unix epoch and expand `timetz`'s minute-less offset (`+HH` -> `+HH:00`). + // Detect by shape rather than the schema attribute so the runtime stays + // decoupled from `@db.*` (which is migration/db-push only): time-only + // values start with `HH:`, anything date-bearing starts with `YYYY-`. + const isTimeOnly = /^\d{2}:/.test(value); + const anchored = isTimeOnly + ? `1970-01-01T${value}`.replace(/([+-]\d{2})$/, '$1:00') + : value; + + // PostgreSQL's jsonb_build_object serializes timestamp as ISO 8601 strings, + // we force interpret them as UTC dates here if the value does not carry timezone + // offset (this happens with "TIMESTAMP WITHOUT TIME ZONE" field type) + const normalized = this.hasTimezoneOffset(anchored) ? anchored : `${anchored}Z`; + const parsed = new Date(normalized); + return Number.isNaN(parsed.getTime()) + ? value // fallback to original value if parsing fails + : parsed; } private hasTimezoneOffset(value: string) { @@ -342,7 +353,10 @@ export class PostgresCrudDialect extends LateralJoinDi const MAX_PAIRS = 50; const buildChunk = (chunk: [string, Expression][]) => - this.eb.fn('jsonb_build_object', chunk.flatMap(([k, v]) => [sql.lit(k), v])); + this.eb.fn( + 'jsonb_build_object', + chunk.flatMap(([k, v]) => [sql.lit(k), v]), + ); if (entries.length <= MAX_PAIRS) { return buildChunk(entries); @@ -469,7 +483,10 @@ export class PostgresCrudDialect extends LateralJoinDi // Resolves the effective SQL type for a field: the native type from any @db.* attribute, // or the base ZModel SQL type if no attribute is present, or undefined if the field is unknown. - private resolveFieldSqlType(fieldDef: FieldDef | undefined): { sqlType: string | undefined; hasDbOverride: boolean } { + private resolveFieldSqlType(fieldDef: FieldDef | undefined): { + sqlType: string | undefined; + hasDbOverride: boolean; + } { if (!fieldDef) { return { sqlType: undefined, hasDbOverride: false }; } @@ -492,7 +509,10 @@ export class PostgresCrudDialect extends LateralJoinDi // If the resolved SQL types differ and at least one side carries a @db.* native type override, // cast that side back to its base ZModel SQL type so PostgreSQL doesn't reject the comparison // (e.g. "operator does not exist: uuid = text"). - if (leftResolved.sqlType !== rightResolved.sqlType && (leftResolved.hasDbOverride || rightResolved.hasDbOverride)) { + if ( + leftResolved.sqlType !== rightResolved.sqlType && + (leftResolved.hasDbOverride || rightResolved.hasDbOverride) + ) { if (leftResolved.hasDbOverride) { left = this.eb.cast(left, sql.raw(this.getSqlType(leftFieldDef!.type))); } diff --git a/packages/orm/src/client/crud/dialects/sqlite.ts b/packages/orm/src/client/crud/dialects/sqlite.ts index 28935c7c7..44f8274c6 100644 --- a/packages/orm/src/client/crud/dialects/sqlite.ts +++ b/packages/orm/src/client/crud/dialects/sqlite.ts @@ -1,4 +1,5 @@ import { invariant } from '@zenstackhq/common-helpers'; +import type { BuiltinType, FieldDef, GetModels, SchemaDef } from '@zenstackhq/schema'; import Decimal from 'decimal.js'; import { expressionBuilder, @@ -13,7 +14,6 @@ import { type SqlBool, } from 'kysely'; import { AnyNullClass, DbNullClass, JsonNullClass } from '../../../common-types'; -import type { BuiltinType, FieldDef, GetModels, SchemaDef } from '../../../schema'; import { DELEGATE_JOINED_FIELD_PREFIX } from '../../constants'; import type { FindArgs, SortOrder } from '../../crud-types'; import { createInternalError, createInvalidInputError, createNotSupportedError } from '../../errors'; @@ -307,7 +307,11 @@ export class SqliteCrudDialect extends BaseCrudDialect ); } - if (typeof payload === 'object' && (payload as any).include && typeof (payload as any).include === 'object') { + if ( + typeof payload === 'object' && + (payload as any).include && + typeof (payload as any).include === 'object' + ) { // include relation fields objArgs.push( ...Object.entries((payload as any).include) diff --git a/packages/orm/src/client/crud/operations/aggregate.ts b/packages/orm/src/client/crud/operations/aggregate.ts index da7af7b1d..035a19d1e 100644 --- a/packages/orm/src/client/crud/operations/aggregate.ts +++ b/packages/orm/src/client/crud/operations/aggregate.ts @@ -1,5 +1,5 @@ +import type { SchemaDef } from '@zenstackhq/schema'; import { match } from 'ts-pattern'; -import type { SchemaDef } from '../../../schema'; import { getField } from '../../query-utils'; import { BaseOperationHandler } from './base'; diff --git a/packages/orm/src/client/crud/operations/base.ts b/packages/orm/src/client/crud/operations/base.ts index 94ac64ad3..4c37e0eae 100644 --- a/packages/orm/src/client/crud/operations/base.ts +++ b/packages/orm/src/client/crud/operations/base.ts @@ -1,5 +1,7 @@ import { createId as cuid2 } from '@paralleldrive/cuid2'; import { clone, enumerate, invariant, isPlainObject } from '@zenstackhq/common-helpers'; +import type { BuiltinType, Expression, FieldDef } from '@zenstackhq/schema'; +import { ExpressionUtils, type GetModels, type ModelDef, type SchemaDef } from '@zenstackhq/schema'; import { default as cuid1 } from 'cuid'; import { createQueryId, @@ -15,8 +17,6 @@ import { nanoid } from 'nanoid'; import { match } from 'ts-pattern'; import { ulid } from 'ulid'; import * as uuid from 'uuid'; -import type { BuiltinType, Expression, FieldDef } from '../../../schema'; -import { ExpressionUtils, type GetModels, type ModelDef, type SchemaDef } from '../../../schema'; import type { AnyKysely } from '../../../utils/kysely-utils'; import { extractFields, fieldsToSelectObject, isEmptyObject } from '../../../utils/object-utils'; import { NUMERIC_FIELD_TYPES } from '../../constants'; diff --git a/packages/orm/src/client/crud/operations/count.ts b/packages/orm/src/client/crud/operations/count.ts index fd9861754..c70b69f1e 100644 --- a/packages/orm/src/client/crud/operations/count.ts +++ b/packages/orm/src/client/crud/operations/count.ts @@ -1,4 +1,4 @@ -import type { SchemaDef } from '../../../schema'; +import type { SchemaDef } from '@zenstackhq/schema'; import { BaseOperationHandler } from './base'; export class CountOperationHandler extends BaseOperationHandler { diff --git a/packages/orm/src/client/crud/operations/create.ts b/packages/orm/src/client/crud/operations/create.ts index 89f07270a..f322a07d3 100644 --- a/packages/orm/src/client/crud/operations/create.ts +++ b/packages/orm/src/client/crud/operations/create.ts @@ -1,5 +1,5 @@ +import type { SchemaDef } from '@zenstackhq/schema'; import { match } from 'ts-pattern'; -import type { SchemaDef } from '../../../schema'; import { createRejectedByPolicyError, RejectedByPolicyReason } from '../../errors'; import { getIdValues } from '../../query-utils'; import { BaseOperationHandler } from './base'; diff --git a/packages/orm/src/client/crud/operations/delete.ts b/packages/orm/src/client/crud/operations/delete.ts index cc16a7be0..03addadc3 100644 --- a/packages/orm/src/client/crud/operations/delete.ts +++ b/packages/orm/src/client/crud/operations/delete.ts @@ -1,5 +1,5 @@ +import type { SchemaDef } from '@zenstackhq/schema'; import { match } from 'ts-pattern'; -import type { SchemaDef } from '../../../schema'; import { createNotFoundError, createRejectedByPolicyError, RejectedByPolicyReason } from '../../errors'; import { BaseOperationHandler } from './base'; diff --git a/packages/orm/src/client/crud/operations/exists.ts b/packages/orm/src/client/crud/operations/exists.ts index d4c6896fc..890a31231 100644 --- a/packages/orm/src/client/crud/operations/exists.ts +++ b/packages/orm/src/client/crud/operations/exists.ts @@ -1,4 +1,4 @@ -import type { SchemaDef } from '../../../schema'; +import type { SchemaDef } from '@zenstackhq/schema'; import { BaseOperationHandler } from './base'; export class ExistsOperationHandler extends BaseOperationHandler { diff --git a/packages/orm/src/client/crud/operations/find.ts b/packages/orm/src/client/crud/operations/find.ts index 197c1c643..d063bea86 100644 --- a/packages/orm/src/client/crud/operations/find.ts +++ b/packages/orm/src/client/crud/operations/find.ts @@ -1,4 +1,4 @@ -import type { SchemaDef } from '../../../schema'; +import type { SchemaDef } from '@zenstackhq/schema'; import { BaseOperationHandler, type CoreCrudOperations } from './base'; export class FindOperationHandler extends BaseOperationHandler { diff --git a/packages/orm/src/client/crud/operations/group-by.ts b/packages/orm/src/client/crud/operations/group-by.ts index ad429cf36..e4ea01439 100644 --- a/packages/orm/src/client/crud/operations/group-by.ts +++ b/packages/orm/src/client/crud/operations/group-by.ts @@ -1,5 +1,5 @@ +import type { SchemaDef } from '@zenstackhq/schema'; import { match } from 'ts-pattern'; -import type { SchemaDef } from '../../../schema'; import { aggregate, getField } from '../../query-utils'; import { BaseOperationHandler } from './base'; diff --git a/packages/orm/src/client/crud/operations/update.ts b/packages/orm/src/client/crud/operations/update.ts index 4b1d9b528..32a666b0e 100644 --- a/packages/orm/src/client/crud/operations/update.ts +++ b/packages/orm/src/client/crud/operations/update.ts @@ -1,5 +1,5 @@ +import type { GetModels, SchemaDef } from '@zenstackhq/schema'; import { match } from 'ts-pattern'; -import type { GetModels, SchemaDef } from '../../../schema'; import type { WhereInput } from '../../crud-types'; import { createRejectedByPolicyError, RejectedByPolicyReason } from '../../errors'; import { getIdValues, requireIdFields } from '../../query-utils'; diff --git a/packages/orm/src/client/crud/validator/validator.ts b/packages/orm/src/client/crud/validator/validator.ts index 001302152..defaf9035 100644 --- a/packages/orm/src/client/crud/validator/validator.ts +++ b/packages/orm/src/client/crud/validator/validator.ts @@ -1,7 +1,7 @@ import { invariant } from '@zenstackhq/common-helpers'; +import { type GetModels, type ProcedureDef, type SchemaDef } from '@zenstackhq/schema'; import { match } from 'ts-pattern'; import { ZodType } from 'zod'; -import { type GetModels, type ProcedureDef, type SchemaDef } from '../../../schema'; import { formatError } from '../../../utils/zod-utils'; import type { ClientContract } from '../../contract'; import { diff --git a/packages/orm/src/client/executor/name-mapper.ts b/packages/orm/src/client/executor/name-mapper.ts index 369526cd6..c03475721 100644 --- a/packages/orm/src/client/executor/name-mapper.ts +++ b/packages/orm/src/client/executor/name-mapper.ts @@ -1,4 +1,5 @@ import { invariant } from '@zenstackhq/common-helpers'; +import type { EnumDef, EnumField, FieldDef, ModelDef, SchemaDef } from '@zenstackhq/schema'; import { AliasNode, BinaryOperationNode, @@ -27,7 +28,6 @@ import { ValueNode, ValuesNode, } from 'kysely'; -import type { EnumDef, EnumField, FieldDef, ModelDef, SchemaDef } from '../../schema'; import type { ClientContract } from '../contract'; import { getCrudDialect } from '../crud/dialects'; import type { BaseCrudDialect } from '../crud/dialects/base-dialect'; @@ -575,7 +575,6 @@ export class QueryNameMapper extends OperationNodeTransformer { }); } - private processSelections(selections: readonly SelectionNode[]) { const result: SelectionNode[] = []; selections.forEach((selection) => { diff --git a/packages/orm/src/client/executor/zenstack-query-executor.ts b/packages/orm/src/client/executor/zenstack-query-executor.ts index 186af02c3..ed4f6f6b1 100644 --- a/packages/orm/src/client/executor/zenstack-query-executor.ts +++ b/packages/orm/src/client/executor/zenstack-query-executor.ts @@ -1,4 +1,5 @@ import { invariant } from '@zenstackhq/common-helpers'; +import type { ModelDef, SchemaDef, TypeDefDef } from '@zenstackhq/schema'; import type { QueryId } from 'kysely'; import { AndNode, @@ -30,7 +31,6 @@ import { type RootOperationNode, } from 'kysely'; import { match } from 'ts-pattern'; -import type { ModelDef, SchemaDef, TypeDefDef } from '../../schema'; import type { ClientImpl } from '../client-impl'; import { TransactionIsolationLevel, type ClientContract } from '../contract'; import { getCrudDialect } from '../crud/dialects'; diff --git a/packages/orm/src/client/helpers/schema-db-pusher.ts b/packages/orm/src/client/helpers/schema-db-pusher.ts index f84a29004..569f65162 100644 --- a/packages/orm/src/client/helpers/schema-db-pusher.ts +++ b/packages/orm/src/client/helpers/schema-db-pusher.ts @@ -1,7 +1,4 @@ import { invariant } from '@zenstackhq/common-helpers'; -import { CreateTableBuilder, sql, type ColumnDataType, type OnModifyForeignAction, type RawBuilder } from 'kysely'; -import toposort from 'toposort'; -import { match } from 'ts-pattern'; import { ExpressionUtils, type BuiltinType, @@ -10,7 +7,10 @@ import { type FieldDef, type ModelDef, type SchemaDef, -} from '../../schema'; +} from '@zenstackhq/schema'; +import { CreateTableBuilder, sql, type ColumnDataType, type OnModifyForeignAction, type RawBuilder } from 'kysely'; +import toposort from 'toposort'; +import { match } from 'ts-pattern'; import type { ToKysely } from '../query-builder'; import { isUnsupportedField, requireModel } from '../query-utils'; diff --git a/packages/orm/src/client/index.ts b/packages/orm/src/client/index.ts index 41e313faa..7414ae1fe 100644 --- a/packages/orm/src/client/index.ts +++ b/packages/orm/src/client/index.ts @@ -6,6 +6,7 @@ export { BaseCrudDialect } from './crud/dialects/base-dialect'; export { AllCrudOperations, AllReadOperations, + AllWriteOperations, CoreCreateOperations, CoreCrudOperations, CoreDeleteOperations, diff --git a/packages/orm/src/client/options.ts b/packages/orm/src/client/options.ts index 1461d637f..136c4928b 100644 --- a/packages/orm/src/client/options.ts +++ b/packages/orm/src/client/options.ts @@ -1,5 +1,5 @@ +import type { GetModel, GetModelFields, GetModels, ProcedureDef, ScalarFields, SchemaDef } from '@zenstackhq/schema'; import type { Dialect, Expression, ExpressionBuilder, KyselyConfig, OperandExpression } from 'kysely'; -import type { GetModel, GetModelFields, GetModels, ProcedureDef, ScalarFields, SchemaDef } from '../schema'; import type { FilterPropertyToKind } from './constants'; import type { ClientContract, CRUD_EXT } from './contract'; import type { GetProcedureNames, ProcedureHandlerFunc } from './crud-types'; @@ -258,7 +258,9 @@ export type OmitConfig = { }; export type ComputedFieldsOptions = { - [Model in GetModels as 'computedFields' extends keyof GetModel ? Uncapitalize : never]: { + [Model in GetModels as 'computedFields' extends keyof GetModel + ? Uncapitalize + : never]: { [Field in keyof Schema['models'][Model]['computedFields']]: Schema['models'][Model]['computedFields'][Field] extends infer Func ? Func extends (...args: any[]) => infer R ? ( diff --git a/packages/orm/src/client/plugin.ts b/packages/orm/src/client/plugin.ts index 7535b6872..e9f05b2ee 100644 --- a/packages/orm/src/client/plugin.ts +++ b/packages/orm/src/client/plugin.ts @@ -1,7 +1,7 @@ import type { OperationNode, QueryId, QueryResult, RootOperationNode, UnknownRow } from 'kysely'; import type { ZodType } from 'zod'; import type { ClientContract, ZModelFunction } from '.'; -import type { GetModelFields, GetModels, NonRelationFields, SchemaDef } from '../schema'; +import type { GetModelFields, GetModels, NonRelationFields, SchemaDef } from '@zenstackhq/schema'; import type { MaybePromise } from '../utils/type-utils'; import type { MapModelFieldType } from './crud-types'; import type { AllCrudOperations, CoreCrudOperations } from './crud/operations/base'; diff --git a/packages/orm/src/client/promise.ts b/packages/orm/src/client/promise.ts index 0f3899321..77d9324b9 100644 --- a/packages/orm/src/client/promise.ts +++ b/packages/orm/src/client/promise.ts @@ -1,4 +1,4 @@ -import type { SchemaDef } from '../schema'; +import type { SchemaDef } from '@zenstackhq/schema'; import type { ClientContract } from './contract'; /** diff --git a/packages/orm/src/client/query-builder.ts b/packages/orm/src/client/query-builder.ts index 91ec4dfaa..90d474086 100644 --- a/packages/orm/src/client/query-builder.ts +++ b/packages/orm/src/client/query-builder.ts @@ -10,7 +10,7 @@ import type { ModelFieldIsOptional, ScalarFields, SchemaDef, -} from '../schema'; +} from '@zenstackhq/schema'; export type ToKyselySchema = { [Model in GetModels]: ToKyselyTable; diff --git a/packages/orm/src/client/query-utils.ts b/packages/orm/src/client/query-utils.ts index 2e8b134b3..9fc830a25 100644 --- a/packages/orm/src/client/query-utils.ts +++ b/packages/orm/src/client/query-utils.ts @@ -1,4 +1,5 @@ import { invariant } from '@zenstackhq/common-helpers'; +import { ExpressionUtils, type FieldDef, type GetModels, type ModelDef, type SchemaDef } from '@zenstackhq/schema'; import { AliasNode, ColumnNode, @@ -9,7 +10,6 @@ import { type OperationNode, } from 'kysely'; import { match } from 'ts-pattern'; -import { ExpressionUtils, type FieldDef, type GetModels, type ModelDef, type SchemaDef } from '../schema'; import { extractFields } from '../utils/object-utils'; import type { AggregateOperators } from './constants'; import { createInternalError } from './errors'; diff --git a/packages/orm/src/client/result-processor.ts b/packages/orm/src/client/result-processor.ts index 38d1aa103..6e40a0844 100644 --- a/packages/orm/src/client/result-processor.ts +++ b/packages/orm/src/client/result-processor.ts @@ -1,4 +1,4 @@ -import type { BuiltinType, FieldDef, GetModels, SchemaDef } from '../schema'; +import type { BuiltinType, FieldDef, GetModels, SchemaDef } from '@zenstackhq/schema'; import { DELEGATE_JOINED_FIELD_PREFIX } from './constants'; import { getCrudDialect } from './crud/dialects'; import type { BaseCrudDialect } from './crud/dialects/base-dialect'; diff --git a/packages/orm/src/client/zod/factory.ts b/packages/orm/src/client/zod/factory.ts index 0f8b22701..77b899008 100644 --- a/packages/orm/src/client/zod/factory.ts +++ b/packages/orm/src/client/zod/factory.ts @@ -1,16 +1,16 @@ -import { enumerate, invariant, lowerCaseFirst } from '@zenstackhq/common-helpers'; -import { ZodUtils } from '@zenstackhq/zod'; -import Decimal from 'decimal.js'; -import { match, P } from 'ts-pattern'; -import { z, ZodObject, ZodType } from 'zod'; -import { AnyNullClass, DbNullClass, JsonNullClass } from '../../common-types'; +import { enumerate, invariant, lowerCaseFirst, upperCaseFirst } from '@zenstackhq/common-helpers'; import { type AttributeApplication, type BuiltinType, type FieldDef, type GetModels, type SchemaDef, -} from '../../schema'; +} from '@zenstackhq/schema'; +import { ZodUtils } from '@zenstackhq/zod'; +import Decimal from 'decimal.js'; +import { match, P } from 'ts-pattern'; +import { z, ZodObject, ZodType } from 'zod'; +import { AnyNullClass, DbNullClass, JsonNullClass } from '../../common-types'; import { extractFields } from '../../utils/object-utils'; import { AggregateOperators, FILTER_PROPERTY_TO_KIND, LOGICAL_COMBINATORS, NUMERIC_FIELD_TYPES } from '../constants'; import type { ClientContract } from '../contract'; @@ -40,7 +40,7 @@ import { type CoreCrudOperations, } from '../crud/operations/base'; import { createInternalError } from '../errors'; -import type { ClientOptions } from '../options'; +import type { ClientOptions, QueryOptions } from '../options'; import type { AnyPlugin, ExtQueryArgsBase, RuntimePlugin } from '../plugin'; import { fieldHasDefaultValue, @@ -54,25 +54,6 @@ import { } from '../query-utils'; import { cache } from './cache-decorator'; -/** - * Minimal field information needed for filter schema generation. - */ -type FieldInfo = { - name: string; - type: string; - optional?: boolean; - array?: boolean; -}; - -function toFieldInfo(def: FieldDef): FieldInfo { - return { - name: def.name, - type: def.type, - optional: def.optional, - array: def.array, - }; -} - /** * Create a factory for generating Zod schemas to validate ORM query inputs. */ @@ -91,6 +72,14 @@ export function createQuerySchemaFactory< ExtQueryArgs extends ExtQueryArgsBase = {}, >(schema: Schema, options?: Options): ZodSchemaFactory; +/** + * Create a factory using only query options (e.g. slicing) without a full client config. + */ +export function createQuerySchemaFactory( + schema: Schema, + options?: QueryOptions, +): ZodSchemaFactory; + export function createQuerySchemaFactory(clientOrSchema: any, options?: any) { return new ZodSchemaFactory(clientOrSchema, options); } @@ -114,6 +103,7 @@ export class ZodSchemaFactory< ExtQueryArgs extends ExtQueryArgsBase = {}, > { private readonly schemaCache = new Map(); + private readonly schemaRegistry = z.registry<{ id: string }>(); private readonly allFilterKinds = [...new Set(Object.values(FILTER_PROPERTY_TO_KIND))]; private readonly schema: Schema; private readonly options: Options; @@ -162,7 +152,81 @@ export class ZodSchemaFactory< // @ts-ignore private setCache(cacheKey: string, schema: ZodType) { - return this.schemaCache.set(cacheKey, schema); + this.schemaCache.set(cacheKey, schema); + } + + /** + * Builds a suffix to append to schema IDs when filter variants differ from defaults. + * Ensures different combinations of optional, array, and allowedFilterKinds produce distinct registry entries. + */ + private filterSchemaSuffix(opts: { + optional?: boolean; + array?: boolean; + withAggregations?: boolean; + allowedFilterKinds?: string[] | undefined; + }): string { + const parts: string[] = []; + if (opts.optional) parts.push('Optional'); + if (opts.array) parts.push('Array'); + if (opts.withAggregations) parts.push('Agg'); + if (opts.allowedFilterKinds) parts.push(...opts.allowedFilterKinds.slice().sort()); + return parts.length ? `${parts.join('')}` : ''; + } + + /** + * Registers a schema in the registry under the given id. + * Safe to call multiple times with the same id: first registration wins, subsequent ones are silently skipped. + */ + private registerSchema(id: string, schema: ZodType) { + if (!this.schemaRegistry.has(schema)) { + try { + this.schemaRegistry.add(schema, { id }); + } catch { + // id already taken by a different schema variant (e.g. different options) — skip + } + } + } + + /** + * Returns a JSON Schema document containing all registered Zod schemas as named definitions. + * The returned object has the shape `{ schemas: { [id]: jsonSchema } }`. + * + * Eagerly builds all top-level schemas for every model so the registry is fully populated + * before serialization. + */ + toJSONSchema() { + // Reset both the registry and the builder cache so that all eager calls + // below re-execute their bodies and re-register schemas into the fresh registry. + this.schemaCache.clear(); + this.schemaRegistry.clear(); + + // Eagerly build schemas for included models so they are registered before serialization. + for (const model of Object.keys(this.schema.models).filter((m) => this.isModelAllowed(m))) { + const m = model as GetModels; + this.makeFindUniqueSchema(m); + this.makeFindFirstSchema(m); + this.makeFindManySchema(m); + this.makeExistsSchema(m); + this.makeCreateSchema(m); + this.makeCreateManySchema(m); + this.makeCreateManyAndReturnSchema(m); + this.makeUpdateSchema(m); + this.makeUpdateManySchema(m); + this.makeUpdateManyAndReturnSchema(m); + this.makeUpsertSchema(m); + this.makeDeleteSchema(m); + this.makeDeleteManySchema(m); + this.makeCountSchema(m); + this.makeAggregateSchema(m); + this.makeGroupBySchema(m); + } + // Eagerly build args schemas for allowed procedures only. + for (const procName of Object.keys(this.schema.procedures ?? {})) { + if (this.isProcedureAllowed(procName)) { + this.makeProcedureArgsSchema(procName); + } + } + return z.toJSONSchema(this.schemaRegistry, { unrepresentable: 'any' }); } get cacheStats() { @@ -240,6 +304,7 @@ export class ZodSchemaFactory< if (!unique) { result = result.optional(); } + this.registerSchema(`${model}${upperCaseFirst(operation)}Args`, result); return result; } @@ -251,9 +316,11 @@ export class ZodSchemaFactory< const baseSchema = z.strictObject({ where: this.makeWhereSchema(model, false, false, false, options).optional(), }); - return this.mergePluginArgsSchema(baseSchema, 'exists').optional() as ZodType< + const result = this.mergePluginArgsSchema(baseSchema, 'exists').optional() as ZodType< ExistsArgs | undefined >; + this.registerSchema(`${model}ExistsArgs`, result); + return result; } private makeScalarSchema(type: string, attributes?: readonly AttributeApplication[]) { @@ -294,9 +361,9 @@ export class ZodSchemaFactory< ZodUtils.addDecimalValidation(z.string(), attributes, this.extraValidationsEnabled), ]); }) - .with('DateTime', () => z.union([z.date(), z.iso.datetime()])) + .with('DateTime', () => this.makeDateTimeValueSchema()) .with('Bytes', () => z.instanceof(Uint8Array)) - .with('Json', () => this.makeJsonValueSchema(false, false)) + .with('Json', () => this.makeJsonValueSchema()) .otherwise(() => z.unknown()); } } @@ -305,7 +372,9 @@ export class ZodSchemaFactory< private makeEnumSchema(_enum: string) { const enumDef = getEnum(this.schema, _enum); invariant(enumDef, `Enum "${_enum}" not found in schema`); - return z.enum(Object.keys(enumDef.values) as [string, ...string[]]); + const schema = z.enum(Object.keys(enumDef.values) as [string, ...string[]]); + this.registerSchema(_enum, schema); + return schema; } @cache() @@ -337,6 +406,7 @@ export class ZodSchemaFactory< } }); + this.registerSchema(type, finalSchema); return finalSchema; } @@ -380,21 +450,19 @@ export class ZodSchemaFactory< this.makeWhereSchema(fieldDef.type, false, false, false, nextOpts).optional(), ); - // optional to-one relation allows null - fieldSchema = this.nullableIf(fieldSchema, !fieldDef.array && !!fieldDef.optional); - if (fieldDef.array) { // to-many relation - fieldSchema = z.union([ - fieldSchema, - z.strictObject({ - some: fieldSchema.optional(), - every: fieldSchema.optional(), - none: fieldSchema.optional(), - }), - ]); + fieldSchema = z.strictObject({ + some: fieldSchema.optional(), + every: fieldSchema.optional(), + none: fieldSchema.optional(), + }); } else { // to-one relation + + // optional to-one relation allows null + fieldSchema = this.nullableIf(fieldSchema, !fieldDef.array && !!fieldDef.optional); + fieldSchema = z.union([ fieldSchema, z.strictObject({ @@ -406,30 +474,37 @@ export class ZodSchemaFactory< } } else { const ignoreSlicing = !!uniqueFieldNames?.includes(field); + const allowedFilterKinds = ignoreSlicing ? undefined : this.getEffectiveFilterKinds(model, field); const enumDef = getEnum(this.schema, fieldDef.type); if (enumDef) { // enum if (Object.keys(enumDef.values).length > 0) { fieldSchema = this.makeEnumFilterSchema( - model, - toFieldInfo(fieldDef), + fieldDef.type, + !!fieldDef.optional, + !!fieldDef.array, withAggregations, - ignoreSlicing, + allowedFilterKinds, ); } } else if (fieldDef.array) { // array field - fieldSchema = this.makeArrayFilterSchema(model, toFieldInfo(fieldDef)); + fieldSchema = this.makeArrayFilterSchema(fieldDef.type, allowedFilterKinds); } else if (this.isTypeDefType(fieldDef.type)) { - fieldSchema = this.makeTypedJsonFilterSchema(model, toFieldInfo(fieldDef)); + fieldSchema = this.makeTypedJsonFilterSchema( + fieldDef.type, + !!fieldDef.optional, + !!fieldDef.array, + allowedFilterKinds, + ); } else { // primitive field fieldSchema = this.makePrimitiveFilterSchema( - model, - toFieldInfo(fieldDef), + fieldDef.type as BuiltinType, + !!fieldDef.optional, withAggregations, - ignoreSlicing, + allowedFilterKinds, ); } } @@ -453,23 +528,24 @@ export class ZodSchemaFactory< let fieldSchema: ZodType; const enumDef = getEnum(this.schema, def.type); if (enumDef) { - // enum + // enum (ignoreSlicing=true → undefined allowedFilterKinds) if (Object.keys(enumDef.values).length > 0) { fieldSchema = this.makeEnumFilterSchema( - model, - toFieldInfo(def), + def.type, + !!def.optional, + !!def.array, false, - true, + undefined, ); } else { fieldSchema = z.never(); } } else { fieldSchema = this.makePrimitiveFilterSchema( - model, - toFieldInfo(def), + def.type as BuiltinType, + !!def.optional, false, - true, + undefined, ); } return [key, fieldSchema]; @@ -521,50 +597,54 @@ export class ZodSchemaFactory< } } + let schemaId = unique ? `${model}WhereUniqueInput` : `${model}WhereInput`; + if (withoutRelationFields) schemaId += 'WithoutRelation'; + if (withAggregations) schemaId += 'WithAggregation'; + this.registerSchema(schemaId, result); return result; } @cache() - private makeTypedJsonFilterSchema(contextModel: string | undefined, fieldInfo: FieldInfo) { - const field = fieldInfo.name; - const type = fieldInfo.type; - const optional = !!fieldInfo.optional; - const array = !!fieldInfo.array; - + private makeTypedJsonFilterSchema( + type: string, + optional: boolean, + array: boolean, + allowedFilterKinds: string[] | undefined, + ) { const typeDef = getTypeDef(this.schema, type); invariant(typeDef, `Type definition "${type}" not found in schema`); const candidates: ZodType[] = []; if (!array) { - // fields filter + // fields filter — typedef sub-fields are not model fields, no slicing applies const fieldSchemas: Record = {}; for (const [fieldName, fieldDef] of Object.entries(typeDef.fields)) { if (this.isTypeDefType(fieldDef.type)) { - // recursive typed JSON - use same model/field for nested typed JSON fieldSchemas[fieldName] = this.makeTypedJsonFilterSchema( - contextModel, - toFieldInfo(fieldDef), + fieldDef.type, + !!fieldDef.optional, + !!fieldDef.array, + undefined, ).optional(); } else { - // enum, array, primitives const enumDef = getEnum(this.schema, fieldDef.type); if (enumDef) { fieldSchemas[fieldName] = this.makeEnumFilterSchema( - contextModel, - toFieldInfo(fieldDef), + fieldDef.type, + !!fieldDef.optional, + !!fieldDef.array, false, + undefined, ).optional(); } else if (fieldDef.array) { - fieldSchemas[fieldName] = this.makeArrayFilterSchema( - contextModel, - toFieldInfo(fieldDef), - ).optional(); + fieldSchemas[fieldName] = this.makeArrayFilterSchema(fieldDef.type, undefined).optional(); } else { fieldSchemas[fieldName] = this.makePrimitiveFilterSchema( - contextModel, - toFieldInfo(fieldDef), + fieldDef.type as BuiltinType, + !!fieldDef.optional, false, + undefined, ).optional(); } } @@ -574,7 +654,7 @@ export class ZodSchemaFactory< } const recursiveSchema = z - .lazy(() => this.makeTypedJsonFilterSchema(contextModel, { name: field, type, optional, array: false })) + .lazy(() => this.makeTypedJsonFilterSchema(type, optional, false, allowedFilterKinds)) .optional(); if (array) { // array filter @@ -596,7 +676,7 @@ export class ZodSchemaFactory< } // plain json filter - candidates.push(this.makeJsonFilterSchema(contextModel, field, optional)); + candidates.push(this.makeJsonFilterSchema(optional, allowedFilterKinds)); if (optional) { // allow null and null sentinel values @@ -607,7 +687,9 @@ export class ZodSchemaFactory< } // either plain json filter or field filters - return z.union(candidates); + const result = z.union(candidates); + this.registerSchema(`${type}Filter${this.filterSchemaSuffix({ optional, array, allowedFilterKinds })}`, result); + return result; } // For optional typed JSON fields, allow DbNull, JsonNull, and null. @@ -641,45 +723,55 @@ export class ZodSchemaFactory< @cache() private makeEnumFilterSchema( - model: string | undefined, - fieldInfo: FieldInfo, + enumName: string, + optional: boolean, + array: boolean, withAggregations: boolean, - ignoreSlicing: boolean = false, + allowedFilterKinds: string[] | undefined, ) { - const enumName = fieldInfo.type; - const optional = !!fieldInfo.optional; - const array = !!fieldInfo.array; - const enumDef = getEnum(this.schema, enumName); invariant(enumDef, `Enum "${enumName}" not found in schema`); const baseSchema = z.enum(Object.keys(enumDef.values) as [string, ...string[]]); + let schema: ZodType; if (array) { - return this.internalMakeArrayFilterSchema(model, fieldInfo.name, baseSchema); + schema = this.internalMakeArrayFilterSchema(baseSchema, allowedFilterKinds); + } else { + const components = this.makeCommonPrimitiveFilterComponents( + baseSchema, + optional, + () => + z.lazy(() => + this.makeEnumFilterSchema(enumName, optional, array, withAggregations, allowedFilterKinds), + ), + ['equals', 'in', 'notIn', 'not'], + withAggregations ? ['_count', '_min', '_max'] : undefined, + allowedFilterKinds, + ); + + schema = this.createUnionFilterSchema(baseSchema, optional, components, allowedFilterKinds); } - const allowedFilterKinds = ignoreSlicing ? undefined : this.getEffectiveFilterKinds(model, fieldInfo.name); - const components = this.makeCommonPrimitiveFilterComponents( - baseSchema, - optional, - () => z.lazy(() => this.makeEnumFilterSchema(model, fieldInfo, withAggregations)), - ['equals', 'in', 'notIn', 'not'], - withAggregations ? ['_count', '_min', '_max'] : undefined, - allowedFilterKinds, + this.registerSchema( + `${enumName}Filter${this.filterSchemaSuffix({ optional, array, allowedFilterKinds, withAggregations })}`, + schema, ); - - return this.createUnionFilterSchema(baseSchema, optional, components, allowedFilterKinds); + return schema; } @cache() - private makeArrayFilterSchema(model: string | undefined, fieldInfo: FieldInfo) { - return this.internalMakeArrayFilterSchema( - model, - fieldInfo.name, - this.makeScalarSchema(fieldInfo.type as BuiltinType), + @cache() + private makeArrayFilterSchema(fieldType: string, allowedFilterKinds: string[] | undefined) { + const schema = this.internalMakeArrayFilterSchema( + this.makeScalarSchema(fieldType as BuiltinType), + allowedFilterKinds, + ); + this.registerSchema( + `${fieldType}ArrayFilter${this.filterSchemaSuffix({ array: true, allowedFilterKinds })}`, + schema, ); + return schema; } - private internalMakeArrayFilterSchema(contextModel: string | undefined, field: string, elementSchema: ZodType) { - const allowedFilterKinds = this.getEffectiveFilterKinds(contextModel, field); + private internalMakeArrayFilterSchema(elementSchema: ZodType, allowedFilterKinds: string[] | undefined) { const operators = { equals: elementSchema.array().optional(), has: elementSchema.optional(), @@ -696,84 +788,75 @@ export class ZodSchemaFactory< @cache() private makePrimitiveFilterSchema( - contextModel: string | undefined, - fieldInfo: FieldInfo, + type: BuiltinType, + optional: boolean, withAggregations: boolean, - ignoreSlicing = false, + allowedFilterKinds: string[] | undefined, ) { - const allowedFilterKinds = ignoreSlicing - ? undefined - : this.getEffectiveFilterKinds(contextModel, fieldInfo.name); - const type = fieldInfo.type as BuiltinType; - const optional = !!fieldInfo.optional; return match(type) .with('String', () => this.makeStringFilterSchema(optional, withAggregations, allowedFilterKinds)) .with(P.union('Int', 'Float', 'Decimal', 'BigInt'), (type) => - this.makeNumberFilterSchema( - this.makeScalarSchema(type), - optional, - withAggregations, - allowedFilterKinds, - ), + this.makeNumberFilterSchema(type, optional, withAggregations, allowedFilterKinds), ) .with('Boolean', () => this.makeBooleanFilterSchema(optional, withAggregations, allowedFilterKinds)) .with('DateTime', () => this.makeDateTimeFilterSchema(optional, withAggregations, allowedFilterKinds)) .with('Bytes', () => this.makeBytesFilterSchema(optional, withAggregations, allowedFilterKinds)) - .with('Json', () => this.makeJsonFilterSchema(contextModel, fieldInfo.name, optional)) + .with('Json', () => this.makeJsonFilterSchema(optional, allowedFilterKinds)) .with('Unsupported', () => z.never()) .exhaustive(); } - private makeJsonValueSchema(nullable: boolean, forFilter: boolean): ZodType { - const options: ZodType[] = [z.string(), z.number(), z.boolean(), z.instanceof(JsonNullClass)]; - - if (forFilter) { - options.push(z.instanceof(DbNullClass)); - } else { - if (nullable) { - // for mutation, allow DbNull only if nullable - options.push(z.instanceof(DbNullClass)); - } - } - - if (forFilter) { - options.push(z.instanceof(AnyNullClass)); - } - + @cache() + private makeJsonValueSchema(): ZodType { const schema = z.union([ - ...options, - z.lazy(() => z.union([this.makeJsonValueSchema(false, false), z.null()]).array()), + z.string(), + z.number(), + z.boolean(), + z.instanceof(JsonNullClass), + z.lazy(() => z.union([this.makeJsonValueSchema(), z.null()]).array()), z.record( z.string(), - z.lazy(() => z.union([this.makeJsonValueSchema(false, false), z.null()])), + z.lazy(() => z.union([this.makeJsonValueSchema(), z.null()])), ), ]); - return this.nullableIf(schema, nullable); + this.registerSchema('JsonValue', schema); + return schema; } @cache() - private makeJsonFilterSchema(contextModel: string | undefined, field: string, optional: boolean) { - const allowedFilterKinds = this.getEffectiveFilterKinds(contextModel, field); - + private makeJsonFilterSchema(optional: boolean, allowedFilterKinds: string[] | undefined) { // Check if Json filter kind is allowed if (allowedFilterKinds && !allowedFilterKinds.includes('Json')) { // Return a never schema if Json filters are not allowed return z.never(); } - const valueSchema = this.makeJsonValueSchema(optional, true); - return z.strictObject({ + // Extend the base JsonValue with filter-only null sentinels, flattened into one union + const jsonValue = this.makeJsonValueSchema(); + const filterMembers: ZodType[] = [jsonValue, z.instanceof(DbNullClass), z.instanceof(AnyNullClass)]; + if (optional) filterMembers.push(z.null()); + const filterValueSchema = z.union(filterMembers as [ZodType, ZodType, ...ZodType[]]); + const schema = z.strictObject({ path: z.string().optional(), - equals: valueSchema.optional(), - not: valueSchema.optional(), + equals: filterValueSchema.optional(), + not: filterValueSchema.optional(), string_contains: z.string().optional(), string_starts_with: z.string().optional(), string_ends_with: z.string().optional(), mode: this.makeStringModeSchema().optional(), - array_contains: valueSchema.optional(), - array_starts_with: valueSchema.optional(), - array_ends_with: valueSchema.optional(), + array_contains: filterValueSchema.optional(), + array_starts_with: filterValueSchema.optional(), + array_ends_with: filterValueSchema.optional(), }); + this.registerSchema(`JsonFilter${this.filterSchemaSuffix({ optional, allowedFilterKinds })}`, schema); + return schema; + } + + @cache() + private makeDateTimeValueSchema(): ZodType { + const schema = z.union([z.iso.datetime(), z.date()]); + this.registerSchema('DateTime', schema); + return schema; } @cache() @@ -782,13 +865,18 @@ export class ZodSchemaFactory< withAggregations: boolean, allowedFilterKinds: string[] | undefined, ): ZodType { - return this.makeCommonPrimitiveFilterSchema( - z.union([z.iso.datetime(), z.date()]), + const schema = this.makeCommonPrimitiveFilterSchema( + this.makeDateTimeValueSchema(), optional, () => z.lazy(() => this.makeDateTimeFilterSchema(optional, withAggregations, allowedFilterKinds)), withAggregations ? ['_count', '_min', '_max'] : undefined, allowedFilterKinds, ); + this.registerSchema( + `DateTimeFilter${this.filterSchemaSuffix({ optional, allowedFilterKinds, withAggregations })}`, + schema, + ); + return schema; } @cache() @@ -806,7 +894,12 @@ export class ZodSchemaFactory< allowedFilterKinds, ); - return this.createUnionFilterSchema(z.boolean(), optional, components, allowedFilterKinds); + const schema = this.createUnionFilterSchema(z.boolean(), optional, components, allowedFilterKinds); + this.registerSchema( + `BooleanFilter${this.filterSchemaSuffix({ optional, allowedFilterKinds, withAggregations })}`, + schema, + ); + return schema; } @cache() @@ -825,7 +918,12 @@ export class ZodSchemaFactory< allowedFilterKinds, ); - return this.createUnionFilterSchema(baseSchema, optional, components, allowedFilterKinds); + const schema = this.createUnionFilterSchema(baseSchema, optional, components, allowedFilterKinds); + this.registerSchema( + `BytesFilter${this.filterSchemaSuffix({ optional, allowedFilterKinds, withAggregations })}`, + schema, + ); + return schema; } private makeCommonPrimitiveFilterComponents( @@ -849,7 +947,7 @@ export class ZodSchemaFactory< between: baseSchema.array().length(2).optional(), not: makeThis().optional(), ...(withAggregations?.includes('_count') - ? { _count: this.makeNumberFilterSchema(z.number().int(), false, false, undefined).optional() } + ? { _count: this.makeNumberFilterSchema('Int', false, false, undefined).optional() } : {}), ...(withAggregations?.includes('_avg') ? { _avg: commonAggSchema() } : {}), ...(withAggregations?.includes('_sum') ? { _sum: commonAggSchema() } : {}), @@ -886,21 +984,28 @@ export class ZodSchemaFactory< return this.createUnionFilterSchema(baseSchema, optional, components, allowedFilterKinds); } + @cache() private makeNumberFilterSchema( - baseSchema: ZodType, + type: 'Int' | 'Float' | 'Decimal' | 'BigInt', optional: boolean, withAggregations: boolean, allowedFilterKinds: string[] | undefined, ): ZodType { - return this.makeCommonPrimitiveFilterSchema( - baseSchema, + const schema = this.makeCommonPrimitiveFilterSchema( + this.makeScalarSchema(type), optional, - () => z.lazy(() => this.makeNumberFilterSchema(baseSchema, optional, withAggregations, allowedFilterKinds)), + () => z.lazy(() => this.makeNumberFilterSchema(type, optional, withAggregations, allowedFilterKinds)), withAggregations ? ['_count', '_avg', '_sum', '_min', '_max'] : undefined, allowedFilterKinds, ); + this.registerSchema( + `${type}Filter${this.filterSchemaSuffix({ optional, allowedFilterKinds, withAggregations })}`, + schema, + ); + return schema; } + @cache() private makeStringFilterSchema( optional: boolean, withAggregations: boolean, @@ -934,7 +1039,12 @@ export class ZodSchemaFactory< ...filteredStringOperators, }; - return this.createUnionFilterSchema(z.string(), optional, allComponents, allowedFilterKinds); + const schema = this.createUnionFilterSchema(z.string(), optional, allComponents, allowedFilterKinds); + this.registerSchema( + `StringFilter${this.filterSchemaSuffix({ optional, allowedFilterKinds, withAggregations })}`, + schema, + ); + return schema; } private makeStringModeSchema() { @@ -967,7 +1077,9 @@ export class ZodSchemaFactory< this.addExtResultFields(model, fields); - return z.strictObject(fields); + const result = z.strictObject(fields); + this.registerSchema(`${model}Select`, result); + return result; } @cache() @@ -976,7 +1088,7 @@ export class ZodSchemaFactory< const toManyRelations = Object.values(modelDef.fields).filter((def) => def.relation && def.array); if (toManyRelations.length > 0) { const nextOpts = this.nextOptions(options); - return z + const schema = z .union([ z.literal(true), z.strictObject({ @@ -1005,6 +1117,8 @@ export class ZodSchemaFactory< }), ]) .optional(); + this.registerSchema(`${model}CountSelection`, schema); + return schema; } else { return z.never(); } @@ -1053,7 +1167,9 @@ export class ZodSchemaFactory< objSchema = this.refineForSelectOmitMutuallyExclusive(objSchema); objSchema = this.refineForSelectHasTruthyField(objSchema); - return z.union([z.boolean(), objSchema]); + const result = z.union([z.boolean(), objSchema]); + this.registerSchema(`${model}${upperCaseFirst(field)}RelationInput`, result); + return result; } @cache() @@ -1073,7 +1189,9 @@ export class ZodSchemaFactory< this.addExtResultFields(model, fields); - return z.strictObject(fields); + const result = z.strictObject(fields); + this.registerSchema(`${model}OmitInput`, result); + return result; } private addExtResultFields(model: string, fields: Record) { @@ -1114,7 +1232,9 @@ export class ZodSchemaFactory< } } - return z.strictObject(fields); + const result = z.strictObject(fields); + this.registerSchema(`${model}Include`, result); + return result; } @cache() @@ -1135,19 +1255,21 @@ export class ZodSchemaFactory< if (fieldDef.relation) { // relations if (withRelation && this.shouldIncludeRelations(options)) { - fields[field] = z.lazy(() => { - let relationOrderBy = this.makeOrderBySchema( - fieldDef.type, - withRelation, - WithAggregation, - nextOpts, - ); - if (fieldDef.array) { - // safeExtend drops existing refinements, so re-apply after extending - relationOrderBy = refineAtMostOneKey(relationOrderBy.safeExtend({ _count: sort })); - } - return relationOrderBy.optional(); - }); + fields[field] = z + .lazy(() => { + let relationOrderBy = this.makeOrderBySchema( + fieldDef.type, + withRelation, + WithAggregation, + nextOpts, + ); + if (fieldDef.array) { + // safeExtend drops existing refinements, so re-apply after extending + relationOrderBy = refineAtMostOneKey(relationOrderBy.safeExtend({ _count: sort })); + } + return relationOrderBy; + }) + .optional(); } } else { // scalars @@ -1175,7 +1297,14 @@ export class ZodSchemaFactory< } } - return refineAtMostOneKey(z.strictObject(fields)); + const schema = refineAtMostOneKey(z.strictObject(fields)); + + let schemaId = `${model}OrderBy`; + if (withRelation) schemaId += 'WithRelation'; + if (WithAggregation) schemaId += 'WithAggregation'; + schemaId += 'Input'; + this.registerSchema(schemaId, schema); + return schema; } @cache() @@ -1183,12 +1312,16 @@ export class ZodSchemaFactory< const nonRelationFields = this.getModelFields(model) .filter(([, def]) => !def.relation) .map(([name]) => name); - return nonRelationFields.length > 0 ? this.orArray(z.enum(nonRelationFields as any), true) : z.never(); + const schema = nonRelationFields.length > 0 ? this.orArray(z.enum(nonRelationFields as any), true) : z.never(); + this.registerSchema(`${model}DistinctInput`, schema); + return schema; } + @cache() private makeCursorSchema(model: string, options?: CreateSchemaOptions) { - // `makeWhereSchema` is already cached - return this.makeWhereSchema(model, true, true, false, options).optional(); + const schema = this.makeWhereSchema(model, true, true, false, options).optional(); + this.registerSchema(`${model}CursorInput`, schema); + return schema; } // #endregion @@ -1211,6 +1344,7 @@ export class ZodSchemaFactory< schema = this.refineForSelectIncludeMutuallyExclusive(schema); schema = this.refineForSelectOmitMutuallyExclusive(schema); schema = this.refineForSelectHasTruthyField(schema); + this.registerSchema(`${model}CreateArgs`, schema); return schema as ZodType>; } @@ -1219,10 +1353,12 @@ export class ZodSchemaFactory< model: Model, options?: CreateSchemaOptions, ): ZodType> { - return this.mergePluginArgsSchema( + const result = this.mergePluginArgsSchema( this.makeCreateManyPayloadSchema(model, [], options), 'createMany', ) as unknown as ZodType>; + this.registerSchema(`${model}CreateManyArgs`, result); + return result; } @cache() @@ -1236,9 +1372,11 @@ export class ZodSchemaFactory< omit: this.makeOmitSchema(model).optional().nullable(), }); result = this.mergePluginArgsSchema(result, 'createManyAndReturn'); - return this.refineForSelectHasTruthyField( + const schema = this.refineForSelectHasTruthyField( this.refineForSelectOmitMutuallyExclusive(result), ).optional() as ZodType>; + this.registerSchema(`${model}CreateManyAndReturnArgs`, schema); + return schema; } @cache() @@ -1362,16 +1500,21 @@ export class ZodSchemaFactory< ? ZodUtils.addCustomValidation(z.strictObject(checkedVariantFields), modelDef.attributes) : z.strictObject(checkedVariantFields); - if (!hasRelation) { - return this.orArray(uncheckedCreateSchema, canBeArray); - } else { - return z.union([ - uncheckedCreateSchema, - checkedCreateSchema, - ...(canBeArray ? [z.array(uncheckedCreateSchema)] : []), - ...(canBeArray ? [z.array(checkedCreateSchema)] : []), - ]); - } + const result = !hasRelation + ? this.orArray(uncheckedCreateSchema, canBeArray) + : z.union([ + uncheckedCreateSchema, + checkedCreateSchema, + ...(canBeArray ? [z.array(uncheckedCreateSchema)] : []), + ...(canBeArray ? [z.array(checkedCreateSchema)] : []), + ]); + + const idParts = [`${model}CreateData`]; + if (canBeArray) idParts.push('Array'); + if (withoutRelationFields) idParts.push('WithoutRelation'); + if (withoutFields.length) idParts.push(`Without${withoutFields.slice().sort().join('')}`); + this.registerSchema(idParts.join(''), result); + return result; } @cache() @@ -1525,10 +1668,14 @@ export class ZodSchemaFactory< @cache() private makeCreateManyPayloadSchema(model: string, withoutFields: string[], options?: CreateSchemaOptions) { - return z.strictObject({ + const schema = z.strictObject({ data: this.makeCreateDataSchema(model, true, withoutFields, true, options), skipDuplicates: z.boolean().optional(), }); + const idParts = [`${model}CreateManyPayload`]; + if (withoutFields.length) idParts.push(`Without${withoutFields.slice().sort().join('')}`); + this.registerSchema(idParts.join(''), schema); + return schema; } // #endregion @@ -1551,6 +1698,7 @@ export class ZodSchemaFactory< schema = this.refineForSelectIncludeMutuallyExclusive(schema); schema = this.refineForSelectOmitMutuallyExclusive(schema); schema = this.refineForSelectHasTruthyField(schema); + this.registerSchema(`${model}UpdateArgs`, schema); return schema as ZodType>; } @@ -1559,7 +1707,7 @@ export class ZodSchemaFactory< model: Model, options?: CreateSchemaOptions, ): ZodType> { - return this.mergePluginArgsSchema( + const result = this.mergePluginArgsSchema( z.strictObject({ where: this.makeWhereSchema(model, false, false, false, options).optional(), data: this.makeUpdateDataSchema(model, [], true, options), @@ -1567,6 +1715,8 @@ export class ZodSchemaFactory< }), 'updateMany', ) as unknown as ZodType>; + this.registerSchema(`${model}UpdateManyArgs`, result); + return result; } @cache() @@ -1582,6 +1732,7 @@ export class ZodSchemaFactory< }); schema = this.refineForSelectOmitMutuallyExclusive(schema); schema = this.refineForSelectHasTruthyField(schema); + this.registerSchema(`${model}UpdateManyAndReturnArgs`, schema); return schema as ZodType>; } @@ -1602,6 +1753,7 @@ export class ZodSchemaFactory< schema = this.refineForSelectIncludeMutuallyExclusive(schema); schema = this.refineForSelectOmitMutuallyExclusive(schema); schema = this.refineForSelectHasTruthyField(schema); + this.registerSchema(`${model}UpsertArgs`, schema); return schema as ZodType>; } @@ -1724,11 +1876,13 @@ export class ZodSchemaFactory< const checkedUpdateSchema = this.extraValidationsEnabled ? ZodUtils.addCustomValidation(z.strictObject(checkedVariantFields), modelDef.attributes) : z.strictObject(checkedVariantFields); - if (!hasRelation) { - return uncheckedUpdateSchema; - } else { - return z.union([uncheckedUpdateSchema, checkedUpdateSchema]); - } + const result = !hasRelation ? uncheckedUpdateSchema : z.union([uncheckedUpdateSchema, checkedUpdateSchema]); + + const idParts = [`${model}UpdateData`]; + if (withoutRelationFields) idParts.push('WithoutRelation'); + if (withoutFields.length) idParts.push(`Without${withoutFields.slice().sort().join('')}`); + this.registerSchema(idParts.join(''), result); + return result; } // #endregion @@ -1750,6 +1904,7 @@ export class ZodSchemaFactory< schema = this.refineForSelectIncludeMutuallyExclusive(schema); schema = this.refineForSelectOmitMutuallyExclusive(schema); schema = this.refineForSelectHasTruthyField(schema); + this.registerSchema(`${model}DeleteArgs`, schema); return schema as ZodType>; } @@ -1758,13 +1913,15 @@ export class ZodSchemaFactory< model: Model, options?: CreateSchemaOptions, ): ZodType | undefined> { - return this.mergePluginArgsSchema( + const result = this.mergePluginArgsSchema( z.strictObject({ where: this.makeWhereSchema(model, false, false, false, options).optional(), limit: z.number().int().nonnegative().optional(), }), 'deleteMany', ).optional() as unknown as ZodType | undefined>; + this.registerSchema(`${model}DeleteManyArgs`, result); + return result; } // #endregion @@ -1776,7 +1933,7 @@ export class ZodSchemaFactory< model: Model, options?: CreateSchemaOptions, ): ZodType | undefined> { - return this.mergePluginArgsSchema( + const result = this.mergePluginArgsSchema( z.strictObject({ where: this.makeWhereSchema(model, false, false, false, options).optional(), skip: this.makeSkipSchema().optional(), @@ -1786,11 +1943,13 @@ export class ZodSchemaFactory< }), 'count', ).optional() as ZodType | undefined>; + this.registerSchema(`${model}CountArgs`, result); + return result; } @cache() private makeCountAggregateInputSchema(model: string) { - return z.union([ + const schema = z.union([ z.literal(true), z.strictObject({ _all: z.literal(true).optional(), @@ -1803,6 +1962,8 @@ export class ZodSchemaFactory< ), }), ]); + this.registerSchema(`${model}CountAggregateInput`, schema); + return schema; } // #endregion @@ -1813,8 +1974,8 @@ export class ZodSchemaFactory< makeAggregateSchema>( model: Model, options?: CreateSchemaOptions, - ): ZodType | undefined> { - return this.mergePluginArgsSchema( + ): ZodType> { + const result = this.mergePluginArgsSchema( z.strictObject({ where: this.makeWhereSchema(model, false, false, false, options).optional(), skip: this.makeSkipSchema().optional(), @@ -1827,12 +1988,14 @@ export class ZodSchemaFactory< _max: this.makeMinMaxInputSchema(model).optional(), }), 'aggregate', - ).optional() as ZodType | undefined>; + ) as unknown as ZodType>; + this.registerSchema(`${model}AggregateArgs`, result); + return result; } @cache() private makeSumAvgInputSchema(model: string) { - return z.strictObject( + const schema = z.strictObject( this.getModelFields(model).reduce( (acc, [field, fieldDef]) => { if (this.isNumericField(fieldDef)) { @@ -1843,11 +2006,13 @@ export class ZodSchemaFactory< {} as Record, ), ); + this.registerSchema(`${model}SumAvgAggregateInput`, schema); + return schema; } @cache() private makeMinMaxInputSchema(model: string) { - return z.strictObject( + const schema = z.strictObject( this.getModelFields(model).reduce( (acc, [field, fieldDef]) => { if (!fieldDef.relation && !fieldDef.array) { @@ -1858,6 +2023,8 @@ export class ZodSchemaFactory< {} as Record, ), ); + this.registerSchema(`${model}MinMaxAggregateInput`, schema); + return schema; } // #endregion @@ -1936,6 +2103,7 @@ export class ZodSchemaFactory< return true; }, 'fields in "orderBy" must be in "by"'); + this.registerSchema(`${model}GroupByArgs`, schema); return schema as ZodType>; } @@ -1956,15 +2124,32 @@ export class ZodSchemaFactory< return true; } + @cache() private makeHavingSchema(model: string, options?: CreateSchemaOptions) { - // `makeWhereSchema` is cached - return this.makeWhereSchema(model, false, true, true, options); + const schema = this.makeWhereSchema(model, false, true, true, options); + this.registerSchema(`${model}HavingInput`, schema); + return schema; } // #endregion // #region Procedures + @cache() + makeProcedureArgsSchema(procName: string): ZodType { + const procDef = (this.schema.procedures ?? {})[procName]; + if (!procDef) { + throw createInternalError(`Procedure not found: ${procName}`); + } + const shape: Record = {}; + for (const param of Object.values(procDef.params ?? {})) { + shape[param.name] = this.makeProcedureParamSchema(param); + } + const schema = z.object(shape); + this.registerSchema(`${procName}ProcArgs`, schema); + return schema; + } + @cache() makeProcedureParamSchema( param: { type: string; array?: boolean; optional?: boolean }, @@ -2312,6 +2497,29 @@ export class ZodSchemaFactory< return true; } + private isProcedureAllowed(procName: string): boolean { + const slicing = this.options.slicing; + if (!slicing) { + return true; + } + + const { includedProcedures, excludedProcedures } = slicing; + + if (includedProcedures !== undefined) { + if (!(includedProcedures as readonly string[]).includes(procName)) { + return false; + } + } + + if (excludedProcedures !== undefined) { + if ((excludedProcedures as readonly string[]).includes(procName)) { + return false; + } + } + + return true; + } + // #endregion } diff --git a/packages/orm/src/client/zod/index.ts b/packages/orm/src/client/zod/index.ts index 63e947e57..8d99f9d09 100644 --- a/packages/orm/src/client/zod/index.ts +++ b/packages/orm/src/client/zod/index.ts @@ -1 +1 @@ -export { createQuerySchemaFactory } from './factory'; +export { createQuerySchemaFactory, type ZodSchemaFactory } from './factory'; diff --git a/packages/orm/src/common-types.ts b/packages/orm/src/common-types.ts index 39caafb69..830036e41 100644 --- a/packages/orm/src/common-types.ts +++ b/packages/orm/src/common-types.ts @@ -1,6 +1,6 @@ export type JsonValue = string | number | boolean | JsonObject | JsonArray; export type JsonObject = { [key: string]: JsonValue | null }; -export type JsonArray = ReadonlyArray; +export type JsonArray = Array; export type JsonNullValues = DbNull | JsonNull | AnyNull; export class DbNullClass { diff --git a/packages/orm/src/utils/schema-utils.ts b/packages/orm/src/utils/schema-utils.ts index 17fb31495..ece5f215c 100644 --- a/packages/orm/src/utils/schema-utils.ts +++ b/packages/orm/src/utils/schema-utils.ts @@ -11,7 +11,7 @@ import type { NullExpression, ThisExpression, UnaryExpression, -} from '../schema'; +} from '@zenstackhq/schema'; export type VisitResult = void | { abort: true }; diff --git a/packages/orm/tsup.config.ts b/packages/orm/tsdown.config.ts similarity index 64% rename from packages/orm/tsup.config.ts rename to packages/orm/tsdown.config.ts index 8318a0491..711b8ce24 100644 --- a/packages/orm/tsup.config.ts +++ b/packages/orm/tsdown.config.ts @@ -1,6 +1,6 @@ -import { defineConfig } from 'tsup'; +import { createConfig } from '@zenstackhq/tsdown-config'; -export default defineConfig({ +export default createConfig({ entry: { index: 'src/index.ts', schema: 'src/schema.ts', @@ -10,10 +10,4 @@ export default defineConfig({ 'dialects/mysql': 'src/dialects/mysql.ts', 'dialects/sql.js': 'src/dialects/sql.js/index.ts', }, - outDir: 'dist', - splitting: false, - sourcemap: true, - clean: true, - dts: true, - format: ['cjs', 'esm'], }); diff --git a/packages/plugins/policy/package.json b/packages/plugins/policy/package.json index f4c683dad..485dcb3ef 100644 --- a/packages/plugins/policy/package.json +++ b/packages/plugins/policy/package.json @@ -2,7 +2,7 @@ "name": "@zenstackhq/plugin-policy", "displayName": "ZenStack Access Policy Plugin", "description": "ZenStack plugin that enforces access control policies defined in the schema", - "version": "3.5.6", + "version": "3.6.0", "type": "module", "author": { "name": "ZenStack Team", @@ -15,8 +15,8 @@ }, "license": "MIT", "scripts": { - "build": "tsc --noEmit && tsup-node", - "watch": "tsup-node --watch", + "build": "tsc --noEmit && tsdown", + "watch": "tsdown --watch", "lint": "eslint src --ext ts", "pack": "pnpm pack" }, @@ -28,8 +28,8 @@ "exports": { ".": { "import": { - "types": "./dist/index.d.ts", - "default": "./dist/index.js" + "types": "./dist/index.d.mts", + "default": "./dist/index.mjs" }, "require": { "types": "./dist/index.d.cts", @@ -57,6 +57,7 @@ "@types/better-sqlite3": "catalog:", "@types/pg": "^8.0.0", "@zenstackhq/eslint-config": "workspace:*", + "@zenstackhq/tsdown-config": "workspace:*", "@zenstackhq/typescript-config": "workspace:*", "@zenstackhq/vitest-config": "workspace:*" }, diff --git a/packages/plugins/policy/tsdown.config.ts b/packages/plugins/policy/tsdown.config.ts new file mode 100644 index 000000000..e0a6d5624 --- /dev/null +++ b/packages/plugins/policy/tsdown.config.ts @@ -0,0 +1,3 @@ +import { createConfig } from '@zenstackhq/tsdown-config'; + +export default createConfig({ entry: { index: 'src/index.ts' } }); diff --git a/packages/plugins/policy/tsup.config.ts b/packages/plugins/policy/tsup.config.ts deleted file mode 100644 index 4b7a3428c..000000000 --- a/packages/plugins/policy/tsup.config.ts +++ /dev/null @@ -1,12 +0,0 @@ -import { defineConfig } from 'tsup'; - -export default defineConfig({ - entry: { - index: 'src/index.ts', - }, - outDir: 'dist', - splitting: false, - sourcemap: true, - dts: true, - format: ['cjs', 'esm'], -}); diff --git a/packages/schema/package.json b/packages/schema/package.json index 70309d84e..6c40b0180 100644 --- a/packages/schema/package.json +++ b/packages/schema/package.json @@ -2,7 +2,7 @@ "name": "@zenstackhq/schema", "displayName": "ZenStack Schema Object Model", "description": "TypeScript representation of ZModel schema", - "version": "3.5.6", + "version": "3.6.0", "type": "module", "author": { "name": "ZenStack Team", @@ -15,8 +15,8 @@ }, "license": "MIT", "scripts": { - "build": "tsc --noEmit && tsup-node", - "watch": "tsup-node --watch", + "build": "tsc --noEmit && tsdown", + "watch": "tsdown --watch", "lint": "eslint src --ext ts", "test": "vitest run", "pack": "pnpm pack", @@ -29,8 +29,8 @@ "exports": { ".": { "import": { - "types": "./dist/index.d.ts", - "default": "./dist/index.js" + "types": "./dist/index.d.mts", + "default": "./dist/index.mjs" }, "require": { "types": "./dist/index.d.cts", @@ -47,6 +47,7 @@ }, "devDependencies": { "@zenstackhq/eslint-config": "workspace:*", + "@zenstackhq/tsdown-config": "workspace:*", "@zenstackhq/typescript-config": "workspace:*", "@zenstackhq/vitest-config": "workspace:*" }, diff --git a/packages/schema/tsdown.config.ts b/packages/schema/tsdown.config.ts new file mode 100644 index 000000000..e0a6d5624 --- /dev/null +++ b/packages/schema/tsdown.config.ts @@ -0,0 +1,3 @@ +import { createConfig } from '@zenstackhq/tsdown-config'; + +export default createConfig({ entry: { index: 'src/index.ts' } }); diff --git a/packages/schema/tsup.config.ts b/packages/schema/tsup.config.ts deleted file mode 100644 index 5a74a9dd1..000000000 --- a/packages/schema/tsup.config.ts +++ /dev/null @@ -1,13 +0,0 @@ -import { defineConfig } from 'tsup'; - -export default defineConfig({ - entry: { - index: 'src/index.ts', - }, - outDir: 'dist', - splitting: false, - sourcemap: true, - clean: true, - dts: true, - format: ['cjs', 'esm'], -}); diff --git a/packages/sdk/package.json b/packages/sdk/package.json index 5a82edf81..157175ca6 100644 --- a/packages/sdk/package.json +++ b/packages/sdk/package.json @@ -2,7 +2,7 @@ "name": "@zenstackhq/sdk", "displayName": "ZenStack SDK", "description": "Utilities for building ZenStack plugins", - "version": "3.5.6", + "version": "3.6.0", "type": "module", "author": { "name": "ZenStack Team", @@ -15,8 +15,8 @@ }, "license": "MIT", "scripts": { - "build": "tsc --noEmit && tsup-node", - "watch": "tsup-node --watch", + "build": "tsc --noEmit && tsdown", + "watch": "tsdown --watch", "lint": "eslint src --ext ts", "pack": "pnpm pack" }, @@ -27,8 +27,8 @@ "exports": { ".": { "import": { - "types": "./dist/index.d.ts", - "default": "./dist/index.js" + "types": "./dist/index.d.mts", + "default": "./dist/index.mjs" }, "require": { "types": "./dist/index.d.cts", @@ -37,8 +37,8 @@ }, "./ast": { "import": { - "types": "./dist/ast.d.ts", - "default": "./dist/ast.js" + "types": "./dist/ast.d.mts", + "default": "./dist/ast.mjs" }, "require": { "types": "./dist/ast.d.cts", @@ -55,9 +55,11 @@ }, "devDependencies": { "@zenstackhq/eslint-config": "workspace:*", + "@zenstackhq/tsdown-config": "workspace:*", "@zenstackhq/typescript-config": "workspace:*", "decimal.js": "catalog:", - "kysely": "catalog:" + "kysely": "catalog:", + "@types/node": "catalog:" }, "funding": "https://github.com/sponsors/zenstackhq" } diff --git a/packages/sdk/src/ts-schema-generator.ts b/packages/sdk/src/ts-schema-generator.ts index fda31fe97..d533c93d9 100644 --- a/packages/sdk/src/ts-schema-generator.ts +++ b/packages/sdk/src/ts-schema-generator.ts @@ -453,7 +453,9 @@ export class TsSchemaGenerator { ...(dm.isView ? [ts.factory.createPropertyAssignment('isView', ts.factory.createTrue())] : []), ]; - const computedFields = dm.fields.filter((f) => hasAttribute(f, '@computed')); + const computedFields = allFields.filter( + (f) => hasAttribute(f, '@computed') && !getDelegateOriginModel(f, dm), + ); if (computedFields.length > 0) { fields.push( @@ -707,10 +709,12 @@ export class TsSchemaGenerator { } if (isDataModel(field.type.reference?.ref)) { - objectFields.push(ts.factory.createPropertyAssignment('relation', this.createRelationObject(field))); + objectFields.push( + ts.factory.createPropertyAssignment('relation', this.createRelationObject(field, contextModel)), + ); } - const fkFor = this.getForeignKeyFor(field); + const fkFor = this.getForeignKeyFor(field, contextModel); if (fkFor && fkFor.length > 0) { objectFields.push( ts.factory.createPropertyAssignment( @@ -738,7 +742,7 @@ export class TsSchemaGenerator { const origin = field.$container; return getAttribute(origin, '@@delegate')?.args.some( (arg) => - arg.$resolvedParam.name === 'discriminator' && + arg.$resolvedParam?.name === 'discriminator' && isDataFieldReference(arg.value) && arg.value.target.ref === field, ); @@ -844,10 +848,10 @@ export class TsSchemaGenerator { ); } - private createRelationObject(field: DataField) { + private createRelationObject(field: DataField, contextModel: DataModel | undefined) { const relationFields: ts.PropertyAssignment[] = []; - const oppositeRelation = this.getOppositeRelationField(field); + const oppositeRelation = this.getOppositeRelationField(field, contextModel); if (oppositeRelation) { relationFields.push( ts.factory.createPropertyAssignment('opposite', ts.factory.createStringLiteral(oppositeRelation.name)), @@ -865,7 +869,7 @@ export class TsSchemaGenerator { const fkFields: string[] = []; if (relation) { for (const arg of relation.args) { - const param = arg.$resolvedParam.name; + const param = arg.$resolvedParam?.name; if (param === 'fields' || param === 'references') { const fieldNames = this.getReferenceNames(arg.value); if (fieldNames) { @@ -910,9 +914,12 @@ export class TsSchemaGenerator { return isArrayExpr(expr) && expr.items.map((item) => (item as ReferenceExpr).target.$refText); } - private getForeignKeyFor(field: DataField) { + private getForeignKeyFor(field: DataField, contextModel: DataModel | undefined) { + if (!contextModel) { + return []; + } const result: string[] = []; - for (const f of field.$container.fields) { + for (const f of getAllFields(contextModel)) { const relation = getAttribute(f, '@relation'); if (relation) { for (const arg of relation.args) { @@ -929,15 +936,20 @@ export class TsSchemaGenerator { return result; } - private getOppositeRelationField(field: DataField) { - if (!field.type.reference?.ref || !isDataModel(field.type.reference?.ref)) { + private getOppositeRelationField(field: DataField, contextModel: DataModel | undefined) { + if (!field.type.reference?.ref || !isDataModel(field.type.reference?.ref) || !contextModel) { return undefined; } - const sourceModel = field.$container as DataModel; + // For mixin-inherited fields the container is a TypeDef, so the concrete model is the + // right source. For fields owned by a DataModel (own field or inherited via delegate base) + // use that DataModel directly — the opposite relation points to the owning model, not the + // concrete subtype. + const sourceModel = isTypeDef(field.$container) ? contextModel : (field.$container as DataModel); + const targetModel = field.type.reference.ref as DataModel; const relationName = this.getRelationName(field); - for (const otherField of targetModel.fields) { + for (const otherField of getAllFields(targetModel)) { if (otherField === field) { // backlink field is never self continue; @@ -960,7 +972,7 @@ export class TsSchemaGenerator { private getRelationName(field: DataField) { const relation = getAttribute(field, '@relation'); if (relation) { - const nameArg = relation.args.find((arg) => arg.$resolvedParam.name === 'name'); + const nameArg = relation.args.find((arg) => arg.$resolvedParam?.name === 'name'); if (nameArg) { invariant(isLiteralExpr(nameArg.value), 'name must be a literal'); return nameArg.value.value as string; @@ -1049,7 +1061,7 @@ export class TsSchemaGenerator { } private getCompoundUniqueKey(attr: DataModelAttribute, fieldNames: string[]) { - const nameArg = attr.args.find((arg) => arg.$resolvedParam.name === 'name'); + const nameArg = attr.args.find((arg) => arg.$resolvedParam?.name === 'name'); if (nameArg && isLiteralExpr(nameArg.value)) { return nameArg.value.value as string; } else { diff --git a/packages/sdk/tsconfig.json b/packages/sdk/tsconfig.json index 25cac1292..769f88015 100644 --- a/packages/sdk/tsconfig.json +++ b/packages/sdk/tsconfig.json @@ -1,7 +1,8 @@ { "extends": "@zenstackhq/typescript-config/base.json", "compilerOptions": { - "noUnusedLocals": false + "noUnusedLocals": false, + "types": ["node"] }, "include": ["src/**/*.ts"] } diff --git a/packages/sdk/tsdown.config.ts b/packages/sdk/tsdown.config.ts new file mode 100644 index 000000000..920cb8fff --- /dev/null +++ b/packages/sdk/tsdown.config.ts @@ -0,0 +1,8 @@ +import { createConfig } from '@zenstackhq/tsdown-config'; + +export default createConfig({ + entry: { + index: 'src/index.ts', + ast: 'src/ast.ts', + }, +}); diff --git a/packages/sdk/tsup.config.ts b/packages/sdk/tsup.config.ts deleted file mode 100644 index 131257ec3..000000000 --- a/packages/sdk/tsup.config.ts +++ /dev/null @@ -1,14 +0,0 @@ -import { defineConfig } from 'tsup'; - -export default defineConfig({ - entry: { - index: 'src/index.ts', - ast: 'src/ast.ts', - }, - outDir: 'dist', - splitting: false, - sourcemap: true, - clean: true, - dts: true, - format: ['cjs', 'esm'], -}); diff --git a/packages/server/package.json b/packages/server/package.json index 1f7db39a1..1670129fb 100644 --- a/packages/server/package.json +++ b/packages/server/package.json @@ -2,7 +2,7 @@ "name": "@zenstackhq/server", "displayName": "ZenStack Automatic CRUD Server", "description": "ZenStack automatic CRUD API handlers and server adapters for popular frameworks", - "version": "3.5.6", + "version": "3.6.0", "type": "module", "author": { "name": "ZenStack Team", @@ -15,8 +15,8 @@ }, "license": "MIT", "scripts": { - "build": "tsc --noEmit && tsup-node", - "watch": "tsup-node --watch", + "build": "tsc --noEmit && tsdown", + "watch": "tsdown --watch", "lint": "eslint src --ext ts", "test": "vitest run", "update-baseline": "UPDATE_BASELINE=1 vitest run test/openapi", @@ -41,8 +41,8 @@ }, "./api": { "import": { - "types": "./dist/api.d.ts", - "default": "./dist/api.js" + "types": "./dist/api.d.mts", + "default": "./dist/api.mjs" }, "require": { "types": "./dist/api.d.cts", @@ -51,8 +51,8 @@ }, "./express": { "import": { - "types": "./dist/express.d.ts", - "default": "./dist/express.js" + "types": "./dist/express.d.mts", + "default": "./dist/express.mjs" }, "require": { "types": "./dist/express.d.cts", @@ -61,8 +61,8 @@ }, "./elysia": { "import": { - "types": "./dist/elysia.d.ts", - "default": "./dist/elysia.js" + "types": "./dist/elysia.d.mts", + "default": "./dist/elysia.mjs" }, "require": { "types": "./dist/elysia.d.cts", @@ -71,8 +71,8 @@ }, "./fastify": { "import": { - "types": "./dist/fastify.d.ts", - "default": "./dist/fastify.js" + "types": "./dist/fastify.d.mts", + "default": "./dist/fastify.mjs" }, "require": { "types": "./dist/fastify.d.cts", @@ -81,8 +81,8 @@ }, "./next": { "import": { - "types": "./dist/next.d.ts", - "default": "./dist/next.js" + "types": "./dist/next.d.mts", + "default": "./dist/next.mjs" }, "require": { "types": "./dist/next.d.cts", @@ -91,8 +91,8 @@ }, "./hono": { "import": { - "types": "./dist/hono.d.ts", - "default": "./dist/hono.js" + "types": "./dist/hono.d.mts", + "default": "./dist/hono.mjs" }, "require": { "types": "./dist/hono.d.cts", @@ -101,8 +101,8 @@ }, "./nuxt": { "import": { - "types": "./dist/nuxt.d.ts", - "default": "./dist/nuxt.js" + "types": "./dist/nuxt.d.mts", + "default": "./dist/nuxt.mjs" }, "require": { "types": "./dist/nuxt.d.cts", @@ -111,8 +111,8 @@ }, "./sveltekit": { "import": { - "types": "./dist/sveltekit.d.ts", - "default": "./dist/sveltekit.js" + "types": "./dist/sveltekit.d.mts", + "default": "./dist/sveltekit.mjs" }, "require": { "types": "./dist/sveltekit.d.cts", @@ -121,8 +121,8 @@ }, "./tanstack-start": { "import": { - "types": "./dist/tanstack-start.d.ts", - "default": "./dist/tanstack-start.js" + "types": "./dist/tanstack-start.d.mts", + "default": "./dist/tanstack-start.mjs" }, "require": { "types": "./dist/tanstack-start.d.cts", @@ -149,6 +149,7 @@ "@types/supertest": "^6.0.3", "@zenstackhq/eslint-config": "workspace:*", "@zenstackhq/testtools": "workspace:*", + "@zenstackhq/tsdown-config": "workspace:*", "@zenstackhq/typescript-config": "workspace:*", "@zenstackhq/vitest-config": "workspace:*", "body-parser": "^2.2.0", diff --git a/packages/server/src/api/common/spec-utils.ts b/packages/server/src/api/common/spec-utils.ts index f469f79aa..f0f7ec38c 100644 --- a/packages/server/src/api/common/spec-utils.ts +++ b/packages/server/src/api/common/spec-utils.ts @@ -1,6 +1,9 @@ import { lowerCaseFirst } from '@zenstackhq/common-helpers'; import type { QueryOptions } from '@zenstackhq/orm'; -import { ExpressionUtils, type AttributeApplication, type SchemaDef } from '@zenstackhq/orm/schema'; +import { ExpressionUtils, type AttributeApplication, type ModelDef, type SchemaDef } from '@zenstackhq/orm/schema'; + +export const DEFAULT_SPEC_TITLE = 'ZenStack Generated API'; +export const DEFAULT_SPEC_VERSION = '1.0.0'; /** * Checks if a model is included based on slicing options. @@ -97,6 +100,49 @@ export function isFilterKindIncluded( return true; } +/** + * Checks if an operation on a model may be denied by access policies. + * Returns true when `respectAccessPolicies` is enabled and the model's policies + * for the given operation are NOT a constant allow. + */ +export function mayDenyAccess(modelDef: ModelDef, operation: string, respectAccessPolicies?: boolean): boolean { + if (!respectAccessPolicies) return false; + + const policyAttrs = (modelDef.attributes ?? []).filter( + (attr) => attr.name === '@@allow' || attr.name === '@@deny', + ); + + // No policy rules at all means default-deny + if (policyAttrs.length === 0) return true; + + const getArgByName = (args: AttributeApplication['args'], name: string) => + args?.find((a) => a.name === name)?.value; + + const matchesOperation = (args: AttributeApplication['args']) => { + const val = getArgByName(args, 'operation'); + if (!val || val.kind !== 'literal' || typeof val.value !== 'string') return false; + const ops = val.value.split(',').map((s) => s.trim()); + return ops.includes(operation) || ops.includes('all'); + }; + + const hasEffectiveDeny = policyAttrs.some((attr) => { + if (attr.name !== '@@deny' || !matchesOperation(attr.args)) return false; + const condition = getArgByName(attr.args, 'condition'); + // @@deny('op', false) is a no-op — skip it + return !(condition?.kind === 'literal' && condition.value === false); + }); + if (hasEffectiveDeny) return true; + + const relevantAllow = policyAttrs.filter((attr) => attr.name === '@@allow' && matchesOperation(attr.args)); + + const hasConstantAllow = relevantAllow.some((attr) => { + const condition = getArgByName(attr.args, 'condition'); + return condition?.kind === 'literal' && condition.value === true; + }); + + return !hasConstantAllow; +} + /** * Extracts a "description" from `@@meta("description", "...")` or `@meta("description", "...")` attributes. */ diff --git a/packages/server/src/api/rest/openapi.ts b/packages/server/src/api/rest/openapi.ts index 45986ceae..d4770e7cf 100644 --- a/packages/server/src/api/rest/openapi.ts +++ b/packages/server/src/api/rest/openapi.ts @@ -1,8 +1,10 @@ import { lowerCaseFirst } from '@zenstackhq/common-helpers'; -import type { AttributeApplication, EnumDef, FieldDef, ModelDef, SchemaDef, TypeDefDef } from '@zenstackhq/orm/schema'; +import type { EnumDef, FieldDef, ModelDef, SchemaDef, TypeDefDef } from '@zenstackhq/orm/schema'; import type { OpenAPIV3_1 } from 'openapi-types'; import { PROCEDURE_ROUTE_PREFIXES } from '../common/procedures'; import { + DEFAULT_SPEC_TITLE, + DEFAULT_SPEC_VERSION, getIncludedModels, getMetaDescription, isFieldOmitted, @@ -10,6 +12,7 @@ import { isModelIncluded, isOperationIncluded, isProcedureIncluded, + mayDenyAccess, } from '../common/spec-utils'; import type { OpenApiSpecOptions } from '../common/types'; import type { RestApiHandlerOptions } from '.'; @@ -70,8 +73,8 @@ export class RestApiSpecGenerator { return { openapi: '3.1.0', info: { - title: options?.title ?? 'ZenStack Generated API', - version: options?.version ?? '1.0.0', + title: options?.title ?? DEFAULT_SPEC_TITLE, + version: options?.version ?? DEFAULT_SPEC_VERSION, ...(options?.description && { description: options.description }), ...(options?.summary && { summary: options.summary }), }, @@ -229,7 +232,7 @@ export class RestApiSpecGenerator { }, }, '400': ERROR_400, - ...(this.mayDenyAccess(modelDef, 'create') && { '403': ERROR_403 }), + ...(mayDenyAccess(modelDef, 'create', this.specOptions?.respectAccessPolicies) && { '403': ERROR_403 }), '422': ERROR_422, }, }; @@ -293,7 +296,7 @@ export class RestApiSpecGenerator { }, }, '400': ERROR_400, - ...(this.mayDenyAccess(modelDef, 'update') && { '403': ERROR_403 }), + ...(mayDenyAccess(modelDef, 'update', this.specOptions?.respectAccessPolicies) && { '403': ERROR_403 }), '404': ERROR_404, '422': ERROR_422, }, @@ -308,7 +311,7 @@ export class RestApiSpecGenerator { parameters: [idParam], responses: { '200': { description: 'Deleted successfully' }, - ...(this.mayDenyAccess(modelDef, 'delete') && { '403': ERROR_403 }), + ...(mayDenyAccess(modelDef, 'delete', this.specOptions?.respectAccessPolicies) && { '403': ERROR_403 }), '404': ERROR_404, }, }; @@ -359,7 +362,7 @@ export class RestApiSpecGenerator { }; if (this.nestedRoutes && relModelDef) { - const mayDeny = this.mayDenyAccess(relModelDef, isCollection ? 'create' : 'update'); + const mayDeny = mayDenyAccess(relModelDef, isCollection ? 'create' : 'update', this.specOptions?.respectAccessPolicies); if (isCollection && isOperationIncluded(fieldDef.type, 'create', this.queryOptions)) { // POST /{model}/{id}/{field} — nested create pathItem['post'] = { @@ -434,8 +437,8 @@ export class RestApiSpecGenerator { ): Record { const childIdParam = { name: 'childId', in: 'path', required: true, schema: { type: 'string' } }; const idParam = { $ref: '#/components/parameters/id' }; - const mayDenyUpdate = this.mayDenyAccess(relModelDef, 'update'); - const mayDenyDelete = this.mayDenyAccess(relModelDef, 'delete'); + const mayDenyUpdate = mayDenyAccess(relModelDef, 'update', this.specOptions?.respectAccessPolicies); + const mayDenyDelete = mayDenyAccess(relModelDef, 'delete', this.specOptions?.respectAccessPolicies); const result: Record = {}; if (isOperationIncluded(fieldDef.type, 'findUnique', this.queryOptions)) { @@ -523,7 +526,7 @@ export class RestApiSpecGenerator { ? { $ref: '#/components/schemas/_toManyRelationshipRequest' } : { $ref: '#/components/schemas/_toOneRelationshipRequest' }; - const mayDeny = this.mayDenyAccess(modelDef, 'update'); + const mayDeny = mayDenyAccess(modelDef, 'update', this.specOptions?.respectAccessPolicies); const pathItem: Record = { get: { @@ -1204,50 +1207,4 @@ export class RestApiSpecGenerator { return modelDef.idFields.map((name) => modelDef.fields[name]).filter((f): f is FieldDef => f !== undefined); } - /** - * Checks if an operation on a model may be denied by access policies. - * Returns true when `respectAccessPolicies` is enabled and the model's - * policies for the given operation are NOT a constant allow (i.e., not - * simply `@@allow('...', true)` with no `@@deny` rules). - */ - private mayDenyAccess(modelDef: ModelDef, operation: string): boolean { - if (!this.specOptions?.respectAccessPolicies) return false; - - const policyAttrs = (modelDef.attributes ?? []).filter( - (attr) => attr.name === '@@allow' || attr.name === '@@deny', - ); - - // No policy rules at all means default-deny - if (policyAttrs.length === 0) return true; - - const getArgByName = (args: AttributeApplication['args'], name: string) => - args?.find((a) => a.name === name)?.value; - - const matchesOperation = (args: AttributeApplication['args']) => { - const val = getArgByName(args, 'operation'); - if (!val || val.kind !== 'literal' || typeof val.value !== 'string') return false; - const ops = val.value.split(',').map((s) => s.trim()); - return ops.includes(operation) || ops.includes('all'); - }; - - const hasEffectiveDeny = policyAttrs.some((attr) => { - if (attr.name !== '@@deny' || !matchesOperation(attr.args)) return false; - const condition = getArgByName(attr.args, 'condition'); - // @@deny('op', false) is a no-op — skip it - return !(condition?.kind === 'literal' && condition.value === false); - }); - if (hasEffectiveDeny) return true; - - const relevantAllow = policyAttrs.filter( - (attr) => attr.name === '@@allow' && matchesOperation(attr.args), - ); - - // If any allow rule has a constant `true` condition (and no deny), access is unconditional - const hasConstantAllow = relevantAllow.some((attr) => { - const condition = getArgByName(attr.args, 'condition'); - return condition?.kind === 'literal' && condition.value === true; - }); - - return !hasConstantAllow; - } } diff --git a/packages/server/src/api/rpc/index.ts b/packages/server/src/api/rpc/index.ts index 712170f9f..024685a98 100644 --- a/packages/server/src/api/rpc/index.ts +++ b/packages/server/src/api/rpc/index.ts @@ -8,7 +8,7 @@ import { fromError } from 'zod-validation-error/v4'; import type { ApiHandler, LogConfig, RequestContext, Response } from '../../types'; import { getProcedureDef, mapProcedureArgs, PROCEDURE_ROUTE_PREFIXES } from '../common/procedures'; import { loggerSchema, queryOptionsSchema } from '../common/schemas'; -import type { CommonHandlerOptions } from '../common/types'; +import type { CommonHandlerOptions, OpenApiSpecGenerator, OpenApiSpecOptions } from '../common/types'; import { processSuperJsonRequestPayload, unmarshalQ } from '../common/utils'; import { log, registerCustomSerializers } from '../utils'; @@ -35,7 +35,7 @@ export type RPCApiHandlerOptions = { /** * RPC style API request handler that mirrors the ZenStackClient API */ -export class RPCApiHandler implements ApiHandler { +export class RPCApiHandler implements ApiHandler, OpenApiSpecGenerator { constructor(private readonly options: RPCApiHandlerOptions) { this.validateOptions(options); } @@ -434,6 +434,12 @@ export class RPCApiHandler implements ApiH return resp; } + async generateSpec(options?: OpenApiSpecOptions) { + const { RPCApiSpecGenerator } = await import('./openapi'); + const generator = new RPCApiSpecGenerator(this.options); + return generator.generateSpec(options); + } + private async processRequestPayload(args: any) { const { meta, ...rest } = args ?? {}; if (meta?.serialization) { diff --git a/packages/server/src/api/rpc/openapi.ts b/packages/server/src/api/rpc/openapi.ts new file mode 100644 index 000000000..6bd6e2c5c --- /dev/null +++ b/packages/server/src/api/rpc/openapi.ts @@ -0,0 +1,756 @@ +import { lowerCaseFirst, upperCaseFirst } from '@zenstackhq/common-helpers'; +import { CoreCrudOperations, createQuerySchemaFactory, type ZodSchemaFactory } from '@zenstackhq/orm'; +import type { BuiltinType, EnumDef, ModelDef, ProcedureDef, SchemaDef, TypeDefDef } from '@zenstackhq/orm/schema'; +import type { OpenAPIV3_1 } from 'openapi-types'; +import type { RPCApiHandlerOptions } from '.'; +import { PROCEDURE_ROUTE_PREFIXES } from '../common/procedures'; +import { + DEFAULT_SPEC_TITLE, + DEFAULT_SPEC_VERSION, + getIncludedModels, + getMetaDescription, + isOperationIncluded, + isProcedureIncluded, + mayDenyAccess, +} from '../common/spec-utils'; +import type { OpenApiSpecOptions } from '../common/types'; + +type SchemaObject = OpenAPIV3_1.SchemaObject; +type ReferenceObject = OpenAPIV3_1.ReferenceObject; + +// Operations that use GET with args in ?q= query parameter +const GET_OPERATIONS = new Set([ + 'findFirst', + 'findUnique', + 'findMany', + 'aggregate', + 'groupBy', + 'count', + 'exists', +]); +// Operations that use POST with request body (201 on success) +const POST_OPERATIONS = new Set(['create', 'createMany', 'createManyAndReturn', 'upsert']); +// Operations that use PUT with request body +const PUT_OPERATIONS = new Set(['update', 'updateMany', 'updateManyAndReturn']); +// Operations that use DELETE with args in ?q= query parameter +const DELETE_OPERATIONS = new Set(['delete', 'deleteMany']); + +const JSON_CT = 'application/json'; + +type OperationInfo = { + summary: (modelName: string) => string; + dataSchema: (entityRef: ReferenceObject) => SchemaObject | ReferenceObject; +}; + +/** + * Per-operation metadata: human-readable summary and response data schema shape. + * Operations absent from this map (aggregate, groupBy, count) return a generic schema. + */ +const OPERATION_INFO: Record = { + findUnique: { + summary: (m) => `Find a unique ${m}`, + dataSchema: (ref) => ({ anyOf: [ref, { type: 'null' }] }), + }, + findFirst: { + summary: (m) => `Find the first ${m}`, + dataSchema: (ref) => ({ anyOf: [ref, { type: 'null' }] }), + }, + findMany: { + summary: (m) => `List ${m} entities`, + dataSchema: (ref) => ({ type: 'array', items: ref }), + }, + create: { + summary: (m) => `Create a ${m}`, + dataSchema: (ref) => ref, + }, + createMany: { + summary: (m) => `Create multiple ${m} entities`, + dataSchema: () => ({ type: 'object', properties: { count: { type: 'integer' } }, required: ['count'] }), + }, + createManyAndReturn: { + summary: (m) => `Create multiple ${m}s and return them`, + dataSchema: (ref) => ({ type: 'array', items: ref }), + }, + update: { + summary: (m) => `Update a ${m}`, + dataSchema: (ref) => ref, + }, + updateMany: { + summary: (m) => `Update multiple ${m} entities`, + dataSchema: () => ({ type: 'object', properties: { count: { type: 'integer' } }, required: ['count'] }), + }, + updateManyAndReturn: { + summary: (m) => `Update multiple ${m} entities and return them`, + dataSchema: (ref) => ({ type: 'array', items: ref }), + }, + upsert: { + summary: (m) => `Upsert a ${m}`, + dataSchema: (ref) => ref, + }, + delete: { + summary: (m) => `Delete a ${m}`, + dataSchema: (ref) => ref, + }, + deleteMany: { + summary: (m) => `Delete multiple ${m} entities`, + dataSchema: () => ({ type: 'object', properties: { count: { type: 'integer' } }, required: ['count'] }), + }, + exists: { + summary: (m) => `Check ${m} existence`, + dataSchema: () => ({ type: 'boolean' }), + }, +}; + +function errorResponse(description: string): OpenAPIV3_1.ResponseObject { + return { + description, + content: { + [JSON_CT]: { + schema: { $ref: '#/components/schemas/_rpcErrorResponse' }, + }, + }, + }; +} + +const ERROR_400 = errorResponse('Error occurred while processing the request'); +const ERROR_403 = errorResponse('Forbidden: insufficient permissions to perform this operation'); +const ERROR_404 = errorResponse('Resource not found'); +const ERROR_422 = errorResponse('Operation is unprocessable due to validation errors'); +const ERROR_500 = errorResponse('Internal server error'); + +// Operations that may throw NOT_FOUND when the target record does not exist +const NOT_FOUND_OPERATIONS = new Set(['update', 'delete']); + +/** + * Generates an OpenAPI v3.1 specification for the RPC-style API handler. + */ +export class RPCApiSpecGenerator { + private specOptions?: OpenApiSpecOptions; + private readonly factory: ZodSchemaFactory; + /** + * Schemas extracted from the Zod registry, keyed by their registered ID, with + * all `$ref` values already rewritten to `#/components/schemas/`. + */ + private registrySchemas: Record = {}; + + constructor(private readonly handlerOptions: RPCApiHandlerOptions) { + this.factory = createQuerySchemaFactory(handlerOptions.schema, handlerOptions.queryOptions); + } + + private get schema(): SchemaDef { + return this.handlerOptions.schema; + } + + private get queryOptions() { + return this.handlerOptions?.queryOptions; + } + + generateSpec(options?: OpenApiSpecOptions): OpenAPIV3_1.Document { + this.specOptions = options; + + // Build all model/procedure schemas eagerly and capture the full registry as + // JSON Schema, then transform bare-ID $refs to OpenAPI component paths. + const rawRegistry = this.factory.toJSONSchema(); + this.registrySchemas = this.transformRegistrySchemas(rawRegistry.schemas); + + return { + openapi: '3.1.0', + info: { + title: options?.title ?? DEFAULT_SPEC_TITLE, + version: options?.version ?? DEFAULT_SPEC_VERSION, + ...(options?.description && { description: options.description }), + ...(options?.summary && { summary: options.summary }), + }, + tags: this.generateTags(), + paths: this.generatePaths(), + components: { + schemas: { + ...this.registrySchemas, + ...this.generateSharedSchemas(), + }, + }, + } as OpenAPIV3_1.Document; + } + + /** + * Takes the raw `schemas` map from `z.toJSONSchema(registry)` and: + * 1. Rewrites bare-ID `$ref` values (e.g. `"UserWhereInput"`) to full + * component paths (`"#/components/schemas/UserWhereInput"`). + * 2. Strips the `$schema` keyword from each top-level schema object, as it + * is redundant inside an OpenAPI document. + * 3. Resolves Zod's auto-generated `__shared/$defs/schemaN` aliases. + * When a `__shared/$defs/schemaN` entry is itself a plain `$ref` to a + * named schema, every reference to it is rewritten to point directly at + * the target schema, removing the double indirection. Any remaining + * `__shared` entries (complex shared sub-schemas) are promoted to + * top-level component schemas with stable names. + */ + private transformRegistrySchemas(schemas: Record): Record { + let result: Record; + + // Step 1: rewrite bare-ID refs to full component paths, and replace repeated + // inline integer bound schemas with $refs to shared named schemas. + // Bare-ID refs produced by the Zod registry look like `"$ref":"SomeName"`. + // __shared cross-refs look like `"$ref":"__shared#/$defs/schemaN"` and are + // also rewritten here. + const INT_PATTERN = '{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991}'; + const NON_NEG_INT_PATTERN = '{"type":"integer","minimum":0,"maximum":9007199254740991}'; + const serialized = JSON.stringify(schemas) + .replace(/"(\$ref)":"([^"#][^"]*)"/g, (_, key, id) => `"${key}":"#/components/schemas/${id}"`) + .replaceAll(NON_NEG_INT_PATTERN, '{"$ref":"#/components/schemas/_nonNegativeInteger"}') + .replaceAll(INT_PATTERN, '{"$ref":"#/components/schemas/_integer"}'); + result = JSON.parse(serialized) as Record; + + // Step 2: resolve __shared/$defs aliases produced by Zod's deduplication + // of circular-reference lazy schemas. + const shared = result['__shared'] as { $defs?: Record } | undefined; + if (shared?.$defs) { + // Build a substitution map: __shared ref → direct target ref (for pure aliases) + // and collect complex entries that need promotion to top-level. + const refMap: Record = {}; + const promoted: Record = {}; + + for (const [key, entry] of Object.entries(shared.$defs)) { + const sharedRef = `#/components/schemas/__shared#/$defs/${key}`; + if (entry && typeof entry === 'object' && '$ref' in entry && Object.keys(entry).length === 1) { + // Pure alias — map it straight to the target. + refMap[sharedRef] = entry.$ref as string; + } else { + // Complex sub-schema — promote to a top-level named schema. + const promotedName = `_shared_${key}`; + promoted[promotedName] = entry; + refMap[sharedRef] = `#/components/schemas/${promotedName}`; + } + } + + if (Object.keys(refMap).length > 0) { + // Replace all __shared refs in a single JSON round-trip. + const escapedKeys = Object.keys(refMap).map((k) => k.replace(/[.*+?^${}()|[\]\\]/g, '\\$&')); + const pattern = new RegExp(`"\\$ref":"(${escapedKeys.join('|')})"`, 'g'); + const resolved = JSON.stringify(result).replace(pattern, (_, ref) => `"$ref":"${refMap[ref]}"`); + result = JSON.parse(resolved) as Record; + + // Remove __shared and add any promoted complex schemas. + delete result['__shared']; + Object.assign(result, promoted); + } + } + + // Step 3: remove the $schema dialect keyword from each top-level entry. + for (const s of Object.values(result)) { + if (s && typeof s === 'object') { + delete (s as Record)['$schema']; + } + } + + return result; + } + + private generateTags(): OpenAPIV3_1.TagObject[] { + return getIncludedModels(this.schema, this.queryOptions).map((modelName) => ({ + name: lowerCaseFirst(modelName), + description: `${modelName} operations`, + })); + } + + private generatePaths(): OpenAPIV3_1.PathsObject { + const paths: OpenAPIV3_1.PathsObject = {}; + + for (const modelName of getIncludedModels(this.schema, this.queryOptions)) { + const modelDef = this.schema.models[modelName]!; + const tag = lowerCaseFirst(modelName); + + for (const op of CoreCrudOperations) { + if (!isOperationIncluded(modelName, op, this.queryOptions)) continue; + const method = this.getHttpMethod(op); + const operation = this.buildModelOperation(modelName, modelDef, op, tag); + paths[`/${lowerCaseFirst(modelName)}/${op}`] = { + [method]: operation, + } as OpenAPIV3_1.PathItemObject; + } + } + + // Procedure paths + if (this.schema.procedures) { + for (const [procName, procDef] of Object.entries(this.schema.procedures)) { + if (!isProcedureIncluded(procName, this.queryOptions)) continue; + const method = procDef.mutation ? 'post' : 'get'; + paths[`/${PROCEDURE_ROUTE_PREFIXES}/${procName}`] = { + [method]: this.buildProcedureOperation(procName, procDef, method), + } as OpenAPIV3_1.PathItemObject; + } + } + + // Sequential transaction endpoint + paths['/$transaction/sequential'] = { + post: this.buildTransactionOperation(), + } as OpenAPIV3_1.PathItemObject; + + return paths; + } + + private getHttpMethod(op: string): string { + if (GET_OPERATIONS.has(op)) return 'get'; + if (POST_OPERATIONS.has(op)) return 'post'; + if (PUT_OPERATIONS.has(op)) return 'put'; + if (DELETE_OPERATIONS.has(op)) return 'delete'; + return 'post'; + } + + /** + * Returns a JSON Schema `$ref` pointing to the pre-built component schema for + * the given model+operation, or `undefined` if the schema was not registered + * (e.g. the operation is not supported for that model). + */ + private getOperationInputSchemaRef(modelName: string, op: string): ReferenceObject | undefined { + const id = `${modelName}${upperCaseFirst(op)}Args`; + return id in this.registrySchemas ? { $ref: `#/components/schemas/${id}` } : undefined; + } + + /** + * Maps an RPC operation name to its corresponding access policy operation type. + * Policy attributes use 'read', 'create', 'update', 'delete', 'all'. + */ + private policyOp(op: string): string { + if (GET_OPERATIONS.has(op)) return 'read'; + if (DELETE_OPERATIONS.has(op)) return 'delete'; + if (PUT_OPERATIONS.has(op)) return 'update'; + // create/createMany/createManyAndReturn/upsert → 'create' + return 'create'; + } + + private buildModelOperation( + modelName: string, + modelDef: ModelDef, + op: string, + tag: string, + ): Record { + const isQueryOp = GET_OPERATIONS.has(op) || DELETE_OPERATIONS.has(op); + const successCode = POST_OPERATIONS.has(op) ? '201' : '200'; + const inputSchemaRef = this.getOperationInputSchemaRef(modelName, op); + + const operation: Record = { + tags: [tag], + summary: OPERATION_INFO[op]?.summary(modelName) ?? `${modelName}.${op}`, + operationId: `${lowerCaseFirst(modelName)}_${op}`, + responses: { + [successCode]: { + description: 'Operation succeeded', + content: { + [JSON_CT]: { + schema: this.buildOperationSuccessSchema(modelName, op), + }, + }, + }, + '400': ERROR_400, + ...(NOT_FOUND_OPERATIONS.has(op) && { '404': ERROR_404 }), + '422': ERROR_422, + '500': ERROR_500, + ...(mayDenyAccess(modelDef, this.policyOp(op), this.specOptions?.respectAccessPolicies) && { + '403': ERROR_403, + }), + }, + }; + + if (inputSchemaRef) { + if (isQueryOp) { + // `q` is required when the input schema has required fields (e.g. `where` for delete/findUnique). + // OAPI 3.1 supports content-typed parameters for structured query values. + // `meta` is an optional companion to `q` used to carry SuperJSON serialization + // metadata (see unmarshalQ in api/common/utils.ts). + const inputSchemaId = `${modelName}${upperCaseFirst(op)}Args`; + const inputSchema = this.registrySchemas[inputSchemaId]; + const qRequired = Array.isArray(inputSchema?.required) && inputSchema.required.length > 0; + operation['parameters'] = [ + { + name: 'q', + in: 'query', + ...(qRequired && { required: true }), + description: `JSON-encoded arguments for ${modelName}.${op}`, + content: { + [JSON_CT]: { schema: inputSchemaRef }, + }, + }, + { + name: 'meta', + in: 'query', + description: 'JSON-encoded SuperJSON serialization metadata for the "q" parameter', + schema: { type: 'string' }, + }, + ]; + } else { + operation['requestBody'] = { + required: true, + content: { + [JSON_CT]: { schema: inputSchemaRef }, + }, + }; + } + } + + return operation; + } + + private buildProcedureOperation( + procName: string, + procDef: ProcedureDef, + method: 'get' | 'post', + ): Record { + const argsSchemaId = `${procName}ProcArgs`; + const argsSchemaRef: ReferenceObject | SchemaObject = + argsSchemaId in this.registrySchemas + ? { $ref: `#/components/schemas/${argsSchemaId}` } + : { type: 'object' }; + + // The RPC handler accepts { args: { param1: val, ... } } envelope. + // `args` is required when the procedure has at least one non-optional parameter + // (mapProcedureArgs throws 'missing procedure arguments' otherwise). + const hasRequiredParams = Object.values(procDef.params ?? {}).some((p) => !p.optional); + const envelopeSchema: SchemaObject = { + type: 'object', + properties: { args: argsSchemaRef }, + ...(hasRequiredParams && { required: ['args'] }), + }; + + const op: Record = { + tags: ['$procs'], + summary: `Execute procedure \`${procName}\``, + operationId: `proc_${procName}`, + responses: { + '200': { + description: `Result of ${procName}`, + content: { + [JSON_CT]: { + schema: { + type: 'object', + properties: { + data: this.getProcedureDataSchema(procDef), + meta: { + type: 'object', + properties: { + serialization: {}, + }, + }, + }, + }, + }, + }, + }, + '400': ERROR_400, + '403': ERROR_403, + '404': ERROR_404, + '422': ERROR_422, + '500': ERROR_500, + }, + }; + + const hasParams = Object.keys(procDef.params ?? {}).length > 0; + if (method === 'get') { + if (hasParams) { + op['parameters'] = [ + { + name: 'q', + in: 'query', + ...(hasRequiredParams && { required: true }), + description: `JSON-encoded arguments for procedure ${procName}`, + content: { + [JSON_CT]: { schema: envelopeSchema }, + }, + }, + { + name: 'meta', + in: 'query', + description: 'JSON-encoded SuperJSON serialization metadata for the "q" parameter', + schema: { type: 'string' }, + }, + ]; + } + } else { + if (hasParams) { + op['requestBody'] = { + ...(hasRequiredParams && { required: true }), + content: { + [JSON_CT]: { schema: envelopeSchema }, + }, + }; + } + } + + return op; + } + + private getProcedureDataSchema(procDef: ProcedureDef): SchemaObject | ReferenceObject { + const { returnType, returnArray } = procDef; + let base: SchemaObject | ReferenceObject; + + if (this.isBuiltinType(returnType)) { + base = this.builtinTypeToJsonSchema(returnType as BuiltinType); + } else if ( + this.schema.enums?.[returnType] || + this.schema.models?.[returnType] || + this.schema.typeDefs?.[returnType] + ) { + base = { $ref: `#/components/schemas/${returnType}` }; + } else { + base = {}; + } + + return returnArray ? { type: 'array', items: base } : base; + } + + private buildTransactionOperation(): Record { + return { + tags: ['$transaction'], + summary: 'Execute a sequential transaction', + operationId: 'transaction_sequential', + requestBody: { + required: true, + content: { + [JSON_CT]: { + schema: { $ref: '#/components/schemas/_rpcTransactionRequest' }, + }, + }, + }, + responses: { + '200': { + description: 'Transaction succeeded', + content: { + [JSON_CT]: { + schema: { $ref: '#/components/schemas/_rpcSuccessResponse' }, + }, + }, + }, + '400': ERROR_400, + '403': ERROR_403, + '404': ERROR_404, + '422': ERROR_422, + '500': ERROR_500, + }, + }; + } + + private generateSharedSchemas(): Record { + // Generate schemas for enums + const enumSchemas: Record = {}; + for (const [enumName, enumDef] of Object.entries(this.schema.enums ?? {})) { + enumSchemas[enumName] = this.buildEnumSchema(enumDef); + } + + // Generate schemas for typedefs (e.g. `type Address { city String }`) + const typeDefSchemas: Record = {}; + for (const [typeName, typeDef] of Object.entries(this.schema.typeDefs ?? {})) { + typeDefSchemas[typeName] = this.buildTypeDefSchema(typeDef); + } + + // Generate a response-side entity schema for every included model + const modelEntitySchemas: Record = {}; + for (const modelName of getIncludedModels(this.schema as SchemaDef, this.queryOptions)) { + modelEntitySchemas[modelName] = this.buildModelEntitySchema(this.schema.models[modelName]!); + } + + return { + ...enumSchemas, + ...typeDefSchemas, + ...modelEntitySchemas, + _integer: { type: 'integer', minimum: -9007199254740991, maximum: 9007199254740991 }, + _nonNegativeInteger: { type: 'integer', minimum: 0, maximum: 9007199254740991 }, + _rpcSuccessResponse: { + type: 'object', + properties: { + data: {}, + meta: { + type: 'object', + properties: { + serialization: {}, + }, + }, + }, + }, + _rpcErrorResponse: { + type: 'object', + properties: { + error: { + type: 'object', + properties: { + message: { type: 'string' }, + reason: { type: 'string' }, + model: { type: 'string' }, + rejectedByPolicy: { type: 'boolean' }, + rejectedByValidation: { type: 'boolean' }, + rejectReason: { type: 'string' }, + dbErrorCode: { type: 'string' }, + }, + required: ['message'], + }, + }, + required: ['error'], + }, + _rpcTransactionRequest: { + type: 'array', + items: { + type: 'object', + properties: { + model: { type: 'string' }, + op: { + type: 'string', + enum: [...CoreCrudOperations], + }, + args: { type: 'object' }, + }, + required: ['model', 'op'], + }, + }, + }; + } + + private builtinTypeToJsonSchema(type: BuiltinType): SchemaObject { + switch (type) { + case 'String': + return { type: 'string' }; + case 'Boolean': + return { type: 'boolean' }; + case 'Int': + return { type: 'integer' }; + case 'Float': + return { type: 'number' }; + case 'BigInt': + return { type: 'integer' }; + case 'Decimal': + return { type: 'string' }; + case 'DateTime': + return { type: 'string', format: 'date-time' }; + case 'Bytes': + return { type: 'string', format: 'byte' }; + default: + // Json, Unsupported + return {}; + } + } + + private isBuiltinType(type: string): boolean { + return [ + 'String', + 'Boolean', + 'Int', + 'Float', + 'BigInt', + 'Decimal', + 'DateTime', + 'Bytes', + 'Json', + 'Unsupported', + ].includes(type); + } + + /** + * Builds a JSON Schema object describing a custom typedef + */ + private buildEnumSchema(enumDef: EnumDef): SchemaObject { + return { type: 'string', enum: Object.values(enumDef.values) }; + } + + private buildTypeDefSchema(typeDef: TypeDefDef): SchemaObject { + const properties: Record = {}; + const required: string[] = []; + for (const [fieldName, fieldDef] of Object.entries(typeDef.fields)) { + const isRef = + !this.isBuiltinType(fieldDef.type) && + (this.schema.enums?.[fieldDef.type] || this.schema.typeDefs?.[fieldDef.type]); + const base: SchemaObject | ReferenceObject = this.isBuiltinType(fieldDef.type) + ? this.builtinTypeToJsonSchema(fieldDef.type as BuiltinType) + : isRef + ? { $ref: `#/components/schemas/${fieldDef.type}` } + : { type: 'object' as const }; + const fieldDesc = getMetaDescription(fieldDef.attributes); + if (fieldDesc && !isRef) { + (base as SchemaObject).description = fieldDesc; + } + const typed: SchemaObject | ReferenceObject = fieldDef.array ? { type: 'array', items: base } : base; + properties[fieldName] = fieldDef.optional ? { anyOf: [typed, { type: 'null' }] } : typed; + if (!fieldDef.optional) required.push(fieldName); + } + const schema: SchemaObject = { type: 'object', properties }; + if (required.length > 0) schema['required'] = required; + return schema; + } + + /** + * Builds a JSON Schema object describing a model entity + */ + private buildModelEntitySchema(modelDef: ModelDef): SchemaObject { + const properties: Record = {}; + const required: string[] = []; + + for (const [fieldName, fieldDef] of Object.entries(modelDef.fields)) { + if (fieldDef.omit) continue; + + if (fieldDef.relation) { + // Relation fields appear only with `include` — mark as optional. + // To-one optional relations are nullable (the ORM returns null when not found). + const refSchema: ReferenceObject = { $ref: `#/components/schemas/${fieldDef.type}` }; + const base: SchemaObject | ReferenceObject = fieldDef.array + ? { type: 'array', items: refSchema } + : refSchema; + properties[fieldName] = + !fieldDef.array && fieldDef.optional ? { anyOf: [base, { type: 'null' }] } : base; + } else if (this.schema.enums?.[fieldDef.type]) { + // Enum field + const refSchema: ReferenceObject = { $ref: `#/components/schemas/${fieldDef.type}` }; + const base: SchemaObject | ReferenceObject = fieldDef.array + ? { type: 'array', items: refSchema } + : refSchema; + properties[fieldName] = fieldDef.optional ? { anyOf: [base, { type: 'null' }] } : base; + required.push(fieldName); + } else if (this.isBuiltinType(fieldDef.type)) { + // Scalar builtin field + const base = this.builtinTypeToJsonSchema(fieldDef.type as BuiltinType); + const fieldDesc = getMetaDescription(fieldDef.attributes); + if (fieldDesc) base.description = fieldDesc; + const typed: SchemaObject = fieldDef.array ? { type: 'array', items: base } : base; + properties[fieldName] = fieldDef.optional ? { anyOf: [typed, { type: 'null' }] } : typed; + required.push(fieldName); + } else if (this.schema.typeDefs?.[fieldDef.type]) { + // TypeDef field — reference the registered typedef schema + const refSchema: ReferenceObject = { $ref: `#/components/schemas/${fieldDef.type}` }; + const base: SchemaObject | ReferenceObject = fieldDef.array + ? { type: 'array', items: refSchema } + : refSchema; + properties[fieldName] = fieldDef.optional ? { anyOf: [base, { type: 'null' }] } : base; + required.push(fieldName); + } else { + // Unknown type — represent as a generic object + const typed: SchemaObject = fieldDef.array + ? { type: 'array', items: { type: 'object' } } + : { type: 'object' }; + properties[fieldName] = typed; + required.push(fieldName); + } + } + + const schema: SchemaObject = { type: 'object', properties }; + if (required.length > 0) { + schema['required'] = required; + } + const modelDesc = getMetaDescription(modelDef.attributes); + if (modelDesc) schema.description = modelDesc; + return schema; + } + + private buildOperationSuccessSchema(modelName: string, op: string): SchemaObject { + const entityRef: ReferenceObject = { $ref: `#/components/schemas/${modelName}` }; + // aggregate, groupBy, count shapes depend on query args — leave generic ({}) + const dataSchema = OPERATION_INFO[op]?.dataSchema(entityRef) ?? {}; + return { + type: 'object', + properties: { + data: dataSchema, + meta: { + type: 'object', + properties: { + serialization: {}, + }, + }, + }, + }; + } +} diff --git a/packages/server/test/openapi/baseline/rpc.baseline.yaml b/packages/server/test/openapi/baseline/rpc.baseline.yaml new file mode 100644 index 000000000..4ff2f4dfe --- /dev/null +++ b/packages/server/test/openapi/baseline/rpc.baseline.yaml @@ -0,0 +1,14905 @@ +openapi: 3.1.0 +info: + title: ZenStack Generated API + version: 1.0.0 +tags: + - name: user + description: User operations + - name: profile + description: Profile operations + - name: post + description: Post operations + - name: comment + description: Comment operations + - name: setting + description: Setting operations +paths: + /user/findMany: + get: + tags: + - user + summary: List User entities + operationId: user_findMany + responses: + "200": + description: Operation succeeded + content: + application/json: + schema: + type: object + properties: + data: + type: array + items: + $ref: "#/components/schemas/User" + meta: + type: object + properties: + serialization: {} + "400": + description: Error occurred while processing the request + content: + application/json: + schema: + $ref: "#/components/schemas/_rpcErrorResponse" + "422": + description: Operation is unprocessable due to validation errors + content: + application/json: + schema: + $ref: "#/components/schemas/_rpcErrorResponse" + "500": + description: Internal server error + content: + application/json: + schema: + $ref: "#/components/schemas/_rpcErrorResponse" + parameters: + - name: q + in: query + description: JSON-encoded arguments for User.findMany + content: + application/json: + schema: + $ref: "#/components/schemas/UserFindManyArgs" + - name: meta + in: query + description: JSON-encoded SuperJSON serialization metadata for the "q" parameter + schema: + type: string + /user/findUnique: + get: + tags: + - user + summary: Find a unique User + operationId: user_findUnique + responses: + "200": + description: Operation succeeded + content: + application/json: + schema: + type: object + properties: + data: + anyOf: + - $ref: "#/components/schemas/User" + - type: "null" + meta: + type: object + properties: + serialization: {} + "400": + description: Error occurred while processing the request + content: + application/json: + schema: + $ref: "#/components/schemas/_rpcErrorResponse" + "422": + description: Operation is unprocessable due to validation errors + content: + application/json: + schema: + $ref: "#/components/schemas/_rpcErrorResponse" + "500": + description: Internal server error + content: + application/json: + schema: + $ref: "#/components/schemas/_rpcErrorResponse" + parameters: + - name: q + in: query + required: true + description: JSON-encoded arguments for User.findUnique + content: + application/json: + schema: + $ref: "#/components/schemas/UserFindUniqueArgs" + - name: meta + in: query + description: JSON-encoded SuperJSON serialization metadata for the "q" parameter + schema: + type: string + /user/findFirst: + get: + tags: + - user + summary: Find the first User + operationId: user_findFirst + responses: + "200": + description: Operation succeeded + content: + application/json: + schema: + type: object + properties: + data: + anyOf: + - $ref: "#/components/schemas/User" + - type: "null" + meta: + type: object + properties: + serialization: {} + "400": + description: Error occurred while processing the request + content: + application/json: + schema: + $ref: "#/components/schemas/_rpcErrorResponse" + "422": + description: Operation is unprocessable due to validation errors + content: + application/json: + schema: + $ref: "#/components/schemas/_rpcErrorResponse" + "500": + description: Internal server error + content: + application/json: + schema: + $ref: "#/components/schemas/_rpcErrorResponse" + parameters: + - name: q + in: query + description: JSON-encoded arguments for User.findFirst + content: + application/json: + schema: + $ref: "#/components/schemas/UserFindFirstArgs" + - name: meta + in: query + description: JSON-encoded SuperJSON serialization metadata for the "q" parameter + schema: + type: string + /user/create: + post: + tags: + - user + summary: Create a User + operationId: user_create + responses: + "201": + description: Operation succeeded + content: + application/json: + schema: + type: object + properties: + data: + $ref: "#/components/schemas/User" + meta: + type: object + properties: + serialization: {} + "400": + description: Error occurred while processing the request + content: + application/json: + schema: + $ref: "#/components/schemas/_rpcErrorResponse" + "422": + description: Operation is unprocessable due to validation errors + content: + application/json: + schema: + $ref: "#/components/schemas/_rpcErrorResponse" + "500": + description: Internal server error + content: + application/json: + schema: + $ref: "#/components/schemas/_rpcErrorResponse" + requestBody: + required: true + content: + application/json: + schema: + $ref: "#/components/schemas/UserCreateArgs" + /user/createMany: + post: + tags: + - user + summary: Create multiple User entities + operationId: user_createMany + responses: + "201": + description: Operation succeeded + content: + application/json: + schema: + type: object + properties: + data: + type: object + properties: + count: + type: integer + required: + - count + meta: + type: object + properties: + serialization: {} + "400": + description: Error occurred while processing the request + content: + application/json: + schema: + $ref: "#/components/schemas/_rpcErrorResponse" + "422": + description: Operation is unprocessable due to validation errors + content: + application/json: + schema: + $ref: "#/components/schemas/_rpcErrorResponse" + "500": + description: Internal server error + content: + application/json: + schema: + $ref: "#/components/schemas/_rpcErrorResponse" + requestBody: + required: true + content: + application/json: + schema: + $ref: "#/components/schemas/UserCreateManyArgs" + /user/createManyAndReturn: + post: + tags: + - user + summary: Create multiple Users and return them + operationId: user_createManyAndReturn + responses: + "201": + description: Operation succeeded + content: + application/json: + schema: + type: object + properties: + data: + type: array + items: + $ref: "#/components/schemas/User" + meta: + type: object + properties: + serialization: {} + "400": + description: Error occurred while processing the request + content: + application/json: + schema: + $ref: "#/components/schemas/_rpcErrorResponse" + "422": + description: Operation is unprocessable due to validation errors + content: + application/json: + schema: + $ref: "#/components/schemas/_rpcErrorResponse" + "500": + description: Internal server error + content: + application/json: + schema: + $ref: "#/components/schemas/_rpcErrorResponse" + requestBody: + required: true + content: + application/json: + schema: + $ref: "#/components/schemas/UserCreateManyAndReturnArgs" + /user/update: + put: + tags: + - user + summary: Update a User + operationId: user_update + responses: + "200": + description: Operation succeeded + content: + application/json: + schema: + type: object + properties: + data: + $ref: "#/components/schemas/User" + meta: + type: object + properties: + serialization: {} + "400": + description: Error occurred while processing the request + content: + application/json: + schema: + $ref: "#/components/schemas/_rpcErrorResponse" + "404": + description: Resource not found + content: + application/json: + schema: + $ref: "#/components/schemas/_rpcErrorResponse" + "422": + description: Operation is unprocessable due to validation errors + content: + application/json: + schema: + $ref: "#/components/schemas/_rpcErrorResponse" + "500": + description: Internal server error + content: + application/json: + schema: + $ref: "#/components/schemas/_rpcErrorResponse" + requestBody: + required: true + content: + application/json: + schema: + $ref: "#/components/schemas/UserUpdateArgs" + /user/updateMany: + put: + tags: + - user + summary: Update multiple User entities + operationId: user_updateMany + responses: + "200": + description: Operation succeeded + content: + application/json: + schema: + type: object + properties: + data: + type: object + properties: + count: + type: integer + required: + - count + meta: + type: object + properties: + serialization: {} + "400": + description: Error occurred while processing the request + content: + application/json: + schema: + $ref: "#/components/schemas/_rpcErrorResponse" + "422": + description: Operation is unprocessable due to validation errors + content: + application/json: + schema: + $ref: "#/components/schemas/_rpcErrorResponse" + "500": + description: Internal server error + content: + application/json: + schema: + $ref: "#/components/schemas/_rpcErrorResponse" + requestBody: + required: true + content: + application/json: + schema: + $ref: "#/components/schemas/UserUpdateManyArgs" + /user/updateManyAndReturn: + put: + tags: + - user + summary: Update multiple User entities and return them + operationId: user_updateManyAndReturn + responses: + "200": + description: Operation succeeded + content: + application/json: + schema: + type: object + properties: + data: + type: array + items: + $ref: "#/components/schemas/User" + meta: + type: object + properties: + serialization: {} + "400": + description: Error occurred while processing the request + content: + application/json: + schema: + $ref: "#/components/schemas/_rpcErrorResponse" + "422": + description: Operation is unprocessable due to validation errors + content: + application/json: + schema: + $ref: "#/components/schemas/_rpcErrorResponse" + "500": + description: Internal server error + content: + application/json: + schema: + $ref: "#/components/schemas/_rpcErrorResponse" + requestBody: + required: true + content: + application/json: + schema: + $ref: "#/components/schemas/UserUpdateManyAndReturnArgs" + /user/upsert: + post: + tags: + - user + summary: Upsert a User + operationId: user_upsert + responses: + "201": + description: Operation succeeded + content: + application/json: + schema: + type: object + properties: + data: + $ref: "#/components/schemas/User" + meta: + type: object + properties: + serialization: {} + "400": + description: Error occurred while processing the request + content: + application/json: + schema: + $ref: "#/components/schemas/_rpcErrorResponse" + "422": + description: Operation is unprocessable due to validation errors + content: + application/json: + schema: + $ref: "#/components/schemas/_rpcErrorResponse" + "500": + description: Internal server error + content: + application/json: + schema: + $ref: "#/components/schemas/_rpcErrorResponse" + requestBody: + required: true + content: + application/json: + schema: + $ref: "#/components/schemas/UserUpsertArgs" + /user/delete: + delete: + tags: + - user + summary: Delete a User + operationId: user_delete + responses: + "200": + description: Operation succeeded + content: + application/json: + schema: + type: object + properties: + data: + $ref: "#/components/schemas/User" + meta: + type: object + properties: + serialization: {} + "400": + description: Error occurred while processing the request + content: + application/json: + schema: + $ref: "#/components/schemas/_rpcErrorResponse" + "404": + description: Resource not found + content: + application/json: + schema: + $ref: "#/components/schemas/_rpcErrorResponse" + "422": + description: Operation is unprocessable due to validation errors + content: + application/json: + schema: + $ref: "#/components/schemas/_rpcErrorResponse" + "500": + description: Internal server error + content: + application/json: + schema: + $ref: "#/components/schemas/_rpcErrorResponse" + parameters: + - name: q + in: query + required: true + description: JSON-encoded arguments for User.delete + content: + application/json: + schema: + $ref: "#/components/schemas/UserDeleteArgs" + - name: meta + in: query + description: JSON-encoded SuperJSON serialization metadata for the "q" parameter + schema: + type: string + /user/deleteMany: + delete: + tags: + - user + summary: Delete multiple User entities + operationId: user_deleteMany + responses: + "200": + description: Operation succeeded + content: + application/json: + schema: + type: object + properties: + data: + type: object + properties: + count: + type: integer + required: + - count + meta: + type: object + properties: + serialization: {} + "400": + description: Error occurred while processing the request + content: + application/json: + schema: + $ref: "#/components/schemas/_rpcErrorResponse" + "422": + description: Operation is unprocessable due to validation errors + content: + application/json: + schema: + $ref: "#/components/schemas/_rpcErrorResponse" + "500": + description: Internal server error + content: + application/json: + schema: + $ref: "#/components/schemas/_rpcErrorResponse" + parameters: + - name: q + in: query + description: JSON-encoded arguments for User.deleteMany + content: + application/json: + schema: + $ref: "#/components/schemas/UserDeleteManyArgs" + - name: meta + in: query + description: JSON-encoded SuperJSON serialization metadata for the "q" parameter + schema: + type: string + /user/count: + get: + tags: + - user + summary: User.count + operationId: user_count + responses: + "200": + description: Operation succeeded + content: + application/json: + schema: + type: object + properties: + data: {} + meta: + type: object + properties: + serialization: {} + "400": + description: Error occurred while processing the request + content: + application/json: + schema: + $ref: "#/components/schemas/_rpcErrorResponse" + "422": + description: Operation is unprocessable due to validation errors + content: + application/json: + schema: + $ref: "#/components/schemas/_rpcErrorResponse" + "500": + description: Internal server error + content: + application/json: + schema: + $ref: "#/components/schemas/_rpcErrorResponse" + parameters: + - name: q + in: query + description: JSON-encoded arguments for User.count + content: + application/json: + schema: + $ref: "#/components/schemas/UserCountArgs" + - name: meta + in: query + description: JSON-encoded SuperJSON serialization metadata for the "q" parameter + schema: + type: string + /user/aggregate: + get: + tags: + - user + summary: User.aggregate + operationId: user_aggregate + responses: + "200": + description: Operation succeeded + content: + application/json: + schema: + type: object + properties: + data: {} + meta: + type: object + properties: + serialization: {} + "400": + description: Error occurred while processing the request + content: + application/json: + schema: + $ref: "#/components/schemas/_rpcErrorResponse" + "422": + description: Operation is unprocessable due to validation errors + content: + application/json: + schema: + $ref: "#/components/schemas/_rpcErrorResponse" + "500": + description: Internal server error + content: + application/json: + schema: + $ref: "#/components/schemas/_rpcErrorResponse" + parameters: + - name: q + in: query + description: JSON-encoded arguments for User.aggregate + content: + application/json: + schema: + $ref: "#/components/schemas/UserAggregateArgs" + - name: meta + in: query + description: JSON-encoded SuperJSON serialization metadata for the "q" parameter + schema: + type: string + /user/groupBy: + get: + tags: + - user + summary: User.groupBy + operationId: user_groupBy + responses: + "200": + description: Operation succeeded + content: + application/json: + schema: + type: object + properties: + data: {} + meta: + type: object + properties: + serialization: {} + "400": + description: Error occurred while processing the request + content: + application/json: + schema: + $ref: "#/components/schemas/_rpcErrorResponse" + "422": + description: Operation is unprocessable due to validation errors + content: + application/json: + schema: + $ref: "#/components/schemas/_rpcErrorResponse" + "500": + description: Internal server error + content: + application/json: + schema: + $ref: "#/components/schemas/_rpcErrorResponse" + parameters: + - name: q + in: query + required: true + description: JSON-encoded arguments for User.groupBy + content: + application/json: + schema: + $ref: "#/components/schemas/UserGroupByArgs" + - name: meta + in: query + description: JSON-encoded SuperJSON serialization metadata for the "q" parameter + schema: + type: string + /user/exists: + get: + tags: + - user + summary: Check User existence + operationId: user_exists + responses: + "200": + description: Operation succeeded + content: + application/json: + schema: + type: object + properties: + data: + type: boolean + meta: + type: object + properties: + serialization: {} + "400": + description: Error occurred while processing the request + content: + application/json: + schema: + $ref: "#/components/schemas/_rpcErrorResponse" + "422": + description: Operation is unprocessable due to validation errors + content: + application/json: + schema: + $ref: "#/components/schemas/_rpcErrorResponse" + "500": + description: Internal server error + content: + application/json: + schema: + $ref: "#/components/schemas/_rpcErrorResponse" + parameters: + - name: q + in: query + description: JSON-encoded arguments for User.exists + content: + application/json: + schema: + $ref: "#/components/schemas/UserExistsArgs" + - name: meta + in: query + description: JSON-encoded SuperJSON serialization metadata for the "q" parameter + schema: + type: string + /profile/findMany: + get: + tags: + - profile + summary: List Profile entities + operationId: profile_findMany + responses: + "200": + description: Operation succeeded + content: + application/json: + schema: + type: object + properties: + data: + type: array + items: + $ref: "#/components/schemas/Profile" + meta: + type: object + properties: + serialization: {} + "400": + description: Error occurred while processing the request + content: + application/json: + schema: + $ref: "#/components/schemas/_rpcErrorResponse" + "422": + description: Operation is unprocessable due to validation errors + content: + application/json: + schema: + $ref: "#/components/schemas/_rpcErrorResponse" + "500": + description: Internal server error + content: + application/json: + schema: + $ref: "#/components/schemas/_rpcErrorResponse" + parameters: + - name: q + in: query + description: JSON-encoded arguments for Profile.findMany + content: + application/json: + schema: + $ref: "#/components/schemas/ProfileFindManyArgs" + - name: meta + in: query + description: JSON-encoded SuperJSON serialization metadata for the "q" parameter + schema: + type: string + /profile/findUnique: + get: + tags: + - profile + summary: Find a unique Profile + operationId: profile_findUnique + responses: + "200": + description: Operation succeeded + content: + application/json: + schema: + type: object + properties: + data: + anyOf: + - $ref: "#/components/schemas/Profile" + - type: "null" + meta: + type: object + properties: + serialization: {} + "400": + description: Error occurred while processing the request + content: + application/json: + schema: + $ref: "#/components/schemas/_rpcErrorResponse" + "422": + description: Operation is unprocessable due to validation errors + content: + application/json: + schema: + $ref: "#/components/schemas/_rpcErrorResponse" + "500": + description: Internal server error + content: + application/json: + schema: + $ref: "#/components/schemas/_rpcErrorResponse" + parameters: + - name: q + in: query + required: true + description: JSON-encoded arguments for Profile.findUnique + content: + application/json: + schema: + $ref: "#/components/schemas/ProfileFindUniqueArgs" + - name: meta + in: query + description: JSON-encoded SuperJSON serialization metadata for the "q" parameter + schema: + type: string + /profile/findFirst: + get: + tags: + - profile + summary: Find the first Profile + operationId: profile_findFirst + responses: + "200": + description: Operation succeeded + content: + application/json: + schema: + type: object + properties: + data: + anyOf: + - $ref: "#/components/schemas/Profile" + - type: "null" + meta: + type: object + properties: + serialization: {} + "400": + description: Error occurred while processing the request + content: + application/json: + schema: + $ref: "#/components/schemas/_rpcErrorResponse" + "422": + description: Operation is unprocessable due to validation errors + content: + application/json: + schema: + $ref: "#/components/schemas/_rpcErrorResponse" + "500": + description: Internal server error + content: + application/json: + schema: + $ref: "#/components/schemas/_rpcErrorResponse" + parameters: + - name: q + in: query + description: JSON-encoded arguments for Profile.findFirst + content: + application/json: + schema: + $ref: "#/components/schemas/ProfileFindFirstArgs" + - name: meta + in: query + description: JSON-encoded SuperJSON serialization metadata for the "q" parameter + schema: + type: string + /profile/create: + post: + tags: + - profile + summary: Create a Profile + operationId: profile_create + responses: + "201": + description: Operation succeeded + content: + application/json: + schema: + type: object + properties: + data: + $ref: "#/components/schemas/Profile" + meta: + type: object + properties: + serialization: {} + "400": + description: Error occurred while processing the request + content: + application/json: + schema: + $ref: "#/components/schemas/_rpcErrorResponse" + "422": + description: Operation is unprocessable due to validation errors + content: + application/json: + schema: + $ref: "#/components/schemas/_rpcErrorResponse" + "500": + description: Internal server error + content: + application/json: + schema: + $ref: "#/components/schemas/_rpcErrorResponse" + requestBody: + required: true + content: + application/json: + schema: + $ref: "#/components/schemas/ProfileCreateArgs" + /profile/createMany: + post: + tags: + - profile + summary: Create multiple Profile entities + operationId: profile_createMany + responses: + "201": + description: Operation succeeded + content: + application/json: + schema: + type: object + properties: + data: + type: object + properties: + count: + type: integer + required: + - count + meta: + type: object + properties: + serialization: {} + "400": + description: Error occurred while processing the request + content: + application/json: + schema: + $ref: "#/components/schemas/_rpcErrorResponse" + "422": + description: Operation is unprocessable due to validation errors + content: + application/json: + schema: + $ref: "#/components/schemas/_rpcErrorResponse" + "500": + description: Internal server error + content: + application/json: + schema: + $ref: "#/components/schemas/_rpcErrorResponse" + requestBody: + required: true + content: + application/json: + schema: + $ref: "#/components/schemas/ProfileCreateManyArgs" + /profile/createManyAndReturn: + post: + tags: + - profile + summary: Create multiple Profiles and return them + operationId: profile_createManyAndReturn + responses: + "201": + description: Operation succeeded + content: + application/json: + schema: + type: object + properties: + data: + type: array + items: + $ref: "#/components/schemas/Profile" + meta: + type: object + properties: + serialization: {} + "400": + description: Error occurred while processing the request + content: + application/json: + schema: + $ref: "#/components/schemas/_rpcErrorResponse" + "422": + description: Operation is unprocessable due to validation errors + content: + application/json: + schema: + $ref: "#/components/schemas/_rpcErrorResponse" + "500": + description: Internal server error + content: + application/json: + schema: + $ref: "#/components/schemas/_rpcErrorResponse" + requestBody: + required: true + content: + application/json: + schema: + $ref: "#/components/schemas/ProfileCreateManyAndReturnArgs" + /profile/update: + put: + tags: + - profile + summary: Update a Profile + operationId: profile_update + responses: + "200": + description: Operation succeeded + content: + application/json: + schema: + type: object + properties: + data: + $ref: "#/components/schemas/Profile" + meta: + type: object + properties: + serialization: {} + "400": + description: Error occurred while processing the request + content: + application/json: + schema: + $ref: "#/components/schemas/_rpcErrorResponse" + "404": + description: Resource not found + content: + application/json: + schema: + $ref: "#/components/schemas/_rpcErrorResponse" + "422": + description: Operation is unprocessable due to validation errors + content: + application/json: + schema: + $ref: "#/components/schemas/_rpcErrorResponse" + "500": + description: Internal server error + content: + application/json: + schema: + $ref: "#/components/schemas/_rpcErrorResponse" + requestBody: + required: true + content: + application/json: + schema: + $ref: "#/components/schemas/ProfileUpdateArgs" + /profile/updateMany: + put: + tags: + - profile + summary: Update multiple Profile entities + operationId: profile_updateMany + responses: + "200": + description: Operation succeeded + content: + application/json: + schema: + type: object + properties: + data: + type: object + properties: + count: + type: integer + required: + - count + meta: + type: object + properties: + serialization: {} + "400": + description: Error occurred while processing the request + content: + application/json: + schema: + $ref: "#/components/schemas/_rpcErrorResponse" + "422": + description: Operation is unprocessable due to validation errors + content: + application/json: + schema: + $ref: "#/components/schemas/_rpcErrorResponse" + "500": + description: Internal server error + content: + application/json: + schema: + $ref: "#/components/schemas/_rpcErrorResponse" + requestBody: + required: true + content: + application/json: + schema: + $ref: "#/components/schemas/ProfileUpdateManyArgs" + /profile/updateManyAndReturn: + put: + tags: + - profile + summary: Update multiple Profile entities and return them + operationId: profile_updateManyAndReturn + responses: + "200": + description: Operation succeeded + content: + application/json: + schema: + type: object + properties: + data: + type: array + items: + $ref: "#/components/schemas/Profile" + meta: + type: object + properties: + serialization: {} + "400": + description: Error occurred while processing the request + content: + application/json: + schema: + $ref: "#/components/schemas/_rpcErrorResponse" + "422": + description: Operation is unprocessable due to validation errors + content: + application/json: + schema: + $ref: "#/components/schemas/_rpcErrorResponse" + "500": + description: Internal server error + content: + application/json: + schema: + $ref: "#/components/schemas/_rpcErrorResponse" + requestBody: + required: true + content: + application/json: + schema: + $ref: "#/components/schemas/ProfileUpdateManyAndReturnArgs" + /profile/upsert: + post: + tags: + - profile + summary: Upsert a Profile + operationId: profile_upsert + responses: + "201": + description: Operation succeeded + content: + application/json: + schema: + type: object + properties: + data: + $ref: "#/components/schemas/Profile" + meta: + type: object + properties: + serialization: {} + "400": + description: Error occurred while processing the request + content: + application/json: + schema: + $ref: "#/components/schemas/_rpcErrorResponse" + "422": + description: Operation is unprocessable due to validation errors + content: + application/json: + schema: + $ref: "#/components/schemas/_rpcErrorResponse" + "500": + description: Internal server error + content: + application/json: + schema: + $ref: "#/components/schemas/_rpcErrorResponse" + requestBody: + required: true + content: + application/json: + schema: + $ref: "#/components/schemas/ProfileUpsertArgs" + /profile/delete: + delete: + tags: + - profile + summary: Delete a Profile + operationId: profile_delete + responses: + "200": + description: Operation succeeded + content: + application/json: + schema: + type: object + properties: + data: + $ref: "#/components/schemas/Profile" + meta: + type: object + properties: + serialization: {} + "400": + description: Error occurred while processing the request + content: + application/json: + schema: + $ref: "#/components/schemas/_rpcErrorResponse" + "404": + description: Resource not found + content: + application/json: + schema: + $ref: "#/components/schemas/_rpcErrorResponse" + "422": + description: Operation is unprocessable due to validation errors + content: + application/json: + schema: + $ref: "#/components/schemas/_rpcErrorResponse" + "500": + description: Internal server error + content: + application/json: + schema: + $ref: "#/components/schemas/_rpcErrorResponse" + parameters: + - name: q + in: query + required: true + description: JSON-encoded arguments for Profile.delete + content: + application/json: + schema: + $ref: "#/components/schemas/ProfileDeleteArgs" + - name: meta + in: query + description: JSON-encoded SuperJSON serialization metadata for the "q" parameter + schema: + type: string + /profile/deleteMany: + delete: + tags: + - profile + summary: Delete multiple Profile entities + operationId: profile_deleteMany + responses: + "200": + description: Operation succeeded + content: + application/json: + schema: + type: object + properties: + data: + type: object + properties: + count: + type: integer + required: + - count + meta: + type: object + properties: + serialization: {} + "400": + description: Error occurred while processing the request + content: + application/json: + schema: + $ref: "#/components/schemas/_rpcErrorResponse" + "422": + description: Operation is unprocessable due to validation errors + content: + application/json: + schema: + $ref: "#/components/schemas/_rpcErrorResponse" + "500": + description: Internal server error + content: + application/json: + schema: + $ref: "#/components/schemas/_rpcErrorResponse" + parameters: + - name: q + in: query + description: JSON-encoded arguments for Profile.deleteMany + content: + application/json: + schema: + $ref: "#/components/schemas/ProfileDeleteManyArgs" + - name: meta + in: query + description: JSON-encoded SuperJSON serialization metadata for the "q" parameter + schema: + type: string + /profile/count: + get: + tags: + - profile + summary: Profile.count + operationId: profile_count + responses: + "200": + description: Operation succeeded + content: + application/json: + schema: + type: object + properties: + data: {} + meta: + type: object + properties: + serialization: {} + "400": + description: Error occurred while processing the request + content: + application/json: + schema: + $ref: "#/components/schemas/_rpcErrorResponse" + "422": + description: Operation is unprocessable due to validation errors + content: + application/json: + schema: + $ref: "#/components/schemas/_rpcErrorResponse" + "500": + description: Internal server error + content: + application/json: + schema: + $ref: "#/components/schemas/_rpcErrorResponse" + parameters: + - name: q + in: query + description: JSON-encoded arguments for Profile.count + content: + application/json: + schema: + $ref: "#/components/schemas/ProfileCountArgs" + - name: meta + in: query + description: JSON-encoded SuperJSON serialization metadata for the "q" parameter + schema: + type: string + /profile/aggregate: + get: + tags: + - profile + summary: Profile.aggregate + operationId: profile_aggregate + responses: + "200": + description: Operation succeeded + content: + application/json: + schema: + type: object + properties: + data: {} + meta: + type: object + properties: + serialization: {} + "400": + description: Error occurred while processing the request + content: + application/json: + schema: + $ref: "#/components/schemas/_rpcErrorResponse" + "422": + description: Operation is unprocessable due to validation errors + content: + application/json: + schema: + $ref: "#/components/schemas/_rpcErrorResponse" + "500": + description: Internal server error + content: + application/json: + schema: + $ref: "#/components/schemas/_rpcErrorResponse" + parameters: + - name: q + in: query + description: JSON-encoded arguments for Profile.aggregate + content: + application/json: + schema: + $ref: "#/components/schemas/ProfileAggregateArgs" + - name: meta + in: query + description: JSON-encoded SuperJSON serialization metadata for the "q" parameter + schema: + type: string + /profile/groupBy: + get: + tags: + - profile + summary: Profile.groupBy + operationId: profile_groupBy + responses: + "200": + description: Operation succeeded + content: + application/json: + schema: + type: object + properties: + data: {} + meta: + type: object + properties: + serialization: {} + "400": + description: Error occurred while processing the request + content: + application/json: + schema: + $ref: "#/components/schemas/_rpcErrorResponse" + "422": + description: Operation is unprocessable due to validation errors + content: + application/json: + schema: + $ref: "#/components/schemas/_rpcErrorResponse" + "500": + description: Internal server error + content: + application/json: + schema: + $ref: "#/components/schemas/_rpcErrorResponse" + parameters: + - name: q + in: query + required: true + description: JSON-encoded arguments for Profile.groupBy + content: + application/json: + schema: + $ref: "#/components/schemas/ProfileGroupByArgs" + - name: meta + in: query + description: JSON-encoded SuperJSON serialization metadata for the "q" parameter + schema: + type: string + /profile/exists: + get: + tags: + - profile + summary: Check Profile existence + operationId: profile_exists + responses: + "200": + description: Operation succeeded + content: + application/json: + schema: + type: object + properties: + data: + type: boolean + meta: + type: object + properties: + serialization: {} + "400": + description: Error occurred while processing the request + content: + application/json: + schema: + $ref: "#/components/schemas/_rpcErrorResponse" + "422": + description: Operation is unprocessable due to validation errors + content: + application/json: + schema: + $ref: "#/components/schemas/_rpcErrorResponse" + "500": + description: Internal server error + content: + application/json: + schema: + $ref: "#/components/schemas/_rpcErrorResponse" + parameters: + - name: q + in: query + description: JSON-encoded arguments for Profile.exists + content: + application/json: + schema: + $ref: "#/components/schemas/ProfileExistsArgs" + - name: meta + in: query + description: JSON-encoded SuperJSON serialization metadata for the "q" parameter + schema: + type: string + /post/findMany: + get: + tags: + - post + summary: List Post entities + operationId: post_findMany + responses: + "200": + description: Operation succeeded + content: + application/json: + schema: + type: object + properties: + data: + type: array + items: + $ref: "#/components/schemas/Post" + meta: + type: object + properties: + serialization: {} + "400": + description: Error occurred while processing the request + content: + application/json: + schema: + $ref: "#/components/schemas/_rpcErrorResponse" + "422": + description: Operation is unprocessable due to validation errors + content: + application/json: + schema: + $ref: "#/components/schemas/_rpcErrorResponse" + "500": + description: Internal server error + content: + application/json: + schema: + $ref: "#/components/schemas/_rpcErrorResponse" + parameters: + - name: q + in: query + description: JSON-encoded arguments for Post.findMany + content: + application/json: + schema: + $ref: "#/components/schemas/PostFindManyArgs" + - name: meta + in: query + description: JSON-encoded SuperJSON serialization metadata for the "q" parameter + schema: + type: string + /post/findUnique: + get: + tags: + - post + summary: Find a unique Post + operationId: post_findUnique + responses: + "200": + description: Operation succeeded + content: + application/json: + schema: + type: object + properties: + data: + anyOf: + - $ref: "#/components/schemas/Post" + - type: "null" + meta: + type: object + properties: + serialization: {} + "400": + description: Error occurred while processing the request + content: + application/json: + schema: + $ref: "#/components/schemas/_rpcErrorResponse" + "422": + description: Operation is unprocessable due to validation errors + content: + application/json: + schema: + $ref: "#/components/schemas/_rpcErrorResponse" + "500": + description: Internal server error + content: + application/json: + schema: + $ref: "#/components/schemas/_rpcErrorResponse" + parameters: + - name: q + in: query + required: true + description: JSON-encoded arguments for Post.findUnique + content: + application/json: + schema: + $ref: "#/components/schemas/PostFindUniqueArgs" + - name: meta + in: query + description: JSON-encoded SuperJSON serialization metadata for the "q" parameter + schema: + type: string + /post/findFirst: + get: + tags: + - post + summary: Find the first Post + operationId: post_findFirst + responses: + "200": + description: Operation succeeded + content: + application/json: + schema: + type: object + properties: + data: + anyOf: + - $ref: "#/components/schemas/Post" + - type: "null" + meta: + type: object + properties: + serialization: {} + "400": + description: Error occurred while processing the request + content: + application/json: + schema: + $ref: "#/components/schemas/_rpcErrorResponse" + "422": + description: Operation is unprocessable due to validation errors + content: + application/json: + schema: + $ref: "#/components/schemas/_rpcErrorResponse" + "500": + description: Internal server error + content: + application/json: + schema: + $ref: "#/components/schemas/_rpcErrorResponse" + parameters: + - name: q + in: query + description: JSON-encoded arguments for Post.findFirst + content: + application/json: + schema: + $ref: "#/components/schemas/PostFindFirstArgs" + - name: meta + in: query + description: JSON-encoded SuperJSON serialization metadata for the "q" parameter + schema: + type: string + /post/create: + post: + tags: + - post + summary: Create a Post + operationId: post_create + responses: + "201": + description: Operation succeeded + content: + application/json: + schema: + type: object + properties: + data: + $ref: "#/components/schemas/Post" + meta: + type: object + properties: + serialization: {} + "400": + description: Error occurred while processing the request + content: + application/json: + schema: + $ref: "#/components/schemas/_rpcErrorResponse" + "422": + description: Operation is unprocessable due to validation errors + content: + application/json: + schema: + $ref: "#/components/schemas/_rpcErrorResponse" + "500": + description: Internal server error + content: + application/json: + schema: + $ref: "#/components/schemas/_rpcErrorResponse" + requestBody: + required: true + content: + application/json: + schema: + $ref: "#/components/schemas/PostCreateArgs" + /post/createMany: + post: + tags: + - post + summary: Create multiple Post entities + operationId: post_createMany + responses: + "201": + description: Operation succeeded + content: + application/json: + schema: + type: object + properties: + data: + type: object + properties: + count: + type: integer + required: + - count + meta: + type: object + properties: + serialization: {} + "400": + description: Error occurred while processing the request + content: + application/json: + schema: + $ref: "#/components/schemas/_rpcErrorResponse" + "422": + description: Operation is unprocessable due to validation errors + content: + application/json: + schema: + $ref: "#/components/schemas/_rpcErrorResponse" + "500": + description: Internal server error + content: + application/json: + schema: + $ref: "#/components/schemas/_rpcErrorResponse" + requestBody: + required: true + content: + application/json: + schema: + $ref: "#/components/schemas/PostCreateManyArgs" + /post/createManyAndReturn: + post: + tags: + - post + summary: Create multiple Posts and return them + operationId: post_createManyAndReturn + responses: + "201": + description: Operation succeeded + content: + application/json: + schema: + type: object + properties: + data: + type: array + items: + $ref: "#/components/schemas/Post" + meta: + type: object + properties: + serialization: {} + "400": + description: Error occurred while processing the request + content: + application/json: + schema: + $ref: "#/components/schemas/_rpcErrorResponse" + "422": + description: Operation is unprocessable due to validation errors + content: + application/json: + schema: + $ref: "#/components/schemas/_rpcErrorResponse" + "500": + description: Internal server error + content: + application/json: + schema: + $ref: "#/components/schemas/_rpcErrorResponse" + requestBody: + required: true + content: + application/json: + schema: + $ref: "#/components/schemas/PostCreateManyAndReturnArgs" + /post/update: + put: + tags: + - post + summary: Update a Post + operationId: post_update + responses: + "200": + description: Operation succeeded + content: + application/json: + schema: + type: object + properties: + data: + $ref: "#/components/schemas/Post" + meta: + type: object + properties: + serialization: {} + "400": + description: Error occurred while processing the request + content: + application/json: + schema: + $ref: "#/components/schemas/_rpcErrorResponse" + "404": + description: Resource not found + content: + application/json: + schema: + $ref: "#/components/schemas/_rpcErrorResponse" + "422": + description: Operation is unprocessable due to validation errors + content: + application/json: + schema: + $ref: "#/components/schemas/_rpcErrorResponse" + "500": + description: Internal server error + content: + application/json: + schema: + $ref: "#/components/schemas/_rpcErrorResponse" + requestBody: + required: true + content: + application/json: + schema: + $ref: "#/components/schemas/PostUpdateArgs" + /post/updateMany: + put: + tags: + - post + summary: Update multiple Post entities + operationId: post_updateMany + responses: + "200": + description: Operation succeeded + content: + application/json: + schema: + type: object + properties: + data: + type: object + properties: + count: + type: integer + required: + - count + meta: + type: object + properties: + serialization: {} + "400": + description: Error occurred while processing the request + content: + application/json: + schema: + $ref: "#/components/schemas/_rpcErrorResponse" + "422": + description: Operation is unprocessable due to validation errors + content: + application/json: + schema: + $ref: "#/components/schemas/_rpcErrorResponse" + "500": + description: Internal server error + content: + application/json: + schema: + $ref: "#/components/schemas/_rpcErrorResponse" + requestBody: + required: true + content: + application/json: + schema: + $ref: "#/components/schemas/PostUpdateManyArgs" + /post/updateManyAndReturn: + put: + tags: + - post + summary: Update multiple Post entities and return them + operationId: post_updateManyAndReturn + responses: + "200": + description: Operation succeeded + content: + application/json: + schema: + type: object + properties: + data: + type: array + items: + $ref: "#/components/schemas/Post" + meta: + type: object + properties: + serialization: {} + "400": + description: Error occurred while processing the request + content: + application/json: + schema: + $ref: "#/components/schemas/_rpcErrorResponse" + "422": + description: Operation is unprocessable due to validation errors + content: + application/json: + schema: + $ref: "#/components/schemas/_rpcErrorResponse" + "500": + description: Internal server error + content: + application/json: + schema: + $ref: "#/components/schemas/_rpcErrorResponse" + requestBody: + required: true + content: + application/json: + schema: + $ref: "#/components/schemas/PostUpdateManyAndReturnArgs" + /post/upsert: + post: + tags: + - post + summary: Upsert a Post + operationId: post_upsert + responses: + "201": + description: Operation succeeded + content: + application/json: + schema: + type: object + properties: + data: + $ref: "#/components/schemas/Post" + meta: + type: object + properties: + serialization: {} + "400": + description: Error occurred while processing the request + content: + application/json: + schema: + $ref: "#/components/schemas/_rpcErrorResponse" + "422": + description: Operation is unprocessable due to validation errors + content: + application/json: + schema: + $ref: "#/components/schemas/_rpcErrorResponse" + "500": + description: Internal server error + content: + application/json: + schema: + $ref: "#/components/schemas/_rpcErrorResponse" + requestBody: + required: true + content: + application/json: + schema: + $ref: "#/components/schemas/PostUpsertArgs" + /post/delete: + delete: + tags: + - post + summary: Delete a Post + operationId: post_delete + responses: + "200": + description: Operation succeeded + content: + application/json: + schema: + type: object + properties: + data: + $ref: "#/components/schemas/Post" + meta: + type: object + properties: + serialization: {} + "400": + description: Error occurred while processing the request + content: + application/json: + schema: + $ref: "#/components/schemas/_rpcErrorResponse" + "404": + description: Resource not found + content: + application/json: + schema: + $ref: "#/components/schemas/_rpcErrorResponse" + "422": + description: Operation is unprocessable due to validation errors + content: + application/json: + schema: + $ref: "#/components/schemas/_rpcErrorResponse" + "500": + description: Internal server error + content: + application/json: + schema: + $ref: "#/components/schemas/_rpcErrorResponse" + parameters: + - name: q + in: query + required: true + description: JSON-encoded arguments for Post.delete + content: + application/json: + schema: + $ref: "#/components/schemas/PostDeleteArgs" + - name: meta + in: query + description: JSON-encoded SuperJSON serialization metadata for the "q" parameter + schema: + type: string + /post/deleteMany: + delete: + tags: + - post + summary: Delete multiple Post entities + operationId: post_deleteMany + responses: + "200": + description: Operation succeeded + content: + application/json: + schema: + type: object + properties: + data: + type: object + properties: + count: + type: integer + required: + - count + meta: + type: object + properties: + serialization: {} + "400": + description: Error occurred while processing the request + content: + application/json: + schema: + $ref: "#/components/schemas/_rpcErrorResponse" + "422": + description: Operation is unprocessable due to validation errors + content: + application/json: + schema: + $ref: "#/components/schemas/_rpcErrorResponse" + "500": + description: Internal server error + content: + application/json: + schema: + $ref: "#/components/schemas/_rpcErrorResponse" + parameters: + - name: q + in: query + description: JSON-encoded arguments for Post.deleteMany + content: + application/json: + schema: + $ref: "#/components/schemas/PostDeleteManyArgs" + - name: meta + in: query + description: JSON-encoded SuperJSON serialization metadata for the "q" parameter + schema: + type: string + /post/count: + get: + tags: + - post + summary: Post.count + operationId: post_count + responses: + "200": + description: Operation succeeded + content: + application/json: + schema: + type: object + properties: + data: {} + meta: + type: object + properties: + serialization: {} + "400": + description: Error occurred while processing the request + content: + application/json: + schema: + $ref: "#/components/schemas/_rpcErrorResponse" + "422": + description: Operation is unprocessable due to validation errors + content: + application/json: + schema: + $ref: "#/components/schemas/_rpcErrorResponse" + "500": + description: Internal server error + content: + application/json: + schema: + $ref: "#/components/schemas/_rpcErrorResponse" + parameters: + - name: q + in: query + description: JSON-encoded arguments for Post.count + content: + application/json: + schema: + $ref: "#/components/schemas/PostCountArgs" + - name: meta + in: query + description: JSON-encoded SuperJSON serialization metadata for the "q" parameter + schema: + type: string + /post/aggregate: + get: + tags: + - post + summary: Post.aggregate + operationId: post_aggregate + responses: + "200": + description: Operation succeeded + content: + application/json: + schema: + type: object + properties: + data: {} + meta: + type: object + properties: + serialization: {} + "400": + description: Error occurred while processing the request + content: + application/json: + schema: + $ref: "#/components/schemas/_rpcErrorResponse" + "422": + description: Operation is unprocessable due to validation errors + content: + application/json: + schema: + $ref: "#/components/schemas/_rpcErrorResponse" + "500": + description: Internal server error + content: + application/json: + schema: + $ref: "#/components/schemas/_rpcErrorResponse" + parameters: + - name: q + in: query + description: JSON-encoded arguments for Post.aggregate + content: + application/json: + schema: + $ref: "#/components/schemas/PostAggregateArgs" + - name: meta + in: query + description: JSON-encoded SuperJSON serialization metadata for the "q" parameter + schema: + type: string + /post/groupBy: + get: + tags: + - post + summary: Post.groupBy + operationId: post_groupBy + responses: + "200": + description: Operation succeeded + content: + application/json: + schema: + type: object + properties: + data: {} + meta: + type: object + properties: + serialization: {} + "400": + description: Error occurred while processing the request + content: + application/json: + schema: + $ref: "#/components/schemas/_rpcErrorResponse" + "422": + description: Operation is unprocessable due to validation errors + content: + application/json: + schema: + $ref: "#/components/schemas/_rpcErrorResponse" + "500": + description: Internal server error + content: + application/json: + schema: + $ref: "#/components/schemas/_rpcErrorResponse" + parameters: + - name: q + in: query + required: true + description: JSON-encoded arguments for Post.groupBy + content: + application/json: + schema: + $ref: "#/components/schemas/PostGroupByArgs" + - name: meta + in: query + description: JSON-encoded SuperJSON serialization metadata for the "q" parameter + schema: + type: string + /post/exists: + get: + tags: + - post + summary: Check Post existence + operationId: post_exists + responses: + "200": + description: Operation succeeded + content: + application/json: + schema: + type: object + properties: + data: + type: boolean + meta: + type: object + properties: + serialization: {} + "400": + description: Error occurred while processing the request + content: + application/json: + schema: + $ref: "#/components/schemas/_rpcErrorResponse" + "422": + description: Operation is unprocessable due to validation errors + content: + application/json: + schema: + $ref: "#/components/schemas/_rpcErrorResponse" + "500": + description: Internal server error + content: + application/json: + schema: + $ref: "#/components/schemas/_rpcErrorResponse" + parameters: + - name: q + in: query + description: JSON-encoded arguments for Post.exists + content: + application/json: + schema: + $ref: "#/components/schemas/PostExistsArgs" + - name: meta + in: query + description: JSON-encoded SuperJSON serialization metadata for the "q" parameter + schema: + type: string + /comment/findMany: + get: + tags: + - comment + summary: List Comment entities + operationId: comment_findMany + responses: + "200": + description: Operation succeeded + content: + application/json: + schema: + type: object + properties: + data: + type: array + items: + $ref: "#/components/schemas/Comment" + meta: + type: object + properties: + serialization: {} + "400": + description: Error occurred while processing the request + content: + application/json: + schema: + $ref: "#/components/schemas/_rpcErrorResponse" + "422": + description: Operation is unprocessable due to validation errors + content: + application/json: + schema: + $ref: "#/components/schemas/_rpcErrorResponse" + "500": + description: Internal server error + content: + application/json: + schema: + $ref: "#/components/schemas/_rpcErrorResponse" + parameters: + - name: q + in: query + description: JSON-encoded arguments for Comment.findMany + content: + application/json: + schema: + $ref: "#/components/schemas/CommentFindManyArgs" + - name: meta + in: query + description: JSON-encoded SuperJSON serialization metadata for the "q" parameter + schema: + type: string + /comment/findUnique: + get: + tags: + - comment + summary: Find a unique Comment + operationId: comment_findUnique + responses: + "200": + description: Operation succeeded + content: + application/json: + schema: + type: object + properties: + data: + anyOf: + - $ref: "#/components/schemas/Comment" + - type: "null" + meta: + type: object + properties: + serialization: {} + "400": + description: Error occurred while processing the request + content: + application/json: + schema: + $ref: "#/components/schemas/_rpcErrorResponse" + "422": + description: Operation is unprocessable due to validation errors + content: + application/json: + schema: + $ref: "#/components/schemas/_rpcErrorResponse" + "500": + description: Internal server error + content: + application/json: + schema: + $ref: "#/components/schemas/_rpcErrorResponse" + parameters: + - name: q + in: query + required: true + description: JSON-encoded arguments for Comment.findUnique + content: + application/json: + schema: + $ref: "#/components/schemas/CommentFindUniqueArgs" + - name: meta + in: query + description: JSON-encoded SuperJSON serialization metadata for the "q" parameter + schema: + type: string + /comment/findFirst: + get: + tags: + - comment + summary: Find the first Comment + operationId: comment_findFirst + responses: + "200": + description: Operation succeeded + content: + application/json: + schema: + type: object + properties: + data: + anyOf: + - $ref: "#/components/schemas/Comment" + - type: "null" + meta: + type: object + properties: + serialization: {} + "400": + description: Error occurred while processing the request + content: + application/json: + schema: + $ref: "#/components/schemas/_rpcErrorResponse" + "422": + description: Operation is unprocessable due to validation errors + content: + application/json: + schema: + $ref: "#/components/schemas/_rpcErrorResponse" + "500": + description: Internal server error + content: + application/json: + schema: + $ref: "#/components/schemas/_rpcErrorResponse" + parameters: + - name: q + in: query + description: JSON-encoded arguments for Comment.findFirst + content: + application/json: + schema: + $ref: "#/components/schemas/CommentFindFirstArgs" + - name: meta + in: query + description: JSON-encoded SuperJSON serialization metadata for the "q" parameter + schema: + type: string + /comment/create: + post: + tags: + - comment + summary: Create a Comment + operationId: comment_create + responses: + "201": + description: Operation succeeded + content: + application/json: + schema: + type: object + properties: + data: + $ref: "#/components/schemas/Comment" + meta: + type: object + properties: + serialization: {} + "400": + description: Error occurred while processing the request + content: + application/json: + schema: + $ref: "#/components/schemas/_rpcErrorResponse" + "422": + description: Operation is unprocessable due to validation errors + content: + application/json: + schema: + $ref: "#/components/schemas/_rpcErrorResponse" + "500": + description: Internal server error + content: + application/json: + schema: + $ref: "#/components/schemas/_rpcErrorResponse" + requestBody: + required: true + content: + application/json: + schema: + $ref: "#/components/schemas/CommentCreateArgs" + /comment/createMany: + post: + tags: + - comment + summary: Create multiple Comment entities + operationId: comment_createMany + responses: + "201": + description: Operation succeeded + content: + application/json: + schema: + type: object + properties: + data: + type: object + properties: + count: + type: integer + required: + - count + meta: + type: object + properties: + serialization: {} + "400": + description: Error occurred while processing the request + content: + application/json: + schema: + $ref: "#/components/schemas/_rpcErrorResponse" + "422": + description: Operation is unprocessable due to validation errors + content: + application/json: + schema: + $ref: "#/components/schemas/_rpcErrorResponse" + "500": + description: Internal server error + content: + application/json: + schema: + $ref: "#/components/schemas/_rpcErrorResponse" + requestBody: + required: true + content: + application/json: + schema: + $ref: "#/components/schemas/CommentCreateManyArgs" + /comment/createManyAndReturn: + post: + tags: + - comment + summary: Create multiple Comments and return them + operationId: comment_createManyAndReturn + responses: + "201": + description: Operation succeeded + content: + application/json: + schema: + type: object + properties: + data: + type: array + items: + $ref: "#/components/schemas/Comment" + meta: + type: object + properties: + serialization: {} + "400": + description: Error occurred while processing the request + content: + application/json: + schema: + $ref: "#/components/schemas/_rpcErrorResponse" + "422": + description: Operation is unprocessable due to validation errors + content: + application/json: + schema: + $ref: "#/components/schemas/_rpcErrorResponse" + "500": + description: Internal server error + content: + application/json: + schema: + $ref: "#/components/schemas/_rpcErrorResponse" + requestBody: + required: true + content: + application/json: + schema: + $ref: "#/components/schemas/CommentCreateManyAndReturnArgs" + /comment/update: + put: + tags: + - comment + summary: Update a Comment + operationId: comment_update + responses: + "200": + description: Operation succeeded + content: + application/json: + schema: + type: object + properties: + data: + $ref: "#/components/schemas/Comment" + meta: + type: object + properties: + serialization: {} + "400": + description: Error occurred while processing the request + content: + application/json: + schema: + $ref: "#/components/schemas/_rpcErrorResponse" + "404": + description: Resource not found + content: + application/json: + schema: + $ref: "#/components/schemas/_rpcErrorResponse" + "422": + description: Operation is unprocessable due to validation errors + content: + application/json: + schema: + $ref: "#/components/schemas/_rpcErrorResponse" + "500": + description: Internal server error + content: + application/json: + schema: + $ref: "#/components/schemas/_rpcErrorResponse" + requestBody: + required: true + content: + application/json: + schema: + $ref: "#/components/schemas/CommentUpdateArgs" + /comment/updateMany: + put: + tags: + - comment + summary: Update multiple Comment entities + operationId: comment_updateMany + responses: + "200": + description: Operation succeeded + content: + application/json: + schema: + type: object + properties: + data: + type: object + properties: + count: + type: integer + required: + - count + meta: + type: object + properties: + serialization: {} + "400": + description: Error occurred while processing the request + content: + application/json: + schema: + $ref: "#/components/schemas/_rpcErrorResponse" + "422": + description: Operation is unprocessable due to validation errors + content: + application/json: + schema: + $ref: "#/components/schemas/_rpcErrorResponse" + "500": + description: Internal server error + content: + application/json: + schema: + $ref: "#/components/schemas/_rpcErrorResponse" + requestBody: + required: true + content: + application/json: + schema: + $ref: "#/components/schemas/CommentUpdateManyArgs" + /comment/updateManyAndReturn: + put: + tags: + - comment + summary: Update multiple Comment entities and return them + operationId: comment_updateManyAndReturn + responses: + "200": + description: Operation succeeded + content: + application/json: + schema: + type: object + properties: + data: + type: array + items: + $ref: "#/components/schemas/Comment" + meta: + type: object + properties: + serialization: {} + "400": + description: Error occurred while processing the request + content: + application/json: + schema: + $ref: "#/components/schemas/_rpcErrorResponse" + "422": + description: Operation is unprocessable due to validation errors + content: + application/json: + schema: + $ref: "#/components/schemas/_rpcErrorResponse" + "500": + description: Internal server error + content: + application/json: + schema: + $ref: "#/components/schemas/_rpcErrorResponse" + requestBody: + required: true + content: + application/json: + schema: + $ref: "#/components/schemas/CommentUpdateManyAndReturnArgs" + /comment/upsert: + post: + tags: + - comment + summary: Upsert a Comment + operationId: comment_upsert + responses: + "201": + description: Operation succeeded + content: + application/json: + schema: + type: object + properties: + data: + $ref: "#/components/schemas/Comment" + meta: + type: object + properties: + serialization: {} + "400": + description: Error occurred while processing the request + content: + application/json: + schema: + $ref: "#/components/schemas/_rpcErrorResponse" + "422": + description: Operation is unprocessable due to validation errors + content: + application/json: + schema: + $ref: "#/components/schemas/_rpcErrorResponse" + "500": + description: Internal server error + content: + application/json: + schema: + $ref: "#/components/schemas/_rpcErrorResponse" + requestBody: + required: true + content: + application/json: + schema: + $ref: "#/components/schemas/CommentUpsertArgs" + /comment/delete: + delete: + tags: + - comment + summary: Delete a Comment + operationId: comment_delete + responses: + "200": + description: Operation succeeded + content: + application/json: + schema: + type: object + properties: + data: + $ref: "#/components/schemas/Comment" + meta: + type: object + properties: + serialization: {} + "400": + description: Error occurred while processing the request + content: + application/json: + schema: + $ref: "#/components/schemas/_rpcErrorResponse" + "404": + description: Resource not found + content: + application/json: + schema: + $ref: "#/components/schemas/_rpcErrorResponse" + "422": + description: Operation is unprocessable due to validation errors + content: + application/json: + schema: + $ref: "#/components/schemas/_rpcErrorResponse" + "500": + description: Internal server error + content: + application/json: + schema: + $ref: "#/components/schemas/_rpcErrorResponse" + parameters: + - name: q + in: query + required: true + description: JSON-encoded arguments for Comment.delete + content: + application/json: + schema: + $ref: "#/components/schemas/CommentDeleteArgs" + - name: meta + in: query + description: JSON-encoded SuperJSON serialization metadata for the "q" parameter + schema: + type: string + /comment/deleteMany: + delete: + tags: + - comment + summary: Delete multiple Comment entities + operationId: comment_deleteMany + responses: + "200": + description: Operation succeeded + content: + application/json: + schema: + type: object + properties: + data: + type: object + properties: + count: + type: integer + required: + - count + meta: + type: object + properties: + serialization: {} + "400": + description: Error occurred while processing the request + content: + application/json: + schema: + $ref: "#/components/schemas/_rpcErrorResponse" + "422": + description: Operation is unprocessable due to validation errors + content: + application/json: + schema: + $ref: "#/components/schemas/_rpcErrorResponse" + "500": + description: Internal server error + content: + application/json: + schema: + $ref: "#/components/schemas/_rpcErrorResponse" + parameters: + - name: q + in: query + description: JSON-encoded arguments for Comment.deleteMany + content: + application/json: + schema: + $ref: "#/components/schemas/CommentDeleteManyArgs" + - name: meta + in: query + description: JSON-encoded SuperJSON serialization metadata for the "q" parameter + schema: + type: string + /comment/count: + get: + tags: + - comment + summary: Comment.count + operationId: comment_count + responses: + "200": + description: Operation succeeded + content: + application/json: + schema: + type: object + properties: + data: {} + meta: + type: object + properties: + serialization: {} + "400": + description: Error occurred while processing the request + content: + application/json: + schema: + $ref: "#/components/schemas/_rpcErrorResponse" + "422": + description: Operation is unprocessable due to validation errors + content: + application/json: + schema: + $ref: "#/components/schemas/_rpcErrorResponse" + "500": + description: Internal server error + content: + application/json: + schema: + $ref: "#/components/schemas/_rpcErrorResponse" + parameters: + - name: q + in: query + description: JSON-encoded arguments for Comment.count + content: + application/json: + schema: + $ref: "#/components/schemas/CommentCountArgs" + - name: meta + in: query + description: JSON-encoded SuperJSON serialization metadata for the "q" parameter + schema: + type: string + /comment/aggregate: + get: + tags: + - comment + summary: Comment.aggregate + operationId: comment_aggregate + responses: + "200": + description: Operation succeeded + content: + application/json: + schema: + type: object + properties: + data: {} + meta: + type: object + properties: + serialization: {} + "400": + description: Error occurred while processing the request + content: + application/json: + schema: + $ref: "#/components/schemas/_rpcErrorResponse" + "422": + description: Operation is unprocessable due to validation errors + content: + application/json: + schema: + $ref: "#/components/schemas/_rpcErrorResponse" + "500": + description: Internal server error + content: + application/json: + schema: + $ref: "#/components/schemas/_rpcErrorResponse" + parameters: + - name: q + in: query + description: JSON-encoded arguments for Comment.aggregate + content: + application/json: + schema: + $ref: "#/components/schemas/CommentAggregateArgs" + - name: meta + in: query + description: JSON-encoded SuperJSON serialization metadata for the "q" parameter + schema: + type: string + /comment/groupBy: + get: + tags: + - comment + summary: Comment.groupBy + operationId: comment_groupBy + responses: + "200": + description: Operation succeeded + content: + application/json: + schema: + type: object + properties: + data: {} + meta: + type: object + properties: + serialization: {} + "400": + description: Error occurred while processing the request + content: + application/json: + schema: + $ref: "#/components/schemas/_rpcErrorResponse" + "422": + description: Operation is unprocessable due to validation errors + content: + application/json: + schema: + $ref: "#/components/schemas/_rpcErrorResponse" + "500": + description: Internal server error + content: + application/json: + schema: + $ref: "#/components/schemas/_rpcErrorResponse" + parameters: + - name: q + in: query + required: true + description: JSON-encoded arguments for Comment.groupBy + content: + application/json: + schema: + $ref: "#/components/schemas/CommentGroupByArgs" + - name: meta + in: query + description: JSON-encoded SuperJSON serialization metadata for the "q" parameter + schema: + type: string + /comment/exists: + get: + tags: + - comment + summary: Check Comment existence + operationId: comment_exists + responses: + "200": + description: Operation succeeded + content: + application/json: + schema: + type: object + properties: + data: + type: boolean + meta: + type: object + properties: + serialization: {} + "400": + description: Error occurred while processing the request + content: + application/json: + schema: + $ref: "#/components/schemas/_rpcErrorResponse" + "422": + description: Operation is unprocessable due to validation errors + content: + application/json: + schema: + $ref: "#/components/schemas/_rpcErrorResponse" + "500": + description: Internal server error + content: + application/json: + schema: + $ref: "#/components/schemas/_rpcErrorResponse" + parameters: + - name: q + in: query + description: JSON-encoded arguments for Comment.exists + content: + application/json: + schema: + $ref: "#/components/schemas/CommentExistsArgs" + - name: meta + in: query + description: JSON-encoded SuperJSON serialization metadata for the "q" parameter + schema: + type: string + /setting/findMany: + get: + tags: + - setting + summary: List Setting entities + operationId: setting_findMany + responses: + "200": + description: Operation succeeded + content: + application/json: + schema: + type: object + properties: + data: + type: array + items: + $ref: "#/components/schemas/Setting" + meta: + type: object + properties: + serialization: {} + "400": + description: Error occurred while processing the request + content: + application/json: + schema: + $ref: "#/components/schemas/_rpcErrorResponse" + "422": + description: Operation is unprocessable due to validation errors + content: + application/json: + schema: + $ref: "#/components/schemas/_rpcErrorResponse" + "500": + description: Internal server error + content: + application/json: + schema: + $ref: "#/components/schemas/_rpcErrorResponse" + parameters: + - name: q + in: query + description: JSON-encoded arguments for Setting.findMany + content: + application/json: + schema: + $ref: "#/components/schemas/SettingFindManyArgs" + - name: meta + in: query + description: JSON-encoded SuperJSON serialization metadata for the "q" parameter + schema: + type: string + /setting/findUnique: + get: + tags: + - setting + summary: Find a unique Setting + operationId: setting_findUnique + responses: + "200": + description: Operation succeeded + content: + application/json: + schema: + type: object + properties: + data: + anyOf: + - $ref: "#/components/schemas/Setting" + - type: "null" + meta: + type: object + properties: + serialization: {} + "400": + description: Error occurred while processing the request + content: + application/json: + schema: + $ref: "#/components/schemas/_rpcErrorResponse" + "422": + description: Operation is unprocessable due to validation errors + content: + application/json: + schema: + $ref: "#/components/schemas/_rpcErrorResponse" + "500": + description: Internal server error + content: + application/json: + schema: + $ref: "#/components/schemas/_rpcErrorResponse" + parameters: + - name: q + in: query + required: true + description: JSON-encoded arguments for Setting.findUnique + content: + application/json: + schema: + $ref: "#/components/schemas/SettingFindUniqueArgs" + - name: meta + in: query + description: JSON-encoded SuperJSON serialization metadata for the "q" parameter + schema: + type: string + /setting/findFirst: + get: + tags: + - setting + summary: Find the first Setting + operationId: setting_findFirst + responses: + "200": + description: Operation succeeded + content: + application/json: + schema: + type: object + properties: + data: + anyOf: + - $ref: "#/components/schemas/Setting" + - type: "null" + meta: + type: object + properties: + serialization: {} + "400": + description: Error occurred while processing the request + content: + application/json: + schema: + $ref: "#/components/schemas/_rpcErrorResponse" + "422": + description: Operation is unprocessable due to validation errors + content: + application/json: + schema: + $ref: "#/components/schemas/_rpcErrorResponse" + "500": + description: Internal server error + content: + application/json: + schema: + $ref: "#/components/schemas/_rpcErrorResponse" + parameters: + - name: q + in: query + description: JSON-encoded arguments for Setting.findFirst + content: + application/json: + schema: + $ref: "#/components/schemas/SettingFindFirstArgs" + - name: meta + in: query + description: JSON-encoded SuperJSON serialization metadata for the "q" parameter + schema: + type: string + /setting/create: + post: + tags: + - setting + summary: Create a Setting + operationId: setting_create + responses: + "201": + description: Operation succeeded + content: + application/json: + schema: + type: object + properties: + data: + $ref: "#/components/schemas/Setting" + meta: + type: object + properties: + serialization: {} + "400": + description: Error occurred while processing the request + content: + application/json: + schema: + $ref: "#/components/schemas/_rpcErrorResponse" + "422": + description: Operation is unprocessable due to validation errors + content: + application/json: + schema: + $ref: "#/components/schemas/_rpcErrorResponse" + "500": + description: Internal server error + content: + application/json: + schema: + $ref: "#/components/schemas/_rpcErrorResponse" + requestBody: + required: true + content: + application/json: + schema: + $ref: "#/components/schemas/SettingCreateArgs" + /setting/createMany: + post: + tags: + - setting + summary: Create multiple Setting entities + operationId: setting_createMany + responses: + "201": + description: Operation succeeded + content: + application/json: + schema: + type: object + properties: + data: + type: object + properties: + count: + type: integer + required: + - count + meta: + type: object + properties: + serialization: {} + "400": + description: Error occurred while processing the request + content: + application/json: + schema: + $ref: "#/components/schemas/_rpcErrorResponse" + "422": + description: Operation is unprocessable due to validation errors + content: + application/json: + schema: + $ref: "#/components/schemas/_rpcErrorResponse" + "500": + description: Internal server error + content: + application/json: + schema: + $ref: "#/components/schemas/_rpcErrorResponse" + requestBody: + required: true + content: + application/json: + schema: + $ref: "#/components/schemas/SettingCreateManyArgs" + /setting/createManyAndReturn: + post: + tags: + - setting + summary: Create multiple Settings and return them + operationId: setting_createManyAndReturn + responses: + "201": + description: Operation succeeded + content: + application/json: + schema: + type: object + properties: + data: + type: array + items: + $ref: "#/components/schemas/Setting" + meta: + type: object + properties: + serialization: {} + "400": + description: Error occurred while processing the request + content: + application/json: + schema: + $ref: "#/components/schemas/_rpcErrorResponse" + "422": + description: Operation is unprocessable due to validation errors + content: + application/json: + schema: + $ref: "#/components/schemas/_rpcErrorResponse" + "500": + description: Internal server error + content: + application/json: + schema: + $ref: "#/components/schemas/_rpcErrorResponse" + requestBody: + required: true + content: + application/json: + schema: + $ref: "#/components/schemas/SettingCreateManyAndReturnArgs" + /setting/update: + put: + tags: + - setting + summary: Update a Setting + operationId: setting_update + responses: + "200": + description: Operation succeeded + content: + application/json: + schema: + type: object + properties: + data: + $ref: "#/components/schemas/Setting" + meta: + type: object + properties: + serialization: {} + "400": + description: Error occurred while processing the request + content: + application/json: + schema: + $ref: "#/components/schemas/_rpcErrorResponse" + "404": + description: Resource not found + content: + application/json: + schema: + $ref: "#/components/schemas/_rpcErrorResponse" + "422": + description: Operation is unprocessable due to validation errors + content: + application/json: + schema: + $ref: "#/components/schemas/_rpcErrorResponse" + "500": + description: Internal server error + content: + application/json: + schema: + $ref: "#/components/schemas/_rpcErrorResponse" + requestBody: + required: true + content: + application/json: + schema: + $ref: "#/components/schemas/SettingUpdateArgs" + /setting/updateMany: + put: + tags: + - setting + summary: Update multiple Setting entities + operationId: setting_updateMany + responses: + "200": + description: Operation succeeded + content: + application/json: + schema: + type: object + properties: + data: + type: object + properties: + count: + type: integer + required: + - count + meta: + type: object + properties: + serialization: {} + "400": + description: Error occurred while processing the request + content: + application/json: + schema: + $ref: "#/components/schemas/_rpcErrorResponse" + "422": + description: Operation is unprocessable due to validation errors + content: + application/json: + schema: + $ref: "#/components/schemas/_rpcErrorResponse" + "500": + description: Internal server error + content: + application/json: + schema: + $ref: "#/components/schemas/_rpcErrorResponse" + requestBody: + required: true + content: + application/json: + schema: + $ref: "#/components/schemas/SettingUpdateManyArgs" + /setting/updateManyAndReturn: + put: + tags: + - setting + summary: Update multiple Setting entities and return them + operationId: setting_updateManyAndReturn + responses: + "200": + description: Operation succeeded + content: + application/json: + schema: + type: object + properties: + data: + type: array + items: + $ref: "#/components/schemas/Setting" + meta: + type: object + properties: + serialization: {} + "400": + description: Error occurred while processing the request + content: + application/json: + schema: + $ref: "#/components/schemas/_rpcErrorResponse" + "422": + description: Operation is unprocessable due to validation errors + content: + application/json: + schema: + $ref: "#/components/schemas/_rpcErrorResponse" + "500": + description: Internal server error + content: + application/json: + schema: + $ref: "#/components/schemas/_rpcErrorResponse" + requestBody: + required: true + content: + application/json: + schema: + $ref: "#/components/schemas/SettingUpdateManyAndReturnArgs" + /setting/upsert: + post: + tags: + - setting + summary: Upsert a Setting + operationId: setting_upsert + responses: + "201": + description: Operation succeeded + content: + application/json: + schema: + type: object + properties: + data: + $ref: "#/components/schemas/Setting" + meta: + type: object + properties: + serialization: {} + "400": + description: Error occurred while processing the request + content: + application/json: + schema: + $ref: "#/components/schemas/_rpcErrorResponse" + "422": + description: Operation is unprocessable due to validation errors + content: + application/json: + schema: + $ref: "#/components/schemas/_rpcErrorResponse" + "500": + description: Internal server error + content: + application/json: + schema: + $ref: "#/components/schemas/_rpcErrorResponse" + requestBody: + required: true + content: + application/json: + schema: + $ref: "#/components/schemas/SettingUpsertArgs" + /setting/delete: + delete: + tags: + - setting + summary: Delete a Setting + operationId: setting_delete + responses: + "200": + description: Operation succeeded + content: + application/json: + schema: + type: object + properties: + data: + $ref: "#/components/schemas/Setting" + meta: + type: object + properties: + serialization: {} + "400": + description: Error occurred while processing the request + content: + application/json: + schema: + $ref: "#/components/schemas/_rpcErrorResponse" + "404": + description: Resource not found + content: + application/json: + schema: + $ref: "#/components/schemas/_rpcErrorResponse" + "422": + description: Operation is unprocessable due to validation errors + content: + application/json: + schema: + $ref: "#/components/schemas/_rpcErrorResponse" + "500": + description: Internal server error + content: + application/json: + schema: + $ref: "#/components/schemas/_rpcErrorResponse" + parameters: + - name: q + in: query + required: true + description: JSON-encoded arguments for Setting.delete + content: + application/json: + schema: + $ref: "#/components/schemas/SettingDeleteArgs" + - name: meta + in: query + description: JSON-encoded SuperJSON serialization metadata for the "q" parameter + schema: + type: string + /setting/deleteMany: + delete: + tags: + - setting + summary: Delete multiple Setting entities + operationId: setting_deleteMany + responses: + "200": + description: Operation succeeded + content: + application/json: + schema: + type: object + properties: + data: + type: object + properties: + count: + type: integer + required: + - count + meta: + type: object + properties: + serialization: {} + "400": + description: Error occurred while processing the request + content: + application/json: + schema: + $ref: "#/components/schemas/_rpcErrorResponse" + "422": + description: Operation is unprocessable due to validation errors + content: + application/json: + schema: + $ref: "#/components/schemas/_rpcErrorResponse" + "500": + description: Internal server error + content: + application/json: + schema: + $ref: "#/components/schemas/_rpcErrorResponse" + parameters: + - name: q + in: query + description: JSON-encoded arguments for Setting.deleteMany + content: + application/json: + schema: + $ref: "#/components/schemas/SettingDeleteManyArgs" + - name: meta + in: query + description: JSON-encoded SuperJSON serialization metadata for the "q" parameter + schema: + type: string + /setting/count: + get: + tags: + - setting + summary: Setting.count + operationId: setting_count + responses: + "200": + description: Operation succeeded + content: + application/json: + schema: + type: object + properties: + data: {} + meta: + type: object + properties: + serialization: {} + "400": + description: Error occurred while processing the request + content: + application/json: + schema: + $ref: "#/components/schemas/_rpcErrorResponse" + "422": + description: Operation is unprocessable due to validation errors + content: + application/json: + schema: + $ref: "#/components/schemas/_rpcErrorResponse" + "500": + description: Internal server error + content: + application/json: + schema: + $ref: "#/components/schemas/_rpcErrorResponse" + parameters: + - name: q + in: query + description: JSON-encoded arguments for Setting.count + content: + application/json: + schema: + $ref: "#/components/schemas/SettingCountArgs" + - name: meta + in: query + description: JSON-encoded SuperJSON serialization metadata for the "q" parameter + schema: + type: string + /setting/aggregate: + get: + tags: + - setting + summary: Setting.aggregate + operationId: setting_aggregate + responses: + "200": + description: Operation succeeded + content: + application/json: + schema: + type: object + properties: + data: {} + meta: + type: object + properties: + serialization: {} + "400": + description: Error occurred while processing the request + content: + application/json: + schema: + $ref: "#/components/schemas/_rpcErrorResponse" + "422": + description: Operation is unprocessable due to validation errors + content: + application/json: + schema: + $ref: "#/components/schemas/_rpcErrorResponse" + "500": + description: Internal server error + content: + application/json: + schema: + $ref: "#/components/schemas/_rpcErrorResponse" + parameters: + - name: q + in: query + description: JSON-encoded arguments for Setting.aggregate + content: + application/json: + schema: + $ref: "#/components/schemas/SettingAggregateArgs" + - name: meta + in: query + description: JSON-encoded SuperJSON serialization metadata for the "q" parameter + schema: + type: string + /setting/groupBy: + get: + tags: + - setting + summary: Setting.groupBy + operationId: setting_groupBy + responses: + "200": + description: Operation succeeded + content: + application/json: + schema: + type: object + properties: + data: {} + meta: + type: object + properties: + serialization: {} + "400": + description: Error occurred while processing the request + content: + application/json: + schema: + $ref: "#/components/schemas/_rpcErrorResponse" + "422": + description: Operation is unprocessable due to validation errors + content: + application/json: + schema: + $ref: "#/components/schemas/_rpcErrorResponse" + "500": + description: Internal server error + content: + application/json: + schema: + $ref: "#/components/schemas/_rpcErrorResponse" + parameters: + - name: q + in: query + required: true + description: JSON-encoded arguments for Setting.groupBy + content: + application/json: + schema: + $ref: "#/components/schemas/SettingGroupByArgs" + - name: meta + in: query + description: JSON-encoded SuperJSON serialization metadata for the "q" parameter + schema: + type: string + /setting/exists: + get: + tags: + - setting + summary: Check Setting existence + operationId: setting_exists + responses: + "200": + description: Operation succeeded + content: + application/json: + schema: + type: object + properties: + data: + type: boolean + meta: + type: object + properties: + serialization: {} + "400": + description: Error occurred while processing the request + content: + application/json: + schema: + $ref: "#/components/schemas/_rpcErrorResponse" + "422": + description: Operation is unprocessable due to validation errors + content: + application/json: + schema: + $ref: "#/components/schemas/_rpcErrorResponse" + "500": + description: Internal server error + content: + application/json: + schema: + $ref: "#/components/schemas/_rpcErrorResponse" + parameters: + - name: q + in: query + description: JSON-encoded arguments for Setting.exists + content: + application/json: + schema: + $ref: "#/components/schemas/SettingExistsArgs" + - name: meta + in: query + description: JSON-encoded SuperJSON serialization metadata for the "q" parameter + schema: + type: string + /$procs/findPostsByUser: + get: + tags: + - $procs + summary: Execute procedure `findPostsByUser` + operationId: proc_findPostsByUser + responses: + "200": + description: Result of findPostsByUser + content: + application/json: + schema: + type: object + properties: + data: + type: array + items: + $ref: "#/components/schemas/Post" + meta: + type: object + properties: + serialization: {} + "400": + description: Error occurred while processing the request + content: + application/json: + schema: + $ref: "#/components/schemas/_rpcErrorResponse" + "403": + description: "Forbidden: insufficient permissions to perform this operation" + content: + application/json: + schema: + $ref: "#/components/schemas/_rpcErrorResponse" + "404": + description: Resource not found + content: + application/json: + schema: + $ref: "#/components/schemas/_rpcErrorResponse" + "422": + description: Operation is unprocessable due to validation errors + content: + application/json: + schema: + $ref: "#/components/schemas/_rpcErrorResponse" + "500": + description: Internal server error + content: + application/json: + schema: + $ref: "#/components/schemas/_rpcErrorResponse" + parameters: + - name: q + in: query + required: true + description: JSON-encoded arguments for procedure findPostsByUser + content: + application/json: + schema: + type: object + properties: + args: + $ref: "#/components/schemas/findPostsByUserProcArgs" + required: + - args + - name: meta + in: query + description: JSON-encoded SuperJSON serialization metadata for the "q" parameter + schema: + type: string + /$procs/getPostCount: + get: + tags: + - $procs + summary: Execute procedure `getPostCount` + operationId: proc_getPostCount + responses: + "200": + description: Result of getPostCount + content: + application/json: + schema: + type: object + properties: + data: + type: integer + meta: + type: object + properties: + serialization: {} + "400": + description: Error occurred while processing the request + content: + application/json: + schema: + $ref: "#/components/schemas/_rpcErrorResponse" + "403": + description: "Forbidden: insufficient permissions to perform this operation" + content: + application/json: + schema: + $ref: "#/components/schemas/_rpcErrorResponse" + "404": + description: Resource not found + content: + application/json: + schema: + $ref: "#/components/schemas/_rpcErrorResponse" + "422": + description: Operation is unprocessable due to validation errors + content: + application/json: + schema: + $ref: "#/components/schemas/_rpcErrorResponse" + "500": + description: Internal server error + content: + application/json: + schema: + $ref: "#/components/schemas/_rpcErrorResponse" + parameters: + - name: q + in: query + required: true + description: JSON-encoded arguments for procedure getPostCount + content: + application/json: + schema: + type: object + properties: + args: + $ref: "#/components/schemas/getPostCountProcArgs" + required: + - args + - name: meta + in: query + description: JSON-encoded SuperJSON serialization metadata for the "q" parameter + schema: + type: string + /$procs/publishPost: + post: + tags: + - $procs + summary: Execute procedure `publishPost` + operationId: proc_publishPost + responses: + "200": + description: Result of publishPost + content: + application/json: + schema: + type: object + properties: + data: + $ref: "#/components/schemas/Post" + meta: + type: object + properties: + serialization: {} + "400": + description: Error occurred while processing the request + content: + application/json: + schema: + $ref: "#/components/schemas/_rpcErrorResponse" + "403": + description: "Forbidden: insufficient permissions to perform this operation" + content: + application/json: + schema: + $ref: "#/components/schemas/_rpcErrorResponse" + "404": + description: Resource not found + content: + application/json: + schema: + $ref: "#/components/schemas/_rpcErrorResponse" + "422": + description: Operation is unprocessable due to validation errors + content: + application/json: + schema: + $ref: "#/components/schemas/_rpcErrorResponse" + "500": + description: Internal server error + content: + application/json: + schema: + $ref: "#/components/schemas/_rpcErrorResponse" + requestBody: + required: true + content: + application/json: + schema: + type: object + properties: + args: + $ref: "#/components/schemas/publishPostProcArgs" + required: + - args + /$transaction/sequential: + post: + tags: + - $transaction + summary: Execute a sequential transaction + operationId: transaction_sequential + requestBody: + required: true + content: + application/json: + schema: + $ref: "#/components/schemas/_rpcTransactionRequest" + responses: + "200": + description: Transaction succeeded + content: + application/json: + schema: + $ref: "#/components/schemas/_rpcSuccessResponse" + "400": + description: Error occurred while processing the request + content: + application/json: + schema: + $ref: "#/components/schemas/_rpcErrorResponse" + "403": + description: "Forbidden: insufficient permissions to perform this operation" + content: + application/json: + schema: + $ref: "#/components/schemas/_rpcErrorResponse" + "404": + description: Resource not found + content: + application/json: + schema: + $ref: "#/components/schemas/_rpcErrorResponse" + "422": + description: Operation is unprocessable due to validation errors + content: + application/json: + schema: + $ref: "#/components/schemas/_rpcErrorResponse" + "500": + description: Internal server error + content: + application/json: + schema: + $ref: "#/components/schemas/_rpcErrorResponse" +components: + schemas: + StringFilter: + anyOf: + - type: string + - type: object + properties: + equals: + type: string + in: + type: array + items: + type: string + notIn: + type: array + items: + type: string + lt: + type: string + lte: + type: string + gt: + type: string + gte: + type: string + between: + minItems: 2 + maxItems: 2 + type: array + items: + type: string + not: + $ref: "#/components/schemas/StringFilter" + startsWith: + type: string + endsWith: + type: string + contains: + type: string + mode: + anyOf: + - type: string + const: default + - type: string + const: insensitive + additionalProperties: false + DateTime: + anyOf: + - type: string + format: date-time + pattern: ^(?:(?:\d\d[2468][048]|\d\d[13579][26]|\d\d0[48]|[02468][048]00|[13579][26]00)-02-29|\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\d|30)|(?:02)-(?:0[1-9]|1\d|2[0-8])))T(?:(?:[01]\d|2[0-3]):[0-5]\d(?::[0-5]\d(?:\.\d+)?)?(?:Z))$ + - {} + DateTimeFilter: + anyOf: + - $ref: "#/components/schemas/DateTime" + - type: object + properties: + equals: + $ref: "#/components/schemas/DateTime" + in: + type: array + items: + $ref: "#/components/schemas/DateTime" + notIn: + type: array + items: + $ref: "#/components/schemas/DateTime" + lt: + $ref: "#/components/schemas/DateTime" + lte: + $ref: "#/components/schemas/DateTime" + gt: + $ref: "#/components/schemas/DateTime" + gte: + $ref: "#/components/schemas/DateTime" + between: + minItems: 2 + maxItems: 2 + type: array + items: + $ref: "#/components/schemas/DateTime" + not: + $ref: "#/components/schemas/DateTimeFilter" + additionalProperties: false + JsonValue: + anyOf: + - type: string + - type: number + - type: boolean + - {} + - type: array + items: + anyOf: + - $ref: "#/components/schemas/JsonValue" + - type: "null" + - type: object + propertyNames: + type: string + additionalProperties: + anyOf: + - $ref: "#/components/schemas/JsonValue" + - type: "null" + JsonFilterOptional: + type: object + properties: + path: + type: string + equals: + anyOf: + - $ref: "#/components/schemas/JsonValue" + - {} + - {} + - type: "null" + not: + anyOf: + - $ref: "#/components/schemas/JsonValue" + - {} + - {} + - type: "null" + string_contains: + type: string + string_starts_with: + type: string + string_ends_with: + type: string + mode: + anyOf: + - type: string + const: default + - type: string + const: insensitive + array_contains: + anyOf: + - $ref: "#/components/schemas/JsonValue" + - {} + - {} + - type: "null" + array_starts_with: + anyOf: + - $ref: "#/components/schemas/JsonValue" + - {} + - {} + - type: "null" + array_ends_with: + anyOf: + - $ref: "#/components/schemas/JsonValue" + - {} + - {} + - type: "null" + additionalProperties: false + AddressFilterOptional: + anyOf: + - type: object + properties: + city: + $ref: "#/components/schemas/StringFilter" + additionalProperties: false + - type: object + properties: + is: + $ref: "#/components/schemas/AddressFilterOptional" + isNot: + $ref: "#/components/schemas/AddressFilterOptional" + additionalProperties: false + - $ref: "#/components/schemas/JsonFilterOptional" + - type: "null" + - {} + - {} + - {} + UserWhereUniqueInput: + type: object + properties: + myId: + $ref: "#/components/schemas/StringFilter" + createdAt: + $ref: "#/components/schemas/DateTimeFilter" + updatedAt: + $ref: "#/components/schemas/DateTimeFilter" + email: + $ref: "#/components/schemas/StringFilter" + posts: + type: object + properties: + some: + $ref: "#/components/schemas/PostWhereInput" + every: + $ref: "#/components/schemas/PostWhereInput" + none: + $ref: "#/components/schemas/PostWhereInput" + additionalProperties: false + profile: + anyOf: + - anyOf: + - $ref: "#/components/schemas/ProfileWhereInput" + - type: "null" + - type: object + properties: + is: + anyOf: + - $ref: "#/components/schemas/ProfileWhereInput" + - type: "null" + isNot: + anyOf: + - $ref: "#/components/schemas/ProfileWhereInput" + - type: "null" + additionalProperties: false + address: + $ref: "#/components/schemas/AddressFilterOptional" + someJson: + $ref: "#/components/schemas/JsonFilterOptional" + $expr: {} + AND: + anyOf: + - $ref: "#/components/schemas/UserWhereInput" + - type: array + items: + $ref: "#/components/schemas/UserWhereInput" + OR: + type: array + items: + $ref: "#/components/schemas/UserWhereInput" + NOT: + anyOf: + - $ref: "#/components/schemas/UserWhereInput" + - type: array + items: + $ref: "#/components/schemas/UserWhereInput" + additionalProperties: false + IntFilter: + anyOf: + - $ref: "#/components/schemas/_integer" + - type: object + properties: + equals: + $ref: "#/components/schemas/_integer" + in: + type: array + items: + $ref: "#/components/schemas/_integer" + notIn: + type: array + items: + $ref: "#/components/schemas/_integer" + lt: + $ref: "#/components/schemas/_integer" + lte: + $ref: "#/components/schemas/_integer" + gt: + $ref: "#/components/schemas/_integer" + gte: + $ref: "#/components/schemas/_integer" + between: + minItems: 2 + maxItems: 2 + type: array + items: + $ref: "#/components/schemas/_integer" + not: + $ref: "#/components/schemas/IntFilter" + additionalProperties: false + StringFilterOptional: + anyOf: + - anyOf: + - type: string + - type: "null" + - type: object + properties: + equals: + anyOf: + - type: string + - type: "null" + in: + type: array + items: + type: string + notIn: + type: array + items: + type: string + lt: + type: string + lte: + type: string + gt: + type: string + gte: + type: string + between: + minItems: 2 + maxItems: 2 + type: array + items: + type: string + not: + $ref: "#/components/schemas/StringFilterOptional" + startsWith: + type: string + endsWith: + type: string + contains: + type: string + mode: + anyOf: + - type: string + const: default + - type: string + const: insensitive + additionalProperties: false + BooleanFilter: + anyOf: + - type: boolean + - type: object + properties: + equals: + type: boolean + not: + $ref: "#/components/schemas/BooleanFilter" + additionalProperties: false + DateTimeFilterOptional: + anyOf: + - anyOf: + - $ref: "#/components/schemas/DateTime" + - type: "null" + - type: object + properties: + equals: + anyOf: + - $ref: "#/components/schemas/DateTime" + - type: "null" + in: + type: array + items: + $ref: "#/components/schemas/DateTime" + notIn: + type: array + items: + $ref: "#/components/schemas/DateTime" + lt: + $ref: "#/components/schemas/DateTime" + lte: + $ref: "#/components/schemas/DateTime" + gt: + $ref: "#/components/schemas/DateTime" + gte: + $ref: "#/components/schemas/DateTime" + between: + minItems: 2 + maxItems: 2 + type: array + items: + $ref: "#/components/schemas/DateTime" + not: + $ref: "#/components/schemas/DateTimeFilterOptional" + additionalProperties: false + PostWhereUniqueInputWithoutRelation: + type: object + properties: + id: + $ref: "#/components/schemas/IntFilter" + createdAt: + $ref: "#/components/schemas/DateTimeFilter" + updatedAt: + $ref: "#/components/schemas/DateTimeFilter" + title: + $ref: "#/components/schemas/StringFilter" + authorId: + $ref: "#/components/schemas/StringFilterOptional" + published: + $ref: "#/components/schemas/BooleanFilter" + publishedAt: + $ref: "#/components/schemas/DateTimeFilterOptional" + viewCount: + $ref: "#/components/schemas/IntFilter" + $expr: {} + AND: + anyOf: + - $ref: "#/components/schemas/PostWhereInputWithoutRelation" + - type: array + items: + $ref: "#/components/schemas/PostWhereInputWithoutRelation" + OR: + type: array + items: + $ref: "#/components/schemas/PostWhereInputWithoutRelation" + NOT: + anyOf: + - $ref: "#/components/schemas/PostWhereInputWithoutRelation" + - type: array + items: + $ref: "#/components/schemas/PostWhereInputWithoutRelation" + required: + - id + additionalProperties: false + PostCursorInput: + $ref: "#/components/schemas/PostWhereUniqueInputWithoutRelation" + PostDistinctInput: + anyOf: + - type: string + enum: + - id + - createdAt + - updatedAt + - title + - authorId + - published + - publishedAt + - viewCount + - type: array + items: + type: string + enum: + - id + - createdAt + - updatedAt + - title + - authorId + - published + - publishedAt + - viewCount + UserPostsRelationInput: + anyOf: + - type: boolean + - type: object + properties: + where: + $ref: "#/components/schemas/PostWhereInput" + select: + anyOf: + - $ref: "#/components/schemas/PostSelect" + - type: "null" + include: + anyOf: + - $ref: "#/components/schemas/PostInclude" + - type: "null" + omit: + anyOf: + - $ref: "#/components/schemas/PostOmitInput" + - type: "null" + orderBy: + anyOf: + - $ref: "#/components/schemas/PostOrderByWithRelationInput" + - type: array + items: + $ref: "#/components/schemas/PostOrderByWithRelationInput" + skip: + $ref: "#/components/schemas/_nonNegativeInteger" + take: + $ref: "#/components/schemas/_integer" + cursor: + $ref: "#/components/schemas/PostCursorInput" + distinct: + $ref: "#/components/schemas/PostDistinctInput" + additionalProperties: false + UserProfileRelationInput: + anyOf: + - type: boolean + - type: object + properties: + where: + $ref: "#/components/schemas/ProfileWhereInput" + select: + anyOf: + - $ref: "#/components/schemas/ProfileSelect" + - type: "null" + include: + anyOf: + - $ref: "#/components/schemas/ProfileInclude" + - type: "null" + omit: + anyOf: + - $ref: "#/components/schemas/ProfileOmitInput" + - type: "null" + additionalProperties: false + PostWhereInput: + type: object + properties: + id: + $ref: "#/components/schemas/IntFilter" + createdAt: + $ref: "#/components/schemas/DateTimeFilter" + updatedAt: + $ref: "#/components/schemas/DateTimeFilter" + title: + $ref: "#/components/schemas/StringFilter" + author: + anyOf: + - anyOf: + - $ref: "#/components/schemas/UserWhereInput" + - type: "null" + - type: object + properties: + is: + anyOf: + - $ref: "#/components/schemas/UserWhereInput" + - type: "null" + isNot: + anyOf: + - $ref: "#/components/schemas/UserWhereInput" + - type: "null" + additionalProperties: false + authorId: + $ref: "#/components/schemas/StringFilterOptional" + published: + $ref: "#/components/schemas/BooleanFilter" + publishedAt: + $ref: "#/components/schemas/DateTimeFilterOptional" + viewCount: + $ref: "#/components/schemas/IntFilter" + comments: + type: object + properties: + some: + $ref: "#/components/schemas/CommentWhereInput" + every: + $ref: "#/components/schemas/CommentWhereInput" + none: + $ref: "#/components/schemas/CommentWhereInput" + additionalProperties: false + setting: + anyOf: + - anyOf: + - $ref: "#/components/schemas/SettingWhereInput" + - type: "null" + - type: object + properties: + is: + anyOf: + - $ref: "#/components/schemas/SettingWhereInput" + - type: "null" + isNot: + anyOf: + - $ref: "#/components/schemas/SettingWhereInput" + - type: "null" + additionalProperties: false + $expr: {} + AND: + anyOf: + - $ref: "#/components/schemas/PostWhereInput" + - type: array + items: + $ref: "#/components/schemas/PostWhereInput" + OR: + type: array + items: + $ref: "#/components/schemas/PostWhereInput" + NOT: + anyOf: + - $ref: "#/components/schemas/PostWhereInput" + - type: array + items: + $ref: "#/components/schemas/PostWhereInput" + additionalProperties: false + UserCountSelection: + anyOf: + - type: boolean + const: true + - type: object + properties: + select: + type: object + properties: + posts: + anyOf: + - type: boolean + - type: object + properties: + where: + $ref: "#/components/schemas/PostWhereInput" + required: + - where + additionalProperties: false + additionalProperties: false + required: + - select + additionalProperties: false + UserSelect: + type: object + properties: + myId: + type: boolean + createdAt: + type: boolean + updatedAt: + type: boolean + email: + type: boolean + posts: + $ref: "#/components/schemas/UserPostsRelationInput" + profile: + $ref: "#/components/schemas/UserProfileRelationInput" + address: + type: boolean + someJson: + type: boolean + _count: + $ref: "#/components/schemas/UserCountSelection" + additionalProperties: false + UserInclude: + type: object + properties: + posts: + $ref: "#/components/schemas/UserPostsRelationInput" + profile: + $ref: "#/components/schemas/UserProfileRelationInput" + _count: + $ref: "#/components/schemas/UserCountSelection" + additionalProperties: false + UserOmitInput: + type: object + properties: + myId: + type: boolean + createdAt: + type: boolean + updatedAt: + type: boolean + email: + type: boolean + address: + type: boolean + someJson: + type: boolean + additionalProperties: false + UserFindUniqueArgs: + type: object + properties: + where: + $ref: "#/components/schemas/UserWhereUniqueInput" + select: + anyOf: + - $ref: "#/components/schemas/UserSelect" + - type: "null" + include: + anyOf: + - $ref: "#/components/schemas/UserInclude" + - type: "null" + omit: + anyOf: + - $ref: "#/components/schemas/UserOmitInput" + - type: "null" + required: + - where + additionalProperties: false + UserWhereInput: + type: object + properties: + myId: + $ref: "#/components/schemas/StringFilter" + createdAt: + $ref: "#/components/schemas/DateTimeFilter" + updatedAt: + $ref: "#/components/schemas/DateTimeFilter" + email: + $ref: "#/components/schemas/StringFilter" + posts: + type: object + properties: + some: + $ref: "#/components/schemas/PostWhereInput" + every: + $ref: "#/components/schemas/PostWhereInput" + none: + $ref: "#/components/schemas/PostWhereInput" + additionalProperties: false + profile: + anyOf: + - anyOf: + - $ref: "#/components/schemas/ProfileWhereInput" + - type: "null" + - type: object + properties: + is: + anyOf: + - $ref: "#/components/schemas/ProfileWhereInput" + - type: "null" + isNot: + anyOf: + - $ref: "#/components/schemas/ProfileWhereInput" + - type: "null" + additionalProperties: false + address: + $ref: "#/components/schemas/AddressFilterOptional" + someJson: + $ref: "#/components/schemas/JsonFilterOptional" + $expr: {} + AND: + anyOf: + - $ref: "#/components/schemas/UserWhereInput" + - type: array + items: + $ref: "#/components/schemas/UserWhereInput" + OR: + type: array + items: + $ref: "#/components/schemas/UserWhereInput" + NOT: + anyOf: + - $ref: "#/components/schemas/UserWhereInput" + - type: array + items: + $ref: "#/components/schemas/UserWhereInput" + additionalProperties: false + UserOrderByWithRelationInput: + type: object + properties: + myId: + anyOf: + - type: string + const: asc + - type: string + const: desc + createdAt: + anyOf: + - type: string + const: asc + - type: string + const: desc + updatedAt: + anyOf: + - type: string + const: asc + - type: string + const: desc + email: + anyOf: + - type: string + const: asc + - type: string + const: desc + posts: + type: object + properties: + id: + anyOf: + - type: string + const: asc + - type: string + const: desc + createdAt: + anyOf: + - type: string + const: asc + - type: string + const: desc + updatedAt: + anyOf: + - type: string + const: asc + - type: string + const: desc + title: + anyOf: + - type: string + const: asc + - type: string + const: desc + author: + $ref: "#/components/schemas/UserOrderByWithRelationInput" + authorId: + anyOf: + - anyOf: + - type: string + const: asc + - type: string + const: desc + - type: object + properties: + sort: + anyOf: + - type: string + const: asc + - type: string + const: desc + nulls: + anyOf: + - type: string + const: first + - type: string + const: last + required: + - sort + - nulls + additionalProperties: false + published: + anyOf: + - type: string + const: asc + - type: string + const: desc + publishedAt: + anyOf: + - anyOf: + - type: string + const: asc + - type: string + const: desc + - type: object + properties: + sort: + anyOf: + - type: string + const: asc + - type: string + const: desc + nulls: + anyOf: + - type: string + const: first + - type: string + const: last + required: + - sort + - nulls + additionalProperties: false + viewCount: + anyOf: + - type: string + const: asc + - type: string + const: desc + comments: + type: object + properties: + id: + anyOf: + - type: string + const: asc + - type: string + const: desc + post: + $ref: "#/components/schemas/PostOrderByWithRelationInput" + postId: + anyOf: + - type: string + const: asc + - type: string + const: desc + content: + anyOf: + - type: string + const: asc + - type: string + const: desc + _count: + anyOf: + - type: string + const: asc + - type: string + const: desc + required: + - _count + additionalProperties: false + setting: + $ref: "#/components/schemas/SettingOrderByWithRelationInput" + _count: + anyOf: + - type: string + const: asc + - type: string + const: desc + required: + - _count + additionalProperties: false + profile: + $ref: "#/components/schemas/ProfileOrderByWithRelationInput" + address: + anyOf: + - anyOf: + - type: string + const: asc + - type: string + const: desc + - type: object + properties: + sort: + anyOf: + - type: string + const: asc + - type: string + const: desc + nulls: + anyOf: + - type: string + const: first + - type: string + const: last + required: + - sort + - nulls + additionalProperties: false + someJson: + anyOf: + - anyOf: + - type: string + const: asc + - type: string + const: desc + - type: object + properties: + sort: + anyOf: + - type: string + const: asc + - type: string + const: desc + nulls: + anyOf: + - type: string + const: first + - type: string + const: last + required: + - sort + - nulls + additionalProperties: false + additionalProperties: false + UserWhereUniqueInputWithoutRelation: + type: object + properties: + myId: + $ref: "#/components/schemas/StringFilter" + createdAt: + $ref: "#/components/schemas/DateTimeFilter" + updatedAt: + $ref: "#/components/schemas/DateTimeFilter" + email: + $ref: "#/components/schemas/StringFilter" + address: + $ref: "#/components/schemas/AddressFilterOptional" + someJson: + $ref: "#/components/schemas/JsonFilterOptional" + $expr: {} + AND: + anyOf: + - $ref: "#/components/schemas/UserWhereInputWithoutRelation" + - type: array + items: + $ref: "#/components/schemas/UserWhereInputWithoutRelation" + OR: + type: array + items: + $ref: "#/components/schemas/UserWhereInputWithoutRelation" + NOT: + anyOf: + - $ref: "#/components/schemas/UserWhereInputWithoutRelation" + - type: array + items: + $ref: "#/components/schemas/UserWhereInputWithoutRelation" + additionalProperties: false + UserCursorInput: + $ref: "#/components/schemas/UserWhereUniqueInputWithoutRelation" + UserDistinctInput: + anyOf: + - type: string + enum: + - myId + - createdAt + - updatedAt + - email + - address + - someJson + - type: array + items: + type: string + enum: + - myId + - createdAt + - updatedAt + - email + - address + - someJson + UserFindFirstArgs: + type: object + properties: + where: + $ref: "#/components/schemas/UserWhereInput" + select: + anyOf: + - $ref: "#/components/schemas/UserSelect" + - type: "null" + include: + anyOf: + - $ref: "#/components/schemas/UserInclude" + - type: "null" + omit: + anyOf: + - $ref: "#/components/schemas/UserOmitInput" + - type: "null" + skip: + $ref: "#/components/schemas/_nonNegativeInteger" + take: + type: number + const: 1 + orderBy: + anyOf: + - $ref: "#/components/schemas/UserOrderByWithRelationInput" + - type: array + items: + $ref: "#/components/schemas/UserOrderByWithRelationInput" + cursor: + $ref: "#/components/schemas/UserCursorInput" + distinct: + $ref: "#/components/schemas/UserDistinctInput" + additionalProperties: false + UserFindManyArgs: + type: object + properties: + where: + $ref: "#/components/schemas/UserWhereInput" + select: + anyOf: + - $ref: "#/components/schemas/UserSelect" + - type: "null" + include: + anyOf: + - $ref: "#/components/schemas/UserInclude" + - type: "null" + omit: + anyOf: + - $ref: "#/components/schemas/UserOmitInput" + - type: "null" + skip: + $ref: "#/components/schemas/_nonNegativeInteger" + take: + $ref: "#/components/schemas/_integer" + orderBy: + anyOf: + - $ref: "#/components/schemas/UserOrderByWithRelationInput" + - type: array + items: + $ref: "#/components/schemas/UserOrderByWithRelationInput" + cursor: + $ref: "#/components/schemas/UserCursorInput" + distinct: + $ref: "#/components/schemas/UserDistinctInput" + additionalProperties: false + UserExistsArgs: + type: object + properties: + where: + $ref: "#/components/schemas/UserWhereInput" + additionalProperties: false + Address: + type: object + properties: + city: + type: string + required: + - city + UserCreateData: + anyOf: + - type: object + properties: + myId: + type: string + createdAt: + $ref: "#/components/schemas/DateTime" + updatedAt: + $ref: "#/components/schemas/DateTime" + email: + type: string + format: email + pattern: ^(?!\.)(?!.*\.\.)([A-Za-z0-9_'+\-\.]*)[A-Za-z0-9_+-]@([A-Za-z0-9][A-Za-z0-9\-]*\.)+[A-Za-z]{2,}$ + posts: + type: object + properties: + connect: + anyOf: + - $ref: "#/components/schemas/PostWhereUniqueInput" + - type: array + items: + $ref: "#/components/schemas/PostWhereUniqueInput" + create: + $ref: "#/components/schemas/PostCreateDataArrayWithoutauthorauthorId" + connectOrCreate: + anyOf: + - type: object + properties: + where: + $ref: "#/components/schemas/PostWhereUniqueInput" + create: + $ref: "#/components/schemas/PostCreateDataWithoutauthorauthorId" + required: + - where + - create + additionalProperties: false + - type: array + items: + type: object + properties: + where: + $ref: "#/components/schemas/PostWhereUniqueInput" + create: + $ref: "#/components/schemas/PostCreateDataWithoutauthorauthorId" + required: + - where + - create + additionalProperties: false + createMany: + $ref: "#/components/schemas/PostCreateManyPayloadWithoutauthorauthorId" + additionalProperties: false + profile: + anyOf: + - type: object + properties: + connect: + $ref: "#/components/schemas/ProfileWhereUniqueInput" + create: + $ref: "#/components/schemas/ProfileCreateDataWithoutuseruserId" + connectOrCreate: + type: object + properties: + where: + $ref: "#/components/schemas/ProfileWhereUniqueInput" + create: + $ref: "#/components/schemas/ProfileCreateDataWithoutuseruserId" + required: + - where + - create + additionalProperties: false + additionalProperties: false + - type: "null" + address: {} + someJson: + anyOf: + - $ref: "#/components/schemas/JsonValue" + - {} + required: + - email + additionalProperties: false + - type: object + properties: + myId: + type: string + createdAt: + $ref: "#/components/schemas/DateTime" + updatedAt: + $ref: "#/components/schemas/DateTime" + email: + type: string + format: email + pattern: ^(?!\.)(?!.*\.\.)([A-Za-z0-9_'+\-\.]*)[A-Za-z0-9_+-]@([A-Za-z0-9][A-Za-z0-9\-]*\.)+[A-Za-z]{2,}$ + posts: + type: object + properties: + connect: + anyOf: + - $ref: "#/components/schemas/PostWhereUniqueInput" + - type: array + items: + $ref: "#/components/schemas/PostWhereUniqueInput" + create: + $ref: "#/components/schemas/PostCreateDataArrayWithoutauthorauthorId" + connectOrCreate: + anyOf: + - type: object + properties: + where: + $ref: "#/components/schemas/PostWhereUniqueInput" + create: + $ref: "#/components/schemas/PostCreateDataWithoutauthorauthorId" + required: + - where + - create + additionalProperties: false + - type: array + items: + type: object + properties: + where: + $ref: "#/components/schemas/PostWhereUniqueInput" + create: + $ref: "#/components/schemas/PostCreateDataWithoutauthorauthorId" + required: + - where + - create + additionalProperties: false + createMany: + $ref: "#/components/schemas/PostCreateManyPayloadWithoutauthorauthorId" + additionalProperties: false + profile: + anyOf: + - type: object + properties: + connect: + $ref: "#/components/schemas/ProfileWhereUniqueInput" + create: + $ref: "#/components/schemas/ProfileCreateDataWithoutuseruserId" + connectOrCreate: + type: object + properties: + where: + $ref: "#/components/schemas/ProfileWhereUniqueInput" + create: + $ref: "#/components/schemas/ProfileCreateDataWithoutuseruserId" + required: + - where + - create + additionalProperties: false + additionalProperties: false + - type: "null" + address: {} + someJson: + anyOf: + - $ref: "#/components/schemas/JsonValue" + - {} + required: + - email + additionalProperties: false + UserCreateArgs: + type: object + properties: + data: + $ref: "#/components/schemas/UserCreateData" + select: + anyOf: + - $ref: "#/components/schemas/UserSelect" + - type: "null" + include: + anyOf: + - $ref: "#/components/schemas/UserInclude" + - type: "null" + omit: + anyOf: + - $ref: "#/components/schemas/UserOmitInput" + - type: "null" + required: + - data + additionalProperties: false + UserCreateDataArrayWithoutRelation: + anyOf: + - type: object + properties: + myId: + type: string + createdAt: + $ref: "#/components/schemas/DateTime" + updatedAt: + $ref: "#/components/schemas/DateTime" + email: + type: string + format: email + pattern: ^(?!\.)(?!.*\.\.)([A-Za-z0-9_'+\-\.]*)[A-Za-z0-9_+-]@([A-Za-z0-9][A-Za-z0-9\-]*\.)+[A-Za-z]{2,}$ + address: {} + someJson: + anyOf: + - $ref: "#/components/schemas/JsonValue" + - {} + required: + - email + additionalProperties: false + - type: array + items: + type: object + properties: + myId: + type: string + createdAt: + $ref: "#/components/schemas/DateTime" + updatedAt: + $ref: "#/components/schemas/DateTime" + email: + type: string + format: email + pattern: ^(?!\.)(?!.*\.\.)([A-Za-z0-9_'+\-\.]*)[A-Za-z0-9_+-]@([A-Za-z0-9][A-Za-z0-9\-]*\.)+[A-Za-z]{2,}$ + address: {} + someJson: + anyOf: + - $ref: "#/components/schemas/JsonValue" + - {} + required: + - email + additionalProperties: false + UserCreateManyPayload: + type: object + properties: + data: + $ref: "#/components/schemas/UserCreateDataArrayWithoutRelation" + skipDuplicates: + type: boolean + required: + - data + additionalProperties: false + UserCreateManyArgs: + type: object + properties: + data: + $ref: "#/components/schemas/UserCreateDataArrayWithoutRelation" + skipDuplicates: + type: boolean + required: + - data + additionalProperties: false + UserCreateManyAndReturnArgs: + type: object + properties: + data: + $ref: "#/components/schemas/UserCreateDataArrayWithoutRelation" + skipDuplicates: + type: boolean + select: + anyOf: + - $ref: "#/components/schemas/UserSelect" + - type: "null" + omit: + anyOf: + - $ref: "#/components/schemas/UserOmitInput" + - type: "null" + required: + - data + additionalProperties: false + UserUpdateData: + anyOf: + - type: object + properties: + myId: + type: string + createdAt: + $ref: "#/components/schemas/DateTime" + updatedAt: + $ref: "#/components/schemas/DateTime" + email: + type: string + format: email + pattern: ^(?!\.)(?!.*\.\.)([A-Za-z0-9_'+\-\.]*)[A-Za-z0-9_+-]@([A-Za-z0-9][A-Za-z0-9\-]*\.)+[A-Za-z]{2,}$ + posts: + type: object + properties: + connect: + anyOf: + - $ref: "#/components/schemas/PostWhereUniqueInput" + - type: array + items: + $ref: "#/components/schemas/PostWhereUniqueInput" + create: + $ref: "#/components/schemas/PostCreateDataArrayWithoutauthorauthorId" + connectOrCreate: + anyOf: + - type: object + properties: + where: + $ref: "#/components/schemas/PostWhereUniqueInput" + create: + $ref: "#/components/schemas/PostCreateDataWithoutauthorauthorId" + required: + - where + - create + additionalProperties: false + - type: array + items: + type: object + properties: + where: + $ref: "#/components/schemas/PostWhereUniqueInput" + create: + $ref: "#/components/schemas/PostCreateDataWithoutauthorauthorId" + required: + - where + - create + additionalProperties: false + createMany: + $ref: "#/components/schemas/PostCreateManyPayloadWithoutauthorauthorId" + disconnect: + anyOf: + - $ref: "#/components/schemas/PostWhereUniqueInput" + - type: array + items: + $ref: "#/components/schemas/PostWhereUniqueInput" + delete: + anyOf: + - $ref: "#/components/schemas/PostWhereUniqueInput" + - type: array + items: + $ref: "#/components/schemas/PostWhereUniqueInput" + update: + anyOf: + - type: object + properties: + where: + $ref: "#/components/schemas/PostWhereUniqueInput" + data: + $ref: "#/components/schemas/PostUpdateDataWithoutauthorauthorId" + required: + - where + - data + additionalProperties: false + - type: array + items: + type: object + properties: + where: + $ref: "#/components/schemas/PostWhereUniqueInput" + data: + $ref: "#/components/schemas/PostUpdateDataWithoutauthorauthorId" + required: + - where + - data + additionalProperties: false + upsert: + anyOf: + - type: object + properties: + where: + $ref: "#/components/schemas/PostWhereUniqueInput" + create: + $ref: "#/components/schemas/PostCreateDataWithoutauthorauthorId" + update: + $ref: "#/components/schemas/PostUpdateDataWithoutauthorauthorId" + required: + - where + - create + - update + additionalProperties: false + - type: array + items: + type: object + properties: + where: + $ref: "#/components/schemas/PostWhereUniqueInput" + create: + $ref: "#/components/schemas/PostCreateDataWithoutauthorauthorId" + update: + $ref: "#/components/schemas/PostUpdateDataWithoutauthorauthorId" + required: + - where + - create + - update + additionalProperties: false + set: + anyOf: + - $ref: "#/components/schemas/PostWhereUniqueInput" + - type: array + items: + $ref: "#/components/schemas/PostWhereUniqueInput" + updateMany: + anyOf: + - type: object + properties: + where: + $ref: "#/components/schemas/PostWhereInputWithoutRelation" + data: + $ref: "#/components/schemas/PostUpdateDataWithoutauthorauthorId" + required: + - where + - data + additionalProperties: false + - type: array + items: + type: object + properties: + where: + $ref: "#/components/schemas/PostWhereInputWithoutRelation" + data: + $ref: "#/components/schemas/PostUpdateDataWithoutauthorauthorId" + required: + - where + - data + additionalProperties: false + deleteMany: + anyOf: + - $ref: "#/components/schemas/PostWhereInput" + - type: array + items: + $ref: "#/components/schemas/PostWhereInput" + additionalProperties: false + profile: + anyOf: + - type: object + properties: + connect: + $ref: "#/components/schemas/ProfileWhereUniqueInput" + create: + $ref: "#/components/schemas/ProfileCreateDataWithoutuseruserId" + connectOrCreate: + type: object + properties: + where: + $ref: "#/components/schemas/ProfileWhereUniqueInput" + create: + $ref: "#/components/schemas/ProfileCreateDataWithoutuseruserId" + required: + - where + - create + additionalProperties: false + disconnect: + anyOf: + - type: boolean + - $ref: "#/components/schemas/ProfileWhereInput" + delete: + anyOf: + - type: boolean + - $ref: "#/components/schemas/ProfileWhereUniqueInput" + update: + anyOf: + - type: object + properties: + where: + $ref: "#/components/schemas/ProfileWhereInput" + data: + $ref: "#/components/schemas/ProfileUpdateDataWithoutuseruserId" + required: + - data + additionalProperties: false + - $ref: "#/components/schemas/ProfileUpdateDataWithoutuseruserId" + upsert: + anyOf: + - type: object + properties: + where: + $ref: "#/components/schemas/ProfileWhereUniqueInput" + create: + $ref: "#/components/schemas/ProfileCreateDataWithoutuseruserId" + update: + $ref: "#/components/schemas/ProfileUpdateDataWithoutuseruserId" + required: + - create + - update + additionalProperties: false + - type: array + items: + type: object + properties: + where: + $ref: "#/components/schemas/ProfileWhereUniqueInput" + create: + $ref: "#/components/schemas/ProfileCreateDataWithoutuseruserId" + update: + $ref: "#/components/schemas/ProfileUpdateDataWithoutuseruserId" + required: + - create + - update + additionalProperties: false + additionalProperties: false + - type: "null" + address: {} + someJson: + anyOf: + - $ref: "#/components/schemas/JsonValue" + - {} + additionalProperties: false + - type: object + properties: + myId: + type: string + createdAt: + $ref: "#/components/schemas/DateTime" + updatedAt: + $ref: "#/components/schemas/DateTime" + email: + type: string + format: email + pattern: ^(?!\.)(?!.*\.\.)([A-Za-z0-9_'+\-\.]*)[A-Za-z0-9_+-]@([A-Za-z0-9][A-Za-z0-9\-]*\.)+[A-Za-z]{2,}$ + posts: + type: object + properties: + connect: + anyOf: + - $ref: "#/components/schemas/PostWhereUniqueInput" + - type: array + items: + $ref: "#/components/schemas/PostWhereUniqueInput" + create: + $ref: "#/components/schemas/PostCreateDataArrayWithoutauthorauthorId" + connectOrCreate: + anyOf: + - type: object + properties: + where: + $ref: "#/components/schemas/PostWhereUniqueInput" + create: + $ref: "#/components/schemas/PostCreateDataWithoutauthorauthorId" + required: + - where + - create + additionalProperties: false + - type: array + items: + type: object + properties: + where: + $ref: "#/components/schemas/PostWhereUniqueInput" + create: + $ref: "#/components/schemas/PostCreateDataWithoutauthorauthorId" + required: + - where + - create + additionalProperties: false + createMany: + $ref: "#/components/schemas/PostCreateManyPayloadWithoutauthorauthorId" + disconnect: + anyOf: + - $ref: "#/components/schemas/PostWhereUniqueInput" + - type: array + items: + $ref: "#/components/schemas/PostWhereUniqueInput" + delete: + anyOf: + - $ref: "#/components/schemas/PostWhereUniqueInput" + - type: array + items: + $ref: "#/components/schemas/PostWhereUniqueInput" + update: + anyOf: + - type: object + properties: + where: + $ref: "#/components/schemas/PostWhereUniqueInput" + data: + $ref: "#/components/schemas/PostUpdateDataWithoutauthorauthorId" + required: + - where + - data + additionalProperties: false + - type: array + items: + type: object + properties: + where: + $ref: "#/components/schemas/PostWhereUniqueInput" + data: + $ref: "#/components/schemas/PostUpdateDataWithoutauthorauthorId" + required: + - where + - data + additionalProperties: false + upsert: + anyOf: + - type: object + properties: + where: + $ref: "#/components/schemas/PostWhereUniqueInput" + create: + $ref: "#/components/schemas/PostCreateDataWithoutauthorauthorId" + update: + $ref: "#/components/schemas/PostUpdateDataWithoutauthorauthorId" + required: + - where + - create + - update + additionalProperties: false + - type: array + items: + type: object + properties: + where: + $ref: "#/components/schemas/PostWhereUniqueInput" + create: + $ref: "#/components/schemas/PostCreateDataWithoutauthorauthorId" + update: + $ref: "#/components/schemas/PostUpdateDataWithoutauthorauthorId" + required: + - where + - create + - update + additionalProperties: false + set: + anyOf: + - $ref: "#/components/schemas/PostWhereUniqueInput" + - type: array + items: + $ref: "#/components/schemas/PostWhereUniqueInput" + updateMany: + anyOf: + - type: object + properties: + where: + $ref: "#/components/schemas/PostWhereInputWithoutRelation" + data: + $ref: "#/components/schemas/PostUpdateDataWithoutauthorauthorId" + required: + - where + - data + additionalProperties: false + - type: array + items: + type: object + properties: + where: + $ref: "#/components/schemas/PostWhereInputWithoutRelation" + data: + $ref: "#/components/schemas/PostUpdateDataWithoutauthorauthorId" + required: + - where + - data + additionalProperties: false + deleteMany: + anyOf: + - $ref: "#/components/schemas/PostWhereInput" + - type: array + items: + $ref: "#/components/schemas/PostWhereInput" + additionalProperties: false + profile: + anyOf: + - type: object + properties: + connect: + $ref: "#/components/schemas/ProfileWhereUniqueInput" + create: + $ref: "#/components/schemas/ProfileCreateDataWithoutuseruserId" + connectOrCreate: + type: object + properties: + where: + $ref: "#/components/schemas/ProfileWhereUniqueInput" + create: + $ref: "#/components/schemas/ProfileCreateDataWithoutuseruserId" + required: + - where + - create + additionalProperties: false + disconnect: + anyOf: + - type: boolean + - $ref: "#/components/schemas/ProfileWhereInput" + delete: + anyOf: + - type: boolean + - $ref: "#/components/schemas/ProfileWhereUniqueInput" + update: + anyOf: + - type: object + properties: + where: + $ref: "#/components/schemas/ProfileWhereInput" + data: + $ref: "#/components/schemas/ProfileUpdateDataWithoutuseruserId" + required: + - data + additionalProperties: false + - $ref: "#/components/schemas/ProfileUpdateDataWithoutuseruserId" + upsert: + anyOf: + - type: object + properties: + where: + $ref: "#/components/schemas/ProfileWhereUniqueInput" + create: + $ref: "#/components/schemas/ProfileCreateDataWithoutuseruserId" + update: + $ref: "#/components/schemas/ProfileUpdateDataWithoutuseruserId" + required: + - create + - update + additionalProperties: false + - type: array + items: + type: object + properties: + where: + $ref: "#/components/schemas/ProfileWhereUniqueInput" + create: + $ref: "#/components/schemas/ProfileCreateDataWithoutuseruserId" + update: + $ref: "#/components/schemas/ProfileUpdateDataWithoutuseruserId" + required: + - create + - update + additionalProperties: false + additionalProperties: false + - type: "null" + address: {} + someJson: + anyOf: + - $ref: "#/components/schemas/JsonValue" + - {} + additionalProperties: false + UserUpdateArgs: + type: object + properties: + where: + $ref: "#/components/schemas/UserWhereUniqueInput" + data: + $ref: "#/components/schemas/UserUpdateData" + select: + anyOf: + - $ref: "#/components/schemas/UserSelect" + - type: "null" + include: + anyOf: + - $ref: "#/components/schemas/UserInclude" + - type: "null" + omit: + anyOf: + - $ref: "#/components/schemas/UserOmitInput" + - type: "null" + required: + - where + - data + additionalProperties: false + UserUpdateDataWithoutRelation: + type: object + properties: + myId: + type: string + createdAt: + $ref: "#/components/schemas/DateTime" + updatedAt: + $ref: "#/components/schemas/DateTime" + email: + type: string + format: email + pattern: ^(?!\.)(?!.*\.\.)([A-Za-z0-9_'+\-\.]*)[A-Za-z0-9_+-]@([A-Za-z0-9][A-Za-z0-9\-]*\.)+[A-Za-z]{2,}$ + address: {} + someJson: + anyOf: + - $ref: "#/components/schemas/JsonValue" + - {} + additionalProperties: false + UserUpdateManyArgs: + type: object + properties: + where: + $ref: "#/components/schemas/UserWhereInput" + data: + $ref: "#/components/schemas/UserUpdateDataWithoutRelation" + limit: + $ref: "#/components/schemas/_nonNegativeInteger" + required: + - data + additionalProperties: false + UserUpdateManyAndReturnArgs: + type: object + properties: + where: + $ref: "#/components/schemas/UserWhereInput" + data: + $ref: "#/components/schemas/UserUpdateDataWithoutRelation" + limit: + $ref: "#/components/schemas/_nonNegativeInteger" + select: + anyOf: + - $ref: "#/components/schemas/UserSelect" + - type: "null" + omit: + anyOf: + - $ref: "#/components/schemas/UserOmitInput" + - type: "null" + required: + - data + additionalProperties: false + UserUpsertArgs: + type: object + properties: + where: + $ref: "#/components/schemas/UserWhereUniqueInput" + create: + $ref: "#/components/schemas/UserCreateData" + update: + $ref: "#/components/schemas/UserUpdateData" + select: + anyOf: + - $ref: "#/components/schemas/UserSelect" + - type: "null" + include: + anyOf: + - $ref: "#/components/schemas/UserInclude" + - type: "null" + omit: + anyOf: + - $ref: "#/components/schemas/UserOmitInput" + - type: "null" + required: + - where + - create + - update + additionalProperties: false + UserDeleteArgs: + type: object + properties: + where: + $ref: "#/components/schemas/UserWhereUniqueInput" + select: + anyOf: + - $ref: "#/components/schemas/UserSelect" + - type: "null" + include: + anyOf: + - $ref: "#/components/schemas/UserInclude" + - type: "null" + omit: + anyOf: + - $ref: "#/components/schemas/UserOmitInput" + - type: "null" + required: + - where + additionalProperties: false + UserDeleteManyArgs: + type: object + properties: + where: + $ref: "#/components/schemas/UserWhereInput" + limit: + $ref: "#/components/schemas/_nonNegativeInteger" + additionalProperties: false + UserCountAggregateInput: + anyOf: + - type: boolean + const: true + - type: object + properties: + _all: + type: boolean + const: true + myId: + type: boolean + const: true + createdAt: + type: boolean + const: true + updatedAt: + type: boolean + const: true + email: + type: boolean + const: true + posts: + type: boolean + const: true + profile: + type: boolean + const: true + address: + type: boolean + const: true + someJson: + type: boolean + const: true + additionalProperties: false + UserCountArgs: + type: object + properties: + where: + $ref: "#/components/schemas/UserWhereInput" + skip: + $ref: "#/components/schemas/_nonNegativeInteger" + take: + $ref: "#/components/schemas/_integer" + orderBy: + anyOf: + - $ref: "#/components/schemas/UserOrderByWithRelationInput" + - type: array + items: + $ref: "#/components/schemas/UserOrderByWithRelationInput" + select: + $ref: "#/components/schemas/UserCountAggregateInput" + additionalProperties: false + UserSumAvgAggregateInput: + type: object + properties: {} + additionalProperties: false + UserMinMaxAggregateInput: + type: object + properties: + myId: + type: boolean + const: true + createdAt: + type: boolean + const: true + updatedAt: + type: boolean + const: true + email: + type: boolean + const: true + address: + type: boolean + const: true + someJson: + type: boolean + const: true + additionalProperties: false + UserAggregateArgs: + type: object + properties: + where: + $ref: "#/components/schemas/UserWhereInput" + skip: + $ref: "#/components/schemas/_nonNegativeInteger" + take: + $ref: "#/components/schemas/_integer" + orderBy: + anyOf: + - $ref: "#/components/schemas/UserOrderByWithRelationInput" + - type: array + items: + $ref: "#/components/schemas/UserOrderByWithRelationInput" + _count: + $ref: "#/components/schemas/UserCountAggregateInput" + _avg: + $ref: "#/components/schemas/UserSumAvgAggregateInput" + _sum: + $ref: "#/components/schemas/UserSumAvgAggregateInput" + _min: + $ref: "#/components/schemas/UserMinMaxAggregateInput" + _max: + $ref: "#/components/schemas/UserMinMaxAggregateInput" + additionalProperties: false + UserOrderByWithAggregationInput: + type: object + properties: + myId: + anyOf: + - type: string + const: asc + - type: string + const: desc + createdAt: + anyOf: + - type: string + const: asc + - type: string + const: desc + updatedAt: + anyOf: + - type: string + const: asc + - type: string + const: desc + email: + anyOf: + - type: string + const: asc + - type: string + const: desc + address: + anyOf: + - anyOf: + - type: string + const: asc + - type: string + const: desc + - type: object + properties: + sort: + anyOf: + - type: string + const: asc + - type: string + const: desc + nulls: + anyOf: + - type: string + const: first + - type: string + const: last + required: + - sort + - nulls + additionalProperties: false + someJson: + anyOf: + - anyOf: + - type: string + const: asc + - type: string + const: desc + - type: object + properties: + sort: + anyOf: + - type: string + const: asc + - type: string + const: desc + nulls: + anyOf: + - type: string + const: first + - type: string + const: last + required: + - sort + - nulls + additionalProperties: false + _count: + $ref: "#/components/schemas/UserOrderByWithRelationInput" + _avg: + $ref: "#/components/schemas/UserOrderByWithRelationInput" + _sum: + $ref: "#/components/schemas/UserOrderByWithRelationInput" + _min: + $ref: "#/components/schemas/UserOrderByWithRelationInput" + _max: + $ref: "#/components/schemas/UserOrderByWithRelationInput" + additionalProperties: false + StringFilterAgg: + anyOf: + - type: string + - type: object + properties: + equals: + type: string + in: + type: array + items: + type: string + notIn: + type: array + items: + type: string + lt: + type: string + lte: + type: string + gt: + type: string + gte: + type: string + between: + minItems: 2 + maxItems: 2 + type: array + items: + type: string + not: + $ref: "#/components/schemas/StringFilterAgg" + _count: + $ref: "#/components/schemas/IntFilter" + _min: + anyOf: + - type: string + - type: object + properties: + equals: + type: string + in: + type: array + items: + type: string + notIn: + type: array + items: + type: string + lt: + type: string + lte: + type: string + gt: + type: string + gte: + type: string + between: + minItems: 2 + maxItems: 2 + type: array + items: + type: string + not: + $ref: "#/components/schemas/StringFilterAgg" + additionalProperties: false + _max: + anyOf: + - type: string + - type: object + properties: + equals: + type: string + in: + type: array + items: + type: string + notIn: + type: array + items: + type: string + lt: + type: string + lte: + type: string + gt: + type: string + gte: + type: string + between: + minItems: 2 + maxItems: 2 + type: array + items: + type: string + not: + $ref: "#/components/schemas/StringFilterAgg" + additionalProperties: false + startsWith: + type: string + endsWith: + type: string + contains: + type: string + mode: + anyOf: + - type: string + const: default + - type: string + const: insensitive + additionalProperties: false + DateTimeFilterAgg: + anyOf: + - $ref: "#/components/schemas/DateTime" + - type: object + properties: + equals: + $ref: "#/components/schemas/DateTime" + in: + type: array + items: + $ref: "#/components/schemas/DateTime" + notIn: + type: array + items: + $ref: "#/components/schemas/DateTime" + lt: + $ref: "#/components/schemas/DateTime" + lte: + $ref: "#/components/schemas/DateTime" + gt: + $ref: "#/components/schemas/DateTime" + gte: + $ref: "#/components/schemas/DateTime" + between: + minItems: 2 + maxItems: 2 + type: array + items: + $ref: "#/components/schemas/DateTime" + not: + $ref: "#/components/schemas/DateTimeFilterAgg" + _count: + $ref: "#/components/schemas/IntFilter" + _min: + anyOf: + - $ref: "#/components/schemas/DateTime" + - type: object + properties: + equals: + $ref: "#/components/schemas/DateTime" + in: + type: array + items: + $ref: "#/components/schemas/DateTime" + notIn: + type: array + items: + $ref: "#/components/schemas/DateTime" + lt: + $ref: "#/components/schemas/DateTime" + lte: + $ref: "#/components/schemas/DateTime" + gt: + $ref: "#/components/schemas/DateTime" + gte: + $ref: "#/components/schemas/DateTime" + between: + minItems: 2 + maxItems: 2 + type: array + items: + $ref: "#/components/schemas/DateTime" + not: + $ref: "#/components/schemas/DateTimeFilterAgg" + additionalProperties: false + _max: + anyOf: + - $ref: "#/components/schemas/DateTime" + - type: object + properties: + equals: + $ref: "#/components/schemas/DateTime" + in: + type: array + items: + $ref: "#/components/schemas/DateTime" + notIn: + type: array + items: + $ref: "#/components/schemas/DateTime" + lt: + $ref: "#/components/schemas/DateTime" + lte: + $ref: "#/components/schemas/DateTime" + gt: + $ref: "#/components/schemas/DateTime" + gte: + $ref: "#/components/schemas/DateTime" + between: + minItems: 2 + maxItems: 2 + type: array + items: + $ref: "#/components/schemas/DateTime" + not: + $ref: "#/components/schemas/DateTimeFilterAgg" + additionalProperties: false + additionalProperties: false + UserWhereInputWithoutRelationWithAggregation: + type: object + properties: + myId: + $ref: "#/components/schemas/StringFilterAgg" + createdAt: + $ref: "#/components/schemas/DateTimeFilterAgg" + updatedAt: + $ref: "#/components/schemas/DateTimeFilterAgg" + email: + $ref: "#/components/schemas/StringFilterAgg" + address: + $ref: "#/components/schemas/AddressFilterOptional" + someJson: + $ref: "#/components/schemas/JsonFilterOptional" + $expr: {} + AND: + anyOf: + - $ref: "#/components/schemas/UserWhereInputWithoutRelation" + - type: array + items: + $ref: "#/components/schemas/UserWhereInputWithoutRelation" + OR: + type: array + items: + $ref: "#/components/schemas/UserWhereInputWithoutRelation" + NOT: + anyOf: + - $ref: "#/components/schemas/UserWhereInputWithoutRelation" + - type: array + items: + $ref: "#/components/schemas/UserWhereInputWithoutRelation" + additionalProperties: false + UserGroupByArgs: + type: object + properties: + where: + $ref: "#/components/schemas/UserWhereInput" + orderBy: + anyOf: + - $ref: "#/components/schemas/UserOrderByWithAggregationInput" + - type: array + items: + $ref: "#/components/schemas/UserOrderByWithAggregationInput" + by: + anyOf: + - type: string + enum: + - myId + - createdAt + - updatedAt + - email + - address + - someJson + - type: array + items: + type: string + enum: + - myId + - createdAt + - updatedAt + - email + - address + - someJson + having: + $ref: "#/components/schemas/UserWhereInputWithoutRelationWithAggregation" + skip: + $ref: "#/components/schemas/_nonNegativeInteger" + take: + $ref: "#/components/schemas/_integer" + _count: + $ref: "#/components/schemas/UserCountAggregateInput" + _avg: + $ref: "#/components/schemas/UserSumAvgAggregateInput" + _sum: + $ref: "#/components/schemas/UserSumAvgAggregateInput" + _min: + $ref: "#/components/schemas/UserMinMaxAggregateInput" + _max: + $ref: "#/components/schemas/UserMinMaxAggregateInput" + required: + - by + additionalProperties: false + ProfileWhereUniqueInput: + type: object + properties: + id: + $ref: "#/components/schemas/IntFilter" + gender: + $ref: "#/components/schemas/StringFilter" + user: + anyOf: + - $ref: "#/components/schemas/UserWhereInput" + - type: object + properties: + is: + $ref: "#/components/schemas/UserWhereInput" + isNot: + $ref: "#/components/schemas/UserWhereInput" + additionalProperties: false + userId: + $ref: "#/components/schemas/StringFilter" + $expr: {} + AND: + anyOf: + - $ref: "#/components/schemas/ProfileWhereInput" + - type: array + items: + $ref: "#/components/schemas/ProfileWhereInput" + OR: + type: array + items: + $ref: "#/components/schemas/ProfileWhereInput" + NOT: + anyOf: + - $ref: "#/components/schemas/ProfileWhereInput" + - type: array + items: + $ref: "#/components/schemas/ProfileWhereInput" + additionalProperties: false + ProfileUserRelationInput: + anyOf: + - type: boolean + - type: object + properties: + select: + anyOf: + - $ref: "#/components/schemas/UserSelect" + - type: "null" + include: + anyOf: + - $ref: "#/components/schemas/UserInclude" + - type: "null" + omit: + anyOf: + - $ref: "#/components/schemas/UserOmitInput" + - type: "null" + additionalProperties: false + ProfileSelect: + type: object + properties: + id: + type: boolean + gender: + type: boolean + user: + $ref: "#/components/schemas/ProfileUserRelationInput" + userId: + type: boolean + additionalProperties: false + ProfileInclude: + type: object + properties: + user: + $ref: "#/components/schemas/ProfileUserRelationInput" + additionalProperties: false + ProfileOmitInput: + type: object + properties: + id: + type: boolean + gender: + type: boolean + userId: + type: boolean + additionalProperties: false + ProfileFindUniqueArgs: + type: object + properties: + where: + $ref: "#/components/schemas/ProfileWhereUniqueInput" + select: + anyOf: + - $ref: "#/components/schemas/ProfileSelect" + - type: "null" + include: + anyOf: + - $ref: "#/components/schemas/ProfileInclude" + - type: "null" + omit: + anyOf: + - $ref: "#/components/schemas/ProfileOmitInput" + - type: "null" + required: + - where + additionalProperties: false + ProfileWhereInput: + type: object + properties: + id: + $ref: "#/components/schemas/IntFilter" + gender: + $ref: "#/components/schemas/StringFilter" + user: + anyOf: + - $ref: "#/components/schemas/UserWhereInput" + - type: object + properties: + is: + $ref: "#/components/schemas/UserWhereInput" + isNot: + $ref: "#/components/schemas/UserWhereInput" + additionalProperties: false + userId: + $ref: "#/components/schemas/StringFilter" + $expr: {} + AND: + anyOf: + - $ref: "#/components/schemas/ProfileWhereInput" + - type: array + items: + $ref: "#/components/schemas/ProfileWhereInput" + OR: + type: array + items: + $ref: "#/components/schemas/ProfileWhereInput" + NOT: + anyOf: + - $ref: "#/components/schemas/ProfileWhereInput" + - type: array + items: + $ref: "#/components/schemas/ProfileWhereInput" + additionalProperties: false + ProfileOrderByWithRelationInput: + type: object + properties: + id: + anyOf: + - type: string + const: asc + - type: string + const: desc + gender: + anyOf: + - type: string + const: asc + - type: string + const: desc + user: + $ref: "#/components/schemas/UserOrderByWithRelationInput" + userId: + anyOf: + - type: string + const: asc + - type: string + const: desc + additionalProperties: false + ProfileWhereUniqueInputWithoutRelation: + type: object + properties: + id: + $ref: "#/components/schemas/IntFilter" + gender: + $ref: "#/components/schemas/StringFilter" + userId: + $ref: "#/components/schemas/StringFilter" + $expr: {} + AND: + anyOf: + - $ref: "#/components/schemas/ProfileWhereInputWithoutRelation" + - type: array + items: + $ref: "#/components/schemas/ProfileWhereInputWithoutRelation" + OR: + type: array + items: + $ref: "#/components/schemas/ProfileWhereInputWithoutRelation" + NOT: + anyOf: + - $ref: "#/components/schemas/ProfileWhereInputWithoutRelation" + - type: array + items: + $ref: "#/components/schemas/ProfileWhereInputWithoutRelation" + additionalProperties: false + ProfileCursorInput: + $ref: "#/components/schemas/ProfileWhereUniqueInputWithoutRelation" + ProfileDistinctInput: + anyOf: + - type: string + enum: + - id + - gender + - userId + - type: array + items: + type: string + enum: + - id + - gender + - userId + ProfileFindFirstArgs: + type: object + properties: + where: + $ref: "#/components/schemas/ProfileWhereInput" + select: + anyOf: + - $ref: "#/components/schemas/ProfileSelect" + - type: "null" + include: + anyOf: + - $ref: "#/components/schemas/ProfileInclude" + - type: "null" + omit: + anyOf: + - $ref: "#/components/schemas/ProfileOmitInput" + - type: "null" + skip: + $ref: "#/components/schemas/_nonNegativeInteger" + take: + type: number + const: 1 + orderBy: + anyOf: + - $ref: "#/components/schemas/ProfileOrderByWithRelationInput" + - type: array + items: + $ref: "#/components/schemas/ProfileOrderByWithRelationInput" + cursor: + $ref: "#/components/schemas/ProfileCursorInput" + distinct: + $ref: "#/components/schemas/ProfileDistinctInput" + additionalProperties: false + ProfileFindManyArgs: + type: object + properties: + where: + $ref: "#/components/schemas/ProfileWhereInput" + select: + anyOf: + - $ref: "#/components/schemas/ProfileSelect" + - type: "null" + include: + anyOf: + - $ref: "#/components/schemas/ProfileInclude" + - type: "null" + omit: + anyOf: + - $ref: "#/components/schemas/ProfileOmitInput" + - type: "null" + skip: + $ref: "#/components/schemas/_nonNegativeInteger" + take: + $ref: "#/components/schemas/_integer" + orderBy: + anyOf: + - $ref: "#/components/schemas/ProfileOrderByWithRelationInput" + - type: array + items: + $ref: "#/components/schemas/ProfileOrderByWithRelationInput" + cursor: + $ref: "#/components/schemas/ProfileCursorInput" + distinct: + $ref: "#/components/schemas/ProfileDistinctInput" + additionalProperties: false + ProfileExistsArgs: + type: object + properties: + where: + $ref: "#/components/schemas/ProfileWhereInput" + additionalProperties: false + ProfileCreateData: + anyOf: + - type: object + properties: + id: + $ref: "#/components/schemas/_integer" + gender: + type: string + userId: + type: string + required: + - gender + - userId + additionalProperties: false + - type: object + properties: + id: + $ref: "#/components/schemas/_integer" + gender: + type: string + user: + type: object + properties: + connect: + $ref: "#/components/schemas/UserWhereUniqueInput" + create: + $ref: "#/components/schemas/UserCreateDataWithoutprofile" + connectOrCreate: + type: object + properties: + where: + $ref: "#/components/schemas/UserWhereUniqueInput" + create: + $ref: "#/components/schemas/UserCreateDataWithoutprofile" + required: + - where + - create + additionalProperties: false + additionalProperties: false + required: + - gender + - user + additionalProperties: false + ProfileCreateArgs: + type: object + properties: + data: + $ref: "#/components/schemas/ProfileCreateData" + select: + anyOf: + - $ref: "#/components/schemas/ProfileSelect" + - type: "null" + include: + anyOf: + - $ref: "#/components/schemas/ProfileInclude" + - type: "null" + omit: + anyOf: + - $ref: "#/components/schemas/ProfileOmitInput" + - type: "null" + required: + - data + additionalProperties: false + ProfileCreateDataArrayWithoutRelation: + anyOf: + - type: object + properties: + id: + $ref: "#/components/schemas/_integer" + gender: + type: string + userId: + type: string + required: + - gender + - userId + additionalProperties: false + - type: array + items: + type: object + properties: + id: + $ref: "#/components/schemas/_integer" + gender: + type: string + userId: + type: string + required: + - gender + - userId + additionalProperties: false + ProfileCreateManyPayload: + type: object + properties: + data: + $ref: "#/components/schemas/ProfileCreateDataArrayWithoutRelation" + skipDuplicates: + type: boolean + required: + - data + additionalProperties: false + ProfileCreateManyArgs: + type: object + properties: + data: + $ref: "#/components/schemas/ProfileCreateDataArrayWithoutRelation" + skipDuplicates: + type: boolean + required: + - data + additionalProperties: false + ProfileCreateManyAndReturnArgs: + type: object + properties: + data: + $ref: "#/components/schemas/ProfileCreateDataArrayWithoutRelation" + skipDuplicates: + type: boolean + select: + anyOf: + - $ref: "#/components/schemas/ProfileSelect" + - type: "null" + omit: + anyOf: + - $ref: "#/components/schemas/ProfileOmitInput" + - type: "null" + required: + - data + additionalProperties: false + ProfileUpdateData: + anyOf: + - type: object + properties: + id: + anyOf: + - $ref: "#/components/schemas/_integer" + - type: object + properties: + set: + type: number + increment: + type: number + decrement: + type: number + multiply: + type: number + divide: + type: number + additionalProperties: false + gender: + type: string + userId: + type: string + additionalProperties: false + - type: object + properties: + id: + anyOf: + - $ref: "#/components/schemas/_integer" + - type: object + properties: + set: + type: number + increment: + type: number + decrement: + type: number + multiply: + type: number + divide: + type: number + additionalProperties: false + gender: + type: string + user: + type: object + properties: + connect: + $ref: "#/components/schemas/UserWhereUniqueInput" + create: + $ref: "#/components/schemas/UserCreateDataWithoutprofile" + connectOrCreate: + type: object + properties: + where: + $ref: "#/components/schemas/UserWhereUniqueInput" + create: + $ref: "#/components/schemas/UserCreateDataWithoutprofile" + required: + - where + - create + additionalProperties: false + update: + anyOf: + - type: object + properties: + where: + $ref: "#/components/schemas/UserWhereInput" + data: + $ref: "#/components/schemas/UserUpdateDataWithoutprofile" + required: + - data + additionalProperties: false + - $ref: "#/components/schemas/UserUpdateDataWithoutprofile" + upsert: + anyOf: + - type: object + properties: + where: + $ref: "#/components/schemas/UserWhereUniqueInput" + create: + $ref: "#/components/schemas/UserCreateDataWithoutprofile" + update: + $ref: "#/components/schemas/UserUpdateDataWithoutprofile" + required: + - create + - update + additionalProperties: false + - type: array + items: + type: object + properties: + where: + $ref: "#/components/schemas/UserWhereUniqueInput" + create: + $ref: "#/components/schemas/UserCreateDataWithoutprofile" + update: + $ref: "#/components/schemas/UserUpdateDataWithoutprofile" + required: + - create + - update + additionalProperties: false + additionalProperties: false + additionalProperties: false + ProfileUpdateArgs: + type: object + properties: + where: + $ref: "#/components/schemas/ProfileWhereUniqueInput" + data: + $ref: "#/components/schemas/ProfileUpdateData" + select: + anyOf: + - $ref: "#/components/schemas/ProfileSelect" + - type: "null" + include: + anyOf: + - $ref: "#/components/schemas/ProfileInclude" + - type: "null" + omit: + anyOf: + - $ref: "#/components/schemas/ProfileOmitInput" + - type: "null" + required: + - where + - data + additionalProperties: false + ProfileUpdateDataWithoutRelation: + type: object + properties: + id: + anyOf: + - $ref: "#/components/schemas/_integer" + - type: object + properties: + set: + type: number + increment: + type: number + decrement: + type: number + multiply: + type: number + divide: + type: number + additionalProperties: false + gender: + type: string + userId: + type: string + additionalProperties: false + ProfileUpdateManyArgs: + type: object + properties: + where: + $ref: "#/components/schemas/ProfileWhereInput" + data: + $ref: "#/components/schemas/ProfileUpdateDataWithoutRelation" + limit: + $ref: "#/components/schemas/_nonNegativeInteger" + required: + - data + additionalProperties: false + ProfileUpdateManyAndReturnArgs: + type: object + properties: + where: + $ref: "#/components/schemas/ProfileWhereInput" + data: + $ref: "#/components/schemas/ProfileUpdateDataWithoutRelation" + limit: + $ref: "#/components/schemas/_nonNegativeInteger" + select: + anyOf: + - $ref: "#/components/schemas/ProfileSelect" + - type: "null" + omit: + anyOf: + - $ref: "#/components/schemas/ProfileOmitInput" + - type: "null" + required: + - data + additionalProperties: false + ProfileUpsertArgs: + type: object + properties: + where: + $ref: "#/components/schemas/ProfileWhereUniqueInput" + create: + $ref: "#/components/schemas/ProfileCreateData" + update: + $ref: "#/components/schemas/ProfileUpdateData" + select: + anyOf: + - $ref: "#/components/schemas/ProfileSelect" + - type: "null" + include: + anyOf: + - $ref: "#/components/schemas/ProfileInclude" + - type: "null" + omit: + anyOf: + - $ref: "#/components/schemas/ProfileOmitInput" + - type: "null" + required: + - where + - create + - update + additionalProperties: false + ProfileDeleteArgs: + type: object + properties: + where: + $ref: "#/components/schemas/ProfileWhereUniqueInput" + select: + anyOf: + - $ref: "#/components/schemas/ProfileSelect" + - type: "null" + include: + anyOf: + - $ref: "#/components/schemas/ProfileInclude" + - type: "null" + omit: + anyOf: + - $ref: "#/components/schemas/ProfileOmitInput" + - type: "null" + required: + - where + additionalProperties: false + ProfileDeleteManyArgs: + type: object + properties: + where: + $ref: "#/components/schemas/ProfileWhereInput" + limit: + $ref: "#/components/schemas/_nonNegativeInteger" + additionalProperties: false + ProfileCountAggregateInput: + anyOf: + - type: boolean + const: true + - type: object + properties: + _all: + type: boolean + const: true + id: + type: boolean + const: true + gender: + type: boolean + const: true + user: + type: boolean + const: true + userId: + type: boolean + const: true + additionalProperties: false + ProfileCountArgs: + type: object + properties: + where: + $ref: "#/components/schemas/ProfileWhereInput" + skip: + $ref: "#/components/schemas/_nonNegativeInteger" + take: + $ref: "#/components/schemas/_integer" + orderBy: + anyOf: + - $ref: "#/components/schemas/ProfileOrderByWithRelationInput" + - type: array + items: + $ref: "#/components/schemas/ProfileOrderByWithRelationInput" + select: + $ref: "#/components/schemas/ProfileCountAggregateInput" + additionalProperties: false + ProfileSumAvgAggregateInput: + type: object + properties: + id: + type: boolean + const: true + additionalProperties: false + ProfileMinMaxAggregateInput: + type: object + properties: + id: + type: boolean + const: true + gender: + type: boolean + const: true + userId: + type: boolean + const: true + additionalProperties: false + ProfileAggregateArgs: + type: object + properties: + where: + $ref: "#/components/schemas/ProfileWhereInput" + skip: + $ref: "#/components/schemas/_nonNegativeInteger" + take: + $ref: "#/components/schemas/_integer" + orderBy: + anyOf: + - $ref: "#/components/schemas/ProfileOrderByWithRelationInput" + - type: array + items: + $ref: "#/components/schemas/ProfileOrderByWithRelationInput" + _count: + $ref: "#/components/schemas/ProfileCountAggregateInput" + _avg: + $ref: "#/components/schemas/ProfileSumAvgAggregateInput" + _sum: + $ref: "#/components/schemas/ProfileSumAvgAggregateInput" + _min: + $ref: "#/components/schemas/ProfileMinMaxAggregateInput" + _max: + $ref: "#/components/schemas/ProfileMinMaxAggregateInput" + additionalProperties: false + ProfileOrderByWithAggregationInput: + type: object + properties: + id: + anyOf: + - type: string + const: asc + - type: string + const: desc + gender: + anyOf: + - type: string + const: asc + - type: string + const: desc + userId: + anyOf: + - type: string + const: asc + - type: string + const: desc + _count: + $ref: "#/components/schemas/ProfileOrderByWithRelationInput" + _avg: + $ref: "#/components/schemas/ProfileOrderByWithRelationInput" + _sum: + $ref: "#/components/schemas/ProfileOrderByWithRelationInput" + _min: + $ref: "#/components/schemas/ProfileOrderByWithRelationInput" + _max: + $ref: "#/components/schemas/ProfileOrderByWithRelationInput" + additionalProperties: false + IntFilterAgg: + anyOf: + - $ref: "#/components/schemas/_integer" + - type: object + properties: + equals: + $ref: "#/components/schemas/_integer" + in: + type: array + items: + $ref: "#/components/schemas/_integer" + notIn: + type: array + items: + $ref: "#/components/schemas/_integer" + lt: + $ref: "#/components/schemas/_integer" + lte: + $ref: "#/components/schemas/_integer" + gt: + $ref: "#/components/schemas/_integer" + gte: + $ref: "#/components/schemas/_integer" + between: + minItems: 2 + maxItems: 2 + type: array + items: + $ref: "#/components/schemas/_integer" + not: + $ref: "#/components/schemas/IntFilterAgg" + _count: + $ref: "#/components/schemas/IntFilter" + _avg: + anyOf: + - $ref: "#/components/schemas/_integer" + - type: object + properties: + equals: + $ref: "#/components/schemas/_integer" + in: + type: array + items: + $ref: "#/components/schemas/_integer" + notIn: + type: array + items: + $ref: "#/components/schemas/_integer" + lt: + $ref: "#/components/schemas/_integer" + lte: + $ref: "#/components/schemas/_integer" + gt: + $ref: "#/components/schemas/_integer" + gte: + $ref: "#/components/schemas/_integer" + between: + minItems: 2 + maxItems: 2 + type: array + items: + $ref: "#/components/schemas/_integer" + not: + $ref: "#/components/schemas/IntFilterAgg" + additionalProperties: false + _sum: + anyOf: + - $ref: "#/components/schemas/_integer" + - type: object + properties: + equals: + $ref: "#/components/schemas/_integer" + in: + type: array + items: + $ref: "#/components/schemas/_integer" + notIn: + type: array + items: + $ref: "#/components/schemas/_integer" + lt: + $ref: "#/components/schemas/_integer" + lte: + $ref: "#/components/schemas/_integer" + gt: + $ref: "#/components/schemas/_integer" + gte: + $ref: "#/components/schemas/_integer" + between: + minItems: 2 + maxItems: 2 + type: array + items: + $ref: "#/components/schemas/_integer" + not: + $ref: "#/components/schemas/IntFilterAgg" + additionalProperties: false + _min: + anyOf: + - $ref: "#/components/schemas/_integer" + - type: object + properties: + equals: + $ref: "#/components/schemas/_integer" + in: + type: array + items: + $ref: "#/components/schemas/_integer" + notIn: + type: array + items: + $ref: "#/components/schemas/_integer" + lt: + $ref: "#/components/schemas/_integer" + lte: + $ref: "#/components/schemas/_integer" + gt: + $ref: "#/components/schemas/_integer" + gte: + $ref: "#/components/schemas/_integer" + between: + minItems: 2 + maxItems: 2 + type: array + items: + $ref: "#/components/schemas/_integer" + not: + $ref: "#/components/schemas/IntFilterAgg" + additionalProperties: false + _max: + anyOf: + - $ref: "#/components/schemas/_integer" + - type: object + properties: + equals: + $ref: "#/components/schemas/_integer" + in: + type: array + items: + $ref: "#/components/schemas/_integer" + notIn: + type: array + items: + $ref: "#/components/schemas/_integer" + lt: + $ref: "#/components/schemas/_integer" + lte: + $ref: "#/components/schemas/_integer" + gt: + $ref: "#/components/schemas/_integer" + gte: + $ref: "#/components/schemas/_integer" + between: + minItems: 2 + maxItems: 2 + type: array + items: + $ref: "#/components/schemas/_integer" + not: + $ref: "#/components/schemas/IntFilterAgg" + additionalProperties: false + additionalProperties: false + ProfileWhereInputWithoutRelationWithAggregation: + type: object + properties: + id: + $ref: "#/components/schemas/IntFilterAgg" + gender: + $ref: "#/components/schemas/StringFilterAgg" + userId: + $ref: "#/components/schemas/StringFilterAgg" + $expr: {} + AND: + anyOf: + - $ref: "#/components/schemas/ProfileWhereInputWithoutRelation" + - type: array + items: + $ref: "#/components/schemas/ProfileWhereInputWithoutRelation" + OR: + type: array + items: + $ref: "#/components/schemas/ProfileWhereInputWithoutRelation" + NOT: + anyOf: + - $ref: "#/components/schemas/ProfileWhereInputWithoutRelation" + - type: array + items: + $ref: "#/components/schemas/ProfileWhereInputWithoutRelation" + additionalProperties: false + ProfileGroupByArgs: + type: object + properties: + where: + $ref: "#/components/schemas/ProfileWhereInput" + orderBy: + anyOf: + - $ref: "#/components/schemas/ProfileOrderByWithAggregationInput" + - type: array + items: + $ref: "#/components/schemas/ProfileOrderByWithAggregationInput" + by: + anyOf: + - type: string + enum: + - id + - gender + - userId + - type: array + items: + type: string + enum: + - id + - gender + - userId + having: + $ref: "#/components/schemas/ProfileWhereInputWithoutRelationWithAggregation" + skip: + $ref: "#/components/schemas/_nonNegativeInteger" + take: + $ref: "#/components/schemas/_integer" + _count: + $ref: "#/components/schemas/ProfileCountAggregateInput" + _avg: + $ref: "#/components/schemas/ProfileSumAvgAggregateInput" + _sum: + $ref: "#/components/schemas/ProfileSumAvgAggregateInput" + _min: + $ref: "#/components/schemas/ProfileMinMaxAggregateInput" + _max: + $ref: "#/components/schemas/ProfileMinMaxAggregateInput" + required: + - by + additionalProperties: false + PostWhereUniqueInput: + type: object + properties: + id: + $ref: "#/components/schemas/IntFilter" + createdAt: + $ref: "#/components/schemas/DateTimeFilter" + updatedAt: + $ref: "#/components/schemas/DateTimeFilter" + title: + $ref: "#/components/schemas/StringFilter" + author: + anyOf: + - anyOf: + - $ref: "#/components/schemas/UserWhereInput" + - type: "null" + - type: object + properties: + is: + anyOf: + - $ref: "#/components/schemas/UserWhereInput" + - type: "null" + isNot: + anyOf: + - $ref: "#/components/schemas/UserWhereInput" + - type: "null" + additionalProperties: false + authorId: + $ref: "#/components/schemas/StringFilterOptional" + published: + $ref: "#/components/schemas/BooleanFilter" + publishedAt: + $ref: "#/components/schemas/DateTimeFilterOptional" + viewCount: + $ref: "#/components/schemas/IntFilter" + comments: + type: object + properties: + some: + $ref: "#/components/schemas/CommentWhereInput" + every: + $ref: "#/components/schemas/CommentWhereInput" + none: + $ref: "#/components/schemas/CommentWhereInput" + additionalProperties: false + setting: + anyOf: + - anyOf: + - $ref: "#/components/schemas/SettingWhereInput" + - type: "null" + - type: object + properties: + is: + anyOf: + - $ref: "#/components/schemas/SettingWhereInput" + - type: "null" + isNot: + anyOf: + - $ref: "#/components/schemas/SettingWhereInput" + - type: "null" + additionalProperties: false + $expr: {} + AND: + anyOf: + - $ref: "#/components/schemas/PostWhereInput" + - type: array + items: + $ref: "#/components/schemas/PostWhereInput" + OR: + type: array + items: + $ref: "#/components/schemas/PostWhereInput" + NOT: + anyOf: + - $ref: "#/components/schemas/PostWhereInput" + - type: array + items: + $ref: "#/components/schemas/PostWhereInput" + required: + - id + additionalProperties: false + PostAuthorRelationInput: + anyOf: + - type: boolean + - type: object + properties: + where: + $ref: "#/components/schemas/UserWhereInput" + select: + anyOf: + - $ref: "#/components/schemas/UserSelect" + - type: "null" + include: + anyOf: + - $ref: "#/components/schemas/UserInclude" + - type: "null" + omit: + anyOf: + - $ref: "#/components/schemas/UserOmitInput" + - type: "null" + additionalProperties: false + CommentWhereUniqueInputWithoutRelation: + type: object + properties: + id: + $ref: "#/components/schemas/IntFilter" + postId: + $ref: "#/components/schemas/IntFilter" + content: + $ref: "#/components/schemas/StringFilter" + $expr: {} + AND: + anyOf: + - $ref: "#/components/schemas/CommentWhereInputWithoutRelation" + - type: array + items: + $ref: "#/components/schemas/CommentWhereInputWithoutRelation" + OR: + type: array + items: + $ref: "#/components/schemas/CommentWhereInputWithoutRelation" + NOT: + anyOf: + - $ref: "#/components/schemas/CommentWhereInputWithoutRelation" + - type: array + items: + $ref: "#/components/schemas/CommentWhereInputWithoutRelation" + required: + - id + additionalProperties: false + CommentCursorInput: + $ref: "#/components/schemas/CommentWhereUniqueInputWithoutRelation" + CommentDistinctInput: + anyOf: + - type: string + enum: + - id + - postId + - content + - type: array + items: + type: string + enum: + - id + - postId + - content + PostCommentsRelationInput: + anyOf: + - type: boolean + - type: object + properties: + where: + $ref: "#/components/schemas/CommentWhereInput" + select: + anyOf: + - $ref: "#/components/schemas/CommentSelect" + - type: "null" + include: + anyOf: + - $ref: "#/components/schemas/CommentInclude" + - type: "null" + omit: + anyOf: + - $ref: "#/components/schemas/CommentOmitInput" + - type: "null" + orderBy: + anyOf: + - $ref: "#/components/schemas/CommentOrderByWithRelationInput" + - type: array + items: + $ref: "#/components/schemas/CommentOrderByWithRelationInput" + skip: + $ref: "#/components/schemas/_nonNegativeInteger" + take: + $ref: "#/components/schemas/_integer" + cursor: + $ref: "#/components/schemas/CommentCursorInput" + distinct: + $ref: "#/components/schemas/CommentDistinctInput" + additionalProperties: false + PostSettingRelationInput: + anyOf: + - type: boolean + - type: object + properties: + where: + $ref: "#/components/schemas/SettingWhereInput" + select: + anyOf: + - $ref: "#/components/schemas/SettingSelect" + - type: "null" + include: + anyOf: + - $ref: "#/components/schemas/SettingInclude" + - type: "null" + omit: + anyOf: + - $ref: "#/components/schemas/SettingOmitInput" + - type: "null" + additionalProperties: false + CommentWhereInput: + type: object + properties: + id: + $ref: "#/components/schemas/IntFilter" + post: + anyOf: + - $ref: "#/components/schemas/PostWhereInput" + - type: object + properties: + is: + $ref: "#/components/schemas/PostWhereInput" + isNot: + $ref: "#/components/schemas/PostWhereInput" + additionalProperties: false + postId: + $ref: "#/components/schemas/IntFilter" + content: + $ref: "#/components/schemas/StringFilter" + $expr: {} + AND: + anyOf: + - $ref: "#/components/schemas/CommentWhereInput" + - type: array + items: + $ref: "#/components/schemas/CommentWhereInput" + OR: + type: array + items: + $ref: "#/components/schemas/CommentWhereInput" + NOT: + anyOf: + - $ref: "#/components/schemas/CommentWhereInput" + - type: array + items: + $ref: "#/components/schemas/CommentWhereInput" + additionalProperties: false + PostCountSelection: + anyOf: + - type: boolean + const: true + - type: object + properties: + select: + type: object + properties: + comments: + anyOf: + - type: boolean + - type: object + properties: + where: + $ref: "#/components/schemas/CommentWhereInput" + required: + - where + additionalProperties: false + additionalProperties: false + required: + - select + additionalProperties: false + PostSelect: + type: object + properties: + id: + type: boolean + createdAt: + type: boolean + updatedAt: + type: boolean + title: + type: boolean + author: + $ref: "#/components/schemas/PostAuthorRelationInput" + authorId: + type: boolean + published: + type: boolean + publishedAt: + type: boolean + viewCount: + type: boolean + comments: + $ref: "#/components/schemas/PostCommentsRelationInput" + setting: + $ref: "#/components/schemas/PostSettingRelationInput" + _count: + $ref: "#/components/schemas/PostCountSelection" + additionalProperties: false + PostInclude: + type: object + properties: + author: + $ref: "#/components/schemas/PostAuthorRelationInput" + comments: + $ref: "#/components/schemas/PostCommentsRelationInput" + setting: + $ref: "#/components/schemas/PostSettingRelationInput" + _count: + $ref: "#/components/schemas/PostCountSelection" + additionalProperties: false + PostOmitInput: + type: object + properties: + id: + type: boolean + createdAt: + type: boolean + updatedAt: + type: boolean + title: + type: boolean + authorId: + type: boolean + published: + type: boolean + publishedAt: + type: boolean + viewCount: + type: boolean + additionalProperties: false + PostFindUniqueArgs: + type: object + properties: + where: + $ref: "#/components/schemas/PostWhereUniqueInput" + select: + anyOf: + - $ref: "#/components/schemas/PostSelect" + - type: "null" + include: + anyOf: + - $ref: "#/components/schemas/PostInclude" + - type: "null" + omit: + anyOf: + - $ref: "#/components/schemas/PostOmitInput" + - type: "null" + required: + - where + additionalProperties: false + PostOrderByWithRelationInput: + type: object + properties: + id: + anyOf: + - type: string + const: asc + - type: string + const: desc + createdAt: + anyOf: + - type: string + const: asc + - type: string + const: desc + updatedAt: + anyOf: + - type: string + const: asc + - type: string + const: desc + title: + anyOf: + - type: string + const: asc + - type: string + const: desc + author: + $ref: "#/components/schemas/UserOrderByWithRelationInput" + authorId: + anyOf: + - anyOf: + - type: string + const: asc + - type: string + const: desc + - type: object + properties: + sort: + anyOf: + - type: string + const: asc + - type: string + const: desc + nulls: + anyOf: + - type: string + const: first + - type: string + const: last + required: + - sort + - nulls + additionalProperties: false + published: + anyOf: + - type: string + const: asc + - type: string + const: desc + publishedAt: + anyOf: + - anyOf: + - type: string + const: asc + - type: string + const: desc + - type: object + properties: + sort: + anyOf: + - type: string + const: asc + - type: string + const: desc + nulls: + anyOf: + - type: string + const: first + - type: string + const: last + required: + - sort + - nulls + additionalProperties: false + viewCount: + anyOf: + - type: string + const: asc + - type: string + const: desc + comments: + type: object + properties: + id: + anyOf: + - type: string + const: asc + - type: string + const: desc + post: + $ref: "#/components/schemas/PostOrderByWithRelationInput" + postId: + anyOf: + - type: string + const: asc + - type: string + const: desc + content: + anyOf: + - type: string + const: asc + - type: string + const: desc + _count: + anyOf: + - type: string + const: asc + - type: string + const: desc + required: + - _count + additionalProperties: false + setting: + $ref: "#/components/schemas/SettingOrderByWithRelationInput" + additionalProperties: false + PostFindFirstArgs: + type: object + properties: + where: + $ref: "#/components/schemas/PostWhereInput" + select: + anyOf: + - $ref: "#/components/schemas/PostSelect" + - type: "null" + include: + anyOf: + - $ref: "#/components/schemas/PostInclude" + - type: "null" + omit: + anyOf: + - $ref: "#/components/schemas/PostOmitInput" + - type: "null" + skip: + $ref: "#/components/schemas/_nonNegativeInteger" + take: + type: number + const: 1 + orderBy: + anyOf: + - $ref: "#/components/schemas/PostOrderByWithRelationInput" + - type: array + items: + $ref: "#/components/schemas/PostOrderByWithRelationInput" + cursor: + $ref: "#/components/schemas/PostCursorInput" + distinct: + $ref: "#/components/schemas/PostDistinctInput" + additionalProperties: false + PostFindManyArgs: + type: object + properties: + where: + $ref: "#/components/schemas/PostWhereInput" + select: + anyOf: + - $ref: "#/components/schemas/PostSelect" + - type: "null" + include: + anyOf: + - $ref: "#/components/schemas/PostInclude" + - type: "null" + omit: + anyOf: + - $ref: "#/components/schemas/PostOmitInput" + - type: "null" + skip: + $ref: "#/components/schemas/_nonNegativeInteger" + take: + $ref: "#/components/schemas/_integer" + orderBy: + anyOf: + - $ref: "#/components/schemas/PostOrderByWithRelationInput" + - type: array + items: + $ref: "#/components/schemas/PostOrderByWithRelationInput" + cursor: + $ref: "#/components/schemas/PostCursorInput" + distinct: + $ref: "#/components/schemas/PostDistinctInput" + additionalProperties: false + PostExistsArgs: + type: object + properties: + where: + $ref: "#/components/schemas/PostWhereInput" + additionalProperties: false + PostCreateData: + anyOf: + - type: object + properties: + id: + $ref: "#/components/schemas/_integer" + createdAt: + $ref: "#/components/schemas/DateTime" + updatedAt: + $ref: "#/components/schemas/DateTime" + title: + type: string + minLength: 1 + maxLength: 10 + authorId: + anyOf: + - type: string + - type: "null" + published: + type: boolean + publishedAt: + anyOf: + - $ref: "#/components/schemas/DateTime" + - type: "null" + viewCount: + $ref: "#/components/schemas/_integer" + comments: + type: object + properties: + connect: + anyOf: + - $ref: "#/components/schemas/CommentWhereUniqueInput" + - type: array + items: + $ref: "#/components/schemas/CommentWhereUniqueInput" + create: + $ref: "#/components/schemas/CommentCreateDataArrayWithoutpostpostId" + connectOrCreate: + anyOf: + - type: object + properties: + where: + $ref: "#/components/schemas/CommentWhereUniqueInput" + create: + $ref: "#/components/schemas/CommentCreateDataWithoutpostpostId" + required: + - where + - create + additionalProperties: false + - type: array + items: + type: object + properties: + where: + $ref: "#/components/schemas/CommentWhereUniqueInput" + create: + $ref: "#/components/schemas/CommentCreateDataWithoutpostpostId" + required: + - where + - create + additionalProperties: false + createMany: + $ref: "#/components/schemas/CommentCreateManyPayloadWithoutpostpostId" + additionalProperties: false + setting: + anyOf: + - type: object + properties: + connect: + $ref: "#/components/schemas/SettingWhereUniqueInput" + create: + $ref: "#/components/schemas/SettingCreateDataWithoutpostpostId" + connectOrCreate: + type: object + properties: + where: + $ref: "#/components/schemas/SettingWhereUniqueInput" + create: + $ref: "#/components/schemas/SettingCreateDataWithoutpostpostId" + required: + - where + - create + additionalProperties: false + additionalProperties: false + - type: "null" + required: + - title + additionalProperties: false + - type: object + properties: + id: + $ref: "#/components/schemas/_integer" + createdAt: + $ref: "#/components/schemas/DateTime" + updatedAt: + $ref: "#/components/schemas/DateTime" + title: + type: string + minLength: 1 + maxLength: 10 + author: + anyOf: + - type: object + properties: + connect: + $ref: "#/components/schemas/UserWhereUniqueInput" + create: + $ref: "#/components/schemas/UserCreateDataWithoutposts" + connectOrCreate: + type: object + properties: + where: + $ref: "#/components/schemas/UserWhereUniqueInput" + create: + $ref: "#/components/schemas/UserCreateDataWithoutposts" + required: + - where + - create + additionalProperties: false + additionalProperties: false + - type: "null" + published: + type: boolean + publishedAt: + anyOf: + - $ref: "#/components/schemas/DateTime" + - type: "null" + viewCount: + $ref: "#/components/schemas/_integer" + comments: + type: object + properties: + connect: + anyOf: + - $ref: "#/components/schemas/CommentWhereUniqueInput" + - type: array + items: + $ref: "#/components/schemas/CommentWhereUniqueInput" + create: + $ref: "#/components/schemas/CommentCreateDataArrayWithoutpostpostId" + connectOrCreate: + anyOf: + - type: object + properties: + where: + $ref: "#/components/schemas/CommentWhereUniqueInput" + create: + $ref: "#/components/schemas/CommentCreateDataWithoutpostpostId" + required: + - where + - create + additionalProperties: false + - type: array + items: + type: object + properties: + where: + $ref: "#/components/schemas/CommentWhereUniqueInput" + create: + $ref: "#/components/schemas/CommentCreateDataWithoutpostpostId" + required: + - where + - create + additionalProperties: false + createMany: + $ref: "#/components/schemas/CommentCreateManyPayloadWithoutpostpostId" + additionalProperties: false + setting: + anyOf: + - type: object + properties: + connect: + $ref: "#/components/schemas/SettingWhereUniqueInput" + create: + $ref: "#/components/schemas/SettingCreateDataWithoutpostpostId" + connectOrCreate: + type: object + properties: + where: + $ref: "#/components/schemas/SettingWhereUniqueInput" + create: + $ref: "#/components/schemas/SettingCreateDataWithoutpostpostId" + required: + - where + - create + additionalProperties: false + additionalProperties: false + - type: "null" + required: + - title + additionalProperties: false + PostCreateArgs: + type: object + properties: + data: + $ref: "#/components/schemas/PostCreateData" + select: + anyOf: + - $ref: "#/components/schemas/PostSelect" + - type: "null" + include: + anyOf: + - $ref: "#/components/schemas/PostInclude" + - type: "null" + omit: + anyOf: + - $ref: "#/components/schemas/PostOmitInput" + - type: "null" + required: + - data + additionalProperties: false + PostCreateDataArrayWithoutRelation: + anyOf: + - type: object + properties: + id: + $ref: "#/components/schemas/_integer" + createdAt: + $ref: "#/components/schemas/DateTime" + updatedAt: + $ref: "#/components/schemas/DateTime" + title: + type: string + minLength: 1 + maxLength: 10 + authorId: + anyOf: + - type: string + - type: "null" + published: + type: boolean + publishedAt: + anyOf: + - $ref: "#/components/schemas/DateTime" + - type: "null" + viewCount: + $ref: "#/components/schemas/_integer" + required: + - title + additionalProperties: false + - type: array + items: + type: object + properties: + id: + $ref: "#/components/schemas/_integer" + createdAt: + $ref: "#/components/schemas/DateTime" + updatedAt: + $ref: "#/components/schemas/DateTime" + title: + type: string + minLength: 1 + maxLength: 10 + authorId: + anyOf: + - type: string + - type: "null" + published: + type: boolean + publishedAt: + anyOf: + - $ref: "#/components/schemas/DateTime" + - type: "null" + viewCount: + $ref: "#/components/schemas/_integer" + required: + - title + additionalProperties: false + PostCreateManyPayload: + type: object + properties: + data: + $ref: "#/components/schemas/PostCreateDataArrayWithoutRelation" + skipDuplicates: + type: boolean + required: + - data + additionalProperties: false + PostCreateManyArgs: + type: object + properties: + data: + $ref: "#/components/schemas/PostCreateDataArrayWithoutRelation" + skipDuplicates: + type: boolean + required: + - data + additionalProperties: false + PostCreateManyAndReturnArgs: + type: object + properties: + data: + $ref: "#/components/schemas/PostCreateDataArrayWithoutRelation" + skipDuplicates: + type: boolean + select: + anyOf: + - $ref: "#/components/schemas/PostSelect" + - type: "null" + omit: + anyOf: + - $ref: "#/components/schemas/PostOmitInput" + - type: "null" + required: + - data + additionalProperties: false + PostUpdateData: + anyOf: + - type: object + properties: + id: + anyOf: + - $ref: "#/components/schemas/_integer" + - type: object + properties: + set: + type: number + increment: + type: number + decrement: + type: number + multiply: + type: number + divide: + type: number + additionalProperties: false + createdAt: + $ref: "#/components/schemas/DateTime" + updatedAt: + $ref: "#/components/schemas/DateTime" + title: + type: string + minLength: 1 + maxLength: 10 + authorId: + anyOf: + - type: string + - type: "null" + published: + type: boolean + publishedAt: + anyOf: + - $ref: "#/components/schemas/DateTime" + - type: "null" + viewCount: + anyOf: + - $ref: "#/components/schemas/_integer" + - type: object + properties: + set: + type: number + increment: + type: number + decrement: + type: number + multiply: + type: number + divide: + type: number + additionalProperties: false + comments: + type: object + properties: + connect: + anyOf: + - $ref: "#/components/schemas/CommentWhereUniqueInput" + - type: array + items: + $ref: "#/components/schemas/CommentWhereUniqueInput" + create: + $ref: "#/components/schemas/CommentCreateDataArrayWithoutpostpostId" + connectOrCreate: + anyOf: + - type: object + properties: + where: + $ref: "#/components/schemas/CommentWhereUniqueInput" + create: + $ref: "#/components/schemas/CommentCreateDataWithoutpostpostId" + required: + - where + - create + additionalProperties: false + - type: array + items: + type: object + properties: + where: + $ref: "#/components/schemas/CommentWhereUniqueInput" + create: + $ref: "#/components/schemas/CommentCreateDataWithoutpostpostId" + required: + - where + - create + additionalProperties: false + createMany: + $ref: "#/components/schemas/CommentCreateManyPayloadWithoutpostpostId" + disconnect: + anyOf: + - $ref: "#/components/schemas/CommentWhereUniqueInput" + - type: array + items: + $ref: "#/components/schemas/CommentWhereUniqueInput" + delete: + anyOf: + - $ref: "#/components/schemas/CommentWhereUniqueInput" + - type: array + items: + $ref: "#/components/schemas/CommentWhereUniqueInput" + update: + anyOf: + - type: object + properties: + where: + $ref: "#/components/schemas/CommentWhereUniqueInput" + data: + $ref: "#/components/schemas/CommentUpdateDataWithoutpostpostId" + required: + - where + - data + additionalProperties: false + - type: array + items: + type: object + properties: + where: + $ref: "#/components/schemas/CommentWhereUniqueInput" + data: + $ref: "#/components/schemas/CommentUpdateDataWithoutpostpostId" + required: + - where + - data + additionalProperties: false + upsert: + anyOf: + - type: object + properties: + where: + $ref: "#/components/schemas/CommentWhereUniqueInput" + create: + $ref: "#/components/schemas/CommentCreateDataWithoutpostpostId" + update: + $ref: "#/components/schemas/CommentUpdateDataWithoutpostpostId" + required: + - where + - create + - update + additionalProperties: false + - type: array + items: + type: object + properties: + where: + $ref: "#/components/schemas/CommentWhereUniqueInput" + create: + $ref: "#/components/schemas/CommentCreateDataWithoutpostpostId" + update: + $ref: "#/components/schemas/CommentUpdateDataWithoutpostpostId" + required: + - where + - create + - update + additionalProperties: false + set: + anyOf: + - $ref: "#/components/schemas/CommentWhereUniqueInput" + - type: array + items: + $ref: "#/components/schemas/CommentWhereUniqueInput" + updateMany: + anyOf: + - type: object + properties: + where: + $ref: "#/components/schemas/CommentWhereInputWithoutRelation" + data: + $ref: "#/components/schemas/CommentUpdateDataWithoutpostpostId" + required: + - where + - data + additionalProperties: false + - type: array + items: + type: object + properties: + where: + $ref: "#/components/schemas/CommentWhereInputWithoutRelation" + data: + $ref: "#/components/schemas/CommentUpdateDataWithoutpostpostId" + required: + - where + - data + additionalProperties: false + deleteMany: + anyOf: + - $ref: "#/components/schemas/CommentWhereInput" + - type: array + items: + $ref: "#/components/schemas/CommentWhereInput" + additionalProperties: false + setting: + anyOf: + - type: object + properties: + connect: + $ref: "#/components/schemas/SettingWhereUniqueInput" + create: + $ref: "#/components/schemas/SettingCreateDataWithoutpostpostId" + connectOrCreate: + type: object + properties: + where: + $ref: "#/components/schemas/SettingWhereUniqueInput" + create: + $ref: "#/components/schemas/SettingCreateDataWithoutpostpostId" + required: + - where + - create + additionalProperties: false + disconnect: + anyOf: + - type: boolean + - $ref: "#/components/schemas/SettingWhereInput" + delete: + anyOf: + - type: boolean + - $ref: "#/components/schemas/SettingWhereUniqueInput" + update: + anyOf: + - type: object + properties: + where: + $ref: "#/components/schemas/SettingWhereInput" + data: + $ref: "#/components/schemas/SettingUpdateDataWithoutpostpostId" + required: + - data + additionalProperties: false + - $ref: "#/components/schemas/SettingUpdateDataWithoutpostpostId" + upsert: + anyOf: + - type: object + properties: + where: + $ref: "#/components/schemas/SettingWhereUniqueInput" + create: + $ref: "#/components/schemas/SettingCreateDataWithoutpostpostId" + update: + $ref: "#/components/schemas/SettingUpdateDataWithoutpostpostId" + required: + - create + - update + additionalProperties: false + - type: array + items: + type: object + properties: + where: + $ref: "#/components/schemas/SettingWhereUniqueInput" + create: + $ref: "#/components/schemas/SettingCreateDataWithoutpostpostId" + update: + $ref: "#/components/schemas/SettingUpdateDataWithoutpostpostId" + required: + - create + - update + additionalProperties: false + additionalProperties: false + - type: "null" + additionalProperties: false + - type: object + properties: + id: + anyOf: + - $ref: "#/components/schemas/_integer" + - type: object + properties: + set: + type: number + increment: + type: number + decrement: + type: number + multiply: + type: number + divide: + type: number + additionalProperties: false + createdAt: + $ref: "#/components/schemas/DateTime" + updatedAt: + $ref: "#/components/schemas/DateTime" + title: + type: string + minLength: 1 + maxLength: 10 + author: + anyOf: + - type: object + properties: + connect: + $ref: "#/components/schemas/UserWhereUniqueInput" + create: + $ref: "#/components/schemas/UserCreateDataWithoutposts" + connectOrCreate: + type: object + properties: + where: + $ref: "#/components/schemas/UserWhereUniqueInput" + create: + $ref: "#/components/schemas/UserCreateDataWithoutposts" + required: + - where + - create + additionalProperties: false + disconnect: + anyOf: + - type: boolean + - $ref: "#/components/schemas/UserWhereInput" + delete: + anyOf: + - type: boolean + - $ref: "#/components/schemas/UserWhereUniqueInput" + update: + anyOf: + - type: object + properties: + where: + $ref: "#/components/schemas/UserWhereInput" + data: + $ref: "#/components/schemas/UserUpdateDataWithoutposts" + required: + - data + additionalProperties: false + - $ref: "#/components/schemas/UserUpdateDataWithoutposts" + upsert: + anyOf: + - type: object + properties: + where: + $ref: "#/components/schemas/UserWhereUniqueInput" + create: + $ref: "#/components/schemas/UserCreateDataWithoutposts" + update: + $ref: "#/components/schemas/UserUpdateDataWithoutposts" + required: + - create + - update + additionalProperties: false + - type: array + items: + type: object + properties: + where: + $ref: "#/components/schemas/UserWhereUniqueInput" + create: + $ref: "#/components/schemas/UserCreateDataWithoutposts" + update: + $ref: "#/components/schemas/UserUpdateDataWithoutposts" + required: + - create + - update + additionalProperties: false + additionalProperties: false + - type: "null" + published: + type: boolean + publishedAt: + anyOf: + - $ref: "#/components/schemas/DateTime" + - type: "null" + viewCount: + anyOf: + - $ref: "#/components/schemas/_integer" + - type: object + properties: + set: + type: number + increment: + type: number + decrement: + type: number + multiply: + type: number + divide: + type: number + additionalProperties: false + comments: + type: object + properties: + connect: + anyOf: + - $ref: "#/components/schemas/CommentWhereUniqueInput" + - type: array + items: + $ref: "#/components/schemas/CommentWhereUniqueInput" + create: + $ref: "#/components/schemas/CommentCreateDataArrayWithoutpostpostId" + connectOrCreate: + anyOf: + - type: object + properties: + where: + $ref: "#/components/schemas/CommentWhereUniqueInput" + create: + $ref: "#/components/schemas/CommentCreateDataWithoutpostpostId" + required: + - where + - create + additionalProperties: false + - type: array + items: + type: object + properties: + where: + $ref: "#/components/schemas/CommentWhereUniqueInput" + create: + $ref: "#/components/schemas/CommentCreateDataWithoutpostpostId" + required: + - where + - create + additionalProperties: false + createMany: + $ref: "#/components/schemas/CommentCreateManyPayloadWithoutpostpostId" + disconnect: + anyOf: + - $ref: "#/components/schemas/CommentWhereUniqueInput" + - type: array + items: + $ref: "#/components/schemas/CommentWhereUniqueInput" + delete: + anyOf: + - $ref: "#/components/schemas/CommentWhereUniqueInput" + - type: array + items: + $ref: "#/components/schemas/CommentWhereUniqueInput" + update: + anyOf: + - type: object + properties: + where: + $ref: "#/components/schemas/CommentWhereUniqueInput" + data: + $ref: "#/components/schemas/CommentUpdateDataWithoutpostpostId" + required: + - where + - data + additionalProperties: false + - type: array + items: + type: object + properties: + where: + $ref: "#/components/schemas/CommentWhereUniqueInput" + data: + $ref: "#/components/schemas/CommentUpdateDataWithoutpostpostId" + required: + - where + - data + additionalProperties: false + upsert: + anyOf: + - type: object + properties: + where: + $ref: "#/components/schemas/CommentWhereUniqueInput" + create: + $ref: "#/components/schemas/CommentCreateDataWithoutpostpostId" + update: + $ref: "#/components/schemas/CommentUpdateDataWithoutpostpostId" + required: + - where + - create + - update + additionalProperties: false + - type: array + items: + type: object + properties: + where: + $ref: "#/components/schemas/CommentWhereUniqueInput" + create: + $ref: "#/components/schemas/CommentCreateDataWithoutpostpostId" + update: + $ref: "#/components/schemas/CommentUpdateDataWithoutpostpostId" + required: + - where + - create + - update + additionalProperties: false + set: + anyOf: + - $ref: "#/components/schemas/CommentWhereUniqueInput" + - type: array + items: + $ref: "#/components/schemas/CommentWhereUniqueInput" + updateMany: + anyOf: + - type: object + properties: + where: + $ref: "#/components/schemas/CommentWhereInputWithoutRelation" + data: + $ref: "#/components/schemas/CommentUpdateDataWithoutpostpostId" + required: + - where + - data + additionalProperties: false + - type: array + items: + type: object + properties: + where: + $ref: "#/components/schemas/CommentWhereInputWithoutRelation" + data: + $ref: "#/components/schemas/CommentUpdateDataWithoutpostpostId" + required: + - where + - data + additionalProperties: false + deleteMany: + anyOf: + - $ref: "#/components/schemas/CommentWhereInput" + - type: array + items: + $ref: "#/components/schemas/CommentWhereInput" + additionalProperties: false + setting: + anyOf: + - type: object + properties: + connect: + $ref: "#/components/schemas/SettingWhereUniqueInput" + create: + $ref: "#/components/schemas/SettingCreateDataWithoutpostpostId" + connectOrCreate: + type: object + properties: + where: + $ref: "#/components/schemas/SettingWhereUniqueInput" + create: + $ref: "#/components/schemas/SettingCreateDataWithoutpostpostId" + required: + - where + - create + additionalProperties: false + disconnect: + anyOf: + - type: boolean + - $ref: "#/components/schemas/SettingWhereInput" + delete: + anyOf: + - type: boolean + - $ref: "#/components/schemas/SettingWhereUniqueInput" + update: + anyOf: + - type: object + properties: + where: + $ref: "#/components/schemas/SettingWhereInput" + data: + $ref: "#/components/schemas/SettingUpdateDataWithoutpostpostId" + required: + - data + additionalProperties: false + - $ref: "#/components/schemas/SettingUpdateDataWithoutpostpostId" + upsert: + anyOf: + - type: object + properties: + where: + $ref: "#/components/schemas/SettingWhereUniqueInput" + create: + $ref: "#/components/schemas/SettingCreateDataWithoutpostpostId" + update: + $ref: "#/components/schemas/SettingUpdateDataWithoutpostpostId" + required: + - create + - update + additionalProperties: false + - type: array + items: + type: object + properties: + where: + $ref: "#/components/schemas/SettingWhereUniqueInput" + create: + $ref: "#/components/schemas/SettingCreateDataWithoutpostpostId" + update: + $ref: "#/components/schemas/SettingUpdateDataWithoutpostpostId" + required: + - create + - update + additionalProperties: false + additionalProperties: false + - type: "null" + additionalProperties: false + PostUpdateArgs: + type: object + properties: + where: + $ref: "#/components/schemas/PostWhereUniqueInput" + data: + $ref: "#/components/schemas/PostUpdateData" + select: + anyOf: + - $ref: "#/components/schemas/PostSelect" + - type: "null" + include: + anyOf: + - $ref: "#/components/schemas/PostInclude" + - type: "null" + omit: + anyOf: + - $ref: "#/components/schemas/PostOmitInput" + - type: "null" + required: + - where + - data + additionalProperties: false + PostUpdateDataWithoutRelation: + type: object + properties: + id: + anyOf: + - $ref: "#/components/schemas/_integer" + - type: object + properties: + set: + type: number + increment: + type: number + decrement: + type: number + multiply: + type: number + divide: + type: number + additionalProperties: false + createdAt: + $ref: "#/components/schemas/DateTime" + updatedAt: + $ref: "#/components/schemas/DateTime" + title: + type: string + minLength: 1 + maxLength: 10 + authorId: + anyOf: + - type: string + - type: "null" + published: + type: boolean + publishedAt: + anyOf: + - $ref: "#/components/schemas/DateTime" + - type: "null" + viewCount: + anyOf: + - $ref: "#/components/schemas/_integer" + - type: object + properties: + set: + type: number + increment: + type: number + decrement: + type: number + multiply: + type: number + divide: + type: number + additionalProperties: false + additionalProperties: false + PostUpdateManyArgs: + type: object + properties: + where: + $ref: "#/components/schemas/PostWhereInput" + data: + $ref: "#/components/schemas/PostUpdateDataWithoutRelation" + limit: + $ref: "#/components/schemas/_nonNegativeInteger" + required: + - data + additionalProperties: false + PostUpdateManyAndReturnArgs: + type: object + properties: + where: + $ref: "#/components/schemas/PostWhereInput" + data: + $ref: "#/components/schemas/PostUpdateDataWithoutRelation" + limit: + $ref: "#/components/schemas/_nonNegativeInteger" + select: + anyOf: + - $ref: "#/components/schemas/PostSelect" + - type: "null" + omit: + anyOf: + - $ref: "#/components/schemas/PostOmitInput" + - type: "null" + required: + - data + additionalProperties: false + PostUpsertArgs: + type: object + properties: + where: + $ref: "#/components/schemas/PostWhereUniqueInput" + create: + $ref: "#/components/schemas/PostCreateData" + update: + $ref: "#/components/schemas/PostUpdateData" + select: + anyOf: + - $ref: "#/components/schemas/PostSelect" + - type: "null" + include: + anyOf: + - $ref: "#/components/schemas/PostInclude" + - type: "null" + omit: + anyOf: + - $ref: "#/components/schemas/PostOmitInput" + - type: "null" + required: + - where + - create + - update + additionalProperties: false + PostDeleteArgs: + type: object + properties: + where: + $ref: "#/components/schemas/PostWhereUniqueInput" + select: + anyOf: + - $ref: "#/components/schemas/PostSelect" + - type: "null" + include: + anyOf: + - $ref: "#/components/schemas/PostInclude" + - type: "null" + omit: + anyOf: + - $ref: "#/components/schemas/PostOmitInput" + - type: "null" + required: + - where + additionalProperties: false + PostDeleteManyArgs: + type: object + properties: + where: + $ref: "#/components/schemas/PostWhereInput" + limit: + $ref: "#/components/schemas/_nonNegativeInteger" + additionalProperties: false + PostCountAggregateInput: + anyOf: + - type: boolean + const: true + - type: object + properties: + _all: + type: boolean + const: true + id: + type: boolean + const: true + createdAt: + type: boolean + const: true + updatedAt: + type: boolean + const: true + title: + type: boolean + const: true + author: + type: boolean + const: true + authorId: + type: boolean + const: true + published: + type: boolean + const: true + publishedAt: + type: boolean + const: true + viewCount: + type: boolean + const: true + comments: + type: boolean + const: true + setting: + type: boolean + const: true + additionalProperties: false + PostCountArgs: + type: object + properties: + where: + $ref: "#/components/schemas/PostWhereInput" + skip: + $ref: "#/components/schemas/_nonNegativeInteger" + take: + $ref: "#/components/schemas/_integer" + orderBy: + anyOf: + - $ref: "#/components/schemas/PostOrderByWithRelationInput" + - type: array + items: + $ref: "#/components/schemas/PostOrderByWithRelationInput" + select: + $ref: "#/components/schemas/PostCountAggregateInput" + additionalProperties: false + PostSumAvgAggregateInput: + type: object + properties: + id: + type: boolean + const: true + viewCount: + type: boolean + const: true + additionalProperties: false + PostMinMaxAggregateInput: + type: object + properties: + id: + type: boolean + const: true + createdAt: + type: boolean + const: true + updatedAt: + type: boolean + const: true + title: + type: boolean + const: true + authorId: + type: boolean + const: true + published: + type: boolean + const: true + publishedAt: + type: boolean + const: true + viewCount: + type: boolean + const: true + additionalProperties: false + PostAggregateArgs: + type: object + properties: + where: + $ref: "#/components/schemas/PostWhereInput" + skip: + $ref: "#/components/schemas/_nonNegativeInteger" + take: + $ref: "#/components/schemas/_integer" + orderBy: + anyOf: + - $ref: "#/components/schemas/PostOrderByWithRelationInput" + - type: array + items: + $ref: "#/components/schemas/PostOrderByWithRelationInput" + _count: + $ref: "#/components/schemas/PostCountAggregateInput" + _avg: + $ref: "#/components/schemas/PostSumAvgAggregateInput" + _sum: + $ref: "#/components/schemas/PostSumAvgAggregateInput" + _min: + $ref: "#/components/schemas/PostMinMaxAggregateInput" + _max: + $ref: "#/components/schemas/PostMinMaxAggregateInput" + additionalProperties: false + PostOrderByWithAggregationInput: + type: object + properties: + id: + anyOf: + - type: string + const: asc + - type: string + const: desc + createdAt: + anyOf: + - type: string + const: asc + - type: string + const: desc + updatedAt: + anyOf: + - type: string + const: asc + - type: string + const: desc + title: + anyOf: + - type: string + const: asc + - type: string + const: desc + authorId: + anyOf: + - anyOf: + - type: string + const: asc + - type: string + const: desc + - type: object + properties: + sort: + anyOf: + - type: string + const: asc + - type: string + const: desc + nulls: + anyOf: + - type: string + const: first + - type: string + const: last + required: + - sort + - nulls + additionalProperties: false + published: + anyOf: + - type: string + const: asc + - type: string + const: desc + publishedAt: + anyOf: + - anyOf: + - type: string + const: asc + - type: string + const: desc + - type: object + properties: + sort: + anyOf: + - type: string + const: asc + - type: string + const: desc + nulls: + anyOf: + - type: string + const: first + - type: string + const: last + required: + - sort + - nulls + additionalProperties: false + viewCount: + anyOf: + - type: string + const: asc + - type: string + const: desc + _count: + $ref: "#/components/schemas/PostOrderByWithRelationInput" + _avg: + $ref: "#/components/schemas/PostOrderByWithRelationInput" + _sum: + $ref: "#/components/schemas/PostOrderByWithRelationInput" + _min: + $ref: "#/components/schemas/PostOrderByWithRelationInput" + _max: + $ref: "#/components/schemas/PostOrderByWithRelationInput" + additionalProperties: false + StringFilterOptionalAgg: + anyOf: + - anyOf: + - type: string + - type: "null" + - type: object + properties: + equals: + anyOf: + - type: string + - type: "null" + in: + type: array + items: + type: string + notIn: + type: array + items: + type: string + lt: + type: string + lte: + type: string + gt: + type: string + gte: + type: string + between: + minItems: 2 + maxItems: 2 + type: array + items: + type: string + not: + $ref: "#/components/schemas/StringFilterOptionalAgg" + _count: + $ref: "#/components/schemas/IntFilter" + _min: + anyOf: + - type: string + - type: object + properties: + equals: + type: string + in: + type: array + items: + type: string + notIn: + type: array + items: + type: string + lt: + type: string + lte: + type: string + gt: + type: string + gte: + type: string + between: + minItems: 2 + maxItems: 2 + type: array + items: + type: string + not: + $ref: "#/components/schemas/StringFilterOptionalAgg" + additionalProperties: false + _max: + anyOf: + - type: string + - type: object + properties: + equals: + type: string + in: + type: array + items: + type: string + notIn: + type: array + items: + type: string + lt: + type: string + lte: + type: string + gt: + type: string + gte: + type: string + between: + minItems: 2 + maxItems: 2 + type: array + items: + type: string + not: + $ref: "#/components/schemas/StringFilterOptionalAgg" + additionalProperties: false + startsWith: + type: string + endsWith: + type: string + contains: + type: string + mode: + anyOf: + - type: string + const: default + - type: string + const: insensitive + additionalProperties: false + BooleanFilterAgg: + anyOf: + - type: boolean + - type: object + properties: + equals: + type: boolean + not: + $ref: "#/components/schemas/BooleanFilterAgg" + _count: + $ref: "#/components/schemas/IntFilter" + _min: + anyOf: + - type: boolean + - type: object + properties: + equals: + type: boolean + in: + type: array + items: + type: boolean + notIn: + type: array + items: + type: boolean + lt: + type: boolean + lte: + type: boolean + gt: + type: boolean + gte: + type: boolean + between: + minItems: 2 + maxItems: 2 + type: array + items: + type: boolean + not: + $ref: "#/components/schemas/BooleanFilterAgg" + additionalProperties: false + _max: + anyOf: + - type: boolean + - type: object + properties: + equals: + type: boolean + in: + type: array + items: + type: boolean + notIn: + type: array + items: + type: boolean + lt: + type: boolean + lte: + type: boolean + gt: + type: boolean + gte: + type: boolean + between: + minItems: 2 + maxItems: 2 + type: array + items: + type: boolean + not: + $ref: "#/components/schemas/BooleanFilterAgg" + additionalProperties: false + additionalProperties: false + DateTimeFilterOptionalAgg: + anyOf: + - anyOf: + - $ref: "#/components/schemas/DateTime" + - type: "null" + - type: object + properties: + equals: + anyOf: + - $ref: "#/components/schemas/DateTime" + - type: "null" + in: + type: array + items: + $ref: "#/components/schemas/DateTime" + notIn: + type: array + items: + $ref: "#/components/schemas/DateTime" + lt: + $ref: "#/components/schemas/DateTime" + lte: + $ref: "#/components/schemas/DateTime" + gt: + $ref: "#/components/schemas/DateTime" + gte: + $ref: "#/components/schemas/DateTime" + between: + minItems: 2 + maxItems: 2 + type: array + items: + $ref: "#/components/schemas/DateTime" + not: + $ref: "#/components/schemas/DateTimeFilterOptionalAgg" + _count: + $ref: "#/components/schemas/IntFilter" + _min: + anyOf: + - $ref: "#/components/schemas/DateTime" + - type: object + properties: + equals: + $ref: "#/components/schemas/DateTime" + in: + type: array + items: + $ref: "#/components/schemas/DateTime" + notIn: + type: array + items: + $ref: "#/components/schemas/DateTime" + lt: + $ref: "#/components/schemas/DateTime" + lte: + $ref: "#/components/schemas/DateTime" + gt: + $ref: "#/components/schemas/DateTime" + gte: + $ref: "#/components/schemas/DateTime" + between: + minItems: 2 + maxItems: 2 + type: array + items: + $ref: "#/components/schemas/DateTime" + not: + $ref: "#/components/schemas/DateTimeFilterOptionalAgg" + additionalProperties: false + _max: + anyOf: + - $ref: "#/components/schemas/DateTime" + - type: object + properties: + equals: + $ref: "#/components/schemas/DateTime" + in: + type: array + items: + $ref: "#/components/schemas/DateTime" + notIn: + type: array + items: + $ref: "#/components/schemas/DateTime" + lt: + $ref: "#/components/schemas/DateTime" + lte: + $ref: "#/components/schemas/DateTime" + gt: + $ref: "#/components/schemas/DateTime" + gte: + $ref: "#/components/schemas/DateTime" + between: + minItems: 2 + maxItems: 2 + type: array + items: + $ref: "#/components/schemas/DateTime" + not: + $ref: "#/components/schemas/DateTimeFilterOptionalAgg" + additionalProperties: false + additionalProperties: false + PostWhereInputWithoutRelationWithAggregation: + type: object + properties: + id: + $ref: "#/components/schemas/IntFilterAgg" + createdAt: + $ref: "#/components/schemas/DateTimeFilterAgg" + updatedAt: + $ref: "#/components/schemas/DateTimeFilterAgg" + title: + $ref: "#/components/schemas/StringFilterAgg" + authorId: + $ref: "#/components/schemas/StringFilterOptionalAgg" + published: + $ref: "#/components/schemas/BooleanFilterAgg" + publishedAt: + $ref: "#/components/schemas/DateTimeFilterOptionalAgg" + viewCount: + $ref: "#/components/schemas/IntFilterAgg" + $expr: {} + AND: + anyOf: + - $ref: "#/components/schemas/PostWhereInputWithoutRelation" + - type: array + items: + $ref: "#/components/schemas/PostWhereInputWithoutRelation" + OR: + type: array + items: + $ref: "#/components/schemas/PostWhereInputWithoutRelation" + NOT: + anyOf: + - $ref: "#/components/schemas/PostWhereInputWithoutRelation" + - type: array + items: + $ref: "#/components/schemas/PostWhereInputWithoutRelation" + additionalProperties: false + PostGroupByArgs: + type: object + properties: + where: + $ref: "#/components/schemas/PostWhereInput" + orderBy: + anyOf: + - $ref: "#/components/schemas/PostOrderByWithAggregationInput" + - type: array + items: + $ref: "#/components/schemas/PostOrderByWithAggregationInput" + by: + anyOf: + - type: string + enum: + - id + - createdAt + - updatedAt + - title + - authorId + - published + - publishedAt + - viewCount + - type: array + items: + type: string + enum: + - id + - createdAt + - updatedAt + - title + - authorId + - published + - publishedAt + - viewCount + having: + $ref: "#/components/schemas/PostWhereInputWithoutRelationWithAggregation" + skip: + $ref: "#/components/schemas/_nonNegativeInteger" + take: + $ref: "#/components/schemas/_integer" + _count: + $ref: "#/components/schemas/PostCountAggregateInput" + _avg: + $ref: "#/components/schemas/PostSumAvgAggregateInput" + _sum: + $ref: "#/components/schemas/PostSumAvgAggregateInput" + _min: + $ref: "#/components/schemas/PostMinMaxAggregateInput" + _max: + $ref: "#/components/schemas/PostMinMaxAggregateInput" + required: + - by + additionalProperties: false + CommentWhereUniqueInput: + type: object + properties: + id: + $ref: "#/components/schemas/IntFilter" + post: + anyOf: + - $ref: "#/components/schemas/PostWhereInput" + - type: object + properties: + is: + $ref: "#/components/schemas/PostWhereInput" + isNot: + $ref: "#/components/schemas/PostWhereInput" + additionalProperties: false + postId: + $ref: "#/components/schemas/IntFilter" + content: + $ref: "#/components/schemas/StringFilter" + $expr: {} + AND: + anyOf: + - $ref: "#/components/schemas/CommentWhereInput" + - type: array + items: + $ref: "#/components/schemas/CommentWhereInput" + OR: + type: array + items: + $ref: "#/components/schemas/CommentWhereInput" + NOT: + anyOf: + - $ref: "#/components/schemas/CommentWhereInput" + - type: array + items: + $ref: "#/components/schemas/CommentWhereInput" + required: + - id + additionalProperties: false + CommentPostRelationInput: + anyOf: + - type: boolean + - type: object + properties: + select: + anyOf: + - $ref: "#/components/schemas/PostSelect" + - type: "null" + include: + anyOf: + - $ref: "#/components/schemas/PostInclude" + - type: "null" + omit: + anyOf: + - $ref: "#/components/schemas/PostOmitInput" + - type: "null" + additionalProperties: false + CommentSelect: + type: object + properties: + id: + type: boolean + post: + $ref: "#/components/schemas/CommentPostRelationInput" + postId: + type: boolean + content: + type: boolean + additionalProperties: false + CommentInclude: + type: object + properties: + post: + $ref: "#/components/schemas/CommentPostRelationInput" + additionalProperties: false + CommentOmitInput: + type: object + properties: + id: + type: boolean + postId: + type: boolean + content: + type: boolean + additionalProperties: false + CommentFindUniqueArgs: + type: object + properties: + where: + $ref: "#/components/schemas/CommentWhereUniqueInput" + select: + anyOf: + - $ref: "#/components/schemas/CommentSelect" + - type: "null" + include: + anyOf: + - $ref: "#/components/schemas/CommentInclude" + - type: "null" + omit: + anyOf: + - $ref: "#/components/schemas/CommentOmitInput" + - type: "null" + required: + - where + additionalProperties: false + CommentOrderByWithRelationInput: + type: object + properties: + id: + anyOf: + - type: string + const: asc + - type: string + const: desc + post: + $ref: "#/components/schemas/PostOrderByWithRelationInput" + postId: + anyOf: + - type: string + const: asc + - type: string + const: desc + content: + anyOf: + - type: string + const: asc + - type: string + const: desc + additionalProperties: false + CommentFindFirstArgs: + type: object + properties: + where: + $ref: "#/components/schemas/CommentWhereInput" + select: + anyOf: + - $ref: "#/components/schemas/CommentSelect" + - type: "null" + include: + anyOf: + - $ref: "#/components/schemas/CommentInclude" + - type: "null" + omit: + anyOf: + - $ref: "#/components/schemas/CommentOmitInput" + - type: "null" + skip: + $ref: "#/components/schemas/_nonNegativeInteger" + take: + type: number + const: 1 + orderBy: + anyOf: + - $ref: "#/components/schemas/CommentOrderByWithRelationInput" + - type: array + items: + $ref: "#/components/schemas/CommentOrderByWithRelationInput" + cursor: + $ref: "#/components/schemas/CommentCursorInput" + distinct: + $ref: "#/components/schemas/CommentDistinctInput" + additionalProperties: false + CommentFindManyArgs: + type: object + properties: + where: + $ref: "#/components/schemas/CommentWhereInput" + select: + anyOf: + - $ref: "#/components/schemas/CommentSelect" + - type: "null" + include: + anyOf: + - $ref: "#/components/schemas/CommentInclude" + - type: "null" + omit: + anyOf: + - $ref: "#/components/schemas/CommentOmitInput" + - type: "null" + skip: + $ref: "#/components/schemas/_nonNegativeInteger" + take: + $ref: "#/components/schemas/_integer" + orderBy: + anyOf: + - $ref: "#/components/schemas/CommentOrderByWithRelationInput" + - type: array + items: + $ref: "#/components/schemas/CommentOrderByWithRelationInput" + cursor: + $ref: "#/components/schemas/CommentCursorInput" + distinct: + $ref: "#/components/schemas/CommentDistinctInput" + additionalProperties: false + CommentExistsArgs: + type: object + properties: + where: + $ref: "#/components/schemas/CommentWhereInput" + additionalProperties: false + CommentCreateData: + anyOf: + - type: object + properties: + id: + $ref: "#/components/schemas/_integer" + postId: + $ref: "#/components/schemas/_integer" + content: + type: string + required: + - postId + - content + additionalProperties: false + - type: object + properties: + id: + $ref: "#/components/schemas/_integer" + post: + type: object + properties: + connect: + $ref: "#/components/schemas/PostWhereUniqueInput" + create: + $ref: "#/components/schemas/PostCreateDataWithoutcomments" + connectOrCreate: + type: object + properties: + where: + $ref: "#/components/schemas/PostWhereUniqueInput" + create: + $ref: "#/components/schemas/PostCreateDataWithoutcomments" + required: + - where + - create + additionalProperties: false + additionalProperties: false + content: + type: string + required: + - post + - content + additionalProperties: false + CommentCreateArgs: + type: object + properties: + data: + $ref: "#/components/schemas/CommentCreateData" + select: + anyOf: + - $ref: "#/components/schemas/CommentSelect" + - type: "null" + include: + anyOf: + - $ref: "#/components/schemas/CommentInclude" + - type: "null" + omit: + anyOf: + - $ref: "#/components/schemas/CommentOmitInput" + - type: "null" + required: + - data + additionalProperties: false + CommentCreateDataArrayWithoutRelation: + anyOf: + - type: object + properties: + id: + $ref: "#/components/schemas/_integer" + postId: + $ref: "#/components/schemas/_integer" + content: + type: string + required: + - postId + - content + additionalProperties: false + - type: array + items: + type: object + properties: + id: + $ref: "#/components/schemas/_integer" + postId: + $ref: "#/components/schemas/_integer" + content: + type: string + required: + - postId + - content + additionalProperties: false + CommentCreateManyPayload: + type: object + properties: + data: + $ref: "#/components/schemas/CommentCreateDataArrayWithoutRelation" + skipDuplicates: + type: boolean + required: + - data + additionalProperties: false + CommentCreateManyArgs: + type: object + properties: + data: + $ref: "#/components/schemas/CommentCreateDataArrayWithoutRelation" + skipDuplicates: + type: boolean + required: + - data + additionalProperties: false + CommentCreateManyAndReturnArgs: + type: object + properties: + data: + $ref: "#/components/schemas/CommentCreateDataArrayWithoutRelation" + skipDuplicates: + type: boolean + select: + anyOf: + - $ref: "#/components/schemas/CommentSelect" + - type: "null" + omit: + anyOf: + - $ref: "#/components/schemas/CommentOmitInput" + - type: "null" + required: + - data + additionalProperties: false + CommentUpdateData: + anyOf: + - type: object + properties: + id: + anyOf: + - $ref: "#/components/schemas/_integer" + - type: object + properties: + set: + type: number + increment: + type: number + decrement: + type: number + multiply: + type: number + divide: + type: number + additionalProperties: false + postId: + anyOf: + - $ref: "#/components/schemas/_integer" + - type: object + properties: + set: + type: number + increment: + type: number + decrement: + type: number + multiply: + type: number + divide: + type: number + additionalProperties: false + content: + type: string + additionalProperties: false + - type: object + properties: + id: + anyOf: + - $ref: "#/components/schemas/_integer" + - type: object + properties: + set: + type: number + increment: + type: number + decrement: + type: number + multiply: + type: number + divide: + type: number + additionalProperties: false + post: + type: object + properties: + connect: + $ref: "#/components/schemas/PostWhereUniqueInput" + create: + $ref: "#/components/schemas/PostCreateDataWithoutcomments" + connectOrCreate: + type: object + properties: + where: + $ref: "#/components/schemas/PostWhereUniqueInput" + create: + $ref: "#/components/schemas/PostCreateDataWithoutcomments" + required: + - where + - create + additionalProperties: false + update: + anyOf: + - type: object + properties: + where: + $ref: "#/components/schemas/PostWhereInput" + data: + $ref: "#/components/schemas/PostUpdateDataWithoutcomments" + required: + - data + additionalProperties: false + - $ref: "#/components/schemas/PostUpdateDataWithoutcomments" + upsert: + anyOf: + - type: object + properties: + where: + $ref: "#/components/schemas/PostWhereUniqueInput" + create: + $ref: "#/components/schemas/PostCreateDataWithoutcomments" + update: + $ref: "#/components/schemas/PostUpdateDataWithoutcomments" + required: + - create + - update + additionalProperties: false + - type: array + items: + type: object + properties: + where: + $ref: "#/components/schemas/PostWhereUniqueInput" + create: + $ref: "#/components/schemas/PostCreateDataWithoutcomments" + update: + $ref: "#/components/schemas/PostUpdateDataWithoutcomments" + required: + - create + - update + additionalProperties: false + additionalProperties: false + content: + type: string + additionalProperties: false + CommentUpdateArgs: + type: object + properties: + where: + $ref: "#/components/schemas/CommentWhereUniqueInput" + data: + $ref: "#/components/schemas/CommentUpdateData" + select: + anyOf: + - $ref: "#/components/schemas/CommentSelect" + - type: "null" + include: + anyOf: + - $ref: "#/components/schemas/CommentInclude" + - type: "null" + omit: + anyOf: + - $ref: "#/components/schemas/CommentOmitInput" + - type: "null" + required: + - where + - data + additionalProperties: false + CommentUpdateDataWithoutRelation: + type: object + properties: + id: + anyOf: + - $ref: "#/components/schemas/_integer" + - type: object + properties: + set: + type: number + increment: + type: number + decrement: + type: number + multiply: + type: number + divide: + type: number + additionalProperties: false + postId: + anyOf: + - $ref: "#/components/schemas/_integer" + - type: object + properties: + set: + type: number + increment: + type: number + decrement: + type: number + multiply: + type: number + divide: + type: number + additionalProperties: false + content: + type: string + additionalProperties: false + CommentUpdateManyArgs: + type: object + properties: + where: + $ref: "#/components/schemas/CommentWhereInput" + data: + $ref: "#/components/schemas/CommentUpdateDataWithoutRelation" + limit: + $ref: "#/components/schemas/_nonNegativeInteger" + required: + - data + additionalProperties: false + CommentUpdateManyAndReturnArgs: + type: object + properties: + where: + $ref: "#/components/schemas/CommentWhereInput" + data: + $ref: "#/components/schemas/CommentUpdateDataWithoutRelation" + limit: + $ref: "#/components/schemas/_nonNegativeInteger" + select: + anyOf: + - $ref: "#/components/schemas/CommentSelect" + - type: "null" + omit: + anyOf: + - $ref: "#/components/schemas/CommentOmitInput" + - type: "null" + required: + - data + additionalProperties: false + CommentUpsertArgs: + type: object + properties: + where: + $ref: "#/components/schemas/CommentWhereUniqueInput" + create: + $ref: "#/components/schemas/CommentCreateData" + update: + $ref: "#/components/schemas/CommentUpdateData" + select: + anyOf: + - $ref: "#/components/schemas/CommentSelect" + - type: "null" + include: + anyOf: + - $ref: "#/components/schemas/CommentInclude" + - type: "null" + omit: + anyOf: + - $ref: "#/components/schemas/CommentOmitInput" + - type: "null" + required: + - where + - create + - update + additionalProperties: false + CommentDeleteArgs: + type: object + properties: + where: + $ref: "#/components/schemas/CommentWhereUniqueInput" + select: + anyOf: + - $ref: "#/components/schemas/CommentSelect" + - type: "null" + include: + anyOf: + - $ref: "#/components/schemas/CommentInclude" + - type: "null" + omit: + anyOf: + - $ref: "#/components/schemas/CommentOmitInput" + - type: "null" + required: + - where + additionalProperties: false + CommentDeleteManyArgs: + type: object + properties: + where: + $ref: "#/components/schemas/CommentWhereInput" + limit: + $ref: "#/components/schemas/_nonNegativeInteger" + additionalProperties: false + CommentCountAggregateInput: + anyOf: + - type: boolean + const: true + - type: object + properties: + _all: + type: boolean + const: true + id: + type: boolean + const: true + post: + type: boolean + const: true + postId: + type: boolean + const: true + content: + type: boolean + const: true + additionalProperties: false + CommentCountArgs: + type: object + properties: + where: + $ref: "#/components/schemas/CommentWhereInput" + skip: + $ref: "#/components/schemas/_nonNegativeInteger" + take: + $ref: "#/components/schemas/_integer" + orderBy: + anyOf: + - $ref: "#/components/schemas/CommentOrderByWithRelationInput" + - type: array + items: + $ref: "#/components/schemas/CommentOrderByWithRelationInput" + select: + $ref: "#/components/schemas/CommentCountAggregateInput" + additionalProperties: false + CommentSumAvgAggregateInput: + type: object + properties: + id: + type: boolean + const: true + postId: + type: boolean + const: true + additionalProperties: false + CommentMinMaxAggregateInput: + type: object + properties: + id: + type: boolean + const: true + postId: + type: boolean + const: true + content: + type: boolean + const: true + additionalProperties: false + CommentAggregateArgs: + type: object + properties: + where: + $ref: "#/components/schemas/CommentWhereInput" + skip: + $ref: "#/components/schemas/_nonNegativeInteger" + take: + $ref: "#/components/schemas/_integer" + orderBy: + anyOf: + - $ref: "#/components/schemas/CommentOrderByWithRelationInput" + - type: array + items: + $ref: "#/components/schemas/CommentOrderByWithRelationInput" + _count: + $ref: "#/components/schemas/CommentCountAggregateInput" + _avg: + $ref: "#/components/schemas/CommentSumAvgAggregateInput" + _sum: + $ref: "#/components/schemas/CommentSumAvgAggregateInput" + _min: + $ref: "#/components/schemas/CommentMinMaxAggregateInput" + _max: + $ref: "#/components/schemas/CommentMinMaxAggregateInput" + additionalProperties: false + CommentOrderByWithAggregationInput: + type: object + properties: + id: + anyOf: + - type: string + const: asc + - type: string + const: desc + postId: + anyOf: + - type: string + const: asc + - type: string + const: desc + content: + anyOf: + - type: string + const: asc + - type: string + const: desc + _count: + $ref: "#/components/schemas/CommentOrderByWithRelationInput" + _avg: + $ref: "#/components/schemas/CommentOrderByWithRelationInput" + _sum: + $ref: "#/components/schemas/CommentOrderByWithRelationInput" + _min: + $ref: "#/components/schemas/CommentOrderByWithRelationInput" + _max: + $ref: "#/components/schemas/CommentOrderByWithRelationInput" + additionalProperties: false + CommentWhereInputWithoutRelationWithAggregation: + type: object + properties: + id: + $ref: "#/components/schemas/IntFilterAgg" + postId: + $ref: "#/components/schemas/IntFilterAgg" + content: + $ref: "#/components/schemas/StringFilterAgg" + $expr: {} + AND: + anyOf: + - $ref: "#/components/schemas/CommentWhereInputWithoutRelation" + - type: array + items: + $ref: "#/components/schemas/CommentWhereInputWithoutRelation" + OR: + type: array + items: + $ref: "#/components/schemas/CommentWhereInputWithoutRelation" + NOT: + anyOf: + - $ref: "#/components/schemas/CommentWhereInputWithoutRelation" + - type: array + items: + $ref: "#/components/schemas/CommentWhereInputWithoutRelation" + additionalProperties: false + CommentGroupByArgs: + type: object + properties: + where: + $ref: "#/components/schemas/CommentWhereInput" + orderBy: + anyOf: + - $ref: "#/components/schemas/CommentOrderByWithAggregationInput" + - type: array + items: + $ref: "#/components/schemas/CommentOrderByWithAggregationInput" + by: + anyOf: + - type: string + enum: + - id + - postId + - content + - type: array + items: + type: string + enum: + - id + - postId + - content + having: + $ref: "#/components/schemas/CommentWhereInputWithoutRelationWithAggregation" + skip: + $ref: "#/components/schemas/_nonNegativeInteger" + take: + $ref: "#/components/schemas/_integer" + _count: + $ref: "#/components/schemas/CommentCountAggregateInput" + _avg: + $ref: "#/components/schemas/CommentSumAvgAggregateInput" + _sum: + $ref: "#/components/schemas/CommentSumAvgAggregateInput" + _min: + $ref: "#/components/schemas/CommentMinMaxAggregateInput" + _max: + $ref: "#/components/schemas/CommentMinMaxAggregateInput" + required: + - by + additionalProperties: false + SettingWhereUniqueInput: + type: object + properties: + id: + $ref: "#/components/schemas/IntFilter" + boost: + $ref: "#/components/schemas/IntFilter" + post: + anyOf: + - $ref: "#/components/schemas/PostWhereInput" + - type: object + properties: + is: + $ref: "#/components/schemas/PostWhereInput" + isNot: + $ref: "#/components/schemas/PostWhereInput" + additionalProperties: false + postId: + $ref: "#/components/schemas/IntFilter" + $expr: {} + AND: + anyOf: + - $ref: "#/components/schemas/SettingWhereInput" + - type: array + items: + $ref: "#/components/schemas/SettingWhereInput" + OR: + type: array + items: + $ref: "#/components/schemas/SettingWhereInput" + NOT: + anyOf: + - $ref: "#/components/schemas/SettingWhereInput" + - type: array + items: + $ref: "#/components/schemas/SettingWhereInput" + additionalProperties: false + SettingPostRelationInput: + anyOf: + - type: boolean + - type: object + properties: + select: + anyOf: + - $ref: "#/components/schemas/PostSelect" + - type: "null" + include: + anyOf: + - $ref: "#/components/schemas/PostInclude" + - type: "null" + omit: + anyOf: + - $ref: "#/components/schemas/PostOmitInput" + - type: "null" + additionalProperties: false + SettingSelect: + type: object + properties: + id: + type: boolean + boost: + type: boolean + post: + $ref: "#/components/schemas/SettingPostRelationInput" + postId: + type: boolean + additionalProperties: false + SettingInclude: + type: object + properties: + post: + $ref: "#/components/schemas/SettingPostRelationInput" + additionalProperties: false + SettingOmitInput: + type: object + properties: + id: + type: boolean + boost: + type: boolean + postId: + type: boolean + additionalProperties: false + SettingFindUniqueArgs: + type: object + properties: + where: + $ref: "#/components/schemas/SettingWhereUniqueInput" + select: + anyOf: + - $ref: "#/components/schemas/SettingSelect" + - type: "null" + include: + anyOf: + - $ref: "#/components/schemas/SettingInclude" + - type: "null" + omit: + anyOf: + - $ref: "#/components/schemas/SettingOmitInput" + - type: "null" + required: + - where + additionalProperties: false + SettingWhereInput: + type: object + properties: + id: + $ref: "#/components/schemas/IntFilter" + boost: + $ref: "#/components/schemas/IntFilter" + post: + anyOf: + - $ref: "#/components/schemas/PostWhereInput" + - type: object + properties: + is: + $ref: "#/components/schemas/PostWhereInput" + isNot: + $ref: "#/components/schemas/PostWhereInput" + additionalProperties: false + postId: + $ref: "#/components/schemas/IntFilter" + $expr: {} + AND: + anyOf: + - $ref: "#/components/schemas/SettingWhereInput" + - type: array + items: + $ref: "#/components/schemas/SettingWhereInput" + OR: + type: array + items: + $ref: "#/components/schemas/SettingWhereInput" + NOT: + anyOf: + - $ref: "#/components/schemas/SettingWhereInput" + - type: array + items: + $ref: "#/components/schemas/SettingWhereInput" + additionalProperties: false + SettingOrderByWithRelationInput: + type: object + properties: + id: + anyOf: + - type: string + const: asc + - type: string + const: desc + boost: + anyOf: + - type: string + const: asc + - type: string + const: desc + post: + $ref: "#/components/schemas/PostOrderByWithRelationInput" + postId: + anyOf: + - type: string + const: asc + - type: string + const: desc + additionalProperties: false + SettingWhereUniqueInputWithoutRelation: + type: object + properties: + id: + $ref: "#/components/schemas/IntFilter" + boost: + $ref: "#/components/schemas/IntFilter" + postId: + $ref: "#/components/schemas/IntFilter" + $expr: {} + AND: + anyOf: + - $ref: "#/components/schemas/SettingWhereInputWithoutRelation" + - type: array + items: + $ref: "#/components/schemas/SettingWhereInputWithoutRelation" + OR: + type: array + items: + $ref: "#/components/schemas/SettingWhereInputWithoutRelation" + NOT: + anyOf: + - $ref: "#/components/schemas/SettingWhereInputWithoutRelation" + - type: array + items: + $ref: "#/components/schemas/SettingWhereInputWithoutRelation" + additionalProperties: false + SettingCursorInput: + $ref: "#/components/schemas/SettingWhereUniqueInputWithoutRelation" + SettingDistinctInput: + anyOf: + - type: string + enum: + - id + - boost + - postId + - type: array + items: + type: string + enum: + - id + - boost + - postId + SettingFindFirstArgs: + type: object + properties: + where: + $ref: "#/components/schemas/SettingWhereInput" + select: + anyOf: + - $ref: "#/components/schemas/SettingSelect" + - type: "null" + include: + anyOf: + - $ref: "#/components/schemas/SettingInclude" + - type: "null" + omit: + anyOf: + - $ref: "#/components/schemas/SettingOmitInput" + - type: "null" + skip: + $ref: "#/components/schemas/_nonNegativeInteger" + take: + type: number + const: 1 + orderBy: + anyOf: + - $ref: "#/components/schemas/SettingOrderByWithRelationInput" + - type: array + items: + $ref: "#/components/schemas/SettingOrderByWithRelationInput" + cursor: + $ref: "#/components/schemas/SettingCursorInput" + distinct: + $ref: "#/components/schemas/SettingDistinctInput" + additionalProperties: false + SettingFindManyArgs: + type: object + properties: + where: + $ref: "#/components/schemas/SettingWhereInput" + select: + anyOf: + - $ref: "#/components/schemas/SettingSelect" + - type: "null" + include: + anyOf: + - $ref: "#/components/schemas/SettingInclude" + - type: "null" + omit: + anyOf: + - $ref: "#/components/schemas/SettingOmitInput" + - type: "null" + skip: + $ref: "#/components/schemas/_nonNegativeInteger" + take: + $ref: "#/components/schemas/_integer" + orderBy: + anyOf: + - $ref: "#/components/schemas/SettingOrderByWithRelationInput" + - type: array + items: + $ref: "#/components/schemas/SettingOrderByWithRelationInput" + cursor: + $ref: "#/components/schemas/SettingCursorInput" + distinct: + $ref: "#/components/schemas/SettingDistinctInput" + additionalProperties: false + SettingExistsArgs: + type: object + properties: + where: + $ref: "#/components/schemas/SettingWhereInput" + additionalProperties: false + SettingCreateData: + anyOf: + - type: object + properties: + id: + $ref: "#/components/schemas/_integer" + boost: + $ref: "#/components/schemas/_integer" + postId: + $ref: "#/components/schemas/_integer" + required: + - boost + - postId + additionalProperties: false + - type: object + properties: + id: + $ref: "#/components/schemas/_integer" + boost: + $ref: "#/components/schemas/_integer" + post: + type: object + properties: + connect: + $ref: "#/components/schemas/PostWhereUniqueInput" + create: + $ref: "#/components/schemas/PostCreateDataWithoutsetting" + connectOrCreate: + type: object + properties: + where: + $ref: "#/components/schemas/PostWhereUniqueInput" + create: + $ref: "#/components/schemas/PostCreateDataWithoutsetting" + required: + - where + - create + additionalProperties: false + additionalProperties: false + required: + - boost + - post + additionalProperties: false + SettingCreateArgs: + type: object + properties: + data: + $ref: "#/components/schemas/SettingCreateData" + select: + anyOf: + - $ref: "#/components/schemas/SettingSelect" + - type: "null" + include: + anyOf: + - $ref: "#/components/schemas/SettingInclude" + - type: "null" + omit: + anyOf: + - $ref: "#/components/schemas/SettingOmitInput" + - type: "null" + required: + - data + additionalProperties: false + SettingCreateDataArrayWithoutRelation: + anyOf: + - type: object + properties: + id: + $ref: "#/components/schemas/_integer" + boost: + $ref: "#/components/schemas/_integer" + postId: + $ref: "#/components/schemas/_integer" + required: + - boost + - postId + additionalProperties: false + - type: array + items: + type: object + properties: + id: + $ref: "#/components/schemas/_integer" + boost: + $ref: "#/components/schemas/_integer" + postId: + $ref: "#/components/schemas/_integer" + required: + - boost + - postId + additionalProperties: false + SettingCreateManyPayload: + type: object + properties: + data: + $ref: "#/components/schemas/SettingCreateDataArrayWithoutRelation" + skipDuplicates: + type: boolean + required: + - data + additionalProperties: false + SettingCreateManyArgs: + type: object + properties: + data: + $ref: "#/components/schemas/SettingCreateDataArrayWithoutRelation" + skipDuplicates: + type: boolean + required: + - data + additionalProperties: false + SettingCreateManyAndReturnArgs: + type: object + properties: + data: + $ref: "#/components/schemas/SettingCreateDataArrayWithoutRelation" + skipDuplicates: + type: boolean + select: + anyOf: + - $ref: "#/components/schemas/SettingSelect" + - type: "null" + omit: + anyOf: + - $ref: "#/components/schemas/SettingOmitInput" + - type: "null" + required: + - data + additionalProperties: false + SettingUpdateData: + anyOf: + - type: object + properties: + id: + anyOf: + - $ref: "#/components/schemas/_integer" + - type: object + properties: + set: + type: number + increment: + type: number + decrement: + type: number + multiply: + type: number + divide: + type: number + additionalProperties: false + boost: + anyOf: + - $ref: "#/components/schemas/_integer" + - type: object + properties: + set: + type: number + increment: + type: number + decrement: + type: number + multiply: + type: number + divide: + type: number + additionalProperties: false + postId: + anyOf: + - $ref: "#/components/schemas/_integer" + - type: object + properties: + set: + type: number + increment: + type: number + decrement: + type: number + multiply: + type: number + divide: + type: number + additionalProperties: false + additionalProperties: false + - type: object + properties: + id: + anyOf: + - $ref: "#/components/schemas/_integer" + - type: object + properties: + set: + type: number + increment: + type: number + decrement: + type: number + multiply: + type: number + divide: + type: number + additionalProperties: false + boost: + anyOf: + - $ref: "#/components/schemas/_integer" + - type: object + properties: + set: + type: number + increment: + type: number + decrement: + type: number + multiply: + type: number + divide: + type: number + additionalProperties: false + post: + type: object + properties: + connect: + $ref: "#/components/schemas/PostWhereUniqueInput" + create: + $ref: "#/components/schemas/PostCreateDataWithoutsetting" + connectOrCreate: + type: object + properties: + where: + $ref: "#/components/schemas/PostWhereUniqueInput" + create: + $ref: "#/components/schemas/PostCreateDataWithoutsetting" + required: + - where + - create + additionalProperties: false + update: + anyOf: + - type: object + properties: + where: + $ref: "#/components/schemas/PostWhereInput" + data: + $ref: "#/components/schemas/PostUpdateDataWithoutsetting" + required: + - data + additionalProperties: false + - $ref: "#/components/schemas/PostUpdateDataWithoutsetting" + upsert: + anyOf: + - type: object + properties: + where: + $ref: "#/components/schemas/PostWhereUniqueInput" + create: + $ref: "#/components/schemas/PostCreateDataWithoutsetting" + update: + $ref: "#/components/schemas/PostUpdateDataWithoutsetting" + required: + - create + - update + additionalProperties: false + - type: array + items: + type: object + properties: + where: + $ref: "#/components/schemas/PostWhereUniqueInput" + create: + $ref: "#/components/schemas/PostCreateDataWithoutsetting" + update: + $ref: "#/components/schemas/PostUpdateDataWithoutsetting" + required: + - create + - update + additionalProperties: false + additionalProperties: false + additionalProperties: false + SettingUpdateArgs: + type: object + properties: + where: + $ref: "#/components/schemas/SettingWhereUniqueInput" + data: + $ref: "#/components/schemas/SettingUpdateData" + select: + anyOf: + - $ref: "#/components/schemas/SettingSelect" + - type: "null" + include: + anyOf: + - $ref: "#/components/schemas/SettingInclude" + - type: "null" + omit: + anyOf: + - $ref: "#/components/schemas/SettingOmitInput" + - type: "null" + required: + - where + - data + additionalProperties: false + SettingUpdateDataWithoutRelation: + type: object + properties: + id: + anyOf: + - $ref: "#/components/schemas/_integer" + - type: object + properties: + set: + type: number + increment: + type: number + decrement: + type: number + multiply: + type: number + divide: + type: number + additionalProperties: false + boost: + anyOf: + - $ref: "#/components/schemas/_integer" + - type: object + properties: + set: + type: number + increment: + type: number + decrement: + type: number + multiply: + type: number + divide: + type: number + additionalProperties: false + postId: + anyOf: + - $ref: "#/components/schemas/_integer" + - type: object + properties: + set: + type: number + increment: + type: number + decrement: + type: number + multiply: + type: number + divide: + type: number + additionalProperties: false + additionalProperties: false + SettingUpdateManyArgs: + type: object + properties: + where: + $ref: "#/components/schemas/SettingWhereInput" + data: + $ref: "#/components/schemas/SettingUpdateDataWithoutRelation" + limit: + $ref: "#/components/schemas/_nonNegativeInteger" + required: + - data + additionalProperties: false + SettingUpdateManyAndReturnArgs: + type: object + properties: + where: + $ref: "#/components/schemas/SettingWhereInput" + data: + $ref: "#/components/schemas/SettingUpdateDataWithoutRelation" + limit: + $ref: "#/components/schemas/_nonNegativeInteger" + select: + anyOf: + - $ref: "#/components/schemas/SettingSelect" + - type: "null" + omit: + anyOf: + - $ref: "#/components/schemas/SettingOmitInput" + - type: "null" + required: + - data + additionalProperties: false + SettingUpsertArgs: + type: object + properties: + where: + $ref: "#/components/schemas/SettingWhereUniqueInput" + create: + $ref: "#/components/schemas/SettingCreateData" + update: + $ref: "#/components/schemas/SettingUpdateData" + select: + anyOf: + - $ref: "#/components/schemas/SettingSelect" + - type: "null" + include: + anyOf: + - $ref: "#/components/schemas/SettingInclude" + - type: "null" + omit: + anyOf: + - $ref: "#/components/schemas/SettingOmitInput" + - type: "null" + required: + - where + - create + - update + additionalProperties: false + SettingDeleteArgs: + type: object + properties: + where: + $ref: "#/components/schemas/SettingWhereUniqueInput" + select: + anyOf: + - $ref: "#/components/schemas/SettingSelect" + - type: "null" + include: + anyOf: + - $ref: "#/components/schemas/SettingInclude" + - type: "null" + omit: + anyOf: + - $ref: "#/components/schemas/SettingOmitInput" + - type: "null" + required: + - where + additionalProperties: false + SettingDeleteManyArgs: + type: object + properties: + where: + $ref: "#/components/schemas/SettingWhereInput" + limit: + $ref: "#/components/schemas/_nonNegativeInteger" + additionalProperties: false + SettingCountAggregateInput: + anyOf: + - type: boolean + const: true + - type: object + properties: + _all: + type: boolean + const: true + id: + type: boolean + const: true + boost: + type: boolean + const: true + post: + type: boolean + const: true + postId: + type: boolean + const: true + additionalProperties: false + SettingCountArgs: + type: object + properties: + where: + $ref: "#/components/schemas/SettingWhereInput" + skip: + $ref: "#/components/schemas/_nonNegativeInteger" + take: + $ref: "#/components/schemas/_integer" + orderBy: + anyOf: + - $ref: "#/components/schemas/SettingOrderByWithRelationInput" + - type: array + items: + $ref: "#/components/schemas/SettingOrderByWithRelationInput" + select: + $ref: "#/components/schemas/SettingCountAggregateInput" + additionalProperties: false + SettingSumAvgAggregateInput: + type: object + properties: + id: + type: boolean + const: true + boost: + type: boolean + const: true + postId: + type: boolean + const: true + additionalProperties: false + SettingMinMaxAggregateInput: + type: object + properties: + id: + type: boolean + const: true + boost: + type: boolean + const: true + postId: + type: boolean + const: true + additionalProperties: false + SettingAggregateArgs: + type: object + properties: + where: + $ref: "#/components/schemas/SettingWhereInput" + skip: + $ref: "#/components/schemas/_nonNegativeInteger" + take: + $ref: "#/components/schemas/_integer" + orderBy: + anyOf: + - $ref: "#/components/schemas/SettingOrderByWithRelationInput" + - type: array + items: + $ref: "#/components/schemas/SettingOrderByWithRelationInput" + _count: + $ref: "#/components/schemas/SettingCountAggregateInput" + _avg: + $ref: "#/components/schemas/SettingSumAvgAggregateInput" + _sum: + $ref: "#/components/schemas/SettingSumAvgAggregateInput" + _min: + $ref: "#/components/schemas/SettingMinMaxAggregateInput" + _max: + $ref: "#/components/schemas/SettingMinMaxAggregateInput" + additionalProperties: false + SettingOrderByWithAggregationInput: + type: object + properties: + id: + anyOf: + - type: string + const: asc + - type: string + const: desc + boost: + anyOf: + - type: string + const: asc + - type: string + const: desc + postId: + anyOf: + - type: string + const: asc + - type: string + const: desc + _count: + $ref: "#/components/schemas/SettingOrderByWithRelationInput" + _avg: + $ref: "#/components/schemas/SettingOrderByWithRelationInput" + _sum: + $ref: "#/components/schemas/SettingOrderByWithRelationInput" + _min: + $ref: "#/components/schemas/SettingOrderByWithRelationInput" + _max: + $ref: "#/components/schemas/SettingOrderByWithRelationInput" + additionalProperties: false + SettingWhereInputWithoutRelationWithAggregation: + type: object + properties: + id: + $ref: "#/components/schemas/IntFilterAgg" + boost: + $ref: "#/components/schemas/IntFilterAgg" + postId: + $ref: "#/components/schemas/IntFilterAgg" + $expr: {} + AND: + anyOf: + - $ref: "#/components/schemas/SettingWhereInputWithoutRelation" + - type: array + items: + $ref: "#/components/schemas/SettingWhereInputWithoutRelation" + OR: + type: array + items: + $ref: "#/components/schemas/SettingWhereInputWithoutRelation" + NOT: + anyOf: + - $ref: "#/components/schemas/SettingWhereInputWithoutRelation" + - type: array + items: + $ref: "#/components/schemas/SettingWhereInputWithoutRelation" + additionalProperties: false + SettingGroupByArgs: + type: object + properties: + where: + $ref: "#/components/schemas/SettingWhereInput" + orderBy: + anyOf: + - $ref: "#/components/schemas/SettingOrderByWithAggregationInput" + - type: array + items: + $ref: "#/components/schemas/SettingOrderByWithAggregationInput" + by: + anyOf: + - type: string + enum: + - id + - boost + - postId + - type: array + items: + type: string + enum: + - id + - boost + - postId + having: + $ref: "#/components/schemas/SettingWhereInputWithoutRelationWithAggregation" + skip: + $ref: "#/components/schemas/_nonNegativeInteger" + take: + $ref: "#/components/schemas/_integer" + _count: + $ref: "#/components/schemas/SettingCountAggregateInput" + _avg: + $ref: "#/components/schemas/SettingSumAvgAggregateInput" + _sum: + $ref: "#/components/schemas/SettingSumAvgAggregateInput" + _min: + $ref: "#/components/schemas/SettingMinMaxAggregateInput" + _max: + $ref: "#/components/schemas/SettingMinMaxAggregateInput" + required: + - by + additionalProperties: false + findPostsByUserProcArgs: + type: object + properties: + userId: + type: string + required: + - userId + additionalProperties: false + getPostCountProcArgs: + type: object + properties: + userId: + type: string + published: + type: boolean + required: + - userId + additionalProperties: false + publishPostProcArgs: + type: object + properties: + postId: + $ref: "#/components/schemas/_integer" + required: + - postId + additionalProperties: false + PostWhereInputWithoutRelation: + type: object + properties: + id: + $ref: "#/components/schemas/IntFilter" + createdAt: + $ref: "#/components/schemas/DateTimeFilter" + updatedAt: + $ref: "#/components/schemas/DateTimeFilter" + title: + $ref: "#/components/schemas/StringFilter" + authorId: + $ref: "#/components/schemas/StringFilterOptional" + published: + $ref: "#/components/schemas/BooleanFilter" + publishedAt: + $ref: "#/components/schemas/DateTimeFilterOptional" + viewCount: + $ref: "#/components/schemas/IntFilter" + $expr: {} + AND: + anyOf: + - $ref: "#/components/schemas/PostWhereInputWithoutRelation" + - type: array + items: + $ref: "#/components/schemas/PostWhereInputWithoutRelation" + OR: + type: array + items: + $ref: "#/components/schemas/PostWhereInputWithoutRelation" + NOT: + anyOf: + - $ref: "#/components/schemas/PostWhereInputWithoutRelation" + - type: array + items: + $ref: "#/components/schemas/PostWhereInputWithoutRelation" + additionalProperties: false + CommentWhereInputWithoutRelation: + type: object + properties: + id: + $ref: "#/components/schemas/IntFilter" + postId: + $ref: "#/components/schemas/IntFilter" + content: + $ref: "#/components/schemas/StringFilter" + $expr: {} + AND: + anyOf: + - $ref: "#/components/schemas/CommentWhereInputWithoutRelation" + - type: array + items: + $ref: "#/components/schemas/CommentWhereInputWithoutRelation" + OR: + type: array + items: + $ref: "#/components/schemas/CommentWhereInputWithoutRelation" + NOT: + anyOf: + - $ref: "#/components/schemas/CommentWhereInputWithoutRelation" + - type: array + items: + $ref: "#/components/schemas/CommentWhereInputWithoutRelation" + additionalProperties: false + UserWhereInputWithoutRelation: + type: object + properties: + myId: + $ref: "#/components/schemas/StringFilter" + createdAt: + $ref: "#/components/schemas/DateTimeFilter" + updatedAt: + $ref: "#/components/schemas/DateTimeFilter" + email: + $ref: "#/components/schemas/StringFilter" + address: + $ref: "#/components/schemas/AddressFilterOptional" + someJson: + $ref: "#/components/schemas/JsonFilterOptional" + $expr: {} + AND: + anyOf: + - $ref: "#/components/schemas/UserWhereInputWithoutRelation" + - type: array + items: + $ref: "#/components/schemas/UserWhereInputWithoutRelation" + OR: + type: array + items: + $ref: "#/components/schemas/UserWhereInputWithoutRelation" + NOT: + anyOf: + - $ref: "#/components/schemas/UserWhereInputWithoutRelation" + - type: array + items: + $ref: "#/components/schemas/UserWhereInputWithoutRelation" + additionalProperties: false + PostCreateDataArrayWithoutauthorauthorId: + anyOf: + - type: object + properties: + id: + $ref: "#/components/schemas/_integer" + createdAt: + $ref: "#/components/schemas/DateTime" + updatedAt: + $ref: "#/components/schemas/DateTime" + title: + type: string + minLength: 1 + maxLength: 10 + published: + type: boolean + publishedAt: + anyOf: + - $ref: "#/components/schemas/DateTime" + - type: "null" + viewCount: + $ref: "#/components/schemas/_integer" + comments: + type: object + properties: + connect: + anyOf: + - $ref: "#/components/schemas/CommentWhereUniqueInput" + - type: array + items: + $ref: "#/components/schemas/CommentWhereUniqueInput" + create: + $ref: "#/components/schemas/CommentCreateDataArrayWithoutpostpostId" + connectOrCreate: + anyOf: + - type: object + properties: + where: + $ref: "#/components/schemas/CommentWhereUniqueInput" + create: + $ref: "#/components/schemas/CommentCreateDataWithoutpostpostId" + required: + - where + - create + additionalProperties: false + - type: array + items: + type: object + properties: + where: + $ref: "#/components/schemas/CommentWhereUniqueInput" + create: + $ref: "#/components/schemas/CommentCreateDataWithoutpostpostId" + required: + - where + - create + additionalProperties: false + createMany: + $ref: "#/components/schemas/CommentCreateManyPayloadWithoutpostpostId" + additionalProperties: false + setting: + anyOf: + - type: object + properties: + connect: + $ref: "#/components/schemas/SettingWhereUniqueInput" + create: + $ref: "#/components/schemas/SettingCreateDataWithoutpostpostId" + connectOrCreate: + type: object + properties: + where: + $ref: "#/components/schemas/SettingWhereUniqueInput" + create: + $ref: "#/components/schemas/SettingCreateDataWithoutpostpostId" + required: + - where + - create + additionalProperties: false + additionalProperties: false + - type: "null" + required: + - title + additionalProperties: false + - type: object + properties: + id: + $ref: "#/components/schemas/_integer" + createdAt: + $ref: "#/components/schemas/DateTime" + updatedAt: + $ref: "#/components/schemas/DateTime" + title: + type: string + minLength: 1 + maxLength: 10 + published: + type: boolean + publishedAt: + anyOf: + - $ref: "#/components/schemas/DateTime" + - type: "null" + viewCount: + $ref: "#/components/schemas/_integer" + comments: + type: object + properties: + connect: + anyOf: + - $ref: "#/components/schemas/CommentWhereUniqueInput" + - type: array + items: + $ref: "#/components/schemas/CommentWhereUniqueInput" + create: + $ref: "#/components/schemas/CommentCreateDataArrayWithoutpostpostId" + connectOrCreate: + anyOf: + - type: object + properties: + where: + $ref: "#/components/schemas/CommentWhereUniqueInput" + create: + $ref: "#/components/schemas/CommentCreateDataWithoutpostpostId" + required: + - where + - create + additionalProperties: false + - type: array + items: + type: object + properties: + where: + $ref: "#/components/schemas/CommentWhereUniqueInput" + create: + $ref: "#/components/schemas/CommentCreateDataWithoutpostpostId" + required: + - where + - create + additionalProperties: false + createMany: + $ref: "#/components/schemas/CommentCreateManyPayloadWithoutpostpostId" + additionalProperties: false + setting: + anyOf: + - type: object + properties: + connect: + $ref: "#/components/schemas/SettingWhereUniqueInput" + create: + $ref: "#/components/schemas/SettingCreateDataWithoutpostpostId" + connectOrCreate: + type: object + properties: + where: + $ref: "#/components/schemas/SettingWhereUniqueInput" + create: + $ref: "#/components/schemas/SettingCreateDataWithoutpostpostId" + required: + - where + - create + additionalProperties: false + additionalProperties: false + - type: "null" + required: + - title + additionalProperties: false + - type: array + items: + type: object + properties: + id: + $ref: "#/components/schemas/_integer" + createdAt: + $ref: "#/components/schemas/DateTime" + updatedAt: + $ref: "#/components/schemas/DateTime" + title: + type: string + minLength: 1 + maxLength: 10 + published: + type: boolean + publishedAt: + anyOf: + - $ref: "#/components/schemas/DateTime" + - type: "null" + viewCount: + $ref: "#/components/schemas/_integer" + comments: + type: object + properties: + connect: + anyOf: + - $ref: "#/components/schemas/CommentWhereUniqueInput" + - type: array + items: + $ref: "#/components/schemas/CommentWhereUniqueInput" + create: + $ref: "#/components/schemas/CommentCreateDataArrayWithoutpostpostId" + connectOrCreate: + anyOf: + - type: object + properties: + where: + $ref: "#/components/schemas/CommentWhereUniqueInput" + create: + $ref: "#/components/schemas/CommentCreateDataWithoutpostpostId" + required: + - where + - create + additionalProperties: false + - type: array + items: + type: object + properties: + where: + $ref: "#/components/schemas/CommentWhereUniqueInput" + create: + $ref: "#/components/schemas/CommentCreateDataWithoutpostpostId" + required: + - where + - create + additionalProperties: false + createMany: + $ref: "#/components/schemas/CommentCreateManyPayloadWithoutpostpostId" + additionalProperties: false + setting: + anyOf: + - type: object + properties: + connect: + $ref: "#/components/schemas/SettingWhereUniqueInput" + create: + $ref: "#/components/schemas/SettingCreateDataWithoutpostpostId" + connectOrCreate: + type: object + properties: + where: + $ref: "#/components/schemas/SettingWhereUniqueInput" + create: + $ref: "#/components/schemas/SettingCreateDataWithoutpostpostId" + required: + - where + - create + additionalProperties: false + additionalProperties: false + - type: "null" + required: + - title + additionalProperties: false + - type: array + items: + type: object + properties: + id: + $ref: "#/components/schemas/_integer" + createdAt: + $ref: "#/components/schemas/DateTime" + updatedAt: + $ref: "#/components/schemas/DateTime" + title: + type: string + minLength: 1 + maxLength: 10 + published: + type: boolean + publishedAt: + anyOf: + - $ref: "#/components/schemas/DateTime" + - type: "null" + viewCount: + $ref: "#/components/schemas/_integer" + comments: + type: object + properties: + connect: + anyOf: + - $ref: "#/components/schemas/CommentWhereUniqueInput" + - type: array + items: + $ref: "#/components/schemas/CommentWhereUniqueInput" + create: + $ref: "#/components/schemas/CommentCreateDataArrayWithoutpostpostId" + connectOrCreate: + anyOf: + - type: object + properties: + where: + $ref: "#/components/schemas/CommentWhereUniqueInput" + create: + $ref: "#/components/schemas/CommentCreateDataWithoutpostpostId" + required: + - where + - create + additionalProperties: false + - type: array + items: + type: object + properties: + where: + $ref: "#/components/schemas/CommentWhereUniqueInput" + create: + $ref: "#/components/schemas/CommentCreateDataWithoutpostpostId" + required: + - where + - create + additionalProperties: false + createMany: + $ref: "#/components/schemas/CommentCreateManyPayloadWithoutpostpostId" + additionalProperties: false + setting: + anyOf: + - type: object + properties: + connect: + $ref: "#/components/schemas/SettingWhereUniqueInput" + create: + $ref: "#/components/schemas/SettingCreateDataWithoutpostpostId" + connectOrCreate: + type: object + properties: + where: + $ref: "#/components/schemas/SettingWhereUniqueInput" + create: + $ref: "#/components/schemas/SettingCreateDataWithoutpostpostId" + required: + - where + - create + additionalProperties: false + additionalProperties: false + - type: "null" + required: + - title + additionalProperties: false + PostCreateDataWithoutauthorauthorId: + anyOf: + - type: object + properties: + id: + $ref: "#/components/schemas/_integer" + createdAt: + $ref: "#/components/schemas/DateTime" + updatedAt: + $ref: "#/components/schemas/DateTime" + title: + type: string + minLength: 1 + maxLength: 10 + published: + type: boolean + publishedAt: + anyOf: + - $ref: "#/components/schemas/DateTime" + - type: "null" + viewCount: + $ref: "#/components/schemas/_integer" + comments: + type: object + properties: + connect: + anyOf: + - $ref: "#/components/schemas/CommentWhereUniqueInput" + - type: array + items: + $ref: "#/components/schemas/CommentWhereUniqueInput" + create: + $ref: "#/components/schemas/CommentCreateDataArrayWithoutpostpostId" + connectOrCreate: + anyOf: + - type: object + properties: + where: + $ref: "#/components/schemas/CommentWhereUniqueInput" + create: + $ref: "#/components/schemas/CommentCreateDataWithoutpostpostId" + required: + - where + - create + additionalProperties: false + - type: array + items: + type: object + properties: + where: + $ref: "#/components/schemas/CommentWhereUniqueInput" + create: + $ref: "#/components/schemas/CommentCreateDataWithoutpostpostId" + required: + - where + - create + additionalProperties: false + createMany: + $ref: "#/components/schemas/CommentCreateManyPayloadWithoutpostpostId" + additionalProperties: false + setting: + anyOf: + - type: object + properties: + connect: + $ref: "#/components/schemas/SettingWhereUniqueInput" + create: + $ref: "#/components/schemas/SettingCreateDataWithoutpostpostId" + connectOrCreate: + type: object + properties: + where: + $ref: "#/components/schemas/SettingWhereUniqueInput" + create: + $ref: "#/components/schemas/SettingCreateDataWithoutpostpostId" + required: + - where + - create + additionalProperties: false + additionalProperties: false + - type: "null" + required: + - title + additionalProperties: false + - type: object + properties: + id: + $ref: "#/components/schemas/_integer" + createdAt: + $ref: "#/components/schemas/DateTime" + updatedAt: + $ref: "#/components/schemas/DateTime" + title: + type: string + minLength: 1 + maxLength: 10 + published: + type: boolean + publishedAt: + anyOf: + - $ref: "#/components/schemas/DateTime" + - type: "null" + viewCount: + $ref: "#/components/schemas/_integer" + comments: + type: object + properties: + connect: + anyOf: + - $ref: "#/components/schemas/CommentWhereUniqueInput" + - type: array + items: + $ref: "#/components/schemas/CommentWhereUniqueInput" + create: + $ref: "#/components/schemas/CommentCreateDataArrayWithoutpostpostId" + connectOrCreate: + anyOf: + - type: object + properties: + where: + $ref: "#/components/schemas/CommentWhereUniqueInput" + create: + $ref: "#/components/schemas/CommentCreateDataWithoutpostpostId" + required: + - where + - create + additionalProperties: false + - type: array + items: + type: object + properties: + where: + $ref: "#/components/schemas/CommentWhereUniqueInput" + create: + $ref: "#/components/schemas/CommentCreateDataWithoutpostpostId" + required: + - where + - create + additionalProperties: false + createMany: + $ref: "#/components/schemas/CommentCreateManyPayloadWithoutpostpostId" + additionalProperties: false + setting: + anyOf: + - type: object + properties: + connect: + $ref: "#/components/schemas/SettingWhereUniqueInput" + create: + $ref: "#/components/schemas/SettingCreateDataWithoutpostpostId" + connectOrCreate: + type: object + properties: + where: + $ref: "#/components/schemas/SettingWhereUniqueInput" + create: + $ref: "#/components/schemas/SettingCreateDataWithoutpostpostId" + required: + - where + - create + additionalProperties: false + additionalProperties: false + - type: "null" + required: + - title + additionalProperties: false + PostCreateDataArrayWithoutRelationWithoutauthorauthorId: + anyOf: + - type: object + properties: + id: + $ref: "#/components/schemas/_integer" + createdAt: + $ref: "#/components/schemas/DateTime" + updatedAt: + $ref: "#/components/schemas/DateTime" + title: + type: string + minLength: 1 + maxLength: 10 + published: + type: boolean + publishedAt: + anyOf: + - $ref: "#/components/schemas/DateTime" + - type: "null" + viewCount: + $ref: "#/components/schemas/_integer" + required: + - title + additionalProperties: false + - type: array + items: + type: object + properties: + id: + $ref: "#/components/schemas/_integer" + createdAt: + $ref: "#/components/schemas/DateTime" + updatedAt: + $ref: "#/components/schemas/DateTime" + title: + type: string + minLength: 1 + maxLength: 10 + published: + type: boolean + publishedAt: + anyOf: + - $ref: "#/components/schemas/DateTime" + - type: "null" + viewCount: + $ref: "#/components/schemas/_integer" + required: + - title + additionalProperties: false + PostCreateManyPayloadWithoutauthorauthorId: + type: object + properties: + data: + $ref: "#/components/schemas/PostCreateDataArrayWithoutRelationWithoutauthorauthorId" + skipDuplicates: + type: boolean + required: + - data + additionalProperties: false + CommentCreateDataArrayWithoutpostpostId: + anyOf: + - type: object + properties: + id: + $ref: "#/components/schemas/_integer" + content: + type: string + required: + - content + additionalProperties: false + - type: array + items: + type: object + properties: + id: + $ref: "#/components/schemas/_integer" + content: + type: string + required: + - content + additionalProperties: false + CommentCreateDataWithoutpostpostId: + type: object + properties: + id: + $ref: "#/components/schemas/_integer" + content: + type: string + required: + - content + additionalProperties: false + CommentCreateDataArrayWithoutRelationWithoutpostpostId: + anyOf: + - type: object + properties: + id: + $ref: "#/components/schemas/_integer" + content: + type: string + required: + - content + additionalProperties: false + - type: array + items: + type: object + properties: + id: + $ref: "#/components/schemas/_integer" + content: + type: string + required: + - content + additionalProperties: false + CommentCreateManyPayloadWithoutpostpostId: + type: object + properties: + data: + $ref: "#/components/schemas/CommentCreateDataArrayWithoutRelationWithoutpostpostId" + skipDuplicates: + type: boolean + required: + - data + additionalProperties: false + SettingCreateDataWithoutpostpostId: + type: object + properties: + id: + $ref: "#/components/schemas/_integer" + boost: + $ref: "#/components/schemas/_integer" + required: + - boost + additionalProperties: false + ProfileCreateDataWithoutuseruserId: + type: object + properties: + id: + $ref: "#/components/schemas/_integer" + gender: + type: string + required: + - gender + additionalProperties: false + PostUpdateDataWithoutauthorauthorId: + anyOf: + - type: object + properties: + id: + anyOf: + - $ref: "#/components/schemas/_integer" + - type: object + properties: + set: + type: number + increment: + type: number + decrement: + type: number + multiply: + type: number + divide: + type: number + additionalProperties: false + createdAt: + $ref: "#/components/schemas/DateTime" + updatedAt: + $ref: "#/components/schemas/DateTime" + title: + type: string + minLength: 1 + maxLength: 10 + published: + type: boolean + publishedAt: + anyOf: + - $ref: "#/components/schemas/DateTime" + - type: "null" + viewCount: + anyOf: + - $ref: "#/components/schemas/_integer" + - type: object + properties: + set: + type: number + increment: + type: number + decrement: + type: number + multiply: + type: number + divide: + type: number + additionalProperties: false + comments: + type: object + properties: + connect: + anyOf: + - $ref: "#/components/schemas/CommentWhereUniqueInput" + - type: array + items: + $ref: "#/components/schemas/CommentWhereUniqueInput" + create: + $ref: "#/components/schemas/CommentCreateDataArrayWithoutpostpostId" + connectOrCreate: + anyOf: + - type: object + properties: + where: + $ref: "#/components/schemas/CommentWhereUniqueInput" + create: + $ref: "#/components/schemas/CommentCreateDataWithoutpostpostId" + required: + - where + - create + additionalProperties: false + - type: array + items: + type: object + properties: + where: + $ref: "#/components/schemas/CommentWhereUniqueInput" + create: + $ref: "#/components/schemas/CommentCreateDataWithoutpostpostId" + required: + - where + - create + additionalProperties: false + createMany: + $ref: "#/components/schemas/CommentCreateManyPayloadWithoutpostpostId" + disconnect: + anyOf: + - $ref: "#/components/schemas/CommentWhereUniqueInput" + - type: array + items: + $ref: "#/components/schemas/CommentWhereUniqueInput" + delete: + anyOf: + - $ref: "#/components/schemas/CommentWhereUniqueInput" + - type: array + items: + $ref: "#/components/schemas/CommentWhereUniqueInput" + update: + anyOf: + - type: object + properties: + where: + $ref: "#/components/schemas/CommentWhereUniqueInput" + data: + $ref: "#/components/schemas/CommentUpdateDataWithoutpostpostId" + required: + - where + - data + additionalProperties: false + - type: array + items: + type: object + properties: + where: + $ref: "#/components/schemas/CommentWhereUniqueInput" + data: + $ref: "#/components/schemas/CommentUpdateDataWithoutpostpostId" + required: + - where + - data + additionalProperties: false + upsert: + anyOf: + - type: object + properties: + where: + $ref: "#/components/schemas/CommentWhereUniqueInput" + create: + $ref: "#/components/schemas/CommentCreateDataWithoutpostpostId" + update: + $ref: "#/components/schemas/CommentUpdateDataWithoutpostpostId" + required: + - where + - create + - update + additionalProperties: false + - type: array + items: + type: object + properties: + where: + $ref: "#/components/schemas/CommentWhereUniqueInput" + create: + $ref: "#/components/schemas/CommentCreateDataWithoutpostpostId" + update: + $ref: "#/components/schemas/CommentUpdateDataWithoutpostpostId" + required: + - where + - create + - update + additionalProperties: false + set: + anyOf: + - $ref: "#/components/schemas/CommentWhereUniqueInput" + - type: array + items: + $ref: "#/components/schemas/CommentWhereUniqueInput" + updateMany: + anyOf: + - type: object + properties: + where: + $ref: "#/components/schemas/CommentWhereInputWithoutRelation" + data: + $ref: "#/components/schemas/CommentUpdateDataWithoutpostpostId" + required: + - where + - data + additionalProperties: false + - type: array + items: + type: object + properties: + where: + $ref: "#/components/schemas/CommentWhereInputWithoutRelation" + data: + $ref: "#/components/schemas/CommentUpdateDataWithoutpostpostId" + required: + - where + - data + additionalProperties: false + deleteMany: + anyOf: + - $ref: "#/components/schemas/CommentWhereInput" + - type: array + items: + $ref: "#/components/schemas/CommentWhereInput" + additionalProperties: false + setting: + anyOf: + - type: object + properties: + connect: + $ref: "#/components/schemas/SettingWhereUniqueInput" + create: + $ref: "#/components/schemas/SettingCreateDataWithoutpostpostId" + connectOrCreate: + type: object + properties: + where: + $ref: "#/components/schemas/SettingWhereUniqueInput" + create: + $ref: "#/components/schemas/SettingCreateDataWithoutpostpostId" + required: + - where + - create + additionalProperties: false + disconnect: + anyOf: + - type: boolean + - $ref: "#/components/schemas/SettingWhereInput" + delete: + anyOf: + - type: boolean + - $ref: "#/components/schemas/SettingWhereUniqueInput" + update: + anyOf: + - type: object + properties: + where: + $ref: "#/components/schemas/SettingWhereInput" + data: + $ref: "#/components/schemas/SettingUpdateDataWithoutpostpostId" + required: + - data + additionalProperties: false + - $ref: "#/components/schemas/SettingUpdateDataWithoutpostpostId" + upsert: + anyOf: + - type: object + properties: + where: + $ref: "#/components/schemas/SettingWhereUniqueInput" + create: + $ref: "#/components/schemas/SettingCreateDataWithoutpostpostId" + update: + $ref: "#/components/schemas/SettingUpdateDataWithoutpostpostId" + required: + - create + - update + additionalProperties: false + - type: array + items: + type: object + properties: + where: + $ref: "#/components/schemas/SettingWhereUniqueInput" + create: + $ref: "#/components/schemas/SettingCreateDataWithoutpostpostId" + update: + $ref: "#/components/schemas/SettingUpdateDataWithoutpostpostId" + required: + - create + - update + additionalProperties: false + additionalProperties: false + - type: "null" + additionalProperties: false + - type: object + properties: + id: + anyOf: + - $ref: "#/components/schemas/_integer" + - type: object + properties: + set: + type: number + increment: + type: number + decrement: + type: number + multiply: + type: number + divide: + type: number + additionalProperties: false + createdAt: + $ref: "#/components/schemas/DateTime" + updatedAt: + $ref: "#/components/schemas/DateTime" + title: + type: string + minLength: 1 + maxLength: 10 + published: + type: boolean + publishedAt: + anyOf: + - $ref: "#/components/schemas/DateTime" + - type: "null" + viewCount: + anyOf: + - $ref: "#/components/schemas/_integer" + - type: object + properties: + set: + type: number + increment: + type: number + decrement: + type: number + multiply: + type: number + divide: + type: number + additionalProperties: false + comments: + type: object + properties: + connect: + anyOf: + - $ref: "#/components/schemas/CommentWhereUniqueInput" + - type: array + items: + $ref: "#/components/schemas/CommentWhereUniqueInput" + create: + $ref: "#/components/schemas/CommentCreateDataArrayWithoutpostpostId" + connectOrCreate: + anyOf: + - type: object + properties: + where: + $ref: "#/components/schemas/CommentWhereUniqueInput" + create: + $ref: "#/components/schemas/CommentCreateDataWithoutpostpostId" + required: + - where + - create + additionalProperties: false + - type: array + items: + type: object + properties: + where: + $ref: "#/components/schemas/CommentWhereUniqueInput" + create: + $ref: "#/components/schemas/CommentCreateDataWithoutpostpostId" + required: + - where + - create + additionalProperties: false + createMany: + $ref: "#/components/schemas/CommentCreateManyPayloadWithoutpostpostId" + disconnect: + anyOf: + - $ref: "#/components/schemas/CommentWhereUniqueInput" + - type: array + items: + $ref: "#/components/schemas/CommentWhereUniqueInput" + delete: + anyOf: + - $ref: "#/components/schemas/CommentWhereUniqueInput" + - type: array + items: + $ref: "#/components/schemas/CommentWhereUniqueInput" + update: + anyOf: + - type: object + properties: + where: + $ref: "#/components/schemas/CommentWhereUniqueInput" + data: + $ref: "#/components/schemas/CommentUpdateDataWithoutpostpostId" + required: + - where + - data + additionalProperties: false + - type: array + items: + type: object + properties: + where: + $ref: "#/components/schemas/CommentWhereUniqueInput" + data: + $ref: "#/components/schemas/CommentUpdateDataWithoutpostpostId" + required: + - where + - data + additionalProperties: false + upsert: + anyOf: + - type: object + properties: + where: + $ref: "#/components/schemas/CommentWhereUniqueInput" + create: + $ref: "#/components/schemas/CommentCreateDataWithoutpostpostId" + update: + $ref: "#/components/schemas/CommentUpdateDataWithoutpostpostId" + required: + - where + - create + - update + additionalProperties: false + - type: array + items: + type: object + properties: + where: + $ref: "#/components/schemas/CommentWhereUniqueInput" + create: + $ref: "#/components/schemas/CommentCreateDataWithoutpostpostId" + update: + $ref: "#/components/schemas/CommentUpdateDataWithoutpostpostId" + required: + - where + - create + - update + additionalProperties: false + set: + anyOf: + - $ref: "#/components/schemas/CommentWhereUniqueInput" + - type: array + items: + $ref: "#/components/schemas/CommentWhereUniqueInput" + updateMany: + anyOf: + - type: object + properties: + where: + $ref: "#/components/schemas/CommentWhereInputWithoutRelation" + data: + $ref: "#/components/schemas/CommentUpdateDataWithoutpostpostId" + required: + - where + - data + additionalProperties: false + - type: array + items: + type: object + properties: + where: + $ref: "#/components/schemas/CommentWhereInputWithoutRelation" + data: + $ref: "#/components/schemas/CommentUpdateDataWithoutpostpostId" + required: + - where + - data + additionalProperties: false + deleteMany: + anyOf: + - $ref: "#/components/schemas/CommentWhereInput" + - type: array + items: + $ref: "#/components/schemas/CommentWhereInput" + additionalProperties: false + setting: + anyOf: + - type: object + properties: + connect: + $ref: "#/components/schemas/SettingWhereUniqueInput" + create: + $ref: "#/components/schemas/SettingCreateDataWithoutpostpostId" + connectOrCreate: + type: object + properties: + where: + $ref: "#/components/schemas/SettingWhereUniqueInput" + create: + $ref: "#/components/schemas/SettingCreateDataWithoutpostpostId" + required: + - where + - create + additionalProperties: false + disconnect: + anyOf: + - type: boolean + - $ref: "#/components/schemas/SettingWhereInput" + delete: + anyOf: + - type: boolean + - $ref: "#/components/schemas/SettingWhereUniqueInput" + update: + anyOf: + - type: object + properties: + where: + $ref: "#/components/schemas/SettingWhereInput" + data: + $ref: "#/components/schemas/SettingUpdateDataWithoutpostpostId" + required: + - data + additionalProperties: false + - $ref: "#/components/schemas/SettingUpdateDataWithoutpostpostId" + upsert: + anyOf: + - type: object + properties: + where: + $ref: "#/components/schemas/SettingWhereUniqueInput" + create: + $ref: "#/components/schemas/SettingCreateDataWithoutpostpostId" + update: + $ref: "#/components/schemas/SettingUpdateDataWithoutpostpostId" + required: + - create + - update + additionalProperties: false + - type: array + items: + type: object + properties: + where: + $ref: "#/components/schemas/SettingWhereUniqueInput" + create: + $ref: "#/components/schemas/SettingCreateDataWithoutpostpostId" + update: + $ref: "#/components/schemas/SettingUpdateDataWithoutpostpostId" + required: + - create + - update + additionalProperties: false + additionalProperties: false + - type: "null" + additionalProperties: false + CommentUpdateDataWithoutpostpostId: + type: object + properties: + id: + anyOf: + - $ref: "#/components/schemas/_integer" + - type: object + properties: + set: + type: number + increment: + type: number + decrement: + type: number + multiply: + type: number + divide: + type: number + additionalProperties: false + content: + type: string + additionalProperties: false + SettingUpdateDataWithoutpostpostId: + type: object + properties: + id: + anyOf: + - $ref: "#/components/schemas/_integer" + - type: object + properties: + set: + type: number + increment: + type: number + decrement: + type: number + multiply: + type: number + divide: + type: number + additionalProperties: false + boost: + anyOf: + - $ref: "#/components/schemas/_integer" + - type: object + properties: + set: + type: number + increment: + type: number + decrement: + type: number + multiply: + type: number + divide: + type: number + additionalProperties: false + additionalProperties: false + ProfileUpdateDataWithoutuseruserId: + type: object + properties: + id: + anyOf: + - $ref: "#/components/schemas/_integer" + - type: object + properties: + set: + type: number + increment: + type: number + decrement: + type: number + multiply: + type: number + divide: + type: number + additionalProperties: false + gender: + type: string + additionalProperties: false + ProfileWhereInputWithoutRelation: + type: object + properties: + id: + $ref: "#/components/schemas/IntFilter" + gender: + $ref: "#/components/schemas/StringFilter" + userId: + $ref: "#/components/schemas/StringFilter" + $expr: {} + AND: + anyOf: + - $ref: "#/components/schemas/ProfileWhereInputWithoutRelation" + - type: array + items: + $ref: "#/components/schemas/ProfileWhereInputWithoutRelation" + OR: + type: array + items: + $ref: "#/components/schemas/ProfileWhereInputWithoutRelation" + NOT: + anyOf: + - $ref: "#/components/schemas/ProfileWhereInputWithoutRelation" + - type: array + items: + $ref: "#/components/schemas/ProfileWhereInputWithoutRelation" + additionalProperties: false + UserCreateDataWithoutprofile: + anyOf: + - type: object + properties: + myId: + type: string + createdAt: + $ref: "#/components/schemas/DateTime" + updatedAt: + $ref: "#/components/schemas/DateTime" + email: + type: string + format: email + pattern: ^(?!\.)(?!.*\.\.)([A-Za-z0-9_'+\-\.]*)[A-Za-z0-9_+-]@([A-Za-z0-9][A-Za-z0-9\-]*\.)+[A-Za-z]{2,}$ + posts: + type: object + properties: + connect: + anyOf: + - $ref: "#/components/schemas/PostWhereUniqueInput" + - type: array + items: + $ref: "#/components/schemas/PostWhereUniqueInput" + create: + $ref: "#/components/schemas/PostCreateDataArrayWithoutauthorauthorId" + connectOrCreate: + anyOf: + - type: object + properties: + where: + $ref: "#/components/schemas/PostWhereUniqueInput" + create: + $ref: "#/components/schemas/PostCreateDataWithoutauthorauthorId" + required: + - where + - create + additionalProperties: false + - type: array + items: + type: object + properties: + where: + $ref: "#/components/schemas/PostWhereUniqueInput" + create: + $ref: "#/components/schemas/PostCreateDataWithoutauthorauthorId" + required: + - where + - create + additionalProperties: false + createMany: + $ref: "#/components/schemas/PostCreateManyPayloadWithoutauthorauthorId" + additionalProperties: false + address: {} + someJson: + anyOf: + - $ref: "#/components/schemas/JsonValue" + - {} + required: + - email + additionalProperties: false + - type: object + properties: + myId: + type: string + createdAt: + $ref: "#/components/schemas/DateTime" + updatedAt: + $ref: "#/components/schemas/DateTime" + email: + type: string + format: email + pattern: ^(?!\.)(?!.*\.\.)([A-Za-z0-9_'+\-\.]*)[A-Za-z0-9_+-]@([A-Za-z0-9][A-Za-z0-9\-]*\.)+[A-Za-z]{2,}$ + posts: + type: object + properties: + connect: + anyOf: + - $ref: "#/components/schemas/PostWhereUniqueInput" + - type: array + items: + $ref: "#/components/schemas/PostWhereUniqueInput" + create: + $ref: "#/components/schemas/PostCreateDataArrayWithoutauthorauthorId" + connectOrCreate: + anyOf: + - type: object + properties: + where: + $ref: "#/components/schemas/PostWhereUniqueInput" + create: + $ref: "#/components/schemas/PostCreateDataWithoutauthorauthorId" + required: + - where + - create + additionalProperties: false + - type: array + items: + type: object + properties: + where: + $ref: "#/components/schemas/PostWhereUniqueInput" + create: + $ref: "#/components/schemas/PostCreateDataWithoutauthorauthorId" + required: + - where + - create + additionalProperties: false + createMany: + $ref: "#/components/schemas/PostCreateManyPayloadWithoutauthorauthorId" + additionalProperties: false + address: {} + someJson: + anyOf: + - $ref: "#/components/schemas/JsonValue" + - {} + required: + - email + additionalProperties: false + UserUpdateDataWithoutprofile: + anyOf: + - type: object + properties: + myId: + type: string + createdAt: + $ref: "#/components/schemas/DateTime" + updatedAt: + $ref: "#/components/schemas/DateTime" + email: + type: string + format: email + pattern: ^(?!\.)(?!.*\.\.)([A-Za-z0-9_'+\-\.]*)[A-Za-z0-9_+-]@([A-Za-z0-9][A-Za-z0-9\-]*\.)+[A-Za-z]{2,}$ + posts: + type: object + properties: + connect: + anyOf: + - $ref: "#/components/schemas/PostWhereUniqueInput" + - type: array + items: + $ref: "#/components/schemas/PostWhereUniqueInput" + create: + $ref: "#/components/schemas/PostCreateDataArrayWithoutauthorauthorId" + connectOrCreate: + anyOf: + - type: object + properties: + where: + $ref: "#/components/schemas/PostWhereUniqueInput" + create: + $ref: "#/components/schemas/PostCreateDataWithoutauthorauthorId" + required: + - where + - create + additionalProperties: false + - type: array + items: + type: object + properties: + where: + $ref: "#/components/schemas/PostWhereUniqueInput" + create: + $ref: "#/components/schemas/PostCreateDataWithoutauthorauthorId" + required: + - where + - create + additionalProperties: false + createMany: + $ref: "#/components/schemas/PostCreateManyPayloadWithoutauthorauthorId" + disconnect: + anyOf: + - $ref: "#/components/schemas/PostWhereUniqueInput" + - type: array + items: + $ref: "#/components/schemas/PostWhereUniqueInput" + delete: + anyOf: + - $ref: "#/components/schemas/PostWhereUniqueInput" + - type: array + items: + $ref: "#/components/schemas/PostWhereUniqueInput" + update: + anyOf: + - type: object + properties: + where: + $ref: "#/components/schemas/PostWhereUniqueInput" + data: + $ref: "#/components/schemas/PostUpdateDataWithoutauthorauthorId" + required: + - where + - data + additionalProperties: false + - type: array + items: + type: object + properties: + where: + $ref: "#/components/schemas/PostWhereUniqueInput" + data: + $ref: "#/components/schemas/PostUpdateDataWithoutauthorauthorId" + required: + - where + - data + additionalProperties: false + upsert: + anyOf: + - type: object + properties: + where: + $ref: "#/components/schemas/PostWhereUniqueInput" + create: + $ref: "#/components/schemas/PostCreateDataWithoutauthorauthorId" + update: + $ref: "#/components/schemas/PostUpdateDataWithoutauthorauthorId" + required: + - where + - create + - update + additionalProperties: false + - type: array + items: + type: object + properties: + where: + $ref: "#/components/schemas/PostWhereUniqueInput" + create: + $ref: "#/components/schemas/PostCreateDataWithoutauthorauthorId" + update: + $ref: "#/components/schemas/PostUpdateDataWithoutauthorauthorId" + required: + - where + - create + - update + additionalProperties: false + set: + anyOf: + - $ref: "#/components/schemas/PostWhereUniqueInput" + - type: array + items: + $ref: "#/components/schemas/PostWhereUniqueInput" + updateMany: + anyOf: + - type: object + properties: + where: + $ref: "#/components/schemas/PostWhereInputWithoutRelation" + data: + $ref: "#/components/schemas/PostUpdateDataWithoutauthorauthorId" + required: + - where + - data + additionalProperties: false + - type: array + items: + type: object + properties: + where: + $ref: "#/components/schemas/PostWhereInputWithoutRelation" + data: + $ref: "#/components/schemas/PostUpdateDataWithoutauthorauthorId" + required: + - where + - data + additionalProperties: false + deleteMany: + anyOf: + - $ref: "#/components/schemas/PostWhereInput" + - type: array + items: + $ref: "#/components/schemas/PostWhereInput" + additionalProperties: false + address: {} + someJson: + anyOf: + - $ref: "#/components/schemas/JsonValue" + - {} + additionalProperties: false + - type: object + properties: + myId: + type: string + createdAt: + $ref: "#/components/schemas/DateTime" + updatedAt: + $ref: "#/components/schemas/DateTime" + email: + type: string + format: email + pattern: ^(?!\.)(?!.*\.\.)([A-Za-z0-9_'+\-\.]*)[A-Za-z0-9_+-]@([A-Za-z0-9][A-Za-z0-9\-]*\.)+[A-Za-z]{2,}$ + posts: + type: object + properties: + connect: + anyOf: + - $ref: "#/components/schemas/PostWhereUniqueInput" + - type: array + items: + $ref: "#/components/schemas/PostWhereUniqueInput" + create: + $ref: "#/components/schemas/PostCreateDataArrayWithoutauthorauthorId" + connectOrCreate: + anyOf: + - type: object + properties: + where: + $ref: "#/components/schemas/PostWhereUniqueInput" + create: + $ref: "#/components/schemas/PostCreateDataWithoutauthorauthorId" + required: + - where + - create + additionalProperties: false + - type: array + items: + type: object + properties: + where: + $ref: "#/components/schemas/PostWhereUniqueInput" + create: + $ref: "#/components/schemas/PostCreateDataWithoutauthorauthorId" + required: + - where + - create + additionalProperties: false + createMany: + $ref: "#/components/schemas/PostCreateManyPayloadWithoutauthorauthorId" + disconnect: + anyOf: + - $ref: "#/components/schemas/PostWhereUniqueInput" + - type: array + items: + $ref: "#/components/schemas/PostWhereUniqueInput" + delete: + anyOf: + - $ref: "#/components/schemas/PostWhereUniqueInput" + - type: array + items: + $ref: "#/components/schemas/PostWhereUniqueInput" + update: + anyOf: + - type: object + properties: + where: + $ref: "#/components/schemas/PostWhereUniqueInput" + data: + $ref: "#/components/schemas/PostUpdateDataWithoutauthorauthorId" + required: + - where + - data + additionalProperties: false + - type: array + items: + type: object + properties: + where: + $ref: "#/components/schemas/PostWhereUniqueInput" + data: + $ref: "#/components/schemas/PostUpdateDataWithoutauthorauthorId" + required: + - where + - data + additionalProperties: false + upsert: + anyOf: + - type: object + properties: + where: + $ref: "#/components/schemas/PostWhereUniqueInput" + create: + $ref: "#/components/schemas/PostCreateDataWithoutauthorauthorId" + update: + $ref: "#/components/schemas/PostUpdateDataWithoutauthorauthorId" + required: + - where + - create + - update + additionalProperties: false + - type: array + items: + type: object + properties: + where: + $ref: "#/components/schemas/PostWhereUniqueInput" + create: + $ref: "#/components/schemas/PostCreateDataWithoutauthorauthorId" + update: + $ref: "#/components/schemas/PostUpdateDataWithoutauthorauthorId" + required: + - where + - create + - update + additionalProperties: false + set: + anyOf: + - $ref: "#/components/schemas/PostWhereUniqueInput" + - type: array + items: + $ref: "#/components/schemas/PostWhereUniqueInput" + updateMany: + anyOf: + - type: object + properties: + where: + $ref: "#/components/schemas/PostWhereInputWithoutRelation" + data: + $ref: "#/components/schemas/PostUpdateDataWithoutauthorauthorId" + required: + - where + - data + additionalProperties: false + - type: array + items: + type: object + properties: + where: + $ref: "#/components/schemas/PostWhereInputWithoutRelation" + data: + $ref: "#/components/schemas/PostUpdateDataWithoutauthorauthorId" + required: + - where + - data + additionalProperties: false + deleteMany: + anyOf: + - $ref: "#/components/schemas/PostWhereInput" + - type: array + items: + $ref: "#/components/schemas/PostWhereInput" + additionalProperties: false + address: {} + someJson: + anyOf: + - $ref: "#/components/schemas/JsonValue" + - {} + additionalProperties: false + UserCreateDataWithoutposts: + anyOf: + - type: object + properties: + myId: + type: string + createdAt: + $ref: "#/components/schemas/DateTime" + updatedAt: + $ref: "#/components/schemas/DateTime" + email: + type: string + format: email + pattern: ^(?!\.)(?!.*\.\.)([A-Za-z0-9_'+\-\.]*)[A-Za-z0-9_+-]@([A-Za-z0-9][A-Za-z0-9\-]*\.)+[A-Za-z]{2,}$ + profile: + anyOf: + - type: object + properties: + connect: + $ref: "#/components/schemas/ProfileWhereUniqueInput" + create: + $ref: "#/components/schemas/ProfileCreateDataWithoutuseruserId" + connectOrCreate: + type: object + properties: + where: + $ref: "#/components/schemas/ProfileWhereUniqueInput" + create: + $ref: "#/components/schemas/ProfileCreateDataWithoutuseruserId" + required: + - where + - create + additionalProperties: false + additionalProperties: false + - type: "null" + address: {} + someJson: + anyOf: + - $ref: "#/components/schemas/JsonValue" + - {} + required: + - email + additionalProperties: false + - type: object + properties: + myId: + type: string + createdAt: + $ref: "#/components/schemas/DateTime" + updatedAt: + $ref: "#/components/schemas/DateTime" + email: + type: string + format: email + pattern: ^(?!\.)(?!.*\.\.)([A-Za-z0-9_'+\-\.]*)[A-Za-z0-9_+-]@([A-Za-z0-9][A-Za-z0-9\-]*\.)+[A-Za-z]{2,}$ + profile: + anyOf: + - type: object + properties: + connect: + $ref: "#/components/schemas/ProfileWhereUniqueInput" + create: + $ref: "#/components/schemas/ProfileCreateDataWithoutuseruserId" + connectOrCreate: + type: object + properties: + where: + $ref: "#/components/schemas/ProfileWhereUniqueInput" + create: + $ref: "#/components/schemas/ProfileCreateDataWithoutuseruserId" + required: + - where + - create + additionalProperties: false + additionalProperties: false + - type: "null" + address: {} + someJson: + anyOf: + - $ref: "#/components/schemas/JsonValue" + - {} + required: + - email + additionalProperties: false + UserUpdateDataWithoutposts: + anyOf: + - type: object + properties: + myId: + type: string + createdAt: + $ref: "#/components/schemas/DateTime" + updatedAt: + $ref: "#/components/schemas/DateTime" + email: + type: string + format: email + pattern: ^(?!\.)(?!.*\.\.)([A-Za-z0-9_'+\-\.]*)[A-Za-z0-9_+-]@([A-Za-z0-9][A-Za-z0-9\-]*\.)+[A-Za-z]{2,}$ + profile: + anyOf: + - type: object + properties: + connect: + $ref: "#/components/schemas/ProfileWhereUniqueInput" + create: + $ref: "#/components/schemas/ProfileCreateDataWithoutuseruserId" + connectOrCreate: + type: object + properties: + where: + $ref: "#/components/schemas/ProfileWhereUniqueInput" + create: + $ref: "#/components/schemas/ProfileCreateDataWithoutuseruserId" + required: + - where + - create + additionalProperties: false + disconnect: + anyOf: + - type: boolean + - $ref: "#/components/schemas/ProfileWhereInput" + delete: + anyOf: + - type: boolean + - $ref: "#/components/schemas/ProfileWhereUniqueInput" + update: + anyOf: + - type: object + properties: + where: + $ref: "#/components/schemas/ProfileWhereInput" + data: + $ref: "#/components/schemas/ProfileUpdateDataWithoutuseruserId" + required: + - data + additionalProperties: false + - $ref: "#/components/schemas/ProfileUpdateDataWithoutuseruserId" + upsert: + anyOf: + - type: object + properties: + where: + $ref: "#/components/schemas/ProfileWhereUniqueInput" + create: + $ref: "#/components/schemas/ProfileCreateDataWithoutuseruserId" + update: + $ref: "#/components/schemas/ProfileUpdateDataWithoutuseruserId" + required: + - create + - update + additionalProperties: false + - type: array + items: + type: object + properties: + where: + $ref: "#/components/schemas/ProfileWhereUniqueInput" + create: + $ref: "#/components/schemas/ProfileCreateDataWithoutuseruserId" + update: + $ref: "#/components/schemas/ProfileUpdateDataWithoutuseruserId" + required: + - create + - update + additionalProperties: false + additionalProperties: false + - type: "null" + address: {} + someJson: + anyOf: + - $ref: "#/components/schemas/JsonValue" + - {} + additionalProperties: false + - type: object + properties: + myId: + type: string + createdAt: + $ref: "#/components/schemas/DateTime" + updatedAt: + $ref: "#/components/schemas/DateTime" + email: + type: string + format: email + pattern: ^(?!\.)(?!.*\.\.)([A-Za-z0-9_'+\-\.]*)[A-Za-z0-9_+-]@([A-Za-z0-9][A-Za-z0-9\-]*\.)+[A-Za-z]{2,}$ + profile: + anyOf: + - type: object + properties: + connect: + $ref: "#/components/schemas/ProfileWhereUniqueInput" + create: + $ref: "#/components/schemas/ProfileCreateDataWithoutuseruserId" + connectOrCreate: + type: object + properties: + where: + $ref: "#/components/schemas/ProfileWhereUniqueInput" + create: + $ref: "#/components/schemas/ProfileCreateDataWithoutuseruserId" + required: + - where + - create + additionalProperties: false + disconnect: + anyOf: + - type: boolean + - $ref: "#/components/schemas/ProfileWhereInput" + delete: + anyOf: + - type: boolean + - $ref: "#/components/schemas/ProfileWhereUniqueInput" + update: + anyOf: + - type: object + properties: + where: + $ref: "#/components/schemas/ProfileWhereInput" + data: + $ref: "#/components/schemas/ProfileUpdateDataWithoutuseruserId" + required: + - data + additionalProperties: false + - $ref: "#/components/schemas/ProfileUpdateDataWithoutuseruserId" + upsert: + anyOf: + - type: object + properties: + where: + $ref: "#/components/schemas/ProfileWhereUniqueInput" + create: + $ref: "#/components/schemas/ProfileCreateDataWithoutuseruserId" + update: + $ref: "#/components/schemas/ProfileUpdateDataWithoutuseruserId" + required: + - create + - update + additionalProperties: false + - type: array + items: + type: object + properties: + where: + $ref: "#/components/schemas/ProfileWhereUniqueInput" + create: + $ref: "#/components/schemas/ProfileCreateDataWithoutuseruserId" + update: + $ref: "#/components/schemas/ProfileUpdateDataWithoutuseruserId" + required: + - create + - update + additionalProperties: false + additionalProperties: false + - type: "null" + address: {} + someJson: + anyOf: + - $ref: "#/components/schemas/JsonValue" + - {} + additionalProperties: false + PostCreateDataWithoutcomments: + anyOf: + - type: object + properties: + id: + $ref: "#/components/schemas/_integer" + createdAt: + $ref: "#/components/schemas/DateTime" + updatedAt: + $ref: "#/components/schemas/DateTime" + title: + type: string + minLength: 1 + maxLength: 10 + authorId: + anyOf: + - type: string + - type: "null" + published: + type: boolean + publishedAt: + anyOf: + - $ref: "#/components/schemas/DateTime" + - type: "null" + viewCount: + $ref: "#/components/schemas/_integer" + setting: + anyOf: + - type: object + properties: + connect: + $ref: "#/components/schemas/SettingWhereUniqueInput" + create: + $ref: "#/components/schemas/SettingCreateDataWithoutpostpostId" + connectOrCreate: + type: object + properties: + where: + $ref: "#/components/schemas/SettingWhereUniqueInput" + create: + $ref: "#/components/schemas/SettingCreateDataWithoutpostpostId" + required: + - where + - create + additionalProperties: false + additionalProperties: false + - type: "null" + required: + - title + additionalProperties: false + - type: object + properties: + id: + $ref: "#/components/schemas/_integer" + createdAt: + $ref: "#/components/schemas/DateTime" + updatedAt: + $ref: "#/components/schemas/DateTime" + title: + type: string + minLength: 1 + maxLength: 10 + author: + anyOf: + - type: object + properties: + connect: + $ref: "#/components/schemas/UserWhereUniqueInput" + create: + $ref: "#/components/schemas/UserCreateDataWithoutposts" + connectOrCreate: + type: object + properties: + where: + $ref: "#/components/schemas/UserWhereUniqueInput" + create: + $ref: "#/components/schemas/UserCreateDataWithoutposts" + required: + - where + - create + additionalProperties: false + additionalProperties: false + - type: "null" + published: + type: boolean + publishedAt: + anyOf: + - $ref: "#/components/schemas/DateTime" + - type: "null" + viewCount: + $ref: "#/components/schemas/_integer" + setting: + anyOf: + - type: object + properties: + connect: + $ref: "#/components/schemas/SettingWhereUniqueInput" + create: + $ref: "#/components/schemas/SettingCreateDataWithoutpostpostId" + connectOrCreate: + type: object + properties: + where: + $ref: "#/components/schemas/SettingWhereUniqueInput" + create: + $ref: "#/components/schemas/SettingCreateDataWithoutpostpostId" + required: + - where + - create + additionalProperties: false + additionalProperties: false + - type: "null" + required: + - title + additionalProperties: false + PostUpdateDataWithoutcomments: + anyOf: + - type: object + properties: + id: + anyOf: + - $ref: "#/components/schemas/_integer" + - type: object + properties: + set: + type: number + increment: + type: number + decrement: + type: number + multiply: + type: number + divide: + type: number + additionalProperties: false + createdAt: + $ref: "#/components/schemas/DateTime" + updatedAt: + $ref: "#/components/schemas/DateTime" + title: + type: string + minLength: 1 + maxLength: 10 + authorId: + anyOf: + - type: string + - type: "null" + published: + type: boolean + publishedAt: + anyOf: + - $ref: "#/components/schemas/DateTime" + - type: "null" + viewCount: + anyOf: + - $ref: "#/components/schemas/_integer" + - type: object + properties: + set: + type: number + increment: + type: number + decrement: + type: number + multiply: + type: number + divide: + type: number + additionalProperties: false + setting: + anyOf: + - type: object + properties: + connect: + $ref: "#/components/schemas/SettingWhereUniqueInput" + create: + $ref: "#/components/schemas/SettingCreateDataWithoutpostpostId" + connectOrCreate: + type: object + properties: + where: + $ref: "#/components/schemas/SettingWhereUniqueInput" + create: + $ref: "#/components/schemas/SettingCreateDataWithoutpostpostId" + required: + - where + - create + additionalProperties: false + disconnect: + anyOf: + - type: boolean + - $ref: "#/components/schemas/SettingWhereInput" + delete: + anyOf: + - type: boolean + - $ref: "#/components/schemas/SettingWhereUniqueInput" + update: + anyOf: + - type: object + properties: + where: + $ref: "#/components/schemas/SettingWhereInput" + data: + $ref: "#/components/schemas/SettingUpdateDataWithoutpostpostId" + required: + - data + additionalProperties: false + - $ref: "#/components/schemas/SettingUpdateDataWithoutpostpostId" + upsert: + anyOf: + - type: object + properties: + where: + $ref: "#/components/schemas/SettingWhereUniqueInput" + create: + $ref: "#/components/schemas/SettingCreateDataWithoutpostpostId" + update: + $ref: "#/components/schemas/SettingUpdateDataWithoutpostpostId" + required: + - create + - update + additionalProperties: false + - type: array + items: + type: object + properties: + where: + $ref: "#/components/schemas/SettingWhereUniqueInput" + create: + $ref: "#/components/schemas/SettingCreateDataWithoutpostpostId" + update: + $ref: "#/components/schemas/SettingUpdateDataWithoutpostpostId" + required: + - create + - update + additionalProperties: false + additionalProperties: false + - type: "null" + additionalProperties: false + - type: object + properties: + id: + anyOf: + - $ref: "#/components/schemas/_integer" + - type: object + properties: + set: + type: number + increment: + type: number + decrement: + type: number + multiply: + type: number + divide: + type: number + additionalProperties: false + createdAt: + $ref: "#/components/schemas/DateTime" + updatedAt: + $ref: "#/components/schemas/DateTime" + title: + type: string + minLength: 1 + maxLength: 10 + author: + anyOf: + - type: object + properties: + connect: + $ref: "#/components/schemas/UserWhereUniqueInput" + create: + $ref: "#/components/schemas/UserCreateDataWithoutposts" + connectOrCreate: + type: object + properties: + where: + $ref: "#/components/schemas/UserWhereUniqueInput" + create: + $ref: "#/components/schemas/UserCreateDataWithoutposts" + required: + - where + - create + additionalProperties: false + disconnect: + anyOf: + - type: boolean + - $ref: "#/components/schemas/UserWhereInput" + delete: + anyOf: + - type: boolean + - $ref: "#/components/schemas/UserWhereUniqueInput" + update: + anyOf: + - type: object + properties: + where: + $ref: "#/components/schemas/UserWhereInput" + data: + $ref: "#/components/schemas/UserUpdateDataWithoutposts" + required: + - data + additionalProperties: false + - $ref: "#/components/schemas/UserUpdateDataWithoutposts" + upsert: + anyOf: + - type: object + properties: + where: + $ref: "#/components/schemas/UserWhereUniqueInput" + create: + $ref: "#/components/schemas/UserCreateDataWithoutposts" + update: + $ref: "#/components/schemas/UserUpdateDataWithoutposts" + required: + - create + - update + additionalProperties: false + - type: array + items: + type: object + properties: + where: + $ref: "#/components/schemas/UserWhereUniqueInput" + create: + $ref: "#/components/schemas/UserCreateDataWithoutposts" + update: + $ref: "#/components/schemas/UserUpdateDataWithoutposts" + required: + - create + - update + additionalProperties: false + additionalProperties: false + - type: "null" + published: + type: boolean + publishedAt: + anyOf: + - $ref: "#/components/schemas/DateTime" + - type: "null" + viewCount: + anyOf: + - $ref: "#/components/schemas/_integer" + - type: object + properties: + set: + type: number + increment: + type: number + decrement: + type: number + multiply: + type: number + divide: + type: number + additionalProperties: false + setting: + anyOf: + - type: object + properties: + connect: + $ref: "#/components/schemas/SettingWhereUniqueInput" + create: + $ref: "#/components/schemas/SettingCreateDataWithoutpostpostId" + connectOrCreate: + type: object + properties: + where: + $ref: "#/components/schemas/SettingWhereUniqueInput" + create: + $ref: "#/components/schemas/SettingCreateDataWithoutpostpostId" + required: + - where + - create + additionalProperties: false + disconnect: + anyOf: + - type: boolean + - $ref: "#/components/schemas/SettingWhereInput" + delete: + anyOf: + - type: boolean + - $ref: "#/components/schemas/SettingWhereUniqueInput" + update: + anyOf: + - type: object + properties: + where: + $ref: "#/components/schemas/SettingWhereInput" + data: + $ref: "#/components/schemas/SettingUpdateDataWithoutpostpostId" + required: + - data + additionalProperties: false + - $ref: "#/components/schemas/SettingUpdateDataWithoutpostpostId" + upsert: + anyOf: + - type: object + properties: + where: + $ref: "#/components/schemas/SettingWhereUniqueInput" + create: + $ref: "#/components/schemas/SettingCreateDataWithoutpostpostId" + update: + $ref: "#/components/schemas/SettingUpdateDataWithoutpostpostId" + required: + - create + - update + additionalProperties: false + - type: array + items: + type: object + properties: + where: + $ref: "#/components/schemas/SettingWhereUniqueInput" + create: + $ref: "#/components/schemas/SettingCreateDataWithoutpostpostId" + update: + $ref: "#/components/schemas/SettingUpdateDataWithoutpostpostId" + required: + - create + - update + additionalProperties: false + additionalProperties: false + - type: "null" + additionalProperties: false + SettingWhereInputWithoutRelation: + type: object + properties: + id: + $ref: "#/components/schemas/IntFilter" + boost: + $ref: "#/components/schemas/IntFilter" + postId: + $ref: "#/components/schemas/IntFilter" + $expr: {} + AND: + anyOf: + - $ref: "#/components/schemas/SettingWhereInputWithoutRelation" + - type: array + items: + $ref: "#/components/schemas/SettingWhereInputWithoutRelation" + OR: + type: array + items: + $ref: "#/components/schemas/SettingWhereInputWithoutRelation" + NOT: + anyOf: + - $ref: "#/components/schemas/SettingWhereInputWithoutRelation" + - type: array + items: + $ref: "#/components/schemas/SettingWhereInputWithoutRelation" + additionalProperties: false + PostCreateDataWithoutsetting: + anyOf: + - type: object + properties: + id: + $ref: "#/components/schemas/_integer" + createdAt: + $ref: "#/components/schemas/DateTime" + updatedAt: + $ref: "#/components/schemas/DateTime" + title: + type: string + minLength: 1 + maxLength: 10 + authorId: + anyOf: + - type: string + - type: "null" + published: + type: boolean + publishedAt: + anyOf: + - $ref: "#/components/schemas/DateTime" + - type: "null" + viewCount: + $ref: "#/components/schemas/_integer" + comments: + type: object + properties: + connect: + anyOf: + - $ref: "#/components/schemas/CommentWhereUniqueInput" + - type: array + items: + $ref: "#/components/schemas/CommentWhereUniqueInput" + create: + $ref: "#/components/schemas/CommentCreateDataArrayWithoutpostpostId" + connectOrCreate: + anyOf: + - type: object + properties: + where: + $ref: "#/components/schemas/CommentWhereUniqueInput" + create: + $ref: "#/components/schemas/CommentCreateDataWithoutpostpostId" + required: + - where + - create + additionalProperties: false + - type: array + items: + type: object + properties: + where: + $ref: "#/components/schemas/CommentWhereUniqueInput" + create: + $ref: "#/components/schemas/CommentCreateDataWithoutpostpostId" + required: + - where + - create + additionalProperties: false + createMany: + $ref: "#/components/schemas/CommentCreateManyPayloadWithoutpostpostId" + additionalProperties: false + required: + - title + additionalProperties: false + - type: object + properties: + id: + $ref: "#/components/schemas/_integer" + createdAt: + $ref: "#/components/schemas/DateTime" + updatedAt: + $ref: "#/components/schemas/DateTime" + title: + type: string + minLength: 1 + maxLength: 10 + author: + anyOf: + - type: object + properties: + connect: + $ref: "#/components/schemas/UserWhereUniqueInput" + create: + $ref: "#/components/schemas/UserCreateDataWithoutposts" + connectOrCreate: + type: object + properties: + where: + $ref: "#/components/schemas/UserWhereUniqueInput" + create: + $ref: "#/components/schemas/UserCreateDataWithoutposts" + required: + - where + - create + additionalProperties: false + additionalProperties: false + - type: "null" + published: + type: boolean + publishedAt: + anyOf: + - $ref: "#/components/schemas/DateTime" + - type: "null" + viewCount: + $ref: "#/components/schemas/_integer" + comments: + type: object + properties: + connect: + anyOf: + - $ref: "#/components/schemas/CommentWhereUniqueInput" + - type: array + items: + $ref: "#/components/schemas/CommentWhereUniqueInput" + create: + $ref: "#/components/schemas/CommentCreateDataArrayWithoutpostpostId" + connectOrCreate: + anyOf: + - type: object + properties: + where: + $ref: "#/components/schemas/CommentWhereUniqueInput" + create: + $ref: "#/components/schemas/CommentCreateDataWithoutpostpostId" + required: + - where + - create + additionalProperties: false + - type: array + items: + type: object + properties: + where: + $ref: "#/components/schemas/CommentWhereUniqueInput" + create: + $ref: "#/components/schemas/CommentCreateDataWithoutpostpostId" + required: + - where + - create + additionalProperties: false + createMany: + $ref: "#/components/schemas/CommentCreateManyPayloadWithoutpostpostId" + additionalProperties: false + required: + - title + additionalProperties: false + PostUpdateDataWithoutsetting: + anyOf: + - type: object + properties: + id: + anyOf: + - $ref: "#/components/schemas/_integer" + - type: object + properties: + set: + type: number + increment: + type: number + decrement: + type: number + multiply: + type: number + divide: + type: number + additionalProperties: false + createdAt: + $ref: "#/components/schemas/DateTime" + updatedAt: + $ref: "#/components/schemas/DateTime" + title: + type: string + minLength: 1 + maxLength: 10 + authorId: + anyOf: + - type: string + - type: "null" + published: + type: boolean + publishedAt: + anyOf: + - $ref: "#/components/schemas/DateTime" + - type: "null" + viewCount: + anyOf: + - $ref: "#/components/schemas/_integer" + - type: object + properties: + set: + type: number + increment: + type: number + decrement: + type: number + multiply: + type: number + divide: + type: number + additionalProperties: false + comments: + type: object + properties: + connect: + anyOf: + - $ref: "#/components/schemas/CommentWhereUniqueInput" + - type: array + items: + $ref: "#/components/schemas/CommentWhereUniqueInput" + create: + $ref: "#/components/schemas/CommentCreateDataArrayWithoutpostpostId" + connectOrCreate: + anyOf: + - type: object + properties: + where: + $ref: "#/components/schemas/CommentWhereUniqueInput" + create: + $ref: "#/components/schemas/CommentCreateDataWithoutpostpostId" + required: + - where + - create + additionalProperties: false + - type: array + items: + type: object + properties: + where: + $ref: "#/components/schemas/CommentWhereUniqueInput" + create: + $ref: "#/components/schemas/CommentCreateDataWithoutpostpostId" + required: + - where + - create + additionalProperties: false + createMany: + $ref: "#/components/schemas/CommentCreateManyPayloadWithoutpostpostId" + disconnect: + anyOf: + - $ref: "#/components/schemas/CommentWhereUniqueInput" + - type: array + items: + $ref: "#/components/schemas/CommentWhereUniqueInput" + delete: + anyOf: + - $ref: "#/components/schemas/CommentWhereUniqueInput" + - type: array + items: + $ref: "#/components/schemas/CommentWhereUniqueInput" + update: + anyOf: + - type: object + properties: + where: + $ref: "#/components/schemas/CommentWhereUniqueInput" + data: + $ref: "#/components/schemas/CommentUpdateDataWithoutpostpostId" + required: + - where + - data + additionalProperties: false + - type: array + items: + type: object + properties: + where: + $ref: "#/components/schemas/CommentWhereUniqueInput" + data: + $ref: "#/components/schemas/CommentUpdateDataWithoutpostpostId" + required: + - where + - data + additionalProperties: false + upsert: + anyOf: + - type: object + properties: + where: + $ref: "#/components/schemas/CommentWhereUniqueInput" + create: + $ref: "#/components/schemas/CommentCreateDataWithoutpostpostId" + update: + $ref: "#/components/schemas/CommentUpdateDataWithoutpostpostId" + required: + - where + - create + - update + additionalProperties: false + - type: array + items: + type: object + properties: + where: + $ref: "#/components/schemas/CommentWhereUniqueInput" + create: + $ref: "#/components/schemas/CommentCreateDataWithoutpostpostId" + update: + $ref: "#/components/schemas/CommentUpdateDataWithoutpostpostId" + required: + - where + - create + - update + additionalProperties: false + set: + anyOf: + - $ref: "#/components/schemas/CommentWhereUniqueInput" + - type: array + items: + $ref: "#/components/schemas/CommentWhereUniqueInput" + updateMany: + anyOf: + - type: object + properties: + where: + $ref: "#/components/schemas/CommentWhereInputWithoutRelation" + data: + $ref: "#/components/schemas/CommentUpdateDataWithoutpostpostId" + required: + - where + - data + additionalProperties: false + - type: array + items: + type: object + properties: + where: + $ref: "#/components/schemas/CommentWhereInputWithoutRelation" + data: + $ref: "#/components/schemas/CommentUpdateDataWithoutpostpostId" + required: + - where + - data + additionalProperties: false + deleteMany: + anyOf: + - $ref: "#/components/schemas/CommentWhereInput" + - type: array + items: + $ref: "#/components/schemas/CommentWhereInput" + additionalProperties: false + additionalProperties: false + - type: object + properties: + id: + anyOf: + - $ref: "#/components/schemas/_integer" + - type: object + properties: + set: + type: number + increment: + type: number + decrement: + type: number + multiply: + type: number + divide: + type: number + additionalProperties: false + createdAt: + $ref: "#/components/schemas/DateTime" + updatedAt: + $ref: "#/components/schemas/DateTime" + title: + type: string + minLength: 1 + maxLength: 10 + author: + anyOf: + - type: object + properties: + connect: + $ref: "#/components/schemas/UserWhereUniqueInput" + create: + $ref: "#/components/schemas/UserCreateDataWithoutposts" + connectOrCreate: + type: object + properties: + where: + $ref: "#/components/schemas/UserWhereUniqueInput" + create: + $ref: "#/components/schemas/UserCreateDataWithoutposts" + required: + - where + - create + additionalProperties: false + disconnect: + anyOf: + - type: boolean + - $ref: "#/components/schemas/UserWhereInput" + delete: + anyOf: + - type: boolean + - $ref: "#/components/schemas/UserWhereUniqueInput" + update: + anyOf: + - type: object + properties: + where: + $ref: "#/components/schemas/UserWhereInput" + data: + $ref: "#/components/schemas/UserUpdateDataWithoutposts" + required: + - data + additionalProperties: false + - $ref: "#/components/schemas/UserUpdateDataWithoutposts" + upsert: + anyOf: + - type: object + properties: + where: + $ref: "#/components/schemas/UserWhereUniqueInput" + create: + $ref: "#/components/schemas/UserCreateDataWithoutposts" + update: + $ref: "#/components/schemas/UserUpdateDataWithoutposts" + required: + - create + - update + additionalProperties: false + - type: array + items: + type: object + properties: + where: + $ref: "#/components/schemas/UserWhereUniqueInput" + create: + $ref: "#/components/schemas/UserCreateDataWithoutposts" + update: + $ref: "#/components/schemas/UserUpdateDataWithoutposts" + required: + - create + - update + additionalProperties: false + additionalProperties: false + - type: "null" + published: + type: boolean + publishedAt: + anyOf: + - $ref: "#/components/schemas/DateTime" + - type: "null" + viewCount: + anyOf: + - $ref: "#/components/schemas/_integer" + - type: object + properties: + set: + type: number + increment: + type: number + decrement: + type: number + multiply: + type: number + divide: + type: number + additionalProperties: false + comments: + type: object + properties: + connect: + anyOf: + - $ref: "#/components/schemas/CommentWhereUniqueInput" + - type: array + items: + $ref: "#/components/schemas/CommentWhereUniqueInput" + create: + $ref: "#/components/schemas/CommentCreateDataArrayWithoutpostpostId" + connectOrCreate: + anyOf: + - type: object + properties: + where: + $ref: "#/components/schemas/CommentWhereUniqueInput" + create: + $ref: "#/components/schemas/CommentCreateDataWithoutpostpostId" + required: + - where + - create + additionalProperties: false + - type: array + items: + type: object + properties: + where: + $ref: "#/components/schemas/CommentWhereUniqueInput" + create: + $ref: "#/components/schemas/CommentCreateDataWithoutpostpostId" + required: + - where + - create + additionalProperties: false + createMany: + $ref: "#/components/schemas/CommentCreateManyPayloadWithoutpostpostId" + disconnect: + anyOf: + - $ref: "#/components/schemas/CommentWhereUniqueInput" + - type: array + items: + $ref: "#/components/schemas/CommentWhereUniqueInput" + delete: + anyOf: + - $ref: "#/components/schemas/CommentWhereUniqueInput" + - type: array + items: + $ref: "#/components/schemas/CommentWhereUniqueInput" + update: + anyOf: + - type: object + properties: + where: + $ref: "#/components/schemas/CommentWhereUniqueInput" + data: + $ref: "#/components/schemas/CommentUpdateDataWithoutpostpostId" + required: + - where + - data + additionalProperties: false + - type: array + items: + type: object + properties: + where: + $ref: "#/components/schemas/CommentWhereUniqueInput" + data: + $ref: "#/components/schemas/CommentUpdateDataWithoutpostpostId" + required: + - where + - data + additionalProperties: false + upsert: + anyOf: + - type: object + properties: + where: + $ref: "#/components/schemas/CommentWhereUniqueInput" + create: + $ref: "#/components/schemas/CommentCreateDataWithoutpostpostId" + update: + $ref: "#/components/schemas/CommentUpdateDataWithoutpostpostId" + required: + - where + - create + - update + additionalProperties: false + - type: array + items: + type: object + properties: + where: + $ref: "#/components/schemas/CommentWhereUniqueInput" + create: + $ref: "#/components/schemas/CommentCreateDataWithoutpostpostId" + update: + $ref: "#/components/schemas/CommentUpdateDataWithoutpostpostId" + required: + - where + - create + - update + additionalProperties: false + set: + anyOf: + - $ref: "#/components/schemas/CommentWhereUniqueInput" + - type: array + items: + $ref: "#/components/schemas/CommentWhereUniqueInput" + updateMany: + anyOf: + - type: object + properties: + where: + $ref: "#/components/schemas/CommentWhereInputWithoutRelation" + data: + $ref: "#/components/schemas/CommentUpdateDataWithoutpostpostId" + required: + - where + - data + additionalProperties: false + - type: array + items: + type: object + properties: + where: + $ref: "#/components/schemas/CommentWhereInputWithoutRelation" + data: + $ref: "#/components/schemas/CommentUpdateDataWithoutpostpostId" + required: + - where + - data + additionalProperties: false + deleteMany: + anyOf: + - $ref: "#/components/schemas/CommentWhereInput" + - type: array + items: + $ref: "#/components/schemas/CommentWhereInput" + additionalProperties: false + additionalProperties: false + User: + type: object + properties: + myId: + type: string + createdAt: + type: string + format: date-time + updatedAt: + type: string + format: date-time + email: + type: string + posts: + type: array + items: + $ref: "#/components/schemas/Post" + profile: + anyOf: + - $ref: "#/components/schemas/Profile" + - type: "null" + address: + anyOf: + - $ref: "#/components/schemas/Address" + - type: "null" + someJson: + anyOf: + - {} + - type: "null" + required: + - myId + - createdAt + - updatedAt + - email + - address + - someJson + Profile: + type: object + properties: + id: + type: integer + gender: + type: string + user: + $ref: "#/components/schemas/User" + userId: + type: string + required: + - id + - gender + - userId + Post: + type: object + properties: + id: + type: integer + createdAt: + type: string + format: date-time + updatedAt: + type: string + format: date-time + title: + type: string + author: + anyOf: + - $ref: "#/components/schemas/User" + - type: "null" + authorId: + anyOf: + - type: string + - type: "null" + published: + type: boolean + publishedAt: + anyOf: + - type: string + format: date-time + - type: "null" + viewCount: + type: integer + comments: + type: array + items: + $ref: "#/components/schemas/Comment" + setting: + anyOf: + - $ref: "#/components/schemas/Setting" + - type: "null" + required: + - id + - createdAt + - updatedAt + - title + - authorId + - published + - publishedAt + - viewCount + Comment: + type: object + properties: + id: + type: integer + post: + $ref: "#/components/schemas/Post" + postId: + type: integer + content: + type: string + required: + - id + - postId + - content + Setting: + type: object + properties: + id: + type: integer + boost: + type: integer + post: + $ref: "#/components/schemas/Post" + postId: + type: integer + required: + - id + - boost + - postId + _integer: + type: integer + minimum: -9007199254740991 + maximum: 9007199254740991 + _nonNegativeInteger: + type: integer + minimum: 0 + maximum: 9007199254740991 + _rpcSuccessResponse: + type: object + properties: + data: {} + meta: + type: object + properties: + serialization: {} + _rpcErrorResponse: + type: object + properties: + error: + type: object + properties: + message: + type: string + reason: + type: string + model: + type: string + rejectedByPolicy: + type: boolean + rejectedByValidation: + type: boolean + rejectReason: + type: string + dbErrorCode: + type: string + required: + - message + required: + - error + _rpcTransactionRequest: + type: array + items: + type: object + properties: + model: + type: string + op: + type: string + enum: + - findMany + - findUnique + - findFirst + - create + - createMany + - createManyAndReturn + - update + - updateMany + - updateManyAndReturn + - upsert + - delete + - deleteMany + - count + - aggregate + - groupBy + - exists + args: + type: object + required: + - model + - op diff --git a/packages/server/test/openapi/rest-openapi.test.ts b/packages/server/test/openapi/rest-openapi.test.ts index 8f6f3fa69..597c9ff62 100644 --- a/packages/server/test/openapi/rest-openapi.test.ts +++ b/packages/server/test/openapi/rest-openapi.test.ts @@ -13,7 +13,10 @@ function loadBaseline(name: string) { } function saveBaseline(name: string, spec: any) { - fs.writeFileSync(path.join(__dirname, 'baseline', name), YAML.stringify(spec, { lineWidth: 0, indent: 4, aliasDuplicateObjects: false })); + fs.writeFileSync( + path.join(__dirname, 'baseline', name), + YAML.stringify(spec, { lineWidth: 0, indent: 4, aliasDuplicateObjects: false }), + ); } const schema = ` diff --git a/packages/server/test/openapi/rpc-openapi.test.ts b/packages/server/test/openapi/rpc-openapi.test.ts new file mode 100644 index 000000000..64d4b1ca4 --- /dev/null +++ b/packages/server/test/openapi/rpc-openapi.test.ts @@ -0,0 +1,1149 @@ +import { validate } from '@readme/openapi-parser'; +import { createTestClient } from '@zenstackhq/testtools'; +import fs from 'fs'; +import path from 'path'; +import { beforeAll, describe, expect, it } from 'vitest'; +import YAML from 'yaml'; +import { RPCApiHandler } from '../../src/api/rpc'; + +const UPDATE_BASELINE = process.env.UPDATE_BASELINE === '1'; + +async function generateSpec(handler: RPCApiHandler, options?: Parameters[0]) { + const spec = await handler.generateSpec(options); + await validate(JSON.parse(JSON.stringify(spec))); + return spec; +} + +function loadBaseline(name: string) { + return YAML.parse(fs.readFileSync(path.join(__dirname, 'baseline', name), 'utf-8'), { maxAliasCount: 10000 }); +} + +function saveBaseline(name: string, spec: any) { + fs.writeFileSync( + path.join(__dirname, 'baseline', name), + YAML.stringify(spec, { lineWidth: 0, indent: 4, aliasDuplicateObjects: false }), + ); +} + +// Shared schema used across most test suites +const schema = ` +type Address { + city String +} + +model User { + myId String @id @default(cuid()) + createdAt DateTime @default(now()) + updatedAt DateTime @updatedAt + email String @unique @email + posts Post[] + profile Profile? + address Address? @json + someJson Json? +} + +model Profile { + id Int @id @default(autoincrement()) + gender String + user User @relation(fields: [userId], references: [myId]) + userId String @unique +} + +model Post { + id Int @id @default(autoincrement()) + createdAt DateTime @default(now()) + updatedAt DateTime @updatedAt + title String @length(1, 10) + author User? @relation(fields: [authorId], references: [myId]) + authorId String? + published Boolean @default(false) + publishedAt DateTime? + viewCount Int @default(0) + comments Comment[] + setting Setting? +} + +model Comment { + id Int @id @default(autoincrement()) + post Post @relation(fields: [postId], references: [id]) + postId Int + content String +} + +model Setting { + id Int @id @default(autoincrement()) + boost Int + post Post @relation(fields: [postId], references: [id]) + postId Int @unique +} + +procedure findPostsByUser(userId: String): Post[] +procedure getPostCount(userId: String, published: Boolean?): Int +mutation procedure publishPost(postId: Int): Post +`; + +describe('RPC OpenAPI spec generation - document structure', () => { + let handler: RPCApiHandler; + let spec: any; + + beforeAll(async () => { + const client = await createTestClient(schema); + handler = new RPCApiHandler({ schema: client.$schema }); + spec = await generateSpec(handler); + }); + + it('has correct openapi version and info', () => { + expect(spec.openapi).toBe('3.1.0'); + expect(spec.info).toBeDefined(); + expect(spec.info.title).toBe('ZenStack Generated API'); + expect(spec.info.version).toBe('1.0.0'); + }); + + it('has paths and components', () => { + expect(spec.paths).toBeDefined(); + expect(spec.components).toBeDefined(); + expect(spec.components.schemas).toBeDefined(); + }); + + it('has tags for each model', () => { + const tagNames = spec.tags.map((t: any) => t.name); + expect(tagNames).toContain('user'); + expect(tagNames).toContain('post'); + expect(tagNames).toContain('comment'); + }); + + it('custom spec options are reflected in info', async () => { + const client = await createTestClient(schema); + const h = new RPCApiHandler({ schema: client.$schema }); + const s = await generateSpec(h, { title: 'My RPC API', version: '2.0.0', description: 'Desc' }); + expect(s.info.title).toBe('My RPC API'); + expect(s.info.version).toBe('2.0.0'); + expect((s.info as any).description).toBe('Desc'); + }); +}); + +describe('RPC OpenAPI spec generation - paths and HTTP methods', () => { + let spec: any; + + beforeAll(async () => { + const client = await createTestClient(schema); + const handler = new RPCApiHandler({ schema: client.$schema }); + spec = await generateSpec(handler); + }); + + it('generates paths for all CRUD operations per model', () => { + const readOps = ['findMany', 'findFirst', 'findUnique', 'count', 'aggregate', 'groupBy', 'exists']; + const writeOps = ['create', 'createMany', 'createManyAndReturn', 'upsert']; + const updateOps = ['update', 'updateMany', 'updateManyAndReturn']; + const deleteOps = ['delete', 'deleteMany']; + + for (const op of [...readOps, ...writeOps, ...updateOps, ...deleteOps]) { + expect(spec.paths[`/user/${op}`], `expected /user/${op}`).toBeDefined(); + expect(spec.paths[`/post/${op}`], `expected /post/${op}`).toBeDefined(); + } + }); + + it('read operations use GET', () => { + for (const op of ['findMany', 'findFirst', 'findUnique', 'count', 'aggregate', 'groupBy', 'exists']) { + const path = spec.paths[`/user/${op}`]; + expect(path.get, `GET /user/${op}`).toBeDefined(); + expect(path.post, `no POST /user/${op}`).toBeUndefined(); + } + }); + + it('create/upsert operations use POST', () => { + for (const op of ['create', 'createMany', 'createManyAndReturn', 'upsert']) { + const path = spec.paths[`/user/${op}`]; + expect(path.post, `POST /user/${op}`).toBeDefined(); + expect(path.get, `no GET /user/${op}`).toBeUndefined(); + } + }); + + it('update operations use PUT', () => { + for (const op of ['update', 'updateMany', 'updateManyAndReturn']) { + const path = spec.paths[`/user/${op}`]; + expect(path.put, `PUT /user/${op}`).toBeDefined(); + } + }); + + it('delete operations use DELETE', () => { + for (const op of ['delete', 'deleteMany']) { + const path = spec.paths[`/user/${op}`]; + expect(path.delete, `DELETE /user/${op}`).toBeDefined(); + } + }); + + it('create operations return 201', () => { + for (const op of ['create', 'createMany', 'createManyAndReturn', 'upsert']) { + const path = spec.paths[`/post/${op}`]; + expect(path.post.responses['201'], `201 for /post/${op}`).toBeDefined(); + } + }); + + it('non-create operations return 200', () => { + expect(spec.paths['/user/findMany'].get.responses['200']).toBeDefined(); + expect(spec.paths['/user/update'].put.responses['200']).toBeDefined(); + expect(spec.paths['/user/delete'].delete.responses['200']).toBeDefined(); + }); + + it('has transaction endpoint', () => { + expect(spec.paths['/$transaction/sequential']).toBeDefined(); + expect(spec.paths['/$transaction/sequential'].post).toBeDefined(); + }); +}); + +describe('RPC OpenAPI spec generation - input schemas', () => { + let spec: any; + + beforeAll(async () => { + const client = await createTestClient(schema); + const handler = new RPCApiHandler({ schema: client.$schema }); + spec = await generateSpec(handler); + }); + + it('GET operations have q query parameter', () => { + for (const op of ['findMany', 'findFirst', 'findUnique', 'count', 'aggregate', 'groupBy', 'exists']) { + const operation = spec.paths[`/user/${op}`].get; + const qParam = operation.parameters?.find((p: any) => p.name === 'q'); + expect(qParam, `q param on /user/${op}`).toBeDefined(); + expect(qParam.in).toBe('query'); + // OAPI 3.1 content-typed parameter for complex JSON + expect(qParam.content?.['application/json']?.schema).toBeDefined(); + } + }); + + it('DELETE operations have q query parameter', () => { + for (const op of ['delete', 'deleteMany']) { + const operation = spec.paths[`/user/${op}`].delete; + const qParam = operation.parameters?.find((p: any) => p.name === 'q'); + expect(qParam, `q param on /user/${op}`).toBeDefined(); + expect(qParam.content?.['application/json']?.schema).toBeDefined(); + } + }); + + it('POST operations have request body', () => { + for (const op of ['create', 'createMany', 'createManyAndReturn', 'upsert']) { + const operation = spec.paths[`/user/${op}`].post; + expect(operation.requestBody, `requestBody on /user/${op}`).toBeDefined(); + expect(operation.requestBody.required).toBe(true); + expect(operation.requestBody.content?.['application/json']?.schema).toBeDefined(); + } + }); + + it('PUT operations have request body', () => { + for (const op of ['update', 'updateMany', 'updateManyAndReturn']) { + const operation = spec.paths[`/user/${op}`].put; + expect(operation.requestBody, `requestBody on /user/${op}`).toBeDefined(); + expect(operation.requestBody.content?.['application/json']?.schema).toBeDefined(); + } + }); + + it('findUnique q schema contains where field', () => { + const operation = spec.paths['/user/findUnique'].get; + const qSchema = operation.parameters.find((p: any) => p.name === 'q').content['application/json'].schema; + // The schema describes FindUniqueArgs which has a required where field + expect(qSchema).toBeDefined(); + expect(qSchema.type === 'object' || qSchema.properties || qSchema.$defs || qSchema.$ref).toBeTruthy(); + }); + + it('create request body schema contains data field', () => { + const operation = spec.paths['/user/create'].post; + const bodySchema = operation.requestBody.content['application/json'].schema; + expect(bodySchema).toBeDefined(); + // CreateArgs has a data field + expect( + bodySchema.type === 'object' || bodySchema.properties || bodySchema.$defs || bodySchema.$ref, + ).toBeTruthy(); + }); + + it('transaction request body uses shared schema ref', () => { + const operation = spec.paths['/$transaction/sequential'].post; + expect(operation.requestBody.content['application/json'].schema.$ref).toBe( + '#/components/schemas/_rpcTransactionRequest', + ); + }); +}); + +describe('RPC OpenAPI spec generation - shared schemas', () => { + let spec: any; + + beforeAll(async () => { + const client = await createTestClient(schema); + const handler = new RPCApiHandler({ schema: client.$schema }); + spec = await generateSpec(handler); + }); + + it('_rpcSuccessResponse schema exists', () => { + const schema = spec.components.schemas['_rpcSuccessResponse']; + expect(schema).toBeDefined(); + expect(schema.type).toBe('object'); + expect(schema.properties.data).toBeDefined(); + }); + + it('_rpcErrorResponse schema exists with required message', () => { + const schema = spec.components.schemas['_rpcErrorResponse']; + expect(schema).toBeDefined(); + expect(schema.type).toBe('object'); + expect(schema.properties.error).toBeDefined(); + expect(schema.properties.error.properties.message).toBeDefined(); + expect(schema.properties.error.required).toContain('message'); + }); + + it('_rpcTransactionRequest schema is an array of operation objects', () => { + const schema = spec.components.schemas['_rpcTransactionRequest']; + expect(schema).toBeDefined(); + expect(schema.type).toBe('array'); + expect(schema.items).toBeDefined(); + expect(schema.items.properties.model).toBeDefined(); + expect(schema.items.properties.op).toBeDefined(); + expect(schema.items.required).toContain('model'); + expect(schema.items.required).toContain('op'); + }); + + it('success responses for model operations are inline (not _rpcSuccessResponse ref)', () => { + const findMany = spec.paths['/user/findMany'].get; + const schema = findMany.responses['200'].content['application/json'].schema; + // Model operations return operation-specific inline schemas, not the generic ref + expect(schema.$ref).toBeUndefined(); + expect(schema.type).toBe('object'); + expect(schema.properties.data).toBeDefined(); + }); + + it('error responses reference _rpcErrorResponse', () => { + const create = spec.paths['/user/create'].post; + expect(create.responses['400'].content['application/json'].schema.$ref).toBe( + '#/components/schemas/_rpcErrorResponse', + ); + expect(create.responses['422'].content['application/json'].schema.$ref).toBe( + '#/components/schemas/_rpcErrorResponse', + ); + }); + + it('all operations have 400 and 500 responses', () => { + for (const [path, item] of Object.entries(spec.paths as Record)) { + for (const method of ['get', 'post', 'put', 'delete'] as const) { + if (!item[method]) continue; + expect(item[method].responses['400'], `400 on ${method.toUpperCase()} ${path}`).toBeDefined(); + expect(item[method].responses['500'], `500 on ${method.toUpperCase()} ${path}`).toBeDefined(); + } + } + }); +}); + +describe('RPC OpenAPI spec generation - response data shapes', () => { + let spec: any; + + beforeAll(async () => { + const client = await createTestClient(schema); + const handler = new RPCApiHandler({ schema: client.$schema }); + spec = await generateSpec(handler); + }); + + it('findUnique and findFirst data is nullable entity ref', () => { + for (const op of ['findUnique', 'findFirst']) { + const opSchema = spec.paths[`/user/${op}`].get.responses['200'].content['application/json'].schema; + const dataSchema = opSchema.properties.data; + expect(dataSchema.anyOf).toBeDefined(); + const refs = dataSchema.anyOf.map((s: any) => s.$ref ?? s.type); + expect(refs).toContain('#/components/schemas/User'); + expect(refs).toContain('null'); + } + }); + + it('findMany data is array of entity refs', () => { + const opSchema = spec.paths['/user/findMany'].get.responses['200'].content['application/json'].schema; + const dataSchema = opSchema.properties.data; + expect(dataSchema.type).toBe('array'); + expect(dataSchema.items.$ref).toBe('#/components/schemas/User'); + }); + + it('createManyAndReturn and updateManyAndReturn data are arrays', () => { + for (const [op, method] of [ + ['createManyAndReturn', 'post'], + ['updateManyAndReturn', 'put'], + ] as const) { + const responses = spec.paths[`/post/${op}`][method].responses; + const successCode = method === 'post' ? '201' : '200'; + const dataSchema = responses[successCode].content['application/json'].schema.properties.data; + expect(dataSchema.type).toBe('array'); + expect(dataSchema.items.$ref).toBe('#/components/schemas/Post'); + } + }); + + it('create, update, delete, upsert data is direct entity ref', () => { + expect( + spec.paths['/user/create'].post.responses['201'].content['application/json'].schema.properties.data.$ref, + ).toBe('#/components/schemas/User'); + expect( + spec.paths['/user/update'].put.responses['200'].content['application/json'].schema.properties.data.$ref, + ).toBe('#/components/schemas/User'); + expect( + spec.paths['/user/delete'].delete.responses['200'].content['application/json'].schema.properties.data.$ref, + ).toBe('#/components/schemas/User'); + expect( + spec.paths['/user/upsert'].post.responses['201'].content['application/json'].schema.properties.data.$ref, + ).toBe('#/components/schemas/User'); + }); + + it('createMany, updateMany, deleteMany data has count property', () => { + for (const [op, method] of [ + ['createMany', 'post'], + ['updateMany', 'put'], + ['deleteMany', 'delete'], + ] as const) { + const responses = spec.paths[`/user/${op}`][method].responses; + const successCode = method === 'post' ? '201' : '200'; + const dataSchema = responses[successCode].content['application/json'].schema.properties.data; + expect(dataSchema.type).toBe('object'); + expect(dataSchema.properties.count.type).toBe('integer'); + expect(dataSchema.required).toContain('count'); + } + }); + + it('exists data is boolean', () => { + const opSchema = spec.paths['/user/exists'].get.responses['200'].content['application/json'].schema; + expect(opSchema.properties.data.type).toBe('boolean'); + }); + + it('model entity schemas are in components/schemas', () => { + const userSchema = spec.components.schemas['User']; + expect(userSchema).toBeDefined(); + expect(userSchema.type).toBe('object'); + expect(userSchema.properties).toBeDefined(); + }); + + it('model entity schema has scalar fields with correct types', () => { + const userSchema = spec.components.schemas['User']; + expect(userSchema.properties['myId'].type).toBe('string'); + expect(userSchema.properties['email'].type).toBe('string'); + expect(userSchema.properties['createdAt'].type).toBe('string'); + expect(userSchema.properties['createdAt'].format).toBe('date-time'); + }); + + it('model entity schema has optional fields as nullable anyOf', () => { + // profile is optional (Profile?) on User, address is optional Address? @json + const userSchema = spec.components.schemas['User']; + // someJson is Json? — optional scalar + expect(userSchema.properties['someJson'].anyOf).toBeDefined(); + const types = userSchema.properties['someJson'].anyOf.map((s: any) => s.type); + expect(types).toContain('null'); + }); + + it('model entity schema has relation fields as optional (not in required)', () => { + const userSchema = spec.components.schemas['User']; + // posts and profile are relation fields — should be present in properties but not required + expect(userSchema.properties['posts']).toBeDefined(); + expect(userSchema.properties['profile']).toBeDefined(); + expect(userSchema.required ?? []).not.toContain('posts'); + expect(userSchema.required ?? []).not.toContain('profile'); + }); + + it('scalar fields are in required', () => { + const postSchema = spec.components.schemas['Post']; + expect(postSchema.required).toContain('id'); + expect(postSchema.required).toContain('title'); + expect(postSchema.required).toContain('published'); + }); + + it('enum schemas are present in components and enum fields reference them', async () => { + const enumSchema = ` +enum Role { + USER + ADMIN +} + +model User { + id Int @id @default(autoincrement()) + role Role +} +`; + const client = await createTestClient(enumSchema); + const handler = new RPCApiHandler({ schema: client.$schema }); + const s = await generateSpec(handler); + + // Enum component must be registered so the $ref resolves + expect(s.components?.schemas?.['Role']).toBeDefined(); + expect(s.components?.schemas?.['Role'].type).toBe('string'); + expect(s.components?.schemas?.['Role'].enum).toEqual(['USER', 'ADMIN']); + + // The entity schema must reference the enum via $ref + const userSchema = s.components?.schemas?.['User'] as any; + const roleField = userSchema?.properties?.role; + expect(roleField?.['$ref']).toBe('#/components/schemas/Role'); + }); +}); + +describe('RPC OpenAPI spec generation - operationIds', () => { + let spec: any; + + beforeAll(async () => { + const client = await createTestClient(schema); + const handler = new RPCApiHandler({ schema: client.$schema }); + spec = await generateSpec(handler); + }); + + it('operationIds are unique', () => { + const ids: string[] = []; + for (const item of Object.values(spec.paths as Record)) { + for (const method of ['get', 'post', 'put', 'delete'] as const) { + if (item[method]?.operationId) { + ids.push(item[method].operationId); + } + } + } + expect(new Set(ids).size).toBe(ids.length); + }); + + it('model operation IDs follow {model}_{op} convention', () => { + expect(spec.paths['/user/findMany'].get.operationId).toBe('user_findMany'); + expect(spec.paths['/post/create'].post.operationId).toBe('post_create'); + expect(spec.paths['/comment/delete'].delete.operationId).toBe('comment_delete'); + }); +}); + +describe('RPC OpenAPI spec generation - queryOptions slicing', () => { + it('excludedModels removes model paths from spec', async () => { + const client = await createTestClient(schema); + const handler = new RPCApiHandler({ + schema: client.$schema, + queryOptions: { slicing: { excludedModels: ['Post'] as any } }, + }); + const spec = await generateSpec(handler); + + expect(spec.paths?.['/post/findMany']).toBeUndefined(); + expect(spec.paths?.['/user/findMany']).toBeDefined(); + // Post tag should not be present + expect(spec.tags?.map((t: any) => t.name)).not.toContain('post'); + }); + + it('includedModels limits spec to those models', async () => { + const client = await createTestClient(schema); + const handler = new RPCApiHandler({ + schema: client.$schema, + queryOptions: { slicing: { includedModels: ['User', 'Post'] as any } }, + }); + const spec = await generateSpec(handler); + + expect(spec.paths?.['/user/findMany']).toBeDefined(); + expect(spec.paths?.['/post/findMany']).toBeDefined(); + expect(spec.paths?.['/comment/findMany']).toBeUndefined(); + }); + + it('excludedOperations removes paths for those operations', async () => { + const client = await createTestClient(schema); + const handler = new RPCApiHandler({ + schema: client.$schema, + queryOptions: { + slicing: { + models: { post: { excludedOperations: ['create', 'delete'] } }, + } as any, + }, + }); + const spec = await generateSpec(handler); + + expect(spec.paths?.['/post/findMany']).toBeDefined(); + expect(spec.paths?.['/post/create']).toBeUndefined(); + expect(spec.paths?.['/post/delete']).toBeUndefined(); + expect(spec.paths?.['/post/update']).toBeDefined(); + }); + + it('includedOperations limits to those operations', async () => { + const client = await createTestClient(schema); + const handler = new RPCApiHandler({ + schema: client.$schema, + queryOptions: { + slicing: { + models: { user: { includedOperations: ['findMany', 'findUnique'] } }, + } as any, + }, + }); + const spec = await generateSpec(handler); + + expect(spec.paths?.['/user/findMany']).toBeDefined(); + expect(spec.paths?.['/user/findUnique']).toBeDefined(); + expect(spec.paths?.['/user/create']).toBeUndefined(); + expect(spec.paths?.['/user/update']).toBeUndefined(); + }); + + it('$all model slicing applies to all models', async () => { + const client = await createTestClient(schema); + const handler = new RPCApiHandler({ + schema: client.$schema, + queryOptions: { + slicing: { + models: { $all: { excludedOperations: ['delete', 'deleteMany'] } }, + } as any, + }, + }); + const spec = await generateSpec(handler); + + for (const model of ['user', 'post', 'comment', 'setting', 'profile']) { + expect(spec.paths?.[`/${model}/delete`]).toBeUndefined(); + expect(spec.paths?.[`/${model}/deleteMany`]).toBeUndefined(); + expect(spec.paths?.[`/${model}/findMany`]).toBeDefined(); + } + }); + + it('excludedModels removes model entity schema from components', async () => { + const client = await createTestClient(schema); + const handler = new RPCApiHandler({ + schema: client.$schema, + queryOptions: { slicing: { excludedModels: ['Post'] as any } }, + }); + const spec = await generateSpec(handler); + + expect(spec.components?.schemas?.['Post']).toBeUndefined(); + expect(spec.components?.schemas?.['User']).toBeDefined(); + }); + + it('includedModels removes excluded model entity schemas from components', async () => { + const client = await createTestClient(schema); + const handler = new RPCApiHandler({ + schema: client.$schema, + queryOptions: { slicing: { includedModels: ['User'] as any } }, + }); + const spec = await generateSpec(handler); + + expect(spec.components?.schemas?.['User']).toBeDefined(); + expect(spec.components?.schemas?.['Post']).toBeUndefined(); + expect(spec.components?.schemas?.['Comment']).toBeUndefined(); + }); + + it('excludedModels removes excluded model arg schemas from components', async () => { + const client = await createTestClient(schema); + const handler = new RPCApiHandler({ + schema: client.$schema, + queryOptions: { slicing: { excludedModels: ['Post'] as any } }, + }); + const spec = await generateSpec(handler); + + expect(spec.components?.schemas?.['PostFindManyArgs']).toBeUndefined(); + expect(spec.components?.schemas?.['PostCreateArgs']).toBeUndefined(); + expect(spec.components?.schemas?.['UserFindManyArgs']).toBeDefined(); + }); + + it('excludedFilterKinds removes filter operators from field filter schema', async () => { + const client = await createTestClient(schema); + const handler = new RPCApiHandler({ + schema: client.$schema, + queryOptions: { + slicing: { + models: { + user: { + fields: { + email: { excludedFilterKinds: ['Like'] }, + }, + }, + }, + } as any, + }, + }); + const spec = await generateSpec(handler); + + // With Like excluded, email uses a sliced filter schema that has no Like operators + const userWhereInput = spec.components?.schemas?.['UserWhereInput'] as any; + // email should reference a sliced filter variant (not the full StringFilter) + const emailRef = userWhereInput?.properties?.email?.['$ref'] as string; + expect(emailRef).toBeDefined(); + const slicedFilterId = emailRef.replace('#/components/schemas/', ''); + const slicedFilter = spec.components?.schemas?.[slicedFilterId] as any; + const filterObj = slicedFilter?.anyOf?.find((s: any) => s.type === 'object'); + // Like operators should be absent + expect(filterObj?.properties?.contains).toBeUndefined(); + expect(filterObj?.properties?.startsWith).toBeUndefined(); + expect(filterObj?.properties?.endsWith).toBeUndefined(); + // Equality operators should still be present + expect(filterObj?.properties?.equals).toBeDefined(); + }); + + it('includedFilterKinds limits field filter schema to specified kinds', async () => { + const client = await createTestClient(schema); + const handler = new RPCApiHandler({ + schema: client.$schema, + queryOptions: { + slicing: { + models: { + user: { + fields: { + email: { includedFilterKinds: ['Equality'] }, + }, + }, + }, + } as any, + }, + }); + const spec = await generateSpec(handler); + + const userWhereInput = spec.components?.schemas?.['UserWhereInput'] as any; + const emailRef = userWhereInput?.properties?.email?.['$ref'] as string; + expect(emailRef).toBeDefined(); + const slicedFilterId = emailRef.replace('#/components/schemas/', ''); + const slicedFilter = spec.components?.schemas?.[slicedFilterId] as any; + const filterObj = slicedFilter?.anyOf?.find((s: any) => s.type === 'object'); + // Only Equality operators should remain + expect(filterObj?.properties?.equals).toBeDefined(); + expect(filterObj?.properties?.in).toBeDefined(); + // Like operators should be gone + expect(filterObj?.properties?.contains).toBeUndefined(); + expect(filterObj?.properties?.startsWith).toBeUndefined(); + // Range operators should be gone + expect(filterObj?.properties?.lt).toBeUndefined(); + expect(filterObj?.properties?.gt).toBeUndefined(); + }); + + it('$all field slicing applies includedFilterKinds to all fields of a model', async () => { + const client = await createTestClient(schema); + const handler = new RPCApiHandler({ + schema: client.$schema, + queryOptions: { + slicing: { + models: { + user: { + fields: { $all: { includedFilterKinds: ['Equality'] } }, + }, + }, + } as any, + }, + }); + const spec = await generateSpec(handler); + + const userWhereInput = spec.components?.schemas?.['UserWhereInput'] as any; + // Both email and myId should reference a sliced Equality-only filter schema + for (const field of ['email', 'myId']) { + const emailRef = userWhereInput?.properties?.[field]?.['$ref'] as string; + expect(emailRef).toBeDefined(); + const slicedFilterId = emailRef.replace('#/components/schemas/', ''); + const slicedFilter = spec.components?.schemas?.[slicedFilterId] as any; + const filterObj = slicedFilter?.anyOf?.find((s: any) => s.type === 'object'); + expect(filterObj?.properties?.equals).toBeDefined(); + expect(filterObj?.properties?.contains).toBeUndefined(); + expect(filterObj?.properties?.lt).toBeUndefined(); + } + }); +}); + +describe('RPC OpenAPI spec generation - procedures', () => { + const procSchema = ` +model User { + id Int @id @default(autoincrement()) + name String +} + +procedure getUser(id: Int): User +mutation procedure createUser(name: String): User +procedure optionalSearch(query: String?): User[] +`; + + it('generates GET path for query procedures', async () => { + const client = await createTestClient(procSchema); + const handler = new RPCApiHandler({ schema: client.$schema }); + const spec = await generateSpec(handler); + + expect(spec.paths?.['/$procs/getUser']).toBeDefined(); + expect(spec.paths?.['/$procs/getUser']?.get).toBeDefined(); + expect(spec.paths?.['/$procs/getUser']?.post).toBeUndefined(); + }); + + it('generates POST path for mutation procedures', async () => { + const client = await createTestClient(procSchema); + const handler = new RPCApiHandler({ schema: client.$schema }); + const spec = await generateSpec(handler); + + expect(spec.paths?.['/$procs/createUser']).toBeDefined(); + expect(spec.paths?.['/$procs/createUser']?.post).toBeDefined(); + expect(spec.paths?.['/$procs/createUser']?.get).toBeUndefined(); + }); + + it('query procedure has q parameter with args envelope schema', async () => { + const client = await createTestClient(procSchema); + const handler = new RPCApiHandler({ schema: client.$schema }); + const spec = await generateSpec(handler); + + const operation = spec.paths?.['/$procs/getUser']?.get; + const qParam: any = operation?.parameters?.find((p: any) => p.name === 'q'); + expect(qParam).toBeDefined(); + expect(qParam?.content?.['application/json']?.schema).toBeDefined(); + // args is a $ref to the registered ProcArgs component schema + const envelopeSchema = qParam?.content['application/json'].schema; + const argsRef = envelopeSchema.properties?.args?.$ref; + expect(argsRef).toBeDefined(); + const argsSchemaName = argsRef.replace('#/components/schemas/', ''); + const argsSchema = spec.components?.schemas?.[argsSchemaName] as any; + expect(argsSchema?.properties?.id).toBeDefined(); + expect(argsSchema?.required).toContain('id'); + }); + + it('mutation procedure has request body with args envelope schema', async () => { + const client = await createTestClient(procSchema); + const handler = new RPCApiHandler({ schema: client.$schema }); + const spec = await generateSpec(handler); + + const operation = spec?.paths?.['/$procs/createUser']?.post; + expect(operation?.requestBody).toBeDefined(); + expect((operation?.requestBody as any)?.required).toBe(true); + const bodySchema = (operation?.requestBody as any)?.content?.['application/json']?.schema; + // args is a $ref to the registered ProcArgs component schema + const argsRef = bodySchema?.properties?.args?.$ref; + expect(argsRef).toBeDefined(); + const argsSchemaName = argsRef.replace('#/components/schemas/', ''); + const argsSchema = spec.components?.schemas?.[argsSchemaName] as any; + expect(argsSchema?.properties?.name).toBeDefined(); + expect(argsSchema?.required).toContain('name'); + }); + + it('mutation with only optional params does not set requestBody.required', async () => { + const optionalMutationSchema = ` +model User { + id Int @id @default(autoincrement()) + name String +} +mutation procedure softDelete(id: Int?): User +`; + const client = await createTestClient(optionalMutationSchema); + const handler = new RPCApiHandler({ schema: client.$schema }); + const spec = await generateSpec(handler); + + const operation = spec?.paths?.['/$procs/softDelete']?.post; + expect(operation?.requestBody).toBeDefined(); + expect((operation?.requestBody as any)?.required).toBeUndefined(); + }); + + it('optional procedure params are not in required array', async () => { + const client = await createTestClient(procSchema); + const handler = new RPCApiHandler({ schema: client.$schema }); + const spec = await generateSpec(handler); + + const operation = spec?.paths?.['/$procs/optionalSearch']?.get; + const qParam = operation?.parameters?.find((p: any) => p.name === 'q'); + // args is a $ref to the registered ProcArgs component schema + const argsRef = (qParam as any)?.content?.['application/json']?.schema?.properties?.args?.$ref; + expect(argsRef).toBeDefined(); + const argsSchemaName = argsRef.replace('#/components/schemas/', ''); + const argsSchema = spec.components?.schemas?.[argsSchemaName] as any; + // query is optional so should not appear in required + expect(argsSchema?.required ?? []).not.toContain('query'); + }); + + it('procedure operationId uses proc_ prefix', async () => { + const client = await createTestClient(procSchema); + const handler = new RPCApiHandler({ schema: client.$schema }); + const spec = await generateSpec(handler); + + expect(spec?.paths?.['/$procs/getUser']?.get?.operationId).toBe('proc_getUser'); + expect(spec?.paths?.['/$procs/createUser']?.post?.operationId).toBe('proc_createUser'); + }); + + it('slicing excludedProcedures removes procedure paths', async () => { + const client = await createTestClient(procSchema); + const handler = new RPCApiHandler({ + schema: client.$schema, + queryOptions: { slicing: { excludedProcedures: ['getUser'] as any } }, + }); + const spec = await generateSpec(handler); + + expect(spec.paths?.['/$procs/getUser']).toBeUndefined(); + expect(spec.paths?.['/$procs/createUser']).toBeDefined(); + }); + + it('slicing excludedProcedures removes procedure args from components schemas', async () => { + const client = await createTestClient(procSchema); + const handler = new RPCApiHandler({ + schema: client.$schema, + queryOptions: { slicing: { excludedProcedures: ['getUser'] as any } }, + }); + const spec = await generateSpec(handler); + + const schemaKeys = Object.keys(spec.components?.schemas ?? {}); + expect(schemaKeys.some((k) => k.startsWith('getUser'))).toBe(false); + expect(schemaKeys.some((k) => k.startsWith('createUser'))).toBe(true); + }); + + it('slicing includedProcedures removes non-listed procedure args from components schemas', async () => { + const client = await createTestClient(procSchema); + const handler = new RPCApiHandler({ + schema: client.$schema, + queryOptions: { slicing: { includedProcedures: ['createUser'] as any } }, + }); + const spec = await generateSpec(handler); + + const schemaKeys = Object.keys(spec.components?.schemas ?? {}); + expect(schemaKeys.some((k) => k.startsWith('createUser'))).toBe(true); + expect(schemaKeys.some((k) => k.startsWith('getUser'))).toBe(false); + expect(schemaKeys.some((k) => k.startsWith('optionalSearch'))).toBe(false); + }); +}); + +describe('RPC OpenAPI spec generation - respectAccessPolicies', () => { + it('no 403 responses when respectAccessPolicies is off', async () => { + const policySchema = ` +model Item { + id Int @id @default(autoincrement()) + value Int + @@allow('create', value > 0) +} +`; + const client = await createTestClient(policySchema); + const handler = new RPCApiHandler({ schema: client.$schema }); + const spec = await generateSpec(handler); + expect(spec.paths?.['/item/create']?.post?.responses?.['403']).toBeUndefined(); + }); + + it('adds 403 for operations with non-constant-allow policies', async () => { + const policySchema = ` +model Item { + id Int @id @default(autoincrement()) + value Int + @@allow('read', true) + @@allow('create', value > 0) + @@allow('update', value > 0) + @@allow('delete', value > 0) +} +`; + const client = await createTestClient(policySchema); + const handler = new RPCApiHandler({ schema: client.$schema }); + const spec = await generateSpec(handler, { respectAccessPolicies: true }); + + expect(spec.paths?.['/item/create']?.post?.responses?.['403']).toBeDefined(); + expect(spec.paths?.['/item/update']?.put?.responses?.['403']).toBeDefined(); + expect(spec.paths?.['/item/delete']?.delete?.responses?.['403']).toBeDefined(); + // read is constant-allow → no 403 + expect(spec.paths?.['/item/findMany']?.get?.responses?.['403']).toBeUndefined(); + }); + + it('no 403 for constant-allow operations', async () => { + const policySchema = ` +model Item { + id Int @id @default(autoincrement()) + value Int + @@allow('all', true) +} +`; + const client = await createTestClient(policySchema); + const handler = new RPCApiHandler({ schema: client.$schema }); + const spec = await generateSpec(handler, { respectAccessPolicies: true }); + + expect(spec.paths?.['/item/create']?.post?.responses?.['403']).toBeUndefined(); + expect(spec.paths?.['/item/update']?.put?.responses?.['403']).toBeUndefined(); + expect(spec.paths?.['/item/delete']?.delete?.responses?.['403']).toBeUndefined(); + }); + + it('403 when deny rule exists even with constant allow', async () => { + const policySchema = ` +model Item { + id Int @id @default(autoincrement()) + value Int + @@allow('create', true) + @@deny('create', value < 0) +} +`; + const client = await createTestClient(policySchema); + const handler = new RPCApiHandler({ schema: client.$schema }); + const spec = await generateSpec(handler, { respectAccessPolicies: true }); + expect(spec.paths?.['/item/create']?.post?.responses?.['403']).toBeDefined(); + }); + + it('403 when no policy rules at all (default-deny)', async () => { + const policySchema = ` +model Item { + id Int @id @default(autoincrement()) + value Int +} +`; + const client = await createTestClient(policySchema); + const handler = new RPCApiHandler({ schema: client.$schema }); + const spec = await generateSpec(handler, { respectAccessPolicies: true }); + + expect(spec.paths?.['/item/create']?.post?.responses?.['403']).toBeDefined(); + expect(spec.paths?.['/item/update']?.put?.responses?.['403']).toBeDefined(); + expect(spec.paths?.['/item/delete']?.delete?.responses?.['403']).toBeDefined(); + }); + + it('per-operation granularity: only non-constant ops get 403', async () => { + const policySchema = ` +model Item { + id Int @id @default(autoincrement()) + value Int + @@allow('create,read', true) + @@allow('update,delete', value > 0) +} +`; + const client = await createTestClient(policySchema); + const handler = new RPCApiHandler({ schema: client.$schema }); + const spec = await generateSpec(handler, { respectAccessPolicies: true }); + + expect(spec.paths?.['/item/create']?.post?.responses?.['403']).toBeUndefined(); + expect(spec.paths?.['/item/update']?.put?.responses?.['403']).toBeDefined(); + expect(spec.paths?.['/item/delete']?.delete?.responses?.['403']).toBeDefined(); + }); +}); + +describe('RPC OpenAPI spec generation - JSON fields', () => { + let spec: any; + + beforeAll(async () => { + const client = await createTestClient(schema); + const handler = new RPCApiHandler({ schema: client.$schema }); + spec = await generateSpec(handler); + }); + + it('JsonValue schema is registered in components', () => { + const jsonValue = spec.components.schemas['JsonValue']; + expect(jsonValue).toBeDefined(); + // Should be a union of primitive types + expect(jsonValue.anyOf).toBeDefined(); + const types = jsonValue.anyOf.map((s: any) => s.type).filter(Boolean); + expect(types).toContain('string'); + expect(types).toContain('number'); + expect(types).toContain('boolean'); + }); + + it('plain JSON field (someJson Json?) is nullable in entity schema', () => { + const userSchema = spec.components.schemas['User']; + const field = userSchema.properties['someJson']; + expect(field).toBeDefined(); + // Optional Json field should allow null + expect(field.anyOf).toBeDefined(); + const types = field.anyOf.map((s: any) => s.type).filter(Boolean); + expect(types).toContain('null'); + }); + + it('typed JSON field (address Address? @json) references typedef schema', () => { + const userSchema = spec.components.schemas['User']; + const field = userSchema.properties['address']; + expect(field).toBeDefined(); + // Optional typed JSON field should be anyOf: [$ref: Address, null] + expect(field.anyOf).toBeDefined(); + const refs = field.anyOf.map((s: any) => s.$ref ?? s.type).filter(Boolean); + expect(refs).toContain('#/components/schemas/Address'); + expect(refs).toContain('null'); + }); + + it('JsonFilter schema is registered for filtering plain JSON fields', () => { + // someJson is optional so JsonFilterOptional is expected + const jsonFilter = spec.components.schemas['JsonFilterOptional']; + expect(jsonFilter).toBeDefined(); + expect(jsonFilter.type).toBe('object'); + // Should have standard JSON filter operators + expect(jsonFilter.properties['equals']).toBeDefined(); + expect(jsonFilter.properties['not']).toBeDefined(); + expect(jsonFilter.properties['string_contains']).toBeDefined(); + expect(jsonFilter.properties['array_contains']).toBeDefined(); + }); + + it('AddressFilter schema is registered for filtering typed JSON fields', () => { + // address is optional so AddressFilterOptional is expected + const addressFilter = spec.components.schemas['AddressFilterOptional']; + expect(addressFilter).toBeDefined(); + // Should be a union (field filter + json filter + is/isNot) + expect(addressFilter.anyOf).toBeDefined(); + }); + + it('AddressFilter field filter variant includes Address typedef fields', () => { + const addressFilter = spec.components.schemas['AddressFilterOptional']; + // One of the anyOf branches should contain the field-level filter for Address.city + const fieldFilterBranch = addressFilter.anyOf?.find((s: any) => s.type === 'object' && s.properties?.city); + expect(fieldFilterBranch).toBeDefined(); + }); + + it('typedef schema (Address) is registered in components', () => { + const addressSchema = spec.components.schemas['Address']; + expect(addressSchema).toBeDefined(); + }); +}); + +describe('RPC OpenAPI spec generation - meta descriptions', () => { + const metaSchema = ` +type Address { + city String @meta(name: "description", value: "The city name") + zip String? @meta(name: "description", value: "Postal code") +} + +model User { + id Int @id @default(autoincrement()) + name String @meta(name: "description", value: "Full name of the user") + email String + + @@meta(name: "description", value: "A platform user") +} +`; + + let spec: any; + + beforeAll(async () => { + const client = await createTestClient(metaSchema); + const handler = new RPCApiHandler({ schema: client.$schema }); + spec = await generateSpec(handler); + }); + + it('model @@meta description appears on entity component schema', () => { + const userSchema = spec.components?.schemas?.['User']; + expect(userSchema?.description).toBe('A platform user'); + }); + + it('field @meta description appears on scalar field schema', () => { + const userSchema = spec.components?.schemas?.['User']; + expect(userSchema?.properties?.name?.description).toBe('Full name of the user'); + }); + + it('field without @meta description has no description property', () => { + const userSchema = spec.components?.schemas?.['User']; + expect(userSchema?.properties?.email?.description).toBeUndefined(); + }); + + it('typedef field @meta description appears on field schema', () => { + const addressSchema = spec.components?.schemas?.['Address']; + expect(addressSchema?.properties?.city?.description).toBe('The city name'); + }); + + it('optional typedef field @meta description appears on field schema', () => { + const addressSchema = spec.components?.schemas?.['Address']; + // zip is optional so it's wrapped in anyOf — description is on the base type inside anyOf + const zipBase = addressSchema?.properties?.zip?.anyOf?.[0]; + expect(zipBase?.description).toBe('Postal code'); + }); +}); + +describe('RPC OpenAPI spec generation - baseline', () => { + it('matches baseline', async () => { + const client = await createTestClient(schema, { provider: 'postgresql' }); + const handler = new RPCApiHandler({ schema: client.$schema }); + const spec = await generateSpec(handler); + const baselineFile = 'rpc.baseline.yaml'; + + if (UPDATE_BASELINE) { + saveBaseline(baselineFile, spec); + return; + } + + const baseline = loadBaseline(baselineFile); + expect(spec).toEqual(baseline); + + await validate(JSON.parse(JSON.stringify(spec))); + }); +}); + +describe('RPC OpenAPI spec generation - OpenAPI validation', () => { + it('spec passes OpenAPI 3.1 validation', async () => { + const client = await createTestClient(schema); + const handler = new RPCApiHandler({ schema: client.$schema }); + const spec = await generateSpec(handler); + // Deep clone to avoid validate() mutating $ref strings + await validate(JSON.parse(JSON.stringify(spec))); + }); + + it('spec with procedures passes OpenAPI 3.1 validation', async () => { + const procSchema = ` +model User { + id Int @id @default(autoincrement()) + name String +} + +procedure findByName(name: String): User +mutation procedure createUser(name: String): User +`; + const client = await createTestClient(procSchema); + const handler = new RPCApiHandler({ schema: client.$schema }); + const spec = await generateSpec(handler); + await validate(JSON.parse(JSON.stringify(spec))); + }); +}); diff --git a/packages/server/tsup.config.ts b/packages/server/tsdown.config.ts similarity index 70% rename from packages/server/tsup.config.ts rename to packages/server/tsdown.config.ts index 4c236d2f9..4c9d852d4 100644 --- a/packages/server/tsup.config.ts +++ b/packages/server/tsdown.config.ts @@ -1,6 +1,6 @@ -import { defineConfig } from 'tsup'; +import { createConfig } from '@zenstackhq/tsdown-config'; -export default defineConfig({ +export default createConfig({ entry: { api: 'src/api/index.ts', express: 'src/adapter/express/index.ts', @@ -12,10 +12,4 @@ export default defineConfig({ sveltekit: 'src/adapter/sveltekit/index.ts', 'tanstack-start': 'src/adapter/tanstack-start/index.ts', }, - outDir: 'dist', - splitting: false, - sourcemap: true, - clean: true, - dts: true, - format: ['cjs', 'esm'], }); diff --git a/packages/testtools/package.json b/packages/testtools/package.json index 04fb5f999..7949cc1c2 100644 --- a/packages/testtools/package.json +++ b/packages/testtools/package.json @@ -2,7 +2,7 @@ "name": "@zenstackhq/testtools", "displayName": "ZenStack Test Tools", "description": "ZenStack Test Tools", - "version": "3.5.6", + "version": "3.6.0", "type": "module", "author": { "name": "ZenStack Team", @@ -15,8 +15,8 @@ }, "license": "MIT", "scripts": { - "build": "tsc --noEmit && tsup-node", - "watch": "tsup-node --watch", + "build": "tsc --noEmit && tsdown", + "watch": "tsdown --watch", "lint": "eslint src --ext ts", "pack": "pnpm pack" }, @@ -27,8 +27,8 @@ "exports": { ".": { "import": { - "types": "./dist/index.d.ts", - "default": "./dist/index.js" + "types": "./dist/index.d.mts", + "default": "./dist/index.mjs" }, "require": { "types": "./dist/index.d.cts", @@ -60,9 +60,10 @@ "devDependencies": { "@types/better-sqlite3": "catalog:", "@types/node": "catalog:", - "@types/tmp": "catalog:", "@types/pg": "^8.11.11", + "@types/tmp": "catalog:", "@zenstackhq/eslint-config": "workspace:*", + "@zenstackhq/tsdown-config": "workspace:*", "@zenstackhq/typescript-config": "workspace:*", "typescript": "catalog:" }, diff --git a/packages/testtools/tsdown.config.ts b/packages/testtools/tsdown.config.ts new file mode 100644 index 000000000..b0a6c43b3 --- /dev/null +++ b/packages/testtools/tsdown.config.ts @@ -0,0 +1,12 @@ +import fs from 'fs'; +import { createConfig } from '@zenstackhq/tsdown-config'; + +export default createConfig({ + entry: { index: 'src/index.ts' }, + deps: { + neverBundle: ['vitest'], + }, + async onSuccess() { + fs.cpSync('src/types.d.ts', 'dist/types.d.ts', { force: true }); + }, +}); diff --git a/packages/testtools/tsup.config.ts b/packages/testtools/tsup.config.ts deleted file mode 100644 index f45bb68e3..000000000 --- a/packages/testtools/tsup.config.ts +++ /dev/null @@ -1,16 +0,0 @@ -import fs from 'fs'; -import { defineConfig } from 'tsup'; - -export default defineConfig({ - entry: { - index: 'src/index.ts', - }, - outDir: 'dist', - splitting: false, - sourcemap: true, - dts: true, - format: ['cjs', 'esm'], - async onSuccess() { - fs.cpSync('src/types.d.ts', 'dist/types.d.ts', { force: true }); - }, -}); diff --git a/packages/zod/package.json b/packages/zod/package.json index 51761d27a..eb87348de 100644 --- a/packages/zod/package.json +++ b/packages/zod/package.json @@ -2,7 +2,7 @@ "name": "@zenstackhq/zod", "displayName": "ZenStack Zod Integration", "description": "Automatically deriving Zod schemas from ZModel schemas", - "version": "3.5.6", + "version": "3.6.0", "type": "module", "author": { "name": "ZenStack Team", @@ -15,8 +15,8 @@ }, "license": "MIT", "scripts": { - "build": "tsc --noEmit && tsup-node", - "watch": "tsup-node --watch", + "build": "tsc --noEmit && tsdown", + "watch": "tsdown --watch", "lint": "eslint src --ext ts", "test": "vitest run", "pack": "pnpm pack", @@ -32,8 +32,8 @@ "exports": { ".": { "import": { - "types": "./dist/index.d.ts", - "default": "./dist/index.js" + "types": "./dist/index.d.mts", + "default": "./dist/index.mjs" }, "require": { "types": "./dist/index.d.cts", @@ -47,6 +47,7 @@ }, "devDependencies": { "@zenstackhq/eslint-config": "workspace:*", + "@zenstackhq/tsdown-config": "workspace:*", "@zenstackhq/typescript-config": "workspace:*", "@zenstackhq/vitest-config": "workspace:*", "zod": "^4.1.0" diff --git a/packages/zod/src/factory.ts b/packages/zod/src/factory.ts index 62620c114..6d2c50b8f 100644 --- a/packages/zod/src/factory.ts +++ b/packages/zod/src/factory.ts @@ -34,9 +34,10 @@ export function createSchemaFactory(schema: Schema) { /** Internal untyped representation of the options object used at runtime. */ type RawOptions = { - select?: Record; - include?: Record; - omit?: Record; + select?: Record; + include?: Record; + omit?: Record; + optionality?: 'all' | 'defaults'; }; /** @@ -49,10 +50,11 @@ type RawOptions = { */ const rawOptionsSchema: z.ZodType = z.lazy(() => z - .object({ - select: z.record(z.string(), z.union([z.boolean(), rawOptionsSchema])).optional(), - include: z.record(z.string(), z.union([z.boolean(), rawOptionsSchema])).optional(), - omit: z.record(z.string(), z.boolean()).optional(), + .strictObject({ + select: z.record(z.string(), z.union([z.literal(true), rawOptionsSchema])).optional(), + include: z.record(z.string(), z.union([z.literal(true), rawOptionsSchema])).optional(), + omit: z.record(z.string(), z.literal(true)).optional(), + optionality: z.enum(['all', 'defaults']).optional(), }) .superRefine((val, ctx) => { if (val.select && val.include) { @@ -93,26 +95,16 @@ class SchemaFactory { const modelDef = this.schema.requireModel(model); if (!options) { - // ── No-options path (original behaviour) ───────────────────────── + // ── No-options path: scalar fields only (relations excluded by default) ── const fields: Record = {}; for (const [fieldName, fieldDef] of Object.entries(modelDef.fields)) { - if (fieldDef.relation) { - const relatedModelName = fieldDef.type; - const lazySchema: z.ZodType = z.lazy(() => - this.makeModelSchema(relatedModelName as GetModels), - ); - // relation fields are always optional - fields[fieldName] = this.applyDescription( - this.applyCardinality(lazySchema, fieldDef).optional(), - fieldDef.attributes, - ); - } else { - fields[fieldName] = this.applyDescription( - this.makeScalarFieldSchema(fieldDef), - fieldDef.attributes, - ); - } + // Relation fields are excluded by default — use `include` or `select` + // to opt in, mirroring ORM behaviour and avoiding infinite + // nesting for circular relations. + if (fieldDef.relation) continue; + + fields[fieldName] = this.applyDescription(this.makeScalarFieldSchema(fieldDef), fieldDef.attributes); } const shape = z.strictObject(fields); @@ -125,7 +117,8 @@ class SchemaFactory { // ── Options path ───────────────────────────────────────────────────── const rawOptions = rawOptionsSchema.parse(options); const fields = this.buildFieldsWithOptions(model as string, rawOptions); - const shape = z.strictObject(fields); + const optionalizedFields = this.applyOptionality(fields, model as string, rawOptions.optionality); + const shape = z.strictObject(optionalizedFields); // @@validate conditions only reference scalar fields of the same model // (the ZModel compiler rejects relation fields). When `select` or `omit` // produces a partial shape some of those scalar fields may be absent; @@ -139,6 +132,9 @@ class SchemaFactory { >; } + /** + * @deprecated Use `makeModelSchema(model, { optionality: 'defaults' })` instead. + */ makeModelCreateSchema>( model: Model, ): z.ZodObject, z.core.$strict> { @@ -165,6 +161,9 @@ class SchemaFactory { ) as unknown as z.ZodObject, z.core.$strict>; } + /** + * @deprecated Use `makeModelSchema(model, { optionality: 'all' })` instead. + */ makeModelUpdateSchema>( model: Model, ): z.ZodObject, z.core.$strict> { @@ -193,6 +192,41 @@ class SchemaFactory { // Options-aware field building // ------------------------------------------------------------------------- + /** + * Applies the `optionality` option to a fields map. + * + * - `"all"` — wraps every field in `z.ZodOptional`. + * - `"defaults"` — only wraps fields that have a `@default` attribute or + * are `@updatedAt` in `z.ZodOptional`. Fields that are + * already optional (nullable optional) retain their shape; + * we just add the outer optional layer. + * - `undefined` — returns the fields map unchanged. + */ + private applyOptionality( + fields: Record, + model: string, + optionality: 'all' | 'defaults' | undefined, + ): Record { + if (!optionality) return fields; + + const modelDef = this.schema.requireModel(model); + const result: Record = {}; + + for (const [fieldName, fieldSchema] of Object.entries(fields)) { + if (optionality === 'all') { + result[fieldName] = this.wrapOptionalPreservingMeta(fieldSchema); + } else { + // optionality === 'defaults' + const fieldDef = modelDef.fields[fieldName]; + const hasDefault = + fieldDef && (fieldDef.default !== undefined || fieldDef.updatedAt || fieldDef.optional); + result[fieldName] = hasDefault ? this.wrapOptionalPreservingMeta(fieldSchema) : fieldSchema; + } + } + + return result; + } + /** * Internal loose options shape used at runtime (we've already validated the * type-level constraints via the overload signatures). @@ -204,10 +238,8 @@ class SchemaFactory { if (select) { // ── select branch ──────────────────────────────────────────────── - // Only include fields that are explicitly listed with a truthy value. + // Only include fields that are explicitly listed (value is always `true` or nested options). for (const [key, value] of Object.entries(select)) { - if (!value) continue; // false → skip - const fieldDef = modelDef.fields[key]; if (!fieldDef) { throw new SchemaFactoryError(`Field "${key}" does not exist on model "${model}"`); @@ -257,8 +289,6 @@ class SchemaFactory { // Validate include keys and add relation fields. if (include) { for (const [key, value] of Object.entries(include)) { - if (!value) continue; // false → skip - const fieldDef = modelDef.fields[key]; if (!fieldDef) { throw new SchemaFactoryError(`Field "${key}" does not exist on model "${model}"`); @@ -296,9 +326,8 @@ class SchemaFactory { const fields = new Set(); if (select) { - // Only scalar fields explicitly selected with a truthy value. - for (const [key, value] of Object.entries(select)) { - if (!value) continue; + // Only scalar fields explicitly selected (value is always `true` or nested options). + for (const key of Object.keys(select)) { const fieldDef = modelDef.fields[key]; if (fieldDef && !fieldDef.relation) { fields.add(key); @@ -403,6 +432,21 @@ class SchemaFactory { ]); } + /** + * Wraps a schema with `.optional()` and copies any `description` from its + * metadata onto the resulting `ZodOptional`, so that callers inspecting + * `.meta()?.description` on shape fields still find the value after + * optionality has been applied. + */ + private wrapOptionalPreservingMeta(schema: z.ZodType): z.ZodType { + const optional = schema.optional(); + const description = schema.meta()?.description as string | undefined; + if (description) { + return optional.meta({ description }); + } + return optional; + } + private applyCardinality(schema: z.ZodType, fieldDef: FieldDef): z.ZodType { let result = schema; if (fieldDef.array) { diff --git a/packages/zod/src/types.ts b/packages/zod/src/types.ts index 2a61531b0..8dfc235a7 100644 --- a/packages/zod/src/types.ts +++ b/packages/zod/src/types.ts @@ -20,15 +20,27 @@ import type { import type Decimal from 'decimal.js'; import type z from 'zod'; +/** + * Scalar-only shape returned by the no-options `makeModelSchema` overload. + * Relation fields are excluded by default — use `include` or `select` to opt in. + */ export type GetModelFieldsShape> = { - // scalar fields [Field in GetModelFields as FieldIsRelation extends true ? never : Field]: ZodOptionalAndNullableIf< ZodArrayIf, FieldIsArray>, ModelFieldIsOptional >; -} & { +}; + +/** + * Full shape including both scalar and relation fields — used internally for + * type lookups (e.g. resolving relation field Zod types in include/select). + */ +type GetAllModelFieldsShape> = GetModelFieldsShape< + Schema, + Model +> & { // relation fields, always optional [Field in GetModelFields as FieldIsRelation extends true ? Field @@ -175,50 +187,77 @@ type RelatedModel< Field extends GetModelFields, > = GetModelFieldType extends GetModels ? GetModelFieldType : never; +/** + * Controls which fields are made optional in the generated schema. + * + * - `"all"` — every field in the schema becomes optional. + * - `"defaults"` — only fields that have a default value (`@default`) or are + * auto-managed (`@updatedAt`) are made optional; all other + * fields retain their original optionality. + */ +export type ModelSchemaOptionality = 'all' | 'defaults'; + /** * ORM-style query options accepted by `makeModelSchema`. * * Exactly mirrors the `select` / `include` / `omit` vocabulary: - * - `select` — pick specific fields (scalars and/or relations). Mutually - * exclusive with `include` and `omit`. - * - `include` — start with all scalar fields, then add the named relation - * fields. Can be combined with `omit`. - * - `omit` — remove named scalar fields from the default scalar set. - * Can be combined with `include`, mutually exclusive with - * `select`. + * - `select` — pick specific fields (scalars and/or relations). Mutually + * exclusive with `include` and `omit`. + * - `include` — start with all scalar fields, then add the named relation + * fields. Can be combined with `omit`. + * - `omit` — remove named scalar fields from the default scalar set. + * Can be combined with `include`, mutually exclusive with + * `select`. + * - `optionality` — when `"all"`, every field becomes optional. When + * `"defaults"`, only fields with a `@default` value or + * `@updatedAt` are made optional. */ export type ModelSchemaOptions> = | { /** - * Pick only the listed fields. Values can be `true` (include with + * Pick only the listed fields. Values must be `true` (include with * default shape) or a nested options object (for relation fields). + * Only `true` is accepted — ORM convention. */ select: { [Field in GetModelFields]?: FieldIsRelation extends true - ? boolean | ModelSchemaOptions> - : boolean; + ? true | ModelSchemaOptions> + : true; }; include?: never; omit?: never; + /** + * Controls which fields are made optional. + * - `"all"` — every field becomes optional. + * - `"defaults"` — only fields with `@default` or `@updatedAt` become optional. + */ + optionality?: ModelSchemaOptionality; } | { select?: never; /** * Add the listed relation fields on top of the scalar fields. - * Values can be `true` / `{}` (default shape) or a nested options - * object. + * Values must be `true` (default shape) or a nested options object. + * Only `true` is accepted — ORM convention. */ include?: { [Field in keyof RelationModelFields]?: Field extends GetModelFields - ? boolean | ModelSchemaOptions> + ? true | ModelSchemaOptions> : never; }; /** * Remove the listed scalar fields from the output. + * Only `true` is accepted — ORM convention. */ omit?: { - [Field in keyof ScalarModelFields]?: boolean; + [Field in keyof ScalarModelFields]?: true; }; + /** + * Controls which fields are made optional. + * - `"all"` — every field becomes optional. + * - `"defaults"` — only fields with `@default` or `@updatedAt` become optional. + */ + optionality?: ModelSchemaOptionality; }; // ---- Output shape helpers ------------------------------------------------ @@ -232,7 +271,7 @@ type FieldInShape< Schema extends SchemaDef, Model extends GetModels, Field extends GetModelFields, -> = Field & keyof GetModelFieldsShape; +> = Field & keyof GetAllModelFieldsShape; /** * Zod shape produced when a relation field is included via `include: { field: @@ -244,7 +283,7 @@ type RelationFieldZodDefault< Schema extends SchemaDef, Model extends GetModels, Field extends GetModelFields, -> = GetModelFieldsShape[FieldInShape]; +> = GetAllModelFieldsShape[FieldInShape]; /** * Zod shape for a relation field included with nested options. We recurse @@ -286,7 +325,7 @@ type SelectEntryToZod< // Handling `boolean` (not just literal `true`) prevents the type from // collapsing to `never` when callers use a boolean variable instead of // a literal (e.g. `const pick: boolean = true`). - GetModelFieldsShape[FieldInShape] + GetAllModelFieldsShape[FieldInShape] : Value extends object ? // nested options — must be a relation field RelationFieldZodWithOptions @@ -297,12 +336,7 @@ type SelectEntryToZod< * recursing into relations when given nested options. */ type BuildSelectShape, S extends Record> = { - [Field in keyof S & GetModelFields as S[Field] extends false ? never : Field]: SelectEntryToZod< - Schema, - Model, - Field, - S[Field] - >; + [Field in keyof S & GetModelFields]: SelectEntryToZod; }; /** @@ -316,7 +350,7 @@ type BuildIncludeOmitShape< I extends Record | undefined, O extends Record | undefined, > = - // scalar fields, omitting those explicitly excluded + // scalar fields, omitting those explicitly excluded (only `true` omits a field) { [Field in GetModelFields as FieldIsRelation extends true ? never @@ -326,34 +360,60 @@ type BuildIncludeOmitShape< ? never : Field : Field - : Field]: GetModelFieldsShape[FieldInShape]; + : Field]: GetAllModelFieldsShape[FieldInShape]; } & (I extends object // included relation fields ? { - [Field in keyof I & GetModelFields as I[Field] extends false - ? never - : Field]: I[Field] extends object + [Field in keyof I & GetModelFields]: I[Field] extends object ? RelationFieldZodWithOptions : RelationFieldZodDefault; } : // no include — empty, so the intersection is a no-op {}); +/** + * Wraps every field in a shape with `z.ZodOptional` when `Optionality` is `"all"`. + * When `Optionality` is `"defaults"`, only fields that carry a `@default` or + * `@updatedAt` attribute (as detected by `FieldHasDefault`) are wrapped. + * When `Optionality` is anything else the shape is returned as-is. + */ +type ApplyOptionality< + Shape extends Record, + Optionality, + Schema extends SchemaDef = never, + Model extends GetModels = never, +> = Optionality extends 'all' + ? { [K in keyof Shape]: z.ZodOptional } + : Optionality extends 'defaults' + ? { + [K in keyof Shape]: K extends GetModelFields + ? FieldHasDefault extends true + ? z.ZodOptional + : Shape[K] + : Shape[K]; + } + : Shape; + /** * The top-level conditional that maps options → Zod shape. * * - No options / undefined → existing `GetModelFieldsShape` (no change). - * - `{ select: S }` → `BuildSelectShape`. - * - `{ include?, omit? }` → `BuildIncludeOmitShape`. + * - `{ select: S }` → `BuildSelectShape` (+ optionality wrapper). + * - `{ include?, omit? }` → `BuildIncludeOmitShape` (+ optionality wrapper). + * + * `optionality: "defaults"` is inferred statically using `FieldHasDefault`, + * which inspects the `default` and `updatedAt` fields on `FieldDef` to + * determine which fields should become optional. */ export type GetModelSchemaShapeWithOptions< Schema extends SchemaDef, Model extends GetModels, Options, -> = Options extends { select: infer S extends Record } - ? BuildSelectShape +> = Options extends { select: infer S extends Record; optionality?: infer Opt } + ? ApplyOptionality, Opt, Schema, Model> : Options extends { include?: infer I extends Record | undefined; omit?: infer O extends Record | undefined; + optionality?: infer Opt; } - ? BuildIncludeOmitShape + ? ApplyOptionality, Opt, Schema, Model> : GetModelFieldsShape; diff --git a/packages/zod/src/utils.ts b/packages/zod/src/utils.ts index d5c9cf81a..9081c1c86 100644 --- a/packages/zod/src/utils.ts +++ b/packages/zod/src/utils.ts @@ -387,8 +387,20 @@ function evalExpression(data: any, expr: Expression): unknown { } } +/** + * Sentinel value returned by `evalField` when a field key is entirely absent + * from the data object (as opposed to being present with a `null` value). + * Used by comparison operators to skip @@validate rules against missing + * optional fields (e.g. when `optionality: 'all'` produces a partial payload). + */ +const ABSENT = Symbol('absent'); + function evalField(data: any, e: FieldExpression) { - return data?.[e.field] ?? null; + if (data == null || !(e.field in data)) { + return ABSENT; + } + // Coerce undefined to null so downstream code only needs to handle null. + return data[e.field] ?? null; } function evalUnary(data: any, expr: UnaryExpression) { @@ -410,17 +422,28 @@ function evalBinary(data: any, expr: BinaryExpression) { case '||': return Boolean(left) || Boolean(right); case '==': - return left == right; + // Treat ABSENT the same as null for equality checks — an absent + // optional field and an explicit null are semantically equivalent. + return (left === ABSENT ? null : left) == (right === ABSENT ? null : right); case '!=': - return left != right; + return (left === ABSENT ? null : left) != (right === ABSENT ? null : right); case '<': - return (left as any) < (right as any); case '<=': - return (left as any) <= (right as any); case '>': - return (left as any) > (right as any); case '>=': - return (left as any) >= (right as any); + // If either operand is the ABSENT sentinel (field not present in the + // partial payload), skip the comparison by returning true so that + // @@validate rules are not incorrectly triggered against missing + // optional fields (e.g. when optionality: 'all' produces a partial + // object or a field is omitted/not-selected). + if (left === ABSENT || right === ABSENT) return true; + return expr.op === '<' + ? (left as any) < (right as any) + : expr.op === '<=' + ? (left as any) <= (right as any) + : expr.op === '>' + ? (left as any) > (right as any) + : (left as any) >= (right as any); case '?': if (!Array.isArray(left)) { return false; @@ -464,7 +487,7 @@ function evalCall(data: any, expr: CallExpression) { switch (f) { // string functions case 'length': { - if (fieldArg === undefined || fieldArg === null) { + if (fieldArg === undefined || fieldArg === null || fieldArg === ABSENT) { return false; } invariant( @@ -476,7 +499,7 @@ function evalCall(data: any, expr: CallExpression) { case 'startsWith': case 'endsWith': case 'contains': { - if (fieldArg === undefined || fieldArg === null) { + if (fieldArg === undefined || fieldArg === null || fieldArg === ABSENT) { return false; } invariant(typeof fieldArg === 'string', `"${f}" first argument must be a string`); @@ -500,7 +523,7 @@ function evalCall(data: any, expr: CallExpression) { : applyStringOp(fieldArg, search); } case 'regex': { - if (fieldArg === undefined || fieldArg === null) { + if (fieldArg === undefined || fieldArg === null || fieldArg === ABSENT) { return false; } invariant(typeof fieldArg === 'string', `"${f}" first argument must be a string`); @@ -511,7 +534,7 @@ function evalCall(data: any, expr: CallExpression) { case 'isEmail': case 'isUrl': case 'isDateTime': { - if (fieldArg === undefined || fieldArg === null) { + if (fieldArg === undefined || fieldArg === null || fieldArg === ABSENT) { return false; } invariant(typeof fieldArg === 'string', `"${f}" first argument must be a string`); @@ -523,7 +546,7 @@ function evalCall(data: any, expr: CallExpression) { case 'hasEvery': case 'hasSome': { invariant(expr.args?.[1], `${f} requires a search argument`); - if (fieldArg === undefined || fieldArg === null) { + if (fieldArg === undefined || fieldArg === null || fieldArg === ABSENT) { return false; } invariant(Array.isArray(fieldArg), `"${f}" first argument must be an array field`); @@ -540,7 +563,7 @@ function evalCall(data: any, expr: CallExpression) { } } case 'isEmpty': { - if (fieldArg === undefined || fieldArg === null) { + if (fieldArg === undefined || fieldArg === null || fieldArg === ABSENT) { return false; } invariant(Array.isArray(fieldArg), `"${f}" first argument must be an array field`); diff --git a/packages/zod/test/factory.test.ts b/packages/zod/test/factory.test.ts index d9b38ebba..cfbdaa4cc 100644 --- a/packages/zod/test/factory.test.ts +++ b/packages/zod/test/factory.test.ts @@ -83,11 +83,8 @@ describe('SchemaFactory - makeModelSchema', () => { expectTypeOf().toEqualTypeOf(); expectTypeOf().toEqualTypeOf
(); - // relation field present - expectTypeOf().toHaveProperty('posts'); - const _postSchema = factory.makeModelSchema('Post'); - type Post = z.infer; - expectTypeOf().toEqualTypeOf(); + // relation fields are NOT present by default — use include/select to opt in + expectTypeOf().not.toHaveProperty('posts'); }); it('infers correct field types for Post', () => { @@ -117,18 +114,22 @@ describe('SchemaFactory - makeModelSchema', () => { expectTypeOf().toEqualTypeOf(); - // optional relation field present in type - expectTypeOf().toHaveProperty('author'); - const _userSchema = factory.makeModelSchema('User'); - type User = z.infer; - expectTypeOf().toEqualTypeOf(); + // relation fields are NOT present by default — use include/select to opt in + expectTypeOf().not.toHaveProperty('author'); }); - it('accepts a fully valid User', () => { + it('accepts a fully valid User (no relation fields)', () => { const userSchema = factory.makeModelSchema('User'); expect(userSchema.safeParse(validUser).success).toBe(true); }); + it('rejects relation fields in default schema (strict object)', () => { + const userSchema = factory.makeModelSchema('User'); + // relation fields are not part of the default schema, so they are rejected + const result = userSchema.safeParse({ ...validUser, posts: [] }); + expect(result.success).toBe(false); + }); + it('accepts a fully valid Post', () => { const postSchema = factory.makeModelSchema('Post'); expect(postSchema.safeParse(validPost).success).toBe(true); @@ -987,12 +988,6 @@ describe('SchemaFactory - makeModelSchema with options', () => { expectTypeOf().toEqualTypeOf(); }); - it('include: false skips the relation', () => { - const schema = factory.makeModelSchema('User', { include: { posts: false } }); - // posts field must not be in the strict schema - expect(schema.safeParse({ ...validUser, posts: [] }).success).toBe(false); - }); - it('include with nested select on relation', () => { const schema = factory.makeModelSchema('User', { include: { posts: { select: { title: true } } }, @@ -1076,12 +1071,6 @@ describe('SchemaFactory - makeModelSchema with options', () => { expectTypeOf().not.toHaveProperty('posts'); }); - it('select: false on a field excludes it', () => { - const schema = factory.makeModelSchema('User', { select: { id: true, email: false } }); - expect(schema.safeParse({ id: 'u1' }).success).toBe(true); - expect(schema.safeParse({ id: 'u1', email: 'a@b.com' }).success).toBe(false); - }); - it('select with a relation field (true) includes the relation', () => { const schema = factory.makeModelSchema('User', { select: { id: true, posts: true } }); expect(schema.safeParse({ id: 'u1', posts: [] }).success).toBe(true); @@ -1201,6 +1190,246 @@ describe('SchemaFactory - makeModelSchema with options', () => { }); }); + // ── optionality ───────────────────────────────────────────────────────── + describe('optionality', () => { + // optionality: 'all' — every field becomes optional + describe("optionality: 'all'", () => { + it('accepts an empty object when optionality is all', () => { + const schema = factory.makeModelSchema('User', { optionality: 'all' }); + expect(schema.safeParse({}).success).toBe(true); + }); + + it('accepts a fully populated object when optionality is all', () => { + const schema = factory.makeModelSchema('User', { optionality: 'all' }); + expect(schema.safeParse(validUser).success).toBe(true); + }); + + it('rejects extra fields when optionality is all (still strict)', () => { + const schema = factory.makeModelSchema('User', { optionality: 'all' }); + expect(schema.safeParse({ ...validUser, unknownField: 'x' }).success).toBe(false); + }); + + it('infers all fields as optional when optionality is all', () => { + const _schema = factory.makeModelSchema('User', { optionality: 'all' }); + type Result = z.infer; + expectTypeOf().toEqualTypeOf(); + expectTypeOf().toEqualTypeOf(); + expectTypeOf().toEqualTypeOf(); + expectTypeOf().toEqualTypeOf(); + expectTypeOf().toEqualTypeOf(); + }); + + it('still validates field constraints when the field is provided with optionality all', () => { + const schema = factory.makeModelSchema('User', { optionality: 'all' }); + // email constraint still applies when email is provided + expect(schema.safeParse({ email: 'not-an-email' }).success).toBe(false); + expect(schema.safeParse({ email: 'valid@example.com' }).success).toBe(true); + // empty object passes (all optional, null comparisons in @@validate pass through) + expect(schema.safeParse({}).success).toBe(true); + }); + + it('combines optionality all with omit', () => { + const schema = factory.makeModelSchema('User', { + omit: { username: true }, + optionality: 'all', + }); + // empty object is fine (all optional, username omitted) + expect(schema.safeParse({}).success).toBe(true); + // username must not be present (strict + omitted) + expect(schema.safeParse({ username: 'alice' }).success).toBe(false); + // other fields are optional + expect(schema.safeParse({ email: 'a@b.com' }).success).toBe(true); + }); + + it('combines optionality all with select', () => { + const schema = factory.makeModelSchema('User', { + select: { id: true, email: true }, + optionality: 'all', + }); + // both fields optional → empty passes (no @@validate fields in shape) + expect(schema.safeParse({}).success).toBe(true); + // non-selected field rejected + expect(schema.safeParse({ id: 'u1', username: 'x' }).success).toBe(false); + // subset passes + expect(schema.safeParse({ id: 'u1' }).success).toBe(true); + }); + + it('preserves @meta description on fields wrapped by optionality all', () => { + const schema = factory.makeModelSchema('User', { optionality: 'all' }); + expect(schema.shape.email.meta()?.description).toBe("The user's email address"); + }); + }); + + // optionality: 'defaults' — only fields with @default or @updatedAt become optional + describe("optionality: 'defaults'", () => { + it('makes fields with @default optional', () => { + // Product.discount has @default(0), Product.id has @default(cuid()) + // finalPrice is computed (no @default) so it must still be provided + const schema = factory.makeModelSchema('Product', { optionality: 'defaults' }); + // omitting id and discount (both have defaults) should pass + expect(schema.safeParse({ name: 'Widget', price: 10.0, finalPrice: 8.0 }).success).toBe(true); + }); + + it('keeps fields without @default required with optionality defaults', () => { + const schema = factory.makeModelSchema('Product', { optionality: 'defaults' }); + // omitting name (no default) should fail + expect(schema.safeParse({ price: 10.0, finalPrice: 8.0 }).success).toBe(false); + // omitting price (no default) should fail + expect(schema.safeParse({ name: 'Widget', finalPrice: 8.0 }).success).toBe(false); + // omitting finalPrice (computed, no default) should fail + expect(schema.safeParse({ name: 'Widget', price: 10.0 }).success).toBe(false); + }); + + it('infers fields with @default as optional and others as required', () => { + const _schema = factory.makeModelSchema('Product', { optionality: 'defaults' }); + type Result = z.infer; + // optionality: 'defaults' is now resolved statically via FieldHasDefault, + // which inspects the `default` and `updatedAt` fields on FieldDef. + // id has @default(cuid()) → optional + expectTypeOf().toEqualTypeOf(); + // discount has @default(0) → optional + expectTypeOf().toEqualTypeOf(); + // name has no default → required (unchanged) + expectTypeOf().toEqualTypeOf(); + // price has no default → required (unchanged) + expectTypeOf().toEqualTypeOf(); + }); + + it('also makes already-optional (nullable) fields optional with optionality defaults', () => { + // User.website is optional: true (nullable optional in the schema) + // optionality: 'defaults' should also make it optional in the output + const schema = factory.makeModelSchema('User', { optionality: 'defaults' }); + // website being absent should still pass since it is an optional field + const { website: _, ...withoutWebsite } = validUser; + expect(schema.safeParse(withoutWebsite).success).toBe(true); + }); + + it('combines optionality defaults with omit', () => { + // omit finalPrice (computed) and apply defaults optionality + const schema = factory.makeModelSchema('Product', { + omit: { finalPrice: true }, + optionality: 'defaults', + }); + // id and discount have defaults → optional; name and price required + expect(schema.safeParse({ name: 'Widget', price: 10.0 }).success).toBe(true); + // finalPrice must be absent + expect(schema.safeParse({ name: 'Widget', price: 10.0, finalPrice: 8.0 }).success).toBe(false); + }); + + it('combines optionality defaults with select (only selected fields apply defaults logic)', () => { + // select only `id` (has default) and `name` (no default) + const schema = factory.makeModelSchema('Product', { + select: { id: true, name: true }, + optionality: 'defaults', + }); + // id has default → optional; name has no default → required + expect(schema.safeParse({ name: 'Widget' }).success).toBe(true); + expect(schema.safeParse({}).success).toBe(false); + // non-selected field rejected + expect(schema.safeParse({ name: 'Widget', price: 10.0 }).success).toBe(false); + }); + + it('preserves @meta description on fields wrapped by optionality defaults', () => { + // id has @default, so it gets wrapped; email has no @default but has @meta + const schema = factory.makeModelSchema('User', { optionality: 'defaults' }); + expect(schema.shape.email.meta()?.description).toBe("The user's email address"); + }); + }); + + // Additional type-level assertions for optionality: 'all' + describe("optionality: 'all' — type inference", () => { + it('infers all scalar fields as optional (including already-optional)', () => { + const _schema = factory.makeModelSchema('User', { optionality: 'all' }); + type Result = z.infer; + expectTypeOf().toEqualTypeOf(); + expectTypeOf().toEqualTypeOf(); + expectTypeOf().toEqualTypeOf(); + // already-optional nullable field + expectTypeOf().toEqualTypeOf(); + }); + + it('infers omitted field absent even with optionality all', () => { + const _schema = factory.makeModelSchema('User', { + omit: { username: true }, + optionality: 'all', + }); + type Result = z.infer; + expectTypeOf().not.toHaveProperty('username'); + expectTypeOf().toEqualTypeOf(); + }); + + it('infers selected fields as optional when optionality is all', () => { + const _schema = factory.makeModelSchema('User', { + select: { id: true, email: true }, + optionality: 'all', + }); + type Result = z.infer; + expectTypeOf().toEqualTypeOf(); + expectTypeOf().toEqualTypeOf(); + expectTypeOf().not.toHaveProperty('username'); + }); + }); + + // Additional cases for optionality: 'defaults' with User model + describe("optionality: 'defaults' — User model", () => { + it('makes @default(cuid) id field optional on User', () => { + const schema = factory.makeModelSchema('User', { optionality: 'defaults' }); + const { id: _, ...withoutId } = validUser; + expect(schema.safeParse(withoutId).success).toBe(true); + }); + + it('keeps non-default fields required on User', () => { + const schema = factory.makeModelSchema('User', { optionality: 'defaults' }); + const { email: _, ...withoutEmail } = validUser; + expect(schema.safeParse(withoutEmail).success).toBe(false); + }); + + it('still accepts the full valid User object', () => { + const schema = factory.makeModelSchema('User', { optionality: 'defaults' }); + expect(schema.safeParse(validUser).success).toBe(true); + }); + + it('makes @default(autoincrement) and @default(now) fields optional on Asset', () => { + const schema = factory.makeModelSchema('Asset', { optionality: 'defaults' }); + // assetType has no default — must be provided + expect(schema.safeParse({ assetType: 'Video' }).success).toBe(true); + // omitting assetType fails + expect(schema.safeParse({}).success).toBe(false); + }); + }); + + // makeModelCreateSchema / makeModelUpdateSchema + describe('makeModelCreateSchema and makeModelUpdateSchema', () => { + it('makeModelCreateSchema makes @default fields optional', () => { + const createSchema = factory.makeModelCreateSchema('User'); + const { id: _, ...withoutId } = validUser; + expect(createSchema.safeParse(withoutId).success).toBe(true); + }); + + it('makeModelUpdateSchema makes all fields optional', () => { + const updateSchema = factory.makeModelUpdateSchema('User'); + expect(updateSchema.safeParse({}).success).toBe(true); + expect(updateSchema.safeParse({ email: 'a@b.com' }).success).toBe(true); + }); + + it('makeModelUpdateSchema still validates constraints when field is provided', () => { + const updateSchema = factory.makeModelUpdateSchema('User'); + expect(updateSchema.safeParse({ email: 'not-an-email' }).success).toBe(false); + expect(updateSchema.safeParse({ email: 'valid@example.com' }).success).toBe(true); + }); + + it('makeModelUpdateSchema preserves @meta description on fields', () => { + const updateSchema = factory.makeModelUpdateSchema('User'); + expect(updateSchema.shape.email.meta()?.description).toBe("The user's email address"); + }); + + it('makeModelCreateSchema preserves @meta description on fields', () => { + const createSchema = factory.makeModelCreateSchema('User'); + expect(createSchema.shape.email.meta()?.description).toBe("The user's email address"); + }); + }); + }); + // ── runtime error handling ──────────────────────────────────────────────── describe('runtime validation still applies with options', () => { it('@@validate still runs with omit when the referenced field is present in the shape', () => { diff --git a/packages/zod/tsdown.config.ts b/packages/zod/tsdown.config.ts new file mode 100644 index 000000000..e0a6d5624 --- /dev/null +++ b/packages/zod/tsdown.config.ts @@ -0,0 +1,3 @@ +import { createConfig } from '@zenstackhq/tsdown-config'; + +export default createConfig({ entry: { index: 'src/index.ts' } }); diff --git a/packages/zod/tsup.config.ts b/packages/zod/tsup.config.ts deleted file mode 100644 index 5a74a9dd1..000000000 --- a/packages/zod/tsup.config.ts +++ /dev/null @@ -1,13 +0,0 @@ -import { defineConfig } from 'tsup'; - -export default defineConfig({ - entry: { - index: 'src/index.ts', - }, - outDir: 'dist', - splitting: false, - sourcemap: true, - clean: true, - dts: true, - format: ['cjs', 'esm'], -}); diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index e6120102a..9f654c7e0 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -43,8 +43,8 @@ catalogs: specifier: ^10.4.3 version: 10.6.0 kysely: - specifier: ~0.28.8 - version: 0.28.8 + specifier: ~0.28.16 + version: 0.28.16 langium: specifier: 3.5.0 version: 3.5.0 @@ -130,9 +130,9 @@ importers: prisma: specifier: 'catalog:' version: 6.19.0(magicast@0.3.5)(typescript@5.9.3) - tsup: - specifier: ^8.5.0 - version: 8.5.0(@swc/core@1.12.5)(jiti@2.6.1)(postcss@8.5.6)(tsx@4.20.3)(typescript@5.9.3)(yaml@2.8.0) + tsdown: + specifier: ^0.21.8 + version: 0.21.8(typescript@5.9.3)(vue-tsc@3.2.5(typescript@5.9.3)) tsx: specifier: ^4.20.3 version: 4.20.3 @@ -169,10 +169,10 @@ importers: devDependencies: '@better-auth/cli': specifier: 1.4.19 - version: 1.4.19(@better-fetch/fetch@1.1.21)(@sveltejs/kit@2.53.2(@sveltejs/vite-plugin-svelte@6.2.1(svelte@5.53.5)(vite@7.3.1(@types/node@25.5.2)(jiti@2.6.1)(lightningcss@1.30.2)(terser@5.44.0)(tsx@4.20.3)(yaml@2.8.2)))(svelte@5.53.5)(typescript@5.9.3)(vite@7.3.1(@types/node@25.5.2)(jiti@2.6.1)(lightningcss@1.30.2)(terser@5.44.0)(tsx@4.20.3)(yaml@2.8.2)))(@types/better-sqlite3@7.6.13)(@types/sql.js@1.4.9)(better-call@1.1.8(zod@4.3.6))(bun-types@1.3.3)(jose@6.1.2)(kysely@0.28.8)(magicast@0.5.1)(mysql2@3.16.1)(nanostores@1.0.1)(next@16.1.6(@babel/core@7.29.0)(react-dom@19.2.0(react@19.2.0))(react@19.2.0))(prisma@6.19.0(magicast@0.5.1)(typescript@5.9.3))(react-dom@19.2.0(react@19.2.0))(react@19.2.0)(sql.js@1.13.0)(svelte@5.53.5)(vitest@4.0.14(@edge-runtime/vm@5.0.0)(@types/node@25.5.2)(happy-dom@20.8.9)(jiti@2.6.1)(jsdom@27.1.0)(lightningcss@1.30.2)(terser@5.44.0)(tsx@4.20.3)(yaml@2.8.2))(vue@3.5.29(typescript@5.9.3)) + version: 1.4.19(@better-fetch/fetch@1.1.21)(@sveltejs/kit@2.53.2(@sveltejs/vite-plugin-svelte@6.2.1(svelte@5.53.5)(vite@7.3.1(@types/node@25.5.2)(jiti@2.6.1)(lightningcss@1.30.2)(terser@5.44.0)(tsx@4.20.3)(yaml@2.8.2)))(svelte@5.53.5)(typescript@5.9.3)(vite@7.3.1(@types/node@25.5.2)(jiti@2.6.1)(lightningcss@1.30.2)(terser@5.44.0)(tsx@4.20.3)(yaml@2.8.2)))(@types/better-sqlite3@7.6.13)(@types/sql.js@1.4.9)(better-call@1.1.8(zod@4.3.6))(bun-types@1.3.3)(jose@6.1.2)(kysely@0.28.16)(magicast@0.5.1)(mysql2@3.16.1)(nanostores@1.0.1)(next@16.1.6(@babel/core@7.29.0)(react-dom@19.2.0(react@19.2.0))(react@19.2.0))(prisma@6.19.0(magicast@0.5.1)(typescript@5.9.3))(react-dom@19.2.0(react@19.2.0))(react@19.2.0)(sql.js@1.13.0)(svelte@5.53.5)(vitest@4.0.14(@edge-runtime/vm@5.0.0)(@types/node@25.5.2)(happy-dom@20.8.9)(jiti@2.6.1)(jsdom@27.1.0)(lightningcss@1.30.2)(terser@5.44.0)(tsx@4.20.3)(yaml@2.8.2))(vue@3.5.29(typescript@5.9.3)) '@better-auth/core': specifier: 1.4.19 - version: 1.4.19(@better-auth/utils@0.3.0)(@better-fetch/fetch@1.1.21)(better-call@1.1.8(zod@4.3.6))(jose@6.1.2)(kysely@0.28.8)(nanostores@1.0.1) + version: 1.4.19(@better-auth/utils@0.3.0)(@better-fetch/fetch@1.1.21)(better-call@1.1.8(zod@4.3.6))(jose@6.1.2)(kysely@0.28.16)(nanostores@1.0.1) '@types/tmp': specifier: 'catalog:' version: 0.2.6 @@ -182,6 +182,9 @@ importers: '@zenstackhq/eslint-config': specifier: workspace:* version: link:../../config/eslint-config + '@zenstackhq/tsdown-config': + specifier: workspace:* + version: link:../../config/tsdown-config '@zenstackhq/typescript-config': specifier: workspace:* version: link:../../config/typescript-config @@ -190,7 +193,10 @@ importers: version: link:../../config/vitest-config better-auth: specifier: 1.4.19 - version: 1.4.19(9698e865c69f9d604fb4edbe7906cba1) + version: 1.4.19(f276412306c0f31e69da8456c8cd9497) + kysely: + specifier: 'catalog:' + version: 0.28.16 tmp: specifier: 'catalog:' version: 0.2.5 @@ -300,6 +306,9 @@ importers: '@zenstackhq/testtools': specifier: workspace:* version: link:../testtools + '@zenstackhq/tsdown-config': + specifier: workspace:* + version: link:../config/tsdown-config '@zenstackhq/typescript-config': specifier: workspace:* version: link:../config/typescript-config @@ -315,6 +324,9 @@ importers: '@zenstackhq/common-helpers': specifier: workspace:* version: link:../../common-helpers + '@zenstackhq/orm': + specifier: workspace:* + version: link:../../orm '@zenstackhq/schema': specifier: workspace:* version: link:../../schema @@ -325,18 +337,15 @@ importers: specifier: ^2.2.3 version: 2.2.3 devDependencies: + '@types/node': + specifier: 'catalog:' + version: 20.19.24 '@zenstackhq/eslint-config': specifier: workspace:* version: link:../../config/eslint-config - '@zenstackhq/language': - specifier: workspace:* - version: link:../../language - '@zenstackhq/orm': - specifier: workspace:* - version: link:../../orm - '@zenstackhq/sdk': + '@zenstackhq/tsdown-config': specifier: workspace:* - version: link:../../sdk + version: link:../../config/tsdown-config '@zenstackhq/typescript-config': specifier: workspace:* version: link:../../config/typescript-config @@ -413,6 +422,9 @@ importers: react: specifier: 'catalog:' version: 19.2.0 + rimraf: + specifier: ^6.1.3 + version: 6.1.3 svelte: specifier: 'catalog:' version: 5.53.5 @@ -422,9 +434,15 @@ importers: packages/common-helpers: devDependencies: + '@types/node': + specifier: 'catalog:' + version: 20.19.24 '@zenstackhq/eslint-config': specifier: workspace:* version: link:../config/eslint-config + '@zenstackhq/tsdown-config': + specifier: workspace:* + version: link:../config/tsdown-config '@zenstackhq/typescript-config': specifier: workspace:* version: link:../config/typescript-config @@ -434,6 +452,12 @@ importers: packages/config/eslint-config: {} + packages/config/tsdown-config: + devDependencies: + '@zenstackhq/typescript-config': + specifier: workspace:* + version: link:../typescript-config + packages/config/typescript-config: {} packages/config/vitest-config: {} @@ -450,9 +474,15 @@ importers: specifier: ^5.4.1 version: 5.4.1 devDependencies: + '@types/node': + specifier: 'catalog:' + version: 20.19.24 '@zenstackhq/eslint-config': specifier: workspace:* version: link:../config/eslint-config + '@zenstackhq/tsdown-config': + specifier: workspace:* + version: link:../config/tsdown-config '@zenstackhq/typescript-config': specifier: workspace:* version: link:../config/typescript-config @@ -490,6 +520,9 @@ importers: '@zenstackhq/eslint-config': specifier: workspace:* version: link:../../config/eslint-config + '@zenstackhq/tsdown-config': + specifier: workspace:* + version: link:../../config/tsdown-config '@zenstackhq/typescript-config': specifier: workspace:* version: link:../../config/typescript-config @@ -524,6 +557,9 @@ importers: '@zenstackhq/eslint-config': specifier: workspace:* version: link:../config/eslint-config + '@zenstackhq/tsdown-config': + specifier: workspace:* + version: link:../config/tsdown-config '@zenstackhq/typescript-config': specifier: workspace:* version: link:../config/typescript-config @@ -568,7 +604,7 @@ importers: version: 1.3.0 kysely: specifier: 'catalog:' - version: 0.28.8 + version: 0.28.16 mysql2: specifier: 'catalog:' version: 3.16.1 @@ -615,6 +651,9 @@ importers: '@zenstackhq/eslint-config': specifier: workspace:* version: link:../config/eslint-config + '@zenstackhq/tsdown-config': + specifier: workspace:* + version: link:../config/tsdown-config '@zenstackhq/typescript-config': specifier: workspace:* version: link:../config/typescript-config @@ -638,7 +677,7 @@ importers: version: link:../../orm kysely: specifier: 'catalog:' - version: 0.28.8 + version: 0.28.16 ts-pattern: specifier: 'catalog:' version: 5.7.1 @@ -652,6 +691,9 @@ importers: '@zenstackhq/eslint-config': specifier: workspace:* version: link:../../config/eslint-config + '@zenstackhq/tsdown-config': + specifier: workspace:* + version: link:../../config/tsdown-config '@zenstackhq/typescript-config': specifier: workspace:* version: link:../../config/typescript-config @@ -668,6 +710,9 @@ importers: '@zenstackhq/eslint-config': specifier: workspace:* version: link:../config/eslint-config + '@zenstackhq/tsdown-config': + specifier: workspace:* + version: link:../config/tsdown-config '@zenstackhq/typescript-config': specifier: workspace:* version: link:../config/typescript-config @@ -693,9 +738,15 @@ importers: specifier: 'catalog:' version: 5.9.3 devDependencies: + '@types/node': + specifier: 'catalog:' + version: 20.19.24 '@zenstackhq/eslint-config': specifier: workspace:* version: link:../config/eslint-config + '@zenstackhq/tsdown-config': + specifier: workspace:* + version: link:../config/tsdown-config '@zenstackhq/typescript-config': specifier: workspace:* version: link:../config/typescript-config @@ -704,7 +755,7 @@ importers: version: 10.6.0 kysely: specifier: 'catalog:' - version: 0.28.8 + version: 0.28.16 packages/server: dependencies: @@ -757,6 +808,9 @@ importers: '@zenstackhq/testtools': specifier: workspace:* version: link:../testtools + '@zenstackhq/tsdown-config': + specifier: workspace:* + version: link:../config/tsdown-config '@zenstackhq/typescript-config': specifier: workspace:* version: link:../config/typescript-config @@ -789,7 +843,7 @@ importers: version: 16.1.6(@babel/core@7.29.0)(react-dom@19.2.0(react@19.2.0))(react@19.2.0) nuxt: specifier: 'catalog:' - version: 4.3.1(cfda133a7eabcf873b5dad9c91eb52c2) + version: 4.3.1(c09e06bbcbcd2b0a94c9a804d2c88498) supertest: specifier: ^7.1.4 version: 7.1.4 @@ -825,7 +879,7 @@ importers: version: 11.1.0 kysely: specifier: 'catalog:' - version: 0.28.8 + version: 0.28.16 mysql2: specifier: 'catalog:' version: 3.16.1 @@ -857,6 +911,9 @@ importers: '@zenstackhq/eslint-config': specifier: workspace:* version: link:../config/eslint-config + '@zenstackhq/tsdown-config': + specifier: workspace:* + version: link:../config/tsdown-config '@zenstackhq/typescript-config': specifier: workspace:* version: link:../config/typescript-config @@ -876,6 +933,9 @@ importers: '@zenstackhq/eslint-config': specifier: workspace:* version: link:../config/eslint-config + '@zenstackhq/tsdown-config': + specifier: workspace:* + version: link:../config/tsdown-config '@zenstackhq/typescript-config': specifier: workspace:* version: link:../config/typescript-config @@ -908,7 +968,7 @@ importers: version: 12.5.0 kysely: specifier: 'catalog:' - version: 0.28.8 + version: 0.28.16 lorem-ipsum: specifier: ^2.0.8 version: 2.0.8 @@ -981,7 +1041,7 @@ importers: version: 2.0.8 nuxt: specifier: 'catalog:' - version: 4.3.1(cfda133a7eabcf873b5dad9c91eb52c2) + version: 4.3.1(c09e06bbcbcd2b0a94c9a804d2c88498) tailwindcss: specifier: ^4.1.18 version: 4.1.18 @@ -1018,7 +1078,7 @@ importers: version: 12.5.0 kysely: specifier: 'catalog:' - version: 0.28.8 + version: 0.28.16 zod: specifier: 'catalog:' version: 4.1.12 @@ -1058,7 +1118,7 @@ importers: version: 12.5.0 kysely: specifier: 'catalog:' - version: 0.28.8 + version: 0.28.16 lorem-ipsum: specifier: ^2.0.8 version: 2.0.8 @@ -1143,7 +1203,7 @@ importers: version: 10.6.0 kysely: specifier: 'catalog:' - version: 0.28.8 + version: 0.28.16 ts-pattern: specifier: 'catalog:' version: 5.7.1 @@ -1172,6 +1232,9 @@ importers: decimal.js: specifier: 'catalog:' version: 10.6.0 + zod: + specifier: 'catalog:' + version: 4.1.12 devDependencies: '@types/node': specifier: 'catalog:' @@ -1200,6 +1263,9 @@ importers: '@zenstackhq/vitest-config': specifier: workspace:* version: link:../../packages/config/vitest-config + '@zenstackhq/zod': + specifier: workspace:* + version: link:../../packages/zod tests/runtimes/bun: dependencies: @@ -1223,10 +1289,10 @@ importers: version: link:../../../packages/testtools kysely: specifier: 'catalog:' - version: 0.28.8 + version: 0.28.16 kysely-bun-sqlite: specifier: ^0.4.0 - version: 0.4.0(kysely@0.28.8) + version: 0.4.0(kysely@0.28.16) pg: specifier: 'catalog:' version: 8.16.3 @@ -1342,6 +1408,10 @@ packages: resolution: {integrity: sha512-qsaF+9Qcm2Qv8SRIMMscAvG4O3lJ0F1GuMo5HR/Bp02LopNgnZBC/EkbevHFeGs4ls/oPz9v+Bsmzbkbe+0dUw==} engines: {node: '>=6.9.0'} + '@babel/generator@8.0.0-rc.3': + resolution: {integrity: sha512-em37/13/nR320G4jab/nIIHZgc2Wz2y/D39lxnTyxB4/D/omPQncl/lSdlnJY1OhQcRGugTSIF2l/69o31C9dA==} + engines: {node: ^20.19.0 || >=22.12.0} + '@babel/helper-annotate-as-pure@7.27.3': resolution: {integrity: sha512-fXSwMQqitTGeHLBC08Eq5yXz2m37E4pJX1qAU1+2cNedz/ifv/bVXft90VeSav5nFO61EcNgwr0aJxbyPaWBPg==} engines: {node: '>=6.9.0'} @@ -1410,10 +1480,18 @@ packages: resolution: {integrity: sha512-qMlSxKbpRlAridDExk92nSobyDdpPijUq2DW6oDnUqd0iOGxmQjyqhMIihI9+zv4LPyZdRje2cavWPbCbWm3eA==} engines: {node: '>=6.9.0'} + '@babel/helper-string-parser@8.0.0-rc.3': + resolution: {integrity: sha512-AmwWFx1m8G/a5cXkxLxTiWl+YEoWuoFLUCwqMlNuWO1tqAYITQAbCRPUkyBHv1VOFgfjVOqEj6L3u15J5ZCzTA==} + engines: {node: ^20.19.0 || >=22.12.0} + '@babel/helper-validator-identifier@7.28.5': resolution: {integrity: sha512-qSs4ifwzKJSV39ucNjsvc6WVHs6b7S03sOh2OcHF9UHfVPqWWALUsNUVzhSBiItjRZoLHx7nIarVjqKVusUZ1Q==} engines: {node: '>=6.9.0'} + '@babel/helper-validator-identifier@8.0.0-rc.3': + resolution: {integrity: sha512-8AWCJ2VJJyDFlGBep5GpaaQ9AAaE/FjAcrqI7jyssYhtL7WGV0DOKpJsQqM037xDbpRLHXsY8TwU7zDma7coOw==} + engines: {node: ^20.19.0 || >=22.12.0} + '@babel/helper-validator-option@7.27.1': resolution: {integrity: sha512-YvjJow9FxbhFFKDSuFnVCe2WxXk1zWc22fFePVNEaWJEu8IrZVlda6N0uHwzZrUM1il7NC9Mlp4MaJYbYd9JSg==} engines: {node: '>=6.9.0'} @@ -1446,6 +1524,11 @@ packages: engines: {node: '>=6.0.0'} hasBin: true + '@babel/parser@8.0.0-rc.3': + resolution: {integrity: sha512-B20dvP3MfNc/XS5KKCHy/oyWl5IA6Cn9YjXRdDlCjNmUFrjvLXMNUfQq/QUy9fnG2gYkKKcrto2YaF9B32ToOQ==} + engines: {node: ^20.19.0 || >=22.12.0} + hasBin: true + '@babel/plugin-syntax-jsx@7.28.6': resolution: {integrity: sha512-wgEmr06G6sIpqr8YDwA2dSRTE3bJ+V0IfpzfSY3Lfgd7YWOaAdlykvJi13ZKBt8cZHfgH1IXN+CL656W3uUa4w==} engines: {node: '>=6.9.0'} @@ -1542,6 +1625,10 @@ packages: resolution: {integrity: sha512-LwdZHpScM4Qz8Xw2iKSzS+cfglZzJGvofQICy7W7v4caru4EaAmyUuO6BGrbyQ2mYV11W0U8j5mBhd14dd3B0A==} engines: {node: '>=6.9.0'} + '@babel/types@8.0.0-rc.3': + resolution: {integrity: sha512-mOm5ZrYmphGfqVWoH5YYMTITb3cDXsFgmvFlvkvWDMsR9X8RFnt7a0Wb6yNIdoFsiMO9WjYLq+U/FMtqIYAF8Q==} + engines: {node: ^20.19.0 || >=22.12.0} + '@bcoe/v8-coverage@1.0.2': resolution: {integrity: sha512-6zABk/ECA/QYSCQ1NGiVwwbQerUCZ+TQbp64Q3AgmfNvurHH0j8TtXa1qbShXA6qqkpAj4V5W8pP6mLe1mcMqA==} engines: {node: '>=18'} @@ -1688,12 +1775,21 @@ packages: '@emnapi/core@1.7.1': resolution: {integrity: sha512-o1uhUASyo921r2XtHYOHy7gdkGLge8ghBEQHMWmyJFoXlpU58kIrhhN3w26lpQb6dspetweapMn2CSNwQ8I4wg==} + '@emnapi/core@1.9.2': + resolution: {integrity: sha512-UC+ZhH3XtczQYfOlu3lNEkdW/p4dsJ1r/bP7H8+rhao3TTTMO1ATq/4DdIi23XuGoFY+Cz0JmCbdVl0hz9jZcA==} + '@emnapi/runtime@1.7.1': resolution: {integrity: sha512-PVtJr5CmLwYAU9PZDMITZoR5iAOShYREoR45EyyLrbntV50mdePTgUn4AmOw90Ifcj+x2kRjdzr1HP3RrNiHGA==} + '@emnapi/runtime@1.9.2': + resolution: {integrity: sha512-3U4+MIWHImeyu1wnmVygh5WlgfYDtyf0k8AbLhMFxOipihf6nrWC4syIm/SwEeec0mNSafiiNnMJwbza/Is6Lw==} + '@emnapi/wasi-threads@1.1.0': resolution: {integrity: sha512-WI0DdZ8xFSbgMjR1sFsKABJ/C5OnRrjT06JXbZKexJGrDuPTzZdDYfFlsgcCXCyf+suG5QU2e/y1Wo2V/OapLQ==} + '@emnapi/wasi-threads@1.2.1': + resolution: {integrity: sha512-uTII7OYF+/Mes/MrcIOYp5yOtSMLBWSIoLPpcgwipoiKbli6k322tcoFsxoIIxPDqW01SQGAgko4EzZi2BNv2w==} + '@esbuild/aix-ppc64@0.25.5': resolution: {integrity: sha512-9o3TMmpmftaCMepOdA5k/yDw8SfInyzWWTjYTFCX3kPSDJMROQTb8jg+h9Cnwnmm1vOzvxN7gIfB5V2ewpjtGA==} engines: {node: '>=18'} @@ -2270,78 +2366,92 @@ packages: resolution: {integrity: sha512-I4RxkXU90cpufazhGPyVujYwfIm9Nk1QDEmiIsaPwdnm013F7RIceaCc87kAH+oUB1ezqEvC6ga4m7MSlqsJvQ==} cpu: [arm64] os: [linux] + libc: [glibc] '@img/sharp-libvips-linux-arm@1.2.3': resolution: {integrity: sha512-x1uE93lyP6wEwGvgAIV0gP6zmaL/a0tGzJs/BIDDG0zeBhMnuUPm7ptxGhUbcGs4okDJrk4nxgrmxpib9g6HpA==} cpu: [arm] os: [linux] + libc: [glibc] '@img/sharp-libvips-linux-ppc64@1.2.3': resolution: {integrity: sha512-Y2T7IsQvJLMCBM+pmPbM3bKT/yYJvVtLJGfCs4Sp95SjvnFIjynbjzsa7dY1fRJX45FTSfDksbTp6AGWudiyCg==} cpu: [ppc64] os: [linux] + libc: [glibc] '@img/sharp-libvips-linux-s390x@1.2.3': resolution: {integrity: sha512-RgWrs/gVU7f+K7P+KeHFaBAJlNkD1nIZuVXdQv6S+fNA6syCcoboNjsV2Pou7zNlVdNQoQUpQTk8SWDHUA3y/w==} cpu: [s390x] os: [linux] + libc: [glibc] '@img/sharp-libvips-linux-x64@1.2.3': resolution: {integrity: sha512-3JU7LmR85K6bBiRzSUc/Ff9JBVIFVvq6bomKE0e63UXGeRw2HPVEjoJke1Yx+iU4rL7/7kUjES4dZ/81Qjhyxg==} cpu: [x64] os: [linux] + libc: [glibc] '@img/sharp-libvips-linuxmusl-arm64@1.2.3': resolution: {integrity: sha512-F9q83RZ8yaCwENw1GieztSfj5msz7GGykG/BA+MOUefvER69K/ubgFHNeSyUu64amHIYKGDs4sRCMzXVj8sEyw==} cpu: [arm64] os: [linux] + libc: [musl] '@img/sharp-libvips-linuxmusl-x64@1.2.3': resolution: {integrity: sha512-U5PUY5jbc45ANM6tSJpsgqmBF/VsL6LnxJmIf11kB7J5DctHgqm0SkuXzVWtIY90GnJxKnC/JT251TDnk1fu/g==} cpu: [x64] os: [linux] + libc: [musl] '@img/sharp-linux-arm64@0.34.4': resolution: {integrity: sha512-YXU1F/mN/Wu786tl72CyJjP/Ngl8mGHN1hST4BGl+hiW5jhCnV2uRVTNOcaYPs73NeT/H8Upm3y9582JVuZHrQ==} engines: {node: ^18.17.0 || ^20.3.0 || >=21.0.0} cpu: [arm64] os: [linux] + libc: [glibc] '@img/sharp-linux-arm@0.34.4': resolution: {integrity: sha512-Xyam4mlqM0KkTHYVSuc6wXRmM7LGN0P12li03jAnZ3EJWZqj83+hi8Y9UxZUbxsgsK1qOEwg7O0Bc0LjqQVtxA==} engines: {node: ^18.17.0 || ^20.3.0 || >=21.0.0} cpu: [arm] os: [linux] + libc: [glibc] '@img/sharp-linux-ppc64@0.34.4': resolution: {integrity: sha512-F4PDtF4Cy8L8hXA2p3TO6s4aDt93v+LKmpcYFLAVdkkD3hSxZzee0rh6/+94FpAynsuMpLX5h+LRsSG3rIciUQ==} engines: {node: ^18.17.0 || ^20.3.0 || >=21.0.0} cpu: [ppc64] os: [linux] + libc: [glibc] '@img/sharp-linux-s390x@0.34.4': resolution: {integrity: sha512-qVrZKE9Bsnzy+myf7lFKvng6bQzhNUAYcVORq2P7bDlvmF6u2sCmK2KyEQEBdYk+u3T01pVsPrkj943T1aJAsw==} engines: {node: ^18.17.0 || ^20.3.0 || >=21.0.0} cpu: [s390x] os: [linux] + libc: [glibc] '@img/sharp-linux-x64@0.34.4': resolution: {integrity: sha512-ZfGtcp2xS51iG79c6Vhw9CWqQC8l2Ot8dygxoDoIQPTat/Ov3qAa8qpxSrtAEAJW+UjTXc4yxCjNfxm4h6Xm2A==} engines: {node: ^18.17.0 || ^20.3.0 || >=21.0.0} cpu: [x64] os: [linux] + libc: [glibc] '@img/sharp-linuxmusl-arm64@0.34.4': resolution: {integrity: sha512-8hDVvW9eu4yHWnjaOOR8kHVrew1iIX+MUgwxSuH2XyYeNRtLUe4VNioSqbNkB7ZYQJj9rUTT4PyRscyk2PXFKA==} engines: {node: ^18.17.0 || ^20.3.0 || >=21.0.0} cpu: [arm64] os: [linux] + libc: [musl] '@img/sharp-linuxmusl-x64@0.34.4': resolution: {integrity: sha512-lU0aA5L8QTlfKjpDCEFOZsTYGn3AEiO6db8W5aQDxj0nQkVrZWmN3ZP9sYKWJdtq3PWPhUNlqehWyXpYDcI9Sg==} engines: {node: ^18.17.0 || ^20.3.0 || >=21.0.0} cpu: [x64] os: [linux] + libc: [musl] '@img/sharp-wasm32@0.34.4': resolution: {integrity: sha512-33QL6ZO/qpRyG7woB/HUALz28WnTMI2W1jgX3Nu2bypqLIKx/QKMILLJzJjI+SIbvXdG9fUnmrxR7vbi1sTBeA==} @@ -2380,10 +2490,6 @@ packages: '@jridgewell/gen-mapping@0.3.13': resolution: {integrity: sha512-2kkt/7niJ6MgEPxF0bYdQ6etZaA+fQvDcLKckhy1yIQOzaoKjBBjSj63/aLVjYE3qhRt5dvM+uUyfCg6UKCBbA==} - '@jridgewell/gen-mapping@0.3.8': - resolution: {integrity: sha512-imAbBGkb+ebQyxKgzv5Hu2nmROxoDOXHh80evxdoXNOrvAnVx7zimzc1Oo5h9RlfV4vPXaE2iM5pOFbvOCClWA==} - engines: {node: '>=6.0.0'} - '@jridgewell/remapping@2.3.5': resolution: {integrity: sha512-LI9u/+laYG4Ds1TDKSJW2YPrIlcVYOwi2fUC6xB43lueCjgxV4lffOCZCtYFiH6TNOX+tQKXx97T4IKHbhyHEQ==} @@ -2391,22 +2497,12 @@ packages: resolution: {integrity: sha512-bRISgCIjP20/tbWSPWMEi54QVPRZExkuD9lJL+UIxUKtwVJA8wW1Trb1jMs1RFXo1CBTNZ/5hpC9QvmKWdopKw==} engines: {node: '>=6.0.0'} - '@jridgewell/set-array@1.2.1': - resolution: {integrity: sha512-R8gLRTZeyp03ymzP/6Lil/28tGeGEzhx1q2k703KGWRAI1VdvPIXdG70VJc2pAMw3NA6JKL5hhFu1sJX0Mnn/A==} - engines: {node: '>=6.0.0'} - '@jridgewell/source-map@0.3.11': resolution: {integrity: sha512-ZMp1V8ZFcPG5dIWnQLr3NSI1MiCU7UETdS/A0G8V/XWHvJv3ZsFqutJn1Y5RPmAPX6F3BiE397OqveU/9NCuIA==} - '@jridgewell/sourcemap-codec@1.5.0': - resolution: {integrity: sha512-gv3ZRaISU3fjPAgNsriBRqGWQL6quFx04YMPW/zD8XMLsU32mhCCbfbO6KZFLjvYpCZ8zyDEgqsgf+PwPaM7GQ==} - '@jridgewell/sourcemap-codec@1.5.5': resolution: {integrity: sha512-cYQ9310grqxueWbl+WuIUIaiUaDcj7WOq5fVhEljNVgRfOUhY9fy2zTvfoqWsnebh8Sl70VScFbICvJnLKB0Og==} - '@jridgewell/trace-mapping@0.3.25': - resolution: {integrity: sha512-vNk6aEwybGtawWmy/PzwnGDOjCkLWSD2wqvjGGAgOAwCGWySYXfYoxt00IJkTF+8Lb57DwOb3Aa0o9CApepiYQ==} - '@jridgewell/trace-mapping@0.3.31': resolution: {integrity: sha512-zzNR+SdQSDJzc8joaeP8QQoCQr8NuYx2dIIytl1QeBEZHJ9uW6hebsrYgbz8hJwUQao3TWCMtmfV8Nu1twOLAw==} @@ -2435,6 +2531,12 @@ packages: '@napi-rs/wasm-runtime@1.1.1': resolution: {integrity: sha512-p64ah1M1ld8xjWv3qbvFwHiFVWrq1yFvV4f7w+mzaqiR4IlSgkqhcRdHwsGgomwzBH51sRY4NEowLxnaBjcW/A==} + '@napi-rs/wasm-runtime@1.1.3': + resolution: {integrity: sha512-xK9sGVbJWYb08+mTJt3/YV24WxvxpXcXtP6B172paPZ+Ts69Re9dAr7lKwJoeIx8OoeuimEiRZ7umkiUVClmmQ==} + peerDependencies: + '@emnapi/core': ^1.7.1 + '@emnapi/runtime': ^1.7.1 + '@next/env@16.1.6': resolution: {integrity: sha512-N1ySLuZjnAtN3kFnwhAwPvZah8RJxKasD7x1f8shFqhncnWZn4JMfg37diLNuoHsLAlrDfM3g4mawVdtAG8XLQ==} @@ -2458,24 +2560,28 @@ packages: engines: {node: '>= 10'} cpu: [arm64] os: [linux] + libc: [glibc] '@next/swc-linux-arm64-musl@16.1.6': resolution: {integrity: sha512-S4J2v+8tT3NIO9u2q+S0G5KdvNDjXfAv06OhfOzNDaBn5rw84DGXWndOEB7d5/x852A20sW1M56vhC/tRVbccQ==} engines: {node: '>= 10'} cpu: [arm64] os: [linux] + libc: [musl] '@next/swc-linux-x64-gnu@16.1.6': resolution: {integrity: sha512-2eEBDkFlMMNQnkTyPBhQOAyn2qMxyG2eE7GPH2WIDGEpEILcBPI/jdSv4t6xupSP+ot/jkfrCShLAa7+ZUPcJQ==} engines: {node: '>= 10'} cpu: [x64] os: [linux] + libc: [glibc] '@next/swc-linux-x64-musl@16.1.6': resolution: {integrity: sha512-oicJwRlyOoZXVlxmIMaTq7f8pN9QNbdes0q2FXfRsPhfCi8n8JmOZJm5oo1pwDaFbnnD421rVU409M3evFbIqg==} engines: {node: '>= 10'} cpu: [x64] os: [linux] + libc: [musl] '@next/swc-win32-arm64-msvc@16.1.6': resolution: {integrity: sha512-gQmm8izDTPgs+DCWH22kcDmuUp7NyiJgEl18bcr8irXA5N2m2O+JQIr6f3ct42GOs9c0h8QF3L5SzIxcYAAXXw==} @@ -2637,48 +2743,56 @@ packages: engines: {node: ^20.19.0 || >=22.12.0} cpu: [arm64] os: [linux] + libc: [glibc] '@oxc-minify/binding-linux-arm64-musl@0.112.0': resolution: {integrity: sha512-IRFMZX589lr3rjG0jc8N261/7wqFq2Vl0OMrJWeFls5BF8HiB+fRYuf0Zy2CyRH6NCY2vbdDdp+QCAavQGVsGw==} engines: {node: ^20.19.0 || >=22.12.0} cpu: [arm64] os: [linux] + libc: [musl] '@oxc-minify/binding-linux-ppc64-gnu@0.112.0': resolution: {integrity: sha512-V/69XqIW9hCUceDpcZh79oDg+F4ptEgIfKRENzYs41LRbSoJ7sNjjcW4zifqyviTvzcnXLgK4uoTyoymmNZBMQ==} engines: {node: ^20.19.0 || >=22.12.0} cpu: [ppc64] os: [linux] + libc: [glibc] '@oxc-minify/binding-linux-riscv64-gnu@0.112.0': resolution: {integrity: sha512-zghvexySyGXGNW+MutjZN7UGTyOQl56RWMlPe1gb+knBm/+0hf9qjk7Q6ofm2tSte+vQolPfQttifGl0dP9uvQ==} engines: {node: ^20.19.0 || >=22.12.0} cpu: [riscv64] os: [linux] + libc: [glibc] '@oxc-minify/binding-linux-riscv64-musl@0.112.0': resolution: {integrity: sha512-E4a8VUFDJPb2mPcc7J4NQQPi1ssHKF7/g4r6KD2+SBVERIaEEd3cGNqR7SG3g82/BLGV2UDoQe/WvZCkt5M/bQ==} engines: {node: ^20.19.0 || >=22.12.0} cpu: [riscv64] os: [linux] + libc: [musl] '@oxc-minify/binding-linux-s390x-gnu@0.112.0': resolution: {integrity: sha512-2Hx87sK3y6jBV364Mvv0zyxiITIuy26Ixenv6pK7e+4an3HgNdhAj8nk3aLoLTTSvLik5/MaGhcZGEu9tYV1aA==} engines: {node: ^20.19.0 || >=22.12.0} cpu: [s390x] os: [linux] + libc: [glibc] '@oxc-minify/binding-linux-x64-gnu@0.112.0': resolution: {integrity: sha512-2MSCnEPLk9ddSouMhJo78Xy2/JbYC80OYzWdR4yWTGSULsgH3d1VXg73DSwFL8vU7Ad9oK10DioBY2ww7sQTEg==} engines: {node: ^20.19.0 || >=22.12.0} cpu: [x64] os: [linux] + libc: [glibc] '@oxc-minify/binding-linux-x64-musl@0.112.0': resolution: {integrity: sha512-HAPfmQKlkVi97/zRonVE9t/kKUG3ni+mOuU1Euw+3s37KwUuOJjmcwXdclVgXKBlTkCGO0FajPwW5dAJeIXCCw==} engines: {node: ^20.19.0 || >=22.12.0} cpu: [x64] os: [linux] + libc: [musl] '@oxc-minify/binding-openharmony-arm64@0.112.0': resolution: {integrity: sha512-bLnMojcPadYzMNpB6IAqMiTOag4etc0zbs8On73JsotO1W5c5/j/ncplpSokpEpNasKRUpHVRXpmq0KRXprNhw==} @@ -2756,48 +2870,56 @@ packages: engines: {node: ^20.19.0 || >=22.12.0} cpu: [arm64] os: [linux] + libc: [glibc] '@oxc-parser/binding-linux-arm64-musl@0.112.0': resolution: {integrity: sha512-3R0iqjM3xYOZCnwgcxOQXH7hrz64/USDIuLbNTM1kZqQzRqaR4w7SwoWKU934zABo8d0op2oSwOp+CV3hZnM7A==} engines: {node: ^20.19.0 || >=22.12.0} cpu: [arm64] os: [linux] + libc: [musl] '@oxc-parser/binding-linux-ppc64-gnu@0.112.0': resolution: {integrity: sha512-lAQf8PQxfgy7h0bmcfSVE3hg3qMueshPYULFsCrHM+8KefGZ9W+ZMvRyU33gLrB4w1O3Fz1orR0hmKMCRxXNrQ==} engines: {node: ^20.19.0 || >=22.12.0} cpu: [ppc64] os: [linux] + libc: [glibc] '@oxc-parser/binding-linux-riscv64-gnu@0.112.0': resolution: {integrity: sha512-2QlvQBUhHuAE3ezD4X3CAEKMXdfgInggQ5Bj/7gb5NcYP3GyfLTj7c+mMu+BRwfC9B3AXBNyqHWbqEuuUvZyRQ==} engines: {node: ^20.19.0 || >=22.12.0} cpu: [riscv64] os: [linux] + libc: [glibc] '@oxc-parser/binding-linux-riscv64-musl@0.112.0': resolution: {integrity: sha512-v06iu0osHszgqJ1dLQRb6leWFU1sjG/UQk4MoVBtE6ZPewgfTkby6G9II1SpEAf2onnAuQceVYxQH9iuU3NJqw==} engines: {node: ^20.19.0 || >=22.12.0} cpu: [riscv64] os: [linux] + libc: [musl] '@oxc-parser/binding-linux-s390x-gnu@0.112.0': resolution: {integrity: sha512-+5HhNHtxsdcd7+ljXFnn9FOoCNXJX3UPgIfIE6vdwS1HqdGNH6eAcVobuqGOp54l8pvcxDQA6F4cPswCgLrQfQ==} engines: {node: ^20.19.0 || >=22.12.0} cpu: [s390x] os: [linux] + libc: [glibc] '@oxc-parser/binding-linux-x64-gnu@0.112.0': resolution: {integrity: sha512-jKwO7ZLNkjxwg7FoCLw+fJszooL9yXRZsDN0AQ1AQUTWq1l8GH/2e44k68N3fcP19jl8O8jGpqLAZcQTYk6skA==} engines: {node: ^20.19.0 || >=22.12.0} cpu: [x64] os: [linux] + libc: [glibc] '@oxc-parser/binding-linux-x64-musl@0.112.0': resolution: {integrity: sha512-TYqnuKV/p3eOc+N61E0961nA7DC+gaCeJ3+V2LcjJdTwFMdikqWL6uVk1jlrpUCBrozHDATVUKDZYH7r4FQYjQ==} engines: {node: ^20.19.0 || >=22.12.0} cpu: [x64] os: [linux] + libc: [musl] '@oxc-parser/binding-openharmony-arm64@0.112.0': resolution: {integrity: sha512-ZhrVmWFifVEFQX4XPwLoVFDHw9tAWH9p9vHsHFH+5uCKdfVR+jje4WxVo6YrokWCboGckoOzHq5KKMOcPZfkRg==} @@ -2831,6 +2953,9 @@ packages: '@oxc-project/types@0.112.0': resolution: {integrity: sha512-m6RebKHIRsax2iCwVpYW2ErQwa4ywHJrE4sCK3/8JK8ZZAWOKXaRJFl/uP51gaVyyXlaS4+chU1nSCdzYf6QqQ==} + '@oxc-project/types@0.124.0': + resolution: {integrity: sha512-VBFWMTBvHxS11Z5Lvlr3IWgrwhMTXV+Md+EQF0Xf60+wAdsGFTBx7X7K/hP4pi8N7dcm1RvcHwDxZ16Qx8keUg==} + '@oxc-transform/binding-android-arm-eabi@0.112.0': resolution: {integrity: sha512-r4LuBaPnOAi0eUOBNi880Fm2tO2omH7N1FRrL6+nyz/AjQ+QPPLtoyZJva0O+sKi1buyN/7IzM5p9m+5ANSDbg==} engines: {node: ^20.19.0 || >=22.12.0} @@ -2878,48 +3003,56 @@ packages: engines: {node: ^20.19.0 || >=22.12.0} cpu: [arm64] os: [linux] + libc: [glibc] '@oxc-transform/binding-linux-arm64-musl@0.112.0': resolution: {integrity: sha512-Lg6VOuSd3oXv7J0eGywgqh/086h+qQzIBOD+47pYKMTTJcbDe+f3h/RgGoMKJE5HhiwT5sH1aGEJfIfaYUiVSw==} engines: {node: ^20.19.0 || >=22.12.0} cpu: [arm64] os: [linux] + libc: [musl] '@oxc-transform/binding-linux-ppc64-gnu@0.112.0': resolution: {integrity: sha512-PXzmj82o1moA4IGphYImTRgc2youTi4VRfyFX3CHwLjxPcQ5JtcsgbDt4QUdOzXZ+zC07s5jf2ZzhRapEOlj2w==} engines: {node: ^20.19.0 || >=22.12.0} cpu: [ppc64] os: [linux] + libc: [glibc] '@oxc-transform/binding-linux-riscv64-gnu@0.112.0': resolution: {integrity: sha512-vhJsMsVH/6xwa3bt1LGts33FXUkGjaEGDwsRyp4lIfOjSfQVWMtCmWMFNaA0dW9FVWdD2Gt2fSFBSZ+azDxlpg==} engines: {node: ^20.19.0 || >=22.12.0} cpu: [riscv64] os: [linux] + libc: [glibc] '@oxc-transform/binding-linux-riscv64-musl@0.112.0': resolution: {integrity: sha512-cXWFb7z+2IjFUEcXtRwluq9oEG5qnyFCjiu3SWrgYNcWwPdHusv3I/7K5/CTbbi4StoZ5txbi7/iSfDHNyWuRw==} engines: {node: ^20.19.0 || >=22.12.0} cpu: [riscv64] os: [linux] + libc: [musl] '@oxc-transform/binding-linux-s390x-gnu@0.112.0': resolution: {integrity: sha512-eEFu4SRqJTJ20/88KRWmp+jpHKAw0Y1DsnSgpEeXyBIIcsOaLIUMU/TfYWUmqRbvbMV9rmOmI3kp5xWYUq6kSQ==} engines: {node: ^20.19.0 || >=22.12.0} cpu: [s390x] os: [linux] + libc: [glibc] '@oxc-transform/binding-linux-x64-gnu@0.112.0': resolution: {integrity: sha512-ST1MDT+TlOyZ1c5btrGinRSUW2Jf4Pa+0gdKwsyjDSOC3dxy2ZNkN3mosTf4ywc3J+mxfYKqtjs7zSwHz03ILA==} engines: {node: ^20.19.0 || >=22.12.0} cpu: [x64] os: [linux] + libc: [glibc] '@oxc-transform/binding-linux-x64-musl@0.112.0': resolution: {integrity: sha512-ISQoA3pD4cyTGpf9sXXeerH6pL2L6EIpdy6oAy2ttkswyVFDyQNVOVIGIdLZDgbpmqGljxZnWqt/J/N68pQaig==} engines: {node: ^20.19.0 || >=22.12.0} cpu: [x64] os: [linux] + libc: [musl] '@oxc-transform/binding-openharmony-arm64@0.112.0': resolution: {integrity: sha512-UOGVrGIv7yLJovyEXEyUTADuLq98vd/cbMHFLJweRXD+11I8Tn4jASi4WzdsN8C3BVYGRHrXH2NlSBmhz33a4g==} @@ -2982,36 +3115,42 @@ packages: engines: {node: '>= 10.0.0'} cpu: [arm] os: [linux] + libc: [glibc] '@parcel/watcher-linux-arm-musl@2.5.1': resolution: {integrity: sha512-6E+m/Mm1t1yhB8X412stiKFG3XykmgdIOqhjWj+VL8oHkKABfu/gjFj8DvLrYVHSBNC+/u5PeNrujiSQ1zwd1Q==} engines: {node: '>= 10.0.0'} cpu: [arm] os: [linux] + libc: [musl] '@parcel/watcher-linux-arm64-glibc@2.5.1': resolution: {integrity: sha512-LrGp+f02yU3BN9A+DGuY3v3bmnFUggAITBGriZHUREfNEzZh/GO06FF5u2kx8x+GBEUYfyTGamol4j3m9ANe8w==} engines: {node: '>= 10.0.0'} cpu: [arm64] os: [linux] + libc: [glibc] '@parcel/watcher-linux-arm64-musl@2.5.1': resolution: {integrity: sha512-cFOjABi92pMYRXS7AcQv9/M1YuKRw8SZniCDw0ssQb/noPkRzA+HBDkwmyOJYp5wXcsTrhxO0zq1U11cK9jsFg==} engines: {node: '>= 10.0.0'} cpu: [arm64] os: [linux] + libc: [musl] '@parcel/watcher-linux-x64-glibc@2.5.1': resolution: {integrity: sha512-GcESn8NZySmfwlTsIur+49yDqSny2IhPeZfXunQi48DMugKeZ7uy1FX83pO0X22sHntJ4Ub+9k34XQCX+oHt2A==} engines: {node: '>= 10.0.0'} cpu: [x64] os: [linux] + libc: [glibc] '@parcel/watcher-linux-x64-musl@2.5.1': resolution: {integrity: sha512-n0E2EQbatQ3bXhcH2D1XIAANAcTZkQICBPVaxMeaCVBtOpBZpWJuf7LwyWPSBDITb7In8mqQgJ7gH8CILCURXg==} engines: {node: '>= 10.0.0'} cpu: [x64] os: [linux] + libc: [musl] '@parcel/watcher-wasm@2.5.1': resolution: {integrity: sha512-RJxlQQLkaMMIuWRozy+z2vEqbaQlCuaCgVZIUCzQLYggY22LZbP5Y1+ia+FD724Ids9e+XIyOLXLrLgQSHIthw==} @@ -3087,6 +3226,9 @@ packages: '@prisma/get-platform@6.19.0': resolution: {integrity: sha512-ym85WDO2yDhC3fIXHWYpG3kVMBA49cL1XD2GCsCF8xbwoy2OkDQY44gEbAt2X46IQ4Apq9H6g0Ex1iFfPqEkHA==} + '@quansync/fs@1.0.0': + resolution: {integrity: sha512-4TJ3DFtlf1L5LDMaM6CanJ/0lckGNtJcMjQ1NAV6zDmA0tEHKZtxNKin8EgPaVX1YzljbxckyT2tJrpQKAtngQ==} + '@readme/better-ajv-errors@2.4.0': resolution: {integrity: sha512-9WODaOAKSl/mU+MYNZ2aHCrkoRSvmQ+1YkLj589OEqqjOAhbn8j7Z+ilYoiTu/he6X63/clsxxAB4qny9/dDzg==} engines: {node: '>=18'} @@ -3103,6 +3245,104 @@ packages: resolution: {integrity: sha512-9FC/6ho8uFa8fV50+FPy/ngWN53jaUu4GRXlAjcxIRrzhltJnpKkBG2Tp0IDraFJeWrOpk84RJ9EMEEYzaI1Bw==} engines: {node: '>=18'} + '@rolldown/binding-android-arm64@1.0.0-rc.15': + resolution: {integrity: sha512-YYe6aWruPZDtHNpwu7+qAHEMbQ/yRl6atqb/AhznLTnD3UY99Q1jE7ihLSahNWkF4EqRPVC4SiR4O0UkLK02tA==} + engines: {node: ^20.19.0 || >=22.12.0} + cpu: [arm64] + os: [android] + + '@rolldown/binding-darwin-arm64@1.0.0-rc.15': + resolution: {integrity: sha512-oArR/ig8wNTPYsXL+Mzhs0oxhxfuHRfG7Ikw7jXsw8mYOtk71W0OkF2VEVh699pdmzjPQsTjlD1JIOoHkLP1Fg==} + engines: {node: ^20.19.0 || >=22.12.0} + cpu: [arm64] + os: [darwin] + + '@rolldown/binding-darwin-x64@1.0.0-rc.15': + resolution: {integrity: sha512-YzeVqOqjPYvUbJSWJ4EDL8ahbmsIXQpgL3JVipmN+MX0XnXMeWomLN3Fb+nwCmP/jfyqte5I3XRSm7OfQrbyxw==} + engines: {node: ^20.19.0 || >=22.12.0} + cpu: [x64] + os: [darwin] + + '@rolldown/binding-freebsd-x64@1.0.0-rc.15': + resolution: {integrity: sha512-9Erhx956jeQ0nNTyif1+QWAXDRD38ZNjr//bSHrt6wDwB+QkAfl2q6Mn1k6OBPerznjRmbM10lgRb1Pli4xZPw==} + engines: {node: ^20.19.0 || >=22.12.0} + cpu: [x64] + os: [freebsd] + + '@rolldown/binding-linux-arm-gnueabihf@1.0.0-rc.15': + resolution: {integrity: sha512-cVwk0w8QbZJGTnP/AHQBs5yNwmpgGYStL88t4UIaqcvYJWBfS0s3oqVLZPwsPU6M0zlW4GqjP0Zq5MnAGwFeGA==} + engines: {node: ^20.19.0 || >=22.12.0} + cpu: [arm] + os: [linux] + + '@rolldown/binding-linux-arm64-gnu@1.0.0-rc.15': + resolution: {integrity: sha512-eBZ/u8iAK9SoHGanqe/jrPnY0JvBN6iXbVOsbO38mbz+ZJsaobExAm1Iu+rxa4S1l2FjG0qEZn4Rc6X8n+9M+w==} + engines: {node: ^20.19.0 || >=22.12.0} + cpu: [arm64] + os: [linux] + libc: [glibc] + + '@rolldown/binding-linux-arm64-musl@1.0.0-rc.15': + resolution: {integrity: sha512-ZvRYMGrAklV9PEkgt4LQM6MjQX2P58HPAuecwYObY2DhS2t35R0I810bKi0wmaYORt6m/2Sm+Z+nFgb0WhXNcQ==} + engines: {node: ^20.19.0 || >=22.12.0} + cpu: [arm64] + os: [linux] + libc: [musl] + + '@rolldown/binding-linux-ppc64-gnu@1.0.0-rc.15': + resolution: {integrity: sha512-VDpgGBzgfg5hLg+uBpCLoFG5kVvEyafmfxGUV0UHLcL5irxAK7PKNeC2MwClgk6ZAiNhmo9FLhRYgvMmedLtnQ==} + engines: {node: ^20.19.0 || >=22.12.0} + cpu: [ppc64] + os: [linux] + libc: [glibc] + + '@rolldown/binding-linux-s390x-gnu@1.0.0-rc.15': + resolution: {integrity: sha512-y1uXY3qQWCzcPgRJATPSOUP4tCemh4uBdY7e3EZbVwCJTY3gLJWnQABgeUetvED+bt1FQ01OeZwvhLS2bpNrAQ==} + engines: {node: ^20.19.0 || >=22.12.0} + cpu: [s390x] + os: [linux] + libc: [glibc] + + '@rolldown/binding-linux-x64-gnu@1.0.0-rc.15': + resolution: {integrity: sha512-023bTPBod7J3Y/4fzAN6QtpkSABR0rigtrwaP+qSEabUh5zf6ELr9Nc7GujaROuPY3uwdSIXWrvhn1KxOvurWA==} + engines: {node: ^20.19.0 || >=22.12.0} + cpu: [x64] + os: [linux] + libc: [glibc] + + '@rolldown/binding-linux-x64-musl@1.0.0-rc.15': + resolution: {integrity: sha512-witB2O0/hU4CgfOOKUoeFgQ4GktPi1eEbAhaLAIpgD6+ZnhcPkUtPsoKKHRzmOoWPZue46IThdSgdo4XneOLYw==} + engines: {node: ^20.19.0 || >=22.12.0} + cpu: [x64] + os: [linux] + libc: [musl] + + '@rolldown/binding-openharmony-arm64@1.0.0-rc.15': + resolution: {integrity: sha512-UCL68NJ0Ud5zRipXZE9dF5PmirzJE4E4BCIOOssEnM7wLDsxjc6Qb0sGDxTNRTP53I6MZpygyCpY8Aa8sPfKPg==} + engines: {node: ^20.19.0 || >=22.12.0} + cpu: [arm64] + os: [openharmony] + + '@rolldown/binding-wasm32-wasi@1.0.0-rc.15': + resolution: {integrity: sha512-ApLruZq/ig+nhaE7OJm4lDjayUnOHVUa77zGeqnqZ9pn0ovdVbbNPerVibLXDmWeUZXjIYIT8V3xkT58Rm9u5Q==} + engines: {node: '>=14.0.0'} + cpu: [wasm32] + + '@rolldown/binding-win32-arm64-msvc@1.0.0-rc.15': + resolution: {integrity: sha512-KmoUoU7HnN+Si5YWJigfTws1jz1bKBYDQKdbLspz0UaqjjFkddHsqorgiW1mxcAj88lYUE6NC/zJNwT+SloqtA==} + engines: {node: ^20.19.0 || >=22.12.0} + cpu: [arm64] + os: [win32] + + '@rolldown/binding-win32-x64-msvc@1.0.0-rc.15': + resolution: {integrity: sha512-3P2A8L+x75qavWLe/Dll3EYBJLQmtkJN8rfh+U/eR3MqMgL/h98PhYI+JFfXuDPgPeCB7iZAKiqii5vqOvnA0g==} + engines: {node: ^20.19.0 || >=22.12.0} + cpu: [x64] + os: [win32] + + '@rolldown/pluginutils@1.0.0-rc.15': + resolution: {integrity: sha512-UromN0peaE53IaBRe9W7CjrZgXl90fqGpK+mIZbA3qSTeYqg3pqpROBdIPvOG3F5ereDHNwoHBI2e50n1BDr1g==} + '@rolldown/pluginutils@1.0.0-rc.2': resolution: {integrity: sha512-izyXV/v+cHiRfozX62W9htOAvwMo4/bXKDrQ+vom1L1qRuexPock/7VZDAhnpHCLNejd3NJ6hiab+tO0D44Rgw==} @@ -3215,66 +3455,79 @@ packages: resolution: {integrity: sha512-t4ONHboXi/3E0rT6OZl1pKbl2Vgxf9vJfWgmUoCEVQVxhW6Cw/c8I6hbbu7DAvgp82RKiH7TpLwxnJeKv2pbsw==} cpu: [arm] os: [linux] + libc: [glibc] '@rollup/rollup-linux-arm-musleabihf@4.59.0': resolution: {integrity: sha512-CikFT7aYPA2ufMD086cVORBYGHffBo4K8MQ4uPS/ZnY54GKj36i196u8U+aDVT2LX4eSMbyHtyOh7D7Zvk2VvA==} cpu: [arm] os: [linux] + libc: [musl] '@rollup/rollup-linux-arm64-gnu@4.59.0': resolution: {integrity: sha512-jYgUGk5aLd1nUb1CtQ8E+t5JhLc9x5WdBKew9ZgAXg7DBk0ZHErLHdXM24rfX+bKrFe+Xp5YuJo54I5HFjGDAA==} cpu: [arm64] os: [linux] + libc: [glibc] '@rollup/rollup-linux-arm64-musl@4.59.0': resolution: {integrity: sha512-peZRVEdnFWZ5Bh2KeumKG9ty7aCXzzEsHShOZEFiCQlDEepP1dpUl/SrUNXNg13UmZl+gzVDPsiCwnV1uI0RUA==} cpu: [arm64] os: [linux] + libc: [musl] '@rollup/rollup-linux-loong64-gnu@4.59.0': resolution: {integrity: sha512-gbUSW/97f7+r4gHy3Jlup8zDG190AuodsWnNiXErp9mT90iCy9NKKU0Xwx5k8VlRAIV2uU9CsMnEFg/xXaOfXg==} cpu: [loong64] os: [linux] + libc: [glibc] '@rollup/rollup-linux-loong64-musl@4.59.0': resolution: {integrity: sha512-yTRONe79E+o0FWFijasoTjtzG9EBedFXJMl888NBEDCDV9I2wGbFFfJQQe63OijbFCUZqxpHz1GzpbtSFikJ4Q==} cpu: [loong64] os: [linux] + libc: [musl] '@rollup/rollup-linux-ppc64-gnu@4.59.0': resolution: {integrity: sha512-sw1o3tfyk12k3OEpRddF68a1unZ5VCN7zoTNtSn2KndUE+ea3m3ROOKRCZxEpmT9nsGnogpFP9x6mnLTCaoLkA==} cpu: [ppc64] os: [linux] + libc: [glibc] '@rollup/rollup-linux-ppc64-musl@4.59.0': resolution: {integrity: sha512-+2kLtQ4xT3AiIxkzFVFXfsmlZiG5FXYW7ZyIIvGA7Bdeuh9Z0aN4hVyXS/G1E9bTP/vqszNIN/pUKCk/BTHsKA==} cpu: [ppc64] os: [linux] + libc: [musl] '@rollup/rollup-linux-riscv64-gnu@4.59.0': resolution: {integrity: sha512-NDYMpsXYJJaj+I7UdwIuHHNxXZ/b/N2hR15NyH3m2qAtb/hHPA4g4SuuvrdxetTdndfj9b1WOmy73kcPRoERUg==} cpu: [riscv64] os: [linux] + libc: [glibc] '@rollup/rollup-linux-riscv64-musl@4.59.0': resolution: {integrity: sha512-nLckB8WOqHIf1bhymk+oHxvM9D3tyPndZH8i8+35p/1YiVoVswPid2yLzgX7ZJP0KQvnkhM4H6QZ5m0LzbyIAg==} cpu: [riscv64] os: [linux] + libc: [musl] '@rollup/rollup-linux-s390x-gnu@4.59.0': resolution: {integrity: sha512-oF87Ie3uAIvORFBpwnCvUzdeYUqi2wY6jRFWJAy1qus/udHFYIkplYRW+wo+GRUP4sKzYdmE1Y3+rY5Gc4ZO+w==} cpu: [s390x] os: [linux] + libc: [glibc] '@rollup/rollup-linux-x64-gnu@4.59.0': resolution: {integrity: sha512-3AHmtQq/ppNuUspKAlvA8HtLybkDflkMuLK4DPo77DfthRb71V84/c4MlWJXixZz4uruIH4uaa07IqoAkG64fg==} cpu: [x64] os: [linux] + libc: [glibc] '@rollup/rollup-linux-x64-musl@4.59.0': resolution: {integrity: sha512-2UdiwS/9cTAx7qIUZB/fWtToJwvt0Vbo0zmnYt7ED35KPg13Q0ym1g442THLC7VyI6JfYTP4PiSOWyoMdV2/xg==} cpu: [x64] os: [linux] + libc: [musl] '@rollup/rollup-openbsd-x64@4.59.0': resolution: {integrity: sha512-M3bLRAVk6GOwFlPTIxVBSYKUaqfLrn8l0psKinkCFxl4lQvOSz8ZrKDz2gxcBwHFpci0B6rttydI4IpS4IS/jQ==} @@ -3377,84 +3630,9 @@ packages: svelte: ^5.0.0 vite: ^6.3.0 || ^7.0.0 - '@swc/core-darwin-arm64@1.12.5': - resolution: {integrity: sha512-3WF+naP/qkt5flrTfJr+p07b522JcixKvIivM7FgvllA6LjJxf+pheoILrTS8IwrNAK/XtHfKWYcGY+3eaA4mA==} - engines: {node: '>=10'} - cpu: [arm64] - os: [darwin] - - '@swc/core-darwin-x64@1.12.5': - resolution: {integrity: sha512-GCcD3dft8YN7unTBcW02Fx41jXp2MNQHCjx5ceWSEYOGvn7vBSUp7k7LkfTxGN5Ftxb9a1mxhPq8r4rD2u/aPw==} - engines: {node: '>=10'} - cpu: [x64] - os: [darwin] - - '@swc/core-linux-arm-gnueabihf@1.12.5': - resolution: {integrity: sha512-jWlzP/Y4+wbE/EJM+WGIDQsklLFV3g5LmbYTBgrY4+5nb517P31mkBzf5y2knfNWPrL7HzNu0578j3Zi2E6Iig==} - engines: {node: '>=10'} - cpu: [arm] - os: [linux] - - '@swc/core-linux-arm64-gnu@1.12.5': - resolution: {integrity: sha512-GkzgIUz+2r6J6Tn3hb7/4ByaWHRrRZt4vuN9BLAd+y65m2Bt0vlEpPtWhrB/TVe4hEkFR+W5PDETLEbUT4i0tQ==} - engines: {node: '>=10'} - cpu: [arm64] - os: [linux] - - '@swc/core-linux-arm64-musl@1.12.5': - resolution: {integrity: sha512-g0AJ7QmZPj3Uw+C5pDa48LAUG7JBgQmB0mN5cW+s2mjaFKT0mTSxYALtx/MDZwJExDPo0yJV8kSbFO1tvFPyhg==} - engines: {node: '>=10'} - cpu: [arm64] - os: [linux] - - '@swc/core-linux-x64-gnu@1.12.5': - resolution: {integrity: sha512-PeYoSziNy+iNiBHPtAsO84bzBne/mbCsG5ijYkAhS1GVsDgohClorUvRXXhcUZoX2gr8TfSI9WLHo30K+DKiHg==} - engines: {node: '>=10'} - cpu: [x64] - os: [linux] - - '@swc/core-linux-x64-musl@1.12.5': - resolution: {integrity: sha512-EJrfCCIyuV5LLmYgKtIMwtgsnjVesdFe0IgQzEKs9OfB6cL6g7WO9conn8BkGX8jphVa7jChKxShDGkreWWDzA==} - engines: {node: '>=10'} - cpu: [x64] - os: [linux] - - '@swc/core-win32-arm64-msvc@1.12.5': - resolution: {integrity: sha512-FnwT7fxkJJMgsfiDoZKEVGyCzrPFbzpflFAAoTCUCu3MaHw6mW55o/MAAfofvJ1iIcEpec4o93OilsmKtpyO5Q==} - engines: {node: '>=10'} - cpu: [arm64] - os: [win32] - - '@swc/core-win32-ia32-msvc@1.12.5': - resolution: {integrity: sha512-jW6l4KFt9mIXSpGseE6BQOEFmbIeXeShDuWgldEJXKeXf/uPs8wrqv80XBIUwVpK0ZbmJwPQ0waGVj8UM3th2Q==} - engines: {node: '>=10'} - cpu: [ia32] - os: [win32] - - '@swc/core-win32-x64-msvc@1.12.5': - resolution: {integrity: sha512-AZszwuEjlz1tSNLQRm3T5OZJ5eebxjJlDQnnzXJmg0B7DJMRoaAe1HTLOmejxjFK6yWr7fh+pSeCw2PgQLxgqA==} - engines: {node: '>=10'} - cpu: [x64] - os: [win32] - - '@swc/core@1.12.5': - resolution: {integrity: sha512-KxA0PHHIuUBmQ/Oi+xFpVzILj2Oo37sTtftCbyowQlyx5YOknEOw1kLpas5hMcpznXgFyAWbpK71xQps4INPgA==} - engines: {node: '>=10'} - peerDependencies: - '@swc/helpers': '>=0.5.17' - peerDependenciesMeta: - '@swc/helpers': - optional: true - - '@swc/counter@0.1.3': - resolution: {integrity: sha512-e2BR4lsJkkRlKZ/qCHPw9ZaSxc0MVUd7gtbtaB7aMvHeJVYe8sOB8DBZkP2DtISHGSku9sCK6T6cnY0CtXrOCQ==} - '@swc/helpers@0.5.15': resolution: {integrity: sha512-JQ5TuMi45Owi4/BIMAJBoSQoOJu12oOk/gADqlcUL9JEdHB8vyjUSsxqeNXnmXHjYKMi2WcYtezGEEhqUI/E2g==} - '@swc/types@0.1.26': - resolution: {integrity: sha512-lyMwd7WGgG79RS7EERZV3T8wMdmPq3xwyg+1nmAM64kIhx5yl+juO2PYIHb7vTiPgPCj8LYjsNV2T5wiQHUEaw==} - '@tailwindcss/node@4.1.16': resolution: {integrity: sha512-BX5iaSsloNuvKNHRN3k2RcCuTEgASTo77mofW0vmeHkfrDWaoFAFvNHpEgtu0eqyypcyiBkDWzSMxJhp3AUVcw==} @@ -3526,48 +3704,56 @@ packages: engines: {node: '>= 10'} cpu: [arm64] os: [linux] + libc: [glibc] '@tailwindcss/oxide-linux-arm64-gnu@4.1.18': resolution: {integrity: sha512-S0n3jboLysNbh55Vrt7pk9wgpyTTPD0fdQeh7wQfMqLPM/Hrxi+dVsLsPrycQjGKEQk85Kgbx+6+QnYNiHalnw==} engines: {node: '>= 10'} cpu: [arm64] os: [linux] + libc: [glibc] '@tailwindcss/oxide-linux-arm64-musl@4.1.16': resolution: {integrity: sha512-H81UXMa9hJhWhaAUca6bU2wm5RRFpuHImrwXBUvPbYb+3jo32I9VIwpOX6hms0fPmA6f2pGVlybO6qU8pF4fzQ==} engines: {node: '>= 10'} cpu: [arm64] os: [linux] + libc: [musl] '@tailwindcss/oxide-linux-arm64-musl@4.1.18': resolution: {integrity: sha512-1px92582HkPQlaaCkdRcio71p8bc8i/ap5807tPRDK/uw953cauQBT8c5tVGkOwrHMfc2Yh6UuxaH4vtTjGvHg==} engines: {node: '>= 10'} cpu: [arm64] os: [linux] + libc: [musl] '@tailwindcss/oxide-linux-x64-gnu@4.1.16': resolution: {integrity: sha512-ZGHQxDtFC2/ruo7t99Qo2TTIvOERULPl5l0K1g0oK6b5PGqjYMga+FcY1wIUnrUxY56h28FxybtDEla+ICOyew==} engines: {node: '>= 10'} cpu: [x64] os: [linux] + libc: [glibc] '@tailwindcss/oxide-linux-x64-gnu@4.1.18': resolution: {integrity: sha512-v3gyT0ivkfBLoZGF9LyHmts0Isc8jHZyVcbzio6Wpzifg/+5ZJpDiRiUhDLkcr7f/r38SWNe7ucxmGW3j3Kb/g==} engines: {node: '>= 10'} cpu: [x64] os: [linux] + libc: [glibc] '@tailwindcss/oxide-linux-x64-musl@4.1.16': resolution: {integrity: sha512-Oi1tAaa0rcKf1Og9MzKeINZzMLPbhxvm7rno5/zuP1WYmpiG0bEHq4AcRUiG2165/WUzvxkW4XDYCscZWbTLZw==} engines: {node: '>= 10'} cpu: [x64] os: [linux] + libc: [musl] '@tailwindcss/oxide-linux-x64-musl@4.1.18': resolution: {integrity: sha512-bhJ2y2OQNlcRwwgOAGMY0xTFStt4/wyU6pvI6LSuZpRgKQwxTec0/3Scu91O8ir7qCR3AuepQKLU/kX99FouqQ==} engines: {node: '>= 10'} cpu: [x64] os: [linux] + libc: [musl] '@tailwindcss/oxide-wasm32-wasi@4.1.16': resolution: {integrity: sha512-B01u/b8LteGRwucIBmCQ07FVXLzImWESAIMcUU6nvFt/tYsQ6IHz8DmZ5KtvmwxD+iTYBtM1xwoGXswnlu9v0Q==} @@ -3733,6 +3919,9 @@ packages: '@types/http-errors@2.0.5': resolution: {integrity: sha512-r8Tayk8HJnX0FztbZN7oVqGccWgw98T/0neJphO91KkmOzug1KkofZURD4UaD5uH8AqcFLfdPErnBod0u71/qg==} + '@types/jsesc@2.5.1': + resolution: {integrity: sha512-9VN+6yxLOPLOav+7PwjZbxiID2bVaeq0ED4qSQmdQTdjnXJSaCVKTR58t15oqH1H5t8Ng2ZX1SabJVoN9Q34bw==} + '@types/json-schema@7.0.15': resolution: {integrity: sha512-5+fP8P8MFNC+AyZCDxrB2pkZFPGzqQWUzpSeuuVLvm8VMcorNYavBqoFcxK8bQz4Qsbn4oUEEem4wDLfcysGHA==} @@ -3745,9 +3934,6 @@ packages: '@types/mime@1.3.5': resolution: {integrity: sha512-/pyBZWSLD2n0dcHE3hq8s8ZvcETHtEuF+3E7XVt0Ig2nvsVQXdghHVcEkIWjy9A0wKfTn97a/PSDYohKIlnP/w==} - '@types/node@20.17.24': - resolution: {integrity: sha512-d7fGCyB96w9BnWQrOsJtpyiSaBcAYYr75bnK6ZRjDbql2cGLj/3GsL5OYmLPNq76l7Gf2q4Rv9J2o6h5CrD9sA==} - '@types/node@20.19.24': resolution: {integrity: sha512-FE5u0ezmi6y9OZEzlJfg37mqqf6ZDSF2V/NLjUyGrR9uTZ7Sb9F7bLNZ03S4XVUNRWGA7Ck4c1kK+YnuWjl+DA==} @@ -3984,41 +4170,49 @@ packages: resolution: {integrity: sha512-34gw7PjDGB9JgePJEmhEqBhWvCiiWCuXsL9hYphDF7crW7UgI05gyBAi6MF58uGcMOiOqSJ2ybEeCvHcq0BCmQ==} cpu: [arm64] os: [linux] + libc: [glibc] '@unrs/resolver-binding-linux-arm64-musl@1.11.1': resolution: {integrity: sha512-RyMIx6Uf53hhOtJDIamSbTskA99sPHS96wxVE/bJtePJJtpdKGXO1wY90oRdXuYOGOTuqjT8ACccMc4K6QmT3w==} cpu: [arm64] os: [linux] + libc: [musl] '@unrs/resolver-binding-linux-ppc64-gnu@1.11.1': resolution: {integrity: sha512-D8Vae74A4/a+mZH0FbOkFJL9DSK2R6TFPC9M+jCWYia/q2einCubX10pecpDiTmkJVUH+y8K3BZClycD8nCShA==} cpu: [ppc64] os: [linux] + libc: [glibc] '@unrs/resolver-binding-linux-riscv64-gnu@1.11.1': resolution: {integrity: sha512-frxL4OrzOWVVsOc96+V3aqTIQl1O2TjgExV4EKgRY09AJ9leZpEg8Ak9phadbuX0BA4k8U5qtvMSQQGGmaJqcQ==} cpu: [riscv64] os: [linux] + libc: [glibc] '@unrs/resolver-binding-linux-riscv64-musl@1.11.1': resolution: {integrity: sha512-mJ5vuDaIZ+l/acv01sHoXfpnyrNKOk/3aDoEdLO/Xtn9HuZlDD6jKxHlkN8ZhWyLJsRBxfv9GYM2utQ1SChKew==} cpu: [riscv64] os: [linux] + libc: [musl] '@unrs/resolver-binding-linux-s390x-gnu@1.11.1': resolution: {integrity: sha512-kELo8ebBVtb9sA7rMe1Cph4QHreByhaZ2QEADd9NzIQsYNQpt9UkM9iqr2lhGr5afh885d/cB5QeTXSbZHTYPg==} cpu: [s390x] os: [linux] + libc: [glibc] '@unrs/resolver-binding-linux-x64-gnu@1.11.1': resolution: {integrity: sha512-C3ZAHugKgovV5YvAMsxhq0gtXuwESUKc5MhEtjBpLoHPLYM+iuwSj3lflFwK3DPm68660rZ7G8BMcwSro7hD5w==} cpu: [x64] os: [linux] + libc: [glibc] '@unrs/resolver-binding-linux-x64-musl@1.11.1': resolution: {integrity: sha512-rV0YSoyhK2nZ4vEswT/QwqzqQXw5I6CjoaYMOX0TqBlWhojUf8P94mvI7nuJTeaCkkds3QE4+zS8Ko+GdXuZtA==} cpu: [x64] os: [linux] + libc: [musl] '@unrs/resolver-binding-wasm32-wasi@1.11.1': resolution: {integrity: sha512-5u4RkfxJm+Ng7IWgkzi3qrFOvLvQYnPBmjmZQ8+szTK/b31fQCnleNl1GgEt7nIsZRIf5PLhPwT0WM+q45x/UQ==} @@ -4322,9 +4516,6 @@ packages: resolution: {integrity: sha512-HqZ5rWlFjGiV0tDm3UxxgNRqsOTniqoKZu0pIAfh7TZQMGuZK+hH0drySty0si0QXj1ieop4+SkSfPZBPPkHig==} engines: {node: '>=14'} - any-promise@1.3.0: - resolution: {integrity: sha512-7UvmKalWRt1wgjL1RrGxoSJW/0QZFIegpeGvZG9kjp8vrRu55XTHbwnqq2GpXm9uLbcuhxm3IqX9OB4MZR1b2A==} - anymatch@3.1.3: resolution: {integrity: sha512-KMReFUr0B4t+D+OBkjR3KYqvocp2XaSzO55UcB6mgQMd3KbcE+mWTyvVV7D/zsdEbNnV6acZUutkiHQXvTr1Rw==} engines: {node: '>= 8'} @@ -4390,6 +4581,10 @@ packages: resolution: {integrity: sha512-TH+b3Lv6pUjy/Nu0m6A2JULtdzLpmqF9x1Dhj00ZoEiML8qvVA9j1flkzTKNYgdEhWrjDwtWNpyyCUbfQe514g==} engines: {node: '>=20.19.0'} + ast-kit@3.0.0-beta.1: + resolution: {integrity: sha512-trmleAnZ2PxN/loHWVhhx1qeOHSRXq4TDsBBxq3GqeJitfk3+jTQ+v/C1km/KYq9M7wKqCewMh+/NAvVH7m+bw==} + engines: {node: '>=20.19.0'} + ast-types-flow@0.0.8: resolution: {integrity: sha512-OH/2E5Fg20h2aPrbe+QL8JZQFko0YZaF+j4mnQ7BGhfavO7OpSLa8a0y9sBwomHdSbkhTS8TQNayBfnW5DwbvQ==} @@ -4560,6 +4755,9 @@ packages: birpc@2.9.0: resolution: {integrity: sha512-KrayHS5pBi69Xi9JmvoqrIgYGDkD6mcSe/i6YKi3w5kekCLzrX4+nawcXqrj2tIp50Kw/mT/s3p+GVK0A0sKxw==} + birpc@4.0.0: + resolution: {integrity: sha512-LShSxJP0KTmd101b6DRyGBj57LZxSDYWKitQNW/mi8GRMvZb078Uf9+pveax1DrVL89vm7mWe+TovdI/UDOuPw==} + bl@4.1.0: resolution: {integrity: sha512-1W07cM9gS6DcLperZfFSj+bWLtaPGSOHWhPiGzXmvVJbRLdG82sH/Kn8EtW1VqWVA54AKf2h5k5BbnIbwF3h6w==} @@ -4614,12 +4812,6 @@ packages: resolution: {integrity: sha512-tjwM5exMg6BGRI+kNmTntNsvdZS1X8BFYS6tnJ2hdH0kVxM6/eVZ2xy+FqStSWvYmtfFMDLIxurorHwDKfDz5Q==} engines: {node: '>=18'} - bundle-require@5.1.0: - resolution: {integrity: sha512-3WrrOuZiyaaZPWiEt4G3+IffISVC9HYlWueJEBWED4ZH4aIAC2PnkdnuRrR94M+w6yGWn4AglWtJtBI8YqvgoA==} - engines: {node: ^12.20.0 || ^14.13.1 || >=16.0.0} - peerDependencies: - esbuild: '>=0.18' - bytes@3.1.2: resolution: {integrity: sha512-/Nf7TyzTx6S3yRJObOAV7956r8cr2+Oj8AC5dt8wSP3BQAoeX58NoHyCU8P8zGkNXStjTSi6fzO6F0pBdcYbEg==} engines: {node: '>= 0.8'} @@ -4644,6 +4836,10 @@ packages: resolution: {integrity: sha512-b6Ilus+c3RrdDk+JhLKUAQfzzgLEPy6wcXqS7f/xe1EETvsDP6GORG7SFuOs6cID5YkqchW/LXZbX5bc8j7ZcQ==} engines: {node: '>=8'} + cac@7.0.0: + resolution: {integrity: sha512-tixWYgm5ZoOD+3g6UTea91eow5z6AAHaho3g0V9CNSNb45gM8SmflpAc+GRd1InC4AqN/07Unrgp56Y94N9hJQ==} + engines: {node: '>=20.19.0'} + call-bind-apply-helpers@1.0.2: resolution: {integrity: sha512-Sp1ablJ0ivDkSzjcaJdxEunN5/XvksFJ2sMBFfq6x0ryhQV/2b/KwFe21cMpmHtPOSij8K99/wSfoEuTObmuMQ==} engines: {node: '>= 0.4'} @@ -4791,10 +4987,6 @@ packages: commander@2.20.3: resolution: {integrity: sha512-GpVkmM8vF2vQUkj2LvZmD35JxeJOLCwJ9cUkugyk2nuhbv3+mJvpLYYt+0+USMxE+oj+ey/lJEnhZw75x/OMcQ==} - commander@4.1.1: - resolution: {integrity: sha512-NOKm8xhkzAjzFx8B2v5OAHT+u5pRQc2UCa2Vq9jYL/31o2wi9mxBA7LIFs3sV5VSC49z6pEhfbMULvShKj26WA==} - engines: {node: '>= 6'} - commander@8.3.0: resolution: {integrity: sha512-OkTL9umf+He2DZkUq8f8J9of7yL6RJKI24dVITBmNfZBmri9zYZQrKkuXiKhyfPSu8tUhnVBB1iKXevvnlR4Ww==} engines: {node: '>= 12'} @@ -5088,6 +5280,9 @@ packages: defu@6.1.4: resolution: {integrity: sha512-mEQCMmwJu317oSz8CwdIOdwf3xMif1ttiM8LTufzc3g6kR+9Pe236twL8j3IYT1F7GfRgGcW6MWxzZjLIkuHIg==} + defu@6.1.7: + resolution: {integrity: sha512-7z22QmUWiQ/2d0KkdYmANbRUVABpZ9SNYyH5vx6PZ+nE5bcC0l7uFvEfHlyld/HcGBFTL536ClDt3DEcSlEJAQ==} + delayed-stream@1.0.0: resolution: {integrity: sha512-ZySD7Nf91aLB0RxL4KGrKHBXl7Eds1DAmEdcoVawXnLD7SDhpNgtuII2aAkg7a7QS41jxPSZ17p4VdGnMHk3MQ==} engines: {node: '>=0.4.0'} @@ -5247,6 +5442,15 @@ packages: sqlite3: optional: true + dts-resolver@2.1.3: + resolution: {integrity: sha512-bihc7jPC90VrosXNzK0LTE2cuLP6jr0Ro8jk+kMugHReJVLIpHz/xadeq3MhuwyO4TD4OA3L1Q8pBBFRc08Tsw==} + engines: {node: '>=20.19.0'} + peerDependencies: + oxc-resolver: '>=11.0.0' + peerDependenciesMeta: + oxc-resolver: + optional: true + dunder-proto@1.0.1: resolution: {integrity: sha512-KIN/nDJBQRcXw0MLVhZE9iQHmG68qAVIBg9CqmUYjmQIhgij9U5MFvrqkUL5FbtyyzZuOeOt0zdeRe4UY7ct+A==} engines: {node: '>= 0.4'} @@ -5630,14 +5834,6 @@ packages: fastq@1.19.1: resolution: {integrity: sha512-GwLTyxkCXjXbxqIhTsMI2Nui8huMPtnxg7krajPJAjnEG/iiOS7i+zCtWGZR9G0NBKbXKh6X9m9UIsYX/N6vvQ==} - fdir@6.4.6: - resolution: {integrity: sha512-hiFoqpyZcfNm1yc4u8oWCf9A2c4D3QjCrks3zmoVKVxpQRzmPNar1hUJcBG2RQHvEVGDN+Jm81ZheVLAQMK6+w==} - peerDependencies: - picomatch: ^3 || ^4 - peerDependenciesMeta: - picomatch: - optional: true - fdir@6.5.0: resolution: {integrity: sha512-tIbYtZbucOs0BRGqPJkshJUYdL+SDH7dVM8gjy+ERp3WAUjLEFJE+02kanyHtwjWOnwrKYBiwAmM0p4kLJAnXg==} engines: {node: '>=12.0.0'} @@ -5681,9 +5877,6 @@ packages: resolution: {integrity: sha512-78/PXT1wlLLDgTzDs7sjq9hzz0vXD+zn+7wypEe4fXQxCmdmqfGsEPQxmiCSQI3ajFV91bVSsvNtrJRiW6nGng==} engines: {node: '>=10'} - fix-dts-default-cjs-exports@1.0.1: - resolution: {integrity: sha512-pVIECanWFC61Hzl2+oOCtoJ3F17kglZC/6N94eRWycFgBH35hHx0Li604ZIzhseh97mf2p0cv7vVrOZGoqhlEg==} - flat-cache@4.0.1: resolution: {integrity: sha512-f7ccFPK3SXFHpx15UIGyRJ/FJQctuKZ0zVuN3frBo4HnK3cay9VEW0R6yPYFHC0AgqhukPzKjq22t5DmAyqGyw==} engines: {node: '>=16'} @@ -5788,6 +5981,9 @@ packages: get-tsconfig@4.10.1: resolution: {integrity: sha512-auHyJ4AgMz7vgS8Hp3N6HXSmlMdUyhSUrfBF16w153rxtLIEOE+HGqaBppczZvnHLqQJfiHotCYpNhl0lUROFQ==} + get-tsconfig@4.13.7: + resolution: {integrity: sha512-7tN6rFgBlMgpBML5j8typ92BKFi2sFQvIdpAqLA2beia5avZDrMs0FLZiM5etShWq5irVyGcGMEA1jcDaK7A/Q==} + giget@2.0.0: resolution: {integrity: sha512-L5bGsVkxJbJgdnwyuheIunkGatUF/zssUoxxjACCseZYAVbaqdh9Tsmmlkl8vYan09H7sbvKt4pS8GqKLBrEzA==} hasBin: true @@ -5914,6 +6110,9 @@ packages: hookable@6.0.1: resolution: {integrity: sha512-uKGyY8BuzN/a5gvzvA+3FVWo0+wUjgtfSdnmjtrOVwQCZPHpHDH2WRO3VZSOeluYrHoDCiXFffZXs8Dj1ULWtw==} + hookable@6.1.0: + resolution: {integrity: sha512-ZoKZSJgu8voGK2geJS+6YtYjvIzu9AOM/KZXsBxr83uhLL++e9pEv/dlgwgy3dvHg06kTz6JOh1hk3C8Ceiymw==} + hosted-git-info@2.8.9: resolution: {integrity: sha512-mxIDAb9Lsm6DoOJ7xH+5+X4y1LU/4Hi50L9C5sIswK3JzULS4bwk1FvjdBgvYR4bzT4tuUQiC15FE2f5HbLvYw==} @@ -5985,6 +6184,10 @@ packages: resolution: {integrity: sha512-TR3KfrTZTYLPB6jUjfx6MF9WcWrHL9su5TObK4ZkYgBdWKPOFoSoQIdEuTuR82pmtxH2spWG9h6etwfr1pLBqQ==} engines: {node: '>=6'} + import-without-cache@0.2.5: + resolution: {integrity: sha512-B6Lc2s6yApwnD2/pMzFh/d5AVjdsDXjgkeJ766FmFuJELIGHNycKRj+l3A39yZPM4CchqNCB4RITEAYB1KUM6A==} + engines: {node: '>=20.19.0'} + impound@1.0.0: resolution: {integrity: sha512-8lAJ+1Arw2sMaZ9HE2ZmL5zOcMnt18s6+7Xqgq2aUVy4P1nlzAyPtzCDxsk51KVFwHEEdc6OWvUyqwHwhRYaug==} @@ -6266,10 +6469,6 @@ packages: jose@6.1.2: resolution: {integrity: sha512-MpcPtHLE5EmztuFIqB0vzHAWJPpmN1E6L4oo+kze56LIs3MyXIj9ZHMDxqOvkP38gBR7K1v3jqd4WU2+nrfONQ==} - joycon@3.1.1: - resolution: {integrity: sha512-34wB/Y7MW7bzjKRjUKTa46I2Z7eV62Rkhva+KkopW7Qvv/OSWBqvkSY7vusOPrNuZcUG3tApvdVgNB8POj3SPw==} - engines: {node: '>=10'} - js-tokens@4.0.0: resolution: {integrity: sha512-RdJUflcE3cUzKiMqQgsCu06FPu9UdIJO0beYbPhHN4k6apgJtifcoCtT9bcxOpYBtpD2kCM6Sbzg4CausW/PKQ==} @@ -6369,8 +6568,8 @@ packages: peerDependencies: kysely: ^0.28.2 - kysely@0.28.8: - resolution: {integrity: sha512-QUOgl5ZrS9IRuhq5FvOKFSsD/3+IA6MLE81/bOOTRA/YQpKDza2sFdN5g6JCB9BOpqMJDGefLCQ9F12hRS13TA==} + kysely@0.28.16: + resolution: {integrity: sha512-3i5pmOiZvMDj00qhrIVbH0AnioVTx22DMP7Vn5At4yJO46iy+FM8Y/g61ltenLVSo3fiO8h8Q3QOFgf/gQ72ww==} engines: {node: '>=20.0.0'} langium-cli@3.5.0: @@ -6445,24 +6644,28 @@ packages: engines: {node: '>= 12.0.0'} cpu: [arm64] os: [linux] + libc: [glibc] lightningcss-linux-arm64-musl@1.30.2: resolution: {integrity: sha512-5Vh9dGeblpTxWHpOx8iauV02popZDsCYMPIgiuw97OJ5uaDsL86cnqSFs5LZkG3ghHoX5isLgWzMs+eD1YzrnA==} engines: {node: '>= 12.0.0'} cpu: [arm64] os: [linux] + libc: [musl] lightningcss-linux-x64-gnu@1.30.2: resolution: {integrity: sha512-Cfd46gdmj1vQ+lR6VRTTadNHu6ALuw2pKR9lYq4FnhvgBc4zWY1EtZcAc6EffShbb1MFrIPfLDXD6Xprbnni4w==} engines: {node: '>= 12.0.0'} cpu: [x64] os: [linux] + libc: [glibc] lightningcss-linux-x64-musl@1.30.2: resolution: {integrity: sha512-XJaLUUFXb6/QG2lGIW6aIk6jKdtjtcffUT0NKvIqhSBY3hh9Ch+1LCeH80dR9q9LBjG3ewbDjnumefsLsP6aiA==} engines: {node: '>= 12.0.0'} cpu: [x64] os: [linux] + libc: [musl] lightningcss-win32-arm64-msvc@1.30.2: resolution: {integrity: sha512-FZn+vaj7zLv//D/192WFFVA0RgHawIcHqLX9xuWiQt7P0PtdFEVaxgF9rjM/IRYHQXNnk61/H/gb2Ei+kUQ4xQ==} @@ -6488,9 +6691,6 @@ packages: resolution: {integrity: sha512-/vlFKAoH5Cgt3Ie+JLhRbwOsCQePABiU3tJ1egGvyQ+33R/vcwM2Zl2QR/LzjsBeItPt3oSVXapn+m4nQDvpzw==} engines: {node: '>=14'} - lines-and-columns@1.2.4: - resolution: {integrity: sha512-7ylylesZQ/PV29jhEDl3Ufjo6ZX7gCqJr5F7PKrqc93v7fzSymt1BpwEU8nAUXs8qzzvqhbjhK5QZg6Mt/HkBg==} - listhen@1.9.0: resolution: {integrity: sha512-I8oW2+QL5KJo8zXNWX046M134WchxsXC7SawLPvRQpogCbkyQIaFxPE89A2HiwR7vAK2Dm2ERBAmyjTYGYEpBg==} hasBin: true @@ -6499,10 +6699,6 @@ packages: resolution: {integrity: sha512-Kx8hMakjX03tiGTLAIdJ+lL0htKnXjEZN6hk/tozf/WOuYGdZBJrZ+rCJRbVCugsjB3jMLn9746NsQIf5VjBMw==} engines: {node: '>=4'} - load-tsconfig@0.2.5: - resolution: {integrity: sha512-IXO6OCs9yg8tMKzfPZ1YmheJbZCiEsnBdcB03l0OcfK9prKnJb96siuHCr5Fl37/yo9DnKU+TLpxzTUspw9shg==} - engines: {node: ^12.20.0 || ^14.13.1 || >=16.0.0} - local-pkg@1.1.2: resolution: {integrity: sha512-arhlxbFRmoQHl33a0Zkle/YWlmNwoyt6QNZEIJcqNbdrsix5Lvc4HyyI3EnwxTYlZYc32EbYrQ8SzEZ7dqgg9A==} engines: {node: '>=14'} @@ -6529,9 +6725,6 @@ packages: lodash.merge@4.6.2: resolution: {integrity: sha512-0KpjqXRVvrYyCsX1swR/XTK0va6VQkQM6MNo7PqW77ByjAhoARA8EfrP1N4+KlKj8YS0ZUCtRT/YUuhyYDujIQ==} - lodash.sortby@4.7.0: - resolution: {integrity: sha512-HDWXG8isMntAyRF5vZ7xKuEvOhT4AhlRt/3czTSjvGUxjYCBVRQY48ViDHyfYz9VIoBkW4TMGQNapx+l3RUwdA==} - lodash.uniq@4.5.0: resolution: {integrity: sha512-xfBaXQd9ryd9dlSDvnvI0lvxfLJlYAZzXomUYzLKtUeOQvOP5piqAWuGtrhWeqaXK9hhoM/iyJc5AV+XfsX3HQ==} @@ -6587,9 +6780,6 @@ packages: resolution: {integrity: sha512-CvkkH1i81zl7mmb94DsRiFeG9V2fR2JeuK8yDgS8oiZSFa++wWLEgZ5ufEOyLHbvSbD1gTRKv9NdX69Rnvr9JA==} engines: {node: '>=20.19.0'} - magic-string@0.30.17: - resolution: {integrity: sha512-sNPKHvyjVf7gyjwS4xGTaW/mCnF8wnjtifKBEhxfZ7E/S8tQ0rssrwGNn6q8JH/ohItJfSQp9mBtQYuTlH5QnA==} - magic-string@0.30.21: resolution: {integrity: sha512-vd2F4YUyEXKGcLHoq+TEyCjxueSeHnFxyyjNp80yg0XV4vUhnDer/lvvlqM/arB5bXQN5K2/3oinyCRyx8T2CQ==} @@ -6751,9 +6941,6 @@ packages: resolution: {integrity: sha512-b75qsDB3ieYEzMsT1uRGsztM/sy6vWPY40uPZlVVl8eefAotFCoS7jaDB5DxDNtlW5kdVGd9jptSpkvujNxI2A==} engines: {node: '>= 8.0'} - mz@2.7.0: - resolution: {integrity: sha512-z81GNO7nnYMEhrGh9LeymoE4+Yr0Wn5McHIZMK5cfQCl+NDX08sCZgUc9/6MHni9IWuFLm1Z3HTCXu2z9fN62Q==} - named-placeholders@1.1.6: resolution: {integrity: sha512-Tz09sEL2EEuv5fFowm419c1+a/jSMiBjI9gHxVLrVdbUkkNUUfjsVYs9pVZu5oCon/kmRh9TfLEObFtkVxmY0w==} engines: {node: '>=8.0.0'} @@ -7168,14 +7355,14 @@ packages: resolution: {integrity: sha512-JU3teHTNjmE2VCGFzuY8EXzCDVwEqB2a8fsIvwaStHhAWJEeVd1o1QD80CU6+ZdEXXSLbSsuLwJjkCBWqRQUVA==} engines: {node: '>=8.6'} - picomatch@4.0.2: - resolution: {integrity: sha512-M7BAV6Rlcy5u+m6oPhAPFgJTzAioX/6B0DxyvDlo9l8+T3nLKbrczg2WLUyzd45L8RqfUMyGPzekbMvX2Ldkwg==} - engines: {node: '>=12'} - picomatch@4.0.3: resolution: {integrity: sha512-5gTmgEY/sqK6gFXLIsQNH19lWb4ebPDLA4SdLP7dsWkIXHWlG66oPuVvXSGFPppYZz8ZDZq0dYYrbHfBCVUb1Q==} engines: {node: '>=12'} + picomatch@4.0.4: + resolution: {integrity: sha512-QP88BAKvMam/3NxH6vj2o21R6MjxZUAd6nlwAS/pnGvN9IVLocLHxGYIzFhg6fUQ+5th6P4dv4eW9jX3DSIj7A==} + engines: {node: '>=12'} + pidtree@0.3.1: resolution: {integrity: sha512-qQbW94hLHEqCg7nhby4yRC7G2+jYHY4Rguc2bjw7Uug4GIJuu1tvf2uHaZv5Q8zdt+WKJ6qK1FOI6amaWUo5FA==} engines: {node: '>=0.10'} @@ -7195,10 +7382,6 @@ packages: resolution: {integrity: sha512-r34yH/GlQpKZbU1BvFFqOjhISRo1MNx1tWYsYvmj6KIRHSPMT2+yHOEb1SG6NMvRoHRF0a07kCOox/9yakl1vg==} hasBin: true - pirates@4.0.7: - resolution: {integrity: sha512-TfySrs/5nm8fQJDcBDuUng3VOUKsd7S+zqvbOTiGXHfxX4wK31ard+hoNuvkicM/2YFzlpDgABOevKSsB4G/FA==} - engines: {node: '>= 6'} - pkg-types@1.3.1: resolution: {integrity: sha512-/Jm5M4RvtBFVkKWRu2BLUTNP8/M2a+UwuAX+ae4770q1qVGtfjG+WTCupoZixokjmHiry8uI+dlY8KXYV5HVVQ==} @@ -7255,24 +7438,6 @@ packages: peerDependencies: postcss: ^8.4.32 - postcss-load-config@6.0.1: - resolution: {integrity: sha512-oPtTM4oerL+UXmx+93ytZVN82RrlY/wPUV8IeDxFrzIjXOLF1pN+EmKPLbubvKHT2HC20xXsCAH2Z+CKV6Oz/g==} - engines: {node: '>= 18'} - peerDependencies: - jiti: '>=1.21.0' - postcss: '>=8.0.9' - tsx: ^4.8.1 - yaml: ^2.4.2 - peerDependenciesMeta: - jiti: - optional: true - postcss: - optional: true - tsx: - optional: true - yaml: - optional: true - postcss-merge-longhand@7.0.5: resolution: {integrity: sha512-Kpu5v4Ys6QI59FxmxtNB/iHUVDn9Y9sYw66D6+SZoIk4QTz1prC4aYkhIESu+ieG1iylod1f8MILMs1Em3mmIw==} engines: {node: ^18.12.0 || ^20.9.0 || >=22.0} @@ -7585,6 +7750,9 @@ packages: quansync@0.2.11: resolution: {integrity: sha512-AifT7QEbW9Nri4tAwR5M/uzpBuqfZf+zwaEM/QkzEjj7NBuFD2rBuy0K3dE+8wltbezDV7JMA0WfnCPYRSYbXA==} + quansync@1.0.0: + resolution: {integrity: sha512-5xZacEEufv3HSTPQuchrvV6soaiACMFnq1H8wkVioctoH3TRha9Sz66lOxRwPK/qZj7HPiSveih9yAyh98gvqA==} + queue-microtask@1.2.3: resolution: {integrity: sha512-NuaNSa6flKT5JaSYQzJok04JzTL1CA6aGhv5rfLW3PgqA+M2ChpZQnAC8h8i4ZFkBS8X5RqkDBHA7r4hej3K9A==} @@ -7732,6 +7900,35 @@ packages: rfdc@1.4.1: resolution: {integrity: sha512-q1b3N5QkRUWUl7iyylaaj3kOpIT0N2i9MqIEQXP73GVsN9cw3fdx8X63cEmWhJGi2PPCF23Ijp7ktmd39rawIA==} + rimraf@6.1.3: + resolution: {integrity: sha512-LKg+Cr2ZF61fkcaK1UdkH2yEBBKnYjTyWzTJT6KNPcSPaiT7HSdhtMXQuN5wkTX0Xu72KQ1l8S42rlmexS2hSA==} + engines: {node: 20 || >=22} + hasBin: true + + rolldown-plugin-dts@0.23.2: + resolution: {integrity: sha512-PbSqLawLgZBGcOGT3yqWBGn4cX+wh2nt5FuBGdcMHyOhoukmjbhYAl8NT9sE4U38Cm9tqLOIQeOrvzeayM0DLQ==} + engines: {node: '>=20.19.0'} + peerDependencies: + '@ts-macro/tsc': ^0.3.6 + '@typescript/native-preview': '>=7.0.0-dev.20260325.1' + rolldown: ^1.0.0-rc.12 + typescript: ^5.0.0 || ^6.0.0 + vue-tsc: ~3.2.0 + peerDependenciesMeta: + '@ts-macro/tsc': + optional: true + '@typescript/native-preview': + optional: true + typescript: + optional: true + vue-tsc: + optional: true + + rolldown@1.0.0-rc.15: + resolution: {integrity: sha512-Ff31guA5zT6WjnGp0SXw76X6hzGRk/OQq2hE+1lcDe+lJdHSgnSX6nK3erbONHyCbpSj9a9E+uX/OvytZoWp2g==} + engines: {node: ^20.19.0 || >=22.12.0} + hasBin: true + rollup-plugin-visualizer@6.0.5: resolution: {integrity: sha512-9+HlNgKCVbJDs8tVtjQ43US12eqaiHyyiLMdBwQ7vSZPiHMysGNo2E88TAp1si5wx8NAoYriI2A5kuKfIakmJg==} engines: {node: '>=18'} @@ -7972,11 +8169,6 @@ packages: resolution: {integrity: sha512-i5uvt8C3ikiWeNZSVZNWcfZPItFQOsYTUAOkcUPGd8DqDy1uOUikjt5dG+uRlwyvR108Fb9DOd4GvXfT0N2/uQ==} engines: {node: '>= 12'} - source-map@0.8.0-beta.0: - resolution: {integrity: sha512-2ymg6oRBpebeZi9UUNsgQ89bhx01TcTkmNTGnNO88imTmbSgy4nfujrgVEFKWpMTEGA11EDkTt7mqObTPdigIA==} - engines: {node: '>= 8'} - deprecated: The work that was done in this beta branch won't be included in future versions - spdx-correct@3.2.0: resolution: {integrity: sha512-kN9dJbvnySHULIluDHy32WHRUu3Og7B9sbY7tsFLctQkIqnMh3hErYgdMjTYuqmcXX+lK5T1lnUt3G7zNswmZA==} @@ -8133,11 +8325,6 @@ packages: peerDependencies: postcss: ^8.4.32 - sucrase@3.35.0: - resolution: {integrity: sha512-8EbVDiu9iN/nESwxeSxDKe0dunta1GOlHufmSSXxMD2z2/tMZpDMpvXQGsc+ajGo8y2uYUmixaSRUc/QPoQ0GA==} - engines: {node: '>=16 || 14 >=14.17'} - hasBin: true - superagent@10.2.3: resolution: {integrity: sha512-y/hkYGeXAj7wUMjxRbB21g/l6aAEituGXM9Rwl4o20+SX3e8YOSV6BxFXl+dL3Uk0mjSL3kCbNkwURm8/gEDig==} engines: {node: '>=14.18.0'} @@ -8240,13 +8427,6 @@ packages: text-decoder@1.2.3: resolution: {integrity: sha512-3/o9z3X0X0fTupwsYvR03pJ/DjWuqqrfwBgTQzdWDiQSm9KitAyz/9WqsT2JQW7KV2m+bC2ol/zqpW37NHxLaA==} - thenify-all@1.6.0: - resolution: {integrity: sha512-RNxQH/qI8/t3thXJDwcstUO4zeqo64+Uy/+sNVRBx4Xn2OX+OZ9oP+iJnNFqplFra2ZUVeKCSa2oVWi3T4uVmA==} - engines: {node: '>=0.8'} - - thenify@3.3.1: - resolution: {integrity: sha512-RVZSIV5IG10Hk3enotrhvz0T9em6cyHBLkH/YAZuKqd8hRkKhSfCGIcP2KUY0EPxndzANBmNllzWPwak+bheSw==} - thread-stream@4.0.0: resolution: {integrity: sha512-4iMVL6HAINXWf1ZKZjIPcz5wYaOdPhtO8ATvZ+Xqp3BTdaqtAwQkNmKORqcIo5YkQqGXq5cwfswDwMqqQNrpJA==} engines: {node: '>=20'} @@ -8260,21 +8440,22 @@ packages: tinyexec@0.3.2: resolution: {integrity: sha512-KQQR9yN7R5+OSwaK0XQoj22pwHoTlgYqmUscPYoknOoWCWfj/5/ABTMRi69FrKU5ffPVh5QcFikpWJI/P1ocHA==} - tinyexec@1.0.1: - resolution: {integrity: sha512-5uC6DDlmeqiOwCPmK9jMSdOuZTh8bU39Ys6yidB+UTt5hfZUPGAypSgFRiEp+jbi9qH40BLDvy85jIU88wKSqw==} - tinyexec@1.0.2: resolution: {integrity: sha512-W/KYk+NFhkmsYpuHq5JykngiOCnxeVL8v8dFnqxSD8qEEdRfXk1SDM6JzNqcERbcGYj9tMrDQBYV9cjgnunFIg==} engines: {node: '>=18'} - tinyglobby@0.2.14: - resolution: {integrity: sha512-tX5e7OM1HnYr2+a2C/4V0htOcSQcoSTH9KgJnVvNm5zm/cyEWKJ7j7YutsH9CxMdtOkkLFy2AHrMci9IM8IPZQ==} - engines: {node: '>=12.0.0'} + tinyexec@1.1.1: + resolution: {integrity: sha512-VKS/ZaQhhkKFMANmAOhhXVoIfBXblQxGX1myCQ2faQrfmobMftXeJPcZGp0gS07ocvGJWDLZGyOZDadDBqYIJg==} + engines: {node: '>=18'} tinyglobby@0.2.15: resolution: {integrity: sha512-j2Zq4NyQYG5XMST4cbs02Ak8iJUdxRM0XI5QyxXuZOzKOINmWurp3smXu3y5wDcJrptwpSjgXHzIQxR0omXljQ==} engines: {node: '>=12.0.0'} + tinyglobby@0.2.16: + resolution: {integrity: sha512-pn99VhoACYR8nFHhxqix+uvsbXineAasWm5ojXoN8xEwK5Kd3/TrhNn1wByuD52UxWRLy8pu+kRMniEi6Eq9Zg==} + engines: {node: '>=12.0.0'} + tinyrainbow@3.0.3: resolution: {integrity: sha512-PSkbLUoxOFRzJYjjxHJt9xro7D+iilgMX/C9lawzVuYiIdcihh9DXmVibBe8lmcFrRi/VzlPjBxbN7rH24q8/Q==} engines: {node: '>=14.0.0'} @@ -8320,9 +8501,6 @@ packages: tr46@0.0.3: resolution: {integrity: sha512-N3WMsuqV66lT30CrXNbEjx4GEwlow3v6rr4mCcv6prnfwhS01rkgyFdjPNBYd9br7LpXV1+Emh01fHnq2Gdgrw==} - tr46@1.0.1: - resolution: {integrity: sha512-dTpowEjclQ7Kgx5SdBkqRzVhERQXov8/l9Ft9dVM9fmg0W0KQSVaXX9T4i6twCPNtYiZM53lpSSUAwJbFPOHxA==} - tr46@6.0.0: resolution: {integrity: sha512-bLVMLPtstlZ4iMQHpFHTR7GAGj2jxi8Dg0s2h2MafAE4uSWF98FC/3MomU51iQAMf8/qDUbKWf5GxuvvVcXEhw==} engines: {node: '>=20'} @@ -8337,9 +8515,6 @@ packages: peerDependencies: typescript: '>=4.8.4' - ts-interface-checker@0.1.13: - resolution: {integrity: sha512-Y/arvbn+rrz3JCKl9C4kVNfTfSm2/mEp5FSz5EsZSANGPSlQrpRI5M4PKF+mJnE52jOO90PnPSc3Ur3bTQw0gA==} - ts-japi@1.12.1: resolution: {integrity: sha512-wATSiA26LAMXe9fEBm+UjuORWjqLhShBEgRw00ORAv5Lcq3OwdOpHnbqKuNGU077pit8p2MUga0fomBYBk39WA==} engines: {node: '>=10'} @@ -8350,27 +8525,36 @@ packages: tsconfig-paths@3.15.0: resolution: {integrity: sha512-2Ac2RgzDe/cn48GvOe3M+o82pEFewD3UPbyoUHHdKasHwJKjds4fLXWf/Ux5kATBKN20oaFGu+jbElp1pos0mg==} - tslib@2.8.1: - resolution: {integrity: sha512-oJFu94HQb+KVduSUQL7wnpmqnfmLsOA/nAh6b6EH0wCEoK0/mPeXU6c3wKDV83MkOuHPRHtSXKKU99IBazS/2w==} - - tsup@8.5.0: - resolution: {integrity: sha512-VmBp77lWNQq6PfuMqCHD3xWl22vEoWsKajkF8t+yMBawlUS8JzEI+vOVMeuNZIuMML8qXRizFKi9oD5glKQVcQ==} - engines: {node: '>=18'} + tsdown@0.21.8: + resolution: {integrity: sha512-rHDIER4JU5owYTWptvyDk6pwfA5lCft1P+11HLGeF0uj0CB7vopFvr/E8QOaRmegeyHIEsu4+03j7ysvdgBAVA==} + engines: {node: '>=20.19.0'} hasBin: true peerDependencies: - '@microsoft/api-extractor': ^7.36.0 - '@swc/core': ^1 - postcss: ^8.4.12 - typescript: '>=4.5.0' + '@arethetypeswrong/core': ^0.18.1 + '@tsdown/css': 0.21.8 + '@tsdown/exe': 0.21.8 + '@vitejs/devtools': '*' + publint: ^0.3.0 + typescript: ^5.0.0 || ^6.0.0 + unplugin-unused: ^0.5.0 peerDependenciesMeta: - '@microsoft/api-extractor': + '@arethetypeswrong/core': + optional: true + '@tsdown/css': optional: true - '@swc/core': + '@tsdown/exe': optional: true - postcss: + '@vitejs/devtools': + optional: true + publint: optional: true typescript: optional: true + unplugin-unused: + optional: true + + tslib@2.8.1: + resolution: {integrity: sha512-oJFu94HQb+KVduSUQL7wnpmqnfmLsOA/nAh6b6EH0wCEoK0/mPeXU6c3wKDV83MkOuHPRHtSXKKU99IBazS/2w==} tsx@4.20.3: resolution: {integrity: sha512-qjbnuR9Tr+FJOMBqJCW5ehvIo/buZq7vH7qD7JziU98h6l3qGy0a/yPFjwO+y0/T7GFpNgNAvEcPPVfyT8rrPQ==} @@ -8485,15 +8669,15 @@ packages: resolution: {integrity: sha512-nWJ91DjeOkej/TA8pXQ3myruKpKEYgqvpw9lz4OPHj/NWFNluYrjbz9j01CJ8yKQd2g4jFoOkINCTW2I5LEEyw==} engines: {node: '>= 0.4'} + unconfig-core@7.5.0: + resolution: {integrity: sha512-Su3FauozOGP44ZmKdHy2oE6LPjk51M/TRRjHv2HNCWiDvfvCoxC2lno6jevMA91MYAdCdwP05QnWdWpSbncX/w==} + uncrypto@0.1.3: resolution: {integrity: sha512-Ql87qFHB3s/De2ClA9e0gsnS6zXG27SkTiSJwjCc9MebbfapQfuPzumMIUMi38ezPZVNFcHI9sUIepeQfw8J8Q==} unctx@2.5.0: resolution: {integrity: sha512-p+Rz9x0R7X+CYDkT+Xg8/GhpcShTlU8n+cf9OtOEf7zEQsNcCZO1dPKNRDqvUTaq+P32PMMkxWHwfrxkqfqAYg==} - undici-types@6.19.8: - resolution: {integrity: sha512-ve2KP6f/JnbPBFyobGHuerC9g1FYGn/F8n1LWTwNxCEzd6IfqTwUQcNXgEtmmQ6DlRrC1hrSrBnCZPokRrDHjw==} - undici-types@6.21.0: resolution: {integrity: sha512-iwDZqg0QAGrg9Rav5H4n0M64c3mkR59cJ6wQp+7C4nI0gsmExaedaYLNO44eT4AtBBwjbTiGPMlt2Md0T9H9JQ==} @@ -8555,6 +8739,16 @@ packages: unrs-resolver@1.11.1: resolution: {integrity: sha512-bSjt9pjaEBnNiGgc9rUiHGKv5l4/TGzDmYw3RhnkJGtLhbnnA/5qJj7x3dNDCRx/PJxu774LlH8lCOlB4hEfKg==} + unrun@0.2.35: + resolution: {integrity: sha512-nDP7mA4Fu5owDarQtLiiN3lq7tJZHFEAVIchnwP8U3wMeEkLoUNT37Hva85H05Rdw8CArpGmtY+lBjpk9fruVQ==} + engines: {node: '>=20.19.0'} + hasBin: true + peerDependencies: + synckit: ^0.11.11 + peerDependenciesMeta: + synckit: + optional: true + unstorage@1.17.4: resolution: {integrity: sha512-fHK0yNg38tBiJKp/Vgsq4j0JEsCmgqH58HAn707S7zGkArbZsVr/CwINoi+nh3h98BRCwKvx1K3Xg9u3VV83sw==} peerDependencies: @@ -8939,9 +9133,6 @@ packages: webidl-conversions@3.0.1: resolution: {integrity: sha512-2JAn3z8AR6rjK8Sm8orRC0h/bcl/DqL7tRPdGZ4I1CjdF+EaMLmYxBHyXuKL849eucPFhvBoxMsflfOb8kxaeQ==} - webidl-conversions@4.0.2: - resolution: {integrity: sha512-YQ+BmxuTgd6UXZW3+ICGfyqRyHXVlD5GtQr5+qjiNW7bF0cqrzX500HVXPBOvgXb5YnzDd+h0zqyv61KUD7+Sg==} - webidl-conversions@8.0.1: resolution: {integrity: sha512-BMhLD/Sw+GbJC21C/UgyaZX41nPt8bUTg+jWyDeg7e7YN4xOM05YPSIXceACnXVtqyEw/LMClUQMtMZ+PGGpqQ==} engines: {node: '>=20'} @@ -8973,9 +9164,6 @@ packages: whatwg-url@5.0.0: resolution: {integrity: sha512-saE57nupxk6v3HY35+jzBwYa0rKSy0XR8JSxZPwgLr7ys0IBzhGviA1/TUGJLmSVqs8pb9AnvICXEuOHLprYTw==} - whatwg-url@7.1.0: - resolution: {integrity: sha512-WUu7Rg1DroM7oQvGWfOiAK21n74Gg+T4elXEQYkOhtyLeWiJFoOGLXPKI/9gzIie9CtwVLm8wtw6YJdKyxSjeg==} - which-boxed-primitive@1.1.1: resolution: {integrity: sha512-TbX3mj8n0odCBFVlY8AxkqcHASw3L60jIuF8jFP78az3C2YhmGvqbHBpAjTRH2/xqYunrJ9g1jSyjCjpoWzIAA==} engines: {node: '>= 0.4'} @@ -9216,8 +9404,8 @@ snapshots: '@babel/generator@7.28.5': dependencies: - '@babel/parser': 7.28.5 - '@babel/types': 7.28.5 + '@babel/parser': 7.29.2 + '@babel/types': 7.29.0 '@jridgewell/gen-mapping': 0.3.13 '@jridgewell/trace-mapping': 0.3.31 jsesc: 3.1.0 @@ -9238,6 +9426,15 @@ snapshots: '@jridgewell/trace-mapping': 0.3.31 jsesc: 3.1.0 + '@babel/generator@8.0.0-rc.3': + dependencies: + '@babel/parser': 8.0.0-rc.3 + '@babel/types': 8.0.0-rc.3 + '@jridgewell/gen-mapping': 0.3.13 + '@jridgewell/trace-mapping': 0.3.31 + '@types/jsesc': 2.5.1 + jsesc: 3.1.0 + '@babel/helper-annotate-as-pure@7.27.3': dependencies: '@babel/types': 7.28.5 @@ -9276,14 +9473,14 @@ snapshots: '@babel/helper-member-expression-to-functions@7.28.5': dependencies: '@babel/traverse': 7.28.5 - '@babel/types': 7.28.5 + '@babel/types': 7.29.0 transitivePeerDependencies: - supports-color '@babel/helper-module-imports@7.27.1': dependencies: '@babel/traverse': 7.28.5 - '@babel/types': 7.28.5 + '@babel/types': 7.29.0 transitivePeerDependencies: - supports-color @@ -9314,7 +9511,7 @@ snapshots: '@babel/helper-optimise-call-expression@7.27.1': dependencies: - '@babel/types': 7.28.5 + '@babel/types': 7.29.0 '@babel/helper-plugin-utils@7.28.6': {} @@ -9336,14 +9533,18 @@ snapshots: '@babel/helper-string-parser@7.27.1': {} + '@babel/helper-string-parser@8.0.0-rc.3': {} + '@babel/helper-validator-identifier@7.28.5': {} + '@babel/helper-validator-identifier@8.0.0-rc.3': {} + '@babel/helper-validator-option@7.27.1': {} '@babel/helpers@7.28.4': dependencies: '@babel/template': 7.27.2 - '@babel/types': 7.28.5 + '@babel/types': 7.29.0 '@babel/helpers@7.28.6': dependencies: @@ -9365,7 +9566,10 @@ snapshots: '@babel/parser@7.29.2': dependencies: '@babel/types': 7.29.0 - optional: true + + '@babel/parser@8.0.0-rc.3': + dependencies: + '@babel/types': 8.0.0-rc.3 '@babel/plugin-syntax-jsx@7.28.6(@babel/core@7.29.0)': dependencies: @@ -9453,8 +9657,8 @@ snapshots: '@babel/template@7.27.2': dependencies: '@babel/code-frame': 7.29.0 - '@babel/parser': 7.28.5 - '@babel/types': 7.28.5 + '@babel/parser': 7.29.2 + '@babel/types': 7.29.0 '@babel/template@7.28.6': dependencies: @@ -9465,11 +9669,11 @@ snapshots: '@babel/traverse@7.28.5': dependencies: '@babel/code-frame': 7.29.0 - '@babel/generator': 7.28.5 + '@babel/generator': 7.29.1 '@babel/helper-globals': 7.28.0 - '@babel/parser': 7.28.5 + '@babel/parser': 7.29.2 '@babel/template': 7.27.2 - '@babel/types': 7.28.5 + '@babel/types': 7.29.0 debug: 4.4.3 transitivePeerDependencies: - supports-color @@ -9513,27 +9717,32 @@ snapshots: '@babel/helper-string-parser': 7.27.1 '@babel/helper-validator-identifier': 7.28.5 + '@babel/types@8.0.0-rc.3': + dependencies: + '@babel/helper-string-parser': 8.0.0-rc.3 + '@babel/helper-validator-identifier': 8.0.0-rc.3 + '@bcoe/v8-coverage@1.0.2': {} - '@better-auth/cli@1.4.19(@better-fetch/fetch@1.1.21)(@sveltejs/kit@2.53.2(@sveltejs/vite-plugin-svelte@6.2.1(svelte@5.53.5)(vite@7.3.1(@types/node@25.5.2)(jiti@2.6.1)(lightningcss@1.30.2)(terser@5.44.0)(tsx@4.20.3)(yaml@2.8.2)))(svelte@5.53.5)(typescript@5.9.3)(vite@7.3.1(@types/node@25.5.2)(jiti@2.6.1)(lightningcss@1.30.2)(terser@5.44.0)(tsx@4.20.3)(yaml@2.8.2)))(@types/better-sqlite3@7.6.13)(@types/sql.js@1.4.9)(better-call@1.1.8(zod@4.3.6))(bun-types@1.3.3)(jose@6.1.2)(kysely@0.28.8)(magicast@0.5.1)(mysql2@3.16.1)(nanostores@1.0.1)(next@16.1.6(@babel/core@7.29.0)(react-dom@19.2.0(react@19.2.0))(react@19.2.0))(prisma@6.19.0(magicast@0.5.1)(typescript@5.9.3))(react-dom@19.2.0(react@19.2.0))(react@19.2.0)(sql.js@1.13.0)(svelte@5.53.5)(vitest@4.0.14(@edge-runtime/vm@5.0.0)(@types/node@25.5.2)(happy-dom@20.8.9)(jiti@2.6.1)(jsdom@27.1.0)(lightningcss@1.30.2)(terser@5.44.0)(tsx@4.20.3)(yaml@2.8.2))(vue@3.5.29(typescript@5.9.3))': + '@better-auth/cli@1.4.19(@better-fetch/fetch@1.1.21)(@sveltejs/kit@2.53.2(@sveltejs/vite-plugin-svelte@6.2.1(svelte@5.53.5)(vite@7.3.1(@types/node@25.5.2)(jiti@2.6.1)(lightningcss@1.30.2)(terser@5.44.0)(tsx@4.20.3)(yaml@2.8.2)))(svelte@5.53.5)(typescript@5.9.3)(vite@7.3.1(@types/node@25.5.2)(jiti@2.6.1)(lightningcss@1.30.2)(terser@5.44.0)(tsx@4.20.3)(yaml@2.8.2)))(@types/better-sqlite3@7.6.13)(@types/sql.js@1.4.9)(better-call@1.1.8(zod@4.3.6))(bun-types@1.3.3)(jose@6.1.2)(kysely@0.28.16)(magicast@0.5.1)(mysql2@3.16.1)(nanostores@1.0.1)(next@16.1.6(@babel/core@7.29.0)(react-dom@19.2.0(react@19.2.0))(react@19.2.0))(prisma@6.19.0(magicast@0.5.1)(typescript@5.9.3))(react-dom@19.2.0(react@19.2.0))(react@19.2.0)(sql.js@1.13.0)(svelte@5.53.5)(vitest@4.0.14(@edge-runtime/vm@5.0.0)(@types/node@25.5.2)(happy-dom@20.8.9)(jiti@2.6.1)(jsdom@27.1.0)(lightningcss@1.30.2)(terser@5.44.0)(tsx@4.20.3)(yaml@2.8.2))(vue@3.5.29(typescript@5.9.3))': dependencies: '@babel/core': 7.29.0 '@babel/preset-react': 7.28.5(@babel/core@7.29.0) '@babel/preset-typescript': 7.28.5(@babel/core@7.29.0) - '@better-auth/core': 1.4.19(@better-auth/utils@0.3.0)(@better-fetch/fetch@1.1.21)(better-call@1.1.8(zod@4.3.6))(jose@6.1.2)(kysely@0.28.8)(nanostores@1.0.1) - '@better-auth/telemetry': 1.4.19(@better-auth/core@1.4.19(@better-auth/utils@0.3.0)(@better-fetch/fetch@1.1.21)(better-call@1.1.8(zod@4.3.6))(jose@6.1.2)(kysely@0.28.8)(nanostores@1.0.1)) + '@better-auth/core': 1.4.19(@better-auth/utils@0.3.0)(@better-fetch/fetch@1.1.21)(better-call@1.1.8(zod@4.3.6))(jose@6.1.2)(kysely@0.28.16)(nanostores@1.0.1) + '@better-auth/telemetry': 1.4.19(@better-auth/core@1.4.19(@better-auth/utils@0.3.0)(@better-fetch/fetch@1.1.21)(better-call@1.1.8(zod@4.3.6))(jose@6.1.2)(kysely@0.28.16)(nanostores@1.0.1)) '@better-auth/utils': 0.3.0 '@clack/prompts': 0.11.0 '@mrleebo/prisma-ast': 0.13.1 '@prisma/client': 5.22.0(prisma@6.19.0(magicast@0.5.1)(typescript@5.9.3)) '@types/pg': 8.16.0 - better-auth: 1.4.19(9698e865c69f9d604fb4edbe7906cba1) + better-auth: 1.4.19(f276412306c0f31e69da8456c8cd9497) better-sqlite3: 12.5.0 c12: 3.3.3(magicast@0.5.1) chalk: 5.6.2 commander: 12.1.0 dotenv: 17.2.3 - drizzle-orm: 0.41.0(@prisma/client@5.22.0(prisma@6.19.0(magicast@0.5.1)(typescript@5.9.3)))(@types/better-sqlite3@7.6.13)(@types/pg@8.16.0)(@types/sql.js@1.4.9)(better-sqlite3@12.5.0)(bun-types@1.3.3)(kysely@0.28.8)(mysql2@3.16.1)(pg@8.16.3)(prisma@6.19.0(magicast@0.5.1)(typescript@5.9.3))(sql.js@1.13.0) + drizzle-orm: 0.41.0(@prisma/client@5.22.0(prisma@6.19.0(magicast@0.5.1)(typescript@5.9.3)))(@types/better-sqlite3@7.6.13)(@types/pg@8.16.0)(@types/sql.js@1.4.9)(better-sqlite3@12.5.0)(bun-types@1.3.3)(kysely@0.28.16)(mysql2@3.16.1)(pg@8.16.3)(prisma@6.19.0(magicast@0.5.1)(typescript@5.9.3))(sql.js@1.13.0) open: 10.2.0 pg: 8.16.3 prettier: 3.8.1 @@ -9587,20 +9796,20 @@ snapshots: - vitest - vue - '@better-auth/core@1.4.19(@better-auth/utils@0.3.0)(@better-fetch/fetch@1.1.21)(better-call@1.1.8(zod@4.3.6))(jose@6.1.2)(kysely@0.28.8)(nanostores@1.0.1)': + '@better-auth/core@1.4.19(@better-auth/utils@0.3.0)(@better-fetch/fetch@1.1.21)(better-call@1.1.8(zod@4.3.6))(jose@6.1.2)(kysely@0.28.16)(nanostores@1.0.1)': dependencies: '@better-auth/utils': 0.3.0 '@better-fetch/fetch': 1.1.21 '@standard-schema/spec': 1.0.0 better-call: 1.1.8(zod@4.3.6) jose: 6.1.2 - kysely: 0.28.8 + kysely: 0.28.16 nanostores: 1.0.1 zod: 4.3.6 - '@better-auth/telemetry@1.4.19(@better-auth/core@1.4.19(@better-auth/utils@0.3.0)(@better-fetch/fetch@1.1.21)(better-call@1.1.8(zod@4.3.6))(jose@6.1.2)(kysely@0.28.8)(nanostores@1.0.1))': + '@better-auth/telemetry@1.4.19(@better-auth/core@1.4.19(@better-auth/utils@0.3.0)(@better-fetch/fetch@1.1.21)(better-call@1.1.8(zod@4.3.6))(jose@6.1.2)(kysely@0.28.16)(nanostores@1.0.1))': dependencies: - '@better-auth/core': 1.4.19(@better-auth/utils@0.3.0)(@better-fetch/fetch@1.1.21)(better-call@1.1.8(zod@4.3.6))(jose@6.1.2)(kysely@0.28.8)(nanostores@1.0.1) + '@better-auth/core': 1.4.19(@better-auth/utils@0.3.0)(@better-fetch/fetch@1.1.21)(better-call@1.1.8(zod@4.3.6))(jose@6.1.2)(kysely@0.28.16)(nanostores@1.0.1) '@better-auth/utils': 0.3.0 '@better-fetch/fetch': 1.1.21 @@ -9731,16 +9940,32 @@ snapshots: tslib: 2.8.1 optional: true + '@emnapi/core@1.9.2': + dependencies: + '@emnapi/wasi-threads': 1.2.1 + tslib: 2.8.1 + optional: true + '@emnapi/runtime@1.7.1': dependencies: tslib: 2.8.1 optional: true + '@emnapi/runtime@1.9.2': + dependencies: + tslib: 2.8.1 + optional: true + '@emnapi/wasi-threads@1.1.0': dependencies: tslib: 2.8.1 optional: true + '@emnapi/wasi-threads@1.2.1': + dependencies: + tslib: 2.8.1 + optional: true + '@esbuild/aix-ppc64@0.25.5': optional: true @@ -10160,19 +10385,13 @@ snapshots: '@isaacs/fs-minipass@4.0.1': dependencies: - minipass: 7.1.2 + minipass: 7.1.3 '@jridgewell/gen-mapping@0.3.13': dependencies: '@jridgewell/sourcemap-codec': 1.5.5 '@jridgewell/trace-mapping': 0.3.31 - '@jridgewell/gen-mapping@0.3.8': - dependencies: - '@jridgewell/set-array': 1.2.1 - '@jridgewell/sourcemap-codec': 1.5.5 - '@jridgewell/trace-mapping': 0.3.25 - '@jridgewell/remapping@2.3.5': dependencies: '@jridgewell/gen-mapping': 0.3.13 @@ -10180,22 +10399,13 @@ snapshots: '@jridgewell/resolve-uri@3.1.2': {} - '@jridgewell/set-array@1.2.1': {} - '@jridgewell/source-map@0.3.11': dependencies: '@jridgewell/gen-mapping': 0.3.13 '@jridgewell/trace-mapping': 0.3.31 - '@jridgewell/sourcemap-codec@1.5.0': {} - '@jridgewell/sourcemap-codec@1.5.5': {} - '@jridgewell/trace-mapping@0.3.25': - dependencies: - '@jridgewell/resolve-uri': 3.1.2 - '@jridgewell/sourcemap-codec': 1.5.5 - '@jridgewell/trace-mapping@0.3.31': dependencies: '@jridgewell/resolve-uri': 3.1.2 @@ -10250,6 +10460,13 @@ snapshots: '@tybys/wasm-util': 0.10.1 optional: true + '@napi-rs/wasm-runtime@1.1.3(@emnapi/core@1.9.2)(@emnapi/runtime@1.9.2)': + dependencies: + '@emnapi/core': 1.9.2 + '@emnapi/runtime': 1.9.2 + '@tybys/wasm-util': 0.10.1 + optional: true + '@next/env@16.1.6': {} '@next/eslint-plugin-next@16.0.1': @@ -10425,7 +10642,7 @@ snapshots: transitivePeerDependencies: - magicast - '@nuxt/nitro-server@4.3.1(better-sqlite3@12.5.0)(db0@0.3.4(better-sqlite3@12.5.0)(drizzle-orm@0.41.0(@prisma/client@5.22.0(prisma@6.19.0(magicast@0.5.1)(typescript@5.9.3)))(@types/better-sqlite3@7.6.13)(@types/pg@8.16.0)(@types/sql.js@1.4.9)(better-sqlite3@12.5.0)(bun-types@1.3.3)(kysely@0.28.8)(mysql2@3.16.1)(pg@8.16.3)(prisma@6.19.0(magicast@0.5.1)(typescript@5.9.3))(sql.js@1.13.0))(mysql2@3.16.1))(drizzle-orm@0.41.0(@prisma/client@5.22.0(prisma@6.19.0(magicast@0.5.1)(typescript@5.9.3)))(@types/better-sqlite3@7.6.13)(@types/pg@8.16.0)(@types/sql.js@1.4.9)(better-sqlite3@12.5.0)(bun-types@1.3.3)(kysely@0.28.8)(mysql2@3.16.1)(pg@8.16.3)(prisma@6.19.0(magicast@0.5.1)(typescript@5.9.3))(sql.js@1.13.0))(ioredis@5.9.3)(magicast@0.5.1)(mysql2@3.16.1)(nuxt@4.3.1(cfda133a7eabcf873b5dad9c91eb52c2))(typescript@5.9.3)': + '@nuxt/nitro-server@4.3.1(better-sqlite3@12.5.0)(db0@0.3.4(better-sqlite3@12.5.0)(drizzle-orm@0.41.0(@prisma/client@5.22.0(prisma@6.19.0(magicast@0.5.1)(typescript@5.9.3)))(@types/better-sqlite3@7.6.13)(@types/pg@8.16.0)(@types/sql.js@1.4.9)(better-sqlite3@12.5.0)(bun-types@1.3.3)(kysely@0.28.16)(mysql2@3.16.1)(pg@8.16.3)(prisma@6.19.0(magicast@0.5.1)(typescript@5.9.3))(sql.js@1.13.0))(mysql2@3.16.1))(drizzle-orm@0.41.0(@prisma/client@5.22.0(prisma@6.19.0(magicast@0.5.1)(typescript@5.9.3)))(@types/better-sqlite3@7.6.13)(@types/pg@8.16.0)(@types/sql.js@1.4.9)(better-sqlite3@12.5.0)(bun-types@1.3.3)(kysely@0.28.16)(mysql2@3.16.1)(pg@8.16.3)(prisma@6.19.0(magicast@0.5.1)(typescript@5.9.3))(sql.js@1.13.0))(ioredis@5.9.3)(magicast@0.5.1)(mysql2@3.16.1)(nuxt@4.3.1(c09e06bbcbcd2b0a94c9a804d2c88498))(rolldown@1.0.0-rc.15)(typescript@5.9.3)': dependencies: '@nuxt/devalue': 2.0.2 '@nuxt/kit': 4.3.1(magicast@0.5.1) @@ -10442,8 +10659,8 @@ snapshots: impound: 1.0.0 klona: 2.0.6 mocked-exports: 0.1.1 - nitropack: 2.13.1(better-sqlite3@12.5.0)(drizzle-orm@0.41.0(@prisma/client@5.22.0(prisma@6.19.0(magicast@0.5.1)(typescript@5.9.3)))(@types/better-sqlite3@7.6.13)(@types/pg@8.16.0)(@types/sql.js@1.4.9)(better-sqlite3@12.5.0)(bun-types@1.3.3)(kysely@0.28.8)(mysql2@3.16.1)(pg@8.16.3)(prisma@6.19.0(magicast@0.5.1)(typescript@5.9.3))(sql.js@1.13.0))(mysql2@3.16.1) - nuxt: 4.3.1(cfda133a7eabcf873b5dad9c91eb52c2) + nitropack: 2.13.1(better-sqlite3@12.5.0)(drizzle-orm@0.41.0(@prisma/client@5.22.0(prisma@6.19.0(magicast@0.5.1)(typescript@5.9.3)))(@types/better-sqlite3@7.6.13)(@types/pg@8.16.0)(@types/sql.js@1.4.9)(better-sqlite3@12.5.0)(bun-types@1.3.3)(kysely@0.28.16)(mysql2@3.16.1)(pg@8.16.3)(prisma@6.19.0(magicast@0.5.1)(typescript@5.9.3))(sql.js@1.13.0))(mysql2@3.16.1)(rolldown@1.0.0-rc.15) + nuxt: 4.3.1(c09e06bbcbcd2b0a94c9a804d2c88498) ohash: 2.0.11 pathe: 2.0.3 pkg-types: 2.3.0 @@ -10451,7 +10668,7 @@ snapshots: std-env: 3.10.0 ufo: 1.6.3 unctx: 2.5.0 - unstorage: 1.17.4(db0@0.3.4(better-sqlite3@12.5.0)(drizzle-orm@0.41.0(@prisma/client@5.22.0(prisma@6.19.0(magicast@0.5.1)(typescript@5.9.3)))(@types/better-sqlite3@7.6.13)(@types/pg@8.16.0)(@types/sql.js@1.4.9)(better-sqlite3@12.5.0)(bun-types@1.3.3)(kysely@0.28.8)(mysql2@3.16.1)(pg@8.16.3)(prisma@6.19.0(magicast@0.5.1)(typescript@5.9.3))(sql.js@1.13.0))(mysql2@3.16.1))(ioredis@5.9.3) + unstorage: 1.17.4(db0@0.3.4(better-sqlite3@12.5.0)(drizzle-orm@0.41.0(@prisma/client@5.22.0(prisma@6.19.0(magicast@0.5.1)(typescript@5.9.3)))(@types/better-sqlite3@7.6.13)(@types/pg@8.16.0)(@types/sql.js@1.4.9)(better-sqlite3@12.5.0)(bun-types@1.3.3)(kysely@0.28.16)(mysql2@3.16.1)(pg@8.16.3)(prisma@6.19.0(magicast@0.5.1)(typescript@5.9.3))(sql.js@1.13.0))(mysql2@3.16.1))(ioredis@5.9.3) vue: 3.5.29(typescript@5.9.3) vue-bundle-renderer: 2.2.0 vue-devtools-stub: 0.1.0 @@ -10507,7 +10724,7 @@ snapshots: rc9: 3.0.0 std-env: 3.10.0 - '@nuxt/vite-builder@4.3.1(@types/node@25.5.2)(eslint@9.29.0(jiti@2.6.1))(lightningcss@1.30.2)(magicast@0.5.1)(nuxt@4.3.1(cfda133a7eabcf873b5dad9c91eb52c2))(optionator@0.9.4)(rollup@4.59.0)(terser@5.44.0)(tsx@4.20.3)(typescript@5.9.3)(vue-tsc@3.2.5(typescript@5.9.3))(vue@3.5.29(typescript@5.9.3))(yaml@2.8.2)': + '@nuxt/vite-builder@4.3.1(@types/node@25.5.2)(eslint@9.29.0(jiti@2.6.1))(lightningcss@1.30.2)(magicast@0.5.1)(nuxt@4.3.1(c09e06bbcbcd2b0a94c9a804d2c88498))(optionator@0.9.4)(rolldown@1.0.0-rc.15)(rollup@4.59.0)(terser@5.44.0)(tsx@4.20.3)(typescript@5.9.3)(vue-tsc@3.2.5(typescript@5.9.3))(vue@3.5.29(typescript@5.9.3))(yaml@2.8.2)': dependencies: '@nuxt/kit': 4.3.1(magicast@0.5.1) '@rollup/plugin-replace': 6.0.3(rollup@4.59.0) @@ -10526,11 +10743,11 @@ snapshots: magic-string: 0.30.21 mlly: 1.8.0 mocked-exports: 0.1.1 - nuxt: 4.3.1(cfda133a7eabcf873b5dad9c91eb52c2) + nuxt: 4.3.1(c09e06bbcbcd2b0a94c9a804d2c88498) pathe: 2.0.3 pkg-types: 2.3.0 postcss: 8.5.6 - rollup-plugin-visualizer: 6.0.5(rollup@4.59.0) + rollup-plugin-visualizer: 6.0.5(rolldown@1.0.0-rc.15)(rollup@4.59.0) seroval: 1.5.0 std-env: 3.10.0 ufo: 1.6.3 @@ -10540,6 +10757,8 @@ snapshots: vite-plugin-checker: 0.12.0(eslint@9.29.0(jiti@2.6.1))(optionator@0.9.4)(typescript@5.9.3)(vite@7.3.1(@types/node@25.5.2)(jiti@2.6.1)(lightningcss@1.30.2)(terser@5.44.0)(tsx@4.20.3)(yaml@2.8.2))(vue-tsc@3.2.5(typescript@5.9.3)) vue: 3.5.29(typescript@5.9.3) vue-bundle-renderer: 2.2.0 + optionalDependencies: + rolldown: 1.0.0-rc.15 transitivePeerDependencies: - '@biomejs/biome' - '@types/node' @@ -10700,6 +10919,8 @@ snapshots: '@oxc-project/types@0.112.0': {} + '@oxc-project/types@0.124.0': {} + '@oxc-transform/binding-android-arm-eabi@0.112.0': optional: true @@ -10894,6 +11115,10 @@ snapshots: dependencies: '@prisma/debug': 6.19.0 + '@quansync/fs@1.0.0': + dependencies: + quansync: 1.0.0 + '@readme/better-ajv-errors@2.4.0(ajv@8.18.0)': dependencies: '@babel/code-frame': 7.29.0 @@ -10916,6 +11141,57 @@ snapshots: '@readme/openapi-schemas@3.1.0': {} + '@rolldown/binding-android-arm64@1.0.0-rc.15': + optional: true + + '@rolldown/binding-darwin-arm64@1.0.0-rc.15': + optional: true + + '@rolldown/binding-darwin-x64@1.0.0-rc.15': + optional: true + + '@rolldown/binding-freebsd-x64@1.0.0-rc.15': + optional: true + + '@rolldown/binding-linux-arm-gnueabihf@1.0.0-rc.15': + optional: true + + '@rolldown/binding-linux-arm64-gnu@1.0.0-rc.15': + optional: true + + '@rolldown/binding-linux-arm64-musl@1.0.0-rc.15': + optional: true + + '@rolldown/binding-linux-ppc64-gnu@1.0.0-rc.15': + optional: true + + '@rolldown/binding-linux-s390x-gnu@1.0.0-rc.15': + optional: true + + '@rolldown/binding-linux-x64-gnu@1.0.0-rc.15': + optional: true + + '@rolldown/binding-linux-x64-musl@1.0.0-rc.15': + optional: true + + '@rolldown/binding-openharmony-arm64@1.0.0-rc.15': + optional: true + + '@rolldown/binding-wasm32-wasi@1.0.0-rc.15': + dependencies: + '@emnapi/core': 1.9.2 + '@emnapi/runtime': 1.9.2 + '@napi-rs/wasm-runtime': 1.1.3(@emnapi/core@1.9.2)(@emnapi/runtime@1.9.2) + optional: true + + '@rolldown/binding-win32-arm64-msvc@1.0.0-rc.15': + optional: true + + '@rolldown/binding-win32-x64-msvc@1.0.0-rc.15': + optional: true + + '@rolldown/pluginutils@1.0.0-rc.15': {} + '@rolldown/pluginutils@1.0.0-rc.2': {} '@rolldown/pluginutils@1.0.0-rc.5': {} @@ -11173,65 +11449,10 @@ snapshots: transitivePeerDependencies: - supports-color - '@swc/core-darwin-arm64@1.12.5': - optional: true - - '@swc/core-darwin-x64@1.12.5': - optional: true - - '@swc/core-linux-arm-gnueabihf@1.12.5': - optional: true - - '@swc/core-linux-arm64-gnu@1.12.5': - optional: true - - '@swc/core-linux-arm64-musl@1.12.5': - optional: true - - '@swc/core-linux-x64-gnu@1.12.5': - optional: true - - '@swc/core-linux-x64-musl@1.12.5': - optional: true - - '@swc/core-win32-arm64-msvc@1.12.5': - optional: true - - '@swc/core-win32-ia32-msvc@1.12.5': - optional: true - - '@swc/core-win32-x64-msvc@1.12.5': - optional: true - - '@swc/core@1.12.5': - dependencies: - '@swc/counter': 0.1.3 - '@swc/types': 0.1.26 - optionalDependencies: - '@swc/core-darwin-arm64': 1.12.5 - '@swc/core-darwin-x64': 1.12.5 - '@swc/core-linux-arm-gnueabihf': 1.12.5 - '@swc/core-linux-arm64-gnu': 1.12.5 - '@swc/core-linux-arm64-musl': 1.12.5 - '@swc/core-linux-x64-gnu': 1.12.5 - '@swc/core-linux-x64-musl': 1.12.5 - '@swc/core-win32-arm64-msvc': 1.12.5 - '@swc/core-win32-ia32-msvc': 1.12.5 - '@swc/core-win32-x64-msvc': 1.12.5 - optional: true - - '@swc/counter@0.1.3': - optional: true - '@swc/helpers@0.5.15': dependencies: tslib: 2.8.1 - '@swc/types@0.1.26': - dependencies: - '@swc/counter': 0.1.3 - optional: true - '@tailwindcss/node@4.1.16': dependencies: '@jridgewell/remapping': 2.3.5 @@ -11447,7 +11668,7 @@ snapshots: '@types/body-parser@1.19.6': dependencies: '@types/connect': 3.4.38 - '@types/node': 20.17.24 + '@types/node': 25.5.2 '@types/chai@5.2.2': dependencies: @@ -11473,7 +11694,7 @@ snapshots: '@types/express-serve-static-core@5.1.0': dependencies: - '@types/node': 20.19.24 + '@types/node': 25.5.2 '@types/qs': 6.14.0 '@types/range-parser': 1.2.7 '@types/send': 1.2.0 @@ -11486,6 +11707,8 @@ snapshots: '@types/http-errors@2.0.5': {} + '@types/jsesc@2.5.1': {} + '@types/json-schema@7.0.15': {} '@types/json5@0.0.29': {} @@ -11494,10 +11717,6 @@ snapshots: '@types/mime@1.3.5': {} - '@types/node@20.17.24': - dependencies: - undici-types: 6.19.8 - '@types/node@20.19.24': dependencies: undici-types: 6.21.0 @@ -11508,13 +11727,13 @@ snapshots: '@types/pg@8.11.11': dependencies: - '@types/node': 20.17.24 + '@types/node': 25.5.2 pg-protocol: 1.10.3 pg-types: 4.0.2 '@types/pg@8.15.6': dependencies: - '@types/node': 20.19.24 + '@types/node': 25.5.2 pg-protocol: 1.10.3 pg-types: 2.2.0 @@ -11554,13 +11773,13 @@ snapshots: '@types/serve-static@1.15.9': dependencies: '@types/http-errors': 2.0.5 - '@types/node': 20.19.24 + '@types/node': 25.5.2 '@types/send': 0.17.5 '@types/sql.js@1.4.9': dependencies: '@types/emscripten': 1.40.1 - '@types/node': 20.17.24 + '@types/node': 25.5.2 '@types/superagent@8.1.9': dependencies: @@ -11719,7 +11938,7 @@ snapshots: fast-glob: 3.3.3 is-glob: 4.0.3 minimatch: 9.0.8 - semver: 7.7.3 + semver: 7.7.4 ts-api-utils: 2.1.0(typescript@5.9.3) typescript: 5.9.3 transitivePeerDependencies: @@ -11735,7 +11954,7 @@ snapshots: fast-glob: 3.3.3 is-glob: 4.0.3 minimatch: 9.0.8 - semver: 7.7.3 + semver: 7.7.4 ts-api-utils: 2.1.0(typescript@5.9.3) typescript: 5.9.3 transitivePeerDependencies: @@ -11995,7 +12214,7 @@ snapshots: '@babel/core': 7.29.0 '@babel/helper-module-imports': 7.28.6 '@babel/helper-plugin-utils': 7.28.6 - '@babel/parser': 7.29.0 + '@babel/parser': 7.29.2 '@vue/compiler-sfc': 3.5.26 transitivePeerDependencies: - supports-color @@ -12010,7 +12229,7 @@ snapshots: '@vue/compiler-core@3.5.26': dependencies: - '@babel/parser': 7.28.5 + '@babel/parser': 7.29.2 '@vue/shared': 3.5.26 entities: 7.0.1 estree-walker: 2.0.2 @@ -12018,7 +12237,7 @@ snapshots: '@vue/compiler-core@3.5.29': dependencies: - '@babel/parser': 7.29.0 + '@babel/parser': 7.29.2 '@vue/shared': 3.5.29 entities: 7.0.1 estree-walker: 2.0.2 @@ -12053,7 +12272,7 @@ snapshots: '@vue/compiler-sfc@3.5.26': dependencies: - '@babel/parser': 7.29.0 + '@babel/parser': 7.29.2 '@vue/compiler-core': 3.5.26 '@vue/compiler-dom': 3.5.26 '@vue/compiler-ssr': 3.5.26 @@ -12255,8 +12474,6 @@ snapshots: ansis@4.2.0: {} - any-promise@1.3.0: {} - anymatch@3.1.3: dependencies: normalize-path: 3.0.0 @@ -12366,7 +12583,13 @@ snapshots: ast-kit@2.1.3: dependencies: - '@babel/parser': 7.29.0 + '@babel/parser': 7.29.2 + pathe: 2.0.3 + + ast-kit@3.0.0-beta.1: + dependencies: + '@babel/parser': 8.0.0-rc.3 + estree-walker: 3.0.3 pathe: 2.0.3 ast-types-flow@0.0.8: {} @@ -12430,10 +12653,10 @@ snapshots: baseline-browser-mapping@2.9.11: {} - better-auth@1.4.19(9698e865c69f9d604fb4edbe7906cba1): + better-auth@1.4.19(f276412306c0f31e69da8456c8cd9497): dependencies: - '@better-auth/core': 1.4.19(@better-auth/utils@0.3.0)(@better-fetch/fetch@1.1.21)(better-call@1.1.8(zod@4.3.6))(jose@6.1.2)(kysely@0.28.8)(nanostores@1.0.1) - '@better-auth/telemetry': 1.4.19(@better-auth/core@1.4.19(@better-auth/utils@0.3.0)(@better-fetch/fetch@1.1.21)(better-call@1.1.8(zod@4.3.6))(jose@6.1.2)(kysely@0.28.8)(nanostores@1.0.1)) + '@better-auth/core': 1.4.19(@better-auth/utils@0.3.0)(@better-fetch/fetch@1.1.21)(better-call@1.1.8(zod@4.3.6))(jose@6.1.2)(kysely@0.28.16)(nanostores@1.0.1) + '@better-auth/telemetry': 1.4.19(@better-auth/core@1.4.19(@better-auth/utils@0.3.0)(@better-fetch/fetch@1.1.21)(better-call@1.1.8(zod@4.3.6))(jose@6.1.2)(kysely@0.28.16)(nanostores@1.0.1)) '@better-auth/utils': 0.3.0 '@better-fetch/fetch': 1.1.21 '@noble/ciphers': 2.0.1 @@ -12441,14 +12664,14 @@ snapshots: better-call: 1.1.8(zod@4.3.6) defu: 6.1.4 jose: 6.1.2 - kysely: 0.28.8 + kysely: 0.28.16 nanostores: 1.0.1 zod: 4.3.6 optionalDependencies: '@prisma/client': 5.22.0(prisma@6.19.0(magicast@0.5.1)(typescript@5.9.3)) '@sveltejs/kit': 2.53.2(@sveltejs/vite-plugin-svelte@6.2.1(svelte@5.53.5)(vite@7.3.1(@types/node@25.5.2)(jiti@2.6.1)(lightningcss@1.30.2)(terser@5.44.0)(tsx@4.20.3)(yaml@2.8.2)))(svelte@5.53.5)(typescript@5.9.3)(vite@7.3.1(@types/node@25.5.2)(jiti@2.6.1)(lightningcss@1.30.2)(terser@5.44.0)(tsx@4.20.3)(yaml@2.8.2)) better-sqlite3: 12.5.0 - drizzle-orm: 0.41.0(@prisma/client@5.22.0(prisma@6.19.0(magicast@0.5.1)(typescript@5.9.3)))(@types/better-sqlite3@7.6.13)(@types/pg@8.16.0)(@types/sql.js@1.4.9)(better-sqlite3@12.5.0)(bun-types@1.3.3)(kysely@0.28.8)(mysql2@3.16.1)(pg@8.16.3)(prisma@6.19.0(magicast@0.5.1)(typescript@5.9.3))(sql.js@1.13.0) + drizzle-orm: 0.41.0(@prisma/client@5.22.0(prisma@6.19.0(magicast@0.5.1)(typescript@5.9.3)))(@types/better-sqlite3@7.6.13)(@types/pg@8.16.0)(@types/sql.js@1.4.9)(better-sqlite3@12.5.0)(bun-types@1.3.3)(kysely@0.28.16)(mysql2@3.16.1)(pg@8.16.3)(prisma@6.19.0(magicast@0.5.1)(typescript@5.9.3))(sql.js@1.13.0) mysql2: 3.16.1 next: 16.1.6(@babel/core@7.29.0)(react-dom@19.2.0(react@19.2.0))(react@19.2.0) pg: 8.16.3 @@ -12484,6 +12707,8 @@ snapshots: birpc@2.9.0: {} + birpc@4.0.0: {} + bl@4.1.0: dependencies: buffer: 5.7.1 @@ -12555,17 +12780,12 @@ snapshots: bun-types@1.3.3: dependencies: - '@types/node': 20.19.24 + '@types/node': 25.5.2 bundle-name@4.1.0: dependencies: run-applescript: 7.1.0 - bundle-require@5.1.0(esbuild@0.25.5): - dependencies: - esbuild: 0.25.5 - load-tsconfig: 0.2.5 - bytes@3.1.2: {} c12@3.1.0(magicast@0.3.5): @@ -12622,6 +12842,8 @@ snapshots: cac@6.7.14: {} + cac@7.0.0: {} + call-bind-apply-helpers@1.0.2: dependencies: es-errors: 1.3.0 @@ -12764,8 +12986,6 @@ snapshots: commander@2.20.3: {} - commander@4.1.1: {} - commander@8.3.0: {} commander@9.5.0: {} @@ -12974,10 +13194,10 @@ snapshots: es-errors: 1.3.0 is-data-view: 1.0.2 - db0@0.3.4(better-sqlite3@12.5.0)(drizzle-orm@0.41.0(@prisma/client@5.22.0(prisma@6.19.0(magicast@0.5.1)(typescript@5.9.3)))(@types/better-sqlite3@7.6.13)(@types/pg@8.16.0)(@types/sql.js@1.4.9)(better-sqlite3@12.5.0)(bun-types@1.3.3)(kysely@0.28.8)(mysql2@3.16.1)(pg@8.16.3)(prisma@6.19.0(magicast@0.5.1)(typescript@5.9.3))(sql.js@1.13.0))(mysql2@3.16.1): + db0@0.3.4(better-sqlite3@12.5.0)(drizzle-orm@0.41.0(@prisma/client@5.22.0(prisma@6.19.0(magicast@0.5.1)(typescript@5.9.3)))(@types/better-sqlite3@7.6.13)(@types/pg@8.16.0)(@types/sql.js@1.4.9)(better-sqlite3@12.5.0)(bun-types@1.3.3)(kysely@0.28.16)(mysql2@3.16.1)(pg@8.16.3)(prisma@6.19.0(magicast@0.5.1)(typescript@5.9.3))(sql.js@1.13.0))(mysql2@3.16.1): optionalDependencies: better-sqlite3: 12.5.0 - drizzle-orm: 0.41.0(@prisma/client@5.22.0(prisma@6.19.0(magicast@0.5.1)(typescript@5.9.3)))(@types/better-sqlite3@7.6.13)(@types/pg@8.16.0)(@types/sql.js@1.4.9)(better-sqlite3@12.5.0)(bun-types@1.3.3)(kysely@0.28.8)(mysql2@3.16.1)(pg@8.16.3)(prisma@6.19.0(magicast@0.5.1)(typescript@5.9.3))(sql.js@1.13.0) + drizzle-orm: 0.41.0(@prisma/client@5.22.0(prisma@6.19.0(magicast@0.5.1)(typescript@5.9.3)))(@types/better-sqlite3@7.6.13)(@types/pg@8.16.0)(@types/sql.js@1.4.9)(better-sqlite3@12.5.0)(bun-types@1.3.3)(kysely@0.28.16)(mysql2@3.16.1)(pg@8.16.3)(prisma@6.19.0(magicast@0.5.1)(typescript@5.9.3))(sql.js@1.13.0) mysql2: 3.16.1 debug@3.2.7: @@ -13037,6 +13257,8 @@ snapshots: defu@6.1.4: {} + defu@6.1.7: {} + delayed-stream@1.0.0: {} denque@2.1.0: {} @@ -13092,7 +13314,7 @@ snapshots: dotenv@17.2.3: {} - drizzle-orm@0.41.0(@prisma/client@5.22.0(prisma@6.19.0(magicast@0.5.1)(typescript@5.9.3)))(@types/better-sqlite3@7.6.13)(@types/pg@8.16.0)(@types/sql.js@1.4.9)(better-sqlite3@12.5.0)(bun-types@1.3.3)(kysely@0.28.8)(mysql2@3.16.1)(pg@8.16.3)(prisma@6.19.0(magicast@0.5.1)(typescript@5.9.3))(sql.js@1.13.0): + drizzle-orm@0.41.0(@prisma/client@5.22.0(prisma@6.19.0(magicast@0.5.1)(typescript@5.9.3)))(@types/better-sqlite3@7.6.13)(@types/pg@8.16.0)(@types/sql.js@1.4.9)(better-sqlite3@12.5.0)(bun-types@1.3.3)(kysely@0.28.16)(mysql2@3.16.1)(pg@8.16.3)(prisma@6.19.0(magicast@0.5.1)(typescript@5.9.3))(sql.js@1.13.0): optionalDependencies: '@prisma/client': 5.22.0(prisma@6.19.0(magicast@0.5.1)(typescript@5.9.3)) '@types/better-sqlite3': 7.6.13 @@ -13100,12 +13322,14 @@ snapshots: '@types/sql.js': 1.4.9 better-sqlite3: 12.5.0 bun-types: 1.3.3 - kysely: 0.28.8 + kysely: 0.28.16 mysql2: 3.16.1 pg: 8.16.3 prisma: 6.19.0(magicast@0.5.1)(typescript@5.9.3) sql.js: 1.13.0 + dts-resolver@2.1.3: {} + dunder-proto@1.0.1: dependencies: call-bind-apply-helpers: 1.0.2 @@ -13380,7 +13604,7 @@ snapshots: eslint: 9.29.0(jiti@2.6.1) eslint-import-resolver-node: 0.3.9 eslint-import-resolver-typescript: 3.10.1(eslint-plugin-import@2.32.0(@typescript-eslint/parser@8.46.2(eslint@9.29.0(jiti@2.6.1))(typescript@5.9.3))(eslint@9.29.0(jiti@2.6.1)))(eslint@9.29.0(jiti@2.6.1)) - eslint-plugin-import: 2.32.0(@typescript-eslint/parser@8.46.2(eslint@9.29.0(jiti@2.6.1))(typescript@5.9.3))(eslint-import-resolver-typescript@3.10.1)(eslint@9.29.0(jiti@2.6.1)) + eslint-plugin-import: 2.32.0(@typescript-eslint/parser@8.46.2(eslint@9.29.0(jiti@2.6.1))(typescript@5.9.3))(eslint-import-resolver-typescript@3.10.1(eslint-plugin-import@2.32.0(@typescript-eslint/parser@8.46.2(eslint@9.29.0(jiti@2.6.1))(typescript@5.9.3))(eslint@9.29.0(jiti@2.6.1)))(eslint@9.29.0(jiti@2.6.1)))(eslint@9.29.0(jiti@2.6.1)) eslint-plugin-jsx-a11y: 6.10.2(eslint@9.29.0(jiti@2.6.1)) eslint-plugin-react: 7.37.5(eslint@9.29.0(jiti@2.6.1)) eslint-plugin-react-hooks: 7.0.1(eslint@9.29.0(jiti@2.6.1)) @@ -13413,7 +13637,7 @@ snapshots: tinyglobby: 0.2.15 unrs-resolver: 1.11.1 optionalDependencies: - eslint-plugin-import: 2.32.0(@typescript-eslint/parser@8.46.2(eslint@9.29.0(jiti@2.6.1))(typescript@5.9.3))(eslint-import-resolver-typescript@3.10.1)(eslint@9.29.0(jiti@2.6.1)) + eslint-plugin-import: 2.32.0(@typescript-eslint/parser@8.46.2(eslint@9.29.0(jiti@2.6.1))(typescript@5.9.3))(eslint-import-resolver-typescript@3.10.1(eslint-plugin-import@2.32.0(@typescript-eslint/parser@8.46.2(eslint@9.29.0(jiti@2.6.1))(typescript@5.9.3))(eslint@9.29.0(jiti@2.6.1)))(eslint@9.29.0(jiti@2.6.1)))(eslint@9.29.0(jiti@2.6.1)) transitivePeerDependencies: - supports-color @@ -13428,7 +13652,7 @@ snapshots: transitivePeerDependencies: - supports-color - eslint-plugin-import@2.32.0(@typescript-eslint/parser@8.46.2(eslint@9.29.0(jiti@2.6.1))(typescript@5.9.3))(eslint-import-resolver-typescript@3.10.1)(eslint@9.29.0(jiti@2.6.1)): + eslint-plugin-import@2.32.0(@typescript-eslint/parser@8.46.2(eslint@9.29.0(jiti@2.6.1))(typescript@5.9.3))(eslint-import-resolver-typescript@3.10.1(eslint-plugin-import@2.32.0(@typescript-eslint/parser@8.46.2(eslint@9.29.0(jiti@2.6.1))(typescript@5.9.3))(eslint@9.29.0(jiti@2.6.1)))(eslint@9.29.0(jiti@2.6.1)))(eslint@9.29.0(jiti@2.6.1)): dependencies: '@rtsao/scc': 1.1.0 array-includes: 3.1.9 @@ -13746,14 +13970,14 @@ snapshots: dependencies: reusify: 1.1.0 - fdir@6.4.6(picomatch@4.0.2): - optionalDependencies: - picomatch: 4.0.2 - fdir@6.5.0(picomatch@4.0.3): optionalDependencies: picomatch: 4.0.3 + fdir@6.5.0(picomatch@4.0.4): + optionalDependencies: + picomatch: 4.0.4 + fflate@0.8.2: {} figures@6.1.0: @@ -13801,12 +14025,6 @@ snapshots: locate-path: 6.0.0 path-exists: 4.0.0 - fix-dts-default-cjs-exports@1.0.1: - dependencies: - magic-string: 0.30.17 - mlly: 1.7.4 - rollup: 4.59.0 - flat-cache@4.0.1: dependencies: flatted: 3.3.3 @@ -13918,6 +14136,10 @@ snapshots: dependencies: resolve-pkg-maps: 1.0.0 + get-tsconfig@4.13.7: + dependencies: + resolve-pkg-maps: 1.0.0 + giget@2.0.0: dependencies: citty: 0.1.6 @@ -13944,7 +14166,7 @@ snapshots: foreground-child: 3.3.1 jackspeak: 3.4.3 minimatch: 9.0.8 - minipass: 7.1.2 + minipass: 7.1.3 package-json-from-dist: 1.0.1 path-scurry: 1.11.1 @@ -14057,6 +14279,8 @@ snapshots: hookable@6.0.1: {} + hookable@6.1.0: {} + hosted-git-info@2.8.9: {} html-encoding-sniffer@4.0.0: @@ -14130,6 +14354,8 @@ snapshots: parent-module: 1.0.1 resolve-from: 4.0.0 + import-without-cache@0.2.5: {} + impound@1.0.0: dependencies: exsolve: 1.0.8 @@ -14199,7 +14425,7 @@ snapshots: is-bun-module@2.0.0: dependencies: - semver: 7.7.3 + semver: 7.7.4 is-callable@1.2.7: {} @@ -14402,8 +14628,6 @@ snapshots: jose@6.1.2: {} - joycon@3.1.1: {} - js-tokens@4.0.0: {} js-tokens@9.0.1: {} @@ -14503,12 +14727,12 @@ snapshots: knitwork@1.3.0: {} - kysely-bun-sqlite@0.4.0(kysely@0.28.8): + kysely-bun-sqlite@0.4.0(kysely@0.28.16): dependencies: bun-types: 1.3.3 - kysely: 0.28.8 + kysely: 0.28.16 - kysely@0.28.8: {} + kysely@0.28.16: {} langium-cli@3.5.0: dependencies: @@ -14614,8 +14838,6 @@ snapshots: lilconfig@3.1.3: {} - lines-and-columns@1.2.4: {} - listhen@1.9.0: dependencies: '@parcel/watcher': 2.5.1 @@ -14644,8 +14866,6 @@ snapshots: pify: 3.0.0 strip-bom: 3.0.0 - load-tsconfig@0.2.5: {} - local-pkg@1.1.2: dependencies: mlly: 1.8.0 @@ -14668,8 +14888,6 @@ snapshots: lodash.merge@4.6.2: {} - lodash.sortby@4.7.0: {} - lodash.uniq@4.5.0: {} lodash@4.17.23: {} @@ -14695,8 +14913,7 @@ snapshots: lru-cache@11.2.6: {} - lru-cache@11.2.7: - optional: true + lru-cache@11.2.7: {} lru-cache@5.1.1: dependencies: @@ -14720,10 +14937,6 @@ snapshots: dependencies: magic-string: 0.30.21 - magic-string@0.30.17: - dependencies: - '@jridgewell/sourcemap-codec': 1.5.0 - magic-string@0.30.21: dependencies: '@jridgewell/sourcemap-codec': 1.5.5 @@ -14819,7 +15032,7 @@ snapshots: minizlib@3.1.0: dependencies: - minipass: 7.1.2 + minipass: 7.1.3 mitt@3.0.1: {} @@ -14867,12 +15080,6 @@ snapshots: seq-queue: 0.0.5 sqlstring: 2.3.3 - mz@2.7.0: - dependencies: - any-promise: 1.3.0 - object-assign: 4.1.1 - thenify-all: 1.6.0 - named-placeholders@1.1.6: dependencies: lru.min: 1.1.3 @@ -14945,7 +15152,7 @@ snapshots: nice-try@1.0.5: {} - nitropack@2.13.1(better-sqlite3@12.5.0)(drizzle-orm@0.41.0(@prisma/client@5.22.0(prisma@6.19.0(magicast@0.5.1)(typescript@5.9.3)))(@types/better-sqlite3@7.6.13)(@types/pg@8.16.0)(@types/sql.js@1.4.9)(better-sqlite3@12.5.0)(bun-types@1.3.3)(kysely@0.28.8)(mysql2@3.16.1)(pg@8.16.3)(prisma@6.19.0(magicast@0.5.1)(typescript@5.9.3))(sql.js@1.13.0))(mysql2@3.16.1): + nitropack@2.13.1(better-sqlite3@12.5.0)(drizzle-orm@0.41.0(@prisma/client@5.22.0(prisma@6.19.0(magicast@0.5.1)(typescript@5.9.3)))(@types/better-sqlite3@7.6.13)(@types/pg@8.16.0)(@types/sql.js@1.4.9)(better-sqlite3@12.5.0)(bun-types@1.3.3)(kysely@0.28.16)(mysql2@3.16.1)(pg@8.16.3)(prisma@6.19.0(magicast@0.5.1)(typescript@5.9.3))(sql.js@1.13.0))(mysql2@3.16.1)(rolldown@1.0.0-rc.15): dependencies: '@cloudflare/kv-asset-handler': 0.4.2 '@rollup/plugin-alias': 6.0.0(rollup@4.59.0) @@ -14966,7 +15173,7 @@ snapshots: cookie-es: 2.0.0 croner: 9.1.0 crossws: 0.3.5 - db0: 0.3.4(better-sqlite3@12.5.0)(drizzle-orm@0.41.0(@prisma/client@5.22.0(prisma@6.19.0(magicast@0.5.1)(typescript@5.9.3)))(@types/better-sqlite3@7.6.13)(@types/pg@8.16.0)(@types/sql.js@1.4.9)(better-sqlite3@12.5.0)(bun-types@1.3.3)(kysely@0.28.8)(mysql2@3.16.1)(pg@8.16.3)(prisma@6.19.0(magicast@0.5.1)(typescript@5.9.3))(sql.js@1.13.0))(mysql2@3.16.1) + db0: 0.3.4(better-sqlite3@12.5.0)(drizzle-orm@0.41.0(@prisma/client@5.22.0(prisma@6.19.0(magicast@0.5.1)(typescript@5.9.3)))(@types/better-sqlite3@7.6.13)(@types/pg@8.16.0)(@types/sql.js@1.4.9)(better-sqlite3@12.5.0)(bun-types@1.3.3)(kysely@0.28.16)(mysql2@3.16.1)(pg@8.16.3)(prisma@6.19.0(magicast@0.5.1)(typescript@5.9.3))(sql.js@1.13.0))(mysql2@3.16.1) defu: 6.1.4 destr: 2.0.5 dot-prop: 10.1.0 @@ -14998,7 +15205,7 @@ snapshots: pretty-bytes: 7.1.0 radix3: 1.1.2 rollup: 4.59.0 - rollup-plugin-visualizer: 6.0.5(rollup@4.59.0) + rollup-plugin-visualizer: 6.0.5(rolldown@1.0.0-rc.15)(rollup@4.59.0) scule: 1.3.0 semver: 7.7.4 serve-placeholder: 2.0.2 @@ -15012,7 +15219,7 @@ snapshots: unenv: 2.0.0-rc.24 unimport: 5.6.0 unplugin-utils: 0.3.1 - unstorage: 1.17.4(db0@0.3.4(better-sqlite3@12.5.0)(drizzle-orm@0.41.0(@prisma/client@5.22.0(prisma@6.19.0(magicast@0.5.1)(typescript@5.9.3)))(@types/better-sqlite3@7.6.13)(@types/pg@8.16.0)(@types/sql.js@1.4.9)(better-sqlite3@12.5.0)(bun-types@1.3.3)(kysely@0.28.8)(mysql2@3.16.1)(pg@8.16.3)(prisma@6.19.0(magicast@0.5.1)(typescript@5.9.3))(sql.js@1.13.0))(mysql2@3.16.1))(ioredis@5.9.3) + unstorage: 1.17.4(db0@0.3.4(better-sqlite3@12.5.0)(drizzle-orm@0.41.0(@prisma/client@5.22.0(prisma@6.19.0(magicast@0.5.1)(typescript@5.9.3)))(@types/better-sqlite3@7.6.13)(@types/pg@8.16.0)(@types/sql.js@1.4.9)(better-sqlite3@12.5.0)(bun-types@1.3.3)(kysely@0.28.16)(mysql2@3.16.1)(pg@8.16.3)(prisma@6.19.0(magicast@0.5.1)(typescript@5.9.3))(sql.js@1.13.0))(mysql2@3.16.1))(ioredis@5.9.3) untyped: 2.0.0 unwasm: 0.5.3 youch: 4.1.0-beta.13 @@ -15111,16 +15318,16 @@ snapshots: dependencies: boolbase: 1.0.0 - nuxt@4.3.1(cfda133a7eabcf873b5dad9c91eb52c2): + nuxt@4.3.1(c09e06bbcbcd2b0a94c9a804d2c88498): dependencies: '@dxup/nuxt': 0.3.2(magicast@0.5.1) '@nuxt/cli': 3.33.1(@nuxt/schema@4.3.1)(cac@6.7.14)(magicast@0.5.1) '@nuxt/devtools': 3.1.1(vite@7.3.1(@types/node@25.5.2)(jiti@2.6.1)(lightningcss@1.30.2)(terser@5.44.0)(tsx@4.20.3)(yaml@2.8.2))(vue@3.5.29(typescript@5.9.3)) '@nuxt/kit': 4.3.1(magicast@0.5.1) - '@nuxt/nitro-server': 4.3.1(better-sqlite3@12.5.0)(db0@0.3.4(better-sqlite3@12.5.0)(drizzle-orm@0.41.0(@prisma/client@5.22.0(prisma@6.19.0(magicast@0.5.1)(typescript@5.9.3)))(@types/better-sqlite3@7.6.13)(@types/pg@8.16.0)(@types/sql.js@1.4.9)(better-sqlite3@12.5.0)(bun-types@1.3.3)(kysely@0.28.8)(mysql2@3.16.1)(pg@8.16.3)(prisma@6.19.0(magicast@0.5.1)(typescript@5.9.3))(sql.js@1.13.0))(mysql2@3.16.1))(drizzle-orm@0.41.0(@prisma/client@5.22.0(prisma@6.19.0(magicast@0.5.1)(typescript@5.9.3)))(@types/better-sqlite3@7.6.13)(@types/pg@8.16.0)(@types/sql.js@1.4.9)(better-sqlite3@12.5.0)(bun-types@1.3.3)(kysely@0.28.8)(mysql2@3.16.1)(pg@8.16.3)(prisma@6.19.0(magicast@0.5.1)(typescript@5.9.3))(sql.js@1.13.0))(ioredis@5.9.3)(magicast@0.5.1)(mysql2@3.16.1)(nuxt@4.3.1(cfda133a7eabcf873b5dad9c91eb52c2))(typescript@5.9.3) + '@nuxt/nitro-server': 4.3.1(better-sqlite3@12.5.0)(db0@0.3.4(better-sqlite3@12.5.0)(drizzle-orm@0.41.0(@prisma/client@5.22.0(prisma@6.19.0(magicast@0.5.1)(typescript@5.9.3)))(@types/better-sqlite3@7.6.13)(@types/pg@8.16.0)(@types/sql.js@1.4.9)(better-sqlite3@12.5.0)(bun-types@1.3.3)(kysely@0.28.16)(mysql2@3.16.1)(pg@8.16.3)(prisma@6.19.0(magicast@0.5.1)(typescript@5.9.3))(sql.js@1.13.0))(mysql2@3.16.1))(drizzle-orm@0.41.0(@prisma/client@5.22.0(prisma@6.19.0(magicast@0.5.1)(typescript@5.9.3)))(@types/better-sqlite3@7.6.13)(@types/pg@8.16.0)(@types/sql.js@1.4.9)(better-sqlite3@12.5.0)(bun-types@1.3.3)(kysely@0.28.16)(mysql2@3.16.1)(pg@8.16.3)(prisma@6.19.0(magicast@0.5.1)(typescript@5.9.3))(sql.js@1.13.0))(ioredis@5.9.3)(magicast@0.5.1)(mysql2@3.16.1)(nuxt@4.3.1(c09e06bbcbcd2b0a94c9a804d2c88498))(rolldown@1.0.0-rc.15)(typescript@5.9.3) '@nuxt/schema': 4.3.1 '@nuxt/telemetry': 2.7.0(@nuxt/kit@4.3.1(magicast@0.5.1)) - '@nuxt/vite-builder': 4.3.1(@types/node@25.5.2)(eslint@9.29.0(jiti@2.6.1))(lightningcss@1.30.2)(magicast@0.5.1)(nuxt@4.3.1(cfda133a7eabcf873b5dad9c91eb52c2))(optionator@0.9.4)(rollup@4.59.0)(terser@5.44.0)(tsx@4.20.3)(typescript@5.9.3)(vue-tsc@3.2.5(typescript@5.9.3))(vue@3.5.29(typescript@5.9.3))(yaml@2.8.2) + '@nuxt/vite-builder': 4.3.1(@types/node@25.5.2)(eslint@9.29.0(jiti@2.6.1))(lightningcss@1.30.2)(magicast@0.5.1)(nuxt@4.3.1(c09e06bbcbcd2b0a94c9a804d2c88498))(optionator@0.9.4)(rolldown@1.0.0-rc.15)(rollup@4.59.0)(terser@5.44.0)(tsx@4.20.3)(typescript@5.9.3)(vue-tsc@3.2.5(typescript@5.9.3))(vue@3.5.29(typescript@5.9.3))(yaml@2.8.2) '@unhead/vue': 2.1.7(vue@3.5.29(typescript@5.9.3)) '@vue/shared': 3.5.29 c12: 3.3.3(magicast@0.5.1) @@ -15240,7 +15447,7 @@ snapshots: consola: 3.4.2 pathe: 2.0.3 pkg-types: 2.3.0 - tinyexec: 1.0.1 + tinyexec: 1.0.2 nypm@0.6.5: dependencies: @@ -15489,7 +15696,7 @@ snapshots: path-scurry@1.11.1: dependencies: lru-cache: 10.4.3 - minipass: 7.1.2 + minipass: 7.1.3 path-scurry@2.0.0: dependencies: @@ -15498,7 +15705,7 @@ snapshots: path-scurry@2.0.2: dependencies: - lru-cache: 11.2.6 + lru-cache: 11.2.7 minipass: 7.1.3 path-to-regexp@8.3.0: {} @@ -15568,10 +15775,10 @@ snapshots: picomatch@2.3.1: {} - picomatch@4.0.2: {} - picomatch@4.0.3: {} + picomatch@4.0.4: {} + pidtree@0.3.1: {} pify@3.0.0: {} @@ -15596,8 +15803,6 @@ snapshots: sonic-boom: 4.2.0 thread-stream: 4.0.0 - pirates@4.0.7: {} - pkg-types@1.3.1: dependencies: confbox: 0.1.8 @@ -15651,15 +15856,6 @@ snapshots: dependencies: postcss: 8.5.6 - postcss-load-config@6.0.1(jiti@2.6.1)(postcss@8.5.6)(tsx@4.20.3)(yaml@2.8.0): - dependencies: - lilconfig: 3.1.3 - optionalDependencies: - jiti: 2.6.1 - postcss: 8.5.6 - tsx: 4.20.3 - yaml: 2.8.0 - postcss-merge-longhand@7.0.5(postcss@8.5.6): dependencies: postcss: 8.5.6 @@ -15910,6 +16106,8 @@ snapshots: quansync@0.2.11: {} + quansync@1.0.0: {} + queue-microtask@1.2.3: {} quick-format-unescaped@4.0.4: {} @@ -16064,13 +16262,59 @@ snapshots: rfdc@1.4.1: {} - rollup-plugin-visualizer@6.0.5(rollup@4.59.0): + rimraf@6.1.3: + dependencies: + glob: 13.0.6 + package-json-from-dist: 1.0.1 + + rolldown-plugin-dts@0.23.2(rolldown@1.0.0-rc.15)(typescript@5.9.3)(vue-tsc@3.2.5(typescript@5.9.3)): + dependencies: + '@babel/generator': 8.0.0-rc.3 + '@babel/helper-validator-identifier': 8.0.0-rc.3 + '@babel/parser': 8.0.0-rc.3 + '@babel/types': 8.0.0-rc.3 + ast-kit: 3.0.0-beta.1 + birpc: 4.0.0 + dts-resolver: 2.1.3 + get-tsconfig: 4.13.7 + obug: 2.1.1 + picomatch: 4.0.4 + rolldown: 1.0.0-rc.15 + optionalDependencies: + typescript: 5.9.3 + vue-tsc: 3.2.5(typescript@5.9.3) + transitivePeerDependencies: + - oxc-resolver + + rolldown@1.0.0-rc.15: + dependencies: + '@oxc-project/types': 0.124.0 + '@rolldown/pluginutils': 1.0.0-rc.15 + optionalDependencies: + '@rolldown/binding-android-arm64': 1.0.0-rc.15 + '@rolldown/binding-darwin-arm64': 1.0.0-rc.15 + '@rolldown/binding-darwin-x64': 1.0.0-rc.15 + '@rolldown/binding-freebsd-x64': 1.0.0-rc.15 + '@rolldown/binding-linux-arm-gnueabihf': 1.0.0-rc.15 + '@rolldown/binding-linux-arm64-gnu': 1.0.0-rc.15 + '@rolldown/binding-linux-arm64-musl': 1.0.0-rc.15 + '@rolldown/binding-linux-ppc64-gnu': 1.0.0-rc.15 + '@rolldown/binding-linux-s390x-gnu': 1.0.0-rc.15 + '@rolldown/binding-linux-x64-gnu': 1.0.0-rc.15 + '@rolldown/binding-linux-x64-musl': 1.0.0-rc.15 + '@rolldown/binding-openharmony-arm64': 1.0.0-rc.15 + '@rolldown/binding-wasm32-wasi': 1.0.0-rc.15 + '@rolldown/binding-win32-arm64-msvc': 1.0.0-rc.15 + '@rolldown/binding-win32-x64-msvc': 1.0.0-rc.15 + + rollup-plugin-visualizer@6.0.5(rolldown@1.0.0-rc.15)(rollup@4.59.0): dependencies: open: 8.4.2 picomatch: 4.0.3 source-map: 0.7.6 yargs: 17.7.2 optionalDependencies: + rolldown: 1.0.0-rc.15 rollup: 4.59.0 rollup@4.59.0: @@ -16375,10 +16619,6 @@ snapshots: source-map@0.7.6: {} - source-map@0.8.0-beta.0: - dependencies: - whatwg-url: 7.1.0 - spdx-correct@3.2.0: dependencies: spdx-expression-parse: 3.0.1 @@ -16554,16 +16794,6 @@ snapshots: postcss: 8.5.6 postcss-selector-parser: 7.1.0 - sucrase@3.35.0: - dependencies: - '@jridgewell/gen-mapping': 0.3.8 - commander: 4.1.1 - glob: 10.5.0 - lines-and-columns: 1.2.4 - mz: 2.7.0 - pirates: 4.0.7 - ts-interface-checker: 0.1.13 - superagent@10.2.3: dependencies: component-emitter: 1.3.1 @@ -16695,7 +16925,7 @@ snapshots: dependencies: '@isaacs/fs-minipass': 4.0.1 chownr: 3.0.0 - minipass: 7.1.2 + minipass: 7.1.3 minizlib: 3.1.0 yallist: 5.0.0 @@ -16717,14 +16947,6 @@ snapshots: transitivePeerDependencies: - react-native-b4a - thenify-all@1.6.0: - dependencies: - thenify: 3.3.1 - - thenify@3.3.1: - dependencies: - any-promise: 1.3.0 - thread-stream@4.0.0: dependencies: real-require: 0.2.0 @@ -16735,20 +16957,20 @@ snapshots: tinyexec@0.3.2: {} - tinyexec@1.0.1: {} - tinyexec@1.0.2: {} - tinyglobby@0.2.14: - dependencies: - fdir: 6.4.6(picomatch@4.0.2) - picomatch: 4.0.2 + tinyexec@1.1.1: {} tinyglobby@0.2.15: dependencies: fdir: 6.5.0(picomatch@4.0.3) picomatch: 4.0.3 + tinyglobby@0.2.16: + dependencies: + fdir: 6.5.0(picomatch@4.0.4) + picomatch: 4.0.4 + tinyrainbow@3.0.3: {} tldts-core@7.0.27: @@ -16786,10 +17008,6 @@ snapshots: tr46@0.0.3: {} - tr46@1.0.1: - dependencies: - punycode: 2.3.1 - tr46@6.0.0: dependencies: punycode: 2.3.1 @@ -16801,8 +17019,6 @@ snapshots: dependencies: typescript: 5.9.3 - ts-interface-checker@0.1.13: {} - ts-japi@1.12.1: {} ts-pattern@5.7.1: {} @@ -16814,36 +17030,34 @@ snapshots: minimist: 1.2.8 strip-bom: 3.0.0 - tslib@2.8.1: {} - - tsup@8.5.0(@swc/core@1.12.5)(jiti@2.6.1)(postcss@8.5.6)(tsx@4.20.3)(typescript@5.9.3)(yaml@2.8.0): + tsdown@0.21.8(typescript@5.9.3)(vue-tsc@3.2.5(typescript@5.9.3)): dependencies: - bundle-require: 5.1.0(esbuild@0.25.5) - cac: 6.7.14 - chokidar: 4.0.3 - consola: 3.4.2 - debug: 4.4.1 - esbuild: 0.25.5 - fix-dts-default-cjs-exports: 1.0.1 - joycon: 3.1.1 - picocolors: 1.1.1 - postcss-load-config: 6.0.1(jiti@2.6.1)(postcss@8.5.6)(tsx@4.20.3)(yaml@2.8.0) - resolve-from: 5.0.0 - rollup: 4.59.0 - source-map: 0.8.0-beta.0 - sucrase: 3.35.0 - tinyexec: 0.3.2 - tinyglobby: 0.2.14 + ansis: 4.2.0 + cac: 7.0.0 + defu: 6.1.7 + empathic: 2.0.0 + hookable: 6.1.0 + import-without-cache: 0.2.5 + obug: 2.1.1 + picomatch: 4.0.4 + rolldown: 1.0.0-rc.15 + rolldown-plugin-dts: 0.23.2(rolldown@1.0.0-rc.15)(typescript@5.9.3)(vue-tsc@3.2.5(typescript@5.9.3)) + semver: 7.7.4 + tinyexec: 1.1.1 + tinyglobby: 0.2.16 tree-kill: 1.2.2 + unconfig-core: 7.5.0 + unrun: 0.2.35 optionalDependencies: - '@swc/core': 1.12.5 - postcss: 8.5.6 typescript: 5.9.3 transitivePeerDependencies: - - jiti - - supports-color - - tsx - - yaml + - '@ts-macro/tsc' + - '@typescript/native-preview' + - oxc-resolver + - synckit + - vue-tsc + + tslib@2.8.1: {} tsx@4.20.3: dependencies: @@ -16972,6 +17186,11 @@ snapshots: has-symbols: 1.1.0 which-boxed-primitive: 1.1.1 + unconfig-core@7.5.0: + dependencies: + '@quansync/fs': 1.0.0 + quansync: 1.0.0 + uncrypto@0.1.3: {} unctx@2.5.0: @@ -16981,8 +17200,6 @@ snapshots: magic-string: 0.30.21 unplugin: 2.3.11 - undici-types@6.19.8: {} - undici-types@6.21.0: {} undici-types@7.18.2: {} @@ -17092,7 +17309,11 @@ snapshots: '@unrs/resolver-binding-win32-ia32-msvc': 1.11.1 '@unrs/resolver-binding-win32-x64-msvc': 1.11.1 - unstorage@1.17.4(db0@0.3.4(better-sqlite3@12.5.0)(drizzle-orm@0.41.0(@prisma/client@5.22.0(prisma@6.19.0(magicast@0.5.1)(typescript@5.9.3)))(@types/better-sqlite3@7.6.13)(@types/pg@8.16.0)(@types/sql.js@1.4.9)(better-sqlite3@12.5.0)(bun-types@1.3.3)(kysely@0.28.8)(mysql2@3.16.1)(pg@8.16.3)(prisma@6.19.0(magicast@0.5.1)(typescript@5.9.3))(sql.js@1.13.0))(mysql2@3.16.1))(ioredis@5.9.3): + unrun@0.2.35: + dependencies: + rolldown: 1.0.0-rc.15 + + unstorage@1.17.4(db0@0.3.4(better-sqlite3@12.5.0)(drizzle-orm@0.41.0(@prisma/client@5.22.0(prisma@6.19.0(magicast@0.5.1)(typescript@5.9.3)))(@types/better-sqlite3@7.6.13)(@types/pg@8.16.0)(@types/sql.js@1.4.9)(better-sqlite3@12.5.0)(bun-types@1.3.3)(kysely@0.28.16)(mysql2@3.16.1)(pg@8.16.3)(prisma@6.19.0(magicast@0.5.1)(typescript@5.9.3))(sql.js@1.13.0))(mysql2@3.16.1))(ioredis@5.9.3): dependencies: anymatch: 3.1.3 chokidar: 5.0.0 @@ -17103,7 +17324,7 @@ snapshots: ofetch: 1.5.1 ufo: 1.6.3 optionalDependencies: - db0: 0.3.4(better-sqlite3@12.5.0)(drizzle-orm@0.41.0(@prisma/client@5.22.0(prisma@6.19.0(magicast@0.5.1)(typescript@5.9.3)))(@types/better-sqlite3@7.6.13)(@types/pg@8.16.0)(@types/sql.js@1.4.9)(better-sqlite3@12.5.0)(bun-types@1.3.3)(kysely@0.28.8)(mysql2@3.16.1)(pg@8.16.3)(prisma@6.19.0(magicast@0.5.1)(typescript@5.9.3))(sql.js@1.13.0))(mysql2@3.16.1) + db0: 0.3.4(better-sqlite3@12.5.0)(drizzle-orm@0.41.0(@prisma/client@5.22.0(prisma@6.19.0(magicast@0.5.1)(typescript@5.9.3)))(@types/better-sqlite3@7.6.13)(@types/pg@8.16.0)(@types/sql.js@1.4.9)(better-sqlite3@12.5.0)(bun-types@1.3.3)(kysely@0.28.16)(mysql2@3.16.1)(pg@8.16.3)(prisma@6.19.0(magicast@0.5.1)(typescript@5.9.3))(sql.js@1.13.0))(mysql2@3.16.1) ioredis: 5.9.3 untun@0.1.3: @@ -17476,8 +17697,6 @@ snapshots: webidl-conversions@3.0.1: {} - webidl-conversions@4.0.2: {} - webidl-conversions@8.0.1: optional: true @@ -17507,12 +17726,6 @@ snapshots: tr46: 0.0.3 webidl-conversions: 3.0.1 - whatwg-url@7.1.0: - dependencies: - lodash.sortby: 4.7.0 - tr46: 1.0.1 - webidl-conversions: 4.0.2 - which-boxed-primitive@1.1.1: dependencies: is-bigint: 1.1.0 diff --git a/pnpm-workspace.yaml b/pnpm-workspace.yaml index b7625c3c5..ea399eb70 100644 --- a/pnpm-workspace.yaml +++ b/pnpm-workspace.yaml @@ -15,7 +15,7 @@ catalog: '@types/tmp': ^0.2.6 better-sqlite3: ^12.5.0 decimal.js: ^10.4.3 - kysely: ~0.28.8 + kysely: ~0.28.16 langium: 3.5.0 langium-cli: 3.5.0 next: 16.1.6 diff --git a/samples/orm/package.json b/samples/orm/package.json index 60d08c498..1c4cfcb9b 100644 --- a/samples/orm/package.json +++ b/samples/orm/package.json @@ -1,6 +1,6 @@ { "name": "sample-orm", - "version": "3.5.6", + "version": "3.6.0", "description": "", "main": "index.js", "private": true, diff --git a/samples/orm/zenstack/schema.zmodel b/samples/orm/zenstack/schema.zmodel index 2567801af..631032d71 100644 --- a/samples/orm/zenstack/schema.zmodel +++ b/samples/orm/zenstack/schema.zmodel @@ -12,7 +12,7 @@ enum Role { plugin policy { // due to pnpm layout we can't directly use package name here, // don't do this in your code and use "@zenstackhq/plugin-policy" instead - provider = '../node_modules/@zenstackhq/plugin-policy/dist/index.js' + provider = '../node_modules/@zenstackhq/plugin-policy/dist/index.mjs' } type CommonFields { diff --git a/scripts/test-generate.ts b/scripts/test-generate.ts index 890d26b8e..7c3926eff 100644 --- a/scripts/test-generate.ts +++ b/scripts/test-generate.ts @@ -19,7 +19,7 @@ async function main() { } async function generate(schemaPath: string, options: string[]) { - const cliPath = path.join(_dirname, '../packages/cli/dist/index.js'); + const cliPath = path.join(_dirname, '../packages/cli/dist/index.mjs'); const RUNTIME = process.env.RUNTIME ?? 'node'; execSync( `${RUNTIME} ${cliPath} generate --schema ${schemaPath} ${options.join(' ')} --generate-models=false --generate-input=false --no-version-check --no-tips`, diff --git a/tests/e2e/orm/client-api/mixin.test.ts b/tests/e2e/orm/client-api/mixin.test.ts index 4dc1001bd..f8f0e7a84 100644 --- a/tests/e2e/orm/client-api/mixin.test.ts +++ b/tests/e2e/orm/client-api/mixin.test.ts @@ -122,6 +122,103 @@ model Bar with CommonFields { }); }); + it('supports non-owned (array-side) relation fields in mixin shared by multiple models', async () => { + const schema = ` +type WithComments { + comments Comment[] +} + +model Post with WithComments { + id String @id @default(cuid()) + title String +} + +model Article with WithComments { + id String @id @default(cuid()) + content String +} + +model Comment { + id String @id @default(cuid()) + text String + post Post? @relation(fields: [postId], references: [id]) + postId String? + article Article? @relation(fields: [articleId], references: [id]) + articleId String? +} + `; + + const client = await createTestClient(schema, { usePrismaPush: true }); + + const post = await client.post.create({ data: { title: 'My Post' } }); + const article = await client.article.create({ data: { content: 'My Article' } }); + + await client.comment.create({ data: { text: 'Post comment', postId: post.id } }); + await client.comment.create({ data: { text: 'Article comment', articleId: article.id } }); + + await expect( + client.post.findUnique({ where: { id: post.id }, include: { comments: true } }), + ).resolves.toMatchObject({ + title: 'My Post', + comments: [{ text: 'Post comment' }], + }); + + await expect( + client.article.findUnique({ where: { id: article.id }, include: { comments: true } }), + ).resolves.toMatchObject({ + content: 'My Article', + comments: [{ text: 'Article comment' }], + }); + }); + + it('supports owned (FK-side) relation fields in mixin shared by multiple models', async () => { + const schema = ` +type WithAuthor { + author User @relation(fields: [authorId], references: [id]) + authorId String +} + +model User { + id String @id @default(cuid()) + posts Post[] + articles Article[] +} + +model Post with WithAuthor { + id String @id @default(cuid()) + title String +} + +model Article with WithAuthor { + id String @id @default(cuid()) + content String +} + `; + + const client = await createTestClient(schema, { usePrismaPush: true }); + + const user = await client.user.create({ data: {} }); + + const post = await client.post.create({ + data: { title: 'My Post', authorId: user.id }, + include: { author: true }, + }); + expect(post).toMatchObject({ title: 'My Post', author: { id: user.id } }); + + const article = await client.article.create({ + data: { content: 'My Article', authorId: user.id }, + include: { author: true }, + }); + expect(article).toMatchObject({ content: 'My Article', author: { id: user.id } }); + + await expect( + client.user.findUnique({ where: { id: user.id }, include: { posts: true, articles: true } }), + ).resolves.toMatchObject({ + posts: [{ title: 'My Post' }], + articles: [{ content: 'My Article' }], + }); + }); + it('works with multiple id fields from base', async () => { const schema = ` type Base { @@ -146,4 +243,49 @@ model Bar with CommonFields { id2: '2', }); }); + + it('resolves opposite relation correctly when a relation field is inherited from a delegate base', async () => { + // Regression: getOppositeRelationField was using contextModel (e.g. Person) as the source + // for the opposite-relation lookup, but the back-reference points to the delegate base + // (Entity), not the concrete subtype. This caused the nested-create TypeScript type to + // collapse to `undefined`. + const schema = ` +type WithName { + name String +} + +model Attachment { + id String @id @default(cuid()) + url String + entityId String + entity Entity @relation(fields: [entityId], references: [id]) +} + +model Entity with WithName { + id String @id @default(cuid()) + attachments Attachment[] + type String + @@delegate(type) +} + +model Person extends Entity { + age Int? +} + `; + + const client = await createTestClient(schema, { usePrismaPush: true }); + + await expect( + client.person.create({ + data: { + name: 'Alice', + attachments: { create: { url: 'https://example.com' } }, + }, + include: { attachments: true }, + }), + ).resolves.toMatchObject({ + name: 'Alice', + attachments: [{ url: 'https://example.com', entityId: expect.any(String) }], + }); + }); }); diff --git a/tests/e2e/orm/client-api/timezone/mysql-timezone.test.ts b/tests/e2e/orm/client-api/timezone/mysql-timezone.test.ts new file mode 100644 index 000000000..5f99a525b --- /dev/null +++ b/tests/e2e/orm/client-api/timezone/mysql-timezone.test.ts @@ -0,0 +1,86 @@ +import { createTestClient } from '@zenstackhq/testtools'; +import { afterEach, beforeEach, describe, expect, it } from 'vitest'; + +describe('Timezone handling tests for mysql', () => { + // Regression for https://github.com/zenstackhq/zenstack/issues/2589 — + // `@db.Time` values were returned as raw strings / Invalid Date because + // `new Date("09:30:00Z")` can't parse a bare time string. + describe('@db.Time fields', () => { + const schema = ` +model Exchange { + id Int @id @default(autoincrement()) + name String + tradingWindows ExchangeTradingWindow[] +} + +model ExchangeTradingWindow { + id Int @id @default(autoincrement()) + exchangeId Int + exchange Exchange @relation(fields: [exchangeId], references: [id], onDelete: Cascade) + open DateTime @db.Time(6) + close DateTime @db.Time(6) +} + `; + + let client: any; + + beforeEach(async () => { + client = await createTestClient(schema, { + usePrismaPush: true, + provider: 'mysql', + }); + }); + + afterEach(async () => { + await client?.$disconnect(); + }); + + it('returns @db.Time fields as Date via nested include', async () => { + const exchange = await client.exchange.create({ data: { name: 'NYSE' } }); + + await client.$qb + .insertInto('ExchangeTradingWindow') + .values({ + exchangeId: exchange.id, + open: '09:30:00', + close: '16:00:00', + }) + .execute(); + + const result = await client.exchange.findUnique({ + where: { id: exchange.id }, + include: { tradingWindows: true }, + }); + + expect(result.tradingWindows).toHaveLength(1); + const win = result.tradingWindows[0]; + + expect(win.open).toBeInstanceOf(Date); + expect(win.open.toISOString()).toBe('1970-01-01T09:30:00.000Z'); + expect(win.close).toBeInstanceOf(Date); + expect(win.close.toISOString()).toBe('1970-01-01T16:00:00.000Z'); + }); + + it('returns @db.Time fields as Date on a direct select', async () => { + const exchange = await client.exchange.create({ data: { name: 'NYSE' } }); + + await client.$qb + .insertInto('ExchangeTradingWindow') + .values({ + exchangeId: exchange.id, + open: '09:30:00', + close: '16:00:00', + }) + .execute(); + + const windows = await client.exchangeTradingWindow.findMany({ + where: { exchangeId: exchange.id }, + }); + + expect(windows).toHaveLength(1); + expect(windows[0].open).toBeInstanceOf(Date); + expect(windows[0].open.toISOString()).toBe('1970-01-01T09:30:00.000Z'); + expect(windows[0].close).toBeInstanceOf(Date); + }); + }); +}); diff --git a/tests/e2e/orm/client-api/timezone/pg-timezone.test.ts b/tests/e2e/orm/client-api/timezone/pg-timezone.test.ts index 935ca818d..915f44f1c 100644 --- a/tests/e2e/orm/client-api/timezone/pg-timezone.test.ts +++ b/tests/e2e/orm/client-api/timezone/pg-timezone.test.ts @@ -543,4 +543,103 @@ model Post { } }); }); + + // Regression for https://github.com/zenstackhq/zenstack/issues/2589 — + // `@db.Time` values were returned as raw strings instead of Date when fetched through + // a nested include (the lateral-join JSON path where pg's per-OID parsers don't fire). + describe('@db.Time fields', () => { + const schema = ` +model Exchange { + id Int @id @default(autoincrement()) + name String + tradingWindows ExchangeTradingWindow[] +} + +model ExchangeTradingWindow { + id Int @id @default(autoincrement()) + exchangeId Int + exchange Exchange @relation(fields: [exchangeId], references: [id], onDelete: Cascade) + open DateTime @db.Time(6) + close DateTime @db.Time(6) + openTz DateTime @db.Timetz(6) + effectiveOn DateTime @db.Date +} + `; + + let client: any; + + beforeEach(async () => { + client = await createTestClient(schema, { + usePrismaPush: true, + provider: 'postgresql', + }); + }); + + afterEach(async () => { + await client?.$disconnect(); + }); + + it('returns @db.Time / @db.Timetz / @db.Date fields as Date via nested include', async () => { + const exchange = await client.exchange.create({ data: { name: 'NYSE' } }); + + await client.$qb + .insertInto('ExchangeTradingWindow') + .values({ + exchangeId: exchange.id, + open: '09:30:00', + close: '16:00:00', + openTz: '09:30:00+00', + effectiveOn: '2024-06-15', + }) + .execute(); + + const result = await client.exchange.findUnique({ + where: { id: exchange.id }, + include: { tradingWindows: true }, + }); + + expect(result.tradingWindows).toHaveLength(1); + const win = result.tradingWindows[0]; + + expect(win.open).toBeInstanceOf(Date); + expect(win.open.toISOString()).toBe('1970-01-01T09:30:00.000Z'); + expect(win.close).toBeInstanceOf(Date); + expect(win.close.toISOString()).toBe('1970-01-01T16:00:00.000Z'); + expect(win.openTz).toBeInstanceOf(Date); + expect(win.openTz.toISOString()).toBe('1970-01-01T09:30:00.000Z'); + // @db.Date must not be corrupted by the tz-offset expansion (guarding + // against `2024-06-15` being rewritten to `2024-06-15:00`). + expect(win.effectiveOn).toBeInstanceOf(Date); + expect(win.effectiveOn.toISOString()).toBe('2024-06-15T00:00:00.000Z'); + }); + + it('returns @db.Time / @db.Date fields as Date on a direct select', async () => { + const exchange = await client.exchange.create({ data: { name: 'NYSE' } }); + + await client.$qb + .insertInto('ExchangeTradingWindow') + .values({ + exchangeId: exchange.id, + open: '09:30:00', + close: '16:00:00', + openTz: '09:30:00+00', + effectiveOn: '2024-06-15', + }) + .execute(); + + const windows = await client.exchangeTradingWindow.findMany({ + where: { exchangeId: exchange.id }, + }); + + expect(windows).toHaveLength(1); + expect(windows[0].open).toBeInstanceOf(Date); + expect(windows[0].open.toISOString()).toBe('1970-01-01T09:30:00.000Z'); + expect(windows[0].close).toBeInstanceOf(Date); + expect(windows[0].openTz).toBeInstanceOf(Date); + // On direct select pg's default DATE parser returns a Date anchored in local + // time, so we only assert the instance type here — the include path above + // exercises the string branch (which is where the offset-expansion bug lived). + expect(windows[0].effectiveOn).toBeInstanceOf(Date); + }); + }); }); diff --git a/tests/e2e/orm/client-api/zod.test.ts b/tests/e2e/orm/client-api/zod.test.ts index abee059d5..7e518803b 100644 --- a/tests/e2e/orm/client-api/zod.test.ts +++ b/tests/e2e/orm/client-api/zod.test.ts @@ -618,11 +618,6 @@ describe('Zod schema factory test', () => { }); describe('makeAggregateSchema', () => { - it('accepts undefined (all optional)', () => { - const s = client.$zod.makeAggregateSchema('User'); - expect(s.safeParse(undefined).success).toBe(true); - }); - it('accepts where clause', () => { const s = client.$zod.makeAggregateSchema('User'); expect(s.safeParse({ where: { role: 'USER' } }).success).toBe(true); diff --git a/tests/e2e/package.json b/tests/e2e/package.json index 4137092a4..59d9bd1f4 100644 --- a/tests/e2e/package.json +++ b/tests/e2e/package.json @@ -1,6 +1,6 @@ { "name": "e2e", - "version": "3.5.6", + "version": "3.6.0", "private": true, "type": "module", "scripts": { diff --git a/tests/regression/package.json b/tests/regression/package.json index 36a5c442a..ab57a5e93 100644 --- a/tests/regression/package.json +++ b/tests/regression/package.json @@ -1,6 +1,6 @@ { "name": "regression", - "version": "3.5.6", + "version": "3.6.0", "private": true, "type": "module", "scripts": { @@ -13,7 +13,8 @@ }, "dependencies": { "@zenstackhq/testtools": "workspace:*", - "decimal.js": "catalog:" + "decimal.js": "catalog:", + "zod": "catalog:" }, "devDependencies": { "@zenstackhq/cli": "workspace:*", @@ -22,6 +23,7 @@ "@zenstackhq/orm": "workspace:*", "@zenstackhq/sdk": "workspace:*", "@zenstackhq/plugin-policy": "workspace:*", + "@zenstackhq/zod": "workspace:*", "@zenstackhq/typescript-config": "workspace:*", "@zenstackhq/vitest-config": "workspace:*", "@types/node": "catalog:" diff --git a/tests/regression/test/issue-2540.test.ts b/tests/regression/test/issue-2540.test.ts new file mode 100644 index 000000000..e193ebfd7 --- /dev/null +++ b/tests/regression/test/issue-2540.test.ts @@ -0,0 +1,63 @@ +import { createTestClient } from '@zenstackhq/testtools'; +import { describe, expect, it } from 'vitest'; + +describe('Regression for issue #2540', () => { + it('includes computed fields inherited from a mixin type when the model is explicitly included', async () => { + const db = await createTestClient( + ` +type ParentRelated { + parentCode String? @computed +} + +model Parent { + id Int @id @default(autoincrement()) + code String + children Child[] +} + +model Child with ParentRelated { + id Int @id @default(autoincrement()) + name String + parentId Int + parent Parent @relation(fields: [parentId], references: [id]) +} + `, + { + provider: 'postgresql', + computedFields: { + Child: { + parentCode: (eb: any) => + eb + .selectFrom('Parent') + .select('Parent.code') + .whereRef('Parent.id', '=', 'parentId') + .limit(1), + }, + }, + } as any, + ); + + const parent = await db.parent.create({ + data: { code: 'P-001', children: { create: [{ name: 'Alice' }, { name: 'Bob' }] } }, + }); + + // Direct query on Child works fine + await expect(db.child.findFirst({ where: { parentId: parent.id } })).resolves.toMatchObject({ + parentCode: 'P-001', + }); + + // Querying Parent with include: { children: true } should also work + await expect( + db.parent.findFirst({ + where: { id: parent.id }, + include: { children: true }, + }), + ).resolves.toMatchObject({ + code: 'P-001', + children: expect.arrayContaining([ + expect.objectContaining({ name: 'Alice', parentCode: 'P-001' }), + expect.objectContaining({ name: 'Bob', parentCode: 'P-001' }), + ]), + }); + }); +}); diff --git a/tests/regression/test/issue-2550/regression.test.ts b/tests/regression/test/issue-2550/regression.test.ts new file mode 100644 index 000000000..fbfa6ceec --- /dev/null +++ b/tests/regression/test/issue-2550/regression.test.ts @@ -0,0 +1,44 @@ +import type { JsonValue } from '@zenstackhq/orm'; +import { createSchemaFactory } from '@zenstackhq/zod'; +import { describe, expectTypeOf, it } from 'vitest'; +import z from 'zod'; +import { schema } from './schema'; +import { createTestClient } from '@zenstackhq/testtools'; + +// https://github.com/zenstackhq/zenstack/issues/2550 + +const factory = createSchemaFactory(schema); + +describe('Regression for issue #2550', () => { + it('matches ORM signature', async () => { + const db = await createTestClient(schema); + const _schema = factory.makeModelSchema('Test'); + type T = Awaited>; + expectTypeOf().toExtend>(); + }); + + it('makeModelSchema Json field type accepts JsonValue (including readonly arrays)', () => { + const _schema = factory.makeModelSchema('Test'); + type Test = z.infer; + + // `metaData` is `Json` with a default in the schema. Assigning a `JsonValue` + // returned by the ORM (which includes readonly arrays) to the inferred type + // must compile without error. + // Before the fix this failed because `readonly T[]` is not assignable to `T[]`. + expectTypeOf().toExtend>(); + }); + + it('makeModelSchema with optionality:defaults Json field type accepts JsonValue', () => { + const _schema = factory.makeModelSchema('Test', { optionality: 'defaults' }); + type TestCreate = z.infer; + + expectTypeOf().toExtend>(); + }); + + it('makeModelSchema with optionality:all Json field type accepts JsonValue', () => { + const _schema = factory.makeModelSchema('Test', { optionality: 'all' }); + type TestUpdate = z.infer; + + expectTypeOf().toExtend>(); + }); +}); diff --git a/tests/regression/test/issue-2550/schema.ts b/tests/regression/test/issue-2550/schema.ts new file mode 100644 index 000000000..96699117b --- /dev/null +++ b/tests/regression/test/issue-2550/schema.ts @@ -0,0 +1,43 @@ +////////////////////////////////////////////////////////////////////////////////////////////// +// DO NOT MODIFY THIS FILE // +// This file is automatically generated by ZenStack CLI and should not be manually updated. // +////////////////////////////////////////////////////////////////////////////////////////////// + +/* eslint-disable */ + +import { type SchemaDef, type AttributeApplication, type FieldDefault, ExpressionUtils } from "@zenstackhq/schema"; +export class SchemaType implements SchemaDef { + provider = { + type: "postgresql" + } as const; + models = { + Test: { + name: "Test", + fields: { + id: { + name: "id", + type: "String", + id: true, + attributes: [{ name: "@id" }, { name: "@default", args: [{ name: "value", value: ExpressionUtils.call("uuid") }] }] as readonly AttributeApplication[], + default: ExpressionUtils.call("uuid") as FieldDefault + }, + name: { + name: "name", + type: "String" + }, + metaData: { + name: "metaData", + type: "Json", + attributes: [{ name: "@default", args: [{ name: "value", value: ExpressionUtils.literal("{}") }] }] as readonly AttributeApplication[], + default: "{}" as FieldDefault + } + }, + idFields: ["id"], + uniqueFields: { + id: { type: "String" } + } + } + } as const; + plugins = {}; +} +export const schema = new SchemaType(); diff --git a/tests/regression/test/issue-2550/schema.zmodel b/tests/regression/test/issue-2550/schema.zmodel new file mode 100644 index 000000000..3c56ce3d3 --- /dev/null +++ b/tests/regression/test/issue-2550/schema.zmodel @@ -0,0 +1,10 @@ +datasource db { + provider = 'postgresql' + url = env("DATABASE_URL") +} + +model Test { + id String @id @default(uuid()) + name String + metaData Json @default("{}") +} diff --git a/tests/regression/test/issue-2578.test.ts b/tests/regression/test/issue-2578.test.ts new file mode 100644 index 000000000..cc599e361 --- /dev/null +++ b/tests/regression/test/issue-2578.test.ts @@ -0,0 +1,123 @@ +import { createTestClient } from '@zenstackhq/testtools'; +import { describe, expect, it } from 'vitest'; + +// https://github.com/zenstackhq/zenstack/issues/2578 +// Sibling of issue 2440, covering the to-one (non-array) relation filter path: +// `buildToOneRelationFilter` used to emit `(select count(1) ...) > 0` which +// PostgreSQL can't convert to a semi-join; it now emits `EXISTS (...)`. +describe('Regression for issue 2578', () => { + const schema = ` +model Post { + id Int @id @default(autoincrement()) + title String + value Int + userId Int? + user User? @relation(fields: [userId], references: [id]) +} + +model User { + id Int @id @default(autoincrement()) + name String + posts Post[] +} + `; + + it('to-one relation filter with field predicate returns matching children', async () => { + const db = await createTestClient(schema); + + const userA = await db.user.create({ data: { name: 'A' } }); + const userB = await db.user.create({ data: { name: 'B' } }); + + const p1 = await db.post.create({ data: { title: 'p1', value: 1, userId: userA.id } }); + const p2 = await db.post.create({ data: { title: 'p2', value: 2, userId: userB.id } }); + const p3 = await db.post.create({ data: { title: 'p3', value: 3, userId: null } }); + + // `user: { name: 'A' }` is a to-one relation filter + const result = await db.post.findMany({ + where: { user: { name: 'A' } }, + orderBy: { id: 'asc' }, + }); + expect(result).toHaveLength(1); + expect(result[0].id).toBe(p1.id); + + // posts with no user should not match a user filter + const result2 = await db.post.findMany({ + where: { user: { name: 'C' } }, + orderBy: { id: 'asc' }, + }); + expect(result2).toHaveLength(0); + + // keep references live so the test intent is readable + expect([p1.id, p2.id, p3.id].length).toBe(3); + }); + + it('`is` with field predicate matches the related row', async () => { + const db = await createTestClient(schema); + + const userA = await db.user.create({ data: { name: 'A' } }); + const userB = await db.user.create({ data: { name: 'B' } }); + const p1 = await db.post.create({ data: { title: 'p1', value: 1, userId: userA.id } }); + const p2 = await db.post.create({ data: { title: 'p2', value: 2, userId: userB.id } }); + await db.post.create({ data: { title: 'p3', value: 3, userId: null } }); + + const result = await db.post.findMany({ + where: { user: { is: { name: 'B' } } }, + orderBy: { id: 'asc' }, + }); + expect(result).toHaveLength(1); + expect(result[0].id).toBe(p2.id); + + // sanity: other rows are still reachable + expect(p1.id).toBeDefined(); + }); + + it('`is: null` matches rows with no related record', async () => { + const db = await createTestClient(schema); + + const userA = await db.user.create({ data: { name: 'A' } }); + await db.post.create({ data: { title: 'p1', value: 1, userId: userA.id } }); + const p2 = await db.post.create({ data: { title: 'p2', value: 2, userId: null } }); + + const result = await db.post.findMany({ + where: { user: { is: null } }, + orderBy: { id: 'asc' }, + }); + expect(result).toHaveLength(1); + expect(result[0].id).toBe(p2.id); + }); + + it('`isNot: null` matches rows with a related record', async () => { + const db = await createTestClient(schema); + + const userA = await db.user.create({ data: { name: 'A' } }); + const p1 = await db.post.create({ data: { title: 'p1', value: 1, userId: userA.id } }); + await db.post.create({ data: { title: 'p2', value: 2, userId: null } }); + + const result = await db.post.findMany({ + where: { user: { isNot: null } }, + orderBy: { id: 'asc' }, + }); + expect(result).toHaveLength(1); + expect(result[0].id).toBe(p1.id); + }); + + it('`isNot` with field predicate matches rows where the related record does not satisfy the filter or has no related record', async () => { + const db = await createTestClient(schema); + + const userA = await db.user.create({ data: { name: 'A' } }); + const userB = await db.user.create({ data: { name: 'B' } }); + const p1 = await db.post.create({ data: { title: 'p1', value: 1, userId: userA.id } }); + const p2 = await db.post.create({ data: { title: 'p2', value: 2, userId: userB.id } }); + const p3 = await db.post.create({ data: { title: 'p3', value: 3, userId: null } }); + + // posts whose related user is NOT named 'A' (includes the no-user case) + const result = await db.post.findMany({ + where: { user: { isNot: { name: 'A' } } }, + orderBy: { id: 'asc' }, + }); + const ids = result.map((p: any) => p.id); + expect(ids).toContain(p2.id); + expect(ids).toContain(p3.id); + expect(ids).not.toContain(p1.id); + }); +}); diff --git a/tests/regression/test/issue-2588.test.ts b/tests/regression/test/issue-2588.test.ts new file mode 100644 index 000000000..92d92a279 --- /dev/null +++ b/tests/regression/test/issue-2588.test.ts @@ -0,0 +1,78 @@ +import { createTestClient } from '@zenstackhq/testtools'; +import { describe, expect, it } from 'vitest'; + +// https://github.com/zenstackhq/zenstack/issues/2588 +describe('Regression for issue 2588', () => { + const schema = ` +model Asset { + id String @id @default(uuid()) + createdAt DateTime @default(now()) + assetType String + @@delegate(assetType) +} + +model Notification extends Asset { + title String +} +`; + + async function setup() { + const db = await createTestClient(schema); + const a = await db.notification.create({ + data: { title: 'A', createdAt: new Date('2025-01-01T00:00:00Z') }, + }); + const b = await db.notification.create({ + data: { title: 'B', createdAt: new Date('2025-01-02T00:00:00Z') }, + }); + const c = await db.notification.create({ + data: { title: 'C', createdAt: new Date('2025-01-03T00:00:00Z') }, + }); + return { db, a, b, c }; + } + + it('cursor + orderBy on delegate parent field does not error', async () => { + const { db, b } = await setup(); + + const result = await db.notification.findMany({ + cursor: { id: b.id }, + orderBy: { createdAt: 'asc' }, + }); + + expect(result.map((n: any) => n.title)).toEqual(['B', 'C']); + }); + + it('cursor + skip + orderBy on delegate parent field works', async () => { + const { db, a } = await setup(); + + const result = await db.notification.findMany({ + cursor: { id: a.id }, + skip: 1, + orderBy: { createdAt: 'asc' }, + take: 25, + }); + + expect(result.map((n: any) => n.title)).toEqual(['B', 'C']); + }); + + it('cursor + multiple orderBy mixing child and delegate fields', async () => { + const { db, a } = await setup(); + + const result = await db.notification.findMany({ + cursor: { id: a.id }, + orderBy: [{ createdAt: 'asc' }, { id: 'asc' }], + }); + + expect(result.map((n: any) => n.title)).toEqual(['A', 'B', 'C']); + }); + + it('cursor + orderBy on child field still works', async () => { + const { db, b } = await setup(); + + const result = await db.notification.findMany({ + cursor: { id: b.id }, + orderBy: { title: 'asc' }, + }); + + expect(result.map((n: any) => n.title)).toEqual(['B', 'C']); + }); +}); diff --git a/tests/regression/test/issue-274/regression.test.ts b/tests/regression/test/issue-274/regression.test.ts index ffa11a09b..128185a38 100644 --- a/tests/regression/test/issue-274/regression.test.ts +++ b/tests/regression/test/issue-274/regression.test.ts @@ -23,5 +23,5 @@ model User { } `); - execSync('node node_modules/@zenstackhq/cli/dist/index.js migrate dev --name init', { cwd: dir }); + execSync('node node_modules/@zenstackhq/cli/dist/index.mjs migrate dev --name init', { cwd: dir }); }); diff --git a/tests/runtimes/bun/package.json b/tests/runtimes/bun/package.json index 090c62598..e4d7ae69e 100644 --- a/tests/runtimes/bun/package.json +++ b/tests/runtimes/bun/package.json @@ -1,6 +1,6 @@ { "name": "bun-e2e", - "version": "3.5.6", + "version": "3.6.0", "private": true, "type": "module", "scripts": { diff --git a/tests/runtimes/edge-runtime/package.json b/tests/runtimes/edge-runtime/package.json index f1713f912..e0d217ea7 100644 --- a/tests/runtimes/edge-runtime/package.json +++ b/tests/runtimes/edge-runtime/package.json @@ -1,6 +1,6 @@ { "name": "edge-runtime-e2e", - "version": "3.5.6", + "version": "3.6.0", "private": true, "type": "module", "scripts": {