const EMAIL_CONTENT_FIELDS = [
  "messageId",
  "contentHash",
  "toAddress",
  "replyTo",
  "inReplyTo",
  "emailReferences",
  "rawText",
  "rawHtml",
  "cleanedText",
  "threadMessages",
  "detectedLanguage",
  "attachmentIds",
  "isActive",
  "metadata",
  "organizationId",
  "tenantId",
  "createdAt",
  "updatedAt",
  "deletedAt"
];
async function canViewEmailContent(ctx) {
  try {
    const rbac = ctx.container.resolve("rbacService");
    return await rbac.userHasAllFeatures(
      ctx.userId,
      ["inbox_ops.proposals.view"],
      { tenantId: ctx.tenantId, organizationId: ctx.organizationId }
    );
  } catch {
    return false;
  }
}
function serializeInboxEmail(email, includeContent) {
  if (includeContent) return email;
  const redacted = { ...email };
  for (const field of EMAIL_CONTENT_FIELDS) {
    redacted[field] = null;
  }
  return redacted;
}
export {
  canViewEmailContent,
  serializeInboxEmail
};
//# sourceMappingURL=response.js.map
