@stalfh233/omc-cli 0.8.16 → 0.8.18
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/call.js +25 -2
- package/dist/cli.js +25 -5
- package/dist/discovery.js +2 -0
- package/dist/field-add.js +1 -1
- package/dist/form-support.js +55 -7
- package/dist/goal-plan.js +23 -2
- package/dist/goal-routes.js +94 -18
- package/dist/human-summary.js +20 -2
- package/dist/lanes/datarule.js +3 -0
- package/dist/lanes/field-contract.js +10 -1
- package/dist/lanes/field.js +98 -21
- package/dist/lanes/form-contract.js +1 -1
- package/dist/lanes/form.js +13 -5
- package/dist/lanes/list-view.js +113 -4
- package/dist/lanes/runtime-data-contract.js +2 -1
- package/dist/lanes/runtime-data.js +244 -25
- package/dist/model-purge.js +23 -3
- package/dist/model-scaffold.js +11 -3
- package/dist/path-projection.js +151 -4
- package/dist/recipes/datarule.js +39 -1
- package/dist/recipes/list-view.js +38 -1
- package/dist/residue.js +22 -7
- package/dist/search-index.js +2 -0
- package/dist/wire.js +11 -1
- package/dist/write.js +2 -1
- package/package.json +3 -3
- package/skills/omc-capabilities.md +1 -1
- package/skills/omc-start-here.md +1 -1
|
@@ -344,18 +344,78 @@ const RUNTIME_SYSTEM_FIELD_CODES = new Set([
|
|
|
344
344
|
...SYSTEM_FIELD_CODES, ...RUNTIME_ENGINE_RECORD_KEYS,
|
|
345
345
|
"bizObjectId", "schemaCode", "updatedTime", "creator", "updater", "parentId", "sortKey",
|
|
346
346
|
]);
|
|
347
|
-
|
|
348
|
-
|
|
347
|
+
const BUSINESS_NULL_WARNING_HINT = "模型可能未配置列表视图:data.list 只投影列表列,业务列会全为 null;核对写入结果请用 data.load,或用 listview.configure 给视图配列";
|
|
348
|
+
const BUSINESS_MISSING_WARNING_HINT = "本次返回行没有任何业务字段(只有系统列):data.list 只回列表视图投影列,键缺席≠值为空;盘点字段值用 data.load,或把业务列加进视图(listview.configure)";
|
|
349
|
+
function isBusinessProjectionCode(code) {
|
|
350
|
+
return code.length > 0 && !RUNTIME_SYSTEM_FIELD_CODES.has(code) && !code.endsWith("_") && !code.endsWith("_key");
|
|
351
|
+
}
|
|
352
|
+
export function projectionWarningOf(items, evidence, requestedFields,
|
|
353
|
+
/**
|
|
354
|
+
* 模型已发布业务列(可选)。业务键整个缺席时,光有视图证据分不清「视图漏配」
|
|
355
|
+
* 与「模型本来就没有业务列」——只有模型字段目录能判。传入空数组 = 纯系统模型,
|
|
356
|
+
* 静默(r53 的 system-only 行不是漏投影);undefined = 读不到,不编结论。
|
|
357
|
+
*/
|
|
358
|
+
modelBusinessCodes) {
|
|
359
|
+
if (items.length === 0)
|
|
360
|
+
return undefined;
|
|
361
|
+
const businessKeys = new Set();
|
|
362
|
+
let hasBusinessValue = false;
|
|
349
363
|
for (const item of items) {
|
|
350
364
|
for (const [key, value] of Object.entries(item.fields)) {
|
|
351
|
-
if (
|
|
365
|
+
if (!isBusinessProjectionCode(key))
|
|
352
366
|
continue;
|
|
353
|
-
|
|
367
|
+
businessKeys.add(key);
|
|
354
368
|
if (value !== null && value !== undefined)
|
|
355
|
-
|
|
369
|
+
hasBusinessValue = true;
|
|
356
370
|
}
|
|
357
371
|
}
|
|
358
|
-
|
|
372
|
+
const viewCodes = evidence?.viewColumnCodes;
|
|
373
|
+
const projectionKnown = viewCodes !== undefined;
|
|
374
|
+
if (businessKeys.size > 0 && hasBusinessValue)
|
|
375
|
+
return undefined;
|
|
376
|
+
// 显式窄投影:调用方自己只要了系统列(如 fields:["sequenceNo"]),业务列缺席
|
|
377
|
+
// 是请求本身的形状,不是视图漏配——不能反过来教「去配视图」。
|
|
378
|
+
if (businessKeys.size === 0
|
|
379
|
+
&& requestedFields !== undefined
|
|
380
|
+
&& requestedFields.length > 0
|
|
381
|
+
&& requestedFields.every((code) => !isBusinessProjectionCode(code))) {
|
|
382
|
+
return {
|
|
383
|
+
reason: "caller-narrowed",
|
|
384
|
+
hint: "你显式只选了系统列,业务列不在本次投影里;业务值用 data.load 读单条,或把业务列加进 fields(只能选视图列)。",
|
|
385
|
+
projectionKnown,
|
|
386
|
+
...(evidence?.viewColumnsCount !== undefined ? { viewColumnsCount: evidence.viewColumnsCount } : {}),
|
|
387
|
+
};
|
|
388
|
+
}
|
|
389
|
+
if (businessKeys.size === 0) {
|
|
390
|
+
const modelCodes = modelBusinessCodes?.filter(isBusinessProjectionCode);
|
|
391
|
+
// r53:模型自己没有业务列(纯系统模型)→ 系统-only 行是正常形状,不喊狼。
|
|
392
|
+
if (modelCodes !== undefined && modelCodes.length === 0)
|
|
393
|
+
return undefined;
|
|
394
|
+
// 有模型证据就点名「模型业务列里没回来的」;否则退回视图证据;都没有就不编字段名。
|
|
395
|
+
const unprojected = modelCodes !== undefined
|
|
396
|
+
? modelCodes.filter((code) => !businessKeys.has(code))
|
|
397
|
+
: viewCodes === undefined
|
|
398
|
+
? []
|
|
399
|
+
: viewCodes.filter((code) => isBusinessProjectionCode(code) && !businessKeys.has(code));
|
|
400
|
+
const detail = unprojected.length > 0
|
|
401
|
+
? `${modelCodes !== undefined ? "模型的业务列" : "视图里的业务列"} ${unprojected.join("、")} 未出现在结果行`
|
|
402
|
+
: modelCodes === undefined && projectionKnown
|
|
403
|
+
? "当前列表视图没有业务列"
|
|
404
|
+
: undefined;
|
|
405
|
+
return {
|
|
406
|
+
reason: "business-columns-missing",
|
|
407
|
+
hint: `${BUSINESS_MISSING_WARNING_HINT}${detail !== undefined ? `(${detail})` : ""}`,
|
|
408
|
+
projectionKnown,
|
|
409
|
+
...(evidence?.viewColumnsCount !== undefined ? { viewColumnsCount: evidence.viewColumnsCount } : {}),
|
|
410
|
+
...(unprojected.length > 0 ? { unprojected } : {}),
|
|
411
|
+
};
|
|
412
|
+
}
|
|
413
|
+
return {
|
|
414
|
+
reason: "business-columns-null",
|
|
415
|
+
hint: BUSINESS_NULL_WARNING_HINT,
|
|
416
|
+
projectionKnown,
|
|
417
|
+
...(evidence?.viewColumnsCount !== undefined ? { viewColumnsCount: evidence.viewColumnsCount } : {}),
|
|
418
|
+
};
|
|
359
419
|
}
|
|
360
420
|
const VIEW_PROJECTION_HINT = "该面仅回视图投影列;业务字段全 null 不代表未写入,真值用 data.load,或用 listview.configure 配列。";
|
|
361
421
|
const PROJECTION_MISS_HINT = "这些字段没有出现在平台返回行里 ≠ 值为空;先查 listview.get 或用 data.load 复核";
|
|
@@ -667,6 +727,37 @@ export function relationColumnsNotProjected(codes, relationCodes, schemaCode, sa
|
|
|
667
727
|
*/
|
|
668
728
|
const MAPPING_NOTE_LIMIT = 5;
|
|
669
729
|
const MAPPING_NOTE_TARGET_LIMIT = 3;
|
|
730
|
+
/** 快照空值判据:null/undefined/空白串(0/false 是有效值,不算空)。 */
|
|
731
|
+
function mappingTargetEmpty(value) {
|
|
732
|
+
return value === null || value === undefined || (typeof value === "string" && value.trim() === "");
|
|
733
|
+
}
|
|
734
|
+
function childRowValues(row) {
|
|
735
|
+
if (row === null || typeof row !== "object" || Array.isArray(row))
|
|
736
|
+
return undefined;
|
|
737
|
+
const record = row;
|
|
738
|
+
return record.data !== null && typeof record.data === "object" && !Array.isArray(record.data)
|
|
739
|
+
? record.data
|
|
740
|
+
: record;
|
|
741
|
+
}
|
|
742
|
+
function mappingSnapshotGapFor(hits) {
|
|
743
|
+
const gapHits = hits.filter((hit) => hit.gapRows.length > 0);
|
|
744
|
+
if (gapHits.length === 0)
|
|
745
|
+
return undefined;
|
|
746
|
+
const rows = [...new Set(gapHits.flatMap((hit) => hit.gapRows))].sort((a, b) => a - b);
|
|
747
|
+
const fields = [...new Set(gapHits.flatMap((hit) => hit.gapFields))];
|
|
748
|
+
const childTables = [...new Set(gapHits.map((hit) => hit.childTable))];
|
|
749
|
+
const location = gapHits
|
|
750
|
+
.slice(0, MAPPING_NOTE_LIMIT)
|
|
751
|
+
.map((hit) => `${hit.childTable} 第 ${hit.gapRows.join("/")} 行→${hit.gapFields.join("/")}`)
|
|
752
|
+
.join("、");
|
|
753
|
+
return {
|
|
754
|
+
rows,
|
|
755
|
+
fields,
|
|
756
|
+
childTables,
|
|
757
|
+
hint: `REST 写不跑关联映射,这些快照字段需在 formData 里自填(门户选值才会回填):${location}` +
|
|
758
|
+
`${gapHits.length > MAPPING_NOTE_LIMIT ? ` 等 ${gapHits.length} 处` : ""};映射配置以 field.get 的 options 为准。`,
|
|
759
|
+
};
|
|
760
|
+
}
|
|
670
761
|
function relationMappingsOf(row) {
|
|
671
762
|
const options = parseOptions(row.options);
|
|
672
763
|
let raw = options.mappings ?? row.mappings;
|
|
@@ -705,6 +796,7 @@ async function childTableMappingHits(session, formData, childCodes) {
|
|
|
705
796
|
// 元数据读不到就不提示(读面副作用不能阻断写)。
|
|
706
797
|
continue;
|
|
707
798
|
}
|
|
799
|
+
const formRows = Array.isArray(formData[childTable]) ? formData[childTable] : [];
|
|
708
800
|
for (const row of rows) {
|
|
709
801
|
const type = Number(row.propertyType ?? row.type);
|
|
710
802
|
if (!RELATION_PROPERTY_TYPES.has(type))
|
|
@@ -713,8 +805,27 @@ async function childTableMappingHits(session, formData, childCodes) {
|
|
|
713
805
|
if (!mapping.declared)
|
|
714
806
|
continue;
|
|
715
807
|
const relationField = String(row.code ?? row.propertyCode ?? "");
|
|
716
|
-
if (relationField)
|
|
717
|
-
|
|
808
|
+
if (!relationField)
|
|
809
|
+
continue;
|
|
810
|
+
// F4(w153):同一份元数据顺带检查本次 formData 的快照空值,零额外 wire。
|
|
811
|
+
const gapRows = [];
|
|
812
|
+
const gapFields = [];
|
|
813
|
+
const targets = mapping.targets;
|
|
814
|
+
if (targets.length > 0) {
|
|
815
|
+
formRows.forEach((entry, index) => {
|
|
816
|
+
const values = childRowValues(entry);
|
|
817
|
+
if (values === undefined)
|
|
818
|
+
return;
|
|
819
|
+
const empty = targets.filter((target) => mappingTargetEmpty(values[target]));
|
|
820
|
+
if (empty.length === 0)
|
|
821
|
+
return;
|
|
822
|
+
gapRows.push(index + 1);
|
|
823
|
+
for (const target of empty)
|
|
824
|
+
if (!gapFields.includes(target))
|
|
825
|
+
gapFields.push(target);
|
|
826
|
+
});
|
|
827
|
+
}
|
|
828
|
+
hits.push({ childTable, relationField, targets, gapRows, gapFields });
|
|
718
829
|
}
|
|
719
830
|
}
|
|
720
831
|
return hits;
|
|
@@ -732,6 +843,13 @@ function mappingRuntimeNoteFor(hits) {
|
|
|
732
843
|
.join("、");
|
|
733
844
|
return `REST 写不执行关联映射(options.mappings 只在门户选值时由表单运行时回填):${detail}${hits.length > shown.length ? ` 等 ${hits.length} 处` : ""};快照/映射目标字段需调用方在 formData 里自填,映射配置以 field.get 的 options 为准。`;
|
|
734
845
|
}
|
|
846
|
+
/**
|
|
847
|
+
* F6(w153 探针 L,2026-11-28):`name` 是模型「数据标题」表达式(模型可配置
|
|
848
|
+
* summary,常见如 创建人+模型名+时间——不是固定文案),平台 insert/update
|
|
849
|
+
* 无条件覆盖(见 `nameOverwrittenNoteOf` 的源码链)。写前就要说清楚,而不是
|
|
850
|
+
* 等读回发现被改;只在 formData 真的传了 `name` 时提示。
|
|
851
|
+
*/
|
|
852
|
+
export const DATA_TITLE_NOTE = "`name` 是平台数据标题(模型可配置 summary,常见如 创建人+模型名+时间)——传入会被覆盖;业务标识(单号/编码)请用自建字段。";
|
|
735
853
|
const NAME_NOTE_VALUE_LIMIT = 40;
|
|
736
854
|
function shortReadbackValue(value) {
|
|
737
855
|
return value.length > NAME_NOTE_VALUE_LIMIT ? `${value.slice(0, NAME_NOTE_VALUE_LIMIT)}…` : value;
|
|
@@ -2091,6 +2209,20 @@ export function registerRuntimeDataLane(tools) {
|
|
|
2091
2209
|
.filter((row) => row.code.length > 0);
|
|
2092
2210
|
return publishedCatalog;
|
|
2093
2211
|
};
|
|
2212
|
+
/**
|
|
2213
|
+
* F3(0.8.18 复核):业务键整个缺席时,用已发布字段目录判「模型有没有业务列」。
|
|
2214
|
+
* 纯系统模型静默(r53);读失败返回 undefined(不编结论)。只在
|
|
2215
|
+
* 「视图没有业务列 + 调用方没有窄投影」时才付这笔读(复用 publishedFields
|
|
2216
|
+
* 的进程内缓存);视图已列业务列 / 全投影读都是零额外 wire。
|
|
2217
|
+
*/
|
|
2218
|
+
const publishedBusinessCodes = async () => {
|
|
2219
|
+
try {
|
|
2220
|
+
return (await publishedFields()).map((row) => row.code).filter(isBusinessProjectionCode);
|
|
2221
|
+
}
|
|
2222
|
+
catch {
|
|
2223
|
+
return undefined;
|
|
2224
|
+
}
|
|
2225
|
+
};
|
|
2094
2226
|
const publishedTypeByCode = async () => {
|
|
2095
2227
|
if (publishedTypes)
|
|
2096
2228
|
return publishedTypes;
|
|
@@ -2378,10 +2510,20 @@ export function registerRuntimeDataLane(tools) {
|
|
|
2378
2510
|
const projectionMissAll = dataListProjectionMiss(collected, fields);
|
|
2379
2511
|
const preview = dataListItemPreview(items);
|
|
2380
2512
|
const nullProjection = items.some((item) => Object.values(item.fields).some((value) => value === null));
|
|
2513
|
+
// F3(w153):业务键整个缺席时也要读视图证据——否则「只有系统列」
|
|
2514
|
+
// 的回执说不出视图里到底缺了哪些业务列。零业务键本身是形状判据,
|
|
2515
|
+
// 不依赖 null。
|
|
2516
|
+
const businessMissing = items.length > 0 && !items.some((item) => Object.keys(item.fields).some(isBusinessProjectionCode));
|
|
2381
2517
|
// F2(retro 24):出现 null 业务列才读视图证据(正常读取零额外 wire);
|
|
2382
2518
|
// 证据链见 projectionHintFace 的源码注释。F5(w63):显式选列时必须读
|
|
2383
2519
|
// 视图列证据才能判「超列」,一笔额外 query/get 只付在显式投影的读上。
|
|
2384
|
-
const viewEvidence = nullProjection || fields !== undefined ? await listViewProjectionEvidence(session, args.schemaCode, args.queryCode ?? args.schemaCode) : undefined;
|
|
2520
|
+
const viewEvidence = nullProjection || fields !== undefined || businessMissing ? await listViewProjectionEvidence(session, args.schemaCode, args.queryCode ?? args.schemaCode) : undefined;
|
|
2521
|
+
// 只有「视图证据说不出业务列」时才读模型字段目录:视图里有业务列时
|
|
2522
|
+
// 已能点名未投影列(零额外 wire);纯系统窄投影是调用方自己收窄,也不读。
|
|
2523
|
+
const narrowToSystemAll = fields !== undefined && fields.length > 0 && fields.every((code) => !isBusinessProjectionCode(code));
|
|
2524
|
+
const viewNamesBusinessAll = (viewEvidence?.viewColumnCodes ?? []).some(isBusinessProjectionCode);
|
|
2525
|
+
const modelBusinessCodesAll = businessMissing && !narrowToSystemAll && !viewNamesBusinessAll ? await publishedBusinessCodes() : undefined;
|
|
2526
|
+
const projectionWarningAll = projectionWarningOf(items, viewEvidence, fields, modelBusinessCodesAll);
|
|
2385
2527
|
const projectionHintAll = projectionHintWithMiss(projectionHintFace(items, viewEvidence), projectionMissAll);
|
|
2386
2528
|
const columnsNotProjected = await relationNotProjectedOf(items, projectionMissAll, viewEvidence?.viewColumnCodes);
|
|
2387
2529
|
const itemsWithProjection = attachItemUnprojected(items, projectionMissAll, viewEvidence?.viewColumnCodes);
|
|
@@ -2429,7 +2571,14 @@ export function registerRuntimeDataLane(tools) {
|
|
|
2429
2571
|
itemsReturned: collected.length,
|
|
2430
2572
|
resultTruncated: truncatedByCap,
|
|
2431
2573
|
itemsExternalized: false,
|
|
2432
|
-
...(
|
|
2574
|
+
...(projectionWarningAll !== undefined
|
|
2575
|
+
? {
|
|
2576
|
+
projectionWarning: projectionWarningAll,
|
|
2577
|
+
// caller-narrowed 是调用方自己的投影选择,不是「视图漏配」。
|
|
2578
|
+
...(projectionWarningAll.reason !== "caller-narrowed" ? { viewProjectionOnly: true } : {}),
|
|
2579
|
+
hint: projectionWarningAll.hint,
|
|
2580
|
+
}
|
|
2581
|
+
: {}),
|
|
2433
2582
|
// r29b F8 的 ids/itemsPreview 由 compact(外置时)现算,不在这里内联——
|
|
2434
2583
|
// 内联会让小结果越过 2048B 外置阈值,反而把 items 挤成 []。
|
|
2435
2584
|
...(truncatedByCap
|
|
@@ -2452,6 +2601,9 @@ export function registerRuntimeDataLane(tools) {
|
|
|
2452
2601
|
: {}),
|
|
2453
2602
|
...(projectionHintAll !== undefined ? { projectionHint: projectionHintAll } : {}),
|
|
2454
2603
|
...(anyNullField ? { nullSemantics: DATA_LIST_NULL_SEMANTICS } : {}),
|
|
2604
|
+
// 口径 = 行级证据(items[].unprojected 的跨行并集)。模型目录点名
|
|
2605
|
+
// (projectionWarning.unprojected)只进 warning.hint,不计入本数——
|
|
2606
|
+
// 否则人类行会指向该场景里并不存在的 `items[].unprojected`。
|
|
2455
2607
|
...(unprojectedCodes.length > 0 ? { unprojectedFieldCount: unprojectedCodes.length } : {}),
|
|
2456
2608
|
...(projectionMissAll.length > 0 ? { projectionMiss: projectionMissAll } : {}),
|
|
2457
2609
|
...(columnsNotProjected.length > 0 ? { columnsNotProjected } : {}),
|
|
@@ -2560,7 +2712,6 @@ export function registerRuntimeDataLane(tools) {
|
|
|
2560
2712
|
// back null while `data.load` shows the real values. That reads as
|
|
2561
2713
|
// "the write failed". Detect an all-null business projection (items
|
|
2562
2714
|
// present, zero non-null business values) and say so.
|
|
2563
|
-
const projectionEmpty = emptyBusinessProjection(items);
|
|
2564
2715
|
const preview = dataListItemPreview(items);
|
|
2565
2716
|
const requestedPage = args.page ?? 0;
|
|
2566
2717
|
// r31b F9: an out-of-range page can answer total:0 / totalPages:1 (platform),
|
|
@@ -2595,7 +2746,12 @@ export function registerRuntimeDataLane(tools) {
|
|
|
2595
2746
|
// projectionHintFace / listViewProjectionEvidence 的源码注释。
|
|
2596
2747
|
// F5(w63):显式选列时必须读视图列证据才能判「超列」。
|
|
2597
2748
|
const hasNullValue = items.some((item) => Object.values(item.fields).some((value) => value === null));
|
|
2598
|
-
const
|
|
2749
|
+
const businessMissingPaged = items.length > 0 && !items.some((item) => Object.keys(item.fields).some(isBusinessProjectionCode));
|
|
2750
|
+
const viewEvidence = hasNullValue || fields !== undefined || businessMissingPaged ? await listViewProjectionEvidence(session, args.schemaCode, args.queryCode ?? args.schemaCode) : undefined;
|
|
2751
|
+
const narrowToSystemPaged = fields !== undefined && fields.length > 0 && fields.every((code) => !isBusinessProjectionCode(code));
|
|
2752
|
+
const viewNamesBusinessPaged = (viewEvidence?.viewColumnCodes ?? []).some(isBusinessProjectionCode);
|
|
2753
|
+
const modelBusinessCodesPaged = businessMissingPaged && !narrowToSystemPaged && !viewNamesBusinessPaged ? await publishedBusinessCodes() : undefined;
|
|
2754
|
+
const projectionWarningPaged = projectionWarningOf(items, viewEvidence, fields, modelBusinessCodesPaged);
|
|
2599
2755
|
const projectionHintPaged = projectionHintWithMiss(projectionHintFace(items, viewEvidence), projectionMissPaged);
|
|
2600
2756
|
const columnsNotProjected = await relationNotProjectedOf(items, projectionMissPaged, viewEvidence?.viewColumnCodes);
|
|
2601
2757
|
const itemsWithProjection = attachItemUnprojected(items, projectionMissPaged, viewEvidence?.viewColumnCodes);
|
|
@@ -2626,8 +2782,10 @@ export function registerRuntimeDataLane(tools) {
|
|
|
2626
2782
|
schemaCode: args.schemaCode,
|
|
2627
2783
|
...application,
|
|
2628
2784
|
...(inlineChild !== undefined ? { childRowsHint: childRowsAggregateHint(inlineChild, args.schemaCode, "本页内联了子表行") } : {}),
|
|
2629
|
-
...(
|
|
2630
|
-
...(
|
|
2785
|
+
...(projectionWarningPaged !== undefined ? { projectionWarning: projectionWarningPaged } : {}),
|
|
2786
|
+
...(projectionWarningPaged !== undefined && projectionWarningPaged.reason !== "caller-narrowed"
|
|
2787
|
+
? { viewProjectionOnly: true, hint: projectionWarningPaged.hint }
|
|
2788
|
+
: {}),
|
|
2631
2789
|
...(args.queryCode !== undefined ? { queryCode: args.queryCode } : {}),
|
|
2632
2790
|
total,
|
|
2633
2791
|
// This branch is the non-`all` read. `excludedDraft` used to be
|
|
@@ -2657,6 +2815,7 @@ export function registerRuntimeDataLane(tools) {
|
|
|
2657
2815
|
...(choiceFilterFields.length > 0 && Number(total ?? 0) === 0 ? { filterValueHint: choiceFilterValueHint(choiceFilterFields) } : {}),
|
|
2658
2816
|
...(projectionHintPaged !== undefined ? { projectionHint: projectionHintPaged } : {}),
|
|
2659
2817
|
...(anyNullField ? { nullSemantics: DATA_LIST_NULL_SEMANTICS } : {}),
|
|
2818
|
+
// 同 all 路径:只数行级证据,模型目录点名留在 warning.hint。
|
|
2660
2819
|
...(unprojectedCodes.length > 0 ? { unprojectedFieldCount: unprojectedCodes.length } : {}),
|
|
2661
2820
|
...(projectionMissPaged.length > 0 ? { projectionMiss: projectionMissPaged } : {}),
|
|
2662
2821
|
...(columnsNotProjected.length > 0 ? { columnsNotProjected } : {}),
|
|
@@ -3452,12 +3611,31 @@ export function registerRuntimeDataLane(tools) {
|
|
|
3452
3611
|
// 券商 issue 1.3(cpdocs 2026-10-27):更新既有记录的主键契约——平台
|
|
3453
3612
|
// BizObjectModel.getId() 只读 bizObject.data.id;顶层 bizObject.bizObjectId
|
|
3454
3613
|
// 被保存逻辑忽略,errcode:0 但 objectId 是新 id(静默新建孤儿行)。
|
|
3455
|
-
'business-object data keyed by field code(关联/人员形状同默认描述)。**单选关联 WORK_SHEET 9=id 串或 `{id}`;MULT_WORK_SHEET 11/人员/组织 50/51 才数组;人员/组织元素 `{id,type,name}`,type 必填**。引擎拥有键(sequenceStatus 等)会被剥离——读改写的 sequenceStatus 不会把行钉回旧状态。新建时子表行缺 sortKey 会按数组下标补 1..n(平台读回按 sortKey ASC;更新既有记录请显式带 sortKey)。mappings
|
|
3614
|
+
'business-object data keyed by field code(关联/人员形状同默认描述)。**单选关联 WORK_SHEET 9=id 串或 `{id}`;MULT_WORK_SHEET 11/人员/组织 50/51 才数组;人员/组织元素 `{id,type,name}`,type 必填**。引擎拥有键(sequenceStatus 等)会被剥离——读改写的 sequenceStatus 不会把行钉回旧状态。新建时子表行缺 sortKey 会按数组下标补 1..n(平台读回按 sortKey ASC;更新既有记录请显式带 sortKey)。mappings 仅门户回填;子表快照字段为空会回 mappingSnapshotGap 点名行/字段;字典-backed 不校验取值(不存在/已停用码也会落库,要拦请配数据规则)。**`name` 是平台数据标题(模型可配置 summary,常见如 创建人+模型名+时间),传入会被覆盖;业务标识用自建字段**。既有记录更新:主键必须放 formData.id(顶层 bizObject.bizObjectId 被平台忽略会静默新建孤儿行——直调 REST 同理,cpdocs issue §1.3);id 无对应行会被拒(save-update-target-absent),新建请省略 id。'),
|
|
3456
3615
|
workflowCode: z.string().optional().describe("portal draft-save shape: create the row AND a DRAFT workflow instance + start workItem (finishStart=FALSE); submit later via data.submit with the returned workItemId. formData must NOT carry an id — in-place workflow start has no REST surface in 8.6.26。发起语义阶梯:本参数=发起停在第一节点(行/实例双 DRAFT,首办待办=发起人);到第一个审批节点用 data.submit 三件套;无流程模型用 submit:true 一调完成态;代他人发起(可选发起人)唯一路径=业务规则 CREATE+startWorkflow(完成态发起,不留草稿待办)"),
|
|
3457
3616
|
submit: z.boolean().optional().describe("true=保存后立即直提(无流程模型 DRAFT→COMPLETED,触发 Create 规则);与 workflowCode 互斥。**按业务约定正式数据优先直接 data.submit(无 id=新建并提交一调完成)——本参数是便捷别名,save 的定位是草稿/暂存**"),
|
|
3458
3617
|
allowStaffOnSubmit: z.boolean().optional().describe("submit:true 时显式允许携带人员字段(issue#10:人员字段提交面两种形状都可能 50000,可靠链路是 save 落库后提交时省略;个别平台构建接受提交面携带,自担风险)"),
|
|
3459
3618
|
...readbackProjectionArgs,
|
|
3460
3619
|
},
|
|
3620
|
+
// F4/F6(w153 探针 L):dry-run 也把「快照空值」与 name 标题语义说在写前。
|
|
3621
|
+
// 只读(父/子表已发布字段元数据)——与真写后的 mappingRuntimeNote 同源,
|
|
3622
|
+
// 真写路径仍只读一次子表 schema(本预览不参与真写)。
|
|
3623
|
+
dryRunPayload: async (session, args) => {
|
|
3624
|
+
const loaded = await loadPublishedFieldMeta(session, args.schemaCode);
|
|
3625
|
+
const formData = (args.formData ?? {});
|
|
3626
|
+
const mappingHits = loaded ? await childTableMappingHits(session, formData, loaded.childCodes) : [];
|
|
3627
|
+
const mappingRuntimeNote = mappingRuntimeNoteFor(mappingHits);
|
|
3628
|
+
const mappingSnapshotGap = mappingSnapshotGapFor(mappingHits);
|
|
3629
|
+
return {
|
|
3630
|
+
// F6 精度:只在 formData 真的传了 name 时才说标题会被覆盖。
|
|
3631
|
+
...(Object.prototype.hasOwnProperty.call(formData, "name") ? { nameTitleNote: DATA_TITLE_NOTE } : {}),
|
|
3632
|
+
...(mappingRuntimeNote !== undefined ? { mappingRuntimeNote } : {}),
|
|
3633
|
+
...(mappingSnapshotGap !== undefined ? { mappingSnapshotGap } : {}),
|
|
3634
|
+
summary: mappingSnapshotGap !== undefined
|
|
3635
|
+
? `计划写入 ${args.schemaCode};注意 ${mappingSnapshotGap.rows.length} 行子表快照字段为空(REST 不跑映射)`
|
|
3636
|
+
: `计划写入 ${args.schemaCode}`,
|
|
3637
|
+
};
|
|
3638
|
+
},
|
|
3461
3639
|
execute: async (session, args) => {
|
|
3462
3640
|
const applicationScope = await resolveApplicationScope(session);
|
|
3463
3641
|
const application = { applicationCode: applicationScope.code, applicationResolution: applicationResolutionOf(applicationScope) };
|
|
@@ -3591,10 +3769,12 @@ export function registerRuntimeDataLane(tools) {
|
|
|
3591
3769
|
const workflowNameNote = nameOverwrittenNoteOf(rawSaveData.name, workflowReadbackRecord?.name);
|
|
3592
3770
|
// F4(w53):本次 formData 真带子表数组时才读子表字段元数据;无数组/读不到
|
|
3593
3771
|
// 元数据 → 零提示(读失败不阻断写)。
|
|
3594
|
-
const
|
|
3772
|
+
const mappingHits = await childTableMappingHits(session, formData, prepared.childCodes);
|
|
3773
|
+
const mappingRuntimeNote = mappingRuntimeNoteFor(mappingHits);
|
|
3774
|
+
const mappingSnapshotGap = mappingSnapshotGapFor(mappingHits);
|
|
3595
3775
|
return {
|
|
3596
3776
|
performed: { errcode: performed.errcode, ...application, bizObjectId: returnedId, workflowInstanceId, workItemId, workItemSource, sheetCode, resolvedFrom, formType: "save-draft-workflow" },
|
|
3597
|
-
readback: { ...application, ...writeDiagnostics, ...(mappingRuntimeNote !== undefined ? { mappingRuntimeNote } : {}), ...(workflowNameNote !== undefined ? { nameOverwrittenNote: workflowNameNote } : {}), authoritative: projectReadbackRecord(workflowReadbackRecord, args), sequenceStatus, expectedSequenceStatus: "DRAFT" },
|
|
3777
|
+
readback: { ...application, ...writeDiagnostics, ...(mappingRuntimeNote !== undefined ? { mappingRuntimeNote } : {}), ...(mappingSnapshotGap !== undefined ? { mappingSnapshotGap } : {}), ...(workflowNameNote !== undefined ? { nameOverwrittenNote: workflowNameNote } : {}), authoritative: projectReadbackRecord(workflowReadbackRecord, args), sequenceStatus, expectedSequenceStatus: "DRAFT" },
|
|
3598
3778
|
};
|
|
3599
3779
|
}
|
|
3600
3780
|
// 券商 issue 1.3(cpdocs 2026-10-27):带 formData.id 的 save 是更新语义;
|
|
@@ -3692,11 +3872,14 @@ export function registerRuntimeDataLane(tools) {
|
|
|
3692
3872
|
: undefined;
|
|
3693
3873
|
// F4(w53):仅在本次 formData 含子表数组时读该子表字段元数据;没有数组 /
|
|
3694
3874
|
// 读不到元数据 → 零提示、零额外 wire(读失败不阻断写)。
|
|
3695
|
-
const
|
|
3875
|
+
const mappingHits = await childTableMappingHits(session, formData, prepared.childCodes);
|
|
3876
|
+
const mappingRuntimeNote = mappingRuntimeNoteFor(mappingHits);
|
|
3877
|
+
const mappingSnapshotGap = mappingSnapshotGapFor(mappingHits);
|
|
3696
3878
|
const plainReadback = {
|
|
3697
3879
|
...application,
|
|
3698
3880
|
...writeDiagnostics,
|
|
3699
3881
|
...(mappingRuntimeNote !== undefined ? { mappingRuntimeNote } : {}),
|
|
3882
|
+
...(mappingSnapshotGap !== undefined ? { mappingSnapshotGap } : {}),
|
|
3700
3883
|
...(nameOverwrittenNote !== undefined ? { nameOverwrittenNote } : {}),
|
|
3701
3884
|
authoritative: projectReadbackRecord(savedRecord, args),
|
|
3702
3885
|
...(savedEmptyFields.length > 0 ? { readbackWarning: readbackWarningFor(savedEmptyFields, "data.save") } : {}),
|
|
@@ -4259,7 +4442,7 @@ export function registerRuntimeDataLane(tools) {
|
|
|
4259
4442
|
workflowInstanceId: z.string().optional(),
|
|
4260
4443
|
workItemId: z.string().optional(),
|
|
4261
4444
|
bizObjectId: z.string().optional().describe("existing record id; REQUIRED for workItem approval submits (formType=1 + workItemId) — the submit's bizObject must reference the in-flight record or the engine NPEs (DataChangeHandlerImpl.changeBizObject)"),
|
|
4262
|
-
agree: z.boolean().optional(),
|
|
4445
|
+
agree: z.boolean().optional().describe("顶层参数:true=通过 / false=驳回,缺省 true;approval.agree 本工具写前即拒(submit-approval-agree-misplaced),平台侧才静默忽略(按通过)。"),
|
|
4263
4446
|
allowChildRowAppend: z.boolean().optional().describe("默认 false:审批提交(带 workItemId/workflowInstanceId)时 formData 含子表数组会被拒——平台按追加插行,每次提交重复一份。确实要追加子行时才置 true。"),
|
|
4264
4447
|
allowStaffOnSubmit: z.boolean().optional().describe("默认 false:提交携带人员字段会被拒(issue#10:两种形状都可能 50000;可靠链路=save 落库后提交省略人员字段)。个别平台构建接受提交面携带时置 true 自担。"),
|
|
4265
4448
|
approval: z.record(z.string(), z.unknown()).optional(),
|
|
@@ -4367,6 +4550,17 @@ export function registerRuntimeDataLane(tools) {
|
|
|
4367
4550
|
assignChildSortKeys: targetObjectId === null,
|
|
4368
4551
|
});
|
|
4369
4552
|
const formData = stampedSubmit.formData;
|
|
4553
|
+
// F4(w153):提交面同样点名「映射配置了但快照为空」的行/字段。
|
|
4554
|
+
// 成本说明(复核纠正):`data.save` 复用 prepareRuntimeFormData 已读的子表
|
|
4555
|
+
// 元数据读取(零额外 wire);standalone `data.submit` **新增一次**子表字段面
|
|
4556
|
+
// 读取——`prepareRuntimeFormData` 只读父模型 schemaCode 的已发布字段,父模型
|
|
4557
|
+
// 字段面不含子列(`options.mappings` 在子表 schema 上)。读失败静默跳过。
|
|
4558
|
+
// 边界:`data.submit {bizObjectId}` 省略 formData 的既有草稿直提,检查发生在
|
|
4559
|
+
// 「formData 与读回行合并」之前,故不会报 mappingSnapshotGap(已知残留,
|
|
4560
|
+
// 见 docs/known-residuals.md)。
|
|
4561
|
+
const submitMappingHits = await childTableMappingHits(session, formData, stampedSubmit.childCodes);
|
|
4562
|
+
const submitMappingRuntimeNote = mappingRuntimeNoteFor(submitMappingHits);
|
|
4563
|
+
const submitMappingSnapshotGap = mappingSnapshotGapFor(submitMappingHits);
|
|
4370
4564
|
// r5-asset 2026-10-20: the platform APPENDS child rows carried in an
|
|
4371
4565
|
// approval submit's formData (no upsert by row id, no error). Live: an
|
|
4372
4566
|
// approval that echoed the whole form twice turned 2 detail rows into 6
|
|
@@ -4730,7 +4924,11 @@ export function registerRuntimeDataLane(tools) {
|
|
|
4730
4924
|
}
|
|
4731
4925
|
}
|
|
4732
4926
|
const performedData = (performed.data ?? {});
|
|
4733
|
-
let readback = {
|
|
4927
|
+
let readback = {
|
|
4928
|
+
formType,
|
|
4929
|
+
...(submitMappingRuntimeNote !== undefined ? { mappingRuntimeNote: submitMappingRuntimeNote } : {}),
|
|
4930
|
+
...(submitMappingSnapshotGap !== undefined ? { mappingSnapshotGap: submitMappingSnapshotGap } : {}),
|
|
4931
|
+
};
|
|
4734
4932
|
if (formType === "2") {
|
|
4735
4933
|
const objectId = typeof performedData.objectId === "string" ? performedData.objectId : null;
|
|
4736
4934
|
if (!objectId) {
|
|
@@ -4739,7 +4937,13 @@ export function registerRuntimeDataLane(tools) {
|
|
|
4739
4937
|
// it with a fabricated sequenceStatus:COMPLETED.
|
|
4740
4938
|
return {
|
|
4741
4939
|
performed: { errcode: performed.errcode, sheetCode, resolvedFrom, formType, draftObjectId },
|
|
4742
|
-
readback: {
|
|
4940
|
+
readback: {
|
|
4941
|
+
formType,
|
|
4942
|
+
sequenceStatus: null,
|
|
4943
|
+
missingObjectId: true,
|
|
4944
|
+
...(submitMappingRuntimeNote !== undefined ? { mappingRuntimeNote: submitMappingRuntimeNote } : {}),
|
|
4945
|
+
...(submitMappingSnapshotGap !== undefined ? { mappingSnapshotGap: submitMappingSnapshotGap } : {}),
|
|
4946
|
+
},
|
|
4743
4947
|
};
|
|
4744
4948
|
}
|
|
4745
4949
|
if (targetObjectId && objectId !== targetObjectId) {
|
|
@@ -4837,6 +5041,13 @@ export function registerRuntimeDataLane(tools) {
|
|
|
4837
5041
|
// Pure-instance submits (workflowInstanceId without workItemId) go
|
|
4838
5042
|
// through the same engine path and deserve the same delta (item 11).
|
|
4839
5043
|
const approvalDelta = (hasWorkItem || hasInstance) && args.summary !== true && args.full !== true && !(Array.isArray(args.fields) && args.fields.length > 0);
|
|
5044
|
+
// F5(探针 L):起始节点提交 ≠ 审批通过。判据与回执文案同源:提交前实例/行
|
|
5045
|
+
// 仍是 DRAFT → 本次消费的是起始待办(DRAFT→PROCESSING 只在起始提交时发生,
|
|
5046
|
+
// SubmitDataChangeHandlerImpl.updateWorkflowInstance:126-131)。驳回至发起人
|
|
5047
|
+
// 重激活的 token 是 PROCESSING,所以按提交前状态判、不按节点类型判(平台
|
|
5048
|
+
// ApprovalActionStatus.java:15/17 的 SUBMIT/AGREE 只是审批日志文案,两面不一致)。
|
|
5049
|
+
const startNodeSubmit = hasWorkItem && (retriedWithWorkItemId !== null || preSubmitStatus === "DRAFT");
|
|
5050
|
+
const rejected = hasWorkItem && args.agree === false;
|
|
4840
5051
|
readback = {
|
|
4841
5052
|
...readback,
|
|
4842
5053
|
workflowInstanceId: effectiveInstanceId,
|
|
@@ -4874,7 +5085,12 @@ export function registerRuntimeDataLane(tools) {
|
|
|
4874
5085
|
};
|
|
4875
5086
|
})(),
|
|
4876
5087
|
...(approvalDelta
|
|
4877
|
-
? {
|
|
5088
|
+
? {
|
|
5089
|
+
readbackShape: "approval-delta",
|
|
5090
|
+
readbackHint: startNodeSubmit
|
|
5091
|
+
? "发起提交(草稿→PROCESSING):默认只回 sequenceStatus + 本次提交的字段;要整条记录(含子表/系统字段)加 full:true,要指定字段加 fields:[...]"
|
|
5092
|
+
: "审批提交默认只回 sequenceStatus + 本次提交的字段;要整条记录(含子表/系统字段)加 full:true,要指定字段加 fields:[...]",
|
|
5093
|
+
}
|
|
4878
5094
|
: {}),
|
|
4879
5095
|
...(serialGenerationFailed.length > 0
|
|
4880
5096
|
? { serialGenerationFailed, serialGenerationWarning: SERIAL_GENERATION_FAILURE_NOTE }
|
|
@@ -4887,9 +5103,10 @@ export function registerRuntimeDataLane(tools) {
|
|
|
4887
5103
|
// this instance while the flow is still in flight (best-effort: a lookup
|
|
4888
5104
|
// failure must never fail the submit).
|
|
4889
5105
|
// r29c F12: 驳回/通过要能从回执区分——agree:false → decision:REJECT。
|
|
4890
|
-
|
|
5106
|
+
// F5(探针 L):起始节点提交(提交前 DRAFT)→ decision:SUBMIT;审批节点才
|
|
5107
|
+
// APPROVE/REJECT。判据见上方 startNodeSubmit(按提交前状态,不按节点类型)。
|
|
4891
5108
|
if (hasWorkItem)
|
|
4892
|
-
readback.decision = rejected ? "REJECT" : "APPROVE";
|
|
5109
|
+
readback.decision = rejected ? "REJECT" : startNodeSubmit ? "SUBMIT" : "APPROVE";
|
|
4893
5110
|
if (hasWorkflow && effectiveInstanceId && sequenceStatus !== "COMPLETED") {
|
|
4894
5111
|
try {
|
|
4895
5112
|
const pending = await searchWorkItems(session, { instanceId: effectiveInstanceId });
|
|
@@ -5117,7 +5334,9 @@ export function registerRuntimeDataLane(tools) {
|
|
|
5117
5334
|
// for the portal button, but for an API caller "I forgot the flag" and
|
|
5118
5335
|
// "I approve" must not look identical in the receipt.
|
|
5119
5336
|
// r29c F10: 只在审批提交(有 workItemId)时给 approvalNote;发起提交用 startNote。
|
|
5120
|
-
|
|
5337
|
+
// F5(探针 L):起始节点提交(decision=SUBMIT)也不是审批——别再对它说
|
|
5338
|
+
// 「本次是审批提交」。
|
|
5339
|
+
...(hasWorkItem && readback.decision !== "SUBMIT" && args.agree === undefined
|
|
5121
5340
|
? {
|
|
5122
5341
|
approvalNote: "本次是审批提交但未传 agree——平台按**通过**处理(顶层 agree 缺省 true)。要驳回必须显式 agree:false;approval.agree 不生效。",
|
|
5123
5342
|
}
|
package/dist/model-purge.js
CHANGED
|
@@ -379,15 +379,35 @@ export async function cmdModelPurge(args, injected) {
|
|
|
379
379
|
const referenced = plan.inboundReferences !== undefined && plan.inboundReferences.length > 0;
|
|
380
380
|
const unbindEnabled = plan.unbindReferences === true;
|
|
381
381
|
const blocked = plan.blockers.length > 0;
|
|
382
|
+
// F6(0.8.17,探针 K):只有跨模型引用才是 blocker。自引用(本模型自己的
|
|
383
|
+
// 子表关联列指回自身)从 0.8.16 起由 --apply 自动拆,dry-run 却仍回
|
|
384
|
+
// blocker:"model-referenced-by"——调用方会把它读成「必须先 --unbind-references,
|
|
385
|
+
// 否则跑不动」,与 apply 的实际行为相反。自引用改为 warning(带 step 清单),
|
|
386
|
+
// 顶层 blocker 只在真有跨模型引用(需要用户决策删别人模型的列)时出现。
|
|
387
|
+
const crossModelReferenced = (plan.crossModelUnbindSteps?.length ?? 0) > 0;
|
|
388
|
+
const selfReferenced = !crossModelReferenced && (plan.selfUnbindSteps?.length ?? 0) > 0;
|
|
382
389
|
writeEnvelope(envelope("ok", {
|
|
383
390
|
// F4(0.8.12,探针 G):入站引用是「删模型必然要拆的内部列」,是计划里的
|
|
384
391
|
// 一步,不是执行失败——dry-run 只有真 blocker(活流程实例)才 blocked。
|
|
385
|
-
// 未带 --unbind-references
|
|
386
|
-
// model.delete dry-run 同名同义),并给出预置的 unbindSteps /
|
|
392
|
+
// 未带 --unbind-references 时,跨模型引用保留 blocker:"model-referenced-by"
|
|
393
|
+
// (与 model.delete dry-run 同名同义),并给出预置的 unbindSteps /
|
|
387
394
|
// wouldRequireFlags,让调用方无需先加破坏性开关就能看完整计划。
|
|
388
395
|
status: blocked ? "blocked" : "dry-run",
|
|
389
396
|
...plan,
|
|
390
|
-
...(referenced && !unbindEnabled ? { blocker: "model-referenced-by" } : {}),
|
|
397
|
+
...(referenced && !unbindEnabled && crossModelReferenced ? { blocker: "model-referenced-by" } : {}),
|
|
398
|
+
...(referenced && !unbindEnabled && selfReferenced
|
|
399
|
+
? {
|
|
400
|
+
warnings: [
|
|
401
|
+
{
|
|
402
|
+
code: "self-reference-auto-unbind",
|
|
403
|
+
autoUnbindSteps: plan.selfUnbindSteps,
|
|
404
|
+
message: `${plan.schemaCode} 只有自引用(本模型子表关联列指回自身):` +
|
|
405
|
+
`--apply 会自动拆(${(plan.selfUnbindSteps ?? []).join(" → ")}),无需 --unbind-references;跨模型引用:无。` +
|
|
406
|
+
`破坏性:被删列数据不可恢复。`,
|
|
407
|
+
},
|
|
408
|
+
],
|
|
409
|
+
}
|
|
410
|
+
: {}),
|
|
391
411
|
...(blocked
|
|
392
412
|
? {}
|
|
393
413
|
: {
|
package/dist/model-scaffold.js
CHANGED
|
@@ -84,7 +84,7 @@ export async function cmdModelScaffold(args) {
|
|
|
84
84
|
" 默认 dry-run(列出将要做什么);--apply 依次执行 建模型→建字段→建子列→发布字段→发布表单。",
|
|
85
85
|
" 幂等:模型/字段已存在记为 skipped 继续;有真失败时默认不发布(--force-publish 可强发)。",
|
|
86
86
|
" 每个子调用使用独立 requestId(避免同 id 不同参数被幂等门拒绝);重入已存在字段记 skipped。",
|
|
87
|
-
" --fields-file 从配置根内文件读 JSON
|
|
87
|
+
" --fields-file 从配置根内文件读 JSON 数组(根 = $OMC_CONFIG_HOME 或当前工作目录,根外拒绝;免落盘用 --fields - 读 stdin);--fields - 从 stdin 读 JSON 数组。",
|
|
88
88
|
].join("\n");
|
|
89
89
|
const invalid = (message) => {
|
|
90
90
|
writeEnvelope(envelope("error", {}, request, { code: "invalid-input", message: `${message}\n${usage}`, retryable: false }));
|
|
@@ -402,15 +402,23 @@ export async function cmdModelScaffold(args) {
|
|
|
402
402
|
}
|
|
403
403
|
function describeScaffoldPlan(options) {
|
|
404
404
|
const childTables = options.fields.filter((field) => scaffoldChildrenOf(field).length > 0);
|
|
405
|
+
const declaredFieldCount = options.fields.length;
|
|
406
|
+
const childColumnCount = options.fields.reduce((sum, field) => sum + scaffoldChildrenOf(field).length, 0);
|
|
407
|
+
// F11(0.8.17,探针 K):dry-run 与 --apply 必须同键同值。旧 dry-run 只给
|
|
408
|
+
// `fields`(顶层数)和一个错的 `childFieldCount`(子表数 + 子列数 = 6,而真实
|
|
409
|
+
// 子列是 5),apply 却给 declaredFieldCount/childColumnCount/fieldCount——同一
|
|
410
|
+
// 份计划两套计数,探针对不上。现在统用 apply 的键名与算法。
|
|
405
411
|
return {
|
|
406
412
|
model: options.code,
|
|
407
413
|
name: options.name,
|
|
408
|
-
|
|
414
|
+
declaredFieldCount,
|
|
415
|
+
childColumnCount,
|
|
416
|
+
fieldCount: declaredFieldCount + childColumnCount,
|
|
409
417
|
childTables: childTables.map((field) => ({
|
|
410
418
|
code: field.code,
|
|
411
419
|
childFields: scaffoldChildrenOf(field).map((entry) => entry.code),
|
|
412
420
|
})),
|
|
413
|
-
|
|
421
|
+
countsNote: "dry-run 与 --apply 同键同义:declaredFieldCount = --fields 声明的顶层字段数;childColumnCount = 子列总数(子表自身不计数);fieldCount = 最终业务字段总数(declaredFieldCount + childColumnCount)。",
|
|
414
422
|
publishForm: options.publishForm,
|
|
415
423
|
steps: [
|
|
416
424
|
`model.create ${options.code}`,
|