commandkit 1.2.0-rc.9 → 1.2.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +19 -3
- package/README.md +45 -26
- package/bin/index.mjs +1 -1
- package/cli.d.ts +19 -0
- package/config.cjs +3 -0
- package/config.d.ts +1 -0
- package/dist/{ActionRow-DKnFVDME.d.ts → ActionRow-Bt9qi0Mb.d.ts} +4 -5
- package/dist/{Button-4ZUXdA56.d.ts → Button-DxJLcZIU.d.ts} +7 -8
- package/dist/{ButtonKit-C7r7RPNf.d.ts → ButtonKit-BfcyvWfj.d.ts} +4 -5
- package/dist/{ChannelSelectMenuKit-BrXvBYNH.d.ts → ChannelSelectMenuKit-DYkudikb.d.ts} +5 -6
- package/dist/{CommandsRouter-CoOA7hkf.d.ts → CommandsRouter-DiNoF0dq.d.ts} +2 -3
- package/dist/{EventInterceptor-x-R2qshQ.d.ts → EventInterceptor-D9JKMcfi.d.ts} +2 -2
- package/dist/{EventsRouter-BacqK6z3.d.ts → EventsRouter-EuuSu6NH.d.ts} +2 -2
- package/dist/{MentionableSelectMenuKit-CPTKqx-O.d.ts → MentionableSelectMenuKit-Mu4xqP6B.d.ts} +5 -6
- package/dist/{MessageCommandParser-ROLibZPX.d.ts → MessageCommandParser-DPCbHXCS.d.ts} +4 -5
- package/dist/{Modal-C6UTRdYQ.d.ts → Modal-v9rrcMl-.d.ts} +25 -12
- package/dist/{ModalKit-Btz58KYn.d.ts → ModalKit-XJSM65SV.d.ts} +4 -5
- package/dist/{RoleSelectMenuKit-C26lU3sN.d.ts → RoleSelectMenuKit-CCjcp3HY.d.ts} +5 -6
- package/dist/{SelectMenu-Diy87_ba.d.ts → SelectMenu-CY0vvoSu.d.ts} +17 -14
- package/dist/{StringSelectMenuKit-Bhs8U6WI.d.ts → StringSelectMenuKit-G5nBTicX.d.ts} +5 -6
- package/dist/{UserSelectMenuKit-CfqFJdxz.d.ts → UserSelectMenuKit-D3SO_fXA.d.ts} +5 -6
- package/dist/analytics/analytics-engine.d.ts +1 -31
- package/dist/analytics/analytics-engine.js +2 -36
- package/dist/analytics/analytics-provider.d.ts +1 -31
- package/dist/analytics/analytics-provider.js +1 -0
- package/dist/analytics/constants.js +26 -3
- package/dist/analytics/constants.js.map +1 -0
- package/dist/analytics/utils.js +2 -36
- package/dist/{analytics-engine-B7JNRnEN.d.ts → analytics-engine-DnRsHBId.d.ts} +48 -34
- package/dist/app/commands/AppCommandRunner.d.ts +1 -31
- package/dist/app/commands/AppCommandRunner.js +2 -36
- package/dist/app/commands/Context.d.ts +1 -31
- package/dist/app/commands/Context.js +2 -36
- package/dist/app/commands/MessageCommandParser.d.ts +1 -1
- package/dist/app/commands/MessageCommandParser.js +261 -4
- package/dist/app/commands/MessageCommandParser.js.map +1 -0
- package/dist/app/commands/helpers.d.ts +1 -1
- package/dist/app/commands/helpers.js +25 -3
- package/dist/app/commands/helpers.js.map +1 -0
- package/dist/app/events/EventWorkerContext.d.ts +42 -33
- package/dist/app/events/EventWorkerContext.js +48 -5
- package/dist/app/events/EventWorkerContext.js.map +1 -0
- package/dist/app/handlers/AppCommandHandler.d.ts +1 -31
- package/dist/app/handlers/AppCommandHandler.js +2 -36
- package/dist/app/handlers/AppEventsHandler.d.ts +1 -31
- package/dist/app/handlers/AppEventsHandler.js +2 -36
- package/dist/app/index.d.ts +4 -31
- package/dist/app/index.js +13 -45
- package/dist/app/interrupt/signals.d.ts +1 -1
- package/dist/app/interrupt/signals.js +54 -7
- package/dist/app/interrupt/signals.js.map +1 -0
- package/dist/app/middlewares/permissions.d.ts +1 -31
- package/dist/app/middlewares/permissions.js +2 -36
- package/dist/app/register/CommandRegistrar.d.ts +1 -31
- package/dist/app/register/CommandRegistrar.js +2 -36
- package/dist/app/router/CommandsRouter.d.ts +1 -1
- package/dist/app/router/CommandsRouter.js +210 -2
- package/dist/app/router/CommandsRouter.js.map +1 -0
- package/dist/app/router/EventsRouter.d.ts +1 -1
- package/dist/app/router/EventsRouter.js +128 -2
- package/dist/app/router/EventsRouter.js.map +1 -0
- package/dist/app/router/index.d.ts +2 -3
- package/dist/app/router/index.js +5 -5
- package/dist/{chunk-nOFOJqeH.js → chunk-BE-pF4vm.js} +11 -7
- package/dist/cli/app-process.d.ts +2 -3
- package/dist/cli/app-process.js +60 -7
- package/dist/cli/app-process.js.map +1 -0
- package/dist/cli/build.d.ts +2 -31
- package/dist/cli/build.js +171 -41
- package/dist/cli/build.js.map +1 -0
- package/dist/cli/common.d.ts +10 -34
- package/dist/cli/common.js +182 -11
- package/dist/cli/common.js.map +1 -0
- package/dist/cli/development.d.ts +18 -1
- package/dist/cli/development.js +52 -78
- package/dist/cli/development.js.map +1 -1
- package/dist/cli/env.d.ts +4 -0
- package/dist/cli/env.js +73 -9
- package/dist/cli/env.js.map +1 -0
- package/dist/cli/generators.js +10 -13
- package/dist/cli/generators.js.map +1 -1
- package/dist/cli/information.js +11 -10
- package/dist/cli/information.js.map +1 -1
- package/dist/cli/init.d.ts +12 -2
- package/dist/cli/init.js +83 -38
- package/dist/cli/init.js.map +1 -0
- package/dist/cli/production.d.ts +2 -3
- package/dist/cli/production.js +19 -52
- package/dist/cli/production.js.map +1 -1
- package/dist/cli/type-checker.js +83 -6
- package/dist/cli/type-checker.js.map +1 -0
- package/dist/cli/utils.d.ts +0 -1
- package/dist/cli/utils.js +18 -2
- package/dist/cli/utils.js.map +1 -0
- package/dist/{commandkit-Bm0gLN8i.js → commandkit-Bh7C1_c7.js} +3219 -2616
- package/dist/commandkit-Bh7C1_c7.js.map +1 -0
- package/dist/commandkit.d.ts +1 -31
- package/dist/commandkit.js +2 -36
- package/dist/{common-DOCvOVC4.d.ts → common-CCvvgnxi.d.ts} +4 -5
- package/dist/components/common/EventInterceptor.d.ts +1 -1
- package/dist/components/common/EventInterceptor.js +137 -2
- package/dist/components/common/EventInterceptor.js.map +1 -0
- package/dist/components/common/element.d.ts +2 -5
- package/dist/components/common/element.js +10 -8
- package/dist/components/common/types.d.ts +1 -1
- package/dist/components/common/types.js +1 -1
- package/dist/components/{v2 → display}/common.d.ts +1 -2
- package/dist/components/display/common.js +4 -0
- package/dist/components/display/container.d.ts +2 -0
- package/dist/components/display/container.js +4 -0
- package/dist/components/display/file.d.ts +2 -0
- package/dist/{file-DVOELoNv.js → components/display/file.js} +5 -10
- package/dist/components/display/file.js.map +1 -0
- package/dist/components/display/index.d.ts +9 -0
- package/dist/components/display/index.js +19 -0
- package/dist/components/display/label.d.ts +2 -0
- package/dist/components/display/label.js +4 -0
- package/dist/components/display/media-gallery.d.ts +2 -0
- package/dist/components/display/media-gallery.js +5 -0
- package/dist/components/display/poll.d.ts +2 -0
- package/dist/components/display/poll.js +86 -0
- package/dist/components/display/poll.js.map +1 -0
- package/dist/components/display/section.d.ts +2 -0
- package/dist/components/display/section.js +5 -0
- package/dist/components/display/separator.d.ts +2 -0
- package/dist/{separator-DL6QH5H1.js → components/display/separator.js} +5 -10
- package/dist/components/display/separator.js.map +1 -0
- package/dist/components/display/text-display.d.ts +2 -0
- package/dist/{text-display-DbMumig_.js → components/display/text-display.js} +5 -10
- package/dist/components/display/text-display.js.map +1 -0
- package/dist/components/index.d.ts +23 -24
- package/dist/components/index.js +29 -53
- package/dist/components/interactive/action-row/ActionRow.d.ts +2 -0
- package/dist/{ActionRow-CbdGFWMT.js → components/interactive/action-row/ActionRow.js} +5 -10
- package/dist/components/interactive/action-row/ActionRow.js.map +1 -0
- package/dist/components/interactive/button/Button.d.ts +2 -0
- package/dist/components/interactive/button/Button.js +4 -0
- package/dist/components/interactive/button/ButtonKit.d.ts +2 -0
- package/dist/components/interactive/button/ButtonKit.js +4 -0
- package/dist/components/interactive/modal/Modal.d.ts +2 -0
- package/dist/components/interactive/modal/Modal.js +8 -0
- package/dist/components/interactive/modal/ModalKit.d.ts +2 -0
- package/dist/components/interactive/modal/ModalKit.js +4 -0
- package/dist/components/interactive/select-menu/ChannelSelectMenuKit.d.ts +2 -0
- package/dist/components/interactive/select-menu/ChannelSelectMenuKit.js +4 -0
- package/dist/components/interactive/select-menu/MentionableSelectMenuKit.d.ts +2 -0
- package/dist/components/interactive/select-menu/MentionableSelectMenuKit.js +4 -0
- package/dist/components/interactive/select-menu/RoleSelectMenuKit.d.ts +2 -0
- package/dist/components/interactive/select-menu/RoleSelectMenuKit.js +4 -0
- package/dist/components/interactive/select-menu/SelectMenu.d.ts +2 -0
- package/dist/components/interactive/select-menu/SelectMenu.js +9 -0
- package/dist/components/interactive/select-menu/StringSelectMenuKit.d.ts +2 -0
- package/dist/components/interactive/select-menu/StringSelectMenuKit.js +4 -0
- package/dist/components/interactive/select-menu/UserSelectMenuKit.d.ts +2 -0
- package/dist/components/interactive/select-menu/UserSelectMenuKit.js +4 -0
- package/dist/components/interactive/select-menu/common.d.ts +2 -0
- package/dist/components/interactive/select-menu/common.js +1 -0
- package/dist/config/config.d.ts +15 -33
- package/dist/config/config.js +2 -36
- package/dist/config/default.d.ts +1 -31
- package/dist/config/default.js +2 -36
- package/dist/config/loader.d.ts +1 -31
- package/dist/config/loader.js +2 -36
- package/dist/config/types.d.ts +1 -31
- package/dist/config/types.js +1 -0
- package/dist/config/utils.d.ts +1 -31
- package/dist/config/utils.js +29 -2
- package/dist/config/utils.js.map +1 -0
- package/dist/{constants-D8PMA9on.d.ts → constants-DqtJY0t-.d.ts} +3 -3
- package/dist/{constants-MKu-Q1jh.d.ts → constants-DwxpkIeH.d.ts} +8 -2
- package/dist/{container-DHBELeJ3.d.ts → container-CYojOA9d.d.ts} +3 -4
- package/dist/context/async-context.d.ts +1 -31
- package/dist/context/async-context.js +2 -36
- package/dist/context/environment.d.ts +1 -31
- package/dist/context/environment.js +2 -36
- package/dist/{element-CAXu1XtK.d.ts → element-DeLvTMfZ.d.ts} +5 -5
- package/dist/events/CommandKitEventsChannel.d.ts +1 -31
- package/dist/events/CommandKitEventsChannel.js +83 -2
- package/dist/events/CommandKitEventsChannel.js.map +1 -0
- package/dist/{file-DTrr-p09.d.ts → file-DLO1zEcH.d.ts} +3 -4
- package/dist/flags/FlagProvider.d.ts +1 -31
- package/dist/flags/FlagProvider.js +1 -0
- package/dist/flags/FlagProvider.js.map +1 -1
- package/dist/flags/feature-flags.d.ts +1 -31
- package/dist/flags/feature-flags.js +5 -40
- package/dist/flags/store.d.ts +1 -31
- package/dist/flags/store.js +13 -2
- package/dist/flags/store.js.map +1 -0
- package/dist/{helpers-Wg6P5fRQ.d.ts → helpers-zmC44Mcu.d.ts} +2 -3
- package/dist/index-BIsCUWAs.d.ts +1 -0
- package/dist/index-CwHYpK-f.d.ts +1 -0
- package/dist/index-DHrsNvX1.d.ts +1 -0
- package/dist/index.d.ts +41 -42
- package/dist/index.js +80 -98
- package/dist/kv/constants.d.ts +1 -1
- package/dist/kv/constants.js +22 -2
- package/dist/kv/constants.js.map +1 -0
- package/dist/kv/dotprops.js +26 -3
- package/dist/kv/dotprops.js.map +1 -0
- package/dist/kv/kv.d.ts +1 -2
- package/dist/kv/kv.js +15 -18
- package/dist/kv/kv.js.map +1 -1
- package/dist/kv/serde.d.ts +12 -3
- package/dist/kv/serde.js +87 -4
- package/dist/kv/serde.js.map +1 -0
- package/dist/label-DqGRqodo.d.ts +28 -0
- package/dist/logger/DefaultLogger.d.ts +66 -3
- package/dist/logger/DefaultLogger.js +2 -36
- package/dist/logger/ILogger.d.ts +64 -2
- package/dist/logger/ILogger.js +1 -1
- package/dist/logger/Logger.d.ts +36 -3
- package/dist/logger/Logger.js +2 -36
- package/dist/logger/NoopLogger.d.ts +1 -2
- package/dist/logger/NoopLogger.js +1 -0
- package/dist/logger/NoopLogger.js.map +1 -1
- package/dist/{media-gallery-BMsXSot3.d.ts → media-gallery-Ca8es-eB.d.ts} +3 -4
- package/dist/plugins/CompilerPlugin.d.ts +1 -31
- package/dist/plugins/CompilerPlugin.js +33 -4
- package/dist/plugins/CompilerPlugin.js.map +1 -0
- package/dist/plugins/PluginCommon.d.ts +1 -31
- package/dist/plugins/PluginCommon.js +55 -4
- package/dist/plugins/PluginCommon.js.map +1 -0
- package/dist/plugins/RuntimePlugin.d.ts +1 -31
- package/dist/plugins/RuntimePlugin.js +124 -4
- package/dist/plugins/RuntimePlugin.js.map +1 -0
- package/dist/plugins/index.d.ts +1 -31
- package/dist/plugins/index.js +8 -40
- package/dist/plugins/plugin-runtime/CommandKitPluginRuntime.d.ts +1 -31
- package/dist/plugins/plugin-runtime/CommandKitPluginRuntime.js +2 -36
- package/dist/plugins/plugin-runtime/CompilerPluginRuntime.d.ts +1 -31
- package/dist/plugins/plugin-runtime/CompilerPluginRuntime.js +2 -36
- package/dist/plugins/plugin-runtime/builtin/CommonDirectiveTransformer.d.ts +1 -31
- package/dist/plugins/plugin-runtime/builtin/CommonDirectiveTransformer.js +2 -36
- package/dist/plugins/plugin-runtime/builtin/MacroPlugin.d.ts +1 -31
- package/dist/plugins/plugin-runtime/builtin/MacroPlugin.js +2 -36
- package/dist/plugins/plugin-runtime/runtime.d.ts +1 -31
- package/dist/plugins/plugin-runtime/runtime.js +1 -1
- package/dist/plugins/types.d.ts +1 -31
- package/dist/plugins/types.js +1 -1
- package/dist/poll-DQ6DX_Tt.d.ts +88 -0
- package/dist/{section-Dh_FhPeC.d.ts → section-Q8nwx_-q.d.ts} +3 -4
- package/dist/{separator-CMf6Cyy5.d.ts → separator-B8P-kdIK.d.ts} +3 -4
- package/dist/{signals-SHg7J1U_.d.ts → signals-CBXwugBW.d.ts} +2 -2
- package/dist/{text-display-DRw3r_lK.d.ts → text-display-CL9C2yMc.d.ts} +3 -4
- package/dist/{types-CJ-XvOFN.d.ts → types-DZy7U-Ld.d.ts} +2 -2
- package/dist/types.d.ts +2 -32
- package/dist/types.js +1 -0
- package/dist/utils/colors.js +9 -3
- package/dist/utils/colors.js.map +1 -0
- package/dist/utils/constants.d.ts +2 -2
- package/dist/utils/constants.js +50 -7
- package/dist/utils/constants.js.map +1 -0
- package/dist/utils/dev-hooks.d.ts +1 -31
- package/dist/utils/dev-hooks.js +2 -36
- package/dist/utils/error-codes.d.ts +54 -2
- package/dist/utils/error-codes.js +53 -5
- package/dist/utils/error-codes.js.map +1 -0
- package/dist/utils/resolve-file-url.d.ts +11 -2
- package/dist/utils/resolve-file-url.js +18 -2
- package/dist/utils/resolve-file-url.js.map +1 -0
- package/dist/utils/types-package.js +61 -4
- package/dist/utils/types-package.js.map +1 -0
- package/dist/utils/useful-stuff/async-queue.js +2 -2
- package/dist/utils/useful-stuff/async-queue.js.map +1 -1
- package/dist/utils/useful-stuff/mutex.js +1 -0
- package/dist/utils/useful-stuff/mutex.js.map +1 -1
- package/dist/utils/useful-stuff/ratelimiter.js +2 -2
- package/dist/utils/useful-stuff/ratelimiter.js.map +1 -1
- package/dist/utils/useful-stuff/semaphore.js +2 -3
- package/dist/utils/useful-stuff/semaphore.js.map +1 -1
- package/dist/utils/utilities.d.ts +113 -2
- package/dist/utils/utilities.js +5 -37
- package/dist/utils/{warn-unstable.d.ts → warning.d.ts} +12 -3
- package/dist/utils/{warn-unstable.js → warning.js} +15 -2
- package/dist/utils/warning.js.map +1 -0
- package/dist/version.d.ts +8 -2
- package/dist/version.js +13 -2
- package/dist/version.js.map +1 -0
- package/hooks.cjs +11 -4
- package/package.json +22 -18
- package/ratelimit.cjs +0 -1
- package/dist/ActionRow-CbdGFWMT.js.map +0 -1
- package/dist/CommandKitEventsChannel-BtRzr3Tz.js +0 -88
- package/dist/CommandKitEventsChannel-BtRzr3Tz.js.map +0 -1
- package/dist/CommandsRouter-Cgcy6cK9.js +0 -220
- package/dist/CommandsRouter-Cgcy6cK9.js.map +0 -1
- package/dist/CompilerPlugin-M8r3yNAl.js +0 -43
- package/dist/CompilerPlugin-M8r3yNAl.js.map +0 -1
- package/dist/DefaultLogger-XCOl5nLd.d.ts +0 -67
- package/dist/EventInterceptor-CQEXyUTp.js +0 -142
- package/dist/EventInterceptor-CQEXyUTp.js.map +0 -1
- package/dist/EventWorkerContext-BMk7IXpC.d.ts +0 -43
- package/dist/EventWorkerContext-Dq29tieI.js +0 -69
- package/dist/EventWorkerContext-Dq29tieI.js.map +0 -1
- package/dist/EventsRouter-3Gygh-km.js +0 -137
- package/dist/EventsRouter-3Gygh-km.js.map +0 -1
- package/dist/ILogger-BW8GM-YZ.d.ts +0 -64
- package/dist/ILogger-dQ7Y9X1f.js +0 -0
- package/dist/Logger-DyfkPk7u.d.ts +0 -37
- package/dist/MessageCommandParser-CEuO6Ex3.js +0 -269
- package/dist/MessageCommandParser-CEuO6Ex3.js.map +0 -1
- package/dist/PluginCommon-Cvl5yYM_.js +0 -71
- package/dist/PluginCommon-Cvl5yYM_.js.map +0 -1
- package/dist/RuntimePlugin-BUecuBIU.js +0 -134
- package/dist/RuntimePlugin-BUecuBIU.js.map +0 -1
- package/dist/app-HN1cVg8J.js +0 -0
- package/dist/app-process-DoG6Spkf.js +0 -68
- package/dist/app-process-DoG6Spkf.js.map +0 -1
- package/dist/build-C9ltqPmn.js +0 -175
- package/dist/build-C9ltqPmn.js.map +0 -1
- package/dist/colors-DL3ucTiT.js +0 -15
- package/dist/colors-DL3ucTiT.js.map +0 -1
- package/dist/commandkit-Bm0gLN8i.js.map +0 -1
- package/dist/common-CcfjYnPG.js +0 -0
- package/dist/common-Dxr9-XPa.js +0 -211
- package/dist/common-Dxr9-XPa.js.map +0 -1
- package/dist/common-vnMIelAE.js +0 -17
- package/dist/common-vnMIelAE.js.map +0 -1
- package/dist/components/v1/action-row/ActionRow.d.ts +0 -6
- package/dist/components/v1/action-row/ActionRow.js +0 -3
- package/dist/components/v1/button/Button.d.ts +0 -7
- package/dist/components/v1/button/Button.js +0 -38
- package/dist/components/v1/button/ButtonKit.d.ts +0 -3
- package/dist/components/v1/button/ButtonKit.js +0 -38
- package/dist/components/v1/modal/Modal.d.ts +0 -7
- package/dist/components/v1/modal/Modal.js +0 -41
- package/dist/components/v1/modal/ModalKit.d.ts +0 -3
- package/dist/components/v1/modal/ModalKit.js +0 -38
- package/dist/components/v1/select-menu/ChannelSelectMenuKit.d.ts +0 -4
- package/dist/components/v1/select-menu/ChannelSelectMenuKit.js +0 -38
- package/dist/components/v1/select-menu/MentionableSelectMenuKit.d.ts +0 -4
- package/dist/components/v1/select-menu/MentionableSelectMenuKit.js +0 -38
- package/dist/components/v1/select-menu/RoleSelectMenuKit.d.ts +0 -4
- package/dist/components/v1/select-menu/RoleSelectMenuKit.js +0 -38
- package/dist/components/v1/select-menu/SelectMenu.d.ts +0 -10
- package/dist/components/v1/select-menu/SelectMenu.js +0 -43
- package/dist/components/v1/select-menu/StringSelectMenuKit.d.ts +0 -4
- package/dist/components/v1/select-menu/StringSelectMenuKit.js +0 -38
- package/dist/components/v1/select-menu/UserSelectMenuKit.d.ts +0 -4
- package/dist/components/v1/select-menu/UserSelectMenuKit.js +0 -38
- package/dist/components/v1/select-menu/common.d.ts +0 -3
- package/dist/components/v1/select-menu/common.js +0 -1
- package/dist/components/v2/common.js +0 -3
- package/dist/components/v2/container.d.ts +0 -2
- package/dist/components/v2/container.js +0 -4
- package/dist/components/v2/file.d.ts +0 -2
- package/dist/components/v2/file.js +0 -3
- package/dist/components/v2/index.d.ts +0 -8
- package/dist/components/v2/index.js +0 -17
- package/dist/components/v2/media-gallery.d.ts +0 -2
- package/dist/components/v2/media-gallery.js +0 -5
- package/dist/components/v2/section.d.ts +0 -2
- package/dist/components/v2/section.js +0 -5
- package/dist/components/v2/separator.d.ts +0 -2
- package/dist/components/v2/separator.js +0 -3
- package/dist/components/v2/text-display.d.ts +0 -2
- package/dist/components/v2/text-display.js +0 -3
- package/dist/config-BhVxyjmZ.d.ts +0 -16
- package/dist/constants-4oxxvaJA.js +0 -27
- package/dist/constants-4oxxvaJA.js.map +0 -1
- package/dist/constants-B5_Ta7PR.js +0 -70
- package/dist/constants-B5_Ta7PR.js.map +0 -1
- package/dist/constants-BOOGN85p.js +0 -37
- package/dist/constants-BOOGN85p.js.map +0 -1
- package/dist/container-C6GtfAPW.js +0 -44
- package/dist/container-C6GtfAPW.js.map +0 -1
- package/dist/dotprops-tnhpnszJ.js +0 -36
- package/dist/dotprops-tnhpnszJ.js.map +0 -1
- package/dist/element-Bak9llw_.js +0 -84
- package/dist/element-Bak9llw_.js.map +0 -1
- package/dist/env-_68PRRoA.js +0 -109
- package/dist/env-_68PRRoA.js.map +0 -1
- package/dist/error-codes-B4TyW4Ct.d.ts +0 -54
- package/dist/error-codes-Ds0bnPvT.js +0 -73
- package/dist/error-codes-Ds0bnPvT.js.map +0 -1
- package/dist/feature-flags-nZJB7-e5.js +0 -160
- package/dist/feature-flags-nZJB7-e5.js.map +0 -1
- package/dist/file-DVOELoNv.js.map +0 -1
- package/dist/helpers-BSwwrKJW.js +0 -36
- package/dist/helpers-BSwwrKJW.js.map +0 -1
- package/dist/index-DKcmsWXw.d.ts +0 -1
- package/dist/index-DSBMRX9A.d.ts +0 -1
- package/dist/index-DdqikUQD.d.ts +0 -1
- package/dist/index.js.map +0 -1
- package/dist/init-Cy_bcUt4.js +0 -95
- package/dist/init-Cy_bcUt4.js.map +0 -1
- package/dist/init-DOr-Y3GQ.d.ts +0 -13
- package/dist/media-gallery-zDtJ3kxb.js +0 -62
- package/dist/media-gallery-zDtJ3kxb.js.map +0 -1
- package/dist/resolve-file-url-ChIyw-Vf.js +0 -23
- package/dist/resolve-file-url-ChIyw-Vf.js.map +0 -1
- package/dist/resolve-file-url-yO8bUxok.d.ts +0 -11
- package/dist/router-Dn35v30f.js +0 -0
- package/dist/runtime-DB9CiPfe.js +0 -0
- package/dist/section-DlvrDoJK.js +0 -60
- package/dist/section-DlvrDoJK.js.map +0 -1
- package/dist/separator-DL6QH5H1.js.map +0 -1
- package/dist/serde-BYaKrsOV.d.ts +0 -12
- package/dist/serde-Cc8iUa9J.js +0 -97
- package/dist/serde-Cc8iUa9J.js.map +0 -1
- package/dist/signals-ChFMD7mB.js +0 -74
- package/dist/signals-ChFMD7mB.js.map +0 -1
- package/dist/store-CM6pWVZh.js +0 -19
- package/dist/store-CM6pWVZh.js.map +0 -1
- package/dist/text-display-DbMumig_.js.map +0 -1
- package/dist/type-checker-DR7RZFs5.js +0 -90
- package/dist/type-checker-DR7RZFs5.js.map +0 -1
- package/dist/types-CUZOquUl.js +0 -0
- package/dist/types-package-BWArjyBF.js +0 -75
- package/dist/types-package-BWArjyBF.js.map +0 -1
- package/dist/types-q0Nm882H.js +0 -0
- package/dist/utilities-DtdPlr4c.d.ts +0 -87
- package/dist/utils/warn-unstable.js.map +0 -1
- package/dist/utils-DCSnVAZ6.js +0 -23
- package/dist/utils-DCSnVAZ6.js.map +0 -1
- package/dist/utils-KsNof0Xz.js +0 -34
- package/dist/utils-KsNof0Xz.js.map +0 -1
- package/dist/v2-DofkPKHs.js +0 -0
- package/dist/version-CtJtBJXI.d.ts +0 -8
- package/dist/version-DRSQMx0w.js +0 -18
- package/dist/version-DRSQMx0w.js.map +0 -1
|
@@ -1,67 +0,0 @@
|
|
|
1
|
-
import { ILogger } from "./ILogger-BW8GM-YZ.js";
|
|
2
|
-
|
|
3
|
-
//#region src/logger/DefaultLogger.d.ts
|
|
4
|
-
|
|
5
|
-
/**
|
|
6
|
-
* Default logger implementation that logs messages to the console.
|
|
7
|
-
* It formats the log messages with timestamps, log levels, and context information.
|
|
8
|
-
*/
|
|
9
|
-
declare class DefaultLogger implements ILogger {
|
|
10
|
-
stdout: NodeJS.WriteStream & {
|
|
11
|
-
fd: 1;
|
|
12
|
-
};
|
|
13
|
-
stderr: NodeJS.WriteStream & {
|
|
14
|
-
fd: 2;
|
|
15
|
-
};
|
|
16
|
-
private logger;
|
|
17
|
-
/**
|
|
18
|
-
* Creates a new instance of DefaultLogger.
|
|
19
|
-
* @param stdout The output stream for standard messages (default: process.stdout).
|
|
20
|
-
* @param stderr The output stream for error messages (default: process.stderr).
|
|
21
|
-
*/
|
|
22
|
-
constructor(stdout?: NodeJS.WriteStream & {
|
|
23
|
-
fd: 1;
|
|
24
|
-
}, stderr?: NodeJS.WriteStream & {
|
|
25
|
-
fd: 2;
|
|
26
|
-
});
|
|
27
|
-
private _formatTime;
|
|
28
|
-
private _getContext;
|
|
29
|
-
private _getLevelLabel;
|
|
30
|
-
private _getPrefix;
|
|
31
|
-
private _log;
|
|
32
|
-
private _logTemplate;
|
|
33
|
-
/**
|
|
34
|
-
* Logs a debug message.
|
|
35
|
-
* @param message The message to log.
|
|
36
|
-
*/
|
|
37
|
-
debug(message: any): void;
|
|
38
|
-
debug(strings: TemplateStringsArray, ...values: any[]): void;
|
|
39
|
-
/**
|
|
40
|
-
* Logs an error message.
|
|
41
|
-
* @param message The error message to log.
|
|
42
|
-
*/
|
|
43
|
-
error(message: any): void;
|
|
44
|
-
error(strings: TemplateStringsArray, ...values: any[]): void;
|
|
45
|
-
/**
|
|
46
|
-
* Logs a default message.
|
|
47
|
-
* @param message The message to log.
|
|
48
|
-
*/
|
|
49
|
-
log(message: any): void;
|
|
50
|
-
log(strings: TemplateStringsArray, ...values: any[]): void;
|
|
51
|
-
/**
|
|
52
|
-
* Logs an info message.
|
|
53
|
-
* @param message The informational message to log.
|
|
54
|
-
*/
|
|
55
|
-
info(message: any): void;
|
|
56
|
-
info(strings: TemplateStringsArray, ...values: any[]): void;
|
|
57
|
-
/**
|
|
58
|
-
* Logs a warning message.
|
|
59
|
-
* @param message The warning message to log.
|
|
60
|
-
*/
|
|
61
|
-
warn(message: any): void;
|
|
62
|
-
warn(strings: TemplateStringsArray, ...values: any[]): void;
|
|
63
|
-
private _isTemplateStringsArray;
|
|
64
|
-
}
|
|
65
|
-
//#endregion
|
|
66
|
-
export { DefaultLogger };
|
|
67
|
-
//# sourceMappingURL=DefaultLogger-XCOl5nLd.d.ts.map
|
|
@@ -1,142 +0,0 @@
|
|
|
1
|
-
|
|
2
|
-
//#region src/components/common/EventInterceptor.ts
|
|
3
|
-
/**
|
|
4
|
-
* The event interceptor class that allows subscribing to events and handling them with custom logic.
|
|
5
|
-
* It also supports automatic cleanup of expired subscriptions.
|
|
6
|
-
*/
|
|
7
|
-
var EventInterceptor = class {
|
|
8
|
-
subscribers = /* @__PURE__ */ new Map();
|
|
9
|
-
globalHandlers = /* @__PURE__ */ new Map();
|
|
10
|
-
cleanupTimer = null;
|
|
11
|
-
/**
|
|
12
|
-
* Creates the event interceptor.
|
|
13
|
-
*/
|
|
14
|
-
constructor(client) {
|
|
15
|
-
this.client = client;
|
|
16
|
-
this.#cleanupLoop();
|
|
17
|
-
}
|
|
18
|
-
#cleanupLoop() {
|
|
19
|
-
if (this.cleanupTimer) clearInterval(this.cleanupTimer);
|
|
20
|
-
this.cleanupTimer = setInterval(() => {
|
|
21
|
-
for (const [event, handlers] of this.subscribers) for (const handler of handlers) {
|
|
22
|
-
const options = Reflect.get(handler, "options");
|
|
23
|
-
if (options.time && Date.now() - options.registeredAt > options.time) this.unsubscribe(event, handler, "time");
|
|
24
|
-
}
|
|
25
|
-
}, 6e4).unref();
|
|
26
|
-
}
|
|
27
|
-
/**
|
|
28
|
-
* Destroys the event interceptor.
|
|
29
|
-
*/
|
|
30
|
-
destroy() {
|
|
31
|
-
if (this.cleanupTimer) {
|
|
32
|
-
clearInterval(this.cleanupTimer);
|
|
33
|
-
this.cleanupTimer = null;
|
|
34
|
-
}
|
|
35
|
-
for (const [event, handlers] of this.subscribers) for (const handler of handlers) this.unsubscribe(event, handler, "destroy");
|
|
36
|
-
this.subscribers.clear();
|
|
37
|
-
this.globalHandlers.clear();
|
|
38
|
-
}
|
|
39
|
-
/**
|
|
40
|
-
* Whether the event has subscribers.
|
|
41
|
-
* @param event The event to check.
|
|
42
|
-
*/
|
|
43
|
-
hasSubscribers(event) {
|
|
44
|
-
return this.subscribers.has(event);
|
|
45
|
-
}
|
|
46
|
-
/**
|
|
47
|
-
* Returns the number of subscribers for the event.
|
|
48
|
-
* @param event The event to check.
|
|
49
|
-
*/
|
|
50
|
-
getSubscriberCount(event) {
|
|
51
|
-
const handlers = this.subscribers.get(event);
|
|
52
|
-
return (handlers === null || handlers === void 0 ? void 0 : handlers.size) ?? 0;
|
|
53
|
-
}
|
|
54
|
-
/**
|
|
55
|
-
* Whether the event has global handlers.
|
|
56
|
-
*/
|
|
57
|
-
hasGlobalHandlers() {
|
|
58
|
-
return this.globalHandlers.size > 0;
|
|
59
|
-
}
|
|
60
|
-
/**
|
|
61
|
-
* Returns the number of global handlers.
|
|
62
|
-
*/
|
|
63
|
-
getGlobalHandlersCount() {
|
|
64
|
-
return this.subscribers.size;
|
|
65
|
-
}
|
|
66
|
-
/**
|
|
67
|
-
* Subscribes to an event.
|
|
68
|
-
* @param event The event to subscribe to.
|
|
69
|
-
* @param listener The listener to call when the event is emitted.
|
|
70
|
-
* @returns A function to unsubscribe from the event.
|
|
71
|
-
*/
|
|
72
|
-
subscribe(event, listener, options) {
|
|
73
|
-
if (!this.subscribers.has(event)) {
|
|
74
|
-
this.subscribers.set(event, /* @__PURE__ */ new Set());
|
|
75
|
-
this.client.on(event, this.createGlobalHandler(event));
|
|
76
|
-
this.client.setMaxListeners(this.client.getMaxListeners() + 1);
|
|
77
|
-
}
|
|
78
|
-
options ??= {};
|
|
79
|
-
options.registeredAt = Date.now();
|
|
80
|
-
Reflect.set(listener, "options", options);
|
|
81
|
-
this.subscribers.get(event).add(listener);
|
|
82
|
-
return () => {
|
|
83
|
-
this.unsubscribe(event, listener);
|
|
84
|
-
};
|
|
85
|
-
}
|
|
86
|
-
/**
|
|
87
|
-
* Unsubscribes from an event.
|
|
88
|
-
* @param event The event to unsubscribe from.
|
|
89
|
-
*/
|
|
90
|
-
unsubscribe(event, listener, reason) {
|
|
91
|
-
var _Reflect$get$onEnd, _Reflect$get;
|
|
92
|
-
const handlers = this.subscribers.get(event);
|
|
93
|
-
if (!handlers) return;
|
|
94
|
-
handlers.delete(listener);
|
|
95
|
-
if (handlers.size < 1) {
|
|
96
|
-
this.subscribers.delete(event);
|
|
97
|
-
this.client.removeListener(event, this.globalHandlers.get(event));
|
|
98
|
-
this.globalHandlers.delete(event);
|
|
99
|
-
this.client.setMaxListeners(Math.max(this.client.getMaxListeners() - 1, 0));
|
|
100
|
-
}
|
|
101
|
-
(_Reflect$get$onEnd = (_Reflect$get = Reflect.get(listener, "options")).onEnd) === null || _Reflect$get$onEnd === void 0 || _Reflect$get$onEnd.call(_Reflect$get, reason ?? "unsubscribe");
|
|
102
|
-
}
|
|
103
|
-
/**
|
|
104
|
-
* Creates a global handler for the event.
|
|
105
|
-
* @param event The event to create a global handler for.
|
|
106
|
-
* @returns The global handler.
|
|
107
|
-
*/
|
|
108
|
-
createGlobalHandler(event) {
|
|
109
|
-
if (this.globalHandlers.has(event)) return this.globalHandlers.get(event);
|
|
110
|
-
const handler = async (...args) => {
|
|
111
|
-
const subscribers = this.subscribers.get(event);
|
|
112
|
-
if (subscribers && subscribers.size > 0) for (const subscriber of subscribers) {
|
|
113
|
-
const options = Reflect.get(subscriber, "options");
|
|
114
|
-
if (options.time && Date.now() - options.registeredAt > options.time) {
|
|
115
|
-
this.unsubscribe(event, subscriber, "time");
|
|
116
|
-
continue;
|
|
117
|
-
}
|
|
118
|
-
if (options.autoReset) options.registeredAt = Date.now();
|
|
119
|
-
if (options.filter && !await options.filter(...args)) continue;
|
|
120
|
-
try {
|
|
121
|
-
await subscriber(...args);
|
|
122
|
-
} catch (e) {
|
|
123
|
-
if (options.onError) await options.onError(e);
|
|
124
|
-
else throw e;
|
|
125
|
-
} finally {
|
|
126
|
-
if (options.once) this.unsubscribe(event, subscriber, "once");
|
|
127
|
-
}
|
|
128
|
-
}
|
|
129
|
-
};
|
|
130
|
-
this.globalHandlers.set(event, handler);
|
|
131
|
-
return handler;
|
|
132
|
-
}
|
|
133
|
-
};
|
|
134
|
-
|
|
135
|
-
//#endregion
|
|
136
|
-
Object.defineProperty(exports, 'EventInterceptor', {
|
|
137
|
-
enumerable: true,
|
|
138
|
-
get: function () {
|
|
139
|
-
return EventInterceptor;
|
|
140
|
-
}
|
|
141
|
-
});
|
|
142
|
-
//# sourceMappingURL=EventInterceptor-CQEXyUTp.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"EventInterceptor-CQEXyUTp.js","names":[],"sources":["../src/components/common/EventInterceptor.ts"],"sourcesContent":["import { Awaitable, Client, ClientEvents, Events } from 'discord.js';\n\nexport interface EventInterceptorContextData<E extends keyof ClientEvents> {\n /**\n * The filter to use for the collector.\n */\n filter?: (...args: ClientEvents[E]) => Awaitable<boolean>;\n /**\n * The duration (in ms) that the collector should run for.\n */\n time?: number;\n /**\n * If the collector should automatically reset the timer when a button is clicked.\n */\n autoReset?: boolean;\n /**\n * Whether the collector should run only once.\n */\n once?: boolean;\n /**\n * The handler to run when the collector ends.\n */\n onEnd?: (reason: string) => Awaitable<void>;\n /**\n * The handler to run upon an error.\n */\n onError?: EventInterceptorErrorHandler;\n}\n\n/**\n * The error handler for the event interceptor.\n */\nexport type EventInterceptorErrorHandler = (error: Error) => Awaitable<void>;\n\n/**\n * The event interceptor class that allows subscribing to events and handling them with custom logic.\n * It also supports automatic cleanup of expired subscriptions.\n */\nexport class EventInterceptor {\n private subscribers = new Map<\n keyof ClientEvents,\n Set<(...args: any[]) => void>\n >();\n private globalHandlers = new Map<\n keyof ClientEvents,\n (...args: any[]) => void\n >();\n private cleanupTimer: NodeJS.Timeout | null = null;\n\n /**\n * Creates the event interceptor.\n */\n public constructor(public readonly client: Client) {\n this.#cleanupLoop();\n }\n\n #cleanupLoop() {\n if (this.cleanupTimer) clearInterval(this.cleanupTimer);\n\n this.cleanupTimer = setInterval(() => {\n for (const [event, handlers] of this.subscribers) {\n for (const handler of handlers) {\n const options = Reflect.get(\n handler,\n 'options',\n ) as EventInterceptorContextData<keyof ClientEvents> & {\n registeredAt: number;\n };\n\n const isExpired =\n options.time && Date.now() - options.registeredAt > options.time;\n\n if (isExpired) {\n this.unsubscribe(event, handler, 'time');\n }\n }\n }\n }, 60_000).unref();\n }\n\n /**\n * Destroys the event interceptor.\n */\n public destroy(): void {\n if (this.cleanupTimer) {\n clearInterval(this.cleanupTimer);\n this.cleanupTimer = null;\n }\n\n for (const [event, handlers] of this.subscribers) {\n for (const handler of handlers) {\n this.unsubscribe(event, handler, 'destroy');\n }\n }\n\n this.subscribers.clear();\n this.globalHandlers.clear();\n }\n\n /**\n * Whether the event has subscribers.\n * @param event The event to check.\n */\n public hasSubscribers(event: keyof ClientEvents): boolean {\n return this.subscribers.has(event);\n }\n\n /**\n * Returns the number of subscribers for the event.\n * @param event The event to check.\n */\n public getSubscriberCount(event: keyof ClientEvents): number {\n const handlers = this.subscribers.get(event);\n return handlers?.size ?? 0;\n }\n\n /**\n * Whether the event has global handlers.\n */\n public hasGlobalHandlers(): boolean {\n return this.globalHandlers.size > 0;\n }\n\n /**\n * Returns the number of global handlers.\n */\n public getGlobalHandlersCount(): number {\n return this.subscribers.size;\n }\n\n /**\n * Subscribes to an event.\n * @param event The event to subscribe to.\n * @param listener The listener to call when the event is emitted.\n * @returns A function to unsubscribe from the event.\n */\n public subscribe<Event extends keyof ClientEvents>(\n event: Event,\n listener: (...args: ClientEvents[Event]) => void,\n options?: EventInterceptorContextData<Event>,\n ): () => void {\n if (!this.subscribers.has(event)) {\n this.subscribers.set(event, new Set());\n this.client.on(event, this.createGlobalHandler(event));\n this.client.setMaxListeners(this.client.getMaxListeners() + 1);\n }\n\n options ??= {};\n\n // @ts-ignore\n options.registeredAt = Date.now();\n\n Reflect.set(listener, 'options', options);\n\n this.subscribers.get(event)!.add(listener);\n\n return () => {\n this.unsubscribe(event, listener);\n };\n }\n\n /**\n * Unsubscribes from an event.\n * @param event The event to unsubscribe from.\n */\n public unsubscribe<Event extends keyof ClientEvents>(\n event: Event,\n listener: (...args: ClientEvents[Event]) => void,\n reason?: string,\n ): void {\n const handlers = this.subscribers.get(event);\n if (!handlers) return;\n\n handlers.delete(listener);\n\n if (handlers.size < 1) {\n this.subscribers.delete(event);\n this.client.removeListener(event, this.globalHandlers.get(event)!);\n this.globalHandlers.delete(event);\n this.client.setMaxListeners(\n Math.max(this.client.getMaxListeners() - 1, 0),\n );\n }\n\n Reflect.get(listener, 'options').onEnd?.(reason ?? 'unsubscribe');\n }\n\n /**\n * Creates a global handler for the event.\n * @param event The event to create a global handler for.\n * @returns The global handler.\n */\n private createGlobalHandler<Event extends keyof ClientEvents>(\n event: Event,\n ): (...args: ClientEvents[Event]) => void {\n if (this.globalHandlers.has(event)) {\n return this.globalHandlers.get(event)!;\n }\n\n const handler = async (...args: ClientEvents[Event]) => {\n const subscribers = this.subscribers.get(event);\n if (subscribers && subscribers.size > 0) {\n for (const subscriber of subscribers) {\n const options = Reflect.get(\n subscriber,\n 'options',\n ) as EventInterceptorContextData<Event> & { registeredAt: number };\n\n const isExpired =\n options.time && Date.now() - options.registeredAt > options.time;\n\n if (isExpired) {\n this.unsubscribe(event, subscriber, 'time');\n continue;\n }\n\n if (options.autoReset) {\n options.registeredAt = Date.now();\n }\n\n if (options.filter && !(await options.filter(...args))) {\n continue;\n }\n\n try {\n await subscriber(...args);\n } catch (e) {\n if (options.onError) {\n await options.onError(<Error>e);\n } else {\n throw e;\n }\n } finally {\n if (options.once) {\n this.unsubscribe(event, subscriber, 'once');\n }\n }\n }\n }\n };\n\n this.globalHandlers.set(event, handler);\n\n return handler;\n }\n}\n"],"mappings":";;;;;;AAsCA,IAAa,mBAAb,MAA8B;CAC5B,AAAQ,8BAAc,IAAI,KAGzB;CACD,AAAQ,iCAAiB,IAAI,KAG5B;CACD,AAAQ,eAAsC;;;;CAK9C,AAAO,YAAY,AAAgB,QAAgB;EAAhB;AACjC,QAAK,aAAc;;CAGrB,eAAe;AACb,MAAI,KAAK,aAAc,eAAc,KAAK,aAAa;AAEvD,OAAK,eAAe,kBAAkB;AACpC,QAAK,MAAM,CAAC,OAAO,aAAa,KAAK,YACnC,MAAK,MAAM,WAAW,UAAU;IAC9B,MAAM,UAAU,QAAQ,IACtB,SACA,UACD;AAOD,QAFA,QAAQ,QAAQ,KAAK,KAAK,GAAG,QAAQ,eAAe,QAAQ,KAG1D,MAAK,YAAY,OAAO,SAAS,OAAO;;KAI7C,IAAO,CAAC,OAAO;;;;;CAMpB,AAAO,UAAgB;AACrB,MAAI,KAAK,cAAc;AACrB,iBAAc,KAAK,aAAa;AAChC,QAAK,eAAe;;AAGtB,OAAK,MAAM,CAAC,OAAO,aAAa,KAAK,YACnC,MAAK,MAAM,WAAW,SACpB,MAAK,YAAY,OAAO,SAAS,UAAU;AAI/C,OAAK,YAAY,OAAO;AACxB,OAAK,eAAe,OAAO;;;;;;CAO7B,AAAO,eAAe,OAAoC;AACxD,SAAO,KAAK,YAAY,IAAI,MAAM;;;;;;CAOpC,AAAO,mBAAmB,OAAmC;EAC3D,MAAM,WAAW,KAAK,YAAY,IAAI,MAAM;AAC5C,8DAAO,SAAU,SAAQ;;;;;CAM3B,AAAO,oBAA6B;AAClC,SAAO,KAAK,eAAe,OAAO;;;;;CAMpC,AAAO,yBAAiC;AACtC,SAAO,KAAK,YAAY;;;;;;;;CAS1B,AAAO,UACP,OACA,UACA,SACa;AACX,MAAI,CAAC,KAAK,YAAY,IAAI,MAAM,EAAE;AAChC,QAAK,YAAY,IAAI,uBAAO,IAAI,KAAK,CAAC;AACtC,QAAK,OAAO,GAAG,OAAO,KAAK,oBAAoB,MAAM,CAAC;AACtD,QAAK,OAAO,gBAAgB,KAAK,OAAO,iBAAiB,GAAG,EAAE;;AAGhE,cAAY,EAAE;AAGd,UAAQ,eAAe,KAAK,KAAK;AAEjC,UAAQ,IAAI,UAAU,WAAW,QAAQ;AAEzC,OAAK,YAAY,IAAI,MAAM,CAAE,IAAI,SAAS;AAE1C,eAAa;AACX,QAAK,YAAY,OAAO,SAAS;;;;;;;CAQrC,AAAO,YACP,OACA,UACA,QACO;;EACL,MAAM,WAAW,KAAK,YAAY,IAAI,MAAM;AAC5C,MAAI,CAAC,SAAU;AAEf,WAAS,OAAO,SAAS;AAEzB,MAAI,SAAS,OAAO,GAAG;AACrB,QAAK,YAAY,OAAO,MAAM;AAC9B,QAAK,OAAO,eAAe,OAAO,KAAK,eAAe,IAAI,MAAM,CAAE;AAClE,QAAK,eAAe,OAAO,MAAM;AACjC,QAAK,OAAO,gBACV,KAAK,IAAI,KAAK,OAAO,iBAAiB,GAAG,GAAG,EAAE,CAC/C;;AAGH,gDAAQ,IAAI,UAAU,UAAU,EAAC,0FAAQ,UAAU,cAAc;;;;;;;CAQnE,AAAQ,oBACR,OACyC;AACvC,MAAI,KAAK,eAAe,IAAI,MAAM,CAChC,QAAO,KAAK,eAAe,IAAI,MAAM;EAGvC,MAAM,UAAU,OAAO,GAAG,SAA8B;GACtD,MAAM,cAAc,KAAK,YAAY,IAAI,MAAM;AAC/C,OAAI,eAAe,YAAY,OAAO,EACpC,MAAK,MAAM,cAAc,aAAa;IACpC,MAAM,UAAU,QAAQ,IACtB,YACA,UACD;AAKD,QAFA,QAAQ,QAAQ,KAAK,KAAK,GAAG,QAAQ,eAAe,QAAQ,MAE7C;AACb,UAAK,YAAY,OAAO,YAAY,OAAO;AAC3C;;AAGF,QAAI,QAAQ,UACV,SAAQ,eAAe,KAAK,KAAK;AAGnC,QAAI,QAAQ,UAAU,CAAE,MAAM,QAAQ,OAAO,GAAG,KAAK,CACnD;AAGF,QAAI;AACF,WAAM,WAAW,GAAG,KAAK;aAClB,GAAG;AACV,SAAI,QAAQ,QACV,OAAM,QAAQ,QAAgB,EAAC;SAE/B,OAAM;cAEA;AACR,SAAI,QAAQ,KACV,MAAK,YAAY,OAAO,YAAY,OAAO;;;;AAOrD,OAAK,eAAe,IAAI,OAAO,QAAQ;AAEvC,SAAO"}
|
|
@@ -1,43 +0,0 @@
|
|
|
1
|
-
import { CommandKit } from "./analytics-engine-B7JNRnEN.js";
|
|
2
|
-
import { ParsedEvent } from "./EventsRouter-BacqK6z3.js";
|
|
3
|
-
import { AsyncLocalStorage } from "node:async_hooks";
|
|
4
|
-
|
|
5
|
-
//#region src/app/events/EventWorkerContext.d.ts
|
|
6
|
-
|
|
7
|
-
/**
|
|
8
|
-
* Context object containing information about the currently executing event.
|
|
9
|
-
*/
|
|
10
|
-
interface EventWorkerContext {
|
|
11
|
-
event: string;
|
|
12
|
-
namespace: string | null;
|
|
13
|
-
data: ParsedEvent;
|
|
14
|
-
commandkit: CommandKit;
|
|
15
|
-
arguments: any[];
|
|
16
|
-
variables: Map<string, any>;
|
|
17
|
-
}
|
|
18
|
-
/**
|
|
19
|
-
* Async local storage for event worker context.
|
|
20
|
-
*/
|
|
21
|
-
declare const eventWorkerContext: AsyncLocalStorage<EventWorkerContext>;
|
|
22
|
-
/**
|
|
23
|
-
* Runs a callback within an event worker context.
|
|
24
|
-
* @param context - The event worker context
|
|
25
|
-
* @param callback - The callback to execute
|
|
26
|
-
* @returns The result of the callback
|
|
27
|
-
*/
|
|
28
|
-
declare function runInEventWorkerContext<T>(context: EventWorkerContext, callback: () => T): T;
|
|
29
|
-
/**
|
|
30
|
-
* Gets the current event worker context.
|
|
31
|
-
* @returns The current event worker context
|
|
32
|
-
* @throws Error if no context is found
|
|
33
|
-
*/
|
|
34
|
-
declare function getEventWorkerContext(): EventWorkerContext;
|
|
35
|
-
/**
|
|
36
|
-
* Type guard to check if an object is an event worker context.
|
|
37
|
-
* @param worker - The object to check
|
|
38
|
-
* @returns True if the object is an event worker context
|
|
39
|
-
*/
|
|
40
|
-
declare function isEventWorkerContext(worker: any): worker is EventWorkerContext;
|
|
41
|
-
//#endregion
|
|
42
|
-
export { EventWorkerContext, eventWorkerContext, getEventWorkerContext, isEventWorkerContext, runInEventWorkerContext };
|
|
43
|
-
//# sourceMappingURL=EventWorkerContext-BMk7IXpC.d.ts.map
|
|
@@ -1,69 +0,0 @@
|
|
|
1
|
-
const require_chunk = require('./chunk-nOFOJqeH.js');
|
|
2
|
-
let node_async_hooks = require("node:async_hooks");
|
|
3
|
-
node_async_hooks = require_chunk.__toESM(node_async_hooks);
|
|
4
|
-
|
|
5
|
-
//#region src/app/events/EventWorkerContext.ts
|
|
6
|
-
/**
|
|
7
|
-
* @private
|
|
8
|
-
* @internal
|
|
9
|
-
*/
|
|
10
|
-
const kEventWorker = Symbol("commandkitEventWorker");
|
|
11
|
-
/**
|
|
12
|
-
* Async local storage for event worker context.
|
|
13
|
-
*/
|
|
14
|
-
const eventWorkerContext = new node_async_hooks.AsyncLocalStorage();
|
|
15
|
-
/**
|
|
16
|
-
* Runs a callback within an event worker context.
|
|
17
|
-
* @param context - The event worker context
|
|
18
|
-
* @param callback - The callback to execute
|
|
19
|
-
* @returns The result of the callback
|
|
20
|
-
*/
|
|
21
|
-
function runInEventWorkerContext(context, callback) {
|
|
22
|
-
Reflect.set(context, kEventWorker, true);
|
|
23
|
-
return eventWorkerContext.run(context, callback);
|
|
24
|
-
}
|
|
25
|
-
/**
|
|
26
|
-
* Gets the current event worker context.
|
|
27
|
-
* @returns The current event worker context
|
|
28
|
-
* @throws Error if no context is found
|
|
29
|
-
*/
|
|
30
|
-
function getEventWorkerContext() {
|
|
31
|
-
const context = eventWorkerContext.getStore();
|
|
32
|
-
if (!context) throw new Error("Event worker context not found");
|
|
33
|
-
return context;
|
|
34
|
-
}
|
|
35
|
-
/**
|
|
36
|
-
* Type guard to check if an object is an event worker context.
|
|
37
|
-
* @param worker - The object to check
|
|
38
|
-
* @returns True if the object is an event worker context
|
|
39
|
-
*/
|
|
40
|
-
function isEventWorkerContext(worker) {
|
|
41
|
-
return worker && Reflect.get(worker, kEventWorker) === true;
|
|
42
|
-
}
|
|
43
|
-
|
|
44
|
-
//#endregion
|
|
45
|
-
Object.defineProperty(exports, 'eventWorkerContext', {
|
|
46
|
-
enumerable: true,
|
|
47
|
-
get: function () {
|
|
48
|
-
return eventWorkerContext;
|
|
49
|
-
}
|
|
50
|
-
});
|
|
51
|
-
Object.defineProperty(exports, 'getEventWorkerContext', {
|
|
52
|
-
enumerable: true,
|
|
53
|
-
get: function () {
|
|
54
|
-
return getEventWorkerContext;
|
|
55
|
-
}
|
|
56
|
-
});
|
|
57
|
-
Object.defineProperty(exports, 'isEventWorkerContext', {
|
|
58
|
-
enumerable: true,
|
|
59
|
-
get: function () {
|
|
60
|
-
return isEventWorkerContext;
|
|
61
|
-
}
|
|
62
|
-
});
|
|
63
|
-
Object.defineProperty(exports, 'runInEventWorkerContext', {
|
|
64
|
-
enumerable: true,
|
|
65
|
-
get: function () {
|
|
66
|
-
return runInEventWorkerContext;
|
|
67
|
-
}
|
|
68
|
-
});
|
|
69
|
-
//# sourceMappingURL=EventWorkerContext-Dq29tieI.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"EventWorkerContext-Dq29tieI.js","names":[],"sources":["../src/app/events/EventWorkerContext.ts"],"sourcesContent":["import { AsyncLocalStorage } from 'node:async_hooks';\nimport { ParsedEvent } from '../router';\nimport { CommandKit } from '../../commandkit';\n\n/**\n * Context object containing information about the currently executing event.\n */\nexport interface EventWorkerContext {\n event: string;\n namespace: string | null;\n data: ParsedEvent;\n commandkit: CommandKit;\n arguments: any[];\n variables: Map<string, any>;\n}\n\n/**\n * @private\n * @internal\n */\nconst kEventWorker = Symbol('commandkitEventWorker');\n\n/**\n * Async local storage for event worker context.\n */\nexport const eventWorkerContext = new AsyncLocalStorage<EventWorkerContext>();\n\n/**\n * Runs a callback within an event worker context.\n * @param context - The event worker context\n * @param callback - The callback to execute\n * @returns The result of the callback\n */\nexport function runInEventWorkerContext<T>(\n context: EventWorkerContext,\n callback: () => T,\n): T {\n Reflect.set(context, kEventWorker, true);\n\n return eventWorkerContext.run(context, callback);\n}\n\n/**\n * Gets the current event worker context.\n * @returns The current event worker context\n * @throws Error if no context is found\n */\nexport function getEventWorkerContext(): EventWorkerContext {\n const context = eventWorkerContext.getStore();\n\n if (!context) {\n throw new Error('Event worker context not found');\n }\n\n return context;\n}\n\n/**\n * Type guard to check if an object is an event worker context.\n * @param worker - The object to check\n * @returns True if the object is an event worker context\n */\nexport function isEventWorkerContext(\n worker: any,\n): worker is EventWorkerContext {\n return worker && Reflect.get(worker, kEventWorker) === true;\n}\n"],"mappings":";;;;;;;;;AAoBA,MAAM,eAAe,OAAO,wBAAwB;;;;AAKpD,MAAa,qBAAqB,IAAI,oCAAuC;;;;;;;AAQ7E,SAAgB,wBAChB,SACA,UACI;AACF,SAAQ,IAAI,SAAS,cAAc,KAAK;AAExC,QAAO,mBAAmB,IAAI,SAAS,SAAS;;;;;;;AAQlD,SAAgB,wBAA4C;CAC1D,MAAM,UAAU,mBAAmB,UAAU;AAE7C,KAAI,CAAC,QACH,OAAM,IAAI,MAAM,iCAAiC;AAGnD,QAAO;;;;;;;AAQT,SAAgB,qBAChB,QAC+B;AAC7B,QAAO,UAAU,QAAQ,IAAI,QAAQ,aAAa,KAAK"}
|
|
@@ -1,137 +0,0 @@
|
|
|
1
|
-
const require_chunk = require('./chunk-nOFOJqeH.js');
|
|
2
|
-
let discord_js = require("discord.js");
|
|
3
|
-
discord_js = require_chunk.__toESM(discord_js);
|
|
4
|
-
let node_fs = require("node:fs");
|
|
5
|
-
node_fs = require_chunk.__toESM(node_fs);
|
|
6
|
-
let node_path = require("node:path");
|
|
7
|
-
node_path = require_chunk.__toESM(node_path);
|
|
8
|
-
let node_fs_promises = require("node:fs/promises");
|
|
9
|
-
node_fs_promises = require_chunk.__toESM(node_fs_promises);
|
|
10
|
-
|
|
11
|
-
//#region src/app/router/EventsRouter.ts
|
|
12
|
-
/**
|
|
13
|
-
* Router for discovering and managing event handler files in a directory structure.
|
|
14
|
-
* Events are represented by directories, and handlers are files within those directories.
|
|
15
|
-
*/
|
|
16
|
-
var EventsRouter = class {
|
|
17
|
-
/** Internal storage of parsed events */
|
|
18
|
-
events = new discord_js.Collection();
|
|
19
|
-
/**
|
|
20
|
-
* Creates a new EventsRouter instance
|
|
21
|
-
* @param options - Configuration options for the router
|
|
22
|
-
* @throws Error if entrypoint is not provided
|
|
23
|
-
*/
|
|
24
|
-
constructor(options) {
|
|
25
|
-
var _options$entrypoints;
|
|
26
|
-
this.options = options;
|
|
27
|
-
if (options.entrypoints) options.entrypoints = Array.from(new Set(options.entrypoints));
|
|
28
|
-
if (!((_options$entrypoints = options.entrypoints) === null || _options$entrypoints === void 0 ? void 0 : _options$entrypoints.length)) throw new Error("Entrypoint directory must be provided");
|
|
29
|
-
}
|
|
30
|
-
/**
|
|
31
|
-
* Adds new entrypoints to the router
|
|
32
|
-
* @param entrypoints - Array of new entrypoint paths
|
|
33
|
-
*/
|
|
34
|
-
addEntrypoints(entrypoints) {
|
|
35
|
-
this.options.entrypoints = Array.from(new Set([...this.options.entrypoints, ...entrypoints]));
|
|
36
|
-
}
|
|
37
|
-
/**
|
|
38
|
-
* Find a parsed event by its name
|
|
39
|
-
* @param event - Name of the event to find
|
|
40
|
-
* @returns Parsed event metadata or null if not found
|
|
41
|
-
*/
|
|
42
|
-
match(event) {
|
|
43
|
-
return this.events.get(event) ?? null;
|
|
44
|
-
}
|
|
45
|
-
/**
|
|
46
|
-
* Get the entrypoint directory path
|
|
47
|
-
* @returns Entrypoint directory path
|
|
48
|
-
*/
|
|
49
|
-
get entrypoints() {
|
|
50
|
-
return this.options.entrypoints;
|
|
51
|
-
}
|
|
52
|
-
/**
|
|
53
|
-
* Checks if the entrypoint path is valid
|
|
54
|
-
*/
|
|
55
|
-
isValidPath() {
|
|
56
|
-
return this.entrypoints.every((entrypoint) => (0, node_fs.existsSync)(entrypoint));
|
|
57
|
-
}
|
|
58
|
-
/**
|
|
59
|
-
* Clear all parsed events
|
|
60
|
-
*/
|
|
61
|
-
clear() {
|
|
62
|
-
this.events.clear();
|
|
63
|
-
}
|
|
64
|
-
/**
|
|
65
|
-
* Reload and re-scan the entrypoint directory for events
|
|
66
|
-
* @returns Promise resolving to the updated events tree
|
|
67
|
-
*/
|
|
68
|
-
async reload() {
|
|
69
|
-
this.clear();
|
|
70
|
-
return this.scan();
|
|
71
|
-
}
|
|
72
|
-
/**
|
|
73
|
-
* Scan the entrypoint directory for events and their handlers
|
|
74
|
-
* @returns Promise resolving to the events tree
|
|
75
|
-
*/
|
|
76
|
-
async scan() {
|
|
77
|
-
for (const entrypoint of this.entrypoints) {
|
|
78
|
-
const dirs = await (0, node_fs_promises.readdir)(entrypoint, { withFileTypes: true });
|
|
79
|
-
for (const dir of dirs) if (dir.isDirectory()) {
|
|
80
|
-
const path = (0, node_path.join)(entrypoint, dir.name);
|
|
81
|
-
await this.scanEvent(dir.name, path, null, [], true);
|
|
82
|
-
}
|
|
83
|
-
}
|
|
84
|
-
return Object.fromEntries(this.events);
|
|
85
|
-
}
|
|
86
|
-
/**
|
|
87
|
-
* Convert the internal events Collection to a plain object
|
|
88
|
-
* @returns Events tree as a plain object
|
|
89
|
-
*/
|
|
90
|
-
toJSON() {
|
|
91
|
-
return Object.fromEntries(this.events);
|
|
92
|
-
}
|
|
93
|
-
/**
|
|
94
|
-
* Recursively scan a directory for event handlers
|
|
95
|
-
* @param event - Name of the event
|
|
96
|
-
* @param path - Path to the event directory
|
|
97
|
-
* @param listeners - Array to collect listener file paths
|
|
98
|
-
* @returns Promise resolving to the parsed event metadata
|
|
99
|
-
*/
|
|
100
|
-
async scanEvent(event, path, _namespace = null, listeners = [], isRoot = false) {
|
|
101
|
-
const files = await (0, node_fs_promises.readdir)(path, { withFileTypes: true });
|
|
102
|
-
const isNamespace = isRoot && /^\(.+\)$/.test(event);
|
|
103
|
-
const namespace = isNamespace ? event.slice(1, -1) : _namespace ?? null;
|
|
104
|
-
files.sort((a, b) => a.name.localeCompare(b.name));
|
|
105
|
-
for (const file of files) {
|
|
106
|
-
if (file.name.startsWith("_")) continue;
|
|
107
|
-
if (file.isDirectory()) {
|
|
108
|
-
const nextPath = (0, node_path.join)(path, file.name);
|
|
109
|
-
await this.scanEvent(file.name, nextPath, namespace, listeners);
|
|
110
|
-
continue;
|
|
111
|
-
}
|
|
112
|
-
if (file.isFile() && /\.(m|c)?(j|t)sx?$/.test(file.name)) listeners.push((0, node_path.join)(file.parentPath, file.name));
|
|
113
|
-
}
|
|
114
|
-
if (!isNamespace) {
|
|
115
|
-
const existing = this.events.get(event);
|
|
116
|
-
if (existing) {
|
|
117
|
-
existing.listeners = Array.from(new Set([...existing.listeners, ...listeners]));
|
|
118
|
-
return;
|
|
119
|
-
}
|
|
120
|
-
this.events.set(event, {
|
|
121
|
-
event,
|
|
122
|
-
path,
|
|
123
|
-
listeners,
|
|
124
|
-
namespace
|
|
125
|
-
});
|
|
126
|
-
}
|
|
127
|
-
}
|
|
128
|
-
};
|
|
129
|
-
|
|
130
|
-
//#endregion
|
|
131
|
-
Object.defineProperty(exports, 'EventsRouter', {
|
|
132
|
-
enumerable: true,
|
|
133
|
-
get: function () {
|
|
134
|
-
return EventsRouter;
|
|
135
|
-
}
|
|
136
|
-
});
|
|
137
|
-
//# sourceMappingURL=EventsRouter-3Gygh-km.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"EventsRouter-3Gygh-km.js","names":[],"sources":["../src/app/router/EventsRouter.ts"],"sourcesContent":["import { Collection } from 'discord.js';\nimport { existsSync } from 'node:fs';\nimport { readdir } from 'node:fs/promises';\nimport { join } from 'node:path';\n\n/**\n * Configuration options for the EventsRouter\n * @interface EventsRouterOptions\n */\nexport interface EventsRouterOptions {\n /** Root directory path where event handlers are located */\n entrypoints: string[];\n}\n\n/**\n * Represents a parsed event with its handlers\n * @interface ParsedEvent\n */\nexport interface ParsedEvent {\n /** Name of the event derived from directory name */\n event: string;\n /** Absolute path to the event directory */\n path: string;\n /** Array of file paths to event listener handlers */\n listeners: string[];\n /** Namespace of the event */\n namespace: string | null;\n}\n\n/** Collection of event names to their parsed metadata */\nexport type EventsTree = Record<string, ParsedEvent>;\n\n/**\n * Router for discovering and managing event handler files in a directory structure.\n * Events are represented by directories, and handlers are files within those directories.\n */\nexport class EventsRouter {\n /** Internal storage of parsed events */\n private events = new Collection<string, ParsedEvent>();\n\n /**\n * Creates a new EventsRouter instance\n * @param options - Configuration options for the router\n * @throws Error if entrypoint is not provided\n */\n public constructor(private options: EventsRouterOptions) {\n if (options.entrypoints) {\n options.entrypoints = Array.from(new Set(options.entrypoints));\n }\n\n if (!options.entrypoints?.length) {\n throw new Error('Entrypoint directory must be provided');\n }\n }\n\n /**\n * Adds new entrypoints to the router\n * @param entrypoints - Array of new entrypoint paths\n */\n public addEntrypoints(entrypoints: string[]) {\n this.options.entrypoints = Array.from(\n new Set([...this.options.entrypoints, ...entrypoints]),\n );\n }\n\n /**\n * Find a parsed event by its name\n * @param event - Name of the event to find\n * @returns Parsed event metadata or null if not found\n */\n public match(event: string): ParsedEvent | null {\n return this.events.get(event) ?? null;\n }\n\n /**\n * Get the entrypoint directory path\n * @returns Entrypoint directory path\n */\n public get entrypoints(): string[] {\n return this.options.entrypoints;\n }\n\n /**\n * Checks if the entrypoint path is valid\n */\n public isValidPath() {\n return this.entrypoints.every((entrypoint) => existsSync(entrypoint));\n }\n\n /**\n * Clear all parsed events\n */\n public clear() {\n this.events.clear();\n }\n\n /**\n * Reload and re-scan the entrypoint directory for events\n * @returns Promise resolving to the updated events tree\n */\n public async reload() {\n this.clear();\n return this.scan();\n }\n\n /**\n * Scan the entrypoint directory for events and their handlers\n * @returns Promise resolving to the events tree\n */\n public async scan(): Promise<EventsTree> {\n for (const entrypoint of this.entrypoints) {\n const dirs = await readdir(entrypoint, { withFileTypes: true });\n\n for (const dir of dirs) {\n if (dir.isDirectory()) {\n const path = join(entrypoint, dir.name);\n await this.scanEvent(dir.name, path, null, [], true);\n }\n }\n }\n\n return Object.fromEntries(this.events);\n }\n\n /**\n * Convert the internal events Collection to a plain object\n * @returns Events tree as a plain object\n */\n public toJSON(): EventsTree {\n return Object.fromEntries(this.events);\n }\n\n /**\n * Recursively scan a directory for event handlers\n * @param event - Name of the event\n * @param path - Path to the event directory\n * @param listeners - Array to collect listener file paths\n * @returns Promise resolving to the parsed event metadata\n */\n private async scanEvent(\n event: string,\n path: string,\n _namespace: string | null = null,\n listeners: string[] = [],\n isRoot = false,\n ): Promise<void> {\n const files = await readdir(path, { withFileTypes: true });\n const isNamespace = isRoot && /^\\(.+\\)$/.test(event);\n\n // if event = (something) pattern then namespace is something\n const namespace = isNamespace ? event.slice(1, -1) : (_namespace ?? null);\n\n files.sort((a, b) => a.name.localeCompare(b.name));\n\n for (const file of files) {\n if (file.name.startsWith('_')) continue;\n\n if (file.isDirectory()) {\n const nextPath = join(path, file.name);\n await this.scanEvent(file.name, nextPath, namespace, listeners);\n continue;\n }\n\n if (file.isFile() && /\\.(m|c)?(j|t)sx?$/.test(file.name)) {\n listeners.push(join(file.parentPath, file.name));\n }\n }\n\n if (!isNamespace) {\n const existing = this.events.get(event);\n\n if (existing) {\n existing.listeners = Array.from(\n new Set([...existing.listeners, ...listeners]),\n );\n\n return;\n }\n\n this.events.set(event, { event, path, listeners, namespace });\n }\n }\n}\n"],"mappings":";;;;;;;;;;;;;;;AAoCA,IAAa,eAAb,MAA0B;;CAExB,AAAQ,SAAS,IAAI,uBAAiC;;;;;;CAOtD,AAAO,YAAY,AAAQ,SAA8B;;EAA9B;AACzB,MAAI,QAAQ,YACV,SAAQ,cAAc,MAAM,KAAK,IAAI,IAAI,QAAQ,YAAY,CAAC;AAGhE,MAAI,0BAAC,QAAQ,yFAAa,QACxB,OAAM,IAAI,MAAM,wCAAwC;;;;;;CAQ5D,AAAO,eAAe,aAAuB;AAC3C,OAAK,QAAQ,cAAc,MAAM,KAC/B,IAAI,IAAI,CAAC,GAAG,KAAK,QAAQ,aAAa,GAAG,YAAY,CAAC,CACvD;;;;;;;CAQH,AAAO,MAAM,OAAmC;AAC9C,SAAO,KAAK,OAAO,IAAI,MAAM,IAAI;;;;;;CAOnC,IAAW,cAAwB;AACjC,SAAO,KAAK,QAAQ;;;;;CAMtB,AAAO,cAAc;AACnB,SAAO,KAAK,YAAY,OAAO,uCAA0B,WAAW,CAAC;;;;;CAMvE,AAAO,QAAQ;AACb,OAAK,OAAO,OAAO;;;;;;CAOrB,MAAa,SAAS;AACpB,OAAK,OAAO;AACZ,SAAO,KAAK,MAAM;;;;;;CAOpB,MAAa,OAA4B;AACvC,OAAK,MAAM,cAAc,KAAK,aAAa;GACzC,MAAM,OAAO,oCAAc,YAAY,EAAE,eAAe,MAAM,CAAC;AAE/D,QAAK,MAAM,OAAO,KAChB,KAAI,IAAI,aAAa,EAAE;IACrB,MAAM,2BAAY,YAAY,IAAI,KAAK;AACvC,UAAM,KAAK,UAAU,IAAI,MAAM,MAAM,MAAM,EAAE,EAAE,KAAK;;;AAK1D,SAAO,OAAO,YAAY,KAAK,OAAO;;;;;;CAOxC,AAAO,SAAqB;AAC1B,SAAO,OAAO,YAAY,KAAK,OAAO;;;;;;;;;CAUxC,MAAc,UACd,OACA,MACA,aAA4B,MAC5B,YAAsB,EAAE,EACxB,SAAS,OACO;EACd,MAAM,QAAQ,oCAAc,MAAM,EAAE,eAAe,MAAM,CAAC;EAC1D,MAAM,cAAc,UAAU,WAAW,KAAK,MAAM;EAGpD,MAAM,YAAY,cAAc,MAAM,MAAM,GAAG,GAAG,GAAG,cAAc;AAEnE,QAAM,MAAM,GAAG,MAAM,EAAE,KAAK,cAAc,EAAE,KAAK,CAAC;AAElD,OAAK,MAAM,QAAQ,OAAO;AACxB,OAAI,KAAK,KAAK,WAAW,IAAI,CAAE;AAE/B,OAAI,KAAK,aAAa,EAAE;IACtB,MAAM,+BAAgB,MAAM,KAAK,KAAK;AACtC,UAAM,KAAK,UAAU,KAAK,MAAM,UAAU,WAAW,UAAU;AAC/D;;AAGF,OAAI,KAAK,QAAQ,IAAI,oBAAoB,KAAK,KAAK,KAAK,CACtD,WAAU,yBAAU,KAAK,YAAY,KAAK,KAAK,CAAC;;AAIpD,MAAI,CAAC,aAAa;GAChB,MAAM,WAAW,KAAK,OAAO,IAAI,MAAM;AAEvC,OAAI,UAAU;AACZ,aAAS,YAAY,MAAM,KACzB,IAAI,IAAI,CAAC,GAAG,SAAS,WAAW,GAAG,UAAU,CAAC,CAC/C;AAED;;AAGF,QAAK,OAAO,IAAI,OAAO;IAAE;IAAO;IAAM;IAAW;IAAW,CAAC"}
|
|
@@ -1,64 +0,0 @@
|
|
|
1
|
-
//#region src/logger/ILogger.d.ts
|
|
2
|
-
/**
|
|
3
|
-
* ILogger interface for logging functionality.
|
|
4
|
-
*/
|
|
5
|
-
interface ILogger {
|
|
6
|
-
/**
|
|
7
|
-
* Logs a message with the default log level.
|
|
8
|
-
* @param message The message to log.
|
|
9
|
-
*/
|
|
10
|
-
log(message: any): void;
|
|
11
|
-
/**
|
|
12
|
-
* Logs a message with the default log level using template literals.
|
|
13
|
-
* @param strings The template literal strings.
|
|
14
|
-
* @param values The values to interpolate.
|
|
15
|
-
*/
|
|
16
|
-
log(strings: TemplateStringsArray, ...values: any[]): void;
|
|
17
|
-
/**
|
|
18
|
-
* Logs an error message.
|
|
19
|
-
* @param message The error message to log.
|
|
20
|
-
*/
|
|
21
|
-
error(message: any): void;
|
|
22
|
-
/**
|
|
23
|
-
* Logs an error message using template literals.
|
|
24
|
-
* @param strings The template literal strings.
|
|
25
|
-
* @param values The values to interpolate.
|
|
26
|
-
*/
|
|
27
|
-
error(strings: TemplateStringsArray, ...values: any[]): void;
|
|
28
|
-
/**
|
|
29
|
-
* Logs a warning message.
|
|
30
|
-
* @param message The warning message to log.
|
|
31
|
-
*/
|
|
32
|
-
warn(message: any): void;
|
|
33
|
-
/**
|
|
34
|
-
* Logs a warning message using template literals.
|
|
35
|
-
* @param strings The template literal strings.
|
|
36
|
-
* @param values The values to interpolate.
|
|
37
|
-
*/
|
|
38
|
-
warn(strings: TemplateStringsArray, ...values: any[]): void;
|
|
39
|
-
/**
|
|
40
|
-
* Logs an informational message.
|
|
41
|
-
* @param message The informational message to log.
|
|
42
|
-
*/
|
|
43
|
-
info(message: any): void;
|
|
44
|
-
/**
|
|
45
|
-
* Logs an informational message using template literals.
|
|
46
|
-
* @param strings The template literal strings.
|
|
47
|
-
* @param values The values to interpolate.
|
|
48
|
-
*/
|
|
49
|
-
info(strings: TemplateStringsArray, ...values: any[]): void;
|
|
50
|
-
/**
|
|
51
|
-
* Logs a debug message.
|
|
52
|
-
* @param message The debug message to log.
|
|
53
|
-
*/
|
|
54
|
-
debug(message: any): void;
|
|
55
|
-
/**
|
|
56
|
-
* Logs a debug message using template literals.
|
|
57
|
-
* @param strings The template literal strings.
|
|
58
|
-
* @param values The values to interpolate.
|
|
59
|
-
*/
|
|
60
|
-
debug(strings: TemplateStringsArray, ...values: any[]): void;
|
|
61
|
-
}
|
|
62
|
-
//#endregion
|
|
63
|
-
export { ILogger };
|
|
64
|
-
//# sourceMappingURL=ILogger-BW8GM-YZ.d.ts.map
|
package/dist/ILogger-dQ7Y9X1f.js
DELETED
|
File without changes
|
|
@@ -1,37 +0,0 @@
|
|
|
1
|
-
import { ILogger } from "./ILogger-BW8GM-YZ.js";
|
|
2
|
-
|
|
3
|
-
//#region src/logger/Logger.d.ts
|
|
4
|
-
|
|
5
|
-
/**
|
|
6
|
-
* Options for configuring the CommandKit logger.
|
|
7
|
-
*/
|
|
8
|
-
interface CommandKitLoggerOptions {
|
|
9
|
-
/**
|
|
10
|
-
* The logger provider to use.
|
|
11
|
-
*/
|
|
12
|
-
provider: ILogger;
|
|
13
|
-
}
|
|
14
|
-
/**
|
|
15
|
-
* Logger implementation for CommandKit.
|
|
16
|
-
*/
|
|
17
|
-
interface LoggerImpl extends ILogger {
|
|
18
|
-
/**
|
|
19
|
-
* Configures the logger with the specified options.
|
|
20
|
-
* @param options The logger options to apply.
|
|
21
|
-
*/
|
|
22
|
-
configure(options: CommandKitLoggerOptions): void;
|
|
23
|
-
}
|
|
24
|
-
/**
|
|
25
|
-
* Creates a new logger instance with the specified options.
|
|
26
|
-
* @param options The options for configuring the logger.
|
|
27
|
-
* @returns A new logger instance.
|
|
28
|
-
*/
|
|
29
|
-
declare function createLogger(options: CommandKitLoggerOptions): LoggerImpl;
|
|
30
|
-
/**
|
|
31
|
-
* Default logger instance for CommandKit. This logger uses the DefaultLogger as its provider.
|
|
32
|
-
* The provider can be replaced with a custom logger implementation using the `configure` method.
|
|
33
|
-
*/
|
|
34
|
-
declare const Logger: LoggerImpl;
|
|
35
|
-
//#endregion
|
|
36
|
-
export { CommandKitLoggerOptions, Logger, LoggerImpl, createLogger };
|
|
37
|
-
//# sourceMappingURL=Logger-DyfkPk7u.d.ts.map
|