( truncatedApiKey: string, )
| 1121 | } |
| 1122 | |
| 1123 | export function getCustomApiKeyStatus( |
| 1124 | truncatedApiKey: string, |
| 1125 | ): 'approved' | 'rejected' | 'new' { |
| 1126 | const config = getGlobalConfig() |
| 1127 | if (config.customApiKeyResponses?.approved?.includes(truncatedApiKey)) { |
| 1128 | return 'approved' |
| 1129 | } |
| 1130 | if (config.customApiKeyResponses?.rejected?.includes(truncatedApiKey)) { |
| 1131 | return 'rejected' |
| 1132 | } |
| 1133 | return 'new' |
| 1134 | } |
| 1135 | |
| 1136 | function saveConfig<A extends object>( |
| 1137 | file: string, |
no test coverage detected