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:
gbuomprisco
2024-08-01 14:57:55 +02:00
parent 5c28eaabeb
commit 23154c366d
48 changed files with 607 additions and 469 deletions

View File

@@ -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,
});
}
}

View File

@@ -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>;

View File

@@ -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>;