@stalfh233/omc-fake-platform 0.6.80 → 0.6.82

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/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,
@@ -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/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
- let rows = [...ctx.state.workItems.values()].filter((item) => String(item.state ?? "").toUpperCase() === wanted);
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.80",
3
+ "version": "0.6.82",
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.80"
21
+ "omc-core": "0.6.82"
22
22
  },
23
23
  "engines": {
24
24
  "node": ">=22.13"