feat(FN-4078): add ntfy access token support to notifications

Adds ntfy access token support to Fusion's notification system, wiring the token through the core settings schema, dashboard UI (SettingsModal), engine notifier, and notification pipeline, with corresponding tests across core, dashboard, and engine packages; also updates settings and storage documen

Fusion-Task-Id: FN-4078
This commit is contained in:
Fusion
2026-05-12 07:05:43 -07:00
committed by gsxdsm
parent bbc9111ff6
commit 7ca8d5ab50
17 changed files with 312 additions and 15 deletions

View File

@@ -169,6 +169,7 @@ describe("GlobalSettingsStore", () => {
// Defaults are filled in for missing fields
expect(settings.ntfyEnabled).toBe(false);
expect(settings.ntfyBaseUrl).toBeUndefined();
expect(settings.ntfyAccessToken).toBeUndefined();
expect(settings.defaultProvider).toBeUndefined();
});
@@ -260,6 +261,23 @@ describe("GlobalSettingsStore", () => {
expect(settings.ntfyTopic).toBeUndefined();
});
it("clearing ntfyAccessToken with null removes it from disk and returns undefined", async () => {
await store.init();
await store.updateSettings({ ntfyAccessToken: "secret-token" });
const raw = JSON.parse(await readFile(join(dir, "settings.json"), "utf-8"));
expect(raw.ntfyAccessToken).toBe("secret-token");
// @ts-expect-error - null is intentionally used to clear field (null-as-delete)
await store.updateSettings({ ntfyAccessToken: null });
const rawAfter = JSON.parse(await readFile(join(dir, "settings.json"), "utf-8"));
expect(rawAfter.ntfyAccessToken).toBeUndefined();
const settings = await store.getSettings();
expect(settings.ntfyAccessToken).toBeUndefined();
});
it("clearing ntfyDashboardHost with null removes it from disk", async () => {
await store.init();
await store.updateSettings({ ntfyDashboardHost: "https://dashboard.example.com" });