perf: 在线插件支持通知类型

This commit is contained in:
xiaojunnuo
2026-08-22 01:47:21 +08:00
parent e79660c5d1
commit c0f194f443
@@ -190,3 +190,39 @@ return class DemoDnsProvider extends AbstractDnsProvider {
content: script,
};
}
export function getDefaultNotificationPlugin() {
const metadata = `
input: # 通知插件的输入参数
title:
title: 通知标题
component:
name: a-input
required: false
content:
title: 通知内容
component:
name: a-textarea
required: true
`;
const script = `
// 必须使用 await import 来引入模块
const { BaseNotification } = await import("@certd/pipeline")
// 需要返回一个继承BaseNotification的类
return class DemoNotification extends BaseNotification {
// 通知输入参数,对应左边 input 配置
// async send(body){
// // body.title: 通知标题
// // body.content: 通知内容
// // this.logger.info("title:", body.title)
// // 调用第三方 API 发送通知
// }
}
`;
return {
metadata: metadata,
content: script,
};
}