@peninsula-med/beisen-ehr-plugin 1.0.6 → 1.1.0

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/README.md CHANGED
@@ -1,201 +1,139 @@
1
- # 北森 EHR OpenClaw Plugin 🏢
1
+ # 北森 EHR OpenClaw 插件 🐉
2
2
 
3
- 北森 EHR 系统的 OpenClaw 插件,支持加班申请、考勤查询、假期余额等功能。
3
+ 北森 EHR 系统集成插件,支持加班申请、考勤查询、假期余额等功能。
4
4
 
5
- > **开发:** 龙二 (Long Er) 🐉
6
- > **版本:** 1.0.1
5
+ ## 快速开始
7
6
 
8
- ---
9
-
10
- ## 快速安装
11
-
12
- ### 1️⃣ 安装插件
7
+ ### 方式一:使用配置向导(推荐)
13
8
 
14
9
  ```bash
10
+ # 1. 安装插件
15
11
  openclaw plugins install @peninsula-med/beisen-ehr-plugin
16
- ```
17
12
 
18
- ### 2️⃣ 配置凭证(推荐 ⭐)
19
-
20
- 使用独立的配置工具,无需查找路径:
21
-
22
- ```bash
13
+ # 2. 运行配置向导(交互式输入凭证)
23
14
  npx @peninsula-med/beisen-ehr-configure
15
+
16
+ # 3. 重启 Gateway
17
+ openclaw gateway restart
24
18
  ```
25
19
 
26
- 或(安装到全局后):
20
+ ### 方式二:一键安装 + 配置(适合脚本化)
27
21
 
28
22
  ```bash
29
- npx beisen-ehr-configure
23
+ openclaw plugins install @peninsula-med/beisen-ehr-plugin && \
24
+ npx @peninsula-med/beisen-ehr-configure && \
25
+ openclaw gateway restart
30
26
  ```
31
27
 
32
- 按提示输入北森凭证即可,自动完成配置!
28
+ ### 方式三:手动配置
33
29
 
34
- **方式 C:手动编辑配置文件**
30
+ ```bash
31
+ # 1. 安装插件
32
+ openclaw plugins install @peninsula-med/beisen-ehr-plugin
35
33
 
36
- 编辑 `~/.openclaw/config.json`:
34
+ # 2. 编辑配置文件(~/.openclaw/config.json
35
+ ```
37
36
 
38
- ```json
37
+ 在配置文件中添加:
38
+
39
+ ```json5
39
40
  {
40
- "plugins": {
41
- "@peninsula-med/beisen-ehr-plugin": {
42
- "enabled": true,
43
- "config": {
44
- "apiUrl": "https://openapi.italent.cn",
45
- "appKey": "YOUR_APP_KEY",
46
- "appSecret": "YOUR_APP_SECRET",
47
- "staffId": "YOUR_STAFF_ID",
48
- "tenantId": "YOUR_TENANT_ID",
49
- "email": "your.email@company.com"
41
+ plugins: {
42
+ entries: {
43
+ "beisen-ehr-plugin": {
44
+ enabled: true,
45
+ config: {
46
+ apiUrl: "https://openapi.italent.cn", // 可选,默认就是这个
47
+ appKey: "your-app-key",
48
+ appSecret: "your-app-secret",
49
+ staffId: "your-staff-id",
50
+ tenantId: "your-tenant-id",
51
+ email: "your-email@company.com"
52
+ }
50
53
  }
51
54
  }
52
55
  }
53
56
  }
54
57
  ```
55
58
 
56
- ### 3️⃣ 重启 OpenClaw
59
+ 然后重启:
57
60
 
58
61
  ```bash
59
- openclaw restart
60
- ```
61
-
62
- ### 4️⃣ 测试
63
-
64
- ```
65
- 帮我提交一个加班申请
66
- ```
67
-
68
- ---
69
-
70
- ## 功能
71
-
72
- ### Tools (工具)
73
-
74
- | 工具 | 说明 |
75
- |------|------|
76
- | `submit_overtime` | 提交加班申请 |
77
- | `query_attendance` | 查询考勤记录 |
78
- | `get_approval_status` | 查询审批状态 |
79
- | `get_leave_balance` | 查询假期余额 |
80
-
81
- ### Resources (资源)
82
-
83
- - `ehr://employee/{id}/profile` - 员工信息
84
- - `ehr://attendance/{id}/records` - 考勤记录
85
- - `ehr://overtime/{id}/list` - 加班记录
86
-
87
- ---
88
-
89
- ## 使用示例
90
-
91
- ### 提交加班申请
92
-
93
- ```
94
- 帮我提交一个加班申请,这周日全天
95
- ```
96
-
97
- ### 查询假期余额
98
-
99
- ```
100
- 我还有多少调休假?
101
- ```
102
-
103
- ### 查询考勤
104
-
105
- ```
106
- 查一下本周的考勤记录
62
+ openclaw gateway restart
107
63
  ```
108
64
 
109
- ---
110
-
111
65
  ## 配置说明
112
66
 
113
- ### 必要配置
114
-
115
- | 字段 | 说明 | 获取方式 |
116
- |------|------|---------|
117
- | `appKey` | 北森 App Key | 联系北森管理员 |
118
- | `appSecret` | 北森 App Secret | 联系北森管理员 |
119
- | `staffId` | 员工 ID | 北森系统或个人信息 |
120
- | `tenantId` | 企业租户 ID | 北森管理员 |
121
- | `email` | 企业邮箱 | 公司邮箱 |
67
+ | 字段 | 说明 | 必填 |
68
+ |------|------|------|
69
+ | `apiUrl` | 北森 API 地址 | 否(默认 `https://openapi.italent.cn`) |
70
+ | `appKey` | App Key(从北森管理员获取) | 是 |
71
+ | `appSecret` | App Secret(从北森管理员获取) | |
72
+ | `staffId` | 员工 ID | |
73
+ | `tenantId` | 企业租户 ID | |
74
+ | `email` | 企业邮箱 | |
122
75
 
123
- ### 可选配置
76
+ ## 可用工具
124
77
 
125
- | 字段 | 说明 | 默认值 |
126
- |------|------|-------|
127
- | `apiUrl` | 北森 API 地址 | `https://openapi.italent.cn` |
78
+ 插件提供以下工具供 AI 调用:
128
79
 
129
- ---
80
+ 1. **beisen_submit_overtime** - 提交加班申请
81
+ 2. **beisen_get_leave_balance** - 查询假期余额
82
+ 3. **beisen_query_attendance** - 查询考勤记录
83
+ 4. **beisen_get_approval_status** - 查询审批状态
130
84
 
131
85
  ## 配置向导
132
86
 
133
- 运行配置向导,按提示输入凭证:
87
+ 独立的配置工具,支持交互式输入凭证:
134
88
 
135
89
  ```bash
136
90
  npx @peninsula-med/beisen-ehr-configure
137
91
  ```
138
92
 
139
- 向导会:
140
- 1. 提示输入必要凭证
141
- 2. 自动验证格式
142
- 3.备份现有配置
143
- 4. 写入配置文件
144
- 5. ✅ 显示配置摘要
145
- 6. ✅ 提供下一步指引
93
+ 功能:
94
+ - 🎯 交互式引导配置
95
+ - 🔐 安全保存凭证到 OpenClaw 配置文件
96
+ -自动验证配置
97
+ - 💾 自动备份旧配置
146
98
 
147
- ---
148
-
149
- ## 故障排查
99
+ ## 开发
150
100
 
151
- ### 插件未加载
101
+ ### 本地开发
152
102
 
153
103
  ```bash
154
- openclaw plugins list
155
- openclaw plugins info @peninsula-med/beisen-ehr-plugin
156
- ```
157
-
158
- ### 配置错误
104
+ # 安装依赖
105
+ pnpm install
159
106
 
160
- 重新运行配置向导:
161
- ```bash
162
- npx @peninsula-med/beisen-ehr-configure
163
- ```
107
+ # 开发模式(监听变化自动构建)
108
+ pnpm dev
164
109
 
165
- ### 查看日志
110
+ # 生产构建
111
+ pnpm build
166
112
 
167
- ```bash
168
- openclaw gateway logs | grep beisen
113
+ # 发布到 npm
114
+ pnpm publish:release
169
115
  ```
170
116
 
171
- ### 卸载
117
+ ### 本地测试
118
+
119
+ 使用 `--link` 安装本地插件:
172
120
 
173
121
  ```bash
174
- openclaw plugins uninstall @peninsula-med/beisen-ehr-plugin
122
+ openclaw plugins install -l /path/to/beisen-ehr-plugin
175
123
  ```
176
124
 
177
- ---
178
-
179
- ## 更新日志
125
+ ## 注意事项
180
126
 
181
- ### v1.0.1 (2026-03-11)
182
- - 添加配置向导脚本
183
- - 支持 npx 一键配置
184
-
185
- ### v1.0.0 (2026-03-11)
186
- - ✅ 初始版本
187
- - ✅ 提交加班申请
188
- - ✅ 查询考勤记录
189
- - ✅ 查询审批状态
190
- - ✅ 查询假期余额
191
-
192
- ---
127
+ - 凭证信息需要联系北森管理员获取
128
+ - Token 会自动管理,有效期 2 小时,自动刷新
129
+ - 所有 API 请求都会记录到 Gateway 日志中
193
130
 
194
- ## License
131
+ ## 技术支持
195
132
 
196
- MIT
133
+ 遇到问题?联系龙二 🐉
197
134
 
198
135
  ---
199
136
 
200
- 🐉 **开发:** 龙二 (Long Er)
201
- **最后更新:** 2026-03-11
137
+ **版本**: 1.1.0
138
+ **作者**: 龙二 🐉
139
+ **License**: MIT