Merge c1cffc53c8eb932b71a48be46b07f663b1f8e83d into 8a05c05596ca9ba0735dafd8e359885de4c2c969

This commit is contained in:
Saurabh Mishra 2026-03-21 06:48:55 +01:00 committed by GitHub
commit 8635c50af8
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -49,7 +49,7 @@ export async function sendMessage(
incomingUrl: string,
text: string,
userId?: string | number,
allowInsecureSsl = true,
allowInsecureSsl = false,
): Promise<boolean> {
// Synology Chat API requires user_ids (numeric) to specify the recipient
// The @mention is optional but user_ids is mandatory
@ -90,7 +90,7 @@ export async function sendFileUrl(
incomingUrl: string,
fileUrl: string,
userId?: string | number,
allowInsecureSsl = true,
allowInsecureSsl = false,
): Promise<boolean> {
const body = buildWebhookBody({ file_url: fileUrl }, userId);
@ -112,7 +112,7 @@ export async function sendFileUrl(
*/
export async function fetchChatUsers(
incomingUrl: string,
allowInsecureSsl = true,
allowInsecureSsl = false,
log?: { warn: (...args: unknown[]) => void },
): Promise<ChatUser[]> {
const now = Date.now();
@ -187,7 +187,7 @@ export async function fetchChatUsers(
export async function resolveChatUserId(
incomingUrl: string,
webhookUsername: string,
allowInsecureSsl = true,
allowInsecureSsl = false,
log?: { warn: (...args: unknown[]) => void },
): Promise<number | undefined> {
const users = await fetchChatUsers(incomingUrl, allowInsecureSsl, log);
@ -220,7 +220,7 @@ function parseNumericUserId(userId?: string | number): number | undefined {
return Number.isNaN(numericId) ? undefined : numericId;
}
function doPost(url: string, body: string, allowInsecureSsl = true): Promise<boolean> {
function doPost(url: string, body: string, allowInsecureSsl = false): Promise<boolean> {
return new Promise((resolve, reject) => {
let parsedUrl: URL;
try {