@senators/bifrost-cli 0.0.0-stage → 7.0.0
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/LICENSE +21 -0
- package/README.md +180 -2
- package/out/accountEditor-CQB91PVf.js +2 -0
- package/out/accountEditor-CQB91PVf.js.map +1 -0
- package/out/achievements-Df5qqpYQ.js +2 -0
- package/out/achievements-Df5qqpYQ.js.map +1 -0
- package/out/active-CnUKpiEo.js +2 -0
- package/out/active-CnUKpiEo.js.map +1 -0
- package/out/alliance-BsPnhi7w.js +2 -0
- package/out/alliance-BsPnhi7w.js.map +1 -0
- package/out/allianceAdmin-Bkyl6ev4.js +2 -0
- package/out/allianceAdmin-Bkyl6ev4.js.map +1 -0
- package/out/arsenal-BMCmAHzv.js +2 -0
- package/out/arsenal-BMCmAHzv.js.map +1 -0
- package/out/ban-BXNvHPMq.js +2 -0
- package/out/ban-BXNvHPMq.js.map +1 -0
- package/out/banList-3DbCToEy.js +2 -0
- package/out/banList-3DbCToEy.js.map +1 -0
- package/out/banList-dT5GF5eO.js +2 -0
- package/out/banList-dT5GF5eO.js.map +1 -0
- package/out/battleHall-C4BALP6S.js +2 -0
- package/out/battleHall-C4BALP6S.js.map +1 -0
- package/out/battleHall-P7Co1jS5.js +2 -0
- package/out/battleHall-P7Co1jS5.js.map +1 -0
- package/out/battleReport-BG0-S-bF.js +2 -0
- package/out/battleReport-BG0-S-bF.js.map +1 -0
- package/out/battleReport-C3PQTXxc.js +2 -0
- package/out/battleReport-C3PQTXxc.js.map +1 -0
- package/out/battleSimulator-BOySErLn.js +2 -0
- package/out/battleSimulator-BOySErLn.js.map +1 -0
- package/out/board-CsNgDx4j.js +2 -0
- package/out/board-CsNgDx4j.js.map +1 -0
- package/out/board-DSCl8eU8.js +2 -0
- package/out/board-DSCl8eU8.js.map +1 -0
- package/out/bonusSummary-Dmm646zj.js +2 -0
- package/out/bonusSummary-Dmm646zj.js.map +1 -0
- package/out/buddyList-B50t-9_g.js +2 -0
- package/out/buddyList-B50t-9_g.js.map +1 -0
- package/out/buildings-CXrMgFyb.js +2 -0
- package/out/buildings-CXrMgFyb.js.map +1 -0
- package/out/catalog-DmSXp_YG.js +2 -0
- package/out/catalog-DmSXp_YG.js.map +1 -0
- package/out/chat-BvtMl-I7.js +2 -0
- package/out/chat-BvtMl-I7.js.map +1 -0
- package/out/clearCache-79cjREI0.js +2 -0
- package/out/clearCache-79cjREI0.js.map +1 -0
- package/out/cli.js +3 -0
- package/out/cli.js.map +1 -0
- package/out/containers-BhguCCkz.js +2 -0
- package/out/containers-BhguCCkz.js.map +1 -0
- package/out/control-IJRy1LDx.js +2 -0
- package/out/control-IJRy1LDx.js.map +1 -0
- package/out/create-D-IygCER.js +2 -0
- package/out/create-D-IygCER.js.map +1 -0
- package/out/createMoon-BMWjdwO0.js +2 -0
- package/out/createMoon-BMWjdwO0.js.map +1 -0
- package/out/cronjob-CCJKDSuv.js +2 -0
- package/out/cronjob-CCJKDSuv.js.map +1 -0
- package/out/dailyBonus-2UwWD4D0.js +2 -0
- package/out/dailyBonus-2UwWD4D0.js.map +1 -0
- package/out/delivery-d8NKP-f1.js +2 -0
- package/out/delivery-d8NKP-f1.js.map +1 -0
- package/out/disclaimer-BmejHZqk.js +2 -0
- package/out/disclaimer-BmejHZqk.js.map +1 -0
- package/out/dump--mJa5m3e.js +2 -0
- package/out/dump--mJa5m3e.js.map +1 -0
- package/out/endpoints-CbZGTbF-.js +2 -0
- package/out/endpoints-CbZGTbF-.js.map +1 -0
- package/out/externalAuth-Dwl3VAHa.js +2 -0
- package/out/externalAuth-Dwl3VAHa.js.map +1 -0
- package/out/findDebris-DOMvMC1l.js +2 -0
- package/out/findDebris-DOMvMC1l.js.map +1 -0
- package/out/fleet-DyITa_Xu.js +2 -0
- package/out/fleet-DyITa_Xu.js.map +1 -0
- package/out/fleetAjax-BGxyUtdi.js +2 -0
- package/out/fleetAjax-BGxyUtdi.js.map +1 -0
- package/out/fleetDealer-n6LM_8IT.js +2 -0
- package/out/fleetDealer-n6LM_8IT.js.map +1 -0
- package/out/fleetMissile-CucQvNmZ.js +2 -0
- package/out/fleetMissile-CucQvNmZ.js.map +1 -0
- package/out/fleetStep1-wp-NgTsC.js +2 -0
- package/out/fleetStep1-wp-NgTsC.js.map +1 -0
- package/out/fleetStep2-C-GzHXyn.js +2 -0
- package/out/fleetStep2-C-GzHXyn.js.map +1 -0
- package/out/fleetStep3-D_fqImWm.js +2 -0
- package/out/fleetStep3-D_fqImWm.js.map +1 -0
- package/out/fleetTable-BpWLh0R1.js +2 -0
- package/out/fleetTable-BpWLh0R1.js.map +1 -0
- package/out/flyingFleet-ClIrGPJz.js +2 -0
- package/out/flyingFleet-ClIrGPJz.js.map +1 -0
- package/out/galaxy-B12wKQUU.js +2 -0
- package/out/galaxy-B12wKQUU.js.map +1 -0
- package/out/get-Cn2hFvGS.js +2 -0
- package/out/get-Cn2hFvGS.js.map +1 -0
- package/out/giveaway-CDWEArOF.js +2 -0
- package/out/giveaway-CDWEArOF.js.map +1 -0
- package/out/growth-C_-C8rLD.js +2 -0
- package/out/growth-C_-C8rLD.js.map +1 -0
- package/out/index.d.ts +29 -0
- package/out/index.d.ts.map +1 -0
- package/out/index.js +1 -0
- package/out/information-CqfqYCH1.js +2 -0
- package/out/information-CqfqYCH1.js.map +1 -0
- package/out/information-DK93hgyE.js +2 -0
- package/out/information-DK93hgyE.js.map +1 -0
- package/out/log-BBE1Jt9i.js +2 -0
- package/out/log-BBE1Jt9i.js.map +1 -0
- package/out/login--4vqysQx.js +2 -0
- package/out/login--4vqysQx.js.map +1 -0
- package/out/login-C_DqRApn.js +2 -0
- package/out/login-C_DqRApn.js.map +1 -0
- package/out/logout-BYnLiMja.js +2 -0
- package/out/logout-BYnLiMja.js.map +1 -0
- package/out/logout-BsCSXzv8.js +2 -0
- package/out/logout-BsCSXzv8.js.map +1 -0
- package/out/lostPassword-Pc_1CUBD.js +2 -0
- package/out/lostPassword-Pc_1CUBD.js.map +1 -0
- package/out/market-DN8cY1tr.js +2 -0
- package/out/market-DN8cY1tr.js.map +1 -0
- package/out/messageList-k_zW_D0G.js +2 -0
- package/out/messageList-k_zW_D0G.js.map +1 -0
- package/out/messages-D461yIe6.js +2 -0
- package/out/messages-D461yIe6.js.map +1 -0
- package/out/missions-5zZtlLIm.js +2 -0
- package/out/missions-5zZtlLIm.js.map +1 -0
- package/out/module-BEPeTBhK.js +2 -0
- package/out/module-BEPeTBhK.js.map +1 -0
- package/out/multiIp-CP3lub1T.js +2 -0
- package/out/multiIp-CP3lub1T.js.map +1 -0
- package/out/new-star-BaVTTcIn.js +2 -0
- package/out/new-star-BaVTTcIn.js.map +1 -0
- package/out/news-BdDDcd-M.js +2 -0
- package/out/news-BdDDcd-M.js.map +1 -0
- package/out/news-Dd1C9JDl.js +2 -0
- package/out/news-Dd1C9JDl.js.map +1 -0
- package/out/notes-DLngBta3.js +2 -0
- package/out/notes-DLngBta3.js.map +1 -0
- package/out/overview-CzcSTNla.js +2 -0
- package/out/overview-CzcSTNla.js.map +1 -0
- package/out/overview-wQWIR_CB.js +2 -0
- package/out/overview-wQWIR_CB.js.map +1 -0
- package/out/password-ZA_1lStC.js +2 -0
- package/out/password-ZA_1lStC.js.map +1 -0
- package/out/phalanx-DaMaoJCT.js +2 -0
- package/out/phalanx-DaMaoJCT.js.map +1 -0
- package/out/planet-CecZ2cAZ.js +2 -0
- package/out/planet-CecZ2cAZ.js.map +1 -0
- package/out/playerCard-BG711xQi.js +2 -0
- package/out/playerCard-BG711xQi.js.map +1 -0
- package/out/post-C_ywAss7.js +2 -0
- package/out/post-C_ywAss7.js.map +1 -0
- package/out/production-D8SZfez8.js +2 -0
- package/out/production-D8SZfez8.js.map +1 -0
- package/out/public-TVVf75qu.js +2 -0
- package/out/public-TVVf75qu.js.map +1 -0
- package/out/questions-NwzZ5_fL.js +2 -0
- package/out/questions-NwzZ5_fL.js.map +1 -0
- package/out/quickEditor-DEJQFH0f.js +2 -0
- package/out/quickEditor-DEJQFH0f.js.map +1 -0
- package/out/records-CDVglYGy.js +2 -0
- package/out/records-CDVglYGy.js.map +1 -0
- package/out/records-Djjz9kxk.js +2 -0
- package/out/records-Djjz9kxk.js.map +1 -0
- package/out/reduceFleet-y8p89weR.js +2 -0
- package/out/reduceFleet-y8p89weR.js.map +1 -0
- package/out/reduceResources-CnGJ9fuf.js +2 -0
- package/out/reduceResources-CnGJ9fuf.js.map +1 -0
- package/out/refreshStatistics-CjGWyNc_.js +2 -0
- package/out/refreshStatistics-CjGWyNc_.js.map +1 -0
- package/out/register-4x5hZcWe.js +2 -0
- package/out/register-4x5hZcWe.js.map +1 -0
- package/out/research-dTK3-tOW.js +2 -0
- package/out/research-dTK3-tOW.js.map +1 -0
- package/out/reset-CHiMI9rj.js +2 -0
- package/out/reset-CHiMI9rj.js.map +1 -0
- package/out/resources-CjnevA41.js +2 -0
- package/out/resources-CjnevA41.js.map +1 -0
- package/out/rights-WPf-j_YF.js +2 -0
- package/out/rights-WPf-j_YF.js.map +1 -0
- package/out/rules-E29jtQRj.js +2 -0
- package/out/rules-E29jtQRj.js.map +1 -0
- package/out/runner-C2bQQS2G.js +43 -0
- package/out/runner-C2bQQS2G.js.map +1 -0
- package/out/scan-RvWZeyyM.js +2 -0
- package/out/scan-RvWZeyyM.js.map +1 -0
- package/out/screens-CZ4g-KNp.js +2 -0
- package/out/screens-CZ4g-KNp.js.map +1 -0
- package/out/search-BYvqiUBF.js +2 -0
- package/out/search-BYvqiUBF.js.map +1 -0
- package/out/search-auPbK2Xc.js +2 -0
- package/out/search-auPbK2Xc.js.map +1 -0
- package/out/sendMessages-B2Uj3PW4.js +2 -0
- package/out/sendMessages-B2Uj3PW4.js.map +1 -0
- package/out/settings-DFFa6Ush.js +2 -0
- package/out/settings-DFFa6Ush.js.map +1 -0
- package/out/settings-Ddez5x9U.js +2 -0
- package/out/settings-Ddez5x9U.js.map +1 -0
- package/out/shared-DoaW4mlX.js +2 -0
- package/out/shared-DoaW4mlX.js.map +1 -0
- package/out/shipyard-DXr745hR.js +2 -0
- package/out/shipyard-DXr745hR.js.map +1 -0
- package/out/shops-CEE02c0g.js +2 -0
- package/out/shops-CEE02c0g.js.map +1 -0
- package/out/snapshot-CrJ8l50N.js +2 -0
- package/out/snapshot-CrJ8l50N.js.map +1 -0
- package/out/social-1Gdni-jZ.js +2 -0
- package/out/social-1Gdni-jZ.js.map +1 -0
- package/out/spec-CrkWB0BN.js +2 -0
- package/out/spec-CrkWB0BN.js.map +1 -0
- package/out/statistics-zg3aVAvW.js +2 -0
- package/out/statistics-zg3aVAvW.js.map +1 -0
- package/out/store-dXG7NoB4.js +2 -0
- package/out/store-dXG7NoB4.js.map +1 -0
- package/out/support-DisUQr57.js +2 -0
- package/out/support-DisUQr57.js.map +1 -0
- package/out/techtree-Ba3FEH5_.js +2 -0
- package/out/techtree-Ba3FEH5_.js.map +1 -0
- package/out/ticket-O_8jTKW8.js +2 -0
- package/out/ticket-O_8jTKW8.js.map +1 -0
- package/out/trader-zFDGaHZ9.js +2 -0
- package/out/trader-zFDGaHZ9.js.map +1 -0
- package/out/universe-DO32RnLQ.js +2 -0
- package/out/universe-DO32RnLQ.js.map +1 -0
- package/out/universeSettings-S7enRJR4.js +2 -0
- package/out/universeSettings-S7enRJR4.js.map +1 -0
- package/out/values-gwcnIHXs.js +2 -0
- package/out/values-gwcnIHXs.js.map +1 -0
- package/out/verify-sYnZ9juV.js +2 -0
- package/out/verify-sYnZ9juV.js.map +1 -0
- package/out/version-Cgs-grc5.js +2 -0
- package/out/version-Cgs-grc5.js.map +1 -0
- package/package.json +65 -4
- package/src/admin.ts +317 -0
- package/src/arguments.ts +323 -0
- package/src/catalog.ts +117 -0
- package/src/cli.ts +29 -0
- package/src/commands/admin/accountEditor.ts +33 -0
- package/src/commands/admin/active.ts +25 -0
- package/src/commands/admin/ban.ts +59 -0
- package/src/commands/admin/clearCache.ts +12 -0
- package/src/commands/admin/create.ts +59 -0
- package/src/commands/admin/cronjob.ts +94 -0
- package/src/commands/admin/dump.ts +25 -0
- package/src/commands/admin/flyingFleet.ts +25 -0
- package/src/commands/admin/giveaway.ts +37 -0
- package/src/commands/admin/information.ts +12 -0
- package/src/commands/admin/log.ts +37 -0
- package/src/commands/admin/login.ts +15 -0
- package/src/commands/admin/logout.ts +12 -0
- package/src/commands/admin/messageList.ts +19 -0
- package/src/commands/admin/module.ts +25 -0
- package/src/commands/admin/multiIp.ts +25 -0
- package/src/commands/admin/news.ts +40 -0
- package/src/commands/admin/overview.ts +12 -0
- package/src/commands/admin/password.ts +18 -0
- package/src/commands/admin/quickEditor.ts +30 -0
- package/src/commands/admin/refreshStatistics.ts +12 -0
- package/src/commands/admin/reset.ts +26 -0
- package/src/commands/admin/rights.ts +68 -0
- package/src/commands/admin/search.ts +31 -0
- package/src/commands/admin/sendMessages.ts +26 -0
- package/src/commands/admin/support.ts +48 -0
- package/src/commands/admin/universe.ts +49 -0
- package/src/commands/admin/universeSettings.ts +32 -0
- package/src/commands/game/achievements.ts +18 -0
- package/src/commands/game/alliance.ts +248 -0
- package/src/commands/game/allianceAdmin.ts +236 -0
- package/src/commands/game/arsenal.ts +12 -0
- package/src/commands/game/banList.ts +20 -0
- package/src/commands/game/battleHall.ts +21 -0
- package/src/commands/game/battleReport.ts +20 -0
- package/src/commands/game/battleSimulator.ts +41 -0
- package/src/commands/game/board.ts +12 -0
- package/src/commands/game/bonusSummary.ts +12 -0
- package/src/commands/game/buddyList.ts +76 -0
- package/src/commands/game/buildings.ts +81 -0
- package/src/commands/game/chat.ts +12 -0
- package/src/commands/game/containers.ts +33 -0
- package/src/commands/game/control.ts +16 -0
- package/src/commands/game/createMoon.ts +28 -0
- package/src/commands/game/dailyBonus.ts +18 -0
- package/src/commands/game/delivery.ts +34 -0
- package/src/commands/game/endpoints.ts +61 -0
- package/src/commands/game/findDebris.ts +16 -0
- package/src/commands/game/fleetAjax.ts +24 -0
- package/src/commands/game/fleetDealer.ts +36 -0
- package/src/commands/game/fleetMissile.ts +25 -0
- package/src/commands/game/fleetStep1.ts +74 -0
- package/src/commands/game/fleetStep2.ts +27 -0
- package/src/commands/game/fleetStep3.ts +28 -0
- package/src/commands/game/fleetTable.ts +96 -0
- package/src/commands/game/galaxy.ts +26 -0
- package/src/commands/game/growth.ts +313 -0
- package/src/commands/game/information.ts +56 -0
- package/src/commands/game/logout.ts +12 -0
- package/src/commands/game/market.ts +67 -0
- package/src/commands/game/messages.ts +129 -0
- package/src/commands/game/notes.ts +65 -0
- package/src/commands/game/overview.ts +49 -0
- package/src/commands/game/phalanx.ts +23 -0
- package/src/commands/game/planet.ts +78 -0
- package/src/commands/game/playerCard.ts +20 -0
- package/src/commands/game/questions.ts +23 -0
- package/src/commands/game/records.ts +16 -0
- package/src/commands/game/reduceFleet.ts +41 -0
- package/src/commands/game/reduceResources.ts +35 -0
- package/src/commands/game/research.ts +80 -0
- package/src/commands/game/resources.ts +49 -0
- package/src/commands/game/scan.ts +12 -0
- package/src/commands/game/search.ts +44 -0
- package/src/commands/game/settings.ts +121 -0
- package/src/commands/game/shipyard.ts +61 -0
- package/src/commands/game/shops.ts +89 -0
- package/src/commands/game/statistics.ts +22 -0
- package/src/commands/game/store.ts +12 -0
- package/src/commands/game/techtree.ts +16 -0
- package/src/commands/game/ticket.ts +44 -0
- package/src/commands/game/trader.ts +51 -0
- package/src/commands/game/workflows/fleet.ts +12 -0
- package/src/commands/game/workflows/snapshot.ts +84 -0
- package/src/commands/game/workflows/social.ts +37 -0
- package/src/commands/http/get.ts +13 -0
- package/src/commands/http/post.ts +44 -0
- package/src/commands/public/banList.ts +21 -0
- package/src/commands/public/battleHall.ts +20 -0
- package/src/commands/public/battleReport.ts +20 -0
- package/src/commands/public/board.ts +20 -0
- package/src/commands/public/disclaimer.ts +20 -0
- package/src/commands/public/externalAuth.ts +17 -0
- package/src/commands/public/index.ts +22 -0
- package/src/commands/public/login.ts +20 -0
- package/src/commands/public/lostPassword.ts +57 -0
- package/src/commands/public/news.ts +20 -0
- package/src/commands/public/register.ts +46 -0
- package/src/commands/public/rules.ts +20 -0
- package/src/commands/public/screens.ts +20 -0
- package/src/commands/public/verify.ts +38 -0
- package/src/commands/rules/new-star.ts +221 -0
- package/src/commands/rules/production.ts +51 -0
- package/src/completion/BifrostCompletion.psm1 +47 -0
- package/src/completion.ts +445 -0
- package/src/connection.ts +106 -0
- package/src/destination.ts +64 -0
- package/src/game.ts +978 -0
- package/src/help.ts +203 -0
- package/src/i18n.ts +45 -0
- package/src/index.ts +2 -0
- package/src/input/admin/accountEditor.ts +156 -0
- package/src/input/admin/ban.ts +23 -0
- package/src/input/admin/create.ts +36 -0
- package/src/input/admin/cronjob.ts +22 -0
- package/src/input/admin/fields.ts +432 -0
- package/src/input/admin/login.ts +9 -0
- package/src/input/admin/messageList.ts +21 -0
- package/src/input/admin/news.ts +29 -0
- package/src/input/admin/quickEditor.ts +115 -0
- package/src/input/admin/records.ts +68 -0
- package/src/input/admin/reset.ts +29 -0
- package/src/input/admin/search.ts +23 -0
- package/src/input/admin/sendMessages.ts +21 -0
- package/src/input/admin/universeSettings.ts +46 -0
- package/src/input/files.ts +65 -0
- package/src/input/game/allianceAdmin.ts +55 -0
- package/src/input/game/battleSimulator.ts +25 -0
- package/src/input/game/fleetStep1.ts +14 -0
- package/src/input/game/settings.ts +46 -0
- package/src/input/game/ticket.ts +16 -0
- package/src/input/parse.ts +173 -0
- package/src/input/paths.ts +392 -0
- package/src/input/protocol/context.ts +10 -0
- package/src/input/protocol/missions.ts +6 -0
- package/src/input/protocol/routes.ts +15 -0
- package/src/input/protocol/settings.ts +126 -0
- package/src/input/protocol/values.ts +13 -0
- package/src/input/public/externalAuth.ts +26 -0
- package/src/input/public/register.ts +9 -0
- package/src/input/rules/new-star.ts +21 -0
- package/src/input/rules/production.ts +14 -0
- package/src/input/shared.ts +51 -0
- package/src/input/spec.ts +155 -0
- package/src/input/values.ts +114 -0
- package/src/input/workflows/fleet.ts +22 -0
- package/src/input/workflows/snapshot.ts +74 -0
- package/src/locales/en-US/commands.ts +377 -0
- package/src/locales/en-US/diagnostics.ts +89 -0
- package/src/locales/en-US.ts +61 -0
- package/src/locales/zh-CN/commands.ts +307 -0
- package/src/locales/zh-CN/diagnostics.ts +81 -0
- package/src/locales/zh-CN.ts +57 -0
- package/src/options.ts +48 -0
- package/src/output.ts +201 -0
- package/src/pointer.ts +46 -0
- package/src/presentation.ts +96 -0
- package/src/public.ts +99 -0
- package/src/registry.ts +67 -0
- package/src/requests.ts +13 -0
- package/src/result.ts +27 -0
- package/src/rules.ts +77 -0
- package/src/runner.ts +214 -0
- package/src/selection.ts +44 -0
- package/src/terminal.ts +27 -0
- package/src/types.ts +110 -0
- package/src/version.ts +11 -0
|
@@ -0,0 +1,432 @@
|
|
|
1
|
+
import type {
|
|
2
|
+
AdminAccountEditorSection,
|
|
3
|
+
AdminAccountEditorSubmit,
|
|
4
|
+
AdminMoonEditorKey,
|
|
5
|
+
AdminPlanetEditorKey,
|
|
6
|
+
AdminPlayerEditorKey,
|
|
7
|
+
AdminRightKey,
|
|
8
|
+
AdminUniverseSettingKey,
|
|
9
|
+
} from '@senators/bifrost'
|
|
10
|
+
|
|
11
|
+
const researchFields = {
|
|
12
|
+
spy_tech: null,
|
|
13
|
+
computer_tech: null,
|
|
14
|
+
military_tech: null,
|
|
15
|
+
defence_tech: null,
|
|
16
|
+
shield_tech: null,
|
|
17
|
+
energy_tech: null,
|
|
18
|
+
hyperspace_tech: null,
|
|
19
|
+
combustion_tech: null,
|
|
20
|
+
impulse_motor_tech: null,
|
|
21
|
+
hyperspace_motor_tech: null,
|
|
22
|
+
laser_tech: null,
|
|
23
|
+
ionic_tech: null,
|
|
24
|
+
buster_tech: null,
|
|
25
|
+
intergalactic_tech: null,
|
|
26
|
+
expedition_tech: null,
|
|
27
|
+
metal_proc_tech: null,
|
|
28
|
+
crystal_proc_tech: null,
|
|
29
|
+
deuterium_proc_tech: null,
|
|
30
|
+
graviton_tech: null,
|
|
31
|
+
}
|
|
32
|
+
const officerFields = {
|
|
33
|
+
rpg_geologue: null,
|
|
34
|
+
rpg_amiral: null,
|
|
35
|
+
rpg_ingenieur: null,
|
|
36
|
+
rpg_technocrate: null,
|
|
37
|
+
rpg_constructeur: null,
|
|
38
|
+
rpg_scientifique: null,
|
|
39
|
+
rpg_stockeur: null,
|
|
40
|
+
rpg_defenseur: null,
|
|
41
|
+
rpg_bunker: null,
|
|
42
|
+
rpg_espion: null,
|
|
43
|
+
rpg_commandant: null,
|
|
44
|
+
rpg_destructeur: null,
|
|
45
|
+
rpg_general: null,
|
|
46
|
+
rpg_raideur: null,
|
|
47
|
+
rpg_empereur: null,
|
|
48
|
+
}
|
|
49
|
+
const shipFields = {
|
|
50
|
+
small_ship_cargo: null,
|
|
51
|
+
big_ship_cargo: null,
|
|
52
|
+
light_hunter: null,
|
|
53
|
+
heavy_hunter: null,
|
|
54
|
+
crusher: null,
|
|
55
|
+
battle_ship: null,
|
|
56
|
+
colonizer: null,
|
|
57
|
+
recycler: null,
|
|
58
|
+
spy_sonde: null,
|
|
59
|
+
bomber_ship: null,
|
|
60
|
+
solar_satelit: null,
|
|
61
|
+
destructor: null,
|
|
62
|
+
dearth_star: null,
|
|
63
|
+
battleship: null,
|
|
64
|
+
lune_noir: null,
|
|
65
|
+
ev_transporter: null,
|
|
66
|
+
star_crasher: null,
|
|
67
|
+
giga_recykler: null,
|
|
68
|
+
dm_ship: null,
|
|
69
|
+
bs_class_oneil: null,
|
|
70
|
+
flying_death: null,
|
|
71
|
+
scrappy: null,
|
|
72
|
+
M19: null,
|
|
73
|
+
galleon: null,
|
|
74
|
+
destroyer: null,
|
|
75
|
+
frigate: null,
|
|
76
|
+
black_wanderer: null,
|
|
77
|
+
M7: null,
|
|
78
|
+
M32: null,
|
|
79
|
+
torpedo: null,
|
|
80
|
+
cog: null,
|
|
81
|
+
scout: null,
|
|
82
|
+
fury: null,
|
|
83
|
+
guardian: null,
|
|
84
|
+
cutter: null,
|
|
85
|
+
brigantine: null,
|
|
86
|
+
raptor: null,
|
|
87
|
+
aircraft: null,
|
|
88
|
+
ranger: null,
|
|
89
|
+
reaver: null,
|
|
90
|
+
phoenix: null,
|
|
91
|
+
hawk: null,
|
|
92
|
+
brig: null,
|
|
93
|
+
defender: null,
|
|
94
|
+
dreadnought: null,
|
|
95
|
+
galleass: null,
|
|
96
|
+
ketch: null,
|
|
97
|
+
titan: null,
|
|
98
|
+
typhoon: null,
|
|
99
|
+
orion: null,
|
|
100
|
+
mirage: null,
|
|
101
|
+
flute: null,
|
|
102
|
+
knarr: null,
|
|
103
|
+
avenger: null,
|
|
104
|
+
hammer: null,
|
|
105
|
+
poleaxe: null,
|
|
106
|
+
erehon: null,
|
|
107
|
+
isis: null,
|
|
108
|
+
iron: null,
|
|
109
|
+
corvette: null,
|
|
110
|
+
thunder: null,
|
|
111
|
+
hunter: null,
|
|
112
|
+
leviathan: null,
|
|
113
|
+
bunyip: null,
|
|
114
|
+
dragon: null,
|
|
115
|
+
predator: null,
|
|
116
|
+
}
|
|
117
|
+
const defenseFields = {
|
|
118
|
+
misil_launcher: null,
|
|
119
|
+
small_laser: null,
|
|
120
|
+
big_laser: null,
|
|
121
|
+
gauss_canyon: null,
|
|
122
|
+
ionic_canyon: null,
|
|
123
|
+
buster_canyon: null,
|
|
124
|
+
small_protection_shield: null,
|
|
125
|
+
big_protection_shield: null,
|
|
126
|
+
planet_protector: null,
|
|
127
|
+
graviton_canyon: null,
|
|
128
|
+
orbital_station: null,
|
|
129
|
+
lepton_gun: null,
|
|
130
|
+
proton_gun: null,
|
|
131
|
+
canyon: null,
|
|
132
|
+
quantum_gun: null,
|
|
133
|
+
hydrogen_gun: null,
|
|
134
|
+
dora_gun: null,
|
|
135
|
+
photon_cannon: null,
|
|
136
|
+
particle_emitter: null,
|
|
137
|
+
slim_mehador: null,
|
|
138
|
+
iron_mehador: null,
|
|
139
|
+
grand_mehador: null,
|
|
140
|
+
landing: null,
|
|
141
|
+
rocket: null,
|
|
142
|
+
charybdis: null,
|
|
143
|
+
uranus: null,
|
|
144
|
+
achilles: null,
|
|
145
|
+
phaser: null,
|
|
146
|
+
armageddon: null,
|
|
147
|
+
sphinx: null,
|
|
148
|
+
wyvern: null,
|
|
149
|
+
icarus: null,
|
|
150
|
+
griffin: null,
|
|
151
|
+
squadron: null,
|
|
152
|
+
neon: null,
|
|
153
|
+
torpedos: null,
|
|
154
|
+
palatine: null,
|
|
155
|
+
installation: null,
|
|
156
|
+
atlantis: null,
|
|
157
|
+
orbital_met: null,
|
|
158
|
+
orbital_cry: null,
|
|
159
|
+
orbital_det: null,
|
|
160
|
+
galactic: null,
|
|
161
|
+
orlan: null,
|
|
162
|
+
vector: null,
|
|
163
|
+
agat: null,
|
|
164
|
+
lightning: null,
|
|
165
|
+
volcano: null,
|
|
166
|
+
typhon: null,
|
|
167
|
+
cerberus: null,
|
|
168
|
+
grad: null,
|
|
169
|
+
starfall: null,
|
|
170
|
+
robot: null,
|
|
171
|
+
droid: null,
|
|
172
|
+
flame: null,
|
|
173
|
+
spotlight: null,
|
|
174
|
+
kraken: null,
|
|
175
|
+
hydra: null,
|
|
176
|
+
panzer: null,
|
|
177
|
+
cthulhu: null,
|
|
178
|
+
}
|
|
179
|
+
const sharedBuildingFields = {
|
|
180
|
+
robot_factory: null,
|
|
181
|
+
hangar: null,
|
|
182
|
+
metal_store: null,
|
|
183
|
+
crystal_store: null,
|
|
184
|
+
deuterium_store: null,
|
|
185
|
+
}
|
|
186
|
+
const planetBuildingFields = {
|
|
187
|
+
...sharedBuildingFields,
|
|
188
|
+
metal_mine: null,
|
|
189
|
+
crystal_mine: null,
|
|
190
|
+
deuterium_sintetizer: null,
|
|
191
|
+
solar_plant: null,
|
|
192
|
+
university: null,
|
|
193
|
+
fusion_plant: null,
|
|
194
|
+
nano_factory: null,
|
|
195
|
+
laboratory: null,
|
|
196
|
+
terraformer: null,
|
|
197
|
+
ally_deposit: null,
|
|
198
|
+
silo: null,
|
|
199
|
+
resource_module: null,
|
|
200
|
+
defensive_module: null,
|
|
201
|
+
military_module: null,
|
|
202
|
+
research_module: null,
|
|
203
|
+
}
|
|
204
|
+
const moonBuildingFields = {
|
|
205
|
+
...sharedBuildingFields,
|
|
206
|
+
mondbasis: null,
|
|
207
|
+
phalanx: null,
|
|
208
|
+
sprungtor: null,
|
|
209
|
+
}
|
|
210
|
+
const bodyFields = {
|
|
211
|
+
...shipFields,
|
|
212
|
+
...defenseFields,
|
|
213
|
+
name: null,
|
|
214
|
+
field_max: null,
|
|
215
|
+
metal: null,
|
|
216
|
+
crystal: null,
|
|
217
|
+
deuterium: null,
|
|
218
|
+
}
|
|
219
|
+
|
|
220
|
+
export const adminPlayerEditorFields: Readonly<Record<AdminPlayerEditorKey, null>> = {
|
|
221
|
+
...researchFields,
|
|
222
|
+
...officerFields,
|
|
223
|
+
name: null,
|
|
224
|
+
darkmatter: null,
|
|
225
|
+
}
|
|
226
|
+
export const adminPlanetEditorFields: Readonly<Record<AdminPlanetEditorKey, null>> = {
|
|
227
|
+
...planetBuildingFields,
|
|
228
|
+
...bodyFields,
|
|
229
|
+
}
|
|
230
|
+
export const adminMoonEditorFields: Readonly<Record<AdminMoonEditorKey, null>> = {
|
|
231
|
+
...moonBuildingFields,
|
|
232
|
+
...bodyFields,
|
|
233
|
+
}
|
|
234
|
+
export const adminUniverseSettingFields: Readonly<Record<AdminUniverseSettingKey, null>> = {
|
|
235
|
+
game_name: null,
|
|
236
|
+
ttf_file: null,
|
|
237
|
+
timezone: null,
|
|
238
|
+
del_oldstuff: null,
|
|
239
|
+
del_user_manually: null,
|
|
240
|
+
del_user_automatic: null,
|
|
241
|
+
sendmail_inactive: null,
|
|
242
|
+
del_user_sendmail: null,
|
|
243
|
+
capaktiv: null,
|
|
244
|
+
cappublic: null,
|
|
245
|
+
capprivate: null,
|
|
246
|
+
mail_active: null,
|
|
247
|
+
mail_use: null,
|
|
248
|
+
smtp_sendmail: null,
|
|
249
|
+
smail_path: null,
|
|
250
|
+
smtp_host: null,
|
|
251
|
+
smtp_ssl: null,
|
|
252
|
+
smtp_port: null,
|
|
253
|
+
smtp_user: null,
|
|
254
|
+
smtp_pass: null,
|
|
255
|
+
message_delete_behavior: null,
|
|
256
|
+
message_delete_days: null,
|
|
257
|
+
ga_active: null,
|
|
258
|
+
ga_key: null,
|
|
259
|
+
chat_channelname: null,
|
|
260
|
+
chat_botname: null,
|
|
261
|
+
chat_nickchange: null,
|
|
262
|
+
chat_logmessage: null,
|
|
263
|
+
chat_allowmes: null,
|
|
264
|
+
chat_allowchan: null,
|
|
265
|
+
chat_closed: null,
|
|
266
|
+
ts_modon: null,
|
|
267
|
+
ts_version: null,
|
|
268
|
+
ts_server: null,
|
|
269
|
+
ts_tcpport: null,
|
|
270
|
+
ts_udpport: null,
|
|
271
|
+
ts_login: null,
|
|
272
|
+
ts_password: null,
|
|
273
|
+
ts_timeout: null,
|
|
274
|
+
ts_cron_interval: null,
|
|
275
|
+
uni_name: null,
|
|
276
|
+
lang: null,
|
|
277
|
+
game_speed: null,
|
|
278
|
+
fleet_speed: null,
|
|
279
|
+
resource_multiplier: null,
|
|
280
|
+
storage_multiplier: null,
|
|
281
|
+
halt_speed: null,
|
|
282
|
+
energySpeed: null,
|
|
283
|
+
forum_url: null,
|
|
284
|
+
game_disable: null,
|
|
285
|
+
close_reason: null,
|
|
286
|
+
max_elements_build: null,
|
|
287
|
+
max_elements_tech: null,
|
|
288
|
+
max_elements_ships: null,
|
|
289
|
+
max_fleet_per_build: null,
|
|
290
|
+
ref_active: null,
|
|
291
|
+
ref_bonus: null,
|
|
292
|
+
ref_minpoints: null,
|
|
293
|
+
ref_max_referals: null,
|
|
294
|
+
min_player_planets: null,
|
|
295
|
+
planets_tech: null,
|
|
296
|
+
planets_officier: null,
|
|
297
|
+
planets_per_tech: null,
|
|
298
|
+
metal_start: null,
|
|
299
|
+
crystal_start: null,
|
|
300
|
+
deuterium_start: null,
|
|
301
|
+
darkmatter_start: null,
|
|
302
|
+
initial_fields: null,
|
|
303
|
+
metal_basic_income: null,
|
|
304
|
+
crystal_basic_income: null,
|
|
305
|
+
deuterium_basic_income: null,
|
|
306
|
+
min_build_time: null,
|
|
307
|
+
reg_closed: null,
|
|
308
|
+
user_valid: null,
|
|
309
|
+
adm_attack: null,
|
|
310
|
+
debug: null,
|
|
311
|
+
Fleet_Cdr: null,
|
|
312
|
+
Defs_Cdr: null,
|
|
313
|
+
max_galaxy: null,
|
|
314
|
+
max_system: null,
|
|
315
|
+
max_planets: null,
|
|
316
|
+
planet_factor: null,
|
|
317
|
+
max_overflow: null,
|
|
318
|
+
moon_factor: null,
|
|
319
|
+
moon_chance: null,
|
|
320
|
+
deuterium_cost_galaxy: null,
|
|
321
|
+
cost_trader: null,
|
|
322
|
+
factor_university: null,
|
|
323
|
+
max_fleets_per_acs: null,
|
|
324
|
+
silo_factor: null,
|
|
325
|
+
vmode_min_time: null,
|
|
326
|
+
gate_wait_time: null,
|
|
327
|
+
debris_moon: null,
|
|
328
|
+
noobprotection: null,
|
|
329
|
+
noobprotectiontime: null,
|
|
330
|
+
noobprotectionmulti: null,
|
|
331
|
+
max_dm_missions: null,
|
|
332
|
+
alliance_create_min_points: null,
|
|
333
|
+
trade_allowed_ships: null,
|
|
334
|
+
trade_charge: null,
|
|
335
|
+
OverviewNewsFrame: null,
|
|
336
|
+
OverviewNewsText: null,
|
|
337
|
+
stat_settings: null,
|
|
338
|
+
stat: null,
|
|
339
|
+
stat_level: null,
|
|
340
|
+
fb_on: null,
|
|
341
|
+
fb_apikey: null,
|
|
342
|
+
fb_skey: null,
|
|
343
|
+
disclamerAddress: null,
|
|
344
|
+
disclamerPhone: null,
|
|
345
|
+
disclamerMail: null,
|
|
346
|
+
disclamerNotice: null,
|
|
347
|
+
}
|
|
348
|
+
export const adminRightFields: Readonly<Record<AdminRightKey, null>> = {
|
|
349
|
+
'ShowAccountEditorPage.class': null,
|
|
350
|
+
'ShowActivePage.class': null,
|
|
351
|
+
'ShowBanPage.class': null,
|
|
352
|
+
'ShowClearCachePage.class': null,
|
|
353
|
+
'ShowConfigUniPage.class': null,
|
|
354
|
+
'ShowCreatePage.class': null,
|
|
355
|
+
'ShowCronjobPage.class': null,
|
|
356
|
+
'ShowDumpPage.class': null,
|
|
357
|
+
'ShowFlyingFleetPage.class': null,
|
|
358
|
+
'ShowGiveawayPage.class': null,
|
|
359
|
+
'ShowInformationPage.class': null,
|
|
360
|
+
'ShowLogPage.class': null,
|
|
361
|
+
'ShowMessageListPage.class': null,
|
|
362
|
+
'ShowModulePage.class': null,
|
|
363
|
+
'ShowMultiIPPage.class': null,
|
|
364
|
+
'ShowNewsPage.class': null,
|
|
365
|
+
'ShowPasswordPage.class': null,
|
|
366
|
+
'ShowQuickEditorPage.class': null,
|
|
367
|
+
'ShowResetPage.class': null,
|
|
368
|
+
'ShowRightsPage.class': null,
|
|
369
|
+
'ShowSearchPage.class': null,
|
|
370
|
+
'ShowSendMessagesPage.class': null,
|
|
371
|
+
'ShowStatUpdatePage.class': null,
|
|
372
|
+
'ShowSupportPage.class': null,
|
|
373
|
+
'ShowUniversePage.class': null,
|
|
374
|
+
}
|
|
375
|
+
|
|
376
|
+
export const adminAccountEditorFields: {
|
|
377
|
+
readonly [Section in AdminAccountEditorSection]: Readonly<
|
|
378
|
+
Record<keyof Extract<AdminAccountEditorSubmit, { section: Section }>['values'], null>
|
|
379
|
+
>
|
|
380
|
+
} = {
|
|
381
|
+
research: { id: null, ...researchFields },
|
|
382
|
+
officers: { id: null, ...officerFields },
|
|
383
|
+
ships: { id: null, ...shipFields },
|
|
384
|
+
defenses: { id: null, ...defenseFields },
|
|
385
|
+
buildings: { id: null, ...planetBuildingFields, ...moonBuildingFields },
|
|
386
|
+
resources: {
|
|
387
|
+
id: null,
|
|
388
|
+
id_dark: null,
|
|
389
|
+
metal: null,
|
|
390
|
+
cristal: null,
|
|
391
|
+
deut: null,
|
|
392
|
+
dark: null,
|
|
393
|
+
},
|
|
394
|
+
personal: {
|
|
395
|
+
id: null,
|
|
396
|
+
username: null,
|
|
397
|
+
password: null,
|
|
398
|
+
email: null,
|
|
399
|
+
email_2: null,
|
|
400
|
+
vacation: null,
|
|
401
|
+
d: null,
|
|
402
|
+
h: null,
|
|
403
|
+
m: null,
|
|
404
|
+
s: null,
|
|
405
|
+
},
|
|
406
|
+
planets: {
|
|
407
|
+
id: null,
|
|
408
|
+
name: null,
|
|
409
|
+
diameter: null,
|
|
410
|
+
fields: null,
|
|
411
|
+
'0_buildings': null,
|
|
412
|
+
'0_ships': null,
|
|
413
|
+
'0_defenses': null,
|
|
414
|
+
'0_c_hangar': null,
|
|
415
|
+
'0_c_buildings': null,
|
|
416
|
+
change_position: null,
|
|
417
|
+
g: null,
|
|
418
|
+
s: null,
|
|
419
|
+
p: null,
|
|
420
|
+
},
|
|
421
|
+
alliances: {
|
|
422
|
+
id: null,
|
|
423
|
+
name: null,
|
|
424
|
+
changeleader: null,
|
|
425
|
+
tag: null,
|
|
426
|
+
externo: null,
|
|
427
|
+
interno: null,
|
|
428
|
+
solicitud: null,
|
|
429
|
+
delete: null,
|
|
430
|
+
delete_u: null,
|
|
431
|
+
},
|
|
432
|
+
}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import type { AdminCredentials } from '@senators/bifrost'
|
|
2
|
+
|
|
3
|
+
import { required, stringInput } from '../spec.ts'
|
|
4
|
+
import type { InputSpec } from '../spec.ts'
|
|
5
|
+
|
|
6
|
+
export const adminCredentialsInput: InputSpec<AdminCredentials> = {
|
|
7
|
+
kind: 'object',
|
|
8
|
+
fields: { password: required(stringInput) },
|
|
9
|
+
}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import type { AdminMessageDate, AdminMessageFilter } from '@senators/bifrost'
|
|
2
|
+
|
|
3
|
+
import { numberInput, optional, required, stringInput } from '../spec.ts'
|
|
4
|
+
import type { InputSpec } from '../spec.ts'
|
|
5
|
+
|
|
6
|
+
const adminMessageDateInput: InputSpec<AdminMessageDate> = {
|
|
7
|
+
kind: 'object',
|
|
8
|
+
fields: { day: required(numberInput), month: required(numberInput), year: required(numberInput) },
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
export const adminMessageFilterInput: InputSpec<AdminMessageFilter> = {
|
|
12
|
+
kind: 'object',
|
|
13
|
+
fields: {
|
|
14
|
+
category: optional(numberInput),
|
|
15
|
+
sender: optional(stringInput),
|
|
16
|
+
receiver: optional(stringInput),
|
|
17
|
+
page: optional(numberInput),
|
|
18
|
+
from: optional(adminMessageDateInput),
|
|
19
|
+
to: optional(adminMessageDateInput),
|
|
20
|
+
},
|
|
21
|
+
}
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import type { AdminNewsDraft, AdminNewsRead } from '@senators/bifrost'
|
|
2
|
+
|
|
3
|
+
import {
|
|
4
|
+
enumeration,
|
|
5
|
+
nullInput,
|
|
6
|
+
numberInput,
|
|
7
|
+
optional,
|
|
8
|
+
required,
|
|
9
|
+
stringInput,
|
|
10
|
+
unionInput,
|
|
11
|
+
} from '../spec.ts'
|
|
12
|
+
import type { InputSpec } from '../spec.ts'
|
|
13
|
+
|
|
14
|
+
export const adminNewsDraftInput: InputSpec<AdminNewsDraft> = {
|
|
15
|
+
kind: 'object',
|
|
16
|
+
fields: {
|
|
17
|
+
id: required(unionInput(numberInput, nullInput)),
|
|
18
|
+
text: required(stringInput),
|
|
19
|
+
title: required(stringInput),
|
|
20
|
+
},
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
export const adminNewsReadInput: InputSpec<AdminNewsRead> = unionInput(
|
|
24
|
+
{ kind: 'object', fields: { action: optional(enumeration(['create'])) } },
|
|
25
|
+
{
|
|
26
|
+
kind: 'object',
|
|
27
|
+
fields: { action: required(enumeration(['edit'])), id: required(numberInput) },
|
|
28
|
+
},
|
|
29
|
+
)
|
|
@@ -0,0 +1,115 @@
|
|
|
1
|
+
import type {
|
|
2
|
+
AdminMoonEditorKey,
|
|
3
|
+
AdminMoonEditorPage,
|
|
4
|
+
AdminPlanetEditorKey,
|
|
5
|
+
AdminPlanetEditorPage,
|
|
6
|
+
AdminPlayerEditorKey,
|
|
7
|
+
AdminPlayerEditorPage,
|
|
8
|
+
AdminQuickEditorSave,
|
|
9
|
+
AdminQuickEditorTarget,
|
|
10
|
+
} from '@senators/bifrost'
|
|
11
|
+
|
|
12
|
+
import {
|
|
13
|
+
booleanInput,
|
|
14
|
+
enumeration,
|
|
15
|
+
nullInput,
|
|
16
|
+
numberInput,
|
|
17
|
+
optional,
|
|
18
|
+
required,
|
|
19
|
+
stringInput,
|
|
20
|
+
unionInput,
|
|
21
|
+
} from '../spec.ts'
|
|
22
|
+
import type { InputSpec } from '../spec.ts'
|
|
23
|
+
import {
|
|
24
|
+
adminMoonEditorFields,
|
|
25
|
+
adminPlanetEditorFields,
|
|
26
|
+
adminPlayerEditorFields,
|
|
27
|
+
} from './fields.ts'
|
|
28
|
+
import { adminDocumentInput, adminPatchInput, adminRecordInput } from './records.ts'
|
|
29
|
+
|
|
30
|
+
export const adminQuickEditorTargetInput: InputSpec<AdminQuickEditorTarget> = enumeration([
|
|
31
|
+
'player',
|
|
32
|
+
'planet',
|
|
33
|
+
])
|
|
34
|
+
|
|
35
|
+
/**
|
|
36
|
+
* The server rewrites all editable values; queried records must retain every stored field.
|
|
37
|
+
*
|
|
38
|
+
* 服务端会重写所有可编辑值,查询记录必须保留全部已有字段。
|
|
39
|
+
*/
|
|
40
|
+
const playerRecordInput: InputSpec<AdminPlayerEditorPage> = {
|
|
41
|
+
kind: 'object',
|
|
42
|
+
additional: true,
|
|
43
|
+
fields: {
|
|
44
|
+
kind: required(enumeration(['adminQuickEditor'])),
|
|
45
|
+
editor: required(enumeration(['player'])),
|
|
46
|
+
observedAtMs: required(numberInput),
|
|
47
|
+
recordId: required(numberInput),
|
|
48
|
+
values: required(
|
|
49
|
+
adminRecordInput<AdminPlayerEditorKey, string>(adminPlayerEditorFields, stringInput, true),
|
|
50
|
+
),
|
|
51
|
+
canChangePassword: required(booleanInput),
|
|
52
|
+
multi: required(unionInput(booleanInput, nullInput)),
|
|
53
|
+
},
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
const planetRecordInput: InputSpec<AdminPlanetEditorPage> = {
|
|
57
|
+
kind: 'object',
|
|
58
|
+
additional: true,
|
|
59
|
+
fields: {
|
|
60
|
+
kind: required(enumeration(['adminQuickEditor'])),
|
|
61
|
+
editor: required(enumeration(['planet'])),
|
|
62
|
+
observedAtMs: required(numberInput),
|
|
63
|
+
recordId: required(numberInput),
|
|
64
|
+
values: required(
|
|
65
|
+
adminRecordInput<AdminPlanetEditorKey, string>(adminPlanetEditorFields, stringInput, true),
|
|
66
|
+
),
|
|
67
|
+
},
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
const moonRecordInput: InputSpec<AdminMoonEditorPage> = {
|
|
71
|
+
kind: 'object',
|
|
72
|
+
additional: true,
|
|
73
|
+
fields: {
|
|
74
|
+
kind: required(enumeration(['adminQuickEditor'])),
|
|
75
|
+
editor: required(enumeration(['moon'])),
|
|
76
|
+
observedAtMs: required(numberInput),
|
|
77
|
+
recordId: required(numberInput),
|
|
78
|
+
values: required(
|
|
79
|
+
adminRecordInput<AdminMoonEditorKey, string>(adminMoonEditorFields, stringInput, true),
|
|
80
|
+
),
|
|
81
|
+
},
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
export const adminQuickEditorSaveInput: InputSpec<AdminQuickEditorSave> = unionInput(
|
|
85
|
+
{
|
|
86
|
+
kind: 'object',
|
|
87
|
+
fields: {
|
|
88
|
+
record: required(adminDocumentInput<AdminPlayerEditorPage>(playerRecordInput)),
|
|
89
|
+
patch: required(
|
|
90
|
+
adminPatchInput<AdminPlayerEditorKey, string>(adminPlayerEditorFields, stringInput),
|
|
91
|
+
),
|
|
92
|
+
authorizationAttack: required(booleanInput),
|
|
93
|
+
multi: required(booleanInput),
|
|
94
|
+
password: optional(stringInput),
|
|
95
|
+
},
|
|
96
|
+
},
|
|
97
|
+
{
|
|
98
|
+
kind: 'object',
|
|
99
|
+
fields: {
|
|
100
|
+
record: required(adminDocumentInput<AdminPlanetEditorPage>(planetRecordInput)),
|
|
101
|
+
patch: required(
|
|
102
|
+
adminPatchInput<AdminPlanetEditorKey, string>(adminPlanetEditorFields, stringInput),
|
|
103
|
+
),
|
|
104
|
+
},
|
|
105
|
+
},
|
|
106
|
+
{
|
|
107
|
+
kind: 'object',
|
|
108
|
+
fields: {
|
|
109
|
+
record: required(adminDocumentInput<AdminMoonEditorPage>(moonRecordInput)),
|
|
110
|
+
patch: required(
|
|
111
|
+
adminPatchInput<AdminMoonEditorKey, string>(adminMoonEditorFields, stringInput),
|
|
112
|
+
),
|
|
113
|
+
},
|
|
114
|
+
},
|
|
115
|
+
)
|
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
import { matchesInput } from '../parse.ts'
|
|
2
|
+
import type { InputField, InputNode, InputSpec } from '../spec.ts'
|
|
3
|
+
|
|
4
|
+
type CheckedInput<Value> = {
|
|
5
|
+
kind: 'custom' | 'document'
|
|
6
|
+
input: InputNode
|
|
7
|
+
output: InputNode
|
|
8
|
+
accepts: (value: unknown) => value is Value
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
/**
|
|
12
|
+
* Field tables define both complete records and partial edits without duplicating field names.
|
|
13
|
+
*
|
|
14
|
+
* 字段表同时描述完整记录与局部编辑,避免重复维护字段名。
|
|
15
|
+
*/
|
|
16
|
+
export function adminRecordFields<Key extends string>(
|
|
17
|
+
names: Readonly<Record<Key, null>>,
|
|
18
|
+
schema: InputNode,
|
|
19
|
+
optional: boolean,
|
|
20
|
+
): Record<string, InputField> {
|
|
21
|
+
return Object.fromEntries(Object.keys(names).map((name) => [name, { schema, optional }]))
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
export function adminRecordInput<Key extends string, Value>(
|
|
25
|
+
names: Readonly<Record<Key, null>>,
|
|
26
|
+
schema: InputSpec<Value>,
|
|
27
|
+
additional: boolean,
|
|
28
|
+
): CheckedInput<Readonly<Record<Key, Value>>> {
|
|
29
|
+
const input: InputNode = {
|
|
30
|
+
kind: 'object',
|
|
31
|
+
fields: adminRecordFields(names, schema, false),
|
|
32
|
+
additional,
|
|
33
|
+
}
|
|
34
|
+
return {
|
|
35
|
+
kind: 'custom',
|
|
36
|
+
input,
|
|
37
|
+
output: input,
|
|
38
|
+
accepts(value): value is Readonly<Record<Key, Value>> {
|
|
39
|
+
return matchesInput(input, value)
|
|
40
|
+
},
|
|
41
|
+
}
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
export function adminPatchInput<Key extends string, Value>(
|
|
45
|
+
names: Readonly<Record<Key, null>>,
|
|
46
|
+
schema: InputSpec<Value>,
|
|
47
|
+
): CheckedInput<Readonly<Partial<Record<Key, Value>>>> {
|
|
48
|
+
const input: InputNode = { kind: 'object', fields: adminRecordFields(names, schema, true) }
|
|
49
|
+
return {
|
|
50
|
+
kind: 'custom',
|
|
51
|
+
input,
|
|
52
|
+
output: input,
|
|
53
|
+
accepts(value): value is Readonly<Partial<Record<Key, Value>>> {
|
|
54
|
+
return matchesInput(input, value)
|
|
55
|
+
},
|
|
56
|
+
}
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
export function adminDocumentInput<Value>(input: InputSpec<Value>): CheckedInput<Value> {
|
|
60
|
+
return {
|
|
61
|
+
kind: 'document',
|
|
62
|
+
input,
|
|
63
|
+
output: input,
|
|
64
|
+
accepts(value): value is Value {
|
|
65
|
+
return matchesInput(input, value)
|
|
66
|
+
},
|
|
67
|
+
}
|
|
68
|
+
}
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import type { AdminResetTarget } from '@senators/bifrost'
|
|
2
|
+
|
|
3
|
+
import { enumeration } from '../spec.ts'
|
|
4
|
+
import type { InputSpec } from '../spec.ts'
|
|
5
|
+
|
|
6
|
+
export const adminResetTargetInput: InputSpec<AdminResetTarget> = enumeration([
|
|
7
|
+
'alliances',
|
|
8
|
+
'banneds',
|
|
9
|
+
'dark',
|
|
10
|
+
'defenses',
|
|
11
|
+
'edif',
|
|
12
|
+
'edif_l',
|
|
13
|
+
'edif_p',
|
|
14
|
+
'fleets',
|
|
15
|
+
'friends',
|
|
16
|
+
'h_d',
|
|
17
|
+
'inves',
|
|
18
|
+
'inves_c',
|
|
19
|
+
'messages',
|
|
20
|
+
'moons',
|
|
21
|
+
'notes',
|
|
22
|
+
'ofis',
|
|
23
|
+
'planets',
|
|
24
|
+
'players',
|
|
25
|
+
'resources',
|
|
26
|
+
'rw',
|
|
27
|
+
'ships',
|
|
28
|
+
'statpoints',
|
|
29
|
+
])
|