@maiyunnet/kebab 9.0.0 → 9.0.2

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
@@ -1355,7 +1355,7 @@ index/variables/VER.md
1355
1355
 
1356
1356
  # Variable: VER
1357
1357
 
1358
- > `const` **VER**: `"9.0.0"` = `'9.0.0'`
1358
+ > `const` **VER**: `"9.0.2"` = `'9.0.2'`
1359
1359
 
1360
1360
  Defined in: [index.ts:10](https://github.com/maiyunnet/kebab/blob/master/index.ts#L10)
1361
1361
 
@@ -1402,7 +1402,7 @@ lib/ai/classes/Ai.md
1402
1402
 
1403
1403
  # Class: Ai
1404
1404
 
1405
- Defined in: [lib/ai.ts:58](https://github.com/maiyunnet/kebab/blob/master/lib/ai.ts#L58)
1405
+ Defined in: [lib/ai.ts:60](https://github.com/maiyunnet/kebab/blob/master/lib/ai.ts#L60)
1406
1406
 
1407
1407
  ## Constructors
1408
1408
 
@@ -1410,7 +1410,7 @@ Defined in: [lib/ai.ts:58](https://github.com/maiyunnet/kebab/blob/master/lib/ai
1410
1410
 
1411
1411
  > **new Ai**(`ctrEtc`, `opt`): `Ai`
1412
1412
 
1413
- Defined in: [lib/ai.ts:71](https://github.com/maiyunnet/kebab/blob/master/lib/ai.ts#L71)
1413
+ Defined in: [lib/ai.ts:73](https://github.com/maiyunnet/kebab/blob/master/lib/ai.ts#L73)
1414
1414
 
1415
1415
  #### Parameters
1416
1416
 
@@ -1432,7 +1432,7 @@ Defined in: [lib/ai.ts:71](https://github.com/maiyunnet/kebab/blob/master/lib/ai
1432
1432
 
1433
1433
  > `readonly` **link**: `OpenAI`
1434
1434
 
1435
- Defined in: [lib/ai.ts:61](https://github.com/maiyunnet/kebab/blob/master/lib/ai.ts#L61)
1435
+ Defined in: [lib/ai.ts:63](https://github.com/maiyunnet/kebab/blob/master/lib/ai.ts#L63)
1436
1436
 
1437
1437
  openai 原生对象
1438
1438
 
@@ -1444,7 +1444,7 @@ openai 原生对象
1444
1444
 
1445
1445
  > **get** **service**(): [`ESERVICE`](../enumerations/ESERVICE.md)
1446
1446
 
1447
- Defined in: [lib/ai.ts:143](https://github.com/maiyunnet/kebab/blob/master/lib/ai.ts#L143)
1447
+ Defined in: [lib/ai.ts:149](https://github.com/maiyunnet/kebab/blob/master/lib/ai.ts#L149)
1448
1448
 
1449
1449
  获取当前服务商
1450
1450
 
@@ -1462,7 +1462,7 @@ Defined in: [lib/ai.ts:143](https://github.com/maiyunnet/kebab/blob/master/lib/a
1462
1462
 
1463
1463
  > **chat**(`body`): `Promise`\<`false` \| `APIPromise`\<`ChatCompletion`\>\>
1464
1464
 
1465
- Defined in: [lib/ai.ts:148](https://github.com/maiyunnet/kebab/blob/master/lib/ai.ts#L148)
1465
+ Defined in: [lib/ai.ts:154](https://github.com/maiyunnet/kebab/blob/master/lib/ai.ts#L154)
1466
1466
 
1467
1467
  创建非流式对话
1468
1468
 
@@ -1480,7 +1480,7 @@ Defined in: [lib/ai.ts:148](https://github.com/maiyunnet/kebab/blob/master/lib/a
1480
1480
 
1481
1481
  > **chat**(`body`): `Promise`\<`false` \| `APIPromise`\<`Stream`\<`ChatCompletionChunk`\>\>\>
1482
1482
 
1483
- Defined in: [lib/ai.ts:152](https://github.com/maiyunnet/kebab/blob/master/lib/ai.ts#L152)
1483
+ Defined in: [lib/ai.ts:158](https://github.com/maiyunnet/kebab/blob/master/lib/ai.ts#L158)
1484
1484
 
1485
1485
  创建流式对话
1486
1486
 
@@ -1500,7 +1500,7 @@ Defined in: [lib/ai.ts:152](https://github.com/maiyunnet/kebab/blob/master/lib/a
1500
1500
 
1501
1501
  > **embedding**(`body`): `Promise`\<`false` \| `APIPromise`\<`CreateEmbeddingResponse`\>\>
1502
1502
 
1503
- Defined in: [lib/ai.ts:175](https://github.com/maiyunnet/kebab/blob/master/lib/ai.ts#L175)
1503
+ Defined in: [lib/ai.ts:181](https://github.com/maiyunnet/kebab/blob/master/lib/ai.ts#L181)
1504
1504
 
1505
1505
  创建向量
1506
1506
 
@@ -1520,7 +1520,7 @@ Defined in: [lib/ai.ts:175](https://github.com/maiyunnet/kebab/blob/master/lib/a
1520
1520
 
1521
1521
  > **image**(`opt`): `Promise`\<`false` \| \{ `list`: `object`[]; `request`: `string`; `seed`: `number`; \}\>
1522
1522
 
1523
- Defined in: [lib/ai.ts:191](https://github.com/maiyunnet/kebab/blob/master/lib/ai.ts#L191)
1523
+ Defined in: [lib/ai.ts:197](https://github.com/maiyunnet/kebab/blob/master/lib/ai.ts#L197)
1524
1524
 
1525
1525
  生成图像,不支持 GEMINI、GROK 服务商
1526
1526
 
@@ -1538,7 +1538,7 @@ Defined in: [lib/ai.ts:191](https://github.com/maiyunnet/kebab/blob/master/lib/a
1538
1538
 
1539
1539
  `string`[]
1540
1540
 
1541
- 参考图,请注意模型是否支持,以及是否支持多张,仅支持 ALICN、ALIAS、VOLCN、VOLAS 服务商
1541
+ 参考图,请注意模型是否支持,以及是否支持多张,仅支持 ALICN、ALIAS、ALINE、VOLCN、VOLAS 服务商
1542
1542
 
1543
1543
  ###### model
1544
1544
 
@@ -1582,7 +1582,7 @@ Defined in: [lib/ai.ts:191](https://github.com/maiyunnet/kebab/blob/master/lib/a
1582
1582
 
1583
1583
  > **poll**(`opt`): `Promise`\<`false` \| \{ `add?`: `number`; `end?`: `number`; `error?`: `string`; `start?`: `number`; `status`: `"FAILED"` \| `"PENDING"` \| `"RUNNING"` \| `"SUCCEEDED"` \| `"CANCELED"` \| `"UNKNOWN"`; `task`: `string`; `url?`: `string`; \}\>
1584
1584
 
1585
- Defined in: [lib/ai.ts:539](https://github.com/maiyunnet/kebab/blob/master/lib/ai.ts#L539)
1585
+ Defined in: [lib/ai.ts:546](https://github.com/maiyunnet/kebab/blob/master/lib/ai.ts#L546)
1586
1586
 
1587
1587
  轮询任务
1588
1588
 
@@ -1608,9 +1608,9 @@ Defined in: [lib/ai.ts:539](https://github.com/maiyunnet/kebab/blob/master/lib/a
1608
1608
 
1609
1609
  > **video**(`opt`): `Promise`\<`false` \| \{ `request`: `string`; `seed`: `number`; `status`: `"FAILED"` \| `"PENDING"` \| `"RUNNING"` \| `"SUCCEEDED"` \| `"CANCELED"` \| `"UNKNOWN"`; `task`: `string`; \}\>
1610
1610
 
1611
- Defined in: [lib/ai.ts:371](https://github.com/maiyunnet/kebab/blob/master/lib/ai.ts#L371)
1611
+ Defined in: [lib/ai.ts:378](https://github.com/maiyunnet/kebab/blob/master/lib/ai.ts#L378)
1612
1612
 
1613
- 异步生成视频,仅支持 ALICN、ALIAS
1613
+ 异步生成视频,仅支持 ALICN、ALIAS、ALINE
1614
1614
 
1615
1615
  #### Parameters
1616
1616
 
@@ -1711,7 +1711,7 @@ Defined in: [lib/ai.ts:19](https://github.com/maiyunnet/kebab/blob/master/lib/ai
1711
1711
 
1712
1712
  Defined in: [lib/ai.ts:23](https://github.com/maiyunnet/kebab/blob/master/lib/ai.ts#L23)
1713
1713
 
1714
- 阿里国际区
1714
+ 阿里新加坡
1715
1715
 
1716
1716
  ***
1717
1717
 
@@ -1725,21 +1725,31 @@ Defined in: [lib/ai.ts:21](https://github.com/maiyunnet/kebab/blob/master/lib/ai
1725
1725
 
1726
1726
  ***
1727
1727
 
1728
- ### AZURE
1728
+ ### ALINE
1729
1729
 
1730
- > **AZURE**: `2`
1730
+ > **ALINE**: `2`
1731
1731
 
1732
1732
  Defined in: [lib/ai.ts:25](https://github.com/maiyunnet/kebab/blob/master/lib/ai.ts#L25)
1733
1733
 
1734
+ 阿里美国
1735
+
1736
+ ***
1737
+
1738
+ ### AZURE
1739
+
1740
+ > **AZURE**: `3`
1741
+
1742
+ Defined in: [lib/ai.ts:27](https://github.com/maiyunnet/kebab/blob/master/lib/ai.ts#L27)
1743
+
1734
1744
  微软 Azure
1735
1745
 
1736
1746
  ***
1737
1747
 
1738
1748
  ### AZURE2
1739
1749
 
1740
- > **AZURE2**: `3`
1750
+ > **AZURE2**: `4`
1741
1751
 
1742
- Defined in: [lib/ai.ts:27](https://github.com/maiyunnet/kebab/blob/master/lib/ai.ts#L27)
1752
+ Defined in: [lib/ai.ts:29](https://github.com/maiyunnet/kebab/blob/master/lib/ai.ts#L29)
1743
1753
 
1744
1754
  微软 Azure 2
1745
1755
 
@@ -1747,9 +1757,9 @@ Defined in: [lib/ai.ts:27](https://github.com/maiyunnet/kebab/blob/master/lib/ai
1747
1757
 
1748
1758
  ### AZURE3
1749
1759
 
1750
- > **AZURE3**: `4`
1760
+ > **AZURE3**: `5`
1751
1761
 
1752
- Defined in: [lib/ai.ts:29](https://github.com/maiyunnet/kebab/blob/master/lib/ai.ts#L29)
1762
+ Defined in: [lib/ai.ts:31](https://github.com/maiyunnet/kebab/blob/master/lib/ai.ts#L31)
1753
1763
 
1754
1764
  微软 Azure 3
1755
1765
 
@@ -1757,9 +1767,9 @@ Defined in: [lib/ai.ts:29](https://github.com/maiyunnet/kebab/blob/master/lib/ai
1757
1767
 
1758
1768
  ### GEMINI
1759
1769
 
1760
- > **GEMINI**: `5`
1770
+ > **GEMINI**: `6`
1761
1771
 
1762
- Defined in: [lib/ai.ts:31](https://github.com/maiyunnet/kebab/blob/master/lib/ai.ts#L31)
1772
+ Defined in: [lib/ai.ts:33](https://github.com/maiyunnet/kebab/blob/master/lib/ai.ts#L33)
1763
1773
 
1764
1774
  Gemini
1765
1775
 
@@ -1767,9 +1777,9 @@ Gemini
1767
1777
 
1768
1778
  ### GROK
1769
1779
 
1770
- > **GROK**: `6`
1780
+ > **GROK**: `7`
1771
1781
 
1772
- Defined in: [lib/ai.ts:33](https://github.com/maiyunnet/kebab/blob/master/lib/ai.ts#L33)
1782
+ Defined in: [lib/ai.ts:35](https://github.com/maiyunnet/kebab/blob/master/lib/ai.ts#L35)
1773
1783
 
1774
1784
  Grok
1775
1785
 
@@ -1777,9 +1787,9 @@ Grok
1777
1787
 
1778
1788
  ### VOLAS
1779
1789
 
1780
- > **VOLAS**: `8`
1790
+ > **VOLAS**: `9`
1781
1791
 
1782
- Defined in: [lib/ai.ts:37](https://github.com/maiyunnet/kebab/blob/master/lib/ai.ts#L37)
1792
+ Defined in: [lib/ai.ts:39](https://github.com/maiyunnet/kebab/blob/master/lib/ai.ts#L39)
1783
1793
 
1784
1794
  火山引擎国际区
1785
1795
 
@@ -1787,9 +1797,9 @@ Defined in: [lib/ai.ts:37](https://github.com/maiyunnet/kebab/blob/master/lib/ai
1787
1797
 
1788
1798
  ### VOLCN
1789
1799
 
1790
- > **VOLCN**: `7`
1800
+ > **VOLCN**: `8`
1791
1801
 
1792
- Defined in: [lib/ai.ts:35](https://github.com/maiyunnet/kebab/blob/master/lib/ai.ts#L35)
1802
+ Defined in: [lib/ai.ts:37](https://github.com/maiyunnet/kebab/blob/master/lib/ai.ts#L37)
1793
1803
 
1794
1804
  火山引擎中国大陆区
1795
1805
 
@@ -1806,7 +1816,7 @@ lib/ai/functions/get.md
1806
1816
 
1807
1817
  > **get**(`ctrEtc`, `opt`): [`Ai`](../classes/Ai.md)
1808
1818
 
1809
- Defined in: [lib/ai.ts:594](https://github.com/maiyunnet/kebab/blob/master/lib/ai.ts#L594)
1819
+ Defined in: [lib/ai.ts:601](https://github.com/maiyunnet/kebab/blob/master/lib/ai.ts#L601)
1810
1820
 
1811
1821
  创建一个 AI 对象
1812
1822
 
@@ -1864,7 +1874,7 @@ lib/ai/interfaces/IOptions.md
1864
1874
 
1865
1875
  # Interface: IOptions
1866
1876
 
1867
- Defined in: [lib/ai.ts:41](https://github.com/maiyunnet/kebab/blob/master/lib/ai.ts#L41)
1877
+ Defined in: [lib/ai.ts:43](https://github.com/maiyunnet/kebab/blob/master/lib/ai.ts#L43)
1868
1878
 
1869
1879
  选项
1870
1880
 
@@ -1874,7 +1884,7 @@ Defined in: [lib/ai.ts:41](https://github.com/maiyunnet/kebab/blob/master/lib/ai
1874
1884
 
1875
1885
  > `optional` **endpoint?**: `string`
1876
1886
 
1877
- Defined in: [lib/ai.ts:45](https://github.com/maiyunnet/kebab/blob/master/lib/ai.ts#L45)
1887
+ Defined in: [lib/ai.ts:47](https://github.com/maiyunnet/kebab/blob/master/lib/ai.ts#L47)
1878
1888
 
1879
1889
  接入点
1880
1890
 
@@ -1884,7 +1894,7 @@ Defined in: [lib/ai.ts:45](https://github.com/maiyunnet/kebab/blob/master/lib/ai
1884
1894
 
1885
1895
  > `optional` **fetch?**: (`input`, `init?`) => `Promise`\<`Response`\>
1886
1896
 
1887
- Defined in: [lib/ai.ts:49](https://github.com/maiyunnet/kebab/blob/master/lib/ai.ts#L49)
1897
+ Defined in: [lib/ai.ts:51](https://github.com/maiyunnet/kebab/blob/master/lib/ai.ts#L51)
1888
1898
 
1889
1899
  自定义 fetch 函数
1890
1900
 
@@ -1908,7 +1918,7 @@ Defined in: [lib/ai.ts:49](https://github.com/maiyunnet/kebab/blob/master/lib/ai
1908
1918
 
1909
1919
  > `optional` **secretKey?**: `string`
1910
1920
 
1911
- Defined in: [lib/ai.ts:47](https://github.com/maiyunnet/kebab/blob/master/lib/ai.ts#L47)
1921
+ Defined in: [lib/ai.ts:49](https://github.com/maiyunnet/kebab/blob/master/lib/ai.ts#L49)
1912
1922
 
1913
1923
  密钥
1914
1924
 
@@ -1918,7 +1928,7 @@ Defined in: [lib/ai.ts:47](https://github.com/maiyunnet/kebab/blob/master/lib/ai
1918
1928
 
1919
1929
  > **service**: [`ESERVICE`](../enumerations/ESERVICE.md)
1920
1930
 
1921
- Defined in: [lib/ai.ts:43](https://github.com/maiyunnet/kebab/blob/master/lib/ai.ts#L43)
1931
+ Defined in: [lib/ai.ts:45](https://github.com/maiyunnet/kebab/blob/master/lib/ai.ts#L45)
1922
1932
 
1923
1933
  服务商 -
1924
1934
 
@@ -20497,9 +20507,9 @@ Defined in: [sys/ctr.ts:315](https://github.com/maiyunnet/kebab/blob/master/sys/
20497
20507
 
20498
20508
  ### \_handleFormData()
20499
20509
 
20500
- > `protected` **\_handleFormData**(`events?`): `Promise`\<`boolean`\>
20510
+ > `protected` **\_handleFormData**(`events?`, `limits?`): `Promise`\<`boolean`\>
20501
20511
 
20502
- Defined in: [sys/ctr.ts:1020](https://github.com/maiyunnet/kebab/blob/master/sys/ctr.ts#L1020)
20512
+ Defined in: [sys/ctr.ts:1021](https://github.com/maiyunnet/kebab/blob/master/sys/ctr.ts#L1021)
20503
20513
 
20504
20514
  获取 formdata 的信息
20505
20515
 
@@ -20521,6 +20531,22 @@ Defined in: [sys/ctr.ts:1020](https://github.com/maiyunnet/kebab/blob/master/sys
20521
20531
 
20522
20532
  (`name`) => `boolean` \| `undefined`
20523
20533
 
20534
+ ##### limits?
20535
+
20536
+ 上传限制
20537
+
20538
+ ###### allowedExts?
20539
+
20540
+ `string`[]
20541
+
20542
+ 允许的文件扩展名(含点号),如 ['.jpg', '.png', '.pdf']
20543
+
20544
+ ###### maxFileSize?
20545
+
20546
+ `number`
20547
+
20548
+ 单个文件最大字节数
20549
+
20524
20550
  #### Returns
20525
20551
 
20526
20552
  `Promise`\<`boolean`\>
@@ -21529,7 +21555,7 @@ Defined in: [sys/mod.ts:68](https://github.com/maiyunnet/kebab/blob/master/sys/m
21529
21555
 
21530
21556
  > `protected` **\_keyGenerator**(): `string`
21531
21557
 
21532
- Defined in: [sys/mod.ts:1794](https://github.com/maiyunnet/kebab/blob/master/sys/mod.ts#L1794)
21558
+ Defined in: [sys/mod.ts:1798](https://github.com/maiyunnet/kebab/blob/master/sys/mod.ts#L1798)
21533
21559
 
21534
21560
  当 _key 不为空时,则依据继承此方法的方法自动生成填充 key
21535
21561
 
@@ -21551,7 +21577,7 @@ Defined in: [sys/mod.ts:1794](https://github.com/maiyunnet/kebab/blob/master/sys
21551
21577
 
21552
21578
  > **all**(): `Promise`\<`false` \| [`Rows`](Rows.md)\<`Mod`\>\>
21553
21579
 
21554
- Defined in: [sys/mod.ts:1136](https://github.com/maiyunnet/kebab/blob/master/sys/mod.ts#L1136)
21580
+ Defined in: [sys/mod.ts:1140](https://github.com/maiyunnet/kebab/blob/master/sys/mod.ts#L1140)
21555
21581
 
21556
21582
  ##### Returns
21557
21583
 
@@ -21561,7 +21587,7 @@ Defined in: [sys/mod.ts:1136](https://github.com/maiyunnet/kebab/blob/master/sys
21561
21587
 
21562
21588
  > **all**(`key`): `Promise`\<`false` \| `Record`\<`string`, `Mod`\>\>
21563
21589
 
21564
- Defined in: [sys/mod.ts:1137](https://github.com/maiyunnet/kebab/blob/master/sys/mod.ts#L1137)
21590
+ Defined in: [sys/mod.ts:1141](https://github.com/maiyunnet/kebab/blob/master/sys/mod.ts#L1141)
21565
21591
 
21566
21592
  ##### Parameters
21567
21593
 
@@ -21587,7 +21613,7 @@ Defined in: [sys/mod.ts:1137](https://github.com/maiyunnet/kebab/blob/master/sys
21587
21613
 
21588
21614
  > **allArray**(): `Promise`\<`false` \| `Record`\<`string`, `any`\>[]\>
21589
21615
 
21590
- Defined in: [sys/mod.ts:1315](https://github.com/maiyunnet/kebab/blob/master/sys/mod.ts#L1315)
21616
+ Defined in: [sys/mod.ts:1319](https://github.com/maiyunnet/kebab/blob/master/sys/mod.ts#L1319)
21591
21617
 
21592
21618
  ##### Returns
21593
21619
 
@@ -21597,7 +21623,7 @@ Defined in: [sys/mod.ts:1315](https://github.com/maiyunnet/kebab/blob/master/sys
21597
21623
 
21598
21624
  > **allArray**(`key`): `Promise`\<`false` \| `Record`\<`string`, `Record`\<`string`, `any`\>\>\>
21599
21625
 
21600
- Defined in: [sys/mod.ts:1316](https://github.com/maiyunnet/kebab/blob/master/sys/mod.ts#L1316)
21626
+ Defined in: [sys/mod.ts:1320](https://github.com/maiyunnet/kebab/blob/master/sys/mod.ts#L1320)
21601
21627
 
21602
21628
  ##### Parameters
21603
21629
 
@@ -21615,7 +21641,7 @@ Defined in: [sys/mod.ts:1316](https://github.com/maiyunnet/kebab/blob/master/sys
21615
21641
 
21616
21642
  > **append**(`sql`): `this`
21617
21643
 
21618
- Defined in: [sys/mod.ts:1703](https://github.com/maiyunnet/kebab/blob/master/sys/mod.ts#L1703)
21644
+ Defined in: [sys/mod.ts:1707](https://github.com/maiyunnet/kebab/blob/master/sys/mod.ts#L1707)
21619
21645
 
21620
21646
  在 sql 最后追加字符串
21621
21647
 
@@ -21635,7 +21661,7 @@ Defined in: [sys/mod.ts:1703](https://github.com/maiyunnet/kebab/blob/master/sys
21635
21661
 
21636
21662
  > **by**(`c`, `d?`): `this`
21637
21663
 
21638
- Defined in: [sys/mod.ts:1659](https://github.com/maiyunnet/kebab/blob/master/sys/mod.ts#L1659)
21664
+ Defined in: [sys/mod.ts:1663](https://github.com/maiyunnet/kebab/blob/master/sys/mod.ts#L1663)
21639
21665
 
21640
21666
  ORDER BY
21641
21667
 
@@ -21663,7 +21689,7 @@ ORDER BY
21663
21689
 
21664
21690
  > **contain**(`contain`): `this`
21665
21691
 
21666
- Defined in: [sys/mod.ts:1712](https://github.com/maiyunnet/kebab/blob/master/sys/mod.ts#L1712)
21692
+ Defined in: [sys/mod.ts:1716](https://github.com/maiyunnet/kebab/blob/master/sys/mod.ts#L1716)
21667
21693
 
21668
21694
  设置闭包含数据
21669
21695
 
@@ -21691,7 +21717,7 @@ Defined in: [sys/mod.ts:1712](https://github.com/maiyunnet/kebab/blob/master/sys
21691
21717
 
21692
21718
  > **count**(): `Promise`\<`number`\>
21693
21719
 
21694
- Defined in: [sys/mod.ts:1523](https://github.com/maiyunnet/kebab/blob/master/sys/mod.ts#L1523)
21720
+ Defined in: [sys/mod.ts:1527](https://github.com/maiyunnet/kebab/blob/master/sys/mod.ts#L1527)
21695
21721
 
21696
21722
  根据当前条件,筛选出当前条目该有的数据条数
21697
21723
 
@@ -21705,7 +21731,7 @@ Defined in: [sys/mod.ts:1523](https://github.com/maiyunnet/kebab/blob/master/sys
21705
21731
 
21706
21732
  > **countSql**(): `string`
21707
21733
 
21708
- Defined in: [sys/mod.ts:1544](https://github.com/maiyunnet/kebab/blob/master/sys/mod.ts#L1544)
21734
+ Defined in: [sys/mod.ts:1548](https://github.com/maiyunnet/kebab/blob/master/sys/mod.ts#L1548)
21709
21735
 
21710
21736
  获取当前条件下的 count 的 SQL 语句
21711
21737
 
@@ -21719,7 +21745,7 @@ Defined in: [sys/mod.ts:1544](https://github.com/maiyunnet/kebab/blob/master/sys
21719
21745
 
21720
21746
  > **create**(): `Promise`\<`boolean` \| `null`\>
21721
21747
 
21722
- Defined in: [sys/mod.ts:830](https://github.com/maiyunnet/kebab/blob/master/sys/mod.ts#L830)
21748
+ Defined in: [sys/mod.ts:834](https://github.com/maiyunnet/kebab/blob/master/sys/mod.ts#L834)
21723
21749
 
21724
21750
  创建数据
21725
21751
 
@@ -21735,7 +21761,7 @@ true-成功,false-报错,null-唯一键非 _$key 键冲突
21735
21761
 
21736
21762
  > **crossJoin**(`f`, `s`, `index?`, `pre?`): `this`
21737
21763
 
21738
- Defined in: [sys/mod.ts:1619](https://github.com/maiyunnet/kebab/blob/master/sys/mod.ts#L1619)
21764
+ Defined in: [sys/mod.ts:1623](https://github.com/maiyunnet/kebab/blob/master/sys/mod.ts#L1623)
21739
21765
 
21740
21766
  cross join 方法
21741
21767
 
@@ -21783,7 +21809,7 @@ ON 信息
21783
21809
 
21784
21810
  > **explain**(`all?`): `Promise`\<`string` \| `false`\>
21785
21811
 
21786
- Defined in: [sys/mod.ts:1441](https://github.com/maiyunnet/kebab/blob/master/sys/mod.ts#L1441)
21812
+ Defined in: [sys/mod.ts:1445](https://github.com/maiyunnet/kebab/blob/master/sys/mod.ts#L1445)
21787
21813
 
21788
21814
  ##### Parameters
21789
21815
 
@@ -21799,7 +21825,7 @@ Defined in: [sys/mod.ts:1441](https://github.com/maiyunnet/kebab/blob/master/sys
21799
21825
 
21800
21826
  > **explain**(`all`): `Promise`\<`false` \| `Record`\<`string`, `any`\>\>
21801
21827
 
21802
- Defined in: [sys/mod.ts:1442](https://github.com/maiyunnet/kebab/blob/master/sys/mod.ts#L1442)
21828
+ Defined in: [sys/mod.ts:1446](https://github.com/maiyunnet/kebab/blob/master/sys/mod.ts#L1446)
21803
21829
 
21804
21830
  ##### Parameters
21805
21831
 
@@ -21817,7 +21843,7 @@ Defined in: [sys/mod.ts:1442](https://github.com/maiyunnet/kebab/blob/master/sys
21817
21843
 
21818
21844
  > **filter**(`s`): `this`
21819
21845
 
21820
- Defined in: [sys/mod.ts:1637](https://github.com/maiyunnet/kebab/blob/master/sys/mod.ts#L1637)
21846
+ Defined in: [sys/mod.ts:1641](https://github.com/maiyunnet/kebab/blob/master/sys/mod.ts#L1641)
21821
21847
 
21822
21848
  筛选器
21823
21849
 
@@ -21851,7 +21877,7 @@ Defined in: [sys/mod.ts:1637](https://github.com/maiyunnet/kebab/blob/master/sys
21851
21877
 
21852
21878
  > **first**(`lock`, `array`): `Promise`\<`false` \| `Record`\<`string`, `any`\> \| `null`\>
21853
21879
 
21854
- Defined in: [sys/mod.ts:1025](https://github.com/maiyunnet/kebab/blob/master/sys/mod.ts#L1025)
21880
+ Defined in: [sys/mod.ts:1029](https://github.com/maiyunnet/kebab/blob/master/sys/mod.ts#L1029)
21855
21881
 
21856
21882
  ##### Parameters
21857
21883
 
@@ -21871,7 +21897,7 @@ Defined in: [sys/mod.ts:1025](https://github.com/maiyunnet/kebab/blob/master/sys
21871
21897
 
21872
21898
  > **first**(`lock?`, `array?`): `Promise`\<`false` \| `Mod` & `Record`\<`string`, `any`\> \| `null`\>
21873
21899
 
21874
- Defined in: [sys/mod.ts:1029](https://github.com/maiyunnet/kebab/blob/master/sys/mod.ts#L1029)
21900
+ Defined in: [sys/mod.ts:1033](https://github.com/maiyunnet/kebab/blob/master/sys/mod.ts#L1033)
21875
21901
 
21876
21902
  ##### Parameters
21877
21903
 
@@ -21893,7 +21919,7 @@ Defined in: [sys/mod.ts:1029](https://github.com/maiyunnet/kebab/blob/master/sys
21893
21919
 
21894
21920
  > **firstArray**(`lock?`): `Promise`\<`false` \| `Record`\<`string`, `any`\> \| `null`\>
21895
21921
 
21896
- Defined in: [sys/mod.ts:1069](https://github.com/maiyunnet/kebab/blob/master/sys/mod.ts#L1069)
21922
+ Defined in: [sys/mod.ts:1073](https://github.com/maiyunnet/kebab/blob/master/sys/mod.ts#L1073)
21897
21923
 
21898
21924
  获取数据库第一个原生对象
21899
21925
 
@@ -21915,7 +21941,7 @@ Defined in: [sys/mod.ts:1069](https://github.com/maiyunnet/kebab/blob/master/sys
21915
21941
 
21916
21942
  > **format**(`sql?`, `data?`): `string`
21917
21943
 
21918
- Defined in: [sys/mod.ts:1739](https://github.com/maiyunnet/kebab/blob/master/sys/mod.ts#L1739)
21944
+ Defined in: [sys/mod.ts:1743](https://github.com/maiyunnet/kebab/blob/master/sys/mod.ts#L1743)
21919
21945
 
21920
21946
  获取带 data 的 sql 语句
21921
21947
 
@@ -21943,7 +21969,7 @@ sql 语句
21943
21969
 
21944
21970
  > **fullJoin**(`f`, `s`, `index?`, `pre?`): `this`
21945
21971
 
21946
- Defined in: [sys/mod.ts:1607](https://github.com/maiyunnet/kebab/blob/master/sys/mod.ts#L1607)
21972
+ Defined in: [sys/mod.ts:1611](https://github.com/maiyunnet/kebab/blob/master/sys/mod.ts#L1611)
21947
21973
 
21948
21974
  full join 方法
21949
21975
 
@@ -21983,7 +22009,7 @@ ON 信息
21983
22009
 
21984
22010
  > **get**(`n`): `any`
21985
22011
 
21986
- Defined in: [sys/mod.ts:822](https://github.com/maiyunnet/kebab/blob/master/sys/mod.ts#L822)
22012
+ Defined in: [sys/mod.ts:826](https://github.com/maiyunnet/kebab/blob/master/sys/mod.ts#L826)
21987
22013
 
21988
22014
  获取一个字段值
21989
22015
 
@@ -22005,7 +22031,7 @@ Defined in: [sys/mod.ts:822](https://github.com/maiyunnet/kebab/blob/master/sys/
22005
22031
 
22006
22032
  > **getData**(): `any`[]
22007
22033
 
22008
- Defined in: [sys/mod.ts:1730](https://github.com/maiyunnet/kebab/blob/master/sys/mod.ts#L1730)
22034
+ Defined in: [sys/mod.ts:1734](https://github.com/maiyunnet/kebab/blob/master/sys/mod.ts#L1734)
22009
22035
 
22010
22036
  获取全部 data
22011
22037
 
@@ -22019,7 +22045,7 @@ Defined in: [sys/mod.ts:1730](https://github.com/maiyunnet/kebab/blob/master/sys
22019
22045
 
22020
22046
  > **getSql**(): `string`
22021
22047
 
22022
- Defined in: [sys/mod.ts:1723](https://github.com/maiyunnet/kebab/blob/master/sys/mod.ts#L1723)
22048
+ Defined in: [sys/mod.ts:1727](https://github.com/maiyunnet/kebab/blob/master/sys/mod.ts#L1727)
22023
22049
 
22024
22050
  获取 sql 语句
22025
22051
 
@@ -22033,7 +22059,7 @@ Defined in: [sys/mod.ts:1723](https://github.com/maiyunnet/kebab/blob/master/sys
22033
22059
 
22034
22060
  > **group**(`c`): `this`
22035
22061
 
22036
- Defined in: [sys/mod.ts:1668](https://github.com/maiyunnet/kebab/blob/master/sys/mod.ts#L1668)
22062
+ Defined in: [sys/mod.ts:1672](https://github.com/maiyunnet/kebab/blob/master/sys/mod.ts#L1672)
22037
22063
 
22038
22064
  GROUP BY
22039
22065
 
@@ -22055,7 +22081,7 @@ GROUP BY
22055
22081
 
22056
22082
  > **having**(`s`): `this`
22057
22083
 
22058
- Defined in: [sys/mod.ts:1628](https://github.com/maiyunnet/kebab/blob/master/sys/mod.ts#L1628)
22084
+ Defined in: [sys/mod.ts:1632](https://github.com/maiyunnet/kebab/blob/master/sys/mod.ts#L1632)
22059
22085
 
22060
22086
  筛选器
22061
22087
 
@@ -22077,7 +22103,7 @@ Defined in: [sys/mod.ts:1628](https://github.com/maiyunnet/kebab/blob/master/sys
22077
22103
 
22078
22104
  > **innerJoin**(`f`, `s`, `index?`, `pre?`): `this`
22079
22105
 
22080
- Defined in: [sys/mod.ts:1595](https://github.com/maiyunnet/kebab/blob/master/sys/mod.ts#L1595)
22106
+ Defined in: [sys/mod.ts:1599](https://github.com/maiyunnet/kebab/blob/master/sys/mod.ts#L1599)
22081
22107
 
22082
22108
  inner join 方法
22083
22109
 
@@ -22117,7 +22143,7 @@ ON 信息
22117
22143
 
22118
22144
  > **join**(`f`, `s?`, `type?`, `index?`, `pre?`): `this`
22119
22145
 
22120
- Defined in: [sys/mod.ts:1559](https://github.com/maiyunnet/kebab/blob/master/sys/mod.ts#L1559)
22146
+ Defined in: [sys/mod.ts:1563](https://github.com/maiyunnet/kebab/blob/master/sys/mod.ts#L1563)
22121
22147
 
22122
22148
  #### Parameters
22123
22149
 
@@ -22161,7 +22187,7 @@ ON 信息
22161
22187
 
22162
22188
  > **langText**(`col`, `lang`): `string`
22163
22189
 
22164
- Defined in: [sys/mod.ts:1774](https://github.com/maiyunnet/kebab/blob/master/sys/mod.ts#L1774)
22190
+ Defined in: [sys/mod.ts:1778](https://github.com/maiyunnet/kebab/blob/master/sys/mod.ts#L1778)
22165
22191
 
22166
22192
  获取字段的可用语种文本
22167
22193
 
@@ -22189,7 +22215,7 @@ Defined in: [sys/mod.ts:1774](https://github.com/maiyunnet/kebab/blob/master/sys
22189
22215
 
22190
22216
  > **leftJoin**(`f`, `s`, `index?`, `pre?`): `this`
22191
22217
 
22192
- Defined in: [sys/mod.ts:1571](https://github.com/maiyunnet/kebab/blob/master/sys/mod.ts#L1571)
22218
+ Defined in: [sys/mod.ts:1575](https://github.com/maiyunnet/kebab/blob/master/sys/mod.ts#L1575)
22193
22219
 
22194
22220
  left join 方法
22195
22221
 
@@ -22229,7 +22255,7 @@ ON 信息
22229
22255
 
22230
22256
  > **limit**(`a`, `b?`): `this`
22231
22257
 
22232
- Defined in: [sys/mod.ts:1681](https://github.com/maiyunnet/kebab/blob/master/sys/mod.ts#L1681)
22258
+ Defined in: [sys/mod.ts:1685](https://github.com/maiyunnet/kebab/blob/master/sys/mod.ts#L1685)
22233
22259
 
22234
22260
  LIMIT
22235
22261
 
@@ -22257,7 +22283,7 @@ LIMIT
22257
22283
 
22258
22284
  > **page**(`count`, `page?`): `this`
22259
22285
 
22260
- Defined in: [sys/mod.ts:1692](https://github.com/maiyunnet/kebab/blob/master/sys/mod.ts#L1692)
22286
+ Defined in: [sys/mod.ts:1696](https://github.com/maiyunnet/kebab/blob/master/sys/mod.ts#L1696)
22261
22287
 
22262
22288
  分页
22263
22289
 
@@ -22285,7 +22311,7 @@ Defined in: [sys/mod.ts:1692](https://github.com/maiyunnet/kebab/blob/master/sys
22285
22311
 
22286
22312
  > **refresh**(`lock?`): `Promise`\<`boolean` \| `null`\>
22287
22313
 
22288
- Defined in: [sys/mod.ts:950](https://github.com/maiyunnet/kebab/blob/master/sys/mod.ts#L950)
22314
+ Defined in: [sys/mod.ts:954](https://github.com/maiyunnet/kebab/blob/master/sys/mod.ts#L954)
22289
22315
 
22290
22316
  刷新当前模型获取最新数据
22291
22317
 
@@ -22307,7 +22333,7 @@ Defined in: [sys/mod.ts:950](https://github.com/maiyunnet/kebab/blob/master/sys/
22307
22333
 
22308
22334
  > **remove**(): `Promise`\<`boolean`\>
22309
22335
 
22310
- Defined in: [sys/mod.ts:1007](https://github.com/maiyunnet/kebab/blob/master/sys/mod.ts#L1007)
22336
+ Defined in: [sys/mod.ts:1011](https://github.com/maiyunnet/kebab/blob/master/sys/mod.ts#L1011)
22311
22337
 
22312
22338
  移除本条目
22313
22339
 
@@ -22321,7 +22347,7 @@ Defined in: [sys/mod.ts:1007](https://github.com/maiyunnet/kebab/blob/master/sys
22321
22347
 
22322
22348
  > **rightJoin**(`f`, `s`, `index?`, `pre?`): `this`
22323
22349
 
22324
- Defined in: [sys/mod.ts:1583](https://github.com/maiyunnet/kebab/blob/master/sys/mod.ts#L1583)
22350
+ Defined in: [sys/mod.ts:1587](https://github.com/maiyunnet/kebab/blob/master/sys/mod.ts#L1587)
22325
22351
 
22326
22352
  right join 方法
22327
22353
 
@@ -22361,7 +22387,7 @@ ON 信息
22361
22387
 
22362
22388
  > **save**(`where?`): `Promise`\<`boolean`\>
22363
22389
 
22364
- Defined in: [sys/mod.ts:978](https://github.com/maiyunnet/kebab/blob/master/sys/mod.ts#L978)
22390
+ Defined in: [sys/mod.ts:982](https://github.com/maiyunnet/kebab/blob/master/sys/mod.ts#L982)
22365
22391
 
22366
22392
  更新 set 的数据到数据库,有未保存数据时才保存
22367
22393
 
@@ -22395,7 +22421,7 @@ Defined in: [sys/mod.ts:978](https://github.com/maiyunnet/kebab/blob/master/sys/
22395
22421
 
22396
22422
  > **set**\<`T`, `TK`\>(`n`): `void`
22397
22423
 
22398
- Defined in: [sys/mod.ts:783](https://github.com/maiyunnet/kebab/blob/master/sys/mod.ts#L783)
22424
+ Defined in: [sys/mod.ts:787](https://github.com/maiyunnet/kebab/blob/master/sys/mod.ts#L787)
22399
22425
 
22400
22426
  ##### Type Parameters
22401
22427
 
@@ -22421,7 +22447,7 @@ Defined in: [sys/mod.ts:783](https://github.com/maiyunnet/kebab/blob/master/sys/
22421
22447
 
22422
22448
  > **set**\<`T`, `TK`\>(`n`, `v`): `void`
22423
22449
 
22424
- Defined in: [sys/mod.ts:784](https://github.com/maiyunnet/kebab/blob/master/sys/mod.ts#L784)
22450
+ Defined in: [sys/mod.ts:788](https://github.com/maiyunnet/kebab/blob/master/sys/mod.ts#L788)
22425
22451
 
22426
22452
  ##### Type Parameters
22427
22453
 
@@ -22453,7 +22479,7 @@ Defined in: [sys/mod.ts:784](https://github.com/maiyunnet/kebab/blob/master/sys/
22453
22479
 
22454
22480
  > **toArray**\<`TC`\>(): [`TOnlyProperties`](../type-aliases/TOnlyProperties.md)\<`InstanceType`\<`TC`\>\> & `Record`\<`string`, `any`\>
22455
22481
 
22456
- Defined in: [sys/mod.ts:1746](https://github.com/maiyunnet/kebab/blob/master/sys/mod.ts#L1746)
22482
+ Defined in: [sys/mod.ts:1750](https://github.com/maiyunnet/kebab/blob/master/sys/mod.ts#L1750)
22457
22483
 
22458
22484
  获取值对象,获取的是新创建的数组
22459
22485
 
@@ -22473,7 +22499,7 @@ Defined in: [sys/mod.ts:1746](https://github.com/maiyunnet/kebab/blob/master/sys
22473
22499
 
22474
22500
  > **total**(`f?`): `Promise`\<`number`\>
22475
22501
 
22476
- Defined in: [sys/mod.ts:1499](https://github.com/maiyunnet/kebab/blob/master/sys/mod.ts#L1499)
22502
+ Defined in: [sys/mod.ts:1503](https://github.com/maiyunnet/kebab/blob/master/sys/mod.ts#L1503)
22477
22503
 
22478
22504
  获取总条数,自动抛弃 LIMIT,仅用于获取数据的情况(select)
22479
22505
 
@@ -22493,7 +22519,7 @@ Defined in: [sys/mod.ts:1499](https://github.com/maiyunnet/kebab/blob/master/sys
22493
22519
 
22494
22520
  > **union**(`f`, `type?`): `this`
22495
22521
 
22496
- Defined in: [sys/mod.ts:1080](https://github.com/maiyunnet/kebab/blob/master/sys/mod.ts#L1080)
22522
+ Defined in: [sys/mod.ts:1084](https://github.com/maiyunnet/kebab/blob/master/sys/mod.ts#L1084)
22497
22523
 
22498
22524
  联合查询表数据
22499
22525
 
@@ -22521,7 +22547,7 @@ Defined in: [sys/mod.ts:1080](https://github.com/maiyunnet/kebab/blob/master/sys
22521
22547
 
22522
22548
  > **unionAll**(`f`): `this`
22523
22549
 
22524
- Defined in: [sys/mod.ts:1110](https://github.com/maiyunnet/kebab/blob/master/sys/mod.ts#L1110)
22550
+ Defined in: [sys/mod.ts:1114](https://github.com/maiyunnet/kebab/blob/master/sys/mod.ts#L1114)
22525
22551
 
22526
22552
  所有联合查询表数据
22527
22553
 
@@ -22543,7 +22569,7 @@ Defined in: [sys/mod.ts:1110](https://github.com/maiyunnet/kebab/blob/master/sys
22543
22569
 
22544
22570
  > **unsaved**(): `boolean`
22545
22571
 
22546
- Defined in: [sys/mod.ts:1765](https://github.com/maiyunnet/kebab/blob/master/sys/mod.ts#L1765)
22572
+ Defined in: [sys/mod.ts:1769](https://github.com/maiyunnet/kebab/blob/master/sys/mod.ts#L1769)
22547
22573
 
22548
22574
  当前是否设置了未保存 --=
22549
22575
 
@@ -22557,7 +22583,7 @@ Defined in: [sys/mod.ts:1765](https://github.com/maiyunnet/kebab/blob/master/sys
22557
22583
 
22558
22584
  > **updates**(): `Record`\<`string`, `any`\>
22559
22585
 
22560
- Defined in: [sys/mod.ts:1754](https://github.com/maiyunnet/kebab/blob/master/sys/mod.ts#L1754)
22586
+ Defined in: [sys/mod.ts:1758](https://github.com/maiyunnet/kebab/blob/master/sys/mod.ts#L1758)
22561
22587
 
22562
22588
  获取当前设置要提交的数据
22563
22589
 
@@ -22571,7 +22597,7 @@ Defined in: [sys/mod.ts:1754](https://github.com/maiyunnet/kebab/blob/master/sys
22571
22597
 
22572
22598
  > **upsert**(`conflict`): `Promise`\<`boolean`\>
22573
22599
 
22574
- Defined in: [sys/mod.ts:920](https://github.com/maiyunnet/kebab/blob/master/sys/mod.ts#L920)
22600
+ Defined in: [sys/mod.ts:924](https://github.com/maiyunnet/kebab/blob/master/sys/mod.ts#L924)
22575
22601
 
22576
22602
  插入数据,如果存在则更新(UPSERT)
22577
22603
 
@@ -22593,7 +22619,7 @@ Defined in: [sys/mod.ts:920](https://github.com/maiyunnet/kebab/blob/master/sys/
22593
22619
 
22594
22620
  > **where**(`s`): `this`
22595
22621
 
22596
- Defined in: [sys/mod.ts:1648](https://github.com/maiyunnet/kebab/blob/master/sys/mod.ts#L1648)
22622
+ Defined in: [sys/mod.ts:1652](https://github.com/maiyunnet/kebab/blob/master/sys/mod.ts#L1652)
22597
22623
 
22598
22624
  是 filter 的别名
22599
22625
 
@@ -22889,7 +22915,7 @@ Defined in: [sys/mod.ts:183](https://github.com/maiyunnet/kebab/blob/master/sys/
22889
22915
 
22890
22916
  #### Param
22891
22917
 
22892
- 选项
22918
+ 选项,lock 需确保 where 条件命中索引,否则可能退化为表锁
22893
22919
 
22894
22920
  #### Call Signature
22895
22921
 
@@ -22925,6 +22951,10 @@ Defined in: [sys/mod.ts:637](https://github.com/maiyunnet/kebab/blob/master/sys/
22925
22951
 
22926
22952
  `string` \| `string`[]
22927
22953
 
22954
+ ###### lock?
22955
+
22956
+ `boolean`
22957
+
22928
22958
  ###### pre?
22929
22959
 
22930
22960
  `string`
@@ -22941,7 +22971,7 @@ Defined in: [sys/mod.ts:637](https://github.com/maiyunnet/kebab/blob/master/sys/
22941
22971
 
22942
22972
  > `static` **one**\<`T`\>(`db`, `s`, `opt?`): `Promise`\<`false` \| `T` & `Record`\<`string`, `any`\> \| `null`\>
22943
22973
 
22944
- Defined in: [sys/mod.ts:649](https://github.com/maiyunnet/kebab/blob/master/sys/mod.ts#L649)
22974
+ Defined in: [sys/mod.ts:650](https://github.com/maiyunnet/kebab/blob/master/sys/mod.ts#L650)
22945
22975
 
22946
22976
  ##### Type Parameters
22947
22977
 
@@ -22977,6 +23007,10 @@ Defined in: [sys/mod.ts:649](https://github.com/maiyunnet/kebab/blob/master/sys/
22977
23007
 
22978
23008
  `string` \| `string`[]
22979
23009
 
23010
+ ###### lock?
23011
+
23012
+ `boolean`
23013
+
22980
23014
  ###### pre?
22981
23015
 
22982
23016
  `string`
@@ -22995,7 +23029,7 @@ Defined in: [sys/mod.ts:649](https://github.com/maiyunnet/kebab/blob/master/sys/
22995
23029
 
22996
23030
  > `static` **oneArray**(`db`, `s`, `opt?`): `Promise`\<`false` \| `Record`\<`string`, `any`\> \| `null`\>
22997
23031
 
22998
- Defined in: [sys/mod.ts:724](https://github.com/maiyunnet/kebab/blob/master/sys/mod.ts#L724)
23032
+ Defined in: [sys/mod.ts:727](https://github.com/maiyunnet/kebab/blob/master/sys/mod.ts#L727)
22999
23033
 
23000
23034
  通过 where 条件筛选单条数据返回原生对象
23001
23035
 
@@ -23025,6 +23059,10 @@ Defined in: [sys/mod.ts:724](https://github.com/maiyunnet/kebab/blob/master/sys/
23025
23059
 
23026
23060
  `string` \| `string`[]
23027
23061
 
23062
+ ###### lock?
23063
+
23064
+ `boolean`
23065
+
23028
23066
  ###### pre?
23029
23067
 
23030
23068
  `string`
@@ -23043,7 +23081,7 @@ Defined in: [sys/mod.ts:724](https://github.com/maiyunnet/kebab/blob/master/sys/
23043
23081
 
23044
23082
  > `static` **primarys**(`db`, `where?`, `opt?`): `Promise`\<`false` \| `any`[]\>
23045
23083
 
23046
- Defined in: [sys/mod.ts:744](https://github.com/maiyunnet/kebab/blob/master/sys/mod.ts#L744)
23084
+ Defined in: [sys/mod.ts:748](https://github.com/maiyunnet/kebab/blob/master/sys/mod.ts#L748)
23047
23085
 
23048
23086
  根据 where 条件获取主键值列表
23049
23087
 
@@ -23257,7 +23295,7 @@ select 自定字段
23257
23295
 
23258
23296
  > `static` **toArrayByRecord**\<`T`\>(`obj`): `Record`\<`string`, `Record`\<`string`, `any`\>\>
23259
23297
 
23260
- Defined in: [sys/mod.ts:771](https://github.com/maiyunnet/kebab/blob/master/sys/mod.ts#L771)
23298
+ Defined in: [sys/mod.ts:775](https://github.com/maiyunnet/kebab/blob/master/sys/mod.ts#L775)
23261
23299
 
23262
23300
  将 key val 组成的数据列表转换为原生对象模式,获取的是新创建的数组
23263
23301
 
@@ -23716,7 +23754,7 @@ sys/mod/interfaces/IModUnionItem.md
23716
23754
 
23717
23755
  # Interface: IModUnionItem
23718
23756
 
23719
- Defined in: [sys/mod.ts:1808](https://github.com/maiyunnet/kebab/blob/master/sys/mod.ts#L1808)
23757
+ Defined in: [sys/mod.ts:1812](https://github.com/maiyunnet/kebab/blob/master/sys/mod.ts#L1812)
23720
23758
 
23721
23759
  ## Properties
23722
23760
 
@@ -23724,7 +23762,7 @@ Defined in: [sys/mod.ts:1808](https://github.com/maiyunnet/kebab/blob/master/sys
23724
23762
 
23725
23763
  > **field**: `string`
23726
23764
 
23727
- Defined in: [sys/mod.ts:1809](https://github.com/maiyunnet/kebab/blob/master/sys/mod.ts#L1809)
23765
+ Defined in: [sys/mod.ts:1813](https://github.com/maiyunnet/kebab/blob/master/sys/mod.ts#L1813)
23728
23766
 
23729
23767
  ***
23730
23768
 
@@ -23732,7 +23770,7 @@ Defined in: [sys/mod.ts:1809](https://github.com/maiyunnet/kebab/blob/master/sys
23732
23770
 
23733
23771
  > `optional` **where?**: `any`
23734
23772
 
23735
- Defined in: [sys/mod.ts:1810](https://github.com/maiyunnet/kebab/blob/master/sys/mod.ts#L1810)
23773
+ Defined in: [sys/mod.ts:1814](https://github.com/maiyunnet/kebab/blob/master/sys/mod.ts#L1814)
23736
23774
 
23737
23775
  sys/mod/interfaces/IRows.md
23738
23776
  ---
@@ -23745,7 +23783,7 @@ sys/mod/interfaces/IRows.md
23745
23783
 
23746
23784
  # Interface: IRows\<T\>
23747
23785
 
23748
- Defined in: [sys/mod.ts:1802](https://github.com/maiyunnet/kebab/blob/master/sys/mod.ts#L1802)
23786
+ Defined in: [sys/mod.ts:1806](https://github.com/maiyunnet/kebab/blob/master/sys/mod.ts#L1806)
23749
23787
 
23750
23788
  ## Extends
23751
23789
 
@@ -23763,7 +23801,7 @@ Defined in: [sys/mod.ts:1802](https://github.com/maiyunnet/kebab/blob/master/sys
23763
23801
 
23764
23802
  > `readonly` **length**: `number`
23765
23803
 
23766
- Defined in: [sys/mod.ts:1803](https://github.com/maiyunnet/kebab/blob/master/sys/mod.ts#L1803)
23804
+ Defined in: [sys/mod.ts:1807](https://github.com/maiyunnet/kebab/blob/master/sys/mod.ts#L1807)
23767
23805
 
23768
23806
  ## Methods
23769
23807
 
@@ -23771,7 +23809,7 @@ Defined in: [sys/mod.ts:1803](https://github.com/maiyunnet/kebab/blob/master/sys
23771
23809
 
23772
23810
  > **item**(`index`): `T`
23773
23811
 
23774
- Defined in: [sys/mod.ts:1804](https://github.com/maiyunnet/kebab/blob/master/sys/mod.ts#L1804)
23812
+ Defined in: [sys/mod.ts:1808](https://github.com/maiyunnet/kebab/blob/master/sys/mod.ts#L1808)
23775
23813
 
23776
23814
  #### Parameters
23777
23815
 
@@ -23789,7 +23827,7 @@ Defined in: [sys/mod.ts:1804](https://github.com/maiyunnet/kebab/blob/master/sys
23789
23827
 
23790
23828
  > **toArray**(): `Record`\<`string`, `any`\>[]
23791
23829
 
23792
- Defined in: [sys/mod.ts:1805](https://github.com/maiyunnet/kebab/blob/master/sys/mod.ts#L1805)
23830
+ Defined in: [sys/mod.ts:1809](https://github.com/maiyunnet/kebab/blob/master/sys/mod.ts#L1809)
23793
23831
 
23794
23832
  #### Returns
23795
23833
 
package/index.d.ts CHANGED
@@ -5,7 +5,7 @@
5
5
  * --- 本文件用来定义每个目录实体地址的常量 ---
6
6
  */
7
7
  /** --- 当前系统版本号 --- */
8
- export declare const VER = "9.0.0";
8
+ export declare const VER = "9.0.2";
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.0.0';
9
+ export const VER = '9.0.2';
10
10
  // --- 服务端用的路径 ---
11
11
  const imu = decodeURIComponent(import.meta.url).replace('file://', '').replace(/^\/(\w:)/, '$1');
12
12
  /** --- /xxx/xxx --- */
package/lib/ai.d.ts CHANGED
@@ -15,22 +15,24 @@ import * as sCtr from '#kebab/sys/ctr.js';
15
15
  export declare enum ESERVICE {
16
16
  /** --- 阿里中国大陆区 --- */
17
17
  'ALICN' = 0,
18
- /** --- 阿里国际区 --- */
18
+ /** --- 阿里新加坡 --- */
19
19
  'ALIAS' = 1,
20
+ /** --- 阿里美国 --- */
21
+ 'ALINE' = 2,
20
22
  /** --- 微软 Azure --- */
21
- 'AZURE' = 2,
23
+ 'AZURE' = 3,
22
24
  /** --- 微软 Azure 2 --- */
23
- 'AZURE2' = 3,
25
+ 'AZURE2' = 4,
24
26
  /** --- 微软 Azure 3 --- */
25
- 'AZURE3' = 4,
27
+ 'AZURE3' = 5,
26
28
  /** --- Gemini --- */
27
- 'GEMINI' = 5,
29
+ 'GEMINI' = 6,
28
30
  /** --- Grok --- */
29
- 'GROK' = 6,
31
+ 'GROK' = 7,
30
32
  /** --- 火山引擎中国大陆区 --- */
31
- 'VOLCN' = 7,
33
+ 'VOLCN' = 8,
32
34
  /** --- 火山引擎国际区 --- */
33
- 'VOLAS' = 8
35
+ 'VOLAS' = 9
34
36
  }
35
37
  /** --- 选项 --- */
36
38
  export interface IOptions {
@@ -64,7 +66,7 @@ export declare class Ai {
64
66
  'model': string;
65
67
  /** --- 提示词 --- */
66
68
  'prompt': string;
67
- /** --- 参考图,请注意模型是否支持,以及是否支持多张,仅支持 ALICN、ALIAS、VOLCN、VOLAS 服务商 --- */
69
+ /** --- 参考图,请注意模型是否支持,以及是否支持多张,仅支持 ALICN、ALIAS、ALINE、VOLCN、VOLAS 服务商 --- */
68
70
  'imgs'?: string[];
69
71
  /** --- 模型是否自动优化提示词,默认为 false,但有些服务商可能无效 --- */
70
72
  'extend'?: boolean;
@@ -87,7 +89,7 @@ export declare class Ai {
87
89
  /** --- 请求编号 --- */
88
90
  'request': string;
89
91
  } | false>;
90
- /** --- 异步生成视频,仅支持 ALICN、ALIAS --- */
92
+ /** --- 异步生成视频,仅支持 ALICN、ALIAS、ALINE --- */
91
93
  video(opt: {
92
94
  'model': string;
93
95
  /** --- 提示词,参考类可用 [I1] 指代图片,如 `[I1] 看向 [I2]` --- */
package/lib/ai.js CHANGED
@@ -16,22 +16,24 @@ export var ESERVICE;
16
16
  (function (ESERVICE) {
17
17
  /** --- 阿里中国大陆区 --- */
18
18
  ESERVICE[ESERVICE["ALICN"] = 0] = "ALICN";
19
- /** --- 阿里国际区 --- */
19
+ /** --- 阿里新加坡 --- */
20
20
  ESERVICE[ESERVICE["ALIAS"] = 1] = "ALIAS";
21
+ /** --- 阿里美国 --- */
22
+ ESERVICE[ESERVICE["ALINE"] = 2] = "ALINE";
21
23
  /** --- 微软 Azure --- */
22
- ESERVICE[ESERVICE["AZURE"] = 2] = "AZURE";
24
+ ESERVICE[ESERVICE["AZURE"] = 3] = "AZURE";
23
25
  /** --- 微软 Azure 2 --- */
24
- ESERVICE[ESERVICE["AZURE2"] = 3] = "AZURE2";
26
+ ESERVICE[ESERVICE["AZURE2"] = 4] = "AZURE2";
25
27
  /** --- 微软 Azure 3 --- */
26
- ESERVICE[ESERVICE["AZURE3"] = 4] = "AZURE3";
28
+ ESERVICE[ESERVICE["AZURE3"] = 5] = "AZURE3";
27
29
  /** --- Gemini --- */
28
- ESERVICE[ESERVICE["GEMINI"] = 5] = "GEMINI";
30
+ ESERVICE[ESERVICE["GEMINI"] = 6] = "GEMINI";
29
31
  /** --- Grok --- */
30
- ESERVICE[ESERVICE["GROK"] = 6] = "GROK";
32
+ ESERVICE[ESERVICE["GROK"] = 7] = "GROK";
31
33
  /** --- 火山引擎中国大陆区 --- */
32
- ESERVICE[ESERVICE["VOLCN"] = 7] = "VOLCN";
34
+ ESERVICE[ESERVICE["VOLCN"] = 8] = "VOLCN";
33
35
  /** --- 火山引擎国际区 --- */
34
- ESERVICE[ESERVICE["VOLAS"] = 8] = "VOLAS";
36
+ ESERVICE[ESERVICE["VOLAS"] = 9] = "VOLAS";
35
37
  })(ESERVICE || (ESERVICE = {}));
36
38
  /** --- openai 的连接对象 --- */
37
39
  const links = [];
@@ -64,6 +66,10 @@ export class Ai {
64
66
  endpoint = opt.endpoint ?? `https://dashscope-intl.aliyuncs.com/compatible-mode/v1`;
65
67
  break;
66
68
  }
69
+ case ESERVICE.ALINE: {
70
+ endpoint = opt.endpoint ?? `https://dashscope-us.aliyuncs.com/compatible-mode/v1`;
71
+ break;
72
+ }
67
73
  case ESERVICE.AZURE: {
68
74
  endpoint = opt.endpoint ?? configAi.endpoint ?? '';
69
75
  break;
@@ -148,9 +154,10 @@ export class Ai {
148
154
  const seed = opt.seed ?? lCore.rand(0, 2147483647);
149
155
  switch (this._service) {
150
156
  case ESERVICE.ALICN:
151
- case ESERVICE.ALIAS: {
157
+ case ESERVICE.ALIAS:
158
+ case ESERVICE.ALINE: {
152
159
  try {
153
- const res = await this._fetch(`https://dashscope${this._service === ESERVICE.ALIAS ? '-intl' : ''}.aliyuncs.com/api/v1/services/aigc/multimodal-generation/generation`, {
160
+ const res = await this._fetch(`https://dashscope${this._service === ESERVICE.ALIAS ? '-intl' : (this._service === ESERVICE.ALINE ? '-us' : '')}.aliyuncs.com/api/v1/services/aigc/multimodal-generation/generation`, {
154
161
  'method': 'POST',
155
162
  'headers': {
156
163
  'authorization': `Bearer ${this.link.apiKey}`,
@@ -295,9 +302,9 @@ export class Ai {
295
302
  }
296
303
  }
297
304
  }
298
- /** --- 异步生成视频,仅支持 ALICN、ALIAS --- */
305
+ /** --- 异步生成视频,仅支持 ALICN、ALIAS、ALINE --- */
299
306
  async video(opt) {
300
- if (this._service !== ESERVICE.ALICN && this._service !== ESERVICE.ALIAS) {
307
+ if (this._service !== ESERVICE.ALICN && this._service !== ESERVICE.ALIAS && this._service !== ESERVICE.ALINE) {
301
308
  return false;
302
309
  }
303
310
  const mode = opt.mode ?? 'text';
@@ -373,7 +380,7 @@ export class Ai {
373
380
  }
374
381
  }
375
382
  try {
376
- const res = await this._fetch(`https://dashscope${this._service === ESERVICE.ALIAS ? '-intl' : ''}.aliyuncs.com/api/v1/services/aigc/video-generation/video-synthesis`, {
383
+ const res = await this._fetch(`https://dashscope${this._service === ESERVICE.ALIAS ? '-intl' : (this._service === ESERVICE.ALINE ? '-us' : '')}.aliyuncs.com/api/v1/services/aigc/video-generation/video-synthesis`, {
377
384
  'method': 'POST',
378
385
  'headers': {
379
386
  'authorization': `Bearer ${this.link.apiKey}`,
@@ -432,11 +439,11 @@ export class Ai {
432
439
  }
433
440
  /** --- 轮询任务 --- */
434
441
  async poll(opt) {
435
- if (this._service !== ESERVICE.ALICN && this._service !== ESERVICE.ALIAS) {
442
+ if (this._service !== ESERVICE.ALICN && this._service !== ESERVICE.ALIAS && this._service !== ESERVICE.ALINE) {
436
443
  return false;
437
444
  }
438
445
  try {
439
- const res = await this._fetch(`https://dashscope${this._service === ESERVICE.ALIAS ? '-intl' : ''}.aliyuncs.com/api/v1/tasks/${opt.task}`, {
446
+ const res = await this._fetch(`https://dashscope${this._service === ESERVICE.ALIAS ? '-intl' : (this._service === ESERVICE.ALINE ? '-us' : '')}.aliyuncs.com/api/v1/tasks/${opt.task}`, {
440
447
  'method': 'GET',
441
448
  'headers': {
442
449
  'authorization': `Bearer ${this.link.apiKey}`,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@maiyunnet/kebab",
3
- "version": "9.0.0",
3
+ "version": "9.0.2",
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/cmd.js CHANGED
@@ -172,6 +172,8 @@ async function run() {
172
172
  config.ai['ALICN'].skey ??= '';
173
173
  config.ai['ALIAS'] ??= {};
174
174
  config.ai['ALIAS'].skey ??= '';
175
+ config.ai['ALINE'] ??= {};
176
+ config.ai['ALINE'].skey ??= '';
175
177
  config.ai['AZURE'] ??= {};
176
178
  config.ai['AZURE'].endpoint ??= '';
177
179
  config.ai['AZURE'].skey ??= '';
package/sys/ctr.d.ts CHANGED
@@ -318,10 +318,16 @@ export declare class Ctr {
318
318
  /**
319
319
  * --- 获取 formdata 的信息 ---
320
320
  * @param events 文件处理情况
321
+ * @param limits 上传限制
321
322
  */
322
323
  protected _handleFormData(events?: {
323
324
  onfilestart?: (name: string) => boolean | undefined;
324
325
  onfiledata?: (chunk: Buffer) => void;
325
326
  onfileend?: () => void;
327
+ }, limits?: {
328
+ /** --- 单个文件最大字节数 --- */
329
+ 'maxFileSize'?: number;
330
+ /** --- 允许的文件扩展名(含点号),如 ['.jpg', '.png', '.pdf'] --- */
331
+ 'allowedExts'?: string[];
326
332
  }): Promise<boolean>;
327
333
  }
package/sys/ctr.js CHANGED
@@ -833,9 +833,10 @@ export class Ctr {
833
833
  /**
834
834
  * --- 获取 formdata 的信息 ---
835
835
  * @param events 文件处理情况
836
+ * @param limits 上传限制
836
837
  */
837
- async _handleFormData(events = {}) {
838
- const rtn = await sRoute.getFormData(this._req, events);
838
+ async _handleFormData(events = {}, limits = {}) {
839
+ const rtn = await sRoute.getFormData(this._req, events, limits);
839
840
  if (!rtn) {
840
841
  return false;
841
842
  }
package/sys/mod.d.ts CHANGED
@@ -240,6 +240,7 @@ export default class Mod {
240
240
  }): Promise<false | null | (T & Record<string, any>)>;
241
241
  static one(db: lDb.Pool | lDb.Transaction, s: string | kebab.Json, opt: {
242
242
  'ctr'?: sCtr.Ctr;
243
+ 'lock'?: boolean;
243
244
  'pre'?: string;
244
245
  'index'?: string | string[];
245
246
  'select'?: string | string[];
@@ -248,6 +249,7 @@ export default class Mod {
248
249
  }): Promise<false | null | Record<string, any>>;
249
250
  static one<T extends Mod>(db: lDb.Pool | lDb.Transaction, s: string | kebab.Json, opt?: {
250
251
  'ctr'?: sCtr.Ctr;
252
+ 'lock'?: boolean;
251
253
  'pre'?: string;
252
254
  'index'?: string | string[];
253
255
  'select'?: string | string[];
@@ -262,6 +264,7 @@ export default class Mod {
262
264
  */
263
265
  static oneArray(db: lDb.Pool | lDb.Transaction, s: string | kebab.Json, opt?: {
264
266
  'ctr'?: sCtr.Ctr;
267
+ 'lock'?: boolean;
265
268
  'pre'?: string;
266
269
  'index'?: string | string[];
267
270
  'select'?: string | string[];
package/sys/mod.js CHANGED
@@ -444,7 +444,7 @@ export default class Mod {
444
444
  * --- 通过 where 条件筛选单条数据 ---
445
445
  * @param db 数据库对象
446
446
  * @param s 筛选条件数组或字符串
447
- * @param opt 选项
447
+ * @param opt 选项,lock 需确保 where 条件命中索引,否则可能退化为表锁
448
448
  */
449
449
  static async one(db, s, opt = {}) {
450
450
  if (!opt.index) {
@@ -459,7 +459,7 @@ export default class Mod {
459
459
  if (opt.by) {
460
460
  o.by(opt.by[0], opt.by[1]);
461
461
  }
462
- return opt.array ? o.firstArray() : o.first();
462
+ return opt.array ? o.firstArray(opt.lock) : o.first(opt.lock);
463
463
  }
464
464
  const indexs = (typeof opt.index === 'string') ? [opt.index] : [...new Set(opt.index)];
465
465
  for (const item of indexs) {
@@ -474,7 +474,7 @@ export default class Mod {
474
474
  if (opt.by) {
475
475
  row.by(opt.by[0], opt.by[1]);
476
476
  }
477
- const rowr = await (opt.array ? row.firstArray() : row.first());
477
+ const rowr = await (opt.array ? row.firstArray(opt.lock) : row.first(opt.lock));
478
478
  if (rowr) {
479
479
  return rowr;
480
480
  }
@@ -3519,7 +3519,9 @@ rtn.push(reader.readBCDString());</pre>${JSON.stringify(rtn)}`);
3519
3519
  // --- 文生图 ---
3520
3520
  let model = 'z-image-turbo';
3521
3521
  let size = [1280, 720];
3522
- if (ai.service !== lAi.ESERVICE.ALICN && ai.service !== lAi.ESERVICE.ALIAS) {
3522
+ if (ai.service !== lAi.ESERVICE.ALICN &&
3523
+ ai.service !== lAi.ESERVICE.ALIAS &&
3524
+ ai.service !== lAi.ESERVICE.ALINE) {
3523
3525
  switch (ai.service) {
3524
3526
  case lAi.ESERVICE.AZURE:
3525
3527
  case lAi.ESERVICE.AZURE2:
@@ -3562,7 +3564,9 @@ rtn.push(reader.readBCDString());</pre>${JSON.stringify(rtn)}`);
3562
3564
  let model = 'wan2.6-image';
3563
3565
  let size = [1280, 720];
3564
3566
  const prompt = '用图1的绘画风格重绘图2的场景,桌上增加一盘番茄炒蛋';
3565
- if (ai.service !== lAi.ESERVICE.ALICN && ai.service !== lAi.ESERVICE.ALIAS) {
3567
+ if (ai.service !== lAi.ESERVICE.ALICN &&
3568
+ ai.service !== lAi.ESERVICE.ALIAS &&
3569
+ ai.service !== lAi.ESERVICE.ALINE) {
3566
3570
  switch (ai.service) {
3567
3571
  default: {
3568
3572
  // --- 火山引擎 ---