import { getUserCredentialStore } from "./store.js";
const { IS_LOCAL, IS_DEMO } = process.env;
export async function deleteUserCredential(data) {
    // Only local and demo can delete for now
    // until operation authz is implemented https://github.com/opennetwork/logistics/issues/39
    if (!(IS_LOCAL || IS_DEMO)) {
        return;
    }
    const store = await getUserCredentialStore(data.userId);
    await store.delete(data.userCredentialId);
}
export async function deleteUserCredentials(items) {
    // Delete in serial... it's not needing to be fast right now
    for (const data of items) {
        await deleteUserCredential(data);
    }
}
//# sourceMappingURL=delete-user-credential.js.map