@discordjs/rest 1.3.0-dev.1664756107-b2ec865.0 → 1.3.0-dev.1665230658-33ec49d.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 +0 -39
- package/dist/index.d.ts +10 -2
- package/dist/index.js +8 -98
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +6 -98
- package/dist/index.mjs.map +1 -1
- package/package.json +15 -15
package/CHANGELOG.md
CHANGED
|
@@ -127,42 +127,3 @@ All notable changes to this project will be documented in this file.
|
|
|
127
127
|
## Testing
|
|
128
128
|
|
|
129
129
|
- **voice:** Fix tests ([62c74b8](https://github.com/discordjs/discord.js/commit/62c74b8333066465e5bd295b8b102b35a506751d))
|
|
130
|
-
|
|
131
|
-
# [0.2.0-canary.0](https://github.com/discordjs/discord.js-modules/compare/@discordjs/rest@0.1.1-canary.0...@discordjs/rest@0.2.0-canary.0) (2021-12-08)
|
|
132
|
-
|
|
133
|
-
## Bug Fixes
|
|
134
|
-
|
|
135
|
-
- **CDN#icon:** remove `guild` prefixes ([#67](https://github.com/discordjs/discord.js-modules/issues/67)) ([8882686](https://github.com/discordjs/discord.js-modules/commit/88826869d8ed3695f2b9475bea8d3b851df270bd))
|
|
136
|
-
- **Cdn:** make parameters immutable ([#84](https://github.com/discordjs/discord.js-modules/issues/84)) ([3105b61](https://github.com/discordjs/discord.js-modules/commit/3105b614da603dd3c8479dea089b5953d3c8b89b))
|
|
137
|
-
- **CDN:** use correct types ([#86](https://github.com/discordjs/discord.js-modules/issues/86)) ([64b02d4](https://github.com/discordjs/discord.js-modules/commit/64b02d4649a38802dd1a4e7a738ec64c27dea760))
|
|
138
|
-
- **Rest:** lint errors ([53c0cce](https://github.com/discordjs/discord.js-modules/commit/53c0ccefee80225ca7640cf88f44c68da99f31e7))
|
|
139
|
-
- use hash instead of animatedHash for default avatar test ([#74](https://github.com/discordjs/discord.js-modules/issues/74)) ([4852838](https://github.com/discordjs/discord.js-modules/commit/485283824cf368874096d59a64131970401218e9))
|
|
140
|
-
|
|
141
|
-
## Features
|
|
142
|
-
|
|
143
|
-
- **CDN#guildIcon:** implement dynamic logic ([#53](https://github.com/discordjs/discord.js-modules/issues/53)) ([c4b2803](https://github.com/discordjs/discord.js-modules/commit/c4b280366b0c5920c147126ccb9068f16fc898aa))
|
|
144
|
-
- **CDN:** add role icon endpoint ([#64](https://github.com/discordjs/discord.js-modules/issues/64)) ([4d7d692](https://github.com/discordjs/discord.js-modules/commit/4d7d692b4954c373941d2d8f3e3335a9a8543220))
|
|
145
|
-
- **CDN:** add sticker endpoints ([#60](https://github.com/discordjs/discord.js-modules/issues/60)) ([3b714ba](https://github.com/discordjs/discord.js-modules/commit/3b714bada415a7987dd6aa50c938751c66dc05be))
|
|
146
|
-
- **CDN:** guild member avatars ([#68](https://github.com/discordjs/discord.js-modules/issues/68)) ([90c25ad](https://github.com/discordjs/discord.js-modules/commit/90c25ad4afa5ec5906867f431afcaf11fb56355a))
|
|
147
|
-
- **Errors:** show data sent when an error occurs ([#72](https://github.com/discordjs/discord.js-modules/issues/72)) ([3e2edc8](https://github.com/discordjs/discord.js-modules/commit/3e2edc8974e2c62c324db0c151da4d34c289c40a))
|
|
148
|
-
- expose https agent options ([#82](https://github.com/discordjs/discord.js-modules/issues/82)) ([7f1c9be](https://github.com/discordjs/discord.js-modules/commit/7f1c9be817bbc6a4a11a726c952580dd3cb7b149))
|
|
149
|
-
- **RateLimits:** optionally error on ratelimits ([#77](https://github.com/discordjs/discord.js-modules/issues/77)) ([a371f0b](https://github.com/discordjs/discord.js-modules/commit/a371f0bc6c76cffaf048fd0fbf9c64a6c4d6619e))
|
|
150
|
-
- **RequestManager:** support setting global headers in options ([#70](https://github.com/discordjs/discord.js-modules/issues/70)) ([d1758c7](https://github.com/discordjs/discord.js-modules/commit/d1758c74b00a3f83c39745cd9af147a7f8f2b12b))
|
|
151
|
-
- **Requests:** add attachment keys and form data for stickers ([#81](https://github.com/discordjs/discord.js-modules/issues/81)) ([7c2b0c0](https://github.com/discordjs/discord.js-modules/commit/7c2b0c0e432b82776bb57c1708f3be6b4affde56))
|
|
152
|
-
- **Rest:** add response and request events ([#85](https://github.com/discordjs/discord.js-modules/issues/85)) ([c3aba56](https://github.com/discordjs/discord.js-modules/commit/c3aba567572e73548c38cd7c7f9945e9361833de))
|
|
153
|
-
- **REST:** change api version to v9 ([#62](https://github.com/discordjs/discord.js-modules/issues/62)) ([4c980e6](https://github.com/discordjs/discord.js-modules/commit/4c980e6ad6c0297519ec0f09ec27953764a4a12d))
|
|
154
|
-
- **Rest:** improve global rate limit and invalid request tracking ([#51](https://github.com/discordjs/discord.js-modules/issues/51)) ([b73cc06](https://github.com/discordjs/discord.js-modules/commit/b73cc060daa701de71815a824ebaccdc9ebf2859))
|
|
155
|
-
- **Rest:** use native Node.js AbortController ([#66](https://github.com/discordjs/discord.js-modules/issues/66)) ([3b53910](https://github.com/discordjs/discord.js-modules/commit/3b539102f07c413ffd3ee60718ac8e5a709bdd0e))
|
|
156
|
-
- **SequentialHandler:** add more info to debug when rate limit was hit ([#78](https://github.com/discordjs/discord.js-modules/issues/78)) ([a4e404b](https://github.com/discordjs/discord.js-modules/commit/a4e404b2e6df625a48176b9f1bfac6cfe86c5d66))
|
|
157
|
-
|
|
158
|
-
# [0.1.1-canary.0](https://github.com/discordjs/discord.js-modules/compare/@discordjs/rest@0.1.0-canary.0...@discordjs/rest@0.1.1-canary.0) (2021-08-24)
|
|
159
|
-
|
|
160
|
-
## Bug Fixes
|
|
161
|
-
|
|
162
|
-
- **Rest:** use reference type for DOM ([#55](https://github.com/discordjs/discord.js-modules/issues/55)) ([07f5aa7](https://github.com/discordjs/discord.js-modules/commit/07f5aa744092c16b0f05b05055e5d4bbd49754e7))
|
|
163
|
-
|
|
164
|
-
# 0.1.0-canary.0 (2021-06-29)
|
|
165
|
-
|
|
166
|
-
## Features
|
|
167
|
-
|
|
168
|
-
- **rest:** Implement rest module ([#34](https://github.com/discordjs/discord.js-modules/issues/34)) ([6990f0f](https://github.com/discordjs/discord.js-modules/commit/6990f0f7f3ca958a95f9b1b19681b42669743427))
|
package/dist/index.d.ts
CHANGED
|
@@ -521,7 +521,7 @@ declare class REST extends EventEmitter {
|
|
|
521
521
|
raw(options: InternalRequest): Promise<Dispatcher.ResponseData>;
|
|
522
522
|
}
|
|
523
523
|
|
|
524
|
-
declare const DefaultUserAgent
|
|
524
|
+
declare const DefaultUserAgent = "DiscordBot (https://discord.js.org, [VI]{{inject}}[/VI])";
|
|
525
525
|
declare const DefaultRestOptions: Required<RESTOptions>;
|
|
526
526
|
/**
|
|
527
527
|
* The events that the REST manager emits
|
|
@@ -839,4 +839,12 @@ declare function makeURLSearchParams(options?: Record<string, unknown>): URLSear
|
|
|
839
839
|
*/
|
|
840
840
|
declare function parseResponse(res: Dispatcher.ResponseData): Promise<unknown>;
|
|
841
841
|
|
|
842
|
-
|
|
842
|
+
/**
|
|
843
|
+
* The [\@discordjs/rest](https://github.com/discordjs/discord.js/blob/main/packages/rest/#readme) version
|
|
844
|
+
* that you are currently using.
|
|
845
|
+
*
|
|
846
|
+
* Note to developers: This needs to explicitly be `string` so it is not typed as a "const string" that gets injected by esbuild
|
|
847
|
+
*/
|
|
848
|
+
declare const version: string;
|
|
849
|
+
|
|
850
|
+
export { ALLOWED_EXTENSIONS, ALLOWED_SIZES, ALLOWED_STICKER_EXTENSIONS, APIRequest, BaseImageURLOptions, CDN, DefaultRestOptions, DefaultUserAgent, DiscordAPIError, DiscordErrorData, HTTPError, HandlerRequestData, HashData, ImageExtension, ImageSize, ImageURLOptions, InternalRequest, InvalidRequestWarningData, MakeURLOptions, OAuthErrorData, 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
|
@@ -6,9 +6,6 @@ var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
|
6
6
|
var __getProtoOf = Object.getPrototypeOf;
|
|
7
7
|
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
8
8
|
var __name = (target, value) => __defProp(target, "name", { value, configurable: true });
|
|
9
|
-
var __commonJS = (cb, mod) => function __require() {
|
|
10
|
-
return mod || (0, cb[__getOwnPropNames(cb)[0]])((mod = { exports: {} }).exports, mod), mod.exports;
|
|
11
|
-
};
|
|
12
9
|
var __export = (target, all) => {
|
|
13
10
|
for (var name in all)
|
|
14
11
|
__defProp(target, name, { get: all[name], enumerable: true });
|
|
@@ -27,97 +24,6 @@ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__ge
|
|
|
27
24
|
));
|
|
28
25
|
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
29
26
|
|
|
30
|
-
// package.json
|
|
31
|
-
var require_package = __commonJS({
|
|
32
|
-
"package.json"(exports, module2) {
|
|
33
|
-
module2.exports = {
|
|
34
|
-
name: "@discordjs/rest",
|
|
35
|
-
version: "1.3.0-dev.1664756107-b2ec865.0",
|
|
36
|
-
description: "The REST API for discord.js",
|
|
37
|
-
scripts: {
|
|
38
|
-
test: "vitest run",
|
|
39
|
-
build: "tsup",
|
|
40
|
-
lint: "prettier --check . && cross-env TIMING=1 eslint src __tests__ --ext mjs,js,ts",
|
|
41
|
-
format: "prettier --write . && cross-env TIMING=1 eslint src __tests__ --ext mjs,js,ts --fix",
|
|
42
|
-
fmt: "yarn format",
|
|
43
|
-
docs: "downlevel-dts dist docs/dist --to=3.7 && docgen -i src/index.ts -c docs/index.json -o docs/docs.json --typescript && api-extractor run --local",
|
|
44
|
-
prepack: "yarn lint && yarn test && yarn build",
|
|
45
|
-
changelog: "git cliff --prepend ./CHANGELOG.md -u -c ./cliff.toml -r ../../ --include-path 'packages/rest/*'",
|
|
46
|
-
release: "cliff-jumper"
|
|
47
|
-
},
|
|
48
|
-
main: "./dist/index.js",
|
|
49
|
-
module: "./dist/index.mjs",
|
|
50
|
-
typings: "./dist/index.d.ts",
|
|
51
|
-
exports: {
|
|
52
|
-
import: "./dist/index.mjs",
|
|
53
|
-
require: "./dist/index.js",
|
|
54
|
-
types: "./dist/index.d.ts"
|
|
55
|
-
},
|
|
56
|
-
directories: {
|
|
57
|
-
lib: "src",
|
|
58
|
-
test: "__tests__"
|
|
59
|
-
},
|
|
60
|
-
files: [
|
|
61
|
-
"dist"
|
|
62
|
-
],
|
|
63
|
-
contributors: [
|
|
64
|
-
"Crawl <icrawltogo@gmail.com>",
|
|
65
|
-
"Amish Shah <amishshah.2k@gmail.com>",
|
|
66
|
-
"SpaceEEC <spaceeec@yahoo.com>",
|
|
67
|
-
"Vlad Frangu <kingdgrizzle@gmail.com>",
|
|
68
|
-
"Aura Rom\xE1n <kyradiscord@gmail.com>"
|
|
69
|
-
],
|
|
70
|
-
license: "Apache-2.0",
|
|
71
|
-
keywords: [
|
|
72
|
-
"discord",
|
|
73
|
-
"api",
|
|
74
|
-
"rest",
|
|
75
|
-
"discordapp",
|
|
76
|
-
"discordjs"
|
|
77
|
-
],
|
|
78
|
-
repository: {
|
|
79
|
-
type: "git",
|
|
80
|
-
url: "git+https://github.com/discordjs/discord.js.git"
|
|
81
|
-
},
|
|
82
|
-
bugs: {
|
|
83
|
-
url: "https://github.com/discordjs/discord.js/issues"
|
|
84
|
-
},
|
|
85
|
-
homepage: "https://discord.js.org",
|
|
86
|
-
dependencies: {
|
|
87
|
-
"@discordjs/collection": "workspace:^",
|
|
88
|
-
"@discordjs/util": "workspace:^",
|
|
89
|
-
"@sapphire/async-queue": "^1.5.0",
|
|
90
|
-
"@sapphire/snowflake": "^3.2.2",
|
|
91
|
-
"discord-api-types": "^0.37.11",
|
|
92
|
-
"file-type": "^18.0.0",
|
|
93
|
-
tslib: "^2.4.0",
|
|
94
|
-
undici: "^5.10.0"
|
|
95
|
-
},
|
|
96
|
-
devDependencies: {
|
|
97
|
-
"@discordjs/docgen": "workspace:^",
|
|
98
|
-
"@favware/cliff-jumper": "^1.8.7",
|
|
99
|
-
"@microsoft/api-extractor": "^7.31.2",
|
|
100
|
-
"@types/node": "^16.11.60",
|
|
101
|
-
"@vitest/coverage-c8": "^0.23.4",
|
|
102
|
-
"cross-env": "^7.0.3",
|
|
103
|
-
"downlevel-dts": "^0.10.1",
|
|
104
|
-
eslint: "^8.24.0",
|
|
105
|
-
"eslint-config-neon": "^0.1.33",
|
|
106
|
-
prettier: "^2.7.1",
|
|
107
|
-
tsup: "^6.2.3",
|
|
108
|
-
typescript: "^4.8.3",
|
|
109
|
-
vitest: "^0.23.4"
|
|
110
|
-
},
|
|
111
|
-
engines: {
|
|
112
|
-
node: ">=16.9.0"
|
|
113
|
-
},
|
|
114
|
-
publishConfig: {
|
|
115
|
-
access: "public"
|
|
116
|
-
}
|
|
117
|
-
};
|
|
118
|
-
}
|
|
119
|
-
});
|
|
120
|
-
|
|
121
27
|
// src/index.ts
|
|
122
28
|
var src_exports = {};
|
|
123
29
|
__export(src_exports, {
|
|
@@ -135,7 +41,8 @@ __export(src_exports, {
|
|
|
135
41
|
RequestManager: () => RequestManager,
|
|
136
42
|
RequestMethod: () => RequestMethod,
|
|
137
43
|
makeURLSearchParams: () => makeURLSearchParams,
|
|
138
|
-
parseResponse: () => parseResponse
|
|
44
|
+
parseResponse: () => parseResponse,
|
|
45
|
+
version: () => version
|
|
139
46
|
});
|
|
140
47
|
module.exports = __toCommonJS(src_exports);
|
|
141
48
|
|
|
@@ -146,8 +53,7 @@ var import_node_url = require("url");
|
|
|
146
53
|
var import_node_process = __toESM(require("process"));
|
|
147
54
|
var import_v10 = require("discord-api-types/v10");
|
|
148
55
|
var import_undici = require("undici");
|
|
149
|
-
var
|
|
150
|
-
var DefaultUserAgent = `DiscordBot (${Package.homepage}, ${Package.version})`;
|
|
56
|
+
var DefaultUserAgent = `DiscordBot (https://discord.js.org, 1.3.0-dev.1665230658-33ec49d.0)`;
|
|
151
57
|
var DefaultRestOptions = {
|
|
152
58
|
get agent() {
|
|
153
59
|
return new import_undici.Agent({
|
|
@@ -1001,6 +907,9 @@ var REST = class extends import_node_events2.EventEmitter {
|
|
|
1001
907
|
}
|
|
1002
908
|
};
|
|
1003
909
|
__name(REST, "REST");
|
|
910
|
+
|
|
911
|
+
// src/index.ts
|
|
912
|
+
var version = "1.3.0-dev.1665230658-33ec49d.0";
|
|
1004
913
|
// Annotate the CommonJS export names for ESM import in node:
|
|
1005
914
|
0 && (module.exports = {
|
|
1006
915
|
ALLOWED_EXTENSIONS,
|
|
@@ -1017,6 +926,7 @@ __name(REST, "REST");
|
|
|
1017
926
|
RequestManager,
|
|
1018
927
|
RequestMethod,
|
|
1019
928
|
makeURLSearchParams,
|
|
1020
|
-
parseResponse
|
|
929
|
+
parseResponse,
|
|
930
|
+
version
|
|
1021
931
|
});
|
|
1022
932
|
//# sourceMappingURL=index.js.map
|