@huyooo/ui 0.13.6 → 0.13.8

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (46) hide show
  1. package/dist/{AuthkitAppSetting-EL2ZvAVT.js → AuthkitAppSetting-u2kUUH6q.js} +7 -7
  2. package/dist/{AuthkitGithubBinding-Ba9sbNEh.js → AuthkitGithubBinding-B-YSWc50.js} +6 -6
  3. package/dist/{Clipboard-CdJtMvg6.js → Clipboard-C8ncjaAJ.js} +1 -1
  4. package/dist/{Contact-Z2VFVeKK.js → Contact-CIMfdt_b.js} +2 -2
  5. package/dist/{FeedbackItem-B_MDdk4s.js → FeedbackItem-C9FQThXG.js} +3 -3
  6. package/dist/{FeedbackModal-qrcBDDQM.js → FeedbackModal-R3NKRxr7.js} +3 -3
  7. package/dist/{MessageHandle-Y96z-IXv.js → MessageHandle-D2dcvWVr.js} +2 -2
  8. package/dist/{MessageNoticeNotificationsDetails.vue_vue_type_script_setup_true_lang-CfmjFcay.js → MessageNoticeNotificationsDetails.vue_vue_type_script_setup_true_lang-CSAIRPOj.js} +2 -2
  9. package/dist/{PaySubscriptions-C75OtmYw.js → PaySubscriptions-BaUlQE-p.js} +4 -4
  10. package/dist/{PricingPlans-DCYIVuuT.js → PricingPlans-B0nt843Q.js} +4 -4
  11. package/dist/{ReferrerReferees-8eSsuPfa.js → ReferrerReferees-B50_V69q.js} +4 -4
  12. package/dist/{Upload.vue_vue_type_script_setup_true_lang-BAibfVEN.js → Upload.vue_vue_type_script_setup_true_lang-dLSky4Yx.js} +1 -1
  13. package/dist/{UserMenuInvitationsItem.vue_vue_type_script_setup_true_lang-BEVmBNlU.js → UserMenuInvitationsItem.vue_vue_type_script_setup_true_lang-BHXLN2Tu.js} +33 -34
  14. package/dist/{WidthContainer-Dqf_-qGk.js → WidthContainer-BQIboxrg.js} +21 -20
  15. package/dist/api/billingSubscriptionApi.d.ts +3 -0
  16. package/dist/{apiClients-D56ALwwO.js → apiClients-CkI47p36.js} +11 -7
  17. package/dist/authkit.js +9 -9
  18. package/dist/common.js +1 -1
  19. package/dist/composables/useMessageList.d.ts +2 -2
  20. package/dist/composables.js +13 -13
  21. package/dist/feedback.js +3 -3
  22. package/dist/main.js +31 -31
  23. package/dist/message.js +3 -3
  24. package/dist/pay.js +4 -4
  25. package/dist/privateCom.js +1 -1
  26. package/dist/referrer.js +1 -1
  27. package/dist/style.css +1 -1
  28. package/dist/types/api/ai.generated.d.ts +3051 -269
  29. package/dist/types/api/billing.generated.d.ts +1206 -275
  30. package/dist/upload.js +2 -2
  31. package/dist/{useAuthkitAppsAuthPageInfo-RMs8sOwk.js → useAuthkitAppsAuthPageInfo-CjPdpZ64.js} +1 -1
  32. package/dist/{useAuthkitAuth-B8aO6aMa.js → useAuthkitAuth-C--qS6UE.js} +1 -1
  33. package/dist/{useAuthkitCreateAndUpdate-DkiLs143.js → useAuthkitCreateAndUpdate-CsYn-oYu.js} +1 -1
  34. package/dist/{useAuthkitUsersProfile-CWAr0CNv.js → useAuthkitUsersProfile-CIFqG3gd.js} +2 -2
  35. package/dist/useBillingStatusOptions-D5Ehwtbj.js +145 -0
  36. package/dist/{useDownloads-DqF1USJ7.js → useDownloads-CxoyuqyY.js} +1 -1
  37. package/dist/{useEnsureAuthenticated-D99GiwEk.js → useEnsureAuthenticated-C4tsSfv6.js} +2 -2
  38. package/dist/{useLegalLinks-DRTOYp3n.js → useLegalLinks-DHqsVvIK.js} +2 -2
  39. package/dist/{useMessageNotifications-CUpk6zCE.js → useMessageNotifications-BMUx5xfX.js} +1 -1
  40. package/dist/{useSEO-CUKPmGRx.js → useSEO-DypqLVfr.js} +2 -2
  41. package/dist/{useSubscriptionCheckout-CAgy1CFj.js → useSubscriptionCheckout-CHAF20s-.js} +102 -108
  42. package/dist/{useTableHandle-CCKjahT0.js → useTableHandle-9alnSWt0.js} +1 -1
  43. package/dist/{useUploadCos-Bxctd4E6.js → useUploadCos-DGPnLOC9.js} +1 -1
  44. package/dist/user.js +1 -1
  45. package/package.json +2 -2
  46. 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: {
@@ -287,6 +287,24 @@ export type Api = {
287
287
  return: any;
288
288
  };
289
289
  };
290
+ historyFind: {
291
+ /** 分页查询订阅权益变化历史(管理端) */
292
+ post: {
293
+ body: {
294
+ current: number;
295
+ pageSize: number;
296
+ where: {
297
+ userId?: string;
298
+ subscriptionId?: string;
299
+ productId?: string;
300
+ action?: string;
301
+ startTime?: string;
302
+ endTime?: string;
303
+ };
304
+ };
305
+ return: any;
306
+ };
307
+ };
290
308
  trend: {
291
309
  /** 获取订阅各状态的历史趋势数据 */
292
310
  post: {
@@ -734,7 +752,8 @@ export type Api = {
734
752
  post: {
735
753
  body: {
736
754
  userId: string;
737
- amount: number;
755
+ amount?: number;
756
+ amountMicro?: number;
738
757
  requestId?: string;
739
758
  description?: string;
740
759
  metadata?: Record<string, unknown>;
@@ -1317,7 +1336,7 @@ export type Api = {
1317
1336
  };
1318
1337
  consumption: {
1319
1338
  trend: {
1320
- /** 聚合服务消费的趋势数据 */
1339
+ /** 聚合积分消耗趋势 */
1321
1340
  post: {
1322
1341
  body: {
1323
1342
  startDate?: string;
@@ -1328,7 +1347,7 @@ export type Api = {
1328
1347
  };
1329
1348
  };
1330
1349
  overview: {
1331
- /** 聚合服务消费的概览数据 */
1350
+ /** 聚合积分消耗概览 */
1332
1351
  post: {
1333
1352
  body: {
1334
1353
  startDate?: string;
@@ -1338,6 +1357,80 @@ export type Api = {
1338
1357
  };
1339
1358
  };
1340
1359
  };
1360
+ billingUsage: {
1361
+ charges: {
1362
+ list: {
1363
+ /** 查询 billingUsageRecord 全站扣费流水 */
1364
+ post: {
1365
+ body: {
1366
+ page?: number;
1367
+ pageSize?: number;
1368
+ userId?: string;
1369
+ serviceGroup?: "ai" | "platform" | "storage";
1370
+ serviceKey?: string;
1371
+ chargeMethodKey?: string;
1372
+ subjectKey?: string;
1373
+ id?: string;
1374
+ idempotencyKey?: string;
1375
+ resourceId?: string;
1376
+ startDate?: string;
1377
+ endDate?: string;
1378
+ };
1379
+ return: any;
1380
+ };
1381
+ };
1382
+ get: {
1383
+ /** 按 ID 查询单条扣费记录(含 AI 扩展字段,供详情抽屉) */
1384
+ post: {
1385
+ body: {
1386
+ id: string;
1387
+ };
1388
+ return: any;
1389
+ };
1390
+ };
1391
+ };
1392
+ consumption: {
1393
+ overview: {
1394
+ /** 聚合 AI / 平台 / 存储积分消耗 */
1395
+ post: {
1396
+ body: {
1397
+ userId?: string;
1398
+ serviceGroup?: "ai" | "platform" | "storage";
1399
+ serviceKey?: string;
1400
+ startDate?: string;
1401
+ endDate?: string;
1402
+ };
1403
+ return: any;
1404
+ };
1405
+ };
1406
+ trend: {
1407
+ /** 按日聚合积分消耗趋势 */
1408
+ post: {
1409
+ body: {
1410
+ userId?: string;
1411
+ serviceGroup?: "ai" | "platform" | "storage";
1412
+ serviceKey?: string;
1413
+ startDate?: string;
1414
+ endDate?: string;
1415
+ limit?: number;
1416
+ };
1417
+ return: any;
1418
+ };
1419
+ };
1420
+ };
1421
+ reference: {
1422
+ trace: {
1423
+ /** 按 resourceId 查询扣费明细与积分流水 */
1424
+ post: {
1425
+ body: {
1426
+ resourceId: string;
1427
+ serviceKey?: string;
1428
+ };
1429
+ return: any;
1430
+ };
1431
+ };
1432
+ };
1433
+ };
1341
1434
  pointsRecharge: {
1342
1435
  packages: {
1343
1436
  /** 获取可用的充值套餐列表 */
@@ -1619,6 +1712,8 @@ export type Api = {
1619
1712
  body: {
1620
1713
  page?: number;
1621
1714
  pageSize?: number;
1715
+ keyword?: string;
1716
+ enabled?: boolean;
1622
1717
  };
1623
1718
  return: any;
1624
1719
  };
@@ -1630,8 +1725,6 @@ export type Api = {
1630
1725
  serviceType: string;
1631
1726
  name: string;
1632
1727
  description?: string;
1633
- billingUnit: string;
1634
- billingMode?: "event" | "continuous";
1635
1728
  };
1636
1729
  return: any;
1637
1730
  };
@@ -1643,8 +1736,6 @@ export type Api = {
1643
1736
  id: string;
1644
1737
  name?: string;
1645
1738
  description?: string;
1646
- billingUnit?: string;
1647
- billingMode?: "event" | "continuous";
1648
1739
  enabled?: boolean;
1649
1740
  };
1650
1741
  return: any;
@@ -1660,43 +1751,16 @@ export type Api = {
1660
1751
  };
1661
1752
  };
1662
1753
  };
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
1754
  usage: {
1693
1755
  report: {
1694
1756
  /** 上报服务用量,自动计费扣费 */
1695
1757
  post: {
1696
1758
  body: {
1697
1759
  serviceType: string;
1760
+ chargeMethodKey?: string;
1698
1761
  metadata: Record<string, unknown>;
1699
- requestId?: string;
1762
+ idempotencyKey?: string;
1763
+ resourceId?: string;
1700
1764
  };
1701
1765
  return: any;
1702
1766
  };
@@ -1706,6 +1770,7 @@ export type Api = {
1706
1770
  post: {
1707
1771
  body: {
1708
1772
  serviceType: string;
1773
+ chargeMethodKey?: string;
1709
1774
  metadata: Record<string, unknown>;
1710
1775
  freeQuotaOverride?: number;
1711
1776
  };
@@ -1719,6 +1784,7 @@ export type Api = {
1719
1784
  startDate?: string;
1720
1785
  endDate?: string;
1721
1786
  serviceType?: string;
1787
+ userId?: string;
1722
1788
  groupBy?: "day" | "service" | "user";
1723
1789
  };
1724
1790
  return: any;
@@ -1730,7 +1796,12 @@ export type Api = {
1730
1796
  body: {
1731
1797
  page?: number;
1732
1798
  pageSize?: number;
1733
- serviceType?: string;
1799
+ id?: string;
1800
+ idempotencyKey?: string;
1801
+ resourceId?: string;
1802
+ serviceKey?: string;
1803
+ chargeMethodKey?: string;
1804
+ userId?: string;
1734
1805
  startDate?: string;
1735
1806
  endDate?: string;
1736
1807
  };
@@ -1738,6 +1809,291 @@ export type Api = {
1738
1809
  };
1739
1810
  };
1740
1811
  };
1812
+ servicePricing: {
1813
+ overview: {
1814
+ post: {
1815
+ return: any;
1816
+ };
1817
+ };
1818
+ list: {
1819
+ post: {
1820
+ body: {
1821
+ serviceKey?: string;
1822
+ };
1823
+ return: any;
1824
+ };
1825
+ };
1826
+ get: {
1827
+ post: {
1828
+ body: {
1829
+ serviceKey: string;
1830
+ chargeMethodKey: string;
1831
+ };
1832
+ return: any;
1833
+ };
1834
+ };
1835
+ upsert: {
1836
+ post: {
1837
+ body: {
1838
+ serviceKey: string;
1839
+ chargeMethodKey: string;
1840
+ originalPrice: number;
1841
+ sellPrice: number;
1842
+ enabled?: boolean;
1843
+ };
1844
+ return: any;
1845
+ };
1846
+ };
1847
+ importLegacy: {
1848
+ /** 幂等:将旧 pricingRule 导入 billingServicePricing */
1849
+ post: {
1850
+ return: any;
1851
+ };
1852
+ };
1853
+ };
1854
+ priceList: {
1855
+ list: {
1856
+ post: {
1857
+ body: {
1858
+ serviceKey?: string;
1859
+ chargeMethodKey?: string;
1860
+ pricingType?: "flat" | "tiered" | "dimensions";
1861
+ enabled?: boolean;
1862
+ page?: number;
1863
+ pageSize?: number;
1864
+ };
1865
+ return: any;
1866
+ };
1867
+ };
1868
+ get: {
1869
+ post: {
1870
+ body: {
1871
+ id: string;
1872
+ };
1873
+ return: any;
1874
+ };
1875
+ };
1876
+ create: {
1877
+ post: {
1878
+ body: {
1879
+ serviceKey: string;
1880
+ chargeMethodKey: string;
1881
+ name: string;
1882
+ currency?: "CNY" | "USD";
1883
+ enabled?: boolean;
1884
+ pricing: {
1885
+ type: "flat";
1886
+ originalPrice: number;
1887
+ sellPrice: number;
1888
+ } | {
1889
+ type: "tiered";
1890
+ priceStructure: "flat" | "segmented";
1891
+ tiers: {
1892
+ tierKey?: string;
1893
+ tierRangeMode?: "at_most" | "at_least" | "between";
1894
+ minTokens?: number;
1895
+ maxTokens?: number;
1896
+ minInclusive?: boolean;
1897
+ maxInclusive?: boolean;
1898
+ originalFenPerUnit: number;
1899
+ sellFenPerUnit: number;
1900
+ billingEnabled: boolean;
1901
+ }[];
1902
+ } | {
1903
+ type: "dimensions";
1904
+ dimensions: {
1905
+ dimensionKey: string;
1906
+ unit: string;
1907
+ priceStructure?: "flat" | "segmented";
1908
+ tiers: {
1909
+ tierKey?: string;
1910
+ tierRangeMode?: "at_most" | "at_least" | "between";
1911
+ minTokens?: number;
1912
+ maxTokens?: number;
1913
+ minInclusive?: boolean;
1914
+ maxInclusive?: boolean;
1915
+ minOutputTokens?: number;
1916
+ maxOutputTokens?: number;
1917
+ originalFenPerUnit: number;
1918
+ sellFenPerUnit: number;
1919
+ billingEnabled: boolean;
1920
+ }[];
1921
+ }[];
1922
+ };
1923
+ };
1924
+ return: any;
1925
+ };
1926
+ };
1927
+ update: {
1928
+ post: {
1929
+ body: {
1930
+ id: string;
1931
+ name?: string;
1932
+ currency?: "CNY" | "USD";
1933
+ enabled?: boolean;
1934
+ pricing?: {
1935
+ type: "flat";
1936
+ originalPrice: number;
1937
+ sellPrice: number;
1938
+ } | {
1939
+ type: "tiered";
1940
+ priceStructure: "flat" | "segmented";
1941
+ tiers: {
1942
+ tierKey?: string;
1943
+ tierRangeMode?: "at_most" | "at_least" | "between";
1944
+ minTokens?: number;
1945
+ maxTokens?: number;
1946
+ minInclusive?: boolean;
1947
+ maxInclusive?: boolean;
1948
+ originalFenPerUnit: number;
1949
+ sellFenPerUnit: number;
1950
+ billingEnabled: boolean;
1951
+ }[];
1952
+ } | {
1953
+ type: "dimensions";
1954
+ dimensions: {
1955
+ dimensionKey: string;
1956
+ unit: string;
1957
+ priceStructure?: "flat" | "segmented";
1958
+ tiers: {
1959
+ tierKey?: string;
1960
+ tierRangeMode?: "at_most" | "at_least" | "between";
1961
+ minTokens?: number;
1962
+ maxTokens?: number;
1963
+ minInclusive?: boolean;
1964
+ maxInclusive?: boolean;
1965
+ minOutputTokens?: number;
1966
+ maxOutputTokens?: number;
1967
+ originalFenPerUnit: number;
1968
+ sellFenPerUnit: number;
1969
+ billingEnabled: boolean;
1970
+ }[];
1971
+ }[];
1972
+ };
1973
+ };
1974
+ return: any;
1975
+ };
1976
+ };
1977
+ delete: {
1978
+ post: {
1979
+ body: {
1980
+ id: string;
1981
+ };
1982
+ return: any;
1983
+ };
1984
+ };
1985
+ };
1986
+ priceBinding: {
1987
+ list: {
1988
+ post: {
1989
+ body: {
1990
+ subjectType?: "model-profile";
1991
+ subjectKey?: string;
1992
+ serviceKey?: string;
1993
+ enabled?: boolean;
1994
+ };
1995
+ return: any;
1996
+ };
1997
+ };
1998
+ upsert: {
1999
+ post: {
2000
+ body: {
2001
+ subjectType: "model-profile";
2002
+ subjectKey: string;
2003
+ priceListId: string;
2004
+ enabled?: boolean;
2005
+ };
2006
+ return: any;
2007
+ };
2008
+ };
2009
+ delete: {
2010
+ post: {
2011
+ body: {
2012
+ id: string;
2013
+ };
2014
+ return: any;
2015
+ };
2016
+ };
2017
+ };
2018
+ billingMethodDefinition: {
2019
+ list: {
2020
+ post: {
2021
+ body: {
2022
+ serviceKey?: string;
2023
+ page?: number;
2024
+ pageSize?: number;
2025
+ };
2026
+ return: any;
2027
+ };
2028
+ };
2029
+ get: {
2030
+ post: {
2031
+ body: {
2032
+ chargeMethodKey: string;
2033
+ };
2034
+ return: any;
2035
+ };
2036
+ };
2037
+ create: {
2038
+ post: {
2039
+ body: {
2040
+ serviceKey: string;
2041
+ chargeMethodKey: string;
2042
+ label: string;
2043
+ billingUnit: string;
2044
+ chargeKind: "instant" | "settlement";
2045
+ settlementPeriod?: "second" | "minute" | "hour" | "day" | "month";
2046
+ priceStructure?: "flat" | "segmented";
2047
+ tiers?: {
2048
+ tierKey?: string;
2049
+ tierRangeMode?: "at_most" | "at_least" | "between";
2050
+ minTokens?: number;
2051
+ maxTokens?: number;
2052
+ minInclusive?: boolean;
2053
+ maxInclusive?: boolean;
2054
+ originalFenPerUnit: number;
2055
+ sellFenPerUnit: number;
2056
+ billingEnabled: boolean;
2057
+ }[];
2058
+ enabled?: boolean;
2059
+ };
2060
+ return: any;
2061
+ };
2062
+ };
2063
+ update: {
2064
+ post: {
2065
+ body: {
2066
+ id: string;
2067
+ label?: string;
2068
+ billingUnit?: string;
2069
+ chargeKind?: "instant" | "settlement";
2070
+ settlementPeriod?: "second" | "minute" | "hour" | "day" | "month";
2071
+ priceStructure?: "flat" | "segmented";
2072
+ tiers?: {
2073
+ tierKey?: string;
2074
+ tierRangeMode?: "at_most" | "at_least" | "between";
2075
+ minTokens?: number;
2076
+ maxTokens?: number;
2077
+ minInclusive?: boolean;
2078
+ maxInclusive?: boolean;
2079
+ originalFenPerUnit: number;
2080
+ sellFenPerUnit: number;
2081
+ billingEnabled: boolean;
2082
+ }[];
2083
+ enabled?: boolean;
2084
+ };
2085
+ return: any;
2086
+ };
2087
+ };
2088
+ delete: {
2089
+ post: {
2090
+ body: {
2091
+ id: string;
2092
+ };
2093
+ return: any;
2094
+ };
2095
+ };
2096
+ };
1741
2097
  export: {
1742
2098
  recharge: {
1743
2099
  /** 导出充值订单记录为 CSV 格式 */
@@ -2044,7 +2400,8 @@ export type Api = {
2044
2400
  body: {
2045
2401
  appId: string;
2046
2402
  userId: string;
2047
- serviceType: string;
2403
+ serviceKey: string;
2404
+ chargeMethodKey: string;
2048
2405
  amount: number;
2049
2406
  freeQuotaOverride?: number;
2050
2407
  };
@@ -2059,7 +2416,8 @@ export type Api = {
2059
2416
  items: {
2060
2417
  key: string;
2061
2418
  userId: string;
2062
- serviceType: string;
2419
+ serviceKey: string;
2420
+ chargeMethodKey: string;
2063
2421
  amount: number;
2064
2422
  freeQuotaOverride?: number;
2065
2423
  }[];
@@ -2073,10 +2431,12 @@ export type Api = {
2073
2431
  body: {
2074
2432
  appId: string;
2075
2433
  userId: string;
2076
- serviceType: string;
2434
+ serviceKey: string;
2435
+ chargeMethodKey: string;
2077
2436
  amount: number;
2078
2437
  metadata?: Record<string, unknown>;
2079
- requestId?: string;
2438
+ idempotencyKey?: string;
2439
+ resourceId?: string;
2080
2440
  usageKind?: "event" | "continuous_settlement";
2081
2441
  periodStart?: string;
2082
2442
  periodEnd?: string;
@@ -2085,18 +2445,172 @@ export type Api = {
2085
2445
  return: any;
2086
2446
  };
2087
2447
  };
2088
- };
2089
- };
2090
- webhooks: {
2091
- events: {
2092
- /** 获取所有可用的 Webhook 事件类型 */
2093
- get: {
2094
- return: any;
2095
- };
2096
- ':id': {
2097
- /** 获取指定分类的 Webhook 事件 */
2098
- get: {
2099
- params: {
2448
+ reversal: {
2449
+ /** 供内部服务冲正已上报的服务用量并退还积分 */
2450
+ post: {
2451
+ body: {
2452
+ appId: string;
2453
+ userId: string;
2454
+ idempotencyKey: string;
2455
+ reason?: string;
2456
+ reversalIdempotencyKey?: string;
2457
+ };
2458
+ return: any;
2459
+ };
2460
+ };
2461
+ 'record-ai': {
2462
+ /** 供 ai-server 计价后写入统一用量账本并扣积分 */
2463
+ post: {
2464
+ body: {
2465
+ appId: string;
2466
+ userId: string;
2467
+ idempotencyKey: string;
2468
+ serviceKey: string;
2469
+ chargeMethodKey: string;
2470
+ resourceId?: string;
2471
+ subjectKey: string;
2472
+ labels?: Record<string, string>;
2473
+ pointsConsumed: number;
2474
+ quantity?: number;
2475
+ unit?: string;
2476
+ snapshot?: {
2477
+ priceListId?: string;
2478
+ usage?: Record<string, number>;
2479
+ cost?: Record<string, unknown>;
2480
+ };
2481
+ };
2482
+ return: any;
2483
+ };
2484
+ };
2485
+ list: {
2486
+ /** 供 ai-server 等内部服务查询 billingUsageRecord */
2487
+ post: {
2488
+ body: {
2489
+ appId: string;
2490
+ userId?: string;
2491
+ serviceGroup?: "ai" | "platform" | "storage";
2492
+ serviceGroups?: "ai" | "platform" | "storage"[];
2493
+ referenceId?: string;
2494
+ serviceKey?: string;
2495
+ chargeMethodKey?: string;
2496
+ model?: string;
2497
+ subjectKeys?: string[];
2498
+ id?: string;
2499
+ requestId?: string;
2500
+ startTime?: string;
2501
+ endTime?: string;
2502
+ page?: number;
2503
+ pageSize?: number;
2504
+ };
2505
+ return: any;
2506
+ };
2507
+ };
2508
+ 'stats-ai': {
2509
+ /** 供 ai-server 查询 AI 用量聚合统计 */
2510
+ post: {
2511
+ body: {
2512
+ appId: string;
2513
+ userId?: string;
2514
+ subjectKeys?: string[];
2515
+ startTime?: string;
2516
+ endTime?: string;
2517
+ timezone?: string;
2518
+ };
2519
+ return: any;
2520
+ };
2521
+ };
2522
+ 'by-reference': {
2523
+ /** 按 referenceId 联合查询用量与积分流水 */
2524
+ post: {
2525
+ body: {
2526
+ appId: string;
2527
+ referenceId: string;
2528
+ serviceKey?: string;
2529
+ };
2530
+ return: any;
2531
+ };
2532
+ };
2533
+ };
2534
+ pricing: {
2535
+ 'resolve-model': {
2536
+ /** 供 ai-server 运行时读取模型定价 */
2537
+ post: {
2538
+ body: {
2539
+ appId: string;
2540
+ supplierId: string;
2541
+ profileId: string;
2542
+ productLine?: string;
2543
+ billingPlan?: string;
2544
+ };
2545
+ return: any;
2546
+ };
2547
+ };
2548
+ 'sync-model': {
2549
+ post: {
2550
+ body: {
2551
+ appId: string;
2552
+ operatorId: string;
2553
+ supplierId: string;
2554
+ profileId: string;
2555
+ productLine: string;
2556
+ currency: "CNY" | "USD";
2557
+ plans: unknown[];
2558
+ };
2559
+ return: any;
2560
+ };
2561
+ };
2562
+ 'delete-model': {
2563
+ post: {
2564
+ body: {
2565
+ appId: string;
2566
+ supplierId: string;
2567
+ profileId: string;
2568
+ };
2569
+ return: any;
2570
+ };
2571
+ };
2572
+ 'load-model-plans': {
2573
+ post: {
2574
+ body: {
2575
+ appId: string;
2576
+ supplierId: string;
2577
+ profileId: string;
2578
+ };
2579
+ return: any;
2580
+ };
2581
+ };
2582
+ 'list-model-pricing-map': {
2583
+ post: {
2584
+ body: {
2585
+ appId: string;
2586
+ };
2587
+ return: any;
2588
+ };
2589
+ };
2590
+ };
2591
+ points: {
2592
+ 'by-request-ids': {
2593
+ /** 供 ai-server 溯源:通过 requestId 列表查询 pointsHistory */
2594
+ post: {
2595
+ body: {
2596
+ appId: string;
2597
+ requestIds: string[];
2598
+ };
2599
+ return: any;
2600
+ };
2601
+ };
2602
+ };
2603
+ };
2604
+ webhooks: {
2605
+ events: {
2606
+ /** 获取所有可用的 Webhook 事件类型 */
2607
+ get: {
2608
+ return: any;
2609
+ };
2610
+ ':id': {
2611
+ /** 获取指定分类的 Webhook 事件 */
2612
+ get: {
2613
+ params: {
2100
2614
  category: string;
2101
2615
  };
2102
2616
  return: any;
@@ -2114,11 +2628,11 @@ export type Api = {
2114
2628
  /** API 客户端类型(提供完整的 IDE 智能提示) */
2115
2629
  export interface ApiClient {
2116
2630
  health: {
2117
- get: (config?: RequestConfig) => Promise<ApiResponse<any>>;
2631
+ get: (config?: RequestConfig) => RequestBuilder<any>;
2118
2632
  };
2119
2633
  'api-spec': {
2120
2634
  /** 获取 API 规范,用于类型同步 */
2121
- get: (config?: RequestConfig) => Promise<ApiResponse<any>>;
2635
+ get: (config?: RequestConfig) => RequestBuilder<any>;
2122
2636
  };
2123
2637
  products: {
2124
2638
  create: {
@@ -2136,13 +2650,13 @@ export interface ApiClient {
2136
2650
  }[];
2137
2651
  metadata?: Record<string, unknown>;
2138
2652
  displayOrder?: number;
2139
- }, config?: RequestConfig) => Promise<ApiResponse<any>>;
2653
+ }, config?: RequestConfig) => RequestBuilder<any>;
2140
2654
  };
2141
2655
  delete: {
2142
2656
  /** 删除产品 */
2143
2657
  post: (body: {
2144
2658
  id: string;
2145
- }, config?: RequestConfig) => Promise<ApiResponse<any>>;
2659
+ }, config?: RequestConfig) => RequestBuilder<any>;
2146
2660
  };
2147
2661
  update: {
2148
2662
  /** 更新产品信息 */
@@ -2161,7 +2675,7 @@ export interface ApiClient {
2161
2675
  status?: "active" | "archived";
2162
2676
  metadata?: Record<string, unknown>;
2163
2677
  displayOrder?: number;
2164
- }, config?: RequestConfig) => Promise<ApiResponse<any>>;
2678
+ }, config?: RequestConfig) => RequestBuilder<any>;
2165
2679
  };
2166
2680
  find: {
2167
2681
  /** 分页查询产品列表 */
@@ -2172,13 +2686,13 @@ export interface ApiClient {
2172
2686
  name?: string;
2173
2687
  status?: "" | "active" | "archived";
2174
2688
  };
2175
- }, config?: RequestConfig) => Promise<ApiResponse<any>>;
2689
+ }, config?: RequestConfig) => RequestBuilder<any>;
2176
2690
  };
2177
2691
  findOne: {
2178
2692
  /** 根据 ID 查询产品详情 */
2179
2693
  post: (body: {
2180
2694
  id: string;
2181
- }, config?: RequestConfig) => Promise<ApiResponse<any>>;
2695
+ }, config?: RequestConfig) => RequestBuilder<any>;
2182
2696
  };
2183
2697
  updateSort: {
2184
2698
  /** 批量更新产品排序 */
@@ -2187,11 +2701,11 @@ export interface ApiClient {
2187
2701
  id: string;
2188
2702
  displayOrder: number;
2189
2703
  }[];
2190
- }, config?: RequestConfig) => Promise<ApiResponse<any>>;
2704
+ }, config?: RequestConfig) => RequestBuilder<any>;
2191
2705
  };
2192
2706
  listActive: {
2193
2707
  /** 获取定价页面可用产品列表(公开) */
2194
- post: (config?: RequestConfig) => Promise<ApiResponse<any>>;
2708
+ post: (config?: RequestConfig) => RequestBuilder<any>;
2195
2709
  };
2196
2710
  };
2197
2711
  prices: {
@@ -2208,13 +2722,13 @@ export interface ApiClient {
2208
2722
  interval?: "day" | "week" | "month" | "year";
2209
2723
  intervalCount?: number;
2210
2724
  metadata?: Record<string, unknown>;
2211
- }, config?: RequestConfig) => Promise<ApiResponse<any>>;
2725
+ }, config?: RequestConfig) => RequestBuilder<any>;
2212
2726
  };
2213
2727
  delete: {
2214
2728
  /** 删除价格方案 */
2215
2729
  post: (body: {
2216
2730
  id: string;
2217
- }, config?: RequestConfig) => Promise<ApiResponse<any>>;
2731
+ }, config?: RequestConfig) => RequestBuilder<any>;
2218
2732
  };
2219
2733
  update: {
2220
2734
  /** 更新价格方案信息 */
@@ -2225,7 +2739,7 @@ export interface ApiClient {
2225
2739
  metadata?: Record<string, unknown>;
2226
2740
  trialPeriodDays?: number;
2227
2741
  allowRepeatTrial?: boolean;
2228
- }, config?: RequestConfig) => Promise<ApiResponse<any>>;
2742
+ }, config?: RequestConfig) => RequestBuilder<any>;
2229
2743
  };
2230
2744
  find: {
2231
2745
  /** 分页查询价格方案列表 */
@@ -2237,23 +2751,23 @@ export interface ApiClient {
2237
2751
  type?: "" | "free" | "one_time" | "recurring";
2238
2752
  active?: boolean;
2239
2753
  };
2240
- }, config?: RequestConfig) => Promise<ApiResponse<any>>;
2754
+ }, config?: RequestConfig) => RequestBuilder<any>;
2241
2755
  };
2242
2756
  findOne: {
2243
2757
  /** 根据 ID 查询价格方案详情 */
2244
2758
  post: (body: {
2245
2759
  id: string;
2246
- }, config?: RequestConfig) => Promise<ApiResponse<any>>;
2760
+ }, config?: RequestConfig) => RequestBuilder<any>;
2247
2761
  };
2248
2762
  listByProduct: {
2249
2763
  /** 获取指定产品的所有可用价格方案 */
2250
2764
  post: (body: {
2251
2765
  productId: string;
2252
- }, config?: RequestConfig) => Promise<ApiResponse<any>>;
2766
+ }, config?: RequestConfig) => RequestBuilder<any>;
2253
2767
  };
2254
2768
  listFreeActive: {
2255
2769
  /** 获取当前应用可领取的免费体验价格方案 */
2256
- post: (config?: RequestConfig) => Promise<ApiResponse<any>>;
2770
+ post: (config?: RequestConfig) => RequestBuilder<any>;
2257
2771
  };
2258
2772
  };
2259
2773
  subscriptions: {
@@ -2262,7 +2776,7 @@ export interface ApiClient {
2262
2776
  post: (body: {
2263
2777
  priceId: string;
2264
2778
  couponCode?: string;
2265
- }, config?: RequestConfig) => Promise<ApiResponse<any>>;
2779
+ }, config?: RequestConfig) => RequestBuilder<any>;
2266
2780
  };
2267
2781
  cancel: {
2268
2782
  /** 取消订阅 */
@@ -2270,13 +2784,13 @@ export interface ApiClient {
2270
2784
  subscriptionId: string;
2271
2785
  cancelAtPeriodEnd?: boolean;
2272
2786
  reason?: string;
2273
- }, config?: RequestConfig) => Promise<ApiResponse<any>>;
2787
+ }, config?: RequestConfig) => RequestBuilder<any>;
2274
2788
  };
2275
2789
  resume: {
2276
2790
  /** 恢复已取消的订阅 */
2277
2791
  post: (body: {
2278
2792
  subscriptionId: string;
2279
- }, config?: RequestConfig) => Promise<ApiResponse<any>>;
2793
+ }, config?: RequestConfig) => RequestBuilder<any>;
2280
2794
  };
2281
2795
  change: {
2282
2796
  /** 升级或降级订阅 */
@@ -2284,7 +2798,7 @@ export interface ApiClient {
2284
2798
  subscriptionId: string;
2285
2799
  newPriceId: string;
2286
2800
  proration?: boolean;
2287
- }, config?: RequestConfig) => Promise<ApiResponse<any>>;
2801
+ }, config?: RequestConfig) => RequestBuilder<any>;
2288
2802
  };
2289
2803
  my: {
2290
2804
  /** 查询当前用户的订阅列表 */
@@ -2292,21 +2806,21 @@ export interface ApiClient {
2292
2806
  current?: number;
2293
2807
  pageSize?: number;
2294
2808
  status?: string;
2295
- }, config?: RequestConfig) => Promise<ApiResponse<any>>;
2809
+ }, config?: RequestConfig) => RequestBuilder<any>;
2296
2810
  };
2297
2811
  current: {
2298
2812
  /** 获取当前活跃订阅 */
2299
- post: (config?: RequestConfig) => Promise<ApiResponse<any>>;
2813
+ post: (config?: RequestConfig) => RequestBuilder<any>;
2300
2814
  };
2301
2815
  summary: {
2302
2816
  /** 获取当前用户订阅、配额、积分和待支付账单摘要 */
2303
- post: (config?: RequestConfig) => Promise<ApiResponse<any>>;
2817
+ post: (config?: RequestConfig) => RequestBuilder<any>;
2304
2818
  };
2305
2819
  userDetail: {
2306
2820
  /** 管理员查询指定用户的订阅、免费体验、配额、积分和最近消费记录 */
2307
2821
  post: (body: {
2308
2822
  userId: string;
2309
- }, config?: RequestConfig) => Promise<ApiResponse<any>>;
2823
+ }, config?: RequestConfig) => RequestBuilder<any>;
2310
2824
  };
2311
2825
  find: {
2312
2826
  /** 分页查询订阅列表(管理端) */
@@ -2319,13 +2833,28 @@ export interface ApiClient {
2319
2833
  status?: string;
2320
2834
  cancelAtPeriodEnd?: boolean;
2321
2835
  };
2322
- }, config?: RequestConfig) => Promise<ApiResponse<any>>;
2836
+ }, config?: RequestConfig) => RequestBuilder<any>;
2323
2837
  };
2324
2838
  history: {
2325
2839
  /** 查询单个订阅的权益变化历史(管理端) */
2326
2840
  post: (body: {
2327
2841
  subscriptionId: string;
2328
- }, config?: RequestConfig) => Promise<ApiResponse<any>>;
2842
+ }, config?: RequestConfig) => RequestBuilder<any>;
2843
+ };
2844
+ historyFind: {
2845
+ /** 分页查询订阅权益变化历史(管理端) */
2846
+ post: (body: {
2847
+ current: number;
2848
+ pageSize: number;
2849
+ where: {
2850
+ userId?: string;
2851
+ subscriptionId?: string;
2852
+ productId?: string;
2853
+ action?: string;
2854
+ startTime?: string;
2855
+ endTime?: string;
2856
+ };
2857
+ }, config?: RequestConfig) => RequestBuilder<any>;
2329
2858
  };
2330
2859
  trend: {
2331
2860
  /** 获取订阅各状态的历史趋势数据 */
@@ -2333,26 +2862,26 @@ export interface ApiClient {
2333
2862
  startTime: string;
2334
2863
  endTime: string;
2335
2864
  granularity: "day" | "week" | "month";
2336
- }, config?: RequestConfig) => Promise<ApiResponse<any>>;
2865
+ }, config?: RequestConfig) => RequestBuilder<any>;
2337
2866
  };
2338
2867
  count: {
2339
2868
  /** 供其他服务查询用户订阅数量 */
2340
2869
  post: (body: {
2341
2870
  userId: string;
2342
2871
  appId?: string;
2343
- }, config?: RequestConfig) => Promise<ApiResponse<any>>;
2872
+ }, config?: RequestConfig) => RequestBuilder<any>;
2344
2873
  };
2345
2874
  countBatch: {
2346
2875
  /** 供其他服务批量查询用户订阅数量 */
2347
2876
  post: (body: {
2348
2877
  userIds: string[];
2349
2878
  appId?: string;
2350
- }, config?: RequestConfig) => Promise<ApiResponse<any>>;
2879
+ }, config?: RequestConfig) => RequestBuilder<any>;
2351
2880
  };
2352
2881
  notify: {
2353
2882
  alipay: {
2354
2883
  /** 支付宝订阅支付回调通知 */
2355
- post: (body: Record<string, unknown>, config?: RequestConfig) => Promise<ApiResponse<any>>;
2884
+ post: (body: Record<string, unknown>, config?: RequestConfig) => RequestBuilder<any>;
2356
2885
  };
2357
2886
  };
2358
2887
  };
@@ -2367,13 +2896,13 @@ export interface ApiClient {
2367
2896
  limit: number;
2368
2897
  period: "day" | "week" | "month" | "year" | "lifetime";
2369
2898
  metadata?: Record<string, unknown>;
2370
- }, config?: RequestConfig) => Promise<ApiResponse<any>>;
2899
+ }, config?: RequestConfig) => RequestBuilder<any>;
2371
2900
  };
2372
2901
  delete: {
2373
2902
  /** 删除配额定义 */
2374
2903
  post: (body: {
2375
2904
  id: string;
2376
- }, config?: RequestConfig) => Promise<ApiResponse<any>>;
2905
+ }, config?: RequestConfig) => RequestBuilder<any>;
2377
2906
  };
2378
2907
  update: {
2379
2908
  /** 更新配额定义 */
@@ -2384,7 +2913,7 @@ export interface ApiClient {
2384
2913
  limit?: number;
2385
2914
  period?: "day" | "week" | "month" | "year" | "lifetime";
2386
2915
  metadata?: Record<string, unknown>;
2387
- }, config?: RequestConfig) => Promise<ApiResponse<any>>;
2916
+ }, config?: RequestConfig) => RequestBuilder<any>;
2388
2917
  };
2389
2918
  find: {
2390
2919
  /** 分页查询配额列表 */
@@ -2396,7 +2925,7 @@ export interface ApiClient {
2396
2925
  priceId?: string;
2397
2926
  featureKey?: string;
2398
2927
  };
2399
- }, config?: RequestConfig) => Promise<ApiResponse<any>>;
2928
+ }, config?: RequestConfig) => RequestBuilder<any>;
2400
2929
  };
2401
2930
  check: {
2402
2931
  /** 供其他服务检查配额是否足够,不写入使用量 */
@@ -2406,11 +2935,11 @@ export interface ApiClient {
2406
2935
  featureKey: string;
2407
2936
  quantity?: number;
2408
2937
  used?: number;
2409
- }, config?: RequestConfig) => Promise<ApiResponse<any>>;
2938
+ }, config?: RequestConfig) => RequestBuilder<any>;
2410
2939
  };
2411
2940
  my: {
2412
2941
  /** 获取当前用户的配额使用情况 */
2413
- post: (config?: RequestConfig) => Promise<ApiResponse<any>>;
2942
+ post: (config?: RequestConfig) => RequestBuilder<any>;
2414
2943
  };
2415
2944
  reserve: {
2416
2945
  /** 供其他服务检查并预占配额 */
@@ -2420,51 +2949,51 @@ export interface ApiClient {
2420
2949
  featureKey: string;
2421
2950
  quantity?: number;
2422
2951
  metadata?: Record<string, unknown>;
2423
- }, config?: RequestConfig) => Promise<ApiResponse<any>>;
2952
+ }, config?: RequestConfig) => RequestBuilder<any>;
2424
2953
  };
2425
2954
  commit: {
2426
2955
  /** 供其他服务确认已预占配额 */
2427
2956
  post: (body: {
2428
2957
  usageRecordId: string;
2429
- }, config?: RequestConfig) => Promise<ApiResponse<any>>;
2958
+ }, config?: RequestConfig) => RequestBuilder<any>;
2430
2959
  };
2431
2960
  release: {
2432
2961
  /** 供其他服务释放已预占配额 */
2433
2962
  post: (body: {
2434
2963
  usageRecordId: string;
2435
- }, config?: RequestConfig) => Promise<ApiResponse<any>>;
2964
+ }, config?: RequestConfig) => RequestBuilder<any>;
2436
2965
  };
2437
2966
  };
2438
2967
  trials: {
2439
2968
  current: {
2440
2969
  /** 获取当前用户免费体验状态 */
2441
- post: (config?: RequestConfig) => Promise<ApiResponse<any>>;
2970
+ post: (config?: RequestConfig) => RequestBuilder<any>;
2442
2971
  };
2443
2972
  start: {
2444
2973
  /** 领取当前应用的免费体验权益 */
2445
2974
  post: (body: {
2446
2975
  priceId?: string;
2447
- }, config?: RequestConfig) => Promise<ApiResponse<any>>;
2976
+ }, config?: RequestConfig) => RequestBuilder<any>;
2448
2977
  };
2449
2978
  };
2450
2979
  newUserDefaults: {
2451
2980
  find: {
2452
2981
  /** 查询注册后默认授予的免费权益配置 */
2453
- post: (config?: RequestConfig) => Promise<ApiResponse<any>>;
2982
+ post: (config?: RequestConfig) => RequestBuilder<any>;
2454
2983
  };
2455
2984
  update: {
2456
2985
  /** 更新注册后默认授予的免费权益配置 */
2457
2986
  post: (body: {
2458
2987
  autoGrantFreePriceOnSignup: boolean;
2459
2988
  defaultFreePriceId?: string;
2460
- }, config?: RequestConfig) => Promise<ApiResponse<any>>;
2989
+ }, config?: RequestConfig) => RequestBuilder<any>;
2461
2990
  };
2462
2991
  grantMissingFreeEntitlements: {
2463
2992
  /** 给当前应用下没有活跃订阅/体验的用户补发默认免费价格方案 */
2464
2993
  post: (body: {
2465
2994
  dryRun?: boolean;
2466
2995
  userIds?: string[];
2467
- }, config?: RequestConfig) => Promise<ApiResponse<any>>;
2996
+ }, config?: RequestConfig) => RequestBuilder<any>;
2468
2997
  };
2469
2998
  };
2470
2999
  usageRecords: {
@@ -2475,7 +3004,7 @@ export interface ApiClient {
2475
3004
  featureKey: string;
2476
3005
  quantity?: number;
2477
3006
  used?: number;
2478
- }, config?: RequestConfig) => Promise<ApiResponse<any>>;
3007
+ }, config?: RequestConfig) => RequestBuilder<any>;
2479
3008
  };
2480
3009
  reserveQuota: {
2481
3010
  /** 检查配额并写入 reserved 使用量记录 */
@@ -2484,19 +3013,19 @@ export interface ApiClient {
2484
3013
  featureKey: string;
2485
3014
  quantity?: number;
2486
3015
  metadata?: Record<string, unknown>;
2487
- }, config?: RequestConfig) => Promise<ApiResponse<any>>;
3016
+ }, config?: RequestConfig) => RequestBuilder<any>;
2488
3017
  };
2489
3018
  commitQuota: {
2490
3019
  /** 将 reserved 使用量记录确认成 committed */
2491
3020
  post: (body: {
2492
3021
  usageRecordId: string;
2493
- }, config?: RequestConfig) => Promise<ApiResponse<any>>;
3022
+ }, config?: RequestConfig) => RequestBuilder<any>;
2494
3023
  };
2495
3024
  releaseQuota: {
2496
3025
  /** 将 reserved 使用量记录释放成 released */
2497
3026
  post: (body: {
2498
3027
  usageRecordId: string;
2499
- }, config?: RequestConfig) => Promise<ApiResponse<any>>;
3028
+ }, config?: RequestConfig) => RequestBuilder<any>;
2500
3029
  };
2501
3030
  find: {
2502
3031
  /** 分页查询使用记录(管理端) */
@@ -2510,7 +3039,7 @@ export interface ApiClient {
2510
3039
  startTime?: string;
2511
3040
  endTime?: string;
2512
3041
  };
2513
- }, config?: RequestConfig) => Promise<ApiResponse<any>>;
3042
+ }, config?: RequestConfig) => RequestBuilder<any>;
2514
3043
  };
2515
3044
  my: {
2516
3045
  /** 查询当前用户的使用记录 */
@@ -2521,7 +3050,7 @@ export interface ApiClient {
2521
3050
  status?: string;
2522
3051
  startTime?: string;
2523
3052
  endTime?: string;
2524
- }, config?: RequestConfig) => Promise<ApiResponse<any>>;
3053
+ }, config?: RequestConfig) => RequestBuilder<any>;
2525
3054
  };
2526
3055
  statistics: {
2527
3056
  /** 获取使用量统计数据 */
@@ -2531,7 +3060,7 @@ export interface ApiClient {
2531
3060
  startTime: string;
2532
3061
  endTime: string;
2533
3062
  granularity: "hour" | "day" | "week" | "month";
2534
- }, config?: RequestConfig) => Promise<ApiResponse<any>>;
3063
+ }, config?: RequestConfig) => RequestBuilder<any>;
2535
3064
  };
2536
3065
  };
2537
3066
  invoices: {
@@ -2547,13 +3076,13 @@ export interface ApiClient {
2547
3076
  startTime?: string;
2548
3077
  endTime?: string;
2549
3078
  };
2550
- }, config?: RequestConfig) => Promise<ApiResponse<any>>;
3079
+ }, config?: RequestConfig) => RequestBuilder<any>;
2551
3080
  };
2552
3081
  findOne: {
2553
3082
  /** 根据 ID 查询订阅账单详情 */
2554
3083
  post: (body: {
2555
3084
  id: string;
2556
- }, config?: RequestConfig) => Promise<ApiResponse<any>>;
3085
+ }, config?: RequestConfig) => RequestBuilder<any>;
2557
3086
  };
2558
3087
  my: {
2559
3088
  /** 查询当前用户的订阅账单列表 */
@@ -2561,40 +3090,40 @@ export interface ApiClient {
2561
3090
  current?: number;
2562
3091
  pageSize?: number;
2563
3092
  status?: string;
2564
- }, config?: RequestConfig) => Promise<ApiResponse<any>>;
3093
+ }, config?: RequestConfig) => RequestBuilder<any>;
2565
3094
  };
2566
3095
  cancel: {
2567
3096
  /** 取消当前用户自己的待支付订阅账单 */
2568
3097
  post: (body: {
2569
3098
  id: string;
2570
3099
  reason?: string;
2571
- }, config?: RequestConfig) => Promise<ApiResponse<any>>;
3100
+ }, config?: RequestConfig) => RequestBuilder<any>;
2572
3101
  };
2573
3102
  pay: {
2574
3103
  /** 为当前用户的待支付账单生成支付链接 */
2575
3104
  post: (body: {
2576
3105
  id: string;
2577
- }, config?: RequestConfig) => Promise<ApiResponse<any>>;
3106
+ }, config?: RequestConfig) => RequestBuilder<any>;
2578
3107
  };
2579
3108
  verifyPayment: {
2580
3109
  /** 查询支付宝订单状态,如果已支付则完成订阅入账 */
2581
3110
  post: (body: {
2582
3111
  orderId: string;
2583
- }, config?: RequestConfig) => Promise<ApiResponse<any>>;
3112
+ }, config?: RequestConfig) => RequestBuilder<any>;
2584
3113
  };
2585
3114
  void: {
2586
3115
  /** 管理端作废待支付订阅账单 */
2587
3116
  post: (body: {
2588
3117
  id: string;
2589
3118
  reason?: string;
2590
- }, config?: RequestConfig) => Promise<ApiResponse<any>>;
3119
+ }, config?: RequestConfig) => RequestBuilder<any>;
2591
3120
  };
2592
3121
  statistics: {
2593
3122
  /** 获取订阅账单统计数据 */
2594
3123
  post: (body: {
2595
3124
  startTime?: string;
2596
3125
  endTime?: string;
2597
- }, config?: RequestConfig) => Promise<ApiResponse<any>>;
3126
+ }, config?: RequestConfig) => RequestBuilder<any>;
2598
3127
  };
2599
3128
  revenueReport: {
2600
3129
  /** 获取收入报表数据 */
@@ -2602,18 +3131,18 @@ export interface ApiClient {
2602
3131
  startTime: string;
2603
3132
  endTime: string;
2604
3133
  granularity: "day" | "week" | "month" | "year";
2605
- }, config?: RequestConfig) => Promise<ApiResponse<any>>;
3134
+ }, config?: RequestConfig) => RequestBuilder<any>;
2606
3135
  };
2607
3136
  revenueByProduct: {
2608
3137
  /** 获取按产品分布的收入数据 */
2609
3138
  post: (body: {
2610
3139
  startTime?: string;
2611
3140
  endTime?: string;
2612
- }, config?: RequestConfig) => Promise<ApiResponse<any>>;
3141
+ }, config?: RequestConfig) => RequestBuilder<any>;
2613
3142
  };
2614
3143
  statusOptions: {
2615
3144
  /** 获取订阅账单状态下拉选项与展示文案 */
2616
- post: (config?: RequestConfig) => Promise<ApiResponse<any>>;
3145
+ post: (config?: RequestConfig) => RequestBuilder<any>;
2617
3146
  };
2618
3147
  stats: {
2619
3148
  /** 供其他服务查询发票统计数据 */
@@ -2621,7 +3150,7 @@ export interface ApiClient {
2621
3150
  appId: string;
2622
3151
  userIds: string[];
2623
3152
  status?: string;
2624
- }, config?: RequestConfig) => Promise<ApiResponse<any>>;
3153
+ }, config?: RequestConfig) => RequestBuilder<any>;
2625
3154
  };
2626
3155
  statsByUser: {
2627
3156
  /** 供其他服务按用户分组查询发票统计 */
@@ -2629,7 +3158,7 @@ export interface ApiClient {
2629
3158
  appId: string;
2630
3159
  userIds: string[];
2631
3160
  status?: string;
2632
- }, config?: RequestConfig) => Promise<ApiResponse<any>>;
3161
+ }, config?: RequestConfig) => RequestBuilder<any>;
2633
3162
  };
2634
3163
  };
2635
3164
  points: {
@@ -2637,7 +3166,7 @@ export interface ApiClient {
2637
3166
  /** 查询用户积分账户余额 */
2638
3167
  post: (body: {
2639
3168
  userId?: string;
2640
- }, config?: RequestConfig) => Promise<ApiResponse<any>>;
3169
+ }, config?: RequestConfig) => RequestBuilder<any>;
2641
3170
  };
2642
3171
  earn: {
2643
3172
  /** 发放积分(充值、奖励等) */
@@ -2651,17 +3180,18 @@ export interface ApiClient {
2651
3180
  referrerId?: string;
2652
3181
  ruleId?: string;
2653
3182
  metadata?: Record<string, unknown>;
2654
- }, config?: RequestConfig) => Promise<ApiResponse<any>>;
3183
+ }, config?: RequestConfig) => RequestBuilder<any>;
2655
3184
  };
2656
3185
  consume: {
2657
3186
  /** 按调用方计算好的积分数消费积分 */
2658
3187
  post: (body: {
2659
3188
  userId: string;
2660
- amount: number;
3189
+ amount?: number;
3190
+ amountMicro?: number;
2661
3191
  requestId?: string;
2662
3192
  description?: string;
2663
3193
  metadata?: Record<string, unknown>;
2664
- }, config?: RequestConfig) => Promise<ApiResponse<any>>;
3194
+ }, config?: RequestConfig) => RequestBuilder<any>;
2665
3195
  };
2666
3196
  consumeByPrice: {
2667
3197
  /** 根据计价配置消费积分 */
@@ -2672,7 +3202,7 @@ export interface ApiClient {
2672
3202
  requestId?: string;
2673
3203
  description?: string;
2674
3204
  metadata?: Record<string, unknown>;
2675
- }, config?: RequestConfig) => Promise<ApiResponse<any>>;
3205
+ }, config?: RequestConfig) => RequestBuilder<any>;
2676
3206
  };
2677
3207
  checkBalance: {
2678
3208
  /** 检查积分是否足够(不扣费) */
@@ -2680,7 +3210,7 @@ export interface ApiClient {
2680
3210
  userId: string;
2681
3211
  priceCode: string;
2682
3212
  quantity?: number;
2683
- }, config?: RequestConfig) => Promise<ApiResponse<any>>;
3213
+ }, config?: RequestConfig) => RequestBuilder<any>;
2684
3214
  };
2685
3215
  reversal: {
2686
3216
  /** 冲正/退还已消费的积分 */
@@ -2689,7 +3219,7 @@ export interface ApiClient {
2689
3219
  originalTransactionId: string;
2690
3220
  requestId?: string;
2691
3221
  reason: string;
2692
- }, config?: RequestConfig) => Promise<ApiResponse<any>>;
3222
+ }, config?: RequestConfig) => RequestBuilder<any>;
2693
3223
  };
2694
3224
  clawback: {
2695
3225
  /** 追回/扣回已发放的积分 */
@@ -2698,7 +3228,7 @@ export interface ApiClient {
2698
3228
  originalTransactionId: string;
2699
3229
  requestId?: string;
2700
3230
  reason: string;
2701
- }, config?: RequestConfig) => Promise<ApiResponse<any>>;
3231
+ }, config?: RequestConfig) => RequestBuilder<any>;
2702
3232
  };
2703
3233
  adjust: {
2704
3234
  /** 人工调整积分(加/减) */
@@ -2708,7 +3238,7 @@ export interface ApiClient {
2708
3238
  requestId?: string;
2709
3239
  reason: string;
2710
3240
  relatedOrderId?: string;
2711
- }, config?: RequestConfig) => Promise<ApiResponse<any>>;
3241
+ }, config?: RequestConfig) => RequestBuilder<any>;
2712
3242
  };
2713
3243
  batchAdjust: {
2714
3244
  /** 批量调整多用户积分 */
@@ -2717,19 +3247,19 @@ export interface ApiClient {
2717
3247
  amount: number;
2718
3248
  requestId?: string;
2719
3249
  reason: string;
2720
- }, config?: RequestConfig) => Promise<ApiResponse<any>>;
3250
+ }, config?: RequestConfig) => RequestBuilder<any>;
2721
3251
  };
2722
3252
  statistics: {
2723
3253
  /** 获取用户积分统计数据 */
2724
3254
  post: (body: {
2725
3255
  userId?: string;
2726
- }, config?: RequestConfig) => Promise<ApiResponse<any>>;
3256
+ }, config?: RequestConfig) => RequestBuilder<any>;
2727
3257
  };
2728
3258
  leaderboard: {
2729
3259
  /** 获取积分排行榜 */
2730
3260
  post: (body: {
2731
3261
  limit?: number;
2732
- }, config?: RequestConfig) => Promise<ApiResponse<any>>;
3262
+ }, config?: RequestConfig) => RequestBuilder<any>;
2733
3263
  };
2734
3264
  };
2735
3265
  pointsHistory: {
@@ -2743,20 +3273,20 @@ export interface ApiClient {
2743
3273
  pageSize?: number;
2744
3274
  startDate?: string;
2745
3275
  endDate?: string;
2746
- }, config?: RequestConfig) => Promise<ApiResponse<any>>;
3276
+ }, config?: RequestConfig) => RequestBuilder<any>;
2747
3277
  };
2748
3278
  findOne: {
2749
3279
  /** 根据 ID 查询积分历史详情 */
2750
3280
  post: (body: {
2751
3281
  id: string;
2752
- }, config?: RequestConfig) => Promise<ApiResponse<any>>;
3282
+ }, config?: RequestConfig) => RequestBuilder<any>;
2753
3283
  };
2754
3284
  statistics: {
2755
3285
  /** 获取积分统计数据 */
2756
3286
  post: (body: {
2757
3287
  userId?: string;
2758
3288
  period?: "day" | "week" | "month" | "year";
2759
- }, config?: RequestConfig) => Promise<ApiResponse<any>>;
3289
+ }, config?: RequestConfig) => RequestBuilder<any>;
2760
3290
  };
2761
3291
  getTrendChart: {
2762
3292
  /** 获取积分变动趋势图表数据 */
@@ -2765,7 +3295,7 @@ export interface ApiClient {
2765
3295
  startTime: string;
2766
3296
  endTime: string;
2767
3297
  granularity: "minute" | "hour" | "day" | "month" | "year";
2768
- }, config?: RequestConfig) => Promise<ApiResponse<any>>;
3298
+ }, config?: RequestConfig) => RequestBuilder<any>;
2769
3299
  };
2770
3300
  getTypeDistributionChart: {
2771
3301
  /** 获取积分类型分布图表数据 */
@@ -2773,7 +3303,7 @@ export interface ApiClient {
2773
3303
  userId?: string;
2774
3304
  startTime?: string;
2775
3305
  endTime?: string;
2776
- }, config?: RequestConfig) => Promise<ApiResponse<any>>;
3306
+ }, config?: RequestConfig) => RequestBuilder<any>;
2777
3307
  };
2778
3308
  getRankingChart: {
2779
3309
  /** 获取用户积分排行榜 */
@@ -2782,7 +3312,7 @@ export interface ApiClient {
2782
3312
  startTime?: string;
2783
3313
  endTime?: string;
2784
3314
  limit?: number;
2785
- }, config?: RequestConfig) => Promise<ApiResponse<any>>;
3315
+ }, config?: RequestConfig) => RequestBuilder<any>;
2786
3316
  };
2787
3317
  };
2788
3318
  pointsTrigger: {
@@ -2791,7 +3321,7 @@ export interface ApiClient {
2791
3321
  post: (body: {
2792
3322
  ruleId: string;
2793
3323
  eventData?: Record<string, unknown>;
2794
- }, config?: RequestConfig) => Promise<ApiResponse<any>>;
3324
+ }, config?: RequestConfig) => RequestBuilder<any>;
2795
3325
  };
2796
3326
  triggerByEvent: {
2797
3327
  /** 根据事件自动匹配并触发积分规则 */
@@ -2799,7 +3329,7 @@ export interface ApiClient {
2799
3329
  event: string;
2800
3330
  eventData?: Record<string, unknown>;
2801
3331
  userId?: string;
2802
- }, config?: RequestConfig) => Promise<ApiResponse<any>>;
3332
+ }, config?: RequestConfig) => RequestBuilder<any>;
2803
3333
  };
2804
3334
  batchTrigger: {
2805
3335
  /** 批量触发多个积分规则 */
@@ -2808,7 +3338,7 @@ export interface ApiClient {
2808
3338
  ruleId: string;
2809
3339
  eventData?: Record<string, unknown>;
2810
3340
  }[];
2811
- }, config?: RequestConfig) => Promise<ApiResponse<any>>;
3341
+ }, config?: RequestConfig) => RequestBuilder<any>;
2812
3342
  };
2813
3343
  };
2814
3344
  pointsTriggerHistory: {
@@ -2827,21 +3357,21 @@ export interface ApiClient {
2827
3357
  startDate?: string;
2828
3358
  endDate?: string;
2829
3359
  };
2830
- }, config?: RequestConfig) => Promise<ApiResponse<any>>;
3360
+ }, config?: RequestConfig) => RequestBuilder<any>;
2831
3361
  };
2832
3362
  findOne: {
2833
3363
  /** 根据 ID 查询积分触发历史详情 */
2834
3364
  post: (body: {
2835
3365
  id: string;
2836
- }, config?: RequestConfig) => Promise<ApiResponse<any>>;
3366
+ }, config?: RequestConfig) => RequestBuilder<any>;
2837
3367
  };
2838
3368
  statusOptions: {
2839
3369
  /** 获取积分触发状态下拉选项 */
2840
- post: (config?: RequestConfig) => Promise<ApiResponse<any>>;
3370
+ post: (config?: RequestConfig) => RequestBuilder<any>;
2841
3371
  };
2842
3372
  rewardTargetOptions: {
2843
3373
  /** 获取奖励目标下拉选项 */
2844
- post: (config?: RequestConfig) => Promise<ApiResponse<any>>;
3374
+ post: (config?: RequestConfig) => RequestBuilder<any>;
2845
3375
  };
2846
3376
  statistics: {
2847
3377
  /** 获取积分触发历史统计数据 */
@@ -2851,7 +3381,7 @@ export interface ApiClient {
2851
3381
  startTime?: string;
2852
3382
  endTime?: string;
2853
3383
  period?: "today" | "week" | "month" | "year";
2854
- }, config?: RequestConfig) => Promise<ApiResponse<any>>;
3384
+ }, config?: RequestConfig) => RequestBuilder<any>;
2855
3385
  };
2856
3386
  trends: {
2857
3387
  /** 获取积分触发趋势图表数据 */
@@ -2861,7 +3391,7 @@ export interface ApiClient {
2861
3391
  startTime?: string;
2862
3392
  endTime?: string;
2863
3393
  granularity?: "minute" | "hour" | "day" | "month" | "year";
2864
- }, config?: RequestConfig) => Promise<ApiResponse<any>>;
3394
+ }, config?: RequestConfig) => RequestBuilder<any>;
2865
3395
  };
2866
3396
  pointsTrends: {
2867
3397
  /** 获取积分变动趋势图表数据 */
@@ -2871,7 +3401,7 @@ export interface ApiClient {
2871
3401
  startTime?: string;
2872
3402
  endTime?: string;
2873
3403
  granularity?: "minute" | "hour" | "day" | "month" | "year";
2874
- }, config?: RequestConfig) => Promise<ApiResponse<any>>;
3404
+ }, config?: RequestConfig) => RequestBuilder<any>;
2875
3405
  };
2876
3406
  completionAnalysis: {
2877
3407
  /** 获取积分规则完成度分析数据 */
@@ -2880,7 +3410,7 @@ export interface ApiClient {
2880
3410
  ruleId?: string;
2881
3411
  startTime?: string;
2882
3412
  endTime?: string;
2883
- }, config?: RequestConfig) => Promise<ApiResponse<any>>;
3413
+ }, config?: RequestConfig) => RequestBuilder<any>;
2884
3414
  };
2885
3415
  triggerTypeTrends: {
2886
3416
  /** 获取积分触发类型趋势图表数据 */
@@ -2890,7 +3420,7 @@ export interface ApiClient {
2890
3420
  startTime?: string;
2891
3421
  endTime?: string;
2892
3422
  granularity?: "minute" | "hour" | "day" | "month" | "year";
2893
- }, config?: RequestConfig) => Promise<ApiResponse<any>>;
3423
+ }, config?: RequestConfig) => RequestBuilder<any>;
2894
3424
  };
2895
3425
  };
2896
3426
  pointsTriggerRule: {
@@ -2905,7 +3435,7 @@ export interface ApiClient {
2905
3435
  pointsReward: unknown;
2906
3436
  constraints: unknown;
2907
3437
  activeTimeRanges: unknown;
2908
- }, config?: RequestConfig) => Promise<ApiResponse<any>>;
3438
+ }, config?: RequestConfig) => RequestBuilder<any>;
2909
3439
  };
2910
3440
  find: {
2911
3441
  /** 分页查询积分触发规则列表 */
@@ -2919,13 +3449,13 @@ export interface ApiClient {
2919
3449
  ruleCode?: string;
2920
3450
  event?: string;
2921
3451
  };
2922
- }, config?: RequestConfig) => Promise<ApiResponse<any>>;
3452
+ }, config?: RequestConfig) => RequestBuilder<any>;
2923
3453
  };
2924
3454
  findOne: {
2925
3455
  /** 根据 ID 查询积分触发规则详情 */
2926
3456
  post: (body: {
2927
3457
  id: string;
2928
- }, config?: RequestConfig) => Promise<ApiResponse<any>>;
3458
+ }, config?: RequestConfig) => RequestBuilder<any>;
2929
3459
  };
2930
3460
  update: {
2931
3461
  /** 更新积分触发规则配置 */
@@ -2939,28 +3469,28 @@ export interface ApiClient {
2939
3469
  pointsReward?: unknown;
2940
3470
  constraints?: unknown;
2941
3471
  activeTimeRanges?: unknown;
2942
- }, config?: RequestConfig) => Promise<ApiResponse<any>>;
3472
+ }, config?: RequestConfig) => RequestBuilder<any>;
2943
3473
  };
2944
3474
  updateStatus: {
2945
3475
  /** 启用或禁用积分触发规则 */
2946
3476
  post: (body: {
2947
3477
  id: string;
2948
3478
  status: "draft" | "active" | "inactive";
2949
- }, config?: RequestConfig) => Promise<ApiResponse<any>>;
3479
+ }, config?: RequestConfig) => RequestBuilder<any>;
2950
3480
  };
2951
3481
  delete: {
2952
3482
  /** 删除积分触发规则 */
2953
3483
  post: (body: {
2954
3484
  id: string;
2955
- }, config?: RequestConfig) => Promise<ApiResponse<any>>;
3485
+ }, config?: RequestConfig) => RequestBuilder<any>;
2956
3486
  };
2957
3487
  statusOptions: {
2958
3488
  /** 获取积分触发规则状态下拉选项 */
2959
- post: (config?: RequestConfig) => Promise<ApiResponse<any>>;
3489
+ post: (config?: RequestConfig) => RequestBuilder<any>;
2960
3490
  };
2961
3491
  eventOptions: {
2962
3492
  /** 获取可绑定的事件类型选项 */
2963
- post: (config?: RequestConfig) => Promise<ApiResponse<any>>;
3493
+ post: (config?: RequestConfig) => RequestBuilder<any>;
2964
3494
  };
2965
3495
  };
2966
3496
  pointsPriceConfig: {
@@ -2975,7 +3505,7 @@ export interface ApiClient {
2975
3505
  unit?: string;
2976
3506
  minCharge?: number;
2977
3507
  status?: "active" | "inactive";
2978
- }, config?: RequestConfig) => Promise<ApiResponse<any>>;
3508
+ }, config?: RequestConfig) => RequestBuilder<any>;
2979
3509
  };
2980
3510
  find: {
2981
3511
  /** 分页查询计价配置列表 */
@@ -2988,14 +3518,14 @@ export interface ApiClient {
2988
3518
  };
2989
3519
  page?: number;
2990
3520
  pageSize?: number;
2991
- }, config?: RequestConfig) => Promise<ApiResponse<any>>;
3521
+ }, config?: RequestConfig) => RequestBuilder<any>;
2992
3522
  };
2993
3523
  findOne: {
2994
3524
  /** 根据 ID 或 code 查询计价配置详情 */
2995
3525
  post: (body: {
2996
3526
  id?: string;
2997
3527
  code?: string;
2998
- }, config?: RequestConfig) => Promise<ApiResponse<any>>;
3528
+ }, config?: RequestConfig) => RequestBuilder<any>;
2999
3529
  };
3000
3530
  update: {
3001
3531
  /** 更新计价配置 */
@@ -3008,24 +3538,24 @@ export interface ApiClient {
3008
3538
  unit?: string;
3009
3539
  minCharge?: number;
3010
3540
  status?: "active" | "inactive";
3011
- }, config?: RequestConfig) => Promise<ApiResponse<any>>;
3541
+ }, config?: RequestConfig) => RequestBuilder<any>;
3012
3542
  };
3013
3543
  updateStatus: {
3014
3544
  /** 启用或停用计价配置 */
3015
3545
  post: (body: {
3016
3546
  id: string;
3017
3547
  status: "active" | "inactive";
3018
- }, config?: RequestConfig) => Promise<ApiResponse<any>>;
3548
+ }, config?: RequestConfig) => RequestBuilder<any>;
3019
3549
  };
3020
3550
  delete: {
3021
3551
  /** 删除计价配置 */
3022
3552
  post: (body: {
3023
3553
  id: string;
3024
- }, config?: RequestConfig) => Promise<ApiResponse<any>>;
3554
+ }, config?: RequestConfig) => RequestBuilder<any>;
3025
3555
  };
3026
3556
  billingModeOptions: {
3027
3557
  /** 获取计费方式下拉选项 */
3028
- post: (config?: RequestConfig) => Promise<ApiResponse<any>>;
3558
+ post: (config?: RequestConfig) => RequestBuilder<any>;
3029
3559
  };
3030
3560
  };
3031
3561
  pointsUsageRecord: {
@@ -3042,7 +3572,7 @@ export interface ApiClient {
3042
3572
  };
3043
3573
  page?: number;
3044
3574
  pageSize?: number;
3045
- }, config?: RequestConfig) => Promise<ApiResponse<any>>;
3575
+ }, config?: RequestConfig) => RequestBuilder<any>;
3046
3576
  };
3047
3577
  statistics: {
3048
3578
  /** 按维度统计消费数据 */
@@ -3053,14 +3583,14 @@ export interface ApiClient {
3053
3583
  priceCode?: string;
3054
3584
  userId?: string;
3055
3585
  limit?: number;
3056
- }, config?: RequestConfig) => Promise<ApiResponse<any>>;
3586
+ }, config?: RequestConfig) => RequestBuilder<any>;
3057
3587
  };
3058
3588
  overview: {
3059
3589
  /** 获取消费概览数据 */
3060
3590
  post: (body: {
3061
3591
  startDate?: string;
3062
3592
  endDate?: string;
3063
- }, config?: RequestConfig) => Promise<ApiResponse<any>>;
3593
+ }, config?: RequestConfig) => RequestBuilder<any>;
3064
3594
  };
3065
3595
  };
3066
3596
  pointsBalanceAlert: {
@@ -3072,11 +3602,11 @@ export interface ApiClient {
3072
3602
  notifyEmail?: boolean;
3073
3603
  notifyEmails?: string[];
3074
3604
  cooldownHours?: number;
3075
- }, config?: RequestConfig) => Promise<ApiResponse<any>>;
3605
+ }, config?: RequestConfig) => RequestBuilder<any>;
3076
3606
  };
3077
3607
  getConfig: {
3078
3608
  /** 获取当前预警配置 */
3079
- post: (config?: RequestConfig) => Promise<ApiResponse<any>>;
3609
+ post: (config?: RequestConfig) => RequestBuilder<any>;
3080
3610
  };
3081
3611
  findAlerts: {
3082
3612
  /** 分页查询预警记录 */
@@ -3089,49 +3619,108 @@ export interface ApiClient {
3089
3619
  };
3090
3620
  page?: number;
3091
3621
  pageSize?: number;
3092
- }, config?: RequestConfig) => Promise<ApiResponse<any>>;
3622
+ }, config?: RequestConfig) => RequestBuilder<any>;
3093
3623
  };
3094
3624
  triggerCheck: {
3095
3625
  /** 手动触发预警检查(测试用) */
3096
3626
  post: (body: {
3097
3627
  userId: string;
3098
- }, config?: RequestConfig) => Promise<ApiResponse<any>>;
3628
+ }, config?: RequestConfig) => RequestBuilder<any>;
3099
3629
  };
3100
3630
  };
3101
3631
  consumption: {
3102
3632
  trend: {
3103
- /** 聚合服务消费的趋势数据 */
3633
+ /** 聚合积分消耗趋势 */
3104
3634
  post: (body: {
3105
3635
  startDate?: string;
3106
3636
  endDate?: string;
3107
3637
  limit?: number;
3108
- }, config?: RequestConfig) => Promise<ApiResponse<any>>;
3638
+ }, config?: RequestConfig) => RequestBuilder<any>;
3109
3639
  };
3110
3640
  overview: {
3111
- /** 聚合服务消费的概览数据 */
3641
+ /** 聚合积分消耗概览 */
3112
3642
  post: (body: {
3113
3643
  startDate?: string;
3114
3644
  endDate?: string;
3115
- }, config?: RequestConfig) => Promise<ApiResponse<any>>;
3645
+ }, config?: RequestConfig) => RequestBuilder<any>;
3646
+ };
3647
+ };
3648
+ billingUsage: {
3649
+ charges: {
3650
+ list: {
3651
+ /** 查询 billingUsageRecord 全站扣费流水 */
3652
+ post: (body: {
3653
+ page?: number;
3654
+ pageSize?: number;
3655
+ userId?: string;
3656
+ serviceGroup?: "ai" | "platform" | "storage";
3657
+ serviceKey?: string;
3658
+ chargeMethodKey?: string;
3659
+ subjectKey?: string;
3660
+ id?: string;
3661
+ idempotencyKey?: string;
3662
+ resourceId?: string;
3663
+ startDate?: string;
3664
+ endDate?: string;
3665
+ }, config?: RequestConfig) => RequestBuilder<any>;
3666
+ };
3667
+ get: {
3668
+ /** 按 ID 查询单条扣费记录(含 AI 扩展字段,供详情抽屉) */
3669
+ post: (body: {
3670
+ id: string;
3671
+ }, config?: RequestConfig) => RequestBuilder<any>;
3672
+ };
3673
+ };
3674
+ consumption: {
3675
+ overview: {
3676
+ /** 聚合 AI / 平台 / 存储积分消耗 */
3677
+ post: (body: {
3678
+ userId?: string;
3679
+ serviceGroup?: "ai" | "platform" | "storage";
3680
+ serviceKey?: string;
3681
+ startDate?: string;
3682
+ endDate?: string;
3683
+ }, config?: RequestConfig) => RequestBuilder<any>;
3684
+ };
3685
+ trend: {
3686
+ /** 按日聚合积分消耗趋势 */
3687
+ post: (body: {
3688
+ userId?: string;
3689
+ serviceGroup?: "ai" | "platform" | "storage";
3690
+ serviceKey?: string;
3691
+ startDate?: string;
3692
+ endDate?: string;
3693
+ limit?: number;
3694
+ }, config?: RequestConfig) => RequestBuilder<any>;
3695
+ };
3696
+ };
3697
+ reference: {
3698
+ trace: {
3699
+ /** 按 resourceId 查询扣费明细与积分流水 */
3700
+ post: (body: {
3701
+ resourceId: string;
3702
+ serviceKey?: string;
3703
+ }, config?: RequestConfig) => RequestBuilder<any>;
3704
+ };
3116
3705
  };
3117
3706
  };
3118
3707
  pointsRecharge: {
3119
3708
  packages: {
3120
3709
  /** 获取可用的充值套餐列表 */
3121
- post: (config?: RequestConfig) => Promise<ApiResponse<any>>;
3710
+ post: (config?: RequestConfig) => RequestBuilder<any>;
3122
3711
  };
3123
3712
  createOrder: {
3124
3713
  /** 创建积分充值订单 */
3125
3714
  post: (body: {
3126
3715
  packageId: string;
3127
3716
  payType: "alipay" | "weixinpay";
3128
- }, config?: RequestConfig) => Promise<ApiResponse<any>>;
3717
+ }, config?: RequestConfig) => RequestBuilder<any>;
3129
3718
  };
3130
3719
  createQRCodeOrder: {
3131
3720
  /** 创建支付宝扫码支付订单(当面付) */
3132
3721
  post: (body: {
3133
3722
  packageId: string;
3134
- }, config?: RequestConfig) => Promise<ApiResponse<any>>;
3723
+ }, config?: RequestConfig) => RequestBuilder<any>;
3135
3724
  };
3136
3725
  orders: {
3137
3726
  /** 查询用户的充值订单记录 */
@@ -3139,7 +3728,7 @@ export interface ApiClient {
3139
3728
  status?: string;
3140
3729
  page?: number;
3141
3730
  pageSize?: number;
3142
- }, config?: RequestConfig) => Promise<ApiResponse<any>>;
3731
+ }, config?: RequestConfig) => RequestBuilder<any>;
3143
3732
  };
3144
3733
  find: {
3145
3734
  /** 管理端分页查询全部积分充值订单 */
@@ -3152,42 +3741,42 @@ export interface ApiClient {
3152
3741
  startTime?: string;
3153
3742
  endTime?: string;
3154
3743
  };
3155
- }, config?: RequestConfig) => Promise<ApiResponse<any>>;
3744
+ }, config?: RequestConfig) => RequestBuilder<any>;
3156
3745
  };
3157
3746
  detail: {
3158
3747
  /** 管理端查询单个积分充值订单详情及操作时间线 */
3159
3748
  post: (body: {
3160
3749
  orderId: string;
3161
- }, config?: RequestConfig) => Promise<ApiResponse<any>>;
3750
+ }, config?: RequestConfig) => RequestBuilder<any>;
3162
3751
  };
3163
3752
  adminStatistics: {
3164
3753
  /** 管理端积分充值订单统计 */
3165
3754
  post: (body: {
3166
3755
  startTime?: string;
3167
3756
  endTime?: string;
3168
- }, config?: RequestConfig) => Promise<ApiResponse<any>>;
3757
+ }, config?: RequestConfig) => RequestBuilder<any>;
3169
3758
  };
3170
3759
  statistics: {
3171
3760
  /** 获取用户积分充值订单统计 */
3172
3761
  post: (body: {
3173
3762
  startTime?: string;
3174
3763
  endTime?: string;
3175
- }, config?: RequestConfig) => Promise<ApiResponse<any>>;
3764
+ }, config?: RequestConfig) => RequestBuilder<any>;
3176
3765
  };
3177
3766
  statusOptions: {
3178
3767
  /** 获取积分充值订单状态下拉选项与展示文案 */
3179
- post: (config?: RequestConfig) => Promise<ApiResponse<any>>;
3768
+ post: (config?: RequestConfig) => RequestBuilder<any>;
3180
3769
  };
3181
3770
  verifyPayment: {
3182
3771
  /** 查询支付宝订单状态,如果已支付则完成充值 */
3183
3772
  post: (body: {
3184
3773
  orderId: string;
3185
- }, config?: RequestConfig) => Promise<ApiResponse<any>>;
3774
+ }, config?: RequestConfig) => RequestBuilder<any>;
3186
3775
  };
3187
3776
  notify: {
3188
3777
  alipay: {
3189
3778
  /** 支付宝积分充值回调通知 */
3190
- post: (body: Record<string, unknown>, config?: RequestConfig) => Promise<ApiResponse<any>>;
3779
+ post: (body: Record<string, unknown>, config?: RequestConfig) => RequestBuilder<any>;
3191
3780
  };
3192
3781
  };
3193
3782
  };
@@ -3196,7 +3785,7 @@ export interface ApiClient {
3196
3785
  /** 获取充值套餐列表(管理端) */
3197
3786
  post: (body: {
3198
3787
  includeDisabled?: boolean;
3199
- }, config?: RequestConfig) => Promise<ApiResponse<any>>;
3788
+ }, config?: RequestConfig) => RequestBuilder<any>;
3200
3789
  };
3201
3790
  create: {
3202
3791
  /** 创建新的充值套餐 */
@@ -3207,7 +3796,7 @@ export interface ApiClient {
3207
3796
  bonus: number;
3208
3797
  description?: string;
3209
3798
  sort?: number;
3210
- }, config?: RequestConfig) => Promise<ApiResponse<any>>;
3799
+ }, config?: RequestConfig) => RequestBuilder<any>;
3211
3800
  };
3212
3801
  update: {
3213
3802
  /** 更新充值套餐信息 */
@@ -3220,13 +3809,13 @@ export interface ApiClient {
3220
3809
  description?: string;
3221
3810
  sort?: number;
3222
3811
  enabled?: boolean;
3223
- }, config?: RequestConfig) => Promise<ApiResponse<any>>;
3812
+ }, config?: RequestConfig) => RequestBuilder<any>;
3224
3813
  };
3225
3814
  delete: {
3226
3815
  /** 删除充值套餐 */
3227
3816
  post: (body: {
3228
3817
  id: string;
3229
- }, config?: RequestConfig) => Promise<ApiResponse<any>>;
3818
+ }, config?: RequestConfig) => RequestBuilder<any>;
3230
3819
  };
3231
3820
  updateSort: {
3232
3821
  /** 批量更新套餐排序 */
@@ -3235,7 +3824,7 @@ export interface ApiClient {
3235
3824
  id: string;
3236
3825
  sort: number;
3237
3826
  }[];
3238
- }, config?: RequestConfig) => Promise<ApiResponse<any>>;
3827
+ }, config?: RequestConfig) => RequestBuilder<any>;
3239
3828
  };
3240
3829
  };
3241
3830
  refund: {
@@ -3245,7 +3834,7 @@ export interface ApiClient {
3245
3834
  orderId: string;
3246
3835
  reason?: string;
3247
3836
  refundAmount?: number;
3248
- }, config?: RequestConfig) => Promise<ApiResponse<any>>;
3837
+ }, config?: RequestConfig) => RequestBuilder<any>;
3249
3838
  };
3250
3839
  applySubscription: {
3251
3840
  /** 对已支付订阅账单申请退款 */
@@ -3254,7 +3843,7 @@ export interface ApiClient {
3254
3843
  reason?: string;
3255
3844
  refundAmount?: number;
3256
3845
  subscriptionAction?: "cancel_immediate" | "none";
3257
- }, config?: RequestConfig) => Promise<ApiResponse<any>>;
3846
+ }, config?: RequestConfig) => RequestBuilder<any>;
3258
3847
  };
3259
3848
  approve: {
3260
3849
  /** 审批退款申请(通过或拒绝) */
@@ -3262,13 +3851,13 @@ export interface ApiClient {
3262
3851
  refundNo: string;
3263
3852
  action: "approve" | "reject";
3264
3853
  remark?: string;
3265
- }, config?: RequestConfig) => Promise<ApiResponse<any>>;
3854
+ }, config?: RequestConfig) => RequestBuilder<any>;
3266
3855
  };
3267
3856
  execute: {
3268
3857
  /** 执行已审批的退款(调用支付宝/微信退款接口) */
3269
3858
  post: (body: {
3270
3859
  refundNo: string;
3271
- }, config?: RequestConfig) => Promise<ApiResponse<any>>;
3860
+ }, config?: RequestConfig) => RequestBuilder<any>;
3272
3861
  };
3273
3862
  manual: {
3274
3863
  /** 管理员手动标记退款完成(用于线上接口故障或特殊情况) */
@@ -3276,7 +3865,7 @@ export interface ApiClient {
3276
3865
  refundNo: string;
3277
3866
  manualRefundNo?: string;
3278
3867
  remark: string;
3279
- }, config?: RequestConfig) => Promise<ApiResponse<any>>;
3868
+ }, config?: RequestConfig) => RequestBuilder<any>;
3280
3869
  };
3281
3870
  list: {
3282
3871
  /** 查询退款记录列表 */
@@ -3288,30 +3877,30 @@ export interface ApiClient {
3288
3877
  userId?: string;
3289
3878
  startDate?: string;
3290
3879
  endDate?: string;
3291
- }, config?: RequestConfig) => Promise<ApiResponse<any>>;
3880
+ }, config?: RequestConfig) => RequestBuilder<any>;
3292
3881
  };
3293
3882
  detail: {
3294
3883
  /** 查询单个退款单详情 */
3295
3884
  post: (body: {
3296
3885
  refundNo: string;
3297
- }, config?: RequestConfig) => Promise<ApiResponse<any>>;
3886
+ }, config?: RequestConfig) => RequestBuilder<any>;
3298
3887
  };
3299
3888
  stats: {
3300
3889
  /** 获取退款统计数据 */
3301
3890
  post: (body: {
3302
3891
  startDate?: string;
3303
3892
  endDate?: string;
3304
- }, config?: RequestConfig) => Promise<ApiResponse<any>>;
3893
+ }, config?: RequestConfig) => RequestBuilder<any>;
3305
3894
  };
3306
3895
  syncStatus: {
3307
3896
  /** 手动同步单个退款单的支付宝退款状态 */
3308
3897
  post: (body: {
3309
3898
  refundNo: string;
3310
- }, config?: RequestConfig) => Promise<ApiResponse<any>>;
3899
+ }, config?: RequestConfig) => RequestBuilder<any>;
3311
3900
  };
3312
3901
  statusOptions: {
3313
3902
  /** 获取退款单状态下拉选项与展示文案 */
3314
- post: (config?: RequestConfig) => Promise<ApiResponse<any>>;
3903
+ post: (config?: RequestConfig) => RequestBuilder<any>;
3315
3904
  };
3316
3905
  };
3317
3906
  serviceDefinition: {
@@ -3320,7 +3909,9 @@ export interface ApiClient {
3320
3909
  post: (body: {
3321
3910
  page?: number;
3322
3911
  pageSize?: number;
3323
- }, config?: RequestConfig) => Promise<ApiResponse<any>>;
3912
+ keyword?: string;
3913
+ enabled?: boolean;
3914
+ }, config?: RequestConfig) => RequestBuilder<any>;
3324
3915
  };
3325
3916
  create: {
3326
3917
  /** 创建新的服务定义 */
@@ -3328,9 +3919,7 @@ export interface ApiClient {
3328
3919
  serviceType: string;
3329
3920
  name: string;
3330
3921
  description?: string;
3331
- billingUnit: string;
3332
- billingMode?: "event" | "continuous";
3333
- }, config?: RequestConfig) => Promise<ApiResponse<any>>;
3922
+ }, config?: RequestConfig) => RequestBuilder<any>;
3334
3923
  };
3335
3924
  update: {
3336
3925
  /** 更新服务定义 */
@@ -3338,39 +3927,14 @@ export interface ApiClient {
3338
3927
  id: string;
3339
3928
  name?: string;
3340
3929
  description?: string;
3341
- billingUnit?: string;
3342
- billingMode?: "event" | "continuous";
3343
3930
  enabled?: boolean;
3344
- }, config?: RequestConfig) => Promise<ApiResponse<any>>;
3931
+ }, config?: RequestConfig) => RequestBuilder<any>;
3345
3932
  };
3346
3933
  delete: {
3347
3934
  /** 删除服务定义 */
3348
3935
  post: (body: {
3349
3936
  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>>;
3937
+ }, config?: RequestConfig) => RequestBuilder<any>;
3374
3938
  };
3375
3939
  };
3376
3940
  usage: {
@@ -3378,17 +3942,20 @@ export interface ApiClient {
3378
3942
  /** 上报服务用量,自动计费扣费 */
3379
3943
  post: (body: {
3380
3944
  serviceType: string;
3945
+ chargeMethodKey?: string;
3381
3946
  metadata: Record<string, unknown>;
3382
- requestId?: string;
3383
- }, config?: RequestConfig) => Promise<ApiResponse<any>>;
3947
+ idempotencyKey?: string;
3948
+ resourceId?: string;
3949
+ }, config?: RequestConfig) => RequestBuilder<any>;
3384
3950
  };
3385
3951
  preview: {
3386
3952
  /** 按当前定价规则预估本次用量费用,不写入记录、不扣积分 */
3387
3953
  post: (body: {
3388
3954
  serviceType: string;
3955
+ chargeMethodKey?: string;
3389
3956
  metadata: Record<string, unknown>;
3390
3957
  freeQuotaOverride?: number;
3391
- }, config?: RequestConfig) => Promise<ApiResponse<any>>;
3958
+ }, config?: RequestConfig) => RequestBuilder<any>;
3392
3959
  };
3393
3960
  stats: {
3394
3961
  /** 获取用量统计数据 */
@@ -3396,18 +3963,257 @@ export interface ApiClient {
3396
3963
  startDate?: string;
3397
3964
  endDate?: string;
3398
3965
  serviceType?: string;
3966
+ userId?: string;
3399
3967
  groupBy?: "day" | "service" | "user";
3400
- }, config?: RequestConfig) => Promise<ApiResponse<any>>;
3968
+ }, config?: RequestConfig) => RequestBuilder<any>;
3401
3969
  };
3402
3970
  records: {
3403
3971
  /** 获取用量记录列表 */
3404
3972
  post: (body: {
3405
3973
  page?: number;
3406
3974
  pageSize?: number;
3407
- serviceType?: string;
3975
+ id?: string;
3976
+ idempotencyKey?: string;
3977
+ resourceId?: string;
3978
+ serviceKey?: string;
3979
+ chargeMethodKey?: string;
3980
+ userId?: string;
3408
3981
  startDate?: string;
3409
3982
  endDate?: string;
3410
- }, config?: RequestConfig) => Promise<ApiResponse<any>>;
3983
+ }, config?: RequestConfig) => RequestBuilder<any>;
3984
+ };
3985
+ };
3986
+ servicePricing: {
3987
+ overview: {
3988
+ post: (config?: RequestConfig) => RequestBuilder<any>;
3989
+ };
3990
+ list: {
3991
+ post: (body: {
3992
+ serviceKey?: string;
3993
+ }, config?: RequestConfig) => RequestBuilder<any>;
3994
+ };
3995
+ get: {
3996
+ post: (body: {
3997
+ serviceKey: string;
3998
+ chargeMethodKey: string;
3999
+ }, config?: RequestConfig) => RequestBuilder<any>;
4000
+ };
4001
+ upsert: {
4002
+ post: (body: {
4003
+ serviceKey: string;
4004
+ chargeMethodKey: string;
4005
+ originalPrice: number;
4006
+ sellPrice: number;
4007
+ enabled?: boolean;
4008
+ }, config?: RequestConfig) => RequestBuilder<any>;
4009
+ };
4010
+ importLegacy: {
4011
+ /** 幂等:将旧 pricingRule 导入 billingServicePricing */
4012
+ post: (config?: RequestConfig) => RequestBuilder<any>;
4013
+ };
4014
+ };
4015
+ priceList: {
4016
+ list: {
4017
+ post: (body: {
4018
+ serviceKey?: string;
4019
+ chargeMethodKey?: string;
4020
+ pricingType?: "flat" | "tiered" | "dimensions";
4021
+ enabled?: boolean;
4022
+ page?: number;
4023
+ pageSize?: number;
4024
+ }, config?: RequestConfig) => RequestBuilder<any>;
4025
+ };
4026
+ get: {
4027
+ post: (body: {
4028
+ id: string;
4029
+ }, config?: RequestConfig) => RequestBuilder<any>;
4030
+ };
4031
+ create: {
4032
+ post: (body: {
4033
+ serviceKey: string;
4034
+ chargeMethodKey: string;
4035
+ name: string;
4036
+ currency?: "CNY" | "USD";
4037
+ enabled?: boolean;
4038
+ pricing: {
4039
+ type: "flat";
4040
+ originalPrice: number;
4041
+ sellPrice: number;
4042
+ } | {
4043
+ type: "tiered";
4044
+ priceStructure: "flat" | "segmented";
4045
+ tiers: {
4046
+ tierKey?: string;
4047
+ tierRangeMode?: "at_most" | "at_least" | "between";
4048
+ minTokens?: number;
4049
+ maxTokens?: number;
4050
+ minInclusive?: boolean;
4051
+ maxInclusive?: boolean;
4052
+ originalFenPerUnit: number;
4053
+ sellFenPerUnit: number;
4054
+ billingEnabled: boolean;
4055
+ }[];
4056
+ } | {
4057
+ type: "dimensions";
4058
+ dimensions: {
4059
+ dimensionKey: string;
4060
+ unit: string;
4061
+ priceStructure?: "flat" | "segmented";
4062
+ tiers: {
4063
+ tierKey?: string;
4064
+ tierRangeMode?: "at_most" | "at_least" | "between";
4065
+ minTokens?: number;
4066
+ maxTokens?: number;
4067
+ minInclusive?: boolean;
4068
+ maxInclusive?: boolean;
4069
+ minOutputTokens?: number;
4070
+ maxOutputTokens?: number;
4071
+ originalFenPerUnit: number;
4072
+ sellFenPerUnit: number;
4073
+ billingEnabled: boolean;
4074
+ }[];
4075
+ }[];
4076
+ };
4077
+ }, config?: RequestConfig) => RequestBuilder<any>;
4078
+ };
4079
+ update: {
4080
+ post: (body: {
4081
+ id: string;
4082
+ name?: string;
4083
+ currency?: "CNY" | "USD";
4084
+ enabled?: boolean;
4085
+ pricing?: {
4086
+ type: "flat";
4087
+ originalPrice: number;
4088
+ sellPrice: number;
4089
+ } | {
4090
+ type: "tiered";
4091
+ priceStructure: "flat" | "segmented";
4092
+ tiers: {
4093
+ tierKey?: string;
4094
+ tierRangeMode?: "at_most" | "at_least" | "between";
4095
+ minTokens?: number;
4096
+ maxTokens?: number;
4097
+ minInclusive?: boolean;
4098
+ maxInclusive?: boolean;
4099
+ originalFenPerUnit: number;
4100
+ sellFenPerUnit: number;
4101
+ billingEnabled: boolean;
4102
+ }[];
4103
+ } | {
4104
+ type: "dimensions";
4105
+ dimensions: {
4106
+ dimensionKey: string;
4107
+ unit: string;
4108
+ priceStructure?: "flat" | "segmented";
4109
+ tiers: {
4110
+ tierKey?: string;
4111
+ tierRangeMode?: "at_most" | "at_least" | "between";
4112
+ minTokens?: number;
4113
+ maxTokens?: number;
4114
+ minInclusive?: boolean;
4115
+ maxInclusive?: boolean;
4116
+ minOutputTokens?: number;
4117
+ maxOutputTokens?: number;
4118
+ originalFenPerUnit: number;
4119
+ sellFenPerUnit: number;
4120
+ billingEnabled: boolean;
4121
+ }[];
4122
+ }[];
4123
+ };
4124
+ }, config?: RequestConfig) => RequestBuilder<any>;
4125
+ };
4126
+ delete: {
4127
+ post: (body: {
4128
+ id: string;
4129
+ }, config?: RequestConfig) => RequestBuilder<any>;
4130
+ };
4131
+ };
4132
+ priceBinding: {
4133
+ list: {
4134
+ post: (body: {
4135
+ subjectType?: "model-profile";
4136
+ subjectKey?: string;
4137
+ serviceKey?: string;
4138
+ enabled?: boolean;
4139
+ }, config?: RequestConfig) => RequestBuilder<any>;
4140
+ };
4141
+ upsert: {
4142
+ post: (body: {
4143
+ subjectType: "model-profile";
4144
+ subjectKey: string;
4145
+ priceListId: string;
4146
+ enabled?: boolean;
4147
+ }, config?: RequestConfig) => RequestBuilder<any>;
4148
+ };
4149
+ delete: {
4150
+ post: (body: {
4151
+ id: string;
4152
+ }, config?: RequestConfig) => RequestBuilder<any>;
4153
+ };
4154
+ };
4155
+ billingMethodDefinition: {
4156
+ list: {
4157
+ post: (body: {
4158
+ serviceKey?: string;
4159
+ page?: number;
4160
+ pageSize?: number;
4161
+ }, config?: RequestConfig) => RequestBuilder<any>;
4162
+ };
4163
+ get: {
4164
+ post: (body: {
4165
+ chargeMethodKey: string;
4166
+ }, config?: RequestConfig) => RequestBuilder<any>;
4167
+ };
4168
+ create: {
4169
+ post: (body: {
4170
+ serviceKey: string;
4171
+ chargeMethodKey: string;
4172
+ label: string;
4173
+ billingUnit: string;
4174
+ chargeKind: "instant" | "settlement";
4175
+ settlementPeriod?: "second" | "minute" | "hour" | "day" | "month";
4176
+ priceStructure?: "flat" | "segmented";
4177
+ tiers?: {
4178
+ tierKey?: string;
4179
+ tierRangeMode?: "at_most" | "at_least" | "between";
4180
+ minTokens?: number;
4181
+ maxTokens?: number;
4182
+ minInclusive?: boolean;
4183
+ maxInclusive?: boolean;
4184
+ originalFenPerUnit: number;
4185
+ sellFenPerUnit: number;
4186
+ billingEnabled: boolean;
4187
+ }[];
4188
+ enabled?: boolean;
4189
+ }, config?: RequestConfig) => RequestBuilder<any>;
4190
+ };
4191
+ update: {
4192
+ post: (body: {
4193
+ id: string;
4194
+ label?: string;
4195
+ billingUnit?: string;
4196
+ chargeKind?: "instant" | "settlement";
4197
+ settlementPeriod?: "second" | "minute" | "hour" | "day" | "month";
4198
+ priceStructure?: "flat" | "segmented";
4199
+ tiers?: {
4200
+ tierKey?: string;
4201
+ tierRangeMode?: "at_most" | "at_least" | "between";
4202
+ minTokens?: number;
4203
+ maxTokens?: number;
4204
+ minInclusive?: boolean;
4205
+ maxInclusive?: boolean;
4206
+ originalFenPerUnit: number;
4207
+ sellFenPerUnit: number;
4208
+ billingEnabled: boolean;
4209
+ }[];
4210
+ enabled?: boolean;
4211
+ }, config?: RequestConfig) => RequestBuilder<any>;
4212
+ };
4213
+ delete: {
4214
+ post: (body: {
4215
+ id: string;
4216
+ }, config?: RequestConfig) => RequestBuilder<any>;
3411
4217
  };
3412
4218
  };
3413
4219
  export: {
@@ -3417,7 +4223,7 @@ export interface ApiClient {
3417
4223
  startDate?: string;
3418
4224
  endDate?: string;
3419
4225
  status?: string;
3420
- }, config?: RequestConfig) => Promise<ApiResponse<any>>;
4226
+ }, config?: RequestConfig) => RequestBuilder<any>;
3421
4227
  };
3422
4228
  refund: {
3423
4229
  /** 导出退款记录为 CSV 格式 */
@@ -3425,7 +4231,7 @@ export interface ApiClient {
3425
4231
  startDate?: string;
3426
4232
  endDate?: string;
3427
4233
  status?: string;
3428
- }, config?: RequestConfig) => Promise<ApiResponse<any>>;
4234
+ }, config?: RequestConfig) => RequestBuilder<any>;
3429
4235
  };
3430
4236
  pointsHistory: {
3431
4237
  /** 导出积分变动记录为 CSV 格式 */
@@ -3434,7 +4240,7 @@ export interface ApiClient {
3434
4240
  endDate?: string;
3435
4241
  type?: string;
3436
4242
  userId?: string;
3437
- }, config?: RequestConfig) => Promise<ApiResponse<any>>;
4243
+ }, config?: RequestConfig) => RequestBuilder<any>;
3438
4244
  };
3439
4245
  };
3440
4246
  financeReport: {
@@ -3443,14 +4249,14 @@ export interface ApiClient {
3443
4249
  post: (body: {
3444
4250
  startDate?: string;
3445
4251
  endDate?: string;
3446
- }, config?: RequestConfig) => Promise<ApiResponse<any>>;
4252
+ }, config?: RequestConfig) => RequestBuilder<any>;
3447
4253
  };
3448
4254
  trend: {
3449
4255
  /** 获取收入趋势数据(按日/周/月) */
3450
4256
  post: (body: {
3451
4257
  period: "day" | "week" | "month";
3452
4258
  days?: number;
3453
- }, config?: RequestConfig) => Promise<ApiResponse<any>>;
4259
+ }, config?: RequestConfig) => RequestBuilder<any>;
3454
4260
  };
3455
4261
  packageRank: {
3456
4262
  /** 获取套餐销售排行数据 */
@@ -3458,7 +4264,7 @@ export interface ApiClient {
3458
4264
  startDate?: string;
3459
4265
  endDate?: string;
3460
4266
  limit?: number;
3461
- }, config?: RequestConfig) => Promise<ApiResponse<any>>;
4267
+ }, config?: RequestConfig) => RequestBuilder<any>;
3462
4268
  };
3463
4269
  userRank: {
3464
4270
  /** 获取用户充值排行数据 */
@@ -3466,7 +4272,7 @@ export interface ApiClient {
3466
4272
  startDate?: string;
3467
4273
  endDate?: string;
3468
4274
  limit?: number;
3469
- }, config?: RequestConfig) => Promise<ApiResponse<any>>;
4275
+ }, config?: RequestConfig) => RequestBuilder<any>;
3470
4276
  };
3471
4277
  };
3472
4278
  reconciliation: {
@@ -3474,7 +4280,7 @@ export interface ApiClient {
3474
4280
  /** 生成指定日期的对账报告 */
3475
4281
  post: (body: {
3476
4282
  date: string;
3477
- }, config?: RequestConfig) => Promise<ApiResponse<any>>;
4283
+ }, config?: RequestConfig) => RequestBuilder<any>;
3478
4284
  };
3479
4285
  list: {
3480
4286
  /** 查询对账报告列表 */
@@ -3484,13 +4290,13 @@ export interface ApiClient {
3484
4290
  status?: string;
3485
4291
  startDate?: string;
3486
4292
  endDate?: string;
3487
- }, config?: RequestConfig) => Promise<ApiResponse<any>>;
4293
+ }, config?: RequestConfig) => RequestBuilder<any>;
3488
4294
  };
3489
4295
  detail: {
3490
4296
  /** 查询对账报告详情 */
3491
4297
  post: (body: {
3492
4298
  id: string;
3493
- }, config?: RequestConfig) => Promise<ApiResponse<any>>;
4299
+ }, config?: RequestConfig) => RequestBuilder<any>;
3494
4300
  };
3495
4301
  processAnomaly: {
3496
4302
  /** 处理对账异常订单 */
@@ -3499,14 +4305,14 @@ export interface ApiClient {
3499
4305
  orderId: string;
3500
4306
  action: "confirm_paid" | "mark_cancelled" | "ignore";
3501
4307
  remark?: string;
3502
- }, config?: RequestConfig) => Promise<ApiResponse<any>>;
4308
+ }, config?: RequestConfig) => RequestBuilder<any>;
3503
4309
  };
3504
4310
  batchGenerate: {
3505
4311
  /** 批量生成指定日期范围的对账报告 */
3506
4312
  post: (body: {
3507
4313
  startDate: string;
3508
4314
  endDate: string;
3509
- }, config?: RequestConfig) => Promise<ApiResponse<any>>;
4315
+ }, config?: RequestConfig) => RequestBuilder<any>;
3510
4316
  };
3511
4317
  };
3512
4318
  invoice: {
@@ -3526,7 +4332,7 @@ export interface ApiClient {
3526
4332
  receiverAddress?: string;
3527
4333
  orderIds?: string[];
3528
4334
  remark?: string;
3529
- }, config?: RequestConfig) => Promise<ApiResponse<any>>;
4335
+ }, config?: RequestConfig) => RequestBuilder<any>;
3530
4336
  };
3531
4337
  list: {
3532
4338
  /** 查询发票申请列表 */
@@ -3537,13 +4343,13 @@ export interface ApiClient {
3537
4343
  userId?: string;
3538
4344
  startDate?: string;
3539
4345
  endDate?: string;
3540
- }, config?: RequestConfig) => Promise<ApiResponse<any>>;
4346
+ }, config?: RequestConfig) => RequestBuilder<any>;
3541
4347
  };
3542
4348
  detail: {
3543
4349
  /** 查询发票详情 */
3544
4350
  post: (body: {
3545
4351
  invoiceNo: string;
3546
- }, config?: RequestConfig) => Promise<ApiResponse<any>>;
4352
+ }, config?: RequestConfig) => RequestBuilder<any>;
3547
4353
  };
3548
4354
  review: {
3549
4355
  /** 审核发票申请(通过/拒绝) */
@@ -3551,7 +4357,7 @@ export interface ApiClient {
3551
4357
  invoiceNo: string;
3552
4358
  action: "approve" | "reject";
3553
4359
  remark?: string;
3554
- }, config?: RequestConfig) => Promise<ApiResponse<any>>;
4360
+ }, config?: RequestConfig) => RequestBuilder<any>;
3555
4361
  };
3556
4362
  issue: {
3557
4363
  /** 标记发票已开具 */
@@ -3560,20 +4366,20 @@ export interface ApiClient {
3560
4366
  invoiceCode?: string;
3561
4367
  invoiceNumber?: string;
3562
4368
  invoiceUrl?: string;
3563
- }, config?: RequestConfig) => Promise<ApiResponse<any>>;
4369
+ }, config?: RequestConfig) => RequestBuilder<any>;
3564
4370
  };
3565
4371
  stats: {
3566
4372
  /** 获取发票统计数据 */
3567
4373
  post: (body: {
3568
4374
  startDate?: string;
3569
4375
  endDate?: string;
3570
- }, config?: RequestConfig) => Promise<ApiResponse<any>>;
4376
+ }, config?: RequestConfig) => RequestBuilder<any>;
3571
4377
  };
3572
4378
  cancel: {
3573
4379
  /** 取消发票申请(仅待审核状态可取消) */
3574
4380
  post: (body: {
3575
4381
  invoiceNo: string;
3576
- }, config?: RequestConfig) => Promise<ApiResponse<any>>;
4382
+ }, config?: RequestConfig) => RequestBuilder<any>;
3577
4383
  };
3578
4384
  };
3579
4385
  agreement: {
@@ -3584,39 +4390,39 @@ export interface ApiClient {
3584
4390
  period: number;
3585
4391
  singleAmount: number;
3586
4392
  totalAmount?: number;
3587
- }, config?: RequestConfig) => Promise<ApiResponse<any>>;
4393
+ }, config?: RequestConfig) => RequestBuilder<any>;
3588
4394
  };
3589
4395
  query: {
3590
4396
  /** 查询签约状态 */
3591
4397
  post: (body: {
3592
4398
  externalAgreementNo?: string;
3593
- }, config?: RequestConfig) => Promise<ApiResponse<any>>;
4399
+ }, config?: RequestConfig) => RequestBuilder<any>;
3594
4400
  };
3595
4401
  my: {
3596
4402
  /** 获取当前用户的签约信息 */
3597
- post: (config?: RequestConfig) => Promise<ApiResponse<any>>;
4403
+ post: (config?: RequestConfig) => RequestBuilder<any>;
3598
4404
  };
3599
4405
  unsign: {
3600
4406
  /** 解除签约授权 */
3601
- post: (config?: RequestConfig) => Promise<ApiResponse<any>>;
4407
+ post: (config?: RequestConfig) => RequestBuilder<any>;
3602
4408
  };
3603
4409
  history: {
3604
4410
  /** 查询签约历史记录 */
3605
4411
  post: (body: {
3606
4412
  page?: number;
3607
4413
  pageSize?: number;
3608
- }, config?: RequestConfig) => Promise<ApiResponse<any>>;
4414
+ }, config?: RequestConfig) => RequestBuilder<any>;
3609
4415
  };
3610
4416
  deductLogs: {
3611
4417
  /** 查询代扣扣款记录 */
3612
4418
  post: (body: {
3613
4419
  page?: number;
3614
4420
  pageSize?: number;
3615
- }, config?: RequestConfig) => Promise<ApiResponse<any>>;
4421
+ }, config?: RequestConfig) => RequestBuilder<any>;
3616
4422
  };
3617
4423
  signNotify: {
3618
4424
  /** 支付宝签约异步通知回调 */
3619
- post: (config?: RequestConfig) => Promise<ApiResponse<any>>;
4425
+ post: (config?: RequestConfig) => RequestBuilder<any>;
3620
4426
  };
3621
4427
  };
3622
4428
  internal: {
@@ -3628,7 +4434,7 @@ export interface ApiClient {
3628
4434
  userId: string;
3629
4435
  event: string;
3630
4436
  eventData?: Record<string, unknown>;
3631
- }, config?: RequestConfig) => Promise<ApiResponse<any>>;
4437
+ }, config?: RequestConfig) => RequestBuilder<any>;
3632
4438
  };
3633
4439
  };
3634
4440
  usage: {
@@ -3637,10 +4443,11 @@ export interface ApiClient {
3637
4443
  post: (body: {
3638
4444
  appId: string;
3639
4445
  userId: string;
3640
- serviceType: string;
4446
+ serviceKey: string;
4447
+ chargeMethodKey: string;
3641
4448
  amount: number;
3642
4449
  freeQuotaOverride?: number;
3643
- }, config?: RequestConfig) => Promise<ApiResponse<any>>;
4450
+ }, config?: RequestConfig) => RequestBuilder<any>;
3644
4451
  };
3645
4452
  previewBatch: {
3646
4453
  /** 供内部服务批量预估通用计费用量,不写入记录、不扣积分 */
@@ -3649,41 +4456,165 @@ export interface ApiClient {
3649
4456
  items: {
3650
4457
  key: string;
3651
4458
  userId: string;
3652
- serviceType: string;
4459
+ serviceKey: string;
4460
+ chargeMethodKey: string;
3653
4461
  amount: number;
3654
4462
  freeQuotaOverride?: number;
3655
4463
  }[];
3656
- }, config?: RequestConfig) => Promise<ApiResponse<any>>;
4464
+ }, config?: RequestConfig) => RequestBuilder<any>;
3657
4465
  };
3658
4466
  report: {
3659
4467
  /** 供内部服务上报通用计费用量并扣积分 */
3660
4468
  post: (body: {
3661
4469
  appId: string;
3662
4470
  userId: string;
3663
- serviceType: string;
4471
+ serviceKey: string;
4472
+ chargeMethodKey: string;
3664
4473
  amount: number;
3665
4474
  metadata?: Record<string, unknown>;
3666
- requestId?: string;
4475
+ idempotencyKey?: string;
4476
+ resourceId?: string;
3667
4477
  usageKind?: "event" | "continuous_settlement";
3668
4478
  periodStart?: string;
3669
4479
  periodEnd?: string;
3670
4480
  freeQuotaOverride?: number;
3671
- }, config?: RequestConfig) => Promise<ApiResponse<any>>;
4481
+ }, config?: RequestConfig) => RequestBuilder<any>;
4482
+ };
4483
+ reversal: {
4484
+ /** 供内部服务冲正已上报的服务用量并退还积分 */
4485
+ post: (body: {
4486
+ appId: string;
4487
+ userId: string;
4488
+ idempotencyKey: string;
4489
+ reason?: string;
4490
+ reversalIdempotencyKey?: string;
4491
+ }, config?: RequestConfig) => RequestBuilder<any>;
4492
+ };
4493
+ 'record-ai': {
4494
+ /** 供 ai-server 计价后写入统一用量账本并扣积分 */
4495
+ post: (body: {
4496
+ appId: string;
4497
+ userId: string;
4498
+ idempotencyKey: string;
4499
+ serviceKey: string;
4500
+ chargeMethodKey: string;
4501
+ resourceId?: string;
4502
+ subjectKey: string;
4503
+ labels?: Record<string, string>;
4504
+ pointsConsumed: number;
4505
+ quantity?: number;
4506
+ unit?: string;
4507
+ snapshot?: {
4508
+ priceListId?: string;
4509
+ usage?: Record<string, number>;
4510
+ cost?: Record<string, unknown>;
4511
+ };
4512
+ }, config?: RequestConfig) => RequestBuilder<any>;
4513
+ };
4514
+ list: {
4515
+ /** 供 ai-server 等内部服务查询 billingUsageRecord */
4516
+ post: (body: {
4517
+ appId: string;
4518
+ userId?: string;
4519
+ serviceGroup?: "ai" | "platform" | "storage";
4520
+ serviceGroups?: "ai" | "platform" | "storage"[];
4521
+ referenceId?: string;
4522
+ serviceKey?: string;
4523
+ chargeMethodKey?: string;
4524
+ model?: string;
4525
+ subjectKeys?: string[];
4526
+ id?: string;
4527
+ requestId?: string;
4528
+ startTime?: string;
4529
+ endTime?: string;
4530
+ page?: number;
4531
+ pageSize?: number;
4532
+ }, config?: RequestConfig) => RequestBuilder<any>;
4533
+ };
4534
+ 'stats-ai': {
4535
+ /** 供 ai-server 查询 AI 用量聚合统计 */
4536
+ post: (body: {
4537
+ appId: string;
4538
+ userId?: string;
4539
+ subjectKeys?: string[];
4540
+ startTime?: string;
4541
+ endTime?: string;
4542
+ timezone?: string;
4543
+ }, config?: RequestConfig) => RequestBuilder<any>;
4544
+ };
4545
+ 'by-reference': {
4546
+ /** 按 referenceId 联合查询用量与积分流水 */
4547
+ post: (body: {
4548
+ appId: string;
4549
+ referenceId: string;
4550
+ serviceKey?: string;
4551
+ }, config?: RequestConfig) => RequestBuilder<any>;
4552
+ };
4553
+ };
4554
+ pricing: {
4555
+ 'resolve-model': {
4556
+ /** 供 ai-server 运行时读取模型定价 */
4557
+ post: (body: {
4558
+ appId: string;
4559
+ supplierId: string;
4560
+ profileId: string;
4561
+ productLine?: string;
4562
+ billingPlan?: string;
4563
+ }, config?: RequestConfig) => RequestBuilder<any>;
4564
+ };
4565
+ 'sync-model': {
4566
+ post: (body: {
4567
+ appId: string;
4568
+ operatorId: string;
4569
+ supplierId: string;
4570
+ profileId: string;
4571
+ productLine: string;
4572
+ currency: "CNY" | "USD";
4573
+ plans: unknown[];
4574
+ }, config?: RequestConfig) => RequestBuilder<any>;
4575
+ };
4576
+ 'delete-model': {
4577
+ post: (body: {
4578
+ appId: string;
4579
+ supplierId: string;
4580
+ profileId: string;
4581
+ }, config?: RequestConfig) => RequestBuilder<any>;
4582
+ };
4583
+ 'load-model-plans': {
4584
+ post: (body: {
4585
+ appId: string;
4586
+ supplierId: string;
4587
+ profileId: string;
4588
+ }, config?: RequestConfig) => RequestBuilder<any>;
4589
+ };
4590
+ 'list-model-pricing-map': {
4591
+ post: (body: {
4592
+ appId: string;
4593
+ }, config?: RequestConfig) => RequestBuilder<any>;
4594
+ };
4595
+ };
4596
+ points: {
4597
+ 'by-request-ids': {
4598
+ /** 供 ai-server 溯源:通过 requestId 列表查询 pointsHistory */
4599
+ post: (body: {
4600
+ appId: string;
4601
+ requestIds: string[];
4602
+ }, config?: RequestConfig) => RequestBuilder<any>;
3672
4603
  };
3673
4604
  };
3674
4605
  };
3675
4606
  webhooks: {
3676
4607
  events: {
3677
4608
  /** 获取所有可用的 Webhook 事件类型 */
3678
- get: (config?: RequestConfig) => Promise<ApiResponse<any>>;
4609
+ get: (config?: RequestConfig) => RequestBuilder<any>;
3679
4610
  ':id': {
3680
4611
  /** 获取指定分类的 Webhook 事件 */
3681
- get: (config?: RequestConfig) => Promise<ApiResponse<any>>;
4612
+ get: (config?: RequestConfig) => RequestBuilder<any>;
3682
4613
  };
3683
4614
  };
3684
4615
  categories: {
3685
4616
  /** 获取所有 Webhook 事件分类 */
3686
- get: (config?: RequestConfig) => Promise<ApiResponse<any>>;
4617
+ get: (config?: RequestConfig) => RequestBuilder<any>;
3687
4618
  };
3688
4619
  };
3689
4620
  }