mirror of
https://github.com/Portabase/portabase.git
synced 2026-07-14 11:16:13 +02:00
* feat: add Microsoft Teams notification provider * feat: Add Microsoft Teams as notification provider * fix: Update database migration * fix: Remove duplicate file 0058 db migration * add Microsoft Teams notification provider E2E tests * fix: externalize e2e testings and profile name trim (#318) * fix: externalize e2e testings * fix: externalize e2e tests. * refactor: improve e2e workflow. * chore: upgrade workflow action version. * fix: createEnv by adding emptyStringAsUndefined (#317) * chore: release 1.18.2 --------- Co-authored-by: killian-larcher <killian.larcher@soluce-technologies.com> Co-authored-by: Charles GTE <charles.gauthereau@soluce-technologies.com> Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com> * fix(layout): guard undefined user.name in avatar fallbacks (#320) * fix(layout): guard undefined user.name in avatar fallbacks * fix: AUTH_DEFAULT_USER as zod email --------- Co-authored-by: charles-gauthereau <charles.gauthereau@soluce-technologies.com> * fix: profile name trim --------- Co-authored-by: killian-larcher <killian.larcher@soluce-technologies.com> Co-authored-by: Charles GTE <charles.gauthereau@soluce-technologies.com> Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com> Co-authored-by: Michael Kutý <6du1ro.n@gmail.com> Co-authored-by: charles-gauthereau <charles.gauthereau@soluce-technologies.com> * chore: release 1.18.3 * chore: Update README.md (#323) * chore: Update README.md added unraid link * chore: Update README.md fix markdown * chore: release 1.18.4 * fix: teams.ts with timeout --------- Co-authored-by: Killian Larcher <98161034+KillianLarcher@users.noreply.github.com> Co-authored-by: killian-larcher <killian.larcher@soluce-technologies.com> Co-authored-by: Charles GTE <charles.gauthereau@soluce-technologies.com> Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com> Co-authored-by: Michael Kutý <6du1ro.n@gmail.com> Co-authored-by: charles-gauthereau <charles.gauthereau@soluce-technologies.com> Co-authored-by: Shawn M <84647313+hyperion02@users.noreply.github.com>
81 lines
3.1 KiB
TypeScript
81 lines
3.1 KiB
TypeScript
import {z} from "zod";
|
|
import {SlackChannelConfigSchema} from "@/features/channel/notifications/slack.schema";
|
|
import {SmtpChannelConfigSchema} from "@/features/channel/notifications/smtp.schema";
|
|
import {DiscordChannelConfigSchema} from "@/features/channel/notifications/discord.schema";
|
|
import {TelegramChannelConfigSchema} from "@/features/channel/notifications/telegram.schema";
|
|
import {GotifyChannelConfigSchema} from "@/features/channel/notifications/gotify.schema";
|
|
import {NtfyChannelConfigSchema} from "@/features/channel/notifications/ntfy.schema";
|
|
import {WebhookChannelConfigSchema} from "@/features/channel/notifications/webhook.schema";
|
|
import {NextcloudChannelConfigSchema} from "@/features/channel/notifications/nextcloud.schema";
|
|
import {S3ChannelConfigSchema} from "@/features/channel/storages/s3.schema";
|
|
import {GoogleDriveChannelConfigSchema} from "@/features/channel/storages/google-drive/google-drive.schema";
|
|
import {LocalChannelConfigSchema} from "@/features/channel/storages/local.schema";
|
|
import {TeamsChannelConfigSchema} from "@/features/channel/notifications/teams.schema";
|
|
|
|
|
|
const BaseChannelFormSchema = z.object({
|
|
name: z
|
|
.string()
|
|
.min(5, "Name must be at least 5 characters long")
|
|
.max(40, "Name must be at most 40 characters long"),
|
|
enabled: z.boolean().default(true),
|
|
});
|
|
|
|
export const NotificationChannelFormSchema = z.discriminatedUnion("provider", [
|
|
BaseChannelFormSchema.extend({
|
|
provider: z.literal("slack"),
|
|
config: SlackChannelConfigSchema,
|
|
}),
|
|
BaseChannelFormSchema.extend({
|
|
provider: z.literal("smtp"),
|
|
config: SmtpChannelConfigSchema,
|
|
}),
|
|
BaseChannelFormSchema.extend({
|
|
provider: z.literal("discord"),
|
|
config: DiscordChannelConfigSchema,
|
|
}),
|
|
BaseChannelFormSchema.extend({
|
|
provider: z.literal("telegram"),
|
|
config: TelegramChannelConfigSchema,
|
|
}),
|
|
BaseChannelFormSchema.extend({
|
|
provider: z.literal("gotify"),
|
|
config: GotifyChannelConfigSchema,
|
|
}),
|
|
BaseChannelFormSchema.extend({
|
|
provider: z.literal("ntfy"),
|
|
config: NtfyChannelConfigSchema,
|
|
}),
|
|
BaseChannelFormSchema.extend({
|
|
provider: z.literal("webhook"),
|
|
config: WebhookChannelConfigSchema,
|
|
}),
|
|
BaseChannelFormSchema.extend({
|
|
provider: z.literal("nextcloud"),
|
|
config: NextcloudChannelConfigSchema,
|
|
}),
|
|
BaseChannelFormSchema.extend({
|
|
provider: z.literal("teams"),
|
|
config: TeamsChannelConfigSchema,
|
|
}),
|
|
]);
|
|
|
|
export const StorageChannelFormSchema = z.discriminatedUnion("provider", [
|
|
BaseChannelFormSchema.extend({
|
|
provider: z.literal("s3"),
|
|
config: S3ChannelConfigSchema,
|
|
}),
|
|
BaseChannelFormSchema.extend({
|
|
provider: z.literal("google-drive"),
|
|
config: GoogleDriveChannelConfigSchema,
|
|
}),
|
|
BaseChannelFormSchema.extend({
|
|
provider: z.literal("local"),
|
|
config: LocalChannelConfigSchema
|
|
})
|
|
]);
|
|
|
|
|
|
export type NotificationChannelFormType = z.infer<typeof NotificationChannelFormSchema>;
|
|
export type StorageChannelFormType = z.infer<typeof StorageChannelFormSchema>;
|