"use strict";
const index = require("./orgDomains-W_rFTMBa.cjs");
const credential = require("./credential-9BNiqYc8.cjs");
function checkAdminOrOwner(role) {
  return role === "OWNER" || role === "ADMIN";
}
async function getUsersCredentialsIncludeServiceAccountKey(user) {
  const credentials = await index.prisma.credential.findMany({
    where: {
      userId: user.id
    },
    select: index.credentialForCalendarServiceSelect,
    orderBy: {
      id: "asc"
    }
  });
  const { credentials: allCredentials } = await credential.enrichUserWithDelegationCredentialsIncludeServiceAccountKey({
    user: {
      email: user.email,
      id: user.id,
      credentials
    }
  });
  return allCredentials;
}
exports.checkAdminOrOwner = checkAdminOrOwner;
exports.getUsersCredentialsIncludeServiceAccountKey = getUsersCredentialsIncludeServiceAccountKey;
