import { noop } from "../../util"; import { cognitoFetch } from "../cognito-fetch"; type TGetCredentialsForIdentityParams = { region: string; identityId: string; logins?: Record; debug?: (trace: any) => void; }; export const getCredentialsForIdentity = async ({ region, identityId, logins, debug = noop, }: TGetCredentialsForIdentityParams) => await cognitoFetch({ region, operation: "GetCredentialsForIdentity", args: { IdentityId: identityId, ...(logins) ? { Logins: logins } : {} }, debug, }); // TODO: this needs a guard for the response