@huyooo/ui 0.13.6 → 0.13.9

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.
Files changed (54) hide show
  1. package/dist/{AuthkitAppSetting-EL2ZvAVT.js → AuthkitAppSetting-Xe-QQSQ4.js} +405 -408
  2. package/dist/{AuthkitGithubBinding-Ba9sbNEh.js → AuthkitGithubBinding-CK6ijijV.js} +330 -331
  3. package/dist/{Clipboard-CdJtMvg6.js → Clipboard-C8ncjaAJ.js} +1 -1
  4. package/dist/{Contact-Z2VFVeKK.js → Contact-mb7deQOs.js} +2 -2
  5. package/dist/CustomTable-BT-cnhLR.js +280 -0
  6. package/dist/{FeedbackItem-B_MDdk4s.js → FeedbackItem-C9FQThXG.js} +3 -3
  7. package/dist/{FeedbackModal-qrcBDDQM.js → FeedbackModal-R3NKRxr7.js} +3 -3
  8. package/dist/{MessageHandle-Y96z-IXv.js → MessageHandle-CVueKPFG.js} +2 -2
  9. package/dist/{MessageNoticeNotificationsDetails.vue_vue_type_script_setup_true_lang-CfmjFcay.js → MessageNoticeNotificationsDetails.vue_vue_type_script_setup_true_lang-DL4qP8DA.js} +2 -2
  10. package/dist/{PaySubscriptions-C75OtmYw.js → PaySubscriptions-BkZaeTgv.js} +5 -5
  11. package/dist/{PricingPlans-DCYIVuuT.js → PricingPlans-B-GWpft_.js} +4 -4
  12. package/dist/{ReferrerReferees-8eSsuPfa.js → ReferrerReferees-DFCwvXJ6.js} +5 -5
  13. package/dist/{Upload.vue_vue_type_script_setup_true_lang-BAibfVEN.js → Upload.vue_vue_type_script_setup_true_lang-dLSky4Yx.js} +1 -1
  14. package/dist/{UserMenuInvitationsItem.vue_vue_type_script_setup_true_lang-BEVmBNlU.js → UserMenuInvitationsItem.vue_vue_type_script_setup_true_lang-Iwq1MOFa.js} +33 -34
  15. package/dist/WidthContainer-jOX17pDu.js +691 -0
  16. package/dist/api/billingSubscriptionApi.d.ts +3 -0
  17. package/dist/{apiClients-D56ALwwO.js → apiClients-CkI47p36.js} +11 -7
  18. package/dist/authkit.js +9 -9
  19. package/dist/common.js +2 -2
  20. package/dist/composables/Authkit/resolveRoutePermission.d.ts +4 -0
  21. package/dist/composables/Authkit/useAuthkitAppsAuthPageInfo.d.ts +1 -1
  22. package/dist/composables/Authkit/useAuthkitUsersProfile.d.ts +1 -1
  23. package/dist/composables/useMessageList.d.ts +2 -2
  24. package/dist/composables.js +13 -13
  25. package/dist/feedback.js +3 -3
  26. package/dist/main.js +32 -32
  27. package/dist/message.js +3 -3
  28. package/dist/pay.js +4 -4
  29. package/dist/privateCom.js +1 -1
  30. package/dist/referrer.js +1 -1
  31. package/dist/style.css +1 -1
  32. package/dist/types/api/ai.generated.d.ts +3248 -335
  33. package/dist/types/api/billing.generated.d.ts +2162 -500
  34. package/dist/upload.js +2 -2
  35. package/dist/{useAuthkitAppsAuthPageInfo-RMs8sOwk.js → useAuthkitAppsAuthPageInfo-nCjfAjiw.js} +17 -7
  36. package/dist/{useAuthkitAuth-B8aO6aMa.js → useAuthkitAuth-C--qS6UE.js} +1 -1
  37. package/dist/useAuthkitCreateAndUpdate-u-ceTc-m.js +25 -0
  38. package/dist/useAuthkitUsersProfile-BC5EsA2f.js +40 -0
  39. package/dist/useBillingStatusOptions-D5Ehwtbj.js +145 -0
  40. package/dist/{useDownloads-DqF1USJ7.js → useDownloads-BC0QyEFr.js} +10 -10
  41. package/dist/{useEnsureAuthenticated-D99GiwEk.js → useEnsureAuthenticated-C4tsSfv6.js} +2 -2
  42. package/dist/{useLegalLinks-DRTOYp3n.js → useLegalLinks-DeXLE-yv.js} +2 -2
  43. package/dist/{useMessageNotifications-CUpk6zCE.js → useMessageNotifications-BMUx5xfX.js} +1 -1
  44. package/dist/{useSEO-CUKPmGRx.js → useSEO-BWAREYk4.js} +238 -227
  45. package/dist/{useSubscriptionCheckout-CAgy1CFj.js → useSubscriptionCheckout-CHAF20s-.js} +102 -108
  46. package/dist/{useTableHandle-CCKjahT0.js → useTableHandle-9alnSWt0.js} +1 -1
  47. package/dist/{useUploadCos-Bxctd4E6.js → useUploadCos-DGPnLOC9.js} +1 -1
  48. package/dist/user.js +1 -1
  49. package/package.json +3 -2
  50. package/dist/CustomTable-BBcd4nNL.js +0 -278
  51. package/dist/WidthContainer-Dqf_-qGk.js +0 -694
  52. package/dist/useAuthkitCreateAndUpdate-DkiLs143.js +0 -25
  53. package/dist/useAuthkitUsersProfile-CWAr0CNv.js +0 -36
  54. package/dist/useBillingStatusOptions-CottFcAr.js +0 -127
@@ -1,4 +1,4 @@
1
- import { ApiResponse, RequestConfig, Client, EdenClient } from '@vafast/api-client';
1
+ import { RequestConfig, Client, EdenClient, RequestBuilder } from '@vafast/api-client';
2
2
  /** API 契约类型 */
3
3
  export type Api = {
4
4
  health: {
@@ -87,6 +87,15 @@ export type Api = {
87
87
  return: any;
88
88
  };
89
89
  };
90
+ manageOptions: {
91
+ /** 管理端表单与筛选用产品选项 */
92
+ post: {
93
+ body: {
94
+ status?: "" | "active" | "archived";
95
+ };
96
+ return: any;
97
+ };
98
+ };
90
99
  updateSort: {
91
100
  /** 批量更新产品排序 */
92
101
  post: {
@@ -99,7 +108,7 @@ export type Api = {
99
108
  return: any;
100
109
  };
101
110
  };
102
- listActive: {
111
+ options: {
103
112
  /** 获取定价页面可用产品列表(公开) */
104
113
  post: {
105
114
  return: any;
@@ -172,21 +181,16 @@ export type Api = {
172
181
  return: any;
173
182
  };
174
183
  };
175
- listByProduct: {
176
- /** 获取指定产品的所有可用价格方案 */
184
+ options: {
185
+ /** 按产品或免费体验筛选可用价格方案 */
177
186
  post: {
178
187
  body: {
179
- productId: string;
188
+ productId?: string;
189
+ freeOnly?: boolean;
180
190
  };
181
191
  return: any;
182
192
  };
183
193
  };
184
- listFreeActive: {
185
- /** 获取当前应用可领取的免费体验价格方案 */
186
- post: {
187
- return: any;
188
- };
189
- };
190
194
  };
191
195
  subscriptions: {
192
196
  create: {
@@ -278,6 +282,15 @@ export type Api = {
278
282
  return: any;
279
283
  };
280
284
  };
285
+ statistics: {
286
+ /** 获取订阅概览页统计数据(状态计数、MRR、产品分布、最近订阅) */
287
+ post: {
288
+ body: {
289
+ recentLimit?: number;
290
+ };
291
+ return: any;
292
+ };
293
+ };
281
294
  history: {
282
295
  /** 查询单个订阅的权益变化历史(管理端) */
283
296
  post: {
@@ -287,6 +300,24 @@ export type Api = {
287
300
  return: any;
288
301
  };
289
302
  };
303
+ historyFind: {
304
+ /** 分页查询订阅权益变化历史(管理端) */
305
+ post: {
306
+ body: {
307
+ current: number;
308
+ pageSize: number;
309
+ where: {
310
+ userId?: string;
311
+ subscriptionId?: string;
312
+ productId?: string;
313
+ action?: string;
314
+ startTime?: string;
315
+ endTime?: string;
316
+ };
317
+ };
318
+ return: any;
319
+ };
320
+ };
290
321
  trend: {
291
322
  /** 获取订阅各状态的历史趋势数据 */
292
323
  post: {
@@ -734,7 +765,8 @@ export type Api = {
734
765
  post: {
735
766
  body: {
736
767
  userId: string;
737
- amount: number;
768
+ amount?: number;
769
+ amountMicro?: number;
738
770
  requestId?: string;
739
771
  description?: string;
740
772
  metadata?: Record<string, unknown>;
@@ -870,7 +902,7 @@ export type Api = {
870
902
  return: any;
871
903
  };
872
904
  };
873
- getTrendChart: {
905
+ trendChart: {
874
906
  /** 获取积分变动趋势图表数据 */
875
907
  post: {
876
908
  body: {
@@ -882,7 +914,7 @@ export type Api = {
882
914
  return: any;
883
915
  };
884
916
  };
885
- getTypeDistributionChart: {
917
+ typeDistributionChart: {
886
918
  /** 获取积分类型分布图表数据 */
887
919
  post: {
888
920
  body: {
@@ -893,7 +925,7 @@ export type Api = {
893
925
  return: any;
894
926
  };
895
927
  };
896
- getRankingChart: {
928
+ rankingChart: {
897
929
  /** 获取用户积分排行榜 */
898
930
  post: {
899
931
  body: {
@@ -1283,13 +1315,13 @@ export type Api = {
1283
1315
  return: any;
1284
1316
  };
1285
1317
  };
1286
- getConfig: {
1318
+ findOne: {
1287
1319
  /** 获取当前预警配置 */
1288
1320
  post: {
1289
1321
  return: any;
1290
1322
  };
1291
1323
  };
1292
- findAlerts: {
1324
+ find: {
1293
1325
  /** 分页查询预警记录 */
1294
1326
  post: {
1295
1327
  body: {
@@ -1317,7 +1349,7 @@ export type Api = {
1317
1349
  };
1318
1350
  consumption: {
1319
1351
  trend: {
1320
- /** 聚合服务消费的趋势数据 */
1352
+ /** 聚合积分消耗趋势 */
1321
1353
  post: {
1322
1354
  body: {
1323
1355
  startDate?: string;
@@ -1328,7 +1360,7 @@ export type Api = {
1328
1360
  };
1329
1361
  };
1330
1362
  overview: {
1331
- /** 聚合服务消费的概览数据 */
1363
+ /** 聚合积分消耗概览 */
1332
1364
  post: {
1333
1365
  body: {
1334
1366
  startDate?: string;
@@ -1338,6 +1370,99 @@ export type Api = {
1338
1370
  };
1339
1371
  };
1340
1372
  };
1373
+ billingUsage: {
1374
+ charges: {
1375
+ find: {
1376
+ /** 查询 billingUsageRecord 全站扣费明细 */
1377
+ post: {
1378
+ body: {
1379
+ where?: {
1380
+ keyword?: string;
1381
+ userId?: string;
1382
+ serviceGroup?: "ai" | "platform" | "storage";
1383
+ businessLineKey?: string;
1384
+ billingProductLineKey?: string;
1385
+ serviceKey?: string;
1386
+ serviceKeys?: string[];
1387
+ meterKey?: string;
1388
+ priceListId?: string;
1389
+ pricingType?: "flat" | "tiered" | "meters";
1390
+ subjectKey?: string;
1391
+ id?: string;
1392
+ idempotencyKey?: string;
1393
+ resourceId?: string;
1394
+ status?: "pending" | "charged" | "failed" | "canceled";
1395
+ startDate?: string;
1396
+ endDate?: string;
1397
+ };
1398
+ page?: number;
1399
+ pageSize?: number;
1400
+ };
1401
+ return: any;
1402
+ };
1403
+ };
1404
+ findOne: {
1405
+ /** 按 ID 查询单条扣费记录(含 AI 扩展字段,供详情抽屉) */
1406
+ post: {
1407
+ body: {
1408
+ id: string;
1409
+ };
1410
+ return: any;
1411
+ };
1412
+ };
1413
+ };
1414
+ consumption: {
1415
+ overview: {
1416
+ /** 聚合已入账扣费结果 */
1417
+ post: {
1418
+ body: {
1419
+ where?: {
1420
+ userId?: string;
1421
+ serviceGroup?: "ai" | "platform" | "storage";
1422
+ businessLineKey?: string;
1423
+ billingProductLineKey?: string;
1424
+ serviceKey?: string;
1425
+ serviceKeys?: string[];
1426
+ startDate?: string;
1427
+ endDate?: string;
1428
+ };
1429
+ };
1430
+ return: any;
1431
+ };
1432
+ };
1433
+ trend: {
1434
+ /** 按日聚合积分消耗趋势 */
1435
+ post: {
1436
+ body: {
1437
+ where?: {
1438
+ userId?: string;
1439
+ serviceGroup?: "ai" | "platform" | "storage";
1440
+ businessLineKey?: string;
1441
+ billingProductLineKey?: string;
1442
+ serviceKey?: string;
1443
+ serviceKeys?: string[];
1444
+ startDate?: string;
1445
+ endDate?: string;
1446
+ };
1447
+ limit?: number;
1448
+ };
1449
+ return: any;
1450
+ };
1451
+ };
1452
+ };
1453
+ reference: {
1454
+ trace: {
1455
+ /** 按 resourceId 查询扣费明细与积分流水 */
1456
+ post: {
1457
+ body: {
1458
+ resourceId: string;
1459
+ serviceKey?: string;
1460
+ };
1461
+ return: any;
1462
+ };
1463
+ };
1464
+ };
1465
+ };
1341
1466
  pointsRecharge: {
1342
1467
  packages: {
1343
1468
  /** 获取可用的充值套餐列表 */
@@ -1391,7 +1516,7 @@ export type Api = {
1391
1516
  return: any;
1392
1517
  };
1393
1518
  };
1394
- detail: {
1519
+ findOne: {
1395
1520
  /** 管理端查询单个积分充值订单详情及操作时间线 */
1396
1521
  post: {
1397
1522
  body: {
@@ -1446,7 +1571,7 @@ export type Api = {
1446
1571
  };
1447
1572
  };
1448
1573
  rechargePackage: {
1449
- list: {
1574
+ find: {
1450
1575
  /** 获取充值套餐列表(管理端) */
1451
1576
  post: {
1452
1577
  body: {
@@ -1562,7 +1687,7 @@ export type Api = {
1562
1687
  return: any;
1563
1688
  };
1564
1689
  };
1565
- list: {
1690
+ find: {
1566
1691
  /** 查询退款记录列表 */
1567
1692
  post: {
1568
1693
  body: {
@@ -1577,7 +1702,7 @@ export type Api = {
1577
1702
  return: any;
1578
1703
  };
1579
1704
  };
1580
- detail: {
1705
+ findOne: {
1581
1706
  /** 查询单个退款单详情 */
1582
1707
  post: {
1583
1708
  body: {
@@ -1613,12 +1738,14 @@ export type Api = {
1613
1738
  };
1614
1739
  };
1615
1740
  serviceDefinition: {
1616
- list: {
1741
+ find: {
1617
1742
  /** 获取应用的所有服务定义 */
1618
1743
  post: {
1619
1744
  body: {
1620
1745
  page?: number;
1621
1746
  pageSize?: number;
1747
+ keyword?: string;
1748
+ enabled?: boolean;
1622
1749
  };
1623
1750
  return: any;
1624
1751
  };
@@ -1630,8 +1757,6 @@ export type Api = {
1630
1757
  serviceType: string;
1631
1758
  name: string;
1632
1759
  description?: string;
1633
- billingUnit: string;
1634
- billingMode?: "event" | "continuous";
1635
1760
  };
1636
1761
  return: any;
1637
1762
  };
@@ -1643,8 +1768,6 @@ export type Api = {
1643
1768
  id: string;
1644
1769
  name?: string;
1645
1770
  description?: string;
1646
- billingUnit?: string;
1647
- billingMode?: "event" | "continuous";
1648
1771
  enabled?: boolean;
1649
1772
  };
1650
1773
  return: any;
@@ -1660,43 +1783,16 @@ export type Api = {
1660
1783
  };
1661
1784
  };
1662
1785
  };
1663
- pricingRule: {
1664
- get: {
1665
- /** 获取服务的定价规则 */
1666
- post: {
1667
- body: {
1668
- serviceType: string;
1669
- };
1670
- return: any;
1671
- };
1672
- };
1673
- save: {
1674
- /** 创建或更新定价规则 */
1675
- post: {
1676
- body: {
1677
- serviceType: string;
1678
- tiers?: {
1679
- minUsage: number;
1680
- maxUsage: number | null;
1681
- pricePerUnit: number;
1682
- }[];
1683
- flatPrice?: number | null;
1684
- freeQuota?: number;
1685
- profitMargin?: number;
1686
- enabled?: boolean;
1687
- };
1688
- return: any;
1689
- };
1690
- };
1691
- };
1692
1786
  usage: {
1693
1787
  report: {
1694
1788
  /** 上报服务用量,自动计费扣费 */
1695
1789
  post: {
1696
1790
  body: {
1697
1791
  serviceType: string;
1792
+ priceListId?: string;
1698
1793
  metadata: Record<string, unknown>;
1699
- requestId?: string;
1794
+ idempotencyKey?: string;
1795
+ resourceId?: string;
1700
1796
  };
1701
1797
  return: any;
1702
1798
  };
@@ -1706,6 +1802,7 @@ export type Api = {
1706
1802
  post: {
1707
1803
  body: {
1708
1804
  serviceType: string;
1805
+ priceListId?: string;
1709
1806
  metadata: Record<string, unknown>;
1710
1807
  freeQuotaOverride?: number;
1711
1808
  };
@@ -1719,6 +1816,7 @@ export type Api = {
1719
1816
  startDate?: string;
1720
1817
  endDate?: string;
1721
1818
  serviceType?: string;
1819
+ userId?: string;
1722
1820
  groupBy?: "day" | "service" | "user";
1723
1821
  };
1724
1822
  return: any;
@@ -1730,7 +1828,11 @@ export type Api = {
1730
1828
  body: {
1731
1829
  page?: number;
1732
1830
  pageSize?: number;
1733
- serviceType?: string;
1831
+ id?: string;
1832
+ idempotencyKey?: string;
1833
+ resourceId?: string;
1834
+ serviceKey?: string;
1835
+ userId?: string;
1734
1836
  startDate?: string;
1735
1837
  endDate?: string;
1736
1838
  };
@@ -1738,111 +1840,207 @@ export type Api = {
1738
1840
  };
1739
1841
  };
1740
1842
  };
1741
- export: {
1742
- recharge: {
1743
- /** 导出充值订单记录为 CSV 格式 */
1843
+ priceList: {
1844
+ find: {
1744
1845
  post: {
1745
1846
  body: {
1746
- startDate?: string;
1747
- endDate?: string;
1748
- status?: string;
1847
+ where?: {
1848
+ priceListId?: string;
1849
+ businessLineKey?: string;
1850
+ billingProductLineKey?: string;
1851
+ serviceKey?: string;
1852
+ meterKey?: string;
1853
+ pricingType?: "flat" | "tiered" | "meters";
1854
+ keyword?: string;
1855
+ enabled?: boolean;
1856
+ };
1857
+ page?: number;
1858
+ pageSize?: number;
1749
1859
  };
1750
1860
  return: any;
1751
1861
  };
1752
1862
  };
1753
- refund: {
1754
- /** 导出退款记录为 CSV 格式 */
1863
+ findOne: {
1755
1864
  post: {
1756
1865
  body: {
1757
- startDate?: string;
1758
- endDate?: string;
1759
- status?: string;
1866
+ id: string;
1760
1867
  };
1761
1868
  return: any;
1762
1869
  };
1763
1870
  };
1764
- pointsHistory: {
1765
- /** 导出积分变动记录为 CSV 格式 */
1871
+ options: {
1872
+ /** 筛选项、绑价表单 Select 用价目表下拉 */
1766
1873
  post: {
1767
1874
  body: {
1768
- startDate?: string;
1769
- endDate?: string;
1770
- type?: string;
1771
- userId?: string;
1875
+ businessLineKey?: string;
1876
+ billingProductLineKey?: string;
1877
+ serviceKey?: string;
1878
+ pricingType?: "flat" | "tiered" | "meters";
1879
+ enabled?: boolean;
1772
1880
  };
1773
1881
  return: any;
1774
1882
  };
1775
1883
  };
1776
- };
1777
- financeReport: {
1778
- overview: {
1779
- /** 获取收入概览数据 */
1884
+ previewSchema: {
1885
+ /** 由所选计费项生成填价表单结构 */
1780
1886
  post: {
1781
1887
  body: {
1782
- startDate?: string;
1783
- endDate?: string;
1888
+ businessLineKey: string;
1889
+ serviceKey: string;
1890
+ meterRefs: {
1891
+ businessLineKey: string;
1892
+ serviceKey: string;
1893
+ meterKey: string;
1894
+ }[];
1784
1895
  };
1785
1896
  return: any;
1786
1897
  };
1787
1898
  };
1788
- trend: {
1789
- /** 获取收入趋势数据(按日/周/月) */
1899
+ create: {
1790
1900
  post: {
1791
1901
  body: {
1792
- period: "day" | "week" | "month";
1793
- days?: number;
1902
+ businessLineKey: string;
1903
+ serviceKey: string;
1904
+ meterRefs?: {
1905
+ businessLineKey: string;
1906
+ serviceKey: string;
1907
+ meterKey: string;
1908
+ }[];
1909
+ name: string;
1910
+ currency?: "CNY" | "USD";
1911
+ enabled?: boolean;
1912
+ pricingValues: {
1913
+ type: "flat";
1914
+ originalPrice: number;
1915
+ sellPrice: number;
1916
+ } | {
1917
+ type: "tiered";
1918
+ priceStructure: "flat" | "segmented";
1919
+ tiers: {
1920
+ match?: Record<string, string>;
1921
+ tierRangeMode?: "at_most" | "at_least" | "between";
1922
+ minTokens?: number;
1923
+ maxTokens?: number;
1924
+ minInclusive?: boolean;
1925
+ maxInclusive?: boolean;
1926
+ originalFenPerUnit: number;
1927
+ sellFenPerUnit: number;
1928
+ billingEnabled: boolean;
1929
+ }[];
1930
+ } | {
1931
+ type: "meters";
1932
+ meters: {
1933
+ componentKey: string;
1934
+ businessLineKey: string;
1935
+ serviceKey: string;
1936
+ meterKey: string;
1937
+ tiers: {
1938
+ match?: Record<string, string>;
1939
+ tierRangeMode?: "at_most" | "at_least" | "between";
1940
+ minTokens?: number;
1941
+ maxTokens?: number;
1942
+ minInclusive?: boolean;
1943
+ maxInclusive?: boolean;
1944
+ originalFenPerUnit: number;
1945
+ sellFenPerUnit: number;
1946
+ billingEnabled: boolean;
1947
+ }[];
1948
+ }[];
1949
+ };
1794
1950
  };
1795
1951
  return: any;
1796
1952
  };
1797
1953
  };
1798
- packageRank: {
1799
- /** 获取套餐销售排行数据 */
1954
+ update: {
1800
1955
  post: {
1801
1956
  body: {
1802
- startDate?: string;
1803
- endDate?: string;
1804
- limit?: number;
1957
+ id: string;
1958
+ name?: string;
1959
+ currency?: "CNY" | "USD";
1960
+ enabled?: boolean;
1961
+ meterRefs?: {
1962
+ businessLineKey: string;
1963
+ serviceKey: string;
1964
+ meterKey: string;
1965
+ }[];
1966
+ pricingValues?: {
1967
+ type: "flat";
1968
+ originalPrice: number;
1969
+ sellPrice: number;
1970
+ } | {
1971
+ type: "tiered";
1972
+ priceStructure: "flat" | "segmented";
1973
+ tiers: {
1974
+ match?: Record<string, string>;
1975
+ tierRangeMode?: "at_most" | "at_least" | "between";
1976
+ minTokens?: number;
1977
+ maxTokens?: number;
1978
+ minInclusive?: boolean;
1979
+ maxInclusive?: boolean;
1980
+ originalFenPerUnit: number;
1981
+ sellFenPerUnit: number;
1982
+ billingEnabled: boolean;
1983
+ }[];
1984
+ } | {
1985
+ type: "meters";
1986
+ meters: {
1987
+ componentKey: string;
1988
+ businessLineKey: string;
1989
+ serviceKey: string;
1990
+ meterKey: string;
1991
+ tiers: {
1992
+ match?: Record<string, string>;
1993
+ tierRangeMode?: "at_most" | "at_least" | "between";
1994
+ minTokens?: number;
1995
+ maxTokens?: number;
1996
+ minInclusive?: boolean;
1997
+ maxInclusive?: boolean;
1998
+ originalFenPerUnit: number;
1999
+ sellFenPerUnit: number;
2000
+ billingEnabled: boolean;
2001
+ }[];
2002
+ }[];
2003
+ };
1805
2004
  };
1806
2005
  return: any;
1807
2006
  };
1808
2007
  };
1809
- userRank: {
1810
- /** 获取用户充值排行数据 */
2008
+ delete: {
1811
2009
  post: {
1812
2010
  body: {
1813
- startDate?: string;
1814
- endDate?: string;
1815
- limit?: number;
2011
+ id: string;
1816
2012
  };
1817
2013
  return: any;
1818
2014
  };
1819
2015
  };
1820
2016
  };
1821
- reconciliation: {
1822
- generate: {
1823
- /** 生成指定日期的对账报告 */
2017
+ priceBinding: {
2018
+ find: {
1824
2019
  post: {
1825
2020
  body: {
1826
- date: string;
2021
+ where?: {
2022
+ subjectType?: "model-profile";
2023
+ subjectKey?: string;
2024
+ serviceKey?: string;
2025
+ businessLineKey?: string;
2026
+ enabled?: boolean;
2027
+ };
1827
2028
  };
1828
2029
  return: any;
1829
2030
  };
1830
2031
  };
1831
- list: {
1832
- /** 查询对账报告列表 */
2032
+ upsert: {
1833
2033
  post: {
1834
2034
  body: {
1835
- page?: number;
1836
- pageSize?: number;
1837
- status?: string;
1838
- startDate?: string;
1839
- endDate?: string;
2035
+ subjectType: "model-profile";
2036
+ subjectKey: string;
2037
+ priceListId: string;
2038
+ enabled?: boolean;
1840
2039
  };
1841
2040
  return: any;
1842
2041
  };
1843
2042
  };
1844
- detail: {
1845
- /** 查询对账报告详情 */
2043
+ delete: {
1846
2044
  post: {
1847
2045
  body: {
1848
2046
  id: string;
@@ -1850,117 +2048,634 @@ export type Api = {
1850
2048
  return: any;
1851
2049
  };
1852
2050
  };
1853
- processAnomaly: {
1854
- /** 处理对账异常订单 */
2051
+ };
2052
+ businessLine: {
2053
+ find: {
1855
2054
  post: {
1856
2055
  body: {
1857
- reportId: string;
1858
- orderId: string;
1859
- action: "confirm_paid" | "mark_cancelled" | "ignore";
1860
- remark?: string;
2056
+ where?: {
2057
+ keyword?: string;
2058
+ enabled?: boolean;
2059
+ };
2060
+ withStats?: boolean;
2061
+ page?: number;
2062
+ pageSize?: number;
1861
2063
  };
1862
2064
  return: any;
1863
2065
  };
1864
2066
  };
1865
- batchGenerate: {
1866
- /** 批量生成指定日期范围的对账报告 */
2067
+ findOne: {
1867
2068
  post: {
1868
2069
  body: {
1869
- startDate: string;
1870
- endDate: string;
2070
+ businessLineKey: string;
1871
2071
  };
1872
2072
  return: any;
1873
2073
  };
1874
2074
  };
1875
- };
1876
- invoice: {
1877
- apply: {
1878
- /** 申请开具发票 */
2075
+ options: {
2076
+ /** 筛选项、表单 Select 用业务线下拉 */
1879
2077
  post: {
1880
2078
  body: {
1881
- invoiceType: "personal" | "company" | "vat_special";
1882
- title: string;
1883
- taxNumber?: string;
1884
- companyAddress?: string;
1885
- companyPhone?: string;
1886
- bankName?: string;
1887
- bankAccount?: string;
1888
- email: string;
1889
- receiverName?: string;
1890
- receiverPhone?: string;
1891
- receiverAddress?: string;
1892
- orderIds?: string[];
1893
- remark?: string;
2079
+ enabled?: boolean;
1894
2080
  };
1895
2081
  return: any;
1896
2082
  };
1897
2083
  };
1898
- list: {
1899
- /** 查询发票申请列表 */
2084
+ create: {
1900
2085
  post: {
1901
2086
  body: {
1902
- page?: number;
1903
- pageSize?: number;
1904
- status?: string;
1905
- userId?: string;
1906
- startDate?: string;
1907
- endDate?: string;
2087
+ businessLineKey: string;
2088
+ label: string;
1908
2089
  };
1909
2090
  return: any;
1910
2091
  };
1911
2092
  };
1912
- detail: {
1913
- /** 查询发票详情 */
2093
+ update: {
1914
2094
  post: {
1915
2095
  body: {
1916
- invoiceNo: string;
2096
+ businessLineKey: string;
2097
+ label?: string;
2098
+ enabled?: boolean;
1917
2099
  };
1918
2100
  return: any;
1919
2101
  };
1920
2102
  };
1921
- review: {
1922
- /** 审核发票申请(通过/拒绝) */
2103
+ delete: {
1923
2104
  post: {
1924
2105
  body: {
1925
- invoiceNo: string;
1926
- action: "approve" | "reject";
1927
- remark?: string;
2106
+ businessLineKey: string;
1928
2107
  };
1929
2108
  return: any;
1930
2109
  };
1931
2110
  };
1932
- issue: {
1933
- /** 标记发票已开具 */
2111
+ };
2112
+ billingProductLine: {
2113
+ find: {
1934
2114
  post: {
1935
2115
  body: {
1936
- invoiceNo: string;
1937
- invoiceCode?: string;
1938
- invoiceNumber?: string;
1939
- invoiceUrl?: string;
2116
+ where?: {
2117
+ businessLineKey?: string;
2118
+ keyword?: string;
2119
+ enabled?: boolean;
2120
+ };
2121
+ withStats?: boolean;
2122
+ page?: number;
2123
+ pageSize?: number;
1940
2124
  };
1941
2125
  return: any;
1942
2126
  };
1943
2127
  };
1944
- stats: {
1945
- /** 获取发票统计数据 */
2128
+ findOne: {
1946
2129
  post: {
1947
2130
  body: {
1948
- startDate?: string;
1949
- endDate?: string;
2131
+ productLineId: string;
1950
2132
  };
1951
2133
  return: any;
1952
2134
  };
1953
2135
  };
1954
- cancel: {
1955
- /** 取消发票申请(仅待审核状态可取消) */
2136
+ options: {
2137
+ /** 筛选项、表单 Select 用产品线下拉 */
1956
2138
  post: {
1957
2139
  body: {
1958
- invoiceNo: string;
2140
+ businessLineKey?: string;
2141
+ enabled?: boolean;
1959
2142
  };
1960
2143
  return: any;
1961
2144
  };
1962
2145
  };
1963
- };
2146
+ create: {
2147
+ post: {
2148
+ body: {
2149
+ businessLineKey: string;
2150
+ productLineKey: string;
2151
+ label: string;
2152
+ };
2153
+ return: any;
2154
+ };
2155
+ };
2156
+ update: {
2157
+ post: {
2158
+ body: {
2159
+ productLineId: string;
2160
+ label?: string;
2161
+ enabled?: boolean;
2162
+ };
2163
+ return: any;
2164
+ };
2165
+ };
2166
+ delete: {
2167
+ post: {
2168
+ body: {
2169
+ productLineId: string;
2170
+ };
2171
+ return: any;
2172
+ };
2173
+ };
2174
+ };
2175
+ billingServiceCatalog: {
2176
+ service: {
2177
+ find: {
2178
+ post: {
2179
+ body: {
2180
+ where?: {
2181
+ businessLineKey?: string;
2182
+ billingProductLineKey?: string;
2183
+ productLine?: string;
2184
+ source?: "builtin" | "custom";
2185
+ serviceKey?: string;
2186
+ keyword?: string;
2187
+ enabled?: boolean;
2188
+ };
2189
+ page?: number;
2190
+ pageSize?: number;
2191
+ };
2192
+ return: any;
2193
+ };
2194
+ };
2195
+ options: {
2196
+ /** 筛选项、表单 Select 用服务下拉 */
2197
+ post: {
2198
+ body: {
2199
+ businessLineKey?: string;
2200
+ billingProductLineKey?: string;
2201
+ enabled?: boolean;
2202
+ };
2203
+ return: any;
2204
+ };
2205
+ };
2206
+ create: {
2207
+ post: {
2208
+ body: {
2209
+ businessLineKey: string;
2210
+ billingProductLineKey: string;
2211
+ serviceType: string;
2212
+ name: string;
2213
+ description?: string;
2214
+ dependencies?: {
2215
+ businessLineKey: string;
2216
+ billingProductLineKey: string;
2217
+ serviceKey: string;
2218
+ meterKeys?: string[];
2219
+ required?: boolean;
2220
+ }[];
2221
+ };
2222
+ return: any;
2223
+ };
2224
+ };
2225
+ update: {
2226
+ post: {
2227
+ body: {
2228
+ businessLineKey: string;
2229
+ serviceKey: string;
2230
+ label?: string;
2231
+ description?: string;
2232
+ billingProductLineKey?: string;
2233
+ dependencies?: {
2234
+ businessLineKey: string;
2235
+ billingProductLineKey: string;
2236
+ serviceKey: string;
2237
+ meterKeys?: string[];
2238
+ required?: boolean;
2239
+ }[];
2240
+ enabled?: boolean;
2241
+ };
2242
+ return: any;
2243
+ };
2244
+ };
2245
+ delete: {
2246
+ post: {
2247
+ body: {
2248
+ businessLineKey: string;
2249
+ serviceKey: string;
2250
+ };
2251
+ return: any;
2252
+ };
2253
+ };
2254
+ };
2255
+ runtime: {
2256
+ export: {
2257
+ /** 前端运行时缓存:服务 + 价目表 operation */
2258
+ post: {
2259
+ return: any;
2260
+ };
2261
+ };
2262
+ };
2263
+ };
2264
+ billingMeter: {
2265
+ find: {
2266
+ post: {
2267
+ body: {
2268
+ where?: {
2269
+ businessLineKey?: string;
2270
+ billingProductLineKey?: string;
2271
+ serviceKey?: string;
2272
+ chargeMode?: "instant" | "settlement";
2273
+ source?: "builtin" | "custom";
2274
+ keyword?: string;
2275
+ enabled?: boolean;
2276
+ };
2277
+ page?: number;
2278
+ pageSize?: number;
2279
+ };
2280
+ return: any;
2281
+ };
2282
+ };
2283
+ options: {
2284
+ post: {
2285
+ body: {
2286
+ businessLineKey?: string;
2287
+ billingProductLineKey?: string;
2288
+ serviceKey?: string;
2289
+ enabled?: boolean;
2290
+ };
2291
+ return: any;
2292
+ };
2293
+ };
2294
+ create: {
2295
+ post: {
2296
+ body: {
2297
+ businessLineKey: string;
2298
+ serviceKey: string;
2299
+ meterKey: string;
2300
+ label: string;
2301
+ description?: string;
2302
+ chargeMode?: "instant" | "settlement";
2303
+ settlementPeriod?: "hour" | "day" | "month";
2304
+ pricingSchema?: {
2305
+ unitLabel: string;
2306
+ quantityScale?: number;
2307
+ priceStructure?: "flat" | "segmented" | "keyed";
2308
+ matchKeys?: {
2309
+ key: string;
2310
+ label: string;
2311
+ values: {
2312
+ value: string;
2313
+ label: string;
2314
+ }[];
2315
+ }[];
2316
+ tiers: {
2317
+ match?: Record<string, string>;
2318
+ tierRangeMode?: "at_most" | "at_least" | "between";
2319
+ minTokens?: number;
2320
+ maxTokens?: number;
2321
+ minInclusive?: boolean;
2322
+ maxInclusive?: boolean;
2323
+ }[];
2324
+ };
2325
+ enabled?: boolean;
2326
+ };
2327
+ return: any;
2328
+ };
2329
+ };
2330
+ update: {
2331
+ post: {
2332
+ body: {
2333
+ id: string;
2334
+ businessLineKey?: string;
2335
+ serviceKey?: string;
2336
+ meterKey?: string;
2337
+ label?: string;
2338
+ description?: string;
2339
+ chargeMode?: "instant" | "settlement";
2340
+ settlementPeriod?: "hour" | "day" | "month";
2341
+ pricingSchema?: {
2342
+ unitLabel: string;
2343
+ quantityScale?: number;
2344
+ priceStructure?: "flat" | "segmented" | "keyed";
2345
+ matchKeys?: {
2346
+ key: string;
2347
+ label: string;
2348
+ values: {
2349
+ value: string;
2350
+ label: string;
2351
+ }[];
2352
+ }[];
2353
+ tiers: {
2354
+ match?: Record<string, string>;
2355
+ tierRangeMode?: "at_most" | "at_least" | "between";
2356
+ minTokens?: number;
2357
+ maxTokens?: number;
2358
+ minInclusive?: boolean;
2359
+ maxInclusive?: boolean;
2360
+ }[];
2361
+ };
2362
+ enabled?: boolean;
2363
+ };
2364
+ return: any;
2365
+ };
2366
+ };
2367
+ delete: {
2368
+ post: {
2369
+ body: {
2370
+ id: string;
2371
+ };
2372
+ return: any;
2373
+ };
2374
+ };
2375
+ };
2376
+ billingMeterChargeItem: {
2377
+ find: {
2378
+ post: {
2379
+ body: {
2380
+ where?: {
2381
+ keyword?: string;
2382
+ userId?: string;
2383
+ businessLineKey?: string;
2384
+ billingProductLineKey?: string;
2385
+ serviceKey?: string;
2386
+ meterKey?: string;
2387
+ priceListId?: string;
2388
+ pricingType?: "flat" | "tiered" | "meters";
2389
+ resourceId?: string;
2390
+ subjectKey?: string;
2391
+ idempotencyKey?: string;
2392
+ billingUsageRecordId?: string;
2393
+ chargeMode?: "instant" | "settlement";
2394
+ status?: "pending" | "accumulating" | "charged" | "failed" | "canceled";
2395
+ startDate?: string;
2396
+ endDate?: string;
2397
+ };
2398
+ page?: number;
2399
+ pageSize?: number;
2400
+ };
2401
+ return: any;
2402
+ };
2403
+ };
2404
+ overview: {
2405
+ post: {
2406
+ body: {
2407
+ where?: {
2408
+ keyword?: string;
2409
+ userId?: string;
2410
+ businessLineKey?: string;
2411
+ billingProductLineKey?: string;
2412
+ serviceKey?: string;
2413
+ meterKey?: string;
2414
+ priceListId?: string;
2415
+ pricingType?: "flat" | "tiered" | "meters";
2416
+ resourceId?: string;
2417
+ subjectKey?: string;
2418
+ idempotencyKey?: string;
2419
+ billingUsageRecordId?: string;
2420
+ chargeMode?: "instant" | "settlement";
2421
+ status?: "pending" | "accumulating" | "charged" | "failed" | "canceled";
2422
+ startDate?: string;
2423
+ endDate?: string;
2424
+ };
2425
+ };
2426
+ return: any;
2427
+ };
2428
+ };
2429
+ trend: {
2430
+ post: {
2431
+ body: {
2432
+ where?: {
2433
+ keyword?: string;
2434
+ userId?: string;
2435
+ businessLineKey?: string;
2436
+ billingProductLineKey?: string;
2437
+ serviceKey?: string;
2438
+ meterKey?: string;
2439
+ priceListId?: string;
2440
+ pricingType?: "flat" | "tiered" | "meters";
2441
+ resourceId?: string;
2442
+ subjectKey?: string;
2443
+ idempotencyKey?: string;
2444
+ billingUsageRecordId?: string;
2445
+ chargeMode?: "instant" | "settlement";
2446
+ status?: "pending" | "accumulating" | "charged" | "failed" | "canceled";
2447
+ startDate?: string;
2448
+ endDate?: string;
2449
+ };
2450
+ limit?: number;
2451
+ };
2452
+ return: any;
2453
+ };
2454
+ };
2455
+ };
2456
+ export: {
2457
+ recharge: {
2458
+ /** 导出充值订单记录为 CSV 格式 */
2459
+ post: {
2460
+ body: {
2461
+ startDate?: string;
2462
+ endDate?: string;
2463
+ status?: string;
2464
+ };
2465
+ return: any;
2466
+ };
2467
+ };
2468
+ refund: {
2469
+ /** 导出退款记录为 CSV 格式 */
2470
+ post: {
2471
+ body: {
2472
+ startDate?: string;
2473
+ endDate?: string;
2474
+ status?: string;
2475
+ };
2476
+ return: any;
2477
+ };
2478
+ };
2479
+ pointsHistory: {
2480
+ /** 导出积分变动记录为 CSV 格式 */
2481
+ post: {
2482
+ body: {
2483
+ startDate?: string;
2484
+ endDate?: string;
2485
+ type?: string;
2486
+ userId?: string;
2487
+ };
2488
+ return: any;
2489
+ };
2490
+ };
2491
+ };
2492
+ financeReport: {
2493
+ overview: {
2494
+ /** 获取收入概览数据 */
2495
+ post: {
2496
+ body: {
2497
+ startDate?: string;
2498
+ endDate?: string;
2499
+ };
2500
+ return: any;
2501
+ };
2502
+ };
2503
+ trend: {
2504
+ /** 获取收入趋势数据(按日/周/月) */
2505
+ post: {
2506
+ body: {
2507
+ period: "day" | "week" | "month";
2508
+ days?: number;
2509
+ };
2510
+ return: any;
2511
+ };
2512
+ };
2513
+ packageRank: {
2514
+ /** 获取套餐销售排行数据 */
2515
+ post: {
2516
+ body: {
2517
+ startDate?: string;
2518
+ endDate?: string;
2519
+ limit?: number;
2520
+ };
2521
+ return: any;
2522
+ };
2523
+ };
2524
+ userRank: {
2525
+ /** 获取用户充值排行数据 */
2526
+ post: {
2527
+ body: {
2528
+ startDate?: string;
2529
+ endDate?: string;
2530
+ limit?: number;
2531
+ };
2532
+ return: any;
2533
+ };
2534
+ };
2535
+ };
2536
+ reconciliation: {
2537
+ generate: {
2538
+ /** 生成指定日期的对账报告 */
2539
+ post: {
2540
+ body: {
2541
+ date: string;
2542
+ };
2543
+ return: any;
2544
+ };
2545
+ };
2546
+ find: {
2547
+ /** 查询对账报告列表 */
2548
+ post: {
2549
+ body: {
2550
+ page?: number;
2551
+ pageSize?: number;
2552
+ status?: string;
2553
+ startDate?: string;
2554
+ endDate?: string;
2555
+ };
2556
+ return: any;
2557
+ };
2558
+ };
2559
+ findOne: {
2560
+ /** 查询对账报告详情 */
2561
+ post: {
2562
+ body: {
2563
+ id: string;
2564
+ };
2565
+ return: any;
2566
+ };
2567
+ };
2568
+ processAnomaly: {
2569
+ /** 处理对账异常订单 */
2570
+ post: {
2571
+ body: {
2572
+ reportId: string;
2573
+ orderId: string;
2574
+ action: "confirm_paid" | "mark_cancelled" | "ignore";
2575
+ remark?: string;
2576
+ };
2577
+ return: any;
2578
+ };
2579
+ };
2580
+ batchGenerate: {
2581
+ /** 批量生成指定日期范围的对账报告 */
2582
+ post: {
2583
+ body: {
2584
+ startDate: string;
2585
+ endDate: string;
2586
+ };
2587
+ return: any;
2588
+ };
2589
+ };
2590
+ };
2591
+ invoice: {
2592
+ apply: {
2593
+ /** 申请开具发票 */
2594
+ post: {
2595
+ body: {
2596
+ invoiceType: "personal" | "company" | "vat_special";
2597
+ title: string;
2598
+ taxNumber?: string;
2599
+ companyAddress?: string;
2600
+ companyPhone?: string;
2601
+ bankName?: string;
2602
+ bankAccount?: string;
2603
+ email: string;
2604
+ receiverName?: string;
2605
+ receiverPhone?: string;
2606
+ receiverAddress?: string;
2607
+ orderIds?: string[];
2608
+ remark?: string;
2609
+ };
2610
+ return: any;
2611
+ };
2612
+ };
2613
+ find: {
2614
+ /** 查询发票申请列表 */
2615
+ post: {
2616
+ body: {
2617
+ page?: number;
2618
+ pageSize?: number;
2619
+ status?: string;
2620
+ userId?: string;
2621
+ startDate?: string;
2622
+ endDate?: string;
2623
+ };
2624
+ return: any;
2625
+ };
2626
+ };
2627
+ findOne: {
2628
+ /** 查询发票详情 */
2629
+ post: {
2630
+ body: {
2631
+ invoiceNo: string;
2632
+ };
2633
+ return: any;
2634
+ };
2635
+ };
2636
+ review: {
2637
+ /** 审核发票申请(通过/拒绝) */
2638
+ post: {
2639
+ body: {
2640
+ invoiceNo: string;
2641
+ action: "approve" | "reject";
2642
+ remark?: string;
2643
+ };
2644
+ return: any;
2645
+ };
2646
+ };
2647
+ issue: {
2648
+ /** 标记发票已开具 */
2649
+ post: {
2650
+ body: {
2651
+ invoiceNo: string;
2652
+ invoiceCode?: string;
2653
+ invoiceNumber?: string;
2654
+ invoiceUrl?: string;
2655
+ };
2656
+ return: any;
2657
+ };
2658
+ };
2659
+ stats: {
2660
+ /** 获取发票统计数据 */
2661
+ post: {
2662
+ body: {
2663
+ startDate?: string;
2664
+ endDate?: string;
2665
+ };
2666
+ return: any;
2667
+ };
2668
+ };
2669
+ cancel: {
2670
+ /** 取消发票申请(仅待审核状态可取消) */
2671
+ post: {
2672
+ body: {
2673
+ invoiceNo: string;
2674
+ };
2675
+ return: any;
2676
+ };
2677
+ };
2678
+ };
1964
2679
  agreement: {
1965
2680
  create: {
1966
2681
  /** 创建支付宝签约代扣授权 */
@@ -2044,7 +2759,9 @@ export type Api = {
2044
2759
  body: {
2045
2760
  appId: string;
2046
2761
  userId: string;
2047
- serviceType: string;
2762
+ businessLineKey: string;
2763
+ serviceKey: string;
2764
+ priceListId: string;
2048
2765
  amount: number;
2049
2766
  freeQuotaOverride?: number;
2050
2767
  };
@@ -2059,7 +2776,9 @@ export type Api = {
2059
2776
  items: {
2060
2777
  key: string;
2061
2778
  userId: string;
2062
- serviceType: string;
2779
+ businessLineKey: string;
2780
+ serviceKey: string;
2781
+ priceListId?: string;
2063
2782
  amount: number;
2064
2783
  freeQuotaOverride?: number;
2065
2784
  }[];
@@ -2073,10 +2792,13 @@ export type Api = {
2073
2792
  body: {
2074
2793
  appId: string;
2075
2794
  userId: string;
2076
- serviceType: string;
2795
+ businessLineKey: string;
2796
+ serviceKey: string;
2797
+ priceListId?: string;
2077
2798
  amount: number;
2078
2799
  metadata?: Record<string, unknown>;
2079
- requestId?: string;
2800
+ idempotencyKey?: string;
2801
+ resourceId?: string;
2080
2802
  usageKind?: "event" | "continuous_settlement";
2081
2803
  periodStart?: string;
2082
2804
  periodEnd?: string;
@@ -2085,6 +2807,196 @@ export type Api = {
2085
2807
  return: any;
2086
2808
  };
2087
2809
  };
2810
+ reversal: {
2811
+ /** 供内部服务冲正已上报的服务用量并退还积分 */
2812
+ post: {
2813
+ body: {
2814
+ appId: string;
2815
+ userId: string;
2816
+ idempotencyKey: string;
2817
+ reason?: string;
2818
+ reversalIdempotencyKey?: string;
2819
+ };
2820
+ return: any;
2821
+ };
2822
+ };
2823
+ 'preview-meter-charge': {
2824
+ /** 供 ai-server 等根据价目表与 meter 用量计算积分 */
2825
+ post: {
2826
+ body: {
2827
+ appId: string;
2828
+ businessLineKey: string;
2829
+ serviceKey: string;
2830
+ priceListId?: string;
2831
+ meterUsage: Record<string, number>;
2832
+ meterMatchContext?: Record<string, Record<string, string>>;
2833
+ meterTierMatchUsage?: Record<string, number>;
2834
+ exchangeRate?: number;
2835
+ };
2836
+ return: any;
2837
+ };
2838
+ };
2839
+ 'record-ai': {
2840
+ /** 供 ai-server 传入 meter 用量,由计费引擎算价并扣积分 */
2841
+ post: {
2842
+ body: {
2843
+ appId: string;
2844
+ userId: string;
2845
+ businessLineKey: string;
2846
+ idempotencyKey: string;
2847
+ serviceKey: string;
2848
+ priceListId: string;
2849
+ resourceId?: string;
2850
+ subjectKey: string;
2851
+ sourceService?: string;
2852
+ sourceType?: string;
2853
+ sourceId?: string;
2854
+ labels?: Record<string, string>;
2855
+ quantity: number;
2856
+ unit: string;
2857
+ meterUsage: Record<string, number>;
2858
+ meterMatchContext?: Record<string, Record<string, string>>;
2859
+ meterTierMatchUsage?: Record<string, number>;
2860
+ exchangeRate?: number;
2861
+ snapshot?: {
2862
+ priceListId?: string;
2863
+ usage?: Record<string, number>;
2864
+ cost?: Record<string, unknown>;
2865
+ };
2866
+ };
2867
+ return: any;
2868
+ };
2869
+ };
2870
+ find: {
2871
+ /** 供 ai-server 等内部服务查询 billingUsageRecord */
2872
+ post: {
2873
+ body: {
2874
+ appId: string;
2875
+ userId?: string;
2876
+ serviceGroup?: "ai" | "platform" | "storage";
2877
+ serviceGroups?: "ai" | "platform" | "storage"[];
2878
+ resourceId?: string;
2879
+ serviceKey?: string;
2880
+ model?: string;
2881
+ subjectKeys?: string[];
2882
+ id?: string;
2883
+ requestId?: string;
2884
+ startTime?: string;
2885
+ endTime?: string;
2886
+ page?: number;
2887
+ pageSize?: number;
2888
+ };
2889
+ return: any;
2890
+ };
2891
+ };
2892
+ 'stats-ai': {
2893
+ /** 供 ai-server 查询 AI 用量聚合统计 */
2894
+ post: {
2895
+ body: {
2896
+ appId: string;
2897
+ userId?: string;
2898
+ subjectKeys?: string[];
2899
+ startTime?: string;
2900
+ endTime?: string;
2901
+ timezone?: string;
2902
+ };
2903
+ return: any;
2904
+ };
2905
+ };
2906
+ 'by-resource': {
2907
+ /** 按 resourceId 联合查询用量与积分流水 */
2908
+ post: {
2909
+ body: {
2910
+ appId: string;
2911
+ resourceId: string;
2912
+ serviceKey?: string;
2913
+ };
2914
+ return: any;
2915
+ };
2916
+ };
2917
+ };
2918
+ pricing: {
2919
+ 'resolve-model': {
2920
+ /** 供 ai-server 运行时读取模型定价 */
2921
+ post: {
2922
+ body: {
2923
+ appId: string;
2924
+ supplierId: string;
2925
+ profileId: string;
2926
+ productLine?: string;
2927
+ billingPlan?: string;
2928
+ };
2929
+ return: any;
2930
+ };
2931
+ };
2932
+ 'sync-model': {
2933
+ post: {
2934
+ body: {
2935
+ appId: string;
2936
+ operatorId: string;
2937
+ supplierId: string;
2938
+ profileId: string;
2939
+ profileName?: string;
2940
+ productLine: string;
2941
+ currency: "CNY" | "USD";
2942
+ plans: unknown[];
2943
+ };
2944
+ return: any;
2945
+ };
2946
+ };
2947
+ 'delete-model': {
2948
+ post: {
2949
+ body: {
2950
+ appId: string;
2951
+ supplierId: string;
2952
+ profileId: string;
2953
+ };
2954
+ return: any;
2955
+ };
2956
+ };
2957
+ 'load-model-plans': {
2958
+ post: {
2959
+ body: {
2960
+ appId: string;
2961
+ supplierId: string;
2962
+ profileId: string;
2963
+ };
2964
+ return: any;
2965
+ };
2966
+ };
2967
+ 'list-model-pricing-map': {
2968
+ post: {
2969
+ body: {
2970
+ appId: string;
2971
+ };
2972
+ return: any;
2973
+ };
2974
+ };
2975
+ };
2976
+ billingCatalog: {
2977
+ list: {
2978
+ /** 服务 + 价目表 operation 列表(供 ai-server 等内部服务) */
2979
+ post: {
2980
+ body: {
2981
+ appId: string;
2982
+ billingProductLineKey?: "ai" | "storage" | "platform";
2983
+ group?: "ai" | "storage" | "platform";
2984
+ };
2985
+ return: any;
2986
+ };
2987
+ };
2988
+ };
2989
+ points: {
2990
+ 'by-request-ids': {
2991
+ /** 供 ai-server 溯源:通过 requestId 列表查询 pointsHistory */
2992
+ post: {
2993
+ body: {
2994
+ appId: string;
2995
+ requestIds: string[];
2996
+ };
2997
+ return: any;
2998
+ };
2999
+ };
2088
3000
  };
2089
3001
  };
2090
3002
  webhooks: {
@@ -2114,11 +3026,11 @@ export type Api = {
2114
3026
  /** API 客户端类型(提供完整的 IDE 智能提示) */
2115
3027
  export interface ApiClient {
2116
3028
  health: {
2117
- get: (config?: RequestConfig) => Promise<ApiResponse<any>>;
3029
+ get: (config?: RequestConfig) => RequestBuilder<any>;
2118
3030
  };
2119
3031
  'api-spec': {
2120
3032
  /** 获取 API 规范,用于类型同步 */
2121
- get: (config?: RequestConfig) => Promise<ApiResponse<any>>;
3033
+ get: (config?: RequestConfig) => RequestBuilder<any>;
2122
3034
  };
2123
3035
  products: {
2124
3036
  create: {
@@ -2136,13 +3048,13 @@ export interface ApiClient {
2136
3048
  }[];
2137
3049
  metadata?: Record<string, unknown>;
2138
3050
  displayOrder?: number;
2139
- }, config?: RequestConfig) => Promise<ApiResponse<any>>;
3051
+ }, config?: RequestConfig) => RequestBuilder<any>;
2140
3052
  };
2141
3053
  delete: {
2142
3054
  /** 删除产品 */
2143
3055
  post: (body: {
2144
3056
  id: string;
2145
- }, config?: RequestConfig) => Promise<ApiResponse<any>>;
3057
+ }, config?: RequestConfig) => RequestBuilder<any>;
2146
3058
  };
2147
3059
  update: {
2148
3060
  /** 更新产品信息 */
@@ -2161,7 +3073,7 @@ export interface ApiClient {
2161
3073
  status?: "active" | "archived";
2162
3074
  metadata?: Record<string, unknown>;
2163
3075
  displayOrder?: number;
2164
- }, config?: RequestConfig) => Promise<ApiResponse<any>>;
3076
+ }, config?: RequestConfig) => RequestBuilder<any>;
2165
3077
  };
2166
3078
  find: {
2167
3079
  /** 分页查询产品列表 */
@@ -2172,13 +3084,19 @@ export interface ApiClient {
2172
3084
  name?: string;
2173
3085
  status?: "" | "active" | "archived";
2174
3086
  };
2175
- }, config?: RequestConfig) => Promise<ApiResponse<any>>;
3087
+ }, config?: RequestConfig) => RequestBuilder<any>;
2176
3088
  };
2177
3089
  findOne: {
2178
3090
  /** 根据 ID 查询产品详情 */
2179
3091
  post: (body: {
2180
3092
  id: string;
2181
- }, config?: RequestConfig) => Promise<ApiResponse<any>>;
3093
+ }, config?: RequestConfig) => RequestBuilder<any>;
3094
+ };
3095
+ manageOptions: {
3096
+ /** 管理端表单与筛选用产品选项 */
3097
+ post: (body: {
3098
+ status?: "" | "active" | "archived";
3099
+ }, config?: RequestConfig) => RequestBuilder<any>;
2182
3100
  };
2183
3101
  updateSort: {
2184
3102
  /** 批量更新产品排序 */
@@ -2187,11 +3105,11 @@ export interface ApiClient {
2187
3105
  id: string;
2188
3106
  displayOrder: number;
2189
3107
  }[];
2190
- }, config?: RequestConfig) => Promise<ApiResponse<any>>;
3108
+ }, config?: RequestConfig) => RequestBuilder<any>;
2191
3109
  };
2192
- listActive: {
3110
+ options: {
2193
3111
  /** 获取定价页面可用产品列表(公开) */
2194
- post: (config?: RequestConfig) => Promise<ApiResponse<any>>;
3112
+ post: (config?: RequestConfig) => RequestBuilder<any>;
2195
3113
  };
2196
3114
  };
2197
3115
  prices: {
@@ -2208,13 +3126,13 @@ export interface ApiClient {
2208
3126
  interval?: "day" | "week" | "month" | "year";
2209
3127
  intervalCount?: number;
2210
3128
  metadata?: Record<string, unknown>;
2211
- }, config?: RequestConfig) => Promise<ApiResponse<any>>;
3129
+ }, config?: RequestConfig) => RequestBuilder<any>;
2212
3130
  };
2213
3131
  delete: {
2214
3132
  /** 删除价格方案 */
2215
3133
  post: (body: {
2216
3134
  id: string;
2217
- }, config?: RequestConfig) => Promise<ApiResponse<any>>;
3135
+ }, config?: RequestConfig) => RequestBuilder<any>;
2218
3136
  };
2219
3137
  update: {
2220
3138
  /** 更新价格方案信息 */
@@ -2225,7 +3143,7 @@ export interface ApiClient {
2225
3143
  metadata?: Record<string, unknown>;
2226
3144
  trialPeriodDays?: number;
2227
3145
  allowRepeatTrial?: boolean;
2228
- }, config?: RequestConfig) => Promise<ApiResponse<any>>;
3146
+ }, config?: RequestConfig) => RequestBuilder<any>;
2229
3147
  };
2230
3148
  find: {
2231
3149
  /** 分页查询价格方案列表 */
@@ -2237,23 +3155,20 @@ export interface ApiClient {
2237
3155
  type?: "" | "free" | "one_time" | "recurring";
2238
3156
  active?: boolean;
2239
3157
  };
2240
- }, config?: RequestConfig) => Promise<ApiResponse<any>>;
3158
+ }, config?: RequestConfig) => RequestBuilder<any>;
2241
3159
  };
2242
3160
  findOne: {
2243
3161
  /** 根据 ID 查询价格方案详情 */
2244
3162
  post: (body: {
2245
3163
  id: string;
2246
- }, config?: RequestConfig) => Promise<ApiResponse<any>>;
3164
+ }, config?: RequestConfig) => RequestBuilder<any>;
2247
3165
  };
2248
- listByProduct: {
2249
- /** 获取指定产品的所有可用价格方案 */
3166
+ options: {
3167
+ /** 按产品或免费体验筛选可用价格方案 */
2250
3168
  post: (body: {
2251
- productId: string;
2252
- }, config?: RequestConfig) => Promise<ApiResponse<any>>;
2253
- };
2254
- listFreeActive: {
2255
- /** 获取当前应用可领取的免费体验价格方案 */
2256
- post: (config?: RequestConfig) => Promise<ApiResponse<any>>;
3169
+ productId?: string;
3170
+ freeOnly?: boolean;
3171
+ }, config?: RequestConfig) => RequestBuilder<any>;
2257
3172
  };
2258
3173
  };
2259
3174
  subscriptions: {
@@ -2262,7 +3177,7 @@ export interface ApiClient {
2262
3177
  post: (body: {
2263
3178
  priceId: string;
2264
3179
  couponCode?: string;
2265
- }, config?: RequestConfig) => Promise<ApiResponse<any>>;
3180
+ }, config?: RequestConfig) => RequestBuilder<any>;
2266
3181
  };
2267
3182
  cancel: {
2268
3183
  /** 取消订阅 */
@@ -2270,13 +3185,13 @@ export interface ApiClient {
2270
3185
  subscriptionId: string;
2271
3186
  cancelAtPeriodEnd?: boolean;
2272
3187
  reason?: string;
2273
- }, config?: RequestConfig) => Promise<ApiResponse<any>>;
3188
+ }, config?: RequestConfig) => RequestBuilder<any>;
2274
3189
  };
2275
3190
  resume: {
2276
3191
  /** 恢复已取消的订阅 */
2277
3192
  post: (body: {
2278
3193
  subscriptionId: string;
2279
- }, config?: RequestConfig) => Promise<ApiResponse<any>>;
3194
+ }, config?: RequestConfig) => RequestBuilder<any>;
2280
3195
  };
2281
3196
  change: {
2282
3197
  /** 升级或降级订阅 */
@@ -2284,7 +3199,7 @@ export interface ApiClient {
2284
3199
  subscriptionId: string;
2285
3200
  newPriceId: string;
2286
3201
  proration?: boolean;
2287
- }, config?: RequestConfig) => Promise<ApiResponse<any>>;
3202
+ }, config?: RequestConfig) => RequestBuilder<any>;
2288
3203
  };
2289
3204
  my: {
2290
3205
  /** 查询当前用户的订阅列表 */
@@ -2292,21 +3207,21 @@ export interface ApiClient {
2292
3207
  current?: number;
2293
3208
  pageSize?: number;
2294
3209
  status?: string;
2295
- }, config?: RequestConfig) => Promise<ApiResponse<any>>;
3210
+ }, config?: RequestConfig) => RequestBuilder<any>;
2296
3211
  };
2297
3212
  current: {
2298
3213
  /** 获取当前活跃订阅 */
2299
- post: (config?: RequestConfig) => Promise<ApiResponse<any>>;
3214
+ post: (config?: RequestConfig) => RequestBuilder<any>;
2300
3215
  };
2301
3216
  summary: {
2302
3217
  /** 获取当前用户订阅、配额、积分和待支付账单摘要 */
2303
- post: (config?: RequestConfig) => Promise<ApiResponse<any>>;
3218
+ post: (config?: RequestConfig) => RequestBuilder<any>;
2304
3219
  };
2305
3220
  userDetail: {
2306
3221
  /** 管理员查询指定用户的订阅、免费体验、配额、积分和最近消费记录 */
2307
3222
  post: (body: {
2308
3223
  userId: string;
2309
- }, config?: RequestConfig) => Promise<ApiResponse<any>>;
3224
+ }, config?: RequestConfig) => RequestBuilder<any>;
2310
3225
  };
2311
3226
  find: {
2312
3227
  /** 分页查询订阅列表(管理端) */
@@ -2319,13 +3234,34 @@ export interface ApiClient {
2319
3234
  status?: string;
2320
3235
  cancelAtPeriodEnd?: boolean;
2321
3236
  };
2322
- }, config?: RequestConfig) => Promise<ApiResponse<any>>;
3237
+ }, config?: RequestConfig) => RequestBuilder<any>;
3238
+ };
3239
+ statistics: {
3240
+ /** 获取订阅概览页统计数据(状态计数、MRR、产品分布、最近订阅) */
3241
+ post: (body: {
3242
+ recentLimit?: number;
3243
+ }, config?: RequestConfig) => RequestBuilder<any>;
2323
3244
  };
2324
3245
  history: {
2325
3246
  /** 查询单个订阅的权益变化历史(管理端) */
2326
3247
  post: (body: {
2327
3248
  subscriptionId: string;
2328
- }, config?: RequestConfig) => Promise<ApiResponse<any>>;
3249
+ }, config?: RequestConfig) => RequestBuilder<any>;
3250
+ };
3251
+ historyFind: {
3252
+ /** 分页查询订阅权益变化历史(管理端) */
3253
+ post: (body: {
3254
+ current: number;
3255
+ pageSize: number;
3256
+ where: {
3257
+ userId?: string;
3258
+ subscriptionId?: string;
3259
+ productId?: string;
3260
+ action?: string;
3261
+ startTime?: string;
3262
+ endTime?: string;
3263
+ };
3264
+ }, config?: RequestConfig) => RequestBuilder<any>;
2329
3265
  };
2330
3266
  trend: {
2331
3267
  /** 获取订阅各状态的历史趋势数据 */
@@ -2333,26 +3269,26 @@ export interface ApiClient {
2333
3269
  startTime: string;
2334
3270
  endTime: string;
2335
3271
  granularity: "day" | "week" | "month";
2336
- }, config?: RequestConfig) => Promise<ApiResponse<any>>;
3272
+ }, config?: RequestConfig) => RequestBuilder<any>;
2337
3273
  };
2338
3274
  count: {
2339
3275
  /** 供其他服务查询用户订阅数量 */
2340
3276
  post: (body: {
2341
3277
  userId: string;
2342
3278
  appId?: string;
2343
- }, config?: RequestConfig) => Promise<ApiResponse<any>>;
3279
+ }, config?: RequestConfig) => RequestBuilder<any>;
2344
3280
  };
2345
3281
  countBatch: {
2346
3282
  /** 供其他服务批量查询用户订阅数量 */
2347
3283
  post: (body: {
2348
3284
  userIds: string[];
2349
3285
  appId?: string;
2350
- }, config?: RequestConfig) => Promise<ApiResponse<any>>;
3286
+ }, config?: RequestConfig) => RequestBuilder<any>;
2351
3287
  };
2352
3288
  notify: {
2353
3289
  alipay: {
2354
3290
  /** 支付宝订阅支付回调通知 */
2355
- post: (body: Record<string, unknown>, config?: RequestConfig) => Promise<ApiResponse<any>>;
3291
+ post: (body: Record<string, unknown>, config?: RequestConfig) => RequestBuilder<any>;
2356
3292
  };
2357
3293
  };
2358
3294
  };
@@ -2367,13 +3303,13 @@ export interface ApiClient {
2367
3303
  limit: number;
2368
3304
  period: "day" | "week" | "month" | "year" | "lifetime";
2369
3305
  metadata?: Record<string, unknown>;
2370
- }, config?: RequestConfig) => Promise<ApiResponse<any>>;
3306
+ }, config?: RequestConfig) => RequestBuilder<any>;
2371
3307
  };
2372
3308
  delete: {
2373
3309
  /** 删除配额定义 */
2374
3310
  post: (body: {
2375
3311
  id: string;
2376
- }, config?: RequestConfig) => Promise<ApiResponse<any>>;
3312
+ }, config?: RequestConfig) => RequestBuilder<any>;
2377
3313
  };
2378
3314
  update: {
2379
3315
  /** 更新配额定义 */
@@ -2384,7 +3320,7 @@ export interface ApiClient {
2384
3320
  limit?: number;
2385
3321
  period?: "day" | "week" | "month" | "year" | "lifetime";
2386
3322
  metadata?: Record<string, unknown>;
2387
- }, config?: RequestConfig) => Promise<ApiResponse<any>>;
3323
+ }, config?: RequestConfig) => RequestBuilder<any>;
2388
3324
  };
2389
3325
  find: {
2390
3326
  /** 分页查询配额列表 */
@@ -2396,7 +3332,7 @@ export interface ApiClient {
2396
3332
  priceId?: string;
2397
3333
  featureKey?: string;
2398
3334
  };
2399
- }, config?: RequestConfig) => Promise<ApiResponse<any>>;
3335
+ }, config?: RequestConfig) => RequestBuilder<any>;
2400
3336
  };
2401
3337
  check: {
2402
3338
  /** 供其他服务检查配额是否足够,不写入使用量 */
@@ -2406,11 +3342,11 @@ export interface ApiClient {
2406
3342
  featureKey: string;
2407
3343
  quantity?: number;
2408
3344
  used?: number;
2409
- }, config?: RequestConfig) => Promise<ApiResponse<any>>;
3345
+ }, config?: RequestConfig) => RequestBuilder<any>;
2410
3346
  };
2411
3347
  my: {
2412
3348
  /** 获取当前用户的配额使用情况 */
2413
- post: (config?: RequestConfig) => Promise<ApiResponse<any>>;
3349
+ post: (config?: RequestConfig) => RequestBuilder<any>;
2414
3350
  };
2415
3351
  reserve: {
2416
3352
  /** 供其他服务检查并预占配额 */
@@ -2420,51 +3356,51 @@ export interface ApiClient {
2420
3356
  featureKey: string;
2421
3357
  quantity?: number;
2422
3358
  metadata?: Record<string, unknown>;
2423
- }, config?: RequestConfig) => Promise<ApiResponse<any>>;
3359
+ }, config?: RequestConfig) => RequestBuilder<any>;
2424
3360
  };
2425
3361
  commit: {
2426
3362
  /** 供其他服务确认已预占配额 */
2427
3363
  post: (body: {
2428
3364
  usageRecordId: string;
2429
- }, config?: RequestConfig) => Promise<ApiResponse<any>>;
3365
+ }, config?: RequestConfig) => RequestBuilder<any>;
2430
3366
  };
2431
3367
  release: {
2432
3368
  /** 供其他服务释放已预占配额 */
2433
3369
  post: (body: {
2434
3370
  usageRecordId: string;
2435
- }, config?: RequestConfig) => Promise<ApiResponse<any>>;
3371
+ }, config?: RequestConfig) => RequestBuilder<any>;
2436
3372
  };
2437
3373
  };
2438
3374
  trials: {
2439
3375
  current: {
2440
3376
  /** 获取当前用户免费体验状态 */
2441
- post: (config?: RequestConfig) => Promise<ApiResponse<any>>;
3377
+ post: (config?: RequestConfig) => RequestBuilder<any>;
2442
3378
  };
2443
3379
  start: {
2444
3380
  /** 领取当前应用的免费体验权益 */
2445
3381
  post: (body: {
2446
3382
  priceId?: string;
2447
- }, config?: RequestConfig) => Promise<ApiResponse<any>>;
3383
+ }, config?: RequestConfig) => RequestBuilder<any>;
2448
3384
  };
2449
3385
  };
2450
3386
  newUserDefaults: {
2451
3387
  find: {
2452
3388
  /** 查询注册后默认授予的免费权益配置 */
2453
- post: (config?: RequestConfig) => Promise<ApiResponse<any>>;
3389
+ post: (config?: RequestConfig) => RequestBuilder<any>;
2454
3390
  };
2455
3391
  update: {
2456
3392
  /** 更新注册后默认授予的免费权益配置 */
2457
3393
  post: (body: {
2458
3394
  autoGrantFreePriceOnSignup: boolean;
2459
3395
  defaultFreePriceId?: string;
2460
- }, config?: RequestConfig) => Promise<ApiResponse<any>>;
3396
+ }, config?: RequestConfig) => RequestBuilder<any>;
2461
3397
  };
2462
3398
  grantMissingFreeEntitlements: {
2463
3399
  /** 给当前应用下没有活跃订阅/体验的用户补发默认免费价格方案 */
2464
3400
  post: (body: {
2465
3401
  dryRun?: boolean;
2466
3402
  userIds?: string[];
2467
- }, config?: RequestConfig) => Promise<ApiResponse<any>>;
3403
+ }, config?: RequestConfig) => RequestBuilder<any>;
2468
3404
  };
2469
3405
  };
2470
3406
  usageRecords: {
@@ -2475,7 +3411,7 @@ export interface ApiClient {
2475
3411
  featureKey: string;
2476
3412
  quantity?: number;
2477
3413
  used?: number;
2478
- }, config?: RequestConfig) => Promise<ApiResponse<any>>;
3414
+ }, config?: RequestConfig) => RequestBuilder<any>;
2479
3415
  };
2480
3416
  reserveQuota: {
2481
3417
  /** 检查配额并写入 reserved 使用量记录 */
@@ -2484,19 +3420,19 @@ export interface ApiClient {
2484
3420
  featureKey: string;
2485
3421
  quantity?: number;
2486
3422
  metadata?: Record<string, unknown>;
2487
- }, config?: RequestConfig) => Promise<ApiResponse<any>>;
3423
+ }, config?: RequestConfig) => RequestBuilder<any>;
2488
3424
  };
2489
3425
  commitQuota: {
2490
3426
  /** 将 reserved 使用量记录确认成 committed */
2491
3427
  post: (body: {
2492
3428
  usageRecordId: string;
2493
- }, config?: RequestConfig) => Promise<ApiResponse<any>>;
3429
+ }, config?: RequestConfig) => RequestBuilder<any>;
2494
3430
  };
2495
3431
  releaseQuota: {
2496
3432
  /** 将 reserved 使用量记录释放成 released */
2497
3433
  post: (body: {
2498
3434
  usageRecordId: string;
2499
- }, config?: RequestConfig) => Promise<ApiResponse<any>>;
3435
+ }, config?: RequestConfig) => RequestBuilder<any>;
2500
3436
  };
2501
3437
  find: {
2502
3438
  /** 分页查询使用记录(管理端) */
@@ -2510,7 +3446,7 @@ export interface ApiClient {
2510
3446
  startTime?: string;
2511
3447
  endTime?: string;
2512
3448
  };
2513
- }, config?: RequestConfig) => Promise<ApiResponse<any>>;
3449
+ }, config?: RequestConfig) => RequestBuilder<any>;
2514
3450
  };
2515
3451
  my: {
2516
3452
  /** 查询当前用户的使用记录 */
@@ -2521,7 +3457,7 @@ export interface ApiClient {
2521
3457
  status?: string;
2522
3458
  startTime?: string;
2523
3459
  endTime?: string;
2524
- }, config?: RequestConfig) => Promise<ApiResponse<any>>;
3460
+ }, config?: RequestConfig) => RequestBuilder<any>;
2525
3461
  };
2526
3462
  statistics: {
2527
3463
  /** 获取使用量统计数据 */
@@ -2531,7 +3467,7 @@ export interface ApiClient {
2531
3467
  startTime: string;
2532
3468
  endTime: string;
2533
3469
  granularity: "hour" | "day" | "week" | "month";
2534
- }, config?: RequestConfig) => Promise<ApiResponse<any>>;
3470
+ }, config?: RequestConfig) => RequestBuilder<any>;
2535
3471
  };
2536
3472
  };
2537
3473
  invoices: {
@@ -2547,13 +3483,13 @@ export interface ApiClient {
2547
3483
  startTime?: string;
2548
3484
  endTime?: string;
2549
3485
  };
2550
- }, config?: RequestConfig) => Promise<ApiResponse<any>>;
3486
+ }, config?: RequestConfig) => RequestBuilder<any>;
2551
3487
  };
2552
3488
  findOne: {
2553
3489
  /** 根据 ID 查询订阅账单详情 */
2554
3490
  post: (body: {
2555
3491
  id: string;
2556
- }, config?: RequestConfig) => Promise<ApiResponse<any>>;
3492
+ }, config?: RequestConfig) => RequestBuilder<any>;
2557
3493
  };
2558
3494
  my: {
2559
3495
  /** 查询当前用户的订阅账单列表 */
@@ -2561,40 +3497,40 @@ export interface ApiClient {
2561
3497
  current?: number;
2562
3498
  pageSize?: number;
2563
3499
  status?: string;
2564
- }, config?: RequestConfig) => Promise<ApiResponse<any>>;
3500
+ }, config?: RequestConfig) => RequestBuilder<any>;
2565
3501
  };
2566
3502
  cancel: {
2567
3503
  /** 取消当前用户自己的待支付订阅账单 */
2568
3504
  post: (body: {
2569
3505
  id: string;
2570
3506
  reason?: string;
2571
- }, config?: RequestConfig) => Promise<ApiResponse<any>>;
3507
+ }, config?: RequestConfig) => RequestBuilder<any>;
2572
3508
  };
2573
3509
  pay: {
2574
3510
  /** 为当前用户的待支付账单生成支付链接 */
2575
3511
  post: (body: {
2576
3512
  id: string;
2577
- }, config?: RequestConfig) => Promise<ApiResponse<any>>;
3513
+ }, config?: RequestConfig) => RequestBuilder<any>;
2578
3514
  };
2579
3515
  verifyPayment: {
2580
3516
  /** 查询支付宝订单状态,如果已支付则完成订阅入账 */
2581
3517
  post: (body: {
2582
3518
  orderId: string;
2583
- }, config?: RequestConfig) => Promise<ApiResponse<any>>;
3519
+ }, config?: RequestConfig) => RequestBuilder<any>;
2584
3520
  };
2585
3521
  void: {
2586
3522
  /** 管理端作废待支付订阅账单 */
2587
3523
  post: (body: {
2588
3524
  id: string;
2589
3525
  reason?: string;
2590
- }, config?: RequestConfig) => Promise<ApiResponse<any>>;
3526
+ }, config?: RequestConfig) => RequestBuilder<any>;
2591
3527
  };
2592
3528
  statistics: {
2593
3529
  /** 获取订阅账单统计数据 */
2594
3530
  post: (body: {
2595
3531
  startTime?: string;
2596
3532
  endTime?: string;
2597
- }, config?: RequestConfig) => Promise<ApiResponse<any>>;
3533
+ }, config?: RequestConfig) => RequestBuilder<any>;
2598
3534
  };
2599
3535
  revenueReport: {
2600
3536
  /** 获取收入报表数据 */
@@ -2602,18 +3538,18 @@ export interface ApiClient {
2602
3538
  startTime: string;
2603
3539
  endTime: string;
2604
3540
  granularity: "day" | "week" | "month" | "year";
2605
- }, config?: RequestConfig) => Promise<ApiResponse<any>>;
3541
+ }, config?: RequestConfig) => RequestBuilder<any>;
2606
3542
  };
2607
3543
  revenueByProduct: {
2608
3544
  /** 获取按产品分布的收入数据 */
2609
3545
  post: (body: {
2610
3546
  startTime?: string;
2611
3547
  endTime?: string;
2612
- }, config?: RequestConfig) => Promise<ApiResponse<any>>;
3548
+ }, config?: RequestConfig) => RequestBuilder<any>;
2613
3549
  };
2614
3550
  statusOptions: {
2615
3551
  /** 获取订阅账单状态下拉选项与展示文案 */
2616
- post: (config?: RequestConfig) => Promise<ApiResponse<any>>;
3552
+ post: (config?: RequestConfig) => RequestBuilder<any>;
2617
3553
  };
2618
3554
  stats: {
2619
3555
  /** 供其他服务查询发票统计数据 */
@@ -2621,7 +3557,7 @@ export interface ApiClient {
2621
3557
  appId: string;
2622
3558
  userIds: string[];
2623
3559
  status?: string;
2624
- }, config?: RequestConfig) => Promise<ApiResponse<any>>;
3560
+ }, config?: RequestConfig) => RequestBuilder<any>;
2625
3561
  };
2626
3562
  statsByUser: {
2627
3563
  /** 供其他服务按用户分组查询发票统计 */
@@ -2629,7 +3565,7 @@ export interface ApiClient {
2629
3565
  appId: string;
2630
3566
  userIds: string[];
2631
3567
  status?: string;
2632
- }, config?: RequestConfig) => Promise<ApiResponse<any>>;
3568
+ }, config?: RequestConfig) => RequestBuilder<any>;
2633
3569
  };
2634
3570
  };
2635
3571
  points: {
@@ -2637,7 +3573,7 @@ export interface ApiClient {
2637
3573
  /** 查询用户积分账户余额 */
2638
3574
  post: (body: {
2639
3575
  userId?: string;
2640
- }, config?: RequestConfig) => Promise<ApiResponse<any>>;
3576
+ }, config?: RequestConfig) => RequestBuilder<any>;
2641
3577
  };
2642
3578
  earn: {
2643
3579
  /** 发放积分(充值、奖励等) */
@@ -2651,17 +3587,18 @@ export interface ApiClient {
2651
3587
  referrerId?: string;
2652
3588
  ruleId?: string;
2653
3589
  metadata?: Record<string, unknown>;
2654
- }, config?: RequestConfig) => Promise<ApiResponse<any>>;
3590
+ }, config?: RequestConfig) => RequestBuilder<any>;
2655
3591
  };
2656
3592
  consume: {
2657
3593
  /** 按调用方计算好的积分数消费积分 */
2658
3594
  post: (body: {
2659
3595
  userId: string;
2660
- amount: number;
3596
+ amount?: number;
3597
+ amountMicro?: number;
2661
3598
  requestId?: string;
2662
3599
  description?: string;
2663
3600
  metadata?: Record<string, unknown>;
2664
- }, config?: RequestConfig) => Promise<ApiResponse<any>>;
3601
+ }, config?: RequestConfig) => RequestBuilder<any>;
2665
3602
  };
2666
3603
  consumeByPrice: {
2667
3604
  /** 根据计价配置消费积分 */
@@ -2672,7 +3609,7 @@ export interface ApiClient {
2672
3609
  requestId?: string;
2673
3610
  description?: string;
2674
3611
  metadata?: Record<string, unknown>;
2675
- }, config?: RequestConfig) => Promise<ApiResponse<any>>;
3612
+ }, config?: RequestConfig) => RequestBuilder<any>;
2676
3613
  };
2677
3614
  checkBalance: {
2678
3615
  /** 检查积分是否足够(不扣费) */
@@ -2680,7 +3617,7 @@ export interface ApiClient {
2680
3617
  userId: string;
2681
3618
  priceCode: string;
2682
3619
  quantity?: number;
2683
- }, config?: RequestConfig) => Promise<ApiResponse<any>>;
3620
+ }, config?: RequestConfig) => RequestBuilder<any>;
2684
3621
  };
2685
3622
  reversal: {
2686
3623
  /** 冲正/退还已消费的积分 */
@@ -2689,7 +3626,7 @@ export interface ApiClient {
2689
3626
  originalTransactionId: string;
2690
3627
  requestId?: string;
2691
3628
  reason: string;
2692
- }, config?: RequestConfig) => Promise<ApiResponse<any>>;
3629
+ }, config?: RequestConfig) => RequestBuilder<any>;
2693
3630
  };
2694
3631
  clawback: {
2695
3632
  /** 追回/扣回已发放的积分 */
@@ -2698,7 +3635,7 @@ export interface ApiClient {
2698
3635
  originalTransactionId: string;
2699
3636
  requestId?: string;
2700
3637
  reason: string;
2701
- }, config?: RequestConfig) => Promise<ApiResponse<any>>;
3638
+ }, config?: RequestConfig) => RequestBuilder<any>;
2702
3639
  };
2703
3640
  adjust: {
2704
3641
  /** 人工调整积分(加/减) */
@@ -2708,7 +3645,7 @@ export interface ApiClient {
2708
3645
  requestId?: string;
2709
3646
  reason: string;
2710
3647
  relatedOrderId?: string;
2711
- }, config?: RequestConfig) => Promise<ApiResponse<any>>;
3648
+ }, config?: RequestConfig) => RequestBuilder<any>;
2712
3649
  };
2713
3650
  batchAdjust: {
2714
3651
  /** 批量调整多用户积分 */
@@ -2717,19 +3654,19 @@ export interface ApiClient {
2717
3654
  amount: number;
2718
3655
  requestId?: string;
2719
3656
  reason: string;
2720
- }, config?: RequestConfig) => Promise<ApiResponse<any>>;
3657
+ }, config?: RequestConfig) => RequestBuilder<any>;
2721
3658
  };
2722
3659
  statistics: {
2723
3660
  /** 获取用户积分统计数据 */
2724
3661
  post: (body: {
2725
3662
  userId?: string;
2726
- }, config?: RequestConfig) => Promise<ApiResponse<any>>;
3663
+ }, config?: RequestConfig) => RequestBuilder<any>;
2727
3664
  };
2728
3665
  leaderboard: {
2729
3666
  /** 获取积分排行榜 */
2730
3667
  post: (body: {
2731
3668
  limit?: number;
2732
- }, config?: RequestConfig) => Promise<ApiResponse<any>>;
3669
+ }, config?: RequestConfig) => RequestBuilder<any>;
2733
3670
  };
2734
3671
  };
2735
3672
  pointsHistory: {
@@ -2743,46 +3680,46 @@ export interface ApiClient {
2743
3680
  pageSize?: number;
2744
3681
  startDate?: string;
2745
3682
  endDate?: string;
2746
- }, config?: RequestConfig) => Promise<ApiResponse<any>>;
3683
+ }, config?: RequestConfig) => RequestBuilder<any>;
2747
3684
  };
2748
3685
  findOne: {
2749
3686
  /** 根据 ID 查询积分历史详情 */
2750
3687
  post: (body: {
2751
3688
  id: string;
2752
- }, config?: RequestConfig) => Promise<ApiResponse<any>>;
3689
+ }, config?: RequestConfig) => RequestBuilder<any>;
2753
3690
  };
2754
3691
  statistics: {
2755
3692
  /** 获取积分统计数据 */
2756
3693
  post: (body: {
2757
3694
  userId?: string;
2758
3695
  period?: "day" | "week" | "month" | "year";
2759
- }, config?: RequestConfig) => Promise<ApiResponse<any>>;
3696
+ }, config?: RequestConfig) => RequestBuilder<any>;
2760
3697
  };
2761
- getTrendChart: {
3698
+ trendChart: {
2762
3699
  /** 获取积分变动趋势图表数据 */
2763
3700
  post: (body: {
2764
3701
  userId?: string;
2765
3702
  startTime: string;
2766
3703
  endTime: string;
2767
3704
  granularity: "minute" | "hour" | "day" | "month" | "year";
2768
- }, config?: RequestConfig) => Promise<ApiResponse<any>>;
3705
+ }, config?: RequestConfig) => RequestBuilder<any>;
2769
3706
  };
2770
- getTypeDistributionChart: {
3707
+ typeDistributionChart: {
2771
3708
  /** 获取积分类型分布图表数据 */
2772
3709
  post: (body: {
2773
3710
  userId?: string;
2774
3711
  startTime?: string;
2775
3712
  endTime?: string;
2776
- }, config?: RequestConfig) => Promise<ApiResponse<any>>;
3713
+ }, config?: RequestConfig) => RequestBuilder<any>;
2777
3714
  };
2778
- getRankingChart: {
3715
+ rankingChart: {
2779
3716
  /** 获取用户积分排行榜 */
2780
3717
  post: (body: {
2781
3718
  type?: "earn" | "spend" | "reversal" | "clawback" | "adjust";
2782
3719
  startTime?: string;
2783
3720
  endTime?: string;
2784
3721
  limit?: number;
2785
- }, config?: RequestConfig) => Promise<ApiResponse<any>>;
3722
+ }, config?: RequestConfig) => RequestBuilder<any>;
2786
3723
  };
2787
3724
  };
2788
3725
  pointsTrigger: {
@@ -2791,7 +3728,7 @@ export interface ApiClient {
2791
3728
  post: (body: {
2792
3729
  ruleId: string;
2793
3730
  eventData?: Record<string, unknown>;
2794
- }, config?: RequestConfig) => Promise<ApiResponse<any>>;
3731
+ }, config?: RequestConfig) => RequestBuilder<any>;
2795
3732
  };
2796
3733
  triggerByEvent: {
2797
3734
  /** 根据事件自动匹配并触发积分规则 */
@@ -2799,7 +3736,7 @@ export interface ApiClient {
2799
3736
  event: string;
2800
3737
  eventData?: Record<string, unknown>;
2801
3738
  userId?: string;
2802
- }, config?: RequestConfig) => Promise<ApiResponse<any>>;
3739
+ }, config?: RequestConfig) => RequestBuilder<any>;
2803
3740
  };
2804
3741
  batchTrigger: {
2805
3742
  /** 批量触发多个积分规则 */
@@ -2808,7 +3745,7 @@ export interface ApiClient {
2808
3745
  ruleId: string;
2809
3746
  eventData?: Record<string, unknown>;
2810
3747
  }[];
2811
- }, config?: RequestConfig) => Promise<ApiResponse<any>>;
3748
+ }, config?: RequestConfig) => RequestBuilder<any>;
2812
3749
  };
2813
3750
  };
2814
3751
  pointsTriggerHistory: {
@@ -2827,21 +3764,21 @@ export interface ApiClient {
2827
3764
  startDate?: string;
2828
3765
  endDate?: string;
2829
3766
  };
2830
- }, config?: RequestConfig) => Promise<ApiResponse<any>>;
3767
+ }, config?: RequestConfig) => RequestBuilder<any>;
2831
3768
  };
2832
3769
  findOne: {
2833
3770
  /** 根据 ID 查询积分触发历史详情 */
2834
3771
  post: (body: {
2835
3772
  id: string;
2836
- }, config?: RequestConfig) => Promise<ApiResponse<any>>;
3773
+ }, config?: RequestConfig) => RequestBuilder<any>;
2837
3774
  };
2838
3775
  statusOptions: {
2839
3776
  /** 获取积分触发状态下拉选项 */
2840
- post: (config?: RequestConfig) => Promise<ApiResponse<any>>;
3777
+ post: (config?: RequestConfig) => RequestBuilder<any>;
2841
3778
  };
2842
3779
  rewardTargetOptions: {
2843
3780
  /** 获取奖励目标下拉选项 */
2844
- post: (config?: RequestConfig) => Promise<ApiResponse<any>>;
3781
+ post: (config?: RequestConfig) => RequestBuilder<any>;
2845
3782
  };
2846
3783
  statistics: {
2847
3784
  /** 获取积分触发历史统计数据 */
@@ -2851,7 +3788,7 @@ export interface ApiClient {
2851
3788
  startTime?: string;
2852
3789
  endTime?: string;
2853
3790
  period?: "today" | "week" | "month" | "year";
2854
- }, config?: RequestConfig) => Promise<ApiResponse<any>>;
3791
+ }, config?: RequestConfig) => RequestBuilder<any>;
2855
3792
  };
2856
3793
  trends: {
2857
3794
  /** 获取积分触发趋势图表数据 */
@@ -2861,7 +3798,7 @@ export interface ApiClient {
2861
3798
  startTime?: string;
2862
3799
  endTime?: string;
2863
3800
  granularity?: "minute" | "hour" | "day" | "month" | "year";
2864
- }, config?: RequestConfig) => Promise<ApiResponse<any>>;
3801
+ }, config?: RequestConfig) => RequestBuilder<any>;
2865
3802
  };
2866
3803
  pointsTrends: {
2867
3804
  /** 获取积分变动趋势图表数据 */
@@ -2871,7 +3808,7 @@ export interface ApiClient {
2871
3808
  startTime?: string;
2872
3809
  endTime?: string;
2873
3810
  granularity?: "minute" | "hour" | "day" | "month" | "year";
2874
- }, config?: RequestConfig) => Promise<ApiResponse<any>>;
3811
+ }, config?: RequestConfig) => RequestBuilder<any>;
2875
3812
  };
2876
3813
  completionAnalysis: {
2877
3814
  /** 获取积分规则完成度分析数据 */
@@ -2880,7 +3817,7 @@ export interface ApiClient {
2880
3817
  ruleId?: string;
2881
3818
  startTime?: string;
2882
3819
  endTime?: string;
2883
- }, config?: RequestConfig) => Promise<ApiResponse<any>>;
3820
+ }, config?: RequestConfig) => RequestBuilder<any>;
2884
3821
  };
2885
3822
  triggerTypeTrends: {
2886
3823
  /** 获取积分触发类型趋势图表数据 */
@@ -2890,7 +3827,7 @@ export interface ApiClient {
2890
3827
  startTime?: string;
2891
3828
  endTime?: string;
2892
3829
  granularity?: "minute" | "hour" | "day" | "month" | "year";
2893
- }, config?: RequestConfig) => Promise<ApiResponse<any>>;
3830
+ }, config?: RequestConfig) => RequestBuilder<any>;
2894
3831
  };
2895
3832
  };
2896
3833
  pointsTriggerRule: {
@@ -2905,7 +3842,7 @@ export interface ApiClient {
2905
3842
  pointsReward: unknown;
2906
3843
  constraints: unknown;
2907
3844
  activeTimeRanges: unknown;
2908
- }, config?: RequestConfig) => Promise<ApiResponse<any>>;
3845
+ }, config?: RequestConfig) => RequestBuilder<any>;
2909
3846
  };
2910
3847
  find: {
2911
3848
  /** 分页查询积分触发规则列表 */
@@ -2919,13 +3856,13 @@ export interface ApiClient {
2919
3856
  ruleCode?: string;
2920
3857
  event?: string;
2921
3858
  };
2922
- }, config?: RequestConfig) => Promise<ApiResponse<any>>;
3859
+ }, config?: RequestConfig) => RequestBuilder<any>;
2923
3860
  };
2924
3861
  findOne: {
2925
3862
  /** 根据 ID 查询积分触发规则详情 */
2926
3863
  post: (body: {
2927
3864
  id: string;
2928
- }, config?: RequestConfig) => Promise<ApiResponse<any>>;
3865
+ }, config?: RequestConfig) => RequestBuilder<any>;
2929
3866
  };
2930
3867
  update: {
2931
3868
  /** 更新积分触发规则配置 */
@@ -2939,28 +3876,28 @@ export interface ApiClient {
2939
3876
  pointsReward?: unknown;
2940
3877
  constraints?: unknown;
2941
3878
  activeTimeRanges?: unknown;
2942
- }, config?: RequestConfig) => Promise<ApiResponse<any>>;
3879
+ }, config?: RequestConfig) => RequestBuilder<any>;
2943
3880
  };
2944
3881
  updateStatus: {
2945
3882
  /** 启用或禁用积分触发规则 */
2946
3883
  post: (body: {
2947
3884
  id: string;
2948
3885
  status: "draft" | "active" | "inactive";
2949
- }, config?: RequestConfig) => Promise<ApiResponse<any>>;
3886
+ }, config?: RequestConfig) => RequestBuilder<any>;
2950
3887
  };
2951
3888
  delete: {
2952
3889
  /** 删除积分触发规则 */
2953
3890
  post: (body: {
2954
3891
  id: string;
2955
- }, config?: RequestConfig) => Promise<ApiResponse<any>>;
3892
+ }, config?: RequestConfig) => RequestBuilder<any>;
2956
3893
  };
2957
3894
  statusOptions: {
2958
3895
  /** 获取积分触发规则状态下拉选项 */
2959
- post: (config?: RequestConfig) => Promise<ApiResponse<any>>;
3896
+ post: (config?: RequestConfig) => RequestBuilder<any>;
2960
3897
  };
2961
3898
  eventOptions: {
2962
3899
  /** 获取可绑定的事件类型选项 */
2963
- post: (config?: RequestConfig) => Promise<ApiResponse<any>>;
3900
+ post: (config?: RequestConfig) => RequestBuilder<any>;
2964
3901
  };
2965
3902
  };
2966
3903
  pointsPriceConfig: {
@@ -2975,7 +3912,7 @@ export interface ApiClient {
2975
3912
  unit?: string;
2976
3913
  minCharge?: number;
2977
3914
  status?: "active" | "inactive";
2978
- }, config?: RequestConfig) => Promise<ApiResponse<any>>;
3915
+ }, config?: RequestConfig) => RequestBuilder<any>;
2979
3916
  };
2980
3917
  find: {
2981
3918
  /** 分页查询计价配置列表 */
@@ -2988,14 +3925,14 @@ export interface ApiClient {
2988
3925
  };
2989
3926
  page?: number;
2990
3927
  pageSize?: number;
2991
- }, config?: RequestConfig) => Promise<ApiResponse<any>>;
3928
+ }, config?: RequestConfig) => RequestBuilder<any>;
2992
3929
  };
2993
3930
  findOne: {
2994
3931
  /** 根据 ID 或 code 查询计价配置详情 */
2995
3932
  post: (body: {
2996
3933
  id?: string;
2997
3934
  code?: string;
2998
- }, config?: RequestConfig) => Promise<ApiResponse<any>>;
3935
+ }, config?: RequestConfig) => RequestBuilder<any>;
2999
3936
  };
3000
3937
  update: {
3001
3938
  /** 更新计价配置 */
@@ -3008,24 +3945,24 @@ export interface ApiClient {
3008
3945
  unit?: string;
3009
3946
  minCharge?: number;
3010
3947
  status?: "active" | "inactive";
3011
- }, config?: RequestConfig) => Promise<ApiResponse<any>>;
3948
+ }, config?: RequestConfig) => RequestBuilder<any>;
3012
3949
  };
3013
3950
  updateStatus: {
3014
3951
  /** 启用或停用计价配置 */
3015
3952
  post: (body: {
3016
3953
  id: string;
3017
3954
  status: "active" | "inactive";
3018
- }, config?: RequestConfig) => Promise<ApiResponse<any>>;
3955
+ }, config?: RequestConfig) => RequestBuilder<any>;
3019
3956
  };
3020
3957
  delete: {
3021
3958
  /** 删除计价配置 */
3022
3959
  post: (body: {
3023
3960
  id: string;
3024
- }, config?: RequestConfig) => Promise<ApiResponse<any>>;
3961
+ }, config?: RequestConfig) => RequestBuilder<any>;
3025
3962
  };
3026
3963
  billingModeOptions: {
3027
3964
  /** 获取计费方式下拉选项 */
3028
- post: (config?: RequestConfig) => Promise<ApiResponse<any>>;
3965
+ post: (config?: RequestConfig) => RequestBuilder<any>;
3029
3966
  };
3030
3967
  };
3031
3968
  pointsUsageRecord: {
@@ -3042,7 +3979,7 @@ export interface ApiClient {
3042
3979
  };
3043
3980
  page?: number;
3044
3981
  pageSize?: number;
3045
- }, config?: RequestConfig) => Promise<ApiResponse<any>>;
3982
+ }, config?: RequestConfig) => RequestBuilder<any>;
3046
3983
  };
3047
3984
  statistics: {
3048
3985
  /** 按维度统计消费数据 */
@@ -3053,14 +3990,14 @@ export interface ApiClient {
3053
3990
  priceCode?: string;
3054
3991
  userId?: string;
3055
3992
  limit?: number;
3056
- }, config?: RequestConfig) => Promise<ApiResponse<any>>;
3993
+ }, config?: RequestConfig) => RequestBuilder<any>;
3057
3994
  };
3058
3995
  overview: {
3059
3996
  /** 获取消费概览数据 */
3060
3997
  post: (body: {
3061
3998
  startDate?: string;
3062
3999
  endDate?: string;
3063
- }, config?: RequestConfig) => Promise<ApiResponse<any>>;
4000
+ }, config?: RequestConfig) => RequestBuilder<any>;
3064
4001
  };
3065
4002
  };
3066
4003
  pointsBalanceAlert: {
@@ -3072,13 +4009,13 @@ export interface ApiClient {
3072
4009
  notifyEmail?: boolean;
3073
4010
  notifyEmails?: string[];
3074
4011
  cooldownHours?: number;
3075
- }, config?: RequestConfig) => Promise<ApiResponse<any>>;
4012
+ }, config?: RequestConfig) => RequestBuilder<any>;
3076
4013
  };
3077
- getConfig: {
4014
+ findOne: {
3078
4015
  /** 获取当前预警配置 */
3079
- post: (config?: RequestConfig) => Promise<ApiResponse<any>>;
4016
+ post: (config?: RequestConfig) => RequestBuilder<any>;
3080
4017
  };
3081
- findAlerts: {
4018
+ find: {
3082
4019
  /** 分页查询预警记录 */
3083
4020
  post: (body: {
3084
4021
  where?: {
@@ -3089,49 +4026,127 @@ export interface ApiClient {
3089
4026
  };
3090
4027
  page?: number;
3091
4028
  pageSize?: number;
3092
- }, config?: RequestConfig) => Promise<ApiResponse<any>>;
4029
+ }, config?: RequestConfig) => RequestBuilder<any>;
3093
4030
  };
3094
4031
  triggerCheck: {
3095
4032
  /** 手动触发预警检查(测试用) */
3096
4033
  post: (body: {
3097
4034
  userId: string;
3098
- }, config?: RequestConfig) => Promise<ApiResponse<any>>;
4035
+ }, config?: RequestConfig) => RequestBuilder<any>;
3099
4036
  };
3100
4037
  };
3101
4038
  consumption: {
3102
4039
  trend: {
3103
- /** 聚合服务消费的趋势数据 */
4040
+ /** 聚合积分消耗趋势 */
3104
4041
  post: (body: {
3105
4042
  startDate?: string;
3106
4043
  endDate?: string;
3107
4044
  limit?: number;
3108
- }, config?: RequestConfig) => Promise<ApiResponse<any>>;
4045
+ }, config?: RequestConfig) => RequestBuilder<any>;
3109
4046
  };
3110
4047
  overview: {
3111
- /** 聚合服务消费的概览数据 */
4048
+ /** 聚合积分消耗概览 */
3112
4049
  post: (body: {
3113
4050
  startDate?: string;
3114
4051
  endDate?: string;
3115
- }, config?: RequestConfig) => Promise<ApiResponse<any>>;
4052
+ }, config?: RequestConfig) => RequestBuilder<any>;
4053
+ };
4054
+ };
4055
+ billingUsage: {
4056
+ charges: {
4057
+ find: {
4058
+ /** 查询 billingUsageRecord 全站扣费明细 */
4059
+ post: (body: {
4060
+ where?: {
4061
+ keyword?: string;
4062
+ userId?: string;
4063
+ serviceGroup?: "ai" | "platform" | "storage";
4064
+ businessLineKey?: string;
4065
+ billingProductLineKey?: string;
4066
+ serviceKey?: string;
4067
+ serviceKeys?: string[];
4068
+ meterKey?: string;
4069
+ priceListId?: string;
4070
+ pricingType?: "flat" | "tiered" | "meters";
4071
+ subjectKey?: string;
4072
+ id?: string;
4073
+ idempotencyKey?: string;
4074
+ resourceId?: string;
4075
+ status?: "pending" | "charged" | "failed" | "canceled";
4076
+ startDate?: string;
4077
+ endDate?: string;
4078
+ };
4079
+ page?: number;
4080
+ pageSize?: number;
4081
+ }, config?: RequestConfig) => RequestBuilder<any>;
4082
+ };
4083
+ findOne: {
4084
+ /** 按 ID 查询单条扣费记录(含 AI 扩展字段,供详情抽屉) */
4085
+ post: (body: {
4086
+ id: string;
4087
+ }, config?: RequestConfig) => RequestBuilder<any>;
4088
+ };
4089
+ };
4090
+ consumption: {
4091
+ overview: {
4092
+ /** 聚合已入账扣费结果 */
4093
+ post: (body: {
4094
+ where?: {
4095
+ userId?: string;
4096
+ serviceGroup?: "ai" | "platform" | "storage";
4097
+ businessLineKey?: string;
4098
+ billingProductLineKey?: string;
4099
+ serviceKey?: string;
4100
+ serviceKeys?: string[];
4101
+ startDate?: string;
4102
+ endDate?: string;
4103
+ };
4104
+ }, config?: RequestConfig) => RequestBuilder<any>;
4105
+ };
4106
+ trend: {
4107
+ /** 按日聚合积分消耗趋势 */
4108
+ post: (body: {
4109
+ where?: {
4110
+ userId?: string;
4111
+ serviceGroup?: "ai" | "platform" | "storage";
4112
+ businessLineKey?: string;
4113
+ billingProductLineKey?: string;
4114
+ serviceKey?: string;
4115
+ serviceKeys?: string[];
4116
+ startDate?: string;
4117
+ endDate?: string;
4118
+ };
4119
+ limit?: number;
4120
+ }, config?: RequestConfig) => RequestBuilder<any>;
4121
+ };
4122
+ };
4123
+ reference: {
4124
+ trace: {
4125
+ /** 按 resourceId 查询扣费明细与积分流水 */
4126
+ post: (body: {
4127
+ resourceId: string;
4128
+ serviceKey?: string;
4129
+ }, config?: RequestConfig) => RequestBuilder<any>;
4130
+ };
3116
4131
  };
3117
4132
  };
3118
4133
  pointsRecharge: {
3119
4134
  packages: {
3120
4135
  /** 获取可用的充值套餐列表 */
3121
- post: (config?: RequestConfig) => Promise<ApiResponse<any>>;
4136
+ post: (config?: RequestConfig) => RequestBuilder<any>;
3122
4137
  };
3123
4138
  createOrder: {
3124
4139
  /** 创建积分充值订单 */
3125
4140
  post: (body: {
3126
4141
  packageId: string;
3127
4142
  payType: "alipay" | "weixinpay";
3128
- }, config?: RequestConfig) => Promise<ApiResponse<any>>;
4143
+ }, config?: RequestConfig) => RequestBuilder<any>;
3129
4144
  };
3130
4145
  createQRCodeOrder: {
3131
4146
  /** 创建支付宝扫码支付订单(当面付) */
3132
4147
  post: (body: {
3133
4148
  packageId: string;
3134
- }, config?: RequestConfig) => Promise<ApiResponse<any>>;
4149
+ }, config?: RequestConfig) => RequestBuilder<any>;
3135
4150
  };
3136
4151
  orders: {
3137
4152
  /** 查询用户的充值订单记录 */
@@ -3139,7 +4154,7 @@ export interface ApiClient {
3139
4154
  status?: string;
3140
4155
  page?: number;
3141
4156
  pageSize?: number;
3142
- }, config?: RequestConfig) => Promise<ApiResponse<any>>;
4157
+ }, config?: RequestConfig) => RequestBuilder<any>;
3143
4158
  };
3144
4159
  find: {
3145
4160
  /** 管理端分页查询全部积分充值订单 */
@@ -3152,51 +4167,51 @@ export interface ApiClient {
3152
4167
  startTime?: string;
3153
4168
  endTime?: string;
3154
4169
  };
3155
- }, config?: RequestConfig) => Promise<ApiResponse<any>>;
4170
+ }, config?: RequestConfig) => RequestBuilder<any>;
3156
4171
  };
3157
- detail: {
4172
+ findOne: {
3158
4173
  /** 管理端查询单个积分充值订单详情及操作时间线 */
3159
4174
  post: (body: {
3160
4175
  orderId: string;
3161
- }, config?: RequestConfig) => Promise<ApiResponse<any>>;
4176
+ }, config?: RequestConfig) => RequestBuilder<any>;
3162
4177
  };
3163
4178
  adminStatistics: {
3164
4179
  /** 管理端积分充值订单统计 */
3165
4180
  post: (body: {
3166
4181
  startTime?: string;
3167
4182
  endTime?: string;
3168
- }, config?: RequestConfig) => Promise<ApiResponse<any>>;
4183
+ }, config?: RequestConfig) => RequestBuilder<any>;
3169
4184
  };
3170
4185
  statistics: {
3171
4186
  /** 获取用户积分充值订单统计 */
3172
4187
  post: (body: {
3173
4188
  startTime?: string;
3174
4189
  endTime?: string;
3175
- }, config?: RequestConfig) => Promise<ApiResponse<any>>;
4190
+ }, config?: RequestConfig) => RequestBuilder<any>;
3176
4191
  };
3177
4192
  statusOptions: {
3178
4193
  /** 获取积分充值订单状态下拉选项与展示文案 */
3179
- post: (config?: RequestConfig) => Promise<ApiResponse<any>>;
4194
+ post: (config?: RequestConfig) => RequestBuilder<any>;
3180
4195
  };
3181
4196
  verifyPayment: {
3182
4197
  /** 查询支付宝订单状态,如果已支付则完成充值 */
3183
4198
  post: (body: {
3184
4199
  orderId: string;
3185
- }, config?: RequestConfig) => Promise<ApiResponse<any>>;
4200
+ }, config?: RequestConfig) => RequestBuilder<any>;
3186
4201
  };
3187
4202
  notify: {
3188
4203
  alipay: {
3189
4204
  /** 支付宝积分充值回调通知 */
3190
- post: (body: Record<string, unknown>, config?: RequestConfig) => Promise<ApiResponse<any>>;
4205
+ post: (body: Record<string, unknown>, config?: RequestConfig) => RequestBuilder<any>;
3191
4206
  };
3192
4207
  };
3193
4208
  };
3194
4209
  rechargePackage: {
3195
- list: {
4210
+ find: {
3196
4211
  /** 获取充值套餐列表(管理端) */
3197
4212
  post: (body: {
3198
4213
  includeDisabled?: boolean;
3199
- }, config?: RequestConfig) => Promise<ApiResponse<any>>;
4214
+ }, config?: RequestConfig) => RequestBuilder<any>;
3200
4215
  };
3201
4216
  create: {
3202
4217
  /** 创建新的充值套餐 */
@@ -3207,207 +4222,696 @@ export interface ApiClient {
3207
4222
  bonus: number;
3208
4223
  description?: string;
3209
4224
  sort?: number;
3210
- }, config?: RequestConfig) => Promise<ApiResponse<any>>;
4225
+ }, config?: RequestConfig) => RequestBuilder<any>;
3211
4226
  };
3212
4227
  update: {
3213
4228
  /** 更新充值套餐信息 */
3214
4229
  post: (body: {
3215
- id: string;
3216
- name?: string;
3217
- price?: number;
3218
- points?: number;
3219
- bonus?: number;
3220
- description?: string;
3221
- sort?: number;
4230
+ id: string;
4231
+ name?: string;
4232
+ price?: number;
4233
+ points?: number;
4234
+ bonus?: number;
4235
+ description?: string;
4236
+ sort?: number;
4237
+ enabled?: boolean;
4238
+ }, config?: RequestConfig) => RequestBuilder<any>;
4239
+ };
4240
+ delete: {
4241
+ /** 删除充值套餐 */
4242
+ post: (body: {
4243
+ id: string;
4244
+ }, config?: RequestConfig) => RequestBuilder<any>;
4245
+ };
4246
+ updateSort: {
4247
+ /** 批量更新套餐排序 */
4248
+ post: (body: {
4249
+ items: {
4250
+ id: string;
4251
+ sort: number;
4252
+ }[];
4253
+ }, config?: RequestConfig) => RequestBuilder<any>;
4254
+ };
4255
+ };
4256
+ refund: {
4257
+ apply: {
4258
+ /** 对已支付订单申请退款 */
4259
+ post: (body: {
4260
+ orderId: string;
4261
+ reason?: string;
4262
+ refundAmount?: number;
4263
+ }, config?: RequestConfig) => RequestBuilder<any>;
4264
+ };
4265
+ applySubscription: {
4266
+ /** 对已支付订阅账单申请退款 */
4267
+ post: (body: {
4268
+ invoiceId: string;
4269
+ reason?: string;
4270
+ refundAmount?: number;
4271
+ subscriptionAction?: "cancel_immediate" | "none";
4272
+ }, config?: RequestConfig) => RequestBuilder<any>;
4273
+ };
4274
+ approve: {
4275
+ /** 审批退款申请(通过或拒绝) */
4276
+ post: (body: {
4277
+ refundNo: string;
4278
+ action: "approve" | "reject";
4279
+ remark?: string;
4280
+ }, config?: RequestConfig) => RequestBuilder<any>;
4281
+ };
4282
+ execute: {
4283
+ /** 执行已审批的退款(调用支付宝/微信退款接口) */
4284
+ post: (body: {
4285
+ refundNo: string;
4286
+ }, config?: RequestConfig) => RequestBuilder<any>;
4287
+ };
4288
+ manual: {
4289
+ /** 管理员手动标记退款完成(用于线上接口故障或特殊情况) */
4290
+ post: (body: {
4291
+ refundNo: string;
4292
+ manualRefundNo?: string;
4293
+ remark: string;
4294
+ }, config?: RequestConfig) => RequestBuilder<any>;
4295
+ };
4296
+ find: {
4297
+ /** 查询退款记录列表 */
4298
+ post: (body: {
4299
+ page?: number;
4300
+ pageSize?: number;
4301
+ status?: string;
4302
+ sourceType?: "points_recharge" | "subscription_invoice";
4303
+ userId?: string;
4304
+ startDate?: string;
4305
+ endDate?: string;
4306
+ }, config?: RequestConfig) => RequestBuilder<any>;
4307
+ };
4308
+ findOne: {
4309
+ /** 查询单个退款单详情 */
4310
+ post: (body: {
4311
+ refundNo: string;
4312
+ }, config?: RequestConfig) => RequestBuilder<any>;
4313
+ };
4314
+ stats: {
4315
+ /** 获取退款统计数据 */
4316
+ post: (body: {
4317
+ startDate?: string;
4318
+ endDate?: string;
4319
+ }, config?: RequestConfig) => RequestBuilder<any>;
4320
+ };
4321
+ syncStatus: {
4322
+ /** 手动同步单个退款单的支付宝退款状态 */
4323
+ post: (body: {
4324
+ refundNo: string;
4325
+ }, config?: RequestConfig) => RequestBuilder<any>;
4326
+ };
4327
+ statusOptions: {
4328
+ /** 获取退款单状态下拉选项与展示文案 */
4329
+ post: (config?: RequestConfig) => RequestBuilder<any>;
4330
+ };
4331
+ };
4332
+ serviceDefinition: {
4333
+ find: {
4334
+ /** 获取应用的所有服务定义 */
4335
+ post: (body: {
4336
+ page?: number;
4337
+ pageSize?: number;
4338
+ keyword?: string;
4339
+ enabled?: boolean;
4340
+ }, config?: RequestConfig) => RequestBuilder<any>;
4341
+ };
4342
+ create: {
4343
+ /** 创建新的服务定义 */
4344
+ post: (body: {
4345
+ serviceType: string;
4346
+ name: string;
4347
+ description?: string;
4348
+ }, config?: RequestConfig) => RequestBuilder<any>;
4349
+ };
4350
+ update: {
4351
+ /** 更新服务定义 */
4352
+ post: (body: {
4353
+ id: string;
4354
+ name?: string;
4355
+ description?: string;
4356
+ enabled?: boolean;
4357
+ }, config?: RequestConfig) => RequestBuilder<any>;
4358
+ };
4359
+ delete: {
4360
+ /** 删除服务定义 */
4361
+ post: (body: {
4362
+ id: string;
4363
+ }, config?: RequestConfig) => RequestBuilder<any>;
4364
+ };
4365
+ };
4366
+ usage: {
4367
+ report: {
4368
+ /** 上报服务用量,自动计费扣费 */
4369
+ post: (body: {
4370
+ serviceType: string;
4371
+ priceListId?: string;
4372
+ metadata: Record<string, unknown>;
4373
+ idempotencyKey?: string;
4374
+ resourceId?: string;
4375
+ }, config?: RequestConfig) => RequestBuilder<any>;
4376
+ };
4377
+ preview: {
4378
+ /** 按当前定价规则预估本次用量费用,不写入记录、不扣积分 */
4379
+ post: (body: {
4380
+ serviceType: string;
4381
+ priceListId?: string;
4382
+ metadata: Record<string, unknown>;
4383
+ freeQuotaOverride?: number;
4384
+ }, config?: RequestConfig) => RequestBuilder<any>;
4385
+ };
4386
+ stats: {
4387
+ /** 获取用量统计数据 */
4388
+ post: (body: {
4389
+ startDate?: string;
4390
+ endDate?: string;
4391
+ serviceType?: string;
4392
+ userId?: string;
4393
+ groupBy?: "day" | "service" | "user";
4394
+ }, config?: RequestConfig) => RequestBuilder<any>;
4395
+ };
4396
+ records: {
4397
+ /** 获取用量记录列表 */
4398
+ post: (body: {
4399
+ page?: number;
4400
+ pageSize?: number;
4401
+ id?: string;
4402
+ idempotencyKey?: string;
4403
+ resourceId?: string;
4404
+ serviceKey?: string;
4405
+ userId?: string;
4406
+ startDate?: string;
4407
+ endDate?: string;
4408
+ }, config?: RequestConfig) => RequestBuilder<any>;
4409
+ };
4410
+ };
4411
+ priceList: {
4412
+ find: {
4413
+ post: (body: {
4414
+ where?: {
4415
+ priceListId?: string;
4416
+ businessLineKey?: string;
4417
+ billingProductLineKey?: string;
4418
+ serviceKey?: string;
4419
+ meterKey?: string;
4420
+ pricingType?: "flat" | "tiered" | "meters";
4421
+ keyword?: string;
4422
+ enabled?: boolean;
4423
+ };
4424
+ page?: number;
4425
+ pageSize?: number;
4426
+ }, config?: RequestConfig) => RequestBuilder<any>;
4427
+ };
4428
+ findOne: {
4429
+ post: (body: {
4430
+ id: string;
4431
+ }, config?: RequestConfig) => RequestBuilder<any>;
4432
+ };
4433
+ options: {
4434
+ /** 筛选项、绑价表单 Select 用价目表下拉 */
4435
+ post: (body: {
4436
+ businessLineKey?: string;
4437
+ billingProductLineKey?: string;
4438
+ serviceKey?: string;
4439
+ pricingType?: "flat" | "tiered" | "meters";
4440
+ enabled?: boolean;
4441
+ }, config?: RequestConfig) => RequestBuilder<any>;
4442
+ };
4443
+ previewSchema: {
4444
+ /** 由所选计费项生成填价表单结构 */
4445
+ post: (body: {
4446
+ businessLineKey: string;
4447
+ serviceKey: string;
4448
+ meterRefs: {
4449
+ businessLineKey: string;
4450
+ serviceKey: string;
4451
+ meterKey: string;
4452
+ }[];
4453
+ }, config?: RequestConfig) => RequestBuilder<any>;
4454
+ };
4455
+ create: {
4456
+ post: (body: {
4457
+ businessLineKey: string;
4458
+ serviceKey: string;
4459
+ meterRefs?: {
4460
+ businessLineKey: string;
4461
+ serviceKey: string;
4462
+ meterKey: string;
4463
+ }[];
4464
+ name: string;
4465
+ currency?: "CNY" | "USD";
4466
+ enabled?: boolean;
4467
+ pricingValues: {
4468
+ type: "flat";
4469
+ originalPrice: number;
4470
+ sellPrice: number;
4471
+ } | {
4472
+ type: "tiered";
4473
+ priceStructure: "flat" | "segmented";
4474
+ tiers: {
4475
+ match?: Record<string, string>;
4476
+ tierRangeMode?: "at_most" | "at_least" | "between";
4477
+ minTokens?: number;
4478
+ maxTokens?: number;
4479
+ minInclusive?: boolean;
4480
+ maxInclusive?: boolean;
4481
+ originalFenPerUnit: number;
4482
+ sellFenPerUnit: number;
4483
+ billingEnabled: boolean;
4484
+ }[];
4485
+ } | {
4486
+ type: "meters";
4487
+ meters: {
4488
+ componentKey: string;
4489
+ businessLineKey: string;
4490
+ serviceKey: string;
4491
+ meterKey: string;
4492
+ tiers: {
4493
+ match?: Record<string, string>;
4494
+ tierRangeMode?: "at_most" | "at_least" | "between";
4495
+ minTokens?: number;
4496
+ maxTokens?: number;
4497
+ minInclusive?: boolean;
4498
+ maxInclusive?: boolean;
4499
+ originalFenPerUnit: number;
4500
+ sellFenPerUnit: number;
4501
+ billingEnabled: boolean;
4502
+ }[];
4503
+ }[];
4504
+ };
4505
+ }, config?: RequestConfig) => RequestBuilder<any>;
4506
+ };
4507
+ update: {
4508
+ post: (body: {
4509
+ id: string;
4510
+ name?: string;
4511
+ currency?: "CNY" | "USD";
4512
+ enabled?: boolean;
4513
+ meterRefs?: {
4514
+ businessLineKey: string;
4515
+ serviceKey: string;
4516
+ meterKey: string;
4517
+ }[];
4518
+ pricingValues?: {
4519
+ type: "flat";
4520
+ originalPrice: number;
4521
+ sellPrice: number;
4522
+ } | {
4523
+ type: "tiered";
4524
+ priceStructure: "flat" | "segmented";
4525
+ tiers: {
4526
+ match?: Record<string, string>;
4527
+ tierRangeMode?: "at_most" | "at_least" | "between";
4528
+ minTokens?: number;
4529
+ maxTokens?: number;
4530
+ minInclusive?: boolean;
4531
+ maxInclusive?: boolean;
4532
+ originalFenPerUnit: number;
4533
+ sellFenPerUnit: number;
4534
+ billingEnabled: boolean;
4535
+ }[];
4536
+ } | {
4537
+ type: "meters";
4538
+ meters: {
4539
+ componentKey: string;
4540
+ businessLineKey: string;
4541
+ serviceKey: string;
4542
+ meterKey: string;
4543
+ tiers: {
4544
+ match?: Record<string, string>;
4545
+ tierRangeMode?: "at_most" | "at_least" | "between";
4546
+ minTokens?: number;
4547
+ maxTokens?: number;
4548
+ minInclusive?: boolean;
4549
+ maxInclusive?: boolean;
4550
+ originalFenPerUnit: number;
4551
+ sellFenPerUnit: number;
4552
+ billingEnabled: boolean;
4553
+ }[];
4554
+ }[];
4555
+ };
4556
+ }, config?: RequestConfig) => RequestBuilder<any>;
4557
+ };
4558
+ delete: {
4559
+ post: (body: {
4560
+ id: string;
4561
+ }, config?: RequestConfig) => RequestBuilder<any>;
4562
+ };
4563
+ };
4564
+ priceBinding: {
4565
+ find: {
4566
+ post: (body: {
4567
+ where?: {
4568
+ subjectType?: "model-profile";
4569
+ subjectKey?: string;
4570
+ serviceKey?: string;
4571
+ businessLineKey?: string;
4572
+ enabled?: boolean;
4573
+ };
4574
+ }, config?: RequestConfig) => RequestBuilder<any>;
4575
+ };
4576
+ upsert: {
4577
+ post: (body: {
4578
+ subjectType: "model-profile";
4579
+ subjectKey: string;
4580
+ priceListId: string;
3222
4581
  enabled?: boolean;
3223
- }, config?: RequestConfig) => Promise<ApiResponse<any>>;
4582
+ }, config?: RequestConfig) => RequestBuilder<any>;
3224
4583
  };
3225
4584
  delete: {
3226
- /** 删除充值套餐 */
3227
4585
  post: (body: {
3228
4586
  id: string;
3229
- }, config?: RequestConfig) => Promise<ApiResponse<any>>;
4587
+ }, config?: RequestConfig) => RequestBuilder<any>;
3230
4588
  };
3231
- updateSort: {
3232
- /** 批量更新套餐排序 */
4589
+ };
4590
+ businessLine: {
4591
+ find: {
3233
4592
  post: (body: {
3234
- items: {
3235
- id: string;
3236
- sort: number;
3237
- }[];
3238
- }, config?: RequestConfig) => Promise<ApiResponse<any>>;
4593
+ where?: {
4594
+ keyword?: string;
4595
+ enabled?: boolean;
4596
+ };
4597
+ withStats?: boolean;
4598
+ page?: number;
4599
+ pageSize?: number;
4600
+ }, config?: RequestConfig) => RequestBuilder<any>;
3239
4601
  };
3240
- };
3241
- refund: {
3242
- apply: {
3243
- /** 对已支付订单申请退款 */
4602
+ findOne: {
3244
4603
  post: (body: {
3245
- orderId: string;
3246
- reason?: string;
3247
- refundAmount?: number;
3248
- }, config?: RequestConfig) => Promise<ApiResponse<any>>;
4604
+ businessLineKey: string;
4605
+ }, config?: RequestConfig) => RequestBuilder<any>;
3249
4606
  };
3250
- applySubscription: {
3251
- /** 对已支付订阅账单申请退款 */
4607
+ options: {
4608
+ /** 筛选项、表单 Select 用业务线下拉 */
3252
4609
  post: (body: {
3253
- invoiceId: string;
3254
- reason?: string;
3255
- refundAmount?: number;
3256
- subscriptionAction?: "cancel_immediate" | "none";
3257
- }, config?: RequestConfig) => Promise<ApiResponse<any>>;
4610
+ enabled?: boolean;
4611
+ }, config?: RequestConfig) => RequestBuilder<any>;
3258
4612
  };
3259
- approve: {
3260
- /** 审批退款申请(通过或拒绝) */
4613
+ create: {
3261
4614
  post: (body: {
3262
- refundNo: string;
3263
- action: "approve" | "reject";
3264
- remark?: string;
3265
- }, config?: RequestConfig) => Promise<ApiResponse<any>>;
4615
+ businessLineKey: string;
4616
+ label: string;
4617
+ }, config?: RequestConfig) => RequestBuilder<any>;
3266
4618
  };
3267
- execute: {
3268
- /** 执行已审批的退款(调用支付宝/微信退款接口) */
4619
+ update: {
3269
4620
  post: (body: {
3270
- refundNo: string;
3271
- }, config?: RequestConfig) => Promise<ApiResponse<any>>;
4621
+ businessLineKey: string;
4622
+ label?: string;
4623
+ enabled?: boolean;
4624
+ }, config?: RequestConfig) => RequestBuilder<any>;
3272
4625
  };
3273
- manual: {
3274
- /** 管理员手动标记退款完成(用于线上接口故障或特殊情况) */
4626
+ delete: {
3275
4627
  post: (body: {
3276
- refundNo: string;
3277
- manualRefundNo?: string;
3278
- remark: string;
3279
- }, config?: RequestConfig) => Promise<ApiResponse<any>>;
4628
+ businessLineKey: string;
4629
+ }, config?: RequestConfig) => RequestBuilder<any>;
3280
4630
  };
3281
- list: {
3282
- /** 查询退款记录列表 */
4631
+ };
4632
+ billingProductLine: {
4633
+ find: {
3283
4634
  post: (body: {
4635
+ where?: {
4636
+ businessLineKey?: string;
4637
+ keyword?: string;
4638
+ enabled?: boolean;
4639
+ };
4640
+ withStats?: boolean;
3284
4641
  page?: number;
3285
4642
  pageSize?: number;
3286
- status?: string;
3287
- sourceType?: "points_recharge" | "subscription_invoice";
3288
- userId?: string;
3289
- startDate?: string;
3290
- endDate?: string;
3291
- }, config?: RequestConfig) => Promise<ApiResponse<any>>;
4643
+ }, config?: RequestConfig) => RequestBuilder<any>;
3292
4644
  };
3293
- detail: {
3294
- /** 查询单个退款单详情 */
4645
+ findOne: {
3295
4646
  post: (body: {
3296
- refundNo: string;
3297
- }, config?: RequestConfig) => Promise<ApiResponse<any>>;
4647
+ productLineId: string;
4648
+ }, config?: RequestConfig) => RequestBuilder<any>;
3298
4649
  };
3299
- stats: {
3300
- /** 获取退款统计数据 */
4650
+ options: {
4651
+ /** 筛选项、表单 Select 用产品线下拉 */
3301
4652
  post: (body: {
3302
- startDate?: string;
3303
- endDate?: string;
3304
- }, config?: RequestConfig) => Promise<ApiResponse<any>>;
4653
+ businessLineKey?: string;
4654
+ enabled?: boolean;
4655
+ }, config?: RequestConfig) => RequestBuilder<any>;
3305
4656
  };
3306
- syncStatus: {
3307
- /** 手动同步单个退款单的支付宝退款状态 */
4657
+ create: {
3308
4658
  post: (body: {
3309
- refundNo: string;
3310
- }, config?: RequestConfig) => Promise<ApiResponse<any>>;
4659
+ businessLineKey: string;
4660
+ productLineKey: string;
4661
+ label: string;
4662
+ }, config?: RequestConfig) => RequestBuilder<any>;
3311
4663
  };
3312
- statusOptions: {
3313
- /** 获取退款单状态下拉选项与展示文案 */
3314
- post: (config?: RequestConfig) => Promise<ApiResponse<any>>;
4664
+ update: {
4665
+ post: (body: {
4666
+ productLineId: string;
4667
+ label?: string;
4668
+ enabled?: boolean;
4669
+ }, config?: RequestConfig) => RequestBuilder<any>;
4670
+ };
4671
+ delete: {
4672
+ post: (body: {
4673
+ productLineId: string;
4674
+ }, config?: RequestConfig) => RequestBuilder<any>;
3315
4675
  };
3316
4676
  };
3317
- serviceDefinition: {
3318
- list: {
3319
- /** 获取应用的所有服务定义 */
4677
+ billingServiceCatalog: {
4678
+ service: {
4679
+ find: {
4680
+ post: (body: {
4681
+ where?: {
4682
+ businessLineKey?: string;
4683
+ billingProductLineKey?: string;
4684
+ productLine?: string;
4685
+ source?: "builtin" | "custom";
4686
+ serviceKey?: string;
4687
+ keyword?: string;
4688
+ enabled?: boolean;
4689
+ };
4690
+ page?: number;
4691
+ pageSize?: number;
4692
+ }, config?: RequestConfig) => RequestBuilder<any>;
4693
+ };
4694
+ options: {
4695
+ /** 筛选项、表单 Select 用服务下拉 */
4696
+ post: (body: {
4697
+ businessLineKey?: string;
4698
+ billingProductLineKey?: string;
4699
+ enabled?: boolean;
4700
+ }, config?: RequestConfig) => RequestBuilder<any>;
4701
+ };
4702
+ create: {
4703
+ post: (body: {
4704
+ businessLineKey: string;
4705
+ billingProductLineKey: string;
4706
+ serviceType: string;
4707
+ name: string;
4708
+ description?: string;
4709
+ dependencies?: {
4710
+ businessLineKey: string;
4711
+ billingProductLineKey: string;
4712
+ serviceKey: string;
4713
+ meterKeys?: string[];
4714
+ required?: boolean;
4715
+ }[];
4716
+ }, config?: RequestConfig) => RequestBuilder<any>;
4717
+ };
4718
+ update: {
4719
+ post: (body: {
4720
+ businessLineKey: string;
4721
+ serviceKey: string;
4722
+ label?: string;
4723
+ description?: string;
4724
+ billingProductLineKey?: string;
4725
+ dependencies?: {
4726
+ businessLineKey: string;
4727
+ billingProductLineKey: string;
4728
+ serviceKey: string;
4729
+ meterKeys?: string[];
4730
+ required?: boolean;
4731
+ }[];
4732
+ enabled?: boolean;
4733
+ }, config?: RequestConfig) => RequestBuilder<any>;
4734
+ };
4735
+ delete: {
4736
+ post: (body: {
4737
+ businessLineKey: string;
4738
+ serviceKey: string;
4739
+ }, config?: RequestConfig) => RequestBuilder<any>;
4740
+ };
4741
+ };
4742
+ runtime: {
4743
+ export: {
4744
+ /** 前端运行时缓存:服务 + 价目表 operation */
4745
+ post: (config?: RequestConfig) => RequestBuilder<any>;
4746
+ };
4747
+ };
4748
+ };
4749
+ billingMeter: {
4750
+ find: {
3320
4751
  post: (body: {
4752
+ where?: {
4753
+ businessLineKey?: string;
4754
+ billingProductLineKey?: string;
4755
+ serviceKey?: string;
4756
+ chargeMode?: "instant" | "settlement";
4757
+ source?: "builtin" | "custom";
4758
+ keyword?: string;
4759
+ enabled?: boolean;
4760
+ };
3321
4761
  page?: number;
3322
4762
  pageSize?: number;
3323
- }, config?: RequestConfig) => Promise<ApiResponse<any>>;
4763
+ }, config?: RequestConfig) => RequestBuilder<any>;
4764
+ };
4765
+ options: {
4766
+ post: (body: {
4767
+ businessLineKey?: string;
4768
+ billingProductLineKey?: string;
4769
+ serviceKey?: string;
4770
+ enabled?: boolean;
4771
+ }, config?: RequestConfig) => RequestBuilder<any>;
3324
4772
  };
3325
4773
  create: {
3326
- /** 创建新的服务定义 */
3327
4774
  post: (body: {
3328
- serviceType: string;
3329
- name: string;
4775
+ businessLineKey: string;
4776
+ serviceKey: string;
4777
+ meterKey: string;
4778
+ label: string;
3330
4779
  description?: string;
3331
- billingUnit: string;
3332
- billingMode?: "event" | "continuous";
3333
- }, config?: RequestConfig) => Promise<ApiResponse<any>>;
4780
+ chargeMode?: "instant" | "settlement";
4781
+ settlementPeriod?: "hour" | "day" | "month";
4782
+ pricingSchema?: {
4783
+ unitLabel: string;
4784
+ quantityScale?: number;
4785
+ priceStructure?: "flat" | "segmented" | "keyed";
4786
+ matchKeys?: {
4787
+ key: string;
4788
+ label: string;
4789
+ values: {
4790
+ value: string;
4791
+ label: string;
4792
+ }[];
4793
+ }[];
4794
+ tiers: {
4795
+ match?: Record<string, string>;
4796
+ tierRangeMode?: "at_most" | "at_least" | "between";
4797
+ minTokens?: number;
4798
+ maxTokens?: number;
4799
+ minInclusive?: boolean;
4800
+ maxInclusive?: boolean;
4801
+ }[];
4802
+ };
4803
+ enabled?: boolean;
4804
+ }, config?: RequestConfig) => RequestBuilder<any>;
3334
4805
  };
3335
4806
  update: {
3336
- /** 更新服务定义 */
3337
4807
  post: (body: {
3338
4808
  id: string;
3339
- name?: string;
4809
+ businessLineKey?: string;
4810
+ serviceKey?: string;
4811
+ meterKey?: string;
4812
+ label?: string;
3340
4813
  description?: string;
3341
- billingUnit?: string;
3342
- billingMode?: "event" | "continuous";
4814
+ chargeMode?: "instant" | "settlement";
4815
+ settlementPeriod?: "hour" | "day" | "month";
4816
+ pricingSchema?: {
4817
+ unitLabel: string;
4818
+ quantityScale?: number;
4819
+ priceStructure?: "flat" | "segmented" | "keyed";
4820
+ matchKeys?: {
4821
+ key: string;
4822
+ label: string;
4823
+ values: {
4824
+ value: string;
4825
+ label: string;
4826
+ }[];
4827
+ }[];
4828
+ tiers: {
4829
+ match?: Record<string, string>;
4830
+ tierRangeMode?: "at_most" | "at_least" | "between";
4831
+ minTokens?: number;
4832
+ maxTokens?: number;
4833
+ minInclusive?: boolean;
4834
+ maxInclusive?: boolean;
4835
+ }[];
4836
+ };
3343
4837
  enabled?: boolean;
3344
- }, config?: RequestConfig) => Promise<ApiResponse<any>>;
4838
+ }, config?: RequestConfig) => RequestBuilder<any>;
3345
4839
  };
3346
4840
  delete: {
3347
- /** 删除服务定义 */
3348
4841
  post: (body: {
3349
4842
  id: string;
3350
- }, config?: RequestConfig) => Promise<ApiResponse<any>>;
3351
- };
3352
- };
3353
- pricingRule: {
3354
- get: {
3355
- /** 获取服务的定价规则 */
3356
- post: (body: {
3357
- serviceType: string;
3358
- }, config?: RequestConfig) => Promise<ApiResponse<any>>;
3359
- };
3360
- save: {
3361
- /** 创建或更新定价规则 */
3362
- post: (body: {
3363
- serviceType: string;
3364
- tiers?: {
3365
- minUsage: number;
3366
- maxUsage: number | null;
3367
- pricePerUnit: number;
3368
- }[];
3369
- flatPrice?: number | null;
3370
- freeQuota?: number;
3371
- profitMargin?: number;
3372
- enabled?: boolean;
3373
- }, config?: RequestConfig) => Promise<ApiResponse<any>>;
4843
+ }, config?: RequestConfig) => RequestBuilder<any>;
3374
4844
  };
3375
4845
  };
3376
- usage: {
3377
- report: {
3378
- /** 上报服务用量,自动计费扣费 */
3379
- post: (body: {
3380
- serviceType: string;
3381
- metadata: Record<string, unknown>;
3382
- requestId?: string;
3383
- }, config?: RequestConfig) => Promise<ApiResponse<any>>;
3384
- };
3385
- preview: {
3386
- /** 按当前定价规则预估本次用量费用,不写入记录、不扣积分 */
4846
+ billingMeterChargeItem: {
4847
+ find: {
3387
4848
  post: (body: {
3388
- serviceType: string;
3389
- metadata: Record<string, unknown>;
3390
- freeQuotaOverride?: number;
3391
- }, config?: RequestConfig) => Promise<ApiResponse<any>>;
4849
+ where?: {
4850
+ keyword?: string;
4851
+ userId?: string;
4852
+ businessLineKey?: string;
4853
+ billingProductLineKey?: string;
4854
+ serviceKey?: string;
4855
+ meterKey?: string;
4856
+ priceListId?: string;
4857
+ pricingType?: "flat" | "tiered" | "meters";
4858
+ resourceId?: string;
4859
+ subjectKey?: string;
4860
+ idempotencyKey?: string;
4861
+ billingUsageRecordId?: string;
4862
+ chargeMode?: "instant" | "settlement";
4863
+ status?: "pending" | "accumulating" | "charged" | "failed" | "canceled";
4864
+ startDate?: string;
4865
+ endDate?: string;
4866
+ };
4867
+ page?: number;
4868
+ pageSize?: number;
4869
+ }, config?: RequestConfig) => RequestBuilder<any>;
3392
4870
  };
3393
- stats: {
3394
- /** 获取用量统计数据 */
4871
+ overview: {
3395
4872
  post: (body: {
3396
- startDate?: string;
3397
- endDate?: string;
3398
- serviceType?: string;
3399
- groupBy?: "day" | "service" | "user";
3400
- }, config?: RequestConfig) => Promise<ApiResponse<any>>;
4873
+ where?: {
4874
+ keyword?: string;
4875
+ userId?: string;
4876
+ businessLineKey?: string;
4877
+ billingProductLineKey?: string;
4878
+ serviceKey?: string;
4879
+ meterKey?: string;
4880
+ priceListId?: string;
4881
+ pricingType?: "flat" | "tiered" | "meters";
4882
+ resourceId?: string;
4883
+ subjectKey?: string;
4884
+ idempotencyKey?: string;
4885
+ billingUsageRecordId?: string;
4886
+ chargeMode?: "instant" | "settlement";
4887
+ status?: "pending" | "accumulating" | "charged" | "failed" | "canceled";
4888
+ startDate?: string;
4889
+ endDate?: string;
4890
+ };
4891
+ }, config?: RequestConfig) => RequestBuilder<any>;
3401
4892
  };
3402
- records: {
3403
- /** 获取用量记录列表 */
4893
+ trend: {
3404
4894
  post: (body: {
3405
- page?: number;
3406
- pageSize?: number;
3407
- serviceType?: string;
3408
- startDate?: string;
3409
- endDate?: string;
3410
- }, config?: RequestConfig) => Promise<ApiResponse<any>>;
4895
+ where?: {
4896
+ keyword?: string;
4897
+ userId?: string;
4898
+ businessLineKey?: string;
4899
+ billingProductLineKey?: string;
4900
+ serviceKey?: string;
4901
+ meterKey?: string;
4902
+ priceListId?: string;
4903
+ pricingType?: "flat" | "tiered" | "meters";
4904
+ resourceId?: string;
4905
+ subjectKey?: string;
4906
+ idempotencyKey?: string;
4907
+ billingUsageRecordId?: string;
4908
+ chargeMode?: "instant" | "settlement";
4909
+ status?: "pending" | "accumulating" | "charged" | "failed" | "canceled";
4910
+ startDate?: string;
4911
+ endDate?: string;
4912
+ };
4913
+ limit?: number;
4914
+ }, config?: RequestConfig) => RequestBuilder<any>;
3411
4915
  };
3412
4916
  };
3413
4917
  export: {
@@ -3417,7 +4921,7 @@ export interface ApiClient {
3417
4921
  startDate?: string;
3418
4922
  endDate?: string;
3419
4923
  status?: string;
3420
- }, config?: RequestConfig) => Promise<ApiResponse<any>>;
4924
+ }, config?: RequestConfig) => RequestBuilder<any>;
3421
4925
  };
3422
4926
  refund: {
3423
4927
  /** 导出退款记录为 CSV 格式 */
@@ -3425,7 +4929,7 @@ export interface ApiClient {
3425
4929
  startDate?: string;
3426
4930
  endDate?: string;
3427
4931
  status?: string;
3428
- }, config?: RequestConfig) => Promise<ApiResponse<any>>;
4932
+ }, config?: RequestConfig) => RequestBuilder<any>;
3429
4933
  };
3430
4934
  pointsHistory: {
3431
4935
  /** 导出积分变动记录为 CSV 格式 */
@@ -3434,7 +4938,7 @@ export interface ApiClient {
3434
4938
  endDate?: string;
3435
4939
  type?: string;
3436
4940
  userId?: string;
3437
- }, config?: RequestConfig) => Promise<ApiResponse<any>>;
4941
+ }, config?: RequestConfig) => RequestBuilder<any>;
3438
4942
  };
3439
4943
  };
3440
4944
  financeReport: {
@@ -3443,14 +4947,14 @@ export interface ApiClient {
3443
4947
  post: (body: {
3444
4948
  startDate?: string;
3445
4949
  endDate?: string;
3446
- }, config?: RequestConfig) => Promise<ApiResponse<any>>;
4950
+ }, config?: RequestConfig) => RequestBuilder<any>;
3447
4951
  };
3448
4952
  trend: {
3449
4953
  /** 获取收入趋势数据(按日/周/月) */
3450
4954
  post: (body: {
3451
4955
  period: "day" | "week" | "month";
3452
4956
  days?: number;
3453
- }, config?: RequestConfig) => Promise<ApiResponse<any>>;
4957
+ }, config?: RequestConfig) => RequestBuilder<any>;
3454
4958
  };
3455
4959
  packageRank: {
3456
4960
  /** 获取套餐销售排行数据 */
@@ -3458,7 +4962,7 @@ export interface ApiClient {
3458
4962
  startDate?: string;
3459
4963
  endDate?: string;
3460
4964
  limit?: number;
3461
- }, config?: RequestConfig) => Promise<ApiResponse<any>>;
4965
+ }, config?: RequestConfig) => RequestBuilder<any>;
3462
4966
  };
3463
4967
  userRank: {
3464
4968
  /** 获取用户充值排行数据 */
@@ -3466,7 +4970,7 @@ export interface ApiClient {
3466
4970
  startDate?: string;
3467
4971
  endDate?: string;
3468
4972
  limit?: number;
3469
- }, config?: RequestConfig) => Promise<ApiResponse<any>>;
4973
+ }, config?: RequestConfig) => RequestBuilder<any>;
3470
4974
  };
3471
4975
  };
3472
4976
  reconciliation: {
@@ -3474,9 +4978,9 @@ export interface ApiClient {
3474
4978
  /** 生成指定日期的对账报告 */
3475
4979
  post: (body: {
3476
4980
  date: string;
3477
- }, config?: RequestConfig) => Promise<ApiResponse<any>>;
4981
+ }, config?: RequestConfig) => RequestBuilder<any>;
3478
4982
  };
3479
- list: {
4983
+ find: {
3480
4984
  /** 查询对账报告列表 */
3481
4985
  post: (body: {
3482
4986
  page?: number;
@@ -3484,13 +4988,13 @@ export interface ApiClient {
3484
4988
  status?: string;
3485
4989
  startDate?: string;
3486
4990
  endDate?: string;
3487
- }, config?: RequestConfig) => Promise<ApiResponse<any>>;
4991
+ }, config?: RequestConfig) => RequestBuilder<any>;
3488
4992
  };
3489
- detail: {
4993
+ findOne: {
3490
4994
  /** 查询对账报告详情 */
3491
4995
  post: (body: {
3492
4996
  id: string;
3493
- }, config?: RequestConfig) => Promise<ApiResponse<any>>;
4997
+ }, config?: RequestConfig) => RequestBuilder<any>;
3494
4998
  };
3495
4999
  processAnomaly: {
3496
5000
  /** 处理对账异常订单 */
@@ -3499,14 +5003,14 @@ export interface ApiClient {
3499
5003
  orderId: string;
3500
5004
  action: "confirm_paid" | "mark_cancelled" | "ignore";
3501
5005
  remark?: string;
3502
- }, config?: RequestConfig) => Promise<ApiResponse<any>>;
5006
+ }, config?: RequestConfig) => RequestBuilder<any>;
3503
5007
  };
3504
5008
  batchGenerate: {
3505
5009
  /** 批量生成指定日期范围的对账报告 */
3506
5010
  post: (body: {
3507
5011
  startDate: string;
3508
5012
  endDate: string;
3509
- }, config?: RequestConfig) => Promise<ApiResponse<any>>;
5013
+ }, config?: RequestConfig) => RequestBuilder<any>;
3510
5014
  };
3511
5015
  };
3512
5016
  invoice: {
@@ -3526,9 +5030,9 @@ export interface ApiClient {
3526
5030
  receiverAddress?: string;
3527
5031
  orderIds?: string[];
3528
5032
  remark?: string;
3529
- }, config?: RequestConfig) => Promise<ApiResponse<any>>;
5033
+ }, config?: RequestConfig) => RequestBuilder<any>;
3530
5034
  };
3531
- list: {
5035
+ find: {
3532
5036
  /** 查询发票申请列表 */
3533
5037
  post: (body: {
3534
5038
  page?: number;
@@ -3537,13 +5041,13 @@ export interface ApiClient {
3537
5041
  userId?: string;
3538
5042
  startDate?: string;
3539
5043
  endDate?: string;
3540
- }, config?: RequestConfig) => Promise<ApiResponse<any>>;
5044
+ }, config?: RequestConfig) => RequestBuilder<any>;
3541
5045
  };
3542
- detail: {
5046
+ findOne: {
3543
5047
  /** 查询发票详情 */
3544
5048
  post: (body: {
3545
5049
  invoiceNo: string;
3546
- }, config?: RequestConfig) => Promise<ApiResponse<any>>;
5050
+ }, config?: RequestConfig) => RequestBuilder<any>;
3547
5051
  };
3548
5052
  review: {
3549
5053
  /** 审核发票申请(通过/拒绝) */
@@ -3551,7 +5055,7 @@ export interface ApiClient {
3551
5055
  invoiceNo: string;
3552
5056
  action: "approve" | "reject";
3553
5057
  remark?: string;
3554
- }, config?: RequestConfig) => Promise<ApiResponse<any>>;
5058
+ }, config?: RequestConfig) => RequestBuilder<any>;
3555
5059
  };
3556
5060
  issue: {
3557
5061
  /** 标记发票已开具 */
@@ -3560,20 +5064,20 @@ export interface ApiClient {
3560
5064
  invoiceCode?: string;
3561
5065
  invoiceNumber?: string;
3562
5066
  invoiceUrl?: string;
3563
- }, config?: RequestConfig) => Promise<ApiResponse<any>>;
5067
+ }, config?: RequestConfig) => RequestBuilder<any>;
3564
5068
  };
3565
5069
  stats: {
3566
5070
  /** 获取发票统计数据 */
3567
5071
  post: (body: {
3568
5072
  startDate?: string;
3569
5073
  endDate?: string;
3570
- }, config?: RequestConfig) => Promise<ApiResponse<any>>;
5074
+ }, config?: RequestConfig) => RequestBuilder<any>;
3571
5075
  };
3572
5076
  cancel: {
3573
5077
  /** 取消发票申请(仅待审核状态可取消) */
3574
5078
  post: (body: {
3575
5079
  invoiceNo: string;
3576
- }, config?: RequestConfig) => Promise<ApiResponse<any>>;
5080
+ }, config?: RequestConfig) => RequestBuilder<any>;
3577
5081
  };
3578
5082
  };
3579
5083
  agreement: {
@@ -3584,39 +5088,39 @@ export interface ApiClient {
3584
5088
  period: number;
3585
5089
  singleAmount: number;
3586
5090
  totalAmount?: number;
3587
- }, config?: RequestConfig) => Promise<ApiResponse<any>>;
5091
+ }, config?: RequestConfig) => RequestBuilder<any>;
3588
5092
  };
3589
5093
  query: {
3590
5094
  /** 查询签约状态 */
3591
5095
  post: (body: {
3592
5096
  externalAgreementNo?: string;
3593
- }, config?: RequestConfig) => Promise<ApiResponse<any>>;
5097
+ }, config?: RequestConfig) => RequestBuilder<any>;
3594
5098
  };
3595
5099
  my: {
3596
5100
  /** 获取当前用户的签约信息 */
3597
- post: (config?: RequestConfig) => Promise<ApiResponse<any>>;
5101
+ post: (config?: RequestConfig) => RequestBuilder<any>;
3598
5102
  };
3599
5103
  unsign: {
3600
5104
  /** 解除签约授权 */
3601
- post: (config?: RequestConfig) => Promise<ApiResponse<any>>;
5105
+ post: (config?: RequestConfig) => RequestBuilder<any>;
3602
5106
  };
3603
5107
  history: {
3604
5108
  /** 查询签约历史记录 */
3605
5109
  post: (body: {
3606
5110
  page?: number;
3607
5111
  pageSize?: number;
3608
- }, config?: RequestConfig) => Promise<ApiResponse<any>>;
5112
+ }, config?: RequestConfig) => RequestBuilder<any>;
3609
5113
  };
3610
5114
  deductLogs: {
3611
5115
  /** 查询代扣扣款记录 */
3612
5116
  post: (body: {
3613
5117
  page?: number;
3614
5118
  pageSize?: number;
3615
- }, config?: RequestConfig) => Promise<ApiResponse<any>>;
5119
+ }, config?: RequestConfig) => RequestBuilder<any>;
3616
5120
  };
3617
5121
  signNotify: {
3618
5122
  /** 支付宝签约异步通知回调 */
3619
- post: (config?: RequestConfig) => Promise<ApiResponse<any>>;
5123
+ post: (config?: RequestConfig) => RequestBuilder<any>;
3620
5124
  };
3621
5125
  };
3622
5126
  internal: {
@@ -3628,7 +5132,7 @@ export interface ApiClient {
3628
5132
  userId: string;
3629
5133
  event: string;
3630
5134
  eventData?: Record<string, unknown>;
3631
- }, config?: RequestConfig) => Promise<ApiResponse<any>>;
5135
+ }, config?: RequestConfig) => RequestBuilder<any>;
3632
5136
  };
3633
5137
  };
3634
5138
  usage: {
@@ -3637,10 +5141,12 @@ export interface ApiClient {
3637
5141
  post: (body: {
3638
5142
  appId: string;
3639
5143
  userId: string;
3640
- serviceType: string;
5144
+ businessLineKey: string;
5145
+ serviceKey: string;
5146
+ priceListId: string;
3641
5147
  amount: number;
3642
5148
  freeQuotaOverride?: number;
3643
- }, config?: RequestConfig) => Promise<ApiResponse<any>>;
5149
+ }, config?: RequestConfig) => RequestBuilder<any>;
3644
5150
  };
3645
5151
  previewBatch: {
3646
5152
  /** 供内部服务批量预估通用计费用量,不写入记录、不扣积分 */
@@ -3649,41 +5155,197 @@ export interface ApiClient {
3649
5155
  items: {
3650
5156
  key: string;
3651
5157
  userId: string;
3652
- serviceType: string;
5158
+ businessLineKey: string;
5159
+ serviceKey: string;
5160
+ priceListId?: string;
3653
5161
  amount: number;
3654
5162
  freeQuotaOverride?: number;
3655
5163
  }[];
3656
- }, config?: RequestConfig) => Promise<ApiResponse<any>>;
5164
+ }, config?: RequestConfig) => RequestBuilder<any>;
3657
5165
  };
3658
5166
  report: {
3659
5167
  /** 供内部服务上报通用计费用量并扣积分 */
3660
5168
  post: (body: {
3661
5169
  appId: string;
3662
5170
  userId: string;
3663
- serviceType: string;
5171
+ businessLineKey: string;
5172
+ serviceKey: string;
5173
+ priceListId?: string;
3664
5174
  amount: number;
3665
5175
  metadata?: Record<string, unknown>;
3666
- requestId?: string;
5176
+ idempotencyKey?: string;
5177
+ resourceId?: string;
3667
5178
  usageKind?: "event" | "continuous_settlement";
3668
5179
  periodStart?: string;
3669
5180
  periodEnd?: string;
3670
5181
  freeQuotaOverride?: number;
3671
- }, config?: RequestConfig) => Promise<ApiResponse<any>>;
5182
+ }, config?: RequestConfig) => RequestBuilder<any>;
5183
+ };
5184
+ reversal: {
5185
+ /** 供内部服务冲正已上报的服务用量并退还积分 */
5186
+ post: (body: {
5187
+ appId: string;
5188
+ userId: string;
5189
+ idempotencyKey: string;
5190
+ reason?: string;
5191
+ reversalIdempotencyKey?: string;
5192
+ }, config?: RequestConfig) => RequestBuilder<any>;
5193
+ };
5194
+ 'preview-meter-charge': {
5195
+ /** 供 ai-server 等根据价目表与 meter 用量计算积分 */
5196
+ post: (body: {
5197
+ appId: string;
5198
+ businessLineKey: string;
5199
+ serviceKey: string;
5200
+ priceListId?: string;
5201
+ meterUsage: Record<string, number>;
5202
+ meterMatchContext?: Record<string, Record<string, string>>;
5203
+ meterTierMatchUsage?: Record<string, number>;
5204
+ exchangeRate?: number;
5205
+ }, config?: RequestConfig) => RequestBuilder<any>;
5206
+ };
5207
+ 'record-ai': {
5208
+ /** 供 ai-server 传入 meter 用量,由计费引擎算价并扣积分 */
5209
+ post: (body: {
5210
+ appId: string;
5211
+ userId: string;
5212
+ businessLineKey: string;
5213
+ idempotencyKey: string;
5214
+ serviceKey: string;
5215
+ priceListId: string;
5216
+ resourceId?: string;
5217
+ subjectKey: string;
5218
+ sourceService?: string;
5219
+ sourceType?: string;
5220
+ sourceId?: string;
5221
+ labels?: Record<string, string>;
5222
+ quantity: number;
5223
+ unit: string;
5224
+ meterUsage: Record<string, number>;
5225
+ meterMatchContext?: Record<string, Record<string, string>>;
5226
+ meterTierMatchUsage?: Record<string, number>;
5227
+ exchangeRate?: number;
5228
+ snapshot?: {
5229
+ priceListId?: string;
5230
+ usage?: Record<string, number>;
5231
+ cost?: Record<string, unknown>;
5232
+ };
5233
+ }, config?: RequestConfig) => RequestBuilder<any>;
5234
+ };
5235
+ find: {
5236
+ /** 供 ai-server 等内部服务查询 billingUsageRecord */
5237
+ post: (body: {
5238
+ appId: string;
5239
+ userId?: string;
5240
+ serviceGroup?: "ai" | "platform" | "storage";
5241
+ serviceGroups?: "ai" | "platform" | "storage"[];
5242
+ resourceId?: string;
5243
+ serviceKey?: string;
5244
+ model?: string;
5245
+ subjectKeys?: string[];
5246
+ id?: string;
5247
+ requestId?: string;
5248
+ startTime?: string;
5249
+ endTime?: string;
5250
+ page?: number;
5251
+ pageSize?: number;
5252
+ }, config?: RequestConfig) => RequestBuilder<any>;
5253
+ };
5254
+ 'stats-ai': {
5255
+ /** 供 ai-server 查询 AI 用量聚合统计 */
5256
+ post: (body: {
5257
+ appId: string;
5258
+ userId?: string;
5259
+ subjectKeys?: string[];
5260
+ startTime?: string;
5261
+ endTime?: string;
5262
+ timezone?: string;
5263
+ }, config?: RequestConfig) => RequestBuilder<any>;
5264
+ };
5265
+ 'by-resource': {
5266
+ /** 按 resourceId 联合查询用量与积分流水 */
5267
+ post: (body: {
5268
+ appId: string;
5269
+ resourceId: string;
5270
+ serviceKey?: string;
5271
+ }, config?: RequestConfig) => RequestBuilder<any>;
5272
+ };
5273
+ };
5274
+ pricing: {
5275
+ 'resolve-model': {
5276
+ /** 供 ai-server 运行时读取模型定价 */
5277
+ post: (body: {
5278
+ appId: string;
5279
+ supplierId: string;
5280
+ profileId: string;
5281
+ productLine?: string;
5282
+ billingPlan?: string;
5283
+ }, config?: RequestConfig) => RequestBuilder<any>;
5284
+ };
5285
+ 'sync-model': {
5286
+ post: (body: {
5287
+ appId: string;
5288
+ operatorId: string;
5289
+ supplierId: string;
5290
+ profileId: string;
5291
+ profileName?: string;
5292
+ productLine: string;
5293
+ currency: "CNY" | "USD";
5294
+ plans: unknown[];
5295
+ }, config?: RequestConfig) => RequestBuilder<any>;
5296
+ };
5297
+ 'delete-model': {
5298
+ post: (body: {
5299
+ appId: string;
5300
+ supplierId: string;
5301
+ profileId: string;
5302
+ }, config?: RequestConfig) => RequestBuilder<any>;
5303
+ };
5304
+ 'load-model-plans': {
5305
+ post: (body: {
5306
+ appId: string;
5307
+ supplierId: string;
5308
+ profileId: string;
5309
+ }, config?: RequestConfig) => RequestBuilder<any>;
5310
+ };
5311
+ 'list-model-pricing-map': {
5312
+ post: (body: {
5313
+ appId: string;
5314
+ }, config?: RequestConfig) => RequestBuilder<any>;
5315
+ };
5316
+ };
5317
+ billingCatalog: {
5318
+ list: {
5319
+ /** 服务 + 价目表 operation 列表(供 ai-server 等内部服务) */
5320
+ post: (body: {
5321
+ appId: string;
5322
+ billingProductLineKey?: "ai" | "storage" | "platform";
5323
+ group?: "ai" | "storage" | "platform";
5324
+ }, config?: RequestConfig) => RequestBuilder<any>;
5325
+ };
5326
+ };
5327
+ points: {
5328
+ 'by-request-ids': {
5329
+ /** 供 ai-server 溯源:通过 requestId 列表查询 pointsHistory */
5330
+ post: (body: {
5331
+ appId: string;
5332
+ requestIds: string[];
5333
+ }, config?: RequestConfig) => RequestBuilder<any>;
3672
5334
  };
3673
5335
  };
3674
5336
  };
3675
5337
  webhooks: {
3676
5338
  events: {
3677
5339
  /** 获取所有可用的 Webhook 事件类型 */
3678
- get: (config?: RequestConfig) => Promise<ApiResponse<any>>;
5340
+ get: (config?: RequestConfig) => RequestBuilder<any>;
3679
5341
  ':id': {
3680
5342
  /** 获取指定分类的 Webhook 事件 */
3681
- get: (config?: RequestConfig) => Promise<ApiResponse<any>>;
5343
+ get: (config?: RequestConfig) => RequestBuilder<any>;
3682
5344
  };
3683
5345
  };
3684
5346
  categories: {
3685
5347
  /** 获取所有 Webhook 事件分类 */
3686
- get: (config?: RequestConfig) => Promise<ApiResponse<any>>;
5348
+ get: (config?: RequestConfig) => RequestBuilder<any>;
3687
5349
  };
3688
5350
  };
3689
5351
  }