Add: Backup notification (#3225)

* Formatting updates

* Add: backup completion notification

* Fix: comment for backup

* Add: backup size units to notification

* Add: failed backup notification

* Add: calls to failed backup notification

* Update: notification OpenAPI spec

* Update notifications to first check if any are active for an event, update JS docs

---------

Co-authored-by: advplyr <advplyr@protonmail.com>
This commit is contained in:
Nicholas W 2024-08-18 14:32:05 -05:00 committed by GitHub
parent 5308fd8b46
commit 27b3a44147
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
7 changed files with 144 additions and 25 deletions

View file

@ -27,6 +27,36 @@ module.exports.notificationData = {
episodeDescription: 'Some description of the podcast episode.'
}
},
{
name: 'onBackupCompleted',
requiresLibrary: false,
description: 'Triggered when a backup is completed',
variables: ['completionTime', 'backupPath', 'backupSize', 'backupCount', 'removedOldest'],
defaults: {
title: 'Backup Completed',
body: 'Backup has been completed successfully.\n\nPath: {{backupPath}}\nSize: {{backupSize}} bytes\nCount: {{backupCount}}\nRemoved Oldest: {{removedOldest}}'
},
testData: {
completionTime: '12:00 AM',
backupPath: 'path/to/backup',
backupSize: '1.23 MB',
backupCount: '1',
removedOldest: 'false'
}
},
{
name: 'onBackupFailed',
requiresLibrary: false,
description: 'Triggered when a backup fails',
variables: ['errorMsg'],
defaults: {
title: 'Backup Failed',
body: 'Backup failed, check ABS logs for more information.\nError message: {{errorMsg}}'
},
testData: {
errorMsg: 'Example error message'
}
},
{
name: 'onTest',
requiresLibrary: false,