commandkit 1.0.0-dev.20250612020250 → 1.0.0-dev.20250612020833
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/dist/{CommandKit-g7NqIdUD.d.ts → CommandKit-BWzWBBGf.d.ts} +16 -1
- package/dist/{CommandKit-BqZBlSaB.js → CommandKit-BwxIJqBr.js} +10 -3
- package/dist/{CommandKit-BqZBlSaB.js.map → CommandKit-BwxIJqBr.js.map} +1 -1
- package/dist/CommandKit.d.ts +1 -1
- package/dist/CommandKit.js +1 -1
- package/dist/{EventWorkerContext-BcXmutAi.d.ts → EventWorkerContext-DdzSorsU.d.ts} +2 -2
- package/dist/analytics/analytics-engine.d.ts +1 -1
- package/dist/analytics/analytics-engine.js +1 -1
- package/dist/analytics/analytics-provider.d.ts +1 -1
- package/dist/analytics/utils.js +1 -1
- package/dist/app/commands/AppCommandRunner.d.ts +1 -1
- package/dist/app/commands/AppCommandRunner.js +1 -1
- package/dist/app/commands/Context.d.ts +1 -1
- package/dist/app/commands/Context.js +1 -1
- package/dist/app/events/EventWorkerContext.d.ts +2 -2
- package/dist/app/handlers/AppCommandHandler.d.ts +1 -1
- package/dist/app/handlers/AppCommandHandler.js +1 -1
- package/dist/app/handlers/AppEventsHandler.d.ts +1 -1
- package/dist/app/handlers/AppEventsHandler.js +1 -1
- package/dist/app/index.d.ts +1 -1
- package/dist/app/index.js +1 -1
- package/dist/app/register/CommandRegistrar.d.ts +1 -1
- package/dist/app/register/CommandRegistrar.js +1 -1
- package/dist/{build-B-Ae1hqg.js → build-m0yxcs2c.js} +2 -2
- package/dist/{build-B-Ae1hqg.js.map → build-m0yxcs2c.js.map} +1 -1
- package/dist/cli/app-process.d.ts +2 -2
- package/dist/cli/build.d.ts +1 -1
- package/dist/cli/build.js +2 -2
- package/dist/cli/common.d.ts +5 -5
- package/dist/cli/development.js +2 -2
- package/dist/cli/information.js +1 -1
- package/dist/cli/init.d.ts +1 -1
- package/dist/cli/init.js +2 -2
- package/dist/cli/production.d.ts +2 -2
- package/dist/cli/production.js +2 -2
- package/dist/components/index.js +1 -1
- package/dist/components/v1/button/Button.js +1 -1
- package/dist/components/v1/button/ButtonKit.js +1 -1
- package/dist/components/v1/modal/Modal.js +1 -1
- package/dist/components/v1/modal/ModalKit.js +1 -1
- package/dist/components/v1/select-menu/ChannelSelectMenuKit.js +1 -1
- package/dist/components/v1/select-menu/MentionableSelectMenuKit.js +1 -1
- package/dist/components/v1/select-menu/RoleSelectMenuKit.js +1 -1
- package/dist/components/v1/select-menu/SelectMenu.js +1 -1
- package/dist/components/v1/select-menu/StringSelectMenuKit.js +1 -1
- package/dist/components/v1/select-menu/UserSelectMenuKit.js +1 -1
- package/dist/config/config.d.ts +4 -4
- package/dist/config/config.js +1 -1
- package/dist/config/default.d.ts +3 -3
- package/dist/config/default.js +1 -1
- package/dist/config/loader.d.ts +3 -3
- package/dist/config/loader.js +1 -1
- package/dist/config/types.d.ts +2 -2
- package/dist/config/utils.d.ts +3 -3
- package/dist/{config-CGECBFwj.d.ts → config-BEl-UW2l.d.ts} +3 -3
- package/dist/context/async-context.d.ts +1 -1
- package/dist/context/async-context.js +1 -1
- package/dist/context/environment.d.ts +1 -1
- package/dist/context/environment.js +1 -1
- package/dist/events/CommandKitEventsChannel.d.ts +1 -1
- package/dist/{feature-flags-CvHcOB7L.js → feature-flags-DG5Ozd1p.js} +2 -2
- package/dist/{feature-flags-CvHcOB7L.js.map → feature-flags-DG5Ozd1p.js.map} +1 -1
- package/dist/flags/FlagProvider.d.ts +1 -1
- package/dist/flags/feature-flags.d.ts +1 -1
- package/dist/flags/feature-flags.js +2 -2
- package/dist/flags/store.d.ts +1 -1
- package/dist/index.d.ts +6 -6
- package/dist/index.js +4 -4
- package/dist/{init-BQgLOfl_.js → init-8cDqgA8y.js} +2 -2
- package/dist/{init-BQgLOfl_.js.map → init-8cDqgA8y.js.map} +1 -1
- package/dist/{init-C62l0PVB.d.ts → init-CT348Okf.d.ts} +3 -3
- package/dist/logger/DefaultLogger.js +1 -1
- package/dist/logger/Logger.js +1 -1
- package/dist/plugins/CompilerPlugin.d.ts +1 -1
- package/dist/plugins/PluginCommon.d.ts +1 -1
- package/dist/plugins/RuntimePlugin.d.ts +1 -1
- package/dist/plugins/index.d.ts +1 -1
- package/dist/plugins/index.js +1 -1
- package/dist/plugins/plugin-runtime/CommandKitPluginRuntime.d.ts +1 -1
- package/dist/plugins/plugin-runtime/CommandKitPluginRuntime.js +1 -1
- package/dist/plugins/plugin-runtime/CompilerPluginRuntime.d.ts +1 -1
- package/dist/plugins/plugin-runtime/builtin/CommonDirectiveTransformer.d.ts +1 -1
- package/dist/plugins/plugin-runtime/builtin/CommonDirectiveTransformer.js +1 -1
- package/dist/plugins/plugin-runtime/builtin/MacroPlugin.d.ts +1 -1
- package/dist/plugins/plugin-runtime/builtin/MacroPlugin.js +1 -1
- package/dist/plugins/plugin-runtime/runtime.d.ts +1 -1
- package/dist/plugins/types.d.ts +1 -1
- package/dist/{types-uBjT82V4.d.ts → types-C8GYFCIt.d.ts} +2 -2
- package/dist/types.d.ts +1 -1
- package/dist/utils/dev-hooks.d.ts +1 -1
- package/dist/utils/dev-hooks.js +1 -1
- package/dist/utils/utilities.js +1 -1
- package/dist/{utils-Bz_BoOnV.d.ts → utils-BjK-2R7h.d.ts} +2 -2
- package/dist/{version-h3LKCH2x.js → version-gm8LnvMg.js} +2 -2
- package/dist/{version-h3LKCH2x.js.map → version-gm8LnvMg.js.map} +1 -1
- package/dist/version.js +1 -1
- package/package.json +2 -2
|
@@ -587,8 +587,23 @@ declare class MiddlewareContext<T extends CommandExecutionMode = CommandExecutio
|
|
|
587
587
|
}
|
|
588
588
|
//#endregion
|
|
589
589
|
//#region src/app/commands/AppCommandRunner.d.ts
|
|
590
|
+
/**
|
|
591
|
+
* Options for running a command in CommandKit.
|
|
592
|
+
*/
|
|
590
593
|
interface RunCommandOptions {
|
|
594
|
+
/**
|
|
595
|
+
* The handler to use for executing the command.
|
|
596
|
+
* If not provided, the execution mode will determine the handler.
|
|
597
|
+
* For example, 'chatInputCommand', 'message', etc.
|
|
598
|
+
*/
|
|
591
599
|
handler?: string;
|
|
600
|
+
/**
|
|
601
|
+
* Whether to throw an error if the command execution fails.
|
|
602
|
+
* If true, any error during execution will be thrown.
|
|
603
|
+
* Default is false, which means errors will be logged but not thrown.
|
|
604
|
+
* @default false
|
|
605
|
+
*/
|
|
606
|
+
throwOnError?: boolean;
|
|
592
607
|
}
|
|
593
608
|
/**
|
|
594
609
|
* Handles the execution of application commands for CommandKit.
|
|
@@ -2010,4 +2025,4 @@ declare class CommandKit extends EventEmitter {
|
|
|
2010
2025
|
declare const commandkit: CommandKit;
|
|
2011
2026
|
//#endregion
|
|
2012
2027
|
export { AnalyticsEngine, AnalyticsEvent, AnalyticsProvider, AnyCommandExecute, AppCommand, AppCommandHandler, AppCommandNative, AppCommandRunner, AppEventsHandler, AppEventsHandlerLoadedData, AsyncFunction, AutocompleteCommand, AutocompleteCommandContext, AutocompleteCommandMiddlewareContext, BootstrapFunction, ChatInputCommand, ChatInputCommandContext, CommandBuilderLike, CommandContext, CommandContextOptions, CommandData, CommandExecutionMode, CommandFlagContext, CommandKit, CommandKitConfiguration, CommandKitEnvironment, CommandKitEnvironmentInternalData, CommandKitEnvironmentType, CommandKitEventDispatch, CommandKitEventsChannel, CommandKitHMREvent, CommandKitOptions, CommandKitPlugin, CommandKitPluginRuntime, CommandRegistrar, CommandTypeData, CommonDirectiveTransformer, CommonDirectiveTransformerOptions, CommonPluginRuntime, CompilerPlugin, CompilerPluginRuntime, Context, ContextParameters, CustomAppCommandProps, CustomEvaluationContext, CustomEvaluationFunction, DecideFunction, EvaluationContext, EventFlagContext, EventListener, FeatureFlag, FeatureFlagDefinition, FilterFunction, FlagConfiguration, FlagProvider, FlagRunner, FlagStore, GenericFunction, IdentifyEvent, IdentifyFunction, InteractionCommandContext, InteractionCommandMiddlewareContext, IpcMessageCommand, JsonFlagProvider, ListenerFunction, LoadedCommand, LoadedEvent, MaybeFalsey, MaybePromise, MessageCommand, MessageCommandContext, MessageCommandMiddlewareContext, MessageContextMenuCommand, MessageContextMenuCommandContext, MessageContextMenuCommandMiddlewareContext, MiddlewareContext, MiddlewareContextArgs, PluginCommon, PluginOptions, PluginTransformParameters, PluginType, PreRegisterCommandsEvent, PreparedAppCommandExecution, ResolvableCommand, RunCommand, RunCommandOptions, RuntimePlugin, SlashCommandMiddlewareContext, TemplateHandler, TransformedResult, UserContextMenuCommand, UserContextMenuCommandContext, UserContextMenuCommandMiddlewareContext, after, cancelAfter, commandkit, exitContext, flag, getCommandKit, getContext, isCommandWorkerContext, isCompilerPlugin, isPlugin, isRuntimePlugin, makeContextAwareFunction, onApplicationBootstrap, onBootstrap, provideContext, registerDevHooks, setFlagProvider, useEnvironment };
|
|
2013
|
-
//# sourceMappingURL=CommandKit-
|
|
2028
|
+
//# sourceMappingURL=CommandKit-BWzWBBGf.d.ts.map
|
|
@@ -2476,6 +2476,7 @@ var AppCommandRunner = class {
|
|
|
2476
2476
|
*/
|
|
2477
2477
|
async runCommand(prepared, source, options) {
|
|
2478
2478
|
const { commandkit: commandkit$1 } = this.handler;
|
|
2479
|
+
const shouldThrowOnError = !!(options === null || options === void 0 ? void 0 : options.throwOnError);
|
|
2479
2480
|
const executionMode = this.getExecutionMode(source);
|
|
2480
2481
|
let runCommand = null;
|
|
2481
2482
|
const env = new CommandKitEnvironment(commandkit$1);
|
|
@@ -2565,9 +2566,15 @@ var AppCommandRunner = class {
|
|
|
2565
2566
|
if (!res) result = await executeCommand();
|
|
2566
2567
|
} catch (e) {
|
|
2567
2568
|
if (require_error_codes.isErrorType(e, require_error_codes.CommandKitErrorCodes.ExitMiddleware)) middlewaresCanceled = true;
|
|
2568
|
-
if (!require_error_codes.isErrorType(e, [require_error_codes.CommandKitErrorCodes.ForwardedCommand, require_error_codes.CommandKitErrorCodes.ExitMiddleware]))
|
|
2569
|
+
if (!require_error_codes.isErrorType(e, [require_error_codes.CommandKitErrorCodes.ForwardedCommand, require_error_codes.CommandKitErrorCodes.ExitMiddleware])) {
|
|
2570
|
+
if (shouldThrowOnError) throw e;
|
|
2571
|
+
Logger.error(e);
|
|
2572
|
+
}
|
|
2569
2573
|
}
|
|
2570
|
-
}
|
|
2574
|
+
} else result = {
|
|
2575
|
+
error: true,
|
|
2576
|
+
message: "Command execution was cancelled by the middleware."
|
|
2577
|
+
};
|
|
2571
2578
|
if (!middlewaresCanceled && prepared.middlewares.length) await provideContext(env, async () => {
|
|
2572
2579
|
for (const middleware of prepared.middlewares) {
|
|
2573
2580
|
if (!middleware.data.afterExecute) continue;
|
|
@@ -4124,4 +4131,4 @@ Object.defineProperty(exports, 'useEnvironment', {
|
|
|
4124
4131
|
return useEnvironment;
|
|
4125
4132
|
}
|
|
4126
4133
|
});
|
|
4127
|
-
//# sourceMappingURL=CommandKit-
|
|
4134
|
+
//# sourceMappingURL=CommandKit-BwxIJqBr.js.map
|