Commit graph

3 commits

Author SHA1 Message Date
Callum Alpass
ffaa38878a feat(webhooks): add comprehensive webhook testing server
- Create standalone Node.js webhook test server
- Implement HMAC signature verification for security testing
- Add support for all webhook event types with detailed logging
- Include CORS headers and preflight request handling
- Provide clear setup instructions and configuration examples
- Add real-time webhook payload inspection and validation
- Support both development and production webhook testing scenarios
2025-08-13 10:42:46 +10:00
Callum Alpass
f432c2d334 feat(webhooks): add reminder.triggered event for notification integrations
Add webhook support for TaskNotes reminder/notification system to enable
external integrations when reminders fire.

**Changes:**
- Add `reminder.triggered` webhook event type to types.ts
- Trigger webhook in NotificationService.triggerNotification() method
- Include comprehensive reminder payload data:
  - Task information
  - Reminder details (type, timing, message)
  - Notification metadata (time, type, message)
- Update webhook modal to include reminder events
- Add reminder webhook documentation with integration examples
- Update test webhook server to handle reminder events

**Webhook Payload:**
The reminder.triggered event includes:
- Full task context
- Reminder configuration (relative/absolute, offset, description)
- Actual notification time and message sent
- Notification type (system/in-app) used

**Integration Examples:**
- Mobile push notifications
- Smart home system alerts
- Cross-platform reminder sync
- Custom notification routing

This enables external systems to receive real-time notifications when
TaskNotes reminders fire, perfect for mobile apps, smart home integration,
or custom notification systems that extend beyond Obsidian.
2025-08-12 20:13:25 +10:00
Callum Alpass
cf301b0935 feat(api): add webhook support for real-time event notifications
Webhooks enable real-time integrations by sending HTTP POST requests to
configured
endpoints when TaskNotes events occur. This opens up powerful automation
and
sync capabilities for external services.

**New Webhook Features:**
- Complete webhook management system with CRUD operations
- 12+ event types covering tasks, time tracking, and pomodoro sessions
- HMAC-SHA256 signature verification for security
- Automatic retries with exponential backoff
- Delivery tracking and failure monitoring
- Auto-disable after repeated failures

**Event Types:**
- Task events: created, updated, deleted, completed, archived,
unarchived
- Time tracking: started, stopped
- Pomodoro: started, completed, interrupted
- Recurring: instance completed

**API Endpoints:**
- POST /api/webhooks - Register new webhook
- GET /api/webhooks - List configured webhooks
- DELETE /api/webhooks/{id} - Remove webhook
- GET /api/webhooks/deliveries - View delivery history

**Settings Integration:**
- Webhook management UI in HTTP API settings tab
- Event subscription selection
- Enable/disable individual webhooks
- Success/failure statistics display

**Security & Reliability:**
- HMAC signatures for payload verification
- 10-second timeout per delivery
- 3 automatic retries with backoff
- Webhook secrets auto-generated
- Non-blocking async delivery

**Documentation:**
- Comprehensive webhook guide with examples
- Integration patterns for popular services
- Security best practices
- Testing utilities and sample code

**Testing:**
- Webhook test server (test-webhook.js)
- Signature verification examples
- Debug logging and monitoring

This enables powerful integrations like:
- Real-time sync with Todoist, TickTick, Notion
- Slack/Discord notifications
- Time tracking integration (Toggl, Clockify)
- Custom automation workflows
- Analytics and reporting dashboards

The webhook system is designed to be reliable, secure, and performant
while
maintaining TaskNotes' core responsiveness.
2025-08-12 20:13:25 +10:00