Files
rosalia-nightsong/package.json
T
hikari 9db206ebbc
Node.js CI / CI (push) Successful in 21s
Security Scan and Upload / Security & DefectDojo Upload (push) Successful in 1m41s
feat: Update Error Notifications with ComponentsV2 (#14)
## Summary

This PR updates Rosalia's Discord error notifications to use Discord's Components V2 for a beautiful, organized display.

### Changes Made

- **Removed @mention** - Error notifications no longer ping anyone
- **Updated channel** - Notifications now go to the correct channel (1474606829504954511)
- **Implemented ComponentsV2** - Using Container (type 17) with Text Display (type 10) components
- **Visual improvements**:
  - Added accent color (#E91E63) for the container
  - Added separators (type 14) between sections
  - Organized content with headers for scope, message, and stack trace
  - Code blocks for message and stack trace

### Technical Changes

1. **`src/modules/pipeLog.ts`**:
   - Created `PipeErrorOptions` and `DiscordErrorPayloadOptions` interfaces
   - Refactored `pipeError` to accept options object
   - Extracted payload creation into `createDiscordErrorPayload` helper
   - Implemented ComponentsV2 structure with container, text displays, and separators

2. **`src/utils/errorHandler.ts`**:
   - Updated error handler to use new `pipeError` interface

3. **`src/server/serve.ts`**:
   - Updated `/error` webhook endpoint to use new interface

 Created by Hikari~ 🌸

Reviewed-on: #14
Co-authored-by: Hikari <hikari@nhcarrigan.com>
Co-committed-by: Hikari <hikari@nhcarrigan.com>
2026-02-20 20:08:45 -08:00

32 lines
841 B
JSON

{
"name": "alert-server",
"version": "1.0.0",
"description": "A web server that sends alerts to our logging inbox.",
"main": "index.js",
"type": "module",
"scripts": {
"build": "rm -rf prod && tsc",
"lint": "eslint src --max-warnings 0",
"start": "op run --env-file=prod.env --no-masking -- node prod/index.js",
"test": "echo \"Error: no test specified\" && exit 0"
},
"keywords": [],
"author": "Naomi Carrigan",
"license": "See license in LICENSE.md",
"devDependencies": {
"@nhcarrigan/eslint-config": "5.1.0",
"@nhcarrigan/typescript-config": "4.0.0",
"@types/node": "22.13.1",
"@types/nodemailer": "6.4.17",
"eslint": "9.20.0",
"typescript": "5.7.3"
},
"dependencies": {
"discord-verify": "1.2.0",
"fastify": "5.2.1",
"fastify-raw-body": "5.0.0",
"nodemailer": "6.10.0",
"stripe": "18.3.0"
}
}