diff --git a/docs/dev/notifications.md b/docs/dev/notifications.md index 3b8658ddb..9ea8b0efa 100644 --- a/docs/dev/notifications.md +++ b/docs/dev/notifications.md @@ -31,11 +31,15 @@ Each notification has a structure that includes the following fields: ```json { "title": "string", // e.g., "Geth Ethereum Node Sync Status" - "body": "string", // e.g., "Triggered: Geth Ethereum Node Syncing" + "body": "string", // e.g., "Geth Ethereum Node Syncing" "category": "string", // e.g., "ethereum" "dnpName": "string", // e.g., "geth.dnp.dappnode.eth" "seen": false, // e.g., false "timestamp": "string", // e.g., "2023-10-01T12:00:00Z" + "priority": "string", // e.g., "medium" + "status": "string", // e.g., "triggered" + "correlationId": "string", // e.g., "geth-eth-syncing" + "isBanner": false, // e.g., false "callToAction": { "title": "string", // e.g., "View Logs" "url": "string" // e.g., "http://dappmanager.dappnode/packages/my/geth.dnp.dappnode.eth/logs" @@ -66,11 +70,14 @@ curl -X POST \ "body": "This is a test notification sent with curl", "category": "other", "dnpName": "test.dnp.dappnode.eth", + "priority": "low", + "status": "triggered", "callToAction": { "title": "Hello World", "url": "http://dappmanager.dappnode" }, - "icon": "https://gateway.ipfs.dappnode.io/ipfs/QmTVc5LQkTuaN3VxcteQ2E27pHSVJakE6XPo2FMxQTP284" + "correlationId": "testPkg-test", + "isBanner": false }' ``` diff --git a/docs/dev/references/notifications.md b/docs/dev/references/notifications.md index f4d504188..35d18e384 100644 --- a/docs/dev/references/notifications.md +++ b/docs/dev/references/notifications.md @@ -33,6 +33,9 @@ endpoints: definition: title: "Mainnet ETH Node Synced Check" # Notifications - settings: title of the notification to be configured description: "Check if the Mainnet ETH Node is synced. You will receive a notification if the node is syncing and another one when it is synced." # Notifications - settings: description of the notification to be configured + correlationId: "geth-eth-syncing" # Unique identifier for each notification endpoint + isBanner: false + priority: "medium" alerts: - type: custom enabled: true @@ -51,6 +54,9 @@ An array of configured notification endpoints. Each endpoint object includes: - **`conditions`** (`string[]`, required): Array of string expressions representing the conditions that trigger the alert. - **`interval`** (`string`, required): Time between checks. Must match the pattern `^[0-9]+[smhd]$` (e.g., `10s`, `5m`, `1h`, `1d`). - **`group`** (`string`, required): Group to which the endpoint belongs. +- **`correlationId`** (`string`, required): It is the unique identifier that links triggered and resolved notifications based on their endpoint. +- **`isBanner`** (`boolean`, required): Boolean that controls whether a banner displaying the notification appears at the top of the DAppManager UI. Should be set to `true` only for relevant notifications. +- **`priority`** (`string`, required): Priority that will be displayed on the notification. One of: `low`, `medium`, `high`, `critical`. - **`alerts`** (`array`, required): List of alert configurations for this endpoint. Each alert object includes: @@ -105,6 +111,8 @@ The response will include the manifest with user settings for custom endpoints: ```yaml customEndpoints: - name: "Package updates notifications" + isBanner: false + correlationId: "dappmanager-update-pkg" description: "Receive package updates notifications when a new version is available." enabled: true ``` @@ -114,6 +122,8 @@ Each object includes: - **`enabled`** (`boolean`, required): Whether the custom endpoint is active. - **`name`** (`string`, required): Unique name for the custom metric. - **`description`** (`string`, required): Explanation of the custom metric. +- **`correlationId`** (`string`, required): It is the unique identifier that links triggered and resolved notifications based on their endpoint. +- **`isBanner`** (`boolean`, required): Boolean that controls whether a banner displaying the notification appears at the top of the DAppManager UI. Should be set to `true` only for relevant notifications. - **`metric`** (`object`, optional): Metric boundaries and unit. - **`treshold`** (`number`, optional): Threshold value to trigger alert (note: possibly a typo, intended to be `threshold`). - **`min`** (`number`, optional): Minimum acceptable value.