File size: 1,857 Bytes
6111b2b
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
/**

 * HIGH_LEVEL_ACTIONS β€” allowlist of audit events that appear in the Activity feed.

 *

 * IMPORTANT: This list is intentionally aligned with the REAL action strings emitted

 * by `logAuditEvent()` calls throughout the repository. Do NOT use "clean" or invented

 * names β€” always grep for `logAuditEvent` in the codebase before adding or renaming

 * an entry here. If the upstream emitter name changes, update both the emitter and

 * this list atomically.

 *

 * Last synced: 2026-05 (B/G3 gap-closure). Source of truth: grep logAuditEvent repo.

 */
export const HIGH_LEVEL_ACTIONS = [
  // providers / connections β€” ALINHADO COM `logAuditEvent` real
  "provider.credentials.created",
  "provider.credentials.applied",
  "provider.credentials.updated",
  "provider.credentials.revoked",
  "provider.credentials.batch_revoked",
  "provider.credentials.bulk_created",
  "provider.credentials.bulk_imported",
  "provider.credentials.imported",
  "provider.validation.ssrf_blocked",

  // auth
  "auth.login.success",
  "auth.login.error",
  "auth.login.failed",
  "auth.login.locked",
  "auth.login.misconfigured",
  "auth.login.setup_required",
  "auth.logout.success",

  // sync tokens
  "sync.token.created",
  "sync.token.revoked",

  // settings β€” alinhado (plural)
  "settings.update",
  "settings.update_failed",

  // service operations
  "service.reveal_api_key",

  // quota sharing (B26 β€” adicionados por F8)
  "quota.pool.created",
  "quota.pool.updated",
  "quota.pool.deleted",
  "quota.plan.updated",
  "quota.store.driver_changed",
] as const;

export type HighLevelAction = (typeof HIGH_LEVEL_ACTIONS)[number];

const SET: ReadonlySet<string> = new Set<string>(HIGH_LEVEL_ACTIONS);

export function isHighLevelAction(action: string): boolean {
  return SET.has(action);
}