import { PLAN_LIMITS } from '@cra-compliance/types'; /** Plan comparison for the WordPress plugin. Limits come from PLAN_LIMITS. */ type Cell = boolean | string; const freq = (value: string) => value.charAt(0).toUpperCase() + value.slice(1); /** * How often a plan saves an automatic scan to scan history. Every account's plugins are * checked every night whatever the plan; scan_frequency only sets the saved record. */ export const SAVED_SCAN_EVERY = { daily: 'every day', weekly: 'every week', monthly: 'every month' } as const; /** Every account gets an email for actively exploited findings; email_alerts adds every new one. */ const emails = (on: boolean) => (on ? 'Every new vulnerability' : 'Actively exploited only'); export const PLAN_COLUMNS = [ { key: 'local', name: 'No account', price: 'Free' }, { key: 'free', name: 'Free account', price: 'Free' }, { key: 'basic', name: 'Basic', price: '$19 a month' }, { key: 'pro', name: 'Pro', price: '$45 a month' }, ] as const; export const PLAN_ROWS: { label: string; values: [Cell, Cell, Cell, Cell] }[] = [ { label: 'Checklist, document templates and CRA primer', values: [true, true, true, true] }, { label: 'WordPress plugins monitored', values: [false, String(PLAN_LIMITS.free.max_plugins), String(PLAN_LIMITS.basic.max_plugins), String(PLAN_LIMITS.pro.max_plugins)], }, { label: 'Checked for new vulnerabilities', values: [false, 'Daily', 'Daily', 'Daily'] }, { label: 'Automatic scan saved to scan history', values: [false, freq(PLAN_LIMITS.free.scan_frequency), freq(PLAN_LIMITS.basic.scan_frequency), freq(PLAN_LIMITS.pro.scan_frequency)], }, { label: 'Email alerts', values: [false, emails(PLAN_LIMITS.free.email_alerts), emails(PLAN_LIMITS.basic.email_alerts), emails(PLAN_LIMITS.pro.email_alerts)] }, { label: 'Incident center for Article 14 reports', values: [false, '1 open incident', 'Unlimited', 'Unlimited'] }, { label: 'Evidence export for incidents', values: [false, false, false, true] }, { label: 'Signed webhooks', values: [false, PLAN_LIMITS.free.webhooks, PLAN_LIMITS.basic.webhooks, PLAN_LIMITS.pro.webhooks] }, ];