@reciple/modules 10.0.43 → 10.0.45
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/classes/InteractionListener.d.mts +1 -2
- package/dist/classes/InteractionListener.mjs +1 -2
- package/dist/classes/builders/InteractionListenerBuilder.d.mts +1 -2
- package/dist/classes/builders/InteractionListenerBuilder.mjs +1 -2
- package/dist/classes/modules/RecipleAnticrash.d.mts +1 -2
- package/dist/classes/modules/RecipleAnticrash.mjs +1 -2
- package/dist/classes/modules/RecipleInteractionEvents.d.mts +1 -2
- package/dist/classes/modules/RecipleInteractionEvents.mjs +1 -2
- package/dist/classes/modules/RecipleRegistryCache.d.mts +1 -2
- package/dist/classes/modules/RecipleRegistryCache.mjs +1 -2
- package/dist/helpers/constants.d.mts +1 -2
- package/dist/helpers/constants.mjs +1 -2
- package/dist/helpers/types.d.mts +1 -2
- package/package.json +2 -2
- package/dist/classes/InteractionListener.mjs.map +0 -1
- package/dist/classes/builders/InteractionListenerBuilder.mjs.map +0 -1
- package/dist/classes/modules/RecipleAnticrash.mjs.map +0 -1
- package/dist/classes/modules/RecipleInteractionEvents.mjs.map +0 -1
- package/dist/classes/modules/RecipleRegistryCache.mjs.map +0 -1
- package/dist/helpers/constants.mjs.map +0 -1
|
@@ -18,5 +18,4 @@ declare namespace InteractionListener {
|
|
|
18
18
|
type Resolvable<T extends InteractionListenerType> = InteractionListener<T> | InteractionListenerData<T> | JSONEncodable<InteractionListenerData<T>>;
|
|
19
19
|
}
|
|
20
20
|
//#endregion
|
|
21
|
-
export { InteractionListener };
|
|
22
|
-
//# sourceMappingURL=InteractionListener.d.mts.map
|
|
21
|
+
export { InteractionListener };
|
|
@@ -12,5 +12,4 @@ declare class InteractionListenerBuilder<T extends InteractionListenerType> {
|
|
|
12
12
|
toJSON(): InteractionListenerData<T>;
|
|
13
13
|
}
|
|
14
14
|
//#endregion
|
|
15
|
-
export { InteractionListenerBuilder };
|
|
16
|
-
//# sourceMappingURL=InteractionListenerBuilder.d.mts.map
|
|
15
|
+
export { InteractionListenerBuilder };
|
|
@@ -31,5 +31,4 @@ declare namespace RecipleInteractionEvents {
|
|
|
31
31
|
function getInteractionTypeFromInteraction(interaction: Interaction): InteractionListenerType;
|
|
32
32
|
}
|
|
33
33
|
//#endregion
|
|
34
|
-
export { RecipleInteractionEvents };
|
|
35
|
-
//# sourceMappingURL=RecipleInteractionEvents.d.mts.map
|
|
34
|
+
export { RecipleInteractionEvents };
|
|
@@ -78,5 +78,4 @@ var RecipleInteractionEvents = class RecipleInteractionEvents extends ClientEven
|
|
|
78
78
|
})(RecipleInteractionEvents || (RecipleInteractionEvents = {}));
|
|
79
79
|
|
|
80
80
|
//#endregion
|
|
81
|
-
export { RecipleInteractionEvents };
|
|
82
|
-
//# sourceMappingURL=RecipleInteractionEvents.mjs.map
|
|
81
|
+
export { RecipleInteractionEvents };
|
|
@@ -146,5 +146,4 @@ var RecipleRegistryCache = class RecipleRegistryCache extends BaseModule {
|
|
|
146
146
|
})(RecipleRegistryCache || (RecipleRegistryCache = {}));
|
|
147
147
|
|
|
148
148
|
//#endregion
|
|
149
|
-
export { RecipleRegistryCache };
|
|
150
|
-
//# sourceMappingURL=RecipleRegistryCache.mjs.map
|
|
149
|
+
export { RecipleRegistryCache };
|
package/dist/helpers/types.d.mts
CHANGED
|
@@ -13,5 +13,4 @@ type AnyComponentInteraction = ButtonInteraction | ModalSubmitInteraction | AnyS
|
|
|
13
13
|
type InteractionFromListenerType<T extends InteractionListenerType> = T extends InteractionListenerType.Autocomplete ? AutocompleteInteraction : T extends InteractionListenerType.ChatInput ? ChatInputCommandInteraction : T extends InteractionListenerType.ContextMenu ? ContextMenuCommandInteraction : T extends InteractionListenerType.Button ? ButtonInteraction : T extends InteractionListenerType.ModalSubmit ? ModalSubmitInteraction : T extends InteractionListenerType.SelectMenu ? AnySelectMenuInteraction : T extends InteractionListenerType.PrimaryEntryPoint ? PrimaryEntryPointCommandInteraction : Interaction;
|
|
14
14
|
type ListenerTypeFromInteraction<T extends InteractionFromListenerType<InteractionListenerType>> = T extends AutocompleteInteraction ? InteractionListenerType.Autocomplete : T extends ChatInputCommandInteraction ? InteractionListenerType.ChatInput : T extends ContextMenuCommandInteraction ? InteractionListenerType.ContextMenu : T extends ButtonInteraction ? InteractionListenerType.Button : T extends ModalSubmitInteraction ? InteractionListenerType.ModalSubmit : T extends AnySelectMenuInteraction ? InteractionListenerType.SelectMenu : T extends PrimaryEntryPointCommandInteraction ? InteractionListenerType.PrimaryEntryPoint : InteractionListenerType;
|
|
15
15
|
//#endregion
|
|
16
|
-
export { AnyCommandInteraction, AnyComponentInteraction, InteractionFromListenerType, InteractionListenerData, ListenerTypeFromInteraction };
|
|
17
|
-
//# sourceMappingURL=types.d.mts.map
|
|
16
|
+
export { AnyCommandInteraction, AnyComponentInteraction, InteractionFromListenerType, InteractionListenerData, ListenerTypeFromInteraction };
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@reciple/modules",
|
|
3
|
-
"version": "10.0.
|
|
3
|
+
"version": "10.0.45",
|
|
4
4
|
"license": "LGPL-3.0-only",
|
|
5
5
|
"description": "A collection of useful modules for reciple",
|
|
6
6
|
"module": "./dist/index.mjs",
|
|
@@ -30,7 +30,7 @@
|
|
|
30
30
|
},
|
|
31
31
|
"peerDependencies": {
|
|
32
32
|
"discord.js": "^14.25.1",
|
|
33
|
-
"reciple": "^10.0.
|
|
33
|
+
"reciple": "^10.0.43"
|
|
34
34
|
},
|
|
35
35
|
"peerDependenciesMeta": {
|
|
36
36
|
"discord.js": {
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"InteractionListener.mjs","names":[],"sources":["../../src/classes/InteractionListener.ts"],"sourcesContent":["import { isJSONEncodable, type JSONEncodable } from 'discord.js';\nimport type { InteractionListenerType } from '../helpers/constants.js';\nimport type { InteractionListenerData, InteractionFromListenerType } from '../helpers/types.js';\nimport { DiscordSnowflake } from '@sapphire/snowflake';\n\nexport class InteractionListener<T extends InteractionListenerType> implements InteractionListenerData<T> {\n public readonly id: string = DiscordSnowflake.generate().toString();\n public readonly moduleId?: string;\n public readonly type!: T;\n public readonly once?: boolean;\n\n constructor(data: InteractionListener.Resolvable<T>) {\n Object.assign(this, isJSONEncodable(data) ? data.toJSON() : data);\n }\n\n public filter(interaction: InteractionFromListenerType<T>): boolean {\n return true;\n }\n\n public execute(interaction: InteractionFromListenerType<T>): Promise<void> {\n return Promise.resolve();\n }\n\n public toJSON(): InteractionListenerData<T> {\n return {\n type: this.type,\n once: this.once,\n filter: this.filter,\n execute: this.execute\n };\n }\n\n public static from<T extends InteractionListenerType>(data: InteractionListener.Resolvable<T>): InteractionListener<T> {\n return data instanceof InteractionListener ? data : new InteractionListener(data);\n }\n}\n\nexport namespace InteractionListener {\n export type Resolvable<T extends InteractionListenerType> = InteractionListener<T>|InteractionListenerData<T>|JSONEncodable<InteractionListenerData<T>>;\n}\n"],"mappings":";;;;AAKA,IAAa,sBAAb,MAAa,oBAA6F;CACtG,AAAgB,KAAa,iBAAiB,UAAU,CAAC,UAAU;CACnE,AAAgB;CAChB,AAAgB;CAChB,AAAgB;CAEhB,YAAY,MAAyC;AACjD,SAAO,OAAO,MAAM,gBAAgB,KAAK,GAAG,KAAK,QAAQ,GAAG,KAAK;;CAGrE,AAAO,OAAO,aAAsD;AAChE,SAAO;;CAGX,AAAO,QAAQ,aAA4D;AACvE,SAAO,QAAQ,SAAS;;CAG5B,AAAO,SAAqC;AACxC,SAAO;GACH,MAAM,KAAK;GACX,MAAM,KAAK;GACX,QAAQ,KAAK;GACb,SAAS,KAAK;GACjB;;CAGL,OAAc,KAAwC,MAAiE;AACnH,SAAO,gBAAgB,sBAAsB,OAAO,IAAI,oBAAoB,KAAK"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"InteractionListenerBuilder.mjs","names":[],"sources":["../../../src/classes/builders/InteractionListenerBuilder.ts"],"sourcesContent":["import { InteractionListenerType } from '../../helpers/constants.js';\nimport type { InteractionListenerData } from '../../helpers/types.js';\n\nexport class InteractionListenerBuilder<T extends InteractionListenerType> {\n public readonly data: Partial<InteractionListenerData<T>> = {};\n\n public constructor(data?: Partial<InteractionListenerData<T>>) {\n if (data) this.data = data;\n }\n\n public setType<Type extends T>(type: Type): InteractionListenerBuilder<Type> {\n this.data.type = type;\n return this as any;\n }\n\n public setOnce(once: boolean): this {\n this.data.once = once;\n return this;\n }\n\n public setFilter(filter: InteractionListenerData<T>['filter']): this {\n this.data.filter = filter;\n return this;\n }\n\n public setExecute(execute: InteractionListenerData<T>['execute']): this {\n this.data.execute = execute;\n return this;\n }\n\n public toJSON(): InteractionListenerData<T> {\n return this.data as InteractionListenerData<T>;\n }\n}\n"],"mappings":";AAGA,IAAa,6BAAb,MAA2E;CACvE,AAAgB,OAA4C,EAAE;CAE9D,AAAO,YAAY,MAA4C;AAC3D,MAAI,KAAM,MAAK,OAAO;;CAG1B,AAAO,QAAwB,MAA8C;AACzE,OAAK,KAAK,OAAO;AACjB,SAAO;;CAGX,AAAO,QAAQ,MAAqB;AAChC,OAAK,KAAK,OAAO;AACjB,SAAO;;CAGX,AAAO,UAAU,QAAoD;AACjE,OAAK,KAAK,SAAS;AACnB,SAAO;;CAGX,AAAO,WAAW,SAAsD;AACpE,OAAK,KAAK,UAAU;AACpB,SAAO;;CAGX,AAAO,SAAqC;AACxC,SAAO,KAAK"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"RecipleAnticrash.mjs","names":[],"sources":["../../../src/classes/modules/RecipleAnticrash.ts"],"sourcesContent":["import { AttachmentBuilder, BaseChannel, codeBlock, Colors, EmbedBuilder, escapeCodeBlock, type Awaitable, type BaseMessageOptions as DJSBaseMessageOptions, type Message, type SendableChannels } from 'discord.js';\nimport { inspect } from 'node:util';\nimport { BaseModule } from 'reciple';\n\nexport class RecipleAnticrash extends BaseModule implements RecipleAnticrash.Options {\n public readonly id: string = 'org.reciple.js.anticrash';\n\n public baseReportMessageOptions?: RecipleAnticrash.Options['baseReportMessageOptions'];\n public reportChannels: string[] = [];\n\n private readonly logger = useLogger().clone({ label: 'Anticrash' });\n\n constructor(options?: RecipleAnticrash.Options) {\n super();\n\n Object.assign(this, options ?? {});\n\n this._captureErrorEvent = this._captureErrorEvent.bind(this);\n }\n\n public async onEnable(data: BaseModule.EventData<boolean>): Promise<void> {\n this.client.on('error', this._captureErrorEvent);\n this.client.on('shardError', this._captureErrorEvent);\n process.on('uncaughtException', this._captureErrorEvent);\n process.on('uncaughtExceptionMonitor', this._captureErrorEvent);\n process.on('unhandledRejection', this._captureErrorEvent);\n }\n\n public async onReady(data: BaseModule.EventData<true>): Promise<void> {}\n\n public async onDisable(data: BaseModule.EventData<boolean>): Promise<void> {\n this.client.off('error', this._captureErrorEvent);\n this.client.off('shardError', this._captureErrorEvent);\n process.off('uncaughtException', this._captureErrorEvent);\n process.off('uncaughtExceptionMonitor', this._captureErrorEvent);\n process.off('unhandledRejection', this._captureErrorEvent);\n }\n\n public async report(reason: any): Promise<RecipleAnticrash.Report[]> {\n const reports: RecipleAnticrash.Report[] = [];\n const stack = inspect(reason, { colors: false });\n\n this.logger.err(reason);\n\n for (const channelId of this.reportChannels) {\n const channel = await this.resolveChannel(channelId);\n if (!channel) continue;\n\n const message = await channel.send(await this.createReportMessageOptions(reason, stack)).catch(() => null);\n if (message) reports.push({ message, stackTrace: stack, timestamp: message.createdTimestamp });\n }\n\n return reports;\n }\n\n public async createReportMessageOptions(reason: any, stack: string): Promise<DJSBaseMessageOptions> {\n const base = typeof this.baseReportMessageOptions === 'function'\n ? await Promise.resolve(this.baseReportMessageOptions(reason)).catch(() => null)\n : this.baseReportMessageOptions ?? {};\n\n const embed = new EmbedBuilder()\n .setAuthor({ name: `Anticrash report` })\n .setTitle(String(reason).substring(0, 100))\n .setColor(Colors.Red)\n .setTimestamp();\n\n let files: Exclude<DJSBaseMessageOptions['files'], undefined>[0][] = [...(base?.files ?? [])];\n\n if (stack.length < 1950) {\n embed.setDescription(codeBlock(escapeCodeBlock(stack)))\n } else {\n const file = new AttachmentBuilder(Buffer.from(stack, 'utf-8'), { name: 'report.log' });\n\n if (base?.replaceFiles) {\n files = [file];\n } else if (base?.replaceFiles === undefined || base?.replaceFiles === 'merge') {\n files.push(file);\n }\n }\n\n return {\n ...base,\n embeds: base?.replaceEmbeds\n ? [embed]\n : base?.replaceEmbeds === undefined || base?.replaceEmbeds === 'merge'\n ? [...(base?.embeds ?? []), embed]\n : base.embeds,\n files\n };\n }\n\n public async resolveChannel(resolvable: Exclude<RecipleAnticrash.Options['reportChannels'], undefined>[0]): Promise<SendableChannels|null> {\n if (resolvable instanceof BaseChannel) return resolvable;\n if (typeof resolvable === 'function') return Promise.resolve(resolvable()).catch(() => null);\n\n const id = typeof resolvable === 'string' ? resolvable : resolvable.id;\n const channel = await this.client.channels.fetch(id).catch(() => null);\n\n if (channel) {\n return channel.isSendable() ? channel : null;\n }\n\n const userDm = await this.client.users.fetch(id).catch(() => null);\n\n return userDm?.dmChannel ?? null;\n }\n\n private async _captureErrorEvent(...args: any[]): Promise<void> {\n if (args[0]) await this.report(args[0]);\n }\n}\n\nexport namespace RecipleAnticrash {\n export interface Options {\n baseReportMessageOptions?: BaseMessageOptions|((reason: any) => Awaitable<BaseMessageOptions>);\n reportChannels?: (string|{ id: string; }|SendableChannels|(() => Awaitable<SendableChannels>))[];\n }\n\n export interface Report {\n message?: Message;\n stackTrace: string;\n timestamp: number;\n }\n\n export interface BaseMessageOptions extends DJSBaseMessageOptions {\n replaceEmbeds?: 'merge'|boolean;\n replaceFiles?: 'merge'|boolean;\n }\n}\n"],"mappings":";;;;;AAIA,IAAa,mBAAb,cAAsC,WAA+C;CACjF,AAAgB,KAAa;CAE7B,AAAO;CACP,AAAO,iBAA2B,EAAE;CAEpC,AAAiB,SAAS,WAAW,CAAC,MAAM,EAAE,OAAO,aAAa,CAAC;CAEnE,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names":[],"sources":["../../../src/classes/modules/RecipleInteractionEvents.ts"],"sourcesContent":["import { type Interaction, type CacheType, type Awaitable, Collection } from 'discord.js';\nimport { ClientEventModule, type AnyModule } from 'reciple';\nimport { InteractionListener } from '../InteractionListener.js';\nimport { InteractionListenerType } from '../../helpers/constants.js';\n\nexport class RecipleInteractionEvents extends ClientEventModule<'interactionCreate'> implements RecipleInteractionEvents.Options {\n public readonly id: string = 'org.reciple.js.interaction-events';\n\n public event = 'interactionCreate' as const;\n public moduleEventListenersProperty: string|string[] = 'interactions';\n public ignoredModules?: (module: AnyModule) => Awaitable<boolean>;\n public listeners: Collection<string, InteractionListener<InteractionListenerType>> = new Collection();\n\n private readonly logger = useLogger().clone({ label: 'InteractionEvents' });\n\n constructor(options: RecipleInteractionEvents.Options = {}) {\n super();\n\n Object.assign(this, options);\n }\n\n public async onReady(): Promise<void> {\n this.client.modules.on('readyModules', async (modules: AnyModule[]) => {\n this.logger.debug(`Resolving listeners for ready modules...`);\n\n for (const listener of await this.resolveListeners(modules)) {\n this.listeners.set(listener.id, listener);\n }\n });\n\n this.client.modules.on('disabledModules', async (modules: AnyModule[]) => {\n this.logger.debug(`Sweeping listeners for disabled modules...`);\n\n for (const module of modules) {\n this.listeners.sweep(listener => listener.moduleId === module.id)\n }\n });\n }\n\n public async onEvent(interaction: Interaction<CacheType>): Promise<void> {\n const type = RecipleInteractionEvents.getInteractionTypeFromInteraction(interaction);\n const listeners = this.listeners.filter(listener => listener.type === type);\n\n this.logger.debug(`Triggered (${listeners.size}) listeners for interaction type \"${InteractionListenerType[type]}\".`);\n\n for (const [id, listener] of listeners) {\n if (!await Promise.resolve(listener.filter(interaction))) continue;\n\n await Promise.resolve(listener.execute(interaction));\n\n if (listener.once) {\n this.logger.debug(`Removed listener \"${id}\" for interaction type \"${InteractionListenerType[type]}\".`);\n this.listeners.delete(id);\n }\n }\n }\n\n public async resolveListeners(customModules?: AnyModule[]) {\n this.logger.debug(`Resolving listeners from (${customModules?.length ?? this.client.modules.cache.size}) modules...`);\n\n const modules = (customModules ?? this.client.modules.cache.map(m => m)) as RecipleInteractionEvents.ListenerModule<string, InteractionListenerType>[];\n const listenersProperty = Array.isArray(this.moduleEventListenersProperty) ? this.moduleEventListenersProperty : [this.moduleEventListenersProperty];\n const listeners: InteractionListener<InteractionListenerType>[] = [];\n\n for (const module of modules) {\n if (module.id === this.id) continue;\n\n this.logger.debug(`Resolving listeners from module \"${module.id}\"...`);\n\n propertyLoop: for (const listenerProperty of listenersProperty) {\n if (!(listenerProperty in module)) continue propertyLoop;\n if (!Array.isArray(module[listenerProperty]) || !module[listenerProperty].length) continue;\n if (typeof this.ignoredModules === 'function' && await Promise.resolve(this.ignoredModules(module))) continue;\n\n const moduleListeners = module[listenerProperty];\n\n this.logger.debug(`Resolving listeners from module \"${module.id}\" with property \"${listenerProperty}\"...`);\n\n for (const data of moduleListeners) {\n const listener = InteractionListener.from(data);\n\n Reflect.set(listener, 'moduleId', module.id);\n listeners.push(listener);\n }\n\n this.logger.debug(`Resolved (${moduleListeners.length}) listeners from module \"${module.id}\" with property \"${listenerProperty}\".`);\n }\n }\n\n return listeners;\n }\n}\n\nexport namespace RecipleInteractionEvents {\n export interface Options {\n /**\n * The property that is scanned from modules to get interaction listeners.\n */\n moduleEventListenersProperty?: string|string[];\n /**\n * Filter modules that should be ignored.\n */\n ignoredModules?: (module: AnyModule) => Awaitable<boolean>;\n }\n\n export type ListenerModule<P extends string, T extends InteractionListenerType> = AnyModule & Record<P, InteractionListener.Resolvable<T>[]>;\n\n export function getInteractionTypeFromInteraction(interaction: Interaction): InteractionListenerType {\n if (interaction.isAutocomplete()) {\n return InteractionListenerType.Autocomplete;\n } else if (interaction.isChatInputCommand()) {\n return InteractionListenerType.ChatInput;\n } else if (interaction.isContextMenuCommand()) {\n return InteractionListenerType.ContextMenu;\n } else if (interaction.isModalSubmit()) {\n return InteractionListenerType.ModalSubmit;\n } else if (interaction.isButton()) {\n return InteractionListenerType.Button;\n } else if (interaction.isAnySelectMenu()) {\n return InteractionListenerType.SelectMenu;\n } else if (interaction.isPrimaryEntryPointCommand()) {\n return InteractionListenerType.PrimaryEntryPoint;\n }\n\n throw new Error(`Unknown interaction type.`);\n }\n}\n"],"mappings":";;;;;;AAKA,IAAa,2BAAb,MAAa,iCAAiC,kBAAmF;CAC7H,AAAgB,KAAa;CAE7B,AAAO,QAAQ;CACf,AAAO,+BAAgD;CACvD,AAAO;CACP,AAAO,YAA8E,IAAI,YAAY;CAErG,AAAiB,SAAS,WAAW,CAAC,MAAM,EAAE,OAAO,qBAAqB,CAAC;CAE3E,YAAY,UAA4C,EAAE,EAAE;AACxD,SAAO;AAEP,SAAO,OAAO,MAAM,QAAQ;;CAGhC,MAAa,UAAyB;AAClC,OAAK,OAAO,QAAQ,GAAG,gBAAgB,OAAO,YAAyB;AACnE,QAAK,OAAO,MAAM,2CAA2C;AAE7D,QAAK,MAAM,YAAY,MAAM,KAAK,iBAAiB,QAAQ,CACvD,MAAK,UAAU,IAAI,SAAS,IAAI,SAAS;IAE/C;AAEF,OAAK,OAAO,QAAQ,GAAG,mBAAmB,OAAO,YAAyB;AACtE,QAAK,OAAO,MAAM,6CAA6C;AAE/D,QAAK,MAAM,UAAU,QACjB,MAAK,UAAU,OAAM,aAAY,SAAS,aAAa,OAAO,GAAG;IAEvE;;CAGN,MAAa,QAAQ,aAAoD;EACrE,MAAM,OAAO,yBAAyB,kCAAkC,YAAY;EACpF,MAAM,YAAY,KAAK,UAAU,QAAO,aAAY,SAAS,SAAS,KAAK;AAE3E,OAAK,OAAO,MAAM,cAAc,UAAU,KAAK,oCAAoC,wBAAwB,MAAM,IAAI;AAErH,OAAK,MAAM,CAAC,IAAI,aAAa,WAAW;AACpC,OAAI,CAAC,MAAM,QAAQ,QAAQ,SAAS,OAAO,YAAY,CAAC,CAAE;AAE1D,SAAM,QAAQ,QAAQ,SAAS,QAAQ,YAAY,CAAC;AAEpD,OAAI,SAAS,MAAM;AACf,SAAK,OAAO,MAA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AAsB,CACzC,QAAO,wBAAwB;WACxB,YAAY,eAAe,CAClC,QAAO,wBAAwB;WACxB,YAAY,UAAU,CAC7B,QAAO,wBAAwB;WACxB,YAAY,iBAAiB,CACpC,QAAO,wBAAwB;WACxB,YAAY,4BAA4B,CAC/C,QAAO,wBAAwB;AAGnC,QAAM,IAAI,MAAM,4BAA4B;;;+DAEnD"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"RecipleRegistryCache.mjs","names":[],"sources":["../../../src/classes/modules/RecipleRegistryCache.ts"],"sourcesContent":["import { createHash } from 'node:crypto';\nimport { mkdir, readFile, rm, stat, writeFile } from 'node:fs/promises';\nimport path from 'node:path';\nimport { BaseModule, CommandType, type AnyCommandData, type Config, type MessageCommand } from 'reciple';\n\nexport class RecipleRegistryCache extends BaseModule implements RecipleRegistryCache.Options {\n public readonly id: string = 'org.reciple.js.registry-cache';\n\n public createCacheEntryEvenIfDisabled: boolean = true;\n public cacheDir: string = path.join(process.cwd(), '.cache/reciple-registry/');\n public maxCacheAgeMs?: number;\n public cacheEnabledEnv: string = 'RECIPLE_REGISTRY_CACHE';\n public cached: boolean = false;\n\n private readonly logger = useLogger().clone({ label: 'RegistryCache' });\n\n constructor(options?: RecipleRegistryCache.Options) {\n super();\n Object.assign(this, options ?? {});\n }\n\n get cachePath(): string {\n return path.join(this.cacheDir, this.client.application?.id ?? 'cache.json');\n }\n\n public async onReady(): Promise<void> {\n const enabled = this.isEnabled();\n\n if (enabled || this.createCacheEntryEvenIfDisabled) {\n this.client.commands?.once('applicationCommandsRegister', async (commands, guildId) => {\n await this.writeCacheEntry();\n });\n }\n\n if (!enabled) {\n this.client.modules.on('readyModules', async () => {\n this.logger.warn(`Registry cache is disabled. Cache is not used.`);\n });\n\n return;\n }\n\n this.logger.debug('Looking for a application commands cache entry...');\n const cachedEntry = await this.readCacheEntry();\n\n this.logger.debug('Creating current application commands cache entry...');\n const currentEntry = await this.createCacheEntry();\n\n if (cachedEntry && this.isCacheHit(cachedEntry, currentEntry)) {\n this.client.config!.applicationCommandsRegister = {\n ...this.client.config!.applicationCommandsRegister,\n registerGlobally: false,\n registerToGuilds: false\n }\n\n this.cached = true;\n }\n\n this.client.modules.on('readyModules', async () => {\n this.logger.warn(`Application commands are ${this.cached ? '' : 'not '}cached. ${this.cached ? 'Skipping' : 'Proceeding with'} registration.`);\n });\n }\n\n public async readCacheEntry(): Promise<RecipleRegistryCache.CacheEntry|null> {\n const stats = await stat(this.cachePath).catch(() => null);\n if (!stats) return null;\n\n return await readFile(this.cachePath, 'utf-8').then(JSON.parse).catch(() => null);\n }\n\n public async writeCacheEntry(entry?: RecipleRegistryCache.CacheEntry): Promise<void> {\n entry ??= await this.createCacheEntry();\n\n this.logger.debug('Writing application commands cache entry...');\n await mkdir(this.cacheDir, { recursive: true });\n await writeFile(this.cachePath, JSON.stringify(entry, null, 4), 'utf-8');\n\n this.logger.debug(`Application commands cache entry written to \"${this.cachePath}\".`);\n }\n\n public async clearCacheEntry(): Promise<void> {\n await rm(this.cachePath).catch(() => null);\n }\n\n public async createCacheEntry(): Promise<RecipleRegistryCache.CacheEntry> {\n this.logger.debug('Creating current application commands cache entry...');\n const commands = Array.from(this.client.commands?.cache.filter(cmd => cmd.type !== CommandType.Message).map(cmd => cmd.toJSON()).values() ?? []);\n\n for (const command of commands) {\n Object.assign(command, { id: \"[cache_value]\" });\n }\n\n const commandsHash = RecipleRegistryCache.createCommandsHash(commands);\n const configHash = RecipleRegistryCache.createConfigHash(this.client.config?.applicationCommandsRegister ?? {});\n\n this.logger.debug(`Commands hash: ${commandsHash}`);\n this.logger.debug(`Config hash: ${configHash}`);\n this.logger.debug('Current application commands cache entry created.');\n\n return {\n createdAt: Date.now(),\n commandsHash,\n configHash\n };\n }\n\n public isCacheHit(cached: RecipleRegistryCache.CacheEntry, current: RecipleRegistryCache.CacheEntry): boolean {\n this.logger.debug('Comparing cache entry with current application commands and configuration...');\n if (this.maxCacheAgeMs && Number.isFinite(this.maxCacheAgeMs)) {\n const age = Date.now() - cached.createdAt;\n if (age > this.maxCacheAgeMs) {\n this.logger.debug(`Cache entry is too old (age: ${age}ms, max age: ${this.maxCacheAgeMs}ms).`);\n return false;\n }\n }\n\n if (cached.commandsHash !== current.commandsHash) {\n this.logger.debug(`Cache entry commands hash doesn't match (cached: ${cached.commandsHash}, current: ${current.commandsHash}).`);\n return false;\n }\n if (cached.configHash !== current.configHash) {\n this.logger.debug(`Cache entry config hash doesn't match (cached: ${cached.configHash}, current: ${current.configHash}).`);\n return false;\n }\n\n this.logger.debug('Cache entry matches current application commands and configuration.');\n return true;\n }\n\n private isEnabled(): boolean {\n if (process.env[this.cacheEnabledEnv] !== 'false' && process.env[this.cacheEnabledEnv] !== '0') {\n return RecipleRegistryCache.checkClientIfEnabled(this.client.config ?? {});\n }\n\n return false;\n }\n}\n\nexport namespace RecipleRegistryCache {\n export interface Options {\n /**\n * @default true\n */\n createCacheEntryEvenIfDisabled?: boolean;\n /**\n * @default '.cache/reciple-registry/'\n */\n cacheDir?: string;\n /**\n * @default 86400000 // 24 hours in milliseconds\n */\n maxCacheAgeMs?: number;\n /**\n * @default 'RECIPLE_REGISTRY_CACHE'\n */\n cacheEnabledEnv?: string;\n }\n\n export interface CacheEntry {\n commandsHash: string;\n configHash: string;\n createdAt: number;\n }\n\n export type CommandData = Exclude<AnyCommandData, MessageCommand.Data>;\n\n export function checkClientIfEnabled(config: Config): boolean {\n return config.applicationCommandsRegister?.registerGlobally\n || config.applicationCommandsRegister?.registerToGuilds === true\n || (\n Array.isArray(config.applicationCommandsRegister?.registerToGuilds)\n && config.applicationCommandsRegister?.registerToGuilds.length > 0\n );\n }\n\n export function createCommandsHash(commands: Exclude<AnyCommandData, MessageCommand.Data>[]): string {\n const hash = createHash('sha256');\n\n hash.update(stringifyValue(commands));\n\n return hash.digest('hex');\n }\n\n export function createConfigHash(config: Config): string {\n const hash = createHash('sha256');\n const relevantConfig = { applicationCommandsRegister: config.applicationCommandsRegister };\n\n hash.update(stringifyValue(relevantConfig));\n\n return hash.digest('hex');\n }\n\n export function stringifyValue(object: any): string {\n switch (typeof object) {\n case 'string':\n return `\"${object}\"`;\n case 'number':\n case 'bigint':\n case 'boolean':\n case 'symbol':\n case 'function':\n return `\"${object.toString()}\"`;\n case 'undefined':\n return 'undefined';\n case 'object':\n if (object === null) {\n return 'null';\n }\n\n if (Array.isArray(object)) {\n return `[${object.map(s => stringifyValue(s)).join(', ')}]`;\n }\n\n if (object instanceof Map) {\n return `{${Array.from(object.entries()).map(([k, v]) => `${stringifyValue(k)}: ${stringifyValue(v)}`).join(', ')}}`;\n }\n\n if (object instanceof Set) {\n return `{${Array.from(object.values()).map(v => stringifyValue(v)).join(', ')}}`;\n }\n\n if (object instanceof Date) {\n return `\"${object.toISOString()}\"`;\n }\n\n try {\n const newObject: Record<string, string> = {};\n\n for (const [key, value] of Object.entries(object)) {\n newObject[key] = stringifyValue(value);\n }\n\n return JSON.stringify(newObject);\n } catch {\n return String(object);\n }\n }\n }\n}\n"],"mappings":";;;;;;AAKA,IAAa,uBAAb,MAAa,6BAA6B,WAAmD;CACzF,AAAgB,KAAa;CAE7B,AAAO,iCAA0C;CACjD,AAAO,WAAmB,KAAK,KAAK,QAAQ,KAAK,EAAE,2BAA2B;CAC9E,AAAO;CACP,AAAO,kBAA0B;CACjC,AAAO,SAAkB;CAEzB,AAAiB,SAAS,WAAW,CAAC,MAAM,EAAE,OAAO,iBAAiB,CAAC;CAEvE,YAAY,SAAwC;AAChD,SAAO;AACP,SAAO,OAAO,MAAM,WAAW,EAAE,CAAC;;CAGtC,IAAI,YAAoB;AACpB,SAAO,KAAK,KAAK,KAAK,UAAU,KAAK,OAAO,aAAa,MAAM,aAAa;;CAGhF,MAAa,UAAyB;EAClC,MAAM,UAAU,KAAK,WAAW;AAEhC,MAAI,WAAW,KAAK,+BAChB,MAAK,OAAO,UAAU,KAAK,+BAA+B,OAAO,UAAU,YAAY;AACnF,SAAM,KAAK,iBAAiB;IAC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,OAAO,CAC7C,WAAU,OAAO,eAAe,MAAM;AAG1C,YAAO,KAAK,UAAU,UAAU;YAC5B;AACJ,YAAO,OAAO,OAAO;;;;;uDAIxC"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"constants.mjs","names":[],"sources":["../../src/helpers/constants.ts"],"sourcesContent":["export enum InteractionListenerType {\n Autocomplete = 1,\n ContextMenu,\n ChatInput,\n Button,\n ModalSubmit,\n SelectMenu,\n PrimaryEntryPoint\n}\n"],"mappings":";AAAA,IAAY,0BAAL;AACH;AACA;AACA;AACA;AACA;AACA;AACA;;KACH"}
|