@flowdular/sdk 0.2.4 → 0.3.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 (908) hide show
  1. package/.ai/agents/sandbox/business-manager.md +5 -1
  2. package/.ai/blueprints/author-spec/README.md +1 -1
  3. package/.ai/blueprints/author-spec/spec-requirements.yaml +44 -0
  4. package/.ai/blueprints/author-spec/steps.yaml +5 -5
  5. package/.ai/blueprints/author-spec/templates/module.yaml +99 -3
  6. package/.ai/blueprints/edit-module/gates.yaml +4 -0
  7. package/.ai/blueprints/edit-module/required-files.yaml +9 -0
  8. package/.ai/blueprints/new-module/gates.yaml +4 -0
  9. package/.ai/blueprints/new-module/spec-requirements.yaml +2 -2
  10. package/.ai/blueprints/release/gates.yaml +4 -0
  11. package/.ai/platform-capabilities.md +128 -0
  12. package/.ai/policies/capabilities.yaml +100 -0
  13. package/.ai/policies/path-ownership.yaml +5 -2
  14. package/.ai/policies/task-budgets.yaml +5 -3
  15. package/.ai/references/catalog/module.json +4 -4
  16. package/.ai/references/catalog/package.json +2 -2
  17. package/.ai/references/catalog/spec/module.yaml +5 -3
  18. package/.ai/references/catalog/src/platform.ts +2 -0
  19. package/.ai/references/catalog/src/services/catalog-service.ts +89 -1
  20. package/.ai/references/catalog/src/services/data-classes.ts +47 -0
  21. package/.ai/references/catalog/src/services/database-repository.ts +98 -1
  22. package/.ai/references/catalog/src/services/repository.ts +22 -1
  23. package/.ai/references/catalog/tests/data-classes.test.ts +157 -0
  24. package/.ai/references/catalog.provenance.json +12 -10
  25. package/.ai/skills/README.md +10 -0
  26. package/.ai/skills/agent-tool-design/SKILL.md +1 -2
  27. package/.ai/skills/auth-security-review/SKILL.md +1 -1
  28. package/.ai/skills/business-agent-design/SKILL.md +0 -1
  29. package/.ai/skills/deploy-operate/SKILL.md +114 -0
  30. package/.ai/skills/module-new/SKILL.md +29 -3
  31. package/.ai/skills/module-update/SKILL.md +9 -3
  32. package/.ai/skills/perf-audit/SKILL.md +0 -1
  33. package/.ai/skills/release-eject-pr/SKILL.md +0 -1
  34. package/.ai/skills/spec-interview/SKILL.md +120 -0
  35. package/.ai/skills/test-hardening/SKILL.md +1 -0
  36. package/.ai/skills/ux-design/SKILL.md +34 -3
  37. package/.ai/skills/variables/SKILL.md +0 -2
  38. package/.ai/skills/workflow-development/SKILL.md +0 -1
  39. package/AGENTS.md +4 -0
  40. package/docs/agent-contract.md +2 -2
  41. package/docs/design-system.md +185 -31
  42. package/modules/access/migrations/0001_access_core.down.sql +1 -0
  43. package/modules/access/migrations/0001_access_core.up.sql +28 -0
  44. package/modules/access/migrations/README.md +3 -0
  45. package/modules/access/module.json +33 -0
  46. package/modules/access/package.json +43 -0
  47. package/modules/access/spec/module.yaml +225 -0
  48. package/modules/access/src/acl/permissions.ts +6 -0
  49. package/modules/access/src/api/endpoints.ts +244 -0
  50. package/modules/access/src/client/ActivityView.tsrx +245 -0
  51. package/modules/access/src/client/AttestationsView.tsrx +176 -0
  52. package/modules/access/src/client/ReviewView.tsrx +586 -0
  53. package/modules/access/src/client/api.ts +132 -0
  54. package/modules/access/src/client/contribution.tsrx +41 -0
  55. package/modules/access/src/client/index.ts +41 -0
  56. package/modules/access/src/client/navigation.ts +57 -0
  57. package/modules/access/src/client/presentation.ts +69 -0
  58. package/modules/access/src/client/state.ts +72 -0
  59. package/modules/access/src/domain/types.ts +189 -0
  60. package/modules/access/src/index.ts +38 -0
  61. package/modules/access/src/platform.ts +60 -0
  62. package/modules/access/src/server/index.ts +42 -0
  63. package/modules/access/src/server/runtime.ts +105 -0
  64. package/modules/access/src/services/access-service.ts +298 -0
  65. package/modules/access/src/services/audit-window.ts +78 -0
  66. package/modules/access/src/services/auth-directory.ts +72 -0
  67. package/modules/access/src/services/changes.ts +91 -0
  68. package/modules/access/src/services/data-classes.ts +28 -0
  69. package/modules/access/src/services/database-repository.ts +185 -0
  70. package/modules/access/src/services/directory.ts +102 -0
  71. package/modules/access/src/services/index.ts +33 -0
  72. package/modules/access/src/services/list-exports.ts +150 -0
  73. package/modules/access/src/services/migration.ts +54 -0
  74. package/modules/access/src/services/repository.ts +30 -0
  75. package/modules/access/src/services/review.ts +178 -0
  76. package/modules/access/translations/en.json +155 -0
  77. package/modules/access/translations/pl.json +155 -0
  78. package/modules/agents/migrations/0022_credential_rotation_inventory.down.sql +2 -0
  79. package/modules/agents/migrations/0022_credential_rotation_inventory.up.sql +7 -0
  80. package/modules/agents/migrations/0023_agents_retention_indexes.down.sql +2 -0
  81. package/modules/agents/migrations/0023_agents_retention_indexes.up.sql +9 -0
  82. package/modules/agents/migrations/0024_agent_meter_refusals.down.sql +3 -0
  83. package/modules/agents/migrations/0024_agent_meter_refusals.up.sql +22 -0
  84. package/modules/agents/migrations/0025_agent_list_indexes.down.sql +3 -0
  85. package/modules/agents/migrations/0025_agent_list_indexes.up.sql +11 -0
  86. package/modules/agents/module.json +30 -4
  87. package/modules/agents/package.json +2 -1
  88. package/modules/agents/spec/module.yaml +63 -5
  89. package/modules/agents/src/api/endpoints.ts +291 -33
  90. package/modules/agents/src/cli/commands.json +11 -0
  91. package/modules/agents/src/cli/index.ts +45 -0
  92. package/modules/agents/src/client/AgentDashboardWidget.tsrx +19 -11
  93. package/modules/agents/src/client/AgentDefinitionList.tsrx +53 -10
  94. package/modules/agents/src/client/AgentPlaygroundView.tsrx +4 -4
  95. package/modules/agents/src/client/AgentProceduresView.tsrx +2 -2
  96. package/modules/agents/src/client/AgentRunsView.tsrx +143 -40
  97. package/modules/agents/src/client/AgentsView.tsrx +109 -33
  98. package/modules/agents/src/client/api.ts +99 -21
  99. package/modules/agents/src/client/state.ts +97 -0
  100. package/modules/agents/src/domain/types.ts +44 -4
  101. package/modules/agents/src/platform.ts +42 -0
  102. package/modules/agents/src/server/action-execution.ts +201 -106
  103. package/modules/agents/src/server/runtime.ts +32 -0
  104. package/modules/agents/src/services/agent-service.ts +158 -30
  105. package/modules/agents/src/services/credential-rotation.ts +185 -0
  106. package/modules/agents/src/services/credential-vault.ts +71 -46
  107. package/modules/agents/src/services/data-classes.ts +176 -0
  108. package/modules/agents/src/services/database-repository.ts +393 -101
  109. package/modules/agents/src/services/metering.ts +111 -0
  110. package/modules/agents/src/services/migration.ts +109 -0
  111. package/modules/agents/src/services/module-agent-preflight.ts +17 -9
  112. package/modules/agents/src/services/notifications.ts +98 -0
  113. package/modules/agents/src/services/provider-repository.ts +9 -18
  114. package/modules/agents/src/services/provider-service.ts +1 -9
  115. package/modules/agents/src/services/reports.ts +107 -0
  116. package/modules/agents/src/services/repository.ts +86 -6
  117. package/modules/agents/src/services/usage-service.ts +2 -0
  118. package/modules/agents/src/services/worker.ts +114 -4
  119. package/modules/agents/src/settings.ts +14 -3
  120. package/modules/agents/translations/en.json +14 -4
  121. package/modules/agents/translations/pl.json +14 -4
  122. package/modules/approvals/migrations/0001_approvals_core.down.sql +3 -0
  123. package/modules/approvals/migrations/0001_approvals_core.up.sql +78 -0
  124. package/modules/approvals/migrations/0002_approvals_expiry_routing_role.down.sql +2 -0
  125. package/modules/approvals/migrations/0002_approvals_expiry_routing_role.up.sql +19 -0
  126. package/modules/approvals/migrations/0003_approvals_retention_indexes.down.sql +6 -0
  127. package/modules/approvals/migrations/0003_approvals_retention_indexes.up.sql +14 -0
  128. package/modules/approvals/migrations/0004_approvals_inbox_keyset_indexes.down.sql +5 -0
  129. package/modules/approvals/migrations/0004_approvals_inbox_keyset_indexes.up.sql +12 -0
  130. package/modules/approvals/migrations/README.md +3 -0
  131. package/modules/approvals/module.json +34 -0
  132. package/modules/approvals/package.json +43 -0
  133. package/modules/approvals/spec/module.yaml +318 -0
  134. package/modules/approvals/src/acl/permissions.ts +7 -0
  135. package/modules/approvals/src/api/endpoints.ts +457 -0
  136. package/modules/approvals/src/client/ApprovalRequestDrawer.tsrx +138 -0
  137. package/modules/approvals/src/client/ApprovalsView.tsrx +562 -0
  138. package/modules/approvals/src/client/PendingCountWidget.tsrx +52 -0
  139. package/modules/approvals/src/client/api.ts +203 -0
  140. package/modules/approvals/src/client/approvals.css +51 -0
  141. package/modules/approvals/src/client/contribution.tsrx +44 -0
  142. package/modules/approvals/src/client/index.ts +26 -0
  143. package/modules/approvals/src/client/navigation.ts +39 -0
  144. package/modules/approvals/src/client/pending-count.ts +26 -0
  145. package/modules/approvals/src/client/presentation.ts +52 -0
  146. package/modules/approvals/src/client/state.ts +141 -0
  147. package/modules/approvals/src/domain/capability.ts +95 -0
  148. package/modules/approvals/src/domain/types.ts +154 -0
  149. package/modules/approvals/src/index.ts +52 -0
  150. package/modules/approvals/src/platform.ts +128 -0
  151. package/modules/approvals/src/server/index.ts +42 -0
  152. package/modules/approvals/src/server/runtime.ts +181 -0
  153. package/modules/approvals/src/services/approvals-service.ts +557 -0
  154. package/modules/approvals/src/services/callbacks.ts +75 -0
  155. package/modules/approvals/src/services/data-classes.ts +167 -0
  156. package/modules/approvals/src/services/database-repository.ts +724 -0
  157. package/modules/approvals/src/services/eligibility.ts +121 -0
  158. package/modules/approvals/src/services/expiry-runner.ts +81 -0
  159. package/modules/approvals/src/services/index.ts +31 -0
  160. package/modules/approvals/src/services/migration.ts +222 -0
  161. package/modules/approvals/src/services/notifications.ts +95 -0
  162. package/modules/approvals/src/services/repository.ts +161 -0
  163. package/modules/approvals/src/services/service-error.ts +70 -0
  164. package/modules/approvals/src/settings.ts +102 -0
  165. package/modules/approvals/translations/en.json +104 -0
  166. package/modules/approvals/translations/pl.json +104 -0
  167. package/modules/audit/migrations/0001_audit_core.down.sql +8 -0
  168. package/modules/audit/migrations/0001_audit_core.up.sql +107 -0
  169. package/modules/audit/migrations/0002_audit_sweep_routing_role.down.sql +2 -0
  170. package/modules/audit/migrations/0002_audit_sweep_routing_role.up.sql +21 -0
  171. package/modules/audit/migrations/0003_audit_export_request.down.sql +12 -0
  172. package/modules/audit/migrations/0003_audit_export_request.up.sql +40 -0
  173. package/modules/audit/migrations/0004_audit_hold_seal_erasure.down.sql +17 -0
  174. package/modules/audit/migrations/0004_audit_hold_seal_erasure.up.sql +192 -0
  175. package/modules/audit/migrations/0005_audit_event_format.down.sql +17 -0
  176. package/modules/audit/migrations/0005_audit_event_format.up.sql +60 -0
  177. package/modules/audit/migrations/0006_audit_own_class_walks.down.sql +3 -0
  178. package/modules/audit/migrations/0006_audit_own_class_walks.up.sql +14 -0
  179. package/modules/audit/migrations/README.md +3 -0
  180. package/modules/audit/module.json +32 -0
  181. package/modules/audit/package.json +49 -0
  182. package/modules/audit/spec/module.yaml +809 -0
  183. package/modules/audit/src/acl/permissions.ts +7 -0
  184. package/modules/audit/src/api/endpoints.ts +315 -0
  185. package/modules/audit/src/cli/commands.json +95 -0
  186. package/modules/audit/src/cli/index.ts +658 -0
  187. package/modules/audit/src/client/DataClassesView.tsrx +420 -0
  188. package/modules/audit/src/client/ExportsView.tsrx +256 -0
  189. package/modules/audit/src/client/HoldsView.tsrx +604 -0
  190. package/modules/audit/src/client/SweepsView.tsrx +251 -0
  191. package/modules/audit/src/client/api.ts +185 -0
  192. package/modules/audit/src/client/contribution.tsrx +52 -0
  193. package/modules/audit/src/client/index.ts +23 -0
  194. package/modules/audit/src/client/navigation.ts +74 -0
  195. package/modules/audit/src/client/presentation.ts +105 -0
  196. package/modules/audit/src/client/state.ts +86 -0
  197. package/modules/audit/src/domain/data-classes.ts +16 -0
  198. package/modules/audit/src/domain/types.ts +339 -0
  199. package/modules/audit/src/index.ts +76 -0
  200. package/modules/audit/src/platform.ts +44 -0
  201. package/modules/audit/src/server/index.ts +177 -0
  202. package/modules/audit/src/server/runtime.ts +303 -0
  203. package/modules/audit/src/services/anchor-key.ts +143 -0
  204. package/modules/audit/src/services/anchor-rotation.ts +147 -0
  205. package/modules/audit/src/services/audit-runners.ts +278 -0
  206. package/modules/audit/src/services/backup-guard.ts +95 -0
  207. package/modules/audit/src/services/database-repository.ts +1946 -0
  208. package/modules/audit/src/services/declared-classes.ts +64 -0
  209. package/modules/audit/src/services/erasure-port.ts +126 -0
  210. package/modules/audit/src/services/erasure-service.ts +770 -0
  211. package/modules/audit/src/services/export-directory.ts +106 -0
  212. package/modules/audit/src/services/export-service.ts +714 -0
  213. package/modules/audit/src/services/hold-service.ts +295 -0
  214. package/modules/audit/src/services/index.ts +17 -0
  215. package/modules/audit/src/services/migration.ts +658 -0
  216. package/modules/audit/src/services/own-classes.ts +318 -0
  217. package/modules/audit/src/services/platform-version.ts +23 -0
  218. package/modules/audit/src/services/repository.ts +495 -0
  219. package/modules/audit/src/services/retention-service.ts +191 -0
  220. package/modules/audit/src/services/seal-service.ts +769 -0
  221. package/modules/audit/src/services/service-error.ts +61 -0
  222. package/modules/audit/src/services/subject-keys.ts +90 -0
  223. package/modules/audit/src/services/sweep-service.ts +298 -0
  224. package/modules/audit/src/services/zip.ts +217 -0
  225. package/modules/audit/src/settings.ts +69 -0
  226. package/modules/audit/translations/en.json +210 -0
  227. package/modules/audit/translations/pl.json +210 -0
  228. package/modules/auth/README.md +77 -29
  229. package/modules/auth/migrations/0016_external_identities.up.sql +16 -0
  230. package/modules/auth/migrations/0017_mfa_key_id.up.sql +8 -0
  231. package/modules/auth/migrations/0018_retire_bundled_module_scopes.up.sql +29 -0
  232. package/modules/auth/migrations/0019_notifications_member_scopes.up.sql +44 -0
  233. package/modules/auth/migrations/0020_identity_providers.up.sql +61 -0
  234. package/modules/auth/migrations/0021_membership_status.up.sql +19 -0
  235. package/modules/auth/migrations/0022_auth_provider_scopes.up.sql +45 -0
  236. package/modules/auth/migrations/0023_enterprise_module_scopes.down.sql +19 -0
  237. package/modules/auth/migrations/0023_enterprise_module_scopes.up.sql +71 -0
  238. package/modules/auth/migrations/0024_approvals_member_scopes.down.sql +22 -0
  239. package/modules/auth/migrations/0024_approvals_member_scopes.up.sql +48 -0
  240. package/modules/auth/migrations/0025_audit_holds_owner_scope.down.sql +21 -0
  241. package/modules/auth/migrations/0025_audit_holds_owner_scope.up.sql +47 -0
  242. package/modules/auth/migrations/0026_auth_export_keyset_indexes.down.sql +6 -0
  243. package/modules/auth/migrations/0026_auth_export_keyset_indexes.up.sql +15 -0
  244. package/modules/auth/migrations/0027_workflow_automation_profile_scopes.down.sql +34 -0
  245. package/modules/auth/migrations/0027_workflow_automation_profile_scopes.up.sql +72 -0
  246. package/modules/auth/migrations/0028_auth_member_search_prefix_indexes.down.sql +6 -0
  247. package/modules/auth/migrations/0028_auth_member_search_prefix_indexes.up.sql +21 -0
  248. package/modules/auth/migrations/0029_reports_exports_access_scopes.down.sql +22 -0
  249. package/modules/auth/migrations/0029_reports_exports_access_scopes.up.sql +56 -0
  250. package/modules/auth/migrations/0030_auth_membership_keyset_index.down.sql +4 -0
  251. package/modules/auth/migrations/0030_auth_membership_keyset_index.up.sql +10 -0
  252. package/modules/auth/migrations/0031_membership_scope_backfills_under_rls.down.sql +4 -0
  253. package/modules/auth/migrations/0031_membership_scope_backfills_under_rls.up.sql +31 -0
  254. package/modules/auth/migrations/0032_audit_actor_service.down.sql +9 -0
  255. package/modules/auth/migrations/0032_audit_actor_service.up.sql +10 -0
  256. package/modules/auth/migrations/0033_auth_account_keyset_indexes.down.sql +5 -0
  257. package/modules/auth/migrations/0033_auth_account_keyset_indexes.up.sql +23 -0
  258. package/modules/auth/module.json +3 -3
  259. package/modules/auth/package.json +2 -1
  260. package/modules/auth/spec/module.yaml +372 -3
  261. package/modules/auth/src/acl/scopes.ts +50 -6
  262. package/modules/auth/src/cli/commands.json +11 -0
  263. package/modules/auth/src/cli/greenfield.ts +2 -2
  264. package/modules/auth/src/cli/index.ts +14 -0
  265. package/modules/auth/src/cli/secrets.ts +114 -0
  266. package/modules/auth/src/client/AuthenticationCore.tsrx +61 -8
  267. package/modules/auth/src/client/api.ts +72 -6
  268. package/modules/auth/src/client/contribution.tsrx +23 -0
  269. package/modules/auth/src/client/index.ts +6 -0
  270. package/modules/auth/src/client/providers/IdentityProviderForm.tsrx +191 -0
  271. package/modules/auth/src/client/providers/IdentityProvidersView.tsrx +358 -0
  272. package/modules/auth/src/client/providers/api.ts +128 -0
  273. package/modules/auth/src/client/providers/provider-columns.tsrx +60 -0
  274. package/modules/auth/src/client/providers/state.ts +35 -0
  275. package/modules/auth/src/client/security/SecurityView.tsrx +9 -1
  276. package/modules/auth/src/client/state.ts +15 -1
  277. package/modules/auth/src/domain/types.ts +55 -0
  278. package/modules/auth/src/index.ts +11 -1
  279. package/modules/auth/src/middleware/authentication.ts +4 -0
  280. package/modules/auth/src/server/endpoints.ts +467 -171
  281. package/modules/auth/src/server/http.ts +3 -2
  282. package/modules/auth/src/server/index.ts +22 -1
  283. package/modules/auth/src/server/membership-endpoints.ts +62 -0
  284. package/modules/auth/src/server/mfa-enforcement.ts +156 -0
  285. package/modules/auth/src/server/oidc.ts +389 -0
  286. package/modules/auth/src/server/provider-endpoints.ts +246 -0
  287. package/modules/auth/src/server/provider-host.ts +77 -0
  288. package/modules/auth/src/server/runtime.ts +231 -55
  289. package/modules/auth/src/services/auth-service-error.ts +7 -2
  290. package/modules/auth/src/services/auth-service.ts +948 -51
  291. package/modules/auth/src/services/data-classes.ts +236 -0
  292. package/modules/auth/src/services/database-repository.ts +853 -71
  293. package/modules/auth/src/services/identity-provider-service.ts +571 -0
  294. package/modules/auth/src/services/mail-delivery.ts +16 -16
  295. package/modules/auth/src/services/mail-message.ts +54 -0
  296. package/modules/auth/src/services/mail-port.ts +24 -0
  297. package/modules/auth/src/services/mail-smtp.ts +85 -0
  298. package/modules/auth/src/services/mfa-rotation.ts +144 -0
  299. package/modules/auth/src/services/migration.ts +810 -0
  300. package/modules/auth/src/services/password.ts +14 -0
  301. package/modules/auth/src/services/provider-secret-rotation.ts +169 -0
  302. package/modules/auth/src/services/provider-secrets.ts +136 -0
  303. package/modules/auth/src/services/repository.ts +321 -5
  304. package/modules/auth/src/services/session-sweep-runner.ts +73 -0
  305. package/modules/auth/src/services/settings-store.ts +10 -83
  306. package/modules/auth/src/services/totp.ts +88 -62
  307. package/modules/auth/src/services/validation.ts +194 -7
  308. package/modules/auth/src/settings.ts +18 -0
  309. package/modules/auth/translations/en.json +84 -1
  310. package/modules/auth/translations/pl.json +84 -1
  311. package/modules/automations/migrations/0005_secret_rotation_inventory.down.sql +1 -0
  312. package/modules/automations/migrations/0005_secret_rotation_inventory.up.sql +6 -0
  313. package/modules/automations/migrations/0006_automations_list_sort_indexes.down.sql +4 -0
  314. package/modules/automations/migrations/0006_automations_list_sort_indexes.up.sql +11 -0
  315. package/modules/automations/module.json +24 -6
  316. package/modules/automations/package.json +4 -1
  317. package/modules/automations/spec/module.yaml +81 -7
  318. package/modules/automations/src/api/endpoints.ts +202 -28
  319. package/modules/automations/src/cli/commands.json +17 -0
  320. package/modules/automations/src/cli/index.ts +114 -0
  321. package/modules/automations/src/client/AutomationScheduleForm.tsrx +77 -19
  322. package/modules/automations/src/client/AutomationSchedulesView.tsrx +144 -40
  323. package/modules/automations/src/client/AutomationTriggersView.tsrx +131 -32
  324. package/modules/automations/src/client/api.ts +62 -19
  325. package/modules/automations/src/client/presentation.ts +20 -2
  326. package/modules/automations/src/client/state.ts +84 -0
  327. package/modules/automations/src/domain/cadence.ts +99 -3
  328. package/modules/automations/src/domain/cron.ts +366 -0
  329. package/modules/automations/src/domain/time-zone.ts +61 -0
  330. package/modules/automations/src/platform.ts +38 -4
  331. package/modules/automations/src/server/index.ts +11 -0
  332. package/modules/automations/src/server/runtime.ts +46 -22
  333. package/modules/{automations-workflows-integration/src/server/adapter.ts → automations/src/server/workflow-target.ts} +13 -14
  334. package/modules/{automations-workflows-integration/src/server/tools.ts → automations/src/server/workflow-tools.ts} +0 -0
  335. package/modules/automations/src/services/data-classes.ts +62 -0
  336. package/modules/automations/src/services/database-repository.ts +152 -38
  337. package/modules/automations/src/services/migration.ts +119 -9
  338. package/modules/automations/src/services/repository.ts +52 -1
  339. package/modules/automations/src/services/schedule-runner.ts +84 -0
  340. package/modules/automations/src/services/schedule-service.ts +152 -26
  341. package/modules/automations/src/services/secret-rotation.ts +176 -0
  342. package/modules/automations/src/services/secret-vault.ts +68 -41
  343. package/modules/automations/src/services/trigger-service.ts +13 -10
  344. package/modules/automations/translations/en.json +15 -2
  345. package/modules/automations/translations/pl.json +15 -2
  346. package/modules/connectors/migrations/0001_connectors_core.down.sql +3 -0
  347. package/modules/connectors/migrations/0001_connectors_core.up.sql +72 -0
  348. package/modules/connectors/migrations/0002_connectors_call_keys.down.sql +3 -0
  349. package/modules/connectors/migrations/0002_connectors_call_keys.up.sql +18 -0
  350. package/modules/connectors/migrations/README.md +3 -0
  351. package/modules/connectors/module.json +28 -0
  352. package/modules/{automations-workflows-integration → connectors}/package.json +27 -26
  353. package/modules/connectors/spec/module.yaml +447 -0
  354. package/modules/connectors/src/acl/permissions.ts +6 -0
  355. package/modules/connectors/src/agent/tools.ts +180 -0
  356. package/modules/connectors/src/api/endpoints.ts +572 -0
  357. package/modules/connectors/src/client/ConnectorCallsView.tsrx +358 -0
  358. package/modules/connectors/src/client/ConnectorForm.tsrx +424 -0
  359. package/modules/connectors/src/client/ConnectorsView.tsrx +711 -0
  360. package/modules/connectors/src/client/api.ts +281 -0
  361. package/modules/connectors/src/client/consent.ts +48 -0
  362. package/modules/connectors/src/client/contribution.tsrx +37 -0
  363. package/modules/connectors/src/client/index.ts +22 -0
  364. package/modules/connectors/src/client/navigation.ts +42 -0
  365. package/modules/connectors/src/client/presentation.ts +38 -0
  366. package/modules/connectors/src/client/state.ts +175 -0
  367. package/modules/connectors/src/domain/calls.ts +70 -0
  368. package/modules/connectors/src/domain/definitions.ts +190 -0
  369. package/modules/connectors/src/domain/http-json.ts +68 -0
  370. package/modules/connectors/src/domain/types.ts +185 -0
  371. package/modules/connectors/src/index.ts +64 -0
  372. package/modules/connectors/src/platform.ts +56 -0
  373. package/modules/connectors/src/server/index.ts +66 -0
  374. package/modules/connectors/src/server/runtime.ts +163 -0
  375. package/modules/connectors/src/services/call-service.ts +903 -0
  376. package/modules/connectors/src/services/connectors-service.ts +653 -0
  377. package/modules/connectors/src/services/credential-vault.ts +188 -0
  378. package/modules/connectors/src/services/data-classes.ts +158 -0
  379. package/modules/connectors/src/services/database-repository.ts +897 -0
  380. package/modules/connectors/src/services/egress.ts +261 -0
  381. package/modules/connectors/src/services/index.ts +19 -0
  382. package/modules/connectors/src/services/migration.ts +166 -0
  383. package/modules/connectors/src/services/repository.ts +175 -0
  384. package/modules/connectors/src/services/service-error.ts +46 -0
  385. package/modules/connectors/src/settings.ts +69 -0
  386. package/modules/connectors/translations/en.json +191 -0
  387. package/modules/connectors/translations/pl.json +191 -0
  388. package/modules/directory/migrations/0001_directory_core.down.sql +5 -0
  389. package/modules/directory/migrations/0001_directory_core.up.sql +111 -0
  390. package/modules/directory/migrations/README.md +3 -0
  391. package/modules/directory/module.json +27 -0
  392. package/modules/directory/package.json +46 -0
  393. package/modules/directory/spec/module.yaml +351 -0
  394. package/modules/directory/src/acl/permissions.ts +7 -0
  395. package/modules/directory/src/api/endpoints.ts +478 -0
  396. package/modules/directory/src/api/scim-endpoints.ts +516 -0
  397. package/modules/directory/src/client/GroupMappingsView.tsrx +430 -0
  398. package/modules/directory/src/client/ProvisioningLogView.tsrx +248 -0
  399. package/modules/directory/src/client/ScimTokensView.tsrx +587 -0
  400. package/modules/directory/src/client/api.ts +222 -0
  401. package/modules/directory/src/client/contribution.tsrx +46 -0
  402. package/modules/directory/src/client/index.ts +22 -0
  403. package/modules/directory/src/client/navigation.ts +57 -0
  404. package/modules/directory/src/client/presentation.ts +143 -0
  405. package/modules/directory/src/client/state.ts +173 -0
  406. package/modules/directory/src/domain/scim.ts +346 -0
  407. package/modules/directory/src/domain/types.ts +166 -0
  408. package/modules/directory/src/index.ts +44 -0
  409. package/modules/directory/src/platform.ts +43 -0
  410. package/modules/directory/src/server/index.ts +17 -0
  411. package/modules/directory/src/server/runtime.ts +124 -0
  412. package/modules/directory/src/services/auth-port.ts +127 -0
  413. package/modules/directory/src/services/data-classes.ts +41 -0
  414. package/modules/directory/src/services/database-repository.ts +1067 -0
  415. package/modules/directory/src/services/directory-service.ts +311 -0
  416. package/modules/directory/src/services/index.ts +43 -0
  417. package/modules/directory/src/services/migration.ts +146 -0
  418. package/modules/directory/src/services/provisioning-service.ts +1420 -0
  419. package/modules/directory/src/services/rate-limiter.ts +103 -0
  420. package/modules/directory/src/services/repository.ts +208 -0
  421. package/modules/directory/src/services/service-error.ts +42 -0
  422. package/modules/directory/src/services/token-service.ts +215 -0
  423. package/modules/directory/src/settings.ts +86 -0
  424. package/modules/directory/translations/en.json +185 -0
  425. package/modules/directory/translations/pl.json +185 -0
  426. package/modules/documents/migrations/0001_documents_core.down.sql +1 -0
  427. package/modules/documents/migrations/0001_documents_core.up.sql +35 -0
  428. package/modules/documents/migrations/0002_documents_files_page.down.sql +1 -0
  429. package/modules/documents/migrations/0002_documents_files_page.up.sql +6 -0
  430. package/modules/documents/migrations/README.md +3 -0
  431. package/modules/documents/module.json +28 -0
  432. package/modules/documents/package.json +49 -0
  433. package/modules/documents/spec/module.yaml +247 -0
  434. package/modules/documents/src/acl/permissions.ts +6 -0
  435. package/modules/documents/src/api/endpoints.ts +401 -0
  436. package/modules/documents/src/client/DocumentUploader.tsrx +148 -0
  437. package/modules/documents/src/client/DocumentsView.tsrx +540 -0
  438. package/modules/documents/src/client/api.ts +209 -0
  439. package/modules/documents/src/client/contribution.tsrx +29 -0
  440. package/modules/documents/src/client/download.ts +70 -0
  441. package/modules/documents/src/client/index.ts +22 -0
  442. package/modules/documents/src/client/navigation.ts +25 -0
  443. package/modules/documents/src/client/presentation.ts +110 -0
  444. package/modules/documents/src/client/state.ts +117 -0
  445. package/modules/documents/src/domain/attachments.ts +84 -0
  446. package/modules/documents/src/domain/types.ts +80 -0
  447. package/modules/documents/src/index.ts +46 -0
  448. package/modules/documents/src/platform.ts +61 -0
  449. package/modules/documents/src/server/index.ts +30 -0
  450. package/modules/documents/src/server/runtime.ts +107 -0
  451. package/modules/documents/src/services/attachments.ts +39 -0
  452. package/modules/documents/src/services/data-classes.ts +25 -0
  453. package/modules/documents/src/services/database-repository.ts +259 -0
  454. package/modules/documents/src/services/documents-service.ts +586 -0
  455. package/modules/documents/src/services/index.ts +18 -0
  456. package/modules/documents/src/services/migration.ts +82 -0
  457. package/modules/documents/src/services/repository.ts +48 -0
  458. package/modules/documents/src/settings.ts +107 -0
  459. package/modules/documents/translations/en.json +111 -0
  460. package/modules/documents/translations/pl.json +111 -0
  461. package/modules/exports/migrations/0001_exports_core.down.sql +2 -0
  462. package/modules/exports/migrations/0001_exports_core.up.sql +28 -0
  463. package/modules/exports/migrations/0002_exports_job_routing_role.down.sql +4 -0
  464. package/modules/exports/migrations/0002_exports_job_routing_role.up.sql +21 -0
  465. package/modules/exports/migrations/README.md +3 -0
  466. package/modules/exports/module.json +28 -0
  467. package/modules/exports/package.json +44 -0
  468. package/modules/exports/spec/module.yaml +229 -0
  469. package/modules/exports/src/acl/permissions.ts +6 -0
  470. package/modules/exports/src/api/endpoints.ts +211 -0
  471. package/modules/exports/src/client/ExportsView.tsrx +327 -0
  472. package/modules/exports/src/client/api.ts +133 -0
  473. package/modules/exports/src/client/contribution.tsrx +31 -0
  474. package/modules/exports/src/client/index.ts +20 -0
  475. package/modules/exports/src/client/navigation.ts +25 -0
  476. package/modules/exports/src/client/presentation.ts +53 -0
  477. package/modules/exports/src/client/state.ts +56 -0
  478. package/modules/exports/src/domain/lists.ts +29 -0
  479. package/modules/exports/src/domain/types.ts +120 -0
  480. package/modules/exports/src/index.ts +41 -0
  481. package/modules/exports/src/platform.ts +80 -0
  482. package/modules/exports/src/server/index.ts +51 -0
  483. package/modules/exports/src/server/runtime.ts +160 -0
  484. package/modules/exports/src/services/data-classes.ts +56 -0
  485. package/modules/exports/src/services/database-repository.ts +405 -0
  486. package/modules/exports/src/services/export-runner.ts +123 -0
  487. package/modules/exports/src/services/export-service.ts +356 -0
  488. package/modules/exports/src/services/index.ts +6 -0
  489. package/modules/exports/src/services/list-registry.ts +105 -0
  490. package/modules/exports/src/services/migration.ts +89 -0
  491. package/modules/exports/src/services/repository.ts +97 -0
  492. package/modules/exports/src/settings.ts +70 -0
  493. package/modules/exports/translations/en.json +69 -0
  494. package/modules/exports/translations/pl.json +69 -0
  495. package/modules/import/migrations/0001_import_core.down.sql +6 -0
  496. package/modules/import/migrations/0001_import_core.up.sql +61 -0
  497. package/modules/import/migrations/0002_import_job_routing_role.down.sql +4 -0
  498. package/modules/import/migrations/0002_import_job_routing_role.up.sql +20 -0
  499. package/modules/import/migrations/0003_import_jobs_export_index.down.sql +1 -0
  500. package/modules/import/migrations/0003_import_jobs_export_index.up.sql +7 -0
  501. package/modules/import/migrations/0004_import_jobs_traceparent.down.sql +1 -0
  502. package/modules/import/migrations/0004_import_jobs_traceparent.up.sql +7 -0
  503. package/modules/import/migrations/README.md +3 -0
  504. package/modules/import/module.json +37 -0
  505. package/modules/import/package.json +50 -0
  506. package/modules/import/spec/module.yaml +335 -0
  507. package/modules/import/src/acl/permissions.ts +6 -0
  508. package/modules/import/src/api/endpoints.ts +400 -0
  509. package/modules/import/src/client/ImportJobDrawer.tsrx +229 -0
  510. package/modules/import/src/client/ImportsView.tsrx +455 -0
  511. package/modules/import/src/client/NewImportForm.tsrx +274 -0
  512. package/modules/import/src/client/api.ts +243 -0
  513. package/modules/import/src/client/contribution.tsrx +29 -0
  514. package/modules/import/src/client/index.ts +23 -0
  515. package/modules/import/src/client/navigation.ts +25 -0
  516. package/modules/import/src/client/presentation.ts +59 -0
  517. package/modules/import/src/client/state.ts +43 -0
  518. package/modules/import/src/domain/csv.ts +258 -0
  519. package/modules/import/src/domain/ports.ts +157 -0
  520. package/modules/import/src/domain/types.ts +179 -0
  521. package/modules/import/src/index.ts +58 -0
  522. package/modules/import/src/platform.ts +60 -0
  523. package/modules/import/src/server/index.ts +49 -0
  524. package/modules/import/src/server/runtime.ts +158 -0
  525. package/modules/import/src/services/csv-source.ts +121 -0
  526. package/modules/import/src/services/data-classes.ts +63 -0
  527. package/modules/import/src/services/database-repository.ts +780 -0
  528. package/modules/import/src/services/import-runner.ts +127 -0
  529. package/modules/import/src/services/import-service.ts +872 -0
  530. package/modules/import/src/services/index.ts +6 -0
  531. package/modules/import/src/services/migration.ts +156 -0
  532. package/modules/import/src/services/port-registry.ts +158 -0
  533. package/modules/import/src/services/repository.ts +147 -0
  534. package/modules/import/src/settings.ts +70 -0
  535. package/modules/import/translations/en.json +175 -0
  536. package/modules/import/translations/pl.json +175 -0
  537. package/modules/metering/migrations/0001_metering_core.down.sql +6 -0
  538. package/modules/metering/migrations/0001_metering_core.up.sql +119 -0
  539. package/modules/metering/migrations/0002_metering_bucket_export.down.sql +3 -0
  540. package/modules/metering/migrations/0002_metering_bucket_export.up.sql +5 -0
  541. package/modules/metering/migrations/README.md +3 -0
  542. package/modules/metering/module.json +46 -0
  543. package/modules/metering/package.json +50 -0
  544. package/modules/metering/spec/module.yaml +269 -0
  545. package/modules/metering/src/acl/permissions.ts +5 -0
  546. package/modules/metering/src/api/endpoints.ts +104 -0
  547. package/modules/metering/src/cli/commands.json +28 -0
  548. package/modules/metering/src/cli/index.ts +246 -0
  549. package/modules/metering/src/client/LimitsView.tsrx +170 -0
  550. package/modules/metering/src/client/UsageSummaryWidget.tsrx +63 -0
  551. package/modules/metering/src/client/UsageView.tsrx +205 -0
  552. package/modules/metering/src/client/api.ts +91 -0
  553. package/modules/metering/src/client/contribution.tsrx +42 -0
  554. package/modules/metering/src/client/index.ts +26 -0
  555. package/modules/metering/src/client/navigation.ts +54 -0
  556. package/modules/metering/src/client/presentation.ts +63 -0
  557. package/modules/metering/src/client/state.ts +31 -0
  558. package/modules/metering/src/domain/meters.ts +100 -0
  559. package/modules/metering/src/domain/types.ts +71 -0
  560. package/modules/metering/src/index.ts +51 -0
  561. package/modules/metering/src/platform.ts +84 -0
  562. package/modules/metering/src/server/index.ts +40 -0
  563. package/modules/metering/src/server/runtime.ts +165 -0
  564. package/modules/metering/src/services/data-classes.ts +34 -0
  565. package/modules/metering/src/services/database-repository.ts +574 -0
  566. package/modules/metering/src/services/index.ts +9 -0
  567. package/modules/metering/src/services/meter-registry.ts +145 -0
  568. package/modules/metering/src/services/metering-service.ts +441 -0
  569. package/modules/metering/src/services/migration.ts +183 -0
  570. package/modules/metering/src/services/notifications.ts +75 -0
  571. package/modules/metering/src/services/reports.ts +105 -0
  572. package/modules/metering/src/services/repository.ts +132 -0
  573. package/modules/metering/src/services/service-error.ts +46 -0
  574. package/modules/metering/src/settings.ts +47 -0
  575. package/modules/metering/translations/en.json +68 -0
  576. package/modules/metering/translations/pl.json +68 -0
  577. package/modules/notifications/migrations/0001_notifications_core.down.sql +1 -0
  578. package/modules/notifications/migrations/0001_notifications_core.up.sql +26 -0
  579. package/modules/notifications/migrations/0002_notifications_preferences.down.sql +1 -0
  580. package/modules/notifications/migrations/0002_notifications_preferences.up.sql +17 -0
  581. package/modules/notifications/migrations/0003_notifications_webhook_subscriptions.down.sql +1 -0
  582. package/modules/notifications/migrations/0003_notifications_webhook_subscriptions.up.sql +30 -0
  583. package/modules/notifications/migrations/0004_notifications_deliveries.down.sql +1 -0
  584. package/modules/notifications/migrations/0004_notifications_deliveries.up.sql +35 -0
  585. package/modules/notifications/migrations/0005_notifications_delivery_routing_role.down.sql +2 -0
  586. package/modules/notifications/migrations/0005_notifications_delivery_routing_role.up.sql +17 -0
  587. package/modules/notifications/migrations/0006_notifications_delivery_title.down.sql +1 -0
  588. package/modules/notifications/migrations/0006_notifications_delivery_title.up.sql +11 -0
  589. package/modules/notifications/migrations/0007_notifications_secret_rotation_inventory.down.sql +2 -0
  590. package/modules/notifications/migrations/0007_notifications_secret_rotation_inventory.up.sql +19 -0
  591. package/modules/notifications/migrations/0008_notifications_delivery_claim.down.sql +8 -0
  592. package/modules/notifications/migrations/0008_notifications_delivery_claim.up.sql +19 -0
  593. package/modules/notifications/migrations/0009_notifications_kind_approvals.down.sql +16 -0
  594. package/modules/notifications/migrations/0009_notifications_kind_approvals.up.sql +18 -0
  595. package/modules/notifications/migrations/0010_notifications_kind_meter_threshold.down.sql +16 -0
  596. package/modules/notifications/migrations/0010_notifications_kind_meter_threshold.up.sql +18 -0
  597. package/modules/notifications/migrations/0011_notifications_retention_keyset.down.sql +5 -0
  598. package/modules/notifications/migrations/0011_notifications_retention_keyset.up.sql +15 -0
  599. package/modules/notifications/migrations/0012_notifications_email_channel.down.sql +12 -0
  600. package/modules/notifications/migrations/0012_notifications_email_channel.up.sql +38 -0
  601. package/modules/notifications/migrations/0013_notifications_list_pages.down.sql +5 -0
  602. package/modules/notifications/migrations/0013_notifications_list_pages.up.sql +13 -0
  603. package/modules/notifications/migrations/README.md +3 -0
  604. package/modules/notifications/module.json +32 -0
  605. package/modules/notifications/package.json +49 -0
  606. package/modules/notifications/spec/module.yaml +718 -0
  607. package/modules/notifications/src/acl/permissions.ts +11 -0
  608. package/modules/notifications/src/api/endpoints.ts +814 -0
  609. package/modules/notifications/src/cli/commands.json +17 -0
  610. package/modules/notifications/src/cli/index.ts +126 -0
  611. package/modules/notifications/src/client/DeliveriesView.tsrx +483 -0
  612. package/modules/notifications/src/client/FactList.tsrx +24 -0
  613. package/modules/notifications/src/client/NotificationPreferencesView.tsrx +240 -0
  614. package/modules/notifications/src/client/NotificationsInboxView.tsrx +592 -0
  615. package/modules/notifications/src/client/UnreadCountWidget.tsrx +62 -0
  616. package/modules/notifications/src/client/WebhookForm.tsrx +297 -0
  617. package/modules/notifications/src/client/WebhooksView.tsrx +637 -0
  618. package/modules/notifications/src/client/api.ts +382 -0
  619. package/modules/notifications/src/client/contribution.tsrx +83 -0
  620. package/modules/notifications/src/client/inbox.ts +41 -0
  621. package/modules/notifications/src/client/index.ts +29 -0
  622. package/modules/notifications/src/client/navigation.ts +92 -0
  623. package/modules/notifications/src/client/notifications.css +70 -0
  624. package/modules/notifications/src/client/presentation.ts +81 -0
  625. package/modules/notifications/src/client/state.ts +246 -0
  626. package/modules/notifications/src/client/unread-count.ts +26 -0
  627. package/modules/notifications/src/domain/locale.ts +47 -0
  628. package/modules/notifications/src/domain/publish.ts +46 -0
  629. package/modules/notifications/src/domain/types.ts +186 -0
  630. package/modules/notifications/src/index.ts +62 -0
  631. package/modules/notifications/src/platform.ts +85 -0
  632. package/modules/notifications/src/server/index.ts +82 -0
  633. package/modules/notifications/src/server/runtime.ts +251 -0
  634. package/modules/notifications/src/services/data-classes.ts +139 -0
  635. package/modules/notifications/src/services/database-repository.ts +1334 -0
  636. package/modules/notifications/src/services/delivery-payload.ts +93 -0
  637. package/modules/notifications/src/services/delivery-runner.ts +170 -0
  638. package/modules/notifications/src/services/delivery-service.ts +811 -0
  639. package/modules/notifications/src/services/egress.ts +239 -0
  640. package/modules/notifications/src/services/email-channel.ts +93 -0
  641. package/modules/notifications/src/services/index.ts +23 -0
  642. package/modules/notifications/src/services/migration.ts +572 -0
  643. package/modules/notifications/src/services/notifications-service.ts +297 -0
  644. package/modules/notifications/src/services/paging.ts +60 -0
  645. package/modules/notifications/src/services/publish-service.ts +133 -0
  646. package/modules/notifications/src/services/repository.ts +342 -0
  647. package/modules/notifications/src/services/secret-rotation.ts +177 -0
  648. package/modules/notifications/src/services/secret-vault.ts +168 -0
  649. package/modules/notifications/src/services/service-error.ts +67 -0
  650. package/modules/notifications/src/services/signature.ts +81 -0
  651. package/modules/notifications/src/services/webhook-service.ts +307 -0
  652. package/modules/notifications/src/settings.ts +130 -0
  653. package/modules/notifications/translations/en.json +255 -0
  654. package/modules/notifications/translations/pl.json +255 -0
  655. package/modules/profile/module.json +3 -3
  656. package/modules/profile/package.json +1 -1
  657. package/modules/profile/spec/module.yaml +3 -3
  658. package/modules/profile/src/services/database-repository.ts +3 -13
  659. package/modules/reports/module.json +28 -0
  660. package/modules/reports/package.json +42 -0
  661. package/modules/reports/spec/module.yaml +231 -0
  662. package/modules/reports/src/acl/permissions.ts +5 -0
  663. package/modules/reports/src/api/endpoints.ts +72 -0
  664. package/modules/reports/src/client/ReportsSummaryWidget.tsrx +52 -0
  665. package/modules/reports/src/client/ReportsView.tsrx +246 -0
  666. package/modules/reports/src/client/api.ts +65 -0
  667. package/modules/reports/src/client/contribution.tsrx +36 -0
  668. package/modules/reports/src/client/index.ts +18 -0
  669. package/modules/reports/src/client/navigation.ts +39 -0
  670. package/modules/reports/src/client/presentation.ts +123 -0
  671. package/modules/reports/src/client/state.ts +28 -0
  672. package/modules/reports/src/domain/providers.ts +115 -0
  673. package/modules/reports/src/domain/types.ts +44 -0
  674. package/modules/reports/src/index.ts +47 -0
  675. package/modules/reports/src/platform.ts +37 -0
  676. package/modules/reports/src/server/index.ts +21 -0
  677. package/modules/reports/src/server/runtime.ts +40 -0
  678. package/modules/reports/src/services/index.ts +17 -0
  679. package/modules/reports/src/services/provider-registry.ts +144 -0
  680. package/modules/reports/src/services/range.ts +65 -0
  681. package/modules/reports/src/services/reports-service.ts +316 -0
  682. package/modules/reports/src/services/service-error.ts +26 -0
  683. package/modules/reports/src/settings.ts +49 -0
  684. package/modules/reports/translations/en.json +35 -0
  685. package/modules/reports/translations/pl.json +35 -0
  686. package/modules/sandbox/module.json +4 -4
  687. package/modules/sandbox/package.json +1 -1
  688. package/modules/sandbox/spec/module.yaml +3 -3
  689. package/modules/sandbox/src/services/database-repository.ts +14 -23
  690. package/modules/sandbox/src/services/directory.ts +16 -0
  691. package/modules/sandbox/src/services/sandbox-service.ts +13 -11
  692. package/modules/search/migrations/0001_search_core.down.sql +1 -0
  693. package/modules/search/migrations/0001_search_core.up.sql +22 -0
  694. package/modules/search/migrations/0002_search_recent_export.down.sql +3 -0
  695. package/modules/search/migrations/0002_search_recent_export.up.sql +5 -0
  696. package/modules/search/migrations/README.md +3 -0
  697. package/modules/search/module.json +28 -0
  698. package/modules/search/package.json +43 -0
  699. package/modules/search/spec/module.yaml +177 -0
  700. package/modules/search/src/acl/permissions.ts +5 -0
  701. package/modules/search/src/api/endpoints.ts +221 -0
  702. package/modules/search/src/client/SearchView.tsrx +346 -0
  703. package/modules/search/src/client/api.ts +157 -0
  704. package/modules/search/src/client/contribution.tsrx +31 -0
  705. package/modules/search/src/client/index.ts +17 -0
  706. package/modules/search/src/client/navigation.ts +97 -0
  707. package/modules/search/src/client/search.css +56 -0
  708. package/modules/search/src/client/state.ts +113 -0
  709. package/modules/search/src/domain/data-classes.ts +73 -0
  710. package/modules/search/src/domain/providers.ts +88 -0
  711. package/modules/search/src/domain/types.ts +56 -0
  712. package/modules/search/src/index.ts +46 -0
  713. package/modules/search/src/platform.ts +42 -0
  714. package/modules/search/src/server/index.ts +25 -0
  715. package/modules/search/src/server/runtime.ts +123 -0
  716. package/modules/search/src/services/database-repository.ts +163 -0
  717. package/modules/search/src/services/index.ts +21 -0
  718. package/modules/search/src/services/migration.ts +65 -0
  719. package/modules/search/src/services/provider-registry.ts +137 -0
  720. package/modules/search/src/services/repository.ts +43 -0
  721. package/modules/search/src/services/search-service.ts +442 -0
  722. package/modules/search/src/services/service-error.ts +35 -0
  723. package/modules/search/src/settings.ts +68 -0
  724. package/modules/search/translations/en.json +45 -0
  725. package/modules/search/translations/pl.json +45 -0
  726. package/modules/system/module.json +2 -2
  727. package/modules/system/package.json +1 -1
  728. package/modules/system/spec/module.yaml +30 -3
  729. package/modules/system/src/client/FlagsPanel.tsrx +127 -0
  730. package/modules/system/src/client/ModuleSettingRow.tsrx +17 -7
  731. package/modules/system/src/client/ModuleSettingsSection.tsrx +10 -71
  732. package/modules/system/src/client/ModulesView.tsrx +91 -65
  733. package/modules/system/src/client/flags.ts +35 -0
  734. package/modules/system/src/client/index.ts +8 -0
  735. package/modules/system/src/client/navigation.ts +8 -0
  736. package/modules/system/src/client/settings-state.ts +159 -0
  737. package/modules/system/src/client/state.ts +2 -0
  738. package/modules/system/src/domain/time-zone.ts +105 -0
  739. package/modules/system/src/index.ts +12 -0
  740. package/modules/system/src/platform.ts +5 -1
  741. package/modules/system/src/server/endpoints.ts +72 -21
  742. package/modules/system/src/settings.ts +28 -0
  743. package/modules/system/translations/en.json +17 -0
  744. package/modules/system/translations/pl.json +17 -0
  745. package/modules/users/module.json +30 -4
  746. package/modules/users/package.json +4 -1
  747. package/modules/users/spec/module.yaml +290 -7
  748. package/modules/users/src/api/endpoints.ts +228 -15
  749. package/modules/users/src/client/InviteMemberForm.tsrx +2 -2
  750. package/modules/users/src/client/MemberDrawer.tsrx +142 -26
  751. package/modules/users/src/client/UserAccountForm.tsrx +2 -2
  752. package/modules/users/src/client/UsersView.tsrx +432 -71
  753. package/modules/users/src/client/api.ts +106 -12
  754. package/modules/users/src/client/contribution.tsrx +5 -0
  755. package/modules/users/src/client/member-columns.tsrx +22 -9
  756. package/modules/users/src/client/state.ts +172 -7
  757. package/modules/users/src/domain/lists.ts +9 -0
  758. package/modules/users/src/index.ts +11 -0
  759. package/modules/users/src/platform.ts +50 -1
  760. package/modules/users/src/services/member-export.ts +51 -0
  761. package/modules/users/src/services/member-import.ts +249 -0
  762. package/modules/users/src/services/member-search.ts +145 -0
  763. package/modules/users/src/services/users-service.ts +117 -4
  764. package/modules/users/translations/en.json +57 -8
  765. package/modules/users/translations/pl.json +57 -8
  766. package/modules/workflows/migrations/0004_payload_rotation_inventory.up.sql +17 -0
  767. package/modules/workflows/migrations/0005_workflows_human_approval.up.sql +28 -0
  768. package/modules/workflows/migrations/0006_workflows_retention_indexes.up.sql +11 -0
  769. package/modules/workflows/migrations/0007_workflows_erasure_subject_indexes.up.sql +17 -0
  770. package/modules/workflows/migrations/0008_workflows_subject_account.up.sql +24 -0
  771. package/modules/workflows/migrations/0009_workflows_definition_list_indexes.up.sql +9 -0
  772. package/modules/workflows/module.json +34 -6
  773. package/modules/workflows/package.json +2 -1
  774. package/modules/workflows/spec/module.yaml +26 -9
  775. package/modules/workflows/src/api/endpoints.ts +131 -25
  776. package/modules/workflows/src/cli/commands.json +17 -0
  777. package/modules/workflows/src/cli/index.ts +114 -0
  778. package/modules/workflows/src/client/WorkflowExecutionHistory.tsrx +36 -27
  779. package/modules/workflows/src/client/WorkflowInspector.tsrx +116 -0
  780. package/modules/workflows/src/client/WorkflowNodePalette.tsrx +1 -0
  781. package/modules/workflows/src/client/WorkflowsView.tsrx +236 -99
  782. package/modules/workflows/src/client/api.ts +54 -34
  783. package/modules/workflows/src/client/canvas-model.ts +12 -0
  784. package/modules/workflows/src/client/state.ts +95 -0
  785. package/modules/workflows/src/domain/events.ts +25 -11
  786. package/modules/workflows/src/domain/graph.ts +135 -1
  787. package/modules/workflows/src/domain/types.ts +91 -4
  788. package/modules/workflows/src/platform.ts +12 -0
  789. package/modules/workflows/src/server/runtime.ts +78 -5
  790. package/modules/workflows/src/services/approvals.ts +62 -0
  791. package/modules/workflows/src/services/cursors.ts +37 -0
  792. package/modules/workflows/src/services/data-classes.ts +232 -0
  793. package/modules/workflows/src/services/database-repository.ts +660 -171
  794. package/modules/workflows/src/services/migration.ts +240 -0
  795. package/modules/workflows/src/services/notifications.ts +98 -0
  796. package/modules/workflows/src/services/payload-codec.ts +51 -28
  797. package/modules/workflows/src/services/payload-rotation.ts +171 -0
  798. package/modules/workflows/src/services/repository.ts +123 -8
  799. package/modules/workflows/src/services/simulation.ts +7 -0
  800. package/modules/workflows/src/services/worker.ts +446 -25
  801. package/modules/workflows/src/services/workflows-service.ts +264 -103
  802. package/modules/workflows/translations/en.json +12 -4
  803. package/modules/workflows/translations/pl.json +12 -4
  804. package/modules.json +48 -4
  805. package/package.json +64 -6
  806. package/packages/client/package.json +1 -0
  807. package/packages/client/src/ApplicationShell.tsrx +43 -0
  808. package/packages/client/src/contributions.ts +55 -0
  809. package/packages/client/src/i18n/locales/en.json +5 -0
  810. package/packages/client/src/i18n/locales/pl.json +5 -0
  811. package/packages/client/src/index.ts +13 -1
  812. package/packages/client/src/routing.ts +22 -0
  813. package/packages/client/src/shell/CommandPalette.tsrx +223 -11
  814. package/packages/client/src/shell/command-search.ts +126 -0
  815. package/packages/client/src/shell/command.ts +30 -0
  816. package/packages/client/src/shell/navigation.ts +12 -0
  817. package/packages/client/src/shell/palette-keys.ts +27 -0
  818. package/packages/client/src/shell/shell.css +7 -0
  819. package/packages/contracts/schemas/module-spec.schema.json +287 -1
  820. package/packages/contracts/schemas/module.schema.json +25 -0
  821. package/packages/contracts/src/index.ts +144 -1
  822. package/packages/database/src/backup.ts +179 -0
  823. package/packages/database/src/decoders.ts +25 -0
  824. package/packages/database/src/index.ts +17 -0
  825. package/packages/database/src/record-history.ts +5 -14
  826. package/packages/harness/src/index.ts +2 -0
  827. package/packages/harness/src/runtime.ts +218 -1
  828. package/packages/harness/src/tool-adapters.ts +19 -1
  829. package/packages/kernel/src/acl.ts +179 -0
  830. package/packages/kernel/src/capability-registry.ts +69 -2
  831. package/packages/kernel/src/data-class-registry.ts +354 -0
  832. package/packages/kernel/src/index.ts +65 -4
  833. package/packages/kernel/src/keyring.ts +208 -0
  834. package/packages/kernel/src/module-compatibility.ts +35 -4
  835. package/packages/kernel/src/module-registry.ts +49 -2
  836. package/packages/kernel/src/module-settings.ts +189 -27
  837. package/packages/server/package.json +2 -1
  838. package/packages/server/src/composition.ts +38 -0
  839. package/packages/server/src/endpoint.ts +104 -47
  840. package/packages/server/src/export/csv.ts +34 -0
  841. package/packages/server/src/export/definition.ts +346 -0
  842. package/packages/server/src/export/index.ts +61 -0
  843. package/packages/server/src/export/run.ts +116 -0
  844. package/packages/server/src/index.ts +155 -0
  845. package/packages/server/src/jobs/index.ts +93 -0
  846. package/packages/server/src/jobs/runner.ts +486 -0
  847. package/packages/server/src/log.ts +291 -0
  848. package/packages/server/src/mail/config.ts +184 -0
  849. package/packages/server/src/mail/contracts.ts +251 -0
  850. package/packages/server/src/mail/index.ts +31 -0
  851. package/packages/server/src/mail/port.ts +101 -0
  852. package/packages/server/src/mail/smtp.ts +191 -0
  853. package/packages/server/src/mail/template.ts +105 -0
  854. package/packages/server/src/metrics.ts +447 -0
  855. package/packages/server/src/pagination.ts +246 -0
  856. package/packages/server/src/trace/context.ts +103 -0
  857. package/packages/server/src/trace/egress.ts +66 -0
  858. package/packages/server/src/trace/error-sink.ts +296 -0
  859. package/packages/server/src/trace/exporter.ts +295 -0
  860. package/packages/server/src/trace/index.ts +60 -0
  861. package/packages/server/src/trace/job-sink.ts +172 -0
  862. package/packages/server/src/trace/tracer.ts +338 -0
  863. package/packages/server/src/web.ts +5 -1
  864. package/packages/storage/package.json +40 -0
  865. package/packages/storage/src/config.ts +189 -0
  866. package/packages/storage/src/content-type.ts +124 -0
  867. package/packages/storage/src/contracts.ts +112 -0
  868. package/packages/storage/src/envelope.ts +189 -0
  869. package/packages/storage/src/index.ts +43 -0
  870. package/packages/storage/src/local.ts +75 -0
  871. package/packages/storage/src/port.ts +251 -0
  872. package/packages/storage/src/read-token.ts +130 -0
  873. package/packages/storage/src/s3.ts +144 -0
  874. package/packages/storage/src/scanner.ts +22 -0
  875. package/packages/storage/src/sigv4.ts +104 -0
  876. package/packages/storage/src/store.ts +13 -0
  877. package/packages/ui/package.json +1 -0
  878. package/packages/ui/src/components/Button.tsrx +3 -0
  879. package/packages/ui/src/components/ConfirmDialog.tsrx +13 -2
  880. package/packages/ui/src/components/DateField.tsrx +92 -0
  881. package/packages/ui/src/components/DatePicker.tsrx +525 -0
  882. package/packages/ui/src/components/DateRangeField.tsrx +93 -0
  883. package/packages/ui/src/components/Drawer.tsrx +10 -1
  884. package/packages/ui/src/components/FileUpload.tsrx +158 -0
  885. package/packages/ui/src/components/Pagination.tsrx +130 -0
  886. package/packages/ui/src/components/Select.tsrx +78 -0
  887. package/packages/ui/src/components/Table.tsrx +498 -81
  888. package/packages/ui/src/components/Tabs.tsrx +53 -0
  889. package/packages/ui/src/components/ToastHost.tsrx +48 -0
  890. package/packages/ui/src/components/calendar.ts +243 -0
  891. package/packages/ui/src/components/date-field.ts +62 -0
  892. package/packages/ui/src/components/file-upload.ts +49 -0
  893. package/packages/ui/src/components/focus-trap.ts +62 -0
  894. package/packages/ui/src/components/pagination.ts +68 -0
  895. package/packages/ui/src/components/table-sorting.ts +49 -0
  896. package/packages/ui/src/components/tabs.ts +61 -0
  897. package/packages/ui/src/components/toast-store.ts +116 -0
  898. package/packages/ui/src/icons/Icon.tsrx +5 -0
  899. package/packages/ui/src/index.ts +45 -0
  900. package/packages/ui/src/styles/components.css +598 -0
  901. package/modules/automations-workflows-integration/module.json +0 -27
  902. package/modules/automations-workflows-integration/spec/module.yaml +0 -93
  903. package/modules/automations-workflows-integration/src/index.ts +0 -14
  904. package/modules/automations-workflows-integration/src/platform.ts +0 -24
  905. package/modules/automations-workflows-integration/src/server/index.ts +0 -11
  906. package/modules/automations-workflows-integration/translations/en.json +0 -21
  907. package/modules/automations-workflows-integration/translations/pl.json +0 -21
  908. package/modules/workflows/src/services/cursor-codec.ts +0 -62
@@ -1,6 +1,6 @@
1
- schemaVersion: 1
1
+ schemaVersion: 2
2
2
  id: users.core
3
- specVersion: 0.6.0
3
+ specVersion: 0.9.8
4
4
  status: approved
5
5
  name: User Management Core
6
6
  description: Provides the tenant-scoped user directory and member administration (creation, display name, role assignment, per-member scopes, account status, password reset, session revocation, removal) through the public auth administration port.
@@ -11,23 +11,40 @@ capabilities:
11
11
  - translations
12
12
  dependencies:
13
13
  - id: system.core
14
- range: 0.5.0
14
+ range: ^0.7.0
15
15
  - id: auth.core
16
- range: 0.10.0
16
+ range: ^0.13.0
17
+ - id: search.core
18
+ range: ^0.1.0
19
+ - id: import.core
20
+ range: ^0.1.0
21
+ - id: exports.core
22
+ range: ^0.2.0
23
+ requires:
24
+ - id: search.providers.v1
25
+ optional: true
26
+ - id: import.ports.v1
27
+ optional: true
28
+ - id: exports.lists.v1
29
+ optional: true
17
30
  tenancy: required
18
31
  locales:
19
32
  - en
20
33
  - pl
21
34
  invariants:
35
+ - Member status is per workspace. Disabling a member through users.core disables only that membership through the auth administration port, revoking its sessions and API tokens in this workspace and leaving the person's other workspaces and the global account status untouched; re-enabling restores sign-in without restoring revoked tokens.
22
36
  - Every directory query and mutation is restricted to the authenticated tenant.
23
37
  - Password hashes, session tokens, and CSRF tokens are never returned by user administration APIs.
24
38
  - Roles are selected from the platform role catalog and determine server-side scope grants.
25
39
  - The module contributes separate user-directory and role-catalog screens through its client contribution without editing the application shell.
26
40
  - A tenant must retain at least one active owner.
27
- - Account creation requires an explicit initial password and never logs it.
41
+ - Account creation through the user administration API requires an explicit initial password and never logs it; a member created by the members import target receives no credential at all instead, through the auth administration port's credential-less entry point, so that member holds no password until an administrator sets a temporary one or the member completes the public reset flow, and nothing was ever drawn that could be guessed or leaked.
28
42
  - Only an owner may create or promote an owner, change another owner, or hand out scopes it does not hold itself.
29
43
  - Disabling, removing, or demoting a member never leaves the tenant without an active owner, and never targets the acting principal.
30
44
  - Every member administration write is recorded in the auth audit trail with the acting principal.
45
+ - The member search provider registered with search.providers.v1 reads members only through the auth administration port, under the tenant of the searching principal and behind users.members.read; it holds no index and no copy of a membership. The predicate and the bound are pushed into the port, which answers at most the documented number of members whose display name or whose normalised address starts with the term. Because that rule is a prefix, the provider pushes the terms of the query in the order they were typed, one read each, stops at the first term that answers rows and makes at most three reads for one query, so a request never reads a workspace of unknown size and the same set is found whichever order the terms were typed in; every term and the ranking are then applied to the rows that came back, and a member no term of the first three opens is not found.
46
+ - The members import target registered with import.ports.v1 as users.core.members accepts email (required), displayName (required) and role (optional, a role key of the workspace, defaulting to member), keys rows by the address folded the way auth.core stores one, trimmed, NFKC normalised and lower cased, so import.core refuses a repeat spelled in another case wherever in the file it stands, resolves that natural key per batch by asking the auth administration port about the addresses the batch names rather than by listing the workspace, and is behind users.members.manage; create-only creates an absent member and refuses an existing one with ALREADY_EXISTS, update-existing creates an absent member and applies the display name and then the role of an existing one, so the write that can only be refused for its own shape lands first and a role auth.core refuses afterwards leaves the row updated with the reason ROLE_UNCHANGED:<code> rather than denying a change that already happened, skip-existing leaves an existing member untouched; every write goes through the auth administration port with the principal that started the job, a refused row never fails another row, and a deployment without import.core still composes users.core.
47
+ - The members list export registered with exports.lists.v1 as users.core.members declares the e-mail, display name, role, workspace status and joined-at columns, is behind users.members.read, and is walked by exports.core under the principal that started the job through the auth administration port, so a file can never carry a member of another workspace or a column the Members screen would not have shown. The walk is the administration port's own paged member listing, one bounded page per call, so an export of M members reads M rows rather than one roll per page. Its keyset is the account id and not the display name the unpaged roll is ordered by, so a member renamed while a long walk runs cannot cross a page boundary and be written twice or skipped, and a member removed mid-walk does not strand the cursor. The Members screen starts a job through exports.core's own start route and links to the Exports screen, and a deployment without exports.core still composes users.core and registers nothing.
31
48
  permissions:
32
49
  - id: users.members.read
33
50
  description: Read memberships in the active tenant.
@@ -36,11 +53,261 @@ permissions:
36
53
  dataOwnership:
37
54
  - auth.core owns accounts, memberships, roles, scopes, credentials, and sessions.
38
55
  - users.core owns the administration use cases and UI but writes only through the public auth administration port.
56
+ entities:
57
+ - id: member
58
+ name: Workspace member
59
+ description: One membership of the active workspace as the auth administration port answers it; auth.core owns the row and users.core reads and writes it only through the port, never through a table of its own.
60
+ fields:
61
+ - id: accountId
62
+ type: string
63
+ required: true
64
+ maxLength: 128
65
+ description: The auth.core account id; the record reference every member action names.
66
+ - id: email
67
+ type: string
68
+ required: true
69
+ unique: tenant
70
+ maxLength: 254
71
+ description: Shown read-only; auth.core owns the address and folds it for uniqueness.
72
+ - id: displayName
73
+ type: string
74
+ required: true
75
+ maxLength: 80
76
+ - id: role
77
+ type: string
78
+ required: true
79
+ maxLength: 32
80
+ description: A role key of the workspace, selected from the role catalog the context read answers.
81
+ - id: membershipStatus
82
+ type: enum
83
+ required: true
84
+ values:
85
+ - active
86
+ - disabled
87
+ description: This workspace's own status for the member; the single membership status path changes it.
88
+ - id: status
89
+ type: enum
90
+ required: true
91
+ values:
92
+ - active
93
+ - disabled
94
+ description: The account's platform-level status; shown read-only, changed by the deployment operator outside this module's screens.
95
+ - id: scopes
96
+ type: json
97
+ required: true
98
+ description: Array of scope identifiers granted to this membership; the list shows the count and the drawer edits the set.
99
+ - id: passwordChangeRequired
100
+ type: boolean
101
+ required: true
102
+ description: True after an administrator set a temporary password and until the member chose a new one.
103
+ states:
104
+ field: membershipStatus
105
+ values:
106
+ - active
107
+ - disabled
108
+ transitions:
109
+ - from: active
110
+ to: disabled
111
+ permission: users.members.manage
112
+ - from: disabled
113
+ to: active
114
+ permission: users.members.manage
115
+ - id: role
116
+ name: Workspace role
117
+ description: One role of the platform role catalog as auth.core's role routes answer it; users.core contributes the screen and owns nothing of the role.
118
+ fields:
119
+ - id: key
120
+ type: string
121
+ required: true
122
+ unique: tenant
123
+ maxLength: 32
124
+ - id: name
125
+ type: string
126
+ required: true
127
+ maxLength: 80
128
+ - id: scopes
129
+ type: json
130
+ required: true
131
+ description: Array of the effective permission scopes the role grants.
132
+ - id: builtin
133
+ type: boolean
134
+ required: true
135
+ description: True for Owner and Member, which are immutable.
136
+ screens:
137
+ - id: members
138
+ kind: list
139
+ entity: member
140
+ title: Members
141
+ columns:
142
+ - displayName
143
+ - email
144
+ - role
145
+ - membershipStatus
146
+ - status
147
+ - passwordChangeRequired
148
+ - scopes
149
+ filters:
150
+ - displayName
151
+ - email
152
+ - membershipStatus
153
+ navigationGroup: Administration
154
+ - id: member
155
+ kind: record
156
+ entity: member
157
+ title: Member
158
+ columns:
159
+ - displayName
160
+ - email
161
+ - role
162
+ - scopes
163
+ - membershipStatus
164
+ - status
165
+ navigationGroup: Administration
166
+ - id: new-member
167
+ kind: form
168
+ entity: member
169
+ title: New account
170
+ columns:
171
+ - email
172
+ - displayName
173
+ - role
174
+ navigationGroup: Administration
175
+ - id: invite-member
176
+ kind: form
177
+ title: Invite member
178
+ navigationGroup: Administration
179
+ - id: roles
180
+ kind: list
181
+ entity: role
182
+ title: Roles
183
+ columns:
184
+ - key
185
+ - name
186
+ - scopes
187
+ - builtin
188
+ navigationGroup: Administration
189
+ actions:
190
+ - id: list-members
191
+ entity: member
192
+ permission: users.members.read
193
+ kind: custom
194
+ risk: read
195
+ idempotent: true
196
+ description: Answer one page of the active workspace's members, sorted by display name or e-mail in either direction, narrowed by a name or address prefix and by membership status, cut by a signed keyset cursor bound to the workspace, the sort, the direction and the filters, with a page limit of at most 200.
197
+ - id: read-context
198
+ entity: member
199
+ permission: users.members.read
200
+ kind: custom
201
+ risk: read
202
+ idempotent: true
203
+ description: Answer what the Members screen needs beside the page, namely the workspace roles, the grantable scopes, the acting principal's account id and role, the shared password minimum length and the member count.
204
+ - id: create-member
205
+ entity: member
206
+ permission: users.members.manage
207
+ kind: create
208
+ risk: workspace-write
209
+ idempotent: false
210
+ description: Create the account and the tenant membership atomically with the role scope template from an e-mail, a display name, a role key and an explicit initial password that is never logged.
211
+ - id: rename-member
212
+ entity: member
213
+ permission: users.members.manage
214
+ kind: update
215
+ risk: workspace-write
216
+ idempotent: true
217
+ description: Change the display name of one member through the auth administration port.
218
+ - id: assign-role
219
+ entity: member
220
+ permission: users.members.manage
221
+ kind: update
222
+ risk: workspace-write
223
+ idempotent: true
224
+ description: Assign a role key of the workspace to one member through the single role assignment path; an owner or the owner role touched by a non-owner is refused.
225
+ - id: set-status
226
+ entity: member
227
+ permission: users.members.manage
228
+ kind: update
229
+ risk: workspace-write
230
+ idempotent: true
231
+ description: Set the account-level status of one member to active or disabled through the auth administration port; no workspace screen calls it, since the account block reaches every workspace the account belongs to.
232
+ - id: set-status-many
233
+ entity: member
234
+ permission: users.members.manage
235
+ kind: update
236
+ risk: workspace-write
237
+ idempotent: true
238
+ description: Deactivate selected, one of the two bulk actions the Members screen offers behind users.members.manage, taking between 1 and 100 unique account ids the screen selected on the page and never the acting principal; the server applies the status one id at a time through the single membership status path of the auth administration port, so every row keeps its own audit event and its own refusal (the acting principal, the last owner, an owner touched by a non-owner), a missing or another workspace's id is answered not-found, and the response carries one outcome per id in the order sent (updated, not-found or refused with its code) rather than failing the call.
239
+ - id: assign-role-many
240
+ entity: member
241
+ permission: users.members.manage
242
+ kind: update
243
+ risk: workspace-write
244
+ idempotent: true
245
+ description: Assign role, the second bulk action the Members screen offers behind users.members.manage, taking between 1 and 100 unique account ids the screen selected on the page and never the acting principal; the server applies the role one id at a time through the single role assignment path of the auth administration port, so every row keeps its own audit event and its own refusal (the acting principal, the last owner, an owner or the owner role touched by a non-owner), a missing or another workspace's id is answered not-found, and the response carries one outcome per id in the order sent (updated, not-found or refused with its code) rather than failing the call.
246
+ - id: remove-member
247
+ entity: member
248
+ permission: users.members.manage
249
+ kind: delete
250
+ risk: destructive
251
+ idempotent: true
252
+ description: Remove one membership from the workspace through the auth administration port; never the acting principal or the last active owner.
253
+ - id: reset-password
254
+ entity: member
255
+ permission: users.members.manage
256
+ kind: custom
257
+ risk: workspace-write
258
+ idempotent: false
259
+ description: Set a temporary password for one member; every earlier session is gone and the member must choose a new password before using the workspace.
260
+ - id: set-scopes
261
+ entity: member
262
+ permission: users.members.manage
263
+ kind: update
264
+ risk: workspace-write
265
+ idempotent: true
266
+ description: Replace the scopes of one membership with at most 256 scope identifiers; a non-owner cannot grant a scope it does not hold.
267
+ widgets:
268
+ - id: access
269
+ slot: dashboard.metrics
270
+ entity: member
271
+ description: The member count of the workspace from the context read with a link to the Users screen; behind users.members.read.
272
+ - id: setup
273
+ slot: dashboard.main
274
+ entity: member
275
+ description: A setup step that links to the Users screen; behind users.members.manage.
276
+ settings: []
277
+ agentTools: []
278
+ outOfScope:
279
+ - The account-level block is not offered by the Members screen; the drawer shows the account status read-only and workspace access changes through the membership status route.
280
+ - Role creation, editing and deletion happen through auth.core's role routes behind auth.roles.manage; users.core contributes the Roles screen only.
281
+ decisions:
282
+ - id: D-USERS-ENTITIES
283
+ question: Does users.core own a table for the member or the role entity?
284
+ answer: No. Both entities describe records auth.core owns and answers through its public administration port and role routes; the module declares no database capability and no migration.
285
+ decidedBy: default
286
+ - id: D-USERS-BULK-ACTIONS
287
+ question: How are the two bulk actions of the Members screen declared?
288
+ answer: As the actions set-status-many and assign-role-many, each behind users.members.manage and each applied one id at a time through the single-row path, with the USERS-STATUS-MANY and USERS-ROLE-MANY scenarios as their evidence.
289
+ decidedBy: default
290
+ - id: D-USERS-JOINED-AT
291
+ question: Why does the member entity not declare the joined-at instant the export carries?
292
+ answer: The instant is auth.core's createdAt column, and createdAt is a field id every tenant table owns, so the specification cannot declare it; the export list still carries it as documented in the invariants.
293
+ decidedBy: default
39
294
  acceptanceScenarios:
40
295
  - id: USERS-LIST
41
296
  given: An authenticated principal has users.members.read in an active tenant.
42
297
  when: The principal requests the user directory.
43
- then: Only memberships from the active tenant are returned without credential or session material.
298
+ then: Only memberships from the active tenant are returned without credential or session material, one page at a time, and the roles, grantable scopes, acting principal and member count the screen needs come from the separate context read.
299
+ - id: USERS-PAGE
300
+ given: A workspace holding more members than one page carries, and another workspace with members of its own.
301
+ when: A screen lists the members with a page limit of at most 200, follows the cursor it receives to the end sorted by display name or by e-mail in either direction, narrows by a name or address prefix and by membership status, and presents a cursor this server did not sign, one of the other workspace, or one issued for another sort or filter.
302
+ then: Every member of the workspace is answered exactly once across the pages in the order asked, the cursor is answered only on a full page and is opaque and bound to the workspace, the sort, the direction and the filters, the prefix and the status are applied by the query rather than by the screen, an unknown sort key or direction is refused, and every mismatched or forged cursor is refused with CURSOR_INVALID.
303
+ - id: USERS-STATUS-MANY
304
+ given: A principal holding users.members.manage selects several members on the Members screen, and the request also names an id that does not exist, an id of another workspace and the acting principal's own id.
305
+ when: The principal deactivates them in one call naming the selected ids.
306
+ then: A list of no ids, of more than 100, or one repeating an id is refused with INVALID_INPUT before any membership is touched; otherwise each named member of the workspace is disabled through the single membership status path with its own audit event, the missing and the foreign id are answered not-found, the acting principal is answered refused with SELF_TARGET, an owner named by a non-owner is refused with OWNER_REQUIRED and the last active owner with LAST_OWNER, every other id is updated, the response carries one outcome per id in the order sent, and a call without the permission or the CSRF proof is refused first.
307
+ - id: USERS-ROLE-MANY
308
+ given: A principal holding users.members.manage selects several members and picks a role of the workspace.
309
+ when: The principal assigns the role in one call naming the selected ids.
310
+ then: The same bounds and refusals apply as for the bulk status change, each member of the workspace receives the role through the single assignment path with its own audit event, a non-owner naming an owner or the owner role is refused per id with OWNER_REQUIRED, and the screen reloads the listing and reports the updated, missing and refused counts.
44
311
  - id: USERS-CREATE
45
312
  given: An authenticated principal has users.members.manage and supplies valid account details and a supported role.
46
313
  when: The principal creates a tenant member.
@@ -55,7 +322,7 @@ acceptanceScenarios:
55
322
  then: Users and Roles appear as separate Administration navigation entries backed by views from the same module contribution.
56
323
  - id: USERS-EDIT
57
324
  given: A principal with users.members.manage selects a member of the active tenant.
58
- when: The principal changes the display name, assigns a role from the tenant role list, replaces the member's scopes, disables or re-enables the account, sets a temporary password, signs the member out everywhere, or removes the member.
325
+ when: The principal changes the display name, assigns a role from the tenant role list, replaces the member's scopes, disables or re-enables the membership in this workspace, sets a temporary password, signs the member out everywhere, or removes the member; the account-level block stays a deployment operator action outside this screen and is shown read-only.
59
326
  then: The change is applied through auth.core, the member row reflects it, and an audit event names the acting principal.
60
327
  - id: USERS-OWNER-CAP
61
328
  given: A principal with users.members.manage that is not an owner.
@@ -77,3 +344,19 @@ acceptanceScenarios:
77
344
  given: A principal with users.members.manage and a configured auth mail adapter.
78
345
  when: The principal sends an invitation to an email address with an assignable workspace role.
79
346
  then: Auth core delivers a single-use invitation without creating a membership before acceptance, and the Users screen reports delivery without exposing the token.
347
+ - id: USERS-MEMBERSHIP-STATUS
348
+ given: A member with sessions and API tokens in this workspace and an active membership in another workspace.
349
+ when: A principal with users.members.manage disables the member from the member drawer and later re-enables them.
350
+ then: This workspace's sessions and tokens are revoked and its sign-in refused while the other workspace keeps working, the drawer shows the membership status with its reason copy in both locales, and re-enabling restores sign-in without restoring revoked tokens.
351
+ - id: USERS-IMPORT
352
+ given: import.core composed before users.core and a principal holding users.members.manage that started an import job into users.core.members with rows of email, display name and role.
353
+ when: The file is written with create-only, repeated with create-only, skip-existing and update-existing, and a row names a role the workspace does not have, an address that is already an account elsewhere, or an address a row above it already carried in another case.
354
+ then: The first run creates the members with their role, their account id as the record reference and no password at all, so a sign-in is refused and a self-service credential change answers PASSWORD_NOT_SET rather than a wrong-password refusal; the repeat reports ALREADY_EXISTS, then skipped, then updated with the display name and role of the file; the unknown role and the repeated address are refused before any write, a role refused at write time after the display name was already changed leaves the row updated with ROLE_UNCHANGED and the member's new name, the address taken elsewhere fails its own row alone, and no member of another workspace is created or changed.
355
+ - id: USERS-EXPORT
356
+ given: exports.core composed either before or after users.core and a principal holding users.members.read in a workspace with more members than one export page carries.
357
+ when: exports.core walks users.core.members for a job that principal started from the Members screen, while another workspace holds members of its own and a member of the exported workspace is removed mid-walk.
358
+ then: The file carries the header and every member of the principal's workspace exactly once in account id order with their e-mail, display name, role, workspace status and joined-at instant, no member of the other workspace appears, the removed member's page cursor still answers the members that sort after it rather than ending the job, the list is registered exactly once whichever of the two modules composed first, and a deployment without exports.core composes users.core with no list registered.
359
+ - id: USERS-SEARCH
360
+ given: search.core composed before users.core and a principal holding users.members.read.
361
+ when: The principal searches a term that matches a member's display name or e-mail.
362
+ then: Only members of the principal's own workspace are returned as hits routed to the Users view, the port is asked for at most the documented bound however large a page the caller wants, the same set is found whichever order the terms were typed in, a principal without users.members.read is never asked, and a deployment without search.core still composes users.core.
@@ -1,27 +1,165 @@
1
+ import { createHash, randomBytes } from 'node:crypto';
1
2
  import {
3
+ decodeCursor,
2
4
  defineEndpoint,
5
+ encodeCursor,
3
6
  HttpProblem,
4
7
  jsonResponse,
8
+ pageResponse,
5
9
  problemResponse,
6
10
  readJsonObject,
11
+ readPageQuery,
7
12
  requiredString,
8
13
  type EndpointExecutionContext,
9
14
  } from '@flowdular/sdk/server';
15
+ import type { TenantMemberSort } from '@flowdular/sdk/modules/auth';
10
16
  import type { AuthRuntime } from '@flowdular/sdk/modules/auth/server';
11
17
  import {
12
18
  AuthServiceError,
13
19
  endpointIdentityFromContext,
14
20
  principalFromContext,
15
21
  sessionMutationDenial,
22
+ TENANT_MEMBER_SEARCH_TERM_LENGTH,
23
+ TENANT_MEMBER_SORTS,
16
24
  } from '@flowdular/sdk/modules/auth/server';
17
25
  import { USER_PERMISSIONS } from '../acl/permissions.ts';
18
26
  import {
19
27
  UsersService,
28
+ MEMBER_BULK_LIMIT,
20
29
  type CreateUserInput,
30
+ type MemberListInput,
31
+ type MemberStatusFilter,
21
32
  } from '../services/users-service.ts';
22
33
 
23
34
  type Context = EndpointExecutionContext['octane'];
24
35
 
36
+ /** The default page of the Members screen, and the most it may ask for. */
37
+ export const MEMBER_PAGE_LIMIT = 50;
38
+ export const MEMBER_PAGE_MAX_LIMIT = 200;
39
+
40
+ /** The query parameters of one member page read, before the cursor. */
41
+ interface MemberListQuery {
42
+ readonly sort: TenantMemberSort;
43
+ readonly direction: 'asc' | 'desc';
44
+ readonly query: string;
45
+ readonly status: MemberStatusFilter;
46
+ }
47
+
48
+ function invalid(message: string): HttpProblem {
49
+ return new HttpProblem('INVALID_INPUT', message, 400);
50
+ }
51
+
52
+ function cursorInvalid(): HttpProblem {
53
+ return new HttpProblem(
54
+ 'CURSOR_INVALID',
55
+ 'The page cursor is not valid.',
56
+ 400,
57
+ );
58
+ }
59
+
60
+ function membershipStatus(
61
+ value: Record<string, unknown>,
62
+ ): 'active' | 'disabled' {
63
+ const status = requiredString(value, 'status', { max: 16 });
64
+ if (status !== 'active' && status !== 'disabled') {
65
+ throw invalid('status must be active or disabled.');
66
+ }
67
+ return status;
68
+ }
69
+
70
+ function accountIds(value: Record<string, unknown>): readonly string[] {
71
+ const raw = value.accountIds;
72
+ if (!Array.isArray(raw)) throw invalid('accountIds must be an array.');
73
+ if (raw.length < 1 || raw.length > MEMBER_BULK_LIMIT) {
74
+ throw invalid(
75
+ `accountIds must name between 1 and ${MEMBER_BULK_LIMIT} members.`,
76
+ );
77
+ }
78
+ const ids = raw.map((entry) =>
79
+ requiredString({ accountId: entry }, 'accountId', { max: 128 }),
80
+ );
81
+ if (new Set(ids).size !== ids.length) {
82
+ throw invalid('accountIds must not repeat an id.');
83
+ }
84
+ return ids;
85
+ }
86
+
87
+ function memberListQuery(url: URL): MemberListQuery {
88
+ const sort = url.searchParams.get('sort') ?? 'displayName';
89
+ if (!(TENANT_MEMBER_SORTS as readonly string[]).includes(sort)) {
90
+ throw invalid(`sort must be one of ${TENANT_MEMBER_SORTS.join(', ')}.`);
91
+ }
92
+ const direction = url.searchParams.get('direction') ?? 'asc';
93
+ if (direction !== 'asc' && direction !== 'desc') {
94
+ throw invalid('direction must be asc or desc.');
95
+ }
96
+ const query = url.searchParams.get('q') ?? '';
97
+ if (query.length > TENANT_MEMBER_SEARCH_TERM_LENGTH) {
98
+ throw invalid(
99
+ `q must contain at most ${TENANT_MEMBER_SEARCH_TERM_LENGTH} characters.`,
100
+ );
101
+ }
102
+ const status = url.searchParams.get('status') ?? '';
103
+ if (status !== '' && status !== 'active' && status !== 'disabled') {
104
+ throw invalid('status must be active or disabled.');
105
+ }
106
+ return {
107
+ sort: sort as TenantMemberSort,
108
+ direction,
109
+ query,
110
+ status: status === '' ? null : status,
111
+ };
112
+ }
113
+
114
+ /* The filters travel as a digest: a term of 200 multibyte characters beside a
115
+ full-length address would push the signed cursor past its length bound. */
116
+ function filtersDigest(query: MemberListQuery): string {
117
+ return createHash('sha256')
118
+ .update(JSON.stringify([query.query, query.status ?? '']))
119
+ .digest('hex')
120
+ .slice(0, 32);
121
+ }
122
+
123
+ /* The cursor names the position and the listing it belongs to: the workspace,
124
+ the sort, the direction and the filters. A cursor presented with any of them
125
+ changed would splice two listings, so it is refused rather than reused. */
126
+ function cursorPayload(
127
+ tenantId: string,
128
+ query: MemberListQuery,
129
+ keyset: { readonly sortValue: string; readonly accountId: string },
130
+ ): Record<string, string> {
131
+ return {
132
+ t: tenantId,
133
+ s: query.sort,
134
+ d: query.direction,
135
+ f: filtersDigest(query),
136
+ v: keyset.sortValue,
137
+ id: keyset.accountId,
138
+ };
139
+ }
140
+
141
+ function keysetFromCursor(
142
+ cursor: string,
143
+ secret: Uint8Array,
144
+ tenantId: string,
145
+ query: MemberListQuery,
146
+ ): MemberListInput['after'] {
147
+ const payload = decodeCursor(cursor, secret);
148
+ const expected = cursorPayload(tenantId, query, {
149
+ sortValue: '',
150
+ accountId: '',
151
+ });
152
+ for (const key of ['t', 's', 'd', 'f'] as const) {
153
+ if (payload[key] !== expected[key]) throw cursorInvalid();
154
+ }
155
+ const sortValue = payload.v;
156
+ const accountId = payload.id;
157
+ if (typeof sortValue !== 'string' || typeof accountId !== 'string') {
158
+ throw cursorInvalid();
159
+ }
160
+ return { sortValue, accountId };
161
+ }
162
+
25
163
  function errorResponse(error: unknown): Response {
26
164
  return error instanceof AuthServiceError
27
165
  ? jsonResponse(
@@ -59,6 +197,10 @@ function passwordField(value: Record<string, unknown>, key: string): string {
59
197
 
60
198
  export function createUserRoutes(auth: AuthRuntime) {
61
199
  const users = new UsersService(auth);
200
+ /* Module-owned and never stored: a cursor names a position in one
201
+ workspace's own list, so a restart invalidating one costs a client the
202
+ first page. */
203
+ const cursorSecret = randomBytes(32);
62
204
 
63
205
  const mutation = (
64
206
  id: string,
@@ -91,8 +233,56 @@ export function createUserRoutes(auth: AuthRuntime) {
91
233
  methods: ['GET'],
92
234
  access: { kind: 'permission', permission: USER_PERMISSIONS.read },
93
235
  resolveIdentity: endpointIdentityFromContext,
94
- handler: async ({ octane }) =>
95
- jsonResponse(await users.list(principalFromContext(octane)!)),
236
+ handler: async ({ octane }) => {
237
+ try {
238
+ const principal = principalFromContext(octane)!;
239
+ const url = new URL(octane.request.url);
240
+ const page = readPageQuery(url, {
241
+ maxLimit: MEMBER_PAGE_MAX_LIMIT,
242
+ defaultLimit: MEMBER_PAGE_LIMIT,
243
+ });
244
+ const query = memberListQuery(url);
245
+ const result = await users.list(principal, {
246
+ ...query,
247
+ limit: page.limit,
248
+ after: page.cursor
249
+ ? keysetFromCursor(
250
+ page.cursor,
251
+ cursorSecret,
252
+ principal.tenantId,
253
+ query,
254
+ )
255
+ : null,
256
+ });
257
+ return pageResponse({
258
+ items: result.members,
259
+ limit: page.limit,
260
+ nextCursor: result.next
261
+ ? encodeCursor(
262
+ cursorPayload(principal.tenantId, query, result.next),
263
+ cursorSecret,
264
+ )
265
+ : null,
266
+ });
267
+ } catch (error) {
268
+ return errorResponse(error);
269
+ }
270
+ },
271
+ });
272
+
273
+ const context = defineEndpoint({
274
+ id: 'users.members.context',
275
+ path: '/api/users/context',
276
+ methods: ['GET'],
277
+ access: { kind: 'permission', permission: USER_PERMISSIONS.read },
278
+ resolveIdentity: endpointIdentityFromContext,
279
+ handler: async ({ octane }) => {
280
+ try {
281
+ return jsonResponse(await users.context(principalFromContext(octane)!));
282
+ } catch (error) {
283
+ return errorResponse(error);
284
+ }
285
+ },
96
286
  });
97
287
 
98
288
  const create = mutation(
@@ -141,23 +331,40 @@ export function createUserRoutes(auth: AuthRuntime) {
141
331
  const status = mutation(
142
332
  'users.members.status',
143
333
  '/api/users/status',
144
- async (octane, payload) => {
145
- const value = requiredString(payload, 'status', { max: 16 });
146
- if (value !== 'active' && value !== 'disabled') {
147
- throw new HttpProblem(
148
- 'INVALID_INPUT',
149
- 'status must be active or disabled.',
150
- 400,
151
- );
152
- }
153
- return jsonResponse({
334
+ async (octane, payload) =>
335
+ jsonResponse({
154
336
  user: await users.setStatus(
155
337
  principalFromContext(octane)!,
156
338
  requiredString(payload, 'accountId', { max: 128 }),
157
- value,
339
+ membershipStatus(payload),
158
340
  ),
159
- });
160
- },
341
+ }),
342
+ );
343
+
344
+ const statusMany = mutation(
345
+ 'users.members.status-many',
346
+ '/api/users/status-many',
347
+ async (octane, payload) =>
348
+ jsonResponse({
349
+ outcomes: await users.setMembershipStatusMany(
350
+ principalFromContext(octane)!,
351
+ accountIds(payload),
352
+ membershipStatus(payload),
353
+ ),
354
+ }),
355
+ );
356
+
357
+ const roleMany = mutation(
358
+ 'users.members.role-many',
359
+ '/api/users/role-many',
360
+ async (octane, payload) =>
361
+ jsonResponse({
362
+ outcomes: await users.assignRoleMany(
363
+ principalFromContext(octane)!,
364
+ accountIds(payload),
365
+ requiredString(payload, 'role', { max: 32 }),
366
+ ),
367
+ }),
161
368
  );
162
369
 
163
370
  const remove = mutation(
@@ -200,10 +407,13 @@ export function createUserRoutes(auth: AuthRuntime) {
200
407
 
201
408
  return [
202
409
  list.serverRoute,
410
+ context.serverRoute,
203
411
  create.serverRoute,
204
412
  update.serverRoute,
205
413
  role.serverRoute,
206
414
  status.serverRoute,
415
+ statusMany.serverRoute,
416
+ roleMany.serverRoute,
207
417
  remove.serverRoute,
208
418
  resetPassword.serverRoute,
209
419
  setScopes.serverRoute,
@@ -212,10 +422,13 @@ export function createUserRoutes(auth: AuthRuntime) {
212
422
 
213
423
  export const endpoints = [
214
424
  'users.members.list',
425
+ 'users.members.context',
215
426
  'users.members.create',
216
427
  'users.members.update',
217
428
  'users.members.role',
218
429
  'users.members.status',
430
+ 'users.members.status-many',
431
+ 'users.members.role-many',
219
432
  'users.members.remove',
220
433
  'users.members.password-reset',
221
434
  'users.members.scopes',
@@ -1,9 +1,9 @@
1
1
  import { Alert, Button, FormField } from '@flowdular/sdk/ui';
2
2
  import { t } from '@flowdular/sdk/client';
3
- import type { UserDirectory } from '../services/users-service.ts';
3
+ import type { UsersContext } from '../services/users-service.ts';
4
4
 
5
5
  export interface InviteMemberFormProps {
6
- readonly roles: UserDirectory['roles'];
6
+ readonly roles: UsersContext['roles'];
7
7
  readonly canAssignOwner: boolean;
8
8
  readonly busy: boolean;
9
9
  readonly error: string;