@zhin.js/adapter-email 0.1.2 → 0.1.3

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.
Files changed (2) hide show
  1. package/README.md +29 -23
  2. package/package.json +2 -2
package/README.md CHANGED
@@ -20,31 +20,37 @@ pnpm add @zhin.js/adapter-email
20
20
  ### 基础配置
21
21
 
22
22
  ```typescript
23
- import { EmailBotConfig } from '@zhin.js/adapter-email'
23
+ // zhin.config.ts
24
+ import { defineConfig } from 'zhin.js'
24
25
 
25
- const emailConfig: EmailBotConfig = {
26
- context: 'email',
27
- name: 'my-email-bot',
28
- smtp: {
29
- host: 'smtp.gmail.com',
30
- port: 587,
31
- secure: false, // true for 465, false for other ports
32
- auth: {
33
- user: 'your-email@gmail.com',
34
- pass: 'your-app-password'
26
+ export default defineConfig({
27
+ bots: [
28
+ {
29
+ context: 'email',
30
+ name: 'my-email-bot',
31
+ smtp: {
32
+ host: 'smtp.gmail.com',
33
+ port: 587,
34
+ secure: false, // true for 465, false for other ports
35
+ auth: {
36
+ user: process.env.EMAIL_USER,
37
+ pass: process.env.EMAIL_PASSWORD
38
+ }
39
+ },
40
+ imap: {
41
+ host: 'imap.gmail.com',
42
+ port: 993,
43
+ tls: true,
44
+ user: process.env.EMAIL_USER,
45
+ password: process.env.EMAIL_PASSWORD,
46
+ checkInterval: 60000, // 检查新邮件间隔(毫秒)
47
+ mailbox: 'INBOX', // 监听的邮箱文件夹
48
+ markSeen: true // 是否标记已读
49
+ }
35
50
  }
36
- },
37
- imap: {
38
- host: 'imap.gmail.com',
39
- port: 993,
40
- tls: true,
41
- user: 'your-email@gmail.com',
42
- password: 'your-app-password',
43
- checkInterval: 60000, // 检查新邮件间隔(毫秒)
44
- mailbox: 'INBOX', // 监听的邮箱文件夹
45
- markSeen: true // 是否标记已读
46
- }
47
- }
51
+ ],
52
+ plugins: ['adapter-email']
53
+ })
48
54
  ```
49
55
 
50
56
  ### 完整配置选项
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@zhin.js/adapter-email",
3
- "version": "0.1.2",
3
+ "version": "0.1.3",
4
4
  "type": "module",
5
5
  "description": "Email adapter for zhin.js",
6
6
  "main": "lib/index.js",
@@ -14,7 +14,7 @@
14
14
  },
15
15
  "peerDependencies": {
16
16
  "@zhin.js/types": "^1.0.3",
17
- "zhin.js": "^1.0.8"
17
+ "zhin.js": "^1.0.9"
18
18
  },
19
19
  "devDependencies": {
20
20
  "@types/mailparser": "^3.4.6",