diff --git a/packages/orm/src/client/zod/factory.ts b/packages/orm/src/client/zod/factory.ts index 0f8b22701..8967c3061 100644 --- a/packages/orm/src/client/zod/factory.ts +++ b/packages/orm/src/client/zod/factory.ts @@ -1,4 +1,4 @@ -import { enumerate, invariant, lowerCaseFirst } from '@zenstackhq/common-helpers'; +import { enumerate, invariant, lowerCaseFirst, upperCaseFirst } from '@zenstackhq/common-helpers'; import { ZodUtils } from '@zenstackhq/zod'; import Decimal from 'decimal.js'; import { match, P } from 'ts-pattern'; @@ -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,79 @@ 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 all procedures. + for (const procName of Object.keys(this.schema.procedures ?? {})) { + this.makeProcedureArgsSchema(procName); + } + return z.toJSONSchema(this.schemaRegistry, { unrepresentable: 'any' }); } get cacheStats() { @@ -240,6 +302,7 @@ export class ZodSchemaFactory< if (!unique) { result = result.optional(); } + this.registerSchema(`${model}${upperCaseFirst(operation)}Args`, result); return result; } @@ -251,9 +314,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 +359,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 +370,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 +404,7 @@ export class ZodSchemaFactory< } }); + this.registerSchema(type, finalSchema); return finalSchema; } @@ -380,21 +448,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 +472,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 +526,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 +595,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 +652,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 +674,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 +685,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 +721,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 +786,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 +863,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 +892,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 +916,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 +945,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 +982,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 +1037,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 +1075,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 +1086,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 +1115,8 @@ export class ZodSchemaFactory< }), ]) .optional(); + this.registerSchema(`${model}CountSelection`, schema); + return schema; } else { return z.never(); } @@ -1053,7 +1165,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 +1187,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 +1230,9 @@ export class ZodSchemaFactory< } } - return z.strictObject(fields); + const result = z.strictObject(fields); + this.registerSchema(`${model}Include`, result); + return result; } @cache() @@ -1135,19 +1253,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 +1295,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 +1310,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 +1342,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 +1351,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 +1370,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 +1498,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 +1666,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 +1696,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 +1705,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 +1713,8 @@ export class ZodSchemaFactory< }), 'updateMany', ) as unknown as ZodType>; + this.registerSchema(`${model}UpdateManyArgs`, result); + return result; } @cache() @@ -1582,6 +1730,7 @@ export class ZodSchemaFactory< }); schema = this.refineForSelectOmitMutuallyExclusive(schema); schema = this.refineForSelectHasTruthyField(schema); + this.registerSchema(`${model}UpdateManyAndReturnArgs`, schema); return schema as ZodType>; } @@ -1602,6 +1751,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 +1874,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 +1902,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 +1911,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 +1931,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 +1941,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 +1960,8 @@ export class ZodSchemaFactory< ), }), ]); + this.registerSchema(`${model}CountAggregateInput`, schema); + return schema; } // #endregion @@ -1813,8 +1972,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 +1986,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 +2004,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 +2021,8 @@ export class ZodSchemaFactory< {} as Record, ), ); + this.registerSchema(`${model}MinMaxAggregateInput`, schema); + return schema; } // #endregion @@ -1936,6 +2101,7 @@ export class ZodSchemaFactory< return true; }, 'fields in "orderBy" must be in "by"'); + this.registerSchema(`${model}GroupByArgs`, schema); return schema as ZodType>; } @@ -1956,15 +2122,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 }, 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/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..95f8c3080 --- /dev/null +++ b/packages/server/src/api/rpc/openapi.ts @@ -0,0 +1,744 @@ +import { lowerCaseFirst, upperCaseFirst } from '@zenstackhq/common-helpers'; +import { CoreCrudOperations, createQuerySchemaFactory, ZodSchemaFactory } from '@zenstackhq/orm'; +import type { BuiltinType, 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'] = { + 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 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 { + ...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 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..b2dde79e9 --- /dev/null +++ b/packages/server/test/openapi/baseline/rpc.baseline.yaml @@ -0,0 +1,14904 @@ +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: + 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..b5dd65293 --- /dev/null +++ b/packages/server/test/openapi/rpc-openapi.test.ts @@ -0,0 +1,1077 @@ +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'); + }); +}); + +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(); + 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('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(); + }); +}); + +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/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);