@stalfh233/omc-fake-platform 0.4.86 → 0.4.87

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.
Files changed (2) hide show
  1. package/dist/workflow.js +20 -0
  2. package/package.json +2 -2
package/dist/workflow.js CHANGED
@@ -372,6 +372,26 @@ export const workflowRoute = (ctx, input) => {
372
372
  content: rows.slice(start, start + size).map(toWorkItemVO),
373
373
  };
374
374
  }
375
+ case "/api/api/runtime/workflow/list_workitems": {
376
+ // The JPA-spec face (WorkflowInstanceController.listWorkItems): it queri
377
+ // the work-item table directly instead of resolving each hit's template,
378
+ // and it filters by `participant`, so it can answer "what is pending for
379
+ // user X" — the question an approval actually asks (r14 2026-10-24).
380
+ const wanted = String(q.status ?? "PENDING").toUpperCase();
381
+ let rows = [...ctx.state.workItems.values()].filter((item) => String(item.state ?? "").toUpperCase() === wanted);
382
+ if (q.participant)
383
+ rows = rows.filter((item) => item.participant === q.participant);
384
+ if (q.workflowCode)
385
+ rows = rows.filter((item) => item.workflowCode === q.workflowCode);
386
+ const size = Number(q.size ?? 10);
387
+ const page = Number(q.page ?? 0);
388
+ const start = page * size;
389
+ return {
390
+ totalElements: rows.length,
391
+ totalPages: size > 0 ? Math.ceil(rows.length / size) : 0,
392
+ content: rows.slice(start, start + size).map(toWorkItemVO),
393
+ };
394
+ }
375
395
  case "/api/api/runtime/workflow/getBizObjectByWfInstanceId": {
376
396
  const instanceId = String(q.workflowInstanceId ?? "");
377
397
  const item = [...ctx.state.workItems.values()].find((candidate) => candidate.instanceId === instanceId);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@stalfh233/omc-fake-platform",
3
- "version": "0.4.86",
3
+ "version": "0.4.87",
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.4.86"
21
+ "omc-core": "0.4.87"
22
22
  },
23
23
  "engines": {
24
24
  "node": ">=22.13"