seyfert 3.0.1-dev-14656752310.0 → 3.0.1-dev-14657186698.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.
package/lib/api/api.d.ts CHANGED
@@ -1,3 +1,4 @@
1
+ import { type UUID } from 'node:crypto';
1
2
  import { type Awaitable, Logger } from '../common';
2
3
  import type { WorkerSendApiRequest } from '../websocket/discord/worker';
3
4
  import type { APIRoutes } from './Routes';
@@ -8,7 +9,6 @@ export interface ApiHandler {
8
9
  }
9
10
  export type OnRatelimitCallback = (response: Response, request: ApiRequestOptions) => Awaitable<any>;
10
11
  export declare class ApiHandler {
11
- #private;
12
12
  options: ApiHandlerInternalOptions;
13
13
  globalBlock: boolean;
14
14
  ratelimits: Map<string, Bucket>;
@@ -23,7 +23,8 @@ export declare class ApiHandler {
23
23
  set debug(active: boolean);
24
24
  get proxy(): APIRoutes;
25
25
  globalUnblock(): void;
26
- private sendMessage;
26
+ randomUUID(): UUID;
27
+ protected sendMessage(_body: WorkerSendApiRequest): void;
27
28
  protected postMessage<T = unknown>(body: WorkerSendApiRequest): Promise<T>;
28
29
  request<T = unknown>(method: HttpMethods, url: `/${string}`, { auth, ...request }?: ApiRequestOptions): Promise<T>;
29
30
  parseError(method: HttpMethods, route: `/${string}`, response: Response, result: string | Record<string, any>): Error;
package/lib/api/api.js CHANGED
@@ -72,10 +72,10 @@ class ApiHandler {
72
72
  cb();
73
73
  }
74
74
  }
75
- #randomUUID() {
75
+ randomUUID() {
76
76
  const uuid = (0, node_crypto_1.randomUUID)();
77
77
  if (this.workerPromises.has(uuid))
78
- return this.#randomUUID();
78
+ return this.randomUUID();
79
79
  return uuid;
80
80
  }
81
81
  sendMessage(_body) {
@@ -89,7 +89,7 @@ class ApiHandler {
89
89
  }
90
90
  async request(method, url, { auth = true, ...request } = {}) {
91
91
  if (this.options.workerProxy) {
92
- const nonce = this.#randomUUID();
92
+ const nonce = this.randomUUID();
93
93
  return this.postMessage({
94
94
  method,
95
95
  url,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "seyfert",
3
- "version": "3.0.1-dev-14656752310.0",
3
+ "version": "3.0.1-dev-14657186698.0",
4
4
  "description": "The most advanced framework for discord bots",
5
5
  "main": "./lib/index.js",
6
6
  "module": "./lib/index.js",