@discordjs/rest 1.7.0-dev.1680307811-34bc36a.0 → 1.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.
- package/CHANGELOG.md +12 -0
- package/README.md +8 -5
- package/dist/index.d.ts +7 -3
- package/dist/index.js +6 -3
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +5 -3
- package/dist/index.mjs.map +1 -1
- package/package.json +5 -5
package/CHANGELOG.md
CHANGED
|
@@ -2,6 +2,18 @@
|
|
|
2
2
|
|
|
3
3
|
All notable changes to this project will be documented in this file.
|
|
4
4
|
|
|
5
|
+
# [@discordjs/rest@1.7.0](https://github.com/discordjs/discord.js/compare/@discordjs/rest@1.6.0...@discordjs/rest@1.7.0) - (2023-04-01)
|
|
6
|
+
|
|
7
|
+
## Bug Fixes
|
|
8
|
+
|
|
9
|
+
- **handlers:** Create burst handler for interaction callbacks (#8996) ([db8df10](https://github.com/discordjs/discord.js/commit/db8df104c5e70a12f35b54e5f3f7c897068dde6f))
|
|
10
|
+
- **scripts:** Accessing tsComment ([d8d5f31](https://github.com/discordjs/discord.js/commit/d8d5f31d3927fd1de62f1fa3a1a6e454243ad87b))
|
|
11
|
+
- **rest:** Remove `const enum`s in favour of regular enums (#9243) ([229ad07](https://github.com/discordjs/discord.js/commit/229ad077ff52d8706d68ed4d31983619a32eba45))
|
|
12
|
+
|
|
13
|
+
## Features
|
|
14
|
+
|
|
15
|
+
- **website:** Render syntax and mdx on the server (#9086) ([ee5169e](https://github.com/discordjs/discord.js/commit/ee5169e0aadd7bbfcd752aae614ec0f69602b68b))
|
|
16
|
+
|
|
5
17
|
# [@discordjs/rest@1.6.0](https://github.com/discordjs/discord.js/compare/@discordjs/rest@1.5.0...@discordjs/rest@1.6.0) - (2023-03-12)
|
|
6
18
|
|
|
7
19
|
## Bug Fixes
|
package/README.md
CHANGED
|
@@ -16,6 +16,10 @@
|
|
|
16
16
|
</p>
|
|
17
17
|
</div>
|
|
18
18
|
|
|
19
|
+
## About
|
|
20
|
+
|
|
21
|
+
`@discord.js/rest` is a module that allows you to easily make REST requests to the Discord API.
|
|
22
|
+
|
|
19
23
|
## Installation
|
|
20
24
|
|
|
21
25
|
**Node.js 16.9.0 or newer is required.**
|
|
@@ -80,7 +84,7 @@ try {
|
|
|
80
84
|
- [Website][website] ([source][website-source])
|
|
81
85
|
- [Documentation][documentation]
|
|
82
86
|
- [Guide][guide] ([source][guide-source])
|
|
83
|
-
|
|
87
|
+
Also see the v13 to v14 [Update Guide][guide-update], which includes updated and removed items from the library.
|
|
84
88
|
- [discord.js Discord server][discord]
|
|
85
89
|
- [Discord API Discord server][discord-api]
|
|
86
90
|
- [GitHub][source]
|
|
@@ -95,12 +99,11 @@ See [the contribution guide][contributing] if you'd like to submit a PR.
|
|
|
95
99
|
|
|
96
100
|
## Help
|
|
97
101
|
|
|
98
|
-
If you don't understand something in the documentation, you are experiencing problems, or you just need a gentle
|
|
99
|
-
nudge in the right direction, please don't hesitate to join our official [discord.js Server][discord].
|
|
102
|
+
If you don't understand something in the documentation, you are experiencing problems, or you just need a gentle nudge in the right direction, please don't hesitate to join our official [discord.js Server][discord].
|
|
100
103
|
|
|
101
|
-
[website]: https://discord.js.org
|
|
104
|
+
[website]: https://discord.js.org
|
|
102
105
|
[website-source]: https://github.com/discordjs/discord.js/tree/main/apps/website
|
|
103
|
-
[documentation]: https://discord.js.org
|
|
106
|
+
[documentation]: https://discord.js.org/docs/packages/rest/stable
|
|
104
107
|
[guide]: https://discordjs.guide/
|
|
105
108
|
[guide-source]: https://github.com/discordjs/guide
|
|
106
109
|
[guide-update]: https://discordjs.guide/additional-info/changes-in-v14.html
|
package/dist/index.d.ts
CHANGED
|
@@ -5,6 +5,10 @@ import { URLSearchParams } from 'node:url';
|
|
|
5
5
|
import { Collection } from '@discordjs/collection';
|
|
6
6
|
|
|
7
7
|
declare const DefaultUserAgent: `DiscordBot (https://discord.js.org, ${string})`;
|
|
8
|
+
/**
|
|
9
|
+
* The default string to append onto the user agent.
|
|
10
|
+
*/
|
|
11
|
+
declare const DefaultUserAgentAppendix: string;
|
|
8
12
|
declare const DefaultRestOptions: {
|
|
9
13
|
readonly agent: Agent;
|
|
10
14
|
readonly api: "https://discord.com/api";
|
|
@@ -17,7 +21,7 @@ declare const DefaultRestOptions: {
|
|
|
17
21
|
readonly rejectOnRateLimit: null;
|
|
18
22
|
readonly retries: 3;
|
|
19
23
|
readonly timeout: 15000;
|
|
20
|
-
readonly userAgentAppendix:
|
|
24
|
+
readonly userAgentAppendix: string;
|
|
21
25
|
readonly version: "10";
|
|
22
26
|
readonly hashSweepInterval: 14400000;
|
|
23
27
|
readonly hashLifetime: 86400000;
|
|
@@ -361,7 +365,7 @@ interface RESTOptions {
|
|
|
361
365
|
/**
|
|
362
366
|
* Extra information to add to the user agent
|
|
363
367
|
*
|
|
364
|
-
* @defaultValue
|
|
368
|
+
* @defaultValue DefaultUserAgentAppendix
|
|
365
369
|
*/
|
|
366
370
|
userAgentAppendix: string;
|
|
367
371
|
/**
|
|
@@ -868,4 +872,4 @@ declare function parseResponse(res: Dispatcher.ResponseData): Promise<unknown>;
|
|
|
868
872
|
*/
|
|
869
873
|
declare const version: string;
|
|
870
874
|
|
|
871
|
-
export { ALLOWED_EXTENSIONS, ALLOWED_SIZES, ALLOWED_STICKER_EXTENSIONS, APIRequest, BaseImageURLOptions, BurstHandlerMajorIdKey, CDN, DefaultRestOptions, DefaultUserAgent, DiscordAPIError, DiscordErrorData, HTTPError, HandlerRequestData, HashData, ImageExtension, ImageSize, ImageURLOptions, InternalRequest, InvalidRequestWarningData, MakeURLOptions, OAuthErrorData, OverwrittenMimeTypes, REST, RESTEvents, RESTOptions, RateLimitData, RateLimitError, RateLimitQueueFilter, RawFile, RequestBody, RequestData, RequestHeaders, RequestManager, RequestMethod, RequestOptions, RestEvents, RouteData, RouteLike, StickerExtension, makeURLSearchParams, parseResponse, version };
|
|
875
|
+
export { ALLOWED_EXTENSIONS, ALLOWED_SIZES, ALLOWED_STICKER_EXTENSIONS, APIRequest, BaseImageURLOptions, BurstHandlerMajorIdKey, CDN, DefaultRestOptions, DefaultUserAgent, DefaultUserAgentAppendix, DiscordAPIError, DiscordErrorData, HTTPError, HandlerRequestData, HashData, ImageExtension, ImageSize, ImageURLOptions, InternalRequest, InvalidRequestWarningData, MakeURLOptions, OAuthErrorData, OverwrittenMimeTypes, REST, RESTEvents, RESTOptions, RateLimitData, RateLimitError, RateLimitQueueFilter, RawFile, RequestBody, RequestData, RequestHeaders, RequestManager, RequestMethod, RequestOptions, RestEvents, RouteData, RouteLike, StickerExtension, makeURLSearchParams, parseResponse, version };
|
package/dist/index.js
CHANGED
|
@@ -38,6 +38,7 @@ __export(src_exports, {
|
|
|
38
38
|
CDN: () => CDN,
|
|
39
39
|
DefaultRestOptions: () => DefaultRestOptions,
|
|
40
40
|
DefaultUserAgent: () => DefaultUserAgent,
|
|
41
|
+
DefaultUserAgentAppendix: () => DefaultUserAgentAppendix,
|
|
41
42
|
DiscordAPIError: () => DiscordAPIError,
|
|
42
43
|
HTTPError: () => HTTPError,
|
|
43
44
|
OverwrittenMimeTypes: () => OverwrittenMimeTypes,
|
|
@@ -59,7 +60,8 @@ var import_node_url = require("url");
|
|
|
59
60
|
var import_node_process = __toESM(require("process"));
|
|
60
61
|
var import_v10 = require("discord-api-types/v10");
|
|
61
62
|
var import_undici = require("undici");
|
|
62
|
-
var DefaultUserAgent = `DiscordBot (https://discord.js.org, 1.7.0
|
|
63
|
+
var DefaultUserAgent = `DiscordBot (https://discord.js.org, 1.7.0)`;
|
|
64
|
+
var DefaultUserAgentAppendix = import_node_process.default.release?.name === "node" ? `Node.js/${import_node_process.default.version}` : "";
|
|
63
65
|
var DefaultRestOptions = {
|
|
64
66
|
get agent() {
|
|
65
67
|
return new import_undici.Agent({
|
|
@@ -78,7 +80,7 @@ var DefaultRestOptions = {
|
|
|
78
80
|
rejectOnRateLimit: null,
|
|
79
81
|
retries: 3,
|
|
80
82
|
timeout: 15e3,
|
|
81
|
-
userAgentAppendix:
|
|
83
|
+
userAgentAppendix: DefaultUserAgentAppendix,
|
|
82
84
|
version: import_v10.APIVersion,
|
|
83
85
|
hashSweepInterval: 144e5,
|
|
84
86
|
// 4 Hours
|
|
@@ -1397,7 +1399,7 @@ var REST = class extends import_node_events2.EventEmitter {
|
|
|
1397
1399
|
__name(REST, "REST");
|
|
1398
1400
|
|
|
1399
1401
|
// src/index.ts
|
|
1400
|
-
var version = "1.7.0
|
|
1402
|
+
var version = "1.7.0";
|
|
1401
1403
|
// Annotate the CommonJS export names for ESM import in node:
|
|
1402
1404
|
0 && (module.exports = {
|
|
1403
1405
|
ALLOWED_EXTENSIONS,
|
|
@@ -1407,6 +1409,7 @@ var version = "1.7.0-dev.1680307811-34bc36a.0";
|
|
|
1407
1409
|
CDN,
|
|
1408
1410
|
DefaultRestOptions,
|
|
1409
1411
|
DefaultUserAgent,
|
|
1412
|
+
DefaultUserAgentAppendix,
|
|
1410
1413
|
DiscordAPIError,
|
|
1411
1414
|
HTTPError,
|
|
1412
1415
|
OverwrittenMimeTypes,
|