@maiyunnet/kebab 9.26.5 → 9.27.1
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 +731 -341
- 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/sql.d.ts +2 -1
- package/lib/sql.js +8 -7
- 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 -3
- package/sys/mod.js +43 -19
- 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/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
|
| 值 | 请求头行为 |
|
|
@@ -178,6 +210,29 @@ public create(): kebab.Json[] {
|
|
|
178
210
|
|
|
179
211
|
`_valibotx` 默认先校验 `_xsrf`,通过后才运行 schema,且 `_xsrf` 不会被自动加入 schema 输出。仅在已有等效安全机制时才可使用 `{ 'ignoreXsrf': true }`。只读请求使用 `_valibot`。
|
|
180
212
|
|
|
213
|
+
|
|
214
|
+
## 原生分区表模型
|
|
215
|
+
|
|
216
|
+
模型通过 `_$partition` 声明数据库原生分区字段,RANGE、HASH、LIST 采用相同写法;支持多个字段。数据库仍负责根据字段值选择分区,框架不查询分区目录,也不自动创建分区。
|
|
217
|
+
|
|
218
|
+
```ts
|
|
219
|
+
export default class Order extends sMod {
|
|
220
|
+
protected static _$table = 'order';
|
|
221
|
+
protected static _$primary = 'id';
|
|
222
|
+
protected static _$partition = ['time_push'];
|
|
223
|
+
}
|
|
224
|
+
```
|
|
225
|
+
|
|
226
|
+
读取模型后,`save()`、`remove()`、`refresh()` 的默认条件自动包含主键与分区字段。例如上面的模型使用 `id = ? AND time_push = ?`。`set()` 仍用于指定待写数据,调用方不必反复填写分区条件。
|
|
227
|
+
|
|
228
|
+
- 查询时须选出主键及全部分区字段。读取记录后不要修改这些字段,包括通过 `set()` 赋值或直接修改 Date、Buffer 等对象;框架直接使用模型中的当前值构造 WHERE,不保存旧值,也不检查这些字段是否被改动。
|
|
229
|
+
- 创建记录时设置分区字段,主键使用数据库返回的自增 ID;使用数据库默认值、生成列、触发器或 SQL 表达式赋值时,须重新查询取得实际字段值后再使用默认实例操作。`upsert()` 用于更新已有记录时,同样不能改变其分区字段。
|
|
230
|
+
- 缺少主键或分区字段时,默认实例操作返回 `false`。`save()` 没有待写字段时仍直接返回 `true`。
|
|
231
|
+
- 显式 `save(where)` 完整采用调用方提供的条件,不自动附加分区或业务条件。
|
|
232
|
+
- 未声明 `_$partition` 的模型保持仅按主键定位的原行为。静态查询、批量更新、删除等方法仍使用显式条件;租户、软删除和业务状态约束由应用负责。
|
|
233
|
+
|
|
234
|
+
`_$partition` 用于数据库原生分区,与 `index` 选项按表名后缀访问分表的机制不同。事务提交、回滚及连接生命周期保持原约定。
|
|
235
|
+
|
|
181
236
|
query-pagination.md
|
|
182
237
|
---
|
|
183
238
|
|
|
@@ -375,7 +430,7 @@ if (started === false) {
|
|
|
375
430
|
|
|
376
431
|
## 监控日志
|
|
377
432
|
|
|
378
|
-
主线程与看门狗的监控简讯保存到 `log/system-monitor/YYYY/MM/DD/HH.jsonl` 或 `HH.csv`,采用框架的 `logFormat` 配置,默认 `jsonl`。JSONL 字段和 CSV
|
|
433
|
+
主线程与看门狗的监控简讯保存到 `log/system-monitor/YYYY/MM/DD/HH.jsonl` 或 `HH.csv`,采用框架的 `logFormat` 配置,默认 `jsonl`。JSONL 字段和 CSV 列顺序与 `Core.log` 一致,可通过 `Core.getLog` 读取,指定 `hostname='system'`、`fend='-monitor'` 和对应日期、小时的 `path`。看门狗在主线程阻塞时仍独立写盘;热重载后的日志格式随下一次主线程采样同步到看门狗。
|
|
379
434
|
|
|
380
435
|
日志用于查看异常简讯和诊断目录。完整的采样、诊断结果与 Profile 等取证文件保存在下述 `log/monitor/` 目录,不作为普通日志行返回。
|
|
381
436
|
|
|
@@ -1534,6 +1589,7 @@ index.md
|
|
|
1534
1589
|
- [lib/consistent](lib/consistent/index.md)
|
|
1535
1590
|
- [lib/cookie](lib/cookie/index.md)
|
|
1536
1591
|
- [lib/core](lib/core/index.md)
|
|
1592
|
+
- [lib/core/rpc](lib/core/rpc/index.md)
|
|
1537
1593
|
- [lib/cron](lib/cron/index.md)
|
|
1538
1594
|
- [lib/crypto](lib/crypto/index.md)
|
|
1539
1595
|
- [lib/db](lib/db/index.md)
|
|
@@ -1794,7 +1850,7 @@ index/variables/VER.md
|
|
|
1794
1850
|
|
|
1795
1851
|
# Variable: VER
|
|
1796
1852
|
|
|
1797
|
-
> `const` **VER**: `"9.
|
|
1853
|
+
> `const` **VER**: `"9.27.1"` = `'9.27.1'`
|
|
1798
1854
|
|
|
1799
1855
|
Defined in: [index.ts:9](https://github.com/maiyunnet/kebab/blob/master/index.ts#L9)
|
|
1800
1856
|
|
|
@@ -3708,7 +3764,7 @@ lib/core/functions/checkSchema.md
|
|
|
3708
3764
|
|
|
3709
3765
|
> **checkSchema**(`val`, `schema`): `string`
|
|
3710
3766
|
|
|
3711
|
-
Defined in: [lib/core.ts:
|
|
3767
|
+
Defined in: [lib/core.ts:308](https://github.com/maiyunnet/kebab/blob/master/lib/core.ts#L308)
|
|
3712
3768
|
|
|
3713
3769
|
判断一个对象是否符合 JSON Schema
|
|
3714
3770
|
|
|
@@ -3743,7 +3799,7 @@ lib/core/functions/checkType.md
|
|
|
3743
3799
|
|
|
3744
3800
|
> **checkType**(`val`, `type`, `tree?`): `string`
|
|
3745
3801
|
|
|
3746
|
-
Defined in: [lib/core.ts:
|
|
3802
|
+
Defined in: [lib/core.ts:220](https://github.com/maiyunnet/kebab/blob/master/lib/core.ts#L220)
|
|
3747
3803
|
|
|
3748
3804
|
判断一个对象是否符合示例组,返回空字符串代表校验通过,返回:应该的类型:位置:传入的类型
|
|
3749
3805
|
|
|
@@ -3784,7 +3840,7 @@ lib/core/functions/clone.md
|
|
|
3784
3840
|
|
|
3785
3841
|
> **clone**\<`T`\>(`obj`): `T`
|
|
3786
3842
|
|
|
3787
|
-
Defined in: [lib/core.ts:
|
|
3843
|
+
Defined in: [lib/core.ts:1493](https://github.com/maiyunnet/kebab/blob/master/lib/core.ts#L1493)
|
|
3788
3844
|
|
|
3789
3845
|
完整的克隆一份数组/对象
|
|
3790
3846
|
|
|
@@ -3819,7 +3875,7 @@ lib/core/functions/convert62.md
|
|
|
3819
3875
|
|
|
3820
3876
|
> **convert62**(`n`): `string`
|
|
3821
3877
|
|
|
3822
|
-
Defined in: [lib/core.ts:
|
|
3878
|
+
Defined in: [lib/core.ts:161](https://github.com/maiyunnet/kebab/blob/master/lib/core.ts#L161)
|
|
3823
3879
|
|
|
3824
3880
|
将 10 进制转换为 62 进制
|
|
3825
3881
|
|
|
@@ -3848,7 +3904,7 @@ lib/core/functions/debug.md
|
|
|
3848
3904
|
|
|
3849
3905
|
> **debug**(`message?`, ...`optionalParams`): `void`
|
|
3850
3906
|
|
|
3851
|
-
Defined in: [lib/core.ts:
|
|
3907
|
+
Defined in: [lib/core.ts:1539](https://github.com/maiyunnet/kebab/blob/master/lib/core.ts#L1539)
|
|
3852
3908
|
|
|
3853
3909
|
打印调试信息,线上环境不会打印
|
|
3854
3910
|
|
|
@@ -3883,7 +3939,7 @@ lib/core/functions/display.md
|
|
|
3883
3939
|
|
|
3884
3940
|
> **display**(`message?`, ...`optionalParams`): `void`
|
|
3885
3941
|
|
|
3886
|
-
Defined in: [lib/core.ts:
|
|
3942
|
+
Defined in: [lib/core.ts:1552](https://github.com/maiyunnet/kebab/blob/master/lib/core.ts#L1552)
|
|
3887
3943
|
|
|
3888
3944
|
向控制台直接显示内容,一般情况下禁止使用
|
|
3889
3945
|
|
|
@@ -3918,7 +3974,7 @@ lib/core/functions/emptyObject.md
|
|
|
3918
3974
|
|
|
3919
3975
|
> **emptyObject**(`obj`, `deep?`): `void`
|
|
3920
3976
|
|
|
3921
|
-
Defined in: [lib/core.ts:
|
|
3977
|
+
Defined in: [lib/core.ts:624](https://github.com/maiyunnet/kebab/blob/master/lib/core.ts#L624)
|
|
3922
3978
|
|
|
3923
3979
|
将对象的所有属性清除包括键,不会破坏引用关系,对象变量依然保证是引用状态
|
|
3924
3980
|
|
|
@@ -3953,7 +4009,7 @@ lib/core/functions/exec.md
|
|
|
3953
4009
|
|
|
3954
4010
|
> **exec**(`command`, `options?`): `Promise`\<`string` \| `false`\>
|
|
3955
4011
|
|
|
3956
|
-
Defined in: [lib/core.ts:
|
|
4012
|
+
Defined in: [lib/core.ts:686](https://github.com/maiyunnet/kebab/blob/master/lib/core.ts#L686)
|
|
3957
4013
|
|
|
3958
4014
|
执行命令行
|
|
3959
4015
|
|
|
@@ -3995,7 +4051,7 @@ lib/core/functions/getLog.md
|
|
|
3995
4051
|
|
|
3996
4052
|
> **getLog**(`opt`): `Promise`\<`false` \| \{ `list`: `any`[] \| `string`[][]; `total`: `number`; \}\>
|
|
3997
4053
|
|
|
3998
|
-
Defined in: [lib/core.ts:
|
|
4054
|
+
Defined in: [lib/core.ts:1273](https://github.com/maiyunnet/kebab/blob/master/lib/core.ts#L1273)
|
|
3999
4055
|
|
|
4000
4056
|
获取日志内容为一个数组
|
|
4001
4057
|
|
|
@@ -4064,7 +4120,7 @@ lib/core/functions/getMonitorEvent.md
|
|
|
4064
4120
|
|
|
4065
4121
|
> **getMonitorEvent**(`opt`): `Promise`\<`false` \| [`IMonitorEvent`](../interfaces/IMonitorEvent.md) \| `null`\>
|
|
4066
4122
|
|
|
4067
|
-
Defined in: [lib/core.ts:
|
|
4123
|
+
Defined in: [lib/core.ts:1409](https://github.com/maiyunnet/kebab/blob/master/lib/core.ts#L1409)
|
|
4068
4124
|
|
|
4069
4125
|
读取事件详情和文件清单;只解析事件记录,不解析 Profile 或堆快照
|
|
4070
4126
|
|
|
@@ -4101,7 +4157,7 @@ lib/core/functions/getMonitorEvents.md
|
|
|
4101
4157
|
|
|
4102
4158
|
> **getMonitorEvents**(`opt?`): `Promise`\<`false` \| \{ `list`: [`IMonitorEventSummary`](../interfaces/IMonitorEventSummary.md)[]; `total`: `number`; \}\>
|
|
4103
4159
|
|
|
4104
|
-
Defined in: [lib/core.ts:
|
|
4160
|
+
Defined in: [lib/core.ts:1382](https://github.com/maiyunnet/kebab/blob/master/lib/core.ts#L1382)
|
|
4105
4161
|
|
|
4106
4162
|
获取某天已保存的监控事件,按目录时间倒序分页
|
|
4107
4163
|
|
|
@@ -4148,7 +4204,7 @@ lib/core/functions/getMonitorFile.md
|
|
|
4148
4204
|
|
|
4149
4205
|
> **getMonitorFile**(`opt`): `Promise`\<`false` \| [`Response`](../../undici/response/classes/Response.md) \| `null`\>
|
|
4150
4206
|
|
|
4151
|
-
Defined in: [lib/core.ts:
|
|
4207
|
+
Defined in: [lib/core.ts:1433](https://github.com/maiyunnet/kebab/blob/master/lib/core.ts#L1433)
|
|
4152
4208
|
|
|
4153
4209
|
获取监控原始文件的响应,可使用 getStream() 下载;小文件可用 getText()/getJson() 预览
|
|
4154
4210
|
|
|
@@ -4189,7 +4245,7 @@ lib/core/functions/ipLimit.md
|
|
|
4189
4245
|
|
|
4190
4246
|
> **ipLimit**(`ip`, `mask?`): `string`
|
|
4191
4247
|
|
|
4192
|
-
Defined in: [lib/core.ts:
|
|
4248
|
+
Defined in: [lib/core.ts:452](https://github.com/maiyunnet/kebab/blob/master/lib/core.ts#L452)
|
|
4193
4249
|
|
|
4194
4250
|
截取 IP 的限速段
|
|
4195
4251
|
IPv4 原样返回;IPv6 截取前 mask 位(默认 /64),防止同一人使用大量 IPv6 地址绕过限速
|
|
@@ -4227,7 +4283,7 @@ lib/core/functions/ip.md
|
|
|
4227
4283
|
|
|
4228
4284
|
> **ip**(`ctr`, `req?`): `string`
|
|
4229
4285
|
|
|
4230
|
-
Defined in: [lib/core.ts:
|
|
4286
|
+
Defined in: [lib/core.ts:365](https://github.com/maiyunnet/kebab/blob/master/lib/core.ts#L365)
|
|
4231
4287
|
|
|
4232
4288
|
获取 IP(非安全 IP)
|
|
4233
4289
|
|
|
@@ -4258,7 +4314,7 @@ lib/core/functions/ips.md
|
|
|
4258
4314
|
|
|
4259
4315
|
> **ips**(`ctr`): `object`
|
|
4260
4316
|
|
|
4261
|
-
Defined in: [lib/core.ts:
|
|
4317
|
+
Defined in: [lib/core.ts:391](https://github.com/maiyunnet/kebab/blob/master/lib/core.ts#L391)
|
|
4262
4318
|
|
|
4263
4319
|
获取 CF 和 X 的 IP
|
|
4264
4320
|
|
|
@@ -4293,7 +4349,7 @@ lib/core/functions/loadEnv.md
|
|
|
4293
4349
|
|
|
4294
4350
|
> **loadEnv**(`dir`): `Promise`\<`void`\>
|
|
4295
4351
|
|
|
4296
|
-
Defined in: [lib/core.ts:
|
|
4352
|
+
Defined in: [lib/core.ts:1623](https://github.com/maiyunnet/kebab/blob/master/lib/core.ts#L1623)
|
|
4297
4353
|
|
|
4298
4354
|
加载 .env 文件到 process.env,若文件不存在则跳过
|
|
4299
4355
|
|
|
@@ -4322,9 +4378,9 @@ lib/core/functions/log.md
|
|
|
4322
4378
|
|
|
4323
4379
|
> **log**(`opt`, `msg`, `fend?`): `void`
|
|
4324
4380
|
|
|
4325
|
-
Defined in: [lib/core.ts:
|
|
4381
|
+
Defined in: [lib/core.ts:1171](https://github.com/maiyunnet/kebab/blob/master/lib/core.ts#L1171)
|
|
4326
4382
|
|
|
4327
|
-
|
|
4383
|
+
写入文件日志,不采集 Cookie、Session 或请求体
|
|
4328
4384
|
|
|
4329
4385
|
## Parameters
|
|
4330
4386
|
|
|
@@ -4350,6 +4406,8 @@ Defined in: [lib/core.ts:1176](https://github.com/maiyunnet/kebab/blob/master/li
|
|
|
4350
4406
|
|
|
4351
4407
|
`void`
|
|
4352
4408
|
|
|
4409
|
+
无返回值
|
|
4410
|
+
|
|
4353
4411
|
lib/core/functions/ls.md
|
|
4354
4412
|
---
|
|
4355
4413
|
|
|
@@ -4363,7 +4421,7 @@ lib/core/functions/ls.md
|
|
|
4363
4421
|
|
|
4364
4422
|
> **ls**(`opt`): `Promise`\<`object`[]\>
|
|
4365
4423
|
|
|
4366
|
-
Defined in: [lib/core.ts:
|
|
4424
|
+
Defined in: [lib/core.ts:1454](https://github.com/maiyunnet/kebab/blob/master/lib/core.ts#L1454)
|
|
4367
4425
|
|
|
4368
4426
|
获取目录内文件/文件夹列表
|
|
4369
4427
|
|
|
@@ -4387,7 +4445,7 @@ Defined in: [lib/core.ts:1470](https://github.com/maiyunnet/kebab/blob/master/li
|
|
|
4387
4445
|
|
|
4388
4446
|
`string`
|
|
4389
4447
|
|
|
4390
|
-
|
|
4448
|
+
相对运行根目录的路径,如 2024/08/01/22,可带首尾 /;拒绝越界的 .. 和软链接
|
|
4391
4449
|
|
|
4392
4450
|
## Returns
|
|
4393
4451
|
|
|
@@ -4406,7 +4464,7 @@ lib/core/functions/muid.md
|
|
|
4406
4464
|
|
|
4407
4465
|
> **muid**(`ctr`, `opt?`): `string`
|
|
4408
4466
|
|
|
4409
|
-
Defined in: [lib/core.ts:
|
|
4467
|
+
Defined in: [lib/core.ts:325](https://github.com/maiyunnet/kebab/blob/master/lib/core.ts#L325)
|
|
4410
4468
|
|
|
4411
4469
|
获取 MUID
|
|
4412
4470
|
|
|
@@ -4469,7 +4527,7 @@ lib/core/functions/objectSort.md
|
|
|
4469
4527
|
|
|
4470
4528
|
> **objectSort**\<`T`\>(`o`): `T`
|
|
4471
4529
|
|
|
4472
|
-
Defined in: [lib/core.ts:
|
|
4530
|
+
Defined in: [lib/core.ts:605](https://github.com/maiyunnet/kebab/blob/master/lib/core.ts#L605)
|
|
4473
4531
|
|
|
4474
4532
|
将对象进行升序排列
|
|
4475
4533
|
|
|
@@ -4504,7 +4562,7 @@ lib/core/functions/passThroughAppend.md
|
|
|
4504
4562
|
|
|
4505
4563
|
> **passThroughAppend**(`passThrough`, `data`, `end?`): `Promise`\<`void`\>
|
|
4506
4564
|
|
|
4507
|
-
Defined in: [lib/core.ts:
|
|
4565
|
+
Defined in: [lib/core.ts:643](https://github.com/maiyunnet/kebab/blob/master/lib/core.ts#L643)
|
|
4508
4566
|
|
|
4509
4567
|
调用前自行创建 passThrough,并且调用 pipe 绑定到应该绑定的对象,然后再调用本函数
|
|
4510
4568
|
|
|
@@ -4545,7 +4603,7 @@ lib/core/functions/purify.md
|
|
|
4545
4603
|
|
|
4546
4604
|
> **purify**(`text`): `string`
|
|
4547
4605
|
|
|
4548
|
-
Defined in: [lib/core.ts:
|
|
4606
|
+
Defined in: [lib/core.ts:190](https://github.com/maiyunnet/kebab/blob/master/lib/core.ts#L190)
|
|
4549
4607
|
|
|
4550
4608
|
去除 html 的空白符、换行以及注释
|
|
4551
4609
|
|
|
@@ -4574,7 +4632,7 @@ lib/core/functions/rand.md
|
|
|
4574
4632
|
|
|
4575
4633
|
> **rand**(`min`, `max`, `prec?`): `number`
|
|
4576
4634
|
|
|
4577
|
-
Defined in: [lib/core.ts:
|
|
4635
|
+
Defined in: [lib/core.ts:98](https://github.com/maiyunnet/kebab/blob/master/lib/core.ts#L98)
|
|
4578
4636
|
|
|
4579
4637
|
生成基础的范围随机数
|
|
4580
4638
|
|
|
@@ -4615,7 +4673,7 @@ lib/core/functions/random.md
|
|
|
4615
4673
|
|
|
4616
4674
|
> **random**(`length?`, `source?`, `block?`): `string`
|
|
4617
4675
|
|
|
4618
|
-
Defined in: [lib/core.ts:
|
|
4676
|
+
Defined in: [lib/core.ts:136](https://github.com/maiyunnet/kebab/blob/master/lib/core.ts#L136)
|
|
4619
4677
|
|
|
4620
4678
|
生成随机字符串
|
|
4621
4679
|
|
|
@@ -4656,7 +4714,7 @@ lib/core/functions/realIPLimit.md
|
|
|
4656
4714
|
|
|
4657
4715
|
> **realIPLimit**(`ctr`, `name?`, `mask?`): `string`
|
|
4658
4716
|
|
|
4659
|
-
Defined in: [lib/core.ts:
|
|
4717
|
+
Defined in: [lib/core.ts:472](https://github.com/maiyunnet/kebab/blob/master/lib/core.ts#L472)
|
|
4660
4718
|
|
|
4661
4719
|
获取安全 IP 的限速段(用于 ratelimit 库的 key)
|
|
4662
4720
|
IPv4 原样返回;IPv6 截取前 mask 位(默认 /64)
|
|
@@ -4700,7 +4758,7 @@ lib/core/functions/realIP.md
|
|
|
4700
4758
|
|
|
4701
4759
|
> **realIP**(`ctr`, `name?`): `string`
|
|
4702
4760
|
|
|
4703
|
-
Defined in: [lib/core.ts:
|
|
4761
|
+
Defined in: [lib/core.ts:433](https://github.com/maiyunnet/kebab/blob/master/lib/core.ts#L433)
|
|
4704
4762
|
|
|
4705
4763
|
获取直连 IP(安全 IP)
|
|
4706
4764
|
|
|
@@ -4733,7 +4791,7 @@ lib/core/functions/removeGlobal.md
|
|
|
4733
4791
|
|
|
4734
4792
|
> **removeGlobal**(`key`, `hosts?`): `Promise`\<`Record`\<`string`, \{ `result`: `boolean`; `return`: `string`; \}\>\>
|
|
4735
4793
|
|
|
4736
|
-
Defined in: [lib/core.ts:
|
|
4794
|
+
Defined in: [lib/core.ts:979](https://github.com/maiyunnet/kebab/blob/master/lib/core.ts#L979)
|
|
4737
4795
|
|
|
4738
4796
|
移除某个跨线程/跨内网服务器全局变量
|
|
4739
4797
|
|
|
@@ -4768,7 +4826,7 @@ lib/core/functions/resolveEnvVars.md
|
|
|
4768
4826
|
|
|
4769
4827
|
> **resolveEnvVars**(`obj`): `void`
|
|
4770
4828
|
|
|
4771
|
-
Defined in: [lib/core.ts:
|
|
4829
|
+
Defined in: [lib/core.ts:1653](https://github.com/maiyunnet/kebab/blob/master/lib/core.ts#L1653)
|
|
4772
4830
|
|
|
4773
4831
|
将配置对象中的 ${ENV_VAR} 占位符替换为 process.env 的值
|
|
4774
4832
|
|
|
@@ -4797,7 +4855,7 @@ lib/core/functions/sendNpm.md
|
|
|
4797
4855
|
|
|
4798
4856
|
> **sendNpm**(`path`, `hosts?`): `Promise`\<`Record`\<`string`, \{ `result`: `boolean`; `return`: `string`; \}\>\>
|
|
4799
4857
|
|
|
4800
|
-
Defined in: [lib/core.ts:
|
|
4858
|
+
Defined in: [lib/core.ts:892](https://github.com/maiyunnet/kebab/blob/master/lib/core.ts#L892)
|
|
4801
4859
|
|
|
4802
4860
|
向本机或局域网 RPC 发送 npm install 操作
|
|
4803
4861
|
|
|
@@ -4832,7 +4890,7 @@ lib/core/functions/sendPackage.md
|
|
|
4832
4890
|
|
|
4833
4891
|
> **sendPackage**(`content`, `hosts?`): `Promise`\<`Record`\<`string`, \{ `result`: `boolean`; `return`: `string`; \}\>\>
|
|
4834
4892
|
|
|
4835
|
-
Defined in: [lib/core.ts:
|
|
4893
|
+
Defined in: [lib/core.ts:1079](https://github.com/maiyunnet/kebab/blob/master/lib/core.ts#L1079)
|
|
4836
4894
|
|
|
4837
4895
|
向本机或局域网 RPC 发送 package.json 更新操作
|
|
4838
4896
|
|
|
@@ -4867,7 +4925,7 @@ lib/core/functions/sendPm2.md
|
|
|
4867
4925
|
|
|
4868
4926
|
> **sendPm2**(`name`, `action?`, `hosts?`): `Promise`\<`Record`\<`string`, \{ `result`: `boolean`; `return`: `string`; \}\>\>
|
|
4869
4927
|
|
|
4870
|
-
Defined in: [lib/core.ts:
|
|
4928
|
+
Defined in: [lib/core.ts:851](https://github.com/maiyunnet/kebab/blob/master/lib/core.ts#L851)
|
|
4871
4929
|
|
|
4872
4930
|
向本机或局域网 RPC 发送 PM2 操作
|
|
4873
4931
|
|
|
@@ -4910,7 +4968,7 @@ lib/core/functions/sendProject.md
|
|
|
4910
4968
|
|
|
4911
4969
|
> **sendProject**(`path`, `key`, `value`, `hosts?`): `Promise`\<`Record`\<`string`, \{ `result`: `boolean`; `return`: `string`; \}\>\>
|
|
4912
4970
|
|
|
4913
|
-
Defined in: [lib/core.ts:
|
|
4971
|
+
Defined in: [lib/core.ts:1038](https://github.com/maiyunnet/kebab/blob/master/lib/core.ts#L1038)
|
|
4914
4972
|
|
|
4915
4973
|
向本机或局域网 RPC 发送项目配置更新操作
|
|
4916
4974
|
|
|
@@ -4957,7 +5015,7 @@ lib/core/functions/sendReload.md
|
|
|
4957
5015
|
|
|
4958
5016
|
> **sendReload**(`hosts?`): `Promise`\<`Record`\<`string`, \{ `result`: `boolean`; `return`: `string`; \}\>\>
|
|
4959
5017
|
|
|
4960
|
-
Defined in: [lib/core.ts:
|
|
5018
|
+
Defined in: [lib/core.ts:712](https://github.com/maiyunnet/kebab/blob/master/lib/core.ts#L712)
|
|
4961
5019
|
|
|
4962
5020
|
向主进程(或局域网同代码机子)发送广播将进行 reload 操作,等待回传
|
|
4963
5021
|
主要作用除代码热更新以外的其他情况
|
|
@@ -4985,7 +5043,7 @@ lib/core/functions/sendRestart.md
|
|
|
4985
5043
|
|
|
4986
5044
|
> **sendRestart**(`hosts?`): `Promise`\<`Record`\<`string`, \{ `result`: `boolean`; `return`: `string`; \}\>\>
|
|
4987
5045
|
|
|
4988
|
-
Defined in: [lib/core.ts:
|
|
5046
|
+
Defined in: [lib/core.ts:756](https://github.com/maiyunnet/kebab/blob/master/lib/core.ts#L756)
|
|
4989
5047
|
|
|
4990
5048
|
向主进程(或局域网同代码机子)发送广播将进行 restart 操作,停止监听并启动新进程,老进程在连接全部断开后自行销毁
|
|
4991
5049
|
主要用作不间断的代码热更新
|
|
@@ -5013,7 +5071,7 @@ lib/core/functions/sendStop.md
|
|
|
5013
5071
|
|
|
5014
5072
|
> **sendStop**(`hosts?`): `Promise`\<`Record`\<`string`, \{ `result`: `boolean`; `return`: `string`; \}\>\>
|
|
5015
5073
|
|
|
5016
|
-
Defined in: [lib/core.ts:
|
|
5074
|
+
Defined in: [lib/core.ts:801](https://github.com/maiyunnet/kebab/blob/master/lib/core.ts#L801)
|
|
5017
5075
|
|
|
5018
5076
|
向主进程(或局域网同代码机子)发送 stop 操作,停止接收新连接并在现有连接全部结束后退出
|
|
5019
5077
|
|
|
@@ -5044,7 +5102,7 @@ lib/core/functions/sendVhost.md
|
|
|
5044
5102
|
|
|
5045
5103
|
> **sendVhost**(`files`, `hosts?`): `Promise`\<`Record`\<`string`, \{ `result`: `boolean`; `return`: `string`; \}\>\>
|
|
5046
5104
|
|
|
5047
|
-
Defined in: [lib/core.ts:
|
|
5105
|
+
Defined in: [lib/core.ts:1120](https://github.com/maiyunnet/kebab/blob/master/lib/core.ts#L1120)
|
|
5048
5106
|
|
|
5049
5107
|
全量替换各节点 conf/vhost/ 中的文件,不自动 reload
|
|
5050
5108
|
|
|
@@ -5081,7 +5139,7 @@ lib/core/functions/setCookie.md
|
|
|
5081
5139
|
|
|
5082
5140
|
> **setCookie**(`ctr`, `name`, `value`, `opt?`): `void`
|
|
5083
5141
|
|
|
5084
|
-
Defined in: [lib/core.ts:
|
|
5142
|
+
Defined in: [lib/core.ts:69](https://github.com/maiyunnet/kebab/blob/master/lib/core.ts#L69)
|
|
5085
5143
|
|
|
5086
5144
|
设置 cookie
|
|
5087
5145
|
|
|
@@ -5128,7 +5186,7 @@ lib/core/functions/setGlobal.md
|
|
|
5128
5186
|
|
|
5129
5187
|
> **setGlobal**(`key`, `data`, `hosts?`): `Promise`\<`Record`\<`string`, \{ `result`: `boolean`; `return`: `string`; \}\>\>
|
|
5130
5188
|
|
|
5131
|
-
Defined in: [lib/core.ts:
|
|
5189
|
+
Defined in: [lib/core.ts:936](https://github.com/maiyunnet/kebab/blob/master/lib/core.ts#L936)
|
|
5132
5190
|
|
|
5133
5191
|
设置跨线程/指定的局域网主机的全局变量
|
|
5134
5192
|
|
|
@@ -5169,7 +5227,7 @@ lib/core/functions/sleep.md
|
|
|
5169
5227
|
|
|
5170
5228
|
> **sleep**(`ms`): `Promise`\<`void`\>
|
|
5171
5229
|
|
|
5172
|
-
Defined in: [lib/core.ts:
|
|
5230
|
+
Defined in: [lib/core.ts:593](https://github.com/maiyunnet/kebab/blob/master/lib/core.ts#L593)
|
|
5173
5231
|
|
|
5174
5232
|
间隔一段时间
|
|
5175
5233
|
|
|
@@ -5198,7 +5256,7 @@ lib/core/functions/unconvert62.md
|
|
|
5198
5256
|
|
|
5199
5257
|
> **unconvert62**(`n`): `bigint`
|
|
5200
5258
|
|
|
5201
|
-
Defined in: [lib/core.ts:
|
|
5259
|
+
Defined in: [lib/core.ts:177](https://github.com/maiyunnet/kebab/blob/master/lib/core.ts#L177)
|
|
5202
5260
|
|
|
5203
5261
|
将 62 进制转换为 10 进制
|
|
5204
5262
|
|
|
@@ -5227,7 +5285,7 @@ lib/core/functions/updateCode.md
|
|
|
5227
5285
|
|
|
5228
5286
|
> **updateCode**(`sourcePath`, `path`, `hosts?`, `config?`, `strict?`): `Promise`\<`Record`\<`string`, \{ `result`: `boolean`; `return`: `string`; \}\>\>
|
|
5229
5287
|
|
|
5230
|
-
Defined in: [lib/core.ts:
|
|
5288
|
+
Defined in: [lib/core.ts:994](https://github.com/maiyunnet/kebab/blob/master/lib/core.ts#L994)
|
|
5231
5289
|
|
|
5232
5290
|
上传并覆盖代码文件,config.json、kebab.json、.js.map、.ts, .gitignore 不会被覆盖和新创建
|
|
5233
5291
|
|
|
@@ -5280,7 +5338,7 @@ lib/core/functions/writeEventStreamHead.md
|
|
|
5280
5338
|
|
|
5281
5339
|
> **writeEventStreamHead**(`res`): `void`
|
|
5282
5340
|
|
|
5283
|
-
Defined in: [lib/core.ts:
|
|
5341
|
+
Defined in: [lib/core.ts:1593](https://github.com/maiyunnet/kebab/blob/master/lib/core.ts#L1593)
|
|
5284
5342
|
|
|
5285
5343
|
提交服务器发送事件(SSE)响应头
|
|
5286
5344
|
|
|
@@ -5315,7 +5373,7 @@ lib/core/functions/writeHead.md
|
|
|
5315
5373
|
|
|
5316
5374
|
> **writeHead**(`res`, `statusCode`, `headers?`): `void`
|
|
5317
5375
|
|
|
5318
|
-
Defined in: [lib/core.ts:
|
|
5376
|
+
Defined in: [lib/core.ts:1572](https://github.com/maiyunnet/kebab/blob/master/lib/core.ts#L1572)
|
|
5319
5377
|
|
|
5320
5378
|
提交 HTTP 响应状态和头部,兼容 HTTP/1.1 与 HTTP/2
|
|
5321
5379
|
|
|
@@ -5365,7 +5423,7 @@ lib/core/functions/write.md
|
|
|
5365
5423
|
|
|
5366
5424
|
> **write**(`res`, `data`): `void`
|
|
5367
5425
|
|
|
5368
|
-
Defined in: [lib/core.ts:
|
|
5426
|
+
Defined in: [lib/core.ts:1605](https://github.com/maiyunnet/kebab/blob/master/lib/core.ts#L1605)
|
|
5369
5427
|
|
|
5370
5428
|
向 res 发送数据
|
|
5371
5429
|
|
|
@@ -5489,7 +5547,7 @@ lib/core/interfaces/ICookieOptions.md
|
|
|
5489
5547
|
|
|
5490
5548
|
# Interface: ICookieOptions
|
|
5491
5549
|
|
|
5492
|
-
Defined in: [lib/core.ts:
|
|
5550
|
+
Defined in: [lib/core.ts:53](https://github.com/maiyunnet/kebab/blob/master/lib/core.ts#L53)
|
|
5493
5551
|
|
|
5494
5552
|
Cookie 设置的选项
|
|
5495
5553
|
|
|
@@ -5499,7 +5557,7 @@ Cookie 设置的选项
|
|
|
5499
5557
|
|
|
5500
5558
|
> `optional` **domain?**: `string`
|
|
5501
5559
|
|
|
5502
|
-
Defined in: [lib/core.ts:
|
|
5560
|
+
Defined in: [lib/core.ts:56](https://github.com/maiyunnet/kebab/blob/master/lib/core.ts#L56)
|
|
5503
5561
|
|
|
5504
5562
|
***
|
|
5505
5563
|
|
|
@@ -5507,7 +5565,7 @@ Defined in: [lib/core.ts:54](https://github.com/maiyunnet/kebab/blob/master/lib/
|
|
|
5507
5565
|
|
|
5508
5566
|
> `optional` **httponly?**: `boolean`
|
|
5509
5567
|
|
|
5510
|
-
Defined in: [lib/core.ts:
|
|
5568
|
+
Defined in: [lib/core.ts:58](https://github.com/maiyunnet/kebab/blob/master/lib/core.ts#L58)
|
|
5511
5569
|
|
|
5512
5570
|
***
|
|
5513
5571
|
|
|
@@ -5515,7 +5573,7 @@ Defined in: [lib/core.ts:56](https://github.com/maiyunnet/kebab/blob/master/lib/
|
|
|
5515
5573
|
|
|
5516
5574
|
> `optional` **path?**: `string`
|
|
5517
5575
|
|
|
5518
|
-
Defined in: [lib/core.ts:
|
|
5576
|
+
Defined in: [lib/core.ts:55](https://github.com/maiyunnet/kebab/blob/master/lib/core.ts#L55)
|
|
5519
5577
|
|
|
5520
5578
|
***
|
|
5521
5579
|
|
|
@@ -5523,7 +5581,7 @@ Defined in: [lib/core.ts:53](https://github.com/maiyunnet/kebab/blob/master/lib/
|
|
|
5523
5581
|
|
|
5524
5582
|
> `optional` **samesite?**: `"Strict"` \| `"Lax"` \| `"None"`
|
|
5525
5583
|
|
|
5526
|
-
Defined in: [lib/core.ts:
|
|
5584
|
+
Defined in: [lib/core.ts:59](https://github.com/maiyunnet/kebab/blob/master/lib/core.ts#L59)
|
|
5527
5585
|
|
|
5528
5586
|
***
|
|
5529
5587
|
|
|
@@ -5531,7 +5589,7 @@ Defined in: [lib/core.ts:57](https://github.com/maiyunnet/kebab/blob/master/lib/
|
|
|
5531
5589
|
|
|
5532
5590
|
> `optional` **ssl?**: `boolean`
|
|
5533
5591
|
|
|
5534
|
-
Defined in: [lib/core.ts:
|
|
5592
|
+
Defined in: [lib/core.ts:57](https://github.com/maiyunnet/kebab/blob/master/lib/core.ts#L57)
|
|
5535
5593
|
|
|
5536
5594
|
***
|
|
5537
5595
|
|
|
@@ -5539,7 +5597,7 @@ Defined in: [lib/core.ts:55](https://github.com/maiyunnet/kebab/blob/master/lib/
|
|
|
5539
5597
|
|
|
5540
5598
|
> `optional` **ttl?**: `number`
|
|
5541
5599
|
|
|
5542
|
-
Defined in: [lib/core.ts:
|
|
5600
|
+
Defined in: [lib/core.ts:54](https://github.com/maiyunnet/kebab/blob/master/lib/core.ts#L54)
|
|
5543
5601
|
|
|
5544
5602
|
lib/core/interfaces/ILogOptions.md
|
|
5545
5603
|
---
|
|
@@ -5552,25 +5610,17 @@ lib/core/interfaces/ILogOptions.md
|
|
|
5552
5610
|
|
|
5553
5611
|
# Interface: ILogOptions
|
|
5554
5612
|
|
|
5555
|
-
Defined in: [lib/core.ts:
|
|
5613
|
+
Defined in: [lib/core.ts:1155](https://github.com/maiyunnet/kebab/blob/master/lib/core.ts#L1155)
|
|
5556
5614
|
|
|
5557
5615
|
log 设置的选项
|
|
5558
5616
|
|
|
5559
5617
|
## Properties
|
|
5560
5618
|
|
|
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
5619
|
### get?
|
|
5570
5620
|
|
|
5571
5621
|
> `optional` **get?**: `Record`\<`string`, `any`\>
|
|
5572
5622
|
|
|
5573
|
-
Defined in: [lib/core.ts:
|
|
5623
|
+
Defined in: [lib/core.ts:1160](https://github.com/maiyunnet/kebab/blob/master/lib/core.ts#L1160)
|
|
5574
5624
|
|
|
5575
5625
|
***
|
|
5576
5626
|
|
|
@@ -5578,7 +5628,7 @@ Defined in: [lib/core.ts:1164](https://github.com/maiyunnet/kebab/blob/master/li
|
|
|
5578
5628
|
|
|
5579
5629
|
> `optional` **headers?**: `IncomingHttpHeaders`
|
|
5580
5630
|
|
|
5581
|
-
Defined in: [lib/core.ts:
|
|
5631
|
+
Defined in: [lib/core.ts:1161](https://github.com/maiyunnet/kebab/blob/master/lib/core.ts#L1161)
|
|
5582
5632
|
|
|
5583
5633
|
***
|
|
5584
5634
|
|
|
@@ -5586,7 +5636,7 @@ Defined in: [lib/core.ts:1167](https://github.com/maiyunnet/kebab/blob/master/li
|
|
|
5586
5636
|
|
|
5587
5637
|
> `optional` **hostname?**: `string`
|
|
5588
5638
|
|
|
5589
|
-
Defined in: [lib/core.ts:
|
|
5639
|
+
Defined in: [lib/core.ts:1158](https://github.com/maiyunnet/kebab/blob/master/lib/core.ts#L1158)
|
|
5590
5640
|
|
|
5591
5641
|
***
|
|
5592
5642
|
|
|
@@ -5594,7 +5644,7 @@ Defined in: [lib/core.ts:1162](https://github.com/maiyunnet/kebab/blob/master/li
|
|
|
5594
5644
|
|
|
5595
5645
|
> `optional` **path?**: `string`
|
|
5596
5646
|
|
|
5597
|
-
Defined in: [lib/core.ts:
|
|
5647
|
+
Defined in: [lib/core.ts:1156](https://github.com/maiyunnet/kebab/blob/master/lib/core.ts#L1156)
|
|
5598
5648
|
|
|
5599
5649
|
***
|
|
5600
5650
|
|
|
@@ -5602,15 +5652,7 @@ Defined in: [lib/core.ts:1160](https://github.com/maiyunnet/kebab/blob/master/li
|
|
|
5602
5652
|
|
|
5603
5653
|
> `optional` **req?**: `IncomingMessage` \| `Http2ServerRequest` \| `null`
|
|
5604
5654
|
|
|
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)
|
|
5655
|
+
Defined in: [lib/core.ts:1159](https://github.com/maiyunnet/kebab/blob/master/lib/core.ts#L1159)
|
|
5614
5656
|
|
|
5615
5657
|
***
|
|
5616
5658
|
|
|
@@ -5618,7 +5660,7 @@ Defined in: [lib/core.ts:1166](https://github.com/maiyunnet/kebab/blob/master/li
|
|
|
5618
5660
|
|
|
5619
5661
|
> `optional` **urlFull?**: `string`
|
|
5620
5662
|
|
|
5621
|
-
Defined in: [lib/core.ts:
|
|
5663
|
+
Defined in: [lib/core.ts:1157](https://github.com/maiyunnet/kebab/blob/master/lib/core.ts#L1157)
|
|
5622
5664
|
|
|
5623
5665
|
lib/core/interfaces/IMonitorEvent.md
|
|
5624
5666
|
---
|
|
@@ -5631,7 +5673,7 @@ lib/core/interfaces/IMonitorEvent.md
|
|
|
5631
5673
|
|
|
5632
5674
|
# Interface: IMonitorEvent
|
|
5633
5675
|
|
|
5634
|
-
Defined in: [lib/core.ts:
|
|
5676
|
+
Defined in: [lib/core.ts:1339](https://github.com/maiyunnet/kebab/blob/master/lib/core.ts#L1339)
|
|
5635
5677
|
|
|
5636
5678
|
事件原始数据与可读取的文件;data 为 null 时可下载原始记录复盘
|
|
5637
5679
|
|
|
@@ -5641,7 +5683,7 @@ Defined in: [lib/core.ts:1355](https://github.com/maiyunnet/kebab/blob/master/li
|
|
|
5641
5683
|
|
|
5642
5684
|
> **data**: `Record`\<`string`, `unknown`\> \| `null`
|
|
5643
5685
|
|
|
5644
|
-
Defined in: [lib/core.ts:
|
|
5686
|
+
Defined in: [lib/core.ts:1341](https://github.com/maiyunnet/kebab/blob/master/lib/core.ts#L1341)
|
|
5645
5687
|
|
|
5646
5688
|
***
|
|
5647
5689
|
|
|
@@ -5649,7 +5691,7 @@ Defined in: [lib/core.ts:1357](https://github.com/maiyunnet/kebab/blob/master/li
|
|
|
5649
5691
|
|
|
5650
5692
|
> **files**: [`IMonitorFile`](IMonitorFile.md)[]
|
|
5651
5693
|
|
|
5652
|
-
Defined in: [lib/core.ts:
|
|
5694
|
+
Defined in: [lib/core.ts:1343](https://github.com/maiyunnet/kebab/blob/master/lib/core.ts#L1343)
|
|
5653
5695
|
|
|
5654
5696
|
***
|
|
5655
5697
|
|
|
@@ -5657,7 +5699,7 @@ Defined in: [lib/core.ts:1359](https://github.com/maiyunnet/kebab/blob/master/li
|
|
|
5657
5699
|
|
|
5658
5700
|
> **recordStatus**: `"loaded"` \| `"invalid"` \| `"missing"` \| `"too-large"` \| `"unreadable"`
|
|
5659
5701
|
|
|
5660
|
-
Defined in: [lib/core.ts:
|
|
5702
|
+
Defined in: [lib/core.ts:1342](https://github.com/maiyunnet/kebab/blob/master/lib/core.ts#L1342)
|
|
5661
5703
|
|
|
5662
5704
|
***
|
|
5663
5705
|
|
|
@@ -5665,7 +5707,7 @@ Defined in: [lib/core.ts:1358](https://github.com/maiyunnet/kebab/blob/master/li
|
|
|
5665
5707
|
|
|
5666
5708
|
> **summary**: [`IMonitorEventSummary`](IMonitorEventSummary.md)
|
|
5667
5709
|
|
|
5668
|
-
Defined in: [lib/core.ts:
|
|
5710
|
+
Defined in: [lib/core.ts:1340](https://github.com/maiyunnet/kebab/blob/master/lib/core.ts#L1340)
|
|
5669
5711
|
|
|
5670
5712
|
lib/core/interfaces/IMonitorEventSummary.md
|
|
5671
5713
|
---
|
|
@@ -5678,7 +5720,7 @@ lib/core/interfaces/IMonitorEventSummary.md
|
|
|
5678
5720
|
|
|
5679
5721
|
# Interface: IMonitorEventSummary
|
|
5680
5722
|
|
|
5681
|
-
Defined in: [lib/core.ts:
|
|
5723
|
+
Defined in: [lib/core.ts:1319](https://github.com/maiyunnet/kebab/blob/master/lib/core.ts#L1319)
|
|
5682
5724
|
|
|
5683
5725
|
已保存监控事件的简短摘要,path 相对于 log/monitor/
|
|
5684
5726
|
|
|
@@ -5688,7 +5730,7 @@ Defined in: [lib/core.ts:1335](https://github.com/maiyunnet/kebab/blob/master/li
|
|
|
5688
5730
|
|
|
5689
5731
|
> **path**: `string`
|
|
5690
5732
|
|
|
5691
|
-
Defined in: [lib/core.ts:
|
|
5733
|
+
Defined in: [lib/core.ts:1320](https://github.com/maiyunnet/kebab/blob/master/lib/core.ts#L1320)
|
|
5692
5734
|
|
|
5693
5735
|
***
|
|
5694
5736
|
|
|
@@ -5696,7 +5738,7 @@ Defined in: [lib/core.ts:1336](https://github.com/maiyunnet/kebab/blob/master/li
|
|
|
5696
5738
|
|
|
5697
5739
|
> **pid**: `number`
|
|
5698
5740
|
|
|
5699
|
-
Defined in: [lib/core.ts:
|
|
5741
|
+
Defined in: [lib/core.ts:1321](https://github.com/maiyunnet/kebab/blob/master/lib/core.ts#L1321)
|
|
5700
5742
|
|
|
5701
5743
|
***
|
|
5702
5744
|
|
|
@@ -5704,7 +5746,7 @@ Defined in: [lib/core.ts:1337](https://github.com/maiyunnet/kebab/blob/master/li
|
|
|
5704
5746
|
|
|
5705
5747
|
> **reasons**: `string`[]
|
|
5706
5748
|
|
|
5707
|
-
Defined in: [lib/core.ts:
|
|
5749
|
+
Defined in: [lib/core.ts:1325](https://github.com/maiyunnet/kebab/blob/master/lib/core.ts#L1325)
|
|
5708
5750
|
|
|
5709
5751
|
***
|
|
5710
5752
|
|
|
@@ -5712,7 +5754,7 @@ Defined in: [lib/core.ts:1341](https://github.com/maiyunnet/kebab/blob/master/li
|
|
|
5712
5754
|
|
|
5713
5755
|
> **source**: `"main"` \| `"watchdog"`
|
|
5714
5756
|
|
|
5715
|
-
Defined in: [lib/core.ts:
|
|
5757
|
+
Defined in: [lib/core.ts:1323](https://github.com/maiyunnet/kebab/blob/master/lib/core.ts#L1323)
|
|
5716
5758
|
|
|
5717
5759
|
***
|
|
5718
5760
|
|
|
@@ -5720,7 +5762,7 @@ Defined in: [lib/core.ts:1339](https://github.com/maiyunnet/kebab/blob/master/li
|
|
|
5720
5762
|
|
|
5721
5763
|
> **status**: `string`
|
|
5722
5764
|
|
|
5723
|
-
Defined in: [lib/core.ts:
|
|
5765
|
+
Defined in: [lib/core.ts:1324](https://github.com/maiyunnet/kebab/blob/master/lib/core.ts#L1324)
|
|
5724
5766
|
|
|
5725
5767
|
***
|
|
5726
5768
|
|
|
@@ -5728,7 +5770,7 @@ Defined in: [lib/core.ts:1340](https://github.com/maiyunnet/kebab/blob/master/li
|
|
|
5728
5770
|
|
|
5729
5771
|
> **time**: `number`
|
|
5730
5772
|
|
|
5731
|
-
Defined in: [lib/core.ts:
|
|
5773
|
+
Defined in: [lib/core.ts:1322](https://github.com/maiyunnet/kebab/blob/master/lib/core.ts#L1322)
|
|
5732
5774
|
|
|
5733
5775
|
lib/core/interfaces/IMonitorFile.md
|
|
5734
5776
|
---
|
|
@@ -5741,7 +5783,7 @@ lib/core/interfaces/IMonitorFile.md
|
|
|
5741
5783
|
|
|
5742
5784
|
# Interface: IMonitorFile
|
|
5743
5785
|
|
|
5744
|
-
Defined in: [lib/core.ts:
|
|
5786
|
+
Defined in: [lib/core.ts:1329](https://github.com/maiyunnet/kebab/blob/master/lib/core.ts#L1329)
|
|
5745
5787
|
|
|
5746
5788
|
监控文件元数据;复杂格式或超过 1 MiB 的文件不提供预览
|
|
5747
5789
|
|
|
@@ -5751,7 +5793,7 @@ Defined in: [lib/core.ts:1345](https://github.com/maiyunnet/kebab/blob/master/li
|
|
|
5751
5793
|
|
|
5752
5794
|
> **mtime**: `number`
|
|
5753
5795
|
|
|
5754
|
-
Defined in: [lib/core.ts:
|
|
5796
|
+
Defined in: [lib/core.ts:1334](https://github.com/maiyunnet/kebab/blob/master/lib/core.ts#L1334)
|
|
5755
5797
|
|
|
5756
5798
|
最后修改时间,单位 ms
|
|
5757
5799
|
|
|
@@ -5761,7 +5803,7 @@ Defined in: [lib/core.ts:1350](https://github.com/maiyunnet/kebab/blob/master/li
|
|
|
5761
5803
|
|
|
5762
5804
|
> **name**: `string`
|
|
5763
5805
|
|
|
5764
|
-
Defined in: [lib/core.ts:
|
|
5806
|
+
Defined in: [lib/core.ts:1331](https://github.com/maiyunnet/kebab/blob/master/lib/core.ts#L1331)
|
|
5765
5807
|
|
|
5766
5808
|
***
|
|
5767
5809
|
|
|
@@ -5769,7 +5811,7 @@ Defined in: [lib/core.ts:1347](https://github.com/maiyunnet/kebab/blob/master/li
|
|
|
5769
5811
|
|
|
5770
5812
|
> **path**: `string`
|
|
5771
5813
|
|
|
5772
|
-
Defined in: [lib/core.ts:
|
|
5814
|
+
Defined in: [lib/core.ts:1330](https://github.com/maiyunnet/kebab/blob/master/lib/core.ts#L1330)
|
|
5773
5815
|
|
|
5774
5816
|
***
|
|
5775
5817
|
|
|
@@ -5777,7 +5819,7 @@ Defined in: [lib/core.ts:1346](https://github.com/maiyunnet/kebab/blob/master/li
|
|
|
5777
5819
|
|
|
5778
5820
|
> **preview**: `"text"` \| `"json"` \| `null`
|
|
5779
5821
|
|
|
5780
|
-
Defined in: [lib/core.ts:
|
|
5822
|
+
Defined in: [lib/core.ts:1335](https://github.com/maiyunnet/kebab/blob/master/lib/core.ts#L1335)
|
|
5781
5823
|
|
|
5782
5824
|
***
|
|
5783
5825
|
|
|
@@ -5785,7 +5827,7 @@ Defined in: [lib/core.ts:1351](https://github.com/maiyunnet/kebab/blob/master/li
|
|
|
5785
5827
|
|
|
5786
5828
|
> **size**: `number`
|
|
5787
5829
|
|
|
5788
|
-
Defined in: [lib/core.ts:
|
|
5830
|
+
Defined in: [lib/core.ts:1332](https://github.com/maiyunnet/kebab/blob/master/lib/core.ts#L1332)
|
|
5789
5831
|
|
|
5790
5832
|
lib/core/namespaces/v/classes/ValiError.md
|
|
5791
5833
|
---
|
|
@@ -115003,6 +115045,331 @@ Defined in: node\_modules/valibot/dist/index.d.mts:16127
|
|
|
115003
115045
|
|
|
115004
115046
|
[UUID](https://en.wikipedia.org/wiki/Universally_unique_identifier) regex.
|
|
115005
115047
|
|
|
115048
|
+
lib/core/rpc/index.md
|
|
115049
|
+
---
|
|
115050
|
+
|
|
115051
|
+
[**Documents for @maiyunnet/kebab**](../../../index.md)
|
|
115052
|
+
|
|
115053
|
+
***
|
|
115054
|
+
|
|
115055
|
+
[Documents for @maiyunnet/kebab](../../../index.md) / lib/core/rpc
|
|
115056
|
+
|
|
115057
|
+
# lib/core/rpc
|
|
115058
|
+
|
|
115059
|
+
## Interfaces
|
|
115060
|
+
|
|
115061
|
+
- [IMessage](interfaces/IMessage.md)
|
|
115062
|
+
|
|
115063
|
+
## Variables
|
|
115064
|
+
|
|
115065
|
+
- [authenticate](variables/authenticate.md)
|
|
115066
|
+
- [hash](variables/hash.md)
|
|
115067
|
+
- [hashFile](variables/hashFile.md)
|
|
115068
|
+
- [readBody](variables/readBody.md)
|
|
115069
|
+
- [reject](variables/reject.md)
|
|
115070
|
+
- [sign](variables/sign.md)
|
|
115071
|
+
- [validSecret](variables/validSecret.md)
|
|
115072
|
+
|
|
115073
|
+
lib/core/rpc/interfaces/IMessage.md
|
|
115074
|
+
---
|
|
115075
|
+
|
|
115076
|
+
[**Documents for @maiyunnet/kebab**](../../../../index.md)
|
|
115077
|
+
|
|
115078
|
+
***
|
|
115079
|
+
|
|
115080
|
+
[Documents for @maiyunnet/kebab](../../../../index.md) / [lib/core/rpc](../index.md) / IMessage
|
|
115081
|
+
|
|
115082
|
+
# Interface: IMessage
|
|
115083
|
+
|
|
115084
|
+
Defined in: [lib/core/rpc.ts:6](https://github.com/maiyunnet/kebab/blob/master/lib/core/rpc.ts#L6)
|
|
115085
|
+
|
|
115086
|
+
经认证的 RPC 命令及请求体摘要
|
|
115087
|
+
|
|
115088
|
+
## Indexable
|
|
115089
|
+
|
|
115090
|
+
> \[`key`: `string`\]: `any`
|
|
115091
|
+
|
|
115092
|
+
## Properties
|
|
115093
|
+
|
|
115094
|
+
### action
|
|
115095
|
+
|
|
115096
|
+
> **action**: `string`
|
|
115097
|
+
|
|
115098
|
+
Defined in: [lib/core/rpc.ts:7](https://github.com/maiyunnet/kebab/blob/master/lib/core/rpc.ts#L7)
|
|
115099
|
+
|
|
115100
|
+
***
|
|
115101
|
+
|
|
115102
|
+
### bodyHash
|
|
115103
|
+
|
|
115104
|
+
> **bodyHash**: `string`
|
|
115105
|
+
|
|
115106
|
+
Defined in: [lib/core/rpc.ts:8](https://github.com/maiyunnet/kebab/blob/master/lib/core/rpc.ts#L8)
|
|
115107
|
+
|
|
115108
|
+
lib/core/rpc/variables/authenticate.md
|
|
115109
|
+
---
|
|
115110
|
+
|
|
115111
|
+
[**Documents for @maiyunnet/kebab**](../../../../index.md)
|
|
115112
|
+
|
|
115113
|
+
***
|
|
115114
|
+
|
|
115115
|
+
[Documents for @maiyunnet/kebab](../../../../index.md) / [lib/core/rpc](../index.md) / authenticate
|
|
115116
|
+
|
|
115117
|
+
# Variable: authenticate
|
|
115118
|
+
|
|
115119
|
+
> `const` **authenticate**: (`req`, `secret`) => [`IMessage`](../interfaces/IMessage.md) \| `false` = `implementation.authenticate`
|
|
115120
|
+
|
|
115121
|
+
Defined in: [lib/core/rpc.ts:51](https://github.com/maiyunnet/kebab/blob/master/lib/core/rpc.ts#L51)
|
|
115122
|
+
|
|
115123
|
+
校验密钥、方法及距当前时间不超过 5 秒的命令,并登记未使用的 nonce
|
|
115124
|
+
|
|
115125
|
+
## Parameters
|
|
115126
|
+
|
|
115127
|
+
### req
|
|
115128
|
+
|
|
115129
|
+
`http.IncomingMessage`
|
|
115130
|
+
|
|
115131
|
+
请求,使用 URL、方法和 socket IP
|
|
115132
|
+
|
|
115133
|
+
### secret
|
|
115134
|
+
|
|
115135
|
+
`unknown`
|
|
115136
|
+
|
|
115137
|
+
RPC 密钥
|
|
115138
|
+
|
|
115139
|
+
## Returns
|
|
115140
|
+
|
|
115141
|
+
[`IMessage`](../interfaces/IMessage.md) \| `false`
|
|
115142
|
+
|
|
115143
|
+
认证命令;无效或已用 nonce、限速及缓存满时返回 false
|
|
115144
|
+
|
|
115145
|
+
lib/core/rpc/variables/hashFile.md
|
|
115146
|
+
---
|
|
115147
|
+
|
|
115148
|
+
[**Documents for @maiyunnet/kebab**](../../../../index.md)
|
|
115149
|
+
|
|
115150
|
+
***
|
|
115151
|
+
|
|
115152
|
+
[Documents for @maiyunnet/kebab](../../../../index.md) / [lib/core/rpc](../index.md) / hashFile
|
|
115153
|
+
|
|
115154
|
+
# Variable: hashFile
|
|
115155
|
+
|
|
115156
|
+
> `const` **hashFile**: (`file`) => `Promise`\<`string` \| `false`\> = `implementation.hashFile`
|
|
115157
|
+
|
|
115158
|
+
Defined in: [lib/core/rpc.ts:31](https://github.com/maiyunnet/kebab/blob/master/lib/core/rpc.ts#L31)
|
|
115159
|
+
|
|
115160
|
+
流式计算文件的 SHA-256
|
|
115161
|
+
|
|
115162
|
+
## Parameters
|
|
115163
|
+
|
|
115164
|
+
### file
|
|
115165
|
+
|
|
115166
|
+
`string`
|
|
115167
|
+
|
|
115168
|
+
文件路径
|
|
115169
|
+
|
|
115170
|
+
## Returns
|
|
115171
|
+
|
|
115172
|
+
`Promise`\<`string` \| `false`\>
|
|
115173
|
+
|
|
115174
|
+
小写十六进制摘要;读取失败返回 false
|
|
115175
|
+
|
|
115176
|
+
lib/core/rpc/variables/hash.md
|
|
115177
|
+
---
|
|
115178
|
+
|
|
115179
|
+
[**Documents for @maiyunnet/kebab**](../../../../index.md)
|
|
115180
|
+
|
|
115181
|
+
***
|
|
115182
|
+
|
|
115183
|
+
[Documents for @maiyunnet/kebab](../../../../index.md) / [lib/core/rpc](../index.md) / hash
|
|
115184
|
+
|
|
115185
|
+
# Variable: hash
|
|
115186
|
+
|
|
115187
|
+
> `const` **hash**: (`data`) => `string` = `implementation.hash`
|
|
115188
|
+
|
|
115189
|
+
Defined in: [lib/core/rpc.ts:24](https://github.com/maiyunnet/kebab/blob/master/lib/core/rpc.ts#L24)
|
|
115190
|
+
|
|
115191
|
+
计算内容的 SHA-256
|
|
115192
|
+
|
|
115193
|
+
## Parameters
|
|
115194
|
+
|
|
115195
|
+
### data
|
|
115196
|
+
|
|
115197
|
+
`string` \| `Buffer`
|
|
115198
|
+
|
|
115199
|
+
请求体内容
|
|
115200
|
+
|
|
115201
|
+
## Returns
|
|
115202
|
+
|
|
115203
|
+
`string`
|
|
115204
|
+
|
|
115205
|
+
小写十六进制摘要
|
|
115206
|
+
|
|
115207
|
+
lib/core/rpc/variables/readBody.md
|
|
115208
|
+
---
|
|
115209
|
+
|
|
115210
|
+
[**Documents for @maiyunnet/kebab**](../../../../index.md)
|
|
115211
|
+
|
|
115212
|
+
***
|
|
115213
|
+
|
|
115214
|
+
[Documents for @maiyunnet/kebab](../../../../index.md) / [lib/core/rpc](../index.md) / readBody
|
|
115215
|
+
|
|
115216
|
+
# Variable: readBody
|
|
115217
|
+
|
|
115218
|
+
> `const` **readBody**: (`req`, `expected`, `directory`, `upload`, `limit`) => `Promise`\<\{ `body?`: `Buffer`; `file?`: `string`; \} \| `false`\> = `implementation.readBody`
|
|
115219
|
+
|
|
115220
|
+
Defined in: [lib/core/rpc.ts:71](https://github.com/maiyunnet/kebab/blob/master/lib/core/rpc.ts#L71)
|
|
115221
|
+
|
|
115222
|
+
按字节上限读取并校验请求体;上传的临时文件由调用方删除
|
|
115223
|
+
|
|
115224
|
+
## Parameters
|
|
115225
|
+
|
|
115226
|
+
### req
|
|
115227
|
+
|
|
115228
|
+
`http.IncomingMessage`
|
|
115229
|
+
|
|
115230
|
+
请求流
|
|
115231
|
+
|
|
115232
|
+
### expected
|
|
115233
|
+
|
|
115234
|
+
`string`
|
|
115235
|
+
|
|
115236
|
+
已认证的 SHA-256 摘要
|
|
115237
|
+
|
|
115238
|
+
### directory
|
|
115239
|
+
|
|
115240
|
+
`string`
|
|
115241
|
+
|
|
115242
|
+
临时文件目录
|
|
115243
|
+
|
|
115244
|
+
### upload
|
|
115245
|
+
|
|
115246
|
+
`boolean`
|
|
115247
|
+
|
|
115248
|
+
是否将请求体写入临时文件
|
|
115249
|
+
|
|
115250
|
+
### limit
|
|
115251
|
+
|
|
115252
|
+
`number`
|
|
115253
|
+
|
|
115254
|
+
允许的最大字节数
|
|
115255
|
+
|
|
115256
|
+
## Returns
|
|
115257
|
+
|
|
115258
|
+
`Promise`\<\{ `body?`: `Buffer`; `file?`: `string`; \} \| `false`\>
|
|
115259
|
+
|
|
115260
|
+
内存内容或临时文件;失败返回 false 并清理临时文件
|
|
115261
|
+
|
|
115262
|
+
lib/core/rpc/variables/reject.md
|
|
115263
|
+
---
|
|
115264
|
+
|
|
115265
|
+
[**Documents for @maiyunnet/kebab**](../../../../index.md)
|
|
115266
|
+
|
|
115267
|
+
***
|
|
115268
|
+
|
|
115269
|
+
[Documents for @maiyunnet/kebab](../../../../index.md) / [lib/core/rpc](../index.md) / reject
|
|
115270
|
+
|
|
115271
|
+
# Variable: reject
|
|
115272
|
+
|
|
115273
|
+
> `const` **reject**: (`req`) => `boolean` = `implementation.reject`
|
|
115274
|
+
|
|
115275
|
+
Defined in: [lib/core/rpc.ts:60](https://github.com/maiyunnet/kebab/blob/master/lib/core/rpc.ts#L60)
|
|
115276
|
+
|
|
115277
|
+
记录 socket IP 的失败次数
|
|
115278
|
+
|
|
115279
|
+
## Parameters
|
|
115280
|
+
|
|
115281
|
+
### req
|
|
115282
|
+
|
|
115283
|
+
`http.IncomingMessage`
|
|
115284
|
+
|
|
115285
|
+
被拒绝的请求
|
|
115286
|
+
|
|
115287
|
+
## Returns
|
|
115288
|
+
|
|
115289
|
+
`boolean`
|
|
115290
|
+
|
|
115291
|
+
每个限速窗口仅首次失败返回 true,供审计
|
|
115292
|
+
|
|
115293
|
+
lib/core/rpc/variables/sign.md
|
|
115294
|
+
---
|
|
115295
|
+
|
|
115296
|
+
[**Documents for @maiyunnet/kebab**](../../../../index.md)
|
|
115297
|
+
|
|
115298
|
+
***
|
|
115299
|
+
|
|
115300
|
+
[Documents for @maiyunnet/kebab](../../../../index.md) / [lib/core/rpc](../index.md) / sign
|
|
115301
|
+
|
|
115302
|
+
# Variable: sign
|
|
115303
|
+
|
|
115304
|
+
> `const` **sign**: (`message`, `secret`, `method?`, `bodyHash?`) => `string` = `implementation.sign`
|
|
115305
|
+
|
|
115306
|
+
Defined in: [lib/core/rpc.ts:41](https://github.com/maiyunnet/kebab/blob/master/lib/core/rpc.ts#L41)
|
|
115307
|
+
|
|
115308
|
+
加密认证命令、HTTP 方法和请求体摘要;自动生成时间与 nonce
|
|
115309
|
+
|
|
115310
|
+
## Parameters
|
|
115311
|
+
|
|
115312
|
+
### message
|
|
115313
|
+
|
|
115314
|
+
`Record`\<`string`, `unknown`\>
|
|
115315
|
+
|
|
115316
|
+
动作及参数
|
|
115317
|
+
|
|
115318
|
+
### secret
|
|
115319
|
+
|
|
115320
|
+
`string`
|
|
115321
|
+
|
|
115322
|
+
RPC 密钥
|
|
115323
|
+
|
|
115324
|
+
### method?
|
|
115325
|
+
|
|
115326
|
+
`string`
|
|
115327
|
+
|
|
115328
|
+
HTTP 方法,默认 GET
|
|
115329
|
+
|
|
115330
|
+
### bodyHash?
|
|
115331
|
+
|
|
115332
|
+
`string`
|
|
115333
|
+
|
|
115334
|
+
请求体的 SHA-256,默认空内容摘要
|
|
115335
|
+
|
|
115336
|
+
## Returns
|
|
115337
|
+
|
|
115338
|
+
`string`
|
|
115339
|
+
|
|
115340
|
+
URL 中的命令;密钥不合格时返回不可认证标记
|
|
115341
|
+
|
|
115342
|
+
lib/core/rpc/variables/validSecret.md
|
|
115343
|
+
---
|
|
115344
|
+
|
|
115345
|
+
[**Documents for @maiyunnet/kebab**](../../../../index.md)
|
|
115346
|
+
|
|
115347
|
+
***
|
|
115348
|
+
|
|
115349
|
+
[Documents for @maiyunnet/kebab](../../../../index.md) / [lib/core/rpc](../index.md) / validSecret
|
|
115350
|
+
|
|
115351
|
+
# Variable: validSecret
|
|
115352
|
+
|
|
115353
|
+
> `const` **validSecret**: (`secret`) => `secret is string` = `implementation.validSecret`
|
|
115354
|
+
|
|
115355
|
+
Defined in: [lib/core/rpc.ts:17](https://github.com/maiyunnet/kebab/blob/master/lib/core/rpc.ts#L17)
|
|
115356
|
+
|
|
115357
|
+
校验密钥:至少 32 个字符,去除首尾空白后拒绝占位值及短重复模式
|
|
115358
|
+
|
|
115359
|
+
## Parameters
|
|
115360
|
+
|
|
115361
|
+
### secret
|
|
115362
|
+
|
|
115363
|
+
`unknown`
|
|
115364
|
+
|
|
115365
|
+
待校验密钥
|
|
115366
|
+
|
|
115367
|
+
## Returns
|
|
115368
|
+
|
|
115369
|
+
`secret is string`
|
|
115370
|
+
|
|
115371
|
+
密钥是否合格
|
|
115372
|
+
|
|
115006
115373
|
lib/core/type-aliases/TPm2Action.md
|
|
115007
115374
|
---
|
|
115008
115375
|
|
|
@@ -115016,7 +115383,7 @@ lib/core/type-aliases/TPm2Action.md
|
|
|
115016
115383
|
|
|
115017
115384
|
> **TPm2Action** = `"start"` \| `"stop"` \| `"restart"`
|
|
115018
115385
|
|
|
115019
|
-
Defined in: [lib/core.ts:
|
|
115386
|
+
Defined in: [lib/core.ts:842](https://github.com/maiyunnet/kebab/blob/master/lib/core.ts#L842)
|
|
115020
115387
|
|
|
115021
115388
|
PM2 操作类型
|
|
115022
115389
|
|
|
@@ -115033,7 +115400,7 @@ lib/core/variables/globalConfig.md
|
|
|
115033
115400
|
|
|
115034
115401
|
> `const` **globalConfig**: [`IConfig`](../../../index/interfaces/IConfig.md) & `object`
|
|
115035
115402
|
|
|
115036
|
-
Defined in: [lib/core.ts:
|
|
115403
|
+
Defined in: [lib/core.ts:32](https://github.com/maiyunnet/kebab/blob/master/lib/core.ts#L32)
|
|
115037
115404
|
|
|
115038
115405
|
全局参数
|
|
115039
115406
|
|
|
@@ -115090,7 +115457,7 @@ lib/core/variables/global.md
|
|
|
115090
115457
|
|
|
115091
115458
|
> `const` **global**: `Record`\<`string`, `any`\> = `{}`
|
|
115092
115459
|
|
|
115093
|
-
Defined in: [lib/core.ts:
|
|
115460
|
+
Defined in: [lib/core.ts:928](https://github.com/maiyunnet/kebab/blob/master/lib/core.ts#L928)
|
|
115094
115461
|
|
|
115095
115462
|
跨进程全局变量
|
|
115096
115463
|
|
|
@@ -115107,7 +115474,7 @@ lib/core/variables/RANDOM_L.md
|
|
|
115107
115474
|
|
|
115108
115475
|
> `const` **RANDOM\_L**: `"abcdefghijklmnopqrstuvwxyz"` = `'abcdefghijklmnopqrstuvwxyz'`
|
|
115109
115476
|
|
|
115110
|
-
Defined in: [lib/core.ts:
|
|
115477
|
+
Defined in: [lib/core.ts:115](https://github.com/maiyunnet/kebab/blob/master/lib/core.ts#L115)
|
|
115111
115478
|
|
|
115112
115479
|
小写字母字符集
|
|
115113
115480
|
|
|
@@ -115124,7 +115491,7 @@ lib/core/variables/RANDOM_LN.md
|
|
|
115124
115491
|
|
|
115125
115492
|
> `const` **RANDOM\_LN**: `string`
|
|
115126
115493
|
|
|
115127
|
-
Defined in: [lib/core.ts:
|
|
115494
|
+
Defined in: [lib/core.ts:120](https://github.com/maiyunnet/kebab/blob/master/lib/core.ts#L120)
|
|
115128
115495
|
|
|
115129
115496
|
小写字母 + 数字字符集
|
|
115130
115497
|
|
|
@@ -115141,7 +115508,7 @@ lib/core/variables/RANDOM_LU.md
|
|
|
115141
115508
|
|
|
115142
115509
|
> `const` **RANDOM\_LU**: `string`
|
|
115143
115510
|
|
|
115144
|
-
Defined in: [lib/core.ts:
|
|
115511
|
+
Defined in: [lib/core.ts:122](https://github.com/maiyunnet/kebab/blob/master/lib/core.ts#L122)
|
|
115145
115512
|
|
|
115146
115513
|
小写字母 + 大写字母字符集
|
|
115147
115514
|
|
|
@@ -115158,7 +115525,7 @@ lib/core/variables/RANDOM_LUN.md
|
|
|
115158
115525
|
|
|
115159
115526
|
> `const` **RANDOM\_LUN**: `string`
|
|
115160
115527
|
|
|
115161
|
-
Defined in: [lib/core.ts:
|
|
115528
|
+
Defined in: [lib/core.ts:124](https://github.com/maiyunnet/kebab/blob/master/lib/core.ts#L124)
|
|
115162
115529
|
|
|
115163
115530
|
小写字母 + 大写字母 + 数字字符集
|
|
115164
115531
|
|
|
@@ -115175,7 +115542,7 @@ lib/core/variables/RANDOM_LUNS.md
|
|
|
115175
115542
|
|
|
115176
115543
|
> `const` **RANDOM\_LUNS**: `string`
|
|
115177
115544
|
|
|
115178
|
-
Defined in: [lib/core.ts:
|
|
115545
|
+
Defined in: [lib/core.ts:128](https://github.com/maiyunnet/kebab/blob/master/lib/core.ts#L128)
|
|
115179
115546
|
|
|
115180
115547
|
小写字母 + 大写字母 + 数字字符集 + 特殊字符字符集
|
|
115181
115548
|
|
|
@@ -115192,7 +115559,7 @@ lib/core/variables/RANDOM_N.md
|
|
|
115192
115559
|
|
|
115193
115560
|
> `const` **RANDOM\_N**: `"0123456789"` = `'0123456789'`
|
|
115194
115561
|
|
|
115195
|
-
Defined in: [lib/core.ts:
|
|
115562
|
+
Defined in: [lib/core.ts:111](https://github.com/maiyunnet/kebab/blob/master/lib/core.ts#L111)
|
|
115196
115563
|
|
|
115197
115564
|
数字字符集
|
|
115198
115565
|
|
|
@@ -115209,7 +115576,7 @@ lib/core/variables/RANDOM_U.md
|
|
|
115209
115576
|
|
|
115210
115577
|
> `const` **RANDOM\_U**: `"ABCDEFGHIJKLMNOPQRSTUVWXYZ"` = `'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
|
|
115211
115578
|
|
|
115212
|
-
Defined in: [lib/core.ts:
|
|
115579
|
+
Defined in: [lib/core.ts:113](https://github.com/maiyunnet/kebab/blob/master/lib/core.ts#L113)
|
|
115213
115580
|
|
|
115214
115581
|
大写字母字符集
|
|
115215
115582
|
|
|
@@ -115226,7 +115593,7 @@ lib/core/variables/RANDOM_UN.md
|
|
|
115226
115593
|
|
|
115227
115594
|
> `const` **RANDOM\_UN**: `string`
|
|
115228
115595
|
|
|
115229
|
-
Defined in: [lib/core.ts:
|
|
115596
|
+
Defined in: [lib/core.ts:118](https://github.com/maiyunnet/kebab/blob/master/lib/core.ts#L118)
|
|
115230
115597
|
|
|
115231
115598
|
大写字母 + 数字字符集
|
|
115232
115599
|
|
|
@@ -115243,7 +115610,7 @@ lib/core/variables/RANDOM_V.md
|
|
|
115243
115610
|
|
|
115244
115611
|
> `const` **RANDOM\_V**: `"ACEFGHJKLMNPRSTWXY34567"` = `'ACEFGHJKLMNPRSTWXY34567'`
|
|
115245
115612
|
|
|
115246
|
-
Defined in: [lib/core.ts:
|
|
115613
|
+
Defined in: [lib/core.ts:126](https://github.com/maiyunnet/kebab/blob/master/lib/core.ts#L126)
|
|
115247
115614
|
|
|
115248
115615
|
验证码字符集
|
|
115249
115616
|
|
|
@@ -115260,7 +115627,7 @@ lib/core/variables/REAL_IP_CF.md
|
|
|
115260
115627
|
|
|
115261
115628
|
> `const` **REAL\_IP\_CF**: `"cf-connecting-ip"` = `'cf-connecting-ip'`
|
|
115262
115629
|
|
|
115263
|
-
Defined in: [lib/core.ts:
|
|
115630
|
+
Defined in: [lib/core.ts:407](https://github.com/maiyunnet/kebab/blob/master/lib/core.ts#L407)
|
|
115264
115631
|
|
|
115265
115632
|
使用的是 Cloudflare
|
|
115266
115633
|
|
|
@@ -115277,7 +115644,7 @@ lib/core/variables/REAL_IP_EO.md
|
|
|
115277
115644
|
|
|
115278
115645
|
> `const` **REAL\_IP\_EO**: `"eo-connecting-ip"` = `'eo-connecting-ip'`
|
|
115279
115646
|
|
|
115280
|
-
Defined in: [lib/core.ts:
|
|
115647
|
+
Defined in: [lib/core.ts:409](https://github.com/maiyunnet/kebab/blob/master/lib/core.ts#L409)
|
|
115281
115648
|
|
|
115282
115649
|
使用的是 EO
|
|
115283
115650
|
|
|
@@ -115294,7 +115661,7 @@ lib/core/variables/REAL_IP_X.md
|
|
|
115294
115661
|
|
|
115295
115662
|
> `const` **REAL\_IP\_X**: `"x-forwarded-for"` = `'x-forwarded-for'`
|
|
115296
115663
|
|
|
115297
|
-
Defined in: [lib/core.ts:
|
|
115664
|
+
Defined in: [lib/core.ts:405](https://github.com/maiyunnet/kebab/blob/master/lib/core.ts#L405)
|
|
115298
115665
|
|
|
115299
115666
|
使用 X-Forwarded-For 的 CDN 厂商
|
|
115300
115667
|
|
|
@@ -124024,7 +124391,7 @@ Defined in: [lib/sql.ts:76](https://github.com/maiyunnet/kebab/blob/master/lib/s
|
|
|
124024
124391
|
|
|
124025
124392
|
> **append**(`sql`): `this`
|
|
124026
124393
|
|
|
124027
|
-
Defined in: [lib/sql.ts:
|
|
124394
|
+
Defined in: [lib/sql.ts:1127](https://github.com/maiyunnet/kebab/blob/master/lib/sql.ts#L1127)
|
|
124028
124395
|
|
|
124029
124396
|
在 sql 最后追加字符串
|
|
124030
124397
|
|
|
@@ -124044,7 +124411,7 @@ Defined in: [lib/sql.ts:1126](https://github.com/maiyunnet/kebab/blob/master/lib
|
|
|
124044
124411
|
|
|
124045
124412
|
> **by**(`c`, `d?`): `this`
|
|
124046
124413
|
|
|
124047
|
-
Defined in: [lib/sql.ts:
|
|
124414
|
+
Defined in: [lib/sql.ts:814](https://github.com/maiyunnet/kebab/blob/master/lib/sql.ts#L814)
|
|
124048
124415
|
|
|
124049
124416
|
ORDER BY
|
|
124050
124417
|
|
|
@@ -124072,7 +124439,7 @@ ORDER BY
|
|
|
124072
124439
|
|
|
124073
124440
|
> **copy**(`f?`, `opt?`): `Sql`
|
|
124074
124441
|
|
|
124075
|
-
Defined in: [lib/sql.ts:
|
|
124442
|
+
Defined in: [lib/sql.ts:933](https://github.com/maiyunnet/kebab/blob/master/lib/sql.ts#L933)
|
|
124076
124443
|
|
|
124077
124444
|
创建一个本对象的一个新的 sql 对象拷贝
|
|
124078
124445
|
|
|
@@ -124174,7 +124541,7 @@ Defined in: [lib/sql.ts:420](https://github.com/maiyunnet/kebab/blob/master/lib/
|
|
|
124174
124541
|
|
|
124175
124542
|
> **field**(`str`, `pre?`, `suf?`): `string`
|
|
124176
124543
|
|
|
124177
|
-
Defined in: [lib/sql.ts:
|
|
124544
|
+
Defined in: [lib/sql.ts:1138](https://github.com/maiyunnet/kebab/blob/master/lib/sql.ts#L1138)
|
|
124178
124545
|
|
|
124179
124546
|
对字段进行包裹
|
|
124180
124547
|
|
|
@@ -124206,7 +124573,7 @@ MySQL 时为表前缀,PostgreSQL 时为 Schema 名,仅请在 field 表名时
|
|
|
124206
124573
|
|
|
124207
124574
|
> **format**(`sql?`, `data?`): `string`
|
|
124208
124575
|
|
|
124209
|
-
Defined in: [lib/sql.ts:
|
|
124576
|
+
Defined in: [lib/sql.ts:1117](https://github.com/maiyunnet/kebab/blob/master/lib/sql.ts#L1117)
|
|
124210
124577
|
|
|
124211
124578
|
获取带 data 的 sql 语句
|
|
124212
124579
|
|
|
@@ -124270,7 +124637,7 @@ MySQL 时为表前缀,PostgreSQL 时为 Schema 名,仅在 join 非默认前
|
|
|
124270
124637
|
|
|
124271
124638
|
> **getData**(): [`DbValue`](../../../index/type-aliases/DbValue.md)[]
|
|
124272
124639
|
|
|
124273
|
-
Defined in: [lib/sql.ts:
|
|
124640
|
+
Defined in: [lib/sql.ts:1101](https://github.com/maiyunnet/kebab/blob/master/lib/sql.ts#L1101)
|
|
124274
124641
|
|
|
124275
124642
|
获取全部 data
|
|
124276
124643
|
|
|
@@ -124284,7 +124651,7 @@ Defined in: [lib/sql.ts:1100](https://github.com/maiyunnet/kebab/blob/master/lib
|
|
|
124284
124651
|
|
|
124285
124652
|
> **getPre**(): `string`
|
|
124286
124653
|
|
|
124287
|
-
Defined in: [lib/sql.ts:
|
|
124654
|
+
Defined in: [lib/sql.ts:1108](https://github.com/maiyunnet/kebab/blob/master/lib/sql.ts#L1108)
|
|
124288
124655
|
|
|
124289
124656
|
获取定义的 pre
|
|
124290
124657
|
|
|
@@ -124298,7 +124665,7 @@ Defined in: [lib/sql.ts:1107](https://github.com/maiyunnet/kebab/blob/master/lib
|
|
|
124298
124665
|
|
|
124299
124666
|
> **getSql**(): `string`
|
|
124300
124667
|
|
|
124301
|
-
Defined in: [lib/sql.ts:
|
|
124668
|
+
Defined in: [lib/sql.ts:1081](https://github.com/maiyunnet/kebab/blob/master/lib/sql.ts#L1081)
|
|
124302
124669
|
|
|
124303
124670
|
获取 sql 语句
|
|
124304
124671
|
|
|
@@ -124312,7 +124679,7 @@ Defined in: [lib/sql.ts:1080](https://github.com/maiyunnet/kebab/blob/master/lib
|
|
|
124312
124679
|
|
|
124313
124680
|
> **group**(`c`): `this`
|
|
124314
124681
|
|
|
124315
|
-
Defined in: [lib/sql.ts:
|
|
124682
|
+
Defined in: [lib/sql.ts:889](https://github.com/maiyunnet/kebab/blob/master/lib/sql.ts#L889)
|
|
124316
124683
|
|
|
124317
124684
|
GROUP BY
|
|
124318
124685
|
|
|
@@ -124553,7 +124920,7 @@ MySQL 时为表前缀,PostgreSQL 时为 Schema 名,仅在 join 非默认前
|
|
|
124553
124920
|
|
|
124554
124921
|
> **limit**(`a`, `b?`): `this`
|
|
124555
124922
|
|
|
124556
|
-
Defined in: [lib/sql.ts:
|
|
124923
|
+
Defined in: [lib/sql.ts:909](https://github.com/maiyunnet/kebab/blob/master/lib/sql.ts#L909)
|
|
124557
124924
|
|
|
124558
124925
|
LIMIT(limit、offset, limit)
|
|
124559
124926
|
|
|
@@ -124581,7 +124948,7 @@ LIMIT(limit、offset, limit)
|
|
|
124581
124948
|
|
|
124582
124949
|
> **lock**(): `this`
|
|
124583
124950
|
|
|
124584
|
-
Defined in: [lib/sql.ts:
|
|
124951
|
+
Defined in: [lib/sql.ts:924](https://github.com/maiyunnet/kebab/blob/master/lib/sql.ts#L924)
|
|
124585
124952
|
|
|
124586
124953
|
追加消极锁,通常不建议使用
|
|
124587
124954
|
|
|
@@ -124635,7 +125002,7 @@ MySQL 时为表前缀,PostgreSQL 时为 Schema 名,仅在 join 非默认前
|
|
|
124635
125002
|
|
|
124636
125003
|
> **seek**(`c`, `values?`, `d?`): `this`
|
|
124637
125004
|
|
|
124638
|
-
Defined in: [lib/sql.ts:
|
|
125005
|
+
Defined in: [lib/sql.ts:842](https://github.com/maiyunnet/kebab/blob/master/lib/sql.ts#L842)
|
|
124639
125006
|
|
|
124640
125007
|
按非空、同向排序字段定位游标并设置排序;字段组合须唯一且有匹配索引
|
|
124641
125008
|
使用行比较,让 PostgreSQL 可以从复合索引边界开始扫描
|
|
@@ -124877,10 +125244,11 @@ Defined in: [lib/sql.ts:154](https://github.com/maiyunnet/kebab/blob/master/lib/
|
|
|
124877
125244
|
|
|
124878
125245
|
> **where**(`s`): `this`
|
|
124879
125246
|
|
|
124880
|
-
Defined in: [lib/sql.ts:
|
|
125247
|
+
Defined in: [lib/sql.ts:573](https://github.com/maiyunnet/kebab/blob/master/lib/sql.ts#L573)
|
|
124881
125248
|
|
|
124882
125249
|
筛选器
|
|
124883
|
-
|
|
125250
|
+
等值条件:'city': 'bj';字符串、数字、布尔值、bigint、Date 和 Buffer 均作为单个参数
|
|
125251
|
+
null 生成 IS NULL,数组生成 IN 条件
|
|
124884
125252
|
运算符条件:['type', '>', '1']
|
|
124885
125253
|
集合条件:['type', 'in', ['1', '2']] 或 'type': ['1', '2']
|
|
124886
125254
|
逻辑分组:'$or': [{'city': 'bj'}, {'city': 'sh'}, [['age', '>', '10']]]
|
|
@@ -125019,7 +125387,7 @@ lib/sql/functions/aoMix.md
|
|
|
125019
125387
|
|
|
125020
125388
|
> **aoMix**(`arr`): `Record`\<`string`, `string` \| `number` \| [`Json`](../../../index/type-aliases/Json.md)\>
|
|
125021
125389
|
|
|
125022
|
-
Defined in: [lib/sql.ts:
|
|
125390
|
+
Defined in: [lib/sql.ts:1487](https://github.com/maiyunnet/kebab/blob/master/lib/sql.ts#L1487)
|
|
125023
125391
|
|
|
125024
125392
|
将数组兑换为组合的对象(Array/Object mix)
|
|
125025
125393
|
|
|
@@ -125048,7 +125416,7 @@ lib/sql/functions/column.md
|
|
|
125048
125416
|
|
|
125049
125417
|
> **column**(`field`): `object`
|
|
125050
125418
|
|
|
125051
|
-
Defined in: [lib/sql.ts:
|
|
125419
|
+
Defined in: [lib/sql.ts:1508](https://github.com/maiyunnet/kebab/blob/master/lib/sql.ts#L1508)
|
|
125052
125420
|
|
|
125053
125421
|
创建字段对象
|
|
125054
125422
|
|
|
@@ -125087,7 +125455,7 @@ lib/sql/functions/format.md
|
|
|
125087
125455
|
|
|
125088
125456
|
> **format**(`sql`, `data`, `service?`): `string`
|
|
125089
125457
|
|
|
125090
|
-
Defined in: [lib/sql.ts:
|
|
125458
|
+
Defined in: [lib/sql.ts:1448](https://github.com/maiyunnet/kebab/blob/master/lib/sql.ts#L1448)
|
|
125091
125459
|
|
|
125092
125460
|
返回代入后的完整 SQL 字符串,这并不安全不能直接执行,只是用来调试打印 sql 语句
|
|
125093
125461
|
|
|
@@ -125128,7 +125496,7 @@ lib/sql/functions/get.md
|
|
|
125128
125496
|
|
|
125129
125497
|
> **get**(`opt`): [`Sql`](../classes/Sql.md)
|
|
125130
125498
|
|
|
125131
|
-
Defined in: [lib/sql.ts:
|
|
125499
|
+
Defined in: [lib/sql.ts:1420](https://github.com/maiyunnet/kebab/blob/master/lib/sql.ts#L1420)
|
|
125132
125500
|
|
|
125133
125501
|
创建 sql 对象
|
|
125134
125502
|
|
|
@@ -125181,7 +125549,7 @@ lib/sql/functions/json.md
|
|
|
125181
125549
|
|
|
125182
125550
|
> **json**\<`T`\>(`obj`): `T`
|
|
125183
125551
|
|
|
125184
|
-
Defined in: [lib/sql.ts:
|
|
125552
|
+
Defined in: [lib/sql.ts:1547](https://github.com/maiyunnet/kebab/blob/master/lib/sql.ts#L1547)
|
|
125185
125553
|
|
|
125186
125554
|
标记需要写入 JSON/jsonb 字段的值;实际序列化延迟到数据库边界
|
|
125187
125555
|
|
|
@@ -125218,7 +125586,7 @@ lib/sql/functions/value.md
|
|
|
125218
125586
|
|
|
125219
125587
|
> **value**(`val`): `object`
|
|
125220
125588
|
|
|
125221
|
-
Defined in: [lib/sql.ts:
|
|
125589
|
+
Defined in: [lib/sql.ts:1527](https://github.com/maiyunnet/kebab/blob/master/lib/sql.ts#L1527)
|
|
125222
125590
|
|
|
125223
125591
|
创建字面量值对象,用于 where 条件中 v[0] 需要是值而非字段名的场景
|
|
125224
125592
|
例:[value('hello'), 'IN', column('tags')]
|
|
@@ -126610,7 +126978,7 @@ lib/text/functions/compareVersion.md
|
|
|
126610
126978
|
|
|
126611
126979
|
> **compareVersion**(`version`, `target`): `0` \| `1` \| `-1` \| `null`
|
|
126612
126980
|
|
|
126613
|
-
Defined in: [lib/text.ts:
|
|
126981
|
+
Defined in: [lib/text.ts:37](https://github.com/maiyunnet/kebab/blob/master/lib/text.ts#L37)
|
|
126614
126982
|
|
|
126615
126983
|
逐段比较三段正式发行版本 X.Y.Z,不按字符串或浮点数比较
|
|
126616
126984
|
|
|
@@ -126647,7 +127015,7 @@ lib/text/functions/csvescape.md
|
|
|
126647
127015
|
|
|
126648
127016
|
> **csvescape**(`str`): `string`
|
|
126649
127017
|
|
|
126650
|
-
Defined in: [lib/text.ts:
|
|
127018
|
+
Defined in: [lib/text.ts:549](https://github.com/maiyunnet/kebab/blob/master/lib/text.ts#L549)
|
|
126651
127019
|
|
|
126652
127020
|
CSV 特殊字符转换为实体字符
|
|
126653
127021
|
|
|
@@ -126674,7 +127042,7 @@ lib/text/functions/getFileExt.md
|
|
|
126674
127042
|
|
|
126675
127043
|
> **getFileExt**(`path`): `string`
|
|
126676
127044
|
|
|
126677
|
-
Defined in: [lib/text.ts:
|
|
127045
|
+
Defined in: [lib/text.ts:590](https://github.com/maiyunnet/kebab/blob/master/lib/text.ts#L590)
|
|
126678
127046
|
|
|
126679
127047
|
获取文件后缀
|
|
126680
127048
|
|
|
@@ -126703,7 +127071,7 @@ lib/text/functions/getFileNameExt.md
|
|
|
126703
127071
|
|
|
126704
127072
|
> **getFileNameExt**(`path`): `object`
|
|
126705
127073
|
|
|
126706
|
-
Defined in: [lib/text.ts:
|
|
127074
|
+
Defined in: [lib/text.ts:603](https://github.com/maiyunnet/kebab/blob/master/lib/text.ts#L603)
|
|
126707
127075
|
|
|
126708
127076
|
获取文件名和后缀
|
|
126709
127077
|
|
|
@@ -126740,7 +127108,7 @@ lib/text/functions/getFilename.md
|
|
|
126740
127108
|
|
|
126741
127109
|
> **getFilename**(`path`, `ext?`): `string`
|
|
126742
127110
|
|
|
126743
|
-
Defined in: [lib/text.ts:
|
|
127111
|
+
Defined in: [lib/text.ts:570](https://github.com/maiyunnet/kebab/blob/master/lib/text.ts#L570)
|
|
126744
127112
|
|
|
126745
127113
|
获取文件名
|
|
126746
127114
|
|
|
@@ -126775,7 +127143,7 @@ lib/text/functions/htmlescape.md
|
|
|
126775
127143
|
|
|
126776
127144
|
> **htmlescape**(`html`): `string`
|
|
126777
127145
|
|
|
126778
|
-
Defined in: [lib/text.ts:
|
|
127146
|
+
Defined in: [lib/text.ts:535](https://github.com/maiyunnet/kebab/blob/master/lib/text.ts#L535)
|
|
126779
127147
|
|
|
126780
127148
|
HTML 特殊字符转换为实体字符
|
|
126781
127149
|
|
|
@@ -126804,7 +127172,7 @@ lib/text/functions/int2str.md
|
|
|
126804
127172
|
|
|
126805
127173
|
> **int2str**(`int`, `digits?`, `decimal?`): `string`
|
|
126806
127174
|
|
|
126807
|
-
Defined in: [lib/text.ts:
|
|
127175
|
+
Defined in: [lib/text.ts:803](https://github.com/maiyunnet/kebab/blob/master/lib/text.ts#L803)
|
|
126808
127176
|
|
|
126809
127177
|
为解决精度问题,将整数转换为小数字符串
|
|
126810
127178
|
以下几个示例都是当 digits 为 3、decimal 为 2 时
|
|
@@ -126850,7 +127218,7 @@ lib/text/functions/isAscii.md
|
|
|
126850
127218
|
|
|
126851
127219
|
> **isAscii**(`text`): `boolean`
|
|
126852
127220
|
|
|
126853
|
-
Defined in: [lib/text.ts:
|
|
127221
|
+
Defined in: [lib/text.ts:337](https://github.com/maiyunnet/kebab/blob/master/lib/text.ts#L337)
|
|
126854
127222
|
|
|
126855
127223
|
判断是否在 ascii 字符集内,仅可输入部分
|
|
126856
127224
|
|
|
@@ -126879,7 +127247,7 @@ lib/text/functions/isDomain.md
|
|
|
126879
127247
|
|
|
126880
127248
|
> **isDomain**(`domain`): `boolean`
|
|
126881
127249
|
|
|
126882
|
-
Defined in: [lib/text.ts:
|
|
127250
|
+
Defined in: [lib/text.ts:326](https://github.com/maiyunnet/kebab/blob/master/lib/text.ts#L326)
|
|
126883
127251
|
|
|
126884
127252
|
判断是否是域名
|
|
126885
127253
|
|
|
@@ -126910,7 +127278,7 @@ lib/text/functions/isEMail.md
|
|
|
126910
127278
|
|
|
126911
127279
|
> **isEMail**(`email`): `boolean`
|
|
126912
127280
|
|
|
126913
|
-
Defined in: [lib/text.ts:
|
|
127281
|
+
Defined in: [lib/text.ts:299](https://github.com/maiyunnet/kebab/blob/master/lib/text.ts#L299)
|
|
126914
127282
|
|
|
126915
127283
|
是否是邮件地址
|
|
126916
127284
|
|
|
@@ -126937,7 +127305,7 @@ lib/text/functions/isFalsy.md
|
|
|
126937
127305
|
|
|
126938
127306
|
> **isFalsy**(`val`): `val is TFalsy`
|
|
126939
127307
|
|
|
126940
|
-
Defined in: [lib/text.ts:
|
|
127308
|
+
Defined in: [lib/text.ts:754](https://github.com/maiyunnet/kebab/blob/master/lib/text.ts#L754)
|
|
126941
127309
|
|
|
126942
127310
|
判断一个值是否是虚假的(为 null/undefined/空字符串/false/0)
|
|
126943
127311
|
|
|
@@ -126966,7 +127334,7 @@ lib/text/functions/isIdCardCN.md
|
|
|
126966
127334
|
|
|
126967
127335
|
> **isIdCardCN**(`idcard`): `boolean`
|
|
126968
127336
|
|
|
126969
|
-
Defined in: [lib/text.ts:
|
|
127337
|
+
Defined in: [lib/text.ts:449](https://github.com/maiyunnet/kebab/blob/master/lib/text.ts#L449)
|
|
126970
127338
|
|
|
126971
127339
|
是否是中国大陆身份证号码
|
|
126972
127340
|
|
|
@@ -126995,7 +127363,7 @@ lib/text/functions/isIPv4.md
|
|
|
126995
127363
|
|
|
126996
127364
|
> **isIPv4**(`ip`): `boolean`
|
|
126997
127365
|
|
|
126998
|
-
Defined in: [lib/text.ts:
|
|
127366
|
+
Defined in: [lib/text.ts:307](https://github.com/maiyunnet/kebab/blob/master/lib/text.ts#L307)
|
|
126999
127367
|
|
|
127000
127368
|
是否是 IPv4(基于 Node 原生 net.isIPv4,严格校验)
|
|
127001
127369
|
|
|
@@ -127022,7 +127390,7 @@ lib/text/functions/isIPv6.md
|
|
|
127022
127390
|
|
|
127023
127391
|
> **isIPv6**(`ip`): `boolean`
|
|
127024
127392
|
|
|
127025
|
-
Defined in: [lib/text.ts:
|
|
127393
|
+
Defined in: [lib/text.ts:315](https://github.com/maiyunnet/kebab/blob/master/lib/text.ts#L315)
|
|
127026
127394
|
|
|
127027
127395
|
是否是 IPv6(基于 Node 原生 net.isIPv6,严格校验)
|
|
127028
127396
|
|
|
@@ -127049,7 +127417,7 @@ lib/text/functions/isPhoneCN.md
|
|
|
127049
127417
|
|
|
127050
127418
|
> **isPhoneCN**(`p`): `boolean`
|
|
127051
127419
|
|
|
127052
|
-
Defined in: [lib/text.ts:
|
|
127420
|
+
Defined in: [lib/text.ts:441](https://github.com/maiyunnet/kebab/blob/master/lib/text.ts#L441)
|
|
127053
127421
|
|
|
127054
127422
|
判断手机号是否是 11 位,不做真实性校验
|
|
127055
127423
|
|
|
@@ -127078,7 +127446,7 @@ lib/text/functions/isRealPath.md
|
|
|
127078
127446
|
|
|
127079
127447
|
> **isRealPath**(`path`): `boolean`
|
|
127080
127448
|
|
|
127081
|
-
Defined in: [lib/text.ts:
|
|
127449
|
+
Defined in: [lib/text.ts:557](https://github.com/maiyunnet/kebab/blob/master/lib/text.ts#L557)
|
|
127082
127450
|
|
|
127083
127451
|
判断是否是绝对路径,是返回 true,相对路径返回 false
|
|
127084
127452
|
|
|
@@ -127107,7 +127475,7 @@ lib/text/functions/isSameOrigin.md
|
|
|
127107
127475
|
|
|
127108
127476
|
> **isSameOrigin**(`from`, `to`): `boolean`
|
|
127109
127477
|
|
|
127110
|
-
Defined in: [lib/text.ts:
|
|
127478
|
+
Defined in: [lib/text.ts:174](https://github.com/maiyunnet/kebab/blob/master/lib/text.ts#L174)
|
|
127111
127479
|
|
|
127112
127480
|
判断两个 URL 是否属于同源地址
|
|
127113
127481
|
|
|
@@ -127142,7 +127510,7 @@ lib/text/functions/isTruthy.md
|
|
|
127142
127510
|
|
|
127143
127511
|
> **isTruthy**\<`T`\>(`val`): `val is Exclude<T, TFalsy>`
|
|
127144
127512
|
|
|
127145
|
-
Defined in: [lib/text.ts:
|
|
127513
|
+
Defined in: [lib/text.ts:762](https://github.com/maiyunnet/kebab/blob/master/lib/text.ts#L762)
|
|
127146
127514
|
|
|
127147
127515
|
判断一个值是否是真实的(不为 null/undefined/空字符串/false/0)
|
|
127148
127516
|
|
|
@@ -127177,7 +127545,7 @@ lib/text/functions/logicalOr.md
|
|
|
127177
127545
|
|
|
127178
127546
|
> **logicalOr**\<`T`, `T2`\>(`v1`, `v2`): `T` *extends* [`TFalsy`](../type-aliases/TFalsy.md) ? `T2` : `T`
|
|
127179
127547
|
|
|
127180
|
-
Defined in: [lib/text.ts:
|
|
127548
|
+
Defined in: [lib/text.ts:771](https://github.com/maiyunnet/kebab/blob/master/lib/text.ts#L771)
|
|
127181
127549
|
|
|
127182
127550
|
类似 || 运算符的效果
|
|
127183
127551
|
|
|
@@ -127222,7 +127590,7 @@ lib/text/functions/match.md
|
|
|
127222
127590
|
|
|
127223
127591
|
> **match**(`str`, `regs`): `boolean`
|
|
127224
127592
|
|
|
127225
|
-
Defined in: [lib/text.ts:
|
|
127593
|
+
Defined in: [lib/text.ts:426](https://github.com/maiyunnet/kebab/blob/master/lib/text.ts#L426)
|
|
127226
127594
|
|
|
127227
127595
|
传入正则进行匹配 str 是否有一项满足
|
|
127228
127596
|
|
|
@@ -127257,7 +127625,7 @@ lib/text/functions/nlReplace.md
|
|
|
127257
127625
|
|
|
127258
127626
|
> **nlReplace**(`str`, `to?`): `string`
|
|
127259
127627
|
|
|
127260
|
-
Defined in: [lib/text.ts:
|
|
127628
|
+
Defined in: [lib/text.ts:346](https://github.com/maiyunnet/kebab/blob/master/lib/text.ts#L346)
|
|
127261
127629
|
|
|
127262
127630
|
换行替换为别的
|
|
127263
127631
|
|
|
@@ -127292,7 +127660,7 @@ lib/text/functions/parseDomain.md
|
|
|
127292
127660
|
|
|
127293
127661
|
> **parseDomain**(`domain`): `Promise`\<[`IDomain`](../interfaces/IDomain.md)\>
|
|
127294
127662
|
|
|
127295
|
-
Defined in: [lib/text.ts:
|
|
127663
|
+
Defined in: [lib/text.ts:369](https://github.com/maiyunnet/kebab/blob/master/lib/text.ts#L369)
|
|
127296
127664
|
|
|
127297
127665
|
解析域名并获取 tld/sld/domain/sub
|
|
127298
127666
|
|
|
@@ -127321,7 +127689,7 @@ lib/text/functions/parseHost.md
|
|
|
127321
127689
|
|
|
127322
127690
|
> **parseHost**(`host`): `object`
|
|
127323
127691
|
|
|
127324
|
-
Defined in: [lib/text.ts:
|
|
127692
|
+
Defined in: [lib/text.ts:70](https://github.com/maiyunnet/kebab/blob/master/lib/text.ts#L70)
|
|
127325
127693
|
|
|
127326
127694
|
解析主机名和端口号
|
|
127327
127695
|
|
|
@@ -127362,7 +127730,7 @@ lib/text/functions/parseJson.md
|
|
|
127362
127730
|
|
|
127363
127731
|
> **parseJson**\<`T`\>(`str`): `false` \| `T`
|
|
127364
127732
|
|
|
127365
|
-
Defined in: [lib/text.ts:
|
|
127733
|
+
Defined in: [lib/text.ts:666](https://github.com/maiyunnet/kebab/blob/master/lib/text.ts#L666)
|
|
127366
127734
|
|
|
127367
127735
|
解析 JSON,超出安全整数范围的整数字面量转换为 BigInt
|
|
127368
127736
|
|
|
@@ -127399,7 +127767,7 @@ lib/text/functions/parseUrl.md
|
|
|
127399
127767
|
|
|
127400
127768
|
> **parseUrl**(`url`): [`IUrlParse`](../../../index/interfaces/IUrlParse.md)
|
|
127401
127769
|
|
|
127402
|
-
Defined in: [lib/text.ts:
|
|
127770
|
+
Defined in: [lib/text.ts:96](https://github.com/maiyunnet/kebab/blob/master/lib/text.ts#L96)
|
|
127403
127771
|
|
|
127404
127772
|
格式化一段 URL
|
|
127405
127773
|
|
|
@@ -127426,7 +127794,7 @@ lib/text/functions/parseVersion.md
|
|
|
127426
127794
|
|
|
127427
127795
|
> **parseVersion**(`value`): \[`number`, `number`, `number`\] \| `null`
|
|
127428
127796
|
|
|
127429
|
-
Defined in: [lib/text.ts:
|
|
127797
|
+
Defined in: [lib/text.ts:18](https://github.com/maiyunnet/kebab/blob/master/lib/text.ts#L18)
|
|
127430
127798
|
|
|
127431
127799
|
解析三段正式发行版本 X.Y.Z,不接受前导零、预发行和构建后缀
|
|
127432
127800
|
|
|
@@ -127457,7 +127825,7 @@ lib/text/functions/queryParse.md
|
|
|
127457
127825
|
|
|
127458
127826
|
> **queryParse**(`query`): `Record`\<`string`, `string` \| `string`[]\>
|
|
127459
127827
|
|
|
127460
|
-
Defined in: [lib/text.ts:
|
|
127828
|
+
Defined in: [lib/text.ts:527](https://github.com/maiyunnet/kebab/blob/master/lib/text.ts#L527)
|
|
127461
127829
|
|
|
127462
127830
|
将 query string 转换为对象
|
|
127463
127831
|
|
|
@@ -127467,12 +127835,14 @@ Defined in: [lib/text.ts:519](https://github.com/maiyunnet/kebab/blob/master/lib
|
|
|
127467
127835
|
|
|
127468
127836
|
`string`
|
|
127469
127837
|
|
|
127470
|
-
|
|
127838
|
+
要转换的字符串,+ 表示空格,%2B 表示加号
|
|
127471
127839
|
|
|
127472
127840
|
## Returns
|
|
127473
127841
|
|
|
127474
127842
|
`Record`\<`string`, `string` \| `string`[]\>
|
|
127475
127843
|
|
|
127844
|
+
查询参数对象,重复键对应字符串数组
|
|
127845
|
+
|
|
127476
127846
|
lib/text/functions/queryStringify.md
|
|
127477
127847
|
---
|
|
127478
127848
|
|
|
@@ -127488,7 +127858,7 @@ lib/text/functions/queryStringify.md
|
|
|
127488
127858
|
|
|
127489
127859
|
> **queryStringify**(`query`, `encode?`): `string`
|
|
127490
127860
|
|
|
127491
|
-
Defined in: [lib/text.ts:
|
|
127861
|
+
Defined in: [lib/text.ts:477](https://github.com/maiyunnet/kebab/blob/master/lib/text.ts#L477)
|
|
127492
127862
|
|
|
127493
127863
|
将对象转换为 query string
|
|
127494
127864
|
|
|
@@ -127514,7 +127884,7 @@ Defined in: [lib/text.ts:470](https://github.com/maiyunnet/kebab/blob/master/lib
|
|
|
127514
127884
|
|
|
127515
127885
|
> **queryStringify**(`query`, `options`): `string`
|
|
127516
127886
|
|
|
127517
|
-
Defined in: [lib/text.ts:
|
|
127887
|
+
Defined in: [lib/text.ts:483](https://github.com/maiyunnet/kebab/blob/master/lib/text.ts#L483)
|
|
127518
127888
|
|
|
127519
127889
|
将对象转换为 query string
|
|
127520
127890
|
|
|
@@ -127559,7 +127929,7 @@ lib/text/functions/redact.md
|
|
|
127559
127929
|
|
|
127560
127930
|
> **redact**(`value`, `secrets`, `options?`): `string`
|
|
127561
127931
|
|
|
127562
|
-
Defined in: [lib/text.ts:
|
|
127932
|
+
Defined in: [lib/text.ts:841](https://github.com/maiyunnet/kebab/blob/master/lib/text.ts#L841)
|
|
127563
127933
|
|
|
127564
127934
|
将文本中的指定敏感字符串替换为占位文本
|
|
127565
127935
|
|
|
@@ -127614,7 +127984,7 @@ lib/text/functions/sizeFormat.md
|
|
|
127614
127984
|
|
|
127615
127985
|
> **sizeFormat**(`size`, `spliter?`): `string`
|
|
127616
127986
|
|
|
127617
|
-
Defined in: [lib/text.ts:
|
|
127987
|
+
Defined in: [lib/text.ts:56](https://github.com/maiyunnet/kebab/blob/master/lib/text.ts#L56)
|
|
127618
127988
|
|
|
127619
127989
|
将文件大小格式化为带单位的字符串
|
|
127620
127990
|
|
|
@@ -127649,7 +128019,7 @@ lib/text/functions/str2int.md
|
|
|
127649
128019
|
|
|
127650
128020
|
> **str2int**(`str`, `digits?`): `number`
|
|
127651
128021
|
|
|
127652
|
-
Defined in: [lib/text.ts:
|
|
128022
|
+
Defined in: [lib/text.ts:785](https://github.com/maiyunnet/kebab/blob/master/lib/text.ts#L785)
|
|
127653
128023
|
|
|
127654
128024
|
为解决精度问题,将字符串数字转换为整数显示
|
|
127655
128025
|
以下几个示例都是当 digits 为 2 时
|
|
@@ -127689,7 +128059,7 @@ lib/text/functions/stringifyBuffer.md
|
|
|
127689
128059
|
|
|
127690
128060
|
> **stringifyBuffer**(`buf`): `string`
|
|
127691
128061
|
|
|
127692
|
-
Defined in: [lib/text.ts:
|
|
128062
|
+
Defined in: [lib/text.ts:708](https://github.com/maiyunnet/kebab/blob/master/lib/text.ts#L708)
|
|
127693
128063
|
|
|
127694
128064
|
输出文本格式的 buffer
|
|
127695
128065
|
|
|
@@ -127718,7 +128088,7 @@ lib/text/functions/stringifyError.md
|
|
|
127718
128088
|
|
|
127719
128089
|
> **stringifyError**(`error`): `string`
|
|
127720
128090
|
|
|
127721
|
-
Defined in: [lib/text.ts:
|
|
128091
|
+
Defined in: [lib/text.ts:685](https://github.com/maiyunnet/kebab/blob/master/lib/text.ts#L685)
|
|
127722
128092
|
|
|
127723
128093
|
将未知异常转换为适合单行日志的文本,Error 优先返回完整堆栈
|
|
127724
128094
|
|
|
@@ -127749,7 +128119,7 @@ lib/text/functions/stringifyJson.md
|
|
|
127749
128119
|
|
|
127750
128120
|
> **stringifyJson**(`obj`, `space?`): `string`
|
|
127751
128121
|
|
|
127752
|
-
Defined in: [lib/text.ts:
|
|
128122
|
+
Defined in: [lib/text.ts:676](https://github.com/maiyunnet/kebab/blob/master/lib/text.ts#L676)
|
|
127753
128123
|
|
|
127754
128124
|
将对象转换为 JSON 字符串,BigInt 输出为整数字面量
|
|
127755
128125
|
|
|
@@ -127786,7 +128156,7 @@ lib/text/functions/stringifyResult.md
|
|
|
127786
128156
|
|
|
127787
128157
|
> **stringifyResult**(`rtn`): `string`
|
|
127788
128158
|
|
|
127789
|
-
Defined in: [lib/text.ts:
|
|
128159
|
+
Defined in: [lib/text.ts:625](https://github.com/maiyunnet/kebab/blob/master/lib/text.ts#L625)
|
|
127790
128160
|
|
|
127791
128161
|
将普通的返回 JSON 对象序列化为字符串
|
|
127792
128162
|
|
|
@@ -127815,7 +128185,7 @@ lib/text/functions/trimJson.md
|
|
|
127815
128185
|
|
|
127816
128186
|
> **trimJson**(`json`): `any`
|
|
127817
128187
|
|
|
127818
|
-
Defined in: [lib/text.ts:
|
|
128188
|
+
Defined in: [lib/text.ts:716](https://github.com/maiyunnet/kebab/blob/master/lib/text.ts#L716)
|
|
127819
128189
|
|
|
127820
128190
|
递归删除 json 中的字符串首尾空格,会返回一个新的对象
|
|
127821
128191
|
|
|
@@ -127842,7 +128212,7 @@ lib/text/functions/urlAtom.md
|
|
|
127842
128212
|
|
|
127843
128213
|
> **urlAtom**(`url`): `string`
|
|
127844
128214
|
|
|
127845
|
-
Defined in: [lib/text.ts:
|
|
128215
|
+
Defined in: [lib/text.ts:289](https://github.com/maiyunnet/kebab/blob/master/lib/text.ts#L289)
|
|
127846
128216
|
|
|
127847
128217
|
将路径中的 ../ ./ 都按规范妥善处理
|
|
127848
128218
|
|
|
@@ -127852,12 +128222,14 @@ Defined in: [lib/text.ts:273](https://github.com/maiyunnet/kebab/blob/master/lib
|
|
|
127852
128222
|
|
|
127853
128223
|
`string`
|
|
127854
128224
|
|
|
127855
|
-
|
|
128225
|
+
要处理的地址;相对路径保留无法抵消的 .. 段
|
|
127856
128226
|
|
|
127857
128227
|
## Returns
|
|
127858
128228
|
|
|
127859
128229
|
`string`
|
|
127860
128230
|
|
|
128231
|
+
规范化后的地址,查询和片段保持不变
|
|
128232
|
+
|
|
127861
128233
|
lib/text/functions/urlResolve.md
|
|
127862
128234
|
---
|
|
127863
128235
|
|
|
@@ -127871,7 +128243,7 @@ lib/text/functions/urlResolve.md
|
|
|
127871
128243
|
|
|
127872
128244
|
> **urlResolve**(`from`, `to`, `limit?`): `string`
|
|
127873
128245
|
|
|
127874
|
-
Defined in: [lib/text.ts:
|
|
128246
|
+
Defined in: [lib/text.ts:219](https://github.com/maiyunnet/kebab/blob/master/lib/text.ts#L219)
|
|
127875
128247
|
|
|
127876
128248
|
将相对路径根据基准路径进行转换
|
|
127877
128249
|
|
|
@@ -127893,12 +128265,14 @@ Defined in: [lib/text.ts:207](https://github.com/maiyunnet/kebab/blob/master/lib
|
|
|
127893
128265
|
|
|
127894
128266
|
`boolean` = `false`
|
|
127895
128267
|
|
|
127896
|
-
|
|
128268
|
+
是否将基准路径视作目录并限定结果不能逃逸,默认 false
|
|
127897
128269
|
|
|
127898
128270
|
## Returns
|
|
127899
128271
|
|
|
127900
128272
|
`string`
|
|
127901
128273
|
|
|
128274
|
+
转换后的地址,超出限定目录时返回基准目录
|
|
128275
|
+
|
|
127902
128276
|
lib/text/index.md
|
|
127903
128277
|
---
|
|
127904
128278
|
|
|
@@ -127976,7 +128350,7 @@ lib/text/interfaces/IDomain.md
|
|
|
127976
128350
|
|
|
127977
128351
|
# Interface: IDomain
|
|
127978
128352
|
|
|
127979
|
-
Defined in: [lib/text.ts:
|
|
128353
|
+
Defined in: [lib/text.ts:358](https://github.com/maiyunnet/kebab/blob/master/lib/text.ts#L358)
|
|
127980
128354
|
|
|
127981
128355
|
解析后的 domain
|
|
127982
128356
|
|
|
@@ -127986,7 +128360,7 @@ Defined in: [lib/text.ts:351](https://github.com/maiyunnet/kebab/blob/master/lib
|
|
|
127986
128360
|
|
|
127987
128361
|
> **domain**: `string` \| `null`
|
|
127988
128362
|
|
|
127989
|
-
Defined in: [lib/text.ts:
|
|
128363
|
+
Defined in: [lib/text.ts:361](https://github.com/maiyunnet/kebab/blob/master/lib/text.ts#L361)
|
|
127990
128364
|
|
|
127991
128365
|
***
|
|
127992
128366
|
|
|
@@ -127994,7 +128368,7 @@ Defined in: [lib/text.ts:354](https://github.com/maiyunnet/kebab/blob/master/lib
|
|
|
127994
128368
|
|
|
127995
128369
|
> **sld**: `string` \| `null`
|
|
127996
128370
|
|
|
127997
|
-
Defined in: [lib/text.ts:
|
|
128371
|
+
Defined in: [lib/text.ts:360](https://github.com/maiyunnet/kebab/blob/master/lib/text.ts#L360)
|
|
127998
128372
|
|
|
127999
128373
|
***
|
|
128000
128374
|
|
|
@@ -128002,7 +128376,7 @@ Defined in: [lib/text.ts:353](https://github.com/maiyunnet/kebab/blob/master/lib
|
|
|
128002
128376
|
|
|
128003
128377
|
> **sub**: `string` \| `null`
|
|
128004
128378
|
|
|
128005
|
-
Defined in: [lib/text.ts:
|
|
128379
|
+
Defined in: [lib/text.ts:362](https://github.com/maiyunnet/kebab/blob/master/lib/text.ts#L362)
|
|
128006
128380
|
|
|
128007
128381
|
***
|
|
128008
128382
|
|
|
@@ -128010,7 +128384,7 @@ Defined in: [lib/text.ts:355](https://github.com/maiyunnet/kebab/blob/master/lib
|
|
|
128010
128384
|
|
|
128011
128385
|
> **tld**: `string` \| `null`
|
|
128012
128386
|
|
|
128013
|
-
Defined in: [lib/text.ts:
|
|
128387
|
+
Defined in: [lib/text.ts:359](https://github.com/maiyunnet/kebab/blob/master/lib/text.ts#L359)
|
|
128014
128388
|
|
|
128015
128389
|
lib/text/type-aliases/TFalsy.md
|
|
128016
128390
|
---
|
|
@@ -128025,7 +128399,7 @@ lib/text/type-aliases/TFalsy.md
|
|
|
128025
128399
|
|
|
128026
128400
|
> **TFalsy** = `false` \| `""` \| `0` \| `null` \| `undefined` \| *typeof* `NaN`
|
|
128027
128401
|
|
|
128028
|
-
Defined in: [lib/text.ts:
|
|
128402
|
+
Defined in: [lib/text.ts:748](https://github.com/maiyunnet/kebab/blob/master/lib/text.ts#L748)
|
|
128029
128403
|
|
|
128030
128404
|
虚假值类型
|
|
128031
128405
|
|
|
@@ -128042,7 +128416,7 @@ lib/text/variables/REGEXP_ASCII.md
|
|
|
128042
128416
|
|
|
128043
128417
|
> `const` **REGEXP\_ASCII**: `RegExp`
|
|
128044
128418
|
|
|
128045
|
-
Defined in: [lib/text.ts:
|
|
128419
|
+
Defined in: [lib/text.ts:331](https://github.com/maiyunnet/kebab/blob/master/lib/text.ts#L331)
|
|
128046
128420
|
|
|
128047
128421
|
可打印的 ascii 字符集
|
|
128048
128422
|
|
|
@@ -128059,7 +128433,7 @@ lib/text/variables/REGEXP_DOMAIN.md
|
|
|
128059
128433
|
|
|
128060
128434
|
> `const` **REGEXP\_DOMAIN**: `RegExp`
|
|
128061
128435
|
|
|
128062
|
-
Defined in: [lib/text.ts:
|
|
128436
|
+
Defined in: [lib/text.ts:319](https://github.com/maiyunnet/kebab/blob/master/lib/text.ts#L319)
|
|
128063
128437
|
|
|
128064
128438
|
lib/text/variables/REGEXP_EMAIL.md
|
|
128065
128439
|
---
|
|
@@ -128074,7 +128448,7 @@ lib/text/variables/REGEXP_EMAIL.md
|
|
|
128074
128448
|
|
|
128075
128449
|
> `const` **REGEXP\_EMAIL**: `RegExp`
|
|
128076
128450
|
|
|
128077
|
-
Defined in: [lib/text.ts:
|
|
128451
|
+
Defined in: [lib/text.ts:293](https://github.com/maiyunnet/kebab/blob/master/lib/text.ts#L293)
|
|
128078
128452
|
|
|
128079
128453
|
lib/time/classes/Time.md
|
|
128080
128454
|
---
|
|
@@ -129422,7 +129796,7 @@ lib/undici/interfaces/IMproxyOptions.md
|
|
|
129422
129796
|
|
|
129423
129797
|
# Interface: IMproxyOptions
|
|
129424
129798
|
|
|
129425
|
-
Defined in: [lib/undici.ts:
|
|
129799
|
+
Defined in: [lib/undici.ts:924](https://github.com/maiyunnet/kebab/blob/master/lib/undici.ts#L924)
|
|
129426
129800
|
|
|
129427
129801
|
正向代理请求的传入参数选项
|
|
129428
129802
|
|
|
@@ -129432,7 +129806,7 @@ Defined in: [lib/undici.ts:913](https://github.com/maiyunnet/kebab/blob/master/l
|
|
|
129432
129806
|
|
|
129433
129807
|
> `optional` **filter?**: (`h`) => `boolean`
|
|
129434
129808
|
|
|
129435
|
-
Defined in: [lib/undici.ts:
|
|
129809
|
+
Defined in: [lib/undici.ts:939](https://github.com/maiyunnet/kebab/blob/master/lib/undici.ts#L939)
|
|
129436
129810
|
|
|
129437
129811
|
过滤 header,返回 true 则留下
|
|
129438
129812
|
|
|
@@ -129452,7 +129826,7 @@ Defined in: [lib/undici.ts:928](https://github.com/maiyunnet/kebab/blob/master/l
|
|
|
129452
129826
|
|
|
129453
129827
|
> `optional` **follow?**: `number`
|
|
129454
129828
|
|
|
129455
|
-
Defined in: [lib/undici.ts:
|
|
129829
|
+
Defined in: [lib/undici.ts:929](https://github.com/maiyunnet/kebab/blob/master/lib/undici.ts#L929)
|
|
129456
129830
|
|
|
129457
129831
|
***
|
|
129458
129832
|
|
|
@@ -129460,7 +129834,7 @@ Defined in: [lib/undici.ts:918](https://github.com/maiyunnet/kebab/blob/master/l
|
|
|
129460
129834
|
|
|
129461
129835
|
> `optional` **headers?**: [`THttpHeaders`](../type-aliases/THttpHeaders.md)
|
|
129462
129836
|
|
|
129463
|
-
Defined in: [lib/undici.ts:
|
|
129837
|
+
Defined in: [lib/undici.ts:933](https://github.com/maiyunnet/kebab/blob/master/lib/undici.ts#L933)
|
|
129464
129838
|
|
|
129465
129839
|
***
|
|
129466
129840
|
|
|
@@ -129468,7 +129842,7 @@ Defined in: [lib/undici.ts:922](https://github.com/maiyunnet/kebab/blob/master/l
|
|
|
129468
129842
|
|
|
129469
129843
|
> `optional` **hosts?**: `string` \| `Record`\<`string`, `string`\>
|
|
129470
129844
|
|
|
129471
|
-
Defined in: [lib/undici.ts:
|
|
129845
|
+
Defined in: [lib/undici.ts:931](https://github.com/maiyunnet/kebab/blob/master/lib/undici.ts#L931)
|
|
129472
129846
|
|
|
129473
129847
|
自定义 host 映射,如 {'www.maiyun.net': '127.0.0.1'},或全部映射到一个 host
|
|
129474
129848
|
|
|
@@ -129478,7 +129852,7 @@ Defined in: [lib/undici.ts:920](https://github.com/maiyunnet/kebab/blob/master/l
|
|
|
129478
129852
|
|
|
129479
129853
|
> `optional` **keepAliveTimeout?**: `number`
|
|
129480
129854
|
|
|
129481
|
-
Defined in: [lib/undici.ts:
|
|
129855
|
+
Defined in: [lib/undici.ts:935](https://github.com/maiyunnet/kebab/blob/master/lib/undici.ts#L935)
|
|
129482
129856
|
|
|
129483
129857
|
空闲连接允许复用的最长秒数;非正数或无效值按未设置处理;默认无服务端提示时为 4 秒,有提示时采用提示值减 2 秒且最多 600 秒
|
|
129484
129858
|
|
|
@@ -129488,7 +129862,7 @@ Defined in: [lib/undici.ts:924](https://github.com/maiyunnet/kebab/blob/master/l
|
|
|
129488
129862
|
|
|
129489
129863
|
> `optional` **local?**: `string`
|
|
129490
129864
|
|
|
129491
|
-
Defined in: [lib/undici.ts:
|
|
129865
|
+
Defined in: [lib/undici.ts:932](https://github.com/maiyunnet/kebab/blob/master/lib/undici.ts#L932)
|
|
129492
129866
|
|
|
129493
129867
|
***
|
|
129494
129868
|
|
|
@@ -129496,7 +129870,7 @@ Defined in: [lib/undici.ts:921](https://github.com/maiyunnet/kebab/blob/master/l
|
|
|
129496
129870
|
|
|
129497
129871
|
> `optional` **proxyMode?**: `"request"` \| `"passthrough"`
|
|
129498
129872
|
|
|
129499
|
-
Defined in: [lib/undici.ts:
|
|
129873
|
+
Defined in: [lib/undici.ts:926](https://github.com/maiyunnet/kebab/blob/master/lib/undici.ts#L926)
|
|
129500
129874
|
|
|
129501
129875
|
默认 passthrough 保留已有来源头;request 清理来源头;两者均使用目标 Host
|
|
129502
129876
|
|
|
@@ -129506,7 +129880,7 @@ Defined in: [lib/undici.ts:915](https://github.com/maiyunnet/kebab/blob/master/l
|
|
|
129506
129880
|
|
|
129507
129881
|
> `optional` **reuse?**: `string` \| `Agent` \| `ProxyAgent`
|
|
129508
129882
|
|
|
129509
|
-
Defined in: [lib/undici.ts:
|
|
129883
|
+
Defined in: [lib/undici.ts:941](https://github.com/maiyunnet/kebab/blob/master/lib/undici.ts#L941)
|
|
129510
129884
|
|
|
129511
129885
|
默认为 default
|
|
129512
129886
|
|
|
@@ -129516,7 +129890,7 @@ Defined in: [lib/undici.ts:930](https://github.com/maiyunnet/kebab/blob/master/l
|
|
|
129516
129890
|
|
|
129517
129891
|
> `optional` **reuseTimeout?**: `number`
|
|
129518
129892
|
|
|
129519
|
-
Defined in: [lib/undici.ts:
|
|
129893
|
+
Defined in: [lib/undici.ts:937](https://github.com/maiyunnet/kebab/blob/master/lib/undici.ts#L937)
|
|
129520
129894
|
|
|
129521
129895
|
连接建立后允许承接新请求的最长秒数;非正数或无效值按未设置处理;达到后不再复用但不会中断在途请求,默认不限制
|
|
129522
129896
|
|
|
@@ -129526,7 +129900,7 @@ Defined in: [lib/undici.ts:926](https://github.com/maiyunnet/kebab/blob/master/l
|
|
|
129526
129900
|
|
|
129527
129901
|
> `optional` **timeout?**: `number`
|
|
129528
129902
|
|
|
129529
|
-
Defined in: [lib/undici.ts:
|
|
129903
|
+
Defined in: [lib/undici.ts:928](https://github.com/maiyunnet/kebab/blob/master/lib/undici.ts#L928)
|
|
129530
129904
|
|
|
129531
129905
|
秒数,默认 300 秒
|
|
129532
129906
|
|
|
@@ -129541,7 +129915,7 @@ lib/undici/interfaces/IRequestOptions.md
|
|
|
129541
129915
|
|
|
129542
129916
|
# Interface: IRequestOptions
|
|
129543
129917
|
|
|
129544
|
-
Defined in: [lib/undici.ts:
|
|
129918
|
+
Defined in: [lib/undici.ts:881](https://github.com/maiyunnet/kebab/blob/master/lib/undici.ts#L881)
|
|
129545
129919
|
|
|
129546
129920
|
请求的传入参数选项
|
|
129547
129921
|
|
|
@@ -129551,7 +129925,7 @@ Defined in: [lib/undici.ts:870](https://github.com/maiyunnet/kebab/blob/master/l
|
|
|
129551
129925
|
|
|
129552
129926
|
> `optional` **cookie?**: `Record`\<`string`, [`ICookie`](../../cookie/interfaces/ICookie.md)\>
|
|
129553
129927
|
|
|
129554
|
-
Defined in: [lib/undici.ts:
|
|
129928
|
+
Defined in: [lib/undici.ts:916](https://github.com/maiyunnet/kebab/blob/master/lib/undici.ts#L916)
|
|
129555
129929
|
|
|
129556
129930
|
cookie 托管对象
|
|
129557
129931
|
|
|
@@ -129561,7 +129935,7 @@ cookie 托管对象
|
|
|
129561
129935
|
|
|
129562
129936
|
> `optional` **follow?**: `number`
|
|
129563
129937
|
|
|
129564
|
-
Defined in: [lib/undici.ts:
|
|
129938
|
+
Defined in: [lib/undici.ts:893](https://github.com/maiyunnet/kebab/blob/master/lib/undici.ts#L893)
|
|
129565
129939
|
|
|
129566
129940
|
追踪 location 次数,0 为不追踪,默认为 0
|
|
129567
129941
|
|
|
@@ -129571,7 +129945,7 @@ Defined in: [lib/undici.ts:882](https://github.com/maiyunnet/kebab/blob/master/l
|
|
|
129571
129945
|
|
|
129572
129946
|
> `optional` **headers?**: [`THttpHeaders`](../type-aliases/THttpHeaders.md)
|
|
129573
129947
|
|
|
129574
|
-
Defined in: [lib/undici.ts:
|
|
129948
|
+
Defined in: [lib/undici.ts:898](https://github.com/maiyunnet/kebab/blob/master/lib/undici.ts#L898)
|
|
129575
129949
|
|
|
129576
129950
|
***
|
|
129577
129951
|
|
|
@@ -129579,7 +129953,7 @@ Defined in: [lib/undici.ts:887](https://github.com/maiyunnet/kebab/blob/master/l
|
|
|
129579
129953
|
|
|
129580
129954
|
> `optional` **hosts?**: `string` \| `Record`\<`string`, `string`\>
|
|
129581
129955
|
|
|
129582
|
-
Defined in: [lib/undici.ts:
|
|
129956
|
+
Defined in: [lib/undici.ts:895](https://github.com/maiyunnet/kebab/blob/master/lib/undici.ts#L895)
|
|
129583
129957
|
|
|
129584
129958
|
自定义 host 映射,如 {'www.maiyun.net': '127.0.0.1'},或全部映射到一个 host
|
|
129585
129959
|
|
|
@@ -129589,7 +129963,7 @@ Defined in: [lib/undici.ts:884](https://github.com/maiyunnet/kebab/blob/master/l
|
|
|
129589
129963
|
|
|
129590
129964
|
> `optional` **keep?**: `boolean`
|
|
129591
129965
|
|
|
129592
|
-
Defined in: [lib/undici.ts:
|
|
129966
|
+
Defined in: [lib/undici.ts:908](https://github.com/maiyunnet/kebab/blob/master/lib/undici.ts#L908)
|
|
129593
129967
|
|
|
129594
129968
|
连接是否保持长连接(即是否允许复用),默认为 true
|
|
129595
129969
|
|
|
@@ -129599,7 +129973,7 @@ Defined in: [lib/undici.ts:897](https://github.com/maiyunnet/kebab/blob/master/l
|
|
|
129599
129973
|
|
|
129600
129974
|
> `optional` **keepAliveTimeout?**: `number`
|
|
129601
129975
|
|
|
129602
|
-
Defined in: [lib/undici.ts:
|
|
129976
|
+
Defined in: [lib/undici.ts:910](https://github.com/maiyunnet/kebab/blob/master/lib/undici.ts#L910)
|
|
129603
129977
|
|
|
129604
129978
|
空闲连接允许复用的最长秒数;非正数或无效值按未设置处理;默认无服务端提示时为 4 秒,有提示时采用提示值减 2 秒且最多 600 秒;自定义 Agent 由其自身配置
|
|
129605
129979
|
|
|
@@ -129609,7 +129983,7 @@ Defined in: [lib/undici.ts:899](https://github.com/maiyunnet/kebab/blob/master/l
|
|
|
129609
129983
|
|
|
129610
129984
|
> `optional` **local?**: `string`
|
|
129611
129985
|
|
|
129612
|
-
Defined in: [lib/undici.ts:
|
|
129986
|
+
Defined in: [lib/undici.ts:897](https://github.com/maiyunnet/kebab/blob/master/lib/undici.ts#L897)
|
|
129613
129987
|
|
|
129614
129988
|
***
|
|
129615
129989
|
|
|
@@ -129617,7 +129991,7 @@ Defined in: [lib/undici.ts:886](https://github.com/maiyunnet/kebab/blob/master/l
|
|
|
129617
129991
|
|
|
129618
129992
|
> `optional` **log?**: `boolean`
|
|
129619
129993
|
|
|
129620
|
-
Defined in: [lib/undici.ts:
|
|
129994
|
+
Defined in: [lib/undici.ts:918](https://github.com/maiyunnet/kebab/blob/master/lib/undici.ts#L918)
|
|
129621
129995
|
|
|
129622
129996
|
若有异常写入文件日志,默认为 true
|
|
129623
129997
|
|
|
@@ -129627,7 +130001,7 @@ Defined in: [lib/undici.ts:907](https://github.com/maiyunnet/kebab/blob/master/l
|
|
|
129627
130001
|
|
|
129628
130002
|
> `optional` **method?**: `"GET"` \| `"POST"` \| `"PUT"` \| `"DELETE"` \| `"OPTIONS"`
|
|
129629
130003
|
|
|
129630
|
-
Defined in: [lib/undici.ts:
|
|
130004
|
+
Defined in: [lib/undici.ts:882](https://github.com/maiyunnet/kebab/blob/master/lib/undici.ts#L882)
|
|
129631
130005
|
|
|
129632
130006
|
***
|
|
129633
130007
|
|
|
@@ -129635,7 +130009,7 @@ Defined in: [lib/undici.ts:871](https://github.com/maiyunnet/kebab/blob/master/l
|
|
|
129635
130009
|
|
|
129636
130010
|
> `optional` **mproxy?**: `object`
|
|
129637
130011
|
|
|
129638
|
-
Defined in: [lib/undici.ts:
|
|
130012
|
+
Defined in: [lib/undici.ts:900](https://github.com/maiyunnet/kebab/blob/master/lib/undici.ts#L900)
|
|
129639
130013
|
|
|
129640
130014
|
正向 mproxy 代理,url 如 https://xxx/abc
|
|
129641
130015
|
|
|
@@ -129663,7 +130037,7 @@ Defined in: [lib/undici.ts:889](https://github.com/maiyunnet/kebab/blob/master/l
|
|
|
129663
130037
|
|
|
129664
130038
|
> `optional` **retry?**: `number`
|
|
129665
130039
|
|
|
129666
|
-
Defined in: [lib/undici.ts:
|
|
130040
|
+
Defined in: [lib/undici.ts:887](https://github.com/maiyunnet/kebab/blob/master/lib/undici.ts#L887)
|
|
129667
130041
|
|
|
129668
130042
|
网络异常后的重试次数,默认 0;流式请求体不可重试,非幂等请求需由调用方保证安全
|
|
129669
130043
|
|
|
@@ -129673,7 +130047,7 @@ Defined in: [lib/undici.ts:876](https://github.com/maiyunnet/kebab/blob/master/l
|
|
|
129673
130047
|
|
|
129674
130048
|
> `optional` **retryJson?**: `number`
|
|
129675
130049
|
|
|
129676
|
-
Defined in: [lib/undici.ts:
|
|
130050
|
+
Defined in: [lib/undici.ts:889](https://github.com/maiyunnet/kebab/blob/master/lib/undici.ts#L889)
|
|
129677
130051
|
|
|
129678
130052
|
JSON 解析失败或重试验证未通过后的重试次数,默认 0;仅适用于 ResponseJson 快捷方法,非幂等请求需由调用方保证安全
|
|
129679
130053
|
|
|
@@ -129683,7 +130057,7 @@ JSON 解析失败或重试验证未通过后的重试次数,默认 0;仅适
|
|
|
129683
130057
|
|
|
129684
130058
|
> `optional` **retryJsonHandler?**: (`json`) => `boolean`
|
|
129685
130059
|
|
|
129686
|
-
Defined in: [lib/undici.ts:
|
|
130060
|
+
Defined in: [lib/undici.ts:891](https://github.com/maiyunnet/kebab/blob/master/lib/undici.ts#L891)
|
|
129687
130061
|
|
|
129688
130062
|
JSON 重试验证方法;返回 false 时按 retryJson 的设置重试,耗尽后仍返回最后一次解析结果,业务结果由调用方判断;仅适用于 ResponseJson 快捷方法
|
|
129689
130063
|
|
|
@@ -129703,7 +130077,7 @@ JSON 重试验证方法;返回 false 时按 retryJson 的设置重试,耗尽
|
|
|
129703
130077
|
|
|
129704
130078
|
> `optional` **reuse?**: `string` \| `Agent` \| `ProxyAgent`
|
|
129705
130079
|
|
|
129706
|
-
Defined in: [lib/undici.ts:
|
|
130080
|
+
Defined in: [lib/undici.ts:914](https://github.com/maiyunnet/kebab/blob/master/lib/undici.ts#L914)
|
|
129707
130081
|
|
|
129708
130082
|
复用池名/Agent,默认为 default
|
|
129709
130083
|
|
|
@@ -129713,7 +130087,7 @@ Defined in: [lib/undici.ts:903](https://github.com/maiyunnet/kebab/blob/master/l
|
|
|
129713
130087
|
|
|
129714
130088
|
> `optional` **reuseTimeout?**: `number`
|
|
129715
130089
|
|
|
129716
|
-
Defined in: [lib/undici.ts:
|
|
130090
|
+
Defined in: [lib/undici.ts:912](https://github.com/maiyunnet/kebab/blob/master/lib/undici.ts#L912)
|
|
129717
130091
|
|
|
129718
130092
|
连接建立后允许承接新请求的最长秒数;非正数或无效值按未设置处理;达到后不再复用但不会中断在途请求,默认不限制;自定义 Agent 由其自身配置
|
|
129719
130093
|
|
|
@@ -129723,7 +130097,7 @@ Defined in: [lib/undici.ts:901](https://github.com/maiyunnet/kebab/blob/master/l
|
|
|
129723
130097
|
|
|
129724
130098
|
> `optional` **save?**: `string`
|
|
129725
130099
|
|
|
129726
|
-
Defined in: [lib/undici.ts:
|
|
130100
|
+
Defined in: [lib/undici.ts:896](https://github.com/maiyunnet/kebab/blob/master/lib/undici.ts#L896)
|
|
129727
130101
|
|
|
129728
130102
|
***
|
|
129729
130103
|
|
|
@@ -129731,7 +130105,7 @@ Defined in: [lib/undici.ts:885](https://github.com/maiyunnet/kebab/blob/master/l
|
|
|
129731
130105
|
|
|
129732
130106
|
> `optional` **signal?**: `AbortSignal`
|
|
129733
130107
|
|
|
129734
|
-
Defined in: [lib/undici.ts:
|
|
130108
|
+
Defined in: [lib/undici.ts:920](https://github.com/maiyunnet/kebab/blob/master/lib/undici.ts#L920)
|
|
129735
130109
|
|
|
129736
130110
|
请求中止信号
|
|
129737
130111
|
|
|
@@ -129741,7 +130115,7 @@ Defined in: [lib/undici.ts:909](https://github.com/maiyunnet/kebab/blob/master/l
|
|
|
129741
130115
|
|
|
129742
130116
|
> `optional` **timeout?**: `number`
|
|
129743
130117
|
|
|
129744
|
-
Defined in: [lib/undici.ts:
|
|
130118
|
+
Defined in: [lib/undici.ts:885](https://github.com/maiyunnet/kebab/blob/master/lib/undici.ts#L885)
|
|
129745
130119
|
|
|
129746
130120
|
秒数,默认 300 秒
|
|
129747
130121
|
|
|
@@ -129751,7 +130125,7 @@ Defined in: [lib/undici.ts:874](https://github.com/maiyunnet/kebab/blob/master/l
|
|
|
129751
130125
|
|
|
129752
130126
|
> `optional` **type?**: `"form"` \| `"json"`
|
|
129753
130127
|
|
|
129754
|
-
Defined in: [lib/undici.ts:
|
|
130128
|
+
Defined in: [lib/undici.ts:883](https://github.com/maiyunnet/kebab/blob/master/lib/undici.ts#L883)
|
|
129755
130129
|
|
|
129756
130130
|
lib/undici/interfaces/IRproxyOptions.md
|
|
129757
130131
|
---
|
|
@@ -129764,7 +130138,7 @@ lib/undici/interfaces/IRproxyOptions.md
|
|
|
129764
130138
|
|
|
129765
130139
|
# Interface: IRproxyOptions
|
|
129766
130140
|
|
|
129767
|
-
Defined in: [lib/undici.ts:
|
|
130141
|
+
Defined in: [lib/undici.ts:945](https://github.com/maiyunnet/kebab/blob/master/lib/undici.ts#L945)
|
|
129768
130142
|
|
|
129769
130143
|
反向代理请求的传入参数选项
|
|
129770
130144
|
|
|
@@ -129778,7 +130152,7 @@ Defined in: [lib/undici.ts:934](https://github.com/maiyunnet/kebab/blob/master/l
|
|
|
129778
130152
|
|
|
129779
130153
|
> `optional` **body?**: `string` \| `Buffer`\<`ArrayBufferLike`\> \| `Readable`
|
|
129780
130154
|
|
|
129781
|
-
Defined in: [lib/undici.ts:
|
|
130155
|
+
Defined in: [lib/undici.ts:968](https://github.com/maiyunnet/kebab/blob/master/lib/undici.ts#L968)
|
|
129782
130156
|
|
|
129783
130157
|
手动传入请求体(优先于原始 req 流),用于 req 流已消费后仍需转发 body 的场景
|
|
129784
130158
|
|
|
@@ -129788,7 +130162,7 @@ Defined in: [lib/undici.ts:957](https://github.com/maiyunnet/kebab/blob/master/l
|
|
|
129788
130162
|
|
|
129789
130163
|
> `optional` **filter?**: (`h`) => `boolean`
|
|
129790
130164
|
|
|
129791
|
-
Defined in: [lib/undici.ts:
|
|
130165
|
+
Defined in: [lib/undici.ts:958](https://github.com/maiyunnet/kebab/blob/master/lib/undici.ts#L958)
|
|
129792
130166
|
|
|
129793
130167
|
过滤 header,返回 true 则留下
|
|
129794
130168
|
|
|
@@ -129808,7 +130182,7 @@ Defined in: [lib/undici.ts:947](https://github.com/maiyunnet/kebab/blob/master/l
|
|
|
129808
130182
|
|
|
129809
130183
|
> `optional` **follow?**: `number`
|
|
129810
130184
|
|
|
129811
|
-
Defined in: [lib/undici.ts:
|
|
130185
|
+
Defined in: [lib/undici.ts:948](https://github.com/maiyunnet/kebab/blob/master/lib/undici.ts#L948)
|
|
129812
130186
|
|
|
129813
130187
|
***
|
|
129814
130188
|
|
|
@@ -129816,7 +130190,7 @@ Defined in: [lib/undici.ts:937](https://github.com/maiyunnet/kebab/blob/master/l
|
|
|
129816
130190
|
|
|
129817
130191
|
> `optional` **headers?**: [`THttpHeaders`](../type-aliases/THttpHeaders.md)
|
|
129818
130192
|
|
|
129819
|
-
Defined in: [lib/undici.ts:
|
|
130193
|
+
Defined in: [lib/undici.ts:952](https://github.com/maiyunnet/kebab/blob/master/lib/undici.ts#L952)
|
|
129820
130194
|
|
|
129821
130195
|
***
|
|
129822
130196
|
|
|
@@ -129824,7 +130198,7 @@ Defined in: [lib/undici.ts:941](https://github.com/maiyunnet/kebab/blob/master/l
|
|
|
129824
130198
|
|
|
129825
130199
|
> `optional` **hosts?**: `string` \| `Record`\<`string`, `string`\>
|
|
129826
130200
|
|
|
129827
|
-
Defined in: [lib/undici.ts:
|
|
130201
|
+
Defined in: [lib/undici.ts:950](https://github.com/maiyunnet/kebab/blob/master/lib/undici.ts#L950)
|
|
129828
130202
|
|
|
129829
130203
|
自定义 host 映射,如 {'www.maiyun.net': '127.0.0.1'},或全部映射到一个 host
|
|
129830
130204
|
|
|
@@ -129834,7 +130208,7 @@ Defined in: [lib/undici.ts:939](https://github.com/maiyunnet/kebab/blob/master/l
|
|
|
129834
130208
|
|
|
129835
130209
|
> `optional` **keepAliveTimeout?**: `number`
|
|
129836
130210
|
|
|
129837
|
-
Defined in: [lib/undici.ts:
|
|
130211
|
+
Defined in: [lib/undici.ts:954](https://github.com/maiyunnet/kebab/blob/master/lib/undici.ts#L954)
|
|
129838
130212
|
|
|
129839
130213
|
空闲连接允许复用的最长秒数;非正数或无效值按未设置处理;默认无服务端提示时为 4 秒,有提示时采用提示值减 2 秒且最多 600 秒
|
|
129840
130214
|
|
|
@@ -129844,7 +130218,7 @@ Defined in: [lib/undici.ts:943](https://github.com/maiyunnet/kebab/blob/master/l
|
|
|
129844
130218
|
|
|
129845
130219
|
> `optional` **local?**: `string`
|
|
129846
130220
|
|
|
129847
|
-
Defined in: [lib/undici.ts:
|
|
130221
|
+
Defined in: [lib/undici.ts:951](https://github.com/maiyunnet/kebab/blob/master/lib/undici.ts#L951)
|
|
129848
130222
|
|
|
129849
130223
|
***
|
|
129850
130224
|
|
|
@@ -129852,7 +130226,7 @@ Defined in: [lib/undici.ts:940](https://github.com/maiyunnet/kebab/blob/master/l
|
|
|
129852
130226
|
|
|
129853
130227
|
> `optional` **mproxy?**: `object`
|
|
129854
130228
|
|
|
129855
|
-
Defined in: [lib/undici.ts:
|
|
130229
|
+
Defined in: [lib/undici.ts:960](https://github.com/maiyunnet/kebab/blob/master/lib/undici.ts#L960)
|
|
129856
130230
|
|
|
129857
130231
|
正向 mproxy 代理,url 如 https://xxx/abc
|
|
129858
130232
|
|
|
@@ -129897,7 +130271,7 @@ reverse 的协议和 IP 仅取实际连接,不信任来路代理头;可信
|
|
|
129897
130271
|
|
|
129898
130272
|
> `optional` **querys?**: `Record`\<`string`, `any`\>
|
|
129899
130273
|
|
|
129900
|
-
Defined in: [lib/undici.ts:
|
|
130274
|
+
Defined in: [lib/undici.ts:970](https://github.com/maiyunnet/kebab/blob/master/lib/undici.ts#L970)
|
|
129901
130275
|
|
|
129902
130276
|
自定义 GET 查询参数,传入后直接替换代理目标 URL 的整个 query string
|
|
129903
130277
|
|
|
@@ -129907,7 +130281,7 @@ Defined in: [lib/undici.ts:959](https://github.com/maiyunnet/kebab/blob/master/l
|
|
|
129907
130281
|
|
|
129908
130282
|
> `optional` **reuse?**: `string` \| `Agent` \| `ProxyAgent`
|
|
129909
130283
|
|
|
129910
|
-
Defined in: [lib/undici.ts:
|
|
130284
|
+
Defined in: [lib/undici.ts:972](https://github.com/maiyunnet/kebab/blob/master/lib/undici.ts#L972)
|
|
129911
130285
|
|
|
129912
130286
|
默认为 default
|
|
129913
130287
|
|
|
@@ -129917,7 +130291,7 @@ Defined in: [lib/undici.ts:961](https://github.com/maiyunnet/kebab/blob/master/l
|
|
|
129917
130291
|
|
|
129918
130292
|
> `optional` **reuseTimeout?**: `number`
|
|
129919
130293
|
|
|
129920
|
-
Defined in: [lib/undici.ts:
|
|
130294
|
+
Defined in: [lib/undici.ts:956](https://github.com/maiyunnet/kebab/blob/master/lib/undici.ts#L956)
|
|
129921
130295
|
|
|
129922
130296
|
连接建立后允许承接新请求的最长秒数;非正数或无效值按未设置处理;达到后不再复用但不会中断在途请求,默认不限制
|
|
129923
130297
|
|
|
@@ -129927,7 +130301,7 @@ Defined in: [lib/undici.ts:945](https://github.com/maiyunnet/kebab/blob/master/l
|
|
|
129927
130301
|
|
|
129928
130302
|
> `optional` **timeout?**: `number`
|
|
129929
130303
|
|
|
129930
|
-
Defined in: [lib/undici.ts:
|
|
130304
|
+
Defined in: [lib/undici.ts:947](https://github.com/maiyunnet/kebab/blob/master/lib/undici.ts#L947)
|
|
129931
130305
|
|
|
129932
130306
|
秒数,默认 300 秒
|
|
129933
130307
|
|
|
@@ -130620,7 +130994,7 @@ lib/undici/type-aliases/THttpHeaders.md
|
|
|
130620
130994
|
|
|
130621
130995
|
> **THttpHeaders** = `http.IncomingHttpHeaders` & `object`
|
|
130622
130996
|
|
|
130623
|
-
Defined in: [lib/undici.ts:
|
|
130997
|
+
Defined in: [lib/undici.ts:977](https://github.com/maiyunnet/kebab/blob/master/lib/undici.ts#L977)
|
|
130624
130998
|
|
|
130625
130999
|
http headers
|
|
130626
131000
|
|
|
@@ -135688,7 +136062,7 @@ Defined in: [sys/mod.ts:74](https://github.com/maiyunnet/kebab/blob/master/sys/m
|
|
|
135688
136062
|
|
|
135689
136063
|
> **new default**(`opt`): `Mod`
|
|
135690
136064
|
|
|
135691
|
-
Defined in: [sys/mod.ts:
|
|
136065
|
+
Defined in: [sys/mod.ts:135](https://github.com/maiyunnet/kebab/blob/master/sys/mod.ts#L135)
|
|
135692
136066
|
|
|
135693
136067
|
构造函数
|
|
135694
136068
|
|
|
@@ -135762,7 +136136,7 @@ MySQL 表前缀或 PostgreSQL Schema 名,优先级:选项 > 类属性 > 配
|
|
|
135762
136136
|
|
|
135763
136137
|
> `protected` **\_contain**: \{ `key`: `string`; `list`: `string`[]; \} \| `null` = `null`
|
|
135764
136138
|
|
|
135765
|
-
Defined in: [sys/mod.ts:
|
|
136139
|
+
Defined in: [sys/mod.ts:111](https://github.com/maiyunnet/kebab/blob/master/sys/mod.ts#L111)
|
|
135766
136140
|
|
|
135767
136141
|
必须追加的数据筛选 key 与 values,仅单表模式有效
|
|
135768
136142
|
|
|
@@ -135772,7 +136146,7 @@ Defined in: [sys/mod.ts:104](https://github.com/maiyunnet/kebab/blob/master/sys/
|
|
|
135772
136146
|
|
|
135773
136147
|
> `protected` `optional` **\_ctr?**: [`Ctr`](../../ctr/classes/Ctr.md) = `undefined`
|
|
135774
136148
|
|
|
135775
|
-
Defined in: [sys/mod.ts:
|
|
136149
|
+
Defined in: [sys/mod.ts:126](https://github.com/maiyunnet/kebab/blob/master/sys/mod.ts#L126)
|
|
135776
136150
|
|
|
135777
136151
|
ctr 对象
|
|
135778
136152
|
|
|
@@ -135782,7 +136156,7 @@ ctr 对象
|
|
|
135782
136156
|
|
|
135783
136157
|
> `protected` **\_data**: `Record`\<`string`, `any`\> = `{}`
|
|
135784
136158
|
|
|
135785
|
-
Defined in: [sys/mod.ts:
|
|
136159
|
+
Defined in: [sys/mod.ts:105](https://github.com/maiyunnet/kebab/blob/master/sys/mod.ts#L105)
|
|
135786
136160
|
|
|
135787
136161
|
模型获取的属性
|
|
135788
136162
|
|
|
@@ -135792,7 +136166,7 @@ Defined in: [sys/mod.ts:98](https://github.com/maiyunnet/kebab/blob/master/sys/m
|
|
|
135792
136166
|
|
|
135793
136167
|
> `protected` **\_db**: [`Transaction`](../../../lib/db/tran/classes/Transaction.md) \| [`Pool`](../../../lib/db/pool/classes/Pool.md)
|
|
135794
136168
|
|
|
135795
|
-
Defined in: [sys/mod.ts:
|
|
136169
|
+
Defined in: [sys/mod.ts:120](https://github.com/maiyunnet/kebab/blob/master/sys/mod.ts#L120)
|
|
135796
136170
|
|
|
135797
136171
|
数据库连接对象
|
|
135798
136172
|
|
|
@@ -135802,7 +136176,7 @@ Defined in: [sys/mod.ts:113](https://github.com/maiyunnet/kebab/blob/master/sys/
|
|
|
135802
136176
|
|
|
135803
136177
|
> `protected` **\_fieldPrefix**: `string` = `''`
|
|
135804
136178
|
|
|
135805
|
-
Defined in: [sys/mod.ts:
|
|
136179
|
+
Defined in: [sys/mod.ts:129](https://github.com/maiyunnet/kebab/blob/master/sys/mod.ts#L129)
|
|
135806
136180
|
|
|
135807
136181
|
主表筛选前缀,优先 alias,其次表名
|
|
135808
136182
|
|
|
@@ -135812,7 +136186,7 @@ Defined in: [sys/mod.ts:122](https://github.com/maiyunnet/kebab/blob/master/sys/
|
|
|
135812
136186
|
|
|
135813
136187
|
> `protected` **\_index**: `string`[] \| `null` = `null`
|
|
135814
136188
|
|
|
135815
|
-
Defined in: [sys/mod.ts:
|
|
136189
|
+
Defined in: [sys/mod.ts:108](https://github.com/maiyunnet/kebab/blob/master/sys/mod.ts#L108)
|
|
135816
136190
|
|
|
135817
136191
|
当前选择的分表 _ 后缀,多个代表联查
|
|
135818
136192
|
|
|
@@ -135822,7 +136196,7 @@ Defined in: [sys/mod.ts:101](https://github.com/maiyunnet/kebab/blob/master/sys/
|
|
|
135822
136196
|
|
|
135823
136197
|
> `protected` **\_jsonUpdates**: `Record`\<`string`, `boolean`\> = `{}`
|
|
135824
136198
|
|
|
135825
|
-
Defined in: [sys/mod.ts:
|
|
136199
|
+
Defined in: [sys/mod.ts:102](https://github.com/maiyunnet/kebab/blob/master/sys/mod.ts#L102)
|
|
135826
136200
|
|
|
135827
136201
|
要在数据库边界序列化的 JSON 字段
|
|
135828
136202
|
|
|
@@ -135832,7 +136206,7 @@ Defined in: [sys/mod.ts:95](https://github.com/maiyunnet/kebab/blob/master/sys/m
|
|
|
135832
136206
|
|
|
135833
136207
|
> `protected` **\_sql**: [`Sql`](../../../lib/sql/classes/Sql.md)
|
|
135834
136208
|
|
|
135835
|
-
Defined in: [sys/mod.ts:
|
|
136209
|
+
Defined in: [sys/mod.ts:123](https://github.com/maiyunnet/kebab/blob/master/sys/mod.ts#L123)
|
|
135836
136210
|
|
|
135837
136211
|
Sql 对象
|
|
135838
136212
|
|
|
@@ -135842,7 +136216,7 @@ Sql 对象
|
|
|
135842
136216
|
|
|
135843
136217
|
> `protected` **\_total**: `number`[] = `[]`
|
|
135844
136218
|
|
|
135845
|
-
Defined in: [sys/mod.ts:
|
|
136219
|
+
Defined in: [sys/mod.ts:117](https://github.com/maiyunnet/kebab/blob/master/sys/mod.ts#L117)
|
|
135846
136220
|
|
|
135847
136221
|
已算出的 total
|
|
135848
136222
|
|
|
@@ -135852,7 +136226,7 @@ Defined in: [sys/mod.ts:110](https://github.com/maiyunnet/kebab/blob/master/sys/
|
|
|
135852
136226
|
|
|
135853
136227
|
> `protected` **\_updates**: `Record`\<`string`, `boolean`\> = `{}`
|
|
135854
136228
|
|
|
135855
|
-
Defined in: [sys/mod.ts:
|
|
136229
|
+
Defined in: [sys/mod.ts:99](https://github.com/maiyunnet/kebab/blob/master/sys/mod.ts#L99)
|
|
135856
136230
|
|
|
135857
136231
|
要 update 的内容
|
|
135858
136232
|
|
|
@@ -135862,7 +136236,7 @@ Defined in: [sys/mod.ts:92](https://github.com/maiyunnet/kebab/blob/master/sys/m
|
|
|
135862
136236
|
|
|
135863
136237
|
> `protected` `static` **\_$index**: `string` \| `string`[] = `''`
|
|
135864
136238
|
|
|
135865
|
-
Defined in: [sys/mod.ts:
|
|
136239
|
+
Defined in: [sys/mod.ts:93](https://github.com/maiyunnet/kebab/blob/master/sys/mod.ts#L93)
|
|
135866
136240
|
|
|
135867
136241
|
自动 key 冲突目标:MySQL 为索引名;PGSQL 为唯一字段或字段数组,PG 留空使用 _$key,不支持部分或表达式索引
|
|
135868
136242
|
|
|
@@ -135872,17 +136246,29 @@ Defined in: [sys/mod.ts:86](https://github.com/maiyunnet/kebab/blob/master/sys/m
|
|
|
135872
136246
|
|
|
135873
136247
|
> `protected` `static` **\_$key**: `string` = `''`
|
|
135874
136248
|
|
|
135875
|
-
Defined in: [sys/mod.ts:
|
|
136249
|
+
Defined in: [sys/mod.ts:90](https://github.com/maiyunnet/kebab/blob/master/sys/mod.ts#L90)
|
|
135876
136250
|
|
|
135877
136251
|
设置后将由 _keyGenerator 函数生成唯一字段
|
|
135878
136252
|
|
|
135879
136253
|
***
|
|
135880
136254
|
|
|
136255
|
+
### \_$partition
|
|
136256
|
+
|
|
136257
|
+
> `protected` `static` **\_$partition**: `string`[] = `[]`
|
|
136258
|
+
|
|
136259
|
+
Defined in: [sys/mod.ts:87](https://github.com/maiyunnet/kebab/blob/master/sys/mod.ts#L87)
|
|
136260
|
+
|
|
136261
|
+
表的分区字段名,如 ['time_push']
|
|
136262
|
+
save、remove、refresh 默认会把这些字段加入 WHERE 条件,与主键一起查找记录。
|
|
136263
|
+
读取记录后不要修改主键或分区字段;留空时只使用主键。
|
|
136264
|
+
|
|
136265
|
+
***
|
|
136266
|
+
|
|
135881
136267
|
### \_$pre?
|
|
135882
136268
|
|
|
135883
136269
|
> `protected` `static` `optional` **\_$pre?**: `string`
|
|
135884
136270
|
|
|
135885
|
-
Defined in: [sys/mod.ts:
|
|
136271
|
+
Defined in: [sys/mod.ts:96](https://github.com/maiyunnet/kebab/blob/master/sys/mod.ts#L96)
|
|
135886
136272
|
|
|
135887
136273
|
前缀,MySQL 时为表前缀(如 prefix_),PostgreSQL 时为 Schema 名。顺序:选项前缀 -> 本前缀 -> 配置文件前缀
|
|
135888
136274
|
|
|
@@ -135912,7 +136298,7 @@ Defined in: [sys/mod.ts:77](https://github.com/maiyunnet/kebab/blob/master/sys/m
|
|
|
135912
136298
|
|
|
135913
136299
|
> `protected` **\_keyGenerator**(): `string`
|
|
135914
136300
|
|
|
135915
|
-
Defined in: [sys/mod.ts:
|
|
136301
|
+
Defined in: [sys/mod.ts:2074](https://github.com/maiyunnet/kebab/blob/master/sys/mod.ts#L2074)
|
|
135916
136302
|
|
|
135917
136303
|
当 _key 不为空时,则依据继承此方法的方法自动生成填充 key
|
|
135918
136304
|
|
|
@@ -135936,7 +136322,7 @@ Defined in: [sys/mod.ts:2048](https://github.com/maiyunnet/kebab/blob/master/sys
|
|
|
135936
136322
|
|
|
135937
136323
|
> **all**(): `Promise`\<`false` \| [`Rows`](Rows.md)\<`Mod`\>\>
|
|
135938
136324
|
|
|
135939
|
-
Defined in: [sys/mod.ts:
|
|
136325
|
+
Defined in: [sys/mod.ts:1297](https://github.com/maiyunnet/kebab/blob/master/sys/mod.ts#L1297)
|
|
135940
136326
|
|
|
135941
136327
|
##### Returns
|
|
135942
136328
|
|
|
@@ -135946,7 +136332,7 @@ Defined in: [sys/mod.ts:1271](https://github.com/maiyunnet/kebab/blob/master/sys
|
|
|
135946
136332
|
|
|
135947
136333
|
> **all**(`key`): `Promise`\<`false` \| `Record`\<`string`, `Mod`\>\>
|
|
135948
136334
|
|
|
135949
|
-
Defined in: [sys/mod.ts:
|
|
136335
|
+
Defined in: [sys/mod.ts:1298](https://github.com/maiyunnet/kebab/blob/master/sys/mod.ts#L1298)
|
|
135950
136336
|
|
|
135951
136337
|
##### Parameters
|
|
135952
136338
|
|
|
@@ -135974,7 +136360,7 @@ Defined in: [sys/mod.ts:1272](https://github.com/maiyunnet/kebab/blob/master/sys
|
|
|
135974
136360
|
|
|
135975
136361
|
> **allArray**(): `Promise`\<`false` \| `Record`\<`string`, `any`\>[]\>
|
|
135976
136362
|
|
|
135977
|
-
Defined in: [sys/mod.ts:
|
|
136363
|
+
Defined in: [sys/mod.ts:1476](https://github.com/maiyunnet/kebab/blob/master/sys/mod.ts#L1476)
|
|
135978
136364
|
|
|
135979
136365
|
##### Returns
|
|
135980
136366
|
|
|
@@ -135984,7 +136370,7 @@ Defined in: [sys/mod.ts:1450](https://github.com/maiyunnet/kebab/blob/master/sys
|
|
|
135984
136370
|
|
|
135985
136371
|
> **allArray**(`key`): `Promise`\<`false` \| `Record`\<`string`, `Record`\<`string`, `any`\>\>\>
|
|
135986
136372
|
|
|
135987
|
-
Defined in: [sys/mod.ts:
|
|
136373
|
+
Defined in: [sys/mod.ts:1477](https://github.com/maiyunnet/kebab/blob/master/sys/mod.ts#L1477)
|
|
135988
136374
|
|
|
135989
136375
|
##### Parameters
|
|
135990
136376
|
|
|
@@ -136002,7 +136388,7 @@ Defined in: [sys/mod.ts:1451](https://github.com/maiyunnet/kebab/blob/master/sys
|
|
|
136002
136388
|
|
|
136003
136389
|
> **allCursor**\<`T`\>(`count`, `opt`): `Promise`\<`false` \| [`ICursorPage`](../interfaces/ICursorPage.md)\<`T`\>\>
|
|
136004
136390
|
|
|
136005
|
-
Defined in: [sys/mod.ts:
|
|
136391
|
+
Defined in: [sys/mod.ts:1725](https://github.com/maiyunnet/kebab/blob/master/sys/mod.ts#L1725)
|
|
136006
136392
|
|
|
136007
136393
|
读取一批游标数据,多取一条判断后续记录,不使用 OFFSET,不修改原查询
|
|
136008
136394
|
排序字段必须全部非空、同向,且组合唯一;SELECT 中须包含对应字段(同名或指定 keys)
|
|
@@ -136067,7 +136453,7 @@ SELECT 结果中对应的字段名,默认去掉 by 的表别名
|
|
|
136067
136453
|
|
|
136068
136454
|
> **append**(`sql`): `this`
|
|
136069
136455
|
|
|
136070
|
-
Defined in: [sys/mod.ts:
|
|
136456
|
+
Defined in: [sys/mod.ts:1983](https://github.com/maiyunnet/kebab/blob/master/sys/mod.ts#L1983)
|
|
136071
136457
|
|
|
136072
136458
|
在 sql 最后追加字符串
|
|
136073
136459
|
|
|
@@ -136087,7 +136473,7 @@ Defined in: [sys/mod.ts:1957](https://github.com/maiyunnet/kebab/blob/master/sys
|
|
|
136087
136473
|
|
|
136088
136474
|
> **by**(`c`, `d?`): `this`
|
|
136089
136475
|
|
|
136090
|
-
Defined in: [sys/mod.ts:
|
|
136476
|
+
Defined in: [sys/mod.ts:1939](https://github.com/maiyunnet/kebab/blob/master/sys/mod.ts#L1939)
|
|
136091
136477
|
|
|
136092
136478
|
ORDER BY
|
|
136093
136479
|
|
|
@@ -136115,7 +136501,7 @@ ORDER BY
|
|
|
136115
136501
|
|
|
136116
136502
|
> **contain**(`contain`): `this`
|
|
136117
136503
|
|
|
136118
|
-
Defined in: [sys/mod.ts:
|
|
136504
|
+
Defined in: [sys/mod.ts:1992](https://github.com/maiyunnet/kebab/blob/master/sys/mod.ts#L1992)
|
|
136119
136505
|
|
|
136120
136506
|
设置闭包含数据
|
|
136121
136507
|
|
|
@@ -136143,7 +136529,7 @@ Defined in: [sys/mod.ts:1966](https://github.com/maiyunnet/kebab/blob/master/sys
|
|
|
136143
136529
|
|
|
136144
136530
|
> **count**(): `Promise`\<`number`\>
|
|
136145
136531
|
|
|
136146
|
-
Defined in: [sys/mod.ts:
|
|
136532
|
+
Defined in: [sys/mod.ts:1775](https://github.com/maiyunnet/kebab/blob/master/sys/mod.ts#L1775)
|
|
136147
136533
|
|
|
136148
136534
|
根据当前条件,筛选出当前条目该有的数据条数
|
|
136149
136535
|
|
|
@@ -136157,7 +136543,7 @@ Defined in: [sys/mod.ts:1749](https://github.com/maiyunnet/kebab/blob/master/sys
|
|
|
136157
136543
|
|
|
136158
136544
|
> **countSql**(): `string`
|
|
136159
136545
|
|
|
136160
|
-
Defined in: [sys/mod.ts:
|
|
136546
|
+
Defined in: [sys/mod.ts:1796](https://github.com/maiyunnet/kebab/blob/master/sys/mod.ts#L1796)
|
|
136161
136547
|
|
|
136162
136548
|
获取当前条件下的 count 的 SQL 语句
|
|
136163
136549
|
|
|
@@ -136171,7 +136557,7 @@ Defined in: [sys/mod.ts:1770](https://github.com/maiyunnet/kebab/blob/master/sys
|
|
|
136171
136557
|
|
|
136172
136558
|
> **create**(): `Promise`\<`boolean` \| `null`\>
|
|
136173
136559
|
|
|
136174
|
-
Defined in: [sys/mod.ts:
|
|
136560
|
+
Defined in: [sys/mod.ts:928](https://github.com/maiyunnet/kebab/blob/master/sys/mod.ts#L928)
|
|
136175
136561
|
|
|
136176
136562
|
创建数据,自动 key 最多尝试 3 次;PGSQL 仅忽略指定字段的唯一冲突
|
|
136177
136563
|
|
|
@@ -136187,7 +136573,7 @@ true-成功,false-错误或重试耗尽,null-其他唯一冲突;PGSQL 的 SQL
|
|
|
136187
136573
|
|
|
136188
136574
|
> **crossJoin**(`f`, `s`, `index?`, `pre?`): `this`
|
|
136189
136575
|
|
|
136190
|
-
Defined in: [sys/mod.ts:
|
|
136576
|
+
Defined in: [sys/mod.ts:1871](https://github.com/maiyunnet/kebab/blob/master/sys/mod.ts#L1871)
|
|
136191
136577
|
|
|
136192
136578
|
cross join 方法
|
|
136193
136579
|
|
|
@@ -136237,7 +136623,7 @@ ON 信息
|
|
|
136237
136623
|
|
|
136238
136624
|
> **explain**(`all?`): `Promise`\<`string` \| `false`\>
|
|
136239
136625
|
|
|
136240
|
-
Defined in: [sys/mod.ts:
|
|
136626
|
+
Defined in: [sys/mod.ts:1602](https://github.com/maiyunnet/kebab/blob/master/sys/mod.ts#L1602)
|
|
136241
136627
|
|
|
136242
136628
|
##### Parameters
|
|
136243
136629
|
|
|
@@ -136253,7 +136639,7 @@ Defined in: [sys/mod.ts:1576](https://github.com/maiyunnet/kebab/blob/master/sys
|
|
|
136253
136639
|
|
|
136254
136640
|
> **explain**(`all`): `Promise`\<`false` \| `Record`\<`string`, `any`\>\>
|
|
136255
136641
|
|
|
136256
|
-
Defined in: [sys/mod.ts:
|
|
136642
|
+
Defined in: [sys/mod.ts:1603](https://github.com/maiyunnet/kebab/blob/master/sys/mod.ts#L1603)
|
|
136257
136643
|
|
|
136258
136644
|
##### Parameters
|
|
136259
136645
|
|
|
@@ -136271,7 +136657,7 @@ Defined in: [sys/mod.ts:1577](https://github.com/maiyunnet/kebab/blob/master/sys
|
|
|
136271
136657
|
|
|
136272
136658
|
> **filter**(`s`): `this`
|
|
136273
136659
|
|
|
136274
|
-
Defined in: [sys/mod.ts:
|
|
136660
|
+
Defined in: [sys/mod.ts:1917](https://github.com/maiyunnet/kebab/blob/master/sys/mod.ts#L1917)
|
|
136275
136661
|
|
|
136276
136662
|
筛选器
|
|
136277
136663
|
|
|
@@ -136309,7 +136695,7 @@ Defined in: [sys/mod.ts:1891](https://github.com/maiyunnet/kebab/blob/master/sys
|
|
|
136309
136695
|
|
|
136310
136696
|
> **first**(`lock`, `array`): `Promise`\<`false` \| `Record`\<`string`, `any`\> \| `null`\>
|
|
136311
136697
|
|
|
136312
|
-
Defined in: [sys/mod.ts:
|
|
136698
|
+
Defined in: [sys/mod.ts:1186](https://github.com/maiyunnet/kebab/blob/master/sys/mod.ts#L1186)
|
|
136313
136699
|
|
|
136314
136700
|
##### Parameters
|
|
136315
136701
|
|
|
@@ -136329,7 +136715,7 @@ Defined in: [sys/mod.ts:1160](https://github.com/maiyunnet/kebab/blob/master/sys
|
|
|
136329
136715
|
|
|
136330
136716
|
> **first**(`lock?`, `array?`): `Promise`\<`false` \| `Mod` & `Record`\<`string`, `any`\> \| `null`\>
|
|
136331
136717
|
|
|
136332
|
-
Defined in: [sys/mod.ts:
|
|
136718
|
+
Defined in: [sys/mod.ts:1190](https://github.com/maiyunnet/kebab/blob/master/sys/mod.ts#L1190)
|
|
136333
136719
|
|
|
136334
136720
|
##### Parameters
|
|
136335
136721
|
|
|
@@ -136351,7 +136737,7 @@ Defined in: [sys/mod.ts:1164](https://github.com/maiyunnet/kebab/blob/master/sys
|
|
|
136351
136737
|
|
|
136352
136738
|
> **firstArray**(`lock?`): `Promise`\<`false` \| `Record`\<`string`, `any`\> \| `null`\>
|
|
136353
136739
|
|
|
136354
|
-
Defined in: [sys/mod.ts:
|
|
136740
|
+
Defined in: [sys/mod.ts:1230](https://github.com/maiyunnet/kebab/blob/master/sys/mod.ts#L1230)
|
|
136355
136741
|
|
|
136356
136742
|
获取数据库第一个原生对象
|
|
136357
136743
|
|
|
@@ -136373,7 +136759,7 @@ Defined in: [sys/mod.ts:1204](https://github.com/maiyunnet/kebab/blob/master/sys
|
|
|
136373
136759
|
|
|
136374
136760
|
> **format**(`sql?`, `data?`): `string`
|
|
136375
136761
|
|
|
136376
|
-
Defined in: [sys/mod.ts:
|
|
136762
|
+
Defined in: [sys/mod.ts:2019](https://github.com/maiyunnet/kebab/blob/master/sys/mod.ts#L2019)
|
|
136377
136763
|
|
|
136378
136764
|
获取带 data 的 sql 语句
|
|
136379
136765
|
|
|
@@ -136401,7 +136787,7 @@ sql 语句
|
|
|
136401
136787
|
|
|
136402
136788
|
> **fullJoin**(`f`, `s`, `index?`, `pre?`): `this`
|
|
136403
136789
|
|
|
136404
|
-
Defined in: [sys/mod.ts:
|
|
136790
|
+
Defined in: [sys/mod.ts:1859](https://github.com/maiyunnet/kebab/blob/master/sys/mod.ts#L1859)
|
|
136405
136791
|
|
|
136406
136792
|
full join 方法
|
|
136407
136793
|
|
|
@@ -136441,7 +136827,7 @@ ON 信息
|
|
|
136441
136827
|
|
|
136442
136828
|
> **get**(`n`): `any`
|
|
136443
136829
|
|
|
136444
|
-
Defined in: [sys/mod.ts:
|
|
136830
|
+
Defined in: [sys/mod.ts:908](https://github.com/maiyunnet/kebab/blob/master/sys/mod.ts#L908)
|
|
136445
136831
|
|
|
136446
136832
|
获取一个字段值
|
|
136447
136833
|
|
|
@@ -136463,7 +136849,7 @@ Defined in: [sys/mod.ts:881](https://github.com/maiyunnet/kebab/blob/master/sys/
|
|
|
136463
136849
|
|
|
136464
136850
|
> **getData**(): `any`[]
|
|
136465
136851
|
|
|
136466
|
-
Defined in: [sys/mod.ts:
|
|
136852
|
+
Defined in: [sys/mod.ts:2010](https://github.com/maiyunnet/kebab/blob/master/sys/mod.ts#L2010)
|
|
136467
136853
|
|
|
136468
136854
|
获取全部 data
|
|
136469
136855
|
|
|
@@ -136477,7 +136863,7 @@ Defined in: [sys/mod.ts:1984](https://github.com/maiyunnet/kebab/blob/master/sys
|
|
|
136477
136863
|
|
|
136478
136864
|
> **getSql**(): `string`
|
|
136479
136865
|
|
|
136480
|
-
Defined in: [sys/mod.ts:
|
|
136866
|
+
Defined in: [sys/mod.ts:2003](https://github.com/maiyunnet/kebab/blob/master/sys/mod.ts#L2003)
|
|
136481
136867
|
|
|
136482
136868
|
获取 sql 语句
|
|
136483
136869
|
|
|
@@ -136491,7 +136877,7 @@ Defined in: [sys/mod.ts:1977](https://github.com/maiyunnet/kebab/blob/master/sys
|
|
|
136491
136877
|
|
|
136492
136878
|
> **group**(`c`): `this`
|
|
136493
136879
|
|
|
136494
|
-
Defined in: [sys/mod.ts:
|
|
136880
|
+
Defined in: [sys/mod.ts:1948](https://github.com/maiyunnet/kebab/blob/master/sys/mod.ts#L1948)
|
|
136495
136881
|
|
|
136496
136882
|
GROUP BY
|
|
136497
136883
|
|
|
@@ -136513,7 +136899,7 @@ GROUP BY
|
|
|
136513
136899
|
|
|
136514
136900
|
> **having**(`s`): `this`
|
|
136515
136901
|
|
|
136516
|
-
Defined in: [sys/mod.ts:
|
|
136902
|
+
Defined in: [sys/mod.ts:1908](https://github.com/maiyunnet/kebab/blob/master/sys/mod.ts#L1908)
|
|
136517
136903
|
|
|
136518
136904
|
筛选器
|
|
136519
136905
|
|
|
@@ -136535,7 +136921,7 @@ Defined in: [sys/mod.ts:1882](https://github.com/maiyunnet/kebab/blob/master/sys
|
|
|
136535
136921
|
|
|
136536
136922
|
> **hint**(`h`): `this`
|
|
136537
136923
|
|
|
136538
|
-
Defined in: [sys/mod.ts:
|
|
136924
|
+
Defined in: [sys/mod.ts:1899](https://github.com/maiyunnet/kebab/blob/master/sys/mod.ts#L1899)
|
|
136539
136925
|
|
|
136540
136926
|
设置 MySQL 优化器 Hint
|
|
136541
136927
|
内容会以 Optimizer Hint 注释语法注入到 SELECT 关键字后
|
|
@@ -136580,7 +136966,7 @@ Hint 内容
|
|
|
136580
136966
|
|
|
136581
136967
|
> **innerJoin**(`f`, `s`, `index?`, `pre?`): `this`
|
|
136582
136968
|
|
|
136583
|
-
Defined in: [sys/mod.ts:
|
|
136969
|
+
Defined in: [sys/mod.ts:1847](https://github.com/maiyunnet/kebab/blob/master/sys/mod.ts#L1847)
|
|
136584
136970
|
|
|
136585
136971
|
inner join 方法
|
|
136586
136972
|
|
|
@@ -136620,7 +137006,7 @@ ON 信息
|
|
|
136620
137006
|
|
|
136621
137007
|
> **join**(`f`, `s?`, `type?`, `index?`, `pre?`): `this`
|
|
136622
137008
|
|
|
136623
|
-
Defined in: [sys/mod.ts:
|
|
137009
|
+
Defined in: [sys/mod.ts:1811](https://github.com/maiyunnet/kebab/blob/master/sys/mod.ts#L1811)
|
|
136624
137010
|
|
|
136625
137011
|
#### Parameters
|
|
136626
137012
|
|
|
@@ -136664,7 +137050,7 @@ ON 信息
|
|
|
136664
137050
|
|
|
136665
137051
|
> **langText**(`col`, `lang`): `string`
|
|
136666
137052
|
|
|
136667
|
-
Defined in: [sys/mod.ts:
|
|
137053
|
+
Defined in: [sys/mod.ts:2054](https://github.com/maiyunnet/kebab/blob/master/sys/mod.ts#L2054)
|
|
136668
137054
|
|
|
136669
137055
|
获取字段的可用语种文本
|
|
136670
137056
|
|
|
@@ -136692,7 +137078,7 @@ Defined in: [sys/mod.ts:2028](https://github.com/maiyunnet/kebab/blob/master/sys
|
|
|
136692
137078
|
|
|
136693
137079
|
> **leftJoin**(`f`, `s`, `index?`, `pre?`): `this`
|
|
136694
137080
|
|
|
136695
|
-
Defined in: [sys/mod.ts:
|
|
137081
|
+
Defined in: [sys/mod.ts:1823](https://github.com/maiyunnet/kebab/blob/master/sys/mod.ts#L1823)
|
|
136696
137082
|
|
|
136697
137083
|
left join 方法
|
|
136698
137084
|
|
|
@@ -136732,7 +137118,7 @@ ON 信息
|
|
|
136732
137118
|
|
|
136733
137119
|
> **limit**(`a`, `b?`): `this`
|
|
136734
137120
|
|
|
136735
|
-
Defined in: [sys/mod.ts:
|
|
137121
|
+
Defined in: [sys/mod.ts:1961](https://github.com/maiyunnet/kebab/blob/master/sys/mod.ts#L1961)
|
|
136736
137122
|
|
|
136737
137123
|
LIMIT
|
|
136738
137124
|
|
|
@@ -136760,7 +137146,7 @@ LIMIT
|
|
|
136760
137146
|
|
|
136761
137147
|
> **page**(`count`, `page?`): `this`
|
|
136762
137148
|
|
|
136763
|
-
Defined in: [sys/mod.ts:
|
|
137149
|
+
Defined in: [sys/mod.ts:1972](https://github.com/maiyunnet/kebab/blob/master/sys/mod.ts#L1972)
|
|
136764
137150
|
|
|
136765
137151
|
分页
|
|
136766
137152
|
|
|
@@ -136788,7 +137174,7 @@ Defined in: [sys/mod.ts:1946](https://github.com/maiyunnet/kebab/blob/master/sys
|
|
|
136788
137174
|
|
|
136789
137175
|
> **refresh**(`lock?`): `Promise`\<`boolean` \| `null`\>
|
|
136790
137176
|
|
|
136791
|
-
Defined in: [sys/mod.ts:
|
|
137177
|
+
Defined in: [sys/mod.ts:1097](https://github.com/maiyunnet/kebab/blob/master/sys/mod.ts#L1097)
|
|
136792
137178
|
|
|
136793
137179
|
刷新当前模型获取最新数据
|
|
136794
137180
|
|
|
@@ -136804,27 +137190,31 @@ Defined in: [sys/mod.ts:1069](https://github.com/maiyunnet/kebab/blob/master/sys
|
|
|
136804
137190
|
|
|
136805
137191
|
`Promise`\<`boolean` \| `null`\>
|
|
136806
137192
|
|
|
137193
|
+
true 成功,null 记录不存在,false 缺少定位字段或查询失败
|
|
137194
|
+
|
|
136807
137195
|
***
|
|
136808
137196
|
|
|
136809
137197
|
### remove()
|
|
136810
137198
|
|
|
136811
137199
|
> **remove**(): `Promise`\<`boolean`\>
|
|
136812
137200
|
|
|
136813
|
-
Defined in: [sys/mod.ts:
|
|
137201
|
+
Defined in: [sys/mod.ts:1165](https://github.com/maiyunnet/kebab/blob/master/sys/mod.ts#L1165)
|
|
136814
137202
|
|
|
136815
|
-
|
|
137203
|
+
按主键和分区字段删除当前记录
|
|
136816
137204
|
|
|
136817
137205
|
#### Returns
|
|
136818
137206
|
|
|
136819
137207
|
`Promise`\<`boolean`\>
|
|
136820
137208
|
|
|
137209
|
+
是否成功,缺少定位字段、记录不存在或删除失败返回 false
|
|
137210
|
+
|
|
136821
137211
|
***
|
|
136822
137212
|
|
|
136823
137213
|
### rightJoin()
|
|
136824
137214
|
|
|
136825
137215
|
> **rightJoin**(`f`, `s`, `index?`, `pre?`): `this`
|
|
136826
137216
|
|
|
136827
|
-
Defined in: [sys/mod.ts:
|
|
137217
|
+
Defined in: [sys/mod.ts:1835](https://github.com/maiyunnet/kebab/blob/master/sys/mod.ts#L1835)
|
|
136828
137218
|
|
|
136829
137219
|
right join 方法
|
|
136830
137220
|
|
|
@@ -136864,7 +137254,7 @@ ON 信息
|
|
|
136864
137254
|
|
|
136865
137255
|
> **save**(`where?`): `Promise`\<`boolean`\>
|
|
136866
137256
|
|
|
136867
|
-
Defined in: [sys/mod.ts:
|
|
137257
|
+
Defined in: [sys/mod.ts:1129](https://github.com/maiyunnet/kebab/blob/master/sys/mod.ts#L1129)
|
|
136868
137258
|
|
|
136869
137259
|
更新 set 的数据到数据库,有未保存数据时才保存
|
|
136870
137260
|
|
|
@@ -136874,13 +137264,13 @@ Defined in: [sys/mod.ts:1102](https://github.com/maiyunnet/kebab/blob/master/sys
|
|
|
136874
137264
|
|
|
136875
137265
|
`any`
|
|
136876
137266
|
|
|
136877
|
-
|
|
137267
|
+
显式非空筛选条件;省略时使用主键和分区字段值
|
|
136878
137268
|
|
|
136879
137269
|
#### Returns
|
|
136880
137270
|
|
|
136881
137271
|
`Promise`\<`boolean`\>
|
|
136882
137272
|
|
|
136883
|
-
|
|
137273
|
+
是否成功,缺少默认定位字段或写入失败返回 false 并保留待写数据
|
|
136884
137274
|
|
|
136885
137275
|
***
|
|
136886
137276
|
|
|
@@ -136904,7 +137294,7 @@ Defined in: [sys/mod.ts:1102](https://github.com/maiyunnet/kebab/blob/master/sys
|
|
|
136904
137294
|
|
|
136905
137295
|
> **set**\<`T`, `TK`\>(`n`): `void`
|
|
136906
137296
|
|
|
136907
|
-
Defined in: [sys/mod.ts:
|
|
137297
|
+
Defined in: [sys/mod.ts:873](https://github.com/maiyunnet/kebab/blob/master/sys/mod.ts#L873)
|
|
136908
137298
|
|
|
136909
137299
|
##### Type Parameters
|
|
136910
137300
|
|
|
@@ -136930,7 +137320,7 @@ Defined in: [sys/mod.ts:846](https://github.com/maiyunnet/kebab/blob/master/sys/
|
|
|
136930
137320
|
|
|
136931
137321
|
> **set**\<`T`, `TK`\>(`n`, `v`): `void`
|
|
136932
137322
|
|
|
136933
|
-
Defined in: [sys/mod.ts:
|
|
137323
|
+
Defined in: [sys/mod.ts:874](https://github.com/maiyunnet/kebab/blob/master/sys/mod.ts#L874)
|
|
136934
137324
|
|
|
136935
137325
|
##### Type Parameters
|
|
136936
137326
|
|
|
@@ -136962,7 +137352,7 @@ Defined in: [sys/mod.ts:847](https://github.com/maiyunnet/kebab/blob/master/sys/
|
|
|
136962
137352
|
|
|
136963
137353
|
> **toArray**\<`TC`\>(): [`TOnlyProperties`](../type-aliases/TOnlyProperties.md)\<`InstanceType`\<`TC`\>\> & `Record`\<`string`, `any`\>
|
|
136964
137354
|
|
|
136965
|
-
Defined in: [sys/mod.ts:
|
|
137355
|
+
Defined in: [sys/mod.ts:2026](https://github.com/maiyunnet/kebab/blob/master/sys/mod.ts#L2026)
|
|
136966
137356
|
|
|
136967
137357
|
获取值对象,获取的是新创建的数组
|
|
136968
137358
|
|
|
@@ -136982,7 +137372,7 @@ Defined in: [sys/mod.ts:2000](https://github.com/maiyunnet/kebab/blob/master/sys
|
|
|
136982
137372
|
|
|
136983
137373
|
> **total**(`f?`): `Promise`\<`number`\>
|
|
136984
137374
|
|
|
136985
|
-
Defined in: [sys/mod.ts:
|
|
137375
|
+
Defined in: [sys/mod.ts:1660](https://github.com/maiyunnet/kebab/blob/master/sys/mod.ts#L1660)
|
|
136986
137376
|
|
|
136987
137377
|
获取总条数,自动抛弃 LIMIT,仅用于获取数据的情况(select)
|
|
136988
137378
|
|
|
@@ -137002,7 +137392,7 @@ Defined in: [sys/mod.ts:1634](https://github.com/maiyunnet/kebab/blob/master/sys
|
|
|
137002
137392
|
|
|
137003
137393
|
> **totalEstimate**(): `Promise`\<`number` \| `false`\>
|
|
137004
137394
|
|
|
137005
|
-
Defined in: [sys/mod.ts:
|
|
137395
|
+
Defined in: [sys/mod.ts:1686](https://github.com/maiyunnet/kebab/blob/master/sys/mod.ts#L1686)
|
|
137006
137396
|
|
|
137007
137397
|
从 PostgreSQL 执行计划估算查询总行数,移除外层排序和分页,不执行数据扫描
|
|
137008
137398
|
请在应用游标条件前调用;非 PostgreSQL、框架分表联查或查询失败返回 false,绝不回退到 COUNT
|
|
@@ -137019,7 +137409,7 @@ Defined in: [sys/mod.ts:1660](https://github.com/maiyunnet/kebab/blob/master/sys
|
|
|
137019
137409
|
|
|
137020
137410
|
> **union**(`f`, `type?`): `this`
|
|
137021
137411
|
|
|
137022
|
-
Defined in: [sys/mod.ts:
|
|
137412
|
+
Defined in: [sys/mod.ts:1241](https://github.com/maiyunnet/kebab/blob/master/sys/mod.ts#L1241)
|
|
137023
137413
|
|
|
137024
137414
|
联合查询表数据
|
|
137025
137415
|
|
|
@@ -137047,7 +137437,7 @@ Defined in: [sys/mod.ts:1215](https://github.com/maiyunnet/kebab/blob/master/sys
|
|
|
137047
137437
|
|
|
137048
137438
|
> **unionAll**(`f`): `this`
|
|
137049
137439
|
|
|
137050
|
-
Defined in: [sys/mod.ts:
|
|
137440
|
+
Defined in: [sys/mod.ts:1271](https://github.com/maiyunnet/kebab/blob/master/sys/mod.ts#L1271)
|
|
137051
137441
|
|
|
137052
137442
|
所有联合查询表数据
|
|
137053
137443
|
|
|
@@ -137069,7 +137459,7 @@ Defined in: [sys/mod.ts:1245](https://github.com/maiyunnet/kebab/blob/master/sys
|
|
|
137069
137459
|
|
|
137070
137460
|
> **unsaved**(): `boolean`
|
|
137071
137461
|
|
|
137072
|
-
Defined in: [sys/mod.ts:
|
|
137462
|
+
Defined in: [sys/mod.ts:2045](https://github.com/maiyunnet/kebab/blob/master/sys/mod.ts#L2045)
|
|
137073
137463
|
|
|
137074
137464
|
当前是否设置了未保存 --=
|
|
137075
137465
|
|
|
@@ -137083,7 +137473,7 @@ Defined in: [sys/mod.ts:2019](https://github.com/maiyunnet/kebab/blob/master/sys
|
|
|
137083
137473
|
|
|
137084
137474
|
> **updates**(): `Record`\<`string`, `any`\>
|
|
137085
137475
|
|
|
137086
|
-
Defined in: [sys/mod.ts:
|
|
137476
|
+
Defined in: [sys/mod.ts:2034](https://github.com/maiyunnet/kebab/blob/master/sys/mod.ts#L2034)
|
|
137087
137477
|
|
|
137088
137478
|
获取当前设置要提交的数据
|
|
137089
137479
|
|
|
@@ -137097,7 +137487,7 @@ Defined in: [sys/mod.ts:2008](https://github.com/maiyunnet/kebab/blob/master/sys
|
|
|
137097
137487
|
|
|
137098
137488
|
> **upsert**(`conflict`): `Promise`\<`boolean`\>
|
|
137099
137489
|
|
|
137100
|
-
Defined in: [sys/mod.ts:
|
|
137490
|
+
Defined in: [sys/mod.ts:1022](https://github.com/maiyunnet/kebab/blob/master/sys/mod.ts#L1022)
|
|
137101
137491
|
|
|
137102
137492
|
插入数据,如果业务唯一键已存在则更新,保留已有主键和自动 key
|
|
137103
137493
|
PGSQL 为原子 UPSERT,自动 key 只生成一次,SQL 错误需回滚事务
|
|
@@ -137123,7 +137513,7 @@ MySQL 分步执行;自动 key 有多个唯一索引时须配置 _$index,整
|
|
|
137123
137513
|
|
|
137124
137514
|
> **where**(`s`): `this`
|
|
137125
137515
|
|
|
137126
|
-
Defined in: [sys/mod.ts:
|
|
137516
|
+
Defined in: [sys/mod.ts:1928](https://github.com/maiyunnet/kebab/blob/master/sys/mod.ts#L1928)
|
|
137127
137517
|
|
|
137128
137518
|
是 filter 的别名
|
|
137129
137519
|
|
|
@@ -137145,7 +137535,7 @@ Defined in: [sys/mod.ts:1902](https://github.com/maiyunnet/kebab/blob/master/sys
|
|
|
137145
137535
|
|
|
137146
137536
|
> `static` **column**(`field`): `object`
|
|
137147
137537
|
|
|
137148
|
-
Defined in: [sys/mod.ts:
|
|
137538
|
+
Defined in: [sys/mod.ts:200](https://github.com/maiyunnet/kebab/blob/master/sys/mod.ts#L200)
|
|
137149
137539
|
|
|
137150
137540
|
创建字段对象
|
|
137151
137541
|
|
|
@@ -137177,7 +137567,7 @@ Defined in: [sys/mod.ts:193](https://github.com/maiyunnet/kebab/blob/master/sys/
|
|
|
137177
137567
|
|
|
137178
137568
|
> `static` **find**\<`T`\>(`db`, `val`, `opt?`): `Promise`\<`false` \| `T` & `Record`\<`string`, `any`\> \| `null`\>
|
|
137179
137569
|
|
|
137180
|
-
Defined in: [sys/mod.ts:
|
|
137570
|
+
Defined in: [sys/mod.ts:649](https://github.com/maiyunnet/kebab/blob/master/sys/mod.ts#L649)
|
|
137181
137571
|
|
|
137182
137572
|
根据主键(或 key 字段)获取对象
|
|
137183
137573
|
|
|
@@ -137241,7 +137631,7 @@ Defined in: [sys/mod.ts:642](https://github.com/maiyunnet/kebab/blob/master/sys/
|
|
|
137241
137631
|
|
|
137242
137632
|
> `static` **getCreate**\<`T`\>(`db`, `opt?`): `T`
|
|
137243
137633
|
|
|
137244
|
-
Defined in: [sys/mod.ts:
|
|
137634
|
+
Defined in: [sys/mod.ts:631](https://github.com/maiyunnet/kebab/blob/master/sys/mod.ts#L631)
|
|
137245
137635
|
|
|
137246
137636
|
获取创建对象,通常用于新建数据库条目
|
|
137247
137637
|
|
|
@@ -137285,7 +137675,7 @@ Defined in: [sys/mod.ts:624](https://github.com/maiyunnet/kebab/blob/master/sys/
|
|
|
137285
137675
|
|
|
137286
137676
|
> `static` **insert**(`db`, `cs`, `vs?`, `opt?`): `Promise`\<`boolean` \| `null`\>
|
|
137287
137677
|
|
|
137288
|
-
Defined in: [sys/mod.ts:
|
|
137678
|
+
Defined in: [sys/mod.ts:229](https://github.com/maiyunnet/kebab/blob/master/sys/mod.ts#L229)
|
|
137289
137679
|
|
|
137290
137680
|
添加一个序列(允许超过 65536 的占位符会被拆分多次执行)
|
|
137291
137681
|
|
|
@@ -137339,7 +137729,7 @@ Defined in: [sys/mod.ts:222](https://github.com/maiyunnet/kebab/blob/master/sys/
|
|
|
137339
137729
|
|
|
137340
137730
|
> `static` **insertSql**(`db`, `cs`, `vs?`, `opt?`): `string`
|
|
137341
137731
|
|
|
137342
|
-
Defined in: [sys/mod.ts:
|
|
137732
|
+
Defined in: [sys/mod.ts:289](https://github.com/maiyunnet/kebab/blob/master/sys/mod.ts#L289)
|
|
137343
137733
|
|
|
137344
137734
|
获取添加一个序列的模拟 SQL
|
|
137345
137735
|
|
|
@@ -137393,7 +137783,7 @@ Defined in: [sys/mod.ts:282](https://github.com/maiyunnet/kebab/blob/master/sys/
|
|
|
137393
137783
|
|
|
137394
137784
|
> `static` **json**\<`T`\>(`obj`): `T`
|
|
137395
137785
|
|
|
137396
|
-
Defined in: [sys/mod.ts:
|
|
137786
|
+
Defined in: [sys/mod.ts:218](https://github.com/maiyunnet/kebab/blob/master/sys/mod.ts#L218)
|
|
137397
137787
|
|
|
137398
137788
|
标记 JSON 字段;模型内保持原始对象,写入数据库时再序列化
|
|
137399
137789
|
|
|
@@ -137441,7 +137831,7 @@ Defined in: [sys/mod.ts:211](https://github.com/maiyunnet/kebab/blob/master/sys/
|
|
|
137441
137831
|
|
|
137442
137832
|
> `static` **one**(`db`, `s`, `opt`): `Promise`\<`false` \| `Record`\<`string`, `any`\> \| `null`\>
|
|
137443
137833
|
|
|
137444
|
-
Defined in: [sys/mod.ts:
|
|
137834
|
+
Defined in: [sys/mod.ts:678](https://github.com/maiyunnet/kebab/blob/master/sys/mod.ts#L678)
|
|
137445
137835
|
|
|
137446
137836
|
##### Parameters
|
|
137447
137837
|
|
|
@@ -137495,7 +137885,7 @@ Defined in: [sys/mod.ts:671](https://github.com/maiyunnet/kebab/blob/master/sys/
|
|
|
137495
137885
|
|
|
137496
137886
|
> `static` **one**\<`T`\>(`db`, `s`, `opt?`): `Promise`\<`false` \| `T` & `Record`\<`string`, `any`\> \| `null`\>
|
|
137497
137887
|
|
|
137498
|
-
Defined in: [sys/mod.ts:
|
|
137888
|
+
Defined in: [sys/mod.ts:692](https://github.com/maiyunnet/kebab/blob/master/sys/mod.ts#L692)
|
|
137499
137889
|
|
|
137500
137890
|
##### Type Parameters
|
|
137501
137891
|
|
|
@@ -137557,7 +137947,7 @@ Defined in: [sys/mod.ts:685](https://github.com/maiyunnet/kebab/blob/master/sys/
|
|
|
137557
137947
|
|
|
137558
137948
|
> `static` **oneArray**(`db`, `s`, `opt?`): `Promise`\<`false` \| `Record`\<`string`, `any`\> \| `null`\>
|
|
137559
137949
|
|
|
137560
|
-
Defined in: [sys/mod.ts:
|
|
137950
|
+
Defined in: [sys/mod.ts:773](https://github.com/maiyunnet/kebab/blob/master/sys/mod.ts#L773)
|
|
137561
137951
|
|
|
137562
137952
|
通过 where 条件筛选单条数据返回原生对象
|
|
137563
137953
|
|
|
@@ -137613,7 +138003,7 @@ Defined in: [sys/mod.ts:766](https://github.com/maiyunnet/kebab/blob/master/sys/
|
|
|
137613
138003
|
|
|
137614
138004
|
> `static` **primarys**(`db`, `where?`, `opt?`): `Promise`\<`false` \| `any`[]\>
|
|
137615
138005
|
|
|
137616
|
-
Defined in: [sys/mod.ts:
|
|
138006
|
+
Defined in: [sys/mod.ts:795](https://github.com/maiyunnet/kebab/blob/master/sys/mod.ts#L795)
|
|
137617
138007
|
|
|
137618
138008
|
根据 where 条件获取主键值列表
|
|
137619
138009
|
|
|
@@ -137657,7 +138047,7 @@ where 条件
|
|
|
137657
138047
|
|
|
137658
138048
|
> `static` **removeByWhere**(`db`, `where`, `opt?`): `Promise`\<`number` \| `false` \| `null`\>
|
|
137659
138049
|
|
|
137660
|
-
Defined in: [sys/mod.ts:
|
|
138050
|
+
Defined in: [sys/mod.ts:315](https://github.com/maiyunnet/kebab/blob/master/sys/mod.ts#L315)
|
|
137661
138051
|
|
|
137662
138052
|
根据条件移除条目
|
|
137663
138053
|
|
|
@@ -137709,7 +138099,7 @@ Defined in: [sys/mod.ts:308](https://github.com/maiyunnet/kebab/blob/master/sys/
|
|
|
137709
138099
|
|
|
137710
138100
|
> `static` **removeByWhereSql**(`db`, `where`, `opt?`): [`Sql`](../../../lib/sql/classes/Sql.md)
|
|
137711
138101
|
|
|
137712
|
-
Defined in: [sys/mod.ts:
|
|
138102
|
+
Defined in: [sys/mod.ts:359](https://github.com/maiyunnet/kebab/blob/master/sys/mod.ts#L359)
|
|
137713
138103
|
|
|
137714
138104
|
根据条件移除条目(仅获取 SQL 对象)
|
|
137715
138105
|
|
|
@@ -137761,7 +138151,7 @@ Defined in: [sys/mod.ts:352](https://github.com/maiyunnet/kebab/blob/master/sys/
|
|
|
137761
138151
|
|
|
137762
138152
|
> `static` **select**\<`T`\>(`db`, `c`, `opt?`): `T` & `Record`\<`string`, `any`\>
|
|
137763
138153
|
|
|
137764
|
-
Defined in: [sys/mod.ts:
|
|
138154
|
+
Defined in: [sys/mod.ts:568](https://github.com/maiyunnet/kebab/blob/master/sys/mod.ts#L568)
|
|
137765
138155
|
|
|
137766
138156
|
select 自定字段
|
|
137767
138157
|
|
|
@@ -137831,7 +138221,7 @@ select 自定字段
|
|
|
137831
138221
|
|
|
137832
138222
|
> `static` **toArrayByRecord**\<`T`\>(`obj`): `Record`\<`string`, `Record`\<`string`, `any`\>\>
|
|
137833
138223
|
|
|
137834
|
-
Defined in: [sys/mod.ts:
|
|
138224
|
+
Defined in: [sys/mod.ts:822](https://github.com/maiyunnet/kebab/blob/master/sys/mod.ts#L822)
|
|
137835
138225
|
|
|
137836
138226
|
将 key val 组成的数据列表转换为原生对象模式,获取的是新创建的数组
|
|
137837
138227
|
|
|
@@ -137859,7 +138249,7 @@ Defined in: [sys/mod.ts:815](https://github.com/maiyunnet/kebab/blob/master/sys/
|
|
|
137859
138249
|
|
|
137860
138250
|
> `static` **updateByWhere**(`db`, `data`, `where`, `opt?`): `Promise`\<`number` \| `false` \| `null`\>
|
|
137861
138251
|
|
|
137862
|
-
Defined in: [sys/mod.ts:
|
|
138252
|
+
Defined in: [sys/mod.ts:392](https://github.com/maiyunnet/kebab/blob/master/sys/mod.ts#L392)
|
|
137863
138253
|
|
|
137864
138254
|
根据条件更新数据
|
|
137865
138255
|
|
|
@@ -137917,7 +138307,7 @@ Defined in: [sys/mod.ts:385](https://github.com/maiyunnet/kebab/blob/master/sys/
|
|
|
137917
138307
|
|
|
137918
138308
|
> `static` **updateByWhereSql**(`db`, `data`, `where`, `opt?`): [`Sql`](../../../lib/sql/classes/Sql.md)
|
|
137919
138309
|
|
|
137920
|
-
Defined in: [sys/mod.ts:
|
|
138310
|
+
Defined in: [sys/mod.ts:438](https://github.com/maiyunnet/kebab/blob/master/sys/mod.ts#L438)
|
|
137921
138311
|
|
|
137922
138312
|
根据条件更新数据(仅获取 SQL 对象)
|
|
137923
138313
|
|
|
@@ -137975,7 +138365,7 @@ Defined in: [sys/mod.ts:431](https://github.com/maiyunnet/kebab/blob/master/sys/
|
|
|
137975
138365
|
|
|
137976
138366
|
> `static` **updateList**(`db`, `data`, `key`, `opt?`): `Promise`\<`boolean` \| `null`\>
|
|
137977
138367
|
|
|
137978
|
-
Defined in: [sys/mod.ts:
|
|
138368
|
+
Defined in: [sys/mod.ts:476](https://github.com/maiyunnet/kebab/blob/master/sys/mod.ts#L476)
|
|
137979
138369
|
|
|
137980
138370
|
批量更新数据
|
|
137981
138371
|
|
|
@@ -138033,7 +138423,7 @@ Defined in: [sys/mod.ts:469](https://github.com/maiyunnet/kebab/blob/master/sys/
|
|
|
138033
138423
|
|
|
138034
138424
|
> `static` **value**(`val`): `object`
|
|
138035
138425
|
|
|
138036
|
-
Defined in: [sys/mod.ts:
|
|
138426
|
+
Defined in: [sys/mod.ts:209](https://github.com/maiyunnet/kebab/blob/master/sys/mod.ts#L209)
|
|
138037
138427
|
|
|
138038
138428
|
创建字面量值对象,用于 where 条件中 v[0] 需要是值而非字段名的场景
|
|
138039
138429
|
|
|
@@ -138065,7 +138455,7 @@ Defined in: [sys/mod.ts:202](https://github.com/maiyunnet/kebab/blob/master/sys/
|
|
|
138065
138455
|
|
|
138066
138456
|
> `static` **where**\<`T`\>(`db`, `s?`, `opt?`): `T` & `Record`\<`string`, `any`\>
|
|
138067
138457
|
|
|
138068
|
-
Defined in: [sys/mod.ts:
|
|
138458
|
+
Defined in: [sys/mod.ts:600](https://github.com/maiyunnet/kebab/blob/master/sys/mod.ts#L600)
|
|
138069
138459
|
|
|
138070
138460
|
通过 where 条件获取模型
|
|
138071
138461
|
|
|
@@ -138388,7 +138778,7 @@ sys/mod/interfaces/IModUnionItem.md
|
|
|
138388
138778
|
|
|
138389
138779
|
# Interface: IModUnionItem
|
|
138390
138780
|
|
|
138391
|
-
Defined in: [sys/mod.ts:
|
|
138781
|
+
Defined in: [sys/mod.ts:2088](https://github.com/maiyunnet/kebab/blob/master/sys/mod.ts#L2088)
|
|
138392
138782
|
|
|
138393
138783
|
## Properties
|
|
138394
138784
|
|
|
@@ -138396,7 +138786,7 @@ Defined in: [sys/mod.ts:2062](https://github.com/maiyunnet/kebab/blob/master/sys
|
|
|
138396
138786
|
|
|
138397
138787
|
> **field**: `string`
|
|
138398
138788
|
|
|
138399
|
-
Defined in: [sys/mod.ts:
|
|
138789
|
+
Defined in: [sys/mod.ts:2089](https://github.com/maiyunnet/kebab/blob/master/sys/mod.ts#L2089)
|
|
138400
138790
|
|
|
138401
138791
|
***
|
|
138402
138792
|
|
|
@@ -138404,7 +138794,7 @@ Defined in: [sys/mod.ts:2063](https://github.com/maiyunnet/kebab/blob/master/sys
|
|
|
138404
138794
|
|
|
138405
138795
|
> `optional` **where?**: `any`
|
|
138406
138796
|
|
|
138407
|
-
Defined in: [sys/mod.ts:
|
|
138797
|
+
Defined in: [sys/mod.ts:2090](https://github.com/maiyunnet/kebab/blob/master/sys/mod.ts#L2090)
|
|
138408
138798
|
|
|
138409
138799
|
sys/mod/interfaces/IRows.md
|
|
138410
138800
|
---
|
|
@@ -138417,7 +138807,7 @@ sys/mod/interfaces/IRows.md
|
|
|
138417
138807
|
|
|
138418
138808
|
# Interface: IRows\<T\>
|
|
138419
138809
|
|
|
138420
|
-
Defined in: [sys/mod.ts:
|
|
138810
|
+
Defined in: [sys/mod.ts:2082](https://github.com/maiyunnet/kebab/blob/master/sys/mod.ts#L2082)
|
|
138421
138811
|
|
|
138422
138812
|
## Extends
|
|
138423
138813
|
|
|
@@ -138435,7 +138825,7 @@ Defined in: [sys/mod.ts:2056](https://github.com/maiyunnet/kebab/blob/master/sys
|
|
|
138435
138825
|
|
|
138436
138826
|
> `readonly` **length**: `number`
|
|
138437
138827
|
|
|
138438
|
-
Defined in: [sys/mod.ts:
|
|
138828
|
+
Defined in: [sys/mod.ts:2083](https://github.com/maiyunnet/kebab/blob/master/sys/mod.ts#L2083)
|
|
138439
138829
|
|
|
138440
138830
|
## Methods
|
|
138441
138831
|
|
|
@@ -138443,7 +138833,7 @@ Defined in: [sys/mod.ts:2057](https://github.com/maiyunnet/kebab/blob/master/sys
|
|
|
138443
138833
|
|
|
138444
138834
|
> **item**(`index`): `T`
|
|
138445
138835
|
|
|
138446
|
-
Defined in: [sys/mod.ts:
|
|
138836
|
+
Defined in: [sys/mod.ts:2084](https://github.com/maiyunnet/kebab/blob/master/sys/mod.ts#L2084)
|
|
138447
138837
|
|
|
138448
138838
|
#### Parameters
|
|
138449
138839
|
|
|
@@ -138461,7 +138851,7 @@ Defined in: [sys/mod.ts:2058](https://github.com/maiyunnet/kebab/blob/master/sys
|
|
|
138461
138851
|
|
|
138462
138852
|
> **toArray**(): `Record`\<`string`, `any`\>[]
|
|
138463
138853
|
|
|
138464
|
-
Defined in: [sys/mod.ts:
|
|
138854
|
+
Defined in: [sys/mod.ts:2085](https://github.com/maiyunnet/kebab/blob/master/sys/mod.ts#L2085)
|
|
138465
138855
|
|
|
138466
138856
|
#### Returns
|
|
138467
138857
|
|
|
@@ -138503,7 +138893,7 @@ sys/route/functions/clearKebabConfigs.md
|
|
|
138503
138893
|
|
|
138504
138894
|
> **clearKebabConfigs**(): `void`
|
|
138505
138895
|
|
|
138506
|
-
Defined in: [sys/route.ts:
|
|
138896
|
+
Defined in: [sys/route.ts:47](https://github.com/maiyunnet/kebab/blob/master/sys/route.ts#L47)
|
|
138507
138897
|
|
|
138508
138898
|
清空缓存的项目配置,下次请求时重新读取文件
|
|
138509
138899
|
|
|
@@ -138524,7 +138914,7 @@ sys/route/functions/getFormData.md
|
|
|
138524
138914
|
|
|
138525
138915
|
> **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)\>; \}\>
|
|
138526
138916
|
|
|
138527
|
-
Defined in: [sys/route.ts:
|
|
138917
|
+
Defined in: [sys/route.ts:1102](https://github.com/maiyunnet/kebab/blob/master/sys/route.ts#L1102)
|
|
138528
138918
|
|
|
138529
138919
|
获取 formdata 的 post
|
|
138530
138920
|
|
|
@@ -138567,7 +138957,7 @@ sys/route/functions/getPost.md
|
|
|
138567
138957
|
|
|
138568
138958
|
> **getPost**(`req`): `Promise`\<`false` \| \{ `input`: `string`; `post`: `Record`\<`string`, `any`\>; `raw`: `Record`\<`string`, `any`\>; \}\>
|
|
138569
138959
|
|
|
138570
|
-
Defined in: [sys/route.ts:
|
|
138960
|
+
Defined in: [sys/route.ts:937](https://github.com/maiyunnet/kebab/blob/master/sys/route.ts#L937)
|
|
138571
138961
|
|
|
138572
138962
|
获取 post 对象(通常已自动获取),如果是文件上传(formdata)的情况则不获取
|
|
138573
138963
|
|
|
@@ -138598,7 +138988,7 @@ sys/route/functions/run.md
|
|
|
138598
138988
|
|
|
138599
138989
|
> **run**(`data`): `Promise`\<`boolean`\>
|
|
138600
138990
|
|
|
138601
|
-
Defined in: [sys/route.ts:
|
|
138991
|
+
Defined in: [sys/route.ts:116](https://github.com/maiyunnet/kebab/blob/master/sys/route.ts#L116)
|
|
138602
138992
|
|
|
138603
138993
|
若为动态路径则执行此函数,此函数不进行判断 kebab.json 是否存在
|
|
138604
138994
|
|
|
@@ -138685,7 +139075,7 @@ sys/route/functions/unlinkUploadFiles.md
|
|
|
138685
139075
|
|
|
138686
139076
|
> **unlinkUploadFiles**(`cctr`): `Promise`\<`void`\>
|
|
138687
139077
|
|
|
138688
|
-
Defined in: [sys/route.ts:
|
|
139078
|
+
Defined in: [sys/route.ts:895](https://github.com/maiyunnet/kebab/blob/master/sys/route.ts#L895)
|
|
138689
139079
|
|
|
138690
139080
|
删除本次请求所有已上传的临时文件
|
|
138691
139081
|
|
|
@@ -138714,7 +139104,7 @@ sys/route/functions/waitCtr.md
|
|
|
138714
139104
|
|
|
138715
139105
|
> **waitCtr**(`cctr`): `Promise`\<`void`\>
|
|
138716
139106
|
|
|
138717
|
-
Defined in: [sys/route.ts:
|
|
139107
|
+
Defined in: [sys/route.ts:915](https://github.com/maiyunnet/kebab/blob/master/sys/route.ts#L915)
|
|
138718
139108
|
|
|
138719
139109
|
等待异步任务结束,并删除临时文件,如果结束后还有事务没关闭,则会在本函数中打印控制台并且写入 log 文件
|
|
138720
139110
|
此时其实已经给客户端返回了,此处等待不消耗客户端的等待时间
|
|
@@ -138768,7 +139158,7 @@ sys/route/interfaces/IFormDataError.md
|
|
|
138768
139158
|
|
|
138769
139159
|
# Interface: IFormDataError
|
|
138770
139160
|
|
|
138771
|
-
Defined in: [sys/route.ts:
|
|
139161
|
+
Defined in: [sys/route.ts:1057](https://github.com/maiyunnet/kebab/blob/master/sys/route.ts#L1057)
|
|
138772
139162
|
|
|
138773
139163
|
解析上传数据时的失败原因,只提供错误码和限制值,不带临时路径或异常对象
|
|
138774
139164
|
|
|
@@ -138778,7 +139168,7 @@ Defined in: [sys/route.ts:1056](https://github.com/maiyunnet/kebab/blob/master/s
|
|
|
138778
139168
|
|
|
138779
139169
|
> **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"`
|
|
138780
139170
|
|
|
138781
|
-
Defined in: [sys/route.ts:
|
|
139171
|
+
Defined in: [sys/route.ts:1058](https://github.com/maiyunnet/kebab/blob/master/sys/route.ts#L1058)
|
|
138782
139172
|
|
|
138783
139173
|
***
|
|
138784
139174
|
|
|
@@ -138786,7 +139176,7 @@ Defined in: [sys/route.ts:1057](https://github.com/maiyunnet/kebab/blob/master/s
|
|
|
138786
139176
|
|
|
138787
139177
|
> `optional` **limit?**: `number`
|
|
138788
139178
|
|
|
138789
|
-
Defined in: [sys/route.ts:
|
|
139179
|
+
Defined in: [sys/route.ts:1062](https://github.com/maiyunnet/kebab/blob/master/sys/route.ts#L1062)
|
|
138790
139180
|
|
|
138791
139181
|
超出的限制值:大小用字节,超时用毫秒,字段和文件数量用个
|
|
138792
139182
|
|
|
@@ -138801,7 +139191,7 @@ sys/route/interfaces/IFormDataEvents.md
|
|
|
138801
139191
|
|
|
138802
139192
|
# Interface: IFormDataEvents
|
|
138803
139193
|
|
|
138804
|
-
Defined in: [sys/route.ts:
|
|
139194
|
+
Defined in: [sys/route.ts:1066](https://github.com/maiyunnet/kebab/blob/master/sys/route.ts#L1066)
|
|
138805
139195
|
|
|
138806
139196
|
multipart 文件处理及失败通知
|
|
138807
139197
|
|
|
@@ -138811,7 +139201,7 @@ multipart 文件处理及失败通知
|
|
|
138811
139201
|
|
|
138812
139202
|
> `optional` **onerror?**: (`error`) => `void`
|
|
138813
139203
|
|
|
138814
|
-
Defined in: [sys/route.ts:
|
|
139204
|
+
Defined in: [sys/route.ts:1074](https://github.com/maiyunnet/kebab/blob/master/sys/route.ts#L1074)
|
|
138815
139205
|
|
|
138816
139206
|
首次失败时调用一次,getFormData 返回 false;若连接已断开,可能无法回复客户端
|
|
138817
139207
|
|
|
@@ -138831,7 +139221,7 @@ Defined in: [sys/route.ts:1073](https://github.com/maiyunnet/kebab/blob/master/s
|
|
|
138831
139221
|
|
|
138832
139222
|
> `optional` **onfiledata?**: (`chunk`) => `void`
|
|
138833
139223
|
|
|
138834
|
-
Defined in: [sys/route.ts:
|
|
139224
|
+
Defined in: [sys/route.ts:1070](https://github.com/maiyunnet/kebab/blob/master/sys/route.ts#L1070)
|
|
138835
139225
|
|
|
138836
139226
|
文件上传时触发,仅 start 返回 true 时触发
|
|
138837
139227
|
|
|
@@ -138851,7 +139241,7 @@ Defined in: [sys/route.ts:1069](https://github.com/maiyunnet/kebab/blob/master/s
|
|
|
138851
139241
|
|
|
138852
139242
|
> `optional` **onfileend?**: () => `void`
|
|
138853
139243
|
|
|
138854
|
-
Defined in: [sys/route.ts:
|
|
139244
|
+
Defined in: [sys/route.ts:1072](https://github.com/maiyunnet/kebab/blob/master/sys/route.ts#L1072)
|
|
138855
139245
|
|
|
138856
139246
|
文件上传结束时触发,仅 start 返回 true 时触发
|
|
138857
139247
|
|
|
@@ -138865,7 +139255,7 @@ Defined in: [sys/route.ts:1071](https://github.com/maiyunnet/kebab/blob/master/s
|
|
|
138865
139255
|
|
|
138866
139256
|
> `optional` **onfilestart?**: (`name`) => `boolean` \| `undefined`
|
|
138867
139257
|
|
|
138868
|
-
Defined in: [sys/route.ts:
|
|
139258
|
+
Defined in: [sys/route.ts:1068](https://github.com/maiyunnet/kebab/blob/master/sys/route.ts#L1068)
|
|
138869
139259
|
|
|
138870
139260
|
文件开始上传时触发,返回 true 则跳过该文件的保存
|
|
138871
139261
|
|
|
@@ -138890,7 +139280,7 @@ sys/route/interfaces/IFormDataLimits.md
|
|
|
138890
139280
|
|
|
138891
139281
|
# Interface: IFormDataLimits
|
|
138892
139282
|
|
|
138893
|
-
Defined in: [sys/route.ts:
|
|
139283
|
+
Defined in: [sys/route.ts:1078](https://github.com/maiyunnet/kebab/blob/master/sys/route.ts#L1078)
|
|
138894
139284
|
|
|
138895
139285
|
multipart 上传限制
|
|
138896
139286
|
|
|
@@ -138900,7 +139290,7 @@ multipart 上传限制
|
|
|
138900
139290
|
|
|
138901
139291
|
> `optional` **allowedExts?**: `string`[]
|
|
138902
139292
|
|
|
138903
|
-
Defined in: [sys/route.ts:
|
|
139293
|
+
Defined in: [sys/route.ts:1082](https://github.com/maiyunnet/kebab/blob/master/sys/route.ts#L1082)
|
|
138904
139294
|
|
|
138905
139295
|
允许的文件扩展名(含点号),如 ['.jpg', '.png', '.pdf']
|
|
138906
139296
|
|
|
@@ -138910,7 +139300,7 @@ Defined in: [sys/route.ts:1081](https://github.com/maiyunnet/kebab/blob/master/s
|
|
|
138910
139300
|
|
|
138911
139301
|
> `optional` **maxFieldSize?**: `number`
|
|
138912
139302
|
|
|
138913
|
-
Defined in: [sys/route.ts:
|
|
139303
|
+
Defined in: [sys/route.ts:1084](https://github.com/maiyunnet/kebab/blob/master/sys/route.ts#L1084)
|
|
138914
139304
|
|
|
138915
139305
|
单个字段(非文件)最大字节数,默认 1 MB
|
|
138916
139306
|
|
|
@@ -138920,7 +139310,7 @@ Defined in: [sys/route.ts:1083](https://github.com/maiyunnet/kebab/blob/master/s
|
|
|
138920
139310
|
|
|
138921
139311
|
> `optional` **maxFileSize?**: `number`
|
|
138922
139312
|
|
|
138923
|
-
Defined in: [sys/route.ts:
|
|
139313
|
+
Defined in: [sys/route.ts:1080](https://github.com/maiyunnet/kebab/blob/master/sys/route.ts#L1080)
|
|
138924
139314
|
|
|
138925
139315
|
单个文件最大字节数
|
|
138926
139316
|
|
|
@@ -138930,7 +139320,7 @@ Defined in: [sys/route.ts:1079](https://github.com/maiyunnet/kebab/blob/master/s
|
|
|
138930
139320
|
|
|
138931
139321
|
> `optional` **maxHeaderSize?**: `number`
|
|
138932
139322
|
|
|
138933
|
-
Defined in: [sys/route.ts:
|
|
139323
|
+
Defined in: [sys/route.ts:1088](https://github.com/maiyunnet/kebab/blob/master/sys/route.ts#L1088)
|
|
138934
139324
|
|
|
138935
139325
|
每个字段或文件的 multipart 头部最多多少字节,默认 16 KB
|
|
138936
139326
|
|
|
@@ -138940,7 +139330,7 @@ Defined in: [sys/route.ts:1087](https://github.com/maiyunnet/kebab/blob/master/s
|
|
|
138940
139330
|
|
|
138941
139331
|
> `optional` **maxParts?**: `number`
|
|
138942
139332
|
|
|
138943
|
-
Defined in: [sys/route.ts:
|
|
139333
|
+
Defined in: [sys/route.ts:1090](https://github.com/maiyunnet/kebab/blob/master/sys/route.ts#L1090)
|
|
138944
139334
|
|
|
138945
139335
|
multipart 字段与文件总数量,默认 1000
|
|
138946
139336
|
|
|
@@ -138950,7 +139340,7 @@ multipart 字段与文件总数量,默认 1000
|
|
|
138950
139340
|
|
|
138951
139341
|
> `optional` **maxTotalSize?**: `number`
|
|
138952
139342
|
|
|
138953
|
-
Defined in: [sys/route.ts:
|
|
139343
|
+
Defined in: [sys/route.ts:1086](https://github.com/maiyunnet/kebab/blob/master/sys/route.ts#L1086)
|
|
138954
139344
|
|
|
138955
139345
|
整体请求最大字节数,不设置或设为 0 则不限制
|
|
138956
139346
|
|
|
@@ -138960,6 +139350,6 @@ Defined in: [sys/route.ts:1085](https://github.com/maiyunnet/kebab/blob/master/s
|
|
|
138960
139350
|
|
|
138961
139351
|
> `optional` **timeout?**: `number`
|
|
138962
139352
|
|
|
138963
|
-
Defined in: [sys/route.ts:
|
|
139353
|
+
Defined in: [sys/route.ts:1092](https://github.com/maiyunnet/kebab/blob/master/sys/route.ts#L1092)
|
|
138964
139354
|
|
|
138965
139355
|
整体请求超时时间(毫秒),默认 5 分钟,设为 0 禁用超时
|