@cripty2001/utils 0.0.87 → 0.0.88
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.
|
@@ -8,9 +8,9 @@ exports.genBuilder = genBuilder;
|
|
|
8
8
|
const handlebars_1 = __importDefault(require("handlebars"));
|
|
9
9
|
const mjml_1 = __importDefault(require("mjml"));
|
|
10
10
|
const typebox_1 = require("@sinclair/typebox");
|
|
11
|
-
const
|
|
12
|
-
const
|
|
13
|
-
const
|
|
11
|
+
const image_1 = require("./image");
|
|
12
|
+
const raw_1 = require("./raw");
|
|
13
|
+
const text_1 = require("./text");
|
|
14
14
|
exports.TEMPLATE_SCHEMA = typebox_1.Type.Object({
|
|
15
15
|
style: typebox_1.Type.Object({
|
|
16
16
|
font: typebox_1.Type.String(),
|
|
@@ -18,9 +18,9 @@ exports.TEMPLATE_SCHEMA = typebox_1.Type.Object({
|
|
|
18
18
|
textColor: typebox_1.Type.String()
|
|
19
19
|
}),
|
|
20
20
|
content: typebox_1.Type.Array(typebox_1.Type.Union([
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
21
|
+
image_1.SCHEMA,
|
|
22
|
+
text_1.SCHEMA,
|
|
23
|
+
raw_1.SCHEMA
|
|
24
24
|
]))
|
|
25
25
|
});
|
|
26
26
|
function genBuilder(config) {
|
|
@@ -28,11 +28,11 @@ function genBuilder(config) {
|
|
|
28
28
|
.map(item => {
|
|
29
29
|
switch (item.type) {
|
|
30
30
|
case "image":
|
|
31
|
-
return (0,
|
|
31
|
+
return (0, image_1.build)(item);
|
|
32
32
|
case "raw":
|
|
33
|
-
return (0,
|
|
33
|
+
return (0, raw_1.build)(item);
|
|
34
34
|
case "text":
|
|
35
|
-
return (0,
|
|
35
|
+
return (0, text_1.build)(item);
|
|
36
36
|
default:
|
|
37
37
|
// @ts-expect-error Should never happen
|
|
38
38
|
throw new Error(`Invalid type ${item.type}`);
|
package/package.json
CHANGED