- pgSchema "mesh" with 4 tables isolating the peer mesh domain - Enums: visibility, transport, tier, role - audit_log is metadata-only (E2E encryption enforced at broker/client) - Cascade on mesh delete, soft-delete via archivedAt/revokedAt Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
32 lines
741 B
TypeScript
32 lines
741 B
TypeScript
import { logger } from "@turbostarter/shared/logger";
|
|
|
|
import { env } from "./env";
|
|
|
|
import type { EmailProviderStrategy } from "../types";
|
|
|
|
const from = env.EMAIL_FROM;
|
|
|
|
export const { send } = {
|
|
send: async ({ to, subject, html, text }) => {
|
|
const response = await fetch("https://api.resend.com/emails", {
|
|
method: "POST",
|
|
headers: {
|
|
"Content-Type": "application/json",
|
|
Authorization: `Bearer ${env.RESEND_API_KEY}`,
|
|
},
|
|
body: JSON.stringify({
|
|
from,
|
|
to,
|
|
subject,
|
|
html,
|
|
text,
|
|
}),
|
|
});
|
|
|
|
if (!response.ok) {
|
|
logger.error(await response.json());
|
|
throw new Error("Could not send email!");
|
|
}
|
|
},
|
|
} satisfies EmailProviderStrategy;
|