mirror of
https://github.com/melgarafael/DeskcommCRM.git
synced 2026-10-02 01:28:34 +08:00
GET /api/v1/admin/platform-admins: requirePlatformAdmin, service-role list of platform_admins with auth.users emails resolved (granted_by, revoked_by, target user). POST/PATCH/DELETE return 405 explicitly with message pointing to Spec 01 §3.4 T-04 (DBA-only mutation). UI: - /admin/platform-admins: prominent DBAOnlyNotice (blue alert with T-04 reference + runbook link) + PlatformAdminsTable (user, granted_at relative, granted_by, scope, mfa_required, status active/revoked, reason tooltip) - ZERO mutation buttons by design Closes EPIC-11 — Super-Admin Platform fully wired (14/14 waves). Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
100 lines
2.8 KiB
TypeScript
100 lines
2.8 KiB
TypeScript
/**
|
|
* Canonical audit action codes. Append new codes at the end; never rename.
|
|
* Each code maps 1:1 with a row in api_audit_log.action.
|
|
*/
|
|
export type AuditAction =
|
|
| "auth.login_success"
|
|
| "auth.login_failed"
|
|
| "auth.logout"
|
|
| "auth.mfa_enrolled"
|
|
| "auth.mfa_success"
|
|
| "auth.mfa_failed"
|
|
| "auth.recovery_code_used"
|
|
| "nuvemshop.connected"
|
|
| "nuvemshop.disconnected"
|
|
| "nuvemshop.oauth_failed"
|
|
| "nuvemshop.webhook_received"
|
|
| "nuvemshop.webhook_invalid_signature"
|
|
| "lead.created"
|
|
| "lead.updated"
|
|
| "lead.deleted"
|
|
| "lead.moved"
|
|
| "lead.won"
|
|
| "lead.lost"
|
|
| "lead.bulk_action"
|
|
| "contact.created"
|
|
| "contact.updated"
|
|
| "contact.anonymized"
|
|
| "contact.merge_pending"
|
|
| "contact.merged"
|
|
| "lgpd.anonymize_executed"
|
|
| "member.invited"
|
|
| "member.accepted"
|
|
| "member.role_changed"
|
|
| "member.revoked"
|
|
| "token.created"
|
|
| "token.revoked"
|
|
| "profile.updated"
|
|
| "org.updated"
|
|
| "pipeline.config_updated"
|
|
| "mfa.recovery_codes_regenerated"
|
|
| "notification_prefs.changed"
|
|
| "onboarding.welcome_completed"
|
|
| "onboarding.whatsapp_configured"
|
|
| "onboarding.whatsapp_skipped"
|
|
| "onboarding.nuvemshop_skipped"
|
|
| "onboarding.ai_configured"
|
|
| "onboarding.team_invited"
|
|
| "onboarding.completed"
|
|
| "tenant.onboarded"
|
|
| "conversation.created"
|
|
| "conversation.claimed"
|
|
| "conversation.released"
|
|
| "conversation.closed"
|
|
| "message.sent"
|
|
| "message.received"
|
|
| "contact.blocked"
|
|
| "ai.handoff_triggered"
|
|
| "ai.reactivated_by_agent"
|
|
| "conversation.usable_for_rag_toggled"
|
|
| "rag.conversations_batch_run"
|
|
| "lgpd.redact_received"
|
|
| "lgpd.data_request_received"
|
|
| "lgpd.store_redact_received"
|
|
| "lgpd.export_generated"
|
|
| "lgpd.export_delivered"
|
|
| "lgpd.export_failed"
|
|
| "lgpd.redact_executed"
|
|
| "lgpd.redact_skipped_already_anonymized"
|
|
| "lgpd.redact_no_local_footprint"
|
|
| "lgpd.redact_completed"
|
|
| "lgpd.redact_failed"
|
|
| "lgpd.tenant_redacted"
|
|
| "lgpd.consent_changed"
|
|
| "lgpd.manually_approved"
|
|
| "webhook.hmac_invalid"
|
|
| "lgpd.sla_alarm_triggered"
|
|
| "lgpd.sla_watcher_run"
|
|
| "platform_admin.inbox_listed"
|
|
| "platform_admin.conversation_viewed"
|
|
| "platform_admin.tenants_listed"
|
|
| "platform_admin.tenant_viewed"
|
|
| "tenant.created_by_platform_admin"
|
|
| "platform_admin.tenant_health_viewed"
|
|
| "platform_admin.impersonate_started"
|
|
| "platform_admin.impersonate_ended"
|
|
| "platform_admin.impersonate_misconfigured"
|
|
| "tenant.suspended"
|
|
| "tenant.reactivated"
|
|
| "platform_admin.audit_listed"
|
|
| "platform_admin.audit_entry_viewed"
|
|
| "platform_admin.lgpd_listed"
|
|
| "platform_admin.lgpd_request_viewed"
|
|
| "platform_admin.incidents_listed"
|
|
| "platform_admin.incident_viewed"
|
|
| "incident.resolved"
|
|
| "platform_admin.usage_viewed"
|
|
| "platform_admin.users_listed"
|
|
| "platform_admin.user_viewed"
|
|
| "platform_admin.platform_admins_listed";
|