mirror of
https://github.com/nicotsx/ironmount.git
synced 2025-12-10 12:10:51 +01:00
feat(notifications): native support for pushover
This commit is contained in:
24
app/server/modules/notifications/builders/pushover.ts
Normal file
24
app/server/modules/notifications/builders/pushover.ts
Normal file
@@ -0,0 +1,24 @@
|
||||
import type { NotificationConfig } from "~/schemas/notifications";
|
||||
|
||||
export function buildPushoverShoutrrrUrl(
|
||||
config: Extract<NotificationConfig, { type: "pushover" }>,
|
||||
): string {
|
||||
const params = new URLSearchParams();
|
||||
|
||||
if (config.devices) {
|
||||
params.append("devices", config.devices);
|
||||
}
|
||||
|
||||
if (config.priority !== undefined) {
|
||||
params.append("priority", config.priority.toString());
|
||||
}
|
||||
|
||||
const queryString = params.toString();
|
||||
let shoutrrrUrl = `pushover://shoutrrr:${config.apiToken}@${config.userKey}/`;
|
||||
|
||||
if (queryString) {
|
||||
shoutrrrUrl += `?${queryString}`;
|
||||
}
|
||||
|
||||
return shoutrrrUrl;
|
||||
}
|
||||
Reference in New Issue
Block a user