@qingflow-tech/qingflow-cli 1.1.43 → 1.1.44-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 (77) hide show
  1. package/README.md +13 -6
  2. package/entry_point.py +1 -1
  3. package/npm/bin/qingflow.mjs +1 -2
  4. package/npm/lib/runtime.mjs +3 -7
  5. package/package.json +2 -2
  6. package/pyproject.toml +3 -4
  7. package/skills/qingflow-app-form/SKILL.md +66 -0
  8. package/skills/qingflow-app-form/agents/openai.yaml +4 -0
  9. package/skills/qingflow-cli/SKILL.md +8 -6
  10. package/skills/qingflow-cli/manifest.yaml +1 -1
  11. package/skills/qingflow-cli/reference/QINGFLOW_CLI_BUILDER_APP_DELIVERY_WORKFLOW.md +4 -4
  12. package/skills/qingflow-cli/reference/QINGFLOW_CLI_EXPLORATION_REPORT.md +1 -1
  13. package/skills/qingflow-cli/reference/QINGFLOW_CLI_FIELD_DATA_TYPES.md +1 -1
  14. package/skills/qingflow-cli/reference/QINGFLOW_CLI_SCHEMA_APPLY_FIELD_TYPES_AND_SCENARIOS.md +4 -4
  15. package/skills/qingflow-cli/reference/builder/10-build-single-app.md +5 -5
  16. package/skills/qingflow-cli/reference/builder/20-build-complete-system.md +14 -14
  17. package/skills/qingflow-cli/reference/builder/30-schema-fields.md +106 -103
  18. package/skills/qingflow-cli/reference/builder/40-layout.md +39 -31
  19. package/skills/qingflow-cli/reference/builder/README.md +9 -9
  20. package/skills/qingflow-cli/reference/builder/code-integrations/README.md +4 -2
  21. package/skills/qingflow-cli/reference/builder/code-integrations/code-block.md +2 -0
  22. package/skills/qingflow-cli/reference/builder/code-integrations/q-linker.md +2 -0
  23. package/skills/qingflow-cli/reference/builder/reference/app-delivery-sop.md +45 -38
  24. package/skills/qingflow-cli/reference/core/QINGFLOW_CLI_EXPLORATION_REPORT.md +1 -1
  25. package/skills/qingflow-cli/reference/core/QINGFLOW_CLI_FIELD_DATA_TYPES.md +1 -1
  26. package/skills/qingflow-cli/reference/examples/README.md +3 -3
  27. package/skills/qingflow-common/SKILL.md +47 -0
  28. package/skills/qingflow-common/agents/openai.yaml +4 -0
  29. package/src/qingflow_mcp/__main__.py +2 -3
  30. package/src/qingflow_mcp/app_form_compat.py +104 -0
  31. package/src/qingflow_mcp/app_form_validator.py +462 -0
  32. package/src/qingflow_mcp/builder_facade/app_form.py +4196 -0
  33. package/src/qingflow_mcp/builder_facade/app_form_schema.py +425 -0
  34. package/src/qingflow_mcp/builder_facade/schemas/app_form/manifest.json +42 -0
  35. package/src/qingflow_mcp/builder_facade/schemas/app_form/v1alpha1/complete.json +2969 -0
  36. package/src/qingflow_mcp/builder_facade/schemas/app_form/v1alpha1/fields/address.json +392 -0
  37. package/src/qingflow_mcp/builder_facade/schemas/app_form/v1alpha1/fields/amount.json +236 -0
  38. package/src/qingflow_mcp/builder_facade/schemas/app_form/v1alpha1/fields/attachment.json +425 -0
  39. package/src/qingflow_mcp/builder_facade/schemas/app_form/v1alpha1/fields/code_block.json +318 -0
  40. package/src/qingflow_mcp/builder_facade/schemas/app_form/v1alpha1/fields/data_relation.json +580 -0
  41. package/src/qingflow_mcp/builder_facade/schemas/app_form/v1alpha1/fields/date.json +150 -0
  42. package/src/qingflow_mcp/builder_facade/schemas/app_form/v1alpha1/fields/datetime.json +150 -0
  43. package/src/qingflow_mcp/builder_facade/schemas/app_form/v1alpha1/fields/department.json +345 -0
  44. package/src/qingflow_mcp/builder_facade/schemas/app_form/v1alpha1/fields/email.json +190 -0
  45. package/src/qingflow_mcp/builder_facade/schemas/app_form/v1alpha1/fields/link.json +190 -0
  46. package/src/qingflow_mcp/builder_facade/schemas/app_form/v1alpha1/fields/long_text.json +190 -0
  47. package/src/qingflow_mcp/builder_facade/schemas/app_form/v1alpha1/fields/member.json +484 -0
  48. package/src/qingflow_mcp/builder_facade/schemas/app_form/v1alpha1/fields/multi_select.json +214 -0
  49. package/src/qingflow_mcp/builder_facade/schemas/app_form/v1alpha1/fields/number.json +236 -0
  50. package/src/qingflow_mcp/builder_facade/schemas/app_form/v1alpha1/fields/phone.json +199 -0
  51. package/src/qingflow_mcp/builder_facade/schemas/app_form/v1alpha1/fields/q_linker.json +412 -0
  52. package/src/qingflow_mcp/builder_facade/schemas/app_form/v1alpha1/fields/relation.json +454 -0
  53. package/src/qingflow_mcp/builder_facade/schemas/app_form/v1alpha1/fields/single_choice.json +214 -0
  54. package/src/qingflow_mcp/builder_facade/schemas/app_form/v1alpha1/fields/single_select.json +214 -0
  55. package/src/qingflow_mcp/builder_facade/schemas/app_form/v1alpha1/fields/subtable.json +1921 -0
  56. package/src/qingflow_mcp/builder_facade/schemas/app_form/v1alpha1/fields/text.json +190 -0
  57. package/src/qingflow_mcp/builder_facade/schemas/app_form/v1alpha1/formula.json +1594 -0
  58. package/src/qingflow_mcp/builder_facade/schemas/app_form/v1alpha1/summary.json +718 -0
  59. package/src/qingflow_mcp/builder_facade/service.py +8 -4
  60. package/src/qingflow_mcp/cli/commands/builder.py +93 -28
  61. package/src/qingflow_mcp/cli/json_io.py +21 -2
  62. package/src/qingflow_mcp/cli/main.py +3 -39
  63. package/src/qingflow_mcp/public_surface.py +5 -2
  64. package/src/qingflow_mcp/response_trim.py +50 -0
  65. package/src/qingflow_mcp/server.py +24 -3
  66. package/src/qingflow_mcp/server_app_builder.py +44 -87
  67. package/src/qingflow_mcp/tools/ai_builder_tools.py +103 -100
  68. package/src/qingflow_mcp/tools/app_tools.py +46 -65
  69. package/src/qingflow_mcp/tools/record_tools.py +3 -3
  70. package/src/qingflow_mcp/version.py +2 -4
  71. package/docs/local-agent-install.md +0 -370
  72. package/skills/qingflow-mcp-setup/SKILL.md +0 -115
  73. package/skills/qingflow-mcp-setup/agents/openai.yaml +0 -4
  74. package/skills/qingflow-mcp-setup/references/claude-desktop.md +0 -34
  75. package/skills/qingflow-mcp-setup/references/environments.md +0 -62
  76. package/skills/qingflow-mcp-setup/references/generic-stdio.md +0 -32
  77. package/skills/qingflow-mcp-setup/scripts/check_local_server.sh +0 -38
@@ -0,0 +1,2969 @@
1
+ {
2
+ "$defs": {
3
+ "AddressConfig": {
4
+ "additionalProperties": false,
5
+ "description": "地址精度、定位和扫码配置;defaultValues 使用 AnswerDetail 结构。",
6
+ "properties": {
7
+ "addressPrecision": {
8
+ "minimum": 0,
9
+ "type": [
10
+ "integer",
11
+ "null"
12
+ ]
13
+ },
14
+ "canScan": {
15
+ "type": [
16
+ "boolean",
17
+ "null"
18
+ ]
19
+ },
20
+ "defaultValues": {
21
+ "oneOf": [
22
+ {
23
+ "type": "null"
24
+ },
25
+ {
26
+ "$ref": "#/$defs/DefaultValues"
27
+ }
28
+ ]
29
+ },
30
+ "pickPosition": {
31
+ "type": [
32
+ "boolean",
33
+ "null"
34
+ ]
35
+ },
36
+ "scanType": {
37
+ "minimum": 0,
38
+ "type": [
39
+ "integer",
40
+ "null"
41
+ ]
42
+ }
43
+ },
44
+ "type": "object"
45
+ },
46
+ "AliasSelector": {
47
+ "additionalProperties": false,
48
+ "description": "Q-Linker 或代码块输出别名;已有输出优先携带 aliasId。",
49
+ "properties": {
50
+ "aliasId": {
51
+ "description": "后端生成的别名 ID;新增输出时可省略。",
52
+ "minimum": 1,
53
+ "type": "integer"
54
+ },
55
+ "name": {
56
+ "description": "输出别名名称。",
57
+ "minLength": 1,
58
+ "type": "string"
59
+ }
60
+ },
61
+ "type": "object"
62
+ },
63
+ "AnswerValue": {
64
+ "additionalProperties": false,
65
+ "properties": {
66
+ "dataValue": {
67
+ "type": [
68
+ "string",
69
+ "null"
70
+ ]
71
+ },
72
+ "email": {
73
+ "type": [
74
+ "string",
75
+ "null"
76
+ ]
77
+ },
78
+ "id": {
79
+ "type": [
80
+ "integer",
81
+ "null"
82
+ ]
83
+ },
84
+ "optionId": {
85
+ "type": [
86
+ "string",
87
+ "null"
88
+ ]
89
+ },
90
+ "ordinal": {
91
+ "type": [
92
+ "integer",
93
+ "null"
94
+ ]
95
+ },
96
+ "otherInfo": {
97
+ "type": [
98
+ "string",
99
+ "null"
100
+ ]
101
+ },
102
+ "pluginValue": {
103
+ "type": [
104
+ "string",
105
+ "null"
106
+ ]
107
+ },
108
+ "queId": {
109
+ "type": [
110
+ "integer",
111
+ "null"
112
+ ]
113
+ },
114
+ "value": {
115
+ "type": [
116
+ "string",
117
+ "null"
118
+ ]
119
+ },
120
+ "valueStr": {
121
+ "type": [
122
+ "string",
123
+ "null"
124
+ ]
125
+ }
126
+ },
127
+ "type": "object"
128
+ },
129
+ "AppFormSpec": {
130
+ "additionalProperties": false,
131
+ "description": "表单基础配置与字段布局目标态;除 body 外,缺失属性表示保留当前值。应用内所有 q_linker 和 code_block 字段的 outputs[].targetField 必须全局唯一,同一实际字段只能被一个输出映射写入。多个生产方需要回写时,请选择不同目标字段或合并为一个生产方。",
132
+ "properties": {
133
+ "appDescription": {
134
+ "description": "应用描述;null 或空字符串表示清空。",
135
+ "type": [
136
+ "string",
137
+ "null"
138
+ ]
139
+ },
140
+ "appName": {
141
+ "description": "应用名称;缺失时保留当前名称。",
142
+ "minLength": 1,
143
+ "type": "string"
144
+ },
145
+ "attachments": {
146
+ "description": "应用附件完整目标态;空数组表示删除全部应用附件。",
147
+ "items": {
148
+ "$ref": "#/$defs/Attachment"
149
+ },
150
+ "type": "array"
151
+ },
152
+ "body": {
153
+ "$ref": "#/$defs/Body",
154
+ "description": "业务字段与布局的完整目标态;缺失字段或段落表示删除。应用内所有 Q-Linker 和代码块的 outputs[].targetField 不得重复选择同一实际字段。"
155
+ },
156
+ "dataCoverField": {
157
+ "description": "数据封面字段选择器;指定每条数据的封面附件来源。仅允许选择顶层 attachment 字段;null 表示清除数据封面。",
158
+ "oneOf": [
159
+ {
160
+ "type": "null"
161
+ },
162
+ {
163
+ "$ref": "#/$defs/FieldSelector"
164
+ }
165
+ ]
166
+ },
167
+ "dataTitleField": {
168
+ "description": "数据标题字段选择器;指定每条数据的主显示标题来源。创建非空 body 时必填,更新时省略表示保留当前选择;显式提供时必须唯一定位一个顶层字段,仅 body 为空时允许 null。",
169
+ "oneOf": [
170
+ {
171
+ "type": "null"
172
+ },
173
+ {
174
+ "$ref": "#/$defs/FieldSelector"
175
+ }
176
+ ]
177
+ },
178
+ "serialNumber": {
179
+ "$ref": "#/$defs/SerialNumber",
180
+ "description": "应用编号规则;支持默认编号或自定义组件编号。"
181
+ }
182
+ },
183
+ "required": [
184
+ "body"
185
+ ],
186
+ "type": "object"
187
+ },
188
+ "Attachment": {
189
+ "additionalProperties": false,
190
+ "description": "应用级附件;已有附件由 attachId 复用,新增附件省略 attachId。",
191
+ "properties": {
192
+ "attachId": {
193
+ "description": "后端生成的附件 ID;get 返回,新增时省略。",
194
+ "minimum": 1,
195
+ "type": "integer"
196
+ },
197
+ "fileName": {
198
+ "description": "附件展示名称。",
199
+ "minLength": 1,
200
+ "type": "string"
201
+ },
202
+ "fileUrl": {
203
+ "description": "已上传文件的可访问 URL。",
204
+ "minLength": 1,
205
+ "type": "string"
206
+ }
207
+ },
208
+ "required": [
209
+ "fileName",
210
+ "fileUrl"
211
+ ],
212
+ "type": "object"
213
+ },
214
+ "AttachmentConfig": {
215
+ "additionalProperties": false,
216
+ "description": "附件字段上传限制。",
217
+ "properties": {
218
+ "canScan": {
219
+ "type": [
220
+ "boolean",
221
+ "null"
222
+ ]
223
+ },
224
+ "defaultValues": {
225
+ "oneOf": [
226
+ {
227
+ "type": "null"
228
+ },
229
+ {
230
+ "$ref": "#/$defs/DefaultValues"
231
+ }
232
+ ]
233
+ },
234
+ "fileBeingCaptureOnly": {
235
+ "minimum": 0,
236
+ "type": [
237
+ "integer",
238
+ "null"
239
+ ]
240
+ },
241
+ "fileSize": {
242
+ "minimum": 1,
243
+ "type": [
244
+ "integer",
245
+ "null"
246
+ ]
247
+ },
248
+ "fileType": {
249
+ "items": {
250
+ "minLength": 1,
251
+ "type": "string"
252
+ },
253
+ "type": "array"
254
+ },
255
+ "imageCompress": {
256
+ "type": [
257
+ "boolean",
258
+ "null"
259
+ ]
260
+ },
261
+ "maxFileLimit": {
262
+ "minimum": 1,
263
+ "type": [
264
+ "integer",
265
+ "null"
266
+ ]
267
+ },
268
+ "maxFileLimitStatus": {
269
+ "type": [
270
+ "boolean",
271
+ "null"
272
+ ]
273
+ },
274
+ "pluginStatus": {
275
+ "type": [
276
+ "boolean",
277
+ "null"
278
+ ]
279
+ },
280
+ "scanType": {
281
+ "minimum": 0,
282
+ "type": [
283
+ "integer",
284
+ "null"
285
+ ]
286
+ }
287
+ },
288
+ "type": "object"
289
+ },
290
+ "Body": {
291
+ "description": "有序表单内容块;空数组表示删除全部业务字段和段落。",
292
+ "items": {
293
+ "$ref": "#/$defs/BodyBlock"
294
+ },
295
+ "type": "array"
296
+ },
297
+ "BodyBlock": {
298
+ "description": "根级普通行或独占外层位置的段落。",
299
+ "oneOf": [
300
+ {
301
+ "$ref": "#/$defs/RowBlock"
302
+ },
303
+ {
304
+ "$ref": "#/$defs/SectionBlock"
305
+ }
306
+ ]
307
+ },
308
+ "ChoiceConfig": {
309
+ "additionalProperties": false,
310
+ "description": "选择类字段配置。",
311
+ "properties": {
312
+ "beingShowColor": {
313
+ "description": "是否展示选项颜色。",
314
+ "type": [
315
+ "boolean",
316
+ "null"
317
+ ]
318
+ },
319
+ "defaultOptions": {
320
+ "description": "选项默认选中状态;值必须来自 options,省略表示保留现有状态。",
321
+ "items": {
322
+ "minLength": 1,
323
+ "type": "string"
324
+ },
325
+ "type": "array",
326
+ "uniqueItems": true
327
+ },
328
+ "maxOpts": {
329
+ "description": "最多选择项数;null 表示不限制。",
330
+ "minimum": 0,
331
+ "type": [
332
+ "integer",
333
+ "null"
334
+ ]
335
+ },
336
+ "minOpts": {
337
+ "description": "最少选择项数;null 表示不限制。",
338
+ "minimum": 0,
339
+ "type": [
340
+ "integer",
341
+ "null"
342
+ ]
343
+ },
344
+ "optDirection": {
345
+ "description": "选项排列方向 ID。",
346
+ "minimum": 0,
347
+ "type": [
348
+ "integer",
349
+ "null"
350
+ ]
351
+ },
352
+ "optSelectMode": {
353
+ "description": "多项选择模式 ID。",
354
+ "minimum": 0,
355
+ "type": [
356
+ "integer",
357
+ "null"
358
+ ]
359
+ },
360
+ "options": {
361
+ "description": "非空有序选项文案;缺失选项表示从该字段配置中删除。",
362
+ "items": {
363
+ "minLength": 1,
364
+ "type": "string"
365
+ },
366
+ "minItems": 1,
367
+ "type": "array",
368
+ "uniqueItems": true
369
+ }
370
+ },
371
+ "required": [
372
+ "options"
373
+ ],
374
+ "type": "object"
375
+ },
376
+ "CodeBlockBinding": {
377
+ "additionalProperties": false,
378
+ "allOf": [
379
+ {
380
+ "if": {
381
+ "properties": {
382
+ "outputs": {
383
+ "minItems": 1
384
+ }
385
+ },
386
+ "required": [
387
+ "outputs"
388
+ ]
389
+ },
390
+ "then": {
391
+ "properties": {
392
+ "code": {
393
+ "pattern": "(^|[^A-Za-z0-9_$])qf_output\\s*=(?!=)"
394
+ }
395
+ }
396
+ }
397
+ }
398
+ ],
399
+ "description": "代码块的输入、代码和输出映射;配置 outputs 时,代码必须显式给 qf_output 赋值,仅 return 对象不会产生可回写结果。每个输出目标还必须满足应用级唯一性规则,不能与任何代码块或 Q-Linker 的其他输出指向同一实际字段。多个生产方需要回写时,请选择不同目标字段或合并为一个生产方。",
400
+ "properties": {
401
+ "autoTrigger": {
402
+ "description": "是否在输入变化时自动执行代码块。",
403
+ "type": [
404
+ "boolean",
405
+ "null"
406
+ ]
407
+ },
408
+ "code": {
409
+ "description": "业务代码源码;MCP/CLI 仅保存,不执行。inputs 声明的 var 会由 Builder 自动注入。配置 outputs 时必须显式赋值 qf_output,例如 qf_output = { score: input.score };,仅 return 对象或比较 qf_output 不会回写。",
410
+ "minLength": 1,
411
+ "type": "string"
412
+ },
413
+ "customButtonText": {
414
+ "description": "自定义触发按钮文案。",
415
+ "type": [
416
+ "string",
417
+ "null"
418
+ ]
419
+ },
420
+ "customButtonTextEnabled": {
421
+ "description": "是否启用自定义触发按钮文案。",
422
+ "type": [
423
+ "boolean",
424
+ "null"
425
+ ]
426
+ },
427
+ "hideOnForm": {
428
+ "description": "是否在表单填写界面隐藏该代码块字段。",
429
+ "type": [
430
+ "boolean",
431
+ "null"
432
+ ]
433
+ },
434
+ "inputs": {
435
+ "description": "当前表单字段到代码变量的映射。Builder 会在保存时自动生成读取 qf_field 的代码前缀;业务 code 直接使用 var,不要手写 qf_field.{字段名$$ID$$}。",
436
+ "items": {
437
+ "$ref": "#/$defs/CodeBlockInputBinding"
438
+ },
439
+ "type": "array"
440
+ },
441
+ "outputs": {
442
+ "description": "代码输出路径到目标字段的映射;每个 path 必须从代码显式赋值的 qf_output 中读取,且所有 targetField 在整个应用的代码块和 Q-Linker 输出中必须全局唯一。",
443
+ "items": {
444
+ "$ref": "#/$defs/CodeBlockOutputBinding"
445
+ },
446
+ "type": "array"
447
+ }
448
+ },
449
+ "required": [
450
+ "code"
451
+ ],
452
+ "type": "object"
453
+ },
454
+ "CodeBlockConfig": {
455
+ "additionalProperties": false,
456
+ "description": "代码块的高层声明;无法无损还原为该结构时阻断处理。",
457
+ "properties": {
458
+ "codeBlockBinding": {
459
+ "$ref": "#/$defs/CodeBlockBinding"
460
+ }
461
+ },
462
+ "required": [
463
+ "codeBlockBinding"
464
+ ],
465
+ "type": "object"
466
+ },
467
+ "CodeBlockInputBinding": {
468
+ "additionalProperties": false,
469
+ "description": "一个表单字段到代码变量的映射;Builder 自动生成后端字段读取前缀。",
470
+ "properties": {
471
+ "field": {
472
+ "$ref": "#/$defs/FieldSelector",
473
+ "description": "输入来源字段。"
474
+ },
475
+ "var": {
476
+ "description": "业务 code 中直接使用的 JavaScript 变量名;null 表示由 Builder 生成合法且唯一的变量名。",
477
+ "type": [
478
+ "string",
479
+ "null"
480
+ ]
481
+ }
482
+ },
483
+ "required": [
484
+ "field"
485
+ ],
486
+ "type": "object"
487
+ },
488
+ "CodeBlockOutputBinding": {
489
+ "additionalProperties": false,
490
+ "description": "一个代码输出值到表单字段的映射;同一实际目标字段在整个应用中只能被一个代码块或 Q-Linker 输出映射写入。",
491
+ "properties": {
492
+ "alias": {
493
+ "description": "输出别名;用于后续数据关联引用。",
494
+ "minLength": 1,
495
+ "type": "string"
496
+ },
497
+ "aliasId": {
498
+ "description": "后端生成的输出别名 ID;新增输出时省略,Builder 在首次写入后按 alias 与 path 自动回填再保存关系。更新已有输出时必须保留 get 返回值,不得自行编造或置空。",
499
+ "minimum": 1,
500
+ "type": "integer"
501
+ },
502
+ "path": {
503
+ "description": "从 qf_output 中取值的 JSONPath。",
504
+ "minLength": 1,
505
+ "type": "string"
506
+ },
507
+ "targetField": {
508
+ "$ref": "#/$defs/FieldSelector",
509
+ "description": "接收结果的当前表单字段;该字段在整个应用的全部代码块和 Q-Linker outputs 中只能作为 targetField 出现一次,不得被多个输出关系重复写入。"
510
+ }
511
+ },
512
+ "required": [
513
+ "alias",
514
+ "path",
515
+ "targetField"
516
+ ],
517
+ "type": "object"
518
+ },
519
+ "DataRelationCondition": {
520
+ "additionalProperties": false,
521
+ "description": "一条数据关联过滤条件;sourceField 必须属于数据来源,operator 必须适用于该字段类型。固定值请使用 literal operand,不要直接声明后端 matchRules。",
522
+ "properties": {
523
+ "operand": {
524
+ "$ref": "#/$defs/DataRelationOperand",
525
+ "description": "比较值来源;可为字面量、当前表单字段或输出别名。"
526
+ },
527
+ "operator": {
528
+ "description": "比较运算符;Reconciler 会结合字段类型校验可用性。",
529
+ "enum": [
530
+ "equal",
531
+ "not_equal",
532
+ "contains",
533
+ "not_contains",
534
+ "greater_than",
535
+ "greater_or_equal",
536
+ "less_than",
537
+ "less_or_equal",
538
+ "dynamic_range",
539
+ "equal_any",
540
+ "not_equal_any",
541
+ "is_empty",
542
+ "is_not_empty",
543
+ "belongs_to",
544
+ "not_belongs_to",
545
+ "subordinate_to",
546
+ "not_subordinate_to",
547
+ "subordinate_included",
548
+ "subordinate_not_included",
549
+ "fuzzy_match",
550
+ "contains_any",
551
+ "contains_all",
552
+ "decimal_range"
553
+ ]
554
+ },
555
+ "sourceField": {
556
+ "$ref": "#/$defs/FieldSelector",
557
+ "description": "被过滤的数据源字段。"
558
+ }
559
+ },
560
+ "required": [
561
+ "sourceField",
562
+ "operator",
563
+ "operand"
564
+ ],
565
+ "type": "object"
566
+ },
567
+ "DataRelationConfig": {
568
+ "additionalProperties": false,
569
+ "description": "数据关联字段配置;从应用、Q-Linker 或代码块输出中读取数据。",
570
+ "properties": {
571
+ "aggregation": {
572
+ "description": "可选聚合方式;null 表示不聚合。",
573
+ "enum": [
574
+ "sum",
575
+ "average",
576
+ "max",
577
+ "min",
578
+ "first",
579
+ "last",
580
+ "filled_count",
581
+ "empty_count",
582
+ "count",
583
+ null
584
+ ],
585
+ "type": [
586
+ "string",
587
+ "null"
588
+ ]
589
+ },
590
+ "customButton": {
591
+ "$ref": "#/$defs/DataRelationCustomButton",
592
+ "description": "可选自定义按钮配置。"
593
+ },
594
+ "filters": {
595
+ "$ref": "#/$defs/DataRelationFilters",
596
+ "description": "可选过滤条件;支持简单条件组或高级公式。"
597
+ },
598
+ "sort": {
599
+ "$ref": "#/$defs/DataRelationSort",
600
+ "description": "可选排序配置。"
601
+ },
602
+ "source": {
603
+ "$ref": "#/$defs/DataRelationSource",
604
+ "description": "数据来源;按 kind 选择一种来源结构。"
605
+ }
606
+ },
607
+ "required": [
608
+ "source"
609
+ ],
610
+ "type": "object"
611
+ },
612
+ "DataRelationCustomButton": {
613
+ "description": "数据关联自定义按钮;启用时必须引用已有 buttonId。",
614
+ "oneOf": [
615
+ {
616
+ "additionalProperties": false,
617
+ "properties": {
618
+ "enabled": {
619
+ "const": false
620
+ }
621
+ },
622
+ "required": [
623
+ "enabled"
624
+ ],
625
+ "type": "object"
626
+ },
627
+ {
628
+ "additionalProperties": false,
629
+ "properties": {
630
+ "buttonId": {
631
+ "minimum": 1,
632
+ "type": "integer"
633
+ },
634
+ "enabled": {
635
+ "const": true
636
+ }
637
+ },
638
+ "required": [
639
+ "enabled",
640
+ "buttonId"
641
+ ],
642
+ "type": "object"
643
+ }
644
+ ]
645
+ },
646
+ "DataRelationFilters": {
647
+ "description": "simple 模式的外层组为 OR、组内条件为 AND;advanced 模式使用完整公式。simple 条件只声明业务值,builder 会生成后端保存所需的 judgeValues 和 judgeValueDetails,不要在声明中直接填写这两个后端属性。",
648
+ "oneOf": [
649
+ {
650
+ "additionalProperties": false,
651
+ "properties": {
652
+ "groups": {
653
+ "description": "OR 条件组数组;每个内层数组是一组 AND 条件。",
654
+ "items": {
655
+ "items": {
656
+ "$ref": "#/$defs/DataRelationCondition"
657
+ },
658
+ "minItems": 1,
659
+ "type": "array"
660
+ },
661
+ "type": "array"
662
+ },
663
+ "mode": {
664
+ "const": "simple"
665
+ }
666
+ },
667
+ "required": [
668
+ "mode",
669
+ "groups"
670
+ ],
671
+ "type": "object"
672
+ },
673
+ {
674
+ "additionalProperties": false,
675
+ "properties": {
676
+ "formula": {
677
+ "description": "解码后的高级筛选公式。",
678
+ "minLength": 1,
679
+ "type": "string"
680
+ },
681
+ "mode": {
682
+ "const": "advanced"
683
+ }
684
+ },
685
+ "required": [
686
+ "mode",
687
+ "formula"
688
+ ],
689
+ "type": "object"
690
+ }
691
+ ]
692
+ },
693
+ "DataRelationOperand": {
694
+ "description": "数据关联条件右值的判别联合。",
695
+ "oneOf": [
696
+ {
697
+ "additionalProperties": false,
698
+ "properties": {
699
+ "kind": {
700
+ "const": "literal"
701
+ },
702
+ "values": {
703
+ "description": "固定比较值列表;值必须使用字符串。选择类来源字段填写已有选项的展示文本,builder 会在 apply 时解析为后端 optId;解析不到会在写入前报错。is_empty/is_not_empty 必须传空数组,其他运算符至少传一项。",
704
+ "items": {
705
+ "type": "string"
706
+ },
707
+ "type": "array"
708
+ }
709
+ },
710
+ "required": [
711
+ "kind",
712
+ "values"
713
+ ],
714
+ "type": "object"
715
+ },
716
+ {
717
+ "additionalProperties": false,
718
+ "properties": {
719
+ "field": {
720
+ "$ref": "#/$defs/FieldSelector"
721
+ },
722
+ "kind": {
723
+ "const": "current_field"
724
+ }
725
+ },
726
+ "required": [
727
+ "kind",
728
+ "field"
729
+ ],
730
+ "type": "object"
731
+ },
732
+ {
733
+ "additionalProperties": false,
734
+ "properties": {
735
+ "alias": {
736
+ "$ref": "#/$defs/AliasSelector"
737
+ },
738
+ "kind": {
739
+ "const": "alias"
740
+ },
741
+ "producer": {
742
+ "$ref": "#/$defs/FieldSelector"
743
+ }
744
+ },
745
+ "required": [
746
+ "kind",
747
+ "producer",
748
+ "alias"
749
+ ],
750
+ "type": "object"
751
+ }
752
+ ]
753
+ },
754
+ "DataRelationSort": {
755
+ "description": "数据关联排序开关;启用时必须指定排序来源和方向。",
756
+ "oneOf": [
757
+ {
758
+ "additionalProperties": false,
759
+ "properties": {
760
+ "enabled": {
761
+ "const": false
762
+ }
763
+ },
764
+ "required": [
765
+ "enabled"
766
+ ],
767
+ "type": "object"
768
+ },
769
+ {
770
+ "additionalProperties": false,
771
+ "properties": {
772
+ "by": {
773
+ "$ref": "#/$defs/DataRelationSortBy"
774
+ },
775
+ "direction": {
776
+ "enum": [
777
+ "asc",
778
+ "desc"
779
+ ]
780
+ },
781
+ "enabled": {
782
+ "const": true
783
+ }
784
+ },
785
+ "required": [
786
+ "enabled",
787
+ "by",
788
+ "direction"
789
+ ],
790
+ "type": "object"
791
+ }
792
+ ]
793
+ },
794
+ "DataRelationSortBy": {
795
+ "description": "排序值来源;可为来源字段或输出别名。",
796
+ "oneOf": [
797
+ {
798
+ "additionalProperties": false,
799
+ "properties": {
800
+ "field": {
801
+ "$ref": "#/$defs/FieldSelector"
802
+ },
803
+ "kind": {
804
+ "const": "field"
805
+ }
806
+ },
807
+ "required": [
808
+ "kind",
809
+ "field"
810
+ ],
811
+ "type": "object"
812
+ },
813
+ {
814
+ "additionalProperties": false,
815
+ "properties": {
816
+ "alias": {
817
+ "$ref": "#/$defs/AliasSelector"
818
+ },
819
+ "kind": {
820
+ "const": "alias"
821
+ },
822
+ "producer": {
823
+ "$ref": "#/$defs/FieldSelector"
824
+ }
825
+ },
826
+ "required": [
827
+ "kind",
828
+ "producer",
829
+ "alias"
830
+ ],
831
+ "type": "object"
832
+ }
833
+ ]
834
+ },
835
+ "DataRelationSource": {
836
+ "description": "数据关联来源判别联合;kind 决定其余必填字段。",
837
+ "oneOf": [
838
+ {
839
+ "additionalProperties": false,
840
+ "properties": {
841
+ "appKey": {
842
+ "description": "来源应用的 appKey。",
843
+ "minLength": 1,
844
+ "type": "string"
845
+ },
846
+ "field": {
847
+ "$ref": "#/$defs/FieldSelector",
848
+ "description": "来源应用中的结果字段。"
849
+ },
850
+ "kind": {
851
+ "const": "app"
852
+ }
853
+ },
854
+ "required": [
855
+ "kind",
856
+ "appKey",
857
+ "field"
858
+ ],
859
+ "type": "object"
860
+ },
861
+ {
862
+ "additionalProperties": false,
863
+ "properties": {
864
+ "alias": {
865
+ "$ref": "#/$defs/AliasSelector",
866
+ "description": "Q-Linker 输出别名。"
867
+ },
868
+ "kind": {
869
+ "const": "q_linker"
870
+ },
871
+ "producer": {
872
+ "$ref": "#/$defs/FieldSelector",
873
+ "description": "当前应用中的 Q-Linker 字段。"
874
+ }
875
+ },
876
+ "required": [
877
+ "kind",
878
+ "producer",
879
+ "alias"
880
+ ],
881
+ "type": "object"
882
+ },
883
+ {
884
+ "additionalProperties": false,
885
+ "properties": {
886
+ "alias": {
887
+ "$ref": "#/$defs/AliasSelector",
888
+ "description": "代码块输出别名。"
889
+ },
890
+ "kind": {
891
+ "const": "code_block"
892
+ },
893
+ "producer": {
894
+ "$ref": "#/$defs/FieldSelector",
895
+ "description": "当前应用中的代码块字段。"
896
+ }
897
+ },
898
+ "required": [
899
+ "kind",
900
+ "producer",
901
+ "alias"
902
+ ],
903
+ "type": "object"
904
+ }
905
+ ]
906
+ },
907
+ "DefaultValues": {
908
+ "additionalProperties": false,
909
+ "properties": {
910
+ "associatedQueType": {
911
+ "type": [
912
+ "integer",
913
+ "null"
914
+ ]
915
+ },
916
+ "beingCanDecrypted": {
917
+ "type": [
918
+ "boolean",
919
+ "null"
920
+ ]
921
+ },
922
+ "beingDesensitized": {
923
+ "type": [
924
+ "boolean",
925
+ "null"
926
+ ]
927
+ },
928
+ "canDecimal": {
929
+ "type": [
930
+ "boolean",
931
+ "null"
932
+ ]
933
+ },
934
+ "currencyStatus": {
935
+ "type": [
936
+ "boolean",
937
+ "null"
938
+ ]
939
+ },
940
+ "currencyType": {
941
+ "type": [
942
+ "integer",
943
+ "null"
944
+ ]
945
+ },
946
+ "dateType": {
947
+ "type": [
948
+ "integer",
949
+ "null"
950
+ ]
951
+ },
952
+ "decimalDigit": {
953
+ "type": [
954
+ "integer",
955
+ "null"
956
+ ]
957
+ },
958
+ "numberFormat": {
959
+ "type": [
960
+ "integer",
961
+ "null"
962
+ ]
963
+ },
964
+ "queId": {
965
+ "type": [
966
+ "integer",
967
+ "null"
968
+ ]
969
+ },
970
+ "queTitle": {
971
+ "type": [
972
+ "string",
973
+ "null"
974
+ ]
975
+ },
976
+ "queType": {
977
+ "type": [
978
+ "integer",
979
+ "null"
980
+ ]
981
+ },
982
+ "referValues": {
983
+ "items": {
984
+ "$ref": "#/$defs/ReferenceDefaultValue"
985
+ },
986
+ "type": "array"
987
+ },
988
+ "rowId": {
989
+ "type": [
990
+ "integer",
991
+ "null"
992
+ ]
993
+ },
994
+ "sourceValue": {
995
+ "type": [
996
+ "string",
997
+ "null"
998
+ ]
999
+ },
1000
+ "tableValues": {
1001
+ "items": {
1002
+ "items": {
1003
+ "$ref": "#/$defs/DefaultValues"
1004
+ },
1005
+ "type": "array"
1006
+ },
1007
+ "type": "array"
1008
+ },
1009
+ "values": {
1010
+ "items": {
1011
+ "$ref": "#/$defs/AnswerValue"
1012
+ },
1013
+ "type": "array"
1014
+ }
1015
+ },
1016
+ "required": [
1017
+ "values"
1018
+ ],
1019
+ "type": "object"
1020
+ },
1021
+ "DepartmentConfig": {
1022
+ "additionalProperties": false,
1023
+ "description": "部门字段的可选范围配置。",
1024
+ "properties": {
1025
+ "beingShowParentPath": {
1026
+ "type": [
1027
+ "boolean",
1028
+ "null"
1029
+ ]
1030
+ },
1031
+ "canScan": {
1032
+ "type": [
1033
+ "boolean",
1034
+ "null"
1035
+ ]
1036
+ },
1037
+ "defaultDepartments": {
1038
+ "$ref": "#/$defs/DepartmentScope"
1039
+ },
1040
+ "departmentScope": {
1041
+ "$ref": "#/$defs/DepartmentScope"
1042
+ },
1043
+ "departmentScopeRelation": {
1044
+ "$ref": "#/$defs/SelectScopeRelation"
1045
+ },
1046
+ "noRepeat": {
1047
+ "type": [
1048
+ "boolean",
1049
+ "null"
1050
+ ]
1051
+ },
1052
+ "scanType": {
1053
+ "minimum": 0,
1054
+ "type": [
1055
+ "integer",
1056
+ "null"
1057
+ ]
1058
+ }
1059
+ },
1060
+ "required": [
1061
+ "departmentScope"
1062
+ ],
1063
+ "type": "object"
1064
+ },
1065
+ "DepartmentScope": {
1066
+ "description": "all 表示全部部门;custom 表示仅允许指定部门。",
1067
+ "oneOf": [
1068
+ {
1069
+ "additionalProperties": false,
1070
+ "properties": {
1071
+ "includeSubDeparts": {
1072
+ "description": "是否包含所选部门的下级部门。",
1073
+ "type": "boolean"
1074
+ },
1075
+ "mode": {
1076
+ "const": "all"
1077
+ }
1078
+ },
1079
+ "required": [
1080
+ "mode"
1081
+ ],
1082
+ "type": "object"
1083
+ },
1084
+ {
1085
+ "additionalProperties": false,
1086
+ "properties": {
1087
+ "departments": {
1088
+ "description": "custom 模式允许选择的部门列表。",
1089
+ "items": {
1090
+ "$ref": "#/$defs/DepartmentSelector"
1091
+ },
1092
+ "minItems": 1,
1093
+ "type": "array"
1094
+ },
1095
+ "includeSubDeparts": {
1096
+ "description": "是否包含指定部门的下级部门。",
1097
+ "type": "boolean"
1098
+ },
1099
+ "mode": {
1100
+ "const": "custom"
1101
+ }
1102
+ },
1103
+ "required": [
1104
+ "mode",
1105
+ "departments"
1106
+ ],
1107
+ "type": "object"
1108
+ },
1109
+ {
1110
+ "additionalProperties": false,
1111
+ "properties": {
1112
+ "includeSubDeparts": {
1113
+ "type": "boolean"
1114
+ },
1115
+ "mode": {
1116
+ "const": "relation"
1117
+ }
1118
+ },
1119
+ "required": [
1120
+ "mode"
1121
+ ],
1122
+ "type": "object"
1123
+ }
1124
+ ]
1125
+ },
1126
+ "DepartmentSelector": {
1127
+ "additionalProperties": false,
1128
+ "description": "部门身份;deptId 必填,deptName 仅用于展示。",
1129
+ "properties": {
1130
+ "deptId": {
1131
+ "minimum": 1,
1132
+ "type": "integer"
1133
+ },
1134
+ "deptName": {
1135
+ "minLength": 1,
1136
+ "type": "string"
1137
+ }
1138
+ },
1139
+ "required": [
1140
+ "deptId"
1141
+ ],
1142
+ "type": "object"
1143
+ },
1144
+ "DynamicMemberSelector": {
1145
+ "additionalProperties": false,
1146
+ "properties": {
1147
+ "queId": {
1148
+ "type": "integer"
1149
+ },
1150
+ "queTitle": {
1151
+ "type": "string"
1152
+ },
1153
+ "type": {
1154
+ "minimum": 1,
1155
+ "type": "integer"
1156
+ }
1157
+ },
1158
+ "required": [
1159
+ "type"
1160
+ ],
1161
+ "type": "object"
1162
+ },
1163
+ "EmptyConfig": {
1164
+ "additionalProperties": false,
1165
+ "description": "该字段类型没有特殊配置。",
1166
+ "type": "object"
1167
+ },
1168
+ "ExternalDepartmentSelector": {
1169
+ "additionalProperties": false,
1170
+ "properties": {
1171
+ "deptId": {
1172
+ "minimum": 1,
1173
+ "type": "integer"
1174
+ },
1175
+ "deptName": {
1176
+ "type": "string"
1177
+ }
1178
+ },
1179
+ "required": [
1180
+ "deptId"
1181
+ ],
1182
+ "type": "object"
1183
+ },
1184
+ "ExternalMemberSelector": {
1185
+ "additionalProperties": false,
1186
+ "properties": {
1187
+ "email": {
1188
+ "type": "string"
1189
+ },
1190
+ "nickName": {
1191
+ "type": "string"
1192
+ },
1193
+ "uid": {
1194
+ "minimum": 1,
1195
+ "type": "integer"
1196
+ }
1197
+ },
1198
+ "required": [
1199
+ "uid"
1200
+ ],
1201
+ "type": "object"
1202
+ },
1203
+ "FieldCommon": {
1204
+ "allOf": [
1205
+ {
1206
+ "if": {
1207
+ "properties": {
1208
+ "defaultType": {
1209
+ "const": 2
1210
+ }
1211
+ },
1212
+ "required": [
1213
+ "defaultType"
1214
+ ]
1215
+ },
1216
+ "then": {
1217
+ "properties": {
1218
+ "defaultValue": {
1219
+ "type": "null"
1220
+ }
1221
+ }
1222
+ }
1223
+ },
1224
+ {
1225
+ "if": {
1226
+ "properties": {
1227
+ "defaultType": {
1228
+ "const": 3
1229
+ }
1230
+ },
1231
+ "required": [
1232
+ "defaultType"
1233
+ ]
1234
+ },
1235
+ "then": {
1236
+ "properties": {
1237
+ "defaultValue": {
1238
+ "minLength": 1,
1239
+ "type": [
1240
+ "string",
1241
+ "null"
1242
+ ]
1243
+ }
1244
+ }
1245
+ }
1246
+ }
1247
+ ],
1248
+ "anyOf": [
1249
+ {
1250
+ "required": [
1251
+ "queId"
1252
+ ]
1253
+ },
1254
+ {
1255
+ "required": [
1256
+ "name"
1257
+ ]
1258
+ }
1259
+ ],
1260
+ "description": "顶层业务字段的公共属性;字段类型由 TopField 的判别分支定义。",
1261
+ "properties": {
1262
+ "beingRequired": {
1263
+ "description": "该字段是否必填;缺失时保留已有字段当前值。",
1264
+ "type": "boolean"
1265
+ },
1266
+ "defaultType": {
1267
+ "default": 1,
1268
+ "description": "默认值类型,与 defaultValue 联动;1 表示静态值,2 表示关联/绑定值且 defaultValue 只能省略或为 null,3 表示公式值且提供 defaultValue 时必须为非空公式文本。省略 defaultType 但提供 defaultValue 时按 1 处理。",
1269
+ "enum": [
1270
+ 1,
1271
+ 2,
1272
+ 3
1273
+ ],
1274
+ "type": "integer"
1275
+ },
1276
+ "defaultValue": {
1277
+ "$ref": "#/$defs/ScalarDefaultValue",
1278
+ "description": "普通字段的默认值;后端 queDefaultValue 为字符串,因此数字等字面量也必须以字符串传入。defaultType 为 1 时表示静态文本,为 3 时表示公式文本,为 2 时不携带字面量默认值。表格、地址、附件、引用等结构化默认值必须放在具体字段 config.defaultValues。显式 null 表示清除默认值。"
1279
+ },
1280
+ "name": {
1281
+ "description": "字段展示名称;新增字段必填,已有字段可在携带 queId 时省略;同一父级内唯一。",
1282
+ "minLength": 1,
1283
+ "type": "string"
1284
+ },
1285
+ "queId": {
1286
+ "description": "已有字段的后端 ID;更新时用于精确定位并复用,新增字段通常省略。",
1287
+ "minimum": 1,
1288
+ "type": "integer"
1289
+ },
1290
+ "questionDescription": {
1291
+ "description": "字段说明;null 或空字符串表示清空。",
1292
+ "type": [
1293
+ "string",
1294
+ "null"
1295
+ ]
1296
+ },
1297
+ "questionType": {
1298
+ "description": "字段类型;具体可用值由当前字段详情 Schema 的判别分支约束。",
1299
+ "type": "string"
1300
+ },
1301
+ "width": {
1302
+ "description": "字段在所在行的宽度百分比;只能选择 25、50、75 或 100。",
1303
+ "enum": [
1304
+ 25,
1305
+ 50,
1306
+ 75,
1307
+ 100
1308
+ ],
1309
+ "type": "integer"
1310
+ }
1311
+ },
1312
+ "type": "object"
1313
+ },
1314
+ "FieldRow": {
1315
+ "additionalProperties": false,
1316
+ "description": "段落内部字段行。",
1317
+ "properties": {
1318
+ "fields": {
1319
+ "description": "本行的 1 到 4 个顶层字段。",
1320
+ "items": {
1321
+ "$ref": "#/$defs/TopField"
1322
+ },
1323
+ "maxItems": 4,
1324
+ "minItems": 1,
1325
+ "type": "array"
1326
+ }
1327
+ },
1328
+ "required": [
1329
+ "fields"
1330
+ ],
1331
+ "type": "object"
1332
+ },
1333
+ "FieldSelector": {
1334
+ "additionalProperties": false,
1335
+ "anyOf": [
1336
+ {
1337
+ "required": [
1338
+ "queId"
1339
+ ]
1340
+ },
1341
+ {
1342
+ "required": [
1343
+ "name"
1344
+ ]
1345
+ }
1346
+ ],
1347
+ "description": "字段选择器;用于定位应用的数据标题、数据封面、自定义编号取值来源或其他配置引用的字段。至少提供 queId 或 name,两者同时提供时必须指向同一字段。",
1348
+ "properties": {
1349
+ "name": {
1350
+ "description": "字段名称;仅在当前作用域内唯一时可用于解析。",
1351
+ "minLength": 1,
1352
+ "type": "string"
1353
+ },
1354
+ "queId": {
1355
+ "description": "已有字段的后端 ID;优先用于精确解析。",
1356
+ "minimum": 1,
1357
+ "type": "integer"
1358
+ }
1359
+ },
1360
+ "type": "object"
1361
+ },
1362
+ "FormulaExpression": {
1363
+ "description": "轻流公式表达式的解码文本;字段引用形如 #queId_<queId>$,由后端 Formula 引擎解析。",
1364
+ "minLength": 1,
1365
+ "type": "string"
1366
+ },
1367
+ "JsonValue": {
1368
+ "description": "数据关联字面量支持的任意 JSON 值。",
1369
+ "oneOf": [
1370
+ {
1371
+ "type": "null"
1372
+ },
1373
+ {
1374
+ "type": "boolean"
1375
+ },
1376
+ {
1377
+ "type": "number"
1378
+ },
1379
+ {
1380
+ "type": "string"
1381
+ },
1382
+ {
1383
+ "items": {
1384
+ "$ref": "#/$defs/JsonValue"
1385
+ },
1386
+ "type": "array"
1387
+ },
1388
+ {
1389
+ "additionalProperties": {
1390
+ "$ref": "#/$defs/JsonValue"
1391
+ },
1392
+ "type": "object"
1393
+ }
1394
+ ]
1395
+ },
1396
+ "MemberConfig": {
1397
+ "additionalProperties": false,
1398
+ "description": "成员字段的选择范围和默认成员。",
1399
+ "properties": {
1400
+ "canScan": {
1401
+ "type": [
1402
+ "boolean",
1403
+ "null"
1404
+ ]
1405
+ },
1406
+ "defaultMembers": {
1407
+ "$ref": "#/$defs/MemberScope"
1408
+ },
1409
+ "memberScope": {
1410
+ "$ref": "#/$defs/MemberScope"
1411
+ },
1412
+ "memberScopeRelation": {
1413
+ "$ref": "#/$defs/SelectScopeRelation"
1414
+ },
1415
+ "noRepeat": {
1416
+ "type": [
1417
+ "boolean",
1418
+ "null"
1419
+ ]
1420
+ },
1421
+ "scanType": {
1422
+ "minimum": 0,
1423
+ "type": [
1424
+ "integer",
1425
+ "null"
1426
+ ]
1427
+ }
1428
+ },
1429
+ "type": "object"
1430
+ },
1431
+ "MemberScope": {
1432
+ "description": "成员字段可选范围;all 为工作区全部成员,custom 为显式成员/部门/角色或动态成员,relation 为按字段关联。",
1433
+ "oneOf": [
1434
+ {
1435
+ "additionalProperties": false,
1436
+ "properties": {
1437
+ "includeSubDeparts": {
1438
+ "type": "boolean"
1439
+ },
1440
+ "mode": {
1441
+ "const": "all"
1442
+ }
1443
+ },
1444
+ "required": [
1445
+ "mode"
1446
+ ],
1447
+ "type": "object"
1448
+ },
1449
+ {
1450
+ "additionalProperties": false,
1451
+ "properties": {
1452
+ "departments": {
1453
+ "items": {
1454
+ "$ref": "#/$defs/DepartmentSelector"
1455
+ },
1456
+ "type": "array"
1457
+ },
1458
+ "dynamic": {
1459
+ "items": {
1460
+ "$ref": "#/$defs/DynamicMemberSelector"
1461
+ },
1462
+ "type": "array"
1463
+ },
1464
+ "externalDepartments": {
1465
+ "items": {
1466
+ "$ref": "#/$defs/ExternalDepartmentSelector"
1467
+ },
1468
+ "type": "array"
1469
+ },
1470
+ "externalMembers": {
1471
+ "items": {
1472
+ "$ref": "#/$defs/ExternalMemberSelector"
1473
+ },
1474
+ "type": "array"
1475
+ },
1476
+ "includeSubDeparts": {
1477
+ "type": "boolean"
1478
+ },
1479
+ "members": {
1480
+ "items": {
1481
+ "$ref": "#/$defs/MemberSelector"
1482
+ },
1483
+ "type": "array"
1484
+ },
1485
+ "mode": {
1486
+ "const": "custom"
1487
+ },
1488
+ "roles": {
1489
+ "items": {
1490
+ "$ref": "#/$defs/RoleSelector"
1491
+ },
1492
+ "type": "array"
1493
+ }
1494
+ },
1495
+ "required": [
1496
+ "mode"
1497
+ ],
1498
+ "type": "object"
1499
+ },
1500
+ {
1501
+ "additionalProperties": false,
1502
+ "properties": {
1503
+ "departments": {
1504
+ "items": {
1505
+ "$ref": "#/$defs/DepartmentSelector"
1506
+ },
1507
+ "type": "array"
1508
+ },
1509
+ "dynamic": {
1510
+ "items": {
1511
+ "$ref": "#/$defs/DynamicMemberSelector"
1512
+ },
1513
+ "type": "array"
1514
+ },
1515
+ "externalDepartments": {
1516
+ "items": {
1517
+ "$ref": "#/$defs/ExternalDepartmentSelector"
1518
+ },
1519
+ "type": "array"
1520
+ },
1521
+ "externalMembers": {
1522
+ "items": {
1523
+ "$ref": "#/$defs/ExternalMemberSelector"
1524
+ },
1525
+ "type": "array"
1526
+ },
1527
+ "includeSubDeparts": {
1528
+ "type": "boolean"
1529
+ },
1530
+ "members": {
1531
+ "items": {
1532
+ "$ref": "#/$defs/MemberSelector"
1533
+ },
1534
+ "type": "array"
1535
+ },
1536
+ "mode": {
1537
+ "const": "relation"
1538
+ },
1539
+ "roles": {
1540
+ "items": {
1541
+ "$ref": "#/$defs/RoleSelector"
1542
+ },
1543
+ "type": "array"
1544
+ }
1545
+ },
1546
+ "required": [
1547
+ "mode"
1548
+ ],
1549
+ "type": "object"
1550
+ }
1551
+ ]
1552
+ },
1553
+ "MemberSelector": {
1554
+ "additionalProperties": false,
1555
+ "properties": {
1556
+ "nickName": {
1557
+ "minLength": 1,
1558
+ "type": "string"
1559
+ },
1560
+ "uid": {
1561
+ "minimum": 1,
1562
+ "type": "integer"
1563
+ }
1564
+ },
1565
+ "required": [
1566
+ "uid"
1567
+ ],
1568
+ "type": "object"
1569
+ },
1570
+ "NumberConfig": {
1571
+ "additionalProperties": false,
1572
+ "description": "数字和金额字段的数值、精度及显示格式。",
1573
+ "properties": {
1574
+ "canDecimal": {
1575
+ "description": "是否允许小数;普通数字字段可显式设置。",
1576
+ "type": [
1577
+ "boolean",
1578
+ "null"
1579
+ ]
1580
+ },
1581
+ "canScan": {
1582
+ "description": "是否允许扫码输入。",
1583
+ "type": [
1584
+ "boolean",
1585
+ "null"
1586
+ ]
1587
+ },
1588
+ "currencyStatus": {
1589
+ "description": "金额字段是否显示货币符号。",
1590
+ "type": [
1591
+ "boolean",
1592
+ "null"
1593
+ ]
1594
+ },
1595
+ "currencyType": {
1596
+ "description": "货币类型 ID。",
1597
+ "minimum": 1,
1598
+ "type": [
1599
+ "integer",
1600
+ "null"
1601
+ ]
1602
+ },
1603
+ "decimalDigit": {
1604
+ "description": "小数位数。",
1605
+ "maximum": 10,
1606
+ "minimum": 0,
1607
+ "type": [
1608
+ "integer",
1609
+ "null"
1610
+ ]
1611
+ },
1612
+ "maxValue": {
1613
+ "description": "允许的最大值;后端按字符串保存。",
1614
+ "type": [
1615
+ "string",
1616
+ "number",
1617
+ "null"
1618
+ ]
1619
+ },
1620
+ "minValue": {
1621
+ "description": "允许的最小值;后端按字符串保存。",
1622
+ "type": [
1623
+ "string",
1624
+ "number",
1625
+ "null"
1626
+ ]
1627
+ },
1628
+ "noRepeat": {
1629
+ "description": "是否禁止重复值。",
1630
+ "type": [
1631
+ "boolean",
1632
+ "null"
1633
+ ]
1634
+ },
1635
+ "numberFormat": {
1636
+ "description": "数字展示格式 ID。",
1637
+ "minimum": 1,
1638
+ "type": [
1639
+ "integer",
1640
+ "null"
1641
+ ]
1642
+ },
1643
+ "numberLimitStatus": {
1644
+ "description": "是否启用最小值和最大值限制。",
1645
+ "type": [
1646
+ "boolean",
1647
+ "null"
1648
+ ]
1649
+ },
1650
+ "scanType": {
1651
+ "description": "扫码类型 ID。",
1652
+ "minimum": 0,
1653
+ "type": [
1654
+ "integer",
1655
+ "null"
1656
+ ]
1657
+ }
1658
+ },
1659
+ "type": "object"
1660
+ },
1661
+ "PhoneConfig": {
1662
+ "additionalProperties": false,
1663
+ "description": "电话字段的长度、重复和校验配置。",
1664
+ "properties": {
1665
+ "canScan": {
1666
+ "type": [
1667
+ "boolean",
1668
+ "null"
1669
+ ]
1670
+ },
1671
+ "fixedPhone": {
1672
+ "description": "是否按固定电话格式校验。",
1673
+ "type": [
1674
+ "boolean",
1675
+ "null"
1676
+ ]
1677
+ },
1678
+ "maxWordCount": {
1679
+ "minimum": 0,
1680
+ "type": [
1681
+ "integer",
1682
+ "null"
1683
+ ]
1684
+ },
1685
+ "minWordCount": {
1686
+ "minimum": 0,
1687
+ "type": [
1688
+ "integer",
1689
+ "null"
1690
+ ]
1691
+ },
1692
+ "msgValidateStatus": {
1693
+ "description": "是否启用短信校验。",
1694
+ "type": [
1695
+ "boolean",
1696
+ "null"
1697
+ ]
1698
+ },
1699
+ "noRepeat": {
1700
+ "type": [
1701
+ "boolean",
1702
+ "null"
1703
+ ]
1704
+ },
1705
+ "scanType": {
1706
+ "minimum": 0,
1707
+ "type": [
1708
+ "integer",
1709
+ "null"
1710
+ ]
1711
+ }
1712
+ },
1713
+ "type": "object"
1714
+ },
1715
+ "QLinkerBinding": {
1716
+ "additionalProperties": false,
1717
+ "description": "Q-Linker 的输入映射、请求配置和输出映射;每个输出目标还必须满足应用级唯一性规则,不能与任何 Q-Linker 或代码块的其他输出指向同一实际字段。多个生产方需要回写时,请选择不同目标字段或合并为一个生产方。",
1718
+ "properties": {
1719
+ "inputs": {
1720
+ "description": "将当前表单字段映射到请求参数的规则。query_param、header、url_encoded 会直接生成对应位置的动态参数;json_path 用于替换 request.url、request.jsonValue 或 request.xmlValue 中的 {{key}} 占位符。",
1721
+ "items": {
1722
+ "$ref": "#/$defs/QLinkerInputBinding"
1723
+ },
1724
+ "type": "array"
1725
+ },
1726
+ "outputs": {
1727
+ "description": "将响应路径映射到目标字段的规则;至少一个。所有 targetField 在整个应用的 Q-Linker 和代码块输出中必须全局唯一。",
1728
+ "items": {
1729
+ "$ref": "#/$defs/QLinkerOutputBinding"
1730
+ },
1731
+ "minItems": 1,
1732
+ "type": "array"
1733
+ },
1734
+ "request": {
1735
+ "$ref": "#/$defs/QLinkerRequest",
1736
+ "description": "远程请求配置。"
1737
+ }
1738
+ },
1739
+ "required": [
1740
+ "request",
1741
+ "outputs"
1742
+ ],
1743
+ "type": "object"
1744
+ },
1745
+ "QLinkerConfig": {
1746
+ "additionalProperties": false,
1747
+ "description": "Q-Linker 的高层声明;无法无损还原为该结构时阻断处理。",
1748
+ "properties": {
1749
+ "qLinkerBinding": {
1750
+ "$ref": "#/$defs/QLinkerBinding"
1751
+ }
1752
+ },
1753
+ "required": [
1754
+ "qLinkerBinding"
1755
+ ],
1756
+ "type": "object"
1757
+ },
1758
+ "QLinkerInputBinding": {
1759
+ "additionalProperties": false,
1760
+ "description": "一个表单字段到请求参数的映射。需要把字段值嵌入 URL、JSON 或 XML 字符串时,source 必须为 json_path,key 必须等于所选字段名,并在对应请求字符串中写 {{key}};其他 source 不会替换 {{key}}。",
1761
+ "properties": {
1762
+ "field": {
1763
+ "$ref": "#/$defs/FieldSelector",
1764
+ "description": "输入来源字段。"
1765
+ },
1766
+ "key": {
1767
+ "description": "请求参数名。source 为 json_path 时必须等于 field 选中的字段名,并与请求字符串中的 {{key}} 完全一致。",
1768
+ "minLength": 1,
1769
+ "type": "string"
1770
+ },
1771
+ "source": {
1772
+ "description": "字段值的写入位置。query_param、header、url_encoded 分别生成动态查询参数、请求头、表单项;json_path 替换 URL、JSON 或 XML 中的 {{key}}。不要用前三种 source 提供字符串占位符。",
1773
+ "enum": [
1774
+ "query_param",
1775
+ "header",
1776
+ "url_encoded",
1777
+ "json_path"
1778
+ ]
1779
+ }
1780
+ },
1781
+ "required": [
1782
+ "field",
1783
+ "key",
1784
+ "source"
1785
+ ],
1786
+ "type": "object"
1787
+ },
1788
+ "QLinkerKeyValue": {
1789
+ "additionalProperties": false,
1790
+ "description": "HTTP 请求中的键值对。",
1791
+ "properties": {
1792
+ "key": {
1793
+ "description": "参数名。",
1794
+ "minLength": 1,
1795
+ "type": "string"
1796
+ },
1797
+ "value": {
1798
+ "description": "参数值;null 表示空值。",
1799
+ "type": [
1800
+ "string",
1801
+ "null"
1802
+ ]
1803
+ }
1804
+ },
1805
+ "required": [
1806
+ "key"
1807
+ ],
1808
+ "type": "object"
1809
+ },
1810
+ "QLinkerOutputBinding": {
1811
+ "additionalProperties": false,
1812
+ "description": "一个响应值到表单目标字段的映射;同一实际目标字段在整个应用中只能被一个 Q-Linker 或代码块输出映射写入。",
1813
+ "properties": {
1814
+ "alias": {
1815
+ "description": "输出别名;用于后续数据关联引用。",
1816
+ "minLength": 1,
1817
+ "type": "string"
1818
+ },
1819
+ "aliasId": {
1820
+ "description": "后端生成的输出别名 ID;新增输出时省略,Builder 在首次写入后按 alias 与 path 自动回填再保存关系。更新已有输出时必须保留 get 返回值,不得自行编造或置空。",
1821
+ "minimum": 1,
1822
+ "type": "integer"
1823
+ },
1824
+ "path": {
1825
+ "description": "从响应中取值的 JSONPath。",
1826
+ "minLength": 1,
1827
+ "type": "string"
1828
+ },
1829
+ "targetField": {
1830
+ "$ref": "#/$defs/FieldSelector",
1831
+ "description": "接收结果的当前表单字段;该字段在整个应用的全部 Q-Linker 和代码块 outputs 中只能作为 targetField 出现一次,不得被多个输出关系重复写入。"
1832
+ }
1833
+ },
1834
+ "required": [
1835
+ "alias",
1836
+ "path",
1837
+ "targetField"
1838
+ ],
1839
+ "type": "object"
1840
+ },
1841
+ "QLinkerRequest": {
1842
+ "additionalProperties": false,
1843
+ "description": "Q-Linker 远程 HTTP 请求配置。",
1844
+ "properties": {
1845
+ "autoTrigger": {
1846
+ "description": "是否在输入变化时自动触发请求。",
1847
+ "type": [
1848
+ "boolean",
1849
+ "null"
1850
+ ]
1851
+ },
1852
+ "bodyType": {
1853
+ "default": "url_encoded",
1854
+ "description": "请求体格式;分别映射后端 bodyType 1、2、3。",
1855
+ "enum": [
1856
+ "url_encoded",
1857
+ "json",
1858
+ "xml"
1859
+ ]
1860
+ },
1861
+ "customButtonText": {
1862
+ "description": "自定义触发按钮文案。",
1863
+ "type": [
1864
+ "string",
1865
+ "null"
1866
+ ]
1867
+ },
1868
+ "customButtonTextEnabled": {
1869
+ "description": "是否启用自定义触发按钮文案。",
1870
+ "type": [
1871
+ "boolean",
1872
+ "null"
1873
+ ]
1874
+ },
1875
+ "headers": {
1876
+ "description": "请求头键值对。",
1877
+ "items": {
1878
+ "$ref": "#/$defs/QLinkerKeyValue"
1879
+ },
1880
+ "type": "array"
1881
+ },
1882
+ "hideOnForm": {
1883
+ "description": "是否在表单填写界面隐藏该 Q-Linker 字段。",
1884
+ "type": [
1885
+ "boolean",
1886
+ "null"
1887
+ ]
1888
+ },
1889
+ "insertValueDirectly": {
1890
+ "description": "是否把请求结果直接写入目标字段。",
1891
+ "type": [
1892
+ "boolean",
1893
+ "null"
1894
+ ]
1895
+ },
1896
+ "jsonValue": {
1897
+ "description": "bodyType 为 json 时的 JSON 请求体字符串。动态字段值写成 {{key}},且 inputs 必须存在同名 source=json_path 映射;query_param、header、url_encoded 不会替换这里的占位符。",
1898
+ "type": [
1899
+ "string",
1900
+ "null"
1901
+ ]
1902
+ },
1903
+ "method": {
1904
+ "default": "GET",
1905
+ "description": "HTTP 方法;当前 Q-Linker 仅支持 GET 和 POST,缺失时按 GET 处理。",
1906
+ "enum": [
1907
+ "GET",
1908
+ "POST"
1909
+ ]
1910
+ },
1911
+ "queryParams": {
1912
+ "description": "URL 查询参数键值对。",
1913
+ "items": {
1914
+ "$ref": "#/$defs/QLinkerKeyValue"
1915
+ },
1916
+ "type": "array"
1917
+ },
1918
+ "resultType": {
1919
+ "default": "json",
1920
+ "description": "响应解析格式;分别映射后端 resultType 1、2、3。",
1921
+ "enum": [
1922
+ "json",
1923
+ "xml",
1924
+ "text"
1925
+ ]
1926
+ },
1927
+ "url": {
1928
+ "description": "请求 URL;动态嵌入字段值时使用 {{key}},并在 inputs 中提供同名 source=json_path 映射。",
1929
+ "minLength": 1,
1930
+ "type": "string"
1931
+ },
1932
+ "urlEncodedValue": {
1933
+ "description": "bodyType 为 url_encoded 时的表单键值对。",
1934
+ "items": {
1935
+ "$ref": "#/$defs/QLinkerKeyValue"
1936
+ },
1937
+ "type": "array"
1938
+ },
1939
+ "xmlValue": {
1940
+ "description": "bodyType 为 xml 时的 XML 请求体字符串。动态字段值写成 {{key}},且 inputs 必须存在同名 source=json_path 映射。",
1941
+ "type": [
1942
+ "string",
1943
+ "null"
1944
+ ]
1945
+ }
1946
+ },
1947
+ "required": [
1948
+ "url"
1949
+ ],
1950
+ "type": "object"
1951
+ },
1952
+ "ReferenceDefaultValue": {
1953
+ "additionalProperties": false,
1954
+ "properties": {
1955
+ "applyId": {
1956
+ "type": [
1957
+ "integer",
1958
+ "null"
1959
+ ]
1960
+ },
1961
+ "dataTitle": {
1962
+ "type": [
1963
+ "string",
1964
+ "null"
1965
+ ]
1966
+ },
1967
+ "values": {
1968
+ "items": {
1969
+ "$ref": "#/$defs/DefaultValues"
1970
+ },
1971
+ "type": "array"
1972
+ }
1973
+ },
1974
+ "type": "object"
1975
+ },
1976
+ "RelationConfig": {
1977
+ "additionalProperties": false,
1978
+ "description": "引用字段配置;引用其他应用中的数据。",
1979
+ "properties": {
1980
+ "beingDefaultFormulaAutoFillEnabled": {
1981
+ "description": "是否启用引用字段的默认值公式自动填充。",
1982
+ "type": [
1983
+ "boolean",
1984
+ "null"
1985
+ ]
1986
+ },
1987
+ "defaultValueFormula": {
1988
+ "description": "引用字段默认值自动填充使用的公式;仅在 beingDefaultFormulaAutoFillEnabled 为 true 时执行,null 表示清除。",
1989
+ "oneOf": [
1990
+ {
1991
+ "type": "null"
1992
+ },
1993
+ {
1994
+ "$ref": "#/$defs/FormulaExpression"
1995
+ }
1996
+ ]
1997
+ },
1998
+ "defaultValueMatchRules": {
1999
+ "type": [
2000
+ "array",
2001
+ "null"
2002
+ ]
2003
+ },
2004
+ "defaultValues": {
2005
+ "oneOf": [
2006
+ {
2007
+ "type": "null"
2008
+ },
2009
+ {
2010
+ "$ref": "#/$defs/DefaultValues"
2011
+ }
2012
+ ]
2013
+ },
2014
+ "displayField": {
2015
+ "$ref": "#/$defs/FieldSelector",
2016
+ "description": "引用值的主展示字段。"
2017
+ },
2018
+ "relationMode": {
2019
+ "default": "single",
2020
+ "description": "单条引用或多条引用;缺失时按 single 处理。",
2021
+ "enum": [
2022
+ "single",
2023
+ "multiple"
2024
+ ]
2025
+ },
2026
+ "targetAppKey": {
2027
+ "description": "被引用应用的 appKey。",
2028
+ "minLength": 1,
2029
+ "type": "string"
2030
+ },
2031
+ "visibleFields": {
2032
+ "description": "引用选择界面额外展示的字段。",
2033
+ "items": {
2034
+ "$ref": "#/$defs/FieldSelector"
2035
+ },
2036
+ "type": "array",
2037
+ "uniqueItems": true
2038
+ }
2039
+ },
2040
+ "required": [
2041
+ "targetAppKey",
2042
+ "displayField"
2043
+ ],
2044
+ "type": "object"
2045
+ },
2046
+ "RoleSelector": {
2047
+ "additionalProperties": false,
2048
+ "properties": {
2049
+ "roleId": {
2050
+ "minimum": 1,
2051
+ "type": "integer"
2052
+ },
2053
+ "roleName": {
2054
+ "minLength": 1,
2055
+ "type": "string"
2056
+ }
2057
+ },
2058
+ "required": [
2059
+ "roleId"
2060
+ ],
2061
+ "type": "object"
2062
+ },
2063
+ "RowBlock": {
2064
+ "additionalProperties": false,
2065
+ "description": "根级普通字段行;字段顺序即展示顺序。",
2066
+ "properties": {
2067
+ "fields": {
2068
+ "description": "本行的 1 到 4 个顶层字段。",
2069
+ "items": {
2070
+ "$ref": "#/$defs/TopField"
2071
+ },
2072
+ "maxItems": 4,
2073
+ "minItems": 1,
2074
+ "type": "array"
2075
+ },
2076
+ "kind": {
2077
+ "const": "row",
2078
+ "description": "普通行判别值。"
2079
+ }
2080
+ },
2081
+ "required": [
2082
+ "kind",
2083
+ "fields"
2084
+ ],
2085
+ "type": "object"
2086
+ },
2087
+ "ScalarDefaultValue": {
2088
+ "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。",
2089
+ "type": [
2090
+ "null",
2091
+ "string"
2092
+ ]
2093
+ },
2094
+ "SectionBlock": {
2095
+ "additionalProperties": false,
2096
+ "description": "段落布局容器;不是业务字段,必须独占一个根级块。",
2097
+ "properties": {
2098
+ "kind": {
2099
+ "const": "section",
2100
+ "description": "段落判别值。"
2101
+ },
2102
+ "rows": {
2103
+ "description": "段落内的非空有序字段行。",
2104
+ "items": {
2105
+ "$ref": "#/$defs/FieldRow"
2106
+ },
2107
+ "minItems": 1,
2108
+ "type": "array"
2109
+ },
2110
+ "sectionId": {
2111
+ "description": "已有段落的真实身份;get 把后端数值 queId 输出为无前导零的正十进制字符串,apply 仅在构造后端 payload 时转回数值 queId,新增段落省略。",
2112
+ "pattern": "^[1-9][0-9]*$",
2113
+ "type": "string"
2114
+ },
2115
+ "title": {
2116
+ "description": "段落标题。",
2117
+ "minLength": 1,
2118
+ "type": "string"
2119
+ }
2120
+ },
2121
+ "required": [
2122
+ "kind",
2123
+ "title",
2124
+ "rows"
2125
+ ],
2126
+ "type": "object"
2127
+ },
2128
+ "SelectScopeRelation": {
2129
+ "additionalProperties": false,
2130
+ "properties": {
2131
+ "displayedField": {
2132
+ "$ref": "#/$defs/FieldSelector"
2133
+ },
2134
+ "displayedFieldType": {
2135
+ "type": [
2136
+ "integer",
2137
+ "null"
2138
+ ]
2139
+ },
2140
+ "matchRuleFormula": {
2141
+ "type": [
2142
+ "string",
2143
+ "null"
2144
+ ]
2145
+ },
2146
+ "matchRuleType": {
2147
+ "type": [
2148
+ "integer",
2149
+ "null"
2150
+ ]
2151
+ },
2152
+ "matchRules": {
2153
+ "type": [
2154
+ "array",
2155
+ "null"
2156
+ ]
2157
+ },
2158
+ "targetAppKey": {
2159
+ "minLength": 1,
2160
+ "type": "string"
2161
+ },
2162
+ "targetAppTitle": {
2163
+ "type": [
2164
+ "string",
2165
+ "null"
2166
+ ]
2167
+ }
2168
+ },
2169
+ "required": [
2170
+ "displayedField",
2171
+ "targetAppKey"
2172
+ ],
2173
+ "type": "object"
2174
+ },
2175
+ "SerialComponent": {
2176
+ "description": "自定义编号的组成部分;id 仅用于复用已有组件。",
2177
+ "oneOf": [
2178
+ {
2179
+ "additionalProperties": false,
2180
+ "properties": {
2181
+ "id": {
2182
+ "description": "后端生成的组件 ID;get 返回,新增时省略。",
2183
+ "minimum": 1,
2184
+ "type": "integer"
2185
+ },
2186
+ "length": {
2187
+ "description": "自动计数部分的位数。",
2188
+ "maximum": 9,
2189
+ "minimum": 3,
2190
+ "type": "integer"
2191
+ },
2192
+ "repeatPeriod": {
2193
+ "description": "自动计数器的重置周期。",
2194
+ "enum": [
2195
+ "none",
2196
+ "day",
2197
+ "week",
2198
+ "month",
2199
+ "year"
2200
+ ]
2201
+ },
2202
+ "type": {
2203
+ "const": "auto_count"
2204
+ }
2205
+ },
2206
+ "required": [
2207
+ "type",
2208
+ "length",
2209
+ "repeatPeriod"
2210
+ ],
2211
+ "type": "object"
2212
+ },
2213
+ {
2214
+ "additionalProperties": false,
2215
+ "properties": {
2216
+ "dateFormat": {
2217
+ "description": "提交时间在编号中的格式。",
2218
+ "enum": [
2219
+ "year",
2220
+ "year_month",
2221
+ "year_month_day"
2222
+ ]
2223
+ },
2224
+ "id": {
2225
+ "minimum": 1,
2226
+ "type": "integer"
2227
+ },
2228
+ "type": {
2229
+ "const": "submit_datetime"
2230
+ }
2231
+ },
2232
+ "required": [
2233
+ "type",
2234
+ "dateFormat"
2235
+ ],
2236
+ "type": "object"
2237
+ },
2238
+ {
2239
+ "additionalProperties": false,
2240
+ "properties": {
2241
+ "id": {
2242
+ "minimum": 1,
2243
+ "type": "integer"
2244
+ },
2245
+ "type": {
2246
+ "const": "fixed_text"
2247
+ },
2248
+ "value": {
2249
+ "description": "固定拼接文本。",
2250
+ "minLength": 1,
2251
+ "type": "string"
2252
+ }
2253
+ },
2254
+ "required": [
2255
+ "type",
2256
+ "value"
2257
+ ],
2258
+ "type": "object"
2259
+ },
2260
+ {
2261
+ "additionalProperties": false,
2262
+ "properties": {
2263
+ "dateFormat": {
2264
+ "description": "来源为日期字段时的格式。",
2265
+ "enum": [
2266
+ "year",
2267
+ "year_month",
2268
+ "year_month_day"
2269
+ ]
2270
+ },
2271
+ "field": {
2272
+ "$ref": "#/$defs/FieldSelector",
2273
+ "description": "自定义编号中参与拼接的取值来源字段。"
2274
+ },
2275
+ "id": {
2276
+ "minimum": 1,
2277
+ "type": "integer"
2278
+ },
2279
+ "type": {
2280
+ "const": "field"
2281
+ }
2282
+ },
2283
+ "required": [
2284
+ "type",
2285
+ "field"
2286
+ ],
2287
+ "type": "object"
2288
+ }
2289
+ ]
2290
+ },
2291
+ "SerialNumber": {
2292
+ "description": "应用数据编号配置;自定义模式必须且只能包含一个自动计数组件。",
2293
+ "oneOf": [
2294
+ {
2295
+ "additionalProperties": false,
2296
+ "properties": {
2297
+ "mode": {
2298
+ "const": "default",
2299
+ "description": "使用系统默认编号规则。"
2300
+ }
2301
+ },
2302
+ "required": [
2303
+ "mode"
2304
+ ],
2305
+ "type": "object"
2306
+ },
2307
+ {
2308
+ "additionalProperties": false,
2309
+ "properties": {
2310
+ "components": {
2311
+ "contains": {
2312
+ "properties": {
2313
+ "type": {
2314
+ "const": "auto_count"
2315
+ }
2316
+ },
2317
+ "required": [
2318
+ "type"
2319
+ ],
2320
+ "type": "object"
2321
+ },
2322
+ "description": "自定义编号组件的完整有序目标态。",
2323
+ "items": {
2324
+ "$ref": "#/$defs/SerialComponent"
2325
+ },
2326
+ "maxContains": 1,
2327
+ "minContains": 1,
2328
+ "minItems": 1,
2329
+ "type": "array"
2330
+ },
2331
+ "mode": {
2332
+ "const": "custom",
2333
+ "description": "使用按数组顺序拼接的自定义编号组件。"
2334
+ }
2335
+ },
2336
+ "required": [
2337
+ "mode",
2338
+ "components"
2339
+ ],
2340
+ "type": "object"
2341
+ }
2342
+ ]
2343
+ },
2344
+ "SubField": {
2345
+ "allOf": [
2346
+ {
2347
+ "$ref": "#/$defs/SubFieldCommon"
2348
+ },
2349
+ {
2350
+ "oneOf": [
2351
+ {
2352
+ "properties": {
2353
+ "config": {
2354
+ "$ref": "#/$defs/TextConfig"
2355
+ },
2356
+ "questionType": {
2357
+ "enum": [
2358
+ "text",
2359
+ "long_text",
2360
+ "link",
2361
+ "email"
2362
+ ]
2363
+ }
2364
+ },
2365
+ "required": [
2366
+ "questionType"
2367
+ ]
2368
+ },
2369
+ {
2370
+ "properties": {
2371
+ "config": {
2372
+ "$ref": "#/$defs/PhoneConfig"
2373
+ },
2374
+ "questionType": {
2375
+ "const": "phone"
2376
+ }
2377
+ },
2378
+ "required": [
2379
+ "questionType"
2380
+ ]
2381
+ },
2382
+ {
2383
+ "properties": {
2384
+ "config": {
2385
+ "$ref": "#/$defs/NumberConfig"
2386
+ },
2387
+ "questionType": {
2388
+ "const": "number"
2389
+ }
2390
+ },
2391
+ "required": [
2392
+ "questionType"
2393
+ ]
2394
+ },
2395
+ {
2396
+ "properties": {
2397
+ "config": {
2398
+ "$ref": "#/$defs/EmptyConfig"
2399
+ },
2400
+ "questionType": {
2401
+ "const": "date"
2402
+ }
2403
+ },
2404
+ "required": [
2405
+ "questionType"
2406
+ ]
2407
+ },
2408
+ {
2409
+ "properties": {
2410
+ "config": {
2411
+ "$ref": "#/$defs/AttachmentConfig"
2412
+ },
2413
+ "questionType": {
2414
+ "const": "attachment"
2415
+ }
2416
+ },
2417
+ "required": [
2418
+ "questionType"
2419
+ ]
2420
+ },
2421
+ {
2422
+ "properties": {
2423
+ "config": {
2424
+ "$ref": "#/$defs/MemberConfig"
2425
+ },
2426
+ "questionType": {
2427
+ "const": "member"
2428
+ }
2429
+ },
2430
+ "required": [
2431
+ "questionType"
2432
+ ]
2433
+ },
2434
+ {
2435
+ "properties": {
2436
+ "config": {
2437
+ "$ref": "#/$defs/ChoiceConfig"
2438
+ },
2439
+ "questionType": {
2440
+ "enum": [
2441
+ "single_choice",
2442
+ "single_select",
2443
+ "multi_select"
2444
+ ]
2445
+ }
2446
+ },
2447
+ "required": [
2448
+ "questionType",
2449
+ "config"
2450
+ ]
2451
+ },
2452
+ {
2453
+ "properties": {
2454
+ "config": {
2455
+ "$ref": "#/$defs/DepartmentConfig"
2456
+ },
2457
+ "questionType": {
2458
+ "const": "department"
2459
+ }
2460
+ },
2461
+ "required": [
2462
+ "questionType",
2463
+ "config"
2464
+ ]
2465
+ },
2466
+ {
2467
+ "properties": {
2468
+ "config": {
2469
+ "$ref": "#/$defs/RelationConfig"
2470
+ },
2471
+ "questionType": {
2472
+ "const": "relation"
2473
+ }
2474
+ },
2475
+ "required": [
2476
+ "questionType",
2477
+ "config"
2478
+ ]
2479
+ },
2480
+ {
2481
+ "properties": {
2482
+ "config": {
2483
+ "$ref": "#/$defs/DataRelationConfig"
2484
+ },
2485
+ "questionType": {
2486
+ "const": "data_relation"
2487
+ }
2488
+ },
2489
+ "required": [
2490
+ "questionType",
2491
+ "config"
2492
+ ]
2493
+ }
2494
+ ]
2495
+ }
2496
+ ],
2497
+ "description": "表格子字段;仅允许一期白名单类型,不包含布局宽度。",
2498
+ "type": "object",
2499
+ "unevaluatedProperties": false
2500
+ },
2501
+ "SubFieldCommon": {
2502
+ "allOf": [
2503
+ {
2504
+ "if": {
2505
+ "properties": {
2506
+ "defaultType": {
2507
+ "const": 2
2508
+ }
2509
+ },
2510
+ "required": [
2511
+ "defaultType"
2512
+ ]
2513
+ },
2514
+ "then": {
2515
+ "properties": {
2516
+ "defaultValue": {
2517
+ "type": "null"
2518
+ }
2519
+ }
2520
+ }
2521
+ },
2522
+ {
2523
+ "if": {
2524
+ "properties": {
2525
+ "defaultType": {
2526
+ "const": 3
2527
+ }
2528
+ },
2529
+ "required": [
2530
+ "defaultType"
2531
+ ]
2532
+ },
2533
+ "then": {
2534
+ "properties": {
2535
+ "defaultValue": {
2536
+ "minLength": 1,
2537
+ "type": [
2538
+ "string",
2539
+ "null"
2540
+ ]
2541
+ }
2542
+ }
2543
+ }
2544
+ }
2545
+ ],
2546
+ "anyOf": [
2547
+ {
2548
+ "required": [
2549
+ "queId"
2550
+ ]
2551
+ },
2552
+ {
2553
+ "required": [
2554
+ "name"
2555
+ ]
2556
+ }
2557
+ ],
2558
+ "description": "表格子字段的公共属性;不允许 width,也不能被应用级数据标题或数据封面选择器选中。",
2559
+ "properties": {
2560
+ "beingRequired": {
2561
+ "description": "该子字段是否必填;缺失时保留当前值。",
2562
+ "type": "boolean"
2563
+ },
2564
+ "defaultType": {
2565
+ "default": 1,
2566
+ "description": "默认值类型,与 defaultValue 联动;1 表示静态值,2 表示关联/绑定值且 defaultValue 只能省略或为 null,3 表示公式值且提供 defaultValue 时必须为非空公式文本。省略 defaultType 但提供 defaultValue 时按 1 处理。",
2567
+ "enum": [
2568
+ 1,
2569
+ 2,
2570
+ 3
2571
+ ],
2572
+ "type": "integer"
2573
+ },
2574
+ "defaultValue": {
2575
+ "$ref": "#/$defs/ScalarDefaultValue",
2576
+ "description": "表单填写时的默认值;后端 queDefaultValue 为字符串,因此数字等字面量也必须以字符串传入。defaultType 为 1 时表示静态文本,为 3 时表示公式文本,为 2 时不携带字面量默认值。显式 null 表示清除默认值。"
2577
+ },
2578
+ "name": {
2579
+ "description": "子字段展示名称;新增子字段必填,已有子字段可在携带 queId 时省略。",
2580
+ "minLength": 1,
2581
+ "type": "string"
2582
+ },
2583
+ "queId": {
2584
+ "description": "已有子字段的后端 ID;更新时用于精确定位并复用,新增子字段通常省略。",
2585
+ "minimum": 1,
2586
+ "type": "integer"
2587
+ },
2588
+ "questionDescription": {
2589
+ "description": "子字段说明;null 或空字符串表示清空。",
2590
+ "type": [
2591
+ "string",
2592
+ "null"
2593
+ ]
2594
+ },
2595
+ "questionType": {
2596
+ "description": "子字段类型;具体可用值由当前字段详情 Schema 的判别分支约束。",
2597
+ "type": "string"
2598
+ }
2599
+ },
2600
+ "type": "object"
2601
+ },
2602
+ "SubtableConfig": {
2603
+ "additionalProperties": false,
2604
+ "description": "表格行数和重复值限制。",
2605
+ "properties": {
2606
+ "defaultValues": {
2607
+ "oneOf": [
2608
+ {
2609
+ "type": "null"
2610
+ },
2611
+ {
2612
+ "$ref": "#/$defs/DefaultValues"
2613
+ }
2614
+ ]
2615
+ },
2616
+ "tableNoRepeatQuestion": {
2617
+ "items": {
2618
+ "$ref": "#/$defs/FieldSelector"
2619
+ },
2620
+ "type": "array"
2621
+ },
2622
+ "tableNoRepeatStatus": {
2623
+ "type": [
2624
+ "boolean",
2625
+ "null"
2626
+ ]
2627
+ },
2628
+ "tableRowHeight": {
2629
+ "minLength": 1,
2630
+ "type": [
2631
+ "string",
2632
+ "null"
2633
+ ]
2634
+ },
2635
+ "tableRowsLimit": {
2636
+ "minimum": 1,
2637
+ "type": [
2638
+ "integer",
2639
+ "null"
2640
+ ]
2641
+ }
2642
+ },
2643
+ "type": "object"
2644
+ },
2645
+ "TextConfig": {
2646
+ "additionalProperties": false,
2647
+ "description": "文字类字段的长度限制;省略表示保留当前值。",
2648
+ "properties": {
2649
+ "canScan": {
2650
+ "description": "是否允许扫码输入。",
2651
+ "type": [
2652
+ "boolean",
2653
+ "null"
2654
+ ]
2655
+ },
2656
+ "maxWordCount": {
2657
+ "description": "最多字数;null 表示清除限制。",
2658
+ "minimum": 0,
2659
+ "type": [
2660
+ "integer",
2661
+ "null"
2662
+ ]
2663
+ },
2664
+ "minWordCount": {
2665
+ "description": "最少字数;null 表示清除限制。",
2666
+ "minimum": 0,
2667
+ "type": [
2668
+ "integer",
2669
+ "null"
2670
+ ]
2671
+ },
2672
+ "noRepeat": {
2673
+ "description": "是否禁止重复值。",
2674
+ "type": [
2675
+ "boolean",
2676
+ "null"
2677
+ ]
2678
+ },
2679
+ "scanType": {
2680
+ "description": "扫码类型 ID。",
2681
+ "minimum": 0,
2682
+ "type": [
2683
+ "integer",
2684
+ "null"
2685
+ ]
2686
+ }
2687
+ },
2688
+ "type": "object"
2689
+ },
2690
+ "TopField": {
2691
+ "allOf": [
2692
+ {
2693
+ "$ref": "#/$defs/FieldCommon"
2694
+ },
2695
+ {
2696
+ "oneOf": [
2697
+ {
2698
+ "properties": {
2699
+ "config": {
2700
+ "$ref": "#/$defs/EmptyConfig"
2701
+ },
2702
+ "questionType": {
2703
+ "enum": [
2704
+ "date",
2705
+ "datetime"
2706
+ ]
2707
+ }
2708
+ },
2709
+ "required": [
2710
+ "questionType"
2711
+ ]
2712
+ },
2713
+ {
2714
+ "properties": {
2715
+ "config": {
2716
+ "$ref": "#/$defs/TextConfig"
2717
+ },
2718
+ "questionType": {
2719
+ "enum": [
2720
+ "text",
2721
+ "long_text",
2722
+ "link",
2723
+ "email"
2724
+ ]
2725
+ }
2726
+ },
2727
+ "required": [
2728
+ "questionType"
2729
+ ]
2730
+ },
2731
+ {
2732
+ "properties": {
2733
+ "config": {
2734
+ "$ref": "#/$defs/PhoneConfig"
2735
+ },
2736
+ "questionType": {
2737
+ "const": "phone"
2738
+ }
2739
+ },
2740
+ "required": [
2741
+ "questionType"
2742
+ ]
2743
+ },
2744
+ {
2745
+ "properties": {
2746
+ "config": {
2747
+ "$ref": "#/$defs/NumberConfig"
2748
+ },
2749
+ "questionType": {
2750
+ "enum": [
2751
+ "number",
2752
+ "amount"
2753
+ ]
2754
+ }
2755
+ },
2756
+ "required": [
2757
+ "questionType"
2758
+ ]
2759
+ },
2760
+ {
2761
+ "properties": {
2762
+ "config": {
2763
+ "$ref": "#/$defs/MemberConfig"
2764
+ },
2765
+ "questionType": {
2766
+ "const": "member"
2767
+ }
2768
+ },
2769
+ "required": [
2770
+ "questionType"
2771
+ ]
2772
+ },
2773
+ {
2774
+ "properties": {
2775
+ "config": {
2776
+ "$ref": "#/$defs/AddressConfig"
2777
+ },
2778
+ "questionType": {
2779
+ "const": "address"
2780
+ }
2781
+ },
2782
+ "required": [
2783
+ "questionType"
2784
+ ]
2785
+ },
2786
+ {
2787
+ "properties": {
2788
+ "config": {
2789
+ "$ref": "#/$defs/AttachmentConfig"
2790
+ },
2791
+ "questionType": {
2792
+ "const": "attachment"
2793
+ }
2794
+ },
2795
+ "required": [
2796
+ "questionType"
2797
+ ]
2798
+ },
2799
+ {
2800
+ "properties": {
2801
+ "config": {
2802
+ "$ref": "#/$defs/ChoiceConfig"
2803
+ },
2804
+ "questionType": {
2805
+ "enum": [
2806
+ "single_choice",
2807
+ "single_select",
2808
+ "multi_select"
2809
+ ]
2810
+ }
2811
+ },
2812
+ "required": [
2813
+ "questionType",
2814
+ "config"
2815
+ ]
2816
+ },
2817
+ {
2818
+ "properties": {
2819
+ "config": {
2820
+ "$ref": "#/$defs/DepartmentConfig"
2821
+ },
2822
+ "questionType": {
2823
+ "const": "department"
2824
+ }
2825
+ },
2826
+ "required": [
2827
+ "questionType",
2828
+ "config"
2829
+ ]
2830
+ },
2831
+ {
2832
+ "properties": {
2833
+ "config": {
2834
+ "$ref": "#/$defs/RelationConfig"
2835
+ },
2836
+ "questionType": {
2837
+ "const": "relation"
2838
+ }
2839
+ },
2840
+ "required": [
2841
+ "questionType",
2842
+ "config"
2843
+ ]
2844
+ },
2845
+ {
2846
+ "properties": {
2847
+ "config": {
2848
+ "$ref": "#/$defs/QLinkerConfig"
2849
+ },
2850
+ "questionType": {
2851
+ "const": "q_linker"
2852
+ }
2853
+ },
2854
+ "required": [
2855
+ "questionType",
2856
+ "config"
2857
+ ]
2858
+ },
2859
+ {
2860
+ "properties": {
2861
+ "config": {
2862
+ "$ref": "#/$defs/CodeBlockConfig"
2863
+ },
2864
+ "questionType": {
2865
+ "const": "code_block"
2866
+ }
2867
+ },
2868
+ "required": [
2869
+ "questionType",
2870
+ "config"
2871
+ ]
2872
+ },
2873
+ {
2874
+ "properties": {
2875
+ "config": {
2876
+ "$ref": "#/$defs/DataRelationConfig"
2877
+ },
2878
+ "questionType": {
2879
+ "const": "data_relation"
2880
+ }
2881
+ },
2882
+ "required": [
2883
+ "questionType",
2884
+ "config"
2885
+ ]
2886
+ },
2887
+ {
2888
+ "properties": {
2889
+ "config": {
2890
+ "$ref": "#/$defs/SubtableConfig"
2891
+ },
2892
+ "questionType": {
2893
+ "const": "subtable"
2894
+ },
2895
+ "subfields": {
2896
+ "items": {
2897
+ "$ref": "#/$defs/SubField"
2898
+ },
2899
+ "minItems": 1,
2900
+ "type": "array"
2901
+ }
2902
+ },
2903
+ "required": [
2904
+ "questionType",
2905
+ "subfields"
2906
+ ]
2907
+ }
2908
+ ]
2909
+ }
2910
+ ],
2911
+ "description": "顶层业务字段;questionType 决定 config 或 subfields 的结构。",
2912
+ "type": "object",
2913
+ "unevaluatedProperties": false
2914
+ }
2915
+ },
2916
+ "$id": "https://builder.qingflow.com/schemas/app-form-apply/v1alpha1.json",
2917
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
2918
+ "oneOf": [
2919
+ {
2920
+ "required": [
2921
+ "appKey"
2922
+ ]
2923
+ },
2924
+ {
2925
+ "not": {
2926
+ "required": [
2927
+ "appKey"
2928
+ ]
2929
+ },
2930
+ "properties": {
2931
+ "spec": {
2932
+ "required": [
2933
+ "appName"
2934
+ ]
2935
+ }
2936
+ },
2937
+ "required": [
2938
+ "packageId"
2939
+ ]
2940
+ }
2941
+ ],
2942
+ "properties": {
2943
+ "apiVersion": {
2944
+ "const": "builder.qingflow.com/v1alpha1",
2945
+ "description": "AppForm 契约版本;当前固定为 v1alpha1。"
2946
+ },
2947
+ "appKey": {
2948
+ "description": "更新已有应用的唯一标识;存在非空值即进入更新模式。",
2949
+ "minLength": 1,
2950
+ "type": "string"
2951
+ },
2952
+ "packageId": {
2953
+ "description": "创建时指定新应用所属包;更新时确保该包引用应用,不移除其他包引用。",
2954
+ "minimum": 1,
2955
+ "type": "integer"
2956
+ },
2957
+ "spec": {
2958
+ "$ref": "#/$defs/AppFormSpec",
2959
+ "description": "应用表单的最终声明状态。"
2960
+ }
2961
+ },
2962
+ "required": [
2963
+ "apiVersion",
2964
+ "spec"
2965
+ ],
2966
+ "title": "Qingflow AppFormApply v1alpha1",
2967
+ "type": "object",
2968
+ "unevaluatedProperties": false
2969
+ }