@maiyunnet/kebab 9.3.3 → 9.3.4

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 CHANGED
@@ -1360,7 +1360,7 @@ index/variables/VER.md
1360
1360
 
1361
1361
  # Variable: VER
1362
1362
 
1363
- > `const` **VER**: `"9.3.3"` = `'9.3.3'`
1363
+ > `const` **VER**: `"9.3.4"` = `'9.3.4'`
1364
1364
 
1365
1365
  Defined in: [index.ts:10](https://github.com/maiyunnet/kebab/blob/master/index.ts#L10)
1366
1366
 
@@ -17807,7 +17807,7 @@ lib/undici/functions/fetch.md
17807
17807
 
17808
17808
  > **fetch**(`input`, `init?`): `Promise`\<`Response`\>
17809
17809
 
17810
- Defined in: [lib/undici.ts:175](https://github.com/maiyunnet/kebab/blob/master/lib/undici.ts#L175)
17810
+ Defined in: [lib/undici.ts:174](https://github.com/maiyunnet/kebab/blob/master/lib/undici.ts#L174)
17811
17811
 
17812
17812
  发起一个完全兼容 fetch 的请求
17813
17813
 
@@ -17842,7 +17842,7 @@ lib/undici/functions/filterHeaders.md
17842
17842
 
17843
17843
  > **filterHeaders**(`headers`, `res?`, `filter?`): `Record`\<`string`, `string` \| `string`[]\>
17844
17844
 
17845
- Defined in: [lib/undici.ts:530](https://github.com/maiyunnet/kebab/blob/master/lib/undici.ts#L530)
17845
+ Defined in: [lib/undici.ts:529](https://github.com/maiyunnet/kebab/blob/master/lib/undici.ts#L529)
17846
17846
 
17847
17847
  剔除不代理的 header,返回新的 header
17848
17848
 
@@ -17883,7 +17883,7 @@ lib/undici/functions/getFormData.md
17883
17883
 
17884
17884
  > **getFormData**(): [`FormData`](../formdata/classes/FormData.md)
17885
17885
 
17886
- Defined in: [lib/undici.ts:514](https://github.com/maiyunnet/kebab/blob/master/lib/undici.ts#L514)
17886
+ Defined in: [lib/undici.ts:513](https://github.com/maiyunnet/kebab/blob/master/lib/undici.ts#L513)
17887
17887
 
17888
17888
  创建 FormData 对象
17889
17889
 
@@ -17966,7 +17966,7 @@ lib/undici/functions/getResponseJson.md
17966
17966
 
17967
17967
  > **getResponseJson**(`u`, `opt?`): `Promise`\<`any`\>
17968
17968
 
17969
- Defined in: [lib/undici.ts:154](https://github.com/maiyunnet/kebab/blob/master/lib/undici.ts#L154)
17969
+ Defined in: [lib/undici.ts:153](https://github.com/maiyunnet/kebab/blob/master/lib/undici.ts#L153)
17970
17970
 
17971
17971
  发起 GET 请求并解析 JSON 响应
17972
17972
 
@@ -18003,7 +18003,7 @@ lib/undici/functions/mproxyData.md
18003
18003
 
18004
18004
  > **mproxyData**(`ctr`): `any`
18005
18005
 
18006
- Defined in: [lib/undici.ts:619](https://github.com/maiyunnet/kebab/blob/master/lib/undici.ts#L619)
18006
+ Defined in: [lib/undici.ts:618](https://github.com/maiyunnet/kebab/blob/master/lib/undici.ts#L618)
18007
18007
 
18008
18008
  获取 mproxy 的附加数据
18009
18009
 
@@ -18032,7 +18032,7 @@ lib/undici/functions/mproxy.md
18032
18032
 
18033
18033
  > **mproxy**(`ctr`, `auth`, `opt?`): `Promise`\<`number`\>
18034
18034
 
18035
- Defined in: [lib/undici.ts:566](https://github.com/maiyunnet/kebab/blob/master/lib/undici.ts#L566)
18035
+ Defined in: [lib/undici.ts:565](https://github.com/maiyunnet/kebab/blob/master/lib/undici.ts#L565)
18036
18036
 
18037
18037
  正向 mproxy 代理,注意提前处理不要自动处理 post 数据,读取 get 的 url 为实际请求地址
18038
18038
  get: url, auth
@@ -18142,9 +18142,9 @@ lib/undici/functions/postJsonResponseJson.md
18142
18142
 
18143
18143
  > **postJsonResponseJson**(`u`, `data`, `opt?`): `Promise`\<`any`\>
18144
18144
 
18145
- Defined in: [lib/undici.ts:131](https://github.com/maiyunnet/kebab/blob/master/lib/undici.ts#L131)
18145
+ Defined in: [lib/undici.ts:130](https://github.com/maiyunnet/kebab/blob/master/lib/undici.ts#L130)
18146
18146
 
18147
- 发起 JSON 请求并解析 JSON 响应
18147
+ 发起 JSON 请求并解析 JSON 响应,失败时返回 null
18148
18148
 
18149
18149
  ## Parameters
18150
18150
 
@@ -18170,8 +18170,6 @@ Defined in: [lib/undici.ts:131](https://github.com/maiyunnet/kebab/blob/master/l
18170
18170
 
18171
18171
  `Promise`\<`any`\>
18172
18172
 
18173
- JSON 数据,失败时返回 null
18174
-
18175
18173
  lib/undici/functions/post.md
18176
18174
  ---
18177
18175
 
@@ -18226,7 +18224,7 @@ lib/undici/functions/request.md
18226
18224
 
18227
18225
  > **request**(`u`, `data?`, `opt?`): `Promise`\<[`Response`](../response/classes/Response.md)\>
18228
18226
 
18229
- Defined in: [lib/undici.ts:344](https://github.com/maiyunnet/kebab/blob/master/lib/undici.ts#L344)
18227
+ Defined in: [lib/undici.ts:343](https://github.com/maiyunnet/kebab/blob/master/lib/undici.ts#L343)
18230
18228
 
18231
18229
  发起一个请求
18232
18230
 
@@ -18263,7 +18261,7 @@ lib/undici/functions/rproxy.md
18263
18261
 
18264
18262
  > **rproxy**(`ctr`, `route`, `opt?`): `Promise`\<`boolean`\>
18265
18263
 
18266
- Defined in: [lib/undici.ts:637](https://github.com/maiyunnet/kebab/blob/master/lib/undici.ts#L637)
18264
+ Defined in: [lib/undici.ts:636](https://github.com/maiyunnet/kebab/blob/master/lib/undici.ts#L636)
18267
18265
 
18268
18266
  反向代理,注意提前处理不要自动处理 post 数据,将本服务器的某个路由反代到其他网址
18269
18267
 
@@ -18340,7 +18338,7 @@ lib/undici/interfaces/IMproxyOptions.md
18340
18338
 
18341
18339
  # Interface: IMproxyOptions
18342
18340
 
18343
- Defined in: [lib/undici.ts:721](https://github.com/maiyunnet/kebab/blob/master/lib/undici.ts#L721)
18341
+ Defined in: [lib/undici.ts:720](https://github.com/maiyunnet/kebab/blob/master/lib/undici.ts#L720)
18344
18342
 
18345
18343
  正向代理请求的传入参数选项
18346
18344
 
@@ -18350,7 +18348,7 @@ Defined in: [lib/undici.ts:721](https://github.com/maiyunnet/kebab/blob/master/l
18350
18348
 
18351
18349
  > `optional` **filter?**: (`h`) => `boolean`
18352
18350
 
18353
- Defined in: [lib/undici.ts:730](https://github.com/maiyunnet/kebab/blob/master/lib/undici.ts#L730)
18351
+ Defined in: [lib/undici.ts:729](https://github.com/maiyunnet/kebab/blob/master/lib/undici.ts#L729)
18354
18352
 
18355
18353
  过滤 header,返回 true 则留下
18356
18354
 
@@ -18370,7 +18368,7 @@ Defined in: [lib/undici.ts:730](https://github.com/maiyunnet/kebab/blob/master/l
18370
18368
 
18371
18369
  > `optional` **follow?**: `number`
18372
18370
 
18373
- Defined in: [lib/undici.ts:724](https://github.com/maiyunnet/kebab/blob/master/lib/undici.ts#L724)
18371
+ Defined in: [lib/undici.ts:723](https://github.com/maiyunnet/kebab/blob/master/lib/undici.ts#L723)
18374
18372
 
18375
18373
  ***
18376
18374
 
@@ -18378,7 +18376,7 @@ Defined in: [lib/undici.ts:724](https://github.com/maiyunnet/kebab/blob/master/l
18378
18376
 
18379
18377
  > `optional` **headers?**: [`THttpHeaders`](../type-aliases/THttpHeaders.md)
18380
18378
 
18381
- Defined in: [lib/undici.ts:728](https://github.com/maiyunnet/kebab/blob/master/lib/undici.ts#L728)
18379
+ Defined in: [lib/undici.ts:727](https://github.com/maiyunnet/kebab/blob/master/lib/undici.ts#L727)
18382
18380
 
18383
18381
  ***
18384
18382
 
@@ -18386,7 +18384,7 @@ Defined in: [lib/undici.ts:728](https://github.com/maiyunnet/kebab/blob/master/l
18386
18384
 
18387
18385
  > `optional` **hosts?**: `string` \| `Record`\<`string`, `string`\>
18388
18386
 
18389
- Defined in: [lib/undici.ts:726](https://github.com/maiyunnet/kebab/blob/master/lib/undici.ts#L726)
18387
+ Defined in: [lib/undici.ts:725](https://github.com/maiyunnet/kebab/blob/master/lib/undici.ts#L725)
18390
18388
 
18391
18389
  自定义 host 映射,如 {'www.maiyun.net': '127.0.0.1'},或全部映射到一个 host
18392
18390
 
@@ -18396,7 +18394,7 @@ Defined in: [lib/undici.ts:726](https://github.com/maiyunnet/kebab/blob/master/l
18396
18394
 
18397
18395
  > `optional` **local?**: `string`
18398
18396
 
18399
- Defined in: [lib/undici.ts:727](https://github.com/maiyunnet/kebab/blob/master/lib/undici.ts#L727)
18397
+ Defined in: [lib/undici.ts:726](https://github.com/maiyunnet/kebab/blob/master/lib/undici.ts#L726)
18400
18398
 
18401
18399
  ***
18402
18400
 
@@ -18404,7 +18402,7 @@ Defined in: [lib/undici.ts:727](https://github.com/maiyunnet/kebab/blob/master/l
18404
18402
 
18405
18403
  > `optional` **reuse?**: `string` \| `Agent` \| `ProxyAgent`
18406
18404
 
18407
- Defined in: [lib/undici.ts:732](https://github.com/maiyunnet/kebab/blob/master/lib/undici.ts#L732)
18405
+ Defined in: [lib/undici.ts:731](https://github.com/maiyunnet/kebab/blob/master/lib/undici.ts#L731)
18408
18406
 
18409
18407
  默认为 default
18410
18408
 
@@ -18414,7 +18412,7 @@ Defined in: [lib/undici.ts:732](https://github.com/maiyunnet/kebab/blob/master/l
18414
18412
 
18415
18413
  > `optional` **timeout?**: `number`
18416
18414
 
18417
- Defined in: [lib/undici.ts:723](https://github.com/maiyunnet/kebab/blob/master/lib/undici.ts#L723)
18415
+ Defined in: [lib/undici.ts:722](https://github.com/maiyunnet/kebab/blob/master/lib/undici.ts#L722)
18418
18416
 
18419
18417
  秒数
18420
18418
 
@@ -18429,7 +18427,7 @@ lib/undici/interfaces/IRequestOptions.md
18429
18427
 
18430
18428
  # Interface: IRequestOptions
18431
18429
 
18432
- Defined in: [lib/undici.ts:690](https://github.com/maiyunnet/kebab/blob/master/lib/undici.ts#L690)
18430
+ Defined in: [lib/undici.ts:689](https://github.com/maiyunnet/kebab/blob/master/lib/undici.ts#L689)
18433
18431
 
18434
18432
  请求的传入参数选项
18435
18433
 
@@ -18439,7 +18437,7 @@ Defined in: [lib/undici.ts:690](https://github.com/maiyunnet/kebab/blob/master/l
18439
18437
 
18440
18438
  > `optional` **cookie?**: `Record`\<`string`, [`ICookie`](../../cookie/interfaces/ICookie.md)\>
18441
18439
 
18442
- Defined in: [lib/undici.ts:715](https://github.com/maiyunnet/kebab/blob/master/lib/undici.ts#L715)
18440
+ Defined in: [lib/undici.ts:714](https://github.com/maiyunnet/kebab/blob/master/lib/undici.ts#L714)
18443
18441
 
18444
18442
  cookie 托管对象
18445
18443
 
@@ -18449,7 +18447,7 @@ cookie 托管对象
18449
18447
 
18450
18448
  > `optional` **follow?**: `number`
18451
18449
 
18452
- Defined in: [lib/undici.ts:696](https://github.com/maiyunnet/kebab/blob/master/lib/undici.ts#L696)
18450
+ Defined in: [lib/undici.ts:695](https://github.com/maiyunnet/kebab/blob/master/lib/undici.ts#L695)
18453
18451
 
18454
18452
  追踪 location 次数,0 为不追踪,默认为 0
18455
18453
 
@@ -18459,7 +18457,7 @@ Defined in: [lib/undici.ts:696](https://github.com/maiyunnet/kebab/blob/master/l
18459
18457
 
18460
18458
  > `optional` **headers?**: [`THttpHeaders`](../type-aliases/THttpHeaders.md)
18461
18459
 
18462
- Defined in: [lib/undici.ts:701](https://github.com/maiyunnet/kebab/blob/master/lib/undici.ts#L701)
18460
+ Defined in: [lib/undici.ts:700](https://github.com/maiyunnet/kebab/blob/master/lib/undici.ts#L700)
18463
18461
 
18464
18462
  ***
18465
18463
 
@@ -18467,7 +18465,7 @@ Defined in: [lib/undici.ts:701](https://github.com/maiyunnet/kebab/blob/master/l
18467
18465
 
18468
18466
  > `optional` **hosts?**: `string` \| `Record`\<`string`, `string`\>
18469
18467
 
18470
- Defined in: [lib/undici.ts:698](https://github.com/maiyunnet/kebab/blob/master/lib/undici.ts#L698)
18468
+ Defined in: [lib/undici.ts:697](https://github.com/maiyunnet/kebab/blob/master/lib/undici.ts#L697)
18471
18469
 
18472
18470
  自定义 host 映射,如 {'www.maiyun.net': '127.0.0.1'},或全部映射到一个 host
18473
18471
 
@@ -18477,7 +18475,7 @@ Defined in: [lib/undici.ts:698](https://github.com/maiyunnet/kebab/blob/master/l
18477
18475
 
18478
18476
  > `optional` **keep?**: `boolean`
18479
18477
 
18480
- Defined in: [lib/undici.ts:711](https://github.com/maiyunnet/kebab/blob/master/lib/undici.ts#L711)
18478
+ Defined in: [lib/undici.ts:710](https://github.com/maiyunnet/kebab/blob/master/lib/undici.ts#L710)
18481
18479
 
18482
18480
  连接是否保持长连接(即是否允许复用),默认为 true
18483
18481
 
@@ -18487,7 +18485,7 @@ Defined in: [lib/undici.ts:711](https://github.com/maiyunnet/kebab/blob/master/l
18487
18485
 
18488
18486
  > `optional` **local?**: `string`
18489
18487
 
18490
- Defined in: [lib/undici.ts:700](https://github.com/maiyunnet/kebab/blob/master/lib/undici.ts#L700)
18488
+ Defined in: [lib/undici.ts:699](https://github.com/maiyunnet/kebab/blob/master/lib/undici.ts#L699)
18491
18489
 
18492
18490
  ***
18493
18491
 
@@ -18495,7 +18493,7 @@ Defined in: [lib/undici.ts:700](https://github.com/maiyunnet/kebab/blob/master/l
18495
18493
 
18496
18494
  > `optional` **log?**: `boolean`
18497
18495
 
18498
- Defined in: [lib/undici.ts:717](https://github.com/maiyunnet/kebab/blob/master/lib/undici.ts#L717)
18496
+ Defined in: [lib/undici.ts:716](https://github.com/maiyunnet/kebab/blob/master/lib/undici.ts#L716)
18499
18497
 
18500
18498
  若有异常写入文件日志,默认为 true
18501
18499
 
@@ -18505,7 +18503,7 @@ Defined in: [lib/undici.ts:717](https://github.com/maiyunnet/kebab/blob/master/l
18505
18503
 
18506
18504
  > `optional` **method?**: `"GET"` \| `"POST"` \| `"PUT"` \| `"DELETE"` \| `"OPTIONS"`
18507
18505
 
18508
- Defined in: [lib/undici.ts:691](https://github.com/maiyunnet/kebab/blob/master/lib/undici.ts#L691)
18506
+ Defined in: [lib/undici.ts:690](https://github.com/maiyunnet/kebab/blob/master/lib/undici.ts#L690)
18509
18507
 
18510
18508
  ***
18511
18509
 
@@ -18513,7 +18511,7 @@ Defined in: [lib/undici.ts:691](https://github.com/maiyunnet/kebab/blob/master/l
18513
18511
 
18514
18512
  > `optional` **mproxy?**: `object`
18515
18513
 
18516
- Defined in: [lib/undici.ts:703](https://github.com/maiyunnet/kebab/blob/master/lib/undici.ts#L703)
18514
+ Defined in: [lib/undici.ts:702](https://github.com/maiyunnet/kebab/blob/master/lib/undici.ts#L702)
18517
18515
 
18518
18516
  正向 mproxy 代理,url 如 https://xxx/abc
18519
18517
 
@@ -18541,7 +18539,7 @@ Defined in: [lib/undici.ts:703](https://github.com/maiyunnet/kebab/blob/master/l
18541
18539
 
18542
18540
  > `optional` **reuse?**: `string` \| `Agent` \| `ProxyAgent`
18543
18541
 
18544
- Defined in: [lib/undici.ts:713](https://github.com/maiyunnet/kebab/blob/master/lib/undici.ts#L713)
18542
+ Defined in: [lib/undici.ts:712](https://github.com/maiyunnet/kebab/blob/master/lib/undici.ts#L712)
18545
18543
 
18546
18544
  复用池名/Agent,默认为 default
18547
18545
 
@@ -18551,7 +18549,7 @@ Defined in: [lib/undici.ts:713](https://github.com/maiyunnet/kebab/blob/master/l
18551
18549
 
18552
18550
  > `optional` **save?**: `string`
18553
18551
 
18554
- Defined in: [lib/undici.ts:699](https://github.com/maiyunnet/kebab/blob/master/lib/undici.ts#L699)
18552
+ Defined in: [lib/undici.ts:698](https://github.com/maiyunnet/kebab/blob/master/lib/undici.ts#L698)
18555
18553
 
18556
18554
  ***
18557
18555
 
@@ -18559,7 +18557,7 @@ Defined in: [lib/undici.ts:699](https://github.com/maiyunnet/kebab/blob/master/l
18559
18557
 
18560
18558
  > `optional` **timeout?**: `number`
18561
18559
 
18562
- Defined in: [lib/undici.ts:694](https://github.com/maiyunnet/kebab/blob/master/lib/undici.ts#L694)
18560
+ Defined in: [lib/undici.ts:693](https://github.com/maiyunnet/kebab/blob/master/lib/undici.ts#L693)
18563
18561
 
18564
18562
  秒数,默认 10 秒
18565
18563
 
@@ -18569,7 +18567,7 @@ Defined in: [lib/undici.ts:694](https://github.com/maiyunnet/kebab/blob/master/l
18569
18567
 
18570
18568
  > `optional` **type?**: `"form"` \| `"json"`
18571
18569
 
18572
- Defined in: [lib/undici.ts:692](https://github.com/maiyunnet/kebab/blob/master/lib/undici.ts#L692)
18570
+ Defined in: [lib/undici.ts:691](https://github.com/maiyunnet/kebab/blob/master/lib/undici.ts#L691)
18573
18571
 
18574
18572
  lib/undici/interfaces/IRproxyOptions.md
18575
18573
  ---
@@ -18582,7 +18580,7 @@ lib/undici/interfaces/IRproxyOptions.md
18582
18580
 
18583
18581
  # Interface: IRproxyOptions
18584
18582
 
18585
- Defined in: [lib/undici.ts:736](https://github.com/maiyunnet/kebab/blob/master/lib/undici.ts#L736)
18583
+ Defined in: [lib/undici.ts:735](https://github.com/maiyunnet/kebab/blob/master/lib/undici.ts#L735)
18586
18584
 
18587
18585
  反向代理请求的传入参数选项
18588
18586
 
@@ -18592,7 +18590,7 @@ Defined in: [lib/undici.ts:736](https://github.com/maiyunnet/kebab/blob/master/l
18592
18590
 
18593
18591
  > `optional` **filter?**: (`h`) => `boolean`
18594
18592
 
18595
- Defined in: [lib/undici.ts:745](https://github.com/maiyunnet/kebab/blob/master/lib/undici.ts#L745)
18593
+ Defined in: [lib/undici.ts:744](https://github.com/maiyunnet/kebab/blob/master/lib/undici.ts#L744)
18596
18594
 
18597
18595
  过滤 header,返回 true 则留下
18598
18596
 
@@ -18612,7 +18610,7 @@ Defined in: [lib/undici.ts:745](https://github.com/maiyunnet/kebab/blob/master/l
18612
18610
 
18613
18611
  > `optional` **follow?**: `number`
18614
18612
 
18615
- Defined in: [lib/undici.ts:739](https://github.com/maiyunnet/kebab/blob/master/lib/undici.ts#L739)
18613
+ Defined in: [lib/undici.ts:738](https://github.com/maiyunnet/kebab/blob/master/lib/undici.ts#L738)
18616
18614
 
18617
18615
  ***
18618
18616
 
@@ -18620,7 +18618,7 @@ Defined in: [lib/undici.ts:739](https://github.com/maiyunnet/kebab/blob/master/l
18620
18618
 
18621
18619
  > `optional` **headers?**: [`THttpHeaders`](../type-aliases/THttpHeaders.md)
18622
18620
 
18623
- Defined in: [lib/undici.ts:743](https://github.com/maiyunnet/kebab/blob/master/lib/undici.ts#L743)
18621
+ Defined in: [lib/undici.ts:742](https://github.com/maiyunnet/kebab/blob/master/lib/undici.ts#L742)
18624
18622
 
18625
18623
  ***
18626
18624
 
@@ -18628,7 +18626,7 @@ Defined in: [lib/undici.ts:743](https://github.com/maiyunnet/kebab/blob/master/l
18628
18626
 
18629
18627
  > `optional` **hosts?**: `string` \| `Record`\<`string`, `string`\>
18630
18628
 
18631
- Defined in: [lib/undici.ts:741](https://github.com/maiyunnet/kebab/blob/master/lib/undici.ts#L741)
18629
+ Defined in: [lib/undici.ts:740](https://github.com/maiyunnet/kebab/blob/master/lib/undici.ts#L740)
18632
18630
 
18633
18631
  自定义 host 映射,如 {'www.maiyun.net': '127.0.0.1'},或全部映射到一个 host
18634
18632
 
@@ -18638,7 +18636,7 @@ Defined in: [lib/undici.ts:741](https://github.com/maiyunnet/kebab/blob/master/l
18638
18636
 
18639
18637
  > `optional` **local?**: `string`
18640
18638
 
18641
- Defined in: [lib/undici.ts:742](https://github.com/maiyunnet/kebab/blob/master/lib/undici.ts#L742)
18639
+ Defined in: [lib/undici.ts:741](https://github.com/maiyunnet/kebab/blob/master/lib/undici.ts#L741)
18642
18640
 
18643
18641
  ***
18644
18642
 
@@ -18646,7 +18644,7 @@ Defined in: [lib/undici.ts:742](https://github.com/maiyunnet/kebab/blob/master/l
18646
18644
 
18647
18645
  > `optional` **mproxy?**: `object`
18648
18646
 
18649
- Defined in: [lib/undici.ts:747](https://github.com/maiyunnet/kebab/blob/master/lib/undici.ts#L747)
18647
+ Defined in: [lib/undici.ts:746](https://github.com/maiyunnet/kebab/blob/master/lib/undici.ts#L746)
18650
18648
 
18651
18649
  正向 mproxy 代理,url 如 https://xxx/abc
18652
18650
 
@@ -18674,7 +18672,7 @@ Defined in: [lib/undici.ts:747](https://github.com/maiyunnet/kebab/blob/master/l
18674
18672
 
18675
18673
  > `optional` **reuse?**: `string` \| `Agent` \| `ProxyAgent`
18676
18674
 
18677
- Defined in: [lib/undici.ts:755](https://github.com/maiyunnet/kebab/blob/master/lib/undici.ts#L755)
18675
+ Defined in: [lib/undici.ts:754](https://github.com/maiyunnet/kebab/blob/master/lib/undici.ts#L754)
18678
18676
 
18679
18677
  默认为 default
18680
18678
 
@@ -18684,7 +18682,7 @@ Defined in: [lib/undici.ts:755](https://github.com/maiyunnet/kebab/blob/master/l
18684
18682
 
18685
18683
  > `optional` **timeout?**: `number`
18686
18684
 
18687
- Defined in: [lib/undici.ts:738](https://github.com/maiyunnet/kebab/blob/master/lib/undici.ts#L738)
18685
+ Defined in: [lib/undici.ts:737](https://github.com/maiyunnet/kebab/blob/master/lib/undici.ts#L737)
18688
18686
 
18689
18687
  秒数
18690
18688
 
@@ -19075,7 +19073,7 @@ Defined in: [lib/undici/response.ts:32](https://github.com/maiyunnet/kebab/blob/
19075
19073
 
19076
19074
  Defined in: [lib/undici/response.ts:63](https://github.com/maiyunnet/kebab/blob/master/lib/undici/response.ts#L63)
19077
19075
 
19078
- 读取所有内容为 JSON
19076
+ 读取所有内容为 JSON,失败返回 null
19079
19077
 
19080
19078
  #### Returns
19081
19079
 
@@ -19173,7 +19171,7 @@ lib/undici/type-aliases/THttpHeaders.md
19173
19171
 
19174
19172
  > **THttpHeaders** = `http.IncomingHttpHeaders` & `object`
19175
19173
 
19176
- Defined in: [lib/undici.ts:760](https://github.com/maiyunnet/kebab/blob/master/lib/undici.ts#L760)
19174
+ Defined in: [lib/undici.ts:759](https://github.com/maiyunnet/kebab/blob/master/lib/undici.ts#L759)
19177
19175
 
19178
19176
  http headers
19179
19177
 
@@ -21918,7 +21916,7 @@ Defined in: [sys/ctr.ts:50](https://github.com/maiyunnet/kebab/blob/master/sys/c
21918
21916
 
21919
21917
  Defined in: [sys/ctr.ts:80](https://github.com/maiyunnet/kebab/blob/master/sys/ctr.ts#L80)
21920
21918
 
21921
- 页面浏览器客户端缓存
21919
+ 页面浏览器客户端缓存(单位:秒)
21922
21920
 
21923
21921
  ***
21924
21922
 
package/index.d.ts CHANGED
@@ -5,7 +5,7 @@
5
5
  * --- 本文件用来定义每个目录实体地址的常量 ---
6
6
  */
7
7
  /** --- 当前系统版本号 --- */
8
- export declare const VER = "9.3.3";
8
+ export declare const VER = "9.3.4";
9
9
  /** --- 框架根目录,以 / 结尾 --- */
10
10
  export declare const ROOT_PATH: string;
11
11
  /** --- 框架的 LIB,以 / 结尾 --- */
package/index.js CHANGED
@@ -6,7 +6,7 @@
6
6
  * --- 本文件用来定义每个目录实体地址的常量 ---
7
7
  */
8
8
  /** --- 当前系统版本号 --- */
9
- export const VER = '9.3.3';
9
+ export const VER = '9.3.4';
10
10
  // --- 服务端用的路径 ---
11
11
  const imu = decodeURIComponent(import.meta.url).replace('file://', '').replace(/^\/(\w:)/, '$1');
12
12
  /** --- /xxx/xxx --- */
@@ -21,7 +21,7 @@ export declare class Response {
21
21
  getContent(): Promise<Buffer | null>;
22
22
  /** --- 读取所有内容为文本 --- */
23
23
  getText(): Promise<string | null>;
24
- /** --- 读取所有内容为 JSON --- */
24
+ /** --- 读取所有内容为 JSON,失败返回 null --- */
25
25
  getJson(): Promise<any>;
26
26
  /**
27
27
  * --- 用户自定义的 content 内容 ---
@@ -31,7 +31,7 @@ export declare class Response {
31
31
  /**
32
32
  * --- 获取响应读取流对象 ---
33
33
  */
34
- getStream(): zlib.BrotliDecompress | zlib.Gunzip | zlib.Inflate | (import("undici/types/readable").default & undici.Dispatcher.BodyMixin) | null;
34
+ getStream(): (import("undici/types/readable").default & undici.Dispatcher.BodyMixin) | zlib.Gunzip | zlib.Inflate | zlib.BrotliDecompress | null;
35
35
  /**
36
36
  * --- 获取原生响应读取流对象 ---
37
37
  */
@@ -43,7 +43,7 @@ export class Response {
43
43
  return null;
44
44
  }
45
45
  }
46
- /** --- 读取所有内容为 JSON --- */
46
+ /** --- 读取所有内容为 JSON,失败返回 null --- */
47
47
  async getJson() {
48
48
  try {
49
49
  const text = await this.getText();
package/lib/undici.d.ts CHANGED
@@ -36,11 +36,10 @@ export declare function post(u: string, data: Record<string, kebab.Json> | Buffe
36
36
  */
37
37
  export declare function postJson(u: string, data: kebab.Json[] | Record<string, kebab.Json>, opt?: IRequestOptions): Promise<lResponse.Response>;
38
38
  /**
39
- * --- 发起 JSON 请求并解析 JSON 响应 ---
39
+ * --- 发起 JSON 请求并解析 JSON 响应,失败时返回 null ---
40
40
  * @param u 网址
41
41
  * @param data 数据
42
42
  * @param opt 选项
43
- * @returns JSON 数据,失败时返回 null
44
43
  */
45
44
  export declare function postJsonResponseJson(u: string, data: kebab.Json[] | Record<string, kebab.Json>, opt?: IRequestOptions): Promise<kebab.Json | null>;
46
45
  /**
package/lib/undici.js CHANGED
@@ -95,11 +95,10 @@ export async function postJson(u, data, opt = {}) {
95
95
  return request(u, data, opt);
96
96
  }
97
97
  /**
98
- * --- 发起 JSON 请求并解析 JSON 响应 ---
98
+ * --- 发起 JSON 请求并解析 JSON 响应,失败时返回 null ---
99
99
  * @param u 网址
100
100
  * @param data 数据
101
101
  * @param opt 选项
102
- * @returns JSON 数据,失败时返回 null
103
102
  */
104
103
  export async function postJsonResponseJson(u, data, opt = {}) {
105
104
  opt.method = 'POST';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@maiyunnet/kebab",
3
- "version": "9.3.3",
3
+ "version": "9.3.4",
4
4
  "description": "Simple, easy-to-use, and fully-featured Node.js framework that is ready-to-use out of the box.",
5
5
  "type": "module",
6
6
  "keywords": [
package/sys/ctr.d.ts CHANGED
@@ -32,7 +32,7 @@ export declare class Ctr {
32
32
  protected _session: Record<string, any>;
33
33
  /** --- Session --- 对象 */
34
34
  protected _sess: lSession.Session | null;
35
- /** --- 页面浏览器客户端缓存 --- */
35
+ /** --- 页面浏览器客户端缓存(单位:秒) --- */
36
36
  protected _cacheTTL: number;
37
37
  /** --- XSRF TOKEN 值 --- */
38
38
  protected _xsrf: string;
package/sys/ctr.js CHANGED
@@ -47,7 +47,7 @@ export class Ctr {
47
47
  _session = {};
48
48
  /** --- Session --- 对象 */
49
49
  _sess = null;
50
- /** --- 页面浏览器客户端缓存 --- */
50
+ /** --- 页面浏览器客户端缓存(单位:秒) --- */
51
51
  _cacheTTL;
52
52
  /** --- XSRF TOKEN 值 --- */
53
53
  _xsrf = '';
package/sys/master.js CHANGED
@@ -238,14 +238,39 @@ function createRpcListener() {
238
238
  return;
239
239
  }
240
240
  const ls = await zip.getList();
241
+ // --- 预扫描:收集 .cga 锁定目录和 kebab 子项目目录 ---
242
+ /** --- .cga 锁定的目录集合,key 格式为"父路径/目录名/"(不含开头/,含尾部/),例如 "www/pika/" --- */
243
+ const cgaLockedDirs = new Set();
244
+ /** --- 含有 kebab.json 的目录路径集合(不含开头/,含尾部/,根目录为空字符串) --- */
245
+ const kebabProjectDirs = new Set();
246
+ for (const scanPath in ls) {
247
+ /** --- 带 / 开头的 zip 中文件完整路径,例如 "/www/pika/stc/index.ts" --- */
248
+ const scanFpath = scanPath.startsWith('/') ? scanPath : '/' + scanPath;
249
+ /** --- 纯路径中最后一个 / 的位置索引 --- */
250
+ const scanLio = scanFpath.lastIndexOf('/');
251
+ /** --- 纯路径,不以 / 开头,以 / 结尾,若是根路径就是空字符串,例如 "www/pika/" --- */
252
+ const scanPat = scanFpath.slice(1, scanLio + 1);
253
+ /** --- 纯文件名,例如 "index.ts" 或 "pika.cga" --- */
254
+ const scanFname = scanFpath.slice(scanLio + 1);
255
+ if (scanFname.endsWith('.cga')) {
256
+ // --- 记录 .cga 锁定的同级目录(去掉 .cga 后缀的名字即为被锁定的目录名)---
257
+ cgaLockedDirs.add(scanPat + scanFname.slice(0, -4) + '/');
258
+ }
259
+ if (scanFname === 'kebab.json') {
260
+ // --- 记录含有 kebab.json 的目录(即 kebab 子项目根目录)---
261
+ kebabProjectDirs.add(scanPat);
262
+ }
263
+ }
264
+ /** --- kebab 子项目中仅允许部署的子文件夹名集合 --- */
265
+ const KEBAB_ALLOWED_DIRS = new Set(['ctr', 'data', 'stc', 'view', 'lib']);
241
266
  for (const path in ls) {
242
- /** --- 带 / 开头的 zip 中文件完整路径 --- */
267
+ /** --- 带 / 开头的 zip 中文件完整路径,例如 "/www/pika/ctr/api.js" --- */
243
268
  const fpath = path.startsWith('/') ? path : '/' + path;
244
- /** --- 最后一个 / 的所在位置 --- */
269
+ /** --- 纯路径中最后一个 / 的位置索引 --- */
245
270
  const lio = fpath.lastIndexOf('/');
246
- /** --- 纯路径,不以 / 开头,以 / 结尾,若是根路径就是空字符串 --- */
271
+ /** --- 纯路径,不以 / 开头,以 / 结尾,若是根路径就是空字符串,例如 "www/pika/ctr/" --- */
247
272
  const pat = fpath.slice(1, lio + 1);
248
- /** --- 纯文件名 --- */
273
+ /** --- 纯文件名,例如 "api.js" --- */
249
274
  const fname = fpath.slice(lio + 1);
250
275
  if ((pat === 'conf/' && fname === 'config.json') || fname === 'kebab.json') {
251
276
  // --- 特殊文件不能覆盖 ---
@@ -255,6 +280,49 @@ function createRpcListener() {
255
280
  // --- 测试或开发文件不覆盖 ---
256
281
  continue;
257
282
  }
283
+ // --- 规则 1:若同级目录存在 xxx.cga,则 xxx 目录下所有内容不部署 ---
284
+ if (pat) {
285
+ /** --- 是否被 .cga 文件锁定阻止 --- */
286
+ let cgaBlocked = false;
287
+ /** --- 累积路径,逐级拼接,用于逐级检查是否命中 cgaLockedDirs,例如 "a/" -> "a/b/" -> "a/b/c/" --- */
288
+ let accumulated = '';
289
+ for (const seg of pat.split('/').filter(Boolean)) {
290
+ accumulated += seg + '/';
291
+ if (cgaLockedDirs.has(accumulated)) {
292
+ cgaBlocked = true;
293
+ break;
294
+ }
295
+ }
296
+ if (cgaBlocked) {
297
+ continue;
298
+ }
299
+ }
300
+ // --- 规则 2:kebab 子项目目录中,仅允许部署 ctr/data/stc/view/lib 子文件夹内的内容 ---
301
+ // --- 快速跳过:zip 中没有 kebab.json 时整个规则无需执行 ---
302
+ if (kebabProjectDirs.size > 0) {
303
+ // --- 找最长(最精确)匹配的 kebab 项目目录,避免父子项目互相干扰 ---
304
+ /** --- 当前文件所属的 kebab 子项目目录,例如 pat 为 "www/pika/ctr/" 时值为 "www/pika/";无匹配则为 null --- */
305
+ let longestMatch = null;
306
+ for (const kdir of kebabProjectDirs) {
307
+ /** --- 当前 kdir 是否比已有的 longestMatch 更精确(路径更深)--- */
308
+ const isDeeper = longestMatch === null || kdir.length > longestMatch.length;
309
+ if (pat.startsWith(kdir) && isDeeper) {
310
+ longestMatch = kdir;
311
+ }
312
+ }
313
+ if (longestMatch !== null) {
314
+ // --- 取相对于 kebab 项目目录的路径,检查第一级子目录 ---
315
+ /** --- 相对路径,例如若 pat 为 "www/pika/ctr/" 且 longestMatch 为 "www/pika/",则 relPath 为 "ctr/" --- */
316
+ const relPath = pat.slice(longestMatch.length);
317
+ if (relPath) {
318
+ /** --- 路径的第一级子目录名,例如 "ctr" 或 "data",用于判断是否在允许列表中 --- */
319
+ const firstSeg = relPath.split('/')[0];
320
+ if (!KEBAB_ALLOWED_DIRS.has(firstSeg)) {
321
+ continue;
322
+ }
323
+ }
324
+ }
325
+ }
258
326
  // --- 看文件夹是否存在 ---
259
327
  if (pat && !await lFs.isDir(to + pat)) {
260
328
  if (rtn.post['strict'] === '1') {