mirror of
https://github.com/openclaw/openclaw.git
synced 2026-05-17 04:10:44 +00:00
14 lines
532 B
TypeScript
14 lines
532 B
TypeScript
import { resolveProviderIdForAuth } from "../provider-auth-aliases.js";
|
|
import type { AuthProfileStore } from "./types.js";
|
|
|
|
export function dedupeProfileIds(profileIds: string[]): string[] {
|
|
return [...new Set(profileIds)];
|
|
}
|
|
|
|
export function listProfilesForProvider(store: AuthProfileStore, provider: string): string[] {
|
|
const providerKey = resolveProviderIdForAuth(provider);
|
|
return Object.entries(store.profiles)
|
|
.filter(([, cred]) => resolveProviderIdForAuth(cred.provider) === providerKey)
|
|
.map(([id]) => id);
|
|
}
|