@stalfh233/omc-fake-platform 0.0.0-stage → 0.4.39

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/README.md CHANGED
@@ -1,3 +1,3 @@
1
- # Temporary Holding Version
1
+ # omc-fake-platform
2
2
 
3
- This version is a temporary placeholder for this package. An operational version to replace this has been submitted for review and is awaiting a staged release.
3
+ OMC 的内存假 CloudPivot 平台(FakeCloudPivot)与 HTTP 假服务器——`@stalfh233/omc-cli` 的 1190 项测试与 `omc bench` 基准全部跑在其上,不触碰真实平台。wire 接缝的两个适配器:真实 HTTP 平台(omc-core)与本假平台共用 core 中的平台 wire 事实。
package/dist/app.d.ts ADDED
@@ -0,0 +1,3 @@
1
+ import { type LaneRoute } from "./state.js";
2
+ /** app-management lane: application package CRUD. Twin of src/lanes/app.ts. */
3
+ export declare const appRoute: LaneRoute;
package/dist/app.js ADDED
@@ -0,0 +1,44 @@
1
+ import { NOT_HANDLED } from "./state.js";
2
+ /** app-management lane: application package CRUD. Twin of src/lanes/app.ts. */
3
+ export const appRoute = (ctx, input) => {
4
+ const q = input.query ?? {};
5
+ const body = (input.body ?? {});
6
+ switch (input.path) {
7
+ case "/api/api/app/apppackage/list":
8
+ return ctx.options.applicationList ?? [...ctx.state.apps.values()].map((app) => ({ appCode: app.code, appName: app.name, id: app.id, groupId: app.groupId, published: app.published !== false }));
9
+ case "/api/api/app/apppackage/list_all_group":
10
+ return [...ctx.state.appGroups.values()].map((group) => ({
11
+ id: group.id,
12
+ code: group.code,
13
+ name: group.name,
14
+ children: [...ctx.state.apps.values()].filter((app) => app.groupId === group.id).map((app) => ({ id: app.id, code: app.code, name: app.name, groupId: app.groupId })),
15
+ }));
16
+ case "/api/api/app/apppackage/create": {
17
+ const code = String(body.code);
18
+ ctx.state.apps.set(code, { id: `app-${ctx.state.apps.size + 1}`, code, name: String(body.name ?? code), groupId: String(body.groupId ?? [...ctx.state.appGroups.keys()][0] ?? "group-1") });
19
+ return null;
20
+ }
21
+ case "/api/api/app/apppackage/get": {
22
+ const app = [...ctx.state.apps.values()].find((row) => row.code === q.appCode);
23
+ return app ? { id: app.id, code: app.code, name: app.name, name_i18n: JSON.stringify({ "zh-CN": app.name }), groupId: app.groupId, enabled: true } : null;
24
+ }
25
+ case "/api/api/app/apppackage/update": {
26
+ // AppIntegrationFacadeImpl.updateAppPackage: id-required whole-record
27
+ // update; explicit groupId honored; blank groupId would be forced to
28
+ // the "default" group; enabled !== true wipes workflow favorites.
29
+ const target = [...ctx.state.apps.values()].find((row) => row.id === body.id);
30
+ if (target) {
31
+ if (typeof body.groupId === "string" && body.groupId)
32
+ target.groupId = body.groupId;
33
+ if (typeof body.name === "string" && body.name)
34
+ target.name = body.name;
35
+ }
36
+ return null;
37
+ }
38
+ case "/api/api/app/apppackage/delete":
39
+ ctx.state.apps.delete(String(q.appCode));
40
+ return null;
41
+ default:
42
+ return NOT_HANDLED;
43
+ }
44
+ };
@@ -0,0 +1,2 @@
1
+ import { type LaneRoute } from "./state.js";
2
+ export declare const b2Route: LaneRoute;