@stalfh233/omc-cli 0.8.7 → 0.8.9
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/approval-flow.js +25 -5
- package/dist/call.js +17 -1
- package/dist/cli.js +7 -5
- package/dist/data-list-filter.js +22 -4
- package/dist/form-support.js +46 -6
- package/dist/goal-routes.js +95 -9
- package/dist/human-summary.js +37 -6
- package/dist/lanes/field-contract.js +2 -2
- package/dist/lanes/field.js +40 -2
- package/dist/lanes/list-view-shapes.js +22 -0
- package/dist/lanes/list-view.js +134 -4
- package/dist/lanes/runtime-data-contract.js +3 -3
- package/dist/lanes/runtime-data.js +277 -17
- package/dist/lanes/workflow.js +185 -42
- package/dist/model-purge.js +231 -24
- package/dist/model-scaffold.js +52 -10
- package/dist/recipes/field.js +56 -7
- package/dist/recipes/list-view.js +1 -1
- package/dist/reserved.js +48 -0
- package/dist/search-index.js +2 -0
- package/package.json +3 -3
- package/skills/omc-playbook.md +2 -2
- package/skills/omc-requirement-vocabulary.md +13 -0
package/dist/lanes/field.js
CHANGED
|
@@ -349,6 +349,37 @@ function fieldRollbackSpec(toolName) {
|
|
|
349
349
|
function parseFieldOptionsForReadback(options) {
|
|
350
350
|
return decodeJsonColumn(options, JSON_COLUMN_PASSTHROUGH);
|
|
351
351
|
}
|
|
352
|
+
/**
|
|
353
|
+
* 探针 D F9(0.8.9):字段行 `options.mappings` 存在 = 关联填充配置。
|
|
354
|
+
* 平台存储形态是 options.mappings 的 **JSON 字符串**(`WorkSheetPropertyMapping[]`,
|
|
355
|
+
* 见 test/field-relation-mapping-sources.test.ts 的证据表),但 API 写面也可能
|
|
356
|
+
* 直接回数组——两种都认。
|
|
357
|
+
*/
|
|
358
|
+
function hasRelationMappings(options) {
|
|
359
|
+
if (options === null || typeof options !== "object")
|
|
360
|
+
return false;
|
|
361
|
+
const raw = options.mappings;
|
|
362
|
+
if (Array.isArray(raw))
|
|
363
|
+
return raw.length > 0;
|
|
364
|
+
if (typeof raw !== "string")
|
|
365
|
+
return false;
|
|
366
|
+
try {
|
|
367
|
+
const parsed = JSON.parse(raw);
|
|
368
|
+
return Array.isArray(parsed) && parsed.length > 0;
|
|
369
|
+
}
|
|
370
|
+
catch {
|
|
371
|
+
return false;
|
|
372
|
+
}
|
|
373
|
+
}
|
|
374
|
+
/**
|
|
375
|
+
* 字段配置面的映射运行期说明(探针 D F9):映射配置正确 ≠ REST 写会回填。
|
|
376
|
+
* 后端证据:CLI `data.save` 打 `/api/runtime/form/save`
|
|
377
|
+
* (FormRuntimeController.java:806-832 → saveBizSheet:932-977 → saveBizObject),
|
|
378
|
+
* 该控制器全文没有 mappingList;`BizFormMappingFacadeImpl.mappingList`
|
|
379
|
+
* 只挂在 OpenAPI v2/v3 写面(BaseController.java:985-1001)与门户表单链。
|
|
380
|
+
* 因此「配置对不对」看 options.mappings,「值会不会回填」看写入面走哪条路。
|
|
381
|
+
*/
|
|
382
|
+
const FIELD_MAPPING_RUNTIME_NOTE = "映射只在门户选值时回填:CLI data.save(/api/runtime/form/save)不跑 options.mappings,快照列需调用方自填;配置正确性以字段行 options.mappings 为准。";
|
|
352
383
|
/**
|
|
353
384
|
* `name_i18n` is a JSON locale map. When every locale value equals the display
|
|
354
385
|
* `name` there is no translation to convey, so echoing the map on every field of
|
|
@@ -571,7 +602,7 @@ export function registerFieldLane(tools) {
|
|
|
571
602
|
lane: FIELD_LANE,
|
|
572
603
|
scope: FIELD_TOOLS["field.list"].scope,
|
|
573
604
|
description: FIELD_TOOLS["field.list"].description,
|
|
574
|
-
inputSchema: { environment: environmentArg, schemaCode: z.string(), published: z.boolean().default(false), code: z.string().optional(), fields: z.array(z.string()).optional(), full: z.boolean().optional().describe("行内联完整 options/subSchema
|
|
605
|
+
inputSchema: { environment: environmentArg, schemaCode: z.string(), published: z.boolean().default(false), code: z.string().optional(), fields: z.array(z.string()).optional(), full: z.boolean().optional().describe("行内联完整 options/subSchema(含子表原始 subSchema);默认面只有 code/name/type(+conditions/shapeWarning),验证 options 用 code/fields 或 full:true;propertyEmpty 平台带回才输出(不回省略,不塞 false)"), all: z.boolean().optional().describe("默认只返业务字段(滤掉 13 个系统字段:id/name/sequenceNo/createdTime/…);true 连系统字段一起返"), capability: capabilityArg },
|
|
575
606
|
handler: async (ctx, args, self) => governedRead(ctx, self, args, async (session) => {
|
|
576
607
|
const rows = wireRows((await wireCall(session, { path: ENDPOINTS.fieldList, query: { schemaCode: args.schemaCode, isPublish: args.published ? "true" : "false" } })).data);
|
|
577
608
|
// r61 a-F9(r60a-F9):draft 面此前不报字段的发布态,行级缺 published 键
|
|
@@ -649,6 +680,11 @@ export function registerFieldLane(tools) {
|
|
|
649
680
|
// restores the previous full list (uses the SAME SYSTEM_FIELD_CODES set the
|
|
650
681
|
// list-view/form scaffolds already filter with).
|
|
651
682
|
const visible = args.all === true ? selected : selected.filter((field) => !isSystemFieldCode(field.code));
|
|
683
|
+
// 探针 D F9:只有真的把 options 送到调用方时(code/fields 选择器或 full)才附带
|
|
684
|
+
// 映射运行期说明——默认清单面不内联 options,在那里提映射是噪音。
|
|
685
|
+
const mappingRuntimeNote = detailed && visible.some((field) => hasRelationMappings(field.options))
|
|
686
|
+
? FIELD_MAPPING_RUNTIME_NOTE
|
|
687
|
+
: undefined;
|
|
652
688
|
const projected = detailed
|
|
653
689
|
? visible
|
|
654
690
|
: visible.map((field) => {
|
|
@@ -707,6 +743,7 @@ export function registerFieldLane(tools) {
|
|
|
707
743
|
}),
|
|
708
744
|
...(selector.length > 0 ? { selected: selector } : {}),
|
|
709
745
|
...(args.all !== true ? { businessOnly: true } : {}),
|
|
746
|
+
...(mappingRuntimeNote !== undefined ? { mappingRuntimeNote } : {}),
|
|
710
747
|
fields: projected,
|
|
711
748
|
// 券商 issue 1.4(2026-10-27):默认面空清单曾被误读成「模型没有字段」。
|
|
712
749
|
// 空清单要自己解释三种可能,别让 agent 二次试错;发布面(published:true)
|
|
@@ -796,12 +833,13 @@ export function registerFieldLane(tools) {
|
|
|
796
833
|
...fieldListTool,
|
|
797
834
|
name: "field.get",
|
|
798
835
|
search: { intents: ["读一个字段", "单个字段", "字段详情", "这个字段配置", "字段 options", "查字段详情"] },
|
|
799
|
-
description: "
|
|
836
|
+
description: "单字段读(= field.list + code)。options/subSchema 传 full:true。",
|
|
800
837
|
inputSchema: {
|
|
801
838
|
environment: environmentArg,
|
|
802
839
|
schemaCode: z.string(),
|
|
803
840
|
code: z.string(),
|
|
804
841
|
published: z.boolean().default(false),
|
|
842
|
+
full: z.boolean().optional().describe("同 field.list.full:完整 options/subSchema(含子表原始 subSchema)"),
|
|
805
843
|
capability: capabilityArg,
|
|
806
844
|
},
|
|
807
845
|
});
|
|
@@ -1024,6 +1024,28 @@ export const PLATFORM_DEFAULT_LIST_ACTIONS = Object.freeze([
|
|
|
1024
1024
|
{ actionCode: "import_attachment", queryActionType: "IMPORT_ATTACHMENT" },
|
|
1025
1025
|
{ actionCode: "export_attachment", queryActionType: "EXPORT_ATTACHMENT" },
|
|
1026
1026
|
]);
|
|
1027
|
+
/**
|
|
1028
|
+
* Actions the platform INJECTS on the query/get READ face (not stored). Evidence:
|
|
1029
|
+
* 8.6.26 `BizQueryController.dealHistoryDataOfButton` — called from the
|
|
1030
|
+
* query/get path at :385; qr_code :488, batch_print :500, batch_update :514,
|
|
1031
|
+
* import_attachment :547, export_attachment :555, batch_submit :567
|
|
1032
|
+
* (`decompiled-engine/.../web/api/controller/app/BizQueryController.java`; the
|
|
1033
|
+
* launcher-8.6.26 copy is :452/:543/:555/:568/:601/:609/:621).
|
|
1034
|
+
*
|
|
1035
|
+
* Consequence (F14, 0.8.9 probe D): `listview.configure {actions:[],replaceActions:true}`
|
|
1036
|
+
* removes the STORED/flow/custom actions (add/delete/import/…) but the read face
|
|
1037
|
+
* still lists these six, so a receipt that only echoes `actions` looks like the
|
|
1038
|
+
* replace did nothing. Readback therefore reports them separately as
|
|
1039
|
+
* `platformDefaultActions`, never as proof that the caller's list survived.
|
|
1040
|
+
*/
|
|
1041
|
+
export const PLATFORM_INJECTED_READ_ACTIONS = Object.freeze([
|
|
1042
|
+
"qr_code",
|
|
1043
|
+
"batch_print",
|
|
1044
|
+
"batch_update",
|
|
1045
|
+
"import_attachment",
|
|
1046
|
+
"export_attachment",
|
|
1047
|
+
"batch_submit",
|
|
1048
|
+
]);
|
|
1027
1049
|
/**
|
|
1028
1050
|
* Merge caller actions into a base set by actionCode (existing rows keep their
|
|
1029
1051
|
* platform fields, caller fields win) and append the rest. Live 2026-09-17:
|
package/dist/lanes/list-view.js
CHANGED
|
@@ -11,7 +11,7 @@ import { QUERY_ACTION_TYPE } from "omc-core/list-view-wire";
|
|
|
11
11
|
import { resolveModelTreeNode } from "./model.js";
|
|
12
12
|
import { NUMERICAL_FORMAT_DECIMALS, SYSTEM_FIELD_CODES, canonicalNumericalFormat } from "../field-families.js";
|
|
13
13
|
import { LIST_VIEW_LANE_CONTRACT } from "./list-view-contract.js";
|
|
14
|
-
import { assertListViewConfigureShape, decodeActionRow, decodeButtonRow, decodeConditionRow, decodeGantt, decodePresentation, decodeSortRow, diffTreeConditionKeys, LISTVIEW_TREE_CONDITION_KEYS, listViewActionArg, listViewButtonArg, listViewConditionArg, listViewGanttArg, listViewMultiTableHeaderArg, listViewOptionsArg, listViewPresentationArg, listViewQueryLayerArg, listViewSortArg, mergeActions, PLATFORM_DEFAULT_LIST_ACTIONS, normalizeActions, normalizeButtons, normalizeConditions, normalizeGantt, normalizePresentation, normalizeSorts, parseConditionOptions, presentationTypeArg, queryLayerSummary, readArray, resolveFieldRef, treeConditionKeysPresent, treeConditionValueEqual, buttonsRenderCompat, columnsRenderCompat, } from "./list-view-shapes.js";
|
|
14
|
+
import { assertListViewConfigureShape, decodeActionRow, decodeButtonRow, decodeConditionRow, decodeGantt, decodePresentation, decodeSortRow, diffTreeConditionKeys, LISTVIEW_TREE_CONDITION_KEYS, listViewActionArg, listViewButtonArg, listViewConditionArg, listViewGanttArg, listViewMultiTableHeaderArg, listViewOptionsArg, listViewPresentationArg, listViewQueryLayerArg, listViewSortArg, mergeActions, PLATFORM_DEFAULT_LIST_ACTIONS, PLATFORM_INJECTED_READ_ACTIONS, normalizeActions, normalizeButtons, normalizeConditions, normalizeGantt, normalizePresentation, normalizeSorts, parseConditionOptions, presentationTypeArg, queryLayerSummary, readArray, resolveFieldRef, treeConditionKeysPresent, treeConditionValueEqual, buttonsRenderCompat, columnsRenderCompat, } from "./list-view-shapes.js";
|
|
15
15
|
// Ticket 53: every shape (enum/zod/encode/decode/lint) lives once in
|
|
16
16
|
// ./list-view-shapes.ts and is re-exported for existing import paths.
|
|
17
17
|
export { assertListViewConfigureShape } from "./list-view-shapes.js";
|
|
@@ -409,21 +409,88 @@ export function decodeButtonScript(input) {
|
|
|
409
409
|
* 306103(删除后将无可用视图)。平台要求**每个模型至少保留一个 PC 可见视图和
|
|
410
410
|
* 一个 MOBILE 可见视图**;该码只在 2.1.5 出现(`ErrorCode.java:383`),8.6.26
|
|
411
411
|
* 无 306103。导出以便回执文案被测试钉住(PC/MOBILE 各一条 + 正确出路)。
|
|
412
|
+
*
|
|
413
|
+
* `detail.localPrecheck:true` 表示本判定来自**写前本地预检**(零 wire 写入):
|
|
414
|
+
* 平台判据由两族源码合并而来 —— 2.1.5 BizQueryController.delete:215-227
|
|
415
|
+
* (扣掉目标后剩余视图里必须仍有 showOnPc=true 与 showOnMobile=true 各一条,
|
|
416
|
+
* null/false 都算不可见);8.6.26 同方法 :297-311 只禁删**第一行**视图
|
|
417
|
+
* (BIZ_QUERY_DEFAULT 303025)。两者取并集,宁拒绝不误删。
|
|
412
418
|
*/
|
|
413
|
-
export function listviewLastVisibleRefusal(schemaCode, code) {
|
|
419
|
+
export function listviewLastVisibleRefusal(schemaCode, code, detail) {
|
|
420
|
+
const local = detail?.localPrecheck === true;
|
|
421
|
+
const reasons = detail?.reasons ?? [];
|
|
422
|
+
const platformRule = reasons.includes("default-view")
|
|
423
|
+
? "8.6.26 BizQueryController.delete:297-311(bizList.get(0) 不可删,BIZ_QUERY_DEFAULT 303025)"
|
|
424
|
+
: "2.1.5 BizQueryController.delete:215-227(扣掉目标后 PC/MOBILE 各需至少一条可见视图,BIZ_QUERY_DELETE_LACK_PC_MOBILE_VIEWS 306103)";
|
|
414
425
|
return new ToolRefusalError({
|
|
415
426
|
status: "refused",
|
|
416
427
|
blocker: "listview-last-visible",
|
|
417
428
|
schemaCode,
|
|
418
429
|
code,
|
|
430
|
+
...(local
|
|
431
|
+
? {
|
|
432
|
+
localPrecheck: true,
|
|
433
|
+
reasons,
|
|
434
|
+
platformRule,
|
|
435
|
+
...(detail?.firstViewCode !== undefined ? { firstViewCode: detail.firstViewCode } : {}),
|
|
436
|
+
...(detail?.remainingViewCodes !== undefined ? { remainingViewCodes: detail.remainingViewCodes } : {}),
|
|
437
|
+
}
|
|
438
|
+
: {}),
|
|
419
439
|
nextCommand: `omc model-purge --code ${schemaCode}`,
|
|
420
440
|
cleanupGuidance: `删视图在平台上不是独立清理步骤:要清视图就删模型(model-purge / model.delete 级联删除它的全部视图,含这条);` +
|
|
421
441
|
`listview.delete 只用于替换视图(先建/配好替代视图再删旧的),最后一条可见视图不可单删。`,
|
|
422
|
-
message:
|
|
442
|
+
message: (local && !reasons.includes("last-visible")
|
|
443
|
+
? `不能删除视图 ${code}:8.6.26 平台禁止删除默认(第一行)视图(BIZ_QUERY_DEFAULT 303025)。`
|
|
444
|
+
: `不能删除视图 ${code}:平台要求**至少保留一个 PC 可见视图和一个 MOBILE 可见视图**(PC + MOBILE 各一条,306103)。`) +
|
|
445
|
+
(local
|
|
446
|
+
? `本条是**写前本地预检**(零写入,未发 delete wire):${reasons.includes("default-view") ? "目标是默认(第一行)视图,8.6.26 直接禁删;" : ""}${reasons.includes("last-visible") ? "扣掉它之后 PC/MOBILE 的可见视图不足各一条。" : ""}`
|
|
447
|
+
: "") +
|
|
423
448
|
`单独删最后一条视图没有意义——删模型会级联删除它的所有视图。要继续用这个模型就**就地改**(listview.configure 省略 code 即改默认视图),` +
|
|
424
449
|
`要整体清理就用 model-purge(默认 dry-run,先看计划)。`,
|
|
425
450
|
});
|
|
426
451
|
}
|
|
452
|
+
/**
|
|
453
|
+
* Local mirror of the platform delete gate (F8 0.8.8). Returns null when the
|
|
454
|
+
* delete is NOT locally known to be blocked — including whenever the read face
|
|
455
|
+
* cannot prove visibility (list wire failed / visibility keys not projected) or
|
|
456
|
+
* the target is absent from the list. In those cases the caller must keep the
|
|
457
|
+
* existing behaviour and let the platform refuse (never a false local allow).
|
|
458
|
+
*/
|
|
459
|
+
export async function listviewDeleteLocalBlock(session, schemaCode, code) {
|
|
460
|
+
let rows;
|
|
461
|
+
try {
|
|
462
|
+
rows = wireRows((await wireCall(session, { path: ENDPOINTS.listQueryList, query: { schemaCode, clientType: "PC" } })).data);
|
|
463
|
+
}
|
|
464
|
+
catch {
|
|
465
|
+
return null;
|
|
466
|
+
}
|
|
467
|
+
if (rows.length === 0)
|
|
468
|
+
return null;
|
|
469
|
+
const index = rows.findIndex((row) => String(row.code ?? "") === code);
|
|
470
|
+
if (index < 0)
|
|
471
|
+
return null;
|
|
472
|
+
// Both flags must be projected by the read face. An ABSENT key is "unknown"
|
|
473
|
+
// (e.g. a proxy projection) — do not read it as false. A present null IS the
|
|
474
|
+
// platform's "not visible" (2.1.5 uses Boolean.TRUE.equals).
|
|
475
|
+
const known = (row, key) => key in row && (typeof row[key] === "boolean" || row[key] === null);
|
|
476
|
+
if (!rows.every((row) => known(row, "showOnPc") && known(row, "showOnMobile")))
|
|
477
|
+
return null;
|
|
478
|
+
const remaining = rows.filter((_, position) => position !== index);
|
|
479
|
+
const pcLeft = remaining.some((row) => row.showOnPc === true);
|
|
480
|
+
const mobileLeft = remaining.some((row) => row.showOnMobile === true);
|
|
481
|
+
const reasons = [];
|
|
482
|
+
if (index === 0)
|
|
483
|
+
reasons.push("default-view");
|
|
484
|
+
if (remaining.length === 0 || !pcLeft || !mobileLeft)
|
|
485
|
+
reasons.push("last-visible");
|
|
486
|
+
if (reasons.length === 0)
|
|
487
|
+
return null;
|
|
488
|
+
return {
|
|
489
|
+
reasons,
|
|
490
|
+
firstViewCode: String(rows[0]?.code ?? ""),
|
|
491
|
+
remainingViewCodes: remaining.map((row) => String(row.code ?? "")).filter(Boolean),
|
|
492
|
+
};
|
|
493
|
+
}
|
|
427
494
|
export function registerListViewLane(tools) {
|
|
428
495
|
tools.push(defineTool({
|
|
429
496
|
name: "listview.get",
|
|
@@ -1175,9 +1242,39 @@ export function registerListViewLane(tools) {
|
|
|
1175
1242
|
}
|
|
1176
1243
|
readback.columnsRenderCompat = columnsRenderCompat(readArray(afterModel, "queryColumns"));
|
|
1177
1244
|
if (args.actions !== undefined) {
|
|
1178
|
-
|
|
1245
|
+
const afterActions = readArray(afterModel, "queryActions")
|
|
1179
1246
|
.map(decodeActionRow)
|
|
1180
1247
|
.sort((a, b) => Number(a.sortKey ?? 0) - Number(b.sortKey ?? 0));
|
|
1248
|
+
readback.actions = afterActions;
|
|
1249
|
+
// F14(0.8.9 探针 D):actions:[] + replaceActions:true 之后 `actions` 仍
|
|
1250
|
+
// 列 6 条平台注入动作(BizQueryController.dealHistoryDataOfButton :482-575
|
|
1251
|
+
// 在 query/get 读面强制补齐 qr_code/batch_print/batch_update/
|
|
1252
|
+
// import_attachment/export_attachment/batch_submit),使用者会怀疑 replace
|
|
1253
|
+
// 没生效。区分三层:平台真值 actions 原样保留;本次被清掉的(旧有效集
|
|
1254
|
+
// 减去回读集)进 removedActionCodes;回读里由平台注入且不是调用方显式
|
|
1255
|
+
// 提交的 code 进 platformDefaultActions。只在权威全集替换时报告——
|
|
1256
|
+
// 默认 merge 本来就会保留既有动作,没有「是不是没生效」的疑问。
|
|
1257
|
+
if (args.replaceActions === true) {
|
|
1258
|
+
const afterCodes = new Set(afterActions.map((action) => String(action.actionCode ?? "")).filter(Boolean));
|
|
1259
|
+
const submittedCodes = new Set(args.actions.map((action) => String(action.actionCode ?? "")).filter(Boolean));
|
|
1260
|
+
const platformDefaultActions = afterActions
|
|
1261
|
+
.map((action) => String(action.actionCode ?? ""))
|
|
1262
|
+
.filter((code) => PLATFORM_INJECTED_READ_ACTIONS.includes(code) && !submittedCodes.has(code));
|
|
1263
|
+
const removedActionCodes = readArray(model, "queryActions")
|
|
1264
|
+
.map((action) => String(action.actionCode ?? ""))
|
|
1265
|
+
.filter((code) => code.length > 0 && !afterCodes.has(code) && !submittedCodes.has(code));
|
|
1266
|
+
if (removedActionCodes.length > 0)
|
|
1267
|
+
readback.removedActionCodes = [...new Set(removedActionCodes)];
|
|
1268
|
+
if (platformDefaultActions.length > 0)
|
|
1269
|
+
readback.platformDefaultActions = [...new Set(platformDefaultActions)];
|
|
1270
|
+
if (removedActionCodes.length > 0 || platformDefaultActions.length > 0) {
|
|
1271
|
+
readback.actionsNote =
|
|
1272
|
+
(removedActionCodes.length > 0 ? `本次移除 ${[...new Set(removedActionCodes)].join("、")};` : "") +
|
|
1273
|
+
(platformDefaultActions.length > 0
|
|
1274
|
+
? `流程/自定义动作已清空;剩余为平台默认动作(${[...new Set(platformDefaultActions)].join("、")},query/get 注入,不是 replaceActions 未生效)。`
|
|
1275
|
+
: "流程/自定义动作已清空;剩余为平台默认动作。");
|
|
1276
|
+
}
|
|
1277
|
+
}
|
|
1181
1278
|
}
|
|
1182
1279
|
if (afterModel.queryPresentation && typeof afterModel.queryPresentation === "object") {
|
|
1183
1280
|
readback.presentation = decodePresentation(afterModel.queryPresentation);
|
|
@@ -1299,10 +1396,43 @@ export function registerListViewLane(tools) {
|
|
|
1299
1396
|
scope: LIST_VIEW_TOOLS["listview.delete"].scope,
|
|
1300
1397
|
description: LIST_VIEW_TOOLS["listview.delete"].description,
|
|
1301
1398
|
inputSchema: { schemaCode: z.string().min(1), code: z.string().min(1) },
|
|
1399
|
+
// F8(0.8.8):写前本地预检——平台在删「最后一条可见视图 / 默认视图」时拒绝
|
|
1400
|
+
// (2.1.5 :215-227 / 8.6.26 :297-311),本工具先读视图清单就地拒绝,零写入。
|
|
1401
|
+
// dry-run 与真写共用这一个函数;读面不足时返回 null → 照旧走平台 wire 拒绝。
|
|
1402
|
+
writeLint: async (session, args) => {
|
|
1403
|
+
const blocked = await listviewDeleteLocalBlock(session, args.schemaCode, args.code);
|
|
1404
|
+
if (blocked !== null)
|
|
1405
|
+
throw listviewLastVisibleRefusal(args.schemaCode, args.code, {
|
|
1406
|
+
localPrecheck: true,
|
|
1407
|
+
reasons: blocked.reasons,
|
|
1408
|
+
firstViewCode: blocked.firstViewCode,
|
|
1409
|
+
remainingViewCodes: blocked.remainingViewCodes,
|
|
1410
|
+
});
|
|
1411
|
+
return {
|
|
1412
|
+
wouldChange: true,
|
|
1413
|
+
summary: `即将删除列表视图 ${args.schemaCode}/${args.code}`,
|
|
1414
|
+
visibilityPrecheck: {
|
|
1415
|
+
locallyBlocked: false,
|
|
1416
|
+
note: "本地未命中「最后一条可见视图/默认视图」判据;平台 306103/303025 仍是最终门(读面不足时不做本地判定)",
|
|
1417
|
+
},
|
|
1418
|
+
};
|
|
1419
|
+
},
|
|
1302
1420
|
execute: async (session, args) => {
|
|
1303
1421
|
const before = await wireCall(session, { path: ENDPOINTS.listQueryGetHeader, query: { schemaCode: args.schemaCode, code: args.code } });
|
|
1304
1422
|
if (before.data == null)
|
|
1305
1423
|
return { performed: { skipped: "already-absent" }, readback: { absent: true, header: null } };
|
|
1424
|
+
// Local precheck (zero write): the platform refuses the last visible view
|
|
1425
|
+
// (2.1.5) / the default first-row view (8.6.26) with 306103/303025. When
|
|
1426
|
+
// the read face cannot prove visibility this returns null and the delete
|
|
1427
|
+
// proceeds to the platform wire, preserving today's refusal path.
|
|
1428
|
+
const blocked = await listviewDeleteLocalBlock(session, args.schemaCode, args.code);
|
|
1429
|
+
if (blocked !== null)
|
|
1430
|
+
throw listviewLastVisibleRefusal(args.schemaCode, args.code, {
|
|
1431
|
+
localPrecheck: true,
|
|
1432
|
+
reasons: blocked.reasons,
|
|
1433
|
+
firstViewCode: blocked.firstViewCode,
|
|
1434
|
+
remainingViewCodes: blocked.remainingViewCodes,
|
|
1435
|
+
});
|
|
1306
1436
|
let performed;
|
|
1307
1437
|
try {
|
|
1308
1438
|
performed = await wireCall(session, { path: ENDPOINTS.listQueryDelete, method: "POST", query: { schemaCode: args.schemaCode, code: args.code } });
|
|
@@ -5,7 +5,7 @@ export { RUNTIME_DATA_WIRE, RUNTIME_QUERY_OPERATORS, ENGINE_OWNED_KEYS, SUBMIT_S
|
|
|
5
5
|
import { RUNTIME_DATA_WIRE } from "omc-core/wire-facts";
|
|
6
6
|
export function dataListDescription() {
|
|
7
7
|
const wire = RUNTIME_DATA_WIRE;
|
|
8
|
-
return `按简化过滤 DSL 查询业务对象(runtime/query/list);DSL 在 CLI 内翻译为平台 queryCondition(${wire.dslShape}),并按发布字段元数据为每个条件注入 propertyType(未知过滤字段将被拒绝,可用 rawCondition
|
|
8
|
+
return `按简化过滤 DSL 查询业务对象(runtime/query/list);DSL 在 CLI 内翻译为平台 queryCondition(${wire.dslShape}),并按发布字段元数据为每个条件注入 propertyType(未知过滤字段将被拒绝,可用 rawCondition 逃生;op 大小写不敏感);响应行在 items[],业务字段在 items[].fields.<code>(不是 rows[],也不是 item 顶层——--jq 常用 items[].fields.sku);空模型返回空列表;列表只投影视图列:**显式选列只能收窄、不能扩列**(视图外 code 进 columnsOutsideView,扩列用 data.load);**已判定未投影的列会从 items[].fields 省略键**(items[].unprojected 点名;不是数据丢失——data.load 有值;全 null 时 readback 追加 projectionHint,先 listview.configure 配置视图列或用 data.load 读单条)。键缺席=字段不存在或该行已判定未投影(见 items[].unprojected);键在且值 null=真空值(未投影或真空值不再同形;nullSemantics 说明口径)。`;
|
|
9
9
|
}
|
|
10
10
|
export function dataAggregateDescription() {
|
|
11
11
|
return `临时计数与数值聚合(纯读)。count:runtime/query/list size:1 读 totalElements(服务端精确、不受 cap 影响;带 filter +1 field.list)。sum/avg/min/max:field 必填且已发布 propertyType=2(NUMERICAL);无 GET_LIST 改源时优先 /sum ALL_DATA(coverage.mode=server-aggregate,全量精确),否则/失败/键不符回退本地折叠(strategyFallback;size:200 翻页至 cap 1000,null 不进聚合、avg=sum/非 null 行数,nonNullCount=0→value:null)。complete 看 rowsScanned>=total,否则 missingCount+capNotice,绝不外推。groupBy 单列:count 值域可枚举(options/字典)→值域×count(V+3 wire),分桶并发窗口 4(限流退化 2,见 wire.concurrency),桶序稳定;按 count 降序取 topN(默认 10/上限 20),截断给 truncatedBuckets/bucketsTruncatedCount,null 单列 nullBucket;不可枚举或数值指标→本地扫描(coverage.mode=paged-local-scan/local-scan),数值桶 {key,count,nonNullCount,value} 按 value 降序、并列按 key,null 行进 nullBucket。filter.draftPolicy:count+groupBy 默认 includeDrafts:false 注入 sequenceStatus≠DRAFT;数值指标不默认排除;count 省略=平台默认(无条件含草稿、带条件排草稿);显式 false 强制排除。边界:临时问句用本工具;持久图表/看板用 report.chartdata,视图汇总列用 sumType,写时计算用 datarule type2。子表计数/求和用 child(主表 schemaCode + childSchemaCode/bizObjectId)。`;
|
|
@@ -133,7 +133,7 @@ export const RUNTIME_DATA_LANE_CONTRACT = Object.freeze({
|
|
|
133
133
|
tools: Object.freeze({
|
|
134
134
|
"data.list": Object.freeze({ scope: "filtered list field projection", description: dataListDescription() }),
|
|
135
135
|
"data.aggregate": Object.freeze({ scope: "aggregate count and grouped distribution via query/list totals", description: dataAggregateDescription() }),
|
|
136
|
-
"data.load": Object.freeze({ scope: "authoritative readback form load", description: "M2 authoritative readback: form/load one business object by id. **返回形状:业务字段值在 `result.data`(非 readback.authoritative);大结果 stdout 只回 detailArtifactId + fetch 提示,用 `omc artifact get <id>` 取回;`fields:[...]` 可投影只取所需键**。" }),
|
|
136
|
+
"data.load": Object.freeze({ scope: "authoritative readback form load", description: "M2 authoritative readback: form/load one business object by id. **返回形状:业务字段值在 `result.data`(非 readback.authoritative);大结果 stdout 只回 detailArtifactId + fetch 提示,用 `omc artifact get <id>` 取回;`fields:[...]` 可投影只取所需键**。DATE 字段读回固定 `YYYY-MM-DD HH:mm:ss`(后端 DateBizField.toDisplayValue 恒用秒级格式;表单 load 序列化同口径),字段 options.format 只影响门户显示,不要按 format 断言读回字符串。" }),
|
|
137
137
|
"data.save": Object.freeze({
|
|
138
138
|
scope: "write authoritative readback form save",
|
|
139
139
|
description: dataSaveDescription(),
|
|
@@ -144,7 +144,7 @@ export const RUNTIME_DATA_LANE_CONTRACT = Object.freeze({
|
|
|
144
144
|
}),
|
|
145
145
|
"data.delete": Object.freeze({
|
|
146
146
|
scope: "write authoritative readback form save",
|
|
147
|
-
description: desc("M2 runtime data delete (runtime/form/delete) with absence readback."),
|
|
147
|
+
description: desc("M2 runtime data delete (runtime/form/delete) with absence readback. 批量回执按 absent / deleted[].absent / deletionVerified / undeletedIds 判成功;**没有 `present` 键**(旧版与 absent 并列会出现 present:true+absent:true,无法判断读哪条);remainingRows/modelRowsRemaining/modelClean 只描述整表状态,不用于判批量删除成败。"),
|
|
148
148
|
}),
|
|
149
149
|
"data.submit": Object.freeze({ scope: "write authoritative readback form save", description: dataSubmitDescription() }),
|
|
150
150
|
}),
|