@takaro/modules 0.0.0-next.0da151e
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +3 -0
- package/dist/BuiltinModule.d.ts +62 -0
- package/dist/BuiltinModule.d.ts.map +1 -0
- package/dist/BuiltinModule.js +245 -0
- package/dist/BuiltinModule.js.map +1 -0
- package/dist/community-modules.json +21 -0
- package/dist/dto/base.d.ts +7 -0
- package/dist/dto/base.d.ts.map +1 -0
- package/dist/dto/base.js +28 -0
- package/dist/dto/base.js.map +1 -0
- package/dist/dto/discordEvents.d.ts +32 -0
- package/dist/dto/discordEvents.d.ts.map +1 -0
- package/dist/dto/discordEvents.js +92 -0
- package/dist/dto/discordEvents.js.map +1 -0
- package/dist/dto/gameEvents.d.ts +83 -0
- package/dist/dto/gameEvents.d.ts.map +1 -0
- package/dist/dto/gameEvents.js +205 -0
- package/dist/dto/gameEvents.js.map +1 -0
- package/dist/dto/index.d.ts +54 -0
- package/dist/dto/index.d.ts.map +1 -0
- package/dist/dto/index.js +18 -0
- package/dist/dto/index.js.map +1 -0
- package/dist/dto/takaroEvents.d.ts +276 -0
- package/dist/dto/takaroEvents.d.ts.map +1 -0
- package/dist/dto/takaroEvents.js +794 -0
- package/dist/dto/takaroEvents.js.map +1 -0
- package/dist/main.d.ts +5 -0
- package/dist/main.d.ts.map +1 -0
- package/dist/main.js +35 -0
- package/dist/main.js.map +1 -0
- package/dist/modules/chatBridge/hooks/DiscordToGame.d.ts +2 -0
- package/dist/modules/chatBridge/hooks/DiscordToGame.d.ts.map +1 -0
- package/dist/modules/chatBridge/hooks/DiscordToGame.js +18 -0
- package/dist/modules/chatBridge/hooks/DiscordToGame.js.map +1 -0
- package/dist/modules/chatBridge/hooks/GameToDiscord.d.ts +2 -0
- package/dist/modules/chatBridge/hooks/GameToDiscord.d.ts.map +1 -0
- package/dist/modules/chatBridge/hooks/GameToDiscord.js +14 -0
- package/dist/modules/chatBridge/hooks/GameToDiscord.js.map +1 -0
- package/dist/modules/chatBridge/hooks/PlayerConnected.d.ts +2 -0
- package/dist/modules/chatBridge/hooks/PlayerConnected.d.ts.map +1 -0
- package/dist/modules/chatBridge/hooks/PlayerConnected.js +9 -0
- package/dist/modules/chatBridge/hooks/PlayerConnected.js.map +1 -0
- package/dist/modules/chatBridge/hooks/PlayerDisconnected.d.ts +2 -0
- package/dist/modules/chatBridge/hooks/PlayerDisconnected.d.ts.map +1 -0
- package/dist/modules/chatBridge/hooks/PlayerDisconnected.js +9 -0
- package/dist/modules/chatBridge/hooks/PlayerDisconnected.js.map +1 -0
- package/dist/modules/chatBridge/index.d.ts +5 -0
- package/dist/modules/chatBridge/index.d.ts.map +1 -0
- package/dist/modules/chatBridge/index.js +64 -0
- package/dist/modules/chatBridge/index.js.map +1 -0
- package/dist/modules/dailyRewards/commands/daily.d.ts +2 -0
- package/dist/modules/dailyRewards/commands/daily.d.ts.map +1 -0
- package/dist/modules/dailyRewards/commands/daily.js +103 -0
- package/dist/modules/dailyRewards/commands/daily.js.map +1 -0
- package/dist/modules/dailyRewards/commands/streak.d.ts +2 -0
- package/dist/modules/dailyRewards/commands/streak.d.ts.map +1 -0
- package/dist/modules/dailyRewards/commands/streak.js +34 -0
- package/dist/modules/dailyRewards/commands/streak.js.map +1 -0
- package/dist/modules/dailyRewards/commands/topstreak.d.ts +2 -0
- package/dist/modules/dailyRewards/commands/topstreak.d.ts.map +1 -0
- package/dist/modules/dailyRewards/commands/topstreak.js +44 -0
- package/dist/modules/dailyRewards/commands/topstreak.js.map +1 -0
- package/dist/modules/dailyRewards/functions/utils.d.ts +6 -0
- package/dist/modules/dailyRewards/functions/utils.d.ts.map +1 -0
- package/dist/modules/dailyRewards/functions/utils.js +32 -0
- package/dist/modules/dailyRewards/functions/utils.js.map +1 -0
- package/dist/modules/dailyRewards/hooks/dailyLoginCheck.d.ts +2 -0
- package/dist/modules/dailyRewards/hooks/dailyLoginCheck.d.ts.map +1 -0
- package/dist/modules/dailyRewards/hooks/dailyLoginCheck.js +19 -0
- package/dist/modules/dailyRewards/hooks/dailyLoginCheck.js.map +1 -0
- package/dist/modules/dailyRewards/index.d.ts +5 -0
- package/dist/modules/dailyRewards/index.d.ts.map +1 -0
- package/dist/modules/dailyRewards/index.js +127 -0
- package/dist/modules/dailyRewards/index.js.map +1 -0
- package/dist/modules/economyUtils/commands/balance.d.ts +2 -0
- package/dist/modules/economyUtils/commands/balance.d.ts.map +1 -0
- package/dist/modules/economyUtils/commands/balance.js +7 -0
- package/dist/modules/economyUtils/commands/balance.js.map +1 -0
- package/dist/modules/economyUtils/commands/claim.d.ts +2 -0
- package/dist/modules/economyUtils/commands/claim.d.ts.map +1 -0
- package/dist/modules/economyUtils/commands/claim.js +35 -0
- package/dist/modules/economyUtils/commands/claim.js.map +1 -0
- package/dist/modules/economyUtils/commands/confirmTransfer.d.ts +2 -0
- package/dist/modules/economyUtils/commands/confirmTransfer.d.ts.map +1 -0
- package/dist/modules/economyUtils/commands/confirmTransfer.js +38 -0
- package/dist/modules/economyUtils/commands/confirmTransfer.js.map +1 -0
- package/dist/modules/economyUtils/commands/grantCurrency.d.ts +2 -0
- package/dist/modules/economyUtils/commands/grantCurrency.d.ts.map +1 -0
- package/dist/modules/economyUtils/commands/grantCurrency.js +28 -0
- package/dist/modules/economyUtils/commands/grantCurrency.js.map +1 -0
- package/dist/modules/economyUtils/commands/revokeCurrency.d.ts +2 -0
- package/dist/modules/economyUtils/commands/revokeCurrency.d.ts.map +1 -0
- package/dist/modules/economyUtils/commands/revokeCurrency.js +28 -0
- package/dist/modules/economyUtils/commands/revokeCurrency.js.map +1 -0
- package/dist/modules/economyUtils/commands/shop.d.ts +2 -0
- package/dist/modules/economyUtils/commands/shop.d.ts.map +1 -0
- package/dist/modules/economyUtils/commands/shop.js +69 -0
- package/dist/modules/economyUtils/commands/shop.js.map +1 -0
- package/dist/modules/economyUtils/commands/topCurrency.d.ts +2 -0
- package/dist/modules/economyUtils/commands/topCurrency.d.ts.map +1 -0
- package/dist/modules/economyUtils/commands/topCurrency.js +22 -0
- package/dist/modules/economyUtils/commands/topCurrency.js.map +1 -0
- package/dist/modules/economyUtils/commands/transfer.d.ts +2 -0
- package/dist/modules/economyUtils/commands/transfer.d.ts.map +1 -0
- package/dist/modules/economyUtils/commands/transfer.js +55 -0
- package/dist/modules/economyUtils/commands/transfer.js.map +1 -0
- package/dist/modules/economyUtils/cronJobs/zombieKillReward.d.ts +2 -0
- package/dist/modules/economyUtils/cronJobs/zombieKillReward.d.ts.map +1 -0
- package/dist/modules/economyUtils/cronJobs/zombieKillReward.js +66 -0
- package/dist/modules/economyUtils/cronJobs/zombieKillReward.js.map +1 -0
- package/dist/modules/economyUtils/index.d.ts +5 -0
- package/dist/modules/economyUtils/index.d.ts.map +1 -0
- package/dist/modules/economyUtils/index.js +192 -0
- package/dist/modules/economyUtils/index.js.map +1 -0
- package/dist/modules/geoBlock/hooks/IPDetected.d.ts +2 -0
- package/dist/modules/geoBlock/hooks/IPDetected.d.ts.map +1 -0
- package/dist/modules/geoBlock/hooks/IPDetected.js +50 -0
- package/dist/modules/geoBlock/hooks/IPDetected.js.map +1 -0
- package/dist/modules/geoBlock/index.d.ts +9 -0
- package/dist/modules/geoBlock/index.d.ts.map +1 -0
- package/dist/modules/geoBlock/index.js +329 -0
- package/dist/modules/geoBlock/index.js.map +1 -0
- package/dist/modules/gimme/commands/gimme.d.ts +2 -0
- package/dist/modules/gimme/commands/gimme.d.ts.map +1 -0
- package/dist/modules/gimme/commands/gimme.js +25 -0
- package/dist/modules/gimme/commands/gimme.js.map +1 -0
- package/dist/modules/gimme/index.d.ts +5 -0
- package/dist/modules/gimme/index.d.ts.map +1 -0
- package/dist/modules/gimme/index.js +75 -0
- package/dist/modules/gimme/index.js.map +1 -0
- package/dist/modules/highPingKicker/cronJobs/Ping check.d.ts +2 -0
- package/dist/modules/highPingKicker/cronJobs/Ping check.d.ts.map +1 -0
- package/dist/modules/highPingKicker/cronJobs/Ping check.js +59 -0
- package/dist/modules/highPingKicker/cronJobs/Ping check.js.map +1 -0
- package/dist/modules/highPingKicker/index.d.ts +5 -0
- package/dist/modules/highPingKicker/index.d.ts.map +1 -0
- package/dist/modules/highPingKicker/index.js +44 -0
- package/dist/modules/highPingKicker/index.js.map +1 -0
- package/dist/modules/lottery/commands/buyTicket.d.ts +2 -0
- package/dist/modules/lottery/commands/buyTicket.d.ts.map +1 -0
- package/dist/modules/lottery/commands/buyTicket.js +51 -0
- package/dist/modules/lottery/commands/buyTicket.js.map +1 -0
- package/dist/modules/lottery/commands/nextDraw.d.ts +2 -0
- package/dist/modules/lottery/commands/nextDraw.d.ts.map +1 -0
- package/dist/modules/lottery/commands/nextDraw.js +34 -0
- package/dist/modules/lottery/commands/nextDraw.js.map +1 -0
- package/dist/modules/lottery/commands/viewTickets.d.ts +2 -0
- package/dist/modules/lottery/commands/viewTickets.d.ts.map +1 -0
- package/dist/modules/lottery/commands/viewTickets.js +20 -0
- package/dist/modules/lottery/commands/viewTickets.js.map +1 -0
- package/dist/modules/lottery/cronJobs/drawLottery.d.ts +2 -0
- package/dist/modules/lottery/cronJobs/drawLottery.d.ts.map +1 -0
- package/dist/modules/lottery/cronJobs/drawLottery.js +96 -0
- package/dist/modules/lottery/cronJobs/drawLottery.js.map +1 -0
- package/dist/modules/lottery/index.d.ts +5 -0
- package/dist/modules/lottery/index.d.ts.map +1 -0
- package/dist/modules/lottery/index.js +85 -0
- package/dist/modules/lottery/index.js.map +1 -0
- package/dist/modules/playerOnboarding/commands/starterkit.d.ts +2 -0
- package/dist/modules/playerOnboarding/commands/starterkit.d.ts.map +1 -0
- package/dist/modules/playerOnboarding/commands/starterkit.js +47 -0
- package/dist/modules/playerOnboarding/commands/starterkit.js.map +1 -0
- package/dist/modules/playerOnboarding/hooks/playerConnected.d.ts +2 -0
- package/dist/modules/playerOnboarding/hooks/playerConnected.d.ts.map +1 -0
- package/dist/modules/playerOnboarding/hooks/playerConnected.js +11 -0
- package/dist/modules/playerOnboarding/hooks/playerConnected.js.map +1 -0
- package/dist/modules/playerOnboarding/index.d.ts +5 -0
- package/dist/modules/playerOnboarding/index.d.ts.map +1 -0
- package/dist/modules/playerOnboarding/index.js +83 -0
- package/dist/modules/playerOnboarding/index.js.map +1 -0
- package/dist/modules/serverMessages/cronJobs/Automated message.d.ts +2 -0
- package/dist/modules/serverMessages/cronJobs/Automated message.d.ts.map +1 -0
- package/dist/modules/serverMessages/cronJobs/Automated message.js +41 -0
- package/dist/modules/serverMessages/cronJobs/Automated message.js.map +1 -0
- package/dist/modules/serverMessages/index.d.ts +5 -0
- package/dist/modules/serverMessages/index.d.ts.map +1 -0
- package/dist/modules/serverMessages/index.js +45 -0
- package/dist/modules/serverMessages/index.js.map +1 -0
- package/dist/modules/teleports/commands/deletetp.d.ts +2 -0
- package/dist/modules/teleports/commands/deletetp.d.ts.map +1 -0
- package/dist/modules/teleports/commands/deletetp.js +20 -0
- package/dist/modules/teleports/commands/deletetp.js.map +1 -0
- package/dist/modules/teleports/commands/deletewaypoint.d.ts +2 -0
- package/dist/modules/teleports/commands/deletewaypoint.d.ts.map +1 -0
- package/dist/modules/teleports/commands/deletewaypoint.js +20 -0
- package/dist/modules/teleports/commands/deletewaypoint.js.map +1 -0
- package/dist/modules/teleports/commands/listwaypoints.d.ts +2 -0
- package/dist/modules/teleports/commands/listwaypoints.d.ts.map +1 -0
- package/dist/modules/teleports/commands/listwaypoints.js +17 -0
- package/dist/modules/teleports/commands/listwaypoints.js.map +1 -0
- package/dist/modules/teleports/commands/setprivate.d.ts +2 -0
- package/dist/modules/teleports/commands/setprivate.d.ts.map +1 -0
- package/dist/modules/teleports/commands/setprivate.js +29 -0
- package/dist/modules/teleports/commands/setprivate.js.map +1 -0
- package/dist/modules/teleports/commands/setpublic.d.ts +2 -0
- package/dist/modules/teleports/commands/setpublic.d.ts.map +1 -0
- package/dist/modules/teleports/commands/setpublic.js +45 -0
- package/dist/modules/teleports/commands/setpublic.js.map +1 -0
- package/dist/modules/teleports/commands/settp.d.ts +2 -0
- package/dist/modules/teleports/commands/settp.d.ts.map +1 -0
- package/dist/modules/teleports/commands/settp.js +40 -0
- package/dist/modules/teleports/commands/settp.js.map +1 -0
- package/dist/modules/teleports/commands/setwaypoint.d.ts +2 -0
- package/dist/modules/teleports/commands/setwaypoint.d.ts.map +1 -0
- package/dist/modules/teleports/commands/setwaypoint.js +28 -0
- package/dist/modules/teleports/commands/setwaypoint.js.map +1 -0
- package/dist/modules/teleports/commands/teleport.d.ts +2 -0
- package/dist/modules/teleports/commands/teleport.d.ts.map +1 -0
- package/dist/modules/teleports/commands/teleport.js +68 -0
- package/dist/modules/teleports/commands/teleport.js.map +1 -0
- package/dist/modules/teleports/commands/teleportwaypoint.d.ts +2 -0
- package/dist/modules/teleports/commands/teleportwaypoint.d.ts.map +1 -0
- package/dist/modules/teleports/commands/teleportwaypoint.js +43 -0
- package/dist/modules/teleports/commands/teleportwaypoint.js.map +1 -0
- package/dist/modules/teleports/commands/tplist.d.ts +2 -0
- package/dist/modules/teleports/commands/tplist.d.ts.map +1 -0
- package/dist/modules/teleports/commands/tplist.js +46 -0
- package/dist/modules/teleports/commands/tplist.js.map +1 -0
- package/dist/modules/teleports/cronJobs/Waypoint reconciler.d.ts +2 -0
- package/dist/modules/teleports/cronJobs/Waypoint reconciler.d.ts.map +1 -0
- package/dist/modules/teleports/cronJobs/Waypoint reconciler.js +6 -0
- package/dist/modules/teleports/cronJobs/Waypoint reconciler.js.map +1 -0
- package/dist/modules/teleports/functions/utils.d.ts +14 -0
- package/dist/modules/teleports/functions/utils.d.ts.map +1 -0
- package/dist/modules/teleports/functions/utils.js +156 -0
- package/dist/modules/teleports/functions/utils.js.map +1 -0
- package/dist/modules/teleports/index.d.ts +5 -0
- package/dist/modules/teleports/index.d.ts.map +1 -0
- package/dist/modules/teleports/index.js +208 -0
- package/dist/modules/teleports/index.js.map +1 -0
- package/dist/modules/timedShutdown/cronJobs/Shutdown.d.ts +2 -0
- package/dist/modules/timedShutdown/cronJobs/Shutdown.d.ts.map +1 -0
- package/dist/modules/timedShutdown/cronJobs/Shutdown.js +7 -0
- package/dist/modules/timedShutdown/cronJobs/Shutdown.js.map +1 -0
- package/dist/modules/timedShutdown/cronJobs/warning.d.ts +2 -0
- package/dist/modules/timedShutdown/cronJobs/warning.d.ts.map +1 -0
- package/dist/modules/timedShutdown/cronJobs/warning.js +10 -0
- package/dist/modules/timedShutdown/cronJobs/warning.js.map +1 -0
- package/dist/modules/timedShutdown/index.d.ts +5 -0
- package/dist/modules/timedShutdown/index.d.ts.map +1 -0
- package/dist/modules/timedShutdown/index.js +43 -0
- package/dist/modules/timedShutdown/index.js.map +1 -0
- package/dist/modules/utils/commands/help.d.ts +2 -0
- package/dist/modules/utils/commands/help.d.ts.map +1 -0
- package/dist/modules/utils/commands/help.js +84 -0
- package/dist/modules/utils/commands/help.js.map +1 -0
- package/dist/modules/utils/commands/ping.d.ts +2 -0
- package/dist/modules/utils/commands/ping.d.ts.map +1 -0
- package/dist/modules/utils/commands/ping.js +6 -0
- package/dist/modules/utils/commands/ping.js.map +1 -0
- package/dist/modules/utils/index.d.ts +5 -0
- package/dist/modules/utils/index.d.ts.map +1 -0
- package/dist/modules/utils/index.js +52 -0
- package/dist/modules/utils/index.js.map +1 -0
- package/dist/modules.json +757 -0
- package/package.json +17 -0
- package/scripts/buildBuiltinJson.ts +81 -0
- package/src/BuiltinModule.ts +159 -0
- package/src/__tests__/aliases.integration.test.ts +90 -0
- package/src/__tests__/bugRepros.integration.test.ts +485 -0
- package/src/__tests__/builtinmodule.unit.test.ts +15 -0
- package/src/__tests__/commandArgs.integration.test.ts +291 -0
- package/src/__tests__/crossServerPlayer.integration.test.ts +176 -0
- package/src/__tests__/economy/claim.integration.test.ts +250 -0
- package/src/__tests__/economy/economyUtils.integration.test.ts +495 -0
- package/src/__tests__/economy/shop.integration.test.ts +177 -0
- package/src/__tests__/economy/zombieKillReward.integration.test.ts +293 -0
- package/src/__tests__/geoblock.integration.test.ts +322 -0
- package/src/__tests__/gimme.integration.test.ts +106 -0
- package/src/__tests__/help.integration.test.ts +314 -0
- package/src/__tests__/highPingKicker.integration.test.ts +618 -0
- package/src/__tests__/lottery.integration.test.ts +344 -0
- package/src/__tests__/modulePermission.integration.test.ts +387 -0
- package/src/__tests__/onboarding.integration.test.ts +122 -0
- package/src/__tests__/ping.integration.test.ts +36 -0
- package/src/__tests__/roleExpiry.integration.test.ts +78 -0
- package/src/__tests__/serverMessages.integration.test.ts +116 -0
- package/src/__tests__/systemConfigCooldown.integration.test.ts +84 -0
- package/src/__tests__/systemConfigCost.integration.test.ts +194 -0
- package/src/__tests__/teleports/listtp.integration.test.ts +189 -0
- package/src/__tests__/teleports/publicteleports.integration.test.ts +345 -0
- package/src/__tests__/teleports/teleport.integration.test.ts +153 -0
- package/src/__tests__/teleports/tpManagement.integration.test.ts +175 -0
- package/src/__tests__/teleports/waypoints.integration.test.ts +832 -0
- package/src/community-modules/README.md +5 -0
- package/src/community-modules/modules/vote.json +19 -0
- package/src/dto/base.ts +13 -0
- package/src/dto/discordEvents.ts +69 -0
- package/src/dto/gameEvents.ts +159 -0
- package/src/dto/index.ts +25 -0
- package/src/dto/takaroEvents.ts +525 -0
- package/src/main.ts +47 -0
- package/src/modules/.eslintrc +5 -0
- package/src/modules/chatBridge/hooks/DiscordToGame.js +18 -0
- package/src/modules/chatBridge/hooks/GameToDiscord.js +18 -0
- package/src/modules/chatBridge/hooks/PlayerConnected.js +11 -0
- package/src/modules/chatBridge/hooks/PlayerDisconnected.js +11 -0
- package/src/modules/chatBridge/index.ts +64 -0
- package/src/modules/dailyRewards/commands/daily.js +114 -0
- package/src/modules/dailyRewards/commands/streak.js +42 -0
- package/src/modules/dailyRewards/commands/topstreak.js +54 -0
- package/src/modules/dailyRewards/functions/utils.js +36 -0
- package/src/modules/dailyRewards/hooks/dailyLoginCheck.js +24 -0
- package/src/modules/dailyRewards/index.ts +138 -0
- package/src/modules/economyUtils/commands/balance.js +8 -0
- package/src/modules/economyUtils/commands/claim.js +42 -0
- package/src/modules/economyUtils/commands/confirmTransfer.js +55 -0
- package/src/modules/economyUtils/commands/grantCurrency.js +34 -0
- package/src/modules/economyUtils/commands/revokeCurrency.js +34 -0
- package/src/modules/economyUtils/commands/shop.js +87 -0
- package/src/modules/economyUtils/commands/topCurrency.js +29 -0
- package/src/modules/economyUtils/commands/transfer.js +73 -0
- package/src/modules/economyUtils/cronJobs/zombieKillReward.js +82 -0
- package/src/modules/economyUtils/index.ts +197 -0
- package/src/modules/geoBlock/hooks/IPDetected.js +53 -0
- package/src/modules/geoBlock/index.ts +333 -0
- package/src/modules/gimme/commands/gimme.js +30 -0
- package/src/modules/gimme/index.ts +76 -0
- package/src/modules/highPingKicker/cronJobs/Ping check.js +68 -0
- package/src/modules/highPingKicker/index.ts +44 -0
- package/src/modules/lottery/commands/buyTicket.js +64 -0
- package/src/modules/lottery/commands/nextDraw.js +47 -0
- package/src/modules/lottery/commands/viewTickets.js +28 -0
- package/src/modules/lottery/cronJobs/drawLottery.js +124 -0
- package/src/modules/lottery/index.ts +86 -0
- package/src/modules/playerOnboarding/commands/starterkit.js +61 -0
- package/src/modules/playerOnboarding/hooks/playerConnected.js +14 -0
- package/src/modules/playerOnboarding/index.ts +86 -0
- package/src/modules/serverMessages/cronJobs/Automated message.js +47 -0
- package/src/modules/serverMessages/index.ts +46 -0
- package/src/modules/teleports/commands/deletetp.js +25 -0
- package/src/modules/teleports/commands/deletewaypoint.js +24 -0
- package/src/modules/teleports/commands/listwaypoints.js +23 -0
- package/src/modules/teleports/commands/setprivate.js +39 -0
- package/src/modules/teleports/commands/setpublic.js +60 -0
- package/src/modules/teleports/commands/settp.js +50 -0
- package/src/modules/teleports/commands/setwaypoint.js +31 -0
- package/src/modules/teleports/commands/teleport.js +84 -0
- package/src/modules/teleports/commands/teleportwaypoint.js +57 -0
- package/src/modules/teleports/commands/tplist.js +62 -0
- package/src/modules/teleports/cronJobs/Waypoint reconciler.js +7 -0
- package/src/modules/teleports/functions/utils.js +189 -0
- package/src/modules/teleports/index.ts +217 -0
- package/src/modules/timedShutdown/cronJobs/Shutdown.js +8 -0
- package/src/modules/timedShutdown/cronJobs/warning.js +13 -0
- package/src/modules/timedShutdown/index.ts +45 -0
- package/src/modules/utils/commands/help.js +100 -0
- package/src/modules/utils/commands/ping.js +7 -0
- package/src/modules/utils/index.ts +53 -0
- package/tsconfig.build.json +10 -0
- package/tsconfig.json +9 -0
- package/typedoc.json +3 -0
package/package.json
ADDED
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@takaro/modules",
|
|
3
|
+
"version": "0.0.0-next.0da151e",
|
|
4
|
+
"description": "Built-in modules for Takaro",
|
|
5
|
+
"main": "dist/main.js",
|
|
6
|
+
"types": "dist/main.d.ts",
|
|
7
|
+
"type": "module",
|
|
8
|
+
"scripts": {
|
|
9
|
+
"start:dev": "tsc --watch --preserveWatchOutput -p ./tsconfig.build.json",
|
|
10
|
+
"build": "tsc -p ./tsconfig.build.json",
|
|
11
|
+
"postbuild": "npm run build:builtin-json",
|
|
12
|
+
"build:builtin-json": "node --import=ts-node-maintained/register/esm ./scripts/buildBuiltinJson.ts"
|
|
13
|
+
},
|
|
14
|
+
"keywords": [],
|
|
15
|
+
"author": "",
|
|
16
|
+
"license": "ISC"
|
|
17
|
+
}
|
|
@@ -0,0 +1,81 @@
|
|
|
1
|
+
import 'reflect-metadata';
|
|
2
|
+
import { getModules } from '@takaro/modules';
|
|
3
|
+
import { writeFile } from 'fs/promises';
|
|
4
|
+
import { readdir, readFile, stat } from 'node:fs/promises';
|
|
5
|
+
import path from 'path';
|
|
6
|
+
|
|
7
|
+
const __dirname = path.dirname(new URL(import.meta.url).pathname);
|
|
8
|
+
|
|
9
|
+
async function main() {
|
|
10
|
+
// Built in modules
|
|
11
|
+
// TODO: we should probably 'export' them in CI and save it as JSON so it's consistent with the community modules
|
|
12
|
+
const modules = getModules();
|
|
13
|
+
const modulesJson = JSON.stringify(modules, null, 2);
|
|
14
|
+
await writeFile('dist/modules.json', modulesJson);
|
|
15
|
+
await writeFile('../web-docs/docs/modules/modules.json', modulesJson);
|
|
16
|
+
await writeFile('../e2e/src/web-main/fixtures/modules.json', modulesJson);
|
|
17
|
+
|
|
18
|
+
// Community modules
|
|
19
|
+
const files = await readdir(`${__dirname}/../src/community-modules/modules`);
|
|
20
|
+
const communityModules: Array<string> = [];
|
|
21
|
+
|
|
22
|
+
for (const file of files) {
|
|
23
|
+
const content = await readFile(`${__dirname}/../src/community-modules/modules/${file}`, 'utf-8');
|
|
24
|
+
communityModules.push(JSON.parse(content));
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
const communityModulesJson = JSON.stringify(communityModules, null, 2);
|
|
28
|
+
await writeFile('dist/community-modules.json', communityModulesJson);
|
|
29
|
+
await writeFile('../web-docs/docs/community-modules.json', communityModulesJson);
|
|
30
|
+
await writeFile('../e2e/src/web-main/fixtures/community-modules.json', communityModulesJson);
|
|
31
|
+
|
|
32
|
+
const startMarker = '{/* AUTO-GENERATED CONTENT () */}';
|
|
33
|
+
const endMarker = '{/* END AUTO-GENERATED CONTENT */}';
|
|
34
|
+
|
|
35
|
+
// Generate docs pages for each builtin module
|
|
36
|
+
for (const mod of modules) {
|
|
37
|
+
const fileExists = await stat(`../web-docs/docs/modules/${mod.name}.mdx`).catch(() => null);
|
|
38
|
+
// This is also generated, but docusaurus takes the first content of the page as the title, so we cannot put the auto-generated content at the top
|
|
39
|
+
const autoGeneratedContent = `---
|
|
40
|
+
description: ${mod.versions.find((v) => v.tag === 'latest')?.description}
|
|
41
|
+
---
|
|
42
|
+
|
|
43
|
+
${startMarker}
|
|
44
|
+
|
|
45
|
+
import { Commands, Config, CronJobs, Hooks } from './helpers';
|
|
46
|
+
|
|
47
|
+
# ${mod.name}
|
|
48
|
+
|
|
49
|
+
export function Module() {
|
|
50
|
+
const mod = ${JSON.stringify(mod, null, 2)};
|
|
51
|
+
|
|
52
|
+
return (
|
|
53
|
+
<div>
|
|
54
|
+
<p>{mod.versions[0].description}</p>
|
|
55
|
+
<Commands commands={mod.versions[0].commands} />
|
|
56
|
+
<CronJobs cronJobs={mod.versions[0].cronJobs} />
|
|
57
|
+
<Hooks hooks={mod.versions[0].hooks} />
|
|
58
|
+
<Config configSchema={mod.versions[0].configSchema} />
|
|
59
|
+
</div>
|
|
60
|
+
)
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
<Module />
|
|
64
|
+
|
|
65
|
+
${endMarker}`;
|
|
66
|
+
|
|
67
|
+
// If file doesnt exist yet, create it
|
|
68
|
+
if (!fileExists) {
|
|
69
|
+
await writeFile(`../web-docs/docs/modules/${mod.name}.mdx`, autoGeneratedContent);
|
|
70
|
+
} else {
|
|
71
|
+
const existingFile = await readFile(`../web-docs/docs/modules/${mod.name}.mdx`, 'utf-8');
|
|
72
|
+
// Otherwise, fine the auto generated content markers and replace it
|
|
73
|
+
const end = existingFile.indexOf(endMarker) + endMarker.length;
|
|
74
|
+
|
|
75
|
+
const newFile = autoGeneratedContent + existingFile.slice(end);
|
|
76
|
+
await writeFile(`../web-docs/docs/modules/${mod.name}.mdx`, newFile);
|
|
77
|
+
}
|
|
78
|
+
}
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
main().catch(console.error);
|
|
@@ -0,0 +1,159 @@
|
|
|
1
|
+
import { readFileSync, readdirSync } from 'fs';
|
|
2
|
+
import path from 'path';
|
|
3
|
+
import * as url from 'url';
|
|
4
|
+
import { IsString, IsOptional, IsNumber, IsArray, ValidateNested, IsEnum, IsBoolean } from 'class-validator';
|
|
5
|
+
import { Type } from 'class-transformer';
|
|
6
|
+
import { EventTypes, HookEvents } from './dto/index.js';
|
|
7
|
+
import { TakaroDTO } from '@takaro/util';
|
|
8
|
+
|
|
9
|
+
const __dirname = url.fileURLToPath(new URL('.', import.meta.url));
|
|
10
|
+
|
|
11
|
+
export class ICommandArgument extends TakaroDTO<ICommandArgument> {
|
|
12
|
+
@IsString()
|
|
13
|
+
name: string;
|
|
14
|
+
@IsString()
|
|
15
|
+
type: string;
|
|
16
|
+
@IsString()
|
|
17
|
+
@IsOptional()
|
|
18
|
+
helpText?: string;
|
|
19
|
+
@IsString()
|
|
20
|
+
@IsOptional()
|
|
21
|
+
defaultValue?: string | null;
|
|
22
|
+
@IsNumber()
|
|
23
|
+
@IsOptional()
|
|
24
|
+
position?: number;
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
export class ICommand extends TakaroDTO<ICommand> {
|
|
28
|
+
@IsString()
|
|
29
|
+
name: string;
|
|
30
|
+
@IsString()
|
|
31
|
+
@IsOptional()
|
|
32
|
+
description?: string;
|
|
33
|
+
@IsString()
|
|
34
|
+
function: string;
|
|
35
|
+
@IsString()
|
|
36
|
+
trigger: string;
|
|
37
|
+
@IsString()
|
|
38
|
+
@IsOptional()
|
|
39
|
+
helpText?: string;
|
|
40
|
+
@ValidateNested({ each: true })
|
|
41
|
+
@Type(() => ICommandArgument)
|
|
42
|
+
@IsOptional()
|
|
43
|
+
arguments: ICommandArgument[];
|
|
44
|
+
@IsArray()
|
|
45
|
+
@IsString({ each: true })
|
|
46
|
+
@IsOptional()
|
|
47
|
+
requiredPermissions?: string[];
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
export class IHook extends TakaroDTO<IHook> {
|
|
51
|
+
@IsString()
|
|
52
|
+
name: string;
|
|
53
|
+
@IsString()
|
|
54
|
+
@IsOptional()
|
|
55
|
+
description?: string;
|
|
56
|
+
@IsString()
|
|
57
|
+
function: string;
|
|
58
|
+
@IsEnum(Object.values(HookEvents))
|
|
59
|
+
eventType: EventTypes;
|
|
60
|
+
@IsString()
|
|
61
|
+
@IsOptional()
|
|
62
|
+
regex?: string;
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
export class ICronJob extends TakaroDTO<ICronJob> {
|
|
66
|
+
@IsString()
|
|
67
|
+
name: string;
|
|
68
|
+
@IsString()
|
|
69
|
+
@IsOptional()
|
|
70
|
+
description?: string;
|
|
71
|
+
@IsString()
|
|
72
|
+
function: string;
|
|
73
|
+
@IsString()
|
|
74
|
+
temporalValue: string;
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
export class IFunction extends TakaroDTO<IFunction> {
|
|
78
|
+
@IsString()
|
|
79
|
+
name: string;
|
|
80
|
+
@IsString()
|
|
81
|
+
@IsOptional()
|
|
82
|
+
description?: string;
|
|
83
|
+
@IsString()
|
|
84
|
+
function: string;
|
|
85
|
+
}
|
|
86
|
+
|
|
87
|
+
export class IPermission extends TakaroDTO<IPermission> {
|
|
88
|
+
@IsString()
|
|
89
|
+
permission: string;
|
|
90
|
+
@IsString()
|
|
91
|
+
description: string;
|
|
92
|
+
@IsString()
|
|
93
|
+
friendlyName: string;
|
|
94
|
+
@IsOptional()
|
|
95
|
+
@IsBoolean()
|
|
96
|
+
canHaveCount?: boolean;
|
|
97
|
+
}
|
|
98
|
+
|
|
99
|
+
export class ModuleTransferVersionDTO<T> extends TakaroDTO<T> {
|
|
100
|
+
@IsString()
|
|
101
|
+
public tag: string;
|
|
102
|
+
@IsString()
|
|
103
|
+
public description: string;
|
|
104
|
+
@IsString()
|
|
105
|
+
public configSchema: string;
|
|
106
|
+
@IsString()
|
|
107
|
+
public uiSchema: string;
|
|
108
|
+
@ValidateNested({ each: true })
|
|
109
|
+
@Type(() => ICommand)
|
|
110
|
+
@IsOptional()
|
|
111
|
+
public commands?: Array<ICommand>;
|
|
112
|
+
@ValidateNested({ each: true })
|
|
113
|
+
@Type(() => IHook)
|
|
114
|
+
@IsOptional()
|
|
115
|
+
public hooks?: Array<IHook>;
|
|
116
|
+
@ValidateNested({ each: true })
|
|
117
|
+
@Type(() => ICronJob)
|
|
118
|
+
@IsOptional()
|
|
119
|
+
public cronJobs?: Array<ICronJob>;
|
|
120
|
+
@ValidateNested({ each: true })
|
|
121
|
+
@Type(() => IFunction)
|
|
122
|
+
@IsOptional()
|
|
123
|
+
public functions?: Array<IFunction>;
|
|
124
|
+
@IsArray()
|
|
125
|
+
@Type(() => IPermission)
|
|
126
|
+
@ValidateNested({ each: true })
|
|
127
|
+
@IsOptional()
|
|
128
|
+
public permissions?: IPermission[];
|
|
129
|
+
}
|
|
130
|
+
|
|
131
|
+
export class ModuleTransferDTO<T> extends TakaroDTO<T> {
|
|
132
|
+
@IsString()
|
|
133
|
+
public name: string;
|
|
134
|
+
@IsString()
|
|
135
|
+
@IsOptional()
|
|
136
|
+
takaroVersion = process.env.TAKARO_VERSION;
|
|
137
|
+
@IsString()
|
|
138
|
+
@IsOptional()
|
|
139
|
+
public author?: string;
|
|
140
|
+
@IsArray()
|
|
141
|
+
@IsString({ each: true })
|
|
142
|
+
@IsOptional()
|
|
143
|
+
public supportedGames?: string[];
|
|
144
|
+
|
|
145
|
+
@ValidateNested({ each: true })
|
|
146
|
+
@Type(() => ModuleTransferVersionDTO)
|
|
147
|
+
versions: ModuleTransferVersionDTO<T>[];
|
|
148
|
+
|
|
149
|
+
protected loadFn(type: 'commands' | 'hooks' | 'cronJobs' | 'functions', name: string) {
|
|
150
|
+
const folderPath = path.join(__dirname, 'modules', this.name, type);
|
|
151
|
+
const files = readdirSync(folderPath);
|
|
152
|
+
const file = files.find((file) => file.replace('.js', '') === name);
|
|
153
|
+
if (!file) {
|
|
154
|
+
throw new Error(`Could not find ${name} in ${this.name}'s ${type}. Did you provide a function implementation?`);
|
|
155
|
+
}
|
|
156
|
+
|
|
157
|
+
return readFileSync(path.join(folderPath, file), 'utf-8');
|
|
158
|
+
}
|
|
159
|
+
}
|
|
@@ -0,0 +1,90 @@
|
|
|
1
|
+
import { IntegrationTest, expect, IModuleTestsSetupData, modulesTestSetup, EventsAwaiter } from '@takaro/test';
|
|
2
|
+
import { GameEvents } from '../dto/index.js';
|
|
3
|
+
import { describe } from 'node:test';
|
|
4
|
+
|
|
5
|
+
const group = 'Aliases';
|
|
6
|
+
|
|
7
|
+
const tests = [
|
|
8
|
+
new IntegrationTest<IModuleTestsSetupData>({
|
|
9
|
+
group,
|
|
10
|
+
snapshot: false,
|
|
11
|
+
setup: modulesTestSetup,
|
|
12
|
+
name: 'Can install and use aliases',
|
|
13
|
+
test: async function () {
|
|
14
|
+
await this.client.module.moduleInstallationsControllerInstallModule({
|
|
15
|
+
gameServerId: this.setupData.gameserver.id,
|
|
16
|
+
versionId: this.setupData.teleportsModule.latestVersion.id,
|
|
17
|
+
systemConfig: JSON.stringify({
|
|
18
|
+
commands: {
|
|
19
|
+
teleport: {
|
|
20
|
+
delay: 0,
|
|
21
|
+
aliases: ['tp', 'tellyport'],
|
|
22
|
+
},
|
|
23
|
+
},
|
|
24
|
+
}),
|
|
25
|
+
});
|
|
26
|
+
|
|
27
|
+
const setEvents = (await new EventsAwaiter().connect(this.client)).waitForEvents(GameEvents.CHAT_MESSAGE, 1);
|
|
28
|
+
await this.client.command.commandControllerTrigger(this.setupData.gameserver.id, {
|
|
29
|
+
msg: '/settp test',
|
|
30
|
+
playerId: this.setupData.players[0].id,
|
|
31
|
+
});
|
|
32
|
+
|
|
33
|
+
expect((await setEvents).length).to.be.eq(1);
|
|
34
|
+
expect((await setEvents)[0].data.meta.msg).to.be.eq('Teleport test set.');
|
|
35
|
+
|
|
36
|
+
const events = (await new EventsAwaiter().connect(this.client)).waitForEvents(GameEvents.CHAT_MESSAGE, 1);
|
|
37
|
+
await this.client.command.commandControllerTrigger(this.setupData.gameserver.id, {
|
|
38
|
+
msg: '/tellyport test',
|
|
39
|
+
playerId: this.setupData.players[0].id,
|
|
40
|
+
});
|
|
41
|
+
|
|
42
|
+
expect((await events).length).to.be.eq(1);
|
|
43
|
+
expect((await events)[0].data.meta.msg).to.be.eq('Teleported to test.');
|
|
44
|
+
},
|
|
45
|
+
}),
|
|
46
|
+
new IntegrationTest<IModuleTestsSetupData>({
|
|
47
|
+
group,
|
|
48
|
+
snapshot: false,
|
|
49
|
+
setup: modulesTestSetup,
|
|
50
|
+
name: 'Aliases are case insensitive',
|
|
51
|
+
test: async function () {
|
|
52
|
+
await this.client.module.moduleInstallationsControllerInstallModule({
|
|
53
|
+
gameServerId: this.setupData.gameserver.id,
|
|
54
|
+
versionId: this.setupData.teleportsModule.latestVersion.id,
|
|
55
|
+
systemConfig: JSON.stringify({
|
|
56
|
+
commands: {
|
|
57
|
+
teleport: {
|
|
58
|
+
delay: 0,
|
|
59
|
+
aliases: ['tp', 'tellyport'],
|
|
60
|
+
},
|
|
61
|
+
},
|
|
62
|
+
}),
|
|
63
|
+
});
|
|
64
|
+
|
|
65
|
+
const setEvents = (await new EventsAwaiter().connect(this.client)).waitForEvents(GameEvents.CHAT_MESSAGE, 1);
|
|
66
|
+
await this.client.command.commandControllerTrigger(this.setupData.gameserver.id, {
|
|
67
|
+
msg: '/settp test',
|
|
68
|
+
playerId: this.setupData.players[0].id,
|
|
69
|
+
});
|
|
70
|
+
|
|
71
|
+
expect((await setEvents).length).to.be.eq(1);
|
|
72
|
+
expect((await setEvents)[0].data.meta.msg).to.be.eq('Teleport test set.');
|
|
73
|
+
|
|
74
|
+
const events = (await new EventsAwaiter().connect(this.client)).waitForEvents(GameEvents.CHAT_MESSAGE, 1);
|
|
75
|
+
await this.client.command.commandControllerTrigger(this.setupData.gameserver.id, {
|
|
76
|
+
msg: '/TelLyPoRt test',
|
|
77
|
+
playerId: this.setupData.players[0].id,
|
|
78
|
+
});
|
|
79
|
+
|
|
80
|
+
expect((await events).length).to.be.eq(1);
|
|
81
|
+
expect((await events)[0].data.meta.msg).to.be.eq('Teleported to test.');
|
|
82
|
+
},
|
|
83
|
+
}),
|
|
84
|
+
];
|
|
85
|
+
|
|
86
|
+
describe(group, function () {
|
|
87
|
+
tests.forEach((test) => {
|
|
88
|
+
test.run();
|
|
89
|
+
});
|
|
90
|
+
});
|