3
0
Fork 0
mirror of https://github.com/ZeppelinBot/Zeppelin.git synced 2025-03-15 05:41:51 +00:00

fix: circular dependency in automod types

This commit is contained in:
Dragory 2024-01-15 18:03:45 +00:00
parent 28692962bc
commit 3db9090705
No known key found for this signature in database
6 changed files with 10 additions and 9 deletions

View file

@ -4,7 +4,7 @@ import { CaseArgs } from "../../Cases/types";
import { ModActionsPlugin } from "../../ModActions/ModActionsPlugin"; import { ModActionsPlugin } from "../../ModActions/ModActionsPlugin";
import { resolveActionContactMethods } from "../functions/resolveActionContactMethods"; import { resolveActionContactMethods } from "../functions/resolveActionContactMethods";
import { automodAction } from "../helpers"; import { automodAction } from "../helpers";
import { zNotify } from "../types"; import { zNotify } from "../constants";
const configSchema = z.strictObject({ const configSchema = z.strictObject({
reason: zBoundedCharacters(0, 4000).nullable().default(null), reason: zBoundedCharacters(0, 4000).nullable().default(null),

View file

@ -4,7 +4,7 @@ import { CaseArgs } from "../../Cases/types";
import { ModActionsPlugin } from "../../ModActions/ModActionsPlugin"; import { ModActionsPlugin } from "../../ModActions/ModActionsPlugin";
import { resolveActionContactMethods } from "../functions/resolveActionContactMethods"; import { resolveActionContactMethods } from "../functions/resolveActionContactMethods";
import { automodAction } from "../helpers"; import { automodAction } from "../helpers";
import { zNotify } from "../types"; import { zNotify } from "../constants";
export const KickAction = automodAction({ export const KickAction = automodAction({
configSchema: z.strictObject({ configSchema: z.strictObject({

View file

@ -6,7 +6,7 @@ import { LogsPlugin } from "../../Logs/LogsPlugin";
import { MutesPlugin } from "../../Mutes/MutesPlugin"; import { MutesPlugin } from "../../Mutes/MutesPlugin";
import { resolveActionContactMethods } from "../functions/resolveActionContactMethods"; import { resolveActionContactMethods } from "../functions/resolveActionContactMethods";
import { automodAction } from "../helpers"; import { automodAction } from "../helpers";
import { zNotify } from "../types"; import { zNotify } from "../constants";
export const MuteAction = automodAction({ export const MuteAction = automodAction({
configSchema: z.strictObject({ configSchema: z.strictObject({

View file

@ -4,7 +4,7 @@ import { CaseArgs } from "../../Cases/types";
import { ModActionsPlugin } from "../../ModActions/ModActionsPlugin"; import { ModActionsPlugin } from "../../ModActions/ModActionsPlugin";
import { resolveActionContactMethods } from "../functions/resolveActionContactMethods"; import { resolveActionContactMethods } from "../functions/resolveActionContactMethods";
import { automodAction } from "../helpers"; import { automodAction } from "../helpers";
import { zNotify } from "../types"; import { zNotify } from "../constants";
export const WarnAction = automodAction({ export const WarnAction = automodAction({
configSchema: z.strictObject({ configSchema: z.strictObject({

View file

@ -1,3 +1,4 @@
import z from "zod";
import { MINUTES, SECONDS } from "../../utils"; import { MINUTES, SECONDS } from "../../utils";
export const RECENT_SPAM_EXPIRY_TIME = 10 * SECONDS; export const RECENT_SPAM_EXPIRY_TIME = 10 * SECONDS;
@ -18,3 +19,8 @@ export enum RecentActionType {
MemberLeave, MemberLeave,
ThreadCreate, ThreadCreate,
} }
export const zNotify = z.union([
z.literal("dm"),
z.literal("channel"),
]);

View file

@ -65,11 +65,6 @@ const zRule = z.strictObject({
}); });
export type TRule = z.infer<typeof zRule>; export type TRule = z.infer<typeof zRule>;
export const zNotify = z.union([
z.literal("dm"),
z.literal("channel"),
]);
export const zAutomodConfig = z.strictObject({ export const zAutomodConfig = z.strictObject({
rules: zBoundedRecord( rules: zBoundedRecord(
z.record(z.string().max(100), zRule), z.record(z.string().max(100), zRule),