From 9b95c290f8049433c7e28b77f7d819a08a452d73 Mon Sep 17 00:00:00 2001 From: FTB_lag Date: Tue, 30 Dec 2025 22:26:17 +0300 Subject: [PATCH 01/12] feat(cli): implement watch mode for generate --- packages/cli/package.json | 1 + packages/cli/src/actions/generate.ts | 98 +++++++++++++++++++++++++++- packages/cli/src/index.ts | 6 ++ 3 files changed, 103 insertions(+), 2 deletions(-) diff --git a/packages/cli/package.json b/packages/cli/package.json index 39540625b..7c81f4251 100644 --- a/packages/cli/package.json +++ b/packages/cli/package.json @@ -35,6 +35,7 @@ "@zenstackhq/common-helpers": "workspace:*", "@zenstackhq/language": "workspace:*", "@zenstackhq/sdk": "workspace:*", + "chokidar": "^5.0.0", "colors": "1.4.0", "commander": "^8.3.0", "execa": "^9.6.0", diff --git a/packages/cli/src/actions/generate.ts b/packages/cli/src/actions/generate.ts index c41a99ea4..b5e99df22 100644 --- a/packages/cli/src/actions/generate.ts +++ b/packages/cli/src/actions/generate.ts @@ -1,5 +1,6 @@ import { invariant } from '@zenstackhq/common-helpers'; -import { isPlugin, LiteralExpr, Plugin, type Model } from '@zenstackhq/language/ast'; +import { ZModelLanguageMetaData } from '@zenstackhq/language'; +import { isPlugin, isDataModel, type DataModel, LiteralExpr, Plugin, type Model } from '@zenstackhq/language/ast'; import { getLiteral, getLiteralArray } from '@zenstackhq/language/utils'; import { type CliPlugin } from '@zenstackhq/sdk'; import colors from 'colors'; @@ -16,6 +17,7 @@ type Options = { schema?: string; output?: string; silent: boolean; + watch: boolean; lite: boolean; liteOnly: boolean; }; @@ -24,6 +26,93 @@ type Options = { * CLI action for generating code from schema */ export async function run(options: Options) { + const model = await pureGenerate(options, false); + + if (options.watch) { + const logsEnabled = !options.silent; + + if (logsEnabled) { + console.log(colors.green(`\nEnable watch mode!`)); + } + + const schemaExtensions = ZModelLanguageMetaData.fileExtensions; + + // Get real models file path (cuz its merged into single document -> we need use cst nodes) + const getModelAllPaths = (model: Model) => new Set( + ( + model.declarations.filter( + (v) => + isDataModel(v) && + v.$cstNode?.parent?.element.$type === 'Model' && + !!v.$cstNode.parent.element.$document?.uri?.fsPath, + ) as DataModel[] + ).map((v) => v.$cstNode!.parent!.element.$document!.uri!.fsPath), + ); + + const { watch } = await import('chokidar'); + + const watchedPaths = getModelAllPaths(model); + let reGenerateSchemaTimeout: ReturnType | undefined; + + if (logsEnabled) { + const logPaths = [...watchedPaths].map((at) => `- ${at}`).join('\n'); + console.log(`Watched file paths:\n${logPaths}`); + } + + const watcher = watch([...watchedPaths], { + alwaysStat: false, + ignoreInitial: true, + ignorePermissionErrors: true, + ignored: (at) => !schemaExtensions.some((ext) => at.endsWith(ext)), + }); + + const reGenerateSchema = () => { + clearTimeout(reGenerateSchemaTimeout); + + // prevent save multiple files and run multiple times + reGenerateSchemaTimeout = setTimeout(async () => { + if (logsEnabled) { + console.log('Got changes, run generation!'); + } + + try { + const newModel = await pureGenerate(options, true); + const allModelsPaths = getModelAllPaths(newModel); + const newModelPaths = [...allModelsPaths].filter((at) => !watchedPaths.has(at)); + + if (newModelPaths.length) { + if (logsEnabled) { + const logPaths = [...newModelPaths].map((at) => `- ${at}`).join('\n'); + console.log(`Add file(s) to watch:\n${logPaths}`); + } + + newModelPaths.forEach((at) => watchedPaths.add(at)); + watcher.add(newModelPaths); + } + } catch (e) { + console.error(e); + } + }, 500); + }; + + watcher.on('unlink', (pathAt) => { + if (logsEnabled) { + console.log(`Remove file from watch: ${pathAt}`); + } + + watchedPaths.delete(pathAt); + watcher.unwatch(pathAt); + + reGenerateSchema(); + }); + + watcher.on('change', () => { + reGenerateSchema(); + }); + } +} + +async function pureGenerate(options: Options, fromWatch: boolean) { const start = Date.now(); const schemaFile = getSchemaFile(options.schema); @@ -35,7 +124,9 @@ export async function run(options: Options) { if (!options.silent) { console.log(colors.green(`Generation completed successfully in ${Date.now() - start}ms.\n`)); - console.log(`You can now create a ZenStack client with it. + + if (!fromWatch) { + console.log(`You can now create a ZenStack client with it. \`\`\`ts import { ZenStackClient } from '@zenstackhq/orm'; @@ -47,7 +138,10 @@ const client = new ZenStackClient(schema, { \`\`\` Check documentation: https://zenstack.dev/docs/`); + } } + + return model; } function getOutputPath(options: Options, schemaFile: string) { diff --git a/packages/cli/src/index.ts b/packages/cli/src/index.ts index c2307fa1d..0d663044c 100644 --- a/packages/cli/src/index.ts +++ b/packages/cli/src/index.ts @@ -68,6 +68,7 @@ function createProgram() { .addOption(schemaOption) .addOption(noVersionCheckOption) .addOption(new Option('-o, --output ', 'default output directory for code generation')) + .addOption(new Option('-w, --watch', 'enable watch mode').default(false)) .addOption(new Option('--lite', 'also generate a lite version of schema without attributes').default(false)) .addOption(new Option('--lite-only', 'only generate lite version of schema without attributes').default(false)) .addOption(new Option('--silent', 'suppress all output except errors').default(false)) @@ -220,6 +221,11 @@ async function main() { } } + if (program.args.includes('generate') && (program.args.includes('-w') || program.args.includes('--watch'))) { + // A "hack" way to prevent the process from terminating because we don't want to stop it. + return; + } + if (telemetry.isTracking) { // give telemetry a chance to send events before exit setTimeout(() => { From 48959490392ec3ae94dedb3d8288f5f639c05813 Mon Sep 17 00:00:00 2001 From: FTB_lag Date: Mon, 5 Jan 2026 22:54:58 +0300 Subject: [PATCH 02/12] chore(root): update pnpm-lock.yaml --- pnpm-lock.yaml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index ba5f04d5d..df889c6bd 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -183,6 +183,9 @@ importers: '@zenstackhq/sdk': specifier: workspace:* version: link:../sdk + chokidar: + specifier: ^5.0.0 + version: 5.0.0 colors: specifier: 1.4.0 version: 1.4.0 From 469cb266282b047bb18dce6791d5c3017be1d8b4 Mon Sep 17 00:00:00 2001 From: FTB_lag Date: Mon, 5 Jan 2026 22:56:14 +0300 Subject: [PATCH 03/12] chore(cli): track all model declaration and removed paths, logs in past tense --- packages/cli/src/actions/generate.ts | 28 +++++++++++++++++++--------- 1 file changed, 19 insertions(+), 9 deletions(-) diff --git a/packages/cli/src/actions/generate.ts b/packages/cli/src/actions/generate.ts index b5e99df22..c48c4aa51 100644 --- a/packages/cli/src/actions/generate.ts +++ b/packages/cli/src/actions/generate.ts @@ -1,6 +1,6 @@ import { invariant } from '@zenstackhq/common-helpers'; import { ZModelLanguageMetaData } from '@zenstackhq/language'; -import { isPlugin, isDataModel, type DataModel, LiteralExpr, Plugin, type Model } from '@zenstackhq/language/ast'; +import { type AbstractDeclaration, isPlugin, LiteralExpr, Plugin, type Model } from '@zenstackhq/language/ast'; import { getLiteral, getLiteralArray } from '@zenstackhq/language/utils'; import { type CliPlugin } from '@zenstackhq/sdk'; import colors from 'colors'; @@ -32,26 +32,25 @@ export async function run(options: Options) { const logsEnabled = !options.silent; if (logsEnabled) { - console.log(colors.green(`\nEnable watch mode!`)); + console.log(colors.green(`\nEnabled watch mode!`)); } const schemaExtensions = ZModelLanguageMetaData.fileExtensions; // Get real models file path (cuz its merged into single document -> we need use cst nodes) - const getModelAllPaths = (model: Model) => new Set( + const getRootModelWatchPaths = (model: Model) => new Set( ( model.declarations.filter( (v) => - isDataModel(v) && v.$cstNode?.parent?.element.$type === 'Model' && !!v.$cstNode.parent.element.$document?.uri?.fsPath, - ) as DataModel[] + ) as AbstractDeclaration[] ).map((v) => v.$cstNode!.parent!.element.$document!.uri!.fsPath), ); const { watch } = await import('chokidar'); - const watchedPaths = getModelAllPaths(model); + const watchedPaths = getRootModelWatchPaths(model); let reGenerateSchemaTimeout: ReturnType | undefined; if (logsEnabled) { @@ -77,18 +76,29 @@ export async function run(options: Options) { try { const newModel = await pureGenerate(options, true); - const allModelsPaths = getModelAllPaths(newModel); + const allModelsPaths = getRootModelWatchPaths(newModel); const newModelPaths = [...allModelsPaths].filter((at) => !watchedPaths.has(at)); + const removeModelPaths = [...watchedPaths].filter((at) => !allModelsPaths.has(at)); if (newModelPaths.length) { if (logsEnabled) { const logPaths = [...newModelPaths].map((at) => `- ${at}`).join('\n'); - console.log(`Add file(s) to watch:\n${logPaths}`); + console.log(`Added file(s) to watch:\n${logPaths}`); } newModelPaths.forEach((at) => watchedPaths.add(at)); watcher.add(newModelPaths); } + + if (removeModelPaths.length) { + if (logsEnabled) { + const logPaths = [...removeModelPaths].map((at) => `- ${at}`).join('\n'); + console.log(`Added file(s) to watch:\n${logPaths}`); + } + + removeModelPaths.forEach((at) => watchedPaths.add(at)); + watcher.add(removeModelPaths); + } } catch (e) { console.error(e); } @@ -97,7 +107,7 @@ export async function run(options: Options) { watcher.on('unlink', (pathAt) => { if (logsEnabled) { - console.log(`Remove file from watch: ${pathAt}`); + console.log(`Removed file from watch: ${pathAt}`); } watchedPaths.delete(pathAt); From 92814cad4d3c7b422afb68f54ba7e153cc97370a Mon Sep 17 00:00:00 2001 From: FTB_lag Date: Mon, 5 Jan 2026 23:33:59 +0300 Subject: [PATCH 04/12] fix(cli): typo, unused double array from --- packages/cli/src/actions/generate.ts | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/packages/cli/src/actions/generate.ts b/packages/cli/src/actions/generate.ts index c48c4aa51..aefb9083d 100644 --- a/packages/cli/src/actions/generate.ts +++ b/packages/cli/src/actions/generate.ts @@ -82,7 +82,7 @@ export async function run(options: Options) { if (newModelPaths.length) { if (logsEnabled) { - const logPaths = [...newModelPaths].map((at) => `- ${at}`).join('\n'); + const logPaths = newModelPaths.map((at) => `- ${at}`).join('\n'); console.log(`Added file(s) to watch:\n${logPaths}`); } @@ -92,12 +92,12 @@ export async function run(options: Options) { if (removeModelPaths.length) { if (logsEnabled) { - const logPaths = [...removeModelPaths].map((at) => `- ${at}`).join('\n'); - console.log(`Added file(s) to watch:\n${logPaths}`); + const logPaths = removeModelPaths.map((at) => `- ${at}`).join('\n'); + console.log(`Removed file(s) from watch:\n${logPaths}`); } - removeModelPaths.forEach((at) => watchedPaths.add(at)); - watcher.add(removeModelPaths); + removeModelPaths.forEach((at) => watchedPaths.delete(at)); + watcher.unwatch(removeModelPaths); } } catch (e) { console.error(e); From c9f31ea2fbd1d36d94b9dc0bd5472288a49c5d3d Mon Sep 17 00:00:00 2001 From: ymc9 <104139426+ymc9@users.noreply.github.com> Date: Tue, 6 Jan 2026 21:00:31 +0800 Subject: [PATCH 05/12] fix(orm): preserve zod validation errors when validating custom json types --- .../orm/src/client/crud/validator/index.ts | 8 ++++++-- .../orm/client-api/typed-json-fields.test.ts | 2 +- tests/regression/test/issue-558.test.ts | 19 +++++++++++++++++++ 3 files changed, 26 insertions(+), 3 deletions(-) create mode 100644 tests/regression/test/issue-558.test.ts diff --git a/packages/orm/src/client/crud/validator/index.ts b/packages/orm/src/client/crud/validator/index.ts index dc1a6f836..072e34b6f 100644 --- a/packages/orm/src/client/crud/validator/index.ts +++ b/packages/orm/src/client/crud/validator/index.ts @@ -382,9 +382,13 @@ export class InputValidator { // zod doesn't preserve object field order after parsing, here we use a // validation-only custom schema and use the original data if parsing // is successful - const finalSchema = z.custom((v) => { - return schema.safeParse(v).success; + const finalSchema = z.any().superRefine((value, ctx) => { + const parseResult = schema.safeParse(value); + if (!parseResult.success) { + parseResult.error.issues.forEach((issue) => ctx.addIssue(issue as any)); + } }); + this.setSchemaCache(key!, finalSchema); return finalSchema; } diff --git a/tests/e2e/orm/client-api/typed-json-fields.test.ts b/tests/e2e/orm/client-api/typed-json-fields.test.ts index a213c1d82..f5a8945c1 100644 --- a/tests/e2e/orm/client-api/typed-json-fields.test.ts +++ b/tests/e2e/orm/client-api/typed-json-fields.test.ts @@ -121,7 +121,7 @@ model User { }, }, }), - ).rejects.toThrow(/invalid/i); + ).rejects.toThrow('data.identity.providers[0].id'); }); it('works with find', async () => { diff --git a/tests/regression/test/issue-558.test.ts b/tests/regression/test/issue-558.test.ts new file mode 100644 index 000000000..4a76e31f4 --- /dev/null +++ b/tests/regression/test/issue-558.test.ts @@ -0,0 +1,19 @@ +import { createTestClient } from '@zenstackhq/testtools'; +import { describe, expect, it } from 'vitest'; + +describe('Regression for issue #558', () => { + it('verifies issue 558', async () => { + const db = await createTestClient(` +type Foo { + x Int +} + +model Model { + id String @id @default(cuid()) + foo Foo @json +} + `); + + await expect(db.model.create({ data: { foo: { x: 'hello' } } })).rejects.toThrow('data.foo.x'); + }); +}); From b625c508d1db0a60ee887c3487b91c2b0e28b149 Mon Sep 17 00:00:00 2001 From: ymc9 <104139426+ymc9@users.noreply.github.com> Date: Tue, 6 Jan 2026 21:04:27 +0800 Subject: [PATCH 06/12] update --- packages/orm/src/client/crud/validator/index.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/orm/src/client/crud/validator/index.ts b/packages/orm/src/client/crud/validator/index.ts index 072e34b6f..8b16a9de1 100644 --- a/packages/orm/src/client/crud/validator/index.ts +++ b/packages/orm/src/client/crud/validator/index.ts @@ -499,7 +499,7 @@ export class InputValidator { } // expression builder - fields['$expr'] = z.custom((v) => typeof v === 'function').optional(); + fields['$expr'] = z.custom((v) => typeof v === 'function', { error: '"$expr" must be a function' }).optional(); // logical operators fields['AND'] = this.orArray( From 835a01ba55562f37c5ff6f07aba08e898e7f2f17 Mon Sep 17 00:00:00 2001 From: FTB_lag Date: Wed, 7 Jan 2026 04:28:36 +0300 Subject: [PATCH 07/12] chore(cli): move import, fix parallel generation on watch --- packages/cli/src/actions/generate.ts | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/packages/cli/src/actions/generate.ts b/packages/cli/src/actions/generate.ts index aefb9083d..ba8fd1585 100644 --- a/packages/cli/src/actions/generate.ts +++ b/packages/cli/src/actions/generate.ts @@ -8,6 +8,7 @@ import { createJiti } from 'jiti'; import fs from 'node:fs'; import path from 'node:path'; import { pathToFileURL } from 'node:url'; +import { watch } from 'chokidar'; import ora, { type Ora } from 'ora'; import { CliError } from '../cli-error'; import * as corePlugins from '../plugins'; @@ -48,10 +49,9 @@ export async function run(options: Options) { ).map((v) => v.$cstNode!.parent!.element.$document!.uri!.fsPath), ); - const { watch } = await import('chokidar'); - const watchedPaths = getRootModelWatchPaths(model); let reGenerateSchemaTimeout: ReturnType | undefined; + let generationInProgress = false; if (logsEnabled) { const logPaths = [...watchedPaths].map((at) => `- ${at}`).join('\n'); @@ -70,6 +70,12 @@ export async function run(options: Options) { // prevent save multiple files and run multiple times reGenerateSchemaTimeout = setTimeout(async () => { + if (generationInProgress) { + return; + } + + generationInProgress = true; + if (logsEnabled) { console.log('Got changes, run generation!'); } @@ -102,6 +108,8 @@ export async function run(options: Options) { } catch (e) { console.error(e); } + + generationInProgress = false; }, 500); }; From f969ec4ef04525a5ec6e3efacb0381e536d89146 Mon Sep 17 00:00:00 2001 From: FTB_lag Date: Wed, 7 Jan 2026 04:40:38 +0300 Subject: [PATCH 08/12] feat(common-helpers): implement single-debounce --- packages/common-helpers/src/index.ts | 1 + 1 file changed, 1 insertion(+) diff --git a/packages/common-helpers/src/index.ts b/packages/common-helpers/src/index.ts index 07c4fff56..146609fb7 100644 --- a/packages/common-helpers/src/index.ts +++ b/packages/common-helpers/src/index.ts @@ -4,6 +4,7 @@ export * from './is-plain-object'; export * from './lower-case-first'; export * from './param-case'; export * from './safe-json-stringify'; +export * from './single-debounce'; export * from './sleep'; export * from './tiny-invariant'; export * from './upper-case-first'; From 87a95f0c58538df95eef5598cadc4de7fd0810db Mon Sep 17 00:00:00 2001 From: FTB_lag Date: Wed, 7 Jan 2026 04:40:51 +0300 Subject: [PATCH 09/12] chore(cli): use single-debounce for debouncing --- packages/cli/src/actions/generate.ts | 70 +++++++++++----------------- 1 file changed, 28 insertions(+), 42 deletions(-) diff --git a/packages/cli/src/actions/generate.ts b/packages/cli/src/actions/generate.ts index ba8fd1585..16e3826c7 100644 --- a/packages/cli/src/actions/generate.ts +++ b/packages/cli/src/actions/generate.ts @@ -1,4 +1,4 @@ -import { invariant } from '@zenstackhq/common-helpers'; +import { invariant, singleDebounce } from '@zenstackhq/common-helpers'; import { ZModelLanguageMetaData } from '@zenstackhq/language'; import { type AbstractDeclaration, isPlugin, LiteralExpr, Plugin, type Model } from '@zenstackhq/language/ast'; import { getLiteral, getLiteralArray } from '@zenstackhq/language/utils'; @@ -50,8 +50,6 @@ export async function run(options: Options) { ); const watchedPaths = getRootModelWatchPaths(model); - let reGenerateSchemaTimeout: ReturnType | undefined; - let generationInProgress = false; if (logsEnabled) { const logPaths = [...watchedPaths].map((at) => `- ${at}`).join('\n'); @@ -65,53 +63,41 @@ export async function run(options: Options) { ignored: (at) => !schemaExtensions.some((ext) => at.endsWith(ext)), }); - const reGenerateSchema = () => { - clearTimeout(reGenerateSchemaTimeout); + // prevent save multiple files and run multiple times + const reGenerateSchema = singleDebounce(async () => { + if (logsEnabled) { + console.log('Got changes, run generation!'); + } - // prevent save multiple files and run multiple times - reGenerateSchemaTimeout = setTimeout(async () => { - if (generationInProgress) { - return; - } + try { + const newModel = await pureGenerate(options, true); + const allModelsPaths = getRootModelWatchPaths(newModel); + const newModelPaths = [...allModelsPaths].filter((at) => !watchedPaths.has(at)); + const removeModelPaths = [...watchedPaths].filter((at) => !allModelsPaths.has(at)); - generationInProgress = true; + if (newModelPaths.length) { + if (logsEnabled) { + const logPaths = newModelPaths.map((at) => `- ${at}`).join('\n'); + console.log(`Added file(s) to watch:\n${logPaths}`); + } - if (logsEnabled) { - console.log('Got changes, run generation!'); + newModelPaths.forEach((at) => watchedPaths.add(at)); + watcher.add(newModelPaths); } - try { - const newModel = await pureGenerate(options, true); - const allModelsPaths = getRootModelWatchPaths(newModel); - const newModelPaths = [...allModelsPaths].filter((at) => !watchedPaths.has(at)); - const removeModelPaths = [...watchedPaths].filter((at) => !allModelsPaths.has(at)); - - if (newModelPaths.length) { - if (logsEnabled) { - const logPaths = newModelPaths.map((at) => `- ${at}`).join('\n'); - console.log(`Added file(s) to watch:\n${logPaths}`); - } - - newModelPaths.forEach((at) => watchedPaths.add(at)); - watcher.add(newModelPaths); + if (removeModelPaths.length) { + if (logsEnabled) { + const logPaths = removeModelPaths.map((at) => `- ${at}`).join('\n'); + console.log(`Removed file(s) from watch:\n${logPaths}`); } - if (removeModelPaths.length) { - if (logsEnabled) { - const logPaths = removeModelPaths.map((at) => `- ${at}`).join('\n'); - console.log(`Removed file(s) from watch:\n${logPaths}`); - } - - removeModelPaths.forEach((at) => watchedPaths.delete(at)); - watcher.unwatch(removeModelPaths); - } - } catch (e) { - console.error(e); + removeModelPaths.forEach((at) => watchedPaths.delete(at)); + watcher.unwatch(removeModelPaths); } - - generationInProgress = false; - }, 500); - }; + } catch (e) { + console.error(e); + } + }, 500, true); watcher.on('unlink', (pathAt) => { if (logsEnabled) { From d966e2ab2a751a5be2ed7654de23ff2852b975e2 Mon Sep 17 00:00:00 2001 From: FTB_lag Date: Wed, 7 Jan 2026 04:43:16 +0300 Subject: [PATCH 10/12] feat(common-helpers): implement single-debounce --- .../common-helpers/src/single-debounce.ts | 31 +++++++++++++++++++ 1 file changed, 31 insertions(+) create mode 100644 packages/common-helpers/src/single-debounce.ts diff --git a/packages/common-helpers/src/single-debounce.ts b/packages/common-helpers/src/single-debounce.ts new file mode 100644 index 000000000..86b0e379f --- /dev/null +++ b/packages/common-helpers/src/single-debounce.ts @@ -0,0 +1,31 @@ +export function singleDebounce(cb: () => void | PromiseLike, debounceMc: number, reRunOnInProgressCall: boolean = false) { + let timeout: ReturnType | undefined; + let inProgress = false; + let pendingInProgress = false; + + const run = async () => { + if (inProgress && reRunOnInProgressCall) { + pendingInProgress = true; + return; + } + + inProgress = true; + pendingInProgress = false; + + try { + await cb(); + } finally { + inProgress = false; + + if (pendingInProgress) { + await run(); + } + } + }; + + return () => { + clearTimeout(timeout); + + timeout = setTimeout(run, debounceMc); + } +} From 385e791d92fb5e0834515380095aab765a747ddc Mon Sep 17 00:00:00 2001 From: FTB_lag Date: Wed, 7 Jan 2026 14:44:49 +0300 Subject: [PATCH 11/12] fix(common-helpers): re run single-debounce --- packages/common-helpers/src/single-debounce.ts | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/packages/common-helpers/src/single-debounce.ts b/packages/common-helpers/src/single-debounce.ts index 86b0e379f..f16091e5c 100644 --- a/packages/common-helpers/src/single-debounce.ts +++ b/packages/common-helpers/src/single-debounce.ts @@ -4,8 +4,11 @@ export function singleDebounce(cb: () => void | PromiseLike, debounceMc: n let pendingInProgress = false; const run = async () => { - if (inProgress && reRunOnInProgressCall) { - pendingInProgress = true; + if (inProgress) { + if (reRunOnInProgressCall) { + pendingInProgress = true; + } + return; } From ca80727f94e6b76f5eb8c1c9c3b2eb9ecc5f634b Mon Sep 17 00:00:00 2001 From: ymc9 <104139426+ymc9@users.noreply.github.com> Date: Thu, 8 Jan 2026 16:18:16 +0800 Subject: [PATCH 12/12] chore: regenerate schemas --- samples/orm/zenstack/input.ts | 5 ++++- tests/e2e/orm/schemas/delegate/input.ts | 9 ++++++++- tests/e2e/orm/schemas/json/input.ts | 3 ++- tests/e2e/orm/schemas/name-mapping/input.ts | 4 +++- tests/e2e/orm/schemas/omit/input.ts | 6 +++++- tests/e2e/orm/schemas/petstore/input.ts | 5 ++++- tests/e2e/orm/schemas/procedures/input.ts | 3 ++- tests/e2e/orm/schemas/todo/input.ts | 7 ++++++- tests/e2e/orm/schemas/typed-json/input.ts | 3 ++- tests/e2e/orm/schemas/typing/input.ts | 8 +++++++- tests/regression/test/issue-204/input.ts | 3 ++- tests/regression/test/issue-422/input.ts | 5 ++++- tests/regression/test/issue-503/input.ts | 5 ++++- tests/runtimes/bun/schemas/input.ts | 4 +++- tests/runtimes/edge-runtime/schemas/input.ts | 4 +++- 15 files changed, 59 insertions(+), 15 deletions(-) diff --git a/samples/orm/zenstack/input.ts b/samples/orm/zenstack/input.ts index fcd198d49..cfc174c06 100644 --- a/samples/orm/zenstack/input.ts +++ b/samples/orm/zenstack/input.ts @@ -6,11 +6,12 @@ /* eslint-disable */ import { type SchemaType as $Schema } from "./schema"; -import type { FindManyArgs as $FindManyArgs, FindUniqueArgs as $FindUniqueArgs, FindFirstArgs as $FindFirstArgs, CreateArgs as $CreateArgs, CreateManyArgs as $CreateManyArgs, CreateManyAndReturnArgs as $CreateManyAndReturnArgs, UpdateArgs as $UpdateArgs, UpdateManyArgs as $UpdateManyArgs, UpdateManyAndReturnArgs as $UpdateManyAndReturnArgs, UpsertArgs as $UpsertArgs, DeleteArgs as $DeleteArgs, DeleteManyArgs as $DeleteManyArgs, CountArgs as $CountArgs, AggregateArgs as $AggregateArgs, GroupByArgs as $GroupByArgs, WhereInput as $WhereInput, SelectInput as $SelectInput, IncludeInput as $IncludeInput, OmitInput as $OmitInput, QueryOptions as $QueryOptions } from "@zenstackhq/orm"; +import type { FindManyArgs as $FindManyArgs, FindUniqueArgs as $FindUniqueArgs, FindFirstArgs as $FindFirstArgs, ExistsArgs as $ExistsArgs, CreateArgs as $CreateArgs, CreateManyArgs as $CreateManyArgs, CreateManyAndReturnArgs as $CreateManyAndReturnArgs, UpdateArgs as $UpdateArgs, UpdateManyArgs as $UpdateManyArgs, UpdateManyAndReturnArgs as $UpdateManyAndReturnArgs, UpsertArgs as $UpsertArgs, DeleteArgs as $DeleteArgs, DeleteManyArgs as $DeleteManyArgs, CountArgs as $CountArgs, AggregateArgs as $AggregateArgs, GroupByArgs as $GroupByArgs, WhereInput as $WhereInput, SelectInput as $SelectInput, IncludeInput as $IncludeInput, OmitInput as $OmitInput, QueryOptions as $QueryOptions } from "@zenstackhq/orm"; import type { SimplifiedPlainResult as $Result, SelectIncludeOmit as $SelectIncludeOmit } from "@zenstackhq/orm"; export type UserFindManyArgs = $FindManyArgs<$Schema, "User">; export type UserFindUniqueArgs = $FindUniqueArgs<$Schema, "User">; export type UserFindFirstArgs = $FindFirstArgs<$Schema, "User">; +export type UserExistsArgs = $ExistsArgs<$Schema, "User">; export type UserCreateArgs = $CreateArgs<$Schema, "User">; export type UserCreateManyArgs = $CreateManyArgs<$Schema, "User">; export type UserCreateManyAndReturnArgs = $CreateManyAndReturnArgs<$Schema, "User">; @@ -31,6 +32,7 @@ export type UserGetPayload; export type ProfileFindUniqueArgs = $FindUniqueArgs<$Schema, "Profile">; export type ProfileFindFirstArgs = $FindFirstArgs<$Schema, "Profile">; +export type ProfileExistsArgs = $ExistsArgs<$Schema, "Profile">; export type ProfileCreateArgs = $CreateArgs<$Schema, "Profile">; export type ProfileCreateManyArgs = $CreateManyArgs<$Schema, "Profile">; export type ProfileCreateManyAndReturnArgs = $CreateManyAndReturnArgs<$Schema, "Profile">; @@ -51,6 +53,7 @@ export type ProfileGetPayload; export type PostFindUniqueArgs = $FindUniqueArgs<$Schema, "Post">; export type PostFindFirstArgs = $FindFirstArgs<$Schema, "Post">; +export type PostExistsArgs = $ExistsArgs<$Schema, "Post">; export type PostCreateArgs = $CreateArgs<$Schema, "Post">; export type PostCreateManyArgs = $CreateManyArgs<$Schema, "Post">; export type PostCreateManyAndReturnArgs = $CreateManyAndReturnArgs<$Schema, "Post">; diff --git a/tests/e2e/orm/schemas/delegate/input.ts b/tests/e2e/orm/schemas/delegate/input.ts index 331448486..23eb5c08b 100644 --- a/tests/e2e/orm/schemas/delegate/input.ts +++ b/tests/e2e/orm/schemas/delegate/input.ts @@ -6,11 +6,12 @@ /* eslint-disable */ import { type SchemaType as $Schema } from "./schema"; -import type { FindManyArgs as $FindManyArgs, FindUniqueArgs as $FindUniqueArgs, FindFirstArgs as $FindFirstArgs, CreateArgs as $CreateArgs, CreateManyArgs as $CreateManyArgs, CreateManyAndReturnArgs as $CreateManyAndReturnArgs, UpdateArgs as $UpdateArgs, UpdateManyArgs as $UpdateManyArgs, UpdateManyAndReturnArgs as $UpdateManyAndReturnArgs, UpsertArgs as $UpsertArgs, DeleteArgs as $DeleteArgs, DeleteManyArgs as $DeleteManyArgs, CountArgs as $CountArgs, AggregateArgs as $AggregateArgs, GroupByArgs as $GroupByArgs, WhereInput as $WhereInput, SelectInput as $SelectInput, IncludeInput as $IncludeInput, OmitInput as $OmitInput, QueryOptions as $QueryOptions } from "@zenstackhq/orm"; +import type { FindManyArgs as $FindManyArgs, FindUniqueArgs as $FindUniqueArgs, FindFirstArgs as $FindFirstArgs, ExistsArgs as $ExistsArgs, CreateArgs as $CreateArgs, CreateManyArgs as $CreateManyArgs, CreateManyAndReturnArgs as $CreateManyAndReturnArgs, UpdateArgs as $UpdateArgs, UpdateManyArgs as $UpdateManyArgs, UpdateManyAndReturnArgs as $UpdateManyAndReturnArgs, UpsertArgs as $UpsertArgs, DeleteArgs as $DeleteArgs, DeleteManyArgs as $DeleteManyArgs, CountArgs as $CountArgs, AggregateArgs as $AggregateArgs, GroupByArgs as $GroupByArgs, WhereInput as $WhereInput, SelectInput as $SelectInput, IncludeInput as $IncludeInput, OmitInput as $OmitInput, QueryOptions as $QueryOptions } from "@zenstackhq/orm"; import type { SimplifiedPlainResult as $Result, SelectIncludeOmit as $SelectIncludeOmit } from "@zenstackhq/orm"; export type UserFindManyArgs = $FindManyArgs<$Schema, "User">; export type UserFindUniqueArgs = $FindUniqueArgs<$Schema, "User">; export type UserFindFirstArgs = $FindFirstArgs<$Schema, "User">; +export type UserExistsArgs = $ExistsArgs<$Schema, "User">; export type UserCreateArgs = $CreateArgs<$Schema, "User">; export type UserCreateManyArgs = $CreateManyArgs<$Schema, "User">; export type UserCreateManyAndReturnArgs = $CreateManyAndReturnArgs<$Schema, "User">; @@ -31,6 +32,7 @@ export type UserGetPayload; export type CommentFindUniqueArgs = $FindUniqueArgs<$Schema, "Comment">; export type CommentFindFirstArgs = $FindFirstArgs<$Schema, "Comment">; +export type CommentExistsArgs = $ExistsArgs<$Schema, "Comment">; export type CommentCreateArgs = $CreateArgs<$Schema, "Comment">; export type CommentCreateManyArgs = $CreateManyArgs<$Schema, "Comment">; export type CommentCreateManyAndReturnArgs = $CreateManyAndReturnArgs<$Schema, "Comment">; @@ -51,6 +53,7 @@ export type CommentGetPayload; export type AssetFindUniqueArgs = $FindUniqueArgs<$Schema, "Asset">; export type AssetFindFirstArgs = $FindFirstArgs<$Schema, "Asset">; +export type AssetExistsArgs = $ExistsArgs<$Schema, "Asset">; export type AssetCreateArgs = $CreateArgs<$Schema, "Asset">; export type AssetCreateManyArgs = $CreateManyArgs<$Schema, "Asset">; export type AssetCreateManyAndReturnArgs = $CreateManyAndReturnArgs<$Schema, "Asset">; @@ -71,6 +74,7 @@ export type AssetGetPayload; export type VideoFindUniqueArgs = $FindUniqueArgs<$Schema, "Video">; export type VideoFindFirstArgs = $FindFirstArgs<$Schema, "Video">; +export type VideoExistsArgs = $ExistsArgs<$Schema, "Video">; export type VideoCreateArgs = $CreateArgs<$Schema, "Video">; export type VideoCreateManyArgs = $CreateManyArgs<$Schema, "Video">; export type VideoCreateManyAndReturnArgs = $CreateManyAndReturnArgs<$Schema, "Video">; @@ -91,6 +95,7 @@ export type VideoGetPayload; export type RatedVideoFindUniqueArgs = $FindUniqueArgs<$Schema, "RatedVideo">; export type RatedVideoFindFirstArgs = $FindFirstArgs<$Schema, "RatedVideo">; +export type RatedVideoExistsArgs = $ExistsArgs<$Schema, "RatedVideo">; export type RatedVideoCreateArgs = $CreateArgs<$Schema, "RatedVideo">; export type RatedVideoCreateManyArgs = $CreateManyArgs<$Schema, "RatedVideo">; export type RatedVideoCreateManyAndReturnArgs = $CreateManyAndReturnArgs<$Schema, "RatedVideo">; @@ -111,6 +116,7 @@ export type RatedVideoGetPayload; export type ImageFindUniqueArgs = $FindUniqueArgs<$Schema, "Image">; export type ImageFindFirstArgs = $FindFirstArgs<$Schema, "Image">; +export type ImageExistsArgs = $ExistsArgs<$Schema, "Image">; export type ImageCreateArgs = $CreateArgs<$Schema, "Image">; export type ImageCreateManyArgs = $CreateManyArgs<$Schema, "Image">; export type ImageCreateManyAndReturnArgs = $CreateManyAndReturnArgs<$Schema, "Image">; @@ -131,6 +137,7 @@ export type ImageGetPayload; export type GalleryFindUniqueArgs = $FindUniqueArgs<$Schema, "Gallery">; export type GalleryFindFirstArgs = $FindFirstArgs<$Schema, "Gallery">; +export type GalleryExistsArgs = $ExistsArgs<$Schema, "Gallery">; export type GalleryCreateArgs = $CreateArgs<$Schema, "Gallery">; export type GalleryCreateManyArgs = $CreateManyArgs<$Schema, "Gallery">; export type GalleryCreateManyAndReturnArgs = $CreateManyAndReturnArgs<$Schema, "Gallery">; diff --git a/tests/e2e/orm/schemas/json/input.ts b/tests/e2e/orm/schemas/json/input.ts index 3c7c14554..74cd690b9 100644 --- a/tests/e2e/orm/schemas/json/input.ts +++ b/tests/e2e/orm/schemas/json/input.ts @@ -6,11 +6,12 @@ /* eslint-disable */ import { type SchemaType as $Schema } from "./schema"; -import type { FindManyArgs as $FindManyArgs, FindUniqueArgs as $FindUniqueArgs, FindFirstArgs as $FindFirstArgs, CreateArgs as $CreateArgs, CreateManyArgs as $CreateManyArgs, CreateManyAndReturnArgs as $CreateManyAndReturnArgs, UpdateArgs as $UpdateArgs, UpdateManyArgs as $UpdateManyArgs, UpdateManyAndReturnArgs as $UpdateManyAndReturnArgs, UpsertArgs as $UpsertArgs, DeleteArgs as $DeleteArgs, DeleteManyArgs as $DeleteManyArgs, CountArgs as $CountArgs, AggregateArgs as $AggregateArgs, GroupByArgs as $GroupByArgs, WhereInput as $WhereInput, SelectInput as $SelectInput, IncludeInput as $IncludeInput, OmitInput as $OmitInput, QueryOptions as $QueryOptions } from "@zenstackhq/orm"; +import type { FindManyArgs as $FindManyArgs, FindUniqueArgs as $FindUniqueArgs, FindFirstArgs as $FindFirstArgs, ExistsArgs as $ExistsArgs, CreateArgs as $CreateArgs, CreateManyArgs as $CreateManyArgs, CreateManyAndReturnArgs as $CreateManyAndReturnArgs, UpdateArgs as $UpdateArgs, UpdateManyArgs as $UpdateManyArgs, UpdateManyAndReturnArgs as $UpdateManyAndReturnArgs, UpsertArgs as $UpsertArgs, DeleteArgs as $DeleteArgs, DeleteManyArgs as $DeleteManyArgs, CountArgs as $CountArgs, AggregateArgs as $AggregateArgs, GroupByArgs as $GroupByArgs, WhereInput as $WhereInput, SelectInput as $SelectInput, IncludeInput as $IncludeInput, OmitInput as $OmitInput, QueryOptions as $QueryOptions } from "@zenstackhq/orm"; import type { SimplifiedPlainResult as $Result, SelectIncludeOmit as $SelectIncludeOmit } from "@zenstackhq/orm"; export type FooFindManyArgs = $FindManyArgs<$Schema, "Foo">; export type FooFindUniqueArgs = $FindUniqueArgs<$Schema, "Foo">; export type FooFindFirstArgs = $FindFirstArgs<$Schema, "Foo">; +export type FooExistsArgs = $ExistsArgs<$Schema, "Foo">; export type FooCreateArgs = $CreateArgs<$Schema, "Foo">; export type FooCreateManyArgs = $CreateManyArgs<$Schema, "Foo">; export type FooCreateManyAndReturnArgs = $CreateManyAndReturnArgs<$Schema, "Foo">; diff --git a/tests/e2e/orm/schemas/name-mapping/input.ts b/tests/e2e/orm/schemas/name-mapping/input.ts index 3799802f9..c6b620ee6 100644 --- a/tests/e2e/orm/schemas/name-mapping/input.ts +++ b/tests/e2e/orm/schemas/name-mapping/input.ts @@ -6,11 +6,12 @@ /* eslint-disable */ import { type SchemaType as $Schema } from "./schema"; -import type { FindManyArgs as $FindManyArgs, FindUniqueArgs as $FindUniqueArgs, FindFirstArgs as $FindFirstArgs, CreateArgs as $CreateArgs, CreateManyArgs as $CreateManyArgs, CreateManyAndReturnArgs as $CreateManyAndReturnArgs, UpdateArgs as $UpdateArgs, UpdateManyArgs as $UpdateManyArgs, UpdateManyAndReturnArgs as $UpdateManyAndReturnArgs, UpsertArgs as $UpsertArgs, DeleteArgs as $DeleteArgs, DeleteManyArgs as $DeleteManyArgs, CountArgs as $CountArgs, AggregateArgs as $AggregateArgs, GroupByArgs as $GroupByArgs, WhereInput as $WhereInput, SelectInput as $SelectInput, IncludeInput as $IncludeInput, OmitInput as $OmitInput, QueryOptions as $QueryOptions } from "@zenstackhq/orm"; +import type { FindManyArgs as $FindManyArgs, FindUniqueArgs as $FindUniqueArgs, FindFirstArgs as $FindFirstArgs, ExistsArgs as $ExistsArgs, CreateArgs as $CreateArgs, CreateManyArgs as $CreateManyArgs, CreateManyAndReturnArgs as $CreateManyAndReturnArgs, UpdateArgs as $UpdateArgs, UpdateManyArgs as $UpdateManyArgs, UpdateManyAndReturnArgs as $UpdateManyAndReturnArgs, UpsertArgs as $UpsertArgs, DeleteArgs as $DeleteArgs, DeleteManyArgs as $DeleteManyArgs, CountArgs as $CountArgs, AggregateArgs as $AggregateArgs, GroupByArgs as $GroupByArgs, WhereInput as $WhereInput, SelectInput as $SelectInput, IncludeInput as $IncludeInput, OmitInput as $OmitInput, QueryOptions as $QueryOptions } from "@zenstackhq/orm"; import type { SimplifiedPlainResult as $Result, SelectIncludeOmit as $SelectIncludeOmit } from "@zenstackhq/orm"; export type UserFindManyArgs = $FindManyArgs<$Schema, "User">; export type UserFindUniqueArgs = $FindUniqueArgs<$Schema, "User">; export type UserFindFirstArgs = $FindFirstArgs<$Schema, "User">; +export type UserExistsArgs = $ExistsArgs<$Schema, "User">; export type UserCreateArgs = $CreateArgs<$Schema, "User">; export type UserCreateManyArgs = $CreateManyArgs<$Schema, "User">; export type UserCreateManyAndReturnArgs = $CreateManyAndReturnArgs<$Schema, "User">; @@ -31,6 +32,7 @@ export type UserGetPayload; export type PostFindUniqueArgs = $FindUniqueArgs<$Schema, "Post">; export type PostFindFirstArgs = $FindFirstArgs<$Schema, "Post">; +export type PostExistsArgs = $ExistsArgs<$Schema, "Post">; export type PostCreateArgs = $CreateArgs<$Schema, "Post">; export type PostCreateManyArgs = $CreateManyArgs<$Schema, "Post">; export type PostCreateManyAndReturnArgs = $CreateManyAndReturnArgs<$Schema, "Post">; diff --git a/tests/e2e/orm/schemas/omit/input.ts b/tests/e2e/orm/schemas/omit/input.ts index bd73757d3..47ada0edd 100644 --- a/tests/e2e/orm/schemas/omit/input.ts +++ b/tests/e2e/orm/schemas/omit/input.ts @@ -6,11 +6,12 @@ /* eslint-disable */ import { type SchemaType as $Schema } from "./schema"; -import type { FindManyArgs as $FindManyArgs, FindUniqueArgs as $FindUniqueArgs, FindFirstArgs as $FindFirstArgs, CreateArgs as $CreateArgs, CreateManyArgs as $CreateManyArgs, CreateManyAndReturnArgs as $CreateManyAndReturnArgs, UpdateArgs as $UpdateArgs, UpdateManyArgs as $UpdateManyArgs, UpdateManyAndReturnArgs as $UpdateManyAndReturnArgs, UpsertArgs as $UpsertArgs, DeleteArgs as $DeleteArgs, DeleteManyArgs as $DeleteManyArgs, CountArgs as $CountArgs, AggregateArgs as $AggregateArgs, GroupByArgs as $GroupByArgs, WhereInput as $WhereInput, SelectInput as $SelectInput, IncludeInput as $IncludeInput, OmitInput as $OmitInput, QueryOptions as $QueryOptions } from "@zenstackhq/orm"; +import type { FindManyArgs as $FindManyArgs, FindUniqueArgs as $FindUniqueArgs, FindFirstArgs as $FindFirstArgs, ExistsArgs as $ExistsArgs, CreateArgs as $CreateArgs, CreateManyArgs as $CreateManyArgs, CreateManyAndReturnArgs as $CreateManyAndReturnArgs, UpdateArgs as $UpdateArgs, UpdateManyArgs as $UpdateManyArgs, UpdateManyAndReturnArgs as $UpdateManyAndReturnArgs, UpsertArgs as $UpsertArgs, DeleteArgs as $DeleteArgs, DeleteManyArgs as $DeleteManyArgs, CountArgs as $CountArgs, AggregateArgs as $AggregateArgs, GroupByArgs as $GroupByArgs, WhereInput as $WhereInput, SelectInput as $SelectInput, IncludeInput as $IncludeInput, OmitInput as $OmitInput, QueryOptions as $QueryOptions } from "@zenstackhq/orm"; import type { SimplifiedPlainResult as $Result, SelectIncludeOmit as $SelectIncludeOmit } from "@zenstackhq/orm"; export type UserFindManyArgs = $FindManyArgs<$Schema, "User">; export type UserFindUniqueArgs = $FindUniqueArgs<$Schema, "User">; export type UserFindFirstArgs = $FindFirstArgs<$Schema, "User">; +export type UserExistsArgs = $ExistsArgs<$Schema, "User">; export type UserCreateArgs = $CreateArgs<$Schema, "User">; export type UserCreateManyArgs = $CreateManyArgs<$Schema, "User">; export type UserCreateManyAndReturnArgs = $CreateManyAndReturnArgs<$Schema, "User">; @@ -31,6 +32,7 @@ export type UserGetPayload; export type PostFindUniqueArgs = $FindUniqueArgs<$Schema, "Post">; export type PostFindFirstArgs = $FindFirstArgs<$Schema, "Post">; +export type PostExistsArgs = $ExistsArgs<$Schema, "Post">; export type PostCreateArgs = $CreateArgs<$Schema, "Post">; export type PostCreateManyArgs = $CreateManyArgs<$Schema, "Post">; export type PostCreateManyAndReturnArgs = $CreateManyAndReturnArgs<$Schema, "Post">; @@ -51,6 +53,7 @@ export type PostGetPayload; export type BaseFindUniqueArgs = $FindUniqueArgs<$Schema, "Base">; export type BaseFindFirstArgs = $FindFirstArgs<$Schema, "Base">; +export type BaseExistsArgs = $ExistsArgs<$Schema, "Base">; export type BaseCreateArgs = $CreateArgs<$Schema, "Base">; export type BaseCreateManyArgs = $CreateManyArgs<$Schema, "Base">; export type BaseCreateManyAndReturnArgs = $CreateManyAndReturnArgs<$Schema, "Base">; @@ -71,6 +74,7 @@ export type BaseGetPayload; export type SubFindUniqueArgs = $FindUniqueArgs<$Schema, "Sub">; export type SubFindFirstArgs = $FindFirstArgs<$Schema, "Sub">; +export type SubExistsArgs = $ExistsArgs<$Schema, "Sub">; export type SubCreateArgs = $CreateArgs<$Schema, "Sub">; export type SubCreateManyArgs = $CreateManyArgs<$Schema, "Sub">; export type SubCreateManyAndReturnArgs = $CreateManyAndReturnArgs<$Schema, "Sub">; diff --git a/tests/e2e/orm/schemas/petstore/input.ts b/tests/e2e/orm/schemas/petstore/input.ts index 7beee9d5d..37afa4933 100644 --- a/tests/e2e/orm/schemas/petstore/input.ts +++ b/tests/e2e/orm/schemas/petstore/input.ts @@ -6,11 +6,12 @@ /* eslint-disable */ import { type SchemaType as $Schema } from "./schema"; -import type { FindManyArgs as $FindManyArgs, FindUniqueArgs as $FindUniqueArgs, FindFirstArgs as $FindFirstArgs, CreateArgs as $CreateArgs, CreateManyArgs as $CreateManyArgs, CreateManyAndReturnArgs as $CreateManyAndReturnArgs, UpdateArgs as $UpdateArgs, UpdateManyArgs as $UpdateManyArgs, UpdateManyAndReturnArgs as $UpdateManyAndReturnArgs, UpsertArgs as $UpsertArgs, DeleteArgs as $DeleteArgs, DeleteManyArgs as $DeleteManyArgs, CountArgs as $CountArgs, AggregateArgs as $AggregateArgs, GroupByArgs as $GroupByArgs, WhereInput as $WhereInput, SelectInput as $SelectInput, IncludeInput as $IncludeInput, OmitInput as $OmitInput, QueryOptions as $QueryOptions } from "@zenstackhq/orm"; +import type { FindManyArgs as $FindManyArgs, FindUniqueArgs as $FindUniqueArgs, FindFirstArgs as $FindFirstArgs, ExistsArgs as $ExistsArgs, CreateArgs as $CreateArgs, CreateManyArgs as $CreateManyArgs, CreateManyAndReturnArgs as $CreateManyAndReturnArgs, UpdateArgs as $UpdateArgs, UpdateManyArgs as $UpdateManyArgs, UpdateManyAndReturnArgs as $UpdateManyAndReturnArgs, UpsertArgs as $UpsertArgs, DeleteArgs as $DeleteArgs, DeleteManyArgs as $DeleteManyArgs, CountArgs as $CountArgs, AggregateArgs as $AggregateArgs, GroupByArgs as $GroupByArgs, WhereInput as $WhereInput, SelectInput as $SelectInput, IncludeInput as $IncludeInput, OmitInput as $OmitInput, QueryOptions as $QueryOptions } from "@zenstackhq/orm"; import type { SimplifiedPlainResult as $Result, SelectIncludeOmit as $SelectIncludeOmit } from "@zenstackhq/orm"; export type UserFindManyArgs = $FindManyArgs<$Schema, "User">; export type UserFindUniqueArgs = $FindUniqueArgs<$Schema, "User">; export type UserFindFirstArgs = $FindFirstArgs<$Schema, "User">; +export type UserExistsArgs = $ExistsArgs<$Schema, "User">; export type UserCreateArgs = $CreateArgs<$Schema, "User">; export type UserCreateManyArgs = $CreateManyArgs<$Schema, "User">; export type UserCreateManyAndReturnArgs = $CreateManyAndReturnArgs<$Schema, "User">; @@ -31,6 +32,7 @@ export type UserGetPayload; export type PetFindUniqueArgs = $FindUniqueArgs<$Schema, "Pet">; export type PetFindFirstArgs = $FindFirstArgs<$Schema, "Pet">; +export type PetExistsArgs = $ExistsArgs<$Schema, "Pet">; export type PetCreateArgs = $CreateArgs<$Schema, "Pet">; export type PetCreateManyArgs = $CreateManyArgs<$Schema, "Pet">; export type PetCreateManyAndReturnArgs = $CreateManyAndReturnArgs<$Schema, "Pet">; @@ -51,6 +53,7 @@ export type PetGetPayload, export type OrderFindManyArgs = $FindManyArgs<$Schema, "Order">; export type OrderFindUniqueArgs = $FindUniqueArgs<$Schema, "Order">; export type OrderFindFirstArgs = $FindFirstArgs<$Schema, "Order">; +export type OrderExistsArgs = $ExistsArgs<$Schema, "Order">; export type OrderCreateArgs = $CreateArgs<$Schema, "Order">; export type OrderCreateManyArgs = $CreateManyArgs<$Schema, "Order">; export type OrderCreateManyAndReturnArgs = $CreateManyAndReturnArgs<$Schema, "Order">; diff --git a/tests/e2e/orm/schemas/procedures/input.ts b/tests/e2e/orm/schemas/procedures/input.ts index 88a751d1c..22bdbfa73 100644 --- a/tests/e2e/orm/schemas/procedures/input.ts +++ b/tests/e2e/orm/schemas/procedures/input.ts @@ -6,11 +6,12 @@ /* eslint-disable */ import { type SchemaType as $Schema } from "./schema"; -import type { FindManyArgs as $FindManyArgs, FindUniqueArgs as $FindUniqueArgs, FindFirstArgs as $FindFirstArgs, CreateArgs as $CreateArgs, CreateManyArgs as $CreateManyArgs, CreateManyAndReturnArgs as $CreateManyAndReturnArgs, UpdateArgs as $UpdateArgs, UpdateManyArgs as $UpdateManyArgs, UpdateManyAndReturnArgs as $UpdateManyAndReturnArgs, UpsertArgs as $UpsertArgs, DeleteArgs as $DeleteArgs, DeleteManyArgs as $DeleteManyArgs, CountArgs as $CountArgs, AggregateArgs as $AggregateArgs, GroupByArgs as $GroupByArgs, WhereInput as $WhereInput, SelectInput as $SelectInput, IncludeInput as $IncludeInput, OmitInput as $OmitInput, QueryOptions as $QueryOptions } from "@zenstackhq/orm"; +import type { FindManyArgs as $FindManyArgs, FindUniqueArgs as $FindUniqueArgs, FindFirstArgs as $FindFirstArgs, ExistsArgs as $ExistsArgs, CreateArgs as $CreateArgs, CreateManyArgs as $CreateManyArgs, CreateManyAndReturnArgs as $CreateManyAndReturnArgs, UpdateArgs as $UpdateArgs, UpdateManyArgs as $UpdateManyArgs, UpdateManyAndReturnArgs as $UpdateManyAndReturnArgs, UpsertArgs as $UpsertArgs, DeleteArgs as $DeleteArgs, DeleteManyArgs as $DeleteManyArgs, CountArgs as $CountArgs, AggregateArgs as $AggregateArgs, GroupByArgs as $GroupByArgs, WhereInput as $WhereInput, SelectInput as $SelectInput, IncludeInput as $IncludeInput, OmitInput as $OmitInput, QueryOptions as $QueryOptions } from "@zenstackhq/orm"; import type { SimplifiedPlainResult as $Result, SelectIncludeOmit as $SelectIncludeOmit } from "@zenstackhq/orm"; export type UserFindManyArgs = $FindManyArgs<$Schema, "User">; export type UserFindUniqueArgs = $FindUniqueArgs<$Schema, "User">; export type UserFindFirstArgs = $FindFirstArgs<$Schema, "User">; +export type UserExistsArgs = $ExistsArgs<$Schema, "User">; export type UserCreateArgs = $CreateArgs<$Schema, "User">; export type UserCreateManyArgs = $CreateManyArgs<$Schema, "User">; export type UserCreateManyAndReturnArgs = $CreateManyAndReturnArgs<$Schema, "User">; diff --git a/tests/e2e/orm/schemas/todo/input.ts b/tests/e2e/orm/schemas/todo/input.ts index 66b1696a9..73614082d 100644 --- a/tests/e2e/orm/schemas/todo/input.ts +++ b/tests/e2e/orm/schemas/todo/input.ts @@ -6,11 +6,12 @@ /* eslint-disable */ import { type SchemaType as $Schema } from "./schema"; -import type { FindManyArgs as $FindManyArgs, FindUniqueArgs as $FindUniqueArgs, FindFirstArgs as $FindFirstArgs, CreateArgs as $CreateArgs, CreateManyArgs as $CreateManyArgs, CreateManyAndReturnArgs as $CreateManyAndReturnArgs, UpdateArgs as $UpdateArgs, UpdateManyArgs as $UpdateManyArgs, UpdateManyAndReturnArgs as $UpdateManyAndReturnArgs, UpsertArgs as $UpsertArgs, DeleteArgs as $DeleteArgs, DeleteManyArgs as $DeleteManyArgs, CountArgs as $CountArgs, AggregateArgs as $AggregateArgs, GroupByArgs as $GroupByArgs, WhereInput as $WhereInput, SelectInput as $SelectInput, IncludeInput as $IncludeInput, OmitInput as $OmitInput, QueryOptions as $QueryOptions } from "@zenstackhq/orm"; +import type { FindManyArgs as $FindManyArgs, FindUniqueArgs as $FindUniqueArgs, FindFirstArgs as $FindFirstArgs, ExistsArgs as $ExistsArgs, CreateArgs as $CreateArgs, CreateManyArgs as $CreateManyArgs, CreateManyAndReturnArgs as $CreateManyAndReturnArgs, UpdateArgs as $UpdateArgs, UpdateManyArgs as $UpdateManyArgs, UpdateManyAndReturnArgs as $UpdateManyAndReturnArgs, UpsertArgs as $UpsertArgs, DeleteArgs as $DeleteArgs, DeleteManyArgs as $DeleteManyArgs, CountArgs as $CountArgs, AggregateArgs as $AggregateArgs, GroupByArgs as $GroupByArgs, WhereInput as $WhereInput, SelectInput as $SelectInput, IncludeInput as $IncludeInput, OmitInput as $OmitInput, QueryOptions as $QueryOptions } from "@zenstackhq/orm"; import type { SimplifiedPlainResult as $Result, SelectIncludeOmit as $SelectIncludeOmit } from "@zenstackhq/orm"; export type SpaceFindManyArgs = $FindManyArgs<$Schema, "Space">; export type SpaceFindUniqueArgs = $FindUniqueArgs<$Schema, "Space">; export type SpaceFindFirstArgs = $FindFirstArgs<$Schema, "Space">; +export type SpaceExistsArgs = $ExistsArgs<$Schema, "Space">; export type SpaceCreateArgs = $CreateArgs<$Schema, "Space">; export type SpaceCreateManyArgs = $CreateManyArgs<$Schema, "Space">; export type SpaceCreateManyAndReturnArgs = $CreateManyAndReturnArgs<$Schema, "Space">; @@ -31,6 +32,7 @@ export type SpaceGetPayload; export type SpaceUserFindUniqueArgs = $FindUniqueArgs<$Schema, "SpaceUser">; export type SpaceUserFindFirstArgs = $FindFirstArgs<$Schema, "SpaceUser">; +export type SpaceUserExistsArgs = $ExistsArgs<$Schema, "SpaceUser">; export type SpaceUserCreateArgs = $CreateArgs<$Schema, "SpaceUser">; export type SpaceUserCreateManyArgs = $CreateManyArgs<$Schema, "SpaceUser">; export type SpaceUserCreateManyAndReturnArgs = $CreateManyAndReturnArgs<$Schema, "SpaceUser">; @@ -51,6 +53,7 @@ export type SpaceUserGetPayload; export type UserFindUniqueArgs = $FindUniqueArgs<$Schema, "User">; export type UserFindFirstArgs = $FindFirstArgs<$Schema, "User">; +export type UserExistsArgs = $ExistsArgs<$Schema, "User">; export type UserCreateArgs = $CreateArgs<$Schema, "User">; export type UserCreateManyArgs = $CreateManyArgs<$Schema, "User">; export type UserCreateManyAndReturnArgs = $CreateManyAndReturnArgs<$Schema, "User">; @@ -71,6 +74,7 @@ export type UserGetPayload; export type ListFindUniqueArgs = $FindUniqueArgs<$Schema, "List">; export type ListFindFirstArgs = $FindFirstArgs<$Schema, "List">; +export type ListExistsArgs = $ExistsArgs<$Schema, "List">; export type ListCreateArgs = $CreateArgs<$Schema, "List">; export type ListCreateManyArgs = $CreateManyArgs<$Schema, "List">; export type ListCreateManyAndReturnArgs = $CreateManyAndReturnArgs<$Schema, "List">; @@ -91,6 +95,7 @@ export type ListGetPayload; export type TodoFindUniqueArgs = $FindUniqueArgs<$Schema, "Todo">; export type TodoFindFirstArgs = $FindFirstArgs<$Schema, "Todo">; +export type TodoExistsArgs = $ExistsArgs<$Schema, "Todo">; export type TodoCreateArgs = $CreateArgs<$Schema, "Todo">; export type TodoCreateManyArgs = $CreateManyArgs<$Schema, "Todo">; export type TodoCreateManyAndReturnArgs = $CreateManyAndReturnArgs<$Schema, "Todo">; diff --git a/tests/e2e/orm/schemas/typed-json/input.ts b/tests/e2e/orm/schemas/typed-json/input.ts index 88a751d1c..22bdbfa73 100644 --- a/tests/e2e/orm/schemas/typed-json/input.ts +++ b/tests/e2e/orm/schemas/typed-json/input.ts @@ -6,11 +6,12 @@ /* eslint-disable */ import { type SchemaType as $Schema } from "./schema"; -import type { FindManyArgs as $FindManyArgs, FindUniqueArgs as $FindUniqueArgs, FindFirstArgs as $FindFirstArgs, CreateArgs as $CreateArgs, CreateManyArgs as $CreateManyArgs, CreateManyAndReturnArgs as $CreateManyAndReturnArgs, UpdateArgs as $UpdateArgs, UpdateManyArgs as $UpdateManyArgs, UpdateManyAndReturnArgs as $UpdateManyAndReturnArgs, UpsertArgs as $UpsertArgs, DeleteArgs as $DeleteArgs, DeleteManyArgs as $DeleteManyArgs, CountArgs as $CountArgs, AggregateArgs as $AggregateArgs, GroupByArgs as $GroupByArgs, WhereInput as $WhereInput, SelectInput as $SelectInput, IncludeInput as $IncludeInput, OmitInput as $OmitInput, QueryOptions as $QueryOptions } from "@zenstackhq/orm"; +import type { FindManyArgs as $FindManyArgs, FindUniqueArgs as $FindUniqueArgs, FindFirstArgs as $FindFirstArgs, ExistsArgs as $ExistsArgs, CreateArgs as $CreateArgs, CreateManyArgs as $CreateManyArgs, CreateManyAndReturnArgs as $CreateManyAndReturnArgs, UpdateArgs as $UpdateArgs, UpdateManyArgs as $UpdateManyArgs, UpdateManyAndReturnArgs as $UpdateManyAndReturnArgs, UpsertArgs as $UpsertArgs, DeleteArgs as $DeleteArgs, DeleteManyArgs as $DeleteManyArgs, CountArgs as $CountArgs, AggregateArgs as $AggregateArgs, GroupByArgs as $GroupByArgs, WhereInput as $WhereInput, SelectInput as $SelectInput, IncludeInput as $IncludeInput, OmitInput as $OmitInput, QueryOptions as $QueryOptions } from "@zenstackhq/orm"; import type { SimplifiedPlainResult as $Result, SelectIncludeOmit as $SelectIncludeOmit } from "@zenstackhq/orm"; export type UserFindManyArgs = $FindManyArgs<$Schema, "User">; export type UserFindUniqueArgs = $FindUniqueArgs<$Schema, "User">; export type UserFindFirstArgs = $FindFirstArgs<$Schema, "User">; +export type UserExistsArgs = $ExistsArgs<$Schema, "User">; export type UserCreateArgs = $CreateArgs<$Schema, "User">; export type UserCreateManyArgs = $CreateManyArgs<$Schema, "User">; export type UserCreateManyAndReturnArgs = $CreateManyAndReturnArgs<$Schema, "User">; diff --git a/tests/e2e/orm/schemas/typing/input.ts b/tests/e2e/orm/schemas/typing/input.ts index 5f893115f..1fa900dc1 100644 --- a/tests/e2e/orm/schemas/typing/input.ts +++ b/tests/e2e/orm/schemas/typing/input.ts @@ -6,11 +6,12 @@ /* eslint-disable */ import { type SchemaType as $Schema } from "./schema"; -import type { FindManyArgs as $FindManyArgs, FindUniqueArgs as $FindUniqueArgs, FindFirstArgs as $FindFirstArgs, CreateArgs as $CreateArgs, CreateManyArgs as $CreateManyArgs, CreateManyAndReturnArgs as $CreateManyAndReturnArgs, UpdateArgs as $UpdateArgs, UpdateManyArgs as $UpdateManyArgs, UpdateManyAndReturnArgs as $UpdateManyAndReturnArgs, UpsertArgs as $UpsertArgs, DeleteArgs as $DeleteArgs, DeleteManyArgs as $DeleteManyArgs, CountArgs as $CountArgs, AggregateArgs as $AggregateArgs, GroupByArgs as $GroupByArgs, WhereInput as $WhereInput, SelectInput as $SelectInput, IncludeInput as $IncludeInput, OmitInput as $OmitInput, QueryOptions as $QueryOptions } from "@zenstackhq/orm"; +import type { FindManyArgs as $FindManyArgs, FindUniqueArgs as $FindUniqueArgs, FindFirstArgs as $FindFirstArgs, ExistsArgs as $ExistsArgs, CreateArgs as $CreateArgs, CreateManyArgs as $CreateManyArgs, CreateManyAndReturnArgs as $CreateManyAndReturnArgs, UpdateArgs as $UpdateArgs, UpdateManyArgs as $UpdateManyArgs, UpdateManyAndReturnArgs as $UpdateManyAndReturnArgs, UpsertArgs as $UpsertArgs, DeleteArgs as $DeleteArgs, DeleteManyArgs as $DeleteManyArgs, CountArgs as $CountArgs, AggregateArgs as $AggregateArgs, GroupByArgs as $GroupByArgs, WhereInput as $WhereInput, SelectInput as $SelectInput, IncludeInput as $IncludeInput, OmitInput as $OmitInput, QueryOptions as $QueryOptions } from "@zenstackhq/orm"; import type { SimplifiedPlainResult as $Result, SelectIncludeOmit as $SelectIncludeOmit } from "@zenstackhq/orm"; export type UserFindManyArgs = $FindManyArgs<$Schema, "User">; export type UserFindUniqueArgs = $FindUniqueArgs<$Schema, "User">; export type UserFindFirstArgs = $FindFirstArgs<$Schema, "User">; +export type UserExistsArgs = $ExistsArgs<$Schema, "User">; export type UserCreateArgs = $CreateArgs<$Schema, "User">; export type UserCreateManyArgs = $CreateManyArgs<$Schema, "User">; export type UserCreateManyAndReturnArgs = $CreateManyAndReturnArgs<$Schema, "User">; @@ -31,6 +32,7 @@ export type UserGetPayload; export type PostFindUniqueArgs = $FindUniqueArgs<$Schema, "Post">; export type PostFindFirstArgs = $FindFirstArgs<$Schema, "Post">; +export type PostExistsArgs = $ExistsArgs<$Schema, "Post">; export type PostCreateArgs = $CreateArgs<$Schema, "Post">; export type PostCreateManyArgs = $CreateManyArgs<$Schema, "Post">; export type PostCreateManyAndReturnArgs = $CreateManyAndReturnArgs<$Schema, "Post">; @@ -51,6 +53,7 @@ export type PostGetPayload; export type ProfileFindUniqueArgs = $FindUniqueArgs<$Schema, "Profile">; export type ProfileFindFirstArgs = $FindFirstArgs<$Schema, "Profile">; +export type ProfileExistsArgs = $ExistsArgs<$Schema, "Profile">; export type ProfileCreateArgs = $CreateArgs<$Schema, "Profile">; export type ProfileCreateManyArgs = $CreateManyArgs<$Schema, "Profile">; export type ProfileCreateManyAndReturnArgs = $CreateManyAndReturnArgs<$Schema, "Profile">; @@ -71,6 +74,7 @@ export type ProfileGetPayload; export type TagFindUniqueArgs = $FindUniqueArgs<$Schema, "Tag">; export type TagFindFirstArgs = $FindFirstArgs<$Schema, "Tag">; +export type TagExistsArgs = $ExistsArgs<$Schema, "Tag">; export type TagCreateArgs = $CreateArgs<$Schema, "Tag">; export type TagCreateManyArgs = $CreateManyArgs<$Schema, "Tag">; export type TagCreateManyAndReturnArgs = $CreateManyAndReturnArgs<$Schema, "Tag">; @@ -91,6 +95,7 @@ export type TagGetPayload, export type RegionFindManyArgs = $FindManyArgs<$Schema, "Region">; export type RegionFindUniqueArgs = $FindUniqueArgs<$Schema, "Region">; export type RegionFindFirstArgs = $FindFirstArgs<$Schema, "Region">; +export type RegionExistsArgs = $ExistsArgs<$Schema, "Region">; export type RegionCreateArgs = $CreateArgs<$Schema, "Region">; export type RegionCreateManyArgs = $CreateManyArgs<$Schema, "Region">; export type RegionCreateManyAndReturnArgs = $CreateManyAndReturnArgs<$Schema, "Region">; @@ -111,6 +116,7 @@ export type RegionGetPayload; export type MetaFindUniqueArgs = $FindUniqueArgs<$Schema, "Meta">; export type MetaFindFirstArgs = $FindFirstArgs<$Schema, "Meta">; +export type MetaExistsArgs = $ExistsArgs<$Schema, "Meta">; export type MetaCreateArgs = $CreateArgs<$Schema, "Meta">; export type MetaCreateManyArgs = $CreateManyArgs<$Schema, "Meta">; export type MetaCreateManyAndReturnArgs = $CreateManyAndReturnArgs<$Schema, "Meta">; diff --git a/tests/regression/test/issue-204/input.ts b/tests/regression/test/issue-204/input.ts index 3c7c14554..74cd690b9 100644 --- a/tests/regression/test/issue-204/input.ts +++ b/tests/regression/test/issue-204/input.ts @@ -6,11 +6,12 @@ /* eslint-disable */ import { type SchemaType as $Schema } from "./schema"; -import type { FindManyArgs as $FindManyArgs, FindUniqueArgs as $FindUniqueArgs, FindFirstArgs as $FindFirstArgs, CreateArgs as $CreateArgs, CreateManyArgs as $CreateManyArgs, CreateManyAndReturnArgs as $CreateManyAndReturnArgs, UpdateArgs as $UpdateArgs, UpdateManyArgs as $UpdateManyArgs, UpdateManyAndReturnArgs as $UpdateManyAndReturnArgs, UpsertArgs as $UpsertArgs, DeleteArgs as $DeleteArgs, DeleteManyArgs as $DeleteManyArgs, CountArgs as $CountArgs, AggregateArgs as $AggregateArgs, GroupByArgs as $GroupByArgs, WhereInput as $WhereInput, SelectInput as $SelectInput, IncludeInput as $IncludeInput, OmitInput as $OmitInput, QueryOptions as $QueryOptions } from "@zenstackhq/orm"; +import type { FindManyArgs as $FindManyArgs, FindUniqueArgs as $FindUniqueArgs, FindFirstArgs as $FindFirstArgs, ExistsArgs as $ExistsArgs, CreateArgs as $CreateArgs, CreateManyArgs as $CreateManyArgs, CreateManyAndReturnArgs as $CreateManyAndReturnArgs, UpdateArgs as $UpdateArgs, UpdateManyArgs as $UpdateManyArgs, UpdateManyAndReturnArgs as $UpdateManyAndReturnArgs, UpsertArgs as $UpsertArgs, DeleteArgs as $DeleteArgs, DeleteManyArgs as $DeleteManyArgs, CountArgs as $CountArgs, AggregateArgs as $AggregateArgs, GroupByArgs as $GroupByArgs, WhereInput as $WhereInput, SelectInput as $SelectInput, IncludeInput as $IncludeInput, OmitInput as $OmitInput, QueryOptions as $QueryOptions } from "@zenstackhq/orm"; import type { SimplifiedPlainResult as $Result, SelectIncludeOmit as $SelectIncludeOmit } from "@zenstackhq/orm"; export type FooFindManyArgs = $FindManyArgs<$Schema, "Foo">; export type FooFindUniqueArgs = $FindUniqueArgs<$Schema, "Foo">; export type FooFindFirstArgs = $FindFirstArgs<$Schema, "Foo">; +export type FooExistsArgs = $ExistsArgs<$Schema, "Foo">; export type FooCreateArgs = $CreateArgs<$Schema, "Foo">; export type FooCreateManyArgs = $CreateManyArgs<$Schema, "Foo">; export type FooCreateManyAndReturnArgs = $CreateManyAndReturnArgs<$Schema, "Foo">; diff --git a/tests/regression/test/issue-422/input.ts b/tests/regression/test/issue-422/input.ts index b2d63acdb..2efb5ebe3 100644 --- a/tests/regression/test/issue-422/input.ts +++ b/tests/regression/test/issue-422/input.ts @@ -6,11 +6,12 @@ /* eslint-disable */ import { type SchemaType as $Schema } from "./schema"; -import type { FindManyArgs as $FindManyArgs, FindUniqueArgs as $FindUniqueArgs, FindFirstArgs as $FindFirstArgs, CreateArgs as $CreateArgs, CreateManyArgs as $CreateManyArgs, CreateManyAndReturnArgs as $CreateManyAndReturnArgs, UpdateArgs as $UpdateArgs, UpdateManyArgs as $UpdateManyArgs, UpdateManyAndReturnArgs as $UpdateManyAndReturnArgs, UpsertArgs as $UpsertArgs, DeleteArgs as $DeleteArgs, DeleteManyArgs as $DeleteManyArgs, CountArgs as $CountArgs, AggregateArgs as $AggregateArgs, GroupByArgs as $GroupByArgs, WhereInput as $WhereInput, SelectInput as $SelectInput, IncludeInput as $IncludeInput, OmitInput as $OmitInput, QueryOptions as $QueryOptions } from "@zenstackhq/orm"; +import type { FindManyArgs as $FindManyArgs, FindUniqueArgs as $FindUniqueArgs, FindFirstArgs as $FindFirstArgs, ExistsArgs as $ExistsArgs, CreateArgs as $CreateArgs, CreateManyArgs as $CreateManyArgs, CreateManyAndReturnArgs as $CreateManyAndReturnArgs, UpdateArgs as $UpdateArgs, UpdateManyArgs as $UpdateManyArgs, UpdateManyAndReturnArgs as $UpdateManyAndReturnArgs, UpsertArgs as $UpsertArgs, DeleteArgs as $DeleteArgs, DeleteManyArgs as $DeleteManyArgs, CountArgs as $CountArgs, AggregateArgs as $AggregateArgs, GroupByArgs as $GroupByArgs, WhereInput as $WhereInput, SelectInput as $SelectInput, IncludeInput as $IncludeInput, OmitInput as $OmitInput, QueryOptions as $QueryOptions } from "@zenstackhq/orm"; import type { SimplifiedPlainResult as $Result, SelectIncludeOmit as $SelectIncludeOmit } from "@zenstackhq/orm"; export type SessionFindManyArgs = $FindManyArgs<$Schema, "Session">; export type SessionFindUniqueArgs = $FindUniqueArgs<$Schema, "Session">; export type SessionFindFirstArgs = $FindFirstArgs<$Schema, "Session">; +export type SessionExistsArgs = $ExistsArgs<$Schema, "Session">; export type SessionCreateArgs = $CreateArgs<$Schema, "Session">; export type SessionCreateManyArgs = $CreateManyArgs<$Schema, "Session">; export type SessionCreateManyAndReturnArgs = $CreateManyAndReturnArgs<$Schema, "Session">; @@ -31,6 +32,7 @@ export type SessionGetPayload; export type UserFindUniqueArgs = $FindUniqueArgs<$Schema, "User">; export type UserFindFirstArgs = $FindFirstArgs<$Schema, "User">; +export type UserExistsArgs = $ExistsArgs<$Schema, "User">; export type UserCreateArgs = $CreateArgs<$Schema, "User">; export type UserCreateManyArgs = $CreateManyArgs<$Schema, "User">; export type UserCreateManyAndReturnArgs = $CreateManyAndReturnArgs<$Schema, "User">; @@ -51,6 +53,7 @@ export type UserGetPayload; export type ProfileFindUniqueArgs = $FindUniqueArgs<$Schema, "Profile">; export type ProfileFindFirstArgs = $FindFirstArgs<$Schema, "Profile">; +export type ProfileExistsArgs = $ExistsArgs<$Schema, "Profile">; export type ProfileCreateArgs = $CreateArgs<$Schema, "Profile">; export type ProfileCreateManyArgs = $CreateManyArgs<$Schema, "Profile">; export type ProfileCreateManyAndReturnArgs = $CreateManyAndReturnArgs<$Schema, "Profile">; diff --git a/tests/regression/test/issue-503/input.ts b/tests/regression/test/issue-503/input.ts index e1e5bb0da..2de93d48a 100644 --- a/tests/regression/test/issue-503/input.ts +++ b/tests/regression/test/issue-503/input.ts @@ -6,11 +6,12 @@ /* eslint-disable */ import { type SchemaType as $Schema } from "./schema"; -import type { FindManyArgs as $FindManyArgs, FindUniqueArgs as $FindUniqueArgs, FindFirstArgs as $FindFirstArgs, CreateArgs as $CreateArgs, CreateManyArgs as $CreateManyArgs, CreateManyAndReturnArgs as $CreateManyAndReturnArgs, UpdateArgs as $UpdateArgs, UpdateManyArgs as $UpdateManyArgs, UpdateManyAndReturnArgs as $UpdateManyAndReturnArgs, UpsertArgs as $UpsertArgs, DeleteArgs as $DeleteArgs, DeleteManyArgs as $DeleteManyArgs, CountArgs as $CountArgs, AggregateArgs as $AggregateArgs, GroupByArgs as $GroupByArgs, WhereInput as $WhereInput, SelectInput as $SelectInput, IncludeInput as $IncludeInput, OmitInput as $OmitInput, QueryOptions as $QueryOptions } from "@zenstackhq/orm"; +import type { FindManyArgs as $FindManyArgs, FindUniqueArgs as $FindUniqueArgs, FindFirstArgs as $FindFirstArgs, ExistsArgs as $ExistsArgs, CreateArgs as $CreateArgs, CreateManyArgs as $CreateManyArgs, CreateManyAndReturnArgs as $CreateManyAndReturnArgs, UpdateArgs as $UpdateArgs, UpdateManyArgs as $UpdateManyArgs, UpdateManyAndReturnArgs as $UpdateManyAndReturnArgs, UpsertArgs as $UpsertArgs, DeleteArgs as $DeleteArgs, DeleteManyArgs as $DeleteManyArgs, CountArgs as $CountArgs, AggregateArgs as $AggregateArgs, GroupByArgs as $GroupByArgs, WhereInput as $WhereInput, SelectInput as $SelectInput, IncludeInput as $IncludeInput, OmitInput as $OmitInput, QueryOptions as $QueryOptions } from "@zenstackhq/orm"; import type { SimplifiedPlainResult as $Result, SelectIncludeOmit as $SelectIncludeOmit } from "@zenstackhq/orm"; export type InternalChatFindManyArgs = $FindManyArgs<$Schema, "InternalChat">; export type InternalChatFindUniqueArgs = $FindUniqueArgs<$Schema, "InternalChat">; export type InternalChatFindFirstArgs = $FindFirstArgs<$Schema, "InternalChat">; +export type InternalChatExistsArgs = $ExistsArgs<$Schema, "InternalChat">; export type InternalChatCreateArgs = $CreateArgs<$Schema, "InternalChat">; export type InternalChatCreateManyArgs = $CreateManyArgs<$Schema, "InternalChat">; export type InternalChatCreateManyAndReturnArgs = $CreateManyAndReturnArgs<$Schema, "InternalChat">; @@ -31,6 +32,7 @@ export type InternalChatGetPayload; export type MessageFindUniqueArgs = $FindUniqueArgs<$Schema, "Message">; export type MessageFindFirstArgs = $FindFirstArgs<$Schema, "Message">; +export type MessageExistsArgs = $ExistsArgs<$Schema, "Message">; export type MessageCreateArgs = $CreateArgs<$Schema, "Message">; export type MessageCreateManyArgs = $CreateManyArgs<$Schema, "Message">; export type MessageCreateManyAndReturnArgs = $CreateManyAndReturnArgs<$Schema, "Message">; @@ -51,6 +53,7 @@ export type MessageGetPayload; export type MediaFindUniqueArgs = $FindUniqueArgs<$Schema, "Media">; export type MediaFindFirstArgs = $FindFirstArgs<$Schema, "Media">; +export type MediaExistsArgs = $ExistsArgs<$Schema, "Media">; export type MediaCreateArgs = $CreateArgs<$Schema, "Media">; export type MediaCreateManyArgs = $CreateManyArgs<$Schema, "Media">; export type MediaCreateManyAndReturnArgs = $CreateManyAndReturnArgs<$Schema, "Media">; diff --git a/tests/runtimes/bun/schemas/input.ts b/tests/runtimes/bun/schemas/input.ts index 3799802f9..c6b620ee6 100644 --- a/tests/runtimes/bun/schemas/input.ts +++ b/tests/runtimes/bun/schemas/input.ts @@ -6,11 +6,12 @@ /* eslint-disable */ import { type SchemaType as $Schema } from "./schema"; -import type { FindManyArgs as $FindManyArgs, FindUniqueArgs as $FindUniqueArgs, FindFirstArgs as $FindFirstArgs, CreateArgs as $CreateArgs, CreateManyArgs as $CreateManyArgs, CreateManyAndReturnArgs as $CreateManyAndReturnArgs, UpdateArgs as $UpdateArgs, UpdateManyArgs as $UpdateManyArgs, UpdateManyAndReturnArgs as $UpdateManyAndReturnArgs, UpsertArgs as $UpsertArgs, DeleteArgs as $DeleteArgs, DeleteManyArgs as $DeleteManyArgs, CountArgs as $CountArgs, AggregateArgs as $AggregateArgs, GroupByArgs as $GroupByArgs, WhereInput as $WhereInput, SelectInput as $SelectInput, IncludeInput as $IncludeInput, OmitInput as $OmitInput, QueryOptions as $QueryOptions } from "@zenstackhq/orm"; +import type { FindManyArgs as $FindManyArgs, FindUniqueArgs as $FindUniqueArgs, FindFirstArgs as $FindFirstArgs, ExistsArgs as $ExistsArgs, CreateArgs as $CreateArgs, CreateManyArgs as $CreateManyArgs, CreateManyAndReturnArgs as $CreateManyAndReturnArgs, UpdateArgs as $UpdateArgs, UpdateManyArgs as $UpdateManyArgs, UpdateManyAndReturnArgs as $UpdateManyAndReturnArgs, UpsertArgs as $UpsertArgs, DeleteArgs as $DeleteArgs, DeleteManyArgs as $DeleteManyArgs, CountArgs as $CountArgs, AggregateArgs as $AggregateArgs, GroupByArgs as $GroupByArgs, WhereInput as $WhereInput, SelectInput as $SelectInput, IncludeInput as $IncludeInput, OmitInput as $OmitInput, QueryOptions as $QueryOptions } from "@zenstackhq/orm"; import type { SimplifiedPlainResult as $Result, SelectIncludeOmit as $SelectIncludeOmit } from "@zenstackhq/orm"; export type UserFindManyArgs = $FindManyArgs<$Schema, "User">; export type UserFindUniqueArgs = $FindUniqueArgs<$Schema, "User">; export type UserFindFirstArgs = $FindFirstArgs<$Schema, "User">; +export type UserExistsArgs = $ExistsArgs<$Schema, "User">; export type UserCreateArgs = $CreateArgs<$Schema, "User">; export type UserCreateManyArgs = $CreateManyArgs<$Schema, "User">; export type UserCreateManyAndReturnArgs = $CreateManyAndReturnArgs<$Schema, "User">; @@ -31,6 +32,7 @@ export type UserGetPayload; export type PostFindUniqueArgs = $FindUniqueArgs<$Schema, "Post">; export type PostFindFirstArgs = $FindFirstArgs<$Schema, "Post">; +export type PostExistsArgs = $ExistsArgs<$Schema, "Post">; export type PostCreateArgs = $CreateArgs<$Schema, "Post">; export type PostCreateManyArgs = $CreateManyArgs<$Schema, "Post">; export type PostCreateManyAndReturnArgs = $CreateManyAndReturnArgs<$Schema, "Post">; diff --git a/tests/runtimes/edge-runtime/schemas/input.ts b/tests/runtimes/edge-runtime/schemas/input.ts index 3799802f9..c6b620ee6 100644 --- a/tests/runtimes/edge-runtime/schemas/input.ts +++ b/tests/runtimes/edge-runtime/schemas/input.ts @@ -6,11 +6,12 @@ /* eslint-disable */ import { type SchemaType as $Schema } from "./schema"; -import type { FindManyArgs as $FindManyArgs, FindUniqueArgs as $FindUniqueArgs, FindFirstArgs as $FindFirstArgs, CreateArgs as $CreateArgs, CreateManyArgs as $CreateManyArgs, CreateManyAndReturnArgs as $CreateManyAndReturnArgs, UpdateArgs as $UpdateArgs, UpdateManyArgs as $UpdateManyArgs, UpdateManyAndReturnArgs as $UpdateManyAndReturnArgs, UpsertArgs as $UpsertArgs, DeleteArgs as $DeleteArgs, DeleteManyArgs as $DeleteManyArgs, CountArgs as $CountArgs, AggregateArgs as $AggregateArgs, GroupByArgs as $GroupByArgs, WhereInput as $WhereInput, SelectInput as $SelectInput, IncludeInput as $IncludeInput, OmitInput as $OmitInput, QueryOptions as $QueryOptions } from "@zenstackhq/orm"; +import type { FindManyArgs as $FindManyArgs, FindUniqueArgs as $FindUniqueArgs, FindFirstArgs as $FindFirstArgs, ExistsArgs as $ExistsArgs, CreateArgs as $CreateArgs, CreateManyArgs as $CreateManyArgs, CreateManyAndReturnArgs as $CreateManyAndReturnArgs, UpdateArgs as $UpdateArgs, UpdateManyArgs as $UpdateManyArgs, UpdateManyAndReturnArgs as $UpdateManyAndReturnArgs, UpsertArgs as $UpsertArgs, DeleteArgs as $DeleteArgs, DeleteManyArgs as $DeleteManyArgs, CountArgs as $CountArgs, AggregateArgs as $AggregateArgs, GroupByArgs as $GroupByArgs, WhereInput as $WhereInput, SelectInput as $SelectInput, IncludeInput as $IncludeInput, OmitInput as $OmitInput, QueryOptions as $QueryOptions } from "@zenstackhq/orm"; import type { SimplifiedPlainResult as $Result, SelectIncludeOmit as $SelectIncludeOmit } from "@zenstackhq/orm"; export type UserFindManyArgs = $FindManyArgs<$Schema, "User">; export type UserFindUniqueArgs = $FindUniqueArgs<$Schema, "User">; export type UserFindFirstArgs = $FindFirstArgs<$Schema, "User">; +export type UserExistsArgs = $ExistsArgs<$Schema, "User">; export type UserCreateArgs = $CreateArgs<$Schema, "User">; export type UserCreateManyArgs = $CreateManyArgs<$Schema, "User">; export type UserCreateManyAndReturnArgs = $CreateManyAndReturnArgs<$Schema, "User">; @@ -31,6 +32,7 @@ export type UserGetPayload; export type PostFindUniqueArgs = $FindUniqueArgs<$Schema, "Post">; export type PostFindFirstArgs = $FindFirstArgs<$Schema, "Post">; +export type PostExistsArgs = $ExistsArgs<$Schema, "Post">; export type PostCreateArgs = $CreateArgs<$Schema, "Post">; export type PostCreateManyArgs = $CreateManyArgs<$Schema, "Post">; export type PostCreateManyAndReturnArgs = $CreateManyAndReturnArgs<$Schema, "Post">;