(apiKey: string)
| 1088 | ) |
| 1089 | |
| 1090 | function isValidApiKey(apiKey: string): boolean { |
| 1091 | // Only allow alphanumeric characters, dashes, and underscores |
| 1092 | return /^[a-zA-Z0-9-_]+$/.test(apiKey) |
| 1093 | } |
| 1094 | |
| 1095 | export async function saveApiKey(apiKey: string): Promise<void> { |
| 1096 | if (!isValidApiKey(apiKey)) { |