@qingflow-tech/qingflow-cli 1.1.43-beta.3 → 1.1.43-beta.5

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 (39) hide show
  1. package/README.md +3 -3
  2. package/package.json +1 -1
  3. package/pyproject.toml +1 -1
  4. package/skills/qingflow-app-form/SKILL.md +12 -9
  5. package/skills/qingflow-cli/reference/builder/30-schema-fields.md +15 -13
  6. package/src/qingflow_mcp/app_form_compat.py +11 -27
  7. package/src/qingflow_mcp/app_form_validator.py +298 -35
  8. package/src/qingflow_mcp/builder_facade/app_form.py +777 -150
  9. package/src/qingflow_mcp/builder_facade/app_form_schema.py +164 -8
  10. package/src/qingflow_mcp/builder_facade/schemas/app_form/manifest.json +5 -0
  11. package/src/qingflow_mcp/builder_facade/schemas/app_form/v1alpha1/complete.json +299 -239
  12. package/src/qingflow_mcp/builder_facade/schemas/app_form/v1alpha1/fields/address.json +82 -27
  13. package/src/qingflow_mcp/builder_facade/schemas/app_form/v1alpha1/fields/amount.json +82 -27
  14. package/src/qingflow_mcp/builder_facade/schemas/app_form/v1alpha1/fields/attachment.json +82 -30
  15. package/src/qingflow_mcp/builder_facade/schemas/app_form/v1alpha1/fields/code_block.json +113 -37
  16. package/src/qingflow_mcp/builder_facade/schemas/app_form/v1alpha1/fields/data_relation.json +87 -64
  17. package/src/qingflow_mcp/builder_facade/schemas/app_form/v1alpha1/fields/date.json +82 -27
  18. package/src/qingflow_mcp/builder_facade/schemas/app_form/v1alpha1/fields/datetime.json +82 -27
  19. package/src/qingflow_mcp/builder_facade/schemas/app_form/v1alpha1/fields/department.json +83 -28
  20. package/src/qingflow_mcp/builder_facade/schemas/app_form/v1alpha1/fields/email.json +82 -27
  21. package/src/qingflow_mcp/builder_facade/schemas/app_form/v1alpha1/fields/link.json +82 -27
  22. package/src/qingflow_mcp/builder_facade/schemas/app_form/v1alpha1/fields/long_text.json +82 -27
  23. package/src/qingflow_mcp/builder_facade/schemas/app_form/v1alpha1/fields/member.json +83 -28
  24. package/src/qingflow_mcp/builder_facade/schemas/app_form/v1alpha1/fields/multi_select.json +82 -27
  25. package/src/qingflow_mcp/builder_facade/schemas/app_form/v1alpha1/fields/number.json +82 -27
  26. package/src/qingflow_mcp/builder_facade/schemas/app_form/v1alpha1/fields/phone.json +82 -27
  27. package/src/qingflow_mcp/builder_facade/schemas/app_form/v1alpha1/fields/q_linker.json +95 -40
  28. package/src/qingflow_mcp/builder_facade/schemas/app_form/v1alpha1/fields/relation.json +100 -28
  29. package/src/qingflow_mcp/builder_facade/schemas/app_form/v1alpha1/fields/single_choice.json +82 -27
  30. package/src/qingflow_mcp/builder_facade/schemas/app_form/v1alpha1/fields/single_select.json +82 -27
  31. package/src/qingflow_mcp/builder_facade/schemas/app_form/v1alpha1/fields/subtable.json +201 -111
  32. package/src/qingflow_mcp/builder_facade/schemas/app_form/v1alpha1/fields/text.json +82 -27
  33. package/src/qingflow_mcp/builder_facade/schemas/app_form/v1alpha1/formula.json +1594 -0
  34. package/src/qingflow_mcp/builder_facade/schemas/app_form/v1alpha1/summary.json +143 -161
  35. package/src/qingflow_mcp/builder_facade/service.py +3 -2
  36. package/src/qingflow_mcp/cli/commands/builder.py +2 -0
  37. package/src/qingflow_mcp/response_trim.py +2 -0
  38. package/src/qingflow_mcp/server_app_builder.py +9 -4
  39. package/src/qingflow_mcp/tools/ai_builder_tools.py +13 -3
@@ -1,15 +1,71 @@
1
1
  {
2
2
  "$defs": {
3
3
  "FieldCommon": {
4
+ "allOf": [
5
+ {
6
+ "if": {
7
+ "properties": {
8
+ "defaultType": {
9
+ "const": 2
10
+ }
11
+ },
12
+ "required": [
13
+ "defaultType"
14
+ ]
15
+ },
16
+ "then": {
17
+ "properties": {
18
+ "defaultValue": {
19
+ "type": "null"
20
+ }
21
+ }
22
+ }
23
+ },
24
+ {
25
+ "if": {
26
+ "properties": {
27
+ "defaultType": {
28
+ "const": 3
29
+ }
30
+ },
31
+ "required": [
32
+ "defaultType"
33
+ ]
34
+ },
35
+ "then": {
36
+ "properties": {
37
+ "defaultValue": {
38
+ "minLength": 1,
39
+ "type": [
40
+ "string",
41
+ "null"
42
+ ]
43
+ }
44
+ }
45
+ }
46
+ }
47
+ ],
48
+ "anyOf": [
49
+ {
50
+ "required": [
51
+ "queId"
52
+ ]
53
+ },
54
+ {
55
+ "required": [
56
+ "name"
57
+ ]
58
+ }
59
+ ],
4
60
  "description": "顶层业务字段的公共属性;字段类型由 TopField 的判别分支定义。",
5
61
  "properties": {
6
- "dataTitle": {
7
- "description": "是否作为数据标题;整个 body 最多且必须按规则存在一个。",
62
+ "beingRequired": {
63
+ "description": "该字段是否必填;缺失时保留已有字段当前值。",
8
64
  "type": "boolean"
9
65
  },
10
66
  "defaultType": {
11
67
  "default": 1,
12
- "description": "默认值类型;1 表示静态值,2 表示关联/绑定值,3 表示公式值。",
68
+ "description": "默认值类型,与 defaultValue 联动;1 表示静态值,2 表示关联/绑定值且 defaultValue 只能省略或为 null,3 表示公式值且提供 defaultValue 时必须为非空公式文本。省略 defaultType 但提供 defaultValue 时按 1 处理。",
13
69
  "enum": [
14
70
  1,
15
71
  2,
@@ -19,47 +75,46 @@
19
75
  },
20
76
  "defaultValue": {
21
77
  "$ref": "#/$defs/ScalarDefaultValue",
22
- "description": "普通字段的标量默认值;表格、地址、附件、引用等结构化默认值必须放在具体字段 config.defaultValues。显式 null 表示清除默认值。"
23
- },
24
- "description": {
25
- "description": "字段说明;null 或空字符串表示清空。",
26
- "type": [
27
- "string",
28
- "null"
29
- ]
78
+ "description": "普通字段的默认值;后端 queDefaultValue 为字符串,因此数字等字面量也必须以字符串传入。defaultType 为 1 时表示静态文本,为 3 时表示公式文本,为 2 时不携带字面量默认值。表格、地址、附件、引用等结构化默认值必须放在具体字段 config.defaultValues。显式 null 表示清除默认值。"
30
79
  },
31
80
  "name": {
32
- "description": "字段展示名称;同一父级内唯一,不单独作为字段身份。",
81
+ "description": "字段展示名称;新增字段必填,已有字段可在携带 queId 时省略;同一父级内唯一。",
33
82
  "minLength": 1,
34
83
  "type": "string"
35
84
  },
36
85
  "queId": {
37
- "description": "已有字段的后端 ID;get 返回,新增字段省略。",
86
+ "description": "已有字段的后端 ID;更新时用于精确定位并复用,新增字段通常省略。",
38
87
  "minimum": 1,
39
88
  "type": "integer"
40
89
  },
41
- "required": {
42
- "description": "是否必填;缺失时保留已有字段当前值。",
43
- "type": "boolean"
90
+ "questionDescription": {
91
+ "description": "字段说明;null 或空字符串表示清空。",
92
+ "type": [
93
+ "string",
94
+ "null"
95
+ ]
96
+ },
97
+ "questionType": {
98
+ "description": "字段类型;具体可用值由当前字段详情 Schema 的判别分支约束。",
99
+ "type": "string"
44
100
  },
45
101
  "width": {
46
- "description": "字段在所在行的宽度百分比;同一行要么全部提供且合计 100,要么全部省略。",
47
- "maximum": 100,
48
- "minimum": 1,
102
+ "description": "字段在所在行的宽度百分比;只能选择 25、50、75 或 100。",
103
+ "enum": [
104
+ 25,
105
+ 50,
106
+ 75,
107
+ 100
108
+ ],
49
109
  "type": "integer"
50
110
  }
51
111
  },
52
- "required": [
53
- "name"
54
- ],
55
112
  "type": "object"
56
113
  },
57
114
  "ScalarDefaultValue": {
58
- "description": "不包含对象或数组的普通字段默认值。",
115
+ "description": "后端 queDefaultValue 支持的普通字段默认值;非空值必须是字符串,显式 null 表示清除默认值。数字和布尔值应先转换为字符串,对象和数组必须使用字段专用默认值配置。defaultType 为 3 时,通过 AppForm Schema 查询能力传入当前 schema_version 并设置 schema_kind=formula 获取公式语法、字段引用、运算符和全部函数说明;CLI 使用 builder app-form schema --schema-kind formula。需要配置结构化默认值时,传入当前 schema_version,并将字段的 questionType 作为 field_type 获取字段详细 Schema。",
59
116
  "type": [
60
117
  "null",
61
- "boolean",
62
- "number",
63
118
  "string"
64
119
  ]
65
120
  },
@@ -120,12 +175,12 @@
120
175
  "config": {
121
176
  "$ref": "#/$defs/TextConfig"
122
177
  },
123
- "type": {
178
+ "questionType": {
124
179
  "const": "long_text"
125
180
  }
126
181
  },
127
182
  "required": [
128
- "type"
183
+ "questionType"
129
184
  ]
130
185
  }
131
186
  ],
@@ -73,15 +73,71 @@
73
73
  "type": "object"
74
74
  },
75
75
  "FieldCommon": {
76
+ "allOf": [
77
+ {
78
+ "if": {
79
+ "properties": {
80
+ "defaultType": {
81
+ "const": 2
82
+ }
83
+ },
84
+ "required": [
85
+ "defaultType"
86
+ ]
87
+ },
88
+ "then": {
89
+ "properties": {
90
+ "defaultValue": {
91
+ "type": "null"
92
+ }
93
+ }
94
+ }
95
+ },
96
+ {
97
+ "if": {
98
+ "properties": {
99
+ "defaultType": {
100
+ "const": 3
101
+ }
102
+ },
103
+ "required": [
104
+ "defaultType"
105
+ ]
106
+ },
107
+ "then": {
108
+ "properties": {
109
+ "defaultValue": {
110
+ "minLength": 1,
111
+ "type": [
112
+ "string",
113
+ "null"
114
+ ]
115
+ }
116
+ }
117
+ }
118
+ }
119
+ ],
120
+ "anyOf": [
121
+ {
122
+ "required": [
123
+ "queId"
124
+ ]
125
+ },
126
+ {
127
+ "required": [
128
+ "name"
129
+ ]
130
+ }
131
+ ],
76
132
  "description": "顶层业务字段的公共属性;字段类型由 TopField 的判别分支定义。",
77
133
  "properties": {
78
- "dataTitle": {
79
- "description": "是否作为数据标题;整个 body 最多且必须按规则存在一个。",
134
+ "beingRequired": {
135
+ "description": "该字段是否必填;缺失时保留已有字段当前值。",
80
136
  "type": "boolean"
81
137
  },
82
138
  "defaultType": {
83
139
  "default": 1,
84
- "description": "默认值类型;1 表示静态值,2 表示关联/绑定值,3 表示公式值。",
140
+ "description": "默认值类型,与 defaultValue 联动;1 表示静态值,2 表示关联/绑定值且 defaultValue 只能省略或为 null,3 表示公式值且提供 defaultValue 时必须为非空公式文本。省略 defaultType 但提供 defaultValue 时按 1 处理。",
85
141
  "enum": [
86
142
  1,
87
143
  2,
@@ -91,39 +147,40 @@
91
147
  },
92
148
  "defaultValue": {
93
149
  "$ref": "#/$defs/ScalarDefaultValue",
94
- "description": "普通字段的标量默认值;表格、地址、附件、引用等结构化默认值必须放在具体字段 config.defaultValues。显式 null 表示清除默认值。"
95
- },
96
- "description": {
97
- "description": "字段说明;null 或空字符串表示清空。",
98
- "type": [
99
- "string",
100
- "null"
101
- ]
150
+ "description": "普通字段的默认值;后端 queDefaultValue 为字符串,因此数字等字面量也必须以字符串传入。defaultType 为 1 时表示静态文本,为 3 时表示公式文本,为 2 时不携带字面量默认值。表格、地址、附件、引用等结构化默认值必须放在具体字段 config.defaultValues。显式 null 表示清除默认值。"
102
151
  },
103
152
  "name": {
104
- "description": "字段展示名称;同一父级内唯一,不单独作为字段身份。",
153
+ "description": "字段展示名称;新增字段必填,已有字段可在携带 queId 时省略;同一父级内唯一。",
105
154
  "minLength": 1,
106
155
  "type": "string"
107
156
  },
108
157
  "queId": {
109
- "description": "已有字段的后端 ID;get 返回,新增字段省略。",
158
+ "description": "已有字段的后端 ID;更新时用于精确定位并复用,新增字段通常省略。",
110
159
  "minimum": 1,
111
160
  "type": "integer"
112
161
  },
113
- "required": {
114
- "description": "是否必填;缺失时保留已有字段当前值。",
115
- "type": "boolean"
162
+ "questionDescription": {
163
+ "description": "字段说明;null 或空字符串表示清空。",
164
+ "type": [
165
+ "string",
166
+ "null"
167
+ ]
168
+ },
169
+ "questionType": {
170
+ "description": "字段类型;具体可用值由当前字段详情 Schema 的判别分支约束。",
171
+ "type": "string"
116
172
  },
117
173
  "width": {
118
- "description": "字段在所在行的宽度百分比;同一行要么全部提供且合计 100,要么全部省略。",
119
- "maximum": 100,
120
- "minimum": 1,
174
+ "description": "字段在所在行的宽度百分比;只能选择 25、50、75 或 100。",
175
+ "enum": [
176
+ 25,
177
+ 50,
178
+ 75,
179
+ 100
180
+ ],
121
181
  "type": "integer"
122
182
  }
123
183
  },
124
- "required": [
125
- "name"
126
- ],
127
184
  "type": "object"
128
185
  },
129
186
  "FieldSelector": {
@@ -140,7 +197,7 @@
140
197
  ]
141
198
  }
142
199
  ],
143
- "description": "跨字段引用选择器;至少提供 queId 或 name,两者同时提供时必须指向同一字段。",
200
+ "description": "字段选择器;用于定位应用的数据标题、数据封面、自定义编号取值来源或其他配置引用的字段。至少提供 queId 或 name,两者同时提供时必须指向同一字段。",
144
201
  "properties": {
145
202
  "name": {
146
203
  "description": "字段名称;仅在当前作用域内唯一时可用于解析。",
@@ -347,11 +404,9 @@
347
404
  "type": "object"
348
405
  },
349
406
  "ScalarDefaultValue": {
350
- "description": "不包含对象或数组的普通字段默认值。",
407
+ "description": "后端 queDefaultValue 支持的普通字段默认值;非空值必须是字符串,显式 null 表示清除默认值。数字和布尔值应先转换为字符串,对象和数组必须使用字段专用默认值配置。defaultType 为 3 时,通过 AppForm Schema 查询能力传入当前 schema_version 并设置 schema_kind=formula 获取公式语法、字段引用、运算符和全部函数说明;CLI 使用 builder app-form schema --schema-kind formula。需要配置结构化默认值时,传入当前 schema_version,并将字段的 questionType 作为 field_type 获取字段详细 Schema。",
351
408
  "type": [
352
409
  "null",
353
- "boolean",
354
- "number",
355
410
  "string"
356
411
  ]
357
412
  },
@@ -414,12 +469,12 @@
414
469
  "config": {
415
470
  "$ref": "#/$defs/MemberConfig"
416
471
  },
417
- "type": {
472
+ "questionType": {
418
473
  "const": "member"
419
474
  }
420
475
  },
421
476
  "required": [
422
- "type"
477
+ "questionType"
423
478
  ]
424
479
  }
425
480
  ],
@@ -69,15 +69,71 @@
69
69
  "type": "object"
70
70
  },
71
71
  "FieldCommon": {
72
+ "allOf": [
73
+ {
74
+ "if": {
75
+ "properties": {
76
+ "defaultType": {
77
+ "const": 2
78
+ }
79
+ },
80
+ "required": [
81
+ "defaultType"
82
+ ]
83
+ },
84
+ "then": {
85
+ "properties": {
86
+ "defaultValue": {
87
+ "type": "null"
88
+ }
89
+ }
90
+ }
91
+ },
92
+ {
93
+ "if": {
94
+ "properties": {
95
+ "defaultType": {
96
+ "const": 3
97
+ }
98
+ },
99
+ "required": [
100
+ "defaultType"
101
+ ]
102
+ },
103
+ "then": {
104
+ "properties": {
105
+ "defaultValue": {
106
+ "minLength": 1,
107
+ "type": [
108
+ "string",
109
+ "null"
110
+ ]
111
+ }
112
+ }
113
+ }
114
+ }
115
+ ],
116
+ "anyOf": [
117
+ {
118
+ "required": [
119
+ "queId"
120
+ ]
121
+ },
122
+ {
123
+ "required": [
124
+ "name"
125
+ ]
126
+ }
127
+ ],
72
128
  "description": "顶层业务字段的公共属性;字段类型由 TopField 的判别分支定义。",
73
129
  "properties": {
74
- "dataTitle": {
75
- "description": "是否作为数据标题;整个 body 最多且必须按规则存在一个。",
130
+ "beingRequired": {
131
+ "description": "该字段是否必填;缺失时保留已有字段当前值。",
76
132
  "type": "boolean"
77
133
  },
78
134
  "defaultType": {
79
135
  "default": 1,
80
- "description": "默认值类型;1 表示静态值,2 表示关联/绑定值,3 表示公式值。",
136
+ "description": "默认值类型,与 defaultValue 联动;1 表示静态值,2 表示关联/绑定值且 defaultValue 只能省略或为 null,3 表示公式值且提供 defaultValue 时必须为非空公式文本。省略 defaultType 但提供 defaultValue 时按 1 处理。",
81
137
  "enum": [
82
138
  1,
83
139
  2,
@@ -87,47 +143,46 @@
87
143
  },
88
144
  "defaultValue": {
89
145
  "$ref": "#/$defs/ScalarDefaultValue",
90
- "description": "普通字段的标量默认值;表格、地址、附件、引用等结构化默认值必须放在具体字段 config.defaultValues。显式 null 表示清除默认值。"
91
- },
92
- "description": {
93
- "description": "字段说明;null 或空字符串表示清空。",
94
- "type": [
95
- "string",
96
- "null"
97
- ]
146
+ "description": "普通字段的默认值;后端 queDefaultValue 为字符串,因此数字等字面量也必须以字符串传入。defaultType 为 1 时表示静态文本,为 3 时表示公式文本,为 2 时不携带字面量默认值。表格、地址、附件、引用等结构化默认值必须放在具体字段 config.defaultValues。显式 null 表示清除默认值。"
98
147
  },
99
148
  "name": {
100
- "description": "字段展示名称;同一父级内唯一,不单独作为字段身份。",
149
+ "description": "字段展示名称;新增字段必填,已有字段可在携带 queId 时省略;同一父级内唯一。",
101
150
  "minLength": 1,
102
151
  "type": "string"
103
152
  },
104
153
  "queId": {
105
- "description": "已有字段的后端 ID;get 返回,新增字段省略。",
154
+ "description": "已有字段的后端 ID;更新时用于精确定位并复用,新增字段通常省略。",
106
155
  "minimum": 1,
107
156
  "type": "integer"
108
157
  },
109
- "required": {
110
- "description": "是否必填;缺失时保留已有字段当前值。",
111
- "type": "boolean"
158
+ "questionDescription": {
159
+ "description": "字段说明;null 或空字符串表示清空。",
160
+ "type": [
161
+ "string",
162
+ "null"
163
+ ]
164
+ },
165
+ "questionType": {
166
+ "description": "字段类型;具体可用值由当前字段详情 Schema 的判别分支约束。",
167
+ "type": "string"
112
168
  },
113
169
  "width": {
114
- "description": "字段在所在行的宽度百分比;同一行要么全部提供且合计 100,要么全部省略。",
115
- "maximum": 100,
116
- "minimum": 1,
170
+ "description": "字段在所在行的宽度百分比;只能选择 25、50、75 或 100。",
171
+ "enum": [
172
+ 25,
173
+ 50,
174
+ 75,
175
+ 100
176
+ ],
117
177
  "type": "integer"
118
178
  }
119
179
  },
120
- "required": [
121
- "name"
122
- ],
123
180
  "type": "object"
124
181
  },
125
182
  "ScalarDefaultValue": {
126
- "description": "不包含对象或数组的普通字段默认值。",
183
+ "description": "后端 queDefaultValue 支持的普通字段默认值;非空值必须是字符串,显式 null 表示清除默认值。数字和布尔值应先转换为字符串,对象和数组必须使用字段专用默认值配置。defaultType 为 3 时,通过 AppForm Schema 查询能力传入当前 schema_version 并设置 schema_kind=formula 获取公式语法、字段引用、运算符和全部函数说明;CLI 使用 builder app-form schema --schema-kind formula。需要配置结构化默认值时,传入当前 schema_version,并将字段的 questionType 作为 field_type 获取字段详细 Schema。",
127
184
  "type": [
128
185
  "null",
129
- "boolean",
130
- "number",
131
186
  "string"
132
187
  ]
133
188
  }
@@ -143,12 +198,12 @@
143
198
  "config": {
144
199
  "$ref": "#/$defs/ChoiceConfig"
145
200
  },
146
- "type": {
201
+ "questionType": {
147
202
  "const": "multi_select"
148
203
  }
149
204
  },
150
205
  "required": [
151
- "type",
206
+ "questionType",
152
207
  "config"
153
208
  ]
154
209
  }
@@ -1,15 +1,71 @@
1
1
  {
2
2
  "$defs": {
3
3
  "FieldCommon": {
4
+ "allOf": [
5
+ {
6
+ "if": {
7
+ "properties": {
8
+ "defaultType": {
9
+ "const": 2
10
+ }
11
+ },
12
+ "required": [
13
+ "defaultType"
14
+ ]
15
+ },
16
+ "then": {
17
+ "properties": {
18
+ "defaultValue": {
19
+ "type": "null"
20
+ }
21
+ }
22
+ }
23
+ },
24
+ {
25
+ "if": {
26
+ "properties": {
27
+ "defaultType": {
28
+ "const": 3
29
+ }
30
+ },
31
+ "required": [
32
+ "defaultType"
33
+ ]
34
+ },
35
+ "then": {
36
+ "properties": {
37
+ "defaultValue": {
38
+ "minLength": 1,
39
+ "type": [
40
+ "string",
41
+ "null"
42
+ ]
43
+ }
44
+ }
45
+ }
46
+ }
47
+ ],
48
+ "anyOf": [
49
+ {
50
+ "required": [
51
+ "queId"
52
+ ]
53
+ },
54
+ {
55
+ "required": [
56
+ "name"
57
+ ]
58
+ }
59
+ ],
4
60
  "description": "顶层业务字段的公共属性;字段类型由 TopField 的判别分支定义。",
5
61
  "properties": {
6
- "dataTitle": {
7
- "description": "是否作为数据标题;整个 body 最多且必须按规则存在一个。",
62
+ "beingRequired": {
63
+ "description": "该字段是否必填;缺失时保留已有字段当前值。",
8
64
  "type": "boolean"
9
65
  },
10
66
  "defaultType": {
11
67
  "default": 1,
12
- "description": "默认值类型;1 表示静态值,2 表示关联/绑定值,3 表示公式值。",
68
+ "description": "默认值类型,与 defaultValue 联动;1 表示静态值,2 表示关联/绑定值且 defaultValue 只能省略或为 null,3 表示公式值且提供 defaultValue 时必须为非空公式文本。省略 defaultType 但提供 defaultValue 时按 1 处理。",
13
69
  "enum": [
14
70
  1,
15
71
  2,
@@ -19,39 +75,40 @@
19
75
  },
20
76
  "defaultValue": {
21
77
  "$ref": "#/$defs/ScalarDefaultValue",
22
- "description": "普通字段的标量默认值;表格、地址、附件、引用等结构化默认值必须放在具体字段 config.defaultValues。显式 null 表示清除默认值。"
23
- },
24
- "description": {
25
- "description": "字段说明;null 或空字符串表示清空。",
26
- "type": [
27
- "string",
28
- "null"
29
- ]
78
+ "description": "普通字段的默认值;后端 queDefaultValue 为字符串,因此数字等字面量也必须以字符串传入。defaultType 为 1 时表示静态文本,为 3 时表示公式文本,为 2 时不携带字面量默认值。表格、地址、附件、引用等结构化默认值必须放在具体字段 config.defaultValues。显式 null 表示清除默认值。"
30
79
  },
31
80
  "name": {
32
- "description": "字段展示名称;同一父级内唯一,不单独作为字段身份。",
81
+ "description": "字段展示名称;新增字段必填,已有字段可在携带 queId 时省略;同一父级内唯一。",
33
82
  "minLength": 1,
34
83
  "type": "string"
35
84
  },
36
85
  "queId": {
37
- "description": "已有字段的后端 ID;get 返回,新增字段省略。",
86
+ "description": "已有字段的后端 ID;更新时用于精确定位并复用,新增字段通常省略。",
38
87
  "minimum": 1,
39
88
  "type": "integer"
40
89
  },
41
- "required": {
42
- "description": "是否必填;缺失时保留已有字段当前值。",
43
- "type": "boolean"
90
+ "questionDescription": {
91
+ "description": "字段说明;null 或空字符串表示清空。",
92
+ "type": [
93
+ "string",
94
+ "null"
95
+ ]
96
+ },
97
+ "questionType": {
98
+ "description": "字段类型;具体可用值由当前字段详情 Schema 的判别分支约束。",
99
+ "type": "string"
44
100
  },
45
101
  "width": {
46
- "description": "字段在所在行的宽度百分比;同一行要么全部提供且合计 100,要么全部省略。",
47
- "maximum": 100,
48
- "minimum": 1,
102
+ "description": "字段在所在行的宽度百分比;只能选择 25、50、75 或 100。",
103
+ "enum": [
104
+ 25,
105
+ 50,
106
+ 75,
107
+ 100
108
+ ],
49
109
  "type": "integer"
50
110
  }
51
111
  },
52
- "required": [
53
- "name"
54
- ],
55
112
  "type": "object"
56
113
  },
57
114
  "NumberConfig": {
@@ -146,11 +203,9 @@
146
203
  "type": "object"
147
204
  },
148
205
  "ScalarDefaultValue": {
149
- "description": "不包含对象或数组的普通字段默认值。",
206
+ "description": "后端 queDefaultValue 支持的普通字段默认值;非空值必须是字符串,显式 null 表示清除默认值。数字和布尔值应先转换为字符串,对象和数组必须使用字段专用默认值配置。defaultType 为 3 时,通过 AppForm Schema 查询能力传入当前 schema_version 并设置 schema_kind=formula 获取公式语法、字段引用、运算符和全部函数说明;CLI 使用 builder app-form schema --schema-kind formula。需要配置结构化默认值时,传入当前 schema_version,并将字段的 questionType 作为 field_type 获取字段详细 Schema。",
150
207
  "type": [
151
208
  "null",
152
- "boolean",
153
- "number",
154
209
  "string"
155
210
  ]
156
211
  }
@@ -166,12 +221,12 @@
166
221
  "config": {
167
222
  "$ref": "#/$defs/NumberConfig"
168
223
  },
169
- "type": {
224
+ "questionType": {
170
225
  "const": "number"
171
226
  }
172
227
  },
173
228
  "required": [
174
- "type"
229
+ "questionType"
175
230
  ]
176
231
  }
177
232
  ],