@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/README.md
ADDED
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
import { EventTypes } from './dto/index.js';
|
|
2
|
+
import { TakaroDTO } from '@takaro/util';
|
|
3
|
+
export declare class ICommandArgument extends TakaroDTO<ICommandArgument> {
|
|
4
|
+
name: string;
|
|
5
|
+
type: string;
|
|
6
|
+
helpText?: string;
|
|
7
|
+
defaultValue?: string | null;
|
|
8
|
+
position?: number;
|
|
9
|
+
}
|
|
10
|
+
export declare class ICommand extends TakaroDTO<ICommand> {
|
|
11
|
+
name: string;
|
|
12
|
+
description?: string;
|
|
13
|
+
function: string;
|
|
14
|
+
trigger: string;
|
|
15
|
+
helpText?: string;
|
|
16
|
+
arguments: ICommandArgument[];
|
|
17
|
+
requiredPermissions?: string[];
|
|
18
|
+
}
|
|
19
|
+
export declare class IHook extends TakaroDTO<IHook> {
|
|
20
|
+
name: string;
|
|
21
|
+
description?: string;
|
|
22
|
+
function: string;
|
|
23
|
+
eventType: EventTypes;
|
|
24
|
+
regex?: string;
|
|
25
|
+
}
|
|
26
|
+
export declare class ICronJob extends TakaroDTO<ICronJob> {
|
|
27
|
+
name: string;
|
|
28
|
+
description?: string;
|
|
29
|
+
function: string;
|
|
30
|
+
temporalValue: string;
|
|
31
|
+
}
|
|
32
|
+
export declare class IFunction extends TakaroDTO<IFunction> {
|
|
33
|
+
name: string;
|
|
34
|
+
description?: string;
|
|
35
|
+
function: string;
|
|
36
|
+
}
|
|
37
|
+
export declare class IPermission extends TakaroDTO<IPermission> {
|
|
38
|
+
permission: string;
|
|
39
|
+
description: string;
|
|
40
|
+
friendlyName: string;
|
|
41
|
+
canHaveCount?: boolean;
|
|
42
|
+
}
|
|
43
|
+
export declare class ModuleTransferVersionDTO<T> extends TakaroDTO<T> {
|
|
44
|
+
tag: string;
|
|
45
|
+
description: string;
|
|
46
|
+
configSchema: string;
|
|
47
|
+
uiSchema: string;
|
|
48
|
+
commands?: Array<ICommand>;
|
|
49
|
+
hooks?: Array<IHook>;
|
|
50
|
+
cronJobs?: Array<ICronJob>;
|
|
51
|
+
functions?: Array<IFunction>;
|
|
52
|
+
permissions?: IPermission[];
|
|
53
|
+
}
|
|
54
|
+
export declare class ModuleTransferDTO<T> extends TakaroDTO<T> {
|
|
55
|
+
name: string;
|
|
56
|
+
takaroVersion: string | undefined;
|
|
57
|
+
author?: string;
|
|
58
|
+
supportedGames?: string[];
|
|
59
|
+
versions: ModuleTransferVersionDTO<T>[];
|
|
60
|
+
protected loadFn(type: 'commands' | 'hooks' | 'cronJobs' | 'functions', name: string): string;
|
|
61
|
+
}
|
|
62
|
+
//# sourceMappingURL=BuiltinModule.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"BuiltinModule.d.ts","sourceRoot":"","sources":["../src/BuiltinModule.ts"],"names":[],"mappings":"AAKA,OAAO,EAAE,UAAU,EAAc,MAAM,gBAAgB,CAAC;AACxD,OAAO,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AAIzC,qBAAa,gBAAiB,SAAQ,SAAS,CAAC,gBAAgB,CAAC;IAE/D,IAAI,EAAE,MAAM,CAAC;IAEb,IAAI,EAAE,MAAM,CAAC;IAGb,QAAQ,CAAC,EAAE,MAAM,CAAC;IAGlB,YAAY,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IAG7B,QAAQ,CAAC,EAAE,MAAM,CAAC;CACnB;AAED,qBAAa,QAAS,SAAQ,SAAS,CAAC,QAAQ,CAAC;IAE/C,IAAI,EAAE,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AC,CAAC;IAI3B,KAAK,CAAC,EAAE,KAAK,CAAC,KAAK,CAAC,CAAC;IAIrB,QAAQ,CAAC,EAAE,KAAK,CAAC,QAAQ,CAAC,CAAC;IAI3B,SAAS,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC,CAAC;IAK7B,WAAW,CAAC,EAAE,WAAW,EAAE,CAAC;CACpC;AAED,qBAAa,iBAAiB,CAAC,CAAC,CAAE,SAAQ,SAAS,CAAC,CAAC,CAAC;IAE7C,IAAI,EAAE,MAAM,CAAC;IAGpB,aAAa,qBAA8B;IAGpC,MAAM,CAAC,EAAE,MAAM,CAAC;IAIhB,cAAc,CAAC,EAAE,MAAM,EAAE,CAAC;IAIjC,QAAQ,EAAE,wBAAwB,CAAC,CAAC,CAAC,EAAE,CAAC;IAExC,SAAS,CAAC,MAAM,CAAC,IAAI,EAAE,UAAU,GAAG,OAAO,GAAG,UAAU,GAAG,WAAW,EAAE,IAAI,EAAE,MAAM;CAUrF"}
|
|
@@ -0,0 +1,245 @@
|
|
|
1
|
+
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
2
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
3
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
4
|
+
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
5
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
6
|
+
};
|
|
7
|
+
var __metadata = (this && this.__metadata) || function (k, v) {
|
|
8
|
+
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
|
9
|
+
};
|
|
10
|
+
import { readFileSync, readdirSync } from 'fs';
|
|
11
|
+
import path from 'path';
|
|
12
|
+
import * as url from 'url';
|
|
13
|
+
import { IsString, IsOptional, IsNumber, IsArray, ValidateNested, IsEnum, IsBoolean } from 'class-validator';
|
|
14
|
+
import { Type } from 'class-transformer';
|
|
15
|
+
import { HookEvents } from './dto/index.js';
|
|
16
|
+
import { TakaroDTO } from '@takaro/util';
|
|
17
|
+
const __dirname = url.fileURLToPath(new URL('.', import.meta.url));
|
|
18
|
+
export class ICommandArgument extends TakaroDTO {
|
|
19
|
+
}
|
|
20
|
+
__decorate([
|
|
21
|
+
IsString(),
|
|
22
|
+
__metadata("design:type", String)
|
|
23
|
+
], ICommandArgument.prototype, "name", void 0);
|
|
24
|
+
__decorate([
|
|
25
|
+
IsString(),
|
|
26
|
+
__metadata("design:type", String)
|
|
27
|
+
], ICommandArgument.prototype, "type", void 0);
|
|
28
|
+
__decorate([
|
|
29
|
+
IsString(),
|
|
30
|
+
IsOptional(),
|
|
31
|
+
__metadata("design:type", String)
|
|
32
|
+
], ICommandArgument.prototype, "helpText", void 0);
|
|
33
|
+
__decorate([
|
|
34
|
+
IsString(),
|
|
35
|
+
IsOptional(),
|
|
36
|
+
__metadata("design:type", Object)
|
|
37
|
+
], ICommandArgument.prototype, "defaultValue", void 0);
|
|
38
|
+
__decorate([
|
|
39
|
+
IsNumber(),
|
|
40
|
+
IsOptional(),
|
|
41
|
+
__metadata("design:type", Number)
|
|
42
|
+
], ICommandArgument.prototype, "position", void 0);
|
|
43
|
+
export class ICommand extends TakaroDTO {
|
|
44
|
+
}
|
|
45
|
+
__decorate([
|
|
46
|
+
IsString(),
|
|
47
|
+
__metadata("design:type", String)
|
|
48
|
+
], ICommand.prototype, "name", void 0);
|
|
49
|
+
__decorate([
|
|
50
|
+
IsString(),
|
|
51
|
+
IsOptional(),
|
|
52
|
+
__metadata("design:type", String)
|
|
53
|
+
], ICommand.prototype, "description", void 0);
|
|
54
|
+
__decorate([
|
|
55
|
+
IsString(),
|
|
56
|
+
__metadata("design:type", String)
|
|
57
|
+
], ICommand.prototype, "function", void 0);
|
|
58
|
+
__decorate([
|
|
59
|
+
IsString(),
|
|
60
|
+
__metadata("design:type", String)
|
|
61
|
+
], ICommand.prototype, "trigger", void 0);
|
|
62
|
+
__decorate([
|
|
63
|
+
IsString(),
|
|
64
|
+
IsOptional(),
|
|
65
|
+
__metadata("design:type", String)
|
|
66
|
+
], ICommand.prototype, "helpText", void 0);
|
|
67
|
+
__decorate([
|
|
68
|
+
ValidateNested({ each: true }),
|
|
69
|
+
Type(() => ICommandArgument),
|
|
70
|
+
IsOptional(),
|
|
71
|
+
__metadata("design:type", Array)
|
|
72
|
+
], ICommand.prototype, "arguments", void 0);
|
|
73
|
+
__decorate([
|
|
74
|
+
IsArray(),
|
|
75
|
+
IsString({ each: true }),
|
|
76
|
+
IsOptional(),
|
|
77
|
+
__metadata("design:type", Array)
|
|
78
|
+
], ICommand.prototype, "requiredPermissions", void 0);
|
|
79
|
+
export class IHook extends TakaroDTO {
|
|
80
|
+
}
|
|
81
|
+
__decorate([
|
|
82
|
+
IsString(),
|
|
83
|
+
__metadata("design:type", String)
|
|
84
|
+
], IHook.prototype, "name", void 0);
|
|
85
|
+
__decorate([
|
|
86
|
+
IsString(),
|
|
87
|
+
IsOptional(),
|
|
88
|
+
__metadata("design:type", String)
|
|
89
|
+
], IHook.prototype, "description", void 0);
|
|
90
|
+
__decorate([
|
|
91
|
+
IsString(),
|
|
92
|
+
__metadata("design:type", String)
|
|
93
|
+
], IHook.prototype, "function", void 0);
|
|
94
|
+
__decorate([
|
|
95
|
+
IsEnum(Object.values(HookEvents)),
|
|
96
|
+
__metadata("design:type", String)
|
|
97
|
+
], IHook.prototype, "eventType", void 0);
|
|
98
|
+
__decorate([
|
|
99
|
+
IsString(),
|
|
100
|
+
IsOptional(),
|
|
101
|
+
__metadata("design:type", String)
|
|
102
|
+
], IHook.prototype, "regex", void 0);
|
|
103
|
+
export class ICronJob extends TakaroDTO {
|
|
104
|
+
}
|
|
105
|
+
__decorate([
|
|
106
|
+
IsString(),
|
|
107
|
+
__metadata("design:type", String)
|
|
108
|
+
], ICronJob.prototype, "name", void 0);
|
|
109
|
+
__decorate([
|
|
110
|
+
IsString(),
|
|
111
|
+
IsOptional(),
|
|
112
|
+
__metadata("design:type", String)
|
|
113
|
+
], ICronJob.prototype, "description", void 0);
|
|
114
|
+
__decorate([
|
|
115
|
+
IsString(),
|
|
116
|
+
__metadata("design:type", String)
|
|
117
|
+
], ICronJob.prototype, "function", void 0);
|
|
118
|
+
__decorate([
|
|
119
|
+
IsString(),
|
|
120
|
+
__metadata("design:type", String)
|
|
121
|
+
], ICronJob.prototype, "temporalValue", void 0);
|
|
122
|
+
export class IFunction extends TakaroDTO {
|
|
123
|
+
}
|
|
124
|
+
__decorate([
|
|
125
|
+
IsString(),
|
|
126
|
+
__metadata("design:type", String)
|
|
127
|
+
], IFunction.prototype, "name", void 0);
|
|
128
|
+
__decorate([
|
|
129
|
+
IsString(),
|
|
130
|
+
IsOptional(),
|
|
131
|
+
__metadata("design:type", String)
|
|
132
|
+
], IFunction.prototype, "description", void 0);
|
|
133
|
+
__decorate([
|
|
134
|
+
IsString(),
|
|
135
|
+
__metadata("design:type", String)
|
|
136
|
+
], IFunction.prototype, "function", void 0);
|
|
137
|
+
export class IPermission extends TakaroDTO {
|
|
138
|
+
}
|
|
139
|
+
__decorate([
|
|
140
|
+
IsString(),
|
|
141
|
+
__metadata("design:type", String)
|
|
142
|
+
], IPermission.prototype, "permission", void 0);
|
|
143
|
+
__decorate([
|
|
144
|
+
IsString(),
|
|
145
|
+
__metadata("design:type", String)
|
|
146
|
+
], IPermission.prototype, "description", void 0);
|
|
147
|
+
__decorate([
|
|
148
|
+
IsString(),
|
|
149
|
+
__metadata("design:type", String)
|
|
150
|
+
], IPermission.prototype, "friendlyName", void 0);
|
|
151
|
+
__decorate([
|
|
152
|
+
IsOptional(),
|
|
153
|
+
IsBoolean(),
|
|
154
|
+
__metadata("design:type", Boolean)
|
|
155
|
+
], IPermission.prototype, "canHaveCount", void 0);
|
|
156
|
+
export class ModuleTransferVersionDTO extends TakaroDTO {
|
|
157
|
+
}
|
|
158
|
+
__decorate([
|
|
159
|
+
IsString(),
|
|
160
|
+
__metadata("design:type", String)
|
|
161
|
+
], ModuleTransferVersionDTO.prototype, "tag", void 0);
|
|
162
|
+
__decorate([
|
|
163
|
+
IsString(),
|
|
164
|
+
__metadata("design:type", String)
|
|
165
|
+
], ModuleTransferVersionDTO.prototype, "description", void 0);
|
|
166
|
+
__decorate([
|
|
167
|
+
IsString(),
|
|
168
|
+
__metadata("design:type", String)
|
|
169
|
+
], ModuleTransferVersionDTO.prototype, "configSchema", void 0);
|
|
170
|
+
__decorate([
|
|
171
|
+
IsString(),
|
|
172
|
+
__metadata("design:type", String)
|
|
173
|
+
], ModuleTransferVersionDTO.prototype, "uiSchema", void 0);
|
|
174
|
+
__decorate([
|
|
175
|
+
ValidateNested({ each: true }),
|
|
176
|
+
Type(() => ICommand),
|
|
177
|
+
IsOptional(),
|
|
178
|
+
__metadata("design:type", Array)
|
|
179
|
+
], ModuleTransferVersionDTO.prototype, "commands", void 0);
|
|
180
|
+
__decorate([
|
|
181
|
+
ValidateNested({ each: true }),
|
|
182
|
+
Type(() => IHook),
|
|
183
|
+
IsOptional(),
|
|
184
|
+
__metadata("design:type", Array)
|
|
185
|
+
], ModuleTransferVersionDTO.prototype, "hooks", void 0);
|
|
186
|
+
__decorate([
|
|
187
|
+
ValidateNested({ each: true }),
|
|
188
|
+
Type(() => ICronJob),
|
|
189
|
+
IsOptional(),
|
|
190
|
+
__metadata("design:type", Array)
|
|
191
|
+
], ModuleTransferVersionDTO.prototype, "cronJobs", void 0);
|
|
192
|
+
__decorate([
|
|
193
|
+
ValidateNested({ each: true }),
|
|
194
|
+
Type(() => IFunction),
|
|
195
|
+
IsOptional(),
|
|
196
|
+
__metadata("design:type", Array)
|
|
197
|
+
], ModuleTransferVersionDTO.prototype, "functions", void 0);
|
|
198
|
+
__decorate([
|
|
199
|
+
IsArray(),
|
|
200
|
+
Type(() => IPermission),
|
|
201
|
+
ValidateNested({ each: true }),
|
|
202
|
+
IsOptional(),
|
|
203
|
+
__metadata("design:type", Array)
|
|
204
|
+
], ModuleTransferVersionDTO.prototype, "permissions", void 0);
|
|
205
|
+
export class ModuleTransferDTO extends TakaroDTO {
|
|
206
|
+
constructor() {
|
|
207
|
+
super(...arguments);
|
|
208
|
+
this.takaroVersion = process.env.TAKARO_VERSION;
|
|
209
|
+
}
|
|
210
|
+
loadFn(type, name) {
|
|
211
|
+
const folderPath = path.join(__dirname, 'modules', this.name, type);
|
|
212
|
+
const files = readdirSync(folderPath);
|
|
213
|
+
const file = files.find((file) => file.replace('.js', '') === name);
|
|
214
|
+
if (!file) {
|
|
215
|
+
throw new Error(`Could not find ${name} in ${this.name}'s ${type}. Did you provide a function implementation?`);
|
|
216
|
+
}
|
|
217
|
+
return readFileSync(path.join(folderPath, file), 'utf-8');
|
|
218
|
+
}
|
|
219
|
+
}
|
|
220
|
+
__decorate([
|
|
221
|
+
IsString(),
|
|
222
|
+
__metadata("design:type", String)
|
|
223
|
+
], ModuleTransferDTO.prototype, "name", void 0);
|
|
224
|
+
__decorate([
|
|
225
|
+
IsString(),
|
|
226
|
+
IsOptional(),
|
|
227
|
+
__metadata("design:type", Object)
|
|
228
|
+
], ModuleTransferDTO.prototype, "takaroVersion", void 0);
|
|
229
|
+
__decorate([
|
|
230
|
+
IsString(),
|
|
231
|
+
IsOptional(),
|
|
232
|
+
__metadata("design:type", String)
|
|
233
|
+
], ModuleTransferDTO.prototype, "author", void 0);
|
|
234
|
+
__decorate([
|
|
235
|
+
IsArray(),
|
|
236
|
+
IsString({ each: true }),
|
|
237
|
+
IsOptional(),
|
|
238
|
+
__metadata("design:type", Array)
|
|
239
|
+
], ModuleTransferDTO.prototype, "supportedGames", void 0);
|
|
240
|
+
__decorate([
|
|
241
|
+
ValidateNested({ each: true }),
|
|
242
|
+
Type(() => ModuleTransferVersionDTO),
|
|
243
|
+
__metadata("design:type", Array)
|
|
244
|
+
], ModuleTransferDTO.prototype, "versions", void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QACpE,IAAI,CAAC,IAAI,EAAE,CAAC;YACV,MAAM,IAAI,KAAK,CAAC,kBAAkB,IAAI,OAAO,IAAI,CAAC,IAAI,MAAM,IAAI,8CAA8C,CAAC,CAAC;QAClH,CAAC;QAED,OAAO,YAAY,CAAC,IAAI,CAAC,IAAI,CAAC,UAAU,EAAE,IAAI,CAAC,EAAE,OAAO,CAAC,CAAC;IAC5D,CAAC;CACF;AA1BQ;IADN,QAAQ,EAAE;;+CACS;AAGpB;IAFC,QAAQ,EAAE;IACV,UAAU,EAAE;;wDAC8B;AAGpC;IAFN,QAAQ,EAAE;IACV,UAAU,EAAE;;iDACU;AAIhB;IAHN,OAAO,EAAE;IACT,QAAQ,CAAC,EAAE,IAAI,EAAE,IAAI,EAAE,CAAC;IACxB,UAAU,EAAE;;yDACoB;AAIjC;IAFC,cAAc,CAAC,EAAE,IAAI,EAAE,IAAI,EAAE,CAAC;IAC9B,IAAI,CAAC,GAAG,EAAE,CAAC,wBAAwB,CAAC;;mDACG"}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
[
|
|
2
|
+
{
|
|
3
|
+
"commands": [
|
|
4
|
+
{
|
|
5
|
+
"function": "\nimport { takaro, data, axios } from '@takaro/helpers';\nasync function main() {\n const { pog } = data;\n const playerRes = await takaro.player.playerControllerGetOne(data.player.id);\n const steamId = playerRes.data.data.steamId;\n const xboxLiveId = playerRes.data.data.xboxLiveId;\n const name = playerRes.data.data.name;\n const key = data.module.userConfig.votekey;\n\n let voteId = `username=${name}`;\n if (steamId.startsWith(\"7656\")) { voteId = `steamid=${steamId}`; }\n\n\n const res = await axios.get(`https://7daystodie-servers.com/api/?object=votes&element=claim&key=${key}&${voteId}`);\n if (res.data == 0) { data.player.pm(data.module.userConfig.didntvote); }\n if (res.data == 2) { data.player.pm(data.module.userConfig.alreadyvoted); }\n if (res.data == 1) {\n\n const claimresponse = await axios.post(`https://7daystodie-servers.com/api/?action=post&object=votes&element=claim&key=${key}&${voteId}`);\n if (claimresponse.data == 1) {\n if (data.module.userConfig.votednow.toLowerCase() !== 'none' && data.module.userConfig.votednow.toLowerCase() !== '\"none\"') { data.player.pm(data.module.userConfig.votednow); }\n if (data.module.userConfig.publicMessage.toLowerCase() !== 'none' && data.module.userConfig.publicMessage.toLowerCase() !== '\"none\"') {\n const originalMessage = data.module.userConfig.publicMessage;\n const modifiedMessage = originalMessage.replace(/\\{name\\}/g, name);\n await takaro.gameserver.gameServerControllerExecuteCommand(data.gameServerId, { command: `say \"${modifiedMessage}\"` });\n }\n await takaro.playerOnGameserver.playerOnGameServerControllerAddCurrency(data.gameServerId, pog.playerId, { currency: data.module.userConfig.currency });\n for (const stuff of data.module.userConfig.giveStuff) {\n if (voteId.startsWith(`steamid`)) {\n await takaro.gameserver.gameServerControllerExecuteCommand(data.gameServerId, { command: `giveplus Steam_${steamId} ${stuff}` });\n } else {\n await takaro.gameserver.gameServerControllerExecuteCommand(data.gameServerId, { command: `giveplus ${xboxLiveId} ${stuff}` });\n }\n }\n }\n }\n}\n\n\n\nawait main();",
|
|
6
|
+
"name": "vote",
|
|
7
|
+
"trigger": "vote",
|
|
8
|
+
"helpText": "Vote for the server and give players rewards.",
|
|
9
|
+
"arguments": []
|
|
10
|
+
}
|
|
11
|
+
],
|
|
12
|
+
"hooks": [],
|
|
13
|
+
"cronJobs": [],
|
|
14
|
+
"functions": [],
|
|
15
|
+
"permissions": [],
|
|
16
|
+
"name": "Vote",
|
|
17
|
+
"description": "Takaro Vote Module",
|
|
18
|
+
"configSchema": "{\"$schema\":\"http://json-schema.org/draft-07/schema#\",\"type\":\"object\",\"required\":[\"votekey\",\"didntvote\",\"alreadyvoted\"],\"additionalProperties\":false,\"properties\":{\"votekey\":{\"title\":\"votekey\",\"description\":\"Votekey from website\",\"default\":\"\",\"type\":\"string\"},\"didntvote\":{\"title\":\"didntvote\",\"description\":\"Message to send to the player when voting site reports no vote was cast.\",\"default\":\"You haven't voted yet.\",\"type\":\"string\"},\"alreadyvoted\":{\"title\":\"alreadyvoted\",\"description\":\"Message to send to the player when voting site reports the vote was already claimed.\",\"default\":\"You have already claimed your last vote.\",\"type\":\"string\"},\"votednow\":{\"title\":\"votednow\",\"description\":\"Optional message to send to the player when vote is successful. \\nUse \\\"none\\\" as the message if you want nothing to be sent instead.\",\"default\":\"Thanks for voting.\",\"type\":\"string\"},\"publicMessage\":{\"title\":\"publicMessage\",\"description\":\"Optional message to broadcast to all players online when vote is successful. Use {name} in the message to refer to the player name.\\nUse \\\"none\\\" as the message if you want nothing to be sent instead.\",\"default\":\"[FF0000]{name}[-] voted at 7daystodie-servers.com and was rewarded Takaro Coins!\",\"type\":\"string\"},\"giveStuff\":{\"title\":\"giveStuff\",\"description\":\"Items to give to the player thru giveplus command. Must indicate quantities and, if applies, quality:\\n<item name> <amount> [<quality> <usedTimes>]\\n\\nItem name has to be the exact name of an item as listed by \\\"listitems\\\".\\n\\nQuality is the quality of the dropped items for items that have a quality.\\n\\nusedTimes is the % that the item was used.\\n\\nThe default value is giving 2 waters and a tier 6 stone axe with no use. If you are going to copy/paste, include the arguments. \",\"default\":[\"drinkJarBoiledWater 2\",\"meleeToolRepairT0StoneAxe 1 6 0\"],\"type\":\"array\",\"items\":{\"type\":\"string\"}},\"currency\":{\"title\":\"currency\",\"description\":\"How much currency to add to the player in Takaro\",\"default\":0,\"type\":\"number\"}}}",
|
|
19
|
+
"uiSchema": "{}"
|
|
20
|
+
}
|
|
21
|
+
]
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"base.d.ts","sourceRoot":"","sources":["../../src/dto/base.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AAEzC,OAAO,EAAE,UAAU,EAAE,MAAM,YAAY,CAAC;AAGxC,qBAAa,SAAS,CAAC,CAAC,CAAE,SAAQ,SAAS,CAAC,CAAC,CAAC;IAE5C,SAAS,EAAE,MAAM,CAA4B;IAI7C,IAAI,EAAE,UAAU,CAAC;CAClB"}
|
package/dist/dto/base.js
ADDED
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
2
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
3
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
4
|
+
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
5
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
6
|
+
};
|
|
7
|
+
var __metadata = (this && this.__metadata) || function (k, v) {
|
|
8
|
+
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
|
9
|
+
};
|
|
10
|
+
import { TakaroDTO } from '@takaro/util';
|
|
11
|
+
import { IsISO8601, IsString } from 'class-validator';
|
|
12
|
+
import { Exclude } from 'class-transformer';
|
|
13
|
+
export class BaseEvent extends TakaroDTO {
|
|
14
|
+
constructor() {
|
|
15
|
+
super(...arguments);
|
|
16
|
+
this.timestamp = new Date().toISOString();
|
|
17
|
+
}
|
|
18
|
+
}
|
|
19
|
+
__decorate([
|
|
20
|
+
IsISO8601(),
|
|
21
|
+
__metadata("design:type", String)
|
|
22
|
+
], BaseEvent.prototype, "timestamp", void 0);
|
|
23
|
+
__decorate([
|
|
24
|
+
IsString(),
|
|
25
|
+
Exclude({ toPlainOnly: true }),
|
|
26
|
+
__metadata("design:type", String)
|
|
27
|
+
], BaseEvent.prototype, "type", void 0);
|
|
28
|
+
//# sourceMappingURL=base.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"base.js","sourceRoot":"","sources":["../../src/dto/base.ts"],"names":[],"mappings":";;;;;;;;;AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AACzC,OAAO,EAAE,SAAS,EAAE,QAAQ,EAAE,MAAM,iBAAiB,CAAC;AAEtD,OAAO,EAAE,OAAO,EAAE,MAAM,mBAAmB,CAAC;AAE5C,MAAM,OAAO,SAAa,SAAQ,SAAY;IAA9C;;QAEE,cAAS,GAAW,IAAI,IAAI,EAAE,CAAC,WAAW,EAAE,CAAC;IAK/C,CAAC;CAAA;AALC;IADC,SAAS,EAAE;;4CACiC;AAI7C;IAFC,QAAQ,EAAE;IACV,OAAO,CAAC,EAAE,WAAW,EAAE,IAAI,EAAE,CAAC;;uCACd"}
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import { TakaroDTO } from '@takaro/util';
|
|
2
|
+
import { ValueOf } from 'type-fest';
|
|
3
|
+
import { BaseEvent } from './base.js';
|
|
4
|
+
export declare const DiscordEvents: {
|
|
5
|
+
readonly DISCORD_MESSAGE: "discord-message";
|
|
6
|
+
};
|
|
7
|
+
export declare class BaseDiscordEvent<T> extends BaseEvent<T> {
|
|
8
|
+
type: ValueOf<typeof DiscordEvents>;
|
|
9
|
+
msg: string;
|
|
10
|
+
}
|
|
11
|
+
export declare class EventDiscordUser extends TakaroDTO<EventDiscordUser> {
|
|
12
|
+
id: string;
|
|
13
|
+
username: string;
|
|
14
|
+
displayName: string;
|
|
15
|
+
isBot: boolean;
|
|
16
|
+
isTakaroBot: boolean;
|
|
17
|
+
}
|
|
18
|
+
export declare class EventDiscordChannel extends TakaroDTO<EventDiscordChannel> {
|
|
19
|
+
id: string;
|
|
20
|
+
name: string;
|
|
21
|
+
}
|
|
22
|
+
export declare class HookEventDiscordMessage extends BaseEvent<HookEventDiscordMessage> {
|
|
23
|
+
type: "discord-message";
|
|
24
|
+
msg: string;
|
|
25
|
+
author: EventDiscordUser;
|
|
26
|
+
channel: EventDiscordChannel;
|
|
27
|
+
}
|
|
28
|
+
export declare function isDiscordMessageEvent(a: unknown): a is HookEventDiscordMessage;
|
|
29
|
+
export declare const DiscordEventsMapping: {
|
|
30
|
+
readonly "discord-message": typeof HookEventDiscordMessage;
|
|
31
|
+
};
|
|
32
|
+
//# sourceMappingURL=discordEvents.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"discordEvents.d.ts","sourceRoot":"","sources":["../../src/dto/discordEvents.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AACzC,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AACpC,OAAO,EAAE,SAAS,EAAE,MAAM,WAAW,CAAC;AAEtC,eAAO,MAAM,aAAa;;CAEhB,CAAC;AAEX,qBAAa,gBAAgB,CAAC,CAAC,CAAE,SAAQ,SAAS,CAAC,CAAC,CAAC;IAE3C,IAAI,EAAE,OAAO,CAAC,OAAO,aAAa,CAAC,CAAC;IAG5C,GAAG,EAAE,MAAM,CAAC;CACb;AAED,qBAAa,gBAAiB,SAAQ,SAAS,CAAC,gBAAgB,CAAC;IAE/D,EAAE,EAAE,MAAM,CAAC;IAGX,QAAQ,EAAE,MAAM,CAAC;IAGjB,WAAW,EAAE,MAAM,CAAC;IAGpB,KAAK,EAAE,OAAO,CAAC;IAGf,WAAW,EAAE,OAAO,CAAC;CACtB;AAED,qBAAa,mBAAoB,SAAQ,SAAS,CAAC,mBAAmB,CAAC;IAErE,EAAE,EAAE,MAAM,CAAC;IAGX,IAAI,EAAE,MAAM,CAAC;CACd;AAED,qBAAa,uBAAwB,SAAQ,SAAS,CAAC,uBAAuB,CAAC;IAE7E,IAAI,oBAAiC;IAGrC,GAAG,EAAE,MAAM,CAAC;IAIZ,MAAM,EAAE,gBAAgB,CAAC;IAIzB,OAAO,EAAE,mBAAmB,CAAC;CAC9B;AAED,wBAAgB,qBAAqB,CAAC,CAAC,EAAE,OAAO,GAAG,CAAC,IAAI,uBAAuB,CAK9E;AAED,eAAO,MAAM,oBAAoB;;CAEvB,CAAC"}
|
|
@@ -0,0 +1,92 @@
|
|
|
1
|
+
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
2
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
3
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
4
|
+
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
5
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
6
|
+
};
|
|
7
|
+
var __metadata = (this && this.__metadata) || function (k, v) {
|
|
8
|
+
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
|
9
|
+
};
|
|
10
|
+
import { IsBoolean, IsEnum, IsString, ValidateNested } from 'class-validator';
|
|
11
|
+
import { Type } from 'class-transformer';
|
|
12
|
+
import { TakaroDTO } from '@takaro/util';
|
|
13
|
+
import { BaseEvent } from './base.js';
|
|
14
|
+
export const DiscordEvents = {
|
|
15
|
+
DISCORD_MESSAGE: 'discord-message',
|
|
16
|
+
};
|
|
17
|
+
export class BaseDiscordEvent extends BaseEvent {
|
|
18
|
+
}
|
|
19
|
+
__decorate([
|
|
20
|
+
IsEnum(DiscordEvents),
|
|
21
|
+
__metadata("design:type", Object)
|
|
22
|
+
], BaseDiscordEvent.prototype, "type", void 0);
|
|
23
|
+
__decorate([
|
|
24
|
+
IsString(),
|
|
25
|
+
__metadata("design:type", String)
|
|
26
|
+
], BaseDiscordEvent.prototype, "msg", void 0);
|
|
27
|
+
export class EventDiscordUser extends TakaroDTO {
|
|
28
|
+
}
|
|
29
|
+
__decorate([
|
|
30
|
+
IsString(),
|
|
31
|
+
__metadata("design:type", String)
|
|
32
|
+
], EventDiscordUser.prototype, "id", void 0);
|
|
33
|
+
__decorate([
|
|
34
|
+
IsString(),
|
|
35
|
+
__metadata("design:type", String)
|
|
36
|
+
], EventDiscordUser.prototype, "username", void 0);
|
|
37
|
+
__decorate([
|
|
38
|
+
IsString(),
|
|
39
|
+
__metadata("design:type", String)
|
|
40
|
+
], EventDiscordUser.prototype, "displayName", void 0);
|
|
41
|
+
__decorate([
|
|
42
|
+
IsBoolean(),
|
|
43
|
+
__metadata("design:type", Boolean)
|
|
44
|
+
], EventDiscordUser.prototype, "isBot", void 0);
|
|
45
|
+
__decorate([
|
|
46
|
+
IsBoolean(),
|
|
47
|
+
__metadata("design:type", Boolean)
|
|
48
|
+
], EventDiscordUser.prototype, "isTakaroBot", void 0);
|
|
49
|
+
export class EventDiscordChannel extends TakaroDTO {
|
|
50
|
+
}
|
|
51
|
+
__decorate([
|
|
52
|
+
IsString(),
|
|
53
|
+
__metadata("design:type", String)
|
|
54
|
+
], EventDiscordChannel.prototype, "id", void 0);
|
|
55
|
+
__decorate([
|
|
56
|
+
IsString(),
|
|
57
|
+
__metadata("design:type", String)
|
|
58
|
+
], EventDiscordChannel.prototype, "name", void 0);
|
|
59
|
+
export class HookEventDiscordMessage extends BaseEvent {
|
|
60
|
+
constructor() {
|
|
61
|
+
super(...arguments);
|
|
62
|
+
this.type = DiscordEvents.DISCORD_MESSAGE;
|
|
63
|
+
}
|
|
64
|
+
}
|
|
65
|
+
__decorate([
|
|
66
|
+
IsString(),
|
|
67
|
+
__metadata("design:type", Object)
|
|
68
|
+
], HookEventDiscordMessage.prototype, "type", void 0);
|
|
69
|
+
__decorate([
|
|
70
|
+
IsString(),
|
|
71
|
+
__metadata("design:type", String)
|
|
72
|
+
], HookEventDiscordMessage.prototype, "msg", void 0);
|
|
73
|
+
__decorate([
|
|
74
|
+
ValidateNested(),
|
|
75
|
+
Type(() => EventDiscordUser),
|
|
76
|
+
__metadata("design:type", EventDiscordUser)
|
|
77
|
+
], HookEventDiscordMessage.prototype, "author", void 0);
|
|
78
|
+
__decorate([
|
|
79
|
+
ValidateNested(),
|
|
80
|
+
Type(() => EventDiscordChannel),
|
|
81
|
+
__metadata("design:type", EventDiscordChannel)
|
|
82
|
+
], HookEventDiscordMessage.prototype, "channel", void 0);
|
|
83
|
+
export function isDiscordMessageEvent(a) {
|
|
84
|
+
if (typeof a === 'object' && a !== null) {
|
|
85
|
+
return 'type' in a && a.type === DiscordEvents.DISCORD_MESSAGE;
|
|
86
|
+
}
|
|
87
|
+
return false;
|
|
88
|
+
}
|
|
89
|
+
export const DiscordEventsMapping = {
|
|
90
|
+
[DiscordEvents.DISCORD_MESSAGE]: HookEventDiscordMessage,
|
|
91
|
+
};
|
|
92
|
+
//# sourceMappingURL=discordEvents.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"discordEvents.js","sourceRoot":"","sources":["../../src/dto/discordEvents.ts"],"names":[],"mappings":";;;;;;;;;AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,EAAE,QAAQ,EAAE,cAAc,EAAE,MAAM,iBAAiB,CAAC;AAC9E,OAAO,EAAE,IAAI,EAAE,MAAM,mBAAmB,CAAC;AACzC,OAAO,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AAEzC,OAAO,EAAE,SAAS,EAAE,MAAM,WAAW,CAAC;AAEtC,MAAM,CAAC,MAAM,aAAa,GAAG;IAC3B,eAAe,EAAE,iBAAiB;CAC1B,CAAC;AAEX,MAAM,OAAO,gBAAoB,SAAQ,SAAY;CAMpD;AAJS;IADP,MAAM,CAAC,aAAa,CAAC;;8CACsB;AAG5C;IADC,QAAQ,EAAE;;6CACC;AAGd,MAAM,OAAO,gBAAiB,SAAQ,SAA2B;CAehE;AAbC;IADC,QAAQ,EAAE;;4CACA;AAGX;IADC,QAAQ,EAAE;;kDACM;AAGjB;IADC,QAAQ,EAAE;;qDACS;AAGpB;IADC,SAAS,EAAE;;+CACG;AAGf;IADC,SAAS,EAAE;;qDACS;AAGvB,MAAM,OAAO,mBAAoB,SAAQ,SAA8B;CAMtE;AAJC;IADC,QAAQ,EAAE;;+CACA;AAGX;IADC,QAAQ,EAAE;;iDACE;AAGf,MAAM,OAAO,uBAAwB,SAAQ,SAAkC;IAA/E;;QAEE,SAAI,GAAG,aAAa,CAAC,eAAe,CAAC;IAYvC,CAAC;CAAA;AAZC;IADC,QAAQ,EAAE;;qDAC0B;AAGrC;IADC,QAAQ,EAAE;;oDACC;AAIZ;IAFC,cAAc,EAAE;IAChB,IAAI,CAAC,GAAG,EAAE,CAAC,gBAAgB,CAAC;8BACrB,gBAAgB;uDAAC;AAIzB;IAFC,cAAc,EAAE;IAChB,IAAI,CAAC,GAAG,EAAE,CAAC,mBAAmB,CAAC;8BACvB,mBAAmB;wDAAC;AAG/B,MAAM,UAAU,qBAAqB,CAAC,CAAU;IAC9C,IAAI,OAAO,CAAC,KAAK,QAAQ,IAAI,CAAC,KAAK,IAAI,EAAE,CAAC;QACxC,OAAO,MAAM,IAAI,CAAC,IAAI,CAAC,CAAC,IAAI,KAAK,aAAa,CAAC,eAAe,CAAC;IACjE,CAAC;IACD,OAAO,KAAK,CAAC;AACf,CAAC;AAED,MAAM,CAAC,MAAM,oBAAoB,GAAG;IAClC,CAAC,aAAa,CAAC,eAAe,CAAC,EAAE,uBAAuB;CAChD,CAAC"}
|
|
@@ -0,0 +1,83 @@
|
|
|
1
|
+
import { TakaroDTO } from '@takaro/util';
|
|
2
|
+
import { BaseEvent } from './base.js';
|
|
3
|
+
import { ValueOf } from 'type-fest';
|
|
4
|
+
export declare const GameEvents: {
|
|
5
|
+
readonly LOG_LINE: "log";
|
|
6
|
+
readonly PLAYER_CONNECTED: "player-connected";
|
|
7
|
+
readonly PLAYER_DISCONNECTED: "player-disconnected";
|
|
8
|
+
readonly CHAT_MESSAGE: "chat-message";
|
|
9
|
+
readonly PLAYER_DEATH: "player-death";
|
|
10
|
+
readonly ENTITY_KILLED: "entity-killed";
|
|
11
|
+
};
|
|
12
|
+
export type GameEventTypes = ValueOf<typeof GameEvents>;
|
|
13
|
+
export declare class IGamePlayer extends TakaroDTO<IGamePlayer> {
|
|
14
|
+
/**
|
|
15
|
+
* Unique identifier for this player, as used by the game
|
|
16
|
+
*/
|
|
17
|
+
gameId: string;
|
|
18
|
+
/**
|
|
19
|
+
* The players username
|
|
20
|
+
*/
|
|
21
|
+
name: string;
|
|
22
|
+
steamId?: string;
|
|
23
|
+
epicOnlineServicesId?: string;
|
|
24
|
+
xboxLiveId?: string;
|
|
25
|
+
platformId?: string;
|
|
26
|
+
ip?: string;
|
|
27
|
+
ping?: number;
|
|
28
|
+
}
|
|
29
|
+
export declare class BaseGameEvent<T> extends BaseEvent<T> {
|
|
30
|
+
type: ValueOf<typeof GameEvents>;
|
|
31
|
+
msg: string;
|
|
32
|
+
}
|
|
33
|
+
export declare class EventLogLine extends BaseGameEvent<EventLogLine> {
|
|
34
|
+
type: "log";
|
|
35
|
+
}
|
|
36
|
+
export declare class EventPlayerConnected extends BaseGameEvent<EventPlayerConnected> {
|
|
37
|
+
type: "player-connected";
|
|
38
|
+
player: IGamePlayer;
|
|
39
|
+
}
|
|
40
|
+
export declare class EventPlayerDisconnected extends BaseGameEvent<EventPlayerDisconnected> {
|
|
41
|
+
type: "player-disconnected";
|
|
42
|
+
player: IGamePlayer;
|
|
43
|
+
}
|
|
44
|
+
export declare enum ChatChannel {
|
|
45
|
+
GLOBAL = "global",
|
|
46
|
+
TEAM = "team",
|
|
47
|
+
FRIENDS = "friends",
|
|
48
|
+
WHISPER = "whisper"
|
|
49
|
+
}
|
|
50
|
+
export declare class EventChatMessage extends BaseGameEvent<EventChatMessage> {
|
|
51
|
+
type: "chat-message";
|
|
52
|
+
player?: IGamePlayer;
|
|
53
|
+
channel: ChatChannel;
|
|
54
|
+
recipient?: IGamePlayer;
|
|
55
|
+
msg: string;
|
|
56
|
+
}
|
|
57
|
+
export declare class IPosition extends TakaroDTO<IPosition> {
|
|
58
|
+
x: number;
|
|
59
|
+
y: number;
|
|
60
|
+
z: number;
|
|
61
|
+
dimension?: string;
|
|
62
|
+
}
|
|
63
|
+
export declare class EventPlayerDeath extends BaseGameEvent<EventPlayerDeath> {
|
|
64
|
+
type: "player-death";
|
|
65
|
+
player: IGamePlayer;
|
|
66
|
+
attacker?: IGamePlayer;
|
|
67
|
+
position: IPosition;
|
|
68
|
+
}
|
|
69
|
+
export declare class EventEntityKilled extends BaseGameEvent<EventEntityKilled> {
|
|
70
|
+
type: "entity-killed";
|
|
71
|
+
player: IGamePlayer;
|
|
72
|
+
entity: string;
|
|
73
|
+
weapon: string;
|
|
74
|
+
}
|
|
75
|
+
export declare const GameEventsMapping: {
|
|
76
|
+
readonly "player-connected": typeof EventPlayerConnected;
|
|
77
|
+
readonly "player-disconnected": typeof EventPlayerDisconnected;
|
|
78
|
+
readonly "chat-message": typeof EventChatMessage;
|
|
79
|
+
readonly "player-death": typeof EventPlayerDeath;
|
|
80
|
+
readonly "entity-killed": typeof EventEntityKilled;
|
|
81
|
+
readonly log: typeof EventLogLine;
|
|
82
|
+
};
|
|
83
|
+
//# sourceMappingURL=gameEvents.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"gameEvents.d.ts","sourceRoot":"","sources":["../../src/dto/gameEvents.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AAEzC,OAAO,EAAE,SAAS,EAAE,MAAM,WAAW,CAAC;AACtC,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAEpC,eAAO,MAAM,UAAU;;;;;;;CAOb,CAAC;AAEX,MAAM,MAAM,cAAc,GAAG,OAAO,CAAC,OAAO,UAAU,CAAC,CAAC;AAExD,qBAAa,WAAY,SAAQ,SAAS,CAAC,WAAW,CAAC;IACrD;;OAEG;IAEH,MAAM,EAAG,MAAM,CAAC;IAChB;;OAEG;IAEH,IAAI,EAAG,MAAM,CAAC;IAId,OAAO,CAAC,EAAE,MAAM,CAAC;IAIjB,oBAAoB,CAAC,EAAE,MAAM,CAAC;IAI9B,UAAU,CAAC,EAAE,MAAM,CAAC;IAOpB,UAAU,CAAC,EAAE,MAAM,CAAC;IAIpB,EAAE,C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