Revert "Unify workspace dropdowns; Update layouts (#458)"

This reverts commit 4bc8448a1d.
This commit is contained in:
gbuomprisco
2026-03-11 14:47:47 +08:00
parent 4bc8448a1d
commit 4912e402a3
530 changed files with 11182 additions and 14382 deletions

View File

@@ -1,4 +1,4 @@
import * as z from 'zod';
import { z } from 'zod';
const MAILER_PROVIDERS = [
'nodemailer',

View File

@@ -1,12 +1,12 @@
import 'server-only';
import * as z from 'zod';
import { z } from 'zod';
import { Mailer, MailerSchema } from '@kit/mailers-shared';
import { getSMTPConfiguration } from './smtp-configuration';
type Config = z.output<typeof MailerSchema>;
type Config = z.infer<typeof MailerSchema>;
export function createNodemailerService() {
return new Nodemailer();

View File

@@ -1,14 +1,15 @@
import 'server-only';
import * as z from 'zod';
import { z } from 'zod';
import { Mailer, MailerSchema } from '@kit/mailers-shared';
type Config = z.output<typeof MailerSchema>;
type Config = z.infer<typeof MailerSchema>;
const RESEND_API_KEY = z
.string({
error: 'Please provide the API key for the Resend API',
description: 'The API key for the Resend API',
required_error: 'Please provide the API key for the Resend API',
})
.parse(process.env.RESEND_API_KEY);

View File

@@ -1,7 +1,7 @@
import * as z from 'zod';
import { z } from 'zod';
import { MailerSchema } from './schema/mailer.schema';
export abstract class Mailer<Res = unknown> {
abstract sendEmail(data: z.output<typeof MailerSchema>): Promise<Res>;
abstract sendEmail(data: z.infer<typeof MailerSchema>): Promise<Res>;
}

View File

@@ -1,4 +1,4 @@
import * as z from 'zod';
import { z } from 'zod';
export const MailerSchema = z
.object({

View File

@@ -1,21 +1,28 @@
import 'server-only';
import * as z from 'zod';
import { z } from 'zod';
export const SmtpConfigSchema = z.object({
user: z.string({
error: `Please provide the variable EMAIL_USER`,
description:
'This is the email account to send emails from. This is specific to the email provider.',
required_error: `Please provide the variable EMAIL_USER`,
}),
pass: z.string({
error: `Please provide the variable EMAIL_PASSWORD`,
description: 'This is the password for the email account',
required_error: `Please provide the variable EMAIL_PASSWORD`,
}),
host: z.string({
error: `Please provide the variable EMAIL_HOST`,
description: 'This is the SMTP host for the email provider',
required_error: `Please provide the variable EMAIL_HOST`,
}),
port: z.number({
error: `Please provide the variable EMAIL_PORT`,
description:
'This is the port for the email provider. Normally 587 or 465.',
required_error: `Please provide the variable EMAIL_PORT`,
}),
secure: z.boolean({
error: `Please provide the variable EMAIL_TLS`,
description: 'This is whether the connection is secure or not',
required_error: `Please provide the variable EMAIL_TLS`,
}),
});