@flowdular/sdk 0.2.4 → 0.3.1
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 +130 -3
- 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/cli-extension/SKILL.md +1 -1
- package/.ai/skills/deploy-operate/SKILL.md +119 -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/0005_approvals_grant_audit.down.sql +4 -0
- package/modules/approvals/migrations/0005_approvals_grant_audit.up.sql +20 -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 +327 -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 +107 -0
- package/modules/approvals/src/domain/grant.ts +69 -0
- package/modules/approvals/src/domain/types.ts +168 -0
- package/modules/approvals/src/index.ts +61 -0
- package/modules/approvals/src/platform.ts +136 -0
- package/modules/approvals/src/server/index.ts +42 -0
- package/modules/approvals/src/server/runtime.ts +185 -0
- package/modules/approvals/src/services/approvals-service.ts +637 -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 +783 -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 +256 -0
- package/modules/approvals/src/services/notifications.ts +95 -0
- package/modules/approvals/src/services/repository.ts +169 -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/0003_connectors_rotation_inventory.down.sql +2 -0
- package/modules/connectors/migrations/0003_connectors_rotation_inventory.up.sql +19 -0
- package/modules/connectors/migrations/README.md +3 -0
- package/modules/connectors/module.json +32 -0
- package/modules/{automations-workflows-integration → connectors}/package.json +28 -26
- package/modules/connectors/spec/module.yaml +448 -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/cli/commands.json +17 -0
- package/modules/connectors/src/cli/index.ts +126 -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-rotation.ts +221 -0
- package/modules/connectors/src/services/credential-vault.ts +194 -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 +202 -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/0003_documents_rotation_inventory.down.sql +2 -0
- package/modules/documents/migrations/0003_documents_rotation_inventory.up.sql +18 -0
- package/modules/documents/migrations/README.md +3 -0
- package/modules/documents/module.json +32 -0
- package/modules/documents/package.json +50 -0
- package/modules/documents/spec/module.yaml +248 -0
- package/modules/documents/src/acl/permissions.ts +6 -0
- package/modules/documents/src/api/endpoints.ts +401 -0
- package/modules/documents/src/cli/commands.json +17 -0
- package/modules/documents/src/cli/index.ts +145 -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 +270 -0
- package/modules/documents/src/services/documents-service.ts +590 -0
- package/modules/documents/src/services/index.ts +18 -0
- package/modules/documents/src/services/migration.ts +117 -0
- package/modules/documents/src/services/repository.ts +58 -0
- package/modules/documents/src/services/storage-rotation.ts +157 -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/0003_exports_rotation_inventory.down.sql +1 -0
- package/modules/exports/migrations/0003_exports_rotation_inventory.up.sql +9 -0
- package/modules/exports/migrations/README.md +3 -0
- package/modules/exports/module.json +32 -0
- package/modules/exports/package.json +45 -0
- package/modules/exports/spec/module.yaml +230 -0
- package/modules/exports/src/acl/permissions.ts +6 -0
- package/modules/exports/src/api/endpoints.ts +211 -0
- package/modules/exports/src/cli/commands.json +17 -0
- package/modules/exports/src/cli/index.ts +145 -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 +50 -0
- package/modules/exports/src/server/runtime.ts +160 -0
- package/modules/exports/src/services/data-classes.ts +59 -0
- package/modules/exports/src/services/database-repository.ts +403 -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 +116 -0
- package/modules/exports/src/services/repository.ts +96 -0
- package/modules/exports/src/services/storage-rotation.ts +138 -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 +180 -0
- package/packages/database/src/decoders.ts +25 -0
- package/packages/database/src/index.ts +17 -0
- package/packages/database/src/migrations.ts +7 -0
- package/packages/database/src/record-history.ts +5 -14
- package/packages/harness/src/index.ts +2 -0
- package/packages/harness/src/runtime.ts +378 -2
- package/packages/harness/src/tool-adapters.ts +20 -9
- package/packages/kernel/src/acl.ts +179 -0
- package/packages/kernel/src/approval-grant.ts +310 -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 +85 -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 +238 -0
- package/packages/storage/src/index.ts +49 -0
- package/packages/storage/src/local.ts +75 -0
- package/packages/storage/src/port.ts +262 -0
- package/packages/storage/src/read-token.ts +130 -0
- package/packages/storage/src/reseal.ts +128 -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
|
@@ -19,6 +19,10 @@
|
|
|
19
19
|
"invite.sending": "Wysyłanie…",
|
|
20
20
|
"invite.sent": "Zaproszenie wysłano na {email}.",
|
|
21
21
|
"invite.error": "Nie udało się wysłać zaproszenia.",
|
|
22
|
+
"export.action": "Eksportuj CSV",
|
|
23
|
+
"export.started": "Eksport członków wystartował. Pojawi się na ekranie Eksporty, gdy plik będzie gotowy.",
|
|
24
|
+
"export.link": "Otwórz Eksporty",
|
|
25
|
+
"export.error": "Nie udało się rozpocząć eksportu.",
|
|
22
26
|
"action.manage": "Zarządzaj",
|
|
23
27
|
"action.cancel": "Anuluj",
|
|
24
28
|
"action.close": "Zamknij",
|
|
@@ -31,10 +35,11 @@
|
|
|
31
35
|
"denied.members": "Odczyt katalogu użytkowników wymaga uprawnienia users.members.read.",
|
|
32
36
|
"table.title": "Członkowie",
|
|
33
37
|
"table.caption": "Użytkownicy przestrzeni roboczej",
|
|
34
|
-
"table.count": "
|
|
38
|
+
"table.count": "Konta: {accounts}",
|
|
35
39
|
"table.user": "Użytkownik",
|
|
40
|
+
"table.email": "E-mail",
|
|
36
41
|
"table.role": "Rola",
|
|
37
|
-
"table.status": "
|
|
42
|
+
"table.status": "Dostęp do przestrzeni",
|
|
38
43
|
"table.scopes": "Zakresy",
|
|
39
44
|
"table.actions": "Akcje użytkownika",
|
|
40
45
|
"table.loading": "Wczytywanie kont…",
|
|
@@ -42,11 +47,36 @@
|
|
|
42
47
|
"table.emptyHint": "Utwórz pierwsze konto w tej przestrzeni roboczej.",
|
|
43
48
|
"table.emptyFilteredTitle": "Brak pasujących kont",
|
|
44
49
|
"table.emptyFilteredHint": "Żadne konto w tej przestrzeni nie pasuje do bieżącego filtra.",
|
|
50
|
+
"selection.label": "Zaznacz wszystkich członków na ekranie",
|
|
51
|
+
"selection.rowLabel": "Zaznacz {name}",
|
|
52
|
+
"selection.clear": "Wyczyść zaznaczenie",
|
|
53
|
+
"selection.summary": "Zaznaczono: {count}",
|
|
54
|
+
"action.deactivateSelected": "Dezaktywuj zaznaczonych",
|
|
55
|
+
"action.assignRoleSelected": "Przypisz rolę",
|
|
56
|
+
"action.bulkRefused": "Zaznacz co najmniej jednego członka innego niż Ty.",
|
|
57
|
+
"deactivateMany.title": "Dezaktywować zaznaczonych członków?",
|
|
58
|
+
"deactivateMany.description": "Liczba członków tracących dostęp do tej przestrzeni: {count}. Ich sesje i tokeny API w tej przestrzeni zostaną unieważnione, a inne przestrzenie pozostaną bez zmian.",
|
|
59
|
+
"roleMany.title": "Przypisz rolę zaznaczonym członkom",
|
|
60
|
+
"roleMany.description": "Rola zastąpi zakresy członków w liczbie {count}.",
|
|
61
|
+
"notice.deactivatedMany": "Dezaktywowano {updated}, brak {missing}, odrzucono {refused}.",
|
|
62
|
+
"notice.roleAssignedMany": "Rolę przypisano {updated}, brak {missing}, odrzucono {refused}.",
|
|
63
|
+
"error.deactivateMany": "Nie udało się dezaktywować zaznaczonych członków.",
|
|
64
|
+
"error.roleMany": "Nie udało się przypisać roli zaznaczonym członkom.",
|
|
65
|
+
"common.messages": "Komunikaty",
|
|
45
66
|
"table.note": "Role określają dostęp kont. Właściciele zarządzają przestrzenią roboczą, a każda pozostała rola ma dokładnie podane zakresy.",
|
|
46
|
-
"search.placeholder": "
|
|
67
|
+
"search.placeholder": "Zaczyna się od nazwy lub adresu e-mail",
|
|
47
68
|
"search.label": "Filtruj członków",
|
|
69
|
+
"filter.label": "Filtry",
|
|
70
|
+
"filter.status": "Dostęp do przestrzeni",
|
|
71
|
+
"filter.allStatuses": "Wszystkie",
|
|
72
|
+
"pagination.label": "Strony listy członków",
|
|
73
|
+
"pagination.previous": "Poprzednia",
|
|
74
|
+
"pagination.next": "Następna",
|
|
75
|
+
"pagination.size": "Członków na stronie",
|
|
76
|
+
"pagination.summary": "Strona {page} · od członka {from}",
|
|
48
77
|
"status.active": "Aktywne",
|
|
49
78
|
"status.disabled": "Wyłączone",
|
|
79
|
+
"status.blocked": "Blokada operatora",
|
|
50
80
|
"status.passwordResetPending": "Oczekuje na zmianę hasła",
|
|
51
81
|
"drawer.newTitle": "Nowe konto",
|
|
52
82
|
"drawer.newSubtitle": "Bezpośredni dostęp do przestrzeni roboczej",
|
|
@@ -68,28 +98,47 @@
|
|
|
68
98
|
"member.saveName": "Zapisz nazwę",
|
|
69
99
|
"member.roleDescription": "Rola ustawia poniższe zakresy. Role niestandardowe są dostępne na ekranie Role.",
|
|
70
100
|
"member.assignRole": "Przypisz rolę",
|
|
101
|
+
"member.access": "Dostęp do tej przestrzeni roboczej",
|
|
102
|
+
"member.accessDescription": "Włącza lub wyłącza to członkostwo. Nie zmienia innych przestrzeni roboczych tej osoby ani jej konta.",
|
|
103
|
+
"membership.active": "Aktywny w tej przestrzeni",
|
|
104
|
+
"membership.disabled": "Wyłączony w tej przestrzeni",
|
|
105
|
+
"membership.reasonActive": "Członek normalnie loguje się do tej przestrzeni roboczej. Pozostałe przestrzenie pozostają bez zmian.",
|
|
106
|
+
"membership.reasonDisabled": "Logowanie do tej przestrzeni roboczej jest odrzucane, a jej sesje i tokeny API zostały unieważnione. Pozostałe przestrzenie działają dalej.",
|
|
107
|
+
"membership.disable": "Wyłącz dostęp",
|
|
108
|
+
"membership.confirmTitle": "Wyłączyć dostęp dla {name}?",
|
|
109
|
+
"membership.confirmDescription": "Sesje i tokeny API tej przestrzeni roboczej zostaną natychmiast unieważnione, a logowanie tutaj odrzucone. Pozostałe przestrzenie pozostaną nietknięte. Ponowne włączenie przywraca logowanie, ale nie unieważnione tokeny.",
|
|
110
|
+
"membership.error": "Nie udało się zmienić dostępu do przestrzeni roboczej.",
|
|
111
|
+
"membership.errorSelf": "Nie możesz zmienić własnego dostępu do tej przestrzeni roboczej. Poproś innego właściciela.",
|
|
112
|
+
"membership.errorLastOwner": "To ostatni aktywny właściciel przestrzeni roboczej. Najpierw nadaj rolę właściciela innemu członkowi.",
|
|
113
|
+
"membership.errorOwnerRequired": "Tylko właściciel może zmienić dostęp innego właściciela do tej przestrzeni roboczej.",
|
|
114
|
+
"membership.errorNotFound": "Tego członka nie ma już w przestrzeni roboczej. Odśwież listę.",
|
|
71
115
|
"member.account": "Konto",
|
|
72
|
-
"member.accountDescription": "
|
|
73
|
-
"member.
|
|
74
|
-
"member.enable": "Włącz konto",
|
|
116
|
+
"member.accountDescription": "Globalny stan konta, którym zarządza operator. Wylogowanie kończy wszystkie sesje tego konta, we wszystkich przestrzeniach roboczych.",
|
|
117
|
+
"member.accountReadOnly": "Zablokowanie lub odblokowanie konta to działanie operatora wdrożenia i nie można go wykonać tutaj. Aby odebrać dostęp do tej przestrzeni roboczej, użyj przełącznika powyżej.",
|
|
75
118
|
"member.signOutEverywhere": "Wyloguj ze wszystkich urządzeń",
|
|
76
119
|
"member.temporaryPassword": "Hasło tymczasowe",
|
|
77
120
|
"member.temporaryPasswordHelp": "Co najmniej {min} znaków. Członek ustawi nowe hasło przy następnym logowaniu.",
|
|
78
121
|
"member.resetPassword": "Zresetuj hasło",
|
|
122
|
+
"member.mfa": "Uwierzytelnianie wieloskładnikowe",
|
|
123
|
+
"member.mfaDescription": "Usuń zarejestrowaną aplikację uwierzytelniającą, gdy członek utraci urządzenie. Członek rejestruje ją ponownie w ustawieniach bezpieczeństwa konta.",
|
|
124
|
+
"member.resetMfa": "Zresetuj MFA",
|
|
79
125
|
"member.removeTitle": "Usuń z przestrzeni roboczej",
|
|
80
126
|
"member.removeDescription": "Kończy członkostwo wraz z sesjami i tokenami. Konto pozostaje, jeśli należy do innej przestrzeni roboczej.",
|
|
81
127
|
"member.remove": "Usuń członka",
|
|
82
128
|
"notice.nameSaved": "Zapisano nazwę wyświetlaną.",
|
|
83
129
|
"notice.roleAssigned": "Przypisano rolę.",
|
|
84
130
|
"notice.scopesSaved": "Zapisano zakresy.",
|
|
85
|
-
"notice.
|
|
86
|
-
"notice.
|
|
131
|
+
"notice.membershipDisabled": "Wyłączono dostęp do tej przestrzeni roboczej.",
|
|
132
|
+
"notice.membershipEnabled": "Włączono dostęp do tej przestrzeni roboczej.",
|
|
87
133
|
"notice.passwordSet": "Ustawiono hasło tymczasowe. Członek musi zmienić je przy logowaniu.",
|
|
134
|
+
"notice.mfaReset": "Uwierzytelnianie wieloskładnikowe zostało wyczyszczone. Członek musi zarejestrować je ponownie.",
|
|
88
135
|
"notice.sessionsCount": "Zakończone sesje: {count}.",
|
|
89
136
|
"notice.sessionsEnded": "Sesje zostały zakończone.",
|
|
90
137
|
"remove.title": "Usunąć tego członka?",
|
|
91
138
|
"remove.fallbackName": "Ten członek",
|
|
92
139
|
"remove.description": "{name} natychmiast utraci dostęp do tej przestrzeni roboczej. Sesje i tokeny API tego członkostwa zostaną unieważnione.",
|
|
140
|
+
"mfaReset.title": "Zresetować uwierzytelnianie wieloskładnikowe?",
|
|
141
|
+
"mfaReset.description": "{name} utraci zarejestrowaną aplikację uwierzytelniającą oraz wszystkie kody odzyskiwania i musi zarejestrować ją ponownie przed kolejnym logowaniem wymagającym drugiego składnika.",
|
|
93
142
|
"roles.title": "Role",
|
|
94
143
|
"roles.description": "Role wbudowane i niestandardowe wraz z dokładnymi zakresami uprawnień.",
|
|
95
144
|
"roles.new": "Nowa rola",
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
-- The rotation command has to find the payloads still sealed with a retired key
|
|
2
|
+
-- before it knows whose they are. The retention sweep sees only payloads with an
|
|
3
|
+
-- expiry; a rotation covers every live one, so it reads under a policy of its
|
|
4
|
+
-- own and is granted the key id alone. The ciphertext stays unreadable on this
|
|
5
|
+
-- connection, and every payload it re-seals is read again under the tenant that
|
|
6
|
+
-- row named.
|
|
7
|
+
DO $$
|
|
8
|
+
BEGIN
|
|
9
|
+
IF NOT EXISTS (SELECT 1 FROM pg_roles WHERE rolname = 'coreloom_background') THEN
|
|
10
|
+
RAISE EXCEPTION 'The coreloom_background role must exist before this migration.';
|
|
11
|
+
END IF;
|
|
12
|
+
END
|
|
13
|
+
$$;
|
|
14
|
+
CREATE POLICY workflow_payloads_rotation_policy ON workflow_payloads
|
|
15
|
+
FOR SELECT TO coreloom_background
|
|
16
|
+
USING (kind = 'execution');
|
|
17
|
+
GRANT SELECT (encryption_key_id) ON workflow_payloads TO coreloom_background;
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
-- A run waiting on a person waits for days, not for the seconds an agent or an
|
|
2
|
+
-- action takes. Leaving it in 'running' would keep it at the head of the claim
|
|
3
|
+
-- queue, where it would be re-claimed every poll and, because the queue is
|
|
4
|
+
-- ordered by queued_at, would starve every run queued after it.
|
|
5
|
+
--
|
|
6
|
+
-- 'waiting-approval' is the status that takes such a run out of the queue. It
|
|
7
|
+
-- comes back when approvals.core calls back, which sets the node's
|
|
8
|
+
-- next_attempt_at to now, or when the recheck the node armed falls due; the
|
|
9
|
+
-- claim predicate reads that column exactly as it already does for a retry.
|
|
10
|
+
--
|
|
11
|
+
-- The approval itself is the third child kind. It reuses the attempt's
|
|
12
|
+
-- waiting-child machinery, so the request id is stored in child_id and recovery
|
|
13
|
+
-- after a restart finds the open request instead of opening a second one.
|
|
14
|
+
ALTER TABLE workflow_runs DROP CONSTRAINT IF EXISTS workflow_runs_status_check;
|
|
15
|
+
ALTER TABLE workflow_runs ADD CONSTRAINT workflow_runs_status_check
|
|
16
|
+
CHECK (status IN ('queued', 'running', 'waiting-agent', 'waiting-approval', 'waiting-retry', 'cancel-requested', 'succeeded', 'failed', 'refused', 'cancelled'));
|
|
17
|
+
ALTER TABLE workflow_node_attempts DROP CONSTRAINT IF EXISTS workflow_node_attempts_child_kind_check;
|
|
18
|
+
ALTER TABLE workflow_node_attempts ADD CONSTRAINT workflow_node_attempts_child_kind_check
|
|
19
|
+
CHECK (child_kind IN ('agent', 'action', 'approval'));
|
|
20
|
+
-- The claim poll has to see that a node is asleep on an approval before it can
|
|
21
|
+
-- decide whether the run is due, and the cross-tenant policy showed it retries
|
|
22
|
+
-- only. It is widened to the second waiting state and no further: the four
|
|
23
|
+
-- routing columns it was already granted stay the whole of what it can read,
|
|
24
|
+
-- and the run is read again under its own tenant before anything is written.
|
|
25
|
+
DROP POLICY IF EXISTS workflow_node_states_background_policy ON workflow_node_states;
|
|
26
|
+
CREATE POLICY workflow_node_states_background_policy ON workflow_node_states
|
|
27
|
+
FOR SELECT TO coreloom_background
|
|
28
|
+
USING (status IN ('waiting-retry', 'waiting-child'));
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
-- The retention sweep of workflows.core.runs asks one workspace for its oldest
|
|
2
|
+
-- settled runs, and a subject erasure asks it for the runs one account
|
|
3
|
+
-- requested. Both are bounded batches, so both need a range scan rather than a
|
|
4
|
+
-- pass over the workspace's runs. The requester lives inside the stored actor
|
|
5
|
+
-- document, so the index is over that one field of it; the export walks the
|
|
6
|
+
-- order workflow_runs_tenant_queue_idx already carries and needs no index of
|
|
7
|
+
-- its own.
|
|
8
|
+
CREATE INDEX IF NOT EXISTS workflow_runs_tenant_settled_idx
|
|
9
|
+
ON workflow_runs (tenant_id, completed_at);
|
|
10
|
+
CREATE INDEX IF NOT EXISTS workflow_runs_tenant_requester_idx
|
|
11
|
+
ON workflow_runs (tenant_id, (actor_json::jsonb ->> 'id'), id);
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
-- A subject erasure asks one workspace for the runs a person is behind, and
|
|
2
|
+
-- that is three questions rather than one: the runs the person started, the
|
|
3
|
+
-- runs a service actor they configured started, and the runs an agent started
|
|
4
|
+
-- on their behalf. 0006 indexed the first, which is the only one held in the
|
|
5
|
+
-- actor's own id. These give the other two the same support.
|
|
6
|
+
-- Neither is reachable from the connection the erasure runs on, and 0006's is
|
|
7
|
+
-- not either. The jsonb extraction operator is not leakproof, so under the
|
|
8
|
+
-- forced row level security policy PostgreSQL applies the policy first and the
|
|
9
|
+
-- comparison stays a filter rather than an index condition: measured over
|
|
10
|
+
-- 20000 runs, the runtime role scans the workspace while the migration role
|
|
11
|
+
-- uses the index. The batch limit is what bounds an erasure until the subject
|
|
12
|
+
-- account is stored in a column of its own, which compares leakproof and
|
|
13
|
+
-- indexes plainly; that column is the precise fix and it retires all three.
|
|
14
|
+
CREATE INDEX IF NOT EXISTS workflow_runs_tenant_configured_by_idx
|
|
15
|
+
ON workflow_runs (tenant_id, (actor_json::jsonb -> 'configuredBy' ->> 'id'), id);
|
|
16
|
+
CREATE INDEX IF NOT EXISTS workflow_runs_tenant_subject_idx
|
|
17
|
+
ON workflow_runs (tenant_id, (authorization_subject_json::jsonb ->> 'id'), id);
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
-- The person behind a run, resolved once at write time instead of read out of
|
|
2
|
+
-- the stored actor document on every erasure. A run started by a person names
|
|
3
|
+
-- them in its actor, a run started by a schedule, a webhook or an automation
|
|
4
|
+
-- names them in the service actor's configuredBy, and a run an agent started
|
|
5
|
+
-- names them in the delegated authorization subject; this column is that one
|
|
6
|
+
-- answer, and the three predicates it replaces become a single equality.
|
|
7
|
+
-- This supersedes the expression indexes of 0006 and 0007, which the erasure
|
|
8
|
+
-- cannot use: the jsonb extraction operator is not leakproof, so under the
|
|
9
|
+
-- forced row level security policy PostgreSQL applies the policy first and the
|
|
10
|
+
-- comparison can never become an index condition. A plain text column compares
|
|
11
|
+
-- leakproof and indexes normally, so the same query becomes an index scan on
|
|
12
|
+
-- the connection the erasure actually runs on. Both older indexes stay because
|
|
13
|
+
-- an applied migration is immutable; they are dead weight, not a hazard.
|
|
14
|
+
ALTER TABLE workflow_runs
|
|
15
|
+
ADD COLUMN subject_account_id TEXT;
|
|
16
|
+
UPDATE workflow_runs
|
|
17
|
+
SET subject_account_id = COALESCE(
|
|
18
|
+
actor_json::jsonb -> 'configuredBy' ->> 'id',
|
|
19
|
+
authorization_subject_json::jsonb ->> 'id',
|
|
20
|
+
actor_json::jsonb ->> 'id'
|
|
21
|
+
)
|
|
22
|
+
WHERE subject_account_id IS NULL;
|
|
23
|
+
CREATE INDEX IF NOT EXISTS workflow_runs_tenant_subject_account_idx
|
|
24
|
+
ON workflow_runs (tenant_id, subject_account_id, id);
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
-- The definitions screen pages by keyset over the order it shows, by name or by
|
|
2
|
+
-- last update, each ending in the id. 0001 indexed (tenant_id, name, id), which
|
|
3
|
+
-- serves neither an ORDER BY over lower(name) nor one over updated_at, so both
|
|
4
|
+
-- orders walked the workspace's rows and sorted them. These two carry each
|
|
5
|
+
-- order the way the page reads it.
|
|
6
|
+
CREATE INDEX IF NOT EXISTS workflow_definitions_tenant_lower_name_idx
|
|
7
|
+
ON workflow_definitions (tenant_id, lower(name), id);
|
|
8
|
+
CREATE INDEX IF NOT EXISTS workflow_definitions_tenant_updated_idx
|
|
9
|
+
ON workflow_definitions (tenant_id, updated_at, id);
|
|
@@ -3,9 +3,16 @@
|
|
|
3
3
|
"schemaVersion": 1,
|
|
4
4
|
"id": "workflows.core",
|
|
5
5
|
"package": "@flowdular/module-workflows",
|
|
6
|
-
"version": "0.
|
|
6
|
+
"version": "0.6.7",
|
|
7
7
|
"profile": "full",
|
|
8
|
-
"capabilities": [
|
|
8
|
+
"capabilities": [
|
|
9
|
+
"api",
|
|
10
|
+
"database",
|
|
11
|
+
"client",
|
|
12
|
+
"translations",
|
|
13
|
+
"integration",
|
|
14
|
+
"cli"
|
|
15
|
+
],
|
|
9
16
|
"platform": {
|
|
10
17
|
"server": true,
|
|
11
18
|
"client": true
|
|
@@ -13,19 +20,40 @@
|
|
|
13
20
|
"dependencies": [
|
|
14
21
|
{
|
|
15
22
|
"id": "system.core",
|
|
16
|
-
"range": "0.
|
|
23
|
+
"range": "^0.7.0"
|
|
17
24
|
},
|
|
18
25
|
{
|
|
19
26
|
"id": "auth.core",
|
|
20
|
-
"range": "0.
|
|
27
|
+
"range": "^0.13.0"
|
|
21
28
|
},
|
|
22
29
|
{
|
|
23
30
|
"id": "agents.core",
|
|
24
|
-
"range": "0.
|
|
31
|
+
"range": "^0.12.0"
|
|
32
|
+
}
|
|
33
|
+
],
|
|
34
|
+
"provides": ["workflows.execution.v1"],
|
|
35
|
+
"requires": [
|
|
36
|
+
{
|
|
37
|
+
"id": "agents.run-execution.v2"
|
|
38
|
+
},
|
|
39
|
+
{
|
|
40
|
+
"id": "agents.actions.v1"
|
|
41
|
+
},
|
|
42
|
+
{
|
|
43
|
+
"id": "notifications.publish.v1",
|
|
44
|
+
"optional": true
|
|
45
|
+
},
|
|
46
|
+
{
|
|
47
|
+
"id": "approvals.requests.v1",
|
|
48
|
+
"optional": true
|
|
25
49
|
}
|
|
26
50
|
],
|
|
27
51
|
"tenancy": "required",
|
|
28
52
|
"locales": ["en", "pl"],
|
|
29
53
|
"stability": "experimental",
|
|
30
|
-
"
|
|
54
|
+
"cli": {
|
|
55
|
+
"catalog": "src/cli/commands.json",
|
|
56
|
+
"entry": "src/cli/index.ts"
|
|
57
|
+
},
|
|
58
|
+
"platformApi": "^0.1.0"
|
|
31
59
|
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@flowdular/module-workflows",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.6.7",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"exports": {
|
|
6
6
|
".": "./src/index.ts",
|
|
@@ -14,6 +14,7 @@
|
|
|
14
14
|
"test": "vitest run"
|
|
15
15
|
},
|
|
16
16
|
"dependencies": {
|
|
17
|
+
"@flowdular/cli-protocol": "workspace:*",
|
|
17
18
|
"@flowdular/client": "workspace:*",
|
|
18
19
|
"@flowdular/contracts": "workspace:*",
|
|
19
20
|
"@flowdular/database": "workspace:*",
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
schemaVersion: 1
|
|
2
2
|
id: workflows.core
|
|
3
|
-
specVersion: 0.
|
|
3
|
+
specVersion: 0.6.7
|
|
4
4
|
status: approved
|
|
5
5
|
name: Agentic Workflows
|
|
6
6
|
description: Builds, publishes, simulates, and executes durable tenant-scoped DAG workflows whose versioned nodes coordinate pinned agents, deterministic decisions, validated data, and registered module actions.
|
|
@@ -11,13 +11,14 @@ capabilities:
|
|
|
11
11
|
- client
|
|
12
12
|
- translations
|
|
13
13
|
- integration
|
|
14
|
+
- cli
|
|
14
15
|
dependencies:
|
|
15
16
|
- id: system.core
|
|
16
|
-
range: 0.
|
|
17
|
+
range: ^0.7.0
|
|
17
18
|
- id: auth.core
|
|
18
|
-
range: 0.
|
|
19
|
+
range: ^0.13.0
|
|
19
20
|
- id: agents.core
|
|
20
|
-
range: 0.
|
|
21
|
+
range: ^0.12.0
|
|
21
22
|
tenancy: required
|
|
22
23
|
locales:
|
|
23
24
|
- en
|
|
@@ -31,12 +32,13 @@ invariants:
|
|
|
31
32
|
- A workflow definition grants no authority. Live execution intersects the immutable node plan with the initiating actor's trusted permission snapshot and every referenced agent or action permission.
|
|
32
33
|
- Manual and module-originated runs retain the real user or agent actor. Schedule and webhook runs retain a service actor with the configuring user snapshot, while trigger kind and identifier remain separate execution-origin fields.
|
|
33
34
|
- Graph configuration contains declarative typed literal, path, and template mappings only. Arbitrary JavaScript, expressions with side effects, source code, shell commands, dynamic imports, and runtime-downloaded code are forbidden.
|
|
34
|
-
- Input, output, agent-decision, gate, validator, action, merge, and terminal output nodes communicate only through declared, schema-bound ports and immutable JSON envelopes.
|
|
35
|
+
- Input, output, agent-decision, gate, validator, action, human-approval, merge, and terminal output nodes communicate only through declared, schema-bound ports and immutable JSON envelopes.
|
|
35
36
|
- An agent-decision node must return a schema-valid pass or fail decision with bounded structured data. Free-form text never decides a branch.
|
|
36
37
|
- Deterministic gate nodes use a versioned allowlisted logic language. Agentic judgment is represented by an explicit agent-decision node, never hidden inside a gate.
|
|
37
38
|
- A validator node emits pass only for data that satisfies its pinned schema and emits bounded structured validation errors on fail.
|
|
39
|
+
- A human-approval node declares its requirement in the published graph and is validated against the workspace roles at publish time; an unknown role or an absent approvals.core refuses publication with a stable code. At run time the node opens one request through approvals.requests.v1 keyed by the run and node, takes the run out of the claim queue until the request resolves or its bounded recheck falls due, resumes on approval, and fails the run with a stable code on rejection, expiry or cancellation. Whenever the run stops waiting for a pending request, whether the run is cancelled, the request's deadline passes, or the run's duration bound is reached, the request is withdrawn rather than left asking people to decide something nobody is waiting for. A simulated run approves without asking anybody. The prompt the node asks and its label are bounded at validation and publication by the limits approvals.core accepts for a request title, so a question that module would refuse fails the publish rather than the run that reaches the node.
|
|
38
40
|
- An action node invokes only a registered, versioned action contract through agents.core, under the required permissions, input schema, timeout, output bound, idempotency key, and audit boundary.
|
|
39
|
-
- Version one admits only read and workspace-write actions. External and destructive actions
|
|
41
|
+
- Version one admits only read and workspace-write actions. External and destructive actions stay excluded from the workflow catalog, publication, and execution; the human-approval node gates a person's decision and never widens the action risk class.
|
|
40
42
|
- Each live workflow run durably snapshots its workflow revision, actor, origin, permission digest, mode, input, limits, and idempotency key before enqueue returns.
|
|
41
43
|
- Workflow workers claim runs with expiring leases, renew live claims, and recover queued or expired work after restart without concurrently owning the same run.
|
|
42
44
|
- A node runs at most once successfully. Retries create immutable attempts and reuse a stable side-effect idempotency key so recovery cannot duplicate an agent enqueue or action mutation.
|
|
@@ -54,12 +56,14 @@ invariants:
|
|
|
54
56
|
- Automated payload retention may remove separately stored payload blobs only after appending a retention event. Run identity, status, revisions, attempts, durations, cost, hashes, and audit linkage remain queryable.
|
|
55
57
|
- Capability absence is detected through the platform registry returning null. A caller hides its optional workflow feature or refuses clearly before invocation; no absent module can return its own unavailable result.
|
|
56
58
|
- automations.core remains a separate optional clock and ingress module. It may trigger workflows through an integration capability but workflows.core owns no schedules, webhook secrets, or polling clock.
|
|
57
|
-
- A live run is bounded by graph size, payload size, node attempts, total duration, and lineage depth. Cross-workflow invocation and cycles between workflows are not supported in version one.
|
|
58
|
-
- Interactive history and audit pages
|
|
59
|
+
- A live run is bounded by graph size, payload size, node attempts, total duration, and lineage depth. Cross-workflow invocation and cycles between workflows are not supported in version one. The total duration bound counts the time the run could work; time asleep on a human approval is excluded from it and bounded by that request's own expiry instead, so a person's window is never a run's.
|
|
60
|
+
- Interactive definition, history and audit lists are keyset pages of at most 100 rows over an indexed sort key (definitions by name or last update, runs by queued time, audit by sequence or time), read through opaque signed cursors bound to the tenant, the filters and the sort order. Malformed, foreign, or mismatched cursors are refused instead of being interpreted loosely.
|
|
59
61
|
- Usage and cost use a versioned typed rollup with integer token counts, integer micro-USD amounts, pricing snapshot references, provisional or final state, and explicit unpriced child and action counts. Dry-run has no rollup and simulation uses not-applicable rollups.
|
|
60
62
|
- Every state transition named as audit-required commits its run event, projection update, and hash-chained workflow audit event atomically. Edge data events remain ordered run evidence unless their transition also changes audited execution state.
|
|
61
63
|
- Every request-time read and write runs on a tenant-scoped database handle. The worker claim poll and payload retention are the only cross-tenant reads, they run on a separate read-only role, and on PostgreSQL that role is granted only the columns that route the work under a policy of each table itself.
|
|
64
|
+
- Run outcome notifications are an optional integration. When a live run reaches a terminal state the worker resolves notifications.publish.v1 from the platform capability registry at that moment, never at composition time, and publishes the outcome keyed by the run id. notifications.core is never a declared dependency. An absent capability, a cancelled run, a simulated run, and a run with no person behind it publish nothing. A publisher failure is logged once at warning level and never changes the settled run, and the kind is read from the settled row so a worker that lost the settling race reports the outcome the run actually has.
|
|
62
65
|
- A run found by the cross-tenant claim poll is read again and re-checked under the tenant that row named before it is claimed, and payload retention performs each redaction in its own transaction under the tenant that owns it.
|
|
66
|
+
- workflows.core declares three data classes to the platform registry while it composes, and performs their operations itself on its own leases under its own tenant transaction. workflows.core.runs holds the run record, its node states and attempts, its edge evidence, its ordered events and its sealed execution payloads, keeps them 90 days by default, sweeps only settled runs in bounded batches so a run still working, waiting on a child or asleep on an approval is never taken from its worker, exports one workspace by keyset in bounded pages, and erases in bounded batches the runs one account is the person behind, reporting a full batch as truncated. The person behind a run is the actor when a person started it, the account the actor was configured by when a schedule, a webhook or an automation started it, and the delegated authorization subject when an agent did, and the erasure matches all three so a run started on somebody's behalf is not left holding their account. A run resolves that person once when it is written and stores the answer, so an erasure is one indexed equality rather than a read of the stored actor document, which the forced row-level security policy would leave unindexable. workflows.core.audit-events is exportable and is kept until a person deletes it, because the trail is hash chained and removing its oldest links by age would make the next verification report a break it cannot tell from tampering. workflows.core.definitions is workspace configuration, is kept until a person deletes it and carries no sweep, and exports the published revision of each workflow alone. No export carries a sealed execution payload, because the archive carries the redacted evidence the run already recorded.
|
|
63
67
|
permissions:
|
|
64
68
|
- id: workflows.definitions.read
|
|
65
69
|
description: Read workflow definitions, drafts, published revisions, and validation reports in the active tenant.
|
|
@@ -80,6 +84,7 @@ dataOwnership:
|
|
|
80
84
|
- Business modules own their records and service operations. An action node can reach them only through a registered action contract and never through their repositories or databases.
|
|
81
85
|
- auth.core owns accounts, memberships, sessions, scopes, and authorization evidence. Workflows stores the bounded invocation snapshot needed for durable execution, not credentials or session tokens.
|
|
82
86
|
- automations.core owns schedules, webhook definitions, trigger secrets, and ingress audit. A triggered workflow stores only the service actor, configuring user snapshot, origin kind, and source reference.
|
|
87
|
+
- notifications.core owns inbox items, deliveries, and read state. workflows.core owns the run it reports and hands over only the run id, the outcome kind, a bounded English title and step summary, and the accountable member; it never writes or reads notification records and never receives them back.
|
|
83
88
|
acceptanceScenarios:
|
|
84
89
|
- id: WORKFLOW-CREATE
|
|
85
90
|
given: A principal with workflow definition management permission supplies a valid name and empty draft graph.
|
|
@@ -164,7 +169,7 @@ acceptanceScenarios:
|
|
|
164
169
|
- id: WORKFLOW-HISTORY
|
|
165
170
|
given: The tenant has workflow runs in queued, intermediate, refused, cancelled, failed, and succeeded states.
|
|
166
171
|
when: An authorized reader filters and pages run history.
|
|
167
|
-
then: Results are tenant-scoped, ordered by queued time and run id descending, and paged with an opaque
|
|
172
|
+
then: Results are tenant-scoped, ordered by queued time and run id descending unless the reader asks for the ascending order, and paged at most 100 runs at a time with an opaque cursor bound to tenant, filters and sort, while malformed, foreign, or mismatched cursors are refused and payload absence never changes row positions.
|
|
168
173
|
- id: WORKFLOW-NODE-HISTORY
|
|
169
174
|
given: A run contains retries, branching, skipped nodes, child agents, and actions.
|
|
170
175
|
when: An authorized reader opens the run.
|
|
@@ -221,7 +226,19 @@ acceptanceScenarios:
|
|
|
221
226
|
given: A graph, mapping, input, output, fixture, retry policy, runtime, or lineage exceeds its declared bound.
|
|
222
227
|
when: It is saved, published, simulated, or executed.
|
|
223
228
|
then: The operation fails with a stable limit code before unbounded memory, storage, provider, or action work begins.
|
|
229
|
+
- id: WORKFLOWS-NOTIFY-RUN
|
|
230
|
+
given: A live workflow run started by a member reaches a terminal state, and the optional notifications module may or may not be composed.
|
|
231
|
+
when: The worker commits the terminal status.
|
|
232
|
+
then: With notifications.core composed, exactly one workflow-run-completed or workflow-run-failed notification is published after that commit, keyed by the run id, addressed to the member accountable for the run, and carrying no payload or evidence; without it, for a cancelled or simulated run, or when the publisher fails, the run settles unchanged and nothing is published.
|
|
224
233
|
- id: WF-CLAIM-NARROW
|
|
225
234
|
given: Two workspaces each own a queued live run.
|
|
226
235
|
when: The worker polls for claimable work across tenants.
|
|
227
236
|
then: The poll returns only the workspace id, run id, mode, status, lease expiry and queue time; the graph, actor, permission snapshot and payload ciphertext are unreadable on that connection, it cannot write, and each run is claimed exactly once under its own workspace.
|
|
237
|
+
- id: WORKFLOWS-HUMAN-APPROVAL
|
|
238
|
+
given: A published workflow revision carrying a human-approval node that requires a workspace role, and approvals.core composed.
|
|
239
|
+
when: A run reaches the node, an owner approves it, in a second run an owner rejects it, and in a third run nobody answers until the request's deadline passes.
|
|
240
|
+
then: The first run pauses with one pending request and resumes to completion after the approval; the second run fails with a stable code after the rejection; the third stays paused past the run duration bound and fails with a stable code at the request's deadline, withdrawing the pending request; a revision naming a role the workspace does not define, carrying a prompt or a label longer than a request title, or published while approvals.core is absent, is refused at publish time with a stable validation code; and a request resolved before the worker armed the wait still resumes its run rather than sleeping until the recheck.
|
|
241
|
+
- id: WORKFLOWS-DATA-CLASSES
|
|
242
|
+
given: Two workspaces hold workflow runs of several ages with node states, edge evidence and sealed payloads, one run still working, plus published workflows and a draft, and the platform has sealed the data class registry.
|
|
243
|
+
when: The platform sweeps, exports and erases the declared classes for one of them.
|
|
244
|
+
then: The sweep removes only that workspace's settled runs strictly older than the cutoff and at most the batch it was given, taking their node states, attempts, edges, events and sealed payloads with them while the working run stays; the export streams that workspace's runs with their nodes and edges, its audit trail in chain order, and its published workflows without their drafts, through the sink in keyset pages with the oldest and newest record time, answers no rows and no range for a workspace that holds none, and carries no payload ciphertext; the audit trail carries no sweep and no erasure; and erasing a subject removes the runs that account is the person behind in that workspace alone, including the ones a schedule or an agent started on its behalf, reporting a full batch as truncated.
|
|
@@ -2,8 +2,10 @@ import {
|
|
|
2
2
|
defineEndpoint,
|
|
3
3
|
HttpProblem,
|
|
4
4
|
jsonResponse,
|
|
5
|
+
pageResponse,
|
|
5
6
|
problemResponse,
|
|
6
7
|
readJsonObject,
|
|
8
|
+
readPageQuery,
|
|
7
9
|
requiredInteger,
|
|
8
10
|
requiredString,
|
|
9
11
|
} from '@flowdular/sdk/server';
|
|
@@ -17,10 +19,10 @@ import {
|
|
|
17
19
|
import type {
|
|
18
20
|
JsonValue,
|
|
19
21
|
WorkflowExecutionOrigin,
|
|
20
|
-
WorkflowRunFilters,
|
|
21
22
|
WorkflowRunMode,
|
|
22
23
|
WorkflowRunStatus,
|
|
23
24
|
WorkflowSimulationFixture,
|
|
25
|
+
WorkflowSortDirection,
|
|
24
26
|
} from '../domain/types.ts';
|
|
25
27
|
import { WORKFLOW_LIMITS } from '../domain/types.ts';
|
|
26
28
|
import { WORKFLOWS_PERMISSIONS } from '../acl/permissions.ts';
|
|
@@ -85,6 +87,65 @@ function optionalQuery(
|
|
|
85
87
|
return value;
|
|
86
88
|
}
|
|
87
89
|
|
|
90
|
+
/** The default page of a list screen; the ceiling is the interactive bound. */
|
|
91
|
+
const LIST_PAGE_LIMIT = 50;
|
|
92
|
+
const SEARCH_LIMIT = 120;
|
|
93
|
+
|
|
94
|
+
interface ListOrder<Sort extends string> {
|
|
95
|
+
readonly sort: Sort;
|
|
96
|
+
readonly direction: WorkflowSortDirection;
|
|
97
|
+
}
|
|
98
|
+
|
|
99
|
+
/* `sort` and `direction` are the list's own vocabulary; anything else is the
|
|
100
|
+
caller's mistake rather than a fallback to the default order. */
|
|
101
|
+
function readOrder<Sort extends string>(
|
|
102
|
+
url: URL,
|
|
103
|
+
allowed: readonly Sort[],
|
|
104
|
+
fallback: ListOrder<Sort>,
|
|
105
|
+
): ListOrder<Sort> {
|
|
106
|
+
const sort = url.searchParams.get('sort');
|
|
107
|
+
const direction = url.searchParams.get('direction');
|
|
108
|
+
if (sort !== null && sort !== '' && !allowed.includes(sort as Sort)) {
|
|
109
|
+
throw new HttpProblem(
|
|
110
|
+
'INVALID_INPUT',
|
|
111
|
+
`sort must be one of ${allowed.join(', ')}.`,
|
|
112
|
+
400,
|
|
113
|
+
);
|
|
114
|
+
}
|
|
115
|
+
if (
|
|
116
|
+
direction !== null &&
|
|
117
|
+
direction !== '' &&
|
|
118
|
+
direction !== 'asc' &&
|
|
119
|
+
direction !== 'desc'
|
|
120
|
+
) {
|
|
121
|
+
throw new HttpProblem(
|
|
122
|
+
'INVALID_INPUT',
|
|
123
|
+
'direction must be asc or desc.',
|
|
124
|
+
400,
|
|
125
|
+
);
|
|
126
|
+
}
|
|
127
|
+
return {
|
|
128
|
+
sort: sort ? (sort as Sort) : fallback.sort,
|
|
129
|
+
direction: direction
|
|
130
|
+
? (direction as WorkflowSortDirection)
|
|
131
|
+
: fallback.direction,
|
|
132
|
+
};
|
|
133
|
+
}
|
|
134
|
+
|
|
135
|
+
/** The screen's search box, trimmed; whitespace alone asks for nothing. */
|
|
136
|
+
function searchQuery(url: URL): string | undefined {
|
|
137
|
+
const value = url.searchParams.get('q')?.trim();
|
|
138
|
+
if (!value) return undefined;
|
|
139
|
+
if (value.length > SEARCH_LIMIT) {
|
|
140
|
+
throw new HttpProblem(
|
|
141
|
+
'INVALID_INPUT',
|
|
142
|
+
`q must contain at most ${SEARCH_LIMIT} characters.`,
|
|
143
|
+
400,
|
|
144
|
+
);
|
|
145
|
+
}
|
|
146
|
+
return value;
|
|
147
|
+
}
|
|
148
|
+
|
|
88
149
|
function requiredDescription(value: Record<string, unknown>): string {
|
|
89
150
|
const description = value.description;
|
|
90
151
|
if (typeof description !== 'string' || description.length > 2_000) {
|
|
@@ -274,12 +335,36 @@ export function createWorkflowsRoutes(
|
|
|
274
335
|
methods: ['GET'],
|
|
275
336
|
access: { kind: 'permission', permission: WORKFLOWS_PERMISSIONS.read },
|
|
276
337
|
resolveIdentity: endpointIdentityFromContext,
|
|
277
|
-
handler: async ({ octane }) =>
|
|
278
|
-
|
|
279
|
-
|
|
338
|
+
handler: async ({ octane }) => {
|
|
339
|
+
try {
|
|
340
|
+
const url = new URL(octane.request.url);
|
|
341
|
+
const page = readPageQuery(url, {
|
|
342
|
+
maxLimit: WORKFLOW_LIMITS.maxInteractivePage,
|
|
343
|
+
defaultLimit: LIST_PAGE_LIMIT,
|
|
344
|
+
});
|
|
345
|
+
const status = optionalQuery(url, 'status', ['active', 'archived']);
|
|
346
|
+
const search = searchQuery(url);
|
|
347
|
+
const listed = await (
|
|
280
348
|
await runtime.service()
|
|
281
|
-
).
|
|
282
|
-
|
|
349
|
+
).listDefinitions(principalFromContext(octane)!.tenantId, {
|
|
350
|
+
...readOrder(url, ['name', 'updatedAt'], {
|
|
351
|
+
sort: 'name',
|
|
352
|
+
direction: 'asc',
|
|
353
|
+
}),
|
|
354
|
+
...(status ? { status: status as 'active' | 'archived' } : {}),
|
|
355
|
+
...(search ? { search } : {}),
|
|
356
|
+
limit: page.limit,
|
|
357
|
+
cursor: page.cursor,
|
|
358
|
+
});
|
|
359
|
+
return pageResponse({
|
|
360
|
+
items: listed.definitions,
|
|
361
|
+
limit: page.limit,
|
|
362
|
+
nextCursor: listed.nextCursor,
|
|
363
|
+
});
|
|
364
|
+
} catch (error) {
|
|
365
|
+
return failure(error);
|
|
366
|
+
}
|
|
367
|
+
},
|
|
283
368
|
});
|
|
284
369
|
const create = defineEndpoint({
|
|
285
370
|
id: 'workflows.definitions.create',
|
|
@@ -509,7 +594,10 @@ export function createWorkflowsRoutes(
|
|
|
509
594
|
try {
|
|
510
595
|
const principal = principalFromContext(octane)!;
|
|
511
596
|
const url = new URL(octane.request.url);
|
|
512
|
-
const
|
|
597
|
+
const page = readPageQuery(url, {
|
|
598
|
+
maxLimit: WORKFLOW_LIMITS.maxInteractivePage,
|
|
599
|
+
defaultLimit: LIST_PAGE_LIMIT,
|
|
600
|
+
});
|
|
513
601
|
const workflowId = optionalQuery(url, 'workflowId');
|
|
514
602
|
const mode = optionalQuery(url, 'mode', ['simulate', 'live']);
|
|
515
603
|
const status = optionalQuery(url, 'status', [
|
|
@@ -534,8 +622,14 @@ export function createWorkflowsRoutes(
|
|
|
534
622
|
'schedule',
|
|
535
623
|
'webhook',
|
|
536
624
|
]);
|
|
537
|
-
const
|
|
538
|
-
const
|
|
625
|
+
const search = searchQuery(url);
|
|
626
|
+
const listed = await (
|
|
627
|
+
await runtime.service()
|
|
628
|
+
).listRuns(principal.tenantId, {
|
|
629
|
+
...readOrder(url, ['queuedAt'], {
|
|
630
|
+
sort: 'queuedAt',
|
|
631
|
+
direction: 'desc',
|
|
632
|
+
}),
|
|
539
633
|
...(workflowId ? { workflowId } : {}),
|
|
540
634
|
...(mode ? { mode: mode as WorkflowRunMode } : {}),
|
|
541
635
|
...(status ? { status: status as WorkflowRunStatus } : {}),
|
|
@@ -545,12 +639,15 @@ export function createWorkflowsRoutes(
|
|
|
545
639
|
...(originKind
|
|
546
640
|
? { originKind: originKind as WorkflowExecutionOrigin['kind'] }
|
|
547
641
|
: {}),
|
|
548
|
-
...(
|
|
549
|
-
|
|
550
|
-
|
|
551
|
-
|
|
552
|
-
|
|
553
|
-
|
|
642
|
+
...(search ? { search } : {}),
|
|
643
|
+
limit: page.limit,
|
|
644
|
+
cursor: page.cursor,
|
|
645
|
+
});
|
|
646
|
+
return pageResponse({
|
|
647
|
+
items: listed.runs,
|
|
648
|
+
limit: page.limit,
|
|
649
|
+
nextCursor: listed.nextCursor,
|
|
650
|
+
});
|
|
554
651
|
} catch (error) {
|
|
555
652
|
return failure(error);
|
|
556
653
|
}
|
|
@@ -773,16 +870,25 @@ export function createWorkflowsRoutes(
|
|
|
773
870
|
handler: async ({ octane }) => {
|
|
774
871
|
try {
|
|
775
872
|
const url = new URL(octane.request.url);
|
|
776
|
-
const
|
|
777
|
-
|
|
778
|
-
|
|
779
|
-
|
|
780
|
-
|
|
781
|
-
|
|
782
|
-
|
|
783
|
-
|
|
784
|
-
|
|
785
|
-
|
|
873
|
+
const page = readPageQuery(url, {
|
|
874
|
+
maxLimit: WORKFLOW_LIMITS.maxInteractivePage,
|
|
875
|
+
defaultLimit: LIST_PAGE_LIMIT,
|
|
876
|
+
});
|
|
877
|
+
const listed = await (
|
|
878
|
+
await runtime.service()
|
|
879
|
+
).listAudit(principalFromContext(octane)!.tenantId, {
|
|
880
|
+
...readOrder(url, ['sequence', 'occurredAt'], {
|
|
881
|
+
sort: 'sequence',
|
|
882
|
+
direction: 'desc',
|
|
883
|
+
}),
|
|
884
|
+
limit: page.limit,
|
|
885
|
+
cursor: page.cursor,
|
|
886
|
+
});
|
|
887
|
+
return pageResponse({
|
|
888
|
+
items: listed.events,
|
|
889
|
+
limit: page.limit,
|
|
890
|
+
nextCursor: listed.nextCursor,
|
|
891
|
+
});
|
|
786
892
|
} catch (error) {
|
|
787
893
|
return failure(error);
|
|
788
894
|
}
|