@qingflow-tech/qingflow-cli 1.1.42 → 1.1.43-beta.1

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 (42) hide show
  1. package/README.md +4 -4
  2. package/package.json +2 -1
  3. package/pyproject.toml +3 -2
  4. package/src/qingflow_mcp/app_form_compat.py +115 -0
  5. package/src/qingflow_mcp/app_form_validator.py +199 -0
  6. package/src/qingflow_mcp/builder_facade/app_form.py +2836 -0
  7. package/src/qingflow_mcp/builder_facade/app_form_schema.py +269 -0
  8. package/src/qingflow_mcp/builder_facade/schemas/app_form/manifest.json +37 -0
  9. package/src/qingflow_mcp/builder_facade/schemas/app_form/v1alpha1/complete.json +1766 -0
  10. package/src/qingflow_mcp/builder_facade/schemas/app_form/v1alpha1/fields/address.json +76 -0
  11. package/src/qingflow_mcp/builder_facade/schemas/app_form/v1alpha1/fields/amount.json +76 -0
  12. package/src/qingflow_mcp/builder_facade/schemas/app_form/v1alpha1/fields/attachment.json +76 -0
  13. package/src/qingflow_mcp/builder_facade/schemas/app_form/v1alpha1/fields/code_block.json +223 -0
  14. package/src/qingflow_mcp/builder_facade/schemas/app_form/v1alpha1/fields/data_relation.json +538 -0
  15. package/src/qingflow_mcp/builder_facade/schemas/app_form/v1alpha1/fields/date.json +76 -0
  16. package/src/qingflow_mcp/builder_facade/schemas/app_form/v1alpha1/fields/datetime.json +76 -0
  17. package/src/qingflow_mcp/builder_facade/schemas/app_form/v1alpha1/fields/department.json +149 -0
  18. package/src/qingflow_mcp/builder_facade/schemas/app_form/v1alpha1/fields/email.json +76 -0
  19. package/src/qingflow_mcp/builder_facade/schemas/app_form/v1alpha1/fields/link.json +76 -0
  20. package/src/qingflow_mcp/builder_facade/schemas/app_form/v1alpha1/fields/long_text.json +76 -0
  21. package/src/qingflow_mcp/builder_facade/schemas/app_form/v1alpha1/fields/member.json +76 -0
  22. package/src/qingflow_mcp/builder_facade/schemas/app_form/v1alpha1/fields/multi_select.json +92 -0
  23. package/src/qingflow_mcp/builder_facade/schemas/app_form/v1alpha1/fields/number.json +76 -0
  24. package/src/qingflow_mcp/builder_facade/schemas/app_form/v1alpha1/fields/phone.json +76 -0
  25. package/src/qingflow_mcp/builder_facade/schemas/app_form/v1alpha1/fields/q_linker.json +338 -0
  26. package/src/qingflow_mcp/builder_facade/schemas/app_form/v1alpha1/fields/relation.json +137 -0
  27. package/src/qingflow_mcp/builder_facade/schemas/app_form/v1alpha1/fields/single_choice.json +92 -0
  28. package/src/qingflow_mcp/builder_facade/schemas/app_form/v1alpha1/fields/single_select.json +92 -0
  29. package/src/qingflow_mcp/builder_facade/schemas/app_form/v1alpha1/fields/subtable.json +810 -0
  30. package/src/qingflow_mcp/builder_facade/schemas/app_form/v1alpha1/fields/text.json +76 -0
  31. package/src/qingflow_mcp/builder_facade/schemas/app_form/v1alpha1/summary.json +713 -0
  32. package/src/qingflow_mcp/builder_facade/service.py +5 -2
  33. package/src/qingflow_mcp/cli/commands/builder.py +91 -28
  34. package/src/qingflow_mcp/cli/json_io.py +21 -2
  35. package/src/qingflow_mcp/cli/main.py +3 -39
  36. package/src/qingflow_mcp/cloud_oauth_proxy.py +96 -3
  37. package/src/qingflow_mcp/public_surface.py +5 -2
  38. package/src/qingflow_mcp/response_trim.py +8 -0
  39. package/src/qingflow_mcp/server_app_builder.py +38 -86
  40. package/src/qingflow_mcp/server_cloud.py +66 -1
  41. package/src/qingflow_mcp/tools/ai_builder_tools.py +93 -100
  42. package/src/qingflow_mcp/tools/app_tools.py +46 -65
@@ -0,0 +1,1766 @@
1
+ {
2
+ "$defs": {
3
+ "AliasSelector": {
4
+ "additionalProperties": false,
5
+ "description": "Q-Linker 或代码块输出别名;已有输出优先携带 aliasId。",
6
+ "properties": {
7
+ "aliasId": {
8
+ "description": "后端生成的别名 ID;新增输出时可省略。",
9
+ "minimum": 1,
10
+ "type": "integer"
11
+ },
12
+ "name": {
13
+ "description": "输出别名名称。",
14
+ "minLength": 1,
15
+ "type": "string"
16
+ }
17
+ },
18
+ "required": [
19
+ "name"
20
+ ],
21
+ "type": "object"
22
+ },
23
+ "AppFormSpec": {
24
+ "additionalProperties": false,
25
+ "description": "表单基础配置与字段布局目标态;除 body 外,缺失属性表示保留当前值。",
26
+ "properties": {
27
+ "appName": {
28
+ "description": "应用名称;缺失时保留当前名称。",
29
+ "minLength": 1,
30
+ "type": "string"
31
+ },
32
+ "attachments": {
33
+ "description": "应用附件完整目标态;空数组表示删除全部应用附件。",
34
+ "items": {
35
+ "$ref": "#/$defs/Attachment"
36
+ },
37
+ "type": "array"
38
+ },
39
+ "body": {
40
+ "$ref": "#/$defs/Body",
41
+ "description": "业务字段与布局的完整目标态;缺失字段或段落表示删除。"
42
+ },
43
+ "color": {
44
+ "description": "新应用图标颜色;仅创建分支允许,必须来自 workspace icon color catalog。",
45
+ "minLength": 1,
46
+ "type": "string"
47
+ },
48
+ "description": {
49
+ "description": "应用描述;null 或空字符串表示清空。",
50
+ "type": [
51
+ "string",
52
+ "null"
53
+ ]
54
+ },
55
+ "icon": {
56
+ "description": "新应用图标;仅创建分支允许,必须来自 workspace icon catalog 且不得为 template。",
57
+ "minLength": 1,
58
+ "type": "string"
59
+ },
60
+ "serialNumber": {
61
+ "$ref": "#/$defs/SerialNumber",
62
+ "description": "应用编号规则;支持默认编号或自定义组件编号。"
63
+ },
64
+ "style": {
65
+ "description": "应用样式;对象内缺失属性保留当前值,null 表示清除全部自定义样式。",
66
+ "oneOf": [
67
+ {
68
+ "$ref": "#/$defs/Style"
69
+ },
70
+ {
71
+ "type": "null"
72
+ }
73
+ ]
74
+ },
75
+ "theme": {
76
+ "description": "应用主题 ID;null 表示清除自定义主题。",
77
+ "type": [
78
+ "integer",
79
+ "null"
80
+ ]
81
+ }
82
+ },
83
+ "required": [
84
+ "body"
85
+ ],
86
+ "type": "object"
87
+ },
88
+ "Attachment": {
89
+ "additionalProperties": false,
90
+ "description": "应用级附件;已有附件由 attachId 复用,新增附件省略 attachId。",
91
+ "properties": {
92
+ "attachId": {
93
+ "description": "后端生成的附件 ID;get 返回,新增时省略。",
94
+ "minimum": 1,
95
+ "type": "integer"
96
+ },
97
+ "fileName": {
98
+ "description": "附件展示名称。",
99
+ "minLength": 1,
100
+ "type": "string"
101
+ },
102
+ "fileUrl": {
103
+ "description": "已上传文件的可访问 URL。",
104
+ "minLength": 1,
105
+ "type": "string"
106
+ }
107
+ },
108
+ "required": [
109
+ "fileName",
110
+ "fileUrl"
111
+ ],
112
+ "type": "object"
113
+ },
114
+ "Body": {
115
+ "description": "有序表单内容块;空数组表示删除全部业务字段和段落。",
116
+ "items": {
117
+ "$ref": "#/$defs/BodyBlock"
118
+ },
119
+ "type": "array"
120
+ },
121
+ "BodyBlock": {
122
+ "description": "根级普通行或独占外层位置的段落。",
123
+ "oneOf": [
124
+ {
125
+ "$ref": "#/$defs/RowBlock"
126
+ },
127
+ {
128
+ "$ref": "#/$defs/SectionBlock"
129
+ }
130
+ ]
131
+ },
132
+ "ChoiceConfig": {
133
+ "additionalProperties": false,
134
+ "description": "选择类字段配置。",
135
+ "properties": {
136
+ "options": {
137
+ "description": "非空有序选项文案;缺失选项表示从该字段配置中删除。",
138
+ "items": {
139
+ "minLength": 1,
140
+ "type": "string"
141
+ },
142
+ "minItems": 1,
143
+ "type": "array",
144
+ "uniqueItems": true
145
+ }
146
+ },
147
+ "required": [
148
+ "options"
149
+ ],
150
+ "type": "object"
151
+ },
152
+ "CodeBlockBinding": {
153
+ "additionalProperties": false,
154
+ "description": "代码块的输入、代码和输出映射。",
155
+ "properties": {
156
+ "autoTrigger": {
157
+ "description": "是否在输入变化时自动执行代码块。",
158
+ "type": [
159
+ "boolean",
160
+ "null"
161
+ ]
162
+ },
163
+ "code": {
164
+ "description": "代码块源码;MCP/CLI 仅保存,不执行。",
165
+ "minLength": 1,
166
+ "type": "string"
167
+ },
168
+ "customButtonText": {
169
+ "description": "自定义触发按钮文案。",
170
+ "type": [
171
+ "string",
172
+ "null"
173
+ ]
174
+ },
175
+ "customButtonTextEnabled": {
176
+ "description": "是否启用自定义触发按钮文案。",
177
+ "type": [
178
+ "boolean",
179
+ "null"
180
+ ]
181
+ },
182
+ "hideOnForm": {
183
+ "description": "是否在表单填写界面隐藏该代码块字段。",
184
+ "type": [
185
+ "boolean",
186
+ "null"
187
+ ]
188
+ },
189
+ "inputs": {
190
+ "description": "当前表单字段到代码变量的映射。",
191
+ "items": {
192
+ "$ref": "#/$defs/CodeBlockInputBinding"
193
+ },
194
+ "type": "array"
195
+ },
196
+ "outputs": {
197
+ "description": "代码输出路径到目标字段的映射。",
198
+ "items": {
199
+ "$ref": "#/$defs/CodeBlockOutputBinding"
200
+ },
201
+ "type": "array"
202
+ }
203
+ },
204
+ "required": [
205
+ "code"
206
+ ],
207
+ "type": "object"
208
+ },
209
+ "CodeBlockConfig": {
210
+ "additionalProperties": false,
211
+ "description": "代码块的高层声明;无法无损还原为该结构时阻断处理。",
212
+ "properties": {
213
+ "codeBlockBinding": {
214
+ "$ref": "#/$defs/CodeBlockBinding"
215
+ }
216
+ },
217
+ "required": [
218
+ "codeBlockBinding"
219
+ ],
220
+ "type": "object"
221
+ },
222
+ "CodeBlockInputBinding": {
223
+ "additionalProperties": false,
224
+ "description": "一个表单字段到代码变量的映射。",
225
+ "properties": {
226
+ "field": {
227
+ "$ref": "#/$defs/FieldSelector",
228
+ "description": "输入来源字段。"
229
+ },
230
+ "var": {
231
+ "description": "代码中的变量名;null 表示沿用后端默认变量名。",
232
+ "type": [
233
+ "string",
234
+ "null"
235
+ ]
236
+ }
237
+ },
238
+ "required": [
239
+ "field"
240
+ ],
241
+ "type": "object"
242
+ },
243
+ "CodeBlockOutputBinding": {
244
+ "additionalProperties": false,
245
+ "description": "一个代码输出值到表单字段的映射。",
246
+ "properties": {
247
+ "alias": {
248
+ "description": "输出别名;用于后续数据关联引用。",
249
+ "minLength": 1,
250
+ "type": "string"
251
+ },
252
+ "aliasId": {
253
+ "description": "后端生成的输出别名 ID;新增输出时可省略,get 返回后必须保留。",
254
+ "minimum": 1,
255
+ "type": "integer"
256
+ },
257
+ "path": {
258
+ "description": "从 qf_output 中取值的 JSONPath。",
259
+ "minLength": 1,
260
+ "type": "string"
261
+ },
262
+ "targetField": {
263
+ "$ref": "#/$defs/FieldSelector",
264
+ "description": "接收结果的当前表单字段。"
265
+ }
266
+ },
267
+ "required": [
268
+ "alias",
269
+ "path",
270
+ "targetField"
271
+ ],
272
+ "type": "object"
273
+ },
274
+ "DataRelationCondition": {
275
+ "additionalProperties": false,
276
+ "description": "一条数据关联过滤条件。",
277
+ "properties": {
278
+ "operand": {
279
+ "$ref": "#/$defs/DataRelationOperand",
280
+ "description": "比较值来源;可为字面量、当前表单字段或输出别名。"
281
+ },
282
+ "operator": {
283
+ "description": "比较运算符;Reconciler 会结合字段类型校验可用性。",
284
+ "enum": [
285
+ "equal",
286
+ "not_equal",
287
+ "contains",
288
+ "not_contains",
289
+ "greater_than",
290
+ "greater_or_equal",
291
+ "less_than",
292
+ "less_or_equal",
293
+ "dynamic_range",
294
+ "equal_any",
295
+ "not_equal_any",
296
+ "is_empty",
297
+ "is_not_empty",
298
+ "belongs_to",
299
+ "not_belongs_to",
300
+ "subordinate_to",
301
+ "not_subordinate_to",
302
+ "subordinate_included",
303
+ "subordinate_not_included",
304
+ "fuzzy_match",
305
+ "contains_any",
306
+ "contains_all",
307
+ "decimal_range"
308
+ ]
309
+ },
310
+ "sourceField": {
311
+ "$ref": "#/$defs/FieldSelector",
312
+ "description": "被过滤的数据源字段。"
313
+ }
314
+ },
315
+ "required": [
316
+ "sourceField",
317
+ "operator",
318
+ "operand"
319
+ ],
320
+ "type": "object"
321
+ },
322
+ "DataRelationConfig": {
323
+ "additionalProperties": false,
324
+ "description": "数据关联字段配置;从应用、Q-Linker 或代码块输出中读取数据。",
325
+ "properties": {
326
+ "aggregation": {
327
+ "description": "可选聚合方式;null 表示不聚合。",
328
+ "enum": [
329
+ "sum",
330
+ "average",
331
+ "max",
332
+ "min",
333
+ "first",
334
+ "last",
335
+ "filled_count",
336
+ "empty_count",
337
+ "count",
338
+ null
339
+ ],
340
+ "type": [
341
+ "string",
342
+ "null"
343
+ ]
344
+ },
345
+ "customButton": {
346
+ "$ref": "#/$defs/DataRelationCustomButton",
347
+ "description": "可选自定义按钮配置。"
348
+ },
349
+ "filters": {
350
+ "$ref": "#/$defs/DataRelationFilters",
351
+ "description": "可选过滤条件;支持简单条件组或高级公式。"
352
+ },
353
+ "sort": {
354
+ "$ref": "#/$defs/DataRelationSort",
355
+ "description": "可选排序配置。"
356
+ },
357
+ "source": {
358
+ "$ref": "#/$defs/DataRelationSource",
359
+ "description": "数据来源;按 kind 选择一种来源结构。"
360
+ }
361
+ },
362
+ "required": [
363
+ "source"
364
+ ],
365
+ "type": "object"
366
+ },
367
+ "DataRelationCustomButton": {
368
+ "description": "数据关联自定义按钮;启用时必须引用已有 buttonId。",
369
+ "oneOf": [
370
+ {
371
+ "additionalProperties": false,
372
+ "properties": {
373
+ "enabled": {
374
+ "const": false
375
+ }
376
+ },
377
+ "required": [
378
+ "enabled"
379
+ ],
380
+ "type": "object"
381
+ },
382
+ {
383
+ "additionalProperties": false,
384
+ "properties": {
385
+ "buttonId": {
386
+ "minimum": 1,
387
+ "type": "integer"
388
+ },
389
+ "enabled": {
390
+ "const": true
391
+ }
392
+ },
393
+ "required": [
394
+ "enabled",
395
+ "buttonId"
396
+ ],
397
+ "type": "object"
398
+ }
399
+ ]
400
+ },
401
+ "DataRelationFilters": {
402
+ "description": "simple 模式的外层组为 OR、组内条件为 AND;advanced 模式使用完整公式。",
403
+ "oneOf": [
404
+ {
405
+ "additionalProperties": false,
406
+ "properties": {
407
+ "groups": {
408
+ "description": "OR 条件组数组;每个内层数组是一组 AND 条件。",
409
+ "items": {
410
+ "items": {
411
+ "$ref": "#/$defs/DataRelationCondition"
412
+ },
413
+ "minItems": 1,
414
+ "type": "array"
415
+ },
416
+ "type": "array"
417
+ },
418
+ "mode": {
419
+ "const": "simple"
420
+ }
421
+ },
422
+ "required": [
423
+ "mode",
424
+ "groups"
425
+ ],
426
+ "type": "object"
427
+ },
428
+ {
429
+ "additionalProperties": false,
430
+ "properties": {
431
+ "formula": {
432
+ "description": "解码后的高级筛选公式。",
433
+ "minLength": 1,
434
+ "type": "string"
435
+ },
436
+ "mode": {
437
+ "const": "advanced"
438
+ }
439
+ },
440
+ "required": [
441
+ "mode",
442
+ "formula"
443
+ ],
444
+ "type": "object"
445
+ }
446
+ ]
447
+ },
448
+ "DataRelationOperand": {
449
+ "description": "数据关联条件右值的判别联合。",
450
+ "oneOf": [
451
+ {
452
+ "additionalProperties": false,
453
+ "properties": {
454
+ "kind": {
455
+ "const": "literal"
456
+ },
457
+ "values": {
458
+ "description": "字面量值列表。",
459
+ "items": {
460
+ "$ref": "#/$defs/JsonValue"
461
+ },
462
+ "type": "array"
463
+ }
464
+ },
465
+ "required": [
466
+ "kind",
467
+ "values"
468
+ ],
469
+ "type": "object"
470
+ },
471
+ {
472
+ "additionalProperties": false,
473
+ "properties": {
474
+ "field": {
475
+ "$ref": "#/$defs/FieldSelector"
476
+ },
477
+ "kind": {
478
+ "const": "current_field"
479
+ }
480
+ },
481
+ "required": [
482
+ "kind",
483
+ "field"
484
+ ],
485
+ "type": "object"
486
+ },
487
+ {
488
+ "additionalProperties": false,
489
+ "properties": {
490
+ "alias": {
491
+ "$ref": "#/$defs/AliasSelector"
492
+ },
493
+ "kind": {
494
+ "const": "alias"
495
+ },
496
+ "producer": {
497
+ "$ref": "#/$defs/FieldSelector"
498
+ }
499
+ },
500
+ "required": [
501
+ "kind",
502
+ "producer",
503
+ "alias"
504
+ ],
505
+ "type": "object"
506
+ }
507
+ ]
508
+ },
509
+ "DataRelationSort": {
510
+ "description": "数据关联排序开关;启用时必须指定排序来源和方向。",
511
+ "oneOf": [
512
+ {
513
+ "additionalProperties": false,
514
+ "properties": {
515
+ "enabled": {
516
+ "const": false
517
+ }
518
+ },
519
+ "required": [
520
+ "enabled"
521
+ ],
522
+ "type": "object"
523
+ },
524
+ {
525
+ "additionalProperties": false,
526
+ "properties": {
527
+ "by": {
528
+ "$ref": "#/$defs/DataRelationSortBy"
529
+ },
530
+ "direction": {
531
+ "enum": [
532
+ "asc",
533
+ "desc"
534
+ ]
535
+ },
536
+ "enabled": {
537
+ "const": true
538
+ }
539
+ },
540
+ "required": [
541
+ "enabled",
542
+ "by",
543
+ "direction"
544
+ ],
545
+ "type": "object"
546
+ }
547
+ ]
548
+ },
549
+ "DataRelationSortBy": {
550
+ "description": "排序值来源;可为来源字段或输出别名。",
551
+ "oneOf": [
552
+ {
553
+ "additionalProperties": false,
554
+ "properties": {
555
+ "field": {
556
+ "$ref": "#/$defs/FieldSelector"
557
+ },
558
+ "kind": {
559
+ "const": "field"
560
+ }
561
+ },
562
+ "required": [
563
+ "kind",
564
+ "field"
565
+ ],
566
+ "type": "object"
567
+ },
568
+ {
569
+ "additionalProperties": false,
570
+ "properties": {
571
+ "alias": {
572
+ "$ref": "#/$defs/AliasSelector"
573
+ },
574
+ "kind": {
575
+ "const": "alias"
576
+ },
577
+ "producer": {
578
+ "$ref": "#/$defs/FieldSelector"
579
+ }
580
+ },
581
+ "required": [
582
+ "kind",
583
+ "producer",
584
+ "alias"
585
+ ],
586
+ "type": "object"
587
+ }
588
+ ]
589
+ },
590
+ "DataRelationSource": {
591
+ "description": "数据关联来源判别联合;kind 决定其余必填字段。",
592
+ "oneOf": [
593
+ {
594
+ "additionalProperties": false,
595
+ "properties": {
596
+ "appKey": {
597
+ "description": "来源应用的 appKey。",
598
+ "minLength": 1,
599
+ "type": "string"
600
+ },
601
+ "field": {
602
+ "$ref": "#/$defs/FieldSelector",
603
+ "description": "来源应用中的结果字段。"
604
+ },
605
+ "kind": {
606
+ "const": "app"
607
+ }
608
+ },
609
+ "required": [
610
+ "kind",
611
+ "appKey",
612
+ "field"
613
+ ],
614
+ "type": "object"
615
+ },
616
+ {
617
+ "additionalProperties": false,
618
+ "properties": {
619
+ "alias": {
620
+ "$ref": "#/$defs/AliasSelector",
621
+ "description": "Q-Linker 输出别名。"
622
+ },
623
+ "kind": {
624
+ "const": "q_linker"
625
+ },
626
+ "producer": {
627
+ "$ref": "#/$defs/FieldSelector",
628
+ "description": "当前应用中的 Q-Linker 字段。"
629
+ }
630
+ },
631
+ "required": [
632
+ "kind",
633
+ "producer",
634
+ "alias"
635
+ ],
636
+ "type": "object"
637
+ },
638
+ {
639
+ "additionalProperties": false,
640
+ "properties": {
641
+ "alias": {
642
+ "$ref": "#/$defs/AliasSelector",
643
+ "description": "代码块输出别名。"
644
+ },
645
+ "kind": {
646
+ "const": "code_block"
647
+ },
648
+ "producer": {
649
+ "$ref": "#/$defs/FieldSelector",
650
+ "description": "当前应用中的代码块字段。"
651
+ }
652
+ },
653
+ "required": [
654
+ "kind",
655
+ "producer",
656
+ "alias"
657
+ ],
658
+ "type": "object"
659
+ }
660
+ ]
661
+ },
662
+ "DepartmentConfig": {
663
+ "additionalProperties": false,
664
+ "description": "部门字段的可选范围配置。",
665
+ "properties": {
666
+ "departmentScope": {
667
+ "$ref": "#/$defs/DepartmentScope"
668
+ }
669
+ },
670
+ "required": [
671
+ "departmentScope"
672
+ ],
673
+ "type": "object"
674
+ },
675
+ "DepartmentScope": {
676
+ "description": "all 表示全部部门;custom 表示仅允许指定部门。",
677
+ "oneOf": [
678
+ {
679
+ "additionalProperties": false,
680
+ "properties": {
681
+ "includeSubDeparts": {
682
+ "description": "是否包含所选部门的下级部门。",
683
+ "type": "boolean"
684
+ },
685
+ "mode": {
686
+ "const": "all"
687
+ }
688
+ },
689
+ "required": [
690
+ "mode"
691
+ ],
692
+ "type": "object"
693
+ },
694
+ {
695
+ "additionalProperties": false,
696
+ "properties": {
697
+ "departments": {
698
+ "description": "custom 模式允许选择的部门列表。",
699
+ "items": {
700
+ "$ref": "#/$defs/DepartmentSelector"
701
+ },
702
+ "minItems": 1,
703
+ "type": "array"
704
+ },
705
+ "includeSubDeparts": {
706
+ "description": "是否包含指定部门的下级部门。",
707
+ "type": "boolean"
708
+ },
709
+ "mode": {
710
+ "const": "custom"
711
+ }
712
+ },
713
+ "required": [
714
+ "mode",
715
+ "departments"
716
+ ],
717
+ "type": "object"
718
+ }
719
+ ]
720
+ },
721
+ "DepartmentSelector": {
722
+ "additionalProperties": false,
723
+ "description": "部门身份;deptId 必填,deptName 仅用于展示。",
724
+ "properties": {
725
+ "deptId": {
726
+ "minimum": 1,
727
+ "type": "integer"
728
+ },
729
+ "deptName": {
730
+ "minLength": 1,
731
+ "type": "string"
732
+ }
733
+ },
734
+ "required": [
735
+ "deptId"
736
+ ],
737
+ "type": "object"
738
+ },
739
+ "EmptyConfig": {
740
+ "additionalProperties": false,
741
+ "description": "该字段类型没有特殊配置。",
742
+ "type": "object"
743
+ },
744
+ "FieldCommon": {
745
+ "description": "顶层业务字段的公共属性;字段类型由 TopField 的判别分支定义。",
746
+ "properties": {
747
+ "dataCover": {
748
+ "description": "是否作为数据封面;仅顶层附件字段可设为 true。",
749
+ "type": "boolean"
750
+ },
751
+ "dataTitle": {
752
+ "description": "是否作为数据标题;整个 body 最多且必须按规则存在一个。",
753
+ "type": "boolean"
754
+ },
755
+ "description": {
756
+ "description": "字段说明;null 或空字符串表示清空。",
757
+ "type": [
758
+ "string",
759
+ "null"
760
+ ]
761
+ },
762
+ "name": {
763
+ "description": "字段展示名称;同一父级内唯一,不单独作为字段身份。",
764
+ "minLength": 1,
765
+ "type": "string"
766
+ },
767
+ "queId": {
768
+ "description": "已有字段的后端 ID;get 返回,新增字段省略。",
769
+ "minimum": 1,
770
+ "type": "integer"
771
+ },
772
+ "required": {
773
+ "description": "是否必填;缺失时保留已有字段当前值。",
774
+ "type": "boolean"
775
+ },
776
+ "width": {
777
+ "description": "字段在所在行的宽度百分比;同一行要么全部提供且合计 100,要么全部省略。",
778
+ "maximum": 100,
779
+ "minimum": 1,
780
+ "type": "integer"
781
+ }
782
+ },
783
+ "required": [
784
+ "name"
785
+ ],
786
+ "type": "object"
787
+ },
788
+ "FieldRow": {
789
+ "additionalProperties": false,
790
+ "description": "段落内部字段行。",
791
+ "properties": {
792
+ "fields": {
793
+ "description": "本行的 1 到 4 个顶层字段。",
794
+ "items": {
795
+ "$ref": "#/$defs/TopField"
796
+ },
797
+ "maxItems": 4,
798
+ "minItems": 1,
799
+ "type": "array"
800
+ }
801
+ },
802
+ "required": [
803
+ "fields"
804
+ ],
805
+ "type": "object"
806
+ },
807
+ "FieldSelector": {
808
+ "additionalProperties": false,
809
+ "anyOf": [
810
+ {
811
+ "required": [
812
+ "queId"
813
+ ]
814
+ },
815
+ {
816
+ "required": [
817
+ "name"
818
+ ]
819
+ }
820
+ ],
821
+ "description": "跨字段引用选择器;至少提供 queId 或 name,两者同时提供时必须指向同一字段。",
822
+ "properties": {
823
+ "name": {
824
+ "description": "字段名称;仅在当前作用域内唯一时可用于解析。",
825
+ "minLength": 1,
826
+ "type": "string"
827
+ },
828
+ "queId": {
829
+ "description": "已有字段的后端 ID;优先用于精确解析。",
830
+ "minimum": 1,
831
+ "type": "integer"
832
+ }
833
+ },
834
+ "type": "object"
835
+ },
836
+ "JsonValue": {
837
+ "description": "数据关联字面量支持的任意 JSON 值。",
838
+ "oneOf": [
839
+ {
840
+ "type": "null"
841
+ },
842
+ {
843
+ "type": "boolean"
844
+ },
845
+ {
846
+ "type": "number"
847
+ },
848
+ {
849
+ "type": "string"
850
+ },
851
+ {
852
+ "items": {
853
+ "$ref": "#/$defs/JsonValue"
854
+ },
855
+ "type": "array"
856
+ },
857
+ {
858
+ "additionalProperties": {
859
+ "$ref": "#/$defs/JsonValue"
860
+ },
861
+ "type": "object"
862
+ }
863
+ ]
864
+ },
865
+ "QLinkerBinding": {
866
+ "additionalProperties": false,
867
+ "description": "Q-Linker 的输入映射、请求配置和输出映射。",
868
+ "properties": {
869
+ "inputs": {
870
+ "description": "将当前表单字段映射到请求参数的规则。",
871
+ "items": {
872
+ "$ref": "#/$defs/QLinkerInputBinding"
873
+ },
874
+ "type": "array"
875
+ },
876
+ "outputs": {
877
+ "description": "将响应路径映射到目标字段的规则;至少一个。",
878
+ "items": {
879
+ "$ref": "#/$defs/QLinkerOutputBinding"
880
+ },
881
+ "minItems": 1,
882
+ "type": "array"
883
+ },
884
+ "request": {
885
+ "$ref": "#/$defs/QLinkerRequest",
886
+ "description": "远程请求配置。"
887
+ }
888
+ },
889
+ "required": [
890
+ "request",
891
+ "outputs"
892
+ ],
893
+ "type": "object"
894
+ },
895
+ "QLinkerConfig": {
896
+ "additionalProperties": false,
897
+ "description": "Q-Linker 的高层声明;无法无损还原为该结构时阻断处理。",
898
+ "properties": {
899
+ "qLinkerBinding": {
900
+ "$ref": "#/$defs/QLinkerBinding"
901
+ }
902
+ },
903
+ "required": [
904
+ "qLinkerBinding"
905
+ ],
906
+ "type": "object"
907
+ },
908
+ "QLinkerInputBinding": {
909
+ "additionalProperties": false,
910
+ "description": "一个表单字段到请求参数的映射。",
911
+ "properties": {
912
+ "field": {
913
+ "$ref": "#/$defs/FieldSelector",
914
+ "description": "输入来源字段。"
915
+ },
916
+ "key": {
917
+ "description": "请求中的参数名。",
918
+ "minLength": 1,
919
+ "type": "string"
920
+ },
921
+ "source": {
922
+ "description": "参数写入请求的位置。",
923
+ "enum": [
924
+ "query_param",
925
+ "header",
926
+ "url_encoded",
927
+ "json_path"
928
+ ]
929
+ }
930
+ },
931
+ "required": [
932
+ "field",
933
+ "key",
934
+ "source"
935
+ ],
936
+ "type": "object"
937
+ },
938
+ "QLinkerKeyValue": {
939
+ "additionalProperties": false,
940
+ "description": "HTTP 请求中的键值对。",
941
+ "properties": {
942
+ "key": {
943
+ "description": "参数名。",
944
+ "minLength": 1,
945
+ "type": "string"
946
+ },
947
+ "value": {
948
+ "description": "参数值;null 表示空值。",
949
+ "type": [
950
+ "string",
951
+ "null"
952
+ ]
953
+ }
954
+ },
955
+ "required": [
956
+ "key"
957
+ ],
958
+ "type": "object"
959
+ },
960
+ "QLinkerOutputBinding": {
961
+ "additionalProperties": false,
962
+ "description": "一个响应值到表单目标字段的映射。",
963
+ "properties": {
964
+ "alias": {
965
+ "description": "输出别名;用于后续数据关联引用。",
966
+ "minLength": 1,
967
+ "type": "string"
968
+ },
969
+ "aliasId": {
970
+ "description": "后端生成的输出别名 ID;新增输出时可省略,get 返回后必须保留。",
971
+ "minimum": 1,
972
+ "type": "integer"
973
+ },
974
+ "path": {
975
+ "description": "从响应中取值的 JSONPath。",
976
+ "minLength": 1,
977
+ "type": "string"
978
+ },
979
+ "targetField": {
980
+ "$ref": "#/$defs/FieldSelector",
981
+ "description": "接收结果的当前表单字段。"
982
+ }
983
+ },
984
+ "required": [
985
+ "alias",
986
+ "path",
987
+ "targetField"
988
+ ],
989
+ "type": "object"
990
+ },
991
+ "QLinkerRequest": {
992
+ "additionalProperties": false,
993
+ "description": "Q-Linker 远程 HTTP 请求配置。",
994
+ "properties": {
995
+ "autoTrigger": {
996
+ "description": "是否在输入变化时自动触发请求。",
997
+ "type": [
998
+ "boolean",
999
+ "null"
1000
+ ]
1001
+ },
1002
+ "bodyType": {
1003
+ "default": "url_encoded",
1004
+ "description": "请求体格式;分别映射后端 bodyType 1、2、3。",
1005
+ "enum": [
1006
+ "url_encoded",
1007
+ "json",
1008
+ "xml"
1009
+ ]
1010
+ },
1011
+ "customButtonText": {
1012
+ "description": "自定义触发按钮文案。",
1013
+ "type": [
1014
+ "string",
1015
+ "null"
1016
+ ]
1017
+ },
1018
+ "customButtonTextEnabled": {
1019
+ "description": "是否启用自定义触发按钮文案。",
1020
+ "type": [
1021
+ "boolean",
1022
+ "null"
1023
+ ]
1024
+ },
1025
+ "headers": {
1026
+ "description": "请求头键值对。",
1027
+ "items": {
1028
+ "$ref": "#/$defs/QLinkerKeyValue"
1029
+ },
1030
+ "type": "array"
1031
+ },
1032
+ "hideOnForm": {
1033
+ "description": "是否在表单填写界面隐藏该 Q-Linker 字段。",
1034
+ "type": [
1035
+ "boolean",
1036
+ "null"
1037
+ ]
1038
+ },
1039
+ "insertValueDirectly": {
1040
+ "description": "是否把请求结果直接写入目标字段。",
1041
+ "type": [
1042
+ "boolean",
1043
+ "null"
1044
+ ]
1045
+ },
1046
+ "jsonValue": {
1047
+ "description": "bodyType 为 json 时的 JSON 请求体字符串。",
1048
+ "type": [
1049
+ "string",
1050
+ "null"
1051
+ ]
1052
+ },
1053
+ "method": {
1054
+ "default": "GET",
1055
+ "description": "HTTP 方法;当前 Q-Linker 仅支持 GET 和 POST,缺失时按 GET 处理。",
1056
+ "enum": [
1057
+ "GET",
1058
+ "POST"
1059
+ ]
1060
+ },
1061
+ "queryParams": {
1062
+ "description": "URL 查询参数键值对。",
1063
+ "items": {
1064
+ "$ref": "#/$defs/QLinkerKeyValue"
1065
+ },
1066
+ "type": "array"
1067
+ },
1068
+ "resultType": {
1069
+ "default": "json",
1070
+ "description": "响应解析格式;分别映射后端 resultType 1、2、3。",
1071
+ "enum": [
1072
+ "json",
1073
+ "xml",
1074
+ "text"
1075
+ ]
1076
+ },
1077
+ "url": {
1078
+ "description": "请求 URL。",
1079
+ "minLength": 1,
1080
+ "type": "string"
1081
+ },
1082
+ "urlEncodedValue": {
1083
+ "description": "bodyType 为 url_encoded 时的表单键值对。",
1084
+ "items": {
1085
+ "$ref": "#/$defs/QLinkerKeyValue"
1086
+ },
1087
+ "type": "array"
1088
+ },
1089
+ "xmlValue": {
1090
+ "description": "bodyType 为 xml 时的 XML 请求体字符串。",
1091
+ "type": [
1092
+ "string",
1093
+ "null"
1094
+ ]
1095
+ }
1096
+ },
1097
+ "required": [
1098
+ "url"
1099
+ ],
1100
+ "type": "object"
1101
+ },
1102
+ "RelationConfig": {
1103
+ "additionalProperties": false,
1104
+ "description": "引用字段配置;引用其他应用中的数据。",
1105
+ "properties": {
1106
+ "displayField": {
1107
+ "$ref": "#/$defs/FieldSelector",
1108
+ "description": "引用值的主展示字段。"
1109
+ },
1110
+ "relationMode": {
1111
+ "default": "single",
1112
+ "description": "单条引用或多条引用;缺失时按 single 处理。",
1113
+ "enum": [
1114
+ "single",
1115
+ "multiple"
1116
+ ]
1117
+ },
1118
+ "targetAppKey": {
1119
+ "description": "被引用应用的 appKey。",
1120
+ "minLength": 1,
1121
+ "type": "string"
1122
+ },
1123
+ "visibleFields": {
1124
+ "description": "引用选择界面额外展示的字段。",
1125
+ "items": {
1126
+ "$ref": "#/$defs/FieldSelector"
1127
+ },
1128
+ "type": "array",
1129
+ "uniqueItems": true
1130
+ }
1131
+ },
1132
+ "required": [
1133
+ "targetAppKey",
1134
+ "displayField"
1135
+ ],
1136
+ "type": "object"
1137
+ },
1138
+ "RowBlock": {
1139
+ "additionalProperties": false,
1140
+ "description": "根级普通字段行;字段顺序即展示顺序。",
1141
+ "properties": {
1142
+ "fields": {
1143
+ "description": "本行的 1 到 4 个顶层字段。",
1144
+ "items": {
1145
+ "$ref": "#/$defs/TopField"
1146
+ },
1147
+ "maxItems": 4,
1148
+ "minItems": 1,
1149
+ "type": "array"
1150
+ },
1151
+ "kind": {
1152
+ "const": "row",
1153
+ "description": "普通行判别值。"
1154
+ }
1155
+ },
1156
+ "required": [
1157
+ "kind",
1158
+ "fields"
1159
+ ],
1160
+ "type": "object"
1161
+ },
1162
+ "SectionBlock": {
1163
+ "additionalProperties": false,
1164
+ "description": "段落布局容器;不是业务字段,必须独占一个根级块。",
1165
+ "properties": {
1166
+ "kind": {
1167
+ "const": "section",
1168
+ "description": "段落判别值。"
1169
+ },
1170
+ "rows": {
1171
+ "description": "段落内的非空有序字段行。",
1172
+ "items": {
1173
+ "$ref": "#/$defs/FieldRow"
1174
+ },
1175
+ "minItems": 1,
1176
+ "type": "array"
1177
+ },
1178
+ "sectionId": {
1179
+ "description": "已有段落的真实身份;get 把后端数值 queId 输出为无前导零的正十进制字符串,apply 仅在构造后端 payload 时转回数值 queId,新增段落省略。",
1180
+ "pattern": "^[1-9][0-9]*$",
1181
+ "type": "string"
1182
+ },
1183
+ "title": {
1184
+ "description": "段落标题。",
1185
+ "minLength": 1,
1186
+ "type": "string"
1187
+ }
1188
+ },
1189
+ "required": [
1190
+ "kind",
1191
+ "title",
1192
+ "rows"
1193
+ ],
1194
+ "type": "object"
1195
+ },
1196
+ "SerialComponent": {
1197
+ "description": "自定义编号的组成部分;id 仅用于复用已有组件。",
1198
+ "oneOf": [
1199
+ {
1200
+ "additionalProperties": false,
1201
+ "properties": {
1202
+ "id": {
1203
+ "description": "后端生成的组件 ID;get 返回,新增时省略。",
1204
+ "minimum": 1,
1205
+ "type": "integer"
1206
+ },
1207
+ "length": {
1208
+ "description": "自动计数部分的位数。",
1209
+ "maximum": 9,
1210
+ "minimum": 3,
1211
+ "type": "integer"
1212
+ },
1213
+ "repeatPeriod": {
1214
+ "description": "自动计数器的重置周期。",
1215
+ "enum": [
1216
+ "none",
1217
+ "day",
1218
+ "week",
1219
+ "month",
1220
+ "year"
1221
+ ]
1222
+ },
1223
+ "type": {
1224
+ "const": "auto_count"
1225
+ }
1226
+ },
1227
+ "required": [
1228
+ "type",
1229
+ "length",
1230
+ "repeatPeriod"
1231
+ ],
1232
+ "type": "object"
1233
+ },
1234
+ {
1235
+ "additionalProperties": false,
1236
+ "properties": {
1237
+ "dateFormat": {
1238
+ "description": "提交时间在编号中的格式。",
1239
+ "enum": [
1240
+ "year",
1241
+ "year_month",
1242
+ "year_month_day"
1243
+ ]
1244
+ },
1245
+ "id": {
1246
+ "minimum": 1,
1247
+ "type": "integer"
1248
+ },
1249
+ "type": {
1250
+ "const": "submit_datetime"
1251
+ }
1252
+ },
1253
+ "required": [
1254
+ "type",
1255
+ "dateFormat"
1256
+ ],
1257
+ "type": "object"
1258
+ },
1259
+ {
1260
+ "additionalProperties": false,
1261
+ "properties": {
1262
+ "id": {
1263
+ "minimum": 1,
1264
+ "type": "integer"
1265
+ },
1266
+ "type": {
1267
+ "const": "fixed_text"
1268
+ },
1269
+ "value": {
1270
+ "description": "固定拼接文本。",
1271
+ "minLength": 1,
1272
+ "type": "string"
1273
+ }
1274
+ },
1275
+ "required": [
1276
+ "type",
1277
+ "value"
1278
+ ],
1279
+ "type": "object"
1280
+ },
1281
+ {
1282
+ "additionalProperties": false,
1283
+ "properties": {
1284
+ "dateFormat": {
1285
+ "description": "来源为日期字段时的格式。",
1286
+ "enum": [
1287
+ "year",
1288
+ "year_month",
1289
+ "year_month_day"
1290
+ ]
1291
+ },
1292
+ "field": {
1293
+ "$ref": "#/$defs/FieldSelector",
1294
+ "description": "取值来源字段。"
1295
+ },
1296
+ "id": {
1297
+ "minimum": 1,
1298
+ "type": "integer"
1299
+ },
1300
+ "type": {
1301
+ "const": "field"
1302
+ }
1303
+ },
1304
+ "required": [
1305
+ "type",
1306
+ "field"
1307
+ ],
1308
+ "type": "object"
1309
+ }
1310
+ ]
1311
+ },
1312
+ "SerialNumber": {
1313
+ "description": "应用数据编号配置;自定义模式必须且只能包含一个自动计数组件。",
1314
+ "oneOf": [
1315
+ {
1316
+ "additionalProperties": false,
1317
+ "properties": {
1318
+ "mode": {
1319
+ "const": "default",
1320
+ "description": "使用系统默认编号规则。"
1321
+ }
1322
+ },
1323
+ "required": [
1324
+ "mode"
1325
+ ],
1326
+ "type": "object"
1327
+ },
1328
+ {
1329
+ "additionalProperties": false,
1330
+ "properties": {
1331
+ "components": {
1332
+ "contains": {
1333
+ "properties": {
1334
+ "type": {
1335
+ "const": "auto_count"
1336
+ }
1337
+ },
1338
+ "required": [
1339
+ "type"
1340
+ ],
1341
+ "type": "object"
1342
+ },
1343
+ "description": "自定义编号组件的完整有序目标态。",
1344
+ "items": {
1345
+ "$ref": "#/$defs/SerialComponent"
1346
+ },
1347
+ "maxContains": 1,
1348
+ "minContains": 1,
1349
+ "minItems": 1,
1350
+ "type": "array"
1351
+ },
1352
+ "mode": {
1353
+ "const": "custom",
1354
+ "description": "使用按数组顺序拼接的自定义编号组件。"
1355
+ }
1356
+ },
1357
+ "required": [
1358
+ "mode",
1359
+ "components"
1360
+ ],
1361
+ "type": "object"
1362
+ }
1363
+ ]
1364
+ },
1365
+ "Style": {
1366
+ "additionalProperties": false,
1367
+ "description": "表单背景和头部视觉样式;颜色使用 CSS 颜色字符串。",
1368
+ "properties": {
1369
+ "bgColor": {
1370
+ "description": "表单背景色;null 表示清除。",
1371
+ "type": [
1372
+ "string",
1373
+ "null"
1374
+ ]
1375
+ },
1376
+ "bgImage": {
1377
+ "description": "表单背景图片 URL;null 表示清除。",
1378
+ "type": [
1379
+ "string",
1380
+ "null"
1381
+ ]
1382
+ },
1383
+ "fontColor": {
1384
+ "description": "表单头部字体颜色;null 表示清除。",
1385
+ "type": [
1386
+ "string",
1387
+ "null"
1388
+ ]
1389
+ },
1390
+ "headerColor": {
1391
+ "description": "表单头部背景色;null 表示清除。",
1392
+ "type": [
1393
+ "string",
1394
+ "null"
1395
+ ]
1396
+ },
1397
+ "headerImage": {
1398
+ "description": "表单头图 URL;null 表示清除。",
1399
+ "type": [
1400
+ "string",
1401
+ "null"
1402
+ ]
1403
+ },
1404
+ "opacity": {
1405
+ "description": "背景透明度,取值 0 到 1;null 表示清除。",
1406
+ "maximum": 1,
1407
+ "minimum": 0,
1408
+ "type": [
1409
+ "number",
1410
+ "null"
1411
+ ]
1412
+ }
1413
+ },
1414
+ "type": "object"
1415
+ },
1416
+ "SubField": {
1417
+ "allOf": [
1418
+ {
1419
+ "$ref": "#/$defs/SubFieldCommon"
1420
+ },
1421
+ {
1422
+ "oneOf": [
1423
+ {
1424
+ "properties": {
1425
+ "config": {
1426
+ "$ref": "#/$defs/EmptyConfig"
1427
+ },
1428
+ "type": {
1429
+ "enum": [
1430
+ "text",
1431
+ "long_text",
1432
+ "number",
1433
+ "link",
1434
+ "date",
1435
+ "phone",
1436
+ "email",
1437
+ "attachment",
1438
+ "member"
1439
+ ]
1440
+ }
1441
+ },
1442
+ "required": [
1443
+ "type"
1444
+ ]
1445
+ },
1446
+ {
1447
+ "properties": {
1448
+ "config": {
1449
+ "$ref": "#/$defs/ChoiceConfig"
1450
+ },
1451
+ "type": {
1452
+ "enum": [
1453
+ "single_choice",
1454
+ "single_select",
1455
+ "multi_select"
1456
+ ]
1457
+ }
1458
+ },
1459
+ "required": [
1460
+ "type",
1461
+ "config"
1462
+ ]
1463
+ },
1464
+ {
1465
+ "properties": {
1466
+ "config": {
1467
+ "$ref": "#/$defs/DepartmentConfig"
1468
+ },
1469
+ "type": {
1470
+ "const": "department"
1471
+ }
1472
+ },
1473
+ "required": [
1474
+ "type",
1475
+ "config"
1476
+ ]
1477
+ },
1478
+ {
1479
+ "properties": {
1480
+ "config": {
1481
+ "$ref": "#/$defs/RelationConfig"
1482
+ },
1483
+ "type": {
1484
+ "const": "relation"
1485
+ }
1486
+ },
1487
+ "required": [
1488
+ "type",
1489
+ "config"
1490
+ ]
1491
+ },
1492
+ {
1493
+ "properties": {
1494
+ "config": {
1495
+ "$ref": "#/$defs/DataRelationConfig"
1496
+ },
1497
+ "type": {
1498
+ "const": "data_relation"
1499
+ }
1500
+ },
1501
+ "required": [
1502
+ "type",
1503
+ "config"
1504
+ ]
1505
+ }
1506
+ ]
1507
+ }
1508
+ ],
1509
+ "description": "表格子字段;仅允许一期白名单类型,不包含布局宽度。",
1510
+ "type": "object",
1511
+ "unevaluatedProperties": false
1512
+ },
1513
+ "SubFieldCommon": {
1514
+ "description": "表格子字段的公共属性;不允许 dataTitle、dataCover 或 width。",
1515
+ "properties": {
1516
+ "description": {
1517
+ "description": "子字段说明;null 或空字符串表示清空。",
1518
+ "type": [
1519
+ "string",
1520
+ "null"
1521
+ ]
1522
+ },
1523
+ "name": {
1524
+ "description": "子字段展示名称;在所属表格内唯一。",
1525
+ "minLength": 1,
1526
+ "type": "string"
1527
+ },
1528
+ "queId": {
1529
+ "description": "已有子字段的后端 ID;新增时省略。",
1530
+ "minimum": 1,
1531
+ "type": "integer"
1532
+ },
1533
+ "required": {
1534
+ "description": "是否必填;缺失时保留当前值。",
1535
+ "type": "boolean"
1536
+ }
1537
+ },
1538
+ "required": [
1539
+ "name"
1540
+ ],
1541
+ "type": "object"
1542
+ },
1543
+ "TopField": {
1544
+ "allOf": [
1545
+ {
1546
+ "$ref": "#/$defs/FieldCommon"
1547
+ },
1548
+ {
1549
+ "oneOf": [
1550
+ {
1551
+ "properties": {
1552
+ "config": {
1553
+ "$ref": "#/$defs/EmptyConfig"
1554
+ },
1555
+ "type": {
1556
+ "enum": [
1557
+ "text",
1558
+ "long_text",
1559
+ "number",
1560
+ "amount",
1561
+ "link",
1562
+ "date",
1563
+ "datetime",
1564
+ "member",
1565
+ "phone",
1566
+ "email",
1567
+ "address",
1568
+ "attachment"
1569
+ ]
1570
+ }
1571
+ },
1572
+ "required": [
1573
+ "type"
1574
+ ]
1575
+ },
1576
+ {
1577
+ "properties": {
1578
+ "config": {
1579
+ "$ref": "#/$defs/ChoiceConfig"
1580
+ },
1581
+ "type": {
1582
+ "enum": [
1583
+ "single_choice",
1584
+ "single_select",
1585
+ "multi_select"
1586
+ ]
1587
+ }
1588
+ },
1589
+ "required": [
1590
+ "type",
1591
+ "config"
1592
+ ]
1593
+ },
1594
+ {
1595
+ "properties": {
1596
+ "config": {
1597
+ "$ref": "#/$defs/DepartmentConfig"
1598
+ },
1599
+ "type": {
1600
+ "const": "department"
1601
+ }
1602
+ },
1603
+ "required": [
1604
+ "type",
1605
+ "config"
1606
+ ]
1607
+ },
1608
+ {
1609
+ "properties": {
1610
+ "config": {
1611
+ "$ref": "#/$defs/RelationConfig"
1612
+ },
1613
+ "type": {
1614
+ "const": "relation"
1615
+ }
1616
+ },
1617
+ "required": [
1618
+ "type",
1619
+ "config"
1620
+ ]
1621
+ },
1622
+ {
1623
+ "properties": {
1624
+ "config": {
1625
+ "$ref": "#/$defs/QLinkerConfig"
1626
+ },
1627
+ "type": {
1628
+ "const": "q_linker"
1629
+ }
1630
+ },
1631
+ "required": [
1632
+ "type",
1633
+ "config"
1634
+ ]
1635
+ },
1636
+ {
1637
+ "properties": {
1638
+ "config": {
1639
+ "$ref": "#/$defs/CodeBlockConfig"
1640
+ },
1641
+ "type": {
1642
+ "const": "code_block"
1643
+ }
1644
+ },
1645
+ "required": [
1646
+ "type",
1647
+ "config"
1648
+ ]
1649
+ },
1650
+ {
1651
+ "properties": {
1652
+ "config": {
1653
+ "$ref": "#/$defs/DataRelationConfig"
1654
+ },
1655
+ "type": {
1656
+ "const": "data_relation"
1657
+ }
1658
+ },
1659
+ "required": [
1660
+ "type",
1661
+ "config"
1662
+ ]
1663
+ },
1664
+ {
1665
+ "properties": {
1666
+ "config": {
1667
+ "$ref": "#/$defs/EmptyConfig"
1668
+ },
1669
+ "subfields": {
1670
+ "items": {
1671
+ "$ref": "#/$defs/SubField"
1672
+ },
1673
+ "minItems": 1,
1674
+ "type": "array"
1675
+ },
1676
+ "type": {
1677
+ "const": "subtable"
1678
+ }
1679
+ },
1680
+ "required": [
1681
+ "type",
1682
+ "subfields"
1683
+ ]
1684
+ }
1685
+ ]
1686
+ }
1687
+ ],
1688
+ "description": "顶层业务字段;type 决定 config 或 subfields 的结构。",
1689
+ "type": "object",
1690
+ "unevaluatedProperties": false
1691
+ }
1692
+ },
1693
+ "$id": "https://builder.qingflow.com/schemas/app-form-apply/v1alpha1.json",
1694
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
1695
+ "oneOf": [
1696
+ {
1697
+ "properties": {
1698
+ "spec": {
1699
+ "not": {
1700
+ "anyOf": [
1701
+ {
1702
+ "required": [
1703
+ "icon"
1704
+ ]
1705
+ },
1706
+ {
1707
+ "required": [
1708
+ "color"
1709
+ ]
1710
+ }
1711
+ ]
1712
+ }
1713
+ }
1714
+ },
1715
+ "required": [
1716
+ "appKey"
1717
+ ]
1718
+ },
1719
+ {
1720
+ "not": {
1721
+ "required": [
1722
+ "appKey"
1723
+ ]
1724
+ },
1725
+ "properties": {
1726
+ "spec": {
1727
+ "required": [
1728
+ "appName",
1729
+ "icon",
1730
+ "color"
1731
+ ]
1732
+ }
1733
+ },
1734
+ "required": [
1735
+ "packageId"
1736
+ ]
1737
+ }
1738
+ ],
1739
+ "properties": {
1740
+ "apiVersion": {
1741
+ "const": "builder.qingflow.com/v1alpha1",
1742
+ "description": "AppForm 契约版本;一期固定为 v1alpha1。"
1743
+ },
1744
+ "appKey": {
1745
+ "description": "更新已有应用的唯一标识;存在非空值即进入更新模式。",
1746
+ "minLength": 1,
1747
+ "type": "string"
1748
+ },
1749
+ "packageId": {
1750
+ "description": "创建时指定新应用所属包;更新时确保该包引用应用,不移除其他包引用。",
1751
+ "minimum": 1,
1752
+ "type": "integer"
1753
+ },
1754
+ "spec": {
1755
+ "$ref": "#/$defs/AppFormSpec",
1756
+ "description": "应用表单的最终声明状态。"
1757
+ }
1758
+ },
1759
+ "required": [
1760
+ "apiVersion",
1761
+ "spec"
1762
+ ],
1763
+ "title": "Qingflow AppFormApply v1alpha1",
1764
+ "type": "object",
1765
+ "unevaluatedProperties": false
1766
+ }