mirror of
https://github.com/DayuanJiang/next-ai-draw-io.git
synced 2026-10-12 20:49:53 +08:00
Step 3 of the provider refactor plan. envVarsOf(provider) spells the key and base URL variable names from the record's envPrefix and keyEnv; the three copies of the gateway/AI_GATEWAY spelling (getAIModel's default branch, globalBaseUrl, the admin panel's credEnvNames) read it. serverCredentialError answers why the server lacks a provider's credentials, or null; detectProvider asks for null and validateProviderCredentials throws the text, so the Anthropic auth token and the Azure URL-or-resource rules exist once. The four error texts and their order are unchanged (tests/unit/server-credentials.test.ts was written against the old code first). credEnvNames reads fixedCredentials and envPrefix and is exported, with a table test over all 24 providers. Behavior snapshot unchanged.