@maiyunnet/kebab 9.29.3 → 9.29.5

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
@@ -1913,7 +1913,7 @@ index/variables/VER.md
1913
1913
 
1914
1914
  # Variable: VER
1915
1915
 
1916
- > `const` **VER**: `"9.29.3"` = `'9.29.3'`
1916
+ > `const` **VER**: `"9.29.5"` = `'9.29.5'`
1917
1917
 
1918
1918
  Defined in: [index.ts:8](https://github.com/maiyunnet/kebab/blob/master/index.ts#L8)
1919
1919
 
@@ -125227,7 +125227,7 @@ Defined in: [lib/sql.ts:76](https://github.com/maiyunnet/kebab/blob/master/lib/s
125227
125227
 
125228
125228
  > **append**(`sql`): `this`
125229
125229
 
125230
- Defined in: [lib/sql.ts:1127](https://github.com/maiyunnet/kebab/blob/master/lib/sql.ts#L1127)
125230
+ Defined in: [lib/sql.ts:1131](https://github.com/maiyunnet/kebab/blob/master/lib/sql.ts#L1131)
125231
125231
 
125232
125232
  在 sql 最后追加字符串
125233
125233
 
@@ -125247,7 +125247,7 @@ Defined in: [lib/sql.ts:1127](https://github.com/maiyunnet/kebab/blob/master/lib
125247
125247
 
125248
125248
  > **by**(`c`, `d?`): `this`
125249
125249
 
125250
- Defined in: [lib/sql.ts:814](https://github.com/maiyunnet/kebab/blob/master/lib/sql.ts#L814)
125250
+ Defined in: [lib/sql.ts:818](https://github.com/maiyunnet/kebab/blob/master/lib/sql.ts#L818)
125251
125251
 
125252
125252
  ORDER BY
125253
125253
 
@@ -125275,7 +125275,7 @@ ORDER BY
125275
125275
 
125276
125276
  > **copy**(`f?`, `opt?`): `Sql`
125277
125277
 
125278
- Defined in: [lib/sql.ts:933](https://github.com/maiyunnet/kebab/blob/master/lib/sql.ts#L933)
125278
+ Defined in: [lib/sql.ts:937](https://github.com/maiyunnet/kebab/blob/master/lib/sql.ts#L937)
125279
125279
 
125280
125280
  创建一个本对象的一个新的 sql 对象拷贝
125281
125281
 
@@ -125377,7 +125377,7 @@ Defined in: [lib/sql.ts:420](https://github.com/maiyunnet/kebab/blob/master/lib/
125377
125377
 
125378
125378
  > **field**(`str`, `pre?`, `suf?`): `string`
125379
125379
 
125380
- Defined in: [lib/sql.ts:1138](https://github.com/maiyunnet/kebab/blob/master/lib/sql.ts#L1138)
125380
+ Defined in: [lib/sql.ts:1142](https://github.com/maiyunnet/kebab/blob/master/lib/sql.ts#L1142)
125381
125381
 
125382
125382
  对字段进行包裹
125383
125383
 
@@ -125409,7 +125409,7 @@ MySQL 时为表前缀,PostgreSQL 时为 Schema 名,仅请在 field 表名时
125409
125409
 
125410
125410
  > **format**(`sql?`, `data?`): `string`
125411
125411
 
125412
- Defined in: [lib/sql.ts:1117](https://github.com/maiyunnet/kebab/blob/master/lib/sql.ts#L1117)
125412
+ Defined in: [lib/sql.ts:1121](https://github.com/maiyunnet/kebab/blob/master/lib/sql.ts#L1121)
125413
125413
 
125414
125414
  获取带 data 的 sql 语句
125415
125415
 
@@ -125473,7 +125473,7 @@ MySQL 时为表前缀,PostgreSQL 时为 Schema 名,仅在 join 非默认前
125473
125473
 
125474
125474
  > **getData**(): [`DbValue`](../../../index/type-aliases/DbValue.md)[]
125475
125475
 
125476
- Defined in: [lib/sql.ts:1101](https://github.com/maiyunnet/kebab/blob/master/lib/sql.ts#L1101)
125476
+ Defined in: [lib/sql.ts:1105](https://github.com/maiyunnet/kebab/blob/master/lib/sql.ts#L1105)
125477
125477
 
125478
125478
  获取全部 data
125479
125479
 
@@ -125487,7 +125487,7 @@ Defined in: [lib/sql.ts:1101](https://github.com/maiyunnet/kebab/blob/master/lib
125487
125487
 
125488
125488
  > **getPre**(): `string`
125489
125489
 
125490
- Defined in: [lib/sql.ts:1108](https://github.com/maiyunnet/kebab/blob/master/lib/sql.ts#L1108)
125490
+ Defined in: [lib/sql.ts:1112](https://github.com/maiyunnet/kebab/blob/master/lib/sql.ts#L1112)
125491
125491
 
125492
125492
  获取定义的 pre
125493
125493
 
@@ -125501,7 +125501,7 @@ Defined in: [lib/sql.ts:1108](https://github.com/maiyunnet/kebab/blob/master/lib
125501
125501
 
125502
125502
  > **getSql**(): `string`
125503
125503
 
125504
- Defined in: [lib/sql.ts:1081](https://github.com/maiyunnet/kebab/blob/master/lib/sql.ts#L1081)
125504
+ Defined in: [lib/sql.ts:1085](https://github.com/maiyunnet/kebab/blob/master/lib/sql.ts#L1085)
125505
125505
 
125506
125506
  获取 sql 语句
125507
125507
 
@@ -125515,7 +125515,7 @@ Defined in: [lib/sql.ts:1081](https://github.com/maiyunnet/kebab/blob/master/lib
125515
125515
 
125516
125516
  > **group**(`c`): `this`
125517
125517
 
125518
- Defined in: [lib/sql.ts:889](https://github.com/maiyunnet/kebab/blob/master/lib/sql.ts#L889)
125518
+ Defined in: [lib/sql.ts:893](https://github.com/maiyunnet/kebab/blob/master/lib/sql.ts#L893)
125519
125519
 
125520
125520
  GROUP BY
125521
125521
 
@@ -125756,7 +125756,7 @@ MySQL 时为表前缀,PostgreSQL 时为 Schema 名,仅在 join 非默认前
125756
125756
 
125757
125757
  > **limit**(`a`, `b?`): `this`
125758
125758
 
125759
- Defined in: [lib/sql.ts:909](https://github.com/maiyunnet/kebab/blob/master/lib/sql.ts#L909)
125759
+ Defined in: [lib/sql.ts:913](https://github.com/maiyunnet/kebab/blob/master/lib/sql.ts#L913)
125760
125760
 
125761
125761
  LIMIT(limit、offset, limit)
125762
125762
 
@@ -125784,7 +125784,7 @@ LIMIT(limit、offset, limit)
125784
125784
 
125785
125785
  > **lock**(): `this`
125786
125786
 
125787
- Defined in: [lib/sql.ts:924](https://github.com/maiyunnet/kebab/blob/master/lib/sql.ts#L924)
125787
+ Defined in: [lib/sql.ts:928](https://github.com/maiyunnet/kebab/blob/master/lib/sql.ts#L928)
125788
125788
 
125789
125789
  追加消极锁,通常不建议使用
125790
125790
 
@@ -125838,7 +125838,7 @@ MySQL 时为表前缀,PostgreSQL 时为 Schema 名,仅在 join 非默认前
125838
125838
 
125839
125839
  > **seek**(`c`, `values?`, `d?`): `this`
125840
125840
 
125841
- Defined in: [lib/sql.ts:842](https://github.com/maiyunnet/kebab/blob/master/lib/sql.ts#L842)
125841
+ Defined in: [lib/sql.ts:846](https://github.com/maiyunnet/kebab/blob/master/lib/sql.ts#L846)
125842
125842
 
125843
125843
  按非空、同向排序字段定位游标并设置排序;字段组合须唯一且有匹配索引
125844
125844
  使用行比较,让 PostgreSQL 可以从复合索引边界开始扫描
@@ -126080,13 +126080,14 @@ Defined in: [lib/sql.ts:154](https://github.com/maiyunnet/kebab/blob/master/lib/
126080
126080
 
126081
126081
  > **where**(`s`): `this`
126082
126082
 
126083
- Defined in: [lib/sql.ts:573](https://github.com/maiyunnet/kebab/blob/master/lib/sql.ts#L573)
126083
+ Defined in: [lib/sql.ts:574](https://github.com/maiyunnet/kebab/blob/master/lib/sql.ts#L574)
126084
126084
 
126085
126085
  筛选器
126086
126086
  等值条件:'city': 'bj';字符串、数字、布尔值、bigint、Date 和 Buffer 均作为单个参数
126087
- null 生成 IS NULL,数组生成 IN 条件
126087
+ null 生成 IS NULL,数组和 Set 生成 IN 条件
126088
126088
  运算符条件:['type', '>', '1']
126089
- 集合条件:['type', 'in', ['1', '2']] 或 'type': ['1', '2']
126089
+ 集合条件:['type', 'in', ['1', '2']] 或 'type': new Set(['1', '2'])
126090
+ IN 和 NOT IN 均接受数组和 Set。空集合的 IN 不匹配任何行,NOT IN 匹配所有行。
126090
126091
  逻辑分组:'$or': [{'city': 'bj'}, {'city': 'sh'}, [['age', '>', '10']]]
126091
126092
  字段比较:'city_in': column('city_out')
126092
126093
  原始条件:['JSON_CONTAINS(`uid`, ?)', ['hello']]
@@ -126223,7 +126224,7 @@ lib/sql/functions/aoMix.md
126223
126224
 
126224
126225
  > **aoMix**(`arr`): `Record`\<`string`, `string` \| `number` \| [`Json`](../../../index/type-aliases/Json.md)\>
126225
126226
 
126226
- Defined in: [lib/sql.ts:1487](https://github.com/maiyunnet/kebab/blob/master/lib/sql.ts#L1487)
126227
+ Defined in: [lib/sql.ts:1491](https://github.com/maiyunnet/kebab/blob/master/lib/sql.ts#L1491)
126227
126228
 
126228
126229
  将数组兑换为组合的对象(Array/Object mix)
126229
126230
 
@@ -126252,7 +126253,7 @@ lib/sql/functions/column.md
126252
126253
 
126253
126254
  > **column**(`field`): `object`
126254
126255
 
126255
- Defined in: [lib/sql.ts:1508](https://github.com/maiyunnet/kebab/blob/master/lib/sql.ts#L1508)
126256
+ Defined in: [lib/sql.ts:1512](https://github.com/maiyunnet/kebab/blob/master/lib/sql.ts#L1512)
126256
126257
 
126257
126258
  创建字段对象
126258
126259
 
@@ -126291,7 +126292,7 @@ lib/sql/functions/format.md
126291
126292
 
126292
126293
  > **format**(`sql`, `data`, `service?`): `string`
126293
126294
 
126294
- Defined in: [lib/sql.ts:1448](https://github.com/maiyunnet/kebab/blob/master/lib/sql.ts#L1448)
126295
+ Defined in: [lib/sql.ts:1452](https://github.com/maiyunnet/kebab/blob/master/lib/sql.ts#L1452)
126295
126296
 
126296
126297
  返回代入后的完整 SQL 字符串,这并不安全不能直接执行,只是用来调试打印 sql 语句
126297
126298
 
@@ -126332,7 +126333,7 @@ lib/sql/functions/get.md
126332
126333
 
126333
126334
  > **get**(`opt`): [`Sql`](../classes/Sql.md)
126334
126335
 
126335
- Defined in: [lib/sql.ts:1420](https://github.com/maiyunnet/kebab/blob/master/lib/sql.ts#L1420)
126336
+ Defined in: [lib/sql.ts:1424](https://github.com/maiyunnet/kebab/blob/master/lib/sql.ts#L1424)
126336
126337
 
126337
126338
  创建 sql 对象
126338
126339
 
@@ -126385,7 +126386,7 @@ lib/sql/functions/json.md
126385
126386
 
126386
126387
  > **json**\<`T`\>(`obj`): `T`
126387
126388
 
126388
- Defined in: [lib/sql.ts:1547](https://github.com/maiyunnet/kebab/blob/master/lib/sql.ts#L1547)
126389
+ Defined in: [lib/sql.ts:1551](https://github.com/maiyunnet/kebab/blob/master/lib/sql.ts#L1551)
126389
126390
 
126390
126391
  标记需要写入 JSON/jsonb 字段的值;实际序列化延迟到数据库边界
126391
126392
 
@@ -126422,7 +126423,7 @@ lib/sql/functions/value.md
126422
126423
 
126423
126424
  > **value**(`val`): `object`
126424
126425
 
126425
- Defined in: [lib/sql.ts:1527](https://github.com/maiyunnet/kebab/blob/master/lib/sql.ts#L1527)
126426
+ Defined in: [lib/sql.ts:1531](https://github.com/maiyunnet/kebab/blob/master/lib/sql.ts#L1531)
126426
126427
 
126427
126428
  创建字面量值对象,用于 where 条件中 v[0] 需要是值而非字段名的场景
126428
126429
  例:[value('hello'), 'IN', column('tags')]
@@ -132160,7 +132161,7 @@ lib/ws/classes/Socket.md
132160
132161
 
132161
132162
  # Class: Socket
132162
132163
 
132163
- Defined in: [lib/ws.ts:166](https://github.com/maiyunnet/kebab/blob/master/lib/ws.ts#L166)
132164
+ Defined in: [lib/ws.ts:167](https://github.com/maiyunnet/kebab/blob/master/lib/ws.ts#L167)
132164
132165
 
132165
132166
  ## Constructors
132166
132167
 
@@ -132168,7 +132169,7 @@ Defined in: [lib/ws.ts:166](https://github.com/maiyunnet/kebab/blob/master/lib/w
132168
132169
 
132169
132170
  > **new Socket**(`request?`, `socket?`, `head?`, `options?`): `Socket`
132170
132171
 
132171
- Defined in: [lib/ws.ts:195](https://github.com/maiyunnet/kebab/blob/master/lib/ws.ts#L195)
132172
+ Defined in: [lib/ws.ts:196](https://github.com/maiyunnet/kebab/blob/master/lib/ws.ts#L196)
132172
132173
 
132173
132174
  #### Parameters
132174
132175
 
@@ -132206,7 +132207,7 @@ Defined in: [lib/ws.ts:195](https://github.com/maiyunnet/kebab/blob/master/lib/w
132206
132207
 
132207
132208
  > **get** **ended**(): `boolean`
132208
132209
 
132209
- Defined in: [lib/ws.ts:667](https://github.com/maiyunnet/kebab/blob/master/lib/ws.ts#L667)
132210
+ Defined in: [lib/ws.ts:669](https://github.com/maiyunnet/kebab/blob/master/lib/ws.ts#L669)
132210
132211
 
132211
132212
  当前是否已经结束读取,并且无法继续读取
132212
132213
 
@@ -132222,7 +132223,7 @@ Defined in: [lib/ws.ts:667](https://github.com/maiyunnet/kebab/blob/master/lib/w
132222
132223
 
132223
132224
  > **get** **finished**(): `boolean`
132224
132225
 
132225
- Defined in: [lib/ws.ts:672](https://github.com/maiyunnet/kebab/blob/master/lib/ws.ts#L672)
132226
+ Defined in: [lib/ws.ts:674](https://github.com/maiyunnet/kebab/blob/master/lib/ws.ts#L674)
132226
132227
 
132227
132228
  当前是否已经结束写入,并且无法继续写入
132228
132229
 
@@ -132238,7 +132239,7 @@ Defined in: [lib/ws.ts:672](https://github.com/maiyunnet/kebab/blob/master/lib/w
132238
132239
 
132239
132240
  > **get** **isServer**(): `boolean`
132240
132241
 
132241
- Defined in: [lib/ws.ts:679](https://github.com/maiyunnet/kebab/blob/master/lib/ws.ts#L679)
132242
+ Defined in: [lib/ws.ts:681](https://github.com/maiyunnet/kebab/blob/master/lib/ws.ts#L681)
132242
132243
 
132243
132244
  当前连接是不是服务器连接
132244
132245
 
@@ -132254,7 +132255,7 @@ Defined in: [lib/ws.ts:679](https://github.com/maiyunnet/kebab/blob/master/lib/w
132254
132255
 
132255
132256
  > **get** **writable**(): `boolean`
132256
132257
 
132257
- Defined in: [lib/ws.ts:662](https://github.com/maiyunnet/kebab/blob/master/lib/ws.ts#L662)
132258
+ Defined in: [lib/ws.ts:664](https://github.com/maiyunnet/kebab/blob/master/lib/ws.ts#L664)
132258
132259
 
132259
132260
  当前是否是可写状态
132260
132261
 
@@ -132268,7 +132269,7 @@ Defined in: [lib/ws.ts:662](https://github.com/maiyunnet/kebab/blob/master/lib/w
132268
132269
 
132269
132270
  > **connect**(`u`, `opt?`): `Promise`\<`Socket` \| `null`\>
132270
132271
 
132271
- Defined in: [lib/ws.ts:228](https://github.com/maiyunnet/kebab/blob/master/lib/ws.ts#L228)
132272
+ Defined in: [lib/ws.ts:229](https://github.com/maiyunnet/kebab/blob/master/lib/ws.ts#L229)
132272
132273
 
132273
132274
  以客户端形式发起链接
132274
132275
 
@@ -132296,7 +132297,7 @@ Defined in: [lib/ws.ts:228](https://github.com/maiyunnet/kebab/blob/master/lib/w
132296
132297
 
132297
132298
  > **destroy**(): `void`
132298
132299
 
132299
- Defined in: [lib/ws.ts:579](https://github.com/maiyunnet/kebab/blob/master/lib/ws.ts#L579)
132300
+ Defined in: [lib/ws.ts:581](https://github.com/maiyunnet/kebab/blob/master/lib/ws.ts#L581)
132300
132301
 
132301
132302
  #### Returns
132302
132303
 
@@ -132308,7 +132309,7 @@ Defined in: [lib/ws.ts:579](https://github.com/maiyunnet/kebab/blob/master/lib/w
132308
132309
 
132309
132310
  > **end**(`code?`, `reason?`): `void`
132310
132311
 
132311
- Defined in: [lib/ws.ts:571](https://github.com/maiyunnet/kebab/blob/master/lib/ws.ts#L571)
132312
+ Defined in: [lib/ws.ts:573](https://github.com/maiyunnet/kebab/blob/master/lib/ws.ts#L573)
132312
132313
 
132313
132314
  正常结束 WebSocket 连接
132314
132315
 
@@ -132336,7 +132337,7 @@ WebSocket 关闭码
132336
132337
 
132337
132338
  > **off**(`event`): `this`
132338
132339
 
132339
- Defined in: [lib/ws.ts:561](https://github.com/maiyunnet/kebab/blob/master/lib/ws.ts#L561)
132340
+ Defined in: [lib/ws.ts:563](https://github.com/maiyunnet/kebab/blob/master/lib/ws.ts#L563)
132340
132341
 
132341
132342
  取消监听
132342
132343
 
@@ -132358,7 +132359,7 @@ Defined in: [lib/ws.ts:561](https://github.com/maiyunnet/kebab/blob/master/lib/w
132358
132359
 
132359
132360
  > **on**(`event`, `cb`): `this`
132360
132361
 
132361
- Defined in: [lib/ws.ts:515](https://github.com/maiyunnet/kebab/blob/master/lib/ws.ts#L515)
132362
+ Defined in: [lib/ws.ts:517](https://github.com/maiyunnet/kebab/blob/master/lib/ws.ts#L517)
132362
132363
 
132363
132364
  绑定监听
132364
132365
 
@@ -132380,7 +132381,7 @@ Defined in: [lib/ws.ts:515](https://github.com/maiyunnet/kebab/blob/master/lib/w
132380
132381
 
132381
132382
  > **on**(`event`, `cb`): `this`
132382
132383
 
132383
- Defined in: [lib/ws.ts:519](https://github.com/maiyunnet/kebab/blob/master/lib/ws.ts#L519)
132384
+ Defined in: [lib/ws.ts:521](https://github.com/maiyunnet/kebab/blob/master/lib/ws.ts#L521)
132384
132385
 
132385
132386
  绑定监听
132386
132387
 
@@ -132402,7 +132403,7 @@ Defined in: [lib/ws.ts:519](https://github.com/maiyunnet/kebab/blob/master/lib/w
132402
132403
 
132403
132404
  > **on**(`event`, `cb`): `this`
132404
132405
 
132405
- Defined in: [lib/ws.ts:520](https://github.com/maiyunnet/kebab/blob/master/lib/ws.ts#L520)
132406
+ Defined in: [lib/ws.ts:522](https://github.com/maiyunnet/kebab/blob/master/lib/ws.ts#L522)
132406
132407
 
132407
132408
  绑定监听
132408
132409
 
@@ -132424,7 +132425,7 @@ Defined in: [lib/ws.ts:520](https://github.com/maiyunnet/kebab/blob/master/lib/w
132424
132425
 
132425
132426
  > **on**(`event`, `cb`): `this`
132426
132427
 
132427
- Defined in: [lib/ws.ts:521](https://github.com/maiyunnet/kebab/blob/master/lib/ws.ts#L521)
132428
+ Defined in: [lib/ws.ts:523](https://github.com/maiyunnet/kebab/blob/master/lib/ws.ts#L523)
132428
132429
 
132429
132430
  绑定监听
132430
132431
 
@@ -132448,7 +132449,7 @@ Defined in: [lib/ws.ts:521](https://github.com/maiyunnet/kebab/blob/master/lib/w
132448
132449
 
132449
132450
  > **pause**(): `void`
132450
132451
 
132451
- Defined in: [lib/ws.ts:585](https://github.com/maiyunnet/kebab/blob/master/lib/ws.ts#L585)
132452
+ Defined in: [lib/ws.ts:587](https://github.com/maiyunnet/kebab/blob/master/lib/ws.ts#L587)
132452
132453
 
132453
132454
  暂停向消息监听器派发数据,并暂停底层 TCP 读取
132454
132455
 
@@ -132462,7 +132463,7 @@ Defined in: [lib/ws.ts:585](https://github.com/maiyunnet/kebab/blob/master/lib/w
132462
132463
 
132463
132464
  > **ping**(`data?`): `boolean`
132464
132465
 
132465
- Defined in: [lib/ws.ts:684](https://github.com/maiyunnet/kebab/blob/master/lib/ws.ts#L684)
132466
+ Defined in: [lib/ws.ts:686](https://github.com/maiyunnet/kebab/blob/master/lib/ws.ts#L686)
132466
132467
 
132467
132468
  发送 ping
132468
132469
 
@@ -132482,7 +132483,7 @@ Defined in: [lib/ws.ts:684](https://github.com/maiyunnet/kebab/blob/master/lib/w
132482
132483
 
132483
132484
  > **pong**(`data?`): `boolean`
132484
132485
 
132485
- Defined in: [lib/ws.ts:689](https://github.com/maiyunnet/kebab/blob/master/lib/ws.ts#L689)
132486
+ Defined in: [lib/ws.ts:691](https://github.com/maiyunnet/kebab/blob/master/lib/ws.ts#L691)
132486
132487
 
132487
132488
  发送 ping
132488
132489
 
@@ -132502,7 +132503,7 @@ Defined in: [lib/ws.ts:689](https://github.com/maiyunnet/kebab/blob/master/lib/w
132502
132503
 
132503
132504
  > **resume**(): `void`
132504
132505
 
132505
- Defined in: [lib/ws.ts:591](https://github.com/maiyunnet/kebab/blob/master/lib/ws.ts#L591)
132506
+ Defined in: [lib/ws.ts:593](https://github.com/maiyunnet/kebab/blob/master/lib/ws.ts#L593)
132506
132507
 
132507
132508
  恢复派发缓存消息,并恢复底层 TCP 读取
132508
132509
 
@@ -132516,7 +132517,7 @@ Defined in: [lib/ws.ts:591](https://github.com/maiyunnet/kebab/blob/master/lib/w
132516
132517
 
132517
132518
  > **writeBinary**(`data`): `boolean`
132518
132519
 
132519
- Defined in: [lib/ws.ts:610](https://github.com/maiyunnet/kebab/blob/master/lib/ws.ts#L610)
132520
+ Defined in: [lib/ws.ts:612](https://github.com/maiyunnet/kebab/blob/master/lib/ws.ts#L612)
132520
132521
 
132521
132522
  发送二进制
132522
132523
 
@@ -132536,7 +132537,7 @@ Defined in: [lib/ws.ts:610](https://github.com/maiyunnet/kebab/blob/master/lib/w
132536
132537
 
132537
132538
  > **writeResult**(`data`): `boolean`
132538
132539
 
132539
- Defined in: [lib/ws.ts:605](https://github.com/maiyunnet/kebab/blob/master/lib/ws.ts#L605)
132540
+ Defined in: [lib/ws.ts:607](https://github.com/maiyunnet/kebab/blob/master/lib/ws.ts#L607)
132540
132541
 
132541
132542
  发送结果对象字符串
132542
132543
 
@@ -132556,7 +132557,7 @@ Defined in: [lib/ws.ts:605](https://github.com/maiyunnet/kebab/blob/master/lib/w
132556
132557
 
132557
132558
  > **writeText**(`data`): `boolean`
132558
132559
 
132559
- Defined in: [lib/ws.ts:600](https://github.com/maiyunnet/kebab/blob/master/lib/ws.ts#L600)
132560
+ Defined in: [lib/ws.ts:602](https://github.com/maiyunnet/kebab/blob/master/lib/ws.ts#L602)
132560
132561
 
132561
132562
  发送文本
132562
132563
 
@@ -132685,7 +132686,7 @@ lib/ws/functions/connect.md
132685
132686
 
132686
132687
  > **connect**(`u`, `opt?`): `Promise`\<[`Socket`](../classes/Socket.md) \| `null`\>
132687
132688
 
132688
- Defined in: [lib/ws.ts:732](https://github.com/maiyunnet/kebab/blob/master/lib/ws.ts#L732)
132689
+ Defined in: [lib/ws.ts:734](https://github.com/maiyunnet/kebab/blob/master/lib/ws.ts#L734)
132689
132690
 
132690
132691
  创建一个 ws 客户端发起 ws 请求
132691
132692
 
@@ -132720,7 +132721,7 @@ lib/ws/functions/createServer.md
132720
132721
 
132721
132722
  > **createServer**(`request`, `socket`, `head?`, `options?`): [`Socket`](../classes/Socket.md)
132722
132723
 
132723
- Defined in: [lib/ws.ts:742](https://github.com/maiyunnet/kebab/blob/master/lib/ws.ts#L742)
132724
+ Defined in: [lib/ws.ts:744](https://github.com/maiyunnet/kebab/blob/master/lib/ws.ts#L744)
132724
132725
 
132725
132726
  创建一个 ws 服务器接收处理器
132726
132727
 
@@ -132769,7 +132770,7 @@ lib/ws/functions/mproxy.md
132769
132770
 
132770
132771
  > **mproxy**(`ctr`, `auth`, `opt?`): `Promise`\<`number`\>
132771
132772
 
132772
- Defined in: [lib/ws.ts:968](https://github.com/maiyunnet/kebab/blob/master/lib/ws.ts#L968)
132773
+ Defined in: [lib/ws.ts:970](https://github.com/maiyunnet/kebab/blob/master/lib/ws.ts#L970)
132773
132774
 
132774
132775
  正向 mproxy 代理,读取 get 的 url 为实际请求地址
132775
132776
  get: url, auth
@@ -132811,7 +132812,7 @@ lib/ws/functions/rproxy.md
132811
132812
 
132812
132813
  > **rproxy**(`ctr`, `url`, `opt?`): `Promise`\<`boolean`\>
132813
132814
 
132814
- Defined in: [lib/ws.ts:1005](https://github.com/maiyunnet/kebab/blob/master/lib/ws.ts#L1005)
132815
+ Defined in: [lib/ws.ts:1007](https://github.com/maiyunnet/kebab/blob/master/lib/ws.ts#L1007)
132815
132816
 
132816
132817
  反向代理,将本 socket 连接反代到其他网址,在 ws 的 onLoad 事件中使用
132817
132818
 
@@ -132852,7 +132853,7 @@ lib/ws/functions/rsocket.md
132852
132853
 
132853
132854
  > **rsocket**(`ctr`, `host`, `port`): `Promise`\<`boolean`\>
132854
132855
 
132855
- Defined in: [lib/ws.ts:1051](https://github.com/maiyunnet/kebab/blob/master/lib/ws.ts#L1051)
132856
+ Defined in: [lib/ws.ts:1053](https://github.com/maiyunnet/kebab/blob/master/lib/ws.ts#L1053)
132856
132857
 
132857
132858
  反向代理,将本 websocket 连接反代到其他真正的 socket,在 ws 的 onLoad 事件中使用
132858
132859
 
package/index.d.ts CHANGED
@@ -4,7 +4,7 @@
4
4
  * --- 本文件用来定义每个目录实体地址的常量 ---
5
5
  */
6
6
  /** --- 当前系统版本号 --- */
7
- export declare const VER = "9.29.3";
7
+ export declare const VER = "9.29.5";
8
8
  /** --- 框架根目录,以 / 结尾 --- */
9
9
  export declare const ROOT_PATH: string;
10
10
  /** --- 框架的 LIB,以 / 结尾 --- */
package/index.js CHANGED
@@ -4,7 +4,7 @@
4
4
  * --- 本文件用来定义每个目录实体地址的常量 ---
5
5
  */
6
6
  /** --- 当前系统版本号 --- */
7
- export const VER = '9.29.3';
7
+ export const VER = '9.29.5';
8
8
  // --- 服务端用的路径 ---
9
9
  const imu = decodeURIComponent(import.meta.url).replace('file://', '').replace(/^\/(\w:)/, '$1');
10
10
  /** --- /xxx/xxx --- */
package/lib/sql.d.ts CHANGED
@@ -195,9 +195,10 @@ export declare class Sql {
195
195
  /**
196
196
  * --- 筛选器 ---
197
197
  * --- 等值条件:'city': 'bj';字符串、数字、布尔值、bigint、Date 和 Buffer 均作为单个参数 ---
198
- * --- null 生成 IS NULL,数组生成 IN 条件 ---
198
+ * --- null 生成 IS NULL,数组和 Set 生成 IN 条件 ---
199
199
  * --- 运算符条件:['type', '>', '1'] ---
200
- * --- 集合条件:['type', 'in', ['1', '2']] 或 'type': ['1', '2'] ---
200
+ * --- 集合条件:['type', 'in', ['1', '2']] 或 'type': new Set(['1', '2']) ---
201
+ * --- IN 和 NOT IN 均接受数组和 Set。空集合的 IN 不匹配任何行,NOT IN 匹配所有行。 ---
201
202
  * --- 逻辑分组:'$or': [{'city': 'bj'}, {'city': 'sh'}, [['age', '>', '10']]] ---
202
203
  * --- 字段比较:'city_in': column('city_out') ---
203
204
  * --- 原始条件:['JSON_CONTAINS(`uid`, ?)', ['hello']] ---
@@ -206,6 +207,15 @@ export declare class Sql {
206
207
  */
207
208
  where(s: string | kebab.Json): this;
208
209
  private _whereSub;
210
+ /**
211
+ * --- 生成集合比较条件,按迭代顺序追加参数 ---
212
+ * @param field 参与比较的字段
213
+ * @param operator 大写 SQL 运算符
214
+ * @param values 集合成员,每个成员是单值或一行组合值
215
+ * @param data 接收绑定参数的数组
216
+ * @returns 集合比较 SQL 片段
217
+ */
218
+ private _whereList;
209
219
  /**
210
220
  * --- ORDER BY ---
211
221
  * @param c 字段字符串或数组
package/lib/sql.js CHANGED
@@ -505,9 +505,10 @@ export class Sql {
505
505
  /**
506
506
  * --- 筛选器 ---
507
507
  * --- 等值条件:'city': 'bj';字符串、数字、布尔值、bigint、Date 和 Buffer 均作为单个参数 ---
508
- * --- null 生成 IS NULL,数组生成 IN 条件 ---
508
+ * --- null 生成 IS NULL,数组和 Set 生成 IN 条件 ---
509
509
  * --- 运算符条件:['type', '>', '1'] ---
510
- * --- 集合条件:['type', 'in', ['1', '2']] 或 'type': ['1', '2'] ---
510
+ * --- 集合条件:['type', 'in', ['1', '2']] 或 'type': new Set(['1', '2']) ---
511
+ * --- IN 和 NOT IN 均接受数组和 Set。空集合的 IN 不匹配任何行,NOT IN 匹配所有行。 ---
511
512
  * --- 逻辑分组:'$or': [{'city': 'bj'}, {'city': 'sh'}, [['age', '>', '10']]] ---
512
513
  * --- 字段比较:'city_in': column('city_out') ---
513
514
  * --- 原始条件:['JSON_CONTAINS(`uid`, ?)', ['hello']] ---
@@ -634,24 +635,8 @@ export class Sql {
634
635
  }
635
636
  sql += this.field(v[0]) + ' ' + opera + ' NULL AND ';
636
637
  }
637
- else if (Array.isArray(v[2])) {
638
- // --- IN 等集合比较 ---
639
- sql += this.field(v[0]) + ' ' + v[1].toUpperCase() + ' (';
640
- for (const v1 of v[2]) {
641
- if (Array.isArray(v1)) {
642
- sql += '(';
643
- for (const v2 of v1) {
644
- sql += this._placeholder() + ', ';
645
- data.push(v2);
646
- }
647
- sql = sql.slice(0, -2) + '), ';
648
- }
649
- else {
650
- sql += this._placeholder() + ', ';
651
- data.push(v1);
652
- }
653
- }
654
- sql = sql.slice(0, -2) + ') AND ';
638
+ else if (Array.isArray(v[2]) || (v[2] instanceof Set && typeof v[1] === 'string' && /^(?:NOT )?IN$/i.test(v[1]))) {
639
+ sql += this._whereList(v[0], v[1].toUpperCase(), v[2], data) + ' AND ';
655
640
  }
656
641
  else {
657
642
  // --- 普通运算符或字段比较 ---
@@ -711,29 +696,8 @@ export class Sql {
711
696
  // --- 字段相等 ---
712
697
  sql += this.field(k) + ' = ' + this.field(v.value) + ' AND ';
713
698
  }
714
- else if (Array.isArray(v)) {
715
- // --- IN 查询,如 'type': ['1', '2'] ---
716
- if (v.length > 0) {
717
- sql += this.field(k) + ' IN (';
718
- for (const v1 of v) {
719
- if (Array.isArray(v1)) {
720
- sql += '(';
721
- for (const v2 of v1) {
722
- sql += this._placeholder() + ', ';
723
- data.push(v2);
724
- }
725
- sql = sql.slice(0, -2) + '), ';
726
- }
727
- else {
728
- sql += this._placeholder() + ', ';
729
- data.push(v1);
730
- }
731
- }
732
- sql = sql.slice(0, -2) + ') AND ';
733
- }
734
- else {
735
- sql += this.field(k) + ' IN (NULL) AND ';
736
- }
699
+ else if (Array.isArray(v) || v instanceof Set) {
700
+ sql += this._whereList(k, 'IN', v, data) + ' AND ';
737
701
  }
738
702
  else {
739
703
  // --- 普通值使用等号比较,原值交给数据库驱动处理 ---
@@ -748,6 +712,40 @@ export class Sql {
748
712
  }
749
713
  return sql.slice(0, -5);
750
714
  }
715
+ /**
716
+ * --- 生成集合比较条件,按迭代顺序追加参数 ---
717
+ * @param field 参与比较的字段
718
+ * @param operator 大写 SQL 运算符
719
+ * @param values 集合成员,每个成员是单值或一行组合值
720
+ * @param data 接收绑定参数的数组
721
+ * @returns 集合比较 SQL 片段
722
+ */
723
+ _whereList(field, operator, values, data) {
724
+ if (Array.isArray(values) ? values.length === 0 : values.size === 0) {
725
+ if (operator === 'IN') {
726
+ return `${this.field(field)} IN (NULL)`;
727
+ }
728
+ if (operator === 'NOT IN') {
729
+ return '1 = 1';
730
+ }
731
+ }
732
+ let sql = `${this.field(field)} ${operator} (`;
733
+ for (const value of values) {
734
+ if (Array.isArray(value)) {
735
+ sql += '(';
736
+ for (const item of value) {
737
+ sql += this._placeholder() + ', ';
738
+ data.push(item);
739
+ }
740
+ sql = sql.slice(0, -2) + '), ';
741
+ }
742
+ else {
743
+ sql += this._placeholder() + ', ';
744
+ data.push(value);
745
+ }
746
+ }
747
+ return sql.slice(0, -2) + ')';
748
+ }
751
749
  /**
752
750
  * --- ORDER BY ---
753
751
  * @param c 字段字符串或数组
@@ -31,7 +31,7 @@ export declare class Response {
31
31
  /**
32
32
  * --- 获取响应读取流对象 ---
33
33
  */
34
- getStream(): (import("undici/types/readable").default & undici.Dispatcher.BodyMixin) | zlib.Gunzip | zlib.Inflate | zlib.BrotliDecompress | null;
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/ws.js CHANGED
@@ -34,6 +34,7 @@ const wsServer = new WebSocketServer({
34
34
  'maxPayload': MAX_MESSAGE_BYTES,
35
35
  'noServer': true,
36
36
  'perMessageDeflate': false,
37
+ 'skipUTF8Validation': true,
37
38
  });
38
39
  wsServer.on('headers', (headers, request) => {
39
40
  const extra = upgradeHeaders.get(request);
@@ -150,6 +151,7 @@ export class Socket {
150
151
  'maxPayload': MAX_MESSAGE_BYTES,
151
152
  'perMessageDeflate': false,
152
153
  'servername': connectUrl.protocol === 'wss:' ? host : undefined,
154
+ 'skipUTF8Validation': true,
153
155
  };
154
156
  const cli = new WebSocket(connectUrl, clientOptions);
155
157
  this._ws = cli;
@@ -656,7 +658,7 @@ function bindPipe(s1, s2, closeReason) {
656
658
  s1.on('message', (msg) => {
657
659
  switch (msg.opcode) {
658
660
  case EOpcode.TEXT: {
659
- if (!s2.writeText(msg.data.toString())) {
661
+ if (!s2.writeText(msg.data)) {
660
662
  s1.pause();
661
663
  }
662
664
  break;
@@ -708,7 +710,7 @@ function bindPipe(s1, s2, closeReason) {
708
710
  s2.on('message', (msg) => {
709
711
  switch (msg.opcode) {
710
712
  case EOpcode.TEXT: {
711
- if (!s1.writeText(msg.data.toString())) {
713
+ if (!s1.writeText(msg.data)) {
712
714
  s2.pause();
713
715
  }
714
716
  break;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@maiyunnet/kebab",
3
- "version": "9.29.3",
3
+ "version": "9.29.5",
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": [