@dsh-plus/notify-email 0.1.3 → 0.1.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/index.d.ts +8 -0
- package/lib/index.js +4 -0
- package/package.json +1 -1
- package/src/service.ts +5 -0
package/lib/index.d.ts
CHANGED
|
@@ -138,6 +138,14 @@ declare class NotifyEmailService extends Service {
|
|
|
138
138
|
ok: boolean;
|
|
139
139
|
detail: string;
|
|
140
140
|
}>;
|
|
141
|
+
/** 通用直发接口(如 lifeboat 故障告警):走正常 enabled/完整性门禁。 */
|
|
142
|
+
sendNotice(notice: {
|
|
143
|
+
subject: string;
|
|
144
|
+
text: string;
|
|
145
|
+
}): Promise<{
|
|
146
|
+
ok: boolean;
|
|
147
|
+
detail: string;
|
|
148
|
+
}>;
|
|
141
149
|
private dispatch;
|
|
142
150
|
}
|
|
143
151
|
//#endregion
|
package/lib/index.js
CHANGED
|
@@ -452,6 +452,10 @@ var NotifyEmailService = class extends Service {
|
|
|
452
452
|
text: "这是一封来自 dsh notify-email 插件的测试邮件。"
|
|
453
453
|
}, true);
|
|
454
454
|
}
|
|
455
|
+
/** 通用直发接口(如 lifeboat 故障告警):走正常 enabled/完整性门禁。 */
|
|
456
|
+
async sendNotice(notice) {
|
|
457
|
+
return this.mailer.send(notice);
|
|
458
|
+
}
|
|
455
459
|
async dispatch(kind, payload, produce) {
|
|
456
460
|
for (const trigger of [...this.triggers]) {
|
|
457
461
|
let notice;
|
package/package.json
CHANGED
package/src/service.ts
CHANGED
|
@@ -94,6 +94,11 @@ export class NotifyEmailService extends Service {
|
|
|
94
94
|
)
|
|
95
95
|
}
|
|
96
96
|
|
|
97
|
+
/** 通用直发接口(如 lifeboat 故障告警):走正常 enabled/完整性门禁。 */
|
|
98
|
+
async sendNotice(notice: { subject: string; text: string }): Promise<{ ok: boolean; detail: string }> {
|
|
99
|
+
return this.mailer.send(notice)
|
|
100
|
+
}
|
|
101
|
+
|
|
97
102
|
private async dispatch<T>(
|
|
98
103
|
kind: string,
|
|
99
104
|
payload: T,
|