- - 50 free email verifications when you sign up. - -
Date: Sat, 16 Dec 2023 17:16:27 +0100 Subject: [PATCH 2/2] feat: Add bulk page (Staging only) (#474) * Use generated types * WIP BULK * Fix timezone * use smtp * feat: Add bulk page (Staging only) --- package.json | 1 + src/app/api/v1/bulk/route.ts | 160 ++++++++++++++++++++ src/app/api/v1/bulk/webhook/route.ts | 57 +++++++ src/pages/bulk.tsx | 145 ++++++++++++++++++ supabase/migrations/20231212135226_bulk.sql | 34 +++++ yarn.lock | 16 +- 6 files changed, 412 insertions(+), 1 deletion(-) create mode 100644 src/app/api/v1/bulk/route.ts create mode 100644 src/app/api/v1/bulk/webhook/route.ts create mode 100644 src/pages/bulk.tsx create mode 100644 supabase/migrations/20231212135226_bulk.sql diff --git a/package.json b/package.json index 756cd546..eaa9e5fe 100644 --- a/package.json +++ b/package.json @@ -37,6 +37,7 @@ "axios": "^1.6.2", "cors": "^2.8.5", "date-fns": "^2.30.0", + "encoding": "^0.1.13", "mailgun-js": "^0.22.0", "markdown-pdf": "^11.0.0", "mustache": "^4.2.0", diff --git a/src/app/api/v1/bulk/route.ts b/src/app/api/v1/bulk/route.ts new file mode 100644 index 00000000..3c382cd7 --- /dev/null +++ b/src/app/api/v1/bulk/route.ts @@ -0,0 +1,160 @@ +import { NextRequest } from "next/server"; +import amqplib from "amqplib"; +import { supabaseAdmin } from "@/util/supabaseServer"; +import { sentryException } from "@/util/sentry"; +import { getWebappURL } from "@/util/helpers"; +import { Tables } from "@/supabase/database.types"; + +interface BulkPayload { + input_type: "array"; + input: string[]; +} + +export const POST = async (req: NextRequest): Promise