feat: update version to 0.0.3 and modify notify method to return boolean

This commit is contained in:
2026-01-08 16:49:44 +08:00
parent 6cf949bcd1
commit c2c3224a42
2 changed files with 5 additions and 3 deletions

View File

@@ -1,6 +1,6 @@
{ {
"name": "@kevisual/notifier", "name": "@kevisual/notifier",
"version": "0.0.2", "version": "0.0.3",
"description": "", "description": "",
"main": "index.js", "main": "index.js",
"basename": "/root/notifier", "basename": "/root/notifier",

View File

@@ -11,7 +11,7 @@ export class FeishuNotifier implements Notification {
this.webhook = config.webhook; this.webhook = config.webhook;
} }
async notify(message: string): Promise<void> { async notify(message: string): Promise<boolean> {
const payload = { const payload = {
msg_type: 'text', msg_type: 'text',
content: { content: {
@@ -28,7 +28,9 @@ export class FeishuNotifier implements Notification {
}); });
if (!response.ok) { if (!response.ok) {
throw new Error(`飞书推送失败: ${response.statusText}`); console.error(`飞书推送失败: ${response.statusText}`);
} return false;
}
return true;
} }
} }