@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.
Files changed (403) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +180 -2
  3. package/out/accountEditor-CQB91PVf.js +2 -0
  4. package/out/accountEditor-CQB91PVf.js.map +1 -0
  5. package/out/achievements-Df5qqpYQ.js +2 -0
  6. package/out/achievements-Df5qqpYQ.js.map +1 -0
  7. package/out/active-CnUKpiEo.js +2 -0
  8. package/out/active-CnUKpiEo.js.map +1 -0
  9. package/out/alliance-BsPnhi7w.js +2 -0
  10. package/out/alliance-BsPnhi7w.js.map +1 -0
  11. package/out/allianceAdmin-Bkyl6ev4.js +2 -0
  12. package/out/allianceAdmin-Bkyl6ev4.js.map +1 -0
  13. package/out/arsenal-BMCmAHzv.js +2 -0
  14. package/out/arsenal-BMCmAHzv.js.map +1 -0
  15. package/out/ban-BXNvHPMq.js +2 -0
  16. package/out/ban-BXNvHPMq.js.map +1 -0
  17. package/out/banList-3DbCToEy.js +2 -0
  18. package/out/banList-3DbCToEy.js.map +1 -0
  19. package/out/banList-dT5GF5eO.js +2 -0
  20. package/out/banList-dT5GF5eO.js.map +1 -0
  21. package/out/battleHall-C4BALP6S.js +2 -0
  22. package/out/battleHall-C4BALP6S.js.map +1 -0
  23. package/out/battleHall-P7Co1jS5.js +2 -0
  24. package/out/battleHall-P7Co1jS5.js.map +1 -0
  25. package/out/battleReport-BG0-S-bF.js +2 -0
  26. package/out/battleReport-BG0-S-bF.js.map +1 -0
  27. package/out/battleReport-C3PQTXxc.js +2 -0
  28. package/out/battleReport-C3PQTXxc.js.map +1 -0
  29. package/out/battleSimulator-BOySErLn.js +2 -0
  30. package/out/battleSimulator-BOySErLn.js.map +1 -0
  31. package/out/board-CsNgDx4j.js +2 -0
  32. package/out/board-CsNgDx4j.js.map +1 -0
  33. package/out/board-DSCl8eU8.js +2 -0
  34. package/out/board-DSCl8eU8.js.map +1 -0
  35. package/out/bonusSummary-Dmm646zj.js +2 -0
  36. package/out/bonusSummary-Dmm646zj.js.map +1 -0
  37. package/out/buddyList-B50t-9_g.js +2 -0
  38. package/out/buddyList-B50t-9_g.js.map +1 -0
  39. package/out/buildings-CXrMgFyb.js +2 -0
  40. package/out/buildings-CXrMgFyb.js.map +1 -0
  41. package/out/catalog-DmSXp_YG.js +2 -0
  42. package/out/catalog-DmSXp_YG.js.map +1 -0
  43. package/out/chat-BvtMl-I7.js +2 -0
  44. package/out/chat-BvtMl-I7.js.map +1 -0
  45. package/out/clearCache-79cjREI0.js +2 -0
  46. package/out/clearCache-79cjREI0.js.map +1 -0
  47. package/out/cli.js +3 -0
  48. package/out/cli.js.map +1 -0
  49. package/out/containers-BhguCCkz.js +2 -0
  50. package/out/containers-BhguCCkz.js.map +1 -0
  51. package/out/control-IJRy1LDx.js +2 -0
  52. package/out/control-IJRy1LDx.js.map +1 -0
  53. package/out/create-D-IygCER.js +2 -0
  54. package/out/create-D-IygCER.js.map +1 -0
  55. package/out/createMoon-BMWjdwO0.js +2 -0
  56. package/out/createMoon-BMWjdwO0.js.map +1 -0
  57. package/out/cronjob-CCJKDSuv.js +2 -0
  58. package/out/cronjob-CCJKDSuv.js.map +1 -0
  59. package/out/dailyBonus-2UwWD4D0.js +2 -0
  60. package/out/dailyBonus-2UwWD4D0.js.map +1 -0
  61. package/out/delivery-d8NKP-f1.js +2 -0
  62. package/out/delivery-d8NKP-f1.js.map +1 -0
  63. package/out/disclaimer-BmejHZqk.js +2 -0
  64. package/out/disclaimer-BmejHZqk.js.map +1 -0
  65. package/out/dump--mJa5m3e.js +2 -0
  66. package/out/dump--mJa5m3e.js.map +1 -0
  67. package/out/endpoints-CbZGTbF-.js +2 -0
  68. package/out/endpoints-CbZGTbF-.js.map +1 -0
  69. package/out/externalAuth-Dwl3VAHa.js +2 -0
  70. package/out/externalAuth-Dwl3VAHa.js.map +1 -0
  71. package/out/findDebris-DOMvMC1l.js +2 -0
  72. package/out/findDebris-DOMvMC1l.js.map +1 -0
  73. package/out/fleet-DyITa_Xu.js +2 -0
  74. package/out/fleet-DyITa_Xu.js.map +1 -0
  75. package/out/fleetAjax-BGxyUtdi.js +2 -0
  76. package/out/fleetAjax-BGxyUtdi.js.map +1 -0
  77. package/out/fleetDealer-n6LM_8IT.js +2 -0
  78. package/out/fleetDealer-n6LM_8IT.js.map +1 -0
  79. package/out/fleetMissile-CucQvNmZ.js +2 -0
  80. package/out/fleetMissile-CucQvNmZ.js.map +1 -0
  81. package/out/fleetStep1-wp-NgTsC.js +2 -0
  82. package/out/fleetStep1-wp-NgTsC.js.map +1 -0
  83. package/out/fleetStep2-C-GzHXyn.js +2 -0
  84. package/out/fleetStep2-C-GzHXyn.js.map +1 -0
  85. package/out/fleetStep3-D_fqImWm.js +2 -0
  86. package/out/fleetStep3-D_fqImWm.js.map +1 -0
  87. package/out/fleetTable-BpWLh0R1.js +2 -0
  88. package/out/fleetTable-BpWLh0R1.js.map +1 -0
  89. package/out/flyingFleet-ClIrGPJz.js +2 -0
  90. package/out/flyingFleet-ClIrGPJz.js.map +1 -0
  91. package/out/galaxy-B12wKQUU.js +2 -0
  92. package/out/galaxy-B12wKQUU.js.map +1 -0
  93. package/out/get-Cn2hFvGS.js +2 -0
  94. package/out/get-Cn2hFvGS.js.map +1 -0
  95. package/out/giveaway-CDWEArOF.js +2 -0
  96. package/out/giveaway-CDWEArOF.js.map +1 -0
  97. package/out/growth-C_-C8rLD.js +2 -0
  98. package/out/growth-C_-C8rLD.js.map +1 -0
  99. package/out/index.d.ts +29 -0
  100. package/out/index.d.ts.map +1 -0
  101. package/out/index.js +1 -0
  102. package/out/information-CqfqYCH1.js +2 -0
  103. package/out/information-CqfqYCH1.js.map +1 -0
  104. package/out/information-DK93hgyE.js +2 -0
  105. package/out/information-DK93hgyE.js.map +1 -0
  106. package/out/log-BBE1Jt9i.js +2 -0
  107. package/out/log-BBE1Jt9i.js.map +1 -0
  108. package/out/login--4vqysQx.js +2 -0
  109. package/out/login--4vqysQx.js.map +1 -0
  110. package/out/login-C_DqRApn.js +2 -0
  111. package/out/login-C_DqRApn.js.map +1 -0
  112. package/out/logout-BYnLiMja.js +2 -0
  113. package/out/logout-BYnLiMja.js.map +1 -0
  114. package/out/logout-BsCSXzv8.js +2 -0
  115. package/out/logout-BsCSXzv8.js.map +1 -0
  116. package/out/lostPassword-Pc_1CUBD.js +2 -0
  117. package/out/lostPassword-Pc_1CUBD.js.map +1 -0
  118. package/out/market-DN8cY1tr.js +2 -0
  119. package/out/market-DN8cY1tr.js.map +1 -0
  120. package/out/messageList-k_zW_D0G.js +2 -0
  121. package/out/messageList-k_zW_D0G.js.map +1 -0
  122. package/out/messages-D461yIe6.js +2 -0
  123. package/out/messages-D461yIe6.js.map +1 -0
  124. package/out/missions-5zZtlLIm.js +2 -0
  125. package/out/missions-5zZtlLIm.js.map +1 -0
  126. package/out/module-BEPeTBhK.js +2 -0
  127. package/out/module-BEPeTBhK.js.map +1 -0
  128. package/out/multiIp-CP3lub1T.js +2 -0
  129. package/out/multiIp-CP3lub1T.js.map +1 -0
  130. package/out/new-star-BaVTTcIn.js +2 -0
  131. package/out/new-star-BaVTTcIn.js.map +1 -0
  132. package/out/news-BdDDcd-M.js +2 -0
  133. package/out/news-BdDDcd-M.js.map +1 -0
  134. package/out/news-Dd1C9JDl.js +2 -0
  135. package/out/news-Dd1C9JDl.js.map +1 -0
  136. package/out/notes-DLngBta3.js +2 -0
  137. package/out/notes-DLngBta3.js.map +1 -0
  138. package/out/overview-CzcSTNla.js +2 -0
  139. package/out/overview-CzcSTNla.js.map +1 -0
  140. package/out/overview-wQWIR_CB.js +2 -0
  141. package/out/overview-wQWIR_CB.js.map +1 -0
  142. package/out/password-ZA_1lStC.js +2 -0
  143. package/out/password-ZA_1lStC.js.map +1 -0
  144. package/out/phalanx-DaMaoJCT.js +2 -0
  145. package/out/phalanx-DaMaoJCT.js.map +1 -0
  146. package/out/planet-CecZ2cAZ.js +2 -0
  147. package/out/planet-CecZ2cAZ.js.map +1 -0
  148. package/out/playerCard-BG711xQi.js +2 -0
  149. package/out/playerCard-BG711xQi.js.map +1 -0
  150. package/out/post-C_ywAss7.js +2 -0
  151. package/out/post-C_ywAss7.js.map +1 -0
  152. package/out/production-D8SZfez8.js +2 -0
  153. package/out/production-D8SZfez8.js.map +1 -0
  154. package/out/public-TVVf75qu.js +2 -0
  155. package/out/public-TVVf75qu.js.map +1 -0
  156. package/out/questions-NwzZ5_fL.js +2 -0
  157. package/out/questions-NwzZ5_fL.js.map +1 -0
  158. package/out/quickEditor-DEJQFH0f.js +2 -0
  159. package/out/quickEditor-DEJQFH0f.js.map +1 -0
  160. package/out/records-CDVglYGy.js +2 -0
  161. package/out/records-CDVglYGy.js.map +1 -0
  162. package/out/records-Djjz9kxk.js +2 -0
  163. package/out/records-Djjz9kxk.js.map +1 -0
  164. package/out/reduceFleet-y8p89weR.js +2 -0
  165. package/out/reduceFleet-y8p89weR.js.map +1 -0
  166. package/out/reduceResources-CnGJ9fuf.js +2 -0
  167. package/out/reduceResources-CnGJ9fuf.js.map +1 -0
  168. package/out/refreshStatistics-CjGWyNc_.js +2 -0
  169. package/out/refreshStatistics-CjGWyNc_.js.map +1 -0
  170. package/out/register-4x5hZcWe.js +2 -0
  171. package/out/register-4x5hZcWe.js.map +1 -0
  172. package/out/research-dTK3-tOW.js +2 -0
  173. package/out/research-dTK3-tOW.js.map +1 -0
  174. package/out/reset-CHiMI9rj.js +2 -0
  175. package/out/reset-CHiMI9rj.js.map +1 -0
  176. package/out/resources-CjnevA41.js +2 -0
  177. package/out/resources-CjnevA41.js.map +1 -0
  178. package/out/rights-WPf-j_YF.js +2 -0
  179. package/out/rights-WPf-j_YF.js.map +1 -0
  180. package/out/rules-E29jtQRj.js +2 -0
  181. package/out/rules-E29jtQRj.js.map +1 -0
  182. package/out/runner-C2bQQS2G.js +43 -0
  183. package/out/runner-C2bQQS2G.js.map +1 -0
  184. package/out/scan-RvWZeyyM.js +2 -0
  185. package/out/scan-RvWZeyyM.js.map +1 -0
  186. package/out/screens-CZ4g-KNp.js +2 -0
  187. package/out/screens-CZ4g-KNp.js.map +1 -0
  188. package/out/search-BYvqiUBF.js +2 -0
  189. package/out/search-BYvqiUBF.js.map +1 -0
  190. package/out/search-auPbK2Xc.js +2 -0
  191. package/out/search-auPbK2Xc.js.map +1 -0
  192. package/out/sendMessages-B2Uj3PW4.js +2 -0
  193. package/out/sendMessages-B2Uj3PW4.js.map +1 -0
  194. package/out/settings-DFFa6Ush.js +2 -0
  195. package/out/settings-DFFa6Ush.js.map +1 -0
  196. package/out/settings-Ddez5x9U.js +2 -0
  197. package/out/settings-Ddez5x9U.js.map +1 -0
  198. package/out/shared-DoaW4mlX.js +2 -0
  199. package/out/shared-DoaW4mlX.js.map +1 -0
  200. package/out/shipyard-DXr745hR.js +2 -0
  201. package/out/shipyard-DXr745hR.js.map +1 -0
  202. package/out/shops-CEE02c0g.js +2 -0
  203. package/out/shops-CEE02c0g.js.map +1 -0
  204. package/out/snapshot-CrJ8l50N.js +2 -0
  205. package/out/snapshot-CrJ8l50N.js.map +1 -0
  206. package/out/social-1Gdni-jZ.js +2 -0
  207. package/out/social-1Gdni-jZ.js.map +1 -0
  208. package/out/spec-CrkWB0BN.js +2 -0
  209. package/out/spec-CrkWB0BN.js.map +1 -0
  210. package/out/statistics-zg3aVAvW.js +2 -0
  211. package/out/statistics-zg3aVAvW.js.map +1 -0
  212. package/out/store-dXG7NoB4.js +2 -0
  213. package/out/store-dXG7NoB4.js.map +1 -0
  214. package/out/support-DisUQr57.js +2 -0
  215. package/out/support-DisUQr57.js.map +1 -0
  216. package/out/techtree-Ba3FEH5_.js +2 -0
  217. package/out/techtree-Ba3FEH5_.js.map +1 -0
  218. package/out/ticket-O_8jTKW8.js +2 -0
  219. package/out/ticket-O_8jTKW8.js.map +1 -0
  220. package/out/trader-zFDGaHZ9.js +2 -0
  221. package/out/trader-zFDGaHZ9.js.map +1 -0
  222. package/out/universe-DO32RnLQ.js +2 -0
  223. package/out/universe-DO32RnLQ.js.map +1 -0
  224. package/out/universeSettings-S7enRJR4.js +2 -0
  225. package/out/universeSettings-S7enRJR4.js.map +1 -0
  226. package/out/values-gwcnIHXs.js +2 -0
  227. package/out/values-gwcnIHXs.js.map +1 -0
  228. package/out/verify-sYnZ9juV.js +2 -0
  229. package/out/verify-sYnZ9juV.js.map +1 -0
  230. package/out/version-Cgs-grc5.js +2 -0
  231. package/out/version-Cgs-grc5.js.map +1 -0
  232. package/package.json +65 -4
  233. package/src/admin.ts +317 -0
  234. package/src/arguments.ts +323 -0
  235. package/src/catalog.ts +117 -0
  236. package/src/cli.ts +29 -0
  237. package/src/commands/admin/accountEditor.ts +33 -0
  238. package/src/commands/admin/active.ts +25 -0
  239. package/src/commands/admin/ban.ts +59 -0
  240. package/src/commands/admin/clearCache.ts +12 -0
  241. package/src/commands/admin/create.ts +59 -0
  242. package/src/commands/admin/cronjob.ts +94 -0
  243. package/src/commands/admin/dump.ts +25 -0
  244. package/src/commands/admin/flyingFleet.ts +25 -0
  245. package/src/commands/admin/giveaway.ts +37 -0
  246. package/src/commands/admin/information.ts +12 -0
  247. package/src/commands/admin/log.ts +37 -0
  248. package/src/commands/admin/login.ts +15 -0
  249. package/src/commands/admin/logout.ts +12 -0
  250. package/src/commands/admin/messageList.ts +19 -0
  251. package/src/commands/admin/module.ts +25 -0
  252. package/src/commands/admin/multiIp.ts +25 -0
  253. package/src/commands/admin/news.ts +40 -0
  254. package/src/commands/admin/overview.ts +12 -0
  255. package/src/commands/admin/password.ts +18 -0
  256. package/src/commands/admin/quickEditor.ts +30 -0
  257. package/src/commands/admin/refreshStatistics.ts +12 -0
  258. package/src/commands/admin/reset.ts +26 -0
  259. package/src/commands/admin/rights.ts +68 -0
  260. package/src/commands/admin/search.ts +31 -0
  261. package/src/commands/admin/sendMessages.ts +26 -0
  262. package/src/commands/admin/support.ts +48 -0
  263. package/src/commands/admin/universe.ts +49 -0
  264. package/src/commands/admin/universeSettings.ts +32 -0
  265. package/src/commands/game/achievements.ts +18 -0
  266. package/src/commands/game/alliance.ts +248 -0
  267. package/src/commands/game/allianceAdmin.ts +236 -0
  268. package/src/commands/game/arsenal.ts +12 -0
  269. package/src/commands/game/banList.ts +20 -0
  270. package/src/commands/game/battleHall.ts +21 -0
  271. package/src/commands/game/battleReport.ts +20 -0
  272. package/src/commands/game/battleSimulator.ts +41 -0
  273. package/src/commands/game/board.ts +12 -0
  274. package/src/commands/game/bonusSummary.ts +12 -0
  275. package/src/commands/game/buddyList.ts +76 -0
  276. package/src/commands/game/buildings.ts +81 -0
  277. package/src/commands/game/chat.ts +12 -0
  278. package/src/commands/game/containers.ts +33 -0
  279. package/src/commands/game/control.ts +16 -0
  280. package/src/commands/game/createMoon.ts +28 -0
  281. package/src/commands/game/dailyBonus.ts +18 -0
  282. package/src/commands/game/delivery.ts +34 -0
  283. package/src/commands/game/endpoints.ts +61 -0
  284. package/src/commands/game/findDebris.ts +16 -0
  285. package/src/commands/game/fleetAjax.ts +24 -0
  286. package/src/commands/game/fleetDealer.ts +36 -0
  287. package/src/commands/game/fleetMissile.ts +25 -0
  288. package/src/commands/game/fleetStep1.ts +74 -0
  289. package/src/commands/game/fleetStep2.ts +27 -0
  290. package/src/commands/game/fleetStep3.ts +28 -0
  291. package/src/commands/game/fleetTable.ts +96 -0
  292. package/src/commands/game/galaxy.ts +26 -0
  293. package/src/commands/game/growth.ts +313 -0
  294. package/src/commands/game/information.ts +56 -0
  295. package/src/commands/game/logout.ts +12 -0
  296. package/src/commands/game/market.ts +67 -0
  297. package/src/commands/game/messages.ts +129 -0
  298. package/src/commands/game/notes.ts +65 -0
  299. package/src/commands/game/overview.ts +49 -0
  300. package/src/commands/game/phalanx.ts +23 -0
  301. package/src/commands/game/planet.ts +78 -0
  302. package/src/commands/game/playerCard.ts +20 -0
  303. package/src/commands/game/questions.ts +23 -0
  304. package/src/commands/game/records.ts +16 -0
  305. package/src/commands/game/reduceFleet.ts +41 -0
  306. package/src/commands/game/reduceResources.ts +35 -0
  307. package/src/commands/game/research.ts +80 -0
  308. package/src/commands/game/resources.ts +49 -0
  309. package/src/commands/game/scan.ts +12 -0
  310. package/src/commands/game/search.ts +44 -0
  311. package/src/commands/game/settings.ts +121 -0
  312. package/src/commands/game/shipyard.ts +61 -0
  313. package/src/commands/game/shops.ts +89 -0
  314. package/src/commands/game/statistics.ts +22 -0
  315. package/src/commands/game/store.ts +12 -0
  316. package/src/commands/game/techtree.ts +16 -0
  317. package/src/commands/game/ticket.ts +44 -0
  318. package/src/commands/game/trader.ts +51 -0
  319. package/src/commands/game/workflows/fleet.ts +12 -0
  320. package/src/commands/game/workflows/snapshot.ts +84 -0
  321. package/src/commands/game/workflows/social.ts +37 -0
  322. package/src/commands/http/get.ts +13 -0
  323. package/src/commands/http/post.ts +44 -0
  324. package/src/commands/public/banList.ts +21 -0
  325. package/src/commands/public/battleHall.ts +20 -0
  326. package/src/commands/public/battleReport.ts +20 -0
  327. package/src/commands/public/board.ts +20 -0
  328. package/src/commands/public/disclaimer.ts +20 -0
  329. package/src/commands/public/externalAuth.ts +17 -0
  330. package/src/commands/public/index.ts +22 -0
  331. package/src/commands/public/login.ts +20 -0
  332. package/src/commands/public/lostPassword.ts +57 -0
  333. package/src/commands/public/news.ts +20 -0
  334. package/src/commands/public/register.ts +46 -0
  335. package/src/commands/public/rules.ts +20 -0
  336. package/src/commands/public/screens.ts +20 -0
  337. package/src/commands/public/verify.ts +38 -0
  338. package/src/commands/rules/new-star.ts +221 -0
  339. package/src/commands/rules/production.ts +51 -0
  340. package/src/completion/BifrostCompletion.psm1 +47 -0
  341. package/src/completion.ts +445 -0
  342. package/src/connection.ts +106 -0
  343. package/src/destination.ts +64 -0
  344. package/src/game.ts +978 -0
  345. package/src/help.ts +203 -0
  346. package/src/i18n.ts +45 -0
  347. package/src/index.ts +2 -0
  348. package/src/input/admin/accountEditor.ts +156 -0
  349. package/src/input/admin/ban.ts +23 -0
  350. package/src/input/admin/create.ts +36 -0
  351. package/src/input/admin/cronjob.ts +22 -0
  352. package/src/input/admin/fields.ts +432 -0
  353. package/src/input/admin/login.ts +9 -0
  354. package/src/input/admin/messageList.ts +21 -0
  355. package/src/input/admin/news.ts +29 -0
  356. package/src/input/admin/quickEditor.ts +115 -0
  357. package/src/input/admin/records.ts +68 -0
  358. package/src/input/admin/reset.ts +29 -0
  359. package/src/input/admin/search.ts +23 -0
  360. package/src/input/admin/sendMessages.ts +21 -0
  361. package/src/input/admin/universeSettings.ts +46 -0
  362. package/src/input/files.ts +65 -0
  363. package/src/input/game/allianceAdmin.ts +55 -0
  364. package/src/input/game/battleSimulator.ts +25 -0
  365. package/src/input/game/fleetStep1.ts +14 -0
  366. package/src/input/game/settings.ts +46 -0
  367. package/src/input/game/ticket.ts +16 -0
  368. package/src/input/parse.ts +173 -0
  369. package/src/input/paths.ts +392 -0
  370. package/src/input/protocol/context.ts +10 -0
  371. package/src/input/protocol/missions.ts +6 -0
  372. package/src/input/protocol/routes.ts +15 -0
  373. package/src/input/protocol/settings.ts +126 -0
  374. package/src/input/protocol/values.ts +13 -0
  375. package/src/input/public/externalAuth.ts +26 -0
  376. package/src/input/public/register.ts +9 -0
  377. package/src/input/rules/new-star.ts +21 -0
  378. package/src/input/rules/production.ts +14 -0
  379. package/src/input/shared.ts +51 -0
  380. package/src/input/spec.ts +155 -0
  381. package/src/input/values.ts +114 -0
  382. package/src/input/workflows/fleet.ts +22 -0
  383. package/src/input/workflows/snapshot.ts +74 -0
  384. package/src/locales/en-US/commands.ts +377 -0
  385. package/src/locales/en-US/diagnostics.ts +89 -0
  386. package/src/locales/en-US.ts +61 -0
  387. package/src/locales/zh-CN/commands.ts +307 -0
  388. package/src/locales/zh-CN/diagnostics.ts +81 -0
  389. package/src/locales/zh-CN.ts +57 -0
  390. package/src/options.ts +48 -0
  391. package/src/output.ts +201 -0
  392. package/src/pointer.ts +46 -0
  393. package/src/presentation.ts +96 -0
  394. package/src/public.ts +99 -0
  395. package/src/registry.ts +67 -0
  396. package/src/requests.ts +13 -0
  397. package/src/result.ts +27 -0
  398. package/src/rules.ts +77 -0
  399. package/src/runner.ts +214 -0
  400. package/src/selection.ts +44 -0
  401. package/src/terminal.ts +27 -0
  402. package/src/types.ts +110 -0
  403. package/src/version.ts +11 -0
package/src/catalog.ts ADDED
@@ -0,0 +1,117 @@
1
+ import type { Session } from '@senators/bifrost'
2
+
3
+ import { parseInput } from './input/parse.ts'
4
+ import type { InputSpec } from './input/spec.ts'
5
+ import { flagName } from './options.ts'
6
+ import type {
7
+ Command,
8
+ CommandMethod,
9
+ CommandResult,
10
+ NetworkCommand,
11
+ ObservedResult,
12
+ OfflineCommand,
13
+ PreparedRead,
14
+ } from './types.ts'
15
+
16
+ export type CommandDomain = 'game' | 'admin' | 'public' | 'rules' | 'http'
17
+ export type CommandEntry = {
18
+ domain: CommandDomain
19
+ name: string
20
+ method: Command['method']
21
+ load: () => Promise<Command>
22
+ }
23
+
24
+ /**
25
+ * The name a caller types for a method: its domain, then the method in kebab case. Methods of
26
+ * `admin` and `public` commands repeat their domain, so that prefix is removed first.
27
+ *
28
+ * 调用方键入的方法名:域名在前,方法名转为 kebab 形式。
29
+ * `admin` 与 `public` 的方法名自带域名前缀,故先移除该前缀。
30
+ */
31
+ export function commandName(domain: CommandDomain, method: string): string {
32
+ const bare = domain === 'admin' || domain === 'public' ? method.slice(domain.length) : method
33
+ return `${domain} ${flagName(bare, false)}`
34
+ }
35
+
36
+ export function defineCommands(
37
+ domain: CommandDomain,
38
+ entries: readonly Pick<CommandEntry, 'method' | 'load'>[],
39
+ ): readonly CommandEntry[] {
40
+ return entries.map((entry) => ({ ...entry, domain, name: commandName(domain, entry.method) }))
41
+ }
42
+
43
+ /**
44
+ * A network command whose SDK function returns an observed document or receipt. Observation is what
45
+ * makes a command eligible as a snapshot extension, and the only case where a planet is bound.
46
+ *
47
+ * 其 SDK 函数返回可观测文档或回执的联网命令。可观测性使它能够作为快照扩展,
48
+ * 也是唯一会绑定星球的情形。
49
+ */
50
+ export function observedCommand<Options>(
51
+ domain: CommandDomain,
52
+ method: CommandMethod,
53
+ input: InputSpec<Options>,
54
+ request: (session: Session, options: Options) => Promise<ObservedResult>,
55
+ planet?: 'planetId' | 'origin',
56
+ ): NetworkCommand {
57
+ const name = commandName(domain, method)
58
+ const prepare = (raw: unknown): PreparedRead => {
59
+ const options = parseInput<Options>(input, raw, name)
60
+ return (session) => request(session, options)
61
+ }
62
+ return {
63
+ name,
64
+ method,
65
+ input,
66
+ session: true,
67
+ extension: true,
68
+ ...(planet === undefined ? {} : { planet }),
69
+ prepare,
70
+ execute: (session, raw) => prepare(raw)(session),
71
+ }
72
+ }
73
+
74
+ /**
75
+ * A command that reaches no server, so it opens no session and observes no document.
76
+ *
77
+ * 不访问服务端的命令:不建立会话,也不产生可观测文档。
78
+ */
79
+ export function offlineCommand<Options>(
80
+ domain: CommandDomain,
81
+ method: CommandMethod,
82
+ input: InputSpec<Options>,
83
+ run: (options: Options) => CommandResult,
84
+ ): OfflineCommand {
85
+ const name = commandName(domain, method)
86
+ return {
87
+ name,
88
+ method,
89
+ input,
90
+ session: false,
91
+ extension: false,
92
+ execute: (raw) => run(parseInput<Options>(input, raw, name)),
93
+ }
94
+ }
95
+
96
+ /**
97
+ * A network command whose SDK function returns anything else, so it observes no document, extension
98
+ * eligibility does not apply, and no planet is bound.
99
+ *
100
+ * 其 SDK 函数返回其他类型的联网命令:不产生可观测文档,不适用扩展资格,也不绑定星球。
101
+ */
102
+ export function plainCommand<Options>(
103
+ domain: CommandDomain,
104
+ method: CommandMethod,
105
+ input: InputSpec<Options>,
106
+ request: (session: Session, options: Options) => CommandResult | Promise<CommandResult>,
107
+ ): NetworkCommand {
108
+ const name = commandName(domain, method)
109
+ return {
110
+ name,
111
+ method,
112
+ input,
113
+ session: true,
114
+ extension: false,
115
+ execute: (session, raw) => request(session, parseInput<Options>(input, raw, name)),
116
+ }
117
+ }
package/src/cli.ts ADDED
@@ -0,0 +1,29 @@
1
+ #!/usr/bin/env node
2
+ import type { Writable } from 'node:stream'
3
+
4
+ import { detectLocale } from './i18n.ts'
5
+ import { run, standardInput } from './runner.ts'
6
+ import { terminalPresentation } from './terminal.ts'
7
+
8
+ async function writeOutput(stream: Writable, output: string): Promise<void> {
9
+ const { promise, resolve, reject } = Promise.withResolvers<void>()
10
+ stream.once('error', reject)
11
+ try {
12
+ stream.write(output, (error) => {
13
+ if (error) reject(error)
14
+ else resolve()
15
+ })
16
+ await promise
17
+ } finally {
18
+ stream.off('error', reject)
19
+ }
20
+ }
21
+
22
+ process.exitCode = await run(process.argv.slice(2), {
23
+ stdin: standardInput,
24
+ stdout: (output) => writeOutput(process.stdout, output),
25
+ stderr: (output) => writeOutput(process.stderr, output),
26
+ stdoutPresentation: terminalPresentation(process.stdout, process.env),
27
+ stderrPresentation: terminalPresentation(process.stderr, process.env),
28
+ locale: detectLocale(process.env, new Intl.DateTimeFormat().resolvedOptions().locale),
29
+ })
@@ -0,0 +1,33 @@
1
+ import { adminAccountEditor, adminAccountEditorSubmit } from '@senators/bifrost'
2
+
3
+ import { observedCommand } from '../../catalog.ts'
4
+ import {
5
+ adminAccountEditorSectionInput,
6
+ adminAccountEditorSubmitInput,
7
+ } from '../../input/admin/accountEditor.ts'
8
+ import { optional } from '../../input/spec.ts'
9
+ import type { InputSpec } from '../../input/spec.ts'
10
+ import type { NetworkCommand } from '../../types.ts'
11
+
12
+ const adminAccountEditorSchema = {
13
+ kind: 'object',
14
+ fields: { section: optional(adminAccountEditorSectionInput) },
15
+ } satisfies InputSpec<Parameters<typeof adminAccountEditor>[1]>
16
+
17
+ const adminAccountEditorSubmitSchema = adminAccountEditorSubmitInput satisfies InputSpec<
18
+ Parameters<typeof adminAccountEditorSubmit>[1]
19
+ >
20
+
21
+ export const adminAccountEditorCommand: NetworkCommand = observedCommand(
22
+ 'admin',
23
+ 'adminAccountEditor',
24
+ adminAccountEditorSchema,
25
+ adminAccountEditor,
26
+ )
27
+
28
+ export const adminAccountEditorSubmitCommand: NetworkCommand = observedCommand(
29
+ 'admin',
30
+ 'adminAccountEditorSubmit',
31
+ adminAccountEditorSubmitSchema,
32
+ adminAccountEditorSubmit,
33
+ )
@@ -0,0 +1,25 @@
1
+ import { adminActive, adminActiveDelete } from '@senators/bifrost'
2
+
3
+ import { observedCommand } from '../../catalog.ts'
4
+ import { emptyInput, numberInput, required } from '../../input/spec.ts'
5
+ import type { InputSpec } from '../../input/spec.ts'
6
+ import type { NetworkCommand } from '../../types.ts'
7
+
8
+ const adminActiveDeleteSchema = {
9
+ kind: 'object',
10
+ fields: { validationId: required(numberInput) },
11
+ } satisfies InputSpec<Parameters<typeof adminActiveDelete>[1]>
12
+
13
+ export const adminActiveCommand: NetworkCommand = observedCommand<Record<string, never>>(
14
+ 'admin',
15
+ 'adminActive',
16
+ emptyInput,
17
+ (session) => adminActive(session),
18
+ )
19
+
20
+ export const adminActiveDeleteCommand: NetworkCommand = observedCommand(
21
+ 'admin',
22
+ 'adminActiveDelete',
23
+ adminActiveDeleteSchema,
24
+ adminActiveDelete,
25
+ )
@@ -0,0 +1,59 @@
1
+ import { adminBan, adminBanLift, adminBanLookup, adminBanPlace } from '@senators/bifrost'
2
+
3
+ import { observedCommand } from '../../catalog.ts'
4
+ import { adminBanRequestInput } from '../../input/admin/ban.ts'
5
+ import { enumeration, 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 adminBanSchema = {
10
+ kind: 'object',
11
+ fields: {
12
+ bannedOrder: optional(enumeration(['id', 'username'])),
13
+ order: optional(enumeration(['id', 'username'])),
14
+ view: optional(enumeration(['all', 'banned'])),
15
+ },
16
+ } satisfies InputSpec<Parameters<typeof adminBan>[1]>
17
+
18
+ const adminBanLiftSchema = {
19
+ kind: 'object',
20
+ fields: { username: required(stringInput) },
21
+ } satisfies InputSpec<Parameters<typeof adminBanLift>[1]>
22
+
23
+ const adminBanLookupSchema = {
24
+ kind: 'object',
25
+ fields: { username: required(stringInput) },
26
+ } satisfies InputSpec<Parameters<typeof adminBanLookup>[1]>
27
+
28
+ const adminBanPlaceSchema = {
29
+ kind: 'object',
30
+ fields: { ban: required(adminBanRequestInput) },
31
+ } satisfies InputSpec<Parameters<typeof adminBanPlace>[1]>
32
+
33
+ export const adminBanCommand: NetworkCommand = observedCommand(
34
+ 'admin',
35
+ 'adminBan',
36
+ adminBanSchema,
37
+ adminBan,
38
+ )
39
+
40
+ export const adminBanLiftCommand: NetworkCommand = observedCommand(
41
+ 'admin',
42
+ 'adminBanLift',
43
+ adminBanLiftSchema,
44
+ adminBanLift,
45
+ )
46
+
47
+ export const adminBanLookupCommand: NetworkCommand = observedCommand(
48
+ 'admin',
49
+ 'adminBanLookup',
50
+ adminBanLookupSchema,
51
+ adminBanLookup,
52
+ )
53
+
54
+ export const adminBanPlaceCommand: NetworkCommand = observedCommand(
55
+ 'admin',
56
+ 'adminBanPlace',
57
+ adminBanPlaceSchema,
58
+ adminBanPlace,
59
+ )
@@ -0,0 +1,12 @@
1
+ import { adminClearCache } 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 adminClearCacheCommand: NetworkCommand = observedCommand<Record<string, never>>(
8
+ 'admin',
9
+ 'adminClearCache',
10
+ emptyInput,
11
+ (session) => adminClearCache(session),
12
+ )
@@ -0,0 +1,59 @@
1
+ import { adminCreate, adminCreateMoon, adminCreatePlanet, adminCreateUser } from '@senators/bifrost'
2
+
3
+ import { observedCommand } from '../../catalog.ts'
4
+ import {
5
+ adminMoonDraftInput,
6
+ adminPlanetDraftInput,
7
+ adminUserDraftInput,
8
+ } from '../../input/admin/create.ts'
9
+ import { enumeration, optional, required } from '../../input/spec.ts'
10
+ import type { InputSpec } from '../../input/spec.ts'
11
+ import type { NetworkCommand } from '../../types.ts'
12
+
13
+ const adminCreateSchema = {
14
+ kind: 'object',
15
+ fields: { kind: optional(enumeration(['user', 'planet', 'moon'])) },
16
+ } satisfies InputSpec<Parameters<typeof adminCreate>[1]>
17
+
18
+ const adminCreateMoonSchema = {
19
+ kind: 'object',
20
+ fields: { draft: required(adminMoonDraftInput) },
21
+ } satisfies InputSpec<Parameters<typeof adminCreateMoon>[1]>
22
+
23
+ const adminCreatePlanetSchema = {
24
+ kind: 'object',
25
+ fields: { draft: required(adminPlanetDraftInput) },
26
+ } satisfies InputSpec<Parameters<typeof adminCreatePlanet>[1]>
27
+
28
+ const adminCreateUserSchema = {
29
+ kind: 'object',
30
+ fields: { draft: required(adminUserDraftInput) },
31
+ } satisfies InputSpec<Parameters<typeof adminCreateUser>[1]>
32
+
33
+ export const adminCreateCommand: NetworkCommand = observedCommand(
34
+ 'admin',
35
+ 'adminCreate',
36
+ adminCreateSchema,
37
+ adminCreate,
38
+ )
39
+
40
+ export const adminCreateMoonCommand: NetworkCommand = observedCommand(
41
+ 'admin',
42
+ 'adminCreateMoon',
43
+ adminCreateMoonSchema,
44
+ adminCreateMoon,
45
+ )
46
+
47
+ export const adminCreatePlanetCommand: NetworkCommand = observedCommand(
48
+ 'admin',
49
+ 'adminCreatePlanet',
50
+ adminCreatePlanetSchema,
51
+ adminCreatePlanet,
52
+ )
53
+
54
+ export const adminCreateUserCommand: NetworkCommand = observedCommand(
55
+ 'admin',
56
+ 'adminCreateUser',
57
+ adminCreateUserSchema,
58
+ adminCreateUser,
59
+ )
@@ -0,0 +1,94 @@
1
+ import {
2
+ adminCronjob,
3
+ adminCronjobDelete,
4
+ adminCronjobDetail,
5
+ adminCronjobEnable,
6
+ adminCronjobLock,
7
+ adminCronjobSave,
8
+ adminCronjobUnlock,
9
+ } from '@senators/bifrost'
10
+
11
+ import { observedCommand } from '../../catalog.ts'
12
+ import { adminCronjobScheduleInput } from '../../input/admin/cronjob.ts'
13
+ import { booleanInput, emptyInput, numberInput, optional, required } from '../../input/spec.ts'
14
+ import type { InputSpec } from '../../input/spec.ts'
15
+ import type { NetworkCommand } from '../../types.ts'
16
+
17
+ const adminCronjobDeleteSchema = {
18
+ kind: 'object',
19
+ fields: { cronjobId: required(numberInput) },
20
+ } satisfies InputSpec<Parameters<typeof adminCronjobDelete>[1]>
21
+
22
+ const adminCronjobDetailSchema = {
23
+ kind: 'object',
24
+ fields: { cronjobId: optional(numberInput) },
25
+ } satisfies InputSpec<Parameters<typeof adminCronjobDetail>[1]>
26
+
27
+ const adminCronjobEnableSchema = {
28
+ kind: 'object',
29
+ fields: { active: required(booleanInput), cronjobId: required(numberInput) },
30
+ } satisfies InputSpec<Parameters<typeof adminCronjobEnable>[1]>
31
+
32
+ const adminCronjobLockSchema = {
33
+ kind: 'object',
34
+ fields: { cronjobId: required(numberInput) },
35
+ } satisfies InputSpec<Parameters<typeof adminCronjobLock>[1]>
36
+
37
+ const adminCronjobSaveSchema = {
38
+ kind: 'object',
39
+ fields: { cronjobId: optional(numberInput), schedule: required(adminCronjobScheduleInput) },
40
+ } satisfies InputSpec<Parameters<typeof adminCronjobSave>[1]>
41
+
42
+ const adminCronjobUnlockSchema = {
43
+ kind: 'object',
44
+ fields: { cronjobId: required(numberInput) },
45
+ } satisfies InputSpec<Parameters<typeof adminCronjobUnlock>[1]>
46
+
47
+ export const adminCronjobCommand: NetworkCommand = observedCommand<Record<string, never>>(
48
+ 'admin',
49
+ 'adminCronjob',
50
+ emptyInput,
51
+ (session) => adminCronjob(session),
52
+ )
53
+
54
+ export const adminCronjobDeleteCommand: NetworkCommand = observedCommand(
55
+ 'admin',
56
+ 'adminCronjobDelete',
57
+ adminCronjobDeleteSchema,
58
+ adminCronjobDelete,
59
+ )
60
+
61
+ export const adminCronjobDetailCommand: NetworkCommand = observedCommand(
62
+ 'admin',
63
+ 'adminCronjobDetail',
64
+ adminCronjobDetailSchema,
65
+ adminCronjobDetail,
66
+ )
67
+
68
+ export const adminCronjobEnableCommand: NetworkCommand = observedCommand(
69
+ 'admin',
70
+ 'adminCronjobEnable',
71
+ adminCronjobEnableSchema,
72
+ adminCronjobEnable,
73
+ )
74
+
75
+ export const adminCronjobLockCommand: NetworkCommand = observedCommand(
76
+ 'admin',
77
+ 'adminCronjobLock',
78
+ adminCronjobLockSchema,
79
+ adminCronjobLock,
80
+ )
81
+
82
+ export const adminCronjobSaveCommand: NetworkCommand = observedCommand(
83
+ 'admin',
84
+ 'adminCronjobSave',
85
+ adminCronjobSaveSchema,
86
+ adminCronjobSave,
87
+ )
88
+
89
+ export const adminCronjobUnlockCommand: NetworkCommand = observedCommand(
90
+ 'admin',
91
+ 'adminCronjobUnlock',
92
+ adminCronjobUnlockSchema,
93
+ adminCronjobUnlock,
94
+ )
@@ -0,0 +1,25 @@
1
+ import { adminDump, adminDumpBackup } from '@senators/bifrost'
2
+
3
+ import { observedCommand } from '../../catalog.ts'
4
+ import { arrayInput, emptyInput, required, stringInput } from '../../input/spec.ts'
5
+ import type { InputSpec } from '../../input/spec.ts'
6
+ import type { NetworkCommand } from '../../types.ts'
7
+
8
+ const adminDumpBackupSchema = {
9
+ kind: 'object',
10
+ fields: { tables: required(arrayInput(stringInput)) },
11
+ } satisfies InputSpec<Parameters<typeof adminDumpBackup>[1]>
12
+
13
+ export const adminDumpCommand: NetworkCommand = observedCommand<Record<string, never>>(
14
+ 'admin',
15
+ 'adminDump',
16
+ emptyInput,
17
+ (session) => adminDump(session),
18
+ )
19
+
20
+ export const adminDumpBackupCommand: NetworkCommand = observedCommand(
21
+ 'admin',
22
+ 'adminDumpBackup',
23
+ adminDumpBackupSchema,
24
+ adminDumpBackup,
25
+ )
@@ -0,0 +1,25 @@
1
+ import { adminFlyingFleet, adminFlyingFleetSetBusy } from '@senators/bifrost'
2
+
3
+ import { observedCommand } from '../../catalog.ts'
4
+ import { emptyInput, enumeration, numberInput, required } from '../../input/spec.ts'
5
+ import type { InputSpec } from '../../input/spec.ts'
6
+ import type { NetworkCommand } from '../../types.ts'
7
+
8
+ const adminFlyingFleetSetBusySchema = {
9
+ kind: 'object',
10
+ fields: { busy: required(enumeration([0, 1, 2])), fleetId: required(numberInput) },
11
+ } satisfies InputSpec<Parameters<typeof adminFlyingFleetSetBusy>[1]>
12
+
13
+ export const adminFlyingFleetCommand: NetworkCommand = observedCommand<Record<string, never>>(
14
+ 'admin',
15
+ 'adminFlyingFleet',
16
+ emptyInput,
17
+ (session) => adminFlyingFleet(session),
18
+ )
19
+
20
+ export const adminFlyingFleetSetBusyCommand: NetworkCommand = observedCommand(
21
+ 'admin',
22
+ 'adminFlyingFleetSetBusy',
23
+ adminFlyingFleetSetBusySchema,
24
+ adminFlyingFleetSetBusy,
25
+ )
@@ -0,0 +1,37 @@
1
+ import { adminGiveaway, adminGiveawayAward } from '@senators/bifrost'
2
+
3
+ import { observedCommand } from '../../catalog.ts'
4
+ import { elementInput } from '../../input/shared.ts'
5
+ import { booleanInput, emptyInput, optional, required } from '../../input/spec.ts'
6
+ import type { InputSpec } from '../../input/spec.ts'
7
+ import type { NetworkCommand } from '../../types.ts'
8
+
9
+ const adminGiveawayAwardSchema = {
10
+ kind: 'object',
11
+ fields: {
12
+ elements: required(elementInput),
13
+ filters: required({
14
+ kind: 'object',
15
+ fields: {
16
+ activeOnly: optional(booleanInput),
17
+ homePlanetOnly: optional(booleanInput),
18
+ moons: optional(booleanInput),
19
+ planets: optional(booleanInput),
20
+ },
21
+ }),
22
+ },
23
+ } satisfies InputSpec<Parameters<typeof adminGiveawayAward>[1]>
24
+
25
+ export const adminGiveawayCommand: NetworkCommand = observedCommand<Record<string, never>>(
26
+ 'admin',
27
+ 'adminGiveaway',
28
+ emptyInput,
29
+ (session) => adminGiveaway(session),
30
+ )
31
+
32
+ export const adminGiveawayAwardCommand: NetworkCommand = observedCommand(
33
+ 'admin',
34
+ 'adminGiveawayAward',
35
+ adminGiveawayAwardSchema,
36
+ adminGiveawayAward,
37
+ )
@@ -0,0 +1,12 @@
1
+ import { adminInformation } 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 adminInformationCommand: NetworkCommand = observedCommand<Record<string, never>>(
8
+ 'admin',
9
+ 'adminInformation',
10
+ emptyInput,
11
+ (session) => adminInformation(session),
12
+ )
@@ -0,0 +1,37 @@
1
+ import { adminLog, adminLogDetail, adminLogList } from '@senators/bifrost'
2
+
3
+ import { observedCommand } from '../../catalog.ts'
4
+ import { emptyInput, enumeration, numberInput, required } from '../../input/spec.ts'
5
+ import type { InputSpec } from '../../input/spec.ts'
6
+ import type { NetworkCommand } from '../../types.ts'
7
+
8
+ const adminLogDetailSchema = {
9
+ kind: 'object',
10
+ fields: { logId: required(numberInput) },
11
+ } satisfies InputSpec<Parameters<typeof adminLogDetail>[1]>
12
+
13
+ const adminLogListSchema = {
14
+ kind: 'object',
15
+ fields: { log: required(enumeration(['planets', 'players', 'settings', 'present'])) },
16
+ } satisfies InputSpec<Parameters<typeof adminLogList>[1]>
17
+
18
+ export const adminLogCommand: NetworkCommand = observedCommand<Record<string, never>>(
19
+ 'admin',
20
+ 'adminLog',
21
+ emptyInput,
22
+ (session) => adminLog(session),
23
+ )
24
+
25
+ export const adminLogDetailCommand: NetworkCommand = observedCommand(
26
+ 'admin',
27
+ 'adminLogDetail',
28
+ adminLogDetailSchema,
29
+ adminLogDetail,
30
+ )
31
+
32
+ export const adminLogListCommand: NetworkCommand = observedCommand(
33
+ 'admin',
34
+ 'adminLogList',
35
+ adminLogListSchema,
36
+ adminLogList,
37
+ )
@@ -0,0 +1,15 @@
1
+ import { adminLogin } from '@senators/bifrost'
2
+
3
+ import { observedCommand } from '../../catalog.ts'
4
+ import { adminCredentialsInput } from '../../input/admin/login.ts'
5
+ import type { InputSpec } from '../../input/spec.ts'
6
+ import type { NetworkCommand } from '../../types.ts'
7
+
8
+ const adminLoginSchema = adminCredentialsInput satisfies InputSpec<Parameters<typeof adminLogin>[1]>
9
+
10
+ export const adminLoginCommand: NetworkCommand = observedCommand(
11
+ 'admin',
12
+ 'adminLogin',
13
+ adminLoginSchema,
14
+ adminLogin,
15
+ )
@@ -0,0 +1,12 @@
1
+ import { adminLogout } 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 adminLogoutCommand: NetworkCommand = observedCommand<Record<string, never>>(
8
+ 'admin',
9
+ 'adminLogout',
10
+ emptyInput,
11
+ (session) => adminLogout(session),
12
+ )
@@ -0,0 +1,19 @@
1
+ import { adminMessageList } from '@senators/bifrost'
2
+
3
+ import { observedCommand } from '../../catalog.ts'
4
+ import { adminMessageFilterInput } from '../../input/admin/messageList.ts'
5
+ import { optional } from '../../input/spec.ts'
6
+ import type { InputSpec } from '../../input/spec.ts'
7
+ import type { NetworkCommand } from '../../types.ts'
8
+
9
+ const adminMessageListSchema = {
10
+ kind: 'object',
11
+ fields: { filter: optional(adminMessageFilterInput) },
12
+ } satisfies InputSpec<Parameters<typeof adminMessageList>[1]>
13
+
14
+ export const adminMessageListCommand: NetworkCommand = observedCommand(
15
+ 'admin',
16
+ 'adminMessageList',
17
+ adminMessageListSchema,
18
+ adminMessageList,
19
+ )
@@ -0,0 +1,25 @@
1
+ import { adminModule, adminModuleSet } from '@senators/bifrost'
2
+
3
+ import { observedCommand } from '../../catalog.ts'
4
+ import { booleanInput, emptyInput, numberInput, required } from '../../input/spec.ts'
5
+ import type { InputSpec } from '../../input/spec.ts'
6
+ import type { NetworkCommand } from '../../types.ts'
7
+
8
+ const adminModuleSetSchema = {
9
+ kind: 'object',
10
+ fields: { active: required(booleanInput), moduleId: required(numberInput) },
11
+ } satisfies InputSpec<Parameters<typeof adminModuleSet>[1]>
12
+
13
+ export const adminModuleCommand: NetworkCommand = observedCommand<Record<string, never>>(
14
+ 'admin',
15
+ 'adminModule',
16
+ emptyInput,
17
+ (session) => adminModule(session),
18
+ )
19
+
20
+ export const adminModuleSetCommand: NetworkCommand = observedCommand(
21
+ 'admin',
22
+ 'adminModuleSet',
23
+ adminModuleSetSchema,
24
+ adminModuleSet,
25
+ )
@@ -0,0 +1,25 @@
1
+ import { adminMultiIp, adminMultiIpMark } from '@senators/bifrost'
2
+
3
+ import { observedCommand } from '../../catalog.ts'
4
+ import { booleanInput, emptyInput, numberInput, required } from '../../input/spec.ts'
5
+ import type { InputSpec } from '../../input/spec.ts'
6
+ import type { NetworkCommand } from '../../types.ts'
7
+
8
+ const adminMultiIpMarkSchema = {
9
+ kind: 'object',
10
+ fields: { known: required(booleanInput), playerId: required(numberInput) },
11
+ } satisfies InputSpec<Parameters<typeof adminMultiIpMark>[1]>
12
+
13
+ export const adminMultiIpCommand: NetworkCommand = observedCommand<Record<string, never>>(
14
+ 'admin',
15
+ 'adminMultiIp',
16
+ emptyInput,
17
+ (session) => adminMultiIp(session),
18
+ )
19
+
20
+ export const adminMultiIpMarkCommand: NetworkCommand = observedCommand(
21
+ 'admin',
22
+ 'adminMultiIpMark',
23
+ adminMultiIpMarkSchema,
24
+ adminMultiIpMark,
25
+ )