mirror of
https://github.com/callumalpass/tasknotes.git
synced 2026-07-22 12:50:26 +00:00
- Add comprehensive error messages for transform file loading failures - Include file path validation and existence checking - Add function validation warnings for missing transform functions - Provide step-by-step logging for transform execution - Add minimal transform examples for Discord and Slack Fixes silent failures that made debugging transform issues difficult. Addresses issue #719 where users couldn't identify why transform scripts weren't loading.
28 lines
No EOL
619 B
JavaScript
28 lines
No EOL
619 B
JavaScript
/**
|
|
* Minimal Discord Webhook Transform for TaskNotes
|
|
* This is the simplest possible transform for Discord webhooks
|
|
*/
|
|
|
|
console.log("🔥 transform file loaded");
|
|
|
|
function transform(payload) {
|
|
const { event, data } = payload;
|
|
|
|
// Simple Discord message format
|
|
if (event === 'task.created') {
|
|
return {
|
|
content: `📝 New task: **${data.task.title}**`
|
|
};
|
|
}
|
|
|
|
if (event === 'task.completed') {
|
|
return {
|
|
content: `✅ Completed: **${data.task.title}**`
|
|
};
|
|
}
|
|
|
|
// For all other events, return a generic message
|
|
return {
|
|
content: `TaskNotes: ${event} event triggered`
|
|
};
|
|
} |