fix: circular dependency in automod types
This commit is contained in:
parent
28692962bc
commit
3db9090705
6 changed files with 10 additions and 9 deletions
|
@ -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),
|
||||||
|
|
|
@ -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({
|
||||||
|
|
|
@ -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({
|
||||||
|
|
|
@ -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({
|
||||||
|
|
|
@ -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"),
|
||||||
|
]);
|
||||||
|
|
|
@ -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),
|
||||||
|
|
Loading…
Add table
Reference in a new issue