// The paths Dashboard.tsx and Settings.tsx call through your /api/outlevo route. Add them to the ALLOW list of the // Next.js or Express proxy template (templates/nextjs, templates/express). The proxy adds the key; the browser never // sees it. The Next.js template exports GET and POST only: add `forward as DELETE` for removing a webhook. Show Settings to your admins only: it manages the workspace's webhooks. const ID = '[0-9a-f-]{36}'; export const DASHBOARD_ALLOW: Array<[string, RegExp]> = [ ['GET', /^\/v1\/usage$/], // usage:read ['GET', /^\/v1\/campaigns$/], // campaigns:read ['GET', new RegExp(`^/v1/campaigns/${ID}/stats$`)], ['GET', /^\/v1\/handoffs$/], // handoffs:read ['GET', new RegExp(`^/v1/handoffs/${ID}$`)], ['POST', new RegExp(`^/v1/handoffs/${ID}/(accept|reject)$`)], // handoffs:write, a key with "Acts as me" ['GET', /^\/v1\/revenue-actions$/], // revenue_actions:read ]; export const SETTINGS_ALLOW: Array<[string, RegExp]> = [ // webhooks:manage ['GET', /^\/v1\/webhooks$/], ['POST', /^\/v1\/webhooks$/], ['DELETE', new RegExp(`^/v1/webhooks/${ID}$`)], ['POST', new RegExp(`^/v1/webhooks/${ID}/(test|rotate-secret)$`)], ['GET', new RegExp(`^/v1/webhooks/${ID}/deliveries$`)], ];