alemonjs 2.1.1 → 2.1.2
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_CONFIG.md +15 -14
- package/dist/alemonjs.es.js +63784 -0
- package/lib/app/load_modules/loadChild.js +4 -2
- package/lib/app/store.js +13 -2
- package/lib/cbp/connects/client.js +2 -6
- package/lib/cbp/core/load-balancer.js +1 -2
- package/lib/cbp/processor/config.js +1 -1
- package/lib/core/config.js +9 -0
- package/lib/core/utils.js +6 -4
- package/lib/polyfills/fs-promises.d.ts +7 -0
- package/lib/polyfills/fs-promises.js +18 -0
- package/lib/polyfills/fs.d.ts +23 -0
- package/lib/polyfills/fs.js +66 -0
- package/lib/polyfills/util-types.d.ts +33 -0
- package/lib/polyfills/util-types.js +36 -0
- package/lib/process/module.js +6 -4
- package/lib/process/platform.js +6 -4
- package/package.json +8 -4
package/README_CONFIG.md
CHANGED
|
@@ -148,18 +148,19 @@ alemonc get login
|
|
|
148
148
|
## 基础环境变量
|
|
149
149
|
|
|
150
150
|
`platform`:`string` - 平台标识,支持的平台类型包括:
|
|
151
|
-
|
|
152
|
-
- `
|
|
153
|
-
- `
|
|
151
|
+
|
|
152
|
+
- `discord` - Discord 平台
|
|
153
|
+
- `qq` - QQ 平台
|
|
154
|
+
- `telegram` - Telegram 平台
|
|
154
155
|
- 或其他自定义平台包名(如:`@alemonjs/xxx`)
|
|
155
156
|
|
|
156
157
|
`login`:`string` - 登录标识,通常与平台名称相同或为平台的特定实例名
|
|
157
158
|
|
|
158
|
-
`url`:`string` - CBP服务器连接地址,默认为 `ws://127.0.0.1:17117`
|
|
159
|
+
`url`:`string` - CBP 服务器连接地址,默认为 `ws://127.0.0.1:17117`
|
|
159
160
|
|
|
160
|
-
`port`:`string | number` - CBP服务器端口,默认为 `17117`
|
|
161
|
+
`port`:`string | number` - CBP 服务器端口,默认为 `17117`
|
|
161
162
|
|
|
162
|
-
`serverPort`:`string | number` - 应用服务器端口(可选,仅在需要启动Web服务时设置)
|
|
163
|
+
`serverPort`:`string | number` - 应用服务器端口(可选,仅在需要启动 Web 服务时设置)
|
|
163
164
|
|
|
164
165
|
`is_full_receive`:`string` - 是否全量接收消息,可选值:`'true'` | `'1'` | `'false'` | `'0'`
|
|
165
166
|
|
|
@@ -179,7 +180,7 @@ alemonc get login
|
|
|
179
180
|
|
|
180
181
|
ChatBot Protocol
|
|
181
182
|
|
|
182
|
-
ALemonJS的核心通信协议,负责客户端与平台之间的消息传输和负载均衡。
|
|
183
|
+
ALemonJS 的核心通信协议,负责客户端与平台之间的消息传输和负载均衡。
|
|
183
184
|
|
|
184
185
|
### 负载均衡策略
|
|
185
186
|
|
|
@@ -190,13 +191,13 @@ loadBalanceStrategy: 'least-connections' # 默认策略
|
|
|
190
191
|
# 支持的策略类型:
|
|
191
192
|
# - 'round-robin': 轮询算法
|
|
192
193
|
# - 'least-connections': 最少连接算法(推荐)
|
|
193
|
-
# - 'random': 随机算法
|
|
194
|
+
# - 'random': 随机算法
|
|
194
195
|
# - 'first-available': 首个可用算法
|
|
195
196
|
|
|
196
197
|
# 支持的策略类型:
|
|
197
198
|
# - 'round-robin': 轮询算法
|
|
198
199
|
# - 'least-connections': 最少连接算法(推荐)
|
|
199
|
-
# - 'random': 随机算法
|
|
200
|
+
# - 'random': 随机算法
|
|
200
201
|
# - 'first-available': 首个可用算法
|
|
201
202
|
|
|
202
203
|
#1. **轮询算法 (round-robin)**
|
|
@@ -220,23 +221,23 @@ loadBalanceStrategy: 'least-connections' # 默认策略
|
|
|
220
221
|
# - 适用于有优先级需求的场景
|
|
221
222
|
```
|
|
222
223
|
|
|
223
|
-
### CBP连接配置
|
|
224
|
+
### CBP 连接配置
|
|
224
225
|
|
|
225
226
|
```yaml
|
|
226
227
|
# CBP服务器配置
|
|
227
228
|
cbp:
|
|
228
229
|
# 连接超时时间(毫秒)
|
|
229
230
|
timeout: 180000 # 3分钟
|
|
230
|
-
|
|
231
|
+
|
|
231
232
|
# 重连间隔(毫秒)
|
|
232
233
|
reconnectInterval: 6000 # 6秒
|
|
233
|
-
|
|
234
|
+
|
|
234
235
|
# 心跳间隔(毫秒)
|
|
235
236
|
heartbeatInterval: 18000 # 18秒
|
|
236
|
-
|
|
237
|
+
|
|
237
238
|
# 健康检查间隔(毫秒)
|
|
238
239
|
healthCheckInterval: 30000 # 30秒
|
|
239
|
-
|
|
240
|
+
|
|
240
241
|
# 连接认证头配置
|
|
241
242
|
headers:
|
|
242
243
|
user-agent: 'platform' # 平台标识
|