@microi.net/cli 5.5.4 → 5.5.5

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.
@@ -0,0 +1,34 @@
1
+ # V8.Email 协议原子
2
+
3
+ 业务编排使用接口引擎,下面的方法只供可信后端调用。
4
+ 连接对象字段为 `Host`、`Port`、`Security`、`UserName`、`Credential`、`Timeout`。
5
+ `Credential` 必须是 `V8.Email.ProtectCredential` 产生的当前租户密文。
6
+ `Security` 仅允许 `SslOnConnect`、`StartTls`。超时默认 40 秒,最高 60 秒。
7
+
8
+ | 方法 | 输入补充 | 返回 Data |
9
+ | --- | --- | --- |
10
+ | `V8.Email.ProtectCredential(value)` | 原文授权码 | 直接返回带版本前缀的租户密文字符串 |
11
+ | `V8.Email.TestConnection(p)` | `Protocol: IMAP / SMTP` | `Connected, Protocol, Secure` |
12
+ | `V8.Email.ListFolders(p)` | 无 | 最多 200 个 `Path, Name, Kind, Total, Unread` |
13
+ | `V8.Email.Fetch(p)` | `Folder, AfterUid, UidValidity, Limit, Recent` | `NextUid, HasMore, Reset, UidValidity, Messages` |
14
+ | `V8.Email.Inspect(p)` | `Folder, UidValidity, Uids`(最多 100) | `UidValidity, Messages`,含存在的 UID 和已读/星标/删除标志 |
15
+ | `V8.Email.GetMessage(p)` | `Folder, UidValidity, Uid` | 信封、`TextBody, HtmlBody, Attachments` |
16
+ | `V8.Email.GetAttachment(p)` | 上述字段及 `AttachmentIndex`(从 0 开始) | `FileName, ContentType, FileByteBase64` |
17
+ | `V8.Email.SetFlags(p)` | `Folder, UidValidity, Uid, IsRead, IsStarred` | 结果状态 |
18
+ | `V8.Email.Move(p)` | `Folder, UidValidity, Uid, DestinationFolder` | 移动结果;不得对整个目录执行无差别清空 |
19
+ | `V8.Email.Send(p)` | SMTP 连接及下述 MIME 字段 | `DeliveryState, MessageId`,外层 `Code` 表示协议结果 |
20
+ | `V8.Email.StoreSent(p)` | IMAP 连接及相同 MIME 字段 | 按 Message-Id 查重并保存已发送副本 |
21
+
22
+ `Fetch.Recent=true` 读取末尾最多 `Limit` 封邮件,但保留历史 `AfterUid` 游标。
23
+ 常规 Fetch 按 UID 窗口分页,`Limit` 最高 100;即使窗口为空也推进游标。
24
+ 返回的 `Reset` 必须与 `UidValidity` 一起持久化,不能把旧代邮件指向新代同号 UID。
25
+
26
+ MIME 字段:`To, Cc, Bcc, Subject, TextBody, HtmlBody, InReplyTo, MessageId, Attachments`。
27
+ 附件对象:`FileName, ContentType, FileByteBase64`,最多 10 个,总大小不超过 10MB;
28
+ 读取单封原始邮件上限 25MB,正文上限 2MB。超限应明确报错,不能静默丢内容。
29
+
30
+ `Send` 的结果:`Accepted`、`Rejected` 或 `Unknown`。
31
+ 在业务层保存草稿及去重标记后才能调用;不要对 `Unknown` 自动重试 SMTP。
32
+ `StoreSent` 与真正发信分开,不可将保存副本当作已经投递。
33
+
34
+ 相关源码:`Microi.Server/Microi.V8Engine/Extend/Email/V8Email.cs`。
@@ -58,6 +58,7 @@ Markdown。第一列是相对 `microi.doc/docs/doc/` 的路径;第二列 Skill
58
58
  | `system-engine/report-engine.md` | report-engine | 虚拟报表和导出 |
59
59
  | `system-engine/saas-engine.md` | v8-saas-multi-tenant | 租户识别、SaaS 配置、ZIP 开库进度与长任务租约 |
60
60
  | `system-engine/search-engine.md` | search-engine | Elasticsearch 索引和查询 |
61
+ | `system-engine/email-engine.md` | email-engine | 邮箱系统、源码商城安装、账号维护、收发同步和邮箱 MCP |
61
62
  | `system-engine/spider-engine.md` | spider-engine | 浏览器采集和 Worker |
62
63
  | `system-engine/ocr-engine.md` | ocr-engine, v8-file-upload, v8-saas-multi-tenant, v8-security | 图片/PDF 文字识别、独立模型服务、租户配置、V8/HTTP/MCP 调用、安全边界与生产验收 |
63
64
  | `system-engine/vision-engine.md` | vision-engine, ai-engine, microi-microservice, app-store, v8-security | ONNX 视觉特征、租户样本匹配、异步 AI 回退、摄像头帧、人脸治理、微服务与商城交付 |
@@ -37,6 +37,11 @@ description: Microi V8 全局对象、上下文变量和通用函数索引。用
37
37
  `Microi.Client/src/views/form-engine/diy-components/v8-api-definitions.js`、
38
38
  `v8-api-server-definitions.js`、V8 宿主接口和官网中文函数列表。
39
39
 
40
+ 邮箱相关能力读取 [email-engine](../email-engine/SKILL.md):`V8.Email` 包含
41
+ `ProtectCredential / TestConnection / ListFolders / Fetch / Inspect / GetMessage /
42
+ GetAttachment / SetFlags / Move / Send / StoreSent`。
43
+ 业务使用 `mci-email` 接口引擎,MCP 使用 `microi_email_query / microi_email_manage / microi_email_send`。
44
+
40
45
  ## 常用通用写法
41
46
 
42
47
  ```javascript