@azurioh/discord-kernel 0.1.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 (373) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +77 -0
  3. package/dist/authz/authorizer.d.ts +45 -0
  4. package/dist/authz/authorizer.d.ts.map +1 -0
  5. package/dist/authz/authorizer.js +31 -0
  6. package/dist/authz/authorizer.js.map +1 -0
  7. package/dist/authz/require-level-guard.d.ts +23 -0
  8. package/dist/authz/require-level-guard.d.ts.map +1 -0
  9. package/dist/authz/require-level-guard.js +37 -0
  10. package/dist/authz/require-level-guard.js.map +1 -0
  11. package/dist/clock.d.ts +13 -0
  12. package/dist/clock.d.ts.map +1 -0
  13. package/dist/clock.js +13 -0
  14. package/dist/clock.js.map +1 -0
  15. package/dist/concurrency/keyed-queue.d.ts +18 -0
  16. package/dist/concurrency/keyed-queue.d.ts.map +1 -0
  17. package/dist/concurrency/keyed-queue.js +37 -0
  18. package/dist/concurrency/keyed-queue.js.map +1 -0
  19. package/dist/concurrency/run-with-concurrency.d.ts +15 -0
  20. package/dist/concurrency/run-with-concurrency.d.ts.map +1 -0
  21. package/dist/concurrency/run-with-concurrency.js +40 -0
  22. package/dist/concurrency/run-with-concurrency.js.map +1 -0
  23. package/dist/config/env.d.ts +17 -0
  24. package/dist/config/env.d.ts.map +1 -0
  25. package/dist/config/env.js +49 -0
  26. package/dist/config/env.js.map +1 -0
  27. package/dist/config/errors.d.ts +14 -0
  28. package/dist/config/errors.d.ts.map +1 -0
  29. package/dist/config/errors.js +25 -0
  30. package/dist/config/errors.js.map +1 -0
  31. package/dist/datetime.d.ts +34 -0
  32. package/dist/datetime.d.ts.map +1 -0
  33. package/dist/datetime.js +188 -0
  34. package/dist/datetime.js.map +1 -0
  35. package/dist/discord/api-errors.d.ts +20 -0
  36. package/dist/discord/api-errors.d.ts.map +1 -0
  37. package/dist/discord/api-errors.js +90 -0
  38. package/dist/discord/api-errors.js.map +1 -0
  39. package/dist/discord/channel-exporter.d.ts +42 -0
  40. package/dist/discord/channel-exporter.d.ts.map +1 -0
  41. package/dist/discord/channel-exporter.js +3 -0
  42. package/dist/discord/channel-exporter.js.map +1 -0
  43. package/dist/discord/command/autocomplete-dispatcher.d.ts +26 -0
  44. package/dist/discord/command/autocomplete-dispatcher.d.ts.map +1 -0
  45. package/dist/discord/command/autocomplete-dispatcher.js +41 -0
  46. package/dist/discord/command/autocomplete-dispatcher.js.map +1 -0
  47. package/dist/discord/command/autocomplete.d.ts +18 -0
  48. package/dist/discord/command/autocomplete.d.ts.map +1 -0
  49. package/dist/discord/command/autocomplete.js +65 -0
  50. package/dist/discord/command/autocomplete.js.map +1 -0
  51. package/dist/discord/command/context.d.ts +33 -0
  52. package/dist/discord/command/context.d.ts.map +1 -0
  53. package/dist/discord/command/context.js +48 -0
  54. package/dist/discord/command/context.js.map +1 -0
  55. package/dist/discord/command/cooldown-guard.d.ts +25 -0
  56. package/dist/discord/command/cooldown-guard.d.ts.map +1 -0
  57. package/dist/discord/command/cooldown-guard.js +60 -0
  58. package/dist/discord/command/cooldown-guard.js.map +1 -0
  59. package/dist/discord/command/create-command.d.ts +100 -0
  60. package/dist/discord/command/create-command.d.ts.map +1 -0
  61. package/dist/discord/command/create-command.js +245 -0
  62. package/dist/discord/command/create-command.js.map +1 -0
  63. package/dist/discord/command/create-context-menu-command.d.ts +51 -0
  64. package/dist/discord/command/create-context-menu-command.d.ts.map +1 -0
  65. package/dist/discord/command/create-context-menu-command.js +128 -0
  66. package/dist/discord/command/create-context-menu-command.js.map +1 -0
  67. package/dist/discord/command/errors.d.ts +19 -0
  68. package/dist/discord/command/errors.d.ts.map +1 -0
  69. package/dist/discord/command/errors.js +27 -0
  70. package/dist/discord/command/errors.js.map +1 -0
  71. package/dist/discord/command/guard.d.ts +30 -0
  72. package/dist/discord/command/guard.d.ts.map +1 -0
  73. package/dist/discord/command/guard.js +34 -0
  74. package/dist/discord/command/guard.js.map +1 -0
  75. package/dist/discord/command/localization.d.ts +9 -0
  76. package/dist/discord/command/localization.d.ts.map +1 -0
  77. package/dist/discord/command/localization.js +13 -0
  78. package/dist/discord/command/localization.js.map +1 -0
  79. package/dist/discord/command/options.d.ts +113 -0
  80. package/dist/discord/command/options.d.ts.map +1 -0
  81. package/dist/discord/command/options.js +509 -0
  82. package/dist/discord/command/options.js.map +1 -0
  83. package/dist/discord/command/permission-guard.d.ts +21 -0
  84. package/dist/discord/command/permission-guard.d.ts.map +1 -0
  85. package/dist/discord/command/permission-guard.js +69 -0
  86. package/dist/discord/command/permission-guard.js.map +1 -0
  87. package/dist/discord/command/router.d.ts +48 -0
  88. package/dist/discord/command/router.d.ts.map +1 -0
  89. package/dist/discord/command/router.js +118 -0
  90. package/dist/discord/command/router.js.map +1 -0
  91. package/dist/discord/command/types.d.ts +51 -0
  92. package/dist/discord/command/types.d.ts.map +1 -0
  93. package/dist/discord/command/types.js +3 -0
  94. package/dist/discord/command/types.js.map +1 -0
  95. package/dist/discord/components/component-router.d.ts +116 -0
  96. package/dist/discord/components/component-router.d.ts.map +1 -0
  97. package/dist/discord/components/component-router.js +123 -0
  98. package/dist/discord/components/component-router.js.map +1 -0
  99. package/dist/discord/components/interactive-message/index.d.ts +3 -0
  100. package/dist/discord/components/interactive-message/index.d.ts.map +1 -0
  101. package/dist/discord/components/interactive-message/index.js +11 -0
  102. package/dist/discord/components/interactive-message/index.js.map +1 -0
  103. package/dist/discord/components/interactive-message/interactive-message-collector.d.ts +195 -0
  104. package/dist/discord/components/interactive-message/interactive-message-collector.d.ts.map +1 -0
  105. package/dist/discord/components/interactive-message/interactive-message-collector.js +151 -0
  106. package/dist/discord/components/interactive-message/interactive-message-collector.js.map +1 -0
  107. package/dist/discord/components/interactive-message/mount-interactive-message.d.ts +30 -0
  108. package/dist/discord/components/interactive-message/mount-interactive-message.d.ts.map +1 -0
  109. package/dist/discord/components/interactive-message/mount-interactive-message.js +44 -0
  110. package/dist/discord/components/interactive-message/mount-interactive-message.js.map +1 -0
  111. package/dist/discord/components/paginator/index.d.ts +5 -0
  112. package/dist/discord/components/paginator/index.d.ts.map +1 -0
  113. package/dist/discord/components/paginator/index.js +15 -0
  114. package/dist/discord/components/paginator/index.js.map +1 -0
  115. package/dist/discord/components/paginator/mount-paginator.d.ts +25 -0
  116. package/dist/discord/components/paginator/mount-paginator.d.ts.map +1 -0
  117. package/dist/discord/components/paginator/mount-paginator.js +41 -0
  118. package/dist/discord/components/paginator/mount-paginator.js.map +1 -0
  119. package/dist/discord/components/paginator/page-state.d.ts +21 -0
  120. package/dist/discord/components/paginator/page-state.d.ts.map +1 -0
  121. package/dist/discord/components/paginator/page-state.js +44 -0
  122. package/dist/discord/components/paginator/page-state.js.map +1 -0
  123. package/dist/discord/components/paginator/paginator-buttons.d.ts +17 -0
  124. package/dist/discord/components/paginator/paginator-buttons.d.ts.map +1 -0
  125. package/dist/discord/components/paginator/paginator-buttons.js +45 -0
  126. package/dist/discord/components/paginator/paginator-buttons.js.map +1 -0
  127. package/dist/discord/components/paginator/paginator-view.d.ts +26 -0
  128. package/dist/discord/components/paginator/paginator-view.d.ts.map +1 -0
  129. package/dist/discord/components/paginator/paginator-view.js +28 -0
  130. package/dist/discord/components/paginator/paginator-view.js.map +1 -0
  131. package/dist/discord/components/persistent-paginator.d.ts +47 -0
  132. package/dist/discord/components/persistent-paginator.d.ts.map +1 -0
  133. package/dist/discord/components/persistent-paginator.js +137 -0
  134. package/dist/discord/components/persistent-paginator.js.map +1 -0
  135. package/dist/discord/components/settings-editor/index.d.ts +7 -0
  136. package/dist/discord/components/settings-editor/index.d.ts.map +1 -0
  137. package/dist/discord/components/settings-editor/index.js +22 -0
  138. package/dist/discord/components/settings-editor/index.js.map +1 -0
  139. package/dist/discord/components/settings-editor/mount-settings-editor.d.ts +140 -0
  140. package/dist/discord/components/settings-editor/mount-settings-editor.d.ts.map +1 -0
  141. package/dist/discord/components/settings-editor/mount-settings-editor.js +344 -0
  142. package/dist/discord/components/settings-editor/mount-settings-editor.js.map +1 -0
  143. package/dist/discord/components/settings-editor/navigation.d.ts +49 -0
  144. package/dist/discord/components/settings-editor/navigation.d.ts.map +1 -0
  145. package/dist/discord/components/settings-editor/navigation.js +39 -0
  146. package/dist/discord/components/settings-editor/navigation.js.map +1 -0
  147. package/dist/discord/components/settings-editor/settings-editor-card.view.d.ts +56 -0
  148. package/dist/discord/components/settings-editor/settings-editor-card.view.d.ts.map +1 -0
  149. package/dist/discord/components/settings-editor/settings-editor-card.view.js +284 -0
  150. package/dist/discord/components/settings-editor/settings-editor-card.view.js.map +1 -0
  151. package/dist/discord/components/settings-editor/settings-editor-field-modal.d.ts +69 -0
  152. package/dist/discord/components/settings-editor/settings-editor-field-modal.d.ts.map +1 -0
  153. package/dist/discord/components/settings-editor/settings-editor-field-modal.js +353 -0
  154. package/dist/discord/components/settings-editor/settings-editor-field-modal.js.map +1 -0
  155. package/dist/discord/components/settings-editor/settings-editor-fields.d.ts +216 -0
  156. package/dist/discord/components/settings-editor/settings-editor-fields.d.ts.map +1 -0
  157. package/dist/discord/components/settings-editor/settings-editor-fields.js +66 -0
  158. package/dist/discord/components/settings-editor/settings-editor-fields.js.map +1 -0
  159. package/dist/discord/components/settings-editor/settings-editor.view.d.ts +303 -0
  160. package/dist/discord/components/settings-editor/settings-editor.view.d.ts.map +1 -0
  161. package/dist/discord/components/settings-editor/settings-editor.view.js +316 -0
  162. package/dist/discord/components/settings-editor/settings-editor.view.js.map +1 -0
  163. package/dist/discord/events/create-event.d.ts +5 -0
  164. package/dist/discord/events/create-event.d.ts.map +1 -0
  165. package/dist/discord/events/create-event.js +8 -0
  166. package/dist/discord/events/create-event.js.map +1 -0
  167. package/dist/discord/events/event-router.d.ts +16 -0
  168. package/dist/discord/events/event-router.d.ts.map +1 -0
  169. package/dist/discord/events/event-router.js +51 -0
  170. package/dist/discord/events/event-router.js.map +1 -0
  171. package/dist/discord/events/types.d.ts +16 -0
  172. package/dist/discord/events/types.d.ts.map +1 -0
  173. package/dist/discord/events/types.js +3 -0
  174. package/dist/discord/events/types.js.map +1 -0
  175. package/dist/discord/i18n.d.ts +58 -0
  176. package/dist/discord/i18n.d.ts.map +1 -0
  177. package/dist/discord/i18n.js +173 -0
  178. package/dist/discord/i18n.js.map +1 -0
  179. package/dist/discord/interaction/button.d.ts +39 -0
  180. package/dist/discord/interaction/button.d.ts.map +1 -0
  181. package/dist/discord/interaction/button.js +36 -0
  182. package/dist/discord/interaction/button.js.map +1 -0
  183. package/dist/discord/interaction/interaction-router.d.ts +21 -0
  184. package/dist/discord/interaction/interaction-router.d.ts.map +1 -0
  185. package/dist/discord/interaction/interaction-router.js +24 -0
  186. package/dist/discord/interaction/interaction-router.js.map +1 -0
  187. package/dist/discord/interaction/modal.d.ts +171 -0
  188. package/dist/discord/interaction/modal.d.ts.map +1 -0
  189. package/dist/discord/interaction/modal.js +264 -0
  190. package/dist/discord/interaction/modal.js.map +1 -0
  191. package/dist/discord/interaction/select-menu.d.ts +104 -0
  192. package/dist/discord/interaction/select-menu.d.ts.map +1 -0
  193. package/dist/discord/interaction/select-menu.js +126 -0
  194. package/dist/discord/interaction/select-menu.js.map +1 -0
  195. package/dist/discord/permissions.d.ts +32 -0
  196. package/dist/discord/permissions.d.ts.map +1 -0
  197. package/dist/discord/permissions.js +40 -0
  198. package/dist/discord/permissions.js.map +1 -0
  199. package/dist/discord/placeholder-registry-errors.d.ts +10 -0
  200. package/dist/discord/placeholder-registry-errors.d.ts.map +1 -0
  201. package/dist/discord/placeholder-registry-errors.js +18 -0
  202. package/dist/discord/placeholder-registry-errors.js.map +1 -0
  203. package/dist/discord/placeholder-registry.d.ts +53 -0
  204. package/dist/discord/placeholder-registry.d.ts.map +1 -0
  205. package/dist/discord/placeholder-registry.js +52 -0
  206. package/dist/discord/placeholder-registry.js.map +1 -0
  207. package/dist/discord/presenter.d.ts +26 -0
  208. package/dist/discord/presenter.d.ts.map +1 -0
  209. package/dist/discord/presenter.js +3 -0
  210. package/dist/discord/presenter.js.map +1 -0
  211. package/dist/discord/ui/card.d.ts +114 -0
  212. package/dist/discord/ui/card.d.ts.map +1 -0
  213. package/dist/discord/ui/card.js +162 -0
  214. package/dist/discord/ui/card.js.map +1 -0
  215. package/dist/discord/ui/color-input-errors.d.ts +12 -0
  216. package/dist/discord/ui/color-input-errors.d.ts.map +1 -0
  217. package/dist/discord/ui/color-input-errors.js +21 -0
  218. package/dist/discord/ui/color-input-errors.js.map +1 -0
  219. package/dist/discord/ui/color-input.d.ts +37 -0
  220. package/dist/discord/ui/color-input.d.ts.map +1 -0
  221. package/dist/discord/ui/color-input.js +166 -0
  222. package/dist/discord/ui/color-input.js.map +1 -0
  223. package/dist/discord/ui/colors.d.ts +44 -0
  224. package/dist/discord/ui/colors.d.ts.map +1 -0
  225. package/dist/discord/ui/colors.js +45 -0
  226. package/dist/discord/ui/colors.js.map +1 -0
  227. package/dist/discord/ui/embed.d.ts +16 -0
  228. package/dist/discord/ui/embed.d.ts.map +1 -0
  229. package/dist/discord/ui/embed.js +53 -0
  230. package/dist/discord/ui/embed.js.map +1 -0
  231. package/dist/discord/ui/message-attachments.d.ts +40 -0
  232. package/dist/discord/ui/message-attachments.d.ts.map +1 -0
  233. package/dist/discord/ui/message-attachments.js +27 -0
  234. package/dist/discord/ui/message-attachments.js.map +1 -0
  235. package/dist/errors/business-error.d.ts +41 -0
  236. package/dist/errors/business-error.d.ts.map +1 -0
  237. package/dist/errors/business-error.js +39 -0
  238. package/dist/errors/business-error.js.map +1 -0
  239. package/dist/errors/describe-error.d.ts +29 -0
  240. package/dist/errors/describe-error.d.ts.map +1 -0
  241. package/dist/errors/describe-error.js +49 -0
  242. package/dist/errors/describe-error.js.map +1 -0
  243. package/dist/errors/incident-ref.d.ts +7 -0
  244. package/dist/errors/incident-ref.d.ts.map +1 -0
  245. package/dist/errors/incident-ref.js +13 -0
  246. package/dist/errors/incident-ref.js.map +1 -0
  247. package/dist/errors/index.d.ts +4 -0
  248. package/dist/errors/index.d.ts.map +1 -0
  249. package/dist/errors/index.js +15 -0
  250. package/dist/errors/index.js.map +1 -0
  251. package/dist/i18n/business-message.d.ts +14 -0
  252. package/dist/i18n/business-message.d.ts.map +1 -0
  253. package/dist/i18n/business-message.js +19 -0
  254. package/dist/i18n/business-message.js.map +1 -0
  255. package/dist/i18n/catalog.d.ts +27 -0
  256. package/dist/i18n/catalog.d.ts.map +1 -0
  257. package/dist/i18n/catalog.js +25 -0
  258. package/dist/i18n/catalog.js.map +1 -0
  259. package/dist/i18n/errors.d.ts +10 -0
  260. package/dist/i18n/errors.d.ts.map +1 -0
  261. package/dist/i18n/errors.js +18 -0
  262. package/dist/i18n/errors.js.map +1 -0
  263. package/dist/i18n/index.d.ts +6 -0
  264. package/dist/i18n/index.d.ts.map +1 -0
  265. package/dist/i18n/index.js +16 -0
  266. package/dist/i18n/index.js.map +1 -0
  267. package/dist/i18n/locale.d.ts +22 -0
  268. package/dist/i18n/locale.d.ts.map +1 -0
  269. package/dist/i18n/locale.js +40 -0
  270. package/dist/i18n/locale.js.map +1 -0
  271. package/dist/i18n/translator.d.ts +35 -0
  272. package/dist/i18n/translator.d.ts.map +1 -0
  273. package/dist/i18n/translator.js +40 -0
  274. package/dist/i18n/translator.js.map +1 -0
  275. package/dist/logger.d.ts +28 -0
  276. package/dist/logger.d.ts.map +1 -0
  277. package/dist/logger.js +3 -0
  278. package/dist/logger.js.map +1 -0
  279. package/dist/module/module.d.ts +42 -0
  280. package/dist/module/module.d.ts.map +1 -0
  281. package/dist/module/module.js +3 -0
  282. package/dist/module/module.js.map +1 -0
  283. package/dist/persistence/database.d.ts +24 -0
  284. package/dist/persistence/database.d.ts.map +1 -0
  285. package/dist/persistence/database.js +3 -0
  286. package/dist/persistence/database.js.map +1 -0
  287. package/dist/resilience/retry.d.ts +36 -0
  288. package/dist/resilience/retry.d.ts.map +1 -0
  289. package/dist/resilience/retry.js +78 -0
  290. package/dist/resilience/retry.js.map +1 -0
  291. package/dist/scheduler/errors.d.ts +25 -0
  292. package/dist/scheduler/errors.d.ts.map +1 -0
  293. package/dist/scheduler/errors.js +45 -0
  294. package/dist/scheduler/errors.js.map +1 -0
  295. package/dist/scheduler/scheduler.d.ts +68 -0
  296. package/dist/scheduler/scheduler.d.ts.map +1 -0
  297. package/dist/scheduler/scheduler.js +162 -0
  298. package/dist/scheduler/scheduler.js.map +1 -0
  299. package/package.json +89 -0
  300. package/src/authz/authorizer.ts +76 -0
  301. package/src/authz/require-level-guard.ts +42 -0
  302. package/src/clock.ts +18 -0
  303. package/src/concurrency/keyed-queue.ts +50 -0
  304. package/src/concurrency/run-with-concurrency.ts +44 -0
  305. package/src/config/env.ts +58 -0
  306. package/src/config/errors.ts +21 -0
  307. package/src/datetime.ts +221 -0
  308. package/src/discord/api-errors.ts +91 -0
  309. package/src/discord/channel-exporter.ts +48 -0
  310. package/src/discord/command/autocomplete-dispatcher.ts +54 -0
  311. package/src/discord/command/autocomplete.ts +76 -0
  312. package/src/discord/command/context.ts +85 -0
  313. package/src/discord/command/cooldown-guard.ts +81 -0
  314. package/src/discord/command/create-command.ts +431 -0
  315. package/src/discord/command/create-context-menu-command.ts +227 -0
  316. package/src/discord/command/errors.ts +22 -0
  317. package/src/discord/command/guard.ts +54 -0
  318. package/src/discord/command/localization.ts +11 -0
  319. package/src/discord/command/options.ts +847 -0
  320. package/src/discord/command/permission-guard.ts +74 -0
  321. package/src/discord/command/router.ts +142 -0
  322. package/src/discord/command/types.ts +52 -0
  323. package/src/discord/components/component-router.ts +213 -0
  324. package/src/discord/components/interactive-message/index.ts +18 -0
  325. package/src/discord/components/interactive-message/interactive-message-collector.ts +374 -0
  326. package/src/discord/components/interactive-message/mount-interactive-message.ts +71 -0
  327. package/src/discord/components/paginator/index.ts +17 -0
  328. package/src/discord/components/paginator/mount-paginator.ts +69 -0
  329. package/src/discord/components/paginator/page-state.ts +45 -0
  330. package/src/discord/components/paginator/paginator-buttons.ts +60 -0
  331. package/src/discord/components/paginator/paginator-view.ts +61 -0
  332. package/src/discord/components/persistent-paginator.ts +197 -0
  333. package/src/discord/components/settings-editor/index.ts +41 -0
  334. package/src/discord/components/settings-editor/mount-settings-editor.ts +646 -0
  335. package/src/discord/components/settings-editor/navigation.ts +67 -0
  336. package/src/discord/components/settings-editor/settings-editor-card.view.ts +344 -0
  337. package/src/discord/components/settings-editor/settings-editor-field-modal.ts +538 -0
  338. package/src/discord/components/settings-editor/settings-editor-fields.ts +290 -0
  339. package/src/discord/components/settings-editor/settings-editor.view.ts +654 -0
  340. package/src/discord/events/create-event.ts +7 -0
  341. package/src/discord/events/event-router.ts +53 -0
  342. package/src/discord/events/types.ts +17 -0
  343. package/src/discord/i18n.ts +173 -0
  344. package/src/discord/interaction/button.ts +75 -0
  345. package/src/discord/interaction/interaction-router.ts +28 -0
  346. package/src/discord/interaction/modal.ts +505 -0
  347. package/src/discord/interaction/select-menu.ts +246 -0
  348. package/src/discord/permissions.ts +57 -0
  349. package/src/discord/placeholder-registry-errors.ts +11 -0
  350. package/src/discord/placeholder-registry.ts +77 -0
  351. package/src/discord/presenter.ts +26 -0
  352. package/src/discord/ui/card.ts +303 -0
  353. package/src/discord/ui/color-input-errors.ts +17 -0
  354. package/src/discord/ui/color-input.ts +179 -0
  355. package/src/discord/ui/colors.ts +58 -0
  356. package/src/discord/ui/embed.ts +64 -0
  357. package/src/discord/ui/message-attachments.ts +57 -0
  358. package/src/errors/business-error.ts +49 -0
  359. package/src/errors/describe-error.ts +73 -0
  360. package/src/errors/incident-ref.ts +10 -0
  361. package/src/errors/index.ts +12 -0
  362. package/src/i18n/business-message.ts +23 -0
  363. package/src/i18n/catalog.ts +41 -0
  364. package/src/i18n/errors.ts +11 -0
  365. package/src/i18n/index.ts +11 -0
  366. package/src/i18n/locale.ts +41 -0
  367. package/src/i18n/translator.ts +78 -0
  368. package/src/logger.ts +28 -0
  369. package/src/module/module.ts +42 -0
  370. package/src/persistence/database.ts +23 -0
  371. package/src/resilience/retry.ts +102 -0
  372. package/src/scheduler/errors.ts +40 -0
  373. package/src/scheduler/scheduler.ts +248 -0
@@ -0,0 +1 @@
1
+ {"version":3,"file":"settings-editor-fields.js","sourceRoot":"","sources":["../../../../src/discord/components/settings-editor/settings-editor-fields.ts"],"names":[],"mappings":";;;AAwMA,oCAIC;AASD,sCAUC;AAGD,oCAIC;AAiBD,wCAEC;AAGD,4CAEC;AAeD,sCAKC;AAGD,kCAYC;AA1FD,wFAAwF;AACxF,SAAgB,YAAY,CAC3B,KAA6B;IAE7B,OAAO,KAAK,CAAC,IAAI,KAAK,MAAM,IAAI,KAAK,CAAC,IAAI,KAAK,OAAO,CAAC;AACxD,CAAC;AAED;;;;;;GAMG;AACH,SAAgB,aAAa,CAC5B,KAA6B;IAE7B,OAAO,CACN,KAAK,CAAC,IAAI,KAAK,MAAM;QACrB,KAAK,CAAC,IAAI,KAAK,UAAU;QACzB,KAAK,CAAC,IAAI,KAAK,MAAM;QACrB,KAAK,CAAC,IAAI,KAAK,SAAS;QACxB,KAAK,CAAC,IAAI,KAAK,QAAQ,CACvB,CAAC;AACH,CAAC;AAED,4EAA4E;AAC5E,SAAgB,YAAY,CAC3B,KAA6B;IAE7B,OAAO,KAAK,CAAC,IAAI,KAAK,OAAO,CAAC;AAC/B,CAAC;AAgBD,yDAAyD;AACzD,SAAgB,cAAc,CAAC,KAAoB;IAClD,OAAO,EAAE,IAAI,EAAE,KAAK,EAAE,QAAQ,EAAE,KAAK,EAAE,MAAM,EAAE,EAAE,EAAE,CAAC;AACrD,CAAC;AAED,kGAAkG;AAClG,SAAgB,gBAAgB,CAAC,GAAsB;IACtD,OAAO,EAAE,IAAI,EAAE,IAAI,EAAE,QAAQ,EAAE,KAAK,EAAE,MAAM,EAAE,GAAG,EAAE,CAAC;AACrD,CAAC;AAED,qFAAqF;AACxE,QAAA,sBAAsB,GAAG,IAAI,CAAC;AAE3C;;;;;;GAMG;AACU,QAAA,oBAAoB,GAAG,CAAC,CAAC;AAEtC,mFAAmF;AACnF,SAAgB,aAAa,CAC5B,MAAyC,EACzC,KAAa;IAEb,OAAO,MAAM,CAAC,IAAI,CAAC,CAAC,KAAK,EAAE,EAAE,CAAC,KAAK,CAAC,GAAG,KAAK,KAAK,CAAC,CAAC;AACpD,CAAC;AAED,4CAA4C;AAC5C,SAAgB,WAAW,CAC1B,MAAyC,EACzC,GAAM;IAEN,MAAM,KAAK,GAAG,MAAM,CAAC,IAAI,CAAC,CAAC,KAAK,EAAE,EAAE,CAAC,KAAK,CAAC,GAAG,KAAK,GAAG,CAAC,CAAC;IACxD,IAAI,KAAK,KAAK,SAAS,EAAE,CAAC;QACzB,0EAA0E;QAC1E,4EAA4E;QAC5E,kBAAkB;QAClB,MAAM,IAAI,KAAK,CAAC,qCAAqC,GAAG,GAAG,CAAC,CAAC;IAC9D,CAAC;IACD,OAAO,KAAK,CAAC;AACd,CAAC"}
@@ -0,0 +1,303 @@
1
+ import { type ActionRowBuilder, EmbedBuilder, type MessageActionRowComponentBuilder, type MessageMentionOptions } from "discord.js";
2
+ import type { Clock } from "../../../clock";
3
+ import type { InteractiveMessagePayload, InteractiveView } from "../../../discord/components/interactive-message";
4
+ import { type SettingsEditorLevel, type SettingsEditorPath } from "../../../discord/components/settings-editor/navigation";
5
+ import { type SettingsEditorField } from "../../../discord/components/settings-editor/settings-editor-fields";
6
+ import { type Button, type ComponentContext } from "../../../discord/interaction/button";
7
+ import type { CardBlock } from "../../../discord/ui/card";
8
+ import type { MessageFile } from "../../../discord/ui/message-attachments";
9
+ import type { Locale, Translator } from "../../../i18n";
10
+ /**
11
+ * The row type this file's own rendering builds — and, since the card layout
12
+ * now renders its screen-level controls as an `ActionRow` beside its
13
+ * `Container` rather than a block inside it, the type
14
+ * `settings-editor-card.view.ts` builds the very same rows with too. Not a
15
+ * shape a caller outside this module ever has to match (unlike
16
+ * `SettingsEditorChrome.extraRows`, kept typed as
17
+ * `InteractiveMessagePayload["components"]` so tournament/ticket screens that
18
+ * implement it keep compiling unchanged).
19
+ */
20
+ export type SettingsEditorRow = ActionRowBuilder<MessageActionRowComponentBuilder>;
21
+ /**
22
+ * The custom ids of one editor's controls, namespaced by the screen mounting it.
23
+ *
24
+ * Local to a collector rather than entries in `component-ids.ts`: an editor is
25
+ * transient and owner-scoped, so none of these is ever routed by the persistent
26
+ * `ComponentRouter`. They are still kept distinct per screen — two editors that
27
+ * shared them would be indistinguishable in a log.
28
+ */
29
+ export declare function editorComponentIds(prefix: string): {
30
+ readonly field: `${string}:field-select`;
31
+ readonly reset: `${string}:reset`;
32
+ readonly resetConfirm: `${string}:reset-confirm`;
33
+ readonly resetCancel: `${string}:reset-cancel`;
34
+ readonly back: `${string}:back`;
35
+ };
36
+ export type SettingsEditorIds = ReturnType<typeof editorComponentIds>;
37
+ /** Discord refuses a select menu carrying more than this many options. */
38
+ export declare const MAX_SELECT_OPTIONS = 25;
39
+ /**
40
+ * Discord's cap on what one option shows — the same for its label and for the
41
+ * line under it.
42
+ */
43
+ export declare const MAX_SELECT_OPTION_TEXT = 100;
44
+ /**
45
+ * The outcome of the last action, and whether it went through.
46
+ *
47
+ * The two are told apart because they are not worth the same room. A
48
+ * confirmation is already visible where it matters — the preview under it
49
+ * shows the change — so at the root it goes unsaid rather than leaving an
50
+ * embed sitting there until the next action. A refusal has no other trace:
51
+ * nothing was written, the previous value stands, and only this says why.
52
+ */
53
+ export interface SettingsEditorNotice {
54
+ readonly text: string;
55
+ readonly tone: "confirmation" | "refusal";
56
+ }
57
+ /**
58
+ * The value {@link SettingsEditorState.confirming} carries while the editor's
59
+ * own reset is waiting for its second click — the one action every screen
60
+ * shares, so it is the one value the generic editor itself recognises. Any
61
+ * other value is a screen's own: an accessory button (a game's own "remove")
62
+ * that arms itself on the first click and fires on the second reads its own
63
+ * key back from `confirming`, and the generic editor never looks at it.
64
+ */
65
+ export declare const SETTINGS_EDITOR_RESET_CONFIRMING = "reset";
66
+ /**
67
+ * What every editor screen holds, whatever it is editing.
68
+ *
69
+ * `subject` is the screen's own business — the guild's settings for the panel,
70
+ * the shown ticket type for a welcome message — and the editor never looks
71
+ * inside it: it is handed back to the callbacks that read and write it.
72
+ */
73
+ export interface SettingsEditorState<S, A> {
74
+ readonly subject: S;
75
+ /**
76
+ * The uploaded images `subject` refers to, already loaded.
77
+ *
78
+ * The screen carries them itself, exactly as the published message does: an
79
+ * `attachment://` reference only resolves against the files of the very
80
+ * message it appears in, so a preview that did not carry them would show a
81
+ * broken image instead of what members see.
82
+ */
83
+ readonly assets: readonly A[];
84
+ /** Outcome of the last action. `null` until the first one. */
85
+ readonly notice: SettingsEditorNotice | null;
86
+ /**
87
+ * The action waiting for its second click, naming it — `null` while nothing
88
+ * is. {@link SETTINGS_EDITOR_RESET_CONFIRMING} is the editor's own; any other
89
+ * string is a screen's, for an accessory button that must not fire on a
90
+ * single misplaced click. A generic `string`, not a dedicated boolean, is
91
+ * what lets the two share the one field instead of a screen needing a
92
+ * confirmation flag of its own beside it.
93
+ *
94
+ * Held here rather than beside the collector because it is what the screen
95
+ * renders: while the editor's own reset is the one waiting, the question
96
+ * replaces the intro, the controls become the confirm/cancel pair, and the
97
+ * menu goes inert.
98
+ */
99
+ readonly confirming: string | null;
100
+ /**
101
+ * Where the screen currently is, outermost first. Never empty — the root is
102
+ * always its first entry.
103
+ */
104
+ readonly path: SettingsEditorPath;
105
+ }
106
+ /**
107
+ * What every screen's chrome states, whichever layout it renders in.
108
+ *
109
+ * Split from {@link SettingsEditorChrome} rather than folded into it: the two
110
+ * layout branches disagree on `preview`'s own return type and on which extra
111
+ * hooks make sense at all, so only what both answer identically belongs on a
112
+ * shared base.
113
+ */
114
+ interface SettingsEditorChromeCommon<S, A> {
115
+ readonly titleKey: string;
116
+ /**
117
+ * What the administrator is doing here, shown under the heading of a level
118
+ * below the root.
119
+ *
120
+ * Omitted by a screen with no depth: the root shows no heading of its own —
121
+ * the menu and the preview under it already say what the screen is for — so
122
+ * an intro declared by a flat screen would never be read.
123
+ */
124
+ readonly introKey?: string;
125
+ /**
126
+ * An extra block held under the intro for as long as the screen is on a level
127
+ * that shows one — the welcome editor's list of placeholders, which is worth
128
+ * nothing if it is only visible inside the modal.
129
+ */
130
+ readonly legend?: string;
131
+ /**
132
+ * The files the message must carry for `preview` to resolve.
133
+ *
134
+ * The editor holds the caller's assets without ever looking inside them —
135
+ * only the caller knows how one of its own assets maps to an attachment — so
136
+ * turning them into files is asked for here rather than assumed. A screen
137
+ * with no uploads returns an empty list and carries no asset concept at all.
138
+ */
139
+ filesOf(state: SettingsEditorState<S, A>): readonly MessageFile[];
140
+ /**
141
+ * Whether anything is customised — what makes the reset worth offering.
142
+ * Left out entirely by a screen with nothing a reset could put back (every
143
+ * setting it holds is one it cannot be without): its absence is what tells
144
+ * the editor this screen offers no reset at all, rather than a function
145
+ * that answers `false` and would have to be trusted never to drift from
146
+ * its own name.
147
+ */
148
+ hasOverrides?(subject: S): boolean;
149
+ /**
150
+ * Who the preview may notify. Stated by a screen whose preview renders text an
151
+ * administrator wrote: a `{staff}` expanded into real role mentions must never
152
+ * ping the team because somebody looked at it.
153
+ */
154
+ readonly allowedMentions?: MessageMentionOptions;
155
+ }
156
+ /**
157
+ * The embeds branch of {@link SettingsEditorChrome} — what every screen
158
+ * declared before the card layout existed.
159
+ *
160
+ * `layout` is optional here, and only here: a screen that predates the card
161
+ * layout names no layout at all, and must keep compiling unchanged. Add a
162
+ * `layout: "card"` key to a screen and it is this branch no longer.
163
+ */
164
+ export interface SettingsEditorEmbedsChrome<S, A> extends SettingsEditorChromeCommon<S, A> {
165
+ readonly layout?: "embeds";
166
+ readonly selectPlaceholderKey: string;
167
+ /** The embed under the screen's own, rendered from the subject. */
168
+ preview(state: SettingsEditorState<S, A>): EmbedBuilder;
169
+ /**
170
+ * Rows shown above the field menu — a type picker, a previewed button. Their
171
+ * behaviour, when they have any, is registered by the caller as an
172
+ * `InteractiveSelect`; this is only their rendering.
173
+ */
174
+ extraRows?(state: SettingsEditorState<S, A>, disabled: boolean): InteractiveMessagePayload["components"];
175
+ }
176
+ /**
177
+ * The card branch of {@link SettingsEditorChrome}: a screen rendered as one
178
+ * Components V2 card instead of two embeds and four rows of components.
179
+ *
180
+ * `preview` returns card blocks rather than an `EmbedBuilder` — spread
181
+ * straight into the card the editor builds — and `extraBlocks` replaces
182
+ * `extraRows` the same way, in the vocabulary a card understands instead of a
183
+ * message's own action rows.
184
+ */
185
+ export interface SettingsEditorCardChrome<S, A> extends SettingsEditorChromeCommon<S, A> {
186
+ readonly layout: "card";
187
+ /** The card's own blocks, rendered from the subject. */
188
+ preview(state: SettingsEditorState<S, A>): readonly (CardBlock<SettingsEditorState<S, A>> | null)[];
189
+ /**
190
+ * Blocks shown above the preview — a type picker, a previewed button. Their
191
+ * behaviour, when they have any, is registered by the caller as an
192
+ * `InteractiveSelect`; this is only their rendering.
193
+ */
194
+ extraBlocks?(state: SettingsEditorState<S, A>, disabled: boolean): readonly (CardBlock<SettingsEditorState<S, A>> | null)[];
195
+ /**
196
+ * How the root level offers its entries — the very meaning
197
+ * {@link import("../../../discord/components/settings-editor/navigation").SettingsEditorLevel.entryLayout}
198
+ * carries for every level below it, mirrored here for the one level that is
199
+ * never itself a `SettingsEditorLevel`. Defaults to `"sections"`.
200
+ */
201
+ readonly entryLayout?: "sections" | "buttons";
202
+ /**
203
+ * The buttons the screen adds to the end of the entries row of the current
204
+ * `"buttons"`-layout level — what acts on the entry shown there rather than
205
+ * on a setting, such as removing it. A card layout only, and only a
206
+ * `"buttons"` level: a `"sections"` level has no one row for this to join,
207
+ * each entry already carrying its own accessory.
208
+ *
209
+ * A screen's own action waiting on its second click takes the row over
210
+ * entirely rather than sharing it with the level's own buttons — the same
211
+ * rule the editor's own reset already follows for the row below the card
212
+ * (see `resetButtons`/`outerButtons`), applied here to a level's own
213
+ * entries instead: while `state.confirming` names anything at all, the row
214
+ * is exactly what this hook returns, nothing else. A hook telling apart its
215
+ * own key from another action's, or from the editor's own reset, is what
216
+ * lets it answer with the confirm/cancel pair only where it actually asked
217
+ * the question.
218
+ */
219
+ entryActions?(state: SettingsEditorState<S, A>): readonly Button<SettingsEditorState<S, A>>[];
220
+ }
221
+ /**
222
+ * How one screen dresses the generic editor.
223
+ *
224
+ * A discriminated union rather than one shape with an optional `layout`, for
225
+ * the same reason {@link InteractiveMessagePayload} is one: an embeds screen
226
+ * and a card screen answer different questions — a card's `preview` returns
227
+ * blocks, not an `EmbedBuilder`. Mixing the two shapes must fail to compile
228
+ * rather than build a chrome the editor cannot render.
229
+ */
230
+ export type SettingsEditorChrome<S, A> = SettingsEditorEmbedsChrome<S, A> | SettingsEditorCardChrome<S, A>;
231
+ /** What each button does. Supplied by the controller, which owns the writes. */
232
+ export interface SettingsEditorActions<S, A> {
233
+ /** Asks the question; it is `onConfirmReset` that writes. */
234
+ onReset: (ctx: ComponentContext<SettingsEditorState<S, A>>) => Promise<void>;
235
+ onConfirmReset: (ctx: ComponentContext<SettingsEditorState<S, A>>) => Promise<void>;
236
+ onCancelReset: (ctx: ComponentContext<SettingsEditorState<S, A>>) => Promise<void>;
237
+ /**
238
+ * Goes back to the level above. At the root there is nothing to undo, so the
239
+ * control is not rendered and this is never reached from there.
240
+ */
241
+ onReturn: (ctx: ComponentContext<SettingsEditorState<S, A>>) => Promise<void>;
242
+ }
243
+ /**
244
+ * The screen's buttons, grouped by the state that shows them — plus `all`, the
245
+ * set the collector routes on. The collector matches a click against the buttons
246
+ * it was mounted with, not against what is currently rendered, so a control
247
+ * missing from `all` would be a dead click whichever state put it up.
248
+ */
249
+ export interface SettingsEditorButtons<S, A> {
250
+ /**
251
+ * Rendered only where there is something to reset — see {@link resetButtons}.
252
+ * Nothing customised means the reset would write the values already stored:
253
+ * an alarming control that does nothing, and a confirmation asked over
254
+ * nothing. Absent rather than disabled, for the same reason the return
255
+ * control below is: a greyed control asks the reader to work out why it is
256
+ * there at all.
257
+ */
258
+ readonly reset: Button<SettingsEditorState<S, A>>;
259
+ readonly confirming: Button<SettingsEditorState<S, A>>[];
260
+ /** Rendered beside `reset` below the root. */
261
+ readonly returning: Button<SettingsEditorState<S, A>>[];
262
+ readonly all: Button<SettingsEditorState<S, A>>[];
263
+ }
264
+ export declare function createEditorButtons<S, A>(ids: SettingsEditorIds, translator: Translator, locale: Locale, actions: SettingsEditorActions<S, A>): SettingsEditorButtons<S, A>;
265
+ /**
266
+ * The reset control, but only where {@link SettingsEditorChrome.hasOverrides}
267
+ * says there is something to reset — the one piece of `buttons.reset`'s
268
+ * absence every layout builds the same way, so `createEditorView` and
269
+ * `createCardEditorView` agree on when it shows without repeating the check.
270
+ */
271
+ export declare function resetButtons<S, A>(buttons: SettingsEditorButtons<S, A>, chrome: SettingsEditorChrome<S, A>, state: SettingsEditorState<S, A>): Button<SettingsEditorState<S, A>>[];
272
+ /**
273
+ * What every embed the editor owns is signed with: the bot it comes from, and
274
+ * when the screen was last refreshed.
275
+ */
276
+ export interface SettingsEditorDressing {
277
+ readonly clock: Clock;
278
+ /**
279
+ * The bot's own avatar, beside the footer text. `null` when the client has no
280
+ * user to read it from — the footer is then text alone rather than a broken
281
+ * image.
282
+ */
283
+ readonly iconUrl: string | null;
284
+ }
285
+ /**
286
+ * The editor screen: a live preview of what is being edited, the controls that
287
+ * change it, and — where it has something to say — the screen's own embed above
288
+ * them.
289
+ *
290
+ * The preview is the screen's whole point, which is why it is rendered from the
291
+ * very resolution the published message goes through — that is the chrome's
292
+ * side of the bargain, not this one's.
293
+ */
294
+ export declare function createEditorView<S, A, F extends string>(ids: SettingsEditorIds, fields: readonly SettingsEditorField<F>[], levels: readonly SettingsEditorLevel<F>[] | undefined, buttons: SettingsEditorButtons<S, A>, chrome: SettingsEditorEmbedsChrome<S, A>, translator: Translator, locale: Locale, dressing: SettingsEditorDressing,
295
+ /**
296
+ * Whether this screen's `groupLegend` hook is declared at all — one hook for
297
+ * the whole screen, not per group, so every group here reserves the one
298
+ * component a legend would cost rather than validate against a budget only
299
+ * some of them will actually spend it against.
300
+ */
301
+ hasGroupLegend?: boolean): InteractiveView<SettingsEditorState<S, A>>;
302
+ export {};
303
+ //# sourceMappingURL=settings-editor.view.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"settings-editor.view.d.ts","sourceRoot":"","sources":["../../../../src/discord/components/settings-editor/settings-editor.view.ts"],"names":[],"mappings":"AAAA,OAAO,EACN,KAAK,gBAAgB,EACrB,YAAY,EACZ,KAAK,gCAAgC,EACrC,KAAK,qBAAqB,EAC1B,MAAM,YAAY,CAAC;AACpB,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,SAAS,CAAC;AACrC,OAAO,KAAK,EACX,yBAAyB,EACzB,eAAe,EACf,MAAM,0CAA0C,CAAC;AAClD,OAAO,EAIN,KAAK,mBAAmB,EACxB,KAAK,kBAAkB,EACvB,MAAM,iDAAiD,CAAC;AACzD,OAAO,EAGN,KAAK,mBAAmB,EAExB,MAAM,6DAA6D,CAAC;AAErE,OAAO,EACN,KAAK,MAAM,EACX,KAAK,gBAAgB,EAGrB,MAAM,8BAA8B,CAAC;AAEtC,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,mBAAmB,CAAC;AAEnD,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,kCAAkC,CAAC;AACpE,OAAO,KAAK,EAAE,MAAM,EAAE,UAAU,EAAE,MAAM,QAAQ,CAAC;AAEjD;;;;;;;;;GASG;AACH,MAAM,MAAM,iBAAiB,GAAG,gBAAgB,CAAC,gCAAgC,CAAC,CAAC;AAEnF;;;;;;;GAOG;AACH,wBAAgB,kBAAkB,CAAC,MAAM,EAAE,MAAM;;;;;;EAQhD;AAED,MAAM,MAAM,iBAAiB,GAAG,UAAU,CAAC,OAAO,kBAAkB,CAAC,CAAC;AAEtE,0EAA0E;AAC1E,eAAO,MAAM,kBAAkB,KAAK,CAAC;AAErC;;;GAGG;AACH,eAAO,MAAM,sBAAsB,MAAM,CAAC;AAwC1C;;;;;;;;GAQG;AACH,MAAM,WAAW,oBAAoB;IACpC,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB,QAAQ,CAA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S_EDITOR_RESET_CONFIRMING = exports.MAX_SELECT_OPTION_TEXT = exports.MAX_SELECT_OPTIONS = void 0;
4
+ exports.editorComponentIds = editorComponentIds;
5
+ exports.createEditorButtons = createEditorButtons;
6
+ exports.resetButtons = resetButtons;
7
+ exports.createEditorView = createEditorView;
8
+ const discord_js_1 = require("discord.js");
9
+ const navigation_1 = require("../../../discord/components/settings-editor/navigation");
10
+ const settings_editor_fields_1 = require("../../../discord/components/settings-editor/settings-editor-fields");
11
+ const i18n_1 = require("../../../discord/i18n");
12
+ const button_1 = require("../../../discord/interaction/button");
13
+ const select_menu_1 = require("../../../discord/interaction/select-menu");
14
+ const colors_1 = require("../../../discord/ui/colors");
15
+ /**
16
+ * The custom ids of one editor's controls, namespaced by the screen mounting it.
17
+ *
18
+ * Local to a collector rather than entries in `component-ids.ts`: an editor is
19
+ * transient and owner-scoped, so none of these is ever routed by the persistent
20
+ * `ComponentRouter`. They are still kept distinct per screen — two editors that
21
+ * shared them would be indistinguishable in a log.
22
+ */
23
+ function editorComponentIds(prefix) {
24
+ return {
25
+ field: `${prefix}:field-select`,
26
+ reset: `${prefix}:reset`,
27
+ resetConfirm: `${prefix}:reset-confirm`,
28
+ resetCancel: `${prefix}:reset-cancel`,
29
+ back: `${prefix}:back`,
30
+ };
31
+ }
32
+ /** Discord refuses a select menu carrying more than this many options. */
33
+ exports.MAX_SELECT_OPTIONS = 25;
34
+ /**
35
+ * Discord's cap on what one option shows — the same for its label and for the
36
+ * line under it.
37
+ */
38
+ exports.MAX_SELECT_OPTION_TEXT = 100;
39
+ /**
40
+ * Refuse a menu entry Discord would refuse, saying which one and how far over.
41
+ *
42
+ * A translated string is what overruns here: the English source can sit
43
+ * comfortably under the cap while the French runs a character past it, so the
44
+ * screen breaks in one language and not the other.
45
+ */
46
+ function assertFits(text, part, field, locale) {
47
+ if (text.length > exports.MAX_SELECT_OPTION_TEXT) {
48
+ throw new Error(`Settings editor field "${field}" has a ${locale} ${part} of ${text.length} characters; a select option carries ${exports.MAX_SELECT_OPTION_TEXT}. Shorten it: ${text}`);
49
+ }
50
+ }
51
+ /**
52
+ * Refuse a group whose modal Discord would refuse, naming the group and how
53
+ * far over it runs.
54
+ *
55
+ * `hasGroupLegend` reserves one slot of the budget whenever the screen
56
+ * declares a `groupLegend` hook at all — the hook is one per screen, not one
57
+ * per group, so a group that never actually gets a legend still budgets as if
58
+ * it might rather than pass only to overflow the day a legend is added to it.
59
+ */
60
+ function assertGroupFits(group, hasGroupLegend) {
61
+ const budget = hasGroupLegend ? settings_editor_fields_1.MAX_MODAL_COMPONENTS - 1 : settings_editor_fields_1.MAX_MODAL_COMPONENTS;
62
+ if (group.fields.length > budget) {
63
+ throw new Error(`Settings editor group "${group.key}" declares ${group.fields.length} member fields; a modal holds ${settings_editor_fields_1.MAX_MODAL_COMPONENTS}${hasGroupLegend ? " (one of which this screen reserves for a legend)" : ""}. It overflows by ${group.fields.length - budget}.`);
64
+ }
65
+ }
66
+ /**
67
+ * The value {@link SettingsEditorState.confirming} carries while the editor's
68
+ * own reset is waiting for its second click — the one action every screen
69
+ * shares, so it is the one value the generic editor itself recognises. Any
70
+ * other value is a screen's own: an accessory button (a game's own "remove")
71
+ * that arms itself on the first click and fires on the second reads its own
72
+ * key back from `confirming`, and the generic editor never looks at it.
73
+ */
74
+ exports.SETTINGS_EDITOR_RESET_CONFIRMING = "reset";
75
+ function createEditorButtons(ids, translator, locale, actions) {
76
+ const reset = (0, button_1.createButton)({
77
+ id: ids.reset,
78
+ label: translator.translate(locale, i18n_1.SETTINGS_EDITOR_MESSAGES.resetButton),
79
+ style: "danger",
80
+ onClick: actions.onReset,
81
+ });
82
+ // Cancel takes the slot the reset button just occupied, so a second reflex
83
+ // click on the same spot backs out instead of carrying the wipe through.
84
+ const confirming = [
85
+ (0, button_1.createButton)({
86
+ id: ids.resetCancel,
87
+ label: translator.translate(locale, i18n_1.SETTINGS_EDITOR_MESSAGES.resetCancelButton),
88
+ style: "secondary",
89
+ onClick: actions.onCancelReset,
90
+ }),
91
+ (0, button_1.createButton)({
92
+ id: ids.resetConfirm,
93
+ label: translator.translate(locale, i18n_1.SETTINGS_EDITOR_MESSAGES.resetConfirmButton),
94
+ emoji: "🗑️",
95
+ style: "danger",
96
+ onClick: actions.onConfirmReset,
97
+ }),
98
+ ];
99
+ const returning = [
100
+ (0, button_1.createButton)({
101
+ id: ids.back,
102
+ label: translator.translate(locale, i18n_1.SETTINGS_EDITOR_MESSAGES.backButton),
103
+ emoji: "◀️",
104
+ style: "secondary",
105
+ onClick: actions.onReturn,
106
+ }),
107
+ ];
108
+ // `all` carries the reset and return buttons whether or not the current
109
+ // state shows them: the collector routes on what it was mounted with, not
110
+ // on what is rendered.
111
+ return { reset, confirming, returning, all: [reset, ...confirming, ...returning] };
112
+ }
113
+ /**
114
+ * The reset control, but only where {@link SettingsEditorChrome.hasOverrides}
115
+ * says there is something to reset — the one piece of `buttons.reset`'s
116
+ * absence every layout builds the same way, so `createEditorView` and
117
+ * `createCardEditorView` agree on when it shows without repeating the check.
118
+ */
119
+ function resetButtons(buttons, chrome, state) {
120
+ return (chrome.hasOverrides?.(state.subject) ?? false) ? [buttons.reset] : [];
121
+ }
122
+ /**
123
+ * The editor screen: a live preview of what is being edited, the controls that
124
+ * change it, and — where it has something to say — the screen's own embed above
125
+ * them.
126
+ *
127
+ * The preview is the screen's whole point, which is why it is rendered from the
128
+ * very resolution the published message goes through — that is the chrome's
129
+ * side of the bargain, not this one's.
130
+ */
131
+ function createEditorView(ids, fields, levels, buttons, chrome, translator, locale, dressing,
132
+ /**
133
+ * Whether this screen's `groupLegend` hook is declared at all — one hook for
134
+ * the whole screen, not per group, so every group here reserves the one
135
+ * component a legend would cost rather than validate against a budget only
136
+ * some of them will actually spend it against.
137
+ */
138
+ hasGroupLegend = false) {
139
+ // None of the three varies with the state, so each is worded once instead of
140
+ // on every render.
141
+ const screenTitle = translator.translate(locale, chrome.titleKey);
142
+ const intro = chrome.introKey === undefined ? null : translator.translate(locale, chrome.introKey);
143
+ // Separates the levels in the heading trail.
144
+ const BREADCRUMB_SEPARATOR = " › ";
145
+ const body = [intro, chrome.legend].filter((part) => part !== undefined && part !== null);
146
+ // The root is a level like any other, named after the screen itself, so
147
+ // rendering never special-cases "no depth declared".
148
+ const root = { key: navigation_1.ROOT_LEVEL_KEY, titleKey: chrome.titleKey, fields };
149
+ const allLevels = [root, ...(levels ?? [])];
150
+ // A level's fields are authored, not accumulated: passing more than a menu can
151
+ // hold is a mistake in the declaration, and Discord would reject the whole
152
+ // message rather than show the first 25. Failing here names the level; failing
153
+ // at render time would only say the message was invalid.
154
+ //
155
+ // Lists that *grow* — a guild's ticket types, its permission grants — are the
156
+ // screen's own to page, through `extraRows`. See research D7.
157
+ for (const level of allLevels) {
158
+ if (level.fields.length > exports.MAX_SELECT_OPTIONS) {
159
+ throw new Error(`Settings editor level "${level.key}" declares ${level.fields.length} entries; a select menu holds ${exports.MAX_SELECT_OPTIONS}. Split it into a deeper level.`);
160
+ }
161
+ // Same reasoning, one level down: a translation over the cap makes the
162
+ // builder refuse the whole menu, and it does so with `CombinedPropertyError`
163
+ // — whose own message is the constant "Received one or more errors". Failing
164
+ // here names the entry, the locale and the length; failing at render time
165
+ // left a screen that would not open and a log that said nothing.
166
+ //
167
+ // It bites the translations rather than the English source, which is why it
168
+ // is checked per locale at build time rather than trusted once.
169
+ for (const field of level.fields) {
170
+ assertFits(translator.translate(locale, field.labelKey), "label", field.key, locale);
171
+ assertFits(translator.translate(locale, field.hintKey), "hint", field.key, locale);
172
+ if ((0, settings_editor_fields_1.isGroupField)(field)) {
173
+ assertGroupFits(field, hasGroupLegend);
174
+ }
175
+ }
176
+ }
177
+ // A path entry naming no declared level cannot happen — only a level field
178
+ // puts one there — but falling back to the root keeps a corrupted state
179
+ // showing a usable screen rather than an empty one.
180
+ function levelAt(key) {
181
+ return allLevels.find((level) => level.key === key) ?? root;
182
+ }
183
+ // One menu per level, built once: the options of a level never vary with the
184
+ // state, only which level is showing does.
185
+ const menus = new Map(allLevels.map((level) => [
186
+ level.key,
187
+ (0, select_menu_1.createStringSelect)({
188
+ id: ids.field,
189
+ placeholder: translator.translate(locale, chrome.selectPlaceholderKey),
190
+ options: level.fields.map((field) => ({
191
+ label: translator.translate(locale, field.labelKey),
192
+ value: field.key,
193
+ description: translator.translate(locale, field.hintKey),
194
+ })),
195
+ }),
196
+ ]));
197
+ function menuFor(state) {
198
+ return menus.get((0, navigation_1.currentLevelKey)(state.path)) ?? menus.get(navigation_1.ROOT_LEVEL_KEY);
199
+ }
200
+ /**
201
+ * Where the reader is, as a trail rather than only the current name: a level
202
+ * called "Roles" says nothing on its own about which type it belongs to.
203
+ */
204
+ function heading(state) {
205
+ return state.path
206
+ .map((key) => translator.translate(locale, levelAt(key).titleKey))
207
+ .join(BREADCRUMB_SEPARATOR);
208
+ }
209
+ /**
210
+ * How the embeds the editor owns are signed: the screen they belong to, the
211
+ * bot they come from, and when they were last rendered.
212
+ *
213
+ * A preview the chrome did not claim as its own is left out of this — it is
214
+ * the message members will see, and signing it would show the administrator
215
+ * something nobody else gets, on an embed whose footer is itself one of the
216
+ * fields being edited.
217
+ */
218
+ function dress(embed) {
219
+ return embed
220
+ .setFooter({
221
+ text: screenTitle,
222
+ ...(dressing.iconUrl === null ? {} : { iconURL: dressing.iconUrl }),
223
+ })
224
+ .setTimestamp(dressing.clock.now());
225
+ }
226
+ /**
227
+ * The screen's own embed, above the preview — or nothing at all.
228
+ *
229
+ * At the root it is dropped unless something was refused: the menu and the
230
+ * preview under it already say what the screen is for, so an intro repeating
231
+ * that on every render is a paragraph to read past on the way to one's own
232
+ * settings — and a confirmation is an embed that would then sit there,
233
+ * outliving what it confirms, until the next action. A level down it earns
234
+ * its place: it is what says where the administrator is, and it carries the
235
+ * legend the fields there need.
236
+ */
237
+ function headerEmbed(state) {
238
+ if (state.confirming === exports.SETTINGS_EDITOR_RESET_CONFIRMING) {
239
+ // The pending question takes the header outright: an intro inviting the
240
+ // administrator to pick a field would read as though the screen were
241
+ // still waiting for one.
242
+ return dress(new discord_js_1.EmbedBuilder()
243
+ .setColor(colors_1.EMBED_COLORS.brand)
244
+ .setTitle(translator.translate(locale, i18n_1.SETTINGS_EDITOR_MESSAGES.resetConfirmTitle))
245
+ .setDescription(translator.translate(locale, i18n_1.SETTINGS_EDITOR_MESSAGES.resetConfirmDescription)));
246
+ }
247
+ if (!(0, navigation_1.canReturn)(state.path)) {
248
+ // A confirmation goes unsaid here: the change it reports is already on
249
+ // screen, in the preview directly underneath.
250
+ return state.notice === null || state.notice.tone !== "refusal"
251
+ ? null
252
+ : dress(new discord_js_1.EmbedBuilder().setColor(colors_1.EMBED_COLORS.brand).setDescription(state.notice.text));
253
+ }
254
+ // Below the root the embed is up anyway, carrying the trail and the legend,
255
+ // so a confirmation costs no room of its own and rides along.
256
+ const description = [...(state.notice === null ? [] : [state.notice.text]), ...body];
257
+ const embed = dress(new discord_js_1.EmbedBuilder().setColor(colors_1.EMBED_COLORS.brand).setTitle(heading(state)));
258
+ return description.length === 0 ? embed : embed.setDescription(description.join("\n\n"));
259
+ }
260
+ /**
261
+ * The screen, top to bottom. The preview is always the last embed — the header
262
+ * above it is only there when it has something to say.
263
+ */
264
+ function embeds(state) {
265
+ const preview = chrome.preview(state);
266
+ const header = headerEmbed(state);
267
+ return header === null ? [preview] : [header, preview];
268
+ }
269
+ function controls(state, disabled) {
270
+ // The extra rows go inert with the rest while the question is up: the
271
+ // screen is asking one thing, and picking another subject underneath it
272
+ // would answer a different one.
273
+ const confirmingReset = state.confirming === exports.SETTINGS_EDITOR_RESET_CONFIRMING;
274
+ const extra = chrome.extraRows?.(state, disabled || confirmingReset) ?? [];
275
+ const menu = menuFor(state);
276
+ if (confirmingReset) {
277
+ return [
278
+ ...extra,
279
+ ...(menu === undefined ? [] : [(0, select_menu_1.createSelectRow)(menu, true)]),
280
+ (0, button_1.createActionRow)(buttons.confirming, state, { disableAll: disabled }),
281
+ ];
282
+ }
283
+ // The return control is absent at the root rather than disabled, and the
284
+ // reset is absent wherever `resetButtons` says there is nothing to reset:
285
+ // an enabled control that does nothing reads as a defect, and a greyed one
286
+ // asks the reader to work out why. With neither offered — a flat screen
287
+ // with nothing to reset — there is nothing left to put in this row at all,
288
+ // so it is left out rather than sent as an `ActionRow` with no button in it,
289
+ // which Discord refuses outright.
290
+ const row = [
291
+ ...resetButtons(buttons, chrome, state),
292
+ ...((0, navigation_1.canReturn)(state.path) ? buttons.returning : []),
293
+ ];
294
+ return [
295
+ ...extra,
296
+ ...(menu === undefined ? [] : [(0, select_menu_1.createSelectRow)(menu, disabled)]),
297
+ ...(row.length === 0 ? [] : [(0, button_1.createActionRow)(row, state, { disableAll: disabled })]),
298
+ ];
299
+ }
300
+ const mentions = chrome.allowedMentions === undefined ? {} : { allowedMentions: chrome.allowedMentions };
301
+ return {
302
+ render: (state) => ({
303
+ embeds: embeds(state),
304
+ components: controls(state, false),
305
+ // Always stated, empty included: this is the screen's whole set of
306
+ // attachments, and an update that said nothing would leave the image
307
+ // of an override that has just been cleared sitting on the message.
308
+ files: [...chrome.filesOf(state)],
309
+ ...mentions,
310
+ }),
311
+ // No `files`: neutralising the controls must leave the preview's image
312
+ // exactly where it is.
313
+ disabledControls: (state) => ({ components: controls(state, true) }),
314
+ };
315
+ }
316
+ //# sourceMappingURL=settings-editor.view.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"settings-editor.view.js","sourceRoot":"","sources":["../../../../src/discord/components/settings-editor/settings-editor.view.ts"],"names":[],"mappings":";;;AAyDA,gDAQC;AAkSD,kDA0CC;AAQD,oCAMC;AAyBD,4CAyNC;AA7oBD,2CAKoB;AAMpB,gFAMyD;AACzD,wGAKqE;AACrE,yCAA0D;AAC1D,yDAKsC;AACtC,mEAAwF;AAExF,gDAAmD;AAgBnD;;;;;;;GAOG;AACH,SAAgB,kBAAkB,CAAC,MAAc;IAChD,OAAO;QACN,KAAK,EAAE,GAAG,MAAM,eAAe;QAC/B,KAAK,EAAE,GAAG,MA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