import { repositories } from '../database/dataSource.js';
import { peerconnectionIdFromUrl } from './urlFromId.js';
function toUUID(idurl) {
    if ('url' in idurl) {
        return peerconnectionIdFromUrl(idurl.url);
    }
    else {
        return idurl.uuid;
    }
}
export async function getPeerconnection(id) {
    const peerconnection = await repositories.peerconnection.findOneOrFail({
        where: { uuid: toUUID(id) },
    });
    return peerconnection;
}
//# sourceMappingURL=peerconnection.js.map