Remove Cloudflare mailer implementation, update dependencies and updated code to reflect stricter EsLint settings
Deleted CloudflareMailer class and its implementation from the mailers package. Updated dependencies across various packages, converting certain imports to use `type` only, and bumped versions for packages like `react-query`, `lucide-react`, and others.
This commit is contained in:
@@ -1,31 +0,0 @@
|
||||
import 'server-only';
|
||||
|
||||
import Email from 'vercel-email';
|
||||
import { z } from 'zod';
|
||||
|
||||
import { Mailer } from '../../mailer';
|
||||
import { MailerSchema } from '../../schema/mailer.schema';
|
||||
|
||||
type Config = z.infer<typeof MailerSchema>;
|
||||
|
||||
/**
|
||||
* A class representing a mailer using Cloudflare's Workers thanks to the 'vercel-email' package.
|
||||
* @implements {Mailer}
|
||||
*/
|
||||
export class CloudflareMailer implements Mailer {
|
||||
async sendEmail(config: Config) {
|
||||
const schema = {
|
||||
to: config.to,
|
||||
from: config.from,
|
||||
subject: config.subject,
|
||||
};
|
||||
|
||||
const content =
|
||||
'text' in config ? { text: config.text } : { html: config.html };
|
||||
|
||||
return Email.send({
|
||||
...schema,
|
||||
...content,
|
||||
});
|
||||
}
|
||||
}
|
||||
@@ -3,7 +3,7 @@ import 'server-only';
|
||||
import { z } from 'zod';
|
||||
|
||||
import { Mailer } from '../../mailer';
|
||||
import { MailerSchema } from '../../schema/mailer.schema';
|
||||
import type { MailerSchema } from '../../schema/mailer.schema';
|
||||
import { getSMTPConfiguration } from '../../smtp-configuration';
|
||||
|
||||
type Config = z.infer<typeof MailerSchema>;
|
||||
|
||||
@@ -3,7 +3,7 @@ import 'server-only';
|
||||
import { z } from 'zod';
|
||||
|
||||
import { Mailer } from '../../mailer';
|
||||
import { MailerSchema } from '../../schema/mailer.schema';
|
||||
import type { MailerSchema } from '../../schema/mailer.schema';
|
||||
|
||||
type Config = z.infer<typeof MailerSchema>;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user