@wolfstar/http-framework 4.0.0 → 4.0.1-next-20260914150239

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.
@@ -1,6 +1,7 @@
1
1
  import { l as ResolvedImportsConfig } from "./resolve-CBovxOO3.js";
2
+ import unplugin from "unimport/unplugin";
2
3
  //#region src/auto-imports.d.ts
3
- interface AutoImportsPluginOptions extends Pick<ResolvedImportsConfig, 'dirs' | 'presets' | 'exclude' | 'dts'> {
4
+ export interface AutoImportsPluginOptions extends Pick<ResolvedImportsConfig, 'dirs' | 'presets' | 'exclude' | 'dts'> {
4
5
  /** Absolute project root, used to resolve `presets` against the project's own `node_modules`. */
5
6
  root: string;
6
7
  }
@@ -8,12 +9,11 @@ interface AutoImportsPluginOptions extends Pick<ResolvedImportsConfig, 'dirs' |
8
9
  * Builds the rolldown plugin `tsdown.config.ts` adds to `plugins` to enable auto imports, as resolved from
9
10
  * {@link StarsImportsConfig} (see `@wolfstar/http-framework/config`).
10
11
  */
11
- declare function autoImports(options: AutoImportsPluginOptions): Promise<import("rolldown").Plugin<any>[] | import("rolldown").Plugin<any>>;
12
+ export declare function autoImports(options: AutoImportsPluginOptions): Promise<ReturnType<typeof unplugin.rolldown>>;
12
13
  /**
13
14
  * Generates the auto imports declaration file's contents without writing it, so `stars prepare --check` can diff it
14
15
  * against what is on disk the same way `stars codegen --check` does for i18next types.
15
16
  */
16
- declare function generateAutoImportsDts(options: Pick<AutoImportsPluginOptions, 'root' | 'dirs' | 'presets' | 'exclude'>): Promise<string>;
17
+ export declare function generateAutoImportsDts(options: Pick<AutoImportsPluginOptions, 'root' | 'dirs' | 'presets' | 'exclude'>): Promise<string>;
17
18
  //#endregion
18
- export { AutoImportsPluginOptions, autoImports, generateAutoImportsDts };
19
19
  //# sourceMappingURL=auto-imports.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"auto-imports.d.ts","names":[],"sources":["../../src/auto-imports.ts"],"mappings":";;UAgCiB,iCAAiC,KAAK;;EAEtD;;;;;;iBAmCqB,YAAY,SAAS,2BAAwB,2BAAA,mCAAA;;;;;iBAmB7C,uBAAuB,SAAS,KAAK,qEAAqE"}
1
+ {"version":3,"file":"auto-imports.d.ts","names":[],"sources":["../../src/auto-imports.ts"],"mappings":";;;iBAgCiB,iCAAiC,KAAK;;EAEtD;;;;;;wBAmCqB,YAAY,SAAS,2BAA2B,QAAQ,kBAAkB,SAAS;;;;;wBAmBnF,uBAAuB,SAAS,KAAK,qEAAqE"}
@@ -1 +1 @@
1
- {"version":3,"file":"auto-imports.js","names":[],"sources":["../../src/auto-imports.ts"],"sourcesContent":["/**\n * Nuxt-style auto imports for `@wolfstar/http-framework` projects.\n *\n * Wires `unimport` into `tsdown`'s rolldown pipeline: the framework's (and any configured preset's) exports, plus\n * the project's own {@link AutoImportsPluginOptions.dirs}, become usable without an explicit `import` statement, the\n * same way Nuxt's own exports and its `composables`/`utils` directories do. Only usable with the `tsdown` build\n * tool — `tsc` and `none` have no transform step to hook the injection into.\n *\n * @module @wolfstar/http-framework/auto-imports\n */\nimport { resolveModuleExportNames } from 'mlly';\nimport { mkdirSync } from 'node:fs';\nimport { dirname } from 'node:path';\nimport { pathToFileURL } from 'node:url';\nimport { createUnimport, type Import } from 'unimport';\nimport unplugin from 'unimport/unplugin';\nimport type { ResolvedImportsConfig } from './lib/config/resolve.js';\n\n/**\n * Export names never auto-imported, even when a preset re-exports them under that name: names generic enough that\n * project code is likely to declare or import its own value with the same identifier.\n */\nconst BLOCKED_EXPORTS: ReadonlySet<string> = new Set(['Client', 'Message', 'Plugin', 'Store']);\n\n/**\n * Nuxt matches its own auto-import transform against every JS/TS file variant (`.js .mjs .cjs .ts .mts .cts .jsx\n * .tsx`, see `isJS` in `@nuxt/kit`), not `unimport`'s narrower unplugin default (`/\\.[jt]sx?$/`, which misses\n * `.mjs`/`.cjs`/`.mts`/`.cts`): whether a file gets auto imports must not depend on whether the project happens to\n * use TypeScript.\n */\nconst TRANSFORM_INCLUDE = [/\\.(?:[cm]?[jt]s|[jt]sx)$/];\n\nexport interface AutoImportsPluginOptions extends Pick<ResolvedImportsConfig, 'dirs' | 'presets' | 'exclude' | 'dts'> {\n\t/** Absolute project root, used to resolve `presets` against the project's own `node_modules`. */\n\troot: string;\n}\n\n/**\n * Scans every configured preset package for its export names, from the project's own `node_modules` so the result\n * matches what the project actually has installed. Packages that fail to resolve (not installed, or a preset the\n * user configured for a plugin they do not use) are skipped rather than failing the build.\n */\nasync function scanPresetImports(root: string, presets: readonly string[], excluded: ReadonlySet<string>): Promise<Import[]> {\n\tconst url = pathToFileURL(`${root}/package.json`).href;\n\tconst imports: Import[] = [];\n\n\tawait Promise.all(\n\t\tpresets.map(async (from) => {\n\t\t\tlet names: string[];\n\t\t\ttry {\n\t\t\t\tnames = await resolveModuleExportNames(from, { url });\n\t\t\t} catch {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tfor (const name of names) {\n\t\t\t\tif (excluded.has(name)) continue;\n\t\t\t\timports.push({ name, from });\n\t\t\t}\n\t\t})\n\t);\n\n\treturn imports;\n}\n\n/**\n * Builds the rolldown plugin `tsdown.config.ts` adds to `plugins` to enable auto imports, as resolved from\n * {@link StarsImportsConfig} (see `@wolfstar/http-framework/config`).\n */\nexport async function autoImports(options: AutoImportsPluginOptions) {\n\tconst excluded = new Set([...BLOCKED_EXPORTS, ...options.exclude]);\n\tconst imports = await scanPresetImports(options.root, options.presets, excluded);\n\n\t// `unimport`'s unplugin writes `dts` on `buildStart` but does not create its parent directory.\n\tmkdirSync(dirname(options.dts), { recursive: true });\n\n\treturn unplugin.rolldown({\n\t\timports,\n\t\tdirs: [...options.dirs],\n\t\tinclude: TRANSFORM_INCLUDE,\n\t\tdts: options.dts\n\t});\n}\n\n/**\n * Generates the auto imports declaration file's contents without writing it, so `stars prepare --check` can diff it\n * against what is on disk the same way `stars codegen --check` does for i18next types.\n */\nexport async function generateAutoImportsDts(options: Pick<AutoImportsPluginOptions, 'root' | 'dirs' | 'presets' | 'exclude'>): Promise<string> {\n\tconst excluded = new Set([...BLOCKED_EXPORTS, ...options.exclude]);\n\tconst imports = await scanPresetImports(options.root, options.presets, excluded);\n\tconst ctx = createUnimport({ imports, dirs: [...options.dirs] });\n\tawait ctx.init();\n\treturn ctx.generateTypeDeclarations();\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;AAsBA,MAAM,kCAAuC,IAAI,IAAI;CAAC;CAAU;CAAW;CAAU;AAAO,CAAC;;;;;;;AAQ7F,MAAM,oBAAoB,CAAC,0BAA0B;;;;;;AAYrD,eAAe,kBAAkB,MAAc,SAA4B,UAAkD;CAC5H,MAAM,MAAM,cAAc,GAAG,KAAK,cAAc,CAAC,CAAC;CAClD,MAAM,UAAoB,CAAC;CAE3B,MAAM,QAAQ,IACb,QAAQ,IAAI,OAAO,SAAS;EAC3B,IAAI;EACJ,IAAI;GACH,QAAQ,MAAM,yBAAyB,MAAM,EAAE,IAAI,CAAC;EACrD,QAAQ;GACP;EACD;EAEA,KAAK,MAAM,QAAQ,OAAO;GACzB,IAAI,SAAS,IAAI,IAAI,GAAG;GACxB,QAAQ,KAAK;IAAE;IAAM;GAAK,CAAC;EAC5B;CACD,CAAC,CACF;CAEA,OAAO;AACR;;;;;AAMA,eAAsB,YAAY,SAAmC;CACpE,MAAM,2BAAW,IAAI,IAAI,CAAC,GAAG,iBAAiB,GAAG,QAAQ,OAAO,CAAC;CACjE,MAAM,UAAU,MAAM,kBAAkB,QAAQ,MAAM,QAAQ,SAAS,QAAQ;CAG/E,UAAU,QAAQ,QAAQ,GAAG,GAAG,EAAE,WAAW,KAAK,CAAC;CAEnD,OAAO,SAAS,SAAS;EACxB;EACA,MAAM,CAAC,GAAG,QAAQ,IAAI;EACtB,SAAS;EACT,KAAK,QAAQ;CACd,CAAC;AACF;;;;;AAMA,eAAsB,uBAAuB,SAAmG;CAC/I,MAAM,2BAAW,IAAI,IAAI,CAAC,GAAG,iBAAiB,GAAG,QAAQ,OAAO,CAAC;CACjE,MAAM,UAAU,MAAM,kBAAkB,QAAQ,MAAM,QAAQ,SAAS,QAAQ;CAC/E,MAAM,MAAM,eAAe;EAAE;EAAS,MAAM,CAAC,GAAG,QAAQ,IAAI;CAAE,CAAC;CAC/D,MAAM,IAAI,KAAK;CACf,OAAO,IAAI,yBAAyB;AACrC"}
1
+ {"version":3,"file":"auto-imports.js","names":[],"sources":["../../src/auto-imports.ts"],"sourcesContent":["/**\n * Nuxt-style auto imports for `@wolfstar/http-framework` projects.\n *\n * Wires `unimport` into `tsdown`'s rolldown pipeline: the framework's (and any configured preset's) exports, plus\n * the project's own {@link AutoImportsPluginOptions.dirs}, become usable without an explicit `import` statement, the\n * same way Nuxt's own exports and its `composables`/`utils` directories do. Only usable with the `tsdown` build\n * tool — `tsc` and `none` have no transform step to hook the injection into.\n *\n * @module @wolfstar/http-framework/auto-imports\n */\nimport { resolveModuleExportNames } from 'mlly';\nimport { mkdirSync } from 'node:fs';\nimport { dirname } from 'node:path';\nimport { pathToFileURL } from 'node:url';\nimport { createUnimport, type Import } from 'unimport';\nimport unplugin from 'unimport/unplugin';\nimport type { ResolvedImportsConfig } from './lib/config/resolve.js';\n\n/**\n * Export names never auto-imported, even when a preset re-exports them under that name: names generic enough that\n * project code is likely to declare or import its own value with the same identifier.\n */\nconst BLOCKED_EXPORTS: ReadonlySet<string> = new Set(['Client', 'Message', 'Plugin', 'Store']);\n\n/**\n * Nuxt matches its own auto-import transform against every JS/TS file variant (`.js .mjs .cjs .ts .mts .cts .jsx\n * .tsx`, see `isJS` in `@nuxt/kit`), not `unimport`'s narrower unplugin default (`/\\.[jt]sx?$/`, which misses\n * `.mjs`/`.cjs`/`.mts`/`.cts`): whether a file gets auto imports must not depend on whether the project happens to\n * use TypeScript.\n */\nconst TRANSFORM_INCLUDE = [/\\.(?:[cm]?[jt]s|[jt]sx)$/];\n\nexport interface AutoImportsPluginOptions extends Pick<ResolvedImportsConfig, 'dirs' | 'presets' | 'exclude' | 'dts'> {\n\t/** Absolute project root, used to resolve `presets` against the project's own `node_modules`. */\n\troot: string;\n}\n\n/**\n * Scans every configured preset package for its export names, from the project's own `node_modules` so the result\n * matches what the project actually has installed. Packages that fail to resolve (not installed, or a preset the\n * user configured for a plugin they do not use) are skipped rather than failing the build.\n */\nasync function scanPresetImports(root: string, presets: readonly string[], excluded: ReadonlySet<string>): Promise<Import[]> {\n\tconst url = pathToFileURL(`${root}/package.json`).href;\n\tconst imports: Import[] = [];\n\n\tawait Promise.all(\n\t\tpresets.map(async (from) => {\n\t\t\tlet names: string[];\n\t\t\ttry {\n\t\t\t\tnames = await resolveModuleExportNames(from, { url });\n\t\t\t} catch {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tfor (const name of names) {\n\t\t\t\tif (excluded.has(name)) continue;\n\t\t\t\timports.push({ name, from });\n\t\t\t}\n\t\t})\n\t);\n\n\treturn imports;\n}\n\n/**\n * Builds the rolldown plugin `tsdown.config.ts` adds to `plugins` to enable auto imports, as resolved from\n * {@link StarsImportsConfig} (see `@wolfstar/http-framework/config`).\n */\nexport async function autoImports(options: AutoImportsPluginOptions): Promise<ReturnType<typeof unplugin.rolldown>> {\n\tconst excluded = new Set([...BLOCKED_EXPORTS, ...options.exclude]);\n\tconst imports = await scanPresetImports(options.root, options.presets, excluded);\n\n\t// `unimport`'s unplugin writes `dts` on `buildStart` but does not create its parent directory.\n\tmkdirSync(dirname(options.dts), { recursive: true });\n\n\treturn unplugin.rolldown({\n\t\timports,\n\t\tdirs: [...options.dirs],\n\t\tinclude: TRANSFORM_INCLUDE,\n\t\tdts: options.dts\n\t});\n}\n\n/**\n * Generates the auto imports declaration file's contents without writing it, so `stars prepare --check` can diff it\n * against what is on disk the same way `stars codegen --check` does for i18next types.\n */\nexport async function generateAutoImportsDts(options: Pick<AutoImportsPluginOptions, 'root' | 'dirs' | 'presets' | 'exclude'>): Promise<string> {\n\tconst excluded = new Set([...BLOCKED_EXPORTS, ...options.exclude]);\n\tconst imports = await scanPresetImports(options.root, options.presets, excluded);\n\tconst ctx = createUnimport({ imports, dirs: [...options.dirs] });\n\tawait ctx.init();\n\treturn ctx.generateTypeDeclarations();\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;AAsBA,MAAM,kCAAuC,IAAI,IAAI;CAAC;CAAU;CAAW;CAAU;AAAO,CAAC;;;;;;;AAQ7F,MAAM,oBAAoB,CAAC,0BAA0B;;;;;;AAYrD,eAAe,kBAAkB,MAAc,SAA4B,UAAkD;CAC5H,MAAM,MAAM,cAAc,GAAG,KAAK,cAAc,CAAC,CAAC;CAClD,MAAM,UAAoB,CAAC;CAE3B,MAAM,QAAQ,IACb,QAAQ,IAAI,OAAO,SAAS;EAC3B,IAAI;EACJ,IAAI;GACH,QAAQ,MAAM,yBAAyB,MAAM,EAAE,IAAI,CAAC;EACrD,QAAQ;GACP;EACD;EAEA,KAAK,MAAM,QAAQ,OAAO;GACzB,IAAI,SAAS,IAAI,IAAI,GAAG;GACxB,QAAQ,KAAK;IAAE;IAAM;GAAK,CAAC;EAC5B;CACD,CAAC,CACF;CAEA,OAAO;AACR;;;;;AAMA,eAAsB,YAAY,SAAkF;CACnH,MAAM,2BAAW,IAAI,IAAI,CAAC,GAAG,iBAAiB,GAAG,QAAQ,OAAO,CAAC;CACjE,MAAM,UAAU,MAAM,kBAAkB,QAAQ,MAAM,QAAQ,SAAS,QAAQ;CAG/E,UAAU,QAAQ,QAAQ,GAAG,GAAG,EAAE,WAAW,KAAK,CAAC;CAEnD,OAAO,SAAS,SAAS;EACxB;EACA,MAAM,CAAC,GAAG,QAAQ,IAAI;EACtB,SAAS;EACT,KAAK,QAAQ;CACd,CAAC;AACF;;;;;AAMA,eAAsB,uBAAuB,SAAmG;CAC/I,MAAM,2BAAW,IAAI,IAAI,CAAC,GAAG,iBAAiB,GAAG,QAAQ,OAAO,CAAC;CACjE,MAAM,UAAU,MAAM,kBAAkB,QAAQ,MAAM,QAAQ,SAAS,QAAQ;CAC/E,MAAM,MAAM,eAAe;EAAE;EAAS,MAAM,CAAC,GAAG,QAAQ,IAAI;CAAE,CAAC;CAC/D,MAAM,IAAI,KAAK;CACf,OAAO,IAAI,yBAAyB;AACrC"}
@@ -1,4 +1,4 @@
1
- import { t as _defineProperty } from "./defineProperty-BFrI-_1n.js";
1
+ import { t as _defineProperty } from "./defineProperty-DeZQsruP.js";
2
2
  import { basename, dirname, extname, isAbsolute, join, relative, resolve } from "node:path";
3
3
  import { existsSync, readFileSync, statSync } from "node:fs";
4
4
 
@@ -1,4 +1,4 @@
1
- //#region \0@oxc-project+runtime@0.144.0/helpers/esm/typeof.js
1
+ //#region \0@oxc-project+runtime@0.149.0/helpers/esm/typeof.js
2
2
  function _typeof(o) {
3
3
  "@babel/helpers - typeof";
4
4
  return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function(o) {
@@ -9,7 +9,7 @@ function _typeof(o) {
9
9
  }
10
10
 
11
11
  //#endregion
12
- //#region \0@oxc-project+runtime@0.144.0/helpers/esm/toPrimitive.js
12
+ //#region \0@oxc-project+runtime@0.149.0/helpers/esm/toPrimitive.js
13
13
  function toPrimitive(t, r) {
14
14
  if ("object" != _typeof(t) || !t) return t;
15
15
  var e = t[Symbol.toPrimitive];
@@ -22,14 +22,14 @@ function toPrimitive(t, r) {
22
22
  }
23
23
 
24
24
  //#endregion
25
- //#region \0@oxc-project+runtime@0.144.0/helpers/esm/toPropertyKey.js
25
+ //#region \0@oxc-project+runtime@0.149.0/helpers/esm/toPropertyKey.js
26
26
  function toPropertyKey(t) {
27
27
  var i = toPrimitive(t, "string");
28
28
  return "symbol" == _typeof(i) ? i : i + "";
29
29
  }
30
30
 
31
31
  //#endregion
32
- //#region \0@oxc-project+runtime@0.144.0/helpers/esm/defineProperty.js
32
+ //#region \0@oxc-project+runtime@0.149.0/helpers/esm/defineProperty.js
33
33
  function _defineProperty(e, r, t) {
34
34
  return (r = toPropertyKey(r)) in e ? Object.defineProperty(e, r, {
35
35
  value: t,
@@ -1,6 +1,6 @@
1
1
  import { t as Client } from "./Client-Mni9tJr6.js";
2
2
  //#region src/fetch.d.ts
3
- interface FetchHandlerOptions {
3
+ export interface FetchHandlerOptions {
4
4
  /**
5
5
  * The bot's Discord public key, used to verify interaction signatures.
6
6
  * @default process.env.DISCORD_PUBLIC_KEY
@@ -12,7 +12,7 @@ interface FetchHandlerOptions {
12
12
  */
13
13
  postPath?: string;
14
14
  }
15
- type FetchHandler = (request: Request) => Promise<Response>;
15
+ export type FetchHandler = (request: Request) => Promise<Response>;
16
16
  /**
17
17
  * Wraps `Client`'s own dispatch — signature verification, routing, replies, the exact same code `listen()` runs —
18
18
  * behind a Fetch handler, by bridging a `Request` to the `IncomingMessage`/`ServerResponse` shape it expects.
@@ -21,7 +21,6 @@ type FetchHandler = (request: Request) => Promise<Response>;
21
21
  * called here exactly as `Client#listen()` calls it on every request. `Client` never has to know which transport
22
22
  * (`node:http`, Vite, Nitro, a Worker) produced the request.
23
23
  */
24
- declare function createFetchHandler(client: Client, options?: FetchHandlerOptions): Promise<FetchHandler>;
24
+ export declare function createFetchHandler(client: Client, options?: FetchHandlerOptions): Promise<FetchHandler>;
25
25
  //#endregion
26
- export { FetchHandler, FetchHandlerOptions, createFetchHandler };
27
26
  //# sourceMappingURL=fetch.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"fetch.d.ts","names":[],"sources":["../../src/fetch.ts"],"mappings":";;UAaiB;;;;;EAKhB;;;;;EAKA;;KAGW,gBAAgB,SAAS,YAAY,QAAQ;;;;;;;;;iBAYnC,mBAAmB,QAAQ,QAAQ,UAAS,sBAA2B,QAAQ"}
1
+ {"version":3,"file":"fetch.d.ts","names":[],"sources":["../../src/fetch.ts"],"mappings":";;iBAaiB;;;;;EAKhB;;;;;EAKA;;YAGW,gBAAgB,SAAS,YAAY,QAAQ;;;;;;;;;wBAYnC,mBAAmB,QAAQ,QAAQ,UAAS,sBAA2B,QAAQ"}
package/dist/esm/fetch.js CHANGED
@@ -1,5 +1,5 @@
1
- import { t as _defineProperty } from "./defineProperty-BFrI-_1n.js";
2
- import { i as _classPrivateFieldGet2, o as _classPrivateFieldInitSpec, r as _classPrivateFieldSet2, t as makeKey } from "./security-BBKStXe6.js";
1
+ import { t as _defineProperty } from "./defineProperty-DeZQsruP.js";
2
+ import { i as _classPrivateFieldGet2, o as _classPrivateFieldInitSpec, r as _classPrivateFieldSet2, t as makeKey } from "./security-pO7x9isF.js";
3
3
  import { EventEmitter } from "node:events";
4
4
  import { Readable } from "node:stream";
5
5
 
@@ -2,7 +2,7 @@ import { $ as MessageComponentButtonInteraction, A as ClientEventName, At as app
2
2
  import { AliasPiece, AliasPieceOptions, AliasStore, LoaderError, LoaderPieceContext, LoaderPieceContext as LoaderPieceContext$1, LoaderStrategy, MissingExportsError, Piece, PieceContext, PieceOptions, PieceOptions as PieceOptions$1, Store, StoreOptions, StoreRegistry, StoreRegistryEntries, container } from "@sapphire/pieces";
3
3
  import { APIApplicationCommandSubcommandGroupOption, APIApplicationCommandSubcommandOption, ApplicationCommandOptionType, PermissionFlagsBits } from "discord-api-types/v10";
4
4
  //#region src/lib/api/HttpCodes.d.ts
5
- declare enum HttpCodes {
5
+ export declare enum HttpCodes {
6
6
  /**
7
7
  * Standard response for successful HTTP requests. The actual response will
8
8
  * depend on the request method used. In a GET request, the response will
@@ -381,7 +381,7 @@ declare enum HttpCodes {
381
381
  }
382
382
  //#endregion
383
383
  //#region src/lib/components/StringIdParser.d.ts
384
- declare class StringIdParser implements IIdParser {
384
+ export declare class StringIdParser implements IIdParser {
385
385
  run(customId: string): IdParserRead | null;
386
386
  }
387
387
  //#endregion
@@ -390,7 +390,7 @@ declare class StringIdParser implements IIdParser {
390
390
  * The constructor signature shared by every `Piece` of `@wolfstar/http-framework`, such as `Command`, `Listener`, and
391
391
  * `InteractionHandler`.
392
392
  */
393
- type PieceConstructor<Options extends PieceOptions$1 = PieceOptions$1> = new (context: LoaderPieceContext$1, options?: Options) => unknown;
393
+ export type PieceConstructor<Options extends PieceOptions$1 = PieceOptions$1> = new (context: LoaderPieceContext$1, options?: Options) => unknown;
394
394
  /**
395
395
  * Decorator that sets the options of a `Piece`, such as a `Command`, a `Listener`, or an `InteractionHandler`.
396
396
  *
@@ -422,7 +422,7 @@ type PieceConstructor<Options extends PieceOptions$1 = PieceOptions$1> = new (co
422
422
  * export class UserCommand extends Command {}
423
423
  * ```
424
424
  */
425
- declare function ApplyOptions<Options extends PieceOptions$1 = PieceOptions$1>(optionsOrFn: Options | ((context: LoaderPieceContext$1) => Options)): ClassDecorator;
425
+ export declare function ApplyOptions<Options extends PieceOptions$1 = PieceOptions$1>(optionsOrFn: Options | ((context: LoaderPieceContext$1) => Options)): ClassDecorator;
426
426
  //#endregion
427
427
  //#region src/lib/decorators/Enumerable.d.ts
428
428
  /**
@@ -448,7 +448,7 @@ declare function ApplyOptions<Options extends PieceOptions$1 = PieceOptions$1>(o
448
448
  * }
449
449
  * ```
450
450
  */
451
- declare function Enumerable(value: boolean): (target: unknown, key: string) => void;
451
+ export declare function Enumerable(value: boolean): (target: unknown, key: string) => void;
452
452
  /**
453
453
  * Decorator that sets the `enumerable` property of a class method to the given value.
454
454
  *
@@ -466,13 +466,13 @@ declare function Enumerable(value: boolean): (target: unknown, key: string) => v
466
466
  * }
467
467
  * ```
468
468
  */
469
- declare function EnumerableMethod(value: boolean): (_target: unknown, _key: string, descriptor: PropertyDescriptor) => void;
469
+ export declare function EnumerableMethod(value: boolean): (_target: unknown, _key: string, descriptor: PropertyDescriptor) => void;
470
470
  //#endregion
471
471
  //#region src/lib/decorators/RequiresContext.d.ts
472
472
  /**
473
473
  * The fallback invoked when a context precondition is not met. It receives the same arguments as the decorated method.
474
474
  */
475
- type ContextFallback = (...args: any[]) => unknown;
475
+ export type ContextFallback = (...args: any[]) => unknown;
476
476
  /**
477
477
  * Decorator that only runs the decorated method when the interaction was received from a guild.
478
478
  *
@@ -494,7 +494,7 @@ type ContextFallback = (...args: any[]) => unknown;
494
494
  * }
495
495
  * ```
496
496
  */
497
- declare function RequiresGuildContext(fallback?: ContextFallback): MethodDecorator;
497
+ export declare function RequiresGuildContext(fallback?: ContextFallback): MethodDecorator;
498
498
  /**
499
499
  * Decorator that only runs the decorated method when the interaction was **not** received from a guild, that is, from a
500
500
  * DM or from a user-installed app context.
@@ -517,13 +517,13 @@ declare function RequiresGuildContext(fallback?: ContextFallback): MethodDecorat
517
517
  * }
518
518
  * ```
519
519
  */
520
- declare function RequiresDMContext(fallback?: ContextFallback): MethodDecorator;
520
+ export declare function RequiresDMContext(fallback?: ContextFallback): MethodDecorator;
521
521
  //#endregion
522
522
  //#region src/lib/utils/permissions.d.ts
523
523
  /**
524
524
  * The name of a Discord permission flag, as defined by {@linkcode PermissionFlagsBits}.
525
525
  */
526
- type PermissionString = keyof typeof PermissionFlagsBits;
526
+ export type PermissionString = keyof typeof PermissionFlagsBits;
527
527
  /**
528
528
  * Anything that can be resolved into a permission bitfield:
529
529
  *
@@ -531,7 +531,7 @@ type PermissionString = keyof typeof PermissionFlagsBits;
531
531
  * - A {@linkcode PermissionString}, such as `'BanMembers'`.
532
532
  * - An arbitrarily nested (readonly) array of the above.
533
533
  */
534
- type PermissionResolvable = bigint | PermissionString | readonly PermissionResolvable[];
534
+ export type PermissionResolvable = bigint | PermissionString | readonly PermissionResolvable[];
535
535
  /**
536
536
  * Resolves any {@linkcode PermissionResolvable} into a single permission bitfield.
537
537
  *
@@ -544,7 +544,7 @@ type PermissionResolvable = bigint | PermissionString | readonly PermissionResol
544
544
  * // 6n
545
545
  * ```
546
546
  */
547
- declare function resolvePermissions(resolvable: PermissionResolvable): bigint;
547
+ export declare function resolvePermissions(resolvable: PermissionResolvable): bigint;
548
548
  /**
549
549
  * Computes the permissions from `required` that are missing in `granted`.
550
550
  *
@@ -554,14 +554,14 @@ declare function resolvePermissions(resolvable: PermissionResolvable): bigint;
554
554
  * @param required The bitfield of the permissions that are required.
555
555
  * @returns The bitfield of the missing permissions, `0n` if none are missing.
556
556
  */
557
- declare function getMissingPermissions(granted: bigint, required: bigint): bigint;
557
+ export declare function getMissingPermissions(granted: bigint, required: bigint): bigint;
558
558
  /**
559
559
  * Converts a permission bitfield into the list of the flag names it contains.
560
560
  *
561
561
  * @param bits The bitfield to convert.
562
562
  * @returns The names of the permissions contained in the bitfield.
563
563
  */
564
- declare function toPermissionNames(bits: bigint): PermissionString[];
564
+ export declare function toPermissionNames(bits: bigint): PermissionString[];
565
565
  //#endregion
566
566
  //#region src/lib/decorators/RequiresPermissions.d.ts
567
567
  /**
@@ -586,7 +586,7 @@ declare function toPermissionNames(bits: bigint): PermissionString[];
586
586
  * }
587
587
  * ```
588
588
  */
589
- declare function RequiresClientPermissions(...permissions: PermissionResolvable[]): MethodDecorator;
589
+ export declare function RequiresClientPermissions(...permissions: PermissionResolvable[]): MethodDecorator;
590
590
  /**
591
591
  * Decorator that only runs the decorated method when the invoking user has all of the given permissions in the channel
592
592
  * the interaction was sent from.
@@ -611,7 +611,7 @@ declare function RequiresClientPermissions(...permissions: PermissionResolvable[
611
611
  * }
612
612
  * ```
613
613
  */
614
- declare function RequiresUserPermissions(...permissions: PermissionResolvable[]): MethodDecorator;
614
+ export declare function RequiresUserPermissions(...permissions: PermissionResolvable[]): MethodDecorator;
615
615
  //#endregion
616
616
  //#region src/lib/decorators/utils.d.ts
617
617
  /**
@@ -631,7 +631,7 @@ declare function RequiresUserPermissions(...permissions: PermissionResolvable[])
631
631
  * }
632
632
  * ```
633
633
  */
634
- declare function createMethodDecorator<TFunction extends (...args: any[]) => unknown>(fn: TFunction): TFunction;
634
+ export declare function createMethodDecorator<TFunction extends (...args: any[]) => unknown>(fn: TFunction): TFunction;
635
635
  /**
636
636
  * Utility to make a class decorator from a function.
637
637
  *
@@ -642,7 +642,7 @@ declare function createMethodDecorator<TFunction extends (...args: any[]) => unk
642
642
  * @returns The decorator.
643
643
  * @see {@linkcode ApplyOptions}
644
644
  */
645
- declare function createClassDecorator<TFunction extends (...args: any[]) => unknown>(fn: TFunction): TFunction;
645
+ export declare function createClassDecorator<TFunction extends (...args: any[]) => unknown>(fn: TFunction): TFunction;
646
646
  /**
647
647
  * Creates a new proxy to efficiently add properties to a class without creating subclasses.
648
648
  *
@@ -650,7 +650,7 @@ declare function createClassDecorator<TFunction extends (...args: any[]) => unkn
650
650
  * @param handler The handler function to modify the constructor behavior for the target.
651
651
  * @returns The proxy.
652
652
  */
653
- declare function createProxy<T extends object>(target: T, handler: Omit<ProxyHandler<T>, 'get'>): T;
653
+ export declare function createProxy<T extends object>(target: T, handler: Omit<ProxyHandler<T>, 'get'>): T;
654
654
  /**
655
655
  * Utility to make a method decorator with lighter syntax and inferred types.
656
656
  *
@@ -670,7 +670,7 @@ declare function createProxy<T extends object>(target: T, handler: Omit<ProxyHan
670
670
  * );
671
671
  * ```
672
672
  */
673
- declare function createFunctionPrecondition(precondition: (...args: any[]) => boolean | Promise<boolean>, fallback?: (...args: any[]) => unknown): MethodDecorator;
673
+ export declare function createFunctionPrecondition(precondition: (...args: any[]) => boolean | Promise<boolean>, fallback?: (...args: any[]) => unknown): MethodDecorator;
674
674
  //#endregion
675
675
  //#region src/lib/errors/UserError.d.ts
676
676
  /**
@@ -691,7 +691,7 @@ declare function createFunctionPrecondition(precondition: (...args: any[]) => bo
691
691
  * });
692
692
  * ```
693
693
  */
694
- declare class UserError extends Error {
694
+ export declare class UserError extends Error {
695
695
  /**
696
696
  * An identifier, useful to localize emitted errors.
697
697
  * @since 3.2.0
@@ -709,7 +709,7 @@ declare class UserError extends Error {
709
709
  constructor(options: UserError.Options);
710
710
  get name(): string;
711
711
  }
712
- declare namespace UserError {
712
+ export declare namespace UserError {
713
713
  /**
714
714
  * The options for {@link UserError}.
715
715
  * @since 3.2.0
@@ -751,7 +751,7 @@ declare namespace UserError {
751
751
  * });
752
752
  * ```
753
753
  */
754
- declare class ArgumentError<T = unknown> extends UserError {
754
+ export declare class ArgumentError<T = unknown> extends UserError {
755
755
  /**
756
756
  * The name of the option that caused the error.
757
757
  * @since 3.2.0
@@ -770,7 +770,7 @@ declare class ArgumentError<T = unknown> extends UserError {
770
770
  constructor(options: ArgumentError.Options<T>);
771
771
  get name(): string;
772
772
  }
773
- declare namespace ArgumentError {
773
+ export declare namespace ArgumentError {
774
774
  /**
775
775
  * The options for {@link ArgumentError}.
776
776
  * @since 3.2.0
@@ -806,7 +806,7 @@ declare namespace ArgumentError {
806
806
  * Represents an error that is thrown when a {@link ChatInputRouter} encounters an error.
807
807
  * @since 2.0.0
808
808
  */
809
- declare class ChatInputRouterError<Options extends Command.Options = Command.Options> extends UserError {
809
+ export declare class ChatInputRouterError<Options extends Command.Options = Command.Options> extends UserError {
810
810
  /**
811
811
  * The key identifying the error.
812
812
  * @since 2.0.0
@@ -835,7 +835,7 @@ declare class ChatInputRouterError<Options extends Command.Options = Command.Opt
835
835
  get path(): string;
836
836
  get name(): string;
837
837
  }
838
- declare const ChatInputRouterErrors: {
838
+ export declare const ChatInputRouterErrors: {
839
839
  readonly DuplicatedSubcommandGroup: (command: string, subcommandGroup: string) => string;
840
840
  readonly DuplicatedSubcommand: (command: string, subcommandGroup: string, subcommand: string) => string;
841
841
  readonly SubcommandGroupLinkInvalid: (command: string, subcommandGroup: string) => string;
@@ -847,7 +847,7 @@ declare const ChatInputRouterErrors: {
847
847
  * The identifiers of the errors the framework may throw, useful to localize them.
848
848
  * @since 3.2.0
849
849
  */
850
- declare enum Identifiers {
850
+ export declare enum Identifiers {
851
851
  ArgumentMissing = "argumentMissing",
852
852
  ArgumentUnavailable = "argumentUnavailable",
853
853
  ArgumentAttachmentError = "attachmentError",
@@ -907,7 +907,7 @@ declare enum Identifiers {
907
907
  * });
908
908
  * ```
909
909
  */
910
- declare class PreconditionError extends UserError {
910
+ export declare class PreconditionError extends UserError {
911
911
  /**
912
912
  * The name of the precondition that caused the error.
913
913
  * @since 3.2.0
@@ -916,7 +916,7 @@ declare class PreconditionError extends UserError {
916
916
  constructor(options: PreconditionError.Options);
917
917
  get name(): string;
918
918
  }
919
- declare namespace PreconditionError {
919
+ export declare namespace PreconditionError {
920
920
  /**
921
921
  * The options for {@link PreconditionError}.
922
922
  * @since 3.2.0
@@ -942,7 +942,7 @@ declare namespace PreconditionError {
942
942
  *
943
943
  * @since 2.0.0
944
944
  */
945
- declare class CommandLoaderStrategy extends LoaderStrategy<Command> {
945
+ export declare class CommandLoaderStrategy extends LoaderStrategy<Command> {
946
946
  /**
947
947
  * Called when a command is loaded.
948
948
  *
@@ -973,7 +973,7 @@ declare class CommandLoaderStrategy extends LoaderStrategy<Command> {
973
973
  *
974
974
  * @since 2.1.0
975
975
  */
976
- declare class ListenerLoaderStrategy extends LoaderStrategy<Listener> {
976
+ export declare class ListenerLoaderStrategy extends LoaderStrategy<Listener> {
977
977
  /**
978
978
  * Called when a listener is loaded.
979
979
  *
@@ -1004,7 +1004,7 @@ declare class ListenerLoaderStrategy extends LoaderStrategy<Listener> {
1004
1004
  *
1005
1005
  * @since 3.4.0
1006
1006
  */
1007
- declare class Logger implements ILogger {
1007
+ export declare class Logger implements ILogger {
1008
1008
  /**
1009
1009
  * The lowest level the logger writes.
1010
1010
  */
@@ -1031,7 +1031,7 @@ declare class Logger implements ILogger {
1031
1031
  *
1032
1032
  * @since 3.4.0
1033
1033
  */
1034
- type LoggerConsoleMethod = 'debug' | 'error' | 'info' | 'trace' | 'warn';
1034
+ export type LoggerConsoleMethod = 'debug' | 'error' | 'info' | 'trace' | 'warn';
1035
1035
  //#endregion
1036
- export { type AbortError, type AddFiles, AliasPiece, type AliasPieceOptions, AliasStore, ApplicationCommandRegistry, ApplicationCommandRegistryEntry, ApplyOptions, ArgumentError, ArgumentTypes, type AsyncDiscordResult, AsyncPluginHooks, AutocompleteInteraction, AutocompleteInteractionArguments, AutocompleteResponseData, AutocompleteResponseOptions, BaseCommandInteractionType, BaseInteraction, BaseInteractionType, ChatInputCommandInteraction, ChatInputRouterError, ChatInputRouterErrors, Client, ClientEventAutocompleteContext, ClientEventCommandContext, ClientEventInteractionHandlerContext, ClientEventName, ClientEvents, ClientLoggerOptions, ClientOptions, Command, CommandInteraction, CommandLoaderStrategy, CommandRegistry, CommandRouter, CommandStore, CommandStoreRouter, ContextFallback, DeferResponseData, DeferResponseOptions, DeferUpdateResult, type DiscordError, type DiscordResult, Enumerable, EnumerableMethod, Events, ExtractedOptions, FollowupOptions, HMROptions, HotModuleReloader, HttpCodes, HttpFrameworkPluginAsyncHook, HttpFrameworkPluginHook, HttpFrameworkPluginHookEntry, IIdParser, ILogger, IdParserRead, Identifiers, InGuild, Interaction, InteractionArguments, InteractionHandler, InteractionHandlerStore, Interactions, ListenOptions, Listener, ListenerLoaderStrategy, ListenerStore, LoadOptions, LoaderError, type LoaderPieceContext, LogLevel, Logger, LoggerConsoleMethod, MakeArguments, MappedClientEvents, Message, MessageComponentButtonInteraction, MessageComponentChannelSelectInteraction, MessageComponentInteraction, MessageComponentInteractionType, MessageComponentMentionableSelectInteraction, MessageComponentRoleSelectInteraction, MessageComponentStringSelectInteraction as MessageComponentSelectMenuInteraction, MessageComponentStringSelectInteraction, MessageComponentUserSelectInteraction, MessageContextMenuCommandInteraction, MessageResponseData, MessageResponseOptions, MissingExportsError, ModalResponseData, ModalResponseOptions, ModalSubmitInteraction, type NonPingInteraction, PartialMessage, PermissionResolvable, PermissionString, Piece, PieceConstructor, type PieceContext, type PieceOptions, Plugin, PluginHook, PluginManager, PreconditionError, RegisterCommand, RegisterMessageCommand, RegisterSubcommand, RegisterSubcommandGroup, RegisterUserCommand, RequestAuthPrefix, RequiresClientPermissions, RequiresDMContext, RequiresGuildContext, RequiresUserPermissions, RestrictGuildIds, Store, type StoreOptions, StoreRegistry, type StoreRegistryEntries, StringIdParser, SyncPluginHooks, TransformedArguments, UpdateData, UpdateOptions, UpdateResponseOptions, UpdateResponseResult, UserContextMenuCommandInteraction, UserError, applicationCommandRegistry, container, createClassDecorator, createFunctionPrecondition, createMethodDecorator, createProxy, extractTopLevelOptions, getMissingPermissions, makeInteraction, postInitialization, postListen, preGenericsInitialization, preInitialization, preLoad, resolvePermissions, restrictedGuildIdRegistry, toPermissionNames, transformAutocompleteInteraction, transformInteraction, transformMessageInteraction, transformUserInteraction };
1036
+ export { type AbortError, type AddFiles, AliasPiece, type AliasPieceOptions, AliasStore, ApplicationCommandRegistry, ApplicationCommandRegistryEntry, ArgumentTypes, type AsyncDiscordResult, AsyncPluginHooks, AutocompleteInteraction, AutocompleteInteractionArguments, AutocompleteResponseData, AutocompleteResponseOptions, BaseCommandInteractionType, BaseInteraction, BaseInteractionType, ChatInputCommandInteraction, Client, ClientEventAutocompleteContext, ClientEventCommandContext, ClientEventInteractionHandlerContext, ClientEventName, ClientEvents, ClientLoggerOptions, ClientOptions, Command, CommandInteraction, CommandRegistry, CommandRouter, CommandStore, CommandStoreRouter, DeferResponseData, DeferResponseOptions, DeferUpdateResult, type DiscordError, type DiscordResult, Events, ExtractedOptions, FollowupOptions, HMROptions, HotModuleReloader, HttpFrameworkPluginAsyncHook, HttpFrameworkPluginHook, HttpFrameworkPluginHookEntry, IIdParser, ILogger, IdParserRead, InGuild, Interaction, InteractionArguments, InteractionHandler, InteractionHandlerStore, Interactions, ListenOptions, Listener, ListenerStore, LoadOptions, LoaderError, type LoaderPieceContext, LogLevel, MakeArguments, MappedClientEvents, Message, MessageComponentButtonInteraction, MessageComponentChannelSelectInteraction, MessageComponentInteraction, MessageComponentInteractionType, MessageComponentMentionableSelectInteraction, MessageComponentRoleSelectInteraction, MessageComponentStringSelectInteraction as MessageComponentSelectMenuInteraction, MessageComponentStringSelectInteraction, MessageComponentUserSelectInteraction, MessageContextMenuCommandInteraction, MessageResponseData, MessageResponseOptions, MissingExportsError, ModalResponseData, ModalResponseOptions, ModalSubmitInteraction, type NonPingInteraction, PartialMessage, Piece, type PieceContext, type PieceOptions, Plugin, PluginHook, PluginManager, RegisterCommand, RegisterMessageCommand, RegisterSubcommand, RegisterSubcommandGroup, RegisterUserCommand, RequestAuthPrefix, RestrictGuildIds, Store, type StoreOptions, StoreRegistry, type StoreRegistryEntries, SyncPluginHooks, TransformedArguments, UpdateData, UpdateOptions, UpdateResponseOptions, UpdateResponseResult, UserContextMenuCommandInteraction, applicationCommandRegistry, container, extractTopLevelOptions, makeInteraction, postInitialization, postListen, preGenericsInitialization, preInitialization, preLoad, restrictedGuildIdRegistry, transformAutocompleteInteraction, transformInteraction, transformMessageInteraction, transformUserInteraction };
1037
1037
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","names":[],"sources":["../../src/lib/api/HttpCodes.ts","../../src/lib/components/StringIdParser.ts","../../src/lib/decorators/ApplyOptions.ts","../../src/lib/decorators/Enumerable.ts","../../src/lib/decorators/RequiresContext.ts","../../src/lib/utils/permissions.ts","../../src/lib/decorators/RequiresPermissions.ts","../../src/lib/decorators/utils.ts","../../src/lib/errors/UserError.ts","../../src/lib/errors/ArgumentError.ts","../../src/lib/errors/ChatInputRouterError.ts","../../src/lib/errors/Identifiers.ts","../../src/lib/errors/PreconditionError.ts","../../src/lib/structures/CommandLoaderStrategy.ts","../../src/lib/structures/ListenerLoaderStrategy.ts","../../src/lib/utils/logger/Logger.ts"],"mappings":";;;;aAGY;;;;;;;;EAQX;;;;;EAMA;;;;;;EAOA;;;;;;EAOA;;;;;EAMA;;;;;EAMA;;;;;;;EAQA;;;;;;EAOA;;;;;;EAOA;;;;;;EAOA;;;;;;;;EASA;;;;EAKA;;;;;;;;;;;;EAaA;;;;;;;EAQA;;;;;;;EAQA;;;;;;;EAQA;;;;;EAKA;;;;;;;;EASA;;;;;;;EAQA;;;;;;EAOA;;;;;;;;;;EAWA;;;;;;;;;;;;EAaA;;;;;;;;;;;EAYA;;;;;EAMA;;;;;;EAOA;;;;;EAMA;;;;EAKA;;;;;;;EAQA;;;;;;EAOA;;;;;;;;;;EAWA;;;;;EAMA;;;;;EAMA;;;;;EAMA;;;;;;;EAQA;;;;;;EAOA;;;;;;;EAQA;;;;;EAMA;;;;;;;;;EA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CAAA;;;;;;;;;;;;;EAwB1C,SAAS,OAAO,cAAc,OAAO,UAAO,mCAAA;;;;;;;;;cC9BhD,+BAA+B,eAAe;;;;;;;;;EAS1C,OAAO,QAAQ,eAAe,OAAO;;;;;;;;;EAkBrC,SAAS,QAAQ,eAAe,OAAO;;;;;;;;;;;;;cC5B3C,kBAAkB;;;;EAIvB,OAAO;;;;EAKd,YAAmB,QAAO;EAInB,IAAI,OAAO;EAIX,SAAS;EAIT,SAAS;EAIT,QAAQ;EAIR,QAAQ;EAIR,SAAS;EAIT,SAAS;EAIT,MAAM,OAAO,aAAa;;;;4BAUP,QAAM,IAAA,UAAA;;;;;;;KAerB"}
1
+ {"version":3,"file":"index.d.ts","names":[],"sources":["../../src/lib/api/HttpCodes.ts","../../src/lib/components/StringIdParser.ts","../../src/lib/decorators/ApplyOptions.ts","../../src/lib/decorators/Enumerable.ts","../../src/lib/decorators/RequiresContext.ts","../../src/lib/utils/permissions.ts","../../src/lib/decorators/RequiresPermissions.ts","../../src/lib/decorators/utils.ts","../../src/lib/errors/UserError.ts","../../src/lib/errors/ArgumentError.ts","../../src/lib/errors/ChatInputRouterError.ts","../../src/lib/errors/Identifiers.ts","../../src/lib/errors/PreconditionError.ts","../../src/lib/structures/CommandLoaderStrategy.ts","../../src/lib/structures/ListenerLoaderStrategy.ts","../../src/lib/utils/logger/Logger.ts"],"mappings":";;;;oBAGY;;;;;;;;EAQX;;;;;EAMA;;;;;;EAOA;;;;;;EAOA;;;;;EAMA;;;;;EAMA;;;;;;;EAQA;;;;;;EAOA;;;;;;EAOA;;;;;;EAOA;;;;;;;;EASA;;;;EAKA;;;;;;;;;;;;EAaA;;;;;;;EAQA;;;;;;;EAQA;;;;;;;EAQA;;;;;EAKA;;;;;;;;EASA;;;;;;;EAQA;;;;;;EAOA;;;;;;;;;;EAWA;;;;;;;;;;;;EAaA;;;;;;;;;;;EAYA;;;;;EAMA;;;;;;EAOA;;;;;EAMA;;;;EAKA;;;;;;;EAQA;;;;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KC,gBAAgB,KAAK,UAAU;;;;;IAK/C;;;;;;IAOA;;;;;;;;;;qBC5CW,8BAA8B,eAAe;;;;;;;;;EASzC,OAAO,OAAO,cAAc,OAAO,UAAO,mCAAA;;;;;;;;;;;;;EAwB1C,SAAS,OAAO,cAAc,OAAO,UAAO,mCAAA;;;;;;;;;qBC9BhD,+BAA+B,eAAe;;;;;;;;;EAS1C,OAAO,QAAQ,eAAe,OAAO;;;;;;;;;EAkBrC,SAAS,QAAQ,eAAe,OAAO;;;;;;;;;;;;;qBC5B3C,kBAAkB;;;;EAIvB,OAAO;;;;EAKd,YAAmB,QAAO;EAInB,IAAI,OAAO;EAIX,SAAS;EAIT,SAAS;EAIT,QAAQ;EAIR,QAAQ;EAIR,SAAS;EAIT,SAAS;EAIT,MAAM,OAAO,aAAa;;;;4BAUP,QAAM,IAAA,UAAA;;;;;;;YAerB"}
package/dist/esm/index.js CHANGED
@@ -1,5 +1,5 @@
1
- import { t as _defineProperty } from "./defineProperty-BFrI-_1n.js";
2
- import { a as _assertClassBrand, i as _classPrivateFieldGet2, n as verifyBody, o as _classPrivateFieldInitSpec, r as _classPrivateFieldSet2, s as _checkPrivateRedeclaration, t as makeKey } from "./security-BBKStXe6.js";
1
+ import { t as _defineProperty } from "./defineProperty-DeZQsruP.js";
2
+ import { a as _assertClassBrand, i as _classPrivateFieldGet2, n as verifyBody, o as _classPrivateFieldInitSpec, r as _classPrivateFieldSet2, s as _checkPrivateRedeclaration, t as makeKey } from "./security-pO7x9isF.js";
3
3
  import { AliasPiece, AliasStore, LoaderError, LoaderStrategy, MissingExportsError, Piece, Piece as Piece$1, Store, Store as Store$1, StoreRegistry, container, container as container$1 } from "@sapphire/pieces";
4
4
  import { REST, makeURLSearchParams } from "@discordjs/rest";
5
5
  import { isFunction, isNullish, isNullishOrEmpty } from "@sapphire/utilities";
@@ -1061,7 +1061,7 @@ function getLinkedMethod(object) {
1061
1061
  }
1062
1062
 
1063
1063
  //#endregion
1064
- //#region \0@oxc-project+runtime@0.144.0/helpers/esm/classPrivateMethodInitSpec.js
1064
+ //#region \0@oxc-project+runtime@0.149.0/helpers/esm/classPrivateMethodInitSpec.js
1065
1065
  function _classPrivateMethodInitSpec(e, a) {
1066
1066
  _checkPrivateRedeclaration(e, a), a.add(e);
1067
1067
  }
@@ -1,31 +1,31 @@
1
1
  import { webcrypto } from "node:crypto";
2
2
 
3
- //#region \0@oxc-project+runtime@0.144.0/helpers/esm/checkPrivateRedeclaration.js
3
+ //#region \0@oxc-project+runtime@0.149.0/helpers/esm/checkPrivateRedeclaration.js
4
4
  function _checkPrivateRedeclaration(e, t) {
5
5
  if (t.has(e)) throw new TypeError("Cannot initialize the same private elements twice on an object");
6
6
  }
7
7
 
8
8
  //#endregion
9
- //#region \0@oxc-project+runtime@0.144.0/helpers/esm/classPrivateFieldInitSpec.js
9
+ //#region \0@oxc-project+runtime@0.149.0/helpers/esm/classPrivateFieldInitSpec.js
10
10
  function _classPrivateFieldInitSpec(e, t, a) {
11
11
  _checkPrivateRedeclaration(e, t), t.set(e, a);
12
12
  }
13
13
 
14
14
  //#endregion
15
- //#region \0@oxc-project+runtime@0.144.0/helpers/esm/assertClassBrand.js
15
+ //#region \0@oxc-project+runtime@0.149.0/helpers/esm/assertClassBrand.js
16
16
  function _assertClassBrand(e, t, n) {
17
17
  if ("function" == typeof e ? e === t : e.has(t)) return arguments.length < 3 ? t : n;
18
18
  throw new TypeError("Private element is not present on this object");
19
19
  }
20
20
 
21
21
  //#endregion
22
- //#region \0@oxc-project+runtime@0.144.0/helpers/esm/classPrivateFieldGet2.js
22
+ //#region \0@oxc-project+runtime@0.149.0/helpers/esm/classPrivateFieldGet2.js
23
23
  function _classPrivateFieldGet2(s, a) {
24
24
  return s.get(_assertClassBrand(s, a));
25
25
  }
26
26
 
27
27
  //#endregion
28
- //#region \0@oxc-project+runtime@0.144.0/helpers/esm/classPrivateFieldSet2.js
28
+ //#region \0@oxc-project+runtime@0.149.0/helpers/esm/classPrivateFieldSet2.js
29
29
  function _classPrivateFieldSet2(s, a, r) {
30
30
  return s.set(_assertClassBrand(s, a), r), r;
31
31
  }
@@ -54,4 +54,4 @@ async function verifyBody(body, signature, timestamp, key) {
54
54
 
55
55
  //#endregion
56
56
  export { _assertClassBrand as a, _classPrivateFieldGet2 as i, verifyBody as n, _classPrivateFieldInitSpec as o, _classPrivateFieldSet2 as r, _checkPrivateRedeclaration as s, makeKey as t };
57
- //# sourceMappingURL=security-BBKStXe6.js.map
57
+ //# sourceMappingURL=security-pO7x9isF.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"security-BBKStXe6.js","names":[],"sources":["../../src/lib/utils/security.ts"],"sourcesContent":["import { webcrypto } from 'node:crypto';\n\nexport type HeaderValue = string | string[];\nexport type Key = webcrypto.CryptoKey;\n\nconst AlgorithmName = 'Ed25519';\n\nfunction headerToString(header: HeaderValue): string {\n\treturn typeof header === 'string' ? header : header[0];\n}\n\nexport function makeKey(key: string): Promise<Key> {\n\treturn webcrypto.subtle.importKey('raw', Buffer.from(key, 'hex'), { name: AlgorithmName }, true, ['verify']);\n}\n\n/**\n * Validates a payload from Discord against its signature and key.\n * @param body The request body.\n * @param signature The value of the `x-signature-ed25519` header.\n * @param signature The value of the `x-signature-timestamp` header.\n * @param key The public key from the Discord developer dashboard, generated by {@link makeKey}\n */\nexport async function verifyBody(body: string, signature: string | string[], timestamp: string | string[], key: Key) {\n\tconst signatureData = Buffer.from(headerToString(signature), 'hex');\n\tconst data = Buffer.isBuffer(body)\n\t\t? Buffer.concat([Buffer.from(headerToString(timestamp)), body])\n\t\t: Buffer.from(`${headerToString(timestamp)}${body}`);\n\n\treturn webcrypto.subtle.verify(AlgorithmName, key, signatureData, Buffer.from(data));\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAKA,MAAM,gBAAgB;AAEtB,SAAS,eAAe,QAA6B;CACpD,OAAO,OAAO,WAAW,WAAW,SAAS,OAAO;AACrD;AAEA,SAAgB,QAAQ,KAA2B;CAClD,OAAO,UAAU,OAAO,UAAU,OAAO,OAAO,KAAK,KAAK,KAAK,GAAG,EAAE,MAAM,cAAc,GAAG,MAAM,CAAC,QAAQ,CAAC;AAC5G;;;;;;;;AASA,eAAsB,WAAW,MAAc,WAA8B,WAA8B,KAAU;CACpH,MAAM,gBAAgB,OAAO,KAAK,eAAe,SAAS,GAAG,KAAK;CAClE,MAAM,OAAO,OAAO,SAAS,IAAI,IAC9B,OAAO,OAAO,CAAC,OAAO,KAAK,eAAe,SAAS,CAAC,GAAG,IAAI,CAAC,IAC5D,OAAO,KAAK,GAAG,eAAe,SAAS,IAAI,MAAM;CAEpD,OAAO,UAAU,OAAO,OAAO,eAAe,KAAK,eAAe,OAAO,KAAK,IAAI,CAAC;AACpF"}
1
+ {"version":3,"file":"security-pO7x9isF.js","names":[],"sources":["../../src/lib/utils/security.ts"],"sourcesContent":["import { webcrypto } from 'node:crypto';\n\nexport type HeaderValue = string | string[];\nexport type Key = webcrypto.CryptoKey;\n\nconst AlgorithmName = 'Ed25519';\n\nfunction headerToString(header: HeaderValue): string {\n\treturn typeof header === 'string' ? header : header[0];\n}\n\nexport function makeKey(key: string): Promise<Key> {\n\treturn webcrypto.subtle.importKey('raw', Buffer.from(key, 'hex'), { name: AlgorithmName }, true, ['verify']);\n}\n\n/**\n * Validates a payload from Discord against its signature and key.\n * @param body The request body.\n * @param signature The value of the `x-signature-ed25519` header.\n * @param signature The value of the `x-signature-timestamp` header.\n * @param key The public key from the Discord developer dashboard, generated by {@link makeKey}\n */\nexport async function verifyBody(body: string, signature: string | string[], timestamp: string | string[], key: Key) {\n\tconst signatureData = Buffer.from(headerToString(signature), 'hex');\n\tconst data = Buffer.isBuffer(body)\n\t\t? Buffer.concat([Buffer.from(headerToString(timestamp)), body])\n\t\t: Buffer.from(`${headerToString(timestamp)}${body}`);\n\n\treturn webcrypto.subtle.verify(AlgorithmName, key, signatureData, Buffer.from(data));\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAKA,MAAM,gBAAgB;AAEtB,SAAS,eAAe,QAA6B;CACpD,OAAO,OAAO,WAAW,WAAW,SAAS,OAAO;AACrD;AAEA,SAAgB,QAAQ,KAA2B;CAClD,OAAO,UAAU,OAAO,UAAU,OAAO,OAAO,KAAK,KAAK,KAAK,GAAG,EAAE,MAAM,cAAc,GAAG,MAAM,CAAC,QAAQ,CAAC;AAC5G;;;;;;;;AASA,eAAsB,WAAW,MAAc,WAA8B,WAA8B,KAAU;CACpH,MAAM,gBAAgB,OAAO,KAAK,eAAe,SAAS,GAAG,KAAK;CAClE,MAAM,OAAO,OAAO,SAAS,IAAI,IAC9B,OAAO,OAAO,CAAC,OAAO,KAAK,eAAe,SAAS,CAAC,GAAG,IAAI,CAAC,IAC5D,OAAO,KAAK,GAAG,eAAe,SAAS,IAAI,MAAM;CAEpD,OAAO,UAAU,OAAO,OAAO,eAAe,KAAK,eAAe,OAAO,KAAK,IAAI,CAAC;AACpF"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@wolfstar/http-framework",
3
- "version": "4.0.0",
3
+ "version": "4.0.1-next-20260914150239",
4
4
  "description": "The framework for Star Network's HTTP-only bots",
5
5
  "keywords": [
6
6
  "api",
@@ -72,12 +72,12 @@
72
72
  "chokidar": "^5.0.0",
73
73
  "discord-api-types": "^0.38.8",
74
74
  "mlly": "^1.8.2",
75
- "unimport": "^6.4.0"
75
+ "unimport": "^6.5.0"
76
76
  },
77
77
  "devDependencies": {
78
78
  "@vitest/coverage-v8": "^4.1.11",
79
79
  "golar": "^0.1.10",
80
- "tsdown": "^0.22.14",
80
+ "tsdown": "^0.23.0",
81
81
  "typescript": "~7.0.2",
82
82
  "vitest": "^4.1.11"
83
83
  },