create-windy 0.3.19 → 0.4.0
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 +28 -13
- package/dist/cli.js +783 -280
- package/package.json +1 -1
- package/template/.agents/skills/windy-business-module/SKILL.md +34 -10
- package/template/.windy-template.json +2 -2
- package/template/AGENTS.md +18 -8
- package/template/README.md +32 -22
- package/template/apps/server/Dockerfile +1 -0
- package/template/apps/server/package.json +1 -0
- package/template/apps/server/scripts/validate-module-composition-once.ts +4 -0
- package/template/apps/server/scripts/validate-module-composition.ts +28 -0
- package/template/apps/server/src/agent/data-scope-routes.test.ts +20 -5
- package/template/apps/server/src/agent/routes.test.ts +20 -7
- package/template/apps/server/src/agent/routes.ts +14 -0
- package/template/apps/server/src/agent/runtime-bootstrap.ts +22 -6
- package/template/apps/server/src/agent/sandbox-worker.ts +2 -2
- package/template/apps/server/src/agent/unavailable-routes.ts +33 -0
- package/template/apps/server/src/app/server-composition.ts +56 -0
- package/template/apps/server/src/application-services.ts +2 -0
- package/template/apps/server/src/bulk-data/service.ts +14 -0
- package/template/apps/server/src/data-governance/export/authorization-port.ts +1 -1
- package/template/apps/server/src/data-governance/export/postgres-api-fixture.ts +18 -2
- package/template/apps/server/src/data-governance/export/postgres-recovery.integration.test.ts +10 -9
- package/template/apps/server/src/data-governance/export/routes-test-fixture.ts +6 -8
- package/template/apps/server/src/data-governance/user-plaintext-routes.test.ts +4 -2
- package/template/apps/server/src/feature/routes.authorization.test.ts +26 -1
- package/template/apps/server/src/feature/routes.ts +33 -15
- package/template/apps/server/src/foundation-activation.test.ts +60 -0
- package/template/apps/server/src/foundation.ts +64 -5
- package/template/apps/server/src/guards.test.ts +23 -0
- package/template/apps/server/src/guards.ts +12 -0
- package/template/apps/server/src/index.ts +28 -34
- package/template/apps/server/src/installed-business-modules.ts +13 -24
- package/template/apps/server/src/jobs/legacy-adapter.integration.test.ts +1 -0
- package/template/apps/server/src/jobs/legacy-adapter.test.ts +106 -0
- package/template/apps/server/src/jobs/legacy-service-runtime.ts +40 -0
- package/template/apps/server/src/license/activation.test.ts +30 -0
- package/template/apps/server/src/license/activation.ts +26 -0
- package/template/apps/server/src/license/restriction.test.ts +16 -0
- package/template/apps/server/src/license/routes-offline-code.test.ts +6 -2
- package/template/apps/server/src/license/routes.ts +20 -4
- package/template/apps/server/src/license/runtime-service.test.ts +10 -2
- package/template/apps/server/src/module-bootstrap.ts +14 -23
- package/template/apps/server/src/module-composition.test.ts +43 -2
- package/template/apps/server/src/module-composition.ts +29 -0
- package/template/apps/server/src/module-host/durable-context-guard.test.ts +172 -0
- package/template/apps/server/src/module-host/durable-context-unavailable.test.ts +50 -1
- package/template/apps/server/src/module-host/durable-context.test.ts +42 -25
- package/template/apps/server/src/module-host/durable-context.ts +42 -2
- package/template/apps/server/src/module-host/durable-handler-registration.ts +96 -5
- package/template/apps/server/src/module-host/implementation-completeness.test.ts +185 -0
- package/template/apps/server/src/module-host/implementation-completeness.ts +132 -0
- package/template/apps/server/src/module-host/initialize-contracts.ts +14 -0
- package/template/apps/server/src/module-host/initialize.test.ts +78 -2
- package/template/apps/server/src/module-host/initialize.ts +15 -4
- package/template/apps/server/src/module-host/project-attachments.test.ts +92 -0
- package/template/apps/server/src/module-host/project-attachments.ts +58 -0
- package/template/apps/server/src/module-host/project-composition-package.test.ts +186 -0
- package/template/apps/server/src/module-host/project-composition.test.ts +260 -0
- package/template/apps/server/src/module-host/project-composition.ts +311 -0
- package/template/apps/server/src/module-host/request-context.ts +3 -0
- package/template/apps/server/src/module-host/route-declaration.ts +15 -6
- package/template/apps/server/src/module-host/route-installer.test.ts +15 -2
- package/template/apps/server/src/module-host/route-installer.ts +12 -2
- package/template/apps/server/src/module-host/route-registration.test.ts +13 -4
- package/template/apps/server/src/module-host/runtime-composition-compatibility.test.ts +63 -0
- package/template/apps/server/src/module-host/runtime-composition-compatibility.ts +46 -0
- package/template/apps/server/src/module-host/runtime-composition.ts +34 -0
- package/template/apps/server/src/module-host/search-provider-registration.test.ts +64 -0
- package/template/apps/server/src/module-host/search-provider-registration.ts +35 -0
- package/template/apps/server/src/module-host/static-route-authorization.test.ts +99 -0
- package/template/apps/server/src/module-host/static-route-authorization.ts +90 -0
- package/template/apps/server/src/module-host/task-definitions.ts +1 -0
- package/template/apps/server/src/module-host/user-directory-composition.test.ts +4 -1
- package/template/apps/server/src/module-host.test.ts +2 -0
- package/template/apps/server/src/module-preflight.test.ts +289 -0
- package/template/apps/server/src/module-preflight.ts +96 -0
- package/template/apps/server/src/module-runtime-validation.ts +1 -0
- package/template/apps/server/src/platform-app-bootstrap.ts +50 -0
- package/template/apps/server/src/platform-http-runtime.ts +32 -7
- package/template/apps/server/src/route-guards.test.ts +22 -0
- package/template/apps/server/src/route-guards.ts +10 -3
- package/template/apps/server/src/runtime-audit-query.ts +50 -0
- package/template/apps/server/src/runtime-feature.test.ts +46 -0
- package/template/apps/server/src/runtime-feature.ts +5 -0
- package/template/apps/server/src/runtime.ts +10 -49
- package/template/apps/server/src/scheduler/audit-action.test.ts +49 -0
- package/template/apps/server/src/scheduler/audit.ts +1 -1
- package/template/apps/server/src/scheduler/execution-recorder.ts +10 -5
- package/template/apps/server/src/scheduler/recovery-service.test.ts +4 -3
- package/template/apps/server/src/scheduler/service-idle.test.ts +4 -3
- package/template/apps/server/src/scheduler/service.test.ts +1 -0
- package/template/apps/server/src/scheduler/service.ts +18 -21
- package/template/apps/server/src/scheduler/types.ts +5 -1
- package/template/apps/server/src/startup-composition-validation.test.ts +35 -0
- package/template/apps/server/src/startup-composition-validation.ts +54 -0
- package/template/apps/server/src/startup-preflight.test.ts +36 -0
- package/template/apps/server/src/startup-preflight.ts +37 -0
- package/template/apps/server/src/system/audit-routes.test.ts +9 -3
- package/template/apps/server/src/system/department-routes.test.ts +5 -3
- package/template/apps/server/src/system/feature-routes.test.ts +4 -3
- package/template/apps/server/src/system/interface-catalog.test.ts +5 -3
- package/template/apps/server/src/system/interface-catalog.ts +3 -0
- package/template/apps/server/src/system/menu-routes.test.ts +5 -3
- package/template/apps/server/src/system/route-test-runtime.ts +24 -0
- package/template/apps/server/src/system/routes-validation.test.ts +7 -3
- package/template/apps/server/src/system/routes.test.ts +21 -11
- package/template/apps/server/src/system/routes.ts +11 -2
- package/template/apps/server/src/work-order/foundation-modules.test.ts +6 -4
- package/template/apps/server/src/work-order/routes.test.ts +8 -0
- package/template/apps/server/src/work-order/task.test.ts +6 -1
- package/template/apps/web/Dockerfile +5 -0
- package/template/apps/web/package.json +1 -0
- package/template/apps/web/scripts/validate-admin-ui-composition.ts +106 -0
- package/template/apps/web/src/app/web-composition.ts +24 -0
- package/template/apps/web/src/app/web-composition.webtest.ts +15 -0
- package/template/apps/web/src/layout/AppSidebar.vue +8 -1
- package/template/apps/web/src/layout/NavigationSearchDialog.vue +8 -1
- package/template/apps/web/src/layout/navigation.ts +29 -4
- package/template/apps/web/src/layout/navigation.webtest.ts +51 -0
- package/template/apps/web/src/pages/dashboard/dashboard-presenter.ts +6 -1
- package/template/apps/web/src/pages/work-orders/WorkOrderListPage.vue +202 -0
- package/template/apps/web/src/pages/work-orders/WorkOrderListPage.webtest.ts +51 -0
- package/template/apps/web/src/router/admin-extension-loader.ts +44 -0
- package/template/apps/web/src/router/admin-extension-loader.webtest.ts +49 -0
- package/template/apps/web/src/router/admin-ui-composition-plugin.ts +33 -0
- package/template/apps/web/src/router/admin-ui-composition-plugin.webtest.ts +20 -0
- package/template/apps/web/src/router/admin-ui-composition.ts +313 -0
- package/template/apps/web/src/router/admin-ui-composition.webtest.ts +225 -0
- package/template/apps/web/src/router/admin-ui-module-registry-plugin.ts +55 -0
- package/template/apps/web/src/router/admin-ui-module-registry-plugin.webtest.ts +46 -0
- package/template/apps/web/src/router/business-routes.ts +32 -45
- package/template/apps/web/src/router/business-routes.webtest.ts +40 -44
- package/template/apps/web/src/router/index.ts +64 -54
- package/template/apps/web/src/router/manifest-routes.ts +27 -7
- package/template/apps/web/src/router/manifest-routes.webtest.ts +10 -2
- package/template/apps/web/src/router/platform-admin-route-bindings.ts +58 -0
- package/template/apps/web/src/router/reserved-route-paths.ts +14 -0
- package/template/apps/web/src/router/shared-scaffold-neutrality.webtest.ts +10 -4
- package/template/apps/web/src/router/web-composition-host.ts +20 -0
- package/template/apps/web/src/services/work-order-api.ts +16 -0
- package/template/apps/web/src/services/work-order-api.webtest.ts +21 -0
- package/template/apps/web/src/virtual-admin-ui-modules.d.ts +5 -0
- package/template/apps/web/vite.config.ts +22 -1
- package/template/docs/architecture/migration-bundle.md +10 -7
- package/template/docs/architecture/module-manifest-composition.md +85 -3
- package/template/docs/architecture/search-provider-protocol.md +6 -1
- package/template/docs/architecture/server-module-interface.md +70 -7
- package/template/docs/development/business-web-routes.md +53 -50
- package/template/docs/development/module-lifecycle.md +48 -54
- package/template/docs/platform/navigation-registry.md +5 -4
- package/template/package.json +1 -1
- package/template/packages/config/package.json +1 -1
- package/template/packages/database/package.json +1 -1
- package/template/packages/example-work-order/package.json +6 -0
- package/template/packages/example-work-order/src/admin-page.ts +78 -0
- package/template/packages/example-work-order/src/admin.ts +35 -0
- package/template/packages/example-work-order/src/manifest.test.ts +62 -5
- package/template/packages/example-work-order/src/manifest.ts +54 -7
- package/template/packages/example-work-order/src/migration-bundle.ts +8 -0
- package/template/packages/example-work-order/src/server-module.ts +2 -2
- package/template/packages/jobs/package.json +1 -1
- package/template/packages/modules/index.ts +4 -0
- package/template/packages/modules/package.json +3 -2
- package/template/packages/modules/src/admin-ui-entry.ts +8 -0
- package/template/packages/modules/src/admin-ui-manifest.test.ts +52 -0
- package/template/packages/modules/src/admin-ui-manifest.ts +53 -0
- package/template/packages/modules/src/capability-audit-validation.test.ts +127 -0
- package/template/packages/modules/src/capability-audit-validation.ts +38 -0
- package/template/packages/modules/src/capability-guard-validation.ts +148 -0
- package/template/packages/modules/src/capability-key-validation.test.ts +150 -0
- package/template/packages/modules/src/composition-fixtures.test-support.ts +7 -5
- package/template/packages/modules/src/composition.test.ts +74 -9
- package/template/packages/modules/src/composition.ts +8 -0
- package/template/packages/modules/src/manifest.ts +1 -0
- package/template/packages/modules/src/migration-bundle-validation.test.ts +23 -0
- package/template/packages/modules/src/module-host-range.test.ts +57 -0
- package/template/packages/modules/src/module-host-range.ts +125 -0
- package/template/packages/modules/src/project-module-assembly.test.ts +133 -0
- package/template/packages/modules/src/project-module-assembly.ts +126 -0
- package/template/packages/modules/src/system-admin-routes.ts +6 -5
- package/template/packages/modules/src/system-admin-ui-catalog.ts +72 -0
- package/template/packages/modules/src/system-agent-tools.ts +2 -2
- package/template/packages/modules/src/system-api-binding.ts +43 -9
- package/template/packages/modules/src/system-api-control-plane.ts +202 -0
- package/template/packages/modules/src/system-api-data-governance.ts +4 -2
- package/template/packages/modules/src/system-api-operational.ts +57 -8
- package/template/packages/modules/src/system-api-permissions.ts +115 -21
- package/template/packages/modules/src/system-api-watermark.ts +3 -0
- package/template/packages/modules/src/system-audit-actions.ts +7 -0
- package/template/packages/modules/src/system-data-governance.ts +5 -2
- package/template/packages/modules/src/system-features.ts +31 -0
- package/template/packages/modules/src/system-governed-export-bindings.ts +8 -4
- package/template/packages/modules/src/system-module-catalog.test.ts +39 -4
- package/template/packages/modules/src/system-module-catalog.ts +68 -7
- package/template/packages/modules/src/system-module-tasks.ts +8 -1
- package/template/packages/modules/src/system-modules-access.test.ts +4 -0
- package/template/packages/modules/src/system-modules.test.ts +10 -2
- package/template/packages/modules/src/system-modules.ts +6 -5
- package/template/packages/modules/src/system-permissions.ts +4 -0
- package/template/packages/modules/user/module.ts +19 -2
- package/template/packages/server-sdk/index.ts +8 -0
- package/template/packages/server-sdk/package.json +2 -1
- package/template/packages/server-sdk/src/durable-handler.ts +16 -1
- package/template/packages/server-sdk/src/module-adapter.test.ts +44 -0
- package/template/packages/server-sdk/src/module-adapter.ts +59 -0
- package/template/packages/server-sdk/src/route-definition.ts +3 -2
- package/template/packages/shared/package.json +1 -1
- package/template/packages/shared/src/audit.test.ts +7 -0
- package/template/packages/shared/src/audit.ts +16 -0
- package/template/packages/shared/src/migration-bundle-validation.ts +9 -11
- package/template/packages/shared/src/rbac.ts +2 -0
- package/template/apps/web/src/app/business-routes.ts +0 -22
|
@@ -10,34 +10,69 @@ import { watermarkApiPermissionBindings } from "./system-api-watermark.js";
|
|
|
10
10
|
import { dataGovernanceApiPermissionBindings } from "./system-api-data-governance.js";
|
|
11
11
|
// @windy-module system.data-governance end
|
|
12
12
|
import { systemOperationalApiPermissionBindings } from "./system-api-operational.js";
|
|
13
|
+
import { systemControlPlaneApiPermissionBindings } from "./system-api-control-plane.js";
|
|
13
14
|
|
|
14
15
|
export function systemApiPermissionBindings(): ApiPermissionBinding[] {
|
|
15
16
|
return [
|
|
17
|
+
...systemControlPlaneApiPermissionBindings(),
|
|
16
18
|
binding(
|
|
17
19
|
"GET",
|
|
18
20
|
"/api/admin/bootstrap",
|
|
19
21
|
"system.admin.access",
|
|
20
22
|
"system.admin",
|
|
23
|
+
"data.read",
|
|
24
|
+
),
|
|
25
|
+
binding(
|
|
26
|
+
"GET",
|
|
27
|
+
"/api/foundation",
|
|
28
|
+
"system.menu.read",
|
|
29
|
+
"system.rbac",
|
|
30
|
+
undefined,
|
|
31
|
+
true,
|
|
21
32
|
),
|
|
22
|
-
binding("GET", "/api/foundation", "system.menu.read", "system.rbac", true),
|
|
23
33
|
// @windy-module system.search begin
|
|
24
34
|
binding(
|
|
25
35
|
"GET",
|
|
26
36
|
"/api/search/providers",
|
|
27
37
|
"system.search.read",
|
|
28
38
|
"system.search",
|
|
39
|
+
"data.read",
|
|
40
|
+
),
|
|
41
|
+
binding(
|
|
42
|
+
"POST",
|
|
43
|
+
"/api/search",
|
|
44
|
+
"system.search.read",
|
|
45
|
+
"system.search",
|
|
46
|
+
"search.query",
|
|
29
47
|
),
|
|
30
|
-
binding("POST", "/api/search", "system.search.read", "system.search"),
|
|
31
48
|
// @windy-module system.search end
|
|
32
49
|
// @windy-module system.agent begin
|
|
33
|
-
binding(
|
|
34
|
-
|
|
35
|
-
|
|
50
|
+
binding(
|
|
51
|
+
"GET",
|
|
52
|
+
MCP_API_PATH,
|
|
53
|
+
"system.agent.read",
|
|
54
|
+
"system.agent",
|
|
55
|
+
"agent.mcp.access",
|
|
56
|
+
),
|
|
57
|
+
binding(
|
|
58
|
+
"POST",
|
|
59
|
+
MCP_API_PATH,
|
|
60
|
+
"system.agent.read",
|
|
61
|
+
"system.agent",
|
|
62
|
+
"agent.mcp.access",
|
|
63
|
+
),
|
|
64
|
+
binding(
|
|
65
|
+
"DELETE",
|
|
66
|
+
MCP_API_PATH,
|
|
67
|
+
"system.agent.read",
|
|
68
|
+
"system.agent",
|
|
69
|
+
"agent.mcp.access",
|
|
70
|
+
),
|
|
36
71
|
// @windy-module system.agent end
|
|
37
72
|
...resourceBindings({
|
|
38
73
|
path: "users",
|
|
39
74
|
permissionResource: "user",
|
|
40
|
-
featureKey: "system.
|
|
75
|
+
featureKey: "system.user",
|
|
41
76
|
backupExport: false,
|
|
42
77
|
}),
|
|
43
78
|
// @windy-module system.data-governance begin
|
|
@@ -47,72 +82,121 @@ export function systemApiPermissionBindings(): ApiPermissionBinding[] {
|
|
|
47
82
|
"POST",
|
|
48
83
|
"/api/auth/users/:id/password",
|
|
49
84
|
"system.user.manage",
|
|
50
|
-
"system.
|
|
85
|
+
"system.user",
|
|
86
|
+
"auth.password.update",
|
|
51
87
|
),
|
|
52
88
|
...resourceBindings({
|
|
53
89
|
path: "roles",
|
|
54
90
|
permissionResource: "role",
|
|
55
|
-
featureKey: "system.
|
|
91
|
+
featureKey: "system.role",
|
|
56
92
|
}),
|
|
57
93
|
...resourceBindings({
|
|
58
94
|
path: "departments",
|
|
59
95
|
permissionResource: "department",
|
|
60
|
-
featureKey: "system.
|
|
96
|
+
featureKey: "system.department",
|
|
61
97
|
}),
|
|
62
98
|
binding(
|
|
63
99
|
"POST",
|
|
64
100
|
"/api/system/departments/quick",
|
|
65
101
|
"system.department.create",
|
|
66
|
-
"system.
|
|
102
|
+
"system.department",
|
|
103
|
+
"crud.create",
|
|
67
104
|
),
|
|
68
105
|
binding(
|
|
69
106
|
"POST",
|
|
70
107
|
"/api/system/departments/:id/transition",
|
|
71
108
|
"system.department.manage",
|
|
72
|
-
"system.
|
|
109
|
+
"system.department",
|
|
110
|
+
"organization.department.transition",
|
|
111
|
+
),
|
|
112
|
+
binding(
|
|
113
|
+
"GET",
|
|
114
|
+
"/api/system/menus",
|
|
115
|
+
"system.menu.read",
|
|
116
|
+
"system.menu",
|
|
117
|
+
"data.read",
|
|
73
118
|
),
|
|
74
|
-
binding("GET", "/api/system/menus", "system.menu.read", "system.rbac"),
|
|
75
119
|
binding(
|
|
76
120
|
"GET",
|
|
77
121
|
"/api/system/menus/export",
|
|
78
122
|
"system.menu.read",
|
|
79
|
-
"system.
|
|
123
|
+
"system.menu",
|
|
124
|
+
"data.export",
|
|
125
|
+
),
|
|
126
|
+
binding(
|
|
127
|
+
"GET",
|
|
128
|
+
"/api/system/menus/:id",
|
|
129
|
+
"system.menu.read",
|
|
130
|
+
"system.menu",
|
|
131
|
+
"data.read",
|
|
80
132
|
),
|
|
81
|
-
binding("GET", "/api/system/menus/:id", "system.menu.read", "system.rbac"),
|
|
82
133
|
binding(
|
|
83
134
|
"PUT",
|
|
84
135
|
"/api/system/menus/:id/placement",
|
|
85
136
|
"system.menu.manage",
|
|
86
|
-
"system.
|
|
137
|
+
"system.menu",
|
|
138
|
+
"menu.structure.update",
|
|
87
139
|
),
|
|
88
140
|
binding(
|
|
89
141
|
"PUT",
|
|
90
142
|
"/api/system/menus/placements",
|
|
91
143
|
"system.menu.manage",
|
|
92
|
-
"system.
|
|
144
|
+
"system.menu",
|
|
145
|
+
"menu.structure.update",
|
|
93
146
|
),
|
|
94
147
|
...resourceBindings({
|
|
95
148
|
path: "dictionaries",
|
|
96
149
|
permissionResource: "dict",
|
|
97
|
-
featureKey: "system.
|
|
150
|
+
featureKey: "system.dict",
|
|
98
151
|
}),
|
|
99
152
|
// @windy-module system.license begin
|
|
100
153
|
...resourceBindings({
|
|
101
154
|
path: "licenses",
|
|
102
155
|
permissionResource: "license",
|
|
103
156
|
featureKey: "system.license",
|
|
157
|
+
auditActions: {
|
|
158
|
+
import: "license.update",
|
|
159
|
+
create: "license.update",
|
|
160
|
+
update: "license.update",
|
|
161
|
+
delete: "license.update",
|
|
162
|
+
},
|
|
104
163
|
}),
|
|
105
164
|
// @windy-module system.license end
|
|
106
|
-
binding(
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
165
|
+
binding(
|
|
166
|
+
"GET",
|
|
167
|
+
"/api/system/features",
|
|
168
|
+
"system.feature.read",
|
|
169
|
+
"system.feature",
|
|
170
|
+
"data.read",
|
|
171
|
+
),
|
|
172
|
+
binding(
|
|
173
|
+
"GET",
|
|
174
|
+
"/api/system/features/export",
|
|
175
|
+
"system.feature.read",
|
|
176
|
+
"system.feature",
|
|
177
|
+
"data.export",
|
|
178
|
+
),
|
|
179
|
+
binding(
|
|
180
|
+
"GET",
|
|
181
|
+
"/api/system/features/:id",
|
|
182
|
+
"system.feature.read",
|
|
183
|
+
"system.feature",
|
|
184
|
+
"data.read",
|
|
185
|
+
),
|
|
186
|
+
binding(
|
|
187
|
+
"PUT",
|
|
188
|
+
"/api/system/features/:id",
|
|
189
|
+
"system.feature.manage",
|
|
190
|
+
"system.feature",
|
|
191
|
+
"feature.update",
|
|
192
|
+
),
|
|
110
193
|
// @windy-module system.settings begin
|
|
111
194
|
binding(
|
|
112
195
|
"GET",
|
|
113
196
|
"/api/platform/branding",
|
|
114
197
|
"system.settings.read",
|
|
115
198
|
undefined,
|
|
199
|
+
undefined,
|
|
116
200
|
true,
|
|
117
201
|
),
|
|
118
202
|
binding(
|
|
@@ -120,12 +204,14 @@ export function systemApiPermissionBindings(): ApiPermissionBinding[] {
|
|
|
120
204
|
"/api/system/settings/branding",
|
|
121
205
|
"system.settings.read",
|
|
122
206
|
"system.settings",
|
|
207
|
+
"data.read",
|
|
123
208
|
),
|
|
124
209
|
binding(
|
|
125
210
|
"PUT",
|
|
126
211
|
"/api/system/settings/branding",
|
|
127
212
|
"system.settings.manage",
|
|
128
213
|
"system.settings",
|
|
214
|
+
"config.update",
|
|
129
215
|
),
|
|
130
216
|
...watermarkApiPermissionBindings(),
|
|
131
217
|
// @windy-module system.settings end
|
|
@@ -135,24 +221,28 @@ export function systemApiPermissionBindings(): ApiPermissionBinding[] {
|
|
|
135
221
|
"/api/system/configurations",
|
|
136
222
|
"system.config.read",
|
|
137
223
|
"system.config",
|
|
224
|
+
"data.read",
|
|
138
225
|
),
|
|
139
226
|
binding(
|
|
140
227
|
"GET",
|
|
141
228
|
"/api/system/configurations/:moduleKey/versions",
|
|
142
229
|
"system.config.read",
|
|
143
230
|
"system.config",
|
|
231
|
+
"data.read",
|
|
144
232
|
),
|
|
145
233
|
binding(
|
|
146
234
|
"POST",
|
|
147
235
|
"/api/system/configurations/:moduleKey/versions",
|
|
148
236
|
"system.config.manage",
|
|
149
237
|
"system.config",
|
|
238
|
+
"config.update",
|
|
150
239
|
),
|
|
151
240
|
binding(
|
|
152
241
|
"POST",
|
|
153
242
|
"/api/system/configurations/:moduleKey/versions/:version/rollback",
|
|
154
243
|
"system.config.manage",
|
|
155
244
|
"system.config",
|
|
245
|
+
"config.rollback",
|
|
156
246
|
),
|
|
157
247
|
// @windy-module system.configuration end
|
|
158
248
|
binding(
|
|
@@ -160,12 +250,14 @@ export function systemApiPermissionBindings(): ApiPermissionBinding[] {
|
|
|
160
250
|
"/api/system/profile",
|
|
161
251
|
"system.profile.read",
|
|
162
252
|
"system.profile",
|
|
253
|
+
"data.read",
|
|
163
254
|
),
|
|
164
255
|
binding(
|
|
165
256
|
"PUT",
|
|
166
257
|
"/api/system/profile",
|
|
167
258
|
"system.profile.manage",
|
|
168
259
|
"system.profile",
|
|
260
|
+
"user.profile.update",
|
|
169
261
|
),
|
|
170
262
|
// @windy-module system.audit begin
|
|
171
263
|
binding(
|
|
@@ -173,12 +265,14 @@ export function systemApiPermissionBindings(): ApiPermissionBinding[] {
|
|
|
173
265
|
"/api/system/audit-logs",
|
|
174
266
|
"system.audit.read",
|
|
175
267
|
"system.audit",
|
|
268
|
+
"data.read",
|
|
176
269
|
),
|
|
177
270
|
binding(
|
|
178
271
|
"GET",
|
|
179
272
|
"/api/system/audit-logs/export",
|
|
180
273
|
"system.audit.read",
|
|
181
274
|
"system.audit",
|
|
275
|
+
"data.export",
|
|
182
276
|
),
|
|
183
277
|
// @windy-module system.audit end
|
|
184
278
|
...systemOperationalApiPermissionBindings(),
|
|
@@ -8,6 +8,7 @@ export function watermarkApiPermissionBindings(): ApiPermissionBinding[] {
|
|
|
8
8
|
"/api/platform/watermark-policy",
|
|
9
9
|
"system.watermark.read",
|
|
10
10
|
undefined,
|
|
11
|
+
undefined,
|
|
11
12
|
true,
|
|
12
13
|
),
|
|
13
14
|
binding(
|
|
@@ -15,12 +16,14 @@ export function watermarkApiPermissionBindings(): ApiPermissionBinding[] {
|
|
|
15
16
|
"/api/system/settings/watermark",
|
|
16
17
|
"system.watermark.read",
|
|
17
18
|
"system.watermark",
|
|
19
|
+
"data.read",
|
|
18
20
|
),
|
|
19
21
|
binding(
|
|
20
22
|
"PUT",
|
|
21
23
|
"/api/system/settings/watermark",
|
|
22
24
|
"system.watermark.manage",
|
|
23
25
|
"system.watermark",
|
|
26
|
+
"config.update",
|
|
24
27
|
),
|
|
25
28
|
];
|
|
26
29
|
}
|
|
@@ -8,6 +8,9 @@ export const systemAuditActions: ModuleManifest["auditActions"] = [
|
|
|
8
8
|
"crud.create",
|
|
9
9
|
"crud.update",
|
|
10
10
|
"crud.delete",
|
|
11
|
+
"data.read",
|
|
12
|
+
"data.import",
|
|
13
|
+
"data.export",
|
|
11
14
|
{
|
|
12
15
|
key: "system.user-directory.query",
|
|
13
16
|
label: "查询业务用户目录",
|
|
@@ -19,6 +22,7 @@ export const systemAuditActions: ModuleManifest["auditActions"] = [
|
|
|
19
22
|
// @windy-module system.configuration end
|
|
20
23
|
// @windy-module system.license begin
|
|
21
24
|
"license.verify",
|
|
25
|
+
"license.update",
|
|
22
26
|
// @windy-module system.license end
|
|
23
27
|
"feature.update",
|
|
24
28
|
"menu.structure.update",
|
|
@@ -73,12 +77,15 @@ export const systemAuditActions: ModuleManifest["auditActions"] = [
|
|
|
73
77
|
// @windy-module system.bulk-data end
|
|
74
78
|
// @windy-module system.storage begin
|
|
75
79
|
"file.upload.create",
|
|
80
|
+
"file.upload.part.write",
|
|
76
81
|
"file.upload.complete",
|
|
77
82
|
"file.upload.abort",
|
|
78
83
|
"file.download",
|
|
79
84
|
// @windy-module system.storage end
|
|
80
85
|
// @windy-module system.agent begin
|
|
86
|
+
"agent.mcp.access",
|
|
81
87
|
"agent.tool.execute",
|
|
88
|
+
"agent.operation.execute",
|
|
82
89
|
// @windy-module system.agent end
|
|
83
90
|
"security.denied",
|
|
84
91
|
"system.error",
|
|
@@ -1,11 +1,14 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import {
|
|
2
|
+
featureKey,
|
|
3
|
+
type DataGovernancePolicyDefinition,
|
|
4
|
+
} from "@southwind-ai/shared";
|
|
2
5
|
|
|
3
6
|
export const systemDataPolicies: DataGovernancePolicyDefinition[] = [
|
|
4
7
|
{
|
|
5
8
|
key: "system.user.fields",
|
|
6
9
|
resourceType: "system.user",
|
|
7
10
|
version: "1",
|
|
8
|
-
featureKey: featureKey("system.
|
|
11
|
+
featureKey: featureKey("system.user"),
|
|
9
12
|
readPermissionKey: "system.user.read",
|
|
10
13
|
revealPermissionKey: "system.user.reveal",
|
|
11
14
|
exportPermissionKey: "system.user.export",
|
|
@@ -12,11 +12,31 @@ export const systemFeatures: ModuleManifest["features"] = [
|
|
|
12
12
|
"Windy 管理面",
|
|
13
13
|
"平台管理员、运维与授权审计人员使用的控制面准入能力。",
|
|
14
14
|
),
|
|
15
|
+
feature("system.runtime", "运行状态", "健康、就绪与指标等部署运行状态入口。"),
|
|
16
|
+
feature(
|
|
17
|
+
"system.auth",
|
|
18
|
+
"认证恢复",
|
|
19
|
+
"登录、登出、会话探测与密码策略等不可关闭的认证恢复入口。",
|
|
20
|
+
),
|
|
15
21
|
feature(
|
|
16
22
|
"system.rbac",
|
|
17
23
|
"RBAC 权限链路",
|
|
18
24
|
"用户、角色、权限点与数据范围的统一访问控制链路。",
|
|
19
25
|
),
|
|
26
|
+
rbacFeature("system.user", "用户管理", "平台用户账号与敏感资料治理。"),
|
|
27
|
+
rbacFeature("system.role", "角色与权限", "角色、授权和数据范围策略管理。"),
|
|
28
|
+
rbacFeature(
|
|
29
|
+
"system.department",
|
|
30
|
+
"部门组织",
|
|
31
|
+
"部门层级、负责人和组织关系管理。",
|
|
32
|
+
),
|
|
33
|
+
rbacFeature("system.menu", "菜单管理", "平台菜单目录与入口编排。"),
|
|
34
|
+
rbacFeature("system.dict", "字典管理", "业务字典类型与条目管理。"),
|
|
35
|
+
feature(
|
|
36
|
+
"system.feature",
|
|
37
|
+
"功能开关管理",
|
|
38
|
+
"查看和恢复平台 Feature 状态的核心控制面能力。",
|
|
39
|
+
),
|
|
20
40
|
feature(
|
|
21
41
|
"system.user-directory",
|
|
22
42
|
"业务用户目录",
|
|
@@ -148,3 +168,14 @@ function feature(
|
|
|
148
168
|
stage: "stable",
|
|
149
169
|
};
|
|
150
170
|
}
|
|
171
|
+
|
|
172
|
+
function rbacFeature(
|
|
173
|
+
key: string,
|
|
174
|
+
label: string,
|
|
175
|
+
description: string,
|
|
176
|
+
): ModuleManifest["features"][number] {
|
|
177
|
+
return {
|
|
178
|
+
...feature(key, label, description),
|
|
179
|
+
dependencies: [featureKey("system.rbac")],
|
|
180
|
+
};
|
|
181
|
+
}
|
|
@@ -7,25 +7,29 @@ export function governedUserExportBindings(): ApiPermissionBinding[] {
|
|
|
7
7
|
"POST",
|
|
8
8
|
"/api/system/users/exports",
|
|
9
9
|
"system.user.export",
|
|
10
|
-
"system.
|
|
10
|
+
"system.user",
|
|
11
|
+
"data.governed-export.request",
|
|
11
12
|
),
|
|
12
13
|
binding(
|
|
13
14
|
"GET",
|
|
14
15
|
"/api/system/users/exports/:id",
|
|
15
16
|
"system.user.export",
|
|
16
|
-
"system.
|
|
17
|
+
"system.user",
|
|
18
|
+
"data.read",
|
|
17
19
|
),
|
|
18
20
|
binding(
|
|
19
21
|
"POST",
|
|
20
22
|
"/api/system/users/exports/:id/cancel",
|
|
21
23
|
"system.user.export",
|
|
22
|
-
"system.
|
|
24
|
+
"system.user",
|
|
25
|
+
"data.governed-export.cancel",
|
|
23
26
|
),
|
|
24
27
|
binding(
|
|
25
28
|
"GET",
|
|
26
29
|
"/api/system/users/exports/:id/download",
|
|
27
30
|
"system.user.export",
|
|
28
|
-
"system.
|
|
31
|
+
"system.user",
|
|
32
|
+
"data.governed-export.download",
|
|
29
33
|
),
|
|
30
34
|
];
|
|
31
35
|
}
|
|
@@ -2,8 +2,11 @@ import { describe, expect, test } from "bun:test";
|
|
|
2
2
|
import { validateModuleComposition } from "./composition.js";
|
|
3
3
|
import { composeModuleMenus } from "./menu-composition.js";
|
|
4
4
|
import {
|
|
5
|
+
// @windy-module system.operations begin
|
|
6
|
+
systemModuleManifest as operationsModuleManifest,
|
|
7
|
+
// @windy-module system.operations end
|
|
5
8
|
// @windy-module system.data-governance begin
|
|
6
|
-
systemModuleManifest,
|
|
9
|
+
systemModuleManifest as governanceModuleManifest,
|
|
7
10
|
// @windy-module system.data-governance end
|
|
8
11
|
systemModuleManifests,
|
|
9
12
|
} from "./system-module-catalog.js";
|
|
@@ -101,10 +104,31 @@ describe("系统能力模块目录", () => {
|
|
|
101
104
|
);
|
|
102
105
|
});
|
|
103
106
|
|
|
107
|
+
test("Manifest 记录运行时真实模块依赖", () => {
|
|
108
|
+
// @windy-module system.operations begin
|
|
109
|
+
expect(operationsModuleManifest("system.operations").dependencies).toEqual([
|
|
110
|
+
"system",
|
|
111
|
+
"system.configuration",
|
|
112
|
+
]);
|
|
113
|
+
// @windy-module system.operations end
|
|
114
|
+
// @windy-module system.data-governance begin
|
|
115
|
+
expect(
|
|
116
|
+
governanceModuleManifest("system.data-governance").dependencies,
|
|
117
|
+
).toEqual([
|
|
118
|
+
"system",
|
|
119
|
+
"system.identity",
|
|
120
|
+
"system.audit",
|
|
121
|
+
"system.storage",
|
|
122
|
+
"system.workflow",
|
|
123
|
+
"system.scheduler",
|
|
124
|
+
]);
|
|
125
|
+
// @windy-module system.data-governance end
|
|
126
|
+
});
|
|
127
|
+
|
|
104
128
|
// @windy-module system.data-governance begin
|
|
105
129
|
test("能力声明归属到对应模块而不是继续挂在 system 聚合项", () => {
|
|
106
|
-
const workflow =
|
|
107
|
-
const identity =
|
|
130
|
+
const workflow = governanceModuleManifest("system.workflow");
|
|
131
|
+
const identity = governanceModuleManifest("system.identity");
|
|
108
132
|
|
|
109
133
|
expect(workflow.features.map(({ key }) => key)).toEqual([
|
|
110
134
|
"system.workflow",
|
|
@@ -119,6 +143,17 @@ describe("系统能力模块目录", () => {
|
|
|
119
143
|
expect(identity.features.map(({ key }) => key)).toContain(
|
|
120
144
|
"system.user-directory",
|
|
121
145
|
);
|
|
146
|
+
for (const key of [
|
|
147
|
+
"system.user",
|
|
148
|
+
"system.role",
|
|
149
|
+
"system.department",
|
|
150
|
+
"system.menu",
|
|
151
|
+
"system.dict",
|
|
152
|
+
]) {
|
|
153
|
+
expect(identity.features.find((feature) => feature.key === key)).toEqual(
|
|
154
|
+
expect.objectContaining({ dependencies: ["system.rbac"] }),
|
|
155
|
+
);
|
|
156
|
+
}
|
|
122
157
|
expect(identity.permissions.map(({ key }) => key)).toContain(
|
|
123
158
|
"system.user-directory.read",
|
|
124
159
|
);
|
|
@@ -133,7 +168,7 @@ describe("系统能力模块目录", () => {
|
|
|
133
168
|
),
|
|
134
169
|
).toContain("system.user-directory.query");
|
|
135
170
|
expect(
|
|
136
|
-
|
|
171
|
+
governanceModuleManifest("system.data-governance").dataPolicies?.map(
|
|
137
172
|
({ key }) => key,
|
|
138
173
|
),
|
|
139
174
|
).toEqual(["system.user.fields"]);
|