@discordjs/rest 0.5.0-dev.1651147752-679dcda → 0.5.0-dev.1652400670-aed687b
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.js +150 -92
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +149 -91
- package/dist/index.mjs.map +1 -1
- package/dist/lib/REST.d.ts +15 -8
- package/dist/lib/RequestManager.d.ts +20 -7
- package/dist/lib/errors/HTTPError.d.ts +1 -2
- package/dist/lib/handlers/IHandler.d.ts +2 -2
- package/dist/lib/handlers/SequentialHandler.d.ts +3 -3
- package/dist/lib/utils/constants.d.ts +0 -1
- package/dist/lib/utils/utils.d.ts +8 -3
- package/package.json +3 -6
|
@@ -1,4 +1,8 @@
|
|
|
1
|
-
|
|
1
|
+
/// <reference types="node" />
|
|
2
|
+
import { URLSearchParams } from 'node:url';
|
|
3
|
+
import { type Dispatcher, type RequestInit } from 'undici';
|
|
4
|
+
import type { RequestOptions } from '../REST';
|
|
5
|
+
export declare function parseHeader(header: string | string[] | undefined): string | undefined;
|
|
2
6
|
/**
|
|
3
7
|
* Creates and populates an URLSearchParams instance from an object, stripping
|
|
4
8
|
* out null and undefined values, while also coercing non-strings to strings.
|
|
@@ -8,9 +12,9 @@ import type { Response } from 'node-fetch';
|
|
|
8
12
|
export declare function makeURLSearchParams(options?: Record<string, unknown>): URLSearchParams;
|
|
9
13
|
/**
|
|
10
14
|
* Converts the response to usable data
|
|
11
|
-
* @param res The
|
|
15
|
+
* @param res The fetch response
|
|
12
16
|
*/
|
|
13
|
-
export declare function parseResponse(res:
|
|
17
|
+
export declare function parseResponse(res: Dispatcher.ResponseData): Promise<unknown>;
|
|
14
18
|
/**
|
|
15
19
|
* Check whether a request falls under a sublimit
|
|
16
20
|
* @param bucketRoute The buckets route identifier
|
|
@@ -19,3 +23,4 @@ export declare function parseResponse(res: Response): Promise<unknown>;
|
|
|
19
23
|
* @returns Whether the request falls under a sublimit
|
|
20
24
|
*/
|
|
21
25
|
export declare function hasSublimit(bucketRoute: string, body?: unknown, method?: string): boolean;
|
|
26
|
+
export declare function resolveBody(body: RequestInit['body']): Promise<RequestOptions['body']>;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@discordjs/rest",
|
|
3
|
-
"version": "0.5.0-dev.
|
|
3
|
+
"version": "0.5.0-dev.1652400670-aed687b",
|
|
4
4
|
"description": "The REST API for discord.js",
|
|
5
5
|
"scripts": {
|
|
6
6
|
"build": "tsup && tsc --emitDeclarationOnly --incremental",
|
|
@@ -53,11 +53,9 @@
|
|
|
53
53
|
"@discordjs/collection": "^0.7.0-dev",
|
|
54
54
|
"@sapphire/async-queue": "^1.3.1",
|
|
55
55
|
"@sapphire/snowflake": "^3.2.1",
|
|
56
|
-
"@types/node-fetch": "^2.6.1",
|
|
57
56
|
"discord-api-types": "^0.29.0",
|
|
58
|
-
"
|
|
59
|
-
"
|
|
60
|
-
"tslib": "^2.3.1"
|
|
57
|
+
"tslib": "^2.3.1",
|
|
58
|
+
"undici": "^5.2.0"
|
|
61
59
|
},
|
|
62
60
|
"devDependencies": {
|
|
63
61
|
"@babel/core": "^7.17.9",
|
|
@@ -75,7 +73,6 @@
|
|
|
75
73
|
"eslint-config-prettier": "^8.5.0",
|
|
76
74
|
"eslint-plugin-import": "^2.26.0",
|
|
77
75
|
"jest": "^27.5.1",
|
|
78
|
-
"nock": "^13.2.4",
|
|
79
76
|
"prettier": "^2.6.2",
|
|
80
77
|
"tsup": "^5.12.5",
|
|
81
78
|
"typedoc": "^0.22.15",
|