@discordjs/rest 2.6.0 → 2.6.2

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/README.md CHANGED
@@ -5,12 +5,13 @@
5
5
  </p>
6
6
  <br />
7
7
  <p>
8
- <a href="https://discord.gg/djs"><img src="https://img.shields.io/discord/222078108977594368?color=5865F2&logo=discord&logoColor=white" alt="Discord server" /></a>
8
+ <a href="https://discord.gg/djs"><img src="https://img.shields.io/badge/join_us-on_discord-5865F2?logo=discord&logoColor=white" alt="Discord server" /></a>
9
9
  <a href="https://www.npmjs.com/package/@discordjs/rest"><img src="https://img.shields.io/npm/v/@discordjs/rest.svg?maxAge=3600" alt="npm version" /></a>
10
10
  <a href="https://www.npmjs.com/package/@discordjs/rest"><img src="https://img.shields.io/npm/dt/@discordjs/rest.svg?maxAge=3600" alt="npm downloads" /></a>
11
11
  <a href="https://github.com/discordjs/discord.js/actions"><img src="https://github.com/discordjs/discord.js/actions/workflows/test.yml/badge.svg" alt="Tests status" /></a>
12
- <a href="https://github.com/discordjs/discord.js/commits/main/packages/rest" ><img alt="Last commit." src="https://img.shields.io/github/last-commit/discordjs/discord.js?logo=github&logoColor=ffffff&path=packages%2Frest"></a>
13
- <a href="https://codecov.io/gh/discordjs/discord.js" ><img src="https://codecov.io/gh/discordjs/discord.js/branch/main/graph/badge.svg?precision=2&flag=rest" alt="Code coverage" /></a>
12
+ <a href="https://github.com/discordjs/discord.js/commits/main/packages/rest"><img alt="Last commit." src="https://img.shields.io/github/last-commit/discordjs/discord.js?logo=github&logoColor=ffffff&path=packages%2Frest" /></a>
13
+ <a href="https://opencollective.com/discordjs"><img src="https://img.shields.io/opencollective/backers/discordjs?maxAge=3600&logo=opencollective" alt="backers" /></a>
14
+ <a href="https://codecov.io/gh/discordjs/discord.js"><img src="https://codecov.io/gh/discordjs/discord.js/branch/main/graph/badge.svg?precision=2&flag=rest" alt="Code coverage" /></a>
14
15
  </p>
15
16
  <p>
16
17
  <a href="https://vercel.com/?utm_source=discordjs&utm_campaign=oss"><img src="https://raw.githubusercontent.com/discordjs/discord.js/main/.github/powered-by-vercel.svg" alt="Vercel" /></a>
@@ -109,7 +110,7 @@ try {
109
110
  - [Guide][guide] ([source][guide-source])
110
111
  Also see the v13 to v14 [Update Guide][guide-update], which includes updated and removed items from the library.
111
112
  - [discord.js Discord server][discord]
112
- - [Discord API Discord server][discord-api]
113
+ - [Discord Developers Discord server][discord-developers]
113
114
  - [GitHub][source]
114
115
  - [npm][npm]
115
116
  - [Related libraries][related-libs]
@@ -127,12 +128,12 @@ If you don't understand something in the documentation, you are experiencing pro
127
128
  [website]: https://discord.js.org
128
129
  [website-source]: https://github.com/discordjs/discord.js/tree/main/apps/website
129
130
  [documentation]: https://discord.js.org/docs/packages/rest/stable
130
- [guide]: https://discordjs.guide/
131
- [guide-source]: https://github.com/discordjs/guide
132
- [guide-update]: https://discordjs.guide/additional-info/changes-in-v14.html
131
+ [guide]: https://discordjs.guide
132
+ [guide-source]: https://github.com/discordjs/discord.js/tree/main/apps/guide
133
+ [guide-update]: https://discordjs.guide/legacy/additional-info/changes-in-v14
133
134
  [discord]: https://discord.gg/djs
134
- [discord-api]: https://discord.gg/discord-api
135
+ [discord-developers]: https://discord.gg/discord-developers
135
136
  [source]: https://github.com/discordjs/discord.js/tree/main/packages/rest
136
137
  [npm]: https://www.npmjs.com/package/@discordjs/rest
137
- [related-libs]: https://discord.com/developers/docs/topics/community-resources#libraries
138
+ [related-libs]: https://docs.discord.com/developers/developer-tools/community-resources#libraries
138
139
  [contributing]: https://github.com/discordjs/discord.js/blob/main/.github/CONTRIBUTING.md
package/dist/index.d.mts CHANGED
@@ -1,13 +1,13 @@
1
- import * as url from 'url';
2
- import { ImageSize, Snowflake } from 'discord-api-types/v10';
3
- export { ImageSize } from 'discord-api-types/v10';
1
+ import * as undici from 'undici';
2
+ import { RequestInit, BodyInit, Agent, Response, Dispatcher } from 'undici';
4
3
  import { Readable } from 'node:stream';
5
4
  import { ReadableStream } from 'node:stream/web';
6
5
  import { Collection } from '@discordjs/collection';
7
6
  import { Awaitable } from '@discordjs/util';
8
- import * as undici from 'undici';
9
- import { RequestInit, Dispatcher, Response, BodyInit, Agent } from 'undici';
7
+ import { ImageSize, Snowflake } from 'discord-api-types/v10';
8
+ export { ImageSize } from 'discord-api-types/v10';
10
9
  import { AsyncEventEmitter } from '@vladfrangu/async_event_emitter';
10
+ import * as url from 'url';
11
11
 
12
12
  interface IHandler {
13
13
  /**
package/dist/index.d.ts CHANGED
@@ -1,13 +1,13 @@
1
- import * as url from 'url';
2
- import { ImageSize, Snowflake } from 'discord-api-types/v10';
3
- export { ImageSize } from 'discord-api-types/v10';
1
+ import * as undici from 'undici';
2
+ import { RequestInit, BodyInit, Agent, Response, Dispatcher } from 'undici';
4
3
  import { Readable } from 'node:stream';
5
4
  import { ReadableStream } from 'node:stream/web';
6
5
  import { Collection } from '@discordjs/collection';
7
6
  import { Awaitable } from '@discordjs/util';
8
- import * as undici from 'undici';
9
- import { RequestInit, Dispatcher, Response, BodyInit, Agent } from 'undici';
7
+ import { ImageSize, Snowflake } from 'discord-api-types/v10';
8
+ export { ImageSize } from 'discord-api-types/v10';
10
9
  import { AsyncEventEmitter } from '@vladfrangu/async_event_emitter';
10
+ import * as url from 'url';
11
11
 
12
12
  interface IHandler {
13
13
  /**
package/dist/index.js CHANGED
@@ -19,8 +19,8 @@ var __copyProps = (to, from, except, desc) => {
19
19
  var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
20
20
 
21
21
  // src/index.ts
22
- var src_exports = {};
23
- __export(src_exports, {
22
+ var index_exports = {};
23
+ __export(index_exports, {
24
24
  ALLOWED_EXTENSIONS: () => ALLOWED_EXTENSIONS,
25
25
  ALLOWED_SIZES: () => ALLOWED_SIZES,
26
26
  ALLOWED_STICKER_EXTENSIONS: () => ALLOWED_STICKER_EXTENSIONS,
@@ -42,7 +42,7 @@ __export(src_exports, {
42
42
  parseResponse: () => parseResponse,
43
43
  version: () => version
44
44
  });
45
- module.exports = __toCommonJS(src_exports);
45
+ module.exports = __toCommonJS(index_exports);
46
46
  var import_node_buffer = require("buffer");
47
47
  var import_util2 = require("@discordjs/util");
48
48
  var import_undici2 = require("undici");
@@ -127,7 +127,7 @@ var import_v102 = require("discord-api-types/v10");
127
127
  // src/lib/utils/constants.ts
128
128
  var import_util = require("@discordjs/util");
129
129
  var import_v10 = require("discord-api-types/v10");
130
- var DefaultUserAgent = `DiscordBot (https://discord.js.org, 2.6.0)`;
130
+ var DefaultUserAgent = `DiscordBot (https://discord.js.org, 2.6.2)`;
131
131
  var DefaultUserAgentAppendix = (0, import_util.getUserAgentAppendix)();
132
132
  var DefaultRestOptions = {
133
133
  agent: null,
@@ -343,6 +343,8 @@ var CDN = class {
343
343
  this.cdn = cdn;
344
344
  this.mediaProxy = mediaProxy;
345
345
  }
346
+ cdn;
347
+ mediaProxy;
346
348
  static {
347
349
  __name(this, "CDN");
348
350
  }
@@ -623,6 +625,11 @@ var DiscordAPIError = class _DiscordAPIError extends Error {
623
625
  this.url = url;
624
626
  this.requestBody = { files: bodyData.files, json: bodyData.body };
625
627
  }
628
+ rawError;
629
+ code;
630
+ status;
631
+ method;
632
+ url;
626
633
  static {
627
634
  __name(this, "DiscordAPIError");
628
635
  }
@@ -679,6 +686,9 @@ var HTTPError = class _HTTPError extends Error {
679
686
  this.url = url;
680
687
  this.requestBody = { files: bodyData.files, json: bodyData.body };
681
688
  }
689
+ status;
690
+ method;
691
+ url;
682
692
  static {
683
693
  __name(this, "HTTPError");
684
694
  }
@@ -779,6 +789,9 @@ var BurstHandler = class {
779
789
  this.majorParameter = majorParameter;
780
790
  this.id = `${hash}:${majorParameter}`;
781
791
  }
792
+ manager;
793
+ hash;
794
+ majorParameter;
782
795
  static {
783
796
  __name(this, "BurstHandler");
784
797
  }
@@ -886,6 +899,9 @@ var SequentialHandler = class {
886
899
  this.majorParameter = majorParameter;
887
900
  this.id = `${hash}:${majorParameter}`;
888
901
  }
902
+ manager;
903
+ hash;
904
+ majorParameter;
889
905
  static {
890
906
  __name(this, "SequentialHandler");
891
907
  }
@@ -1483,7 +1499,7 @@ var REST = class _REST extends import_async_event_emitter.AsyncEventEmitter {
1483
1499
  };
1484
1500
 
1485
1501
  // src/shared.ts
1486
- var version = "2.6.0";
1502
+ var version = "2.6.2";
1487
1503
 
1488
1504
  // src/index.ts
1489
1505
  globalThis.FormData ??= import_undici2.FormData;