@stalfh233/omc-fake-platform 0.6.81 → 0.6.83
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/businessrule.js +29 -22
- package/dist/environment.js +14 -0
- package/dist/index.d.ts +7 -0
- package/dist/index.js +12 -0
- package/dist/model.js +3 -1
- package/dist/routes.js +2 -0
- package/dist/rule-lifecycle.js +21 -4
- package/dist/runtime-data.js +99 -1
- package/dist/servicelog.d.ts +30 -0
- package/dist/servicelog.js +47 -0
- package/dist/state.d.ts +21 -0
- package/dist/workflow.js +11 -1
- package/package.json +2 -2
package/dist/businessrule.js
CHANGED
|
@@ -46,28 +46,35 @@ export const businessRuleRoute = (ctx, input) => {
|
|
|
46
46
|
switch (input.path) {
|
|
47
47
|
case "/api/api/app/businessrule/list_by_schemacode":
|
|
48
48
|
case "/api/api/runtime/business_rule/list_by_schemacode":
|
|
49
|
-
return [...ctx.state.rules.values()].filter((rule) => rule.schemaCode === q.schemaCode).map((rule) =>
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
49
|
+
return [...ctx.state.rules.values()].filter((rule) => rule.schemaCode === q.schemaCode).map((rule) => {
|
|
50
|
+
// r86 issue 14 fidelity: hidePublishedFace keeps the list projections
|
|
51
|
+
// from ever showing latestPublished (DRAFT-only app face / runtime face
|
|
52
|
+
// draft-enabled filter) even after a successful publish.
|
|
53
|
+
const computedPublishStatus = rule.publishStatus ?? (rule.enabled ? "PUBLISHED" : "DRAFT");
|
|
54
|
+
const facePublishStatus = rule.hidePublishedFace === true ? "DRAFT" : computedPublishStatus;
|
|
55
|
+
return {
|
|
56
|
+
id: rule.id,
|
|
57
|
+
schemaCode: rule.schemaCode,
|
|
58
|
+
code: rule.code,
|
|
59
|
+
ruleCode: rule.code,
|
|
60
|
+
name: rule.name,
|
|
61
|
+
enabled: rule.enabled,
|
|
62
|
+
status: rule.status ?? (rule.enabled ? RULE_STATUS.enabled : RULE_STATUS.disabled),
|
|
63
|
+
// Live fidelity: the list face carries defaultRule (platform preset
|
|
64
|
+
// trigger rows answer true); consumers derive `preset` from it.
|
|
65
|
+
defaultRule: rule.defaultRule ?? false,
|
|
66
|
+
priority: rule.priority ?? 0,
|
|
67
|
+
createdTime: rule.createdTime ?? 1730000000000,
|
|
68
|
+
creator: rule.creator ?? "fake-user",
|
|
69
|
+
// latestPublished must read the COMPUTED status, not the raw optional
|
|
70
|
+
// field: a rule enabled by businessrule/publish has no explicit
|
|
71
|
+
// publishStatus and previously reported latestPublished:false here.
|
|
72
|
+
publishStatus: facePublishStatus,
|
|
73
|
+
developmentMode: rule.developmentMode ?? "CODING",
|
|
74
|
+
ruleVersion: rule.ruleVersion ?? 1,
|
|
75
|
+
latestPublished: facePublishStatus === "PUBLISHED",
|
|
76
|
+
};
|
|
77
|
+
});
|
|
71
78
|
case "/api/api/app/businessrule/get": {
|
|
72
79
|
// Ticket 109 fidelity: superseded rows stay readable by their OLD id
|
|
73
80
|
// (historical versions) — the current rows map only holds the newest.
|
package/dist/environment.js
CHANGED
|
@@ -17,6 +17,20 @@ export const environmentRoute = (ctx, input) => {
|
|
|
17
17
|
};
|
|
18
18
|
case "/user/public/getKey":
|
|
19
19
|
return { key: FAKE_RSA_PUBLIC_KEY, index: "1" };
|
|
20
|
+
case "/api/license/info":
|
|
21
|
+
// r86(retro issue 17):LicenseController.info(8.6 族)→ LicenseInfo
|
|
22
|
+
// {systemVersion(系统版本号), licenseType, expiration, ...}。
|
|
23
|
+
// 默认挂载(fake 基线是 8.6.26);1.1.x 产品线不挂载——测试用
|
|
24
|
+
// fake.absentPaths.add("/api/license/info") 模拟(真机 1.1.25 实测 404)。
|
|
25
|
+
// buildTime 是 LicenseInfo 的**声明字段**,但 8.6.26 的 info() 从不 setBuildTime
|
|
26
|
+
// (反编译 LicenseController.java:92-119)——默认不伪造;要测「有 buildTime
|
|
27
|
+
// 的产品线」用 options.licenseBuildTime 显式注入。
|
|
28
|
+
return {
|
|
29
|
+
systemVersion: ctx.options.systemVersion ?? ctx.options.version ?? "8.6.26",
|
|
30
|
+
...(ctx.options.licenseBuildTime !== undefined ? { buildTime: ctx.options.licenseBuildTime } : {}),
|
|
31
|
+
licenseType: 2,
|
|
32
|
+
expiration: "2030-01-01",
|
|
33
|
+
};
|
|
20
34
|
case "/user/login/Authentication/get_code":
|
|
21
35
|
return { code: "fake-auth-code" };
|
|
22
36
|
case "/user/login/Authentication/get_token":
|
package/dist/index.d.ts
CHANGED
|
@@ -66,6 +66,13 @@ export declare class FakeCloudPivot implements CloudPivotHttp {
|
|
|
66
66
|
markListViewUnconfigured(schemaCode: string): void;
|
|
67
67
|
seedApp(app: Partial<FakeApp> & Pick<FakeApp, "code">): void;
|
|
68
68
|
seedField(schemaCode: string, code: string, propertyType: number, published?: boolean, options?: Record<string, unknown>): void;
|
|
69
|
+
/**
|
|
70
|
+
* r86(retro issue 15):种一个子表 schema(bizmodels/get_all 的 parentCode 面)。
|
|
71
|
+
* 真平台里子表 schema 由父模型的 CHILD_TABLE 字段隐式创建;fake 不模拟该隐式链,
|
|
72
|
+
* 测试显式声明 child→parent 关系即可驱动 get_all parentCode 与 query/list 的
|
|
73
|
+
* 子表面行为(裸过滤字段按父模型解析 → 50000)。
|
|
74
|
+
*/
|
|
75
|
+
seedChildSchema(childCode: string, parentCode: string, name?: string): void;
|
|
69
76
|
request(input: FakeRequestInput): Promise<{
|
|
70
77
|
status: number;
|
|
71
78
|
body: unknown;
|
package/dist/index.js
CHANGED
|
@@ -124,6 +124,18 @@ export class FakeCloudPivot {
|
|
|
124
124
|
this.ensureSeedModel(schemaCode);
|
|
125
125
|
this.state.fields.set(`${schemaCode}#${code}`, { code, name: code, type: String(propertyType), published, ...(options !== undefined ? { options: JSON.stringify(options) } : {}) });
|
|
126
126
|
}
|
|
127
|
+
/**
|
|
128
|
+
* r86(retro issue 15):种一个子表 schema(bizmodels/get_all 的 parentCode 面)。
|
|
129
|
+
* 真平台里子表 schema 由父模型的 CHILD_TABLE 字段隐式创建;fake 不模拟该隐式链,
|
|
130
|
+
* 测试显式声明 child→parent 关系即可驱动 get_all parentCode 与 query/list 的
|
|
131
|
+
* 子表面行为(裸过滤字段按父模型解析 → 50000)。
|
|
132
|
+
*/
|
|
133
|
+
seedChildSchema(childCode, parentCode, name = childCode) {
|
|
134
|
+
this.ensureSeedModel(childCode);
|
|
135
|
+
this.ensureSeedModel(parentCode);
|
|
136
|
+
this.state.models.get(childCode).parentCode = parentCode;
|
|
137
|
+
this.state.models.get(childCode).name = name;
|
|
138
|
+
}
|
|
127
139
|
async request(input) {
|
|
128
140
|
this.state.callLog.push({
|
|
129
141
|
path: input.path,
|
package/dist/model.js
CHANGED
|
@@ -163,7 +163,9 @@ export const modelRoute = (ctx, input) => {
|
|
|
163
163
|
if (ctx.options.modelGetAllAbsent === true)
|
|
164
164
|
return httpErrorResponse(404, JSON.stringify({ timestamp: "fake", status: 404, error: "Not Found", path: input.path }));
|
|
165
165
|
const model = ctx.state.models.get(q.schemaCode);
|
|
166
|
-
|
|
166
|
+
// r86(retro issue 15):BizSchemaModel.parentCode 是子表判别面(真机 1.1.25
|
|
167
|
+
// 实证:get_all?schemaCode=w9a_items → parentCode=w9a_parent)。
|
|
168
|
+
return model ? { id: model.recordId, name: model.name, modelType: "LIST", ...(model.parentCode ? { parentCode: model.parentCode } : {}) } : null;
|
|
167
169
|
}
|
|
168
170
|
case "/api/api/app/folders/create": {
|
|
169
171
|
const appCode = String(body.appCode ?? "");
|
package/dist/routes.js
CHANGED
|
@@ -14,6 +14,7 @@ import { programmingRoute } from "./programming.js";
|
|
|
14
14
|
import { reportRoute } from "./report.js";
|
|
15
15
|
import { ruleLifecycleRoute } from "./rule-lifecycle.js";
|
|
16
16
|
import { ruleLogRoute } from "./rulelog.js";
|
|
17
|
+
import { serviceLogRoute } from "./servicelog.js";
|
|
17
18
|
import { runtimeDataRoute } from "./runtime-data.js";
|
|
18
19
|
import { NOT_HANDLED } from "./state.js";
|
|
19
20
|
import { workflowRoute } from "./workflow.js";
|
|
@@ -33,6 +34,7 @@ const LANE_ROUTES = [
|
|
|
33
34
|
formRoute,
|
|
34
35
|
businessRuleRoute,
|
|
35
36
|
ruleLogRoute,
|
|
37
|
+
serviceLogRoute,
|
|
36
38
|
ruleLifecycleRoute,
|
|
37
39
|
runtimeDataRoute,
|
|
38
40
|
workflowRoute,
|
package/dist/rule-lifecycle.js
CHANGED
|
@@ -142,10 +142,27 @@ export const ruleLifecycleRoute = (ctx, input) => {
|
|
|
142
142
|
const model = { ...(stored ?? {}), ...body };
|
|
143
143
|
if (selfCheckProblems(ctx.state, model).length > 0)
|
|
144
144
|
return businessRefusal(550018, "保存规则失败,规则存在异常,请点击检测并修正!");
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
145
|
+
// r86 issue 14 fidelity: the platform publish is synchronous — the facade
|
|
146
|
+
// mints the PUBLISH row in-lock (ruleVersion = max+1, latestPublished=TRUE,
|
|
147
|
+
// status ENABLED; BusinessRuleServiceImpl.publish:483-536) and RETURNS the
|
|
148
|
+
// model with the minted ruleVersion (BusinessRuleFacadeImpl.
|
|
149
|
+
// publishBusinessRule:337-352). The response body is the verification
|
|
150
|
+
// evidence rule.save falls back to when the list faces cannot show the row.
|
|
151
|
+
for (const rule of ctx.state.rules.values()) {
|
|
152
|
+
if (rule.id !== targetId)
|
|
153
|
+
continue;
|
|
154
|
+
rule.enabled = true;
|
|
155
|
+
rule.ruleVersion = (rule.ruleVersion ?? 0) + 1;
|
|
156
|
+
if (rule.hidePublishedFace !== true)
|
|
157
|
+
rule.publishStatus = "PUBLISHED";
|
|
158
|
+
}
|
|
159
|
+
const storedNow = [...ctx.state.rules.values()].find((rule) => rule.id === targetId);
|
|
160
|
+
const responseModel = { ...(storedNow ?? model), ruleVersion: storedNow?.ruleVersion ?? 1, latestPublished: storedNow?.hidePublishedFace === true ? false : true };
|
|
161
|
+
if (storedNow?.publishResponseBare === true) {
|
|
162
|
+
delete responseModel.ruleVersion;
|
|
163
|
+
return responseModel;
|
|
164
|
+
}
|
|
165
|
+
return responseModel;
|
|
149
166
|
}
|
|
150
167
|
case "/api/api/app/businessrule/enable": {
|
|
151
168
|
// BusinessRuleKeyRequest {schemaCode, ruleCode} flips the DRAFT row's
|
package/dist/runtime-data.js
CHANGED
|
@@ -41,6 +41,23 @@ export const runtimeDataRoute = (ctx, input) => {
|
|
|
41
41
|
// and>or>and>leaf array (level1 AND across groups, level2 OR across
|
|
42
42
|
// and-groups, level3 AND across leaves), PageVO response.
|
|
43
43
|
const schemaCode = String(body.schemaCode ?? "");
|
|
44
|
+
// r86(retro issue 15,8.6.26 ChildBizObjectAssembler + 真机 1.1.25):子表
|
|
45
|
+
// schema(get_all parentCode 非空)的 queryCondition 叶子按**父模型**解析——
|
|
46
|
+
// 裸字段不在父属性表 → 50000 服务异常;带点号的 `<子表code>.<字段>` 合法
|
|
47
|
+
// (真机:productCode eq → 50000、parentId eq → 50000、
|
|
48
|
+
// w9a_items.productCode eq → errcode 0)。
|
|
49
|
+
const parentCode = ctx.state.models.get(schemaCode)?.parentCode;
|
|
50
|
+
if (parentCode && Array.isArray(body.queryCondition)) {
|
|
51
|
+
const bareFields = collectConditionFields(body.queryCondition)
|
|
52
|
+
.filter((code) => !code.includes("."))
|
|
53
|
+
// 默认属性列(DefaultPropertyType.codes)两表都有物理列,按父模型解析也成立
|
|
54
|
+
// (平台子表分支自己就用 parent-scope sequenceStatus 排草稿);只有父表
|
|
55
|
+
// **没有**的裸字段(子表业务列、parentId 之外的子表专有列)才 50000。
|
|
56
|
+
.filter((code) => !ORDERABLE_SYSTEM_FIELDS.has(code))
|
|
57
|
+
.filter((code) => !ctx.state.fields.has(`${parentCode}#${code}`));
|
|
58
|
+
if (bareFields.length > 0)
|
|
59
|
+
return businessRefusal(50000, "服务异常");
|
|
60
|
+
}
|
|
44
61
|
const rows = [...ctx.state.dataRows.values()].filter((row) => row.schemaCode === schemaCode);
|
|
45
62
|
const groups = Array.isArray(body.queryCondition) ? body.queryCondition : [];
|
|
46
63
|
const filtered = groups.length > 0
|
|
@@ -49,6 +66,15 @@ export const runtimeDataRoute = (ctx, input) => {
|
|
|
49
66
|
const page = typeof body.page === "number" ? body.page : 0;
|
|
50
67
|
const size = typeof body.size === "number" ? body.size : 20;
|
|
51
68
|
const start = page * size;
|
|
69
|
+
// r86(retro issue 16,8.6.26 QueryDataVO.orders + 真机 1.1.25):服务端排序
|
|
70
|
+
// orders:[{propertyCode,dir:ASC|DESC}]——dir 大小写敏感(Order$Dir 枚举,小写
|
|
71
|
+
// 10009);未知列 → 40000 调用数据库发生异常(真机);多键数组序优先、
|
|
72
|
+
// ASC 时 null 在前(真机 contract_no ASC 的 None 首位)。子表 schema 分支
|
|
73
|
+
// 不消费 orders(ChildBizObjectAssembler 不设排序)——如实忽略。
|
|
74
|
+
const ordered = parentCode ? filtered : applyOrders(ctx, schemaCode, filtered, body.orders);
|
|
75
|
+
if (ordered === null)
|
|
76
|
+
return businessRefusal(40000, "调用数据库发生异常");
|
|
77
|
+
const content = ordered.slice(start, start + size);
|
|
52
78
|
// An unconfigured default list view omits business columns from the
|
|
53
79
|
// projection: the stored value exists but the wire row does not carry
|
|
54
80
|
// it, so explicit display columns read back null (ticket 07).
|
|
@@ -61,7 +87,7 @@ export const runtimeDataRoute = (ctx, input) => {
|
|
|
61
87
|
totalPages: size > 0 ? Math.ceil(filtered.length / size) : 0,
|
|
62
88
|
page,
|
|
63
89
|
size,
|
|
64
|
-
content:
|
|
90
|
+
content: content.map((row) => ({
|
|
65
91
|
bizObjectId: row.bizObjectId,
|
|
66
92
|
schemaCode,
|
|
67
93
|
data: project(row),
|
|
@@ -427,3 +453,75 @@ function matchesCondition(condition, row) {
|
|
|
427
453
|
return true;
|
|
428
454
|
return operator.matches(row[String(value.propertyCode ?? "")], String(value.propertyValue ?? ""));
|
|
429
455
|
}
|
|
456
|
+
/** Walk a 3-level queryCondition array and collect leaf propertyCode values. */
|
|
457
|
+
function collectConditionFields(condition) {
|
|
458
|
+
const codes = [];
|
|
459
|
+
const walk = (node) => {
|
|
460
|
+
if (Array.isArray(node)) {
|
|
461
|
+
node.forEach(walk);
|
|
462
|
+
return;
|
|
463
|
+
}
|
|
464
|
+
if (node === null || typeof node !== "object")
|
|
465
|
+
return;
|
|
466
|
+
const leaf = node;
|
|
467
|
+
if (typeof leaf.propertyCode === "string" && leaf.propertyCode)
|
|
468
|
+
codes.push(leaf.propertyCode);
|
|
469
|
+
};
|
|
470
|
+
walk(condition);
|
|
471
|
+
return [...new Set(codes)];
|
|
472
|
+
}
|
|
473
|
+
/**
|
|
474
|
+
* r86(retro issue 16):QueryDataVO.orders 服务端排序。可排面 = 已发布业务字段 +
|
|
475
|
+
* 系统列(DefaultPropertyType;平台默认排序本身就是 createdTime)。不在可排面的
|
|
476
|
+
* 列 → 40000 调用数据库发生异常(真机 1.1.25 实证:no_such_col DESC → 40000)。
|
|
477
|
+
* 排序语义:多键数组序优先、ASC 时 null 在前(真机 contract_no ASC 的 None 首
|
|
478
|
+
* 位)、并列保持插入序(JS sort 稳定)。
|
|
479
|
+
*/
|
|
480
|
+
const ORDERABLE_SYSTEM_FIELDS = new Set([
|
|
481
|
+
"id", "name", "creater", "createdDeptId", "owner", "ownerDeptId", "createdTime",
|
|
482
|
+
"modifier", "modifiedTime", "workflowInstanceId", "sequenceNo", "sequenceStatus",
|
|
483
|
+
"ownerDeptQueryCode", "version",
|
|
484
|
+
]);
|
|
485
|
+
function orderableFieldOf(ctx, schemaCode, code) {
|
|
486
|
+
if (ORDERABLE_SYSTEM_FIELDS.has(code))
|
|
487
|
+
return true;
|
|
488
|
+
return ctx.state.fields.has(`${schemaCode}#${code}`);
|
|
489
|
+
}
|
|
490
|
+
function applyOrders(ctx, schemaCode, rows, orders) {
|
|
491
|
+
if (!Array.isArray(orders) || orders.length === 0)
|
|
492
|
+
return rows;
|
|
493
|
+
const keys = [];
|
|
494
|
+
for (const entry of orders) {
|
|
495
|
+
if (!entry || typeof entry !== "object")
|
|
496
|
+
return null;
|
|
497
|
+
const code = String(entry.propertyCode ?? "");
|
|
498
|
+
const dir = String(entry.dir ?? "");
|
|
499
|
+
if (!code || (dir !== "ASC" && dir !== "DESC"))
|
|
500
|
+
return null;
|
|
501
|
+
if (!orderableFieldOf(ctx, schemaCode, code))
|
|
502
|
+
return null;
|
|
503
|
+
keys.push({ code, dir });
|
|
504
|
+
}
|
|
505
|
+
return [...rows].sort((left, right) => {
|
|
506
|
+
for (const key of keys) {
|
|
507
|
+
const compared = compareOrderValues(left[key.code], right[key.code]);
|
|
508
|
+
if (compared !== 0)
|
|
509
|
+
return key.dir === "DESC" ? -compared : compared;
|
|
510
|
+
}
|
|
511
|
+
return 0;
|
|
512
|
+
});
|
|
513
|
+
}
|
|
514
|
+
/** null/undefined first under ASC (observed live: contract_no ASC put None first). */
|
|
515
|
+
function compareOrderValues(left, right) {
|
|
516
|
+
const leftMissing = left === null || left === undefined || left === "";
|
|
517
|
+
const rightMissing = right === null || right === undefined || right === "";
|
|
518
|
+
if (leftMissing && rightMissing)
|
|
519
|
+
return 0;
|
|
520
|
+
if (leftMissing)
|
|
521
|
+
return -1;
|
|
522
|
+
if (rightMissing)
|
|
523
|
+
return 1;
|
|
524
|
+
if (typeof left === "number" && typeof right === "number")
|
|
525
|
+
return left - right;
|
|
526
|
+
return String(left).localeCompare(String(right));
|
|
527
|
+
}
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import { type FakeState, type LaneRoute } from "./state.js";
|
|
2
|
+
/**
|
|
3
|
+
* Business-service invocation log face (`h_log_biz_service`). Mirrors
|
|
4
|
+
* LogManagerController.listBizServiceLog (page is 0-based, size defaults to 10)
|
|
5
|
+
* and BizServiceLogServiceImpl.getOrmWhereClause: code/methodName are
|
|
6
|
+
* LIKE-contains (comma → exact IN), dataTitle contains, `startTime >=` /
|
|
7
|
+
* `endTime <=`, status 1=failure 2=success, always startTime DESC. schemaCode /
|
|
8
|
+
* bizObjectId are row fields, NOT query filters — the fake ignores them exactly
|
|
9
|
+
* like the platform does, so the tool's client-side matching stays honest.
|
|
10
|
+
*/
|
|
11
|
+
export interface FakeBizServiceLog {
|
|
12
|
+
id?: string;
|
|
13
|
+
code: string;
|
|
14
|
+
methodName: string;
|
|
15
|
+
dataTitle?: string | null;
|
|
16
|
+
params?: string | null;
|
|
17
|
+
result?: string | null;
|
|
18
|
+
bizServiceStatus?: 1 | 2;
|
|
19
|
+
bizServiceStatusName?: string;
|
|
20
|
+
detail?: string | null;
|
|
21
|
+
startTime: string;
|
|
22
|
+
endTime?: string | null;
|
|
23
|
+
usedTime?: number | null;
|
|
24
|
+
server?: string | null;
|
|
25
|
+
schemaCode?: string | null;
|
|
26
|
+
bizObjectId?: string | null;
|
|
27
|
+
extensionLog?: string | null;
|
|
28
|
+
}
|
|
29
|
+
export declare function seedBizServiceLog(state: FakeState, seed: FakeBizServiceLog): void;
|
|
30
|
+
export declare const serviceLogRoute: LaneRoute;
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
import { NOT_HANDLED } from "./state.js";
|
|
2
|
+
const logStore = (state) => {
|
|
3
|
+
const holder = state;
|
|
4
|
+
return holder.__bizServiceLogs ?? (holder.__bizServiceLogs = []);
|
|
5
|
+
};
|
|
6
|
+
export function seedBizServiceLog(state, seed) {
|
|
7
|
+
const list = logStore(state);
|
|
8
|
+
list.push({
|
|
9
|
+
...seed,
|
|
10
|
+
id: seed.id ?? `biz-log-${list.length + 1}`,
|
|
11
|
+
bizServiceStatusName: seed.bizServiceStatusName ?? (seed.bizServiceStatus === 1 ? "失败" : "成功"),
|
|
12
|
+
});
|
|
13
|
+
}
|
|
14
|
+
const containsOrIn = (value, column) => {
|
|
15
|
+
if (value === undefined || value === "")
|
|
16
|
+
return true;
|
|
17
|
+
const cell = column ?? "";
|
|
18
|
+
if (value.includes(","))
|
|
19
|
+
return value.split(",").includes(cell);
|
|
20
|
+
return cell.includes(value);
|
|
21
|
+
};
|
|
22
|
+
export const serviceLogRoute = (ctx, input) => {
|
|
23
|
+
if (input.path !== "/api/api/log/list_bizservicelog" && input.path !== "/api/log/list_bizservicelog")
|
|
24
|
+
return NOT_HANDLED;
|
|
25
|
+
const q = input.query ?? {};
|
|
26
|
+
const status = q.status === undefined || q.status === "" ? undefined : Number(q.status);
|
|
27
|
+
const filtered = logStore(ctx.state)
|
|
28
|
+
.filter((row) => containsOrIn(q.code, row.code))
|
|
29
|
+
.filter((row) => containsOrIn(q.methodName, row.methodName))
|
|
30
|
+
.filter((row) => q.dataTitle === undefined || String(row.dataTitle ?? "").includes(q.dataTitle))
|
|
31
|
+
.filter((row) => q.startTime === undefined || String(row.startTime) >= q.startTime)
|
|
32
|
+
.filter((row) => q.endTime === undefined || String(row.endTime ?? row.startTime) <= q.endTime)
|
|
33
|
+
.filter((row) => status === undefined || status === 0 || row.bizServiceStatus === status)
|
|
34
|
+
.sort((left, right) => String(right.startTime).localeCompare(String(left.startTime)));
|
|
35
|
+
const page = Number(q.page ?? 0);
|
|
36
|
+
const size = Number(q.size ?? 10);
|
|
37
|
+
const content = filtered.slice(page * size, (page + 1) * size);
|
|
38
|
+
return {
|
|
39
|
+
view: null,
|
|
40
|
+
parentData: null,
|
|
41
|
+
totalElements: filtered.length,
|
|
42
|
+
totalPages: Math.ceil(filtered.length / size),
|
|
43
|
+
sumLine: 0,
|
|
44
|
+
sumMap: {},
|
|
45
|
+
content,
|
|
46
|
+
};
|
|
47
|
+
};
|
package/dist/state.d.ts
CHANGED
|
@@ -42,6 +42,12 @@ export interface FakeCloudPivotOptions {
|
|
|
42
42
|
readonly systemClientSecretField?: boolean;
|
|
43
43
|
readonly systemClient?: string;
|
|
44
44
|
readonly systemVersion?: string;
|
|
45
|
+
/**
|
|
46
|
+
* r86(retro issue 17):LicenseInfo.buildTime 是声明字段但 8.6.26 的
|
|
47
|
+
* `GET /api/license/info` 从不赋值(反编译 LicenseController.info)。
|
|
48
|
+
* 默认不返回;测试「有 buildTime 的产品线」时显式注入。
|
|
49
|
+
*/
|
|
50
|
+
readonly licenseBuildTime?: string;
|
|
45
51
|
/**
|
|
46
52
|
* 8.0/8.1 deployments do not serve `/api/api/app/bizmodels/get_all` at all —
|
|
47
53
|
* the path answers HTTP 404 and the same rows come from
|
|
@@ -150,6 +156,20 @@ export interface FakeRule {
|
|
|
150
156
|
ruleVersion?: number;
|
|
151
157
|
/** Platform preset trigger rule (Create/Update/Load/…); the list face exposes it. */
|
|
152
158
|
defaultRule?: boolean;
|
|
159
|
+
/**
|
|
160
|
+
* r86 issue 14 fidelity: publish succeeds and the response carries the minted
|
|
161
|
+
* ruleVersion, but the list faces keep reporting latestPublished:false /
|
|
162
|
+
* publishStatus:"DRAFT" — modeling the real platform's DRAFT-only app face
|
|
163
|
+
* and the runtime face's draft-enabled filter (a disabled draft hides the
|
|
164
|
+
* PUBLISH row). Verification must fall back to the publish response.
|
|
165
|
+
*/
|
|
166
|
+
hidePublishedFace?: boolean;
|
|
167
|
+
/**
|
|
168
|
+
* r86 issue 14 fidelity: the publish answer carries NO ruleVersion (product
|
|
169
|
+
* lines whose publish response is a bare ok) — combined with
|
|
170
|
+
* hidePublishedFace, neither evidence face can verify the publish.
|
|
171
|
+
*/
|
|
172
|
+
publishResponseBare?: boolean;
|
|
153
173
|
}
|
|
154
174
|
export interface FakeDataRule {
|
|
155
175
|
id: string;
|
|
@@ -527,6 +547,7 @@ export interface FakeState {
|
|
|
527
547
|
treeHidden?: boolean;
|
|
528
548
|
nodeName?: string;
|
|
529
549
|
parentId?: string;
|
|
550
|
+
parentCode?: string;
|
|
530
551
|
}>;
|
|
531
552
|
apps: Map<string, FakeApp>;
|
|
532
553
|
appGroups: Map<string, FakeAppGroup>;
|
package/dist/workflow.js
CHANGED
|
@@ -531,8 +531,18 @@ export const workflowRoute = (ctx, input) => {
|
|
|
531
531
|
// the work-item table directly instead of resolving each hit's template,
|
|
532
532
|
// and it filters by `participant`, so it can answer "what is pending for
|
|
533
533
|
// user X" — the question an approval actually asks (r14 2026-10-24).
|
|
534
|
+
//
|
|
535
|
+
// r85(issue 10 保真):status=PENDING 不是存储态——反编译
|
|
536
|
+
// BizWorkitemServiceImpl.searchWorkitems(WorkItemQuerySpec):608-619 把
|
|
537
|
+
// PENDING 映射为 state IN (NOTSTARTED, INPROGRESS)(PAUSE 另有实例级子查询,
|
|
538
|
+
// 本 fake 无暂停态可走);其余 status 精确匹配(DRAFT 是可显式查询的存储态)。
|
|
534
539
|
const wanted = String(q.status ?? "PENDING").toUpperCase();
|
|
535
|
-
|
|
540
|
+
const stateOf = (item) => String(item.state ?? "").toUpperCase();
|
|
541
|
+
let rows = [...ctx.state.workItems.values()];
|
|
542
|
+
if (wanted === "PENDING")
|
|
543
|
+
rows = rows.filter((item) => stateOf(item) === "NOTSTARTED" || stateOf(item) === "INPROGRESS");
|
|
544
|
+
else
|
|
545
|
+
rows = rows.filter((item) => stateOf(item) === wanted);
|
|
536
546
|
if (q.participant)
|
|
537
547
|
rows = rows.filter((item) => item.participant === q.participant);
|
|
538
548
|
if (q.workflowCode)
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@stalfh233/omc-fake-platform",
|
|
3
|
-
"version": "0.6.
|
|
3
|
+
"version": "0.6.83",
|
|
4
4
|
"description": "OMC 的内存假 CloudPivot 平台(wire 接缝的第二个适配器)+ HTTP 假服务器——@stalfh233/omc-cli 的测试与 bench 基准基座",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "dist/index.js",
|
|
@@ -18,7 +18,7 @@
|
|
|
18
18
|
"build": "tsc --project tsconfig.build.json"
|
|
19
19
|
},
|
|
20
20
|
"dependencies": {
|
|
21
|
-
"omc-core": "0.6.
|
|
21
|
+
"omc-core": "0.6.83"
|
|
22
22
|
},
|
|
23
23
|
"engines": {
|
|
24
24
|
"node": ">=22.13"
|