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