snowtransfer 0.3.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.
Files changed (42) hide show
  1. package/LICENSE.md +21 -0
  2. package/README.md +46 -0
  3. package/dist/Constants.d.ts +8 -0
  4. package/dist/Constants.js +8 -0
  5. package/dist/Endpoints.d.ts +89 -0
  6. package/dist/Endpoints.js +99 -0
  7. package/dist/Ratelimiter.d.ts +39 -0
  8. package/dist/Ratelimiter.js +69 -0
  9. package/dist/RequestHandler.d.ts +112 -0
  10. package/dist/RequestHandler.js +238 -0
  11. package/dist/SnowTransfer.d.ts +51 -0
  12. package/dist/SnowTransfer.js +56 -0
  13. package/dist/index.d.ts +4 -0
  14. package/dist/index.js +12 -0
  15. package/dist/methods/AuditLog.d.ts +45 -0
  16. package/dist/methods/AuditLog.js +35 -0
  17. package/dist/methods/Bots.d.ts +40 -0
  18. package/dist/methods/Bots.js +46 -0
  19. package/dist/methods/Channels.d.ts +749 -0
  20. package/dist/methods/Channels.js +685 -0
  21. package/dist/methods/GuildAssets.d.ts +191 -0
  22. package/dist/methods/GuildAssets.js +172 -0
  23. package/dist/methods/GuildTemplate.d.ts +57 -0
  24. package/dist/methods/GuildTemplate.js +68 -0
  25. package/dist/methods/Guilds.d.ts +733 -0
  26. package/dist/methods/Guilds.js +598 -0
  27. package/dist/methods/Interactions.d.ts +221 -0
  28. package/dist/methods/Interactions.js +262 -0
  29. package/dist/methods/Invites.d.ts +37 -0
  30. package/dist/methods/Invites.js +44 -0
  31. package/dist/methods/StageInstance.d.ts +64 -0
  32. package/dist/methods/StageInstance.js +73 -0
  33. package/dist/methods/Users.d.ts +76 -0
  34. package/dist/methods/Users.js +93 -0
  35. package/dist/methods/Voices.d.ts +21 -0
  36. package/dist/methods/Voices.js +29 -0
  37. package/dist/methods/Webhooks.d.ts +288 -0
  38. package/dist/methods/Webhooks.js +222 -0
  39. package/dist/ratelimitBuckets/LocalBucket.d.ts +58 -0
  40. package/dist/ratelimitBuckets/LocalBucket.js +77 -0
  41. package/dist/tsconfig.tsbuildinfo +1 -0
  42. package/package.json +48 -0
@@ -0,0 +1,222 @@
1
+ "use strict";
2
+ var __importDefault = (this && this.__importDefault) || function (mod) {
3
+ return (mod && mod.__esModule) ? mod : { "default": mod };
4
+ };
5
+ const Endpoints_1 = __importDefault(require("../Endpoints"));
6
+ /**
7
+ * Methods for handling webhook interactions
8
+ */
9
+ class WebhookMethods {
10
+ /**
11
+ * Create a new Method Handler
12
+ *
13
+ * Usually SnowTransfer creates a method handler for you, this is here for completion
14
+ *
15
+ * You can access the methods listed via `client.webhook.method`, where `client` is an initialized SnowTransfer instance
16
+ * @param requestHandler request handler that calls the rest api
17
+ * @param disableEveryone Disable [at]everyone/[at]here on outgoing messages
18
+ */
19
+ constructor(requestHandler, disableEveryone) {
20
+ this.requestHandler = requestHandler;
21
+ this.disableEveryone = disableEveryone;
22
+ }
23
+ /**
24
+ * Create a new Webhook
25
+ * @param channelId Id of the channel
26
+ * @param data Object with webhook properties
27
+ * @returns [Webhook Object](https://discord.com/developers/docs/resources/webhook#webhook-object-webhook-structure)
28
+ *
29
+ * | Permissions needed | Condition |
30
+ * |--------------------|-----------|
31
+ * | MANAGE_WEBHOOKS | always |
32
+ *
33
+ * @example
34
+ * // Create a new Webhook with the name "Webby Webhook"
35
+ * let client = new SnowTransfer('TOKEN');
36
+ * let webhookData = {
37
+ * name: "Webby Webhook"
38
+ * }
39
+ * client.webhook.createWebhook('channel Id', webhookData);
40
+ */
41
+ async createWebhook(channelId, data) {
42
+ return this.requestHandler.request(Endpoints_1.default.CHANNEL_WEBHOOKS(channelId), "post", "json", data);
43
+ }
44
+ /**
45
+ * Get webhooks created within a channel
46
+ * @param channelId Id of the channel
47
+ * @returns Array of [Webhook Objects](https://discord.com/developers/docs/resources/webhook#webhook-object-webhook-structure)
48
+ *
49
+ * | Permissions needed | Condition |
50
+ * |--------------------|-----------|
51
+ * | MANAGE_WEBHOOKS | always |
52
+ *
53
+ * @example
54
+ * // Get all webhooks within a channel
55
+ * let client = new SnowTransfer('TOKEN');
56
+ * client.webhook.getWebhooksChannel('channel Id').then(console.log);
57
+ */
58
+ async getWebhooksChannel(channelId) {
59
+ return this.requestHandler.request(Endpoints_1.default.CHANNEL_WEBHOOKS(channelId), "get", "json");
60
+ }
61
+ /**
62
+ * Get all webhooks within a guild
63
+ * @param guildId Id of the guild
64
+ * @returns Array of [Webhook Objects](https://discord.com/developers/docs/resources/webhook#webhook-object-webhook-structure)
65
+ *
66
+ * | Permissions needed | Condition |
67
+ * |--------------------|-----------|
68
+ * | MANAGE_WEBHOOKS | always |
69
+ *
70
+ * @example
71
+ * // Get all webhooks within a guild
72
+ * let client = new SnowTransfer('TOKEN');
73
+ * client.webhook.getWebhooksGuild('guild Id').then(console.log);
74
+ */
75
+ async getWebhooksGuild(guildId) {
76
+ return this.requestHandler.request(Endpoints_1.default.GUILD_WEBHOOKS(guildId), "get", "json");
77
+ }
78
+ /**
79
+ * Get a single Webhook via Id
80
+ * @param webhookId Id of the webhook
81
+ * @param token Webhook token
82
+ * @returns [Webhook Object](https://discord.com/developers/docs/resources/webhook#webhook-object-webhook-structure)
83
+ *
84
+ * | Permissions needed | Condition |
85
+ * |--------------------|---------------|
86
+ * | MANAGE_WEBHOOKS | without token |
87
+ *
88
+ * @example
89
+ * // Get a webhook via Id
90
+ * let client = new SnowTransfer('TOKEN');
91
+ * client.webhook.getWebhook('webhook Id', 'webhook token').then(console.log);
92
+ */
93
+ async getWebhook(webhookId, token) {
94
+ if (token)
95
+ return this.requestHandler.request(Endpoints_1.default.WEBHOOK_TOKEN(webhookId, token), "get", "json");
96
+ return this.requestHandler.request(Endpoints_1.default.WEBHOOK(webhookId), "get", "json");
97
+ }
98
+ /**
99
+ * Update a webhook
100
+ * @param webhookId Id of the webhook
101
+ * @param token Webhook token
102
+ * @param data Updated Webhook properties
103
+ * @returns Updated [Webhook Object](https://discord.com/developers/docs/resources/webhook#webhook-object-webhook-structure)
104
+ *
105
+ * | Permissions needed | Condition |
106
+ * |--------------------|---------------|
107
+ * | MANAGE_WEBHOOKS | without token |
108
+ *
109
+ * @example
110
+ * // Rename a webhook to "Captain Hook"
111
+ * let client = new SnowTransfer('TOKEN');
112
+ * let webhookData = {
113
+ * name: 'Captain Hook'
114
+ * }
115
+ * client.webhook.updateWebhook('webhook Id', 'webhook token', webhookData);
116
+ */
117
+ async updateWebhook(webhookId, token, data) {
118
+ if (token)
119
+ return this.requestHandler.request(Endpoints_1.default.WEBHOOK_TOKEN(webhookId, token), "patch", "json", data);
120
+ return this.requestHandler.request(Endpoints_1.default.WEBHOOK(webhookId), "patch", "json", data);
121
+ }
122
+ /**
123
+ * Delete a Webhook
124
+ * @param webhookId Id of the webhook
125
+ * @param token Webhook token
126
+ * @returns Resolves the Promise on successful execution
127
+ *
128
+ * | Permissions needed | Condition |
129
+ * |--------------------|---------------|
130
+ * | MANAGE_WEBHOOKS | without token |
131
+ */
132
+ async deleteWebhook(webhookId, token) {
133
+ if (token)
134
+ return this.requestHandler.request(Endpoints_1.default.WEBHOOK_TOKEN(webhookId, token), "delete", "json");
135
+ return this.requestHandler.request(Endpoints_1.default.WEBHOOK(webhookId), "delete", "json");
136
+ }
137
+ async executeWebhook(webhookId, token, data, options = { wait: false, disableEveryone: this.disableEveryone }) {
138
+ if (typeof data !== "string" && !(data === null || data === void 0 ? void 0 : data.content) && !(data === null || data === void 0 ? void 0 : data.embeds) && !(data === null || data === void 0 ? void 0 : data.files)) {
139
+ throw new Error("Missing content or embeds or files");
140
+ }
141
+ if (typeof data === "string") {
142
+ data = { content: data };
143
+ }
144
+ // Sanitize the message
145
+ if (data.content && ((options === null || options === void 0 ? void 0 : options.disableEveryone) !== undefined ? options.disableEveryone : this.disableEveryone)) {
146
+ data.content = data.content.replace(/@([^<>@ ]*)/gsmu, replaceEveryone);
147
+ }
148
+ if (data.files)
149
+ return this.requestHandler.request(Endpoints_1.default.WEBHOOK_TOKEN(webhookId, token) + (options === null || options === void 0 ? void 0 : options.wait) ? "?wait=true" : "", "post", "multipart", data);
150
+ else
151
+ return this.requestHandler.request(Endpoints_1.default.WEBHOOK_TOKEN(webhookId, token) + (options === null || options === void 0 ? void 0 : options.wait) ? "?wait=true" : "", "post", "json", data);
152
+ }
153
+ /**
154
+ * Execute a slack style Webhook
155
+ * @param webhookId Id of the Webhook
156
+ * @param token Webhook token
157
+ * @param data Check [Slack's documentation](https://api.slack.com/incoming-webhooks)
158
+ * @param options Options for disabling everyone/here pings or setting the wait query string
159
+ * @returns Resolves the Promise on successful execution
160
+ */
161
+ async executeWebhookSlack(webhookId, token, data, options = { wait: false, disableEveryone: this.disableEveryone }) {
162
+ // Sanitize the message
163
+ if (data.text && ((options === null || options === void 0 ? void 0 : options.disableEveryone) !== undefined ? options.disableEveryone : this.disableEveryone)) {
164
+ data.text = data.text.replace(/@([^<>@ ]*)/gsmu, replaceEveryone);
165
+ }
166
+ return this.requestHandler.request(Endpoints_1.default.WEBHOOK_TOKEN_SLACK(webhookId, token) + (options === null || options === void 0 ? void 0 : options.wait) ? "?wait=true" : "", "post", "json", data);
167
+ }
168
+ /**
169
+ * Executes a github style Webhook
170
+ * @param webhookId Id of the Webhook
171
+ * @param token Webhook token
172
+ * @param data Check [GitHub's documentation](https://docs.github.com/en/developers/webhooks-and-events/webhook-events-and-payloads#webhook-payload-object)
173
+ * @param options Options for disabling everyone/here pings or setting the wait query string
174
+ * @returns Resolves the Promise on successful execution
175
+ */
176
+ async executeWebhookGitHub(webhookId, token, data, options = { wait: false }) {
177
+ return this.requestHandler.request(Endpoints_1.default.WEBHOOK_TOKEN_GITHUB(webhookId, token) + (options === null || options === void 0 ? void 0 : options.wait) ? "?wait=true" : "", "post", "json", data);
178
+ }
179
+ /**
180
+ * Get a single message from a specific Webhook via Id
181
+ * @param webhookId Id of the Webhook
182
+ * @param token Webhook token
183
+ * @param messageId Id of the message
184
+ * @returns [discord message](https://discord.com/developers/docs/resources/channel#message-object) object
185
+ */
186
+ async getWebhookMessage(webhookId, token, messageId) {
187
+ return this.requestHandler.request(Endpoints_1.default.WEBHOOK_TOKEN_MESSAGE(webhookId, token, messageId), "get", "json");
188
+ }
189
+ /**
190
+ * Edit a message sent by a Webhook
191
+ * @param webhookId Id of the Webhook
192
+ * @param token Webhook token
193
+ * @param messageId Id of the message
194
+ * @param data Data to send
195
+ * @returns [discord message](https://discord.com/developers/docs/resources/channel#message-object) object
196
+ */
197
+ async editWebhookMessage(webhookId, token, messageId, data) {
198
+ if (data.files)
199
+ return this.requestHandler.request(Endpoints_1.default.WEBHOOK_TOKEN_MESSAGE(webhookId, token, messageId), "patch", "multipart", data);
200
+ else
201
+ return this.requestHandler.request(Endpoints_1.default.WEBHOOK_TOKEN_MESSAGE(webhookId, token, messageId), "patch", "json", data);
202
+ }
203
+ /**
204
+ * Delete a message sent by a Webhook
205
+ * @param webhookId Id of the Webhook
206
+ * @param token Webhook token
207
+ * @param messageId Id of the message
208
+ * @returns Resolves the Promise on successful execution
209
+ */
210
+ async deleteWebhookMessage(webhookId, token, messageId) {
211
+ return this.requestHandler.request(Endpoints_1.default.WEBHOOK_TOKEN_MESSAGE(webhookId, token, messageId), "delete", "json");
212
+ }
213
+ }
214
+ function replaceEveryone(match, target) {
215
+ if (target.match(/^[&!]?\d+$/)) {
216
+ return `@${target}`;
217
+ }
218
+ else {
219
+ return `@\u200b${target}`;
220
+ }
221
+ }
222
+ module.exports = WebhookMethods;
@@ -0,0 +1,58 @@
1
+ /**
2
+ * Bucket used for saving ratelimits
3
+ */
4
+ declare class LocalBucket {
5
+ /**
6
+ * array of functions waiting to be executed
7
+ */
8
+ fnQueue: Array<{
9
+ fn: (...args: Array<any>) => any;
10
+ callback: () => any;
11
+ }>;
12
+ /**
13
+ * Number of functions that may be executed during the timeframe set in limitReset
14
+ */
15
+ limit: number;
16
+ /**
17
+ * Remaining amount of executions during the current timeframe
18
+ */
19
+ protected _remaining: number;
20
+ /**
21
+ * Timeframe in milliseconds until the ratelimit resets
22
+ */
23
+ reset: number;
24
+ /**
25
+ * Timeout that calls the reset function once the timeframe passed
26
+ */
27
+ resetAt: number | null;
28
+ /**
29
+ * ratelimiter used for ratelimiting requests
30
+ */
31
+ ratelimiter: import("../Ratelimiter");
32
+ /**
33
+ * Create a new bucket
34
+ * @param ratelimiter ratelimiter used for ratelimiting requests
35
+ */
36
+ constructor(ratelimiter: import("../Ratelimiter"));
37
+ get remaining(): number;
38
+ set remaining(value: number);
39
+ /**
40
+ * Queue a function to be executed
41
+ * @param fn function to be executed
42
+ * @returns Result of the function if any
43
+ */
44
+ queue(fn: (bucket: LocalBucket) => any | Promise<any>): Promise<any>;
45
+ /**
46
+ * Check if there are any functions in the queue that haven't been executed yet
47
+ */
48
+ checkQueue(): void;
49
+ /**
50
+ * Reset the remaining tokens to the base limit
51
+ */
52
+ resetRemaining(): void;
53
+ /**
54
+ * Clear the current queue of events to be sent
55
+ */
56
+ dropQueue(): void;
57
+ }
58
+ export = LocalBucket;
@@ -0,0 +1,77 @@
1
+ "use strict";
2
+ /**
3
+ * Bucket used for saving ratelimits
4
+ */
5
+ class LocalBucket {
6
+ /**
7
+ * Create a new bucket
8
+ * @param ratelimiter ratelimiter used for ratelimiting requests
9
+ */
10
+ constructor(ratelimiter) {
11
+ this.fnQueue = [];
12
+ this.limit = 5;
13
+ this._remaining = 1;
14
+ this.reset = 5000;
15
+ this.resetAt = null;
16
+ this.ratelimiter = ratelimiter;
17
+ }
18
+ get remaining() {
19
+ if (this.resetAt && this.resetAt <= Date.now()) {
20
+ this._remaining = this.limit;
21
+ this.resetAt = null;
22
+ }
23
+ return this._remaining;
24
+ }
25
+ set remaining(value) {
26
+ this._remaining = value;
27
+ }
28
+ /**
29
+ * Queue a function to be executed
30
+ * @param fn function to be executed
31
+ * @returns Result of the function if any
32
+ */
33
+ queue(fn) {
34
+ return new Promise((res, rej) => {
35
+ const wrapFn = () => {
36
+ if (fn instanceof Promise) {
37
+ return fn(this).then(res).catch(rej);
38
+ }
39
+ return res(fn(this));
40
+ };
41
+ this.fnQueue.push({
42
+ fn, callback: wrapFn
43
+ });
44
+ this.checkQueue();
45
+ });
46
+ }
47
+ /**
48
+ * Check if there are any functions in the queue that haven't been executed yet
49
+ */
50
+ checkQueue() {
51
+ if (this.reset < 0) {
52
+ this.reset = 100;
53
+ }
54
+ if (this.ratelimiter.global && this.ratelimiter.globalResetAt > Date.now())
55
+ return;
56
+ if (this.fnQueue.length > 0 && this.remaining !== 0) {
57
+ const queuedFunc = this.fnQueue.splice(0, 1)[0];
58
+ queuedFunc.callback();
59
+ this.checkQueue();
60
+ }
61
+ }
62
+ /**
63
+ * Reset the remaining tokens to the base limit
64
+ */
65
+ resetRemaining() {
66
+ this._remaining = this.limit;
67
+ this.resetAt = null;
68
+ this.checkQueue();
69
+ }
70
+ /**
71
+ * Clear the current queue of events to be sent
72
+ */
73
+ dropQueue() {
74
+ this.fnQueue.length = 0;
75
+ }
76
+ }
77
+ module.exports = LocalBucket;
@@ -0,0 +1 @@
1
+ {"program":{"fileNames":["../../../../appdata/roaming/npm/node_modules/typescript/lib/lib.es5.d.ts","../../../../appdata/roaming/npm/node_modules/typescript/lib/lib.es2015.d.ts","../../../../appdata/roaming/npm/node_modules/typescript/lib/lib.es2016.d.ts","../../../../appdata/roaming/npm/node_modules/typescript/lib/lib.es2017.d.ts","../../../../appdata/roaming/npm/node_modules/typescript/lib/lib.es2018.d.ts","../../../../appdata/roaming/npm/node_modules/typescript/lib/lib.es2019.d.ts","../../../../appdata/roaming/npm/node_modules/typescript/lib/lib.es2020.d.ts","../../../../appdata/roaming/npm/node_modules/typescript/lib/lib.es2021.d.ts","../../../../appdata/roaming/npm/node_modules/typescript/lib/lib.esnext.d.ts","../../../../appdata/roaming/npm/node_modules/typescript/lib/lib.dom.d.ts","../../../../appdata/roaming/npm/node_modules/typescript/lib/lib.es2015.core.d.ts","../../../../appdata/roaming/npm/node_modules/typescript/lib/lib.es2015.collection.d.ts","../../../../appdata/roaming/npm/node_modules/typescript/lib/lib.es2015.generator.d.ts","../../../../appdata/roaming/npm/node_modules/typescript/lib/lib.es2015.iterable.d.ts","../../../../appdata/roaming/npm/node_modules/typescript/lib/lib.es2015.promise.d.ts","../../../../appdata/roaming/npm/node_modules/typescript/lib/lib.es2015.proxy.d.ts","../../../../appdata/roaming/npm/node_modules/typescript/lib/lib.es2015.reflect.d.ts","../../../../appdata/roaming/npm/node_modules/typescript/lib/lib.es2015.symbol.d.ts","../../../../appdata/roaming/npm/node_modules/typescript/lib/lib.es2015.symbol.wellknown.d.ts","../../../../appdata/roaming/npm/node_modules/typescript/lib/lib.es2016.array.include.d.ts","../../../../appdata/roaming/npm/node_modules/typescript/lib/lib.es2017.object.d.ts","../../../../appdata/roaming/npm/node_modules/typescript/lib/lib.es2017.sharedmemory.d.ts","../../../../appdata/roaming/npm/node_modules/typescript/lib/lib.es2017.string.d.ts","../../../../appdata/roaming/npm/node_modules/typescript/lib/lib.es2017.intl.d.ts","../../../../appdata/roaming/npm/node_modules/typescript/lib/lib.es2017.typedarrays.d.ts","../../../../appdata/roaming/npm/node_modules/typescript/lib/lib.es2018.asyncgenerator.d.ts","../../../../appdata/roaming/npm/node_modules/typescript/lib/lib.es2018.asynciterable.d.ts","../../../../appdata/roaming/npm/node_modules/typescript/lib/lib.es2018.intl.d.ts","../../../../appdata/roaming/npm/node_modules/typescript/lib/lib.es2018.promise.d.ts","../../../../appdata/roaming/npm/node_modules/typescript/lib/lib.es2018.regexp.d.ts","../../../../appdata/roaming/npm/node_modules/typescript/lib/lib.es2019.array.d.ts","../../../../appdata/roaming/npm/node_modules/typescript/lib/lib.es2019.object.d.ts","../../../../appdata/roaming/npm/node_modules/typescript/lib/lib.es2019.string.d.ts","../../../../appdata/roaming/npm/node_modules/typescript/lib/lib.es2019.symbol.d.ts","../../../../appdata/roaming/npm/node_modules/typescript/lib/lib.es2020.bigint.d.ts","../../../../appdata/roaming/npm/node_modules/typescript/lib/lib.es2020.promise.d.ts","../../../../appdata/roaming/npm/node_modules/typescript/lib/lib.es2020.sharedmemory.d.ts","../../../../appdata/roaming/npm/node_modules/typescript/lib/lib.es2020.string.d.ts","../../../../appdata/roaming/npm/node_modules/typescript/lib/lib.es2020.symbol.wellknown.d.ts","../../../../appdata/roaming/npm/node_modules/typescript/lib/lib.es2020.intl.d.ts","../../../../appdata/roaming/npm/node_modules/typescript/lib/lib.es2021.promise.d.ts","../../../../appdata/roaming/npm/node_modules/typescript/lib/lib.es2021.string.d.ts","../../../../appdata/roaming/npm/node_modules/typescript/lib/lib.es2021.weakref.d.ts","../../../../appdata/roaming/npm/node_modules/typescript/lib/lib.esnext.intl.d.ts","../src/constants.ts","../src/endpoints.ts","../src/ratelimitbuckets/localbucket.ts","../src/ratelimiter.ts","../node_modules/@types/node/assert.d.ts","../node_modules/@types/node/assert/strict.d.ts","../node_modules/@types/node/globals.d.ts","../node_modules/@types/node/async_hooks.d.ts","../node_modules/@types/node/buffer.d.ts","../node_modules/@types/node/child_process.d.ts","../node_modules/@types/node/cluster.d.ts","../node_modules/@types/node/console.d.ts","../node_modules/@types/node/constants.d.ts","../node_modules/@types/node/crypto.d.ts","../node_modules/@types/node/dgram.d.ts","../node_modules/@types/node/diagnostics_channel.d.ts","../node_modules/@types/node/dns.d.ts","../node_modules/@types/node/dns/promises.d.ts","../node_modules/@types/node/domain.d.ts","../node_modules/@types/node/events.d.ts","../node_modules/@types/node/fs.d.ts","../node_modules/@types/node/fs/promises.d.ts","../node_modules/@types/node/http.d.ts","../node_modules/@types/node/http2.d.ts","../node_modules/@types/node/https.d.ts","../node_modules/@types/node/inspector.d.ts","../node_modules/@types/node/module.d.ts","../node_modules/@types/node/net.d.ts","../node_modules/@types/node/os.d.ts","../node_modules/@types/node/path.d.ts","../node_modules/@types/node/perf_hooks.d.ts","../node_modules/@types/node/process.d.ts","../node_modules/@types/node/punycode.d.ts","../node_modules/@types/node/querystring.d.ts","../node_modules/@types/node/readline.d.ts","../node_modules/@types/node/repl.d.ts","../node_modules/@types/node/stream.d.ts","../node_modules/@types/node/stream/promises.d.ts","../node_modules/@types/node/stream/consumers.d.ts","../node_modules/@types/node/stream/web.d.ts","../node_modules/@types/node/string_decoder.d.ts","../node_modules/@types/node/timers.d.ts","../node_modules/@types/node/timers/promises.d.ts","../node_modules/@types/node/tls.d.ts","../node_modules/@types/node/trace_events.d.ts","../node_modules/@types/node/tty.d.ts","../node_modules/@types/node/url.d.ts","../node_modules/@types/node/util.d.ts","../node_modules/@types/node/v8.d.ts","../node_modules/@types/node/vm.d.ts","../node_modules/@types/node/wasi.d.ts","../node_modules/@types/node/worker_threads.d.ts","../node_modules/@types/node/zlib.d.ts","../node_modules/@types/node/globals.global.d.ts","../node_modules/@types/node/index.d.ts","../node_modules/@types/centra/index.d.ts","../node_modules/form-data/index.d.ts","../src/requesthandler.ts","../node_modules/discord-typings/index.d.ts","../src/methods/channels.ts","../src/methods/users.ts","../src/methods/guildassets.ts","../src/methods/webhooks.ts","../src/methods/guilds.ts","../src/methods/guildtemplate.ts","../src/methods/interactions.ts","../src/methods/invites.ts","../src/methods/voices.ts","../src/methods/bots.ts","../src/methods/auditlog.ts","../src/methods/stageinstance.ts","../src/snowtransfer.ts","../src/index.ts"],"fileInfos":[{"version":"aa9fb4c70f369237c2f45f9d969c9a59e0eae9a192962eb48581fe864aa609db","affectsGlobalScope":true},"dc47c4fa66b9b9890cf076304de2a9c5201e94b740cffdf09f87296d877d71f6","7a387c58583dfca701b6c85e0adaf43fb17d590fb16d5b2dc0a2fbd89f35c467","8a12173c586e95f4433e0c6dc446bc88346be73ffe9ca6eec7aa63c8f3dca7f9","5f4e733ced4e129482ae2186aae29fde948ab7182844c3a5a51dd346182c7b06","e6b724280c694a9f588847f754198fb96c43d805f065c3a5b28bbc9594541c84","e21c071ca3e1b4a815d5f04a7475adcaeea5d64367e840dd0154096d705c3940","eb75e89d63b3b72dd9ca8b0cac801cecae5be352307c004adeaa60bc9d6df51f","2cc028cd0bdb35b1b5eb723d84666a255933fffbea607f72cbd0c7c7b4bee144",{"version":"e54c8715a4954cfdc66cd69489f2b725c09ebf37492dbd91cff0a1688b1159e8","affectsGlobalScope":true},{"version":"51b8b27c21c066bf877646e320bf6a722b80d1ade65e686923cd9d4494aef1ca","affectsGlobalScope":true},{"version":"43fb1d932e4966a39a41b464a12a81899d9ae5f2c829063f5571b6b87e6d2f9c","affectsGlobalScope":true},{"version":"cdccba9a388c2ee3fd6ad4018c640a471a6c060e96f1232062223063b0a5ac6a","affectsGlobalScope":true},{"version":"2c8c5ee58f30e7c944e04ab1fb5506fdbb4dd507c9efa6972cf4b91cec90c503","affectsGlobalScope":true},{"version":"2bb4b3927299434052b37851a47bf5c39764f2ba88a888a107b32262e9292b7c","affectsGlobalScope":true},{"version":"810627a82ac06fb5166da5ada4159c4ec11978dfbb0805fe804c86406dab8357","affectsGlobalScope":true},{"version":"62d80405c46c3f4c527ee657ae9d43fda65a0bf582292429aea1e69144a522a6","affectsGlobalScope":true},{"version":"3013574108c36fd3aaca79764002b3717da09725a36a6fc02eac386593110f93","affectsGlobalScope":true},{"version":"75ec0bdd727d887f1b79ed6619412ea72ba3c81d92d0787ccb64bab18d261f14","affectsGlobalScope":true},{"version":"3be5a1453daa63e031d266bf342f3943603873d890ab8b9ada95e22389389006","affectsGlobalScope":true},{"version":"17bb1fc99591b00515502d264fa55dc8370c45c5298f4a5c2083557dccba5a2a","affectsGlobalScope":true},{"version":"7ce9f0bde3307ca1f944119f6365f2d776d281a393b576a18a2f2893a2d75c98","affectsGlobalScope":true},{"version":"6a6b173e739a6a99629a8594bfb294cc7329bfb7b227f12e1f7c11bc163b8577","affectsGlobalScope":true},{"version":"12a310447c5d23c7d0d5ca2af606e3bd08afda69100166730ab92c62999ebb9d","affectsGlobalScope":true},{"version":"b0124885ef82641903d232172577f2ceb5d3e60aed4da1153bab4221e1f6dd4e","affectsGlobalScope":true},{"version":"0eb85d6c590b0d577919a79e0084fa1744c1beba6fd0d4e951432fa1ede5510a","affectsGlobalScope":true},{"version":"da233fc1c8a377ba9e0bed690a73c290d843c2c3d23a7bd7ec5cd3d7d73ba1e0","affectsGlobalScope":true},{"version":"df9c8a72ca8b0ed62f5470b41208a0587f0f73f0a7db28e5a1272cf92537518e","affectsGlobalScope":true},{"version":"bb2d3fb05a1d2ffbca947cc7cbc95d23e1d053d6595391bd325deb265a18d36c","affectsGlobalScope":true},{"version":"c80df75850fea5caa2afe43b9949338ce4e2de086f91713e9af1a06f973872b8","affectsGlobalScope":true},{"version":"9d57b2b5d15838ed094aa9ff1299eecef40b190722eb619bac4616657a05f951","affectsGlobalScope":true},{"version":"6c51b5dd26a2c31dbf37f00cfc32b2aa6a92e19c995aefb5b97a3a64f1ac99de","affectsGlobalScope":true},{"version":"93544ca2f26a48716c1b6c5091842cad63129daac422dfa4bc52460465f22bb1","affectsGlobalScope":true},{"version":"2ad234885a4240522efccd77de6c7d99eecf9b4de0914adb9a35c0c22433f993","affectsGlobalScope":true},{"version":"1b3fe904465430e030c93239a348f05e1be80640d91f2f004c3512c2c2c89f34","affectsGlobalScope":true},{"version":"7435b75fdf3509622e79622dbe5091cf4b09688410ee2034e4fc17d0c99d0862","affectsGlobalScope":true},{"version":"e7e8e1d368290e9295ef18ca23f405cf40d5456fa9f20db6373a61ca45f75f40","affectsGlobalScope":true},{"version":"faf0221ae0465363c842ce6aa8a0cbda5d9296940a8e26c86e04cc4081eea21e","affectsGlobalScope":true},{"version":"06393d13ea207a1bfe08ec8d7be562549c5e2da8983f2ee074e00002629d1871","affectsGlobalScope":true},{"version":"9f1817f7c3f02f6d56e0f403b927e90bb133f371dcebc36fa7d6d208ef6899da","affectsGlobalScope":true},{"version":"cd6efb9467a8b6338ece2e2855e37765700f2cd061ca54b01b33878cf5c7677e","affectsGlobalScope":true},{"version":"fb4416144c1bf0323ccbc9afb0ab289c07312214e8820ad17d709498c865a3fe","affectsGlobalScope":true},{"version":"5b0ca94ec819d68d33da516306c15297acec88efeb0ae9e2b39f71dbd9685ef7","affectsGlobalScope":true},{"version":"4632665b87204bb1caa8b44d165bce0c50dfab177df5b561b345a567cabacf9a","affectsGlobalScope":true},"105bd33cf7f1feaa8a950b3a8731bb55cb364887aaf1fc1c0c282098259f97db","b81b9cc121e0cde9e08672e5a7a4be8995c0391b7662e8edb0ac3464172b2c7c","17d02341b834b42f17db930b9e59732b3e17b1062c04542025432090e5f6175d","218e5423c8345f154ff01c4a61f0c9637863668e8658576421d064c1c818afad","0d5a2ee1fdfa82740e0103389b9efd6bfe145a20018a2da3c02b89666181f4d9","a69c09dbea52352f479d3e7ac949fde3d17b195abe90b045d619f747b38d6d1a",{"version":"92d63add669d18ebc349efbacd88966d6f2ccdddfb1b880b2db98ae3aa7bf7c4","affectsGlobalScope":true},"ccc94049a9841fe47abe5baef6be9a38fc6228807974ae675fb15dc22531b4be",{"version":"9acfe4d1ff027015151ce81d60797b04b52bffe97ad8310bb0ec2e8fd61e1303","affectsGlobalScope":true},"43978f18d1165eea81040bc9bfac1a551717f5cc9bd0f13b31bf490c5fcdc75f","afc6e96061af46bcff47246158caee7e056f5288783f2d83d6858cd25be1c565",{"version":"34f5bcac12b36d70304b73de5f5aab3bb91bd9919f984be80579ebcad03a624e","affectsGlobalScope":true},"82408ed3e959ddc60d3e9904481b5a8dc16469928257af22a3f7d1a3bc7fd8c4","57a558a99ab24fdff45a2c2db0c34285de2dcbc66149d9a3d83fcde844426e37","260aad3a6bd3fc510b7f97cfb05859bfc045ce185f8c2b4d73ddb9c43b0eb3c0","cb428529763c6c8e38e42db2a39f333ffcc6d3aab396b24ac84b22da752c1de0","ad4b60488fb1e562bf375dac9299815f7028bf667d9b5887b2d01d501b7d1ddd","246341c3a7a2638cf830d690e69de1e6085a102c6a30596435b050e6ac86c11a","6972fca26f6e9bd56197568d4379f99071a90766e06b4fcb5920a0130a9202be",{"version":"4a2628e95962c8ab756121faa3ac2ed348112ff7a87b5c286dd2cc3326546b4c","affectsGlobalScope":true},"fd5d2f531376b1e84df315df0fe724445353a0ae2e2c4de7bae01e24c6c2047a","84214d474bed6e36b7608ba8a39d463ff90061b8af47cbd1a8f7ecb775e21fac","944660c079e97f62f513c33ec64cebc44154374053d3a9adb04bf02f67ee1066","b287b810b5035d5685f1df6e1e418f1ca452a3ed4f59fd5cc081dbf2045f0d9b","4b9a003b5c556c96784132945bb41c655ea11273b1917f5c8d0c154dd5fd20dd","62a00c9cc0c78d9f282dcd7b0a7776aefe220106c3bc327e259e5f6484c6f556",{"version":"e8b18c6385ff784228a6f369694fcf1a6b475355ba89090a88de13587a9391d5","affectsGlobalScope":true},"f3e8bcce378a26bc672fce0ec05affabbbbfa18493b76f24c39136dea87100d0","abc1c425b2ad6720433f40f1877abfa4223f0f3dd486c9c28c492179ca183cb6","cd4854d38f4eb5592afd98ab95ca17389a7dfe38013d9079e802d739bdbcc939","94eed4cc2f5f658d5e229ff1ccd38860bddf4233e347bf78edd2154dee1f2b99",{"version":"e51bee3200733b1f58818b5a9ea90fcd61c5b8afa3a0378391991f3696826a65","affectsGlobalScope":true},"9f1069b9e2c051737b1f9b4f1baf50e4a63385a6a89c32235549ae87fc3d5492","ee18f2da7a037c6ceeb112a084e485aead9ea166980bf433474559eac1b46553","e70339a3d63f806c43f24250c42aa0000093923457b0ed7dfc10e0ac910ebca9","0acbf26bf958f9e80c1ffa587b74749d2697b75b484062d36e103c137c562bc3","d7838022c7dab596357a9604b9c6adffe37dc34085ce0779c958ce9545bd7139","1b952304137851e45bc009785de89ada562d9376177c97e37702e39e60c2f1ff",{"version":"806ef4cac3b3d9fa4a48d849c8e084d7c72fcd7b16d76e06049a9ed742ff79c0","affectsGlobalScope":true},"a279435e7813d1f061c0cab6ab77b1b9377e8d96851e5ed4a76a1ce6eb6e628f","c33a6ea7147af60d8e98f1ac127047f4b0d4e2ce28b8f08ff3de07ca7cc00637",{"version":"b42b47e17b8ece2424ae8039feb944c2e3ba4b262986aebd582e51efbdca93dc","affectsGlobalScope":true},"664d8f2d59164f2e08c543981453893bc7e003e4dfd29651ce09db13e9457980","2408611d9b4146e35d1dbd1f443ccd8e187c74614a54b80300728277529dbf11","998a3de5237518c0b3ac00a11b3b4417affb008aa20aedee52f3fdae3cb86151","ad41008ffe077206e1811fc873f4d9005b5fd7f6ab52bb6118fef600815a5cb4","b810390059fc34122556c644f586e7a2b4598ded8afe5ba70bb82fc2e50577b1","ba9de5c5823e06ee3314f959c138cdaf4477d3a1a0769f0d24e62911020e8088","c3db860bcaaaeb3bbc23f353bbda1f8ab82756c8d5e973bebb3953cb09ea68f2","235a53595bd20b0b0eeb1a29cb2887c67c48375e92f03749b2488fbd46d0b1a0","bc09393cd4cd13f69cf1366d4236fbae5359bb550f0de4e15767e9a91d63dfb1","9c266243b01545e11d2733a55ad02b4c00ecdbda99c561cd1674f96e89cdc958","c71155c05fc76ff948a4759abc1cb9feec036509f500174bc18dad4c7827a60c",{"version":"ab9b9a36e5284fd8d3bf2f7d5fcbc60052f25f27e4d20954782099282c60d23e","affectsGlobalScope":true},"893f4b8552c248f6542174b53d1519f739b20428c970dda89cd90485dab059d0","3e5883cbd1b75ae02ec22e0a74b35c1c069eecf6a34814292024f431d3a38cb3","736097ddbb2903bef918bb3b5811ef1c9c5656f2a73bd39b22a91b9cc2525e50","93a6a7ae10e3de560817662804c39643e67e8c6bb52ef6ef466f856706429a65","feb77ecbf930284f2e2482916f94278606e621b682857c14bd6267f60f1e951d","7510ccf4cb5818eb1ba440f68a1e333df0ea5802c1f15e1bba9b8836cf03ca52","36df4eae7cf2f90072a40648df229ba1527d979d7e71cb53055cd3d2713fe9e3","39ba0d0fecf2ea712bc242c82796ac373ef535db77be5cbd8809266cb9a5b468","1cd6e65347656a13485139cc0ef19c7da01930c957608dbd71604c8c01afae0f","f5203321851e3ffc3631d216955858e6adfa4433598d605880ba20a4ac2af59c","f1572b56de7f571fe08c002fe2d051cedb85eddc18078ded4140e32a193b2c6d","affc8fc915a88b0b496c7aad4e37a5d707730e1def186f0c869b949f7c5dd189","88d599750584880737ce67184ad2602614edcd27d7621c19fefc6d075c7694e2","4b684c884a80ddd13442408591c4b5daac488b98dbe23bbb1b74c8cbf3abf003","7ba8fa98d56e3d4ba01558c0f3b1d75d0aa48b108bca720b03740dc15f59d3df","6377205b7c9d7c5442d3ba02110490cd0d905c0aa8c825183873495549c1d328","5b3eebdeebf4da1f8243cdc869844f08608a1f9f332e205f388dc7ee5a900ae6","b358ac8db4fc19bbb024cb57b6380921e45e6a12e1ce35f3e087f9f53fd5bdf6","9171ad14f0a74623d555141efe5a6340db7d0ea1248f1c161b84ca6c4b6b893e"],"options":{"allowSyntheticDefaultImports":true,"declaration":true,"emitDecoratorMetadata":true,"esModuleInterop":true,"experimentalDecorators":true,"module":1,"noUnusedLocals":false,"outDir":"./","removeComments":false,"sourceMap":false,"strictNullChecks":true,"target":6},"fileIdsList":[[92],[67,91,92,99],[49,92],[52,92],[53,58,92],[54,64,65,72,81,91,92],[54,55,64,72,92],[56,92],[57,58,65,73,92],[58,81,88,92],[59,61,64,72,92],[60,92],[61,62,92],[63,64,92],[64,92],[64,65,66,81,91,92],[64,65,66,81,92],[67,72,81,91,92],[64,65,67,68,72,81,88,91,92],[67,69,81,88,91,92],[49,50,51,52,53,54,55,56,57,58,59,60,61,62,63,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,83,84,85,86,87,88,89,90,91,92,93,94,95,96,97,98],[64,70,92],[71,91,92],[61,64,72,81,92],[73,92],[74,92],[52,75,92],[76,90,92,96],[77,92],[78,92],[64,79,92],[79,80,92,94],[64,81,82,83,92],[81,83,92],[81,82,92],[84,92],[85,92],[64,86,87,92],[86,87,92],[58,72,88,92],[89,92],[72,90,92],[53,67,78,91,92],[58,92],[81,92,93],[92,94],[92,95],[53,58,64,66,75,81,91,92,94,96],[81,92,97],[67,81,92,99],[45,92],[45,46,92,116],[46,92,102,103],[46,92,102],[45,46,92,102,103],[46,92,102,103,107],[48,92],[47,92],[45,46,47,48,58,64,92,100,101],[46,48,92,102,104,105,106,107,108,109,110,111,112,113,114,115]],"referencedMap":[[10,1],[12,1],[11,1],[2,1],[13,1],[14,1],[15,1],[16,1],[17,1],[18,1],[19,1],[20,1],[3,1],[4,1],[24,1],[21,1],[22,1],[23,1],[25,1],[26,1],[27,1],[5,1],[28,1],[29,1],[30,1],[31,1],[6,1],[32,1],[33,1],[34,1],[35,1],[7,1],[40,1],[36,1],[37,1],[38,1],[39,1],[8,1],[41,1],[42,1],[43,1],[1,1],[9,1],[44,1],[100,2],[49,3],[50,3],[52,4],[53,5],[54,6],[55,7],[56,8],[57,9],[58,10],[59,11],[60,12],[61,13],[62,13],[63,14],[64,15],[65,16],[66,17],[51,1],[98,1],[67,18],[68,19],[69,20],[99,21],[70,22],[71,23],[72,24],[73,25],[74,26],[75,27],[76,28],[77,29],[78,30],[79,31],[80,32],[81,33],[83,34],[82,35],[84,36],[85,37],[86,38],[87,39],[88,40],[89,41],[90,42],[91,43],[92,44],[93,45],[94,46],[95,47],[96,48],[97,49],[103,1],[101,50],[45,1],[46,51],[117,52],[114,53],[113,54],[104,55],[106,53],[108,53],[109,53],[110,56],[111,53],[115,53],[105,53],[112,53],[107,53],[47,57],[48,58],[102,59],[116,60]],"exportedModulesMap":[[10,1],[12,1],[11,1],[2,1],[13,1],[14,1],[15,1],[16,1],[17,1],[18,1],[19,1],[20,1],[3,1],[4,1],[24,1],[21,1],[22,1],[23,1],[25,1],[26,1],[27,1],[5,1],[28,1],[29,1],[30,1],[31,1],[6,1],[32,1],[33,1],[34,1],[35,1],[7,1],[40,1],[36,1],[37,1],[38,1],[39,1],[8,1],[41,1],[42,1],[43,1],[1,1],[9,1],[44,1],[100,2],[49,3],[50,3],[52,4],[53,5],[54,6],[55,7],[56,8],[57,9],[58,10],[59,11],[60,12],[61,13],[62,13],[63,14],[64,15],[65,16],[66,17],[51,1],[98,1],[67,18],[68,19],[69,20],[99,21],[70,22],[71,23],[72,24],[73,25],[74,26],[75,27],[76,28],[77,29],[78,30],[79,31],[80,32],[81,33],[83,34],[82,35],[84,36],[85,37],[86,38],[87,39],[88,40],[89,41],[90,42],[91,43],[92,44],[93,45],[94,46],[95,47],[96,48],[97,49],[103,1],[101,50],[45,1],[46,51],[117,52],[114,53],[113,54],[104,55],[106,53],[108,53],[109,53],[110,56],[111,53],[115,53],[105,53],[112,53],[107,53],[47,57],[48,58],[102,59],[116,60]],"semanticDiagnosticsPerFile":[10,12,11,2,13,14,15,16,17,18,19,20,3,4,24,21,22,23,25,26,27,5,28,29,30,31,6,32,33,34,35,7,40,36,37,38,39,8,41,42,43,1,9,44,100,49,50,52,53,54,55,56,57,58,59,60,61,62,63,64,65,66,51,98,67,68,69,99,70,71,72,73,74,75,76,77,78,79,80,81,83,82,84,85,86,87,88,89,90,91,92,93,94,95,96,97,103,101,45,46,117,114,113,104,106,108,109,110,111,115,105,112,107,47,48,102,116]},"version":"4.4.3"}
package/package.json ADDED
@@ -0,0 +1,48 @@
1
+ {
2
+ "name": "snowtransfer",
3
+ "version": "0.3.0",
4
+ "description": "Minimalistic Rest client for the Discord Api",
5
+ "main": "./dist/index.js",
6
+ "types": "./dist/index.d.ts",
7
+ "engines": {
8
+ "node": ">=12.0.0"
9
+ },
10
+ "keywords": [
11
+ "discord",
12
+ "api",
13
+ "rest",
14
+ "http",
15
+ "microservice",
16
+ "discord bot",
17
+ "discord bot microservice",
18
+ "microservice bot"
19
+ ],
20
+ "scripts": {
21
+ "build:src": "tsc -p .",
22
+ "build:docs": "typedoc --name SnowTransfer --excludeExternals --sort static-first --sort alphabetical"
23
+ },
24
+ "repository": {
25
+ "type": "git",
26
+ "url": "git+https://github.com/DasWolke/SnowTransfer.git"
27
+ },
28
+ "bugs": "https://github.com/DasWolke/SnowTransfer/issues",
29
+ "author": "wolke <wolke@weeb.sh>",
30
+ "license": "MIT",
31
+ "dependencies": {
32
+ "discord-typings": "9.0.x",
33
+ "centra": "^2.5.0",
34
+ "form-data": "~4.0.0"
35
+ },
36
+ "devDependencies": {
37
+ "@types/centra": "^2.2.0",
38
+ "@types/node": "^16.0.1",
39
+ "@typescript-eslint/eslint-plugin": "^4.33.0",
40
+ "@typescript-eslint/parser": "^4.33.0",
41
+ "eslint": "^7.32.0",
42
+ "typedoc": "^0.22.5",
43
+ "typedoc-plugin-mdn-links": "^1.0.4",
44
+ "typedoc-plugin-missing-exports": "^0.22.3",
45
+ "typescript": "^4.4.3"
46
+ },
47
+ "files": ["dist", "README.md", "LICENSE.md"]
48
+ }