@nectar-js/nectar 0.1.0

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.
@@ -0,0 +1,2 @@
1
+ import { $ as InteractionContext, A as defineComponent, At as OptionChoice, B as PluginChange, C as ComponentOptions, Ct as ChannelOption, D as Routed, Dt as CommandType, E as ComponentRoutes, Et as CommandRouteMeta, F as NectarConfig, Ft as version, G as definePlugin, H as PluginCommandContext, I as defineConfig, J as ContextExtension, K as EventMeta, L as validateConfig, M as defineEvent, Mt as SimpleOption, N as defineMiddleware, Nt as StringOption, O as customId, Ot as IntegerOption, P as ConfigError, Pt as TopLevelMeta, Q as Extended, R as NectarPlugin, S as ComponentKindName, St as SelectKind, T as ComponentPath, Tt as CommandOption, U as PluginError, V as PluginCommand, W as PluginGraph, X as ErrorHandler, Y as Env, Z as EventContext, _ as requiredIntents, _t as LoggerOptions, a as SyncResult, at as RouteInfo, b as CommandRoutes, bt as CustomIdTooLongError, c as RegistrationError, ct as RejectReason, d as CommandDiff, dt as SignalEmitter, et as Logger, f as PolicyOptions, ft as SignalType, g as requireRoles, gt as LogSink, h as requirePermissions, ht as LogRecord, i as SyncOptions, it as Params, j as defineError, jt as OptionType, k as defineCommand, kt as NumberOption, l as RegistrationProblem, lt as Signal, m as guildOnly, mt as LogLevel, n as NectarServices, nt as MiddlewareExtension, o as UnsafeSyncError, ot as Trace, p as RoleOptions, pt as LogFields, q as EventMode, r as ScopeSync, rt as Next, s as syncCommands, st as InteractionMeta, t as NectarRoutes, tt as Middleware, u as Scope, ut as SignalData, v as CommandContext, vt as ParamValidator, w as ComponentParams, wt as CommandMeta, x as ComponentContext, xt as MAX_CUSTOM_ID_LENGTH, y as CommandPath, yt as StandardSchemaLike, z as PluginApp } from "./index-DGMxBsub.js";
2
+ export { type ChannelOption, type CommandContext, type CommandDiff, type CommandMeta, type CommandOption, type CommandPath, type CommandRouteMeta, type CommandRoutes, type CommandType, type ComponentContext, type ComponentKindName, type ComponentOptions, type ComponentParams, type ComponentPath, type ComponentRoutes, ConfigError, type ContextExtension, CustomIdTooLongError, type Env, type ErrorHandler, type EventContext, type EventMeta, type EventMode, type Extended, type IntegerOption, type InteractionContext, type InteractionMeta, type LogFields, type LogLevel, type LogRecord, type LogSink, type Logger, type LoggerOptions, MAX_CUSTOM_ID_LENGTH, type Middleware, type MiddlewareExtension, type NectarConfig, type NectarPlugin, NectarRoutes, NectarServices, type Next, type NumberOption, type OptionChoice, type OptionType, type ParamValidator, type Params, type PluginApp, type PluginChange, type PluginCommand, type PluginCommandContext, PluginError, type PluginGraph, type PolicyOptions, RegistrationError, type RegistrationProblem, type RejectReason, type RoleOptions, type RouteInfo, type Routed, type Scope, type ScopeSync, type SelectKind, type Signal, type SignalData, type SignalEmitter, type SignalType, type SimpleOption, type StandardSchemaLike, type StringOption, type SyncOptions, type SyncResult, type TopLevelMeta, type Trace, UnsafeSyncError, customId, defineCommand, defineComponent, defineConfig, defineError, defineEvent, defineMiddleware, definePlugin, guildOnly, requirePermissions, requireRoles, requiredIntents, syncCommands, validateConfig, version };
package/dist/index.js ADDED
@@ -0,0 +1,105 @@
1
+ import { C as MAX_CUSTOM_ID_LENGTH, S as CustomIdTooLongError, T as version, l as encodeComponentRoute, n as definePlugin, t as PluginError } from "./plugins-CGvM19v9.js";
2
+ import { l as defineConfig, n as syncCommands, o as requiredIntents, r as RegistrationError, s as ConfigError, t as UnsafeSyncError, u as validateConfig } from "./registration-CaE0QBT6.js";
3
+ import { MessageFlags } from "discord-api-types/v10";
4
+ //#region src/define.ts
5
+ /**
6
+ * The custom ID for a component route, ready for a discord.js builder.
7
+ *
8
+ * Typed against the generated route map: the path must exist and the parameters must match
9
+ * the dynamic segments. Throws when a value is missing or the ID would exceed Discord's limit.
10
+ */
11
+ function customId(route, ...args) {
12
+ return encodeComponentRoute(route, args[0] ?? {});
13
+ }
14
+ function defineCommand(route, handler) {
15
+ return routed("defineCommand", route, handler);
16
+ }
17
+ function defineComponent(route, handler, options = {}) {
18
+ const defined = routed("defineComponent", route, handler);
19
+ if (options.params !== void 0) Object.assign(defined, { params: options.params });
20
+ return defined;
21
+ }
22
+ function defineEvent(event, handler) {
23
+ return routed("defineEvent", event, handler);
24
+ }
25
+ /**
26
+ * `return next({ member })` types `member` onto every downstream context. Middleware that
27
+ * calls `next()` without returning it adds nothing; pass the extension type explicitly if
28
+ * you need both.
29
+ */
30
+ function defineMiddleware(middleware) {
31
+ if (typeof middleware !== "function") throw new TypeError(`defineMiddleware() expects a function, got ${typeof middleware}.`);
32
+ return middleware;
33
+ }
34
+ function defineError(handler) {
35
+ if (typeof handler !== "function") throw new TypeError(`defineError() expects a function, got ${typeof handler}.`);
36
+ return handler;
37
+ }
38
+ function routed(name, route, handler) {
39
+ if (typeof route !== "string" || route === "") throw new TypeError(`${name}() expects the route path as its first argument.`);
40
+ if (typeof handler !== "function") throw new TypeError(`${name}("${route}") expects a handler function, got ${typeof handler}.`);
41
+ return Object.assign(handler, { route });
42
+ }
43
+ //#endregion
44
+ //#region src/policy.ts
45
+ /** Passes only interactions that come from a guild. */
46
+ function guildOnly(options = {}) {
47
+ const message = options.message ?? "This only works in a server.";
48
+ return async (ctx, next) => {
49
+ if (!inGuild(ctx)) return deny(ctx, message);
50
+ return next();
51
+ };
52
+ }
53
+ /** Passes only when the invoking member has every listed permission in the current channel. */
54
+ function requirePermissions(permissions, options = {}) {
55
+ const message = options.message ?? "You do not have permission to do that.";
56
+ return async (ctx, next) => {
57
+ if (!inGuild(ctx)) return deny(ctx, message);
58
+ const held = ctx.interaction.memberPermissions;
59
+ if (held === null || held === void 0 || !held.has(permissions)) return deny(ctx, message);
60
+ return next();
61
+ };
62
+ }
63
+ /** Passes only when the invoking member holds the listed role IDs. */
64
+ function requireRoles(roles, options = {}) {
65
+ const wanted = typeof roles === "string" ? [roles] : [...roles];
66
+ const message = options.message ?? "You do not have the role for that.";
67
+ const mode = options.mode ?? "any";
68
+ return async (ctx, next) => {
69
+ if (!inGuild(ctx)) return deny(ctx, message);
70
+ const held = memberRoles(ctx.interaction);
71
+ if (!(mode === "all" ? wanted.every((r) => held.has(r)) : wanted.some((r) => held.has(r)))) return deny(ctx, message);
72
+ return next();
73
+ };
74
+ }
75
+ function inGuild(ctx) {
76
+ const i = ctx.interaction;
77
+ return typeof i.inGuild === "function" ? i.inGuild() : typeof i.guildId === "string";
78
+ }
79
+ /**
80
+ * Role IDs of the invoking member. discord.js gives a `GuildMember` with a role cache when the
81
+ * guild is cached and a raw API member with an ID array otherwise.
82
+ */
83
+ function memberRoles(interaction) {
84
+ const roles = interaction.member?.roles;
85
+ if (roles === void 0 || roles === null) return /* @__PURE__ */ new Set();
86
+ if (Array.isArray(roles)) return new Set(roles);
87
+ return new Set(roles.cache.keys());
88
+ }
89
+ /** Answers the user, when the interaction can still be answered, and ends the chain. */
90
+ async function deny(ctx, message) {
91
+ const i = ctx.interaction;
92
+ if (typeof i.respond === "function") {
93
+ if (!i.responded) await i.respond([]);
94
+ return;
95
+ }
96
+ if (typeof i.reply !== "function" || i.replied || i.deferred) return;
97
+ await i.reply({
98
+ content: message,
99
+ flags: MessageFlags.Ephemeral
100
+ });
101
+ }
102
+ //#endregion
103
+ export { ConfigError, CustomIdTooLongError, MAX_CUSTOM_ID_LENGTH, PluginError, RegistrationError, UnsafeSyncError, customId, defineCommand, defineComponent, defineConfig, defineError, defineEvent, defineMiddleware, definePlugin, guildOnly, requirePermissions, requireRoles, requiredIntents, syncCommands, validateConfig, version };
104
+
105
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","names":[],"sources":["../src/define.ts","../src/policy.ts"],"sourcesContent":["import type {\n ButtonInteraction,\n ChannelSelectMenuInteraction,\n ChatInputCommandInteraction,\n ClientEvents,\n MentionableSelectMenuInteraction,\n MessageContextMenuCommandInteraction,\n ModalSubmitInteraction,\n RoleSelectMenuInteraction,\n StringSelectMenuInteraction,\n UserContextMenuCommandInteraction,\n UserSelectMenuInteraction,\n} from \"discord.js\";\nimport type { CommandType, OptionType } from \"./commands/meta.js\";\nimport type { SelectKind } from \"./components/compile.js\";\nimport type { ParamValidator } from \"./components/params.js\";\nimport { encodeComponentRoute } from \"./components/registry.js\";\nimport type { NectarRoutes } from \"./index.js\";\nimport type {\n ContextExtension,\n ErrorHandler,\n EventContext,\n Extended,\n InteractionContext,\n Middleware,\n Next,\n Params,\n} from \"./runtime/types.js\";\n\ntype Empty = Record<never, never>;\n\n/** `NectarRoutes[K]` when the generated types declare it, otherwise `never`. */\ntype Declared<K extends string> = NectarRoutes extends Record<K, infer V> ? V : never;\ntype Fallback<T, F> = [T] extends [never] ? F : T;\n\nexport type ComponentKindName = \"button\" | \"modal\" | `select:${SelectKind}`;\n\nexport interface ComponentRouteType {\n kind: ComponentKindName;\n params: Params;\n context: object;\n}\n\nexport interface CommandRouteType {\n type: CommandType;\n options: Record<string, OptionType>;\n context: object;\n}\n\n/** Component routes by path. Until types are generated, any string is accepted. */\nexport type ComponentRoutes = Fallback<\n Declared<\"components\">,\n Record<string, { kind: ComponentKindName; params: Params; context: Empty }>\n>;\n\n/** Command routes by path. Until types are generated, any string is accepted. */\nexport type CommandRoutes = Fallback<\n Declared<\"commands\">,\n Record<string, { type: CommandType; options: Record<string, OptionType>; context: Empty }>\n>;\n\nexport type ComponentPath = keyof ComponentRoutes & string;\nexport type CommandPath = keyof CommandRoutes & string;\n\ntype Route<Routes, P extends string> = P extends keyof Routes ? Routes[P] : never;\n\ntype ComponentInteraction<K> = K extends \"button\"\n ? ButtonInteraction\n : K extends \"modal\"\n ? ModalSubmitInteraction\n : K extends \"select:string\"\n ? StringSelectMenuInteraction\n : K extends \"select:user\"\n ? UserSelectMenuInteraction\n : K extends \"select:role\"\n ? RoleSelectMenuInteraction\n : K extends \"select:channel\"\n ? ChannelSelectMenuInteraction\n : K extends \"select:mentionable\"\n ? MentionableSelectMenuInteraction\n : never;\n\ntype CommandInteraction<T> = T extends \"chatInput\"\n ? ChatInputCommandInteraction\n : T extends \"user\"\n ? UserContextMenuCommandInteraction\n : T extends \"message\"\n ? MessageContextMenuCommandInteraction\n : never;\n\ntype Field<R, K extends string, F> = R extends Record<K, infer V> ? V : F;\n\nexport type ComponentParams<P extends ComponentPath> = Field<\n Route<ComponentRoutes, P>,\n \"params\",\n Params\n>;\n\nexport type ComponentContext<P extends ComponentPath> = InteractionContext<\n ComponentInteraction<Field<Route<ComponentRoutes, P>, \"kind\", ComponentKindName>>,\n ComponentParams<P>\n> &\n Field<Route<ComponentRoutes, P>, \"context\", Empty>;\n\nexport type CommandContext<P extends CommandPath> = InteractionContext<\n CommandInteraction<Field<Route<CommandRoutes, P>, \"type\", CommandType>>,\n Empty\n> &\n Field<Route<CommandRoutes, P>, \"context\", Empty>;\n\n/** Every field is optional when the route has no parameters, so `customId(\"confirm\")` works. */\ntype ParamsArg<P extends ComponentPath> =\n Empty extends ComponentParams<P> ? [params?: ComponentParams<P>] : [params: ComponentParams<P>];\n\n/**\n * The custom ID for a component route, ready for a discord.js builder.\n *\n * Typed against the generated route map: the path must exist and the parameters must match\n * the dynamic segments. Throws when a value is missing or the ID would exceed Discord's limit.\n */\nexport function customId<P extends ComponentPath>(route: P, ...args: ParamsArg<P>): string {\n return encodeComponentRoute(route, (args[0] ?? {}) as Params);\n}\n\n/** A handler that remembers which route it was written for, so the compiler can check the file location. */\nexport type Routed<F> = F & { route: string };\n\nexport function defineCommand<P extends CommandPath>(\n route: P,\n handler: (ctx: CommandContext<P>) => unknown,\n): Routed<typeof handler> {\n return routed(\"defineCommand\", route, handler);\n}\n\nexport interface ComponentOptions<P extends ComponentPath> {\n /**\n * Validators for the route's parameters, run on every incoming custom ID before middleware.\n * A parameter without one accepts any string. When a validator fails the interaction is\n * dropped and reported; the handler never sees it.\n */\n params?: { [K in keyof ComponentParams<P>]?: ParamValidator<ComponentParams<P>[K]> };\n}\n\nexport function defineComponent<P extends ComponentPath>(\n route: P,\n handler: (ctx: ComponentContext<P>) => unknown,\n options: ComponentOptions<P> = {},\n): Routed<typeof handler> {\n const defined = routed(\"defineComponent\", route, handler);\n if (options.params !== undefined) Object.assign(defined, { params: options.params });\n return defined;\n}\n\nexport function defineEvent<Name extends keyof ClientEvents>(\n event: Name,\n handler: (...args: [...ClientEvents[Name], EventContext]) => unknown,\n): Routed<typeof handler> {\n return routed(\"defineEvent\", event, handler);\n}\n\n/**\n * `return next({ member })` types `member` onto every downstream context. Middleware that\n * calls `next()` without returning it adds nothing; pass the extension type explicitly if\n * you need both.\n */\nexport function defineMiddleware<E extends ContextExtension = Empty>(\n middleware: (\n ctx: InteractionContext,\n next: Next,\n // biome-ignore lint/suspicious/noConfusingVoidType: handlers that only call next() return void\n ) => Promise<Extended<E> | undefined | void> | Extended<E> | undefined | void,\n): Middleware<E> {\n if (typeof middleware !== \"function\") {\n throw new TypeError(`defineMiddleware() expects a function, got ${typeof middleware}.`);\n }\n return middleware as Middleware<E>;\n}\n\nexport function defineError(handler: ErrorHandler): ErrorHandler {\n if (typeof handler !== \"function\") {\n throw new TypeError(`defineError() expects a function, got ${typeof handler}.`);\n }\n return handler;\n}\n\nfunction routed<F>(name: string, route: string, handler: F): Routed<F> {\n if (typeof route !== \"string\" || route === \"\") {\n throw new TypeError(`${name}() expects the route path as its first argument.`);\n }\n if (typeof handler !== \"function\") {\n throw new TypeError(`${name}(\"${route}\") expects a handler function, got ${typeof handler}.`);\n }\n return Object.assign(handler, { route });\n}\n","import type { PermissionResolvable } from \"discord.js\";\nimport { MessageFlags } from \"discord-api-types/v10\";\nimport type { InteractionContext, Middleware } from \"./runtime/types.js\";\n\n/**\n * Opt-in policy middleware. Each returns a middleware that stops the chain and answers the\n * user with a short ephemeral message when the check fails. Registration-time permissions\n * (`meta.defaultMemberPermissions`) are a separate concept: Discord enforces those before the\n * interaction reaches the bot, and server admins can override them. These checks run in the\n * bot and cannot be overridden.\n *\n * Use them from a `middleware.ts`:\n *\n * export default requirePermissions(\"BanMembers\");\n *\n * Or compose them with your own middleware by calling them inside it.\n */\n\nexport interface PolicyOptions {\n /** What the user sees when the check fails. */\n message?: string;\n}\n\n/** Passes only interactions that come from a guild. */\nexport function guildOnly(options: PolicyOptions = {}): Middleware {\n const message = options.message ?? \"This only works in a server.\";\n return async (ctx, next) => {\n if (!inGuild(ctx)) return deny(ctx, message);\n return next();\n };\n}\n\n/** Passes only when the invoking member has every listed permission in the current channel. */\nexport function requirePermissions(\n permissions: PermissionResolvable,\n options: PolicyOptions = {},\n): Middleware {\n const message = options.message ?? \"You do not have permission to do that.\";\n return async (ctx, next) => {\n if (!inGuild(ctx)) return deny(ctx, message);\n const held = (ctx.interaction as GuildInteractionLike).memberPermissions;\n if (held === null || held === undefined || !held.has(permissions)) return deny(ctx, message);\n return next();\n };\n}\n\nexport interface RoleOptions extends PolicyOptions {\n /** `\"any\"` (default) passes with one matching role; `\"all\"` needs every listed role. */\n mode?: \"any\" | \"all\";\n}\n\n/** Passes only when the invoking member holds the listed role IDs. */\nexport function requireRoles(\n roles: string | readonly string[],\n options: RoleOptions = {},\n): Middleware {\n const wanted = typeof roles === \"string\" ? [roles] : [...roles];\n const message = options.message ?? \"You do not have the role for that.\";\n const mode = options.mode ?? \"any\";\n return async (ctx, next) => {\n if (!inGuild(ctx)) return deny(ctx, message);\n const held = memberRoles(ctx.interaction as GuildInteractionLike);\n const ok = mode === \"all\" ? wanted.every((r) => held.has(r)) : wanted.some((r) => held.has(r));\n if (!ok) return deny(ctx, message);\n return next();\n };\n}\n\nfunction inGuild(ctx: InteractionContext): boolean {\n const i = ctx.interaction as GuildInteractionLike;\n return typeof i.inGuild === \"function\" ? i.inGuild() : typeof i.guildId === \"string\";\n}\n\n/**\n * Role IDs of the invoking member. discord.js gives a `GuildMember` with a role cache when the\n * guild is cached and a raw API member with an ID array otherwise.\n */\nfunction memberRoles(interaction: GuildInteractionLike): Set<string> {\n const roles = interaction.member?.roles;\n if (roles === undefined || roles === null) return new Set();\n if (Array.isArray(roles)) return new Set(roles);\n return new Set((roles as { cache: Map<string, unknown> }).cache.keys());\n}\n\n/** Answers the user, when the interaction can still be answered, and ends the chain. */\nasync function deny(ctx: InteractionContext, message: string): Promise<void> {\n const i = ctx.interaction as RepliableLike;\n if (typeof i.respond === \"function\") {\n // Autocomplete cannot show a message. An empty list is the only quiet answer.\n if (!i.responded) await i.respond([]);\n return;\n }\n if (typeof i.reply !== \"function\" || i.replied || i.deferred) return;\n await i.reply({ content: message, flags: MessageFlags.Ephemeral });\n}\n\ninterface GuildInteractionLike {\n inGuild?: () => boolean;\n guildId?: string | null;\n memberPermissions?: { has(permission: PermissionResolvable): boolean } | null;\n member?: { roles: readonly string[] | { cache: Map<string, unknown> } } | null;\n}\n\ninterface RepliableLike {\n replied?: boolean;\n deferred?: boolean;\n responded?: boolean;\n reply?: (options: { content: string; flags: MessageFlags }) => Promise<unknown>;\n respond?: (choices: never[]) => Promise<unknown>;\n}\n"],"mappings":";;;;;;;;;;AAwHA,SAAgB,SAAkC,OAAU,GAAG,MAA4B;CACzF,OAAO,qBAAqB,OAAQ,KAAK,MAAM,CAAC,CAAY;AAC9D;AAKA,SAAgB,cACd,OACA,SACwB;CACxB,OAAO,OAAO,iBAAiB,OAAO,OAAO;AAC/C;AAWA,SAAgB,gBACd,OACA,SACA,UAA+B,CAAC,GACR;CACxB,MAAM,UAAU,OAAO,mBAAmB,OAAO,OAAO;CACxD,IAAI,QAAQ,WAAW,KAAA,GAAW,OAAO,OAAO,SAAS,EAAE,QAAQ,QAAQ,OAAO,CAAC;CACnF,OAAO;AACT;AAEA,SAAgB,YACd,OACA,SACwB;CACxB,OAAO,OAAO,eAAe,OAAO,OAAO;AAC7C;;;;;;AAOA,SAAgB,iBACd,YAKe;CACf,IAAI,OAAO,eAAe,YACxB,MAAM,IAAI,UAAU,8CAA8C,OAAO,WAAW,EAAE;CAExF,OAAO;AACT;AAEA,SAAgB,YAAY,SAAqC;CAC/D,IAAI,OAAO,YAAY,YACrB,MAAM,IAAI,UAAU,yCAAyC,OAAO,QAAQ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