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