@stalfh233/omc-cli 0.6.89 → 0.6.90
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/lanes/businessrule.js +81 -9
- package/dist/read-shapes.js +2 -2
- package/package.json +3 -3
|
@@ -750,7 +750,11 @@ async function readRuleListBody(session, schemaCode, options) {
|
|
|
750
750
|
createdTime: row.createdTime,
|
|
751
751
|
creator: row.creater ?? row.creator,
|
|
752
752
|
}
|
|
753
|
-
|
|
753
|
+
// 内部面(T02b 调度摘要):行 id 让调用方直接读 businessrule/get,
|
|
754
|
+
// 省掉逐条 `resolveRuleRowId` 的二次 list。对外读面形状不变。
|
|
755
|
+
: options.withRowIds === true && typeof row.id === "string" && row.id !== ""
|
|
756
|
+
? { id: row.id }
|
|
757
|
+
: {}),
|
|
754
758
|
...mappingOf(row),
|
|
755
759
|
})),
|
|
756
760
|
};
|
|
@@ -762,12 +766,30 @@ async function readRuleListBody(session, schemaCode, options) {
|
|
|
762
766
|
* 调用。零新工具、零新写面;只做一层清单(不做触发链路传递闭包)。
|
|
763
767
|
*
|
|
764
768
|
* wire 受控:应用树 1(出处 + 存在性)+ 流程面(isworkflow→getWorkflow→
|
|
765
|
-
* get_published,复用 scanModelWorkflowBindings)+ 规则清单 1
|
|
766
|
-
*
|
|
769
|
+
* get_published,复用 scanModelWorkflowBindings)+ 规则清单 1 + **调度摘要**
|
|
770
|
+
* (自定义规则逐条 keys 瘦身读,≤20 条,只取 bizRuleType/schedulerSetting;
|
|
771
|
+
* TIMING 行只投影 7 个调度键,filterConditionGroups 等大块不外泄)+ 表单 1
|
|
767
772
|
* (按钮与在线 JS 共用一次 bizsheet/get)。activityCode 过滤只读流程面,其余
|
|
768
773
|
* 面逐条记 notScanned。
|
|
769
774
|
*/
|
|
770
775
|
const TRIGGER_PRESET_CODES = ["Create", "Update", "Delete"];
|
|
776
|
+
/**
|
|
777
|
+
* T02b(2026-11-20):调度摘要扫描的预算。
|
|
778
|
+
*
|
|
779
|
+
* 触发器视图此前刻意不逐条 rule.get(wire 会随规则数线性爆),代价是
|
|
780
|
+
* via:rule 行看不见定时规则。折中:只对自定义规则读一次 keys 瘦身面
|
|
781
|
+
* (bizRuleType/schedulerSetting),硬上限 20 条;超出部分与读取失败都记账
|
|
782
|
+
* (notScanned / scanned.schedulerReadFailed),不静默。
|
|
783
|
+
*/
|
|
784
|
+
const TRIGGER_SCHEDULER_MAX_RULES = 20;
|
|
785
|
+
/** TIMING(定时任务)的规则行 bizRuleType。 */
|
|
786
|
+
const RULE_BIZ_TYPE_TIMING = 2;
|
|
787
|
+
/**
|
|
788
|
+
* 调度摘要投影:只这 7 个键。`filterConditionGroups`(二维过滤条件)、
|
|
789
|
+
* `second`/`endType`/`triggerTime` 等大块留给 rule.get 整读——清单面只需要
|
|
790
|
+
* 「多久跑一次、从哪取数」。
|
|
791
|
+
*/
|
|
792
|
+
const TRIGGER_SCHEDULER_KEYS = ["triggerTimeType", "cycleType", "execCycle", "hour", "minute", "startTime", "dataSourceType"];
|
|
771
793
|
/**
|
|
772
794
|
* 在线 JS 触发点的**文本**匹配:每行至多一条(优先级 axios → fetch( → /api/)。
|
|
773
795
|
* 可能漏动态拼 URL、可能命中注释——这是协议局限,回执标 scanMode:"text"。
|
|
@@ -894,13 +916,19 @@ async function scanSchemaTriggers(session, args) {
|
|
|
894
916
|
}
|
|
895
917
|
}
|
|
896
918
|
// 4. 规则清单:一次 list,自建行进 via:rule,预置 Create/Update/Delete 行进
|
|
897
|
-
// via:preset
|
|
898
|
-
//
|
|
919
|
+
// via:preset。bizRuleType 不在 list 行上——分类留给第 4b 步的 keys 瘦身读
|
|
920
|
+
// (只取 bizRuleType/schedulerSetting,逐条整图才是会打爆 wire 的读法)。
|
|
899
921
|
let scannedRules = 0;
|
|
922
|
+
let schedulerReads = 0;
|
|
923
|
+
let schedulerReadFailed = 0;
|
|
900
924
|
const ruleRows = [];
|
|
925
|
+
// 第 4b 步的读面清单:每行只留 (ruleCode, 行 id)。id 来自 list 行
|
|
926
|
+
// (withRowIds),让调度摘要每条只付 1 wire(businessrule/get),
|
|
927
|
+
// 不再走 resolveRuleRowId 的二次 list。
|
|
928
|
+
const customRuleRows = [];
|
|
901
929
|
const presetRows = [];
|
|
902
930
|
if (activityCodeFilter === undefined) {
|
|
903
|
-
const body = await readRuleListBody(session, schemaCode, { onlyCustom: false, full: false, withMappings: false });
|
|
931
|
+
const body = await readRuleListBody(session, schemaCode, { onlyCustom: false, full: false, withMappings: false, withRowIds: true });
|
|
904
932
|
if (body.modelPresent === false)
|
|
905
933
|
throw appScopeRefusal(`模型 ${schemaCode} 不存在(模型读面为空)——本次没有扫描任何东西,空 triggers 不代表「没有触发」`, 0);
|
|
906
934
|
const rows = Array.isArray(body.rules) ? body.rules : [];
|
|
@@ -913,7 +941,49 @@ async function scanSchemaTriggers(session, args) {
|
|
|
913
941
|
presetRows.push({ via: "preset", trigger, ruleCode, enabled: row.enabled === true, note: "REST 写入面不派发数据事件——预置行只对平台内部写入生效" });
|
|
914
942
|
continue;
|
|
915
943
|
}
|
|
916
|
-
|
|
944
|
+
const ruleRow = { via: "rule", ruleCode, name: row.name ?? null, defaultRule: false, enabled: row.enabled === true, status: row.status ?? null };
|
|
945
|
+
ruleRows.push(ruleRow);
|
|
946
|
+
customRuleRows.push({ row: ruleRow, id: typeof row.id === "string" && row.id !== "" ? row.id : null });
|
|
947
|
+
}
|
|
948
|
+
// 4b. 调度摘要:自定义规则逐条 keys 瘦身读(rule.get 的
|
|
949
|
+
// {keys:["bizRuleType","schedulerSetting"]} 同一读面),≤20 条。
|
|
950
|
+
// 所有命中行回填 bizRuleType;TIMING(===2)行再回投影后的 scheduler
|
|
951
|
+
// (7 键)——filterConditionGroups/second/endType 等大块留给 rule.get。
|
|
952
|
+
// 单条失败不连坐:该行两个键都不回,失败计数进 scanned。
|
|
953
|
+
// 必须在 action 过滤**之前**回填,否则 action 视图看不到调度。
|
|
954
|
+
const readTargets = customRuleRows.slice(0, TRIGGER_SCHEDULER_MAX_RULES);
|
|
955
|
+
if (customRuleRows.length > TRIGGER_SCHEDULER_MAX_RULES)
|
|
956
|
+
notScanned.push(`自定义规则 ${customRuleRows.length} 条 > ${TRIGGER_SCHEDULER_MAX_RULES}:第 ${TRIGGER_SCHEDULER_MAX_RULES + 1} 条起未读调度摘要(用 rule.get keys:["bizRuleType","schedulerSetting"])`);
|
|
957
|
+
for (const target of readTargets) {
|
|
958
|
+
const id = target.id ?? (await resolveRuleRowId(session, schemaCode, target.row.ruleCode));
|
|
959
|
+
if (id === null) {
|
|
960
|
+
schedulerReadFailed += 1;
|
|
961
|
+
continue;
|
|
962
|
+
}
|
|
963
|
+
try {
|
|
964
|
+
const record = (await wireCall(session, { path: ENDPOINTS.businessRuleGet, query: { id } })).data;
|
|
965
|
+
if (record === null) {
|
|
966
|
+
schedulerReadFailed += 1;
|
|
967
|
+
continue;
|
|
968
|
+
}
|
|
969
|
+
schedulerReads += 1;
|
|
970
|
+
if (typeof record.bizRuleType === "number")
|
|
971
|
+
target.row.bizRuleType = record.bizRuleType;
|
|
972
|
+
if (record.bizRuleType === RULE_BIZ_TYPE_TIMING) {
|
|
973
|
+
const settings = parseRuleColumn(record.schedulerSetting);
|
|
974
|
+
if (settings !== null && typeof settings === "object" && !Array.isArray(settings)) {
|
|
975
|
+
const source = settings;
|
|
976
|
+
const projected = {};
|
|
977
|
+
for (const key of TRIGGER_SCHEDULER_KEYS)
|
|
978
|
+
if (source[key] !== undefined)
|
|
979
|
+
projected[key] = source[key];
|
|
980
|
+
target.row.scheduler = projected;
|
|
981
|
+
}
|
|
982
|
+
}
|
|
983
|
+
}
|
|
984
|
+
catch {
|
|
985
|
+
schedulerReadFailed += 1;
|
|
986
|
+
}
|
|
917
987
|
}
|
|
918
988
|
}
|
|
919
989
|
// 5. 在线 JS 文本匹配(零 wire;无脚本时第 3 步已记 notScanned)。
|
|
@@ -944,15 +1014,17 @@ async function scanSchemaTriggers(session, args) {
|
|
|
944
1014
|
const filterNote = action !== undefined && action !== "flow"
|
|
945
1015
|
? `;action:"${action}" 的规则绑定判据=workflow 行的 activityCode/nodeEvent/handler 或按钮的 buttonCode/targetCode 含「${action}」,或规则 code 就是 ${action}(不区分大小写,启发式;完整清单去掉 action)`
|
|
946
1016
|
: "";
|
|
1017
|
+
// T02b:调度摘要的 wire 说明。本 kind 没有 wire.plan 键,就按既有形状进 note。
|
|
1018
|
+
const schedulerNote = activityCodeFilter === undefined ? ";调度摘要另 +≤20 次 rule.get keys 瘦身读(bizRuleType/schedulerSetting)" : "";
|
|
947
1019
|
return {
|
|
948
1020
|
schemaCode,
|
|
949
1021
|
action: action ?? null,
|
|
950
1022
|
mode,
|
|
951
1023
|
triggers,
|
|
952
|
-
scanned: { workflows, rules: scannedRules, buttons: scannedButtons, onlinejsBytes },
|
|
1024
|
+
scanned: { workflows, rules: scannedRules, buttons: scannedButtons, onlinejsBytes, schedulerReads, schedulerReadFailed },
|
|
953
1025
|
notScanned,
|
|
954
1026
|
scanMode: "source",
|
|
955
|
-
note: "零命中=本次扫描未命中触发点,不代表没有触发;在线 JS 是文本匹配,可能漏动态拼 URL" + filterNote,
|
|
1027
|
+
note: "零命中=本次扫描未命中触发点,不代表没有触发;在线 JS 是文本匹配,可能漏动态拼 URL" + schedulerNote + filterNote,
|
|
956
1028
|
...(activityCodeFilter !== undefined ? { activityCode: activityCodeFilter } : {}),
|
|
957
1029
|
applicationResolution: { ...applicationResolutionOf(scope), mode: "trigger", models: 1 },
|
|
958
1030
|
};
|
package/dist/read-shapes.js
CHANGED
|
@@ -102,8 +102,8 @@ const READ_SHAPES = {
|
|
|
102
102
|
},
|
|
103
103
|
// r80:计数/分组统计的读回面。notes 只显首条——把陷阱并进第一句。
|
|
104
104
|
"data.aggregate": {
|
|
105
|
-
keys: ["schemaCode", "metric", "field?", "value?", "count", "nonNullCount?", "nullCount?", "groupBy?", "total", "buckets:array<{key,count,nonNullCount?,value?}>", "nullBucket:{count,nonNullCount?,value?}", "truncatedBuckets", "bucketsTruncatedCount", "unaccountedCount?", "shapeWarnings?", "strategyFallback?", "coverage:{mode:server-total|paged-local-scan|local-scan|server-aggregate,rowsScanned,cap,complete,missingCount?}", "filter:{draftPolicy,hint}", "wire:{calls,plan,concurrency?}", "capNotice?", "note?", "environmentFingerprint"],
|
|
106
|
-
notes: ["计数用 total(totalElements);分组=值域×count,key 是存储值/code,null 单列 nullBucket;分桶 count 并发窗口 4;数值指标(sum/avg/min/max+field)本地折叠(cap 1000,null 不进聚合、avg 分母排除 null);coverage.mode=server-total/paged-local-scan/local-scan/server-aggregate,/sum 不可用或形状不符回退本地(strategyFallback);complete:false 只覆盖已扫行,勿外推"],
|
|
105
|
+
keys: ["schemaCode", "metric", "field?", "value?", "count", "nonNullCount?", "nullCount?", "groupBy?", "total", "buckets:array<{key,count,nonNullCount?,value?}>", "nullBucket:{count,nonNullCount?,value?}", "truncatedBuckets", "bucketsTruncatedCount", "unaccountedCount?", "shapeWarnings?", "strategyFallback?", "coverage:{mode:server-total|paged-local-scan|local-scan|server-aggregate|server-child|local-scan-child,rowsScanned,cap,complete,missingCount?}", "child:{childSchemaCode,bizObjectId}?", "pages?", "partial?", "readFailure:{page,code?,message}?", "filter:{draftPolicy,hint}", "wire:{calls,plan,concurrency?}", "capNotice?", "note?", "environmentFingerprint"],
|
|
106
|
+
notes: ["计数用 total(totalElements);分组=值域×count,key 是存储值/code,null 单列 nullBucket;分桶 count 并发窗口 4;数值指标(sum/avg/min/max+field)本地折叠(cap 1000,null 不进聚合、avg 分母排除 null);coverage.mode=server-total/paged-local-scan/local-scan/server-aggregate,/sum 不可用或形状不符回退本地(strategyFallback);complete:false 只覆盖已扫行,勿外推", "child=子表目标:count 走 list_child totalElements,数值列只拉目标列分页折叠"],
|
|
107
107
|
},
|
|
108
108
|
"app.list": {
|
|
109
109
|
keys: ["applications:array<{code,name,groupId?,modelCount}>", "applicationsCount", "omitted"],
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@stalfh233/omc-cli",
|
|
3
|
-
"version": "0.6.
|
|
3
|
+
"version": "0.6.90",
|
|
4
4
|
"description": "CloudPivot 8.6 configuration capability CLI — governed, fail-closed, coverage-manifest bounded.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"bin": {
|
|
@@ -56,7 +56,7 @@
|
|
|
56
56
|
},
|
|
57
57
|
"dependencies": {
|
|
58
58
|
"commander": "14.0.3",
|
|
59
|
-
"omc-core": "0.6.
|
|
59
|
+
"omc-core": "0.6.90",
|
|
60
60
|
"proper-lockfile": "4.1.2",
|
|
61
61
|
"write-file-atomic": "6.0.0",
|
|
62
62
|
"zod": "^3.23.8",
|
|
@@ -74,6 +74,6 @@
|
|
|
74
74
|
"directory": "packages/omc-cli"
|
|
75
75
|
},
|
|
76
76
|
"optionalDependencies": {
|
|
77
|
-
"@stalfh233/omc-fake-platform": "0.6.
|
|
77
|
+
"@stalfh233/omc-fake-platform": "0.6.90"
|
|
78
78
|
}
|
|
79
79
|
}
|