{"version":3,"file":"emails.mjs","names":[],"sources":["../../../../../src/astro/routes/api/dev/emails.ts"],"sourcesContent":["/**\n * GET /_emdash/api/dev/emails\n * DELETE /_emdash/api/dev/emails\n *\n * Development-only endpoint to view and clear emails captured by\n * the dev console email provider.\n *\n * ONLY available when import.meta.env.DEV is true.\n *\n */\n\nimport type { APIRoute } from \"astro\";\n\nexport const prerender = false;\n\nimport { apiError, apiSuccess } from \"#api/error.js\";\n\nimport { clearDevEmails, getDevEmails } from \"../../../../plugins/email-console.js\";\n\nexport const GET: APIRoute = async () => {\n\tif (!import.meta.env.DEV) {\n\t\treturn apiError(\"FORBIDDEN\", \"Dev emails endpoint is only available in development mode\", 403);\n\t}\n\n\tconst emails = getDevEmails();\n\treturn apiSuccess({ items: emails });\n};\n\nexport const DELETE: APIRoute = async () => {\n\tif (!import.meta.env.DEV) {\n\t\treturn apiError(\"FORBIDDEN\", \"Dev emails endpoint is only available in development mode\", 403);\n\t}\n\n\tclearDevEmails();\n\treturn apiSuccess({ success: true });\n};\n"],"mappings":";;;;;;AAaA,MAAa,YAAY;AAMzB,MAAa,MAAgB,YAAY;AACxC,KAAI,CAAC,OAAO,KAAK,IAAI,IACpB,QAAO,SAAS,aAAa,6DAA6D,IAAI;AAI/F,QAAO,WAAW,EAAE,OADL,cAAc,EACM,CAAC;;AAGrC,MAAa,SAAmB,YAAY;AAC3C,KAAI,CAAC,OAAO,KAAK,IAAI,IACpB,QAAO,SAAS,aAAa,6DAA6D,IAAI;AAG/F,iBAAgB;AAChB,QAAO,WAAW,EAAE,SAAS,MAAM,CAAC"}