@zenstackhq/orm 3.9.7 → 3.10.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.d.mts CHANGED
@@ -1,9 +1,10 @@
1
1
  import { AnyNull, AnyNullClass, DbNull, DbNullClass, JsonArray, JsonNull, JsonNullClass, JsonNullValues, JsonObject, JsonValue } from "./common-types.mjs";
2
+ import { a as CoreCreateOperations, c as CoreReadOperations, d as FilterPropertyToKind, f as LOGICAL_COMBINATORS, i as AllWriteOperations, l as CoreUpdateOperations, n as AllCrudOperations, o as CoreCrudOperations, p as TRANSACTION_UNSUPPORTED_METHODS, r as AllReadOperations, s as CoreDeleteOperations, t as AggregateOperators, u as CoreWriteOperations } from "./constants-RUWhnVl4.mjs";
2
3
  import * as _$kysely from "kysely";
3
- import { AddColumnNode, AddConstraintNode, AddIndexNode, AddValueNode, AggregateFunctionNode, AliasNode, AliasableExpression, AlterColumnNode, AlterTableNode, AlterTypeNode, AndNode, BinaryOperationNode, CaseNode, CastNode, CheckConstraintNode, CollateNode, ColumnDefinitionNode, ColumnNode, ColumnUpdateNode, CommonTableExpressionNameNode, CommonTableExpressionNode, CreateIndexNode, CreateSchemaNode, CreateTableNode, CreateTypeNode, CreateViewNode, DataTypeNode, DefaultInsertValueNode, DefaultValueNode, DeleteQueryNode, Dialect, DropColumnNode, DropConstraintNode, DropIndexNode, DropSchemaNode, DropTableNode, DropTypeNode, DropViewNode, ExplainNode, Expression, ExpressionBuilder, ExpressionWrapper, FetchNode, ForeignKeyConstraintNode, FromNode, FunctionNode, Generated, GeneratedNode, GroupByItemNode, GroupByNode, HavingNode, IdentifierNode, InsertQueryNode, JSONOperatorChainNode, JSONPathLegNode, JSONPathNode, JSONReferenceNode, JoinNode, Kysely, KyselyConfig, LimitNode, ListNode, MatchedNode, MergeQueryNode, ModifyColumnNode, OffsetNode, OnConflictNode, OnDuplicateKeyNode, OnNode, OperandExpression, OperationNode, OperationNodeVisitor, OperatorNode, OrActionNode, OrNode, OrderByItemNode, OrderByNode, OutputNode, OverNode, ParensNode, PartitionByItemNode, PartitionByNode, PrimaryKeyConstraintNode, PrimitiveValueListNode, QueryId, QueryResult, RawNode, ReferenceNode, ReferencesNode, RefreshMaterializedViewNode, RenameColumnNode, RenameConstraintNode, RenameValueNode, ReturningNode, RootOperationNode, SchemableIdentifierNode, SelectAllNode, SelectModifierNode, SelectQueryBuilder, SelectQueryNode, SelectionNode, SetOperationNode, SqlBool, TableNode, TopNode, TupleNode, UnaryOperationNode, UniqueConstraintNode, UnknownRow, UpdateQueryNode, UsingNode, ValueListNode, ValueNode, ValuesNode, WhenNode, WhereNode, WithNode } from "kysely";
4
- import { ZodType, z as z$1 } from "zod";
4
+ import { AddColumnNode, AddConstraintNode, AddIndexNode, AddValueNode, AggregateFunctionNode, AliasNode, AliasableExpression, AlterColumnNode, AlterTableNode, AlterTypeNode, AndNode, BinaryOperationNode, CaseNode, CastNode, CheckConstraintNode, CollateNode, ColumnDefinitionNode, ColumnNode, ColumnUpdateNode, CommonTableExpressionNameNode, CommonTableExpressionNode, CreateIndexNode, CreateSchemaNode, CreateTableNode, CreateTypeNode, CreateViewNode, DataTypeNode, DefaultInsertValueNode, DefaultValueNode, DeleteQueryNode, Dialect, DropColumnNode, DropConstraintNode, DropIndexNode, DropSchemaNode, DropTableNode, DropTypeNode, DropViewNode, ExplainNode, Expression, ExpressionBuilder, ExpressionWrapper, FetchNode, ForeignKeyConstraintNode, FromNode, FunctionNode, Generated, GeneratedNode, GroupByItemNode, GroupByNode, HavingNode, IdentifierNode, InsertQueryNode, JSONOperatorChainNode, JSONPathLegNode, JSONPathNode, JSONReferenceNode, JoinNode, Kysely, KyselyConfig, LimitNode, ListNode, MatchedNode, MergeQueryNode, ModifyColumnNode, OffsetNode, OnConflictNode, OnDuplicateKeyNode, OnNode, OperandExpression, OperationNode, OperationNodeVisitor, OperatorNode, OrActionNode, OrNode, OrderByItemNode, OrderByNode, OutputNode, OverNode, ParensNode, PartitionByItemNode, PartitionByNode, PrimaryKeyConstraintNode, PrimitiveValueListNode, QueryId, QueryResult, RawNode, ReferenceNode, ReferencesNode, RefreshMaterializedViewNode, RenameColumnNode, RenameConstraintNode, RenameValueNode, ReturningNode, RootOperationNode, SchemableIdentifierNode, SelectAllNode, SelectModifierNode, SelectQueryBuilder, SelectQueryNode, Selectable, SelectionNode, SetOperationNode, SqlBool, TableNode, TopNode, TupleNode, UnaryOperationNode, UniqueConstraintNode, UnknownRow, UpdateQueryNode, UsingNode, ValueListNode, ValueNode, ValuesNode, WhenNode, WhereNode, WithNode } from "kysely";
5
+ import { ZodType, z } from "zod";
5
6
  import * as _$_zenstackhq_schema0 from "@zenstackhq/schema";
6
- import { ArrayExpression, BinaryExpression, BindingExpression, BuiltinType, CallExpression, DataSourceProviderType, EnumDef, Expression as Expression$1, FieldDef, FieldExpression, FieldHasDefault, FieldIsArray, FieldIsDelegateDiscriminator, FieldIsRelation, FieldType, ForeignKeyFields, GetEnum, GetEnums, GetModel, GetModelDelegateMapValue, GetModelDiscriminator, GetModelField, GetModelFieldType, GetModelFields, GetModels, GetSubModels, GetTypeDefField, GetTypeDefFieldType, GetTypeDefFields, GetTypeDefs, IsDelegateModel, LiteralExpression, MemberExpression, ModelDef, ModelFieldIsOptional, NonRelationFields, NullExpression, ProcedureDef, RelationFieldType, RelationFields, RelationInfo, ScalarFields, SchemaDef, ThisExpression, TypeDefDef, TypeDefFieldIsArray, TypeDefFieldIsOptional, UnaryExpression, UpdatedAtInfo } from "@zenstackhq/schema";
7
+ import { ArrayExpression, BinaryExpression, BindingExpression, BuiltinType, CallExpression, DataSourceProviderType, EnumDef, Expression as Expression$1, FieldDef, FieldExpression, FieldHasDefault, FieldIsArray, FieldIsDelegateDiscriminator, FieldIsRelation, FieldType, ForeignKeyFields, GetEnum, GetEnums, GetModel, GetModelDelegateMapValue, GetModelDiscriminator, GetModelField, GetModelFieldType, GetModelFields, GetModels, GetSubModels, GetTypeDef, GetTypeDefField, GetTypeDefFieldType, GetTypeDefFields, GetTypeDefs, IsDelegateModel, LiteralExpression, MemberExpression, ModelDef, ModelFieldIsOptional, NonRelationFields, NullExpression, ProcedureDef, RelationFieldType, RelationFields, RelationInfo, ScalarFields, SchemaDef, ThisExpression, TypeDefDef, TypeDefFieldIsArray, TypeDefFieldIsOptional, TypeDefIsPrimitive, UnaryExpression, UpdatedAtInfo } from "@zenstackhq/schema";
7
8
  import Decimal from "decimal.js";
8
9
 
9
10
  //#region src/utils/kysely-utils.d.ts
@@ -162,61 +163,6 @@ type _NoExtraObject<T extends object, Shape, Keys extends PropertyKey = _ObjectK
162
163
  */
163
164
  type NoExtraProperties<T, Shape> = unknown extends Shape ? unknown : T extends _ExactLeaf ? T : T extends readonly (infer Item)[] ? [_ArrayItem<Shape>] extends [never] ? never : NoExtraProperties<Item, _ArrayItem<Shape>>[] : T extends object ? _NoExtraObject<T, Shape> : T;
164
165
  //#endregion
165
- //#region src/client/constants.d.ts
166
- /**
167
- * Client API methods that are not supported in transactions.
168
- */
169
- declare const TRANSACTION_UNSUPPORTED_METHODS: readonly ["$transaction", "$connect", "$disconnect", "$use"];
170
- /**
171
- * Logical combinators used in filters.
172
- */
173
- declare const LOGICAL_COMBINATORS: readonly ["AND", "OR", "NOT"];
174
- /**
175
- * Aggregation operators.
176
- */
177
- declare const AggregateOperators: readonly ["_count", "_sum", "_avg", "_min", "_max"];
178
- type AggregateOperators = (typeof AggregateOperators)[number];
179
- /**
180
- * Mapping of filter operators to their corresponding filter kind categories.
181
- */
182
- declare const FILTER_PROPERTY_TO_KIND: {
183
- readonly equals: "Equality";
184
- readonly not: "Equality";
185
- readonly in: "Equality";
186
- readonly notIn: "Equality";
187
- readonly lt: "Range";
188
- readonly lte: "Range";
189
- readonly gt: "Range";
190
- readonly gte: "Range";
191
- readonly between: "Range";
192
- readonly contains: "Like";
193
- readonly startsWith: "Like";
194
- readonly endsWith: "Like";
195
- readonly mode: "Like";
196
- readonly is: "Relation";
197
- readonly isNot: "Relation";
198
- readonly some: "Relation";
199
- readonly every: "Relation";
200
- readonly none: "Relation";
201
- readonly path: "Json";
202
- readonly string_contains: "Json";
203
- readonly string_starts_with: "Json";
204
- readonly string_ends_with: "Json";
205
- readonly array_contains: "Json";
206
- readonly array_starts_with: "Json";
207
- readonly array_ends_with: "Json";
208
- readonly fuzzy: "Fuzzy";
209
- readonly fts: "FullText";
210
- readonly has: "List";
211
- readonly hasEvery: "List";
212
- readonly hasSome: "List";
213
- readonly isEmpty: "List";
214
- };
215
- /**
216
- * Mapping of filter operators to their corresponding filter kind categories.
217
- */
218
- type FilterPropertyToKind = typeof FILTER_PROPERTY_TO_KIND;
219
- //#endregion
220
166
  //#region src/client/query-builder.d.ts
221
167
  type ToKyselySchema<Schema extends SchemaDef> = { [Model in GetModels<Schema>]: ToKyselyTable<Schema, Model> };
222
168
  type ToKysely<Schema extends SchemaDef> = Kysely<ToKyselySchema<Schema>>;
@@ -416,7 +362,8 @@ type OnQueryHookContext<Schema extends SchemaDef> = {
416
362
  */
417
363
  client: ClientContract<Schema>;
418
364
  };
419
- type EntityMutationHooksDef<Schema extends SchemaDef> = {
365
+ type EntityMutationHooksDef<Schema extends SchemaDef> = { [M in '$all' | GetModels<Schema>]?: M extends '$all' ? AllEntityMutationHooksDef<Schema> : ModelEntityMutationHooksDef<Schema, M & GetModels<Schema>> };
366
+ type AllEntityMutationHooksDef<Schema extends SchemaDef> = {
420
367
  /**
421
368
  * Called before entities are mutated.
422
369
  */
@@ -487,12 +434,45 @@ type PluginAfterEntityMutationArgs<Schema extends SchemaDef> = MutationHooksArgs
487
434
  beforeMutationEntities?: Record<string, unknown>[];
488
435
  /**
489
436
  * The ZenStack client you can use to perform additional operations.
490
- * See {@link EntityMutationHooksDef.runAfterMutationWithinTransaction} for detailed transaction behavior.
437
+ * See {@link AllEntityMutationHooksDef.runAfterMutationWithinTransaction} for detailed transaction behavior.
491
438
  *
492
439
  * Mutations initiated from this client will NOT trigger entity mutation hooks to avoid infinite loops.
493
440
  */
494
441
  client: ClientContract<Schema>;
495
442
  };
443
+ /**
444
+ * The shape of an entity passed to per-model entity mutation hooks. Entities are
445
+ * loaded directly from the database table (the same way as `$qb` query results),
446
+ * so they contain only physical columns (no relations, no computed fields, and no
447
+ * fields inherited from a delegate base model), and values are in the form returned
448
+ * by the database driver, not post-processed by the ORM.
449
+ *
450
+ * For models using delegate inheritance (`@@delegate`), a mutation fires one event
451
+ * per physical table written, keyed by that table's model. E.g., creating a sub-model
452
+ * entity fires a base-model event followed by a sub-model event; updating only
453
+ * inherited fields fires only a base-model event; deleting a sub-model entity fires
454
+ * only a base-model event (the sub-model row is removed by cascade). Base-model
455
+ * entities carry the discriminator field, which can be used to identify the concrete
456
+ * sub-model. To observe all mutations of a sub-model, register hooks on its base model
457
+ * (or use `$all`).
458
+ */
459
+ type MutationHookEntity<Schema extends SchemaDef, Model extends GetModels<Schema>> = Selectable<ToKyselySchema<Schema>[Model]>;
460
+ type PluginModelBeforeEntityMutationArgs<Schema extends SchemaDef, Model extends GetModels<Schema>> = Omit<MutationHooksArgs<Schema>, 'model'> & {
461
+ model: Model;
462
+ loadBeforeMutationEntities(): Promise<MutationHookEntity<Schema, Model>[] | undefined>;
463
+ client: ClientContract<Schema>;
464
+ };
465
+ type PluginModelAfterEntityMutationArgs<Schema extends SchemaDef, Model extends GetModels<Schema>> = Omit<MutationHooksArgs<Schema>, 'model'> & {
466
+ model: Model;
467
+ loadAfterMutationEntities(): Promise<MutationHookEntity<Schema, Model>[] | undefined>;
468
+ beforeMutationEntities?: MutationHookEntity<Schema, Model>[];
469
+ client: ClientContract<Schema>;
470
+ };
471
+ type ModelEntityMutationHooksDef<Schema extends SchemaDef, Model extends GetModels<Schema>> = {
472
+ beforeEntityMutation?: (args: PluginModelBeforeEntityMutationArgs<Schema, Model>) => MaybePromise<void>;
473
+ afterEntityMutation?: (args: PluginModelAfterEntityMutationArgs<Schema, Model>) => MaybePromise<void>;
474
+ runAfterMutationWithinTransaction?: boolean;
475
+ };
496
476
  type OnKyselyQueryArgs<Schema extends SchemaDef> = {
497
477
  schema: SchemaDef;
498
478
  client: ClientContract<Schema>;
@@ -883,7 +863,19 @@ declare abstract class BaseCrudDialect<Schema extends SchemaDef> {
883
863
  shouldOmitField(omit: unknown, model: string, field: string): any;
884
864
  protected buildModelSelect(model: GetModels<Schema>, subQueryAlias: string, payload: true | FindArgs<Schema, GetModels<Schema>, any, true>, selectAllFields: boolean): SelectQueryBuilder<any, any, {}>;
885
865
  buildSelectField(query: SelectQueryBuilder<any, any, any>, model: string, modelAlias: string, field: string, computedArgs?: unknown): SelectQueryBuilder<any, any, any>;
886
- buildDelegateJoin(thisModel: string, thisModelAlias: string, otherModelAlias: string, query: SelectQueryBuilder<any, any, any>): SelectQueryBuilder<any, any, any>;
866
+ buildDelegateJoin(thisModel: string, thisModelAlias: string, otherModel: string, query: SelectQueryBuilder<any, any, any>): SelectQueryBuilder<any, any, any>;
867
+ /**
868
+ * Gets the alias under which a delegate base or sub model is joined to a model selected as `modelAlias`.
869
+ * A model selected under its own name (a top-level query) has them joined under their own model names.
870
+ * A model selected under another alias (a relation subquery) has them joined under aliases derived from
871
+ * it, so they never shadow a table of an enclosing query in the same delegate hierarchy.
872
+ */
873
+ delegateJoinAlias(model: string, modelAlias: string, joinedModel: string): string;
874
+ /**
875
+ * Gets the alias of the table holding a field of a model selected as `modelAlias`: the joined base
876
+ * table for a field inherited from a delegate base, otherwise the model's own table.
877
+ */
878
+ delegateFieldAlias(model: string, modelAlias: string, fieldDef: FieldDef): string;
887
879
  buildCountJson(model: string, eb: ExpressionBuilder<any, any>, parentAlias: string, payload: any): AliasableExpression<unknown>;
888
880
  protected negateSort(sort: SortOrder, negated: boolean): SortOrder;
889
881
  true(): Expression<SqlBool>;
@@ -1043,80 +1035,6 @@ declare class InputValidator<Schema extends SchemaDef> {
1043
1035
  private validate;
1044
1036
  }
1045
1037
  //#endregion
1046
- //#region src/client/crud/operations/base.d.ts
1047
- /**
1048
- * List of core CRUD operations. It excludes the 'orThrow' variants.
1049
- */
1050
- declare const CoreCrudOperations: readonly ["findMany", "findUnique", "findFirst", "create", "createMany", "createManyAndReturn", "update", "updateMany", "updateManyAndReturn", "upsert", "delete", "deleteMany", "count", "aggregate", "groupBy", "exists"];
1051
- /**
1052
- * List of core CRUD operations. It excludes the 'orThrow' variants.
1053
- */
1054
- type CoreCrudOperations = (typeof CoreCrudOperations)[number];
1055
- /**
1056
- * List of core read operations. It excludes the 'orThrow' variants.
1057
- */
1058
- declare const CoreReadOperations: readonly ["findMany", "findUnique", "findFirst", "count", "aggregate", "groupBy", "exists"];
1059
- /**
1060
- * List of core read operations. It excludes the 'orThrow' variants.
1061
- */
1062
- type CoreReadOperations = (typeof CoreReadOperations)[number];
1063
- /**
1064
- * List of core write operations.
1065
- */
1066
- declare const CoreWriteOperations: readonly ["create", "createMany", "createManyAndReturn", "update", "updateMany", "updateManyAndReturn", "upsert", "delete", "deleteMany"];
1067
- /**
1068
- * List of core write operations.
1069
- */
1070
- type CoreWriteOperations = (typeof CoreWriteOperations)[number];
1071
- /**
1072
- * List of core create operations.
1073
- */
1074
- declare const CoreCreateOperations: readonly ["create", "createMany", "createManyAndReturn", "upsert"];
1075
- /**
1076
- * List of core create operations.
1077
- */
1078
- type CoreCreateOperations = (typeof CoreCreateOperations)[number];
1079
- /**
1080
- * List of core update operations.
1081
- */
1082
- declare const CoreUpdateOperations: readonly ["update", "updateMany", "updateManyAndReturn", "upsert"];
1083
- /**
1084
- * List of core update operations.
1085
- */
1086
- type CoreUpdateOperations = (typeof CoreUpdateOperations)[number];
1087
- /**
1088
- * List of core delete operations.
1089
- */
1090
- declare const CoreDeleteOperations: readonly ["delete", "deleteMany"];
1091
- /**
1092
- * List of core delete operations.
1093
- */
1094
- type CoreDeleteOperations = (typeof CoreDeleteOperations)[number];
1095
- /**
1096
- * List of all CRUD operations, including 'orThrow' variants.
1097
- */
1098
- declare const AllCrudOperations: readonly ["findMany", "findUnique", "findFirst", "create", "createMany", "createManyAndReturn", "update", "updateMany", "updateManyAndReturn", "upsert", "delete", "deleteMany", "count", "aggregate", "groupBy", "exists", "findUniqueOrThrow", "findFirstOrThrow"];
1099
- /**
1100
- * List of all CRUD operations, including 'orThrow' variants.
1101
- */
1102
- type AllCrudOperations = (typeof AllCrudOperations)[number];
1103
- /**
1104
- * List of all read operations, including 'orThrow' variants.
1105
- */
1106
- declare const AllReadOperations: readonly ["findMany", "findUnique", "findFirst", "count", "aggregate", "groupBy", "exists", "findUniqueOrThrow", "findFirstOrThrow"];
1107
- /**
1108
- * List of all read operations, including 'orThrow' variants.
1109
- */
1110
- type AllReadOperations = (typeof AllReadOperations)[number];
1111
- /**
1112
- * List of all write operations - simply an alias of CoreWriteOperations.
1113
- */
1114
- declare const AllWriteOperations: readonly ["create", "createMany", "createManyAndReturn", "update", "updateMany", "updateManyAndReturn", "upsert", "delete", "deleteMany"];
1115
- /**
1116
- * List of all write operations - simply an alias of CoreWriteOperations.
1117
- */
1118
- type AllWriteOperations = CoreWriteOperations;
1119
- //#endregion
1120
1038
  //#region src/client/type-utils.d.ts
1121
1039
  /**
1122
1040
  * Checks if a model has any required Unsupported fields (non-optional, no default).
@@ -1223,22 +1141,35 @@ DefaultModelResult<Schema, Model, O, Options, false, false> & { [Key in keyof I
1223
1141
  } & Record<string, unknown> ? DefaultModelResult<Schema, Model, O, Options, false, false> : DefaultModelResult<Schema, Model, undefined, Options, false, false>) & SelectAwareExtResult<ExtResult, Model & string, Args>, Optional, Array>;
1224
1142
  type SimplifiedResult<Schema extends SchemaDef, Model extends GetModels<Schema>, Args = {}, Options extends QueryOptions<Schema> = QueryOptions<Schema>, Optional = false, Array = false, ExtResult extends ExtResultBase<Schema> = {}> = Simplify<ModelResult<Schema, Model, Args, Options, Optional, Array, ExtResult>>;
1225
1143
  type SimplifiedPlainResult<Schema extends SchemaDef, Model extends GetModels<Schema>, Args = {}, Options extends QueryOptions<Schema> = QueryOptions<Schema>, ExtResult extends ExtResultBase<Schema> = {}> = Simplify<ModelResult<Schema, Model, Args, Options, false, false, ExtResult>>;
1226
- type TypeDefResult<Schema extends SchemaDef, TypeDef extends GetTypeDefs<Schema>, Partial extends boolean = false> = PartialIf<Optional<{ [Key in GetTypeDefFields<Schema, TypeDef>]: MapFieldDefType<Schema, GetTypeDefField<Schema, TypeDef, Key>, Partial> }, Partial extends true ? never : keyof { [Key in GetTypeDefFields<Schema, TypeDef> as TypeDefFieldIsOptional<Schema, TypeDef, Key> extends true ? Key : never]: true }>, Partial> & (IsTypeDefStrict<Schema, TypeDef> extends true ? {} : Record<string, unknown>);
1144
+ type TypeDefResult<Schema extends SchemaDef, TypeDef extends GetTypeDefs<Schema>, Partial extends boolean = false> = Schema['typeDefs'] extends Record<string, unknown> ? Schema['typeDefs'][TypeDef]['base'] extends string ? TypeMap[Schema['typeDefs'][TypeDef]['base']] : PartialIf<Optional<{ [Key in GetTypeDefFields<Schema, TypeDef>]: MapFieldDefType<Schema, GetTypeDefField<Schema, TypeDef, Key>, Partial> }, Partial extends true ? never : keyof { [Key in GetTypeDefFields<Schema, TypeDef> as TypeDefFieldIsOptional<Schema, TypeDef, Key> extends true ? Key : never]: true }>, Partial> & (IsTypeDefStrict<Schema, TypeDef> extends true ? {} : Record<string, unknown>) : never;
1227
1145
  type IsTypeDefStrict<Schema extends SchemaDef, TypeDef extends GetTypeDefs<Schema>> = Schema['typeDefs'] extends Record<string, unknown> ? Schema['typeDefs'][TypeDef]['strict'] extends true ? true : false : never;
1228
1146
  type BatchResult = {
1229
1147
  count: number;
1230
1148
  };
1149
+ /**
1150
+ * Context object passed to `$expr` filters.
1151
+ */
1152
+ type ExprFilterContext<Schema extends SchemaDef, Model extends GetModels<Schema>> = {
1153
+ /**
1154
+ * The alias that can be used to refer to the filtered model. It's the model name for top-level
1155
+ * filters, but relation filters select the model under a generated alias.
1156
+ *
1157
+ * Typed as the model name to match the expression builder's scope, so qualified references
1158
+ * like `` eb.ref(`${modelAlias}.field`) `` type-check.
1159
+ */
1160
+ modelAlias: Model;
1161
+ };
1231
1162
  type WhereInput<Schema extends SchemaDef, Model extends GetModels<Schema>, Options extends QueryOptions<Schema> = QueryOptions<Schema>, ScalarOnly extends boolean = false, WithAggregations extends boolean = false> = { [Key in GetModelFields<Schema, Model> as ScalarOnly extends true ? Key extends RelationFields<Schema, Model> ? never : Key : Key]?: FieldHasComputedArgs<Schema, Model, Key> extends true ? // a parameterized computed field carries its query-time `args` alongside the filter
1232
1163
  {
1233
1164
  args: ComputedFieldArgs<Schema, Model, Key>;
1234
1165
  } & FieldFilter<Schema, Model, Key, Options, WithAggregations> : FieldFilter<Schema, Model, Key, Options, WithAggregations> } & {
1235
- $expr?: (eb: ExpressionBuilder<ToKyselySchema<Schema>, Model>) => OperandExpression<SqlBool>;
1166
+ $expr?: (eb: ExpressionBuilder<ToKyselySchema<Schema>, Model>, context: ExprFilterContext<Schema, Model>) => OperandExpression<SqlBool>;
1236
1167
  } & {
1237
1168
  AND?: OrArray<WhereInput<Schema, Model, Options, ScalarOnly>>;
1238
1169
  OR?: WhereInput<Schema, Model, Options, ScalarOnly>[];
1239
1170
  NOT?: OrArray<WhereInput<Schema, Model, Options, ScalarOnly>>;
1240
1171
  };
1241
- type FieldFilter<Schema extends SchemaDef, Model extends GetModels<Schema>, Field extends GetModelFields<Schema, Model>, Options extends QueryOptions<Schema>, WithAggregations extends boolean, AllowedKinds extends FilterKind = GetSlicedFilterKindsForField<Schema, Model, Field, Options>> = Field extends RelationFields<Schema, Model> ? RelationFilter<Schema, Model, Field, Options, AllowedKinds> : FieldIsArray<Schema, Model, Field> extends true ? ArrayFilter<Schema, GetModelFieldType<Schema, Model, Field>, AllowedKinds> : GetModelFieldType<Schema, Model, Field> extends GetEnums<Schema> ? EnumFilter<Schema, GetModelFieldType<Schema, Model, Field>, ModelFieldIsOptional<Schema, Model, Field>, WithAggregations, AllowedKinds> : GetModelFieldType<Schema, Model, Field> extends GetTypeDefs<Schema> ? TypedJsonFilter<Schema, GetModelFieldType<Schema, Model, Field>, FieldIsArray<Schema, Model, Field>, ModelFieldIsOptional<Schema, Model, Field>, AllowedKinds> : GetModelFieldType<Schema, Model, Field> extends 'String' ? AddFullTextFilterIfSupported<Schema, Model, Field, AllowedKinds, AddFuzzyFilterIfSupported<Schema, Model, Field, AllowedKinds, PrimitiveFilter<GetModelFieldType<Schema, Model, Field>, ModelFieldIsOptional<Schema, Model, Field>, WithAggregations, AllowedKinds>>> : PrimitiveFilter<GetModelFieldType<Schema, Model, Field>, ModelFieldIsOptional<Schema, Model, Field>, WithAggregations, AllowedKinds>;
1172
+ type FieldFilter<Schema extends SchemaDef, Model extends GetModels<Schema>, Field extends GetModelFields<Schema, Model>, Options extends QueryOptions<Schema>, WithAggregations extends boolean, AllowedKinds extends FilterKind = GetSlicedFilterKindsForField<Schema, Model, Field, Options>> = Field extends RelationFields<Schema, Model> ? RelationFilter<Schema, Model, Field, Options, AllowedKinds> : FieldIsArray<Schema, Model, Field> extends true ? ArrayFilter<Schema, GetModelFieldType<Schema, Model, Field>, AllowedKinds> : GetModelFieldType<Schema, Model, Field> extends GetEnums<Schema> ? EnumFilter<Schema, GetModelFieldType<Schema, Model, Field>, ModelFieldIsOptional<Schema, Model, Field>, WithAggregations, AllowedKinds> : GetModelFieldType<Schema, Model, Field> extends GetTypeDefs<Schema> ? TypeDefIsPrimitive<Schema, GetModelFieldType<Schema, Model, Field>> extends true ? PrimitiveFilter<TypeDefBaseType<Schema, GetModelFieldType<Schema, Model, Field>>, ModelFieldIsOptional<Schema, Model, Field>, WithAggregations, AllowedKinds> : TypedJsonFilter<Schema, GetModelFieldType<Schema, Model, Field>, FieldIsArray<Schema, Model, Field>, ModelFieldIsOptional<Schema, Model, Field>, AllowedKinds> : GetModelFieldType<Schema, Model, Field> extends 'String' ? AddFullTextFilterIfSupported<Schema, Model, Field, AllowedKinds, AddFuzzyFilterIfSupported<Schema, Model, Field, AllowedKinds, PrimitiveFilter<GetModelFieldType<Schema, Model, Field>, ModelFieldIsOptional<Schema, Model, Field>, WithAggregations, AllowedKinds>>> : PrimitiveFilter<GetModelFieldType<Schema, Model, Field>, ModelFieldIsOptional<Schema, Model, Field>, WithAggregations, AllowedKinds>;
1242
1173
  /**
1243
1174
  * Conditionally augments a string-field filter with the `fuzzy` operator when:
1244
1175
  * 1. The `Fuzzy` filter kind is allowed for this field, AND
@@ -1330,7 +1261,8 @@ type ArrayFilter<Schema extends SchemaDef, Type extends string, AllowedKinds ext
1330
1261
  */
1331
1262
  isEmpty?: boolean;
1332
1263
  } : {});
1333
- type MapScalarType<Schema extends SchemaDef, Type extends string> = Type extends GetEnums<Schema> ? keyof GetEnum<Schema, Type> : MapBaseType$1<Type>;
1264
+ type TypeDefBaseType<Schema extends SchemaDef, TypeDef extends GetTypeDefs<Schema>> = GetTypeDef<Schema, TypeDef>['base'] extends infer B extends string ? B : never;
1265
+ type MapScalarType<Schema extends SchemaDef, Type extends string> = Type extends GetEnums<Schema> ? keyof GetEnum<Schema, Type> : Type extends GetTypeDefs<Schema> ? TypeDefIsPrimitive<Schema, Type> extends true ? MapBaseType$1<TypeDefBaseType<Schema, Type>> : MapBaseType$1<Type> : MapBaseType$1<Type>;
1334
1266
  type PrimitiveFilter<T extends string, Nullable extends boolean, WithAggregations extends boolean, AllowedKinds extends FilterKind> = T extends 'String' ? StringFilter<Nullable, WithAggregations, AllowedKinds> : T extends 'Int' | 'Float' | 'Decimal' | 'BigInt' ? NumberFilter<T, Nullable, WithAggregations, AllowedKinds> : T extends 'Boolean' ? BooleanFilter<Nullable, WithAggregations, AllowedKinds> : T extends 'DateTime' ? DateTimeFilter<Nullable, WithAggregations, AllowedKinds> : T extends 'Bytes' ? BytesFilter<Nullable, WithAggregations, AllowedKinds> : T extends 'Json' ? JsonFilter<AllowedKinds> : never;
1335
1267
  type CommonPrimitiveFilter<DataType, T extends BuiltinType, Nullable extends boolean, WithAggregations extends boolean, AllowedKinds extends FilterKind> = ('Equality' extends AllowedKinds ? {
1336
1268
  /**
@@ -1549,7 +1481,7 @@ type NonArrayTypedJsonFilter<Schema extends SchemaDef, TypeDefName extends GetTy
1549
1481
  is?: TypedJsonFieldsFilter<Schema, TypeDefName, AllowedKinds>;
1550
1482
  isNot?: TypedJsonFieldsFilter<Schema, TypeDefName, AllowedKinds>;
1551
1483
  } | TypedJsonFieldsFilter<Schema, TypeDefName, AllowedKinds>;
1552
- type TypedJsonFieldsFilter<Schema extends SchemaDef, TypeDefName extends GetTypeDefs<Schema>, AllowedKinds extends FilterKind> = { [Key in GetTypeDefFields<Schema, TypeDefName>]?: GetTypeDefFieldType<Schema, TypeDefName, Key> extends GetTypeDefs<Schema> ? TypedJsonFilter<Schema, GetTypeDefFieldType<Schema, TypeDefName, Key>, TypeDefFieldIsArray<Schema, TypeDefName, Key>, TypeDefFieldIsOptional<Schema, TypeDefName, Key>, AllowedKinds> : TypeDefFieldIsArray<Schema, TypeDefName, Key> extends true ? ArrayFilter<Schema, GetTypeDefFieldType<Schema, TypeDefName, Key>, AllowedKinds> : GetTypeDefFieldType<Schema, TypeDefName, Key> extends GetEnums<Schema> ? EnumFilter<Schema, GetTypeDefFieldType<Schema, TypeDefName, Key>, TypeDefFieldIsOptional<Schema, TypeDefName, Key>, false, AllowedKinds> : PrimitiveFilter<GetTypeDefFieldType<Schema, TypeDefName, Key>, TypeDefFieldIsOptional<Schema, TypeDefName, Key>, false, AllowedKinds> };
1484
+ type TypedJsonFieldsFilter<Schema extends SchemaDef, TypeDefName extends GetTypeDefs<Schema>, AllowedKinds extends FilterKind> = { [Key in GetTypeDefFields<Schema, TypeDefName>]?: GetTypeDefFieldType<Schema, TypeDefName, Key> extends GetTypeDefs<Schema> ? TypeDefIsPrimitive<Schema, GetTypeDefFieldType<Schema, TypeDefName, Key>> extends true ? TypeDefFieldIsArray<Schema, TypeDefName, Key> extends true ? ArrayFilter<Schema, GetTypeDefFieldType<Schema, TypeDefName, Key>, AllowedKinds> : PrimitiveFilter<TypeDefBaseType<Schema, GetTypeDefFieldType<Schema, TypeDefName, Key>>, TypeDefFieldIsOptional<Schema, TypeDefName, Key>, false, AllowedKinds> : TypedJsonFilter<Schema, GetTypeDefFieldType<Schema, TypeDefName, Key>, TypeDefFieldIsArray<Schema, TypeDefName, Key>, TypeDefFieldIsOptional<Schema, TypeDefName, Key>, AllowedKinds> : TypeDefFieldIsArray<Schema, TypeDefName, Key> extends true ? ArrayFilter<Schema, GetTypeDefFieldType<Schema, TypeDefName, Key>, AllowedKinds> : GetTypeDefFieldType<Schema, TypeDefName, Key> extends GetEnums<Schema> ? EnumFilter<Schema, GetTypeDefFieldType<Schema, TypeDefName, Key>, TypeDefFieldIsOptional<Schema, TypeDefName, Key>, false, AllowedKinds> : PrimitiveFilter<GetTypeDefFieldType<Schema, TypeDefName, Key>, TypeDefFieldIsOptional<Schema, TypeDefName, Key>, false, AllowedKinds> };
1553
1485
  type SortOrder = 'asc' | 'desc';
1554
1486
  type NullsOrder = 'first' | 'last';
1555
1487
  type StringFields<Schema extends SchemaDef, Model extends GetModels<Schema>> = { [Key in NonRelationFields<Schema, Model>]: MapModelFieldType<Schema, Model, Key> extends string | null ? Key : never }[NonRelationFields<Schema, Model>];
@@ -1816,7 +1748,7 @@ type ToOneRelationFilter<Schema extends SchemaDef, Model extends GetModels<Schem
1816
1748
  }, ModelFieldIsOptional<Schema, Model, Field>>;
1817
1749
  type RelationFilter<Schema extends SchemaDef, Model extends GetModels<Schema>, Field extends RelationFields<Schema, Model>, Options extends QueryOptions<Schema>, AllowedKinds extends FilterKind> = 'Relation' extends AllowedKinds ? FieldIsArray<Schema, Model, Field> extends true ? ToManyRelationFilter<Schema, Model, Field, Options> : ToOneRelationFilter<Schema, Model, Field, Options> : never;
1818
1750
  type MapModelFieldType<Schema extends SchemaDef, Model extends GetModels<Schema>, Field extends GetModelFields<Schema, Model>> = MapFieldDefType<Schema, GetModelField<Schema, Model, Field>>;
1819
- type MapFieldDefType<Schema extends SchemaDef, T extends Pick<FieldDef, 'type' | 'optional' | 'array'>, Partial extends boolean = false> = WrapType<T['type'] extends GetEnums<Schema> ? keyof GetEnum<Schema, T['type']> : T['type'] extends GetTypeDefs<Schema> ? TypeDefResult<Schema, T['type'], Partial> & (IsTypeDefStrict<Schema, T['type']> extends true ? {} : Record<string, unknown>) : MapBaseType$1<T['type']>, T['optional'], T['array']>;
1751
+ type MapFieldDefType<Schema extends SchemaDef, T extends Pick<FieldDef, 'type' | 'optional' | 'array'>, Partial extends boolean = false> = WrapType<T['type'] extends GetEnums<Schema> ? keyof GetEnum<Schema, T['type']> : T['type'] extends GetTypeDefs<Schema> ? TypeDefIsPrimitive<Schema, T['type']> extends true ? TypeDefResult<Schema, T['type']> : TypeDefResult<Schema, T['type'], Partial> & (IsTypeDefStrict<Schema, T['type']> extends true ? {} : Record<string, unknown>) : MapBaseType$1<T['type']>, T['optional'], T['array']>;
1820
1752
  type OptionalFieldsForCreate<Schema extends SchemaDef, Model extends GetModels<Schema>> = keyof { [Key in GetModelFields<Schema, Model> as ModelFieldIsOptional<Schema, Model, Key> extends true ? Key : FieldHasDefault<Schema, Model, Key> extends true ? Key : FieldIsArray<Schema, Model, Key> extends true ? Key : GetModelField<Schema, Model, Key>['updatedAt'] extends true | UpdatedAtInfo ? Key : never]: GetModelField<Schema, Model, Key> };
1821
1753
  type GetRelation<Schema extends SchemaDef, Model extends GetModels<Schema>, Field extends GetModelFields<Schema, Model>> = GetModelField<Schema, Model, Field>['relation'];
1822
1754
  type OppositeRelation<Schema extends SchemaDef, Model extends GetModels<Schema>, Field extends GetModelFields<Schema, Model>, FT = FieldType<Schema, Model, Field>> = FT extends GetModels<Schema> ? GetRelation<Schema, Model, Field> extends RelationInfo ? GetRelation<Schema, Model, Field>['opposite'] extends GetModelFields<Schema, FT> ? Schema['models'][FT]['fields'][GetRelation<Schema, Model, Field>['opposite']]['relation'] : never : never : never;
@@ -3348,7 +3280,7 @@ declare class ZodSchemaFactory<in out Schema extends SchemaDef, in out Options e
3348
3280
  * before serialization.
3349
3281
  */
3350
3282
  toJSONSchema(): {
3351
- schemas: Record<string, z$1.core.JSONSchema.BaseSchema>;
3283
+ schemas: Record<string, z.core.JSONSchema.BaseSchema>;
3352
3284
  };
3353
3285
  get cacheStats(): {
3354
3286
  size: number;
@@ -3364,11 +3296,17 @@ declare class ZodSchemaFactory<in out Schema extends SchemaDef, in out Options e
3364
3296
  private makeFieldArgsSchema;
3365
3297
  private addComputedArgsToFilter;
3366
3298
  private makeEnumSchema;
3299
+ /**
3300
+ * Attributes to validate each value of a scalar field against. For typedef list fields, the
3301
+ * field's own attributes (e.g. `@length`) validate the list rather than its items.
3302
+ */
3303
+ private getItemAttributes;
3367
3304
  private makeTypeDefSchema;
3368
3305
  makeWhereSchema(model: string, unique: boolean, withoutRelationFields?: boolean, withAggregations?: boolean, options?: CreateSchemaOptions): ZodType;
3369
3306
  private makeTypedJsonFilterSchema;
3370
3307
  private makeNullableTypedJsonMutationSchema;
3371
3308
  private isTypeDefType;
3309
+ private getEffectiveFieldType;
3372
3310
  private makeEnumFilterSchema;
3373
3311
  private makeArrayFilterSchema;
3374
3312
  private internalMakeArrayFilterSchema;
@@ -3566,7 +3504,7 @@ declare class ORMError extends Error {
3566
3504
  sqlParams?: readonly unknown[];
3567
3505
  }
3568
3506
  declare namespace query_utils_d_exports {
3569
- export { ManyToManyJoinTableEndpoints, TEMP_ALIAS_PREFIX, aggregate, buildJoinPairs, ensureArray, extractFieldName, extractIdFields, extractModelName, fieldHasDefaultValue, flattenCompoundUniqueFilters, getDelegateDescendantModels, getDelegateDiscriminatorValue, getDiscriminatorField, getEnum, getField, getIdFields, getIdValues, getManyToManyJoinTable, getManyToManyRelation, getModel, getModelFields, getRelationForeignKeyFieldPairs, getTypeDef, getUniqueFields, hasModel, isEnum, isForeignKeyField, isInheritedField, isRelationField, isScalarField, isTypeDef, isUnsupportedField, makeDefaultOrderBy, requireField, requireIdFields, requireModel, requireTypeDef, schemaHasMappedNames, stripAlias, tmpAlias };
3507
+ export { ManyToManyJoinTableEndpoints, TEMP_ALIAS_PREFIX, aggregate, buildJoinPairs, ensureArray, extractFieldName, extractIdFields, extractModelName, fieldHasDefaultValue, flattenCompoundUniqueFilters, getDelegateDescendantModels, getDelegateDiscriminatorValue, getDiscriminatorField, getEnum, getField, getIdFields, getIdValues, getManyToManyJoinTable, getManyToManyRelation, getModel, getModelFields, getRelationForeignKeyFieldPairs, getTypeDef, getUniqueFields, hasModel, isEnum, isForeignKeyField, isInheritedField, isPrimitiveTypeDef, isRelationField, isScalarField, isTypeDef, isUnsupportedField, makeDefaultOrderBy, requireField, requireIdFields, requireModel, requireTypeDef, schemaHasMappedNames, stripAlias, tmpAlias };
3570
3508
  }
3571
3509
  declare function hasModel(schema: SchemaDef, model: string): boolean;
3572
3510
  declare function getModel(schema: SchemaDef, model: string): ModelDef | undefined;
@@ -3619,6 +3557,7 @@ declare function fieldHasDefaultValue(fieldDef: FieldDef): boolean | _$_zenstack
3619
3557
  declare function isEnum(schema: SchemaDef, type: string): boolean;
3620
3558
  declare function getEnum(schema: SchemaDef, type: string): EnumDef | undefined;
3621
3559
  declare function isTypeDef(schema: SchemaDef, type: string): boolean;
3560
+ declare function isPrimitiveTypeDef(schema: SchemaDef, type: string): boolean;
3622
3561
  declare function buildJoinPairs(schema: SchemaDef, model: string, modelAlias: string, relationField: string, relationModelAlias: string): [string, string][];
3623
3562
  declare function makeDefaultOrderBy(schema: SchemaDef, model: string): {
3624
3563
  readonly [x: string]: "asc";
@@ -3712,5 +3651,5 @@ declare class MatchingExpressionVisitor extends ExpressionVisitor {
3712
3651
  };
3713
3652
  }
3714
3653
  //#endregion
3715
- export { AfterEntityMutationCallback, AggregateArgs, AggregateResult, AllCrudOperations, AllModelOperations, AllReadOperations, AllWriteOperations, AnyNull, AnyNullClass, AnyPlugin, AuthType, BaseCrudDialect, BatchResult, BeforeEntityMutationCallback, BooleanFilter, BytesFilter, CRUD, CRUD_EXT, CheckedCreateInput, CheckedUpdateInput, ClientConstructor, ClientContract, ClientOptions, ComputedFieldArgs, ComputedFieldContext, ComputedFieldsOptions, CoreCreateOperations, CoreCrudOperations, CoreDeleteOperations, CoreReadOperations, CoreUpdateOperations, CoreWriteOperations, CountArgs, CountResult, CreateArgs, CreateInput, CreateManyAndReturnArgs, CreateManyArgs, CreateManyInput, CrudArgsMap, CrudArgsType, CrudReturnMap, CrudReturnType, DateTimeFilter, DbNull, DbNullClass, DefaultModelResult, DeleteArgs, DeleteManyArgs, EntityMutationHooksDef, ExistsArgs, ExtClientMembersBase, ExtQueryArgsBase, ExtQueryArgsMarker, ExtResultBase, ExtResultInferenceArgs, ExtResultMarker, ExtResultSelectOmitFields, ExtractExtResult, FieldHasComputedArgs, FilterKind, FindArgs, FindFirstArgs, FindManyArgs, FindUniqueArgs, FtsRelevanceOrderBy, FullTextFilterPayload, FuzzyFilterPayload, FuzzyRelevanceOrderBy, GetAllIncludedOperations, GetIncludedOperations, GetProcedure, GetProcedureNames, GetProcedureParams, GetQueryOptions, GetSlicedFilterKindsForField, GetSlicedModels, GetSlicedOperations, GetSlicedProcedures, GroupByArgs, GroupByResult, HasComputedFields, HasProcedures, IncludeInput, InputValidator, IsTypeDefStrict, JsonArray, JsonFilter, JsonNull, JsonNullClass, JsonNullValues, JsonObject, JsonValue, kysely_utils_d_exports as KyselyUtils, MapModelFieldType, ModelAllowsCreate, ModelHasRequiredUnsupportedField, ModelOperations, ModelResult, ModelSlicingOptions, NonParamComputedNonRelationFields, NullsOrder, NumberFilter, ORMError, ORMErrorReason, OmitConfig, OmitInput, OnKyselyQueryArgs, OnKyselyQueryCallback, OnProcedureHookContext, OperationsRequiringCreate, OrderBy, PluginAfterEntityMutationArgs, PluginBeforeEntityMutationArgs, ProcedureEnvelope, ProcedureFunc, ProcedureHandlerFunc, ProcedureOperations, ProceduresOptions, ProceedKyselyQueryFunction, QueryOptions, QueryRelevantOptions, query_utils_d_exports as QueryUtils, RejectedByPolicyReason, RuntimePlugin, schema_utils_d_exports as SchemaUtils, SelectAwareExtResult, SelectIncludeOmit, SelectInput, SelectSubset, SimplifiedPlainResult, SimplifiedResult, SlicingOptions, SortOrder, StringFilter, Subset, type ToKysely, TransactionClientContract, TransactionIsolationLevel, TypeDefResult, TypedJsonFilter, UncheckedCreateInput, UncheckedUpdateInput, UpdateArgs, UpdateInput, UpdateManyAndReturnArgs, UpdateManyArgs, UpsertArgs, WhereInput, WhereUniqueInput, ZModelFunction, ZModelFunctionContext, ZenStackClient, type ZenStackPromise, type ZodSchemaFactory, createQuerySchemaFactory, definePlugin, getCrudDialect };
3654
+ export { AfterEntityMutationCallback, AggregateArgs, AggregateResult, AllCrudOperations, AllEntityMutationHooksDef, AllModelOperations, AllReadOperations, AllWriteOperations, AnyNull, AnyNullClass, AnyPlugin, AuthType, BaseCrudDialect, BatchResult, BeforeEntityMutationCallback, BooleanFilter, BytesFilter, CRUD, CRUD_EXT, CheckedCreateInput, CheckedUpdateInput, ClientConstructor, ClientContract, ClientOptions, ComputedFieldArgs, ComputedFieldContext, ComputedFieldsOptions, CoreCreateOperations, CoreCrudOperations, CoreDeleteOperations, CoreReadOperations, CoreUpdateOperations, CoreWriteOperations, CountArgs, CountResult, CreateArgs, CreateInput, CreateManyAndReturnArgs, CreateManyArgs, CreateManyInput, CrudArgsMap, CrudArgsType, CrudReturnMap, CrudReturnType, DateTimeFilter, DbNull, DbNullClass, DefaultModelResult, DeleteArgs, DeleteManyArgs, EntityMutationHooksDef, ExistsArgs, ExprFilterContext, ExtClientMembersBase, ExtQueryArgsBase, ExtQueryArgsMarker, ExtResultBase, ExtResultInferenceArgs, ExtResultMarker, ExtResultSelectOmitFields, ExtractExtResult, FieldHasComputedArgs, FilterKind, FindArgs, FindFirstArgs, FindManyArgs, FindUniqueArgs, FtsRelevanceOrderBy, FullTextFilterPayload, FuzzyFilterPayload, FuzzyRelevanceOrderBy, GetAllIncludedOperations, GetIncludedOperations, GetProcedure, GetProcedureNames, GetProcedureParams, GetQueryOptions, GetSlicedFilterKindsForField, GetSlicedModels, GetSlicedOperations, GetSlicedProcedures, GroupByArgs, GroupByResult, HasComputedFields, HasProcedures, IncludeInput, InputValidator, IsTypeDefStrict, JsonArray, JsonFilter, JsonNull, JsonNullClass, JsonNullValues, JsonObject, JsonValue, kysely_utils_d_exports as KyselyUtils, MapModelFieldType, ModelAllowsCreate, ModelEntityMutationHooksDef, ModelHasRequiredUnsupportedField, ModelOperations, ModelResult, ModelSlicingOptions, MutationHookEntity, NonParamComputedNonRelationFields, NullsOrder, NumberFilter, ORMError, ORMErrorReason, OmitConfig, OmitInput, OnKyselyQueryArgs, OnKyselyQueryCallback, OnProcedureHookContext, OperationsRequiringCreate, OrderBy, PluginAfterEntityMutationArgs, PluginBeforeEntityMutationArgs, PluginModelAfterEntityMutationArgs, PluginModelBeforeEntityMutationArgs, ProcedureEnvelope, ProcedureFunc, ProcedureHandlerFunc, ProcedureOperations, ProceduresOptions, ProceedKyselyQueryFunction, QueryOptions, QueryRelevantOptions, query_utils_d_exports as QueryUtils, RejectedByPolicyReason, RuntimePlugin, schema_utils_d_exports as SchemaUtils, SelectAwareExtResult, SelectIncludeOmit, SelectInput, SelectSubset, SimplifiedPlainResult, SimplifiedResult, SlicingOptions, SortOrder, StringFilter, Subset, type ToKysely, TransactionClientContract, TransactionIsolationLevel, TypeDefResult, TypedJsonFilter, UncheckedCreateInput, UncheckedUpdateInput, UpdateArgs, UpdateInput, UpdateManyAndReturnArgs, UpdateManyArgs, UpsertArgs, WhereInput, WhereUniqueInput, ZModelFunction, ZModelFunctionContext, ZenStackClient, type ZenStackPromise, type ZodSchemaFactory, createQuerySchemaFactory, definePlugin, getCrudDialect };
3716
3655
  //# sourceMappingURL=index.d.mts.map