scaleContent, rotatePage allow negative rotations, validateOperations casts action.values now

This commit is contained in:
Felix Kaspar
2024-05-17 23:10:32 +02:00
parent 6f4bb8242b
commit a484a804ad
7 changed files with 90 additions and 39 deletions

View File

@@ -20,8 +20,8 @@ export class RotatePages extends Operator {
protected static inputSchema = JoiPDFFileSchema.label(i18next.t("inputs.pdffile.name")).description(i18next.t("inputs.pdffile.description"));
protected static valueSchema = Joi.object({
rotation: Joi.alternatives().try(
Joi.number().min(0).max(360).allow(null),
CommaArrayJoiExt.comma_array().items(Joi.number().integer().min(0).max(360))
Joi.number().integer().min(-360).max(360),
CommaArrayJoiExt.comma_array().items(Joi.number().integer().min(-360).max(360))
).label(i18next.t("values.rotation.friendlyName", { ns: "rotatePages" })).description(i18next.t("values.rotation.description", { ns: "rotatePages" }))
.example("90").example("-180").example("[90, 0, 270]"),
});