commandkit 1.2.0-dev.20250818125640 → 1.2.0-dev.20250819125017
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/README.md +4 -12
- package/dist/{CommandsRouter-Ci1Pe8Vd.js → CommandsRouter-tMAivEfv.js} +10 -7
- package/dist/{CommandsRouter-Ci1Pe8Vd.js.map → CommandsRouter-tMAivEfv.js.map} +1 -1
- package/dist/{EventWorkerContext-DJUi1W3T.d.ts → EventWorkerContext-DiMpRt1P.d.ts} +2 -2
- package/dist/analytics/analytics-engine.d.ts +1 -1
- package/dist/analytics/analytics-engine.js +2 -2
- package/dist/analytics/analytics-provider.d.ts +1 -1
- package/dist/analytics/utils.js +2 -2
- package/dist/{analytics-engine-vA4MaJYx.d.ts → analytics-engine-Ddw9axi4.d.ts} +83 -11
- package/dist/app/commands/AppCommandRunner.d.ts +1 -1
- package/dist/app/commands/AppCommandRunner.js +2 -2
- package/dist/app/commands/Context.d.ts +1 -1
- package/dist/app/commands/Context.js +2 -2
- package/dist/app/events/EventWorkerContext.d.ts +2 -2
- package/dist/app/handlers/AppCommandHandler.d.ts +1 -1
- package/dist/app/handlers/AppCommandHandler.js +2 -2
- package/dist/app/handlers/AppEventsHandler.d.ts +1 -1
- package/dist/app/handlers/AppEventsHandler.js +2 -2
- package/dist/app/index.d.ts +1 -1
- package/dist/app/index.js +2 -2
- package/dist/app/middlewares/permissions.d.ts +42 -0
- package/dist/app/middlewares/permissions.js +38 -0
- package/dist/app/register/CommandRegistrar.d.ts +1 -1
- package/dist/app/register/CommandRegistrar.js +2 -2
- package/dist/app/router/CommandsRouter.js +1 -1
- package/dist/app/router/index.js +1 -1
- package/dist/{app-process-CjMovpoZ.js → app-process-COBre_uT.js} +2 -2
- package/dist/{app-process-CjMovpoZ.js.map → app-process-COBre_uT.js.map} +1 -1
- package/dist/{build-DXl8uEv4.js → build-n8Om7nnR.js} +4 -4
- package/dist/{build-DXl8uEv4.js.map → build-n8Om7nnR.js.map} +1 -1
- package/dist/cli/app-process.js +2 -2
- package/dist/cli/build.d.ts +1 -1
- package/dist/cli/build.js +5 -5
- package/dist/cli/common.d.ts +1 -1
- package/dist/cli/development.js +6 -6
- package/dist/cli/env.js +1 -1
- package/dist/cli/information.js +1 -1
- package/dist/cli/init.js +3 -3
- package/dist/cli/production.js +7 -7
- package/dist/cli/type-checker.js +1 -1
- package/dist/cli/utils.js +1 -1
- package/dist/{commandkit-DMEW0kJg.js → commandkit-C0BuNRSN.js} +188 -32
- package/dist/commandkit-C0BuNRSN.js.map +1 -0
- package/dist/commandkit.d.ts +1 -1
- package/dist/commandkit.js +2 -2
- package/dist/components/index.js +2 -2
- package/dist/components/v1/button/Button.js +2 -2
- package/dist/components/v1/button/ButtonKit.js +2 -2
- package/dist/components/v1/modal/Modal.js +2 -2
- package/dist/components/v1/modal/ModalKit.js +2 -2
- package/dist/components/v1/select-menu/ChannelSelectMenuKit.js +2 -2
- package/dist/components/v1/select-menu/MentionableSelectMenuKit.js +2 -2
- package/dist/components/v1/select-menu/RoleSelectMenuKit.js +2 -2
- package/dist/components/v1/select-menu/SelectMenu.js +2 -2
- package/dist/components/v1/select-menu/StringSelectMenuKit.js +2 -2
- package/dist/components/v1/select-menu/UserSelectMenuKit.js +2 -2
- package/dist/config/config.d.ts +2 -2
- package/dist/config/config.js +2 -2
- package/dist/config/default.d.ts +1 -1
- package/dist/config/default.js +2 -2
- package/dist/config/loader.d.ts +1 -1
- package/dist/config/loader.js +2 -2
- package/dist/config/types.d.ts +1 -1
- package/dist/config/utils.d.ts +1 -1
- package/dist/{config-CcWJ-vz5.d.ts → config-C4nHXErw.d.ts} +2 -2
- package/dist/{constants-DrjIvQd6.d.ts → constants-D8PMA9on.d.ts} +1 -1
- package/dist/{constants-4oxxvaJA.js → constants-_QEzyskw.js} +1 -1
- package/dist/{constants-4oxxvaJA.js.map → constants-_QEzyskw.js.map} +1 -1
- package/dist/context/async-context.d.ts +1 -1
- package/dist/context/async-context.js +2 -2
- package/dist/context/environment.d.ts +1 -1
- package/dist/context/environment.js +2 -2
- package/dist/{dotprops-C_4L7RPD.js → dotprops-HH5qmrql.js} +1 -1
- package/dist/{dotprops-C_4L7RPD.js.map → dotprops-HH5qmrql.js.map} +1 -1
- package/dist/{env-_68PRRoA.js → env-8yY-6pbC.js} +1 -1
- package/dist/{env-_68PRRoA.js.map → env-8yY-6pbC.js.map} +1 -1
- package/dist/error-codes-BzoEctmD.d.ts +54 -0
- package/dist/events/CommandKitEventsChannel.d.ts +1 -1
- package/dist/{feature-flags-Cxl9JtVG.js → feature-flags-BZMExGfA.js} +2 -2
- package/dist/{feature-flags-Cxl9JtVG.js.map → feature-flags-BZMExGfA.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 +3 -3
- package/dist/flags/store.d.ts +1 -1
- package/dist/index.d.ts +5 -4
- package/dist/index.js +8 -6
- package/dist/{init-DTBFphOg.js → init-D20FhDjn.js} +2 -2
- package/dist/{init-DTBFphOg.js.map → init-D20FhDjn.js.map} +1 -1
- package/dist/kv/constants.d.ts +1 -1
- package/dist/kv/constants.js +1 -1
- package/dist/kv/dotprops.js +1 -1
- package/dist/kv/kv.d.ts +2 -2
- package/dist/kv/kv.js +3 -3
- package/dist/kv/serde.d.ts +2 -2
- package/dist/kv/serde.js +2 -2
- package/dist/logger/DefaultLogger.js +2 -2
- package/dist/logger/Logger.js +2 -2
- 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 +2 -2
- package/dist/plugins/plugin-runtime/CommandKitPluginRuntime.d.ts +1 -1
- package/dist/plugins/plugin-runtime/CommandKitPluginRuntime.js +2 -2
- package/dist/plugins/plugin-runtime/CompilerPluginRuntime.d.ts +1 -1
- package/dist/plugins/plugin-runtime/CompilerPluginRuntime.js +2 -2
- package/dist/plugins/plugin-runtime/builtin/CommonDirectiveTransformer.d.ts +1 -1
- package/dist/plugins/plugin-runtime/builtin/CommonDirectiveTransformer.js +2 -2
- package/dist/plugins/plugin-runtime/builtin/MacroPlugin.d.ts +1 -1
- package/dist/plugins/plugin-runtime/builtin/MacroPlugin.js +2 -2
- package/dist/plugins/plugin-runtime/runtime.d.ts +1 -1
- package/dist/plugins/types.d.ts +1 -1
- package/dist/{serde-BUDI03pX.d.ts → serde-BYaKrsOV.d.ts} +2 -2
- package/dist/{serde-CHySNpFr.js → serde-CrxRqj3u.js} +2 -2
- package/dist/{serde-CHySNpFr.js.map → serde-CrxRqj3u.js.map} +1 -1
- package/dist/{type-checker-1Iu1jJcy.js → type-checker-BIOeyY9g.js} +1 -1
- package/dist/{type-checker-1Iu1jJcy.js.map → type-checker-BIOeyY9g.js.map} +1 -1
- package/dist/types.d.ts +2 -2
- package/dist/utils/dev-hooks.d.ts +1 -1
- package/dist/utils/dev-hooks.js +2 -2
- package/dist/utils/error-codes.d.ts +2 -54
- package/dist/utils/utilities.js +2 -2
- package/dist/{utils-DCSnVAZ6.js → utils-Bf-3Eevb.js} +1 -1
- package/dist/{utils-DCSnVAZ6.js.map → utils-Bf-3Eevb.js.map} +1 -1
- package/dist/{version-C1IgTOgS.js → version-CXwQ7AXt.js} +2 -2
- package/dist/{version-C1IgTOgS.js.map → version-CXwQ7AXt.js.map} +1 -1
- package/dist/version.js +1 -1
- package/package.json +2 -2
- package/dist/commandkit-DMEW0kJg.js.map +0 -1
package/README.md
CHANGED
|
@@ -1,16 +1,12 @@
|
|
|
1
1
|
<div align="center">
|
|
2
|
-
<img src="https://raw.githubusercontent.com/underctrl-io/commandkit/main/apps/website/static/img/ckit_logo.svg" width="
|
|
2
|
+
<img src="https://raw.githubusercontent.com/underctrl-io/commandkit/main/apps/website/static/img/ckit_logo.svg" width="75%" />
|
|
3
3
|
<br />
|
|
4
4
|
<a href="https://ctrl.lol/discord"><img src="https://img.shields.io/discord/1055188344188973066?color=5865F2&logo=discord&logoColor=white" alt="support server" /></a>
|
|
5
5
|
<a href="https://www.npmjs.com/package/commandkit"><img src="https://img.shields.io/npm/v/commandkit?maxAge=3600" alt="npm version" /></a>
|
|
6
6
|
<a href="https://www.npmjs.com/package/commandkit"><img src="https://img.shields.io/npm/dt/commandkit?maxAge=3600" alt="npm downloads" /></a>
|
|
7
7
|
</div>
|
|
8
8
|
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
CommandKit is a library that makes it easy to handle commands and events in your Discord.js projects.
|
|
12
|
-
|
|
13
|
-
> **Supports Discord.js version 14**
|
|
9
|
+
<p align="center">The discord.js meta-framework for building powerful, modular, and extensible Discord bots with ease.</p>
|
|
14
10
|
|
|
15
11
|
## Features
|
|
16
12
|
|
|
@@ -31,9 +27,9 @@ CommandKit is a library that makes it easy to handle commands and events in your
|
|
|
31
27
|
- Less boilerplate code, more productivity 💪
|
|
32
28
|
- and much more...
|
|
33
29
|
|
|
34
|
-
##
|
|
30
|
+
## Getting Started
|
|
35
31
|
|
|
36
|
-
|
|
32
|
+
Get started by checking out the [documentation](https://commandkit.dev).
|
|
37
33
|
|
|
38
34
|
## Installation
|
|
39
35
|
|
|
@@ -48,10 +44,6 @@ npm create commandkit
|
|
|
48
44
|
|
|
49
45
|
This will prompt you to enter few details about your project. Once you have entered the details, you can simply run `commandkit dev` to start the bot application.
|
|
50
46
|
|
|
51
|
-
## Getting Started
|
|
52
|
-
|
|
53
|
-
To get started with CommandKit, you can check out the [quick start guide](https://commandkit.dev/docs/next/guide/installation).
|
|
54
|
-
|
|
55
47
|
## Support and Suggestions
|
|
56
48
|
|
|
57
49
|
Submit any queries or suggestions in our [Discord community](https://ctrl.lol/discord).
|
|
@@ -186,12 +186,15 @@ var CommandsRouter = class {
|
|
|
186
186
|
applyMiddlewares() {
|
|
187
187
|
this.commands.forEach((command) => {
|
|
188
188
|
const commandPath = command.parentPath;
|
|
189
|
-
const
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
189
|
+
const allMiddlewares = Array.from(this.middlewares.values());
|
|
190
|
+
const commandSpecificMiddlewares = allMiddlewares.filter((middleware) => middleware.command === command.name).map((middleware) => middleware.id);
|
|
191
|
+
const directorySpecificMiddlewares = allMiddlewares.filter((middleware) => !middleware.global && !middleware.command && middleware.parentPath === commandPath).map((middleware) => middleware.id);
|
|
192
|
+
const globalMiddlewares = allMiddlewares.filter((middleware) => middleware.global).map((middleware) => middleware.id);
|
|
193
|
+
command.middlewares = [
|
|
194
|
+
...commandSpecificMiddlewares,
|
|
195
|
+
...directorySpecificMiddlewares,
|
|
196
|
+
...globalMiddlewares
|
|
197
|
+
];
|
|
195
198
|
});
|
|
196
199
|
}
|
|
197
200
|
/**
|
|
@@ -211,4 +214,4 @@ Object.defineProperty(exports, 'CommandsRouter', {
|
|
|
211
214
|
return CommandsRouter;
|
|
212
215
|
}
|
|
213
216
|
});
|
|
214
|
-
//# sourceMappingURL=CommandsRouter-
|
|
217
|
+
//# sourceMappingURL=CommandsRouter-tMAivEfv.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CommandsRouter-Ci1Pe8Vd.js","names":[],"sources":["../src/app/router/CommandsRouter.ts"],"sourcesContent":["import { Collection } from 'discord.js';\nimport { Dirent, existsSync } from 'node:fs';\nimport { readdir } from 'node:fs/promises';\nimport { basename, extname, join, normalize } from 'node:path';\n\n/**\n * Represents a command with its metadata and middleware associations.\n */\nexport interface Command {\n id: string;\n name: string;\n path: string;\n relativePath: string;\n parentPath: string;\n middlewares: Array<string>;\n category: string | null;\n}\n\n/**\n * Represents a middleware with its metadata and scope.\n */\nexport interface Middleware {\n id: string;\n name: string;\n path: string;\n relativePath: string;\n parentPath: string;\n global: boolean;\n command: string | null;\n}\n\n/**\n * Data structure containing parsed commands and middleware.\n */\nexport interface ParsedCommandData {\n commands: Record<string, Command>;\n middlewares: Record<string, Middleware>;\n}\n\n/**\n * Configuration options for the commands router.\n */\nexport interface CommandsRouterOptions {\n entrypoint: string;\n}\n\n/**\n * @private\n * @internal\n */\nconst MIDDLEWARE_PATTERN = /^\\+middleware\\.(m|c)?(j|t)sx?$/;\n\n/**\n * @private\n * @internal\n */\nconst COMMAND_MIDDLEWARE_PATTERN =\n /^\\+([^+().][^().]*)\\.middleware\\.(m|c)?(j|t)sx?$/;\n\n/**\n * @private\n * @internal\n */\nconst GLOBAL_MIDDLEWARE_PATTERN = /^\\+global-middleware\\.(m|c)?(j|t)sx?$/;\n\n/**\n * @private\n * @internal\n */\nconst COMMAND_PATTERN = /^([^+().][^().]*)\\.(m|c)?(j|t)sx?$/;\n\n/**\n * @private\n * @internal\n */\nconst CATEGORY_PATTERN = /^\\(.+\\)$/;\n\n/**\n * Handles discovery and parsing of command and middleware files in the filesystem.\n */\nexport class CommandsRouter {\n /**\n * @private\n * @internal\n */\n private commands = new Collection<string, Command>();\n\n /**\n * @private\n * @internal\n */\n private middlewares = new Collection<string, Middleware>();\n\n /**\n * Creates a new CommandsRouter instance.\n * @param options - Configuration options for the router\n */\n public constructor(private readonly options: CommandsRouterOptions) {}\n\n /**\n * Populates the router with existing command and middleware data.\n * @param data - Parsed command data to populate with\n */\n public populate(data: ParsedCommandData) {\n for (const [id, command] of Object.entries(data.commands)) {\n this.commands.set(id, command);\n }\n\n for (const [id, middleware] of Object.entries(data.middlewares)) {\n this.middlewares.set(id, middleware);\n }\n }\n\n /**\n * Checks if the configured entrypoint path exists.\n * @returns True if the path exists\n */\n public isValidPath(): boolean {\n return existsSync(this.options.entrypoint);\n }\n\n /**\n * @private\n * @internal\n */\n private isCommand(name: string): boolean {\n return COMMAND_PATTERN.test(name);\n }\n\n /**\n * @private\n * @internal\n */\n private isMiddleware(name: string): boolean {\n return (\n MIDDLEWARE_PATTERN.test(name) ||\n GLOBAL_MIDDLEWARE_PATTERN.test(name) ||\n COMMAND_MIDDLEWARE_PATTERN.test(name)\n );\n }\n\n /**\n * @private\n * @internal\n */\n private isCategory(name: string): boolean {\n return CATEGORY_PATTERN.test(name);\n }\n\n /**\n * Clears all loaded commands and middleware.\n */\n public clear() {\n this.commands.clear();\n this.middlewares.clear();\n }\n\n /**\n * Scans the filesystem for commands and middleware files.\n * @returns Parsed command data\n */\n public async scan() {\n const entries = await readdir(this.options.entrypoint, {\n withFileTypes: true,\n });\n\n for (const entry of entries) {\n // ignore _ prefixed files\n if (entry.name.startsWith('_')) continue;\n\n const fullPath = join(this.options.entrypoint, entry.name);\n\n if (entry.isDirectory()) {\n const category = this.isCategory(entry.name)\n ? entry.name.slice(1, -1)\n : null;\n\n await this.traverse(fullPath, category);\n } else {\n await this.handle(entry);\n }\n }\n\n await this.applyMiddlewares();\n\n return this.toJSON();\n }\n\n /**\n * Gets the raw command and middleware collections.\n * @returns Object containing commands and middlewares collections\n */\n public getData() {\n return {\n commands: this.commands,\n middlewares: this.middlewares,\n };\n }\n\n /**\n * Converts the loaded data to a JSON-serializable format.\n * @returns Plain object with commands and middlewares\n */\n public toJSON() {\n return {\n commands: Object.fromEntries(this.commands.entries()),\n middlewares: Object.fromEntries(this.middlewares.entries()),\n };\n }\n\n /**\n * @private\n * @internal\n */\n private async traverse(path: string, category: string | null) {\n const entries = await readdir(path, {\n withFileTypes: true,\n });\n\n for (const entry of entries) {\n // ignore _ prefixed files\n if (entry.name.startsWith('_')) continue;\n\n if (entry.isFile()) {\n if (this.isCommand(entry.name) || this.isMiddleware(entry.name)) {\n await this.handle(entry, category);\n }\n } else if (\n entry.isDirectory() &&\n this.isCategory(entry.name) &&\n category\n ) {\n // nested category\n const nestedCategory = this.isCategory(entry.name)\n ? `${category}:${entry.name.slice(1, -1)}`\n : null;\n await this.traverse(join(path, entry.name), nestedCategory);\n }\n\n // TODO: handle subcommands\n }\n }\n\n /**\n * @private\n * @internal\n */\n private async handle(entry: Dirent, category: string | null = null) {\n const name = entry.name;\n const path = join(entry.parentPath, entry.name);\n\n if (this.isCommand(name)) {\n const command: Command = {\n id: crypto.randomUUID(),\n name: basename(path, extname(path)),\n path,\n category,\n parentPath: entry.parentPath,\n relativePath: this.replaceEntrypoint(path),\n middlewares: [],\n };\n\n this.commands.set(command.id, command);\n } else if (this.isMiddleware(name)) {\n const middleware: Middleware = {\n id: crypto.randomUUID(),\n name: basename(path, extname(path)),\n path,\n relativePath: this.replaceEntrypoint(path),\n parentPath: entry.parentPath,\n global: GLOBAL_MIDDLEWARE_PATTERN.test(name),\n command: COMMAND_MIDDLEWARE_PATTERN.test(name)\n ? name.match(COMMAND_MIDDLEWARE_PATTERN)?.[1] || null\n : null,\n };\n\n this.middlewares.set(middleware.id, middleware);\n }\n }\n\n /**\n * @private\n * @internal\n */\n private applyMiddlewares() {\n this.commands.forEach((command) => {\n const commandPath = command.parentPath;\n const samePathMiddlewares = Array.from(this.middlewares.values())\n .filter((middleware) => {\n if (middleware.global) return true;\n if (middleware.command) return middleware.command === command.name;\n return middleware.parentPath === commandPath;\n })\n .map((middleware) => middleware.id);\n\n command.middlewares = Array.from(\n new Set([...command.middlewares, ...samePathMiddlewares]),\n );\n });\n }\n\n /**\n * @private\n * @internal\n */\n private replaceEntrypoint(path: string) {\n const normalized = normalize(path);\n return normalized.replace(this.options.entrypoint, '');\n }\n}\n"],"mappings":"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"}
|
|
1
|
+
{"version":3,"file":"CommandsRouter-tMAivEfv.js","names":[],"sources":["../src/app/router/CommandsRouter.ts"],"sourcesContent":["import { Collection } from 'discord.js';\nimport { Dirent, existsSync } from 'node:fs';\nimport { readdir } from 'node:fs/promises';\nimport { basename, extname, join, normalize } from 'node:path';\n\n/**\n * Represents a command with its metadata and middleware associations.\n */\nexport interface Command {\n id: string;\n name: string;\n path: string;\n relativePath: string;\n parentPath: string;\n middlewares: Array<string>;\n category: string | null;\n}\n\n/**\n * Represents a middleware with its metadata and scope.\n */\nexport interface Middleware {\n id: string;\n name: string;\n path: string;\n relativePath: string;\n parentPath: string;\n global: boolean;\n command: string | null;\n}\n\n/**\n * Data structure containing parsed commands and middleware.\n */\nexport interface ParsedCommandData {\n commands: Record<string, Command>;\n middlewares: Record<string, Middleware>;\n}\n\n/**\n * Configuration options for the commands router.\n */\nexport interface CommandsRouterOptions {\n entrypoint: string;\n}\n\n/**\n * @private\n * @internal\n */\nconst MIDDLEWARE_PATTERN = /^\\+middleware\\.(m|c)?(j|t)sx?$/;\n\n/**\n * @private\n * @internal\n */\nconst COMMAND_MIDDLEWARE_PATTERN =\n /^\\+([^+().][^().]*)\\.middleware\\.(m|c)?(j|t)sx?$/;\n\n/**\n * @private\n * @internal\n */\nconst GLOBAL_MIDDLEWARE_PATTERN = /^\\+global-middleware\\.(m|c)?(j|t)sx?$/;\n\n/**\n * @private\n * @internal\n */\nconst COMMAND_PATTERN = /^([^+().][^().]*)\\.(m|c)?(j|t)sx?$/;\n\n/**\n * @private\n * @internal\n */\nconst CATEGORY_PATTERN = /^\\(.+\\)$/;\n\n/**\n * Handles discovery and parsing of command and middleware files in the filesystem.\n */\nexport class CommandsRouter {\n /**\n * @private\n * @internal\n */\n private commands = new Collection<string, Command>();\n\n /**\n * @private\n * @internal\n */\n private middlewares = new Collection<string, Middleware>();\n\n /**\n * Creates a new CommandsRouter instance.\n * @param options - Configuration options for the router\n */\n public constructor(private readonly options: CommandsRouterOptions) {}\n\n /**\n * Populates the router with existing command and middleware data.\n * @param data - Parsed command data to populate with\n */\n public populate(data: ParsedCommandData) {\n for (const [id, command] of Object.entries(data.commands)) {\n this.commands.set(id, command);\n }\n\n for (const [id, middleware] of Object.entries(data.middlewares)) {\n this.middlewares.set(id, middleware);\n }\n }\n\n /**\n * Checks if the configured entrypoint path exists.\n * @returns True if the path exists\n */\n public isValidPath(): boolean {\n return existsSync(this.options.entrypoint);\n }\n\n /**\n * @private\n * @internal\n */\n private isCommand(name: string): boolean {\n return COMMAND_PATTERN.test(name);\n }\n\n /**\n * @private\n * @internal\n */\n private isMiddleware(name: string): boolean {\n return (\n MIDDLEWARE_PATTERN.test(name) ||\n GLOBAL_MIDDLEWARE_PATTERN.test(name) ||\n COMMAND_MIDDLEWARE_PATTERN.test(name)\n );\n }\n\n /**\n * @private\n * @internal\n */\n private isCategory(name: string): boolean {\n return CATEGORY_PATTERN.test(name);\n }\n\n /**\n * Clears all loaded commands and middleware.\n */\n public clear() {\n this.commands.clear();\n this.middlewares.clear();\n }\n\n /**\n * Scans the filesystem for commands and middleware files.\n * @returns Parsed command data\n */\n public async scan() {\n const entries = await readdir(this.options.entrypoint, {\n withFileTypes: true,\n });\n\n for (const entry of entries) {\n // ignore _ prefixed files\n if (entry.name.startsWith('_')) continue;\n\n const fullPath = join(this.options.entrypoint, entry.name);\n\n if (entry.isDirectory()) {\n const category = this.isCategory(entry.name)\n ? entry.name.slice(1, -1)\n : null;\n\n await this.traverse(fullPath, category);\n } else {\n await this.handle(entry);\n }\n }\n\n await this.applyMiddlewares();\n\n return this.toJSON();\n }\n\n /**\n * Gets the raw command and middleware collections.\n * @returns Object containing commands and middlewares collections\n */\n public getData() {\n return {\n commands: this.commands,\n middlewares: this.middlewares,\n };\n }\n\n /**\n * Converts the loaded data to a JSON-serializable format.\n * @returns Plain object with commands and middlewares\n */\n public toJSON() {\n return {\n commands: Object.fromEntries(this.commands.entries()),\n middlewares: Object.fromEntries(this.middlewares.entries()),\n };\n }\n\n /**\n * @private\n * @internal\n */\n private async traverse(path: string, category: string | null) {\n const entries = await readdir(path, {\n withFileTypes: true,\n });\n\n for (const entry of entries) {\n // ignore _ prefixed files\n if (entry.name.startsWith('_')) continue;\n\n if (entry.isFile()) {\n if (this.isCommand(entry.name) || this.isMiddleware(entry.name)) {\n await this.handle(entry, category);\n }\n } else if (\n entry.isDirectory() &&\n this.isCategory(entry.name) &&\n category\n ) {\n // nested category\n const nestedCategory = this.isCategory(entry.name)\n ? `${category}:${entry.name.slice(1, -1)}`\n : null;\n await this.traverse(join(path, entry.name), nestedCategory);\n }\n\n // TODO: handle subcommands\n }\n }\n\n /**\n * @private\n * @internal\n */\n private async handle(entry: Dirent, category: string | null = null) {\n const name = entry.name;\n const path = join(entry.parentPath, entry.name);\n\n if (this.isCommand(name)) {\n const command: Command = {\n id: crypto.randomUUID(),\n name: basename(path, extname(path)),\n path,\n category,\n parentPath: entry.parentPath,\n relativePath: this.replaceEntrypoint(path),\n middlewares: [],\n };\n\n this.commands.set(command.id, command);\n } else if (this.isMiddleware(name)) {\n const middleware: Middleware = {\n id: crypto.randomUUID(),\n name: basename(path, extname(path)),\n path,\n relativePath: this.replaceEntrypoint(path),\n parentPath: entry.parentPath,\n global: GLOBAL_MIDDLEWARE_PATTERN.test(name),\n command: COMMAND_MIDDLEWARE_PATTERN.test(name)\n ? name.match(COMMAND_MIDDLEWARE_PATTERN)?.[1] || null\n : null,\n };\n\n this.middlewares.set(middleware.id, middleware);\n }\n }\n\n /**\n * @private\n * @internal\n */\n private applyMiddlewares() {\n this.commands.forEach((command) => {\n const commandPath = command.parentPath;\n const allMiddlewares = Array.from(this.middlewares.values());\n\n const commandSpecificMiddlewares = allMiddlewares\n .filter((middleware) => middleware.command === command.name)\n .map((middleware) => middleware.id);\n\n const directorySpecificMiddlewares = allMiddlewares\n .filter(\n (middleware) =>\n !middleware.global &&\n !middleware.command &&\n middleware.parentPath === commandPath,\n )\n .map((middleware) => middleware.id);\n\n const globalMiddlewares = allMiddlewares\n .filter((middleware) => middleware.global)\n .map((middleware) => middleware.id);\n\n command.middlewares = [\n ...commandSpecificMiddlewares,\n ...directorySpecificMiddlewares,\n ...globalMiddlewares,\n ];\n });\n }\n\n /**\n * @private\n * @internal\n */\n private replaceEntrypoint(path: string) {\n const normalized = normalize(path);\n return normalized.replace(this.options.entrypoint, '');\n }\n}\n"],"mappings":"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"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { CommandKit } from "./analytics-engine-
|
|
1
|
+
import { CommandKit } from "./analytics-engine-Ddw9axi4.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-DiMpRt1P.d.ts.map
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { AnalyticsEngine, FilterFunction } from "../analytics-engine-
|
|
1
|
+
import { AnalyticsEngine, FilterFunction } from "../analytics-engine-Ddw9axi4.js";
|
|
2
2
|
import "../EventInterceptor-x-R2qshQ.js";
|
|
3
3
|
import "../ButtonKit-C7r7RPNf.js";
|
|
4
4
|
import "../ModalKit-Btz58KYn.js";
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
require('../colors-Cd4Oz-r-.js');
|
|
2
2
|
require('../ActionRow-CmTHbo2t.js');
|
|
3
3
|
require('../error-codes-C-ViHyu-.js');
|
|
4
|
-
const require_commandkit = require('../commandkit-
|
|
4
|
+
const require_commandkit = require('../commandkit-C0BuNRSN.js');
|
|
5
5
|
require('../common-CcfjYnPG.js');
|
|
6
6
|
require('../common-vnMIelAE.js');
|
|
7
7
|
require('../container-z621KfH5.js');
|
|
@@ -27,7 +27,7 @@ require('../EventWorkerContext-CSlD9rbx.js');
|
|
|
27
27
|
require('../signals-DHdYrd-n.js');
|
|
28
28
|
require('../constants-CUND8XkG.js');
|
|
29
29
|
require('../MessageCommandParser-B_BEQ3p8.js');
|
|
30
|
-
require('../CommandsRouter-
|
|
30
|
+
require('../CommandsRouter-tMAivEfv.js');
|
|
31
31
|
require('../EventsRouter-C_J0M3uO.js');
|
|
32
32
|
require('../router-DHnFRADH.js');
|
|
33
33
|
require('../common-DNADUU3_.js');
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { AnalyticsEvent, AnalyticsProvider, IdentifyEvent } from "../analytics-engine-
|
|
1
|
+
import { AnalyticsEvent, AnalyticsProvider, IdentifyEvent } from "../analytics-engine-Ddw9axi4.js";
|
|
2
2
|
import "../EventInterceptor-x-R2qshQ.js";
|
|
3
3
|
import "../ButtonKit-C7r7RPNf.js";
|
|
4
4
|
import "../ModalKit-Btz58KYn.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
3
|
require('../error-codes-C-ViHyu-.js');
|
|
4
|
-
const require_commandkit = require('../commandkit-
|
|
4
|
+
const require_commandkit = require('../commandkit-C0BuNRSN.js');
|
|
5
5
|
require('../common-CcfjYnPG.js');
|
|
6
6
|
require('../common-vnMIelAE.js');
|
|
7
7
|
require('../container-z621KfH5.js');
|
|
@@ -27,7 +27,7 @@ require('../EventWorkerContext-CSlD9rbx.js');
|
|
|
27
27
|
require('../signals-DHdYrd-n.js');
|
|
28
28
|
require('../constants-CUND8XkG.js');
|
|
29
29
|
require('../MessageCommandParser-B_BEQ3p8.js');
|
|
30
|
-
require('../CommandsRouter-
|
|
30
|
+
require('../CommandsRouter-tMAivEfv.js');
|
|
31
31
|
require('../EventsRouter-C_J0M3uO.js');
|
|
32
32
|
require('../router-DHnFRADH.js');
|
|
33
33
|
require('../common-DNADUU3_.js');
|
|
@@ -6,7 +6,7 @@ import { Command, CommandsRouter, Middleware } from "./CommandsRouter-CoOA7hkf.j
|
|
|
6
6
|
import { EventsRouter, ParsedEvent } from "./EventsRouter-BacqK6z3.js";
|
|
7
7
|
import { HMREventType } from "./constants-MKu-Q1jh.js";
|
|
8
8
|
import EventEmitter from "node:events";
|
|
9
|
-
import { AutocompleteInteraction, Awaitable, CacheType, ChatInputCommandInteraction, Client, ClientEvents, Collection, Constructable, ContextMenuCommandBuilder, ContextMenuCommandInteraction, Guild, Interaction, Locale, Message, MessageContextMenuCommandInteraction, RESTPostAPIApplicationCommandsJSONBody, SlashCommandBuilder, TextBasedChannel, UserContextMenuCommandInteraction } from "discord.js";
|
|
9
|
+
import { AutocompleteInteraction, Awaitable, CacheType, ChatInputCommandInteraction, Client, ClientEvents, Collection, Constructable, ContextMenuCommandBuilder, ContextMenuCommandInteraction, Guild, Interaction, Locale, Message, MessageContextMenuCommandInteraction, PermissionsString, RESTPostAPIApplicationCommandsJSONBody, SlashCommandBuilder, TextBasedChannel, UserContextMenuCommandInteraction } from "discord.js";
|
|
10
10
|
import { DirectiveTransformerOptions } from "directive-to-hof";
|
|
11
11
|
import { Options } from "tsdown";
|
|
12
12
|
|
|
@@ -38,18 +38,59 @@ interface CommandContext<T extends Interaction, Cached extends CacheType> {
|
|
|
38
38
|
*/
|
|
39
39
|
handler: CommandKit;
|
|
40
40
|
}
|
|
41
|
+
/**
|
|
42
|
+
* Represents the command metadata.
|
|
43
|
+
*/
|
|
44
|
+
interface CommandMetadata {
|
|
45
|
+
/**
|
|
46
|
+
* The guilds that the command is available in.
|
|
47
|
+
*/
|
|
48
|
+
guilds?: string[];
|
|
49
|
+
/**
|
|
50
|
+
* The aliases of the command.
|
|
51
|
+
*/
|
|
52
|
+
aliases?: string[];
|
|
53
|
+
/**
|
|
54
|
+
* The user permissions required to execute the command.
|
|
55
|
+
*/
|
|
56
|
+
userPermissions?: PermissionsString | PermissionsString[];
|
|
57
|
+
/**
|
|
58
|
+
* The bot permissions required to execute the command.
|
|
59
|
+
*/
|
|
60
|
+
botPermissions?: PermissionsString | PermissionsString[];
|
|
61
|
+
}
|
|
62
|
+
/**
|
|
63
|
+
* @deprecated Use `CommandMetadata` instead.
|
|
64
|
+
*/
|
|
65
|
+
interface LegacyCommandMetadata {
|
|
66
|
+
/**
|
|
67
|
+
* The aliases of the command.
|
|
68
|
+
* @deprecated Use `metadata.aliases` or `generateMetadata` instead.
|
|
69
|
+
*/
|
|
70
|
+
aliases?: string[];
|
|
71
|
+
/**
|
|
72
|
+
* The guilds that the command is available in.
|
|
73
|
+
* @deprecated Use `metadata.guilds` or `generateMetadata` instead.
|
|
74
|
+
*/
|
|
75
|
+
guilds?: string[];
|
|
76
|
+
}
|
|
41
77
|
/**
|
|
42
78
|
* Represents a command that can be executed by CommandKit.
|
|
43
79
|
*/
|
|
44
80
|
type CommandData = Prettify<Omit<RESTPostAPIApplicationCommandsJSONBody, 'description'> & {
|
|
81
|
+
/**
|
|
82
|
+
* The description of the command.
|
|
83
|
+
*/
|
|
45
84
|
description?: string;
|
|
46
|
-
|
|
47
|
-
aliases?: string[];
|
|
48
|
-
}>;
|
|
85
|
+
} & LegacyCommandMetadata>;
|
|
49
86
|
/**
|
|
50
87
|
* Represents an event handler for a specific event.
|
|
51
88
|
*/
|
|
52
|
-
type EventHandler<K extends keyof ClientEvents> = (...args: ClientEvents[K]) => void | Promise<void>;
|
|
89
|
+
type EventHandler<K extends keyof ClientEvents> = (...args: [...ClientEvents[K], Client<true>, CommandKit]) => void | Promise<void>;
|
|
90
|
+
/**
|
|
91
|
+
* The command metadata function
|
|
92
|
+
*/
|
|
93
|
+
type CommandMetadataFunction = () => Promise<CommandMetadata> | CommandMetadata;
|
|
53
94
|
//#endregion
|
|
54
95
|
//#region src/app/commands/Context.d.ts
|
|
55
96
|
/**
|
|
@@ -359,7 +400,9 @@ declare class CommandRegistrar {
|
|
|
359
400
|
/**
|
|
360
401
|
* Gets the commands data.
|
|
361
402
|
*/
|
|
362
|
-
getCommandsData(): CommandData
|
|
403
|
+
getCommandsData(): (CommandData & {
|
|
404
|
+
__metadata?: CommandMetadata;
|
|
405
|
+
})[];
|
|
363
406
|
/**
|
|
364
407
|
* Registers loaded commands.
|
|
365
408
|
*/
|
|
@@ -367,11 +410,15 @@ declare class CommandRegistrar {
|
|
|
367
410
|
/**
|
|
368
411
|
* Updates the global commands.
|
|
369
412
|
*/
|
|
370
|
-
updateGlobalCommands(commands: CommandData
|
|
413
|
+
updateGlobalCommands(commands: (CommandData & {
|
|
414
|
+
__metadata?: CommandMetadata;
|
|
415
|
+
})[]): Promise<void>;
|
|
371
416
|
/**
|
|
372
417
|
* Updates the guild commands.
|
|
373
418
|
*/
|
|
374
|
-
updateGuildCommands(commands: CommandData
|
|
419
|
+
updateGuildCommands(commands: (CommandData & {
|
|
420
|
+
__metadata?: CommandMetadata;
|
|
421
|
+
})[]): Promise<void>;
|
|
375
422
|
}
|
|
376
423
|
//#endregion
|
|
377
424
|
//#region src/context/environment.d.ts
|
|
@@ -653,6 +700,8 @@ type RunCommand = <T extends AsyncFunction>(fn: T) => T;
|
|
|
653
700
|
*/
|
|
654
701
|
interface AppCommandNative {
|
|
655
702
|
command: CommandData | Record<string, any>;
|
|
703
|
+
generateMetadata?: CommandMetadataFunction;
|
|
704
|
+
metadata?: CommandMetadata;
|
|
656
705
|
chatInput?: (ctx: Context) => Awaitable<unknown>;
|
|
657
706
|
autocomplete?: (ctx: Context) => Awaitable<unknown>;
|
|
658
707
|
message?: (ctx: Context) => Awaitable<unknown>;
|
|
@@ -684,8 +733,8 @@ interface AppCommandMiddleware {
|
|
|
684
733
|
*/
|
|
685
734
|
interface LoadedCommand {
|
|
686
735
|
command: Command;
|
|
736
|
+
metadata: CommandMetadata;
|
|
687
737
|
data: AppCommand;
|
|
688
|
-
guilds?: string[];
|
|
689
738
|
}
|
|
690
739
|
/**
|
|
691
740
|
* Type representing command data identifier.
|
|
@@ -727,8 +776,20 @@ declare const commandDataSchema: {
|
|
|
727
776
|
messageContextMenu: (c: unknown) => c is Function;
|
|
728
777
|
userContextMenu: (c: unknown) => c is Function;
|
|
729
778
|
};
|
|
779
|
+
/**
|
|
780
|
+
* @private
|
|
781
|
+
* @internal
|
|
782
|
+
*/
|
|
730
783
|
type CommandDataSchema = typeof commandDataSchema;
|
|
784
|
+
/**
|
|
785
|
+
* @private
|
|
786
|
+
* @internal
|
|
787
|
+
*/
|
|
731
788
|
type CommandDataSchemaKey = keyof CommandDataSchema;
|
|
789
|
+
/**
|
|
790
|
+
* @private
|
|
791
|
+
* @internal
|
|
792
|
+
*/
|
|
732
793
|
type CommandDataSchemaValue = CommandDataSchema[CommandDataSchemaKey];
|
|
733
794
|
/**
|
|
734
795
|
* Handles application commands for CommandKit, including loading, registration, and execution.
|
|
@@ -841,6 +902,12 @@ declare class AppCommandHandler {
|
|
|
841
902
|
* @internal
|
|
842
903
|
*/
|
|
843
904
|
private loadCommand;
|
|
905
|
+
/**
|
|
906
|
+
* Gets the metadata for a command.
|
|
907
|
+
* @param command - The command name to get metadata for
|
|
908
|
+
* @returns The command metadata or null if not found
|
|
909
|
+
*/
|
|
910
|
+
getMetadataFor(command: string): CommandMetadata | null;
|
|
844
911
|
}
|
|
845
912
|
//#endregion
|
|
846
913
|
//#region src/events/CommandKitEventsChannel.d.ts
|
|
@@ -1864,6 +1931,11 @@ interface CommandKitConfig {
|
|
|
1864
1931
|
* @default false
|
|
1865
1932
|
*/
|
|
1866
1933
|
disablePrefixCommands?: boolean;
|
|
1934
|
+
/**
|
|
1935
|
+
* Whether or not to disable the built-in permissions middleware. This only affects `botPermissions` and `userPermissions` in the command metadata.
|
|
1936
|
+
* @default false
|
|
1937
|
+
*/
|
|
1938
|
+
disablePermissionsMiddleware?: boolean;
|
|
1867
1939
|
/**
|
|
1868
1940
|
* Whether or not to show a warning when a prefix command is not found. This only affects development mode.
|
|
1869
1941
|
* @default true
|
|
@@ -2179,5 +2251,5 @@ declare class AnalyticsEngine {
|
|
|
2179
2251
|
track(event: AnalyticsEvent): Promise<void>;
|
|
2180
2252
|
}
|
|
2181
2253
|
//#endregion
|
|
2182
|
-
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, 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, 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 };
|
|
2183
|
-
//# sourceMappingURL=analytics-engine-
|
|
2254
|
+
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-Ddw9axi4.d.ts.map
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { AppCommandRunner, RunCommandOptions } from "../../analytics-engine-
|
|
1
|
+
import { AppCommandRunner, RunCommandOptions } from "../../analytics-engine-Ddw9axi4.js";
|
|
2
2
|
import "../../EventInterceptor-x-R2qshQ.js";
|
|
3
3
|
import "../../ButtonKit-C7r7RPNf.js";
|
|
4
4
|
import "../../ModalKit-Btz58KYn.js";
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
require('../../colors-Cd4Oz-r-.js');
|
|
2
2
|
require('../../ActionRow-CmTHbo2t.js');
|
|
3
3
|
require('../../error-codes-C-ViHyu-.js');
|
|
4
|
-
const require_commandkit = require('../../commandkit-
|
|
4
|
+
const require_commandkit = require('../../commandkit-C0BuNRSN.js');
|
|
5
5
|
require('../../common-CcfjYnPG.js');
|
|
6
6
|
require('../../common-vnMIelAE.js');
|
|
7
7
|
require('../../container-z621KfH5.js');
|
|
@@ -27,7 +27,7 @@ require('../../EventWorkerContext-CSlD9rbx.js');
|
|
|
27
27
|
require('../../signals-DHdYrd-n.js');
|
|
28
28
|
require('../../constants-CUND8XkG.js');
|
|
29
29
|
require('../../MessageCommandParser-B_BEQ3p8.js');
|
|
30
|
-
require('../../CommandsRouter-
|
|
30
|
+
require('../../CommandsRouter-tMAivEfv.js');
|
|
31
31
|
require('../../EventsRouter-C_J0M3uO.js');
|
|
32
32
|
require('../../router-DHnFRADH.js');
|
|
33
33
|
require('../../common-DNADUU3_.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-Ddw9axi4.js";
|
|
2
2
|
import "../../EventInterceptor-x-R2qshQ.js";
|
|
3
3
|
import "../../ButtonKit-C7r7RPNf.js";
|
|
4
4
|
import "../../ModalKit-Btz58KYn.js";
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
require('../../colors-Cd4Oz-r-.js');
|
|
2
2
|
require('../../ActionRow-CmTHbo2t.js');
|
|
3
3
|
require('../../error-codes-C-ViHyu-.js');
|
|
4
|
-
const require_commandkit = require('../../commandkit-
|
|
4
|
+
const require_commandkit = require('../../commandkit-C0BuNRSN.js');
|
|
5
5
|
require('../../common-CcfjYnPG.js');
|
|
6
6
|
require('../../common-vnMIelAE.js');
|
|
7
7
|
require('../../container-z621KfH5.js');
|
|
@@ -27,7 +27,7 @@ require('../../EventWorkerContext-CSlD9rbx.js');
|
|
|
27
27
|
require('../../signals-DHdYrd-n.js');
|
|
28
28
|
require('../../constants-CUND8XkG.js');
|
|
29
29
|
require('../../MessageCommandParser-B_BEQ3p8.js');
|
|
30
|
-
require('../../CommandsRouter-
|
|
30
|
+
require('../../CommandsRouter-tMAivEfv.js');
|
|
31
31
|
require('../../EventsRouter-C_J0M3uO.js');
|
|
32
32
|
require('../../router-DHnFRADH.js');
|
|
33
33
|
require('../../common-DNADUU3_.js');
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import "../../analytics-engine-
|
|
1
|
+
import "../../analytics-engine-Ddw9axi4.js";
|
|
2
2
|
import "../../EventInterceptor-x-R2qshQ.js";
|
|
3
3
|
import "../../ButtonKit-C7r7RPNf.js";
|
|
4
4
|
import "../../ModalKit-Btz58KYn.js";
|
|
@@ -29,5 +29,5 @@ 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-DiMpRt1P.js";
|
|
33
33
|
export { EventWorkerContext, eventWorkerContext, getEventWorkerContext, isEventWorkerContext, runInEventWorkerContext };
|
|
@@ -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-Ddw9axi4.js";
|
|
2
2
|
import "../../EventInterceptor-x-R2qshQ.js";
|
|
3
3
|
import "../../ButtonKit-C7r7RPNf.js";
|
|
4
4
|
import "../../ModalKit-Btz58KYn.js";
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
require('../../colors-Cd4Oz-r-.js');
|
|
2
2
|
require('../../ActionRow-CmTHbo2t.js');
|
|
3
3
|
require('../../error-codes-C-ViHyu-.js');
|
|
4
|
-
const require_commandkit = require('../../commandkit-
|
|
4
|
+
const require_commandkit = require('../../commandkit-C0BuNRSN.js');
|
|
5
5
|
require('../../common-CcfjYnPG.js');
|
|
6
6
|
require('../../common-vnMIelAE.js');
|
|
7
7
|
require('../../container-z621KfH5.js');
|
|
@@ -27,7 +27,7 @@ require('../../EventWorkerContext-CSlD9rbx.js');
|
|
|
27
27
|
require('../../signals-DHdYrd-n.js');
|
|
28
28
|
require('../../constants-CUND8XkG.js');
|
|
29
29
|
require('../../MessageCommandParser-B_BEQ3p8.js');
|
|
30
|
-
require('../../CommandsRouter-
|
|
30
|
+
require('../../CommandsRouter-tMAivEfv.js');
|
|
31
31
|
require('../../EventsRouter-C_J0M3uO.js');
|
|
32
32
|
require('../../router-DHnFRADH.js');
|
|
33
33
|
require('../../common-DNADUU3_.js');
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { AppEventsHandler, AppEventsHandlerLoadedData, EventListener, LoadedEvent } from "../../analytics-engine-
|
|
1
|
+
import { AppEventsHandler, AppEventsHandlerLoadedData, EventListener, LoadedEvent } from "../../analytics-engine-Ddw9axi4.js";
|
|
2
2
|
import "../../EventInterceptor-x-R2qshQ.js";
|
|
3
3
|
import "../../ButtonKit-C7r7RPNf.js";
|
|
4
4
|
import "../../ModalKit-Btz58KYn.js";
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
require('../../colors-Cd4Oz-r-.js');
|
|
2
2
|
require('../../ActionRow-CmTHbo2t.js');
|
|
3
3
|
require('../../error-codes-C-ViHyu-.js');
|
|
4
|
-
const require_commandkit = require('../../commandkit-
|
|
4
|
+
const require_commandkit = require('../../commandkit-C0BuNRSN.js');
|
|
5
5
|
require('../../common-CcfjYnPG.js');
|
|
6
6
|
require('../../common-vnMIelAE.js');
|
|
7
7
|
require('../../container-z621KfH5.js');
|
|
@@ -27,7 +27,7 @@ require('../../EventWorkerContext-CSlD9rbx.js');
|
|
|
27
27
|
require('../../signals-DHdYrd-n.js');
|
|
28
28
|
require('../../constants-CUND8XkG.js');
|
|
29
29
|
require('../../MessageCommandParser-B_BEQ3p8.js');
|
|
30
|
-
require('../../CommandsRouter-
|
|
30
|
+
require('../../CommandsRouter-tMAivEfv.js');
|
|
31
31
|
require('../../EventsRouter-C_J0M3uO.js');
|
|
32
32
|
require('../../router-DHnFRADH.js');
|
|
33
33
|
require('../../common-DNADUU3_.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-Ddw9axi4.js";
|
|
2
2
|
import "../EventInterceptor-x-R2qshQ.js";
|
|
3
3
|
import "../ButtonKit-C7r7RPNf.js";
|
|
4
4
|
import "../ModalKit-Btz58KYn.js";
|
package/dist/app/index.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
require('../colors-Cd4Oz-r-.js');
|
|
2
2
|
require('../ActionRow-CmTHbo2t.js');
|
|
3
3
|
require('../error-codes-C-ViHyu-.js');
|
|
4
|
-
const require_commandkit = require('../commandkit-
|
|
4
|
+
const require_commandkit = require('../commandkit-C0BuNRSN.js');
|
|
5
5
|
require('../common-CcfjYnPG.js');
|
|
6
6
|
require('../common-vnMIelAE.js');
|
|
7
7
|
require('../container-z621KfH5.js');
|
|
@@ -27,7 +27,7 @@ require('../EventWorkerContext-CSlD9rbx.js');
|
|
|
27
27
|
const require_signals = require('../signals-DHdYrd-n.js');
|
|
28
28
|
require('../constants-CUND8XkG.js');
|
|
29
29
|
const require_MessageCommandParser = require('../MessageCommandParser-B_BEQ3p8.js');
|
|
30
|
-
require('../CommandsRouter-
|
|
30
|
+
require('../CommandsRouter-tMAivEfv.js');
|
|
31
31
|
require('../EventsRouter-C_J0M3uO.js');
|
|
32
32
|
require('../router-DHnFRADH.js');
|
|
33
33
|
require('../common-DNADUU3_.js');
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
import { MiddlewareContext } from "../../analytics-engine-Ddw9axi4.js";
|
|
2
|
+
import "../../EventInterceptor-x-R2qshQ.js";
|
|
3
|
+
import "../../ButtonKit-C7r7RPNf.js";
|
|
4
|
+
import "../../ModalKit-Btz58KYn.js";
|
|
5
|
+
import "../../element-CAXu1XtK.js";
|
|
6
|
+
import "../../ActionRow-DKnFVDME.js";
|
|
7
|
+
import "../../types-CJ-XvOFN.js";
|
|
8
|
+
import "../../Button-4ZUXdA56.js";
|
|
9
|
+
import "../../Modal-C6UTRdYQ.js";
|
|
10
|
+
import "../../common-DOCvOVC4.js";
|
|
11
|
+
import "../../StringSelectMenuKit-Bhs8U6WI.js";
|
|
12
|
+
import "../../ChannelSelectMenuKit-BrXvBYNH.js";
|
|
13
|
+
import "../../MentionableSelectMenuKit-CPTKqx-O.js";
|
|
14
|
+
import "../../UserSelectMenuKit-CfqFJdxz.js";
|
|
15
|
+
import "../../RoleSelectMenuKit-C26lU3sN.js";
|
|
16
|
+
import "../../SelectMenu-Diy87_ba.js";
|
|
17
|
+
import "../../container-DHBELeJ3.js";
|
|
18
|
+
import "../../file-DTrr-p09.js";
|
|
19
|
+
import "../../media-gallery-BMsXSot3.js";
|
|
20
|
+
import "../../section-Dh_FhPeC.js";
|
|
21
|
+
import "../../separator-CMf6Cyy5.js";
|
|
22
|
+
import "../../text-display-DRw3r_lK.js";
|
|
23
|
+
import "../../index-DSBMRX9A.js";
|
|
24
|
+
import "../../index-DdqikUQD.js";
|
|
25
|
+
import "../../MessageCommandParser-ROLibZPX.js";
|
|
26
|
+
import "../../signals-BQbEfy3X.js";
|
|
27
|
+
import "../../helpers-Wg6P5fRQ.js";
|
|
28
|
+
import "../../CommandsRouter-CoOA7hkf.js";
|
|
29
|
+
import "../../EventsRouter-BacqK6z3.js";
|
|
30
|
+
import "../../index-DKcmsWXw.js";
|
|
31
|
+
import "../../constants-MKu-Q1jh.js";
|
|
32
|
+
|
|
33
|
+
//#region src/app/middlewares/permissions.d.ts
|
|
34
|
+
declare const middlewareId: `${string}-${string}-${string}-${string}-${string}`;
|
|
35
|
+
/**
|
|
36
|
+
* @private
|
|
37
|
+
* @ignore
|
|
38
|
+
*/
|
|
39
|
+
declare function beforeExecute(ctx: MiddlewareContext): Promise<void>;
|
|
40
|
+
//#endregion
|
|
41
|
+
export { beforeExecute, middlewareId };
|
|
42
|
+
//# sourceMappingURL=permissions.d.ts.map
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
require('../../colors-Cd4Oz-r-.js');
|
|
2
|
+
require('../../ActionRow-CmTHbo2t.js');
|
|
3
|
+
require('../../error-codes-C-ViHyu-.js');
|
|
4
|
+
const require_commandkit = require('../../commandkit-C0BuNRSN.js');
|
|
5
|
+
require('../../common-CcfjYnPG.js');
|
|
6
|
+
require('../../common-vnMIelAE.js');
|
|
7
|
+
require('../../container-z621KfH5.js');
|
|
8
|
+
require('../../file-DVZC0QXI.js');
|
|
9
|
+
require('../../media-gallery-CIKypjbJ.js');
|
|
10
|
+
require('../../section-CuYr0Inu.js');
|
|
11
|
+
require('../../separator-DLdWBjSN.js');
|
|
12
|
+
require('../../text-display--p2-BoUa.js');
|
|
13
|
+
require('../../v2-DofkPKHs.js');
|
|
14
|
+
require('../../element-Bak9llw_.js');
|
|
15
|
+
require('../../types-CUZOquUl.js');
|
|
16
|
+
require('../../EventInterceptor-CQ4PBpBJ.js');
|
|
17
|
+
require('../../constants-B5_Ta7PR.js');
|
|
18
|
+
require('../../PluginCommon-Di1xIa8d.js');
|
|
19
|
+
require('../../CompilerPlugin-CjoZAAR8.js');
|
|
20
|
+
require('../../RuntimePlugin-CBgBLXTG.js');
|
|
21
|
+
require('../../types-q0Nm882H.js');
|
|
22
|
+
require('../../runtime-5fxB4uhe.js');
|
|
23
|
+
require('../../utils-BnXM4eKk.js');
|
|
24
|
+
require('../../resolve-file-url-DHTQj2mU.js');
|
|
25
|
+
require('../../types-package-DrnIdWLg.js');
|
|
26
|
+
require('../../EventWorkerContext-CSlD9rbx.js');
|
|
27
|
+
require('../../signals-DHdYrd-n.js');
|
|
28
|
+
require('../../constants-CUND8XkG.js');
|
|
29
|
+
require('../../MessageCommandParser-B_BEQ3p8.js');
|
|
30
|
+
require('../../CommandsRouter-tMAivEfv.js');
|
|
31
|
+
require('../../EventsRouter-C_J0M3uO.js');
|
|
32
|
+
require('../../router-DHnFRADH.js');
|
|
33
|
+
require('../../common-DNADUU3_.js');
|
|
34
|
+
require('../../CommandKitEventsChannel-Bgw0XCOl.js');
|
|
35
|
+
require('../../store-CiqLHedg.js');
|
|
36
|
+
|
|
37
|
+
exports.beforeExecute = require_commandkit.beforeExecute;
|
|
38
|
+
exports.middlewareId = require_commandkit.middlewareId;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { CommandRegistrar, PreRegisterCommandsEvent } from "../../analytics-engine-
|
|
1
|
+
import { CommandRegistrar, PreRegisterCommandsEvent } from "../../analytics-engine-Ddw9axi4.js";
|
|
2
2
|
import "../../EventInterceptor-x-R2qshQ.js";
|
|
3
3
|
import "../../ButtonKit-C7r7RPNf.js";
|
|
4
4
|
import "../../ModalKit-Btz58KYn.js";
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
require('../../colors-Cd4Oz-r-.js');
|
|
2
2
|
require('../../ActionRow-CmTHbo2t.js');
|
|
3
3
|
require('../../error-codes-C-ViHyu-.js');
|
|
4
|
-
const require_commandkit = require('../../commandkit-
|
|
4
|
+
const require_commandkit = require('../../commandkit-C0BuNRSN.js');
|
|
5
5
|
require('../../common-CcfjYnPG.js');
|
|
6
6
|
require('../../common-vnMIelAE.js');
|
|
7
7
|
require('../../container-z621KfH5.js');
|
|
@@ -27,7 +27,7 @@ require('../../EventWorkerContext-CSlD9rbx.js');
|
|
|
27
27
|
require('../../signals-DHdYrd-n.js');
|
|
28
28
|
require('../../constants-CUND8XkG.js');
|
|
29
29
|
require('../../MessageCommandParser-B_BEQ3p8.js');
|
|
30
|
-
require('../../CommandsRouter-
|
|
30
|
+
require('../../CommandsRouter-tMAivEfv.js');
|
|
31
31
|
require('../../EventsRouter-C_J0M3uO.js');
|
|
32
32
|
require('../../router-DHnFRADH.js');
|
|
33
33
|
require('../../common-DNADUU3_.js');
|