| 41 | import type { SimSubscriptionConfig } from '@/lib/workspace-events/types' |
| 42 | |
| 43 | function makeConfig(overrides: Partial<SimSubscriptionConfig> = {}): SimSubscriptionConfig { |
| 44 | return { |
| 45 | eventType: 'no_activity', |
| 46 | workflowIds: [], |
| 47 | consecutiveFailures: 3, |
| 48 | failureRatePercent: 50, |
| 49 | windowHours: 24, |
| 50 | durationThresholdMs: 30000, |
| 51 | latencySpikePercent: 100, |
| 52 | costThresholdCredits: 200, |
| 53 | errorCountThreshold: 10, |
| 54 | inactivityHours: 24, |
| 55 | ...overrides, |
| 56 | } |
| 57 | } |
| 58 | |
| 59 | /** Flattens nested and/or condition trees from the drizzle operator mocks. */ |
| 60 | function flattenCondition(condition: unknown): unknown[] { |