[autofix.ci] apply automated fixes

This commit is contained in:
autofix-ci[bot]
2025-09-23 16:46:21 +00:00
committed by GitHub
parent b4a3cbdff4
commit cd06b55a0c
6 changed files with 169 additions and 163 deletions
@@ -50,7 +50,8 @@ export const sendBuildErrorNotifications = async ({
}); });
for (const notification of notificationList) { for (const notification of notificationList) {
const { email, discord, telegram, slack, gotify, ntfy, lark } = notification; const { email, discord, telegram, slack, gotify, ntfy, lark } =
notification;
if (email) { if (email) {
const template = await renderAsync( const template = await renderAsync(
BuildFailedEmail({ BuildFailedEmail({
@@ -228,10 +229,10 @@ export const sendBuildErrorNotifications = async ({
normal_v2: { normal_v2: {
default: "normal", default: "normal",
pc: "normal", pc: "normal",
mobile: "heading" mobile: "heading",
} },
} },
} },
}, },
header: { header: {
title: { title: {
@@ -243,7 +244,7 @@ export const sendBuildErrorNotifications = async ({
content: "", content: "",
}, },
template: "red", template: "red",
padding: "12px 12px 12px 12px" padding: "12px 12px 12px 12px",
}, },
body: { body: {
direction: "vertical", direction: "vertical",
@@ -260,23 +261,23 @@ export const sendBuildErrorNotifications = async ({
tag: "markdown", tag: "markdown",
content: `**Project:**\n${projectName}`, content: `**Project:**\n${projectName}`,
text_align: "left", text_align: "left",
text_size: "normal_v2" text_size: "normal_v2",
}, },
{ {
tag: "markdown", tag: "markdown",
content: `**Type:**\n${applicationType}`, content: `**Type:**\n${applicationType}`,
text_align: "left", text_align: "left",
text_size: "normal_v2" text_size: "normal_v2",
}, },
{ {
tag: "markdown", tag: "markdown",
content: `**Error Message:**\n\`\`\`\n${truncatedErrorMessage}\n\`\`\``, content: `**Error Message:**\n\`\`\`\n${truncatedErrorMessage}\n\`\`\``,
text_align: "left", text_align: "left",
text_size: "normal_v2" text_size: "normal_v2",
} },
], ],
vertical_align: "top", vertical_align: "top",
weight: 1 weight: 1,
}, },
{ {
tag: "column", tag: "column",
@@ -286,19 +287,19 @@ export const sendBuildErrorNotifications = async ({
tag: "markdown", tag: "markdown",
content: `**Application:**\n${applicationName}`, content: `**Application:**\n${applicationName}`,
text_align: "left", text_align: "left",
text_size: "normal_v2" text_size: "normal_v2",
}, },
{ {
tag: "markdown", tag: "markdown",
content: `**Date:**\n${format(date, "PP pp")}`, content: `**Date:**\n${format(date, "PP pp")}`,
text_align: "left", text_align: "left",
text_size: "normal_v2" text_size: "normal_v2",
} },
], ],
vertical_align: "top", vertical_align: "top",
weight: 1 weight: 1,
} },
] ],
}, },
{ {
tag: "button", tag: "button",
@@ -315,13 +316,13 @@ export const sendBuildErrorNotifications = async ({
default_url: buildLink, default_url: buildLink,
pc_url: "", pc_url: "",
ios_url: "", ios_url: "",
android_url: "" android_url: "",
} },
], ],
margin: "0px 0px 0px 0px" margin: "0px 0px 0px 0px",
} },
], ],
} },
}, },
}); });
} }
@@ -51,7 +51,8 @@ export const sendBuildSuccessNotifications = async ({
}); });
for (const notification of notificationList) { for (const notification of notificationList) {
const { email, discord, telegram, slack, gotify, ntfy, lark } = notification; const { email, discord, telegram, slack, gotify, ntfy, lark } =
notification;
if (email) { if (email) {
const template = await renderAsync( const template = await renderAsync(
@@ -225,10 +226,10 @@ export const sendBuildSuccessNotifications = async ({
normal_v2: { normal_v2: {
default: "normal", default: "normal",
pc: "normal", pc: "normal",
mobile: "heading" mobile: "heading",
} },
} },
} },
}, },
header: { header: {
title: { title: {
@@ -240,7 +241,7 @@ export const sendBuildSuccessNotifications = async ({
content: "", content: "",
}, },
template: "green", template: "green",
padding: "12px 12px 12px 12px" padding: "12px 12px 12px 12px",
}, },
body: { body: {
direction: "vertical", direction: "vertical",
@@ -257,17 +258,17 @@ export const sendBuildSuccessNotifications = async ({
tag: "markdown", tag: "markdown",
content: `**Project:**\n${projectName}`, content: `**Project:**\n${projectName}`,
text_align: "left", text_align: "left",
text_size: "normal_v2" text_size: "normal_v2",
}, },
{ {
tag: "markdown", tag: "markdown",
content: `**Type:**\n${applicationType}`, content: `**Type:**\n${applicationType}`,
text_align: "left", text_align: "left",
text_size: "normal_v2" text_size: "normal_v2",
} },
], ],
vertical_align: "top", vertical_align: "top",
weight: 1 weight: 1,
}, },
{ {
tag: "column", tag: "column",
@@ -277,19 +278,19 @@ export const sendBuildSuccessNotifications = async ({
tag: "markdown", tag: "markdown",
content: `**Application:**\n${applicationName}`, content: `**Application:**\n${applicationName}`,
text_align: "left", text_align: "left",
text_size: "normal_v2" text_size: "normal_v2",
}, },
{ {
tag: "markdown", tag: "markdown",
content: `**Date:**\n${format(date, "PP pp")}`, content: `**Date:**\n${format(date, "PP pp")}`,
text_align: "left", text_align: "left",
text_size: "normal_v2" text_size: "normal_v2",
} },
], ],
vertical_align: "top", vertical_align: "top",
weight: 1 weight: 1,
} },
] ],
}, },
{ {
tag: "button", tag: "button",
@@ -306,13 +307,13 @@ export const sendBuildSuccessNotifications = async ({
default_url: buildLink, default_url: buildLink,
pc_url: "", pc_url: "",
ios_url: "", ios_url: "",
android_url: "" android_url: "",
} },
], ],
margin: "0px 0px 0px 0px" margin: "0px 0px 0px 0px",
} },
], ],
} },
}, },
}); });
} }
@@ -50,7 +50,8 @@ export const sendDatabaseBackupNotifications = async ({
}); });
for (const notification of notificationList) { for (const notification of notificationList) {
const { email, discord, telegram, slack, gotify, ntfy, lark } = notification; const { email, discord, telegram, slack, gotify, ntfy, lark } =
notification;
if (email) { if (email) {
const template = await renderAsync( const template = await renderAsync(
@@ -243,7 +244,8 @@ export const sendDatabaseBackupNotifications = async ({
if (lark) { if (lark) {
const limitCharacter = 800; const limitCharacter = 800;
const truncatedErrorMessage = errorMessage && errorMessage.length > limitCharacter const truncatedErrorMessage =
errorMessage && errorMessage.length > limitCharacter
? errorMessage.substring(0, limitCharacter) ? errorMessage.substring(0, limitCharacter)
: errorMessage; : errorMessage;
@@ -258,10 +260,10 @@ export const sendDatabaseBackupNotifications = async ({
normal_v2: { normal_v2: {
default: "normal", default: "normal",
pc: "normal", pc: "normal",
mobile: "heading" mobile: "heading",
} },
} },
} },
}, },
header: { header: {
title: { title: {
@@ -276,7 +278,7 @@ export const sendDatabaseBackupNotifications = async ({
content: "", content: "",
}, },
template: type === "success" ? "green" : "red", template: type === "success" ? "green" : "red",
padding: "12px 12px 12px 12px" padding: "12px 12px 12px 12px",
}, },
body: { body: {
direction: "vertical", direction: "vertical",
@@ -293,23 +295,23 @@ export const sendDatabaseBackupNotifications = async ({
tag: "markdown", tag: "markdown",
content: `**Project:**\n${projectName}`, content: `**Project:**\n${projectName}`,
text_align: "left", text_align: "left",
text_size: "normal_v2" text_size: "normal_v2",
}, },
{ {
tag: "markdown", tag: "markdown",
content: `**Database Type:**\n${databaseType}`, content: `**Database Type:**\n${databaseType}`,
text_align: "left", text_align: "left",
text_size: "normal_v2" text_size: "normal_v2",
}, },
{ {
tag: "markdown", tag: "markdown",
content: `**Status:**\n${type === "success" ? "Successful" : "Failed"}`, content: `**Status:**\n${type === "success" ? "Successful" : "Failed"}`,
text_align: "left", text_align: "left",
text_size: "normal_v2" text_size: "normal_v2",
} },
], ],
vertical_align: "top", vertical_align: "top",
weight: 1 weight: 1,
}, },
{ {
tag: "column", tag: "column",
@@ -319,25 +321,25 @@ export const sendDatabaseBackupNotifications = async ({
tag: "markdown", tag: "markdown",
content: `**Application:**\n${applicationName}`, content: `**Application:**\n${applicationName}`,
text_align: "left", text_align: "left",
text_size: "normal_v2" text_size: "normal_v2",
}, },
{ {
tag: "markdown", tag: "markdown",
content: `**Database Name:**\n${databaseName}`, content: `**Database Name:**\n${databaseName}`,
text_align: "left", text_align: "left",
text_size: "normal_v2" text_size: "normal_v2",
}, },
{ {
tag: "markdown", tag: "markdown",
content: `**Date:**\n${format(date, "PP pp")}`, content: `**Date:**\n${format(date, "PP pp")}`,
text_align: "left", text_align: "left",
text_size: "normal_v2" text_size: "normal_v2",
} },
], ],
vertical_align: "top", vertical_align: "top",
weight: 1 weight: 1,
} },
] ],
}, },
...(type === "error" && truncatedErrorMessage ...(type === "error" && truncatedErrorMessage
? [ ? [
@@ -345,12 +347,12 @@ export const sendDatabaseBackupNotifications = async ({
tag: "markdown", tag: "markdown",
content: `**Error Message:**\n\`\`\`\n${truncatedErrorMessage}\n\`\`\``, content: `**Error Message:**\n\`\`\`\n${truncatedErrorMessage}\n\`\`\``,
text_align: "left", text_align: "left",
text_size: "normal_v2" text_size: "normal_v2",
} },
] ]
: []) : []),
], ],
} },
}, },
}); });
} }
@@ -37,7 +37,8 @@ export const sendDockerCleanupNotifications = async (
}); });
for (const notification of notificationList) { for (const notification of notificationList) {
const { email, discord, telegram, slack, gotify, ntfy, lark } = notification; const { email, discord, telegram, slack, gotify, ntfy, lark } =
notification;
if (email) { if (email) {
const template = await renderAsync( const template = await renderAsync(
@@ -150,10 +151,10 @@ export const sendDockerCleanupNotifications = async (
normal_v2: { normal_v2: {
default: "normal", default: "normal",
pc: "normal", pc: "normal",
mobile: "heading" mobile: "heading",
} },
} },
} },
}, },
header: { header: {
title: { title: {
@@ -165,7 +166,7 @@ export const sendDockerCleanupNotifications = async (
content: "", content: "",
}, },
template: "green", template: "green",
padding: "12px 12px 12px 12px" padding: "12px 12px 12px 12px",
}, },
body: { body: {
direction: "vertical", direction: "vertical",
@@ -182,17 +183,17 @@ export const sendDockerCleanupNotifications = async (
tag: "markdown", tag: "markdown",
content: `**Status:**\nSuccessful`, content: `**Status:**\nSuccessful`,
text_align: "left", text_align: "left",
text_size: "normal_v2" text_size: "normal_v2",
}, },
{ {
tag: "markdown", tag: "markdown",
content: `**Cleanup Details:**\n${message}`, content: `**Cleanup Details:**\n${message}`,
text_align: "left", text_align: "left",
text_size: "normal_v2" text_size: "normal_v2",
} },
], ],
vertical_align: "top", vertical_align: "top",
weight: 1 weight: 1,
}, },
{ {
tag: "column", tag: "column",
@@ -202,16 +203,16 @@ export const sendDockerCleanupNotifications = async (
tag: "markdown", tag: "markdown",
content: `**Date:**\n${format(date, "PP pp")}`, content: `**Date:**\n${format(date, "PP pp")}`,
text_align: "left", text_align: "left",
text_size: "normal_v2" text_size: "normal_v2",
} },
], ],
vertical_align: "top", vertical_align: "top",
weight: 1 weight: 1,
} },
]
}
], ],
} },
],
},
}, },
}); });
} }
@@ -31,7 +31,8 @@ export const sendDokployRestartNotifications = async () => {
}); });
for (const notification of notificationList) { for (const notification of notificationList) {
const { email, discord, telegram, slack, gotify, ntfy, lark } = notification; const { email, discord, telegram, slack, gotify, ntfy, lark } =
notification;
if (email) { if (email) {
const template = await renderAsync( const template = await renderAsync(
@@ -151,10 +152,10 @@ export const sendDokployRestartNotifications = async () => {
normal_v2: { normal_v2: {
default: "normal", default: "normal",
pc: "normal", pc: "normal",
mobile: "heading" mobile: "heading",
} },
} },
} },
}, },
header: { header: {
title: { title: {
@@ -166,7 +167,7 @@ export const sendDokployRestartNotifications = async () => {
content: "", content: "",
}, },
template: "green", template: "green",
padding: "12px 12px 12px 12px" padding: "12px 12px 12px 12px",
}, },
body: { body: {
direction: "vertical", direction: "vertical",
@@ -183,11 +184,11 @@ export const sendDokployRestartNotifications = async () => {
tag: "markdown", tag: "markdown",
content: `**Status:**\nSuccessful`, content: `**Status:**\nSuccessful`,
text_align: "left", text_align: "left",
text_size: "normal_v2" text_size: "normal_v2",
} },
], ],
vertical_align: "top", vertical_align: "top",
weight: 1 weight: 1,
}, },
{ {
tag: "column", tag: "column",
@@ -197,16 +198,16 @@ export const sendDokployRestartNotifications = async () => {
tag: "markdown", tag: "markdown",
content: `**Restart Time:**\n${format(date, "PP pp")}`, content: `**Restart Time:**\n${format(date, "PP pp")}`,
text_align: "left", text_align: "left",
text_size: "normal_v2" text_size: "normal_v2",
} },
], ],
vertical_align: "top", vertical_align: "top",
weight: 1 weight: 1,
} },
]
}
], ],
} },
],
},
}, },
}); });
} catch (error) { } catch (error) {
@@ -166,10 +166,10 @@ export const sendServerThresholdNotifications = async (
normal_v2: { normal_v2: {
default: "normal", default: "normal",
pc: "normal", pc: "normal",
mobile: "heading" mobile: "heading",
} },
} },
} },
}, },
header: { header: {
title: { title: {
@@ -181,7 +181,7 @@ export const sendServerThresholdNotifications = async (
content: "", content: "",
}, },
template: "red", template: "red",
padding: "12px 12px 12px 12px" padding: "12px 12px 12px 12px",
}, },
body: { body: {
direction: "vertical", direction: "vertical",
@@ -198,23 +198,23 @@ export const sendServerThresholdNotifications = async (
tag: "markdown", tag: "markdown",
content: `**Server Name:**\n${payload.ServerName}`, content: `**Server Name:**\n${payload.ServerName}`,
text_align: "left", text_align: "left",
text_size: "normal_v2" text_size: "normal_v2",
}, },
{ {
tag: "markdown", tag: "markdown",
content: `**Current Value:**\n${payload.Value.toFixed(2)}%`, content: `**Current Value:**\n${payload.Value.toFixed(2)}%`,
text_align: "left", text_align: "left",
text_size: "normal_v2" text_size: "normal_v2",
}, },
{ {
tag: "markdown", tag: "markdown",
content: `**Alert Message:**\n${payload.Message}`, content: `**Alert Message:**\n${payload.Message}`,
text_align: "left", text_align: "left",
text_size: "normal_v2" text_size: "normal_v2",
} },
], ],
vertical_align: "top", vertical_align: "top",
weight: 1 weight: 1,
}, },
{ {
tag: "column", tag: "column",
@@ -224,28 +224,28 @@ export const sendServerThresholdNotifications = async (
tag: "markdown", tag: "markdown",
content: `**Type:**\n${payload.Type === "CPU" ? "🔲" : "💾"} ${payload.Type}`, content: `**Type:**\n${payload.Type === "CPU" ? "🔲" : "💾"} ${payload.Type}`,
text_align: "left", text_align: "left",
text_size: "normal_v2" text_size: "normal_v2",
}, },
{ {
tag: "markdown", tag: "markdown",
content: `**Threshold:**\n${payload.Threshold.toFixed(2)}%`, content: `**Threshold:**\n${payload.Threshold.toFixed(2)}%`,
text_align: "left", text_align: "left",
text_size: "normal_v2" text_size: "normal_v2",
}, },
{ {
tag: "markdown", tag: "markdown",
content: `**Alert Time:**\n${date.toLocaleString()}`, content: `**Alert Time:**\n${date.toLocaleString()}`,
text_align: "left", text_align: "left",
text_size: "normal_v2" text_size: "normal_v2",
} },
], ],
vertical_align: "top", vertical_align: "top",
weight: 1 weight: 1,
} },
]
}
], ],
} },
],
},
}, },
}); });
} }