@dsh-plus/notify-email 0.1.0 → 0.1.1
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 +13 -1
- package/lib/index.js +14 -2
- package/package.json +9 -9
- package/src/client/client.ts +5 -1
- package/src/config.ts +4 -2
- package/src/ns.ts +9 -0
package/lib/client.js
CHANGED
|
@@ -32,6 +32,18 @@ react = __toESM(react);
|
|
|
32
32
|
let react_jsx_runtime = require("react/jsx-runtime");
|
|
33
33
|
react_jsx_runtime = __toESM(react_jsx_runtime);
|
|
34
34
|
|
|
35
|
+
//#region src/ns.ts
|
|
36
|
+
/**
|
|
37
|
+
* settings 命名空间字面量(纯常量,零依赖,浏览器半可安全引入)。
|
|
38
|
+
* 服务端经 settingsNamespace() 品牌化后使用(config.ts),浏览器半将其作为
|
|
39
|
+
* settings.plugin.item keyed 槽位的 key —— 同一字面量两处共用,防止漂移。
|
|
40
|
+
* 契约:dsh rc7 起该槽位按「卡片编辑的 settings 命名空间」作 key 分发,
|
|
41
|
+
* 官方配置页只渲染 key 命中 Host 已注册命名空间的卡片。
|
|
42
|
+
* @module notify-email/ns
|
|
43
|
+
*/
|
|
44
|
+
const SETTINGS_NS = "dsh-plus-notify-email";
|
|
45
|
+
|
|
46
|
+
//#endregion
|
|
35
47
|
//#region src/client/api.ts
|
|
36
48
|
const ROUTE_CONFIG = "/dsh-plus/notify-email/config";
|
|
37
49
|
const ROUTE_TEST = "/dsh-plus/notify-email/test";
|
|
@@ -608,7 +620,7 @@ function apply(ctx) {
|
|
|
608
620
|
}), "notify-email: locale");
|
|
609
621
|
c.slots.inject("settings.plugin.item", () => c.slots.register({
|
|
610
622
|
name: "settings.plugin.item",
|
|
611
|
-
|
|
623
|
+
key: SETTINGS_NS,
|
|
612
624
|
order: 100,
|
|
613
625
|
locale: NS,
|
|
614
626
|
inject: () => ({ t: c.locale.bind(NS) })
|
package/lib/index.js
CHANGED
|
@@ -6,9 +6,21 @@ import { appendFile, mkdir } from "node:fs/promises";
|
|
|
6
6
|
import { dirname } from "node:path";
|
|
7
7
|
import nodemailer from "nodemailer";
|
|
8
8
|
|
|
9
|
+
//#region src/ns.ts
|
|
10
|
+
/**
|
|
11
|
+
* settings 命名空间字面量(纯常量,零依赖,浏览器半可安全引入)。
|
|
12
|
+
* 服务端经 settingsNamespace() 品牌化后使用(config.ts),浏览器半将其作为
|
|
13
|
+
* settings.plugin.item keyed 槽位的 key —— 同一字面量两处共用,防止漂移。
|
|
14
|
+
* 契约:dsh rc7 起该槽位按「卡片编辑的 settings 命名空间」作 key 分发,
|
|
15
|
+
* 官方配置页只渲染 key 命中 Host 已注册命名空间的卡片。
|
|
16
|
+
* @module notify-email/ns
|
|
17
|
+
*/
|
|
18
|
+
const SETTINGS_NS$1 = "dsh-plus-notify-email";
|
|
19
|
+
|
|
20
|
+
//#endregion
|
|
9
21
|
//#region src/config.ts
|
|
10
|
-
/** settings 命名空间;webui
|
|
11
|
-
const SETTINGS_NS = settingsNamespace(
|
|
22
|
+
/** settings 命名空间;webui 配置卡片与插件运行期读取同一份(字面量见 ./ns.ts)。 */
|
|
23
|
+
const SETTINGS_NS = settingsNamespace(SETTINGS_NS$1);
|
|
12
24
|
const SmtpSchema = z.object({
|
|
13
25
|
host: z.string().description("SMTP 服务器主机名").default(""),
|
|
14
26
|
port: z.natural().max(65535).description("SMTP 端口").default(465),
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@dsh-plus/notify-email",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.1",
|
|
4
4
|
"description": "dsh-plus service+ui plugin: 任务结束/等待决策/出错时向指定邮箱发送邮件通知",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "lib/index.js",
|
|
@@ -31,17 +31,17 @@
|
|
|
31
31
|
},
|
|
32
32
|
"dependencies": {
|
|
33
33
|
"@deepseek-ai/cordis": "4.0.1",
|
|
34
|
-
"@deepseek-ai/dsh-home-paths": "0.1.0-rc.
|
|
35
|
-
"@deepseek-ai/dsh-settings": "0.1.0-rc.
|
|
34
|
+
"@deepseek-ai/dsh-home-paths": "0.1.0-rc.7",
|
|
35
|
+
"@deepseek-ai/dsh-settings": "0.1.0-rc.7",
|
|
36
36
|
"@deepseek-ai/schemastery": "3.18.1",
|
|
37
37
|
"nodemailer": "9.0.5"
|
|
38
38
|
},
|
|
39
39
|
"devDependencies": {
|
|
40
|
-
"@deepseek-ai/dsh-agent": "0.1.0-rc.
|
|
41
|
-
"@deepseek-ai/dsh-host-webserver": "0.1.0-rc.
|
|
42
|
-
"@deepseek-ai/dsh-llm": "0.1.0-rc.
|
|
43
|
-
"@deepseek-ai/dsh-session": "0.1.0-rc.
|
|
44
|
-
"@deepseek-ai/dsh-tools": "0.1.0-rc.
|
|
40
|
+
"@deepseek-ai/dsh-agent": "0.1.0-rc.7",
|
|
41
|
+
"@deepseek-ai/dsh-host-webserver": "0.1.0-rc.7",
|
|
42
|
+
"@deepseek-ai/dsh-llm": "0.1.0-rc.7",
|
|
43
|
+
"@deepseek-ai/dsh-session": "0.1.0-rc.7",
|
|
44
|
+
"@deepseek-ai/dsh-tools": "0.1.0-rc.7",
|
|
45
45
|
"@types/nodemailer": "8.0.1",
|
|
46
46
|
"@types/react": "~18.3.1",
|
|
47
47
|
"react": "^18.2.0"
|
|
@@ -52,7 +52,7 @@
|
|
|
52
52
|
"license": "MIT",
|
|
53
53
|
"repository": {
|
|
54
54
|
"type": "git",
|
|
55
|
-
"url": "git+https://github.com/A-G-guy/dsh-
|
|
55
|
+
"url": "git+https://github.com/A-G-guy/dsh-plus.git",
|
|
56
56
|
"directory": "packages/notify-email"
|
|
57
57
|
},
|
|
58
58
|
"scripts": {
|
package/src/client/client.ts
CHANGED
|
@@ -6,10 +6,14 @@
|
|
|
6
6
|
* 类型说明:浏览器半只用到 slots/locale 的很窄一面,此处以最小本地接口声明,
|
|
7
7
|
* 避免为构建期类型引入整条官方 client 依赖树;运行时契约以官方
|
|
8
8
|
* dsh-client-ui-settings-plugins 的 settings.plugin.item 插槽为准。
|
|
9
|
+
* rc7 起该插槽为 keyed 槽位:key 必须是卡片编辑的 settings 命名空间
|
|
10
|
+
* (即服务端 settingsNamespace() 注册的同一字面量,见 ../ns.ts),
|
|
11
|
+
* 官方配置页按此 key 与 Host 已注册命名空间配对分发。
|
|
9
12
|
* @module @dsh-plus/notify-email/client
|
|
10
13
|
*/
|
|
11
14
|
import type { Context } from '@deepseek-ai/cordis'
|
|
12
15
|
|
|
16
|
+
import { SETTINGS_NS } from '../ns.ts'
|
|
13
17
|
import { NotifyEmailCard } from './card.tsx'
|
|
14
18
|
import { en, NS, zh } from './i18n.ts'
|
|
15
19
|
import { injectStyle } from './styles.ts'
|
|
@@ -52,7 +56,7 @@ export function apply(ctx: Context): void {
|
|
|
52
56
|
c.slots.register(
|
|
53
57
|
{
|
|
54
58
|
name: 'settings.plugin.item',
|
|
55
|
-
|
|
59
|
+
key: SETTINGS_NS,
|
|
56
60
|
order: 100,
|
|
57
61
|
locale: NS,
|
|
58
62
|
inject: () => ({ t: c.locale.bind(NS) }),
|
package/src/config.ts
CHANGED
|
@@ -7,8 +7,10 @@
|
|
|
7
7
|
import z from '@deepseek-ai/schemastery'
|
|
8
8
|
import { settingsNamespace } from '@deepseek-ai/dsh-settings'
|
|
9
9
|
|
|
10
|
-
|
|
11
|
-
|
|
10
|
+
import { SETTINGS_NS as NS_LITERAL } from './ns.ts'
|
|
11
|
+
|
|
12
|
+
/** settings 命名空间;webui 配置卡片与插件运行期读取同一份(字面量见 ./ns.ts)。 */
|
|
13
|
+
export const SETTINGS_NS = settingsNamespace(NS_LITERAL)
|
|
12
14
|
|
|
13
15
|
const SmtpSchema = z.object({
|
|
14
16
|
host: z.string().description('SMTP 服务器主机名').default(''),
|
package/src/ns.ts
ADDED
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* settings 命名空间字面量(纯常量,零依赖,浏览器半可安全引入)。
|
|
3
|
+
* 服务端经 settingsNamespace() 品牌化后使用(config.ts),浏览器半将其作为
|
|
4
|
+
* settings.plugin.item keyed 槽位的 key —— 同一字面量两处共用,防止漂移。
|
|
5
|
+
* 契约:dsh rc7 起该槽位按「卡片编辑的 settings 命名空间」作 key 分发,
|
|
6
|
+
* 官方配置页只渲染 key 命中 Host 已注册命名空间的卡片。
|
|
7
|
+
* @module notify-email/ns
|
|
8
|
+
*/
|
|
9
|
+
export const SETTINGS_NS = 'dsh-plus-notify-email'
|