OmniRoute/scripts/scratch/dump-auth-groups.ts
diegosouzapw adf59ddce7 chore(scripts): add scratch maintenance utilities and ai workspace rules
Add one-off database inspection and cleanup scripts under
`scripts/scratch/` for local debugging and maintenance work.

Document root cleanliness and file placement expectations for AI
assistants in `GEMINI.md` to keep temporary scripts and tests out of
the project root.
2026-04-16 16:07:44 -03:00

23 lines
952 B
TypeScript

import {
APIKEY_PROVIDERS,
SEARCH_PROVIDERS,
AUDIO_ONLY_PROVIDERS,
WEB_COOKIE_PROVIDERS,
} from "./src/shared/constants/providers";
console.log("SEARCH_PROVIDERS", !!SEARCH_PROVIDERS, Object.keys(SEARCH_PROVIDERS || {}));
console.log("AUDIO_ONLY", !!AUDIO_ONLY_PROVIDERS);
console.log("WEB_COOKIE", !!WEB_COOKIE_PROVIDERS);
// Determine auth type group for a provider id
function getAuthGroup(providerId: string) {
if (WEB_COOKIE_PROVIDERS && WEB_COOKIE_PROVIDERS[providerId]) return "web-cookie";
if (SEARCH_PROVIDERS && SEARCH_PROVIDERS[providerId]) return "search";
if (AUDIO_ONLY_PROVIDERS && AUDIO_ONLY_PROVIDERS[providerId]) return "audio";
if (APIKEY_PROVIDERS && APIKEY_PROVIDERS[providerId]) return "apikey";
return "apikey";
}
console.log("grok-web returns:", getAuthGroup("grok-web"));
console.log("perplexity-search returns:", getAuthGroup("perplexity-search"));
console.log("openai returns:", getAuthGroup("openai"));