@maiyunnet/kebab 9.26.4 → 9.27.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/abox/response.d.ts +3 -0
- package/abox/response.js +59 -0
- package/abox/rpc.d.ts +14 -0
- package/abox/rpc.js +116 -0
- package/abox/text-path.d.ts +3 -0
- package/abox/text-path.js +94 -0
- package/doc/kebab-rag.md +645 -289
- package/index.d.ts +1 -1
- package/index.js +1 -1
- package/lib/core/rpc.d.ts +61 -0
- package/lib/core/rpc.js +51 -0
- package/lib/core.d.ts +3 -4
- package/lib/core.js +36 -50
- package/lib/text.d.ts +6 -3
- package/lib/text.js +26 -61
- package/lib/undici.js +11 -0
- package/package.json +1 -1
- package/sys/child.js +19 -5
- package/sys/cmd.js +5 -4
- package/sys/ctr.js +1 -1
- package/sys/master.js +256 -260
- package/sys/mod.d.ts +16 -7
- package/sys/mod.js +111 -52
- package/sys/monitor/watchdog.js +3 -3
- package/sys/route.js +21 -22
- package/www/example/abox/core-updatecode.d.ts +2 -0
- package/www/example/abox/core-updatecode.js +43 -0
- package/www/example/ctr/test.d.ts +4 -0
- package/www/example/ctr/test.js +29 -4
- package/www/example/mod/test.js +2 -2
package/doc/kebab-rag.md
CHANGED
|
@@ -37,6 +37,18 @@ quick-start.md
|
|
|
37
37
|
- `view/`: 视图目录,存放 ejs 文件
|
|
38
38
|
- `ws/`: WebSocket 目录
|
|
39
39
|
|
|
40
|
+
## RPC 管理通信
|
|
41
|
+
|
|
42
|
+
管理端和被管理节点须使用相同的当前 RPC 协议;旧版 ECB 请求不再接受,升级时需同时更新两端。`rpcSecret` 至少 32 个字符,拒绝空白、占位值和明显重复值。初始化缺省值由 32 个随机字节生成,已有配置不会自动替换;各管理节点使用约定的密钥。
|
|
43
|
+
|
|
44
|
+
命令使用 AES-256-GCM 认证加密,绑定 HTTP 方法及完整请求体的 SHA-256 摘要。接收端在执行动作前验证正文;时间戳允许前后 5 秒,同一 master 进程内的 nonce 在有效期内只接受一次。认证失败统一返回 401,按直连 IP 限制失败尝试并限制审计输出频率。
|
|
45
|
+
|
|
46
|
+
`updateCode()` 保留公开参数,通过独立文件流向各节点发送 ZIP,压缩包上限 512 MiB;上传先保存到受限临时文件,摘要校验通过后部署,失败或处理结束后清理。`sendVhost()` 的 JSON 正文上限为 50 MiB。
|
|
47
|
+
|
|
48
|
+
RPC 仍使用 HTTP,正文和响应不提供传输保密,nonce 缓存不跨 master 完全重启或共享密钥的其他节点。管理端口应处于受控网络,或经 VPN/TLS 隧道访问;认证协议不替代网络隔离。
|
|
49
|
+
|
|
50
|
+
`lCore.ls()` 的路径相对运行根目录,首尾 `/` 可省略;接收端校验真实文件路径,拒绝越界的 `..` 和指向根目录外的软链接。根目录内的软链接仍可使用。
|
|
51
|
+
|
|
40
52
|
## 全量更新虚拟主机配置
|
|
41
53
|
|
|
42
54
|
`lCore.sendVhost(files, hosts?)` 全量替换目标节点的 `conf/vhost/`,未提交的旧文件及子目录会被移除。`files` 是文件名到 JSON 原文的非空集合,仅接受直接 `.json` 文件名,不允许路径及大小写重名;每份 JSON 为 `IVhost` 或 `IVhost[]`。文件原文会被保留。
|
|
@@ -50,7 +62,7 @@ const results = await lCore.sendVhost({
|
|
|
50
62
|
}, 'config');
|
|
51
63
|
```
|
|
52
64
|
|
|
53
|
-
省略 `hosts` 或传入空列表时更新本机;传入 `'config'` 使用全局 `hosts`,也可指定节点列表。各节点独立返回 `{ result, return }`,失败节点可单独重试。接收端复用 RPC 鉴权,通过 POST body
|
|
65
|
+
省略 `hosts` 或传入空列表时更新本机;传入 `'config'` 使用全局 `hosts`,也可指定节点列表。各节点独立返回 `{ result, return }`,失败节点可单独重试。接收端复用 RPC 鉴权,通过 POST body 接收配置,不传输证书或全局配置。
|
|
54
66
|
|
|
55
67
|
同一节点串行执行替换。全部文件校验、写入临时目录成功后,才备份旧目录并切换;切换失败会恢复旧目录。若恢复也失败,返回信息会给出保留的备份目录,需人工恢复;目标 `vhost` 本身是软链接或普通文件时拒绝更新。替换包含两次目录重命名,过程中不要同时执行 reload 或手动修改该目录。
|
|
56
68
|
|
|
@@ -60,8 +72,28 @@ const results = await lCore.sendVhost({
|
|
|
60
72
|
|
|
61
73
|
控制器通过 `this._config.const.hostCanonical` 获取用于 URL 的主机地址:HTTPS 的 443 和 HTTP 的 80 端口会省略,其余端口及 IPv6 方括号保留。`host`、`hostname` 和 `hostport` 保留原有含义。`urlOrigin`、`urlFull` 和 `urlStcFull` 使用 `hostCanonical` 生成,SSR 注入的 `_urlFull`、默认 `_staticPathFull` 同步省略默认端口。
|
|
62
74
|
|
|
75
|
+
`lText.urlAtom()` 按完整路径段处理 `.` 和 `..`,保留普通文件名、查询串和片段中的文本;相对路径中无法抵消的 `..` 会保留。`urlResolve(from, to, true)` 将 `from` 视为目录,越界时返回基准目录;文件系统访问仍须校验真实路径及软链接。
|
|
76
|
+
|
|
77
|
+
查询串和表单解析中的 `+` 表示空格,需要传递字面加号时使用 `%2B`;重复参数仍返回字符串数组。
|
|
78
|
+
|
|
79
|
+
## 访问日志
|
|
80
|
+
|
|
81
|
+
HTTP 和 WebSocket 请求匹配有效 vhost 后即写入一条 `-visit` 日志,覆盖反代、静态文件、404 和中间件提前响应。记录发生在路由和控制器执行前;`onReqStart()` 返回 `-1` 不影响记录,控制器与 `rproxy()` 不再额外记录。
|
|
82
|
+
|
|
83
|
+
访问 URL 使用本次连接的协议、请求 Host(HTTP/2 为 `:authority`)及原始路径、查询串;UA 和来源 IP 直接从请求头与连接获取,无需解析请求体。此记录表示请求到达,不包含最终响应状态或耗时。
|
|
84
|
+
|
|
85
|
+
`Core.log` 不采集 Cookie、Session 或请求体。JSONL 和 CSV 均不包含 Cookie、Session 字段。旧日志内容不变。
|
|
86
|
+
|
|
87
|
+
## React 页面与浏览器资源
|
|
88
|
+
|
|
89
|
+
控制器负责业务数据与权限判断,再将可公开的 props 传入 `_loadReactPage()`。`stc/` 中的 React 页面及组件用于 SSR 和浏览器水合;Node 加载 TypeScript 生成的 `.page.js`,浏览器加载构建生成的 `.page.bundle.js`、共享 chunk 和 CSS。静态资源仍可公开访问,不应在这些组件或水合 props 中放置服务端秘密。
|
|
90
|
+
|
|
91
|
+
水合数据以 JSON 嵌入页面,框架会转义 `<`,浏览器解析后恢复原始值。`hydrate: false` 仅输出渲染后的 HTML。
|
|
92
|
+
|
|
63
93
|
## 代理请求头模式
|
|
64
94
|
|
|
95
|
+
HTTP `rproxy` 会校验拼接后的目标 URL;协议必须为 HTTP 或 HTTPS,且 origin 必须与配置的上游一致,否则返回 `false`。
|
|
96
|
+
|
|
65
97
|
`lib/undici` 和 `lib/ws` 的 `rproxy` 支持三种 `proxyMode`,`mproxy` 支持 `passthrough` 和 `request`:
|
|
66
98
|
|
|
67
99
|
| 值 | 请求头行为 |
|
|
@@ -375,7 +407,7 @@ if (started === false) {
|
|
|
375
407
|
|
|
376
408
|
## 监控日志
|
|
377
409
|
|
|
378
|
-
主线程与看门狗的监控简讯保存到 `log/system-monitor/YYYY/MM/DD/HH.jsonl` 或 `HH.csv`,采用框架的 `logFormat` 配置,默认 `jsonl`。JSONL 字段和 CSV
|
|
410
|
+
主线程与看门狗的监控简讯保存到 `log/system-monitor/YYYY/MM/DD/HH.jsonl` 或 `HH.csv`,采用框架的 `logFormat` 配置,默认 `jsonl`。JSONL 字段和 CSV 列顺序与 `Core.log` 一致,可通过 `Core.getLog` 读取,指定 `hostname='system'`、`fend='-monitor'` 和对应日期、小时的 `path`。看门狗在主线程阻塞时仍独立写盘;热重载后的日志格式随下一次主线程采样同步到看门狗。
|
|
379
411
|
|
|
380
412
|
日志用于查看异常简讯和诊断目录。完整的采样、诊断结果与 Profile 等取证文件保存在下述 `log/monitor/` 目录,不作为普通日志行返回。
|
|
381
413
|
|
|
@@ -1534,6 +1566,7 @@ index.md
|
|
|
1534
1566
|
- [lib/consistent](lib/consistent/index.md)
|
|
1535
1567
|
- [lib/cookie](lib/cookie/index.md)
|
|
1536
1568
|
- [lib/core](lib/core/index.md)
|
|
1569
|
+
- [lib/core/rpc](lib/core/rpc/index.md)
|
|
1537
1570
|
- [lib/cron](lib/cron/index.md)
|
|
1538
1571
|
- [lib/crypto](lib/crypto/index.md)
|
|
1539
1572
|
- [lib/db](lib/db/index.md)
|
|
@@ -1794,7 +1827,7 @@ index/variables/VER.md
|
|
|
1794
1827
|
|
|
1795
1828
|
# Variable: VER
|
|
1796
1829
|
|
|
1797
|
-
> `const` **VER**: `"9.
|
|
1830
|
+
> `const` **VER**: `"9.27.0"` = `'9.27.0'`
|
|
1798
1831
|
|
|
1799
1832
|
Defined in: [index.ts:9](https://github.com/maiyunnet/kebab/blob/master/index.ts#L9)
|
|
1800
1833
|
|
|
@@ -3708,7 +3741,7 @@ lib/core/functions/checkSchema.md
|
|
|
3708
3741
|
|
|
3709
3742
|
> **checkSchema**(`val`, `schema`): `string`
|
|
3710
3743
|
|
|
3711
|
-
Defined in: [lib/core.ts:
|
|
3744
|
+
Defined in: [lib/core.ts:308](https://github.com/maiyunnet/kebab/blob/master/lib/core.ts#L308)
|
|
3712
3745
|
|
|
3713
3746
|
判断一个对象是否符合 JSON Schema
|
|
3714
3747
|
|
|
@@ -3743,7 +3776,7 @@ lib/core/functions/checkType.md
|
|
|
3743
3776
|
|
|
3744
3777
|
> **checkType**(`val`, `type`, `tree?`): `string`
|
|
3745
3778
|
|
|
3746
|
-
Defined in: [lib/core.ts:
|
|
3779
|
+
Defined in: [lib/core.ts:220](https://github.com/maiyunnet/kebab/blob/master/lib/core.ts#L220)
|
|
3747
3780
|
|
|
3748
3781
|
判断一个对象是否符合示例组,返回空字符串代表校验通过,返回:应该的类型:位置:传入的类型
|
|
3749
3782
|
|
|
@@ -3784,7 +3817,7 @@ lib/core/functions/clone.md
|
|
|
3784
3817
|
|
|
3785
3818
|
> **clone**\<`T`\>(`obj`): `T`
|
|
3786
3819
|
|
|
3787
|
-
Defined in: [lib/core.ts:
|
|
3820
|
+
Defined in: [lib/core.ts:1493](https://github.com/maiyunnet/kebab/blob/master/lib/core.ts#L1493)
|
|
3788
3821
|
|
|
3789
3822
|
完整的克隆一份数组/对象
|
|
3790
3823
|
|
|
@@ -3819,7 +3852,7 @@ lib/core/functions/convert62.md
|
|
|
3819
3852
|
|
|
3820
3853
|
> **convert62**(`n`): `string`
|
|
3821
3854
|
|
|
3822
|
-
Defined in: [lib/core.ts:
|
|
3855
|
+
Defined in: [lib/core.ts:161](https://github.com/maiyunnet/kebab/blob/master/lib/core.ts#L161)
|
|
3823
3856
|
|
|
3824
3857
|
将 10 进制转换为 62 进制
|
|
3825
3858
|
|
|
@@ -3848,7 +3881,7 @@ lib/core/functions/debug.md
|
|
|
3848
3881
|
|
|
3849
3882
|
> **debug**(`message?`, ...`optionalParams`): `void`
|
|
3850
3883
|
|
|
3851
|
-
Defined in: [lib/core.ts:
|
|
3884
|
+
Defined in: [lib/core.ts:1539](https://github.com/maiyunnet/kebab/blob/master/lib/core.ts#L1539)
|
|
3852
3885
|
|
|
3853
3886
|
打印调试信息,线上环境不会打印
|
|
3854
3887
|
|
|
@@ -3883,7 +3916,7 @@ lib/core/functions/display.md
|
|
|
3883
3916
|
|
|
3884
3917
|
> **display**(`message?`, ...`optionalParams`): `void`
|
|
3885
3918
|
|
|
3886
|
-
Defined in: [lib/core.ts:
|
|
3919
|
+
Defined in: [lib/core.ts:1552](https://github.com/maiyunnet/kebab/blob/master/lib/core.ts#L1552)
|
|
3887
3920
|
|
|
3888
3921
|
向控制台直接显示内容,一般情况下禁止使用
|
|
3889
3922
|
|
|
@@ -3918,7 +3951,7 @@ lib/core/functions/emptyObject.md
|
|
|
3918
3951
|
|
|
3919
3952
|
> **emptyObject**(`obj`, `deep?`): `void`
|
|
3920
3953
|
|
|
3921
|
-
Defined in: [lib/core.ts:
|
|
3954
|
+
Defined in: [lib/core.ts:624](https://github.com/maiyunnet/kebab/blob/master/lib/core.ts#L624)
|
|
3922
3955
|
|
|
3923
3956
|
将对象的所有属性清除包括键,不会破坏引用关系,对象变量依然保证是引用状态
|
|
3924
3957
|
|
|
@@ -3953,7 +3986,7 @@ lib/core/functions/exec.md
|
|
|
3953
3986
|
|
|
3954
3987
|
> **exec**(`command`, `options?`): `Promise`\<`string` \| `false`\>
|
|
3955
3988
|
|
|
3956
|
-
Defined in: [lib/core.ts:
|
|
3989
|
+
Defined in: [lib/core.ts:686](https://github.com/maiyunnet/kebab/blob/master/lib/core.ts#L686)
|
|
3957
3990
|
|
|
3958
3991
|
执行命令行
|
|
3959
3992
|
|
|
@@ -3995,7 +4028,7 @@ lib/core/functions/getLog.md
|
|
|
3995
4028
|
|
|
3996
4029
|
> **getLog**(`opt`): `Promise`\<`false` \| \{ `list`: `any`[] \| `string`[][]; `total`: `number`; \}\>
|
|
3997
4030
|
|
|
3998
|
-
Defined in: [lib/core.ts:
|
|
4031
|
+
Defined in: [lib/core.ts:1273](https://github.com/maiyunnet/kebab/blob/master/lib/core.ts#L1273)
|
|
3999
4032
|
|
|
4000
4033
|
获取日志内容为一个数组
|
|
4001
4034
|
|
|
@@ -4064,7 +4097,7 @@ lib/core/functions/getMonitorEvent.md
|
|
|
4064
4097
|
|
|
4065
4098
|
> **getMonitorEvent**(`opt`): `Promise`\<`false` \| [`IMonitorEvent`](../interfaces/IMonitorEvent.md) \| `null`\>
|
|
4066
4099
|
|
|
4067
|
-
Defined in: [lib/core.ts:
|
|
4100
|
+
Defined in: [lib/core.ts:1409](https://github.com/maiyunnet/kebab/blob/master/lib/core.ts#L1409)
|
|
4068
4101
|
|
|
4069
4102
|
读取事件详情和文件清单;只解析事件记录,不解析 Profile 或堆快照
|
|
4070
4103
|
|
|
@@ -4101,7 +4134,7 @@ lib/core/functions/getMonitorEvents.md
|
|
|
4101
4134
|
|
|
4102
4135
|
> **getMonitorEvents**(`opt?`): `Promise`\<`false` \| \{ `list`: [`IMonitorEventSummary`](../interfaces/IMonitorEventSummary.md)[]; `total`: `number`; \}\>
|
|
4103
4136
|
|
|
4104
|
-
Defined in: [lib/core.ts:
|
|
4137
|
+
Defined in: [lib/core.ts:1382](https://github.com/maiyunnet/kebab/blob/master/lib/core.ts#L1382)
|
|
4105
4138
|
|
|
4106
4139
|
获取某天已保存的监控事件,按目录时间倒序分页
|
|
4107
4140
|
|
|
@@ -4148,7 +4181,7 @@ lib/core/functions/getMonitorFile.md
|
|
|
4148
4181
|
|
|
4149
4182
|
> **getMonitorFile**(`opt`): `Promise`\<`false` \| [`Response`](../../undici/response/classes/Response.md) \| `null`\>
|
|
4150
4183
|
|
|
4151
|
-
Defined in: [lib/core.ts:
|
|
4184
|
+
Defined in: [lib/core.ts:1433](https://github.com/maiyunnet/kebab/blob/master/lib/core.ts#L1433)
|
|
4152
4185
|
|
|
4153
4186
|
获取监控原始文件的响应,可使用 getStream() 下载;小文件可用 getText()/getJson() 预览
|
|
4154
4187
|
|
|
@@ -4189,7 +4222,7 @@ lib/core/functions/ipLimit.md
|
|
|
4189
4222
|
|
|
4190
4223
|
> **ipLimit**(`ip`, `mask?`): `string`
|
|
4191
4224
|
|
|
4192
|
-
Defined in: [lib/core.ts:
|
|
4225
|
+
Defined in: [lib/core.ts:452](https://github.com/maiyunnet/kebab/blob/master/lib/core.ts#L452)
|
|
4193
4226
|
|
|
4194
4227
|
截取 IP 的限速段
|
|
4195
4228
|
IPv4 原样返回;IPv6 截取前 mask 位(默认 /64),防止同一人使用大量 IPv6 地址绕过限速
|
|
@@ -4227,7 +4260,7 @@ lib/core/functions/ip.md
|
|
|
4227
4260
|
|
|
4228
4261
|
> **ip**(`ctr`, `req?`): `string`
|
|
4229
4262
|
|
|
4230
|
-
Defined in: [lib/core.ts:
|
|
4263
|
+
Defined in: [lib/core.ts:365](https://github.com/maiyunnet/kebab/blob/master/lib/core.ts#L365)
|
|
4231
4264
|
|
|
4232
4265
|
获取 IP(非安全 IP)
|
|
4233
4266
|
|
|
@@ -4258,7 +4291,7 @@ lib/core/functions/ips.md
|
|
|
4258
4291
|
|
|
4259
4292
|
> **ips**(`ctr`): `object`
|
|
4260
4293
|
|
|
4261
|
-
Defined in: [lib/core.ts:
|
|
4294
|
+
Defined in: [lib/core.ts:391](https://github.com/maiyunnet/kebab/blob/master/lib/core.ts#L391)
|
|
4262
4295
|
|
|
4263
4296
|
获取 CF 和 X 的 IP
|
|
4264
4297
|
|
|
@@ -4293,7 +4326,7 @@ lib/core/functions/loadEnv.md
|
|
|
4293
4326
|
|
|
4294
4327
|
> **loadEnv**(`dir`): `Promise`\<`void`\>
|
|
4295
4328
|
|
|
4296
|
-
Defined in: [lib/core.ts:
|
|
4329
|
+
Defined in: [lib/core.ts:1623](https://github.com/maiyunnet/kebab/blob/master/lib/core.ts#L1623)
|
|
4297
4330
|
|
|
4298
4331
|
加载 .env 文件到 process.env,若文件不存在则跳过
|
|
4299
4332
|
|
|
@@ -4322,9 +4355,9 @@ lib/core/functions/log.md
|
|
|
4322
4355
|
|
|
4323
4356
|
> **log**(`opt`, `msg`, `fend?`): `void`
|
|
4324
4357
|
|
|
4325
|
-
Defined in: [lib/core.ts:
|
|
4358
|
+
Defined in: [lib/core.ts:1171](https://github.com/maiyunnet/kebab/blob/master/lib/core.ts#L1171)
|
|
4326
4359
|
|
|
4327
|
-
|
|
4360
|
+
写入文件日志,不采集 Cookie、Session 或请求体
|
|
4328
4361
|
|
|
4329
4362
|
## Parameters
|
|
4330
4363
|
|
|
@@ -4350,6 +4383,8 @@ Defined in: [lib/core.ts:1176](https://github.com/maiyunnet/kebab/blob/master/li
|
|
|
4350
4383
|
|
|
4351
4384
|
`void`
|
|
4352
4385
|
|
|
4386
|
+
无返回值
|
|
4387
|
+
|
|
4353
4388
|
lib/core/functions/ls.md
|
|
4354
4389
|
---
|
|
4355
4390
|
|
|
@@ -4363,7 +4398,7 @@ lib/core/functions/ls.md
|
|
|
4363
4398
|
|
|
4364
4399
|
> **ls**(`opt`): `Promise`\<`object`[]\>
|
|
4365
4400
|
|
|
4366
|
-
Defined in: [lib/core.ts:
|
|
4401
|
+
Defined in: [lib/core.ts:1454](https://github.com/maiyunnet/kebab/blob/master/lib/core.ts#L1454)
|
|
4367
4402
|
|
|
4368
4403
|
获取目录内文件/文件夹列表
|
|
4369
4404
|
|
|
@@ -4387,7 +4422,7 @@ Defined in: [lib/core.ts:1470](https://github.com/maiyunnet/kebab/blob/master/li
|
|
|
4387
4422
|
|
|
4388
4423
|
`string`
|
|
4389
4424
|
|
|
4390
|
-
|
|
4425
|
+
相对运行根目录的路径,如 2024/08/01/22,可带首尾 /;拒绝越界的 .. 和软链接
|
|
4391
4426
|
|
|
4392
4427
|
## Returns
|
|
4393
4428
|
|
|
@@ -4406,7 +4441,7 @@ lib/core/functions/muid.md
|
|
|
4406
4441
|
|
|
4407
4442
|
> **muid**(`ctr`, `opt?`): `string`
|
|
4408
4443
|
|
|
4409
|
-
Defined in: [lib/core.ts:
|
|
4444
|
+
Defined in: [lib/core.ts:325](https://github.com/maiyunnet/kebab/blob/master/lib/core.ts#L325)
|
|
4410
4445
|
|
|
4411
4446
|
获取 MUID
|
|
4412
4447
|
|
|
@@ -4469,7 +4504,7 @@ lib/core/functions/objectSort.md
|
|
|
4469
4504
|
|
|
4470
4505
|
> **objectSort**\<`T`\>(`o`): `T`
|
|
4471
4506
|
|
|
4472
|
-
Defined in: [lib/core.ts:
|
|
4507
|
+
Defined in: [lib/core.ts:605](https://github.com/maiyunnet/kebab/blob/master/lib/core.ts#L605)
|
|
4473
4508
|
|
|
4474
4509
|
将对象进行升序排列
|
|
4475
4510
|
|
|
@@ -4504,7 +4539,7 @@ lib/core/functions/passThroughAppend.md
|
|
|
4504
4539
|
|
|
4505
4540
|
> **passThroughAppend**(`passThrough`, `data`, `end?`): `Promise`\<`void`\>
|
|
4506
4541
|
|
|
4507
|
-
Defined in: [lib/core.ts:
|
|
4542
|
+
Defined in: [lib/core.ts:643](https://github.com/maiyunnet/kebab/blob/master/lib/core.ts#L643)
|
|
4508
4543
|
|
|
4509
4544
|
调用前自行创建 passThrough,并且调用 pipe 绑定到应该绑定的对象,然后再调用本函数
|
|
4510
4545
|
|
|
@@ -4545,7 +4580,7 @@ lib/core/functions/purify.md
|
|
|
4545
4580
|
|
|
4546
4581
|
> **purify**(`text`): `string`
|
|
4547
4582
|
|
|
4548
|
-
Defined in: [lib/core.ts:
|
|
4583
|
+
Defined in: [lib/core.ts:190](https://github.com/maiyunnet/kebab/blob/master/lib/core.ts#L190)
|
|
4549
4584
|
|
|
4550
4585
|
去除 html 的空白符、换行以及注释
|
|
4551
4586
|
|
|
@@ -4574,7 +4609,7 @@ lib/core/functions/rand.md
|
|
|
4574
4609
|
|
|
4575
4610
|
> **rand**(`min`, `max`, `prec?`): `number`
|
|
4576
4611
|
|
|
4577
|
-
Defined in: [lib/core.ts:
|
|
4612
|
+
Defined in: [lib/core.ts:98](https://github.com/maiyunnet/kebab/blob/master/lib/core.ts#L98)
|
|
4578
4613
|
|
|
4579
4614
|
生成基础的范围随机数
|
|
4580
4615
|
|
|
@@ -4615,7 +4650,7 @@ lib/core/functions/random.md
|
|
|
4615
4650
|
|
|
4616
4651
|
> **random**(`length?`, `source?`, `block?`): `string`
|
|
4617
4652
|
|
|
4618
|
-
Defined in: [lib/core.ts:
|
|
4653
|
+
Defined in: [lib/core.ts:136](https://github.com/maiyunnet/kebab/blob/master/lib/core.ts#L136)
|
|
4619
4654
|
|
|
4620
4655
|
生成随机字符串
|
|
4621
4656
|
|
|
@@ -4656,7 +4691,7 @@ lib/core/functions/realIPLimit.md
|
|
|
4656
4691
|
|
|
4657
4692
|
> **realIPLimit**(`ctr`, `name?`, `mask?`): `string`
|
|
4658
4693
|
|
|
4659
|
-
Defined in: [lib/core.ts:
|
|
4694
|
+
Defined in: [lib/core.ts:472](https://github.com/maiyunnet/kebab/blob/master/lib/core.ts#L472)
|
|
4660
4695
|
|
|
4661
4696
|
获取安全 IP 的限速段(用于 ratelimit 库的 key)
|
|
4662
4697
|
IPv4 原样返回;IPv6 截取前 mask 位(默认 /64)
|
|
@@ -4700,7 +4735,7 @@ lib/core/functions/realIP.md
|
|
|
4700
4735
|
|
|
4701
4736
|
> **realIP**(`ctr`, `name?`): `string`
|
|
4702
4737
|
|
|
4703
|
-
Defined in: [lib/core.ts:
|
|
4738
|
+
Defined in: [lib/core.ts:433](https://github.com/maiyunnet/kebab/blob/master/lib/core.ts#L433)
|
|
4704
4739
|
|
|
4705
4740
|
获取直连 IP(安全 IP)
|
|
4706
4741
|
|
|
@@ -4733,7 +4768,7 @@ lib/core/functions/removeGlobal.md
|
|
|
4733
4768
|
|
|
4734
4769
|
> **removeGlobal**(`key`, `hosts?`): `Promise`\<`Record`\<`string`, \{ `result`: `boolean`; `return`: `string`; \}\>\>
|
|
4735
4770
|
|
|
4736
|
-
Defined in: [lib/core.ts:
|
|
4771
|
+
Defined in: [lib/core.ts:979](https://github.com/maiyunnet/kebab/blob/master/lib/core.ts#L979)
|
|
4737
4772
|
|
|
4738
4773
|
移除某个跨线程/跨内网服务器全局变量
|
|
4739
4774
|
|
|
@@ -4768,7 +4803,7 @@ lib/core/functions/resolveEnvVars.md
|
|
|
4768
4803
|
|
|
4769
4804
|
> **resolveEnvVars**(`obj`): `void`
|
|
4770
4805
|
|
|
4771
|
-
Defined in: [lib/core.ts:
|
|
4806
|
+
Defined in: [lib/core.ts:1653](https://github.com/maiyunnet/kebab/blob/master/lib/core.ts#L1653)
|
|
4772
4807
|
|
|
4773
4808
|
将配置对象中的 ${ENV_VAR} 占位符替换为 process.env 的值
|
|
4774
4809
|
|
|
@@ -4797,7 +4832,7 @@ lib/core/functions/sendNpm.md
|
|
|
4797
4832
|
|
|
4798
4833
|
> **sendNpm**(`path`, `hosts?`): `Promise`\<`Record`\<`string`, \{ `result`: `boolean`; `return`: `string`; \}\>\>
|
|
4799
4834
|
|
|
4800
|
-
Defined in: [lib/core.ts:
|
|
4835
|
+
Defined in: [lib/core.ts:892](https://github.com/maiyunnet/kebab/blob/master/lib/core.ts#L892)
|
|
4801
4836
|
|
|
4802
4837
|
向本机或局域网 RPC 发送 npm install 操作
|
|
4803
4838
|
|
|
@@ -4832,7 +4867,7 @@ lib/core/functions/sendPackage.md
|
|
|
4832
4867
|
|
|
4833
4868
|
> **sendPackage**(`content`, `hosts?`): `Promise`\<`Record`\<`string`, \{ `result`: `boolean`; `return`: `string`; \}\>\>
|
|
4834
4869
|
|
|
4835
|
-
Defined in: [lib/core.ts:
|
|
4870
|
+
Defined in: [lib/core.ts:1079](https://github.com/maiyunnet/kebab/blob/master/lib/core.ts#L1079)
|
|
4836
4871
|
|
|
4837
4872
|
向本机或局域网 RPC 发送 package.json 更新操作
|
|
4838
4873
|
|
|
@@ -4867,7 +4902,7 @@ lib/core/functions/sendPm2.md
|
|
|
4867
4902
|
|
|
4868
4903
|
> **sendPm2**(`name`, `action?`, `hosts?`): `Promise`\<`Record`\<`string`, \{ `result`: `boolean`; `return`: `string`; \}\>\>
|
|
4869
4904
|
|
|
4870
|
-
Defined in: [lib/core.ts:
|
|
4905
|
+
Defined in: [lib/core.ts:851](https://github.com/maiyunnet/kebab/blob/master/lib/core.ts#L851)
|
|
4871
4906
|
|
|
4872
4907
|
向本机或局域网 RPC 发送 PM2 操作
|
|
4873
4908
|
|
|
@@ -4910,7 +4945,7 @@ lib/core/functions/sendProject.md
|
|
|
4910
4945
|
|
|
4911
4946
|
> **sendProject**(`path`, `key`, `value`, `hosts?`): `Promise`\<`Record`\<`string`, \{ `result`: `boolean`; `return`: `string`; \}\>\>
|
|
4912
4947
|
|
|
4913
|
-
Defined in: [lib/core.ts:
|
|
4948
|
+
Defined in: [lib/core.ts:1038](https://github.com/maiyunnet/kebab/blob/master/lib/core.ts#L1038)
|
|
4914
4949
|
|
|
4915
4950
|
向本机或局域网 RPC 发送项目配置更新操作
|
|
4916
4951
|
|
|
@@ -4957,7 +4992,7 @@ lib/core/functions/sendReload.md
|
|
|
4957
4992
|
|
|
4958
4993
|
> **sendReload**(`hosts?`): `Promise`\<`Record`\<`string`, \{ `result`: `boolean`; `return`: `string`; \}\>\>
|
|
4959
4994
|
|
|
4960
|
-
Defined in: [lib/core.ts:
|
|
4995
|
+
Defined in: [lib/core.ts:712](https://github.com/maiyunnet/kebab/blob/master/lib/core.ts#L712)
|
|
4961
4996
|
|
|
4962
4997
|
向主进程(或局域网同代码机子)发送广播将进行 reload 操作,等待回传
|
|
4963
4998
|
主要作用除代码热更新以外的其他情况
|
|
@@ -4985,7 +5020,7 @@ lib/core/functions/sendRestart.md
|
|
|
4985
5020
|
|
|
4986
5021
|
> **sendRestart**(`hosts?`): `Promise`\<`Record`\<`string`, \{ `result`: `boolean`; `return`: `string`; \}\>\>
|
|
4987
5022
|
|
|
4988
|
-
Defined in: [lib/core.ts:
|
|
5023
|
+
Defined in: [lib/core.ts:756](https://github.com/maiyunnet/kebab/blob/master/lib/core.ts#L756)
|
|
4989
5024
|
|
|
4990
5025
|
向主进程(或局域网同代码机子)发送广播将进行 restart 操作,停止监听并启动新进程,老进程在连接全部断开后自行销毁
|
|
4991
5026
|
主要用作不间断的代码热更新
|
|
@@ -5013,7 +5048,7 @@ lib/core/functions/sendStop.md
|
|
|
5013
5048
|
|
|
5014
5049
|
> **sendStop**(`hosts?`): `Promise`\<`Record`\<`string`, \{ `result`: `boolean`; `return`: `string`; \}\>\>
|
|
5015
5050
|
|
|
5016
|
-
Defined in: [lib/core.ts:
|
|
5051
|
+
Defined in: [lib/core.ts:801](https://github.com/maiyunnet/kebab/blob/master/lib/core.ts#L801)
|
|
5017
5052
|
|
|
5018
5053
|
向主进程(或局域网同代码机子)发送 stop 操作,停止接收新连接并在现有连接全部结束后退出
|
|
5019
5054
|
|
|
@@ -5044,7 +5079,7 @@ lib/core/functions/sendVhost.md
|
|
|
5044
5079
|
|
|
5045
5080
|
> **sendVhost**(`files`, `hosts?`): `Promise`\<`Record`\<`string`, \{ `result`: `boolean`; `return`: `string`; \}\>\>
|
|
5046
5081
|
|
|
5047
|
-
Defined in: [lib/core.ts:
|
|
5082
|
+
Defined in: [lib/core.ts:1120](https://github.com/maiyunnet/kebab/blob/master/lib/core.ts#L1120)
|
|
5048
5083
|
|
|
5049
5084
|
全量替换各节点 conf/vhost/ 中的文件,不自动 reload
|
|
5050
5085
|
|
|
@@ -5081,7 +5116,7 @@ lib/core/functions/setCookie.md
|
|
|
5081
5116
|
|
|
5082
5117
|
> **setCookie**(`ctr`, `name`, `value`, `opt?`): `void`
|
|
5083
5118
|
|
|
5084
|
-
Defined in: [lib/core.ts:
|
|
5119
|
+
Defined in: [lib/core.ts:69](https://github.com/maiyunnet/kebab/blob/master/lib/core.ts#L69)
|
|
5085
5120
|
|
|
5086
5121
|
设置 cookie
|
|
5087
5122
|
|
|
@@ -5128,7 +5163,7 @@ lib/core/functions/setGlobal.md
|
|
|
5128
5163
|
|
|
5129
5164
|
> **setGlobal**(`key`, `data`, `hosts?`): `Promise`\<`Record`\<`string`, \{ `result`: `boolean`; `return`: `string`; \}\>\>
|
|
5130
5165
|
|
|
5131
|
-
Defined in: [lib/core.ts:
|
|
5166
|
+
Defined in: [lib/core.ts:936](https://github.com/maiyunnet/kebab/blob/master/lib/core.ts#L936)
|
|
5132
5167
|
|
|
5133
5168
|
设置跨线程/指定的局域网主机的全局变量
|
|
5134
5169
|
|
|
@@ -5169,7 +5204,7 @@ lib/core/functions/sleep.md
|
|
|
5169
5204
|
|
|
5170
5205
|
> **sleep**(`ms`): `Promise`\<`void`\>
|
|
5171
5206
|
|
|
5172
|
-
Defined in: [lib/core.ts:
|
|
5207
|
+
Defined in: [lib/core.ts:593](https://github.com/maiyunnet/kebab/blob/master/lib/core.ts#L593)
|
|
5173
5208
|
|
|
5174
5209
|
间隔一段时间
|
|
5175
5210
|
|
|
@@ -5198,7 +5233,7 @@ lib/core/functions/unconvert62.md
|
|
|
5198
5233
|
|
|
5199
5234
|
> **unconvert62**(`n`): `bigint`
|
|
5200
5235
|
|
|
5201
|
-
Defined in: [lib/core.ts:
|
|
5236
|
+
Defined in: [lib/core.ts:177](https://github.com/maiyunnet/kebab/blob/master/lib/core.ts#L177)
|
|
5202
5237
|
|
|
5203
5238
|
将 62 进制转换为 10 进制
|
|
5204
5239
|
|
|
@@ -5227,7 +5262,7 @@ lib/core/functions/updateCode.md
|
|
|
5227
5262
|
|
|
5228
5263
|
> **updateCode**(`sourcePath`, `path`, `hosts?`, `config?`, `strict?`): `Promise`\<`Record`\<`string`, \{ `result`: `boolean`; `return`: `string`; \}\>\>
|
|
5229
5264
|
|
|
5230
|
-
Defined in: [lib/core.ts:
|
|
5265
|
+
Defined in: [lib/core.ts:994](https://github.com/maiyunnet/kebab/blob/master/lib/core.ts#L994)
|
|
5231
5266
|
|
|
5232
5267
|
上传并覆盖代码文件,config.json、kebab.json、.js.map、.ts, .gitignore 不会被覆盖和新创建
|
|
5233
5268
|
|
|
@@ -5280,7 +5315,7 @@ lib/core/functions/writeEventStreamHead.md
|
|
|
5280
5315
|
|
|
5281
5316
|
> **writeEventStreamHead**(`res`): `void`
|
|
5282
5317
|
|
|
5283
|
-
Defined in: [lib/core.ts:
|
|
5318
|
+
Defined in: [lib/core.ts:1593](https://github.com/maiyunnet/kebab/blob/master/lib/core.ts#L1593)
|
|
5284
5319
|
|
|
5285
5320
|
提交服务器发送事件(SSE)响应头
|
|
5286
5321
|
|
|
@@ -5315,7 +5350,7 @@ lib/core/functions/writeHead.md
|
|
|
5315
5350
|
|
|
5316
5351
|
> **writeHead**(`res`, `statusCode`, `headers?`): `void`
|
|
5317
5352
|
|
|
5318
|
-
Defined in: [lib/core.ts:
|
|
5353
|
+
Defined in: [lib/core.ts:1572](https://github.com/maiyunnet/kebab/blob/master/lib/core.ts#L1572)
|
|
5319
5354
|
|
|
5320
5355
|
提交 HTTP 响应状态和头部,兼容 HTTP/1.1 与 HTTP/2
|
|
5321
5356
|
|
|
@@ -5365,7 +5400,7 @@ lib/core/functions/write.md
|
|
|
5365
5400
|
|
|
5366
5401
|
> **write**(`res`, `data`): `void`
|
|
5367
5402
|
|
|
5368
|
-
Defined in: [lib/core.ts:
|
|
5403
|
+
Defined in: [lib/core.ts:1605](https://github.com/maiyunnet/kebab/blob/master/lib/core.ts#L1605)
|
|
5369
5404
|
|
|
5370
5405
|
向 res 发送数据
|
|
5371
5406
|
|
|
@@ -5489,7 +5524,7 @@ lib/core/interfaces/ICookieOptions.md
|
|
|
5489
5524
|
|
|
5490
5525
|
# Interface: ICookieOptions
|
|
5491
5526
|
|
|
5492
|
-
Defined in: [lib/core.ts:
|
|
5527
|
+
Defined in: [lib/core.ts:53](https://github.com/maiyunnet/kebab/blob/master/lib/core.ts#L53)
|
|
5493
5528
|
|
|
5494
5529
|
Cookie 设置的选项
|
|
5495
5530
|
|
|
@@ -5499,7 +5534,7 @@ Cookie 设置的选项
|
|
|
5499
5534
|
|
|
5500
5535
|
> `optional` **domain?**: `string`
|
|
5501
5536
|
|
|
5502
|
-
Defined in: [lib/core.ts:
|
|
5537
|
+
Defined in: [lib/core.ts:56](https://github.com/maiyunnet/kebab/blob/master/lib/core.ts#L56)
|
|
5503
5538
|
|
|
5504
5539
|
***
|
|
5505
5540
|
|
|
@@ -5507,7 +5542,7 @@ Defined in: [lib/core.ts:54](https://github.com/maiyunnet/kebab/blob/master/lib/
|
|
|
5507
5542
|
|
|
5508
5543
|
> `optional` **httponly?**: `boolean`
|
|
5509
5544
|
|
|
5510
|
-
Defined in: [lib/core.ts:
|
|
5545
|
+
Defined in: [lib/core.ts:58](https://github.com/maiyunnet/kebab/blob/master/lib/core.ts#L58)
|
|
5511
5546
|
|
|
5512
5547
|
***
|
|
5513
5548
|
|
|
@@ -5515,7 +5550,7 @@ Defined in: [lib/core.ts:56](https://github.com/maiyunnet/kebab/blob/master/lib/
|
|
|
5515
5550
|
|
|
5516
5551
|
> `optional` **path?**: `string`
|
|
5517
5552
|
|
|
5518
|
-
Defined in: [lib/core.ts:
|
|
5553
|
+
Defined in: [lib/core.ts:55](https://github.com/maiyunnet/kebab/blob/master/lib/core.ts#L55)
|
|
5519
5554
|
|
|
5520
5555
|
***
|
|
5521
5556
|
|
|
@@ -5523,7 +5558,7 @@ Defined in: [lib/core.ts:53](https://github.com/maiyunnet/kebab/blob/master/lib/
|
|
|
5523
5558
|
|
|
5524
5559
|
> `optional` **samesite?**: `"Strict"` \| `"Lax"` \| `"None"`
|
|
5525
5560
|
|
|
5526
|
-
Defined in: [lib/core.ts:
|
|
5561
|
+
Defined in: [lib/core.ts:59](https://github.com/maiyunnet/kebab/blob/master/lib/core.ts#L59)
|
|
5527
5562
|
|
|
5528
5563
|
***
|
|
5529
5564
|
|
|
@@ -5531,7 +5566,7 @@ Defined in: [lib/core.ts:57](https://github.com/maiyunnet/kebab/blob/master/lib/
|
|
|
5531
5566
|
|
|
5532
5567
|
> `optional` **ssl?**: `boolean`
|
|
5533
5568
|
|
|
5534
|
-
Defined in: [lib/core.ts:
|
|
5569
|
+
Defined in: [lib/core.ts:57](https://github.com/maiyunnet/kebab/blob/master/lib/core.ts#L57)
|
|
5535
5570
|
|
|
5536
5571
|
***
|
|
5537
5572
|
|
|
@@ -5539,7 +5574,7 @@ Defined in: [lib/core.ts:55](https://github.com/maiyunnet/kebab/blob/master/lib/
|
|
|
5539
5574
|
|
|
5540
5575
|
> `optional` **ttl?**: `number`
|
|
5541
5576
|
|
|
5542
|
-
Defined in: [lib/core.ts:
|
|
5577
|
+
Defined in: [lib/core.ts:54](https://github.com/maiyunnet/kebab/blob/master/lib/core.ts#L54)
|
|
5543
5578
|
|
|
5544
5579
|
lib/core/interfaces/ILogOptions.md
|
|
5545
5580
|
---
|
|
@@ -5552,25 +5587,17 @@ lib/core/interfaces/ILogOptions.md
|
|
|
5552
5587
|
|
|
5553
5588
|
# Interface: ILogOptions
|
|
5554
5589
|
|
|
5555
|
-
Defined in: [lib/core.ts:
|
|
5590
|
+
Defined in: [lib/core.ts:1155](https://github.com/maiyunnet/kebab/blob/master/lib/core.ts#L1155)
|
|
5556
5591
|
|
|
5557
5592
|
log 设置的选项
|
|
5558
5593
|
|
|
5559
5594
|
## Properties
|
|
5560
5595
|
|
|
5561
|
-
### cookie?
|
|
5562
|
-
|
|
5563
|
-
> `optional` **cookie?**: `Record`\<`string`, `string`\>
|
|
5564
|
-
|
|
5565
|
-
Defined in: [lib/core.ts:1165](https://github.com/maiyunnet/kebab/blob/master/lib/core.ts#L1165)
|
|
5566
|
-
|
|
5567
|
-
***
|
|
5568
|
-
|
|
5569
5596
|
### get?
|
|
5570
5597
|
|
|
5571
5598
|
> `optional` **get?**: `Record`\<`string`, `any`\>
|
|
5572
5599
|
|
|
5573
|
-
Defined in: [lib/core.ts:
|
|
5600
|
+
Defined in: [lib/core.ts:1160](https://github.com/maiyunnet/kebab/blob/master/lib/core.ts#L1160)
|
|
5574
5601
|
|
|
5575
5602
|
***
|
|
5576
5603
|
|
|
@@ -5578,7 +5605,7 @@ Defined in: [lib/core.ts:1164](https://github.com/maiyunnet/kebab/blob/master/li
|
|
|
5578
5605
|
|
|
5579
5606
|
> `optional` **headers?**: `IncomingHttpHeaders`
|
|
5580
5607
|
|
|
5581
|
-
Defined in: [lib/core.ts:
|
|
5608
|
+
Defined in: [lib/core.ts:1161](https://github.com/maiyunnet/kebab/blob/master/lib/core.ts#L1161)
|
|
5582
5609
|
|
|
5583
5610
|
***
|
|
5584
5611
|
|
|
@@ -5586,7 +5613,7 @@ Defined in: [lib/core.ts:1167](https://github.com/maiyunnet/kebab/blob/master/li
|
|
|
5586
5613
|
|
|
5587
5614
|
> `optional` **hostname?**: `string`
|
|
5588
5615
|
|
|
5589
|
-
Defined in: [lib/core.ts:
|
|
5616
|
+
Defined in: [lib/core.ts:1158](https://github.com/maiyunnet/kebab/blob/master/lib/core.ts#L1158)
|
|
5590
5617
|
|
|
5591
5618
|
***
|
|
5592
5619
|
|
|
@@ -5594,7 +5621,7 @@ Defined in: [lib/core.ts:1162](https://github.com/maiyunnet/kebab/blob/master/li
|
|
|
5594
5621
|
|
|
5595
5622
|
> `optional` **path?**: `string`
|
|
5596
5623
|
|
|
5597
|
-
Defined in: [lib/core.ts:
|
|
5624
|
+
Defined in: [lib/core.ts:1156](https://github.com/maiyunnet/kebab/blob/master/lib/core.ts#L1156)
|
|
5598
5625
|
|
|
5599
5626
|
***
|
|
5600
5627
|
|
|
@@ -5602,15 +5629,7 @@ Defined in: [lib/core.ts:1160](https://github.com/maiyunnet/kebab/blob/master/li
|
|
|
5602
5629
|
|
|
5603
5630
|
> `optional` **req?**: `IncomingMessage` \| `Http2ServerRequest` \| `null`
|
|
5604
5631
|
|
|
5605
|
-
Defined in: [lib/core.ts:
|
|
5606
|
-
|
|
5607
|
-
***
|
|
5608
|
-
|
|
5609
|
-
### session?
|
|
5610
|
-
|
|
5611
|
-
> `optional` **session?**: `Record`\<`string`, `any`\>
|
|
5612
|
-
|
|
5613
|
-
Defined in: [lib/core.ts:1166](https://github.com/maiyunnet/kebab/blob/master/lib/core.ts#L1166)
|
|
5632
|
+
Defined in: [lib/core.ts:1159](https://github.com/maiyunnet/kebab/blob/master/lib/core.ts#L1159)
|
|
5614
5633
|
|
|
5615
5634
|
***
|
|
5616
5635
|
|
|
@@ -5618,7 +5637,7 @@ Defined in: [lib/core.ts:1166](https://github.com/maiyunnet/kebab/blob/master/li
|
|
|
5618
5637
|
|
|
5619
5638
|
> `optional` **urlFull?**: `string`
|
|
5620
5639
|
|
|
5621
|
-
Defined in: [lib/core.ts:
|
|
5640
|
+
Defined in: [lib/core.ts:1157](https://github.com/maiyunnet/kebab/blob/master/lib/core.ts#L1157)
|
|
5622
5641
|
|
|
5623
5642
|
lib/core/interfaces/IMonitorEvent.md
|
|
5624
5643
|
---
|
|
@@ -5631,7 +5650,7 @@ lib/core/interfaces/IMonitorEvent.md
|
|
|
5631
5650
|
|
|
5632
5651
|
# Interface: IMonitorEvent
|
|
5633
5652
|
|
|
5634
|
-
Defined in: [lib/core.ts:
|
|
5653
|
+
Defined in: [lib/core.ts:1339](https://github.com/maiyunnet/kebab/blob/master/lib/core.ts#L1339)
|
|
5635
5654
|
|
|
5636
5655
|
事件原始数据与可读取的文件;data 为 null 时可下载原始记录复盘
|
|
5637
5656
|
|
|
@@ -5641,7 +5660,7 @@ Defined in: [lib/core.ts:1355](https://github.com/maiyunnet/kebab/blob/master/li
|
|
|
5641
5660
|
|
|
5642
5661
|
> **data**: `Record`\<`string`, `unknown`\> \| `null`
|
|
5643
5662
|
|
|
5644
|
-
Defined in: [lib/core.ts:
|
|
5663
|
+
Defined in: [lib/core.ts:1341](https://github.com/maiyunnet/kebab/blob/master/lib/core.ts#L1341)
|
|
5645
5664
|
|
|
5646
5665
|
***
|
|
5647
5666
|
|
|
@@ -5649,7 +5668,7 @@ Defined in: [lib/core.ts:1357](https://github.com/maiyunnet/kebab/blob/master/li
|
|
|
5649
5668
|
|
|
5650
5669
|
> **files**: [`IMonitorFile`](IMonitorFile.md)[]
|
|
5651
5670
|
|
|
5652
|
-
Defined in: [lib/core.ts:
|
|
5671
|
+
Defined in: [lib/core.ts:1343](https://github.com/maiyunnet/kebab/blob/master/lib/core.ts#L1343)
|
|
5653
5672
|
|
|
5654
5673
|
***
|
|
5655
5674
|
|
|
@@ -5657,7 +5676,7 @@ Defined in: [lib/core.ts:1359](https://github.com/maiyunnet/kebab/blob/master/li
|
|
|
5657
5676
|
|
|
5658
5677
|
> **recordStatus**: `"loaded"` \| `"invalid"` \| `"missing"` \| `"too-large"` \| `"unreadable"`
|
|
5659
5678
|
|
|
5660
|
-
Defined in: [lib/core.ts:
|
|
5679
|
+
Defined in: [lib/core.ts:1342](https://github.com/maiyunnet/kebab/blob/master/lib/core.ts#L1342)
|
|
5661
5680
|
|
|
5662
5681
|
***
|
|
5663
5682
|
|
|
@@ -5665,7 +5684,7 @@ Defined in: [lib/core.ts:1358](https://github.com/maiyunnet/kebab/blob/master/li
|
|
|
5665
5684
|
|
|
5666
5685
|
> **summary**: [`IMonitorEventSummary`](IMonitorEventSummary.md)
|
|
5667
5686
|
|
|
5668
|
-
Defined in: [lib/core.ts:
|
|
5687
|
+
Defined in: [lib/core.ts:1340](https://github.com/maiyunnet/kebab/blob/master/lib/core.ts#L1340)
|
|
5669
5688
|
|
|
5670
5689
|
lib/core/interfaces/IMonitorEventSummary.md
|
|
5671
5690
|
---
|
|
@@ -5678,7 +5697,7 @@ lib/core/interfaces/IMonitorEventSummary.md
|
|
|
5678
5697
|
|
|
5679
5698
|
# Interface: IMonitorEventSummary
|
|
5680
5699
|
|
|
5681
|
-
Defined in: [lib/core.ts:
|
|
5700
|
+
Defined in: [lib/core.ts:1319](https://github.com/maiyunnet/kebab/blob/master/lib/core.ts#L1319)
|
|
5682
5701
|
|
|
5683
5702
|
已保存监控事件的简短摘要,path 相对于 log/monitor/
|
|
5684
5703
|
|
|
@@ -5688,7 +5707,7 @@ Defined in: [lib/core.ts:1335](https://github.com/maiyunnet/kebab/blob/master/li
|
|
|
5688
5707
|
|
|
5689
5708
|
> **path**: `string`
|
|
5690
5709
|
|
|
5691
|
-
Defined in: [lib/core.ts:
|
|
5710
|
+
Defined in: [lib/core.ts:1320](https://github.com/maiyunnet/kebab/blob/master/lib/core.ts#L1320)
|
|
5692
5711
|
|
|
5693
5712
|
***
|
|
5694
5713
|
|
|
@@ -5696,7 +5715,7 @@ Defined in: [lib/core.ts:1336](https://github.com/maiyunnet/kebab/blob/master/li
|
|
|
5696
5715
|
|
|
5697
5716
|
> **pid**: `number`
|
|
5698
5717
|
|
|
5699
|
-
Defined in: [lib/core.ts:
|
|
5718
|
+
Defined in: [lib/core.ts:1321](https://github.com/maiyunnet/kebab/blob/master/lib/core.ts#L1321)
|
|
5700
5719
|
|
|
5701
5720
|
***
|
|
5702
5721
|
|
|
@@ -5704,7 +5723,7 @@ Defined in: [lib/core.ts:1337](https://github.com/maiyunnet/kebab/blob/master/li
|
|
|
5704
5723
|
|
|
5705
5724
|
> **reasons**: `string`[]
|
|
5706
5725
|
|
|
5707
|
-
Defined in: [lib/core.ts:
|
|
5726
|
+
Defined in: [lib/core.ts:1325](https://github.com/maiyunnet/kebab/blob/master/lib/core.ts#L1325)
|
|
5708
5727
|
|
|
5709
5728
|
***
|
|
5710
5729
|
|
|
@@ -5712,7 +5731,7 @@ Defined in: [lib/core.ts:1341](https://github.com/maiyunnet/kebab/blob/master/li
|
|
|
5712
5731
|
|
|
5713
5732
|
> **source**: `"main"` \| `"watchdog"`
|
|
5714
5733
|
|
|
5715
|
-
Defined in: [lib/core.ts:
|
|
5734
|
+
Defined in: [lib/core.ts:1323](https://github.com/maiyunnet/kebab/blob/master/lib/core.ts#L1323)
|
|
5716
5735
|
|
|
5717
5736
|
***
|
|
5718
5737
|
|
|
@@ -5720,7 +5739,7 @@ Defined in: [lib/core.ts:1339](https://github.com/maiyunnet/kebab/blob/master/li
|
|
|
5720
5739
|
|
|
5721
5740
|
> **status**: `string`
|
|
5722
5741
|
|
|
5723
|
-
Defined in: [lib/core.ts:
|
|
5742
|
+
Defined in: [lib/core.ts:1324](https://github.com/maiyunnet/kebab/blob/master/lib/core.ts#L1324)
|
|
5724
5743
|
|
|
5725
5744
|
***
|
|
5726
5745
|
|
|
@@ -5728,7 +5747,7 @@ Defined in: [lib/core.ts:1340](https://github.com/maiyunnet/kebab/blob/master/li
|
|
|
5728
5747
|
|
|
5729
5748
|
> **time**: `number`
|
|
5730
5749
|
|
|
5731
|
-
Defined in: [lib/core.ts:
|
|
5750
|
+
Defined in: [lib/core.ts:1322](https://github.com/maiyunnet/kebab/blob/master/lib/core.ts#L1322)
|
|
5732
5751
|
|
|
5733
5752
|
lib/core/interfaces/IMonitorFile.md
|
|
5734
5753
|
---
|
|
@@ -5741,7 +5760,7 @@ lib/core/interfaces/IMonitorFile.md
|
|
|
5741
5760
|
|
|
5742
5761
|
# Interface: IMonitorFile
|
|
5743
5762
|
|
|
5744
|
-
Defined in: [lib/core.ts:
|
|
5763
|
+
Defined in: [lib/core.ts:1329](https://github.com/maiyunnet/kebab/blob/master/lib/core.ts#L1329)
|
|
5745
5764
|
|
|
5746
5765
|
监控文件元数据;复杂格式或超过 1 MiB 的文件不提供预览
|
|
5747
5766
|
|
|
@@ -5751,7 +5770,7 @@ Defined in: [lib/core.ts:1345](https://github.com/maiyunnet/kebab/blob/master/li
|
|
|
5751
5770
|
|
|
5752
5771
|
> **mtime**: `number`
|
|
5753
5772
|
|
|
5754
|
-
Defined in: [lib/core.ts:
|
|
5773
|
+
Defined in: [lib/core.ts:1334](https://github.com/maiyunnet/kebab/blob/master/lib/core.ts#L1334)
|
|
5755
5774
|
|
|
5756
5775
|
最后修改时间,单位 ms
|
|
5757
5776
|
|
|
@@ -5761,7 +5780,7 @@ Defined in: [lib/core.ts:1350](https://github.com/maiyunnet/kebab/blob/master/li
|
|
|
5761
5780
|
|
|
5762
5781
|
> **name**: `string`
|
|
5763
5782
|
|
|
5764
|
-
Defined in: [lib/core.ts:
|
|
5783
|
+
Defined in: [lib/core.ts:1331](https://github.com/maiyunnet/kebab/blob/master/lib/core.ts#L1331)
|
|
5765
5784
|
|
|
5766
5785
|
***
|
|
5767
5786
|
|
|
@@ -5769,7 +5788,7 @@ Defined in: [lib/core.ts:1347](https://github.com/maiyunnet/kebab/blob/master/li
|
|
|
5769
5788
|
|
|
5770
5789
|
> **path**: `string`
|
|
5771
5790
|
|
|
5772
|
-
Defined in: [lib/core.ts:
|
|
5791
|
+
Defined in: [lib/core.ts:1330](https://github.com/maiyunnet/kebab/blob/master/lib/core.ts#L1330)
|
|
5773
5792
|
|
|
5774
5793
|
***
|
|
5775
5794
|
|
|
@@ -5777,7 +5796,7 @@ Defined in: [lib/core.ts:1346](https://github.com/maiyunnet/kebab/blob/master/li
|
|
|
5777
5796
|
|
|
5778
5797
|
> **preview**: `"text"` \| `"json"` \| `null`
|
|
5779
5798
|
|
|
5780
|
-
Defined in: [lib/core.ts:
|
|
5799
|
+
Defined in: [lib/core.ts:1335](https://github.com/maiyunnet/kebab/blob/master/lib/core.ts#L1335)
|
|
5781
5800
|
|
|
5782
5801
|
***
|
|
5783
5802
|
|
|
@@ -5785,7 +5804,7 @@ Defined in: [lib/core.ts:1351](https://github.com/maiyunnet/kebab/blob/master/li
|
|
|
5785
5804
|
|
|
5786
5805
|
> **size**: `number`
|
|
5787
5806
|
|
|
5788
|
-
Defined in: [lib/core.ts:
|
|
5807
|
+
Defined in: [lib/core.ts:1332](https://github.com/maiyunnet/kebab/blob/master/lib/core.ts#L1332)
|
|
5789
5808
|
|
|
5790
5809
|
lib/core/namespaces/v/classes/ValiError.md
|
|
5791
5810
|
---
|
|
@@ -115003,6 +115022,331 @@ Defined in: node\_modules/valibot/dist/index.d.mts:16127
|
|
|
115003
115022
|
|
|
115004
115023
|
[UUID](https://en.wikipedia.org/wiki/Universally_unique_identifier) regex.
|
|
115005
115024
|
|
|
115025
|
+
lib/core/rpc/index.md
|
|
115026
|
+
---
|
|
115027
|
+
|
|
115028
|
+
[**Documents for @maiyunnet/kebab**](../../../index.md)
|
|
115029
|
+
|
|
115030
|
+
***
|
|
115031
|
+
|
|
115032
|
+
[Documents for @maiyunnet/kebab](../../../index.md) / lib/core/rpc
|
|
115033
|
+
|
|
115034
|
+
# lib/core/rpc
|
|
115035
|
+
|
|
115036
|
+
## Interfaces
|
|
115037
|
+
|
|
115038
|
+
- [IMessage](interfaces/IMessage.md)
|
|
115039
|
+
|
|
115040
|
+
## Variables
|
|
115041
|
+
|
|
115042
|
+
- [authenticate](variables/authenticate.md)
|
|
115043
|
+
- [hash](variables/hash.md)
|
|
115044
|
+
- [hashFile](variables/hashFile.md)
|
|
115045
|
+
- [readBody](variables/readBody.md)
|
|
115046
|
+
- [reject](variables/reject.md)
|
|
115047
|
+
- [sign](variables/sign.md)
|
|
115048
|
+
- [validSecret](variables/validSecret.md)
|
|
115049
|
+
|
|
115050
|
+
lib/core/rpc/interfaces/IMessage.md
|
|
115051
|
+
---
|
|
115052
|
+
|
|
115053
|
+
[**Documents for @maiyunnet/kebab**](../../../../index.md)
|
|
115054
|
+
|
|
115055
|
+
***
|
|
115056
|
+
|
|
115057
|
+
[Documents for @maiyunnet/kebab](../../../../index.md) / [lib/core/rpc](../index.md) / IMessage
|
|
115058
|
+
|
|
115059
|
+
# Interface: IMessage
|
|
115060
|
+
|
|
115061
|
+
Defined in: [lib/core/rpc.ts:6](https://github.com/maiyunnet/kebab/blob/master/lib/core/rpc.ts#L6)
|
|
115062
|
+
|
|
115063
|
+
经认证的 RPC 命令及请求体摘要
|
|
115064
|
+
|
|
115065
|
+
## Indexable
|
|
115066
|
+
|
|
115067
|
+
> \[`key`: `string`\]: `any`
|
|
115068
|
+
|
|
115069
|
+
## Properties
|
|
115070
|
+
|
|
115071
|
+
### action
|
|
115072
|
+
|
|
115073
|
+
> **action**: `string`
|
|
115074
|
+
|
|
115075
|
+
Defined in: [lib/core/rpc.ts:7](https://github.com/maiyunnet/kebab/blob/master/lib/core/rpc.ts#L7)
|
|
115076
|
+
|
|
115077
|
+
***
|
|
115078
|
+
|
|
115079
|
+
### bodyHash
|
|
115080
|
+
|
|
115081
|
+
> **bodyHash**: `string`
|
|
115082
|
+
|
|
115083
|
+
Defined in: [lib/core/rpc.ts:8](https://github.com/maiyunnet/kebab/blob/master/lib/core/rpc.ts#L8)
|
|
115084
|
+
|
|
115085
|
+
lib/core/rpc/variables/authenticate.md
|
|
115086
|
+
---
|
|
115087
|
+
|
|
115088
|
+
[**Documents for @maiyunnet/kebab**](../../../../index.md)
|
|
115089
|
+
|
|
115090
|
+
***
|
|
115091
|
+
|
|
115092
|
+
[Documents for @maiyunnet/kebab](../../../../index.md) / [lib/core/rpc](../index.md) / authenticate
|
|
115093
|
+
|
|
115094
|
+
# Variable: authenticate
|
|
115095
|
+
|
|
115096
|
+
> `const` **authenticate**: (`req`, `secret`) => [`IMessage`](../interfaces/IMessage.md) \| `false` = `implementation.authenticate`
|
|
115097
|
+
|
|
115098
|
+
Defined in: [lib/core/rpc.ts:51](https://github.com/maiyunnet/kebab/blob/master/lib/core/rpc.ts#L51)
|
|
115099
|
+
|
|
115100
|
+
校验密钥、方法及距当前时间不超过 5 秒的命令,并登记未使用的 nonce
|
|
115101
|
+
|
|
115102
|
+
## Parameters
|
|
115103
|
+
|
|
115104
|
+
### req
|
|
115105
|
+
|
|
115106
|
+
`http.IncomingMessage`
|
|
115107
|
+
|
|
115108
|
+
请求,使用 URL、方法和 socket IP
|
|
115109
|
+
|
|
115110
|
+
### secret
|
|
115111
|
+
|
|
115112
|
+
`unknown`
|
|
115113
|
+
|
|
115114
|
+
RPC 密钥
|
|
115115
|
+
|
|
115116
|
+
## Returns
|
|
115117
|
+
|
|
115118
|
+
[`IMessage`](../interfaces/IMessage.md) \| `false`
|
|
115119
|
+
|
|
115120
|
+
认证命令;无效或已用 nonce、限速及缓存满时返回 false
|
|
115121
|
+
|
|
115122
|
+
lib/core/rpc/variables/hashFile.md
|
|
115123
|
+
---
|
|
115124
|
+
|
|
115125
|
+
[**Documents for @maiyunnet/kebab**](../../../../index.md)
|
|
115126
|
+
|
|
115127
|
+
***
|
|
115128
|
+
|
|
115129
|
+
[Documents for @maiyunnet/kebab](../../../../index.md) / [lib/core/rpc](../index.md) / hashFile
|
|
115130
|
+
|
|
115131
|
+
# Variable: hashFile
|
|
115132
|
+
|
|
115133
|
+
> `const` **hashFile**: (`file`) => `Promise`\<`string` \| `false`\> = `implementation.hashFile`
|
|
115134
|
+
|
|
115135
|
+
Defined in: [lib/core/rpc.ts:31](https://github.com/maiyunnet/kebab/blob/master/lib/core/rpc.ts#L31)
|
|
115136
|
+
|
|
115137
|
+
流式计算文件的 SHA-256
|
|
115138
|
+
|
|
115139
|
+
## Parameters
|
|
115140
|
+
|
|
115141
|
+
### file
|
|
115142
|
+
|
|
115143
|
+
`string`
|
|
115144
|
+
|
|
115145
|
+
文件路径
|
|
115146
|
+
|
|
115147
|
+
## Returns
|
|
115148
|
+
|
|
115149
|
+
`Promise`\<`string` \| `false`\>
|
|
115150
|
+
|
|
115151
|
+
小写十六进制摘要;读取失败返回 false
|
|
115152
|
+
|
|
115153
|
+
lib/core/rpc/variables/hash.md
|
|
115154
|
+
---
|
|
115155
|
+
|
|
115156
|
+
[**Documents for @maiyunnet/kebab**](../../../../index.md)
|
|
115157
|
+
|
|
115158
|
+
***
|
|
115159
|
+
|
|
115160
|
+
[Documents for @maiyunnet/kebab](../../../../index.md) / [lib/core/rpc](../index.md) / hash
|
|
115161
|
+
|
|
115162
|
+
# Variable: hash
|
|
115163
|
+
|
|
115164
|
+
> `const` **hash**: (`data`) => `string` = `implementation.hash`
|
|
115165
|
+
|
|
115166
|
+
Defined in: [lib/core/rpc.ts:24](https://github.com/maiyunnet/kebab/blob/master/lib/core/rpc.ts#L24)
|
|
115167
|
+
|
|
115168
|
+
计算内容的 SHA-256
|
|
115169
|
+
|
|
115170
|
+
## Parameters
|
|
115171
|
+
|
|
115172
|
+
### data
|
|
115173
|
+
|
|
115174
|
+
`string` \| `Buffer`
|
|
115175
|
+
|
|
115176
|
+
请求体内容
|
|
115177
|
+
|
|
115178
|
+
## Returns
|
|
115179
|
+
|
|
115180
|
+
`string`
|
|
115181
|
+
|
|
115182
|
+
小写十六进制摘要
|
|
115183
|
+
|
|
115184
|
+
lib/core/rpc/variables/readBody.md
|
|
115185
|
+
---
|
|
115186
|
+
|
|
115187
|
+
[**Documents for @maiyunnet/kebab**](../../../../index.md)
|
|
115188
|
+
|
|
115189
|
+
***
|
|
115190
|
+
|
|
115191
|
+
[Documents for @maiyunnet/kebab](../../../../index.md) / [lib/core/rpc](../index.md) / readBody
|
|
115192
|
+
|
|
115193
|
+
# Variable: readBody
|
|
115194
|
+
|
|
115195
|
+
> `const` **readBody**: (`req`, `expected`, `directory`, `upload`, `limit`) => `Promise`\<\{ `body?`: `Buffer`; `file?`: `string`; \} \| `false`\> = `implementation.readBody`
|
|
115196
|
+
|
|
115197
|
+
Defined in: [lib/core/rpc.ts:71](https://github.com/maiyunnet/kebab/blob/master/lib/core/rpc.ts#L71)
|
|
115198
|
+
|
|
115199
|
+
按字节上限读取并校验请求体;上传的临时文件由调用方删除
|
|
115200
|
+
|
|
115201
|
+
## Parameters
|
|
115202
|
+
|
|
115203
|
+
### req
|
|
115204
|
+
|
|
115205
|
+
`http.IncomingMessage`
|
|
115206
|
+
|
|
115207
|
+
请求流
|
|
115208
|
+
|
|
115209
|
+
### expected
|
|
115210
|
+
|
|
115211
|
+
`string`
|
|
115212
|
+
|
|
115213
|
+
已认证的 SHA-256 摘要
|
|
115214
|
+
|
|
115215
|
+
### directory
|
|
115216
|
+
|
|
115217
|
+
`string`
|
|
115218
|
+
|
|
115219
|
+
临时文件目录
|
|
115220
|
+
|
|
115221
|
+
### upload
|
|
115222
|
+
|
|
115223
|
+
`boolean`
|
|
115224
|
+
|
|
115225
|
+
是否将请求体写入临时文件
|
|
115226
|
+
|
|
115227
|
+
### limit
|
|
115228
|
+
|
|
115229
|
+
`number`
|
|
115230
|
+
|
|
115231
|
+
允许的最大字节数
|
|
115232
|
+
|
|
115233
|
+
## Returns
|
|
115234
|
+
|
|
115235
|
+
`Promise`\<\{ `body?`: `Buffer`; `file?`: `string`; \} \| `false`\>
|
|
115236
|
+
|
|
115237
|
+
内存内容或临时文件;失败返回 false 并清理临时文件
|
|
115238
|
+
|
|
115239
|
+
lib/core/rpc/variables/reject.md
|
|
115240
|
+
---
|
|
115241
|
+
|
|
115242
|
+
[**Documents for @maiyunnet/kebab**](../../../../index.md)
|
|
115243
|
+
|
|
115244
|
+
***
|
|
115245
|
+
|
|
115246
|
+
[Documents for @maiyunnet/kebab](../../../../index.md) / [lib/core/rpc](../index.md) / reject
|
|
115247
|
+
|
|
115248
|
+
# Variable: reject
|
|
115249
|
+
|
|
115250
|
+
> `const` **reject**: (`req`) => `boolean` = `implementation.reject`
|
|
115251
|
+
|
|
115252
|
+
Defined in: [lib/core/rpc.ts:60](https://github.com/maiyunnet/kebab/blob/master/lib/core/rpc.ts#L60)
|
|
115253
|
+
|
|
115254
|
+
记录 socket IP 的失败次数
|
|
115255
|
+
|
|
115256
|
+
## Parameters
|
|
115257
|
+
|
|
115258
|
+
### req
|
|
115259
|
+
|
|
115260
|
+
`http.IncomingMessage`
|
|
115261
|
+
|
|
115262
|
+
被拒绝的请求
|
|
115263
|
+
|
|
115264
|
+
## Returns
|
|
115265
|
+
|
|
115266
|
+
`boolean`
|
|
115267
|
+
|
|
115268
|
+
每个限速窗口仅首次失败返回 true,供审计
|
|
115269
|
+
|
|
115270
|
+
lib/core/rpc/variables/sign.md
|
|
115271
|
+
---
|
|
115272
|
+
|
|
115273
|
+
[**Documents for @maiyunnet/kebab**](../../../../index.md)
|
|
115274
|
+
|
|
115275
|
+
***
|
|
115276
|
+
|
|
115277
|
+
[Documents for @maiyunnet/kebab](../../../../index.md) / [lib/core/rpc](../index.md) / sign
|
|
115278
|
+
|
|
115279
|
+
# Variable: sign
|
|
115280
|
+
|
|
115281
|
+
> `const` **sign**: (`message`, `secret`, `method?`, `bodyHash?`) => `string` = `implementation.sign`
|
|
115282
|
+
|
|
115283
|
+
Defined in: [lib/core/rpc.ts:41](https://github.com/maiyunnet/kebab/blob/master/lib/core/rpc.ts#L41)
|
|
115284
|
+
|
|
115285
|
+
加密认证命令、HTTP 方法和请求体摘要;自动生成时间与 nonce
|
|
115286
|
+
|
|
115287
|
+
## Parameters
|
|
115288
|
+
|
|
115289
|
+
### message
|
|
115290
|
+
|
|
115291
|
+
`Record`\<`string`, `unknown`\>
|
|
115292
|
+
|
|
115293
|
+
动作及参数
|
|
115294
|
+
|
|
115295
|
+
### secret
|
|
115296
|
+
|
|
115297
|
+
`string`
|
|
115298
|
+
|
|
115299
|
+
RPC 密钥
|
|
115300
|
+
|
|
115301
|
+
### method?
|
|
115302
|
+
|
|
115303
|
+
`string`
|
|
115304
|
+
|
|
115305
|
+
HTTP 方法,默认 GET
|
|
115306
|
+
|
|
115307
|
+
### bodyHash?
|
|
115308
|
+
|
|
115309
|
+
`string`
|
|
115310
|
+
|
|
115311
|
+
请求体的 SHA-256,默认空内容摘要
|
|
115312
|
+
|
|
115313
|
+
## Returns
|
|
115314
|
+
|
|
115315
|
+
`string`
|
|
115316
|
+
|
|
115317
|
+
URL 中的命令;密钥不合格时返回不可认证标记
|
|
115318
|
+
|
|
115319
|
+
lib/core/rpc/variables/validSecret.md
|
|
115320
|
+
---
|
|
115321
|
+
|
|
115322
|
+
[**Documents for @maiyunnet/kebab**](../../../../index.md)
|
|
115323
|
+
|
|
115324
|
+
***
|
|
115325
|
+
|
|
115326
|
+
[Documents for @maiyunnet/kebab](../../../../index.md) / [lib/core/rpc](../index.md) / validSecret
|
|
115327
|
+
|
|
115328
|
+
# Variable: validSecret
|
|
115329
|
+
|
|
115330
|
+
> `const` **validSecret**: (`secret`) => `secret is string` = `implementation.validSecret`
|
|
115331
|
+
|
|
115332
|
+
Defined in: [lib/core/rpc.ts:17](https://github.com/maiyunnet/kebab/blob/master/lib/core/rpc.ts#L17)
|
|
115333
|
+
|
|
115334
|
+
校验密钥:至少 32 个字符,去除首尾空白后拒绝占位值及短重复模式
|
|
115335
|
+
|
|
115336
|
+
## Parameters
|
|
115337
|
+
|
|
115338
|
+
### secret
|
|
115339
|
+
|
|
115340
|
+
`unknown`
|
|
115341
|
+
|
|
115342
|
+
待校验密钥
|
|
115343
|
+
|
|
115344
|
+
## Returns
|
|
115345
|
+
|
|
115346
|
+
`secret is string`
|
|
115347
|
+
|
|
115348
|
+
密钥是否合格
|
|
115349
|
+
|
|
115006
115350
|
lib/core/type-aliases/TPm2Action.md
|
|
115007
115351
|
---
|
|
115008
115352
|
|
|
@@ -115016,7 +115360,7 @@ lib/core/type-aliases/TPm2Action.md
|
|
|
115016
115360
|
|
|
115017
115361
|
> **TPm2Action** = `"start"` \| `"stop"` \| `"restart"`
|
|
115018
115362
|
|
|
115019
|
-
Defined in: [lib/core.ts:
|
|
115363
|
+
Defined in: [lib/core.ts:842](https://github.com/maiyunnet/kebab/blob/master/lib/core.ts#L842)
|
|
115020
115364
|
|
|
115021
115365
|
PM2 操作类型
|
|
115022
115366
|
|
|
@@ -115033,7 +115377,7 @@ lib/core/variables/globalConfig.md
|
|
|
115033
115377
|
|
|
115034
115378
|
> `const` **globalConfig**: [`IConfig`](../../../index/interfaces/IConfig.md) & `object`
|
|
115035
115379
|
|
|
115036
|
-
Defined in: [lib/core.ts:
|
|
115380
|
+
Defined in: [lib/core.ts:32](https://github.com/maiyunnet/kebab/blob/master/lib/core.ts#L32)
|
|
115037
115381
|
|
|
115038
115382
|
全局参数
|
|
115039
115383
|
|
|
@@ -115090,7 +115434,7 @@ lib/core/variables/global.md
|
|
|
115090
115434
|
|
|
115091
115435
|
> `const` **global**: `Record`\<`string`, `any`\> = `{}`
|
|
115092
115436
|
|
|
115093
|
-
Defined in: [lib/core.ts:
|
|
115437
|
+
Defined in: [lib/core.ts:928](https://github.com/maiyunnet/kebab/blob/master/lib/core.ts#L928)
|
|
115094
115438
|
|
|
115095
115439
|
跨进程全局变量
|
|
115096
115440
|
|
|
@@ -115107,7 +115451,7 @@ lib/core/variables/RANDOM_L.md
|
|
|
115107
115451
|
|
|
115108
115452
|
> `const` **RANDOM\_L**: `"abcdefghijklmnopqrstuvwxyz"` = `'abcdefghijklmnopqrstuvwxyz'`
|
|
115109
115453
|
|
|
115110
|
-
Defined in: [lib/core.ts:
|
|
115454
|
+
Defined in: [lib/core.ts:115](https://github.com/maiyunnet/kebab/blob/master/lib/core.ts#L115)
|
|
115111
115455
|
|
|
115112
115456
|
小写字母字符集
|
|
115113
115457
|
|
|
@@ -115124,7 +115468,7 @@ lib/core/variables/RANDOM_LN.md
|
|
|
115124
115468
|
|
|
115125
115469
|
> `const` **RANDOM\_LN**: `string`
|
|
115126
115470
|
|
|
115127
|
-
Defined in: [lib/core.ts:
|
|
115471
|
+
Defined in: [lib/core.ts:120](https://github.com/maiyunnet/kebab/blob/master/lib/core.ts#L120)
|
|
115128
115472
|
|
|
115129
115473
|
小写字母 + 数字字符集
|
|
115130
115474
|
|
|
@@ -115141,7 +115485,7 @@ lib/core/variables/RANDOM_LU.md
|
|
|
115141
115485
|
|
|
115142
115486
|
> `const` **RANDOM\_LU**: `string`
|
|
115143
115487
|
|
|
115144
|
-
Defined in: [lib/core.ts:
|
|
115488
|
+
Defined in: [lib/core.ts:122](https://github.com/maiyunnet/kebab/blob/master/lib/core.ts#L122)
|
|
115145
115489
|
|
|
115146
115490
|
小写字母 + 大写字母字符集
|
|
115147
115491
|
|
|
@@ -115158,7 +115502,7 @@ lib/core/variables/RANDOM_LUN.md
|
|
|
115158
115502
|
|
|
115159
115503
|
> `const` **RANDOM\_LUN**: `string`
|
|
115160
115504
|
|
|
115161
|
-
Defined in: [lib/core.ts:
|
|
115505
|
+
Defined in: [lib/core.ts:124](https://github.com/maiyunnet/kebab/blob/master/lib/core.ts#L124)
|
|
115162
115506
|
|
|
115163
115507
|
小写字母 + 大写字母 + 数字字符集
|
|
115164
115508
|
|
|
@@ -115175,7 +115519,7 @@ lib/core/variables/RANDOM_LUNS.md
|
|
|
115175
115519
|
|
|
115176
115520
|
> `const` **RANDOM\_LUNS**: `string`
|
|
115177
115521
|
|
|
115178
|
-
Defined in: [lib/core.ts:
|
|
115522
|
+
Defined in: [lib/core.ts:128](https://github.com/maiyunnet/kebab/blob/master/lib/core.ts#L128)
|
|
115179
115523
|
|
|
115180
115524
|
小写字母 + 大写字母 + 数字字符集 + 特殊字符字符集
|
|
115181
115525
|
|
|
@@ -115192,7 +115536,7 @@ lib/core/variables/RANDOM_N.md
|
|
|
115192
115536
|
|
|
115193
115537
|
> `const` **RANDOM\_N**: `"0123456789"` = `'0123456789'`
|
|
115194
115538
|
|
|
115195
|
-
Defined in: [lib/core.ts:
|
|
115539
|
+
Defined in: [lib/core.ts:111](https://github.com/maiyunnet/kebab/blob/master/lib/core.ts#L111)
|
|
115196
115540
|
|
|
115197
115541
|
数字字符集
|
|
115198
115542
|
|
|
@@ -115209,7 +115553,7 @@ lib/core/variables/RANDOM_U.md
|
|
|
115209
115553
|
|
|
115210
115554
|
> `const` **RANDOM\_U**: `"ABCDEFGHIJKLMNOPQRSTUVWXYZ"` = `'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
|
|
115211
115555
|
|
|
115212
|
-
Defined in: [lib/core.ts:
|
|
115556
|
+
Defined in: [lib/core.ts:113](https://github.com/maiyunnet/kebab/blob/master/lib/core.ts#L113)
|
|
115213
115557
|
|
|
115214
115558
|
大写字母字符集
|
|
115215
115559
|
|
|
@@ -115226,7 +115570,7 @@ lib/core/variables/RANDOM_UN.md
|
|
|
115226
115570
|
|
|
115227
115571
|
> `const` **RANDOM\_UN**: `string`
|
|
115228
115572
|
|
|
115229
|
-
Defined in: [lib/core.ts:
|
|
115573
|
+
Defined in: [lib/core.ts:118](https://github.com/maiyunnet/kebab/blob/master/lib/core.ts#L118)
|
|
115230
115574
|
|
|
115231
115575
|
大写字母 + 数字字符集
|
|
115232
115576
|
|
|
@@ -115243,7 +115587,7 @@ lib/core/variables/RANDOM_V.md
|
|
|
115243
115587
|
|
|
115244
115588
|
> `const` **RANDOM\_V**: `"ACEFGHJKLMNPRSTWXY34567"` = `'ACEFGHJKLMNPRSTWXY34567'`
|
|
115245
115589
|
|
|
115246
|
-
Defined in: [lib/core.ts:
|
|
115590
|
+
Defined in: [lib/core.ts:126](https://github.com/maiyunnet/kebab/blob/master/lib/core.ts#L126)
|
|
115247
115591
|
|
|
115248
115592
|
验证码字符集
|
|
115249
115593
|
|
|
@@ -115260,7 +115604,7 @@ lib/core/variables/REAL_IP_CF.md
|
|
|
115260
115604
|
|
|
115261
115605
|
> `const` **REAL\_IP\_CF**: `"cf-connecting-ip"` = `'cf-connecting-ip'`
|
|
115262
115606
|
|
|
115263
|
-
Defined in: [lib/core.ts:
|
|
115607
|
+
Defined in: [lib/core.ts:407](https://github.com/maiyunnet/kebab/blob/master/lib/core.ts#L407)
|
|
115264
115608
|
|
|
115265
115609
|
使用的是 Cloudflare
|
|
115266
115610
|
|
|
@@ -115277,7 +115621,7 @@ lib/core/variables/REAL_IP_EO.md
|
|
|
115277
115621
|
|
|
115278
115622
|
> `const` **REAL\_IP\_EO**: `"eo-connecting-ip"` = `'eo-connecting-ip'`
|
|
115279
115623
|
|
|
115280
|
-
Defined in: [lib/core.ts:
|
|
115624
|
+
Defined in: [lib/core.ts:409](https://github.com/maiyunnet/kebab/blob/master/lib/core.ts#L409)
|
|
115281
115625
|
|
|
115282
115626
|
使用的是 EO
|
|
115283
115627
|
|
|
@@ -115294,7 +115638,7 @@ lib/core/variables/REAL_IP_X.md
|
|
|
115294
115638
|
|
|
115295
115639
|
> `const` **REAL\_IP\_X**: `"x-forwarded-for"` = `'x-forwarded-for'`
|
|
115296
115640
|
|
|
115297
|
-
Defined in: [lib/core.ts:
|
|
115641
|
+
Defined in: [lib/core.ts:405](https://github.com/maiyunnet/kebab/blob/master/lib/core.ts#L405)
|
|
115298
115642
|
|
|
115299
115643
|
使用 X-Forwarded-For 的 CDN 厂商
|
|
115300
115644
|
|
|
@@ -126610,7 +126954,7 @@ lib/text/functions/compareVersion.md
|
|
|
126610
126954
|
|
|
126611
126955
|
> **compareVersion**(`version`, `target`): `0` \| `1` \| `-1` \| `null`
|
|
126612
126956
|
|
|
126613
|
-
Defined in: [lib/text.ts:
|
|
126957
|
+
Defined in: [lib/text.ts:37](https://github.com/maiyunnet/kebab/blob/master/lib/text.ts#L37)
|
|
126614
126958
|
|
|
126615
126959
|
逐段比较三段正式发行版本 X.Y.Z,不按字符串或浮点数比较
|
|
126616
126960
|
|
|
@@ -126647,7 +126991,7 @@ lib/text/functions/csvescape.md
|
|
|
126647
126991
|
|
|
126648
126992
|
> **csvescape**(`str`): `string`
|
|
126649
126993
|
|
|
126650
|
-
Defined in: [lib/text.ts:
|
|
126994
|
+
Defined in: [lib/text.ts:549](https://github.com/maiyunnet/kebab/blob/master/lib/text.ts#L549)
|
|
126651
126995
|
|
|
126652
126996
|
CSV 特殊字符转换为实体字符
|
|
126653
126997
|
|
|
@@ -126674,7 +127018,7 @@ lib/text/functions/getFileExt.md
|
|
|
126674
127018
|
|
|
126675
127019
|
> **getFileExt**(`path`): `string`
|
|
126676
127020
|
|
|
126677
|
-
Defined in: [lib/text.ts:
|
|
127021
|
+
Defined in: [lib/text.ts:590](https://github.com/maiyunnet/kebab/blob/master/lib/text.ts#L590)
|
|
126678
127022
|
|
|
126679
127023
|
获取文件后缀
|
|
126680
127024
|
|
|
@@ -126703,7 +127047,7 @@ lib/text/functions/getFileNameExt.md
|
|
|
126703
127047
|
|
|
126704
127048
|
> **getFileNameExt**(`path`): `object`
|
|
126705
127049
|
|
|
126706
|
-
Defined in: [lib/text.ts:
|
|
127050
|
+
Defined in: [lib/text.ts:603](https://github.com/maiyunnet/kebab/blob/master/lib/text.ts#L603)
|
|
126707
127051
|
|
|
126708
127052
|
获取文件名和后缀
|
|
126709
127053
|
|
|
@@ -126740,7 +127084,7 @@ lib/text/functions/getFilename.md
|
|
|
126740
127084
|
|
|
126741
127085
|
> **getFilename**(`path`, `ext?`): `string`
|
|
126742
127086
|
|
|
126743
|
-
Defined in: [lib/text.ts:
|
|
127087
|
+
Defined in: [lib/text.ts:570](https://github.com/maiyunnet/kebab/blob/master/lib/text.ts#L570)
|
|
126744
127088
|
|
|
126745
127089
|
获取文件名
|
|
126746
127090
|
|
|
@@ -126775,7 +127119,7 @@ lib/text/functions/htmlescape.md
|
|
|
126775
127119
|
|
|
126776
127120
|
> **htmlescape**(`html`): `string`
|
|
126777
127121
|
|
|
126778
|
-
Defined in: [lib/text.ts:
|
|
127122
|
+
Defined in: [lib/text.ts:535](https://github.com/maiyunnet/kebab/blob/master/lib/text.ts#L535)
|
|
126779
127123
|
|
|
126780
127124
|
HTML 特殊字符转换为实体字符
|
|
126781
127125
|
|
|
@@ -126804,7 +127148,7 @@ lib/text/functions/int2str.md
|
|
|
126804
127148
|
|
|
126805
127149
|
> **int2str**(`int`, `digits?`, `decimal?`): `string`
|
|
126806
127150
|
|
|
126807
|
-
Defined in: [lib/text.ts:
|
|
127151
|
+
Defined in: [lib/text.ts:803](https://github.com/maiyunnet/kebab/blob/master/lib/text.ts#L803)
|
|
126808
127152
|
|
|
126809
127153
|
为解决精度问题,将整数转换为小数字符串
|
|
126810
127154
|
以下几个示例都是当 digits 为 3、decimal 为 2 时
|
|
@@ -126850,7 +127194,7 @@ lib/text/functions/isAscii.md
|
|
|
126850
127194
|
|
|
126851
127195
|
> **isAscii**(`text`): `boolean`
|
|
126852
127196
|
|
|
126853
|
-
Defined in: [lib/text.ts:
|
|
127197
|
+
Defined in: [lib/text.ts:337](https://github.com/maiyunnet/kebab/blob/master/lib/text.ts#L337)
|
|
126854
127198
|
|
|
126855
127199
|
判断是否在 ascii 字符集内,仅可输入部分
|
|
126856
127200
|
|
|
@@ -126879,7 +127223,7 @@ lib/text/functions/isDomain.md
|
|
|
126879
127223
|
|
|
126880
127224
|
> **isDomain**(`domain`): `boolean`
|
|
126881
127225
|
|
|
126882
|
-
Defined in: [lib/text.ts:
|
|
127226
|
+
Defined in: [lib/text.ts:326](https://github.com/maiyunnet/kebab/blob/master/lib/text.ts#L326)
|
|
126883
127227
|
|
|
126884
127228
|
判断是否是域名
|
|
126885
127229
|
|
|
@@ -126910,7 +127254,7 @@ lib/text/functions/isEMail.md
|
|
|
126910
127254
|
|
|
126911
127255
|
> **isEMail**(`email`): `boolean`
|
|
126912
127256
|
|
|
126913
|
-
Defined in: [lib/text.ts:
|
|
127257
|
+
Defined in: [lib/text.ts:299](https://github.com/maiyunnet/kebab/blob/master/lib/text.ts#L299)
|
|
126914
127258
|
|
|
126915
127259
|
是否是邮件地址
|
|
126916
127260
|
|
|
@@ -126937,7 +127281,7 @@ lib/text/functions/isFalsy.md
|
|
|
126937
127281
|
|
|
126938
127282
|
> **isFalsy**(`val`): `val is TFalsy`
|
|
126939
127283
|
|
|
126940
|
-
Defined in: [lib/text.ts:
|
|
127284
|
+
Defined in: [lib/text.ts:754](https://github.com/maiyunnet/kebab/blob/master/lib/text.ts#L754)
|
|
126941
127285
|
|
|
126942
127286
|
判断一个值是否是虚假的(为 null/undefined/空字符串/false/0)
|
|
126943
127287
|
|
|
@@ -126966,7 +127310,7 @@ lib/text/functions/isIdCardCN.md
|
|
|
126966
127310
|
|
|
126967
127311
|
> **isIdCardCN**(`idcard`): `boolean`
|
|
126968
127312
|
|
|
126969
|
-
Defined in: [lib/text.ts:
|
|
127313
|
+
Defined in: [lib/text.ts:449](https://github.com/maiyunnet/kebab/blob/master/lib/text.ts#L449)
|
|
126970
127314
|
|
|
126971
127315
|
是否是中国大陆身份证号码
|
|
126972
127316
|
|
|
@@ -126995,7 +127339,7 @@ lib/text/functions/isIPv4.md
|
|
|
126995
127339
|
|
|
126996
127340
|
> **isIPv4**(`ip`): `boolean`
|
|
126997
127341
|
|
|
126998
|
-
Defined in: [lib/text.ts:
|
|
127342
|
+
Defined in: [lib/text.ts:307](https://github.com/maiyunnet/kebab/blob/master/lib/text.ts#L307)
|
|
126999
127343
|
|
|
127000
127344
|
是否是 IPv4(基于 Node 原生 net.isIPv4,严格校验)
|
|
127001
127345
|
|
|
@@ -127022,7 +127366,7 @@ lib/text/functions/isIPv6.md
|
|
|
127022
127366
|
|
|
127023
127367
|
> **isIPv6**(`ip`): `boolean`
|
|
127024
127368
|
|
|
127025
|
-
Defined in: [lib/text.ts:
|
|
127369
|
+
Defined in: [lib/text.ts:315](https://github.com/maiyunnet/kebab/blob/master/lib/text.ts#L315)
|
|
127026
127370
|
|
|
127027
127371
|
是否是 IPv6(基于 Node 原生 net.isIPv6,严格校验)
|
|
127028
127372
|
|
|
@@ -127049,7 +127393,7 @@ lib/text/functions/isPhoneCN.md
|
|
|
127049
127393
|
|
|
127050
127394
|
> **isPhoneCN**(`p`): `boolean`
|
|
127051
127395
|
|
|
127052
|
-
Defined in: [lib/text.ts:
|
|
127396
|
+
Defined in: [lib/text.ts:441](https://github.com/maiyunnet/kebab/blob/master/lib/text.ts#L441)
|
|
127053
127397
|
|
|
127054
127398
|
判断手机号是否是 11 位,不做真实性校验
|
|
127055
127399
|
|
|
@@ -127078,7 +127422,7 @@ lib/text/functions/isRealPath.md
|
|
|
127078
127422
|
|
|
127079
127423
|
> **isRealPath**(`path`): `boolean`
|
|
127080
127424
|
|
|
127081
|
-
Defined in: [lib/text.ts:
|
|
127425
|
+
Defined in: [lib/text.ts:557](https://github.com/maiyunnet/kebab/blob/master/lib/text.ts#L557)
|
|
127082
127426
|
|
|
127083
127427
|
判断是否是绝对路径,是返回 true,相对路径返回 false
|
|
127084
127428
|
|
|
@@ -127107,7 +127451,7 @@ lib/text/functions/isSameOrigin.md
|
|
|
127107
127451
|
|
|
127108
127452
|
> **isSameOrigin**(`from`, `to`): `boolean`
|
|
127109
127453
|
|
|
127110
|
-
Defined in: [lib/text.ts:
|
|
127454
|
+
Defined in: [lib/text.ts:174](https://github.com/maiyunnet/kebab/blob/master/lib/text.ts#L174)
|
|
127111
127455
|
|
|
127112
127456
|
判断两个 URL 是否属于同源地址
|
|
127113
127457
|
|
|
@@ -127142,7 +127486,7 @@ lib/text/functions/isTruthy.md
|
|
|
127142
127486
|
|
|
127143
127487
|
> **isTruthy**\<`T`\>(`val`): `val is Exclude<T, TFalsy>`
|
|
127144
127488
|
|
|
127145
|
-
Defined in: [lib/text.ts:
|
|
127489
|
+
Defined in: [lib/text.ts:762](https://github.com/maiyunnet/kebab/blob/master/lib/text.ts#L762)
|
|
127146
127490
|
|
|
127147
127491
|
判断一个值是否是真实的(不为 null/undefined/空字符串/false/0)
|
|
127148
127492
|
|
|
@@ -127177,7 +127521,7 @@ lib/text/functions/logicalOr.md
|
|
|
127177
127521
|
|
|
127178
127522
|
> **logicalOr**\<`T`, `T2`\>(`v1`, `v2`): `T` *extends* [`TFalsy`](../type-aliases/TFalsy.md) ? `T2` : `T`
|
|
127179
127523
|
|
|
127180
|
-
Defined in: [lib/text.ts:
|
|
127524
|
+
Defined in: [lib/text.ts:771](https://github.com/maiyunnet/kebab/blob/master/lib/text.ts#L771)
|
|
127181
127525
|
|
|
127182
127526
|
类似 || 运算符的效果
|
|
127183
127527
|
|
|
@@ -127222,7 +127566,7 @@ lib/text/functions/match.md
|
|
|
127222
127566
|
|
|
127223
127567
|
> **match**(`str`, `regs`): `boolean`
|
|
127224
127568
|
|
|
127225
|
-
Defined in: [lib/text.ts:
|
|
127569
|
+
Defined in: [lib/text.ts:426](https://github.com/maiyunnet/kebab/blob/master/lib/text.ts#L426)
|
|
127226
127570
|
|
|
127227
127571
|
传入正则进行匹配 str 是否有一项满足
|
|
127228
127572
|
|
|
@@ -127257,7 +127601,7 @@ lib/text/functions/nlReplace.md
|
|
|
127257
127601
|
|
|
127258
127602
|
> **nlReplace**(`str`, `to?`): `string`
|
|
127259
127603
|
|
|
127260
|
-
Defined in: [lib/text.ts:
|
|
127604
|
+
Defined in: [lib/text.ts:346](https://github.com/maiyunnet/kebab/blob/master/lib/text.ts#L346)
|
|
127261
127605
|
|
|
127262
127606
|
换行替换为别的
|
|
127263
127607
|
|
|
@@ -127292,7 +127636,7 @@ lib/text/functions/parseDomain.md
|
|
|
127292
127636
|
|
|
127293
127637
|
> **parseDomain**(`domain`): `Promise`\<[`IDomain`](../interfaces/IDomain.md)\>
|
|
127294
127638
|
|
|
127295
|
-
Defined in: [lib/text.ts:
|
|
127639
|
+
Defined in: [lib/text.ts:369](https://github.com/maiyunnet/kebab/blob/master/lib/text.ts#L369)
|
|
127296
127640
|
|
|
127297
127641
|
解析域名并获取 tld/sld/domain/sub
|
|
127298
127642
|
|
|
@@ -127321,7 +127665,7 @@ lib/text/functions/parseHost.md
|
|
|
127321
127665
|
|
|
127322
127666
|
> **parseHost**(`host`): `object`
|
|
127323
127667
|
|
|
127324
|
-
Defined in: [lib/text.ts:
|
|
127668
|
+
Defined in: [lib/text.ts:70](https://github.com/maiyunnet/kebab/blob/master/lib/text.ts#L70)
|
|
127325
127669
|
|
|
127326
127670
|
解析主机名和端口号
|
|
127327
127671
|
|
|
@@ -127362,7 +127706,7 @@ lib/text/functions/parseJson.md
|
|
|
127362
127706
|
|
|
127363
127707
|
> **parseJson**\<`T`\>(`str`): `false` \| `T`
|
|
127364
127708
|
|
|
127365
|
-
Defined in: [lib/text.ts:
|
|
127709
|
+
Defined in: [lib/text.ts:666](https://github.com/maiyunnet/kebab/blob/master/lib/text.ts#L666)
|
|
127366
127710
|
|
|
127367
127711
|
解析 JSON,超出安全整数范围的整数字面量转换为 BigInt
|
|
127368
127712
|
|
|
@@ -127399,7 +127743,7 @@ lib/text/functions/parseUrl.md
|
|
|
127399
127743
|
|
|
127400
127744
|
> **parseUrl**(`url`): [`IUrlParse`](../../../index/interfaces/IUrlParse.md)
|
|
127401
127745
|
|
|
127402
|
-
Defined in: [lib/text.ts:
|
|
127746
|
+
Defined in: [lib/text.ts:96](https://github.com/maiyunnet/kebab/blob/master/lib/text.ts#L96)
|
|
127403
127747
|
|
|
127404
127748
|
格式化一段 URL
|
|
127405
127749
|
|
|
@@ -127426,7 +127770,7 @@ lib/text/functions/parseVersion.md
|
|
|
127426
127770
|
|
|
127427
127771
|
> **parseVersion**(`value`): \[`number`, `number`, `number`\] \| `null`
|
|
127428
127772
|
|
|
127429
|
-
Defined in: [lib/text.ts:
|
|
127773
|
+
Defined in: [lib/text.ts:18](https://github.com/maiyunnet/kebab/blob/master/lib/text.ts#L18)
|
|
127430
127774
|
|
|
127431
127775
|
解析三段正式发行版本 X.Y.Z,不接受前导零、预发行和构建后缀
|
|
127432
127776
|
|
|
@@ -127457,7 +127801,7 @@ lib/text/functions/queryParse.md
|
|
|
127457
127801
|
|
|
127458
127802
|
> **queryParse**(`query`): `Record`\<`string`, `string` \| `string`[]\>
|
|
127459
127803
|
|
|
127460
|
-
Defined in: [lib/text.ts:
|
|
127804
|
+
Defined in: [lib/text.ts:527](https://github.com/maiyunnet/kebab/blob/master/lib/text.ts#L527)
|
|
127461
127805
|
|
|
127462
127806
|
将 query string 转换为对象
|
|
127463
127807
|
|
|
@@ -127467,12 +127811,14 @@ Defined in: [lib/text.ts:519](https://github.com/maiyunnet/kebab/blob/master/lib
|
|
|
127467
127811
|
|
|
127468
127812
|
`string`
|
|
127469
127813
|
|
|
127470
|
-
|
|
127814
|
+
要转换的字符串,+ 表示空格,%2B 表示加号
|
|
127471
127815
|
|
|
127472
127816
|
## Returns
|
|
127473
127817
|
|
|
127474
127818
|
`Record`\<`string`, `string` \| `string`[]\>
|
|
127475
127819
|
|
|
127820
|
+
查询参数对象,重复键对应字符串数组
|
|
127821
|
+
|
|
127476
127822
|
lib/text/functions/queryStringify.md
|
|
127477
127823
|
---
|
|
127478
127824
|
|
|
@@ -127488,7 +127834,7 @@ lib/text/functions/queryStringify.md
|
|
|
127488
127834
|
|
|
127489
127835
|
> **queryStringify**(`query`, `encode?`): `string`
|
|
127490
127836
|
|
|
127491
|
-
Defined in: [lib/text.ts:
|
|
127837
|
+
Defined in: [lib/text.ts:477](https://github.com/maiyunnet/kebab/blob/master/lib/text.ts#L477)
|
|
127492
127838
|
|
|
127493
127839
|
将对象转换为 query string
|
|
127494
127840
|
|
|
@@ -127514,7 +127860,7 @@ Defined in: [lib/text.ts:470](https://github.com/maiyunnet/kebab/blob/master/lib
|
|
|
127514
127860
|
|
|
127515
127861
|
> **queryStringify**(`query`, `options`): `string`
|
|
127516
127862
|
|
|
127517
|
-
Defined in: [lib/text.ts:
|
|
127863
|
+
Defined in: [lib/text.ts:483](https://github.com/maiyunnet/kebab/blob/master/lib/text.ts#L483)
|
|
127518
127864
|
|
|
127519
127865
|
将对象转换为 query string
|
|
127520
127866
|
|
|
@@ -127559,7 +127905,7 @@ lib/text/functions/redact.md
|
|
|
127559
127905
|
|
|
127560
127906
|
> **redact**(`value`, `secrets`, `options?`): `string`
|
|
127561
127907
|
|
|
127562
|
-
Defined in: [lib/text.ts:
|
|
127908
|
+
Defined in: [lib/text.ts:841](https://github.com/maiyunnet/kebab/blob/master/lib/text.ts#L841)
|
|
127563
127909
|
|
|
127564
127910
|
将文本中的指定敏感字符串替换为占位文本
|
|
127565
127911
|
|
|
@@ -127614,7 +127960,7 @@ lib/text/functions/sizeFormat.md
|
|
|
127614
127960
|
|
|
127615
127961
|
> **sizeFormat**(`size`, `spliter?`): `string`
|
|
127616
127962
|
|
|
127617
|
-
Defined in: [lib/text.ts:
|
|
127963
|
+
Defined in: [lib/text.ts:56](https://github.com/maiyunnet/kebab/blob/master/lib/text.ts#L56)
|
|
127618
127964
|
|
|
127619
127965
|
将文件大小格式化为带单位的字符串
|
|
127620
127966
|
|
|
@@ -127649,7 +127995,7 @@ lib/text/functions/str2int.md
|
|
|
127649
127995
|
|
|
127650
127996
|
> **str2int**(`str`, `digits?`): `number`
|
|
127651
127997
|
|
|
127652
|
-
Defined in: [lib/text.ts:
|
|
127998
|
+
Defined in: [lib/text.ts:785](https://github.com/maiyunnet/kebab/blob/master/lib/text.ts#L785)
|
|
127653
127999
|
|
|
127654
128000
|
为解决精度问题,将字符串数字转换为整数显示
|
|
127655
128001
|
以下几个示例都是当 digits 为 2 时
|
|
@@ -127689,7 +128035,7 @@ lib/text/functions/stringifyBuffer.md
|
|
|
127689
128035
|
|
|
127690
128036
|
> **stringifyBuffer**(`buf`): `string`
|
|
127691
128037
|
|
|
127692
|
-
Defined in: [lib/text.ts:
|
|
128038
|
+
Defined in: [lib/text.ts:708](https://github.com/maiyunnet/kebab/blob/master/lib/text.ts#L708)
|
|
127693
128039
|
|
|
127694
128040
|
输出文本格式的 buffer
|
|
127695
128041
|
|
|
@@ -127718,7 +128064,7 @@ lib/text/functions/stringifyError.md
|
|
|
127718
128064
|
|
|
127719
128065
|
> **stringifyError**(`error`): `string`
|
|
127720
128066
|
|
|
127721
|
-
Defined in: [lib/text.ts:
|
|
128067
|
+
Defined in: [lib/text.ts:685](https://github.com/maiyunnet/kebab/blob/master/lib/text.ts#L685)
|
|
127722
128068
|
|
|
127723
128069
|
将未知异常转换为适合单行日志的文本,Error 优先返回完整堆栈
|
|
127724
128070
|
|
|
@@ -127749,7 +128095,7 @@ lib/text/functions/stringifyJson.md
|
|
|
127749
128095
|
|
|
127750
128096
|
> **stringifyJson**(`obj`, `space?`): `string`
|
|
127751
128097
|
|
|
127752
|
-
Defined in: [lib/text.ts:
|
|
128098
|
+
Defined in: [lib/text.ts:676](https://github.com/maiyunnet/kebab/blob/master/lib/text.ts#L676)
|
|
127753
128099
|
|
|
127754
128100
|
将对象转换为 JSON 字符串,BigInt 输出为整数字面量
|
|
127755
128101
|
|
|
@@ -127786,7 +128132,7 @@ lib/text/functions/stringifyResult.md
|
|
|
127786
128132
|
|
|
127787
128133
|
> **stringifyResult**(`rtn`): `string`
|
|
127788
128134
|
|
|
127789
|
-
Defined in: [lib/text.ts:
|
|
128135
|
+
Defined in: [lib/text.ts:625](https://github.com/maiyunnet/kebab/blob/master/lib/text.ts#L625)
|
|
127790
128136
|
|
|
127791
128137
|
将普通的返回 JSON 对象序列化为字符串
|
|
127792
128138
|
|
|
@@ -127815,7 +128161,7 @@ lib/text/functions/trimJson.md
|
|
|
127815
128161
|
|
|
127816
128162
|
> **trimJson**(`json`): `any`
|
|
127817
128163
|
|
|
127818
|
-
Defined in: [lib/text.ts:
|
|
128164
|
+
Defined in: [lib/text.ts:716](https://github.com/maiyunnet/kebab/blob/master/lib/text.ts#L716)
|
|
127819
128165
|
|
|
127820
128166
|
递归删除 json 中的字符串首尾空格,会返回一个新的对象
|
|
127821
128167
|
|
|
@@ -127842,7 +128188,7 @@ lib/text/functions/urlAtom.md
|
|
|
127842
128188
|
|
|
127843
128189
|
> **urlAtom**(`url`): `string`
|
|
127844
128190
|
|
|
127845
|
-
Defined in: [lib/text.ts:
|
|
128191
|
+
Defined in: [lib/text.ts:289](https://github.com/maiyunnet/kebab/blob/master/lib/text.ts#L289)
|
|
127846
128192
|
|
|
127847
128193
|
将路径中的 ../ ./ 都按规范妥善处理
|
|
127848
128194
|
|
|
@@ -127852,12 +128198,14 @@ Defined in: [lib/text.ts:273](https://github.com/maiyunnet/kebab/blob/master/lib
|
|
|
127852
128198
|
|
|
127853
128199
|
`string`
|
|
127854
128200
|
|
|
127855
|
-
|
|
128201
|
+
要处理的地址;相对路径保留无法抵消的 .. 段
|
|
127856
128202
|
|
|
127857
128203
|
## Returns
|
|
127858
128204
|
|
|
127859
128205
|
`string`
|
|
127860
128206
|
|
|
128207
|
+
规范化后的地址,查询和片段保持不变
|
|
128208
|
+
|
|
127861
128209
|
lib/text/functions/urlResolve.md
|
|
127862
128210
|
---
|
|
127863
128211
|
|
|
@@ -127871,7 +128219,7 @@ lib/text/functions/urlResolve.md
|
|
|
127871
128219
|
|
|
127872
128220
|
> **urlResolve**(`from`, `to`, `limit?`): `string`
|
|
127873
128221
|
|
|
127874
|
-
Defined in: [lib/text.ts:
|
|
128222
|
+
Defined in: [lib/text.ts:219](https://github.com/maiyunnet/kebab/blob/master/lib/text.ts#L219)
|
|
127875
128223
|
|
|
127876
128224
|
将相对路径根据基准路径进行转换
|
|
127877
128225
|
|
|
@@ -127893,12 +128241,14 @@ Defined in: [lib/text.ts:207](https://github.com/maiyunnet/kebab/blob/master/lib
|
|
|
127893
128241
|
|
|
127894
128242
|
`boolean` = `false`
|
|
127895
128243
|
|
|
127896
|
-
|
|
128244
|
+
是否将基准路径视作目录并限定结果不能逃逸,默认 false
|
|
127897
128245
|
|
|
127898
128246
|
## Returns
|
|
127899
128247
|
|
|
127900
128248
|
`string`
|
|
127901
128249
|
|
|
128250
|
+
转换后的地址,超出限定目录时返回基准目录
|
|
128251
|
+
|
|
127902
128252
|
lib/text/index.md
|
|
127903
128253
|
---
|
|
127904
128254
|
|
|
@@ -127976,7 +128326,7 @@ lib/text/interfaces/IDomain.md
|
|
|
127976
128326
|
|
|
127977
128327
|
# Interface: IDomain
|
|
127978
128328
|
|
|
127979
|
-
Defined in: [lib/text.ts:
|
|
128329
|
+
Defined in: [lib/text.ts:358](https://github.com/maiyunnet/kebab/blob/master/lib/text.ts#L358)
|
|
127980
128330
|
|
|
127981
128331
|
解析后的 domain
|
|
127982
128332
|
|
|
@@ -127986,7 +128336,7 @@ Defined in: [lib/text.ts:351](https://github.com/maiyunnet/kebab/blob/master/lib
|
|
|
127986
128336
|
|
|
127987
128337
|
> **domain**: `string` \| `null`
|
|
127988
128338
|
|
|
127989
|
-
Defined in: [lib/text.ts:
|
|
128339
|
+
Defined in: [lib/text.ts:361](https://github.com/maiyunnet/kebab/blob/master/lib/text.ts#L361)
|
|
127990
128340
|
|
|
127991
128341
|
***
|
|
127992
128342
|
|
|
@@ -127994,7 +128344,7 @@ Defined in: [lib/text.ts:354](https://github.com/maiyunnet/kebab/blob/master/lib
|
|
|
127994
128344
|
|
|
127995
128345
|
> **sld**: `string` \| `null`
|
|
127996
128346
|
|
|
127997
|
-
Defined in: [lib/text.ts:
|
|
128347
|
+
Defined in: [lib/text.ts:360](https://github.com/maiyunnet/kebab/blob/master/lib/text.ts#L360)
|
|
127998
128348
|
|
|
127999
128349
|
***
|
|
128000
128350
|
|
|
@@ -128002,7 +128352,7 @@ Defined in: [lib/text.ts:353](https://github.com/maiyunnet/kebab/blob/master/lib
|
|
|
128002
128352
|
|
|
128003
128353
|
> **sub**: `string` \| `null`
|
|
128004
128354
|
|
|
128005
|
-
Defined in: [lib/text.ts:
|
|
128355
|
+
Defined in: [lib/text.ts:362](https://github.com/maiyunnet/kebab/blob/master/lib/text.ts#L362)
|
|
128006
128356
|
|
|
128007
128357
|
***
|
|
128008
128358
|
|
|
@@ -128010,7 +128360,7 @@ Defined in: [lib/text.ts:355](https://github.com/maiyunnet/kebab/blob/master/lib
|
|
|
128010
128360
|
|
|
128011
128361
|
> **tld**: `string` \| `null`
|
|
128012
128362
|
|
|
128013
|
-
Defined in: [lib/text.ts:
|
|
128363
|
+
Defined in: [lib/text.ts:359](https://github.com/maiyunnet/kebab/blob/master/lib/text.ts#L359)
|
|
128014
128364
|
|
|
128015
128365
|
lib/text/type-aliases/TFalsy.md
|
|
128016
128366
|
---
|
|
@@ -128025,7 +128375,7 @@ lib/text/type-aliases/TFalsy.md
|
|
|
128025
128375
|
|
|
128026
128376
|
> **TFalsy** = `false` \| `""` \| `0` \| `null` \| `undefined` \| *typeof* `NaN`
|
|
128027
128377
|
|
|
128028
|
-
Defined in: [lib/text.ts:
|
|
128378
|
+
Defined in: [lib/text.ts:748](https://github.com/maiyunnet/kebab/blob/master/lib/text.ts#L748)
|
|
128029
128379
|
|
|
128030
128380
|
虚假值类型
|
|
128031
128381
|
|
|
@@ -128042,7 +128392,7 @@ lib/text/variables/REGEXP_ASCII.md
|
|
|
128042
128392
|
|
|
128043
128393
|
> `const` **REGEXP\_ASCII**: `RegExp`
|
|
128044
128394
|
|
|
128045
|
-
Defined in: [lib/text.ts:
|
|
128395
|
+
Defined in: [lib/text.ts:331](https://github.com/maiyunnet/kebab/blob/master/lib/text.ts#L331)
|
|
128046
128396
|
|
|
128047
128397
|
可打印的 ascii 字符集
|
|
128048
128398
|
|
|
@@ -128059,7 +128409,7 @@ lib/text/variables/REGEXP_DOMAIN.md
|
|
|
128059
128409
|
|
|
128060
128410
|
> `const` **REGEXP\_DOMAIN**: `RegExp`
|
|
128061
128411
|
|
|
128062
|
-
Defined in: [lib/text.ts:
|
|
128412
|
+
Defined in: [lib/text.ts:319](https://github.com/maiyunnet/kebab/blob/master/lib/text.ts#L319)
|
|
128063
128413
|
|
|
128064
128414
|
lib/text/variables/REGEXP_EMAIL.md
|
|
128065
128415
|
---
|
|
@@ -128074,7 +128424,7 @@ lib/text/variables/REGEXP_EMAIL.md
|
|
|
128074
128424
|
|
|
128075
128425
|
> `const` **REGEXP\_EMAIL**: `RegExp`
|
|
128076
128426
|
|
|
128077
|
-
Defined in: [lib/text.ts:
|
|
128427
|
+
Defined in: [lib/text.ts:293](https://github.com/maiyunnet/kebab/blob/master/lib/text.ts#L293)
|
|
128078
128428
|
|
|
128079
128429
|
lib/time/classes/Time.md
|
|
128080
128430
|
---
|
|
@@ -129422,7 +129772,7 @@ lib/undici/interfaces/IMproxyOptions.md
|
|
|
129422
129772
|
|
|
129423
129773
|
# Interface: IMproxyOptions
|
|
129424
129774
|
|
|
129425
|
-
Defined in: [lib/undici.ts:
|
|
129775
|
+
Defined in: [lib/undici.ts:924](https://github.com/maiyunnet/kebab/blob/master/lib/undici.ts#L924)
|
|
129426
129776
|
|
|
129427
129777
|
正向代理请求的传入参数选项
|
|
129428
129778
|
|
|
@@ -129432,7 +129782,7 @@ Defined in: [lib/undici.ts:913](https://github.com/maiyunnet/kebab/blob/master/l
|
|
|
129432
129782
|
|
|
129433
129783
|
> `optional` **filter?**: (`h`) => `boolean`
|
|
129434
129784
|
|
|
129435
|
-
Defined in: [lib/undici.ts:
|
|
129785
|
+
Defined in: [lib/undici.ts:939](https://github.com/maiyunnet/kebab/blob/master/lib/undici.ts#L939)
|
|
129436
129786
|
|
|
129437
129787
|
过滤 header,返回 true 则留下
|
|
129438
129788
|
|
|
@@ -129452,7 +129802,7 @@ Defined in: [lib/undici.ts:928](https://github.com/maiyunnet/kebab/blob/master/l
|
|
|
129452
129802
|
|
|
129453
129803
|
> `optional` **follow?**: `number`
|
|
129454
129804
|
|
|
129455
|
-
Defined in: [lib/undici.ts:
|
|
129805
|
+
Defined in: [lib/undici.ts:929](https://github.com/maiyunnet/kebab/blob/master/lib/undici.ts#L929)
|
|
129456
129806
|
|
|
129457
129807
|
***
|
|
129458
129808
|
|
|
@@ -129460,7 +129810,7 @@ Defined in: [lib/undici.ts:918](https://github.com/maiyunnet/kebab/blob/master/l
|
|
|
129460
129810
|
|
|
129461
129811
|
> `optional` **headers?**: [`THttpHeaders`](../type-aliases/THttpHeaders.md)
|
|
129462
129812
|
|
|
129463
|
-
Defined in: [lib/undici.ts:
|
|
129813
|
+
Defined in: [lib/undici.ts:933](https://github.com/maiyunnet/kebab/blob/master/lib/undici.ts#L933)
|
|
129464
129814
|
|
|
129465
129815
|
***
|
|
129466
129816
|
|
|
@@ -129468,7 +129818,7 @@ Defined in: [lib/undici.ts:922](https://github.com/maiyunnet/kebab/blob/master/l
|
|
|
129468
129818
|
|
|
129469
129819
|
> `optional` **hosts?**: `string` \| `Record`\<`string`, `string`\>
|
|
129470
129820
|
|
|
129471
|
-
Defined in: [lib/undici.ts:
|
|
129821
|
+
Defined in: [lib/undici.ts:931](https://github.com/maiyunnet/kebab/blob/master/lib/undici.ts#L931)
|
|
129472
129822
|
|
|
129473
129823
|
自定义 host 映射,如 {'www.maiyun.net': '127.0.0.1'},或全部映射到一个 host
|
|
129474
129824
|
|
|
@@ -129478,7 +129828,7 @@ Defined in: [lib/undici.ts:920](https://github.com/maiyunnet/kebab/blob/master/l
|
|
|
129478
129828
|
|
|
129479
129829
|
> `optional` **keepAliveTimeout?**: `number`
|
|
129480
129830
|
|
|
129481
|
-
Defined in: [lib/undici.ts:
|
|
129831
|
+
Defined in: [lib/undici.ts:935](https://github.com/maiyunnet/kebab/blob/master/lib/undici.ts#L935)
|
|
129482
129832
|
|
|
129483
129833
|
空闲连接允许复用的最长秒数;非正数或无效值按未设置处理;默认无服务端提示时为 4 秒,有提示时采用提示值减 2 秒且最多 600 秒
|
|
129484
129834
|
|
|
@@ -129488,7 +129838,7 @@ Defined in: [lib/undici.ts:924](https://github.com/maiyunnet/kebab/blob/master/l
|
|
|
129488
129838
|
|
|
129489
129839
|
> `optional` **local?**: `string`
|
|
129490
129840
|
|
|
129491
|
-
Defined in: [lib/undici.ts:
|
|
129841
|
+
Defined in: [lib/undici.ts:932](https://github.com/maiyunnet/kebab/blob/master/lib/undici.ts#L932)
|
|
129492
129842
|
|
|
129493
129843
|
***
|
|
129494
129844
|
|
|
@@ -129496,7 +129846,7 @@ Defined in: [lib/undici.ts:921](https://github.com/maiyunnet/kebab/blob/master/l
|
|
|
129496
129846
|
|
|
129497
129847
|
> `optional` **proxyMode?**: `"request"` \| `"passthrough"`
|
|
129498
129848
|
|
|
129499
|
-
Defined in: [lib/undici.ts:
|
|
129849
|
+
Defined in: [lib/undici.ts:926](https://github.com/maiyunnet/kebab/blob/master/lib/undici.ts#L926)
|
|
129500
129850
|
|
|
129501
129851
|
默认 passthrough 保留已有来源头;request 清理来源头;两者均使用目标 Host
|
|
129502
129852
|
|
|
@@ -129506,7 +129856,7 @@ Defined in: [lib/undici.ts:915](https://github.com/maiyunnet/kebab/blob/master/l
|
|
|
129506
129856
|
|
|
129507
129857
|
> `optional` **reuse?**: `string` \| `Agent` \| `ProxyAgent`
|
|
129508
129858
|
|
|
129509
|
-
Defined in: [lib/undici.ts:
|
|
129859
|
+
Defined in: [lib/undici.ts:941](https://github.com/maiyunnet/kebab/blob/master/lib/undici.ts#L941)
|
|
129510
129860
|
|
|
129511
129861
|
默认为 default
|
|
129512
129862
|
|
|
@@ -129516,7 +129866,7 @@ Defined in: [lib/undici.ts:930](https://github.com/maiyunnet/kebab/blob/master/l
|
|
|
129516
129866
|
|
|
129517
129867
|
> `optional` **reuseTimeout?**: `number`
|
|
129518
129868
|
|
|
129519
|
-
Defined in: [lib/undici.ts:
|
|
129869
|
+
Defined in: [lib/undici.ts:937](https://github.com/maiyunnet/kebab/blob/master/lib/undici.ts#L937)
|
|
129520
129870
|
|
|
129521
129871
|
连接建立后允许承接新请求的最长秒数;非正数或无效值按未设置处理;达到后不再复用但不会中断在途请求,默认不限制
|
|
129522
129872
|
|
|
@@ -129526,7 +129876,7 @@ Defined in: [lib/undici.ts:926](https://github.com/maiyunnet/kebab/blob/master/l
|
|
|
129526
129876
|
|
|
129527
129877
|
> `optional` **timeout?**: `number`
|
|
129528
129878
|
|
|
129529
|
-
Defined in: [lib/undici.ts:
|
|
129879
|
+
Defined in: [lib/undici.ts:928](https://github.com/maiyunnet/kebab/blob/master/lib/undici.ts#L928)
|
|
129530
129880
|
|
|
129531
129881
|
秒数,默认 300 秒
|
|
129532
129882
|
|
|
@@ -129541,7 +129891,7 @@ lib/undici/interfaces/IRequestOptions.md
|
|
|
129541
129891
|
|
|
129542
129892
|
# Interface: IRequestOptions
|
|
129543
129893
|
|
|
129544
|
-
Defined in: [lib/undici.ts:
|
|
129894
|
+
Defined in: [lib/undici.ts:881](https://github.com/maiyunnet/kebab/blob/master/lib/undici.ts#L881)
|
|
129545
129895
|
|
|
129546
129896
|
请求的传入参数选项
|
|
129547
129897
|
|
|
@@ -129551,7 +129901,7 @@ Defined in: [lib/undici.ts:870](https://github.com/maiyunnet/kebab/blob/master/l
|
|
|
129551
129901
|
|
|
129552
129902
|
> `optional` **cookie?**: `Record`\<`string`, [`ICookie`](../../cookie/interfaces/ICookie.md)\>
|
|
129553
129903
|
|
|
129554
|
-
Defined in: [lib/undici.ts:
|
|
129904
|
+
Defined in: [lib/undici.ts:916](https://github.com/maiyunnet/kebab/blob/master/lib/undici.ts#L916)
|
|
129555
129905
|
|
|
129556
129906
|
cookie 托管对象
|
|
129557
129907
|
|
|
@@ -129561,7 +129911,7 @@ cookie 托管对象
|
|
|
129561
129911
|
|
|
129562
129912
|
> `optional` **follow?**: `number`
|
|
129563
129913
|
|
|
129564
|
-
Defined in: [lib/undici.ts:
|
|
129914
|
+
Defined in: [lib/undici.ts:893](https://github.com/maiyunnet/kebab/blob/master/lib/undici.ts#L893)
|
|
129565
129915
|
|
|
129566
129916
|
追踪 location 次数,0 为不追踪,默认为 0
|
|
129567
129917
|
|
|
@@ -129571,7 +129921,7 @@ Defined in: [lib/undici.ts:882](https://github.com/maiyunnet/kebab/blob/master/l
|
|
|
129571
129921
|
|
|
129572
129922
|
> `optional` **headers?**: [`THttpHeaders`](../type-aliases/THttpHeaders.md)
|
|
129573
129923
|
|
|
129574
|
-
Defined in: [lib/undici.ts:
|
|
129924
|
+
Defined in: [lib/undici.ts:898](https://github.com/maiyunnet/kebab/blob/master/lib/undici.ts#L898)
|
|
129575
129925
|
|
|
129576
129926
|
***
|
|
129577
129927
|
|
|
@@ -129579,7 +129929,7 @@ Defined in: [lib/undici.ts:887](https://github.com/maiyunnet/kebab/blob/master/l
|
|
|
129579
129929
|
|
|
129580
129930
|
> `optional` **hosts?**: `string` \| `Record`\<`string`, `string`\>
|
|
129581
129931
|
|
|
129582
|
-
Defined in: [lib/undici.ts:
|
|
129932
|
+
Defined in: [lib/undici.ts:895](https://github.com/maiyunnet/kebab/blob/master/lib/undici.ts#L895)
|
|
129583
129933
|
|
|
129584
129934
|
自定义 host 映射,如 {'www.maiyun.net': '127.0.0.1'},或全部映射到一个 host
|
|
129585
129935
|
|
|
@@ -129589,7 +129939,7 @@ Defined in: [lib/undici.ts:884](https://github.com/maiyunnet/kebab/blob/master/l
|
|
|
129589
129939
|
|
|
129590
129940
|
> `optional` **keep?**: `boolean`
|
|
129591
129941
|
|
|
129592
|
-
Defined in: [lib/undici.ts:
|
|
129942
|
+
Defined in: [lib/undici.ts:908](https://github.com/maiyunnet/kebab/blob/master/lib/undici.ts#L908)
|
|
129593
129943
|
|
|
129594
129944
|
连接是否保持长连接(即是否允许复用),默认为 true
|
|
129595
129945
|
|
|
@@ -129599,7 +129949,7 @@ Defined in: [lib/undici.ts:897](https://github.com/maiyunnet/kebab/blob/master/l
|
|
|
129599
129949
|
|
|
129600
129950
|
> `optional` **keepAliveTimeout?**: `number`
|
|
129601
129951
|
|
|
129602
|
-
Defined in: [lib/undici.ts:
|
|
129952
|
+
Defined in: [lib/undici.ts:910](https://github.com/maiyunnet/kebab/blob/master/lib/undici.ts#L910)
|
|
129603
129953
|
|
|
129604
129954
|
空闲连接允许复用的最长秒数;非正数或无效值按未设置处理;默认无服务端提示时为 4 秒,有提示时采用提示值减 2 秒且最多 600 秒;自定义 Agent 由其自身配置
|
|
129605
129955
|
|
|
@@ -129609,7 +129959,7 @@ Defined in: [lib/undici.ts:899](https://github.com/maiyunnet/kebab/blob/master/l
|
|
|
129609
129959
|
|
|
129610
129960
|
> `optional` **local?**: `string`
|
|
129611
129961
|
|
|
129612
|
-
Defined in: [lib/undici.ts:
|
|
129962
|
+
Defined in: [lib/undici.ts:897](https://github.com/maiyunnet/kebab/blob/master/lib/undici.ts#L897)
|
|
129613
129963
|
|
|
129614
129964
|
***
|
|
129615
129965
|
|
|
@@ -129617,7 +129967,7 @@ Defined in: [lib/undici.ts:886](https://github.com/maiyunnet/kebab/blob/master/l
|
|
|
129617
129967
|
|
|
129618
129968
|
> `optional` **log?**: `boolean`
|
|
129619
129969
|
|
|
129620
|
-
Defined in: [lib/undici.ts:
|
|
129970
|
+
Defined in: [lib/undici.ts:918](https://github.com/maiyunnet/kebab/blob/master/lib/undici.ts#L918)
|
|
129621
129971
|
|
|
129622
129972
|
若有异常写入文件日志,默认为 true
|
|
129623
129973
|
|
|
@@ -129627,7 +129977,7 @@ Defined in: [lib/undici.ts:907](https://github.com/maiyunnet/kebab/blob/master/l
|
|
|
129627
129977
|
|
|
129628
129978
|
> `optional` **method?**: `"GET"` \| `"POST"` \| `"PUT"` \| `"DELETE"` \| `"OPTIONS"`
|
|
129629
129979
|
|
|
129630
|
-
Defined in: [lib/undici.ts:
|
|
129980
|
+
Defined in: [lib/undici.ts:882](https://github.com/maiyunnet/kebab/blob/master/lib/undici.ts#L882)
|
|
129631
129981
|
|
|
129632
129982
|
***
|
|
129633
129983
|
|
|
@@ -129635,7 +129985,7 @@ Defined in: [lib/undici.ts:871](https://github.com/maiyunnet/kebab/blob/master/l
|
|
|
129635
129985
|
|
|
129636
129986
|
> `optional` **mproxy?**: `object`
|
|
129637
129987
|
|
|
129638
|
-
Defined in: [lib/undici.ts:
|
|
129988
|
+
Defined in: [lib/undici.ts:900](https://github.com/maiyunnet/kebab/blob/master/lib/undici.ts#L900)
|
|
129639
129989
|
|
|
129640
129990
|
正向 mproxy 代理,url 如 https://xxx/abc
|
|
129641
129991
|
|
|
@@ -129663,7 +130013,7 @@ Defined in: [lib/undici.ts:889](https://github.com/maiyunnet/kebab/blob/master/l
|
|
|
129663
130013
|
|
|
129664
130014
|
> `optional` **retry?**: `number`
|
|
129665
130015
|
|
|
129666
|
-
Defined in: [lib/undici.ts:
|
|
130016
|
+
Defined in: [lib/undici.ts:887](https://github.com/maiyunnet/kebab/blob/master/lib/undici.ts#L887)
|
|
129667
130017
|
|
|
129668
130018
|
网络异常后的重试次数,默认 0;流式请求体不可重试,非幂等请求需由调用方保证安全
|
|
129669
130019
|
|
|
@@ -129673,7 +130023,7 @@ Defined in: [lib/undici.ts:876](https://github.com/maiyunnet/kebab/blob/master/l
|
|
|
129673
130023
|
|
|
129674
130024
|
> `optional` **retryJson?**: `number`
|
|
129675
130025
|
|
|
129676
|
-
Defined in: [lib/undici.ts:
|
|
130026
|
+
Defined in: [lib/undici.ts:889](https://github.com/maiyunnet/kebab/blob/master/lib/undici.ts#L889)
|
|
129677
130027
|
|
|
129678
130028
|
JSON 解析失败或重试验证未通过后的重试次数,默认 0;仅适用于 ResponseJson 快捷方法,非幂等请求需由调用方保证安全
|
|
129679
130029
|
|
|
@@ -129683,7 +130033,7 @@ JSON 解析失败或重试验证未通过后的重试次数,默认 0;仅适
|
|
|
129683
130033
|
|
|
129684
130034
|
> `optional` **retryJsonHandler?**: (`json`) => `boolean`
|
|
129685
130035
|
|
|
129686
|
-
Defined in: [lib/undici.ts:
|
|
130036
|
+
Defined in: [lib/undici.ts:891](https://github.com/maiyunnet/kebab/blob/master/lib/undici.ts#L891)
|
|
129687
130037
|
|
|
129688
130038
|
JSON 重试验证方法;返回 false 时按 retryJson 的设置重试,耗尽后仍返回最后一次解析结果,业务结果由调用方判断;仅适用于 ResponseJson 快捷方法
|
|
129689
130039
|
|
|
@@ -129703,7 +130053,7 @@ JSON 重试验证方法;返回 false 时按 retryJson 的设置重试,耗尽
|
|
|
129703
130053
|
|
|
129704
130054
|
> `optional` **reuse?**: `string` \| `Agent` \| `ProxyAgent`
|
|
129705
130055
|
|
|
129706
|
-
Defined in: [lib/undici.ts:
|
|
130056
|
+
Defined in: [lib/undici.ts:914](https://github.com/maiyunnet/kebab/blob/master/lib/undici.ts#L914)
|
|
129707
130057
|
|
|
129708
130058
|
复用池名/Agent,默认为 default
|
|
129709
130059
|
|
|
@@ -129713,7 +130063,7 @@ Defined in: [lib/undici.ts:903](https://github.com/maiyunnet/kebab/blob/master/l
|
|
|
129713
130063
|
|
|
129714
130064
|
> `optional` **reuseTimeout?**: `number`
|
|
129715
130065
|
|
|
129716
|
-
Defined in: [lib/undici.ts:
|
|
130066
|
+
Defined in: [lib/undici.ts:912](https://github.com/maiyunnet/kebab/blob/master/lib/undici.ts#L912)
|
|
129717
130067
|
|
|
129718
130068
|
连接建立后允许承接新请求的最长秒数;非正数或无效值按未设置处理;达到后不再复用但不会中断在途请求,默认不限制;自定义 Agent 由其自身配置
|
|
129719
130069
|
|
|
@@ -129723,7 +130073,7 @@ Defined in: [lib/undici.ts:901](https://github.com/maiyunnet/kebab/blob/master/l
|
|
|
129723
130073
|
|
|
129724
130074
|
> `optional` **save?**: `string`
|
|
129725
130075
|
|
|
129726
|
-
Defined in: [lib/undici.ts:
|
|
130076
|
+
Defined in: [lib/undici.ts:896](https://github.com/maiyunnet/kebab/blob/master/lib/undici.ts#L896)
|
|
129727
130077
|
|
|
129728
130078
|
***
|
|
129729
130079
|
|
|
@@ -129731,7 +130081,7 @@ Defined in: [lib/undici.ts:885](https://github.com/maiyunnet/kebab/blob/master/l
|
|
|
129731
130081
|
|
|
129732
130082
|
> `optional` **signal?**: `AbortSignal`
|
|
129733
130083
|
|
|
129734
|
-
Defined in: [lib/undici.ts:
|
|
130084
|
+
Defined in: [lib/undici.ts:920](https://github.com/maiyunnet/kebab/blob/master/lib/undici.ts#L920)
|
|
129735
130085
|
|
|
129736
130086
|
请求中止信号
|
|
129737
130087
|
|
|
@@ -129741,7 +130091,7 @@ Defined in: [lib/undici.ts:909](https://github.com/maiyunnet/kebab/blob/master/l
|
|
|
129741
130091
|
|
|
129742
130092
|
> `optional` **timeout?**: `number`
|
|
129743
130093
|
|
|
129744
|
-
Defined in: [lib/undici.ts:
|
|
130094
|
+
Defined in: [lib/undici.ts:885](https://github.com/maiyunnet/kebab/blob/master/lib/undici.ts#L885)
|
|
129745
130095
|
|
|
129746
130096
|
秒数,默认 300 秒
|
|
129747
130097
|
|
|
@@ -129751,7 +130101,7 @@ Defined in: [lib/undici.ts:874](https://github.com/maiyunnet/kebab/blob/master/l
|
|
|
129751
130101
|
|
|
129752
130102
|
> `optional` **type?**: `"form"` \| `"json"`
|
|
129753
130103
|
|
|
129754
|
-
Defined in: [lib/undici.ts:
|
|
130104
|
+
Defined in: [lib/undici.ts:883](https://github.com/maiyunnet/kebab/blob/master/lib/undici.ts#L883)
|
|
129755
130105
|
|
|
129756
130106
|
lib/undici/interfaces/IRproxyOptions.md
|
|
129757
130107
|
---
|
|
@@ -129764,7 +130114,7 @@ lib/undici/interfaces/IRproxyOptions.md
|
|
|
129764
130114
|
|
|
129765
130115
|
# Interface: IRproxyOptions
|
|
129766
130116
|
|
|
129767
|
-
Defined in: [lib/undici.ts:
|
|
130117
|
+
Defined in: [lib/undici.ts:945](https://github.com/maiyunnet/kebab/blob/master/lib/undici.ts#L945)
|
|
129768
130118
|
|
|
129769
130119
|
反向代理请求的传入参数选项
|
|
129770
130120
|
|
|
@@ -129778,7 +130128,7 @@ Defined in: [lib/undici.ts:934](https://github.com/maiyunnet/kebab/blob/master/l
|
|
|
129778
130128
|
|
|
129779
130129
|
> `optional` **body?**: `string` \| `Buffer`\<`ArrayBufferLike`\> \| `Readable`
|
|
129780
130130
|
|
|
129781
|
-
Defined in: [lib/undici.ts:
|
|
130131
|
+
Defined in: [lib/undici.ts:968](https://github.com/maiyunnet/kebab/blob/master/lib/undici.ts#L968)
|
|
129782
130132
|
|
|
129783
130133
|
手动传入请求体(优先于原始 req 流),用于 req 流已消费后仍需转发 body 的场景
|
|
129784
130134
|
|
|
@@ -129788,7 +130138,7 @@ Defined in: [lib/undici.ts:957](https://github.com/maiyunnet/kebab/blob/master/l
|
|
|
129788
130138
|
|
|
129789
130139
|
> `optional` **filter?**: (`h`) => `boolean`
|
|
129790
130140
|
|
|
129791
|
-
Defined in: [lib/undici.ts:
|
|
130141
|
+
Defined in: [lib/undici.ts:958](https://github.com/maiyunnet/kebab/blob/master/lib/undici.ts#L958)
|
|
129792
130142
|
|
|
129793
130143
|
过滤 header,返回 true 则留下
|
|
129794
130144
|
|
|
@@ -129808,7 +130158,7 @@ Defined in: [lib/undici.ts:947](https://github.com/maiyunnet/kebab/blob/master/l
|
|
|
129808
130158
|
|
|
129809
130159
|
> `optional` **follow?**: `number`
|
|
129810
130160
|
|
|
129811
|
-
Defined in: [lib/undici.ts:
|
|
130161
|
+
Defined in: [lib/undici.ts:948](https://github.com/maiyunnet/kebab/blob/master/lib/undici.ts#L948)
|
|
129812
130162
|
|
|
129813
130163
|
***
|
|
129814
130164
|
|
|
@@ -129816,7 +130166,7 @@ Defined in: [lib/undici.ts:937](https://github.com/maiyunnet/kebab/blob/master/l
|
|
|
129816
130166
|
|
|
129817
130167
|
> `optional` **headers?**: [`THttpHeaders`](../type-aliases/THttpHeaders.md)
|
|
129818
130168
|
|
|
129819
|
-
Defined in: [lib/undici.ts:
|
|
130169
|
+
Defined in: [lib/undici.ts:952](https://github.com/maiyunnet/kebab/blob/master/lib/undici.ts#L952)
|
|
129820
130170
|
|
|
129821
130171
|
***
|
|
129822
130172
|
|
|
@@ -129824,7 +130174,7 @@ Defined in: [lib/undici.ts:941](https://github.com/maiyunnet/kebab/blob/master/l
|
|
|
129824
130174
|
|
|
129825
130175
|
> `optional` **hosts?**: `string` \| `Record`\<`string`, `string`\>
|
|
129826
130176
|
|
|
129827
|
-
Defined in: [lib/undici.ts:
|
|
130177
|
+
Defined in: [lib/undici.ts:950](https://github.com/maiyunnet/kebab/blob/master/lib/undici.ts#L950)
|
|
129828
130178
|
|
|
129829
130179
|
自定义 host 映射,如 {'www.maiyun.net': '127.0.0.1'},或全部映射到一个 host
|
|
129830
130180
|
|
|
@@ -129834,7 +130184,7 @@ Defined in: [lib/undici.ts:939](https://github.com/maiyunnet/kebab/blob/master/l
|
|
|
129834
130184
|
|
|
129835
130185
|
> `optional` **keepAliveTimeout?**: `number`
|
|
129836
130186
|
|
|
129837
|
-
Defined in: [lib/undici.ts:
|
|
130187
|
+
Defined in: [lib/undici.ts:954](https://github.com/maiyunnet/kebab/blob/master/lib/undici.ts#L954)
|
|
129838
130188
|
|
|
129839
130189
|
空闲连接允许复用的最长秒数;非正数或无效值按未设置处理;默认无服务端提示时为 4 秒,有提示时采用提示值减 2 秒且最多 600 秒
|
|
129840
130190
|
|
|
@@ -129844,7 +130194,7 @@ Defined in: [lib/undici.ts:943](https://github.com/maiyunnet/kebab/blob/master/l
|
|
|
129844
130194
|
|
|
129845
130195
|
> `optional` **local?**: `string`
|
|
129846
130196
|
|
|
129847
|
-
Defined in: [lib/undici.ts:
|
|
130197
|
+
Defined in: [lib/undici.ts:951](https://github.com/maiyunnet/kebab/blob/master/lib/undici.ts#L951)
|
|
129848
130198
|
|
|
129849
130199
|
***
|
|
129850
130200
|
|
|
@@ -129852,7 +130202,7 @@ Defined in: [lib/undici.ts:940](https://github.com/maiyunnet/kebab/blob/master/l
|
|
|
129852
130202
|
|
|
129853
130203
|
> `optional` **mproxy?**: `object`
|
|
129854
130204
|
|
|
129855
|
-
Defined in: [lib/undici.ts:
|
|
130205
|
+
Defined in: [lib/undici.ts:960](https://github.com/maiyunnet/kebab/blob/master/lib/undici.ts#L960)
|
|
129856
130206
|
|
|
129857
130207
|
正向 mproxy 代理,url 如 https://xxx/abc
|
|
129858
130208
|
|
|
@@ -129897,7 +130247,7 @@ reverse 的协议和 IP 仅取实际连接,不信任来路代理头;可信
|
|
|
129897
130247
|
|
|
129898
130248
|
> `optional` **querys?**: `Record`\<`string`, `any`\>
|
|
129899
130249
|
|
|
129900
|
-
Defined in: [lib/undici.ts:
|
|
130250
|
+
Defined in: [lib/undici.ts:970](https://github.com/maiyunnet/kebab/blob/master/lib/undici.ts#L970)
|
|
129901
130251
|
|
|
129902
130252
|
自定义 GET 查询参数,传入后直接替换代理目标 URL 的整个 query string
|
|
129903
130253
|
|
|
@@ -129907,7 +130257,7 @@ Defined in: [lib/undici.ts:959](https://github.com/maiyunnet/kebab/blob/master/l
|
|
|
129907
130257
|
|
|
129908
130258
|
> `optional` **reuse?**: `string` \| `Agent` \| `ProxyAgent`
|
|
129909
130259
|
|
|
129910
|
-
Defined in: [lib/undici.ts:
|
|
130260
|
+
Defined in: [lib/undici.ts:972](https://github.com/maiyunnet/kebab/blob/master/lib/undici.ts#L972)
|
|
129911
130261
|
|
|
129912
130262
|
默认为 default
|
|
129913
130263
|
|
|
@@ -129917,7 +130267,7 @@ Defined in: [lib/undici.ts:961](https://github.com/maiyunnet/kebab/blob/master/l
|
|
|
129917
130267
|
|
|
129918
130268
|
> `optional` **reuseTimeout?**: `number`
|
|
129919
130269
|
|
|
129920
|
-
Defined in: [lib/undici.ts:
|
|
130270
|
+
Defined in: [lib/undici.ts:956](https://github.com/maiyunnet/kebab/blob/master/lib/undici.ts#L956)
|
|
129921
130271
|
|
|
129922
130272
|
连接建立后允许承接新请求的最长秒数;非正数或无效值按未设置处理;达到后不再复用但不会中断在途请求,默认不限制
|
|
129923
130273
|
|
|
@@ -129927,7 +130277,7 @@ Defined in: [lib/undici.ts:945](https://github.com/maiyunnet/kebab/blob/master/l
|
|
|
129927
130277
|
|
|
129928
130278
|
> `optional` **timeout?**: `number`
|
|
129929
130279
|
|
|
129930
|
-
Defined in: [lib/undici.ts:
|
|
130280
|
+
Defined in: [lib/undici.ts:947](https://github.com/maiyunnet/kebab/blob/master/lib/undici.ts#L947)
|
|
129931
130281
|
|
|
129932
130282
|
秒数,默认 300 秒
|
|
129933
130283
|
|
|
@@ -130620,7 +130970,7 @@ lib/undici/type-aliases/THttpHeaders.md
|
|
|
130620
130970
|
|
|
130621
130971
|
> **THttpHeaders** = `http.IncomingHttpHeaders` & `object`
|
|
130622
130972
|
|
|
130623
|
-
Defined in: [lib/undici.ts:
|
|
130973
|
+
Defined in: [lib/undici.ts:977](https://github.com/maiyunnet/kebab/blob/master/lib/undici.ts#L977)
|
|
130624
130974
|
|
|
130625
130975
|
http headers
|
|
130626
130976
|
|
|
@@ -135860,11 +136210,11 @@ Defined in: [sys/mod.ts:92](https://github.com/maiyunnet/kebab/blob/master/sys/m
|
|
|
135860
136210
|
|
|
135861
136211
|
### \_$index
|
|
135862
136212
|
|
|
135863
|
-
> `protected` `static` **\_$index**: `string` = `''`
|
|
136213
|
+
> `protected` `static` **\_$index**: `string` \| `string`[] = `''`
|
|
135864
136214
|
|
|
135865
136215
|
Defined in: [sys/mod.ts:86](https://github.com/maiyunnet/kebab/blob/master/sys/mod.ts#L86)
|
|
135866
136216
|
|
|
135867
|
-
|
|
136217
|
+
自动 key 冲突目标:MySQL 为索引名;PGSQL 为唯一字段或字段数组,PG 留空使用 _$key,不支持部分或表达式索引
|
|
135868
136218
|
|
|
135869
136219
|
***
|
|
135870
136220
|
|
|
@@ -135912,7 +136262,7 @@ Defined in: [sys/mod.ts:77](https://github.com/maiyunnet/kebab/blob/master/sys/m
|
|
|
135912
136262
|
|
|
135913
136263
|
> `protected` **\_keyGenerator**(): `string`
|
|
135914
136264
|
|
|
135915
|
-
Defined in: [sys/mod.ts:
|
|
136265
|
+
Defined in: [sys/mod.ts:2048](https://github.com/maiyunnet/kebab/blob/master/sys/mod.ts#L2048)
|
|
135916
136266
|
|
|
135917
136267
|
当 _key 不为空时,则依据继承此方法的方法自动生成填充 key
|
|
135918
136268
|
|
|
@@ -135936,7 +136286,7 @@ Defined in: [sys/mod.ts:1987](https://github.com/maiyunnet/kebab/blob/master/sys
|
|
|
135936
136286
|
|
|
135937
136287
|
> **all**(): `Promise`\<`false` \| [`Rows`](Rows.md)\<`Mod`\>\>
|
|
135938
136288
|
|
|
135939
|
-
Defined in: [sys/mod.ts:
|
|
136289
|
+
Defined in: [sys/mod.ts:1271](https://github.com/maiyunnet/kebab/blob/master/sys/mod.ts#L1271)
|
|
135940
136290
|
|
|
135941
136291
|
##### Returns
|
|
135942
136292
|
|
|
@@ -135946,7 +136296,7 @@ Defined in: [sys/mod.ts:1210](https://github.com/maiyunnet/kebab/blob/master/sys
|
|
|
135946
136296
|
|
|
135947
136297
|
> **all**(`key`): `Promise`\<`false` \| `Record`\<`string`, `Mod`\>\>
|
|
135948
136298
|
|
|
135949
|
-
Defined in: [sys/mod.ts:
|
|
136299
|
+
Defined in: [sys/mod.ts:1272](https://github.com/maiyunnet/kebab/blob/master/sys/mod.ts#L1272)
|
|
135950
136300
|
|
|
135951
136301
|
##### Parameters
|
|
135952
136302
|
|
|
@@ -135974,7 +136324,7 @@ Defined in: [sys/mod.ts:1211](https://github.com/maiyunnet/kebab/blob/master/sys
|
|
|
135974
136324
|
|
|
135975
136325
|
> **allArray**(): `Promise`\<`false` \| `Record`\<`string`, `any`\>[]\>
|
|
135976
136326
|
|
|
135977
|
-
Defined in: [sys/mod.ts:
|
|
136327
|
+
Defined in: [sys/mod.ts:1450](https://github.com/maiyunnet/kebab/blob/master/sys/mod.ts#L1450)
|
|
135978
136328
|
|
|
135979
136329
|
##### Returns
|
|
135980
136330
|
|
|
@@ -135984,7 +136334,7 @@ Defined in: [sys/mod.ts:1389](https://github.com/maiyunnet/kebab/blob/master/sys
|
|
|
135984
136334
|
|
|
135985
136335
|
> **allArray**(`key`): `Promise`\<`false` \| `Record`\<`string`, `Record`\<`string`, `any`\>\>\>
|
|
135986
136336
|
|
|
135987
|
-
Defined in: [sys/mod.ts:
|
|
136337
|
+
Defined in: [sys/mod.ts:1451](https://github.com/maiyunnet/kebab/blob/master/sys/mod.ts#L1451)
|
|
135988
136338
|
|
|
135989
136339
|
##### Parameters
|
|
135990
136340
|
|
|
@@ -136002,7 +136352,7 @@ Defined in: [sys/mod.ts:1390](https://github.com/maiyunnet/kebab/blob/master/sys
|
|
|
136002
136352
|
|
|
136003
136353
|
> **allCursor**\<`T`\>(`count`, `opt`): `Promise`\<`false` \| [`ICursorPage`](../interfaces/ICursorPage.md)\<`T`\>\>
|
|
136004
136354
|
|
|
136005
|
-
Defined in: [sys/mod.ts:
|
|
136355
|
+
Defined in: [sys/mod.ts:1699](https://github.com/maiyunnet/kebab/blob/master/sys/mod.ts#L1699)
|
|
136006
136356
|
|
|
136007
136357
|
读取一批游标数据,多取一条判断后续记录,不使用 OFFSET,不修改原查询
|
|
136008
136358
|
排序字段必须全部非空、同向,且组合唯一;SELECT 中须包含对应字段(同名或指定 keys)
|
|
@@ -136067,7 +136417,7 @@ SELECT 结果中对应的字段名,默认去掉 by 的表别名
|
|
|
136067
136417
|
|
|
136068
136418
|
> **append**(`sql`): `this`
|
|
136069
136419
|
|
|
136070
|
-
Defined in: [sys/mod.ts:
|
|
136420
|
+
Defined in: [sys/mod.ts:1957](https://github.com/maiyunnet/kebab/blob/master/sys/mod.ts#L1957)
|
|
136071
136421
|
|
|
136072
136422
|
在 sql 最后追加字符串
|
|
136073
136423
|
|
|
@@ -136087,7 +136437,7 @@ Defined in: [sys/mod.ts:1896](https://github.com/maiyunnet/kebab/blob/master/sys
|
|
|
136087
136437
|
|
|
136088
136438
|
> **by**(`c`, `d?`): `this`
|
|
136089
136439
|
|
|
136090
|
-
Defined in: [sys/mod.ts:
|
|
136440
|
+
Defined in: [sys/mod.ts:1913](https://github.com/maiyunnet/kebab/blob/master/sys/mod.ts#L1913)
|
|
136091
136441
|
|
|
136092
136442
|
ORDER BY
|
|
136093
136443
|
|
|
@@ -136115,7 +136465,7 @@ ORDER BY
|
|
|
136115
136465
|
|
|
136116
136466
|
> **contain**(`contain`): `this`
|
|
136117
136467
|
|
|
136118
|
-
Defined in: [sys/mod.ts:
|
|
136468
|
+
Defined in: [sys/mod.ts:1966](https://github.com/maiyunnet/kebab/blob/master/sys/mod.ts#L1966)
|
|
136119
136469
|
|
|
136120
136470
|
设置闭包含数据
|
|
136121
136471
|
|
|
@@ -136143,7 +136493,7 @@ Defined in: [sys/mod.ts:1905](https://github.com/maiyunnet/kebab/blob/master/sys
|
|
|
136143
136493
|
|
|
136144
136494
|
> **count**(): `Promise`\<`number`\>
|
|
136145
136495
|
|
|
136146
|
-
Defined in: [sys/mod.ts:
|
|
136496
|
+
Defined in: [sys/mod.ts:1749](https://github.com/maiyunnet/kebab/blob/master/sys/mod.ts#L1749)
|
|
136147
136497
|
|
|
136148
136498
|
根据当前条件,筛选出当前条目该有的数据条数
|
|
136149
136499
|
|
|
@@ -136157,7 +136507,7 @@ Defined in: [sys/mod.ts:1688](https://github.com/maiyunnet/kebab/blob/master/sys
|
|
|
136157
136507
|
|
|
136158
136508
|
> **countSql**(): `string`
|
|
136159
136509
|
|
|
136160
|
-
Defined in: [sys/mod.ts:
|
|
136510
|
+
Defined in: [sys/mod.ts:1770](https://github.com/maiyunnet/kebab/blob/master/sys/mod.ts#L1770)
|
|
136161
136511
|
|
|
136162
136512
|
获取当前条件下的 count 的 SQL 语句
|
|
136163
136513
|
|
|
@@ -136171,15 +136521,15 @@ Defined in: [sys/mod.ts:1709](https://github.com/maiyunnet/kebab/blob/master/sys
|
|
|
136171
136521
|
|
|
136172
136522
|
> **create**(): `Promise`\<`boolean` \| `null`\>
|
|
136173
136523
|
|
|
136174
|
-
Defined in: [sys/mod.ts:
|
|
136524
|
+
Defined in: [sys/mod.ts:901](https://github.com/maiyunnet/kebab/blob/master/sys/mod.ts#L901)
|
|
136175
136525
|
|
|
136176
|
-
|
|
136526
|
+
创建数据,自动 key 最多尝试 3 次;PGSQL 仅忽略指定字段的唯一冲突
|
|
136177
136527
|
|
|
136178
136528
|
#### Returns
|
|
136179
136529
|
|
|
136180
136530
|
`Promise`\<`boolean` \| `null`\>
|
|
136181
136531
|
|
|
136182
|
-
true-成功,false
|
|
136532
|
+
true-成功,false-错误或重试耗尽,null-其他唯一冲突;PGSQL 的 SQL 错误需要回滚事务
|
|
136183
136533
|
|
|
136184
136534
|
***
|
|
136185
136535
|
|
|
@@ -136187,7 +136537,7 @@ true-成功,false-报错,null-唯一键非 _$key 键冲突
|
|
|
136187
136537
|
|
|
136188
136538
|
> **crossJoin**(`f`, `s`, `index?`, `pre?`): `this`
|
|
136189
136539
|
|
|
136190
|
-
Defined in: [sys/mod.ts:
|
|
136540
|
+
Defined in: [sys/mod.ts:1845](https://github.com/maiyunnet/kebab/blob/master/sys/mod.ts#L1845)
|
|
136191
136541
|
|
|
136192
136542
|
cross join 方法
|
|
136193
136543
|
|
|
@@ -136237,7 +136587,7 @@ ON 信息
|
|
|
136237
136587
|
|
|
136238
136588
|
> **explain**(`all?`): `Promise`\<`string` \| `false`\>
|
|
136239
136589
|
|
|
136240
|
-
Defined in: [sys/mod.ts:
|
|
136590
|
+
Defined in: [sys/mod.ts:1576](https://github.com/maiyunnet/kebab/blob/master/sys/mod.ts#L1576)
|
|
136241
136591
|
|
|
136242
136592
|
##### Parameters
|
|
136243
136593
|
|
|
@@ -136253,7 +136603,7 @@ Defined in: [sys/mod.ts:1515](https://github.com/maiyunnet/kebab/blob/master/sys
|
|
|
136253
136603
|
|
|
136254
136604
|
> **explain**(`all`): `Promise`\<`false` \| `Record`\<`string`, `any`\>\>
|
|
136255
136605
|
|
|
136256
|
-
Defined in: [sys/mod.ts:
|
|
136606
|
+
Defined in: [sys/mod.ts:1577](https://github.com/maiyunnet/kebab/blob/master/sys/mod.ts#L1577)
|
|
136257
136607
|
|
|
136258
136608
|
##### Parameters
|
|
136259
136609
|
|
|
@@ -136271,7 +136621,7 @@ Defined in: [sys/mod.ts:1516](https://github.com/maiyunnet/kebab/blob/master/sys
|
|
|
136271
136621
|
|
|
136272
136622
|
> **filter**(`s`): `this`
|
|
136273
136623
|
|
|
136274
|
-
Defined in: [sys/mod.ts:
|
|
136624
|
+
Defined in: [sys/mod.ts:1891](https://github.com/maiyunnet/kebab/blob/master/sys/mod.ts#L1891)
|
|
136275
136625
|
|
|
136276
136626
|
筛选器
|
|
136277
136627
|
|
|
@@ -136309,7 +136659,7 @@ Defined in: [sys/mod.ts:1830](https://github.com/maiyunnet/kebab/blob/master/sys
|
|
|
136309
136659
|
|
|
136310
136660
|
> **first**(`lock`, `array`): `Promise`\<`false` \| `Record`\<`string`, `any`\> \| `null`\>
|
|
136311
136661
|
|
|
136312
|
-
Defined in: [sys/mod.ts:
|
|
136662
|
+
Defined in: [sys/mod.ts:1160](https://github.com/maiyunnet/kebab/blob/master/sys/mod.ts#L1160)
|
|
136313
136663
|
|
|
136314
136664
|
##### Parameters
|
|
136315
136665
|
|
|
@@ -136329,7 +136679,7 @@ Defined in: [sys/mod.ts:1099](https://github.com/maiyunnet/kebab/blob/master/sys
|
|
|
136329
136679
|
|
|
136330
136680
|
> **first**(`lock?`, `array?`): `Promise`\<`false` \| `Mod` & `Record`\<`string`, `any`\> \| `null`\>
|
|
136331
136681
|
|
|
136332
|
-
Defined in: [sys/mod.ts:
|
|
136682
|
+
Defined in: [sys/mod.ts:1164](https://github.com/maiyunnet/kebab/blob/master/sys/mod.ts#L1164)
|
|
136333
136683
|
|
|
136334
136684
|
##### Parameters
|
|
136335
136685
|
|
|
@@ -136351,7 +136701,7 @@ Defined in: [sys/mod.ts:1103](https://github.com/maiyunnet/kebab/blob/master/sys
|
|
|
136351
136701
|
|
|
136352
136702
|
> **firstArray**(`lock?`): `Promise`\<`false` \| `Record`\<`string`, `any`\> \| `null`\>
|
|
136353
136703
|
|
|
136354
|
-
Defined in: [sys/mod.ts:
|
|
136704
|
+
Defined in: [sys/mod.ts:1204](https://github.com/maiyunnet/kebab/blob/master/sys/mod.ts#L1204)
|
|
136355
136705
|
|
|
136356
136706
|
获取数据库第一个原生对象
|
|
136357
136707
|
|
|
@@ -136373,7 +136723,7 @@ Defined in: [sys/mod.ts:1143](https://github.com/maiyunnet/kebab/blob/master/sys
|
|
|
136373
136723
|
|
|
136374
136724
|
> **format**(`sql?`, `data?`): `string`
|
|
136375
136725
|
|
|
136376
|
-
Defined in: [sys/mod.ts:
|
|
136726
|
+
Defined in: [sys/mod.ts:1993](https://github.com/maiyunnet/kebab/blob/master/sys/mod.ts#L1993)
|
|
136377
136727
|
|
|
136378
136728
|
获取带 data 的 sql 语句
|
|
136379
136729
|
|
|
@@ -136401,7 +136751,7 @@ sql 语句
|
|
|
136401
136751
|
|
|
136402
136752
|
> **fullJoin**(`f`, `s`, `index?`, `pre?`): `this`
|
|
136403
136753
|
|
|
136404
|
-
Defined in: [sys/mod.ts:
|
|
136754
|
+
Defined in: [sys/mod.ts:1833](https://github.com/maiyunnet/kebab/blob/master/sys/mod.ts#L1833)
|
|
136405
136755
|
|
|
136406
136756
|
full join 方法
|
|
136407
136757
|
|
|
@@ -136463,7 +136813,7 @@ Defined in: [sys/mod.ts:881](https://github.com/maiyunnet/kebab/blob/master/sys/
|
|
|
136463
136813
|
|
|
136464
136814
|
> **getData**(): `any`[]
|
|
136465
136815
|
|
|
136466
|
-
Defined in: [sys/mod.ts:
|
|
136816
|
+
Defined in: [sys/mod.ts:1984](https://github.com/maiyunnet/kebab/blob/master/sys/mod.ts#L1984)
|
|
136467
136817
|
|
|
136468
136818
|
获取全部 data
|
|
136469
136819
|
|
|
@@ -136477,7 +136827,7 @@ Defined in: [sys/mod.ts:1923](https://github.com/maiyunnet/kebab/blob/master/sys
|
|
|
136477
136827
|
|
|
136478
136828
|
> **getSql**(): `string`
|
|
136479
136829
|
|
|
136480
|
-
Defined in: [sys/mod.ts:
|
|
136830
|
+
Defined in: [sys/mod.ts:1977](https://github.com/maiyunnet/kebab/blob/master/sys/mod.ts#L1977)
|
|
136481
136831
|
|
|
136482
136832
|
获取 sql 语句
|
|
136483
136833
|
|
|
@@ -136491,7 +136841,7 @@ Defined in: [sys/mod.ts:1916](https://github.com/maiyunnet/kebab/blob/master/sys
|
|
|
136491
136841
|
|
|
136492
136842
|
> **group**(`c`): `this`
|
|
136493
136843
|
|
|
136494
|
-
Defined in: [sys/mod.ts:
|
|
136844
|
+
Defined in: [sys/mod.ts:1922](https://github.com/maiyunnet/kebab/blob/master/sys/mod.ts#L1922)
|
|
136495
136845
|
|
|
136496
136846
|
GROUP BY
|
|
136497
136847
|
|
|
@@ -136513,7 +136863,7 @@ GROUP BY
|
|
|
136513
136863
|
|
|
136514
136864
|
> **having**(`s`): `this`
|
|
136515
136865
|
|
|
136516
|
-
Defined in: [sys/mod.ts:
|
|
136866
|
+
Defined in: [sys/mod.ts:1882](https://github.com/maiyunnet/kebab/blob/master/sys/mod.ts#L1882)
|
|
136517
136867
|
|
|
136518
136868
|
筛选器
|
|
136519
136869
|
|
|
@@ -136535,7 +136885,7 @@ Defined in: [sys/mod.ts:1821](https://github.com/maiyunnet/kebab/blob/master/sys
|
|
|
136535
136885
|
|
|
136536
136886
|
> **hint**(`h`): `this`
|
|
136537
136887
|
|
|
136538
|
-
Defined in: [sys/mod.ts:
|
|
136888
|
+
Defined in: [sys/mod.ts:1873](https://github.com/maiyunnet/kebab/blob/master/sys/mod.ts#L1873)
|
|
136539
136889
|
|
|
136540
136890
|
设置 MySQL 优化器 Hint
|
|
136541
136891
|
内容会以 Optimizer Hint 注释语法注入到 SELECT 关键字后
|
|
@@ -136580,7 +136930,7 @@ Hint 内容
|
|
|
136580
136930
|
|
|
136581
136931
|
> **innerJoin**(`f`, `s`, `index?`, `pre?`): `this`
|
|
136582
136932
|
|
|
136583
|
-
Defined in: [sys/mod.ts:
|
|
136933
|
+
Defined in: [sys/mod.ts:1821](https://github.com/maiyunnet/kebab/blob/master/sys/mod.ts#L1821)
|
|
136584
136934
|
|
|
136585
136935
|
inner join 方法
|
|
136586
136936
|
|
|
@@ -136620,7 +136970,7 @@ ON 信息
|
|
|
136620
136970
|
|
|
136621
136971
|
> **join**(`f`, `s?`, `type?`, `index?`, `pre?`): `this`
|
|
136622
136972
|
|
|
136623
|
-
Defined in: [sys/mod.ts:
|
|
136973
|
+
Defined in: [sys/mod.ts:1785](https://github.com/maiyunnet/kebab/blob/master/sys/mod.ts#L1785)
|
|
136624
136974
|
|
|
136625
136975
|
#### Parameters
|
|
136626
136976
|
|
|
@@ -136664,7 +137014,7 @@ ON 信息
|
|
|
136664
137014
|
|
|
136665
137015
|
> **langText**(`col`, `lang`): `string`
|
|
136666
137016
|
|
|
136667
|
-
Defined in: [sys/mod.ts:
|
|
137017
|
+
Defined in: [sys/mod.ts:2028](https://github.com/maiyunnet/kebab/blob/master/sys/mod.ts#L2028)
|
|
136668
137018
|
|
|
136669
137019
|
获取字段的可用语种文本
|
|
136670
137020
|
|
|
@@ -136692,7 +137042,7 @@ Defined in: [sys/mod.ts:1967](https://github.com/maiyunnet/kebab/blob/master/sys
|
|
|
136692
137042
|
|
|
136693
137043
|
> **leftJoin**(`f`, `s`, `index?`, `pre?`): `this`
|
|
136694
137044
|
|
|
136695
|
-
Defined in: [sys/mod.ts:
|
|
137045
|
+
Defined in: [sys/mod.ts:1797](https://github.com/maiyunnet/kebab/blob/master/sys/mod.ts#L1797)
|
|
136696
137046
|
|
|
136697
137047
|
left join 方法
|
|
136698
137048
|
|
|
@@ -136732,7 +137082,7 @@ ON 信息
|
|
|
136732
137082
|
|
|
136733
137083
|
> **limit**(`a`, `b?`): `this`
|
|
136734
137084
|
|
|
136735
|
-
Defined in: [sys/mod.ts:
|
|
137085
|
+
Defined in: [sys/mod.ts:1935](https://github.com/maiyunnet/kebab/blob/master/sys/mod.ts#L1935)
|
|
136736
137086
|
|
|
136737
137087
|
LIMIT
|
|
136738
137088
|
|
|
@@ -136760,7 +137110,7 @@ LIMIT
|
|
|
136760
137110
|
|
|
136761
137111
|
> **page**(`count`, `page?`): `this`
|
|
136762
137112
|
|
|
136763
|
-
Defined in: [sys/mod.ts:
|
|
137113
|
+
Defined in: [sys/mod.ts:1946](https://github.com/maiyunnet/kebab/blob/master/sys/mod.ts#L1946)
|
|
136764
137114
|
|
|
136765
137115
|
分页
|
|
136766
137116
|
|
|
@@ -136788,7 +137138,7 @@ Defined in: [sys/mod.ts:1885](https://github.com/maiyunnet/kebab/blob/master/sys
|
|
|
136788
137138
|
|
|
136789
137139
|
> **refresh**(`lock?`): `Promise`\<`boolean` \| `null`\>
|
|
136790
137140
|
|
|
136791
|
-
Defined in: [sys/mod.ts:
|
|
137141
|
+
Defined in: [sys/mod.ts:1069](https://github.com/maiyunnet/kebab/blob/master/sys/mod.ts#L1069)
|
|
136792
137142
|
|
|
136793
137143
|
刷新当前模型获取最新数据
|
|
136794
137144
|
|
|
@@ -136810,7 +137160,7 @@ Defined in: [sys/mod.ts:1011](https://github.com/maiyunnet/kebab/blob/master/sys
|
|
|
136810
137160
|
|
|
136811
137161
|
> **remove**(): `Promise`\<`boolean`\>
|
|
136812
137162
|
|
|
136813
|
-
Defined in: [sys/mod.ts:
|
|
137163
|
+
Defined in: [sys/mod.ts:1138](https://github.com/maiyunnet/kebab/blob/master/sys/mod.ts#L1138)
|
|
136814
137164
|
|
|
136815
137165
|
移除本条目
|
|
136816
137166
|
|
|
@@ -136824,7 +137174,7 @@ Defined in: [sys/mod.ts:1077](https://github.com/maiyunnet/kebab/blob/master/sys
|
|
|
136824
137174
|
|
|
136825
137175
|
> **rightJoin**(`f`, `s`, `index?`, `pre?`): `this`
|
|
136826
137176
|
|
|
136827
|
-
Defined in: [sys/mod.ts:
|
|
137177
|
+
Defined in: [sys/mod.ts:1809](https://github.com/maiyunnet/kebab/blob/master/sys/mod.ts#L1809)
|
|
136828
137178
|
|
|
136829
137179
|
right join 方法
|
|
136830
137180
|
|
|
@@ -136864,7 +137214,7 @@ ON 信息
|
|
|
136864
137214
|
|
|
136865
137215
|
> **save**(`where?`): `Promise`\<`boolean`\>
|
|
136866
137216
|
|
|
136867
|
-
Defined in: [sys/mod.ts:
|
|
137217
|
+
Defined in: [sys/mod.ts:1102](https://github.com/maiyunnet/kebab/blob/master/sys/mod.ts#L1102)
|
|
136868
137218
|
|
|
136869
137219
|
更新 set 的数据到数据库,有未保存数据时才保存
|
|
136870
137220
|
|
|
@@ -136874,12 +137224,14 @@ Defined in: [sys/mod.ts:1043](https://github.com/maiyunnet/kebab/blob/master/sys
|
|
|
136874
137224
|
|
|
136875
137225
|
`any`
|
|
136876
137226
|
|
|
136877
|
-
|
|
137227
|
+
非空筛选条件,省略时必须有主键
|
|
136878
137228
|
|
|
136879
137229
|
#### Returns
|
|
136880
137230
|
|
|
136881
137231
|
`Promise`\<`boolean`\>
|
|
136882
137232
|
|
|
137233
|
+
是否成功,失败保留待写数据
|
|
137234
|
+
|
|
136883
137235
|
***
|
|
136884
137236
|
|
|
136885
137237
|
### set()
|
|
@@ -136960,7 +137312,7 @@ Defined in: [sys/mod.ts:847](https://github.com/maiyunnet/kebab/blob/master/sys/
|
|
|
136960
137312
|
|
|
136961
137313
|
> **toArray**\<`TC`\>(): [`TOnlyProperties`](../type-aliases/TOnlyProperties.md)\<`InstanceType`\<`TC`\>\> & `Record`\<`string`, `any`\>
|
|
136962
137314
|
|
|
136963
|
-
Defined in: [sys/mod.ts:
|
|
137315
|
+
Defined in: [sys/mod.ts:2000](https://github.com/maiyunnet/kebab/blob/master/sys/mod.ts#L2000)
|
|
136964
137316
|
|
|
136965
137317
|
获取值对象,获取的是新创建的数组
|
|
136966
137318
|
|
|
@@ -136980,7 +137332,7 @@ Defined in: [sys/mod.ts:1939](https://github.com/maiyunnet/kebab/blob/master/sys
|
|
|
136980
137332
|
|
|
136981
137333
|
> **total**(`f?`): `Promise`\<`number`\>
|
|
136982
137334
|
|
|
136983
|
-
Defined in: [sys/mod.ts:
|
|
137335
|
+
Defined in: [sys/mod.ts:1634](https://github.com/maiyunnet/kebab/blob/master/sys/mod.ts#L1634)
|
|
136984
137336
|
|
|
136985
137337
|
获取总条数,自动抛弃 LIMIT,仅用于获取数据的情况(select)
|
|
136986
137338
|
|
|
@@ -137000,7 +137352,7 @@ Defined in: [sys/mod.ts:1573](https://github.com/maiyunnet/kebab/blob/master/sys
|
|
|
137000
137352
|
|
|
137001
137353
|
> **totalEstimate**(): `Promise`\<`number` \| `false`\>
|
|
137002
137354
|
|
|
137003
|
-
Defined in: [sys/mod.ts:
|
|
137355
|
+
Defined in: [sys/mod.ts:1660](https://github.com/maiyunnet/kebab/blob/master/sys/mod.ts#L1660)
|
|
137004
137356
|
|
|
137005
137357
|
从 PostgreSQL 执行计划估算查询总行数,移除外层排序和分页,不执行数据扫描
|
|
137006
137358
|
请在应用游标条件前调用;非 PostgreSQL、框架分表联查或查询失败返回 false,绝不回退到 COUNT
|
|
@@ -137017,7 +137369,7 @@ Defined in: [sys/mod.ts:1599](https://github.com/maiyunnet/kebab/blob/master/sys
|
|
|
137017
137369
|
|
|
137018
137370
|
> **union**(`f`, `type?`): `this`
|
|
137019
137371
|
|
|
137020
|
-
Defined in: [sys/mod.ts:
|
|
137372
|
+
Defined in: [sys/mod.ts:1215](https://github.com/maiyunnet/kebab/blob/master/sys/mod.ts#L1215)
|
|
137021
137373
|
|
|
137022
137374
|
联合查询表数据
|
|
137023
137375
|
|
|
@@ -137045,7 +137397,7 @@ Defined in: [sys/mod.ts:1154](https://github.com/maiyunnet/kebab/blob/master/sys
|
|
|
137045
137397
|
|
|
137046
137398
|
> **unionAll**(`f`): `this`
|
|
137047
137399
|
|
|
137048
|
-
Defined in: [sys/mod.ts:
|
|
137400
|
+
Defined in: [sys/mod.ts:1245](https://github.com/maiyunnet/kebab/blob/master/sys/mod.ts#L1245)
|
|
137049
137401
|
|
|
137050
137402
|
所有联合查询表数据
|
|
137051
137403
|
|
|
@@ -137067,7 +137419,7 @@ Defined in: [sys/mod.ts:1184](https://github.com/maiyunnet/kebab/blob/master/sys
|
|
|
137067
137419
|
|
|
137068
137420
|
> **unsaved**(): `boolean`
|
|
137069
137421
|
|
|
137070
|
-
Defined in: [sys/mod.ts:
|
|
137422
|
+
Defined in: [sys/mod.ts:2019](https://github.com/maiyunnet/kebab/blob/master/sys/mod.ts#L2019)
|
|
137071
137423
|
|
|
137072
137424
|
当前是否设置了未保存 --=
|
|
137073
137425
|
|
|
@@ -137081,7 +137433,7 @@ Defined in: [sys/mod.ts:1958](https://github.com/maiyunnet/kebab/blob/master/sys
|
|
|
137081
137433
|
|
|
137082
137434
|
> **updates**(): `Record`\<`string`, `any`\>
|
|
137083
137435
|
|
|
137084
|
-
Defined in: [sys/mod.ts:
|
|
137436
|
+
Defined in: [sys/mod.ts:2008](https://github.com/maiyunnet/kebab/blob/master/sys/mod.ts#L2008)
|
|
137085
137437
|
|
|
137086
137438
|
获取当前设置要提交的数据
|
|
137087
137439
|
|
|
@@ -137095,9 +137447,11 @@ Defined in: [sys/mod.ts:1947](https://github.com/maiyunnet/kebab/blob/master/sys
|
|
|
137095
137447
|
|
|
137096
137448
|
> **upsert**(`conflict`): `Promise`\<`boolean`\>
|
|
137097
137449
|
|
|
137098
|
-
Defined in: [sys/mod.ts:
|
|
137450
|
+
Defined in: [sys/mod.ts:995](https://github.com/maiyunnet/kebab/blob/master/sys/mod.ts#L995)
|
|
137099
137451
|
|
|
137100
|
-
|
|
137452
|
+
插入数据,如果业务唯一键已存在则更新,保留已有主键和自动 key
|
|
137453
|
+
PGSQL 为原子 UPSERT,自动 key 只生成一次,SQL 错误需回滚事务
|
|
137454
|
+
MySQL 分步执行;自动 key 有多个唯一索引时须配置 _$index,整笔原子性由调用方事务保证
|
|
137101
137455
|
|
|
137102
137456
|
#### Parameters
|
|
137103
137457
|
|
|
@@ -137105,19 +137459,21 @@ Defined in: [sys/mod.ts:980](https://github.com/maiyunnet/kebab/blob/master/sys/
|
|
|
137105
137459
|
|
|
137106
137460
|
`string` \| `string`[]
|
|
137107
137461
|
|
|
137108
|
-
|
|
137462
|
+
已通过 set 赋非 NULL 值的业务唯一字段,不得包含 _$key 或 _$primary;PGSQL 不支持部分或表达式索引
|
|
137109
137463
|
|
|
137110
137464
|
#### Returns
|
|
137111
137465
|
|
|
137112
137466
|
`Promise`\<`boolean`\>
|
|
137113
137467
|
|
|
137468
|
+
是否成功;至少需要一个可更新字段,失败保留待写数据
|
|
137469
|
+
|
|
137114
137470
|
***
|
|
137115
137471
|
|
|
137116
137472
|
### where()
|
|
137117
137473
|
|
|
137118
137474
|
> **where**(`s`): `this`
|
|
137119
137475
|
|
|
137120
|
-
Defined in: [sys/mod.ts:
|
|
137476
|
+
Defined in: [sys/mod.ts:1902](https://github.com/maiyunnet/kebab/blob/master/sys/mod.ts#L1902)
|
|
137121
137477
|
|
|
137122
137478
|
是 filter 的别名
|
|
137123
137479
|
|
|
@@ -138382,7 +138738,7 @@ sys/mod/interfaces/IModUnionItem.md
|
|
|
138382
138738
|
|
|
138383
138739
|
# Interface: IModUnionItem
|
|
138384
138740
|
|
|
138385
|
-
Defined in: [sys/mod.ts:
|
|
138741
|
+
Defined in: [sys/mod.ts:2062](https://github.com/maiyunnet/kebab/blob/master/sys/mod.ts#L2062)
|
|
138386
138742
|
|
|
138387
138743
|
## Properties
|
|
138388
138744
|
|
|
@@ -138390,7 +138746,7 @@ Defined in: [sys/mod.ts:2001](https://github.com/maiyunnet/kebab/blob/master/sys
|
|
|
138390
138746
|
|
|
138391
138747
|
> **field**: `string`
|
|
138392
138748
|
|
|
138393
|
-
Defined in: [sys/mod.ts:
|
|
138749
|
+
Defined in: [sys/mod.ts:2063](https://github.com/maiyunnet/kebab/blob/master/sys/mod.ts#L2063)
|
|
138394
138750
|
|
|
138395
138751
|
***
|
|
138396
138752
|
|
|
@@ -138398,7 +138754,7 @@ Defined in: [sys/mod.ts:2002](https://github.com/maiyunnet/kebab/blob/master/sys
|
|
|
138398
138754
|
|
|
138399
138755
|
> `optional` **where?**: `any`
|
|
138400
138756
|
|
|
138401
|
-
Defined in: [sys/mod.ts:
|
|
138757
|
+
Defined in: [sys/mod.ts:2064](https://github.com/maiyunnet/kebab/blob/master/sys/mod.ts#L2064)
|
|
138402
138758
|
|
|
138403
138759
|
sys/mod/interfaces/IRows.md
|
|
138404
138760
|
---
|
|
@@ -138411,7 +138767,7 @@ sys/mod/interfaces/IRows.md
|
|
|
138411
138767
|
|
|
138412
138768
|
# Interface: IRows\<T\>
|
|
138413
138769
|
|
|
138414
|
-
Defined in: [sys/mod.ts:
|
|
138770
|
+
Defined in: [sys/mod.ts:2056](https://github.com/maiyunnet/kebab/blob/master/sys/mod.ts#L2056)
|
|
138415
138771
|
|
|
138416
138772
|
## Extends
|
|
138417
138773
|
|
|
@@ -138429,7 +138785,7 @@ Defined in: [sys/mod.ts:1995](https://github.com/maiyunnet/kebab/blob/master/sys
|
|
|
138429
138785
|
|
|
138430
138786
|
> `readonly` **length**: `number`
|
|
138431
138787
|
|
|
138432
|
-
Defined in: [sys/mod.ts:
|
|
138788
|
+
Defined in: [sys/mod.ts:2057](https://github.com/maiyunnet/kebab/blob/master/sys/mod.ts#L2057)
|
|
138433
138789
|
|
|
138434
138790
|
## Methods
|
|
138435
138791
|
|
|
@@ -138437,7 +138793,7 @@ Defined in: [sys/mod.ts:1996](https://github.com/maiyunnet/kebab/blob/master/sys
|
|
|
138437
138793
|
|
|
138438
138794
|
> **item**(`index`): `T`
|
|
138439
138795
|
|
|
138440
|
-
Defined in: [sys/mod.ts:
|
|
138796
|
+
Defined in: [sys/mod.ts:2058](https://github.com/maiyunnet/kebab/blob/master/sys/mod.ts#L2058)
|
|
138441
138797
|
|
|
138442
138798
|
#### Parameters
|
|
138443
138799
|
|
|
@@ -138455,7 +138811,7 @@ Defined in: [sys/mod.ts:1997](https://github.com/maiyunnet/kebab/blob/master/sys
|
|
|
138455
138811
|
|
|
138456
138812
|
> **toArray**(): `Record`\<`string`, `any`\>[]
|
|
138457
138813
|
|
|
138458
|
-
Defined in: [sys/mod.ts:
|
|
138814
|
+
Defined in: [sys/mod.ts:2059](https://github.com/maiyunnet/kebab/blob/master/sys/mod.ts#L2059)
|
|
138459
138815
|
|
|
138460
138816
|
#### Returns
|
|
138461
138817
|
|
|
@@ -138497,7 +138853,7 @@ sys/route/functions/clearKebabConfigs.md
|
|
|
138497
138853
|
|
|
138498
138854
|
> **clearKebabConfigs**(): `void`
|
|
138499
138855
|
|
|
138500
|
-
Defined in: [sys/route.ts:
|
|
138856
|
+
Defined in: [sys/route.ts:47](https://github.com/maiyunnet/kebab/blob/master/sys/route.ts#L47)
|
|
138501
138857
|
|
|
138502
138858
|
清空缓存的项目配置,下次请求时重新读取文件
|
|
138503
138859
|
|
|
@@ -138518,7 +138874,7 @@ sys/route/functions/getFormData.md
|
|
|
138518
138874
|
|
|
138519
138875
|
> **getFormData**(`req`, `events?`, `limits?`): `Promise`\<`false` \| \{ `files`: `Record`\<`string`, [`IPostFile`](../../../index/interfaces/IPostFile.md) \| [`IPostFile`](../../../index/interfaces/IPostFile.md)[]\>; `post`: `Record`\<`string`, [`Json`](../../../index/type-aliases/Json.md)\>; \}\>
|
|
138520
138876
|
|
|
138521
|
-
Defined in: [sys/route.ts:
|
|
138877
|
+
Defined in: [sys/route.ts:1102](https://github.com/maiyunnet/kebab/blob/master/sys/route.ts#L1102)
|
|
138522
138878
|
|
|
138523
138879
|
获取 formdata 的 post
|
|
138524
138880
|
|
|
@@ -138561,7 +138917,7 @@ sys/route/functions/getPost.md
|
|
|
138561
138917
|
|
|
138562
138918
|
> **getPost**(`req`): `Promise`\<`false` \| \{ `input`: `string`; `post`: `Record`\<`string`, `any`\>; `raw`: `Record`\<`string`, `any`\>; \}\>
|
|
138563
138919
|
|
|
138564
|
-
Defined in: [sys/route.ts:
|
|
138920
|
+
Defined in: [sys/route.ts:937](https://github.com/maiyunnet/kebab/blob/master/sys/route.ts#L937)
|
|
138565
138921
|
|
|
138566
138922
|
获取 post 对象(通常已自动获取),如果是文件上传(formdata)的情况则不获取
|
|
138567
138923
|
|
|
@@ -138592,7 +138948,7 @@ sys/route/functions/run.md
|
|
|
138592
138948
|
|
|
138593
138949
|
> **run**(`data`): `Promise`\<`boolean`\>
|
|
138594
138950
|
|
|
138595
|
-
Defined in: [sys/route.ts:
|
|
138951
|
+
Defined in: [sys/route.ts:116](https://github.com/maiyunnet/kebab/blob/master/sys/route.ts#L116)
|
|
138596
138952
|
|
|
138597
138953
|
若为动态路径则执行此函数,此函数不进行判断 kebab.json 是否存在
|
|
138598
138954
|
|
|
@@ -138679,7 +139035,7 @@ sys/route/functions/unlinkUploadFiles.md
|
|
|
138679
139035
|
|
|
138680
139036
|
> **unlinkUploadFiles**(`cctr`): `Promise`\<`void`\>
|
|
138681
139037
|
|
|
138682
|
-
Defined in: [sys/route.ts:
|
|
139038
|
+
Defined in: [sys/route.ts:895](https://github.com/maiyunnet/kebab/blob/master/sys/route.ts#L895)
|
|
138683
139039
|
|
|
138684
139040
|
删除本次请求所有已上传的临时文件
|
|
138685
139041
|
|
|
@@ -138708,7 +139064,7 @@ sys/route/functions/waitCtr.md
|
|
|
138708
139064
|
|
|
138709
139065
|
> **waitCtr**(`cctr`): `Promise`\<`void`\>
|
|
138710
139066
|
|
|
138711
|
-
Defined in: [sys/route.ts:
|
|
139067
|
+
Defined in: [sys/route.ts:915](https://github.com/maiyunnet/kebab/blob/master/sys/route.ts#L915)
|
|
138712
139068
|
|
|
138713
139069
|
等待异步任务结束,并删除临时文件,如果结束后还有事务没关闭,则会在本函数中打印控制台并且写入 log 文件
|
|
138714
139070
|
此时其实已经给客户端返回了,此处等待不消耗客户端的等待时间
|
|
@@ -138762,7 +139118,7 @@ sys/route/interfaces/IFormDataError.md
|
|
|
138762
139118
|
|
|
138763
139119
|
# Interface: IFormDataError
|
|
138764
139120
|
|
|
138765
|
-
Defined in: [sys/route.ts:
|
|
139121
|
+
Defined in: [sys/route.ts:1057](https://github.com/maiyunnet/kebab/blob/master/sys/route.ts#L1057)
|
|
138766
139122
|
|
|
138767
139123
|
解析上传数据时的失败原因,只提供错误码和限制值,不带临时路径或异常对象
|
|
138768
139124
|
|
|
@@ -138772,7 +139128,7 @@ Defined in: [sys/route.ts:1056](https://github.com/maiyunnet/kebab/blob/master/s
|
|
|
138772
139128
|
|
|
138773
139129
|
> **code**: `"INVALID_BOUNDARY"` \| `"FILE_TOO_LARGE"` \| `"TOTAL_TOO_LARGE"` \| `"FIELD_TOO_LARGE"` \| `"HEADER_TOO_LARGE"` \| `"TOO_MANY_PARTS"` \| `"FILE_TYPE"` \| `"TIMEOUT"` \| `"TEMP_FILE_ERROR"` \| `"REQUEST_ERROR"` \| `"REQUEST_ABORTED"`
|
|
138774
139130
|
|
|
138775
|
-
Defined in: [sys/route.ts:
|
|
139131
|
+
Defined in: [sys/route.ts:1058](https://github.com/maiyunnet/kebab/blob/master/sys/route.ts#L1058)
|
|
138776
139132
|
|
|
138777
139133
|
***
|
|
138778
139134
|
|
|
@@ -138780,7 +139136,7 @@ Defined in: [sys/route.ts:1057](https://github.com/maiyunnet/kebab/blob/master/s
|
|
|
138780
139136
|
|
|
138781
139137
|
> `optional` **limit?**: `number`
|
|
138782
139138
|
|
|
138783
|
-
Defined in: [sys/route.ts:
|
|
139139
|
+
Defined in: [sys/route.ts:1062](https://github.com/maiyunnet/kebab/blob/master/sys/route.ts#L1062)
|
|
138784
139140
|
|
|
138785
139141
|
超出的限制值:大小用字节,超时用毫秒,字段和文件数量用个
|
|
138786
139142
|
|
|
@@ -138795,7 +139151,7 @@ sys/route/interfaces/IFormDataEvents.md
|
|
|
138795
139151
|
|
|
138796
139152
|
# Interface: IFormDataEvents
|
|
138797
139153
|
|
|
138798
|
-
Defined in: [sys/route.ts:
|
|
139154
|
+
Defined in: [sys/route.ts:1066](https://github.com/maiyunnet/kebab/blob/master/sys/route.ts#L1066)
|
|
138799
139155
|
|
|
138800
139156
|
multipart 文件处理及失败通知
|
|
138801
139157
|
|
|
@@ -138805,7 +139161,7 @@ multipart 文件处理及失败通知
|
|
|
138805
139161
|
|
|
138806
139162
|
> `optional` **onerror?**: (`error`) => `void`
|
|
138807
139163
|
|
|
138808
|
-
Defined in: [sys/route.ts:
|
|
139164
|
+
Defined in: [sys/route.ts:1074](https://github.com/maiyunnet/kebab/blob/master/sys/route.ts#L1074)
|
|
138809
139165
|
|
|
138810
139166
|
首次失败时调用一次,getFormData 返回 false;若连接已断开,可能无法回复客户端
|
|
138811
139167
|
|
|
@@ -138825,7 +139181,7 @@ Defined in: [sys/route.ts:1073](https://github.com/maiyunnet/kebab/blob/master/s
|
|
|
138825
139181
|
|
|
138826
139182
|
> `optional` **onfiledata?**: (`chunk`) => `void`
|
|
138827
139183
|
|
|
138828
|
-
Defined in: [sys/route.ts:
|
|
139184
|
+
Defined in: [sys/route.ts:1070](https://github.com/maiyunnet/kebab/blob/master/sys/route.ts#L1070)
|
|
138829
139185
|
|
|
138830
139186
|
文件上传时触发,仅 start 返回 true 时触发
|
|
138831
139187
|
|
|
@@ -138845,7 +139201,7 @@ Defined in: [sys/route.ts:1069](https://github.com/maiyunnet/kebab/blob/master/s
|
|
|
138845
139201
|
|
|
138846
139202
|
> `optional` **onfileend?**: () => `void`
|
|
138847
139203
|
|
|
138848
|
-
Defined in: [sys/route.ts:
|
|
139204
|
+
Defined in: [sys/route.ts:1072](https://github.com/maiyunnet/kebab/blob/master/sys/route.ts#L1072)
|
|
138849
139205
|
|
|
138850
139206
|
文件上传结束时触发,仅 start 返回 true 时触发
|
|
138851
139207
|
|
|
@@ -138859,7 +139215,7 @@ Defined in: [sys/route.ts:1071](https://github.com/maiyunnet/kebab/blob/master/s
|
|
|
138859
139215
|
|
|
138860
139216
|
> `optional` **onfilestart?**: (`name`) => `boolean` \| `undefined`
|
|
138861
139217
|
|
|
138862
|
-
Defined in: [sys/route.ts:
|
|
139218
|
+
Defined in: [sys/route.ts:1068](https://github.com/maiyunnet/kebab/blob/master/sys/route.ts#L1068)
|
|
138863
139219
|
|
|
138864
139220
|
文件开始上传时触发,返回 true 则跳过该文件的保存
|
|
138865
139221
|
|
|
@@ -138884,7 +139240,7 @@ sys/route/interfaces/IFormDataLimits.md
|
|
|
138884
139240
|
|
|
138885
139241
|
# Interface: IFormDataLimits
|
|
138886
139242
|
|
|
138887
|
-
Defined in: [sys/route.ts:
|
|
139243
|
+
Defined in: [sys/route.ts:1078](https://github.com/maiyunnet/kebab/blob/master/sys/route.ts#L1078)
|
|
138888
139244
|
|
|
138889
139245
|
multipart 上传限制
|
|
138890
139246
|
|
|
@@ -138894,7 +139250,7 @@ multipart 上传限制
|
|
|
138894
139250
|
|
|
138895
139251
|
> `optional` **allowedExts?**: `string`[]
|
|
138896
139252
|
|
|
138897
|
-
Defined in: [sys/route.ts:
|
|
139253
|
+
Defined in: [sys/route.ts:1082](https://github.com/maiyunnet/kebab/blob/master/sys/route.ts#L1082)
|
|
138898
139254
|
|
|
138899
139255
|
允许的文件扩展名(含点号),如 ['.jpg', '.png', '.pdf']
|
|
138900
139256
|
|
|
@@ -138904,7 +139260,7 @@ Defined in: [sys/route.ts:1081](https://github.com/maiyunnet/kebab/blob/master/s
|
|
|
138904
139260
|
|
|
138905
139261
|
> `optional` **maxFieldSize?**: `number`
|
|
138906
139262
|
|
|
138907
|
-
Defined in: [sys/route.ts:
|
|
139263
|
+
Defined in: [sys/route.ts:1084](https://github.com/maiyunnet/kebab/blob/master/sys/route.ts#L1084)
|
|
138908
139264
|
|
|
138909
139265
|
单个字段(非文件)最大字节数,默认 1 MB
|
|
138910
139266
|
|
|
@@ -138914,7 +139270,7 @@ Defined in: [sys/route.ts:1083](https://github.com/maiyunnet/kebab/blob/master/s
|
|
|
138914
139270
|
|
|
138915
139271
|
> `optional` **maxFileSize?**: `number`
|
|
138916
139272
|
|
|
138917
|
-
Defined in: [sys/route.ts:
|
|
139273
|
+
Defined in: [sys/route.ts:1080](https://github.com/maiyunnet/kebab/blob/master/sys/route.ts#L1080)
|
|
138918
139274
|
|
|
138919
139275
|
单个文件最大字节数
|
|
138920
139276
|
|
|
@@ -138924,7 +139280,7 @@ Defined in: [sys/route.ts:1079](https://github.com/maiyunnet/kebab/blob/master/s
|
|
|
138924
139280
|
|
|
138925
139281
|
> `optional` **maxHeaderSize?**: `number`
|
|
138926
139282
|
|
|
138927
|
-
Defined in: [sys/route.ts:
|
|
139283
|
+
Defined in: [sys/route.ts:1088](https://github.com/maiyunnet/kebab/blob/master/sys/route.ts#L1088)
|
|
138928
139284
|
|
|
138929
139285
|
每个字段或文件的 multipart 头部最多多少字节,默认 16 KB
|
|
138930
139286
|
|
|
@@ -138934,7 +139290,7 @@ Defined in: [sys/route.ts:1087](https://github.com/maiyunnet/kebab/blob/master/s
|
|
|
138934
139290
|
|
|
138935
139291
|
> `optional` **maxParts?**: `number`
|
|
138936
139292
|
|
|
138937
|
-
Defined in: [sys/route.ts:
|
|
139293
|
+
Defined in: [sys/route.ts:1090](https://github.com/maiyunnet/kebab/blob/master/sys/route.ts#L1090)
|
|
138938
139294
|
|
|
138939
139295
|
multipart 字段与文件总数量,默认 1000
|
|
138940
139296
|
|
|
@@ -138944,7 +139300,7 @@ multipart 字段与文件总数量,默认 1000
|
|
|
138944
139300
|
|
|
138945
139301
|
> `optional` **maxTotalSize?**: `number`
|
|
138946
139302
|
|
|
138947
|
-
Defined in: [sys/route.ts:
|
|
139303
|
+
Defined in: [sys/route.ts:1086](https://github.com/maiyunnet/kebab/blob/master/sys/route.ts#L1086)
|
|
138948
139304
|
|
|
138949
139305
|
整体请求最大字节数,不设置或设为 0 则不限制
|
|
138950
139306
|
|
|
@@ -138954,6 +139310,6 @@ Defined in: [sys/route.ts:1085](https://github.com/maiyunnet/kebab/blob/master/s
|
|
|
138954
139310
|
|
|
138955
139311
|
> `optional` **timeout?**: `number`
|
|
138956
139312
|
|
|
138957
|
-
Defined in: [sys/route.ts:
|
|
139313
|
+
Defined in: [sys/route.ts:1092](https://github.com/maiyunnet/kebab/blob/master/sys/route.ts#L1092)
|
|
138958
139314
|
|
|
138959
139315
|
整体请求超时时间(毫秒),默认 5 分钟,设为 0 禁用超时
|