@qingflow-tech/qingflow-cli 1.1.50-beta.2 → 1.1.50-beta.3
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.
- package/README.md +3 -3
- package/package.json +1 -1
- package/pyproject.toml +7 -2
- package/skills/qingflow-cli/SKILL.md +74 -0
- package/skills/qingflow-cli/reference/QINGFLOW_CLI_BUILDER_VIEWS_WORKFLOW.md +3 -9
- package/skills/qingflow-cli/reference/builder/20-build-complete-system.md +1 -0
- package/skills/qingflow-cli/reference/builder/50-views.md +176 -190
- package/skills/qingflow-cli/reference/builder/README.md +1 -1
- package/skills/qingflow-cli/reference/builder/reference/app-delivery-sop.md +3 -3
- package/skills/qingflow-cli/reference/examples/README.md +1 -1
- package/skills/qingflow-cli/reference/examples/views/views_apply_v1alpha1.example.json +14 -0
- package/skills/qingflow-cli/reference/examples/views/views_upsert_table_minimal.example.json +30 -36
- package/src/qingflow_mcp/builder_facade/models.py +208 -17
- package/src/qingflow_mcp/builder_facade/schemas/views/manifest.json +43 -0
- package/src/qingflow_mcp/builder_facade/schemas/views/v1alpha1/complete.json +1193 -0
- package/src/qingflow_mcp/builder_facade/schemas/views/v1alpha1/details/button-config.json +53 -0
- package/src/qingflow_mcp/builder_facade/schemas/views/v1alpha1/details/data-permission.json +60 -0
- package/src/qingflow_mcp/builder_facade/schemas/views/v1alpha1/details/display.json +71 -0
- package/src/qingflow_mcp/builder_facade/schemas/views/v1alpha1/details/operation-permission.json +48 -0
- package/src/qingflow_mcp/builder_facade/schemas/views/v1alpha1/details/query-condition.json +47 -0
- package/src/qingflow_mcp/builder_facade/schemas/views/v1alpha1/summary.json +274 -0
- package/src/qingflow_mcp/builder_facade/service.py +1427 -410
- package/src/qingflow_mcp/builder_facade/views_extract.py +572 -0
- package/src/qingflow_mcp/builder_facade/views_schema.py +400 -0
- package/src/qingflow_mcp/cli/commands/builder.py +72 -53
- package/src/qingflow_mcp/public_surface.py +3 -0
- package/src/qingflow_mcp/response_trim.py +11 -2
- package/src/qingflow_mcp/server_app_builder.py +32 -8
- package/src/qingflow_mcp/solution/executor.py +93 -7
- package/src/qingflow_mcp/tools/ai_builder_tools.py +211 -393
- package/src/qingflow_mcp/tools/solution_tools.py +2 -0
- package/src/qingflow_mcp/tools/view_tools.py +0 -6
- package/src/qingflow_mcp/tools/view_writer.py +44 -0
- package/skills/qingflow-cli/reference/examples/views/views_batch_full.example.json +0 -159
- package/skills/qingflow-cli/reference/views_upsert_table_minimal.example.json +0 -42
|
@@ -7,7 +7,7 @@ Use these files as copyable bases after reading the matching resource document.
|
|
|
7
7
|
| Historical single-app schema probe | [schema/schema_single_app_form_standard.example.json](./schema/schema_single_app_form_standard.example.json) | Retired `--form-file` shape; use `builder app-form schema/get/validate/apply` for current declarations. |
|
|
8
8
|
| Historical multi-app schema probe | [schema/schema_multi_app_form_relation_layout.example.json](./schema/schema_multi_app_form_relation_layout.example.json) | Retired `--apps-file` shape; current systems create independent AppForms and then bind confirmed app keys. |
|
|
9
9
|
| Existing-app layout probe | [layout/layout_sections_full.example.json](./layout/layout_sections_full.example.json) | Historical layout-patch shape; current new and existing forms use the complete AppForm `spec.body`. |
|
|
10
|
-
| Views | [views/views_upsert_table_minimal.example.json](./views/views_upsert_table_minimal.example.json), [views/
|
|
10
|
+
| Views | [views/views_upsert_table_minimal.example.json](./views/views_upsert_table_minimal.example.json), [views/views_apply_v1alpha1.example.json](./views/views_apply_v1alpha1.example.json) | 单视图 JSON 对象,包含筛选、查询面板和视图绑定按钮;通过 `--app-key` 指定应用。 |
|
|
11
11
|
| Charts | [charts/charts_upsert_dashboard_starter.example.json](./charts/charts_upsert_dashboard_starter.example.json) | Standalone chart apply; portal usually creates missing charts inline. |
|
|
12
12
|
| Portal | [portal/portal_sections_standard_workbench.example.json](./portal/portal_sections_standard_workbench.example.json) | Standard workbench with inline QingBI charts and data views. |
|
|
13
13
|
| Associated resources | [associated/associated_resources_semantic_full.example.json](./associated/associated_resources_semantic_full.example.json) | Current-record matching through `match_mappings`. |
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "项目台账视图",
|
|
3
|
+
"type": "table",
|
|
4
|
+
"columns": [100, 101, 102, 103],
|
|
5
|
+
"data_permission": {"type": "custom", "scope": "dept"},
|
|
6
|
+
"sort": [{"que_id": 100, "ascending": false}],
|
|
7
|
+
"display": {"row_height": "compact", "pin_navigate": true},
|
|
8
|
+
"query_conditions": {
|
|
9
|
+
"enabled": true,
|
|
10
|
+
"exact": false,
|
|
11
|
+
"hide_before_query": false,
|
|
12
|
+
"rows": [["项目名称", "负责人"], ["创建时间"]]
|
|
13
|
+
}
|
|
14
|
+
}
|
package/skills/qingflow-cli/reference/examples/views/views_upsert_table_minimal.example.json
CHANGED
|
@@ -1,42 +1,36 @@
|
|
|
1
1
|
{
|
|
2
|
-
"
|
|
2
|
+
"name": "示例业务操作视图_CLI模板",
|
|
3
|
+
"type": "table",
|
|
4
|
+
"columns": [100, 101, 102, 103],
|
|
5
|
+
"filters": [
|
|
6
|
+
{"que_id": 100, "operator": "neq", "value": "已关闭"}
|
|
7
|
+
],
|
|
8
|
+
"query_conditions": {
|
|
9
|
+
"enabled": true,
|
|
10
|
+
"exact": false,
|
|
11
|
+
"hide_before_query": false,
|
|
12
|
+
"rows": [["主记录编号", "主记录名称"], ["状态", "负责人"]]
|
|
13
|
+
},
|
|
14
|
+
"action_buttons": [
|
|
3
15
|
{
|
|
4
|
-
"
|
|
5
|
-
"
|
|
6
|
-
"
|
|
7
|
-
"
|
|
8
|
-
|
|
9
|
-
"filters": [
|
|
10
|
-
{"field_name": "状态", "operator": "neq", "value": "已关闭"}
|
|
16
|
+
"text": "行内创建子记录",
|
|
17
|
+
"action": "add_data",
|
|
18
|
+
"target_app_key": "TARGET_APP_KEY",
|
|
19
|
+
"field_mappings": [
|
|
20
|
+
{"source_field": "数据ID", "target_field": "关联主记录"}
|
|
11
21
|
],
|
|
12
|
-
"
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
"
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
{"source_field": "数据ID", "target_field": "关联主记录"}
|
|
25
|
-
],
|
|
26
|
-
"default_values": {"目标状态字段": "REPLACE_WITH_TARGET_OPTION_LABEL"},
|
|
27
|
-
"placement": "list"
|
|
28
|
-
},
|
|
29
|
-
{
|
|
30
|
-
"text": "详情创建子记录",
|
|
31
|
-
"action": "add_data",
|
|
32
|
-
"target_app_key": "TARGET_APP_KEY",
|
|
33
|
-
"field_mappings": [
|
|
34
|
-
{"source_field": "数据ID", "target_field": "关联主记录"}
|
|
35
|
-
],
|
|
36
|
-
"default_values": {"目标状态字段": "REPLACE_WITH_TARGET_OPTION_LABEL"},
|
|
37
|
-
"placement": "detail"
|
|
38
|
-
}
|
|
39
|
-
]
|
|
22
|
+
"default_values": {"目标状态字段": "REPLACE_WITH_TARGET_OPTION_LABEL"},
|
|
23
|
+
"placement": "list"
|
|
24
|
+
},
|
|
25
|
+
{
|
|
26
|
+
"text": "详情创建子记录",
|
|
27
|
+
"action": "add_data",
|
|
28
|
+
"target_app_key": "TARGET_APP_KEY",
|
|
29
|
+
"field_mappings": [
|
|
30
|
+
{"source_field": "数据ID", "target_field": "关联主记录"}
|
|
31
|
+
],
|
|
32
|
+
"default_values": {"目标状态字段": "REPLACE_WITH_TARGET_OPTION_LABEL"},
|
|
33
|
+
"placement": "detail"
|
|
40
34
|
}
|
|
41
35
|
]
|
|
42
36
|
}
|
|
@@ -2,7 +2,7 @@ from __future__ import annotations
|
|
|
2
2
|
|
|
3
3
|
import re
|
|
4
4
|
from enum import Enum
|
|
5
|
-
from typing import Any
|
|
5
|
+
from typing import Any, Union
|
|
6
6
|
|
|
7
7
|
from pydantic import AliasChoices, Field, model_validator
|
|
8
8
|
|
|
@@ -134,6 +134,7 @@ class PublicViewType(str, Enum):
|
|
|
134
134
|
card = "card"
|
|
135
135
|
board = "board"
|
|
136
136
|
gantt = "gantt"
|
|
137
|
+
hierarchy = "hierarchy"
|
|
137
138
|
|
|
138
139
|
|
|
139
140
|
class PublicButtonTriggerAction(str, Enum):
|
|
@@ -390,9 +391,38 @@ class FlowConditionRulePatch(StrictModel):
|
|
|
390
391
|
return self
|
|
391
392
|
|
|
392
393
|
|
|
394
|
+
|
|
395
|
+
|
|
396
|
+
def _coerce_que_id(value: Any) -> Any:
|
|
397
|
+
"""字段引用归一:queId(后端字段唯一键)。接受 int / "123" / "field_123"(field_id 形态) → int;
|
|
398
|
+
其余形态原样返回交给 pydantic 报错(契约诚实:不支持显示名引用)。"""
|
|
399
|
+
if isinstance(value, bool) or isinstance(value, int):
|
|
400
|
+
return value
|
|
401
|
+
if isinstance(value, str):
|
|
402
|
+
stripped = value.strip()
|
|
403
|
+
if stripped.isdigit():
|
|
404
|
+
return int(stripped)
|
|
405
|
+
if stripped.startswith("field_") and stripped[6:].isdigit():
|
|
406
|
+
return int(stripped[6:])
|
|
407
|
+
return value
|
|
408
|
+
|
|
393
409
|
class ViewFilterRulePatch(StrictModel):
|
|
394
|
-
|
|
410
|
+
que_id: int = Field(validation_alias=AliasChoices("que_id", "queId", "field_id", "fieldId"))
|
|
395
411
|
operator: ViewFilterOperator = Field(default=ViewFilterOperator.eq, validation_alias=AliasChoices("operator", "op"))
|
|
412
|
+
|
|
413
|
+
@model_validator(mode="before")
|
|
414
|
+
@classmethod
|
|
415
|
+
def normalize_que_id(cls, value: Any) -> Any:
|
|
416
|
+
if isinstance(value, dict):
|
|
417
|
+
for alias in ("queId", "field_id", "fieldId"):
|
|
418
|
+
if alias in value and "que_id" not in value:
|
|
419
|
+
value = {**{k: v for k, v in value.items() if k != alias}, "que_id": value[alias]}
|
|
420
|
+
break
|
|
421
|
+
for alias in ("queId", "field_id", "fieldId"):
|
|
422
|
+
value.pop(alias, None) if alias != "que_id" else None
|
|
423
|
+
if isinstance(value, dict) and "que_id" in value:
|
|
424
|
+
return {**value, "que_id": _coerce_que_id(value["que_id"])}
|
|
425
|
+
return value
|
|
396
426
|
values: list[Any] = Field(default_factory=list)
|
|
397
427
|
|
|
398
428
|
@model_validator(mode="before")
|
|
@@ -405,11 +435,18 @@ class ViewFilterRulePatch(StrictModel):
|
|
|
405
435
|
if self.operator in {ViewFilterOperator.is_empty, ViewFilterOperator.not_empty}:
|
|
406
436
|
self.values = []
|
|
407
437
|
return self
|
|
408
|
-
if not self.values:
|
|
438
|
+
if not self.values and self.operator != ViewFilterOperator.in_:
|
|
439
|
+
# in+空值合法:选项/成员类字段"ANY 判型未选任何值"的存量形态
|
|
440
|
+
# (后端 judgeType=EQUAL_ANY+空值,实测回写稳定保留)
|
|
409
441
|
raise ValueError("view filter rule requires values")
|
|
410
442
|
return self
|
|
411
443
|
|
|
412
444
|
|
|
445
|
+
# 视图筛选双形态(与 visible_when/root_filter 的嵌组形态对齐):
|
|
446
|
+
# 扁平 [rule, ...] = 单组 AND(向后兼容);嵌套 [[rule,...],[rule,...]] = 组间 OR、组内 AND
|
|
447
|
+
ViewFilterGroupPatch = Union[ViewFilterRulePatch, list[ViewFilterRulePatch]]
|
|
448
|
+
|
|
449
|
+
|
|
413
450
|
class FieldSelector(StrictModel):
|
|
414
451
|
field_id: str | None = None
|
|
415
452
|
que_id: int | None = None
|
|
@@ -544,16 +581,14 @@ class VisibilityPatch(StrictModel):
|
|
|
544
581
|
|
|
545
582
|
@model_validator(mode="after")
|
|
546
583
|
def validate_shape(self) -> "VisibilityPatch":
|
|
547
|
-
|
|
548
|
-
|
|
584
|
+
# mode=specific + 空 selectors 是合法形态(auth=2 但未配置成员),回写保真;
|
|
585
|
+
# 不强制要求 specific 必须有 selectors
|
|
549
586
|
if self.mode != PublicVisibilityMode.specific and self.selectors.has_any_selector():
|
|
550
587
|
raise ValueError("selectors are only allowed when mode=specific")
|
|
551
588
|
if self.mode == PublicVisibilityMode.everyone and self.external_mode != PublicExternalVisibilityMode.workspace:
|
|
552
589
|
raise ValueError("mode=everyone requires external_mode=workspace")
|
|
553
590
|
if self.mode == PublicVisibilityMode.everyone and self.external_selectors.has_any_selector():
|
|
554
591
|
raise ValueError("external_selectors are not allowed when mode=everyone")
|
|
555
|
-
if self.external_mode == PublicExternalVisibilityMode.specific and not self.external_selectors.has_any_selector():
|
|
556
|
-
raise ValueError("external_mode=specific requires external_selectors")
|
|
557
592
|
if self.external_mode != PublicExternalVisibilityMode.specific and self.external_selectors.has_any_selector():
|
|
558
593
|
raise ValueError("external_selectors are only allowed when external_mode=specific")
|
|
559
594
|
return self
|
|
@@ -1137,6 +1172,141 @@ class ViewQueryConditionsPatch(StrictModel):
|
|
|
1137
1172
|
rows: list[list[str | int]] = Field(default_factory=list, validation_alias=AliasChoices("rows", "fields", "queryCondition"))
|
|
1138
1173
|
|
|
1139
1174
|
|
|
1175
|
+
class ViewDataPermissionPatch(StrictModel):
|
|
1176
|
+
"""数据权限形状(公开语义)→ dataPermissionType + dataScope。"""
|
|
1177
|
+
|
|
1178
|
+
type: str = Field(default="custom", validation_alias=AliasChoices("type", "permission_type", "permissionType"))
|
|
1179
|
+
scope: str = Field(default="all", validation_alias=AliasChoices("scope", "data_scope", "dataScope"))
|
|
1180
|
+
|
|
1181
|
+
@model_validator(mode="after")
|
|
1182
|
+
def validate_shape(self) -> "ViewDataPermissionPatch":
|
|
1183
|
+
if self.type not in {"config", "custom"}:
|
|
1184
|
+
raise ValueError("data_permission.type must be config or custom")
|
|
1185
|
+
if self.scope not in {"all", "oneself", "dept", "subordinate", "custom"}:
|
|
1186
|
+
raise ValueError("data_permission.scope must be one of all/oneself/dept/subordinate/custom")
|
|
1187
|
+
return self
|
|
1188
|
+
|
|
1189
|
+
|
|
1190
|
+
class ViewSortRulePatch(StrictModel):
|
|
1191
|
+
"""排序规则(公开语义)→ viewgraphSorts + sortType=customSort。"""
|
|
1192
|
+
|
|
1193
|
+
que_id: int = Field(validation_alias=AliasChoices("que_id", "queId", "field_id", "fieldId"))
|
|
1194
|
+
ascending: bool = Field(default=True, validation_alias=AliasChoices("ascending", "asc", "beingSortAscend"))
|
|
1195
|
+
|
|
1196
|
+
@model_validator(mode="before")
|
|
1197
|
+
@classmethod
|
|
1198
|
+
def normalize_que_id(cls, value: Any) -> Any:
|
|
1199
|
+
if isinstance(value, dict):
|
|
1200
|
+
for alias in ("queId", "field_id", "fieldId"):
|
|
1201
|
+
if alias in value and "que_id" not in value:
|
|
1202
|
+
value = {**{k: v for k, v in value.items() if k != alias}, "que_id": value[alias]}
|
|
1203
|
+
break
|
|
1204
|
+
for alias in ("queId", "field_id", "fieldId"):
|
|
1205
|
+
value.pop(alias, None) if alias != "que_id" else None
|
|
1206
|
+
if isinstance(value, dict) and "que_id" in value:
|
|
1207
|
+
return {**value, "que_id": _coerce_que_id(value["que_id"])}
|
|
1208
|
+
return value
|
|
1209
|
+
|
|
1210
|
+
|
|
1211
|
+
class ViewCardConfigPatch(StrictModel):
|
|
1212
|
+
"""卡片视图特有配置 → titleQue/frontCoverQueId/clippingMode/... 。"""
|
|
1213
|
+
|
|
1214
|
+
title_que_id: int | None = Field(default=None, validation_alias=AliasChoices("title_que_id", "titleQueId"))
|
|
1215
|
+
cover_que_id: int | None = Field(default=None, validation_alias=AliasChoices("cover_que_id", "coverQueId", "front_cover_que_id", "frontCoverQueId"))
|
|
1216
|
+
clipping_mode: str | None = Field(default=None, validation_alias=AliasChoices("clipping_mode", "clippingMode"))
|
|
1217
|
+
image_adaption: bool | None = Field(default=None, validation_alias=AliasChoices("image_adaption", "imageAdaption", "beingImageAdaption"))
|
|
1218
|
+
show_field_title: bool | None = Field(default=None, validation_alias=AliasChoices("show_field_title", "showFieldTitle", "beingShowQueTitle"))
|
|
1219
|
+
show_title: bool | None = Field(default=None, validation_alias=AliasChoices("show_title", "showTitle", "beingShowTitleQue"))
|
|
1220
|
+
show_cover: bool | None = Field(default=None, validation_alias=AliasChoices("show_cover", "showCover", "beingShowCover"))
|
|
1221
|
+
group_que_id: int | None = Field(default=None, validation_alias=AliasChoices("group_que_id", "groupQueId"))
|
|
1222
|
+
group_color: bool | None = Field(default=None, validation_alias=AliasChoices("group_color", "groupColor", "beingGroupColor"))
|
|
1223
|
+
|
|
1224
|
+
@model_validator(mode="after")
|
|
1225
|
+
def validate_shape(self) -> "ViewCardConfigPatch":
|
|
1226
|
+
if self.clipping_mode is not None and self.clipping_mode not in {"default", "fill"}:
|
|
1227
|
+
raise ValueError("card.clipping_mode must be default or fill")
|
|
1228
|
+
return self
|
|
1229
|
+
|
|
1230
|
+
|
|
1231
|
+
class ViewGanttGroupPatch(StrictModel):
|
|
1232
|
+
que_id: int = Field(validation_alias=AliasChoices("que_id", "queId"))
|
|
1233
|
+
ordinal: int | None = Field(default=None)
|
|
1234
|
+
|
|
1235
|
+
|
|
1236
|
+
class ViewGanttDependencyPatch(StrictModel):
|
|
1237
|
+
predecessor_que_id: int = Field(validation_alias=AliasChoices("predecessor_que_id", "predecessorQueId"))
|
|
1238
|
+
dependency_que_id: int = Field(validation_alias=AliasChoices("dependency_que_id", "dependencyQueId"))
|
|
1239
|
+
start_start_option_id: int | None = Field(default=None, validation_alias=AliasChoices("start_start_option_id", "startStartOptionId"))
|
|
1240
|
+
start_end_option_id: int | None = Field(default=None, validation_alias=AliasChoices("start_end_option_id", "startEndOptionId"))
|
|
1241
|
+
end_start_option_id: int | None = Field(default=None, validation_alias=AliasChoices("end_start_option_id", "endStartOptionId"))
|
|
1242
|
+
end_end_option_id: int | None = Field(default=None, validation_alias=AliasChoices("end_end_option_id", "endEndOptionId"))
|
|
1243
|
+
|
|
1244
|
+
|
|
1245
|
+
class ViewGanttConfigPatch(StrictModel):
|
|
1246
|
+
"""甘特视图特有配置 → viewgraphGanttConfigVO。"""
|
|
1247
|
+
|
|
1248
|
+
title_que_id: int | None = Field(default=None, validation_alias=AliasChoices("title_que_id", "titleQueId"))
|
|
1249
|
+
start_que_id: int | None = Field(default=None, validation_alias=AliasChoices("start_que_id", "startQueId"))
|
|
1250
|
+
end_que_id: int | None = Field(default=None, validation_alias=AliasChoices("end_que_id", "endQueId"))
|
|
1251
|
+
default_time_dimension: str | None = Field(default=None, validation_alias=AliasChoices("default_time_dimension", "defaultTimeDimension"))
|
|
1252
|
+
auto_calibration: bool | None = Field(default=None, validation_alias=AliasChoices("auto_calibration", "autoCalibration", "beingAutoCalibration"))
|
|
1253
|
+
groups: list[ViewGanttGroupPatch] = Field(default_factory=list)
|
|
1254
|
+
dependencies: list[ViewGanttDependencyPatch] = Field(default_factory=list, validation_alias=AliasChoices("dependencies", "dependency"))
|
|
1255
|
+
|
|
1256
|
+
@model_validator(mode="after")
|
|
1257
|
+
def validate_shape(self) -> "ViewGanttConfigPatch":
|
|
1258
|
+
if self.default_time_dimension is not None and self.default_time_dimension not in {"day", "week", "month", "year"}:
|
|
1259
|
+
raise ValueError("gantt.default_time_dimension must be day, week, month, or year")
|
|
1260
|
+
if len(self.dependencies) > 1:
|
|
1261
|
+
raise ValueError("gantt.dependencies supports at most one dependency relation in v1alpha1")
|
|
1262
|
+
return self
|
|
1263
|
+
|
|
1264
|
+
|
|
1265
|
+
class ViewHierarchyConfigPatch(StrictModel):
|
|
1266
|
+
"""层级视图特有配置 → viewgraphHierarchyConfigVO。"""
|
|
1267
|
+
|
|
1268
|
+
title_que_id: int = Field(validation_alias=AliasChoices("title_que_id", "titleQueId"))
|
|
1269
|
+
children_que_id: int = Field(validation_alias=AliasChoices("children_que_id", "childrenQueId"))
|
|
1270
|
+
root_filter: list[list[ViewFilterRulePatch]] = Field(
|
|
1271
|
+
default_factory=list,
|
|
1272
|
+
validation_alias=AliasChoices("root_filter", "rootFilter", "root_node_filter", "rootNodeFilter"),
|
|
1273
|
+
)
|
|
1274
|
+
|
|
1275
|
+
|
|
1276
|
+
class ViewDisplayConfigPatch(StrictModel):
|
|
1277
|
+
"""展示杂项 → defaultRowHigh/beingPinNavigate/remark。"""
|
|
1278
|
+
|
|
1279
|
+
row_height: str | None = Field(default=None, validation_alias=AliasChoices("row_height", "rowHeight", "defaultRowHigh"))
|
|
1280
|
+
pin_navigate: bool | None = Field(default=None, validation_alias=AliasChoices("pin_navigate", "pinNavigate", "beingPinNavigate"))
|
|
1281
|
+
remark: str | None = Field(default=None)
|
|
1282
|
+
|
|
1283
|
+
@model_validator(mode="after")
|
|
1284
|
+
def validate_shape(self) -> "ViewDisplayConfigPatch":
|
|
1285
|
+
# 后端 defaultRowHigh 实际值域:compact/moderate/highest(high 为历史别名)
|
|
1286
|
+
if self.row_height is not None and self.row_height not in {"compact", "moderate", "highest", "high"}:
|
|
1287
|
+
raise ValueError("display.row_height must be compact, moderate, highest, or high")
|
|
1288
|
+
return self
|
|
1289
|
+
|
|
1290
|
+
|
|
1291
|
+
class ViewRecordConfigPatch(StrictModel):
|
|
1292
|
+
"""记录可见性开关 → beingAuditRecordVisible 等。"""
|
|
1293
|
+
|
|
1294
|
+
audit_visible: bool | None = Field(default=None, validation_alias=AliasChoices("audit_visible", "auditVisible", "beingAuditRecordVisible"))
|
|
1295
|
+
data_log_visible: bool | None = Field(default=None, validation_alias=AliasChoices("data_log_visible", "dataLogVisible", "beingDataLogVisible"))
|
|
1296
|
+
qrobot_record_visible: bool | None = Field(default=None, validation_alias=AliasChoices("qrobot_record_visible", "qrobotRecordVisible", "beingQrobotRecordVisible"))
|
|
1297
|
+
workflow_future_visible: bool | None = Field(default=None, validation_alias=AliasChoices("workflow_future_visible", "workflowFutureVisible", "beingWorkflowNodeFutureListVisible"))
|
|
1298
|
+
comment: bool | None = Field(default=None, validation_alias=AliasChoices("comment", "beingCommentStatus"))
|
|
1299
|
+
|
|
1300
|
+
|
|
1301
|
+
class ViewShareConfigPatch(StrictModel):
|
|
1302
|
+
"""分享与安全 → beingNeedPass/viewgraphPass/beingForceLogin/beingPrintStatus。"""
|
|
1303
|
+
|
|
1304
|
+
need_pass: bool | None = Field(default=None, validation_alias=AliasChoices("need_pass", "needPass", "beingNeedPass"))
|
|
1305
|
+
password: str | None = Field(default=None, validation_alias=AliasChoices("password", "pass", "viewgraphPass"))
|
|
1306
|
+
force_login: bool | None = Field(default=None, validation_alias=AliasChoices("force_login", "forceLogin", "beingForceLogin"))
|
|
1307
|
+
print_enabled: bool | None = Field(default=None, validation_alias=AliasChoices("print_enabled", "printEnabled", "beingPrintStatus"))
|
|
1308
|
+
|
|
1309
|
+
|
|
1140
1310
|
class ViewAssociatedResourcesPatch(StrictModel):
|
|
1141
1311
|
visible: bool = Field(default=True, validation_alias=AliasChoices("visible", "enabled", "asosChartVisible"))
|
|
1142
1312
|
limit_type: str | None = Field(default=None, validation_alias=AliasChoices("limit_type", "limitType"))
|
|
@@ -1239,17 +1409,29 @@ class ViewActionButtonPatch(StrictModel):
|
|
|
1239
1409
|
class ViewUpsertPatch(StrictModel):
|
|
1240
1410
|
name: str
|
|
1241
1411
|
view_key: str | None = Field(default=None, validation_alias=AliasChoices("view_key", "viewKey"))
|
|
1412
|
+
pinned: bool | None = Field(default=None, validation_alias=AliasChoices("pinned", "fixed", "is_pinned", "isPinned"))
|
|
1242
1413
|
type: PublicViewType
|
|
1243
|
-
columns: list[
|
|
1244
|
-
|
|
1245
|
-
filters: list[
|
|
1246
|
-
|
|
1247
|
-
|
|
1248
|
-
|
|
1414
|
+
columns: list[int] = Field(default_factory=list)
|
|
1415
|
+
group_que_id: int | None = Field(default=None, validation_alias=AliasChoices("group_que_id", "groupQueId"))
|
|
1416
|
+
filters: list["ViewFilterGroupPatch"] = Field(default_factory=list)
|
|
1417
|
+
start_que_id: int | None = Field(default=None, validation_alias=AliasChoices("start_que_id", "startQueId"))
|
|
1418
|
+
end_que_id: int | None = Field(default=None, validation_alias=AliasChoices("end_que_id", "endQueId"))
|
|
1419
|
+
title_que_id: int | None = Field(default=None, validation_alias=AliasChoices("title_que_id", "titleQueId"))
|
|
1249
1420
|
buttons: list["ViewButtonBindingPatch"] | None = None
|
|
1250
1421
|
action_buttons: list[ViewActionButtonPatch] | None = Field(default=None, validation_alias=AliasChoices("action_buttons", "actionButtons"))
|
|
1251
1422
|
action_buttons_mode: str = Field(default="merge", validation_alias=AliasChoices("action_buttons_mode", "actionButtonsMode", "button_mode", "buttonMode"))
|
|
1252
1423
|
visibility: VisibilityPatch | None = None
|
|
1424
|
+
data_permission: ViewDataPermissionPatch | None = Field(
|
|
1425
|
+
default=None,
|
|
1426
|
+
validation_alias=AliasChoices("data_permission", "dataPermission"),
|
|
1427
|
+
)
|
|
1428
|
+
sort: list[ViewSortRulePatch] | None = Field(default=None, validation_alias=AliasChoices("sort", "sort_rules", "sortRules"))
|
|
1429
|
+
card: ViewCardConfigPatch | None = Field(default=None)
|
|
1430
|
+
gantt: ViewGanttConfigPatch | None = Field(default=None)
|
|
1431
|
+
hierarchy: ViewHierarchyConfigPatch | None = Field(default=None)
|
|
1432
|
+
display: ViewDisplayConfigPatch | None = Field(default=None)
|
|
1433
|
+
record: ViewRecordConfigPatch | None = Field(default=None)
|
|
1434
|
+
share: ViewShareConfigPatch | None = Field(default=None)
|
|
1253
1435
|
query_conditions: ViewQueryConditionsPatch | None = Field(default=None, validation_alias=AliasChoices("query_conditions", "queryConditions", "query_condition", "queryCondition"))
|
|
1254
1436
|
associated_resources: ViewAssociatedResourcesPatch | None = Field(
|
|
1255
1437
|
default=None,
|
|
@@ -1321,10 +1503,19 @@ class ViewUpsertPatch(StrictModel):
|
|
|
1321
1503
|
def validate_shape(self) -> "ViewUpsertPatch":
|
|
1322
1504
|
if self.type in {PublicViewType.table, PublicViewType.card} and not self.columns:
|
|
1323
1505
|
raise ValueError("table/card views require columns")
|
|
1324
|
-
if self.type == PublicViewType.board and not self.
|
|
1325
|
-
raise ValueError("board view requires
|
|
1326
|
-
if self.type == PublicViewType.gantt and not (self.
|
|
1327
|
-
raise ValueError("gantt view requires
|
|
1506
|
+
if self.type == PublicViewType.board and not self.group_que_id:
|
|
1507
|
+
raise ValueError("board view requires group_que_id")
|
|
1508
|
+
if self.type == PublicViewType.gantt and not (self.start_que_id and self.end_que_id):
|
|
1509
|
+
raise ValueError("gantt view requires start_que_id and end_que_id")
|
|
1510
|
+
if self.type == PublicViewType.hierarchy:
|
|
1511
|
+
if self.hierarchy is None or not (self.hierarchy.title_que_id and self.hierarchy.children_que_id):
|
|
1512
|
+
raise ValueError("hierarchy view requires hierarchy.title_que_id and children_que_id")
|
|
1513
|
+
elif self.hierarchy is not None:
|
|
1514
|
+
raise ValueError("hierarchy config is only allowed on hierarchy views")
|
|
1515
|
+
if self.type != PublicViewType.card and self.card is not None:
|
|
1516
|
+
raise ValueError("card config is only allowed on card views")
|
|
1517
|
+
if self.type != PublicViewType.gantt and self.gantt is not None:
|
|
1518
|
+
raise ValueError("gantt config is only allowed on gantt views")
|
|
1328
1519
|
normalized_mode = str(self.action_buttons_mode or "merge").strip().lower()
|
|
1329
1520
|
if normalized_mode not in {"merge", "replace"}:
|
|
1330
1521
|
raise ValueError("action_buttons_mode must be merge or replace")
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
{
|
|
2
|
+
"manifestDescription": "面向 app_views_apply 的版本化公开视图契约。summary 提供最小声明,complete 覆盖当前可写能力,details 提供按配置域读取的自包含专项 Schema。后端已知但尚不可写的能力以说明性元数据列出,不会被误报为公开能力。",
|
|
3
|
+
"latestVersion": "v1alpha1",
|
|
4
|
+
"versions": {
|
|
5
|
+
"v1alpha1": {
|
|
6
|
+
"versionDescription": "AI 和 CLI/MCP 使用的 canonical views DSL。字段名、更新语义和约束与 app_views_apply 对齐;schema 返回会内联专项 Schema 的依赖定义。",
|
|
7
|
+
"apiVersion": "builder.qingflow.com/v1alpha1",
|
|
8
|
+
"applyDto": "v1alpha1",
|
|
9
|
+
"contractSource": "app_views_apply",
|
|
10
|
+
"contractVersion": "v1alpha1",
|
|
11
|
+
"enabledByDefault": true,
|
|
12
|
+
"schemaKinds": [
|
|
13
|
+
"summary",
|
|
14
|
+
"complete",
|
|
15
|
+
"display",
|
|
16
|
+
"data-permission",
|
|
17
|
+
"operation-permission",
|
|
18
|
+
"query-condition",
|
|
19
|
+
"button-config"
|
|
20
|
+
],
|
|
21
|
+
"schemaFiles": {
|
|
22
|
+
"summary": "v1alpha1/summary.json",
|
|
23
|
+
"complete": "v1alpha1/complete.json",
|
|
24
|
+
"display": "v1alpha1/details/display.json",
|
|
25
|
+
"data-permission": "v1alpha1/details/data-permission.json",
|
|
26
|
+
"operation-permission": "v1alpha1/details/operation-permission.json",
|
|
27
|
+
"query-condition": "v1alpha1/details/query-condition.json",
|
|
28
|
+
"button-config": "v1alpha1/details/button-config.json"
|
|
29
|
+
},
|
|
30
|
+
"viewTypes": [
|
|
31
|
+
"table",
|
|
32
|
+
"card",
|
|
33
|
+
"board",
|
|
34
|
+
"gantt",
|
|
35
|
+
"hierarchy"
|
|
36
|
+
],
|
|
37
|
+
"backendKnownUnsupportedViewTypes": [
|
|
38
|
+
"calendar"
|
|
39
|
+
],
|
|
40
|
+
"status": "active"
|
|
41
|
+
}
|
|
42
|
+
}
|
|
43
|
+
}
|