@huyooo/ui 0.7.24 → 0.8.0

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 (85) hide show
  1. package/dist/{AuthkitAuthModal-DcZ69VKT.js → AuthkitAuthModal-CX6-EB-D.js} +563 -628
  2. package/dist/{AuthkitSignInPhone-CJLeElZ1.js → AuthkitSignInPhone-D3hR0dGZ.js} +100 -100
  3. package/dist/{Clipboard-BVSUEtX_.js → Clipboard-CI4IUrMw.js} +13 -14
  4. package/dist/{Contact-DWQjd6yu.js → Contact-mQa-gB4k.js} +3 -3
  5. package/dist/{CustomTable-BCOwLyRJ.js → CustomTable-D8ubfrWL.js} +2 -2
  6. package/dist/{FeedbackItem-qppn-rOs.js → FeedbackItem-qaxaQ8gu.js} +4 -4
  7. package/dist/{FeedbackModal-28L6QJaB.js → FeedbackModal-CUSOWVn5.js} +268 -303
  8. package/dist/{LandingPageSectionTabs-DYNXKElT.js → LandingPageSectionTabs-BOX6nVdh.js} +2 -2
  9. package/dist/MessageHandle-WcCeYl7E.js +1147 -0
  10. package/dist/{MessageNoticeNotificationsDetails.vue_vue_type_script_setup_true_lang-DHO6VGx-.js → MessageNoticeNotificationsDetails.vue_vue_type_script_setup_true_lang-BwZM2SQn.js} +38 -37
  11. package/dist/{PaySubscriptions-BqtXFPHR.js → PaySubscriptions-DO2W3Y5v.js} +131 -171
  12. package/dist/ReferrerReferees-CXVi2pUl.js +106 -0
  13. package/dist/{Upload.vue_vue_type_script_setup_true_lang-D2gY_z-p.js → Upload.vue_vue_type_script_setup_true_lang-CY_Pk57x.js} +2 -2
  14. package/dist/{UserAccountMenu--fY2QkYw.js → UserAccountMenu-CHkdka0u.js} +8 -8
  15. package/dist/{WidthContainer-DMJSBs_q.js → WidthContainer-BBoIS50Z.js} +10 -10
  16. package/dist/apiClients-CChPISR0.js +1805 -0
  17. package/dist/authkit.js +6 -6
  18. package/dist/common/globalConfig.d.ts +2 -2
  19. package/dist/common.js +2 -2
  20. package/dist/components/Authkit/Auth/AuthkitAuthContainer.vue.d.ts +1 -1
  21. package/dist/components/Authkit/Auth/AuthkitAuthorize.vue.d.ts +1 -1
  22. package/dist/components/LandingPage/LandingPageLogo.vue.d.ts +1 -1
  23. package/dist/components/LandingPage/LandingPageStats.vue.d.ts +1 -1
  24. package/dist/components/Logo.vue.d.ts +1 -1
  25. package/dist/components/MenuItem.vue.d.ts +1 -1
  26. package/dist/components/Message/MessageTabs.vue.d.ts +2 -2
  27. package/dist/components/Upload/Upload.vue.d.ts +2 -2
  28. package/dist/components/User/UserBasicInformation.vue.d.ts +1 -1
  29. package/dist/components/User/UserPanel.vue.d.ts +2 -2
  30. package/dist/composables/Authkit/useAuthkitAuth.d.ts +1 -1
  31. package/dist/composables.js +9 -9
  32. package/dist/feedback.js +3 -3
  33. package/dist/{index-Bb-d5pBq.js → index-4_tj9bS1.js} +1 -1
  34. package/dist/index-96pA3ONI.js +30 -0
  35. package/dist/index.js +191 -189
  36. package/dist/landingPage.js +1 -1
  37. package/dist/main.d.ts +1 -1
  38. package/dist/message.js +3 -3
  39. package/dist/pay.js +1 -1
  40. package/dist/privateCom.js +1 -1
  41. package/dist/referrer.js +1 -1
  42. package/dist/style.css +1 -1
  43. package/dist/types/api/auth.generated.d.ts +2747 -0
  44. package/dist/types/api/billing.generated.d.ts +1964 -0
  45. package/dist/types/api/ones.generated.d.ts +5567 -0
  46. package/dist/upload.js +2 -2
  47. package/dist/{useAuthkitAppsAuthPageInfo-Bu-Q-44G.js → useAuthkitAppsAuthPageInfo-gn2zm_NY.js} +13 -27
  48. package/dist/{useAuthkitCreateAndUpdate-DHGgpk14.js → useAuthkitCreateAndUpdate-yNpIyVXV.js} +2 -2
  49. package/dist/useAuthkitUsersProfile-D32zPSn2.js +174 -0
  50. package/dist/{useDownloads-jzTsK6S6.js → useDownloads-MF9rK9J_.js} +2 -2
  51. package/dist/useMessageNotifications-CCfM6W6J.js +78 -0
  52. package/dist/{useSEO-Curqg3Re.js → useSEO-DivOwPWc.js} +2 -2
  53. package/dist/{useTableHandle-MuavycJ7.js → useTableHandle-DpemWl6Y.js} +2 -2
  54. package/dist/{useUploadCos-C4mpMNhT.js → useUploadCos-BVvRc0BW.js} +159 -181
  55. package/dist/user.js +1 -1
  56. package/dist/utils/apiClients.d.ts +6 -0
  57. package/dist/utils/apiMiddlewares.d.ts +16 -0
  58. package/package.json +8 -3
  59. package/dist/MessageHandle-DaczDI82.js +0 -1207
  60. package/dist/MessageNotifications-IluYhczu.js +0 -35
  61. package/dist/ReferrerReferees-D6CNoqs4.js +0 -113
  62. package/dist/_commonjsHelpers-DaMA6jEr.js +0 -8
  63. package/dist/api/Authkit/Users.d.ts +0 -15
  64. package/dist/api/Authkit/apps.d.ts +0 -2
  65. package/dist/api/Authkit/auth.d.ts +0 -50
  66. package/dist/api/Authkit/oauth.d.ts +0 -12
  67. package/dist/api/Authkit/verify.d.ts +0 -25
  68. package/dist/api/Buckets/Files.d.ts +0 -7
  69. package/dist/api/Buckets.d.ts +0 -2
  70. package/dist/api/Invoices.d.ts +0 -32
  71. package/dist/api/Message/ChangelogNotifications.d.ts +0 -17
  72. package/dist/api/Message/EventNotifications.d.ts +0 -16
  73. package/dist/api/Message/MessageNotifications.d.ts +0 -25
  74. package/dist/api/Message/NoticeNotifications.d.ts +0 -37
  75. package/dist/api/Messages.d.ts +0 -2
  76. package/dist/api/Orders.d.ts +0 -9
  77. package/dist/api/Products.d.ts +0 -20
  78. package/dist/api/Quotas.d.ts +0 -21
  79. package/dist/api/Referrer.d.ts +0 -1
  80. package/dist/api/Subscriptions.d.ts +0 -35
  81. package/dist/api/index.d.ts +0 -8
  82. package/dist/request-BkNyIDws.js +0 -196
  83. package/dist/useAuthkitUsersProfile-D58I5n2T.js +0 -257
  84. package/dist/useMessageNotifications-CLowHpNV.js +0 -78
  85. package/dist/utils/request.d.ts +0 -26
@@ -0,0 +1,1964 @@
1
+ import { ApiResponse, RequestConfig, Client, EdenClient } from '@vafast/api-client';
2
+ /** API 契约类型 */
3
+ export type Api = {
4
+ health: {
5
+ get: {
6
+ return: any;
7
+ };
8
+ };
9
+ 'api-spec': {
10
+ /** 获取 API 规范,用于类型同步 */
11
+ get: {
12
+ return: any;
13
+ };
14
+ };
15
+ products: {
16
+ create: {
17
+ /** 创建新产品 */
18
+ post: {
19
+ body: {
20
+ name: string;
21
+ description?: string;
22
+ features: {
23
+ key: string;
24
+ name: string;
25
+ description?: string;
26
+ type: "boolean" | "quota" | "unlimited";
27
+ value?: boolean | number;
28
+ highlight?: boolean;
29
+ }[];
30
+ metadata?: Record<string, unknown>;
31
+ displayOrder?: number;
32
+ };
33
+ return: any;
34
+ };
35
+ };
36
+ delete: {
37
+ /** 删除产品 */
38
+ post: {
39
+ body: {
40
+ id: string;
41
+ };
42
+ return: any;
43
+ };
44
+ };
45
+ update: {
46
+ /** 更新产品信息 */
47
+ post: {
48
+ body: {
49
+ id: string;
50
+ name?: string;
51
+ description?: string;
52
+ features?: {
53
+ key: string;
54
+ name: string;
55
+ description?: string;
56
+ type: "boolean" | "quota" | "unlimited";
57
+ value?: boolean | number;
58
+ highlight?: boolean;
59
+ }[];
60
+ status?: "active" | "archived";
61
+ metadata?: Record<string, unknown>;
62
+ displayOrder?: number;
63
+ };
64
+ return: any;
65
+ };
66
+ };
67
+ find: {
68
+ /** 分页查询产品列表 */
69
+ post: {
70
+ body: {
71
+ current: number;
72
+ pageSize: number;
73
+ where: {
74
+ name?: string;
75
+ status?: "" | "active" | "archived";
76
+ };
77
+ };
78
+ return: any;
79
+ };
80
+ };
81
+ findOne: {
82
+ /** 根据 ID 查询产品详情 */
83
+ post: {
84
+ body: {
85
+ id: string;
86
+ };
87
+ return: any;
88
+ };
89
+ };
90
+ listActive: {
91
+ /** 获取定价页面可用产品列表(公开) */
92
+ post: {
93
+ return: any;
94
+ };
95
+ };
96
+ };
97
+ prices: {
98
+ create: {
99
+ /** 创建新价格方案 */
100
+ post: {
101
+ body: {
102
+ productId: string;
103
+ nickname?: string;
104
+ type: "one_time" | "recurring";
105
+ currency: string;
106
+ unitAmount: number;
107
+ interval?: "day" | "week" | "month" | "year";
108
+ intervalCount?: number;
109
+ trialPeriodDays?: number;
110
+ metadata?: Record<string, unknown>;
111
+ };
112
+ return: any;
113
+ };
114
+ };
115
+ delete: {
116
+ /** 删除价格方案 */
117
+ post: {
118
+ body: {
119
+ id: string;
120
+ };
121
+ return: any;
122
+ };
123
+ };
124
+ update: {
125
+ /** 更新价格方案信息 */
126
+ post: {
127
+ body: {
128
+ id: string;
129
+ nickname?: string;
130
+ active?: boolean;
131
+ trialPeriodDays?: number;
132
+ metadata?: Record<string, unknown>;
133
+ };
134
+ return: any;
135
+ };
136
+ };
137
+ find: {
138
+ /** 分页查询价格方案列表 */
139
+ post: {
140
+ body: {
141
+ current: number;
142
+ pageSize: number;
143
+ where: {
144
+ productId?: string;
145
+ type?: "" | "one_time" | "recurring";
146
+ active?: boolean;
147
+ };
148
+ };
149
+ return: any;
150
+ };
151
+ };
152
+ findOne: {
153
+ /** 根据 ID 查询价格方案详情 */
154
+ post: {
155
+ body: {
156
+ id: string;
157
+ };
158
+ return: any;
159
+ };
160
+ };
161
+ listByProduct: {
162
+ /** 获取指定产品的所有可用价格方案 */
163
+ post: {
164
+ body: {
165
+ productId: string;
166
+ };
167
+ return: any;
168
+ };
169
+ };
170
+ };
171
+ subscriptions: {
172
+ create: {
173
+ /** 创建新订阅并发起支付 */
174
+ post: {
175
+ body: {
176
+ priceId: string;
177
+ couponCode?: string;
178
+ };
179
+ return: any;
180
+ };
181
+ };
182
+ cancel: {
183
+ /** 取消订阅 */
184
+ post: {
185
+ body: {
186
+ subscriptionId: string;
187
+ cancelAtPeriodEnd?: boolean;
188
+ reason?: string;
189
+ };
190
+ return: any;
191
+ };
192
+ };
193
+ resume: {
194
+ /** 恢复已取消的订阅 */
195
+ post: {
196
+ body: {
197
+ subscriptionId: string;
198
+ };
199
+ return: any;
200
+ };
201
+ };
202
+ change: {
203
+ /** 升级或降级订阅 */
204
+ post: {
205
+ body: {
206
+ subscriptionId: string;
207
+ newPriceId: string;
208
+ proration?: boolean;
209
+ };
210
+ return: any;
211
+ };
212
+ };
213
+ my: {
214
+ /** 查询当前用户的订阅列表 */
215
+ post: {
216
+ body: {
217
+ current?: number;
218
+ pageSize?: number;
219
+ status?: string;
220
+ };
221
+ return: any;
222
+ };
223
+ };
224
+ current: {
225
+ /** 获取当前活跃订阅 */
226
+ post: {
227
+ return: any;
228
+ };
229
+ };
230
+ find: {
231
+ /** 分页查询订阅列表(管理端) */
232
+ post: {
233
+ body: {
234
+ current: number;
235
+ pageSize: number;
236
+ where: {
237
+ userId?: string;
238
+ productId?: string;
239
+ status?: string;
240
+ };
241
+ };
242
+ return: any;
243
+ };
244
+ };
245
+ };
246
+ quotas: {
247
+ create: {
248
+ /** 创建配额定义 */
249
+ post: {
250
+ body: {
251
+ productId: string;
252
+ featureKey: string;
253
+ name: string;
254
+ description?: string;
255
+ limit: number;
256
+ allowOverage?: boolean;
257
+ pointsCostPerUnit?: number;
258
+ period: "day" | "week" | "month" | "year" | "lifetime";
259
+ metadata?: Record<string, unknown>;
260
+ };
261
+ return: any;
262
+ };
263
+ };
264
+ delete: {
265
+ /** 删除配额定义 */
266
+ post: {
267
+ body: {
268
+ id: string;
269
+ };
270
+ return: any;
271
+ };
272
+ };
273
+ update: {
274
+ /** 更新配额定义 */
275
+ post: {
276
+ body: {
277
+ id: string;
278
+ name?: string;
279
+ description?: string;
280
+ limit?: number;
281
+ period?: "day" | "week" | "month" | "year" | "lifetime";
282
+ allowOverage?: boolean;
283
+ pointsCostPerUnit?: number;
284
+ metadata?: Record<string, unknown>;
285
+ };
286
+ return: any;
287
+ };
288
+ };
289
+ find: {
290
+ /** 分页查询配额列表 */
291
+ post: {
292
+ body: {
293
+ current: number;
294
+ pageSize: number;
295
+ where: {
296
+ productId?: string;
297
+ featureKey?: string;
298
+ };
299
+ };
300
+ return: any;
301
+ };
302
+ };
303
+ check: {
304
+ /** 检查用户配额是否足够 */
305
+ post: {
306
+ body: {
307
+ featureKey: string;
308
+ amount?: number;
309
+ };
310
+ return: any;
311
+ };
312
+ };
313
+ my: {
314
+ /** 获取当前用户的配额使用情况 */
315
+ post: {
316
+ return: any;
317
+ };
318
+ };
319
+ };
320
+ usageRecords: {
321
+ record: {
322
+ /** 记录用户功能使用量 */
323
+ post: {
324
+ body: {
325
+ userId?: string;
326
+ featureKey: string;
327
+ quantity?: number;
328
+ metadata?: Record<string, unknown>;
329
+ };
330
+ return: any;
331
+ };
332
+ };
333
+ recordWithQuotaCheck: {
334
+ /** 记录使用量并检查配额,支持超额积分扣费 */
335
+ post: {
336
+ body: {
337
+ userId?: string;
338
+ featureKey: string;
339
+ quantity?: number;
340
+ metadata?: Record<string, unknown>;
341
+ };
342
+ return: any;
343
+ };
344
+ };
345
+ checkQuota: {
346
+ /** 预检查配额是否足够(不记录使用量) */
347
+ post: {
348
+ body: {
349
+ userId?: string;
350
+ featureKey: string;
351
+ quantity?: number;
352
+ };
353
+ return: any;
354
+ };
355
+ };
356
+ batchRecord: {
357
+ /** 批量记录使用量 */
358
+ post: {
359
+ body: {
360
+ records: {
361
+ userId: string;
362
+ featureKey: string;
363
+ quantity?: number;
364
+ metadata?: Record<string, unknown>;
365
+ timestamp?: string;
366
+ }[];
367
+ };
368
+ return: any;
369
+ };
370
+ };
371
+ find: {
372
+ /** 分页查询使用记录(管理端) */
373
+ post: {
374
+ body: {
375
+ current: number;
376
+ pageSize: number;
377
+ where: {
378
+ userId?: string;
379
+ featureKey?: string;
380
+ startTime?: string;
381
+ endTime?: string;
382
+ };
383
+ };
384
+ return: any;
385
+ };
386
+ };
387
+ my: {
388
+ /** 查询当前用户的使用记录 */
389
+ post: {
390
+ body: {
391
+ current?: number;
392
+ pageSize?: number;
393
+ featureKey?: string;
394
+ startTime?: string;
395
+ endTime?: string;
396
+ };
397
+ return: any;
398
+ };
399
+ };
400
+ statistics: {
401
+ /** 获取使用量统计数据 */
402
+ post: {
403
+ body: {
404
+ userId?: string;
405
+ featureKey?: string;
406
+ startTime: string;
407
+ endTime: string;
408
+ granularity: "hour" | "day" | "week" | "month";
409
+ };
410
+ return: any;
411
+ };
412
+ };
413
+ getTrendChart: {
414
+ /** 获取使用量趋势图表数据 */
415
+ post: {
416
+ body: {
417
+ featureKey?: string;
418
+ startTime: string;
419
+ endTime: string;
420
+ granularity: "hour" | "day" | "week" | "month";
421
+ };
422
+ return: any;
423
+ };
424
+ };
425
+ };
426
+ invoices: {
427
+ find: {
428
+ /** 分页查询发票列表(管理端) */
429
+ post: {
430
+ body: {
431
+ current: number;
432
+ pageSize: number;
433
+ where: {
434
+ userId?: string;
435
+ subscriptionId?: string;
436
+ status?: string;
437
+ startTime?: string;
438
+ endTime?: string;
439
+ };
440
+ };
441
+ return: any;
442
+ };
443
+ };
444
+ findOne: {
445
+ /** 根据 ID 查询发票详情 */
446
+ post: {
447
+ body: {
448
+ id: string;
449
+ };
450
+ return: any;
451
+ };
452
+ };
453
+ my: {
454
+ /** 查询当前用户的发票列表 */
455
+ post: {
456
+ body: {
457
+ current?: number;
458
+ pageSize?: number;
459
+ status?: string;
460
+ };
461
+ return: any;
462
+ };
463
+ };
464
+ void: {
465
+ /** 作废发票 */
466
+ post: {
467
+ body: {
468
+ id: string;
469
+ reason?: string;
470
+ };
471
+ return: any;
472
+ };
473
+ };
474
+ statistics: {
475
+ /** 获取发票统计数据 */
476
+ post: {
477
+ body: {
478
+ startTime?: string;
479
+ endTime?: string;
480
+ };
481
+ return: any;
482
+ };
483
+ };
484
+ revenueReport: {
485
+ /** 获取收入报表数据 */
486
+ post: {
487
+ body: {
488
+ startTime: string;
489
+ endTime: string;
490
+ granularity: "day" | "week" | "month" | "year";
491
+ };
492
+ return: any;
493
+ };
494
+ };
495
+ };
496
+ points: {
497
+ account: {
498
+ /** 查询用户积分账户余额 */
499
+ post: {
500
+ body: {
501
+ userId?: string;
502
+ };
503
+ return: any;
504
+ };
505
+ };
506
+ earn: {
507
+ /** 发放积分(充值、奖励等) */
508
+ post: {
509
+ body: {
510
+ userId: string;
511
+ amount: number;
512
+ subType: "recharge" | "referral" | "signup" | "subscription" | "activity" | "bonus";
513
+ requestId?: string;
514
+ description: string;
515
+ orderId?: string;
516
+ referrerId?: string;
517
+ ruleId?: string;
518
+ metadata?: Record<string, unknown>;
519
+ };
520
+ return: any;
521
+ };
522
+ };
523
+ consumeByPrice: {
524
+ /** 根据计价配置消费积分 */
525
+ post: {
526
+ body: {
527
+ userId: string;
528
+ priceCode: string;
529
+ quantity?: number;
530
+ requestId?: string;
531
+ description?: string;
532
+ metadata?: Record<string, unknown>;
533
+ };
534
+ return: any;
535
+ };
536
+ };
537
+ checkBalance: {
538
+ /** 检查积分是否足够(不扣费) */
539
+ post: {
540
+ body: {
541
+ userId: string;
542
+ priceCode: string;
543
+ quantity?: number;
544
+ };
545
+ return: any;
546
+ };
547
+ };
548
+ reversal: {
549
+ /** 冲正/退还已消费的积分 */
550
+ post: {
551
+ body: {
552
+ userId: string;
553
+ originalTransactionId: string;
554
+ requestId?: string;
555
+ reason: string;
556
+ };
557
+ return: any;
558
+ };
559
+ };
560
+ clawback: {
561
+ /** 追回/扣回已发放的积分 */
562
+ post: {
563
+ body: {
564
+ userId: string;
565
+ originalTransactionId: string;
566
+ requestId?: string;
567
+ reason: string;
568
+ };
569
+ return: any;
570
+ };
571
+ };
572
+ adjust: {
573
+ /** 人工调整积分(加/减) */
574
+ post: {
575
+ body: {
576
+ userId: string;
577
+ amount: number;
578
+ requestId?: string;
579
+ reason: string;
580
+ relatedOrderId?: string;
581
+ };
582
+ return: any;
583
+ };
584
+ };
585
+ batchAdjust: {
586
+ /** 批量调整多用户积分 */
587
+ post: {
588
+ body: {
589
+ userIds: string[];
590
+ amount: number;
591
+ requestId?: string;
592
+ reason: string;
593
+ };
594
+ return: any;
595
+ };
596
+ };
597
+ statistics: {
598
+ /** 获取用户积分统计数据 */
599
+ post: {
600
+ body: {
601
+ userId?: string;
602
+ };
603
+ return: any;
604
+ };
605
+ };
606
+ leaderboard: {
607
+ /** 获取积分排行榜 */
608
+ post: {
609
+ body: {
610
+ limit?: number;
611
+ };
612
+ return: any;
613
+ };
614
+ };
615
+ };
616
+ pointsHistory: {
617
+ find: {
618
+ /** 分页查询积分变动历史 */
619
+ post: {
620
+ body: {
621
+ userId?: string;
622
+ type?: "earn" | "spend" | "reversal" | "clawback" | "adjust";
623
+ subType?: string;
624
+ page?: number;
625
+ pageSize?: number;
626
+ startDate?: string;
627
+ endDate?: string;
628
+ };
629
+ return: any;
630
+ };
631
+ };
632
+ findOne: {
633
+ /** 根据 ID 查询积分历史详情 */
634
+ post: {
635
+ body: {
636
+ id: string;
637
+ };
638
+ return: any;
639
+ };
640
+ };
641
+ statistics: {
642
+ /** 获取积分统计数据 */
643
+ post: {
644
+ body: {
645
+ userId?: string;
646
+ period?: "day" | "week" | "month" | "year";
647
+ };
648
+ return: any;
649
+ };
650
+ };
651
+ getTrendChart: {
652
+ /** 获取积分变动趋势图表数据 */
653
+ post: {
654
+ body: {
655
+ userId?: string;
656
+ startTime: string;
657
+ endTime: string;
658
+ granularity: "minute" | "hour" | "day" | "month" | "year";
659
+ };
660
+ return: any;
661
+ };
662
+ };
663
+ getTypeDistributionChart: {
664
+ /** 获取积分类型分布图表数据 */
665
+ post: {
666
+ body: {
667
+ userId?: string;
668
+ startTime?: string;
669
+ endTime?: string;
670
+ };
671
+ return: any;
672
+ };
673
+ };
674
+ getRankingChart: {
675
+ /** 获取用户积分排行榜 */
676
+ post: {
677
+ body: {
678
+ type?: "earn" | "spend" | "reversal" | "clawback" | "adjust";
679
+ startTime?: string;
680
+ endTime?: string;
681
+ limit?: number;
682
+ };
683
+ return: any;
684
+ };
685
+ };
686
+ };
687
+ pointsTrigger: {
688
+ trigger: {
689
+ /** 根据规则 ID 触发积分发放 */
690
+ post: {
691
+ body: {
692
+ ruleId: string;
693
+ eventData?: Record<string, unknown>;
694
+ };
695
+ return: any;
696
+ };
697
+ };
698
+ triggerByEvent: {
699
+ /** 根据事件自动匹配并触发积分规则 */
700
+ post: {
701
+ body: {
702
+ event: string;
703
+ eventData?: Record<string, unknown>;
704
+ userId?: string;
705
+ };
706
+ return: any;
707
+ };
708
+ };
709
+ batchTrigger: {
710
+ /** 批量触发多个积分规则 */
711
+ post: {
712
+ body: {
713
+ triggers: {
714
+ ruleId: string;
715
+ eventData?: Record<string, unknown>;
716
+ }[];
717
+ };
718
+ return: any;
719
+ };
720
+ };
721
+ };
722
+ pointsTriggerHistory: {
723
+ find: {
724
+ /** 分页查询积分触发历史记录 */
725
+ post: {
726
+ body: {
727
+ current?: number;
728
+ pageSize?: number;
729
+ where?: {
730
+ userId?: string;
731
+ ruleId?: string;
732
+ ruleCode?: string;
733
+ event?: string;
734
+ status?: "pending" | "success" | "completed" | "failed" | "cooldown" | "constraintFailed";
735
+ rewardTarget?: "self" | "referrer";
736
+ startDate?: string;
737
+ endDate?: string;
738
+ };
739
+ };
740
+ return: any;
741
+ };
742
+ };
743
+ findOne: {
744
+ /** 根据 ID 查询积分触发历史详情 */
745
+ post: {
746
+ body: {
747
+ id: string;
748
+ };
749
+ return: any;
750
+ };
751
+ };
752
+ statusOptions: {
753
+ /** 获取积分触发状态下拉选项 */
754
+ post: {
755
+ return: any;
756
+ };
757
+ };
758
+ rewardTargetOptions: {
759
+ /** 获取奖励目标下拉选项 */
760
+ post: {
761
+ return: any;
762
+ };
763
+ };
764
+ statistics: {
765
+ /** 获取积分触发历史统计数据 */
766
+ post: {
767
+ body: {
768
+ userId?: string;
769
+ ruleId?: string;
770
+ startTime?: string;
771
+ endTime?: string;
772
+ period?: "today" | "week" | "month" | "year";
773
+ };
774
+ return: any;
775
+ };
776
+ };
777
+ trends: {
778
+ /** 获取积分触发趋势图表数据 */
779
+ post: {
780
+ body: {
781
+ userId?: string;
782
+ ruleId?: string;
783
+ startTime?: string;
784
+ endTime?: string;
785
+ granularity?: "minute" | "hour" | "day" | "month" | "year";
786
+ };
787
+ return: any;
788
+ };
789
+ };
790
+ pointsTrends: {
791
+ /** 获取积分变动趋势图表数据 */
792
+ post: {
793
+ body: {
794
+ userId?: string;
795
+ ruleId?: string;
796
+ startTime?: string;
797
+ endTime?: string;
798
+ granularity?: "minute" | "hour" | "day" | "month" | "year";
799
+ };
800
+ return: any;
801
+ };
802
+ };
803
+ completionAnalysis: {
804
+ /** 获取积分规则完成度分析数据 */
805
+ post: {
806
+ body: {
807
+ userId?: string;
808
+ ruleId?: string;
809
+ startTime?: string;
810
+ endTime?: string;
811
+ };
812
+ return: any;
813
+ };
814
+ };
815
+ triggerTypeTrends: {
816
+ /** 获取积分触发类型趋势图表数据 */
817
+ post: {
818
+ body: {
819
+ userId?: string;
820
+ ruleId?: string;
821
+ startTime?: string;
822
+ endTime?: string;
823
+ granularity?: "minute" | "hour" | "day" | "month" | "year";
824
+ };
825
+ return: any;
826
+ };
827
+ };
828
+ };
829
+ pointsTriggerRule: {
830
+ create: {
831
+ /** 创建新积分触发规则 */
832
+ post: {
833
+ body: {
834
+ ruleName: string;
835
+ ruleCode: string;
836
+ description: string;
837
+ event?: string;
838
+ triggerCondition: unknown;
839
+ pointsReward: unknown;
840
+ constraints: unknown;
841
+ activeTimeRanges: unknown;
842
+ };
843
+ return: any;
844
+ };
845
+ };
846
+ find: {
847
+ /** 分页查询积分触发规则列表 */
848
+ post: {
849
+ body: {
850
+ current?: number;
851
+ pageSize?: number;
852
+ where?: {
853
+ triggerType?: string;
854
+ status?: string;
855
+ ruleName?: string;
856
+ ruleCode?: string;
857
+ event?: string;
858
+ };
859
+ };
860
+ return: any;
861
+ };
862
+ };
863
+ findOne: {
864
+ /** 根据 ID 查询积分触发规则详情 */
865
+ post: {
866
+ body: {
867
+ id: string;
868
+ };
869
+ return: any;
870
+ };
871
+ };
872
+ update: {
873
+ /** 更新积分触发规则配置 */
874
+ post: {
875
+ body: {
876
+ id: string;
877
+ ruleName?: string;
878
+ ruleCode?: string;
879
+ description?: string;
880
+ event?: string | null;
881
+ triggerCondition?: unknown;
882
+ pointsReward?: unknown;
883
+ constraints?: unknown;
884
+ activeTimeRanges?: unknown;
885
+ };
886
+ return: any;
887
+ };
888
+ };
889
+ updateStatus: {
890
+ /** 启用或禁用积分触发规则 */
891
+ post: {
892
+ body: {
893
+ id: string;
894
+ status: "draft" | "active" | "inactive";
895
+ };
896
+ return: any;
897
+ };
898
+ };
899
+ delete: {
900
+ /** 删除积分触发规则 */
901
+ post: {
902
+ body: {
903
+ id: string;
904
+ };
905
+ return: any;
906
+ };
907
+ };
908
+ statusOptions: {
909
+ /** 获取积分触发规则状态下拉选项 */
910
+ post: {
911
+ return: any;
912
+ };
913
+ };
914
+ eventOptions: {
915
+ /** 获取可绑定的事件类型选项 */
916
+ post: {
917
+ return: any;
918
+ };
919
+ };
920
+ };
921
+ pointsPriceConfig: {
922
+ create: {
923
+ /** 创建新的积分计价配置 */
924
+ post: {
925
+ body: {
926
+ code: string;
927
+ name: string;
928
+ description?: string;
929
+ billingMode: "per_request" | "per_unit";
930
+ unitPrice: number;
931
+ unit?: string;
932
+ minCharge?: number;
933
+ status?: "active" | "inactive";
934
+ };
935
+ return: any;
936
+ };
937
+ };
938
+ find: {
939
+ /** 分页查询计价配置列表 */
940
+ post: {
941
+ body: {
942
+ where?: {
943
+ code?: string;
944
+ name?: string;
945
+ billingMode?: string;
946
+ status?: string;
947
+ };
948
+ page?: number;
949
+ pageSize?: number;
950
+ };
951
+ return: any;
952
+ };
953
+ };
954
+ findOne: {
955
+ /** 根据 ID 或 code 查询计价配置详情 */
956
+ post: {
957
+ body: {
958
+ id?: string;
959
+ code?: string;
960
+ };
961
+ return: any;
962
+ };
963
+ };
964
+ update: {
965
+ /** 更新计价配置 */
966
+ post: {
967
+ body: {
968
+ id: string;
969
+ name?: string;
970
+ description?: string;
971
+ billingMode?: "per_request" | "per_unit";
972
+ unitPrice?: number;
973
+ unit?: string;
974
+ minCharge?: number;
975
+ status?: "active" | "inactive";
976
+ };
977
+ return: any;
978
+ };
979
+ };
980
+ updateStatus: {
981
+ /** 启用或停用计价配置 */
982
+ post: {
983
+ body: {
984
+ id: string;
985
+ status: "active" | "inactive";
986
+ };
987
+ return: any;
988
+ };
989
+ };
990
+ delete: {
991
+ /** 删除计价配置 */
992
+ post: {
993
+ body: {
994
+ id: string;
995
+ };
996
+ return: any;
997
+ };
998
+ };
999
+ billingModeOptions: {
1000
+ /** 获取计费方式下拉选项 */
1001
+ post: {
1002
+ return: any;
1003
+ };
1004
+ };
1005
+ };
1006
+ pointsUsageRecord: {
1007
+ find: {
1008
+ /** 分页查询积分消费记录 */
1009
+ post: {
1010
+ body: {
1011
+ where?: {
1012
+ userId?: string;
1013
+ priceCode?: string;
1014
+ priceName?: string;
1015
+ billingMode?: string;
1016
+ startDate?: string;
1017
+ endDate?: string;
1018
+ };
1019
+ page?: number;
1020
+ pageSize?: number;
1021
+ };
1022
+ return: any;
1023
+ };
1024
+ };
1025
+ statistics: {
1026
+ /** 按维度统计消费数据 */
1027
+ post: {
1028
+ body: {
1029
+ dimension: "priceCode" | "userId" | "date";
1030
+ startDate?: string;
1031
+ endDate?: string;
1032
+ priceCode?: string;
1033
+ userId?: string;
1034
+ limit?: number;
1035
+ };
1036
+ return: any;
1037
+ };
1038
+ };
1039
+ overview: {
1040
+ /** 获取消费概览数据 */
1041
+ post: {
1042
+ body: {
1043
+ startDate?: string;
1044
+ endDate?: string;
1045
+ };
1046
+ return: any;
1047
+ };
1048
+ };
1049
+ };
1050
+ pointsBalanceAlert: {
1051
+ upsertConfig: {
1052
+ /** 创建或更新预警配置 */
1053
+ post: {
1054
+ body: {
1055
+ threshold: number;
1056
+ enabled?: boolean;
1057
+ notifyEmail?: boolean;
1058
+ notifyEmails?: string[];
1059
+ cooldownHours?: number;
1060
+ };
1061
+ return: any;
1062
+ };
1063
+ };
1064
+ getConfig: {
1065
+ /** 获取当前预警配置 */
1066
+ post: {
1067
+ return: any;
1068
+ };
1069
+ };
1070
+ findAlerts: {
1071
+ /** 分页查询预警记录 */
1072
+ post: {
1073
+ body: {
1074
+ where?: {
1075
+ userId?: string;
1076
+ alertType?: string;
1077
+ startDate?: string;
1078
+ endDate?: string;
1079
+ };
1080
+ page?: number;
1081
+ pageSize?: number;
1082
+ };
1083
+ return: any;
1084
+ };
1085
+ };
1086
+ triggerCheck: {
1087
+ /** 手动触发预警检查(测试用) */
1088
+ post: {
1089
+ body: {
1090
+ userId: string;
1091
+ };
1092
+ return: any;
1093
+ };
1094
+ };
1095
+ };
1096
+ notify: {
1097
+ alipay: {
1098
+ /** 支付宝订阅支付回调通知 */
1099
+ post: {
1100
+ body: Record<string, unknown>;
1101
+ return: any;
1102
+ };
1103
+ };
1104
+ };
1105
+ };
1106
+ /** API 客户端类型(提供完整的 IDE 智能提示) */
1107
+ export interface ApiClient {
1108
+ health: {
1109
+ get: (config?: RequestConfig) => Promise<ApiResponse<any>>;
1110
+ };
1111
+ 'api-spec': {
1112
+ /** 获取 API 规范,用于类型同步 */
1113
+ get: (config?: RequestConfig) => Promise<ApiResponse<any>>;
1114
+ };
1115
+ products: {
1116
+ create: {
1117
+ /** 创建新产品 */
1118
+ post: (body: {
1119
+ name: string;
1120
+ description?: string;
1121
+ features: {
1122
+ key: string;
1123
+ name: string;
1124
+ description?: string;
1125
+ type: "boolean" | "quota" | "unlimited";
1126
+ value?: boolean | number;
1127
+ highlight?: boolean;
1128
+ }[];
1129
+ metadata?: Record<string, unknown>;
1130
+ displayOrder?: number;
1131
+ }, config?: RequestConfig) => Promise<ApiResponse<any>>;
1132
+ };
1133
+ delete: {
1134
+ /** 删除产品 */
1135
+ post: (body: {
1136
+ id: string;
1137
+ }, config?: RequestConfig) => Promise<ApiResponse<any>>;
1138
+ };
1139
+ update: {
1140
+ /** 更新产品信息 */
1141
+ post: (body: {
1142
+ id: string;
1143
+ name?: string;
1144
+ description?: string;
1145
+ features?: {
1146
+ key: string;
1147
+ name: string;
1148
+ description?: string;
1149
+ type: "boolean" | "quota" | "unlimited";
1150
+ value?: boolean | number;
1151
+ highlight?: boolean;
1152
+ }[];
1153
+ status?: "active" | "archived";
1154
+ metadata?: Record<string, unknown>;
1155
+ displayOrder?: number;
1156
+ }, config?: RequestConfig) => Promise<ApiResponse<any>>;
1157
+ };
1158
+ find: {
1159
+ /** 分页查询产品列表 */
1160
+ post: (body: {
1161
+ current: number;
1162
+ pageSize: number;
1163
+ where: {
1164
+ name?: string;
1165
+ status?: "" | "active" | "archived";
1166
+ };
1167
+ }, config?: RequestConfig) => Promise<ApiResponse<any>>;
1168
+ };
1169
+ findOne: {
1170
+ /** 根据 ID 查询产品详情 */
1171
+ post: (body: {
1172
+ id: string;
1173
+ }, config?: RequestConfig) => Promise<ApiResponse<any>>;
1174
+ };
1175
+ listActive: {
1176
+ /** 获取定价页面可用产品列表(公开) */
1177
+ post: (config?: RequestConfig) => Promise<ApiResponse<any>>;
1178
+ };
1179
+ };
1180
+ prices: {
1181
+ create: {
1182
+ /** 创建新价格方案 */
1183
+ post: (body: {
1184
+ productId: string;
1185
+ nickname?: string;
1186
+ type: "one_time" | "recurring";
1187
+ currency: string;
1188
+ unitAmount: number;
1189
+ interval?: "day" | "week" | "month" | "year";
1190
+ intervalCount?: number;
1191
+ trialPeriodDays?: number;
1192
+ metadata?: Record<string, unknown>;
1193
+ }, config?: RequestConfig) => Promise<ApiResponse<any>>;
1194
+ };
1195
+ delete: {
1196
+ /** 删除价格方案 */
1197
+ post: (body: {
1198
+ id: string;
1199
+ }, config?: RequestConfig) => Promise<ApiResponse<any>>;
1200
+ };
1201
+ update: {
1202
+ /** 更新价格方案信息 */
1203
+ post: (body: {
1204
+ id: string;
1205
+ nickname?: string;
1206
+ active?: boolean;
1207
+ trialPeriodDays?: number;
1208
+ metadata?: Record<string, unknown>;
1209
+ }, config?: RequestConfig) => Promise<ApiResponse<any>>;
1210
+ };
1211
+ find: {
1212
+ /** 分页查询价格方案列表 */
1213
+ post: (body: {
1214
+ current: number;
1215
+ pageSize: number;
1216
+ where: {
1217
+ productId?: string;
1218
+ type?: "" | "one_time" | "recurring";
1219
+ active?: boolean;
1220
+ };
1221
+ }, config?: RequestConfig) => Promise<ApiResponse<any>>;
1222
+ };
1223
+ findOne: {
1224
+ /** 根据 ID 查询价格方案详情 */
1225
+ post: (body: {
1226
+ id: string;
1227
+ }, config?: RequestConfig) => Promise<ApiResponse<any>>;
1228
+ };
1229
+ listByProduct: {
1230
+ /** 获取指定产品的所有可用价格方案 */
1231
+ post: (body: {
1232
+ productId: string;
1233
+ }, config?: RequestConfig) => Promise<ApiResponse<any>>;
1234
+ };
1235
+ };
1236
+ subscriptions: {
1237
+ create: {
1238
+ /** 创建新订阅并发起支付 */
1239
+ post: (body: {
1240
+ priceId: string;
1241
+ couponCode?: string;
1242
+ }, config?: RequestConfig) => Promise<ApiResponse<any>>;
1243
+ };
1244
+ cancel: {
1245
+ /** 取消订阅 */
1246
+ post: (body: {
1247
+ subscriptionId: string;
1248
+ cancelAtPeriodEnd?: boolean;
1249
+ reason?: string;
1250
+ }, config?: RequestConfig) => Promise<ApiResponse<any>>;
1251
+ };
1252
+ resume: {
1253
+ /** 恢复已取消的订阅 */
1254
+ post: (body: {
1255
+ subscriptionId: string;
1256
+ }, config?: RequestConfig) => Promise<ApiResponse<any>>;
1257
+ };
1258
+ change: {
1259
+ /** 升级或降级订阅 */
1260
+ post: (body: {
1261
+ subscriptionId: string;
1262
+ newPriceId: string;
1263
+ proration?: boolean;
1264
+ }, config?: RequestConfig) => Promise<ApiResponse<any>>;
1265
+ };
1266
+ my: {
1267
+ /** 查询当前用户的订阅列表 */
1268
+ post: (body: {
1269
+ current?: number;
1270
+ pageSize?: number;
1271
+ status?: string;
1272
+ }, config?: RequestConfig) => Promise<ApiResponse<any>>;
1273
+ };
1274
+ current: {
1275
+ /** 获取当前活跃订阅 */
1276
+ post: (config?: RequestConfig) => Promise<ApiResponse<any>>;
1277
+ };
1278
+ find: {
1279
+ /** 分页查询订阅列表(管理端) */
1280
+ post: (body: {
1281
+ current: number;
1282
+ pageSize: number;
1283
+ where: {
1284
+ userId?: string;
1285
+ productId?: string;
1286
+ status?: string;
1287
+ };
1288
+ }, config?: RequestConfig) => Promise<ApiResponse<any>>;
1289
+ };
1290
+ };
1291
+ quotas: {
1292
+ create: {
1293
+ /** 创建配额定义 */
1294
+ post: (body: {
1295
+ productId: string;
1296
+ featureKey: string;
1297
+ name: string;
1298
+ description?: string;
1299
+ limit: number;
1300
+ allowOverage?: boolean;
1301
+ pointsCostPerUnit?: number;
1302
+ period: "day" | "week" | "month" | "year" | "lifetime";
1303
+ metadata?: Record<string, unknown>;
1304
+ }, config?: RequestConfig) => Promise<ApiResponse<any>>;
1305
+ };
1306
+ delete: {
1307
+ /** 删除配额定义 */
1308
+ post: (body: {
1309
+ id: string;
1310
+ }, config?: RequestConfig) => Promise<ApiResponse<any>>;
1311
+ };
1312
+ update: {
1313
+ /** 更新配额定义 */
1314
+ post: (body: {
1315
+ id: string;
1316
+ name?: string;
1317
+ description?: string;
1318
+ limit?: number;
1319
+ period?: "day" | "week" | "month" | "year" | "lifetime";
1320
+ allowOverage?: boolean;
1321
+ pointsCostPerUnit?: number;
1322
+ metadata?: Record<string, unknown>;
1323
+ }, config?: RequestConfig) => Promise<ApiResponse<any>>;
1324
+ };
1325
+ find: {
1326
+ /** 分页查询配额列表 */
1327
+ post: (body: {
1328
+ current: number;
1329
+ pageSize: number;
1330
+ where: {
1331
+ productId?: string;
1332
+ featureKey?: string;
1333
+ };
1334
+ }, config?: RequestConfig) => Promise<ApiResponse<any>>;
1335
+ };
1336
+ check: {
1337
+ /** 检查用户配额是否足够 */
1338
+ post: (body: {
1339
+ featureKey: string;
1340
+ amount?: number;
1341
+ }, config?: RequestConfig) => Promise<ApiResponse<any>>;
1342
+ };
1343
+ my: {
1344
+ /** 获取当前用户的配额使用情况 */
1345
+ post: (config?: RequestConfig) => Promise<ApiResponse<any>>;
1346
+ };
1347
+ };
1348
+ usageRecords: {
1349
+ record: {
1350
+ /** 记录用户功能使用量 */
1351
+ post: (body: {
1352
+ userId?: string;
1353
+ featureKey: string;
1354
+ quantity?: number;
1355
+ metadata?: Record<string, unknown>;
1356
+ }, config?: RequestConfig) => Promise<ApiResponse<any>>;
1357
+ };
1358
+ recordWithQuotaCheck: {
1359
+ /** 记录使用量并检查配额,支持超额积分扣费 */
1360
+ post: (body: {
1361
+ userId?: string;
1362
+ featureKey: string;
1363
+ quantity?: number;
1364
+ metadata?: Record<string, unknown>;
1365
+ }, config?: RequestConfig) => Promise<ApiResponse<any>>;
1366
+ };
1367
+ checkQuota: {
1368
+ /** 预检查配额是否足够(不记录使用量) */
1369
+ post: (body: {
1370
+ userId?: string;
1371
+ featureKey: string;
1372
+ quantity?: number;
1373
+ }, config?: RequestConfig) => Promise<ApiResponse<any>>;
1374
+ };
1375
+ batchRecord: {
1376
+ /** 批量记录使用量 */
1377
+ post: (body: {
1378
+ records: {
1379
+ userId: string;
1380
+ featureKey: string;
1381
+ quantity?: number;
1382
+ metadata?: Record<string, unknown>;
1383
+ timestamp?: string;
1384
+ }[];
1385
+ }, config?: RequestConfig) => Promise<ApiResponse<any>>;
1386
+ };
1387
+ find: {
1388
+ /** 分页查询使用记录(管理端) */
1389
+ post: (body: {
1390
+ current: number;
1391
+ pageSize: number;
1392
+ where: {
1393
+ userId?: string;
1394
+ featureKey?: string;
1395
+ startTime?: string;
1396
+ endTime?: string;
1397
+ };
1398
+ }, config?: RequestConfig) => Promise<ApiResponse<any>>;
1399
+ };
1400
+ my: {
1401
+ /** 查询当前用户的使用记录 */
1402
+ post: (body: {
1403
+ current?: number;
1404
+ pageSize?: number;
1405
+ featureKey?: string;
1406
+ startTime?: string;
1407
+ endTime?: string;
1408
+ }, config?: RequestConfig) => Promise<ApiResponse<any>>;
1409
+ };
1410
+ statistics: {
1411
+ /** 获取使用量统计数据 */
1412
+ post: (body: {
1413
+ userId?: string;
1414
+ featureKey?: string;
1415
+ startTime: string;
1416
+ endTime: string;
1417
+ granularity: "hour" | "day" | "week" | "month";
1418
+ }, config?: RequestConfig) => Promise<ApiResponse<any>>;
1419
+ };
1420
+ getTrendChart: {
1421
+ /** 获取使用量趋势图表数据 */
1422
+ post: (body: {
1423
+ featureKey?: string;
1424
+ startTime: string;
1425
+ endTime: string;
1426
+ granularity: "hour" | "day" | "week" | "month";
1427
+ }, config?: RequestConfig) => Promise<ApiResponse<any>>;
1428
+ };
1429
+ };
1430
+ invoices: {
1431
+ find: {
1432
+ /** 分页查询发票列表(管理端) */
1433
+ post: (body: {
1434
+ current: number;
1435
+ pageSize: number;
1436
+ where: {
1437
+ userId?: string;
1438
+ subscriptionId?: string;
1439
+ status?: string;
1440
+ startTime?: string;
1441
+ endTime?: string;
1442
+ };
1443
+ }, config?: RequestConfig) => Promise<ApiResponse<any>>;
1444
+ };
1445
+ findOne: {
1446
+ /** 根据 ID 查询发票详情 */
1447
+ post: (body: {
1448
+ id: string;
1449
+ }, config?: RequestConfig) => Promise<ApiResponse<any>>;
1450
+ };
1451
+ my: {
1452
+ /** 查询当前用户的发票列表 */
1453
+ post: (body: {
1454
+ current?: number;
1455
+ pageSize?: number;
1456
+ status?: string;
1457
+ }, config?: RequestConfig) => Promise<ApiResponse<any>>;
1458
+ };
1459
+ void: {
1460
+ /** 作废发票 */
1461
+ post: (body: {
1462
+ id: string;
1463
+ reason?: string;
1464
+ }, config?: RequestConfig) => Promise<ApiResponse<any>>;
1465
+ };
1466
+ statistics: {
1467
+ /** 获取发票统计数据 */
1468
+ post: (body: {
1469
+ startTime?: string;
1470
+ endTime?: string;
1471
+ }, config?: RequestConfig) => Promise<ApiResponse<any>>;
1472
+ };
1473
+ revenueReport: {
1474
+ /** 获取收入报表数据 */
1475
+ post: (body: {
1476
+ startTime: string;
1477
+ endTime: string;
1478
+ granularity: "day" | "week" | "month" | "year";
1479
+ }, config?: RequestConfig) => Promise<ApiResponse<any>>;
1480
+ };
1481
+ };
1482
+ points: {
1483
+ account: {
1484
+ /** 查询用户积分账户余额 */
1485
+ post: (body: {
1486
+ userId?: string;
1487
+ }, config?: RequestConfig) => Promise<ApiResponse<any>>;
1488
+ };
1489
+ earn: {
1490
+ /** 发放积分(充值、奖励等) */
1491
+ post: (body: {
1492
+ userId: string;
1493
+ amount: number;
1494
+ subType: "recharge" | "referral" | "signup" | "subscription" | "activity" | "bonus";
1495
+ requestId?: string;
1496
+ description: string;
1497
+ orderId?: string;
1498
+ referrerId?: string;
1499
+ ruleId?: string;
1500
+ metadata?: Record<string, unknown>;
1501
+ }, config?: RequestConfig) => Promise<ApiResponse<any>>;
1502
+ };
1503
+ consumeByPrice: {
1504
+ /** 根据计价配置消费积分 */
1505
+ post: (body: {
1506
+ userId: string;
1507
+ priceCode: string;
1508
+ quantity?: number;
1509
+ requestId?: string;
1510
+ description?: string;
1511
+ metadata?: Record<string, unknown>;
1512
+ }, config?: RequestConfig) => Promise<ApiResponse<any>>;
1513
+ };
1514
+ checkBalance: {
1515
+ /** 检查积分是否足够(不扣费) */
1516
+ post: (body: {
1517
+ userId: string;
1518
+ priceCode: string;
1519
+ quantity?: number;
1520
+ }, config?: RequestConfig) => Promise<ApiResponse<any>>;
1521
+ };
1522
+ reversal: {
1523
+ /** 冲正/退还已消费的积分 */
1524
+ post: (body: {
1525
+ userId: string;
1526
+ originalTransactionId: string;
1527
+ requestId?: string;
1528
+ reason: string;
1529
+ }, config?: RequestConfig) => Promise<ApiResponse<any>>;
1530
+ };
1531
+ clawback: {
1532
+ /** 追回/扣回已发放的积分 */
1533
+ post: (body: {
1534
+ userId: string;
1535
+ originalTransactionId: string;
1536
+ requestId?: string;
1537
+ reason: string;
1538
+ }, config?: RequestConfig) => Promise<ApiResponse<any>>;
1539
+ };
1540
+ adjust: {
1541
+ /** 人工调整积分(加/减) */
1542
+ post: (body: {
1543
+ userId: string;
1544
+ amount: number;
1545
+ requestId?: string;
1546
+ reason: string;
1547
+ relatedOrderId?: string;
1548
+ }, config?: RequestConfig) => Promise<ApiResponse<any>>;
1549
+ };
1550
+ batchAdjust: {
1551
+ /** 批量调整多用户积分 */
1552
+ post: (body: {
1553
+ userIds: string[];
1554
+ amount: number;
1555
+ requestId?: string;
1556
+ reason: string;
1557
+ }, config?: RequestConfig) => Promise<ApiResponse<any>>;
1558
+ };
1559
+ statistics: {
1560
+ /** 获取用户积分统计数据 */
1561
+ post: (body: {
1562
+ userId?: string;
1563
+ }, config?: RequestConfig) => Promise<ApiResponse<any>>;
1564
+ };
1565
+ leaderboard: {
1566
+ /** 获取积分排行榜 */
1567
+ post: (body: {
1568
+ limit?: number;
1569
+ }, config?: RequestConfig) => Promise<ApiResponse<any>>;
1570
+ };
1571
+ };
1572
+ pointsHistory: {
1573
+ find: {
1574
+ /** 分页查询积分变动历史 */
1575
+ post: (body: {
1576
+ userId?: string;
1577
+ type?: "earn" | "spend" | "reversal" | "clawback" | "adjust";
1578
+ subType?: string;
1579
+ page?: number;
1580
+ pageSize?: number;
1581
+ startDate?: string;
1582
+ endDate?: string;
1583
+ }, config?: RequestConfig) => Promise<ApiResponse<any>>;
1584
+ };
1585
+ findOne: {
1586
+ /** 根据 ID 查询积分历史详情 */
1587
+ post: (body: {
1588
+ id: string;
1589
+ }, config?: RequestConfig) => Promise<ApiResponse<any>>;
1590
+ };
1591
+ statistics: {
1592
+ /** 获取积分统计数据 */
1593
+ post: (body: {
1594
+ userId?: string;
1595
+ period?: "day" | "week" | "month" | "year";
1596
+ }, config?: RequestConfig) => Promise<ApiResponse<any>>;
1597
+ };
1598
+ getTrendChart: {
1599
+ /** 获取积分变动趋势图表数据 */
1600
+ post: (body: {
1601
+ userId?: string;
1602
+ startTime: string;
1603
+ endTime: string;
1604
+ granularity: "minute" | "hour" | "day" | "month" | "year";
1605
+ }, config?: RequestConfig) => Promise<ApiResponse<any>>;
1606
+ };
1607
+ getTypeDistributionChart: {
1608
+ /** 获取积分类型分布图表数据 */
1609
+ post: (body: {
1610
+ userId?: string;
1611
+ startTime?: string;
1612
+ endTime?: string;
1613
+ }, config?: RequestConfig) => Promise<ApiResponse<any>>;
1614
+ };
1615
+ getRankingChart: {
1616
+ /** 获取用户积分排行榜 */
1617
+ post: (body: {
1618
+ type?: "earn" | "spend" | "reversal" | "clawback" | "adjust";
1619
+ startTime?: string;
1620
+ endTime?: string;
1621
+ limit?: number;
1622
+ }, config?: RequestConfig) => Promise<ApiResponse<any>>;
1623
+ };
1624
+ };
1625
+ pointsTrigger: {
1626
+ trigger: {
1627
+ /** 根据规则 ID 触发积分发放 */
1628
+ post: (body: {
1629
+ ruleId: string;
1630
+ eventData?: Record<string, unknown>;
1631
+ }, config?: RequestConfig) => Promise<ApiResponse<any>>;
1632
+ };
1633
+ triggerByEvent: {
1634
+ /** 根据事件自动匹配并触发积分规则 */
1635
+ post: (body: {
1636
+ event: string;
1637
+ eventData?: Record<string, unknown>;
1638
+ userId?: string;
1639
+ }, config?: RequestConfig) => Promise<ApiResponse<any>>;
1640
+ };
1641
+ batchTrigger: {
1642
+ /** 批量触发多个积分规则 */
1643
+ post: (body: {
1644
+ triggers: {
1645
+ ruleId: string;
1646
+ eventData?: Record<string, unknown>;
1647
+ }[];
1648
+ }, config?: RequestConfig) => Promise<ApiResponse<any>>;
1649
+ };
1650
+ };
1651
+ pointsTriggerHistory: {
1652
+ find: {
1653
+ /** 分页查询积分触发历史记录 */
1654
+ post: (body: {
1655
+ current?: number;
1656
+ pageSize?: number;
1657
+ where?: {
1658
+ userId?: string;
1659
+ ruleId?: string;
1660
+ ruleCode?: string;
1661
+ event?: string;
1662
+ status?: "pending" | "success" | "completed" | "failed" | "cooldown" | "constraintFailed";
1663
+ rewardTarget?: "self" | "referrer";
1664
+ startDate?: string;
1665
+ endDate?: string;
1666
+ };
1667
+ }, config?: RequestConfig) => Promise<ApiResponse<any>>;
1668
+ };
1669
+ findOne: {
1670
+ /** 根据 ID 查询积分触发历史详情 */
1671
+ post: (body: {
1672
+ id: string;
1673
+ }, config?: RequestConfig) => Promise<ApiResponse<any>>;
1674
+ };
1675
+ statusOptions: {
1676
+ /** 获取积分触发状态下拉选项 */
1677
+ post: (config?: RequestConfig) => Promise<ApiResponse<any>>;
1678
+ };
1679
+ rewardTargetOptions: {
1680
+ /** 获取奖励目标下拉选项 */
1681
+ post: (config?: RequestConfig) => Promise<ApiResponse<any>>;
1682
+ };
1683
+ statistics: {
1684
+ /** 获取积分触发历史统计数据 */
1685
+ post: (body: {
1686
+ userId?: string;
1687
+ ruleId?: string;
1688
+ startTime?: string;
1689
+ endTime?: string;
1690
+ period?: "today" | "week" | "month" | "year";
1691
+ }, config?: RequestConfig) => Promise<ApiResponse<any>>;
1692
+ };
1693
+ trends: {
1694
+ /** 获取积分触发趋势图表数据 */
1695
+ post: (body: {
1696
+ userId?: string;
1697
+ ruleId?: string;
1698
+ startTime?: string;
1699
+ endTime?: string;
1700
+ granularity?: "minute" | "hour" | "day" | "month" | "year";
1701
+ }, config?: RequestConfig) => Promise<ApiResponse<any>>;
1702
+ };
1703
+ pointsTrends: {
1704
+ /** 获取积分变动趋势图表数据 */
1705
+ post: (body: {
1706
+ userId?: string;
1707
+ ruleId?: string;
1708
+ startTime?: string;
1709
+ endTime?: string;
1710
+ granularity?: "minute" | "hour" | "day" | "month" | "year";
1711
+ }, config?: RequestConfig) => Promise<ApiResponse<any>>;
1712
+ };
1713
+ completionAnalysis: {
1714
+ /** 获取积分规则完成度分析数据 */
1715
+ post: (body: {
1716
+ userId?: string;
1717
+ ruleId?: string;
1718
+ startTime?: string;
1719
+ endTime?: string;
1720
+ }, config?: RequestConfig) => Promise<ApiResponse<any>>;
1721
+ };
1722
+ triggerTypeTrends: {
1723
+ /** 获取积分触发类型趋势图表数据 */
1724
+ post: (body: {
1725
+ userId?: string;
1726
+ ruleId?: string;
1727
+ startTime?: string;
1728
+ endTime?: string;
1729
+ granularity?: "minute" | "hour" | "day" | "month" | "year";
1730
+ }, config?: RequestConfig) => Promise<ApiResponse<any>>;
1731
+ };
1732
+ };
1733
+ pointsTriggerRule: {
1734
+ create: {
1735
+ /** 创建新积分触发规则 */
1736
+ post: (body: {
1737
+ ruleName: string;
1738
+ ruleCode: string;
1739
+ description: string;
1740
+ event?: string;
1741
+ triggerCondition: unknown;
1742
+ pointsReward: unknown;
1743
+ constraints: unknown;
1744
+ activeTimeRanges: unknown;
1745
+ }, config?: RequestConfig) => Promise<ApiResponse<any>>;
1746
+ };
1747
+ find: {
1748
+ /** 分页查询积分触发规则列表 */
1749
+ post: (body: {
1750
+ current?: number;
1751
+ pageSize?: number;
1752
+ where?: {
1753
+ triggerType?: string;
1754
+ status?: string;
1755
+ ruleName?: string;
1756
+ ruleCode?: string;
1757
+ event?: string;
1758
+ };
1759
+ }, config?: RequestConfig) => Promise<ApiResponse<any>>;
1760
+ };
1761
+ findOne: {
1762
+ /** 根据 ID 查询积分触发规则详情 */
1763
+ post: (body: {
1764
+ id: string;
1765
+ }, config?: RequestConfig) => Promise<ApiResponse<any>>;
1766
+ };
1767
+ update: {
1768
+ /** 更新积分触发规则配置 */
1769
+ post: (body: {
1770
+ id: string;
1771
+ ruleName?: string;
1772
+ ruleCode?: string;
1773
+ description?: string;
1774
+ event?: string | null;
1775
+ triggerCondition?: unknown;
1776
+ pointsReward?: unknown;
1777
+ constraints?: unknown;
1778
+ activeTimeRanges?: unknown;
1779
+ }, config?: RequestConfig) => Promise<ApiResponse<any>>;
1780
+ };
1781
+ updateStatus: {
1782
+ /** 启用或禁用积分触发规则 */
1783
+ post: (body: {
1784
+ id: string;
1785
+ status: "draft" | "active" | "inactive";
1786
+ }, config?: RequestConfig) => Promise<ApiResponse<any>>;
1787
+ };
1788
+ delete: {
1789
+ /** 删除积分触发规则 */
1790
+ post: (body: {
1791
+ id: string;
1792
+ }, config?: RequestConfig) => Promise<ApiResponse<any>>;
1793
+ };
1794
+ statusOptions: {
1795
+ /** 获取积分触发规则状态下拉选项 */
1796
+ post: (config?: RequestConfig) => Promise<ApiResponse<any>>;
1797
+ };
1798
+ eventOptions: {
1799
+ /** 获取可绑定的事件类型选项 */
1800
+ post: (config?: RequestConfig) => Promise<ApiResponse<any>>;
1801
+ };
1802
+ };
1803
+ pointsPriceConfig: {
1804
+ create: {
1805
+ /** 创建新的积分计价配置 */
1806
+ post: (body: {
1807
+ code: string;
1808
+ name: string;
1809
+ description?: string;
1810
+ billingMode: "per_request" | "per_unit";
1811
+ unitPrice: number;
1812
+ unit?: string;
1813
+ minCharge?: number;
1814
+ status?: "active" | "inactive";
1815
+ }, config?: RequestConfig) => Promise<ApiResponse<any>>;
1816
+ };
1817
+ find: {
1818
+ /** 分页查询计价配置列表 */
1819
+ post: (body: {
1820
+ where?: {
1821
+ code?: string;
1822
+ name?: string;
1823
+ billingMode?: string;
1824
+ status?: string;
1825
+ };
1826
+ page?: number;
1827
+ pageSize?: number;
1828
+ }, config?: RequestConfig) => Promise<ApiResponse<any>>;
1829
+ };
1830
+ findOne: {
1831
+ /** 根据 ID 或 code 查询计价配置详情 */
1832
+ post: (body: {
1833
+ id?: string;
1834
+ code?: string;
1835
+ }, config?: RequestConfig) => Promise<ApiResponse<any>>;
1836
+ };
1837
+ update: {
1838
+ /** 更新计价配置 */
1839
+ post: (body: {
1840
+ id: string;
1841
+ name?: string;
1842
+ description?: string;
1843
+ billingMode?: "per_request" | "per_unit";
1844
+ unitPrice?: number;
1845
+ unit?: string;
1846
+ minCharge?: number;
1847
+ status?: "active" | "inactive";
1848
+ }, config?: RequestConfig) => Promise<ApiResponse<any>>;
1849
+ };
1850
+ updateStatus: {
1851
+ /** 启用或停用计价配置 */
1852
+ post: (body: {
1853
+ id: string;
1854
+ status: "active" | "inactive";
1855
+ }, config?: RequestConfig) => Promise<ApiResponse<any>>;
1856
+ };
1857
+ delete: {
1858
+ /** 删除计价配置 */
1859
+ post: (body: {
1860
+ id: string;
1861
+ }, config?: RequestConfig) => Promise<ApiResponse<any>>;
1862
+ };
1863
+ billingModeOptions: {
1864
+ /** 获取计费方式下拉选项 */
1865
+ post: (config?: RequestConfig) => Promise<ApiResponse<any>>;
1866
+ };
1867
+ };
1868
+ pointsUsageRecord: {
1869
+ find: {
1870
+ /** 分页查询积分消费记录 */
1871
+ post: (body: {
1872
+ where?: {
1873
+ userId?: string;
1874
+ priceCode?: string;
1875
+ priceName?: string;
1876
+ billingMode?: string;
1877
+ startDate?: string;
1878
+ endDate?: string;
1879
+ };
1880
+ page?: number;
1881
+ pageSize?: number;
1882
+ }, config?: RequestConfig) => Promise<ApiResponse<any>>;
1883
+ };
1884
+ statistics: {
1885
+ /** 按维度统计消费数据 */
1886
+ post: (body: {
1887
+ dimension: "priceCode" | "userId" | "date";
1888
+ startDate?: string;
1889
+ endDate?: string;
1890
+ priceCode?: string;
1891
+ userId?: string;
1892
+ limit?: number;
1893
+ }, config?: RequestConfig) => Promise<ApiResponse<any>>;
1894
+ };
1895
+ overview: {
1896
+ /** 获取消费概览数据 */
1897
+ post: (body: {
1898
+ startDate?: string;
1899
+ endDate?: string;
1900
+ }, config?: RequestConfig) => Promise<ApiResponse<any>>;
1901
+ };
1902
+ };
1903
+ pointsBalanceAlert: {
1904
+ upsertConfig: {
1905
+ /** 创建或更新预警配置 */
1906
+ post: (body: {
1907
+ threshold: number;
1908
+ enabled?: boolean;
1909
+ notifyEmail?: boolean;
1910
+ notifyEmails?: string[];
1911
+ cooldownHours?: number;
1912
+ }, config?: RequestConfig) => Promise<ApiResponse<any>>;
1913
+ };
1914
+ getConfig: {
1915
+ /** 获取当前预警配置 */
1916
+ post: (config?: RequestConfig) => Promise<ApiResponse<any>>;
1917
+ };
1918
+ findAlerts: {
1919
+ /** 分页查询预警记录 */
1920
+ post: (body: {
1921
+ where?: {
1922
+ userId?: string;
1923
+ alertType?: string;
1924
+ startDate?: string;
1925
+ endDate?: string;
1926
+ };
1927
+ page?: number;
1928
+ pageSize?: number;
1929
+ }, config?: RequestConfig) => Promise<ApiResponse<any>>;
1930
+ };
1931
+ triggerCheck: {
1932
+ /** 手动触发预警检查(测试用) */
1933
+ post: (body: {
1934
+ userId: string;
1935
+ }, config?: RequestConfig) => Promise<ApiResponse<any>>;
1936
+ };
1937
+ };
1938
+ notify: {
1939
+ alipay: {
1940
+ /** 支付宝订阅支付回调通知 */
1941
+ post: (body: Record<string, unknown>, config?: RequestConfig) => Promise<ApiResponse<any>>;
1942
+ };
1943
+ };
1944
+ }
1945
+ /** API 客户端类型别名(基于 EdenClient 推断,提供完整类型检查) */
1946
+ export type ApiClientType = EdenClient<Api>;
1947
+ /**
1948
+ * 创建类型安全的 API 客户端
1949
+ *
1950
+ * @example
1951
+ * ```typescript
1952
+ * import { createClient } from '@vafast/api-client'
1953
+ * import { createApiClient } from './api.generated'
1954
+ *
1955
+ * const client = createClient('/api').use(authMiddleware)
1956
+ * const api = createApiClient(client)
1957
+ *
1958
+ * // 完整的 IDE 智能提示和类型检查
1959
+ * const { data, error } = await api.users.find.post({ current: 1, pageSize: 10 })
1960
+ * // ❌ 错误路径会被 TypeScript 检测到
1961
+ * // api.nonExistent.post() // Error: Property 'nonExistent' does not exist
1962
+ * ```
1963
+ */
1964
+ export declare function createApiClient(client: Client): EdenClient<Api>;