@seedcord/core 0.5.0 → 0.6.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.
- package/dist/Bus-dGy6xq3F.mjs.map +1 -1
- package/dist/{Pluggable-CtMiOP3p.mjs → Pluggable-B7_EftHj.mjs} +31 -8
- package/dist/Pluggable-B7_EftHj.mjs.map +1 -0
- package/dist/{Pluggable-BKe2uCa0.d.mts → Pluggable-C5uxmDb-.d.mts} +10 -3
- package/dist/Plugin-BJfRk0s_.mjs.map +1 -1
- package/dist/{Plugin-iAaWcLaD.d.mts → Plugin-Bnz61fs_.d.mts} +8 -2
- package/dist/index.d.mts +12 -12
- package/dist/index.mjs +4 -4
- package/dist/index.mjs.map +1 -1
- package/dist/internal.index.d.mts +1 -1
- package/dist/node-internal.index.d.mts +8 -3
- package/dist/node-internal.index.mjs +15 -6
- package/dist/node-internal.index.mjs.map +1 -1
- package/dist/node.index.d.mts +1 -1
- package/dist/node.index.mjs +31 -10
- package/dist/node.index.mjs.map +1 -1
- package/dist/plugin.index.d.mts +1 -1
- package/package.json +14 -14
- package/dist/Pluggable-CtMiOP3p.mjs.map +0 -1
package/dist/index.d.mts
CHANGED
|
@@ -3,7 +3,7 @@ import { $ as MessageContextMenuRegistry, C as Gate, D as defineEffectGate, E as
|
|
|
3
3
|
import { t as Constructor } from "./basic-Dng__Ena.mjs";
|
|
4
4
|
import { a as Subscribe, i as WebhookFile, n as WebhookLog, o as SubscribeOptions, r as WebhookReport, t as WebhookUrl } from "./index-CD8l15aZ.mjs";
|
|
5
5
|
import "reflect-metadata";
|
|
6
|
-
import { AnyCustomId, CustomId, FieldOptions, setCustomIdErrors } from "@seedcord/custom-id";
|
|
6
|
+
import { AnyCustomId, AnyCustomId as AnyCustomId$1, CustomId, CustomIdField, CustomIdShape, DecodedParams, DecodedRoute, FieldOptions, decodeFor, prefixOf, setCustomIdErrors } from "@seedcord/custom-id";
|
|
7
7
|
import { ActionRowBuilder, ButtonBuilder } from "@discordjs/builders";
|
|
8
8
|
import { APIMessageComponentEmoji, APIModalInteractionResponseCallbackData, ApplicationCommandType, ButtonStyle } from "discord-api-types/v10";
|
|
9
9
|
import { Logger } from "@seedcord/logger";
|
|
@@ -83,12 +83,12 @@ type ComponentOf<TCtor extends AnyHandlerCtor> = InstanceType<TCtor> extends {
|
|
|
83
83
|
[ComponentKindBrand]?: infer Brand extends ComponentBrand;
|
|
84
84
|
} ? Brand : never;
|
|
85
85
|
type DefsOf<TCtor extends AnyHandlerCtor> = InstanceType<TCtor> extends {
|
|
86
|
-
[ComponentDefsBrand]?: infer Defs extends readonly AnyCustomId[];
|
|
86
|
+
[ComponentDefsBrand]?: infer Defs extends readonly AnyCustomId$1[];
|
|
87
87
|
} ? Defs : never;
|
|
88
88
|
type AssertSlashRoute<Route extends keyof SlashRegistry, TCtor extends AnyHandlerCtor> = [Route] extends [SlashRouteOf<TCtor>] ? [SlashRouteOf<TCtor>] extends [Route] ? TCtor : Constructor<['SlashHandler declares a route the SlashRoute decorator does not list', SlashRouteOf<TCtor>]> : Constructor<['SlashRoute does not match the SlashHandler generic', Route]>;
|
|
89
89
|
type AssertAutocompleteRoute<Route extends keyof SlashRegistry, TCtor extends AnyHandlerCtor> = [Route] extends [AutocompleteRouteOf<TCtor>] ? [AutocompleteRouteOf<TCtor>] extends [Route] ? TCtor : Constructor<['AutocompleteHandler declares a command the AutocompleteRoute decorator does not list', AutocompleteRouteOf<TCtor>]> : Constructor<['AutocompleteRoute does not match the AutocompleteHandler generic', Route]>;
|
|
90
90
|
type AssertContextMenuRoute<Kind extends ContextMenuKind, Names extends NamesFor<Kind>, TCtor extends AnyHandlerCtor> = [Kind] extends [ContextMenuKindOf<TCtor>] ? [ContextMenuKindOf<TCtor>] extends [Kind] ? [Names] extends [ContextMenuNamesOf<TCtor>] ? [ContextMenuNamesOf<TCtor>] extends [Names] ? TCtor : Constructor<['ContextMenuHandler declares a name the ContextMenuRoute decorator does not list', ContextMenuNamesOf<TCtor>]> : Constructor<['ContextMenuRoute lists a name the ContextMenuHandler generic does not declare', Names]> : Constructor<['ContextMenuHandler declares a kind the ContextMenuRoute decorator does not match', ContextMenuKindOf<TCtor>]> : Constructor<['ContextMenuRoute does not match the ContextMenuHandler generic', Kind]>;
|
|
91
|
-
type AssertComponentRoute<Brand extends ComponentBrand, Defs extends readonly AnyCustomId[], TCtor extends AnyHandlerCtor> = [ComponentOf<TCtor>] extends [Brand] ? [Brand] extends [ComponentOf<TCtor>] ? [DefsOf<TCtor>] extends [Defs] ? TCtor : Constructor<['the customId definitions do not match the handler generic', DefsOf<TCtor>]> : Constructor<['the decorator does not match the handler kind', ComponentOf<TCtor>]> : Constructor<['the decorator does not match the handler kind', ComponentOf<TCtor>]>;
|
|
91
|
+
type AssertComponentRoute<Brand extends ComponentBrand, Defs extends readonly AnyCustomId$1[], TCtor extends AnyHandlerCtor> = [ComponentOf<TCtor>] extends [Brand] ? [Brand] extends [ComponentOf<TCtor>] ? [DefsOf<TCtor>] extends [Defs] ? TCtor : Constructor<['the customId definitions do not match the handler generic', DefsOf<TCtor>]> : Constructor<['the decorator does not match the handler kind', ComponentOf<TCtor>]> : Constructor<['the decorator does not match the handler kind', ComponentOf<TCtor>]>;
|
|
92
92
|
/**
|
|
93
93
|
* Routes one or more slash commands to a `SlashHandler`.
|
|
94
94
|
*
|
|
@@ -179,7 +179,7 @@ declare function MessageContextMenuRoute<const Names extends NamesFor<Applicatio
|
|
|
179
179
|
* @param defs - The customId definition(s) this handler decodes, one per route.
|
|
180
180
|
* @decorator
|
|
181
181
|
*/
|
|
182
|
-
declare function ButtonRoute<const Defs extends readonly AnyCustomId[]>(...defs: Defs): <TCtor extends AnyHandlerCtor>(constructor: AssertComponentRoute<InteractionKind.Button, Defs, TCtor>) => void;
|
|
182
|
+
declare function ButtonRoute<const Defs extends readonly AnyCustomId$1[]>(...defs: Defs): <TCtor extends AnyHandlerCtor>(constructor: AssertComponentRoute<InteractionKind.Button, Defs, TCtor>) => void;
|
|
183
183
|
/**
|
|
184
184
|
* Routes modal submissions to handler classes.
|
|
185
185
|
*
|
|
@@ -190,7 +190,7 @@ declare function ButtonRoute<const Defs extends readonly AnyCustomId[]>(...defs:
|
|
|
190
190
|
* @param defs - The customId definition(s) this handler decodes, one per route.
|
|
191
191
|
* @decorator
|
|
192
192
|
*/
|
|
193
|
-
declare function ModalRoute<const Defs extends readonly AnyCustomId[]>(...defs: Defs): <TCtor extends AnyHandlerCtor>(constructor: AssertComponentRoute<InteractionKind.Modal, Defs, TCtor>) => void;
|
|
193
|
+
declare function ModalRoute<const Defs extends readonly AnyCustomId$1[]>(...defs: Defs): <TCtor extends AnyHandlerCtor>(constructor: AssertComponentRoute<InteractionKind.Modal, Defs, TCtor>) => void;
|
|
194
194
|
/**
|
|
195
195
|
* Routes string select menu interactions to a `StringMenuHandler`.
|
|
196
196
|
*
|
|
@@ -209,7 +209,7 @@ declare function ModalRoute<const Defs extends readonly AnyCustomId[]>(...defs:
|
|
|
209
209
|
* }
|
|
210
210
|
* ```
|
|
211
211
|
*/
|
|
212
|
-
declare function StringMenuRoute<const Defs extends readonly AnyCustomId[]>(...defs: Defs): <TCtor extends AnyHandlerCtor>(constructor: AssertComponentRoute<InteractionKind.StringMenu, Defs, TCtor>) => void;
|
|
212
|
+
declare function StringMenuRoute<const Defs extends readonly AnyCustomId$1[]>(...defs: Defs): <TCtor extends AnyHandlerCtor>(constructor: AssertComponentRoute<InteractionKind.StringMenu, Defs, TCtor>) => void;
|
|
213
213
|
/**
|
|
214
214
|
* Routes user select menu interactions to a `UserMenuHandler`.
|
|
215
215
|
*
|
|
@@ -230,7 +230,7 @@ declare function StringMenuRoute<const Defs extends readonly AnyCustomId[]>(...d
|
|
|
230
230
|
* }
|
|
231
231
|
* ```
|
|
232
232
|
*/
|
|
233
|
-
declare function UserMenuRoute<const Defs extends readonly AnyCustomId[]>(...defs: Defs): <TCtor extends AnyHandlerCtor>(constructor: AssertComponentRoute<InteractionKind.UserMenu, Defs, TCtor>) => void;
|
|
233
|
+
declare function UserMenuRoute<const Defs extends readonly AnyCustomId$1[]>(...defs: Defs): <TCtor extends AnyHandlerCtor>(constructor: AssertComponentRoute<InteractionKind.UserMenu, Defs, TCtor>) => void;
|
|
234
234
|
/**
|
|
235
235
|
* Routes role select menu interactions to a `RoleMenuHandler`.
|
|
236
236
|
*
|
|
@@ -249,7 +249,7 @@ declare function UserMenuRoute<const Defs extends readonly AnyCustomId[]>(...def
|
|
|
249
249
|
* }
|
|
250
250
|
* ```
|
|
251
251
|
*/
|
|
252
|
-
declare function RoleMenuRoute<const Defs extends readonly AnyCustomId[]>(...defs: Defs): <TCtor extends AnyHandlerCtor>(constructor: AssertComponentRoute<InteractionKind.RoleMenu, Defs, TCtor>) => void;
|
|
252
|
+
declare function RoleMenuRoute<const Defs extends readonly AnyCustomId$1[]>(...defs: Defs): <TCtor extends AnyHandlerCtor>(constructor: AssertComponentRoute<InteractionKind.RoleMenu, Defs, TCtor>) => void;
|
|
253
253
|
/**
|
|
254
254
|
* Routes channel select menu interactions to a `ChannelMenuHandler`.
|
|
255
255
|
*
|
|
@@ -268,7 +268,7 @@ declare function RoleMenuRoute<const Defs extends readonly AnyCustomId[]>(...def
|
|
|
268
268
|
* }
|
|
269
269
|
* ```
|
|
270
270
|
*/
|
|
271
|
-
declare function ChannelMenuRoute<const Defs extends readonly AnyCustomId[]>(...defs: Defs): <TCtor extends AnyHandlerCtor>(constructor: AssertComponentRoute<InteractionKind.ChannelMenu, Defs, TCtor>) => void;
|
|
271
|
+
declare function ChannelMenuRoute<const Defs extends readonly AnyCustomId$1[]>(...defs: Defs): <TCtor extends AnyHandlerCtor>(constructor: AssertComponentRoute<InteractionKind.ChannelMenu, Defs, TCtor>) => void;
|
|
272
272
|
/**
|
|
273
273
|
* Routes mentionable select menu interactions to a `MentionableMenuHandler`.
|
|
274
274
|
*
|
|
@@ -288,7 +288,7 @@ declare function ChannelMenuRoute<const Defs extends readonly AnyCustomId[]>(...
|
|
|
288
288
|
* }
|
|
289
289
|
* ```
|
|
290
290
|
*/
|
|
291
|
-
declare function MentionableMenuRoute<const Defs extends readonly AnyCustomId[]>(...defs: Defs): <TCtor extends AnyHandlerCtor>(constructor: AssertComponentRoute<InteractionKind.MentionableMenu, Defs, TCtor>) => void;
|
|
291
|
+
declare function MentionableMenuRoute<const Defs extends readonly AnyCustomId$1[]>(...defs: Defs): <TCtor extends AnyHandlerCtor>(constructor: AssertComponentRoute<InteractionKind.MentionableMenu, Defs, TCtor>) => void;
|
|
292
292
|
//#endregion
|
|
293
293
|
//#region src/dispatch/DispatchContext.d.ts
|
|
294
294
|
/**
|
|
@@ -860,7 +860,7 @@ interface PageView<Item> {
|
|
|
860
860
|
*/
|
|
861
861
|
declare function paginate<Item>(items: readonly Item[], page: number, perPage: number): PageView<Item>;
|
|
862
862
|
//#endregion
|
|
863
|
-
//#region src/pagination/
|
|
863
|
+
//#region src/pagination/Controls.d.ts
|
|
864
864
|
/** The five built-in nav controls. */
|
|
865
865
|
type ControlKey = 'first' | 'prev' | 'indicator' | 'next' | 'last';
|
|
866
866
|
type CustomIdStyle = ButtonStyle.Primary | ButtonStyle.Secondary | ButtonStyle.Success | ButtonStyle.Danger;
|
|
@@ -982,5 +982,5 @@ declare abstract class PaginatorBase<Item, Prefix extends string, Ctx> {
|
|
|
982
982
|
/** Package version */
|
|
983
983
|
declare const version: string;
|
|
984
984
|
//#endregion
|
|
985
|
-
export { ArraySourceBase, type AttemptedWrite, type AutocompleteOptions, AutocompleteRoute, BaseHandler, BaseReplySender, BuilderComponent, type BuilderType, Bus, ButtonRoute, ChannelMenuRoute, type CommandInfo, Commands, type ContextMenuInfo, ContextMenus, type ControlCosmetics, type ControlKey, Cooldown, type CooldownOptions, type CoreBase, CursorSourceBase, CustomId, DispatchContext, type DispatchOutcome, type DispatchState, DmOnly, type EffectGate, Fault, type FaultSource, type FieldOptions, type Gate, type GateContextBase, type GateNoticeOptions, GuildOnly, type GuildPermissionsContext, type InjectedCommandMap, type InjectedContextMenuMap, InteractionKind, type ItemRender, MentionableMenuRoute, type MessageContextMenuRegistry, MessageContextMenuRoute, type ModalLike, ModalRoute, Notice, OwnerOnly, type PageRender, type PageSourceBase, type PageView, PaginatorBase, type PaginatorConfig, type PaginatorControls, type PermissionAssertion, type PermissionNoticeOverrides, type PermissionScope, RegisterCommand, RepliableHandler, RequireBotPermissions, RequirePermissions, type RequirePermissionsOptions, RequireRole, type RequireRoleOptions, type RequiredOf, ResolvedEmoji, type ResponseAttempt, type ResponseFailed, type ResponseOutcome, type ResponseSent, RoleMenuRoute, RowComponent, type RowType, ShutdownPhase, Silence, type SlashRegistry, SlashRoute, StartupPhase, StringMenuRoute, Subscribe, type SubscribeOptions, Subscriber, type SubscriptionData, type SubscriptionKey, type Subscriptions, type UserContextMenuRegistry, UserContextMenuRoute, UserMenuRoute, type WebhookFile, WebhookLog, type WebhookReport, WebhookUrl, and, assertPermissions, defineEffectGate, defineGate, mergeRoles, or, paginate, setCustomIdErrors, version };
|
|
985
|
+
export { type AnyCustomId, ArraySourceBase, type AttemptedWrite, type AutocompleteOptions, AutocompleteRoute, BaseHandler, BaseReplySender, BuilderComponent, type BuilderType, Bus, ButtonRoute, ChannelMenuRoute, type CommandInfo, Commands, type ContextMenuInfo, ContextMenus, type ControlCosmetics, type ControlKey, Cooldown, type CooldownOptions, type CoreBase, CursorSourceBase, CustomId, type CustomIdField, type CustomIdShape, type DecodedParams, type DecodedRoute, DispatchContext, type DispatchOutcome, type DispatchState, DmOnly, type EffectGate, Fault, type FaultSource, type FieldOptions, type Gate, type GateContextBase, type GateNoticeOptions, GuildOnly, type GuildPermissionsContext, type InjectedCommandMap, type InjectedContextMenuMap, InteractionKind, type ItemRender, MentionableMenuRoute, type MessageContextMenuRegistry, MessageContextMenuRoute, type ModalLike, ModalRoute, Notice, OwnerOnly, type PageRender, type PageSourceBase, type PageView, PaginatorBase, type PaginatorConfig, type PaginatorControls, type PermissionAssertion, type PermissionNoticeOverrides, type PermissionScope, RegisterCommand, RepliableHandler, RequireBotPermissions, RequirePermissions, type RequirePermissionsOptions, RequireRole, type RequireRoleOptions, type RequiredOf, ResolvedEmoji, type ResponseAttempt, type ResponseFailed, type ResponseOutcome, type ResponseSent, RoleMenuRoute, RowComponent, type RowType, ShutdownPhase, Silence, type SlashRegistry, SlashRoute, StartupPhase, StringMenuRoute, Subscribe, type SubscribeOptions, Subscriber, type SubscriptionData, type SubscriptionKey, type Subscriptions, type UserContextMenuRegistry, UserContextMenuRoute, UserMenuRoute, type WebhookFile, WebhookLog, type WebhookReport, WebhookUrl, and, assertPermissions, decodeFor, defineEffectGate, defineGate, mergeRoles, or, paginate, prefixOf, setCustomIdErrors, version };
|
|
986
986
|
//# sourceMappingURL=index.d.mts.map
|
package/dist/index.mjs
CHANGED
|
@@ -3,7 +3,7 @@ import { A as RowComponent, d as WebhookLog, f as Subscriber, g as CommandMetada
|
|
|
3
3
|
import { n as Commands, r as ContextMenus } from "./subscribers-A8lNU5yM.mjs";
|
|
4
4
|
import { n as StartupPhase, t as ShutdownPhase } from "./phases-BauKJOTT.mjs";
|
|
5
5
|
import "reflect-metadata";
|
|
6
|
-
import { CustomId, setCustomIdErrors, setCustomIdErrors as setCustomIdErrors$1 } from "@seedcord/custom-id";
|
|
6
|
+
import { CustomId, decodeFor, prefixOf, setCustomIdErrors, setCustomIdErrors as setCustomIdErrors$1 } from "@seedcord/custom-id";
|
|
7
7
|
import { ActionRowBuilder, ButtonBuilder, TextDisplayBuilder } from "@discordjs/builders";
|
|
8
8
|
import { ApplicationCommandType, ButtonStyle } from "discord-api-types/v10";
|
|
9
9
|
import { SeedcordErrorCode } from "@seedcord/errors";
|
|
@@ -972,7 +972,7 @@ function paginate(items, page, perPage) {
|
|
|
972
972
|
}
|
|
973
973
|
|
|
974
974
|
//#endregion
|
|
975
|
-
//#region src/pagination/
|
|
975
|
+
//#region src/pagination/Controls.ts
|
|
976
976
|
const DEFAULT_LABEL = {
|
|
977
977
|
first: "First",
|
|
978
978
|
prev: "Prev",
|
|
@@ -1177,8 +1177,8 @@ var CursorSourceBase = class {
|
|
|
1177
1177
|
//#endregion
|
|
1178
1178
|
//#region src/index.ts
|
|
1179
1179
|
/** Package version */
|
|
1180
|
-
const version = "0.
|
|
1180
|
+
const version = "0.6.0";
|
|
1181
1181
|
|
|
1182
1182
|
//#endregion
|
|
1183
|
-
export { ArraySourceBase, AutocompleteRoute, BaseHandler, BaseReplySender, BuilderComponent, Bus, ButtonRoute, ChannelMenuRoute, Commands, ContextMenus, Cooldown, CursorSourceBase, CustomId, DispatchContext, DmOnly, Fault, GuildOnly, InteractionKind, MentionableMenuRoute, MessageContextMenuRoute, ModalRoute, Notice, OwnerOnly, PaginatorBase, RegisterCommand, RepliableHandler, RequireBotPermissions, RequirePermissions, RequireRole, ResolvedEmoji, RoleMenuRoute, RowComponent, ShutdownPhase, Silence, SlashRoute, StartupPhase, StringMenuRoute, Subscribe, Subscriber, UserContextMenuRoute, UserMenuRoute, WebhookLog, WebhookUrl, and, assertPermissions, defineEffectGate, defineGate, mergeRoles, or, paginate, setCustomIdErrors, version };
|
|
1183
|
+
export { ArraySourceBase, AutocompleteRoute, BaseHandler, BaseReplySender, BuilderComponent, Bus, ButtonRoute, ChannelMenuRoute, Commands, ContextMenus, Cooldown, CursorSourceBase, CustomId, DispatchContext, DmOnly, Fault, GuildOnly, InteractionKind, MentionableMenuRoute, MessageContextMenuRoute, ModalRoute, Notice, OwnerOnly, PaginatorBase, RegisterCommand, RepliableHandler, RequireBotPermissions, RequirePermissions, RequireRole, ResolvedEmoji, RoleMenuRoute, RowComponent, ShutdownPhase, Silence, SlashRoute, StartupPhase, StringMenuRoute, Subscribe, Subscriber, UserContextMenuRoute, UserMenuRoute, WebhookLog, WebhookUrl, and, assertPermissions, decodeFor, defineEffectGate, defineGate, mergeRoles, or, paginate, prefixOf, setCustomIdErrors, version };
|
|
1184
1184
|
//# sourceMappingURL=index.mjs.map
|