@dsh-plus/notify-email 0.1.12 → 0.1.14
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/client.js +61140 -21
- package/lib/index.js +10 -9
- package/lib/style.css +1627 -0
- package/package.json +15 -15
- package/src/client/client.ts +2 -2
- package/src/config.ts +2 -3
- package/src/ns.ts +4 -3
- package/src/service.ts +11 -7
package/lib/index.js
CHANGED
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import { installSettingsSection, settingsNamespace } from "@deepseek-ai/dsh-settings";
|
|
2
1
|
import z from "@deepseek-ai/schemastery";
|
|
3
2
|
import { Context, Service } from "@deepseek-ai/cordis";
|
|
4
3
|
import { dshHomePath } from "@deepseek-ai/dsh-home-paths";
|
|
@@ -13,8 +12,8 @@ import nodemailer from "nodemailer";
|
|
|
13
12
|
* 共用同一 schemastery schema。SMTP 密码标记 secret 角色,任何读取通道不得回传。
|
|
14
13
|
* @module notify-email/config
|
|
15
14
|
*/
|
|
16
|
-
/** settings
|
|
17
|
-
const SETTINGS_NS =
|
|
15
|
+
/** settings 命名空间(字面量即合法命名空间,0.1.2-alpha.2 起编译期校验;webui 配置卡片与插件运行期读取同一份)。 */
|
|
16
|
+
const SETTINGS_NS = "dsh-plus-notify-email";
|
|
18
17
|
const SmtpSchema = z.object({
|
|
19
18
|
host: z.string().description("SMTP 服务器主机名").default(""),
|
|
20
19
|
port: z.natural().max(65535).description("SMTP 端口").default(465),
|
|
@@ -409,7 +408,7 @@ function installTurnEndWatcher(ctx, service, resolveConfig) {
|
|
|
409
408
|
//#region src/service.ts
|
|
410
409
|
/**
|
|
411
410
|
* NotifyEmailService:通知编排中枢。
|
|
412
|
-
* - 配置:
|
|
411
|
+
* - 配置:settings.installSection 接入 settings 用户层($DSH_HOME/settings.yaml,热生效),
|
|
413
412
|
* 无 settings provider 时退化为 cordis 行级 config。
|
|
414
413
|
* - 触发器:registerTrigger 是第三方插件的扩展接口;内置官方适配器同路径注册。
|
|
415
414
|
* - 投递:首个非空 EmailNotice 经 Mailer 发送;单个触发器抛错不影响其余。
|
|
@@ -423,11 +422,13 @@ var NotifyEmailService = class extends Service {
|
|
|
423
422
|
constructor(ctx, config) {
|
|
424
423
|
super(ctx, "notifyEmail");
|
|
425
424
|
this.current = () => config;
|
|
426
|
-
|
|
427
|
-
|
|
428
|
-
|
|
429
|
-
|
|
430
|
-
|
|
425
|
+
ctx.inject(["settings"], (settingsCtx) => {
|
|
426
|
+
settingsCtx.settings.installSection(ctx, SETTINGS_NS, Config, config, {
|
|
427
|
+
setSource: (source) => {
|
|
428
|
+
this.current = source;
|
|
429
|
+
},
|
|
430
|
+
onChange: () => {}
|
|
431
|
+
});
|
|
431
432
|
});
|
|
432
433
|
const logger = ctx.logger("notify-email");
|
|
433
434
|
const audit = createJsonlAuditSink(dshHomePath("logs", "notify-email.jsonl"), (message) => logger.warn(`audit write failed: ${message}`));
|