@maiyunnet/kebab 9.13.6 → 9.13.8
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/doc/kebab-rag.md +197 -109
- package/index.d.ts +2 -2
- package/index.js +2 -2
- package/lib/db/conn.js +5 -2
- package/lib/net.d.ts +8 -0
- package/lib/net.js +20 -0
- package/lib/undici/response.d.ts +1 -1
- package/lib/undici.d.ts +8 -0
- package/lib/undici.js +20 -0
- package/package.json +1 -1
- package/sys/child.js +6 -2
- package/sys/route.js +18 -8
package/doc/kebab-rag.md
CHANGED
|
@@ -1360,7 +1360,7 @@ index/variables/VER.md
|
|
|
1360
1360
|
|
|
1361
1361
|
# Variable: VER
|
|
1362
1362
|
|
|
1363
|
-
> `const` **VER**: `"9.13.
|
|
1363
|
+
> `const` **VER**: `"9.13.8"` = `'9.13.8'`
|
|
1364
1364
|
|
|
1365
1365
|
Defined in: [index.ts:10](https://github.com/maiyunnet/kebab/blob/master/index.ts#L10)
|
|
1366
1366
|
|
|
@@ -6829,7 +6829,7 @@ lib/db/conn/classes/Connection.md
|
|
|
6829
6829
|
|
|
6830
6830
|
# Class: Connection
|
|
6831
6831
|
|
|
6832
|
-
Defined in: [lib/db/conn.ts:
|
|
6832
|
+
Defined in: [lib/db/conn.ts:37](https://github.com/maiyunnet/kebab/blob/master/lib/db/conn.ts#L37)
|
|
6833
6833
|
|
|
6834
6834
|
数据库连接对象
|
|
6835
6835
|
|
|
@@ -6839,7 +6839,7 @@ Defined in: [lib/db/conn.ts:34](https://github.com/maiyunnet/kebab/blob/master/l
|
|
|
6839
6839
|
|
|
6840
6840
|
> **new Connection**(`etc`, `link`): `Connection`
|
|
6841
6841
|
|
|
6842
|
-
Defined in: [lib/db/conn.ts:
|
|
6842
|
+
Defined in: [lib/db/conn.ts:62](https://github.com/maiyunnet/kebab/blob/master/lib/db/conn.ts#L62)
|
|
6843
6843
|
|
|
6844
6844
|
#### Parameters
|
|
6845
6845
|
|
|
@@ -6861,7 +6861,7 @@ Defined in: [lib/db/conn.ts:59](https://github.com/maiyunnet/kebab/blob/master/l
|
|
|
6861
6861
|
|
|
6862
6862
|
> **beginTransaction**(): `Promise`\<`boolean`\>
|
|
6863
6863
|
|
|
6864
|
-
Defined in: [lib/db/conn.ts:
|
|
6864
|
+
Defined in: [lib/db/conn.ts:322](https://github.com/maiyunnet/kebab/blob/master/lib/db/conn.ts#L322)
|
|
6865
6865
|
|
|
6866
6866
|
#### Returns
|
|
6867
6867
|
|
|
@@ -6873,7 +6873,7 @@ Defined in: [lib/db/conn.ts:319](https://github.com/maiyunnet/kebab/blob/master/
|
|
|
6873
6873
|
|
|
6874
6874
|
> **commit**(): `Promise`\<`boolean`\>
|
|
6875
6875
|
|
|
6876
|
-
Defined in: [lib/db/conn.ts:
|
|
6876
|
+
Defined in: [lib/db/conn.ts:343](https://github.com/maiyunnet/kebab/blob/master/lib/db/conn.ts#L343)
|
|
6877
6877
|
|
|
6878
6878
|
#### Returns
|
|
6879
6879
|
|
|
@@ -6885,7 +6885,7 @@ Defined in: [lib/db/conn.ts:340](https://github.com/maiyunnet/kebab/blob/master/
|
|
|
6885
6885
|
|
|
6886
6886
|
> **end**(): `Promise`\<`boolean`\>
|
|
6887
6887
|
|
|
6888
|
-
Defined in: [lib/db/conn.ts:
|
|
6888
|
+
Defined in: [lib/db/conn.ts:311](https://github.com/maiyunnet/kebab/blob/master/lib/db/conn.ts#L311)
|
|
6889
6889
|
|
|
6890
6890
|
关闭连接,一般情况下不使用
|
|
6891
6891
|
|
|
@@ -6899,7 +6899,7 @@ Defined in: [lib/db/conn.ts:308](https://github.com/maiyunnet/kebab/blob/master/
|
|
|
6899
6899
|
|
|
6900
6900
|
> **execute**(`sql`, `values?`): `Promise`\<[`IPacket`](../../interfaces/IPacket.md)\>
|
|
6901
6901
|
|
|
6902
|
-
Defined in: [lib/db/conn.ts:
|
|
6902
|
+
Defined in: [lib/db/conn.ts:238](https://github.com/maiyunnet/kebab/blob/master/lib/db/conn.ts#L238)
|
|
6903
6903
|
|
|
6904
6904
|
执行一条 SQL 并获得影响行数对象 packet
|
|
6905
6905
|
|
|
@@ -6927,7 +6927,7 @@ Defined in: [lib/db/conn.ts:235](https://github.com/maiyunnet/kebab/blob/master/
|
|
|
6927
6927
|
|
|
6928
6928
|
> **getEtc**(): [`IConfigDb`](../../../../index/interfaces/IConfigDb.md)
|
|
6929
6929
|
|
|
6930
|
-
Defined in: [lib/db/conn.ts:
|
|
6930
|
+
Defined in: [lib/db/conn.ts:71](https://github.com/maiyunnet/kebab/blob/master/lib/db/conn.ts#L71)
|
|
6931
6931
|
|
|
6932
6932
|
获取连接 etc 信息
|
|
6933
6933
|
|
|
@@ -6941,7 +6941,7 @@ Defined in: [lib/db/conn.ts:68](https://github.com/maiyunnet/kebab/blob/master/l
|
|
|
6941
6941
|
|
|
6942
6942
|
> **getLast**(): `number`
|
|
6943
6943
|
|
|
6944
|
-
Defined in: [lib/db/conn.ts:
|
|
6944
|
+
Defined in: [lib/db/conn.ts:83](https://github.com/maiyunnet/kebab/blob/master/lib/db/conn.ts#L83)
|
|
6945
6945
|
|
|
6946
6946
|
获取最后一次获取连接的时间
|
|
6947
6947
|
|
|
@@ -6955,7 +6955,7 @@ Defined in: [lib/db/conn.ts:80](https://github.com/maiyunnet/kebab/blob/master/l
|
|
|
6955
6955
|
|
|
6956
6956
|
> **getLastSql**(): `object`[]
|
|
6957
6957
|
|
|
6958
|
-
Defined in: [lib/db/conn.ts:
|
|
6958
|
+
Defined in: [lib/db/conn.ts:90](https://github.com/maiyunnet/kebab/blob/master/lib/db/conn.ts#L90)
|
|
6959
6959
|
|
|
6960
6960
|
获取最后两次执行的 sql 字符串
|
|
6961
6961
|
|
|
@@ -6969,7 +6969,7 @@ Defined in: [lib/db/conn.ts:87](https://github.com/maiyunnet/kebab/blob/master/l
|
|
|
6969
6969
|
|
|
6970
6970
|
> **getService**(): [`ESERVICE`](../../enumerations/ESERVICE.md)
|
|
6971
6971
|
|
|
6972
|
-
Defined in: [lib/db/conn.ts:
|
|
6972
|
+
Defined in: [lib/db/conn.ts:76](https://github.com/maiyunnet/kebab/blob/master/lib/db/conn.ts#L76)
|
|
6973
6973
|
|
|
6974
6974
|
获取数据库服务类型
|
|
6975
6975
|
|
|
@@ -6983,7 +6983,7 @@ Defined in: [lib/db/conn.ts:73](https://github.com/maiyunnet/kebab/blob/master/l
|
|
|
6983
6983
|
|
|
6984
6984
|
> **isAvailable**(`last?`): `Promise`\<`boolean`\>
|
|
6985
6985
|
|
|
6986
|
-
Defined in: [lib/db/conn.ts:
|
|
6986
|
+
Defined in: [lib/db/conn.ts:157](https://github.com/maiyunnet/kebab/blob/master/lib/db/conn.ts#L157)
|
|
6987
6987
|
|
|
6988
6988
|
通过执行一条语句判断当前连接是否可用
|
|
6989
6989
|
|
|
@@ -7005,7 +7005,7 @@ Defined in: [lib/db/conn.ts:154](https://github.com/maiyunnet/kebab/blob/master/
|
|
|
7005
7005
|
|
|
7006
7006
|
> **isLost**(): `boolean`
|
|
7007
7007
|
|
|
7008
|
-
Defined in: [lib/db/conn.ts:
|
|
7008
|
+
Defined in: [lib/db/conn.ts:107](https://github.com/maiyunnet/kebab/blob/master/lib/db/conn.ts#L107)
|
|
7009
7009
|
|
|
7010
7010
|
是否已经丢失
|
|
7011
7011
|
|
|
@@ -7019,7 +7019,7 @@ Defined in: [lib/db/conn.ts:104](https://github.com/maiyunnet/kebab/blob/master/
|
|
|
7019
7019
|
|
|
7020
7020
|
> **isTransaction**(): `boolean`
|
|
7021
7021
|
|
|
7022
|
-
Defined in: [lib/db/conn.ts:
|
|
7022
|
+
Defined in: [lib/db/conn.ts:114](https://github.com/maiyunnet/kebab/blob/master/lib/db/conn.ts#L114)
|
|
7023
7023
|
|
|
7024
7024
|
是否是开启事务状态
|
|
7025
7025
|
|
|
@@ -7033,7 +7033,7 @@ Defined in: [lib/db/conn.ts:111](https://github.com/maiyunnet/kebab/blob/master/
|
|
|
7033
7033
|
|
|
7034
7034
|
> **isUsing**(): `boolean`
|
|
7035
7035
|
|
|
7036
|
-
Defined in: [lib/db/conn.ts:
|
|
7036
|
+
Defined in: [lib/db/conn.ts:121](https://github.com/maiyunnet/kebab/blob/master/lib/db/conn.ts#L121)
|
|
7037
7037
|
|
|
7038
7038
|
获取当前状态是否正在被使用中
|
|
7039
7039
|
|
|
@@ -7047,7 +7047,7 @@ Defined in: [lib/db/conn.ts:118](https://github.com/maiyunnet/kebab/blob/master/
|
|
|
7047
7047
|
|
|
7048
7048
|
> **query**(`sql`, `values?`): `Promise`\<[`IData`](../../interfaces/IData.md)\>
|
|
7049
7049
|
|
|
7050
|
-
Defined in: [lib/db/conn.ts:
|
|
7050
|
+
Defined in: [lib/db/conn.ts:180](https://github.com/maiyunnet/kebab/blob/master/lib/db/conn.ts#L180)
|
|
7051
7051
|
|
|
7052
7052
|
执行一条 SQL 并获得返回数据
|
|
7053
7053
|
|
|
@@ -7075,7 +7075,7 @@ Defined in: [lib/db/conn.ts:177](https://github.com/maiyunnet/kebab/blob/master/
|
|
|
7075
7075
|
|
|
7076
7076
|
> **refreshLast**(): `void`
|
|
7077
7077
|
|
|
7078
|
-
Defined in: [lib/db/conn.ts:
|
|
7078
|
+
Defined in: [lib/db/conn.ts:149](https://github.com/maiyunnet/kebab/blob/master/lib/db/conn.ts#L149)
|
|
7079
7079
|
|
|
7080
7080
|
设定最后使用时间
|
|
7081
7081
|
|
|
@@ -7089,7 +7089,7 @@ Defined in: [lib/db/conn.ts:146](https://github.com/maiyunnet/kebab/blob/master/
|
|
|
7089
7089
|
|
|
7090
7090
|
> **rollback**(): `Promise`\<`boolean`\>
|
|
7091
7091
|
|
|
7092
|
-
Defined in: [lib/db/conn.ts:
|
|
7092
|
+
Defined in: [lib/db/conn.ts:361](https://github.com/maiyunnet/kebab/blob/master/lib/db/conn.ts#L361)
|
|
7093
7093
|
|
|
7094
7094
|
#### Returns
|
|
7095
7095
|
|
|
@@ -7101,7 +7101,7 @@ Defined in: [lib/db/conn.ts:358](https://github.com/maiyunnet/kebab/blob/master/
|
|
|
7101
7101
|
|
|
7102
7102
|
> **setLost**(): `void`
|
|
7103
7103
|
|
|
7104
|
-
Defined in: [lib/db/conn.ts:
|
|
7104
|
+
Defined in: [lib/db/conn.ts:100](https://github.com/maiyunnet/kebab/blob/master/lib/db/conn.ts#L100)
|
|
7105
7105
|
|
|
7106
7106
|
将本条连接设置为不可用
|
|
7107
7107
|
|
|
@@ -7115,7 +7115,7 @@ Defined in: [lib/db/conn.ts:97](https://github.com/maiyunnet/kebab/blob/master/l
|
|
|
7115
7115
|
|
|
7116
7116
|
> **used**(): `void`
|
|
7117
7117
|
|
|
7118
|
-
Defined in: [lib/db/conn.ts:
|
|
7118
|
+
Defined in: [lib/db/conn.ts:142](https://github.com/maiyunnet/kebab/blob/master/lib/db/conn.ts#L142)
|
|
7119
7119
|
|
|
7120
7120
|
取消占用
|
|
7121
7121
|
|
|
@@ -7129,7 +7129,7 @@ Defined in: [lib/db/conn.ts:139](https://github.com/maiyunnet/kebab/blob/master/
|
|
|
7129
7129
|
|
|
7130
7130
|
> **using**(): `boolean`
|
|
7131
7131
|
|
|
7132
|
-
Defined in: [lib/db/conn.ts:
|
|
7132
|
+
Defined in: [lib/db/conn.ts:128](https://github.com/maiyunnet/kebab/blob/master/lib/db/conn.ts#L128)
|
|
7133
7133
|
|
|
7134
7134
|
判断是否可用(丢失的也算不可用),返回 true 代表获取成功并自动刷新最后时间
|
|
7135
7135
|
|
|
@@ -11023,7 +11023,7 @@ lib/net/functions/fetch.md
|
|
|
11023
11023
|
|
|
11024
11024
|
> **fetch**(`input`, `init?`): `Promise`\<`Response`\>
|
|
11025
11025
|
|
|
11026
|
-
Defined in: [lib/net.ts:
|
|
11026
|
+
Defined in: [lib/net.ts:178](https://github.com/maiyunnet/kebab/blob/master/lib/net.ts#L178)
|
|
11027
11027
|
|
|
11028
11028
|
发起一个完全兼容 fetch 的请求
|
|
11029
11029
|
|
|
@@ -11058,7 +11058,7 @@ lib/net/functions/filterHeaders.md
|
|
|
11058
11058
|
|
|
11059
11059
|
> **filterHeaders**(`headers`, `res?`, `filter?`): `Record`\<`string`, `string` \| `string`[]\>
|
|
11060
11060
|
|
|
11061
|
-
Defined in: [lib/net.ts:
|
|
11061
|
+
Defined in: [lib/net.ts:533](https://github.com/maiyunnet/kebab/blob/master/lib/net.ts#L533)
|
|
11062
11062
|
|
|
11063
11063
|
剔除不代理的 header,返回新的 header
|
|
11064
11064
|
|
|
@@ -11120,7 +11120,7 @@ lib/net/functions/getFormData.md
|
|
|
11120
11120
|
|
|
11121
11121
|
> **getFormData**(): [`FormData`](../formdata/classes/FormData.md)
|
|
11122
11122
|
|
|
11123
|
-
Defined in: [lib/net.ts:
|
|
11123
|
+
Defined in: [lib/net.ts:517](https://github.com/maiyunnet/kebab/blob/master/lib/net.ts#L517)
|
|
11124
11124
|
|
|
11125
11125
|
创建 FormData 对象
|
|
11126
11126
|
|
|
@@ -11176,7 +11176,7 @@ lib/net/functions/getResponseJson.md
|
|
|
11176
11176
|
|
|
11177
11177
|
> **getResponseJson**(`u`, `opt?`): `Promise`\<`any`\>
|
|
11178
11178
|
|
|
11179
|
-
Defined in: [lib/net.ts:
|
|
11179
|
+
Defined in: [lib/net.ts:157](https://github.com/maiyunnet/kebab/blob/master/lib/net.ts#L157)
|
|
11180
11180
|
|
|
11181
11181
|
发起 GET 请求并解析 JSON 响应
|
|
11182
11182
|
|
|
@@ -11213,7 +11213,7 @@ lib/net/functions/mproxyData.md
|
|
|
11213
11213
|
|
|
11214
11214
|
> **mproxyData**(`ctr`): `any`
|
|
11215
11215
|
|
|
11216
|
-
Defined in: [lib/net.ts:
|
|
11216
|
+
Defined in: [lib/net.ts:621](https://github.com/maiyunnet/kebab/blob/master/lib/net.ts#L621)
|
|
11217
11217
|
|
|
11218
11218
|
获取 mproxy 的附加数据
|
|
11219
11219
|
|
|
@@ -11242,7 +11242,7 @@ lib/net/functions/mproxy.md
|
|
|
11242
11242
|
|
|
11243
11243
|
> **mproxy**(`ctr`, `auth`, `opt?`): `Promise`\<`number`\>
|
|
11244
11244
|
|
|
11245
|
-
Defined in: [lib/net.ts:
|
|
11245
|
+
Defined in: [lib/net.ts:569](https://github.com/maiyunnet/kebab/blob/master/lib/net.ts#L569)
|
|
11246
11246
|
|
|
11247
11247
|
正向 mproxy 代理,注意提前处理不要自动处理 post 数据,读取 get 的 url 为实际请求地址
|
|
11248
11248
|
get: url, auth
|
|
@@ -11423,6 +11423,49 @@ Defined in: [lib/net.ts:79](https://github.com/maiyunnet/kebab/blob/master/lib/n
|
|
|
11423
11423
|
|
|
11424
11424
|
`Promise`\<[`Response`](../response/classes/Response.md)\>
|
|
11425
11425
|
|
|
11426
|
+
lib/net/functions/postResponseJson.md
|
|
11427
|
+
---
|
|
11428
|
+
|
|
11429
|
+
[**Documents for @maiyunnet/kebab**](../../../index.md)
|
|
11430
|
+
|
|
11431
|
+
***
|
|
11432
|
+
|
|
11433
|
+
[Documents for @maiyunnet/kebab](../../../index.md) / [lib/net](../index.md) / postResponseJson
|
|
11434
|
+
|
|
11435
|
+
# Function: postResponseJson()
|
|
11436
|
+
|
|
11437
|
+
> **postResponseJson**(`u`, `data`, `opt?`): `Promise`\<`any`\>
|
|
11438
|
+
|
|
11439
|
+
Defined in: [lib/net.ts:135](https://github.com/maiyunnet/kebab/blob/master/lib/net.ts#L135)
|
|
11440
|
+
|
|
11441
|
+
发起 POST 请求并解析 JSON 响应
|
|
11442
|
+
|
|
11443
|
+
## Parameters
|
|
11444
|
+
|
|
11445
|
+
### u
|
|
11446
|
+
|
|
11447
|
+
`string`
|
|
11448
|
+
|
|
11449
|
+
网址
|
|
11450
|
+
|
|
11451
|
+
### data
|
|
11452
|
+
|
|
11453
|
+
`Record`\<`string`, [`Json`](../../../index/type-aliases/Json.md)\>
|
|
11454
|
+
|
|
11455
|
+
数据
|
|
11456
|
+
|
|
11457
|
+
### opt?
|
|
11458
|
+
|
|
11459
|
+
[`IRequestOptions`](../interfaces/IRequestOptions.md) = `{}`
|
|
11460
|
+
|
|
11461
|
+
选项
|
|
11462
|
+
|
|
11463
|
+
## Returns
|
|
11464
|
+
|
|
11465
|
+
`Promise`\<`any`\>
|
|
11466
|
+
|
|
11467
|
+
JSON 数据,失败时返回 null
|
|
11468
|
+
|
|
11426
11469
|
lib/net/functions/request.md
|
|
11427
11470
|
---
|
|
11428
11471
|
|
|
@@ -11436,7 +11479,7 @@ lib/net/functions/request.md
|
|
|
11436
11479
|
|
|
11437
11480
|
> **request**(`u`, `data?`, `opt?`): `Promise`\<[`Response`](../response/classes/Response.md)\>
|
|
11438
11481
|
|
|
11439
|
-
Defined in: [lib/net.ts:
|
|
11482
|
+
Defined in: [lib/net.ts:328](https://github.com/maiyunnet/kebab/blob/master/lib/net.ts#L328)
|
|
11440
11483
|
|
|
11441
11484
|
发起一个请求
|
|
11442
11485
|
|
|
@@ -11473,7 +11516,7 @@ lib/net/functions/rproxy.md
|
|
|
11473
11516
|
|
|
11474
11517
|
> **rproxy**(`ctr`, `route`, `opt?`): `Promise`\<`boolean`\>
|
|
11475
11518
|
|
|
11476
|
-
Defined in: [lib/net.ts:
|
|
11519
|
+
Defined in: [lib/net.ts:639](https://github.com/maiyunnet/kebab/blob/master/lib/net.ts#L639)
|
|
11477
11520
|
|
|
11478
11521
|
反向代理,注意提前处理不要自动处理 post 数据,将本服务器的某个路由反代到其他网址
|
|
11479
11522
|
|
|
@@ -11536,6 +11579,7 @@ lib/net/index.md
|
|
|
11536
11579
|
- [post](functions/post.md)
|
|
11537
11580
|
- [postJson](functions/postJson.md)
|
|
11538
11581
|
- [postJsonResponseJson](functions/postJsonResponseJson.md)
|
|
11582
|
+
- [postResponseJson](functions/postResponseJson.md)
|
|
11539
11583
|
- [request](functions/request.md)
|
|
11540
11584
|
- [rproxy](functions/rproxy.md)
|
|
11541
11585
|
|
|
@@ -11550,7 +11594,7 @@ lib/net/interfaces/IMproxyOptions.md
|
|
|
11550
11594
|
|
|
11551
11595
|
# Interface: IMproxyOptions
|
|
11552
11596
|
|
|
11553
|
-
Defined in: [lib/net.ts:
|
|
11597
|
+
Defined in: [lib/net.ts:723](https://github.com/maiyunnet/kebab/blob/master/lib/net.ts#L723)
|
|
11554
11598
|
|
|
11555
11599
|
正向代理请求的传入参数选项
|
|
11556
11600
|
|
|
@@ -11560,7 +11604,7 @@ Defined in: [lib/net.ts:700](https://github.com/maiyunnet/kebab/blob/master/lib/
|
|
|
11560
11604
|
|
|
11561
11605
|
> `optional` **filter?**: (`h`) => `boolean`
|
|
11562
11606
|
|
|
11563
|
-
Defined in: [lib/net.ts:
|
|
11607
|
+
Defined in: [lib/net.ts:732](https://github.com/maiyunnet/kebab/blob/master/lib/net.ts#L732)
|
|
11564
11608
|
|
|
11565
11609
|
过滤 header,返回 true 则留下
|
|
11566
11610
|
|
|
@@ -11580,7 +11624,7 @@ Defined in: [lib/net.ts:709](https://github.com/maiyunnet/kebab/blob/master/lib/
|
|
|
11580
11624
|
|
|
11581
11625
|
> `optional` **follow?**: `number`
|
|
11582
11626
|
|
|
11583
|
-
Defined in: [lib/net.ts:
|
|
11627
|
+
Defined in: [lib/net.ts:726](https://github.com/maiyunnet/kebab/blob/master/lib/net.ts#L726)
|
|
11584
11628
|
|
|
11585
11629
|
***
|
|
11586
11630
|
|
|
@@ -11588,7 +11632,7 @@ Defined in: [lib/net.ts:703](https://github.com/maiyunnet/kebab/blob/master/lib/
|
|
|
11588
11632
|
|
|
11589
11633
|
> `optional` **headers?**: [`THttpHeaders`](../type-aliases/THttpHeaders.md)
|
|
11590
11634
|
|
|
11591
|
-
Defined in: [lib/net.ts:
|
|
11635
|
+
Defined in: [lib/net.ts:730](https://github.com/maiyunnet/kebab/blob/master/lib/net.ts#L730)
|
|
11592
11636
|
|
|
11593
11637
|
***
|
|
11594
11638
|
|
|
@@ -11596,7 +11640,7 @@ Defined in: [lib/net.ts:707](https://github.com/maiyunnet/kebab/blob/master/lib/
|
|
|
11596
11640
|
|
|
11597
11641
|
> `optional` **hosts?**: `string` \| `Record`\<`string`, `string`\>
|
|
11598
11642
|
|
|
11599
|
-
Defined in: [lib/net.ts:
|
|
11643
|
+
Defined in: [lib/net.ts:728](https://github.com/maiyunnet/kebab/blob/master/lib/net.ts#L728)
|
|
11600
11644
|
|
|
11601
11645
|
自定义 host 映射,如 {'www.maiyun.net': '127.0.0.1'},或全部映射到一个 host
|
|
11602
11646
|
|
|
@@ -11606,7 +11650,7 @@ Defined in: [lib/net.ts:705](https://github.com/maiyunnet/kebab/blob/master/lib/
|
|
|
11606
11650
|
|
|
11607
11651
|
> `optional` **local?**: `string`
|
|
11608
11652
|
|
|
11609
|
-
Defined in: [lib/net.ts:
|
|
11653
|
+
Defined in: [lib/net.ts:729](https://github.com/maiyunnet/kebab/blob/master/lib/net.ts#L729)
|
|
11610
11654
|
|
|
11611
11655
|
***
|
|
11612
11656
|
|
|
@@ -11614,7 +11658,7 @@ Defined in: [lib/net.ts:706](https://github.com/maiyunnet/kebab/blob/master/lib/
|
|
|
11614
11658
|
|
|
11615
11659
|
> `optional` **reuse?**: `string`
|
|
11616
11660
|
|
|
11617
|
-
Defined in: [lib/net.ts:
|
|
11661
|
+
Defined in: [lib/net.ts:734](https://github.com/maiyunnet/kebab/blob/master/lib/net.ts#L734)
|
|
11618
11662
|
|
|
11619
11663
|
默认为 default
|
|
11620
11664
|
|
|
@@ -11624,7 +11668,7 @@ Defined in: [lib/net.ts:711](https://github.com/maiyunnet/kebab/blob/master/lib/
|
|
|
11624
11668
|
|
|
11625
11669
|
> `optional` **timeout?**: `number`
|
|
11626
11670
|
|
|
11627
|
-
Defined in: [lib/net.ts:
|
|
11671
|
+
Defined in: [lib/net.ts:725](https://github.com/maiyunnet/kebab/blob/master/lib/net.ts#L725)
|
|
11628
11672
|
|
|
11629
11673
|
秒数
|
|
11630
11674
|
|
|
@@ -11639,7 +11683,7 @@ lib/net/interfaces/IRequestOptions.md
|
|
|
11639
11683
|
|
|
11640
11684
|
# Interface: IRequestOptions
|
|
11641
11685
|
|
|
11642
|
-
Defined in: [lib/net.ts:
|
|
11686
|
+
Defined in: [lib/net.ts:692](https://github.com/maiyunnet/kebab/blob/master/lib/net.ts#L692)
|
|
11643
11687
|
|
|
11644
11688
|
请求的传入参数选项
|
|
11645
11689
|
|
|
@@ -11649,7 +11693,7 @@ Defined in: [lib/net.ts:669](https://github.com/maiyunnet/kebab/blob/master/lib/
|
|
|
11649
11693
|
|
|
11650
11694
|
> `optional` **cookie?**: `Record`\<`string`, [`ICookie`](../../cookie/interfaces/ICookie.md)\>
|
|
11651
11695
|
|
|
11652
|
-
Defined in: [lib/net.ts:
|
|
11696
|
+
Defined in: [lib/net.ts:717](https://github.com/maiyunnet/kebab/blob/master/lib/net.ts#L717)
|
|
11653
11697
|
|
|
11654
11698
|
cookie 托管对象
|
|
11655
11699
|
|
|
@@ -11659,7 +11703,7 @@ cookie 托管对象
|
|
|
11659
11703
|
|
|
11660
11704
|
> `optional` **follow?**: `number`
|
|
11661
11705
|
|
|
11662
|
-
Defined in: [lib/net.ts:
|
|
11706
|
+
Defined in: [lib/net.ts:698](https://github.com/maiyunnet/kebab/blob/master/lib/net.ts#L698)
|
|
11663
11707
|
|
|
11664
11708
|
追踪 location 次数,0 为不追踪,默认为 0
|
|
11665
11709
|
|
|
@@ -11669,7 +11713,7 @@ Defined in: [lib/net.ts:675](https://github.com/maiyunnet/kebab/blob/master/lib/
|
|
|
11669
11713
|
|
|
11670
11714
|
> `optional` **headers?**: [`THttpHeaders`](../type-aliases/THttpHeaders.md)
|
|
11671
11715
|
|
|
11672
|
-
Defined in: [lib/net.ts:
|
|
11716
|
+
Defined in: [lib/net.ts:703](https://github.com/maiyunnet/kebab/blob/master/lib/net.ts#L703)
|
|
11673
11717
|
|
|
11674
11718
|
***
|
|
11675
11719
|
|
|
@@ -11677,7 +11721,7 @@ Defined in: [lib/net.ts:680](https://github.com/maiyunnet/kebab/blob/master/lib/
|
|
|
11677
11721
|
|
|
11678
11722
|
> `optional` **hosts?**: `string` \| `Record`\<`string`, `string`\>
|
|
11679
11723
|
|
|
11680
|
-
Defined in: [lib/net.ts:
|
|
11724
|
+
Defined in: [lib/net.ts:700](https://github.com/maiyunnet/kebab/blob/master/lib/net.ts#L700)
|
|
11681
11725
|
|
|
11682
11726
|
自定义 host 映射,如 {'www.maiyun.net': '127.0.0.1'},或全部映射到一个 host
|
|
11683
11727
|
|
|
@@ -11687,7 +11731,7 @@ Defined in: [lib/net.ts:677](https://github.com/maiyunnet/kebab/blob/master/lib/
|
|
|
11687
11731
|
|
|
11688
11732
|
> `optional` **keep?**: `boolean`
|
|
11689
11733
|
|
|
11690
|
-
Defined in: [lib/net.ts:
|
|
11734
|
+
Defined in: [lib/net.ts:713](https://github.com/maiyunnet/kebab/blob/master/lib/net.ts#L713)
|
|
11691
11735
|
|
|
11692
11736
|
连接是否保持长连接(即是否允许复用),默认为 true
|
|
11693
11737
|
|
|
@@ -11697,7 +11741,7 @@ Defined in: [lib/net.ts:690](https://github.com/maiyunnet/kebab/blob/master/lib/
|
|
|
11697
11741
|
|
|
11698
11742
|
> `optional` **local?**: `string`
|
|
11699
11743
|
|
|
11700
|
-
Defined in: [lib/net.ts:
|
|
11744
|
+
Defined in: [lib/net.ts:702](https://github.com/maiyunnet/kebab/blob/master/lib/net.ts#L702)
|
|
11701
11745
|
|
|
11702
11746
|
***
|
|
11703
11747
|
|
|
@@ -11705,7 +11749,7 @@ Defined in: [lib/net.ts:679](https://github.com/maiyunnet/kebab/blob/master/lib/
|
|
|
11705
11749
|
|
|
11706
11750
|
> `optional` **log?**: `boolean`
|
|
11707
11751
|
|
|
11708
|
-
Defined in: [lib/net.ts:
|
|
11752
|
+
Defined in: [lib/net.ts:719](https://github.com/maiyunnet/kebab/blob/master/lib/net.ts#L719)
|
|
11709
11753
|
|
|
11710
11754
|
若有异常写入文件日志,默认为 true
|
|
11711
11755
|
|
|
@@ -11715,7 +11759,7 @@ Defined in: [lib/net.ts:696](https://github.com/maiyunnet/kebab/blob/master/lib/
|
|
|
11715
11759
|
|
|
11716
11760
|
> `optional` **method?**: `"GET"` \| `"POST"` \| `"PUT"` \| `"DELETE"` \| `"OPTIONS"`
|
|
11717
11761
|
|
|
11718
|
-
Defined in: [lib/net.ts:
|
|
11762
|
+
Defined in: [lib/net.ts:693](https://github.com/maiyunnet/kebab/blob/master/lib/net.ts#L693)
|
|
11719
11763
|
|
|
11720
11764
|
***
|
|
11721
11765
|
|
|
@@ -11723,7 +11767,7 @@ Defined in: [lib/net.ts:670](https://github.com/maiyunnet/kebab/blob/master/lib/
|
|
|
11723
11767
|
|
|
11724
11768
|
> `optional` **mproxy?**: `object`
|
|
11725
11769
|
|
|
11726
|
-
Defined in: [lib/net.ts:
|
|
11770
|
+
Defined in: [lib/net.ts:705](https://github.com/maiyunnet/kebab/blob/master/lib/net.ts#L705)
|
|
11727
11771
|
|
|
11728
11772
|
正向 mproxy 代理,url 如 https://xxx/abc
|
|
11729
11773
|
|
|
@@ -11751,7 +11795,7 @@ Defined in: [lib/net.ts:682](https://github.com/maiyunnet/kebab/blob/master/lib/
|
|
|
11751
11795
|
|
|
11752
11796
|
> `optional` **reuse?**: `string`
|
|
11753
11797
|
|
|
11754
|
-
Defined in: [lib/net.ts:
|
|
11798
|
+
Defined in: [lib/net.ts:715](https://github.com/maiyunnet/kebab/blob/master/lib/net.ts#L715)
|
|
11755
11799
|
|
|
11756
11800
|
复用池名,默认为 default
|
|
11757
11801
|
|
|
@@ -11761,7 +11805,7 @@ Defined in: [lib/net.ts:692](https://github.com/maiyunnet/kebab/blob/master/lib/
|
|
|
11761
11805
|
|
|
11762
11806
|
> `optional` **save?**: `string`
|
|
11763
11807
|
|
|
11764
|
-
Defined in: [lib/net.ts:
|
|
11808
|
+
Defined in: [lib/net.ts:701](https://github.com/maiyunnet/kebab/blob/master/lib/net.ts#L701)
|
|
11765
11809
|
|
|
11766
11810
|
***
|
|
11767
11811
|
|
|
@@ -11769,7 +11813,7 @@ Defined in: [lib/net.ts:678](https://github.com/maiyunnet/kebab/blob/master/lib/
|
|
|
11769
11813
|
|
|
11770
11814
|
> `optional` **timeout?**: `number`
|
|
11771
11815
|
|
|
11772
|
-
Defined in: [lib/net.ts:
|
|
11816
|
+
Defined in: [lib/net.ts:696](https://github.com/maiyunnet/kebab/blob/master/lib/net.ts#L696)
|
|
11773
11817
|
|
|
11774
11818
|
秒数,默认 10 秒
|
|
11775
11819
|
|
|
@@ -11779,7 +11823,7 @@ Defined in: [lib/net.ts:673](https://github.com/maiyunnet/kebab/blob/master/lib/
|
|
|
11779
11823
|
|
|
11780
11824
|
> `optional` **type?**: `"form"` \| `"json"`
|
|
11781
11825
|
|
|
11782
|
-
Defined in: [lib/net.ts:
|
|
11826
|
+
Defined in: [lib/net.ts:694](https://github.com/maiyunnet/kebab/blob/master/lib/net.ts#L694)
|
|
11783
11827
|
|
|
11784
11828
|
lib/net/interfaces/IRproxyOptions.md
|
|
11785
11829
|
---
|
|
@@ -11792,7 +11836,7 @@ lib/net/interfaces/IRproxyOptions.md
|
|
|
11792
11836
|
|
|
11793
11837
|
# Interface: IRproxyOptions
|
|
11794
11838
|
|
|
11795
|
-
Defined in: [lib/net.ts:
|
|
11839
|
+
Defined in: [lib/net.ts:738](https://github.com/maiyunnet/kebab/blob/master/lib/net.ts#L738)
|
|
11796
11840
|
|
|
11797
11841
|
反向代理请求的传入参数选项
|
|
11798
11842
|
|
|
@@ -11802,7 +11846,7 @@ Defined in: [lib/net.ts:715](https://github.com/maiyunnet/kebab/blob/master/lib/
|
|
|
11802
11846
|
|
|
11803
11847
|
> `optional` **filter?**: (`h`) => `boolean`
|
|
11804
11848
|
|
|
11805
|
-
Defined in: [lib/net.ts:
|
|
11849
|
+
Defined in: [lib/net.ts:747](https://github.com/maiyunnet/kebab/blob/master/lib/net.ts#L747)
|
|
11806
11850
|
|
|
11807
11851
|
过滤 header,返回 true 则留下
|
|
11808
11852
|
|
|
@@ -11822,7 +11866,7 @@ Defined in: [lib/net.ts:724](https://github.com/maiyunnet/kebab/blob/master/lib/
|
|
|
11822
11866
|
|
|
11823
11867
|
> `optional` **follow?**: `number`
|
|
11824
11868
|
|
|
11825
|
-
Defined in: [lib/net.ts:
|
|
11869
|
+
Defined in: [lib/net.ts:741](https://github.com/maiyunnet/kebab/blob/master/lib/net.ts#L741)
|
|
11826
11870
|
|
|
11827
11871
|
***
|
|
11828
11872
|
|
|
@@ -11830,7 +11874,7 @@ Defined in: [lib/net.ts:718](https://github.com/maiyunnet/kebab/blob/master/lib/
|
|
|
11830
11874
|
|
|
11831
11875
|
> `optional` **headers?**: [`THttpHeaders`](../type-aliases/THttpHeaders.md)
|
|
11832
11876
|
|
|
11833
|
-
Defined in: [lib/net.ts:
|
|
11877
|
+
Defined in: [lib/net.ts:745](https://github.com/maiyunnet/kebab/blob/master/lib/net.ts#L745)
|
|
11834
11878
|
|
|
11835
11879
|
***
|
|
11836
11880
|
|
|
@@ -11838,7 +11882,7 @@ Defined in: [lib/net.ts:722](https://github.com/maiyunnet/kebab/blob/master/lib/
|
|
|
11838
11882
|
|
|
11839
11883
|
> `optional` **hosts?**: `string` \| `Record`\<`string`, `string`\>
|
|
11840
11884
|
|
|
11841
|
-
Defined in: [lib/net.ts:
|
|
11885
|
+
Defined in: [lib/net.ts:743](https://github.com/maiyunnet/kebab/blob/master/lib/net.ts#L743)
|
|
11842
11886
|
|
|
11843
11887
|
自定义 host 映射,如 {'www.maiyun.net': '127.0.0.1'},或全部映射到一个 host
|
|
11844
11888
|
|
|
@@ -11848,7 +11892,7 @@ Defined in: [lib/net.ts:720](https://github.com/maiyunnet/kebab/blob/master/lib/
|
|
|
11848
11892
|
|
|
11849
11893
|
> `optional` **local?**: `string`
|
|
11850
11894
|
|
|
11851
|
-
Defined in: [lib/net.ts:
|
|
11895
|
+
Defined in: [lib/net.ts:744](https://github.com/maiyunnet/kebab/blob/master/lib/net.ts#L744)
|
|
11852
11896
|
|
|
11853
11897
|
***
|
|
11854
11898
|
|
|
@@ -11856,7 +11900,7 @@ Defined in: [lib/net.ts:721](https://github.com/maiyunnet/kebab/blob/master/lib/
|
|
|
11856
11900
|
|
|
11857
11901
|
> `optional` **mproxy?**: `object`
|
|
11858
11902
|
|
|
11859
|
-
Defined in: [lib/net.ts:
|
|
11903
|
+
Defined in: [lib/net.ts:749](https://github.com/maiyunnet/kebab/blob/master/lib/net.ts#L749)
|
|
11860
11904
|
|
|
11861
11905
|
正向 mproxy 代理,url 如 https://xxx/abc
|
|
11862
11906
|
|
|
@@ -11884,7 +11928,7 @@ Defined in: [lib/net.ts:726](https://github.com/maiyunnet/kebab/blob/master/lib/
|
|
|
11884
11928
|
|
|
11885
11929
|
> `optional` **reuse?**: `string`
|
|
11886
11930
|
|
|
11887
|
-
Defined in: [lib/net.ts:
|
|
11931
|
+
Defined in: [lib/net.ts:757](https://github.com/maiyunnet/kebab/blob/master/lib/net.ts#L757)
|
|
11888
11932
|
|
|
11889
11933
|
默认为 default
|
|
11890
11934
|
|
|
@@ -11894,7 +11938,7 @@ Defined in: [lib/net.ts:734](https://github.com/maiyunnet/kebab/blob/master/lib/
|
|
|
11894
11938
|
|
|
11895
11939
|
> `optional` **timeout?**: `number`
|
|
11896
11940
|
|
|
11897
|
-
Defined in: [lib/net.ts:
|
|
11941
|
+
Defined in: [lib/net.ts:740](https://github.com/maiyunnet/kebab/blob/master/lib/net.ts#L740)
|
|
11898
11942
|
|
|
11899
11943
|
秒数
|
|
11900
11944
|
|
|
@@ -12355,7 +12399,7 @@ lib/net/type-aliases/THttpHeaders.md
|
|
|
12355
12399
|
|
|
12356
12400
|
> **THttpHeaders** = `http.IncomingHttpHeaders` & `object`
|
|
12357
12401
|
|
|
12358
|
-
Defined in: [lib/net.ts:
|
|
12402
|
+
Defined in: [lib/net.ts:762](https://github.com/maiyunnet/kebab/blob/master/lib/net.ts#L762)
|
|
12359
12403
|
|
|
12360
12404
|
http headers
|
|
12361
12405
|
|
|
@@ -18286,7 +18330,7 @@ lib/undici/functions/fetch.md
|
|
|
18286
18330
|
|
|
18287
18331
|
> **fetch**(`input`, `init?`): `Promise`\<`Response`\>
|
|
18288
18332
|
|
|
18289
|
-
Defined in: [lib/undici.ts:
|
|
18333
|
+
Defined in: [lib/undici.ts:198](https://github.com/maiyunnet/kebab/blob/master/lib/undici.ts#L198)
|
|
18290
18334
|
|
|
18291
18335
|
发起一个完全兼容 fetch 的请求
|
|
18292
18336
|
|
|
@@ -18321,7 +18365,7 @@ lib/undici/functions/filterHeaders.md
|
|
|
18321
18365
|
|
|
18322
18366
|
> **filterHeaders**(`headers`, `res?`, `filter?`): `Record`\<`string`, `string` \| `string`[]\>
|
|
18323
18367
|
|
|
18324
|
-
Defined in: [lib/undici.ts:
|
|
18368
|
+
Defined in: [lib/undici.ts:554](https://github.com/maiyunnet/kebab/blob/master/lib/undici.ts#L554)
|
|
18325
18369
|
|
|
18326
18370
|
剔除不代理的 header,返回新的 header
|
|
18327
18371
|
|
|
@@ -18362,7 +18406,7 @@ lib/undici/functions/getFormData.md
|
|
|
18362
18406
|
|
|
18363
18407
|
> **getFormData**(): [`FormData`](../formdata/classes/FormData.md)
|
|
18364
18408
|
|
|
18365
|
-
Defined in: [lib/undici.ts:
|
|
18409
|
+
Defined in: [lib/undici.ts:538](https://github.com/maiyunnet/kebab/blob/master/lib/undici.ts#L538)
|
|
18366
18410
|
|
|
18367
18411
|
创建 FormData 对象
|
|
18368
18412
|
|
|
@@ -18445,7 +18489,7 @@ lib/undici/functions/getResponseJson.md
|
|
|
18445
18489
|
|
|
18446
18490
|
> **getResponseJson**(`u`, `opt?`): `Promise`\<`any`\>
|
|
18447
18491
|
|
|
18448
|
-
Defined in: [lib/undici.ts:
|
|
18492
|
+
Defined in: [lib/undici.ts:177](https://github.com/maiyunnet/kebab/blob/master/lib/undici.ts#L177)
|
|
18449
18493
|
|
|
18450
18494
|
发起 GET 请求并解析 JSON 响应
|
|
18451
18495
|
|
|
@@ -18482,7 +18526,7 @@ lib/undici/functions/mproxyData.md
|
|
|
18482
18526
|
|
|
18483
18527
|
> **mproxyData**(`ctr`): `any`
|
|
18484
18528
|
|
|
18485
|
-
Defined in: [lib/undici.ts:
|
|
18529
|
+
Defined in: [lib/undici.ts:656](https://github.com/maiyunnet/kebab/blob/master/lib/undici.ts#L656)
|
|
18486
18530
|
|
|
18487
18531
|
获取 mproxy 的附加数据
|
|
18488
18532
|
|
|
@@ -18511,7 +18555,7 @@ lib/undici/functions/mproxy.md
|
|
|
18511
18555
|
|
|
18512
18556
|
> **mproxy**(`ctr`, `auth`, `opt?`): `Promise`\<`number`\>
|
|
18513
18557
|
|
|
18514
|
-
Defined in: [lib/undici.ts:
|
|
18558
|
+
Defined in: [lib/undici.ts:594](https://github.com/maiyunnet/kebab/blob/master/lib/undici.ts#L594)
|
|
18515
18559
|
|
|
18516
18560
|
正向 mproxy 代理,注意提前处理不要自动处理 post 数据,读取 get 的 url 为实际请求地址
|
|
18517
18561
|
get: url, auth
|
|
@@ -18690,6 +18734,49 @@ Defined in: [lib/undici.ts:100](https://github.com/maiyunnet/kebab/blob/master/l
|
|
|
18690
18734
|
|
|
18691
18735
|
`Promise`\<[`Response`](../response/classes/Response.md)\>
|
|
18692
18736
|
|
|
18737
|
+
lib/undici/functions/postResponseJson.md
|
|
18738
|
+
---
|
|
18739
|
+
|
|
18740
|
+
[**Documents for @maiyunnet/kebab**](../../../index.md)
|
|
18741
|
+
|
|
18742
|
+
***
|
|
18743
|
+
|
|
18744
|
+
[Documents for @maiyunnet/kebab](../../../index.md) / [lib/undici](../index.md) / postResponseJson
|
|
18745
|
+
|
|
18746
|
+
# Function: postResponseJson()
|
|
18747
|
+
|
|
18748
|
+
> **postResponseJson**(`u`, `data`, `opt?`): `Promise`\<`any`\>
|
|
18749
|
+
|
|
18750
|
+
Defined in: [lib/undici.ts:155](https://github.com/maiyunnet/kebab/blob/master/lib/undici.ts#L155)
|
|
18751
|
+
|
|
18752
|
+
发起 POST 请求并解析 JSON 响应
|
|
18753
|
+
|
|
18754
|
+
## Parameters
|
|
18755
|
+
|
|
18756
|
+
### u
|
|
18757
|
+
|
|
18758
|
+
`string`
|
|
18759
|
+
|
|
18760
|
+
网址
|
|
18761
|
+
|
|
18762
|
+
### data
|
|
18763
|
+
|
|
18764
|
+
`Record`\<`string`, [`Json`](../../../index/type-aliases/Json.md)\>
|
|
18765
|
+
|
|
18766
|
+
数据
|
|
18767
|
+
|
|
18768
|
+
### opt?
|
|
18769
|
+
|
|
18770
|
+
[`IRequestOptions`](../interfaces/IRequestOptions.md) = `{}`
|
|
18771
|
+
|
|
18772
|
+
选项
|
|
18773
|
+
|
|
18774
|
+
## Returns
|
|
18775
|
+
|
|
18776
|
+
`Promise`\<`any`\>
|
|
18777
|
+
|
|
18778
|
+
JSON 数据,失败时返回 null
|
|
18779
|
+
|
|
18693
18780
|
lib/undici/functions/request.md
|
|
18694
18781
|
---
|
|
18695
18782
|
|
|
@@ -18703,7 +18790,7 @@ lib/undici/functions/request.md
|
|
|
18703
18790
|
|
|
18704
18791
|
> **request**(`u`, `data?`, `opt?`): `Promise`\<[`Response`](../response/classes/Response.md)\>
|
|
18705
18792
|
|
|
18706
|
-
Defined in: [lib/undici.ts:
|
|
18793
|
+
Defined in: [lib/undici.ts:367](https://github.com/maiyunnet/kebab/blob/master/lib/undici.ts#L367)
|
|
18707
18794
|
|
|
18708
18795
|
发起一个请求
|
|
18709
18796
|
|
|
@@ -18740,7 +18827,7 @@ lib/undici/functions/rproxy.md
|
|
|
18740
18827
|
|
|
18741
18828
|
> **rproxy**(`ctr`, `route`, `opt?`): `Promise`\<`boolean`\>
|
|
18742
18829
|
|
|
18743
|
-
Defined in: [lib/undici.ts:
|
|
18830
|
+
Defined in: [lib/undici.ts:686](https://github.com/maiyunnet/kebab/blob/master/lib/undici.ts#L686)
|
|
18744
18831
|
|
|
18745
18832
|
反向代理,将本服务器的某个路由反代到其他网址
|
|
18746
18833
|
|
|
@@ -18814,6 +18901,7 @@ lib/undici/index.md
|
|
|
18814
18901
|
- [post](functions/post.md)
|
|
18815
18902
|
- [postJson](functions/postJson.md)
|
|
18816
18903
|
- [postJsonResponseJson](functions/postJsonResponseJson.md)
|
|
18904
|
+
- [postResponseJson](functions/postResponseJson.md)
|
|
18817
18905
|
- [request](functions/request.md)
|
|
18818
18906
|
- [rproxy](functions/rproxy.md)
|
|
18819
18907
|
|
|
@@ -18828,7 +18916,7 @@ lib/undici/interfaces/IMproxyOptions.md
|
|
|
18828
18916
|
|
|
18829
18917
|
# Interface: IMproxyOptions
|
|
18830
18918
|
|
|
18831
|
-
Defined in: [lib/undici.ts:
|
|
18919
|
+
Defined in: [lib/undici.ts:803](https://github.com/maiyunnet/kebab/blob/master/lib/undici.ts#L803)
|
|
18832
18920
|
|
|
18833
18921
|
正向代理请求的传入参数选项
|
|
18834
18922
|
|
|
@@ -18838,7 +18926,7 @@ Defined in: [lib/undici.ts:780](https://github.com/maiyunnet/kebab/blob/master/l
|
|
|
18838
18926
|
|
|
18839
18927
|
> `optional` **filter?**: (`h`) => `boolean`
|
|
18840
18928
|
|
|
18841
|
-
Defined in: [lib/undici.ts:
|
|
18929
|
+
Defined in: [lib/undici.ts:812](https://github.com/maiyunnet/kebab/blob/master/lib/undici.ts#L812)
|
|
18842
18930
|
|
|
18843
18931
|
过滤 header,返回 true 则留下
|
|
18844
18932
|
|
|
@@ -18858,7 +18946,7 @@ Defined in: [lib/undici.ts:789](https://github.com/maiyunnet/kebab/blob/master/l
|
|
|
18858
18946
|
|
|
18859
18947
|
> `optional` **follow?**: `number`
|
|
18860
18948
|
|
|
18861
|
-
Defined in: [lib/undici.ts:
|
|
18949
|
+
Defined in: [lib/undici.ts:806](https://github.com/maiyunnet/kebab/blob/master/lib/undici.ts#L806)
|
|
18862
18950
|
|
|
18863
18951
|
***
|
|
18864
18952
|
|
|
@@ -18866,7 +18954,7 @@ Defined in: [lib/undici.ts:783](https://github.com/maiyunnet/kebab/blob/master/l
|
|
|
18866
18954
|
|
|
18867
18955
|
> `optional` **headers?**: [`THttpHeaders`](../type-aliases/THttpHeaders.md)
|
|
18868
18956
|
|
|
18869
|
-
Defined in: [lib/undici.ts:
|
|
18957
|
+
Defined in: [lib/undici.ts:810](https://github.com/maiyunnet/kebab/blob/master/lib/undici.ts#L810)
|
|
18870
18958
|
|
|
18871
18959
|
***
|
|
18872
18960
|
|
|
@@ -18874,7 +18962,7 @@ Defined in: [lib/undici.ts:787](https://github.com/maiyunnet/kebab/blob/master/l
|
|
|
18874
18962
|
|
|
18875
18963
|
> `optional` **hosts?**: `string` \| `Record`\<`string`, `string`\>
|
|
18876
18964
|
|
|
18877
|
-
Defined in: [lib/undici.ts:
|
|
18965
|
+
Defined in: [lib/undici.ts:808](https://github.com/maiyunnet/kebab/blob/master/lib/undici.ts#L808)
|
|
18878
18966
|
|
|
18879
18967
|
自定义 host 映射,如 {'www.maiyun.net': '127.0.0.1'},或全部映射到一个 host
|
|
18880
18968
|
|
|
@@ -18884,7 +18972,7 @@ Defined in: [lib/undici.ts:785](https://github.com/maiyunnet/kebab/blob/master/l
|
|
|
18884
18972
|
|
|
18885
18973
|
> `optional` **local?**: `string`
|
|
18886
18974
|
|
|
18887
|
-
Defined in: [lib/undici.ts:
|
|
18975
|
+
Defined in: [lib/undici.ts:809](https://github.com/maiyunnet/kebab/blob/master/lib/undici.ts#L809)
|
|
18888
18976
|
|
|
18889
18977
|
***
|
|
18890
18978
|
|
|
@@ -18892,7 +18980,7 @@ Defined in: [lib/undici.ts:786](https://github.com/maiyunnet/kebab/blob/master/l
|
|
|
18892
18980
|
|
|
18893
18981
|
> `optional` **reuse?**: `string` \| `Agent` \| `ProxyAgent`
|
|
18894
18982
|
|
|
18895
|
-
Defined in: [lib/undici.ts:
|
|
18983
|
+
Defined in: [lib/undici.ts:814](https://github.com/maiyunnet/kebab/blob/master/lib/undici.ts#L814)
|
|
18896
18984
|
|
|
18897
18985
|
默认为 default
|
|
18898
18986
|
|
|
@@ -18902,7 +18990,7 @@ Defined in: [lib/undici.ts:791](https://github.com/maiyunnet/kebab/blob/master/l
|
|
|
18902
18990
|
|
|
18903
18991
|
> `optional` **timeout?**: `number`
|
|
18904
18992
|
|
|
18905
|
-
Defined in: [lib/undici.ts:
|
|
18993
|
+
Defined in: [lib/undici.ts:805](https://github.com/maiyunnet/kebab/blob/master/lib/undici.ts#L805)
|
|
18906
18994
|
|
|
18907
18995
|
秒数,默认 300 秒
|
|
18908
18996
|
|
|
@@ -18917,7 +19005,7 @@ lib/undici/interfaces/IRequestOptions.md
|
|
|
18917
19005
|
|
|
18918
19006
|
# Interface: IRequestOptions
|
|
18919
19007
|
|
|
18920
|
-
Defined in: [lib/undici.ts:
|
|
19008
|
+
Defined in: [lib/undici.ts:770](https://github.com/maiyunnet/kebab/blob/master/lib/undici.ts#L770)
|
|
18921
19009
|
|
|
18922
19010
|
请求的传入参数选项
|
|
18923
19011
|
|
|
@@ -18927,7 +19015,7 @@ Defined in: [lib/undici.ts:747](https://github.com/maiyunnet/kebab/blob/master/l
|
|
|
18927
19015
|
|
|
18928
19016
|
> `optional` **cookie?**: `Record`\<`string`, [`ICookie`](../../cookie/interfaces/ICookie.md)\>
|
|
18929
19017
|
|
|
18930
|
-
Defined in: [lib/undici.ts:
|
|
19018
|
+
Defined in: [lib/undici.ts:795](https://github.com/maiyunnet/kebab/blob/master/lib/undici.ts#L795)
|
|
18931
19019
|
|
|
18932
19020
|
cookie 托管对象
|
|
18933
19021
|
|
|
@@ -18937,7 +19025,7 @@ cookie 托管对象
|
|
|
18937
19025
|
|
|
18938
19026
|
> `optional` **follow?**: `number`
|
|
18939
19027
|
|
|
18940
|
-
Defined in: [lib/undici.ts:
|
|
19028
|
+
Defined in: [lib/undici.ts:776](https://github.com/maiyunnet/kebab/blob/master/lib/undici.ts#L776)
|
|
18941
19029
|
|
|
18942
19030
|
追踪 location 次数,0 为不追踪,默认为 0
|
|
18943
19031
|
|
|
@@ -18947,7 +19035,7 @@ Defined in: [lib/undici.ts:753](https://github.com/maiyunnet/kebab/blob/master/l
|
|
|
18947
19035
|
|
|
18948
19036
|
> `optional` **headers?**: [`THttpHeaders`](../type-aliases/THttpHeaders.md)
|
|
18949
19037
|
|
|
18950
|
-
Defined in: [lib/undici.ts:
|
|
19038
|
+
Defined in: [lib/undici.ts:781](https://github.com/maiyunnet/kebab/blob/master/lib/undici.ts#L781)
|
|
18951
19039
|
|
|
18952
19040
|
***
|
|
18953
19041
|
|
|
@@ -18955,7 +19043,7 @@ Defined in: [lib/undici.ts:758](https://github.com/maiyunnet/kebab/blob/master/l
|
|
|
18955
19043
|
|
|
18956
19044
|
> `optional` **hosts?**: `string` \| `Record`\<`string`, `string`\>
|
|
18957
19045
|
|
|
18958
|
-
Defined in: [lib/undici.ts:
|
|
19046
|
+
Defined in: [lib/undici.ts:778](https://github.com/maiyunnet/kebab/blob/master/lib/undici.ts#L778)
|
|
18959
19047
|
|
|
18960
19048
|
自定义 host 映射,如 {'www.maiyun.net': '127.0.0.1'},或全部映射到一个 host
|
|
18961
19049
|
|
|
@@ -18965,7 +19053,7 @@ Defined in: [lib/undici.ts:755](https://github.com/maiyunnet/kebab/blob/master/l
|
|
|
18965
19053
|
|
|
18966
19054
|
> `optional` **keep?**: `boolean`
|
|
18967
19055
|
|
|
18968
|
-
Defined in: [lib/undici.ts:
|
|
19056
|
+
Defined in: [lib/undici.ts:791](https://github.com/maiyunnet/kebab/blob/master/lib/undici.ts#L791)
|
|
18969
19057
|
|
|
18970
19058
|
连接是否保持长连接(即是否允许复用),默认为 true
|
|
18971
19059
|
|
|
@@ -18975,7 +19063,7 @@ Defined in: [lib/undici.ts:768](https://github.com/maiyunnet/kebab/blob/master/l
|
|
|
18975
19063
|
|
|
18976
19064
|
> `optional` **local?**: `string`
|
|
18977
19065
|
|
|
18978
|
-
Defined in: [lib/undici.ts:
|
|
19066
|
+
Defined in: [lib/undici.ts:780](https://github.com/maiyunnet/kebab/blob/master/lib/undici.ts#L780)
|
|
18979
19067
|
|
|
18980
19068
|
***
|
|
18981
19069
|
|
|
@@ -18983,7 +19071,7 @@ Defined in: [lib/undici.ts:757](https://github.com/maiyunnet/kebab/blob/master/l
|
|
|
18983
19071
|
|
|
18984
19072
|
> `optional` **log?**: `boolean`
|
|
18985
19073
|
|
|
18986
|
-
Defined in: [lib/undici.ts:
|
|
19074
|
+
Defined in: [lib/undici.ts:797](https://github.com/maiyunnet/kebab/blob/master/lib/undici.ts#L797)
|
|
18987
19075
|
|
|
18988
19076
|
若有异常写入文件日志,默认为 true
|
|
18989
19077
|
|
|
@@ -18993,7 +19081,7 @@ Defined in: [lib/undici.ts:774](https://github.com/maiyunnet/kebab/blob/master/l
|
|
|
18993
19081
|
|
|
18994
19082
|
> `optional` **method?**: `"GET"` \| `"POST"` \| `"PUT"` \| `"DELETE"` \| `"OPTIONS"`
|
|
18995
19083
|
|
|
18996
|
-
Defined in: [lib/undici.ts:
|
|
19084
|
+
Defined in: [lib/undici.ts:771](https://github.com/maiyunnet/kebab/blob/master/lib/undici.ts#L771)
|
|
18997
19085
|
|
|
18998
19086
|
***
|
|
18999
19087
|
|
|
@@ -19001,7 +19089,7 @@ Defined in: [lib/undici.ts:748](https://github.com/maiyunnet/kebab/blob/master/l
|
|
|
19001
19089
|
|
|
19002
19090
|
> `optional` **mproxy?**: `object`
|
|
19003
19091
|
|
|
19004
|
-
Defined in: [lib/undici.ts:
|
|
19092
|
+
Defined in: [lib/undici.ts:783](https://github.com/maiyunnet/kebab/blob/master/lib/undici.ts#L783)
|
|
19005
19093
|
|
|
19006
19094
|
正向 mproxy 代理,url 如 https://xxx/abc
|
|
19007
19095
|
|
|
@@ -19029,7 +19117,7 @@ Defined in: [lib/undici.ts:760](https://github.com/maiyunnet/kebab/blob/master/l
|
|
|
19029
19117
|
|
|
19030
19118
|
> `optional` **reuse?**: `string` \| `Agent` \| `ProxyAgent`
|
|
19031
19119
|
|
|
19032
|
-
Defined in: [lib/undici.ts:
|
|
19120
|
+
Defined in: [lib/undici.ts:793](https://github.com/maiyunnet/kebab/blob/master/lib/undici.ts#L793)
|
|
19033
19121
|
|
|
19034
19122
|
复用池名/Agent,默认为 default
|
|
19035
19123
|
|
|
@@ -19039,7 +19127,7 @@ Defined in: [lib/undici.ts:770](https://github.com/maiyunnet/kebab/blob/master/l
|
|
|
19039
19127
|
|
|
19040
19128
|
> `optional` **save?**: `string`
|
|
19041
19129
|
|
|
19042
|
-
Defined in: [lib/undici.ts:
|
|
19130
|
+
Defined in: [lib/undici.ts:779](https://github.com/maiyunnet/kebab/blob/master/lib/undici.ts#L779)
|
|
19043
19131
|
|
|
19044
19132
|
***
|
|
19045
19133
|
|
|
@@ -19047,7 +19135,7 @@ Defined in: [lib/undici.ts:756](https://github.com/maiyunnet/kebab/blob/master/l
|
|
|
19047
19135
|
|
|
19048
19136
|
> `optional` **signal?**: `AbortSignal`
|
|
19049
19137
|
|
|
19050
|
-
Defined in: [lib/undici.ts:
|
|
19138
|
+
Defined in: [lib/undici.ts:799](https://github.com/maiyunnet/kebab/blob/master/lib/undici.ts#L799)
|
|
19051
19139
|
|
|
19052
19140
|
请求中止信号
|
|
19053
19141
|
|
|
@@ -19057,7 +19145,7 @@ Defined in: [lib/undici.ts:776](https://github.com/maiyunnet/kebab/blob/master/l
|
|
|
19057
19145
|
|
|
19058
19146
|
> `optional` **timeout?**: `number`
|
|
19059
19147
|
|
|
19060
|
-
Defined in: [lib/undici.ts:
|
|
19148
|
+
Defined in: [lib/undici.ts:774](https://github.com/maiyunnet/kebab/blob/master/lib/undici.ts#L774)
|
|
19061
19149
|
|
|
19062
19150
|
秒数,默认 300 秒
|
|
19063
19151
|
|
|
@@ -19067,7 +19155,7 @@ Defined in: [lib/undici.ts:751](https://github.com/maiyunnet/kebab/blob/master/l
|
|
|
19067
19155
|
|
|
19068
19156
|
> `optional` **type?**: `"form"` \| `"json"`
|
|
19069
19157
|
|
|
19070
|
-
Defined in: [lib/undici.ts:
|
|
19158
|
+
Defined in: [lib/undici.ts:772](https://github.com/maiyunnet/kebab/blob/master/lib/undici.ts#L772)
|
|
19071
19159
|
|
|
19072
19160
|
lib/undici/interfaces/IRproxyOptions.md
|
|
19073
19161
|
---
|
|
@@ -19080,7 +19168,7 @@ lib/undici/interfaces/IRproxyOptions.md
|
|
|
19080
19168
|
|
|
19081
19169
|
# Interface: IRproxyOptions
|
|
19082
19170
|
|
|
19083
|
-
Defined in: [lib/undici.ts:
|
|
19171
|
+
Defined in: [lib/undici.ts:818](https://github.com/maiyunnet/kebab/blob/master/lib/undici.ts#L818)
|
|
19084
19172
|
|
|
19085
19173
|
反向代理请求的传入参数选项
|
|
19086
19174
|
|
|
@@ -19090,7 +19178,7 @@ Defined in: [lib/undici.ts:795](https://github.com/maiyunnet/kebab/blob/master/l
|
|
|
19090
19178
|
|
|
19091
19179
|
> `optional` **body?**: `string` \| `Buffer`\<`ArrayBufferLike`\> \| `Readable`
|
|
19092
19180
|
|
|
19093
|
-
Defined in: [lib/undici.ts:
|
|
19181
|
+
Defined in: [lib/undici.ts:837](https://github.com/maiyunnet/kebab/blob/master/lib/undici.ts#L837)
|
|
19094
19182
|
|
|
19095
19183
|
手动传入请求体(优先于原始 req 流),用于 req 流已消费后仍需转发 body 的场景
|
|
19096
19184
|
|
|
@@ -19100,7 +19188,7 @@ Defined in: [lib/undici.ts:814](https://github.com/maiyunnet/kebab/blob/master/l
|
|
|
19100
19188
|
|
|
19101
19189
|
> `optional` **filter?**: (`h`) => `boolean`
|
|
19102
19190
|
|
|
19103
|
-
Defined in: [lib/undici.ts:
|
|
19191
|
+
Defined in: [lib/undici.ts:827](https://github.com/maiyunnet/kebab/blob/master/lib/undici.ts#L827)
|
|
19104
19192
|
|
|
19105
19193
|
过滤 header,返回 true 则留下
|
|
19106
19194
|
|
|
@@ -19120,7 +19208,7 @@ Defined in: [lib/undici.ts:804](https://github.com/maiyunnet/kebab/blob/master/l
|
|
|
19120
19208
|
|
|
19121
19209
|
> `optional` **follow?**: `number`
|
|
19122
19210
|
|
|
19123
|
-
Defined in: [lib/undici.ts:
|
|
19211
|
+
Defined in: [lib/undici.ts:821](https://github.com/maiyunnet/kebab/blob/master/lib/undici.ts#L821)
|
|
19124
19212
|
|
|
19125
19213
|
***
|
|
19126
19214
|
|
|
@@ -19128,7 +19216,7 @@ Defined in: [lib/undici.ts:798](https://github.com/maiyunnet/kebab/blob/master/l
|
|
|
19128
19216
|
|
|
19129
19217
|
> `optional` **headers?**: [`THttpHeaders`](../type-aliases/THttpHeaders.md)
|
|
19130
19218
|
|
|
19131
|
-
Defined in: [lib/undici.ts:
|
|
19219
|
+
Defined in: [lib/undici.ts:825](https://github.com/maiyunnet/kebab/blob/master/lib/undici.ts#L825)
|
|
19132
19220
|
|
|
19133
19221
|
***
|
|
19134
19222
|
|
|
@@ -19136,7 +19224,7 @@ Defined in: [lib/undici.ts:802](https://github.com/maiyunnet/kebab/blob/master/l
|
|
|
19136
19224
|
|
|
19137
19225
|
> `optional` **hosts?**: `string` \| `Record`\<`string`, `string`\>
|
|
19138
19226
|
|
|
19139
|
-
Defined in: [lib/undici.ts:
|
|
19227
|
+
Defined in: [lib/undici.ts:823](https://github.com/maiyunnet/kebab/blob/master/lib/undici.ts#L823)
|
|
19140
19228
|
|
|
19141
19229
|
自定义 host 映射,如 {'www.maiyun.net': '127.0.0.1'},或全部映射到一个 host
|
|
19142
19230
|
|
|
@@ -19146,7 +19234,7 @@ Defined in: [lib/undici.ts:800](https://github.com/maiyunnet/kebab/blob/master/l
|
|
|
19146
19234
|
|
|
19147
19235
|
> `optional` **local?**: `string`
|
|
19148
19236
|
|
|
19149
|
-
Defined in: [lib/undici.ts:
|
|
19237
|
+
Defined in: [lib/undici.ts:824](https://github.com/maiyunnet/kebab/blob/master/lib/undici.ts#L824)
|
|
19150
19238
|
|
|
19151
19239
|
***
|
|
19152
19240
|
|
|
@@ -19154,7 +19242,7 @@ Defined in: [lib/undici.ts:801](https://github.com/maiyunnet/kebab/blob/master/l
|
|
|
19154
19242
|
|
|
19155
19243
|
> `optional` **mproxy?**: `object`
|
|
19156
19244
|
|
|
19157
|
-
Defined in: [lib/undici.ts:
|
|
19245
|
+
Defined in: [lib/undici.ts:829](https://github.com/maiyunnet/kebab/blob/master/lib/undici.ts#L829)
|
|
19158
19246
|
|
|
19159
19247
|
正向 mproxy 代理,url 如 https://xxx/abc
|
|
19160
19248
|
|
|
@@ -19182,7 +19270,7 @@ Defined in: [lib/undici.ts:806](https://github.com/maiyunnet/kebab/blob/master/l
|
|
|
19182
19270
|
|
|
19183
19271
|
> `optional` **querys?**: `Record`\<`string`, `any`\>
|
|
19184
19272
|
|
|
19185
|
-
Defined in: [lib/undici.ts:
|
|
19273
|
+
Defined in: [lib/undici.ts:839](https://github.com/maiyunnet/kebab/blob/master/lib/undici.ts#L839)
|
|
19186
19274
|
|
|
19187
19275
|
自定义 GET 查询参数,传入后直接替换代理目标 URL 的整个 query string
|
|
19188
19276
|
|
|
@@ -19192,7 +19280,7 @@ Defined in: [lib/undici.ts:816](https://github.com/maiyunnet/kebab/blob/master/l
|
|
|
19192
19280
|
|
|
19193
19281
|
> `optional` **reuse?**: `string` \| `Agent` \| `ProxyAgent`
|
|
19194
19282
|
|
|
19195
|
-
Defined in: [lib/undici.ts:
|
|
19283
|
+
Defined in: [lib/undici.ts:841](https://github.com/maiyunnet/kebab/blob/master/lib/undici.ts#L841)
|
|
19196
19284
|
|
|
19197
19285
|
默认为 default
|
|
19198
19286
|
|
|
@@ -19202,7 +19290,7 @@ Defined in: [lib/undici.ts:818](https://github.com/maiyunnet/kebab/blob/master/l
|
|
|
19202
19290
|
|
|
19203
19291
|
> `optional` **timeout?**: `number`
|
|
19204
19292
|
|
|
19205
|
-
Defined in: [lib/undici.ts:
|
|
19293
|
+
Defined in: [lib/undici.ts:820](https://github.com/maiyunnet/kebab/blob/master/lib/undici.ts#L820)
|
|
19206
19294
|
|
|
19207
19295
|
秒数,默认 300 秒
|
|
19208
19296
|
|
|
@@ -19691,7 +19779,7 @@ lib/undici/type-aliases/THttpHeaders.md
|
|
|
19691
19779
|
|
|
19692
19780
|
> **THttpHeaders** = `http.IncomingHttpHeaders` & `object`
|
|
19693
19781
|
|
|
19694
|
-
Defined in: [lib/undici.ts:
|
|
19782
|
+
Defined in: [lib/undici.ts:846](https://github.com/maiyunnet/kebab/blob/master/lib/undici.ts#L846)
|
|
19695
19783
|
|
|
19696
19784
|
http headers
|
|
19697
19785
|
|
|
@@ -26422,7 +26510,7 @@ sys/route/functions/getFormData.md
|
|
|
26422
26510
|
|
|
26423
26511
|
> **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)\>; \}\>
|
|
26424
26512
|
|
|
26425
|
-
Defined in: [sys/route.ts:
|
|
26513
|
+
Defined in: [sys/route.ts:980](https://github.com/maiyunnet/kebab/blob/master/sys/route.ts#L980)
|
|
26426
26514
|
|
|
26427
26515
|
获取 formdata 的 post
|
|
26428
26516
|
|
|
@@ -26489,7 +26577,7 @@ sys/route/functions/getPost.md
|
|
|
26489
26577
|
|
|
26490
26578
|
> **getPost**(`req`): `Promise`\<\{ `input`: `string`; `post`: `Record`\<`string`, `any`\>; `raw`: `Record`\<`string`, `any`\>; \}\>
|
|
26491
26579
|
|
|
26492
|
-
Defined in: [sys/route.ts:
|
|
26580
|
+
Defined in: [sys/route.ts:894](https://github.com/maiyunnet/kebab/blob/master/sys/route.ts#L894)
|
|
26493
26581
|
|
|
26494
26582
|
获取 post 对象(通常已自动获取),如果是文件上传(formdata)的情况则不获取
|
|
26495
26583
|
|
|
@@ -26518,7 +26606,7 @@ sys/route/functions/run.md
|
|
|
26518
26606
|
|
|
26519
26607
|
> **run**(`data`): `Promise`\<`boolean`\>
|
|
26520
26608
|
|
|
26521
|
-
Defined in: [sys/route.ts:
|
|
26609
|
+
Defined in: [sys/route.ts:87](https://github.com/maiyunnet/kebab/blob/master/sys/route.ts#L87)
|
|
26522
26610
|
|
|
26523
26611
|
若为动态路径则执行此函数,此函数不进行判断 kebab.json 是否存在
|
|
26524
26612
|
|
|
@@ -26605,7 +26693,7 @@ sys/route/functions/unlinkUploadFiles.md
|
|
|
26605
26693
|
|
|
26606
26694
|
> **unlinkUploadFiles**(`cctr`): `Promise`\<`void`\>
|
|
26607
26695
|
|
|
26608
|
-
Defined in: [sys/route.ts:
|
|
26696
|
+
Defined in: [sys/route.ts:853](https://github.com/maiyunnet/kebab/blob/master/sys/route.ts#L853)
|
|
26609
26697
|
|
|
26610
26698
|
删除本次请求所有已上传的临时文件
|
|
26611
26699
|
|
|
@@ -26634,7 +26722,7 @@ sys/route/functions/waitCtr.md
|
|
|
26634
26722
|
|
|
26635
26723
|
> **waitCtr**(`cctr`): `Promise`\<`void`\>
|
|
26636
26724
|
|
|
26637
|
-
Defined in: [sys/route.ts:
|
|
26725
|
+
Defined in: [sys/route.ts:873](https://github.com/maiyunnet/kebab/blob/master/sys/route.ts#L873)
|
|
26638
26726
|
|
|
26639
26727
|
等待异步任务结束,并删除临时文件,如果结束后还有事务没关闭,则会在本函数中打印控制台并且写入 log 文件
|
|
26640
26728
|
此时其实已经给客户端返回了,此处等待不消耗客户端的等待时间
|
package/index.d.ts
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Project: Kebab, User: JianSuoQiYue
|
|
3
3
|
* Date: 2019-3-30 12:46:41
|
|
4
|
-
* Last: 2020-3-8 21:04:24, 2022-07-22 14:20:34, 2023-5-24 01:34:57, 2025-6-13 14:49:27, 2025-10-1 10:11:54
|
|
4
|
+
* Last: 2020-3-8 21:04:24, 2022-07-22 14:20:34, 2023-5-24 01:34:57, 2025-6-13 14:49:27, 2025-10-1 10:11:54, 2026-07-14 17:40:00
|
|
5
5
|
* --- 本文件用来定义每个目录实体地址的常量 ---
|
|
6
6
|
*/
|
|
7
7
|
/** --- 当前系统版本号 --- */
|
|
8
|
-
export declare const VER = "9.13.
|
|
8
|
+
export declare const VER = "9.13.8";
|
|
9
9
|
/** --- 框架根目录,以 / 结尾 --- */
|
|
10
10
|
export declare const ROOT_PATH: string;
|
|
11
11
|
/** --- 框架的 LIB,以 / 结尾 --- */
|
package/index.js
CHANGED
|
@@ -2,11 +2,11 @@
|
|
|
2
2
|
/**
|
|
3
3
|
* Project: Kebab, User: JianSuoQiYue
|
|
4
4
|
* Date: 2019-3-30 12:46:41
|
|
5
|
-
* Last: 2020-3-8 21:04:24, 2022-07-22 14:20:34, 2023-5-24 01:34:57, 2025-6-13 14:49:27, 2025-10-1 10:11:54
|
|
5
|
+
* Last: 2020-3-8 21:04:24, 2022-07-22 14:20:34, 2023-5-24 01:34:57, 2025-6-13 14:49:27, 2025-10-1 10:11:54, 2026-07-14 17:40:00
|
|
6
6
|
* --- 本文件用来定义每个目录实体地址的常量 ---
|
|
7
7
|
*/
|
|
8
8
|
/** --- 当前系统版本号 --- */
|
|
9
|
-
export const VER = '9.13.
|
|
9
|
+
export const VER = '9.13.8';
|
|
10
10
|
// --- 服务端用的路径 ---
|
|
11
11
|
const imu = decodeURIComponent(import.meta.url).replace('file://', '').replace(/^\/(\w:)/, '$1');
|
|
12
12
|
/** --- /xxx/xxx --- */
|
package/lib/db/conn.js
CHANGED
|
@@ -3,6 +3,8 @@ import * as lCore from '#kebab/lib/core.js';
|
|
|
3
3
|
import * as lTime from '#kebab/lib/time.js';
|
|
4
4
|
import * as lDb from '#kebab/lib/db.js';
|
|
5
5
|
// --- 注册解析器 ---
|
|
6
|
+
// --- pg 库对以下类型默认返回 string,为与 MySQL 行为保持一致,在此注册解析器转为 JS 原生类型 ---
|
|
7
|
+
// --- POLYGON: 返回如 ((1,1),(2,2)) 的字符串,解析为 {x, y}[] ---
|
|
6
8
|
pg.types.setTypeParser(pg.types.builtins.POLYGON, val => {
|
|
7
9
|
if (val === null) {
|
|
8
10
|
return null;
|
|
@@ -20,6 +22,7 @@ pg.types.setTypeParser(pg.types.builtins.POLYGON, val => {
|
|
|
20
22
|
// --- 返回 [{x: 1, y: 1}, {x :2, y: 2}, ... ] ---
|
|
21
23
|
return points;
|
|
22
24
|
});
|
|
25
|
+
// --- INT8 (bigint): JS Number 无法安全表示 64 位整数,pg 默认返回 string,parseInt 转为 number ---
|
|
23
26
|
pg.types.setTypeParser(pg.types.builtins.INT8, val => {
|
|
24
27
|
if (val === null) {
|
|
25
28
|
return null;
|
|
@@ -170,7 +173,7 @@ export class Connection {
|
|
|
170
173
|
}));
|
|
171
174
|
}
|
|
172
175
|
else {
|
|
173
|
-
const res = await this._link.
|
|
176
|
+
const res = await this._link.query(sql, values);
|
|
174
177
|
rtn.rows = res[0];
|
|
175
178
|
if (res[1]) {
|
|
176
179
|
rtn.fields = res[1].map(item => ({
|
|
@@ -236,7 +239,7 @@ export class Connection {
|
|
|
236
239
|
}));
|
|
237
240
|
}
|
|
238
241
|
else {
|
|
239
|
-
const res = await this._link.
|
|
242
|
+
const res = await this._link.query(sql, values);
|
|
240
243
|
rtn.packet = {
|
|
241
244
|
'affected': res[0].affectedRows,
|
|
242
245
|
'insert': res[0].insertId,
|
package/lib/net.d.ts
CHANGED
|
@@ -48,6 +48,14 @@ export declare function postJson(u: string, data: kebab.Json[] | Record<string,
|
|
|
48
48
|
* @returns JSON 数据,失败时返回 null
|
|
49
49
|
*/
|
|
50
50
|
export declare function postJsonResponseJson(u: string, data: kebab.Json[] | Record<string, kebab.Json>, opt?: IRequestOptions): Promise<kebab.Json | null>;
|
|
51
|
+
/**
|
|
52
|
+
* --- 发起 POST 请求并解析 JSON 响应 ---
|
|
53
|
+
* @param u 网址
|
|
54
|
+
* @param data 数据
|
|
55
|
+
* @param opt 选项
|
|
56
|
+
* @returns JSON 数据,失败时返回 null
|
|
57
|
+
*/
|
|
58
|
+
export declare function postResponseJson(u: string, data: Record<string, kebab.Json>, opt?: IRequestOptions): Promise<kebab.Json | null>;
|
|
51
59
|
/**
|
|
52
60
|
* --- 发起 GET 请求并解析 JSON 响应 ---
|
|
53
61
|
* @param u 网址
|
package/lib/net.js
CHANGED
|
@@ -97,6 +97,26 @@ export async function postJsonResponseJson(u, data, opt = {}) {
|
|
|
97
97
|
}
|
|
98
98
|
return json;
|
|
99
99
|
}
|
|
100
|
+
/**
|
|
101
|
+
* --- 发起 POST 请求并解析 JSON 响应 ---
|
|
102
|
+
* @param u 网址
|
|
103
|
+
* @param data 数据
|
|
104
|
+
* @param opt 选项
|
|
105
|
+
* @returns JSON 数据,失败时返回 null
|
|
106
|
+
*/
|
|
107
|
+
export async function postResponseJson(u, data, opt = {}) {
|
|
108
|
+
opt.method = 'POST';
|
|
109
|
+
const res = await request(u, data, opt);
|
|
110
|
+
const rtn = await res.getContent();
|
|
111
|
+
if (!rtn) {
|
|
112
|
+
return null;
|
|
113
|
+
}
|
|
114
|
+
const json = lText.parseJson(rtn.toString());
|
|
115
|
+
if (!json) {
|
|
116
|
+
return null;
|
|
117
|
+
}
|
|
118
|
+
return json;
|
|
119
|
+
}
|
|
100
120
|
/**
|
|
101
121
|
* --- 发起 GET 请求并解析 JSON 响应 ---
|
|
102
122
|
* @param u 网址
|
package/lib/undici/response.d.ts
CHANGED
|
@@ -31,7 +31,7 @@ export declare class Response {
|
|
|
31
31
|
/**
|
|
32
32
|
* --- 获取响应读取流对象 ---
|
|
33
33
|
*/
|
|
34
|
-
getStream(): (import("undici/types/readable").default & undici.Dispatcher.BodyMixin) |
|
|
34
|
+
getStream(): zlib.BrotliDecompress | zlib.Gunzip | zlib.Inflate | (import("undici/types/readable").default & undici.Dispatcher.BodyMixin) | null;
|
|
35
35
|
/**
|
|
36
36
|
* --- 获取原生响应读取流对象 ---
|
|
37
37
|
*/
|
package/lib/undici.d.ts
CHANGED
|
@@ -42,6 +42,14 @@ export declare function postJson(u: string, data: kebab.Json[] | Record<string,
|
|
|
42
42
|
* @param opt 选项
|
|
43
43
|
*/
|
|
44
44
|
export declare function postJsonResponseJson(u: string, data: kebab.Json[] | Record<string, kebab.Json>, opt?: IRequestOptions): Promise<kebab.Json | null>;
|
|
45
|
+
/**
|
|
46
|
+
* --- 发起 POST 请求并解析 JSON 响应 ---
|
|
47
|
+
* @param u 网址
|
|
48
|
+
* @param data 数据
|
|
49
|
+
* @param opt 选项
|
|
50
|
+
* @returns JSON 数据,失败时返回 null
|
|
51
|
+
*/
|
|
52
|
+
export declare function postResponseJson(u: string, data: Record<string, kebab.Json>, opt?: IRequestOptions): Promise<kebab.Json | null>;
|
|
45
53
|
/**
|
|
46
54
|
* --- 发起 GET 请求并解析 JSON 响应 ---
|
|
47
55
|
* @param u 网址
|
package/lib/undici.js
CHANGED
|
@@ -115,6 +115,26 @@ export async function postJsonResponseJson(u, data, opt = {}) {
|
|
|
115
115
|
}
|
|
116
116
|
return json;
|
|
117
117
|
}
|
|
118
|
+
/**
|
|
119
|
+
* --- 发起 POST 请求并解析 JSON 响应 ---
|
|
120
|
+
* @param u 网址
|
|
121
|
+
* @param data 数据
|
|
122
|
+
* @param opt 选项
|
|
123
|
+
* @returns JSON 数据,失败时返回 null
|
|
124
|
+
*/
|
|
125
|
+
export async function postResponseJson(u, data, opt = {}) {
|
|
126
|
+
opt.method = 'POST';
|
|
127
|
+
const res = await request(u, data, opt);
|
|
128
|
+
const rtn = await res.getContent();
|
|
129
|
+
if (!rtn) {
|
|
130
|
+
return null;
|
|
131
|
+
}
|
|
132
|
+
const json = lText.parseJson(rtn.toString());
|
|
133
|
+
if (!json) {
|
|
134
|
+
return null;
|
|
135
|
+
}
|
|
136
|
+
return json;
|
|
137
|
+
}
|
|
118
138
|
/**
|
|
119
139
|
* --- 发起 GET 请求并解析 JSON 响应 ---
|
|
120
140
|
* @param u 网址
|
package/package.json
CHANGED
package/sys/child.js
CHANGED
|
@@ -303,7 +303,9 @@ async function requestHandler(req, res, https) {
|
|
|
303
303
|
res.setHeader('content-length', Buffer.byteLength(content));
|
|
304
304
|
lCore.writeHead(res, 500);
|
|
305
305
|
}
|
|
306
|
-
res.
|
|
306
|
+
if (!res.writableEnded) {
|
|
307
|
+
res.end(content);
|
|
308
|
+
}
|
|
307
309
|
return;
|
|
308
310
|
}
|
|
309
311
|
}
|
|
@@ -344,7 +346,9 @@ async function requestHandler(req, res, https) {
|
|
|
344
346
|
res.setHeader('content-length', Buffer.byteLength(content));
|
|
345
347
|
lCore.writeHead(res, 500);
|
|
346
348
|
}
|
|
347
|
-
res.
|
|
349
|
+
if (!res.writableEnded) {
|
|
350
|
+
res.end(content);
|
|
351
|
+
}
|
|
348
352
|
return;
|
|
349
353
|
}
|
|
350
354
|
}
|
package/sys/route.js
CHANGED
|
@@ -37,7 +37,9 @@ function respond500(res) {
|
|
|
37
37
|
res.setHeader('content-length', Buffer.byteLength(content));
|
|
38
38
|
lCore.writeHead(res, 500);
|
|
39
39
|
}
|
|
40
|
-
res.
|
|
40
|
+
if (!res.writableEnded) {
|
|
41
|
+
res.end(content);
|
|
42
|
+
}
|
|
41
43
|
}
|
|
42
44
|
/**
|
|
43
45
|
* --- 输出 404 错误响应 ---
|
|
@@ -47,16 +49,24 @@ function respond500(res) {
|
|
|
47
49
|
*/
|
|
48
50
|
function respond404(res, config, path) {
|
|
49
51
|
if (config?.route?.['#404']) {
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
52
|
+
if (!res.headersSent) {
|
|
53
|
+
res.setHeader('location', lText.urlResolve(config.const.urlBase, config.route['#404']));
|
|
54
|
+
lCore.writeHead(res, 302);
|
|
55
|
+
}
|
|
56
|
+
if (!res.writableEnded) {
|
|
57
|
+
res.end('');
|
|
58
|
+
}
|
|
53
59
|
return;
|
|
54
60
|
}
|
|
55
61
|
const content = '[Error] Controller not found, path: ' + path + '.';
|
|
56
|
-
res.
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
62
|
+
if (!res.headersSent) {
|
|
63
|
+
res.setHeader('content-type', 'text/html; charset=utf-8');
|
|
64
|
+
res.setHeader('content-length', Buffer.byteLength(content));
|
|
65
|
+
lCore.writeHead(res, 404);
|
|
66
|
+
}
|
|
67
|
+
if (!res.writableEnded) {
|
|
68
|
+
res.end(content);
|
|
69
|
+
}
|
|
60
70
|
}
|
|
61
71
|
/**
|
|
62
72
|
* --- 若为动态路径则执行此函数,此函数不进行判断 kebab.json 是否存在 ---
|