stoatx 0.5.0 → 0.5.1
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/index.d.mts +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.js +1 -2
- package/dist/index.mjs +1 -2
- package/package.json +2 -2
- package/dist/.tsbuildinfo +0 -1
- package/dist/decorators/Events.d.ts +0 -55
- package/dist/decorators/Events.d.ts.map +0 -1
- package/dist/decorators/Events.js +0 -71
- package/dist/decorators/Events.js.map +0 -1
- package/dist/decorators/Guard.d.ts +0 -38
- package/dist/decorators/Guard.d.ts.map +0 -1
- package/dist/decorators/Guard.js +0 -47
- package/dist/decorators/Guard.js.map +0 -1
- package/dist/decorators/SimpleCommand.d.ts +0 -35
- package/dist/decorators/SimpleCommand.d.ts.map +0 -1
- package/dist/decorators/SimpleCommand.js +0 -43
- package/dist/decorators/SimpleCommand.js.map +0 -1
- package/dist/decorators/Stoat.d.ts +0 -30
- package/dist/decorators/Stoat.d.ts.map +0 -1
- package/dist/decorators/Stoat.js +0 -39
- package/dist/decorators/Stoat.js.map +0 -1
- package/dist/decorators/index.d.ts +0 -9
- package/dist/decorators/index.d.ts.map +0 -1
- package/dist/decorators/index.js +0 -10
- package/dist/decorators/index.js.map +0 -1
- package/dist/decorators/keys.d.ts +0 -10
- package/dist/decorators/keys.d.ts.map +0 -1
- package/dist/decorators/keys.js +0 -10
- package/dist/decorators/keys.js.map +0 -1
- package/dist/decorators/store.d.ts +0 -46
- package/dist/decorators/store.d.ts.map +0 -1
- package/dist/decorators/store.js +0 -70
- package/dist/decorators/store.js.map +0 -1
- package/dist/decorators/utils.d.ts +0 -6
- package/dist/decorators/utils.d.ts.map +0 -1
- package/dist/decorators/utils.js +0 -16
- package/dist/decorators/utils.js.map +0 -1
- package/dist/decorators.d.ts +0 -9
- package/dist/decorators.d.ts.map +0 -1
- package/dist/decorators.js +0 -21
- package/dist/decorators.js.map +0 -1
- package/dist/handler.d.ts +0 -145
- package/dist/handler.d.ts.map +0 -1
- package/dist/handler.js +0 -355
- package/dist/handler.js.map +0 -1
- package/dist/index.d.ts.map +0 -1
- package/dist/index.js.map +0 -1
- package/dist/registry.d.ts +0 -125
- package/dist/registry.d.ts.map +0 -1
- package/dist/registry.js +0 -279
- package/dist/registry.js.map +0 -1
- package/dist/types.d.ts +0 -111
- package/dist/types.d.ts.map +0 -1
- package/dist/types.js +0 -2
- package/dist/types.js.map +0 -1
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"Stoat.js","sourceRoot":"","sources":["../../src/decorators/Stoat.ts"],"names":[],"mappings":"AAAA,OAAO,kBAAkB,CAAC;AAC1B,OAAO,EAAE,aAAa,EAAE,MAAM,QAAQ,CAAC;AACvC,OAAO,EAAE,cAAc,EAAE,MAAM,SAAS,CAAC;AAEzC;;;;;;;;;;;;;;;;;;;;;;GAsBG;AACH,MAAM,UAAU,KAAK;IACnB,OAAO,CAAC,MAAgB,EAAE,EAAE;QAC1B,OAAO,CAAC,cAAc,CAAC,aAAa,CAAC,cAAc,EAAE,IAAI,EAAE,MAAM,CAAC,CAAC;QACnE,cAAc,CAAC,kBAAkB,CAAC,MAAM,CAAC,CAAC;IAC5C,CAAC,CAAC;AACJ,CAAC;AAED;;GAEG;AACH,MAAM,UAAU,YAAY,CAAC,MAAgB;IAC3C,OAAO,OAAO,CAAC,WAAW,CAAC,aAAa,CAAC,cAAc,EAAE,MAAM,CAAC,KAAK,IAAI,CAAC;AAC5E,CAAC"}
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
export { Stoat, isStoatClass } from "./Stoat";
|
|
2
|
-
export { SimpleCommand, getSimpleCommands } from "./SimpleCommand";
|
|
3
|
-
export { Guard, getGuards } from "./Guard";
|
|
4
|
-
export { On, Once, getEventsMetadata } from "./Events";
|
|
5
|
-
export type { SimpleCommandDefinition } from "./SimpleCommand";
|
|
6
|
-
export type { EventDefinition } from "./Events";
|
|
7
|
-
export { buildSimpleCommandMetadata } from "./utils";
|
|
8
|
-
export { METADATA_KEYS } from "./keys";
|
|
9
|
-
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/decorators/index.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,KAAK,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC;AAC9C,OAAO,EAAE,aAAa,EAAE,iBAAiB,EAAE,MAAM,iBAAiB,CAAC;AACnE,OAAO,EAAE,KAAK,EAAE,SAAS,EAAE,MAAM,SAAS,CAAC;AAC3C,OAAO,EAAE,EAAE,EAAE,IAAI,EAAE,iBAAiB,EAAE,MAAM,UAAU,CAAC;AAEvD,YAAY,EAAE,uBAAuB,EAAE,MAAM,iBAAiB,CAAC;AAC/D,YAAY,EAAE,eAAe,EAAE,MAAM,UAAU,CAAC;AAGhD,OAAO,EAAE,0BAA0B,EAAE,MAAM,SAAS,CAAC;AAGrD,OAAO,EAAE,aAAa,EAAE,MAAM,QAAQ,CAAC"}
|
package/dist/decorators/index.js
DELETED
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
// Re-export all decorators
|
|
2
|
-
export { Stoat, isStoatClass } from "./Stoat";
|
|
3
|
-
export { SimpleCommand, getSimpleCommands } from "./SimpleCommand";
|
|
4
|
-
export { Guard, getGuards } from "./Guard";
|
|
5
|
-
export { On, Once, getEventsMetadata } from "./Events";
|
|
6
|
-
// Shared utilities
|
|
7
|
-
export { buildSimpleCommandMetadata } from "./utils";
|
|
8
|
-
// Metadata keys (for advanced usage)
|
|
9
|
-
export { METADATA_KEYS } from "./keys";
|
|
10
|
-
//# sourceMappingURL=index.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/decorators/index.ts"],"names":[],"mappings":"AAAA,2BAA2B;AAC3B,OAAO,EAAE,KAAK,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC;AAC9C,OAAO,EAAE,aAAa,EAAE,iBAAiB,EAAE,MAAM,iBAAiB,CAAC;AACnE,OAAO,EAAE,KAAK,EAAE,SAAS,EAAE,MAAM,SAAS,CAAC;AAC3C,OAAO,EAAE,EAAE,EAAE,IAAI,EAAE,iBAAiB,EAAE,MAAM,UAAU,CAAC;AAKvD,mBAAmB;AACnB,OAAO,EAAE,0BAA0B,EAAE,MAAM,SAAS,CAAC;AAErD,qCAAqC;AACrC,OAAO,EAAE,aAAa,EAAE,MAAM,QAAQ,CAAC"}
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Metadata keys used by decorators
|
|
3
|
-
*/
|
|
4
|
-
export declare const METADATA_KEYS: {
|
|
5
|
-
readonly IS_STOAT_CLASS: symbol;
|
|
6
|
-
readonly SIMPLE_COMMANDS: symbol;
|
|
7
|
-
readonly GUARDS: "stoatx:command:guards";
|
|
8
|
-
readonly EVENTS: symbol;
|
|
9
|
-
};
|
|
10
|
-
//# sourceMappingURL=keys.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"keys.d.ts","sourceRoot":"","sources":["../../src/decorators/keys.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,eAAO,MAAM,aAAa;;;;;CAKhB,CAAC"}
|
package/dist/decorators/keys.js
DELETED
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Metadata keys used by decorators
|
|
3
|
-
*/
|
|
4
|
-
export const METADATA_KEYS = {
|
|
5
|
-
IS_STOAT_CLASS: Symbol("stoatx:stoat:isClass"),
|
|
6
|
-
SIMPLE_COMMANDS: Symbol("stoatx:stoat:simpleCommands"),
|
|
7
|
-
GUARDS: "stoatx:command:guards",
|
|
8
|
-
EVENTS: Symbol("stoatx:stoat:events"),
|
|
9
|
-
};
|
|
10
|
-
//# sourceMappingURL=keys.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"keys.js","sourceRoot":"","sources":["../../src/decorators/keys.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,MAAM,CAAC,MAAM,aAAa,GAAG;IAC3B,cAAc,EAAE,MAAM,CAAC,sBAAsB,CAAC;IAC9C,eAAe,EAAE,MAAM,CAAC,6BAA6B,CAAC;IACtD,MAAM,EAAE,uBAAuB;IAC/B,MAAM,EAAE,MAAM,CAAC,qBAAqB,CAAC;CAC7B,CAAC"}
|
|
@@ -1,46 +0,0 @@
|
|
|
1
|
-
import type { RegisteredCommand } from "../registry";
|
|
2
|
-
/**
|
|
3
|
-
* Global store for all decorated classes and commands
|
|
4
|
-
* This allows automatic registration without directory scanning
|
|
5
|
-
*/
|
|
6
|
-
export declare class DecoratorStore {
|
|
7
|
-
private static instance;
|
|
8
|
-
/** Stoat classes with their SimpleCommand methods */
|
|
9
|
-
private stoatClasses;
|
|
10
|
-
/** Registered commands from @Stoat/@SimpleCommand decorators */
|
|
11
|
-
private commands;
|
|
12
|
-
/** Whether the store has been initialized */
|
|
13
|
-
private initialized;
|
|
14
|
-
private constructor();
|
|
15
|
-
static getInstance(): DecoratorStore;
|
|
16
|
-
/**
|
|
17
|
-
* Register a @Stoat decorated class
|
|
18
|
-
*/
|
|
19
|
-
registerStoatClass(classConstructor: Function): void;
|
|
20
|
-
/**
|
|
21
|
-
* Get all registered Stoat classes with their instances
|
|
22
|
-
*/
|
|
23
|
-
getStoatClasses(): Map<Function, object>;
|
|
24
|
-
/**
|
|
25
|
-
* Add a registered command
|
|
26
|
-
*/
|
|
27
|
-
addCommand(command: RegisteredCommand): void;
|
|
28
|
-
/**
|
|
29
|
-
* Get all registered commands
|
|
30
|
-
*/
|
|
31
|
-
getCommands(): RegisteredCommand[];
|
|
32
|
-
/**
|
|
33
|
-
* Clear all registered classes (useful for testing)
|
|
34
|
-
*/
|
|
35
|
-
clear(): void;
|
|
36
|
-
/**
|
|
37
|
-
* Mark as initialized
|
|
38
|
-
*/
|
|
39
|
-
markInitialized(): void;
|
|
40
|
-
/**
|
|
41
|
-
* Check if initialized
|
|
42
|
-
*/
|
|
43
|
-
isInitialized(): boolean;
|
|
44
|
-
}
|
|
45
|
-
export declare const decoratorStore: DecoratorStore;
|
|
46
|
-
//# sourceMappingURL=store.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"store.d.ts","sourceRoot":"","sources":["../../src/decorators/store.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,aAAa,CAAC;AAErD;;;GAGG;AACH,qBAAa,cAAc;IACzB,OAAO,CAAC,MAAM,CAAC,QAAQ,CAAiB;IAExC,qDAAqD;IACrD,OAAO,CAAC,YAAY,CAAoC;IAExD,gEAAgE;IAChE,OAAO,CAAC,QAAQ,CAA2B;IAE3C,6CAA6C;IAC7C,OAAO,CAAC,WAAW,CAAS;IAE5B,OAAO;IAEP,MAAM,CAAC,WAAW,IAAI,cAAc;IAOpC;;OAEG;IACH,kBAAkB,CAAC,gBAAgB,EAAE,QAAQ,GAAG,IAAI;IAQpD;;OAEG;IACH,eAAe,IAAI,GAAG,CAAC,QAAQ,EAAE,MAAM,CAAC;IAIxC;;OAEG;IACH,UAAU,CAAC,OAAO,EAAE,iBAAiB,GAAG,IAAI;IAI5C;;OAEG;IACH,WAAW,IAAI,iBAAiB,EAAE;IAIlC;;OAEG;IACH,KAAK,IAAI,IAAI;IAMb;;OAEG;IACH,eAAe,IAAI,IAAI;IAIvB;;OAEG;IACH,aAAa,IAAI,OAAO;CAGzB;AAED,eAAO,MAAM,cAAc,gBAA+B,CAAC"}
|
package/dist/decorators/store.js
DELETED
|
@@ -1,70 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Global store for all decorated classes and commands
|
|
3
|
-
* This allows automatic registration without directory scanning
|
|
4
|
-
*/
|
|
5
|
-
export class DecoratorStore {
|
|
6
|
-
static instance;
|
|
7
|
-
/** Stoat classes with their SimpleCommand methods */
|
|
8
|
-
stoatClasses = new Map();
|
|
9
|
-
/** Registered commands from @Stoat/@SimpleCommand decorators */
|
|
10
|
-
commands = [];
|
|
11
|
-
/** Whether the store has been initialized */
|
|
12
|
-
initialized = false;
|
|
13
|
-
constructor() { }
|
|
14
|
-
static getInstance() {
|
|
15
|
-
if (!DecoratorStore.instance) {
|
|
16
|
-
DecoratorStore.instance = new DecoratorStore();
|
|
17
|
-
}
|
|
18
|
-
return DecoratorStore.instance;
|
|
19
|
-
}
|
|
20
|
-
/**
|
|
21
|
-
* Register a @Stoat decorated class
|
|
22
|
-
*/
|
|
23
|
-
registerStoatClass(classConstructor) {
|
|
24
|
-
if (!this.stoatClasses.has(classConstructor)) {
|
|
25
|
-
// Create instance immediately when decorated
|
|
26
|
-
const instance = new classConstructor();
|
|
27
|
-
this.stoatClasses.set(classConstructor, instance);
|
|
28
|
-
}
|
|
29
|
-
}
|
|
30
|
-
/**
|
|
31
|
-
* Get all registered Stoat classes with their instances
|
|
32
|
-
*/
|
|
33
|
-
getStoatClasses() {
|
|
34
|
-
return this.stoatClasses;
|
|
35
|
-
}
|
|
36
|
-
/**
|
|
37
|
-
* Add a registered command
|
|
38
|
-
*/
|
|
39
|
-
addCommand(command) {
|
|
40
|
-
this.commands.push(command);
|
|
41
|
-
}
|
|
42
|
-
/**
|
|
43
|
-
* Get all registered commands
|
|
44
|
-
*/
|
|
45
|
-
getCommands() {
|
|
46
|
-
return this.commands;
|
|
47
|
-
}
|
|
48
|
-
/**
|
|
49
|
-
* Clear all registered classes (useful for testing)
|
|
50
|
-
*/
|
|
51
|
-
clear() {
|
|
52
|
-
this.stoatClasses.clear();
|
|
53
|
-
this.commands = [];
|
|
54
|
-
this.initialized = false;
|
|
55
|
-
}
|
|
56
|
-
/**
|
|
57
|
-
* Mark as initialized
|
|
58
|
-
*/
|
|
59
|
-
markInitialized() {
|
|
60
|
-
this.initialized = true;
|
|
61
|
-
}
|
|
62
|
-
/**
|
|
63
|
-
* Check if initialized
|
|
64
|
-
*/
|
|
65
|
-
isInitialized() {
|
|
66
|
-
return this.initialized;
|
|
67
|
-
}
|
|
68
|
-
}
|
|
69
|
-
export const decoratorStore = DecoratorStore.getInstance();
|
|
70
|
-
//# sourceMappingURL=store.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"store.js","sourceRoot":"","sources":["../../src/decorators/store.ts"],"names":[],"mappings":"AAEA;;;GAGG;AACH,MAAM,OAAO,cAAc;IACjB,MAAM,CAAC,QAAQ,CAAiB;IAExC,qDAAqD;IAC7C,YAAY,GAA0B,IAAI,GAAG,EAAE,CAAC;IAExD,gEAAgE;IACxD,QAAQ,GAAwB,EAAE,CAAC;IAE3C,6CAA6C;IACrC,WAAW,GAAG,KAAK,CAAC;IAE5B,gBAAuB,CAAC;IAExB,MAAM,CAAC,WAAW;QAChB,IAAI,CAAC,cAAc,CAAC,QAAQ,EAAE,CAAC;YAC7B,cAAc,CAAC,QAAQ,GAAG,IAAI,cAAc,EAAE,CAAC;QACjD,CAAC;QACD,OAAO,cAAc,CAAC,QAAQ,CAAC;IACjC,CAAC;IAED;;OAEG;IACH,kBAAkB,CAAC,gBAA0B;QAC3C,IAAI,CAAC,IAAI,CAAC,YAAY,CAAC,GAAG,CAAC,gBAAgB,CAAC,EAAE,CAAC;YAC7C,6CAA6C;YAC7C,MAAM,QAAQ,GAAG,IAAK,gBAAqC,EAAE,CAAC;YAC9D,IAAI,CAAC,YAAY,CAAC,GAAG,CAAC,gBAAgB,EAAE,QAAQ,CAAC,CAAC;QACpD,CAAC;IACH,CAAC;IAED;;OAEG;IACH,eAAe;QACb,OAAO,IAAI,CAAC,YAAY,CAAC;IAC3B,CAAC;IAED;;OAEG;IACH,UAAU,CAAC,OAA0B;QACnC,IAAI,CAAC,QAAQ,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;IAC9B,CAAC;IAED;;OAEG;IACH,WAAW;QACT,OAAO,IAAI,CAAC,QAAQ,CAAC;IACvB,CAAC;IAED;;OAEG;IACH,KAAK;QACH,IAAI,CAAC,YAAY,CAAC,KAAK,EAAE,CAAC;QAC1B,IAAI,CAAC,QAAQ,GAAG,EAAE,CAAC;QACnB,IAAI,CAAC,WAAW,GAAG,KAAK,CAAC;IAC3B,CAAC;IAED;;OAEG;IACH,eAAe;QACb,IAAI,CAAC,WAAW,GAAG,IAAI,CAAC;IAC1B,CAAC;IAED;;OAEG;IACH,aAAa;QACX,OAAO,IAAI,CAAC,WAAW,CAAC;IAC1B,CAAC;CACF;AAED,MAAM,CAAC,MAAM,cAAc,GAAG,cAAc,CAAC,WAAW,EAAE,CAAC"}
|
|
@@ -1,6 +0,0 @@
|
|
|
1
|
-
import type { CommandMetadata, SimpleCommandOptions } from "../types";
|
|
2
|
-
/**
|
|
3
|
-
* Build CommandMetadata from SimpleCommandOptions
|
|
4
|
-
*/
|
|
5
|
-
export declare function buildSimpleCommandMetadata(options: SimpleCommandOptions, methodName: string, category?: string): CommandMetadata;
|
|
6
|
-
//# sourceMappingURL=utils.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../src/decorators/utils.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,eAAe,EAAE,oBAAoB,EAAE,MAAM,UAAU,CAAC;AAEtE;;GAEG;AACH,wBAAgB,0BAA0B,CACxC,OAAO,EAAE,oBAAoB,EAC7B,UAAU,EAAE,MAAM,EAClB,QAAQ,CAAC,EAAE,MAAM,GAChB,eAAe,CAWjB"}
|
package/dist/decorators/utils.js
DELETED
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Build CommandMetadata from SimpleCommandOptions
|
|
3
|
-
*/
|
|
4
|
-
export function buildSimpleCommandMetadata(options, methodName, category) {
|
|
5
|
-
return {
|
|
6
|
-
name: options.name ?? methodName.toLowerCase(),
|
|
7
|
-
description: options.description ?? "No description provided",
|
|
8
|
-
aliases: options.aliases ?? [],
|
|
9
|
-
permissions: options.permissions ?? [],
|
|
10
|
-
category: options.category ?? category ?? "uncategorized",
|
|
11
|
-
cooldown: options.cooldown ?? 0,
|
|
12
|
-
nsfw: options.nsfw ?? false,
|
|
13
|
-
ownerOnly: options.ownerOnly ?? false,
|
|
14
|
-
};
|
|
15
|
-
}
|
|
16
|
-
//# sourceMappingURL=utils.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"utils.js","sourceRoot":"","sources":["../../src/decorators/utils.ts"],"names":[],"mappings":"AAEA;;GAEG;AACH,MAAM,UAAU,0BAA0B,CACxC,OAA6B,EAC7B,UAAkB,EAClB,QAAiB;IAEjB,OAAO;QACL,IAAI,EAAE,OAAO,CAAC,IAAI,IAAI,UAAU,CAAC,WAAW,EAAE;QAC9C,WAAW,EAAE,OAAO,CAAC,WAAW,IAAI,yBAAyB;QAC7D,OAAO,EAAE,OAAO,CAAC,OAAO,IAAI,EAAE;QAC9B,WAAW,EAAE,OAAO,CAAC,WAAW,IAAI,EAAE;QACtC,QAAQ,EAAE,OAAO,CAAC,QAAQ,IAAI,QAAQ,IAAI,eAAe;QACzD,QAAQ,EAAE,OAAO,CAAC,QAAQ,IAAI,CAAC;QAC/B,IAAI,EAAE,OAAO,CAAC,IAAI,IAAI,KAAK;QAC3B,SAAS,EAAE,OAAO,CAAC,SAAS,IAAI,KAAK;KACtC,CAAC;AACJ,CAAC"}
|
package/dist/decorators.d.ts
DELETED
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Decorators module - Re-exports all decorators from the decorators folder
|
|
3
|
-
*
|
|
4
|
-
* This file maintains backward compatibility while the actual implementations
|
|
5
|
-
* are organized in separate files under the decorators/ folder.
|
|
6
|
-
*/
|
|
7
|
-
export { Stoat, isStoatClass, SimpleCommand, getSimpleCommands, Guard, getGuards, buildSimpleCommandMetadata, METADATA_KEYS, On, Once, getEventsMetadata, } from "./decorators/index";
|
|
8
|
-
export type { SimpleCommandDefinition, EventDefinition } from "./decorators/index";
|
|
9
|
-
//# sourceMappingURL=decorators.d.ts.map
|
package/dist/decorators.d.ts.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"decorators.d.ts","sourceRoot":"","sources":["../src/decorators.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAGH,OAAO,EAEL,KAAK,EACL,YAAY,EAGZ,aAAa,EACb,iBAAiB,EAGjB,KAAK,EACL,SAAS,EAGT,0BAA0B,EAG1B,aAAa,EAGb,EAAE,EACF,IAAI,EACJ,iBAAiB,GAClB,MAAM,oBAAoB,CAAC;AAG5B,YAAY,EAAE,uBAAuB,EAAE,eAAe,EAAE,MAAM,oBAAoB,CAAC"}
|
package/dist/decorators.js
DELETED
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Decorators module - Re-exports all decorators from the decorators folder
|
|
3
|
-
*
|
|
4
|
-
* This file maintains backward compatibility while the actual implementations
|
|
5
|
-
* are organized in separate files under the decorators/ folder.
|
|
6
|
-
*/
|
|
7
|
-
// Re-export everything from the decorators folder
|
|
8
|
-
export {
|
|
9
|
-
// Stoat (discordx-style class decorator)
|
|
10
|
-
Stoat, isStoatClass,
|
|
11
|
-
// SimpleCommand (method decorator for @Stoat classes)
|
|
12
|
-
SimpleCommand, getSimpleCommands,
|
|
13
|
-
// Guard
|
|
14
|
-
Guard, getGuards,
|
|
15
|
-
// Utilities
|
|
16
|
-
buildSimpleCommandMetadata,
|
|
17
|
-
// Metadata keys
|
|
18
|
-
METADATA_KEYS,
|
|
19
|
-
// Events
|
|
20
|
-
On, Once, getEventsMetadata, } from "./decorators/index";
|
|
21
|
-
//# sourceMappingURL=decorators.js.map
|
package/dist/decorators.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"decorators.js","sourceRoot":"","sources":["../src/decorators.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,kDAAkD;AAClD,OAAO;AACL,yCAAyC;AACzC,KAAK,EACL,YAAY;AAEZ,sDAAsD;AACtD,aAAa,EACb,iBAAiB;AAEjB,QAAQ;AACR,KAAK,EACL,SAAS;AAET,YAAY;AACZ,0BAA0B;AAE1B,gBAAgB;AAChB,aAAa;AAEb,SAAS;AACT,EAAE,EACF,IAAI,EACJ,iBAAiB,GAClB,MAAM,oBAAoB,CAAC"}
|
package/dist/handler.d.ts
DELETED
|
@@ -1,145 +0,0 @@
|
|
|
1
|
-
import "reflect-metadata";
|
|
2
|
-
import { CommandRegistry, RegisteredCommand } from "./registry";
|
|
3
|
-
import type { CommandContext, StoatxHandlerOptions } from "./types";
|
|
4
|
-
import { Client as StoatClient, Message } from "stoat.js";
|
|
5
|
-
/**
|
|
6
|
-
* Client - An extended Client that integrates StoatxHandler directly
|
|
7
|
-
*
|
|
8
|
-
* @example
|
|
9
|
-
* ```ts
|
|
10
|
-
* import { Client } from 'stoatx';
|
|
11
|
-
*
|
|
12
|
-
* const client = new Client({
|
|
13
|
-
* prefix: '!',
|
|
14
|
-
* owners: ['owner-user-id'],
|
|
15
|
-
* });
|
|
16
|
-
*
|
|
17
|
-
* await client.initCommands();
|
|
18
|
-
* ```
|
|
19
|
-
*/
|
|
20
|
-
export declare class Client extends StoatClient {
|
|
21
|
-
readonly handler: StoatxHandler;
|
|
22
|
-
constructor(options: Omit<StoatxHandlerOptions, "client">);
|
|
23
|
-
/**
|
|
24
|
-
* Initialize the StoatxHandler commands
|
|
25
|
-
*/
|
|
26
|
-
initCommands(): Promise<void>;
|
|
27
|
-
}
|
|
28
|
-
/**
|
|
29
|
-
* StoatxHandler - The execution engine for commands
|
|
30
|
-
*
|
|
31
|
-
* Handles message parsing, middleware execution, and command dispatching
|
|
32
|
-
*
|
|
33
|
-
* @internal This class is not intended to be instantiated directly. Use the `Client` from `stoatx` instead.
|
|
34
|
-
*/
|
|
35
|
-
export declare class StoatxHandler {
|
|
36
|
-
private readonly commandsDir;
|
|
37
|
-
private readonly discoveryOptions;
|
|
38
|
-
private readonly prefixResolver;
|
|
39
|
-
private readonly owners;
|
|
40
|
-
private readonly registry;
|
|
41
|
-
private readonly cooldowns;
|
|
42
|
-
private readonly disableMentionPrefix;
|
|
43
|
-
private readonly client;
|
|
44
|
-
constructor(options: StoatxHandlerOptions);
|
|
45
|
-
/**
|
|
46
|
-
* Initialize the handler - load all commands
|
|
47
|
-
*/
|
|
48
|
-
init(): Promise<void>;
|
|
49
|
-
/**
|
|
50
|
-
* Attach registered events to the client
|
|
51
|
-
*/
|
|
52
|
-
private attachEvents;
|
|
53
|
-
/**
|
|
54
|
-
* Parse a raw message into command context
|
|
55
|
-
*/
|
|
56
|
-
parseMessage(rawContent: string, message: Message, meta: {
|
|
57
|
-
authorId: string;
|
|
58
|
-
channelId: string;
|
|
59
|
-
serverId?: string;
|
|
60
|
-
reply: (content: string) => Promise<Message>;
|
|
61
|
-
}): Promise<CommandContext | null>;
|
|
62
|
-
/**
|
|
63
|
-
* Handle a message object using the configured message adapter
|
|
64
|
-
*
|
|
65
|
-
* @example
|
|
66
|
-
* ```ts
|
|
67
|
-
* // With message adapter configured
|
|
68
|
-
* client.on('messageCreate', (message) => {
|
|
69
|
-
* handler.handle(message);
|
|
70
|
-
* });
|
|
71
|
-
* ```
|
|
72
|
-
*/
|
|
73
|
-
handle(message: any): Promise<boolean>;
|
|
74
|
-
/**
|
|
75
|
-
* Handle a raw message string with metadata
|
|
76
|
-
*
|
|
77
|
-
* @example
|
|
78
|
-
* ```ts
|
|
79
|
-
* // Manual usage without message adapter
|
|
80
|
-
* client.on('messageCreate', (message) => {
|
|
81
|
-
* handler.handleMessage(message.content, message, {
|
|
82
|
-
* authorId: message.author.id,
|
|
83
|
-
* channelId: message.channel.id,
|
|
84
|
-
* serverId: message.server?.id,
|
|
85
|
-
* reply: (content) => message.channel.sendMessage(content),
|
|
86
|
-
* });
|
|
87
|
-
* });
|
|
88
|
-
* ```
|
|
89
|
-
*/
|
|
90
|
-
handleMessage(rawContent: string, message: Message, meta: {
|
|
91
|
-
authorId: string;
|
|
92
|
-
channelId: string;
|
|
93
|
-
serverId?: string;
|
|
94
|
-
reply: (content: string) => Promise<Message>;
|
|
95
|
-
}): Promise<boolean>;
|
|
96
|
-
/**
|
|
97
|
-
* Execute a command with the given context
|
|
98
|
-
*/
|
|
99
|
-
execute(ctx: CommandContext): Promise<boolean>;
|
|
100
|
-
/**
|
|
101
|
-
* Get the command registry
|
|
102
|
-
*/
|
|
103
|
-
getRegistry(): CommandRegistry;
|
|
104
|
-
/**
|
|
105
|
-
* Get a command by name or alias
|
|
106
|
-
*/
|
|
107
|
-
getCommand(name: string): RegisteredCommand | undefined;
|
|
108
|
-
/**
|
|
109
|
-
* Get all commands
|
|
110
|
-
*/
|
|
111
|
-
getCommands(): RegisteredCommand[];
|
|
112
|
-
/**
|
|
113
|
-
* Reload all commands
|
|
114
|
-
*/
|
|
115
|
-
reload(): Promise<void>;
|
|
116
|
-
/**
|
|
117
|
-
* Check if a user is an owner
|
|
118
|
-
*/
|
|
119
|
-
isOwner(userId: string): boolean;
|
|
120
|
-
/**
|
|
121
|
-
* Add an owner
|
|
122
|
-
*/
|
|
123
|
-
addOwner(userId: string): void;
|
|
124
|
-
/**
|
|
125
|
-
* Remove an owner
|
|
126
|
-
*/
|
|
127
|
-
removeOwner(userId: string): void;
|
|
128
|
-
/**
|
|
129
|
-
* Resolve the prefix for a context
|
|
130
|
-
*/
|
|
131
|
-
private resolvePrefix;
|
|
132
|
-
/**
|
|
133
|
-
* Check if user is on cooldown
|
|
134
|
-
*/
|
|
135
|
-
private checkCooldown;
|
|
136
|
-
/**
|
|
137
|
-
* Get remaining cooldown time in ms
|
|
138
|
-
*/
|
|
139
|
-
private getRemainingCooldown;
|
|
140
|
-
/**
|
|
141
|
-
* Set cooldown for a user
|
|
142
|
-
*/
|
|
143
|
-
private setCooldown;
|
|
144
|
-
}
|
|
145
|
-
//# sourceMappingURL=handler.d.ts.map
|
package/dist/handler.d.ts.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|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