xernerx 4.17.7 → 5.0.2

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.
Files changed (75) hide show
  1. package/README.md +14 -67
  2. package/dist/main.cjs +63 -0
  3. package/dist/main.cjs.map +1 -0
  4. package/dist/main.d.cts +21 -0
  5. package/dist/main.d.ts +20 -46
  6. package/dist/main.js +23 -49
  7. package/dist/main.js.map +1 -0
  8. package/package.json +63 -47
  9. package/src/main.ts +26 -0
  10. package/dist/build/XernerxContextCommand.d.ts +0 -82
  11. package/dist/build/XernerxContextCommand.js +0 -125
  12. package/dist/build/XernerxEvent.d.ts +0 -21
  13. package/dist/build/XernerxEvent.js +0 -27
  14. package/dist/build/XernerxInhibitor.d.ts +0 -53
  15. package/dist/build/XernerxInhibitor.js +0 -27
  16. package/dist/build/XernerxMessageCommand.d.ts +0 -84
  17. package/dist/build/XernerxMessageCommand.js +0 -123
  18. package/dist/build/XernerxSlashCommand.d.ts +0 -104
  19. package/dist/build/XernerxSlashCommand.js +0 -182
  20. package/dist/client/XernerxClient.d.ts +0 -70
  21. package/dist/client/XernerxClient.js +0 -106
  22. package/dist/client/XernerxShardClient.d.ts +0 -21
  23. package/dist/client/XernerxShardClient.js +0 -67
  24. package/dist/functions/deploy.d.ts +0 -3
  25. package/dist/functions/deploy.js +0 -56
  26. package/dist/functions/load.d.ts +0 -4
  27. package/dist/functions/load.js +0 -34
  28. package/dist/functions/reload.d.ts +0 -3
  29. package/dist/functions/reload.js +0 -29
  30. package/dist/functions/setPresence.d.ts +0 -4
  31. package/dist/functions/setPresence.js +0 -22
  32. package/dist/functions/xernerxUser.d.ts +0 -4
  33. package/dist/functions/xernerxUser.js +0 -10
  34. package/dist/handlers/CommandHandler.d.ts +0 -16
  35. package/dist/handlers/CommandHandler.js +0 -326
  36. package/dist/handlers/EventHandler.d.ts +0 -9
  37. package/dist/handlers/EventHandler.js +0 -56
  38. package/dist/handlers/ExtensionHandler.d.ts +0 -9
  39. package/dist/handlers/ExtensionHandler.js +0 -29
  40. package/dist/handlers/Handler.d.ts +0 -31
  41. package/dist/handlers/Handler.js +0 -52
  42. package/dist/handlers/InhibitorHandler.d.ts +0 -9
  43. package/dist/handlers/InhibitorHandler.js +0 -33
  44. package/dist/handlers/IntegrationHandler.d.ts +0 -15
  45. package/dist/handlers/IntegrationHandler.js +0 -26
  46. package/dist/models/Arguments.d.ts +0 -12
  47. package/dist/models/Arguments.js +0 -139
  48. package/dist/models/Cooldowns.d.ts +0 -11
  49. package/dist/models/Cooldowns.js +0 -29
  50. package/dist/tools/XernerxError.d.ts +0 -7
  51. package/dist/tools/XernerxError.js +0 -11
  52. package/dist/tools/XernerxIntents.d.ts +0 -6
  53. package/dist/tools/XernerxIntents.js +0 -26
  54. package/dist/tools/XernerxLog.d.ts +0 -31
  55. package/dist/tools/XernerxLog.js +0 -148
  56. package/dist/tools/XernerxText.d.ts +0 -31
  57. package/dist/tools/XernerxText.js +0 -84
  58. package/dist/types/extenders.d.ts +0 -84
  59. package/dist/types/extenders.js +0 -2
  60. package/dist/types/interfaces.d.ts +0 -263
  61. package/dist/types/interfaces.js +0 -2
  62. package/dist/types/types.d.ts +0 -111
  63. package/dist/types/types.js +0 -2
  64. package/dist/utils/ClientUtil.d.ts +0 -22
  65. package/dist/utils/ClientUtil.js +0 -102
  66. package/dist/utils/InteractionUtil.d.ts +0 -25
  67. package/dist/utils/InteractionUtil.js +0 -154
  68. package/dist/utils/MessageUtil.d.ts +0 -26
  69. package/dist/utils/MessageUtil.js +0 -168
  70. package/dist/utils/Util.d.ts +0 -12
  71. package/dist/utils/Util.js +0 -11
  72. package/dist/validators/commandValidation.d.ts +0 -10
  73. package/dist/validators/commandValidation.js +0 -167
  74. package/dist/validators/inhibitorValidations.d.ts +0 -28
  75. package/dist/validators/inhibitorValidations.js +0 -44
package/README.md CHANGED
@@ -1,76 +1,23 @@
1
1
  <!-- @format -->
2
- <center>
3
2
 
4
- [![](./docs/icons/Xernerx%20-%20Logo%20-%20Purple.png)](https://xernerx.github.io/xernerx)
3
+ # xernerx
5
4
 
6
- [![Discord](https://img.shields.io/discord/784094726432489522?logo=discord)](https://discord.gg/teNWyb69dq)
7
- ![npm](https://img.shields.io/npm/dw/xernerx)
8
- ![npm](https://img.shields.io/npm/dt/xernerx)
9
- ![Read the Docs](https://img.shields.io/readthedocs/node)
10
- ![npm type definitions](https://img.shields.io/npm/types/xernerx)
11
- ![node-current](https://img.shields.io/npm/v/discord.js)
12
- [![wakatime](https://wakatime.com/badge/user/0eeef1b5-98a7-4ec0-ab4c-db00536d5ed1/project/23ab34b7-623b-45e8-b8db-e9f1910589f7.svg)](https://wakatime.com/badge/user/0eeef1b5-98a7-4ec0-ab4c-db00536d5ed1/project/23ab34b7-623b-45e8-b8db-e9f1910589f7)
13
- ![node-current](https://img.shields.io/node/v/xernerx)
14
- ![GitHub commit activity (branch)](https://img.shields.io/github/commit-activity/t/xernerx/xernerx)
5
+ The official all-in-one **Xernerx** meta-package, re-exporting all `@xernerx/*` packages from a single entry point:
15
6
 
16
- </center>
17
- # About
7
+ - [`@xernerx/framework`](https://www.npmjs.com/package/@xernerx/framework) — Discord bot framework (`XernerxClient`, `XernerxShardClient`, command/event/inhibitor builders & handlers)
8
+ - [`@xernerx/commands`](https://www.npmjs.com/package/@xernerx/commands) — Developer command extension & Xernerx Suite Commands API SDK (`XernerxCommands`, `CommandsClient`, `postCommands`)
9
+ - [`@xernerx/stats`](https://www.npmjs.com/package/@xernerx/stats) — Xernerx Suite Stats API SDK (`XernerxStats`, `StatsClient`, `postStats`)
10
+ - [`@xernerx/terminal`](https://www.npmjs.com/package/@xernerx/terminal) — Formatted CLI logger & interactive spinner (`Terminal`, `terminal`, `Spinner`)
11
+ - [`@xernerx/websocket`](https://www.npmjs.com/package/@xernerx/websocket) — Xernerx Suite WebSocket client (`XernerxWebsocket`)
18
12
 
19
- Xernerx is a class based discord.js framework. \[BETA\]
13
+ ## Installation
20
14
 
21
- It can be customized to be a lightweight handler or a heavy customizable framework that does all the hard work for you
22
-
23
- ## Features
24
-
25
- > - [x] Slash command handler
26
- > - [x] Message command handler
27
- > - [x] Context command handler
28
- > - [x] Event handler (with custom Events)
29
- > - [x] Inhibitor handler
30
- > - [x] Extension handler
31
- > - [x] Client Utilities
32
- > - [x] Message Utilities
33
- > - [x] Interaction Utilities
34
- > - [x] Message command handles
35
- > - [x] Extension support
36
- > - [x] ShardClient
37
-
38
- ## Links
39
-
40
- > - [Documentation](https://xernerx.github.io/xernerx/docs/#v4)
41
- > - [Guide](https://xernerx.github.io/xernerx/guide/#v4)
42
-
43
- ## Setup
44
-
45
- ### Settings
46
-
47
- ```js
48
- import XernerxClient from 'xernerx';
49
-
50
- new (class Client extends XernerxClient {
51
- constructor() {
52
- super([discordOptions], [xernerxOptions]);
53
-
54
- this.connect('token');
55
- }
56
- })();
15
+ ```bash
16
+ pnpm add xernerx discord.js @discordjs/core
57
17
  ```
58
18
 
59
- ### Handlers
60
-
61
- There are 5 handlers total
62
-
63
- > - Command handler, handles message, slash and context commands
64
- > - Event handler, has all the Discord.js events and more
65
- > - Inhibitor handler, handles conditions before commands are ran globally
66
- > - Extension handler, more info [here](#Extensions)
67
- > - Webhook handler, will allow for top.gg to get your stats (needs a rework)
68
-
69
- ## Extensions
19
+ ## Usage
70
20
 
71
- Xernerx supports the ability to use extensions, features not initially included into your code. You can use any extension based on the [xernerx-extension-builder](https://npmjs.com/xernerx-extension-builder) package, or make your own with it!
72
-
73
- ## Notes
74
-
75
- - Only compatible with ESM
76
- - TypeScript and JavaScript support
21
+ ```ts
22
+ import { XernerxClient, XernerxCommands, XernerxStats, XernerxWebsocket, terminal } from 'xernerx';
23
+ ```
package/dist/main.cjs ADDED
@@ -0,0 +1,63 @@
1
+ 'use strict';
2
+
3
+ var framework = require('@xernerx/framework');
4
+ var terminal = require('@xernerx/terminal');
5
+ var websocket = require('@xernerx/websocket');
6
+ var stats = require('@xernerx/stats');
7
+ var commands = require('@xernerx/commands');
8
+
9
+ var __defProp = Object.defineProperty;
10
+ var __name = (target, value) => __defProp(target, "name", { value, configurable: true });
11
+ async function post(data, token, baseUrl) {
12
+ if (data && typeof data === "object" && "commands" in data) {
13
+ return commands.post(data, token, baseUrl);
14
+ }
15
+ return stats.post(data, token, baseUrl);
16
+ }
17
+ __name(post, "post");
18
+
19
+ Object.defineProperty(exports, "BaseClient", {
20
+ enumerable: true,
21
+ get: function () { return stats.BaseClient; }
22
+ });
23
+ Object.defineProperty(exports, "postStats", {
24
+ enumerable: true,
25
+ get: function () { return stats.post; }
26
+ });
27
+ Object.defineProperty(exports, "postCommands", {
28
+ enumerable: true,
29
+ get: function () { return commands.post; }
30
+ });
31
+ exports.post = post;
32
+ Object.keys(framework).forEach(function (k) {
33
+ if (k !== 'default' && !Object.prototype.hasOwnProperty.call(exports, k)) Object.defineProperty(exports, k, {
34
+ enumerable: true,
35
+ get: function () { return framework[k]; }
36
+ });
37
+ });
38
+ Object.keys(terminal).forEach(function (k) {
39
+ if (k !== 'default' && !Object.prototype.hasOwnProperty.call(exports, k)) Object.defineProperty(exports, k, {
40
+ enumerable: true,
41
+ get: function () { return terminal[k]; }
42
+ });
43
+ });
44
+ Object.keys(websocket).forEach(function (k) {
45
+ if (k !== 'default' && !Object.prototype.hasOwnProperty.call(exports, k)) Object.defineProperty(exports, k, {
46
+ enumerable: true,
47
+ get: function () { return websocket[k]; }
48
+ });
49
+ });
50
+ Object.keys(stats).forEach(function (k) {
51
+ if (k !== 'default' && !Object.prototype.hasOwnProperty.call(exports, k)) Object.defineProperty(exports, k, {
52
+ enumerable: true,
53
+ get: function () { return stats[k]; }
54
+ });
55
+ });
56
+ Object.keys(commands).forEach(function (k) {
57
+ if (k !== 'default' && !Object.prototype.hasOwnProperty.call(exports, k)) Object.defineProperty(exports, k, {
58
+ enumerable: true,
59
+ get: function () { return commands[k]; }
60
+ });
61
+ });
62
+ //# sourceMappingURL=main.cjs.map
63
+ //# sourceMappingURL=main.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/main.ts"],"names":["postCommands","postStats"],"mappings":";;;;;;;;;;AAoBA,eAAsB,IAAA,CAAK,IAAA,EAAsC,KAAA,EAAe,OAAA,EAAgC;AAC/G,EAAA,IAAI,IAAA,IAAQ,OAAO,IAAA,KAAS,QAAA,IAAY,cAAc,IAAA,EAAM;AAC3D,IAAA,OAAOA,aAAA,CAAa,IAAA,EAAM,KAAA,EAAO,OAAO,CAAA;AAAA,EACzC;AACA,EAAA,OAAOC,UAAA,CAAU,IAAA,EAAsB,KAAA,EAAO,OAAO,CAAA;AACtD;AALsB,MAAA,CAAA,IAAA,EAAA,MAAA,CAAA","file":"main.cjs","sourcesContent":["/** @format */\n// Re-exports all @xernerx/* packages\n\nexport * from '@xernerx/framework';\nexport * from '@xernerx/terminal';\nexport * from '@xernerx/websocket';\nexport * from '@xernerx/stats';\nexport * from '@xernerx/commands';\n\nimport { BaseClient, type BaseClientOptions, post as postStats, type StatsPayload } from '@xernerx/stats';\nimport { post as postCommands, type CommandsPayload } from '@xernerx/commands';\n\nexport { BaseClient, type BaseClientOptions, postStats, postCommands };\n\n/**\n * Posts either bot statistics (`StatsPayload`) or bot commands (`CommandsPayload`) to the Xernerx Suite API.\n * @param data - Statistics payload or commands payload.\n * @param token - Xernerx API bearer token.\n * @param baseUrl - Optional custom API base URL.\n */\nexport async function post(data: StatsPayload | CommandsPayload, token: string, baseUrl?: string): Promise<any> {\n\tif (data && typeof data === 'object' && 'commands' in data) {\n\t\treturn postCommands(data, token, baseUrl);\n\t}\n\treturn postStats(data as StatsPayload, token, baseUrl);\n}\n"]}
@@ -0,0 +1,21 @@
1
+ export * from '@xernerx/framework';
2
+ export * from '@xernerx/terminal';
3
+ export * from '@xernerx/websocket';
4
+ import { StatsPayload } from '@xernerx/stats';
5
+ export * from '@xernerx/stats';
6
+ export { BaseClient, BaseClientOptions, post as postStats } from '@xernerx/stats';
7
+ import { CommandsPayload } from '@xernerx/commands';
8
+ export * from '@xernerx/commands';
9
+ export { post as postCommands } from '@xernerx/commands';
10
+
11
+ /** @format */
12
+
13
+ /**
14
+ * Posts either bot statistics (`StatsPayload`) or bot commands (`CommandsPayload`) to the Xernerx Suite API.
15
+ * @param data - Statistics payload or commands payload.
16
+ * @param token - Xernerx API bearer token.
17
+ * @param baseUrl - Optional custom API base URL.
18
+ */
19
+ declare function post(data: StatsPayload | CommandsPayload, token: string, baseUrl?: string): Promise<any>;
20
+
21
+ export { post };
package/dist/main.d.ts CHANGED
@@ -1,47 +1,21 @@
1
+ export * from '@xernerx/framework';
2
+ export * from '@xernerx/terminal';
3
+ export * from '@xernerx/websocket';
4
+ import { StatsPayload } from '@xernerx/stats';
5
+ export * from '@xernerx/stats';
6
+ export { BaseClient, BaseClientOptions, post as postStats } from '@xernerx/stats';
7
+ import { CommandsPayload } from '@xernerx/commands';
8
+ export * from '@xernerx/commands';
9
+ export { post as postCommands } from '@xernerx/commands';
10
+
1
11
  /** @format */
2
- declare const version: any;
3
- import XernerxClient from './client/XernerxClient.js';
4
- import XernerxShardClient from './client/XernerxShardClient.js';
5
- import XernerxMessageCommand from './build/XernerxMessageCommand.js';
6
- import XernerxSlashCommand from './build/XernerxSlashCommand.js';
7
- import XernerxContextCommand from './build/XernerxContextCommand.js';
8
- import XernerxEvent from './build/XernerxEvent.js';
9
- import XernerxInhibitor from './build/XernerxInhibitor.js';
10
- import XernerxLog from './tools/XernerxLog.js';
11
- export { XernerxIntents } from './tools/XernerxIntents.js';
12
- export * from 'discord.js';
13
- export * from 'dumfunctions';
14
- import Discord from 'discord.js';
15
- import XernerxExtension from 'xernerx-extension-builder';
16
- export * from './types/types.js';
17
- export * from './types/extenders.js';
18
- export * from './types/interfaces.js';
19
- export default XernerxClient;
20
- export {
21
- /**
22
- ** Clients
23
- */
24
- XernerxClient,
25
- XernerxShardClient,
26
- /**
27
- ** Builders
28
- */
29
- XernerxMessageCommand,
30
- XernerxSlashCommand,
31
- XernerxContextCommand,
32
- XernerxEvent,
33
- XernerxInhibitor,
34
- XernerxExtension,
35
- /**
36
- ** Imported exports
37
- */
38
- Discord,
39
- /**
40
- ** Properties
41
- */
42
- version,
43
- /**
44
- ** Tools
45
- */
46
- XernerxLog,
47
- };
12
+
13
+ /**
14
+ * Posts either bot statistics (`StatsPayload`) or bot commands (`CommandsPayload`) to the Xernerx Suite API.
15
+ * @param data - Statistics payload or commands payload.
16
+ * @param token - Xernerx API bearer token.
17
+ * @param baseUrl - Optional custom API base URL.
18
+ */
19
+ declare function post(data: StatsPayload | CommandsPayload, token: string, baseUrl?: string): Promise<any>;
20
+
21
+ export { post };
package/dist/main.js CHANGED
@@ -1,49 +1,23 @@
1
- /** @format */
2
- import * as fs from 'fs';
3
- const version = JSON.parse(fs.readFileSync('node_modules/xernerx/package.json', 'utf-8')).version;
4
- new XernerxLog(true).update(version, 'https://raw.githubusercontent.com/xernerx/xernerx/master/package.json');
5
- import XernerxClient from './client/XernerxClient.js';
6
- import XernerxShardClient from './client/XernerxShardClient.js';
7
- import XernerxMessageCommand from './build/XernerxMessageCommand.js';
8
- import XernerxSlashCommand from './build/XernerxSlashCommand.js';
9
- import XernerxContextCommand from './build/XernerxContextCommand.js';
10
- import XernerxEvent from './build/XernerxEvent.js';
11
- import XernerxInhibitor from './build/XernerxInhibitor.js';
12
- import XernerxLog from './tools/XernerxLog.js';
13
- export { XernerxIntents } from './tools/XernerxIntents.js';
14
- export * from 'discord.js';
15
- export * from 'dumfunctions';
16
- import Discord from 'discord.js';
17
- import XernerxExtension from 'xernerx-extension-builder';
18
- export * from './types/types.js';
19
- export * from './types/extenders.js';
20
- export * from './types/interfaces.js';
21
- export default XernerxClient;
22
- export {
23
- /**
24
- ** Clients
25
- */
26
- XernerxClient,
27
- XernerxShardClient,
28
- /**
29
- ** Builders
30
- */
31
- XernerxMessageCommand,
32
- XernerxSlashCommand,
33
- XernerxContextCommand,
34
- XernerxEvent,
35
- XernerxInhibitor,
36
- XernerxExtension,
37
- /**
38
- ** Imported exports
39
- */
40
- Discord,
41
- /**
42
- ** Properties
43
- */
44
- version,
45
- /**
46
- ** Tools
47
- */
48
- XernerxLog,
49
- };
1
+ export * from '@xernerx/framework';
2
+ export * from '@xernerx/terminal';
3
+ export * from '@xernerx/websocket';
4
+ import { post as post$2 } from '@xernerx/stats';
5
+ export * from '@xernerx/stats';
6
+ export { BaseClient, post as postStats } from '@xernerx/stats';
7
+ import { post as post$1 } from '@xernerx/commands';
8
+ export * from '@xernerx/commands';
9
+ export { post as postCommands } from '@xernerx/commands';
10
+
11
+ var __defProp = Object.defineProperty;
12
+ var __name = (target, value) => __defProp(target, "name", { value, configurable: true });
13
+ async function post(data, token, baseUrl) {
14
+ if (data && typeof data === "object" && "commands" in data) {
15
+ return post$1(data, token, baseUrl);
16
+ }
17
+ return post$2(data, token, baseUrl);
18
+ }
19
+ __name(post, "post");
20
+
21
+ export { post };
22
+ //# sourceMappingURL=main.js.map
23
+ //# sourceMappingURL=main.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/main.ts"],"names":["postCommands","postStats"],"mappings":";;;;;;;;;;;;AAoBA,eAAsB,IAAA,CAAK,IAAA,EAAsC,KAAA,EAAe,OAAA,EAAgC;AAC/G,EAAA,IAAI,IAAA,IAAQ,OAAO,IAAA,KAAS,QAAA,IAAY,cAAc,IAAA,EAAM;AAC3D,IAAA,OAAOA,MAAA,CAAa,IAAA,EAAM,KAAA,EAAO,OAAO,CAAA;AAAA,EACzC;AACA,EAAA,OAAOC,MAAA,CAAU,IAAA,EAAsB,KAAA,EAAO,OAAO,CAAA;AACtD;AALsB,MAAA,CAAA,IAAA,EAAA,MAAA,CAAA","file":"main.js","sourcesContent":["/** @format */\n// Re-exports all @xernerx/* packages\n\nexport * from '@xernerx/framework';\nexport * from '@xernerx/terminal';\nexport * from '@xernerx/websocket';\nexport * from '@xernerx/stats';\nexport * from '@xernerx/commands';\n\nimport { BaseClient, type BaseClientOptions, post as postStats, type StatsPayload } from '@xernerx/stats';\nimport { post as postCommands, type CommandsPayload } from '@xernerx/commands';\n\nexport { BaseClient, type BaseClientOptions, postStats, postCommands };\n\n/**\n * Posts either bot statistics (`StatsPayload`) or bot commands (`CommandsPayload`) to the Xernerx Suite API.\n * @param data - Statistics payload or commands payload.\n * @param token - Xernerx API bearer token.\n * @param baseUrl - Optional custom API base URL.\n */\nexport async function post(data: StatsPayload | CommandsPayload, token: string, baseUrl?: string): Promise<any> {\n\tif (data && typeof data === 'object' && 'commands' in data) {\n\t\treturn postCommands(data, token, baseUrl);\n\t}\n\treturn postStats(data as StatsPayload, token, baseUrl);\n}\n"]}
package/package.json CHANGED
@@ -1,59 +1,75 @@
1
1
  {
2
2
  "name": "xernerx",
3
- "version": "4.17.7",
4
- "description": "A bot framework for discord.js.",
5
- "main": "dist/main.js",
3
+ "publishConfig": {
4
+ "access": "public"
5
+ },
6
+ "version": "5.0.2",
6
7
  "type": "module",
7
- "keywords": [
8
- "discord.js",
9
- "discord",
10
- "framework",
11
- "mjs",
12
- "esm",
13
- "cjs",
14
- "ts"
8
+ "main": "./dist/main.cjs",
9
+ "module": "./dist/main.js",
10
+ "types": "./dist/main.d.ts",
11
+ "description": "The official all-in-one Xernerx Suite SDK and bot framework, re-exporting all @xernerx/* packages.",
12
+ "homepage": "www.xernerx.com",
13
+ "files": [
14
+ "src",
15
+ "dist"
15
16
  ],
16
- "author": "Dummi",
17
- "license": "MIT",
18
- "homepage": "https://xernerx.github.io/xernerx",
19
- "packageManager": "npm@8.5.5",
20
- "engines": {
21
- "node": ">=16.11.0"
17
+ "exports": {
18
+ "require": {
19
+ "types": "./dist/main.d.cts",
20
+ "default": "./dist/main.cjs"
21
+ },
22
+ "import": {
23
+ "types": "./dist/main.d.ts",
24
+ "default": "./dist/main.js"
25
+ }
22
26
  },
23
27
  "scripts": {
24
- "cover": "jest",
25
- "start": "npm i && npm fund && npm audit fix --force && npm link && tsc -w",
26
- "commit": "npm run write && git add . && node ./.github/scripts/message.js",
27
- "tag": "node ./.github/scripts/tag.js",
28
- "patch": "npm run commit && npm version patch && npm run tag && npm publish && git push",
29
- "minor": "npm run commit && npm version minor && npm run tag && npm publish && git push",
30
- "major": "npm run commit && npm version major && npm run tag && npm publish && git push",
31
- "site": "git add docs && npm run commit && git push",
32
- "write": "npm i && npm run build && npm run format",
33
- "format": "npx prettier --write src dist",
34
- "build": "npm run build:esm && npm run format",
35
- "build:esm": "tsc",
36
- "build:cjs": "tsc --module CommonJS --outDir dist/cjs"
37
- },
38
- "repository": {
39
- "type": "git",
40
- "url": "git+https://github.com/xernerx/xernerx.git"
41
- },
42
- "bugs": {
43
- "url": "https://github.com/xernerx/xernerx/issues"
28
+ "commit": "prettier --write . && node -e \"const fs=require('fs'),cp=require('child_process');const has=fs.readdirSync('.changeset').some(f=>f.endsWith('.md')&&f.toLowerCase()!=='readme.md');cp.execSync(!process.stdin.isTTY&&has?'pnpm exec changeset status':'pnpm exec changeset',{stdio:'inherit'})\"",
29
+ "ship": "changeset version && pnpm run build && git add . && git commit -m \"chore: release\" && changeset tag && git push --follow-tags",
30
+ "docs": "typedoc",
31
+ "build": "pnpm i && tsup && attw --pack && pnpm run docs",
32
+ "dev": "pnpm i && pnpm link && tsup --watch",
33
+ "test": "pnpm install --engine-strict=true"
44
34
  },
35
+ "keywords": [
36
+ "xernerx",
37
+ "framework",
38
+ "commands",
39
+ "stats",
40
+ "terminal",
41
+ "websocket"
42
+ ],
43
+ "author": "Xernerx Studios",
44
+ "license": "MIT",
45
+ "packageManager": "pnpm@11.24.0",
45
46
  "dependencies": {
46
- "@clack/prompts": "^0.7.0",
47
- "dbl-sdk": "^2.0.3",
48
- "discord.js": "^14.14.1",
49
- "dumfunctions": "^2.1.6",
50
- "xernerx-extension-builder": "0.0.16",
51
- "zod": "^3.22.4"
47
+ "@xernerx/commands": "^0.2.3",
48
+ "@xernerx/framework": "^1.0.3",
49
+ "@xernerx/stats": "^1.0.12",
50
+ "@xernerx/terminal": "^1.1.14",
51
+ "@xernerx/websocket": "^0.4.15"
52
+ },
53
+ "peerDependencies": {
54
+ "@discordjs/core": ">=2.0.0",
55
+ "discord.js": ">=14.0.0"
52
56
  },
53
57
  "devDependencies": {
54
- "jest": "^29.7.0",
55
- "prettier": "3.0.0",
56
- "ts-node": "^10.9.2",
57
- "typescript": "^5.5.2"
58
+ "@arethetypeswrong/cli": "^0.18.2",
59
+ "@changesets/cli": "^3.0.1",
60
+ "@discordjs/core": "2.2.2",
61
+ "@types/node": "^24",
62
+ "discord.js": "14.22.1",
63
+ "prettier": "^3.8.3",
64
+ "tslib": "^2.8.1",
65
+ "tsup": "^8.5.1",
66
+ "typedoc": "^0.28.20",
67
+ "typedoc-github-theme": "^0.4.0",
68
+ "typedoc-plugin-extras": "^4.0.1",
69
+ "typedoc-plugin-zod": "^1.4.3",
70
+ "typescript": "^6.0.3"
71
+ },
72
+ "engines": {
73
+ "node": ">=24"
58
74
  }
59
75
  }
package/src/main.ts ADDED
@@ -0,0 +1,26 @@
1
+ /** @format */
2
+ // Re-exports all @xernerx/* packages
3
+
4
+ export * from '@xernerx/framework';
5
+ export * from '@xernerx/terminal';
6
+ export * from '@xernerx/websocket';
7
+ export * from '@xernerx/stats';
8
+ export * from '@xernerx/commands';
9
+
10
+ import { BaseClient, type BaseClientOptions, post as postStats, type StatsPayload } from '@xernerx/stats';
11
+ import { post as postCommands, type CommandsPayload } from '@xernerx/commands';
12
+
13
+ export { BaseClient, type BaseClientOptions, postStats, postCommands };
14
+
15
+ /**
16
+ * Posts either bot statistics (`StatsPayload`) or bot commands (`CommandsPayload`) to the Xernerx Suite API.
17
+ * @param data - Statistics payload or commands payload.
18
+ * @param token - Xernerx API bearer token.
19
+ * @param baseUrl - Optional custom API base URL.
20
+ */
21
+ export async function post(data: StatsPayload | CommandsPayload, token: string, baseUrl?: string): Promise<any> {
22
+ if (data && typeof data === 'object' && 'commands' in data) {
23
+ return postCommands(data, token, baseUrl);
24
+ }
25
+ return postStats(data as StatsPayload, token, baseUrl);
26
+ }
@@ -1,82 +0,0 @@
1
- /** @format */
2
- import { ContextMenuCommandBuilder } from 'discord.js';
3
- import { XernerxMessageContextInteraction, XernerxUserContextInteraction, XernerxClientType } from '../types/extenders.js';
4
- import { ContextCommandArguments, ContextCommandOptions } from '../types/interfaces.js';
5
- import InteractionUtil from '../utils/InteractionUtil.js';
6
- export default class XernerxContextCommand {
7
- readonly id: string;
8
- readonly data: ContextMenuCommandBuilder;
9
- readonly name: string;
10
- readonly type: 'user' | 'message';
11
- readonly description: string | null | undefined;
12
- readonly usage: string | null | undefined;
13
- readonly info: string | null | undefined;
14
- readonly category: string | null | undefined;
15
- readonly cooldown: number | null | undefined;
16
- readonly channel:
17
- | (
18
- | 'GuildText'
19
- | 'DM'
20
- | 'GuildVoice'
21
- | 'GroupDM'
22
- | 'GuildCategory'
23
- | 'GuildAnnouncement'
24
- | 'AnnouncementThread'
25
- | 'PublicThread'
26
- | 'PrivateThread'
27
- | 'GuildStageVoice'
28
- | 'GuildDirectory'
29
- | 'GuildForum'
30
- | 'GuildMedia'
31
- | 'GuildNews'
32
- | 'GuildNewsThread'
33
- | 'GuildPublicThread'
34
- | 'GuildPrivateThread'
35
- )[]
36
- | null;
37
- readonly global: boolean | undefined;
38
- readonly ignore:
39
- | {
40
- owner?: boolean;
41
- users?: Array<string>;
42
- channels?: Array<string>;
43
- guilds?: Array<string>;
44
- voice?: boolean;
45
- }
46
- | undefined;
47
- readonly strict:
48
- | {
49
- owner?: boolean;
50
- users?: Array<string>;
51
- channels?: Array<string>;
52
- guilds?: Array<string>;
53
- voice?: boolean;
54
- }
55
- | undefined;
56
- readonly permissions:
57
- | {
58
- user?: Array<import('../main.js').PermissionNames> | Array<string> | null;
59
- client?: Array<import('../main.js').PermissionNames> | Array<string> | null;
60
- dm?: boolean;
61
- }
62
- | undefined;
63
- readonly defer:
64
- | {
65
- reply?: boolean;
66
- ephemeral?: boolean;
67
- fetchReply?: boolean;
68
- }
69
- | undefined;
70
- readonly filetype: 'ContextCommand';
71
- readonly filepath: string;
72
- readonly client: XernerxClientType;
73
- util: InteractionUtil;
74
- snowflake: string | null;
75
- constructor(id: string, options: ContextCommandOptions);
76
- /**
77
- * @description the execution of the command
78
- * @param interaction - Interaction event emitted on command
79
- * @param args - The arguments parsed with the command, if any
80
- */
81
- exec<T = void>(interaction: XernerxUserContextInteraction | XernerxMessageContextInteraction, args: ContextCommandArguments<'user' | 'message'>): Promise<void | any | T>;
82
- }