import { xcxApi } from '../utils/server';

export const getUidScore = async (uids: string[], force?: boolean): Promise<Record<string, string>> => {
  const entries: [string, string][] = [];
  console.debug('getUidScore(%s): start', uids.length);
  for (const uid of uids) {
    const profile = await xcxApi.getAdvProfile(uid, force);
    entries.push([uid, profile?.score ?? '']);
  }
  console.debug('getUidScore(%s): end', uids.length);
  return Object.fromEntries(entries);
}