( truncatedApiKey: string, )
| 1175 | } |
| 1176 | |
| 1177 | export function getCustomApiKeyStatus( |
| 1178 | truncatedApiKey: string, |
| 1179 | ): 'approved' | 'rejected' | 'new' { |
| 1180 | const config = getGlobalConfig() |
| 1181 | if (config.customApiKeyResponses?.approved?.includes(truncatedApiKey)) { |
| 1182 | return 'approved' |
| 1183 | } |
| 1184 | if (config.customApiKeyResponses?.rejected?.includes(truncatedApiKey)) { |
| 1185 | return 'rejected' |
| 1186 | } |
| 1187 | return 'new' |
| 1188 | } |
| 1189 | |
| 1190 | function saveConfig<A extends object>( |
| 1191 | file: string, |
no test coverage detected