zentao-api 0.3.3 → 0.4.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.
@@ -1037,19 +1037,12 @@ export declare const BUILTIN_MODULES: readonly [{
1037
1037
  readonly display: "获取产品计划列表,支持获取产品下的产品计划";
1038
1038
  readonly type: "list";
1039
1039
  readonly method: "get";
1040
- readonly path: "/{scope}/{scopeID}/productplans";
1040
+ readonly path: "/products/{productID}/productplans";
1041
1041
  readonly resultType: "list";
1042
1042
  readonly pagerGetter: "pager";
1043
1043
  readonly resultGetter: "productplans";
1044
1044
  readonly pathParams: {
1045
- readonly scope: {
1046
- readonly description: "产品计划范围";
1047
- readonly options: readonly [{
1048
- readonly value: "products";
1049
- readonly label: "产品";
1050
- }];
1051
- };
1052
- readonly scopeID: "范围ID";
1045
+ readonly productID: "所属产品ID";
1053
1046
  };
1054
1047
  readonly params: readonly [{
1055
1048
  readonly name: "browseType";
@@ -1245,7 +1238,7 @@ export declare const BUILTIN_MODULES: readonly [{
1245
1238
  readonly resultGetter: "stories";
1246
1239
  readonly pathParams: {
1247
1240
  readonly scope: {
1248
- readonly description: "需求范围";
1241
+ readonly description: "需求所属范围";
1249
1242
  readonly options: readonly [{
1250
1243
  readonly value: "products";
1251
1244
  readonly label: "产品";
@@ -1257,7 +1250,7 @@ export declare const BUILTIN_MODULES: readonly [{
1257
1250
  readonly label: "执行";
1258
1251
  }];
1259
1252
  };
1260
- readonly scopeID: "范围ID";
1253
+ readonly scopeID: "所属范围ID";
1261
1254
  };
1262
1255
  readonly params: readonly [{
1263
1256
  readonly name: "browseType";
@@ -1580,19 +1573,12 @@ export declare const BUILTIN_MODULES: readonly [{
1580
1573
  readonly display: "获取业务需求列表,支持获取产品下的业务需求";
1581
1574
  readonly type: "list";
1582
1575
  readonly method: "get";
1583
- readonly path: "/{scope}/{scopeID}/epics";
1576
+ readonly path: "/products/{productID}/epics";
1584
1577
  readonly resultType: "list";
1585
1578
  readonly pagerGetter: "pager";
1586
1579
  readonly resultGetter: "epics";
1587
1580
  readonly pathParams: {
1588
- readonly scope: {
1589
- readonly description: "业务需求范围";
1590
- readonly options: readonly [{
1591
- readonly value: "products";
1592
- readonly label: "产品";
1593
- }];
1594
- };
1595
- readonly scopeID: "范围ID";
1581
+ readonly productID: "所属产品ID";
1596
1582
  };
1597
1583
  readonly params: readonly [{
1598
1584
  readonly name: "browseType";
@@ -1906,19 +1892,12 @@ export declare const BUILTIN_MODULES: readonly [{
1906
1892
  readonly display: "获取用户需求列表,支持获取产品下的用户需求";
1907
1893
  readonly type: "list";
1908
1894
  readonly method: "get";
1909
- readonly path: "/{scope}/{scopeID}/requirements";
1895
+ readonly path: "/products/{productID}/requirements";
1910
1896
  readonly resultType: "list";
1911
1897
  readonly pagerGetter: "pager";
1912
1898
  readonly resultGetter: "requirements";
1913
1899
  readonly pathParams: {
1914
- readonly scope: {
1915
- readonly description: "用户需求范围";
1916
- readonly options: readonly [{
1917
- readonly value: "products";
1918
- readonly label: "产品";
1919
- }];
1920
- };
1921
- readonly scopeID: "范围ID";
1900
+ readonly productID: "所属产品ID";
1922
1901
  };
1923
1902
  readonly params: readonly [{
1924
1903
  readonly name: "browseType";
@@ -2229,7 +2208,7 @@ export declare const BUILTIN_MODULES: readonly [{
2229
2208
  readonly resultGetter: "bugs";
2230
2209
  readonly pathParams: {
2231
2210
  readonly scope: {
2232
- readonly description: "Bug范围";
2211
+ readonly description: "Bug所属范围";
2233
2212
  readonly options: readonly [{
2234
2213
  readonly value: "products";
2235
2214
  readonly label: "产品";
@@ -2241,7 +2220,7 @@ export declare const BUILTIN_MODULES: readonly [{
2241
2220
  readonly label: "执行";
2242
2221
  }];
2243
2222
  };
2244
- readonly scopeID: "范围ID";
2223
+ readonly scopeID: "所属范围ID";
2245
2224
  };
2246
2225
  readonly params: readonly [{
2247
2226
  readonly name: "browseType";
@@ -2563,7 +2542,7 @@ export declare const BUILTIN_MODULES: readonly [{
2563
2542
  readonly resultGetter: "testcases";
2564
2543
  readonly pathParams: {
2565
2544
  readonly scope: {
2566
- readonly description: "测试用例范围";
2545
+ readonly description: "测试用例所属范围";
2567
2546
  readonly options: readonly [{
2568
2547
  readonly value: "products";
2569
2548
  readonly label: "产品";
@@ -2575,7 +2554,7 @@ export declare const BUILTIN_MODULES: readonly [{
2575
2554
  readonly label: "执行";
2576
2555
  }];
2577
2556
  };
2578
- readonly scopeID: "范围ID";
2557
+ readonly scopeID: "所属范围ID";
2579
2558
  };
2580
2559
  readonly params: readonly [{
2581
2560
  readonly name: "browseType";
@@ -2807,19 +2786,12 @@ export declare const BUILTIN_MODULES: readonly [{
2807
2786
  readonly display: "获取任务列表,支持获取执行下的任务";
2808
2787
  readonly type: "list";
2809
2788
  readonly method: "get";
2810
- readonly path: "/{scope}/{scopeID}/tasks";
2789
+ readonly path: "/executions/{executionID}/tasks";
2811
2790
  readonly resultType: "list";
2812
2791
  readonly pagerGetter: "pager";
2813
2792
  readonly resultGetter: "tasks";
2814
2793
  readonly pathParams: {
2815
- readonly scope: {
2816
- readonly description: "任务范围";
2817
- readonly options: readonly [{
2818
- readonly value: "executions";
2819
- readonly label: "执行";
2820
- }];
2821
- };
2822
- readonly scopeID: "范围ID";
2794
+ readonly executionID: "所属执行ID";
2823
2795
  };
2824
2796
  readonly params: readonly [{
2825
2797
  readonly name: "status";
@@ -3183,19 +3155,12 @@ export declare const BUILTIN_MODULES: readonly [{
3183
3155
  readonly display: "获取反馈列表,支持获取产品下的反馈";
3184
3156
  readonly type: "list";
3185
3157
  readonly method: "get";
3186
- readonly path: "/{scope}/{scopeID}/feedbacks";
3158
+ readonly path: "/products/{productID}/feedbacks";
3187
3159
  readonly resultType: "list";
3188
3160
  readonly pagerGetter: "pager";
3189
3161
  readonly resultGetter: "feedbacks";
3190
3162
  readonly pathParams: {
3191
- readonly scope: {
3192
- readonly description: "反馈范围";
3193
- readonly options: readonly [{
3194
- readonly value: "products";
3195
- readonly label: "产品";
3196
- }];
3197
- };
3198
- readonly scopeID: "范围ID";
3163
+ readonly productID: "所属产品ID";
3199
3164
  };
3200
3165
  readonly params: readonly [{
3201
3166
  readonly name: "browseType";
@@ -3443,19 +3408,12 @@ export declare const BUILTIN_MODULES: readonly [{
3443
3408
  readonly display: "获取工单列表,支持获取产品下的工单";
3444
3409
  readonly type: "list";
3445
3410
  readonly method: "get";
3446
- readonly path: "/{scope}/{scopeID}/tickets";
3411
+ readonly path: "/products/{productID}/tickets";
3447
3412
  readonly resultType: "list";
3448
3413
  readonly pagerGetter: "pager";
3449
3414
  readonly resultGetter: "tickets";
3450
3415
  readonly pathParams: {
3451
- readonly scope: {
3452
- readonly description: "工单范围";
3453
- readonly options: readonly [{
3454
- readonly value: "products";
3455
- readonly label: "产品";
3456
- }];
3457
- };
3458
- readonly scopeID: "范围ID";
3416
+ readonly productID: "所属产品ID";
3459
3417
  };
3460
3418
  readonly params: readonly [{
3461
3419
  readonly name: "browseType";
@@ -3719,18 +3677,11 @@ export declare const BUILTIN_MODULES: readonly [{
3719
3677
  readonly display: "获取应用列表,支持获取产品下的应用";
3720
3678
  readonly type: "list";
3721
3679
  readonly method: "get";
3722
- readonly path: "/{scope}/{scopeID}/systems";
3680
+ readonly path: "/products/{productID}/systems";
3723
3681
  readonly resultType: "list";
3724
3682
  readonly pagerGetter: "pager";
3725
3683
  readonly pathParams: {
3726
- readonly scope: {
3727
- readonly description: "应用范围";
3728
- readonly options: readonly [{
3729
- readonly value: "products";
3730
- readonly label: "产品";
3731
- }];
3732
- };
3733
- readonly scopeID: "范围ID";
3684
+ readonly productID: "所属产品ID";
3734
3685
  };
3735
3686
  }, {
3736
3687
  readonly name: "create";
@@ -3825,7 +3776,7 @@ export declare const BUILTIN_MODULES: readonly [{
3825
3776
  readonly resultGetter: "builds";
3826
3777
  readonly pathParams: {
3827
3778
  readonly scope: {
3828
- readonly description: "版本范围";
3779
+ readonly description: "版本所属范围";
3829
3780
  readonly options: readonly [{
3830
3781
  readonly value: "projects";
3831
3782
  readonly label: "项目";
@@ -3834,7 +3785,7 @@ export declare const BUILTIN_MODULES: readonly [{
3834
3785
  readonly label: "执行";
3835
3786
  }];
3836
3787
  };
3837
- readonly scopeID: "范围ID";
3788
+ readonly scopeID: "所属范围ID";
3838
3789
  };
3839
3790
  }, {
3840
3791
  readonly name: "create";
@@ -3977,7 +3928,7 @@ export declare const BUILTIN_MODULES: readonly [{
3977
3928
  readonly resultGetter: "testtasks";
3978
3929
  readonly pathParams: {
3979
3930
  readonly scope: {
3980
- readonly description: "测试单范围";
3931
+ readonly description: "测试单所属范围";
3981
3932
  readonly options: readonly [{
3982
3933
  readonly value: "products";
3983
3934
  readonly label: "产品";
@@ -3989,7 +3940,7 @@ export declare const BUILTIN_MODULES: readonly [{
3989
3940
  readonly label: "执行";
3990
3941
  }];
3991
3942
  };
3992
- readonly scopeID: "范围ID";
3943
+ readonly scopeID: "所属范围ID";
3993
3944
  };
3994
3945
  }, {
3995
3946
  readonly name: "create";
@@ -4135,19 +4086,12 @@ export declare const BUILTIN_MODULES: readonly [{
4135
4086
  readonly display: "获取发布列表,支持获取产品下的发布";
4136
4087
  readonly type: "list";
4137
4088
  readonly method: "get";
4138
- readonly path: "/{scope}/{scopeID}/releases";
4089
+ readonly path: "/products/{productID}/releases";
4139
4090
  readonly resultType: "list";
4140
4091
  readonly pagerGetter: "pager";
4141
4092
  readonly resultGetter: "releases";
4142
4093
  readonly pathParams: {
4143
- readonly scope: {
4144
- readonly description: "发布范围";
4145
- readonly options: readonly [{
4146
- readonly value: "products";
4147
- readonly label: "产品";
4148
- }];
4149
- };
4150
- readonly scopeID: "范围ID";
4094
+ readonly productID: "所属产品ID";
4151
4095
  };
4152
4096
  }, {
4153
4097
  readonly name: "create";
@@ -1016,13 +1016,12 @@ export const BUILTIN_MODULES = [
1016
1016
  display: '获取产品计划列表,支持获取产品下的产品计划',
1017
1017
  type: 'list',
1018
1018
  method: 'get',
1019
- path: '/{scope}/{scopeID}/productplans',
1019
+ path: '/products/{productID}/productplans',
1020
1020
  resultType: 'list',
1021
1021
  pagerGetter: 'pager',
1022
1022
  resultGetter: 'productplans',
1023
1023
  pathParams: {
1024
- scope: { description: '产品计划范围', options: [{ value: 'products', label: '产品' }] },
1025
- scopeID: '范围ID',
1024
+ productID: '所属产品ID',
1026
1025
  },
1027
1026
  params: [
1028
1027
  {
@@ -1207,8 +1206,8 @@ export const BUILTIN_MODULES = [
1207
1206
  pagerGetter: 'pager',
1208
1207
  resultGetter: 'stories',
1209
1208
  pathParams: {
1210
- scope: { description: '需求范围', options: [{ value: 'products', label: '产品' }, { value: 'projects', label: '项目' }, { value: 'executions', label: '执行' }] },
1211
- scopeID: '范围ID',
1209
+ scope: { description: '需求所属范围', options: [{ value: 'products', label: '产品' }, { value: 'projects', label: '项目' }, { value: 'executions', label: '执行' }] },
1210
+ scopeID: '所属范围ID',
1212
1211
  },
1213
1212
  params: [
1214
1213
  {
@@ -1529,13 +1528,12 @@ export const BUILTIN_MODULES = [
1529
1528
  display: '获取业务需求列表,支持获取产品下的业务需求',
1530
1529
  type: 'list',
1531
1530
  method: 'get',
1532
- path: '/{scope}/{scopeID}/epics',
1531
+ path: '/products/{productID}/epics',
1533
1532
  resultType: 'list',
1534
1533
  pagerGetter: 'pager',
1535
1534
  resultGetter: 'epics',
1536
1535
  pathParams: {
1537
- scope: { description: '业务需求范围', options: [{ value: 'products', label: '产品' }] },
1538
- scopeID: '范围ID',
1536
+ productID: '所属产品ID',
1539
1537
  },
1540
1538
  params: [
1541
1539
  {
@@ -1847,13 +1845,12 @@ export const BUILTIN_MODULES = [
1847
1845
  display: '获取用户需求列表,支持获取产品下的用户需求',
1848
1846
  type: 'list',
1849
1847
  method: 'get',
1850
- path: '/{scope}/{scopeID}/requirements',
1848
+ path: '/products/{productID}/requirements',
1851
1849
  resultType: 'list',
1852
1850
  pagerGetter: 'pager',
1853
1851
  resultGetter: 'requirements',
1854
1852
  pathParams: {
1855
- scope: { description: '用户需求范围', options: [{ value: 'products', label: '产品' }] },
1856
- scopeID: '范围ID',
1853
+ productID: '所属产品ID',
1857
1854
  },
1858
1855
  params: [
1859
1856
  {
@@ -2159,8 +2156,8 @@ export const BUILTIN_MODULES = [
2159
2156
  pagerGetter: 'pager',
2160
2157
  resultGetter: 'bugs',
2161
2158
  pathParams: {
2162
- scope: { description: 'Bug范围', options: [{ value: 'products', label: '产品' }, { value: 'projects', label: '项目' }, { value: 'executions', label: '执行' }] },
2163
- scopeID: '范围ID',
2159
+ scope: { description: 'Bug所属范围', options: [{ value: 'products', label: '产品' }, { value: 'projects', label: '项目' }, { value: 'executions', label: '执行' }] },
2160
+ scopeID: '所属范围ID',
2164
2161
  },
2165
2162
  params: [
2166
2163
  {
@@ -2476,8 +2473,8 @@ export const BUILTIN_MODULES = [
2476
2473
  pagerGetter: 'pager',
2477
2474
  resultGetter: 'testcases',
2478
2475
  pathParams: {
2479
- scope: { description: '测试用例范围', options: [{ value: 'products', label: '产品' }, { value: 'projects', label: '项目' }, { value: 'executions', label: '执行' }] },
2480
- scopeID: '范围ID',
2476
+ scope: { description: '测试用例所属范围', options: [{ value: 'products', label: '产品' }, { value: 'projects', label: '项目' }, { value: 'executions', label: '执行' }] },
2477
+ scopeID: '所属范围ID',
2481
2478
  },
2482
2479
  params: [
2483
2480
  {
@@ -2707,13 +2704,12 @@ export const BUILTIN_MODULES = [
2707
2704
  display: '获取任务列表,支持获取执行下的任务',
2708
2705
  type: 'list',
2709
2706
  method: 'get',
2710
- path: '/{scope}/{scopeID}/tasks',
2707
+ path: '/executions/{executionID}/tasks',
2711
2708
  resultType: 'list',
2712
2709
  pagerGetter: 'pager',
2713
2710
  resultGetter: 'tasks',
2714
2711
  pathParams: {
2715
- scope: { description: '任务范围', options: [{ value: 'executions', label: '执行' }] },
2716
- scopeID: '范围ID',
2712
+ executionID: '所属执行ID',
2717
2713
  },
2718
2714
  params: [
2719
2715
  {
@@ -3073,13 +3069,12 @@ export const BUILTIN_MODULES = [
3073
3069
  display: '获取反馈列表,支持获取产品下的反馈',
3074
3070
  type: 'list',
3075
3071
  method: 'get',
3076
- path: '/{scope}/{scopeID}/feedbacks',
3072
+ path: '/products/{productID}/feedbacks',
3077
3073
  resultType: 'list',
3078
3074
  pagerGetter: 'pager',
3079
3075
  resultGetter: 'feedbacks',
3080
3076
  pathParams: {
3081
- scope: { description: '反馈范围', options: [{ value: 'products', label: '产品' }] },
3082
- scopeID: '范围ID',
3077
+ productID: '所属产品ID',
3083
3078
  },
3084
3079
  params: [
3085
3080
  {
@@ -3320,13 +3315,12 @@ export const BUILTIN_MODULES = [
3320
3315
  display: '获取工单列表,支持获取产品下的工单',
3321
3316
  type: 'list',
3322
3317
  method: 'get',
3323
- path: '/{scope}/{scopeID}/tickets',
3318
+ path: '/products/{productID}/tickets',
3324
3319
  resultType: 'list',
3325
3320
  pagerGetter: 'pager',
3326
3321
  resultGetter: 'tickets',
3327
3322
  pathParams: {
3328
- scope: { description: '工单范围', options: [{ value: 'products', label: '产品' }] },
3329
- scopeID: '范围ID',
3323
+ productID: '所属产品ID',
3330
3324
  },
3331
3325
  params: [
3332
3326
  {
@@ -3579,12 +3573,11 @@ export const BUILTIN_MODULES = [
3579
3573
  display: '获取应用列表,支持获取产品下的应用',
3580
3574
  type: 'list',
3581
3575
  method: 'get',
3582
- path: '/{scope}/{scopeID}/systems',
3576
+ path: '/products/{productID}/systems',
3583
3577
  resultType: 'list',
3584
3578
  pagerGetter: 'pager',
3585
3579
  pathParams: {
3586
- scope: { description: '应用范围', options: [{ value: 'products', label: '产品' }] },
3587
- scopeID: '范围ID',
3580
+ productID: '所属产品ID',
3588
3581
  },
3589
3582
  }, {
3590
3583
  name: 'create',
@@ -3690,8 +3683,8 @@ export const BUILTIN_MODULES = [
3690
3683
  pagerGetter: 'pager',
3691
3684
  resultGetter: 'builds',
3692
3685
  pathParams: {
3693
- scope: { description: '版本范围', options: [{ value: 'projects', label: '项目' }, { value: 'executions', label: '执行' }] },
3694
- scopeID: '范围ID',
3686
+ scope: { description: '版本所属范围', options: [{ value: 'projects', label: '项目' }, { value: 'executions', label: '执行' }] },
3687
+ scopeID: '所属范围ID',
3695
3688
  },
3696
3689
  }, {
3697
3690
  name: 'create',
@@ -3851,8 +3844,8 @@ export const BUILTIN_MODULES = [
3851
3844
  pagerGetter: 'pager',
3852
3845
  resultGetter: 'testtasks',
3853
3846
  pathParams: {
3854
- scope: { description: '测试单范围', options: [{ value: 'products', label: '产品' }, { value: 'projects', label: '项目' }, { value: 'executions', label: '执行' }] },
3855
- scopeID: '范围ID',
3847
+ scope: { description: '测试单所属范围', options: [{ value: 'products', label: '产品' }, { value: 'projects', label: '项目' }, { value: 'executions', label: '执行' }] },
3848
+ scopeID: '所属范围ID',
3856
3849
  },
3857
3850
  }, {
3858
3851
  name: 'create',
@@ -4013,13 +4006,12 @@ export const BUILTIN_MODULES = [
4013
4006
  display: '获取发布列表,支持获取产品下的发布',
4014
4007
  type: 'list',
4015
4008
  method: 'get',
4016
- path: '/{scope}/{scopeID}/releases',
4009
+ path: '/products/{productID}/releases',
4017
4010
  resultType: 'list',
4018
4011
  pagerGetter: 'pager',
4019
4012
  resultGetter: 'releases',
4020
4013
  pathParams: {
4021
- scope: { description: '发布范围', options: [{ value: 'products', label: '产品' }] },
4022
- scopeID: '范围ID',
4014
+ productID: '所属产品ID',
4023
4015
  },
4024
4016
  }, {
4025
4017
  name: 'create',
@@ -1,4 +1,4 @@
1
- import type { ModuleAction, ModuleDefinition } from '../types/index.js';
1
+ import type { ModuleAction, ModuleActionParam, ModuleActionParamRole, ModuleDefinition } from '../types/index.js';
2
2
  /**
3
3
  * 获取模块定义。
4
4
  *
@@ -27,6 +27,18 @@ export declare function getModule(moduleName: string): ModuleDefinition;
27
27
  * @throws {ZentaoError} `E_INVALID_MODULE`(模块未注册)或 `E_INVALID_ACTION`(动作不存在)。
28
28
  */
29
29
  export declare function getModuleAction(moduleName: string, actionName: string): ModuleAction;
30
+ /**
31
+ * 获取指定模块下的某个动作的参数。
32
+ *
33
+ * @param moduleName - 模块名(大小写不敏感)。
34
+ * @param actionName - 动作名(大小写不敏感);支持 `ls` 作为 `list` 的别名。
35
+ * @param options - 选项。
36
+ * @param options.roles - 角色,可选 `path`、`query`、`body`。
37
+ * @returns 动作参数。
38
+ */
39
+ export declare function getModuleActionParams(moduleName: string, actionName: string, options?: {
40
+ roles?: ModuleActionParamRole[];
41
+ }): ModuleActionParam[];
30
42
  /**
31
43
  * 返回当前运行时注册表中的所有模块名。
32
44
  *
@@ -47,6 +47,65 @@ export function getModuleAction(moduleName, actionName) {
47
47
  }
48
48
  throw new ZentaoError('E_INVALID_ACTION', { module: moduleName, action: actionName });
49
49
  }
50
+ /**
51
+ * 获取指定模块下的某个动作的参数。
52
+ *
53
+ * @param moduleName - 模块名(大小写不敏感)。
54
+ * @param actionName - 动作名(大小写不敏感);支持 `ls` 作为 `list` 的别名。
55
+ * @param options - 选项。
56
+ * @param options.roles - 角色,可选 `path`、`query`、`body`。
57
+ * @returns 动作参数。
58
+ */
59
+ export function getModuleActionParams(moduleName, actionName, options) {
60
+ const { roles } = options ?? {};
61
+ const params = [];
62
+ const action = getModuleAction(moduleName, actionName);
63
+ if (!action) {
64
+ return [];
65
+ }
66
+ if (action.pathParams && (!roles || roles.includes('path'))) {
67
+ Object.entries(action.pathParams).forEach(([name, param]) => {
68
+ if (typeof param === 'string') {
69
+ param = {
70
+ description: param,
71
+ };
72
+ }
73
+ params.push({
74
+ name,
75
+ role: 'path',
76
+ required: true,
77
+ ...param,
78
+ });
79
+ });
80
+ }
81
+ if (action.params && (!roles || roles.includes('query'))) {
82
+ params.push(...action.params.map(x => ({ ...x, role: 'query' })));
83
+ }
84
+ const schema = action.requestBody?.schema;
85
+ if (schema && (!roles || roles.includes('body'))) {
86
+ if (schema.type === 'object') {
87
+ const requiredSet = new Set(schema.required ? schema.required.map(x => x.toLowerCase()) : []);
88
+ Object.entries(schema.properties).forEach(([name, property]) => {
89
+ params.push({
90
+ name,
91
+ role: 'body',
92
+ required: property.required ?? requiredSet.has(name.toLowerCase()),
93
+ type: (property.type === 'integer' ? 'number' : property.type) ?? 'string',
94
+ ...property,
95
+ });
96
+ });
97
+ }
98
+ else {
99
+ params.push({
100
+ name: 'data',
101
+ role: 'body',
102
+ required: true,
103
+ type: schema.type,
104
+ });
105
+ }
106
+ }
107
+ return params;
108
+ }
50
109
  /**
51
110
  * 返回当前运行时注册表中的所有模块名。
52
111
  *