import { getExternalReferenceKey, getExternalUserReferenceStore, getUserStore } from "./store.js";
import { getExternalReference } from "./get-user.js";
export async function deleteUser(userId) {
    const store = getUserStore();
    await store.delete(userId);
}
export async function deleteExternalUser(data) {
    const { externalId, externalType } = data;
    const reference = await getExternalReference(externalType, externalId);
    if (!reference)
        return;
    await deleteUser(reference.userId);
    await deleteExternalReference(externalType, externalId);
}
export async function deleteExternalReference(externalType, externalId) {
    const store = getExternalUserReferenceStore();
    const key = getExternalReferenceKey(externalType, externalId);
    await store.delete(key);
}
//# sourceMappingURL=delete-user.js.map