( truncatedApiKey: string, )
| 1101 | } |
| 1102 | |
| 1103 | export function getCustomApiKeyStatus( |
| 1104 | truncatedApiKey: string, |
| 1105 | ): 'approved' | 'rejected' | 'new' { |
| 1106 | const config = getGlobalConfig() |
| 1107 | if (config.customApiKeyResponses?.approved?.includes(truncatedApiKey)) { |
| 1108 | return 'approved' |
| 1109 | } |
| 1110 | if (config.customApiKeyResponses?.rejected?.includes(truncatedApiKey)) { |
| 1111 | return 'rejected' |
| 1112 | } |
| 1113 | return 'new' |
| 1114 | } |
| 1115 | |
| 1116 | function saveConfig<A extends object>( |
| 1117 | file: string, |
no test coverage detected