@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.
- package/.ai/agents/sandbox/business-manager.md +5 -1
- package/.ai/blueprints/author-spec/README.md +1 -1
- package/.ai/blueprints/author-spec/spec-requirements.yaml +44 -0
- package/.ai/blueprints/author-spec/steps.yaml +5 -5
- package/.ai/blueprints/author-spec/templates/module.yaml +99 -3
- package/.ai/blueprints/edit-module/gates.yaml +4 -0
- package/.ai/blueprints/edit-module/required-files.yaml +9 -0
- package/.ai/blueprints/new-module/gates.yaml +4 -0
- package/.ai/blueprints/new-module/spec-requirements.yaml +2 -2
- package/.ai/blueprints/release/gates.yaml +4 -0
- package/.ai/platform-capabilities.md +128 -0
- package/.ai/policies/capabilities.yaml +100 -0
- package/.ai/policies/path-ownership.yaml +5 -2
- package/.ai/policies/task-budgets.yaml +5 -3
- package/.ai/references/catalog/module.json +4 -4
- package/.ai/references/catalog/package.json +2 -2
- package/.ai/references/catalog/spec/module.yaml +5 -3
- package/.ai/references/catalog/src/platform.ts +2 -0
- package/.ai/references/catalog/src/services/catalog-service.ts +89 -1
- package/.ai/references/catalog/src/services/data-classes.ts +47 -0
- package/.ai/references/catalog/src/services/database-repository.ts +98 -1
- package/.ai/references/catalog/src/services/repository.ts +22 -1
- package/.ai/references/catalog/tests/data-classes.test.ts +157 -0
- package/.ai/references/catalog.provenance.json +12 -10
- package/.ai/skills/README.md +10 -0
- package/.ai/skills/agent-tool-design/SKILL.md +1 -2
- package/.ai/skills/auth-security-review/SKILL.md +1 -1
- package/.ai/skills/business-agent-design/SKILL.md +0 -1
- package/.ai/skills/deploy-operate/SKILL.md +114 -0
- package/.ai/skills/module-new/SKILL.md +29 -3
- package/.ai/skills/module-update/SKILL.md +9 -3
- package/.ai/skills/perf-audit/SKILL.md +0 -1
- package/.ai/skills/release-eject-pr/SKILL.md +0 -1
- package/.ai/skills/spec-interview/SKILL.md +120 -0
- package/.ai/skills/test-hardening/SKILL.md +1 -0
- package/.ai/skills/ux-design/SKILL.md +34 -3
- package/.ai/skills/variables/SKILL.md +0 -2
- package/.ai/skills/workflow-development/SKILL.md +0 -1
- package/AGENTS.md +4 -0
- package/docs/agent-contract.md +2 -2
- package/docs/design-system.md +185 -31
- package/modules/access/migrations/0001_access_core.down.sql +1 -0
- package/modules/access/migrations/0001_access_core.up.sql +28 -0
- package/modules/access/migrations/README.md +3 -0
- package/modules/access/module.json +33 -0
- package/modules/access/package.json +43 -0
- package/modules/access/spec/module.yaml +225 -0
- package/modules/access/src/acl/permissions.ts +6 -0
- package/modules/access/src/api/endpoints.ts +244 -0
- package/modules/access/src/client/ActivityView.tsrx +245 -0
- package/modules/access/src/client/AttestationsView.tsrx +176 -0
- package/modules/access/src/client/ReviewView.tsrx +586 -0
- package/modules/access/src/client/api.ts +132 -0
- package/modules/access/src/client/contribution.tsrx +41 -0
- package/modules/access/src/client/index.ts +41 -0
- package/modules/access/src/client/navigation.ts +57 -0
- package/modules/access/src/client/presentation.ts +69 -0
- package/modules/access/src/client/state.ts +72 -0
- package/modules/access/src/domain/types.ts +189 -0
- package/modules/access/src/index.ts +38 -0
- package/modules/access/src/platform.ts +60 -0
- package/modules/access/src/server/index.ts +42 -0
- package/modules/access/src/server/runtime.ts +105 -0
- package/modules/access/src/services/access-service.ts +298 -0
- package/modules/access/src/services/audit-window.ts +78 -0
- package/modules/access/src/services/auth-directory.ts +72 -0
- package/modules/access/src/services/changes.ts +91 -0
- package/modules/access/src/services/data-classes.ts +28 -0
- package/modules/access/src/services/database-repository.ts +185 -0
- package/modules/access/src/services/directory.ts +102 -0
- package/modules/access/src/services/index.ts +33 -0
- package/modules/access/src/services/list-exports.ts +150 -0
- package/modules/access/src/services/migration.ts +54 -0
- package/modules/access/src/services/repository.ts +30 -0
- package/modules/access/src/services/review.ts +178 -0
- package/modules/access/translations/en.json +155 -0
- package/modules/access/translations/pl.json +155 -0
- package/modules/agents/migrations/0022_credential_rotation_inventory.down.sql +2 -0
- package/modules/agents/migrations/0022_credential_rotation_inventory.up.sql +7 -0
- package/modules/agents/migrations/0023_agents_retention_indexes.down.sql +2 -0
- package/modules/agents/migrations/0023_agents_retention_indexes.up.sql +9 -0
- package/modules/agents/migrations/0024_agent_meter_refusals.down.sql +3 -0
- package/modules/agents/migrations/0024_agent_meter_refusals.up.sql +22 -0
- package/modules/agents/migrations/0025_agent_list_indexes.down.sql +3 -0
- package/modules/agents/migrations/0025_agent_list_indexes.up.sql +11 -0
- package/modules/agents/module.json +30 -4
- package/modules/agents/package.json +2 -1
- package/modules/agents/spec/module.yaml +63 -5
- package/modules/agents/src/api/endpoints.ts +291 -33
- package/modules/agents/src/cli/commands.json +11 -0
- package/modules/agents/src/cli/index.ts +45 -0
- package/modules/agents/src/client/AgentDashboardWidget.tsrx +19 -11
- package/modules/agents/src/client/AgentDefinitionList.tsrx +53 -10
- package/modules/agents/src/client/AgentPlaygroundView.tsrx +4 -4
- package/modules/agents/src/client/AgentProceduresView.tsrx +2 -2
- package/modules/agents/src/client/AgentRunsView.tsrx +143 -40
- package/modules/agents/src/client/AgentsView.tsrx +109 -33
- package/modules/agents/src/client/api.ts +99 -21
- package/modules/agents/src/client/state.ts +97 -0
- package/modules/agents/src/domain/types.ts +44 -4
- package/modules/agents/src/platform.ts +42 -0
- package/modules/agents/src/server/action-execution.ts +201 -106
- package/modules/agents/src/server/runtime.ts +32 -0
- package/modules/agents/src/services/agent-service.ts +158 -30
- package/modules/agents/src/services/credential-rotation.ts +185 -0
- package/modules/agents/src/services/credential-vault.ts +71 -46
- package/modules/agents/src/services/data-classes.ts +176 -0
- package/modules/agents/src/services/database-repository.ts +393 -101
- package/modules/agents/src/services/metering.ts +111 -0
- package/modules/agents/src/services/migration.ts +109 -0
- package/modules/agents/src/services/module-agent-preflight.ts +17 -9
- package/modules/agents/src/services/notifications.ts +98 -0
- package/modules/agents/src/services/provider-repository.ts +9 -18
- package/modules/agents/src/services/provider-service.ts +1 -9
- package/modules/agents/src/services/reports.ts +107 -0
- package/modules/agents/src/services/repository.ts +86 -6
- package/modules/agents/src/services/usage-service.ts +2 -0
- package/modules/agents/src/services/worker.ts +114 -4
- package/modules/agents/src/settings.ts +14 -3
- package/modules/agents/translations/en.json +14 -4
- package/modules/agents/translations/pl.json +14 -4
- package/modules/approvals/migrations/0001_approvals_core.down.sql +3 -0
- package/modules/approvals/migrations/0001_approvals_core.up.sql +78 -0
- package/modules/approvals/migrations/0002_approvals_expiry_routing_role.down.sql +2 -0
- package/modules/approvals/migrations/0002_approvals_expiry_routing_role.up.sql +19 -0
- package/modules/approvals/migrations/0003_approvals_retention_indexes.down.sql +6 -0
- package/modules/approvals/migrations/0003_approvals_retention_indexes.up.sql +14 -0
- package/modules/approvals/migrations/0004_approvals_inbox_keyset_indexes.down.sql +5 -0
- package/modules/approvals/migrations/0004_approvals_inbox_keyset_indexes.up.sql +12 -0
- package/modules/approvals/migrations/README.md +3 -0
- package/modules/approvals/module.json +34 -0
- package/modules/approvals/package.json +43 -0
- package/modules/approvals/spec/module.yaml +318 -0
- package/modules/approvals/src/acl/permissions.ts +7 -0
- package/modules/approvals/src/api/endpoints.ts +457 -0
- package/modules/approvals/src/client/ApprovalRequestDrawer.tsrx +138 -0
- package/modules/approvals/src/client/ApprovalsView.tsrx +562 -0
- package/modules/approvals/src/client/PendingCountWidget.tsrx +52 -0
- package/modules/approvals/src/client/api.ts +203 -0
- package/modules/approvals/src/client/approvals.css +51 -0
- package/modules/approvals/src/client/contribution.tsrx +44 -0
- package/modules/approvals/src/client/index.ts +26 -0
- package/modules/approvals/src/client/navigation.ts +39 -0
- package/modules/approvals/src/client/pending-count.ts +26 -0
- package/modules/approvals/src/client/presentation.ts +52 -0
- package/modules/approvals/src/client/state.ts +141 -0
- package/modules/approvals/src/domain/capability.ts +95 -0
- package/modules/approvals/src/domain/types.ts +154 -0
- package/modules/approvals/src/index.ts +52 -0
- package/modules/approvals/src/platform.ts +128 -0
- package/modules/approvals/src/server/index.ts +42 -0
- package/modules/approvals/src/server/runtime.ts +181 -0
- package/modules/approvals/src/services/approvals-service.ts +557 -0
- package/modules/approvals/src/services/callbacks.ts +75 -0
- package/modules/approvals/src/services/data-classes.ts +167 -0
- package/modules/approvals/src/services/database-repository.ts +724 -0
- package/modules/approvals/src/services/eligibility.ts +121 -0
- package/modules/approvals/src/services/expiry-runner.ts +81 -0
- package/modules/approvals/src/services/index.ts +31 -0
- package/modules/approvals/src/services/migration.ts +222 -0
- package/modules/approvals/src/services/notifications.ts +95 -0
- package/modules/approvals/src/services/repository.ts +161 -0
- package/modules/approvals/src/services/service-error.ts +70 -0
- package/modules/approvals/src/settings.ts +102 -0
- package/modules/approvals/translations/en.json +104 -0
- package/modules/approvals/translations/pl.json +104 -0
- package/modules/audit/migrations/0001_audit_core.down.sql +8 -0
- package/modules/audit/migrations/0001_audit_core.up.sql +107 -0
- package/modules/audit/migrations/0002_audit_sweep_routing_role.down.sql +2 -0
- package/modules/audit/migrations/0002_audit_sweep_routing_role.up.sql +21 -0
- package/modules/audit/migrations/0003_audit_export_request.down.sql +12 -0
- package/modules/audit/migrations/0003_audit_export_request.up.sql +40 -0
- package/modules/audit/migrations/0004_audit_hold_seal_erasure.down.sql +17 -0
- package/modules/audit/migrations/0004_audit_hold_seal_erasure.up.sql +192 -0
- package/modules/audit/migrations/0005_audit_event_format.down.sql +17 -0
- package/modules/audit/migrations/0005_audit_event_format.up.sql +60 -0
- package/modules/audit/migrations/0006_audit_own_class_walks.down.sql +3 -0
- package/modules/audit/migrations/0006_audit_own_class_walks.up.sql +14 -0
- package/modules/audit/migrations/README.md +3 -0
- package/modules/audit/module.json +32 -0
- package/modules/audit/package.json +49 -0
- package/modules/audit/spec/module.yaml +809 -0
- package/modules/audit/src/acl/permissions.ts +7 -0
- package/modules/audit/src/api/endpoints.ts +315 -0
- package/modules/audit/src/cli/commands.json +95 -0
- package/modules/audit/src/cli/index.ts +658 -0
- package/modules/audit/src/client/DataClassesView.tsrx +420 -0
- package/modules/audit/src/client/ExportsView.tsrx +256 -0
- package/modules/audit/src/client/HoldsView.tsrx +604 -0
- package/modules/audit/src/client/SweepsView.tsrx +251 -0
- package/modules/audit/src/client/api.ts +185 -0
- package/modules/audit/src/client/contribution.tsrx +52 -0
- package/modules/audit/src/client/index.ts +23 -0
- package/modules/audit/src/client/navigation.ts +74 -0
- package/modules/audit/src/client/presentation.ts +105 -0
- package/modules/audit/src/client/state.ts +86 -0
- package/modules/audit/src/domain/data-classes.ts +16 -0
- package/modules/audit/src/domain/types.ts +339 -0
- package/modules/audit/src/index.ts +76 -0
- package/modules/audit/src/platform.ts +44 -0
- package/modules/audit/src/server/index.ts +177 -0
- package/modules/audit/src/server/runtime.ts +303 -0
- package/modules/audit/src/services/anchor-key.ts +143 -0
- package/modules/audit/src/services/anchor-rotation.ts +147 -0
- package/modules/audit/src/services/audit-runners.ts +278 -0
- package/modules/audit/src/services/backup-guard.ts +95 -0
- package/modules/audit/src/services/database-repository.ts +1946 -0
- package/modules/audit/src/services/declared-classes.ts +64 -0
- package/modules/audit/src/services/erasure-port.ts +126 -0
- package/modules/audit/src/services/erasure-service.ts +770 -0
- package/modules/audit/src/services/export-directory.ts +106 -0
- package/modules/audit/src/services/export-service.ts +714 -0
- package/modules/audit/src/services/hold-service.ts +295 -0
- package/modules/audit/src/services/index.ts +17 -0
- package/modules/audit/src/services/migration.ts +658 -0
- package/modules/audit/src/services/own-classes.ts +318 -0
- package/modules/audit/src/services/platform-version.ts +23 -0
- package/modules/audit/src/services/repository.ts +495 -0
- package/modules/audit/src/services/retention-service.ts +191 -0
- package/modules/audit/src/services/seal-service.ts +769 -0
- package/modules/audit/src/services/service-error.ts +61 -0
- package/modules/audit/src/services/subject-keys.ts +90 -0
- package/modules/audit/src/services/sweep-service.ts +298 -0
- package/modules/audit/src/services/zip.ts +217 -0
- package/modules/audit/src/settings.ts +69 -0
- package/modules/audit/translations/en.json +210 -0
- package/modules/audit/translations/pl.json +210 -0
- package/modules/auth/README.md +77 -29
- package/modules/auth/migrations/0016_external_identities.up.sql +16 -0
- package/modules/auth/migrations/0017_mfa_key_id.up.sql +8 -0
- package/modules/auth/migrations/0018_retire_bundled_module_scopes.up.sql +29 -0
- package/modules/auth/migrations/0019_notifications_member_scopes.up.sql +44 -0
- package/modules/auth/migrations/0020_identity_providers.up.sql +61 -0
- package/modules/auth/migrations/0021_membership_status.up.sql +19 -0
- package/modules/auth/migrations/0022_auth_provider_scopes.up.sql +45 -0
- package/modules/auth/migrations/0023_enterprise_module_scopes.down.sql +19 -0
- package/modules/auth/migrations/0023_enterprise_module_scopes.up.sql +71 -0
- package/modules/auth/migrations/0024_approvals_member_scopes.down.sql +22 -0
- package/modules/auth/migrations/0024_approvals_member_scopes.up.sql +48 -0
- package/modules/auth/migrations/0025_audit_holds_owner_scope.down.sql +21 -0
- package/modules/auth/migrations/0025_audit_holds_owner_scope.up.sql +47 -0
- package/modules/auth/migrations/0026_auth_export_keyset_indexes.down.sql +6 -0
- package/modules/auth/migrations/0026_auth_export_keyset_indexes.up.sql +15 -0
- package/modules/auth/migrations/0027_workflow_automation_profile_scopes.down.sql +34 -0
- package/modules/auth/migrations/0027_workflow_automation_profile_scopes.up.sql +72 -0
- package/modules/auth/migrations/0028_auth_member_search_prefix_indexes.down.sql +6 -0
- package/modules/auth/migrations/0028_auth_member_search_prefix_indexes.up.sql +21 -0
- package/modules/auth/migrations/0029_reports_exports_access_scopes.down.sql +22 -0
- package/modules/auth/migrations/0029_reports_exports_access_scopes.up.sql +56 -0
- package/modules/auth/migrations/0030_auth_membership_keyset_index.down.sql +4 -0
- package/modules/auth/migrations/0030_auth_membership_keyset_index.up.sql +10 -0
- package/modules/auth/migrations/0031_membership_scope_backfills_under_rls.down.sql +4 -0
- package/modules/auth/migrations/0031_membership_scope_backfills_under_rls.up.sql +31 -0
- package/modules/auth/migrations/0032_audit_actor_service.down.sql +9 -0
- package/modules/auth/migrations/0032_audit_actor_service.up.sql +10 -0
- package/modules/auth/migrations/0033_auth_account_keyset_indexes.down.sql +5 -0
- package/modules/auth/migrations/0033_auth_account_keyset_indexes.up.sql +23 -0
- package/modules/auth/module.json +3 -3
- package/modules/auth/package.json +2 -1
- package/modules/auth/spec/module.yaml +372 -3
- package/modules/auth/src/acl/scopes.ts +50 -6
- package/modules/auth/src/cli/commands.json +11 -0
- package/modules/auth/src/cli/greenfield.ts +2 -2
- package/modules/auth/src/cli/index.ts +14 -0
- package/modules/auth/src/cli/secrets.ts +114 -0
- package/modules/auth/src/client/AuthenticationCore.tsrx +61 -8
- package/modules/auth/src/client/api.ts +72 -6
- package/modules/auth/src/client/contribution.tsrx +23 -0
- package/modules/auth/src/client/index.ts +6 -0
- package/modules/auth/src/client/providers/IdentityProviderForm.tsrx +191 -0
- package/modules/auth/src/client/providers/IdentityProvidersView.tsrx +358 -0
- package/modules/auth/src/client/providers/api.ts +128 -0
- package/modules/auth/src/client/providers/provider-columns.tsrx +60 -0
- package/modules/auth/src/client/providers/state.ts +35 -0
- package/modules/auth/src/client/security/SecurityView.tsrx +9 -1
- package/modules/auth/src/client/state.ts +15 -1
- package/modules/auth/src/domain/types.ts +55 -0
- package/modules/auth/src/index.ts +11 -1
- package/modules/auth/src/middleware/authentication.ts +4 -0
- package/modules/auth/src/server/endpoints.ts +467 -171
- package/modules/auth/src/server/http.ts +3 -2
- package/modules/auth/src/server/index.ts +22 -1
- package/modules/auth/src/server/membership-endpoints.ts +62 -0
- package/modules/auth/src/server/mfa-enforcement.ts +156 -0
- package/modules/auth/src/server/oidc.ts +389 -0
- package/modules/auth/src/server/provider-endpoints.ts +246 -0
- package/modules/auth/src/server/provider-host.ts +77 -0
- package/modules/auth/src/server/runtime.ts +231 -55
- package/modules/auth/src/services/auth-service-error.ts +7 -2
- package/modules/auth/src/services/auth-service.ts +948 -51
- package/modules/auth/src/services/data-classes.ts +236 -0
- package/modules/auth/src/services/database-repository.ts +853 -71
- package/modules/auth/src/services/identity-provider-service.ts +571 -0
- package/modules/auth/src/services/mail-delivery.ts +16 -16
- package/modules/auth/src/services/mail-message.ts +54 -0
- package/modules/auth/src/services/mail-port.ts +24 -0
- package/modules/auth/src/services/mail-smtp.ts +85 -0
- package/modules/auth/src/services/mfa-rotation.ts +144 -0
- package/modules/auth/src/services/migration.ts +810 -0
- package/modules/auth/src/services/password.ts +14 -0
- package/modules/auth/src/services/provider-secret-rotation.ts +169 -0
- package/modules/auth/src/services/provider-secrets.ts +136 -0
- package/modules/auth/src/services/repository.ts +321 -5
- package/modules/auth/src/services/session-sweep-runner.ts +73 -0
- package/modules/auth/src/services/settings-store.ts +10 -83
- package/modules/auth/src/services/totp.ts +88 -62
- package/modules/auth/src/services/validation.ts +194 -7
- package/modules/auth/src/settings.ts +18 -0
- package/modules/auth/translations/en.json +84 -1
- package/modules/auth/translations/pl.json +84 -1
- package/modules/automations/migrations/0005_secret_rotation_inventory.down.sql +1 -0
- package/modules/automations/migrations/0005_secret_rotation_inventory.up.sql +6 -0
- package/modules/automations/migrations/0006_automations_list_sort_indexes.down.sql +4 -0
- package/modules/automations/migrations/0006_automations_list_sort_indexes.up.sql +11 -0
- package/modules/automations/module.json +24 -6
- package/modules/automations/package.json +4 -1
- package/modules/automations/spec/module.yaml +81 -7
- package/modules/automations/src/api/endpoints.ts +202 -28
- package/modules/automations/src/cli/commands.json +17 -0
- package/modules/automations/src/cli/index.ts +114 -0
- package/modules/automations/src/client/AutomationScheduleForm.tsrx +77 -19
- package/modules/automations/src/client/AutomationSchedulesView.tsrx +144 -40
- package/modules/automations/src/client/AutomationTriggersView.tsrx +131 -32
- package/modules/automations/src/client/api.ts +62 -19
- package/modules/automations/src/client/presentation.ts +20 -2
- package/modules/automations/src/client/state.ts +84 -0
- package/modules/automations/src/domain/cadence.ts +99 -3
- package/modules/automations/src/domain/cron.ts +366 -0
- package/modules/automations/src/domain/time-zone.ts +61 -0
- package/modules/automations/src/platform.ts +38 -4
- package/modules/automations/src/server/index.ts +11 -0
- package/modules/automations/src/server/runtime.ts +46 -22
- package/modules/{automations-workflows-integration/src/server/adapter.ts → automations/src/server/workflow-target.ts} +13 -14
- package/modules/{automations-workflows-integration/src/server/tools.ts → automations/src/server/workflow-tools.ts} +0 -0
- package/modules/automations/src/services/data-classes.ts +62 -0
- package/modules/automations/src/services/database-repository.ts +152 -38
- package/modules/automations/src/services/migration.ts +119 -9
- package/modules/automations/src/services/repository.ts +52 -1
- package/modules/automations/src/services/schedule-runner.ts +84 -0
- package/modules/automations/src/services/schedule-service.ts +152 -26
- package/modules/automations/src/services/secret-rotation.ts +176 -0
- package/modules/automations/src/services/secret-vault.ts +68 -41
- package/modules/automations/src/services/trigger-service.ts +13 -10
- package/modules/automations/translations/en.json +15 -2
- package/modules/automations/translations/pl.json +15 -2
- package/modules/connectors/migrations/0001_connectors_core.down.sql +3 -0
- package/modules/connectors/migrations/0001_connectors_core.up.sql +72 -0
- package/modules/connectors/migrations/0002_connectors_call_keys.down.sql +3 -0
- package/modules/connectors/migrations/0002_connectors_call_keys.up.sql +18 -0
- package/modules/connectors/migrations/README.md +3 -0
- package/modules/connectors/module.json +28 -0
- package/modules/{automations-workflows-integration → connectors}/package.json +27 -26
- package/modules/connectors/spec/module.yaml +447 -0
- package/modules/connectors/src/acl/permissions.ts +6 -0
- package/modules/connectors/src/agent/tools.ts +180 -0
- package/modules/connectors/src/api/endpoints.ts +572 -0
- package/modules/connectors/src/client/ConnectorCallsView.tsrx +358 -0
- package/modules/connectors/src/client/ConnectorForm.tsrx +424 -0
- package/modules/connectors/src/client/ConnectorsView.tsrx +711 -0
- package/modules/connectors/src/client/api.ts +281 -0
- package/modules/connectors/src/client/consent.ts +48 -0
- package/modules/connectors/src/client/contribution.tsrx +37 -0
- package/modules/connectors/src/client/index.ts +22 -0
- package/modules/connectors/src/client/navigation.ts +42 -0
- package/modules/connectors/src/client/presentation.ts +38 -0
- package/modules/connectors/src/client/state.ts +175 -0
- package/modules/connectors/src/domain/calls.ts +70 -0
- package/modules/connectors/src/domain/definitions.ts +190 -0
- package/modules/connectors/src/domain/http-json.ts +68 -0
- package/modules/connectors/src/domain/types.ts +185 -0
- package/modules/connectors/src/index.ts +64 -0
- package/modules/connectors/src/platform.ts +56 -0
- package/modules/connectors/src/server/index.ts +66 -0
- package/modules/connectors/src/server/runtime.ts +163 -0
- package/modules/connectors/src/services/call-service.ts +903 -0
- package/modules/connectors/src/services/connectors-service.ts +653 -0
- package/modules/connectors/src/services/credential-vault.ts +188 -0
- package/modules/connectors/src/services/data-classes.ts +158 -0
- package/modules/connectors/src/services/database-repository.ts +897 -0
- package/modules/connectors/src/services/egress.ts +261 -0
- package/modules/connectors/src/services/index.ts +19 -0
- package/modules/connectors/src/services/migration.ts +166 -0
- package/modules/connectors/src/services/repository.ts +175 -0
- package/modules/connectors/src/services/service-error.ts +46 -0
- package/modules/connectors/src/settings.ts +69 -0
- package/modules/connectors/translations/en.json +191 -0
- package/modules/connectors/translations/pl.json +191 -0
- package/modules/directory/migrations/0001_directory_core.down.sql +5 -0
- package/modules/directory/migrations/0001_directory_core.up.sql +111 -0
- package/modules/directory/migrations/README.md +3 -0
- package/modules/directory/module.json +27 -0
- package/modules/directory/package.json +46 -0
- package/modules/directory/spec/module.yaml +351 -0
- package/modules/directory/src/acl/permissions.ts +7 -0
- package/modules/directory/src/api/endpoints.ts +478 -0
- package/modules/directory/src/api/scim-endpoints.ts +516 -0
- package/modules/directory/src/client/GroupMappingsView.tsrx +430 -0
- package/modules/directory/src/client/ProvisioningLogView.tsrx +248 -0
- package/modules/directory/src/client/ScimTokensView.tsrx +587 -0
- package/modules/directory/src/client/api.ts +222 -0
- package/modules/directory/src/client/contribution.tsrx +46 -0
- package/modules/directory/src/client/index.ts +22 -0
- package/modules/directory/src/client/navigation.ts +57 -0
- package/modules/directory/src/client/presentation.ts +143 -0
- package/modules/directory/src/client/state.ts +173 -0
- package/modules/directory/src/domain/scim.ts +346 -0
- package/modules/directory/src/domain/types.ts +166 -0
- package/modules/directory/src/index.ts +44 -0
- package/modules/directory/src/platform.ts +43 -0
- package/modules/directory/src/server/index.ts +17 -0
- package/modules/directory/src/server/runtime.ts +124 -0
- package/modules/directory/src/services/auth-port.ts +127 -0
- package/modules/directory/src/services/data-classes.ts +41 -0
- package/modules/directory/src/services/database-repository.ts +1067 -0
- package/modules/directory/src/services/directory-service.ts +311 -0
- package/modules/directory/src/services/index.ts +43 -0
- package/modules/directory/src/services/migration.ts +146 -0
- package/modules/directory/src/services/provisioning-service.ts +1420 -0
- package/modules/directory/src/services/rate-limiter.ts +103 -0
- package/modules/directory/src/services/repository.ts +208 -0
- package/modules/directory/src/services/service-error.ts +42 -0
- package/modules/directory/src/services/token-service.ts +215 -0
- package/modules/directory/src/settings.ts +86 -0
- package/modules/directory/translations/en.json +185 -0
- package/modules/directory/translations/pl.json +185 -0
- package/modules/documents/migrations/0001_documents_core.down.sql +1 -0
- package/modules/documents/migrations/0001_documents_core.up.sql +35 -0
- package/modules/documents/migrations/0002_documents_files_page.down.sql +1 -0
- package/modules/documents/migrations/0002_documents_files_page.up.sql +6 -0
- package/modules/documents/migrations/README.md +3 -0
- package/modules/documents/module.json +28 -0
- package/modules/documents/package.json +49 -0
- package/modules/documents/spec/module.yaml +247 -0
- package/modules/documents/src/acl/permissions.ts +6 -0
- package/modules/documents/src/api/endpoints.ts +401 -0
- package/modules/documents/src/client/DocumentUploader.tsrx +148 -0
- package/modules/documents/src/client/DocumentsView.tsrx +540 -0
- package/modules/documents/src/client/api.ts +209 -0
- package/modules/documents/src/client/contribution.tsrx +29 -0
- package/modules/documents/src/client/download.ts +70 -0
- package/modules/documents/src/client/index.ts +22 -0
- package/modules/documents/src/client/navigation.ts +25 -0
- package/modules/documents/src/client/presentation.ts +110 -0
- package/modules/documents/src/client/state.ts +117 -0
- package/modules/documents/src/domain/attachments.ts +84 -0
- package/modules/documents/src/domain/types.ts +80 -0
- package/modules/documents/src/index.ts +46 -0
- package/modules/documents/src/platform.ts +61 -0
- package/modules/documents/src/server/index.ts +30 -0
- package/modules/documents/src/server/runtime.ts +107 -0
- package/modules/documents/src/services/attachments.ts +39 -0
- package/modules/documents/src/services/data-classes.ts +25 -0
- package/modules/documents/src/services/database-repository.ts +259 -0
- package/modules/documents/src/services/documents-service.ts +586 -0
- package/modules/documents/src/services/index.ts +18 -0
- package/modules/documents/src/services/migration.ts +82 -0
- package/modules/documents/src/services/repository.ts +48 -0
- package/modules/documents/src/settings.ts +107 -0
- package/modules/documents/translations/en.json +111 -0
- package/modules/documents/translations/pl.json +111 -0
- package/modules/exports/migrations/0001_exports_core.down.sql +2 -0
- package/modules/exports/migrations/0001_exports_core.up.sql +28 -0
- package/modules/exports/migrations/0002_exports_job_routing_role.down.sql +4 -0
- package/modules/exports/migrations/0002_exports_job_routing_role.up.sql +21 -0
- package/modules/exports/migrations/README.md +3 -0
- package/modules/exports/module.json +28 -0
- package/modules/exports/package.json +44 -0
- package/modules/exports/spec/module.yaml +229 -0
- package/modules/exports/src/acl/permissions.ts +6 -0
- package/modules/exports/src/api/endpoints.ts +211 -0
- package/modules/exports/src/client/ExportsView.tsrx +327 -0
- package/modules/exports/src/client/api.ts +133 -0
- package/modules/exports/src/client/contribution.tsrx +31 -0
- package/modules/exports/src/client/index.ts +20 -0
- package/modules/exports/src/client/navigation.ts +25 -0
- package/modules/exports/src/client/presentation.ts +53 -0
- package/modules/exports/src/client/state.ts +56 -0
- package/modules/exports/src/domain/lists.ts +29 -0
- package/modules/exports/src/domain/types.ts +120 -0
- package/modules/exports/src/index.ts +41 -0
- package/modules/exports/src/platform.ts +80 -0
- package/modules/exports/src/server/index.ts +51 -0
- package/modules/exports/src/server/runtime.ts +160 -0
- package/modules/exports/src/services/data-classes.ts +56 -0
- package/modules/exports/src/services/database-repository.ts +405 -0
- package/modules/exports/src/services/export-runner.ts +123 -0
- package/modules/exports/src/services/export-service.ts +356 -0
- package/modules/exports/src/services/index.ts +6 -0
- package/modules/exports/src/services/list-registry.ts +105 -0
- package/modules/exports/src/services/migration.ts +89 -0
- package/modules/exports/src/services/repository.ts +97 -0
- package/modules/exports/src/settings.ts +70 -0
- package/modules/exports/translations/en.json +69 -0
- package/modules/exports/translations/pl.json +69 -0
- package/modules/import/migrations/0001_import_core.down.sql +6 -0
- package/modules/import/migrations/0001_import_core.up.sql +61 -0
- package/modules/import/migrations/0002_import_job_routing_role.down.sql +4 -0
- package/modules/import/migrations/0002_import_job_routing_role.up.sql +20 -0
- package/modules/import/migrations/0003_import_jobs_export_index.down.sql +1 -0
- package/modules/import/migrations/0003_import_jobs_export_index.up.sql +7 -0
- package/modules/import/migrations/0004_import_jobs_traceparent.down.sql +1 -0
- package/modules/import/migrations/0004_import_jobs_traceparent.up.sql +7 -0
- package/modules/import/migrations/README.md +3 -0
- package/modules/import/module.json +37 -0
- package/modules/import/package.json +50 -0
- package/modules/import/spec/module.yaml +335 -0
- package/modules/import/src/acl/permissions.ts +6 -0
- package/modules/import/src/api/endpoints.ts +400 -0
- package/modules/import/src/client/ImportJobDrawer.tsrx +229 -0
- package/modules/import/src/client/ImportsView.tsrx +455 -0
- package/modules/import/src/client/NewImportForm.tsrx +274 -0
- package/modules/import/src/client/api.ts +243 -0
- package/modules/import/src/client/contribution.tsrx +29 -0
- package/modules/import/src/client/index.ts +23 -0
- package/modules/import/src/client/navigation.ts +25 -0
- package/modules/import/src/client/presentation.ts +59 -0
- package/modules/import/src/client/state.ts +43 -0
- package/modules/import/src/domain/csv.ts +258 -0
- package/modules/import/src/domain/ports.ts +157 -0
- package/modules/import/src/domain/types.ts +179 -0
- package/modules/import/src/index.ts +58 -0
- package/modules/import/src/platform.ts +60 -0
- package/modules/import/src/server/index.ts +49 -0
- package/modules/import/src/server/runtime.ts +158 -0
- package/modules/import/src/services/csv-source.ts +121 -0
- package/modules/import/src/services/data-classes.ts +63 -0
- package/modules/import/src/services/database-repository.ts +780 -0
- package/modules/import/src/services/import-runner.ts +127 -0
- package/modules/import/src/services/import-service.ts +872 -0
- package/modules/import/src/services/index.ts +6 -0
- package/modules/import/src/services/migration.ts +156 -0
- package/modules/import/src/services/port-registry.ts +158 -0
- package/modules/import/src/services/repository.ts +147 -0
- package/modules/import/src/settings.ts +70 -0
- package/modules/import/translations/en.json +175 -0
- package/modules/import/translations/pl.json +175 -0
- package/modules/metering/migrations/0001_metering_core.down.sql +6 -0
- package/modules/metering/migrations/0001_metering_core.up.sql +119 -0
- package/modules/metering/migrations/0002_metering_bucket_export.down.sql +3 -0
- package/modules/metering/migrations/0002_metering_bucket_export.up.sql +5 -0
- package/modules/metering/migrations/README.md +3 -0
- package/modules/metering/module.json +46 -0
- package/modules/metering/package.json +50 -0
- package/modules/metering/spec/module.yaml +269 -0
- package/modules/metering/src/acl/permissions.ts +5 -0
- package/modules/metering/src/api/endpoints.ts +104 -0
- package/modules/metering/src/cli/commands.json +28 -0
- package/modules/metering/src/cli/index.ts +246 -0
- package/modules/metering/src/client/LimitsView.tsrx +170 -0
- package/modules/metering/src/client/UsageSummaryWidget.tsrx +63 -0
- package/modules/metering/src/client/UsageView.tsrx +205 -0
- package/modules/metering/src/client/api.ts +91 -0
- package/modules/metering/src/client/contribution.tsrx +42 -0
- package/modules/metering/src/client/index.ts +26 -0
- package/modules/metering/src/client/navigation.ts +54 -0
- package/modules/metering/src/client/presentation.ts +63 -0
- package/modules/metering/src/client/state.ts +31 -0
- package/modules/metering/src/domain/meters.ts +100 -0
- package/modules/metering/src/domain/types.ts +71 -0
- package/modules/metering/src/index.ts +51 -0
- package/modules/metering/src/platform.ts +84 -0
- package/modules/metering/src/server/index.ts +40 -0
- package/modules/metering/src/server/runtime.ts +165 -0
- package/modules/metering/src/services/data-classes.ts +34 -0
- package/modules/metering/src/services/database-repository.ts +574 -0
- package/modules/metering/src/services/index.ts +9 -0
- package/modules/metering/src/services/meter-registry.ts +145 -0
- package/modules/metering/src/services/metering-service.ts +441 -0
- package/modules/metering/src/services/migration.ts +183 -0
- package/modules/metering/src/services/notifications.ts +75 -0
- package/modules/metering/src/services/reports.ts +105 -0
- package/modules/metering/src/services/repository.ts +132 -0
- package/modules/metering/src/services/service-error.ts +46 -0
- package/modules/metering/src/settings.ts +47 -0
- package/modules/metering/translations/en.json +68 -0
- package/modules/metering/translations/pl.json +68 -0
- package/modules/notifications/migrations/0001_notifications_core.down.sql +1 -0
- package/modules/notifications/migrations/0001_notifications_core.up.sql +26 -0
- package/modules/notifications/migrations/0002_notifications_preferences.down.sql +1 -0
- package/modules/notifications/migrations/0002_notifications_preferences.up.sql +17 -0
- package/modules/notifications/migrations/0003_notifications_webhook_subscriptions.down.sql +1 -0
- package/modules/notifications/migrations/0003_notifications_webhook_subscriptions.up.sql +30 -0
- package/modules/notifications/migrations/0004_notifications_deliveries.down.sql +1 -0
- package/modules/notifications/migrations/0004_notifications_deliveries.up.sql +35 -0
- package/modules/notifications/migrations/0005_notifications_delivery_routing_role.down.sql +2 -0
- package/modules/notifications/migrations/0005_notifications_delivery_routing_role.up.sql +17 -0
- package/modules/notifications/migrations/0006_notifications_delivery_title.down.sql +1 -0
- package/modules/notifications/migrations/0006_notifications_delivery_title.up.sql +11 -0
- package/modules/notifications/migrations/0007_notifications_secret_rotation_inventory.down.sql +2 -0
- package/modules/notifications/migrations/0007_notifications_secret_rotation_inventory.up.sql +19 -0
- package/modules/notifications/migrations/0008_notifications_delivery_claim.down.sql +8 -0
- package/modules/notifications/migrations/0008_notifications_delivery_claim.up.sql +19 -0
- package/modules/notifications/migrations/0009_notifications_kind_approvals.down.sql +16 -0
- package/modules/notifications/migrations/0009_notifications_kind_approvals.up.sql +18 -0
- package/modules/notifications/migrations/0010_notifications_kind_meter_threshold.down.sql +16 -0
- package/modules/notifications/migrations/0010_notifications_kind_meter_threshold.up.sql +18 -0
- package/modules/notifications/migrations/0011_notifications_retention_keyset.down.sql +5 -0
- package/modules/notifications/migrations/0011_notifications_retention_keyset.up.sql +15 -0
- package/modules/notifications/migrations/0012_notifications_email_channel.down.sql +12 -0
- package/modules/notifications/migrations/0012_notifications_email_channel.up.sql +38 -0
- package/modules/notifications/migrations/0013_notifications_list_pages.down.sql +5 -0
- package/modules/notifications/migrations/0013_notifications_list_pages.up.sql +13 -0
- package/modules/notifications/migrations/README.md +3 -0
- package/modules/notifications/module.json +32 -0
- package/modules/notifications/package.json +49 -0
- package/modules/notifications/spec/module.yaml +718 -0
- package/modules/notifications/src/acl/permissions.ts +11 -0
- package/modules/notifications/src/api/endpoints.ts +814 -0
- package/modules/notifications/src/cli/commands.json +17 -0
- package/modules/notifications/src/cli/index.ts +126 -0
- package/modules/notifications/src/client/DeliveriesView.tsrx +483 -0
- package/modules/notifications/src/client/FactList.tsrx +24 -0
- package/modules/notifications/src/client/NotificationPreferencesView.tsrx +240 -0
- package/modules/notifications/src/client/NotificationsInboxView.tsrx +592 -0
- package/modules/notifications/src/client/UnreadCountWidget.tsrx +62 -0
- package/modules/notifications/src/client/WebhookForm.tsrx +297 -0
- package/modules/notifications/src/client/WebhooksView.tsrx +637 -0
- package/modules/notifications/src/client/api.ts +382 -0
- package/modules/notifications/src/client/contribution.tsrx +83 -0
- package/modules/notifications/src/client/inbox.ts +41 -0
- package/modules/notifications/src/client/index.ts +29 -0
- package/modules/notifications/src/client/navigation.ts +92 -0
- package/modules/notifications/src/client/notifications.css +70 -0
- package/modules/notifications/src/client/presentation.ts +81 -0
- package/modules/notifications/src/client/state.ts +246 -0
- package/modules/notifications/src/client/unread-count.ts +26 -0
- package/modules/notifications/src/domain/locale.ts +47 -0
- package/modules/notifications/src/domain/publish.ts +46 -0
- package/modules/notifications/src/domain/types.ts +186 -0
- package/modules/notifications/src/index.ts +62 -0
- package/modules/notifications/src/platform.ts +85 -0
- package/modules/notifications/src/server/index.ts +82 -0
- package/modules/notifications/src/server/runtime.ts +251 -0
- package/modules/notifications/src/services/data-classes.ts +139 -0
- package/modules/notifications/src/services/database-repository.ts +1334 -0
- package/modules/notifications/src/services/delivery-payload.ts +93 -0
- package/modules/notifications/src/services/delivery-runner.ts +170 -0
- package/modules/notifications/src/services/delivery-service.ts +811 -0
- package/modules/notifications/src/services/egress.ts +239 -0
- package/modules/notifications/src/services/email-channel.ts +93 -0
- package/modules/notifications/src/services/index.ts +23 -0
- package/modules/notifications/src/services/migration.ts +572 -0
- package/modules/notifications/src/services/notifications-service.ts +297 -0
- package/modules/notifications/src/services/paging.ts +60 -0
- package/modules/notifications/src/services/publish-service.ts +133 -0
- package/modules/notifications/src/services/repository.ts +342 -0
- package/modules/notifications/src/services/secret-rotation.ts +177 -0
- package/modules/notifications/src/services/secret-vault.ts +168 -0
- package/modules/notifications/src/services/service-error.ts +67 -0
- package/modules/notifications/src/services/signature.ts +81 -0
- package/modules/notifications/src/services/webhook-service.ts +307 -0
- package/modules/notifications/src/settings.ts +130 -0
- package/modules/notifications/translations/en.json +255 -0
- package/modules/notifications/translations/pl.json +255 -0
- package/modules/profile/module.json +3 -3
- package/modules/profile/package.json +1 -1
- package/modules/profile/spec/module.yaml +3 -3
- package/modules/profile/src/services/database-repository.ts +3 -13
- package/modules/reports/module.json +28 -0
- package/modules/reports/package.json +42 -0
- package/modules/reports/spec/module.yaml +231 -0
- package/modules/reports/src/acl/permissions.ts +5 -0
- package/modules/reports/src/api/endpoints.ts +72 -0
- package/modules/reports/src/client/ReportsSummaryWidget.tsrx +52 -0
- package/modules/reports/src/client/ReportsView.tsrx +246 -0
- package/modules/reports/src/client/api.ts +65 -0
- package/modules/reports/src/client/contribution.tsrx +36 -0
- package/modules/reports/src/client/index.ts +18 -0
- package/modules/reports/src/client/navigation.ts +39 -0
- package/modules/reports/src/client/presentation.ts +123 -0
- package/modules/reports/src/client/state.ts +28 -0
- package/modules/reports/src/domain/providers.ts +115 -0
- package/modules/reports/src/domain/types.ts +44 -0
- package/modules/reports/src/index.ts +47 -0
- package/modules/reports/src/platform.ts +37 -0
- package/modules/reports/src/server/index.ts +21 -0
- package/modules/reports/src/server/runtime.ts +40 -0
- package/modules/reports/src/services/index.ts +17 -0
- package/modules/reports/src/services/provider-registry.ts +144 -0
- package/modules/reports/src/services/range.ts +65 -0
- package/modules/reports/src/services/reports-service.ts +316 -0
- package/modules/reports/src/services/service-error.ts +26 -0
- package/modules/reports/src/settings.ts +49 -0
- package/modules/reports/translations/en.json +35 -0
- package/modules/reports/translations/pl.json +35 -0
- package/modules/sandbox/module.json +4 -4
- package/modules/sandbox/package.json +1 -1
- package/modules/sandbox/spec/module.yaml +3 -3
- package/modules/sandbox/src/services/database-repository.ts +14 -23
- package/modules/sandbox/src/services/directory.ts +16 -0
- package/modules/sandbox/src/services/sandbox-service.ts +13 -11
- package/modules/search/migrations/0001_search_core.down.sql +1 -0
- package/modules/search/migrations/0001_search_core.up.sql +22 -0
- package/modules/search/migrations/0002_search_recent_export.down.sql +3 -0
- package/modules/search/migrations/0002_search_recent_export.up.sql +5 -0
- package/modules/search/migrations/README.md +3 -0
- package/modules/search/module.json +28 -0
- package/modules/search/package.json +43 -0
- package/modules/search/spec/module.yaml +177 -0
- package/modules/search/src/acl/permissions.ts +5 -0
- package/modules/search/src/api/endpoints.ts +221 -0
- package/modules/search/src/client/SearchView.tsrx +346 -0
- package/modules/search/src/client/api.ts +157 -0
- package/modules/search/src/client/contribution.tsrx +31 -0
- package/modules/search/src/client/index.ts +17 -0
- package/modules/search/src/client/navigation.ts +97 -0
- package/modules/search/src/client/search.css +56 -0
- package/modules/search/src/client/state.ts +113 -0
- package/modules/search/src/domain/data-classes.ts +73 -0
- package/modules/search/src/domain/providers.ts +88 -0
- package/modules/search/src/domain/types.ts +56 -0
- package/modules/search/src/index.ts +46 -0
- package/modules/search/src/platform.ts +42 -0
- package/modules/search/src/server/index.ts +25 -0
- package/modules/search/src/server/runtime.ts +123 -0
- package/modules/search/src/services/database-repository.ts +163 -0
- package/modules/search/src/services/index.ts +21 -0
- package/modules/search/src/services/migration.ts +65 -0
- package/modules/search/src/services/provider-registry.ts +137 -0
- package/modules/search/src/services/repository.ts +43 -0
- package/modules/search/src/services/search-service.ts +442 -0
- package/modules/search/src/services/service-error.ts +35 -0
- package/modules/search/src/settings.ts +68 -0
- package/modules/search/translations/en.json +45 -0
- package/modules/search/translations/pl.json +45 -0
- package/modules/system/module.json +2 -2
- package/modules/system/package.json +1 -1
- package/modules/system/spec/module.yaml +30 -3
- package/modules/system/src/client/FlagsPanel.tsrx +127 -0
- package/modules/system/src/client/ModuleSettingRow.tsrx +17 -7
- package/modules/system/src/client/ModuleSettingsSection.tsrx +10 -71
- package/modules/system/src/client/ModulesView.tsrx +91 -65
- package/modules/system/src/client/flags.ts +35 -0
- package/modules/system/src/client/index.ts +8 -0
- package/modules/system/src/client/navigation.ts +8 -0
- package/modules/system/src/client/settings-state.ts +159 -0
- package/modules/system/src/client/state.ts +2 -0
- package/modules/system/src/domain/time-zone.ts +105 -0
- package/modules/system/src/index.ts +12 -0
- package/modules/system/src/platform.ts +5 -1
- package/modules/system/src/server/endpoints.ts +72 -21
- package/modules/system/src/settings.ts +28 -0
- package/modules/system/translations/en.json +17 -0
- package/modules/system/translations/pl.json +17 -0
- package/modules/users/module.json +30 -4
- package/modules/users/package.json +4 -1
- package/modules/users/spec/module.yaml +290 -7
- package/modules/users/src/api/endpoints.ts +228 -15
- package/modules/users/src/client/InviteMemberForm.tsrx +2 -2
- package/modules/users/src/client/MemberDrawer.tsrx +142 -26
- package/modules/users/src/client/UserAccountForm.tsrx +2 -2
- package/modules/users/src/client/UsersView.tsrx +432 -71
- package/modules/users/src/client/api.ts +106 -12
- package/modules/users/src/client/contribution.tsrx +5 -0
- package/modules/users/src/client/member-columns.tsrx +22 -9
- package/modules/users/src/client/state.ts +172 -7
- package/modules/users/src/domain/lists.ts +9 -0
- package/modules/users/src/index.ts +11 -0
- package/modules/users/src/platform.ts +50 -1
- package/modules/users/src/services/member-export.ts +51 -0
- package/modules/users/src/services/member-import.ts +249 -0
- package/modules/users/src/services/member-search.ts +145 -0
- package/modules/users/src/services/users-service.ts +117 -4
- package/modules/users/translations/en.json +57 -8
- package/modules/users/translations/pl.json +57 -8
- package/modules/workflows/migrations/0004_payload_rotation_inventory.up.sql +17 -0
- package/modules/workflows/migrations/0005_workflows_human_approval.up.sql +28 -0
- package/modules/workflows/migrations/0006_workflows_retention_indexes.up.sql +11 -0
- package/modules/workflows/migrations/0007_workflows_erasure_subject_indexes.up.sql +17 -0
- package/modules/workflows/migrations/0008_workflows_subject_account.up.sql +24 -0
- package/modules/workflows/migrations/0009_workflows_definition_list_indexes.up.sql +9 -0
- package/modules/workflows/module.json +34 -6
- package/modules/workflows/package.json +2 -1
- package/modules/workflows/spec/module.yaml +26 -9
- package/modules/workflows/src/api/endpoints.ts +131 -25
- package/modules/workflows/src/cli/commands.json +17 -0
- package/modules/workflows/src/cli/index.ts +114 -0
- package/modules/workflows/src/client/WorkflowExecutionHistory.tsrx +36 -27
- package/modules/workflows/src/client/WorkflowInspector.tsrx +116 -0
- package/modules/workflows/src/client/WorkflowNodePalette.tsrx +1 -0
- package/modules/workflows/src/client/WorkflowsView.tsrx +236 -99
- package/modules/workflows/src/client/api.ts +54 -34
- package/modules/workflows/src/client/canvas-model.ts +12 -0
- package/modules/workflows/src/client/state.ts +95 -0
- package/modules/workflows/src/domain/events.ts +25 -11
- package/modules/workflows/src/domain/graph.ts +135 -1
- package/modules/workflows/src/domain/types.ts +91 -4
- package/modules/workflows/src/platform.ts +12 -0
- package/modules/workflows/src/server/runtime.ts +78 -5
- package/modules/workflows/src/services/approvals.ts +62 -0
- package/modules/workflows/src/services/cursors.ts +37 -0
- package/modules/workflows/src/services/data-classes.ts +232 -0
- package/modules/workflows/src/services/database-repository.ts +660 -171
- package/modules/workflows/src/services/migration.ts +240 -0
- package/modules/workflows/src/services/notifications.ts +98 -0
- package/modules/workflows/src/services/payload-codec.ts +51 -28
- package/modules/workflows/src/services/payload-rotation.ts +171 -0
- package/modules/workflows/src/services/repository.ts +123 -8
- package/modules/workflows/src/services/simulation.ts +7 -0
- package/modules/workflows/src/services/worker.ts +446 -25
- package/modules/workflows/src/services/workflows-service.ts +264 -103
- package/modules/workflows/translations/en.json +12 -4
- package/modules/workflows/translations/pl.json +12 -4
- package/modules.json +48 -4
- package/package.json +64 -6
- package/packages/client/package.json +1 -0
- package/packages/client/src/ApplicationShell.tsrx +43 -0
- package/packages/client/src/contributions.ts +55 -0
- package/packages/client/src/i18n/locales/en.json +5 -0
- package/packages/client/src/i18n/locales/pl.json +5 -0
- package/packages/client/src/index.ts +13 -1
- package/packages/client/src/routing.ts +22 -0
- package/packages/client/src/shell/CommandPalette.tsrx +223 -11
- package/packages/client/src/shell/command-search.ts +126 -0
- package/packages/client/src/shell/command.ts +30 -0
- package/packages/client/src/shell/navigation.ts +12 -0
- package/packages/client/src/shell/palette-keys.ts +27 -0
- package/packages/client/src/shell/shell.css +7 -0
- package/packages/contracts/schemas/module-spec.schema.json +287 -1
- package/packages/contracts/schemas/module.schema.json +25 -0
- package/packages/contracts/src/index.ts +144 -1
- package/packages/database/src/backup.ts +179 -0
- package/packages/database/src/decoders.ts +25 -0
- package/packages/database/src/index.ts +17 -0
- package/packages/database/src/record-history.ts +5 -14
- package/packages/harness/src/index.ts +2 -0
- package/packages/harness/src/runtime.ts +218 -1
- package/packages/harness/src/tool-adapters.ts +19 -1
- package/packages/kernel/src/acl.ts +179 -0
- package/packages/kernel/src/capability-registry.ts +69 -2
- package/packages/kernel/src/data-class-registry.ts +354 -0
- package/packages/kernel/src/index.ts +65 -4
- package/packages/kernel/src/keyring.ts +208 -0
- package/packages/kernel/src/module-compatibility.ts +35 -4
- package/packages/kernel/src/module-registry.ts +49 -2
- package/packages/kernel/src/module-settings.ts +189 -27
- package/packages/server/package.json +2 -1
- package/packages/server/src/composition.ts +38 -0
- package/packages/server/src/endpoint.ts +104 -47
- package/packages/server/src/export/csv.ts +34 -0
- package/packages/server/src/export/definition.ts +346 -0
- package/packages/server/src/export/index.ts +61 -0
- package/packages/server/src/export/run.ts +116 -0
- package/packages/server/src/index.ts +155 -0
- package/packages/server/src/jobs/index.ts +93 -0
- package/packages/server/src/jobs/runner.ts +486 -0
- package/packages/server/src/log.ts +291 -0
- package/packages/server/src/mail/config.ts +184 -0
- package/packages/server/src/mail/contracts.ts +251 -0
- package/packages/server/src/mail/index.ts +31 -0
- package/packages/server/src/mail/port.ts +101 -0
- package/packages/server/src/mail/smtp.ts +191 -0
- package/packages/server/src/mail/template.ts +105 -0
- package/packages/server/src/metrics.ts +447 -0
- package/packages/server/src/pagination.ts +246 -0
- package/packages/server/src/trace/context.ts +103 -0
- package/packages/server/src/trace/egress.ts +66 -0
- package/packages/server/src/trace/error-sink.ts +296 -0
- package/packages/server/src/trace/exporter.ts +295 -0
- package/packages/server/src/trace/index.ts +60 -0
- package/packages/server/src/trace/job-sink.ts +172 -0
- package/packages/server/src/trace/tracer.ts +338 -0
- package/packages/server/src/web.ts +5 -1
- package/packages/storage/package.json +40 -0
- package/packages/storage/src/config.ts +189 -0
- package/packages/storage/src/content-type.ts +124 -0
- package/packages/storage/src/contracts.ts +112 -0
- package/packages/storage/src/envelope.ts +189 -0
- package/packages/storage/src/index.ts +43 -0
- package/packages/storage/src/local.ts +75 -0
- package/packages/storage/src/port.ts +251 -0
- package/packages/storage/src/read-token.ts +130 -0
- package/packages/storage/src/s3.ts +144 -0
- package/packages/storage/src/scanner.ts +22 -0
- package/packages/storage/src/sigv4.ts +104 -0
- package/packages/storage/src/store.ts +13 -0
- package/packages/ui/package.json +1 -0
- package/packages/ui/src/components/Button.tsrx +3 -0
- package/packages/ui/src/components/ConfirmDialog.tsrx +13 -2
- package/packages/ui/src/components/DateField.tsrx +92 -0
- package/packages/ui/src/components/DatePicker.tsrx +525 -0
- package/packages/ui/src/components/DateRangeField.tsrx +93 -0
- package/packages/ui/src/components/Drawer.tsrx +10 -1
- package/packages/ui/src/components/FileUpload.tsrx +158 -0
- package/packages/ui/src/components/Pagination.tsrx +130 -0
- package/packages/ui/src/components/Select.tsrx +78 -0
- package/packages/ui/src/components/Table.tsrx +498 -81
- package/packages/ui/src/components/Tabs.tsrx +53 -0
- package/packages/ui/src/components/ToastHost.tsrx +48 -0
- package/packages/ui/src/components/calendar.ts +243 -0
- package/packages/ui/src/components/date-field.ts +62 -0
- package/packages/ui/src/components/file-upload.ts +49 -0
- package/packages/ui/src/components/focus-trap.ts +62 -0
- package/packages/ui/src/components/pagination.ts +68 -0
- package/packages/ui/src/components/table-sorting.ts +49 -0
- package/packages/ui/src/components/tabs.ts +61 -0
- package/packages/ui/src/components/toast-store.ts +116 -0
- package/packages/ui/src/icons/Icon.tsrx +5 -0
- package/packages/ui/src/index.ts +45 -0
- package/packages/ui/src/styles/components.css +598 -0
- package/modules/automations-workflows-integration/module.json +0 -27
- package/modules/automations-workflows-integration/spec/module.yaml +0 -93
- package/modules/automations-workflows-integration/src/index.ts +0 -14
- package/modules/automations-workflows-integration/src/platform.ts +0 -24
- package/modules/automations-workflows-integration/src/server/index.ts +0 -11
- package/modules/automations-workflows-integration/translations/en.json +0 -21
- package/modules/automations-workflows-integration/translations/pl.json +0 -21
- package/modules/workflows/src/services/cursor-codec.ts +0 -62
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@flowdular/module-access",
|
|
3
|
+
"version": "0.1.1",
|
|
4
|
+
"private": true,
|
|
5
|
+
"type": "module",
|
|
6
|
+
"exports": {
|
|
7
|
+
".": "./src/index.ts",
|
|
8
|
+
"./client": "./src/client/index.ts",
|
|
9
|
+
"./server": "./src/server/index.ts",
|
|
10
|
+
"./platform": "./src/platform.ts",
|
|
11
|
+
"./module.json": "./module.json"
|
|
12
|
+
},
|
|
13
|
+
"files": [
|
|
14
|
+
"src",
|
|
15
|
+
"module.json",
|
|
16
|
+
"migrations",
|
|
17
|
+
"translations",
|
|
18
|
+
"spec",
|
|
19
|
+
"README.md"
|
|
20
|
+
],
|
|
21
|
+
"scripts": {
|
|
22
|
+
"typecheck": "tsrx-tsc --noEmit -p tsconfig.json",
|
|
23
|
+
"test": "vitest run"
|
|
24
|
+
},
|
|
25
|
+
"dependencies": {
|
|
26
|
+
"@flowdular/client": "workspace:*",
|
|
27
|
+
"@flowdular/contracts": "workspace:*",
|
|
28
|
+
"@flowdular/database": "workspace:*",
|
|
29
|
+
"@flowdular/kernel": "workspace:*",
|
|
30
|
+
"@flowdular/module-auth": "workspace:*",
|
|
31
|
+
"@flowdular/server": "workspace:*",
|
|
32
|
+
"@flowdular/ui": "workspace:*",
|
|
33
|
+
"octane": "0.1.51",
|
|
34
|
+
"segment-state": "0.2.1"
|
|
35
|
+
},
|
|
36
|
+
"devDependencies": {
|
|
37
|
+
"@flowdular/database-testing": "workspace:*",
|
|
38
|
+
"@tsrx/typescript-plugin": "0.3.120",
|
|
39
|
+
"@types/node": "24.13.3",
|
|
40
|
+
"typescript": "5.9.3",
|
|
41
|
+
"vitest": "4.1.11"
|
|
42
|
+
}
|
|
43
|
+
}
|
|
@@ -0,0 +1,225 @@
|
|
|
1
|
+
schemaVersion: 2
|
|
2
|
+
id: access.core
|
|
3
|
+
specVersion: 0.1.1
|
|
4
|
+
status: approved
|
|
5
|
+
name: Access Review
|
|
6
|
+
description: Point-in-time access review, an audit-trail diff between two dates, an administrative activity report over privileged actions, and a recorded attestation that someone reviewed them.
|
|
7
|
+
profile: full
|
|
8
|
+
capabilities:
|
|
9
|
+
- api
|
|
10
|
+
- database
|
|
11
|
+
- client
|
|
12
|
+
- translations
|
|
13
|
+
dependencies:
|
|
14
|
+
- id: system.core
|
|
15
|
+
range: ^0.7.0
|
|
16
|
+
- id: auth.core
|
|
17
|
+
range: ^0.13.0
|
|
18
|
+
requires:
|
|
19
|
+
- id: exports.lists.v1
|
|
20
|
+
optional: true
|
|
21
|
+
tenancy: required
|
|
22
|
+
locales:
|
|
23
|
+
- en
|
|
24
|
+
- pl
|
|
25
|
+
invariants:
|
|
26
|
+
- The tenant comes from the authenticated principal. No request input selects a workspace, and every statement runs inside a tenant-scoped transaction on the module's own lease.
|
|
27
|
+
- access_attestations enables and forces row-level security with a USING and WITH CHECK policy bound to transaction-local coreloom.tenant_id, and the runtime role holds neither SUPERUSER nor BYPASSRLS.
|
|
28
|
+
- Attestations are append-only. The module publishes no endpoint, service method or SQL that updates or deletes a recorded attestation.
|
|
29
|
+
- The review, the diff and the activity report hold no state. They are computed per request from the auth.core read surfaces on the acting principal's workspace, and access.core never opens another module's database.
|
|
30
|
+
- Summary counts on an attestation are computed by the server from the same read surfaces inside the attesting request. A count supplied by the caller is ignored.
|
|
31
|
+
- No credential ever enters a report or an attestation. API tokens are reported by label, prefix and scopes; identity providers by key, label, issuer and rules; never a secret, a fingerprint or a hash.
|
|
32
|
+
- Every range is bounded before any read. from and to are UTC calendar dates, to is inclusive, a reversed range and a range longer than the declared maximum are refused with a stable code.
|
|
33
|
+
- The diff and the activity report walk the auth audit trail in bounded pages. One request scans at most the declared page budget and answers a cursor for the rest, so no request walks a workspace's whole trail.
|
|
34
|
+
- The review lists at most the declared row bound per section and says so; the counts it reports are exact.
|
|
35
|
+
- A file of the review is not capped. Its walk reads auth.core's paged member surface rather than the review's own listing, one bounded page per call keyed on the account id, so a workspace with more members than the review lists exports every one of them, and a member renamed or removed while the walk runs is neither written twice nor dropped because an account id does not move and the next page is whatever still sorts after the id the cursor names.
|
|
36
|
+
- Recording an attestation is a mutation and passes the session CSRF and origin check before any read or write.
|
|
37
|
+
- Both permissions are workspace owner permissions. Neither is granted to members by enabling the module.
|
|
38
|
+
permissions:
|
|
39
|
+
- id: access.review.read
|
|
40
|
+
description: Read the access review, the change diff, the administrative activity report and the recorded attestations of the active workspace.
|
|
41
|
+
- id: access.review.manage
|
|
42
|
+
description: Record an attestation that the access review of a period was performed.
|
|
43
|
+
dataOwnership:
|
|
44
|
+
- access.core owns access_attestations and nothing else. A row is one review someone performed for one period, with the counts the server computed at that moment.
|
|
45
|
+
- Memberships, roles, membership scopes, API tokens, identity providers and the audit trail stay owned by auth.core. access.core reads them live through the auth runtime the platform composes and copies none of them.
|
|
46
|
+
- The review, the diff and the activity report are derived reports. They are recomputed per request and are never persisted, so a report always reflects the auth data at the moment it was asked for.
|
|
47
|
+
entities:
|
|
48
|
+
- id: attestations
|
|
49
|
+
name: Access attestation
|
|
50
|
+
description: An append-only record that a named reviewer reviewed the access of one period, with the counts the server computed at that moment.
|
|
51
|
+
fields:
|
|
52
|
+
- id: reviewerAccountId
|
|
53
|
+
type: string
|
|
54
|
+
required: true
|
|
55
|
+
maxLength: 64
|
|
56
|
+
description: The account that recorded the attestation, taken from the principal.
|
|
57
|
+
- id: reviewerLabel
|
|
58
|
+
type: string
|
|
59
|
+
required: true
|
|
60
|
+
maxLength: 254
|
|
61
|
+
description: The reviewer's e-mail as it stood when the attestation was recorded, so the evidence survives a later rename.
|
|
62
|
+
- id: periodFrom
|
|
63
|
+
type: datetime
|
|
64
|
+
required: true
|
|
65
|
+
description: First instant of the reviewed period, UTC.
|
|
66
|
+
- id: periodTo
|
|
67
|
+
type: datetime
|
|
68
|
+
required: true
|
|
69
|
+
description: Last instant of the reviewed period, UTC.
|
|
70
|
+
- id: memberCount
|
|
71
|
+
type: integer
|
|
72
|
+
required: true
|
|
73
|
+
description: Memberships the review listed.
|
|
74
|
+
- id: activeMemberCount
|
|
75
|
+
type: integer
|
|
76
|
+
required: true
|
|
77
|
+
description: Memberships that were active in the workspace.
|
|
78
|
+
- id: roleCount
|
|
79
|
+
type: integer
|
|
80
|
+
required: true
|
|
81
|
+
description: Roles the workspace held.
|
|
82
|
+
- id: extraScopeCount
|
|
83
|
+
type: integer
|
|
84
|
+
required: true
|
|
85
|
+
description: Scope grants a member held beyond the scopes of the assigned role.
|
|
86
|
+
- id: tokenCount
|
|
87
|
+
type: integer
|
|
88
|
+
required: true
|
|
89
|
+
description: API tokens that were usable, so neither revoked nor expired.
|
|
90
|
+
- id: providerCount
|
|
91
|
+
type: integer
|
|
92
|
+
required: true
|
|
93
|
+
description: Identity providers the workspace could sign in with.
|
|
94
|
+
- id: note
|
|
95
|
+
type: text
|
|
96
|
+
maxLength: 2000
|
|
97
|
+
description: What the reviewer wants the next reviewer to know.
|
|
98
|
+
screens:
|
|
99
|
+
- id: review
|
|
100
|
+
kind: list
|
|
101
|
+
title: Access review
|
|
102
|
+
navigationGroup: Administration
|
|
103
|
+
- id: activity
|
|
104
|
+
kind: list
|
|
105
|
+
title: Access activity
|
|
106
|
+
navigationGroup: Administration
|
|
107
|
+
- id: attestations
|
|
108
|
+
kind: list
|
|
109
|
+
entity: attestations
|
|
110
|
+
title: Attestations
|
|
111
|
+
navigationGroup: Administration
|
|
112
|
+
columns:
|
|
113
|
+
- periodFrom
|
|
114
|
+
- periodTo
|
|
115
|
+
- reviewerLabel
|
|
116
|
+
- memberCount
|
|
117
|
+
- extraScopeCount
|
|
118
|
+
- tokenCount
|
|
119
|
+
actions:
|
|
120
|
+
- id: attest
|
|
121
|
+
entity: attestations
|
|
122
|
+
permission: access.review.manage
|
|
123
|
+
kind: create
|
|
124
|
+
risk: workspace-write
|
|
125
|
+
idempotent: false
|
|
126
|
+
description: Record an attestation for a period. The server computes the counts from the current review and appends the row.
|
|
127
|
+
acceptanceScenarios:
|
|
128
|
+
- id: ACCESS-REVIEW
|
|
129
|
+
given: A workspace holds memberships with roles, a member carrying a scope its role does not grant, a usable API token and a configured identity provider.
|
|
130
|
+
when: A principal holding access.review.read reads the review.
|
|
131
|
+
then: The report lists every membership with its account and workspace status and its role, names the scopes that member holds beyond the role, lists the usable API tokens with their labels, prefixes and scopes, lists the identity providers with their status and joining rules, carries no secret of any kind, and reports counts that match what it listed.
|
|
132
|
+
- id: ACCESS-REVIEW-TOKENS
|
|
133
|
+
given: A workspace holds one usable API token, one revoked token and one expired token.
|
|
134
|
+
when: The review is read.
|
|
135
|
+
then: Only the usable token is listed and the token count is one, because the review answers who holds access now.
|
|
136
|
+
- id: ACCESS-REVIEW-EXPORT
|
|
137
|
+
given: exports.core is composed and a workspace holds more members than the review lists, with a member renamed while the export runs.
|
|
138
|
+
when: The review list registered with exports.lists.v1 is walked page by page into a file.
|
|
139
|
+
then: Every member of the workspace reaches the file exactly once in account id order however far past the review's listing bound the workspace is, the rename does not repeat or drop a row, and a cursor naming a member who has since left the workspace pages on from the members that sort after them rather than ending the job.
|
|
140
|
+
- id: ACCESS-DIFF
|
|
141
|
+
given: A member's role was changed between two dates and unrelated activity happened outside that window.
|
|
142
|
+
when: A principal holding access.review.read asks for the diff of that window.
|
|
143
|
+
then: The change is listed with its subject, actor and time, changes outside the window are absent, and a window wider than one page answers a cursor that continues the walk without repeating or skipping a change.
|
|
144
|
+
- id: ACCESS-ACTIVITY
|
|
145
|
+
given: The audit trail of a window holds privileged actions and ordinary sign-in activity.
|
|
146
|
+
when: A principal holding access.review.read asks for the activity report of that window.
|
|
147
|
+
then: Only privileged actions are listed, in time order, newest first, and ordinary sign-in, sign-out and session activity is absent.
|
|
148
|
+
- id: ACCESS-RANGE-BOUNDS
|
|
149
|
+
given: A principal holding access.review.read asks for a report.
|
|
150
|
+
when: The request omits a date, reverses the range or asks for a range longer than the maximum.
|
|
151
|
+
then: The server answers a stable input error before reading the audit trail.
|
|
152
|
+
- id: ACCESS-ATTEST
|
|
153
|
+
given: A principal holds access.review.manage and a valid session.
|
|
154
|
+
when: The principal records an attestation for a period with a note.
|
|
155
|
+
then: A row is appended carrying the principal's account and e-mail, the period, the counts the server computed from the current review rather than any count in the request, and the note, and the attestation list returns it newest first in bounded pages.
|
|
156
|
+
- id: ACCESS-ATTEST-APPEND-ONLY
|
|
157
|
+
given: An attestation was recorded for a period.
|
|
158
|
+
when: The same period is attested again.
|
|
159
|
+
then: A second row is appended and the first is unchanged, and the module exposes no route, service method or statement that updates or deletes an attestation.
|
|
160
|
+
- id: ACCESS-DENY
|
|
161
|
+
given: A request carries no session, or a session whose scopes lack the permission the route requires.
|
|
162
|
+
when: The request reaches any access.core route.
|
|
163
|
+
then: The server answers 401 without an identity and 403 without the permission, before any read of auth data or any write, and a principal holding only access.review.read is refused when it attests.
|
|
164
|
+
- id: ACCESS-CSRF
|
|
165
|
+
given: A principal holds access.review.manage and a valid session.
|
|
166
|
+
when: The attestation request arrives without the session CSRF proof or from another origin.
|
|
167
|
+
then: The server refuses it before computing the review or writing a row.
|
|
168
|
+
- id: ACCESS-TENANT-BOUNDARY
|
|
169
|
+
given: Two workspaces have recorded attestations.
|
|
170
|
+
when: A principal of one workspace lists attestations, and a transaction bound to that workspace attempts to write a row carrying the other workspace's identifier.
|
|
171
|
+
then: Only its own workspace's attestations are visible, and the forced row-level security policy rejects the foreign row.
|
|
172
|
+
outOfScope:
|
|
173
|
+
- Per-member identity provider bindings. auth.core exposes no read of which account is linked to which provider, so the review lists the providers a workspace has configured and their joining rules; the per-member binding waits for an auth.core read surface and is recorded as a follow-up.
|
|
174
|
+
- A screen that starts an export. access.core registers its two lists with exports.core when that module is present, and the export is started from the exports screen; access.core adds no export button of its own.
|
|
175
|
+
- Holds and erasures in the activity report. They belong to audit.core's own trail, which publishes no read capability, so the activity report covers the auth.core trail and names the missing source rather than guessing at it.
|
|
176
|
+
- The agents and sandbox audit sources. ADR 0004's source selector reads them behind their own scopes in auth.core's Audit screen; access.core reports the platform trail only.
|
|
177
|
+
- A reconstructed point-in-time membership state for a past date. The diff is the recorded change list of a window, which is what the trail can answer honestly.
|
|
178
|
+
- Reminders, schedules and periodic attestation campaigns. An attestation is recorded when someone performs the review.
|
|
179
|
+
- Erasure of attestations. The ledger is the evidence that a review happened, so its rows are kept like an audit event rather than erased with a subject.
|
|
180
|
+
- PDF output. The platform has no renderer, so a file of a review is the CSV exports.core writes.
|
|
181
|
+
decisions:
|
|
182
|
+
- id: D-EXPORT-LISTS
|
|
183
|
+
question: How is a review exported to a file?
|
|
184
|
+
answer: Through exports.core. access.core registers two lists with exports.lists.v1 when that module is composed, the review's memberships (walked from the member the page last carried) and the attestation ledger (whose rows never change). The capability is optional, so a deployment without exports.core registers nothing.
|
|
185
|
+
decidedBy: default
|
|
186
|
+
- id: D-OWNERS-ONLY
|
|
187
|
+
question: Who may read the access review and who may record an attestation?
|
|
188
|
+
answer: Workspace owners only. Both permissions are granted to owners when the module is enabled and neither is added to the member scope list, because the review names every scope, token and provider of the workspace.
|
|
189
|
+
decidedBy: user
|
|
190
|
+
- id: D-SERVER-COUNTS
|
|
191
|
+
question: Where do the counts stored on an attestation come from?
|
|
192
|
+
answer: The server recomputes the review inside the attesting request and stores its own counts. A count in the request body is ignored, so the evidence cannot be fabricated by the caller.
|
|
193
|
+
decidedBy: default
|
|
194
|
+
- id: D-APPEND-ONLY
|
|
195
|
+
question: May an attestation be corrected or withdrawn?
|
|
196
|
+
answer: No. The ledger is append-only; a second attestation for the same period is appended and the earlier row stays as it was recorded.
|
|
197
|
+
decidedBy: default
|
|
198
|
+
- id: D-ACTIVE-ACCESS
|
|
199
|
+
question: Does the review list revoked and expired API tokens?
|
|
200
|
+
answer: No. The review answers who holds access now, so it lists usable tokens only. Issuance and revocation appear in the activity report.
|
|
201
|
+
decidedBy: default
|
|
202
|
+
- id: D-RANGE-BOUND
|
|
203
|
+
question: How long a period may a diff or an activity report cover?
|
|
204
|
+
answer: At most 366 days, given as UTC calendar dates with an inclusive end. A longer or reversed range is refused with a stable code before any read.
|
|
205
|
+
decidedBy: default
|
|
206
|
+
- id: D-BOUNDED-WALK
|
|
207
|
+
question: How does a report stay bounded when a workspace's trail is large?
|
|
208
|
+
answer: One request scans a fixed budget of audit pages and answers a signed cursor for the rest. The cursor is the last position scanned, not the last row shown, so a page that matched nothing still advances.
|
|
209
|
+
decidedBy: default
|
|
210
|
+
- id: D-AUDIT-WINDOW-GAP
|
|
211
|
+
question: Where is the date window of a report applied?
|
|
212
|
+
answer: In auth.core. The audit query carries the window as an inclusive from and to over the recorded instant, applied in SQL beside the keyset, so access.core states the period and pages the positions rather than seeding the cursor at a ceiling and watching for a floor. An event on the first or the last millisecond of the window belongs to it, and nothing in access.core reads auth tables directly.
|
|
213
|
+
decidedBy: default
|
|
214
|
+
- id: D-REPORT-SCREENS
|
|
215
|
+
question: How are the review and activity screens specified when they render no entity?
|
|
216
|
+
answer: They name no entity and no columns, because they render reports computed from auth.core. What each one carries is fixed by the acceptance scenarios rather than by entity fields.
|
|
217
|
+
decidedBy: default
|
|
218
|
+
- id: D-REVIEW-BOUND
|
|
219
|
+
question: What happens when a workspace holds more members or tokens than one review can list?
|
|
220
|
+
answer: Each section lists at most its declared bound and says it was capped, while the counts stay exact. Only the screen is bounded that way, because a file of the review walks auth.core's paged member surface and carries every member of the workspace.
|
|
221
|
+
decidedBy: default
|
|
222
|
+
- id: D-NO-ATTESTATION-ERASURE
|
|
223
|
+
question: Is an attestation erased when its reviewer requests erasure?
|
|
224
|
+
answer: No. The data class is declared kept and exportable and carries no erase operation, so an erasure certificate names it as not erasable, the same answer audit events give.
|
|
225
|
+
decidedBy: default
|
|
@@ -0,0 +1,244 @@
|
|
|
1
|
+
import { randomBytes } from 'node:crypto';
|
|
2
|
+
import {
|
|
3
|
+
decodeCursor,
|
|
4
|
+
defineEndpoint,
|
|
5
|
+
encodeCursor,
|
|
6
|
+
jsonResponse,
|
|
7
|
+
pageResponse,
|
|
8
|
+
problemResponse,
|
|
9
|
+
readJsonObject,
|
|
10
|
+
readPageQuery,
|
|
11
|
+
optionalString,
|
|
12
|
+
requiredString,
|
|
13
|
+
} from '@flowdular/sdk/server';
|
|
14
|
+
import type { AuthRuntime } from '@flowdular/sdk/modules/auth/server';
|
|
15
|
+
import {
|
|
16
|
+
endpointIdentityFromContext,
|
|
17
|
+
principalFromContext,
|
|
18
|
+
sessionMutationDenial,
|
|
19
|
+
} from '@flowdular/sdk/modules/auth/server';
|
|
20
|
+
import { ACCESS_PERMISSIONS } from '../acl/permissions.ts';
|
|
21
|
+
import {
|
|
22
|
+
ACCESS_LIMITS,
|
|
23
|
+
type AccessWindow,
|
|
24
|
+
type AttestationPosition,
|
|
25
|
+
type AuditPosition,
|
|
26
|
+
} from '../domain/types.ts';
|
|
27
|
+
import type { AccessRuntime } from '../server/runtime.ts';
|
|
28
|
+
import { AccessServiceError, parseWindow } from '../services/access-service.ts';
|
|
29
|
+
import type { AccessReportKind } from '../services/changes.ts';
|
|
30
|
+
|
|
31
|
+
function failure(error: unknown): Response {
|
|
32
|
+
if (error instanceof AccessServiceError) {
|
|
33
|
+
return jsonResponse(
|
|
34
|
+
{ error: { code: error.code, message: error.message } },
|
|
35
|
+
error.status,
|
|
36
|
+
);
|
|
37
|
+
}
|
|
38
|
+
return problemResponse(error, 'The access review operation failed.');
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
function windowOf(url: URL): AccessWindow {
|
|
42
|
+
const from = url.searchParams.get('from');
|
|
43
|
+
const to = url.searchParams.get('to');
|
|
44
|
+
if (from === null || to === null) {
|
|
45
|
+
throw new AccessServiceError('INVALID_INPUT', 'from and to are required.');
|
|
46
|
+
}
|
|
47
|
+
return parseWindow(from, to);
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
export function createAccessRoutes(auth: AuthRuntime, runtime: AccessRuntime) {
|
|
51
|
+
/* Module-owned and never stored: a cursor names a position in one
|
|
52
|
+
workspace's own report, so a restart invalidating one costs a reader the
|
|
53
|
+
first page. */
|
|
54
|
+
const cursorSecret = randomBytes(32);
|
|
55
|
+
|
|
56
|
+
/* Every cursor this module answers is signed with the same secret, so a
|
|
57
|
+
cursor from one report reaches another report's reader. Each one checks
|
|
58
|
+
the shape it needs rather than trusting the signature alone. */
|
|
59
|
+
const invalidCursor = (): never => {
|
|
60
|
+
throw new AccessServiceError(
|
|
61
|
+
'CURSOR_INVALID',
|
|
62
|
+
'The page cursor is not valid.',
|
|
63
|
+
);
|
|
64
|
+
};
|
|
65
|
+
|
|
66
|
+
const auditCursor = (cursor: string | null): AuditPosition | null => {
|
|
67
|
+
if (cursor === null) return null;
|
|
68
|
+
const value = decodeCursor(cursor, cursorSecret);
|
|
69
|
+
const occurredAt = value.occurredAt;
|
|
70
|
+
const id = value.id;
|
|
71
|
+
if (!Number.isSafeInteger(occurredAt) || !Number.isSafeInteger(id)) {
|
|
72
|
+
invalidCursor();
|
|
73
|
+
}
|
|
74
|
+
return { occurredAt: occurredAt as number, id: id as number };
|
|
75
|
+
};
|
|
76
|
+
|
|
77
|
+
const attestationCursor = (
|
|
78
|
+
cursor: string | null,
|
|
79
|
+
): AttestationPosition | null => {
|
|
80
|
+
if (cursor === null) return null;
|
|
81
|
+
const value = decodeCursor(cursor, cursorSecret);
|
|
82
|
+
const createdAt = value.createdAt;
|
|
83
|
+
const id = value.id;
|
|
84
|
+
if (!Number.isSafeInteger(createdAt) || typeof id !== 'string') {
|
|
85
|
+
invalidCursor();
|
|
86
|
+
}
|
|
87
|
+
return { createdAt: createdAt as number, id: id as string };
|
|
88
|
+
};
|
|
89
|
+
|
|
90
|
+
/* Both reports answer the same body: the matched changes, the window they
|
|
91
|
+
were read over, and the position the next request resumes from. */
|
|
92
|
+
const changes = (id: string, path: string, kind: AccessReportKind) =>
|
|
93
|
+
defineEndpoint({
|
|
94
|
+
id,
|
|
95
|
+
path,
|
|
96
|
+
methods: ['GET'],
|
|
97
|
+
access: { kind: 'permission', permission: ACCESS_PERMISSIONS.read },
|
|
98
|
+
resolveIdentity: endpointIdentityFromContext,
|
|
99
|
+
handler: async ({ octane }) => {
|
|
100
|
+
try {
|
|
101
|
+
const url = new URL(octane.request.url);
|
|
102
|
+
const window = windowOf(url);
|
|
103
|
+
const page = readPageQuery(url, {
|
|
104
|
+
maxLimit: ACCESS_LIMITS.reportLimit,
|
|
105
|
+
defaultLimit: ACCESS_LIMITS.reportDefault,
|
|
106
|
+
});
|
|
107
|
+
const result = await (
|
|
108
|
+
await runtime.service()
|
|
109
|
+
).changes(principalFromContext(octane)!.tenantId, kind, window, {
|
|
110
|
+
limit: page.limit,
|
|
111
|
+
after: auditCursor(page.cursor),
|
|
112
|
+
});
|
|
113
|
+
return jsonResponse({
|
|
114
|
+
items: result.items,
|
|
115
|
+
page: {
|
|
116
|
+
nextCursor:
|
|
117
|
+
result.next === null
|
|
118
|
+
? null
|
|
119
|
+
: encodeCursor({ ...result.next }, cursorSecret),
|
|
120
|
+
limit: page.limit,
|
|
121
|
+
},
|
|
122
|
+
window: {
|
|
123
|
+
from: result.window.from,
|
|
124
|
+
to: result.window.to,
|
|
125
|
+
},
|
|
126
|
+
/* The trail this report covers. Holds and erasures live in
|
|
127
|
+
audit.core's own trail, which publishes no read capability,
|
|
128
|
+
so a later source is added here rather than silently. */
|
|
129
|
+
source: 'auth.core',
|
|
130
|
+
});
|
|
131
|
+
} catch (error) {
|
|
132
|
+
return failure(error);
|
|
133
|
+
}
|
|
134
|
+
},
|
|
135
|
+
});
|
|
136
|
+
|
|
137
|
+
const review = defineEndpoint({
|
|
138
|
+
id: 'access.review.get',
|
|
139
|
+
path: '/api/access/review',
|
|
140
|
+
methods: ['GET'],
|
|
141
|
+
access: { kind: 'permission', permission: ACCESS_PERMISSIONS.read },
|
|
142
|
+
resolveIdentity: endpointIdentityFromContext,
|
|
143
|
+
handler: async ({ octane }) => {
|
|
144
|
+
try {
|
|
145
|
+
const service = await runtime.service();
|
|
146
|
+
return jsonResponse({
|
|
147
|
+
review: await service.review(principalFromContext(octane)!.tenantId),
|
|
148
|
+
});
|
|
149
|
+
} catch (error) {
|
|
150
|
+
return failure(error);
|
|
151
|
+
}
|
|
152
|
+
},
|
|
153
|
+
});
|
|
154
|
+
|
|
155
|
+
const diff = changes('access.diff.get', '/api/access/diff', 'diff');
|
|
156
|
+
const activity = changes(
|
|
157
|
+
'access.activity.get',
|
|
158
|
+
'/api/access/activity',
|
|
159
|
+
'activity',
|
|
160
|
+
);
|
|
161
|
+
|
|
162
|
+
const attest = defineEndpoint({
|
|
163
|
+
id: 'access.attestations.create',
|
|
164
|
+
path: '/api/access/attest',
|
|
165
|
+
methods: ['POST'],
|
|
166
|
+
access: { kind: 'permission', permission: ACCESS_PERMISSIONS.manage },
|
|
167
|
+
resolveIdentity: endpointIdentityFromContext,
|
|
168
|
+
handler: async ({ octane }) => {
|
|
169
|
+
const denial = sessionMutationDenial(octane, auth);
|
|
170
|
+
if (denial) return denial;
|
|
171
|
+
try {
|
|
172
|
+
const value = await readJsonObject(octane.request);
|
|
173
|
+
const window = parseWindow(
|
|
174
|
+
requiredString(value, 'from', { min: 10, max: 10 }),
|
|
175
|
+
requiredString(value, 'to', { min: 10, max: 10 }),
|
|
176
|
+
);
|
|
177
|
+
const principal = principalFromContext(octane)!;
|
|
178
|
+
const service = await runtime.service();
|
|
179
|
+
/* The reviewer is the acting principal and the counts are the
|
|
180
|
+
server's own reading; the body carries the period and the note
|
|
181
|
+
and nothing that could dress up the evidence. */
|
|
182
|
+
const attestation = await service.attest(
|
|
183
|
+
principal.tenantId,
|
|
184
|
+
{ accountId: principal.accountId, label: principal.email },
|
|
185
|
+
{
|
|
186
|
+
window,
|
|
187
|
+
note: optionalString(value, 'note', ACCESS_LIMITS.note),
|
|
188
|
+
},
|
|
189
|
+
);
|
|
190
|
+
return jsonResponse({ attestation }, 201);
|
|
191
|
+
} catch (error) {
|
|
192
|
+
return failure(error);
|
|
193
|
+
}
|
|
194
|
+
},
|
|
195
|
+
});
|
|
196
|
+
|
|
197
|
+
const attestations = defineEndpoint({
|
|
198
|
+
id: 'access.attestations.list',
|
|
199
|
+
path: '/api/access/attestations',
|
|
200
|
+
methods: ['GET'],
|
|
201
|
+
access: { kind: 'permission', permission: ACCESS_PERMISSIONS.read },
|
|
202
|
+
resolveIdentity: endpointIdentityFromContext,
|
|
203
|
+
handler: async ({ octane }) => {
|
|
204
|
+
try {
|
|
205
|
+
const page = readPageQuery(new URL(octane.request.url), {
|
|
206
|
+
maxLimit: ACCESS_LIMITS.attestationLimit,
|
|
207
|
+
defaultLimit: ACCESS_LIMITS.attestationDefault,
|
|
208
|
+
});
|
|
209
|
+
const result = await (
|
|
210
|
+
await runtime.service()
|
|
211
|
+
).attestations(principalFromContext(octane)!.tenantId, {
|
|
212
|
+
limit: page.limit,
|
|
213
|
+
after: attestationCursor(page.cursor),
|
|
214
|
+
});
|
|
215
|
+
return pageResponse({
|
|
216
|
+
items: result.items,
|
|
217
|
+
limit: page.limit,
|
|
218
|
+
nextCursor:
|
|
219
|
+
result.next === null
|
|
220
|
+
? null
|
|
221
|
+
: encodeCursor({ ...result.next }, cursorSecret),
|
|
222
|
+
});
|
|
223
|
+
} catch (error) {
|
|
224
|
+
return failure(error);
|
|
225
|
+
}
|
|
226
|
+
},
|
|
227
|
+
});
|
|
228
|
+
|
|
229
|
+
return [
|
|
230
|
+
review.serverRoute,
|
|
231
|
+
diff.serverRoute,
|
|
232
|
+
activity.serverRoute,
|
|
233
|
+
attest.serverRoute,
|
|
234
|
+
attestations.serverRoute,
|
|
235
|
+
] as const;
|
|
236
|
+
}
|
|
237
|
+
|
|
238
|
+
export const endpoints = [
|
|
239
|
+
'access.review.get',
|
|
240
|
+
'access.diff.get',
|
|
241
|
+
'access.activity.get',
|
|
242
|
+
'access.attestations.create',
|
|
243
|
+
'access.attestations.list',
|
|
244
|
+
] as const;
|