mirror of
https://github.com/Stirling-Tools/Stirling-PDF.git
synced 2025-06-23 16:05:09 +00:00
Icons and clearer OperatorSchema
This commit is contained in:
parent
c2bcda925a
commit
227f46456b
@ -1,14 +1,15 @@
|
|||||||
import { OperatorSchema } from ".";
|
import { OperatorAvailability, OperatorSchema } from ".";
|
||||||
import Joi from "@stirling-tools/joi";
|
import Joi from "@stirling-tools/joi";
|
||||||
import { JoiPDFFileSchema } from "../wrappers/PdfFileJoi";
|
import { JoiPDFFileSchema } from "../wrappers/PdfFileJoi";
|
||||||
|
|
||||||
import i18next from "i18next";
|
import i18next from "i18next";
|
||||||
|
|
||||||
export default new OperatorSchema(
|
export default new OperatorSchema({
|
||||||
i18next.t("friendlyName", { ns: "arrangePages" }),
|
joi: {
|
||||||
i18next.t("description", { ns: "arrangePages" }),
|
label: i18next.t("friendlyName", { ns: "arrangePages" }),
|
||||||
JoiPDFFileSchema.label(i18next.t("inputs.pdffile.name")).description(i18next.t("inputs.pdffile.description")),
|
description: i18next.t("description", { ns: "arrangePages" }),
|
||||||
Joi.object({
|
inputSchema: JoiPDFFileSchema.label(i18next.t("inputs.pdffile.name")).description(i18next.t("inputs.pdffile.description")),
|
||||||
|
valueSchema: Joi.object({
|
||||||
arrangementConfig: Joi.string().valid(...[
|
arrangementConfig: Joi.string().valid(...[
|
||||||
"REVERSE_ORDER",
|
"REVERSE_ORDER",
|
||||||
"DUPLEX_SORT",
|
"DUPLEX_SORT",
|
||||||
@ -22,6 +23,8 @@ export default new OperatorSchema(
|
|||||||
.label(i18next.t("values.arrangementConfig.friendlyName", { ns: "arrangePages" })).description(i18next.t("values.arrangementConfig.description", { ns: "arrangePages" }))
|
.label(i18next.t("values.arrangementConfig.friendlyName", { ns: "arrangePages" })).description(i18next.t("values.arrangementConfig.description", { ns: "arrangePages" }))
|
||||||
.example("REVERSE_ORDER").example("DUPLEX_SORT").example("BOOKLET_SORT").required()
|
.example("REVERSE_ORDER").example("DUPLEX_SORT").example("BOOKLET_SORT").required()
|
||||||
}),
|
}),
|
||||||
JoiPDFFileSchema.label(i18next.t("outputs.pdffile.name")).description(i18next.t("outputs.pdffile.description")),
|
outputSchema: JoiPDFFileSchema.label(i18next.t("outputs.pdffile.name")).description(i18next.t("outputs.pdffile.description")),
|
||||||
"list"
|
},
|
||||||
);
|
materialSymbolName: "list",
|
||||||
|
availability: OperatorAvailability.Both
|
||||||
|
});
|
@ -1,4 +1,4 @@
|
|||||||
import { OperatorSchema } from ".";
|
import { OperatorAvailability, OperatorSchema } from ".";
|
||||||
import Joi from "@stirling-tools/joi";
|
import Joi from "@stirling-tools/joi";
|
||||||
import { JoiPDFFileSchema } from "../wrappers/PdfFileJoi";
|
import { JoiPDFFileSchema } from "../wrappers/PdfFileJoi";
|
||||||
|
|
||||||
@ -6,14 +6,18 @@ import i18next from "i18next";
|
|||||||
|
|
||||||
import CommaArrayJoiExt from "../wrappers/CommaArrayJoiExt";
|
import CommaArrayJoiExt from "../wrappers/CommaArrayJoiExt";
|
||||||
|
|
||||||
export default new OperatorSchema(
|
export default new OperatorSchema({
|
||||||
i18next.t("friendlyName", { ns: "extractPages" }),
|
joi: {
|
||||||
i18next.t("description", { ns: "extractPages" }),
|
label: i18next.t("friendlyName", { ns: "extractPages" }),
|
||||||
JoiPDFFileSchema.label(i18next.t("inputs.pdffile.name")).description(i18next.t("inputs.pdffile.description")),
|
description: i18next.t("description", { ns: "extractPages" }),
|
||||||
Joi.object({
|
inputSchema: JoiPDFFileSchema.label(i18next.t("inputs.pdffile.name")).description(i18next.t("inputs.pdffile.description")),
|
||||||
|
valueSchema: Joi.object({
|
||||||
pageIndexes: CommaArrayJoiExt.comma_array().items(Joi.number().integer()).required()
|
pageIndexes: CommaArrayJoiExt.comma_array().items(Joi.number().integer()).required()
|
||||||
.label(i18next.t("values.pageIndexes.friendlyName", { ns: "extractPages" })).description(i18next.t("values.pageIndexes.description", { ns: "extractPages" }))
|
.label(i18next.t("values.pageIndexes.friendlyName", { ns: "extractPages" })).description(i18next.t("values.pageIndexes.description", { ns: "extractPages" }))
|
||||||
.example("1").example("1, 2, 3, 4").example("4, 2, 4, 3").required()
|
.example("1").example("1, 2, 3, 4").example("4, 2, 4, 3").required()
|
||||||
}),
|
}),
|
||||||
JoiPDFFileSchema.label(i18next.t("outputs.pdffile.name")).description(i18next.t("outputs.pdffile.description"))
|
outputSchema: JoiPDFFileSchema.label(i18next.t("outputs.pdffile.name")).description(i18next.t("outputs.pdffile.description")),
|
||||||
);
|
},
|
||||||
|
materialSymbolName: "content_cut",
|
||||||
|
availability: OperatorAvailability.Both
|
||||||
|
});
|
@ -1,14 +1,15 @@
|
|||||||
import { OperatorSchema } from ".";
|
import { OperatorAvailability, OperatorSchema } from ".";
|
||||||
import Joi from "@stirling-tools/joi";
|
import Joi from "@stirling-tools/joi";
|
||||||
import { JoiPDFFileSchema } from "../wrappers/PdfFileJoi";
|
import { JoiPDFFileSchema } from "../wrappers/PdfFileJoi";
|
||||||
|
|
||||||
import i18next from "i18next";
|
import i18next from "i18next";
|
||||||
|
|
||||||
export default new OperatorSchema(
|
export default new OperatorSchema({
|
||||||
i18next.t("friendlyName", { ns: "impose" }),
|
joi: {
|
||||||
i18next.t("description", { ns: "impose" }),
|
label: i18next.t("friendlyName", { ns: "impose" }),
|
||||||
JoiPDFFileSchema.label(i18next.t("inputs.pdffile.name")).description(i18next.t("inputs.pdffile.description")),
|
description: i18next.t("description", { ns: "impose" }),
|
||||||
Joi.object({
|
inputSchema: JoiPDFFileSchema.label(i18next.t("inputs.pdffile.name")).description(i18next.t("inputs.pdffile.description")),
|
||||||
|
valueSchema: Joi.object({
|
||||||
nup: Joi.number().integer().valid(2, 3, 4, 8, 9, 12, 16).required()
|
nup: Joi.number().integer().valid(2, 3, 4, 8, 9, 12, 16).required()
|
||||||
.label(i18next.t("values.nup.friendlyName", { ns: "impose" })).description(i18next.t("values.nup.description", { ns: "impose" }))
|
.label(i18next.t("values.nup.friendlyName", { ns: "impose" })).description(i18next.t("values.nup.description", { ns: "impose" }))
|
||||||
.example("3").example("4"),
|
.example("3").example("4"),
|
||||||
@ -55,5 +56,9 @@ export default new OperatorSchema(
|
|||||||
.label(i18next.t("values.format.friendlyName", { ns: "impose" })).description(i18next.t("values.format.description", { ns: "impose" }))
|
.label(i18next.t("values.format.friendlyName", { ns: "impose" })).description(i18next.t("values.format.description", { ns: "impose" }))
|
||||||
.example("A4").example("A3L")
|
.example("A4").example("A3L")
|
||||||
}),
|
}),
|
||||||
JoiPDFFileSchema.label(i18next.t("outputs.pdffile.name")).description(i18next.t("outputs.pdffile.description"))
|
outputSchema: JoiPDFFileSchema.label(i18next.t("outputs.pdffile.name")).description(i18next.t("outputs.pdffile.description")),
|
||||||
|
},
|
||||||
|
materialSymbolName: "grid_view",
|
||||||
|
availability: OperatorAvailability.Both
|
||||||
|
}
|
||||||
)
|
)
|
@ -31,18 +31,31 @@ export class Operator {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
export enum OperatorAvailability {Serverside, Clientside, Both}
|
||||||
|
|
||||||
export class OperatorSchema {
|
export class OperatorSchema {
|
||||||
schema: Joi.ObjectSchema<any>;
|
schema: Joi.ObjectSchema<any>;
|
||||||
materialSymbolName: MaterialSymbolProps["icon"] | undefined;
|
materialSymbolName: MaterialSymbolProps["icon"] | undefined;
|
||||||
|
availability: OperatorAvailability;
|
||||||
|
|
||||||
constructor(label: string, description: string, inputSchema: Joi.Schema, valueSchema: Joi.Schema, outputSchema: Joi.Schema, materialSymbolName?: MaterialSymbolProps["icon"] | undefined) {
|
constructor(params: {
|
||||||
|
joi: {
|
||||||
|
label: string;
|
||||||
|
description: string;
|
||||||
|
inputSchema: Joi.Schema;
|
||||||
|
valueSchema: Joi.Schema;
|
||||||
|
outputSchema: Joi.Schema;
|
||||||
|
},
|
||||||
|
materialSymbolName?: MaterialSymbolProps["icon"],
|
||||||
|
availability: OperatorAvailability
|
||||||
|
}) {
|
||||||
this.schema = Joi.object({
|
this.schema = Joi.object({
|
||||||
input: inputSchema,
|
input: params.joi.inputSchema,
|
||||||
values: valueSchema.required(),
|
values: params.joi.valueSchema.required(),
|
||||||
output: outputSchema
|
output: params.joi.outputSchema
|
||||||
}).label(label).description(description);
|
}).label(params.joi.label).description(params.joi.description);
|
||||||
this.materialSymbolName = materialSymbolName;
|
this.materialSymbolName = params.materialSymbolName;
|
||||||
|
this.availability = params.availability;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1,13 +1,18 @@
|
|||||||
import { OperatorSchema } from ".";
|
import { OperatorAvailability, OperatorSchema } from ".";
|
||||||
import Joi from "@stirling-tools/joi";
|
import Joi from "@stirling-tools/joi";
|
||||||
import { JoiPDFFileSchema } from "../wrappers/PdfFileJoi";
|
import { JoiPDFFileSchema } from "../wrappers/PdfFileJoi";
|
||||||
|
|
||||||
import i18next from "i18next";
|
import i18next from "i18next";
|
||||||
|
|
||||||
export default new OperatorSchema(
|
export default new OperatorSchema({
|
||||||
i18next.t("friendlyName", { ns: "merge" }),
|
joi: {
|
||||||
i18next.t("description", { ns: "merge" }),
|
label: i18next.t("friendlyName", { ns: "merge" }),
|
||||||
JoiPDFFileSchema.label(i18next.t("inputs.pdffile.name")).description(i18next.t("inputs.pdffile.description")),
|
description: i18next.t("description", { ns: "merge" }),
|
||||||
Joi.object({}),
|
inputSchema: JoiPDFFileSchema.label(i18next.t("inputs.pdffile.name")).description(i18next.t("inputs.pdffile.description")),
|
||||||
JoiPDFFileSchema.label(i18next.t("outputs.pdffile.name")).description(i18next.t("outputs.pdffile.description"))
|
valueSchema: Joi.object({}),
|
||||||
|
outputSchema: JoiPDFFileSchema.label(i18next.t("outputs.pdffile.name")).description(i18next.t("outputs.pdffile.description")),
|
||||||
|
},
|
||||||
|
materialSymbolName: "cell_merge",
|
||||||
|
availability: OperatorAvailability.Both
|
||||||
|
}
|
||||||
);
|
);
|
@ -1,17 +1,21 @@
|
|||||||
import { OperatorSchema } from ".";
|
import { OperatorAvailability, OperatorSchema } from ".";
|
||||||
import Joi from "@stirling-tools/joi";
|
import Joi from "@stirling-tools/joi";
|
||||||
import { JoiPDFFileSchema } from "../wrappers/PdfFileJoi";
|
import { JoiPDFFileSchema } from "../wrappers/PdfFileJoi";
|
||||||
|
|
||||||
import i18next from "i18next";
|
import i18next from "i18next";
|
||||||
|
|
||||||
export default new OperatorSchema(
|
export default new OperatorSchema({
|
||||||
i18next.t("friendlyName", { ns: "removeBlankPages" }),
|
joi: {
|
||||||
i18next.t("description", { ns: "removeBlankPages" }),
|
label: i18next.t("friendlyName", { ns: "removeBlankPages" }),
|
||||||
JoiPDFFileSchema.label(i18next.t("inputs.pdffile.name")).description(i18next.t("inputs.pdffile.description")),
|
description: i18next.t("description", { ns: "removeBlankPages" }),
|
||||||
Joi.object({
|
inputSchema: JoiPDFFileSchema.label(i18next.t("inputs.pdffile.name")).description(i18next.t("inputs.pdffile.description")),
|
||||||
|
valueSchema: Joi.object({
|
||||||
whiteThreashold: Joi.number().min(0).max(255).required()
|
whiteThreashold: Joi.number().min(0).max(255).required()
|
||||||
.label(i18next.t("values.whiteThreashold.friendlyName", { ns: "removeBlankPages" })).description(i18next.t("values.whiteThreashold.description", { ns: "removeBlankPages" }))
|
.label(i18next.t("values.whiteThreashold.friendlyName", { ns: "removeBlankPages" })).description(i18next.t("values.whiteThreashold.description", { ns: "removeBlankPages" }))
|
||||||
.example("10").example("0").example("255").required()
|
.example("10").example("0").example("255").required()
|
||||||
}),
|
}),
|
||||||
JoiPDFFileSchema.label(i18next.t("outputs.pdffile.name")).description(i18next.t("outputs.pdffile.description"))
|
outputSchema: JoiPDFFileSchema.label(i18next.t("outputs.pdffile.name")).description(i18next.t("outputs.pdffile.description")),
|
||||||
);
|
},
|
||||||
|
materialSymbolName: "filter_alt",
|
||||||
|
availability: OperatorAvailability.Both
|
||||||
|
});
|
@ -1,4 +1,4 @@
|
|||||||
import { OperatorSchema } from ".";
|
import { OperatorAvailability, OperatorSchema } from ".";
|
||||||
import Joi from "@stirling-tools/joi";
|
import Joi from "@stirling-tools/joi";
|
||||||
import { JoiPDFFileSchema } from "../wrappers/PdfFileJoi";
|
import { JoiPDFFileSchema } from "../wrappers/PdfFileJoi";
|
||||||
|
|
||||||
@ -6,14 +6,18 @@ import i18next from "i18next";
|
|||||||
|
|
||||||
import CommaArrayJoiExt from "../wrappers/CommaArrayJoiExt";
|
import CommaArrayJoiExt from "../wrappers/CommaArrayJoiExt";
|
||||||
|
|
||||||
export default new OperatorSchema(
|
export default new OperatorSchema({
|
||||||
i18next.t("friendlyName", { ns: "removePages" }),
|
joi: {
|
||||||
i18next.t("description", { ns: "removePages" }),
|
label: i18next.t("friendlyName", { ns: "removePages" }),
|
||||||
JoiPDFFileSchema.label(i18next.t("inputs.pdffile.name")).description(i18next.t("inputs.pdffile.description")),
|
description: i18next.t("description", { ns: "removePages" }),
|
||||||
Joi.object({
|
inputSchema: JoiPDFFileSchema.label(i18next.t("inputs.pdffile.name")).description(i18next.t("inputs.pdffile.description")),
|
||||||
|
valueSchema: Joi.object({
|
||||||
pageIndexes: CommaArrayJoiExt.comma_array().items(Joi.number().integer()).required()
|
pageIndexes: CommaArrayJoiExt.comma_array().items(Joi.number().integer()).required()
|
||||||
.label(i18next.t("values.pageIndexes.friendlyName", { ns: "removePages" })).description(i18next.t("values.pageIndexes.description", { ns: "removePages" }))
|
.label(i18next.t("values.pageIndexes.friendlyName", { ns: "removePages" })).description(i18next.t("values.pageIndexes.description", { ns: "removePages" }))
|
||||||
.example("1").example("1, 2, 3, 4").example("4, 2, 4, 3").required()
|
.example("1").example("1, 2, 3, 4").example("4, 2, 4, 3").required()
|
||||||
}),
|
}),
|
||||||
JoiPDFFileSchema.label(i18next.t("outputs.pdffile.name")).description(i18next.t("outputs.pdffile.description"))
|
outputSchema: JoiPDFFileSchema.label(i18next.t("outputs.pdffile.name")).description(i18next.t("outputs.pdffile.description")),
|
||||||
);
|
},
|
||||||
|
materialSymbolName: "delete",
|
||||||
|
availability: OperatorAvailability.Both
|
||||||
|
});
|
@ -1,4 +1,4 @@
|
|||||||
import { OperatorSchema } from ".";
|
import { OperatorAvailability, OperatorSchema } from ".";
|
||||||
import Joi from "@stirling-tools/joi";
|
import Joi from "@stirling-tools/joi";
|
||||||
import { JoiPDFFileSchema } from "../wrappers/PdfFileJoi";
|
import { JoiPDFFileSchema } from "../wrappers/PdfFileJoi";
|
||||||
|
|
||||||
@ -6,11 +6,12 @@ import i18next from "i18next";
|
|||||||
|
|
||||||
import CommaArrayJoiExt from "../wrappers/CommaArrayJoiExt";
|
import CommaArrayJoiExt from "../wrappers/CommaArrayJoiExt";
|
||||||
|
|
||||||
export default new OperatorSchema(
|
export default new OperatorSchema({
|
||||||
i18next.t("friendlyName", { ns: "rotatePages" }),
|
joi: {
|
||||||
i18next.t("description", { ns: "rotatePages" }),
|
label: i18next.t("friendlyName", { ns: "rotatePages" }),
|
||||||
JoiPDFFileSchema.label(i18next.t("inputs.pdffile.name")).description(i18next.t("inputs.pdffile.description")),
|
description: i18next.t("description", { ns: "rotatePages" }),
|
||||||
Joi.object({
|
inputSchema: JoiPDFFileSchema.label(i18next.t("inputs.pdffile.name")).description(i18next.t("inputs.pdffile.description")),
|
||||||
|
valueSchema: Joi.object({
|
||||||
rotation: Joi.alternatives().try(
|
rotation: Joi.alternatives().try(
|
||||||
Joi.number().integer().min(-360).max(360).required(),
|
Joi.number().integer().min(-360).max(360).required(),
|
||||||
CommaArrayJoiExt.comma_array().items(Joi.number().integer().min(-360).max(360)).required()
|
CommaArrayJoiExt.comma_array().items(Joi.number().integer().min(-360).max(360)).required()
|
||||||
@ -18,5 +19,8 @@ export default new OperatorSchema(
|
|||||||
.label(i18next.t("values.rotation.friendlyName", { ns: "rotatePages" })).description(i18next.t("values.rotation.description", { ns: "rotatePages" }))
|
.label(i18next.t("values.rotation.friendlyName", { ns: "rotatePages" })).description(i18next.t("values.rotation.description", { ns: "rotatePages" }))
|
||||||
.example("90").example("-180").example("[90, 0, 270]"),
|
.example("90").example("-180").example("[90, 0, 270]"),
|
||||||
}),
|
}),
|
||||||
JoiPDFFileSchema.label(i18next.t("outputs.pdffile.name")).description(i18next.t("outputs.pdffile.description"))
|
outputSchema: JoiPDFFileSchema.label(i18next.t("outputs.pdffile.name")).description(i18next.t("outputs.pdffile.description")),
|
||||||
);
|
},
|
||||||
|
materialSymbolName: "rotate_right",
|
||||||
|
availability: OperatorAvailability.Both
|
||||||
|
});
|
@ -1,4 +1,4 @@
|
|||||||
import { OperatorSchema } from ".";
|
import { OperatorAvailability, OperatorSchema } from ".";
|
||||||
import Joi from "@stirling-tools/joi";
|
import Joi from "@stirling-tools/joi";
|
||||||
import { JoiPDFFileSchema } from "../wrappers/PdfFileJoi";
|
import { JoiPDFFileSchema } from "../wrappers/PdfFileJoi";
|
||||||
|
|
||||||
@ -6,11 +6,12 @@ import i18next from "i18next";
|
|||||||
|
|
||||||
import CommaArrayJoiExt from "../wrappers/CommaArrayJoiExt";
|
import CommaArrayJoiExt from "../wrappers/CommaArrayJoiExt";
|
||||||
|
|
||||||
export default new OperatorSchema(
|
export default new OperatorSchema({
|
||||||
i18next.t("friendlyName", { ns: "scaleContent" }),
|
joi: {
|
||||||
i18next.t("description", { ns: "scaleContent" }),
|
label: i18next.t("friendlyName", { ns: "scaleContent" }),
|
||||||
JoiPDFFileSchema.label(i18next.t("inputs.pdffile.name")).description(i18next.t("inputs.pdffile.description")),
|
description: i18next.t("description", { ns: "scaleContent" }),
|
||||||
Joi.object({
|
inputSchema: JoiPDFFileSchema.label(i18next.t("inputs.pdffile.name")).description(i18next.t("inputs.pdffile.description")),
|
||||||
|
valueSchema: Joi.object({
|
||||||
scaleFactor: Joi.alternatives().try(
|
scaleFactor: Joi.alternatives().try(
|
||||||
Joi.number().required(),
|
Joi.number().required(),
|
||||||
CommaArrayJoiExt.comma_array().items(Joi.number()).required()
|
CommaArrayJoiExt.comma_array().items(Joi.number()).required()
|
||||||
@ -18,5 +19,8 @@ export default new OperatorSchema(
|
|||||||
.label(i18next.t("values.scaleFactor.friendlyName", { ns: "scaleContent" })).description(i18next.t("values.scaleFactor.description", { ns: "scaleContent" }))
|
.label(i18next.t("values.scaleFactor.friendlyName", { ns: "scaleContent" })).description(i18next.t("values.scaleFactor.description", { ns: "scaleContent" }))
|
||||||
.example("2").example("1.5").example("[1, 1.5, 0.9]"),
|
.example("2").example("1.5").example("[1, 1.5, 0.9]"),
|
||||||
}),
|
}),
|
||||||
JoiPDFFileSchema.label(i18next.t("outputs.pdffile.name")).description(i18next.t("outputs.pdffile.description"))
|
outputSchema: JoiPDFFileSchema.label(i18next.t("outputs.pdffile.name")).description(i18next.t("outputs.pdffile.description")),
|
||||||
);
|
},
|
||||||
|
materialSymbolName: "center_focus_strong",
|
||||||
|
availability: OperatorAvailability.Both
|
||||||
|
});
|
@ -1,14 +1,15 @@
|
|||||||
import { OperatorSchema } from ".";
|
import { OperatorAvailability, OperatorSchema } from ".";
|
||||||
import Joi from "@stirling-tools/joi";
|
import Joi from "@stirling-tools/joi";
|
||||||
import { JoiPDFFileSchema } from "../wrappers/PdfFileJoi";
|
import { JoiPDFFileSchema } from "../wrappers/PdfFileJoi";
|
||||||
|
|
||||||
import i18next from "i18next";
|
import i18next from "i18next";
|
||||||
|
|
||||||
export default new OperatorSchema(
|
export default new OperatorSchema({
|
||||||
i18next.t("friendlyName", { ns: "scalePage" }),
|
joi: {
|
||||||
i18next.t("description", { ns: "scalePage" }),
|
label: i18next.t("friendlyName", { ns: "scalePage" }),
|
||||||
JoiPDFFileSchema.label(i18next.t("inputs.pdffile.name")).description(i18next.t("inputs.pdffile.description")),
|
description: i18next.t("description", { ns: "scalePage" }),
|
||||||
Joi.object({
|
inputSchema: JoiPDFFileSchema.label(i18next.t("inputs.pdffile.name")).description(i18next.t("inputs.pdffile.description")),
|
||||||
|
valueSchema: Joi.object({
|
||||||
height: Joi.number().min(0)
|
height: Joi.number().min(0)
|
||||||
.label(i18next.t("values.height.friendlyName", { ns: "scalePage" })).description(i18next.t("values.height.description", { ns: "scalePage" }))
|
.label(i18next.t("values.height.friendlyName", { ns: "scalePage" })).description(i18next.t("values.height.description", { ns: "scalePage" }))
|
||||||
.example("842").example("595").example("1190"),
|
.example("842").example("595").example("1190"),
|
||||||
@ -16,5 +17,8 @@ export default new OperatorSchema(
|
|||||||
.label(i18next.t("values.width.friendlyName", { ns: "scalePage" })).description(i18next.t("values.width.description", { ns: "scalePage" }))
|
.label(i18next.t("values.width.friendlyName", { ns: "scalePage" })).description(i18next.t("values.width.description", { ns: "scalePage" }))
|
||||||
.example("595").example("420").example("842"),
|
.example("595").example("420").example("842"),
|
||||||
}).or("height", "width"),
|
}).or("height", "width"),
|
||||||
JoiPDFFileSchema.label(i18next.t("outputs.pdffile.name")).description(i18next.t("outputs.pdffile.description"))
|
outputSchema: JoiPDFFileSchema.label(i18next.t("outputs.pdffile.name")).description(i18next.t("outputs.pdffile.description")),
|
||||||
);
|
},
|
||||||
|
materialSymbolName: "zoom_out_map",
|
||||||
|
availability: OperatorAvailability.Both
|
||||||
|
});
|
@ -1,14 +1,15 @@
|
|||||||
import { OperatorSchema } from ".";
|
import { OperatorAvailability, OperatorSchema } from ".";
|
||||||
import Joi from "@stirling-tools/joi";
|
import Joi from "@stirling-tools/joi";
|
||||||
import { JoiPDFFileSchema } from "../wrappers/PdfFileJoi";
|
import { JoiPDFFileSchema } from "../wrappers/PdfFileJoi";
|
||||||
|
|
||||||
import i18next from "i18next";
|
import i18next from "i18next";
|
||||||
|
|
||||||
export default new OperatorSchema(
|
export default new OperatorSchema({
|
||||||
i18next.t("friendlyName", { ns: "splitPagesByPreset" }),
|
joi: {
|
||||||
i18next.t("description", { ns: "splitPagesByPreset" }),
|
label: i18next.t("friendlyName", { ns: "splitPagesByPreset" }),
|
||||||
JoiPDFFileSchema.label(i18next.t("inputs.pdffile.name")).description(i18next.t("inputs.pdffile.description")),
|
description: i18next.t("description", { ns: "splitPagesByPreset" }),
|
||||||
Joi.alternatives().try(
|
inputSchema: JoiPDFFileSchema.label(i18next.t("inputs.pdffile.name")).description(i18next.t("inputs.pdffile.description")),
|
||||||
|
valueSchema: Joi.alternatives().try(
|
||||||
Joi.object({
|
Joi.object({
|
||||||
type: Joi.string().valid("BAR_CODE").required()
|
type: Joi.string().valid("BAR_CODE").required()
|
||||||
}),
|
}),
|
||||||
@ -22,5 +23,8 @@ export default new OperatorSchema(
|
|||||||
)
|
)
|
||||||
.label(i18next.t("values.splitSettings.friendlyName", { ns: "splitPagesByPreset" })).description(i18next.t("values.splitSettings.description", { ns: "splitPagesByPreset" })
|
.label(i18next.t("values.splitSettings.friendlyName", { ns: "splitPagesByPreset" })).description(i18next.t("values.splitSettings.description", { ns: "splitPagesByPreset" })
|
||||||
),
|
),
|
||||||
JoiPDFFileSchema.label(i18next.t("outputs.pdffile.name")).description(i18next.t("outputs.pdffile.description"))
|
outputSchema: JoiPDFFileSchema.label(i18next.t("outputs.pdffile.name")).description(i18next.t("outputs.pdffile.description")),
|
||||||
);
|
},
|
||||||
|
materialSymbolName: "water",
|
||||||
|
availability: OperatorAvailability.Both
|
||||||
|
});
|
@ -1,4 +1,4 @@
|
|||||||
import { OperatorSchema } from ".";
|
import { OperatorAvailability, OperatorSchema } from ".";
|
||||||
import Joi from "@stirling-tools/joi";
|
import Joi from "@stirling-tools/joi";
|
||||||
import { JoiPDFFileSchema } from "../wrappers/PdfFileJoi";
|
import { JoiPDFFileSchema } from "../wrappers/PdfFileJoi";
|
||||||
|
|
||||||
@ -6,14 +6,18 @@ import i18next from "i18next";
|
|||||||
|
|
||||||
import CommaArrayJoiExt from "../wrappers/CommaArrayJoiExt";
|
import CommaArrayJoiExt from "../wrappers/CommaArrayJoiExt";
|
||||||
|
|
||||||
export default new OperatorSchema(
|
export default new OperatorSchema({
|
||||||
i18next.t("friendlyName", { ns: "splitPdfByIndex" }),
|
joi: {
|
||||||
i18next.t("description", { ns: "splitPdfByIndex" }),
|
label: i18next.t("friendlyName", { ns: "splitPdfByIndex" }),
|
||||||
JoiPDFFileSchema.label(i18next.t("inputs.pdffile.name")).description(i18next.t("inputs.pdffile.description")),
|
description: i18next.t("description", { ns: "splitPdfByIndex" }),
|
||||||
Joi.object({
|
inputSchema: JoiPDFFileSchema.label(i18next.t("inputs.pdffile.name")).description(i18next.t("inputs.pdffile.description")),
|
||||||
|
valueSchema: Joi.object({
|
||||||
pageIndexes: CommaArrayJoiExt.comma_array().items(Joi.number().integer()).required()
|
pageIndexes: CommaArrayJoiExt.comma_array().items(Joi.number().integer()).required()
|
||||||
.label(i18next.t("values.pageIndexes.friendlyName", { ns: "splitPdfByIndex" })).description(i18next.t("values.pageIndexes.description", { ns: "splitPdfByIndex" }))
|
.label(i18next.t("values.pageIndexes.friendlyName", { ns: "splitPdfByIndex" })).description(i18next.t("values.pageIndexes.description", { ns: "splitPdfByIndex" }))
|
||||||
.example("1").example("1, 2, 3, 4").example("4, 2, 4, 3")
|
.example("1").example("1, 2, 3, 4").example("4, 2, 4, 3")
|
||||||
}),
|
}),
|
||||||
JoiPDFFileSchema.label(i18next.t("outputs.pdffile.name")).description(i18next.t("outputs.pdffile.description"))
|
outputSchema: JoiPDFFileSchema.label(i18next.t("outputs.pdffile.name")).description(i18next.t("outputs.pdffile.description")),
|
||||||
);
|
},
|
||||||
|
materialSymbolName: "splitscreen",
|
||||||
|
availability: OperatorAvailability.Both
|
||||||
|
});
|
@ -1,14 +1,15 @@
|
|||||||
import { OperatorSchema } from ".";
|
import { OperatorAvailability, OperatorSchema } from ".";
|
||||||
import Joi from "@stirling-tools/joi";
|
import Joi from "@stirling-tools/joi";
|
||||||
import { JoiPDFFileSchema } from "../wrappers/PdfFileJoi";
|
import { JoiPDFFileSchema } from "../wrappers/PdfFileJoi";
|
||||||
|
|
||||||
import i18next from "i18next";
|
import i18next from "i18next";
|
||||||
|
|
||||||
export default new OperatorSchema(
|
export default new OperatorSchema({
|
||||||
i18next.t("friendlyName", { ns: "updateMetadata" }),
|
joi: {
|
||||||
i18next.t("description", { ns: "updateMetadata" }),
|
label: i18next.t("friendlyName", { ns: "updateMetadata" }),
|
||||||
JoiPDFFileSchema.label(i18next.t("inputs.pdffile.name")).description(i18next.t("inputs.pdffile.description")),
|
description: i18next.t("description", { ns: "updateMetadata" }),
|
||||||
Joi.object({
|
inputSchema: JoiPDFFileSchema.label(i18next.t("inputs.pdffile.name")).description(i18next.t("inputs.pdffile.description")),
|
||||||
|
valueSchema: Joi.object({
|
||||||
deleteAll: Joi.boolean().invalid(false)
|
deleteAll: Joi.boolean().invalid(false)
|
||||||
.label(i18next.t("values.deleteAll.friendlyName", { ns: "updateMetadata" })).description(i18next.t("values.deleteAll.description", { ns: "updateMetadata" }))
|
.label(i18next.t("values.deleteAll.friendlyName", { ns: "updateMetadata" })).description(i18next.t("values.deleteAll.description", { ns: "updateMetadata" }))
|
||||||
.example("true").example("false"),
|
.example("true").example("false"),
|
||||||
@ -41,5 +42,8 @@ export default new OperatorSchema(
|
|||||||
|
|
||||||
// TODO: allRequestParams?: {[key: string]: [key: string]}, // Map list of key and value of custom parameters. Note these must start with customKey and customValue if they are non-standard
|
// TODO: allRequestParams?: {[key: string]: [key: string]}, // Map list of key and value of custom parameters. Note these must start with customKey and customValue if they are non-standard
|
||||||
}),
|
}),
|
||||||
JoiPDFFileSchema.label(i18next.t("outputs.pdffile.name")).description(i18next.t("outputs.pdffile.description"))
|
outputSchema:JoiPDFFileSchema.label(i18next.t("outputs.pdffile.name")).description(i18next.t("outputs.pdffile.description")),
|
||||||
);
|
},
|
||||||
|
materialSymbolName: "description",
|
||||||
|
availability: OperatorAvailability.Both
|
||||||
|
});
|
Loading…
x
Reference in New Issue
Block a user