prisma-guard 1.13.0 → 1.14.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/generator/index.js +4 -2
- package/dist/generator/index.js.map +1 -1
- package/dist/runtime/index.cjs +11 -12
- package/dist/runtime/index.cjs.map +1 -1
- package/dist/runtime/index.d.cts +1 -0
- package/dist/runtime/index.d.ts +1 -0
- package/dist/runtime/index.js +11 -12
- package/dist/runtime/index.js.map +1 -1
- package/package.json +1 -1
package/dist/runtime/index.d.cts
CHANGED
package/dist/runtime/index.d.ts
CHANGED
package/dist/runtime/index.js
CHANGED
|
@@ -198,7 +198,9 @@ function getSupportedOperators(fieldMeta) {
|
|
|
198
198
|
}
|
|
199
199
|
function createBaseType(fieldMeta, enumMap, scalarBase) {
|
|
200
200
|
let base;
|
|
201
|
-
if (fieldMeta.
|
|
201
|
+
if (fieldMeta.isUnsupported) {
|
|
202
|
+
base = z2.unknown();
|
|
203
|
+
} else if (fieldMeta.isEnum) {
|
|
202
204
|
const values = enumMap[fieldMeta.type];
|
|
203
205
|
if (!values || values.length === 0) {
|
|
204
206
|
throw new ShapeError(`Unknown enum: ${fieldMeta.type}`);
|
|
@@ -3361,23 +3363,20 @@ function buildRelationWriteSchema(model, fieldName, relatedModelName, isList, co
|
|
|
3361
3363
|
}
|
|
3362
3364
|
if (!isPlainObject(config.deleteMany)) {
|
|
3363
3365
|
throw new ShapeError(
|
|
3364
|
-
`deleteMany config on "${model}.${fieldName}" must be an object`
|
|
3366
|
+
`deleteMany config on "${model}.${fieldName}" must be an object of allowed filter fields`
|
|
3365
3367
|
);
|
|
3366
3368
|
}
|
|
3367
|
-
const
|
|
3368
|
-
if (!dmConfig.where || !isPlainObject(dmConfig.where)) {
|
|
3369
|
-
throw new ShapeError(
|
|
3370
|
-
`deleteMany on "${model}.${fieldName}" requires "where" object`
|
|
3371
|
-
);
|
|
3372
|
-
}
|
|
3373
|
-
const whereSchema = buildWhereFieldsSchema(
|
|
3369
|
+
const filterSchema = buildWhereFieldsSchema(
|
|
3374
3370
|
relatedModelName,
|
|
3375
|
-
|
|
3371
|
+
config.deleteMany,
|
|
3376
3372
|
typeMap,
|
|
3377
3373
|
schemaBuilder
|
|
3378
3374
|
);
|
|
3379
|
-
|
|
3380
|
-
|
|
3375
|
+
opSchemas["deleteMany"] = z8.union([
|
|
3376
|
+
filterSchema,
|
|
3377
|
+
z8.preprocess(coerceToArray, z8.array(filterSchema)),
|
|
3378
|
+
z8.object({}).strict()
|
|
3379
|
+
]).optional();
|
|
3381
3380
|
}
|
|
3382
3381
|
return z8.object(opSchemas).strict();
|
|
3383
3382
|
}
|