@discordjs/rest 3.0.0-dev.1765324923-548d75258 → 3.0.0-dev.1765454516-df0c28afc
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 +6 -6
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +6 -6
- package/dist/index.mjs.map +1 -1
- package/dist/strategies/undiciRequest.js +4 -4
- package/dist/strategies/undiciRequest.js.map +1 -1
- package/dist/strategies/undiciRequest.mjs +3 -3
- package/dist/strategies/undiciRequest.mjs.map +1 -1
- package/dist/web.js +2 -2
- package/dist/web.js.map +1 -1
- package/dist/web.mjs +2 -2
- package/dist/web.mjs.map +1 -1
- package/package.json +5 -5
package/dist/index.mjs
CHANGED
|
@@ -16,8 +16,8 @@ function getDefaultStrategy() {
|
|
|
16
16
|
__name(getDefaultStrategy, "getDefaultStrategy");
|
|
17
17
|
|
|
18
18
|
// src/strategies/undiciRequest.ts
|
|
19
|
+
import { Buffer as Buffer2 } from "buffer";
|
|
19
20
|
import { STATUS_CODES } from "http";
|
|
20
|
-
import { URLSearchParams as URLSearchParams2 } from "url";
|
|
21
21
|
import { types } from "util";
|
|
22
22
|
import { request, Headers, FormData as UndiciFormData, Agent } from "undici";
|
|
23
23
|
var localAgent = null;
|
|
@@ -61,7 +61,7 @@ async function resolveBody(body) {
|
|
|
61
61
|
return body;
|
|
62
62
|
} else if (types.isArrayBuffer(body)) {
|
|
63
63
|
return new Uint8Array(body);
|
|
64
|
-
} else if (body instanceof
|
|
64
|
+
} else if (body instanceof URLSearchParams) {
|
|
65
65
|
return body.toString();
|
|
66
66
|
} else if (body instanceof DataView) {
|
|
67
67
|
return new Uint8Array(body.buffer);
|
|
@@ -73,13 +73,13 @@ async function resolveBody(body) {
|
|
|
73
73
|
return globalToUndiciFormData(body);
|
|
74
74
|
} else if (body[Symbol.iterator]) {
|
|
75
75
|
const chunks = [...body];
|
|
76
|
-
return
|
|
76
|
+
return Buffer2.concat(chunks);
|
|
77
77
|
} else if (body[Symbol.asyncIterator]) {
|
|
78
78
|
const chunks = [];
|
|
79
79
|
for await (const chunk of body) {
|
|
80
80
|
chunks.push(chunk);
|
|
81
81
|
}
|
|
82
|
-
return
|
|
82
|
+
return Buffer2.concat(chunks);
|
|
83
83
|
}
|
|
84
84
|
throw new TypeError(`Unable to resolve body.`);
|
|
85
85
|
}
|
|
@@ -103,7 +103,7 @@ import { CDNRoutes } from "discord-api-types/v10";
|
|
|
103
103
|
// src/lib/utils/constants.ts
|
|
104
104
|
import { getUserAgentAppendix } from "@discordjs/util";
|
|
105
105
|
import { APIVersion } from "discord-api-types/v10";
|
|
106
|
-
var DefaultUserAgent = `DiscordBot (https://discord.js.org, 3.0.0-dev.
|
|
106
|
+
var DefaultUserAgent = `DiscordBot (https://discord.js.org, 3.0.0-dev.1765454516-df0c28afc)`;
|
|
107
107
|
var DefaultUserAgentAppendix = getUserAgentAppendix();
|
|
108
108
|
var DefaultRestOptions = {
|
|
109
109
|
agent: null,
|
|
@@ -1504,7 +1504,7 @@ var REST = class _REST extends AsyncEventEmitter {
|
|
|
1504
1504
|
};
|
|
1505
1505
|
|
|
1506
1506
|
// src/shared.ts
|
|
1507
|
-
var version = "3.0.0-dev.
|
|
1507
|
+
var version = "3.0.0-dev.1765454516-df0c28afc";
|
|
1508
1508
|
|
|
1509
1509
|
// src/index.ts
|
|
1510
1510
|
setDefaultStrategy(shouldUseGlobalFetchAndWebSocket() ? fetch : makeRequest);
|