@zenstackhq/orm 3.1.0 → 3.1.1
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.cjs +8 -3
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +8 -3
- package/dist/index.js.map +1 -1
- package/package.json +6 -6
package/dist/index.js
CHANGED
|
@@ -4482,8 +4482,11 @@ var InputValidator = class {
|
|
|
4482
4482
|
fieldSchema
|
|
4483
4483
|
];
|
|
4484
4484
|
})));
|
|
4485
|
-
const finalSchema = z3.
|
|
4486
|
-
|
|
4485
|
+
const finalSchema = z3.any().superRefine((value, ctx) => {
|
|
4486
|
+
const parseResult = schema.safeParse(value);
|
|
4487
|
+
if (!parseResult.success) {
|
|
4488
|
+
parseResult.error.issues.forEach((issue) => ctx.addIssue(issue));
|
|
4489
|
+
}
|
|
4487
4490
|
});
|
|
4488
4491
|
this.setSchemaCache(key, finalSchema);
|
|
4489
4492
|
return finalSchema;
|
|
@@ -4561,7 +4564,9 @@ var InputValidator = class {
|
|
|
4561
4564
|
}
|
|
4562
4565
|
}
|
|
4563
4566
|
}
|
|
4564
|
-
fields["$expr"] = z3.custom((v) => typeof v === "function"
|
|
4567
|
+
fields["$expr"] = z3.custom((v) => typeof v === "function", {
|
|
4568
|
+
error: '"$expr" must be a function'
|
|
4569
|
+
}).optional();
|
|
4565
4570
|
fields["AND"] = this.orArray(z3.lazy(() => this.makeWhereSchema(model, false, withoutRelationFields)), true).optional();
|
|
4566
4571
|
fields["OR"] = z3.lazy(() => this.makeWhereSchema(model, false, withoutRelationFields)).array().optional();
|
|
4567
4572
|
fields["NOT"] = this.orArray(z3.lazy(() => this.makeWhereSchema(model, false, withoutRelationFields)), true).optional();
|