@peninsula-med/beisen-ehr-plugin 1.0.3 → 1.0.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.
- package/README.md +7 -7
- package/dist/index.cjs.js +16 -4
- package/dist/index.cjs.js.map +1 -1
- package/dist/index.esm.js +16 -4
- package/dist/index.esm.js.map +1 -1
- package/package.json +1 -1
- package/scripts/configure.js +32 -3
package/README.md
CHANGED
|
@@ -15,22 +15,22 @@
|
|
|
15
15
|
openclaw plugins install @peninsula-med/beisen-ehr-plugin
|
|
16
16
|
```
|
|
17
17
|
|
|
18
|
-
### 2️⃣
|
|
18
|
+
### 2️⃣ 配置凭证(推荐 ⭐)
|
|
19
19
|
|
|
20
|
-
|
|
20
|
+
使用独立的配置工具,无需查找路径:
|
|
21
21
|
|
|
22
22
|
```bash
|
|
23
|
-
|
|
23
|
+
npx @peninsula-med/beisen-ehr-configure
|
|
24
24
|
```
|
|
25
25
|
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
**方式 B:运行配置脚本**
|
|
26
|
+
或(安装到全局后):
|
|
29
27
|
|
|
30
28
|
```bash
|
|
31
|
-
|
|
29
|
+
npx beisen-ehr-configure
|
|
32
30
|
```
|
|
33
31
|
|
|
32
|
+
按提示输入北森凭证即可,自动完成配置!
|
|
33
|
+
|
|
34
34
|
**方式 C:手动编辑配置文件**
|
|
35
35
|
|
|
36
36
|
编辑 `~/.openclaw/config.json`:
|
package/dist/index.cjs.js
CHANGED
|
@@ -27,11 +27,19 @@ async function activate(runtime, config) {
|
|
|
27
27
|
// 处理空配置情况
|
|
28
28
|
if (!config) {
|
|
29
29
|
console.error('⚠️ 插件已安装,但未配置凭证');
|
|
30
|
+
console.error('');
|
|
30
31
|
console.error('📝 请运行配置向导完成配置:');
|
|
31
|
-
console.error(' node ~/.openclaw/extensions/beisen-ehr-plugin/scripts/configure.js');
|
|
32
32
|
console.error('');
|
|
33
|
-
console.error('
|
|
34
|
-
console.error('
|
|
33
|
+
console.error(' npx @peninsula-med/beisen-ehr-configure');
|
|
34
|
+
console.error('');
|
|
35
|
+
console.error('按提示输入北森凭证即可!');
|
|
36
|
+
console.error('');
|
|
37
|
+
console.error('需要凭证?联系北森管理员获取:');
|
|
38
|
+
console.error(' • App Key');
|
|
39
|
+
console.error(' • App Secret');
|
|
40
|
+
console.error(' • Tenant ID');
|
|
41
|
+
console.error(' • Staff ID');
|
|
42
|
+
console.error(' • 企业邮箱');
|
|
35
43
|
return;
|
|
36
44
|
}
|
|
37
45
|
// 验证必要配置
|
|
@@ -39,8 +47,12 @@ async function activate(runtime, config) {
|
|
|
39
47
|
const missingFields = requiredFields.filter(field => !config[field]);
|
|
40
48
|
if (missingFields.length > 0) {
|
|
41
49
|
console.error(`❌ 缺少必要配置:${missingFields.join(', ')}`);
|
|
50
|
+
console.error('');
|
|
42
51
|
console.error('📝 请运行配置向导完成配置:');
|
|
43
|
-
console.error('
|
|
52
|
+
console.error('');
|
|
53
|
+
console.error(' npx @peninsula-med/beisen-ehr-configure');
|
|
54
|
+
console.error('');
|
|
55
|
+
console.error('按提示输入北森凭证即可!');
|
|
44
56
|
return;
|
|
45
57
|
}
|
|
46
58
|
// MCP 服务器配置会自动从 openclaw.plugin.json 加载
|
package/dist/index.cjs.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.cjs.js","sources":["../src/index.ts"],"sourcesContent":["/**\n * 北森 EHR OpenClaw Plugin\n * 🐉 龙二 开发\n * \n * 功能:加班申请、考勤查询、假期余额、审批状态查询\n */\n\nimport type { OpenClawPlugin } from 'openclaw/plugin-sdk';\n\n// 插件元数据\nexport const pluginId = 'beisen-ehr-plugin';\nexport const pluginVersion = '1.0.0';\n\n/**\n * 北森 EHR 插件配置接口\n */\nexport interface BeisenEHRConfig {\n /** 北森 API 地址 */\n apiUrl?: string;\n /** App Key */\n appKey: string;\n /** App Secret */\n appSecret: string;\n /** 员工 ID */\n staffId: string;\n /** 企业租户 ID */\n tenantId: string;\n /** 企业邮箱 */\n email: string;\n}\n\n/**\n * 默认配置\n */\nexport const defaultConfig: Partial<BeisenEHRConfig> = {\n apiUrl: 'https://openapi.italent.cn',\n};\n\n/**\n * 插件激活函数\n * \n * 当插件被激活时,自动配置 MCP 服务器\n */\nexport async function activate(runtime: any, config?: BeisenEHRConfig) {\n console.error(`🏢 北森 EHR 插件已激活 v${pluginVersion}`);\n \n // 处理空配置情况\n if (!config) {\n console.error('⚠️ 插件已安装,但未配置凭证');\n console.error('📝 请运行配置向导完成配置:');\n console.error('
|
|
1
|
+
{"version":3,"file":"index.cjs.js","sources":["../src/index.ts"],"sourcesContent":["/**\n * 北森 EHR OpenClaw Plugin\n * 🐉 龙二 开发\n * \n * 功能:加班申请、考勤查询、假期余额、审批状态查询\n */\n\nimport type { OpenClawPlugin } from 'openclaw/plugin-sdk';\n\n// 插件元数据\nexport const pluginId = 'beisen-ehr-plugin';\nexport const pluginVersion = '1.0.0';\n\n/**\n * 北森 EHR 插件配置接口\n */\nexport interface BeisenEHRConfig {\n /** 北森 API 地址 */\n apiUrl?: string;\n /** App Key */\n appKey: string;\n /** App Secret */\n appSecret: string;\n /** 员工 ID */\n staffId: string;\n /** 企业租户 ID */\n tenantId: string;\n /** 企业邮箱 */\n email: string;\n}\n\n/**\n * 默认配置\n */\nexport const defaultConfig: Partial<BeisenEHRConfig> = {\n apiUrl: 'https://openapi.italent.cn',\n};\n\n/**\n * 插件激活函数\n * \n * 当插件被激活时,自动配置 MCP 服务器\n */\nexport async function activate(runtime: any, config?: BeisenEHRConfig) {\n console.error(`🏢 北森 EHR 插件已激活 v${pluginVersion}`);\n \n // 处理空配置情况\n if (!config) {\n console.error('⚠️ 插件已安装,但未配置凭证');\n console.error('');\n console.error('📝 请运行配置向导完成配置:');\n console.error('');\n console.error(' npx @peninsula-med/beisen-ehr-configure');\n console.error('');\n console.error('按提示输入北森凭证即可!');\n console.error('');\n console.error('需要凭证?联系北森管理员获取:');\n console.error(' • App Key');\n console.error(' • App Secret');\n console.error(' • Tenant ID');\n console.error(' • Staff ID');\n console.error(' • 企业邮箱');\n return;\n }\n \n // 验证必要配置\n const requiredFields: (keyof BeisenEHRConfig)[] = ['appKey', 'appSecret', 'staffId', 'tenantId', 'email'];\n const missingFields = requiredFields.filter(field => !config[field]);\n \n if (missingFields.length > 0) {\n console.error(`❌ 缺少必要配置:${missingFields.join(', ')}`);\n console.error('');\n console.error('📝 请运行配置向导完成配置:');\n console.error('');\n console.error(' npx @peninsula-med/beisen-ehr-configure');\n console.error('');\n console.error('按提示输入北森凭证即可!');\n return;\n }\n \n // MCP 服务器配置会自动从 openclaw.plugin.json 加载\n // 这里只需要验证配置即可\n console.error('✅ 北森 EHR 配置验证通过');\n console.error(`📡 API: ${config.apiUrl || defaultConfig.apiUrl}`);\n console.error(`👤 员工:${config.staffId}`);\n console.error(`🏢 企业:${config.tenantId}`);\n}\n\n/**\n * 插件停用函数\n */\nexport async function deactivate() {\n console.error('🏢 北森 EHR 插件已停用');\n}\n\n/**\n * 配置变更回调\n */\nexport async function onConfigChange(config: BeisenEHRConfig) {\n console.error('🔄 北森 EHR 配置已更新');\n await activate(undefined as any, config);\n}\n\n// 导出插件入口\nconst plugin: OpenClawPlugin = {\n id: pluginId,\n version: pluginVersion,\n activate,\n deactivate,\n onConfigChange,\n};\n\nexport default plugin;\n"],"names":[],"mappings":";;;;AAAA;;;;;AAKG;AAIH;AACO,MAAM,QAAQ,GAAG;AACjB,MAAM,aAAa,GAAG;AAoB7B;;AAEG;AACI,MAAM,aAAa,GAA6B;AACrD,IAAA,MAAM,EAAE,4BAA4B;;AAGtC;;;;AAIG;AACI,eAAe,QAAQ,CAAC,OAAY,EAAE,MAAwB,EAAA;AACnE,IAAA,OAAO,CAAC,KAAK,CAAC,oBAAoB,aAAa,CAAA,CAAE,CAAC;;IAGlD,IAAI,CAAC,MAAM,EAAE;AACX,QAAA,OAAO,CAAC,KAAK,CAAC,kBAAkB,CAAC;AACjC,Q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AC,KAAK,CAAC,EAAE,CAAC;AACjB,QAAA,OAAO,CAAC,KAAK,CAAC,cAAc,CAAC;QAC7B;IACF;;;AAIA,IAAA,OAAO,CAAC,KAAK,CAAC,iBAAiB,CAAC;AAChC,IAAA,OAAO,CAAC,KAAK,CAAC,CAAA,QAAA,EAAW,MAAM,CAAC,MAAM,IAAI,aAAa,CAAC,MAAM,CAAA,CAAE,CAAC;IACjE,OAAO,CAAC,KAAK,CAAC,CAAA,MAAA,EAAS,MAAM,CAAC,OAAO,CAAA,CAAE,CAAC;IACxC,OAAO,CAAC,KAAK,CAAC,CAAA,MAAA,EAAS,MAAM,CAAC,QAAQ,CAAA,CAAE,CAAC;AAC3C;AAEA;;AAEG;AACI,eAAe,UAAU,GAAA;AAC9B,IAAA,OAAO,CAAC,KAAK,CAAC,iBAAiB,CAAC;AAClC;AAEA;;AAEG;AACI,eAAe,cAAc,CAAC,MAAuB,EAAA;AAC1D,IAAA,OAAO,CAAC,KAAK,CAAC,iBAAiB,CAAC;AAChC,IAAA,MAAM,QAAQ,CAAC,SAAgB,EAAE,MAAM,CAAC;AAC1C;AAEA;AACA,MAAM,MAAM,GAAmB;AAC7B,IAAA,EAAE,EAAE,QAAQ;AACZ,IAAA,OAAO,EAAE,aAAa;IACtB,QAAQ;IACR,UAAU;IACV,cAAc;;;;;;;;;;;"}
|
package/dist/index.esm.js
CHANGED
|
@@ -23,11 +23,19 @@ async function activate(runtime, config) {
|
|
|
23
23
|
// 处理空配置情况
|
|
24
24
|
if (!config) {
|
|
25
25
|
console.error('⚠️ 插件已安装,但未配置凭证');
|
|
26
|
+
console.error('');
|
|
26
27
|
console.error('📝 请运行配置向导完成配置:');
|
|
27
|
-
console.error(' node ~/.openclaw/extensions/beisen-ehr-plugin/scripts/configure.js');
|
|
28
28
|
console.error('');
|
|
29
|
-
console.error('
|
|
30
|
-
console.error('
|
|
29
|
+
console.error(' npx @peninsula-med/beisen-ehr-configure');
|
|
30
|
+
console.error('');
|
|
31
|
+
console.error('按提示输入北森凭证即可!');
|
|
32
|
+
console.error('');
|
|
33
|
+
console.error('需要凭证?联系北森管理员获取:');
|
|
34
|
+
console.error(' • App Key');
|
|
35
|
+
console.error(' • App Secret');
|
|
36
|
+
console.error(' • Tenant ID');
|
|
37
|
+
console.error(' • Staff ID');
|
|
38
|
+
console.error(' • 企业邮箱');
|
|
31
39
|
return;
|
|
32
40
|
}
|
|
33
41
|
// 验证必要配置
|
|
@@ -35,8 +43,12 @@ async function activate(runtime, config) {
|
|
|
35
43
|
const missingFields = requiredFields.filter(field => !config[field]);
|
|
36
44
|
if (missingFields.length > 0) {
|
|
37
45
|
console.error(`❌ 缺少必要配置:${missingFields.join(', ')}`);
|
|
46
|
+
console.error('');
|
|
38
47
|
console.error('📝 请运行配置向导完成配置:');
|
|
39
|
-
console.error('
|
|
48
|
+
console.error('');
|
|
49
|
+
console.error(' npx @peninsula-med/beisen-ehr-configure');
|
|
50
|
+
console.error('');
|
|
51
|
+
console.error('按提示输入北森凭证即可!');
|
|
40
52
|
return;
|
|
41
53
|
}
|
|
42
54
|
// MCP 服务器配置会自动从 openclaw.plugin.json 加载
|
package/dist/index.esm.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.esm.js","sources":["../src/index.ts"],"sourcesContent":["/**\n * 北森 EHR OpenClaw Plugin\n * 🐉 龙二 开发\n * \n * 功能:加班申请、考勤查询、假期余额、审批状态查询\n */\n\nimport type { OpenClawPlugin } from 'openclaw/plugin-sdk';\n\n// 插件元数据\nexport const pluginId = 'beisen-ehr-plugin';\nexport const pluginVersion = '1.0.0';\n\n/**\n * 北森 EHR 插件配置接口\n */\nexport interface BeisenEHRConfig {\n /** 北森 API 地址 */\n apiUrl?: string;\n /** App Key */\n appKey: string;\n /** App Secret */\n appSecret: string;\n /** 员工 ID */\n staffId: string;\n /** 企业租户 ID */\n tenantId: string;\n /** 企业邮箱 */\n email: string;\n}\n\n/**\n * 默认配置\n */\nexport const defaultConfig: Partial<BeisenEHRConfig> = {\n apiUrl: 'https://openapi.italent.cn',\n};\n\n/**\n * 插件激活函数\n * \n * 当插件被激活时,自动配置 MCP 服务器\n */\nexport async function activate(runtime: any, config?: BeisenEHRConfig) {\n console.error(`🏢 北森 EHR 插件已激活 v${pluginVersion}`);\n \n // 处理空配置情况\n if (!config) {\n console.error('⚠️ 插件已安装,但未配置凭证');\n console.error('📝 请运行配置向导完成配置:');\n console.error('
|
|
1
|
+
{"version":3,"file":"index.esm.js","sources":["../src/index.ts"],"sourcesContent":["/**\n * 北森 EHR OpenClaw Plugin\n * 🐉 龙二 开发\n * \n * 功能:加班申请、考勤查询、假期余额、审批状态查询\n */\n\nimport type { OpenClawPlugin } from 'openclaw/plugin-sdk';\n\n// 插件元数据\nexport const pluginId = 'beisen-ehr-plugin';\nexport const pluginVersion = '1.0.0';\n\n/**\n * 北森 EHR 插件配置接口\n */\nexport interface BeisenEHRConfig {\n /** 北森 API 地址 */\n apiUrl?: string;\n /** App Key */\n appKey: string;\n /** App Secret */\n appSecret: string;\n /** 员工 ID */\n staffId: string;\n /** 企业租户 ID */\n tenantId: string;\n /** 企业邮箱 */\n email: string;\n}\n\n/**\n * 默认配置\n */\nexport const defaultConfig: Partial<BeisenEHRConfig> = {\n apiUrl: 'https://openapi.italent.cn',\n};\n\n/**\n * 插件激活函数\n * \n * 当插件被激活时,自动配置 MCP 服务器\n */\nexport async function activate(runtime: any, config?: BeisenEHRConfig) {\n console.error(`🏢 北森 EHR 插件已激活 v${pluginVersion}`);\n \n // 处理空配置情况\n if (!config) {\n console.error('⚠️ 插件已安装,但未配置凭证');\n console.error('');\n console.error('📝 请运行配置向导完成配置:');\n console.error('');\n console.error(' npx @peninsula-med/beisen-ehr-configure');\n console.error('');\n console.error('按提示输入北森凭证即可!');\n console.error('');\n console.error('需要凭证?联系北森管理员获取:');\n console.error(' • App Key');\n console.error(' • App Secret');\n console.error(' • Tenant ID');\n console.error(' • Staff ID');\n console.error(' • 企业邮箱');\n return;\n }\n \n // 验证必要配置\n const requiredFields: (keyof BeisenEHRConfig)[] = ['appKey', 'appSecret', 'staffId', 'tenantId', 'email'];\n const missingFields = requiredFields.filter(field => !config[field]);\n \n if (missingFields.length > 0) {\n console.error(`❌ 缺少必要配置:${missingFields.join(', ')}`);\n console.error('');\n console.error('📝 请运行配置向导完成配置:');\n console.error('');\n console.error(' npx @peninsula-med/beisen-ehr-configure');\n console.error('');\n console.error('按提示输入北森凭证即可!');\n return;\n }\n \n // MCP 服务器配置会自动从 openclaw.plugin.json 加载\n // 这里只需要验证配置即可\n console.error('✅ 北森 EHR 配置验证通过');\n console.error(`📡 API: ${config.apiUrl || defaultConfig.apiUrl}`);\n console.error(`👤 员工:${config.staffId}`);\n console.error(`🏢 企业:${config.tenantId}`);\n}\n\n/**\n * 插件停用函数\n */\nexport async function deactivate() {\n console.error('🏢 北森 EHR 插件已停用');\n}\n\n/**\n * 配置变更回调\n */\nexport async function onConfigChange(config: BeisenEHRConfig) {\n console.error('🔄 北森 EHR 配置已更新');\n await activate(undefined as any, config);\n}\n\n// 导出插件入口\nconst plugin: OpenClawPlugin = {\n id: pluginId,\n version: pluginVersion,\n activate,\n deactivate,\n onConfigChange,\n};\n\nexport default plugin;\n"],"names":[],"mappings":"AAAA;;;;;AAKG;AAIH;AACO,MAAM,QAAQ,GAAG;AACjB,MAAM,aAAa,GAAG;AAoB7B;;AAEG;AACI,MAAM,aAAa,GAA6B;AACrD,IAAA,MAAM,EAAE,4BAA4B;;AAGtC;;;;AAIG;AACI,eAAe,QAAQ,CAAC,OAAY,EAAE,MAAwB,EAAA;AACnE,IAAA,OAAO,CAAC,KAAK,CAAC,oBAAoB,aAAa,CAAA,CAAE,CAAC;;IAGlD,IAAI,CAAC,MAAM,EAAE;AACX,QAAA,OAAO,CAAC,KAAK,CAAC,kBAAkB,CAAC;AACjC,QAAA,OAAO,CAAC,KAAK,CAAC,EAAE,CAAC;AACjB,QAAA,OAAO,CAAC,KAAK,CAAC,iBA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B;IACF;;;AAIA,IAAA,OAAO,CAAC,KAAK,CAAC,iBAAiB,CAAC;AAChC,IAAA,OAAO,CAAC,KAAK,CAAC,CAAA,QAAA,EAAW,MAAM,CAAC,MAAM,IAAI,aAAa,CAAC,MAAM,CAAA,CAAE,CAAC;IACjE,OAAO,CAAC,KAAK,CAAC,CAAA,MAAA,EAAS,MAAM,CAAC,OAAO,CAAA,CAAE,CAAC;IACxC,OAAO,CAAC,KAAK,CAAC,CAAA,MAAA,EAAS,MAAM,CAAC,QAAQ,CAAA,CAAE,CAAC;AAC3C;AAEA;;AAEG;AACI,eAAe,UAAU,GAAA;AAC9B,IAAA,OAAO,CAAC,KAAK,CAAC,iBAAiB,CAAC;AAClC;AAEA;;AAEG;AACI,eAAe,cAAc,CAAC,MAAuB,EAAA;AAC1D,IAAA,OAAO,CAAC,KAAK,CAAC,iBAAiB,CAAC;AAChC,IAAA,MAAM,QAAQ,CAAC,SAAgB,EAAE,MAAM,CAAC;AAC1C;AAEA;AACA,MAAM,MAAM,GAAmB;AAC7B,IAAA,EAAE,EAAE,QAAQ;AACZ,IAAA,OAAO,EAAE,aAAa;IACtB,QAAQ;IACR,UAAU;IACV,cAAc;;;;;"}
|
package/package.json
CHANGED
package/scripts/configure.js
CHANGED
|
@@ -119,10 +119,39 @@ async function main() {
|
|
|
119
119
|
}
|
|
120
120
|
|
|
121
121
|
// 写入配置
|
|
122
|
-
|
|
122
|
+
try {
|
|
123
|
+
fs.writeFileSync(configPath, JSON.stringify(openclawConfig, null, 2), 'utf-8');
|
|
124
|
+
console.log('');
|
|
125
|
+
console.log('✅ 配置已保存到:', configPath);
|
|
126
|
+
console.log('');
|
|
127
|
+
|
|
128
|
+
// 验证写入
|
|
129
|
+
const verifyContent = fs.readFileSync(configPath, 'utf-8');
|
|
130
|
+
const verifyConfig = JSON.parse(verifyContent);
|
|
131
|
+
if (verifyConfig.plugins && verifyConfig.plugins['@peninsula-med/beisen-ehr-plugin']) {
|
|
132
|
+
console.log('✅ 配置验证成功!');
|
|
133
|
+
} else {
|
|
134
|
+
console.log('⚠️ 配置验证失败,请检查配置文件');
|
|
135
|
+
}
|
|
136
|
+
} catch (writeError) {
|
|
137
|
+
console.error('');
|
|
138
|
+
console.error('❌ 保存配置失败:', writeError.message);
|
|
139
|
+
console.error('');
|
|
140
|
+
console.error('请手动编辑配置文件:');
|
|
141
|
+
console.error(' ' + configPath);
|
|
142
|
+
console.error('');
|
|
143
|
+
console.error('添加以下内容:');
|
|
144
|
+
console.error(JSON.stringify({
|
|
145
|
+
plugins: {
|
|
146
|
+
'@peninsula-med/beisen-ehr-plugin': {
|
|
147
|
+
enabled: true,
|
|
148
|
+
config: config
|
|
149
|
+
}
|
|
150
|
+
}
|
|
151
|
+
}, null, 2));
|
|
152
|
+
throw writeError;
|
|
153
|
+
}
|
|
123
154
|
|
|
124
|
-
console.log('');
|
|
125
|
-
console.log('✅ 配置已保存!');
|
|
126
155
|
console.log('');
|
|
127
156
|
console.log('📋 配置摘要:');
|
|
128
157
|
console.log(' • API 地址:', config.apiUrl);
|