create-windy 0.3.18 → 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.
Files changed (216) hide show
  1. package/README.md +28 -13
  2. package/dist/cli.js +788 -280
  3. package/package.json +1 -1
  4. package/template/.agents/skills/windy-business-module/SKILL.md +34 -10
  5. package/template/.windy-template.json +2 -2
  6. package/template/AGENTS.md +18 -8
  7. package/template/README.md +32 -22
  8. package/template/apps/agent-server/src/southwind_agent_server/adk_debug.py +38 -5
  9. package/template/apps/agent-server/tests/test_adk_debug_result_polling.py +139 -0
  10. package/template/apps/server/Dockerfile +1 -0
  11. package/template/apps/server/package.json +1 -0
  12. package/template/apps/server/scripts/validate-module-composition-once.ts +4 -0
  13. package/template/apps/server/scripts/validate-module-composition.ts +28 -0
  14. package/template/apps/server/src/agent/data-scope-routes.test.ts +20 -5
  15. package/template/apps/server/src/agent/routes.test.ts +20 -7
  16. package/template/apps/server/src/agent/routes.ts +14 -0
  17. package/template/apps/server/src/agent/runtime-bootstrap.ts +22 -6
  18. package/template/apps/server/src/agent/sandbox-worker.ts +2 -2
  19. package/template/apps/server/src/agent/unavailable-routes.ts +33 -0
  20. package/template/apps/server/src/app/server-composition.ts +56 -0
  21. package/template/apps/server/src/application-services.ts +2 -0
  22. package/template/apps/server/src/bulk-data/service.ts +14 -0
  23. package/template/apps/server/src/data-governance/export/authorization-port.ts +1 -1
  24. package/template/apps/server/src/data-governance/export/postgres-api-fixture.ts +18 -2
  25. package/template/apps/server/src/data-governance/export/postgres-recovery.integration.test.ts +10 -9
  26. package/template/apps/server/src/data-governance/export/routes-test-fixture.ts +6 -8
  27. package/template/apps/server/src/data-governance/user-plaintext-routes.test.ts +4 -2
  28. package/template/apps/server/src/feature/routes.authorization.test.ts +26 -1
  29. package/template/apps/server/src/feature/routes.ts +33 -15
  30. package/template/apps/server/src/foundation-activation.test.ts +60 -0
  31. package/template/apps/server/src/foundation.ts +64 -5
  32. package/template/apps/server/src/guards.test.ts +23 -0
  33. package/template/apps/server/src/guards.ts +12 -0
  34. package/template/apps/server/src/index.ts +28 -34
  35. package/template/apps/server/src/installed-business-modules.ts +13 -24
  36. package/template/apps/server/src/jobs/legacy-adapter.integration.test.ts +1 -0
  37. package/template/apps/server/src/jobs/legacy-adapter.test.ts +106 -0
  38. package/template/apps/server/src/jobs/legacy-service-runtime.ts +40 -0
  39. package/template/apps/server/src/license/activation.test.ts +30 -0
  40. package/template/apps/server/src/license/activation.ts +26 -0
  41. package/template/apps/server/src/license/restriction.test.ts +16 -0
  42. package/template/apps/server/src/license/routes-offline-code.test.ts +6 -2
  43. package/template/apps/server/src/license/routes.ts +20 -4
  44. package/template/apps/server/src/license/runtime-service.test.ts +10 -2
  45. package/template/apps/server/src/module-bootstrap.ts +14 -23
  46. package/template/apps/server/src/module-composition.test.ts +43 -2
  47. package/template/apps/server/src/module-composition.ts +29 -0
  48. package/template/apps/server/src/module-host/durable-context-guard.test.ts +172 -0
  49. package/template/apps/server/src/module-host/durable-context-unavailable.test.ts +50 -1
  50. package/template/apps/server/src/module-host/durable-context.test.ts +42 -25
  51. package/template/apps/server/src/module-host/durable-context.ts +42 -2
  52. package/template/apps/server/src/module-host/durable-handler-registration.ts +96 -5
  53. package/template/apps/server/src/module-host/implementation-completeness.test.ts +185 -0
  54. package/template/apps/server/src/module-host/implementation-completeness.ts +132 -0
  55. package/template/apps/server/src/module-host/initialize-contracts.ts +14 -0
  56. package/template/apps/server/src/module-host/initialize.test.ts +78 -2
  57. package/template/apps/server/src/module-host/initialize.ts +15 -4
  58. package/template/apps/server/src/module-host/project-attachments.test.ts +92 -0
  59. package/template/apps/server/src/module-host/project-attachments.ts +58 -0
  60. package/template/apps/server/src/module-host/project-composition-package.test.ts +186 -0
  61. package/template/apps/server/src/module-host/project-composition.test.ts +260 -0
  62. package/template/apps/server/src/module-host/project-composition.ts +311 -0
  63. package/template/apps/server/src/module-host/request-context.ts +3 -0
  64. package/template/apps/server/src/module-host/route-declaration.ts +15 -6
  65. package/template/apps/server/src/module-host/route-installer.test.ts +15 -2
  66. package/template/apps/server/src/module-host/route-installer.ts +12 -2
  67. package/template/apps/server/src/module-host/route-registration.test.ts +13 -4
  68. package/template/apps/server/src/module-host/runtime-composition-compatibility.test.ts +63 -0
  69. package/template/apps/server/src/module-host/runtime-composition-compatibility.ts +46 -0
  70. package/template/apps/server/src/module-host/runtime-composition.ts +34 -0
  71. package/template/apps/server/src/module-host/search-provider-registration.test.ts +64 -0
  72. package/template/apps/server/src/module-host/search-provider-registration.ts +35 -0
  73. package/template/apps/server/src/module-host/static-route-authorization.test.ts +99 -0
  74. package/template/apps/server/src/module-host/static-route-authorization.ts +90 -0
  75. package/template/apps/server/src/module-host/task-definitions.ts +1 -0
  76. package/template/apps/server/src/module-host/user-directory-composition.test.ts +4 -1
  77. package/template/apps/server/src/module-host.test.ts +2 -0
  78. package/template/apps/server/src/module-preflight.test.ts +289 -0
  79. package/template/apps/server/src/module-preflight.ts +96 -0
  80. package/template/apps/server/src/module-runtime-validation.ts +1 -0
  81. package/template/apps/server/src/platform-app-bootstrap.ts +50 -0
  82. package/template/apps/server/src/platform-http-runtime.ts +32 -7
  83. package/template/apps/server/src/route-guards.test.ts +22 -0
  84. package/template/apps/server/src/route-guards.ts +10 -3
  85. package/template/apps/server/src/runtime-audit-query.ts +50 -0
  86. package/template/apps/server/src/runtime-feature.test.ts +46 -0
  87. package/template/apps/server/src/runtime-feature.ts +5 -0
  88. package/template/apps/server/src/runtime.ts +10 -49
  89. package/template/apps/server/src/scheduler/audit-action.test.ts +49 -0
  90. package/template/apps/server/src/scheduler/audit.ts +1 -1
  91. package/template/apps/server/src/scheduler/execution-recorder.ts +10 -5
  92. package/template/apps/server/src/scheduler/recovery-service.test.ts +4 -3
  93. package/template/apps/server/src/scheduler/service-idle.test.ts +4 -3
  94. package/template/apps/server/src/scheduler/service.test.ts +1 -0
  95. package/template/apps/server/src/scheduler/service.ts +18 -21
  96. package/template/apps/server/src/scheduler/types.ts +5 -1
  97. package/template/apps/server/src/startup-composition-validation.test.ts +35 -0
  98. package/template/apps/server/src/startup-composition-validation.ts +54 -0
  99. package/template/apps/server/src/startup-preflight.test.ts +36 -0
  100. package/template/apps/server/src/startup-preflight.ts +37 -0
  101. package/template/apps/server/src/system/audit-routes.test.ts +9 -3
  102. package/template/apps/server/src/system/department-routes.test.ts +5 -3
  103. package/template/apps/server/src/system/feature-routes.test.ts +4 -3
  104. package/template/apps/server/src/system/interface-catalog.test.ts +5 -3
  105. package/template/apps/server/src/system/interface-catalog.ts +3 -0
  106. package/template/apps/server/src/system/menu-routes.test.ts +5 -3
  107. package/template/apps/server/src/system/route-test-runtime.ts +24 -0
  108. package/template/apps/server/src/system/routes-validation.test.ts +7 -3
  109. package/template/apps/server/src/system/routes.test.ts +21 -11
  110. package/template/apps/server/src/system/routes.ts +11 -2
  111. package/template/apps/server/src/work-order/foundation-modules.test.ts +6 -4
  112. package/template/apps/server/src/work-order/routes.test.ts +8 -0
  113. package/template/apps/server/src/work-order/task.test.ts +6 -1
  114. package/template/apps/web/Dockerfile +5 -0
  115. package/template/apps/web/package.json +1 -0
  116. package/template/apps/web/scripts/validate-admin-ui-composition.ts +106 -0
  117. package/template/apps/web/src/app/web-composition.ts +24 -0
  118. package/template/apps/web/src/app/web-composition.webtest.ts +15 -0
  119. package/template/apps/web/src/layout/AppSidebar.vue +8 -1
  120. package/template/apps/web/src/layout/NavigationSearchDialog.vue +8 -1
  121. package/template/apps/web/src/layout/navigation.ts +29 -4
  122. package/template/apps/web/src/layout/navigation.webtest.ts +51 -0
  123. package/template/apps/web/src/pages/dashboard/dashboard-presenter.ts +6 -1
  124. package/template/apps/web/src/pages/work-orders/WorkOrderListPage.vue +202 -0
  125. package/template/apps/web/src/pages/work-orders/WorkOrderListPage.webtest.ts +51 -0
  126. package/template/apps/web/src/router/admin-extension-loader.ts +44 -0
  127. package/template/apps/web/src/router/admin-extension-loader.webtest.ts +49 -0
  128. package/template/apps/web/src/router/admin-ui-composition-plugin.ts +33 -0
  129. package/template/apps/web/src/router/admin-ui-composition-plugin.webtest.ts +20 -0
  130. package/template/apps/web/src/router/admin-ui-composition.ts +313 -0
  131. package/template/apps/web/src/router/admin-ui-composition.webtest.ts +225 -0
  132. package/template/apps/web/src/router/admin-ui-module-registry-plugin.ts +55 -0
  133. package/template/apps/web/src/router/admin-ui-module-registry-plugin.webtest.ts +46 -0
  134. package/template/apps/web/src/router/business-routes.ts +32 -45
  135. package/template/apps/web/src/router/business-routes.webtest.ts +40 -44
  136. package/template/apps/web/src/router/index.ts +64 -54
  137. package/template/apps/web/src/router/manifest-routes.ts +27 -7
  138. package/template/apps/web/src/router/manifest-routes.webtest.ts +10 -2
  139. package/template/apps/web/src/router/platform-admin-route-bindings.ts +58 -0
  140. package/template/apps/web/src/router/reserved-route-paths.ts +14 -0
  141. package/template/apps/web/src/router/shared-scaffold-neutrality.webtest.ts +10 -4
  142. package/template/apps/web/src/router/web-composition-host.ts +20 -0
  143. package/template/apps/web/src/services/work-order-api.ts +16 -0
  144. package/template/apps/web/src/services/work-order-api.webtest.ts +21 -0
  145. package/template/apps/web/src/virtual-admin-ui-modules.d.ts +5 -0
  146. package/template/apps/web/vite.config.ts +22 -1
  147. package/template/docs/architecture/migration-bundle.md +10 -7
  148. package/template/docs/architecture/module-manifest-composition.md +85 -3
  149. package/template/docs/architecture/search-provider-protocol.md +6 -1
  150. package/template/docs/architecture/server-module-interface.md +70 -7
  151. package/template/docs/development/business-web-routes.md +53 -50
  152. package/template/docs/development/module-lifecycle.md +48 -54
  153. package/template/docs/platform/agent-runtime.md +2 -0
  154. package/template/docs/platform/navigation-registry.md +5 -4
  155. package/template/package.json +1 -1
  156. package/template/packages/config/package.json +1 -1
  157. package/template/packages/database/package.json +1 -1
  158. package/template/packages/example-work-order/package.json +6 -0
  159. package/template/packages/example-work-order/src/admin-page.ts +78 -0
  160. package/template/packages/example-work-order/src/admin.ts +35 -0
  161. package/template/packages/example-work-order/src/manifest.test.ts +62 -5
  162. package/template/packages/example-work-order/src/manifest.ts +54 -7
  163. package/template/packages/example-work-order/src/migration-bundle.ts +8 -0
  164. package/template/packages/example-work-order/src/server-module.ts +2 -2
  165. package/template/packages/jobs/package.json +1 -1
  166. package/template/packages/modules/index.ts +4 -0
  167. package/template/packages/modules/package.json +3 -2
  168. package/template/packages/modules/src/admin-ui-entry.ts +8 -0
  169. package/template/packages/modules/src/admin-ui-manifest.test.ts +52 -0
  170. package/template/packages/modules/src/admin-ui-manifest.ts +53 -0
  171. package/template/packages/modules/src/capability-audit-validation.test.ts +127 -0
  172. package/template/packages/modules/src/capability-audit-validation.ts +38 -0
  173. package/template/packages/modules/src/capability-guard-validation.ts +148 -0
  174. package/template/packages/modules/src/capability-key-validation.test.ts +150 -0
  175. package/template/packages/modules/src/composition-fixtures.test-support.ts +7 -5
  176. package/template/packages/modules/src/composition.test.ts +74 -9
  177. package/template/packages/modules/src/composition.ts +8 -0
  178. package/template/packages/modules/src/manifest.ts +1 -0
  179. package/template/packages/modules/src/migration-bundle-validation.test.ts +23 -0
  180. package/template/packages/modules/src/module-host-range.test.ts +57 -0
  181. package/template/packages/modules/src/module-host-range.ts +125 -0
  182. package/template/packages/modules/src/project-module-assembly.test.ts +133 -0
  183. package/template/packages/modules/src/project-module-assembly.ts +126 -0
  184. package/template/packages/modules/src/system-admin-routes.ts +6 -5
  185. package/template/packages/modules/src/system-admin-ui-catalog.ts +72 -0
  186. package/template/packages/modules/src/system-agent-tools.ts +2 -2
  187. package/template/packages/modules/src/system-api-binding.ts +43 -9
  188. package/template/packages/modules/src/system-api-control-plane.ts +202 -0
  189. package/template/packages/modules/src/system-api-data-governance.ts +4 -2
  190. package/template/packages/modules/src/system-api-operational.ts +57 -8
  191. package/template/packages/modules/src/system-api-permissions.ts +115 -21
  192. package/template/packages/modules/src/system-api-watermark.ts +3 -0
  193. package/template/packages/modules/src/system-audit-actions.ts +7 -0
  194. package/template/packages/modules/src/system-data-governance.ts +5 -2
  195. package/template/packages/modules/src/system-features.ts +31 -0
  196. package/template/packages/modules/src/system-governed-export-bindings.ts +8 -4
  197. package/template/packages/modules/src/system-module-catalog.test.ts +39 -4
  198. package/template/packages/modules/src/system-module-catalog.ts +68 -7
  199. package/template/packages/modules/src/system-module-tasks.ts +8 -1
  200. package/template/packages/modules/src/system-modules-access.test.ts +4 -0
  201. package/template/packages/modules/src/system-modules.test.ts +10 -2
  202. package/template/packages/modules/src/system-modules.ts +6 -5
  203. package/template/packages/modules/src/system-permissions.ts +4 -0
  204. package/template/packages/modules/user/module.ts +19 -2
  205. package/template/packages/server-sdk/index.ts +8 -0
  206. package/template/packages/server-sdk/package.json +2 -1
  207. package/template/packages/server-sdk/src/durable-handler.ts +16 -1
  208. package/template/packages/server-sdk/src/module-adapter.test.ts +44 -0
  209. package/template/packages/server-sdk/src/module-adapter.ts +59 -0
  210. package/template/packages/server-sdk/src/route-definition.ts +3 -2
  211. package/template/packages/shared/package.json +1 -1
  212. package/template/packages/shared/src/audit.test.ts +7 -0
  213. package/template/packages/shared/src/audit.ts +16 -0
  214. package/template/packages/shared/src/migration-bundle-validation.ts +9 -11
  215. package/template/packages/shared/src/rbac.ts +2 -0
  216. package/template/apps/web/src/app/business-routes.ts +0 -22
@@ -1,10 +1,25 @@
1
- import type { ApiPermissionBinding, HttpMethod } from "@southwind-ai/shared";
1
+ import type {
2
+ ApiPermissionBinding,
3
+ AuditActionType,
4
+ HttpMethod,
5
+ } from "@southwind-ai/shared";
2
6
 
3
7
  interface ResourceBindingInput {
4
8
  path: string;
5
9
  permissionResource: string;
6
10
  featureKey?: string;
7
11
  backupExport?: boolean;
12
+ auditActions?: Partial<ResourceAuditActions>;
13
+ }
14
+
15
+ interface ResourceAuditActions {
16
+ list: AuditActionType;
17
+ export: AuditActionType;
18
+ detail: AuditActionType;
19
+ import: AuditActionType;
20
+ create: AuditActionType;
21
+ update: AuditActionType;
22
+ delete: AuditActionType;
8
23
  }
9
24
 
10
25
  export function resourceBindings(
@@ -13,16 +28,34 @@ export function resourceBindings(
13
28
  const base = `/api/system/${input.path}`;
14
29
  const read = `system.${input.permissionResource}.read`;
15
30
  const manage = `system.${input.permissionResource}.manage`;
31
+ const audit = {
32
+ list: "data.read",
33
+ export: "data.export",
34
+ detail: "data.read",
35
+ import: "data.import",
36
+ create: "crud.create",
37
+ update: "crud.update",
38
+ delete: "crud.delete",
39
+ ...input.auditActions,
40
+ } satisfies ResourceAuditActions;
16
41
  return [
17
- binding("GET", base, read, input.featureKey),
42
+ binding("GET", base, read, input.featureKey, audit.list),
18
43
  ...(input.backupExport === false
19
44
  ? []
20
- : [binding("GET", `${base}/export`, read, input.featureKey)]),
21
- binding("GET", `${base}/:id`, read, input.featureKey),
22
- binding("POST", `${base}/import`, manage, input.featureKey),
23
- binding("POST", base, manage, input.featureKey),
24
- binding("PUT", `${base}/:id`, manage, input.featureKey),
25
- binding("DELETE", `${base}/:id`, manage, input.featureKey),
45
+ : [
46
+ binding(
47
+ "GET",
48
+ `${base}/export`,
49
+ read,
50
+ input.featureKey,
51
+ audit.export,
52
+ ),
53
+ ]),
54
+ binding("GET", `${base}/:id`, read, input.featureKey, audit.detail),
55
+ binding("POST", `${base}/import`, manage, input.featureKey, audit.import),
56
+ binding("POST", base, manage, input.featureKey, audit.create),
57
+ binding("PUT", `${base}/:id`, manage, input.featureKey, audit.update),
58
+ binding("DELETE", `${base}/:id`, manage, input.featureKey, audit.delete),
26
59
  ];
27
60
  }
28
61
 
@@ -31,7 +64,8 @@ export function binding(
31
64
  path: string,
32
65
  permissionKey: string,
33
66
  featureKey?: string,
67
+ auditAction?: AuditActionType,
34
68
  anonymous?: boolean,
35
69
  ): ApiPermissionBinding {
36
- return { method, path, permissionKey, featureKey, anonymous };
70
+ return { method, path, permissionKey, featureKey, auditAction, anonymous };
37
71
  }
@@ -0,0 +1,202 @@
1
+ import type { ApiPermissionBinding } from "@southwind-ai/shared";
2
+ import { binding } from "./system-api-binding.js";
3
+
4
+ /**
5
+ * 不走资源 CRUD 的平台入口仍必须进入 Manifest。
6
+ *
7
+ * 认证自服务 Route 使用 anonymous=true 表示不受 RBAC 权限点控制;Handler 仍会校验
8
+ * 登录态、当前会话和对象所有权。Swagger 等纯框架 Route 不在这里声明。
9
+ */
10
+ export function systemControlPlaneApiPermissionBindings(): ApiPermissionBinding[] {
11
+ return [
12
+ ...runtimeBindings(),
13
+ ...sessionBindings(),
14
+ // @windy-module system.agent begin
15
+ ...aiRuntimeBindings(),
16
+ // @windy-module system.agent end
17
+ // @windy-module system.license begin
18
+ binding(
19
+ "GET",
20
+ "/api/license/runtime",
21
+ "system.license.read",
22
+ "system.license",
23
+ "data.read",
24
+ ),
25
+ binding(
26
+ "POST",
27
+ "/api/license/runtime/install",
28
+ "system.license.manage",
29
+ "system.license",
30
+ "license.update",
31
+ ),
32
+ // @windy-module system.license end
33
+ // @windy-module system.agent begin
34
+ binding(
35
+ "GET",
36
+ "/api/agent/tools",
37
+ "system.agent.read",
38
+ "system.agent",
39
+ "data.read",
40
+ ),
41
+ binding(
42
+ "POST",
43
+ "/api/agent/tools/:key/execute",
44
+ "system.agent.read",
45
+ "system.agent",
46
+ "agent.tool.execute",
47
+ ),
48
+ // @windy-module system.agent end
49
+ ];
50
+ }
51
+
52
+ // @windy-module system.agent begin
53
+ function aiRuntimeBindings(): ApiPermissionBinding[] {
54
+ const read = [
55
+ "/api/internal/ai/artifacts",
56
+ "/api/document/runs/:runId/events",
57
+ "/api/document/runs/:runId/result",
58
+ "/api/speech/runs/:runId/events",
59
+ "/api/speech/runs/:runId/result",
60
+ "/api/speech/runs/:runId/artifact",
61
+ "/api/agent/runs/:runId/events",
62
+ "/api/agent/runs/:runId/result",
63
+ ].map((path) =>
64
+ binding(
65
+ "GET",
66
+ path,
67
+ "system.agent.read",
68
+ "system.agent",
69
+ "data.read",
70
+ path.startsWith("/api/internal/"),
71
+ ),
72
+ );
73
+ const execute = [
74
+ "/api/document/runs",
75
+ "/api/document/runs/:runId/cancel",
76
+ "/api/speech/runs",
77
+ "/api/speech/runs/:runId/cancel",
78
+ "/api/embeddings",
79
+ "/api/agent/runs",
80
+ "/api/agent/runs/:runId/cancel",
81
+ "/api/agent/runs/:runId/attach",
82
+ "/api/internal/agent/tools/execute",
83
+ ].map((path) =>
84
+ binding(
85
+ "POST",
86
+ path,
87
+ "system.agent.read",
88
+ "system.agent",
89
+ "agent.operation.execute",
90
+ path.startsWith("/api/internal/"),
91
+ ),
92
+ );
93
+ return [...read, ...execute];
94
+ }
95
+ // @windy-module system.agent end
96
+
97
+ function runtimeBindings(): ApiPermissionBinding[] {
98
+ return ["/api/live", "/api/ready", "/api/health", "/api/metrics"].map(
99
+ (path) =>
100
+ binding(
101
+ "GET",
102
+ path,
103
+ "system.runtime.read",
104
+ "system.runtime",
105
+ undefined,
106
+ true,
107
+ ),
108
+ );
109
+ }
110
+
111
+ function sessionBindings(): ApiPermissionBinding[] {
112
+ return [
113
+ binding(
114
+ "GET",
115
+ "/api/auth/session",
116
+ "system.auth.access",
117
+ "system.auth",
118
+ "data.read",
119
+ true,
120
+ ),
121
+ binding(
122
+ "POST",
123
+ "/api/auth/login",
124
+ "system.auth.access",
125
+ "system.auth",
126
+ "auth.login",
127
+ true,
128
+ ),
129
+ binding(
130
+ "POST",
131
+ "/api/auth/api/login",
132
+ "system.auth.access",
133
+ "system.auth",
134
+ "auth.login",
135
+ true,
136
+ ),
137
+ binding(
138
+ "GET",
139
+ "/api/auth/sessions",
140
+ "system.profile.read",
141
+ "system.profile",
142
+ "data.read",
143
+ true,
144
+ ),
145
+ binding(
146
+ "GET",
147
+ "/api/auth/login-events",
148
+ "system.profile.read",
149
+ "system.profile",
150
+ "data.read",
151
+ true,
152
+ ),
153
+ binding(
154
+ "POST",
155
+ "/api/auth/sessions/revoke-all",
156
+ "system.profile.manage",
157
+ "system.profile",
158
+ "auth.session.revoke",
159
+ true,
160
+ ),
161
+ binding(
162
+ "GET",
163
+ "/api/auth/password/policy",
164
+ "system.auth.access",
165
+ "system.auth",
166
+ "data.read",
167
+ true,
168
+ ),
169
+ binding(
170
+ "POST",
171
+ "/api/auth/logout",
172
+ "system.auth.access",
173
+ "system.auth",
174
+ "auth.session.revoke",
175
+ true,
176
+ ),
177
+ binding(
178
+ "POST",
179
+ "/api/auth/password/change",
180
+ "system.profile.manage",
181
+ "system.profile",
182
+ "auth.password.update",
183
+ true,
184
+ ),
185
+ binding(
186
+ "POST",
187
+ "/api/auth/sessions/:id/revoke",
188
+ "system.profile.manage",
189
+ "system.profile",
190
+ "auth.session.revoke",
191
+ true,
192
+ ),
193
+ binding(
194
+ "GET",
195
+ "/api/session/context",
196
+ "system.auth.access",
197
+ "system.auth",
198
+ "data.read",
199
+ true,
200
+ ),
201
+ ];
202
+ }
@@ -9,13 +9,15 @@ export function dataGovernanceApiPermissionBindings(): ApiPermissionBinding[] {
9
9
  "GET",
10
10
  "/api/system/users/:id/plaintext",
11
11
  "system.user.reveal",
12
- "system.rbac",
12
+ "system.user",
13
+ "data.plaintext.read",
13
14
  ),
14
15
  binding(
15
16
  "POST",
16
17
  "/api/system/users/plaintext/batch",
17
18
  "system.user.reveal",
18
- "system.rbac",
19
+ "system.user",
20
+ "data.plaintext.batch-read",
19
21
  ),
20
22
  ];
21
23
  }
@@ -10,47 +10,60 @@ export function systemOperationalApiPermissionBindings(): ApiPermissionBinding[]
10
10
  "/api/system/storage/uploads",
11
11
  "system.storage.create",
12
12
  "system.storage",
13
+ "file.upload.create",
13
14
  ),
14
15
  binding(
15
16
  "GET",
16
17
  "/api/system/storage/uploads/:id",
17
18
  "system.storage.create",
18
19
  "system.storage",
20
+ "data.read",
19
21
  ),
20
22
  binding(
21
23
  "PUT",
22
24
  "/api/system/storage/uploads/:id/parts/:partNumber",
23
25
  "system.storage.create",
24
26
  "system.storage",
27
+ "file.upload.part.write",
25
28
  ),
26
29
  binding(
27
30
  "POST",
28
31
  "/api/system/storage/uploads/:id/complete",
29
32
  "system.storage.create",
30
33
  "system.storage",
34
+ "file.upload.complete",
31
35
  ),
32
36
  binding(
33
37
  "DELETE",
34
38
  "/api/system/storage/uploads/:id",
35
39
  "system.storage.create",
36
40
  "system.storage",
41
+ "file.upload.abort",
37
42
  ),
38
43
  binding(
39
44
  "GET",
40
45
  "/api/system/storage/files/:id",
41
46
  "system.storage.read",
42
47
  "system.storage",
48
+ "file.download",
43
49
  ),
44
50
  binding(
45
51
  "GET",
46
52
  "/api/platform/files/:id",
47
53
  "system.settings.read",
48
54
  "system.settings",
55
+ undefined,
49
56
  true,
50
57
  ),
51
58
  // @windy-module system.storage end
52
59
  // @windy-module system.operations begin
53
- binding("GET", "/api/system/operations", "system.ops.read", "system.ops"),
60
+ binding(
61
+ "GET",
62
+ "/api/system/operations",
63
+ "system.ops.read",
64
+ "system.ops",
65
+ "data.read",
66
+ ),
54
67
  // @windy-module system.operations end
55
68
  // @windy-module system.notification begin
56
69
  binding(
@@ -58,78 +71,91 @@ export function systemOperationalApiPermissionBindings(): ApiPermissionBinding[]
58
71
  "/api/notifications",
59
72
  "system.notification.read",
60
73
  "system.notification",
74
+ "data.read",
61
75
  ),
62
76
  binding(
63
77
  "GET",
64
78
  "/api/notifications/preferences",
65
79
  "system.notification.read",
66
80
  "system.notification",
81
+ "data.read",
67
82
  ),
68
83
  binding(
69
84
  "PUT",
70
85
  "/api/notifications/preferences",
71
86
  "system.notification.read",
72
87
  "system.notification",
88
+ "notification.preference.update",
73
89
  ),
74
90
  binding(
75
91
  "POST",
76
92
  "/api/notifications/:id/read",
77
93
  "system.notification.read",
78
94
  "system.notification",
95
+ "notification.read",
79
96
  ),
80
97
  binding(
81
98
  "PUT",
82
99
  "/api/notifications/:id/favorite",
83
100
  "system.notification.read",
84
101
  "system.notification",
102
+ "notification.favorite",
85
103
  ),
86
104
  binding(
87
105
  "DELETE",
88
106
  "/api/notifications/:id/favorite",
89
107
  "system.notification.read",
90
108
  "system.notification",
109
+ "notification.unfavorite",
91
110
  ),
92
111
  binding(
93
112
  "GET",
94
113
  "/api/system/notifications/audience-options",
95
114
  "system.notification.manage",
96
115
  "system.notification",
116
+ "data.read",
97
117
  ),
98
118
  binding(
99
119
  "GET",
100
120
  "/api/system/notifications/:id/deliveries",
101
121
  "system.notification.manage",
102
122
  "system.notification",
123
+ "data.read",
103
124
  ),
104
125
  binding(
105
126
  "GET",
106
127
  "/api/system/notifications",
107
128
  "system.notification.manage",
108
129
  "system.notification",
130
+ "data.read",
109
131
  ),
110
132
  binding(
111
133
  "POST",
112
134
  "/api/system/notifications",
113
135
  "system.notification.manage",
114
136
  "system.notification",
137
+ "notification.publish",
115
138
  ),
116
139
  binding(
117
140
  "PUT",
118
141
  "/api/system/notifications/:id",
119
142
  "system.notification.update",
120
143
  "system.notification",
144
+ "notification.update",
121
145
  ),
122
146
  binding(
123
147
  "GET",
124
148
  "/api/system/notifications/:id/revisions",
125
149
  "system.notification.manage",
126
150
  "system.notification",
151
+ "data.read",
127
152
  ),
128
153
  binding(
129
154
  "DELETE",
130
155
  "/api/system/notifications/:id",
131
156
  "system.notification.manage",
132
157
  "system.notification",
158
+ "notification.archive",
133
159
  ),
134
160
  // @windy-module system.notification end
135
161
  // @windy-module system.workflow begin
@@ -138,31 +164,44 @@ export function systemOperationalApiPermissionBindings(): ApiPermissionBinding[]
138
164
  "/api/workflow/work-items",
139
165
  "system.workflow.read",
140
166
  "system.workflow",
167
+ "data.read",
141
168
  ),
142
169
  binding(
143
170
  "GET",
144
171
  "/api/workflow/work-items/:id",
145
172
  "system.workflow.read",
146
173
  "system.workflow",
174
+ "data.read",
147
175
  ),
148
176
  binding(
149
177
  "GET",
150
178
  "/api/workflow/work-items/:id/history",
151
179
  "system.workflow.read",
152
180
  "system.workflow",
181
+ "data.read",
153
182
  ),
154
183
  binding(
155
184
  "POST",
156
185
  "/api/workflow/work-items",
157
186
  "system.workflow.create",
158
187
  "system.workflow",
159
- ),
160
- ...["claim", "transfer", "approve", "reject", "cancel"].map((command) =>
188
+ "workflow.create",
189
+ ),
190
+ ...(
191
+ [
192
+ ["claim", "workflow.claim"],
193
+ ["transfer", "workflow.transfer"],
194
+ ["approve", "workflow.decide"],
195
+ ["reject", "workflow.decide"],
196
+ ["cancel", "workflow.cancel"],
197
+ ] as const
198
+ ).map(([command, auditAction]) =>
161
199
  binding(
162
200
  "POST",
163
201
  `/api/workflow/work-items/:id/${command}`,
164
202
  "system.workflow.approve",
165
203
  "system.workflow",
204
+ auditAction,
166
205
  ),
167
206
  ),
168
207
  // @windy-module system.workflow end
@@ -172,62 +211,72 @@ export function systemOperationalApiPermissionBindings(): ApiPermissionBinding[]
172
211
  "/api/system/scheduled-tasks",
173
212
  "system.scheduler.read",
174
213
  "system.scheduler",
214
+ "task.read",
175
215
  ),
176
216
  binding(
177
217
  "GET",
178
218
  "/api/system/scheduled-task-runs",
179
219
  "system.scheduler.read",
180
220
  "system.scheduler",
221
+ "task.read",
181
222
  ),
182
223
  binding(
183
224
  "GET",
184
225
  "/api/system/operations/scheduler",
185
226
  "system.scheduler.read",
186
227
  "system.scheduler",
228
+ "task.read",
187
229
  ),
188
230
  binding(
189
231
  "POST",
190
232
  "/api/system/scheduled-tasks/:id/trigger",
191
233
  "system.scheduler.manage",
192
234
  "system.scheduler",
235
+ "task.trigger",
193
236
  ),
194
237
  binding(
195
238
  "POST",
196
239
  "/api/system/scheduled-tasks/:id/runs/:runId/recover",
197
240
  "system.scheduler.manage",
198
241
  "system.scheduler",
242
+ "task.recover",
199
243
  ),
200
244
  // @windy-module system.scheduler end
201
245
  // @windy-module system.bulk-data begin
202
246
  binding(
203
247
  "GET",
204
248
  "/api/system/bulk-data/jobs",
205
- "system.dict.read",
249
+ "system.bulk-data.manage",
206
250
  "system.bulk-data",
251
+ "task.read",
207
252
  ),
208
253
  binding(
209
254
  "GET",
210
255
  "/api/system/bulk-data/jobs/:id",
211
- "system.dict.read",
256
+ "system.bulk-data.manage",
212
257
  "system.bulk-data",
258
+ "task.read",
213
259
  ),
214
260
  binding(
215
261
  "GET",
216
262
  "/api/system/bulk-data/jobs/:id/artifacts/:kind",
217
- "system.dict.read",
263
+ "system.bulk-data.manage",
218
264
  "system.bulk-data",
265
+ "data.bulk-artifact.download",
219
266
  ),
220
267
  binding(
221
268
  "POST",
222
269
  "/api/system/bulk-data/dictionaries/import",
223
- "system.dict.manage",
270
+ "system.bulk-data.manage",
224
271
  "system.bulk-data",
272
+ "data.bulk-import.create",
225
273
  ),
226
274
  binding(
227
275
  "POST",
228
276
  "/api/system/bulk-data/dictionaries/export",
229
- "system.dict.read",
277
+ "system.bulk-data.manage",
230
278
  "system.bulk-data",
279
+ "data.bulk-export.create",
231
280
  ),
232
281
  // @windy-module system.bulk-data end
233
282
  ];