Skip to content

Papermark is the open-source DocSend alternative and secure data rooms with built-in analytics and custom domains.

feat: security updates

Marc Seitz7fa52b239448
diff --git a/app/(auth)/auth/confirm-email-change/[token]/page.tsx b/app/(auth)/auth/confirm-email-change/[token]/page.tsx
index aa97d6c3..01aa823c 100644
--- a/app/(auth)/auth/confirm-email-change/[token]/page.tsx
+++ b/app/(auth)/auth/confirm-email-change/[token]/page.tsx
@@ -80,9 +80,12 @@ const VerifyEmailChange = async ({ params: { token } }: PageProps) => {
}
const currentUserId = (session.user as CustomUser).id;
+ const tokenUserId = tokenFound.identifier;
+
+ if (tokenUserId !== currentUserId) return <NotFound />;
const data = await redis.get<{ email: string; newEmail: string }>(
- `email-change-request:user:${currentUserId}`,
+ `email-change-request:user:${tokenUserId}`,
);
if (!data) return <NotFound />;
@@ -91,7 +94,7 @@ const VerifyEmailChange = async ({ params: { token } }: PageProps) => {
await prisma.user.update({
where: {
- id: currentUserId,
+ id: tokenUserId,
},
data: {
email: data.newEmail,
diff --git a/app/api/views-dataroom/route.ts b/app/api/views-dataroom/route.ts
index 8bdfc2d6..4a3b3601 100644
--- a/app/api/views-dataroom/route.ts
+++ b/app/api/views-dataroom/route.ts
@@ -3,7 +3,7 @@ import { NextRequest, NextResponse } from "next/server";
import { reportDeniedAccessAttempt } from "@/ee/features/access-notifications";
import { getTeamStorageConfigById } from "@/ee/features/storage/config";
import { authOptions } from "@/lib/auth/auth-options";
-import { ItemType, LinkAudienceType } from "@prisma/client";
+import { ItemType, LinkAudienceType, LinkType } from "@prisma/client";
import { ipAddress, waitUntil } from "@vercel/functions";
import { getServerSession } from "next-auth";
@@ -119,6 +119,7 @@ export async function POST(request: NextRequest) {
deletedAt: true,
slug: true,
domainId: true,
+ linkType: true,
allowList: true,
denyList: true,
enableAgreement: true,
@@ -848,6 +849,95 @@ export async function POST(request: NextRequest) {
// ** DOCUMENT_VIEW **
try {
+ if (!documentVersionId) {
+ return NextResponse.json(
+ { message: "Document version ID is required." },
+ { status: 400 },
+ );
+ }
+
+ const documentVersionAccess = await prisma.documentVersion.findUnique({
+ where: { id: documentVersionId },
+ select: { documentId: true },
+ });
+
+ if (!documentVersionAccess) {
+ return NextResponse.json(
+ { message: "Document version not found." },
+ { status: 404 },
+ );
+ }
+
+ const effectiveGroupId = link.groupId || link.permissionGroupId;
+ let dataroomDocument: { id: string } | null = null;
+ let dataroomDocumentPermission: {
+ canView: boolean;
+ canDownload: boolean;
+ } | null = null;
+
+ if (link.linkType !== LinkType.DATAROOM_LINK || !link.dataroomId) {
+ return NextResponse.json(
+ { message: "Unauthorized access." },
+ { status: 403 },
+ );
+ }
+
+ dataroomDocument = await prisma.dataroomDocument.findUnique({
+ where: {
+ dataroomId_documentId: {
+ dataroomId: link.dataroomId,
+ documentId: documentVersionAccess.documentId,
+ },
+ },
+ select: { id: true },
+ });
+
+ if (!dataroomDocument) {
+ return NextResponse.json(
+ { message: "Unauthorized access." },
+ { status: 403 },
+ );
+ }
+
+ if (effectiveGroupId) {
+ if (link.groupId) {
+ dataroomDocumentPermission =
+ await prisma.viewerGroupAccessControls.findUnique({
+ where: {
+ groupId_itemId: {
+ groupId: link.groupId,
+ itemId: dataroomDocument.id,
+ },
+ itemType: ItemType.DATAROOM_DOCUMENT,
+ },
+ select: { canView: true, canDownload: true },
+ });
+ } else if (link.permissionGroupId) {
+ dataroomDocumentPermission =
+ await prisma.permissionGroupAccessControls.findUnique({
+ where: {
+ groupId_itemId: {
+ groupId: link.permissionGroupId,
+ itemId: dataroomDocument.id,
+ },
+ itemType: ItemType.DATAROOM_DOCUMENT,
+ },
+ select: { canView: true, canDownload: true },
+ });
+ }
+
+ if (
+ !dataroomDocumentPermission?.canView &&
+ !dataroomDocumentPermission?.canDownload
+ ) {
+ return NextResponse.json(
+ { message: "Unauthorized access." },
+ { status: 403 },
+ );
+ }
+ }
+
+ const resolvedDocumentId = documentVersionAccess.documentId;
let newView: { id: string } | null = null;
let dataroomView: { id: string } | null = null;
if (!isPreview) {
@@ -879,7 +969,7 @@ export async function POST(request: NextRequest) {
newView = await prisma.view.create({
data: {
...viewFields,
- documentId: documentId,
+ documentId: resolvedDocumentId,
dataroomViewId:
dataroomSession?.viewId ?? dataroomView?.id ?? dataroomViewId,
viewType: "DOCUMENT_VIEW",
@@ -894,7 +984,7 @@ export async function POST(request: NextRequest) {
try {
await notifyDocumentView({
teamId: link.teamId!,
- documentId,
+ documentId: resolvedDocumentId,
dataroomId: link.dataroomId!,
linkId,
viewerEmail: verifiedEmail ?? email,
@@ -984,7 +1074,7 @@ export async function POST(request: NextRequest) {
// For link documents, the file is already a URL, no processing needed
if (documentVersion.type === "sheet") {
const document = await prisma.document.findUnique({
- where: { id: documentId },
+ where: { id: resolvedDocumentId },
select: { advancedExcelEnabled: true },
});
useAdvancedExcelViewer = document?.advancedExcelEnabled ?? false;
@@ -1014,59 +1104,15 @@ export async function POST(request: NextRequest) {
// check if viewer can download the document based on group permissions
let canDownload: boolean = link.allowDownload ?? false;
- const effectiveGroupId = link.groupId || link.permissionGroupId;
if (
link.allowDownload &&
(link.audienceType === LinkAudienceType.GROUP ||
link.permissionGroupId) &&
effectiveGroupId &&
- documentId &&
- link.dataroomId
+ dataroomDocument
) {
- const dataroomDocument = await prisma.dataroomDocument.findUnique({
- where: {
- dataroomId_documentId: {
- dataroomId: link.dataroomId,
- documentId: documentId,
- },
- },
- select: { id: true },
- });
- if (!dataroomDocument) {
- canDownload = false;
- } else {
- if (link.groupId) {
- // This is a ViewerGroup (legacy behavior)
- const groupDocumentPermission =
- await prisma.viewerGroupAccessControls.findUnique({
- where: {
- groupId_itemId: {
- groupId: link.groupId,
- itemId: dataroomDocument.id,
- },
- itemType: ItemType.DATAROOM_DOCUMENT,
- },
- select: { canDownload: true },
- });
- canDownload = groupDocumentPermission?.canDownload ?? false;
- } else if (link.permissionGroupId) {
- // This is a PermissionGroup (new behavior)
- const permissionGroupDocumentPermission =
- await prisma.permissionGroupAccessControls.findUnique({
- where: {
- groupId_itemId: {
- groupId: link.permissionGroupId,
- itemId: dataroomDocument.id,
- },
- itemType: ItemType.DATAROOM_DOCUMENT,
- },
- select: { canDownload: true },
- });
- canDownload =
- permissionGroupDocumentPermission?.canDownload ?? false;
- }
- }
+ canDownload = dataroomDocumentPermission?.canDownload ?? false;
}
const isLinkType = documentVersion?.type === "link";
diff --git a/app/api/views/route.ts b/app/api/views/route.ts
index ab5c1aa9..50e6158a 100644
--- a/app/api/views/route.ts
+++ b/app/api/views/route.ts
@@ -8,6 +8,11 @@ import { ipAddress, waitUntil } from "@vercel/functions";
import { getServerSession } from "next-auth";
import { hashToken } from "@/lib/api/auth/token";
+import {
+ collectFingerprintHeaders,
+ generateSessionFingerprint,
+} from "@/lib/auth/dataroom-auth";
+import { createLinkSession } from "@/lib/auth/link-session";
import { verifyPreviewSession } from "@/lib/auth/preview-auth";
import { PreviewSession } from "@/lib/auth/preview-auth";
import { isEmbeddableUrl } from "@/lib/edge-config/embeddable-domains";
@@ -781,7 +786,38 @@ export async function POST(request: NextRequest) {
...(isEmbeddable && { isEmbeddable: true }),
};
- return NextResponse.json(returnObject);
+ const response = NextResponse.json(returnObject);
+
+ if (!isPreview && newView) {
+ const ipAddressValue = ipAddress(request) ?? LOCALHOST_IP;
+ const userAgent = request.headers.get("user-agent") ?? "unknown";
+ const fingerprint = generateSessionFingerprint(
+ collectFingerprintHeaders(request.headers),
+ );
+ const { token: sessionToken, expiresAt } = await createLinkSession(
+ linkId,
+ "DOCUMENT_LINK",
+ newView.id,
+ email ?? "",
+ ipAddressValue,
+ userAgent,
+ isEmailVerified,
+ viewer?.id ?? undefined,
+ documentId,
+ undefined,
+ fingerprint,
+ );
+
+ response.cookies.set(`pm_ls_${linkId}`, sessionToken, {
+ httpOnly: true,
+ secure: process.env.NODE_ENV === "production",
+ sameSite: "lax",
+ expires: new Date(expiresAt),
+ path: "/",
+ });
+ }
+
+ return response;
} catch (error) {
log({
message: `Failed to record view for ${linkId}. \n\n ${error}`,
diff --git a/components/emails/custom-domain-setup.tsx b/components/emails/custom-domain-setup.tsx
index 2fc095bb..8e6260d7 100644
--- a/components/emails/custom-domain-setup.tsx
+++ b/components/emails/custom-domain-setup.tsx
@@ -12,7 +12,7 @@ import {
Section,
Tailwind,
Text,
-} from "@react-email/components";
+} from "react-email";
import { Footer } from "./shared/footer";
diff --git a/components/emails/data-rooms-information.tsx b/components/emails/data-rooms-information.tsx
index 86694a3e..bf37630a 100644
--- a/components/emails/data-rooms-information.tsx
+++ b/components/emails/data-rooms-information.tsx
@@ -10,7 +10,7 @@ import {
Section,
Tailwind,
Text,
-} from "@react-email/components";
+} from "react-email";
import { Footer } from "./shared/footer";
diff --git a/components/emails/dataroom-digest-notification.tsx b/components/emails/dataroom-digest-notification.tsx
index 51338d99..c9725746 100644
--- a/components/emails/dataroom-digest-notification.tsx
+++ b/components/emails/dataroom-digest-notification.tsx
@@ -11,7 +11,7 @@ import {
Section,
Tailwind,
Text,
-} from "@react-email/components";
+} from "react-email";
type DocumentChange = {
documentName: string;
diff --git a/components/emails/dataroom-notification.tsx b/components/emails/dataroom-notification.tsx
index 5bb59f16..e4e76953 100644
--- a/components/emails/dataroom-notification.tsx
+++ b/components/emails/dataroom-notification.tsx
@@ -11,7 +11,7 @@ import {
Section,
Tailwind,
Text,
-} from "@react-email/components";
+} from "react-email";
export default function DataroomNotification({
dataroomName = "Example Data Room",
diff --git a/components/emails/dataroom-trial-24h.tsx b/components/emails/dataroom-trial-24h.tsx
index 8ef408f0..8d304d53 100644
--- a/components/emails/dataroom-trial-24h.tsx
+++ b/components/emails/dataroom-trial-24h.tsx
@@ -12,7 +12,7 @@ import {
Section,
Tailwind,
Text,
-} from "@react-email/components";
+} from "react-email";
import { Footer } from "./shared/footer";
diff --git a/components/emails/dataroom-trial-end.tsx b/components/emails/dataroom-trial-end.tsx
index c7e1f4c5..3c3e756b 100644
--- a/components/emails/dataroom-trial-end.tsx
+++ b/components/emails/dataroom-trial-end.tsx
@@ -12,7 +12,7 @@ import {
Section,
Tailwind,
Text,
-} from "@react-email/components";
+} from "react-email";
import { Footer } from "./shared/footer";
diff --git a/components/emails/dataroom-trial-welcome.tsx b/components/emails/dataroom-trial-welcome.tsx
index 2f098f7a..3464db9d 100644
--- a/components/emails/dataroom-trial-welcome.tsx
+++ b/components/emails/dataroom-trial-welcome.tsx
@@ -1,6 +1,6 @@
import React from "react";
-import { Body, Head, Html, Tailwind, Text } from "@react-email/components";
+import { Body, Head, Html, Tailwind, Text } from "react-email";
interface WelcomeEmailProps {
name: string | null | undefined;
diff --git a/components/emails/dataroom-upload-notification.tsx b/components/emails/dataroom-upload-notification.tsx
index 84327722..84a2f02f 100644
--- a/components/emails/dataroom-upload-notification.tsx
+++ b/components/emails/dataroom-upload-notification.tsx
@@ -10,7 +10,7 @@ import {
Section,
Tailwind,
Text,
-} from "@react-email/components";
+} from "react-email";
import { Footer } from "./shared/footer";
diff --git a/components/emails/deleted-domain.tsx b/components/emails/deleted-domain.tsx
index 83b4b21f..70929b23 100644
--- a/components/emails/deleted-domain.tsx
+++ b/components/emails/deleted-domain.tsx
@@ -11,7 +11,7 @@ import {
Section,
Tailwind,
Text,
-} from "@react-email/components";
+} from "react-email";
import { Footer } from "./shared/footer";
diff --git a/components/emails/download-ready.tsx b/components/emails/download-ready.tsx
index 4fb137eb..aba3c212 100644
--- a/components/emails/download-ready.tsx
+++ b/components/emails/download-ready.tsx
@@ -8,7 +8,7 @@ import {
Section,
Tailwind,
Text,
-} from "@react-email/components";
+} from "react-email";
import { Footer } from "./shared/footer";
diff --git a/components/emails/email-updated.tsx b/components/emails/email-updated.tsx
index 6f45addd..c9813eed 100644
--- a/components/emails/email-updated.tsx
+++ b/components/emails/email-updated.tsx
@@ -9,7 +9,7 @@ import {
Section,
Tailwind,
Text,
-} from "@react-email/components";
+} from "react-email";
import { Footer } from "./shared/footer";
diff --git a/components/emails/export-ready.tsx b/components/emails/export-ready.tsx
index e6871cfc..6d5d7a18 100644
--- a/components/emails/export-ready.tsx
+++ b/components/emails/export-ready.tsx
@@ -9,7 +9,7 @@ import {
Section,
Tailwind,
Text,
-} from "@react-email/components";
+} from "react-email";
import { Footer } from "./shared/footer";
diff --git a/components/emails/hundred-views-congrats.tsx b/components/emails/hundred-views-congrats.tsx
index a056ebf6..e789a815 100644
--- a/components/emails/hundred-views-congrats.tsx
+++ b/components/emails/hundred-views-congrats.tsx
@@ -5,7 +5,7 @@ import {
Link,
Tailwind,
Text,
-} from "@react-email/components";
+} from "react-email";
interface HundredViewsCongratsEmailProps {
name: string | null | undefined;
diff --git a/components/emails/installed-integration-notification.tsx b/components/emails/installed-integration-notification.tsx
index 0fa85626..be1faf26 100644
--- a/components/emails/installed-integration-notification.tsx
+++ b/components/emails/installed-integration-notification.tsx
@@ -11,7 +11,7 @@ import {
Section,
Tailwind,
Text,
-} from "@react-email/components";
+} from "react-email";
import { Footer } from "./shared/footer";
diff --git a/components/emails/invalid-domain.tsx b/components/emails/invalid-domain.tsx
index 515bdc9f..3b39e20a 100644
--- a/components/emails/invalid-domain.tsx
+++ b/components/emails/invalid-domain.tsx
@@ -12,7 +12,7 @@ import {
Section,
Tailwind,
Text,
-} from "@react-email/components";
+} from "react-email";
import { Footer } from "./shared/footer";
diff --git a/components/emails/onboarding-1.tsx b/components/emails/onboarding-1.tsx
index edde6e10..06bcab5f 100644
--- a/components/emails/onboarding-1.tsx
+++ b/components/emails/onboarding-1.tsx
@@ -11,7 +11,7 @@ import {
Section,
Tailwind,
Text,
-} from "@react-email/components";
+} from "react-email";
const Onboarding1Email = () => {
const previewText = `Share documents not attachments`;
diff --git a/components/emails/onboarding-2.tsx b/components/emails/onboarding-2.tsx
index 76aaaa88..2fe9ef6c 100644
--- a/components/emails/onboarding-2.tsx
+++ b/components/emails/onboarding-2.tsx
@@ -11,7 +11,7 @@ import {
Section,
Tailwind,
Text,
-} from "@react-email/components";
+} from "react-email";
const Onboarding2Email = () => {
return (
diff --git a/components/emails/onboarding-3.tsx b/components/emails/onboarding-3.tsx
index 3f255feb..625dafda 100644
--- a/components/emails/onboarding-3.tsx
+++ b/components/emails/onboarding-3.tsx
@@ -11,7 +11,7 @@ import {
Section,
Tailwind,
Text,
-} from "@react-email/components";
+} from "react-email";
const Onboarding3Email = () => {
return (
diff --git a/components/emails/onboarding-4.tsx b/components/emails/onboarding-4.tsx
index 6accdab0..c6574643 100644
--- a/components/emails/onboarding-4.tsx
+++ b/components/emails/onboarding-4.tsx
@@ -11,7 +11,7 @@ import {
Section,
Tailwind,
Text,
-} from "@react-email/components";
+} from "react-email";
const Onboarding4Email = () => {
const previewText = `The document sharing infrastructure for the modern web`;
diff --git a/components/emails/otp-verification.tsx b/components/emails/otp-verification.tsx
index fc75a2f0..685eeb35 100644
--- a/components/emails/otp-verification.tsx
+++ b/components/emails/otp-verification.tsx
@@ -11,7 +11,7 @@ import {
Section,
Tailwind,
Text,
-} from "@react-email/components";
+} from "react-email";
export default function OtpEmailVerification({
email = "[email protected]",
diff --git a/components/emails/shared/footer.tsx b/components/emails/shared/footer.tsx
index 8b4e32de..adaccdc9 100644
--- a/components/emails/shared/footer.tsx
+++ b/components/emails/shared/footer.tsx
@@ -1,6 +1,6 @@
import React from "react";
-import { Hr, Link, Section, Text } from "@react-email/components";
+import { Hr, Link, Section, Text } from "react-email";
export const Footer = ({
withAddress = false,
diff --git a/components/emails/slack-integration.tsx b/components/emails/slack-integration.tsx
index 025e2839..a1a9e372 100644
--- a/components/emails/slack-integration.tsx
+++ b/components/emails/slack-integration.tsx
@@ -11,7 +11,7 @@ import {
Section,
Tailwind,
Text,
-} from "@react-email/components";
+} from "react-email";
interface SlackIntegrationEmailProps {
name: string | null | undefined;
diff --git a/components/emails/team-invitation.tsx b/components/emails/team-invitation.tsx
index 32fb8712..51006048 100644
--- a/components/emails/team-invitation.tsx
+++ b/components/emails/team-invitation.tsx
@@ -11,7 +11,7 @@ import {
Section,
Tailwind,
Text,
-} from "@react-email/components";
+} from "react-email";
import { Footer } from "./shared/footer";
diff --git a/components/emails/thousand-views-congrats.tsx b/components/emails/thousand-views-congrats.tsx
index 27374c86..af826616 100644
--- a/components/emails/thousand-views-congrats.tsx
+++ b/components/emails/thousand-views-congrats.tsx
@@ -8,7 +8,7 @@ import {
Preview,
Tailwind,
Text,
-} from "@react-email/components";
+} from "react-email";
interface ThousandViewsCongratsEmailProps {
name: string | null | undefined;
diff --git a/components/emails/upgrade-one-month-checkin.tsx b/components/emails/upgrade-one-month-checkin.tsx
index d74eda83..599af3a0 100644
--- a/components/emails/upgrade-one-month-checkin.tsx
+++ b/components/emails/upgrade-one-month-checkin.tsx
@@ -7,7 +7,7 @@ import {
Preview,
Tailwind,
Text,
-} from "@react-email/components";
+} from "react-email";
interface UpgradeCheckinEmailProps {
name: string | null | undefined;
diff --git a/components/emails/upgrade-personal-welcome.tsx b/components/emails/upgrade-personal-welcome.tsx
index 72abd0e8..01a23e8e 100644
--- a/components/emails/upgrade-personal-welcome.tsx
+++ b/components/emails/upgrade-personal-welcome.tsx
@@ -7,7 +7,7 @@ import {
Preview,
Tailwind,
Text,
-} from "@react-email/components";
+} from "react-email";
interface UpgradePersonalEmailProps {
name: string | null | undefined;
diff --git a/components/emails/upgrade-plan.tsx b/components/emails/upgrade-plan.tsx
index 0933e3cd..09024151 100644
--- a/components/emails/upgrade-plan.tsx
+++ b/components/emails/upgrade-plan.tsx
@@ -12,7 +12,7 @@ import {
Section,
Tailwind,
Text,
-} from "@react-email/components";
+} from "react-email";
import { Footer } from "./shared/footer";
diff --git a/components/emails/upgrade-six-month-checkin.tsx b/components/emails/upgrade-six-month-checkin.tsx
index 6cc95a3b..2a1098b2 100644
--- a/components/emails/upgrade-six-month-checkin.tsx
+++ b/components/emails/upgrade-six-month-checkin.tsx
@@ -7,7 +7,7 @@ import {
Preview,
Tailwind,
Text,
-} from "@react-email/components";
+} from "react-email";
interface SixMonthMilestoneEmailProps {
name: string | null | undefined;
diff --git a/components/emails/verification-email-change.tsx b/components/emails/verification-email-change.tsx
index 9274f118..f256155c 100644
--- a/components/emails/verification-email-change.tsx
+++ b/components/emails/verification-email-change.tsx
@@ -10,7 +10,7 @@ import {
Section,
Tailwind,
Text,
-} from "@react-email/components";
+} from "react-email";
import { Footer } from "./shared/footer";
diff --git a/components/emails/verification-link.tsx b/components/emails/verification-link.tsx
index 778d755c..ff5d78c7 100644
--- a/components/emails/verification-link.tsx
+++ b/components/emails/verification-link.tsx
@@ -11,7 +11,7 @@ import {
Section,
Tailwind,
Text,
-} from "@react-email/components";
+} from "react-email";
const VerificationCodeEmail = ({
email = "[email protected]",
diff --git a/components/emails/viewed-dataroom-paused.tsx b/components/emails/viewed-dataroom-paused.tsx
index 438f5093..161fcf0e 100644
--- a/components/emails/viewed-dataroom-paused.tsx
+++ b/components/emails/viewed-dataroom-paused.tsx
@@ -11,7 +11,7 @@ import {
Section,
Tailwind,
Text,
-} from "@react-email/components";
+} from "react-email";
import { Footer } from "./shared/footer";
diff --git a/components/emails/viewed-dataroom.tsx b/components/emails/viewed-dataroom.tsx
index 658afac3..601b97ad 100644
--- a/components/emails/viewed-dataroom.tsx
+++ b/components/emails/viewed-dataroom.tsx
@@ -10,7 +10,7 @@ import {
Section,
Tailwind,
Text,
-} from "@react-email/components";
+} from "react-email";
import { Footer } from "./shared/footer";
diff --git a/components/emails/viewed-document-paused.tsx b/components/emails/viewed-document-paused.tsx
index 1ff86a25..35b0cfac 100644
--- a/components/emails/viewed-document-paused.tsx
+++ b/components/emails/viewed-document-paused.tsx
@@ -11,7 +11,7 @@ import {
Section,
Tailwind,
Text,
-} from "@react-email/components";
+} from "react-email";
import { Footer } from "./shared/footer";
diff --git a/components/emails/viewed-document.tsx b/components/emails/viewed-document.tsx
index 349a1120..54a0a377 100644
--- a/components/emails/viewed-document.tsx
+++ b/components/emails/viewed-document.tsx
@@ -10,7 +10,7 @@ import {
Section,
Tailwind,
Text,
-} from "@react-email/components";
+} from "react-email";
import { Footer } from "./shared/footer";
diff --git a/components/emails/welcome.tsx b/components/emails/welcome.tsx
index cb216b86..099999c9 100644
--- a/components/emails/welcome.tsx
+++ b/components/emails/welcome.tsx
@@ -12,7 +12,7 @@ import {
Section,
Tailwind,
Text,
-} from "@react-email/components";
+} from "react-email";
import { Footer } from "./shared/footer";
diff --git a/components/emails/year-in-review-papermark.tsx b/components/emails/year-in-review-papermark.tsx
index 01c37b00..bc520f12 100644
--- a/components/emails/year-in-review-papermark.tsx
+++ b/components/emails/year-in-review-papermark.tsx
@@ -14,7 +14,7 @@ import {
Section,
Tailwind,
Text,
-} from "@react-email/components";
+} from "react-email";
import { UploadIcon } from "lucide-react";
interface PapermarkYearInReviewEmailProps {
diff --git a/components/ui/resizable.tsx b/components/ui/resizable.tsx
index 765b840d..c69f004d 100644
--- a/components/ui/resizable.tsx
+++ b/components/ui/resizable.tsx
@@ -8,12 +8,9 @@ import { cn } from "@/lib/utils";
const ResizablePanelGroup = ({
className,
...props
-}: React.ComponentProps<typeof ResizablePrimitive.PanelGroup>) => (
- <ResizablePrimitive.PanelGroup
- className={cn(
- "flex h-full w-full data-[panel-group-direction=vertical]:flex-col",
- className,
- )}
+}: React.ComponentProps<typeof ResizablePrimitive.Group>) => (
+ <ResizablePrimitive.Group
+ className={cn("flex h-full w-full", className)}
{...props}
/>
);
@@ -24,12 +21,12 @@ const ResizableHandle = ({
withHandle,
className,
...props
-}: React.ComponentProps<typeof ResizablePrimitive.PanelResizeHandle> & {
+}: React.ComponentProps<typeof ResizablePrimitive.Separator> & {
withHandle?: boolean;
}) => (
- <ResizablePrimitive.PanelResizeHandle
+ <ResizablePrimitive.Separator
className={cn(
- "relative flex w-px items-center justify-center bg-border after:absolute after:inset-y-0 after:left-1/2 after:w-1 after:-translate-x-1/2 focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring focus-visible:ring-offset-1 data-[panel-group-direction=vertical]:h-px data-[panel-group-direction=vertical]:w-full data-[panel-group-direction=vertical]:after:left-0 data-[panel-group-direction=vertical]:after:h-1 data-[panel-group-direction=vertical]:after:w-full data-[panel-group-direction=vertical]:after:-translate-y-1/2 data-[panel-group-direction=vertical]:after:translate-x-0 [&[data-panel-group-direction=vertical]>div]:rotate-90",
+ "relative flex w-px items-center justify-center bg-border after:absolute after:inset-y-0 after:left-1/2 after:w-1 after:-translate-x-1/2 focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring focus-visible:ring-offset-1 aria-[orientation=vertical]:h-px aria-[orientation=vertical]:w-full aria-[orientation=vertical]:after:left-0 aria-[orientation=vertical]:after:h-1 aria-[orientation=vertical]:after:w-full aria-[orientation=vertical]:after:-translate-y-1/2 aria-[orientation=vertical]:after:translate-x-0 [&[aria-orientation=vertical]>div]:rotate-90",
className,
)}
{...props}
@@ -39,7 +36,7 @@ const ResizableHandle = ({
<GripVertical className="h-2.5 w-2.5" />
</div>
)}
- </ResizablePrimitive.PanelResizeHandle>
+ </ResizablePrimitive.Separator>
);
export { ResizablePanelGroup, ResizablePanel, ResizableHandle };
diff --git a/components/view/viewer/pages-horizontal-viewer.tsx b/components/view/viewer/pages-horizontal-viewer.tsx
index 4e3dbea8..d06695f2 100644
--- a/components/view/viewer/pages-horizontal-viewer.tsx
+++ b/components/view/viewer/pages-horizontal-viewer.tsx
@@ -580,9 +580,9 @@ export default function PagesHorizontalViewer({
style={{ height: "calc(100dvh - 64px)" }}
className="relative overflow-hidden"
>
- <ResizablePanelGroup direction="horizontal">
+ <ResizablePanelGroup orientation="horizontal">
{/* Document Content */}
- <ResizablePanel defaultSize={100}>
+ <ResizablePanel defaultSize="100%">
<div className="flex h-full w-full items-center">
<div
className={cn(
diff --git a/components/view/viewer/pages-vertical-viewer.tsx b/components/view/viewer/pages-vertical-viewer.tsx
index 40e3f3db..6a204c1b 100644
--- a/components/view/viewer/pages-vertical-viewer.tsx
+++ b/components/view/viewer/pages-vertical-viewer.tsx
@@ -788,9 +788,9 @@ export default function PagesVerticalViewer({
style={{ height: "calc(100dvh - 64px)" }}
className="relative overflow-hidden"
>
- <ResizablePanelGroup direction="horizontal">
+ <ResizablePanelGroup orientation="horizontal">
{/* Document Content */}
- <ResizablePanel defaultSize={100}>
+ <ResizablePanel defaultSize="100%">
<div
className={cn(
"h-full w-full",
diff --git a/lib/auth/link-session.ts b/lib/auth/link-session.ts
index 55c6e8b7..07cdbe18 100644
--- a/lib/auth/link-session.ts
+++ b/lib/auth/link-session.ts
@@ -1,7 +1,9 @@
// lib/auth/link-session.ts
+import { NextApiRequest } from "next";
import { cookies } from "next/headers";
import { NextRequest } from "next/server";
+import { parse } from "cookie";
import crypto from "crypto";
import { z } from "zod";
@@ -34,6 +36,16 @@ export const LinkSessionSchema = z.object({
export type LinkSession = z.infer<typeof LinkSessionSchema>;
+function getFingerprintFromPagesRequest(req: NextApiRequest): string {
+ const header = (name: string) => {
+ const v = req.headers[name];
+ return (Array.isArray(v) ? v[0] : v) ?? null;
+ };
+ return generateSessionFingerprint(
+ collectFingerprintHeaders({ get: header }),
+ );
+}
+
export async function createLinkSession(
linkId: string,
linkType: "DOCUMENT_LINK" | "DATAROOM_LINK",
@@ -88,12 +100,12 @@ export async function createLinkSession(
return { token: sessionToken, expiresAt };
}
-export async function verifyLinkSession(
- request: NextRequest,
+async function verifyLinkSessionToken(
+ sessionToken: string | undefined,
linkId: string,
+ fingerprint: string,
+ userAgent: string,
): Promise<LinkSession | null> {
- const sessionToken = cookies().get(`pm_ls_${linkId}`)?.value;
-
if (!sessionToken) return null;
const session = await redis.get(`link_session:${sessionToken}`);
@@ -113,19 +125,13 @@ export async function verifyLinkSession(
// + client hints); legacy sessions without a fingerprint fall back to a
// plain User-Agent comparison.
if (sessionData.fingerprint) {
- const currentFingerprint = generateSessionFingerprint(
- collectFingerprintHeaders(request.headers),
- );
- if (currentFingerprint !== sessionData.fingerprint) {
- await deleteLinkSession(sessionToken, sessionData.viewerId);
- return null;
- }
- } else {
- const currentUserAgent = request.headers.get("user-agent") ?? "unknown";
- if (currentUserAgent !== sessionData.userAgent) {
+ if (fingerprint !== sessionData.fingerprint) {
await deleteLinkSession(sessionToken, sessionData.viewerId);
return null;
}
+ } else if (userAgent !== sessionData.userAgent) {
+ await deleteLinkSession(sessionToken, sessionData.viewerId);
+ return null;
}
// Check link ID matches
@@ -169,6 +175,33 @@ export async function verifyLinkSession(
}
}
+export async function verifyLinkSession(
+ request: NextRequest,
+ linkId: string,
+): Promise<LinkSession | null> {
+ const sessionToken = cookies().get(`pm_ls_${linkId}`)?.value;
+ const fingerprint = generateSessionFingerprint(
+ collectFingerprintHeaders(request.headers),
+ );
+ const userAgent = request.headers.get("user-agent") ?? "unknown";
+
+ return verifyLinkSessionToken(sessionToken, linkId, fingerprint, userAgent);
+}
+
+export async function verifyLinkSessionInPagesRouter(
+ req: NextApiRequest,
+ linkId: string,
+): Promise<LinkSession | null> {
+ const sessionToken = parse(req.headers.cookie || "")[`pm_ls_${linkId}`];
+ const fingerprint = getFingerprintFromPagesRequest(req);
+ const userAgent =
+ (Array.isArray(req.headers["user-agent"])
+ ? req.headers["user-agent"][0]
+ : req.headers["user-agent"]) ?? "unknown";
+
+ return verifyLinkSessionToken(sessionToken, linkId, fingerprint, userAgent);
+}
+
async function deleteLinkSession(
sessionToken: string,
viewerId?: string,
diff --git a/lib/documents/get-file-helper.ts b/lib/documents/get-file-helper.ts
index fb6f0fc8..6ec0a883 100644
--- a/lib/documents/get-file-helper.ts
+++ b/lib/documents/get-file-helper.ts
@@ -1,17 +1,32 @@
import { getFile } from "@/lib/files/get-file";
import prisma from "@/lib/prisma";
-export const getFileForDocumentPage = async (
- pageNumber: number,
- documentId: string,
- versionNumber?: number,
-): Promise<string> => {
- const documentVersions = await prisma.documentVersion.findMany({
+type GetFileForDocumentPageParams = {
+ pageNumber: number;
+ documentId: string;
+ userId: string;
+ versionNumber?: number;
+};
+
+export const getFileForDocumentPage = async ({
+ pageNumber,
+ documentId,
+ userId,
+ versionNumber,
+}: GetFileForDocumentPageParams): Promise<string> => {
+ const documentVersion = await prisma.documentVersion.findFirst({
where: {
- documentId: documentId,
- ...(versionNumber
- ? { versionNumber: versionNumber }
- : { isPrimary: true }),
+ documentId,
+ document: {
+ team: {
+ users: {
+ some: {
+ userId,
+ },
+ },
+ },
+ },
+ ...(versionNumber !== undefined ? { versionNumber } : { isPrimary: true }),
},
select: {
id: true,
@@ -19,17 +34,14 @@ export const getFileForDocumentPage = async (
orderBy: {
versionNumber: "desc",
},
- take: 1,
});
- if (documentVersions.length === 0) {
+ if (!documentVersion) {
throw new Error(
- `Latest document version from document id ${documentId} with document id ${documentId} not found`,
+ `Document version from document id ${documentId} not found`,
);
}
- const documentVersion = documentVersions[0];
-
const documentPage = await prisma.documentPage.findUnique({
where: {
pageNumber_versionId: {
diff --git a/lib/middleware/app.ts b/lib/middleware/app.ts
index cf74ba15..e1473a0e 100644
--- a/lib/middleware/app.ts
+++ b/lib/middleware/app.ts
@@ -5,7 +5,11 @@ import { getToken } from "next-auth/jwt";
const LOGIN_PATH = "/login";
const DEFAULT_AUTH_REDIRECT_PATH = "/dashboard";
-function normalizeNextPath(nextPath: string | null): string {
+function isProtocolRelativePath(path: string) {
+ return path[1] === "/" || path[1] === "\\";
+}
+
+function normalizeNextPath(nextPath: string | null, requestUrl: string): string {
if (!nextPath) {
return DEFAULT_AUTH_REDIRECT_PATH;
}
@@ -25,11 +29,22 @@ function normalizeNextPath(nextPath: string | null): string {
}
}
- if (!normalized.startsWith("/")) {
+ if (!normalized.startsWith("/") || isProtocolRelativePath(normalized)) {
return DEFAULT_AUTH_REDIRECT_PATH;
}
- return normalized;
+ try {
+ const targetUrl = new URL(normalized, requestUrl);
+ const requestOrigin = new URL(requestUrl).origin;
+
+ if (targetUrl.origin !== requestOrigin) {
+ return DEFAULT_AUTH_REDIRECT_PATH;
+ }
+
+ return `${targetUrl.pathname}${targetUrl.search}${targetUrl.hash}`;
+ } catch {
+ return DEFAULT_AUTH_REDIRECT_PATH;
+ }
}
export default async function AppMiddleware(req: NextRequest) {
@@ -63,7 +78,7 @@ export default async function AppMiddleware(req: NextRequest) {
const rawNextPath = url.searchParams.get("next");
if (rawNextPath) {
- const normalizedNextPath = normalizeNextPath(rawNextPath);
+ const normalizedNextPath = normalizeNextPath(rawNextPath, req.url);
const canonicalLoginUrl = new URL(LOGIN_PATH, req.url);
canonicalLoginUrl.searchParams.set("next", normalizedNextPath);
@@ -93,7 +108,7 @@ export default async function AppMiddleware(req: NextRequest) {
// AUTHENTICATED if the path is /login, redirect to the next path
if (token?.email && path === LOGIN_PATH) {
- const nextPath = normalizeNextPath(url.searchParams.get("next"));
+ const nextPath = normalizeNextPath(url.searchParams.get("next"), req.url);
return NextResponse.redirect(new URL(nextPath, req.url));
}
diff --git a/lib/resend.ts b/lib/resend.ts
index e3926bd9..acf10342 100644
--- a/lib/resend.ts
+++ b/lib/resend.ts
@@ -1,6 +1,6 @@
import { JSXElementConstructor, ReactElement } from "react";
-import { render, toPlainText } from "@react-email/render";
+import { render, toPlainText } from "react-email";
import { Resend } from "resend";
import prisma from "@/lib/prisma";
diff --git a/lib/swr/use-billing.ts b/lib/swr/use-billing.ts
index 27ffd133..419151ba 100644
--- a/lib/swr/use-billing.ts
+++ b/lib/swr/use-billing.ts
@@ -7,35 +7,6 @@ import useSWR from "swr";
import { fetcher } from "@/lib/utils";
-interface BillingProps {
- id: string;
- plan: string;
- startsAt: Date | null;
- endsAt: Date | null;
- subscriptionId: string | null;
- _count: {
- documents: number;
- };
-}
-
-export function useBilling() {
- const teamInfo = useTeam();
-
- const { data, error } = useSWR<BillingProps>(
- teamInfo?.currentTeam && `/api/teams/${teamInfo.currentTeam.id}/billing`,
- fetcher,
- {
- dedupingInterval: 30000,
- },
- );
-
- return {
- ...data,
- error,
- loading: !data && !error,
- };
-}
-
export type BasePlan =
| "free"
| "starter"
diff --git a/lib/utils/ssrf-protection.ts b/lib/utils/ssrf-protection.ts
new file mode 100644
index 00000000..5f64c137
--- /dev/null
+++ b/lib/utils/ssrf-protection.ts
@@ -0,0 +1,501 @@
+import { lookup } from "node:dns/promises";
+import type { IncomingHttpHeaders, IncomingMessage } from "node:http";
+import { request as httpsRequest } from "node:https";
+import { isIP } from "node:net";
+
+const DEFAULT_MAX_REDIRECTS = 5;
+const DEFAULT_CONNECT_TIMEOUT_MS = 30_000;
+const DEFAULT_READ_TIMEOUT_MS = 60_000;
+
+type ResolvedPublicAddress = {
+ address: string;
+ family: 4 | 6;
+ hostname: string;
+ hostnameIsIp: boolean;
+};
+
+type RemoteHttpResponse = {
+ status: number;
+ headers: IncomingHttpHeaders;
+ body: IncomingMessage;
+ clearReadTimer: () => void;
+ refreshReadTimer: () => void;
+};
+
+export class ConnectionTimeoutError extends Error {
+ readonly code = "CONNECT_TIMEOUT" as const;
+ constructor(message = "Connection to URL timed out.") {
+ super(message);
+ this.name = "ConnectionTimeoutError";
+ }
+}
+
+export class ReadTimeoutError extends Error {
+ readonly code = "READ_TIMEOUT" as const;
+ constructor(message = "Reading response body from URL timed out.") {
+ super(message);
+ this.name = "ReadTimeoutError";
+ }
+}
+
+export type PublicHttpsDownload = {
+ buffer: Buffer;
+ contentType: string;
+ finalUrl: URL;
+ headers: IncomingHttpHeaders;
+};
+
+export function normalizeHostnameForSSRF(hostname: string): string {
+ const normalized = hostname.trim().toLowerCase();
+ const withoutBrackets =
+ normalized.startsWith("[") && normalized.endsWith("]")
+ ? normalized.slice(1, -1)
+ : normalized;
+
+ return withoutBrackets.endsWith(".")
+ ? withoutBrackets.slice(0, -1)
+ : withoutBrackets;
+}
+
+function parseIpv4Bytes(address: string): number[] | null {
+ if (isIP(address) !== 4) return null;
+
+ const octets = address.split(".").map((part) => Number(part));
+ if (
+ octets.length !== 4 ||
+ octets.some((octet) => !Number.isInteger(octet) || octet < 0 || octet > 255)
+ ) {
+ return null;
+ }
+
+ return octets;
+}
+
+function parseIpv6Bytes(address: string): number[] | null {
+ const normalized = normalizeHostnameForSSRF(address);
+ if (isIP(normalized) !== 6) return null;
+
+ let expanded = normalized;
+ const ipv4Tail = normalized.match(/(?:^|:)(\d{1,3}(?:\.\d{1,3}){3})$/);
+ if (ipv4Tail) {
+ const ipv4Bytes = parseIpv4Bytes(ipv4Tail[1]);
+ if (!ipv4Bytes) return null;
+
+ const firstGroup = (ipv4Bytes[0] << 8) + ipv4Bytes[1];
+ const secondGroup = (ipv4Bytes[2] << 8) + ipv4Bytes[3];
+ expanded = `${normalized.slice(0, -ipv4Tail[1].length)}${firstGroup.toString(16)}:${secondGroup.toString(16)}`;
+ }
+
+ const halves = expanded.split("::");
+ if (halves.length > 2) return null;
+
+ const left = halves[0] ? halves[0].split(":").filter(Boolean) : [];
+ const right = halves[1] ? halves[1].split(":").filter(Boolean) : [];
+ const missingGroups = 8 - left.length - right.length;
+ if (
+ (halves.length === 1 && missingGroups !== 0) ||
+ (halves.length === 2 && missingGroups < 1)
+ ) {
+ return null;
+ }
+
+ const groups = [...left, ...Array(missingGroups).fill("0"), ...right];
+ if (groups.length !== 8) return null;
+
+ const bytes: number[] = [];
+ for (const group of groups) {
+ if (!/^[0-9a-f]{1,4}$/i.test(group)) return null;
+ const value = Number.parseInt(group, 16);
+ bytes.push((value >> 8) & 0xff, value & 0xff);
+ }
+
+ return bytes;
+}
+
+function isReservedIpv4Bytes(bytes: number[]): boolean {
+ const [first, second, third] = bytes;
+
+ return (
+ first === 0 ||
+ first === 10 ||
+ first === 127 ||
+ (first === 100 && second >= 64 && second <= 127) ||
+ (first === 169 && second === 254) ||
+ (first === 172 && second >= 16 && second <= 31) ||
+ (first === 192 && second === 0 && third === 0) ||
+ (first === 192 && second === 0 && third === 2) ||
+ (first === 192 && second === 88 && third === 99) ||
+ (first === 192 && second === 168) ||
+ (first === 198 && (second === 18 || second === 19)) ||
+ (first === 198 && second === 51 && third === 100) ||
+ (first === 203 && second === 0 && third === 113) ||
+ first >= 224
+ );
+}
+
+function hasIpv6Prefix(
+ bytes: number[],
+ prefixBytes: number[],
+ prefixBits: number,
+): boolean {
+ for (let bit = 0; bit < prefixBits; bit++) {
+ const byteIndex = Math.floor(bit / 8);
+ const mask = 1 << (7 - (bit % 8));
+ if ((bytes[byteIndex] & mask) !== ((prefixBytes[byteIndex] ?? 0) & mask)) {
+ return false;
+ }
+ }
+
+ return true;
+}
+
+function getIpv4MappedBytes(ipv6Bytes: number[]): number[] | null {
+ const isMapped =
+ ipv6Bytes.slice(0, 10).every((byte) => byte === 0) &&
+ ipv6Bytes[10] === 0xff &&
+ ipv6Bytes[11] === 0xff;
+
+ return isMapped ? ipv6Bytes.slice(12, 16) : null;
+}
+
+function isPrivateOrReservedIpAddress(address: string): boolean {
+ const normalized = normalizeHostnameForSSRF(address);
+
+ const ipv4Bytes = parseIpv4Bytes(normalized);
+ if (ipv4Bytes) {
+ return isReservedIpv4Bytes(ipv4Bytes);
+ }
+
+ const ipv6Bytes = parseIpv6Bytes(normalized);
+ if (!ipv6Bytes) return false;
+
+ const mappedIpv4Bytes = getIpv4MappedBytes(ipv6Bytes);
+ if (mappedIpv4Bytes) {
+ return true;
+ }
+
+ const nat64MappedIpv4Bytes = hasIpv6Prefix(ipv6Bytes, [0x64, 0xff, 0x9b], 96)
+ ? ipv6Bytes.slice(12, 16)
+ : null;
+ if (nat64MappedIpv4Bytes) {
+ return isReservedIpv4Bytes(nat64MappedIpv4Bytes);
+ }
+
+ return (
+ ipv6Bytes.every((byte) => byte === 0) ||
+ (ipv6Bytes.slice(0, 15).every((byte) => byte === 0) &&
+ ipv6Bytes[15] === 1) ||
+ // Deprecated IPv4-compatible IPv6 form (::/96).
+ hasIpv6Prefix(ipv6Bytes, [], 96) ||
+ hasIpv6Prefix(ipv6Bytes, [0x01, 0x00], 64) ||
+ hasIpv6Prefix(ipv6Bytes, [0x20, 0x01, 0x00, 0x02, 0x00, 0x00], 48) ||
+ hasIpv6Prefix(ipv6Bytes, [0x20, 0x01, 0x0d, 0xb8], 32) ||
+ hasIpv6Prefix(ipv6Bytes, [0x3f, 0xff], 20) ||
+ (ipv6Bytes[0] & 0xfe) === 0xfc ||
+ (ipv6Bytes[0] === 0xfe && (ipv6Bytes[1] & 0xc0) === 0x80) ||
+ ipv6Bytes[0] === 0xff
+ );
+}
+
+export function isPublicHostnameLiteral(hostname: string): boolean {
+ const normalizedHostname = normalizeHostnameForSSRF(hostname);
+
+ if (
+ !normalizedHostname ||
+ normalizedHostname === "localhost" ||
+ normalizedHostname.endsWith(".localhost") ||
+ normalizedHostname.endsWith(".local")
+ ) {
+ return false;
+ }
+
+ return !isPrivateOrReservedIpAddress(normalizedHostname);
+}
+
+async function resolvePublicHostname(
+ hostname: string,
+): Promise<ResolvedPublicAddress> {
+ const normalizedHostname = normalizeHostnameForSSRF(hostname);
+
+ if (!isPublicHostnameLiteral(normalizedHostname)) {
+ throw new Error("URL must point to a public host.");
+ }
+
+ const hostnameIpVersion = isIP(normalizedHostname);
+ if (hostnameIpVersion) {
+ return {
+ address: normalizedHostname,
+ family: hostnameIpVersion as 4 | 6,
+ hostname: normalizedHostname,
+ hostnameIsIp: true,
+ };
+ }
+
+ let addresses: Array<{ address: string; family: number }>;
+ try {
+ addresses = await lookup(normalizedHostname, { all: true, verbatim: true });
+ } catch {
+ throw new Error("URL hostname could not be resolved.");
+ }
+
+ if (addresses.length === 0) {
+ throw new Error("URL hostname could not be resolved.");
+ }
+
+ if (addresses.some((entry) => isPrivateOrReservedIpAddress(entry.address))) {
+ throw new Error("URL must not resolve to a private or local IP address.");
+ }
+
+ const selected = addresses[0];
+ return {
+ address: selected.address,
+ family: selected.family as 4 | 6,
+ hostname: normalizedHostname,
+ hostnameIsIp: false,
+ };
+}
+
+function getHeaderValue(headers: IncomingHttpHeaders, name: string): string {
+ const value = headers[name.toLowerCase()];
+ if (Array.isArray(value)) return value[0] ?? "";
+ return value ?? "";
+}
+
+async function requestResolvedHttpsUrl(
+ url: URL,
+ resolvedAddress: ResolvedPublicAddress,
+ {
+ connectTimeoutMs = DEFAULT_CONNECT_TIMEOUT_MS,
+ readTimeoutMs = DEFAULT_READ_TIMEOUT_MS,
+ }: { connectTimeoutMs?: number; readTimeoutMs?: number } = {},
+): Promise<RemoteHttpResponse> {
+ return new Promise((resolve, reject) => {
+ let settled = false;
+
+ const request = httpsRequest(
+ {
+ protocol: "https:",
+ host: resolvedAddress.address,
+ family: resolvedAddress.family,
+ port: url.port ? Number(url.port) : 443,
+ path: `${url.pathname}${url.search}`,
+ method: "GET",
+ headers: {
+ Host: url.host,
+ },
+ servername: resolvedAddress.hostnameIsIp
+ ? undefined
+ : resolvedAddress.hostname,
+ },
+ (response) => {
+ if (settled) {
+ response.destroy();
+ return;
+ }
+ settled = true;
+ // Disable the socket-level connect timeout now that headers are in.
+ request.setTimeout(0);
+
+ let readTimer: NodeJS.Timeout | null = null;
+
+ const clearReadTimer = () => {
+ if (readTimer) {
+ clearTimeout(readTimer);
+ readTimer = null;
+ }
+ };
+
+ // Restart the inactivity deadline so an active transfer is not
+ // mistakenly treated as a stalled one. Safe to call after clear.
+ const refreshReadTimer = () => {
+ if (readTimer) {
+ clearTimeout(readTimer);
+ }
+ readTimer = setTimeout(() => {
+ readTimer = null;
+ response.destroy(new ReadTimeoutError());
+ }, readTimeoutMs);
+ };
+
+ refreshReadTimer();
+
+ // Safety net: clear the timer if the stream ends, closes, or errors
+ // without going through readResponseBuffer (e.g. discarded redirects).
+ response.once("close", clearReadTimer);
+ response.once("error", clearReadTimer);
+
+ resolve({
+ status: response.statusCode ?? 0,
+ headers: response.headers,
+ body: response,
+ clearReadTimer,
+ refreshReadTimer,
+ });
+ },
+ );
+
+ request.setTimeout(connectTimeoutMs);
+ request.once("timeout", () => {
+ if (settled) return;
+ settled = true;
+ const error = new ConnectionTimeoutError();
+ request.destroy(error);
+ reject(error);
+ });
+
+ request.once("error", (error) => {
+ if (settled) return;
+ settled = true;
+ reject(error);
+ });
+
+ request.end();
+ });
+}
+
+async function readResponseBuffer(
+ response: IncomingMessage,
+ maxBytes: number,
+ clearReadTimer: () => void,
+ refreshReadTimer: () => void,
+): Promise<Buffer> {
+ const chunks: Buffer[] = [];
+ let total = 0;
+
+ return new Promise((resolve, reject) => {
+ let settled = false;
+
+ const fail = (error: Error) => {
+ if (settled) return;
+ settled = true;
+ clearReadTimer();
+ response.destroy();
+ reject(error);
+ };
+
+ response.on("data", (chunk: Buffer | string) => {
+ refreshReadTimer();
+ const buffer = Buffer.isBuffer(chunk) ? chunk : Buffer.from(chunk);
+ total += buffer.byteLength;
+ if (total > maxBytes) {
+ fail(new Error("URL response exceeds the maximum allowed size."));
+ return;
+ }
+
+ chunks.push(buffer);
+ });
+
+ response.on("end", () => {
+ if (settled) return;
+ settled = true;
+ clearReadTimer();
+ resolve(Buffer.concat(chunks, total));
+ });
+
+ response.on("error", (error) => {
+ fail(error);
+ });
+ });
+}
+
+function discardResponseBody(response: IncomingMessage): void {
+ if (!response.destroyed) {
+ response.resume();
+ }
+}
+
+/**
+ * Fetches an HTTPS URL while protecting against SSRF.
+ *
+ * @param url - Absolute HTTPS URL to download.
+ * @param options.maxBytes - Maximum response size in bytes. Must be a finite
+ * positive integer; `NaN`, `Infinity`, `0`, or negative values are rejected
+ * so they cannot bypass the size checks performed against Content-Length and
+ * the streamed body.
+ */
+export async function fetchPublicHttpsUrlToBuffer(
+ url: string,
+ {
+ maxBytes,
+ maxRedirects = DEFAULT_MAX_REDIRECTS,
+ connectTimeoutMs,
+ readTimeoutMs,
+ }: {
+ maxBytes: number;
+ maxRedirects?: number;
+ connectTimeoutMs?: number;
+ readTimeoutMs?: number;
+ },
+): Promise<PublicHttpsDownload> {
+ if (!Number.isInteger(maxBytes) || maxBytes <= 0) {
+ throw new RangeError("maxBytes must be a finite positive integer.");
+ }
+
+ let current = new URL(url);
+
+ for (let redirects = 0; redirects <= maxRedirects; redirects++) {
+ if (current.protocol !== "https:") {
+ throw new Error("URL must use HTTPS.");
+ }
+
+ if (current.username || current.password) {
+ throw new Error("URL must not contain embedded credentials.");
+ }
+
+ if (!isPublicHostnameLiteral(current.hostname)) {
+ throw new Error("URL must point to a public host.");
+ }
+
+ const resolvedAddress = await resolvePublicHostname(current.hostname);
+ const response = await requestResolvedHttpsUrl(current, resolvedAddress, {
+ connectTimeoutMs,
+ readTimeoutMs,
+ });
+
+ if ([301, 302, 303, 307, 308].includes(response.status)) {
+ const location = getHeaderValue(response.headers, "location");
+ response.clearReadTimer();
+ discardResponseBody(response.body);
+ if (!location) {
+ throw new Error("Redirect response was missing a Location header.");
+ }
+
+ current = new URL(location, current);
+ continue;
+ }
+
+ if (response.status < 200 || response.status >= 300) {
+ response.clearReadTimer();
+ discardResponseBody(response.body);
+ throw new Error(`URL could not be downloaded (HTTP ${response.status}).`);
+ }
+
+ const contentLengthHeader = getHeaderValue(
+ response.headers,
+ "content-length",
+ );
+ const contentLength = contentLengthHeader
+ ? Number(contentLengthHeader)
+ : NaN;
+ if (Number.isFinite(contentLength) && contentLength > maxBytes) {
+ response.clearReadTimer();
+ response.body.destroy();
+ throw new Error("URL response exceeds the maximum allowed size.");
+ }
+
+ const buffer = await readResponseBuffer(
+ response.body,
+ maxBytes,
+ response.clearReadTimer,
+ response.refreshReadTimer,
+ );
+ return {
+ buffer,
+ contentType: getHeaderValue(response.headers, "content-type"),
+ finalUrl: current,
+ headers: response.headers,
+ };
+ }
+
+ throw new Error("URL followed too many redirects.");
+}
diff --git a/lib/year-in-review/send-emails.ts b/lib/year-in-review/send-emails.ts
index aad335ab..825d668c 100644
--- a/lib/year-in-review/send-emails.ts
+++ b/lib/year-in-review/send-emails.ts
@@ -1,4 +1,4 @@
-import { render } from "@react-email/components";
+import { render, toPlainText } from "react-email";
import { nanoid } from "nanoid";
import prisma from "@/lib/prisma";
@@ -141,7 +141,8 @@ export async function processEmailQueue() {
unsubscribeUrl,
});
- const plainText = await render(react, { plainText: true });
+ const html = await render(react);
+ const plainText = toPlainText(html);
return {
email: {
diff --git a/lib/zod/url-validation.ts b/lib/zod/url-validation.ts
index 8886a7a6..c7a53688 100644
--- a/lib/zod/url-validation.ts
+++ b/lib/zod/url-validation.ts
@@ -9,8 +9,9 @@ import {
getNotionPageIdFromSlug,
isCustomNotionDomain,
} from "@/lib/notion/utils";
-import { sanitizePlainText } from "@/lib/utils/sanitize-html";
+import { isPublicHostnameLiteral } from "@/lib/utils/ssrf-protection";
import { getSupportedContentType } from "@/lib/utils/get-content-type";
+import { sanitizePlainText } from "@/lib/utils/sanitize-html";
/**
* Validates basic security aspects of paths and URLs
@@ -42,33 +43,13 @@ export const validatePathSecurity = (pathOrUrl: string): boolean => {
export const validateUrlSSRFProtection = (url: string): boolean => {
try {
const urlObj = new URL(url);
- const hostname = urlObj.hostname;
-
- // Block localhost/loopback
- if (
- hostname === "localhost" ||
- hostname === "127.0.0.1" ||
- hostname === "::1"
- ) {
- return false;
- }
-
- // Block private IP ranges (simplified check)
- if (hostname.match(/^10\.|^172\.(1[6-9]|2[0-9]|3[01])\.|^192\.168\./)) {
- return false;
- }
-
- // Block link-local addresses
- if (hostname.match(/^169\.254\./)) {
- return false;
- }
-
- // Block IPv6 link-local addresses (fe80::/10)
- if (hostname.toLowerCase().startsWith("fe80:")) {
+ if (urlObj.username || urlObj.password) {
return false;
}
- return true;
+ // Synchronous validation only catches literal hosts. Network fetchers must
+ // resolve DNS and re-check redirect targets before connecting.
+ return isPublicHostnameLiteral(urlObj.hostname);
} catch {
return false;
}
diff --git a/package-lock.json b/package-lock.json
index 2336e5d3..e57a16bf 100644
--- a/package-lock.json
+++ b/package-lock.json
@@ -9,9 +9,9 @@
"version": "0.1.0",
"hasInstallScript": true,
"dependencies": {
- "@ai-sdk/google-vertex": "^4.0.124",
+ "@ai-sdk/google-vertex": "^4.0.125",
"@ai-sdk/openai": "^3.0.63",
- "@ai-sdk/react": "^3.0.178",
+ "@ai-sdk/react": "^3.0.179",
"@aws-sdk/client-lambda": "^3.1045.0",
"@aws-sdk/client-s3": "^3.1045.0",
"@aws-sdk/cloudfront-signer": "^3.1036.0",
@@ -55,8 +55,6 @@
"@radix-ui/react-toggle-group": "^1.1.11",
"@radix-ui/react-tooltip": "^1.2.8",
"@radix-ui/react-use-controllable-state": "^1.2.2",
- "@react-email/components": "^1.0.11",
- "@react-email/render": "^2.0.8",
"@sindresorhus/slugify": "^3.0.0",
"@stripe/stripe-js": "^4.10.0",
"@tailwindcss/typography": "^0.5.19",
@@ -80,8 +78,8 @@
"@upstash/redis": "^1.38.0",
"@vercel/blob": "^2.3.3",
"@vercel/edge-config": "^1.4.3",
- "@vercel/functions": "^3.5.0",
- "ai": "^6.0.176",
+ "@vercel/functions": "^3.5.1",
+ "ai": "^6.0.177",
"archiver": "^7.0.1",
"autoprefixer": "^10.4.27",
"base-x": "^5.0.1",
@@ -121,22 +119,22 @@
"postcss": "^8.5.14",
"posthog-js": "^1.372.10",
"react": "^18.3.1",
- "react-colorful": "^5.6.1",
+ "react-colorful": "^5.7.0",
"react-day-picker": "^8.10.2",
"react-dom": "^18.3.1",
"react-draggable": "^4.5.0",
- "react-dropzone": "^14.4.1",
- "react-email": "^5.2.10",
+ "react-dropzone": "^15.0.0",
+ "react-email": "^6.1.1",
"react-hook-form": "^7.75.0",
"react-hotkeys-hook": "^5.3.2",
- "react-intersection-observer": "^9.16.0",
+ "react-intersection-observer": "^10.0.3",
"react-markdown": "^10.1.0",
"react-notion-x": "^7.10.0",
"react-pdf": "^8.0.2",
"react-phone-number-input": "^3.4.16",
- "react-resizable-panels": "^3.0.6",
+ "react-resizable-panels": "^4.11.0",
"react-textarea-autosize": "^8.5.9",
- "react-zoom-pan-pinch": "^3.7.0",
+ "react-zoom-pan-pinch": "^4.0.3",
"resend": "^6.12.3",
"sanitize-html": "^2.17.3",
"shiki": "^3.23.0",
@@ -161,7 +159,7 @@
"zod": "^3.25.76"
},
"devDependencies": {
- "@react-email/preview-server": "^5.2.10",
+ "@react-email/ui": "^6.1.1",
"@tailwindcss/forms": "^0.5.11",
"@trigger.dev/build": "4.4.5",
"@trivago/prettier-plugin-sort-imports": "^6.0.2",
@@ -172,7 +170,7 @@
"@types/jsonwebtoken": "^9.0.7",
"@types/mime-types": "^3.0.1",
"@types/ms": "^2.1.0",
- "@types/node": "^22.13.5",
+ "@types/node": "^24.12.3",
"@types/oidc-provider": "^9.5.0",
"@types/react": "^18",
"@types/react-dom": "^18",
@@ -207,9 +205,9 @@
}
},
"node_modules/@ai-sdk/gateway": {
- "version": "3.0.111",
- "resolved": "https://registry.npmjs.org/@ai-sdk/gateway/-/gateway-3.0.111.tgz",
- "integrity": "sha512-gzdRuEH9Mqeuu8zG6j4of3EH3fFJUI0UIubyeaA8gep6KzhCJF7uaTfagSE7x2vLAf381g/NrxsXhhH7Hon9iA==",
+ "version": "3.0.112",
+ "resolved": "https://registry.npmjs.org/@ai-sdk/gateway/-/gateway-3.0.112.tgz",
+ "integrity": "sha512-jiBao9pR4owWyjo0BnuNc7WSQBGOD0thysE4AFgZXaG+zMFbISQXUkJr7ePw/phBvePy7jE5FSA2Lf7lwqUiiQ==",
"license": "Apache-2.0",
"dependencies": {
"@ai-sdk/provider": "3.0.10",
@@ -233,9 +231,9 @@
}
},
"node_modules/@ai-sdk/google": {
- "version": "3.0.70",
- "resolved": "https://registry.npmjs.org/@ai-sdk/google/-/google-3.0.70.tgz",
- "integrity": "sha512-ZM77Ri/hWCf7hTt8KmdwI8CU92RSy58MCK3kr6sj+okuU7g8RZfm6JNeiyYdMxKkUhrOOC8WmbnLMfQaSO/QoQ==",
+ "version": "3.0.71",
+ "resolved": "https://registry.npmjs.org/@ai-sdk/google/-/google-3.0.71.tgz",
+ "integrity": "sha512-G86UtqkCKM8mQcvsA4FQ1WCRN+w1gl/sxuoYl5CJX5DFSUSkrLNKmLcvi3TtnMvKth5li8W/1h3emQSl2K+qnA==",
"license": "Apache-2.0",
"dependencies": {
"@ai-sdk/provider": "3.0.10",
@@ -249,13 +247,13 @@
}
},
"node_modules/@ai-sdk/google-vertex": {
- "version": "4.0.124",
- "resolved": "https://registry.npmjs.org/@ai-sdk/google-vertex/-/google-vertex-4.0.124.tgz",
- "integrity": "sha512-2Lncw416rIngCwHjQLzpdyWMq+eUyee1weLEEeVRGJOzBSQV26prAtZP70billre7l+Bxv69Qq9hHOorect+dw==",
+ "version": "4.0.125",
+ "resolved": "https://registry.npmjs.org/@ai-sdk/google-vertex/-/google-vertex-4.0.125.tgz",
+ "integrity": "sha512-pExcT1yUWzg5SWtWRYjf7GfgZW1xC2ryzSSo8Wll6Ui5aJYRNCLDwOgBAAw4imrvsLiJ20CpjmpAoiKeRuIdAw==",
"license": "Apache-2.0",
"dependencies": {
"@ai-sdk/anthropic": "3.0.76",
- "@ai-sdk/google": "3.0.70",
+ "@ai-sdk/google": "3.0.71",
"@ai-sdk/openai-compatible": "2.0.47",
"@ai-sdk/provider": "3.0.10",
"@ai-sdk/provider-utils": "4.0.27",
@@ -330,13 +328,13 @@
}
},
"node_modules/@ai-sdk/react": {
- "version": "3.0.178",
- "resolved": "https://registry.npmjs.org/@ai-sdk/react/-/react-3.0.178.tgz",
- "integrity": "sha512-fLkT2fD8Bgi8nsp16PKL6UOiAIwZiwCfv+jXRhOikx0nIh3AdtaGUqJ1yqig7BXg5F9oxHmiaD7YpLC2fN/arQ==",
+ "version": "3.0.179",
+ "resolved": "https://registry.npmjs.org/@ai-sdk/react/-/react-3.0.179.tgz",
+ "integrity": "sha512-wq3gqDrwi6QvwHQuVrTpjeUQI/LHZ5ysokWTIS1hOFw0UIIX8eVpri5iVvqQuq5CeQw/6bYXSI15SfMtZJixpQ==",
"license": "Apache-2.0",
"dependencies": {
"@ai-sdk/provider-utils": "4.0.27",
- "ai": "6.0.176",
+ "ai": "6.0.177",
"swr": "^2.2.5",
"throttleit": "2.1.0"
},
@@ -4603,6 +4601,8 @@
},
"node_modules/@img/colour": {
"version": "1.1.0",
+ "resolved": "https://registry.npmjs.org/@img/colour/-/colour-1.1.0.tgz",
+ "integrity": "sha512-Td76q7j57o/tLVdgS746cYARfSyxk8iEfRxewL9h4OMzYhbW4TAcppl0mT4eyqXddh6L/jwoM75mo7ixa/pCeQ==",
"dev": true,
"license": "MIT",
"optional": true,
@@ -4612,6 +4612,8 @@
},
"node_modules/@img/sharp-darwin-arm64": {
"version": "0.34.5",
+ "resolved": "https://registry.npmjs.org/@img/sharp-darwin-arm64/-/sharp-darwin-arm64-0.34.5.tgz",
+ "integrity": "sha512-imtQ3WMJXbMY4fxb/Ndp6HBTNVtWCUI0WdobyheGf5+ad6xX8VIDO8u2xE4qc/fr08CKG/7dDseFtn6M6g/r3w==",
"cpu": [
"arm64"
],
@@ -4656,6 +4658,8 @@
},
"node_modules/@img/sharp-libvips-darwin-arm64": {
"version": "1.2.4",
+ "resolved": "https://registry.npmjs.org/@img/sharp-libvips-darwin-arm64/-/sharp-libvips-darwin-arm64-1.2.4.tgz",
+ "integrity": "sha512-zqjjo7RatFfFoP0MkQ51jfuFZBnVE2pRiaydKJ1G/rHZvnsrHAOcQALIi9sA5co5xenQdTugCvtb1cuf78Vf4g==",
"cpu": [
"arm64"
],
@@ -8097,93 +8101,10 @@
"react-dom": "^16.8.0 || ^17.0.0-rc.1 || ^18.0.0 || ^19.0.0-rc.1"
}
},
- "node_modules/@react-email/body": {
- "version": "0.3.0",
- "license": "MIT",
- "engines": {
- "node": ">=20.0.0"
- },
- "peerDependencies": {
- "react": "^18.0 || ^19.0 || ^19.0.0-rc"
- }
- },
- "node_modules/@react-email/button": {
- "version": "0.2.1",
- "license": "MIT",
- "engines": {
- "node": ">=20.0.0"
- },
- "peerDependencies": {
- "react": "^18.0 || ^19.0 || ^19.0.0-rc"
- }
- },
- "node_modules/@react-email/code-block": {
- "version": "0.2.1",
- "license": "MIT",
- "dependencies": {
- "prismjs": "^1.30.0"
- },
- "engines": {
- "node": ">=20.0.0"
- },
- "peerDependencies": {
- "react": "^18.0 || ^19.0 || ^19.0.0-rc"
- }
- },
- "node_modules/@react-email/code-inline": {
- "version": "0.0.6",
- "license": "MIT",
- "engines": {
- "node": ">=20.0.0"
- },
- "peerDependencies": {
- "react": "^18.0 || ^19.0 || ^19.0.0-rc"
- }
- },
- "node_modules/@react-email/column": {
- "version": "0.0.14",
- "license": "MIT",
- "engines": {
- "node": ">=20.0.0"
- },
- "peerDependencies": {
- "react": "^18.0 || ^19.0 || ^19.0.0-rc"
- }
- },
- "node_modules/@react-email/components": {
- "version": "1.0.12",
- "license": "MIT",
- "dependencies": {
- "@react-email/body": "0.3.0",
- "@react-email/button": "0.2.1",
- "@react-email/code-block": "0.2.1",
- "@react-email/code-inline": "0.0.6",
- "@react-email/column": "0.0.14",
- "@react-email/container": "0.0.16",
- "@react-email/font": "0.0.10",
- "@react-email/head": "0.0.13",
- "@react-email/heading": "0.0.16",
- "@react-email/hr": "0.0.12",
- "@react-email/html": "0.0.12",
- "@react-email/img": "0.0.12",
- "@react-email/link": "0.0.13",
- "@react-email/markdown": "0.0.18",
- "@react-email/preview": "0.0.14",
- "@react-email/render": "2.0.6",
- "@react-email/row": "0.0.13",
- "@react-email/section": "0.0.17",
- "@react-email/tailwind": "2.0.7",
- "@react-email/text": "0.1.6"
- },
- "engines": {
- "node": ">=20.0.0"
- },
- "peerDependencies": {
- "react": "^18.0 || ^19.0 || ^19.0.0-rc"
- }
- },
- "node_modules/@react-email/components/node_modules/@react-email/render": {
- "version": "2.0.6",
+ "node_modules/@react-email/render": {
+ "version": "2.0.8",
+ "resolved": "https://registry.npmjs.org/@react-email/render/-/render-2.0.8.tgz",
+ "integrity": "sha512-5udvVr3U/WuGJZfLdLBOhkzrqRWd2Q5ZYmF7ppcy7FzWcwgshdqLMNqJOXcVzAXJXg/2bm7D+WGJzTtZOZMQnQ==",
"license": "MIT",
"dependencies": {
"html-to-text": "^9.0.5",
@@ -8197,125 +8118,174 @@
"react-dom": "^18.0 || ^19.0 || ^19.0.0-rc"
}
},
- "node_modules/@react-email/container": {
- "version": "0.0.16",
- "license": "MIT",
- "engines": {
- "node": ">=20.0.0"
- },
- "peerDependencies": {
- "react": "^18.0 || ^19.0 || ^19.0.0-rc"
- }
- },
- "node_modules/@react-email/font": {
- "version": "0.0.10",
+ "node_modules/@react-email/ui": {
+ "version": "6.1.1",
+ "resolved": "https://registry.npmjs.org/@react-email/ui/-/ui-6.1.1.tgz",
+ "integrity": "sha512-lu6LHIl7qd/s2u6hIkRijD/Jo3A0Naf4LCy507Tuh5NM2iki7FHL59DiMQPuMxep3nxtV9TyQmBqQ+iRQt0Iyg==",
+ "dev": true,
"license": "MIT",
- "engines": {
- "node": ">=20.0.0"
- },
- "peerDependencies": {
- "react": "^18.0 || ^19.0 || ^19.0.0-rc"
+ "dependencies": {
+ "esbuild": "0.28.0",
+ "next": "16.2.3"
}
},
- "node_modules/@react-email/head": {
- "version": "0.0.13",
+ "node_modules/@react-email/ui/node_modules/@esbuild/aix-ppc64": {
+ "version": "0.28.0",
+ "resolved": "https://registry.npmjs.org/@esbuild/aix-ppc64/-/aix-ppc64-0.28.0.tgz",
+ "integrity": "sha512-lhRUCeuOyJQURhTxl4WkpFTjIsbDayJHih5kZC1giwE+MhIzAb7mEsQMqMf18rHLsrb5qI1tafG20mLxEWcWlA==",
+ "cpu": [
+ "ppc64"
+ ],
+ "dev": true,
"license": "MIT",
+ "optional": true,
+ "os": [
+ "aix"
+ ],
"engines": {
- "node": ">=20.0.0"
- },
- "peerDependencies": {
- "react": "^18.0 || ^19.0 || ^19.0.0-rc"
+ "node": ">=18"
}
},
- "node_modules/@react-email/heading": {
- "version": "0.0.16",
+ "node_modules/@react-email/ui/node_modules/@esbuild/android-arm": {
+ "version": "0.28.0",
+ "resolved": "https://registry.npmjs.org/@esbuild/android-arm/-/android-arm-0.28.0.tgz",
+ "integrity": "sha512-wqh0ByljabXLKHeWXYLqoJ5jKC4XBaw6Hk08OfMrCRd2nP2ZQ5eleDZC41XHyCNgktBGYMbqnrJKq/K/lzPMSQ==",
+ "cpu": [
+ "arm"
+ ],
+ "dev": true,
"license": "MIT",
+ "optional": true,
+ "os": [
+ "android"
+ ],
"engines": {
- "node": ">=20.0.0"
- },
- "peerDependencies": {
- "react": "^18.0 || ^19.0 || ^19.0.0-rc"
+ "node": ">=18"
}
},
- "node_modules/@react-email/hr": {
- "version": "0.0.12",
+ "node_modules/@react-email/ui/node_modules/@esbuild/android-arm64": {
+ "version": "0.28.0",
+ "resolved": "https://registry.npmjs.org/@esbuild/android-arm64/-/android-arm64-0.28.0.tgz",
+ "integrity": "sha512-+WzIXQOSaGs33tLEgYPYe/yQHf0WTU0X42Jca3y8NWMbUVhp7rUnw+vAsRC/QiDrdD31IszMrZy+qwPOPjd+rw==",
+ "cpu": [
+ "arm64"
+ ],
+ "dev": true,
"license": "MIT",
+ "optional": true,
+ "os": [
+ "android"
+ ],
"engines": {
- "node": ">=20.0.0"
- },
- "peerDependencies": {
- "react": "^18.0 || ^19.0 || ^19.0.0-rc"
+ "node": ">=18"
}
},
- "node_modules/@react-email/html": {
- "version": "0.0.12",
+ "node_modules/@react-email/ui/node_modules/@esbuild/android-x64": {
+ "version": "0.28.0",
+ "resolved": "https://registry.npmjs.org/@esbuild/android-x64/-/android-x64-0.28.0.tgz",
+ "integrity": "sha512-+VJggoaKhk2VNNqVL7f6S189UzShHC/mR9EE8rDdSkdpN0KflSwWY/gWjDrNxxisg8Fp1ZCD9jLMo4m0OUfeUA==",
+ "cpu": [
+ "x64"
+ ],
+ "dev": true,
"license": "MIT",
+ "optional": true,
+ "os": [
+ "android"
+ ],
"engines": {
- "node": ">=20.0.0"
- },
- "peerDependencies": {
- "react": "^18.0 || ^19.0 || ^19.0.0-rc"
+ "node": ">=18"
}
},
- "node_modules/@react-email/img": {
- "version": "0.0.12",
+ "node_modules/@react-email/ui/node_modules/@esbuild/darwin-arm64": {
+ "version": "0.28.0",
+ "resolved": "https://registry.npmjs.org/@esbuild/darwin-arm64/-/darwin-arm64-0.28.0.tgz",
+ "integrity": "sha512-0T+A9WZm+bZ84nZBtk1ckYsOvyA3x7e2Acj1KdVfV4/2tdG4fzUp91YHx+GArWLtwqp77pBXVCPn2We7Letr0Q==",
+ "cpu": [
+ "arm64"
+ ],
+ "dev": true,
"license": "MIT",
+ "optional": true,
+ "os": [
+ "darwin"
+ ],
"engines": {
- "node": ">=20.0.0"
- },
- "peerDependencies": {
- "react": "^18.0 || ^19.0 || ^19.0.0-rc"
+ "node": ">=18"
}
},
- "node_modules/@react-email/link": {
- "version": "0.0.13",
+ "node_modules/@react-email/ui/node_modules/@esbuild/darwin-x64": {
+ "version": "0.28.0",
+ "resolved": "https://registry.npmjs.org/@esbuild/darwin-x64/-/darwin-x64-0.28.0.tgz",
+ "integrity": "sha512-fyzLm/DLDl/84OCfp2f/XQ4flmORsjU7VKt8HLjvIXChJoFFOIL6pLJPH4Yhd1n1gGFF9mPwtlN5Wf82DZs+LQ==",
+ "cpu": [
+ "x64"
+ ],
+ "dev": true,
"license": "MIT",
+ "optional": true,
+ "os": [
+ "darwin"
+ ],
"engines": {
- "node": ">=20.0.0"
- },
- "peerDependencies": {
- "react": "^18.0 || ^19.0 || ^19.0.0-rc"
+ "node": ">=18"
}
},
- "node_modules/@react-email/markdown": {
- "version": "0.0.18",
+ "node_modules/@react-email/ui/node_modules/@esbuild/freebsd-arm64": {
+ "version": "0.28.0",
+ "resolved": "https://registry.npmjs.org/@esbuild/freebsd-arm64/-/freebsd-arm64-0.28.0.tgz",
+ "integrity": "sha512-l9GeW5UZBT9k9brBYI+0WDffcRxgHQD8ShN2Ur4xWq/NFzUKm3k5lsH4PdaRgb2w7mI9u61nr2gI2mLI27Nh3Q==",
+ "cpu": [
+ "arm64"
+ ],
+ "dev": true,
"license": "MIT",
- "dependencies": {
- "marked": "^15.0.12"
- },
+ "optional": true,
+ "os": [
+ "freebsd"
+ ],
"engines": {
- "node": ">=20.0.0"
- },
- "peerDependencies": {
- "react": "^18.0 || ^19.0 || ^19.0.0-rc"
+ "node": ">=18"
}
},
- "node_modules/@react-email/preview": {
- "version": "0.0.14",
+ "node_modules/@react-email/ui/node_modules/@esbuild/freebsd-x64": {
+ "version": "0.28.0",
+ "resolved": "https://registry.npmjs.org/@esbuild/freebsd-x64/-/freebsd-x64-0.28.0.tgz",
+ "integrity": "sha512-BXoQai/A0wPO6Es3yFJ7APCiKGc1tdAEOgeTNy3SsB491S3aHn4S4r3e976eUnPdU+NbdtmBuLncYir2tMU9Nw==",
+ "cpu": [
+ "x64"
+ ],
+ "dev": true,
"license": "MIT",
+ "optional": true,
+ "os": [
+ "freebsd"
+ ],
"engines": {
- "node": ">=20.0.0"
- },
- "peerDependencies": {
- "react": "^18.0 || ^19.0 || ^19.0.0-rc"
+ "node": ">=18"
}
},
- "node_modules/@react-email/preview-server": {
- "version": "5.2.11",
+ "node_modules/@react-email/ui/node_modules/@esbuild/linux-arm": {
+ "version": "0.28.0",
+ "resolved": "https://registry.npmjs.org/@esbuild/linux-arm/-/linux-arm-0.28.0.tgz",
+ "integrity": "sha512-CjaaREJagqJp7iTaNQjjidaNbCKYcd4IDkzbwwxtSvjI7NZm79qiHc8HqciMddQ6CKvJT6aBd8lO9kN/ZudLlw==",
+ "cpu": [
+ "arm"
+ ],
"dev": true,
"license": "MIT",
- "dependencies": {
- "esbuild": "0.27.4",
- "next": "16.2.3"
+ "optional": true,
+ "os": [
+ "linux"
+ ],
+ "engines": {
+ "node": ">=18"
}
},
- "node_modules/@react-email/preview-server/node_modules/@next/env": {
- "version": "16.2.3",
- "dev": true,
- "license": "MIT"
- },
- "node_modules/@react-email/preview-server/node_modules/@next/swc-darwin-arm64": {
- "version": "16.2.3",
+ "node_modules/@react-email/ui/node_modules/@esbuild/linux-arm64": {
+ "version": "0.28.0",
+ "resolved": "https://registry.npmjs.org/@esbuild/linux-arm64/-/linux-arm64-0.28.0.tgz",
+ "integrity": "sha512-RVyzfb3FWsGA55n6WY0MEIEPURL1FcbhFE6BffZEMEekfCzCIMtB5yyDcFnVbTnwk+CLAgTujmV/Lgvih56W+A==",
"cpu": [
"arm64"
],
@@ -8323,130 +8293,118 @@
"license": "MIT",
"optional": true,
"os": [
- "darwin"
+ "linux"
],
"engines": {
- "node": ">= 10"
+ "node": ">=18"
}
},
- "node_modules/@react-email/preview-server/node_modules/@next/swc-darwin-x64": {
- "version": "16.2.3",
- "resolved": "https://registry.npmjs.org/@next/swc-darwin-x64/-/swc-darwin-x64-16.2.3.tgz",
- "integrity": "sha512-gHjL/qy6Q6CG3176FWbAKyKh9IfntKZTB3RY/YOJdDFpHGsUDXVH38U4mMNpHVGXmeYW4wj22dMp1lTfmu/bTQ==",
+ "node_modules/@react-email/ui/node_modules/@esbuild/linux-ia32": {
+ "version": "0.28.0",
+ "resolved": "https://registry.npmjs.org/@esbuild/linux-ia32/-/linux-ia32-0.28.0.tgz",
+ "integrity": "sha512-KBnSTt1kxl9x70q+ydterVdl+Cn0H18ngRMRCEQfrbqdUuntQQ0LoMZv47uB97NljZFzY6HcfqEZ2SAyIUTQBQ==",
"cpu": [
- "x64"
+ "ia32"
],
"dev": true,
"license": "MIT",
"optional": true,
"os": [
- "darwin"
+ "linux"
],
"engines": {
- "node": ">= 10"
+ "node": ">=18"
}
},
- "node_modules/@react-email/preview-server/node_modules/@next/swc-linux-arm64-gnu": {
- "version": "16.2.3",
- "resolved": "https://registry.npmjs.org/@next/swc-linux-arm64-gnu/-/swc-linux-arm64-gnu-16.2.3.tgz",
- "integrity": "sha512-U6vtblPtU/P14Y/b/n9ZY0GOxbbIhTFuaFR7F4/uMBidCi2nSdaOFhA0Go81L61Zd6527+yvuX44T4ksnf8T+Q==",
+ "node_modules/@react-email/ui/node_modules/@esbuild/linux-loong64": {
+ "version": "0.28.0",
+ "resolved": "https://registry.npmjs.org/@esbuild/linux-loong64/-/linux-loong64-0.28.0.tgz",
+ "integrity": "sha512-zpSlUce1mnxzgBADvxKXX5sl8aYQHo2ezvMNI8I0lbblJtp8V4odlm3Yzlj7gPyt3T8ReksE6bK+pT3WD+aJRg==",
"cpu": [
- "arm64"
+ "loong64"
],
"dev": true,
- "libc": [
- "glibc"
- ],
"license": "MIT",
"optional": true,
"os": [
"linux"
],
"engines": {
- "node": ">= 10"
+ "node": ">=18"
}
},
- "node_modules/@react-email/preview-server/node_modules/@next/swc-linux-arm64-musl": {
- "version": "16.2.3",
- "resolved": "https://registry.npmjs.org/@next/swc-linux-arm64-musl/-/swc-linux-arm64-musl-16.2.3.tgz",
- "integrity": "sha512-/YV0LgjHUmfhQpn9bVoGc4x4nan64pkhWR5wyEV8yCOfwwrH630KpvRg86olQHTwHIn1z59uh6JwKvHq1h4QEw==",
+ "node_modules/@react-email/ui/node_modules/@esbuild/linux-mips64el": {
+ "version": "0.28.0",
+ "resolved": "https://registry.npmjs.org/@esbuild/linux-mips64el/-/linux-mips64el-0.28.0.tgz",
+ "integrity": "sha512-2jIfP6mmjkdmeTlsX/9vmdmhBmKADrWqN7zcdtHIeNSCH1SqIoNI63cYsjQR8J+wGa4Y5izRcSHSm8K3QWmk3w==",
"cpu": [
- "arm64"
+ "mips64el"
],
"dev": true,
- "libc": [
- "musl"
- ],
"license": "MIT",
"optional": true,
"os": [
"linux"
],
"engines": {
- "node": ">= 10"
+ "node": ">=18"
}
},
- "node_modules/@react-email/preview-server/node_modules/@next/swc-linux-x64-gnu": {
- "version": "16.2.3",
- "resolved": "https://registry.npmjs.org/@next/swc-linux-x64-gnu/-/swc-linux-x64-gnu-16.2.3.tgz",
- "integrity": "sha512-/HiWEcp+WMZ7VajuiMEFGZ6cg0+aYZPqCJD3YJEfpVWQsKYSjXQG06vJP6F1rdA03COD9Fef4aODs3YxKx+RDQ==",
+ "node_modules/@react-email/ui/node_modules/@esbuild/linux-ppc64": {
+ "version": "0.28.0",
+ "resolved": "https://registry.npmjs.org/@esbuild/linux-ppc64/-/linux-ppc64-0.28.0.tgz",
+ "integrity": "sha512-bc0FE9wWeC0WBm49IQMPSPILRocGTQt3j5KPCA8os6VprfuJ7KD+5PzESSrJ6GmPIPJK965ZJHTUlSA6GNYEhg==",
"cpu": [
- "x64"
+ "ppc64"
],
"dev": true,
- "libc": [
- "glibc"
- ],
"license": "MIT",
"optional": true,
"os": [
"linux"
],
"engines": {
- "node": ">= 10"
+ "node": ">=18"
}
},
- "node_modules/@react-email/preview-server/node_modules/@next/swc-linux-x64-musl": {
- "version": "16.2.3",
- "resolved": "https://registry.npmjs.org/@next/swc-linux-x64-musl/-/swc-linux-x64-musl-16.2.3.tgz",
- "integrity": "sha512-Kt44hGJfZSefebhk/7nIdivoDr3Ugp5+oNz9VvF3GUtfxutucUIHfIO0ZYO8QlOPDQloUVQn4NVC/9JvHRk9hw==",
+ "node_modules/@react-email/ui/node_modules/@esbuild/linux-riscv64": {
+ "version": "0.28.0",
+ "resolved": "https://registry.npmjs.org/@esbuild/linux-riscv64/-/linux-riscv64-0.28.0.tgz",
+ "integrity": "sha512-SQPZOwoTTT/HXFXQJG/vBX8sOFagGqvZyXcgLA3NhIqcBv1BJU1d46c0rGcrij2B56Z2rNiSLaZOYW5cUk7yLQ==",
"cpu": [
- "x64"
+ "riscv64"
],
"dev": true,
- "libc": [
- "musl"
- ],
"license": "MIT",
"optional": true,
"os": [
"linux"
],
"engines": {
- "node": ">= 10"
+ "node": ">=18"
}
},
- "node_modules/@react-email/preview-server/node_modules/@next/swc-win32-arm64-msvc": {
- "version": "16.2.3",
- "resolved": "https://registry.npmjs.org/@next/swc-win32-arm64-msvc/-/swc-win32-arm64-msvc-16.2.3.tgz",
- "integrity": "sha512-O2NZ9ie3Tq6xj5Z5CSwBT3+aWAMW2PIZ4egUi9MaWLkwaehgtB7YZjPm+UpcNpKOme0IQuqDcor7BsW6QBiQBw==",
+ "node_modules/@react-email/ui/node_modules/@esbuild/linux-s390x": {
+ "version": "0.28.0",
+ "resolved": "https://registry.npmjs.org/@esbuild/linux-s390x/-/linux-s390x-0.28.0.tgz",
+ "integrity": "sha512-SCfR0HN8CEEjnYnySJTd2cw0k9OHB/YFzt5zgJEwa+wL/T/raGWYMBqwDNAC6dqFKmJYZoQBRfHjgwLHGSrn3Q==",
"cpu": [
- "arm64"
+ "s390x"
],
"dev": true,
"license": "MIT",
"optional": true,
"os": [
- "win32"
+ "linux"
],
"engines": {
- "node": ">= 10"
+ "node": ">=18"
}
},
- "node_modules/@react-email/preview-server/node_modules/@next/swc-win32-x64-msvc": {
- "version": "16.2.3",
- "resolved": "https://registry.npmjs.org/@next/swc-win32-x64-msvc/-/swc-win32-x64-msvc-16.2.3.tgz",
- "integrity": "sha512-Ibm29/GgB/ab5n7XKqlStkm54qqZE8v2FnijUPBgrd67FWrac45o/RsNlaOWjme/B5UqeWt/8KM4aWBwA1D2Kw==",
+ "node_modules/@react-email/ui/node_modules/@esbuild/linux-x64": {
+ "version": "0.28.0",
+ "resolved": "https://registry.npmjs.org/@esbuild/linux-x64/-/linux-x64-0.28.0.tgz",
+ "integrity": "sha512-us0dSb9iFxIi8srnpl931Nvs65it/Jd2a2K3qs7fz2WfGPHqzfzZTfec7oxZJRNPXPnNYZtanmRc4AL/JwVzHQ==",
"cpu": [
"x64"
],
@@ -8454,254 +8412,507 @@
"license": "MIT",
"optional": true,
"os": [
- "win32"
+ "linux"
],
"engines": {
- "node": ">= 10"
+ "node": ">=18"
}
},
- "node_modules/@react-email/preview-server/node_modules/@swc/helpers": {
- "version": "0.5.15",
- "dev": true,
- "license": "Apache-2.0",
- "dependencies": {
- "tslib": "^2.8.0"
+ "node_modules/@react-email/ui/node_modules/@esbuild/netbsd-arm64": {
+ "version": "0.28.0",
+ "resolved": "https://registry.npmjs.org/@esbuild/netbsd-arm64/-/netbsd-arm64-0.28.0.tgz",
+ "integrity": "sha512-CR/RYotgtCKwtftMwJlUU7xCVNg3lMYZ0RzTmAHSfLCXw3NtZtNpswLEj/Kkf6kEL3Gw+BpOekRX0BYCtklhUw==",
+ "cpu": [
+ "arm64"
+ ],
+ "dev": true,
+ "license": "MIT",
+ "optional": true,
+ "os": [
+ "netbsd"
+ ],
+ "engines": {
+ "node": ">=18"
}
},
- "node_modules/@react-email/preview-server/node_modules/nanoid": {
- "version": "3.3.11",
- "dev": true,
- "funding": [
- {
- "type": "github",
- "url": "https://github.com/sponsors/ai"
- }
+ "node_modules/@react-email/ui/node_modules/@esbuild/netbsd-x64": {
+ "version": "0.28.0",
+ "resolved": "https://registry.npmjs.org/@esbuild/netbsd-x64/-/netbsd-x64-0.28.0.tgz",
+ "integrity": "sha512-nU1yhmYutL+fQ71Kxnhg8uEOdC0pwEW9entHykTgEbna2pw2dkbFSMeqjjyHZoCmt8SBkOSvV+yNmm94aUrrqw==",
+ "cpu": [
+ "x64"
],
+ "dev": true,
"license": "MIT",
- "bin": {
- "nanoid": "bin/nanoid.cjs"
- },
+ "optional": true,
+ "os": [
+ "netbsd"
+ ],
"engines": {
- "node": "^10 || ^12 || ^13.7 || ^14 || >=15.0.1"
+ "node": ">=18"
}
},
- "node_modules/@react-email/preview-server/node_modules/next": {
- "version": "16.2.3",
+ "node_modules/@react-email/ui/node_modules/@esbuild/openbsd-arm64": {
+ "version": "0.28.0",
+ "resolved": "https://registry.npmjs.org/@esbuild/openbsd-arm64/-/openbsd-arm64-0.28.0.tgz",
+ "integrity": "sha512-cXb5vApOsRsxsEl4mcZ1XY3D4DzcoMxR/nnc4IyqYs0rTI8ZKmW6kyyg+11Z8yvgMfAEldKzP7AdP64HnSC/6g==",
+ "cpu": [
+ "arm64"
+ ],
"dev": true,
"license": "MIT",
- "dependencies": {
- "@next/env": "16.2.3",
- "@swc/helpers": "0.5.15",
- "baseline-browser-mapping": "^2.9.19",
- "caniuse-lite": "^1.0.30001579",
- "postcss": "8.4.31",
- "styled-jsx": "5.1.6"
- },
- "bin": {
- "next": "dist/bin/next"
- },
+ "optional": true,
+ "os": [
+ "openbsd"
+ ],
"engines": {
- "node": ">=20.9.0"
- },
- "optionalDependencies": {
- "@next/swc-darwin-arm64": "16.2.3",
- "@next/swc-darwin-x64": "16.2.3",
- "@next/swc-linux-arm64-gnu": "16.2.3",
- "@next/swc-linux-arm64-musl": "16.2.3",
- "@next/swc-linux-x64-gnu": "16.2.3",
- "@next/swc-linux-x64-musl": "16.2.3",
- "@next/swc-win32-arm64-msvc": "16.2.3",
- "@next/swc-win32-x64-msvc": "16.2.3",
- "sharp": "^0.34.5"
- },
- "peerDependencies": {
- "@opentelemetry/api": "^1.1.0",
- "@playwright/test": "^1.51.1",
- "babel-plugin-react-compiler": "*",
- "react": "^18.2.0 || 19.0.0-rc-de68d2f4-20241204 || ^19.0.0",
- "react-dom": "^18.2.0 || 19.0.0-rc-de68d2f4-20241204 || ^19.0.0",
- "sass": "^1.3.0"
- },
- "peerDependenciesMeta": {
- "@opentelemetry/api": {
- "optional": true
- },
- "@playwright/test": {
- "optional": true
- },
- "babel-plugin-react-compiler": {
- "optional": true
- },
- "sass": {
- "optional": true
- }
+ "node": ">=18"
}
},
- "node_modules/@react-email/preview-server/node_modules/postcss": {
- "version": "8.4.31",
- "dev": true,
- "funding": [
- {
- "type": "opencollective",
- "url": "https://opencollective.com/postcss/"
- },
- {
- "type": "tidelift",
- "url": "https://tidelift.com/funding/github/npm/postcss"
- },
- {
- "type": "github",
- "url": "https://github.com/sponsors/ai"
- }
+ "node_modules/@react-email/ui/node_modules/@esbuild/openbsd-x64": {
+ "version": "0.28.0",
+ "resolved": "https://registry.npmjs.org/@esbuild/openbsd-x64/-/openbsd-x64-0.28.0.tgz",
+ "integrity": "sha512-8wZM2qqtv9UP3mzy7HiGYNH/zjTA355mpeuA+859TyR+e+Tc08IHYpLJuMsfpDJwoLo1ikIJI8jC3GFjnRClzA==",
+ "cpu": [
+ "x64"
],
+ "dev": true,
"license": "MIT",
- "dependencies": {
- "nanoid": "^3.3.6",
- "picocolors": "^1.0.0",
- "source-map-js": "^1.0.2"
- },
+ "optional": true,
+ "os": [
+ "openbsd"
+ ],
"engines": {
- "node": "^10 || ^12 || >=14"
+ "node": ">=18"
}
},
- "node_modules/@react-email/preview-server/node_modules/styled-jsx": {
- "version": "5.1.6",
+ "node_modules/@react-email/ui/node_modules/@esbuild/openharmony-arm64": {
+ "version": "0.28.0",
+ "resolved": "https://registry.npmjs.org/@esbuild/openharmony-arm64/-/openharmony-arm64-0.28.0.tgz",
+ "integrity": "sha512-FLGfyizszcef5C3YtoyQDACyg95+dndv79i2EekILBofh5wpCa1KuBqOWKrEHZg3zrL3t5ouE5jgr94vA+Wb2w==",
+ "cpu": [
+ "arm64"
+ ],
"dev": true,
"license": "MIT",
- "dependencies": {
- "client-only": "0.0.1"
- },
+ "optional": true,
+ "os": [
+ "openharmony"
+ ],
"engines": {
- "node": ">= 12.0.0"
- },
- "peerDependencies": {
- "react": ">= 16.8.0 || 17.x.x || ^18.0.0-0 || ^19.0.0-0"
- },
- "peerDependenciesMeta": {
- "@babel/core": {
- "optional": true
- },
- "babel-plugin-macros": {
- "optional": true
- }
+ "node": ">=18"
}
},
- "node_modules/@react-email/render": {
- "version": "2.0.8",
- "resolved": "https://registry.npmjs.org/@react-email/render/-/render-2.0.8.tgz",
- "integrity": "sha512-5udvVr3U/WuGJZfLdLBOhkzrqRWd2Q5ZYmF7ppcy7FzWcwgshdqLMNqJOXcVzAXJXg/2bm7D+WGJzTtZOZMQnQ==",
+ "node_modules/@react-email/ui/node_modules/@esbuild/sunos-x64": {
+ "version": "0.28.0",
+ "resolved": "https://registry.npmjs.org/@esbuild/sunos-x64/-/sunos-x64-0.28.0.tgz",
+ "integrity": "sha512-1ZgjUoEdHZZl/YlV76TSCz9Hqj9h9YmMGAgAPYd+q4SicWNX3G5GCyx9uhQWSLcbvPW8Ni7lj4gDa1T40akdlw==",
+ "cpu": [
+ "x64"
+ ],
+ "dev": true,
"license": "MIT",
- "dependencies": {
- "html-to-text": "^9.0.5",
- "prettier": "^3.5.3"
- },
+ "optional": true,
+ "os": [
+ "sunos"
+ ],
"engines": {
- "node": ">=20.0.0"
- },
- "peerDependencies": {
- "react": "^18.0 || ^19.0 || ^19.0.0-rc",
- "react-dom": "^18.0 || ^19.0 || ^19.0.0-rc"
+ "node": ">=18"
}
},
- "node_modules/@react-email/row": {
- "version": "0.0.13",
+ "node_modules/@react-email/ui/node_modules/@esbuild/win32-arm64": {
+ "version": "0.28.0",
+ "resolved": "https://registry.npmjs.org/@esbuild/win32-arm64/-/win32-arm64-0.28.0.tgz",
+ "integrity": "sha512-Q9StnDmQ/enxnpxCCLSg0oo4+34B9TdXpuyPeTedN/6+iXBJ4J+zwfQI28u/Jl40nOYAxGoNi7mFP40RUtkmUA==",
+ "cpu": [
+ "arm64"
+ ],
+ "dev": true,
"license": "MIT",
+ "optional": true,
+ "os": [
+ "win32"
+ ],
"engines": {
- "node": ">=20.0.0"
- },
- "peerDependencies": {
- "react": "^18.0 || ^19.0 || ^19.0.0-rc"
+ "node": ">=18"
}
},
- "node_modules/@react-email/section": {
- "version": "0.0.17",
+ "node_modules/@react-email/ui/node_modules/@esbuild/win32-ia32": {
+ "version": "0.28.0",
+ "resolved": "https://registry.npmjs.org/@esbuild/win32-ia32/-/win32-ia32-0.28.0.tgz",
+ "integrity": "sha512-zF3ag/gfiCe6U2iczcRzSYJKH1DCI+ByzSENHlM2FcDbEeo5Zd2C86Aq0tKUYAJJ1obRP84ymxIAksZUcdztHA==",
+ "cpu": [
+ "ia32"
+ ],
+ "dev": true,
"license": "MIT",
+ "optional": true,
+ "os": [
+ "win32"
+ ],
"engines": {
- "node": ">=20.0.0"
- },
- "peerDependencies": {
- "react": "^18.0 || ^19.0 || ^19.0.0-rc"
+ "node": ">=18"
}
},
- "node_modules/@react-email/tailwind": {
- "version": "2.0.7",
+ "node_modules/@react-email/ui/node_modules/@esbuild/win32-x64": {
+ "version": "0.28.0",
+ "resolved": "https://registry.npmjs.org/@esbuild/win32-x64/-/win32-x64-0.28.0.tgz",
+ "integrity": "sha512-pEl1bO9mfAmIC+tW5btTmrKaujg3zGtUmWNdCw/xs70FBjwAL3o9OEKNHvNmnyylD6ubxUERiEhdsL0xBQ9efw==",
+ "cpu": [
+ "x64"
+ ],
+ "dev": true,
"license": "MIT",
- "dependencies": {
- "tailwindcss": "^4.1.18"
- },
+ "optional": true,
+ "os": [
+ "win32"
+ ],
"engines": {
- "node": ">=20.0.0"
- },
- "peerDependencies": {
- "@react-email/body": ">=0",
- "@react-email/button": ">=0",
- "@react-email/code-block": ">=0",
- "@react-email/code-inline": ">=0",
- "@react-email/container": ">=0",
- "@react-email/heading": ">=0",
- "@react-email/hr": ">=0",
- "@react-email/img": ">=0",
- "@react-email/link": ">=0",
- "@react-email/preview": ">=0",
- "@react-email/text": ">=0",
- "react": "^18.0 || ^19.0 || ^19.0.0-rc"
- },
- "peerDependenciesMeta": {
- "@react-email/body": {
- "optional": true
- },
- "@react-email/button": {
- "optional": true
- },
- "@react-email/code-block": {
- "optional": true
- },
- "@react-email/code-inline": {
- "optional": true
- },
- "@react-email/container": {
- "optional": true
- },
- "@react-email/heading": {
- "optional": true
- },
- "@react-email/hr": {
- "optional": true
- },
- "@react-email/img": {
- "optional": true
- },
- "@react-email/link": {
- "optional": true
- },
- "@react-email/preview": {
- "optional": true
- }
+ "node": ">=18"
}
},
- "node_modules/@react-email/tailwind/node_modules/tailwindcss": {
- "version": "4.2.2",
+ "node_modules/@react-email/ui/node_modules/@next/env": {
+ "version": "16.2.3",
+ "resolved": "https://registry.npmjs.org/@next/env/-/env-16.2.3.tgz",
+ "integrity": "sha512-ZWXyj4uNu4GCWQw9cjRxWlbD+33mcDszIo9iQxFnBX3Wmgq9ulaSJcl6VhuWx5pCWqqD+9W6Wfz7N0lM5lYPMA==",
+ "dev": true,
"license": "MIT"
},
- "node_modules/@react-email/text": {
- "version": "0.1.6",
+ "node_modules/@react-email/ui/node_modules/@next/swc-darwin-arm64": {
+ "version": "16.2.3",
+ "resolved": "https://registry.npmjs.org/@next/swc-darwin-arm64/-/swc-darwin-arm64-16.2.3.tgz",
+ "integrity": "sha512-u37KDKTKQ+OQLvY+z7SNXixwo4Q2/IAJFDzU1fYe66IbCE51aDSAzkNDkWmLN0yjTUh4BKBd+hb69jYn6qqqSg==",
+ "cpu": [
+ "arm64"
+ ],
+ "dev": true,
"license": "MIT",
+ "optional": true,
+ "os": [
+ "darwin"
+ ],
"engines": {
- "node": ">=20.0.0"
- },
- "peerDependencies": {
- "react": "^18.0 || ^19.0 || ^19.0.0-rc"
- }
- },
- "node_modules/@react-types/shared": {
- "version": "3.34.0",
- "license": "Apache-2.0",
- "peerDependencies": {
- "react": "^16.8.0 || ^17.0.0-rc.1 || ^18.0.0 || ^19.0.0-rc.1"
+ "node": ">= 10"
}
},
- "node_modules/@redis/bloom": {
- "version": "1.2.0",
+ "node_modules/@react-email/ui/node_modules/@next/swc-darwin-x64": {
+ "version": "16.2.3",
+ "resolved": "https://registry.npmjs.org/@next/swc-darwin-x64/-/swc-darwin-x64-16.2.3.tgz",
+ "integrity": "sha512-gHjL/qy6Q6CG3176FWbAKyKh9IfntKZTB3RY/YOJdDFpHGsUDXVH38U4mMNpHVGXmeYW4wj22dMp1lTfmu/bTQ==",
+ "cpu": [
+ "x64"
+ ],
+ "dev": true,
+ "license": "MIT",
+ "optional": true,
+ "os": [
+ "darwin"
+ ],
+ "engines": {
+ "node": ">= 10"
+ }
+ },
+ "node_modules/@react-email/ui/node_modules/@next/swc-linux-arm64-gnu": {
+ "version": "16.2.3",
+ "resolved": "https://registry.npmjs.org/@next/swc-linux-arm64-gnu/-/swc-linux-arm64-gnu-16.2.3.tgz",
+ "integrity": "sha512-U6vtblPtU/P14Y/b/n9ZY0GOxbbIhTFuaFR7F4/uMBidCi2nSdaOFhA0Go81L61Zd6527+yvuX44T4ksnf8T+Q==",
+ "cpu": [
+ "arm64"
+ ],
+ "dev": true,
+ "libc": [
+ "glibc"
+ ],
+ "license": "MIT",
+ "optional": true,
+ "os": [
+ "linux"
+ ],
+ "engines": {
+ "node": ">= 10"
+ }
+ },
+ "node_modules/@react-email/ui/node_modules/@next/swc-linux-arm64-musl": {
+ "version": "16.2.3",
+ "resolved": "https://registry.npmjs.org/@next/swc-linux-arm64-musl/-/swc-linux-arm64-musl-16.2.3.tgz",
+ "integrity": "sha512-/YV0LgjHUmfhQpn9bVoGc4x4nan64pkhWR5wyEV8yCOfwwrH630KpvRg86olQHTwHIn1z59uh6JwKvHq1h4QEw==",
+ "cpu": [
+ "arm64"
+ ],
+ "dev": true,
+ "libc": [
+ "musl"
+ ],
+ "license": "MIT",
+ "optional": true,
+ "os": [
+ "linux"
+ ],
+ "engines": {
+ "node": ">= 10"
+ }
+ },
+ "node_modules/@react-email/ui/node_modules/@next/swc-linux-x64-gnu": {
+ "version": "16.2.3",
+ "resolved": "https://registry.npmjs.org/@next/swc-linux-x64-gnu/-/swc-linux-x64-gnu-16.2.3.tgz",
+ "integrity": "sha512-/HiWEcp+WMZ7VajuiMEFGZ6cg0+aYZPqCJD3YJEfpVWQsKYSjXQG06vJP6F1rdA03COD9Fef4aODs3YxKx+RDQ==",
+ "cpu": [
+ "x64"
+ ],
+ "dev": true,
+ "libc": [
+ "glibc"
+ ],
+ "license": "MIT",
+ "optional": true,
+ "os": [
+ "linux"
+ ],
+ "engines": {
+ "node": ">= 10"
+ }
+ },
+ "node_modules/@react-email/ui/node_modules/@next/swc-linux-x64-musl": {
+ "version": "16.2.3",
+ "resolved": "https://registry.npmjs.org/@next/swc-linux-x64-musl/-/swc-linux-x64-musl-16.2.3.tgz",
+ "integrity": "sha512-Kt44hGJfZSefebhk/7nIdivoDr3Ugp5+oNz9VvF3GUtfxutucUIHfIO0ZYO8QlOPDQloUVQn4NVC/9JvHRk9hw==",
+ "cpu": [
+ "x64"
+ ],
+ "dev": true,
+ "libc": [
+ "musl"
+ ],
+ "license": "MIT",
+ "optional": true,
+ "os": [
+ "linux"
+ ],
+ "engines": {
+ "node": ">= 10"
+ }
+ },
+ "node_modules/@react-email/ui/node_modules/@next/swc-win32-arm64-msvc": {
+ "version": "16.2.3",
+ "resolved": "https://registry.npmjs.org/@next/swc-win32-arm64-msvc/-/swc-win32-arm64-msvc-16.2.3.tgz",
+ "integrity": "sha512-O2NZ9ie3Tq6xj5Z5CSwBT3+aWAMW2PIZ4egUi9MaWLkwaehgtB7YZjPm+UpcNpKOme0IQuqDcor7BsW6QBiQBw==",
+ "cpu": [
+ "arm64"
+ ],
+ "dev": true,
+ "license": "MIT",
+ "optional": true,
+ "os": [
+ "win32"
+ ],
+ "engines": {
+ "node": ">= 10"
+ }
+ },
+ "node_modules/@react-email/ui/node_modules/@next/swc-win32-x64-msvc": {
+ "version": "16.2.3",
+ "resolved": "https://registry.npmjs.org/@next/swc-win32-x64-msvc/-/swc-win32-x64-msvc-16.2.3.tgz",
+ "integrity": "sha512-Ibm29/GgB/ab5n7XKqlStkm54qqZE8v2FnijUPBgrd67FWrac45o/RsNlaOWjme/B5UqeWt/8KM4aWBwA1D2Kw==",
+ "cpu": [
+ "x64"
+ ],
+ "dev": true,
+ "license": "MIT",
+ "optional": true,
+ "os": [
+ "win32"
+ ],
+ "engines": {
+ "node": ">= 10"
+ }
+ },
+ "node_modules/@react-email/ui/node_modules/@swc/helpers": {
+ "version": "0.5.15",
+ "resolved": "https://registry.npmjs.org/@swc/helpers/-/helpers-0.5.15.tgz",
+ "integrity": "sha512-JQ5TuMi45Owi4/BIMAJBoSQoOJu12oOk/gADqlcUL9JEdHB8vyjUSsxqeNXnmXHjYKMi2WcYtezGEEhqUI/E2g==",
+ "dev": true,
+ "license": "Apache-2.0",
+ "dependencies": {
+ "tslib": "^2.8.0"
+ }
+ },
+ "node_modules/@react-email/ui/node_modules/esbuild": {
+ "version": "0.28.0",
+ "resolved": "https://registry.npmjs.org/esbuild/-/esbuild-0.28.0.tgz",
+ "integrity": "sha512-sNR9MHpXSUV/XB4zmsFKN+QgVG82Cc7+/aaxJ8Adi8hyOac+EXptIp45QBPaVyX3N70664wRbTcLTOemCAnyqw==",
+ "dev": true,
+ "hasInstallScript": true,
+ "license": "MIT",
+ "bin": {
+ "esbuild": "bin/esbuild"
+ },
+ "engines": {
+ "node": ">=18"
+ },
+ "optionalDependencies": {
+ "@esbuild/aix-ppc64": "0.28.0",
+ "@esbuild/android-arm": "0.28.0",
+ "@esbuild/android-arm64": "0.28.0",
+ "@esbuild/android-x64": "0.28.0",
+ "@esbuild/darwin-arm64": "0.28.0",
+ "@esbuild/darwin-x64": "0.28.0",
+ "@esbuild/freebsd-arm64": "0.28.0",
+ "@esbuild/freebsd-x64": "0.28.0",
+ "@esbuild/linux-arm": "0.28.0",
+ "@esbuild/linux-arm64": "0.28.0",
+ "@esbuild/linux-ia32": "0.28.0",
+ "@esbuild/linux-loong64": "0.28.0",
+ "@esbuild/linux-mips64el": "0.28.0",
+ "@esbuild/linux-ppc64": "0.28.0",
+ "@esbuild/linux-riscv64": "0.28.0",
+ "@esbuild/linux-s390x": "0.28.0",
+ "@esbuild/linux-x64": "0.28.0",
+ "@esbuild/netbsd-arm64": "0.28.0",
+ "@esbuild/netbsd-x64": "0.28.0",
+ "@esbuild/openbsd-arm64": "0.28.0",
+ "@esbuild/openbsd-x64": "0.28.0",
+ "@esbuild/openharmony-arm64": "0.28.0",
+ "@esbuild/sunos-x64": "0.28.0",
+ "@esbuild/win32-arm64": "0.28.0",
+ "@esbuild/win32-ia32": "0.28.0",
+ "@esbuild/win32-x64": "0.28.0"
+ }
+ },
+ "node_modules/@react-email/ui/node_modules/nanoid": {
+ "version": "3.3.12",
+ "resolved": "https://registry.npmjs.org/nanoid/-/nanoid-3.3.12.tgz",
+ "integrity": "sha512-ZB9RH/39qpq5Vu6Y+NmUaFhQR6pp+M2Xt76XBnEwDaGcVAqhlvxrl3B2bKS5D3NH3QR76v3aSrKaF/Kiy7lEtQ==",
+ "dev": true,
+ "funding": [
+ {
+ "type": "github",
+ "url": "https://github.com/sponsors/ai"
+ }
+ ],
+ "license": "MIT",
+ "bin": {
+ "nanoid": "bin/nanoid.cjs"
+ },
+ "engines": {
+ "node": "^10 || ^12 || ^13.7 || ^14 || >=15.0.1"
+ }
+ },
+ "node_modules/@react-email/ui/node_modules/next": {
+ "version": "16.2.3",
+ "resolved": "https://registry.npmjs.org/next/-/next-16.2.3.tgz",
+ "integrity": "sha512-9V3zV4oZFza3PVev5/poB9g0dEafVcgNyQ8eTRop8GvxZjV2G15FC5ARuG1eFD42QgeYkzJBJzHghNP8Ad9xtA==",
+ "dev": true,
+ "license": "MIT",
+ "dependencies": {
+ "@next/env": "16.2.3",
+ "@swc/helpers": "0.5.15",
+ "baseline-browser-mapping": "^2.9.19",
+ "caniuse-lite": "^1.0.30001579",
+ "postcss": "8.4.31",
+ "styled-jsx": "5.1.6"
+ },
+ "bin": {
+ "next": "dist/bin/next"
+ },
+ "engines": {
+ "node": ">=20.9.0"
+ },
+ "optionalDependencies": {
+ "@next/swc-darwin-arm64": "16.2.3",
+ "@next/swc-darwin-x64": "16.2.3",
+ "@next/swc-linux-arm64-gnu": "16.2.3",
+ "@next/swc-linux-arm64-musl": "16.2.3",
+ "@next/swc-linux-x64-gnu": "16.2.3",
+ "@next/swc-linux-x64-musl": "16.2.3",
+ "@next/swc-win32-arm64-msvc": "16.2.3",
+ "@next/swc-win32-x64-msvc": "16.2.3",
+ "sharp": "^0.34.5"
+ },
+ "peerDependencies": {
+ "@opentelemetry/api": "^1.1.0",
+ "@playwright/test": "^1.51.1",
+ "babel-plugin-react-compiler": "*",
+ "react": "^18.2.0 || 19.0.0-rc-de68d2f4-20241204 || ^19.0.0",
+ "react-dom": "^18.2.0 || 19.0.0-rc-de68d2f4-20241204 || ^19.0.0",
+ "sass": "^1.3.0"
+ },
+ "peerDependenciesMeta": {
+ "@opentelemetry/api": {
+ "optional": true
+ },
+ "@playwright/test": {
+ "optional": true
+ },
+ "babel-plugin-react-compiler": {
+ "optional": true
+ },
+ "sass": {
+ "optional": true
+ }
+ }
+ },
+ "node_modules/@react-email/ui/node_modules/postcss": {
+ "version": "8.4.31",
+ "resolved": "https://registry.npmjs.org/postcss/-/postcss-8.4.31.tgz",
+ "integrity": "sha512-PS08Iboia9mts/2ygV3eLpY5ghnUcfLV/EXTOW1E2qYxJKGGBUtNjN76FYHnMs36RmARn41bC0AZmn+rR0OVpQ==",
+ "dev": true,
+ "funding": [
+ {
+ "type": "opencollective",
+ "url": "https://opencollective.com/postcss/"
+ },
+ {
+ "type": "tidelift",
+ "url": "https://tidelift.com/funding/github/npm/postcss"
+ },
+ {
+ "type": "github",
+ "url": "https://github.com/sponsors/ai"
+ }
+ ],
+ "license": "MIT",
+ "dependencies": {
+ "nanoid": "^3.3.6",
+ "picocolors": "^1.0.0",
+ "source-map-js": "^1.0.2"
+ },
+ "engines": {
+ "node": "^10 || ^12 || >=14"
+ }
+ },
+ "node_modules/@react-email/ui/node_modules/styled-jsx": {
+ "version": "5.1.6",
+ "resolved": "https://registry.npmjs.org/styled-jsx/-/styled-jsx-5.1.6.tgz",
+ "integrity": "sha512-qSVyDTeMotdvQYoHWLNGwRFJHC+i+ZvdBRYosOFgC+Wg1vx4frN2/RG/NA7SYqqvKNLf39P2LSRA2pu6n0XYZA==",
+ "dev": true,
+ "license": "MIT",
+ "dependencies": {
+ "client-only": "0.0.1"
+ },
+ "engines": {
+ "node": ">= 12.0.0"
+ },
+ "peerDependencies": {
+ "react": ">= 16.8.0 || 17.x.x || ^18.0.0-0 || ^19.0.0-0"
+ },
+ "peerDependenciesMeta": {
+ "@babel/core": {
+ "optional": true
+ },
+ "babel-plugin-macros": {
+ "optional": true
+ }
+ }
+ },
+ "node_modules/@react-types/shared": {
+ "version": "3.34.0",
+ "license": "Apache-2.0",
+ "peerDependencies": {
+ "react": "^16.8.0 || ^17.0.0-rc.1 || ^18.0.0 || ^19.0.0-rc.1"
+ }
+ },
+ "node_modules/@redis/bloom": {
+ "version": "1.2.0",
"license": "MIT",
"peerDependencies": {
"@redis/client": "^1.0.0"
@@ -10953,10 +11164,12 @@
"license": "MIT"
},
"node_modules/@types/node": {
- "version": "22.19.17",
+ "version": "24.12.3",
+ "resolved": "https://registry.npmjs.org/@types/node/-/node-24.12.3.tgz",
+ "integrity": "sha512-8oljBDGun9cIsZRJR6fkihn0TSXJI0UDOOhncYaERq6M0JMDoPLxyscwruJcb4GKS6dvK/d8xebYBg27h/duaQ==",
"license": "MIT",
"dependencies": {
- "undici-types": "~6.21.0"
+ "undici-types": "~7.16.0"
}
},
"node_modules/@types/oidc-provider": {
@@ -11687,12 +11900,12 @@
"license": "Apache-2.0"
},
"node_modules/@vercel/functions": {
- "version": "3.5.0",
- "resolved": "https://registry.npmjs.org/@vercel/functions/-/functions-3.5.0.tgz",
- "integrity": "sha512-+RokZ+4gkYyOsKBuJ29cQ8iSZG123LLJbZfPry20kkTgrN9U0277La4feP4DnWVo3sGoYa4plCEKY9XKUYoX9g==",
+ "version": "3.5.1",
+ "resolved": "https://registry.npmjs.org/@vercel/functions/-/functions-3.5.1.tgz",
+ "integrity": "sha512-ndh5v+uhWqGA8033oD0i0KHvqUHcLlLCOaLOw5L+xx5zVsWUSQcZPKEYk2nm51aisnKhcnTylxnOmhx+w4UCRA==",
"license": "Apache-2.0",
"dependencies": {
- "@vercel/oidc": "3.4.0"
+ "@vercel/oidc": "3.4.1"
},
"engines": {
"node": ">= 20"
@@ -11707,9 +11920,9 @@
}
},
"node_modules/@vercel/oidc": {
- "version": "3.4.0",
- "resolved": "https://registry.npmjs.org/@vercel/oidc/-/oidc-3.4.0.tgz",
- "integrity": "sha512-p0sKfHkfRmMaqqDwNL4tjnX9TgRrLMlEtUjIxfrEns8pOxz1R9ztqOVI+ehqiq93/2/HnfPe/UBZkfAZwnx0UA==",
+ "version": "3.4.1",
+ "resolved": "https://registry.npmjs.org/@vercel/oidc/-/oidc-3.4.1.tgz",
+ "integrity": "sha512-H6B+/ig/GoahccL3WZjiHayHw1H5KhvTJNceqYulwfK9kkz5iul2hTmYzcJ7tTCQzyd0dutuL9xYFZCyLUqsog==",
"license": "Apache-2.0",
"engines": {
"node": ">= 20"
@@ -11815,12 +12028,12 @@
}
},
"node_modules/ai": {
- "version": "6.0.176",
- "resolved": "https://registry.npmjs.org/ai/-/ai-6.0.176.tgz",
- "integrity": "sha512-dhxDef3VCIxaFr6tKyG0BrkkCelmnporlen8nHajIwCk7S4PvIaSVI/iyJenhFOZ9KBoKjCAoUs6TzZ3yrSjxw==",
+ "version": "6.0.177",
+ "resolved": "https://registry.npmjs.org/ai/-/ai-6.0.177.tgz",
+ "integrity": "sha512-1xQtbeWwNcLyyM86ixZhkKvT+WRXc1lvarIKqPVtsyn8F9NDikwUMBqYu+aQKDgMht50SMXh4qboYuU8MeHZZA==",
"license": "Apache-2.0",
"dependencies": {
- "@ai-sdk/gateway": "3.0.111",
+ "@ai-sdk/gateway": "3.0.112",
"@ai-sdk/provider": "3.0.10",
"@ai-sdk/provider-utils": "4.0.27",
"@opentelemetry/api": "1.9.0"
@@ -11959,6 +12172,8 @@
},
"node_modules/archiver": {
"version": "7.0.1",
+ "resolved": "https://registry.npmjs.org/archiver/-/archiver-7.0.1.tgz",
+ "integrity": "sha512-ZcbTaIqJOfCc03QwD468Unz/5Ir8ATtvAHsK+FdXbDIbGfihqh9mrvdcYunQzqn4HrvWWaFyaxJhGZagaJJpPQ==",
"license": "MIT",
"dependencies": {
"archiver-utils": "^5.0.2",
@@ -11975,6 +12190,8 @@
},
"node_modules/archiver-utils": {
"version": "5.0.2",
+ "resolved": "https://registry.npmjs.org/archiver-utils/-/archiver-utils-5.0.2.tgz",
+ "integrity": "sha512-wuLJMmIBQYCsGZgYLTy5FIB2pF6Lfb6cXMSF8Qywwk3t20zWnAi7zLcQFdKQmIB8wyZpY5ER38x08GbwtR2cLA==",
"license": "MIT",
"dependencies": {
"glob": "^10.0.0",
@@ -13029,29 +13246,6 @@
"version": "2.5.1",
"license": "MIT"
},
- "node_modules/cli-cursor": {
- "version": "5.0.0",
- "license": "MIT",
- "dependencies": {
- "restore-cursor": "^5.0.0"
- },
- "engines": {
- "node": ">=18"
- },
- "funding": {
- "url": "https://github.com/sponsors/sindresorhus"
- }
- },
- "node_modules/cli-spinners": {
- "version": "2.9.2",
- "license": "MIT",
- "engines": {
- "node": ">=6"
- },
- "funding": {
- "url": "https://github.com/sponsors/sindresorhus"
- }
- },
"node_modules/client-only": {
"version": "0.0.1",
"license": "MIT"
@@ -13198,6 +13392,8 @@
},
"node_modules/compress-commons": {
"version": "6.0.2",
+ "resolved": "https://registry.npmjs.org/compress-commons/-/compress-commons-6.0.2.tgz",
+ "integrity": "sha512-6FqVXeETqWPoGcfzrXb37E50NP0LXT8kAMu5ooZayhWWdgEY4lBEEcbQNXtkuKQsGduxiIcI4gOTsxTmuq/bSg==",
"license": "MIT",
"dependencies": {
"crc-32": "^1.2.0",
@@ -13365,6 +13561,8 @@
},
"node_modules/crc32-stream": {
"version": "6.0.0",
+ "resolved": "https://registry.npmjs.org/crc32-stream/-/crc32-stream-6.0.0.tgz",
+ "integrity": "sha512-piICUB6ei4IlTv1+653yq5+KoqfBYmj9bw6LqXoOneTMDXk5nM1qt12mFW1caG3LlJXEKW1Bp0WggEmIfQB34g==",
"license": "MIT",
"dependencies": {
"crc-32": "^1.2.0",
@@ -13406,6 +13604,19 @@
"utrie": "^1.0.2"
}
},
+ "node_modules/css-tree": {
+ "version": "3.2.1",
+ "resolved": "https://registry.npmjs.org/css-tree/-/css-tree-3.2.1.tgz",
+ "integrity": "sha512-X7sjQzceUhu1u7Y/ylrRZFU2FS6LRiFVp6rKLPg23y3x3c3DOKAwuXGDp+PAGjh6CSnCjYeAul8pcT8bAl+lSA==",
+ "license": "MIT",
+ "dependencies": {
+ "mdn-data": "2.27.1",
+ "source-map-js": "^1.2.1"
+ },
+ "engines": {
+ "node": "^10 || ^12.20.0 || ^14.13.0 || >=15.0.0"
+ }
+ },
"node_modules/cssesc": {
"version": "3.0.0",
"license": "MIT",
@@ -14722,6 +14933,7 @@
},
"node_modules/esbuild": {
"version": "0.27.4",
+ "devOptional": true,
"hasInstallScript": true,
"license": "MIT",
"bin": {
@@ -15866,7 +16078,9 @@
"license": "Unlicense"
},
"node_modules/fast-uri": {
- "version": "3.1.0",
+ "version": "3.1.2",
+ "resolved": "https://registry.npmjs.org/fast-uri/-/fast-uri-3.1.2.tgz",
+ "integrity": "sha512-rVjf7ArG3LTk+FS6Yw81V1DLuZl1bRbNrev6Tmd/9RaroeeRRJhAt7jg/6YFxbvAQXUCavSoZhPPj6oOx+5KjQ==",
"funding": [
{
"type": "github",
@@ -16412,16 +16626,6 @@
"node": "6.* || 8.* || >= 10.*"
}
},
- "node_modules/get-east-asian-width": {
- "version": "1.5.0",
- "license": "MIT",
- "engines": {
- "node": ">=18"
- },
- "funding": {
- "url": "https://github.com/sponsors/sindresorhus"
- }
- },
"node_modules/get-intrinsic": {
"version": "1.3.0",
"license": "MIT",
@@ -17572,16 +17776,6 @@
"url": "https://github.com/sponsors/sindresorhus"
}
},
- "node_modules/is-interactive": {
- "version": "2.0.0",
- "license": "MIT",
- "engines": {
- "node": ">=12"
- },
- "funding": {
- "url": "https://github.com/sponsors/sindresorhus"
- }
- },
"node_modules/is-map": {
"version": "2.0.3",
"license": "MIT",
@@ -18574,6 +18768,8 @@
},
"node_modules/marked": {
"version": "15.0.12",
+ "resolved": "https://registry.npmjs.org/marked/-/marked-15.0.12.tgz",
+ "integrity": "sha512-8dD6FusOQSrpv9Z1rdNMdlSgQOIP880DHqnohobOmYLElGEqAL/JvxvuxZO16r4HtjTlfPRDC1hbvxC9dPN2nA==",
"license": "MIT",
"bin": {
"marked": "bin/marked.js"
@@ -18829,6 +19025,12 @@
"url": "https://opencollective.com/unified"
}
},
+ "node_modules/mdn-data": {
+ "version": "2.27.1",
+ "resolved": "https://registry.npmjs.org/mdn-data/-/mdn-data-2.27.1.tgz",
+ "integrity": "sha512-9Yubnt3e8A0OKwxYSXyhLymGW4sCufcLG6VdiDdUGVkPhpqLxlvP5vl1983gQjJl3tqbrM731mjaZaP68AgosQ==",
+ "license": "CC0-1.0"
+ },
"node_modules/media-typer": {
"version": "1.1.0",
"license": "MIT",
@@ -20251,12 +20453,14 @@
"license": "MIT"
},
"node_modules/nypm": {
- "version": "0.6.5",
+ "version": "0.6.6",
+ "resolved": "https://registry.npmjs.org/nypm/-/nypm-0.6.6.tgz",
+ "integrity": "sha512-vRyr0r4cbBapw07Xw8xrj9Teq3o7MUD35rSaTcanDbW+aK2XHDgJFiU6ZTj2GBw7Q12ysdsyFss+Vdz4hQ0Y6Q==",
"license": "MIT",
"dependencies": {
- "citty": "^0.2.0",
+ "citty": "^0.2.2",
"pathe": "^2.0.3",
- "tinyexec": "^1.0.2"
+ "tinyexec": "^1.1.1"
},
"bin": {
"nypm": "dist/cli.mjs"
@@ -20556,93 +20760,6 @@
"node": ">= 0.8.0"
}
},
- "node_modules/ora": {
- "version": "8.2.0",
- "license": "MIT",
- "dependencies": {
- "chalk": "^5.3.0",
- "cli-cursor": "^5.0.0",
- "cli-spinners": "^2.9.2",
- "is-interactive": "^2.0.0",
- "is-unicode-supported": "^2.0.0",
- "log-symbols": "^6.0.0",
- "stdin-discarder": "^0.2.2",
- "string-width": "^7.2.0",
- "strip-ansi": "^7.1.0"
- },
- "engines": {
- "node": ">=18"
- },
- "funding": {
- "url": "https://github.com/sponsors/sindresorhus"
- }
- },
- "node_modules/ora/node_modules/ansi-regex": {
- "version": "6.2.2",
- "license": "MIT",
- "engines": {
- "node": ">=12"
- },
- "funding": {
- "url": "https://github.com/chalk/ansi-regex?sponsor=1"
- }
- },
- "node_modules/ora/node_modules/emoji-regex": {
- "version": "10.6.0",
- "license": "MIT"
- },
- "node_modules/ora/node_modules/log-symbols": {
- "version": "6.0.0",
- "license": "MIT",
- "dependencies": {
- "chalk": "^5.3.0",
- "is-unicode-supported": "^1.3.0"
- },
- "engines": {
- "node": ">=18"
- },
- "funding": {
- "url": "https://github.com/sponsors/sindresorhus"
- }
- },
- "node_modules/ora/node_modules/log-symbols/node_modules/is-unicode-supported": {
- "version": "1.3.0",
- "license": "MIT",
- "engines": {
- "node": ">=12"
- },
- "funding": {
- "url": "https://github.com/sponsors/sindresorhus"
- }
- },
- "node_modules/ora/node_modules/string-width": {
- "version": "7.2.0",
- "license": "MIT",
- "dependencies": {
- "emoji-regex": "^10.3.0",
- "get-east-asian-width": "^1.0.0",
- "strip-ansi": "^7.1.0"
- },
- "engines": {
- "node": ">=18"
- },
- "funding": {
- "url": "https://github.com/sponsors/sindresorhus"
- }
- },
- "node_modules/ora/node_modules/strip-ansi": {
- "version": "7.2.0",
- "license": "MIT",
- "dependencies": {
- "ansi-regex": "^6.2.2"
- },
- "engines": {
- "node": ">=12"
- },
- "funding": {
- "url": "https://github.com/chalk/strip-ansi?sponsor=1"
- }
- },
"node_modules/orderedmap": {
"version": "2.1.1",
"license": "MIT"
@@ -21086,6 +21203,15 @@
"url": "https://github.com/sponsors/jonschlinkert"
}
},
+ "node_modules/picospinner": {
+ "version": "3.0.0",
+ "resolved": "https://registry.npmjs.org/picospinner/-/picospinner-3.0.0.tgz",
+ "integrity": "sha512-lGA1TNsmy2bxvRsTI2cV01kfTwKzZjnZSDmF9llYNyMHMrU4sP87lQ5taiIKm88L3cbswjl008nwyGc3WpNvzg==",
+ "license": "MIT",
+ "engines": {
+ "node": ">=18.0.0"
+ }
+ },
"node_modules/pify": {
"version": "2.3.0",
"license": "MIT",
@@ -21745,500 +21871,931 @@
"node": ">= 6"
}
},
- "node_modules/prop-types": {
- "version": "15.8.1",
+ "node_modules/prop-types": {
+ "version": "15.8.1",
+ "license": "MIT",
+ "dependencies": {
+ "loose-envify": "^1.4.0",
+ "object-assign": "^4.1.1",
+ "react-is": "^16.13.1"
+ }
+ },
+ "node_modules/proper-lockfile": {
+ "version": "4.1.2",
+ "license": "MIT",
+ "dependencies": {
+ "graceful-fs": "^4.2.4",
+ "retry": "^0.12.0",
+ "signal-exit": "^3.0.2"
+ }
+ },
+ "node_modules/proper-lockfile/node_modules/retry": {
+ "version": "0.12.0",
+ "license": "MIT",
+ "engines": {
+ "node": ">= 4"
+ }
+ },
+ "node_modules/proper-lockfile/node_modules/signal-exit": {
+ "version": "3.0.7",
+ "license": "ISC"
+ },
+ "node_modules/property-information": {
+ "version": "7.1.0",
+ "license": "MIT",
+ "funding": {
+ "type": "github",
+ "url": "https://github.com/sponsors/wooorm"
+ }
+ },
+ "node_modules/prosemirror-changeset": {
+ "version": "2.4.1",
+ "license": "MIT",
+ "dependencies": {
+ "prosemirror-transform": "^1.0.0"
+ }
+ },
+ "node_modules/prosemirror-commands": {
+ "version": "1.7.1",
+ "resolved": "https://registry.npmjs.org/prosemirror-commands/-/prosemirror-commands-1.7.1.tgz",
+ "integrity": "sha512-rT7qZnQtx5c0/y/KlYaGvtG411S97UaL6gdp6RIZ23DLHanMYLyfGBV5DtSnZdthQql7W+lEVbpSfwtO8T+L2w==",
+ "license": "MIT",
+ "dependencies": {
+ "prosemirror-model": "^1.0.0",
+ "prosemirror-state": "^1.0.0",
+ "prosemirror-transform": "^1.10.2"
+ }
+ },
+ "node_modules/prosemirror-dropcursor": {
+ "version": "1.8.2",
+ "license": "MIT",
+ "dependencies": {
+ "prosemirror-state": "^1.0.0",
+ "prosemirror-transform": "^1.1.0",
+ "prosemirror-view": "^1.1.0"
+ }
+ },
+ "node_modules/prosemirror-gapcursor": {
+ "version": "1.4.1",
+ "license": "MIT",
+ "dependencies": {
+ "prosemirror-keymap": "^1.0.0",
+ "prosemirror-model": "^1.0.0",
+ "prosemirror-state": "^1.0.0",
+ "prosemirror-view": "^1.0.0"
+ }
+ },
+ "node_modules/prosemirror-history": {
+ "version": "1.5.0",
+ "resolved": "https://registry.npmjs.org/prosemirror-history/-/prosemirror-history-1.5.0.tgz",
+ "integrity": "sha512-zlzTiH01eKA55UAf1MEjtssJeHnGxO0j4K4Dpx+gnmX9n+SHNlDqI2oO1Kv1iPN5B1dm5fsljCfqKF9nFL6HRg==",
+ "license": "MIT",
+ "dependencies": {
+ "prosemirror-state": "^1.2.2",
+ "prosemirror-transform": "^1.0.0",
+ "prosemirror-view": "^1.31.0",
+ "rope-sequence": "^1.3.0"
+ }
+ },
+ "node_modules/prosemirror-keymap": {
+ "version": "1.2.3",
+ "license": "MIT",
+ "dependencies": {
+ "prosemirror-state": "^1.0.0",
+ "w3c-keyname": "^2.2.0"
+ }
+ },
+ "node_modules/prosemirror-model": {
+ "version": "1.25.4",
+ "license": "MIT",
+ "dependencies": {
+ "orderedmap": "^2.0.0"
+ }
+ },
+ "node_modules/prosemirror-schema-list": {
+ "version": "1.5.1",
+ "license": "MIT",
+ "dependencies": {
+ "prosemirror-model": "^1.0.0",
+ "prosemirror-state": "^1.0.0",
+ "prosemirror-transform": "^1.7.3"
+ }
+ },
+ "node_modules/prosemirror-state": {
+ "version": "1.4.4",
+ "license": "MIT",
+ "dependencies": {
+ "prosemirror-model": "^1.0.0",
+ "prosemirror-transform": "^1.0.0",
+ "prosemirror-view": "^1.27.0"
+ }
+ },
+ "node_modules/prosemirror-tables": {
+ "version": "1.8.5",
+ "license": "MIT",
+ "dependencies": {
+ "prosemirror-keymap": "^1.2.3",
+ "prosemirror-model": "^1.25.4",
+ "prosemirror-state": "^1.4.4",
+ "prosemirror-transform": "^1.10.5",
+ "prosemirror-view": "^1.41.4"
+ }
+ },
+ "node_modules/prosemirror-transform": {
+ "version": "1.12.0",
+ "license": "MIT",
+ "dependencies": {
+ "prosemirror-model": "^1.21.0"
+ }
+ },
+ "node_modules/prosemirror-view": {
+ "version": "1.41.8",
+ "license": "MIT",
+ "dependencies": {
+ "prosemirror-model": "^1.20.0",
+ "prosemirror-state": "^1.0.0",
+ "prosemirror-transform": "^1.1.0"
+ }
+ },
+ "node_modules/protobufjs": {
+ "version": "7.5.5",
+ "hasInstallScript": true,
+ "license": "BSD-3-Clause",
+ "dependencies": {
+ "@protobufjs/aspromise": "^1.1.2",
+ "@protobufjs/base64": "^1.1.2",
+ "@protobufjs/codegen": "^2.0.4",
+ "@protobufjs/eventemitter": "^1.1.0",
+ "@protobufjs/fetch": "^1.1.0",
+ "@protobufjs/float": "^1.0.2",
+ "@protobufjs/inquire": "^1.1.0",
+ "@protobufjs/path": "^1.1.2",
+ "@protobufjs/pool": "^1.1.0",
+ "@protobufjs/utf8": "^1.1.0",
+ "@types/node": ">=13.7.0",
+ "long": "^5.0.0"
+ },
+ "engines": {
+ "node": ">=12.0.0"
+ }
+ },
+ "node_modules/proxy-addr": {
+ "version": "2.0.7",
+ "license": "MIT",
+ "dependencies": {
+ "forwarded": "0.2.0",
+ "ipaddr.js": "1.9.1"
+ },
+ "engines": {
+ "node": ">= 0.10"
+ }
+ },
+ "node_modules/proxy-addr/node_modules/ipaddr.js": {
+ "version": "1.9.1",
+ "license": "MIT",
+ "engines": {
+ "node": ">= 0.10"
+ }
+ },
+ "node_modules/proxy-from-env": {
+ "version": "2.1.0",
+ "resolved": "https://registry.npmjs.org/proxy-from-env/-/proxy-from-env-2.1.0.tgz",
+ "integrity": "sha512-cJ+oHTW1VAEa8cJslgmUZrc+sjRKgAKl3Zyse6+PV38hZe/V6Z14TbCuXcan9F9ghlz4QrFr2c92TNF82UkYHA==",
+ "license": "MIT",
+ "engines": {
+ "node": ">=10"
+ }
+ },
+ "node_modules/pump": {
+ "version": "3.0.4",
+ "license": "MIT",
+ "dependencies": {
+ "end-of-stream": "^1.1.0",
+ "once": "^1.3.1"
+ }
+ },
+ "node_modules/punycode": {
+ "version": "2.3.1",
+ "license": "MIT",
+ "engines": {
+ "node": ">=6"
+ }
+ },
+ "node_modules/pure-rand": {
+ "version": "6.1.0",
+ "funding": [
+ {
+ "type": "individual",
+ "url": "https://github.com/sponsors/dubzzz"
+ },
+ {
+ "type": "opencollective",
+ "url": "https://opencollective.com/fast-check"
+ }
+ ],
+ "license": "MIT"
+ },
+ "node_modules/pvtsutils": {
+ "version": "1.3.6",
+ "license": "MIT",
+ "dependencies": {
+ "tslib": "^2.8.1"
+ }
+ },
+ "node_modules/pvutils": {
+ "version": "1.1.5",
+ "license": "MIT",
+ "engines": {
+ "node": ">=16.0.0"
+ }
+ },
+ "node_modules/qs": {
+ "version": "6.15.1",
+ "license": "BSD-3-Clause",
+ "dependencies": {
+ "side-channel": "^1.1.0"
+ },
+ "engines": {
+ "node": ">=0.6"
+ },
+ "funding": {
+ "url": "https://github.com/sponsors/ljharb"
+ }
+ },
+ "node_modules/query-selector-shadow-dom": {
+ "version": "1.0.1",
+ "license": "MIT"
+ },
+ "node_modules/querystringify": {
+ "version": "2.2.0",
+ "license": "MIT"
+ },
+ "node_modules/queue-microtask": {
+ "version": "1.2.3",
+ "funding": [
+ {
+ "type": "github",
+ "url": "https://github.com/sponsors/feross"
+ },
+ {
+ "type": "patreon",
+ "url": "https://www.patreon.com/feross"
+ },
+ {
+ "type": "consulting",
+ "url": "https://feross.org/support"
+ }
+ ],
+ "license": "MIT"
+ },
+ "node_modules/quick-lru": {
+ "version": "7.3.0",
+ "license": "MIT",
+ "engines": {
+ "node": ">=18"
+ },
+ "funding": {
+ "url": "https://github.com/sponsors/sindresorhus"
+ }
+ },
+ "node_modules/range-parser": {
+ "version": "1.2.1",
"license": "MIT",
- "dependencies": {
- "loose-envify": "^1.4.0",
- "object-assign": "^4.1.1",
- "react-is": "^16.13.1"
+ "engines": {
+ "node": ">= 0.6"
}
},
- "node_modules/proper-lockfile": {
- "version": "4.1.2",
+ "node_modules/raw-body": {
+ "version": "3.0.2",
"license": "MIT",
"dependencies": {
- "graceful-fs": "^4.2.4",
- "retry": "^0.12.0",
- "signal-exit": "^3.0.2"
- }
- },
- "node_modules/proper-lockfile/node_modules/retry": {
- "version": "0.12.0",
- "license": "MIT",
+ "bytes": "~3.1.2",
+ "http-errors": "~2.0.1",
+ "iconv-lite": "~0.7.0",
+ "unpipe": "~1.0.0"
+ },
"engines": {
- "node": ">= 4"
+ "node": ">= 0.10"
}
},
- "node_modules/proper-lockfile/node_modules/signal-exit": {
- "version": "3.0.7",
- "license": "ISC"
- },
- "node_modules/property-information": {
- "version": "7.1.0",
+ "node_modules/raw-body/node_modules/iconv-lite": {
+ "version": "0.7.2",
"license": "MIT",
+ "dependencies": {
+ "safer-buffer": ">= 2.1.2 < 3.0.0"
+ },
+ "engines": {
+ "node": ">=0.10.0"
+ },
"funding": {
- "type": "github",
- "url": "https://github.com/sponsors/wooorm"
+ "type": "opencollective",
+ "url": "https://opencollective.com/express"
}
},
- "node_modules/prosemirror-changeset": {
- "version": "2.4.1",
- "license": "MIT",
+ "node_modules/rc": {
+ "version": "1.2.8",
+ "license": "(BSD-2-Clause OR MIT OR Apache-2.0)",
"dependencies": {
- "prosemirror-transform": "^1.0.0"
+ "deep-extend": "^0.6.0",
+ "ini": "~1.3.0",
+ "minimist": "^1.2.0",
+ "strip-json-comments": "~2.0.1"
+ },
+ "bin": {
+ "rc": "cli.js"
}
},
- "node_modules/prosemirror-commands": {
- "version": "1.7.1",
- "resolved": "https://registry.npmjs.org/prosemirror-commands/-/prosemirror-commands-1.7.1.tgz",
- "integrity": "sha512-rT7qZnQtx5c0/y/KlYaGvtG411S97UaL6gdp6RIZ23DLHanMYLyfGBV5DtSnZdthQql7W+lEVbpSfwtO8T+L2w==",
+ "node_modules/rc/node_modules/strip-json-comments": {
+ "version": "2.0.1",
"license": "MIT",
- "dependencies": {
- "prosemirror-model": "^1.0.0",
- "prosemirror-state": "^1.0.0",
- "prosemirror-transform": "^1.10.2"
+ "engines": {
+ "node": ">=0.10.0"
}
},
- "node_modules/prosemirror-dropcursor": {
- "version": "1.8.2",
+ "node_modules/rc9": {
+ "version": "2.1.2",
"license": "MIT",
"dependencies": {
- "prosemirror-state": "^1.0.0",
- "prosemirror-transform": "^1.1.0",
- "prosemirror-view": "^1.1.0"
+ "defu": "^6.1.4",
+ "destr": "^2.0.3"
}
},
- "node_modules/prosemirror-gapcursor": {
- "version": "1.4.1",
+ "node_modules/react": {
+ "version": "18.3.1",
"license": "MIT",
"dependencies": {
- "prosemirror-keymap": "^1.0.0",
- "prosemirror-model": "^1.0.0",
- "prosemirror-state": "^1.0.0",
- "prosemirror-view": "^1.0.0"
+ "loose-envify": "^1.1.0"
+ },
+ "engines": {
+ "node": ">=0.10.0"
}
},
- "node_modules/prosemirror-history": {
- "version": "1.5.0",
- "resolved": "https://registry.npmjs.org/prosemirror-history/-/prosemirror-history-1.5.0.tgz",
- "integrity": "sha512-zlzTiH01eKA55UAf1MEjtssJeHnGxO0j4K4Dpx+gnmX9n+SHNlDqI2oO1Kv1iPN5B1dm5fsljCfqKF9nFL6HRg==",
- "license": "MIT",
+ "node_modules/react-aria": {
+ "version": "3.48.0",
+ "license": "Apache-2.0",
"dependencies": {
- "prosemirror-state": "^1.2.2",
- "prosemirror-transform": "^1.0.0",
- "prosemirror-view": "^1.31.0",
- "rope-sequence": "^1.3.0"
+ "@internationalized/date": "^3.12.1",
+ "@internationalized/number": "^3.6.6",
+ "@internationalized/string": "^3.2.8",
+ "@react-types/shared": "^3.34.0",
+ "@swc/helpers": "^0.5.0",
+ "aria-hidden": "^1.2.3",
+ "clsx": "^2.0.0",
+ "react-stately": "3.46.0",
+ "use-sync-external-store": "^1.6.0"
+ },
+ "peerDependencies": {
+ "react": "^16.8.0 || ^17.0.0-rc.1 || ^18.0.0 || ^19.0.0-rc.1",
+ "react-dom": "^16.8.0 || ^17.0.0-rc.1 || ^18.0.0 || ^19.0.0-rc.1"
}
},
- "node_modules/prosemirror-keymap": {
- "version": "1.2.3",
+ "node_modules/react-colorful": {
+ "version": "5.7.0",
+ "resolved": "https://registry.npmjs.org/react-colorful/-/react-colorful-5.7.0.tgz",
+ "integrity": "sha512-fuesYIemttah97XmsIHmz4OORDHiSFzyc9HMAIrCHJou2jaRQmL8cFJ76K4zQhhj8jzwOBlOi4BaGTjjOZCfTg==",
"license": "MIT",
- "dependencies": {
- "prosemirror-state": "^1.0.0",
- "w3c-keyname": "^2.2.0"
+ "peerDependencies": {
+ "react": ">=16.8.0",
+ "react-dom": ">=16.8.0"
}
},
- "node_modules/prosemirror-model": {
- "version": "1.25.4",
+ "node_modules/react-day-picker": {
+ "version": "8.10.2",
+ "resolved": "https://registry.npmjs.org/react-day-picker/-/react-day-picker-8.10.2.tgz",
+ "integrity": "sha512-LK68OTbHB3oJNhl9cA0qVizzp3o26w61YSjAFkYi67N86iro32wx86kSNeFU/hq+gI8m1yzWhnomMLfZ041RzQ==",
"license": "MIT",
- "dependencies": {
- "orderedmap": "^2.0.0"
+ "funding": {
+ "type": "individual",
+ "url": "https://github.com/sponsors/gpbl"
+ },
+ "peerDependencies": {
+ "date-fns": "^2.28.0 || ^3.0.0",
+ "react": "^16.8.0 || ^17.0.0 || ^18.0.0 || ^19.0.0"
}
},
- "node_modules/prosemirror-schema-list": {
- "version": "1.5.1",
+ "node_modules/react-dom": {
+ "version": "18.3.1",
"license": "MIT",
"dependencies": {
- "prosemirror-model": "^1.0.0",
- "prosemirror-state": "^1.0.0",
- "prosemirror-transform": "^1.7.3"
+ "loose-envify": "^1.1.0",
+ "scheduler": "^0.23.2"
+ },
+ "peerDependencies": {
+ "react": "^18.3.1"
}
},
- "node_modules/prosemirror-state": {
- "version": "1.4.4",
+ "node_modules/react-draggable": {
+ "version": "4.5.0",
"license": "MIT",
"dependencies": {
- "prosemirror-model": "^1.0.0",
- "prosemirror-transform": "^1.0.0",
- "prosemirror-view": "^1.27.0"
+ "clsx": "^2.1.1",
+ "prop-types": "^15.8.1"
+ },
+ "peerDependencies": {
+ "react": ">= 16.3.0",
+ "react-dom": ">= 16.3.0"
}
},
- "node_modules/prosemirror-tables": {
- "version": "1.8.5",
+ "node_modules/react-dropzone": {
+ "version": "15.0.0",
+ "resolved": "https://registry.npmjs.org/react-dropzone/-/react-dropzone-15.0.0.tgz",
+ "integrity": "sha512-lGjYV/EoqEjEWPnmiSvH4v5IoIAwQM2W4Z1C0Q/Pw2xD0eVzKPS359BQTUMum+1fa0kH2nrKjuavmTPOGhpLPg==",
"license": "MIT",
"dependencies": {
- "prosemirror-keymap": "^1.2.3",
- "prosemirror-model": "^1.25.4",
- "prosemirror-state": "^1.4.4",
- "prosemirror-transform": "^1.10.5",
- "prosemirror-view": "^1.41.4"
+ "attr-accept": "^2.2.4",
+ "file-selector": "^2.1.0",
+ "prop-types": "^15.8.1"
+ },
+ "engines": {
+ "node": ">= 10.13"
+ },
+ "peerDependencies": {
+ "react": ">= 16.8 || 18.0.0"
}
},
- "node_modules/prosemirror-transform": {
- "version": "1.12.0",
+ "node_modules/react-email": {
+ "version": "6.1.1",
+ "resolved": "https://registry.npmjs.org/react-email/-/react-email-6.1.1.tgz",
+ "integrity": "sha512-5wITcaKhYPsW8IAx4d2zRCtKq0JJydxlH4qCfy1bltreRDIAbfJUdlW6gCiLMsFJN/QvC4r5adlIaqvJgRgXMw==",
"license": "MIT",
"dependencies": {
- "prosemirror-model": "^1.21.0"
+ "@babel/parser": "7.27.0",
+ "@babel/traverse": "7.27.0",
+ "@react-email/render": ">=2.0.8",
+ "chokidar": "^4.0.3",
+ "commander": "^13.0.0",
+ "conf": "^15.0.2",
+ "css-tree": "3.2.1",
+ "debounce": "^2.0.0",
+ "esbuild": "^0.28.0",
+ "glob": "^13.0.6",
+ "jiti": "2.4.2",
+ "log-symbols": "^7.0.0",
+ "marked": "^15.0.12",
+ "mime-types": "^3.0.0",
+ "normalize-path": "^3.0.0",
+ "nypm": "0.6.6",
+ "picospinner": "^3.0.0",
+ "prismjs": "^1.30.0",
+ "prompts": "2.4.2",
+ "socket.io": "^4.8.1",
+ "tailwindcss": "^4.1.18",
+ "tsconfig-paths": "4.2.0"
+ },
+ "bin": {
+ "email": "dist/cli/index.mjs"
+ },
+ "engines": {
+ "node": ">=20.0.0"
+ },
+ "peerDependencies": {
+ "react": "^18.0 || ^19.0 || ^19.0.0-rc",
+ "react-dom": "^18.0 || ^19.0 || ^19.0.0-rc"
}
},
- "node_modules/prosemirror-view": {
- "version": "1.41.8",
+ "node_modules/react-email/node_modules/@babel/parser": {
+ "version": "7.27.0",
"license": "MIT",
"dependencies": {
- "prosemirror-model": "^1.20.0",
- "prosemirror-state": "^1.0.0",
- "prosemirror-transform": "^1.1.0"
+ "@babel/types": "^7.27.0"
+ },
+ "bin": {
+ "parser": "bin/babel-parser.js"
+ },
+ "engines": {
+ "node": ">=6.0.0"
}
},
- "node_modules/protobufjs": {
- "version": "7.5.5",
- "hasInstallScript": true,
- "license": "BSD-3-Clause",
+ "node_modules/react-email/node_modules/@babel/traverse": {
+ "version": "7.27.0",
+ "license": "MIT",
"dependencies": {
- "@protobufjs/aspromise": "^1.1.2",
- "@protobufjs/base64": "^1.1.2",
- "@protobufjs/codegen": "^2.0.4",
- "@protobufjs/eventemitter": "^1.1.0",
- "@protobufjs/fetch": "^1.1.0",
- "@protobufjs/float": "^1.0.2",
- "@protobufjs/inquire": "^1.1.0",
- "@protobufjs/path": "^1.1.2",
- "@protobufjs/pool": "^1.1.0",
- "@protobufjs/utf8": "^1.1.0",
- "@types/node": ">=13.7.0",
- "long": "^5.0.0"
+ "@babel/code-frame": "^7.26.2",
+ "@babel/generator": "^7.27.0",
+ "@babel/parser": "^7.27.0",
+ "@babel/template": "^7.27.0",
+ "@babel/types": "^7.27.0",
+ "debug": "^4.3.1",
+ "globals": "^11.1.0"
},
"engines": {
- "node": ">=12.0.0"
+ "node": ">=6.9.0"
}
},
- "node_modules/proxy-addr": {
- "version": "2.0.7",
+ "node_modules/react-email/node_modules/@esbuild/aix-ppc64": {
+ "version": "0.28.0",
+ "resolved": "https://registry.npmjs.org/@esbuild/aix-ppc64/-/aix-ppc64-0.28.0.tgz",
+ "integrity": "sha512-lhRUCeuOyJQURhTxl4WkpFTjIsbDayJHih5kZC1giwE+MhIzAb7mEsQMqMf18rHLsrb5qI1tafG20mLxEWcWlA==",
+ "cpu": [
+ "ppc64"
+ ],
"license": "MIT",
- "dependencies": {
- "forwarded": "0.2.0",
- "ipaddr.js": "1.9.1"
- },
+ "optional": true,
+ "os": [
+ "aix"
+ ],
"engines": {
- "node": ">= 0.10"
+ "node": ">=18"
}
},
- "node_modules/proxy-addr/node_modules/ipaddr.js": {
- "version": "1.9.1",
+ "node_modules/react-email/node_modules/@esbuild/android-arm": {
+ "version": "0.28.0",
+ "resolved": "https://registry.npmjs.org/@esbuild/android-arm/-/android-arm-0.28.0.tgz",
+ "integrity": "sha512-wqh0ByljabXLKHeWXYLqoJ5jKC4XBaw6Hk08OfMrCRd2nP2ZQ5eleDZC41XHyCNgktBGYMbqnrJKq/K/lzPMSQ==",
+ "cpu": [
+ "arm"
+ ],
"license": "MIT",
+ "optional": true,
+ "os": [
+ "android"
+ ],
"engines": {
- "node": ">= 0.10"
+ "node": ">=18"
}
},
- "node_modules/proxy-from-env": {
- "version": "2.1.0",
- "resolved": "https://registry.npmjs.org/proxy-from-env/-/proxy-from-env-2.1.0.tgz",
- "integrity": "sha512-cJ+oHTW1VAEa8cJslgmUZrc+sjRKgAKl3Zyse6+PV38hZe/V6Z14TbCuXcan9F9ghlz4QrFr2c92TNF82UkYHA==",
+ "node_modules/react-email/node_modules/@esbuild/android-arm64": {
+ "version": "0.28.0",
+ "resolved": "https://registry.npmjs.org/@esbuild/android-arm64/-/android-arm64-0.28.0.tgz",
+ "integrity": "sha512-+WzIXQOSaGs33tLEgYPYe/yQHf0WTU0X42Jca3y8NWMbUVhp7rUnw+vAsRC/QiDrdD31IszMrZy+qwPOPjd+rw==",
+ "cpu": [
+ "arm64"
+ ],
"license": "MIT",
+ "optional": true,
+ "os": [
+ "android"
+ ],
"engines": {
- "node": ">=10"
+ "node": ">=18"
}
},
- "node_modules/pump": {
- "version": "3.0.4",
+ "node_modules/react-email/node_modules/@esbuild/android-x64": {
+ "version": "0.28.0",
+ "resolved": "https://registry.npmjs.org/@esbuild/android-x64/-/android-x64-0.28.0.tgz",
+ "integrity": "sha512-+VJggoaKhk2VNNqVL7f6S189UzShHC/mR9EE8rDdSkdpN0KflSwWY/gWjDrNxxisg8Fp1ZCD9jLMo4m0OUfeUA==",
+ "cpu": [
+ "x64"
+ ],
"license": "MIT",
- "dependencies": {
- "end-of-stream": "^1.1.0",
- "once": "^1.3.1"
+ "optional": true,
+ "os": [
+ "android"
+ ],
+ "engines": {
+ "node": ">=18"
}
},
- "node_modules/punycode": {
- "version": "2.3.1",
+ "node_modules/react-email/node_modules/@esbuild/darwin-arm64": {
+ "version": "0.28.0",
+ "resolved": "https://registry.npmjs.org/@esbuild/darwin-arm64/-/darwin-arm64-0.28.0.tgz",
+ "integrity": "sha512-0T+A9WZm+bZ84nZBtk1ckYsOvyA3x7e2Acj1KdVfV4/2tdG4fzUp91YHx+GArWLtwqp77pBXVCPn2We7Letr0Q==",
+ "cpu": [
+ "arm64"
+ ],
"license": "MIT",
+ "optional": true,
+ "os": [
+ "darwin"
+ ],
"engines": {
- "node": ">=6"
+ "node": ">=18"
}
},
- "node_modules/pure-rand": {
- "version": "6.1.0",
- "funding": [
- {
- "type": "individual",
- "url": "https://github.com/sponsors/dubzzz"
- },
- {
- "type": "opencollective",
- "url": "https://opencollective.com/fast-check"
- }
+ "node_modules/react-email/node_modules/@esbuild/darwin-x64": {
+ "version": "0.28.0",
+ "resolved": "https://registry.npmjs.org/@esbuild/darwin-x64/-/darwin-x64-0.28.0.tgz",
+ "integrity": "sha512-fyzLm/DLDl/84OCfp2f/XQ4flmORsjU7VKt8HLjvIXChJoFFOIL6pLJPH4Yhd1n1gGFF9mPwtlN5Wf82DZs+LQ==",
+ "cpu": [
+ "x64"
],
- "license": "MIT"
- },
- "node_modules/pvtsutils": {
- "version": "1.3.6",
"license": "MIT",
- "dependencies": {
- "tslib": "^2.8.1"
+ "optional": true,
+ "os": [
+ "darwin"
+ ],
+ "engines": {
+ "node": ">=18"
}
},
- "node_modules/pvutils": {
- "version": "1.1.5",
+ "node_modules/react-email/node_modules/@esbuild/freebsd-arm64": {
+ "version": "0.28.0",
+ "resolved": "https://registry.npmjs.org/@esbuild/freebsd-arm64/-/freebsd-arm64-0.28.0.tgz",
+ "integrity": "sha512-l9GeW5UZBT9k9brBYI+0WDffcRxgHQD8ShN2Ur4xWq/NFzUKm3k5lsH4PdaRgb2w7mI9u61nr2gI2mLI27Nh3Q==",
+ "cpu": [
+ "arm64"
+ ],
"license": "MIT",
+ "optional": true,
+ "os": [
+ "freebsd"
+ ],
"engines": {
- "node": ">=16.0.0"
+ "node": ">=18"
}
},
- "node_modules/qs": {
- "version": "6.15.1",
- "license": "BSD-3-Clause",
- "dependencies": {
- "side-channel": "^1.1.0"
- },
+ "node_modules/react-email/node_modules/@esbuild/freebsd-x64": {
+ "version": "0.28.0",
+ "resolved": "https://registry.npmjs.org/@esbuild/freebsd-x64/-/freebsd-x64-0.28.0.tgz",
+ "integrity": "sha512-BXoQai/A0wPO6Es3yFJ7APCiKGc1tdAEOgeTNy3SsB491S3aHn4S4r3e976eUnPdU+NbdtmBuLncYir2tMU9Nw==",
+ "cpu": [
+ "x64"
+ ],
+ "license": "MIT",
+ "optional": true,
+ "os": [
+ "freebsd"
+ ],
"engines": {
- "node": ">=0.6"
- },
- "funding": {
- "url": "https://github.com/sponsors/ljharb"
+ "node": ">=18"
}
},
- "node_modules/query-selector-shadow-dom": {
- "version": "1.0.1",
- "license": "MIT"
- },
- "node_modules/querystringify": {
- "version": "2.2.0",
- "license": "MIT"
- },
- "node_modules/queue-microtask": {
- "version": "1.2.3",
- "funding": [
- {
- "type": "github",
- "url": "https://github.com/sponsors/feross"
- },
- {
- "type": "patreon",
- "url": "https://www.patreon.com/feross"
- },
- {
- "type": "consulting",
- "url": "https://feross.org/support"
- }
+ "node_modules/react-email/node_modules/@esbuild/linux-arm": {
+ "version": "0.28.0",
+ "resolved": "https://registry.npmjs.org/@esbuild/linux-arm/-/linux-arm-0.28.0.tgz",
+ "integrity": "sha512-CjaaREJagqJp7iTaNQjjidaNbCKYcd4IDkzbwwxtSvjI7NZm79qiHc8HqciMddQ6CKvJT6aBd8lO9kN/ZudLlw==",
+ "cpu": [
+ "arm"
],
- "license": "MIT"
+ "license": "MIT",
+ "optional": true,
+ "os": [
+ "linux"
+ ],
+ "engines": {
+ "node": ">=18"
+ }
},
- "node_modules/quick-lru": {
- "version": "7.3.0",
+ "node_modules/react-email/node_modules/@esbuild/linux-arm64": {
+ "version": "0.28.0",
+ "resolved": "https://registry.npmjs.org/@esbuild/linux-arm64/-/linux-arm64-0.28.0.tgz",
+ "integrity": "sha512-RVyzfb3FWsGA55n6WY0MEIEPURL1FcbhFE6BffZEMEekfCzCIMtB5yyDcFnVbTnwk+CLAgTujmV/Lgvih56W+A==",
+ "cpu": [
+ "arm64"
+ ],
"license": "MIT",
+ "optional": true,
+ "os": [
+ "linux"
+ ],
"engines": {
"node": ">=18"
- },
- "funding": {
- "url": "https://github.com/sponsors/sindresorhus"
}
},
- "node_modules/range-parser": {
- "version": "1.2.1",
+ "node_modules/react-email/node_modules/@esbuild/linux-ia32": {
+ "version": "0.28.0",
+ "resolved": "https://registry.npmjs.org/@esbuild/linux-ia32/-/linux-ia32-0.28.0.tgz",
+ "integrity": "sha512-KBnSTt1kxl9x70q+ydterVdl+Cn0H18ngRMRCEQfrbqdUuntQQ0LoMZv47uB97NljZFzY6HcfqEZ2SAyIUTQBQ==",
+ "cpu": [
+ "ia32"
+ ],
"license": "MIT",
+ "optional": true,
+ "os": [
+ "linux"
+ ],
"engines": {
- "node": ">= 0.6"
+ "node": ">=18"
}
},
- "node_modules/raw-body": {
- "version": "3.0.2",
+ "node_modules/react-email/node_modules/@esbuild/linux-loong64": {
+ "version": "0.28.0",
+ "resolved": "https://registry.npmjs.org/@esbuild/linux-loong64/-/linux-loong64-0.28.0.tgz",
+ "integrity": "sha512-zpSlUce1mnxzgBADvxKXX5sl8aYQHo2ezvMNI8I0lbblJtp8V4odlm3Yzlj7gPyt3T8ReksE6bK+pT3WD+aJRg==",
+ "cpu": [
+ "loong64"
+ ],
"license": "MIT",
- "dependencies": {
- "bytes": "~3.1.2",
- "http-errors": "~2.0.1",
- "iconv-lite": "~0.7.0",
- "unpipe": "~1.0.0"
- },
+ "optional": true,
+ "os": [
+ "linux"
+ ],
"engines": {
- "node": ">= 0.10"
+ "node": ">=18"
}
},
- "node_modules/raw-body/node_modules/iconv-lite": {
- "version": "0.7.2",
+ "node_modules/react-email/node_modules/@esbuild/linux-mips64el": {
+ "version": "0.28.0",
+ "resolved": "https://registry.npmjs.org/@esbuild/linux-mips64el/-/linux-mips64el-0.28.0.tgz",
+ "integrity": "sha512-2jIfP6mmjkdmeTlsX/9vmdmhBmKADrWqN7zcdtHIeNSCH1SqIoNI63cYsjQR8J+wGa4Y5izRcSHSm8K3QWmk3w==",
+ "cpu": [
+ "mips64el"
+ ],
"license": "MIT",
- "dependencies": {
- "safer-buffer": ">= 2.1.2 < 3.0.0"
- },
+ "optional": true,
+ "os": [
+ "linux"
+ ],
"engines": {
- "node": ">=0.10.0"
- },
- "funding": {
- "type": "opencollective",
- "url": "https://opencollective.com/express"
+ "node": ">=18"
}
},
- "node_modules/rc": {
- "version": "1.2.8",
- "license": "(BSD-2-Clause OR MIT OR Apache-2.0)",
- "dependencies": {
- "deep-extend": "^0.6.0",
- "ini": "~1.3.0",
- "minimist": "^1.2.0",
- "strip-json-comments": "~2.0.1"
- },
- "bin": {
- "rc": "cli.js"
+ "node_modules/react-email/node_modules/@esbuild/linux-ppc64": {
+ "version": "0.28.0",
+ "resolved": "https://registry.npmjs.org/@esbuild/linux-ppc64/-/linux-ppc64-0.28.0.tgz",
+ "integrity": "sha512-bc0FE9wWeC0WBm49IQMPSPILRocGTQt3j5KPCA8os6VprfuJ7KD+5PzESSrJ6GmPIPJK965ZJHTUlSA6GNYEhg==",
+ "cpu": [
+ "ppc64"
+ ],
+ "license": "MIT",
+ "optional": true,
+ "os": [
+ "linux"
+ ],
+ "engines": {
+ "node": ">=18"
}
},
- "node_modules/rc/node_modules/strip-json-comments": {
- "version": "2.0.1",
+ "node_modules/react-email/node_modules/@esbuild/linux-riscv64": {
+ "version": "0.28.0",
+ "resolved": "https://registry.npmjs.org/@esbuild/linux-riscv64/-/linux-riscv64-0.28.0.tgz",
+ "integrity": "sha512-SQPZOwoTTT/HXFXQJG/vBX8sOFagGqvZyXcgLA3NhIqcBv1BJU1d46c0rGcrij2B56Z2rNiSLaZOYW5cUk7yLQ==",
+ "cpu": [
+ "riscv64"
+ ],
"license": "MIT",
+ "optional": true,
+ "os": [
+ "linux"
+ ],
"engines": {
- "node": ">=0.10.0"
+ "node": ">=18"
}
},
- "node_modules/rc9": {
- "version": "2.1.2",
+ "node_modules/react-email/node_modules/@esbuild/linux-s390x": {
+ "version": "0.28.0",
+ "resolved": "https://registry.npmjs.org/@esbuild/linux-s390x/-/linux-s390x-0.28.0.tgz",
+ "integrity": "sha512-SCfR0HN8CEEjnYnySJTd2cw0k9OHB/YFzt5zgJEwa+wL/T/raGWYMBqwDNAC6dqFKmJYZoQBRfHjgwLHGSrn3Q==",
+ "cpu": [
+ "s390x"
+ ],
"license": "MIT",
- "dependencies": {
- "defu": "^6.1.4",
- "destr": "^2.0.3"
+ "optional": true,
+ "os": [
+ "linux"
+ ],
+ "engines": {
+ "node": ">=18"
}
},
- "node_modules/react": {
- "version": "18.3.1",
+ "node_modules/react-email/node_modules/@esbuild/linux-x64": {
+ "version": "0.28.0",
+ "resolved": "https://registry.npmjs.org/@esbuild/linux-x64/-/linux-x64-0.28.0.tgz",
+ "integrity": "sha512-us0dSb9iFxIi8srnpl931Nvs65it/Jd2a2K3qs7fz2WfGPHqzfzZTfec7oxZJRNPXPnNYZtanmRc4AL/JwVzHQ==",
+ "cpu": [
+ "x64"
+ ],
"license": "MIT",
- "dependencies": {
- "loose-envify": "^1.1.0"
- },
+ "optional": true,
+ "os": [
+ "linux"
+ ],
"engines": {
- "node": ">=0.10.0"
+ "node": ">=18"
}
},
- "node_modules/react-aria": {
- "version": "3.48.0",
- "license": "Apache-2.0",
- "dependencies": {
- "@internationalized/date": "^3.12.1",
- "@internationalized/number": "^3.6.6",
- "@internationalized/string": "^3.2.8",
- "@react-types/shared": "^3.34.0",
- "@swc/helpers": "^0.5.0",
- "aria-hidden": "^1.2.3",
- "clsx": "^2.0.0",
- "react-stately": "3.46.0",
- "use-sync-external-store": "^1.6.0"
- },
- "peerDependencies": {
- "react": "^16.8.0 || ^17.0.0-rc.1 || ^18.0.0 || ^19.0.0-rc.1",
- "react-dom": "^16.8.0 || ^17.0.0-rc.1 || ^18.0.0 || ^19.0.0-rc.1"
+ "node_modules/react-email/node_modules/@esbuild/netbsd-arm64": {
+ "version": "0.28.0",
+ "resolved": "https://registry.npmjs.org/@esbuild/netbsd-arm64/-/netbsd-arm64-0.28.0.tgz",
+ "integrity": "sha512-CR/RYotgtCKwtftMwJlUU7xCVNg3lMYZ0RzTmAHSfLCXw3NtZtNpswLEj/Kkf6kEL3Gw+BpOekRX0BYCtklhUw==",
+ "cpu": [
+ "arm64"
+ ],
+ "license": "MIT",
+ "optional": true,
+ "os": [
+ "netbsd"
+ ],
+ "engines": {
+ "node": ">=18"
}
},
- "node_modules/react-colorful": {
- "version": "5.6.1",
+ "node_modules/react-email/node_modules/@esbuild/netbsd-x64": {
+ "version": "0.28.0",
+ "resolved": "https://registry.npmjs.org/@esbuild/netbsd-x64/-/netbsd-x64-0.28.0.tgz",
+ "integrity": "sha512-nU1yhmYutL+fQ71Kxnhg8uEOdC0pwEW9entHykTgEbna2pw2dkbFSMeqjjyHZoCmt8SBkOSvV+yNmm94aUrrqw==",
+ "cpu": [
+ "x64"
+ ],
"license": "MIT",
- "peerDependencies": {
- "react": ">=16.8.0",
- "react-dom": ">=16.8.0"
+ "optional": true,
+ "os": [
+ "netbsd"
+ ],
+ "engines": {
+ "node": ">=18"
}
},
- "node_modules/react-day-picker": {
- "version": "8.10.2",
- "resolved": "https://registry.npmjs.org/react-day-picker/-/react-day-picker-8.10.2.tgz",
- "integrity": "sha512-LK68OTbHB3oJNhl9cA0qVizzp3o26w61YSjAFkYi67N86iro32wx86kSNeFU/hq+gI8m1yzWhnomMLfZ041RzQ==",
+ "node_modules/react-email/node_modules/@esbuild/openbsd-arm64": {
+ "version": "0.28.0",
+ "resolved": "https://registry.npmjs.org/@esbuild/openbsd-arm64/-/openbsd-arm64-0.28.0.tgz",
+ "integrity": "sha512-cXb5vApOsRsxsEl4mcZ1XY3D4DzcoMxR/nnc4IyqYs0rTI8ZKmW6kyyg+11Z8yvgMfAEldKzP7AdP64HnSC/6g==",
+ "cpu": [
+ "arm64"
+ ],
"license": "MIT",
- "funding": {
- "type": "individual",
- "url": "https://github.com/sponsors/gpbl"
- },
- "peerDependencies": {
- "date-fns": "^2.28.0 || ^3.0.0",
- "react": "^16.8.0 || ^17.0.0 || ^18.0.0 || ^19.0.0"
+ "optional": true,
+ "os": [
+ "openbsd"
+ ],
+ "engines": {
+ "node": ">=18"
}
},
- "node_modules/react-dom": {
- "version": "18.3.1",
+ "node_modules/react-email/node_modules/@esbuild/openbsd-x64": {
+ "version": "0.28.0",
+ "resolved": "https://registry.npmjs.org/@esbuild/openbsd-x64/-/openbsd-x64-0.28.0.tgz",
+ "integrity": "sha512-8wZM2qqtv9UP3mzy7HiGYNH/zjTA355mpeuA+859TyR+e+Tc08IHYpLJuMsfpDJwoLo1ikIJI8jC3GFjnRClzA==",
+ "cpu": [
+ "x64"
+ ],
"license": "MIT",
- "dependencies": {
- "loose-envify": "^1.1.0",
- "scheduler": "^0.23.2"
- },
- "peerDependencies": {
- "react": "^18.3.1"
+ "optional": true,
+ "os": [
+ "openbsd"
+ ],
+ "engines": {
+ "node": ">=18"
}
},
- "node_modules/react-draggable": {
- "version": "4.5.0",
+ "node_modules/react-email/node_modules/@esbuild/openharmony-arm64": {
+ "version": "0.28.0",
+ "resolved": "https://registry.npmjs.org/@esbuild/openharmony-arm64/-/openharmony-arm64-0.28.0.tgz",
+ "integrity": "sha512-FLGfyizszcef5C3YtoyQDACyg95+dndv79i2EekILBofh5wpCa1KuBqOWKrEHZg3zrL3t5ouE5jgr94vA+Wb2w==",
+ "cpu": [
+ "arm64"
+ ],
"license": "MIT",
- "dependencies": {
- "clsx": "^2.1.1",
- "prop-types": "^15.8.1"
- },
- "peerDependencies": {
- "react": ">= 16.3.0",
- "react-dom": ">= 16.3.0"
+ "optional": true,
+ "os": [
+ "openharmony"
+ ],
+ "engines": {
+ "node": ">=18"
}
},
- "node_modules/react-dropzone": {
- "version": "14.4.1",
+ "node_modules/react-email/node_modules/@esbuild/sunos-x64": {
+ "version": "0.28.0",
+ "resolved": "https://registry.npmjs.org/@esbuild/sunos-x64/-/sunos-x64-0.28.0.tgz",
+ "integrity": "sha512-1ZgjUoEdHZZl/YlV76TSCz9Hqj9h9YmMGAgAPYd+q4SicWNX3G5GCyx9uhQWSLcbvPW8Ni7lj4gDa1T40akdlw==",
+ "cpu": [
+ "x64"
+ ],
"license": "MIT",
- "dependencies": {
- "attr-accept": "^2.2.4",
- "file-selector": "^2.1.0",
- "prop-types": "^15.8.1"
- },
+ "optional": true,
+ "os": [
+ "sunos"
+ ],
"engines": {
- "node": ">= 10.13"
- },
- "peerDependencies": {
- "react": ">= 16.8 || 18.0.0"
+ "node": ">=18"
}
},
- "node_modules/react-email": {
- "version": "5.2.11",
+ "node_modules/react-email/node_modules/@esbuild/win32-arm64": {
+ "version": "0.28.0",
+ "resolved": "https://registry.npmjs.org/@esbuild/win32-arm64/-/win32-arm64-0.28.0.tgz",
+ "integrity": "sha512-Q9StnDmQ/enxnpxCCLSg0oo4+34B9TdXpuyPeTedN/6+iXBJ4J+zwfQI28u/Jl40nOYAxGoNi7mFP40RUtkmUA==",
+ "cpu": [
+ "arm64"
+ ],
"license": "MIT",
- "dependencies": {
- "@babel/parser": "7.27.0",
- "@babel/traverse": "7.27.0",
- "chokidar": "^4.0.3",
- "commander": "^13.0.0",
- "conf": "^15.0.2",
- "debounce": "^2.0.0",
- "esbuild": "0.27.4",
- "glob": "^13.0.6",
- "jiti": "2.4.2",
- "log-symbols": "^7.0.0",
- "mime-types": "^3.0.0",
- "normalize-path": "^3.0.0",
- "nypm": "0.6.5",
- "ora": "^8.0.0",
- "prompts": "2.4.2",
- "socket.io": "^4.8.1",
- "tsconfig-paths": "4.2.0"
- },
- "bin": {
- "email": "dist/index.mjs"
- },
+ "optional": true,
+ "os": [
+ "win32"
+ ],
"engines": {
- "node": ">=20.0.0"
+ "node": ">=18"
}
},
- "node_modules/react-email/node_modules/@babel/parser": {
- "version": "7.27.0",
+ "node_modules/react-email/node_modules/@esbuild/win32-ia32": {
+ "version": "0.28.0",
+ "resolved": "https://registry.npmjs.org/@esbuild/win32-ia32/-/win32-ia32-0.28.0.tgz",
+ "integrity": "sha512-zF3ag/gfiCe6U2iczcRzSYJKH1DCI+ByzSENHlM2FcDbEeo5Zd2C86Aq0tKUYAJJ1obRP84ymxIAksZUcdztHA==",
+ "cpu": [
+ "ia32"
+ ],
"license": "MIT",
- "dependencies": {
- "@babel/types": "^7.27.0"
- },
- "bin": {
- "parser": "bin/babel-parser.js"
- },
+ "optional": true,
+ "os": [
+ "win32"
+ ],
"engines": {
- "node": ">=6.0.0"
+ "node": ">=18"
}
},
- "node_modules/react-email/node_modules/@babel/traverse": {
- "version": "7.27.0",
+ "node_modules/react-email/node_modules/@esbuild/win32-x64": {
+ "version": "0.28.0",
+ "resolved": "https://registry.npmjs.org/@esbuild/win32-x64/-/win32-x64-0.28.0.tgz",
+ "integrity": "sha512-pEl1bO9mfAmIC+tW5btTmrKaujg3zGtUmWNdCw/xs70FBjwAL3o9OEKNHvNmnyylD6ubxUERiEhdsL0xBQ9efw==",
+ "cpu": [
+ "x64"
+ ],
"license": "MIT",
- "dependencies": {
- "@babel/code-frame": "^7.26.2",
- "@babel/generator": "^7.27.0",
- "@babel/parser": "^7.27.0",
- "@babel/template": "^7.27.0",
- "@babel/types": "^7.27.0",
- "debug": "^4.3.1",
- "globals": "^11.1.0"
- },
+ "optional": true,
+ "os": [
+ "win32"
+ ],
"engines": {
- "node": ">=6.9.0"
+ "node": ">=18"
}
},
"node_modules/react-email/node_modules/balanced-match": {
@@ -22284,6 +22841,47 @@
"node": ">=10.2.0"
}
},
+ "node_modules/react-email/node_modules/esbuild": {
+ "version": "0.28.0",
+ "resolved": "https://registry.npmjs.org/esbuild/-/esbuild-0.28.0.tgz",
+ "integrity": "sha512-sNR9MHpXSUV/XB4zmsFKN+QgVG82Cc7+/aaxJ8Adi8hyOac+EXptIp45QBPaVyX3N70664wRbTcLTOemCAnyqw==",
+ "hasInstallScript": true,
+ "license": "MIT",
+ "bin": {
+ "esbuild": "bin/esbuild"
+ },
+ "engines": {
+ "node": ">=18"
+ },
+ "optionalDependencies": {
+ "@esbuild/aix-ppc64": "0.28.0",
+ "@esbuild/android-arm": "0.28.0",
+ "@esbuild/android-arm64": "0.28.0",
+ "@esbuild/android-x64": "0.28.0",
+ "@esbuild/darwin-arm64": "0.28.0",
+ "@esbuild/darwin-x64": "0.28.0",
+ "@esbuild/freebsd-arm64": "0.28.0",
+ "@esbuild/freebsd-x64": "0.28.0",
+ "@esbuild/linux-arm": "0.28.0",
+ "@esbuild/linux-arm64": "0.28.0",
+ "@esbuild/linux-ia32": "0.28.0",
+ "@esbuild/linux-loong64": "0.28.0",
+ "@esbuild/linux-mips64el": "0.28.0",
+ "@esbuild/linux-ppc64": "0.28.0",
+ "@esbuild/linux-riscv64": "0.28.0",
+ "@esbuild/linux-s390x": "0.28.0",
+ "@esbuild/linux-x64": "0.28.0",
+ "@esbuild/netbsd-arm64": "0.28.0",
+ "@esbuild/netbsd-x64": "0.28.0",
+ "@esbuild/openbsd-arm64": "0.28.0",
+ "@esbuild/openbsd-x64": "0.28.0",
+ "@esbuild/openharmony-arm64": "0.28.0",
+ "@esbuild/sunos-x64": "0.28.0",
+ "@esbuild/win32-arm64": "0.28.0",
+ "@esbuild/win32-ia32": "0.28.0",
+ "@esbuild/win32-x64": "0.28.0"
+ }
+ },
"node_modules/react-email/node_modules/glob": {
"version": "13.0.6",
"license": "BlueOak-1.0.0",
@@ -22366,6 +22964,12 @@
"node": ">=10.2.0"
}
},
+ "node_modules/react-email/node_modules/tailwindcss": {
+ "version": "4.3.0",
+ "resolved": "https://registry.npmjs.org/tailwindcss/-/tailwindcss-4.3.0.tgz",
+ "integrity": "sha512-y6nxMGB1nMW9R6k96e5gdIFzcfL/gTJRNaqGes1YvkLnPVXzWgbqFF2yLC0T8G774n24cx3Pe8XrKoniCOAH+Q==",
+ "license": "MIT"
+ },
"node_modules/react-email/node_modules/tsconfig-paths": {
"version": "4.2.0",
"license": "MIT",
@@ -22440,7 +23044,9 @@
}
},
"node_modules/react-intersection-observer": {
- "version": "9.16.0",
+ "version": "10.0.3",
+ "resolved": "https://registry.npmjs.org/react-intersection-observer/-/react-intersection-observer-10.0.3.tgz",
+ "integrity": "sha512-luICLMbs0zxTO/70Zy7K5jOXkABPEVSAF8T3FdZUlctsrIaPLmx8TZe2SSA+CY2HGWfz2INyNTnp82pxNNsShA==",
"license": "MIT",
"peerDependencies": {
"react": "^17.0.0 || ^18.0.0 || ^19.0.0",
@@ -22535,6 +23141,21 @@
"react-dom": ">=16.8.1"
}
},
+ "node_modules/react-notion-x/node_modules/react-intersection-observer": {
+ "version": "9.16.0",
+ "resolved": "https://registry.npmjs.org/react-intersection-observer/-/react-intersection-observer-9.16.0.tgz",
+ "integrity": "sha512-w9nJSEp+DrW9KmQmeWHQyfaP6b03v+TdXynaoA964Wxt7mdR3An11z4NNCQgL4gKSK7y1ver2Fq+JKH6CWEzUA==",
+ "license": "MIT",
+ "peerDependencies": {
+ "react": "^17.0.0 || ^18.0.0 || ^19.0.0",
+ "react-dom": "^17.0.0 || ^18.0.0 || ^19.0.0"
+ },
+ "peerDependenciesMeta": {
+ "react-dom": {
+ "optional": true
+ }
+ }
+ },
"node_modules/react-pdf": {
"version": "8.0.2",
"license": "MIT",
@@ -22632,11 +23253,13 @@
}
},
"node_modules/react-resizable-panels": {
- "version": "3.0.6",
+ "version": "4.11.0",
+ "resolved": "https://registry.npmjs.org/react-resizable-panels/-/react-resizable-panels-4.11.0.tgz",
+ "integrity": "sha512-LPk/AkFDGkg7SsbOyL93ojrE6E7lhrxxDwnYNjfmnSeI6BE7Sje6dB24PXgZk8DeugdeXNk1LO+ohRqIjhxiLw==",
"license": "MIT",
"peerDependencies": {
- "react": "^16.14.0 || ^17.0.0 || ^18.0.0 || ^19.0.0 || ^19.0.0-rc",
- "react-dom": "^16.14.0 || ^17.0.0 || ^18.0.0 || ^19.0.0 || ^19.0.0-rc"
+ "react": "^18.0.0 || ^19.0.0",
+ "react-dom": "^18.0.0 || ^19.0.0"
}
},
"node_modules/react-smooth": {
@@ -22725,7 +23348,9 @@
}
},
"node_modules/react-zoom-pan-pinch": {
- "version": "3.7.0",
+ "version": "4.0.3",
+ "resolved": "https://registry.npmjs.org/react-zoom-pan-pinch/-/react-zoom-pan-pinch-4.0.3.tgz",
+ "integrity": "sha512-N2Hi6L78fFmhRra+ORpFSW7WST5x6kxpOPplIvtB0b7b+U2anpo1z1wLgaWRPS2kUSqcraRG+JgBCIlDJnqqAg==",
"license": "MIT",
"engines": {
"node": ">=8",
@@ -23117,33 +23742,6 @@
"url": "https://github.com/privatenumber/resolve-pkg-maps?sponsor=1"
}
},
- "node_modules/restore-cursor": {
- "version": "5.1.0",
- "license": "MIT",
- "dependencies": {
- "onetime": "^7.0.0",
- "signal-exit": "^4.1.0"
- },
- "engines": {
- "node": ">=18"
- },
- "funding": {
- "url": "https://github.com/sponsors/sindresorhus"
- }
- },
- "node_modules/restore-cursor/node_modules/onetime": {
- "version": "7.0.0",
- "license": "MIT",
- "dependencies": {
- "mimic-function": "^5.0.0"
- },
- "engines": {
- "node": ">=18"
- },
- "funding": {
- "url": "https://github.com/sponsors/sindresorhus"
- }
- },
"node_modules/retry": {
"version": "0.13.1",
"license": "MIT",
@@ -23554,6 +24152,8 @@
},
"node_modules/sharp": {
"version": "0.34.5",
+ "resolved": "https://registry.npmjs.org/sharp/-/sharp-0.34.5.tgz",
+ "integrity": "sha512-Ou9I5Ft9WNcCbXrU9cMgPBcCK8LiwLqcbywW3t4oDV37n1pzpuNLsYiAV8eODnjbtQlSDwZ2cUEeQz4E54Hltg==",
"dev": true,
"hasInstallScript": true,
"license": "Apache-2.0",
@@ -23980,16 +24580,6 @@
"integrity": "sha512-5GS12FdOZNliM5mAOxFRg7Ir0pWz8MdpYm6AY6VPkGpbA7ZzmbzNcBJQ0GPvvyWgcY7QAhCgf9Uy89I03faLkg==",
"license": "MIT"
},
- "node_modules/stdin-discarder": {
- "version": "0.2.2",
- "license": "MIT",
- "engines": {
- "node": ">=18"
- },
- "funding": {
- "url": "https://github.com/sponsors/sindresorhus"
- }
- },
"node_modules/stop-iteration-iterator": {
"version": "1.1.0",
"license": "MIT",
@@ -25369,7 +25959,9 @@
}
},
"node_modules/undici-types": {
- "version": "6.21.0",
+ "version": "7.16.0",
+ "resolved": "https://registry.npmjs.org/undici-types/-/undici-types-7.16.0.tgz",
+ "integrity": "sha512-Zz+aZWSj8LE6zoxD+xrjh4VfkIG8Ya6LvYkZqtUQGJPZjYl53ypCaUwWqo7eI0x66KBGeRo+mlBEkMSeSZ38Nw==",
"license": "MIT"
},
"node_modules/unified": {
@@ -26349,6 +26941,8 @@
},
"node_modules/zip-stream": {
"version": "6.0.1",
+ "resolved": "https://registry.npmjs.org/zip-stream/-/zip-stream-6.0.1.tgz",
+ "integrity": "sha512-zK7YHHz4ZXpW89AHXUPbQVGKI7uvkd3hzusTdotCg1UxyaVtg0zFJSTfW/Dq5f7OBBVnq6cZIaC8Ti4hb6dtCA==",
"license": "MIT",
"dependencies": {
"archiver-utils": "^5.0.0",
diff --git a/package.json b/package.json
index 060543be..1b73c8bc 100644
--- a/package.json
+++ b/package.json
@@ -21,9 +21,9 @@
"generate:openapi": "tsx scripts/generate-openapi.ts"
},
"dependencies": {
- "@ai-sdk/google-vertex": "^4.0.124",
+ "@ai-sdk/google-vertex": "^4.0.125",
"@ai-sdk/openai": "^3.0.63",
- "@ai-sdk/react": "^3.0.178",
+ "@ai-sdk/react": "^3.0.179",
"@aws-sdk/client-lambda": "^3.1045.0",
"@aws-sdk/client-s3": "^3.1045.0",
"@aws-sdk/cloudfront-signer": "^3.1036.0",
@@ -67,8 +67,6 @@
"@radix-ui/react-toggle-group": "^1.1.11",
"@radix-ui/react-tooltip": "^1.2.8",
"@radix-ui/react-use-controllable-state": "^1.2.2",
- "@react-email/components": "^1.0.11",
- "@react-email/render": "^2.0.8",
"@sindresorhus/slugify": "^3.0.0",
"@stripe/stripe-js": "^4.10.0",
"@tailwindcss/typography": "^0.5.19",
@@ -92,8 +90,8 @@
"@upstash/redis": "^1.38.0",
"@vercel/blob": "^2.3.3",
"@vercel/edge-config": "^1.4.3",
- "@vercel/functions": "^3.5.0",
- "ai": "^6.0.176",
+ "@vercel/functions": "^3.5.1",
+ "ai": "^6.0.177",
"archiver": "^7.0.1",
"autoprefixer": "^10.4.27",
"base-x": "^5.0.1",
@@ -133,22 +131,22 @@
"postcss": "^8.5.14",
"posthog-js": "^1.372.10",
"react": "^18.3.1",
- "react-colorful": "^5.6.1",
+ "react-colorful": "^5.7.0",
"react-day-picker": "^8.10.2",
"react-dom": "^18.3.1",
"react-draggable": "^4.5.0",
- "react-dropzone": "^14.4.1",
- "react-email": "^5.2.10",
+ "react-dropzone": "^15.0.0",
+ "react-email": "^6.1.1",
"react-hook-form": "^7.75.0",
"react-hotkeys-hook": "^5.3.2",
- "react-intersection-observer": "^9.16.0",
+ "react-intersection-observer": "^10.0.3",
"react-markdown": "^10.1.0",
"react-notion-x": "^7.10.0",
"react-pdf": "^8.0.2",
"react-phone-number-input": "^3.4.16",
- "react-resizable-panels": "^3.0.6",
+ "react-resizable-panels": "^4.11.0",
"react-textarea-autosize": "^8.5.9",
- "react-zoom-pan-pinch": "^3.7.0",
+ "react-zoom-pan-pinch": "^4.0.3",
"resend": "^6.12.3",
"sanitize-html": "^2.17.3",
"shiki": "^3.23.0",
@@ -173,7 +171,7 @@
"zod": "^3.25.76"
},
"devDependencies": {
- "@react-email/preview-server": "^5.2.10",
+ "@react-email/ui": "^6.1.1",
"@tailwindcss/forms": "^0.5.11",
"@trigger.dev/build": "4.4.5",
"@trivago/prettier-plugin-sort-imports": "^6.0.2",
@@ -184,7 +182,7 @@
"@types/jsonwebtoken": "^9.0.7",
"@types/mime-types": "^3.0.1",
"@types/ms": "^2.1.0",
- "@types/node": "^22.13.5",
+ "@types/node": "^24.12.3",
"@types/oidc-provider": "^9.5.0",
"@types/react": "^18",
"@types/react-dom": "^18",
@@ -218,4 +216,4 @@
"tar": "7.5.10",
"lodash": "4.18.1"
}
-}
\ No newline at end of file
+}
diff --git a/pages/api/jobs/get-thumbnail.ts b/pages/api/jobs/get-thumbnail.ts
index 9e090599..53d314f7 100644
--- a/pages/api/jobs/get-thumbnail.ts
+++ b/pages/api/jobs/get-thumbnail.ts
@@ -22,8 +22,9 @@ export default async function handle(
return res.status(401).end("Unauthorized");
}
+ const userId = (session.user as CustomUser).id;
const { success } = await ratelimit(150, "1 m").limit(
- `get-thumbnail:${(session.user as CustomUser).id}`,
+ `get-thumbnail:${userId}`,
);
if (!success) {
return res.status(429).json({ message: "Too many requests" });
@@ -36,11 +37,17 @@ export default async function handle(
};
try {
- const imageUrl = await getFileForDocumentPage(
- Number(pageNumber),
+ const parsedVersionNumber =
+ versionNumber && versionNumber !== "undefined"
+ ? Number(versionNumber)
+ : undefined;
+
+ const imageUrl = await getFileForDocumentPage({
+ pageNumber: Number(pageNumber),
documentId,
- versionNumber === "undefined" ? undefined : Number(versionNumber),
- );
+ userId,
+ versionNumber: parsedVersionNumber,
+ });
return res.status(200).json({ imageUrl });
} catch (error) {
diff --git a/pages/api/links/download/bulk.ts b/pages/api/links/download/bulk.ts
index 9eaf6108..9481c2d9 100644
--- a/pages/api/links/download/bulk.ts
+++ b/pages/api/links/download/bulk.ts
@@ -2,7 +2,7 @@ import { NextApiRequest, NextApiResponse } from "next";
import { ViewType } from "@prisma/client";
-import { verifyDataroomSessionInPagesRouter } from "@/lib/auth/dataroom-auth";
+import { getDataroomSessionByLinkIdInPagesRouter } from "@/lib/auth/dataroom-auth";
import prisma from "@/lib/prisma";
import { downloadJobStore } from "@/lib/redis-download-job-store";
import { bulkDownloadTask } from "@/lib/trigger/bulk-download";
@@ -24,9 +24,8 @@ export default async function handle(
return res.status(405).end(`Method ${req.method} Not Allowed`);
}
- const { linkId, viewId, emailNotification } = req.body as {
+ const { linkId, emailNotification } = req.body as {
linkId: string;
- viewId: string;
emailNotification?: boolean;
};
@@ -34,14 +33,15 @@ export default async function handle(
return res.status(400).json({ error: "linkId is required" });
}
- if (typeof viewId !== "string" || !viewId.trim()) {
- return res.status(400).json({ error: "viewId is required" });
- }
-
try {
+ const session = await getDataroomSessionByLinkIdInPagesRouter(req, linkId);
+ if (!session) {
+ return res.status(401).json({ error: "Session required to download" });
+ }
+
const view = await prisma.view.findUnique({
where: {
- id: viewId,
+ id: session.viewId,
linkId: linkId,
viewType: { equals: ViewType.DATAROOM_VIEW },
},
@@ -80,13 +80,8 @@ export default async function handle(
}
const dataroomId = view.dataroom?.id;
- const session = await verifyDataroomSessionInPagesRouter(
- req,
- linkId,
- dataroomId ?? "",
- );
- if (!session) {
- return res.status(401).json({ error: "Session required to download" });
+ if (!dataroomId || session.dataroomId !== dataroomId) {
+ return res.status(403).json({ error: "Error downloading" });
}
if (emailNotification) {
diff --git a/pages/api/links/download/by-email.ts b/pages/api/links/download/by-email.ts
deleted file mode 100644
index 20521d22..00000000
--- a/pages/api/links/download/by-email.ts
+++ /dev/null
@@ -1,51 +0,0 @@
-import { NextApiRequest, NextApiResponse } from "next";
-
-import { getDataroomSessionByLinkIdInPagesRouter } from "@/lib/auth/dataroom-auth";
-import prisma from "@/lib/prisma";
-import { ratelimit } from "@/lib/redis";
-import { getIpAddress } from "@/lib/utils/ip";
-
-export default async function handler(
- req: NextApiRequest,
- res: NextApiResponse,
-) {
- if (req.method !== "POST") {
- res.setHeader("Allow", ["POST"]);
- return res.status(405).end(`Method ${req.method} Not Allowed`);
- }
-
- // 1. IP-based rate limiting (same pattern as OTP endpoints in verify.ts)
- const ipAddress = getIpAddress(req.headers) ?? "unknown";
- const { success } = await ratelimit(10, "1 m").limit(
- `download-by-email-ip:${ipAddress}`,
- );
- if (!success) {
- return res
- .status(429)
- .json({ error: "Too many requests. Try again later." });
- }
-
- const { linkId, email } = req.body as { linkId?: string; email?: string };
- if (!linkId || !email) {
- return res.status(400).json({ error: "linkId and email are required" });
- }
-
- // 2. Require a valid dataroom session
- const session = await getDataroomSessionByLinkIdInPagesRouter(req, linkId);
- if (!session) {
- return res.status(401).json({ error: "Session required" });
- }
-
- // 3. Prevent email enumeration — always return 200 with uniform body
- const view = await prisma.view.findFirst({
- where: {
- linkId,
- viewType: "DATAROOM_VIEW",
- viewerEmail: { equals: email, mode: "insensitive" },
- },
- select: { id: true },
- orderBy: { viewedAt: "desc" },
- });
-
- return res.status(200).json({ viewId: view?.id ?? null });
-}
diff --git a/pages/api/links/download/dataroom-document.ts b/pages/api/links/download/dataroom-document.ts
index e440e238..bfc656ed 100644
--- a/pages/api/links/download/dataroom-document.ts
+++ b/pages/api/links/download/dataroom-document.ts
@@ -3,6 +3,7 @@ import { NextApiRequest, NextApiResponse } from "next";
import { ItemType, ViewType } from "@prisma/client";
import { waitUntil } from "@vercel/functions";
+import { getDataroomSessionByLinkIdInPagesRouter } from "@/lib/auth/dataroom-auth";
import { getFile } from "@/lib/files/get-file";
import { notifyDocumentDownload } from "@/lib/integrations/slack/events";
import prisma from "@/lib/prisma";
@@ -23,16 +24,23 @@ export default async function handle(
) {
if (req.method === "POST") {
// POST /api/links/download/dataroom-document
- const { linkId, viewId, documentId } = req.body as {
+ const { linkId, documentId } = req.body as {
linkId: string;
- viewId: string;
documentId: string;
};
try {
+ const session = await getDataroomSessionByLinkIdInPagesRouter(
+ req,
+ linkId,
+ );
+ if (!session) {
+ return res.status(401).json({ error: "Session required to download" });
+ }
+
const view = await prisma.view.findUnique({
where: {
- id: viewId,
+ id: session.viewId,
linkId: linkId,
viewType: { equals: ViewType.DATAROOM_VIEW },
},
@@ -48,6 +56,7 @@ export default async function handle(
expiresAt: true,
isArchived: true,
deletedAt: true,
+ emailAuthenticated: true,
enableWatermark: true,
watermarkConfig: true,
name: true,
@@ -94,6 +103,19 @@ export default async function handle(
return res.status(404).json({ error: "Error downloading" });
}
+ // if dataroom does not exist, we should not allow the download
+ if (!view.dataroom) {
+ return res.status(404).json({ error: "Error downloading" });
+ }
+
+ if (session.dataroomId !== view.dataroom.id) {
+ return res.status(403).json({ error: "Error downloading" });
+ }
+
+ if (view.link.emailAuthenticated && !session.verified) {
+ return res.status(403).json({ error: "Error downloading" });
+ }
+
// if link does not allow download, we should not allow the download
if (!view.link.allowDownload) {
return res.status(403).json({ error: "Error downloading" });
@@ -114,11 +136,6 @@ export default async function handle(
return res.status(403).json({ error: "Error downloading" });
}
- // if dataroom does not exist, we should not allow the download
- if (!view.dataroom) {
- return res.status(404).json({ error: "Error downloading" });
- }
-
// if viewedAt is longer than 23 hours ago, we should not allow the download
if (
view.viewedAt &&
diff --git a/pages/api/links/download/dataroom-folder.ts b/pages/api/links/download/dataroom-folder.ts
index 9c66c47b..2984bc9c 100644
--- a/pages/api/links/download/dataroom-folder.ts
+++ b/pages/api/links/download/dataroom-folder.ts
@@ -25,11 +25,10 @@ export default async function handler(
}
try {
- const { folderId, dataroomId, viewId, linkId, emailNotification } =
+ const { folderId, dataroomId, linkId, emailNotification } =
req.body as {
folderId: string;
dataroomId: string;
- viewId: string;
linkId: string;
emailNotification?: boolean;
};
@@ -39,9 +38,18 @@ export default async function handler(
.json({ error: "folderId is required in request body" });
}
+ const session = await verifyDataroomSessionInPagesRouter(
+ req,
+ linkId,
+ dataroomId,
+ );
+ if (!session) {
+ return res.status(401).json({ error: "Session required to download" });
+ }
+
const view = await prisma.view.findUnique({
where: {
- id: viewId,
+ id: session.viewId,
linkId: linkId,
viewType: { equals: ViewType.DATAROOM_VIEW },
},
@@ -72,15 +80,6 @@ export default async function handler(
return res.status(404).json({ error: "Error downloading" });
}
- const session = await verifyDataroomSessionInPagesRouter(
- req,
- linkId,
- dataroomId,
- );
- if (!session) {
- return res.status(401).json({ error: "Session required to download" });
- }
-
// Verified session and email are only required when the viewer requested email notification
if (emailNotification) {
if (!view.viewerEmail) {
diff --git a/pages/api/links/download/index.ts b/pages/api/links/download/index.ts
index e7cd3f35..205f85fa 100644
--- a/pages/api/links/download/index.ts
+++ b/pages/api/links/download/index.ts
@@ -2,6 +2,8 @@ import { NextApiRequest, NextApiResponse } from "next";
import { LinkType } from "@prisma/client";
+import { verifyDataroomSessionInPagesRouter } from "@/lib/auth/dataroom-auth";
+import { verifyLinkSessionInPagesRouter } from "@/lib/auth/link-session";
import { getFile } from "@/lib/files/get-file";
import { notifyDocumentDownload } from "@/lib/integrations/slack/events";
import prisma from "@/lib/prisma";
@@ -33,11 +35,14 @@ export default async function handle(
},
select: {
id: true,
+ dataroomId: true,
+ dataroomViewId: true,
viewedAt: true,
viewerEmail: true,
link: {
select: {
linkType: true,
+ emailAuthenticated: true,
allowDownload: true,
expiresAt: true,
isArchived: true,
@@ -75,6 +80,46 @@ export default async function handle(
return res.status(404).json({ error: "Error downloading" });
}
+ if (view.link.linkType === LinkType.DATAROOM_LINK) {
+ const session = await verifyDataroomSessionInPagesRouter(
+ req,
+ linkId,
+ view.dataroomId ?? "",
+ );
+ if (!session) {
+ return res
+ .status(401)
+ .json({ error: "Session required to download" });
+ }
+
+ if (!view.dataroomViewId || session.viewId !== view.dataroomViewId) {
+ return res.status(403).json({ error: "Error downloading" });
+ }
+
+ if (view.link.emailAuthenticated && !session.verified) {
+ return res.status(403).json({ error: "Error downloading" });
+ }
+ } else if (view.link.linkType === LinkType.DOCUMENT_LINK) {
+ const session = await verifyLinkSessionInPagesRouter(req, linkId);
+ if (!session) {
+ return res
+ .status(401)
+ .json({ error: "Session required to download" });
+ }
+
+ if (
+ session.linkType !== LinkType.DOCUMENT_LINK ||
+ session.viewId !== view.id ||
+ session.documentId !== view.document?.id
+ ) {
+ return res.status(403).json({ error: "Error downloading" });
+ }
+
+ if (view.link.emailAuthenticated && !session.verified) {
+ return res.status(403).json({ error: "Error downloading" });
+ }
+ }
+
// if document is downloadOnly, always allow. Otherwise, check link settings.
if (!view.document?.downloadOnly && !view.link.allowDownload) {
return res.status(403).json({ error: "Error downloading" });
diff --git a/pages/api/teams/[teamId]/billing/index.ts b/pages/api/teams/[teamId]/billing/index.ts
deleted file mode 100644
index 7fead2d1..00000000
--- a/pages/api/teams/[teamId]/billing/index.ts
+++ /dev/null
@@ -1,54 +0,0 @@
-import { NextApiRequest, NextApiResponse } from "next";
-
-import { getServerSession } from "next-auth/next";
-
-import { errorhandler } from "@/lib/errorHandler";
-import prisma from "@/lib/prisma";
-import { CustomUser } from "@/lib/types";
-
-import { authOptions } from "../../../auth/[...nextauth]";
-
-export default async function handle(
- req: NextApiRequest,
- res: NextApiResponse,
-) {
- if (req.method === "GET") {
- // POST /api/teams/:teamId/billing – get user's subscription info
- const session = await getServerSession(req, res, authOptions);
- if (!session) {
- res.status(401).end("Unauthorized");
- return;
- }
-
- const { teamId } = req.query as { teamId: string };
-
- try {
- const team = await prisma.team.findUnique({
- where: {
- id: teamId,
- },
- select: {
- id: true,
- subscriptionId: true,
- startsAt: true,
- endsAt: true,
- plan: true,
- _count: {
- select: {
- documents: true,
- },
- },
- },
- });
- if (!team) {
- return res.status(400).json({ error: "Team does not exists" });
- }
- return res.status(200).json(team);
- } catch (error) {
- errorhandler(error, res);
- }
- } else {
- res.setHeader("Allow", ["GET"]);
- return res.status(405).end(`Method ${req.method} Not Allowed`);
- }
-}
diff --git a/pages/api/teams/[teamId]/datarooms/[id]/generate-index.ts b/pages/api/teams/[teamId]/datarooms/[id]/generate-index.ts
index c51d69b4..5a448971 100644
--- a/pages/api/teams/[teamId]/datarooms/[id]/generate-index.ts
+++ b/pages/api/teams/[teamId]/datarooms/[id]/generate-index.ts
@@ -99,7 +99,13 @@ export default async function handle(
},
});
- if (!link || !link.dataroom || link.dataroom.id !== dataroomId) {
+ if (
+ !link ||
+ !link.dataroom ||
+ link.dataroom.id !== dataroomId ||
+ link.teamId !== teamId ||
+ link.dataroom.teamId !== teamId
+ ) {
return res.status(404).json({ error: "Link not found" });
}
diff --git a/pages/api/teams/[teamId]/datarooms/[id]/groups/[groupId]/index.ts b/pages/api/teams/[teamId]/datarooms/[id]/groups/[groupId]/index.ts
index ed30ef51..9ca5ec85 100644
--- a/pages/api/teams/[teamId]/datarooms/[id]/groups/[groupId]/index.ts
+++ b/pages/api/teams/[teamId]/datarooms/[id]/groups/[groupId]/index.ts
@@ -48,6 +48,7 @@ export default async function handle(
where: {
id: groupId,
dataroomId: dataroomId,
+ teamId: teamId,
},
include: {
members: {
@@ -71,6 +72,10 @@ export default async function handle(
},
});
+ if (!group) {
+ return res.status(404).end("Group not found");
+ }
+
return res.status(200).json(group);
} catch (error) {
log({
@@ -177,22 +182,25 @@ export default async function handle(
return res.status(401).end("Unauthorized");
}
- // delete links associated with the group
- await prisma.link.deleteMany({
- where: {
- groupId: groupId,
- dataroomId: dataroomId,
- },
- });
+ await prisma.$transaction([
+ // delete links associated with the group
+ prisma.link.deleteMany({
+ where: {
+ groupId: groupId,
+ dataroomId: dataroomId,
+ teamId: teamId,
+ },
+ }),
- // delete group
- await prisma.viewerGroup.delete({
- where: {
- id: groupId,
- dataroomId: dataroomId,
- teamId: teamId,
- },
- });
+ // delete group
+ prisma.viewerGroup.delete({
+ where: {
+ id: groupId,
+ dataroomId: dataroomId,
+ teamId: teamId,
+ },
+ }),
+ ]);
res.status(200).json({ success: true });
return;
diff --git a/pages/api/teams/[teamId]/datarooms/[id]/groups/[groupId]/links.ts b/pages/api/teams/[teamId]/datarooms/[id]/groups/[groupId]/links.ts
index ecfc6975..45358da9 100644
--- a/pages/api/teams/[teamId]/datarooms/[id]/groups/[groupId]/links.ts
+++ b/pages/api/teams/[teamId]/datarooms/[id]/groups/[groupId]/links.ts
@@ -31,28 +31,38 @@ export default async function handle(
const userId = (session.user as CustomUser).id;
try {
- const team = await prisma.team.findUnique({
+ const teamAccess = await prisma.userTeam.findUnique({
where: {
- id: teamId,
- users: {
- some: {
- userId: (session.user as CustomUser).id,
- },
+ userId_teamId: {
+ userId: userId,
+ teamId: teamId,
},
},
+ });
+ if (!teamAccess) {
+ return res.status(403).end("Unauthorized to access this team");
+ }
+
+ const group = await prisma.viewerGroup.findFirst({
+ where: {
+ id: groupId,
+ dataroomId,
+ teamId,
+ },
select: {
id: true,
},
});
- if (!team) {
- return res.status(403).end("Unauthorized to access this team");
+ if (!group) {
+ return res.status(404).json({ message: "Group not found" });
}
let links = await prisma.link.findMany({
where: {
- groupId: groupId,
- dataroomId: dataroomId,
+ groupId,
+ dataroomId,
+ teamId,
linkType: "DATAROOM_LINK",
deletedAt: null,
},
diff --git a/pages/api/teams/[teamId]/datarooms/[id]/index.ts b/pages/api/teams/[teamId]/datarooms/[id]/index.ts
index 3991b924..a601af85 100644
--- a/pages/api/teams/[teamId]/datarooms/[id]/index.ts
+++ b/pages/api/teams/[teamId]/datarooms/[id]/index.ts
@@ -166,6 +166,7 @@ export default async function handle(
const dataroom = await tx.dataroom.update({
where: {
id: dataroomId,
+ teamId: team.id,
},
data: {
...(name && { name }),
@@ -219,6 +220,11 @@ export default async function handle(
await tx.tagItem.deleteMany({
where: {
dataroomId: dataroomId,
+ dataroom: {
+ is: {
+ teamId: team.id,
+ },
+ },
itemType: "DATAROOM_TAG",
},
});
diff --git a/pages/api/teams/[teamId]/datarooms/[id]/reorder.ts b/pages/api/teams/[teamId]/datarooms/[id]/reorder.ts
index f73aca34..365dd479 100644
--- a/pages/api/teams/[teamId]/datarooms/[id]/reorder.ts
+++ b/pages/api/teams/[teamId]/datarooms/[id]/reorder.ts
@@ -4,6 +4,7 @@ import { authOptions } from "@/pages/api/auth/[...nextauth]";
import { getServerSession } from "next-auth/next";
import prisma from "@/lib/prisma";
+import { CustomUser } from "@/lib/types";
type OrderItem = {
id: string;
@@ -24,36 +25,102 @@ export default async function handler(
return res.status(401).end("Unauthorized");
}
- const { id: dataroomId } = req.query as { teamId: string; id: string };
+ const userId = (session.user as CustomUser).id;
+ const { teamId, id: dataroomId } = req.query as {
+ teamId: string;
+ id: string;
+ };
const newOrder: OrderItem[] = req.body;
if (
!Array.isArray(newOrder) ||
+ !teamId ||
!dataroomId ||
+ typeof teamId !== "string" ||
typeof dataroomId !== "string"
) {
return res.status(400).json({ message: "Invalid input" });
}
+ const isValidOrderItem = (item: unknown): item is OrderItem => {
+ if (!item || typeof item !== "object") {
+ return false;
+ }
+
+ const { id, category, orderIndex } = item as OrderItem;
+
+ return (
+ typeof id === "string" &&
+ id.length > 0 &&
+ (category === "folder" || category === "document") &&
+ Number.isInteger(orderIndex) &&
+ Number.isFinite(orderIndex)
+ );
+ };
+
+ if (!newOrder.every(isValidOrderItem)) {
+ return res.status(400).json({ message: "Invalid input" });
+ }
+
+ const seenKeys = new Set<string>();
+ for (const item of newOrder) {
+ const key = `${item.category}:${item.id}`;
+ if (seenKeys.has(key)) {
+ return res.status(400).json({ message: "Duplicate reorder entries" });
+ }
+ seenKeys.add(key);
+ }
+
try {
- await prisma.$transaction(async (prisma) => {
+ const team = await prisma.team.findUnique({
+ where: { id: teamId },
+ include: {
+ datarooms: {
+ where: { id: dataroomId },
+ },
+ users: {
+ where: {
+ role: { in: ["ADMIN", "MANAGER"] },
+ userId: userId,
+ },
+ },
+ },
+ });
+
+ if (!team || team.users.length === 0 || team.datarooms.length === 0) {
+ return res.status(403).end("Forbidden");
+ }
+
+ await prisma.$transaction(async (tx) => {
for (const item of newOrder) {
if (item.category === "folder") {
- await prisma.dataroomFolder.update({
- where: { id: item.id },
+ const updatedFolder = await tx.dataroomFolder.updateMany({
+ where: { id: item.id, dataroomId },
data: { orderIndex: item.orderIndex },
});
+
+ if (updatedFolder.count === 0) {
+ throw new Error("REORDER_ITEM_NOT_FOUND");
+ }
} else {
- await prisma.dataroomDocument.update({
- where: { id: item.id },
+ const updatedDocument = await tx.dataroomDocument.updateMany({
+ where: { id: item.id, dataroomId },
data: { orderIndex: item.orderIndex },
});
+
+ if (updatedDocument.count === 0) {
+ throw new Error("REORDER_ITEM_NOT_FOUND");
+ }
}
}
});
res.status(200).json({ message: "Order updated successfully" });
} catch (error) {
+ if (error instanceof Error && error.message === "REORDER_ITEM_NOT_FOUND") {
+ return res.status(404).json({ message: "Item not found" });
+ }
+
console.error("Error updating order:", error);
res.status(500).json({ message: "Error updating order" });
}
diff --git a/pages/api/teams/[teamId]/datarooms/[id]/stats.ts b/pages/api/teams/[teamId]/datarooms/[id]/stats.ts
index c6ca97f0..c5eb8126 100644
--- a/pages/api/teams/[teamId]/datarooms/[id]/stats.ts
+++ b/pages/api/teams/[teamId]/datarooms/[id]/stats.ts
@@ -57,12 +57,17 @@ export default async function handle(
const dataroom = await prisma.dataroom.findUnique({
where: {
id: dataroomId,
+ teamId,
},
include: {
views: true,
},
});
+ if (!dataroom) {
+ return res.status(404).end("Dataroom not found");
+ }
+
const users = await prisma.user.findMany({
where: {
teams: {
@@ -76,7 +81,7 @@ export default async function handle(
},
});
- const views = dataroom?.views;
+ const views = dataroom.views;
// if there are no views, return an empty array
if (!views) {
diff --git a/pages/api/teams/[teamId]/datarooms/create-from-folder.ts b/pages/api/teams/[teamId]/datarooms/create-from-folder.ts
index 0df43b84..d35220c7 100644
--- a/pages/api/teams/[teamId]/datarooms/create-from-folder.ts
+++ b/pages/api/teams/[teamId]/datarooms/create-from-folder.ts
@@ -15,13 +15,24 @@ interface FolderWithContents extends Folder {
childFolders: Omit<FolderWithContents, "parentId">[];
}
+class FolderAccessError extends Error {
+ statusCode = 404;
+
+ constructor() {
+ super("Folder not found");
+ this.name = "FolderAccessError";
+ }
+}
+
// Recursive function to fetch all folders, child folders, and documents
async function fetchFolderContents(
folderId: string,
+ teamId: string,
): Promise<FolderWithContents> {
- const folder = await prisma.folder.findUnique({
+ const folder = await prisma.folder.findFirst({
where: {
id: folderId,
+ teamId,
},
include: {
documents: true,
@@ -30,12 +41,26 @@ async function fetchFolderContents(
});
if (!folder) {
- throw new Error(`Folder with id ${folderId} not found`);
+ throw new FolderAccessError();
+ }
+
+ const hasCrossTeamDocument = folder.documents.some(
+ (document) => document.teamId !== teamId,
+ );
+ const hasCrossTeamChildFolder = folder.childFolders.some(
+ (childFolder) => childFolder.teamId !== teamId,
+ );
+
+ if (hasCrossTeamDocument || hasCrossTeamChildFolder) {
+ throw new FolderAccessError();
}
const childFolders = await Promise.all(
folder.childFolders.map(async (childFolder) => {
- const nestedChildFolders = await fetchFolderContents(childFolder.id);
+ const nestedChildFolders = await fetchFolderContents(
+ childFolder.id,
+ teamId,
+ );
return nestedChildFolders;
}),
);
@@ -128,6 +153,10 @@ export default async function handle(
const userId = (session.user as CustomUser).id;
try {
+ if (!folderId || typeof folderId !== "string") {
+ return res.status(400).json({ error: "Missing folderId" });
+ }
+
const team = await prisma.team.findUnique({
where: {
id: teamId,
@@ -181,7 +210,7 @@ export default async function handle(
}
// Fetch the folder structure
- const folderContents = await fetchFolderContents(folderId);
+ const folderContents = await fetchFolderContents(folderId, teamId);
// Create the data room
const pId = newId("dataroom");
@@ -220,6 +249,10 @@ export default async function handle(
res.status(201).json(dataroomWithCount);
} catch (error) {
+ if (error instanceof FolderAccessError) {
+ return res.status(error.statusCode).json({ error: error.message });
+ }
+
console.error("Request error", error);
res.status(500).json({ error: "Error creating dataroom" });
}
diff --git a/pages/api/teams/[teamId]/documents/[id]/add-to-dataroom.ts b/pages/api/teams/[teamId]/documents/[id]/add-to-dataroom.ts
index e0a5ece0..492c9a81 100644
--- a/pages/api/teams/[teamId]/documents/[id]/add-to-dataroom.ts
+++ b/pages/api/teams/[teamId]/documents/[id]/add-to-dataroom.ts
@@ -71,9 +71,9 @@ export default async function handle(
});
}
- // Fetch dataroom with AI settings
+ // Fetch dataroom with AI settings, scoped to the current team.
const dataroom = await prisma.dataroom.findUnique({
- where: { id: dataroomId },
+ where: { id: dataroomId, teamId },
select: {
id: true,
teamId: true,
@@ -119,7 +119,7 @@ export default async function handle(
dataroomDocument = await prisma.dataroomDocument.create({
data: {
documentId: docId,
- dataroomId,
+ dataroomId: dataroom.id,
},
});
} catch (error) {
@@ -178,10 +178,10 @@ export default async function handle(
metadata: fileMetadata,
},
{
- idempotencyKey: `ai-index-dataroom-${dataroomId}-${primaryVersion.id}`,
+ idempotencyKey: `ai-index-dataroom-${dataroom.id}-${primaryVersion.id}`,
tags: [
`team_${teamId}`,
- `dataroom_${dataroomId}`,
+ `dataroom_${dataroom.id}`,
`document_${document.id}`,
`version_${primaryVersion.id}`,
],
diff --git a/pages/api/teams/[teamId]/documents/[id]/change-orientation.ts b/pages/api/teams/[teamId]/documents/[id]/change-orientation.ts
index e8e6ba26..17056abc 100644
--- a/pages/api/teams/[teamId]/documents/[id]/change-orientation.ts
+++ b/pages/api/teams/[teamId]/documents/[id]/change-orientation.ts
@@ -1,13 +1,19 @@
import { NextApiRequest, NextApiResponse } from "next";
+import { Prisma } from "@prisma/client";
import { authOptions } from "@/pages/api/auth/[...nextauth]";
import { getServerSession } from "next-auth/next";
-import { version } from "os";
+import { z } from "zod";
import { errorhandler } from "@/lib/errorHandler";
import prisma from "@/lib/prisma";
import { CustomUser } from "@/lib/types";
+const changeOrientationSchema = z.object({
+ versionId: z.string().min(1, "versionId is required"),
+ isVertical: z.boolean(),
+});
+
export default async function handle(
req: NextApiRequest,
res: NextApiResponse,
@@ -20,10 +26,15 @@ export default async function handle(
}
const { teamId, id: docId } = req.query as { teamId: string; id: string };
- const { versionId, isVertical } = req.body as {
- versionId: string;
- isVertical: boolean;
- };
+
+ const parsed = changeOrientationSchema.safeParse(req.body);
+ if (!parsed.success) {
+ return res.status(400).json({
+ error: "Invalid input",
+ details: parsed.error.errors,
+ });
+ }
+ const { versionId, isVertical } = parsed.data;
const userId = (session.user as CustomUser).id;
@@ -53,14 +64,27 @@ export default async function handle(
return res.status(401).end("Unauthorized");
}
- await prisma.documentVersion.update({
- where: {
- id: versionId,
- },
- data: {
- isVertical,
- },
- });
+ try {
+ await prisma.documentVersion.update({
+ where: {
+ id: versionId,
+ documentId: docId,
+ },
+ data: {
+ isVertical,
+ },
+ });
+ } catch (err) {
+ if (
+ err instanceof Prisma.PrismaClientKnownRequestError &&
+ err.code === "P2025"
+ ) {
+ return res
+ .status(404)
+ .json({ message: "Document version not found" });
+ }
+ throw err;
+ }
await fetch(
`${process.env.NEXTAUTH_URL}/api/revalidate?secret=${process.env.REVALIDATE_TOKEN}&documentId=${docId}`,
diff --git a/pages/api/teams/[teamId]/documents/[id]/check-notion-accessibility.ts b/pages/api/teams/[teamId]/documents/[id]/check-notion-accessibility.ts
index 50734c36..385a85f0 100644
--- a/pages/api/teams/[teamId]/documents/[id]/check-notion-accessibility.ts
+++ b/pages/api/teams/[teamId]/documents/[id]/check-notion-accessibility.ts
@@ -48,6 +48,9 @@ export default async function handle(
where: {
documentId: documentId,
isPrimary: true,
+ document: {
+ teamId: teamId,
+ },
},
select: {
file: true,
diff --git a/pages/api/teams/[teamId]/documents/[id]/update-notion-url.ts b/pages/api/teams/[teamId]/documents/[id]/update-notion-url.ts
index a79dbd31..88493ec7 100644
--- a/pages/api/teams/[teamId]/documents/[id]/update-notion-url.ts
+++ b/pages/api/teams/[teamId]/documents/[id]/update-notion-url.ts
@@ -35,19 +35,15 @@ export default async function handle(
const notionUrl = validationResult.data;
try {
- // Check if user has access to the team
- const team = await prisma.team.findUnique({
+ const teamAccess = await prisma.userTeam.findUnique({
where: {
- id: teamId,
- users: {
- some: {
- userId: userId,
- },
+ userId_teamId: {
+ userId: userId,
+ teamId: teamId,
},
},
});
-
- if (!team) {
+ if (!teamAccess) {
return res.status(401).json({ message: "Unauthorized" });
}
@@ -55,6 +51,9 @@ export default async function handle(
where: {
documentId: documentId,
isPrimary: true,
+ document: {
+ teamId: teamId,
+ },
},
select: {
id: true,
@@ -84,10 +83,9 @@ export default async function handle(
}
// Update document version
- await prisma.documentVersion.updateMany({
+ await prisma.documentVersion.update({
where: {
- documentId: documentId,
- isPrimary: true,
+ id: documentVersion.id,
},
data: {
file: newUrl.toString(),
diff --git a/pages/api/teams/[teamId]/domains/[domain]/verify.ts b/pages/api/teams/[teamId]/domains/[domain]/verify.ts
index 66b776c9..ad5f5f9e 100644
--- a/pages/api/teams/[teamId]/domains/[domain]/verify.ts
+++ b/pages/api/teams/[teamId]/domains/[domain]/verify.ts
@@ -1,7 +1,9 @@
import { NextApiRequest, NextApiResponse } from "next";
import { waitUntil } from "@vercel/functions";
+import { getServerSession } from "next-auth/next";
+import { checkRateLimit, rateLimiters } from "@/ee/features/security";
import { trackAnalytics } from "@/lib/analytics";
import {
getConfigResponse,
@@ -9,114 +11,166 @@ import {
verifyDomain,
} from "@/lib/domains";
import prisma from "@/lib/prisma";
-import { DomainVerificationStatusProps } from "@/lib/types";
+import { CustomUser, DomainVerificationStatusProps } from "@/lib/types";
+
+import { authOptions } from "../../../../auth/[...nextauth]";
export default async function handle(
req: NextApiRequest,
res: NextApiResponse,
) {
+ if (req.method !== "GET") {
+ res.setHeader("Allow", ["GET"]);
+ return res.status(405).end(`Method ${req.method} Not Allowed`);
+ }
+
// GET /api/teams/:teamId/domains/[domain]/verify - get domain verification status
- if (req.method === "GET") {
- const { domain } = req.query as { domain: string };
- let status: DomainVerificationStatusProps = "Valid Configuration";
-
- const [domainJson, configJson] = await Promise.all([
- getDomainResponse(domain),
- getConfigResponse(domain),
- ]);
-
- if (domainJson?.error?.code === "not_found") {
- // domain not found on Vercel project
- status = "Domain Not Found";
- return res.status(200).json({
- status,
- response: { domainJson, configJson },
- });
- // unknown error
- } else if (domainJson.error) {
- status = "Unknown Error";
- return res.status(200).json({
- status,
- response: { domainJson, configJson },
- });
- }
+ const { teamId, domain } = req.query;
- /**
- * Domain has DNS conflicts
- */
- if (configJson?.conflicts.length > 0) {
- status = "Conflicting DNS Records";
- return res.status(200).json({
- status,
- response: { domainJson, configJson },
- });
- }
+ if (typeof teamId !== "string" || typeof domain !== "string") {
+ return res
+ .status(400)
+ .json({ error: "Invalid domain verification request" });
+ }
- /**
- * If domain is not verified, we try to verify now
- */
- if (!domainJson.verified) {
- status = "Pending Verification";
- const verificationJson = await verifyDomain(domain);
-
- // domain was just verified
- if (verificationJson && verificationJson.verified) {
- status = "Valid Configuration";
- }
-
- return res.status(200).json({
- status,
- response: { domainJson, configJson },
- });
- }
+ const session = await getServerSession(req, res, authOptions);
+ if (!session) {
+ return res.status(401).end("Unauthorized");
+ }
+
+ const userId = (session.user as CustomUser).id;
+
+ const teamAccess = await prisma.userTeam.findUnique({
+ where: {
+ userId_teamId: {
+ userId,
+ teamId,
+ },
+ },
+ select: {
+ teamId: true,
+ },
+ });
+
+ if (!teamAccess) {
+ return res.status(401).end("Unauthorized");
+ }
+
+ const currentDomain = await prisma.domain.findFirst({
+ where: {
+ slug: domain,
+ teamId,
+ },
+ select: {
+ id: true,
+ slug: true,
+ verified: true,
+ },
+ });
+
+ if (!currentDomain) {
+ return res.status(404).json("Domain not found");
+ }
+
+ const rateLimitResult = await checkRateLimit(
+ rateLimiters.domainVerification,
+ `${userId}:${teamId}`,
+ );
+
+ if (!rateLimitResult.success) {
+ return res.status(429).json({
+ error: "Too many domain verification requests. Please try again later.",
+ remaining: rateLimitResult.remaining,
+ });
+ }
+
+ const domainSlug = currentDomain.slug;
+ let status: DomainVerificationStatusProps = "Valid Configuration";
+
+ const [domainJson, configJson] = await Promise.all([
+ getDomainResponse(domainSlug),
+ getConfigResponse(domainSlug),
+ ]);
+
+ if (domainJson?.error?.code === "not_found") {
+ // domain not found on Vercel project
+ status = "Domain Not Found";
+ return res.status(200).json({
+ status,
+ response: { domainJson, configJson },
+ });
+ // unknown error
+ } else if (domainJson.error) {
+ status = "Unknown Error";
+ return res.status(200).json({
+ status,
+ response: { domainJson, configJson },
+ });
+ }
- if (!configJson.misconfigured) {
+ /**
+ * Domain has DNS conflicts
+ */
+ if (configJson?.conflicts.length > 0) {
+ status = "Conflicting DNS Records";
+ return res.status(200).json({
+ status,
+ response: { domainJson, configJson },
+ });
+ }
+
+ /**
+ * If domain is not verified, we try to verify now
+ */
+ if (!domainJson.verified) {
+ status = "Pending Verification";
+ const verificationJson = await verifyDomain(domainSlug);
+
+ // domain was just verified
+ if (verificationJson && verificationJson.verified) {
status = "Valid Configuration";
- const currentDomain = await prisma.domain.findUnique({
- where: {
- slug: domain,
- },
- select: {
- verified: true,
- },
- });
-
- const updatedDomain = await prisma.domain.update({
- where: {
- slug: domain,
- },
- data: {
- verified: true,
- lastChecked: new Date(),
- },
- select: {
- userId: true,
- verified: true,
- },
- });
-
- if (!currentDomain!.verified && updatedDomain.verified) {
- waitUntil(trackAnalytics({ event: "Domain Verified", slug: domain }));
- }
- } else {
- status = "Invalid Configuration";
- await prisma.domain.update({
- where: {
- slug: domain,
- },
- data: {
- verified: false,
- lastChecked: new Date(),
- },
- });
}
return res.status(200).json({
status,
response: { domainJson, configJson },
});
+ }
+
+ if (!configJson.misconfigured) {
+ status = "Valid Configuration";
+
+ const updatedDomain = await prisma.domain.update({
+ where: {
+ id: currentDomain.id,
+ },
+ data: {
+ verified: true,
+ lastChecked: new Date(),
+ },
+ select: {
+ verified: true,
+ },
+ });
+
+ if (!currentDomain.verified && updatedDomain.verified) {
+ waitUntil(trackAnalytics({ event: "Domain Verified", slug: domainSlug }));
+ }
} else {
- res.setHeader("Allow", ["GET"]);
- return res.status(405).end(`Method ${req.method} Not Allowed`);
+ status = "Invalid Configuration";
+ await prisma.domain.update({
+ where: {
+ id: currentDomain.id,
+ },
+ data: {
+ verified: false,
+ lastChecked: new Date(),
+ },
+ });
}
+
+ return res.status(200).json({
+ status,
+ response: { domainJson, configJson },
+ });
}
diff --git a/pages/api/teams/[teamId]/invitations/index.ts b/pages/api/teams/[teamId]/invitations/index.ts
index 8323aa6d..5765f0c4 100644
--- a/pages/api/teams/[teamId]/invitations/index.ts
+++ b/pages/api/teams/[teamId]/invitations/index.ts
@@ -81,6 +81,10 @@ export default async function handle(
return res.status(403).json("You are not part of this team");
}
+ if (userTeam.role !== "ADMIN") {
+ return res.status(403).json("Only admins can revoke invitations");
+ }
+
// delete invitation
await prisma.invitation.delete({
where: {
diff --git a/pages/api/teams/[teamId]/remove-teammate.ts b/pages/api/teams/[teamId]/remove-teammate.ts
index 1449d846..da99d657 100644
--- a/pages/api/teams/[teamId]/remove-teammate.ts
+++ b/pages/api/teams/[teamId]/remove-teammate.ts
@@ -39,8 +39,23 @@ export default async function handle(
return res.status(401).json("Unauthorized");
}
- if (userTeam?.role === "ADMIN" && userTeam.userId === userToBeDeleted) {
- return res.status(401).json("You can't remove the Admin");
+ const isSelfRemoval = userTeam.userId === userToBeDeleted;
+
+ if (!isSelfRemoval && userTeam.role !== "ADMIN") {
+ return res.status(403).json("Only admins can remove teammates");
+ }
+
+ if (isSelfRemoval && userTeam.role === "ADMIN") {
+ const adminCount = await prisma.userTeam.count({
+ where: {
+ teamId,
+ role: "ADMIN",
+ },
+ });
+
+ if (adminCount <= 1) {
+ return res.status(403).json("You can't remove the last admin");
+ }
}
await Promise.all([
diff --git a/pages/api/webhooks/services/[...path]/index.ts b/pages/api/webhooks/services/[...path]/index.ts
index c7d98b13..79d5d0ce 100644
--- a/pages/api/webhooks/services/[...path]/index.ts
+++ b/pages/api/webhooks/services/[...path]/index.ts
@@ -27,6 +27,10 @@ import {
getExtensionFromContentType,
getSupportedContentType,
} from "@/lib/utils/get-content-type";
+import {
+ fetchPublicHttpsUrlToBuffer,
+ type PublicHttpsDownload,
+} from "@/lib/utils/ssrf-protection";
import { sendLinkCreatedWebhook } from "@/lib/webhook/triggers/link-created";
import { webhookFileUrlSchema } from "@/lib/zod/url-validation";
@@ -36,6 +40,8 @@ export const config = {
maxDuration: 120,
};
+const MAX_WEBHOOK_FILE_BYTES = 100 * 1024 * 1024;
+
// Define a common link schema to reuse
const LinkSchema = z.object({
name: z.string().optional(),
@@ -416,13 +422,18 @@ async function handleDocumentCreate(
}
// 4. Fetch file from URL
- const response = await fetch(fileUrl);
- if (!response.ok) {
+ let remoteFile: PublicHttpsDownload;
+ try {
+ remoteFile = await fetchPublicHttpsUrlToBuffer(fileUrl, {
+ maxBytes: MAX_WEBHOOK_FILE_BYTES,
+ });
+ } catch (error) {
+ console.warn("Failed to fetch webhook file", error);
return res.status(400).json({ error: "Failed to fetch file from URL" });
}
// 5. Validate response content type matches expected
- const responseContentType = response.headers.get("content-type");
+ const responseContentType = remoteFile.contentType;
if (!responseContentType || responseContentType.startsWith("text/html")) {
return res
.status(400)
@@ -436,7 +447,7 @@ async function handleDocumentCreate(
}
// 6. Convert to buffer
- const fileBuffer = Buffer.from(await response.arrayBuffer());
+ const fileBuffer = remoteFile.buffer;
// Ensure filename has proper extension, based on the actual response content-type when available
let fileName = name?.trim();
@@ -727,13 +738,18 @@ async function handleDocumentUpdate(
}
// Fetch file from URL
- const response = await fetch(fileUrl);
- if (!response.ok) {
+ let remoteFile: PublicHttpsDownload;
+ try {
+ remoteFile = await fetchPublicHttpsUrlToBuffer(fileUrl, {
+ maxBytes: MAX_WEBHOOK_FILE_BYTES,
+ });
+ } catch (error) {
+ console.warn("Failed to fetch webhook file", error);
return res.status(400).json({ error: "Failed to fetch file from URL" });
}
// Validate response content type
- const responseContentType = response.headers.get("content-type");
+ const responseContentType = remoteFile.contentType;
if (!responseContentType || responseContentType.startsWith("text/html")) {
return res
.status(400)
@@ -746,7 +762,7 @@ async function handleDocumentUpdate(
}
// Convert to buffer
- const fileBuffer = Buffer.from(await response.arrayBuffer());
+ const fileBuffer = remoteFile.buffer;
// Ensure filename has proper extension
let fileName = document.name?.trim() ?? "document";