omegga 0.1.83 → 1.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 (463) hide show
  1. package/.vscode/settings.json +20 -0
  2. package/README.md +142 -62
  3. package/bin/omegga +10 -4
  4. package/dist/brickadia/config.d.ts +3 -0
  5. package/dist/brickadia/config.d.ts.map +1 -0
  6. package/dist/brickadia/config.js +61 -0
  7. package/dist/brickadia/config.js.map +1 -0
  8. package/dist/brickadia/presets.d.ts +65 -0
  9. package/dist/brickadia/presets.js +3 -0
  10. package/dist/brickadia/presets.js.map +1 -0
  11. package/dist/brickadia/server.d.ts +20 -0
  12. package/dist/brickadia/server.d.ts.map +1 -0
  13. package/dist/brickadia/server.js +188 -0
  14. package/dist/brickadia/server.js.map +1 -0
  15. package/dist/brickadia/types.d.ts +45 -0
  16. package/dist/brickadia/types.d.ts.map +1 -0
  17. package/dist/brickadia/types.js +3 -0
  18. package/dist/brickadia/types.js.map +1 -0
  19. package/dist/cli/auth.d.ts +20 -0
  20. package/dist/cli/auth.d.ts.map +1 -0
  21. package/dist/cli/auth.js +115 -0
  22. package/dist/cli/auth.js.map +1 -0
  23. package/dist/cli/config.d.ts +10 -0
  24. package/dist/cli/config.d.ts.map +1 -0
  25. package/dist/cli/config.js +72 -0
  26. package/dist/cli/config.js.map +1 -0
  27. package/dist/cli/index.d.ts +20 -0
  28. package/dist/cli/index.d.ts.map +1 -0
  29. package/dist/cli/index.js +15 -0
  30. package/dist/cli/index.js.map +1 -0
  31. package/dist/cli/installer.d.ts +1 -0
  32. package/dist/cli/installer.d.ts.map +1 -0
  33. package/dist/cli/installer.js +55 -0
  34. package/dist/cli/installer.js.map +1 -0
  35. package/dist/cli/plugin.d.ts +11 -0
  36. package/dist/cli/plugin.d.ts.map +1 -0
  37. package/dist/cli/plugin.js +596 -0
  38. package/dist/cli/plugin.js.map +1 -0
  39. package/dist/cli/terminal.d.ts +34 -0
  40. package/dist/cli/terminal.d.ts.map +1 -0
  41. package/dist/cli/terminal.js +395 -0
  42. package/dist/cli/terminal.js.map +1 -0
  43. package/dist/config/authorizer.d.ts +2 -0
  44. package/dist/config/authorizer.d.ts.map +1 -0
  45. package/dist/config/authorizer.js +38 -0
  46. package/dist/config/authorizer.js.map +1 -0
  47. package/dist/config/formats/format_js.d.ts +3 -0
  48. package/dist/config/formats/format_js.d.ts.map +1 -0
  49. package/dist/config/formats/format_js.js +10 -0
  50. package/dist/config/formats/format_js.js.map +1 -0
  51. package/dist/config/formats/format_yml.d.ts +3 -0
  52. package/dist/config/formats/format_yml.d.ts.map +1 -0
  53. package/dist/config/formats/format_yml.js +14 -0
  54. package/dist/config/formats/format_yml.js.map +1 -0
  55. package/dist/config/index.d.ts +18 -0
  56. package/dist/config/index.d.ts.map +1 -0
  57. package/dist/config/index.js +86 -0
  58. package/dist/config/index.js.map +1 -0
  59. package/dist/config/reader.d.ts +3 -0
  60. package/dist/config/reader.d.ts.map +1 -0
  61. package/dist/config/reader.js +30 -0
  62. package/dist/config/reader.js.map +1 -0
  63. package/dist/config/types.d.ts +37 -0
  64. package/dist/config/types.d.ts.map +1 -0
  65. package/dist/config/types.js +3 -0
  66. package/dist/config/types.js.map +1 -0
  67. package/dist/config/validator.d.ts +6 -0
  68. package/dist/config/validator.d.ts.map +1 -0
  69. package/dist/config/validator.js +26 -0
  70. package/dist/config/validator.js.map +1 -0
  71. package/dist/config/writer.d.ts +3 -0
  72. package/dist/config/writer.d.ts.map +1 -0
  73. package/dist/config/writer.js +25 -0
  74. package/dist/config/writer.js.map +1 -0
  75. package/dist/index.d.ts +22 -0
  76. package/dist/index.js +55 -0
  77. package/dist/index.js.map +1 -0
  78. package/dist/info/default_commands.json +28 -0
  79. package/dist/lib.d.ts +21 -0
  80. package/dist/lib.d.ts.map +1 -0
  81. package/dist/lib.js +54 -0
  82. package/dist/lib.js.map +1 -0
  83. package/dist/logger.d.ts +41 -0
  84. package/dist/logger.js +67 -0
  85. package/dist/logger.js.map +1 -0
  86. package/dist/main.d.ts +1 -0
  87. package/dist/main.d.ts.map +1 -0
  88. package/dist/main.js +284 -0
  89. package/dist/main.js.map +1 -0
  90. package/dist/omegga/auth.d.ts +6 -0
  91. package/dist/omegga/auth.d.ts.map +1 -0
  92. package/dist/omegga/auth.js +139 -0
  93. package/dist/omegga/auth.js.map +1 -0
  94. package/dist/omegga/commandInjector.d.ts +35 -0
  95. package/dist/omegga/commandInjector.d.ts.map +1 -0
  96. package/dist/omegga/commandInjector.js +234 -0
  97. package/dist/omegga/commandInjector.js.map +1 -0
  98. package/dist/omegga/index.d.ts +7 -0
  99. package/dist/omegga/index.d.ts.map +1 -0
  100. package/dist/omegga/index.js +43 -0
  101. package/dist/omegga/index.js.map +1 -0
  102. package/dist/omegga/logWrangler.d.ts +32 -0
  103. package/dist/omegga/logWrangler.d.ts.map +1 -0
  104. package/dist/omegga/logWrangler.js +279 -0
  105. package/dist/omegga/logWrangler.js.map +1 -0
  106. package/dist/omegga/matchers/auth.d.ts +9 -0
  107. package/dist/omegga/matchers/auth.d.ts.map +1 -0
  108. package/dist/omegga/matchers/auth.js +53 -0
  109. package/dist/omegga/matchers/auth.js.map +1 -0
  110. package/dist/omegga/matchers/chat.d.ts +9 -0
  111. package/dist/omegga/matchers/chat.d.ts.map +1 -0
  112. package/dist/omegga/matchers/chat.js +68 -0
  113. package/dist/omegga/matchers/chat.js.map +1 -0
  114. package/dist/omegga/matchers/command.d.ts +7 -0
  115. package/dist/omegga/matchers/command.d.ts.map +1 -0
  116. package/dist/omegga/matchers/command.js +39 -0
  117. package/dist/omegga/matchers/command.js.map +1 -0
  118. package/dist/omegga/matchers/exit.d.ts +3 -0
  119. package/dist/omegga/matchers/exit.d.ts.map +1 -0
  120. package/dist/omegga/matchers/exit.js +21 -0
  121. package/dist/omegga/matchers/exit.js.map +1 -0
  122. package/dist/omegga/matchers/index.d.ts +3 -0
  123. package/dist/omegga/matchers/index.d.ts.map +1 -0
  124. package/dist/omegga/matchers/index.js +39 -0
  125. package/dist/omegga/matchers/index.js.map +1 -0
  126. package/dist/omegga/matchers/init.d.ts +3 -0
  127. package/dist/omegga/matchers/init.d.ts.map +1 -0
  128. package/dist/omegga/matchers/init.js +26 -0
  129. package/dist/omegga/matchers/init.js.map +1 -0
  130. package/dist/omegga/matchers/interact.d.ts +4 -0
  131. package/dist/omegga/matchers/interact.js +39 -0
  132. package/dist/omegga/matchers/interact.js.map +1 -0
  133. package/dist/omegga/matchers/join.d.ts +4 -0
  134. package/dist/omegga/matchers/join.d.ts.map +1 -0
  135. package/dist/omegga/matchers/join.js +95 -0
  136. package/dist/omegga/matchers/join.js.map +1 -0
  137. package/dist/omegga/matchers/leave.d.ts +4 -0
  138. package/dist/omegga/matchers/leave.d.ts.map +1 -0
  139. package/dist/omegga/matchers/leave.js +59 -0
  140. package/dist/omegga/matchers/leave.js.map +1 -0
  141. package/dist/omegga/matchers/mapChange.d.ts +3 -0
  142. package/dist/omegga/matchers/mapChange.d.ts.map +1 -0
  143. package/dist/omegga/matchers/mapChange.js +38 -0
  144. package/dist/omegga/matchers/mapChange.js.map +1 -0
  145. package/dist/omegga/matchers/types.d.ts +5 -0
  146. package/dist/omegga/matchers/types.d.ts.map +1 -0
  147. package/dist/omegga/matchers/types.js +7 -0
  148. package/dist/omegga/matchers/types.js.map +1 -0
  149. package/dist/omegga/matchers/version.d.ts +3 -0
  150. package/dist/omegga/matchers/version.d.ts.map +1 -0
  151. package/dist/omegga/matchers/version.js +45 -0
  152. package/dist/omegga/matchers/version.js.map +1 -0
  153. package/dist/omegga/player.d.ts +71 -0
  154. package/dist/omegga/player.d.ts.map +1 -0
  155. package/dist/omegga/player.js +442 -0
  156. package/dist/omegga/player.js.map +1 -0
  157. package/dist/omegga/plugin/plugin_jsonrpc_stdio.d.ts +23 -0
  158. package/dist/omegga/plugin/plugin_jsonrpc_stdio.d.ts.map +1 -0
  159. package/dist/omegga/plugin/plugin_jsonrpc_stdio.js +441 -0
  160. package/dist/omegga/plugin/plugin_jsonrpc_stdio.js.map +1 -0
  161. package/dist/omegga/plugin/plugin_node_safe/proxyOmegga.d.ts +129 -0
  162. package/dist/omegga/plugin/plugin_node_safe/proxyOmegga.d.ts.map +1 -0
  163. package/dist/omegga/plugin/plugin_node_safe/proxyOmegga.js +260 -0
  164. package/dist/omegga/plugin/plugin_node_safe/proxyOmegga.js.map +1 -0
  165. package/dist/omegga/plugin/plugin_node_safe/worker.d.ts +1 -0
  166. package/dist/omegga/plugin/plugin_node_safe/worker.d.ts.map +1 -0
  167. package/dist/omegga/plugin/plugin_node_safe/worker.js +289 -0
  168. package/dist/omegga/plugin/plugin_node_safe/worker.js.map +1 -0
  169. package/dist/omegga/plugin/plugin_node_safe.d.ts +24 -0
  170. package/dist/omegga/plugin/plugin_node_safe.d.ts.map +1 -0
  171. package/dist/omegga/plugin/plugin_node_safe.js +397 -0
  172. package/dist/omegga/plugin/plugin_node_safe.js.map +1 -0
  173. package/dist/omegga/plugin/plugin_node_unsafe.d.ts +13 -0
  174. package/dist/omegga/plugin/plugin_node_unsafe.d.ts.map +1 -0
  175. package/dist/omegga/plugin/plugin_node_unsafe.js +178 -0
  176. package/dist/omegga/plugin/plugin_node_unsafe.js.map +1 -0
  177. package/dist/omegga/plugin.d.ts +86 -0
  178. package/dist/omegga/plugin.d.ts.map +1 -0
  179. package/dist/omegga/plugin.js +458 -0
  180. package/dist/omegga/plugin.js.map +1 -0
  181. package/dist/omegga/server.d.ts +149 -0
  182. package/dist/omegga/server.d.ts.map +1 -0
  183. package/dist/omegga/server.js +601 -0
  184. package/dist/omegga/server.js.map +1 -0
  185. package/dist/omegga/types.d.ts +48 -0
  186. package/dist/omegga/types.d.ts.map +1 -0
  187. package/dist/omegga/types.js +3 -0
  188. package/dist/omegga/types.js.map +1 -0
  189. package/dist/omegga/wrapper.d.ts +22 -0
  190. package/dist/omegga/wrapper.d.ts.map +1 -0
  191. package/dist/omegga/wrapper.js +75 -0
  192. package/dist/omegga/wrapper.js.map +1 -0
  193. package/dist/omeggaplugin.d.ts +1 -0
  194. package/dist/omeggaplugin.js +4 -0
  195. package/dist/omeggaplugin.js.map +1 -0
  196. package/dist/plugin.d.ts +781 -0
  197. package/dist/plugin.js +41 -0
  198. package/dist/plugin.js.map +1 -0
  199. package/dist/softconfig.d.ts +51 -0
  200. package/dist/softconfig.d.ts.map +1 -0
  201. package/dist/softconfig.js +82 -0
  202. package/dist/softconfig.js.map +1 -0
  203. package/dist/util/brick/checkBounds.d.ts +8 -0
  204. package/dist/util/brick/checkBounds.d.ts.map +1 -0
  205. package/dist/util/brick/checkBounds.js +22 -0
  206. package/dist/util/brick/checkBounds.js.map +1 -0
  207. package/dist/util/brick/constants.d.ts +18 -0
  208. package/dist/util/brick/constants.d.ts.map +1 -0
  209. package/dist/util/brick/constants.js +184 -0
  210. package/dist/util/brick/constants.js.map +1 -0
  211. package/dist/util/brick/getBounds.d.ts +4 -0
  212. package/dist/util/brick/getBounds.d.ts.map +1 -0
  213. package/dist/util/brick/getBounds.js +39 -0
  214. package/dist/util/brick/getBounds.js.map +1 -0
  215. package/dist/util/brick/getBrickSize.d.ts +3 -0
  216. package/dist/util/brick/getBrickSize.d.ts.map +1 -0
  217. package/dist/util/brick/getBrickSize.js +12 -0
  218. package/dist/util/brick/getBrickSize.js.map +1 -0
  219. package/dist/util/brick/getScaleAxis.d.ts +3 -0
  220. package/dist/util/brick/getScaleAxis.d.ts.map +1 -0
  221. package/dist/util/brick/getScaleAxis.js +38 -0
  222. package/dist/util/brick/getScaleAxis.js.map +1 -0
  223. package/dist/util/brick/index.d.ts +13 -0
  224. package/dist/util/brick/index.d.ts.map +1 -0
  225. package/dist/util/brick/index.js +29 -0
  226. package/dist/util/brick/index.js.map +1 -0
  227. package/dist/util/brick/rotate.d.ts +17 -0
  228. package/dist/util/brick/rotate.d.ts.map +1 -0
  229. package/dist/util/brick/rotate.js +38 -0
  230. package/dist/util/brick/rotate.js.map +1 -0
  231. package/dist/util/brick/setOwnership.d.ts +12 -0
  232. package/dist/util/brick/setOwnership.d.ts.map +1 -0
  233. package/dist/util/brick/setOwnership.js +21 -0
  234. package/dist/util/brick/setOwnership.js.map +1 -0
  235. package/dist/util/chat.d.ts +23 -0
  236. package/dist/util/chat.d.ts.map +1 -0
  237. package/dist/util/chat.js +50 -0
  238. package/dist/util/chat.js.map +1 -0
  239. package/dist/util/color.d.ts +13 -0
  240. package/dist/util/color.d.ts.map +1 -0
  241. package/dist/util/color.js +130 -0
  242. package/dist/util/color.js.map +1 -0
  243. package/dist/util/file.d.ts +5 -0
  244. package/dist/util/file.d.ts.map +1 -0
  245. package/dist/util/file.js +114 -0
  246. package/dist/util/file.js.map +1 -0
  247. package/dist/util/index.d.ts +162 -0
  248. package/dist/util/index.d.ts.map +1 -0
  249. package/dist/util/index.js +92 -0
  250. package/dist/util/index.js.map +1 -0
  251. package/dist/util/map.d.ts +6 -0
  252. package/dist/util/map.d.ts.map +1 -0
  253. package/dist/util/map.js +26 -0
  254. package/dist/util/map.js.map +1 -0
  255. package/dist/util/pattern.d.ts +1 -0
  256. package/dist/util/pattern.d.ts.map +1 -0
  257. package/dist/util/pattern.js +11 -0
  258. package/dist/util/pattern.js.map +1 -0
  259. package/dist/util/time.d.ts +4 -0
  260. package/dist/util/time.d.ts.map +1 -0
  261. package/dist/util/time.js +41 -0
  262. package/dist/util/time.js.map +1 -0
  263. package/dist/util/uuid.d.ts +2 -0
  264. package/dist/util/uuid.d.ts.map +1 -0
  265. package/dist/util/uuid.js +8 -0
  266. package/dist/util/uuid.js.map +1 -0
  267. package/dist/util/wsl.d.ts +1 -0
  268. package/dist/util/wsl.d.ts.map +1 -0
  269. package/dist/util/wsl.js +14 -0
  270. package/dist/util/wsl.js.map +1 -0
  271. package/dist/webserver/backend/api.d.ts +3 -0
  272. package/dist/webserver/backend/api.d.ts.map +1 -0
  273. package/dist/webserver/backend/api.js +685 -0
  274. package/dist/webserver/backend/api.js.map +1 -0
  275. package/dist/webserver/backend/calendar.d.ts +5 -0
  276. package/dist/webserver/backend/calendar.d.ts.map +1 -0
  277. package/dist/webserver/backend/calendar.js +21 -0
  278. package/dist/webserver/backend/calendar.js.map +1 -0
  279. package/dist/webserver/backend/database.d.ts +149 -0
  280. package/dist/webserver/backend/database.d.ts.map +1 -0
  281. package/dist/webserver/backend/database.js +575 -0
  282. package/dist/webserver/backend/database.js.map +1 -0
  283. package/dist/webserver/backend/index.d.ts +31 -0
  284. package/dist/webserver/backend/index.d.ts.map +1 -0
  285. package/dist/webserver/backend/index.js +189 -0
  286. package/dist/webserver/backend/index.js.map +1 -0
  287. package/dist/webserver/backend/metrics.d.ts +3 -0
  288. package/dist/webserver/backend/metrics.d.ts.map +1 -0
  289. package/dist/webserver/backend/metrics.js +203 -0
  290. package/dist/webserver/backend/metrics.js.map +1 -0
  291. package/dist/webserver/backend/types.d.ts +115 -0
  292. package/dist/webserver/backend/types.d.ts.map +1 -0
  293. package/dist/webserver/backend/types.js +3 -0
  294. package/dist/webserver/backend/types.js.map +1 -0
  295. package/dist/webserver/backend/util.d.ts +2 -0
  296. package/dist/webserver/backend/util.d.ts.map +1 -0
  297. package/dist/webserver/backend/util.js +78 -0
  298. package/dist/webserver/backend/util.js.map +1 -0
  299. package/dist/webserver/index.d.ts +2 -0
  300. package/dist/webserver/index.d.ts.map +1 -0
  301. package/dist/webserver/index.js +9 -0
  302. package/dist/webserver/index.js.map +1 -0
  303. package/{src/webserver/frontend → frontend}/app.html +0 -0
  304. package/{src/webserver/frontend → frontend}/assets/fonts/GlacialIndifferenceBold.ttf +0 -0
  305. package/{src/webserver/frontend → frontend}/assets/fonts/GlacialIndifferenceItalic.otf +0 -0
  306. package/{src/webserver/frontend → frontend}/assets/fonts/GlacialIndifferenceMedium.otf +0 -0
  307. package/{src/webserver/frontend → frontend}/assets/fonts/GlacialIndifferenceRegular.ttf +0 -0
  308. package/{src/webserver/frontend → frontend}/assets/fonts/RobotoBold.ttf +0 -0
  309. package/{src/webserver/frontend → frontend}/assets/fonts/RobotoItalic.ttf +0 -0
  310. package/{src/webserver/frontend → frontend}/assets/fonts/RobotoRegular.ttf +0 -0
  311. package/{src/webserver/frontend → frontend}/assets/img/auth_bg.webp +0 -0
  312. package/{src/webserver/frontend → frontend}/assets/img/dark_bg.webp +0 -0
  313. package/{src/webserver/frontend → frontend}/assets/img/turkey.webp +0 -0
  314. package/{src/webserver/frontend → frontend}/auth.html +0 -0
  315. package/index.js +10 -2
  316. package/package.json +43 -15
  317. package/public/app.bundle.js +537 -73
  318. package/public/app.bundle.js.map +1 -1
  319. package/public/app.css +727 -2
  320. package/public/app.css.map +1 -1
  321. package/public/auth.bundle.js +18 -18
  322. package/public/auth.bundle.js.map +1 -1
  323. package/public/auth.css +364 -2
  324. package/public/auth.css.map +1 -1
  325. package/templates/rpc/README.md +29 -0
  326. package/templates/rpc/doc.json +7 -0
  327. package/templates/rpc/omegga_plugin +0 -0
  328. package/templates/rpc/plugin.json +4 -0
  329. package/templates/rpc/setup.sh +3 -0
  330. package/templates/safe/README.md +29 -0
  331. package/templates/safe/access.json +1 -0
  332. package/templates/safe/doc.json +7 -0
  333. package/templates/safe/omegga.plugin.js +20 -0
  334. package/templates/safe/plugin.json +4 -0
  335. package/templates/safe/setup.sh +4 -0
  336. package/templates/safe-ts/README.md +29 -0
  337. package/templates/safe-ts/access.json +1 -0
  338. package/templates/safe-ts/doc.json +7 -0
  339. package/templates/safe-ts/omegga.plugin.ts +29 -0
  340. package/templates/safe-ts/plugin.json +4 -0
  341. package/templates/safe-ts/setup.sh +4 -0
  342. package/templates/safe-ts/tsconfig.json +10 -0
  343. package/templates/unsafe/README.md +29 -0
  344. package/templates/unsafe/doc.json +7 -0
  345. package/templates/unsafe/omegga.main.js +15 -0
  346. package/templates/unsafe/plugin.json +4 -0
  347. package/templates/unsafe/setup.sh +4 -0
  348. package/.prettierrc +0 -7
  349. package/src/OMEGGA_LEGACY_INSTALL +0 -44
  350. package/src/brickadia/config.js +0 -42
  351. package/src/brickadia/server.js +0 -227
  352. package/src/cli/auth.js +0 -104
  353. package/src/cli/config.js +0 -77
  354. package/src/cli/index.js +0 -6
  355. package/src/cli/installer.js +0 -65
  356. package/src/cli/plugin.js +0 -575
  357. package/src/cli/terminal.js +0 -466
  358. package/src/config/authorizer.js +0 -37
  359. package/src/config/formats/format_js.js +0 -6
  360. package/src/config/formats/format_yml.js +0 -8
  361. package/src/config/index.js +0 -81
  362. package/src/config/reader.js +0 -27
  363. package/src/config/validator.js +0 -32
  364. package/src/config/writer.js +0 -20
  365. package/src/info/default_commands.json +0 -26
  366. package/src/lib.js +0 -23
  367. package/src/main.js +0 -332
  368. package/src/omegga/auth.js +0 -138
  369. package/src/omegga/commandInjector.js +0 -228
  370. package/src/omegga/index.js +0 -22
  371. package/src/omegga/logWrangler.js +0 -323
  372. package/src/omegga/matchers/auth.js +0 -49
  373. package/src/omegga/matchers/chat.js +0 -73
  374. package/src/omegga/matchers/command.js +0 -39
  375. package/src/omegga/matchers/exit.js +0 -19
  376. package/src/omegga/matchers/init.js +0 -23
  377. package/src/omegga/matchers/join.js +0 -115
  378. package/src/omegga/matchers/leave.js +0 -58
  379. package/src/omegga/matchers/mapChange.js +0 -37
  380. package/src/omegga/matchers/version.js +0 -45
  381. package/src/omegga/player.js +0 -585
  382. package/src/omegga/plugin/plugin_jsonrpc_stdio.js +0 -526
  383. package/src/omegga/plugin/plugin_node_safe/proxyOmegga.js +0 -117
  384. package/src/omegga/plugin/plugin_node_safe/worker.js +0 -238
  385. package/src/omegga/plugin/plugin_node_safe.js +0 -473
  386. package/src/omegga/plugin/plugin_node_unsafe.js +0 -177
  387. package/src/omegga/plugin.js +0 -565
  388. package/src/omegga/server.js +0 -658
  389. package/src/omegga/wrapper.js +0 -62
  390. package/src/softconfig.js +0 -64
  391. package/src/util/brick/checkBounds.js +0 -22
  392. package/src/util/brick/constants.js +0 -185
  393. package/src/util/brick/getBounds.js +0 -36
  394. package/src/util/brick/getBrickSize.js +0 -9
  395. package/src/util/brick/getScaleAxis.js +0 -31
  396. package/src/util/brick/index.js +0 -9
  397. package/src/util/brick/rotate.js +0 -43
  398. package/src/util/brick/setOwnership.js +0 -20
  399. package/src/util/chat.js +0 -28
  400. package/src/util/color.js +0 -143
  401. package/src/util/file.js +0 -118
  402. package/src/util/index.js +0 -28
  403. package/src/util/map.js +0 -28
  404. package/src/util/pattern.js +0 -14
  405. package/src/util/time.js +0 -46
  406. package/src/util/uuid.js +0 -8
  407. package/src/util/wsl.js +0 -9
  408. package/src/webserver/backend/api.js +0 -795
  409. package/src/webserver/backend/calendar.js +0 -15
  410. package/src/webserver/backend/database.js +0 -725
  411. package/src/webserver/backend/index.js +0 -206
  412. package/src/webserver/backend/metrics.js +0 -148
  413. package/src/webserver/backend/util.js +0 -75
  414. package/src/webserver/frontend/.eslintrc.yml +0 -26
  415. package/src/webserver/frontend/app.js +0 -78
  416. package/src/webserver/frontend/auth.js +0 -16
  417. package/src/webserver/frontend/components/Background.vue +0 -83
  418. package/src/webserver/frontend/components/Button.vue +0 -105
  419. package/src/webserver/frontend/components/ChatEntry.vue +0 -107
  420. package/src/webserver/frontend/components/ChatTime.vue +0 -40
  421. package/src/webserver/frontend/components/Dimmer.vue +0 -43
  422. package/src/webserver/frontend/components/Dropdown.vue +0 -145
  423. package/src/webserver/frontend/components/Footer.vue +0 -29
  424. package/src/webserver/frontend/components/Header.vue +0 -27
  425. package/src/webserver/frontend/components/InfiniteScroll.vue +0 -51
  426. package/src/webserver/frontend/components/Input.vue +0 -93
  427. package/src/webserver/frontend/components/ListInput.vue +0 -105
  428. package/src/webserver/frontend/components/Loader.vue +0 -98
  429. package/src/webserver/frontend/components/MainMenuButton.vue +0 -83
  430. package/src/webserver/frontend/components/Modal.vue +0 -44
  431. package/src/webserver/frontend/components/NavBar.vue +0 -24
  432. package/src/webserver/frontend/components/PlayerDropdown.vue +0 -210
  433. package/src/webserver/frontend/components/PopoutContent.vue +0 -32
  434. package/src/webserver/frontend/components/RoleDropdown.vue +0 -157
  435. package/src/webserver/frontend/components/Scroll.vue +0 -33
  436. package/src/webserver/frontend/components/Toggle.vue +0 -91
  437. package/src/webserver/frontend/components/index.js +0 -33
  438. package/src/webserver/frontend/css/font.scss +0 -53
  439. package/src/webserver/frontend/css/mixins.scss +0 -49
  440. package/src/webserver/frontend/css/style.scss +0 -166
  441. package/src/webserver/frontend/css/theme.scss +0 -64
  442. package/src/webserver/frontend/partials/NavHeader.vue +0 -55
  443. package/src/webserver/frontend/partials/Page.vue +0 -40
  444. package/src/webserver/frontend/partials/PageContent.vue +0 -31
  445. package/src/webserver/frontend/partials/SideNav.vue +0 -115
  446. package/src/webserver/frontend/partials/index.js +0 -4
  447. package/src/webserver/frontend/router.js +0 -83
  448. package/src/webserver/frontend/views/Auth.vue +0 -190
  449. package/src/webserver/frontend/views/History.vue +0 -462
  450. package/src/webserver/frontend/views/Home.vue +0 -251
  451. package/src/webserver/frontend/views/Main.vue +0 -69
  452. package/src/webserver/frontend/views/NotFound.vue +0 -10
  453. package/src/webserver/frontend/views/Players.vue +0 -425
  454. package/src/webserver/frontend/views/PlayersInspector.vue +0 -538
  455. package/src/webserver/frontend/views/Plugins.vue +0 -217
  456. package/src/webserver/frontend/views/PluginsInspector.vue +0 -418
  457. package/src/webserver/frontend/views/Server.vue +0 -167
  458. package/src/webserver/frontend/views/Users.vue +0 -538
  459. package/src/webserver/frontend/widgets/Chat.vue +0 -124
  460. package/src/webserver/frontend/widgets/Status.vue +0 -91
  461. package/src/webserver/frontend/widgets/index.js +0 -2
  462. package/src/webserver/frontend/widgets/tooltip.js +0 -108
  463. package/src/webserver/index.js +0 -4
package/src/cli/plugin.js DELETED
@@ -1,575 +0,0 @@
1
- const fs = require('fs');
2
- const path = require('path');
3
- const simpleGit = require('simple-git');
4
- const semver = require('semver');
5
- const util = require('util');
6
- const { exec: execNonPromise } = require('child_process');
7
- const exec = util.promisify(execNonPromise);
8
-
9
- require('colors');
10
-
11
- const soft = require('../softconfig.js');
12
- const pkg = require('../../package.json');
13
- const config = require('../config/index');
14
-
15
- const MAIN_BRANCHES = ['master', 'main'];
16
-
17
- // get the working directory for omegga
18
- function getWorkDir() {
19
- // default working directory is the one specified in config
20
- let workDir = config.store.get('defaultOmegga');
21
- verboseLog('Using working directory', workDir.yellow);
22
-
23
- // if there's a config in the current directory, use that one instead
24
- if (config.find('.')) workDir = '.';
25
-
26
- const confFile = config.find(workDir);
27
-
28
- return confFile
29
- ? path.resolve(process.cwd(), path.dirname(confFile))
30
- : undefined;
31
- }
32
-
33
- // plugin url transformers
34
- const transformers = [
35
- {
36
- // github transformer
37
- pattern: /^gh:(?<owner>[^/]+)\/(?<repo>[^/]+)$/,
38
- fn: ({ owner, repo }) => ({
39
- type: 'short',
40
- name: repo,
41
- url: `https://github.com/${owner}/omegga-${repo}`,
42
- }),
43
- },
44
- {
45
- // gitlab transformer
46
- pattern: /^gl:(?<owner>[^/]+)\/(?<repo>[^/]+)$/,
47
- fn: ({ owner, repo }) => ({
48
- type: 'short',
49
- name: repo,
50
- url: `https://gitlab.com/${owner}/omegga-${repo}`,
51
- }),
52
- },
53
- ];
54
-
55
- // convert a shortened url into a full length one
56
- const transformUrl = url => {
57
- const found = transformers.find(t => url.match(t.pattern));
58
- if (!found) return { type: 'raw', url };
59
- return found.fn(url.match(found.pattern).groups);
60
- };
61
-
62
- let needsNL = false;
63
-
64
- // rewrite a console line
65
- const rewriteLine = (...args) => {
66
- process.stdout.clearLine();
67
- process.stdout.cursorTo(0);
68
- process.stdout.write(args.join(' '));
69
- needsNL = true;
70
- };
71
-
72
- // logging helper functions
73
- const plg = (plugin, ...args) => {
74
- if (needsNL) {
75
- needsNL = false;
76
- console.log();
77
- }
78
- console.log(plugin.name, '>>'.green, ...args);
79
- };
80
- const plgLog = (plugin, ...args) => {
81
- if (global.VERBOSE) plg(plugin, ...args);
82
- else rewriteLine(plugin.name, '>>'.green, ...args);
83
- };
84
- const plgWarn = (plugin, ...args) => {
85
- if (needsNL) {
86
- needsNL = false;
87
- console.warn();
88
- }
89
- console.warn(plugin.name, 'W>'.yellow, ...args);
90
- };
91
- const plgErr = (plugin, ...args) => {
92
- if (needsNL) {
93
- needsNL = false;
94
- console.error();
95
- }
96
- console.error(plugin.name, '!>'.red, ...args);
97
- };
98
-
99
- const err = (...args) => {
100
- if (needsNL) {
101
- needsNL = false;
102
- console.error();
103
- }
104
- console.error('!>'.red, ...args);
105
- };
106
- const log = (...args) => {
107
- if (needsNL) {
108
- needsNL = false;
109
- console.log();
110
- }
111
- console.log('>>'.green, ...args);
112
- };
113
- const verboseLog = (...args) => {
114
- if (!global.VERBOSE) return;
115
- if (needsNL) {
116
- needsNL = false;
117
- console.log();
118
- }
119
- console.log('V>'.magenta, ...args);
120
- };
121
-
122
- function checkPlugin(omeggaPath, plugin) {
123
- const pluginPath = path.join(omeggaPath, soft.PLUGIN_PATH, plugin.name);
124
-
125
- // check for the plugin file, whatever it's called
126
- if (fs.existsSync(path.join(pluginPath, soft.PLUGIN_FILE))) {
127
- if (needsNL) {
128
- console.log();
129
- needsNL = false;
130
- }
131
- plgLog(plugin, 'Checking plugin file...');
132
- let data;
133
- try {
134
- data = JSON.parse(
135
- fs.readFileSync(path.join(pluginPath, soft.PLUGIN_FILE), 'utf8')
136
- );
137
- } catch (e) {
138
- plgErr(plugin, 'Error reading plugin file', e);
139
- return false;
140
- }
141
-
142
- // make sure this plugin version is okay.
143
- // in the future, this may include deprecation warnings and format changes
144
- if (data.formatVersion !== 1) {
145
- plgWarn(
146
- plugin,
147
- 'WARNING - Plugin file has invalid',
148
- 'formatVersion'.yellow + '. Expected',
149
- '1'.yellow
150
- );
151
- return;
152
- }
153
-
154
- // check the omeggaVersion field of the plugin file
155
- if (!data.omeggaVersion || !semver.validRange(data.omeggaVersion)) {
156
- plgWarn(
157
- plugin,
158
- 'WARNING - Plugin file has invalid',
159
- 'omeggaVersion'.yellow + '. Expected semver expression'
160
- );
161
- return false;
162
- } else if (!semver.satisfies(pkg.version, data.omeggaVersion)) {
163
- plgWarn(
164
- plugin,
165
- `WARNING - Plugin is not made for this version of omegga (${pkg.version.yellow} vs ${data.omeggaVersion.yellow})`
166
- );
167
- return false;
168
- }
169
-
170
- plgLog(plugin, 'Plugin file', 'OK'.green);
171
- return true;
172
- }
173
-
174
- // no plugin file, no problem!
175
- plgWarn(
176
- plugin,
177
- `WARNING - Plugin is missing plugin file (${soft.PLUGIN_FILE}), this may be a problem in future versions`
178
- );
179
- return true;
180
- }
181
-
182
- module.exports = {
183
- // install plugins from a list of plugins
184
- async install(plugins, _options) {
185
- const omeggaPath = getWorkDir();
186
- if (!omeggaPath)
187
- return err(
188
- 'Not an omegga directory, run ',
189
- 'omegga init'.yellow,
190
- 'to setup one.'
191
- );
192
-
193
- log('Attempting to install', (plugins.length + '').yellow, 'plugins...');
194
-
195
- for (const pluginUrl of plugins) {
196
- const plugin = transformUrl(pluginUrl);
197
-
198
- // if the plugin wasn't transformed, try to extract its name from the git url
199
- if (!('name' in plugin)) {
200
- try {
201
- const { name } = path.parse(plugin.url);
202
- plugin.name = name.replace(/^omegga-/, '');
203
- } catch (e) {
204
- console.error('!>'.red, 'Error parsing name from url', plugin.url);
205
- break;
206
- }
207
- }
208
-
209
- log(
210
- 'Installing plugin',
211
- plugin.name.yellow,
212
- 'from',
213
- plugin.url.yellow + '...'
214
- );
215
-
216
- // plugin absolute path
217
- const pluginPath = path.join(omeggaPath, soft.PLUGIN_PATH, plugin.name);
218
-
219
- // check if plugin already exists
220
- // TODO: if force is passed in, remove the old directory
221
- if (
222
- fs.existsSync(pluginPath) &&
223
- fs.existsSync(path.join(pluginPath, 'doc.json'))
224
- ) {
225
- plgErr(
226
- plugin,
227
- 'Directory already exists! Try',
228
- ('omegga update ' + plugin.name).yellow,
229
- 'or check for plugin name collisions'
230
- );
231
- continue;
232
- }
233
-
234
- if (!fs.existsSync(pluginPath)) {
235
- // create plugin local directory
236
- try {
237
- fs.mkdirSync(pluginPath, { recursive: true });
238
- } catch (e) {
239
- plgErr(plugin, 'Error creating plugin directory', e);
240
- }
241
- }
242
-
243
- // clone the plugin from git
244
- try {
245
- plgLog(plugin, 'Cloning...');
246
- const git = simpleGit(pluginPath);
247
- await git.clone(plugin.url, pluginPath);
248
- } catch (e) {
249
- plgErr(plugin, 'Error cloning plugin', e);
250
- }
251
-
252
- // check for the plugin file for issues
253
- // TODO: if force is passed in, ignore the plugin check
254
- if (!checkPlugin(omeggaPath, plugin)) continue;
255
-
256
- const postInstallPath = path.join(pluginPath, soft.PLUGIN_POSTINSTALL);
257
- if (fs.existsSync(postInstallPath)) {
258
- plgLog(plugin, 'Running post install script...');
259
- try {
260
- fs.chmodSync(postInstallPath, '0755');
261
- let { stdout, stderr } = await exec(postInstallPath, {
262
- cwd: pluginPath,
263
- shell: true,
264
- });
265
-
266
- if (stderr.length) plgErr(plugin, stderr);
267
-
268
- verboseLog(stdout);
269
- } catch (e) {
270
- plgErr(plugin, 'Error running post install script:', e);
271
- }
272
- }
273
- }
274
- },
275
-
276
- async update(plugins, _options) {
277
- const omeggaPath = getWorkDir();
278
- if (!omeggaPath)
279
- return err(
280
- 'Not an omegga directory, run ',
281
- 'omegga init'.yellow,
282
- 'to setup one.'
283
- );
284
-
285
- const pluginFolder = path.join(omeggaPath, soft.PLUGIN_PATH);
286
-
287
- // if no plugins are passed in, use every plugin in the plugins folder
288
- if (plugins.length === 0) {
289
- plugins = fs.readdirSync(pluginFolder);
290
- }
291
-
292
- plugins = plugins
293
- .map(dir => path.join(pluginFolder, dir))
294
- // every plugin must be in a directory
295
- .filter(
296
- dir =>
297
- fs.existsSync(dir) &&
298
- fs.lstatSync(dir).isDirectory() &&
299
- fs.existsSync(path.join(dir, '.git'))
300
- )
301
- .map(dir => ({ name: path.basename(dir) }));
302
-
303
- if (plugins.length === 0) {
304
- log('Found no plugins that can be updated');
305
- return;
306
- }
307
-
308
- log('Checking', (plugins.length + '').yellow, 'plugins for updates...');
309
-
310
- // list of plugins that will be updated
311
- let pluginsToUpdate = [];
312
-
313
- for (const plugin of plugins) {
314
- if (needsNL) {
315
- console.log();
316
- needsNL = false;
317
- }
318
- plgLog(plugin, 'Checking...');
319
- const pluginPath = path.join(pluginFolder, plugin.name);
320
- plugin.path = pluginPath;
321
- const git = simpleGit(pluginPath);
322
- plugin.git = git;
323
- if (!(await git.checkIsRepo())) {
324
- plgErr(plugin, 'No git repo detected');
325
- continue;
326
- }
327
-
328
- let status;
329
- // get git status
330
- try {
331
- status = await git.status();
332
- } catch (e) {
333
- plgErr(plugin, 'Error getting status', e);
334
- }
335
-
336
- try {
337
- // check for uncommitted changes
338
- if (status.files.some(f => f.working_dir !== '?')) {
339
- plgErr(plugin, 'Detected uncommitted changes - ignoring');
340
- continue;
341
- }
342
-
343
- const remotes = await git.getRemotes();
344
- const branches = await git.branch();
345
-
346
- // check if we're on a weird branch
347
- if (!MAIN_BRANCHES.includes(branches.current)) {
348
- plgErr(plugin, 'Not on a main branch - ignoring');
349
- continue;
350
- }
351
-
352
- // try to correct a weird detached branch
353
- if (
354
- remotes.length === 1 &&
355
- remotes[0].name === 'origin' &&
356
- !status.tracking
357
- ) {
358
- let skip = false;
359
- for (const branch of MAIN_BRANCHES) {
360
- if (
361
- branches.current === branch &&
362
- branches.branches[`remotes/origin/${branch}`]
363
- ) {
364
- plgLog(plugin, 'Correcting upstream...');
365
- try {
366
- await git.branch({ '--set-upstream-to': `origin/${branch}` });
367
- status = await git.status();
368
- break;
369
- } catch (e) {
370
- plgErr(
371
- plugin,
372
- 'Error getting status/fixing upstream branch',
373
- e
374
- );
375
- skip = true;
376
- break;
377
- }
378
- }
379
- }
380
- if (skip) continue;
381
- }
382
-
383
- // this should be corrected by the above check, though if it's not I am not fighting git lol
384
- if (!status.tracking) {
385
- plgErr(plugin, 'No upstream branch - ignoring');
386
- continue;
387
- }
388
-
389
- // local developers, publish your code please!!! :)
390
- if (remotes.length === 0) {
391
- plgErr(plugin, 'No remotes - ignoring');
392
- continue;
393
- }
394
-
395
- try {
396
- plgLog(plugin, 'Fetching...');
397
- await git.fetch();
398
- status = await git.status();
399
- } catch (e) {
400
- plgErr(plugin, 'Error fetching remote code', e);
401
- continue;
402
- }
403
-
404
- if (status.ahead > 0) {
405
- plgErr(plugin, 'Detected plugin is ahead - ignoring');
406
- continue;
407
- }
408
-
409
- if (status.behind === 0) {
410
- plgLog(plugin, 'Already up-to-date!'.green);
411
- continue;
412
- }
413
-
414
- plgLog(plugin, 'Update available');
415
- pluginsToUpdate.push(plugin);
416
- } catch (e) {
417
- plgErr(plugin, 'Error', e);
418
- }
419
- }
420
-
421
- if (pluginsToUpdate.length === 0) {
422
- log('All plugins are currently up-to-date');
423
- return;
424
- }
425
-
426
- log('Updating', (pluginsToUpdate.length + '').yellow, 'plugins...');
427
- let updates = 0;
428
-
429
- for (const plugin of pluginsToUpdate) {
430
- const { git } = plugin;
431
- if (needsNL) {
432
- console.log();
433
- needsNL = false;
434
- }
435
- plgLog(plugin, 'Creating backup branch...');
436
- try {
437
- const branches = await git.branch();
438
- const mainBranch =
439
- MAIN_BRANCHES.find(b => branches.branches[b]) ?? MAIN_BRANCHES[0];
440
- if (branches.branches['omegga-upgrade-backup']) {
441
- plgLog(plugin, 'Deleting leftover backup branch...');
442
- await git.deleteLocalBranch('omegga-upgrade-backup', true);
443
- }
444
- await git.checkoutBranch('omegga-upgrade-backup', mainBranch);
445
- await git.branch({ '--set-upstream-to': `origin/${mainBranch}` });
446
- await git.checkout(mainBranch);
447
- plgLog(plugin, 'Pulling update...');
448
- await git.pull();
449
- if ((await git.status()).behind > 0) {
450
- throw '- still behind?';
451
- }
452
- plgLog(plugin, 'Checking plugin versions...');
453
- if (!checkPlugin(omeggaPath, plugin)) {
454
- throw 'Incompatible';
455
- }
456
-
457
- const postInstallPath = path.join(plugin.path, soft.PLUGIN_POSTINSTALL);
458
- if (fs.existsSync(postInstallPath)) {
459
- plgLog(plugin, 'Running post install script...');
460
- try {
461
- fs.chmodSync(postInstallPath, '0755');
462
- let { stdout, stderr } = await exec(postInstallPath, {
463
- cwd: plugin.path,
464
- shell: true,
465
- });
466
-
467
- if (stderr.length) plgErr(plugin, stderr);
468
-
469
- verboseLog(stdout);
470
- } catch (e) {
471
- plgErr(plugin, 'Error running post install script:', e);
472
- }
473
- }
474
-
475
- plgLog(plugin, 'Updated!'.green);
476
- updates++;
477
- } catch (e) {
478
- plgErr(
479
- plugin,
480
- 'Error updating - attempting to restore from backup branch',
481
- e
482
- );
483
- try {
484
- const branches = await git.branch();
485
- if (!MAIN_BRANCHES.includes(branches.current)) {
486
- plgErr(
487
- plugin,
488
- 'Not on expected branch - exiting before I break more things'
489
- );
490
- continue;
491
- }
492
-
493
- const mainBranch =
494
- MAIN_BRANCHES.find(b => branches.branches[b]) ?? MAIN_BRANCHES[0];
495
-
496
- plg(plugin, 'Resetting current branch');
497
- await git.reset('hard');
498
- plgLog(plugin, 'Attempting to checkout backup branch');
499
- await git.checkout('omegga-upgrade-backup');
500
- plgLog(plugin, `Replacing ${mainBranch} with backup`);
501
- await git.deleteLocalBranch(mainBranch);
502
- await git.checkoutBranch(mainBranch, 'omegga-upgrade-backup');
503
- plgLog(plugin, 'Restored to backup branch');
504
-
505
- if ((await git.branch()) !== mainBranch) {
506
- plgErr(
507
- plugin,
508
- `Failed to checkout newly created ${mainBranch} branch`
509
- );
510
- continue;
511
- } else {
512
- plgWarn(plugin, 'Restored from backup and plugin not updated...');
513
- }
514
- } catch (e) {
515
- plgErr(plugin, 'Error restoring from backup... Whelp...');
516
- }
517
- continue;
518
- }
519
- }
520
-
521
- log('Updated', (updates + '').yellow, 'plugins!');
522
- },
523
-
524
- async check(plugins, _options) {
525
- const omeggaPath = getWorkDir();
526
- if (!omeggaPath)
527
- return err(
528
- 'Not an omegga directory, run ',
529
- 'omegga init'.yellow,
530
- 'to setup one.'
531
- );
532
-
533
- const pluginFolder = path.join(omeggaPath, soft.PLUGIN_PATH);
534
-
535
- // if no plugins are passed in, use every plugin in the plugins folder
536
- if (plugins.length === 0) {
537
- plugins = fs.readdirSync(pluginFolder);
538
- }
539
-
540
- plugins = plugins
541
- .map(dir => path.join(pluginFolder, dir))
542
- // every plugin must be in a directory
543
- .filter(
544
- dir =>
545
- fs.existsSync(dir) &&
546
- fs.lstatSync(dir).isDirectory() &&
547
- fs.existsSync(path.join(dir, '.git'))
548
- )
549
- .map(dir => ({ name: path.basename(dir) }));
550
-
551
- if (plugins.length === 0) {
552
- log('Found no plugins that can be checked');
553
- return;
554
- }
555
-
556
- log(
557
- 'Checking',
558
- (plugins.length + '').yellow,
559
- 'plugins for valid plugin files'
560
- );
561
-
562
- for (const plugin of plugins) {
563
- const pluginPath = path.join(pluginFolder, plugin.name);
564
- plugin.path = pluginPath;
565
- const git = simpleGit(pluginPath);
566
- plugin.git = git;
567
- if (!(await git.checkIsRepo())) {
568
- plgErr(plugin, 'No git repo detected');
569
- continue;
570
- }
571
- checkPlugin(omeggaPath, plugin);
572
- }
573
- console.log();
574
- },
575
- };