@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
package/src/help.ts
ADDED
|
@@ -0,0 +1,203 @@
|
|
|
1
|
+
import { COMPLETION_SHELLS } from './completion.ts'
|
|
2
|
+
import { LOCALE_MODES, messages } from './i18n.ts'
|
|
3
|
+
import { inputLabels, inputOptions, PATH_SLOTS } from './input/paths.ts'
|
|
4
|
+
import type { InputNode } from './input/spec.ts'
|
|
5
|
+
import type { HelpPart, TextRole } from './presentation.ts'
|
|
6
|
+
import { PRESENTATION_MODES } from './presentation.ts'
|
|
7
|
+
import { commands } from './registry.ts'
|
|
8
|
+
import { UsageError } from './result.ts'
|
|
9
|
+
import type { Command, Primitive } from './types.ts'
|
|
10
|
+
|
|
11
|
+
function token(role: TextRole, text: string): HelpPart {
|
|
12
|
+
return { role, text }
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
function alternatives(parts: readonly HelpPart[]): HelpPart[] {
|
|
16
|
+
return parts.flatMap((part, index) => (index === 0 ? [part] : ['|', part]))
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
function choices(values: readonly Primitive[]): HelpPart[] {
|
|
20
|
+
return alternatives(values.map((value) => ({ value })))
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
function heading(text: string): HelpPart[] {
|
|
24
|
+
return [token('emphasis', text), ':']
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
/**
|
|
28
|
+
* Generated path slots are placeholders; the surrounding segments are literal option names.
|
|
29
|
+
*
|
|
30
|
+
* 生成的路径槽位是占位符,周围片段是字面参数名。
|
|
31
|
+
*/
|
|
32
|
+
function option(name: string): HelpPart[] {
|
|
33
|
+
return name
|
|
34
|
+
.split(new RegExp(`(${PATH_SLOTS.join('|')})`, 'u'))
|
|
35
|
+
.flatMap((part) =>
|
|
36
|
+
PATH_SLOTS.includes(part)
|
|
37
|
+
? ['<', token('type', part.slice(1, -1)), '>']
|
|
38
|
+
: [token('identifier', part)],
|
|
39
|
+
)
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
function inputTypes(schema: InputNode): HelpPart[] {
|
|
43
|
+
const labels = new Map<string, HelpPart>()
|
|
44
|
+
for (const label of inputLabels(schema)) {
|
|
45
|
+
const text = label.kind === 'type' ? label.text : String(label.value)
|
|
46
|
+
if (!labels.has(text))
|
|
47
|
+
labels.set(text, label.kind === 'type' ? token('type', text) : { value: label.value })
|
|
48
|
+
}
|
|
49
|
+
return alternatives([...labels.values()])
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
/**
|
|
53
|
+
* Stack signatures and details so translated text needs no terminal-width padding.
|
|
54
|
+
*
|
|
55
|
+
* 参数签名与说明分行展示,翻译文本无需按终端字符宽度填充空格。
|
|
56
|
+
*/
|
|
57
|
+
function entry(signature: readonly HelpPart[], description: readonly HelpPart[]): HelpPart[] {
|
|
58
|
+
return [' ', ...signature, '\n ', ...description, '\n']
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
function sharedOptions(): HelpPart[] {
|
|
62
|
+
return [
|
|
63
|
+
...heading(messages().help.sharedOptions),
|
|
64
|
+
' ',
|
|
65
|
+
token('emphasis', 'bifrost'),
|
|
66
|
+
' ',
|
|
67
|
+
...option('--help'),
|
|
68
|
+
'\n',
|
|
69
|
+
]
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
function childCommands(name: string): string[] {
|
|
73
|
+
const prefix = name === '' ? '' : name + ' '
|
|
74
|
+
const paths = [...commands.map((command) => command.name), 'completion']
|
|
75
|
+
return [
|
|
76
|
+
...new Set(
|
|
77
|
+
paths
|
|
78
|
+
.filter((path) => path.startsWith(prefix))
|
|
79
|
+
.map((path) => path.slice(prefix.length).split(' ')[0]!),
|
|
80
|
+
),
|
|
81
|
+
].toSorted()
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
export function help(words: readonly string[], command?: Command): HelpPart[] {
|
|
85
|
+
const catalog = messages()
|
|
86
|
+
const label = catalog.help
|
|
87
|
+
const name = command?.name ?? words.join(' ')
|
|
88
|
+
const children = childCommands(name)
|
|
89
|
+
if (name !== '' && command === undefined && children.length === 0)
|
|
90
|
+
throw new UsageError(catalog.diagnostics.unknownCommand(name))
|
|
91
|
+
const path = name === '' ? 'bifrost' : `bifrost ${name}`
|
|
92
|
+
const parts: HelpPart[] = [
|
|
93
|
+
...(name === '' ? [token('emphasis', label.title), '\n'] : []),
|
|
94
|
+
...heading(label.usage),
|
|
95
|
+
' ',
|
|
96
|
+
token('emphasis', path),
|
|
97
|
+
...(children.length === 0 ? [] : [' <', token('type', label.command), '>']),
|
|
98
|
+
' [',
|
|
99
|
+
token('type', label.option),
|
|
100
|
+
']\n',
|
|
101
|
+
...(command === undefined ? [] : [catalog.commands[command.method], '\n']),
|
|
102
|
+
'\n',
|
|
103
|
+
]
|
|
104
|
+
if (command !== undefined) {
|
|
105
|
+
const fields = inputOptions(command.input)
|
|
106
|
+
if (fields.length > 0) {
|
|
107
|
+
parts.push(...heading(label.input), '\n')
|
|
108
|
+
for (const field of fields) {
|
|
109
|
+
const requirement = field.conditional
|
|
110
|
+
? label.conditional
|
|
111
|
+
: field.optional
|
|
112
|
+
? label.optional
|
|
113
|
+
: label.required
|
|
114
|
+
const description = field.schema.description?.()
|
|
115
|
+
parts.push(
|
|
116
|
+
...entry(
|
|
117
|
+
[...option('--' + field.name), ' ', ...inputTypes(field.schema)],
|
|
118
|
+
[
|
|
119
|
+
'(',
|
|
120
|
+
token(field.conditional || !field.optional ? 'required' : 'muted', requirement),
|
|
121
|
+
')',
|
|
122
|
+
...(description === undefined ? [] : [' ', description]),
|
|
123
|
+
],
|
|
124
|
+
),
|
|
125
|
+
)
|
|
126
|
+
}
|
|
127
|
+
parts.push('\n')
|
|
128
|
+
}
|
|
129
|
+
}
|
|
130
|
+
if (children.length > 0)
|
|
131
|
+
parts.push(
|
|
132
|
+
...heading(label.commands),
|
|
133
|
+
'\n',
|
|
134
|
+
...children.flatMap((child) => [' ', token('emphasis', child), '\n']),
|
|
135
|
+
'\n',
|
|
136
|
+
)
|
|
137
|
+
if (name === '') {
|
|
138
|
+
const jsonSource = alternatives([
|
|
139
|
+
token('type', 'JSON'),
|
|
140
|
+
token('type', '@' + label.file),
|
|
141
|
+
{ value: '-' },
|
|
142
|
+
])
|
|
143
|
+
const shared = (flag: string, values: readonly HelpPart[], description: string): HelpPart[] =>
|
|
144
|
+
entry([...option(flag), ...(values.length === 0 ? [] : [' ', ...values])], [description])
|
|
145
|
+
parts.push(
|
|
146
|
+
...heading(label.options),
|
|
147
|
+
'\n',
|
|
148
|
+
...shared('--input', jsonSource, label.inputDescription),
|
|
149
|
+
...shared('--format', choices(['text', 'json']), label.formatDescription),
|
|
150
|
+
...shared('--color', choices(PRESENTATION_MODES), label.colorDescription),
|
|
151
|
+
...shared('--links', choices(PRESENTATION_MODES), label.linksDescription),
|
|
152
|
+
...shared('--locale', choices(LOCALE_MODES), label.localeDescription),
|
|
153
|
+
...shared(
|
|
154
|
+
'--select',
|
|
155
|
+
[token('type', label.pointer), '|', ...jsonSource],
|
|
156
|
+
label.selectDescription,
|
|
157
|
+
),
|
|
158
|
+
...shared(
|
|
159
|
+
'--output',
|
|
160
|
+
[token('type', label.file), '|', { value: '-' }],
|
|
161
|
+
label.outputDescription,
|
|
162
|
+
),
|
|
163
|
+
...shared('--help', [], label.helpDescription),
|
|
164
|
+
...shared('--version', [], label.versionDescription),
|
|
165
|
+
'\n',
|
|
166
|
+
...heading(label.connection),
|
|
167
|
+
'\n',
|
|
168
|
+
...shared('--session', jsonSource, label.sessionDescription),
|
|
169
|
+
...shared('--base-url', [token('type', 'URL')], label.baseUrlDescription),
|
|
170
|
+
...shared('--universe', [token('type', label.numberType)], label.universeDescription),
|
|
171
|
+
...shared('--session-token', [token('type', label.token)], label.tokenDescription),
|
|
172
|
+
...shared('--auth-username', [token('type', label.user)], label.usernameDescription),
|
|
173
|
+
...shared('--auth-password', [token('type', label.password)], label.passwordDescription),
|
|
174
|
+
...shared('--auth-language', [token('type', label.code)], label.languageDescription),
|
|
175
|
+
...shared('--forwarded-ip', [token('type', 'IP')], label.forwardedIpDescription),
|
|
176
|
+
...shared('--auto-login', [], label.autoLoginDescription),
|
|
177
|
+
...shared('--no-auto-login', [], label.noAutoLoginDescription),
|
|
178
|
+
'\n',
|
|
179
|
+
...heading(label.docs),
|
|
180
|
+
' ',
|
|
181
|
+
token('link', label.docsUrl),
|
|
182
|
+
'\n\n',
|
|
183
|
+
)
|
|
184
|
+
} else parts.push(...sharedOptions())
|
|
185
|
+
return parts
|
|
186
|
+
}
|
|
187
|
+
|
|
188
|
+
export function completionHelp(): HelpPart[] {
|
|
189
|
+
const label = messages().help
|
|
190
|
+
return [
|
|
191
|
+
...heading(label.usage),
|
|
192
|
+
' ',
|
|
193
|
+
token('emphasis', 'bifrost completion'),
|
|
194
|
+
' <',
|
|
195
|
+
...alternatives(COMPLETION_SHELLS.map((shell) => token('emphasis', shell))),
|
|
196
|
+
'> [',
|
|
197
|
+
...option('--enhance'),
|
|
198
|
+
']\n',
|
|
199
|
+
...label.completion(token('identifier', '--enhance')),
|
|
200
|
+
'\n\n',
|
|
201
|
+
...sharedOptions(),
|
|
202
|
+
]
|
|
203
|
+
}
|
package/src/i18n.ts
ADDED
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
import { AsyncLocalStorage } from 'node:async_hooks'
|
|
2
|
+
|
|
3
|
+
import { enUS } from './locales/en-US.ts'
|
|
4
|
+
import type { Messages } from './locales/en-US.ts'
|
|
5
|
+
import { zhCN } from './locales/zh-CN.ts'
|
|
6
|
+
|
|
7
|
+
export type Locale = 'en-US' | 'zh-CN'
|
|
8
|
+
export type LocaleMode = 'auto' | Locale
|
|
9
|
+
export const LOCALE_MODES: readonly LocaleMode[] = ['auto', 'en-US', 'zh-CN']
|
|
10
|
+
|
|
11
|
+
const catalogs: Readonly<Record<Locale, Messages>> = { 'en-US': enUS, 'zh-CN': zhCN }
|
|
12
|
+
const context = new AsyncLocalStorage<Locale>()
|
|
13
|
+
|
|
14
|
+
/**
|
|
15
|
+
* An invocation owns its language across asynchronous work; concurrent calls stay independent.
|
|
16
|
+
*
|
|
17
|
+
* 一次调用在异步处理期间持有自身语言,并发调用互不影响。
|
|
18
|
+
*/
|
|
19
|
+
export function withLocale<Result>(locale: Locale, operation: () => Result): Result {
|
|
20
|
+
return context.run(locale, operation)
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
export function messages(): Messages {
|
|
24
|
+
return catalogs[context.getStore() ?? 'en-US']
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
/**
|
|
28
|
+
* Match supported regional languages; other Chinese regions do not imply Simplified Chinese.
|
|
29
|
+
*
|
|
30
|
+
* 按支持的地区语言匹配;其他中文地区不自动视为简体中文。
|
|
31
|
+
*/
|
|
32
|
+
export function detectLocale(
|
|
33
|
+
environment: Readonly<Record<string, string | undefined>>,
|
|
34
|
+
systemLocale: string,
|
|
35
|
+
): Locale {
|
|
36
|
+
const preferred = [environment.LC_ALL, environment.LC_MESSAGES, environment.LANG].find(
|
|
37
|
+
(value) => value !== undefined && value.trim() !== '',
|
|
38
|
+
)
|
|
39
|
+
const value = (preferred ?? systemLocale).trim().split(/[.@]/u, 1)[0]!.replaceAll('_', '-')
|
|
40
|
+
try {
|
|
41
|
+
return new Intl.Locale(value).baseName === 'zh-CN' ? 'zh-CN' : 'en-US'
|
|
42
|
+
} catch {
|
|
43
|
+
return 'en-US'
|
|
44
|
+
}
|
|
45
|
+
}
|
package/src/index.ts
ADDED
|
@@ -0,0 +1,156 @@
|
|
|
1
|
+
import type { AdminAccountEditorSection, AdminAccountEditorSubmit } from '@senators/bifrost'
|
|
2
|
+
|
|
3
|
+
import { messages } from '../../i18n.ts'
|
|
4
|
+
import { matchesInput } from '../parse.ts'
|
|
5
|
+
import { enumeration, numberInput, optional, required, stringInput, unionInput } from '../spec.ts'
|
|
6
|
+
import type { InputNode, InputSpec } from '../spec.ts'
|
|
7
|
+
import { adminAccountEditorFields } from './fields.ts'
|
|
8
|
+
import { adminRecordFields } from './records.ts'
|
|
9
|
+
|
|
10
|
+
export const adminAccountEditorSectionInput: InputSpec<AdminAccountEditorSection> = {
|
|
11
|
+
kind: 'custom',
|
|
12
|
+
input: enumeration(Object.keys(adminAccountEditorFields)),
|
|
13
|
+
accepts(value): value is AdminAccountEditorSection {
|
|
14
|
+
return typeof value === 'string' && Object.hasOwn(adminAccountEditorFields, value)
|
|
15
|
+
},
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
const scalarInput = unionInput(stringInput, numberInput)
|
|
19
|
+
|
|
20
|
+
type AccountEditorValues<Section extends AdminAccountEditorSection> = Extract<
|
|
21
|
+
AdminAccountEditorSubmit,
|
|
22
|
+
{ section: Section }
|
|
23
|
+
>['values']
|
|
24
|
+
|
|
25
|
+
function accountEditorValuesInput<Section extends AdminAccountEditorSection>(
|
|
26
|
+
section: Section,
|
|
27
|
+
): {
|
|
28
|
+
kind: 'custom'
|
|
29
|
+
input: InputNode
|
|
30
|
+
output: InputNode
|
|
31
|
+
accepts: (value: unknown) => value is AccountEditorValues<Section>
|
|
32
|
+
} {
|
|
33
|
+
const fields = adminRecordFields(adminAccountEditorFields[section], scalarInput, true)
|
|
34
|
+
let input: InputNode
|
|
35
|
+
if (section === 'resources')
|
|
36
|
+
input = {
|
|
37
|
+
kind: 'object',
|
|
38
|
+
fields: {
|
|
39
|
+
...fields,
|
|
40
|
+
id: optional(numberInput),
|
|
41
|
+
id_dark: optional({
|
|
42
|
+
...numberInput,
|
|
43
|
+
description: () => messages().help.accountEditorIds,
|
|
44
|
+
}),
|
|
45
|
+
},
|
|
46
|
+
check: (value) => value.id !== undefined || value.id_dark !== undefined,
|
|
47
|
+
}
|
|
48
|
+
else if (section === 'personal')
|
|
49
|
+
input = unionInput(
|
|
50
|
+
{
|
|
51
|
+
kind: 'object',
|
|
52
|
+
fields: { ...fields, id: required(numberInput), vacation: required(enumeration(['no'])) },
|
|
53
|
+
},
|
|
54
|
+
{
|
|
55
|
+
kind: 'object',
|
|
56
|
+
fields: {
|
|
57
|
+
...fields,
|
|
58
|
+
id: required(numberInput),
|
|
59
|
+
vacation: required(enumeration(['yes'])),
|
|
60
|
+
d: required(numberInput),
|
|
61
|
+
h: required(numberInput),
|
|
62
|
+
m: required(numberInput),
|
|
63
|
+
s: required(numberInput),
|
|
64
|
+
},
|
|
65
|
+
},
|
|
66
|
+
)
|
|
67
|
+
else
|
|
68
|
+
input = {
|
|
69
|
+
kind: 'object',
|
|
70
|
+
fields: {
|
|
71
|
+
...fields,
|
|
72
|
+
id: required(numberInput),
|
|
73
|
+
...(section === 'alliances' ? { changeleader: required(numberInput) } : {}),
|
|
74
|
+
},
|
|
75
|
+
}
|
|
76
|
+
return {
|
|
77
|
+
kind: 'custom',
|
|
78
|
+
input,
|
|
79
|
+
output: input,
|
|
80
|
+
accepts(value): value is AccountEditorValues<Section> {
|
|
81
|
+
return matchesInput(input, value)
|
|
82
|
+
},
|
|
83
|
+
}
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
export const adminAccountEditorSubmitInput: InputSpec<AdminAccountEditorSubmit> = unionInput(
|
|
87
|
+
{
|
|
88
|
+
kind: 'object',
|
|
89
|
+
fields: {
|
|
90
|
+
section: required(enumeration(['alliances'])),
|
|
91
|
+
values: required(accountEditorValuesInput<'alliances'>('alliances')),
|
|
92
|
+
},
|
|
93
|
+
} satisfies InputSpec<Extract<AdminAccountEditorSubmit, { section: 'alliances' }>>,
|
|
94
|
+
{
|
|
95
|
+
kind: 'object',
|
|
96
|
+
fields: {
|
|
97
|
+
section: required(enumeration(['personal'])),
|
|
98
|
+
values: required(accountEditorValuesInput<'personal'>('personal')),
|
|
99
|
+
},
|
|
100
|
+
} satisfies InputSpec<Extract<AdminAccountEditorSubmit, { section: 'personal' }>>,
|
|
101
|
+
{
|
|
102
|
+
kind: 'object',
|
|
103
|
+
fields: {
|
|
104
|
+
section: required(enumeration(['planets'])),
|
|
105
|
+
values: required(accountEditorValuesInput<'planets'>('planets')),
|
|
106
|
+
},
|
|
107
|
+
} satisfies InputSpec<Extract<AdminAccountEditorSubmit, { section: 'planets' }>>,
|
|
108
|
+
{
|
|
109
|
+
kind: 'object',
|
|
110
|
+
fields: {
|
|
111
|
+
section: required(enumeration(['resources'])),
|
|
112
|
+
values: required(accountEditorValuesInput<'resources'>('resources')),
|
|
113
|
+
submit: required(enumeration(['add', 'delete'])),
|
|
114
|
+
},
|
|
115
|
+
} satisfies InputSpec<Extract<AdminAccountEditorSubmit, { section: 'resources' }>>,
|
|
116
|
+
{
|
|
117
|
+
kind: 'object',
|
|
118
|
+
fields: {
|
|
119
|
+
section: required(enumeration(['buildings'])),
|
|
120
|
+
values: required(accountEditorValuesInput<'buildings'>('buildings')),
|
|
121
|
+
submit: required(enumeration(['add', 'delete'])),
|
|
122
|
+
},
|
|
123
|
+
} satisfies InputSpec<Extract<AdminAccountEditorSubmit, { section: 'buildings' }>>,
|
|
124
|
+
{
|
|
125
|
+
kind: 'object',
|
|
126
|
+
fields: {
|
|
127
|
+
section: required(enumeration(['defenses'])),
|
|
128
|
+
values: required(accountEditorValuesInput<'defenses'>('defenses')),
|
|
129
|
+
submit: required(enumeration(['add', 'delete'])),
|
|
130
|
+
},
|
|
131
|
+
} satisfies InputSpec<Extract<AdminAccountEditorSubmit, { section: 'defenses' }>>,
|
|
132
|
+
{
|
|
133
|
+
kind: 'object',
|
|
134
|
+
fields: {
|
|
135
|
+
section: required(enumeration(['officers'])),
|
|
136
|
+
values: required(accountEditorValuesInput<'officers'>('officers')),
|
|
137
|
+
submit: required(enumeration(['add', 'delete'])),
|
|
138
|
+
},
|
|
139
|
+
} satisfies InputSpec<Extract<AdminAccountEditorSubmit, { section: 'officers' }>>,
|
|
140
|
+
{
|
|
141
|
+
kind: 'object',
|
|
142
|
+
fields: {
|
|
143
|
+
section: required(enumeration(['research'])),
|
|
144
|
+
values: required(accountEditorValuesInput<'research'>('research')),
|
|
145
|
+
submit: required(enumeration(['add', 'delete'])),
|
|
146
|
+
},
|
|
147
|
+
} satisfies InputSpec<Extract<AdminAccountEditorSubmit, { section: 'research' }>>,
|
|
148
|
+
{
|
|
149
|
+
kind: 'object',
|
|
150
|
+
fields: {
|
|
151
|
+
section: required(enumeration(['ships'])),
|
|
152
|
+
values: required(accountEditorValuesInput<'ships'>('ships')),
|
|
153
|
+
submit: required(enumeration(['add', 'delete'])),
|
|
154
|
+
},
|
|
155
|
+
} satisfies InputSpec<Extract<AdminAccountEditorSubmit, { section: 'ships' }>>,
|
|
156
|
+
)
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import type { AdminBanRequest } from '@senators/bifrost'
|
|
2
|
+
|
|
3
|
+
import { booleanInput, numberInput, optional, required, stringInput } from '../spec.ts'
|
|
4
|
+
import type { InputSpec } from '../spec.ts'
|
|
5
|
+
|
|
6
|
+
export const adminBanRequestInput: InputSpec<AdminBanRequest> = {
|
|
7
|
+
kind: 'object',
|
|
8
|
+
fields: {
|
|
9
|
+
username: required(stringInput),
|
|
10
|
+
reason: required(stringInput),
|
|
11
|
+
duration: required({
|
|
12
|
+
kind: 'object',
|
|
13
|
+
fields: {
|
|
14
|
+
days: optional(numberInput),
|
|
15
|
+
hours: optional(numberInput),
|
|
16
|
+
minutes: optional(numberInput),
|
|
17
|
+
seconds: optional(numberInput),
|
|
18
|
+
},
|
|
19
|
+
}),
|
|
20
|
+
permanent: optional(booleanInput),
|
|
21
|
+
vacation: optional(booleanInput),
|
|
22
|
+
},
|
|
23
|
+
}
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import type { AdminMoonDraft, AdminPlanetDraft, AdminUserDraft } from '@senators/bifrost'
|
|
2
|
+
|
|
3
|
+
import { coordinateInput } from '../shared.ts'
|
|
4
|
+
import { numberInput, optional, required, stringInput } from '../spec.ts'
|
|
5
|
+
import type { InputSpec } from '../spec.ts'
|
|
6
|
+
|
|
7
|
+
export const adminMoonDraftInput: InputSpec<AdminMoonDraft> = {
|
|
8
|
+
kind: 'object',
|
|
9
|
+
fields: {
|
|
10
|
+
planetId: required(numberInput),
|
|
11
|
+
name: optional(stringInput),
|
|
12
|
+
diameter: optional(numberInput),
|
|
13
|
+
},
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
export const adminPlanetDraftInput: InputSpec<AdminPlanetDraft> = {
|
|
17
|
+
kind: 'object',
|
|
18
|
+
fields: {
|
|
19
|
+
playerId: required(numberInput),
|
|
20
|
+
coordinate: required(coordinateInput),
|
|
21
|
+
name: optional(stringInput),
|
|
22
|
+
fields: required(numberInput),
|
|
23
|
+
},
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
export const adminUserDraftInput: InputSpec<AdminUserDraft> = {
|
|
27
|
+
kind: 'object',
|
|
28
|
+
fields: {
|
|
29
|
+
name: required(stringInput),
|
|
30
|
+
password: required(stringInput),
|
|
31
|
+
email: required(stringInput),
|
|
32
|
+
level: required(numberInput),
|
|
33
|
+
language: required(stringInput),
|
|
34
|
+
coordinate: required(coordinateInput),
|
|
35
|
+
},
|
|
36
|
+
}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import type { AdminCronjobField, AdminCronjobSchedule } from '@senators/bifrost'
|
|
2
|
+
|
|
3
|
+
import { arrayInput, enumeration, numberInput, required, stringInput, unionInput } from '../spec.ts'
|
|
4
|
+
import type { InputSpec } from '../spec.ts'
|
|
5
|
+
|
|
6
|
+
const adminCronjobFieldInput: InputSpec<AdminCronjobField> = unionInput(
|
|
7
|
+
arrayInput(numberInput),
|
|
8
|
+
enumeration(['*']),
|
|
9
|
+
)
|
|
10
|
+
|
|
11
|
+
export const adminCronjobScheduleInput: InputSpec<AdminCronjobSchedule> = {
|
|
12
|
+
kind: 'object',
|
|
13
|
+
fields: {
|
|
14
|
+
name: required(stringInput),
|
|
15
|
+
className: required(stringInput),
|
|
16
|
+
minutes: required(adminCronjobFieldInput),
|
|
17
|
+
hours: required(adminCronjobFieldInput),
|
|
18
|
+
daysOfMonth: required(adminCronjobFieldInput),
|
|
19
|
+
months: required(adminCronjobFieldInput),
|
|
20
|
+
daysOfWeek: required(adminCronjobFieldInput),
|
|
21
|
+
},
|
|
22
|
+
}
|