mirror of
https://github.com/fawney19/Aether.git
synced 2026-09-02 09:20:22 +08:00
feat(body_rules): 支持通配符路径、范围索引、name_style action 和 $item 条件引用
- 路径语法新增 [*] 通配符(遍历所有元素)和 [N-M] 范围索引 - 新增 name_style action,支持 snake_case/camelCase/PascalCase/kebab-case/capitalize 风格转换 - condition 支持 $item.xxx 引用通配符当前元素,实现逐元素条件过滤 - 前端同步更新类型定义、表单 UI 和帮助文档 - 提取 isBodyRuleEffective 函数消除重复的规则有效性判断逻辑
This commit is contained in:
@@ -135,7 +135,19 @@ export interface BodyRuleCondition {
|
||||
value?: any // exists / not_exists 不需要 value
|
||||
}
|
||||
|
||||
export type BodyRule = (BodyRuleSet | BodyRuleDrop | BodyRuleRename | BodyRuleAppend | BodyRuleInsert | BodyRuleRegexReplace) & {
|
||||
/**
|
||||
* 请求体规则 - 转换命名风格
|
||||
*
|
||||
* - path 指向目标字符串字段,支持通配符如 "tools[*].name"
|
||||
* - style 为目标命名风格
|
||||
*/
|
||||
export interface BodyRuleNameStyle {
|
||||
action: 'name_style'
|
||||
path: string
|
||||
style: 'snake_case' | 'camelCase' | 'PascalCase' | 'kebab-case' | 'capitalize'
|
||||
}
|
||||
|
||||
export type BodyRule = (BodyRuleSet | BodyRuleDrop | BodyRuleRename | BodyRuleAppend | BodyRuleInsert | BodyRuleRegexReplace | BodyRuleNameStyle) & {
|
||||
condition?: BodyRuleCondition
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user