alemonjs 2.1.46 → 2.1.48
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/LICENSE +21 -0
- package/bin/README.md +7 -7
- package/bin/alemonc.js +8 -8
- package/bin/info.js +71 -71
- package/bin/login.js +58 -62
- package/bin/platform.js +106 -110
- package/bin/versionUpdate.js +49 -49
- package/lib/app/event-processor.js +13 -13
- package/lib/app/message-format-old.d.ts +2 -2
- package/lib/core/config.d.ts +37 -0
- package/lib/core/index.js +1 -1
- package/lib/core/utils.d.ts +2 -1
- package/lib/core/utils.js +12 -9
- package/lib/global.d.ts +3 -1
- package/lib/index.js +1 -1
- package/lib/types/message/markdown.d.ts +1 -1
- package/package.json +5 -5
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
The MIT License (MIT)
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2013-present, Yuxi (Evan) You
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in
|
|
13
|
+
all copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIdED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
|
21
|
+
THE SOFTWARE.
|
package/bin/README.md
CHANGED
|
@@ -165,12 +165,12 @@ alemonc login telegram
|
|
|
165
165
|
|
|
166
166
|
根据平台交互式提示输入所需字段:
|
|
167
167
|
|
|
168
|
-
| 平台
|
|
169
|
-
|
|
170
|
-
| discord
|
|
171
|
-
| kook
|
|
172
|
-
| qq-bot
|
|
173
|
-
| onebot
|
|
174
|
-
| telegram | token
|
|
168
|
+
| 平台 | 必填字段 | 可选字段 |
|
|
169
|
+
| -------- | --------------------- | -------- |
|
|
170
|
+
| discord | token | — |
|
|
171
|
+
| kook | token | — |
|
|
172
|
+
| qq-bot | app_id, token, secret | — |
|
|
173
|
+
| onebot | url | token |
|
|
174
|
+
| telegram | token | proxy |
|
|
175
175
|
|
|
176
176
|
配置保存到 `alemon.config.yaml`,已有值回车可保留。
|
package/bin/alemonc.js
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
import {updateConfig} from './updateConfig.js';
|
|
3
|
-
import {run} from './run.js';
|
|
4
|
-
import {start} from './start.js';
|
|
5
|
-
import {versionUpdate} from './versionUpdate.js';
|
|
6
|
-
import {info} from './info.js';
|
|
7
|
-
import {platformAdd, platformRemove, platformList} from './platform.js';
|
|
8
|
-
import {login} from './login.js';
|
|
9
|
-
import {Command} from 'commander';
|
|
2
|
+
import { updateConfig } from './updateConfig.js';
|
|
3
|
+
import { run } from './run.js';
|
|
4
|
+
import { start } from './start.js';
|
|
5
|
+
import { versionUpdate } from './versionUpdate.js';
|
|
6
|
+
import { info } from './info.js';
|
|
7
|
+
import { platformAdd, platformRemove, platformList } from './platform.js';
|
|
8
|
+
import { login } from './login.js';
|
|
9
|
+
import { Command } from 'commander';
|
|
10
10
|
const program = new Command();
|
|
11
11
|
|
|
12
12
|
program.name('alemonc').description('CLI to some alemonc actions and scripts').version('1.0.0');
|
package/bin/info.js
CHANGED
|
@@ -1,93 +1,93 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
import {join} from 'path';
|
|
2
|
+
import { join } from 'path';
|
|
3
3
|
import fs from 'fs';
|
|
4
|
-
import {execSync} from 'child_process';
|
|
4
|
+
import { execSync } from 'child_process';
|
|
5
5
|
import YAML from 'yaml';
|
|
6
6
|
|
|
7
7
|
/**
|
|
8
8
|
* 输出项目诊断信息
|
|
9
9
|
*/
|
|
10
10
|
export function info() {
|
|
11
|
-
|
|
11
|
+
console.log('=== AlemonJS 项目信息 ===\n');
|
|
12
12
|
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
13
|
+
// Node 版本
|
|
14
|
+
console.log(`Node.js: ${process.version}`);
|
|
15
|
+
console.log(`Platform: ${process.platform} ${process.arch}`);
|
|
16
16
|
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
17
|
+
// package.json
|
|
18
|
+
const pkgPath = join(process.cwd(), 'package.json');
|
|
19
|
+
if (!fs.existsSync(pkgPath)) {
|
|
20
|
+
console.log('\n未找到 package.json');
|
|
21
|
+
return;
|
|
22
|
+
}
|
|
23
23
|
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
24
|
+
const pkg = JSON.parse(fs.readFileSync(pkgPath, 'utf8'));
|
|
25
|
+
console.log(`项目名: ${pkg.name || '-'}`);
|
|
26
|
+
console.log(`版本: ${pkg.version || '-'}`);
|
|
27
27
|
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
}
|
|
28
|
+
// alemonjs 相关依赖
|
|
29
|
+
const depFields = ['dependencies', 'devDependencies'];
|
|
30
|
+
const related = [];
|
|
31
|
+
for (const field of depFields) {
|
|
32
|
+
const deps = pkg[field];
|
|
33
|
+
if (!deps) continue;
|
|
34
|
+
for (const [name, ver] of Object.entries(deps)) {
|
|
35
|
+
if (name === 'alemonjs' || name.startsWith('@alemonjs/')) {
|
|
36
|
+
related.push({ name, ver, dev: field === 'devDependencies' });
|
|
37
|
+
}
|
|
39
38
|
}
|
|
39
|
+
}
|
|
40
40
|
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
}
|
|
41
|
+
console.log(`\n--- 已安装平台/依赖 (${related.length}) ---`);
|
|
42
|
+
if (related.length === 0) {
|
|
43
|
+
console.log(' 无');
|
|
44
|
+
} else {
|
|
45
|
+
for (const item of related) {
|
|
46
|
+
const tag = item.dev ? ' (dev)' : '';
|
|
47
|
+
console.log(` ${item.name}@${item.ver}${tag}`);
|
|
49
48
|
}
|
|
49
|
+
}
|
|
50
50
|
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
51
|
+
// alemon.config.yaml 摘要
|
|
52
|
+
const configPath = join(process.cwd(), 'alemon.config.yaml');
|
|
53
|
+
if (fs.existsSync(configPath)) {
|
|
54
|
+
const config = YAML.parse(fs.readFileSync(configPath, 'utf8')) ?? {};
|
|
55
|
+
const keys = Object.keys(config);
|
|
56
|
+
console.log(`\n--- 配置摘要 (alemon.config.yaml) ---`);
|
|
57
|
+
if (keys.length === 0) {
|
|
58
|
+
console.log(' 空配置');
|
|
59
|
+
} else {
|
|
60
|
+
for (const key of keys) {
|
|
61
|
+
const val = config[key];
|
|
62
|
+
if (Array.isArray(val)) {
|
|
63
|
+
console.log(` ${key}: [${val.join(', ')}]`);
|
|
64
|
+
} else if (typeof val === 'object' && val !== null) {
|
|
65
|
+
console.log(` ${key}: { ${Object.keys(val).join(', ')} }`);
|
|
59
66
|
} else {
|
|
60
|
-
|
|
61
|
-
const val = config[key];
|
|
62
|
-
if (Array.isArray(val)) {
|
|
63
|
-
console.log(` ${key}: [${val.join(', ')}]`);
|
|
64
|
-
} else if (typeof val === 'object' && val !== null) {
|
|
65
|
-
console.log(` ${key}: { ${Object.keys(val).join(', ')} }`);
|
|
66
|
-
} else {
|
|
67
|
-
console.log(` ${key}: ${val}`);
|
|
68
|
-
}
|
|
69
|
-
}
|
|
67
|
+
console.log(` ${key}: ${val}`);
|
|
70
68
|
}
|
|
71
|
-
|
|
72
|
-
console.log('\n未找到 alemon.config.yaml');
|
|
69
|
+
}
|
|
73
70
|
}
|
|
71
|
+
} else {
|
|
72
|
+
console.log('\n未找到 alemon.config.yaml');
|
|
73
|
+
}
|
|
74
74
|
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
75
|
+
// .env 检查
|
|
76
|
+
const envPath = join(process.cwd(), '.env');
|
|
77
|
+
if (fs.existsSync(envPath)) {
|
|
78
|
+
const envContent = fs.readFileSync(envPath, 'utf8');
|
|
79
|
+
const envKeys = envContent
|
|
80
|
+
.split('\n')
|
|
81
|
+
.filter(l => l.trim() && !l.trim().startsWith('#'))
|
|
82
|
+
.map(l => l.split('=')[0].trim())
|
|
83
|
+
.filter(Boolean);
|
|
84
|
+
console.log(`\n--- 环境变量 (.env) ---`);
|
|
85
|
+
console.log(` 已配置 ${envKeys.length} 个变量: ${envKeys.join(', ')}`);
|
|
86
|
+
}
|
|
87
87
|
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
88
|
+
// 包管理器
|
|
89
|
+
let pm = 'npm';
|
|
90
|
+
if (fs.existsSync(join(process.cwd(), 'pnpm-lock.yaml'))) pm = 'pnpm';
|
|
91
|
+
else if (fs.existsSync(join(process.cwd(), 'yarn.lock'))) pm = 'yarn';
|
|
92
|
+
console.log(`\n包管理器: ${pm}`);
|
|
93
93
|
}
|
package/bin/login.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
import {join} from 'path';
|
|
2
|
+
import { join } from 'path';
|
|
3
3
|
import fs from 'fs';
|
|
4
|
-
import {createInterface} from 'readline';
|
|
4
|
+
import { createInterface } from 'readline';
|
|
5
5
|
import YAML from 'yaml';
|
|
6
6
|
|
|
7
7
|
const configPath = join(process.cwd(), 'alemon.config.yaml');
|
|
@@ -10,36 +10,32 @@ const configPath = join(process.cwd(), 'alemon.config.yaml');
|
|
|
10
10
|
* 平台所需的配置字段定义
|
|
11
11
|
*/
|
|
12
12
|
const platformFields = {
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
onebot: [
|
|
29
|
-
{key: 'url', label: 'WebSocket 地址 (如 ws://127.0.0.1:6700)', required: true},
|
|
30
|
-
{key: 'token', label: 'Access Token (可选)', required: false, secret: true}
|
|
31
|
-
]
|
|
13
|
+
discord: [{ key: 'token', label: 'Bot Token', required: true, secret: true }],
|
|
14
|
+
kook: [{ key: 'token', label: 'Bot Token', required: true, secret: true }],
|
|
15
|
+
telegram: [
|
|
16
|
+
{ key: 'token', label: 'Bot Token (从 @BotFather 获取)', required: true, secret: true },
|
|
17
|
+
{ key: 'proxy', label: '代理地址 (可选, 如 http://127.0.0.1:7890)', required: false }
|
|
18
|
+
],
|
|
19
|
+
'qq-bot': [
|
|
20
|
+
{ key: 'app_id', label: 'AppID', required: true },
|
|
21
|
+
{ key: 'token', label: 'Token', required: true, secret: true },
|
|
22
|
+
{ key: 'secret', label: 'AppSecret', required: true, secret: true }
|
|
23
|
+
],
|
|
24
|
+
onebot: [
|
|
25
|
+
{ key: 'url', label: 'WebSocket 地址 (如 ws://127.0.0.1:6700)', required: true },
|
|
26
|
+
{ key: 'token', label: 'Access Token (可选)', required: false, secret: true }
|
|
27
|
+
]
|
|
32
28
|
};
|
|
33
29
|
|
|
34
30
|
/**
|
|
35
31
|
* 提示输入
|
|
36
32
|
*/
|
|
37
33
|
function prompt(rl, question) {
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
});
|
|
34
|
+
return new Promise(resolve => {
|
|
35
|
+
rl.question(question, answer => {
|
|
36
|
+
resolve(answer.trim());
|
|
42
37
|
});
|
|
38
|
+
});
|
|
43
39
|
}
|
|
44
40
|
|
|
45
41
|
/**
|
|
@@ -47,52 +43,52 @@ function prompt(rl, question) {
|
|
|
47
43
|
* @param {string} name 平台名
|
|
48
44
|
*/
|
|
49
45
|
export async function login(name) {
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
46
|
+
const fields = platformFields[name];
|
|
47
|
+
if (!fields) {
|
|
48
|
+
const supported = Object.keys(platformFields).join(', ');
|
|
49
|
+
console.error(`不支持的平台: ${name}`);
|
|
50
|
+
console.log(`支持的平台: ${supported}`);
|
|
51
|
+
process.exit(1);
|
|
52
|
+
}
|
|
57
53
|
|
|
58
|
-
|
|
54
|
+
console.log(`\n=== 配置 ${name} 平台 ===\n`);
|
|
59
55
|
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
56
|
+
// 读取现有配置
|
|
57
|
+
let config = {};
|
|
58
|
+
if (fs.existsSync(configPath)) {
|
|
59
|
+
config = YAML.parse(fs.readFileSync(configPath, 'utf8')) ?? {};
|
|
60
|
+
}
|
|
61
|
+
const existing = config[name] || {};
|
|
66
62
|
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
63
|
+
const rl = createInterface({
|
|
64
|
+
input: process.stdin,
|
|
65
|
+
output: process.stdout
|
|
66
|
+
});
|
|
71
67
|
|
|
72
|
-
|
|
68
|
+
const result = { ...existing };
|
|
73
69
|
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
70
|
+
for (const field of fields) {
|
|
71
|
+
const current = existing[field.key];
|
|
72
|
+
const mask = field.secret && current ? current.slice(0, 4) + '****' : current;
|
|
73
|
+
const hint = current ? ` [当前: ${mask}, 回车保留]` : field.required ? '' : ' [可选, 回车跳过]';
|
|
78
74
|
|
|
79
|
-
|
|
75
|
+
const answer = await prompt(rl, `${field.label}${hint}: `);
|
|
80
76
|
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
}
|
|
77
|
+
if (answer) {
|
|
78
|
+
result[field.key] = answer;
|
|
79
|
+
} else if (!current && field.required) {
|
|
80
|
+
console.error(`${field.label} 是必填项`);
|
|
81
|
+
rl.close();
|
|
82
|
+
process.exit(1);
|
|
88
83
|
}
|
|
84
|
+
}
|
|
89
85
|
|
|
90
|
-
|
|
86
|
+
rl.close();
|
|
91
87
|
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
88
|
+
// 写入配置
|
|
89
|
+
config[name] = result;
|
|
90
|
+
fs.writeFileSync(configPath, YAML.stringify(config));
|
|
95
91
|
|
|
96
|
-
|
|
97
|
-
|
|
92
|
+
console.log(`\n✓ ${name} 配置已保存到 alemon.config.yaml`);
|
|
93
|
+
console.log(' 提示: 请确保 alemon.config.yaml 已加入 .gitignore,避免泄露密钥');
|
|
98
94
|
}
|
package/bin/platform.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
import {join} from 'path';
|
|
2
|
+
import { join } from 'path';
|
|
3
3
|
import fs from 'fs';
|
|
4
|
-
import {execSync} from 'child_process';
|
|
4
|
+
import { execSync } from 'child_process';
|
|
5
5
|
import YAML from 'yaml';
|
|
6
6
|
|
|
7
7
|
const configPath = join(process.cwd(), 'alemon.config.yaml');
|
|
@@ -10,26 +10,26 @@ const configPath = join(process.cwd(), 'alemon.config.yaml');
|
|
|
10
10
|
* 检测包管理器
|
|
11
11
|
*/
|
|
12
12
|
function detectPM() {
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
13
|
+
if (fs.existsSync(join(process.cwd(), 'pnpm-lock.yaml'))) return 'pnpm';
|
|
14
|
+
if (fs.existsSync(join(process.cwd(), 'yarn.lock'))) return 'yarn';
|
|
15
|
+
return 'npm';
|
|
16
16
|
}
|
|
17
17
|
|
|
18
18
|
/**
|
|
19
19
|
* 读取配置
|
|
20
20
|
*/
|
|
21
21
|
function readConfig() {
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
22
|
+
if (fs.existsSync(configPath)) {
|
|
23
|
+
return YAML.parse(fs.readFileSync(configPath, 'utf8')) ?? {};
|
|
24
|
+
}
|
|
25
|
+
return {};
|
|
26
26
|
}
|
|
27
27
|
|
|
28
28
|
/**
|
|
29
29
|
* 写入配置
|
|
30
30
|
*/
|
|
31
31
|
function writeConfig(config) {
|
|
32
|
-
|
|
32
|
+
fs.writeFileSync(configPath, YAML.stringify(config));
|
|
33
33
|
}
|
|
34
34
|
|
|
35
35
|
/**
|
|
@@ -37,48 +37,46 @@ function writeConfig(config) {
|
|
|
37
37
|
* @param {string} name 平台名(如 discord, kook, qq-bot)
|
|
38
38
|
*/
|
|
39
39
|
export function platformAdd(name) {
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
console.error(`✗ ${pkgName} 安装失败`);
|
|
66
|
-
process.exit(1);
|
|
67
|
-
}
|
|
68
|
-
}
|
|
69
|
-
|
|
70
|
-
// 3. 注册到配置
|
|
71
|
-
const config = readConfig();
|
|
72
|
-
if (!Array.isArray(config.platforms)) {
|
|
73
|
-
config.platforms = [];
|
|
74
|
-
}
|
|
75
|
-
if (!config.platforms.includes(name)) {
|
|
76
|
-
config.platforms.push(name);
|
|
77
|
-
writeConfig(config);
|
|
78
|
-
console.log(`✓ 已将 ${name} 添加到 alemon.config.yaml`);
|
|
79
|
-
} else {
|
|
80
|
-
console.log(`${name} 已在配置中`);
|
|
40
|
+
const pkgName = `@alemonjs/${name}`;
|
|
41
|
+
const pm = detectPM();
|
|
42
|
+
|
|
43
|
+
// 1. 检查是否已安装
|
|
44
|
+
const pkgPath = join(process.cwd(), 'package.json');
|
|
45
|
+
if (!fs.existsSync(pkgPath)) {
|
|
46
|
+
console.error('未找到 package.json');
|
|
47
|
+
process.exit(1);
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
const pkg = JSON.parse(fs.readFileSync(pkgPath, 'utf8'));
|
|
51
|
+
const allDeps = { ...pkg.dependencies, ...pkg.devDependencies };
|
|
52
|
+
|
|
53
|
+
if (allDeps[pkgName]) {
|
|
54
|
+
console.log(`${pkgName} 已安装 (${allDeps[pkgName]})`);
|
|
55
|
+
} else {
|
|
56
|
+
// 2. 安装
|
|
57
|
+
console.log(`正在安装 ${pkgName}...`);
|
|
58
|
+
try {
|
|
59
|
+
const cmd = pm === 'npm' ? `npm install ${pkgName}` : pm === 'pnpm' ? `pnpm add ${pkgName}` : `yarn add ${pkgName}`;
|
|
60
|
+
execSync(cmd, { stdio: 'inherit', timeout: 60000 });
|
|
61
|
+
console.log(`✓ ${pkgName} 安装完成`);
|
|
62
|
+
} catch {
|
|
63
|
+
console.error(`✗ ${pkgName} 安装失败`);
|
|
64
|
+
process.exit(1);
|
|
81
65
|
}
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
// 3. 注册到配置
|
|
69
|
+
const config = readConfig();
|
|
70
|
+
if (!Array.isArray(config.platforms)) {
|
|
71
|
+
config.platforms = [];
|
|
72
|
+
}
|
|
73
|
+
if (!config.platforms.includes(name)) {
|
|
74
|
+
config.platforms.push(name);
|
|
75
|
+
writeConfig(config);
|
|
76
|
+
console.log(`✓ 已将 ${name} 添加到 alemon.config.yaml`);
|
|
77
|
+
} else {
|
|
78
|
+
console.log(`${name} 已在配置中`);
|
|
79
|
+
}
|
|
82
80
|
}
|
|
83
81
|
|
|
84
82
|
/**
|
|
@@ -86,71 +84,69 @@ export function platformAdd(name) {
|
|
|
86
84
|
* @param {string} name 平台名
|
|
87
85
|
*/
|
|
88
86
|
export function platformRemove(name) {
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
if (allDeps[pkgName]) {
|
|
99
|
-
console.log(`正在卸载 ${pkgName}...`);
|
|
100
|
-
try {
|
|
101
|
-
const cmd = pm === 'npm' ? `npm uninstall ${pkgName}` :
|
|
102
|
-
pm === 'pnpm' ? `pnpm remove ${pkgName}` :
|
|
103
|
-
`yarn remove ${pkgName}`;
|
|
104
|
-
execSync(cmd, {stdio: 'inherit', timeout: 60000});
|
|
105
|
-
console.log(`✓ ${pkgName} 已卸载`);
|
|
106
|
-
} catch {
|
|
107
|
-
console.warn(`✗ ${pkgName} 卸载失败,请手动移除`);
|
|
108
|
-
}
|
|
109
|
-
} else {
|
|
110
|
-
console.log(`${pkgName} 未安装,跳过卸载`);
|
|
111
|
-
}
|
|
112
|
-
}
|
|
87
|
+
const pkgName = `@alemonjs/${name}`;
|
|
88
|
+
const pm = detectPM();
|
|
89
|
+
|
|
90
|
+
// 1. 卸载包
|
|
91
|
+
const pkgPath = join(process.cwd(), 'package.json');
|
|
92
|
+
if (fs.existsSync(pkgPath)) {
|
|
93
|
+
const pkg = JSON.parse(fs.readFileSync(pkgPath, 'utf8'));
|
|
94
|
+
const allDeps = { ...pkg.dependencies, ...pkg.devDependencies };
|
|
113
95
|
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
const
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
96
|
+
if (allDeps[pkgName]) {
|
|
97
|
+
console.log(`正在卸载 ${pkgName}...`);
|
|
98
|
+
try {
|
|
99
|
+
const cmd = pm === 'npm' ? `npm uninstall ${pkgName}` : pm === 'pnpm' ? `pnpm remove ${pkgName}` : `yarn remove ${pkgName}`;
|
|
100
|
+
execSync(cmd, { stdio: 'inherit', timeout: 60000 });
|
|
101
|
+
console.log(`✓ ${pkgName} 已卸载`);
|
|
102
|
+
} catch {
|
|
103
|
+
console.warn(`✗ ${pkgName} 卸载失败,请手动移除`);
|
|
104
|
+
}
|
|
105
|
+
} else {
|
|
106
|
+
console.log(`${pkgName} 未安装,跳过卸载`);
|
|
107
|
+
}
|
|
108
|
+
}
|
|
109
|
+
|
|
110
|
+
// 2. 从配置中移除
|
|
111
|
+
const config = readConfig();
|
|
112
|
+
if (Array.isArray(config.platforms)) {
|
|
113
|
+
const idx = config.platforms.indexOf(name);
|
|
114
|
+
if (idx !== -1) {
|
|
115
|
+
config.platforms.splice(idx, 1);
|
|
116
|
+
writeConfig(config);
|
|
117
|
+
console.log(`✓ 已从 alemon.config.yaml 移除 ${name}`);
|
|
123
118
|
}
|
|
119
|
+
}
|
|
124
120
|
}
|
|
125
121
|
|
|
126
122
|
/**
|
|
127
123
|
* 列出已安装平台
|
|
128
124
|
*/
|
|
129
125
|
export function platformList() {
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
126
|
+
const pkgPath = join(process.cwd(), 'package.json');
|
|
127
|
+
if (!fs.existsSync(pkgPath)) {
|
|
128
|
+
console.error('未找到 package.json');
|
|
129
|
+
return;
|
|
130
|
+
}
|
|
131
|
+
|
|
132
|
+
const pkg = JSON.parse(fs.readFileSync(pkgPath, 'utf8'));
|
|
133
|
+
const allDeps = { ...pkg.dependencies, ...pkg.devDependencies };
|
|
134
|
+
const installed = Object.keys(allDeps).filter(n => n.startsWith('@alemonjs/'));
|
|
135
|
+
|
|
136
|
+
const config = readConfig();
|
|
137
|
+
const configured = Array.isArray(config.platforms) ? config.platforms : [];
|
|
138
|
+
|
|
139
|
+
console.log('=== 平台列表 ===\n');
|
|
140
|
+
|
|
141
|
+
if (installed.length === 0) {
|
|
142
|
+
console.log('未安装任何 @alemonjs/* 平台包');
|
|
143
|
+
return;
|
|
144
|
+
}
|
|
145
|
+
|
|
146
|
+
for (const name of installed) {
|
|
147
|
+
const short = name.replace('@alemonjs/', '');
|
|
148
|
+
const inConfig = configured.includes(short);
|
|
149
|
+
const ver = allDeps[name];
|
|
150
|
+
console.log(` ${inConfig ? '●' : '○'} ${short} (${ver})${inConfig ? '' : ' [未注册到配置]'}`);
|
|
151
|
+
}
|
|
156
152
|
}
|
package/bin/versionUpdate.js
CHANGED
|
@@ -1,70 +1,70 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
import {join} from 'path';
|
|
2
|
+
import { join } from 'path';
|
|
3
3
|
import fs from 'fs';
|
|
4
|
-
import {execSync} from 'child_process';
|
|
4
|
+
import { execSync } from 'child_process';
|
|
5
5
|
|
|
6
6
|
/**
|
|
7
7
|
* 检查并更新 alemonjs 相关包到最新版本
|
|
8
8
|
*/
|
|
9
9
|
export async function versionUpdate() {
|
|
10
|
-
|
|
10
|
+
const pkgPath = join(process.cwd(), 'package.json');
|
|
11
11
|
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
12
|
+
if (!fs.existsSync(pkgPath)) {
|
|
13
|
+
console.error('未找到 package.json');
|
|
14
|
+
process.exit(1);
|
|
15
|
+
}
|
|
16
16
|
|
|
17
|
-
|
|
18
|
-
|
|
17
|
+
const raw = fs.readFileSync(pkgPath, 'utf8');
|
|
18
|
+
const pkg = JSON.parse(raw);
|
|
19
19
|
|
|
20
|
-
|
|
21
|
-
|
|
20
|
+
const depFields = ['dependencies', 'devDependencies'];
|
|
21
|
+
const matched = [];
|
|
22
22
|
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
}
|
|
23
|
+
for (const field of depFields) {
|
|
24
|
+
const deps = pkg[field];
|
|
25
|
+
if (!deps) continue;
|
|
26
|
+
for (const name of Object.keys(deps)) {
|
|
27
|
+
if (name === 'alemonjs' || name.startsWith('@alemonjs/')) {
|
|
28
|
+
matched.push({ field, name, current: deps[name] });
|
|
29
|
+
}
|
|
31
30
|
}
|
|
31
|
+
}
|
|
32
32
|
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
33
|
+
if (matched.length === 0) {
|
|
34
|
+
console.log('未找到 alemonjs 或 @alemonjs/* 相关依赖');
|
|
35
|
+
return;
|
|
36
|
+
}
|
|
37
37
|
|
|
38
|
-
|
|
38
|
+
console.log(`找到 ${matched.length} 个相关包,正在查询最新版本...\n`);
|
|
39
39
|
|
|
40
|
-
|
|
40
|
+
let updated = 0;
|
|
41
41
|
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
42
|
+
for (const item of matched) {
|
|
43
|
+
try {
|
|
44
|
+
const latest = execSync(`npm view ${item.name} version`, {
|
|
45
|
+
encoding: 'utf8',
|
|
46
|
+
timeout: 15000
|
|
47
|
+
}).trim();
|
|
48
48
|
|
|
49
|
-
|
|
49
|
+
const currentClean = item.current.replace(/^[\^~>=<]*/, '');
|
|
50
50
|
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
}
|
|
51
|
+
if (currentClean === latest) {
|
|
52
|
+
console.log(` ✓ ${item.name} 已是最新 (${latest})`);
|
|
53
|
+
} else {
|
|
54
|
+
const prefix = item.current.match(/^([\^~]?)/)?.[1] ?? '^';
|
|
55
|
+
pkg[item.field][item.name] = `${prefix}${latest}`;
|
|
56
|
+
console.log(` ↑ ${item.name} ${item.current} → ${prefix}${latest}`);
|
|
57
|
+
updated++;
|
|
58
|
+
}
|
|
59
|
+
} catch {
|
|
60
|
+
console.warn(` ✗ ${item.name} 查询失败,跳过`);
|
|
62
61
|
}
|
|
62
|
+
}
|
|
63
63
|
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
64
|
+
if (updated > 0) {
|
|
65
|
+
fs.writeFileSync(pkgPath, JSON.stringify(pkg, null, 2) + '\n');
|
|
66
|
+
console.log(`\n已更新 ${updated} 个包,请执行 npm install 安装最新版本`);
|
|
67
|
+
} else {
|
|
68
|
+
console.log('\n所有包均为最新版本');
|
|
69
|
+
}
|
|
70
70
|
}
|
|
@@ -2,7 +2,7 @@ import { getConfigValue } from '../core/config.js';
|
|
|
2
2
|
import { processorRepeatedClearTimeMin, processorRepeatedClearTimeMax, processorRepeatedEventTime, processorRepeatedUserTime, processorRepeatedClearSize, processorMaxMapSize } from '../core/variable.js';
|
|
3
3
|
import { expendCycle } from './event-processor-cycle.js';
|
|
4
4
|
import { ProcessorEventAutoClearMap, ProcessorEventUserAutoClearMap } from './store.js';
|
|
5
|
-
import { getCachedRegExp, fastHash } from '../core/utils.js';
|
|
5
|
+
import { getCachedRegExp, matchIn, fastHash } from '../core/utils.js';
|
|
6
6
|
|
|
7
7
|
const filter = ({ Now, store, INTERVAL }, MessageId) => {
|
|
8
8
|
if (store.has(MessageId)) {
|
|
@@ -69,12 +69,12 @@ const onProcessor = (name, event, data) => {
|
|
|
69
69
|
if (disabledSelects[name]) {
|
|
70
70
|
return;
|
|
71
71
|
}
|
|
72
|
-
const disabledUserId = value?.disabled_user_id
|
|
73
|
-
if (event['UserId'] && disabledUserId
|
|
72
|
+
const disabledUserId = value?.disabled_user_id;
|
|
73
|
+
if (event['UserId'] && matchIn(disabledUserId, event['UserId'])) {
|
|
74
74
|
return;
|
|
75
75
|
}
|
|
76
|
-
const disabledUserKey = value?.disabled_user_key
|
|
77
|
-
if (event['UserKey'] && disabledUserKey
|
|
76
|
+
const disabledUserKey = value?.disabled_user_key;
|
|
77
|
+
if (event['UserKey'] && matchIn(disabledUserKey, event['UserKey'])) {
|
|
78
78
|
return;
|
|
79
79
|
}
|
|
80
80
|
const redirectRegular = value?.redirect_regular ?? value?.redirect_text_regular;
|
|
@@ -98,20 +98,20 @@ const onProcessor = (name, event, data) => {
|
|
|
98
98
|
}
|
|
99
99
|
}
|
|
100
100
|
}
|
|
101
|
-
const masterId = value?.master_id
|
|
102
|
-
const masterKey = value?.master_key
|
|
103
|
-
if (event['UserId'] && masterId
|
|
101
|
+
const masterId = value?.master_id;
|
|
102
|
+
const masterKey = value?.master_key;
|
|
103
|
+
if (event['UserId'] && matchIn(masterId, event['UserId'])) {
|
|
104
104
|
event['isMaster'] = true;
|
|
105
105
|
}
|
|
106
|
-
else if (event['UserKey'] && masterKey
|
|
106
|
+
else if (event['UserKey'] && matchIn(masterKey, event['UserKey'])) {
|
|
107
107
|
event['isMaster'] = true;
|
|
108
108
|
}
|
|
109
|
-
const botId = value?.bot_id
|
|
110
|
-
const botKey = value?.bot_key
|
|
111
|
-
if (event['UserId'] && botId
|
|
109
|
+
const botId = value?.bot_id;
|
|
110
|
+
const botKey = value?.bot_key;
|
|
111
|
+
if (event['UserId'] && matchIn(botId, event['UserId'])) {
|
|
112
112
|
event['isBot'] = true;
|
|
113
113
|
}
|
|
114
|
-
else if (event['UserKey'] && botKey
|
|
114
|
+
else if (event['UserKey'] && matchIn(botKey, event['UserKey'])) {
|
|
115
115
|
event['isBot'] = true;
|
|
116
116
|
}
|
|
117
117
|
const Now = Date.now();
|
|
@@ -32,7 +32,7 @@ declare const Markdown: {
|
|
|
32
32
|
italic(text: string): DataMarkdownItalic;
|
|
33
33
|
italicStar(text: string): DataMarkdownItalicStar;
|
|
34
34
|
strikethrough(text: string): DataMarkdownStrikethrough;
|
|
35
|
-
link(text: string, url
|
|
35
|
+
link(text: string, url?: string): DataMarkdownLink;
|
|
36
36
|
image(url: string, options?: {
|
|
37
37
|
width?: number;
|
|
38
38
|
height?: number;
|
|
@@ -56,7 +56,7 @@ export declare const MD: {
|
|
|
56
56
|
italic(text: string): DataMarkdownItalic;
|
|
57
57
|
italicStar(text: string): DataMarkdownItalicStar;
|
|
58
58
|
strikethrough(text: string): DataMarkdownStrikethrough;
|
|
59
|
-
link(text: string, url
|
|
59
|
+
link(text: string, url?: string): DataMarkdownLink;
|
|
60
60
|
image(url: string, options?: {
|
|
61
61
|
width?: number;
|
|
62
62
|
height?: number;
|
package/lib/core/config.d.ts
CHANGED
|
@@ -1,6 +1,43 @@
|
|
|
1
1
|
import type { Package } from '../types';
|
|
2
2
|
type ConfigValue = {
|
|
3
3
|
[key: string]: any;
|
|
4
|
+
master_key?: {
|
|
5
|
+
[key: string]: boolean;
|
|
6
|
+
} | string[];
|
|
7
|
+
master_id?: {
|
|
8
|
+
[key: string]: boolean;
|
|
9
|
+
} | string[];
|
|
10
|
+
bot_key?: {
|
|
11
|
+
[key: string]: boolean;
|
|
12
|
+
} | string[];
|
|
13
|
+
bot_id?: {
|
|
14
|
+
[key: string]: boolean;
|
|
15
|
+
} | string[];
|
|
16
|
+
disabled_text_regular?: string;
|
|
17
|
+
disabled_selects?: {
|
|
18
|
+
[key: string]: boolean;
|
|
19
|
+
};
|
|
20
|
+
disabled_user_id?: {
|
|
21
|
+
[key: string]: boolean;
|
|
22
|
+
} | string[];
|
|
23
|
+
disabled_user_key?: {
|
|
24
|
+
[key: string]: boolean;
|
|
25
|
+
} | string[];
|
|
26
|
+
redirect_regular?: string;
|
|
27
|
+
redirect_target?: string;
|
|
28
|
+
redirect_text_regular?: string;
|
|
29
|
+
redirect_text_target?: string;
|
|
30
|
+
mapping_text?: {
|
|
31
|
+
regular?: string;
|
|
32
|
+
target?: string;
|
|
33
|
+
}[];
|
|
34
|
+
processor?: {
|
|
35
|
+
repeated_event_time?: number;
|
|
36
|
+
repeated_user_time?: number;
|
|
37
|
+
};
|
|
38
|
+
apps?: string[] | {
|
|
39
|
+
[key: string]: boolean;
|
|
40
|
+
};
|
|
4
41
|
};
|
|
5
42
|
type ConfigListener<T extends ConfigValue = ConfigValue> = (value: T) => void;
|
|
6
43
|
declare class ConfigCore<T extends ConfigValue = ConfigValue> {
|
package/lib/core/index.js
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
export { ResultCode } from './variable.js';
|
|
2
2
|
export { getConfig, getConfigValue, onWatchConfigValue } from './config.js';
|
|
3
|
-
export { createEventName, createHash, createResult, createUserHashKey, fastHash, getCachedRegExp, getInputExportPath, getRecursiveDirFiles, isMaster, sanitizeForSerialization, showErrorModule, stringToNumber, useUserHashKey } from './utils.js';
|
|
3
|
+
export { createEventName, createHash, createResult, createUserHashKey, fastHash, getCachedRegExp, getInputExportPath, getRecursiveDirFiles, isMaster, matchIn, sanitizeForSerialization, showErrorModule, stringToNumber, useUserHashKey } from './utils.js';
|
package/lib/core/utils.d.ts
CHANGED
|
@@ -14,7 +14,8 @@ export declare const useUserHashKey: (event: {
|
|
|
14
14
|
UserId: string;
|
|
15
15
|
Platform: string;
|
|
16
16
|
}) => string;
|
|
17
|
-
export declare const
|
|
17
|
+
export declare const matchIn: (source: any, key: string) => boolean;
|
|
18
|
+
export declare const isMaster: (UserId: string, platform: string) => boolean;
|
|
18
19
|
export declare const createEventName: (url: string, appKey: string) => string;
|
|
19
20
|
export declare const stringToNumber: (str: string, size?: number) => number;
|
|
20
21
|
export declare const getRecursiveDirFiles: (dir: string, condition?: (func: Dirent) => boolean) => {
|
package/lib/core/utils.js
CHANGED
|
@@ -37,20 +37,23 @@ const createUserHashKey = (event) => {
|
|
|
37
37
|
return fastHash(`${event.Platform}:${event.UserId}`);
|
|
38
38
|
};
|
|
39
39
|
const useUserHashKey = createUserHashKey;
|
|
40
|
+
const matchIn = (source, key) => {
|
|
41
|
+
if (Array.isArray(source)) {
|
|
42
|
+
return source.includes(key);
|
|
43
|
+
}
|
|
44
|
+
if (source && typeof source === 'object') {
|
|
45
|
+
return Object.prototype.hasOwnProperty.call(source, key) && !!source[key];
|
|
46
|
+
}
|
|
47
|
+
return false;
|
|
48
|
+
};
|
|
40
49
|
const isMaster = (UserId, platform) => {
|
|
41
50
|
const values = getConfigValue() || {};
|
|
42
|
-
const
|
|
43
|
-
const mainMasterId = values.master_id || [];
|
|
44
|
-
const value = values[platform] || {};
|
|
45
|
-
const masterKey = value.master_key || [];
|
|
46
|
-
const masterId = value.master_id || [];
|
|
51
|
+
const value = values[platform] && typeof values[platform] === 'object' ? values[platform] : {};
|
|
47
52
|
const UserKey = createUserHashKey({
|
|
48
53
|
Platform: platform,
|
|
49
54
|
UserId: UserId
|
|
50
55
|
});
|
|
51
|
-
|
|
52
|
-
const cMasterId = mainMasterId.concat(masterId);
|
|
53
|
-
return cMaster.includes(UserKey) || cMasterId.includes(UserId);
|
|
56
|
+
return matchIn(values.master_key, UserKey) || matchIn(values.master_id, UserId) || matchIn(value.master_key, UserKey) || matchIn(value.master_id, UserId);
|
|
54
57
|
};
|
|
55
58
|
const createEventName = (url, appKey) => {
|
|
56
59
|
let uri = url;
|
|
@@ -152,4 +155,4 @@ const createResult = (code, message, data) => {
|
|
|
152
155
|
};
|
|
153
156
|
};
|
|
154
157
|
|
|
155
|
-
export { createEventName, createHash, createResult, createUserHashKey, fastHash, getCachedRegExp, getInputExportPath, getRecursiveDirFiles, isMaster, sanitizeForSerialization, showErrorModule, stringToNumber, useUserHashKey };
|
|
158
|
+
export { createEventName, createHash, createResult, createUserHashKey, fastHash, getCachedRegExp, getInputExportPath, getRecursiveDirFiles, isMaster, matchIn, sanitizeForSerialization, showErrorModule, stringToNumber, useUserHashKey };
|
package/lib/global.d.ts
CHANGED
|
@@ -1,7 +1,9 @@
|
|
|
1
|
-
import type { DefineChildrenFunc, OnResponseReversalFunc, OnMiddlewareReversalFunc, OnSelectsFunc, OnDataFormatFunc, OnResponseReversalFuncBack, OnGroupFunc, OnMiddlewareReversalFuncBack, DefineResponseFunc, defineMiddlewareFunc, StoreChildrenApp, StateSubscribeMap, SubscribeKeysMap, LoggerUtils, ResponseState } from './types';
|
|
1
|
+
import type { DefineChildrenFunc, OnResponseReversalFunc, OnMiddlewareReversalFunc, OnSelectsFunc, OnDataFormatFunc, OnResponseReversalFuncBack, OnGroupFunc, OnMiddlewareReversalFuncBack, DefineResponseFunc, defineMiddlewareFunc, StoreChildrenApp, StateSubscribeMap, SubscribeKeysMap, LoggerUtils, ResponseState, StartOptions } from './types';
|
|
2
2
|
import WebSocket, { Server } from 'ws';
|
|
3
3
|
import { IncomingMessage } from 'http';
|
|
4
4
|
declare global {
|
|
5
|
+
var __config: any;
|
|
6
|
+
var __options: StartOptions;
|
|
5
7
|
var logger: LoggerUtils;
|
|
6
8
|
var alemonjsCore: {
|
|
7
9
|
storeState: ResponseState;
|
package/lib/index.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
export { ActionsEventEnum } from './types/event/actions.js';
|
|
2
2
|
export { ResultCode } from './core/variable.js';
|
|
3
3
|
export { getConfig, getConfigValue, onWatchConfigValue } from './core/config.js';
|
|
4
|
-
export { createEventName, createHash, createResult, createUserHashKey, fastHash, getCachedRegExp, getInputExportPath, getRecursiveDirFiles, isMaster, sanitizeForSerialization, showErrorModule, stringToNumber, useUserHashKey } from './core/utils.js';
|
|
4
|
+
export { createEventName, createHash, createResult, createUserHashKey, fastHash, getCachedRegExp, getInputExportPath, getRecursiveDirFiles, isMaster, matchIn, sanitizeForSerialization, showErrorModule, stringToNumber, useUserHashKey } from './core/utils.js';
|
|
5
5
|
export { cbpClient } from './cbp/connects/client.js';
|
|
6
6
|
export { cbpPlatform } from './cbp/connects/platform.js';
|
|
7
7
|
export { cbpServer } from './cbp/server/main.js';
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "alemonjs",
|
|
3
|
-
"version": "2.1.
|
|
3
|
+
"version": "2.1.48",
|
|
4
4
|
"description": "bot script",
|
|
5
5
|
"author": "lemonade",
|
|
6
6
|
"license": "MIT",
|
|
@@ -28,8 +28,8 @@
|
|
|
28
28
|
},
|
|
29
29
|
"dependencies": {
|
|
30
30
|
"@koa/cors": "^5.0.0",
|
|
31
|
-
"axios": "^1.
|
|
32
|
-
"chalk": "^5.
|
|
31
|
+
"axios": "^1.14.0",
|
|
32
|
+
"chalk": "^5.6.2",
|
|
33
33
|
"commander": "^13.1.0",
|
|
34
34
|
"file-type": "21.0.0",
|
|
35
35
|
"flatted": "^3.3.3",
|
|
@@ -69,5 +69,5 @@
|
|
|
69
69
|
"type": "git",
|
|
70
70
|
"url": "https://github.com/lemonade-lab/alemonjs.git"
|
|
71
71
|
},
|
|
72
|
-
"gitHead": "
|
|
73
|
-
}
|
|
72
|
+
"gitHead": "e50477125586204c6e56a8ecfe3391136f5fe74b"
|
|
73
|
+
}
|