@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,22 @@
|
|
|
1
|
+
import { statistics } from '@senators/bifrost'
|
|
2
|
+
|
|
3
|
+
import { observedCommand } from '../../catalog.ts'
|
|
4
|
+
import { enumeration, numberInput, optional } from '../../input/spec.ts'
|
|
5
|
+
import type { InputSpec } from '../../input/spec.ts'
|
|
6
|
+
import type { NetworkCommand } from '../../types.ts'
|
|
7
|
+
|
|
8
|
+
const statisticsSchema = {
|
|
9
|
+
kind: 'object',
|
|
10
|
+
fields: {
|
|
11
|
+
entityType: optional(enumeration([1, 2])),
|
|
12
|
+
rankRange: optional(numberInput),
|
|
13
|
+
rankingType: optional(enumeration([1, 2, 3, 4, 5])),
|
|
14
|
+
},
|
|
15
|
+
} satisfies InputSpec<Parameters<typeof statistics>[1]>
|
|
16
|
+
|
|
17
|
+
export const statisticsCommand: NetworkCommand = observedCommand(
|
|
18
|
+
'game',
|
|
19
|
+
'statistics',
|
|
20
|
+
statisticsSchema,
|
|
21
|
+
statistics,
|
|
22
|
+
)
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { store } from '@senators/bifrost'
|
|
2
|
+
|
|
3
|
+
import { observedCommand } from '../../catalog.ts'
|
|
4
|
+
import { emptyInput } from '../../input/spec.ts'
|
|
5
|
+
import type { NetworkCommand } from '../../types.ts'
|
|
6
|
+
|
|
7
|
+
export const storeCommand: NetworkCommand = observedCommand<Record<string, never>>(
|
|
8
|
+
'game',
|
|
9
|
+
'store',
|
|
10
|
+
emptyInput,
|
|
11
|
+
(session) => store(session),
|
|
12
|
+
)
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { techtree } from '@senators/bifrost'
|
|
2
|
+
|
|
3
|
+
import { observedCommand } from '../../catalog.ts'
|
|
4
|
+
import { planetReferenceInput } from '../../input/shared.ts'
|
|
5
|
+
import type { InputSpec } from '../../input/spec.ts'
|
|
6
|
+
import type { NetworkCommand } from '../../types.ts'
|
|
7
|
+
|
|
8
|
+
const techtreeSchema = planetReferenceInput satisfies InputSpec<Parameters<typeof techtree>[1]>
|
|
9
|
+
|
|
10
|
+
export const techtreeCommand: NetworkCommand = observedCommand(
|
|
11
|
+
'game',
|
|
12
|
+
'techtree',
|
|
13
|
+
techtreeSchema,
|
|
14
|
+
techtree,
|
|
15
|
+
'planetId',
|
|
16
|
+
)
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
import { ticket, ticketCreate, ticketSend, ticketView } from '@senators/bifrost'
|
|
2
|
+
|
|
3
|
+
import { observedCommand } from '../../catalog.ts'
|
|
4
|
+
import { ticketInput } from '../../input/game/ticket.ts'
|
|
5
|
+
import { emptyInput, numberInput, required } from '../../input/spec.ts'
|
|
6
|
+
import type { InputSpec } from '../../input/spec.ts'
|
|
7
|
+
import type { NetworkCommand } from '../../types.ts'
|
|
8
|
+
|
|
9
|
+
const ticketSendSchema = ticketInput satisfies InputSpec<Parameters<typeof ticketSend>[1]>
|
|
10
|
+
|
|
11
|
+
const ticketViewSchema = {
|
|
12
|
+
kind: 'object',
|
|
13
|
+
fields: {
|
|
14
|
+
ticketId: required(numberInput),
|
|
15
|
+
},
|
|
16
|
+
} satisfies InputSpec<Parameters<typeof ticketView>[1]>
|
|
17
|
+
|
|
18
|
+
export const ticketCommand: NetworkCommand = observedCommand<Record<string, never>>(
|
|
19
|
+
'game',
|
|
20
|
+
'ticket',
|
|
21
|
+
emptyInput,
|
|
22
|
+
(session) => ticket(session),
|
|
23
|
+
)
|
|
24
|
+
|
|
25
|
+
export const ticketCreateCommand: NetworkCommand = observedCommand<Record<string, never>>(
|
|
26
|
+
'game',
|
|
27
|
+
'ticketCreate',
|
|
28
|
+
emptyInput,
|
|
29
|
+
(session) => ticketCreate(session),
|
|
30
|
+
)
|
|
31
|
+
|
|
32
|
+
export const ticketSendCommand: NetworkCommand = observedCommand(
|
|
33
|
+
'game',
|
|
34
|
+
'ticketSend',
|
|
35
|
+
ticketSendSchema,
|
|
36
|
+
ticketSend,
|
|
37
|
+
)
|
|
38
|
+
|
|
39
|
+
export const ticketViewCommand: NetworkCommand = observedCommand(
|
|
40
|
+
'game',
|
|
41
|
+
'ticketView',
|
|
42
|
+
ticketViewSchema,
|
|
43
|
+
ticketView,
|
|
44
|
+
)
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
import { trader, traderSend, traderTrade } from '@senators/bifrost'
|
|
2
|
+
|
|
3
|
+
import { observedCommand } from '../../catalog.ts'
|
|
4
|
+
import { planetStockIdInput } from '../../input/protocol/context.ts'
|
|
5
|
+
import { planetReferenceInput, stockAmountsInput } from '../../input/shared.ts'
|
|
6
|
+
import { numberInput, required } from '../../input/spec.ts'
|
|
7
|
+
import type { InputSpec } from '../../input/spec.ts'
|
|
8
|
+
import type { NetworkCommand } from '../../types.ts'
|
|
9
|
+
|
|
10
|
+
const traderSchema = planetReferenceInput satisfies InputSpec<Parameters<typeof trader>[1]>
|
|
11
|
+
|
|
12
|
+
const traderSendSchema = {
|
|
13
|
+
kind: 'object',
|
|
14
|
+
fields: {
|
|
15
|
+
planetId: required(numberInput),
|
|
16
|
+
receive: required(stockAmountsInput),
|
|
17
|
+
resourceId: required(planetStockIdInput),
|
|
18
|
+
},
|
|
19
|
+
} satisfies InputSpec<Parameters<typeof traderSend>[1]>
|
|
20
|
+
|
|
21
|
+
const traderTradeSchema = {
|
|
22
|
+
kind: 'object',
|
|
23
|
+
fields: {
|
|
24
|
+
planetId: required(numberInput),
|
|
25
|
+
resourceId: required(planetStockIdInput),
|
|
26
|
+
},
|
|
27
|
+
} satisfies InputSpec<Parameters<typeof traderTrade>[1]>
|
|
28
|
+
|
|
29
|
+
export const traderCommand: NetworkCommand = observedCommand(
|
|
30
|
+
'game',
|
|
31
|
+
'trader',
|
|
32
|
+
traderSchema,
|
|
33
|
+
trader,
|
|
34
|
+
'planetId',
|
|
35
|
+
)
|
|
36
|
+
|
|
37
|
+
export const traderSendCommand: NetworkCommand = observedCommand(
|
|
38
|
+
'game',
|
|
39
|
+
'traderSend',
|
|
40
|
+
traderSendSchema,
|
|
41
|
+
traderSend,
|
|
42
|
+
'planetId',
|
|
43
|
+
)
|
|
44
|
+
|
|
45
|
+
export const traderTradeCommand: NetworkCommand = observedCommand(
|
|
46
|
+
'game',
|
|
47
|
+
'traderTrade',
|
|
48
|
+
traderTradeSchema,
|
|
49
|
+
traderTrade,
|
|
50
|
+
'planetId',
|
|
51
|
+
)
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { dispatchFleet } from '@senators/bifrost'
|
|
2
|
+
|
|
3
|
+
import { plainCommand } from '../../../catalog.ts'
|
|
4
|
+
import { dispatchFleetInput } from '../../../input/workflows/fleet.ts'
|
|
5
|
+
import type { NetworkCommand } from '../../../types.ts'
|
|
6
|
+
|
|
7
|
+
export const dispatchFleetCommand: NetworkCommand = plainCommand(
|
|
8
|
+
'game',
|
|
9
|
+
'dispatchFleet',
|
|
10
|
+
dispatchFleetInput,
|
|
11
|
+
dispatchFleet,
|
|
12
|
+
)
|
|
@@ -0,0 +1,84 @@
|
|
|
1
|
+
import { snapshotAccount, snapshotPlanet } from '@senators/bifrost'
|
|
2
|
+
import type { SnapshotRequest } from '@senators/bifrost'
|
|
3
|
+
|
|
4
|
+
import { parseInput } from '../../../input/parse.ts'
|
|
5
|
+
import { snapshotAccountInput, snapshotPlanetInput } from '../../../input/workflows/snapshot.ts'
|
|
6
|
+
import type {
|
|
7
|
+
SnapshotAccountInput,
|
|
8
|
+
SnapshotPlanetInput,
|
|
9
|
+
} from '../../../input/workflows/snapshot.ts'
|
|
10
|
+
import type { SnapshotCommand } from '../../../types.ts'
|
|
11
|
+
|
|
12
|
+
export const snapshotAccountCommand: SnapshotCommand = {
|
|
13
|
+
name: 'game snapshot-account',
|
|
14
|
+
method: 'snapshotAccount',
|
|
15
|
+
input: snapshotAccountInput,
|
|
16
|
+
session: true,
|
|
17
|
+
extension: false,
|
|
18
|
+
async execute(session, input, extension) {
|
|
19
|
+
const value = parseInput<SnapshotAccountInput>(
|
|
20
|
+
snapshotAccountInput,
|
|
21
|
+
input,
|
|
22
|
+
'game snapshot-account',
|
|
23
|
+
)
|
|
24
|
+
const { additional: requests, additionalByPlanet: planetRequests, ...options } = value
|
|
25
|
+
const additional =
|
|
26
|
+
requests === undefined
|
|
27
|
+
? undefined
|
|
28
|
+
: await Promise.all(
|
|
29
|
+
requests.map(async ({ name, read }) => ({ name, read: await extension(read) })),
|
|
30
|
+
)
|
|
31
|
+
const additionalByPlanet =
|
|
32
|
+
planetRequests === undefined
|
|
33
|
+
? undefined
|
|
34
|
+
: new Map(
|
|
35
|
+
await Promise.all(
|
|
36
|
+
[...planetRequests].map(
|
|
37
|
+
async ([planetId, entries]): Promise<[number, SnapshotRequest[]]> => [
|
|
38
|
+
planetId,
|
|
39
|
+
await Promise.all(
|
|
40
|
+
entries.map(async ({ name, read }) => ({
|
|
41
|
+
name,
|
|
42
|
+
read: await extension(read, { planetId }),
|
|
43
|
+
})),
|
|
44
|
+
),
|
|
45
|
+
],
|
|
46
|
+
),
|
|
47
|
+
),
|
|
48
|
+
)
|
|
49
|
+
return snapshotAccount(session, {
|
|
50
|
+
...options,
|
|
51
|
+
...(additional === undefined ? {} : { additional }),
|
|
52
|
+
...(additionalByPlanet === undefined ? {} : { additionalByPlanet }),
|
|
53
|
+
})
|
|
54
|
+
},
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
export const snapshotPlanetCommand: SnapshotCommand = {
|
|
58
|
+
name: 'game snapshot-planet',
|
|
59
|
+
method: 'snapshotPlanet',
|
|
60
|
+
input: snapshotPlanetInput,
|
|
61
|
+
session: true,
|
|
62
|
+
extension: false,
|
|
63
|
+
async execute(session, input, extension) {
|
|
64
|
+
const value = parseInput<SnapshotPlanetInput>(
|
|
65
|
+
snapshotPlanetInput,
|
|
66
|
+
input,
|
|
67
|
+
'game snapshot-planet',
|
|
68
|
+
)
|
|
69
|
+
const { additional: requests, ...options } = value
|
|
70
|
+
const additional =
|
|
71
|
+
requests === undefined
|
|
72
|
+
? undefined
|
|
73
|
+
: await Promise.all(
|
|
74
|
+
requests.map(async ({ name, read }) => ({
|
|
75
|
+
name,
|
|
76
|
+
read: await extension(read, { planetId: value.planetId }),
|
|
77
|
+
})),
|
|
78
|
+
)
|
|
79
|
+
return snapshotPlanet(session, {
|
|
80
|
+
...options,
|
|
81
|
+
...(additional === undefined ? {} : { additional }),
|
|
82
|
+
})
|
|
83
|
+
},
|
|
84
|
+
}
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import { sendBuddyRequest, sendMessage } from '@senators/bifrost'
|
|
2
|
+
|
|
3
|
+
import { plainCommand } from '../../../catalog.ts'
|
|
4
|
+
import { numberInput, optional, required, stringInput } from '../../../input/spec.ts'
|
|
5
|
+
import type { InputSpec } from '../../../input/spec.ts'
|
|
6
|
+
import type { NetworkCommand } from '../../../types.ts'
|
|
7
|
+
|
|
8
|
+
const sendBuddyRequestSchema = {
|
|
9
|
+
kind: 'object',
|
|
10
|
+
fields: {
|
|
11
|
+
playerId: required(numberInput),
|
|
12
|
+
text: required(stringInput),
|
|
13
|
+
},
|
|
14
|
+
} satisfies InputSpec<Parameters<typeof sendBuddyRequest>[1]>
|
|
15
|
+
|
|
16
|
+
const sendMessageSchema = {
|
|
17
|
+
kind: 'object',
|
|
18
|
+
fields: {
|
|
19
|
+
recipientId: required(numberInput),
|
|
20
|
+
subject: optional(stringInput),
|
|
21
|
+
text: required(stringInput),
|
|
22
|
+
},
|
|
23
|
+
} satisfies InputSpec<Parameters<typeof sendMessage>[1]>
|
|
24
|
+
|
|
25
|
+
export const sendBuddyRequestCommand: NetworkCommand = plainCommand(
|
|
26
|
+
'game',
|
|
27
|
+
'sendBuddyRequest',
|
|
28
|
+
sendBuddyRequestSchema,
|
|
29
|
+
sendBuddyRequest,
|
|
30
|
+
)
|
|
31
|
+
|
|
32
|
+
export const sendMessageCommand: NetworkCommand = plainCommand(
|
|
33
|
+
'game',
|
|
34
|
+
'sendMessage',
|
|
35
|
+
sendMessageSchema,
|
|
36
|
+
sendMessage,
|
|
37
|
+
)
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { get } from '@senators/bifrost'
|
|
2
|
+
|
|
3
|
+
import { plainCommand } from '../../catalog.ts'
|
|
4
|
+
import { required, stringInput } from '../../input/spec.ts'
|
|
5
|
+
import type { InputSpec } from '../../input/spec.ts'
|
|
6
|
+
import type { NetworkCommand } from '../../types.ts'
|
|
7
|
+
|
|
8
|
+
const getSchema = {
|
|
9
|
+
kind: 'object',
|
|
10
|
+
fields: { url: required(stringInput) },
|
|
11
|
+
} satisfies InputSpec<Parameters<typeof get>[1]>
|
|
12
|
+
|
|
13
|
+
export const getCommand: NetworkCommand = plainCommand('http', 'get', getSchema, get)
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
import { post } from '@senators/bifrost'
|
|
2
|
+
import type { RequestParameters } from '@senators/bifrost'
|
|
3
|
+
|
|
4
|
+
import { plainCommand } from '../../catalog.ts'
|
|
5
|
+
import {
|
|
6
|
+
arrayInput,
|
|
7
|
+
mapInput,
|
|
8
|
+
numberInput,
|
|
9
|
+
required,
|
|
10
|
+
stringInput,
|
|
11
|
+
unionInput,
|
|
12
|
+
} from '../../input/spec.ts'
|
|
13
|
+
import type { InputSpec } from '../../input/spec.ts'
|
|
14
|
+
import { isObject, isScalar, readParameters } from '../../input/values.ts'
|
|
15
|
+
import type { NetworkCommand } from '../../types.ts'
|
|
16
|
+
|
|
17
|
+
function isRequestParameters(value: unknown): value is RequestParameters {
|
|
18
|
+
return (
|
|
19
|
+
typeof value === 'string' ||
|
|
20
|
+
value instanceof URLSearchParams ||
|
|
21
|
+
(isObject(value) && Object.values(value).every(isScalar))
|
|
22
|
+
)
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
const requestParametersInput = {
|
|
26
|
+
kind: 'custom',
|
|
27
|
+
accepts: isRequestParameters,
|
|
28
|
+
read: readParameters,
|
|
29
|
+
input: unionInput(
|
|
30
|
+
stringInput,
|
|
31
|
+
mapInput(stringInput, unionInput(stringInput, numberInput)),
|
|
32
|
+
arrayInput(arrayInput(stringInput)),
|
|
33
|
+
),
|
|
34
|
+
} satisfies InputSpec<RequestParameters>
|
|
35
|
+
|
|
36
|
+
const postSchema = {
|
|
37
|
+
kind: 'object',
|
|
38
|
+
fields: {
|
|
39
|
+
url: required(stringInput),
|
|
40
|
+
body: required(requestParametersInput),
|
|
41
|
+
},
|
|
42
|
+
} satisfies InputSpec<Parameters<typeof post>[1]>
|
|
43
|
+
|
|
44
|
+
export const postCommand: NetworkCommand = plainCommand('http', 'post', postSchema, post)
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { publicBanList } from '@senators/bifrost'
|
|
2
|
+
|
|
3
|
+
import { observedCommand } from '../../catalog.ts'
|
|
4
|
+
import { numberInput, optional, stringInput } from '../../input/spec.ts'
|
|
5
|
+
import type { InputSpec } from '../../input/spec.ts'
|
|
6
|
+
import type { NetworkCommand } from '../../types.ts'
|
|
7
|
+
|
|
8
|
+
const publicBanListSchema = {
|
|
9
|
+
kind: 'object',
|
|
10
|
+
fields: {
|
|
11
|
+
language: optional(stringInput),
|
|
12
|
+
page: optional(numberInput),
|
|
13
|
+
},
|
|
14
|
+
} satisfies InputSpec<Parameters<typeof publicBanList>[1]>
|
|
15
|
+
|
|
16
|
+
export const publicBanListCommand: NetworkCommand = observedCommand(
|
|
17
|
+
'public',
|
|
18
|
+
'publicBanList',
|
|
19
|
+
publicBanListSchema,
|
|
20
|
+
publicBanList,
|
|
21
|
+
)
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { publicBattleHall } from '@senators/bifrost'
|
|
2
|
+
|
|
3
|
+
import { observedCommand } from '../../catalog.ts'
|
|
4
|
+
import { optional, stringInput } from '../../input/spec.ts'
|
|
5
|
+
import type { InputSpec } from '../../input/spec.ts'
|
|
6
|
+
import type { NetworkCommand } from '../../types.ts'
|
|
7
|
+
|
|
8
|
+
const publicBattleHallSchema = {
|
|
9
|
+
kind: 'object',
|
|
10
|
+
fields: {
|
|
11
|
+
language: optional(stringInput),
|
|
12
|
+
},
|
|
13
|
+
} satisfies InputSpec<Parameters<typeof publicBattleHall>[1]>
|
|
14
|
+
|
|
15
|
+
export const publicBattleHallCommand: NetworkCommand = observedCommand(
|
|
16
|
+
'public',
|
|
17
|
+
'publicBattleHall',
|
|
18
|
+
publicBattleHallSchema,
|
|
19
|
+
publicBattleHall,
|
|
20
|
+
)
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { publicBattleReport } from '@senators/bifrost'
|
|
2
|
+
|
|
3
|
+
import { observedCommand } from '../../catalog.ts'
|
|
4
|
+
import { required, stringInput } from '../../input/spec.ts'
|
|
5
|
+
import type { InputSpec } from '../../input/spec.ts'
|
|
6
|
+
import type { NetworkCommand } from '../../types.ts'
|
|
7
|
+
|
|
8
|
+
const publicBattleReportSchema = {
|
|
9
|
+
kind: 'object',
|
|
10
|
+
fields: {
|
|
11
|
+
reportId: required(stringInput),
|
|
12
|
+
},
|
|
13
|
+
} satisfies InputSpec<Parameters<typeof publicBattleReport>[1]>
|
|
14
|
+
|
|
15
|
+
export const publicBattleReportCommand: NetworkCommand = observedCommand(
|
|
16
|
+
'public',
|
|
17
|
+
'publicBattleReport',
|
|
18
|
+
publicBattleReportSchema,
|
|
19
|
+
publicBattleReport,
|
|
20
|
+
)
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { publicBoard } from '@senators/bifrost'
|
|
2
|
+
|
|
3
|
+
import { observedCommand } from '../../catalog.ts'
|
|
4
|
+
import { optional, stringInput } from '../../input/spec.ts'
|
|
5
|
+
import type { InputSpec } from '../../input/spec.ts'
|
|
6
|
+
import type { NetworkCommand } from '../../types.ts'
|
|
7
|
+
|
|
8
|
+
const publicBoardSchema = {
|
|
9
|
+
kind: 'object',
|
|
10
|
+
fields: {
|
|
11
|
+
language: optional(stringInput),
|
|
12
|
+
},
|
|
13
|
+
} satisfies InputSpec<Parameters<typeof publicBoard>[1]>
|
|
14
|
+
|
|
15
|
+
export const publicBoardCommand: NetworkCommand = observedCommand(
|
|
16
|
+
'public',
|
|
17
|
+
'publicBoard',
|
|
18
|
+
publicBoardSchema,
|
|
19
|
+
publicBoard,
|
|
20
|
+
)
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { publicDisclaimer } from '@senators/bifrost'
|
|
2
|
+
|
|
3
|
+
import { observedCommand } from '../../catalog.ts'
|
|
4
|
+
import { optional, stringInput } from '../../input/spec.ts'
|
|
5
|
+
import type { InputSpec } from '../../input/spec.ts'
|
|
6
|
+
import type { NetworkCommand } from '../../types.ts'
|
|
7
|
+
|
|
8
|
+
const publicDisclaimerSchema = {
|
|
9
|
+
kind: 'object',
|
|
10
|
+
fields: {
|
|
11
|
+
language: optional(stringInput),
|
|
12
|
+
},
|
|
13
|
+
} satisfies InputSpec<Parameters<typeof publicDisclaimer>[1]>
|
|
14
|
+
|
|
15
|
+
export const publicDisclaimerCommand: NetworkCommand = observedCommand(
|
|
16
|
+
'public',
|
|
17
|
+
'publicDisclaimer',
|
|
18
|
+
publicDisclaimerSchema,
|
|
19
|
+
publicDisclaimer,
|
|
20
|
+
)
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { publicExternalAuth } from '@senators/bifrost'
|
|
2
|
+
|
|
3
|
+
import { observedCommand } from '../../catalog.ts'
|
|
4
|
+
import { publicExternalAuthInput } from '../../input/public/externalAuth.ts'
|
|
5
|
+
import type { InputSpec } from '../../input/spec.ts'
|
|
6
|
+
import type { NetworkCommand } from '../../types.ts'
|
|
7
|
+
|
|
8
|
+
const publicExternalAuthSchema = publicExternalAuthInput satisfies InputSpec<
|
|
9
|
+
Parameters<typeof publicExternalAuth>[1]
|
|
10
|
+
>
|
|
11
|
+
|
|
12
|
+
export const publicExternalAuthCommand: NetworkCommand = observedCommand(
|
|
13
|
+
'public',
|
|
14
|
+
'publicExternalAuth',
|
|
15
|
+
publicExternalAuthSchema,
|
|
16
|
+
publicExternalAuth,
|
|
17
|
+
)
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { publicIndex } from '@senators/bifrost'
|
|
2
|
+
|
|
3
|
+
import { observedCommand } from '../../catalog.ts'
|
|
4
|
+
import { numberInput, optional, stringInput } from '../../input/spec.ts'
|
|
5
|
+
import type { InputSpec } from '../../input/spec.ts'
|
|
6
|
+
import type { NetworkCommand } from '../../types.ts'
|
|
7
|
+
|
|
8
|
+
const publicIndexSchema = {
|
|
9
|
+
kind: 'object',
|
|
10
|
+
fields: {
|
|
11
|
+
language: optional(stringInput),
|
|
12
|
+
errorCode: optional(numberInput),
|
|
13
|
+
referralId: optional(numberInput),
|
|
14
|
+
},
|
|
15
|
+
} satisfies InputSpec<Parameters<typeof publicIndex>[1]>
|
|
16
|
+
|
|
17
|
+
export const publicIndexCommand: NetworkCommand = observedCommand(
|
|
18
|
+
'public',
|
|
19
|
+
'publicIndex',
|
|
20
|
+
publicIndexSchema,
|
|
21
|
+
publicIndex,
|
|
22
|
+
)
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { publicLogin } from '@senators/bifrost'
|
|
2
|
+
|
|
3
|
+
import { observedCommand } from '../../catalog.ts'
|
|
4
|
+
import { numberInput, optional, required, stringInput } from '../../input/spec.ts'
|
|
5
|
+
import type { InputSpec } from '../../input/spec.ts'
|
|
6
|
+
import type { NetworkCommand } from '../../types.ts'
|
|
7
|
+
|
|
8
|
+
const publicLoginSchema = {
|
|
9
|
+
kind: 'object',
|
|
10
|
+
fields: {
|
|
11
|
+
language: optional(stringInput),
|
|
12
|
+
password: required(stringInput),
|
|
13
|
+
username: required(stringInput),
|
|
14
|
+
universe: optional(numberInput),
|
|
15
|
+
},
|
|
16
|
+
} satisfies InputSpec<Parameters<typeof publicLogin>[1]>
|
|
17
|
+
|
|
18
|
+
export const publicLoginCommand: NetworkCommand = observedCommand<
|
|
19
|
+
Parameters<typeof publicLogin>[1]
|
|
20
|
+
>('public', 'publicLogin', publicLoginSchema, publicLogin)
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
import {
|
|
2
|
+
publicLostPassword,
|
|
3
|
+
publicLostPasswordNew,
|
|
4
|
+
publicLostPasswordSend,
|
|
5
|
+
} from '@senators/bifrost'
|
|
6
|
+
|
|
7
|
+
import { observedCommand } from '../../catalog.ts'
|
|
8
|
+
import { numberInput, optional, required, stringInput } from '../../input/spec.ts'
|
|
9
|
+
import type { InputSpec } from '../../input/spec.ts'
|
|
10
|
+
import type { NetworkCommand } from '../../types.ts'
|
|
11
|
+
|
|
12
|
+
const publicLostPasswordSchema = {
|
|
13
|
+
kind: 'object',
|
|
14
|
+
fields: {
|
|
15
|
+
language: optional(stringInput),
|
|
16
|
+
},
|
|
17
|
+
} satisfies InputSpec<Parameters<typeof publicLostPassword>[1]>
|
|
18
|
+
|
|
19
|
+
const publicLostPasswordNewSchema = {
|
|
20
|
+
kind: 'object',
|
|
21
|
+
fields: {
|
|
22
|
+
key: required(stringInput),
|
|
23
|
+
language: optional(stringInput),
|
|
24
|
+
playerId: required(numberInput),
|
|
25
|
+
},
|
|
26
|
+
} satisfies InputSpec<Parameters<typeof publicLostPasswordNew>[1]>
|
|
27
|
+
|
|
28
|
+
const publicLostPasswordSendSchema = {
|
|
29
|
+
kind: 'object',
|
|
30
|
+
fields: {
|
|
31
|
+
captcha: optional(stringInput),
|
|
32
|
+
language: optional(stringInput),
|
|
33
|
+
mail: required(stringInput),
|
|
34
|
+
username: required(stringInput),
|
|
35
|
+
},
|
|
36
|
+
} satisfies InputSpec<Parameters<typeof publicLostPasswordSend>[1]>
|
|
37
|
+
|
|
38
|
+
export const publicLostPasswordCommand: NetworkCommand = observedCommand(
|
|
39
|
+
'public',
|
|
40
|
+
'publicLostPassword',
|
|
41
|
+
publicLostPasswordSchema,
|
|
42
|
+
publicLostPassword,
|
|
43
|
+
)
|
|
44
|
+
|
|
45
|
+
export const publicLostPasswordNewCommand: NetworkCommand = observedCommand(
|
|
46
|
+
'public',
|
|
47
|
+
'publicLostPasswordNew',
|
|
48
|
+
publicLostPasswordNewSchema,
|
|
49
|
+
publicLostPasswordNew,
|
|
50
|
+
)
|
|
51
|
+
|
|
52
|
+
export const publicLostPasswordSendCommand: NetworkCommand = observedCommand(
|
|
53
|
+
'public',
|
|
54
|
+
'publicLostPasswordSend',
|
|
55
|
+
publicLostPasswordSendSchema,
|
|
56
|
+
publicLostPasswordSend,
|
|
57
|
+
)
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { publicNews } from '@senators/bifrost'
|
|
2
|
+
|
|
3
|
+
import { observedCommand } from '../../catalog.ts'
|
|
4
|
+
import { optional, stringInput } from '../../input/spec.ts'
|
|
5
|
+
import type { InputSpec } from '../../input/spec.ts'
|
|
6
|
+
import type { NetworkCommand } from '../../types.ts'
|
|
7
|
+
|
|
8
|
+
const publicNewsSchema = {
|
|
9
|
+
kind: 'object',
|
|
10
|
+
fields: {
|
|
11
|
+
language: optional(stringInput),
|
|
12
|
+
},
|
|
13
|
+
} satisfies InputSpec<Parameters<typeof publicNews>[1]>
|
|
14
|
+
|
|
15
|
+
export const publicNewsCommand: NetworkCommand = observedCommand(
|
|
16
|
+
'public',
|
|
17
|
+
'publicNews',
|
|
18
|
+
publicNewsSchema,
|
|
19
|
+
publicNews,
|
|
20
|
+
)
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
import { publicRegister, publicRegisterSend } from '@senators/bifrost'
|
|
2
|
+
|
|
3
|
+
import { observedCommand } from '../../catalog.ts'
|
|
4
|
+
import { publicExternalAuthIdentityInput } from '../../input/public/register.ts'
|
|
5
|
+
import { booleanInput, numberInput, optional, required, stringInput } from '../../input/spec.ts'
|
|
6
|
+
import type { InputSpec } from '../../input/spec.ts'
|
|
7
|
+
import type { NetworkCommand } from '../../types.ts'
|
|
8
|
+
|
|
9
|
+
const publicRegisterSchema = {
|
|
10
|
+
kind: 'object',
|
|
11
|
+
fields: {
|
|
12
|
+
language: optional(stringInput),
|
|
13
|
+
externalAuth: optional(publicExternalAuthIdentityInput),
|
|
14
|
+
referralId: optional(numberInput),
|
|
15
|
+
},
|
|
16
|
+
} satisfies InputSpec<Parameters<typeof publicRegister>[1]>
|
|
17
|
+
|
|
18
|
+
const publicRegisterSendSchema = {
|
|
19
|
+
kind: 'object',
|
|
20
|
+
fields: {
|
|
21
|
+
captcha: optional(stringInput),
|
|
22
|
+
email: required(stringInput),
|
|
23
|
+
emailReplay: required(stringInput),
|
|
24
|
+
externalAuth: optional(publicExternalAuthIdentityInput),
|
|
25
|
+
language: optional(stringInput),
|
|
26
|
+
password: required(stringInput),
|
|
27
|
+
passwordReplay: required(stringInput),
|
|
28
|
+
referralId: optional(numberInput),
|
|
29
|
+
rules: required(booleanInput),
|
|
30
|
+
username: required(stringInput),
|
|
31
|
+
},
|
|
32
|
+
} satisfies InputSpec<Parameters<typeof publicRegisterSend>[1]>
|
|
33
|
+
|
|
34
|
+
export const publicRegisterCommand: NetworkCommand = observedCommand(
|
|
35
|
+
'public',
|
|
36
|
+
'publicRegister',
|
|
37
|
+
publicRegisterSchema,
|
|
38
|
+
publicRegister,
|
|
39
|
+
)
|
|
40
|
+
|
|
41
|
+
export const publicRegisterSendCommand: NetworkCommand = observedCommand(
|
|
42
|
+
'public',
|
|
43
|
+
'publicRegisterSend',
|
|
44
|
+
publicRegisterSendSchema,
|
|
45
|
+
publicRegisterSend,
|
|
46
|
+
)
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { publicRules } from '@senators/bifrost'
|
|
2
|
+
|
|
3
|
+
import { observedCommand } from '../../catalog.ts'
|
|
4
|
+
import { optional, stringInput } from '../../input/spec.ts'
|
|
5
|
+
import type { InputSpec } from '../../input/spec.ts'
|
|
6
|
+
import type { NetworkCommand } from '../../types.ts'
|
|
7
|
+
|
|
8
|
+
const publicRulesSchema = {
|
|
9
|
+
kind: 'object',
|
|
10
|
+
fields: {
|
|
11
|
+
language: optional(stringInput),
|
|
12
|
+
},
|
|
13
|
+
} satisfies InputSpec<Parameters<typeof publicRules>[1]>
|
|
14
|
+
|
|
15
|
+
export const publicRulesCommand: NetworkCommand = observedCommand(
|
|
16
|
+
'public',
|
|
17
|
+
'publicRules',
|
|
18
|
+
publicRulesSchema,
|
|
19
|
+
publicRules,
|
|
20
|
+
)
|