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