migrate webhookTriggers and workflows apis (#19875)

This commit is contained in:
Benny Joo authored and GitHub committed 2025-03-10 14:35:11 +00:00
1 parent f2ca2bdc83
commit 631c5f7c53
12 files changed
+52 -68

No files matched your search

@@ -0,0 +1,17 @@
import type { NextRequest } from "next/server";
import { NextResponse } from "next/server";
import { handleWebhookScheduledTriggers } from "@calcom/features/webhooks/lib/handleWebhookScheduledTriggers";
import prisma from "@calcom/prisma";
export async function POST(req: NextRequest) {
const apiKey = req.headers.get("authorization") || req.nextUrl.searchParams.get("apiKey");
if (process.env.CRON_API_KEY !== apiKey) {
return NextResponse.json({ message: "Not authenticated" }, { status: 401 });
}
await handleWebhookScheduledTriggers(prisma);
return NextResponse.json({ ok: true });
}
@@ -0,0 +1,3 @@
import { handler } from "@calcom/features/ee/workflows/api/scheduleEmailReminders";
export { handler as POST };
@@ -0,0 +1,3 @@
import { handler } from "@calcom/features/ee/workflows/api/scheduleSMSReminders";
export { handler as POST };
@@ -0,0 +1,3 @@
import { handler } from "@calcom/features/ee/workflows/api/scheduleWhatsappReminders";
export { handler as POST };
@@ -1 +0,0 @@
export { default } from "@calcom/features/webhooks/lib/cron";
@@ -1 +0,0 @@
export { default } from "@calcom/features/ee/workflows/api/scheduleEmailReminders";
@@ -1 +0,0 @@
export { default } from "@calcom/features/ee/workflows/api/scheduleSMSReminders";
@@ -1 +0,0 @@
export { default } from "@calcom/features/ee/workflows/api/scheduleWhatsappReminders";