commandkit 1.2.0-rc.10 → 1.2.0-rc.12

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 (360) hide show
  1. package/COPYING.md +684 -0
  2. package/dist/{ActionRow-DKnFVDME.d.ts → ActionRow-B-7n9MMr.d.ts} +3 -3
  3. package/dist/{ActionRow-CbdGFWMT.js → ActionRow-uJxU4UGo.js} +2 -2
  4. package/dist/ActionRow-uJxU4UGo.js.map +1 -0
  5. package/dist/{Button-4ZUXdA56.d.ts → Button-RMp-w8HV.d.ts} +4 -4
  6. package/dist/{ButtonKit-C7r7RPNf.d.ts → ButtonKit-9k4yfhYD.d.ts} +2 -2
  7. package/dist/{ChannelSelectMenuKit-BrXvBYNH.d.ts → ChannelSelectMenuKit-CsYgIyKe.d.ts} +3 -3
  8. package/dist/{CommandKitEventsChannel-BtRzr3Tz.js → CommandKitEventsChannel-2l9Za-le.js} +1 -1
  9. package/dist/{CommandKitEventsChannel-BtRzr3Tz.js.map → CommandKitEventsChannel-2l9Za-le.js.map} +1 -1
  10. package/dist/{CommandsRouter-CoOA7hkf.d.ts → CommandsRouter-CBdsqaWK.d.ts} +1 -1
  11. package/dist/{CommandsRouter-Dmzw-ikm.js → CommandsRouter-CWMipIis.js} +1 -1
  12. package/dist/{CommandsRouter-Dmzw-ikm.js.map → CommandsRouter-CWMipIis.js.map} +1 -1
  13. package/dist/{CompilerPlugin-M8r3yNAl.js → CompilerPlugin-CZ4412Zm.js} +2 -2
  14. package/dist/{CompilerPlugin-M8r3yNAl.js.map → CompilerPlugin-CZ4412Zm.js.map} +1 -1
  15. package/dist/{DefaultLogger-XCOl5nLd.d.ts → DefaultLogger-CHMVsizQ.d.ts} +2 -2
  16. package/dist/{EventInterceptor-CQEXyUTp.js → EventInterceptor-BWoEJMHZ.js} +1 -1
  17. package/dist/{EventInterceptor-CQEXyUTp.js.map → EventInterceptor-BWoEJMHZ.js.map} +1 -1
  18. package/dist/{EventWorkerContext-DNWfsE1t.d.ts → EventWorkerContext-CLhZRHhH.d.ts} +3 -3
  19. package/dist/{EventWorkerContext-Dq29tieI.js → EventWorkerContext-D_9q1Bm2.js} +1 -1
  20. package/dist/EventWorkerContext-D_9q1Bm2.js.map +1 -0
  21. package/dist/{EventsRouter-BacqK6z3.d.ts → EventsRouter-4pT6vj-U.d.ts} +1 -1
  22. package/dist/{EventsRouter-3Gygh-km.js → EventsRouter-C04XqRKf.js} +1 -1
  23. package/dist/{EventsRouter-3Gygh-km.js.map → EventsRouter-C04XqRKf.js.map} +1 -1
  24. package/dist/{ILogger-BW8GM-YZ.d.ts → ILogger-BQ2ew4zR.d.ts} +1 -1
  25. package/dist/{Logger-DyfkPk7u.d.ts → Logger-DyV7oli4.d.ts} +2 -2
  26. package/dist/{MentionableSelectMenuKit-CPTKqx-O.d.ts → MentionableSelectMenuKit-CO9phWMf.d.ts} +3 -3
  27. package/dist/{MessageCommandParser-Dl0xxtdr.js → MessageCommandParser-CKh-tM97.js} +52 -53
  28. package/dist/{MessageCommandParser-Dl0xxtdr.js.map → MessageCommandParser-CKh-tM97.js.map} +1 -1
  29. package/dist/{MessageCommandParser-BsGMOTDo.d.ts → MessageCommandParser-DEOl_ifb.d.ts} +1 -1
  30. package/dist/{Modal-C6UTRdYQ.d.ts → Modal-Calb46SJ.d.ts} +11 -8
  31. package/dist/{ModalKit-Btz58KYn.d.ts → ModalKit-Cq2ns6jv.d.ts} +2 -2
  32. package/dist/{PluginCommon-Cvl5yYM_.js → PluginCommon-CPWV5xuX.js} +1 -1
  33. package/dist/{PluginCommon-Cvl5yYM_.js.map → PluginCommon-CPWV5xuX.js.map} +1 -1
  34. package/dist/{RoleSelectMenuKit-C26lU3sN.d.ts → RoleSelectMenuKit-DvBxzpWh.d.ts} +3 -3
  35. package/dist/{RuntimePlugin-BUecuBIU.js → RuntimePlugin-COeXe8rP.js} +2 -2
  36. package/dist/{RuntimePlugin-BUecuBIU.js.map → RuntimePlugin-COeXe8rP.js.map} +1 -1
  37. package/dist/{SelectMenu-Diy87_ba.d.ts → SelectMenu-VcDhOGoJ.d.ts} +8 -8
  38. package/dist/{StringSelectMenuKit-Bhs8U6WI.d.ts → StringSelectMenuKit-CJ0MzUZJ.d.ts} +3 -3
  39. package/dist/{UserSelectMenuKit-CfqFJdxz.d.ts → UserSelectMenuKit-C_J-9RJs.d.ts} +3 -3
  40. package/dist/analytics/analytics-engine.d.ts +31 -29
  41. package/dist/analytics/analytics-engine.js +37 -34
  42. package/dist/analytics/analytics-provider.d.ts +31 -29
  43. package/dist/analytics/constants.js +1 -1
  44. package/dist/analytics/utils.js +37 -34
  45. package/dist/{analytics-engine-jVeSoxEk.d.ts → analytics-engine-NOInIjv8.d.ts} +30 -24
  46. package/dist/app/commands/AppCommandRunner.d.ts +31 -29
  47. package/dist/app/commands/AppCommandRunner.js +37 -34
  48. package/dist/app/commands/Context.d.ts +31 -29
  49. package/dist/app/commands/Context.js +37 -34
  50. package/dist/app/commands/MessageCommandParser.d.ts +1 -1
  51. package/dist/app/commands/MessageCommandParser.js +1 -1
  52. package/dist/app/commands/helpers.d.ts +1 -1
  53. package/dist/app/commands/helpers.js +1 -1
  54. package/dist/app/events/EventWorkerContext.d.ts +32 -30
  55. package/dist/app/events/EventWorkerContext.js +1 -1
  56. package/dist/app/handlers/AppCommandHandler.d.ts +31 -29
  57. package/dist/app/handlers/AppCommandHandler.js +37 -34
  58. package/dist/app/handlers/AppEventsHandler.d.ts +31 -29
  59. package/dist/app/handlers/AppEventsHandler.js +37 -34
  60. package/dist/app/index.d.ts +31 -29
  61. package/dist/app/index.js +38 -35
  62. package/dist/app/interrupt/signals.d.ts +1 -1
  63. package/dist/app/interrupt/signals.js +2 -2
  64. package/dist/app/middlewares/permissions.d.ts +31 -29
  65. package/dist/app/middlewares/permissions.js +37 -34
  66. package/dist/app/register/CommandRegistrar.d.ts +31 -29
  67. package/dist/app/register/CommandRegistrar.js +37 -34
  68. package/dist/app/router/CommandsRouter.d.ts +1 -1
  69. package/dist/app/router/CommandsRouter.js +1 -1
  70. package/dist/app/router/EventsRouter.d.ts +1 -1
  71. package/dist/app/router/EventsRouter.js +1 -1
  72. package/dist/app/router/index.d.ts +3 -3
  73. package/dist/app/router/index.js +3 -3
  74. package/dist/{app-process-cj2vF12T.js → app-process-AQ3Cbf6j.js} +4 -4
  75. package/dist/app-process-AQ3Cbf6j.js.map +1 -0
  76. package/dist/{build-DB_aX5xt.js → build-BYMHMOl_.js} +11 -12
  77. package/dist/{build-DB_aX5xt.js.map → build-BYMHMOl_.js.map} +1 -1
  78. package/dist/cli/app-process.js +5 -5
  79. package/dist/cli/build.d.ts +31 -29
  80. package/dist/cli/build.js +40 -37
  81. package/dist/cli/common.d.ts +31 -29
  82. package/dist/cli/common.js +3 -3
  83. package/dist/cli/development.js +41 -38
  84. package/dist/cli/development.js.map +1 -1
  85. package/dist/cli/env.js +1 -1
  86. package/dist/cli/generators.js +3 -3
  87. package/dist/cli/information.js +2 -2
  88. package/dist/cli/init.d.ts +1 -1
  89. package/dist/cli/init.js +38 -35
  90. package/dist/cli/production.js +43 -41
  91. package/dist/cli/production.js.map +1 -1
  92. package/dist/cli/type-checker.js +4 -4
  93. package/dist/cli/utils.js +1 -1
  94. package/dist/{commandkit-lhbfAyX9.js → commandkit-DabqpQ6v.js} +110 -69
  95. package/dist/commandkit-DabqpQ6v.js.map +1 -0
  96. package/dist/commandkit.d.ts +31 -29
  97. package/dist/commandkit.js +37 -34
  98. package/dist/{common-vnMIelAE.js → common-CCx-FJI4.js} +3 -3
  99. package/dist/common-CCx-FJI4.js.map +1 -0
  100. package/dist/{common-DOCvOVC4.d.ts → common-DHTTnX82.d.ts} +2 -2
  101. package/dist/{common-CrqwC-sx.js → common-fIO6fqGZ.js} +4 -5
  102. package/dist/{common-CrqwC-sx.js.map → common-fIO6fqGZ.js.map} +1 -1
  103. package/dist/components/common/EventInterceptor.js +1 -1
  104. package/dist/components/common/element.d.ts +3 -3
  105. package/dist/components/common/element.js +1 -1
  106. package/dist/components/common/types.js +1 -1
  107. package/dist/components/{v2 → display}/common.d.ts +1 -1
  108. package/dist/components/display/common.js +3 -0
  109. package/dist/components/display/container.d.ts +2 -0
  110. package/dist/components/display/container.js +4 -0
  111. package/dist/components/display/file.d.ts +2 -0
  112. package/dist/components/display/file.js +3 -0
  113. package/dist/components/display/index.d.ts +10 -0
  114. package/dist/components/display/index.js +23 -0
  115. package/dist/components/display/label.d.ts +2 -0
  116. package/dist/components/display/label.js +4 -0
  117. package/dist/components/{v2 → display}/media-gallery.d.ts +1 -1
  118. package/dist/components/{v2 → display}/media-gallery.js +2 -2
  119. package/dist/components/display/poll.d.ts +2 -0
  120. package/dist/components/display/poll.js +5 -0
  121. package/dist/components/display/section.d.ts +2 -0
  122. package/dist/components/display/section.js +5 -0
  123. package/dist/components/display/separator.d.ts +2 -0
  124. package/dist/components/display/separator.js +3 -0
  125. package/dist/components/display/text-display.d.ts +2 -0
  126. package/dist/components/display/text-display.js +3 -0
  127. package/dist/components/index.d.ts +25 -23
  128. package/dist/components/index.js +41 -35
  129. package/dist/components/interactive/action-row/ActionRow.d.ts +6 -0
  130. package/dist/components/interactive/action-row/ActionRow.js +3 -0
  131. package/dist/components/interactive/button/Button.d.ts +7 -0
  132. package/dist/components/interactive/button/Button.js +41 -0
  133. package/dist/components/{v1 → interactive}/button/ButtonKit.d.ts +1 -1
  134. package/dist/components/interactive/button/ButtonKit.js +41 -0
  135. package/dist/components/{v1 → interactive}/modal/Modal.d.ts +4 -4
  136. package/dist/components/interactive/modal/Modal.js +44 -0
  137. package/dist/components/{v1 → interactive}/modal/ModalKit.d.ts +1 -1
  138. package/dist/components/interactive/modal/ModalKit.js +41 -0
  139. package/dist/components/{v1 → interactive}/select-menu/ChannelSelectMenuKit.d.ts +2 -2
  140. package/dist/components/interactive/select-menu/ChannelSelectMenuKit.js +41 -0
  141. package/dist/components/{v1 → interactive}/select-menu/MentionableSelectMenuKit.d.ts +2 -2
  142. package/dist/components/interactive/select-menu/MentionableSelectMenuKit.js +41 -0
  143. package/dist/components/{v1 → interactive}/select-menu/RoleSelectMenuKit.d.ts +2 -2
  144. package/dist/components/interactive/select-menu/RoleSelectMenuKit.js +41 -0
  145. package/dist/components/{v1 → interactive}/select-menu/SelectMenu.d.ts +7 -7
  146. package/dist/components/interactive/select-menu/SelectMenu.js +46 -0
  147. package/dist/components/{v1 → interactive}/select-menu/StringSelectMenuKit.d.ts +2 -2
  148. package/dist/components/interactive/select-menu/StringSelectMenuKit.js +41 -0
  149. package/dist/components/{v1 → interactive}/select-menu/UserSelectMenuKit.d.ts +2 -2
  150. package/dist/components/interactive/select-menu/UserSelectMenuKit.js +41 -0
  151. package/dist/components/{v1 → interactive}/select-menu/common.d.ts +1 -1
  152. package/dist/components/interactive/select-menu/common.js +1 -0
  153. package/dist/config/config.d.ts +32 -30
  154. package/dist/config/config.js +37 -34
  155. package/dist/config/default.d.ts +31 -29
  156. package/dist/config/default.js +37 -34
  157. package/dist/config/loader.d.ts +31 -29
  158. package/dist/config/loader.js +37 -34
  159. package/dist/config/types.d.ts +31 -29
  160. package/dist/config/utils.d.ts +31 -29
  161. package/dist/config/utils.js +1 -1
  162. package/dist/{config-YAQdMBqh.d.ts → config-DbgXt6mf.d.ts} +2 -2
  163. package/dist/{constants-4oxxvaJA.js → constants-AH-9qJ89.js} +1 -1
  164. package/dist/{constants-4oxxvaJA.js.map → constants-AH-9qJ89.js.map} +1 -1
  165. package/dist/{constants-B5_Ta7PR.js → constants-BMWH2YUr.js} +1 -1
  166. package/dist/{constants-B5_Ta7PR.js.map → constants-BMWH2YUr.js.map} +1 -1
  167. package/dist/{constants-D8PMA9on.d.ts → constants-CCFSX2NG.d.ts} +1 -1
  168. package/dist/{constants-BOOGN85p.js → constants-D0dawKxO.js} +1 -1
  169. package/dist/{constants-BOOGN85p.js.map → constants-D0dawKxO.js.map} +1 -1
  170. package/dist/{constants-MKu-Q1jh.d.ts → constants-DqnSDZ6l.d.ts} +1 -1
  171. package/dist/{container-DHBELeJ3.d.ts → container-1ltvkavy.d.ts} +2 -2
  172. package/dist/{container-C6GtfAPW.js → container-DC0eQigs.js} +3 -3
  173. package/dist/container-DC0eQigs.js.map +1 -0
  174. package/dist/context/async-context.d.ts +31 -29
  175. package/dist/context/async-context.js +37 -34
  176. package/dist/context/environment.d.ts +31 -29
  177. package/dist/context/environment.js +37 -34
  178. package/dist/{dotprops-tnhpnszJ.js → dotprops-DvJUE8fw.js} +1 -1
  179. package/dist/{dotprops-tnhpnszJ.js.map → dotprops-DvJUE8fw.js.map} +1 -1
  180. package/dist/{element-CAXu1XtK.d.ts → element-CvNhvLZ8.d.ts} +3 -3
  181. package/dist/{element-Bak9llw_.js → element-DibzzA5L.js} +1 -1
  182. package/dist/element-DibzzA5L.js.map +1 -0
  183. package/dist/{env-_68PRRoA.js → env-8yY-6pbC.js} +1 -1
  184. package/dist/{env-_68PRRoA.js.map → env-8yY-6pbC.js.map} +1 -1
  185. package/dist/{error-codes-B4TyW4Ct.d.ts → error-codes-BiNRVMiV.d.ts} +1 -1
  186. package/dist/events/CommandKitEventsChannel.d.ts +31 -29
  187. package/dist/events/CommandKitEventsChannel.js +1 -1
  188. package/dist/{feature-flags-DnnKABHf.js → feature-flags-BoBV4Dsj.js} +4 -4
  189. package/dist/feature-flags-BoBV4Dsj.js.map +1 -0
  190. package/dist/{file-DVOELoNv.js → file-DAUOZYhC.js} +2 -2
  191. package/dist/file-DAUOZYhC.js.map +1 -0
  192. package/dist/{file-DTrr-p09.d.ts → file-n2yl_-vl.d.ts} +2 -2
  193. package/dist/flags/FlagProvider.d.ts +31 -29
  194. package/dist/flags/feature-flags.d.ts +31 -29
  195. package/dist/flags/feature-flags.js +38 -35
  196. package/dist/flags/store.d.ts +31 -29
  197. package/dist/flags/store.js +1 -1
  198. package/dist/{helpers-Dl8wW6aO.js → helpers-D2_1jih6.js} +1 -1
  199. package/dist/{helpers-Dl8wW6aO.js.map → helpers-D2_1jih6.js.map} +1 -1
  200. package/dist/{helpers-Wg6P5fRQ.d.ts → helpers-hDh_tMb6.d.ts} +1 -1
  201. package/dist/index.d.ts +42 -40
  202. package/dist/index.js +46 -39
  203. package/dist/index.js.map +1 -1
  204. package/dist/{init-CY7OJPF-.js → init-CBb0StSB.js} +11 -15
  205. package/dist/{init-CY7OJPF-.js.map → init-CBb0StSB.js.map} +1 -1
  206. package/dist/{init-DOr-Y3GQ.d.ts → init-DSYckXwx.d.ts} +1 -1
  207. package/dist/kv/constants.d.ts +1 -1
  208. package/dist/kv/constants.js +1 -1
  209. package/dist/kv/dotprops.js +1 -1
  210. package/dist/kv/kv.d.ts +2 -2
  211. package/dist/kv/kv.js +5 -7
  212. package/dist/kv/kv.js.map +1 -1
  213. package/dist/kv/serde.d.ts +2 -2
  214. package/dist/kv/serde.js +2 -2
  215. package/dist/label-D-uJWRZ0.js +36 -0
  216. package/dist/label-D-uJWRZ0.js.map +1 -0
  217. package/dist/label-D0KXeBhk.d.ts +29 -0
  218. package/dist/logger/DefaultLogger.d.ts +2 -2
  219. package/dist/logger/DefaultLogger.js +37 -34
  220. package/dist/logger/ILogger.d.ts +1 -1
  221. package/dist/logger/ILogger.js +1 -1
  222. package/dist/logger/Logger.d.ts +2 -2
  223. package/dist/logger/Logger.js +37 -34
  224. package/dist/logger/NoopLogger.d.ts +1 -1
  225. package/dist/{media-gallery-zDtJ3kxb.js → media-gallery-BLhwe5lO.js} +3 -3
  226. package/dist/media-gallery-BLhwe5lO.js.map +1 -0
  227. package/dist/{media-gallery-BMsXSot3.d.ts → media-gallery-BzG70ued.d.ts} +2 -2
  228. package/dist/plugins/CompilerPlugin.d.ts +31 -29
  229. package/dist/plugins/CompilerPlugin.js +2 -2
  230. package/dist/plugins/PluginCommon.d.ts +31 -29
  231. package/dist/plugins/PluginCommon.js +1 -1
  232. package/dist/plugins/RuntimePlugin.d.ts +31 -29
  233. package/dist/plugins/RuntimePlugin.js +2 -2
  234. package/dist/plugins/index.d.ts +31 -29
  235. package/dist/plugins/index.js +37 -34
  236. package/dist/plugins/plugin-runtime/CommandKitPluginRuntime.d.ts +31 -29
  237. package/dist/plugins/plugin-runtime/CommandKitPluginRuntime.js +37 -34
  238. package/dist/plugins/plugin-runtime/CompilerPluginRuntime.d.ts +31 -29
  239. package/dist/plugins/plugin-runtime/CompilerPluginRuntime.js +37 -34
  240. package/dist/plugins/plugin-runtime/builtin/CommonDirectiveTransformer.d.ts +31 -29
  241. package/dist/plugins/plugin-runtime/builtin/CommonDirectiveTransformer.js +37 -34
  242. package/dist/plugins/plugin-runtime/builtin/MacroPlugin.d.ts +31 -29
  243. package/dist/plugins/plugin-runtime/builtin/MacroPlugin.js +37 -34
  244. package/dist/plugins/plugin-runtime/runtime.d.ts +31 -29
  245. package/dist/plugins/plugin-runtime/runtime.js +1 -1
  246. package/dist/plugins/types.d.ts +31 -29
  247. package/dist/plugins/types.js +1 -1
  248. package/dist/poll-Bc6rjeUS.js +101 -0
  249. package/dist/poll-Bc6rjeUS.js.map +1 -0
  250. package/dist/poll-HnaJcB0o.d.ts +89 -0
  251. package/dist/{resolve-file-url-ChIyw-Vf.js → resolve-file-url-CJoD0FAn.js} +1 -1
  252. package/dist/{resolve-file-url-ChIyw-Vf.js.map → resolve-file-url-CJoD0FAn.js.map} +1 -1
  253. package/dist/{resolve-file-url-yO8bUxok.d.ts → resolve-file-url-DFtR8jRR.d.ts} +1 -1
  254. package/dist/{section-DlvrDoJK.js → section-BMcHN97i.js} +3 -3
  255. package/dist/section-BMcHN97i.js.map +1 -0
  256. package/dist/{section-Dh_FhPeC.d.ts → section-BOaJKXiy.d.ts} +2 -2
  257. package/dist/{separator-DL6QH5H1.js → separator-C___2K-f.js} +2 -2
  258. package/dist/separator-C___2K-f.js.map +1 -0
  259. package/dist/{separator-CMf6Cyy5.d.ts → separator-Cb7-6T6N.d.ts} +2 -2
  260. package/dist/{serde-BYaKrsOV.d.ts → serde-D4H23l2F.d.ts} +2 -2
  261. package/dist/{serde-Cc8iUa9J.js → serde-DHHwhltz.js} +2 -2
  262. package/dist/{serde-Cc8iUa9J.js.map → serde-DHHwhltz.js.map} +1 -1
  263. package/dist/{signals-ChFMD7mB.js → signals-Cnqe9dFV.js} +2 -2
  264. package/dist/{signals-ChFMD7mB.js.map → signals-Cnqe9dFV.js.map} +1 -1
  265. package/dist/{signals-SHg7J1U_.d.ts → signals-DBS60vTo.d.ts} +1 -1
  266. package/dist/{store-CM6pWVZh.js → store-ZwL2gN6a.js} +1 -1
  267. package/dist/{store-CM6pWVZh.js.map → store-ZwL2gN6a.js.map} +1 -1
  268. package/dist/{text-display-DRw3r_lK.d.ts → text-display-B_hpz50P.d.ts} +2 -2
  269. package/dist/{text-display-DbMumig_.js → text-display-BtQR88kY.js} +2 -2
  270. package/dist/text-display-BtQR88kY.js.map +1 -0
  271. package/dist/{type-checker-ocNSZh0W.js → type-checker-CEFHoQoV.js} +2 -2
  272. package/dist/{type-checker-ocNSZh0W.js.map → type-checker-CEFHoQoV.js.map} +1 -1
  273. package/dist/{types-package-BWArjyBF.js → types-package-D11rQXLs.js} +3 -4
  274. package/dist/{types-package-BWArjyBF.js.map → types-package-D11rQXLs.js.map} +1 -1
  275. package/dist/types.d.ts +32 -30
  276. package/dist/{utilities-DtdPlr4c.d.ts → utilities-CQUaua43.d.ts} +1 -1
  277. package/dist/utils/constants.d.ts +1 -1
  278. package/dist/utils/constants.js +1 -1
  279. package/dist/utils/dev-hooks.d.ts +31 -29
  280. package/dist/utils/dev-hooks.js +37 -34
  281. package/dist/utils/error-codes.d.ts +1 -1
  282. package/dist/utils/resolve-file-url.d.ts +1 -1
  283. package/dist/utils/resolve-file-url.js +1 -1
  284. package/dist/utils/types-package.js +2 -2
  285. package/dist/utils/useful-stuff/async-queue.js +1 -2
  286. package/dist/utils/useful-stuff/async-queue.js.map +1 -1
  287. package/dist/utils/useful-stuff/ratelimiter.js +1 -2
  288. package/dist/utils/useful-stuff/ratelimiter.js.map +1 -1
  289. package/dist/utils/useful-stuff/semaphore.js +1 -3
  290. package/dist/utils/useful-stuff/semaphore.js.map +1 -1
  291. package/dist/utils/utilities.d.ts +1 -1
  292. package/dist/utils/utilities.js +37 -34
  293. package/dist/utils/{warn-unstable.d.ts → warning.d.ts} +12 -3
  294. package/dist/utils/warning.js +5 -0
  295. package/dist/{utils-DCSnVAZ6.js → utils-Bf-3Eevb.js} +1 -1
  296. package/dist/{utils-DCSnVAZ6.js.map → utils-Bf-3Eevb.js.map} +1 -1
  297. package/dist/{utils-KsNof0Xz.js → utils-Br3eenD1.js} +1 -1
  298. package/dist/{utils-KsNof0Xz.js.map → utils-Br3eenD1.js.map} +1 -1
  299. package/dist/{version-BCILNeQb.js → version-DC4j2ZwU.js} +2 -2
  300. package/dist/{version-BCILNeQb.js.map → version-DC4j2ZwU.js.map} +1 -1
  301. package/dist/{version-CtJtBJXI.d.ts → version-DggMfP_1.d.ts} +1 -1
  302. package/dist/version.d.ts +1 -1
  303. package/dist/version.js +1 -1
  304. package/dist/warning-CszH8HeS.js +53 -0
  305. package/dist/warning-CszH8HeS.js.map +1 -0
  306. package/package.json +4 -4
  307. package/LICENSE +0 -5
  308. package/dist/ActionRow-CbdGFWMT.js.map +0 -1
  309. package/dist/EventWorkerContext-Dq29tieI.js.map +0 -1
  310. package/dist/app-process-cj2vF12T.js.map +0 -1
  311. package/dist/commandkit-lhbfAyX9.js.map +0 -1
  312. package/dist/common-vnMIelAE.js.map +0 -1
  313. package/dist/components/v1/action-row/ActionRow.d.ts +0 -6
  314. package/dist/components/v1/action-row/ActionRow.js +0 -3
  315. package/dist/components/v1/button/Button.d.ts +0 -7
  316. package/dist/components/v1/button/Button.js +0 -38
  317. package/dist/components/v1/button/ButtonKit.js +0 -38
  318. package/dist/components/v1/modal/Modal.js +0 -41
  319. package/dist/components/v1/modal/ModalKit.js +0 -38
  320. package/dist/components/v1/select-menu/ChannelSelectMenuKit.js +0 -38
  321. package/dist/components/v1/select-menu/MentionableSelectMenuKit.js +0 -38
  322. package/dist/components/v1/select-menu/RoleSelectMenuKit.js +0 -38
  323. package/dist/components/v1/select-menu/SelectMenu.js +0 -43
  324. package/dist/components/v1/select-menu/StringSelectMenuKit.js +0 -38
  325. package/dist/components/v1/select-menu/UserSelectMenuKit.js +0 -38
  326. package/dist/components/v1/select-menu/common.js +0 -1
  327. package/dist/components/v2/common.js +0 -3
  328. package/dist/components/v2/container.d.ts +0 -2
  329. package/dist/components/v2/container.js +0 -4
  330. package/dist/components/v2/file.d.ts +0 -2
  331. package/dist/components/v2/file.js +0 -3
  332. package/dist/components/v2/index.d.ts +0 -8
  333. package/dist/components/v2/index.js +0 -17
  334. package/dist/components/v2/section.d.ts +0 -2
  335. package/dist/components/v2/section.js +0 -5
  336. package/dist/components/v2/separator.d.ts +0 -2
  337. package/dist/components/v2/separator.js +0 -3
  338. package/dist/components/v2/text-display.d.ts +0 -2
  339. package/dist/components/v2/text-display.js +0 -3
  340. package/dist/container-C6GtfAPW.js.map +0 -1
  341. package/dist/element-Bak9llw_.js.map +0 -1
  342. package/dist/feature-flags-DnnKABHf.js.map +0 -1
  343. package/dist/file-DVOELoNv.js.map +0 -1
  344. package/dist/media-gallery-zDtJ3kxb.js.map +0 -1
  345. package/dist/section-DlvrDoJK.js.map +0 -1
  346. package/dist/separator-DL6QH5H1.js.map +0 -1
  347. package/dist/text-display-DbMumig_.js.map +0 -1
  348. package/dist/utils/warn-unstable.js +0 -26
  349. package/dist/utils/warn-unstable.js.map +0 -1
  350. /package/dist/{ILogger-dQ7Y9X1f.js → ILogger-B0q7p7L1.js} +0 -0
  351. /package/dist/{app-HN1cVg8J.js → app-CrjK9yWX.js} +0 -0
  352. /package/dist/{common-CcfjYnPG.js → common-0Iw8ZeM6.js} +0 -0
  353. /package/dist/{router-Dn35v30f.js → display-WDb9wMCv.js} +0 -0
  354. /package/dist/{index-CUPkUUOR.d.ts → index-B5F3AfVc.d.ts} +0 -0
  355. /package/dist/{index-Dw5cCt-A.d.ts → index-BLwMeReG.d.ts} +0 -0
  356. /package/dist/{index-E7Wvm5uX.d.ts → index-h64gcVNJ.d.ts} +0 -0
  357. /package/dist/{runtime-DB9CiPfe.js → router-BvamdzoF.js} +0 -0
  358. /package/dist/{types-CUZOquUl.js → runtime-Skt5NiOc.js} +0 -0
  359. /package/dist/{types-q0Nm882H.js → types-Cdh4uaFR.js} +0 -0
  360. /package/dist/{v2-DofkPKHs.js → types-TC4g3w91.js} +0 -0
@@ -1,4 +1,4 @@
1
- const require_dotprops = require('../dotprops-tnhpnszJ.js');
1
+ const require_dotprops = require('../dotprops-DvJUE8fw.js');
2
2
 
3
3
  exports.getNestedValue = require_dotprops.getNestedValue;
4
4
  exports.setNestedValue = require_dotprops.setNestedValue;
package/dist/kv/kv.d.ts CHANGED
@@ -1,5 +1,5 @@
1
- import "../constants-D8PMA9on.js";
2
- import { SerializedValue } from "../serde-BYaKrsOV.js";
1
+ import "../constants-CCFSX2NG.js";
2
+ import { SerializedValue } from "../serde-D4H23l2F.js";
3
3
  import { DatabaseSync } from "node:sqlite";
4
4
 
5
5
  //#region src/kv/kv.d.ts
package/dist/kv/kv.js CHANGED
@@ -1,7 +1,7 @@
1
1
  const require_chunk = require('../chunk-nOFOJqeH.js');
2
- require('../constants-4oxxvaJA.js');
3
- const require_dotprops = require('../dotprops-tnhpnszJ.js');
4
- const require_serde = require('../serde-Cc8iUa9J.js');
2
+ require('../constants-AH-9qJ89.js');
3
+ const require_dotprops = require('../dotprops-DvJUE8fw.js');
4
+ const require_serde = require('../serde-DHHwhltz.js');
5
5
  let node_sqlite = require("node:sqlite");
6
6
  node_sqlite = require_chunk.__toESM(node_sqlite);
7
7
 
@@ -141,8 +141,7 @@ var KV = class KV {
141
141
  this.delete(key);
142
142
  return;
143
143
  }
144
- const serialized = JSON.parse(result.value);
145
- const deserialized = require_serde.deserializer(serialized);
144
+ const deserialized = require_serde.deserializer(JSON.parse(result.value));
146
145
  if (key.includes(".")) return require_dotprops.getNestedValue(deserialized, key.split(".").slice(1).join("."));
147
146
  return deserialized;
148
147
  }
@@ -403,8 +402,7 @@ var KV = class KV {
403
402
  */
404
403
  values() {
405
404
  return this.statements.values.all(this.getCurrentTime()).map((row) => {
406
- const serialized = JSON.parse(row.value);
407
- return require_serde.deserializer(serialized);
405
+ return require_serde.deserializer(JSON.parse(row.value));
408
406
  });
409
407
  }
410
408
  /**
package/dist/kv/kv.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"kv.js","names":[],"sources":["../../src/kv/kv.ts"],"sourcesContent":["import { DatabaseSync, StatementSync } from 'node:sqlite';\nimport { deserializer, serializer } from './serde';\nimport { getNestedValue, setNestedValue } from './dotprops';\n\nexport type { SerializedValue } from './serde';\n\n/**\n * Mathematical operators supported by the KV math method\n */\nexport type KvMathOperator = '+' | '-' | '*' | '/' | '^' | '%';\n\n/**\n * Configuration options for the KV store\n */\nexport interface KvOptions {\n /** Enable Write-Ahead Logging for better performance and durability */\n enableWAL?: boolean;\n /** Namespace for the key-value store table */\n namespace?: string;\n}\n\n/**\n * A key-value store implementation using SQLite\n *\n * This class provides a simple, persistent key-value storage solution\n * with support for namespaces, automatic cleanup, iteration, expiration, and JSON serialization.\n *\n * @example\n * ```typescript\n * const kv = new KV('data.db');\n *\n * // Store any JSON-serializable data\n * kv.set('user:123', { name: 'John', age: 30 });\n * kv.set('counter', 42);\n * kv.set('active', true);\n * kv.set('dates', [new Date(), new Date()]);\n *\n * // Use dot notation for nested properties\n * kv.set('user:123.name', 'John');\n * kv.set('user:123.settings.theme', 'dark');\n *\n * // Retrieve data\n * const user = kv.get('user:123'); // { name: 'John', age: 30, settings: { theme: 'dark' } }\n * const name = kv.get('user:123.name'); // 'John'\n * ```\n */\nexport class KV implements Disposable, AsyncDisposable {\n private db: DatabaseSync;\n private statements: Record<string, StatementSync> = {};\n\n /**\n * Creates a new KV store instance\n *\n * @param path - Database file path, buffer, URL, or existing DatabaseSync instance\n * @param options - Configuration options for the KV store\n */\n public constructor(\n path: string | Buffer | URL | DatabaseSync,\n private options: KvOptions = {\n enableWAL: true,\n namespace: 'commandkit_kv',\n },\n ) {\n this.db =\n path instanceof DatabaseSync\n ? path\n : new DatabaseSync(path, { open: true });\n\n if (options.enableWAL) {\n this.db.exec(/* sql */ `PRAGMA journal_mode = WAL;`);\n }\n\n const namespace = this.options.namespace ?? 'commandkit_kv';\n\n this.db.exec(/* sql */ `\n CREATE TABLE IF NOT EXISTS ${namespace} (\n key TEXT PRIMARY KEY,\n value TEXT,\n expires_at INTEGER\n )\n `);\n\n this.statements = {\n get: this.db.prepare(\n /* sql */ `SELECT value, expires_at FROM ${namespace} WHERE key = ?`,\n ),\n set: this.db.prepare(\n /* sql */ `INSERT OR REPLACE INTO ${namespace} (key, value, expires_at) VALUES (?, ?, ?)`,\n ),\n setex: this.db.prepare(\n /* sql */ `INSERT OR REPLACE INTO ${namespace} (key, value, expires_at) VALUES (?, ?, ?)`,\n ),\n delete: this.db.prepare(\n /* sql */ `DELETE FROM ${namespace} WHERE key = ?`,\n ),\n has: this.db.prepare(\n /* sql */ `SELECT COUNT(*) FROM ${namespace} WHERE key = ? AND (expires_at IS NULL OR expires_at > ?)`,\n ),\n keys: this.db.prepare(\n /* sql */ `SELECT key FROM ${namespace} WHERE expires_at IS NULL OR expires_at > ?`,\n ),\n values: this.db.prepare(\n /* sql */ `SELECT value FROM ${namespace} WHERE expires_at IS NULL OR expires_at > ?`,\n ),\n clear: this.db.prepare(/* sql */ `DELETE FROM ${namespace}`),\n count: this.db.prepare(\n /* sql */ `SELECT COUNT(*) FROM ${namespace} WHERE expires_at IS NULL OR expires_at > ?`,\n ),\n all: this.db.prepare(\n /* sql */ `SELECT key, value FROM ${namespace} WHERE expires_at IS NULL OR expires_at > ?`,\n ),\n expire: this.db.prepare(\n /* sql */ `UPDATE ${namespace} SET expires_at = ? WHERE key = ?`,\n ),\n ttl: this.db.prepare(\n /* sql */ `SELECT expires_at FROM ${namespace} WHERE key = ?`,\n ),\n namespaces: this.db.prepare(\n /* sql */ `SELECT name FROM sqlite_master WHERE type = 'table' AND name NOT LIKE 'sqlite_%'`,\n ),\n begin: this.db.prepare(/* sql */ `BEGIN TRANSACTION`),\n commit: this.db.prepare(/* sql */ `COMMIT`),\n rollback: this.db.prepare(/* sql */ `ROLLBACK`),\n };\n }\n\n /**\n * Gets the current timestamp in milliseconds\n */\n private getCurrentTime(): number {\n return Date.now();\n }\n\n /**\n * Checks if the database connection is open\n *\n * @returns `true` if the database is open, `false` otherwise\n */\n public isOpen(): boolean {\n return this.db.isOpen;\n }\n\n /**\n * Gets the underlying SQLite database instance\n *\n * @returns The DatabaseSync instance\n */\n public getDatabase(): DatabaseSync {\n return this.db;\n }\n\n /**\n * Closes the database connection\n */\n public close(): void {\n if (this.db.isOpen) this.db.close();\n }\n\n /**\n * Disposable implementation - closes the database when disposed\n */\n public [Symbol.dispose]() {\n this.close();\n }\n\n /**\n * AsyncDisposable implementation - closes the database when disposed\n */\n public async [Symbol.asyncDispose]() {\n this.close();\n }\n\n /**\n * Retrieves a value by key\n *\n * @param key - The key to retrieve (supports dot notation for nested properties)\n * @returns The value associated with the key, or `undefined` if not found or expired\n *\n * @example\n * ```typescript\n * // Store an object\n * kv.set('user:123', { name: 'John', age: 30, settings: { theme: 'dark' } });\n *\n * // Get the entire object\n * const user = kv.get('user:123');\n * // { name: 'John', age: 30, settings: { theme: 'dark' } }\n *\n * // Get nested properties using dot notation\n * const name = kv.get('user:123.name'); // 'John'\n * const theme = kv.get('user:123.settings.theme'); // 'dark'\n * ```\n */\n public get<T = any>(key: string): T | undefined {\n const result = this.statements.get.get(key);\n\n if (!result) return undefined;\n\n // Check if the key has expired\n if (\n result.expires_at &&\n Number(result.expires_at) <= this.getCurrentTime()\n ) {\n this.delete(key);\n return undefined;\n }\n\n const serialized = JSON.parse(result.value as string);\n const deserialized = deserializer(serialized);\n\n // Handle dot notation for nested properties\n if (key.includes('.')) {\n return getNestedValue(deserialized, key.split('.').slice(1).join('.'));\n }\n\n return deserialized;\n }\n\n /**\n * Sets a key-value pair\n *\n * @param key - The key to set (supports dot notation for nested properties)\n * @param value - The value to associate with the key (any JSON-serializable type)\n *\n * @example\n * ```typescript\n * // Store primitive values\n * kv.set('counter', 42);\n * kv.set('active', true);\n * kv.set('name', 'John');\n *\n * // Store objects\n * kv.set('user:123', { name: 'John', age: 30 });\n *\n * // Store arrays\n * kv.set('tags', ['javascript', 'typescript', 'sqlite']);\n *\n * // Store dates\n * kv.set('created', new Date());\n *\n * // Store maps and sets\n * kv.set('permissions', new Map([['admin', true], ['user', false]]));\n * kv.set('unique_ids', new Set([1, 2, 3, 4, 5]));\n *\n * // Use dot notation for nested properties\n * kv.set('user:123.settings.theme', 'dark');\n * kv.set('user:123.settings.notifications', true);\n * ```\n */\n public set(key: string, value: any): void {\n let serializedValue: string;\n\n if (key.includes('.')) {\n // Handle dot notation for nested properties\n const [baseKey, ...pathParts] = key.split('.');\n const path = pathParts.join('.');\n\n // Get existing value or create new object\n const existing = this.get(baseKey) || {};\n setNestedValue(existing, path, value);\n\n const serialized = serializer(existing);\n serializedValue = JSON.stringify(serialized);\n\n this.statements.set.run(baseKey, serializedValue, null);\n } else {\n const serialized = serializer(value);\n serializedValue = JSON.stringify(serialized);\n\n this.statements.set.run(key, serializedValue, null);\n }\n }\n\n /**\n * Sets a key-value pair with expiration\n *\n * @param key - The key to set (supports dot notation for nested properties)\n * @param value - The value to associate with the key (any JSON-serializable type)\n * @param ttl - Time to live in milliseconds\n *\n * @example\n * ```typescript\n * // Set with 1 hour expiration\n * kv.setex('session:123', { userId: 123, token: 'abc123' }, 60 * 60 * 1000);\n *\n * // Set with 5 minutes expiration\n * kv.setex('temp:data', { cached: true, timestamp: Date.now() }, 5 * 60 * 1000);\n *\n * // Use dot notation with expiration\n * kv.setex('user:123.temp_settings', { theme: 'light' }, 30 * 60 * 1000);\n * ```\n */\n public setex(key: string, value: any, ttl: number): void {\n const expiresAt = this.getCurrentTime() + ttl;\n let serializedValue: string;\n\n if (key.includes('.')) {\n // Handle dot notation for nested properties\n const [baseKey, ...pathParts] = key.split('.');\n const path = pathParts.join('.');\n\n // Get existing value or create new object\n const existing = this.get(baseKey) || {};\n setNestedValue(existing, path, value);\n\n const serialized = serializer(existing);\n serializedValue = JSON.stringify(serialized);\n\n this.statements.setex.run(baseKey, serializedValue, expiresAt);\n } else {\n const serialized = serializer(value);\n serializedValue = JSON.stringify(serialized);\n\n this.statements.setex.run(key, serializedValue, expiresAt);\n }\n }\n\n /**\n * Performs mathematical operations on numeric values in the KV store\n *\n * @param key - The key to perform math operation on (supports dot notation for nested properties)\n * @param operator - The mathematical operator to apply\n * @param value - The value to use in the operation\n * @returns The updated value after the mathematical operation\n * @throws Error if the existing value is not numeric or if the operation is invalid\n *\n * @example\n * ```typescript\n * // Initialize a counter\n * kv.set('counter', 10);\n *\n * // Increment by 5\n * const result1 = kv.math('counter', '+', 5); // 15\n *\n * // Multiply by 2\n * const result2 = kv.math('counter', '*', 2); // 30\n *\n * // Use with bigint\n * kv.set('big_counter', BigInt(1000));\n * const result3 = kv.math('big_counter', '+', BigInt(500)); // 1500n\n *\n * // Use with dot notation\n * kv.set('user:123', { score: 100, level: 5 });\n * const result4 = kv.math('user:123.score', '+', 50); // 150\n * ```\n */\n public math(\n key: string,\n operator: KvMathOperator,\n value: number | bigint,\n ): number | bigint {\n const existingValue = this.get(key);\n\n if (existingValue === undefined) {\n throw new Error(`Key '${key}' does not exist`);\n }\n\n if (\n typeof existingValue !== 'number' &&\n typeof existingValue !== 'bigint'\n ) {\n throw new Error(\n `Value at key '${key}' is not numeric. Expected number or bigint, got ${typeof existingValue}`,\n );\n }\n\n // Handle mixed number/bigint operations by converting to bigint\n const isBigIntOperation =\n typeof existingValue === 'bigint' || typeof value === 'bigint';\n\n const existing = isBigIntOperation\n ? typeof existingValue === 'bigint'\n ? existingValue\n : BigInt(existingValue)\n : (existingValue as number);\n const operand = isBigIntOperation\n ? typeof value === 'bigint'\n ? value\n : BigInt(value)\n : (value as number);\n\n let result: number | bigint;\n\n switch (operator) {\n case '+':\n result = (existing as any) + (operand as any);\n break;\n case '-':\n result = (existing as any) - (operand as any);\n break;\n case '*':\n result = (existing as any) * (operand as any);\n break;\n case '/':\n if (operand === 0 || operand === 0n) {\n throw new Error('Division by zero');\n }\n result = (existing as any) / (operand as any);\n break;\n case '^':\n if (isBigIntOperation && operand < 0n) {\n throw new Error(\n 'Exponentiation with negative exponent is not supported for bigint',\n );\n }\n result = (existing as any) ** (operand as any);\n break;\n case '%':\n if (operand === 0 || operand === 0n) {\n throw new Error('Modulo by zero');\n }\n result = (existing as any) % (operand as any);\n break;\n default:\n throw new Error(`Invalid operator: ${operator}`);\n }\n\n // Update the value in the store\n this.set(key, result);\n\n return result;\n }\n\n /**\n * Sets expiration for an existing key\n *\n * @param key - The key to set expiration for\n * @param ttl - Time to live in milliseconds\n * @returns `true` if the key exists and expiration was set, `false` otherwise\n *\n * @example\n * ```typescript\n * kv.set('user:123', { name: 'John', age: 30 });\n *\n * // Set 30 minute expiration\n * if (kv.expire('user:123', 30 * 60 * 1000)) {\n * console.log('Expiration set successfully');\n * }\n * ```\n */\n public expire(key: string, ttl: number): boolean {\n if (!this.has(key)) return false;\n\n const expiresAt = this.getCurrentTime() + ttl;\n this.statements.expire.run(expiresAt, key);\n return true;\n }\n\n /**\n * Gets the time to live for a key\n *\n * @param key - The key to check\n * @returns Time to live in milliseconds, or `-1` if the key doesn't exist, or `-2` if the key has no expiration\n *\n * @example\n * ```typescript\n * const ttl = kv.ttl('user:123');\n * if (ttl > 0) {\n * console.log(`Key expires in ${ttl}ms`);\n * } else if (ttl === -2) {\n * console.log('Key has no expiration');\n * } else {\n * console.log('Key does not exist');\n * }\n * ```\n */\n public ttl(key: string): number {\n const result = this.statements.ttl.get(key);\n\n if (!result) return -1; // Key doesn't exist\n\n if (!result.expires_at) return -2; // No expiration\n\n const remaining = Number(result.expires_at) - this.getCurrentTime();\n return remaining > 0 ? remaining : -1; // Expired or doesn't exist\n }\n\n /**\n * Deletes a key-value pair\n *\n * @param key - The key to delete\n *\n * @example\n * ```typescript\n * kv.delete('user:123');\n * kv.delete('user:123.settings.theme'); // Delete nested property\n * ```\n */\n public delete(key: string): void {\n this.statements.delete.run(key);\n }\n\n /**\n * Checks if a key exists and is not expired\n *\n * @param key - The key to check\n * @returns `true` if the key exists and is not expired, `false` otherwise\n *\n * @example\n * ```typescript\n * if (kv.has('user:123')) {\n * console.log('User exists and is not expired');\n * }\n *\n * if (kv.has('user:123.settings.theme')) {\n * console.log('Theme setting exists');\n * }\n * ```\n */\n public has(key: string): boolean {\n const result = this.statements.has.get(key, this.getCurrentTime());\n\n return (\n result?.count !== undefined &&\n result.count !== null &&\n Number(result.count) > 0\n );\n }\n\n /**\n * Gets all keys in the current namespace (excluding expired keys)\n *\n * @returns Array of all non-expired keys\n *\n * @example\n * ```typescript\n * const keys = kv.keys();\n * console.log('All keys:', keys);\n * ```\n */\n public keys(): string[] {\n const result = this.statements.keys.all(this.getCurrentTime());\n\n return result.map((row) => row.key as string);\n }\n\n /**\n * Gets all values in the current namespace (excluding expired keys)\n *\n * @returns Array of all non-expired values\n *\n * @example\n * ```typescript\n * const values = kv.values();\n * console.log('All values:', values);\n * ```\n */\n public values(): any[] {\n const result = this.statements.values.all(this.getCurrentTime());\n\n return result.map((row) => {\n const serialized = JSON.parse(row.value as string);\n return deserializer(serialized);\n });\n }\n\n /**\n * Gets the total number of key-value pairs in the current namespace (excluding expired keys)\n *\n * @returns The count of non-expired key-value pairs\n *\n * @example\n * ```typescript\n * const count = kv.count();\n * console.log(`Total entries: ${count}`);\n * ```\n */\n public count(): number {\n const result = this.statements.count.get(this.getCurrentTime());\n\n return Number(result?.count ?? 0);\n }\n\n /**\n * Removes all key-value pairs from the current namespace\n *\n * @example\n * ```typescript\n * kv.clear(); // Removes all entries in current namespace\n * ```\n */\n public clear(): void {\n this.statements.clear.run();\n }\n\n /**\n * Gets all key-value pairs as an object (excluding expired keys)\n *\n * @returns Object with all non-expired key-value pairs\n *\n * @example\n * ```typescript\n * const all = kv.all();\n * console.log('All entries:', all);\n * // Output: { 'key1': value1, 'key2': value2 }\n * ```\n */\n public all(): Record<string, any> {\n const result = this.statements.all.all(this.getCurrentTime());\n\n return Object.fromEntries(\n result.map((row) => {\n const serialized = JSON.parse(row.value as string);\n return [row.key as string, deserializer(serialized)];\n }),\n );\n }\n\n /**\n * Gets all available namespaces (tables) in the database\n *\n * @returns Array of namespace names\n *\n * @example\n * ```typescript\n * const namespaces = kv.namespaces();\n * console.log('Available namespaces:', namespaces);\n * ```\n */\n public namespaces(): string[] {\n const result = this.statements.namespaces.all();\n\n return result.map((row) => row.name as string);\n }\n\n /**\n * Gets the current namespace name\n *\n * @returns The current namespace string\n */\n public getCurrentNamespace(): string {\n return this.options.namespace ?? 'commandkit_kv';\n }\n\n /**\n * Creates a new KV instance with a different namespace\n *\n * @param namespace - The namespace to use for the new instance\n * @returns A new KV instance with the specified namespace\n *\n * @example\n * ```typescript\n * const userKv = kv.namespace('users');\n * const configKv = kv.namespace('config');\n *\n * userKv.set('123', { name: 'John', age: 30 });\n * configKv.set('theme', 'dark');\n * ```\n */\n public namespace(namespace: string): KV {\n return new KV(this.db, {\n enableWAL: this.options.enableWAL,\n namespace,\n });\n }\n\n /**\n * Iterator implementation for iterating over all non-expired key-value pairs\n *\n * @returns Iterator yielding [key, value] tuples\n *\n * @example\n * ```typescript\n * for (const [key, value] of kv) {\n * console.log(`${key}:`, value);\n * }\n *\n * // Or using spread operator\n * const entries = [...kv];\n * ```\n */\n public *[Symbol.iterator](): Iterator<[string, any]> {\n const result = this.statements.all.iterate(this.getCurrentTime());\n\n for (const row of result) {\n const serialized = JSON.parse(row.value as string);\n yield [row.key as string, deserializer(serialized)];\n }\n }\n\n /**\n * Executes a function within a transaction\n *\n * @param fn - Function to execute within the transaction (can be async)\n * @returns The result of the function\n *\n * @example\n * ```typescript\n * // Synchronous transaction\n * kv.transaction(() => {\n * kv.set('user:123', { name: 'John', age: 30 });\n * kv.set('user:456', { name: 'Jane', age: 25 });\n * // If any operation fails, all changes are rolled back\n * });\n *\n * // Async transaction\n * await kv.transaction(async () => {\n * kv.set('user:123', { name: 'John', age: 30 });\n * await someAsyncOperation();\n * kv.set('user:456', { name: 'Jane', age: 25 });\n * // If any operation fails, all changes are rolled back\n * });\n * ```\n */\n public async transaction<T>(fn: () => T | Promise<T>): Promise<T> {\n try {\n // Begin transaction\n this.statements.begin.run();\n\n // Execute the function\n const result = await fn();\n\n // Commit transaction\n this.statements.commit.run();\n\n return result;\n } catch (error) {\n // Rollback transaction on error\n this.statements.rollback.run();\n throw error;\n }\n }\n}\n\n/**\n * Opens a new KV instance\n *\n * @param path - Database file path, buffer, URL, or existing DatabaseSync instance\n * @param options - Configuration options for the KV store\n * @returns A new KV instance\n */\nexport function openKV(\n path: string | Buffer | URL | DatabaseSync = 'commandkit_kv.db',\n options: KvOptions = { enableWAL: true, namespace: 'commandkit_kv' },\n): KV {\n return new KV(path, options);\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA8CA,IAAa,KAAb,MAAa,GAA0C;CACrD,AAAQ;CACR,AAAQ,aAA4C,EAAE;;;;;;;CAQtD,AAAO,YACP,MACA,AAAQ,UAAqB;EAC3B,WAAW;EACX,WAAW;EACZ,EACD;EAJQ;AAKN,OAAK,KACL,gBAAgB,2BAChB,OACA,IAAI,yBAAa,MAAM,EAAE,MAAM,MAAM,CAAC;AAEtC,MAAI,QAAQ,UACV,MAAK,GAAG,KAAc,6BAA6B;EAGrD,MAAM,YAAY,KAAK,QAAQ,aAAa;AAE5C,OAAK,GAAG,KAAc;mCACS,UAAU;;;;;MAKvC;AAEF,OAAK,aAAa;GAChB,KAAK,KAAK,GAAG,QACF,iCAAiC,UAAU,gBACrD;GACD,KAAK,KAAK,GAAG,QACF,0BAA0B,UAAU,4CAC9C;GACD,OAAO,KAAK,GAAG,QACJ,0BAA0B,UAAU,4CAC9C;GACD,QAAQ,KAAK,GAAG,QACL,eAAe,UAAU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e,KAAK,WAAW,WAAW,KAAK,CAEjC,KAAK,QAAQ,IAAI,KAAe;;;;;;;CAQhD,AAAO,sBAA8B;AACnC,SAAO,KAAK,QAAQ,aAAa;;;;;;;;;;;;;;;;;CAkBnC,AAAO,UAAU,WAAuB;AACtC,SAAO,IAAI,GAAG,KAAK,IAAI;GACrB,WAAW,KAAK,QAAQ;GACxB;GACD,CAAC;;;;;;;;;;;;;;;;;CAkBJ,EAAS,OAAO,YAAqC;EACnD,MAAM,SAAS,KAAK,WAAW,IAAI,QAAQ,KAAK,gBAAgB,CAAC;AAEjE,OAAK,MAAM,OAAO,QAAQ;GACxB,MAAM,aAAa,KAAK,MAAM,IAAI,MAAgB;AAClD,SAAM,CAAC,IAAI,KAAe,2BAAa,WAAW,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;CA4BvD,MAAa,YAAe,IAAsC;AAChE,MAAI;AAEF,QAAK,WAAW,MAAM,KAAK;GAG3B,MAAM,SAAS,MAAM,IAAI;AAGzB,QAAK,WAAW,OAAO,KAAK;AAE5B,UAAO;WACA,OAAO;AAEd,QAAK,WAAW,SAAS,KAAK;AAC9B,SAAM;;;;;;;;;;;AAYZ,SAAgB,OAChB,OAA6C,oBAC7C,UAAqB;CAAE,WAAW;CAAM,WAAW;CAAiB,EAC/D;AACH,QAAO,IAAI,GAAG,MAAM,QAAQ"}
1
+ {"version":3,"file":"kv.js","names":[],"sources":["../../src/kv/kv.ts"],"sourcesContent":["import { DatabaseSync, StatementSync } from 'node:sqlite';\nimport { deserializer, serializer } from './serde';\nimport { getNestedValue, setNestedValue } from './dotprops';\n\nexport type { SerializedValue } from './serde';\n\n/**\n * Mathematical operators supported by the KV math method\n */\nexport type KvMathOperator = '+' | '-' | '*' | '/' | '^' | '%';\n\n/**\n * Configuration options for the KV store\n */\nexport interface KvOptions {\n /** Enable Write-Ahead Logging for better performance and durability */\n enableWAL?: boolean;\n /** Namespace for the key-value store table */\n namespace?: string;\n}\n\n/**\n * A key-value store implementation using SQLite\n *\n * This class provides a simple, persistent key-value storage solution\n * with support for namespaces, automatic cleanup, iteration, expiration, and JSON serialization.\n *\n * @example\n * ```typescript\n * const kv = new KV('data.db');\n *\n * // Store any JSON-serializable data\n * kv.set('user:123', { name: 'John', age: 30 });\n * kv.set('counter', 42);\n * kv.set('active', true);\n * kv.set('dates', [new Date(), new Date()]);\n *\n * // Use dot notation for nested properties\n * kv.set('user:123.name', 'John');\n * kv.set('user:123.settings.theme', 'dark');\n *\n * // Retrieve data\n * const user = kv.get('user:123'); // { name: 'John', age: 30, settings: { theme: 'dark' } }\n * const name = kv.get('user:123.name'); // 'John'\n * ```\n */\nexport class KV implements Disposable, AsyncDisposable {\n private db: DatabaseSync;\n private statements: Record<string, StatementSync> = {};\n\n /**\n * Creates a new KV store instance\n *\n * @param path - Database file path, buffer, URL, or existing DatabaseSync instance\n * @param options - Configuration options for the KV store\n */\n public constructor(\n path: string | Buffer | URL | DatabaseSync,\n private options: KvOptions = {\n enableWAL: true,\n namespace: 'commandkit_kv',\n },\n ) {\n this.db =\n path instanceof DatabaseSync\n ? path\n : new DatabaseSync(path, { open: true });\n\n if (options.enableWAL) {\n this.db.exec(/* sql */ `PRAGMA journal_mode = WAL;`);\n }\n\n const namespace = this.options.namespace ?? 'commandkit_kv';\n\n this.db.exec(/* sql */ `\n CREATE TABLE IF NOT EXISTS ${namespace} (\n key TEXT PRIMARY KEY,\n value TEXT,\n expires_at INTEGER\n )\n `);\n\n this.statements = {\n get: this.db.prepare(\n /* sql */ `SELECT value, expires_at FROM ${namespace} WHERE key = ?`,\n ),\n set: this.db.prepare(\n /* sql */ `INSERT OR REPLACE INTO ${namespace} (key, value, expires_at) VALUES (?, ?, ?)`,\n ),\n setex: this.db.prepare(\n /* sql */ `INSERT OR REPLACE INTO ${namespace} (key, value, expires_at) VALUES (?, ?, ?)`,\n ),\n delete: this.db.prepare(\n /* sql */ `DELETE FROM ${namespace} WHERE key = ?`,\n ),\n has: this.db.prepare(\n /* sql */ `SELECT COUNT(*) FROM ${namespace} WHERE key = ? AND (expires_at IS NULL OR expires_at > ?)`,\n ),\n keys: this.db.prepare(\n /* sql */ `SELECT key FROM ${namespace} WHERE expires_at IS NULL OR expires_at > ?`,\n ),\n values: this.db.prepare(\n /* sql */ `SELECT value FROM ${namespace} WHERE expires_at IS NULL OR expires_at > ?`,\n ),\n clear: this.db.prepare(/* sql */ `DELETE FROM ${namespace}`),\n count: this.db.prepare(\n /* sql */ `SELECT COUNT(*) FROM ${namespace} WHERE expires_at IS NULL OR expires_at > ?`,\n ),\n all: this.db.prepare(\n /* sql */ `SELECT key, value FROM ${namespace} WHERE expires_at IS NULL OR expires_at > ?`,\n ),\n expire: this.db.prepare(\n /* sql */ `UPDATE ${namespace} SET expires_at = ? WHERE key = ?`,\n ),\n ttl: this.db.prepare(\n /* sql */ `SELECT expires_at FROM ${namespace} WHERE key = ?`,\n ),\n namespaces: this.db.prepare(\n /* sql */ `SELECT name FROM sqlite_master WHERE type = 'table' AND name NOT LIKE 'sqlite_%'`,\n ),\n begin: this.db.prepare(/* sql */ `BEGIN TRANSACTION`),\n commit: this.db.prepare(/* sql */ `COMMIT`),\n rollback: this.db.prepare(/* sql */ `ROLLBACK`),\n };\n }\n\n /**\n * Gets the current timestamp in milliseconds\n */\n private getCurrentTime(): number {\n return Date.now();\n }\n\n /**\n * Checks if the database connection is open\n *\n * @returns `true` if the database is open, `false` otherwise\n */\n public isOpen(): boolean {\n return this.db.isOpen;\n }\n\n /**\n * Gets the underlying SQLite database instance\n *\n * @returns The DatabaseSync instance\n */\n public getDatabase(): DatabaseSync {\n return this.db;\n }\n\n /**\n * Closes the database connection\n */\n public close(): void {\n if (this.db.isOpen) this.db.close();\n }\n\n /**\n * Disposable implementation - closes the database when disposed\n */\n public [Symbol.dispose]() {\n this.close();\n }\n\n /**\n * AsyncDisposable implementation - closes the database when disposed\n */\n public async [Symbol.asyncDispose]() {\n this.close();\n }\n\n /**\n * Retrieves a value by key\n *\n * @param key - The key to retrieve (supports dot notation for nested properties)\n * @returns The value associated with the key, or `undefined` if not found or expired\n *\n * @example\n * ```typescript\n * // Store an object\n * kv.set('user:123', { name: 'John', age: 30, settings: { theme: 'dark' } });\n *\n * // Get the entire object\n * const user = kv.get('user:123');\n * // { name: 'John', age: 30, settings: { theme: 'dark' } }\n *\n * // Get nested properties using dot notation\n * const name = kv.get('user:123.name'); // 'John'\n * const theme = kv.get('user:123.settings.theme'); // 'dark'\n * ```\n */\n public get<T = any>(key: string): T | undefined {\n const result = this.statements.get.get(key);\n\n if (!result) return undefined;\n\n // Check if the key has expired\n if (\n result.expires_at &&\n Number(result.expires_at) <= this.getCurrentTime()\n ) {\n this.delete(key);\n return undefined;\n }\n\n const serialized = JSON.parse(result.value as string);\n const deserialized = deserializer(serialized);\n\n // Handle dot notation for nested properties\n if (key.includes('.')) {\n return getNestedValue(deserialized, key.split('.').slice(1).join('.'));\n }\n\n return deserialized;\n }\n\n /**\n * Sets a key-value pair\n *\n * @param key - The key to set (supports dot notation for nested properties)\n * @param value - The value to associate with the key (any JSON-serializable type)\n *\n * @example\n * ```typescript\n * // Store primitive values\n * kv.set('counter', 42);\n * kv.set('active', true);\n * kv.set('name', 'John');\n *\n * // Store objects\n * kv.set('user:123', { name: 'John', age: 30 });\n *\n * // Store arrays\n * kv.set('tags', ['javascript', 'typescript', 'sqlite']);\n *\n * // Store dates\n * kv.set('created', new Date());\n *\n * // Store maps and sets\n * kv.set('permissions', new Map([['admin', true], ['user', false]]));\n * kv.set('unique_ids', new Set([1, 2, 3, 4, 5]));\n *\n * // Use dot notation for nested properties\n * kv.set('user:123.settings.theme', 'dark');\n * kv.set('user:123.settings.notifications', true);\n * ```\n */\n public set(key: string, value: any): void {\n let serializedValue: string;\n\n if (key.includes('.')) {\n // Handle dot notation for nested properties\n const [baseKey, ...pathParts] = key.split('.');\n const path = pathParts.join('.');\n\n // Get existing value or create new object\n const existing = this.get(baseKey) || {};\n setNestedValue(existing, path, value);\n\n const serialized = serializer(existing);\n serializedValue = JSON.stringify(serialized);\n\n this.statements.set.run(baseKey, serializedValue, null);\n } else {\n const serialized = serializer(value);\n serializedValue = JSON.stringify(serialized);\n\n this.statements.set.run(key, serializedValue, null);\n }\n }\n\n /**\n * Sets a key-value pair with expiration\n *\n * @param key - The key to set (supports dot notation for nested properties)\n * @param value - The value to associate with the key (any JSON-serializable type)\n * @param ttl - Time to live in milliseconds\n *\n * @example\n * ```typescript\n * // Set with 1 hour expiration\n * kv.setex('session:123', { userId: 123, token: 'abc123' }, 60 * 60 * 1000);\n *\n * // Set with 5 minutes expiration\n * kv.setex('temp:data', { cached: true, timestamp: Date.now() }, 5 * 60 * 1000);\n *\n * // Use dot notation with expiration\n * kv.setex('user:123.temp_settings', { theme: 'light' }, 30 * 60 * 1000);\n * ```\n */\n public setex(key: string, value: any, ttl: number): void {\n const expiresAt = this.getCurrentTime() + ttl;\n let serializedValue: string;\n\n if (key.includes('.')) {\n // Handle dot notation for nested properties\n const [baseKey, ...pathParts] = key.split('.');\n const path = pathParts.join('.');\n\n // Get existing value or create new object\n const existing = this.get(baseKey) || {};\n setNestedValue(existing, path, value);\n\n const serialized = serializer(existing);\n serializedValue = JSON.stringify(serialized);\n\n this.statements.setex.run(baseKey, serializedValue, expiresAt);\n } else {\n const serialized = serializer(value);\n serializedValue = JSON.stringify(serialized);\n\n this.statements.setex.run(key, serializedValue, expiresAt);\n }\n }\n\n /**\n * Performs mathematical operations on numeric values in the KV store\n *\n * @param key - The key to perform math operation on (supports dot notation for nested properties)\n * @param operator - The mathematical operator to apply\n * @param value - The value to use in the operation\n * @returns The updated value after the mathematical operation\n * @throws Error if the existing value is not numeric or if the operation is invalid\n *\n * @example\n * ```typescript\n * // Initialize a counter\n * kv.set('counter', 10);\n *\n * // Increment by 5\n * const result1 = kv.math('counter', '+', 5); // 15\n *\n * // Multiply by 2\n * const result2 = kv.math('counter', '*', 2); // 30\n *\n * // Use with bigint\n * kv.set('big_counter', BigInt(1000));\n * const result3 = kv.math('big_counter', '+', BigInt(500)); // 1500n\n *\n * // Use with dot notation\n * kv.set('user:123', { score: 100, level: 5 });\n * const result4 = kv.math('user:123.score', '+', 50); // 150\n * ```\n */\n public math(\n key: string,\n operator: KvMathOperator,\n value: number | bigint,\n ): number | bigint {\n const existingValue = this.get(key);\n\n if (existingValue === undefined) {\n throw new Error(`Key '${key}' does not exist`);\n }\n\n if (\n typeof existingValue !== 'number' &&\n typeof existingValue !== 'bigint'\n ) {\n throw new Error(\n `Value at key '${key}' is not numeric. Expected number or bigint, got ${typeof existingValue}`,\n );\n }\n\n // Handle mixed number/bigint operations by converting to bigint\n const isBigIntOperation =\n typeof existingValue === 'bigint' || typeof value === 'bigint';\n\n const existing = isBigIntOperation\n ? typeof existingValue === 'bigint'\n ? existingValue\n : BigInt(existingValue)\n : (existingValue as number);\n const operand = isBigIntOperation\n ? typeof value === 'bigint'\n ? value\n : BigInt(value)\n : (value as number);\n\n let result: number | bigint;\n\n switch (operator) {\n case '+':\n result = (existing as any) + (operand as any);\n break;\n case '-':\n result = (existing as any) - (operand as any);\n break;\n case '*':\n result = (existing as any) * (operand as any);\n break;\n case '/':\n if (operand === 0 || operand === 0n) {\n throw new Error('Division by zero');\n }\n result = (existing as any) / (operand as any);\n break;\n case '^':\n if (isBigIntOperation && operand < 0n) {\n throw new Error(\n 'Exponentiation with negative exponent is not supported for bigint',\n );\n }\n result = (existing as any) ** (operand as any);\n break;\n case '%':\n if (operand === 0 || operand === 0n) {\n throw new Error('Modulo by zero');\n }\n result = (existing as any) % (operand as any);\n break;\n default:\n throw new Error(`Invalid operator: ${operator}`);\n }\n\n // Update the value in the store\n this.set(key, result);\n\n return result;\n }\n\n /**\n * Sets expiration for an existing key\n *\n * @param key - The key to set expiration for\n * @param ttl - Time to live in milliseconds\n * @returns `true` if the key exists and expiration was set, `false` otherwise\n *\n * @example\n * ```typescript\n * kv.set('user:123', { name: 'John', age: 30 });\n *\n * // Set 30 minute expiration\n * if (kv.expire('user:123', 30 * 60 * 1000)) {\n * console.log('Expiration set successfully');\n * }\n * ```\n */\n public expire(key: string, ttl: number): boolean {\n if (!this.has(key)) return false;\n\n const expiresAt = this.getCurrentTime() + ttl;\n this.statements.expire.run(expiresAt, key);\n return true;\n }\n\n /**\n * Gets the time to live for a key\n *\n * @param key - The key to check\n * @returns Time to live in milliseconds, or `-1` if the key doesn't exist, or `-2` if the key has no expiration\n *\n * @example\n * ```typescript\n * const ttl = kv.ttl('user:123');\n * if (ttl > 0) {\n * console.log(`Key expires in ${ttl}ms`);\n * } else if (ttl === -2) {\n * console.log('Key has no expiration');\n * } else {\n * console.log('Key does not exist');\n * }\n * ```\n */\n public ttl(key: string): number {\n const result = this.statements.ttl.get(key);\n\n if (!result) return -1; // Key doesn't exist\n\n if (!result.expires_at) return -2; // No expiration\n\n const remaining = Number(result.expires_at) - this.getCurrentTime();\n return remaining > 0 ? remaining : -1; // Expired or doesn't exist\n }\n\n /**\n * Deletes a key-value pair\n *\n * @param key - The key to delete\n *\n * @example\n * ```typescript\n * kv.delete('user:123');\n * kv.delete('user:123.settings.theme'); // Delete nested property\n * ```\n */\n public delete(key: string): void {\n this.statements.delete.run(key);\n }\n\n /**\n * Checks if a key exists and is not expired\n *\n * @param key - The key to check\n * @returns `true` if the key exists and is not expired, `false` otherwise\n *\n * @example\n * ```typescript\n * if (kv.has('user:123')) {\n * console.log('User exists and is not expired');\n * }\n *\n * if (kv.has('user:123.settings.theme')) {\n * console.log('Theme setting exists');\n * }\n * ```\n */\n public has(key: string): boolean {\n const result = this.statements.has.get(key, this.getCurrentTime());\n\n return (\n result?.count !== undefined &&\n result.count !== null &&\n Number(result.count) > 0\n );\n }\n\n /**\n * Gets all keys in the current namespace (excluding expired keys)\n *\n * @returns Array of all non-expired keys\n *\n * @example\n * ```typescript\n * const keys = kv.keys();\n * console.log('All keys:', keys);\n * ```\n */\n public keys(): string[] {\n const result = this.statements.keys.all(this.getCurrentTime());\n\n return result.map((row) => row.key as string);\n }\n\n /**\n * Gets all values in the current namespace (excluding expired keys)\n *\n * @returns Array of all non-expired values\n *\n * @example\n * ```typescript\n * const values = kv.values();\n * console.log('All values:', values);\n * ```\n */\n public values(): any[] {\n const result = this.statements.values.all(this.getCurrentTime());\n\n return result.map((row) => {\n const serialized = JSON.parse(row.value as string);\n return deserializer(serialized);\n });\n }\n\n /**\n * Gets the total number of key-value pairs in the current namespace (excluding expired keys)\n *\n * @returns The count of non-expired key-value pairs\n *\n * @example\n * ```typescript\n * const count = kv.count();\n * console.log(`Total entries: ${count}`);\n * ```\n */\n public count(): number {\n const result = this.statements.count.get(this.getCurrentTime());\n\n return Number(result?.count ?? 0);\n }\n\n /**\n * Removes all key-value pairs from the current namespace\n *\n * @example\n * ```typescript\n * kv.clear(); // Removes all entries in current namespace\n * ```\n */\n public clear(): void {\n this.statements.clear.run();\n }\n\n /**\n * Gets all key-value pairs as an object (excluding expired keys)\n *\n * @returns Object with all non-expired key-value pairs\n *\n * @example\n * ```typescript\n * const all = kv.all();\n * console.log('All entries:', all);\n * // Output: { 'key1': value1, 'key2': value2 }\n * ```\n */\n public all(): Record<string, any> {\n const result = this.statements.all.all(this.getCurrentTime());\n\n return Object.fromEntries(\n result.map((row) => {\n const serialized = JSON.parse(row.value as string);\n return [row.key as string, deserializer(serialized)];\n }),\n );\n }\n\n /**\n * Gets all available namespaces (tables) in the database\n *\n * @returns Array of namespace names\n *\n * @example\n * ```typescript\n * const namespaces = kv.namespaces();\n * console.log('Available namespaces:', namespaces);\n * ```\n */\n public namespaces(): string[] {\n const result = this.statements.namespaces.all();\n\n return result.map((row) => row.name as string);\n }\n\n /**\n * Gets the current namespace name\n *\n * @returns The current namespace string\n */\n public getCurrentNamespace(): string {\n return this.options.namespace ?? 'commandkit_kv';\n }\n\n /**\n * Creates a new KV instance with a different namespace\n *\n * @param namespace - The namespace to use for the new instance\n * @returns A new KV instance with the specified namespace\n *\n * @example\n * ```typescript\n * const userKv = kv.namespace('users');\n * const configKv = kv.namespace('config');\n *\n * userKv.set('123', { name: 'John', age: 30 });\n * configKv.set('theme', 'dark');\n * ```\n */\n public namespace(namespace: string): KV {\n return new KV(this.db, {\n enableWAL: this.options.enableWAL,\n namespace,\n });\n }\n\n /**\n * Iterator implementation for iterating over all non-expired key-value pairs\n *\n * @returns Iterator yielding [key, value] tuples\n *\n * @example\n * ```typescript\n * for (const [key, value] of kv) {\n * console.log(`${key}:`, value);\n * }\n *\n * // Or using spread operator\n * const entries = [...kv];\n * ```\n */\n public *[Symbol.iterator](): Iterator<[string, any]> {\n const result = this.statements.all.iterate(this.getCurrentTime());\n\n for (const row of result) {\n const serialized = JSON.parse(row.value as string);\n yield [row.key as string, deserializer(serialized)];\n }\n }\n\n /**\n * Executes a function within a transaction\n *\n * @param fn - Function to execute within the transaction (can be async)\n * @returns The result of the function\n *\n * @example\n * ```typescript\n * // Synchronous transaction\n * kv.transaction(() => {\n * kv.set('user:123', { name: 'John', age: 30 });\n * kv.set('user:456', { name: 'Jane', age: 25 });\n * // If any operation fails, all changes are rolled back\n * });\n *\n * // Async transaction\n * await kv.transaction(async () => {\n * kv.set('user:123', { name: 'John', age: 30 });\n * await someAsyncOperation();\n * kv.set('user:456', { name: 'Jane', age: 25 });\n * // If any operation fails, all changes are rolled back\n * });\n * ```\n */\n public async transaction<T>(fn: () => T | Promise<T>): Promise<T> {\n try {\n // Begin transaction\n this.statements.begin.run();\n\n // Execute the function\n const result = await fn();\n\n // Commit transaction\n this.statements.commit.run();\n\n return result;\n } catch (error) {\n // Rollback transaction on error\n this.statements.rollback.run();\n throw error;\n }\n }\n}\n\n/**\n * Opens a new KV instance\n *\n * @param path - Database file path, buffer, URL, or existing DatabaseSync instance\n * @param options - Configuration options for the KV store\n * @returns A new KV instance\n */\nexport function openKV(\n path: string | Buffer | URL | DatabaseSync = 'commandkit_kv.db',\n options: KvOptions = { enableWAL: true, namespace: 'commandkit_kv' },\n): KV {\n return new KV(path, options);\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;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QAAK,WAAW,SAAS,KAAK;AAC9B,SAAM;;;;;;;;;;;AAYZ,SAAgB,OAChB,OAA6C,oBAC7C,UAAqB;CAAE,WAAW;CAAM,WAAW;CAAiB,EAC/D;AACH,QAAO,IAAI,GAAG,MAAM,QAAQ"}
@@ -1,3 +1,3 @@
1
- import "../constants-D8PMA9on.js";
2
- import { SerializedValue, deserializer, serializer } from "../serde-BYaKrsOV.js";
1
+ import "../constants-CCFSX2NG.js";
2
+ import { SerializedValue, deserializer, serializer } from "../serde-D4H23l2F.js";
3
3
  export { SerializedValue, deserializer, serializer };
package/dist/kv/serde.js CHANGED
@@ -1,5 +1,5 @@
1
- require('../constants-4oxxvaJA.js');
2
- const require_serde = require('../serde-Cc8iUa9J.js');
1
+ require('../constants-AH-9qJ89.js');
2
+ const require_serde = require('../serde-DHHwhltz.js');
3
3
 
4
4
  exports.deserializer = require_serde.deserializer;
5
5
  exports.serializer = require_serde.serializer;
@@ -0,0 +1,36 @@
1
+ const require_chunk = require('./chunk-nOFOJqeH.js');
2
+ const require_common = require('./common-CCx-FJI4.js');
3
+ let discord_js = require("discord.js");
4
+ discord_js = require_chunk.__toESM(discord_js);
5
+
6
+ //#region src/components/display/label.ts
7
+ /**
8
+ * The label component wraps modal components with text as a label and optional description.
9
+ * @param props The label properties.
10
+ * @returns The label builder instance.
11
+ * @example ```tsx
12
+ * import { Label } from 'commandkit';
13
+ *
14
+ * const label = <Label label="Name" description="Enter your name">
15
+ * <ShortInput customId="name" label="Name" placeholder="John" required />
16
+ * </Label>;
17
+ * ```
18
+ */
19
+ function Label(props) {
20
+ const { children, id,...rest } = props;
21
+ const label = new discord_js.LabelBuilder({
22
+ ...rest,
23
+ component: children
24
+ });
25
+ require_common.applyId(props, label);
26
+ return label;
27
+ }
28
+
29
+ //#endregion
30
+ Object.defineProperty(exports, 'Label', {
31
+ enumerable: true,
32
+ get: function () {
33
+ return Label;
34
+ }
35
+ });
36
+ //# sourceMappingURL=label-D-uJWRZ0.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"label-D-uJWRZ0.js","names":[],"sources":["../src/components/display/label.ts"],"sourcesContent":["import {\n APIComponentInLabel,\n LabelBuilder,\n type LabelBuilderData,\n} from 'discord.js';\nimport { applyId } from './common';\n\n/**\n * The label properties for the label component.\n */\nexport interface LabelProps\n extends Omit<LabelBuilderData, 'component' | 'type'> {\n /**\n * The component that will be wrapped by the label component.\n */\n children: LabelBuilderData['component'] & {};\n}\n\n/**\n * The label component wraps modal components with text as a label and optional description.\n * @param props The label properties.\n * @returns The label builder instance.\n * @example ```tsx\n * import { Label } from 'commandkit';\n *\n * const label = <Label label=\"Name\" description=\"Enter your name\">\n * <ShortInput customId=\"name\" label=\"Name\" placeholder=\"John\" required />\n * </Label>;\n * ```\n */\nexport function Label(props: LabelProps) {\n const { children, id, ...rest } = props;\n\n const label = new LabelBuilder({\n ...rest,\n // channel select menu builder is missing?\n component: children as unknown as APIComponentInLabel,\n });\n\n applyId(props, label);\n\n return label;\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;AA8BA,SAAgB,MAAM,OAAmB;CACvC,MAAM,EAAE,UAAU,GAAI,GAAG,SAAS;CAElC,MAAM,QAAQ,IAAI,wBAAa;EAC7B,GAAG;EAEH,WAAW;EACZ,CAAC;AAEF,wBAAQ,OAAO,MAAM;AAErB,QAAO"}
@@ -0,0 +1,29 @@
1
+ import { LabelBuilder, LabelBuilderData } from "discord.js";
2
+
3
+ //#region src/components/display/label.d.ts
4
+
5
+ /**
6
+ * The label properties for the label component.
7
+ */
8
+ interface LabelProps extends Omit<LabelBuilderData, 'component' | 'type'> {
9
+ /**
10
+ * The component that will be wrapped by the label component.
11
+ */
12
+ children: LabelBuilderData['component'] & {};
13
+ }
14
+ /**
15
+ * The label component wraps modal components with text as a label and optional description.
16
+ * @param props The label properties.
17
+ * @returns The label builder instance.
18
+ * @example ```tsx
19
+ * import { Label } from 'commandkit';
20
+ *
21
+ * const label = <Label label="Name" description="Enter your name">
22
+ * <ShortInput customId="name" label="Name" placeholder="John" required />
23
+ * </Label>;
24
+ * ```
25
+ */
26
+ declare function Label(props: LabelProps): LabelBuilder;
27
+ //#endregion
28
+ export { Label, LabelProps };
29
+ //# sourceMappingURL=label-D0KXeBhk.d.ts.map
@@ -1,3 +1,3 @@
1
- import "../ILogger-BW8GM-YZ.js";
2
- import { DefaultLogger } from "../DefaultLogger-XCOl5nLd.js";
1
+ import "../ILogger-BQ2ew4zR.js";
2
+ import { DefaultLogger } from "../DefaultLogger-CHMVsizQ.js";
3
3
  export { DefaultLogger };
@@ -1,38 +1,41 @@
1
1
  require('../colors-DL3ucTiT.js');
2
- require('../ActionRow-CbdGFWMT.js');
2
+ require('../ActionRow-uJxU4UGo.js');
3
3
  require('../error-codes-Ds0bnPvT.js');
4
- const require_commandkit = require('../commandkit-lhbfAyX9.js');
5
- require('../common-CcfjYnPG.js');
6
- require('../common-vnMIelAE.js');
7
- require('../container-C6GtfAPW.js');
8
- require('../file-DVOELoNv.js');
9
- require('../media-gallery-zDtJ3kxb.js');
10
- require('../section-DlvrDoJK.js');
11
- require('../separator-DL6QH5H1.js');
12
- require('../text-display-DbMumig_.js');
13
- require('../v2-DofkPKHs.js');
14
- require('../element-Bak9llw_.js');
15
- require('../types-CUZOquUl.js');
16
- require('../EventInterceptor-CQEXyUTp.js');
17
- require('../constants-B5_Ta7PR.js');
18
- require('../PluginCommon-Cvl5yYM_.js');
19
- require('../CompilerPlugin-M8r3yNAl.js');
20
- require('../RuntimePlugin-BUecuBIU.js');
21
- require('../types-q0Nm882H.js');
22
- require('../resolve-file-url-ChIyw-Vf.js');
23
- require('../runtime-DB9CiPfe.js');
24
- require('../utils-KsNof0Xz.js');
25
- require('../types-package-BWArjyBF.js');
26
- require('../constants-BOOGN85p.js');
27
- require('../EventWorkerContext-Dq29tieI.js');
28
- require('../signals-ChFMD7mB.js');
29
- require('../helpers-Dl8wW6aO.js');
30
- require('../MessageCommandParser-Dl0xxtdr.js');
31
- require('../CommandsRouter-Dmzw-ikm.js');
32
- require('../EventsRouter-3Gygh-km.js');
33
- require('../router-Dn35v30f.js');
34
- require('../common-CrqwC-sx.js');
35
- require('../CommandKitEventsChannel-BtRzr3Tz.js');
36
- require('../store-CM6pWVZh.js');
4
+ const require_commandkit = require('../commandkit-DabqpQ6v.js');
5
+ require('../warning-CszH8HeS.js');
6
+ require('../common-0Iw8ZeM6.js');
7
+ require('../common-CCx-FJI4.js');
8
+ require('../container-DC0eQigs.js');
9
+ require('../file-DAUOZYhC.js');
10
+ require('../media-gallery-BLhwe5lO.js');
11
+ require('../section-BMcHN97i.js');
12
+ require('../separator-C___2K-f.js');
13
+ require('../text-display-BtQR88kY.js');
14
+ require('../label-D-uJWRZ0.js');
15
+ require('../poll-Bc6rjeUS.js');
16
+ require('../display-WDb9wMCv.js');
17
+ require('../element-DibzzA5L.js');
18
+ require('../types-TC4g3w91.js');
19
+ require('../EventInterceptor-BWoEJMHZ.js');
20
+ require('../constants-BMWH2YUr.js');
21
+ require('../PluginCommon-CPWV5xuX.js');
22
+ require('../CompilerPlugin-CZ4412Zm.js');
23
+ require('../RuntimePlugin-COeXe8rP.js');
24
+ require('../types-Cdh4uaFR.js');
25
+ require('../resolve-file-url-CJoD0FAn.js');
26
+ require('../runtime-Skt5NiOc.js');
27
+ require('../utils-Br3eenD1.js');
28
+ require('../types-package-D11rQXLs.js');
29
+ require('../constants-D0dawKxO.js');
30
+ require('../EventWorkerContext-D_9q1Bm2.js');
31
+ require('../signals-Cnqe9dFV.js');
32
+ require('../helpers-D2_1jih6.js');
33
+ require('../MessageCommandParser-CKh-tM97.js');
34
+ require('../CommandsRouter-CWMipIis.js');
35
+ require('../EventsRouter-C04XqRKf.js');
36
+ require('../router-BvamdzoF.js');
37
+ require('../common-fIO6fqGZ.js');
38
+ require('../CommandKitEventsChannel-2l9Za-le.js');
39
+ require('../store-ZwL2gN6a.js');
37
40
 
38
41
  exports.DefaultLogger = require_commandkit.DefaultLogger;
@@ -1,2 +1,2 @@
1
- import { ILogger } from "../ILogger-BW8GM-YZ.js";
1
+ import { ILogger } from "../ILogger-BQ2ew4zR.js";
2
2
  export { ILogger };
@@ -1 +1 @@
1
- require('../ILogger-dQ7Y9X1f.js');
1
+ require('../ILogger-B0q7p7L1.js');
@@ -1,3 +1,3 @@
1
- import "../ILogger-BW8GM-YZ.js";
2
- import { CommandKitLoggerOptions, Logger, LoggerImpl, createLogger } from "../Logger-DyfkPk7u.js";
1
+ import "../ILogger-BQ2ew4zR.js";
2
+ import { CommandKitLoggerOptions, Logger, LoggerImpl, createLogger } from "../Logger-DyV7oli4.js";
3
3
  export { CommandKitLoggerOptions, Logger, LoggerImpl, createLogger };
@@ -1,39 +1,42 @@
1
1
  require('../colors-DL3ucTiT.js');
2
- require('../ActionRow-CbdGFWMT.js');
2
+ require('../ActionRow-uJxU4UGo.js');
3
3
  require('../error-codes-Ds0bnPvT.js');
4
- const require_commandkit = require('../commandkit-lhbfAyX9.js');
5
- require('../common-CcfjYnPG.js');
6
- require('../common-vnMIelAE.js');
7
- require('../container-C6GtfAPW.js');
8
- require('../file-DVOELoNv.js');
9
- require('../media-gallery-zDtJ3kxb.js');
10
- require('../section-DlvrDoJK.js');
11
- require('../separator-DL6QH5H1.js');
12
- require('../text-display-DbMumig_.js');
13
- require('../v2-DofkPKHs.js');
14
- require('../element-Bak9llw_.js');
15
- require('../types-CUZOquUl.js');
16
- require('../EventInterceptor-CQEXyUTp.js');
17
- require('../constants-B5_Ta7PR.js');
18
- require('../PluginCommon-Cvl5yYM_.js');
19
- require('../CompilerPlugin-M8r3yNAl.js');
20
- require('../RuntimePlugin-BUecuBIU.js');
21
- require('../types-q0Nm882H.js');
22
- require('../resolve-file-url-ChIyw-Vf.js');
23
- require('../runtime-DB9CiPfe.js');
24
- require('../utils-KsNof0Xz.js');
25
- require('../types-package-BWArjyBF.js');
26
- require('../constants-BOOGN85p.js');
27
- require('../EventWorkerContext-Dq29tieI.js');
28
- require('../signals-ChFMD7mB.js');
29
- require('../helpers-Dl8wW6aO.js');
30
- require('../MessageCommandParser-Dl0xxtdr.js');
31
- require('../CommandsRouter-Dmzw-ikm.js');
32
- require('../EventsRouter-3Gygh-km.js');
33
- require('../router-Dn35v30f.js');
34
- require('../common-CrqwC-sx.js');
35
- require('../CommandKitEventsChannel-BtRzr3Tz.js');
36
- require('../store-CM6pWVZh.js');
4
+ const require_commandkit = require('../commandkit-DabqpQ6v.js');
5
+ require('../warning-CszH8HeS.js');
6
+ require('../common-0Iw8ZeM6.js');
7
+ require('../common-CCx-FJI4.js');
8
+ require('../container-DC0eQigs.js');
9
+ require('../file-DAUOZYhC.js');
10
+ require('../media-gallery-BLhwe5lO.js');
11
+ require('../section-BMcHN97i.js');
12
+ require('../separator-C___2K-f.js');
13
+ require('../text-display-BtQR88kY.js');
14
+ require('../label-D-uJWRZ0.js');
15
+ require('../poll-Bc6rjeUS.js');
16
+ require('../display-WDb9wMCv.js');
17
+ require('../element-DibzzA5L.js');
18
+ require('../types-TC4g3w91.js');
19
+ require('../EventInterceptor-BWoEJMHZ.js');
20
+ require('../constants-BMWH2YUr.js');
21
+ require('../PluginCommon-CPWV5xuX.js');
22
+ require('../CompilerPlugin-CZ4412Zm.js');
23
+ require('../RuntimePlugin-COeXe8rP.js');
24
+ require('../types-Cdh4uaFR.js');
25
+ require('../resolve-file-url-CJoD0FAn.js');
26
+ require('../runtime-Skt5NiOc.js');
27
+ require('../utils-Br3eenD1.js');
28
+ require('../types-package-D11rQXLs.js');
29
+ require('../constants-D0dawKxO.js');
30
+ require('../EventWorkerContext-D_9q1Bm2.js');
31
+ require('../signals-Cnqe9dFV.js');
32
+ require('../helpers-D2_1jih6.js');
33
+ require('../MessageCommandParser-CKh-tM97.js');
34
+ require('../CommandsRouter-CWMipIis.js');
35
+ require('../EventsRouter-C04XqRKf.js');
36
+ require('../router-BvamdzoF.js');
37
+ require('../common-fIO6fqGZ.js');
38
+ require('../CommandKitEventsChannel-2l9Za-le.js');
39
+ require('../store-ZwL2gN6a.js');
37
40
 
38
41
  exports.Logger = require_commandkit.Logger;
39
42
  exports.createLogger = require_commandkit.createLogger;
@@ -1,4 +1,4 @@
1
- import { ILogger } from "../ILogger-BW8GM-YZ.js";
1
+ import { ILogger } from "../ILogger-BQ2ew4zR.js";
2
2
 
3
3
  //#region src/logger/NoopLogger.d.ts
4
4
 
@@ -1,9 +1,9 @@
1
1
  const require_chunk = require('./chunk-nOFOJqeH.js');
2
- const require_common = require('./common-vnMIelAE.js');
2
+ const require_common = require('./common-CCx-FJI4.js');
3
3
  let discord_js = require("discord.js");
4
4
  discord_js = require_chunk.__toESM(discord_js);
5
5
 
6
- //#region src/components/v2/media-gallery.ts
6
+ //#region src/components/display/media-gallery.ts
7
7
  /**
8
8
  * The media gallery component
9
9
  * @param props The properties for the media gallery component.
@@ -59,4 +59,4 @@ Object.defineProperty(exports, 'MediaGalleryItem', {
59
59
  return MediaGalleryItem;
60
60
  }
61
61
  });
62
- //# sourceMappingURL=media-gallery-zDtJ3kxb.js.map
62
+ //# sourceMappingURL=media-gallery-BLhwe5lO.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"media-gallery-BLhwe5lO.js","names":[],"sources":["../src/components/display/media-gallery.ts"],"sourcesContent":["import { MediaGalleryBuilder, MediaGalleryItemBuilder } from 'discord.js';\nimport { applyId } from './common';\n\n/**\n * Represents the properties for a media gallery component.\n */\nexport interface MediaGalleryProps {\n id?: number;\n children?: MediaGalleryItemBuilder[];\n}\n\n/**\n * The media gallery component\n * @param props The properties for the media gallery component.\n * @returns The media gallery builder instance.\n * @example ```tsx\n * import { MediaGallery } from 'commandkit';\n *\n * const gallery = (\n * <MediaGallery>\n * <MediaGalleryItem url=\"https://example.com/image1.png\" description=\"Image 1\" />\n * <MediaGalleryItem url=\"https://example.com/image2.png\" description=\"Image 2\" />\n * </MediaGallery>\n * );\n * ```\n */\nexport function MediaGallery(props: MediaGalleryProps) {\n const gallery = new MediaGalleryBuilder();\n\n applyId(props, gallery);\n\n if (props.children != null) {\n if (!Array.isArray(props.children)) props.children = [props.children];\n gallery.addItems(props.children.flat());\n }\n\n return gallery;\n}\n\n/**\n * Represents the properties for a media gallery item component.\n */\nexport interface MediaGalleryItemProps {\n description?: string;\n spoiler?: boolean;\n url?: string;\n}\n\n/**\n * The media gallery item component\n * @param props The properties for the media gallery item component.\n * @returns The media gallery item builder instance.\n * @example ```tsx\n * import { MediaGalleryItem } from 'commandkit';\n *\n * const item = <MediaGalleryItem url=\"https://example.com/image.png\" description=\"An image\" />;\n * ```\n */\nexport function MediaGalleryItem(props: MediaGalleryItemProps) {\n const item = new MediaGalleryItemBuilder();\n\n if (props.description != null) {\n item.setDescription(props.description);\n }\n\n if (props.spoiler != null) {\n item.setSpoiler(props.spoiler);\n }\n\n if (props.url != null) {\n item.setURL(props.url);\n }\n\n return item;\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;AA0BA,SAAgB,aAAa,OAA0B;CACrD,MAAM,UAAU,IAAI,gCAAqB;AAEzC,wBAAQ,OAAO,QAAQ;AAEvB,KAAI,MAAM,YAAY,MAAM;AAC1B,MAAI,CAAC,MAAM,QAAQ,MAAM,SAAS,CAAE,OAAM,WAAW,CAAC,MAAM,SAAS;AACrE,UAAQ,SAAS,MAAM,SAAS,MAAM,CAAC;;AAGzC,QAAO;;;;;;;;;;;;AAsBT,SAAgB,iBAAiB,OAA8B;CAC7D,MAAM,OAAO,IAAI,oCAAyB;AAE1C,KAAI,MAAM,eAAe,KACvB,MAAK,eAAe,MAAM,YAAY;AAGxC,KAAI,MAAM,WAAW,KACnB,MAAK,WAAW,MAAM,QAAQ;AAGhC,KAAI,MAAM,OAAO,KACf,MAAK,OAAO,MAAM,IAAI;AAGxB,QAAO"}
@@ -1,6 +1,6 @@
1
1
  import { MediaGalleryBuilder, MediaGalleryItemBuilder } from "discord.js";
2
2
 
3
- //#region src/components/v2/media-gallery.d.ts
3
+ //#region src/components/display/media-gallery.d.ts
4
4
 
5
5
  /**
6
6
  * Represents the properties for a media gallery component.
@@ -46,4 +46,4 @@ interface MediaGalleryItemProps {
46
46
  declare function MediaGalleryItem(props: MediaGalleryItemProps): MediaGalleryItemBuilder;
47
47
  //#endregion
48
48
  export { MediaGallery, MediaGalleryItem, MediaGalleryItemProps, MediaGalleryProps };
49
- //# sourceMappingURL=media-gallery-BMsXSot3.d.ts.map
49
+ //# sourceMappingURL=media-gallery-BzG70ued.d.ts.map
@@ -1,32 +1,34 @@
1
- import { CompilerPlugin, PluginTransformParameters, TransformedResult, isCompilerPlugin } from "../analytics-engine-jVeSoxEk.js";
1
+ import { CompilerPlugin, PluginTransformParameters, TransformedResult, isCompilerPlugin } from "../analytics-engine-NOInIjv8.js";
2
2
  import "../EventInterceptor-x-R2qshQ.js";
3
- import "../ButtonKit-C7r7RPNf.js";
4
- import "../ModalKit-Btz58KYn.js";
5
- import "../element-CAXu1XtK.js";
6
- import "../ActionRow-DKnFVDME.js";
3
+ import "../ButtonKit-9k4yfhYD.js";
4
+ import "../ModalKit-Cq2ns6jv.js";
5
+ import "../element-CvNhvLZ8.js";
6
+ import "../ActionRow-B-7n9MMr.js";
7
7
  import "../types-CJ-XvOFN.js";
8
- import "../Button-4ZUXdA56.js";
9
- import "../Modal-C6UTRdYQ.js";
10
- import "../common-DOCvOVC4.js";
11
- import "../StringSelectMenuKit-Bhs8U6WI.js";
12
- import "../ChannelSelectMenuKit-BrXvBYNH.js";
13
- import "../MentionableSelectMenuKit-CPTKqx-O.js";
14
- import "../UserSelectMenuKit-CfqFJdxz.js";
15
- import "../RoleSelectMenuKit-C26lU3sN.js";
16
- import "../SelectMenu-Diy87_ba.js";
17
- import "../container-DHBELeJ3.js";
18
- import "../file-DTrr-p09.js";
19
- import "../media-gallery-BMsXSot3.js";
20
- import "../section-Dh_FhPeC.js";
21
- import "../separator-CMf6Cyy5.js";
22
- import "../text-display-DRw3r_lK.js";
23
- import "../index-Dw5cCt-A.js";
24
- import "../index-E7Wvm5uX.js";
25
- import "../MessageCommandParser-BsGMOTDo.js";
26
- import "../signals-SHg7J1U_.js";
27
- import "../helpers-Wg6P5fRQ.js";
28
- import "../CommandsRouter-CoOA7hkf.js";
29
- import "../EventsRouter-BacqK6z3.js";
30
- import "../index-CUPkUUOR.js";
31
- import "../constants-MKu-Q1jh.js";
8
+ import "../Button-RMp-w8HV.js";
9
+ import "../Modal-Calb46SJ.js";
10
+ import "../common-DHTTnX82.js";
11
+ import "../StringSelectMenuKit-CJ0MzUZJ.js";
12
+ import "../ChannelSelectMenuKit-CsYgIyKe.js";
13
+ import "../MentionableSelectMenuKit-CO9phWMf.js";
14
+ import "../UserSelectMenuKit-C_J-9RJs.js";
15
+ import "../RoleSelectMenuKit-DvBxzpWh.js";
16
+ import "../SelectMenu-VcDhOGoJ.js";
17
+ import "../container-1ltvkavy.js";
18
+ import "../file-n2yl_-vl.js";
19
+ import "../media-gallery-BzG70ued.js";
20
+ import "../section-BOaJKXiy.js";
21
+ import "../separator-Cb7-6T6N.js";
22
+ import "../text-display-B_hpz50P.js";
23
+ import "../label-D0KXeBhk.js";
24
+ import "../poll-HnaJcB0o.js";
25
+ import "../index-h64gcVNJ.js";
26
+ import "../index-BLwMeReG.js";
27
+ import "../MessageCommandParser-DEOl_ifb.js";
28
+ import "../signals-DBS60vTo.js";
29
+ import "../helpers-hDh_tMb6.js";
30
+ import "../CommandsRouter-CBdsqaWK.js";
31
+ import "../EventsRouter-4pT6vj-U.js";
32
+ import "../index-B5F3AfVc.js";
33
+ import "../constants-DqnSDZ6l.js";
32
34
  export { CompilerPlugin, PluginTransformParameters, TransformedResult, isCompilerPlugin };
@@ -1,5 +1,5 @@
1
- require('../PluginCommon-Cvl5yYM_.js');
2
- const require_CompilerPlugin = require('../CompilerPlugin-M8r3yNAl.js');
1
+ require('../PluginCommon-CPWV5xuX.js');
2
+ const require_CompilerPlugin = require('../CompilerPlugin-CZ4412Zm.js');
3
3
 
4
4
  exports.CompilerPlugin = require_CompilerPlugin.CompilerPlugin;
5
5
  exports.isCompilerPlugin = require_CompilerPlugin.isCompilerPlugin;