@buape/carbon 0.6.1 → 0.7.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.
Files changed (53) hide show
  1. package/dist/package.json +6 -6
  2. package/dist/src/abstracts/BaseCommand.d.ts +6 -3
  3. package/dist/src/abstracts/BaseCommand.d.ts.map +1 -1
  4. package/dist/src/abstracts/BaseCommand.js +17 -4
  5. package/dist/src/abstracts/BaseCommand.js.map +1 -1
  6. package/dist/src/abstracts/Plugin.d.ts +32 -1
  7. package/dist/src/abstracts/Plugin.d.ts.map +1 -1
  8. package/dist/src/abstracts/Plugin.js +3 -1
  9. package/dist/src/abstracts/Plugin.js.map +1 -1
  10. package/dist/src/adapters/bun/index.d.ts +8 -12
  11. package/dist/src/adapters/bun/index.d.ts.map +1 -1
  12. package/dist/src/adapters/bun/index.js +9 -13
  13. package/dist/src/adapters/bun/index.js.map +1 -1
  14. package/dist/src/adapters/fetch/index.d.ts +10 -0
  15. package/dist/src/adapters/fetch/index.d.ts.map +1 -0
  16. package/dist/src/adapters/fetch/index.js +45 -0
  17. package/dist/src/adapters/fetch/index.js.map +1 -0
  18. package/dist/src/adapters/node/index.d.ts +8 -12
  19. package/dist/src/adapters/node/index.d.ts.map +1 -1
  20. package/dist/src/adapters/node/index.js +10 -13
  21. package/dist/src/adapters/node/index.js.map +1 -1
  22. package/dist/src/classes/Client.d.ts +44 -6
  23. package/dist/src/classes/Client.d.ts.map +1 -1
  24. package/dist/src/classes/Client.js +59 -11
  25. package/dist/src/classes/Client.js.map +1 -1
  26. package/dist/src/classes/Listener.d.ts +8 -0
  27. package/dist/src/classes/Listener.d.ts.map +1 -0
  28. package/dist/src/classes/Listener.js +3 -0
  29. package/dist/src/classes/Listener.js.map +1 -0
  30. package/dist/src/index.d.ts +53 -3
  31. package/dist/src/index.d.ts.map +1 -1
  32. package/dist/src/index.js +4 -3
  33. package/dist/src/index.js.map +1 -1
  34. package/dist/src/internals/EventHandler.d.ts +9 -0
  35. package/dist/src/internals/EventHandler.d.ts.map +1 -0
  36. package/dist/src/internals/EventHandler.js +16 -0
  37. package/dist/src/internals/EventHandler.js.map +1 -0
  38. package/dist/src/plugins/linked-roles/LinkedRoles.d.ts +23 -27
  39. package/dist/src/plugins/linked-roles/LinkedRoles.d.ts.map +1 -1
  40. package/dist/src/plugins/linked-roles/LinkedRoles.js +36 -28
  41. package/dist/src/plugins/linked-roles/LinkedRoles.js.map +1 -1
  42. package/dist/src/types/messagePayload.d.ts +37 -0
  43. package/dist/src/types/messagePayload.d.ts.map +1 -0
  44. package/dist/src/types/messagePayload.js +2 -0
  45. package/dist/src/types/messagePayload.js.map +1 -0
  46. package/dist/src/types.d.ts +2 -1
  47. package/dist/src/types.d.ts.map +1 -1
  48. package/dist/src/utils.d.ts +6 -1
  49. package/dist/src/utils.d.ts.map +1 -1
  50. package/dist/src/utils.js +1 -0
  51. package/dist/src/utils.js.map +1 -1
  52. package/dist/tsconfig.tsbuildinfo +1 -1
  53. package/package.json +6 -6
package/dist/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@buape/carbon",
3
- "version": "0.6.1",
3
+ "version": "0.7.0",
4
4
  "type": "module",
5
5
  "main": "./dist/src/index.js",
6
6
  "repository": "github:buape/carbon",
@@ -26,13 +26,13 @@
26
26
  "license": "MIT",
27
27
  "dependencies": {
28
28
  "@buape/carbon-request": "workspace:*",
29
- "@types/node": "^20",
30
- "discord-api-types": "0.37.102"
29
+ "@types/node": "^22.10.7",
30
+ "discord-api-types": "0.37.117"
31
31
  },
32
32
  "optionalDependencies": {
33
- "@cloudflare/workers-types": "4.20241018.0",
34
- "@hono/node-server": "1.13.2",
35
- "@types/bun": "1.1.11"
33
+ "@cloudflare/workers-types": "4.20250121.0",
34
+ "@hono/node-server": "1.13.7",
35
+ "@types/bun": "1.1.18"
36
36
  },
37
37
  "files": [
38
38
  "dist",
@@ -1,5 +1,5 @@
1
1
  import { ApplicationCommandType, type RESTPostAPIApplicationCommandsJSONBody } from "discord-api-types/v10";
2
- import { ApplicationIntegrationType, type BaseComponent, InteractionContextType, type Modal } from "../index.js";
2
+ import { ApplicationIntegrationType, type ArrayOrSingle, type BaseComponent, InteractionContextType, type Modal, type Permission } from "../index.js";
3
3
  /**
4
4
  * Represents the base data of a command that the user creates
5
5
  */
@@ -26,14 +26,17 @@ export declare abstract class BaseCommand {
26
26
  abstract type: ApplicationCommandType;
27
27
  /**
28
28
  * The places this command can be used in
29
- * @beta API types are not finalized
30
29
  */
31
30
  integrationTypes: ApplicationIntegrationType[];
32
31
  /**
33
32
  * The contexts this command can be used in
34
- * @beta API types are not finalized
35
33
  */
36
34
  contexts: InteractionContextType[];
35
+ /**
36
+ * The default permission that a user needs to have to use this command.
37
+ * This can be overridden by server admins.
38
+ */
39
+ permission?: ArrayOrSingle<(typeof Permission)[keyof typeof Permission]>;
37
40
  /**
38
41
  * The components that the command is able to use.
39
42
  * You pass these here so the handler can listen for them..
@@ -1 +1 @@
1
- {"version":3,"file":"BaseCommand.d.ts","sourceRoot":"","sources":["../../../src/abstracts/BaseCommand.ts"],"names":[],"mappings":"AAAA,OAAO,EACN,sBAAsB,EACtB,KAAK,sCAAsC,EAC3C,MAAM,uBAAuB,CAAA;AAC9B,OAAO,EACN,0BAA0B,EAC1B,KAAK,aAAa,EAClB,sBAAsB,EACtB,KAAK,KAAK,EACV,MAAM,aAAa,CAAA;AAEpB;;GAEG;AACH,8BAAsB,WAAW;IAChC;;OAEG;IACH,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAA;IACrB;;OAEG;IACH,QAAQ,CAAC,WAAW,EAAE,MAAM,CAAA;IAC5B;;OAEG;IACH,KAAK,UAAQ;IACb;;OAEG;IACH,SAAS,UAAQ;IACjB;;OAEG;IACH,QAAQ,CAAC,IAAI,EAAE,sBAAsB,CAAA;IACrC;;;OAGG;IACH,gBAAgB,EAAE,0BAA0B,EAAE,CAG7C;IACD;;;OAGG;IACH,QAAQ,EAAE,sBAA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CAAC,gBAAgB,IAAI,sCAAsC,CAAC,SAAS,CAAC;CAC9E"}
@@ -14,7 +14,6 @@ export class BaseCommand {
14
14
  ephemeral = false;
15
15
  /**
16
16
  * The places this command can be used in
17
- * @beta API types are not finalized
18
17
  */
19
18
  integrationTypes = [
20
19
  ApplicationIntegrationType.GuildInstall,
@@ -22,13 +21,17 @@ export class BaseCommand {
22
21
  ];
23
22
  /**
24
23
  * The contexts this command can be used in
25
- * @beta API types are not finalized
26
24
  */
27
25
  contexts = [
28
26
  InteractionContextType.Guild,
29
27
  InteractionContextType.BotDM,
30
28
  InteractionContextType.PrivateChannel
31
29
  ];
30
+ /**
31
+ * The default permission that a user needs to have to use this command.
32
+ * This can be overridden by server admins.
33
+ */
34
+ permission;
32
35
  /**
33
36
  * The components that the command is able to use.
34
37
  * You pass these here so the handler can listen for them..
@@ -55,7 +58,12 @@ export class BaseCommand {
55
58
  description: this.description,
56
59
  options: this.serializeOptions(),
57
60
  integration_types: this.integrationTypes,
58
- contexts: this.contexts
61
+ contexts: this.contexts,
62
+ default_member_permissions: Array.isArray(this.permission)
63
+ ? this.permission.reduce((a, p) => a | p, 0n).toString()
64
+ : this.permission
65
+ ? `${this.permission}`
66
+ : null
59
67
  };
60
68
  return data;
61
69
  }
@@ -64,7 +72,12 @@ export class BaseCommand {
64
72
  type: this.type,
65
73
  options: this.serializeOptions(),
66
74
  integration_types: this.integrationTypes,
67
- contexts: this.contexts
75
+ contexts: this.contexts,
76
+ default_member_permissions: Array.isArray(this.permission)
77
+ ? this.permission.reduce((a, p) => a | p, 0n).toString()
78
+ : this.permission
79
+ ? `${this.permission}`
80
+ : null
68
81
  };
69
82
  return data;
70
83
  }
@@ -1 +1 @@
1
- {"version":3,"file":"BaseCommand.js","sourceRoot":"","sources":["../../../src/abstracts/BaseCommand.ts"],"names":[],"mappings":"AAAA,OAAO,EACN,sBAAsB,EAEtB,MAAM,uBAAuB,CAAA;AAC9B,OAAO,EACN,0BAA0B,EAE1B,sBAAs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;gBACvB,0BAA0B,EAAE,KAAK,CAAC,OAAO,CAAC,IAAI,CAAC,UAAU,CAAC;oBACzD,CAAC,CAAC,IAAI,CAAC,UAAU,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC,CAAC,GAAG,CAAC,EAAE,EAAE,CAAC,CAAC,QAAQ,EAAE;oBACxD,CAAC,CAAC,IAAI,CAAC,UAAU;wBAChB,CAAC,CAAC,GAAG,IAAI,CAAC,UAAU,EAAE;wBACtB,CAAC,CAAC,IAAI;aACR,CAAA;YAED,OAAO,IAAI,CAAA;QACZ,CAAC;QACD,MAAM,IAAI,GAA2C;YACpD,IAAI,EAAE,IAAI,CAAC,IAAI;YACf,IAAI,EAAE,IAAI,CAAC,IAAI;YACf,OAAO,EAAE,IAAI,CAAC,gBAAgB,EAAE;YAChC,iBAAiB,EAAE,IAAI,CAAC,gBAAgB;YACxC,QAAQ,EAAE,IAAI,CAAC,QAAQ;YACvB,0BAA0B,EAAE,KAAK,CAAC,OAAO,CAAC,IAAI,CAAC,UAAU,CAAC;gBACzD,CAAC,CAAC,IAAI,CAAC,UAAU,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC,CAAC,GAAG,CAAC,EAAE,EAAE,CAAC,CAAC,QAAQ,EAAE;gBACxD,CAAC,CAAC,IAAI,CAAC,UAAU;oBAChB,CAAC,CAAC,GAAG,IAAI,CAAC,UAAU,EAAE;oBACtB,CAAC,CAAC,IAAI;SACR,CAAA;QAED,OAAO,IAAI,CAAA;IACZ,CAAC;CAOD"}
@@ -1,11 +1,42 @@
1
+ import type { Client } from "../classes/Client.js";
2
+ /**
3
+ * The base class for all plugins
4
+ */
1
5
  export declare abstract class Plugin {
2
- routes: Route[];
6
+ /**
7
+ * Registers the client with this plugin
8
+ * @param client The client to register
9
+ */
10
+ registerClient?(client: Client): void;
11
+ /**
12
+ * Registers the routes of this plugin with the client
13
+ * @param client The client to register the routes with
14
+ */
15
+ registerRoutes?(client: Client): void;
3
16
  }
4
17
  export interface Route {
18
+ /**
19
+ * The HTTP method of the route
20
+ */
5
21
  method: "GET" | "POST" | "PUT" | "PATCH" | "DELETE";
22
+ /**
23
+ * The relative path of the route
24
+ */
6
25
  path: `/${string}`;
26
+ /**
27
+ * The handler function for the route
28
+ * @param req The request object
29
+ * @param ctx The context object
30
+ * @returns The response object or a promise that resolves to a response object
31
+ */
7
32
  handler(req: Request, ctx?: Context): Response | Promise<Response>;
33
+ /**
34
+ * Whether this route requires authentication
35
+ */
8
36
  protected?: boolean;
37
+ /**
38
+ * Whether this route is disabled
39
+ */
9
40
  disabled?: boolean;
10
41
  }
11
42
  export interface Context {
@@ -1 +1 @@
1
- {"version":3,"file":"Plugin.d.ts","sourceRoot":"","sources":["../../../src/abstracts/Plugin.ts"],"names":[],"mappings":"AAAA,8BAAsB,MAAM;IAC3B,MAAM,EAAE,KAAK,EAAE,CAAK;CACpB;AAED,MAAM,WAAW,KAAK;IACrB,MAAM,EAAE,KAAK,GAAG,MAAM,GAAG,KAAK,GAAG,OAAO,GAAG,QAAQ,CAAA;IACnD,IAAI,EAAE,IAAI,MAAM,EAAE,CAAA;IAClB,OAAO,CAAC,GAAG,EAAE,OAAO,EAAE,GAAG,CAAC,EAAE,OAAO,GAAG,QAAQ,GAAG,OAAO,CAAC,QAAQ,CAAC,CAAA;IAClE,SAAS,CAAC,EAAE,OAAO,CAAA;IACnB,QAAQ,CAAC,EAAE,OAAO,CAAA;CAClB;AAED,MAAM,WAAW,OAAO;IAEvB,SAAS,CAAC,CAAC,OAAO,EAAE,OAAO,CAAC,GAAG,CAAC,GAAG,IAAI,CAAA;CACvC"}
1
+ {"version":3,"file":"Plugin.d.ts","sourceRoot":"","sources":["../../../src/abstracts/Plugin.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,sBAAsB,CAAA;AAElD;;GAEG;AACH,8BAAsB,MAAM;IAC3B;;;OAGG;IACH,cAAc,CAAC,CAAC,MAAM,EAAE,MAAM,GAAG,IAAI;IAErC;;;OAGG;IACH,cAAc,CAAC,CAAC,MAAM,EAAE,MAAM,GAAG,IAAI;CACrC;AAED,MAAM,WAAW,KAAK;IACrB;;OAEG;IACH,MAAM,EAAE,KAAK,GAAG,MAAM,GAAG,KAAK,GAAG,OAAO,GAAG,QAAQ,CAAA;IAEnD;;OAEG;IACH,IAAI,EAAE,IAAI,MAAM,EAAE,CAAA;IAElB;;;;;OAKG;IACH,OAAO,CAAC,GAAG,EAAE,OAAO,EAAE,GAAG,CAAC,EAAE,OAAO,GAAG,QAAQ,GAAG,OAAO,CAAC,QAAQ,CAAC,CAAA;IAElE;;OAEG;IACH,SAAS,CAAC,EAAE,OAAO,CAAA;IAEnB;;OAEG;IACH,QAAQ,CAAC,EAAE,OAAO,CAAA;CAClB;AAED,MAAM,WAAW,OAAO;IAEvB,SAAS,CAAC,CAAC,OAAO,EAAE,OAAO,CAAC,GAAG,CAAC,GAAG,IAAI,CAAA;CACvC"}
@@ -1,4 +1,6 @@
1
+ /**
2
+ * The base class for all plugins
3
+ */
1
4
  export class Plugin {
2
- routes = [];
3
5
  }
4
6
  //# sourceMappingURL=Plugin.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"Plugin.js","sourceRoot":"","sources":["../../../src/abstracts/Plugin.ts"],"names":[],"mappings":"AAAA,MAAM,OAAgB,MAAM;IAC3B,MAAM,GAAY,EAAE,CAAA;CACpB"}
1
+ {"version":3,"file":"Plugin.js","sourceRoot":"","sources":["../../../src/abstracts/Plugin.ts"],"names":[],"mappings":"AAEA;;GAEG;AACH,MAAM,OAAgB,MAAM;CAY3B"}
@@ -1,16 +1,12 @@
1
1
  import Bun from "bun";
2
- import type { Handle } from "../../createHandle.js";
3
- import type { ServerOptions } from "../shared.js";
4
- export type Server = ReturnType<typeof Bun.serve>;
2
+ import type { Client } from "../../index.js";
3
+ export type Server = Bun.Server;
4
+ export type ServerOptions = Omit<Bun.ServeOptions, "fetch">;
5
5
  /**
6
- * Creates a Bun server using the provided handle function and options
7
- * @param handle The handle function created by {@link createHandle}
8
- * @param options The server options including the port and hostname
9
- * @returns The created server instance
10
- * @example
11
- * ```ts
12
- * const server = createServer(handle, { ... })
13
- * ```
6
+ * Creates a server for the client using Bun.serve
7
+ * @param client The Carbon client to create the server for
8
+ * @param options Additional options for the server
9
+ * @returns The Bun.Server instance
14
10
  */
15
- export declare function createServer(handle: Handle, options: ServerOptions): Server;
11
+ export declare function createServer(client: Client, options: ServerOptions): Server;
16
12
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/adapters/bun/index.ts"],"names":[],"mappings":"AAAA,OAAO,GAAG,MAAM,KAAK,CAAA;AACrB,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,uBAAuB,CAAA;AACnD,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,cAAc,CAAA;AAEjD,MAAM,MAAM,MAAM,GAAG,UAAU,CAAC,OAAO,GAAG,CAAC,KAAK,CAAC,CAAA;AAEjD;;;;;;;;;GASG;AACH,wBAAgB,YAAY,CAAC,MAAM,EAAE,MAAM,EAAE,OAAO,EAAE,aAAa,GAAG,MAAM,CAO3E"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/adapters/bun/index.ts"],"names":[],"mappings":"AAAA,OAAO,GAAG,MAAM,KAAK,CAAA;AACrB,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,gBAAgB,CAAA;AAG5C,MAAM,MAAM,MAAM,GAAG,GAAG,CAAC,MAAM,CAAA;AAC/B,MAAM,MAAM,aAAa,GAAG,IAAI,CAAC,GAAG,CAAC,YAAY,EAAE,OAAO,CAAC,CAAA;AAE3D;;;;;GAKG;AACH,wBAAgB,YAAY,CAAC,MAAM,EAAE,MAAM,EAAE,OAAO,EAAE,aAAa,GAAG,MAAM,CAM3E"}
@@ -1,20 +1,16 @@
1
1
  import Bun from "bun";
2
+ import { createHandler } from "../fetch/index.js";
2
3
  /**
3
- * Creates a Bun server using the provided handle function and options
4
- * @param handle The handle function created by {@link createHandle}
5
- * @param options The server options including the port and hostname
6
- * @returns The created server instance
7
- * @example
8
- * ```ts
9
- * const server = createServer(handle, { ... })
10
- * ```
4
+ * Creates a server for the client using Bun.serve
5
+ * @param client The Carbon client to create the server for
6
+ * @param options Additional options for the server
7
+ * @returns The Bun.Server instance
11
8
  */
12
- export function createServer(handle, options) {
13
- const fetch = handle(process.env);
9
+ export function createServer(client, options) {
10
+ const fetch = createHandler(client);
14
11
  return Bun.serve({
15
- fetch: (req) => fetch(req, {}),
16
- port: options.port,
17
- hostname: options.hostname
12
+ ...options,
13
+ fetch: (r) => fetch(r, {})
18
14
  });
19
15
  }
20
16
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/adapters/bun/index.ts"],"names":[],"mappings":"AAAA,OAAO,GAAG,MAAM,KAAK,CAAA;AAMrB;;;;;;;;;GASG;AACH,MAAM,UAAU,YAAY,CAAC,MAAc,EAAE,OAAsB;IAClE,MAAM,KAAK,GAAG,MAAM,CAAC,OAAO,CAAC,GAAG,CAAC,CAAA;IACjC,OAAO,GAAG,CAAC,KAAK,CAAC;QAChB,KAAK,EAAE,CAAC,GAAG,EAAE,EAAE,CAAC,KAAK,CAAC,GAAG,EAAE,EAAE,CAAC;QAC9B,IAAI,EAAE,OAAO,CAAC,IAAI;QAClB,QAAQ,EAAE,OAAO,CAAC,QAAQ;KAC1B,CAAC,CAAA;AACH,CAAC"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/adapters/bun/index.ts"],"names":[],"mappings":"AAAA,OAAO,GAAG,MAAM,KAAK,CAAA;AAErB,OAAO,EAAE,aAAa,EAAE,MAAM,mBAAmB,CAAA;AAKjD;;;;;GAKG;AACH,MAAM,UAAU,YAAY,CAAC,MAAc,EAAE,OAAsB;IAClE,MAAM,KAAK,GAAG,aAAa,CAAC,MAAM,CAAC,CAAA;IACnC,OAAO,GAAG,CAAC,KAAK,CAAC;QAChB,GAAG,OAAO;QACV,KAAK,EAAE,CAAC,CAAC,EAAE,EAAE,CAAC,KAAK,CAAC,CAAC,EAAE,EAAE,CAAC;KAC1B,CAAC,CAAA;AACH,CAAC"}
@@ -0,0 +1,10 @@
1
+ import type { Context } from "../../abstracts/Plugin.js";
2
+ import type { Client } from "../../classes/Client.js";
3
+ export type Handler = (req: Request, ctx: Context) => Promise<Response>;
4
+ /**
5
+ * Creates a fetch handler function for the clients routes
6
+ * @param client The client to create the handler for
7
+ * @returns The handler function
8
+ */
9
+ export declare function createHandler(client: Client): Handler;
10
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/adapters/fetch/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAS,MAAM,2BAA2B,CAAA;AAC/D,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,yBAAyB,CAAA;AAErD,MAAM,MAAM,OAAO,GAAG,CAAC,GAAG,EAAE,OAAO,EAAE,GAAG,EAAE,OAAO,KAAK,OAAO,CAAC,QAAQ,CAAC,CAAA;AAEvE;;;;GAIG;AACH,wBAAgB,aAAa,CAAC,MAAM,EAAE,MAAM,GAAG,OAAO,CAiCrD"}
@@ -0,0 +1,45 @@
1
+ /**
2
+ * Creates a fetch handler function for the clients routes
3
+ * @param client The client to create the handler for
4
+ * @returns The handler function
5
+ */
6
+ export function createHandler(client) {
7
+ return async (req, ctx) => {
8
+ const method = req.method;
9
+ const url = new URL(req.url, "http://localhost");
10
+ const pathname = //
11
+ resolveRequestPathname(new URL(client.options.baseUrl), url);
12
+ if (!pathname)
13
+ return new Response("Not Found", { status: 404 });
14
+ const matchedRoutesByPath = //
15
+ client.routes.filter((r) => r.path === pathname && !r.disabled);
16
+ const matchedRoutesByMethod = //
17
+ matchedRoutesByPath.filter((r) => r.method === method);
18
+ if (matchedRoutesByMethod.length === 0) {
19
+ if (matchedRoutesByPath.length > 0)
20
+ return new Response("Method Not Allowed", { status: 405 });
21
+ return new Response("Not Found", { status: 404 });
22
+ }
23
+ // Use the last matched route to allow for overriding
24
+ const route = matchedRoutesByMethod.at(-1);
25
+ const passedSecret = url.searchParams.get("secret");
26
+ if (route.protected && client.options.deploySecret !== passedSecret)
27
+ return new Response("Unauthorized", { status: 401 });
28
+ try {
29
+ return await route.handler(req, ctx);
30
+ }
31
+ catch (error) {
32
+ console.error(error);
33
+ return new Response("Internal Server Error", { status: 500 });
34
+ }
35
+ };
36
+ }
37
+ function resolveRequestPathname(baseUrl, reqUrl) {
38
+ // Need to use pathname only due to host name being different in Cloudflare Tunnel
39
+ const basePathname = baseUrl.pathname.replace(/\/$/, "");
40
+ const reqPathname = reqUrl.pathname.replace(/\/$/, "");
41
+ if (!reqPathname.startsWith(basePathname))
42
+ return null;
43
+ return reqPathname.slice(basePathname.length);
44
+ }
45
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/adapters/fetch/index.ts"],"names":[],"mappings":"AAKA;;;;GAIG;AACH,MAAM,UAAU,aAAa,CAAC,MAAc;IAC3C,OAAO,KAAK,EAAE,GAAY,EAAE,GAAY,EAAE,EAAE;QAC3C,MAAM,MAAM,GAAG,GAAG,CAAC,MAAM,CAAA;QACzB,MAAM,GAAG,GAAG,IAAI,GAAG,CAAC,GAAG,CAAC,GAAG,EAAE,kBAAkB,CAAC,CAAA;QAChD,MAAM,QAAQ,GAAG,EAAE;SAClB,sBAAsB,CAAC,IAAI,GAAG,CAAC,MAAM,CAAC,OAAO,CAAC,OAAO,CAAC,EAAE,GAAG,CAAC,CAAA;QAC7D,IAAI,CAAC,QAAQ;YAAE,OAAO,IAAI,QAAQ,CAAC,WAAW,EAAE,EAAE,MAAM,EAAE,GAAG,EAA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CAAC;IACF,CAAC,CAAA;AACF,CAAC;AAED,SAAS,sBAAsB,CAAC,OAAY,EAAE,MAAW;IACxD,kFAAkF;IAClF,MAAM,YAAY,GAAG,OAAO,CAAC,QAAQ,CAAC,OAAO,CAAC,KAAK,EAAE,EAAE,CAAC,CAAA;IACxD,MAAM,WAAW,GAAG,MAAM,CAAC,QAAQ,CAAC,OAAO,CAAC,KAAK,EAAE,EAAE,CAAC,CAAA;IACtD,IAAI,CAAC,WAAW,CAAC,UAAU,CAAC,YAAY,CAAC;QAAE,OAAO,IAAI,CAAA;IACtD,OAAO,WAAW,CAAC,KAAK,CAAC,YAAY,CAAC,MAAM,CAAC,CAAA;AAC9C,CAAC"}
@@ -1,16 +1,12 @@
1
1
  import * as Hono from "@hono/node-server";
2
- import type { Handle } from "../../createHandle.js";
3
- import type { ServerOptions } from "../shared.js";
4
- export type Server = ReturnType<typeof Hono.serve>;
2
+ import type { Client } from "../../index.js";
3
+ export type Server = Hono.ServerType;
4
+ export type ServerOptions = Omit<Parameters<typeof Hono.serve>[0], "fetch">;
5
5
  /**
6
- * Creates a Node.js server using the provided handle function and options
7
- * @param handle The handle function created by {@link createHandle}
8
- * @param options The server options including the port and hostname
9
- * @returns The created server instance
10
- * @example
11
- * ```ts
12
- * const server = createServer(handle, { ... })
13
- * ```
6
+ * Creates a server for the client using Hono.serve under the hood
7
+ * @param client The Carbon client to create the server for
8
+ * @param options Additional options for the server
9
+ * @returns The server instance
14
10
  */
15
- export declare function createServer(handle: Handle, options: ServerOptions): Server;
11
+ export declare function createServer(client: Client, options: ServerOptions): Server;
16
12
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/adapters/node/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,IAAI,MAAM,mBAAmB,CAAA;AACzC,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,uBAAuB,CAAA;AACnD,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,cAAc,CAAA;AAEjD,MAAM,MAAM,MAAM,GAAG,UAAU,CAAC,OAAO,IAAI,CAAC,KAAK,CAAC,CAAA;AAElD;;;;;;;;;GASG;AACH,wBAAgB,YAAY,CAAC,MAAM,EAAE,MAAM,EAAE,OAAO,EAAE,aAAa,GAAG,MAAM,CAO3E"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/adapters/node/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,IAAI,MAAM,mBAAmB,CAAA;AACzC,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,gBAAgB,CAAA;AAG5C,MAAM,MAAM,MAAM,GAAG,IAAI,CAAC,UAAU,CAAA;AACpC,MAAM,MAAM,aAAa,GAAG,IAAI,CAAC,UAAU,CAAC,OAAO,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,EAAE,OAAO,CAAC,CAAA;AAE3E;;;;;GAKG;AACH,wBAAgB,YAAY,CAAC,MAAM,EAAE,MAAM,EAAE,OAAO,EAAE,aAAa,GAAG,MAAM,CAO3E"}
@@ -1,20 +1,17 @@
1
1
  import * as Hono from "@hono/node-server";
2
+ import { createHandler } from "../fetch/index.js";
2
3
  /**
3
- * Creates a Node.js server using the provided handle function and options
4
- * @param handle The handle function created by {@link createHandle}
5
- * @param options The server options including the port and hostname
6
- * @returns The created server instance
7
- * @example
8
- * ```ts
9
- * const server = createServer(handle, { ... })
10
- * ```
4
+ * Creates a server for the client using Hono.serve under the hood
5
+ * @param client The Carbon client to create the server for
6
+ * @param options Additional options for the server
7
+ * @returns The server instance
11
8
  */
12
- export function createServer(handle, options) {
13
- const fetch = handle(process.env);
9
+ export function createServer(client, options) {
10
+ const fetch = createHandler(client);
14
11
  return Hono.serve({
15
- fetch: (req) => fetch(req, {}),
16
- port: options.port,
17
- hostname: options.hostname
12
+ // Weird type issue with options.createServer ??
13
+ ...options,
14
+ fetch: (r) => fetch(r, {})
18
15
  });
19
16
  }
20
17
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/adapters/node/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,IAAI,MAAM,mBAAmB,CAAA;AAMzC;;;;;;;;;GASG;AACH,MAAM,UAAU,YAAY,CAAC,MAAc,EAAE,OAAsB;IAClE,MAAM,KAAK,GAAG,MAAM,CAAC,OAAO,CAAC,GAAG,CAAC,CAAA;IACjC,OAAO,IAAI,CAAC,KAAK,CAAC;QACjB,KAAK,EAAE,CAAC,GAAG,EAAE,EAAE,CAAC,KAAK,CAAC,GAAG,EAAE,EAAE,CAAC;QAC9B,IAAI,EAAE,OAAO,CAAC,IAAI;QAClB,QAAQ,EAAE,OAAO,CAAC,QAAQ;KAC1B,CAAC,CAAA;AACH,CAAC"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/adapters/node/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,IAAI,MAAM,mBAAmB,CAAA;AAEzC,OAAO,EAAE,aAAa,EAAE,MAAM,mBAAmB,CAAA;AAKjD;;;;;GAKG;AACH,MAAM,UAAU,YAAY,CAAC,MAAc,EAAE,OAAsB;IAClE,MAAM,KAAK,GAAG,aAAa,CAAC,MAAM,CAAC,CAAA;IACnC,OAAO,IAAI,CAAC,KAAK,CAAC;QACjB,gDAAgD;QAChD,GAAI,OAAkB;QACtB,KAAK,EAAE,CAAC,CAAC,EAAE,EAAE,CAAC,KAAK,CAAC,CAAC,EAAE,EAAE,CAAC;KAC1B,CAAC,CAAA;AACH,CAAC"}
@@ -1,17 +1,23 @@
1
1
  import { RequestClient, type RequestClientOptions } from "@buape/carbon-request";
2
2
  import type { BaseCommand } from "../abstracts/BaseCommand.js";
3
- import { type Context, Plugin } from "../abstracts/Plugin.js";
3
+ import type { Context, Plugin, Route } from "../abstracts/Plugin.js";
4
4
  import { CommandHandler } from "../internals/CommandHandler.js";
5
5
  import { ComponentHandler } from "../internals/ComponentHandler.js";
6
+ import { EventHandler } from "../internals/EventHandler.js";
6
7
  import { ModalHandler } from "../internals/ModalHandler.js";
7
8
  import { Guild } from "../structures/Guild.js";
8
9
  import { GuildMember } from "../structures/GuildMember.js";
9
10
  import { Role } from "../structures/Role.js";
10
11
  import { User } from "../structures/User.js";
12
+ import type { Listener } from "./Listener.js";
11
13
  /**
12
14
  * The options used for initializing the client
13
15
  */
14
16
  export interface ClientOptions {
17
+ /**
18
+ * The base URL of the app
19
+ */
20
+ baseUrl: string;
15
21
  /**
16
22
  * The client ID of the app
17
23
  */
@@ -49,15 +55,28 @@ export interface ClientOptions {
49
55
  */
50
56
  disableDeployRoute?: boolean;
51
57
  /**
52
- * Whether the interactions route should
58
+ * Whether the interactions route should be disabled
53
59
  * @default false
54
60
  */
55
61
  disableInteractionsRoute?: boolean;
62
+ /**
63
+ * Whether the events route should be disabled
64
+ * @default false
65
+ */
66
+ disableEventsRoute?: boolean;
56
67
  }
57
68
  /**
58
69
  * The main client used to interact with Discord
59
70
  */
60
- export declare class Client extends Plugin {
71
+ export declare class Client {
72
+ /**
73
+ * The routes that the client will handle
74
+ */
75
+ routes: Route[];
76
+ /**
77
+ * The plugins that the client has registered
78
+ */
79
+ plugins: Plugin[];
61
80
  /**
62
81
  * The options used to initialize the client
63
82
  */
@@ -66,6 +85,10 @@ export declare class Client extends Plugin {
66
85
  * The commands that the client has registered
67
86
  */
68
87
  commands: BaseCommand[];
88
+ /**
89
+ * The event listeners that the client has registered
90
+ */
91
+ listeners: Listener[];
69
92
  /**
70
93
  * The rest client used to interact with the Discord API
71
94
  */
@@ -85,18 +108,33 @@ export declare class Client extends Plugin {
85
108
  * @internal
86
109
  */
87
110
  modalHandler: ModalHandler;
111
+ /**
112
+ * The handler for events sent from Discord
113
+ * @internal
114
+ */
115
+ eventHandler: EventHandler;
88
116
  /**
89
117
  * Creates a new client
90
118
  * @param options The options used to initialize the client
91
119
  * @param commands The commands that the client has registered
120
+ * @param plugins The plugins that the client should use
92
121
  */
93
- constructor(options: ClientOptions, commands: BaseCommand[]);
122
+ constructor(options: ClientOptions, handlers: {
123
+ commands?: BaseCommand[];
124
+ listeners?: Listener[];
125
+ }, plugins?: Plugin[]);
94
126
  private appendRoutes;
95
127
  /**
96
128
  * Handle a request to deploy the commands to Discord
97
129
  * @returns A response
98
130
  */
99
131
  handleDeployRequest(): Promise<Response>;
132
+ /**
133
+ * Handle an interaction request from Discord
134
+ * @param req The request to handle
135
+ * @returns A response
136
+ */
137
+ handleEventsRequest(req: Request): Promise<Response>;
100
138
  /**
101
139
  * Handle an interaction request from Discord
102
140
  * @param req The request to handle
@@ -105,10 +143,10 @@ export declare class Client extends Plugin {
105
143
  */
106
144
  handleInteractionsRequest(req: Request, ctx: Context): Promise<Response>;
107
145
  /**
108
- * Validate the interaction request
146
+ * Validate a request from Discord
109
147
  * @param req The request to validate
110
148
  */
111
- private validateInteractionRequest;
149
+ private validateDiscordRequest;
112
150
  /**
113
151
  * Fetch a user from the Discord API
114
152
  * @param id The ID of the user to fetch
@@ -1 +1 @@
1
- {"version":3,"file":"Client.d.ts","sourceRoot":"","sources":["../../../src/classes/Client.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,KAAK,oBAAoB,EAAE,MAAM,uBAAuB,CAAA;AAYhF,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,6BAA6B,CAAA;AAC9D,OAAO,EAAE,KAAK,OAAO,EAAE,MAAM,EAAE,MAAM,wBAAwB,CAAA;AAE7D,OAAO,EAAE,cAAc,EAAE,MAAM,gCAAgC,CAAA;AAC/D,OAAO,EAAE,gBAAgB,EAAE,MAAM,kCAAkC,CAAA;AACnE,OAAO,EAAE,YAAY,EAAE,MAAM,8BAA8B,CAAA;AAC3D,OAAO,EAAE,KAAK,EAAE,MAAM,wBAAwB,CAAA;AAC9C,OAAO,EAAE,WAAW,EAAE,MAAM,8BAA8B,CAAA;AAC1D,OAAO,EAAE,IAAI,EAAE,MAAM,uBA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