refactor: convert /backend to ESM

This commit is contained in:
Dragory 2024-04-09 20:57:18 +03:00
parent 31d74c05aa
commit 5772e27cda
No known key found for this signature in database
766 changed files with 3473 additions and 3500 deletions

View file

@ -1,13 +1,13 @@
import { guildPlugin } from "knub";
import { GuildRoleQueue } from "../../data/GuildRoleQueue";
import { makePublicFn } from "../../pluginUtils";
import { LogsPlugin } from "../Logs/LogsPlugin";
import { addPriorityRole } from "./functions/addPriorityRole";
import { addRole } from "./functions/addRole";
import { removePriorityRole } from "./functions/removePriorityRole";
import { removeRole } from "./functions/removeRole";
import { runRoleAssignmentLoop } from "./functions/runRoleAssignmentLoop";
import { RoleManagerPluginType, zRoleManagerConfig } from "./types";
import { GuildRoleQueue } from "../../data/GuildRoleQueue.js";
import { makePublicFn } from "../../pluginUtils.js";
import { LogsPlugin } from "../Logs/LogsPlugin.js";
import { addPriorityRole } from "./functions/addPriorityRole.js";
import { addRole } from "./functions/addRole.js";
import { removePriorityRole } from "./functions/removePriorityRole.js";
import { removeRole } from "./functions/removeRole.js";
import { runRoleAssignmentLoop } from "./functions/runRoleAssignmentLoop.js";
import { RoleManagerPluginType, zRoleManagerConfig } from "./types.js";
export const RoleManagerPlugin = guildPlugin<RoleManagerPluginType>()({
name: "role_manager",

View file

@ -1,7 +1,7 @@
import { GuildPluginData } from "knub";
import { PRIORITY_ROLE_PRIORITY } from "../constants";
import { RoleManagerPluginType } from "../types";
import { runRoleAssignmentLoop } from "./runRoleAssignmentLoop";
import { PRIORITY_ROLE_PRIORITY } from "../constants.js";
import { RoleManagerPluginType } from "../types.js";
import { runRoleAssignmentLoop } from "./runRoleAssignmentLoop.js";
export async function addPriorityRole(
pluginData: GuildPluginData<RoleManagerPluginType>,

View file

@ -1,6 +1,6 @@
import { GuildPluginData } from "knub";
import { RoleManagerPluginType } from "../types";
import { runRoleAssignmentLoop } from "./runRoleAssignmentLoop";
import { RoleManagerPluginType } from "../types.js";
import { runRoleAssignmentLoop } from "./runRoleAssignmentLoop.js";
export async function addRole(pluginData: GuildPluginData<RoleManagerPluginType>, userId: string, roleId: string) {
await pluginData.state.roleQueue.addQueueItem(userId, roleId, true);

View file

@ -1,7 +1,7 @@
import { GuildPluginData } from "knub";
import { PRIORITY_ROLE_PRIORITY } from "../constants";
import { RoleManagerPluginType } from "../types";
import { runRoleAssignmentLoop } from "./runRoleAssignmentLoop";
import { PRIORITY_ROLE_PRIORITY } from "../constants.js";
import { RoleManagerPluginType } from "../types.js";
import { runRoleAssignmentLoop } from "./runRoleAssignmentLoop.js";
export async function removePriorityRole(
pluginData: GuildPluginData<RoleManagerPluginType>,

View file

@ -1,6 +1,6 @@
import { GuildPluginData } from "knub";
import { RoleManagerPluginType } from "../types";
import { runRoleAssignmentLoop } from "./runRoleAssignmentLoop";
import { RoleManagerPluginType } from "../types.js";
import { runRoleAssignmentLoop } from "./runRoleAssignmentLoop.js";
export async function removeRole(pluginData: GuildPluginData<RoleManagerPluginType>, userId: string, roleId: string) {
await pluginData.state.roleQueue.addQueueItem(userId, roleId, false);

View file

@ -1,7 +1,7 @@
import { GuildPluginData } from "knub";
import { logger } from "../../../logger";
import { LogsPlugin } from "../../Logs/LogsPlugin";
import { RoleManagerPluginType } from "../types";
import { logger } from "../../../logger.js";
import { LogsPlugin } from "../../Logs/LogsPlugin.js";
import { RoleManagerPluginType } from "../types.js";
const ROLE_ASSIGNMENTS_PER_BATCH = 10;

View file

@ -1,4 +1,4 @@
import { ZeppelinPluginInfo } from "../../types";
import { ZeppelinPluginInfo } from "../../types.js";
export const roleManagerPluginInfo: ZeppelinPluginInfo = {
prettyName: "Role manager",

View file

@ -1,6 +1,6 @@
import { BasePluginType } from "knub";
import z from "zod";
import { GuildRoleQueue } from "../../data/GuildRoleQueue";
import { GuildRoleQueue } from "../../data/GuildRoleQueue.js";
export const zRoleManagerConfig = z.strictObject({});