commandkit 1.2.0-dev.20250825125304 → 1.2.0-dev.20250826015841
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/{EventWorkerContext-DiMpRt1P.d.ts → EventWorkerContext-BEezHh5-.d.ts} +2 -2
- package/dist/{EventWorkerContext-CSlD9rbx.js → EventWorkerContext-TZIKxVCu.js} +1 -1
- package/dist/{EventWorkerContext-CSlD9rbx.js.map → EventWorkerContext-TZIKxVCu.js.map} +1 -1
- package/dist/{MessageCommandParser-B_BEQ3p8.js → MessageCommandParser-TPEPhjvx.js} +2 -2
- package/dist/{MessageCommandParser-B_BEQ3p8.js.map → MessageCommandParser-TPEPhjvx.js.map} +1 -1
- package/dist/analytics/analytics-engine.d.ts +2 -2
- package/dist/analytics/analytics-engine.js +6 -6
- package/dist/analytics/analytics-provider.d.ts +2 -2
- package/dist/analytics/constants.js +1 -1
- package/dist/analytics/utils.js +6 -6
- package/dist/{analytics-engine-Ddw9axi4.d.ts → analytics-engine-Iu_1uJop.d.ts} +2 -17
- package/dist/app/commands/AppCommandRunner.d.ts +2 -2
- package/dist/app/commands/AppCommandRunner.js +6 -6
- package/dist/app/commands/Context.d.ts +2 -2
- package/dist/app/commands/Context.js +6 -6
- package/dist/app/commands/MessageCommandParser.js +2 -2
- package/dist/app/events/EventWorkerContext.d.ts +3 -3
- package/dist/app/events/EventWorkerContext.js +1 -1
- package/dist/app/handlers/AppCommandHandler.d.ts +2 -2
- package/dist/app/handlers/AppCommandHandler.js +6 -6
- package/dist/app/handlers/AppEventsHandler.d.ts +2 -2
- package/dist/app/handlers/AppEventsHandler.js +6 -6
- package/dist/app/index.d.ts +3 -3
- package/dist/app/index.js +8 -8
- package/dist/app/interrupt/signals.d.ts +2 -2
- package/dist/app/interrupt/signals.js +5 -5
- package/dist/app/middlewares/permissions.d.ts +2 -2
- package/dist/app/middlewares/permissions.js +6 -6
- package/dist/app/register/CommandRegistrar.d.ts +2 -2
- package/dist/app/register/CommandRegistrar.js +6 -6
- package/dist/{build-CoJqJ17n.js → build-Yhb1VjD0.js} +2 -2
- package/dist/build-Yhb1VjD0.js.map +1 -0
- package/dist/cli/build.d.ts +2 -2
- package/dist/cli/build.js +7 -7
- package/dist/cli/common.d.ts +2 -2
- package/dist/cli/development.js +8 -8
- package/dist/cli/development.js.map +1 -1
- package/dist/cli/information.js +1 -1
- package/dist/cli/init.js +7 -7
- package/dist/cli/production.js +7 -7
- package/dist/{commandkit-CYJ8d2gj.js → commandkit-c0sAaK0G.js} +123 -133
- package/dist/commandkit-c0sAaK0G.js.map +1 -0
- package/dist/commandkit.d.ts +2 -2
- package/dist/commandkit.js +6 -6
- package/dist/components/index.js +6 -6
- package/dist/components/v1/button/Button.js +6 -6
- package/dist/components/v1/button/ButtonKit.js +6 -6
- package/dist/components/v1/modal/Modal.js +6 -6
- package/dist/components/v1/modal/ModalKit.js +6 -6
- package/dist/components/v1/select-menu/ChannelSelectMenuKit.js +6 -6
- package/dist/components/v1/select-menu/MentionableSelectMenuKit.js +6 -6
- package/dist/components/v1/select-menu/RoleSelectMenuKit.js +6 -6
- package/dist/components/v1/select-menu/SelectMenu.js +6 -6
- package/dist/components/v1/select-menu/StringSelectMenuKit.js +6 -6
- package/dist/components/v1/select-menu/UserSelectMenuKit.js +6 -6
- package/dist/config/config.d.ts +3 -3
- package/dist/config/config.js +6 -6
- package/dist/config/default.d.ts +2 -2
- package/dist/config/default.js +6 -6
- package/dist/config/loader.d.ts +2 -2
- package/dist/config/loader.js +6 -6
- package/dist/config/types.d.ts +2 -2
- package/dist/config/utils.d.ts +2 -2
- package/dist/{config-C4nHXErw.d.ts → config-ClEaYnf1.d.ts} +2 -2
- package/dist/{constants-CUND8XkG.js → constants-DxfYtA6t.js} +1 -1
- package/dist/{constants-CUND8XkG.js.map → constants-DxfYtA6t.js.map} +1 -1
- package/dist/context/async-context.d.ts +2 -2
- package/dist/context/async-context.js +6 -6
- package/dist/context/environment.d.ts +2 -2
- package/dist/context/environment.js +6 -6
- package/dist/{error-codes-BzoEctmD.d.ts → error-codes-B4TyW4Ct.d.ts} +2 -2
- package/dist/{error-codes-C-ViHyu-.js → error-codes-Ds0bnPvT.js} +2 -2
- package/dist/error-codes-Ds0bnPvT.js.map +1 -0
- package/dist/events/CommandKitEventsChannel.d.ts +2 -2
- package/dist/{feature-flags-Co2WUAIe.js → feature-flags-Dxi9TI2e.js} +5 -5
- package/dist/{feature-flags-Co2WUAIe.js.map → feature-flags-Dxi9TI2e.js.map} +1 -1
- package/dist/flags/FlagProvider.d.ts +2 -2
- package/dist/flags/feature-flags.d.ts +2 -2
- package/dist/flags/feature-flags.js +7 -7
- package/dist/flags/store.d.ts +2 -2
- package/dist/index.d.ts +6 -6
- package/dist/index.js +12 -12
- package/dist/index.js.map +1 -1
- package/dist/{init-CEuxl8qP.js → init-CrFvqdxZ.js} +2 -2
- package/dist/{init-CEuxl8qP.js.map → init-CrFvqdxZ.js.map} +1 -1
- package/dist/logger/DefaultLogger.js +6 -6
- package/dist/logger/Logger.js +6 -6
- package/dist/plugins/CompilerPlugin.d.ts +2 -2
- package/dist/plugins/PluginCommon.d.ts +2 -2
- package/dist/plugins/RuntimePlugin.d.ts +2 -2
- package/dist/plugins/index.d.ts +2 -2
- package/dist/plugins/index.js +6 -6
- package/dist/plugins/plugin-runtime/CommandKitPluginRuntime.d.ts +2 -2
- package/dist/plugins/plugin-runtime/CommandKitPluginRuntime.js +6 -6
- package/dist/plugins/plugin-runtime/CompilerPluginRuntime.d.ts +2 -2
- package/dist/plugins/plugin-runtime/CompilerPluginRuntime.js +6 -6
- package/dist/plugins/plugin-runtime/builtin/CommonDirectiveTransformer.d.ts +2 -2
- package/dist/plugins/plugin-runtime/builtin/CommonDirectiveTransformer.js +6 -6
- package/dist/plugins/plugin-runtime/builtin/MacroPlugin.d.ts +2 -2
- package/dist/plugins/plugin-runtime/builtin/MacroPlugin.js +6 -6
- package/dist/plugins/plugin-runtime/runtime.d.ts +2 -2
- package/dist/plugins/types.d.ts +2 -2
- package/dist/{signals-BQbEfy3X.d.ts → signals-SHg7J1U_.d.ts} +4 -7
- package/dist/{signals-DHdYrd-n.js → signals-r7qPAvOR.js} +12 -15
- package/dist/signals-r7qPAvOR.js.map +1 -0
- package/dist/types.d.ts +2 -2
- package/dist/utils/dev-hooks.d.ts +2 -2
- package/dist/utils/dev-hooks.js +6 -6
- package/dist/utils/error-codes.d.ts +1 -1
- package/dist/utils/error-codes.js +1 -1
- package/dist/utils/utilities.js +6 -6
- package/dist/{version-B_bKw4jL.js → version-Dye7khwD.js} +2 -2
- package/dist/{version-B_bKw4jL.js.map → version-Dye7khwD.js.map} +1 -1
- package/dist/version.js +1 -1
- package/package.json +60 -59
- package/dist/build-CoJqJ17n.js.map +0 -1
- package/dist/commandkit-CYJ8d2gj.js.map +0 -1
- package/dist/error-codes-C-ViHyu-.js.map +0 -1
- package/dist/signals-DHdYrd-n.js.map +0 -1
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { CommandKit } from "./analytics-engine-
|
|
1
|
+
import { CommandKit } from "./analytics-engine-Iu_1uJop.js";
|
|
2
2
|
import { ParsedEvent } from "./EventsRouter-BacqK6z3.js";
|
|
3
3
|
import { AsyncLocalStorage } from "node:async_hooks";
|
|
4
4
|
|
|
@@ -40,4 +40,4 @@ declare function getEventWorkerContext(): EventWorkerContext;
|
|
|
40
40
|
declare function isEventWorkerContext(worker: any): worker is EventWorkerContext;
|
|
41
41
|
//#endregion
|
|
42
42
|
export { EventWorkerContext, eventWorkerContext, getEventWorkerContext, isEventWorkerContext, runInEventWorkerContext };
|
|
43
|
-
//# sourceMappingURL=EventWorkerContext-
|
|
43
|
+
//# sourceMappingURL=EventWorkerContext-BEezHh5-.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"EventWorkerContext-
|
|
1
|
+
{"version":3,"file":"EventWorkerContext-TZIKxVCu.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;;;;AAK5B,MAAa,qBAAqB,IAAI;;;;;;;AAQtC,SAAgB,wBAChB,SACA,UACI;AACF,SAAQ,IAAI,SAAS,cAAc;AAEnC,QAAO,mBAAmB,IAAI,SAAS;;;;;;;AAQzC,SAAgB,wBAA4C;CAC1D,MAAM,UAAU,mBAAmB;AAEnC,KAAI,CAAC,QACH,OAAM,IAAI,MAAM;AAGlB,QAAO;;;;;;;AAQT,SAAgB,qBAChB,QAC+B;AAC7B,QAAO,UAAU,QAAQ,IAAI,QAAQ,kBAAkB"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
const require_chunk = require('./chunk-nOFOJqeH.js');
|
|
2
|
-
const require_error_codes = require('./error-codes-
|
|
2
|
+
const require_error_codes = require('./error-codes-Ds0bnPvT.js');
|
|
3
3
|
const discord_js = require_chunk.__toESM(require("discord.js"));
|
|
4
4
|
|
|
5
5
|
//#region src/app/commands/MessageCommandParser.ts
|
|
@@ -265,4 +265,4 @@ Object.defineProperty(exports, 'MessageCommandParser', {
|
|
|
265
265
|
return MessageCommandParser;
|
|
266
266
|
}
|
|
267
267
|
});
|
|
268
|
-
//# sourceMappingURL=MessageCommandParser-
|
|
268
|
+
//# sourceMappingURL=MessageCommandParser-TPEPhjvx.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"MessageCommandParser-B_BEQ3p8.js","names":[],"sources":["../src/app/commands/MessageCommandParser.ts"],"sourcesContent":["import { Channel } from 'diagnostics_channel';\nimport {\n Message,\n ApplicationCommandOptionType,\n GuildMember,\n Attachment,\n User,\n Role,\n CommandInteractionOption,\n} from 'discord.js';\nimport {\n CommandKitErrorCodes,\n createCommandKitError,\n} from '../../utils/error-codes';\n\n/**\n * Represents a parsed message command with its components.\n */\nexport interface ParsedMessageCommand {\n command: string;\n options: { name: string; value: unknown }[];\n subcommand?: string;\n subcommandGroup?: string;\n}\n\n/**\n * Schema defining the types of options for a message command.\n */\nexport type MessageCommandOptionsSchema = Record<\n string,\n ApplicationCommandOptionType\n>;\n\n/**\n * Parses message content into structured command data with options and subcommands.\n */\nexport class MessageCommandParser {\n /**\n * @private\n * @internal\n */\n #parsed: ParsedMessageCommand | null = null;\n\n /**\n * @private\n * @internal\n */\n #options: MessageCommandOptions | null = null;\n\n /**\n * @private\n * @internal\n */\n #args: string[] = [];\n\n /**\n * Creates a new message command parser.\n * @param message - The Discord message to parse\n * @param prefix - Array of valid command prefixes\n * @param schema - Function that returns the options schema for a command\n */\n public constructor(\n public message: Message,\n private prefix: string[],\n private schema: (command: string) => MessageCommandOptionsSchema,\n ) {}\n\n /**\n * Gets the parsed command arguments.\n * @returns Array of command arguments\n */\n public getArgs() {\n void this.parse();\n return this.#args;\n }\n\n /**\n * Gets the message command options object for easy access to typed option values.\n */\n public get options() {\n if (!this.#options) {\n this.#options = new MessageCommandOptions(this);\n }\n\n return this.#options;\n }\n\n /**\n * Gets a specific option value by name.\n * @param name - The option name\n * @returns The option value or undefined if not found\n */\n public getOption<T>(name: string): T | undefined {\n return this.parse().options.find((o) => o.name === name)?.value as T;\n }\n\n /**\n * Gets the main command name.\n * @returns The command name\n */\n public getCommand(): string {\n return this.parse().command;\n }\n\n /**\n * Gets the subcommand name if present.\n * @returns The subcommand name or undefined\n */\n public getSubcommand(): string | undefined {\n return this.parse().subcommand;\n }\n\n /**\n * Gets the subcommand group name if present.\n * @returns The subcommand group name or undefined\n */\n public getSubcommandGroup(): string | undefined {\n return this.parse().subcommandGroup;\n }\n\n /**\n * Gets the prefix used in the message.\n * @returns The matched prefix or undefined\n */\n public getPrefix() {\n for (const p of this.prefix) {\n if (this.message.content.startsWith(p)) {\n return p;\n }\n }\n }\n\n /**\n * Gets the full command including subcommand group and subcommand.\n * @returns The complete command string\n */\n public getFullCommand() {\n return [this.getCommand(), this.getSubcommandGroup(), this.getSubcommand()]\n .filter((v) => v)\n .join(' ');\n }\n\n /**\n * Parses the message content into structured command data.\n * @returns The parsed command data\n */\n public parse(): ParsedMessageCommand {\n if (this.#parsed) {\n return this.#parsed;\n }\n\n const content = this.message.content;\n\n const prefix = this.getPrefix();\n\n if (!prefix) {\n throw createCommandKitError(CommandKitErrorCodes.InvalidCommandPrefix);\n }\n\n const parts = content.slice(prefix.length).trim().split(' ');\n const command = parts.shift();\n\n this.#args = parts;\n\n let subcommandGroup: string | undefined;\n let subcommand: string | undefined;\n\n if (command?.includes(':')) {\n const [, group, cmd] = command.split(':');\n\n if (!cmd && group) {\n subcommand = group;\n } else if (cmd && group) {\n subcommandGroup = group;\n subcommand = cmd;\n }\n }\n\n const schema = this.schema(\n [command, subcommandGroup, subcommand].filter(Boolean).join(' ').trim(),\n );\n\n const options = parts\n .map((part) => {\n try {\n const [name, value] = part.split(':');\n\n if (!(name in schema)) return null;\n\n switch (schema[name]) {\n case ApplicationCommandOptionType.Boolean:\n return { name, value: value === 'true' };\n case ApplicationCommandOptionType.Integer:\n return { name, value: parseInt(value, 10) };\n case ApplicationCommandOptionType.Number:\n return { name, value: parseFloat(value) };\n case ApplicationCommandOptionType.String:\n return { name, value };\n case ApplicationCommandOptionType.User:\n return {\n name,\n value: this.message.mentions.users.find((u) => {\n return u.id === value.replace(/[<@!>]/g, '');\n }),\n };\n case ApplicationCommandOptionType.Channel:\n return {\n name,\n value: this.message.mentions.channels.find((c) => {\n return c.id === value.replace(/[<#>]/g, '');\n }),\n };\n case ApplicationCommandOptionType.Role:\n return {\n name,\n value: this.message.mentions.roles.find((r) => {\n return r.id === value.replace(/[<@&>]/g, '');\n }),\n };\n case ApplicationCommandOptionType.Attachment:\n return {\n name,\n value: this.message.attachments.find((a) => {\n return a.name === value;\n }),\n };\n default:\n return null;\n }\n } catch {\n // Invalid option\n return null;\n }\n })\n .filter((v) => v !== null);\n\n this.#parsed = {\n command: command!,\n options,\n subcommand,\n subcommandGroup,\n };\n\n return this.#parsed;\n }\n}\n\n/**\n * Provides typed access to message command options with methods similar to Discord.js interaction options.\n */\nexport class MessageCommandOptions {\n /**\n * Creates a new message command options instance.\n * @param parser - The message command parser instance\n */\n public constructor(private parser: MessageCommandParser) {}\n\n /**\n * @private\n * @internal\n */\n private assertOption<T>(name: string, required = false) {\n const option = this.parser.getOption<T>(name);\n\n if (required && option === undefined) {\n throw new Error(`Option \"${name}\" is required.`);\n }\n\n return option ?? null;\n }\n\n /**\n * Gets a guild member from the command options.\n * @param name - The option name\n * @param required - Whether the option is required\n * @returns The guild member or null if not found\n */\n getMember(name: string): GuildMember | null;\n getMember(name: string, required: true): GuildMember;\n getMember(name: string, required = false) {\n const user = this.assertOption<User>(name, required);\n const member = this.parser.message.guild?.members.cache.get(user?.id!);\n\n if (required && !member) {\n throw new Error(`Member \"${name}\" is required.`);\n }\n\n return member ?? null;\n }\n\n /**\n * Gets an attachment from the command options.\n * @param name - The option name\n * @param required - Whether the option is required\n * @returns The attachment or null if not found\n */\n getAttachment(name: string): Attachment | null;\n getAttachment(name: string, required: true): Attachment;\n getAttachment(name: string, required = false) {\n return this.assertOption<Attachment>(name, required);\n }\n\n /**\n * Gets a boolean value from the command options.\n * @param name - The option name\n * @param required - Whether the option is required\n * @returns The boolean value or null if not found\n */\n getBoolean(name: string): boolean | null;\n getBoolean(name: string, required: true): boolean;\n getBoolean(name: string, required = false) {\n return this.assertOption<boolean>(name, required);\n }\n\n /**\n * Gets a number value from the command options.\n * @param name - The option name\n * @param required - Whether the option is required\n * @returns The number value or null if not found\n */\n getNumber(name: string): number | null;\n getNumber(name: string, required: true): number;\n getNumber(name: string, required = false) {\n return this.assertOption<number>(name, required);\n }\n\n /**\n * Gets a string value from the command options.\n * @param name - The option name\n * @param required - Whether the option is required\n * @returns The string value or null if not found\n */\n getString(name: string): string | null;\n getString(name: string, required: true): string;\n getString(name: string, required = false) {\n return this.assertOption<string>(name, required);\n }\n\n /**\n * Gets an integer value from the command options.\n * @param name - The option name\n * @param required - Whether the option is required\n * @returns The integer value or null if not found\n */\n getInteger(name: string): number | null;\n getInteger(name: string, required: true): number;\n getInteger(name: string, required = false) {\n return this.assertOption<number>(name, required);\n }\n\n /**\n * Gets a user from the command options.\n * @param name - The option name\n * @param required - Whether the option is required\n * @returns The user or null if not found\n */\n getUser(name: string): User | null;\n getUser(name: string, required: true): User;\n getUser(name: string, required = false) {\n return this.assertOption<User>(name, required);\n }\n\n /**\n * Gets a channel from the command options.\n * @param name - The option name\n * @param required - Whether the option is required\n * @returns The channel or null if not found\n */\n getChannel(name: string): Channel | null;\n getChannel(name: string, required: true): Channel;\n getChannel(name: string, required = false) {\n return this.assertOption<Channel>(name, required);\n }\n\n /**\n * Gets a role from the command options.\n * @param name - The option name\n * @param required - Whether the option is required\n * @returns The role or null if not found\n */\n getRole(name: string): Role | null;\n getRole(name: string, required: true): Role;\n getRole(name: string, required = false) {\n return this.assertOption<Role>(name, required);\n }\n\n /**\n * Gets a mentionable (user, member, or role) from the command options.\n * @param name - The option name\n * @param required - Whether the option is required\n * @returns The mentionable or null if not found\n */\n getMentionable(\n name: string,\n ): NonNullable<CommandInteractionOption['member' | 'role' | 'user']> | null;\n getMentionable(\n name: string,\n required: true,\n ): NonNullable<CommandInteractionOption['member' | 'role' | 'user']>;\n getMentionable(\n name: string,\n required = false,\n ): NonNullable<CommandInteractionOption['member' | 'role' | 'user']> | null {\n const target = this.assertOption(name, required);\n\n if (\n target instanceof GuildMember ||\n target instanceof User ||\n target instanceof Role\n ) {\n return target;\n }\n\n if (required) {\n throw new Error(`Mentionable \"${name}\" is required.`);\n }\n\n return null;\n }\n\n /**\n * Gets the subcommand name from the command.\n * @param required - Whether the subcommand is required\n * @returns The subcommand name or null if not found\n */\n getSubcommand(): string | null;\n getSubcommand(required: true): string;\n getSubcommand(required = false) {\n const sub = this.parser.getSubcommand();\n\n if (required && sub === undefined) {\n throw new Error('Subcommand is required.');\n }\n\n return sub ?? null;\n }\n\n /**\n * Gets the subcommand group name from the command.\n * @param required - Whether the subcommand group is required\n * @returns The subcommand group name or null if not found\n */\n getSubcommandGroup(): string | null;\n getSubcommandGroup(required: true): string;\n getSubcommandGroup(required = false) {\n const sub = this.parser.getSubcommandGroup();\n\n if (required && sub === undefined) {\n throw new Error('Subcommand group is required.');\n }\n\n return sub ?? null;\n }\n}\n"],"mappings":";;;;;;;;AAoCA,IAAa,uBAAb,MAAkC;;;;;CAKhC,UAAuC;;;;;CAMvC,WAAyC;;;;;CAMzC,QAAkB;;;;;;;CAQlB,AAAO,YACP,AAAO,SACP,AAAQ,QACR,AAAQ,QACR;EAHO;EACC;EACA;;;;;;CAOR,AAAO,UAAU;AACf,EAAK,KAAK;AACV,SAAO,MAAK;;;;;CAMd,IAAW,UAAU;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,KAAM;AAElE,MAAI,YAAY,CAAC,OACf,OAAM,IAAI,MAAM,WAAW,KAAK;AAGlC,SAAO,UAAU;;CAWnB,cAAc,MAAc,WAAW,OAAO;AAC5C,SAAO,KAAK,aAAyB,MAAM;;CAW7C,WAAW,MAAc,WAAW,OAAO;AACzC,SAAO,KAAK,aAAsB,MAAM;;CAW1C,UAAU,MAAc,WAAW,OAAO;AACxC,SAAO,KAAK,aAAqB,MAAM;;CAWzC,UAAU,MAAc,WAAW,OAAO;AACxC,SAAO,KAAK,aAAqB,MAAM;;CAWzC,WAAW,MAAc,WAAW,OAAO;AACzC,SAAO,KAAK,aAAqB,MAAM;;CAWzC,QAAQ,MAAc,WAAW,OAAO;AACtC,SAAO,KAAK,aAAmB,MAAM;;CAWvC,WAAW,MAAc,WAAW,OAAO;AACzC,SAAO,KAAK,aAAsB,MAAM;;CAW1C,QAAQ,MAAc,WAAW,OAAO;AACtC,SAAO,KAAK,aAAmB,MAAM;;CAgBvC,eACA,MACA,WAAW,OACgE;EACzE,MAAM,SAAS,KAAK,aAAa,MAAM;AAEvC,MACA,kBAAkB,0BAClB,kBAAkB,mBAClB,kBAAkB,gBAEhB,QAAO;AAGT,MAAI,SACF,OAAM,IAAI,MAAM,gBAAgB,KAAK;AAGvC,SAAO;;CAUT,cAAc,WAAW,OAAO;EAC9B,MAAM,MAAM,KAAK,OAAO;AAExB,MAAI,YAAY,QAAQ,OACtB,OAAM,IAAI,MAAM;AAGlB,SAAO,OAAO;;CAUhB,mBAAmB,WAAW,OAAO;EACnC,MAAM,MAAM,KAAK,OAAO;AAExB,MAAI,YAAY,QAAQ,OACtB,OAAM,IAAI,MAAM;AAGlB,SAAO,OAAO"}
|
|
1
|
+
{"version":3,"file":"MessageCommandParser-TPEPhjvx.js","names":[],"sources":["../src/app/commands/MessageCommandParser.ts"],"sourcesContent":["import { Channel } from 'diagnostics_channel';\nimport {\n Message,\n ApplicationCommandOptionType,\n GuildMember,\n Attachment,\n User,\n Role,\n CommandInteractionOption,\n} from 'discord.js';\nimport {\n CommandKitErrorCodes,\n createCommandKitError,\n} from '../../utils/error-codes';\n\n/**\n * Represents a parsed message command with its components.\n */\nexport interface ParsedMessageCommand {\n command: string;\n options: { name: string; value: unknown }[];\n subcommand?: string;\n subcommandGroup?: string;\n}\n\n/**\n * Schema defining the types of options for a message command.\n */\nexport type MessageCommandOptionsSchema = Record<\n string,\n ApplicationCommandOptionType\n>;\n\n/**\n * Parses message content into structured command data with options and subcommands.\n */\nexport class MessageCommandParser {\n /**\n * @private\n * @internal\n */\n #parsed: ParsedMessageCommand | null = null;\n\n /**\n * @private\n * @internal\n */\n #options: MessageCommandOptions | null = null;\n\n /**\n * @private\n * @internal\n */\n #args: string[] = [];\n\n /**\n * Creates a new message command parser.\n * @param message - The Discord message to parse\n * @param prefix - Array of valid command prefixes\n * @param schema - Function that returns the options schema for a command\n */\n public constructor(\n public message: Message,\n private prefix: string[],\n private schema: (command: string) => MessageCommandOptionsSchema,\n ) {}\n\n /**\n * Gets the parsed command arguments.\n * @returns Array of command arguments\n */\n public getArgs() {\n void this.parse();\n return this.#args;\n }\n\n /**\n * Gets the message command options object for easy access to typed option values.\n */\n public get options() {\n if (!this.#options) {\n this.#options = new MessageCommandOptions(this);\n }\n\n return this.#options;\n }\n\n /**\n * Gets a specific option value by name.\n * @param name - The option name\n * @returns The option value or undefined if not found\n */\n public getOption<T>(name: string): T | undefined {\n return this.parse().options.find((o) => o.name === name)?.value as T;\n }\n\n /**\n * Gets the main command name.\n * @returns The command name\n */\n public getCommand(): string {\n return this.parse().command;\n }\n\n /**\n * Gets the subcommand name if present.\n * @returns The subcommand name or undefined\n */\n public getSubcommand(): string | undefined {\n return this.parse().subcommand;\n }\n\n /**\n * Gets the subcommand group name if present.\n * @returns The subcommand group name or undefined\n */\n public getSubcommandGroup(): string | undefined {\n return this.parse().subcommandGroup;\n }\n\n /**\n * Gets the prefix used in the message.\n * @returns The matched prefix or undefined\n */\n public getPrefix() {\n for (const p of this.prefix) {\n if (this.message.content.startsWith(p)) {\n return p;\n }\n }\n }\n\n /**\n * Gets the full command including subcommand group and subcommand.\n * @returns The complete command string\n */\n public getFullCommand() {\n return [this.getCommand(), this.getSubcommandGroup(), this.getSubcommand()]\n .filter((v) => v)\n .join(' ');\n }\n\n /**\n * Parses the message content into structured command data.\n * @returns The parsed command data\n */\n public parse(): ParsedMessageCommand {\n if (this.#parsed) {\n return this.#parsed;\n }\n\n const content = this.message.content;\n\n const prefix = this.getPrefix();\n\n if (!prefix) {\n throw createCommandKitError(CommandKitErrorCodes.InvalidCommandPrefix);\n }\n\n const parts = content.slice(prefix.length).trim().split(' ');\n const command = parts.shift();\n\n this.#args = parts;\n\n let subcommandGroup: string | undefined;\n let subcommand: string | undefined;\n\n if (command?.includes(':')) {\n const [, group, cmd] = command.split(':');\n\n if (!cmd && group) {\n subcommand = group;\n } else if (cmd && group) {\n subcommandGroup = group;\n subcommand = cmd;\n }\n }\n\n const schema = this.schema(\n [command, subcommandGroup, subcommand].filter(Boolean).join(' ').trim(),\n );\n\n const options = parts\n .map((part) => {\n try {\n const [name, value] = part.split(':');\n\n if (!(name in schema)) return null;\n\n switch (schema[name]) {\n case ApplicationCommandOptionType.Boolean:\n return { name, value: value === 'true' };\n case ApplicationCommandOptionType.Integer:\n return { name, value: parseInt(value, 10) };\n case ApplicationCommandOptionType.Number:\n return { name, value: parseFloat(value) };\n case ApplicationCommandOptionType.String:\n return { name, value };\n case ApplicationCommandOptionType.User:\n return {\n name,\n value: this.message.mentions.users.find((u) => {\n return u.id === value.replace(/[<@!>]/g, '');\n }),\n };\n case ApplicationCommandOptionType.Channel:\n return {\n name,\n value: this.message.mentions.channels.find((c) => {\n return c.id === value.replace(/[<#>]/g, '');\n }),\n };\n case ApplicationCommandOptionType.Role:\n return {\n name,\n value: this.message.mentions.roles.find((r) => {\n return r.id === value.replace(/[<@&>]/g, '');\n }),\n };\n case ApplicationCommandOptionType.Attachment:\n return {\n name,\n value: this.message.attachments.find((a) => {\n return a.name === value;\n }),\n };\n default:\n return null;\n }\n } catch {\n // Invalid option\n return null;\n }\n })\n .filter((v) => v !== null);\n\n this.#parsed = {\n command: command!,\n options,\n subcommand,\n subcommandGroup,\n };\n\n return this.#parsed;\n }\n}\n\n/**\n * Provides typed access to message command options with methods similar to Discord.js interaction options.\n */\nexport class MessageCommandOptions {\n /**\n * Creates a new message command options instance.\n * @param parser - The message command parser instance\n */\n public constructor(private parser: MessageCommandParser) {}\n\n /**\n * @private\n * @internal\n */\n private assertOption<T>(name: string, required = false) {\n const option = this.parser.getOption<T>(name);\n\n if (required && option === undefined) {\n throw new Error(`Option \"${name}\" is required.`);\n }\n\n return option ?? null;\n }\n\n /**\n * Gets a guild member from the command options.\n * @param name - The option name\n * @param required - Whether the option is required\n * @returns The guild member or null if not found\n */\n getMember(name: string): GuildMember | null;\n getMember(name: string, required: true): GuildMember;\n getMember(name: string, required = false) {\n const user = this.assertOption<User>(name, required);\n const member = this.parser.message.guild?.members.cache.get(user?.id!);\n\n if (required && !member) {\n throw new Error(`Member \"${name}\" is required.`);\n }\n\n return member ?? null;\n }\n\n /**\n * Gets an attachment from the command options.\n * @param name - The option name\n * @param required - Whether the option is required\n * @returns The attachment or null if not found\n */\n getAttachment(name: string): Attachment | null;\n getAttachment(name: string, required: true): Attachment;\n getAttachment(name: string, required = false) {\n return this.assertOption<Attachment>(name, required);\n }\n\n /**\n * Gets a boolean value from the command options.\n * @param name - The option name\n * @param required - Whether the option is required\n * @returns The boolean value or null if not found\n */\n getBoolean(name: string): boolean | null;\n getBoolean(name: string, required: true): boolean;\n getBoolean(name: string, required = false) {\n return this.assertOption<boolean>(name, required);\n }\n\n /**\n * Gets a number value from the command options.\n * @param name - The option name\n * @param required - Whether the option is required\n * @returns The number value or null if not found\n */\n getNumber(name: string): number | null;\n getNumber(name: string, required: true): number;\n getNumber(name: string, required = false) {\n return this.assertOption<number>(name, required);\n }\n\n /**\n * Gets a string value from the command options.\n * @param name - The option name\n * @param required - Whether the option is required\n * @returns The string value or null if not found\n */\n getString(name: string): string | null;\n getString(name: string, required: true): string;\n getString(name: string, required = false) {\n return this.assertOption<string>(name, required);\n }\n\n /**\n * Gets an integer value from the command options.\n * @param name - The option name\n * @param required - Whether the option is required\n * @returns The integer value or null if not found\n */\n getInteger(name: string): number | null;\n getInteger(name: string, required: true): number;\n getInteger(name: string, required = false) {\n return this.assertOption<number>(name, required);\n }\n\n /**\n * Gets a user from the command options.\n * @param name - The option name\n * @param required - Whether the option is required\n * @returns The user or null if not found\n */\n getUser(name: string): User | null;\n getUser(name: string, required: true): User;\n getUser(name: string, required = false) {\n return this.assertOption<User>(name, required);\n }\n\n /**\n * Gets a channel from the command options.\n * @param name - The option name\n * @param required - Whether the option is required\n * @returns The channel or null if not found\n */\n getChannel(name: string): Channel | null;\n getChannel(name: string, required: true): Channel;\n getChannel(name: string, required = false) {\n return this.assertOption<Channel>(name, required);\n }\n\n /**\n * Gets a role from the command options.\n * @param name - The option name\n * @param required - Whether the option is required\n * @returns The role or null if not found\n */\n getRole(name: string): Role | null;\n getRole(name: string, required: true): Role;\n getRole(name: string, required = false) {\n return this.assertOption<Role>(name, required);\n }\n\n /**\n * Gets a mentionable (user, member, or role) from the command options.\n * @param name - The option name\n * @param required - Whether the option is required\n * @returns The mentionable or null if not found\n */\n getMentionable(\n name: string,\n ): NonNullable<CommandInteractionOption['member' | 'role' | 'user']> | null;\n getMentionable(\n name: string,\n required: true,\n ): NonNullable<CommandInteractionOption['member' | 'role' | 'user']>;\n getMentionable(\n name: string,\n required = false,\n ): NonNullable<CommandInteractionOption['member' | 'role' | 'user']> | null {\n const target = this.assertOption(name, required);\n\n if (\n target instanceof GuildMember ||\n target instanceof User ||\n target instanceof Role\n ) {\n return target;\n }\n\n if (required) {\n throw new Error(`Mentionable \"${name}\" is required.`);\n }\n\n return null;\n }\n\n /**\n * Gets the subcommand name from the command.\n * @param required - Whether the subcommand is required\n * @returns The subcommand name or null if not found\n */\n getSubcommand(): string | null;\n getSubcommand(required: true): string;\n getSubcommand(required = false) {\n const sub = this.parser.getSubcommand();\n\n if (required && sub === undefined) {\n throw new Error('Subcommand is required.');\n }\n\n return sub ?? null;\n }\n\n /**\n * Gets the subcommand group name from the command.\n * @param required - Whether the subcommand group is required\n * @returns The subcommand group name or null if not found\n */\n getSubcommandGroup(): string | null;\n getSubcommandGroup(required: true): string;\n getSubcommandGroup(required = false) {\n const sub = this.parser.getSubcommandGroup();\n\n if (required && sub === undefined) {\n throw new Error('Subcommand group is required.');\n }\n\n return sub ?? null;\n }\n}\n"],"mappings":";;;;;;;;AAoCA,IAAa,uBAAb,MAAkC;;;;;CAKhC,UAAuC;;;;;CAMvC,WAAyC;;;;;CAMzC,QAAkB;;;;;;;CAQlB,AAAO,YACP,AAAO,SACP,AAAQ,QACR,AAAQ,QACR;EAHO;EACC;EACA;;;;;;CAOR,AAAO,UAAU;AACf,EAAK,KAAK;AACV,SAAO,MAAK;;;;;CAMd,IAAW,UAAU;AACnB,MAAI,CAAC,MAAK,QACR,OAAK,UAAW,IAAI,sBAAsB;AAG5C,SAAO,MAAK;;;;;;;CAQd,AAAO,UAAa,MAA6B;;AAC/C,kCAAO,KAAK,QAAQ,QAAQ,MAAM,MAAM,EAAE,SAAS,qFAAO;;;;;;CAO5D,AAAO,aAAqB;AAC1B,SAAO,KAAK,QAAQ;;;;;;CAOtB,AAAO,gBAAoC;AACzC,SAAO,KAAK,QAAQ;;;;;;CAOtB,AAAO,qBAAyC;AAC9C,SAAO,KAAK,QAAQ;;;;;;CAOtB,AAAO,YAAY;AACjB,OAAK,MAAM,KAAK,KAAK,OACnB,KAAI,KAAK,QAAQ,QAAQ,WAAW,GAClC,QAAO;;;;;;CASb,AAAO,iBAAiB;AACtB,SAAO;GAAC,KAAK;GAAc,KAAK;GAAsB,KAAK;IAC3D,QAAQ,MAAM,GACd,KAAK;;;;;;CAOP,AAAO,QAA8B;AACnC,MAAI,MAAK,OACP,QAAO,MAAK;EAGd,MAAM,UAAU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,OACgE;EACzE,MAAM,SAAS,KAAK,aAAa,MAAM;AAEvC,MACA,kBAAkB,0BAClB,kBAAkB,mBAClB,kBAAkB,gBAEhB,QAAO;AAGT,MAAI,SACF,OAAM,IAAI,MAAM,gBAAgB,KAAK;AAGvC,SAAO;;CAUT,cAAc,WAAW,OAAO;EAC9B,MAAM,MAAM,KAAK,OAAO;AAExB,MAAI,YAAY,QAAQ,OACtB,OAAM,IAAI,MAAM;AAGlB,SAAO,OAAO;;CAUhB,mBAAmB,WAAW,OAAO;EACnC,MAAM,MAAM,KAAK,OAAO;AAExB,MAAI,YAAY,QAAQ,OACtB,OAAM,IAAI,MAAM;AAGlB,SAAO,OAAO"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { AnalyticsEngine, FilterFunction } from "../analytics-engine-
|
|
1
|
+
import { AnalyticsEngine, FilterFunction } from "../analytics-engine-Iu_1uJop.js";
|
|
2
2
|
import "../EventInterceptor-x-R2qshQ.js";
|
|
3
3
|
import "../ButtonKit-C7r7RPNf.js";
|
|
4
4
|
import "../ModalKit-Btz58KYn.js";
|
|
@@ -23,7 +23,7 @@ import "../text-display-DRw3r_lK.js";
|
|
|
23
23
|
import "../index-DSBMRX9A.js";
|
|
24
24
|
import "../index-DdqikUQD.js";
|
|
25
25
|
import "../MessageCommandParser-ROLibZPX.js";
|
|
26
|
-
import "../signals-
|
|
26
|
+
import "../signals-SHg7J1U_.js";
|
|
27
27
|
import "../helpers-Wg6P5fRQ.js";
|
|
28
28
|
import "../CommandsRouter-CoOA7hkf.js";
|
|
29
29
|
import "../EventsRouter-BacqK6z3.js";
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
require('../colors-Cd4Oz-r-.js');
|
|
2
2
|
require('../ActionRow-CmTHbo2t.js');
|
|
3
|
-
require('../error-codes-
|
|
4
|
-
const require_commandkit = require('../commandkit-
|
|
3
|
+
require('../error-codes-Ds0bnPvT.js');
|
|
4
|
+
const require_commandkit = require('../commandkit-c0sAaK0G.js');
|
|
5
5
|
require('../common-CcfjYnPG.js');
|
|
6
6
|
require('../common-vnMIelAE.js');
|
|
7
7
|
require('../container-z621KfH5.js');
|
|
@@ -23,10 +23,10 @@ require('../runtime-5fxB4uhe.js');
|
|
|
23
23
|
require('../utils-BnXM4eKk.js');
|
|
24
24
|
require('../resolve-file-url-DHTQj2mU.js');
|
|
25
25
|
require('../types-package-DrnIdWLg.js');
|
|
26
|
-
require('../
|
|
27
|
-
require('../
|
|
28
|
-
require('../
|
|
29
|
-
require('../MessageCommandParser-
|
|
26
|
+
require('../constants-DxfYtA6t.js');
|
|
27
|
+
require('../EventWorkerContext-TZIKxVCu.js');
|
|
28
|
+
require('../signals-r7qPAvOR.js');
|
|
29
|
+
require('../MessageCommandParser-TPEPhjvx.js');
|
|
30
30
|
require('../CommandsRouter-tMAivEfv.js');
|
|
31
31
|
require('../EventsRouter-C_J0M3uO.js');
|
|
32
32
|
require('../router-DHnFRADH.js');
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { AnalyticsEvent, AnalyticsProvider, IdentifyEvent } from "../analytics-engine-
|
|
1
|
+
import { AnalyticsEvent, AnalyticsProvider, IdentifyEvent } from "../analytics-engine-Iu_1uJop.js";
|
|
2
2
|
import "../EventInterceptor-x-R2qshQ.js";
|
|
3
3
|
import "../ButtonKit-C7r7RPNf.js";
|
|
4
4
|
import "../ModalKit-Btz58KYn.js";
|
|
@@ -23,7 +23,7 @@ import "../text-display-DRw3r_lK.js";
|
|
|
23
23
|
import "../index-DSBMRX9A.js";
|
|
24
24
|
import "../index-DdqikUQD.js";
|
|
25
25
|
import "../MessageCommandParser-ROLibZPX.js";
|
|
26
|
-
import "../signals-
|
|
26
|
+
import "../signals-SHg7J1U_.js";
|
|
27
27
|
import "../helpers-Wg6P5fRQ.js";
|
|
28
28
|
import "../CommandsRouter-CoOA7hkf.js";
|
|
29
29
|
import "../EventsRouter-BacqK6z3.js";
|
package/dist/analytics/utils.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
require('../colors-Cd4Oz-r-.js');
|
|
2
2
|
require('../ActionRow-CmTHbo2t.js');
|
|
3
|
-
require('../error-codes-
|
|
4
|
-
const require_commandkit = require('../commandkit-
|
|
3
|
+
require('../error-codes-Ds0bnPvT.js');
|
|
4
|
+
const require_commandkit = require('../commandkit-c0sAaK0G.js');
|
|
5
5
|
require('../common-CcfjYnPG.js');
|
|
6
6
|
require('../common-vnMIelAE.js');
|
|
7
7
|
require('../container-z621KfH5.js');
|
|
@@ -23,10 +23,10 @@ require('../runtime-5fxB4uhe.js');
|
|
|
23
23
|
require('../utils-BnXM4eKk.js');
|
|
24
24
|
require('../resolve-file-url-DHTQj2mU.js');
|
|
25
25
|
require('../types-package-DrnIdWLg.js');
|
|
26
|
-
require('../
|
|
27
|
-
require('../
|
|
28
|
-
require('../
|
|
29
|
-
require('../MessageCommandParser-
|
|
26
|
+
require('../constants-DxfYtA6t.js');
|
|
27
|
+
require('../EventWorkerContext-TZIKxVCu.js');
|
|
28
|
+
require('../signals-r7qPAvOR.js');
|
|
29
|
+
require('../MessageCommandParser-TPEPhjvx.js');
|
|
30
30
|
require('../CommandsRouter-tMAivEfv.js');
|
|
31
31
|
require('../EventsRouter-C_J0M3uO.js');
|
|
32
32
|
require('../router-DHnFRADH.js');
|
|
@@ -341,27 +341,11 @@ declare class Context<ExecutionMode extends CommandExecutionMode = CommandExecut
|
|
|
341
341
|
* @returns Array of command arguments
|
|
342
342
|
*/
|
|
343
343
|
args(): string[];
|
|
344
|
-
/**
|
|
345
|
-
* Stops upcoming middleware or current command execution.
|
|
346
|
-
* If this is called inside pre-stage middleware, the next run will be the actual command, skipping all other pre-stage middlewares.
|
|
347
|
-
* If this is called inside a command itself, it will skip all post-stage middlewares.
|
|
348
|
-
* If this is called inside post-stage middleware, it will skip all other post-stage middlewares.
|
|
349
|
-
*/
|
|
350
|
-
exit(): never;
|
|
351
344
|
}
|
|
352
345
|
/**
|
|
353
346
|
* Extended context class for middleware execution with additional control methods.
|
|
354
347
|
*/
|
|
355
348
|
declare class MiddlewareContext<T extends CommandExecutionMode = CommandExecutionMode> extends Context<T, MiddlewareContextArgs> {
|
|
356
|
-
#private;
|
|
357
|
-
/**
|
|
358
|
-
* Whether the command execution was cancelled.
|
|
359
|
-
*/
|
|
360
|
-
get cancelled(): boolean;
|
|
361
|
-
/**
|
|
362
|
-
* Cancels the command execution.
|
|
363
|
-
*/
|
|
364
|
-
cancel(): void;
|
|
365
349
|
/**
|
|
366
350
|
* Sets command runner function to wrap the command execution.
|
|
367
351
|
* @param fn The function to set.
|
|
@@ -678,6 +662,7 @@ declare class AppCommandRunner {
|
|
|
678
662
|
* Handles the complete command lifecycle including before/after middleware execution.
|
|
679
663
|
* @param prepared - The prepared command execution data
|
|
680
664
|
* @param source - The source interaction or message that triggered the command
|
|
665
|
+
* @param options - The options for running the command
|
|
681
666
|
*/
|
|
682
667
|
runCommand(prepared: PreparedAppCommandExecution, source: Interaction | Message, options?: RunCommandOptions): Promise<any>;
|
|
683
668
|
/**
|
|
@@ -2252,4 +2237,4 @@ declare class AnalyticsEngine {
|
|
|
2252
2237
|
}
|
|
2253
2238
|
//#endregion
|
|
2254
2239
|
export { AnalyticsEngine, AnalyticsEvent, AnalyticsProvider, AnyCommandExecute, AppCommand, AppCommandHandler, AppCommandNative, AppCommandRunner, AppEventsHandler, AppEventsHandlerLoadedData, AsyncFunction, AutocompleteCommand, AutocompleteCommandContext, AutocompleteCommandMiddlewareContext, BootstrapFunction, ChatInputCommand, ChatInputCommandContext, CommandBuilderLike, CommandContext, CommandContextOptions, CommandData, CommandDataSchema, CommandDataSchemaKey, CommandDataSchemaValue, CommandExecutionMode, CommandFlagContext, CommandKit, CommandKitCompilerOptions, CommandKitConfig, CommandKitConfiguration, CommandKitEnvironment, CommandKitEnvironmentInternalData, CommandKitEnvironmentType, CommandKitEventDispatch, CommandKitEventsChannel, CommandKitHMREvent, CommandKitOptions, CommandKitPlugin, CommandKitPluginRuntime, CommandMetadata, CommandMetadataFunction, CommandRegistrar, CommandTypeData, CommonDirectiveTransformer, CommonDirectiveTransformerOptions, CommonPluginRuntime, CompilerPlugin, CompilerPluginRuntime, Context, ContextParameters, CustomAppCommandProps, CustomEvaluationContext, CustomEvaluationFunction, DecideFunction, DeepPartial, DeepRequired, EvaluationContext, EventFlagContext, EventHandler, EventListener, FeatureFlag, FeatureFlagDefinition, FilterFunction, FlagConfiguration, FlagProvider, FlagRunner, FlagStore, GenericFunction, IdentifyEvent, IdentifyFunction, InteractionCommandContext, InteractionCommandMiddlewareContext, IpcMessageCommand, JsonFlagProvider, LegacyCommandMetadata, ListenerFunction, LoadedCommand, LoadedEvent, MaybeFalsey, MaybePromise, MessageCommand, MessageCommandContext, MessageCommandMiddlewareContext, MessageContextMenuCommand, MessageContextMenuCommandContext, MessageContextMenuCommandMiddlewareContext, MiddlewareContext, MiddlewareContextArgs, PluginCommon, PluginOptions, PluginTransformParameters, PluginType, PreRegisterCommandsEvent, PreparedAppCommandExecution, ResolvableCommand, ResolvedCommandKitConfig, RunCommand, RunCommandOptions, RuntimePlugin, SlashCommandMiddlewareContext, TemplateHandler, TransformedResult, UserContextMenuCommand, UserContextMenuCommandContext, UserContextMenuCommandMiddlewareContext, after, cancelAfter, commandkit, exitContext, flag, getCommandKit, getContext, isCommandWorkerContext, isCompilerPlugin, isPlugin, isRuntimePlugin, makeContextAwareFunction, mergeDeep, onApplicationBootstrap, onBootstrap, provideContext, registerDevHooks, setFlagProvider, useEnvironment };
|
|
2255
|
-
//# sourceMappingURL=analytics-engine-
|
|
2240
|
+
//# sourceMappingURL=analytics-engine-Iu_1uJop.d.ts.map
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { AppCommandRunner, RunCommandOptions } from "../../analytics-engine-
|
|
1
|
+
import { AppCommandRunner, RunCommandOptions } from "../../analytics-engine-Iu_1uJop.js";
|
|
2
2
|
import "../../EventInterceptor-x-R2qshQ.js";
|
|
3
3
|
import "../../ButtonKit-C7r7RPNf.js";
|
|
4
4
|
import "../../ModalKit-Btz58KYn.js";
|
|
@@ -23,7 +23,7 @@ import "../../text-display-DRw3r_lK.js";
|
|
|
23
23
|
import "../../index-DSBMRX9A.js";
|
|
24
24
|
import "../../index-DdqikUQD.js";
|
|
25
25
|
import "../../MessageCommandParser-ROLibZPX.js";
|
|
26
|
-
import "../../signals-
|
|
26
|
+
import "../../signals-SHg7J1U_.js";
|
|
27
27
|
import "../../helpers-Wg6P5fRQ.js";
|
|
28
28
|
import "../../CommandsRouter-CoOA7hkf.js";
|
|
29
29
|
import "../../EventsRouter-BacqK6z3.js";
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
require('../../colors-Cd4Oz-r-.js');
|
|
2
2
|
require('../../ActionRow-CmTHbo2t.js');
|
|
3
|
-
require('../../error-codes-
|
|
4
|
-
const require_commandkit = require('../../commandkit-
|
|
3
|
+
require('../../error-codes-Ds0bnPvT.js');
|
|
4
|
+
const require_commandkit = require('../../commandkit-c0sAaK0G.js');
|
|
5
5
|
require('../../common-CcfjYnPG.js');
|
|
6
6
|
require('../../common-vnMIelAE.js');
|
|
7
7
|
require('../../container-z621KfH5.js');
|
|
@@ -23,10 +23,10 @@ require('../../runtime-5fxB4uhe.js');
|
|
|
23
23
|
require('../../utils-BnXM4eKk.js');
|
|
24
24
|
require('../../resolve-file-url-DHTQj2mU.js');
|
|
25
25
|
require('../../types-package-DrnIdWLg.js');
|
|
26
|
-
require('../../
|
|
27
|
-
require('../../
|
|
28
|
-
require('../../
|
|
29
|
-
require('../../MessageCommandParser-
|
|
26
|
+
require('../../constants-DxfYtA6t.js');
|
|
27
|
+
require('../../EventWorkerContext-TZIKxVCu.js');
|
|
28
|
+
require('../../signals-r7qPAvOR.js');
|
|
29
|
+
require('../../MessageCommandParser-TPEPhjvx.js');
|
|
30
30
|
require('../../CommandsRouter-tMAivEfv.js');
|
|
31
31
|
require('../../EventsRouter-C_J0M3uO.js');
|
|
32
32
|
require('../../router-DHnFRADH.js');
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { AnyCommandExecute, AutocompleteCommand, AutocompleteCommandContext, AutocompleteCommandMiddlewareContext, ChatInputCommand, ChatInputCommandContext, CommandContextOptions, CommandExecutionMode, Context, ContextParameters, InteractionCommandContext, InteractionCommandMiddlewareContext, MessageCommand, MessageCommandContext, MessageCommandMiddlewareContext, MessageContextMenuCommand, MessageContextMenuCommandContext, MessageContextMenuCommandMiddlewareContext, MiddlewareContext, MiddlewareContextArgs, SlashCommandMiddlewareContext, UserContextMenuCommand, UserContextMenuCommandContext, UserContextMenuCommandMiddlewareContext } from "../../analytics-engine-
|
|
1
|
+
import { AnyCommandExecute, AutocompleteCommand, AutocompleteCommandContext, AutocompleteCommandMiddlewareContext, ChatInputCommand, ChatInputCommandContext, CommandContextOptions, CommandExecutionMode, Context, ContextParameters, InteractionCommandContext, InteractionCommandMiddlewareContext, MessageCommand, MessageCommandContext, MessageCommandMiddlewareContext, MessageContextMenuCommand, MessageContextMenuCommandContext, MessageContextMenuCommandMiddlewareContext, MiddlewareContext, MiddlewareContextArgs, SlashCommandMiddlewareContext, UserContextMenuCommand, UserContextMenuCommandContext, UserContextMenuCommandMiddlewareContext } from "../../analytics-engine-Iu_1uJop.js";
|
|
2
2
|
import "../../EventInterceptor-x-R2qshQ.js";
|
|
3
3
|
import "../../ButtonKit-C7r7RPNf.js";
|
|
4
4
|
import "../../ModalKit-Btz58KYn.js";
|
|
@@ -23,7 +23,7 @@ import "../../text-display-DRw3r_lK.js";
|
|
|
23
23
|
import "../../index-DSBMRX9A.js";
|
|
24
24
|
import "../../index-DdqikUQD.js";
|
|
25
25
|
import "../../MessageCommandParser-ROLibZPX.js";
|
|
26
|
-
import "../../signals-
|
|
26
|
+
import "../../signals-SHg7J1U_.js";
|
|
27
27
|
import "../../helpers-Wg6P5fRQ.js";
|
|
28
28
|
import "../../CommandsRouter-CoOA7hkf.js";
|
|
29
29
|
import "../../EventsRouter-BacqK6z3.js";
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
require('../../colors-Cd4Oz-r-.js');
|
|
2
2
|
require('../../ActionRow-CmTHbo2t.js');
|
|
3
|
-
require('../../error-codes-
|
|
4
|
-
const require_commandkit = require('../../commandkit-
|
|
3
|
+
require('../../error-codes-Ds0bnPvT.js');
|
|
4
|
+
const require_commandkit = require('../../commandkit-c0sAaK0G.js');
|
|
5
5
|
require('../../common-CcfjYnPG.js');
|
|
6
6
|
require('../../common-vnMIelAE.js');
|
|
7
7
|
require('../../container-z621KfH5.js');
|
|
@@ -23,10 +23,10 @@ require('../../runtime-5fxB4uhe.js');
|
|
|
23
23
|
require('../../utils-BnXM4eKk.js');
|
|
24
24
|
require('../../resolve-file-url-DHTQj2mU.js');
|
|
25
25
|
require('../../types-package-DrnIdWLg.js');
|
|
26
|
-
require('../../
|
|
27
|
-
require('../../
|
|
28
|
-
require('../../
|
|
29
|
-
require('../../MessageCommandParser-
|
|
26
|
+
require('../../constants-DxfYtA6t.js');
|
|
27
|
+
require('../../EventWorkerContext-TZIKxVCu.js');
|
|
28
|
+
require('../../signals-r7qPAvOR.js');
|
|
29
|
+
require('../../MessageCommandParser-TPEPhjvx.js');
|
|
30
30
|
require('../../CommandsRouter-tMAivEfv.js');
|
|
31
31
|
require('../../EventsRouter-C_J0M3uO.js');
|
|
32
32
|
require('../../router-DHnFRADH.js');
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
require('../../error-codes-
|
|
2
|
-
const require_MessageCommandParser = require('../../MessageCommandParser-
|
|
1
|
+
require('../../error-codes-Ds0bnPvT.js');
|
|
2
|
+
const require_MessageCommandParser = require('../../MessageCommandParser-TPEPhjvx.js');
|
|
3
3
|
|
|
4
4
|
exports.MessageCommandOptions = require_MessageCommandParser.MessageCommandOptions;
|
|
5
5
|
exports.MessageCommandParser = require_MessageCommandParser.MessageCommandParser;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import "../../analytics-engine-
|
|
1
|
+
import "../../analytics-engine-Iu_1uJop.js";
|
|
2
2
|
import "../../EventInterceptor-x-R2qshQ.js";
|
|
3
3
|
import "../../ButtonKit-C7r7RPNf.js";
|
|
4
4
|
import "../../ModalKit-Btz58KYn.js";
|
|
@@ -23,11 +23,11 @@ import "../../text-display-DRw3r_lK.js";
|
|
|
23
23
|
import "../../index-DSBMRX9A.js";
|
|
24
24
|
import "../../index-DdqikUQD.js";
|
|
25
25
|
import "../../MessageCommandParser-ROLibZPX.js";
|
|
26
|
-
import "../../signals-
|
|
26
|
+
import "../../signals-SHg7J1U_.js";
|
|
27
27
|
import "../../helpers-Wg6P5fRQ.js";
|
|
28
28
|
import "../../CommandsRouter-CoOA7hkf.js";
|
|
29
29
|
import "../../EventsRouter-BacqK6z3.js";
|
|
30
30
|
import "../../index-DKcmsWXw.js";
|
|
31
31
|
import "../../constants-MKu-Q1jh.js";
|
|
32
|
-
import { EventWorkerContext, eventWorkerContext, getEventWorkerContext, isEventWorkerContext, runInEventWorkerContext } from "../../EventWorkerContext-
|
|
32
|
+
import { EventWorkerContext, eventWorkerContext, getEventWorkerContext, isEventWorkerContext, runInEventWorkerContext } from "../../EventWorkerContext-BEezHh5-.js";
|
|
33
33
|
export { EventWorkerContext, eventWorkerContext, getEventWorkerContext, isEventWorkerContext, runInEventWorkerContext };
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
const require_EventWorkerContext = require('../../EventWorkerContext-
|
|
1
|
+
const require_EventWorkerContext = require('../../EventWorkerContext-TZIKxVCu.js');
|
|
2
2
|
|
|
3
3
|
exports.eventWorkerContext = require_EventWorkerContext.eventWorkerContext;
|
|
4
4
|
exports.getEventWorkerContext = require_EventWorkerContext.getEventWorkerContext;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { AppCommand, AppCommandHandler, AppCommandNative, CommandBuilderLike, CommandDataSchema, CommandDataSchemaKey, CommandDataSchemaValue, CommandTypeData, CustomAppCommandProps, LoadedCommand, PreparedAppCommandExecution, ResolvableCommand, RunCommand } from "../../analytics-engine-
|
|
1
|
+
import { AppCommand, AppCommandHandler, AppCommandNative, CommandBuilderLike, CommandDataSchema, CommandDataSchemaKey, CommandDataSchemaValue, CommandTypeData, CustomAppCommandProps, LoadedCommand, PreparedAppCommandExecution, ResolvableCommand, RunCommand } from "../../analytics-engine-Iu_1uJop.js";
|
|
2
2
|
import "../../EventInterceptor-x-R2qshQ.js";
|
|
3
3
|
import "../../ButtonKit-C7r7RPNf.js";
|
|
4
4
|
import "../../ModalKit-Btz58KYn.js";
|
|
@@ -23,7 +23,7 @@ import "../../text-display-DRw3r_lK.js";
|
|
|
23
23
|
import "../../index-DSBMRX9A.js";
|
|
24
24
|
import "../../index-DdqikUQD.js";
|
|
25
25
|
import "../../MessageCommandParser-ROLibZPX.js";
|
|
26
|
-
import "../../signals-
|
|
26
|
+
import "../../signals-SHg7J1U_.js";
|
|
27
27
|
import "../../helpers-Wg6P5fRQ.js";
|
|
28
28
|
import "../../CommandsRouter-CoOA7hkf.js";
|
|
29
29
|
import "../../EventsRouter-BacqK6z3.js";
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
require('../../colors-Cd4Oz-r-.js');
|
|
2
2
|
require('../../ActionRow-CmTHbo2t.js');
|
|
3
|
-
require('../../error-codes-
|
|
4
|
-
const require_commandkit = require('../../commandkit-
|
|
3
|
+
require('../../error-codes-Ds0bnPvT.js');
|
|
4
|
+
const require_commandkit = require('../../commandkit-c0sAaK0G.js');
|
|
5
5
|
require('../../common-CcfjYnPG.js');
|
|
6
6
|
require('../../common-vnMIelAE.js');
|
|
7
7
|
require('../../container-z621KfH5.js');
|
|
@@ -23,10 +23,10 @@ require('../../runtime-5fxB4uhe.js');
|
|
|
23
23
|
require('../../utils-BnXM4eKk.js');
|
|
24
24
|
require('../../resolve-file-url-DHTQj2mU.js');
|
|
25
25
|
require('../../types-package-DrnIdWLg.js');
|
|
26
|
-
require('../../
|
|
27
|
-
require('../../
|
|
28
|
-
require('../../
|
|
29
|
-
require('../../MessageCommandParser-
|
|
26
|
+
require('../../constants-DxfYtA6t.js');
|
|
27
|
+
require('../../EventWorkerContext-TZIKxVCu.js');
|
|
28
|
+
require('../../signals-r7qPAvOR.js');
|
|
29
|
+
require('../../MessageCommandParser-TPEPhjvx.js');
|
|
30
30
|
require('../../CommandsRouter-tMAivEfv.js');
|
|
31
31
|
require('../../EventsRouter-C_J0M3uO.js');
|
|
32
32
|
require('../../router-DHnFRADH.js');
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { AppEventsHandler, AppEventsHandlerLoadedData, EventListener, LoadedEvent } from "../../analytics-engine-
|
|
1
|
+
import { AppEventsHandler, AppEventsHandlerLoadedData, EventListener, LoadedEvent } from "../../analytics-engine-Iu_1uJop.js";
|
|
2
2
|
import "../../EventInterceptor-x-R2qshQ.js";
|
|
3
3
|
import "../../ButtonKit-C7r7RPNf.js";
|
|
4
4
|
import "../../ModalKit-Btz58KYn.js";
|
|
@@ -23,7 +23,7 @@ import "../../text-display-DRw3r_lK.js";
|
|
|
23
23
|
import "../../index-DSBMRX9A.js";
|
|
24
24
|
import "../../index-DdqikUQD.js";
|
|
25
25
|
import "../../MessageCommandParser-ROLibZPX.js";
|
|
26
|
-
import "../../signals-
|
|
26
|
+
import "../../signals-SHg7J1U_.js";
|
|
27
27
|
import "../../helpers-Wg6P5fRQ.js";
|
|
28
28
|
import "../../CommandsRouter-CoOA7hkf.js";
|
|
29
29
|
import "../../EventsRouter-BacqK6z3.js";
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
require('../../colors-Cd4Oz-r-.js');
|
|
2
2
|
require('../../ActionRow-CmTHbo2t.js');
|
|
3
|
-
require('../../error-codes-
|
|
4
|
-
const require_commandkit = require('../../commandkit-
|
|
3
|
+
require('../../error-codes-Ds0bnPvT.js');
|
|
4
|
+
const require_commandkit = require('../../commandkit-c0sAaK0G.js');
|
|
5
5
|
require('../../common-CcfjYnPG.js');
|
|
6
6
|
require('../../common-vnMIelAE.js');
|
|
7
7
|
require('../../container-z621KfH5.js');
|
|
@@ -23,10 +23,10 @@ require('../../runtime-5fxB4uhe.js');
|
|
|
23
23
|
require('../../utils-BnXM4eKk.js');
|
|
24
24
|
require('../../resolve-file-url-DHTQj2mU.js');
|
|
25
25
|
require('../../types-package-DrnIdWLg.js');
|
|
26
|
-
require('../../
|
|
27
|
-
require('../../
|
|
28
|
-
require('../../
|
|
29
|
-
require('../../MessageCommandParser-
|
|
26
|
+
require('../../constants-DxfYtA6t.js');
|
|
27
|
+
require('../../EventWorkerContext-TZIKxVCu.js');
|
|
28
|
+
require('../../signals-r7qPAvOR.js');
|
|
29
|
+
require('../../MessageCommandParser-TPEPhjvx.js');
|
|
30
30
|
require('../../CommandsRouter-tMAivEfv.js');
|
|
31
31
|
require('../../EventsRouter-C_J0M3uO.js');
|
|
32
32
|
require('../../router-DHnFRADH.js');
|
package/dist/app/index.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { AnyCommandExecute, AppCommand, AppCommandHandler, AppCommandNative, AutocompleteCommand, AutocompleteCommandContext, AutocompleteCommandMiddlewareContext, ChatInputCommand, ChatInputCommandContext, CommandBuilderLike, CommandContextOptions, CommandDataSchema, CommandDataSchemaKey, CommandDataSchemaValue, CommandExecutionMode, CommandRegistrar, CommandTypeData, Context, ContextParameters, CustomAppCommandProps, InteractionCommandContext, InteractionCommandMiddlewareContext, LoadedCommand, MessageCommand, MessageCommandContext, MessageCommandMiddlewareContext, MessageContextMenuCommand, MessageContextMenuCommandContext, MessageContextMenuCommandMiddlewareContext, MiddlewareContext, MiddlewareContextArgs, PreRegisterCommandsEvent, PreparedAppCommandExecution, ResolvableCommand, RunCommand, SlashCommandMiddlewareContext, UserContextMenuCommand, UserContextMenuCommandContext, UserContextMenuCommandMiddlewareContext } from "../analytics-engine-
|
|
1
|
+
import { AnyCommandExecute, AppCommand, AppCommandHandler, AppCommandNative, AutocompleteCommand, AutocompleteCommandContext, AutocompleteCommandMiddlewareContext, ChatInputCommand, ChatInputCommandContext, CommandBuilderLike, CommandContextOptions, CommandDataSchema, CommandDataSchemaKey, CommandDataSchemaValue, CommandExecutionMode, CommandRegistrar, CommandTypeData, Context, ContextParameters, CustomAppCommandProps, InteractionCommandContext, InteractionCommandMiddlewareContext, LoadedCommand, MessageCommand, MessageCommandContext, MessageCommandMiddlewareContext, MessageContextMenuCommand, MessageContextMenuCommandContext, MessageContextMenuCommandMiddlewareContext, MiddlewareContext, MiddlewareContextArgs, PreRegisterCommandsEvent, PreparedAppCommandExecution, ResolvableCommand, RunCommand, SlashCommandMiddlewareContext, UserContextMenuCommand, UserContextMenuCommandContext, UserContextMenuCommandMiddlewareContext } from "../analytics-engine-Iu_1uJop.js";
|
|
2
2
|
import "../EventInterceptor-x-R2qshQ.js";
|
|
3
3
|
import "../ButtonKit-C7r7RPNf.js";
|
|
4
4
|
import "../ModalKit-Btz58KYn.js";
|
|
@@ -23,10 +23,10 @@ import "../text-display-DRw3r_lK.js";
|
|
|
23
23
|
import "../index-DSBMRX9A.js";
|
|
24
24
|
import "../index-DdqikUQD.js";
|
|
25
25
|
import { MessageCommandOptions, MessageCommandOptionsSchema, MessageCommandParser, ParsedMessageCommand } from "../MessageCommandParser-ROLibZPX.js";
|
|
26
|
-
import {
|
|
26
|
+
import { redirect, rethrow, stopEvents, stopMiddlewares } from "../signals-SHg7J1U_.js";
|
|
27
27
|
import { CommandSource, isInteractionSource, isMessageSource } from "../helpers-Wg6P5fRQ.js";
|
|
28
28
|
import "../CommandsRouter-CoOA7hkf.js";
|
|
29
29
|
import "../EventsRouter-BacqK6z3.js";
|
|
30
30
|
import "../index-DKcmsWXw.js";
|
|
31
31
|
import "../constants-MKu-Q1jh.js";
|
|
32
|
-
export { AnyCommandExecute, AppCommand, AppCommandHandler, AppCommandNative, AutocompleteCommand, AutocompleteCommandContext, AutocompleteCommandMiddlewareContext, ChatInputCommand, ChatInputCommandContext, CommandBuilderLike, CommandContextOptions, CommandDataSchema, CommandDataSchemaKey, CommandDataSchemaValue, CommandExecutionMode, CommandRegistrar, CommandSource, CommandTypeData, Context, ContextParameters, CustomAppCommandProps, InteractionCommandContext, InteractionCommandMiddlewareContext, LoadedCommand, MessageCommand, MessageCommandContext, MessageCommandMiddlewareContext, MessageCommandOptions, MessageCommandOptionsSchema, MessageCommandParser, MessageContextMenuCommand, MessageContextMenuCommandContext, MessageContextMenuCommandMiddlewareContext, MiddlewareContext, MiddlewareContextArgs, ParsedMessageCommand, PreRegisterCommandsEvent, PreparedAppCommandExecution, ResolvableCommand, RunCommand, SlashCommandMiddlewareContext, UserContextMenuCommand, UserContextMenuCommandContext, UserContextMenuCommandMiddlewareContext,
|
|
32
|
+
export { AnyCommandExecute, AppCommand, AppCommandHandler, AppCommandNative, AutocompleteCommand, AutocompleteCommandContext, AutocompleteCommandMiddlewareContext, ChatInputCommand, ChatInputCommandContext, CommandBuilderLike, CommandContextOptions, CommandDataSchema, CommandDataSchemaKey, CommandDataSchemaValue, CommandExecutionMode, CommandRegistrar, CommandSource, CommandTypeData, Context, ContextParameters, CustomAppCommandProps, InteractionCommandContext, InteractionCommandMiddlewareContext, LoadedCommand, MessageCommand, MessageCommandContext, MessageCommandMiddlewareContext, MessageCommandOptions, MessageCommandOptionsSchema, MessageCommandParser, MessageContextMenuCommand, MessageContextMenuCommandContext, MessageContextMenuCommandMiddlewareContext, MiddlewareContext, MiddlewareContextArgs, ParsedMessageCommand, PreRegisterCommandsEvent, PreparedAppCommandExecution, ResolvableCommand, RunCommand, SlashCommandMiddlewareContext, UserContextMenuCommand, UserContextMenuCommandContext, UserContextMenuCommandMiddlewareContext, isInteractionSource, isMessageSource, redirect, rethrow, stopEvents, stopMiddlewares };
|
package/dist/app/index.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
require('../colors-Cd4Oz-r-.js');
|
|
2
2
|
require('../ActionRow-CmTHbo2t.js');
|
|
3
|
-
require('../error-codes-
|
|
4
|
-
const require_commandkit = require('../commandkit-
|
|
3
|
+
require('../error-codes-Ds0bnPvT.js');
|
|
4
|
+
const require_commandkit = require('../commandkit-c0sAaK0G.js');
|
|
5
5
|
require('../common-CcfjYnPG.js');
|
|
6
6
|
require('../common-vnMIelAE.js');
|
|
7
7
|
require('../container-z621KfH5.js');
|
|
@@ -23,10 +23,10 @@ require('../runtime-5fxB4uhe.js');
|
|
|
23
23
|
require('../utils-BnXM4eKk.js');
|
|
24
24
|
require('../resolve-file-url-DHTQj2mU.js');
|
|
25
25
|
require('../types-package-DrnIdWLg.js');
|
|
26
|
-
require('../
|
|
27
|
-
|
|
28
|
-
require('../
|
|
29
|
-
const require_MessageCommandParser = require('../MessageCommandParser-
|
|
26
|
+
require('../constants-DxfYtA6t.js');
|
|
27
|
+
require('../EventWorkerContext-TZIKxVCu.js');
|
|
28
|
+
const require_signals = require('../signals-r7qPAvOR.js');
|
|
29
|
+
const require_MessageCommandParser = require('../MessageCommandParser-TPEPhjvx.js');
|
|
30
30
|
require('../CommandsRouter-tMAivEfv.js');
|
|
31
31
|
require('../EventsRouter-C_J0M3uO.js');
|
|
32
32
|
require('../router-DHnFRADH.js');
|
|
@@ -43,9 +43,9 @@ exports.Context = require_commandkit.Context;
|
|
|
43
43
|
exports.MessageCommandOptions = require_MessageCommandParser.MessageCommandOptions;
|
|
44
44
|
exports.MessageCommandParser = require_MessageCommandParser.MessageCommandParser;
|
|
45
45
|
exports.MiddlewareContext = require_commandkit.MiddlewareContext;
|
|
46
|
-
exports.exitMiddleware = require_signals.exitMiddleware;
|
|
47
46
|
exports.isInteractionSource = require_helpers.isInteractionSource;
|
|
48
47
|
exports.isMessageSource = require_helpers.isMessageSource;
|
|
49
48
|
exports.redirect = require_signals.redirect;
|
|
50
49
|
exports.rethrow = require_signals.rethrow;
|
|
51
|
-
exports.stopEvents = require_signals.stopEvents;
|
|
50
|
+
exports.stopEvents = require_signals.stopEvents;
|
|
51
|
+
exports.stopMiddlewares = require_signals.stopMiddlewares;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import {
|
|
2
|
-
export {
|
|
1
|
+
import { redirect, rethrow, stopEvents, stopMiddlewares } from "../../signals-SHg7J1U_.js";
|
|
2
|
+
export { redirect, rethrow, stopEvents, stopMiddlewares };
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
require('../../error-codes-
|
|
2
|
-
require('../../EventWorkerContext-
|
|
3
|
-
const require_signals = require('../../signals-
|
|
1
|
+
require('../../error-codes-Ds0bnPvT.js');
|
|
2
|
+
require('../../EventWorkerContext-TZIKxVCu.js');
|
|
3
|
+
const require_signals = require('../../signals-r7qPAvOR.js');
|
|
4
4
|
|
|
5
|
-
exports.exitMiddleware = require_signals.exitMiddleware;
|
|
6
5
|
exports.redirect = require_signals.redirect;
|
|
7
6
|
exports.rethrow = require_signals.rethrow;
|
|
8
|
-
exports.stopEvents = require_signals.stopEvents;
|
|
7
|
+
exports.stopEvents = require_signals.stopEvents;
|
|
8
|
+
exports.stopMiddlewares = require_signals.stopMiddlewares;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { MiddlewareContext } from "../../analytics-engine-
|
|
1
|
+
import { MiddlewareContext } from "../../analytics-engine-Iu_1uJop.js";
|
|
2
2
|
import "../../EventInterceptor-x-R2qshQ.js";
|
|
3
3
|
import "../../ButtonKit-C7r7RPNf.js";
|
|
4
4
|
import "../../ModalKit-Btz58KYn.js";
|
|
@@ -23,7 +23,7 @@ import "../../text-display-DRw3r_lK.js";
|
|
|
23
23
|
import "../../index-DSBMRX9A.js";
|
|
24
24
|
import "../../index-DdqikUQD.js";
|
|
25
25
|
import "../../MessageCommandParser-ROLibZPX.js";
|
|
26
|
-
import "../../signals-
|
|
26
|
+
import "../../signals-SHg7J1U_.js";
|
|
27
27
|
import "../../helpers-Wg6P5fRQ.js";
|
|
28
28
|
import "../../CommandsRouter-CoOA7hkf.js";
|
|
29
29
|
import "../../EventsRouter-BacqK6z3.js";
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
require('../../colors-Cd4Oz-r-.js');
|
|
2
2
|
require('../../ActionRow-CmTHbo2t.js');
|
|
3
|
-
require('../../error-codes-
|
|
4
|
-
const require_commandkit = require('../../commandkit-
|
|
3
|
+
require('../../error-codes-Ds0bnPvT.js');
|
|
4
|
+
const require_commandkit = require('../../commandkit-c0sAaK0G.js');
|
|
5
5
|
require('../../common-CcfjYnPG.js');
|
|
6
6
|
require('../../common-vnMIelAE.js');
|
|
7
7
|
require('../../container-z621KfH5.js');
|
|
@@ -23,10 +23,10 @@ require('../../runtime-5fxB4uhe.js');
|
|
|
23
23
|
require('../../utils-BnXM4eKk.js');
|
|
24
24
|
require('../../resolve-file-url-DHTQj2mU.js');
|
|
25
25
|
require('../../types-package-DrnIdWLg.js');
|
|
26
|
-
require('../../
|
|
27
|
-
require('../../
|
|
28
|
-
require('../../
|
|
29
|
-
require('../../MessageCommandParser-
|
|
26
|
+
require('../../constants-DxfYtA6t.js');
|
|
27
|
+
require('../../EventWorkerContext-TZIKxVCu.js');
|
|
28
|
+
require('../../signals-r7qPAvOR.js');
|
|
29
|
+
require('../../MessageCommandParser-TPEPhjvx.js');
|
|
30
30
|
require('../../CommandsRouter-tMAivEfv.js');
|
|
31
31
|
require('../../EventsRouter-C_J0M3uO.js');
|
|
32
32
|
require('../../router-DHnFRADH.js');
|