mirror of
https://github.com/discordjs/discord-api-types.git
synced 2026-05-21 02:40:08 +00:00
src: Initial Commit 🎉
This commit is contained in:
9
.eslintrc.json
Normal file
9
.eslintrc.json
Normal file
@@ -0,0 +1,9 @@
|
||||
{
|
||||
"extends": "@skyra",
|
||||
"parserOptions": {
|
||||
"project": "./tsconfig.json"
|
||||
},
|
||||
"rules": {
|
||||
"@typescript-eslint/naming-convention": 0
|
||||
}
|
||||
}
|
||||
8
.github/FUNDING.yml
vendored
Normal file
8
.github/FUNDING.yml
vendored
Normal file
@@ -0,0 +1,8 @@
|
||||
# These are supported funding model platforms
|
||||
|
||||
github: []
|
||||
patreon: vladfrangu
|
||||
open_collective: # Replace with a single Open Collective username
|
||||
ko_fi: wolfgalvlad
|
||||
tidelift: # Replace with a single Tidelift platform-name/package-name e.g., npm/babel
|
||||
custom: # Replace with a single custom sponsorship URL
|
||||
55
.github/workflows/codequality.yml
vendored
Normal file
55
.github/workflows/codequality.yml
vendored
Normal file
@@ -0,0 +1,55 @@
|
||||
name: Code Quality
|
||||
|
||||
on:
|
||||
push:
|
||||
branches:
|
||||
- master
|
||||
- stable
|
||||
pull_request:
|
||||
|
||||
jobs:
|
||||
ESLint:
|
||||
name: ESLint
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Checkout Project
|
||||
uses: actions/checkout@v1
|
||||
- name: Use Node.js 14
|
||||
uses: actions/setup-node@v1
|
||||
with:
|
||||
node-version: 14
|
||||
- name: Restore CI Cache
|
||||
uses: actions/cache@v1
|
||||
with:
|
||||
path: node_modules
|
||||
key: ${{ runner.os }}-14-${{ hashFiles('**/yarn.lock') }}
|
||||
- name: Install Dependencies
|
||||
run: yarn --ignore-scripts --frozen-lockfile
|
||||
- name: Run ESLint
|
||||
uses: icrawl/action-eslint@v1
|
||||
env:
|
||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||
with:
|
||||
custom-glob: 'v*/** default/** common/**'
|
||||
|
||||
TypeScript:
|
||||
name: TypeScript
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Checkout Project
|
||||
uses: actions/checkout@v1
|
||||
- name: Use Node.js 14
|
||||
uses: actions/setup-node@v1
|
||||
with:
|
||||
node-version: 14
|
||||
- name: Restore CI Cache
|
||||
uses: actions/cache@v1
|
||||
with:
|
||||
path: node_modules
|
||||
key: ${{ runner.os }}-14-${{ hashFiles('**/yarn.lock') }}
|
||||
- name: Install Dependencies
|
||||
run: yarn --ignore-scripts --frozen-lockfile
|
||||
- name: Run TSC
|
||||
uses: icrawl/action-tsc@v1
|
||||
env:
|
||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||
12
.gitignore
vendored
Normal file
12
.gitignore
vendored
Normal file
@@ -0,0 +1,12 @@
|
||||
node_modules/
|
||||
package-lock.json
|
||||
|
||||
out/
|
||||
coverage/
|
||||
.nyc_output/
|
||||
|
||||
# Don't commit build outputs
|
||||
|
||||
v*/**/*.js
|
||||
v*/**/*.map
|
||||
v*/**/*.d.ts
|
||||
7
CHANGELOG.md
Normal file
7
CHANGELOG.md
Normal file
@@ -0,0 +1,7 @@
|
||||
# Changelog
|
||||
|
||||
This will be a list of changes that happen between versions
|
||||
|
||||
## 0.1.0
|
||||
|
||||
Initial release
|
||||
21
LICENSE
Normal file
21
LICENSE
Normal file
@@ -0,0 +1,21 @@
|
||||
MIT License
|
||||
|
||||
Copyright (c) 2020 vladfrangu
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
of this software and associated documentation files (the "Software"), to deal
|
||||
in the Software without restriction, including without limitation the rights
|
||||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
copies of the Software, and to permit persons to whom the Software is
|
||||
furnished to do so, subject to the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be included in all
|
||||
copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
SOFTWARE.
|
||||
44
README.md
Normal file
44
README.md
Normal file
@@ -0,0 +1,44 @@
|
||||
# Discord API Types
|
||||
|
||||
Simple type defitions for the [Discord API](https://discord.com/developers/docs/intro)
|
||||
|
||||
## How it's done
|
||||
|
||||
The exports of each API version is split into three main parts:
|
||||
|
||||
- Everything exported with the `API` prefix represents a payload you may get from the REST API *or* the Gateway
|
||||
- Everything exported with the `Gateway` prefix represents data that ONLY comes from or is directly referred to the Gateway
|
||||
- Everything exported with the `REST` prefix represents data that ONLY comes from or is directly reffered to the REST API
|
||||
- For endpoint options, they will follow the following structure: `REST<HTTP Method><Type><Query|<JSON|FormData>Body|Result>` where the type represents what it will return
|
||||
- If a type ends with `Result`, then it represents the expected result by calling it's accompanying route
|
||||
- Types that are exported as `never` usually mean the result will be a `204 No Content`, so you can safely ignore it. This does **not** account for errors
|
||||
- Anything else that is miscellaneous will be exported based on what it represents (for example the REST route object)
|
||||
- There may be exported things from all versions - common throughout all API versions - that will simply be exported as is and are present in the `common` directory. They will still be prefixed with `REST` or `Gateway` accordingly.
|
||||
|
||||
**Warning**: This package documents just KNOWN (and documented) properties. Anything that isn't documented will NOT be added to this package (unless said properties are already PR'd to Discord's [API Documentation repository](https://github.com/discord/discord-api-docs) or known through other means and have received the green light to be used)
|
||||
|
||||
## How to use
|
||||
|
||||
You can require / import the module directly, which will give you the latest types as of the current API version. This is considered the `default` version and may break at any point in time.
|
||||
|
||||
> We **strongly recommend** you use a version when importing this module! This will prevent breaking changes when updating the module.
|
||||
|
||||
```js
|
||||
const { APIUserData } = require('discord-api-types');
|
||||
```
|
||||
|
||||
```ts
|
||||
// TypeScript support
|
||||
import { APIUserData } from 'discord-api-types'
|
||||
```
|
||||
|
||||
You may also add the API version you want to use by appending `/v*`, where the * represends the API version
|
||||
|
||||
```js
|
||||
const { APIUserData } = require('discord-api-types/v6');
|
||||
```
|
||||
|
||||
```ts
|
||||
// TypeScript support
|
||||
import { APIUserData } from 'discord-api-types/v6';
|
||||
```
|
||||
142
common/index.ts
Normal file
142
common/index.ts
Normal file
@@ -0,0 +1,142 @@
|
||||
/**
|
||||
* https://discord.com/developers/docs/topics/opcodes-and-status-codes#json-json-error-codes
|
||||
*/
|
||||
export enum RESTJSONErrorCodes {
|
||||
GeneralError,
|
||||
|
||||
UnknownAccount = 10001,
|
||||
UnknownApplication,
|
||||
UnknownChannel,
|
||||
UnknownGuild,
|
||||
UnknownIntegration,
|
||||
UnknownInvite,
|
||||
UnknownMember,
|
||||
UnknownMessage,
|
||||
UnknownPermissionOverwrite,
|
||||
UnknownProvider,
|
||||
UnknownRole,
|
||||
UnknownToken,
|
||||
UnknownUser,
|
||||
UnknownEmoji,
|
||||
UnknownWebook,
|
||||
|
||||
UnknownBan = 10026,
|
||||
UnknownSKU,
|
||||
UnknownStoreListing,
|
||||
UnknownEntitlement,
|
||||
UnknownBuild,
|
||||
UnknownLobby,
|
||||
UnknownBranch,
|
||||
|
||||
UnknownRedistributable = 10036,
|
||||
|
||||
BotsCannotUseThisEndpoint = 20001,
|
||||
OnlyBotsCanUseThisEndpoint,
|
||||
|
||||
MaximumNumberOfGuildsReached = 30001,
|
||||
MaximumNumberOfFriendsReached,
|
||||
MaximumNumberOfPinsReachedForTheChannel,
|
||||
|
||||
MaximumNumberOfGuildRolesReached = 30005,
|
||||
|
||||
MaximumNumberOfWebhooksReached = 30007,
|
||||
|
||||
MaximumNumberOfReactionsReached = 30010,
|
||||
|
||||
MaximumNumberOfGuildChannelsReached = 30013,
|
||||
|
||||
MaximumNumberOfAttachmentsInAMessageReached = 30015,
|
||||
MaximumNumberOfInvitesReached,
|
||||
|
||||
Unauthorized = 40001,
|
||||
VerifyYourAccount,
|
||||
|
||||
RequestEntityTooLarge = 40005,
|
||||
FeatureTemporarilyDisabledServerSide,
|
||||
UserBannedFromThisGuild,
|
||||
|
||||
MissingAccess = 50001,
|
||||
InvalidAccountType,
|
||||
CannotExecuteActionOnDMChannel,
|
||||
GuildWidgetDisabled,
|
||||
CannotEditMessageAuthoredByAnotherUser,
|
||||
CannotSendAnEmptyMessage,
|
||||
CannotSendMessagesToThisUser,
|
||||
CannotSendMessagesInVoiceChannel,
|
||||
ChannelVerificationLevelTooHighForYouToGainAccess,
|
||||
Oauth2ApplicationDoesNotHaveBot,
|
||||
Oauth2ApplicationLimitReached,
|
||||
InvalidOauth2State,
|
||||
MissingPermissions,
|
||||
InvalidToken,
|
||||
NoteWasTooLong,
|
||||
ProvidedTooFewOrTooManyMessagesToDelete,
|
||||
|
||||
MessageCanOnlyBePinnedInTheChannelItWasSentIn = 50019,
|
||||
InviteCodeInvalidOrTaken,
|
||||
CannotExecuteActionOnSystemMessage,
|
||||
|
||||
CannotExecuteActionOnThisChannelType = 50024,
|
||||
InvalidOauth2AccessToken,
|
||||
|
||||
InvalidRecipients = 50033,
|
||||
OneOfTheMessagesProvidedWasTooOldForBulkDelete,
|
||||
InvalidFormBodyOrContentType,
|
||||
InviteAcceptedToGuildWithoutTheBotBeingIn,
|
||||
|
||||
InvalidAPIVersion = 50041,
|
||||
|
||||
CannotDeleteChannelRequiredForCommunityGuilds = 50074,
|
||||
|
||||
TwoFactorAuthenticationIsRequired = 60003,
|
||||
|
||||
ReactionWasBlocked = 90001,
|
||||
|
||||
APIResourceOverloaded = 130000
|
||||
}
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/topics/opcodes-and-status-codes#rpc-rpc-error-codes
|
||||
*/
|
||||
export enum RPCErrorCodes {
|
||||
UnknownError = 1000,
|
||||
|
||||
InvalidPayload = 4000,
|
||||
|
||||
InvalidCommand = 4002,
|
||||
InvalidGuild,
|
||||
InvalidEvent,
|
||||
InvalidChannel,
|
||||
InvalidPermissions,
|
||||
InvalidClientID,
|
||||
InvalidOrigin,
|
||||
InvalidToken,
|
||||
InvalidUser,
|
||||
|
||||
Oauth2Error = 5000,
|
||||
SelectChannelTimedOut,
|
||||
GetGuildTimedOut,
|
||||
SelectVoiceForceRequired,
|
||||
CaptureShortcutAlreadyListening,
|
||||
}
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/topics/opcodes-and-status-codes#rpc-rpc-close-event-codes
|
||||
*/
|
||||
export enum RPCCloseEventCodes {
|
||||
InvalidClientID = 4000,
|
||||
InvalidOrigin,
|
||||
RateLimited,
|
||||
TokenRevoked,
|
||||
InvalidVersion,
|
||||
InvalidEncoding,
|
||||
}
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/topics/gateway#connecting-gateway-url-params
|
||||
*/
|
||||
export interface GatewayConnectQuery {
|
||||
v: string;
|
||||
encoding: 'json' | 'etf';
|
||||
compress?: 'zlib-stream';
|
||||
}
|
||||
4
default/index.ts
Normal file
4
default/index.ts
Normal file
@@ -0,0 +1,4 @@
|
||||
// This file exports all the types available in the default API version
|
||||
// Thereby, things MAY break in the future
|
||||
|
||||
export * from '../v6';
|
||||
44
package.json
Normal file
44
package.json
Normal file
@@ -0,0 +1,44 @@
|
||||
{
|
||||
"name": "discord-api-types",
|
||||
"version": "0.1.0",
|
||||
"description": "Discord API typings that are kept up to date for use in bot library creation.",
|
||||
"main": "default/index.js",
|
||||
"scripts": {
|
||||
"prepublishOnly": "npm run clean && npm run test:lint && npm run build",
|
||||
"build": "tsc",
|
||||
"test:lint": "eslint --ext ts v*/** default/** common/**",
|
||||
"lint": "eslint --fix --ext ts v*/** default/** common/**",
|
||||
"clean": "npx rimraf {v*,default,common}/**/*.{js,d.ts,map}"
|
||||
},
|
||||
"keywords": [
|
||||
"discord",
|
||||
"discord api",
|
||||
"types",
|
||||
"discordjs"
|
||||
],
|
||||
"author": "Vlad Frangu <kingdgrizzle@gmail.com>",
|
||||
"license": "MIT",
|
||||
"files": [
|
||||
"v*/*",
|
||||
"default/*",
|
||||
"common/*",
|
||||
"!**/*.ts",
|
||||
"v*/*.d.ts",
|
||||
"default/*.d.ts",
|
||||
"common/*.d.ts"
|
||||
],
|
||||
"engines": {
|
||||
"node": ">12"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@skyra/eslint-config": "^5.3.0",
|
||||
"@typescript-eslint/eslint-plugin": "^3.9.1",
|
||||
"@typescript-eslint/parser": "^3.9.1",
|
||||
"eslint": "^7.7.0",
|
||||
"typescript": "^4.0.2"
|
||||
},
|
||||
"repository": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/vladfrangu/discord-api-types"
|
||||
}
|
||||
}
|
||||
26
tsconfig.json
Normal file
26
tsconfig.json
Normal file
@@ -0,0 +1,26 @@
|
||||
{
|
||||
"compileOnSave": true,
|
||||
"compilerOptions": {
|
||||
"alwaysStrict": true,
|
||||
"lib": ["esnext"],
|
||||
"module": "commonjs",
|
||||
"noUnusedParameters": true,
|
||||
"sourceMap": true,
|
||||
"declaration": true,
|
||||
"noUnusedLocals": true,
|
||||
"removeComments": false,
|
||||
"target": "esnext",
|
||||
"importsNotUsedAsValues": "error"
|
||||
},
|
||||
"exclude": [
|
||||
"node_modules",
|
||||
"bin",
|
||||
"examples",
|
||||
"scripts"
|
||||
],
|
||||
"include": [
|
||||
"./v*/**/*",
|
||||
"default/**/*",
|
||||
"common/**/*",
|
||||
]
|
||||
}
|
||||
613
v6/gateway/index.ts
Normal file
613
v6/gateway/index.ts
Normal file
@@ -0,0 +1,613 @@
|
||||
/**
|
||||
* Types extracted from https://discord.com/developers/docs/topics/gateway
|
||||
*/
|
||||
|
||||
import type { APIChannel, APIEmoji, APIGuild, APIGuildMember, APIMessage, APIRole, APIUnavailableGuild, APIUser, GatewayActivity, GatewayPresenceUpdate as RawGatewayPresenceUpdate, GatewayVoiceState, InviteTargetUserType, PresenceUpdateStatus } from '../payloads';
|
||||
|
||||
export const GatewayVersion = '6';
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/topics/opcodes-and-status-codes#gateway-gateway-opcodes
|
||||
*/
|
||||
export enum GatewayOPCodes {
|
||||
Dispatch,
|
||||
Heartbeat,
|
||||
Identify,
|
||||
PresenceUpdate,
|
||||
VoiceStateUpdate,
|
||||
|
||||
Resume = 6,
|
||||
Reconnect,
|
||||
RequestGuildMembers,
|
||||
InvalidSession,
|
||||
Hello,
|
||||
HeartbeatAck,
|
||||
}
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/topics/opcodes-and-status-codes#gateway-gateway-close-event-codes
|
||||
*/
|
||||
export enum GatewayCloseCodes {
|
||||
UnknownError = 4000,
|
||||
UnknownOpCode,
|
||||
DecodeError,
|
||||
NotAuthenticated,
|
||||
AuthenticationFailed,
|
||||
AlreadyAuthenticated,
|
||||
|
||||
InvalidSeq = 4007,
|
||||
RateLimited,
|
||||
SessionTimedOut,
|
||||
InvalidShard,
|
||||
ShardingRequired,
|
||||
InvalidAPIVersion,
|
||||
InvalidIntents,
|
||||
DisallowedIntents,
|
||||
}
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/topics/opcodes-and-status-codes#voice-voice-opcodes
|
||||
*/
|
||||
export enum VoiceOPCodes {
|
||||
Identify,
|
||||
SelectProtocol,
|
||||
Ready,
|
||||
Heartbeat,
|
||||
SessionDescription,
|
||||
Speaking,
|
||||
HeartbeatAck,
|
||||
Resume,
|
||||
Hello,
|
||||
Resumed,
|
||||
|
||||
ClientDisconnect = 13,
|
||||
}
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/topics/opcodes-and-status-codes#voice-voice-close-event-codes
|
||||
*/
|
||||
export enum VoiceCloseCodes {
|
||||
UnknownOpCode = 4001,
|
||||
|
||||
NotAuthenticated = 4003,
|
||||
AuthenticationFailed,
|
||||
AlreadyAuthenticated,
|
||||
SessionNoLongerValid,
|
||||
|
||||
SessionTimeout = 4009,
|
||||
|
||||
ServerNotFound = 4011,
|
||||
UnknownProtocol,
|
||||
|
||||
Disconnected = 4014,
|
||||
VoiceServerCrashed,
|
||||
UnknownEncryptionMode,
|
||||
}
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/topics/gateway#list-of-intents
|
||||
*/
|
||||
export enum GatewayIntentBits {
|
||||
GUILDS = 1 << 0,
|
||||
GUILD_MEMBERS = 1 << 1,
|
||||
GUILD_BANS = 1 << 2,
|
||||
GUILD_EMOJIS = 1 << 3,
|
||||
GUILD_INTEGRATIONS = 1 << 4,
|
||||
GUILD_WEBHOOKS = 1 << 5,
|
||||
GUILD_INVITES = 1 << 6,
|
||||
GUILD_VOICE_STATES = 1 << 7,
|
||||
GUILD_PRESENCES = 1 << 8,
|
||||
GUILD_MESSAGES = 1 << 9,
|
||||
GUILD_MESSAGE_REACTIONS = 1 << 10,
|
||||
GUILD_MESSAGE_TYPING = 1 << 11,
|
||||
DIRECT_MESSAGES = 1 << 12,
|
||||
DIRECT_MESSAGE_REACTIONS = 1 << 13,
|
||||
DIRECT_MESSAGE_TYPING = 1 << 14,
|
||||
}
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/topics/gateway#commands-and-events-gateway-events
|
||||
*/
|
||||
export enum GatewayDispatchEvents {
|
||||
Ready = 'READY',
|
||||
Resumed = 'RESUMED',
|
||||
ChannelCreate = 'CHANNEL_CREATE',
|
||||
ChannelUpdate = 'CHANNEL_UPDATE',
|
||||
ChannelDelete = 'CHANNEL_DELETE',
|
||||
ChannelPinsUpdate = 'CHANNEL_PINS_UPDATE',
|
||||
GuildCreate = 'GUILD_CREATE',
|
||||
GuildUpdate = 'GUILD_UPDATE',
|
||||
GuildDelete = 'GUILD_DELETE',
|
||||
GuildBanAdd = 'GUILD_BAN_ADD',
|
||||
GuildBanRemove = 'GUILD_BAN_REMOVE',
|
||||
GuildEmojisUpdate = 'GUILD_EMOJIS_UPDATE',
|
||||
GuildIntegrationsUpdate = 'GUILD_INTEGRATIONS_UPDATE',
|
||||
GuildMemberAdd = 'GUILD_MEMBER_ADD',
|
||||
GuildMemberRemove = 'GUILD_MEMBER_REMOVE',
|
||||
GuildMemberUpdate = 'GUILD_MEMBER_UPDATE',
|
||||
GuildMembersChunk = 'GUILD_MEMBERS_CHUNK',
|
||||
GuildRoleCreate = 'GUILD_ROLE_CREATE',
|
||||
GuildRoleUpdate = 'GUILD_ROLE_UPDATE',
|
||||
GuildRoleDelete = 'GUILD_ROLE_DELETE',
|
||||
InviteCreate = 'INVITE_CREATE',
|
||||
InviteDelete = 'INVITE_DELETE',
|
||||
MessageCreate = 'MESSAGE_CREATE',
|
||||
MessageUpdate = 'MESSAGE_UPDATE',
|
||||
MessageDelete = 'MESSAGE_DELETE',
|
||||
MessageDeleteBulk = 'MESSAGE_DELETE_BULK',
|
||||
MessageReactionAdd = 'MESSAGE_REACTION_ADD',
|
||||
MessageReactionRemove = 'MESSAGE_REACTION_REMOVE',
|
||||
MessageReactionRemoveAll = 'MESSAGE_REACTION_REMOVE_ALL',
|
||||
MessageReactionRemoveEmoji = 'MESSAGE_REACTION_REMOVE_EMOJI',
|
||||
PresenceUpdate = 'PRESENCE_UPDATE',
|
||||
TypingStart = 'TYPING_START',
|
||||
UserUpdate = 'USER_UPDATE',
|
||||
VoiceStateUpdate = 'VOICE_STATE_UPDATE',
|
||||
VoiceServerUpdate = 'VOICE_SERVER_UPDATE',
|
||||
WebhooksUpdate = 'WEBHOOKS_UPDATE',
|
||||
}
|
||||
|
||||
export type GatewaySendPayload = GatewayHeartbeat | GatewayIdentify | GatewayPresenceUpdate | GatewayVoiceStateUpdate | GatewayResume | GatewayRequestGuildMembers;
|
||||
|
||||
export type GatewayReceivePayload = GatewayHello | GatewayHeartbeatRequest | GatewayHeartbeatAck | GatewayInvalidSession | GatewayReconnect | GatewayDispatchPayload;
|
||||
|
||||
export type GatewayDispatchPayload =
|
||||
GatewayReadyDispatch
|
||||
| GatewayResumedDispatch
|
||||
| GatewayChannelModifyDispatch
|
||||
| GatewayChannelPinsUpdateDispatch
|
||||
| GatewayGuildModifyDispatch
|
||||
| GatewayGuildDeleteDispatch
|
||||
| GatewayGuildBanModifyDispatch
|
||||
| GatewayGuildEmojisUpdateDispatch
|
||||
| GatewayGuildIntegrationsUpdateDispatch
|
||||
| GatewayGuildMemberAddDispatch
|
||||
| GatewayGuildMemberRemoveDispatch
|
||||
| GatewayGuildMemberUpdateDispatch
|
||||
| GatewayGuildMembersChunkDispatch
|
||||
| GatewayGuildRoleModifyDispatch
|
||||
| GatewayGuildRoleDeleteDispatch
|
||||
| GatewayInviteCreateDispatch
|
||||
| GatewayInviteDeleteDispatch
|
||||
| GatewayMessageCreateDispatch
|
||||
| GatewayMessageUpdateDispatch
|
||||
| GatewayMessageDeleteDispatch
|
||||
| GatewayMessageDeleteBulkDispatch
|
||||
| GatewayMessageReactionAddDispatch
|
||||
| GatewayMessageReactionRemoveDispatch
|
||||
| GatewayMessageReactionRemoveAllDispatch
|
||||
| GatewayMessageReactionRemoveEmojiDispatch
|
||||
| GatewayPresenceUpdateDispatch
|
||||
| GatewayTypingStartDispatch
|
||||
| GatewayUserUpdateDispatch
|
||||
| GatewayVoiceStateUpdateDispatch
|
||||
| GatewayVoiceServerUpdateDispatch
|
||||
| GatewayWebhooksUpdateDispatch;
|
||||
|
||||
// #region Dispatch Payloads
|
||||
/**
|
||||
* https://discord.com/developers/docs/topics/gateway#hello
|
||||
*/
|
||||
export interface GatewayHello extends NonDispatchPayload {
|
||||
op: GatewayOPCodes.Hello;
|
||||
d: {
|
||||
heartbeat_interval: number;
|
||||
};
|
||||
}
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/topics/gateway#heartbeating
|
||||
*/
|
||||
export interface GatewayHeartbeatRequest extends NonDispatchPayload {
|
||||
op: GatewayOPCodes.Heartbeat;
|
||||
d: never;
|
||||
}
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/topics/gateway#heartbeating-example-gateway-heartbeat-ack
|
||||
*/
|
||||
export interface GatewayHeartbeatAck extends NonDispatchPayload {
|
||||
op: GatewayOPCodes.HeartbeatAck;
|
||||
d: never;
|
||||
}
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/topics/gateway#invalid-session
|
||||
*/
|
||||
export interface GatewayInvalidSession extends NonDispatchPayload {
|
||||
op: GatewayOPCodes.InvalidSession;
|
||||
d: boolean;
|
||||
}
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/topics/gateway#reconnect
|
||||
*/
|
||||
export interface GatewayReconnect extends NonDispatchPayload {
|
||||
op: GatewayOPCodes.Reconnect;
|
||||
d: never;
|
||||
}
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/topics/gateway#ready
|
||||
*/
|
||||
export type GatewayReadyDispatch = DataPayload<GatewayDispatchEvents.Ready, {
|
||||
v: number;
|
||||
user: APIUser;
|
||||
session_id: string;
|
||||
private_channels: [];
|
||||
guilds: APIUnavailableGuild[];
|
||||
shard?: [number, number];
|
||||
}>;
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/topics/gateway#resumed
|
||||
*/
|
||||
export type GatewayResumedDispatch = DataPayload<GatewayDispatchEvents.Resumed, never>;
|
||||
|
||||
/* eslint-disable @typescript-eslint/indent */
|
||||
/**
|
||||
* https://discord.com/developers/docs/topics/gateway#channel-create
|
||||
* https://discord.com/developers/docs/topics/gateway#channel-update
|
||||
* https://discord.com/developers/docs/topics/gateway#channel-delete
|
||||
*/
|
||||
export type GatewayChannelModifyDispatch = DataPayload<
|
||||
GatewayDispatchEvents.ChannelCreate
|
||||
| GatewayDispatchEvents.ChannelDelete
|
||||
| GatewayDispatchEvents.ChannelUpdate,
|
||||
APIChannel
|
||||
>;
|
||||
/* eslint-enable @typescript-eslint/indent */
|
||||
|
||||
export type GatewayChannelCreateDispatch = GatewayChannelModifyDispatch;
|
||||
export type GatewayChannelUpdateDispatch = GatewayChannelModifyDispatch;
|
||||
export type GatewayChannelDeleteDispatch = GatewayChannelModifyDispatch;
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/topics/gateway#channel-pins-update
|
||||
*/
|
||||
export type GatewayChannelPinsUpdateDispatch = DataPayload<GatewayDispatchEvents.ChannelPinsUpdate, {
|
||||
guild_id?: string;
|
||||
channel_id: string;
|
||||
last_pin_timestamp?: string;
|
||||
}>;
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/topics/gateway#guild-create
|
||||
* https://discord.com/developers/docs/topics/gateway#guild-update
|
||||
*/
|
||||
export type GatewayGuildModifyDispatch = DataPayload<GatewayDispatchEvents.GuildCreate | GatewayDispatchEvents.GuildUpdate, APIGuild>;
|
||||
|
||||
export type GatewayGuildCreateDispatch = GatewayGuildModifyDispatch;
|
||||
export type GatewayGuildUpdateDispatch = GatewayGuildModifyDispatch;
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/topics/gateway#guild-delete
|
||||
*/
|
||||
export type GatewayGuildDeleteDispatch = DataPayload<GatewayDispatchEvents.GuildDelete, APIUnavailableGuild>;
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/topics/gateway#guild-ban-add
|
||||
* https://discord.com/developers/docs/topics/gateway#guild-ban-remove
|
||||
*/
|
||||
export type GatewayGuildBanModifyDispatch = DataPayload<GatewayDispatchEvents.GuildBanAdd | GatewayDispatchEvents.GuildBanRemove, {
|
||||
guild_id: string;
|
||||
user: APIUser;
|
||||
}>;
|
||||
|
||||
export type GatewayGuildBanAddDispatch = GatewayGuildBanModifyDispatch;
|
||||
export type GatewayGuildBanRemoveDispatch = GatewayGuildBanModifyDispatch;
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/topics/gateway#guild-emojis-update
|
||||
*/
|
||||
export type GatewayGuildEmojisUpdateDispatch = DataPayload<GatewayDispatchEvents.GuildEmojisUpdate, {
|
||||
guild_id: string;
|
||||
emojis: APIEmoji[];
|
||||
}>;
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/topics/gateway#guild-integrations-update
|
||||
*/
|
||||
export type GatewayGuildIntegrationsUpdateDispatch = DataPayload<GatewayDispatchEvents.GuildIntegrationsUpdate, { guild_id: string }>;
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/topics/gateway#guild-member-add
|
||||
*/
|
||||
export type GatewayGuildMemberAddDispatch = DataPayload<GatewayDispatchEvents.GuildMemberAdd, APIGuildMember & { guild_id: string }>;
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/topics/gateway#guild-member-remove
|
||||
*/
|
||||
export type GatewayGuildMemberRemoveDispatch = DataPayload<GatewayDispatchEvents.GuildMemberRemove, {
|
||||
guild_id: string;
|
||||
user: APIUser;
|
||||
}>;
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/topics/gateway#guild-member-update
|
||||
*/
|
||||
export type GatewayGuildMemberUpdateDispatch = DataPayload<GatewayDispatchEvents.GuildMemberUpdate, Omit<APIGuildMember, 'deaf' | 'mute'> & {
|
||||
guild_id: string;
|
||||
}>;
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/topics/gateway#guild-members-chunk
|
||||
*/
|
||||
export type GatewayGuildMembersChunkDispatch = DataPayload<GatewayDispatchEvents.GuildMembersChunk, {
|
||||
guild_id: string;
|
||||
members: APIGuildMember[];
|
||||
chunk_index?: number;
|
||||
chunk_count?: number;
|
||||
not_found?: unknown[];
|
||||
presences?: RawGatewayPresenceUpdate[];
|
||||
nonce?: string;
|
||||
}>;
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/topics/gateway#guild-role-create
|
||||
* https://discord.com/developers/docs/topics/gateway#guild-role-update
|
||||
*/
|
||||
export type GatewayGuildRoleModifyDispatch = DataPayload<GatewayDispatchEvents.GuildRoleCreate | GatewayDispatchEvents.GuildRoleUpdate, {
|
||||
guild_id: string;
|
||||
role: APIRole;
|
||||
}>;
|
||||
|
||||
export type GatewayGuildRoleCreateDispatch = GatewayGuildRoleModifyDispatch;
|
||||
export type GatewayGuildRoleUpdateDispatch = GatewayGuildRoleModifyDispatch;
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/topics/gateway#guild-role-delete
|
||||
*/
|
||||
export type GatewayGuildRoleDeleteDispatch = DataPayload<GatewayDispatchEvents.GuildRoleDelete, {
|
||||
guild_id: string;
|
||||
role_id: string;
|
||||
}>;
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/topics/gateway#invite-create
|
||||
*/
|
||||
export type GatewayInviteCreateDispatch = DataPayload<GatewayDispatchEvents.InviteCreate, {
|
||||
channel_id: string;
|
||||
code: string;
|
||||
created_at: number;
|
||||
guild_id?: string;
|
||||
inviter?: APIUser;
|
||||
max_age: number;
|
||||
max_uses: number;
|
||||
target_user?: APIUser;
|
||||
target_user_type?: InviteTargetUserType;
|
||||
temporary: boolean;
|
||||
uses: 0;
|
||||
}>;
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/topics/gateway#invite-delete
|
||||
*/
|
||||
export type GatewayInviteDeleteDispatch = DataPayload<GatewayDispatchEvents.InviteDelete, {
|
||||
channel_id: string;
|
||||
guild_id?: string;
|
||||
code: string;
|
||||
}>;
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/topics/gateway#message-create
|
||||
*/
|
||||
export type GatewayMessageCreateDispatch = DataPayload<GatewayDispatchEvents.MessageCreate, APIMessage>;
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/topics/gateway#message-update
|
||||
*/
|
||||
export type GatewayMessageUpdateDispatch = DataPayload<GatewayDispatchEvents.MessageUpdate, { id: string; channel_id: string } & Partial<APIMessage>>;
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/topics/gateway#message-delete
|
||||
*/
|
||||
export type GatewayMessageDeleteDispatch = DataPayload<GatewayDispatchEvents.MessageDelete, {
|
||||
id: string;
|
||||
channel_id: string;
|
||||
guild_id?: string;
|
||||
}>;
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/topics/gateway#message-delete-bulk
|
||||
*/
|
||||
export type GatewayMessageDeleteBulkDispatch = DataPayload<GatewayDispatchEvents.MessageDeleteBulk, {
|
||||
ids: string[];
|
||||
channel_id: string;
|
||||
guild_id?: string;
|
||||
}>;
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/topics/gateway#message-reaction-add
|
||||
*/
|
||||
export type GatewayMessageReactionAddDispatch = ReactionData<GatewayDispatchEvents.MessageReactionAdd>;
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/topics/gateway#message-reaction-remove
|
||||
*/
|
||||
export type GatewayMessageReactionRemoveDispatch = ReactionData<GatewayDispatchEvents.MessageReactionRemove, 'member'>;
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/topics/gateway#message-reaction-remove-all
|
||||
*/
|
||||
export type GatewayMessageReactionRemoveAllDispatch = DataPayload<GatewayDispatchEvents.MessageReactionRemoveAll, MessageReactionRemoveData>;
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/topics/gateway#message-reaction-remove-emoji
|
||||
*/
|
||||
export type GatewayMessageReactionRemoveEmojiDispatch = DataPayload<GatewayDispatchEvents.MessageReactionRemoveEmoji, MessageReactionRemoveData & {
|
||||
emoji: APIEmoji;
|
||||
}>;
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/topics/gateway#presence-update
|
||||
*/
|
||||
export type GatewayPresenceUpdateDispatch = DataPayload<GatewayDispatchEvents.PresenceUpdate, RawGatewayPresenceUpdate>;
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/topics/gateway#typing-start
|
||||
*/
|
||||
export type GatewayTypingStartDispatch = DataPayload<GatewayDispatchEvents.TypingStart, {
|
||||
channel_id: string;
|
||||
guild_id?: string;
|
||||
user_id: string;
|
||||
timestamp: number;
|
||||
member?: APIGuildMember;
|
||||
}>;
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/topics/gateway#user-update
|
||||
*/
|
||||
export type GatewayUserUpdateDispatch = DataPayload<GatewayDispatchEvents.UserUpdate, APIUser>;
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/topics/gateway#voice-state-update
|
||||
*/
|
||||
export type GatewayVoiceStateUpdateDispatch = DataPayload<GatewayDispatchEvents.VoiceStateUpdate, GatewayVoiceState>;
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/topics/gateway#voice-server-update
|
||||
*/
|
||||
export type GatewayVoiceServerUpdateDispatch = DataPayload<GatewayDispatchEvents.VoiceServerUpdate, {
|
||||
token: string;
|
||||
guild_id: string;
|
||||
endpoint: string;
|
||||
}>;
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/topics/gateway#webhooks-update
|
||||
*/
|
||||
export type GatewayWebhooksUpdateDispatch = DataPayload<GatewayDispatchEvents.WebhooksUpdate, {
|
||||
guild_id: string;
|
||||
channel_id: string;
|
||||
}>;
|
||||
|
||||
// #endregion Dispatch Payloads
|
||||
|
||||
// #region Sendable Payloads
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/topics/gateway#heartbeating
|
||||
*/
|
||||
export interface GatewayHeartbeat {
|
||||
op: GatewayOPCodes.Heartbeat;
|
||||
d: number;
|
||||
}
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/topics/gateway#identify-identify-connection-properties
|
||||
*/
|
||||
export interface GatewayIdentifyProperties {
|
||||
$os: string;
|
||||
$browser: string;
|
||||
device: string;
|
||||
}
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/topics/gateway#identify
|
||||
*/
|
||||
export interface GatewayIdentify {
|
||||
op: GatewayOPCodes.Identify;
|
||||
d: {
|
||||
token: string;
|
||||
properties: GatewayIdentifyProperties;
|
||||
compress?: boolean;
|
||||
large_threshold?: number;
|
||||
shard?: [shard_id: number, shard_count: number];
|
||||
presence?: RawGatewayPresenceUpdate;
|
||||
guild_subscriptions?: boolean;
|
||||
intents?: number;
|
||||
};
|
||||
}
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/topics/gateway#resume
|
||||
*/
|
||||
export interface GatewayResume {
|
||||
op: GatewayOPCodes.Resume;
|
||||
d: {
|
||||
token: string;
|
||||
session_id: string;
|
||||
seq: number;
|
||||
};
|
||||
}
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/topics/gateway#request-guild-members
|
||||
*/
|
||||
export interface GatewayRequestGuildMembers {
|
||||
op: GatewayOPCodes.RequestGuildMembers;
|
||||
d: {
|
||||
guild_id: string | string[];
|
||||
query?: string;
|
||||
limit: number;
|
||||
presences?: boolean;
|
||||
user_ids?: string | string[];
|
||||
nonce?: string;
|
||||
};
|
||||
}
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/topics/gateway#update-voice-state
|
||||
*/
|
||||
export interface GatewayVoiceStateUpdate {
|
||||
op: GatewayOPCodes.VoiceStateUpdate;
|
||||
d: {
|
||||
guild_id: string;
|
||||
channel_id: string | null;
|
||||
self_mute: boolean;
|
||||
self_deaf: boolean;
|
||||
};
|
||||
}
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/topics/gateway#update-status
|
||||
*/
|
||||
export interface GatewayPresenceUpdate {
|
||||
op: GatewayOPCodes.PresenceUpdate;
|
||||
d: GatewayPresenceUpdateData;
|
||||
}
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/topics/gateway#update-status-gateway-status-update-structure
|
||||
*/
|
||||
export interface GatewayPresenceUpdateData {
|
||||
since: number | null;
|
||||
game: GatewayActivity | null;
|
||||
status: PresenceUpdateStatus;
|
||||
afk: boolean;
|
||||
}
|
||||
|
||||
// #endregion Sendable Payloads
|
||||
|
||||
// #region Shared
|
||||
interface BasePayload {
|
||||
op: GatewayOPCodes;
|
||||
s: number;
|
||||
d?: unknown;
|
||||
t?: string;
|
||||
}
|
||||
|
||||
type NonDispatchPayload = Omit<BasePayload, 't'>;
|
||||
|
||||
interface DataPayload<Event extends GatewayDispatchEvents, D = unknown> extends BasePayload {
|
||||
op: GatewayOPCodes.Dispatch;
|
||||
t: Event;
|
||||
d: D;
|
||||
}
|
||||
|
||||
type ReactionData<E extends GatewayDispatchEvents, O extends string = never> = DataPayload<E, Omit<{
|
||||
user_id: string;
|
||||
channel_id: string;
|
||||
message_id: string;
|
||||
guild_id?: string;
|
||||
member?: APIGuildMember;
|
||||
emoji: APIEmoji;
|
||||
}, O>>;
|
||||
|
||||
interface MessageReactionRemoveData {
|
||||
channel_id: string;
|
||||
message_id: string;
|
||||
guild_id?: string;
|
||||
}
|
||||
// #endregion Shared
|
||||
5
v6/index.ts
Normal file
5
v6/index.ts
Normal file
@@ -0,0 +1,5 @@
|
||||
export * from '../common';
|
||||
export * from './gateway';
|
||||
export * from './payloads';
|
||||
export * from './rest';
|
||||
|
||||
376
v6/payloads/auditLog.ts
Normal file
376
v6/payloads/auditLog.ts
Normal file
@@ -0,0 +1,376 @@
|
||||
/**
|
||||
* Types extracted from https://discord.com/developers/docs/resources/audit-log
|
||||
*/
|
||||
|
||||
import type { APIOverwrite, ChannelType } from './channel';
|
||||
import type { APIGuildIntegration, GuildDefaultMessageNotifications, GuildExplicitContentFilter, GuildMFALevel, GuildVerificationLevel, IntegrationExpireBehavior } from './guild';
|
||||
import type { APIRole } from './permissions';
|
||||
import type { APIUser } from './user';
|
||||
import type { APIWebhook } from './webhook';
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/audit-log#audit-log-object-audit-log-structure
|
||||
*/
|
||||
export interface APIAuditLog {
|
||||
webhooks: APIWebhook[];
|
||||
users: APIUser[];
|
||||
audit_log_entries: APIAuditLogEntry[];
|
||||
integrations: APIGuildIntegration[];
|
||||
}
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/audit-log#audit-log-entry-object-audit-log-entry-structure
|
||||
*/
|
||||
export interface APIAuditLogEntry {
|
||||
target_id: string | null;
|
||||
changes?: APIAuditLogChange[];
|
||||
user_id: string | null;
|
||||
id: string;
|
||||
action_type: AuditLogEvent;
|
||||
options?: APIAuditLogOptions;
|
||||
reason?: string;
|
||||
}
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/audit-log#audit-log-entry-object-audit-log-events
|
||||
*/
|
||||
export enum AuditLogEvent {
|
||||
GUILD_UPDATE = 1,
|
||||
|
||||
CHANNEL_CREATE = 10,
|
||||
CHANNEL_UPDATE,
|
||||
CHANNEL_DELETE,
|
||||
CHANNEL_OVERWRITE_CREATE,
|
||||
CHANNEL_OVERWRITE_UPDATE,
|
||||
CHANNEL_OVERWRITE_DELETE,
|
||||
|
||||
MEMBER_KICK = 20,
|
||||
MEMBER_PRUNE,
|
||||
MEMBER_BAN_ADD,
|
||||
MEMBER_BAN_REMOVE,
|
||||
MEMBER_UPDATE,
|
||||
MEMBER_ROLE_UPDATE,
|
||||
MEMBER_MOVE,
|
||||
MEMBER_DISCONNECT,
|
||||
BOT_ADD,
|
||||
|
||||
ROLE_CREATE = 30,
|
||||
ROLE_UPDATE,
|
||||
ROLE_DELETE,
|
||||
|
||||
INVITE_CREATE = 40,
|
||||
INVITE_UPDATE,
|
||||
INVITE_DELETE,
|
||||
|
||||
WEBHOOK_CREATE = 50,
|
||||
WEBHOOK_UPDATE,
|
||||
WEBHOOK_DELETE,
|
||||
|
||||
EMOJI_CREATE = 60,
|
||||
EMOJI_UPDATE,
|
||||
EMOJI_DELETE,
|
||||
|
||||
MESSAGE_DELETE = 72,
|
||||
MESSAGE_BULK_DELETE,
|
||||
MESSAGE_PIN,
|
||||
MESSAGE_UNPIN,
|
||||
|
||||
INTEGRATION_CREATE = 80,
|
||||
INTEGRATION_UPDATE,
|
||||
INTEGRATION_DELETE,
|
||||
}
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/audit-log#audit-log-entry-object-optional-audit-entry-info
|
||||
*/
|
||||
export interface APIAuditLogOptions {
|
||||
/**
|
||||
* Present from:
|
||||
* - MEMBER_PRUNE
|
||||
*/
|
||||
delete_member_days?: string;
|
||||
/**
|
||||
* Present from:
|
||||
* - MEMBER_PRUNE
|
||||
*/
|
||||
members_removed?: string;
|
||||
|
||||
/**
|
||||
* Present from:
|
||||
* - MEMBER_MOVE
|
||||
* - MESSAGE_PIN
|
||||
* - MESSAGE_UNPIN
|
||||
* - MESSAGE_DELETE
|
||||
*/
|
||||
channel_id?: string;
|
||||
|
||||
/**
|
||||
* Present from:
|
||||
* - MESSAGE_PIN
|
||||
* - MESSAGE_UNPIN
|
||||
*/
|
||||
message_id?: string;
|
||||
|
||||
/**
|
||||
* Present from:
|
||||
* - MESSAGE_DELETE
|
||||
* - MESSAGE_BULK_DELETE
|
||||
* - MEMBER_DISCONNECT
|
||||
* - MEMBER_MOVE
|
||||
*/
|
||||
count?: string;
|
||||
|
||||
/**
|
||||
* Present from:
|
||||
* - CHANNEL_OVERWRITE_CREATE
|
||||
* - CHANNEL_OVERWRITE_UPDATE
|
||||
* - CHANNEL_OVERWRITE_DELETE
|
||||
*/
|
||||
id?: string;
|
||||
|
||||
/**
|
||||
* Present from:
|
||||
* - CHANNEL_OVERWRITE_CREATE
|
||||
* - CHANNEL_OVERWRITE_UPDATE
|
||||
* - CHANNEL_OVERWRITE_DELETE
|
||||
*/
|
||||
type: AuditLogOptionsType;
|
||||
|
||||
/**
|
||||
* Present from:
|
||||
* - CHANNEL_OVERWRITE_CREATE
|
||||
* - CHANNEL_OVERWRITE_UPDATE
|
||||
* - CHANNEL_OVERWRITE_DELETE
|
||||
*
|
||||
* **Present only if the {@link APIAuditLogOptions#type entry type} is "role"**
|
||||
*/
|
||||
role_name?: string;
|
||||
}
|
||||
|
||||
export enum AuditLogOptionsType {
|
||||
Member = 'member',
|
||||
Role = 'role',
|
||||
}
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/audit-log#audit-log-change-object-audit-log-change-structure
|
||||
*/
|
||||
export interface APIAuditLogChange {
|
||||
new_value?: APIAuditLogChangeKey;
|
||||
old_value?: APIAuditLogChangeKey;
|
||||
key: string;
|
||||
}
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/audit-log#audit-log-change-object-audit-log-change-key
|
||||
*/
|
||||
export interface APIAuditLogChangeKey {
|
||||
/**
|
||||
* Returned when a guild is updated
|
||||
*/
|
||||
name?: string;
|
||||
/**
|
||||
* Returned when a guild is updated
|
||||
*/
|
||||
icon_hash?: string;
|
||||
/**
|
||||
* Returned when a guild is updated
|
||||
*/
|
||||
splash_hash?: string;
|
||||
/**
|
||||
* Returned when a guild is updated
|
||||
*/
|
||||
owner_id?: string;
|
||||
/**
|
||||
* Returned when a guild is updated
|
||||
*/
|
||||
region?: string;
|
||||
/**
|
||||
* Returned when a guild is updated
|
||||
*/
|
||||
afk_channel_id?: string;
|
||||
/**
|
||||
* Returned when a guild is updated
|
||||
*/
|
||||
afk_timeout?: number;
|
||||
/**
|
||||
* Returned when a guild is updated
|
||||
*/
|
||||
mfa_level?: GuildMFALevel;
|
||||
/**
|
||||
* Returned when a guild is updated
|
||||
*/
|
||||
verification_level?: GuildVerificationLevel;
|
||||
/**
|
||||
* Returned when a guild is updated
|
||||
*/
|
||||
explicit_content_filter?: GuildExplicitContentFilter;
|
||||
/**
|
||||
* Returned when a guild is updated
|
||||
*/
|
||||
default_message_notifications?: GuildDefaultMessageNotifications;
|
||||
/**
|
||||
* Returned when a guild is updated
|
||||
*/
|
||||
vanity_url_code?: string;
|
||||
/**
|
||||
* Returned when a guild is updated
|
||||
*/
|
||||
$add?: APIRole[];
|
||||
/**
|
||||
* Returned when a guild is updated
|
||||
*/
|
||||
$remove?: APIRole[];
|
||||
/**
|
||||
* Returned when a guild is updated
|
||||
*/
|
||||
prune_delete_days?: number;
|
||||
/**
|
||||
* Returned when a guild is updated
|
||||
*/
|
||||
widget_enabled?: boolean;
|
||||
/**
|
||||
* Returned when a guild is updated
|
||||
*/
|
||||
widget_channel_id?: string;
|
||||
/**
|
||||
* Returned when a guild is updated
|
||||
*/
|
||||
system_channel_id?: string;
|
||||
|
||||
/**
|
||||
* Returned when a channel is updated
|
||||
*/
|
||||
position?: number;
|
||||
/**
|
||||
* Returned when a channel is updated
|
||||
*/
|
||||
topic?: string;
|
||||
/**
|
||||
* Returned when a channel is updated
|
||||
*/
|
||||
bitrate?: number;
|
||||
/**
|
||||
* Returned when a channel is updated
|
||||
*/
|
||||
permission_overwrites?: APIOverwrite[];
|
||||
/**
|
||||
* Returned when a channel is updated
|
||||
*/
|
||||
nsfw?: boolean;
|
||||
/**
|
||||
* Returned when a channel is updated
|
||||
*/
|
||||
application_id?: string;
|
||||
/**
|
||||
* Returned when a channel is updated
|
||||
*/
|
||||
rate_limit_per_user?: number;
|
||||
|
||||
/**
|
||||
* Returned when a role is updated
|
||||
*/
|
||||
permissions?: number;
|
||||
/**
|
||||
* Returned when a role is updated
|
||||
*/
|
||||
permissions_new?: string;
|
||||
/**
|
||||
* Returned when a role is updated
|
||||
*/
|
||||
color?: string;
|
||||
/**
|
||||
* Returned when a role is updated
|
||||
*/
|
||||
hoist?: boolean;
|
||||
/**
|
||||
* Returned when a role is updated
|
||||
*/
|
||||
mentionable?: boolean;
|
||||
/**
|
||||
* Returned when a role is updated
|
||||
* @deprecated Use `allow_new` instead
|
||||
*/
|
||||
allow?: number;
|
||||
/**
|
||||
* Returned when a role is updated
|
||||
*/
|
||||
allow_new?: string;
|
||||
/**
|
||||
* Returned when a role is updated
|
||||
* @deprecated Use `deny_new` instead
|
||||
*/
|
||||
deny?: number;
|
||||
/**
|
||||
* Returned when a role is updated
|
||||
*/
|
||||
deny_new?: string;
|
||||
|
||||
/**
|
||||
* Returned when an invite is updated
|
||||
*/
|
||||
code?: string;
|
||||
/**
|
||||
* Returned when an invite is updated
|
||||
*/
|
||||
channel_id?: string;
|
||||
/**
|
||||
* Returned when an invite is updated
|
||||
*/
|
||||
inviter_id?: string;
|
||||
/**
|
||||
* Returned when an invite is updated
|
||||
*/
|
||||
max_uses?: number;
|
||||
/**
|
||||
* Returned when an invite is updated
|
||||
*/
|
||||
uses?: number;
|
||||
/**
|
||||
* Returned when an invite is updated
|
||||
*/
|
||||
max_age?: number;
|
||||
/**
|
||||
* Returned when an invite is updated
|
||||
*/
|
||||
temporary?: boolean;
|
||||
|
||||
/**
|
||||
* Returned when a user is updated
|
||||
*/
|
||||
deaf?: boolean;
|
||||
/**
|
||||
* Returned when a user is updated
|
||||
*/
|
||||
mute?: boolean;
|
||||
/**
|
||||
* Returned when a user is updated
|
||||
*/
|
||||
nick?: string;
|
||||
/**
|
||||
* Returned when a user is updated
|
||||
*/
|
||||
avatar_hash?: string;
|
||||
|
||||
/**
|
||||
* The ID of the changed entry
|
||||
*/
|
||||
id: string;
|
||||
/**
|
||||
* The type of the changed entity
|
||||
*/
|
||||
type?: ChannelType | string;
|
||||
|
||||
/**
|
||||
* Returned when an integration is updated
|
||||
*/
|
||||
enable_emoticons?: boolean;
|
||||
/**
|
||||
* Returned when an integration is updated
|
||||
*/
|
||||
expire_behavior?: IntegrationExpireBehavior;
|
||||
/**
|
||||
* Returned when an integration is updated
|
||||
*/
|
||||
expire_grace_period?: number;
|
||||
}
|
||||
313
v6/payloads/channel.ts
Normal file
313
v6/payloads/channel.ts
Normal file
@@ -0,0 +1,313 @@
|
||||
/**
|
||||
* Types extracted from https://discord.com/developers/docs/resources/channel
|
||||
*/
|
||||
|
||||
import type { APIPartialEmoji } from './emoji';
|
||||
import type { APIGuildMember } from './guild';
|
||||
import type { APIUser } from './user';
|
||||
|
||||
/**
|
||||
* Not documented, but partial only includes id, name, and type
|
||||
*/
|
||||
export interface APIPartialChannel {
|
||||
id: string;
|
||||
type: ChannelType;
|
||||
name?: string;
|
||||
}
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/channel#channel-object-channel-structure
|
||||
*/
|
||||
export interface APIChannel extends APIPartialChannel {
|
||||
guild_id?: string;
|
||||
position: number;
|
||||
permission_overwrites?: APIOverwrite[];
|
||||
name?: string;
|
||||
topic?: string | null;
|
||||
nsfw?: boolean;
|
||||
last_message_id?: string | null;
|
||||
bitrate?: number;
|
||||
user_limit?: number;
|
||||
rate_limit_per_user?: number;
|
||||
recipients?: APIUser[];
|
||||
icon?: string | null;
|
||||
owner_id?: string;
|
||||
application_id?: string;
|
||||
parent_id?: string | null;
|
||||
last_pin_timestamp?: string | null;
|
||||
}
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/channel#channel-object-channel-types
|
||||
*/
|
||||
export enum ChannelType {
|
||||
GUILD_TEXT = 0,
|
||||
DM,
|
||||
GUILD_VOICE,
|
||||
GROUP_DM,
|
||||
GUILD_CATEGORY,
|
||||
GUILD_NEWS,
|
||||
GUILD_STORE,
|
||||
}
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/channel#message-object-message-structure
|
||||
*/
|
||||
export interface APIMessage {
|
||||
id: string;
|
||||
channel_id: string;
|
||||
guild_id?: string;
|
||||
author: APIUser;
|
||||
member?: APIGuildMember;
|
||||
content: string;
|
||||
timestamp: string;
|
||||
edited_timestamp: string | null;
|
||||
tts: boolean;
|
||||
mention_everyone: boolean;
|
||||
mentions: APIUser & { member?: Omit<APIGuildMember, 'user'> };
|
||||
mention_roles: string[];
|
||||
mention_channels?: APIChannelMention[];
|
||||
attachments: APIAttachment[];
|
||||
embeds: APIEmbed[];
|
||||
reactions?: APIReaction[];
|
||||
nonce?: string | number;
|
||||
pinned: boolean;
|
||||
webhook_id?: string;
|
||||
type: MessageType;
|
||||
activity?: APIMessageActivity;
|
||||
application?: APIMessageApplication;
|
||||
message_reference?: APIMessageReference;
|
||||
flags?: MessageFlags;
|
||||
}
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/channel#message-object-message-types
|
||||
*/
|
||||
export enum MessageType {
|
||||
DEFAULT = 0,
|
||||
RECIPIENT_ADD,
|
||||
RECIPIENT_REMOVE,
|
||||
CALL,
|
||||
CHANNEL_NAME_CHANGE,
|
||||
CHANNEL_ICON_CHANGE,
|
||||
CHANNEL_PINNED_MESSAGE,
|
||||
GUILD_MEMBER_JOIN,
|
||||
USER_PREMIUM_GUILD_SUBSCRIPTION,
|
||||
USER_PREMIUM_GUILD_SUBSCRIPTION_TIER_1,
|
||||
USER_PREMIUM_GUILD_SUBSCRIPTION_TIER_2,
|
||||
USER_PREMIUM_GUILD_SUBSCRIPTION_TIER_3,
|
||||
CHANNEL_FOLLOW_ADD,
|
||||
GUILD_DISCOVERY_DISQUALIFIED = 14,
|
||||
GUILD_DISCOVERY_REQUALIFIED,
|
||||
GUILD_DISCOVERY_GRACE_PERIOD_INITIAL_WARNING,
|
||||
GUILD_DISCOVERY_GRACE_PERIOD_FINAL_WARNING,
|
||||
}
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/channel#message-object-message-activity-structure
|
||||
*/
|
||||
export interface APIMessageActivity {
|
||||
type: MessageActivityType;
|
||||
party_id?: string;
|
||||
}
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/channel#message-object-message-application-structure
|
||||
*/
|
||||
export interface APIMessageApplication {
|
||||
id: string;
|
||||
cover_image?: string;
|
||||
description: string;
|
||||
icon: string | null;
|
||||
name: string;
|
||||
}
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/channel#message-object-message-reference-structure
|
||||
*/
|
||||
export interface APIMessageReference {
|
||||
message_id?: string;
|
||||
channel_id: string;
|
||||
guild_id?: string;
|
||||
}
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/channel#message-object-message-activity-types
|
||||
*/
|
||||
export enum MessageActivityType {
|
||||
JOIN = 1,
|
||||
SPECTATE,
|
||||
LISTEN,
|
||||
JOIN_REQUEST = 5
|
||||
}
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/channel#message-object-message-flags
|
||||
*/
|
||||
export enum MessageFlags {
|
||||
CROSSPOSTED = 1 << 0,
|
||||
IS_CROSSPOST = 1 << 1,
|
||||
SUPPRESS_EMBEDS = 1 << 2,
|
||||
SOURCE_MESSAGE_DELETED = 1 << 3,
|
||||
URGENT = 1 << 4
|
||||
}
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/channel#reaction-object-reaction-structure
|
||||
*/
|
||||
export interface APIReaction {
|
||||
count: number;
|
||||
me: boolean;
|
||||
emoji: APIPartialEmoji;
|
||||
}
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/channel#overwrite-object-overwrite-structure
|
||||
*/
|
||||
export interface APIOverwrite {
|
||||
id: string;
|
||||
type: OverwriteType;
|
||||
/**
|
||||
* @deprecated Use `allow_new` instead
|
||||
*/
|
||||
allow: number;
|
||||
allow_new: string;
|
||||
/**
|
||||
* @deprecated Use `deny_new` instead
|
||||
*/
|
||||
deny: number;
|
||||
deny_new: string;
|
||||
}
|
||||
|
||||
export enum OverwriteType {
|
||||
Member = 'member',
|
||||
Role = 'role',
|
||||
}
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/channel#embed-object-embed-structure
|
||||
*/
|
||||
export interface APIEmbed {
|
||||
title?: string;
|
||||
/**
|
||||
* @deprecated *Embed types should be considered deprecated and might be removed in a future API version*
|
||||
*/
|
||||
type?: EmbedType;
|
||||
description?: string;
|
||||
url?: string;
|
||||
timestamp?: string;
|
||||
color?: number;
|
||||
footer?: APIEmbedFooter;
|
||||
image?: APIEmbedImage;
|
||||
thumbnail?: APIEmbedThumbnail;
|
||||
video?: APIEmbedVideo;
|
||||
provider?: APIEmbedProvider;
|
||||
author?: APIEmbedAuthor;
|
||||
fields?: APIEmbedField[];
|
||||
}
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/channel#embed-object-embed-types
|
||||
* @deprecated *Embed types should be considered deprecated and might be removed in a future API version*
|
||||
*/
|
||||
export enum EmbedType {
|
||||
Rich = 'rich',
|
||||
Image = 'image',
|
||||
Video = 'video',
|
||||
GifV = 'gifv',
|
||||
Article = 'article',
|
||||
Link = 'link',
|
||||
}
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/channel#embed-object-embed-thumbnail-structure
|
||||
*/
|
||||
export interface APIEmbedThumbnail {
|
||||
url?: string;
|
||||
proxy_url?: string;
|
||||
height?: number;
|
||||
width?: number;
|
||||
}
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/channel#embed-object-embed-video-structure
|
||||
*/
|
||||
export interface APIEmbedVideo {
|
||||
url?: string;
|
||||
height?: number;
|
||||
width?: number;
|
||||
}
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/channel#embed-object-embed-image-structure
|
||||
*/
|
||||
export interface APIEmbedImage {
|
||||
url?: string;
|
||||
proxy_url?: string;
|
||||
height?: number;
|
||||
width?: number;
|
||||
}
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/channel#embed-object-embed-provider-structure
|
||||
*/
|
||||
export interface APIEmbedProvider {
|
||||
name?: string;
|
||||
url?: string;
|
||||
}
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/channel#embed-object-embed-author-structure
|
||||
*/
|
||||
export interface APIEmbedAuthor {
|
||||
name?: string;
|
||||
url?: string;
|
||||
icon_url?: string;
|
||||
proxy_icon_url?: string;
|
||||
}
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/channel#embed-object-embed-footer-structure
|
||||
*/
|
||||
export interface APIEmbedFooter {
|
||||
text: string;
|
||||
icon_url?: string;
|
||||
proxy_icon_url?: string;
|
||||
}
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/channel#embed-object-embed-field-structure
|
||||
*/
|
||||
export interface APIEmbedField {
|
||||
name: string;
|
||||
value: string;
|
||||
inline?: boolean;
|
||||
}
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/channel#attachment-object-attachment-structure
|
||||
*/
|
||||
export interface APIAttachment {
|
||||
id: string;
|
||||
filename: string;
|
||||
size: number;
|
||||
url: string;
|
||||
proxy_url: string;
|
||||
height: number | null;
|
||||
width: number | null;
|
||||
}
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/channel#channel-mention-object-channel-mention-structure
|
||||
*/
|
||||
export interface APIChannelMention {
|
||||
id: string;
|
||||
guild_id: string;
|
||||
type: ChannelType;
|
||||
name: string;
|
||||
}
|
||||
|
||||
export interface APIFollowedChannel {
|
||||
channel_id: string;
|
||||
webhook_id: string;
|
||||
}
|
||||
25
v6/payloads/emoji.ts
Normal file
25
v6/payloads/emoji.ts
Normal file
@@ -0,0 +1,25 @@
|
||||
/**
|
||||
* Types extracted from https://discord.com/developers/docs/resources/emoji
|
||||
*/
|
||||
|
||||
import type { APIUser } from './user';
|
||||
|
||||
/**
|
||||
* Not documented but mentioned
|
||||
*/
|
||||
export interface APIPartialEmoji {
|
||||
id: string | null;
|
||||
name: string | null;
|
||||
animated?: boolean;
|
||||
}
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/emoji#emoji-object-emoji-structure
|
||||
*/
|
||||
export interface APIEmoji extends APIPartialEmoji {
|
||||
roles?: string[];
|
||||
user?: APIUser;
|
||||
require_colons?: boolean;
|
||||
managed?: boolean;
|
||||
available?: boolean;
|
||||
}
|
||||
137
v6/payloads/gateway.ts
Normal file
137
v6/payloads/gateway.ts
Normal file
@@ -0,0 +1,137 @@
|
||||
/**
|
||||
* Types extracted from https://discord.com/developers/docs/topics/gateway
|
||||
*/
|
||||
|
||||
import type { APIEmoji } from './emoji';
|
||||
import type { APIUser } from './user';
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/topics/gateway#get-gateway
|
||||
*/
|
||||
export interface APIGatewayInfo {
|
||||
url: string;
|
||||
}
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/topics/gateway#get-gateway-bot
|
||||
*/
|
||||
export interface APIGatewayBotInfo extends APIGatewayInfo {
|
||||
shards: number;
|
||||
session_start_limit: APIGatewaySessionStartLimit;
|
||||
}
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/topics/gateway#session-start-limit-object
|
||||
*/
|
||||
export interface APIGatewaySessionStartLimit {
|
||||
total: number;
|
||||
remaining: number;
|
||||
reset_after: number;
|
||||
}
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/topics/gateway#presence-update-presence-update-event-fields
|
||||
*/
|
||||
export interface GatewayPresenceUpdate {
|
||||
user: Partial<APIUser> & {
|
||||
id: string;
|
||||
};
|
||||
roles?: string[];
|
||||
game?: GatewayActivity | null;
|
||||
guild_id?: string;
|
||||
status?: PresenceUpdateStatus;
|
||||
activities?: GatewayActivity[];
|
||||
client_status?: GatewayPresenceClientStatus;
|
||||
premium_since?: string | null;
|
||||
nick?: string | null;
|
||||
}
|
||||
|
||||
export enum PresenceUpdateStatus {
|
||||
Online = 'online',
|
||||
Idle = 'idle',
|
||||
DoNotDisturb = 'dnd',
|
||||
Invisible = 'invisible',
|
||||
Offline = 'offline'
|
||||
}
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/topics/gateway#client-status-object
|
||||
*/
|
||||
export type GatewayPresenceClientStatus = Partial<Record<
|
||||
'desktop' | 'mobile' | 'web',
|
||||
PresenceUpdateStatus
|
||||
>>;
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/topics/gateway#activity-object
|
||||
*/
|
||||
export interface GatewayActivity {
|
||||
name: string;
|
||||
type: ActivityType;
|
||||
url?: string | null;
|
||||
created_at: number;
|
||||
timestamps?: GatewayActivityTimestamps;
|
||||
application_id?: string;
|
||||
details?: string | null;
|
||||
state?: string | null;
|
||||
emoji?: GatewayActivityEmoji;
|
||||
party?: GatewayActivityParty;
|
||||
assets?: GatewayActivityAssets;
|
||||
secrets?: GatewayActivitySecrets;
|
||||
instance?: boolean;
|
||||
flags?: ActivityFlags;
|
||||
}
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/topics/gateway#activity-object-activity-types
|
||||
*/
|
||||
export enum ActivityType {
|
||||
Game,
|
||||
Streaming,
|
||||
Listening,
|
||||
|
||||
Custom = 4
|
||||
}
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/topics/gateway#activity-object-activity-timestamps
|
||||
*/
|
||||
export interface GatewayActivityTimestamps {
|
||||
start?: number;
|
||||
end?: number;
|
||||
}
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/topics/gateway#activity-object-activity-emoji
|
||||
*/
|
||||
export type GatewayActivityEmoji = Partial<Pick<APIEmoji, 'name' | 'animated'>> & Pick<APIEmoji, 'id'>;
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/topics/gateway#activity-object-activity-party
|
||||
*/
|
||||
export interface GatewayActivityParty {
|
||||
id?: string;
|
||||
size?: [currentSize: number, maxSize: number];
|
||||
}
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/topics/gateway#activity-object-activity-assets
|
||||
*/
|
||||
export type GatewayActivityAssets = Partial<Record<'large_image' | 'large_text' | 'small_image' | 'small_text', string>>;
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/topics/gateway#activity-object-activity-secrets
|
||||
*/
|
||||
export type GatewayActivitySecrets = Partial<Record<'join' | 'spectate' | 'match', string>>;
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/topics/gateway#activity-object-activity-flags
|
||||
*/
|
||||
export enum ActivityFlags {
|
||||
INSTANCE = 1 << 0,
|
||||
JOIN = 1 << 1,
|
||||
SPECTATE = 1 << 2,
|
||||
JOIN_REQUEST = 1 << 3,
|
||||
SYNC = 1 << 4,
|
||||
PLAY = 1 << 5,
|
||||
}
|
||||
265
v6/payloads/guild.ts
Normal file
265
v6/payloads/guild.ts
Normal file
@@ -0,0 +1,265 @@
|
||||
/**
|
||||
* Types extracted from https://discord.com/developers/docs/resources/guild
|
||||
*/
|
||||
|
||||
import type { APIChannel } from './channel';
|
||||
import type { APIEmoji } from './emoji';
|
||||
import type { GatewayPresenceUpdate } from './gateway';
|
||||
import type { APIRole } from './permissions';
|
||||
import type { APIUser } from './user';
|
||||
import type { GatewayVoiceState } from './voice';
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/guild#unavailable-guild-object
|
||||
*/
|
||||
export interface APIUnavailableGuild {
|
||||
id: string;
|
||||
unavailable: boolean;
|
||||
}
|
||||
|
||||
export interface APIPartialGuild extends Omit<APIUnavailableGuild, 'unavailable'>,
|
||||
Pick<APIGuild, 'welcome_screen'> {
|
||||
name: string;
|
||||
icon: string | null;
|
||||
splash: string | null;
|
||||
banner?: string | null;
|
||||
description?: string | null;
|
||||
features?: GuildFeature[];
|
||||
verification_level?: GuildVerificationLevel;
|
||||
vanity_url_code?: string | null;
|
||||
unavailable?: boolean;
|
||||
}
|
||||
|
||||
export interface APIGuild extends APIPartialGuild {
|
||||
discovery_splash: string | null;
|
||||
owner?: boolean;
|
||||
owner_id: string;
|
||||
/**
|
||||
* @deprecated Use `permissions_new` instead
|
||||
*/
|
||||
permissions?: number;
|
||||
permissions_new?: string;
|
||||
region: string;
|
||||
afk_channel_id: string | null;
|
||||
afk_timeout: number;
|
||||
/**
|
||||
* @deprecated Use `widget_enabled` instead
|
||||
*/
|
||||
embed_enabled?: boolean;
|
||||
/**
|
||||
* @deprecated Use `widget_channel_id` instead
|
||||
*/
|
||||
embed_channel_id?: string | null;
|
||||
verification_level: GuildVerificationLevel;
|
||||
default_message_notifications: GuildDefaultMessageNotifications;
|
||||
explicit_content_filter: GuildExplicitContentFilter;
|
||||
roles: APIRole[];
|
||||
emojis: APIEmoji[];
|
||||
features: GuildFeature[];
|
||||
mfa_level: GuildMFALevel;
|
||||
application_id: string | null;
|
||||
widget_enabled?: boolean;
|
||||
widget_channel_id?: string | null;
|
||||
system_channel_id: string | null;
|
||||
system_channel_flags: GuildSystemChannelFlags;
|
||||
rules_channel_id: string | null;
|
||||
joined_at?: string;
|
||||
large?: boolean;
|
||||
member_count?: number;
|
||||
voice_states?: Omit<GatewayVoiceState, 'guild_id'>[];
|
||||
members?: APIGuildMember[];
|
||||
channels?: APIChannel[];
|
||||
presences?: GatewayPresenceUpdate[];
|
||||
max_presences?: number | null;
|
||||
max_members?: number;
|
||||
vanity_url_code: string | null;
|
||||
description: string | null;
|
||||
banner: string | null;
|
||||
premium_tier: GuildPremiumTier;
|
||||
premium_subscription_count?: number;
|
||||
preferred_locale: string;
|
||||
public_updates_channel_id: string | null;
|
||||
max_video_channel_users?: number;
|
||||
/**
|
||||
* Returned by calling GET `/guilds/{guid.id}` with the query `with_counts` set to `true`
|
||||
*/
|
||||
approximate_member_count?: number;
|
||||
/**
|
||||
* Returned by calling GET `/guilds/{guid.id}` with the query `with_counts` set to `true`
|
||||
*/
|
||||
approximate_presence_count?: number;
|
||||
welcome_screen?: APIGuildWelcomeScreen;
|
||||
}
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/guild#guild-object-default-message-notification-level
|
||||
*/
|
||||
export enum GuildDefaultMessageNotifications {
|
||||
ALL_MESSAGES,
|
||||
ONLY_MENTIONS,
|
||||
}
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/guild#guild-object-explicit-content-filter-level
|
||||
*/
|
||||
export enum GuildExplicitContentFilter {
|
||||
DISABLED,
|
||||
MEMBERS_WITHOUT_ROLES,
|
||||
ALL_MEMBERS,
|
||||
}
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/guild#guild-object-mfa-level
|
||||
*/
|
||||
export enum GuildMFALevel {
|
||||
NONE,
|
||||
ELEVATED,
|
||||
}
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/guild#guild-object-verification-level
|
||||
*/
|
||||
export enum GuildVerificationLevel {
|
||||
NONE,
|
||||
LOW,
|
||||
MEDIUM,
|
||||
HIGH,
|
||||
VERY_HIGH,
|
||||
}
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/guild#guild-object-premium-tier
|
||||
*/
|
||||
export enum GuildPremiumTier {
|
||||
NONE,
|
||||
TIER_1,
|
||||
TIER_2,
|
||||
TIER_3,
|
||||
}
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/guild#guild-object-system-channel-flags
|
||||
*/
|
||||
export enum GuildSystemChannelFlags {
|
||||
SUPPRESS_JOIN_NOTIFICATIONS = 1 << 0,
|
||||
SUPPRESS_PREMIUM_SUBSCRIPTIONS = 1 << 1,
|
||||
}
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/guild#guild-object-guild-features
|
||||
*/
|
||||
export enum GuildFeature {
|
||||
INVITE_SPLASH = 'INVITE_SPLASH',
|
||||
VIP_REGIONS = 'VIP_REGIONS',
|
||||
VANITY_URL = 'VANITY_URL',
|
||||
VERIFIED = 'VERIFIED',
|
||||
PARTNERED = 'PARTNERED',
|
||||
COMMUNITY = 'COMMUNITY',
|
||||
COMMERCE = 'COMMERCE',
|
||||
NEWS = 'NEWS',
|
||||
DISCOVERABLE = 'DISCOVERABLE',
|
||||
FEATURABLE = 'FEATURABLE',
|
||||
ANIMATED_ICON = 'ANIMATED_ICON',
|
||||
BANNER = 'BANNER',
|
||||
WELCOME_SCREEN_ENABLED = 'WELCOME_SCREEN_ENABLED',
|
||||
}
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/guild#guild-preview-object
|
||||
*/
|
||||
export interface APIGuildPreview {
|
||||
id: string;
|
||||
name: string;
|
||||
icon: string | null;
|
||||
splash: string | null;
|
||||
discovery_splash: string | null;
|
||||
emojis: APIEmoji[];
|
||||
features: GuildFeature[];
|
||||
approximate_member_count: number;
|
||||
approximate_presence_count: number;
|
||||
}
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/guild#guild-widget-object
|
||||
*/
|
||||
export interface APIGuildWidget {
|
||||
enabled: boolean;
|
||||
channel_id: string | null;
|
||||
}
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/guild#guild-member-object
|
||||
*/
|
||||
export interface APIGuildMember {
|
||||
user?: APIUser;
|
||||
nick: string | null;
|
||||
roles: string[];
|
||||
joined_at: string;
|
||||
premium_since?: string | null;
|
||||
deaf: boolean;
|
||||
mute: boolean;
|
||||
}
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/guild#integration-object
|
||||
*/
|
||||
export interface APIGuildIntegration {
|
||||
id: string;
|
||||
name: string;
|
||||
type: string;
|
||||
enabled: boolean;
|
||||
syncing: boolean;
|
||||
role_id: string;
|
||||
enable_emoticons?: boolean;
|
||||
expire_behavior: IntegrationExpireBehavior;
|
||||
expire_grace_period: number;
|
||||
user: APIUser;
|
||||
account: APIIntegrationAccount;
|
||||
synced_at: string;
|
||||
}
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/guild#integration-object-integration-expire-behaviors
|
||||
*/
|
||||
export enum IntegrationExpireBehavior {
|
||||
RemoveRole,
|
||||
Kick
|
||||
}
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/guild#integration-account-object
|
||||
*/
|
||||
export interface APIIntegrationAccount {
|
||||
id: string;
|
||||
name: string;
|
||||
}
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/guild#ban-object
|
||||
*/
|
||||
export interface APIBan {
|
||||
reason: string | null;
|
||||
user: APIUser;
|
||||
}
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/guild#get-guild-widget-image-widget-style-options
|
||||
*/
|
||||
export enum GuildWidgetStyle {
|
||||
Shield = 'shield',
|
||||
Banner1 = 'banner1',
|
||||
Banner2 = 'banner2',
|
||||
Banner3 = 'banner3',
|
||||
Banner4 = 'banner4',
|
||||
}
|
||||
|
||||
export interface APIGuildWelcomeScreen {
|
||||
description: string | null;
|
||||
welcome_channels: APIGuildWelcomeScreenChannel[];
|
||||
}
|
||||
|
||||
export interface APIGuildWelcomeScreenChannel {
|
||||
channel_id: string;
|
||||
emoji_id: string | null;
|
||||
emoji_name: string | null;
|
||||
}
|
||||
13
v6/payloads/index.ts
Normal file
13
v6/payloads/index.ts
Normal file
@@ -0,0 +1,13 @@
|
||||
export * from './auditLog';
|
||||
export * from './channel';
|
||||
export * from './emoji';
|
||||
export * from './gateway';
|
||||
export * from './guild';
|
||||
export * from './invite';
|
||||
export * from './oauth2';
|
||||
export * from './permissions';
|
||||
export * from './teams';
|
||||
export * from './user';
|
||||
export * from './voice';
|
||||
export * from './webhook';
|
||||
|
||||
39
v6/payloads/invite.ts
Normal file
39
v6/payloads/invite.ts
Normal file
@@ -0,0 +1,39 @@
|
||||
/**
|
||||
* Types extracted from https://discord.com/developers/docs/resources/invite
|
||||
*/
|
||||
|
||||
import type { APIPartialChannel } from './channel';
|
||||
import type { APIPartialGuild } from './guild';
|
||||
import type { APIUser } from './user';
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/invite#invite-object
|
||||
*/
|
||||
export interface APIInvite {
|
||||
code: string;
|
||||
guild?: APIPartialGuild;
|
||||
channel?: Required<APIPartialChannel>;
|
||||
inviter?: APIUser;
|
||||
target_user?: APIUser;
|
||||
target_user_type?: InviteTargetUserType;
|
||||
approximate_presence_count?: number;
|
||||
approximate_member_count?: number;
|
||||
}
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/invite#invite-object-target-user-types
|
||||
*/
|
||||
export enum InviteTargetUserType {
|
||||
STREAM = 1,
|
||||
}
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/invite#invite-metadata-object
|
||||
*/
|
||||
export interface APIExtendedInvite extends APIInvite {
|
||||
uses: number;
|
||||
max_uses: number;
|
||||
max_age: number;
|
||||
temporary: boolean;
|
||||
created_at: string;
|
||||
}
|
||||
27
v6/payloads/oauth2.ts
Normal file
27
v6/payloads/oauth2.ts
Normal file
@@ -0,0 +1,27 @@
|
||||
/**
|
||||
* Types extracted from https://discord.com/developers/docs/topics/oauth2
|
||||
*/
|
||||
|
||||
import type { APITeam } from './teams';
|
||||
import type { APIUser } from './user';
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/topics/oauth2#get-current-application-information-response-structure
|
||||
*/
|
||||
export interface APIApplication {
|
||||
id: string;
|
||||
name: string;
|
||||
icon: string | null;
|
||||
description: string;
|
||||
rpc_origins?: string[];
|
||||
bot_public: boolean;
|
||||
bot_require_code_grant: boolean;
|
||||
owner: APIUser;
|
||||
summary: string;
|
||||
verify_key: string;
|
||||
team: APITeam | null;
|
||||
guild_id?: string;
|
||||
primary_sku_id?: string;
|
||||
slug?: string;
|
||||
cover_image?: string;
|
||||
}
|
||||
76
v6/payloads/permissions.ts
Normal file
76
v6/payloads/permissions.ts
Normal file
@@ -0,0 +1,76 @@
|
||||
/**
|
||||
* Types extracted from https://discord.com/developers/docs/topics/permissions
|
||||
*/
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/topics/permissions#permissions-bitwise-permission-flags
|
||||
*
|
||||
* These flags are exported as `BigInt`s and NOT numbers. For most of them, you can
|
||||
* convert them in a number by wrapping it in `Number()`, however be careful as any
|
||||
* futher bits added may cause issues if done so. Try to use BigInts as much as possible
|
||||
* or modules that can replicate them in some way.
|
||||
*/
|
||||
export const PermissionFlagsBits = {
|
||||
CREATE_INSTANT_INVITE: 1n,
|
||||
KICK_MEMBERS: 2n,
|
||||
BAN_MEMBERS: 4n,
|
||||
ADMINISTRATOR: 8n,
|
||||
MANAGE_CHANNELS: 16n,
|
||||
MANAGE_GUILD: 32n,
|
||||
ADD_REACTIONS: 64n,
|
||||
VIEW_AUDIT_LOG: 128n,
|
||||
PRIORITY_SPEAKER: 256n,
|
||||
STREAM: 512n,
|
||||
VIEW_CHANNEL: 1024n,
|
||||
SEND_MESSAGES: 2048n,
|
||||
SEND_TTS_MESSAGES: 4096n,
|
||||
MANAGE_MESSAGES: 8192n,
|
||||
EMBED_LINKS: 16384n,
|
||||
ATTACH_FILES: 32768n,
|
||||
READ_MESSAGE_HISTORY: 65536n,
|
||||
MENTION_EVERYONE: 131072n,
|
||||
USE_EXTERNAL_EMOJIS: 262144n,
|
||||
VIEW_GUILD_INSIGHTS: 524288n,
|
||||
CONNECT: 1048576n,
|
||||
SPEAK: 2097152n,
|
||||
MUTE_MEMBERS: 4194304n,
|
||||
DEAFEN_MEMBERS: 8388608n,
|
||||
MOVE_MEMBERS: 16777216n,
|
||||
USE_VAD: 33554432n,
|
||||
CHANGE_NICKNAME: 67108864n,
|
||||
MANAGE_NICKNAMES: 134217728n,
|
||||
MANAGE_ROLES: 268435456n,
|
||||
MANAGE_WEBHOOKS: 536870912n,
|
||||
MANAGE_EMOJIS: 1073741824n
|
||||
} as const;
|
||||
|
||||
/**
|
||||
* Freeze the object of bits, preventing any modifications to it.
|
||||
* @internal
|
||||
*/
|
||||
Object.freeze(PermissionFlagsBits);
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/topics/permissions#role-object
|
||||
*/
|
||||
export interface APIRole {
|
||||
id: string;
|
||||
name: string;
|
||||
color: number;
|
||||
hoist: boolean;
|
||||
position: number;
|
||||
/**
|
||||
* @deprecated Use `permissions_new` instead
|
||||
*/
|
||||
permissions: number;
|
||||
permissions_new: string;
|
||||
managed: boolean;
|
||||
mentionable: boolean;
|
||||
tags?: APIRoleTags;
|
||||
}
|
||||
|
||||
export interface APIRoleTags {
|
||||
bot_id?: string;
|
||||
premium_subscriber?: null;
|
||||
integration_id?: string;
|
||||
}
|
||||
33
v6/payloads/teams.ts
Normal file
33
v6/payloads/teams.ts
Normal file
@@ -0,0 +1,33 @@
|
||||
/**
|
||||
* Types extracted from https://discord.com/developers/docs/topics/teams
|
||||
*/
|
||||
|
||||
import type { APIUser } from './user';
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/topics/teams#data-models-team-object
|
||||
*/
|
||||
export interface APITeam {
|
||||
id: string;
|
||||
icon: string | null;
|
||||
members: APITeamMember[];
|
||||
owner_user_id: string;
|
||||
}
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/topics/teams#data-models-team-members-object
|
||||
*/
|
||||
export interface APITeamMember {
|
||||
membership_state: TeamMemberMembershipState;
|
||||
permissions: string[];
|
||||
team_id: string;
|
||||
user: APIUser;
|
||||
}
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/topics/teams#data-models-membership-state-enum
|
||||
*/
|
||||
export enum TeamMemberMembershipState {
|
||||
INVITED = 1,
|
||||
ACCEPTED
|
||||
}
|
||||
73
v6/payloads/user.ts
Normal file
73
v6/payloads/user.ts
Normal file
@@ -0,0 +1,73 @@
|
||||
/**
|
||||
* Types extracted from https://discord.com/developers/docs/resources/user
|
||||
*/
|
||||
|
||||
import type { APIGuildIntegration } from './guild';
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/user#user-object
|
||||
*/
|
||||
export interface APIUser {
|
||||
id: string;
|
||||
username: string;
|
||||
discriminator: string;
|
||||
avatar: string | null;
|
||||
bot?: boolean;
|
||||
system?: boolean;
|
||||
mfa_enabled?: boolean;
|
||||
locale?: string;
|
||||
verified?: boolean;
|
||||
email?: string | null;
|
||||
flags?: UserFlags;
|
||||
premium_type: UserPremiumType;
|
||||
public_flags?: UserFlags;
|
||||
}
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/user#user-object-user-flags
|
||||
*/
|
||||
export enum UserFlags {
|
||||
None = 0,
|
||||
DiscordEmployee = 1 << 0,
|
||||
DiscordPartner = 1 << 1,
|
||||
DiscordHypeSquadEvents = 1 << 2,
|
||||
BugHunterLevel1 = 1 << 3,
|
||||
HypeSquadHouseBravery = 1 << 6,
|
||||
HypeSquadHouseBrilliance = 1 << 7,
|
||||
HypeSquadHouseBalance = 1 << 8,
|
||||
EarlySupporter = 1 << 9,
|
||||
TeamUser = 1 << 10,
|
||||
System = 1 << 12,
|
||||
BugHunterLevel2 = 1 << 14,
|
||||
VerifiedBot = 1 << 16,
|
||||
VerifiedBotDeveloper = 1 << 17,
|
||||
}
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/user#user-object-premium-types
|
||||
*/
|
||||
export enum UserPremiumType {
|
||||
None,
|
||||
NitroClassic,
|
||||
Nitro,
|
||||
}
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/user#connection-object
|
||||
*/
|
||||
export interface APIConnection {
|
||||
id: string;
|
||||
name: string;
|
||||
type: string;
|
||||
revoked?: boolean;
|
||||
integrations?: Partial<APIGuildIntegration>[];
|
||||
verified: boolean;
|
||||
friend_sync: boolean;
|
||||
show_activity: boolean;
|
||||
visibility: ConnectionVisibility;
|
||||
}
|
||||
|
||||
export enum ConnectionVisibility {
|
||||
None,
|
||||
Everyone,
|
||||
}
|
||||
35
v6/payloads/voice.ts
Normal file
35
v6/payloads/voice.ts
Normal file
@@ -0,0 +1,35 @@
|
||||
/**
|
||||
* Types extracted from https://discord.com/developers/docs/resources/voice
|
||||
*/
|
||||
|
||||
import type { APIGuildMember } from './guild';
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/voice#voice-state-object
|
||||
*/
|
||||
export interface GatewayVoiceState {
|
||||
guild_id?: string;
|
||||
channel_id: string | null;
|
||||
user_id: string;
|
||||
member?: APIGuildMember;
|
||||
session_id: string;
|
||||
deaf: boolean;
|
||||
mute: boolean;
|
||||
self_deaf: boolean;
|
||||
self_mute: boolean;
|
||||
self_stream?: boolean;
|
||||
self_video: boolean;
|
||||
suppress: boolean;
|
||||
}
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/voice#voice-region-object
|
||||
*/
|
||||
export interface APIVoiceRegion {
|
||||
id: string;
|
||||
name: string;
|
||||
vip: boolean;
|
||||
optimal: boolean;
|
||||
deprecated: boolean;
|
||||
custom: boolean;
|
||||
}
|
||||
28
v6/payloads/webhook.ts
Normal file
28
v6/payloads/webhook.ts
Normal file
@@ -0,0 +1,28 @@
|
||||
/**
|
||||
* Types extracted from https://discord.com/developers/docs/resources/webhook
|
||||
*/
|
||||
|
||||
import type { APIPartialChannel } from './channel';
|
||||
import type { APIPartialGuild } from './guild';
|
||||
import type { APIUser } from './user';
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/webhook#webhook-object
|
||||
*/
|
||||
export interface APIWebhook {
|
||||
id: string;
|
||||
type: WebhookType;
|
||||
guild_id?: string;
|
||||
channel_id: string;
|
||||
user?: APIUser;
|
||||
name: string | null;
|
||||
avatar: string | null;
|
||||
token?: string;
|
||||
source_guild?: APIPartialGuild;
|
||||
source_channel?: APIPartialChannel;
|
||||
}
|
||||
|
||||
export enum WebhookType {
|
||||
Incoming = 1,
|
||||
ChannelFollower,
|
||||
}
|
||||
13
v6/rest/auditLog.ts
Normal file
13
v6/rest/auditLog.ts
Normal file
@@ -0,0 +1,13 @@
|
||||
import type { APIAuditLog, AuditLogEvent } from '../payloads/auditLog';
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/audit-log#get-guild-audit-log
|
||||
*/
|
||||
export interface RESTGetAPIAuditLogQuery {
|
||||
user_id?: string;
|
||||
action_type?: AuditLogEvent;
|
||||
before?: string;
|
||||
limit?: number;
|
||||
}
|
||||
|
||||
export type RESTGetAPIAuditLogResult = APIAuditLog;
|
||||
201
v6/rest/channel.ts
Normal file
201
v6/rest/channel.ts
Normal file
@@ -0,0 +1,201 @@
|
||||
import type { APIChannel, APIEmbed, APIFollowedChannel, APIInvite, APIMessage, APIOverwrite, APIUser, ChannelType, InviteTargetUserType, MessageFlags, OverwriteType } from '../payloads';
|
||||
|
||||
// #region TypeDefs
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/channel#overwrite-object-overwrite-structure
|
||||
*/
|
||||
export interface APIOverwriteSend {
|
||||
id: string;
|
||||
type: OverwriteType;
|
||||
allow: number | string;
|
||||
deny: number | string;
|
||||
}
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/channel#allowed-mentions-object-allowed-mention-types
|
||||
*/
|
||||
export enum AllowedMentionsTypes {
|
||||
Role = 'roles',
|
||||
User = 'users',
|
||||
Everyone = 'everyone'
|
||||
}
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/channel#allowed-mentions-object-allowed-mentions-structure
|
||||
*/
|
||||
export interface APIAllowedMentionsSend {
|
||||
parse?: AllowedMentionsTypes[];
|
||||
roles?: string[];
|
||||
users?: string[];
|
||||
}
|
||||
|
||||
// #endregion TypeDefs
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/channel#modify-channel
|
||||
*/
|
||||
export interface RESTPatchAPIChannelJSONBody {
|
||||
name?: string;
|
||||
type?: ChannelType.GUILD_NEWS | ChannelType.GUILD_TEXT;
|
||||
position?: number | null;
|
||||
topic?: string | null;
|
||||
nsfw?: boolean | null;
|
||||
rate_limit_per_user?: number | null;
|
||||
user_limit?: number | null;
|
||||
permission_overwrites?: APIOverwrite[] | null;
|
||||
parent_id?: string | null;
|
||||
}
|
||||
|
||||
export type RESTGetAPIChannelResult = APIChannel;
|
||||
export type RESTPatchAPIChannelResult = APIChannel;
|
||||
export type RESTDeleteAPIChannelResult = APIChannel;
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/channel#get-channel-messages
|
||||
*/
|
||||
export interface RESTGetAPIChannelMessagesQuery {
|
||||
around?: string;
|
||||
before?: string;
|
||||
after?: string;
|
||||
limit?: number;
|
||||
}
|
||||
|
||||
export type RESTGetAPIChannelMessagesResult = APIMessage[];
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/channel#create-message
|
||||
*/
|
||||
export interface RESTPostAPIChannelMessageJSONBody {
|
||||
content?: string;
|
||||
nonce?: number | string;
|
||||
tts?: boolean;
|
||||
embed?: APIEmbed;
|
||||
allowed_mentions?: APIAllowedMentionsSend;
|
||||
}
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/channel#create-message
|
||||
*/
|
||||
export type RESTPostAPIChannelMessageFormDataBody = {
|
||||
/**
|
||||
* JSON stringified message body
|
||||
*/
|
||||
payload_json?: string;
|
||||
/**
|
||||
* The file contents
|
||||
*/
|
||||
file: unknown;
|
||||
} | {
|
||||
content?: string;
|
||||
nonce?: number | string;
|
||||
tts?: boolean;
|
||||
embed?: APIEmbed;
|
||||
allowed_mentions?: APIAllowedMentionsSend;
|
||||
/**
|
||||
* The file contents
|
||||
*/
|
||||
file: unknown;
|
||||
};
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/channel#edit-message
|
||||
*/
|
||||
export interface RESTPatchAPIChannelMessageJSONBody {
|
||||
content?: string | null;
|
||||
embed?: APIEmbed | null;
|
||||
allowed_mentions?: APIAllowedMentionsSend | null;
|
||||
flags?: MessageFlags | null;
|
||||
}
|
||||
|
||||
export type RESTGetAPIChannelMessageResult = APIMessage;
|
||||
export type RESTPostAPIChannelMessageResult = APIMessage;
|
||||
export type RESTPatchAPIChannelMessageResult = APIMessage;
|
||||
export type RESTDeleteAPIChannelMessageResult = never;
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/channel#get-reactions
|
||||
*/
|
||||
export interface RESTGetAPIChannelMessageReactionsQuery {
|
||||
before?: string;
|
||||
after?: string;
|
||||
limit?: number;
|
||||
}
|
||||
|
||||
export type RESTGetAPIChannelMessageReactionsResult = APIUser[];
|
||||
|
||||
export type RESTPutAPIChannelMessageReactionResult = never;
|
||||
export type RESTDeleteAPIChannelMessageReactionResult = never;
|
||||
export type RESTDeleteAPIChannelAllMessageReactionsResult = never;
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/channel#bulk-delete-messages
|
||||
*/
|
||||
export interface RESTPostAPIChannelMessagesBulkDeleteJSONBody {
|
||||
messages: string[];
|
||||
}
|
||||
|
||||
export type RESTPostAPIChannelMessagesBulkDeleteResult = never;
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/channel#edit-channel-permissions
|
||||
*/
|
||||
export interface RESTPutAPIChannelPermissionsJSONBody {
|
||||
allow: number | string;
|
||||
deny: number | string;
|
||||
type: OverwriteType;
|
||||
}
|
||||
|
||||
export type RESTPutAPIChannelPermissionsResult = never;
|
||||
export type RESTDeleteAPIChannelPermissionsResult = never;
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/channel#get-channel-invites
|
||||
*/
|
||||
export type RESTGetAPIChannelInvitesResult = APIInvite[];
|
||||
|
||||
export interface RESTPostAPIChannelInviteJSONBody {
|
||||
max_age?: number;
|
||||
max_uses?: number;
|
||||
temporary?: boolean;
|
||||
unique?: boolean;
|
||||
target_user_id?: string;
|
||||
target_user_type?: InviteTargetUserType;
|
||||
}
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/channel#trigger-typing-indicator
|
||||
*/
|
||||
export type RESTPostAPIChannelTypingResult = never;
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/channel#get-pinned-messages
|
||||
*/
|
||||
export type RESTGetAPIChannelPinsResult = APIMessage[];
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/channel#add-pinned-channel-message
|
||||
*/
|
||||
export type RESTPutAPIChannelPinResult = never;
|
||||
export type RESTDeleteAPIChannelPinResult = never;
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/channel#group-dm-add-recipient
|
||||
*/
|
||||
export interface RESTPutAPIChannelRecipientJSONBody {
|
||||
access_token: string;
|
||||
nick?: string;
|
||||
}
|
||||
|
||||
export type RESTPutAPIChannelRecipientResult = unknown;
|
||||
export type RESTDeleteAPIChannelRecipientResult = unknown;
|
||||
|
||||
// TODO: Docs updated once https://github.com/discord/discord-api-docs/pull/1692/files is merged
|
||||
|
||||
export type RESTPostAPIChannelMessageCrosspostResult = APIMessage;
|
||||
|
||||
export interface RESTPostAPIChannelFollowersJSONBody {
|
||||
webhook_channel_id: string;
|
||||
}
|
||||
|
||||
export type RESTPostAPIChannelFollowersResult = APIFollowedChannel;
|
||||
40
v6/rest/emoji.ts
Normal file
40
v6/rest/emoji.ts
Normal file
@@ -0,0 +1,40 @@
|
||||
import type { APIEmoji } from '../payloads';
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/emoji#list-guild-emojis
|
||||
*/
|
||||
export type RESTGetAPIGuildEmojisResult = APIEmoji[];
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/emoji#get-guild-emoji
|
||||
*/
|
||||
export type RESTGetAPIGuildEmojiResult = APIEmoji;
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/emoji#create-guild-emoji-json-params
|
||||
*/
|
||||
export interface RESTPostAPIGuildEmojiJSONBody {
|
||||
name: string;
|
||||
/**
|
||||
* The image data, read more [here](https://discord.com/developers/docs/reference#image-data)
|
||||
*/
|
||||
image: string;
|
||||
roles?: string[];
|
||||
}
|
||||
|
||||
export type RESTPostAPIGuildEmojiResult = APIEmoji;
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/emoji#modify-guild-emoji
|
||||
*/
|
||||
export interface RESTPatchAPIGuildEmojiJSONBody {
|
||||
name?: string;
|
||||
roles?: string[] | null;
|
||||
}
|
||||
|
||||
export type RESTPatchAPIGuildEmojiResult = APIEmoji;
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/emoji#delete-guild-emoji
|
||||
*/
|
||||
export type RESTDeleteAPIGuildEmojiResult = never;
|
||||
11
v6/rest/gateway.ts
Normal file
11
v6/rest/gateway.ts
Normal file
@@ -0,0 +1,11 @@
|
||||
import type { APIGatewayBotInfo, APIGatewayInfo } from '../payloads';
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/topics/gateway#get-gateway
|
||||
*/
|
||||
export type RESTGetAPIGatewayResult = APIGatewayInfo;
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/topics/gateway#get-gateway-bot
|
||||
*/
|
||||
export type RESTGetAPIGatewayBotResult = APIGatewayBotInfo;
|
||||
348
v6/rest/guild.ts
Normal file
348
v6/rest/guild.ts
Normal file
@@ -0,0 +1,348 @@
|
||||
import type { APIBan, APIChannel, APIGuild, APIGuildIntegration, APIGuildMember, APIGuildPreview, APIGuildWidget, APIInvite, APIRole, APIVoiceRegion, GuildDefaultMessageNotifications, GuildExplicitContentFilter, GuildFeature, GuildVerificationLevel, GuildWidgetStyle, IntegrationExpireBehavior } from '../payloads';
|
||||
|
||||
export type APIGuildCreatePartialChannel = Partial<Pick<APIChannel, 'type' | 'permission_overwrites' | 'topic' | 'nsfw' | 'bitrate' | 'user_limit' | 'rate_limit_per_user' | 'parent_id'>> & Required<Pick<APIChannel, 'name'>>;
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/guild#create-guild
|
||||
*/
|
||||
export interface RESTPostAPIGuildsJSONBody {
|
||||
name: string;
|
||||
region?: string;
|
||||
icon?: string;
|
||||
verification_level?: GuildVerificationLevel;
|
||||
default_message_notifications?: GuildDefaultMessageNotifications;
|
||||
explicit_content_filter?: GuildExplicitContentFilter;
|
||||
roles?: APIRole[];
|
||||
channels?: APIGuildCreatePartialChannel[];
|
||||
afk_channel_id?: string;
|
||||
afk_timeout?: number;
|
||||
system_channel_id?: string;
|
||||
}
|
||||
|
||||
export type RESTPostAPIGuildsResult = APIGuild;
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/guild#get-guild
|
||||
*/
|
||||
export interface RESTGetAPIGuildQuery {
|
||||
with_counts?: boolean;
|
||||
}
|
||||
|
||||
export type RESTGetAPIGuildResult = APIGuild;
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/guild#get-guild-preview
|
||||
*/
|
||||
export type RESTGetAPIGuildPreviewResult = APIGuildPreview;
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/guild#modify-guild
|
||||
*/
|
||||
export interface RESTPatchAPIGuildJSONBody {
|
||||
name?: string;
|
||||
region?: string;
|
||||
verification_level?: GuildVerificationLevel;
|
||||
default_message_notifications?: GuildDefaultMessageNotifications;
|
||||
explicit_content_filter?: GuildExplicitContentFilter;
|
||||
afk_channel_id?: string | null;
|
||||
afk_timeout?: number;
|
||||
icon?: string | null;
|
||||
owner_id?: string;
|
||||
splash?: string | null;
|
||||
discovery_splash?: string | null;
|
||||
banner?: string | null;
|
||||
system_channel_id?: string | null;
|
||||
rules_channel_id?: string | null;
|
||||
public_updates_channel_id?: string | null;
|
||||
preferred_locale?: string;
|
||||
features?: GuildFeature[];
|
||||
description?: string | null;
|
||||
}
|
||||
|
||||
export type RESTPatchAPIGuildResult = APIGuild;
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/guild#delete-guild
|
||||
*/
|
||||
export type RESTDeleteAPIGuildResult = never;
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/guild#get-guild-channels
|
||||
*/
|
||||
export type RESTGetAPIGuildChannelsResult = APIChannel[];
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/guild#create-guild-channel
|
||||
*/
|
||||
export type RESTPostAPIGuildChannelJSONBody = APIGuildCreatePartialChannel;
|
||||
|
||||
export type RESTPostAPIGuildChannelResult = APIChannel;
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/guild#modify-guild-channel-positions
|
||||
*/
|
||||
export type RESTPatchAPIGuildChannelPositionsJSONBody = Array<{
|
||||
id: string;
|
||||
position: number;
|
||||
lock_permissions?: boolean;
|
||||
parent_id?: string | null;
|
||||
}>;
|
||||
|
||||
export type RESTPatchAPIGuildChannelPositionsResult = never;
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/guild#get-guild-member
|
||||
*/
|
||||
export type RESTGetAPIGuildMemberResult = APIGuildMember;
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/guild#list-guild-members
|
||||
*/
|
||||
export interface RESTGetAPIGuildMembersQuery {
|
||||
limit?: number;
|
||||
after?: string;
|
||||
}
|
||||
|
||||
export type RESTGetAPIGuildMembersResult = APIGuildMember[];
|
||||
|
||||
export interface RESTGetAPIGuildMembersSearchQuery {
|
||||
query: string;
|
||||
limit?: number;
|
||||
}
|
||||
|
||||
export type RESTGetAPIGuildMembersSearchResult = APIGuildMember[];
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/guild#add-guild-member
|
||||
*/
|
||||
export interface RESTPutAPIGuildMemberJSONBody {
|
||||
access_token: string;
|
||||
nick?: string;
|
||||
roles?: string[];
|
||||
mute?: boolean;
|
||||
deaf?: boolean;
|
||||
}
|
||||
|
||||
export type RESTPutAPIGuildMemberResult = APIGuildMember | undefined;
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/guild#modify-guild-member
|
||||
*/
|
||||
export interface RESTPatchAPIGuildMemberJSONBody {
|
||||
nick?: string | null;
|
||||
roles?: string[] | null;
|
||||
mute?: boolean | null;
|
||||
deaf?: boolean | null;
|
||||
channel_id?: string | null;
|
||||
}
|
||||
|
||||
export type RESTPatchAPIGuildMemberResult = never;
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/guild#modify-current-user-nick
|
||||
*/
|
||||
export interface RESTPatchAPICurrentGuildMemberNicknameJSONBody {
|
||||
nick?: string | null;
|
||||
}
|
||||
|
||||
export type RESTPatchAPICurrentGuildMemberNicknameResult = Required<RESTPatchAPICurrentGuildMemberNicknameJSONBody>;
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/guild#add-guild-member-role
|
||||
*/
|
||||
export type RESTPutAPIGuildMemberRoleResult = never;
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/guild#remove-guild-member-role
|
||||
*/
|
||||
export type RESTDeleteAPIGuildMemberRoleResult = never;
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/guild#remove-guild-member
|
||||
*/
|
||||
export type RESTDeleteAPIGuildMemberResult = never;
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/guild#get-guild-bans
|
||||
*/
|
||||
export type RESTGetAPIGuildBansResult = APIBan[];
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/guild#get-guild-ban
|
||||
*/
|
||||
export type RESTGetAPIGuildBanResult = APIBan;
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/guild#create-guild-ban
|
||||
*/
|
||||
export interface RESTPutAPIGuildBanJSONBody {
|
||||
delete_message_days?: number;
|
||||
reason?: string;
|
||||
}
|
||||
|
||||
export type RESTPutAPIGuildBanResult = never;
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/guild#remove-guild-ban
|
||||
*/
|
||||
export type RESTDeleteAPIGuildBanResult = never;
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/guild#get-guild-roles
|
||||
*/
|
||||
export type RESTGetAPIGuildRolesResult = APIRole[];
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/guild#create-guild-role
|
||||
*/
|
||||
export interface RESTPostAPIGuildRoleJSONBody {
|
||||
name?: string | null;
|
||||
permissions?: number | string | null;
|
||||
color?: number | null;
|
||||
hoist?: boolean | null;
|
||||
mentionable?: boolean | null;
|
||||
}
|
||||
|
||||
export type RESTPostAPIGuildRoleResult = APIRole;
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/guild#modify-guild-role-positions
|
||||
*/
|
||||
export type RESTPatchAPIGuildRolePositionsJSONBody = Array<{
|
||||
id: string;
|
||||
position?: number;
|
||||
}>;
|
||||
|
||||
export type RESTPatchAPIGuildRolePositionsResult = APIRole[];
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/guild#modify-guild-role
|
||||
*/
|
||||
export interface RESTPatchAPIGuildRoleJSONBody {
|
||||
name?: string;
|
||||
permissions?: number | string;
|
||||
color?: number;
|
||||
hoist?: boolean;
|
||||
mentionable?: boolean;
|
||||
}
|
||||
|
||||
export type RESTPatchAPIGuildRoleResult = APIRole;
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/guild#delete-guild-role
|
||||
*/
|
||||
export type RESTDeleteAPIGuildRoleResult = never;
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/guild#get-guild-prune-count
|
||||
*/
|
||||
export interface RESTGetAPIGuildPruneCountQuery {
|
||||
days?: number;
|
||||
/**
|
||||
* While this is typed as a string, it represents an array of
|
||||
* role IDs delimited by commas.
|
||||
*
|
||||
* @see https://discord.com/developers/docs/resources/guild#get-guild-prune-count-query-string-params
|
||||
*/
|
||||
include_roles?: string;
|
||||
}
|
||||
|
||||
export interface RESTGetAPIGuildPruneCountResult {
|
||||
pruned: number;
|
||||
}
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/guild#begin-guild-prune
|
||||
*/
|
||||
export interface RESTPostAPIGuildPruneJSONBody {
|
||||
days?: number;
|
||||
compute_prune_count?: boolean;
|
||||
include_roles?: string[];
|
||||
}
|
||||
|
||||
export interface RESTPostAPIGuildPruneResult {
|
||||
pruned: number | null;
|
||||
}
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/guild#get-guild-voice-regions
|
||||
*/
|
||||
export type RESTGetAPIGuildVoiceRegionsResult = APIVoiceRegion[];
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/guild#get-guild-invites
|
||||
*/
|
||||
export type RESTGetAPIGuildInvitesResult = APIInvite[];
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/guild#get-guild-integrations
|
||||
*/
|
||||
export interface RESTGetAPIGuildIntegrationsQuery {
|
||||
include_applications?: boolean;
|
||||
}
|
||||
|
||||
export type RESTGetAPIGuildIntegrationsResult = APIGuildIntegration[];
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/guild#create-guild-integration
|
||||
*/
|
||||
export interface RESTPostAPIGuildIntegrationJSONBody {
|
||||
type: string;
|
||||
id: string;
|
||||
}
|
||||
|
||||
export type RESTPostAPIGuildIntegrationResult = never;
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/guild#modify-guild-integration
|
||||
*/
|
||||
export interface RESTPatchAPIGuildIntegrationJSONBody {
|
||||
expire_behavior?: IntegrationExpireBehavior | null;
|
||||
expire_grace_period?: number | null;
|
||||
enable_emoticons?: boolean | null;
|
||||
}
|
||||
|
||||
export type RESTPatchAPIGuildIntegrationResult = never;
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/guild#delete-guild-integration
|
||||
*/
|
||||
export type RESTDeleteAPIGuildIntegrationResult = never;
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/guild#sync-guild-integration
|
||||
*/
|
||||
export type RESTPostAPIGuildIntegrationSyncResult = never;
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/guild#get-guild-widget
|
||||
*/
|
||||
export type RESTGetAPIGuildWidgetResult = APIGuildWidget;
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/guild#modify-guild-widget
|
||||
*/
|
||||
export type RESTPatchAPIGuildWidgetJSONBody = Partial<APIGuildWidget>;
|
||||
|
||||
export type RESTPatchAPIGuildWidgetResult = APIGuildWidget;
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/guild#get-guild-vanity-url
|
||||
*/
|
||||
export interface RESTGetAPIGuildVanityUrlResult {
|
||||
code: string | null;
|
||||
uses: number;
|
||||
}
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/guild#get-guild-widget-image
|
||||
*/
|
||||
export interface RESTGetAPIGuildWidgetImageQuery {
|
||||
style?: GuildWidgetStyle;
|
||||
}
|
||||
|
||||
/**
|
||||
* Note: while the return type is `ArrayBuffer`, the expected result is
|
||||
* a buffer of sorts (depends if in browser or on node.js/deno).
|
||||
*/
|
||||
export type RESTGetAPIGuildWidgetImageResult = ArrayBuffer;
|
||||
505
v6/rest/index.ts
Normal file
505
v6/rest/index.ts
Normal file
@@ -0,0 +1,505 @@
|
||||
export * from './auditLog';
|
||||
export * from './channel';
|
||||
export * from './emoji';
|
||||
export * from './gateway';
|
||||
export * from './guild';
|
||||
export * from './invite';
|
||||
export * from './oauth2';
|
||||
export * from './user';
|
||||
export * from './voice';
|
||||
export * from './webhook';
|
||||
|
||||
export const APIVersion = '6';
|
||||
export const Routes = {
|
||||
/**
|
||||
* Route for:
|
||||
* - GET `/guilds/{guild.id}/audit-logs`
|
||||
*/
|
||||
guildAuditLog(guildID: string) {
|
||||
return `/guilds/${guildID}/audit-logs`;
|
||||
},
|
||||
|
||||
/**
|
||||
* Route for:
|
||||
* - GET `/channels/{channel.id}`
|
||||
* - PATCH `/channels/{channel.id}`
|
||||
* - DELETE `/channels/{channel.id}`
|
||||
*/
|
||||
channel(channelID: string) {
|
||||
return `/channels/${channelID}`;
|
||||
},
|
||||
|
||||
/**
|
||||
* Route for:
|
||||
* - GET `/channels/{channel.id}/messages`
|
||||
* - POST `/channels/{channel.id}/messages`
|
||||
*/
|
||||
channelMessages(channelID: string) {
|
||||
return `/channels/${channelID}/messages`;
|
||||
},
|
||||
|
||||
/**
|
||||
* Route for:
|
||||
* - GET `/channels/{channel.id}/messages/{message.id}`
|
||||
* - PATCH `/channels/{channel.id}/messages/{message.id}`
|
||||
* - DELETE `/channels/{channel.id}/messages/{message.id}`
|
||||
*/
|
||||
channelMessage(channelID: string, messageID: string) {
|
||||
return `/channels/${channelID}/messages/${messageID}`;
|
||||
},
|
||||
|
||||
/**
|
||||
* Route for:
|
||||
* - POST `/channels/{channel.id}/messages/{message.id}/crosspost`
|
||||
*/
|
||||
channelCrosspost(channelID: string, messageID: string) {
|
||||
return `/channels/${channelID}/message/${messageID}/crosspost`;
|
||||
},
|
||||
|
||||
/**
|
||||
* Route for:
|
||||
* - PUT `/channels/{channel.id}/messages/{message.id}/reactions/{emoji}/@me`
|
||||
* - DELETE `/channels/{channel.id}/messages/{message.id}/reactions/{emoji}/@me`
|
||||
*
|
||||
* **Note**: You need to URL encode the emoji yourself.
|
||||
*/
|
||||
channelMessageOwnReaction(channelID: string, messageID: string, emoji: string) {
|
||||
return `/channels/${channelID}/messages/${messageID}/reactions/${emoji}/@me`;
|
||||
},
|
||||
|
||||
/**
|
||||
* Route for:
|
||||
* - DELETE `/channels/{channel.id}/messages/{message.id}/reactions/{emoji}/{user.id}`
|
||||
*
|
||||
* **Note**: You need to URL encode the emoji yourself.
|
||||
*/
|
||||
channelMessageUserReaction(channelID: string, messageID: string, emoji: string, userID: string) {
|
||||
return `/channels/${channelID}/messages/${messageID}/reactions/${emoji}/${userID}`;
|
||||
},
|
||||
|
||||
/**
|
||||
* Route for:
|
||||
* - GET `/channels/{channel.id}/messages/{message.id}/reactions/{emoji}`
|
||||
* - DELETE `/channels/{channel.id}/messages/{message.id}/reactions/{emoji}`
|
||||
*
|
||||
* **Note**: You need to URL encode the emoji yourself.
|
||||
*/
|
||||
channelMessageSpecificReaction(channelID: string, messageID: string, emoji: string) {
|
||||
return `/channels/${channelID}/messages/${messageID}/reactions/${emoji}`;
|
||||
},
|
||||
|
||||
/**
|
||||
* Route for:
|
||||
* - DELETE `/channels/{channel.id}/messages/{message.id}/reactions`
|
||||
*/
|
||||
channelMessageAllReactions(channelID: string, messageID: string) {
|
||||
return `/channels/${channelID}/messages/${messageID}`;
|
||||
},
|
||||
|
||||
/**
|
||||
* Route for:
|
||||
* - POST `/channels/{channel.id}/messages/bulk-delete`
|
||||
*/
|
||||
channelBulkDelete(channelID: string) {
|
||||
return `/channels/${channelID}/bulk-delete`;
|
||||
},
|
||||
|
||||
/**
|
||||
* Route for:
|
||||
* - PUT `/channels/{channel.id}/permissions/{overwrite.id}`
|
||||
* - DELETE `/channels/{channel.id}/permissions/{overwrite.id}`
|
||||
*/
|
||||
channelPermissions(channelID: string, overwriteID: string) {
|
||||
return `/channels/${channelID}/permissions/${overwriteID}`;
|
||||
},
|
||||
|
||||
/**
|
||||
* Route for:
|
||||
* - GET `/channels/{channel.id}/invites`
|
||||
* - POST `/channels/{channel.id}/invites`
|
||||
*/
|
||||
channelInvite(channelID: string) {
|
||||
return `/channels/${channelID}`;
|
||||
},
|
||||
|
||||
/**
|
||||
* Route for:
|
||||
* - POST `/channels/{channel.id}/followers`
|
||||
*/
|
||||
channelFollowers(channelID: string) {
|
||||
return `/channels/${channelID}/followers`;
|
||||
},
|
||||
|
||||
/**
|
||||
* Route for:
|
||||
* - POST `/channels/{channel.id}/typing`
|
||||
*/
|
||||
channelTyping(channelID: string) {
|
||||
return `/channels/${channelID}/typing`;
|
||||
},
|
||||
|
||||
/**
|
||||
* Route for:
|
||||
* - GET `/channels/{channel.id}/pins`
|
||||
*/
|
||||
channelPins(channelID: string) {
|
||||
return `/channels/${channelID}/pins`;
|
||||
},
|
||||
|
||||
/**
|
||||
* Route for:
|
||||
* - PUT `/channels/{channel.id}/pins/{message.id}`
|
||||
* - DELETE `/channels/{channel.id}/pins/{message.id}`
|
||||
*/
|
||||
channelPin(channelID: string, messageID: string) {
|
||||
return `/channels/${channelID}/pins/${messageID}`;
|
||||
},
|
||||
|
||||
/**
|
||||
* Route for:
|
||||
* - PUT `/channels/{channel.id}/recipients/{user.id}`
|
||||
* - DELETE `/channels/{channel.id}/recipients/{user.id}`
|
||||
*/
|
||||
channelRecipient(channelID: string, userID: string) {
|
||||
return `/channels/${channelID}/recipients/${userID}`;
|
||||
},
|
||||
|
||||
/**
|
||||
* Route for:
|
||||
* - GET `/guilds/{guild.id}/emojis`
|
||||
* - POST `/guilds/{guild.id}/emojis`
|
||||
*/
|
||||
guildEmojis(guildID: string) {
|
||||
return `/guilds/${guildID}/emojis`;
|
||||
},
|
||||
|
||||
/**
|
||||
* Route for:
|
||||
* - GET `/guilds/{guild.id}/emojis/{emoji.id}`
|
||||
* - PATCH `/guilds/{guild.id}/emojis/{emoji.id}`
|
||||
* - DELETE `/guilds/{guild.id}/emojis/{emoji.id}`
|
||||
*/
|
||||
guildEmoji(guildID: string, emojiID: string) {
|
||||
return `/guilds/${guildID}/emojis/${emojiID}`;
|
||||
},
|
||||
|
||||
/**
|
||||
* Route for:
|
||||
* - POST `/guilds`
|
||||
*/
|
||||
guilds() {
|
||||
return '/guilds';
|
||||
},
|
||||
|
||||
/**
|
||||
* Route for:
|
||||
* - GET `/guilds/{guild.id}`
|
||||
* - PATCH `/guilds/{guild.id}`
|
||||
* - DELETE `/guilds/{guild.id}`
|
||||
*/
|
||||
guild(guildID: string) {
|
||||
return `/guilds/${guildID}`;
|
||||
},
|
||||
|
||||
/**
|
||||
* Route for:
|
||||
* - GET `/guilds/{guild.id}/preview`
|
||||
*/
|
||||
guildPreview(guildID: string) {
|
||||
return `/guilds/${guildID}/preview`;
|
||||
},
|
||||
|
||||
/**
|
||||
* Route for:
|
||||
* - GET `/guilds/{guild.id}/channels`
|
||||
* - POST `/guilds/{guild.id}/channels`
|
||||
* - PATCH `/guilds/{guild.id}/channels`
|
||||
*/
|
||||
guildChannels(guildID: string) {
|
||||
return `/guilds/${guildID}/channels`;
|
||||
},
|
||||
|
||||
/**
|
||||
* Route for:
|
||||
* - GET `/guilds/{guild.id}/members/{user.id}`
|
||||
* - PUT `/guilds/{guild.id}/members/{user.id}`
|
||||
* - PATCH `/guilds/{guild.id}/members/{user.id}`
|
||||
* - DELETE `/guilds/{guild.id}/members/{user.id}`
|
||||
*/
|
||||
guildMember(guildID: string, userID: string) {
|
||||
return `/guilds/${guildID}/members/${userID}`;
|
||||
},
|
||||
|
||||
/**
|
||||
* Route for:
|
||||
* - GET `/guilds/{guild.id}/members`
|
||||
*/
|
||||
guildMembers(guildID: string) {
|
||||
return `/guilds/${guildID}/members`;
|
||||
},
|
||||
|
||||
/**
|
||||
* Route for:
|
||||
* - GET `/guilds/{guild.id}/members/search`
|
||||
*/
|
||||
guildMembersSearch(guildID: string) {
|
||||
return `/guilds/${guildID}/members/search`;
|
||||
},
|
||||
|
||||
/**
|
||||
* Route for:
|
||||
* - PATCH `/guilds/{guild.id}/members/@me/nick`
|
||||
*/
|
||||
guildCurrentMemberNickname(guildID: string) {
|
||||
return `/guilds/${guildID}/members/@me/nick`;
|
||||
},
|
||||
|
||||
/**
|
||||
* Route for:
|
||||
* - PUT `/guilds/{guild.id}/members/{user.id}/roles/{role.id}`
|
||||
* - DELETE `/guilds/{guild.id}/members/{user.id}/roles/{role.id}`
|
||||
*/
|
||||
guildMemberRole(guildID: string, memberID: string, roleID: string) {
|
||||
return `/guilds/${guildID}/members/${memberID}/roles/${roleID}`;
|
||||
},
|
||||
|
||||
/**
|
||||
* Route for:
|
||||
* - GET `/guilds/{guild.id}/bans`
|
||||
*/
|
||||
guildBans(guildID: string) {
|
||||
return `/guilds/${guildID}/bans`;
|
||||
},
|
||||
|
||||
/**
|
||||
* Route for:
|
||||
* - GET `/guilds/{guild.id}/bans/{user.id}`
|
||||
* - PUT `/guilds/{guild.id}/bans/{user.id}`
|
||||
* - DELETE `/guilds/{guild.id}/bans/{user.id}`
|
||||
*/
|
||||
guildBan(guildID: string, userID: string) {
|
||||
return `/guilds/${guildID}/bans/${userID}`;
|
||||
},
|
||||
|
||||
/**
|
||||
* Route for:
|
||||
* - GET `/guilds/{guild.id}/roles`
|
||||
* - POST `/guilds/{guild.id}/roles`
|
||||
* - PATCH `/guilds/{guild.id}/roles`
|
||||
*/
|
||||
guildRoles(guildID: string) {
|
||||
return `/guilds/${guildID}/roles`;
|
||||
},
|
||||
|
||||
/**
|
||||
* Route for:
|
||||
* - PATCH `/guilds/{guild.id}/roles/{role.id}`
|
||||
* - DELETE `/guilds/{guild.id}/roles/{role.id}`
|
||||
*/
|
||||
guildRole(guildID: string, roleID: string) {
|
||||
return `/guilds/${guildID}/roles/${roleID}`;
|
||||
},
|
||||
|
||||
/**
|
||||
* Route for:
|
||||
* - GET `/guilds/{guild.id}/prune`
|
||||
* - POST `/guilds/{guild.id}/prune`
|
||||
*/
|
||||
guildPrune(guildID: string) {
|
||||
return `/guilds/${guildID}/prune`;
|
||||
},
|
||||
|
||||
/**
|
||||
* Route for:
|
||||
* - GET `/guilds/{guild.id}/regions`
|
||||
*/
|
||||
guildVoiceRegions(guildID: string) {
|
||||
return `/guilds/${guildID}/regions`;
|
||||
},
|
||||
|
||||
/**
|
||||
* Route for:
|
||||
* - GET `/guilds/{guild.id}/invites`
|
||||
*/
|
||||
guildInvites(guildID: string) {
|
||||
return `/guilds/${guildID}/invites`;
|
||||
},
|
||||
|
||||
/**
|
||||
* Route for:
|
||||
* - GET `/guilds/{guild.id}/integrations`
|
||||
* - POST `/guilds/{guild.id}/integrations`
|
||||
*/
|
||||
guildIntegrations(guildID: string) {
|
||||
return `/guilds/${guildID}/integrations`;
|
||||
},
|
||||
|
||||
/**
|
||||
* Route for:
|
||||
* - PATCH `/guilds/{guild.id}/integrations/{integration.id}`
|
||||
* - DELETE `/guilds/{guild.id}/integrations/{integration.id}`
|
||||
*/
|
||||
guildIntegration(guildID: string, integrationID: string) {
|
||||
return `/guilds/${guildID}/integrations/${integrationID}`;
|
||||
},
|
||||
|
||||
/**
|
||||
* Route for:
|
||||
* - POST `/guilds/{guild.id}/integrations/{integration.id}/sync`
|
||||
*/
|
||||
guildIntegrationSync(guildID: string, integrationID: string) {
|
||||
return `/guilds/${guildID}/integrations/${integrationID}/sync`;
|
||||
},
|
||||
|
||||
/**
|
||||
* Route for:
|
||||
* - GET `/guilds/{guild.id}/widget`
|
||||
* - PATCH `/guilds/{guild.id}/widget`
|
||||
*/
|
||||
guildWidget(guildID: string) {
|
||||
return `/guilds/${guildID}/widget`;
|
||||
},
|
||||
|
||||
/**
|
||||
* Route for:
|
||||
* - GET `/guilds/{guild.id}/vanity-url`
|
||||
*/
|
||||
guildVanityUrl(guildID: string) {
|
||||
return `/guilds/${guildID}/vanity-url`;
|
||||
},
|
||||
|
||||
/**
|
||||
* Route for:
|
||||
* - GET `/guilds/{guild.id}/widget.png`
|
||||
*/
|
||||
guildWidgetImage(guildID: string) {
|
||||
return `/guilds/${guildID}/widget.png`;
|
||||
},
|
||||
|
||||
/**
|
||||
* Route for:
|
||||
* - GET `/invites/{invite.code}`
|
||||
* - DELETE `/invites/{invite.code}`
|
||||
*/
|
||||
invite(code: string) {
|
||||
return `/invites/${code}`;
|
||||
},
|
||||
|
||||
/**
|
||||
* Route for:
|
||||
* - GET `/users/@me`
|
||||
* - GET `/users/{user.id}`
|
||||
* - PATCH `/users/@me`
|
||||
*/
|
||||
user(userID = '@me') {
|
||||
return `/users/${userID}`;
|
||||
},
|
||||
|
||||
/**
|
||||
* Route for:
|
||||
* - GET `/users/@me/guilds`
|
||||
*/
|
||||
userGuilds() {
|
||||
return `/users/@me/guilds`;
|
||||
},
|
||||
|
||||
/**
|
||||
* Route for:
|
||||
* - DELETE `/users/@me/guilds/{guild.id}`
|
||||
*/
|
||||
userGuild(guildID: string) {
|
||||
return `/users/@me/guilds/${guildID}`;
|
||||
},
|
||||
|
||||
/**
|
||||
* Route for:
|
||||
* - POST `/users/@me/channels`
|
||||
*/
|
||||
userChannels() {
|
||||
return `/users/@me/channels`;
|
||||
},
|
||||
|
||||
/**
|
||||
* Route for:
|
||||
* - GET `/users/@me/connections`
|
||||
*/
|
||||
userConnections() {
|
||||
return `/users/@me/connections`;
|
||||
},
|
||||
|
||||
/**
|
||||
* Route for:
|
||||
* - GET `/voice/regions`
|
||||
*/
|
||||
voiceRegions() {
|
||||
return `/voice/regions`;
|
||||
},
|
||||
|
||||
/**
|
||||
* Route for:
|
||||
* - POST `/channels/{channel.id}/webhooks`
|
||||
* - GET `/channels/{channel.id}/webhooks`
|
||||
*/
|
||||
channelWebhook(channelID: string) {
|
||||
return `/channels/${channelID}/webhooks`;
|
||||
},
|
||||
|
||||
/**
|
||||
* Route for:
|
||||
* - GET `/guilds/{guild.id}/webhooks`
|
||||
*/
|
||||
guildWebhooks(guildID: string) {
|
||||
return `/guilds/${guildID}/webhooks`;
|
||||
},
|
||||
|
||||
/**
|
||||
* Route for:
|
||||
* - GET `/webhooks/{webhook.id}`
|
||||
* - GET `/webhooks/{webhook.id}/{webhook.token}`
|
||||
* - PATCH `/webhooks/{webhook.id}`
|
||||
* - PATCH `/webhooks/{webhook.id}/{webhook.token}`
|
||||
* - DELETE `/webhooks/{webhook.id}`
|
||||
* - DELETE `/webhooks/{webhook.id}/{webhook.token}`
|
||||
* - POST `/webhooks/{webhook.id}/{webhook.token}`
|
||||
*/
|
||||
webhook(webhookID: string, webhookToken?: string) {
|
||||
const parts = ['', 'webhooks', webhookID];
|
||||
|
||||
if (webhookToken) parts.push(webhookToken);
|
||||
|
||||
return parts.join('/');
|
||||
},
|
||||
|
||||
/**
|
||||
* Route for:
|
||||
* - POST `/webhooks/{webhook.id}/{webhook.token}/slack`
|
||||
* - POST `/webhooks/{webhook.id}/{webhook.token}/github`
|
||||
*/
|
||||
webhookPlatform(webhookID: string, webhookToken: string, platform: 'github' | 'slack') {
|
||||
return `/${webhookID}/${webhookToken}/${platform}`;
|
||||
},
|
||||
|
||||
/**
|
||||
* Route for:
|
||||
* - GET `/gateway`
|
||||
*/
|
||||
gateway() {
|
||||
return `/gateway`;
|
||||
},
|
||||
|
||||
/**
|
||||
* Route for:
|
||||
* - GET `/gateway/bot`
|
||||
*/
|
||||
gatewayBot() {
|
||||
return `/gateway/bot`;
|
||||
},
|
||||
|
||||
/**
|
||||
* Route for:
|
||||
* - GET `/oauth2/applications/@me`
|
||||
*/
|
||||
oauth2CurrentApplication() {
|
||||
return `/oauth2/applications/@me`;
|
||||
}
|
||||
};
|
||||
15
v6/rest/invite.ts
Normal file
15
v6/rest/invite.ts
Normal file
@@ -0,0 +1,15 @@
|
||||
import type { APIInvite } from '../payloads';
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/invite#get-invite
|
||||
*/
|
||||
export interface RESTGetAPIInviteQuery {
|
||||
with_counts?: boolean;
|
||||
}
|
||||
|
||||
export type RESTGetAPIInviteResult = APIInvite;
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/invite#delete-invite
|
||||
*/
|
||||
export type RESTDeleteAPIInviteResult = APIInvite;
|
||||
6
v6/rest/oauth2.ts
Normal file
6
v6/rest/oauth2.ts
Normal file
@@ -0,0 +1,6 @@
|
||||
import type { APIApplication } from '../payloads';
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/topics/oauth2#get-current-application-information
|
||||
*/
|
||||
export type RESTGetAPIOauth2CurrentApplicationResult = APIApplication;
|
||||
64
v6/rest/user.ts
Normal file
64
v6/rest/user.ts
Normal file
@@ -0,0 +1,64 @@
|
||||
import type { APIChannel, APIConnection, APIUser, GuildFeature } from '../payloads';
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/user#get-current-user
|
||||
*/
|
||||
export type RESTGetAPICurrentUserResult = APIUser;
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/user#get-user
|
||||
*/
|
||||
export type RESTGetAPIUserResult = APIUser;
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/user#modify-current-user
|
||||
*/
|
||||
export interface RESTPatchAPICurrentUserJSONBody {
|
||||
username?: string;
|
||||
avatar?: string | null;
|
||||
}
|
||||
|
||||
export type RESTPatchAPICurrentUserResult = APIUser;
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/user#get-current-user-guilds
|
||||
*/
|
||||
export interface RESTGetAPICurrentUserGuildsQuery {
|
||||
before?: string;
|
||||
after?: string;
|
||||
limit?: number;
|
||||
}
|
||||
|
||||
export interface RESTAPIPartialCurrentUserGuild {
|
||||
id: string;
|
||||
name: string;
|
||||
icon: string | null;
|
||||
owner: boolean;
|
||||
features: GuildFeature[];
|
||||
/**
|
||||
* @deprecated Use `permissions_new` instead
|
||||
*/
|
||||
permissions: number;
|
||||
permissions_new: string;
|
||||
}
|
||||
|
||||
export type RESTGetAPICurrentUserGuildsResult = RESTAPIPartialCurrentUserGuild[];
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/user#leave-guild
|
||||
*/
|
||||
export type RESTDeleteAPICurrentUserGuildResult = never;
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/user#create-dm
|
||||
*/
|
||||
export interface RESTPostAPICurrentUserCreateDMChannelJSONBody {
|
||||
recipient_id: string;
|
||||
}
|
||||
|
||||
export type RESTPostAPICurrentUserCreateDMChannelResult = APIChannel;
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/user#get-user-connections
|
||||
*/
|
||||
export type RESTGetAPICurrentUserConnectionsResult = APIConnection[];
|
||||
6
v6/rest/voice.ts
Normal file
6
v6/rest/voice.ts
Normal file
@@ -0,0 +1,6 @@
|
||||
import type { APIVoiceRegion } from '../payloads';
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/voice#list-voice-regions
|
||||
*/
|
||||
export type GetAPIVoiceRegionsResult = APIVoiceRegion[];
|
||||
114
v6/rest/webhook.ts
Normal file
114
v6/rest/webhook.ts
Normal file
@@ -0,0 +1,114 @@
|
||||
import type { APIEmbed, APIMessage, APIWebhook } from '../payloads';
|
||||
import type { APIAllowedMentionsSend } from './channel';
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/webhook#create-webhook
|
||||
*/
|
||||
export interface RESTPostAPIChannelWebhookJSONBody {
|
||||
name: string;
|
||||
avatar?: string | null;
|
||||
}
|
||||
|
||||
export type RESTPostAPIChannelWebhookResult = APIWebhook;
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/webhook#get-channel-webhooks
|
||||
*/
|
||||
export type RESTGetAPIChannelWebhooksResult = APIWebhook[];
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/webhook#get-guild-webhooks
|
||||
*/
|
||||
export type RESTGetAPIGuildWebhooksResult = APIWebhook[];
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/webhook#get-webhook
|
||||
*/
|
||||
export type RESTGetAPIWebhookResult = APIWebhook;
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/webhook#get-webhook-with-token
|
||||
*/
|
||||
export type RESTGetAPIWebhookWithTokenResult = Omit<APIWebhook, 'user'>;
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/webhook#modify-webhook
|
||||
*/
|
||||
export interface RESTPatchAPIWebhookJSONBody {
|
||||
name?: string;
|
||||
avatar?: string | null;
|
||||
channel_id?: string;
|
||||
}
|
||||
|
||||
export type RESTPatchAPIWebhookResult = APIWebhook;
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/webhook#modify-webhook-with-token
|
||||
*/
|
||||
export type RESTPatchAPIWebhookWithTokenJSONBody = Omit<RESTPatchAPIWebhookJSONBody, 'channel_id'>;
|
||||
|
||||
export type RESTPatchAPIWebhookWithTokenResult = Omit<APIWebhook, 'user'>;
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/webhook#delete-webhook
|
||||
*/
|
||||
export type RESTDeleteAPIWebhookResult = never;
|
||||
export type RESTDeleteAPIWebhookWithTokenResult = never;
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/webhook#execute-webhook
|
||||
*/
|
||||
export interface RESTPostAPIWebhookWithTokenJSONBody {
|
||||
content?: string;
|
||||
username?: string;
|
||||
avatar_url?: string;
|
||||
tts?: boolean;
|
||||
embeds?: APIEmbed[];
|
||||
allowed_mentions?: APIAllowedMentionsSend;
|
||||
}
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/webhook#execute-webhook
|
||||
*/
|
||||
export type RESTPostAPIWebhookWithTokenFormDataBody = {
|
||||
/**
|
||||
* JSON stringified message body
|
||||
*/
|
||||
payload_json?: string;
|
||||
/**
|
||||
* The file contents
|
||||
*/
|
||||
file: unknown;
|
||||
} | (RESTPostAPIWebhookWithTokenJSONBody & {
|
||||
/**
|
||||
* The file contents
|
||||
*/
|
||||
file: unknown;
|
||||
});
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/webhook#execute-webhook-querystring-params
|
||||
*/
|
||||
export interface RESTPostAPIWebhookWithTokenQuery {
|
||||
wait?: boolean;
|
||||
}
|
||||
|
||||
export type RESTPostAPIWebhookWithTokenResult = never;
|
||||
|
||||
/**
|
||||
* Received when a call to POST `/webhooks/{webhook.id}/{webhook.token}` receives
|
||||
* the `wait` query parameter set to `true`
|
||||
*
|
||||
* @see https://discord.com/developers/docs/resources/webhook#execute-webhook-querystring-params
|
||||
*/
|
||||
export type RESTPostAPIWebhookWithTokenWaitResult = APIMessage;
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/webhook#execute-slackcompatible-webhook-querystring-params
|
||||
*/
|
||||
export type RESTPostAPIWebhookWithTokenSlackQuery = RESTPostAPIWebhookWithTokenQuery;
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/webhook#execute-githubcompatible-webhook-querystring-params
|
||||
*/
|
||||
export type RESTPostAPIWebhookWithTokenGitHubQuery = RESTPostAPIWebhookWithTokenQuery;
|
||||
801
yarn.lock
Normal file
801
yarn.lock
Normal file
@@ -0,0 +1,801 @@
|
||||
# THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY.
|
||||
# yarn lockfile v1
|
||||
|
||||
|
||||
"@babel/code-frame@^7.0.0":
|
||||
version "7.10.4"
|
||||
resolved "https://registry.yarnpkg.com/@babel/code-frame/-/code-frame-7.10.4.tgz#168da1a36e90da68ae8d49c0f1b48c7c6249213a"
|
||||
integrity sha512-vG6SvB6oYEhvgisZNFRmRCUkLz11c7rp+tbNTynGqc6mS1d5ATd/sGyV6W0KZZnXRKMTzZDRgQT3Ou9jhpAfUg==
|
||||
dependencies:
|
||||
"@babel/highlight" "^7.10.4"
|
||||
|
||||
"@babel/helper-validator-identifier@^7.10.4":
|
||||
version "7.10.4"
|
||||
resolved "https://registry.yarnpkg.com/@babel/helper-validator-identifier/-/helper-validator-identifier-7.10.4.tgz#a78c7a7251e01f616512d31b10adcf52ada5e0d2"
|
||||
integrity sha512-3U9y+43hz7ZM+rzG24Qe2mufW5KhvFg/NhnNph+i9mgCtdTCtMJuI1TMkrIUiK7Ix4PYlRF9I5dhqaLYA/ADXw==
|
||||
|
||||
"@babel/highlight@^7.10.4":
|
||||
version "7.10.4"
|
||||
resolved "https://registry.yarnpkg.com/@babel/highlight/-/highlight-7.10.4.tgz#7d1bdfd65753538fabe6c38596cdb76d9ac60143"
|
||||
integrity sha512-i6rgnR/YgPEQzZZnbTHHuZdlE8qyoBNalD6F+q4vAFlcMEcqmkoG+mPqJYJCo63qPf74+Y1UZsl3l6f7/RIkmA==
|
||||
dependencies:
|
||||
"@babel/helper-validator-identifier" "^7.10.4"
|
||||
chalk "^2.0.0"
|
||||
js-tokens "^4.0.0"
|
||||
|
||||
"@skyra/eslint-config@^5.3.0":
|
||||
version "5.3.0"
|
||||
resolved "https://registry.yarnpkg.com/@skyra/eslint-config/-/eslint-config-5.3.0.tgz#9f4f49bea425d0aac6877fa42daec0c4fc00f0ad"
|
||||
integrity sha512-MO/JbDZjd5NvdS82pooOBiDHq3Njb54lo8XsMBYUM2vUxYAzpFcjZ2SIVnfj76MWZS9yQcvV+2MFLtTKaOuFOQ==
|
||||
|
||||
"@types/color-name@^1.1.1":
|
||||
version "1.1.1"
|
||||
resolved "https://registry.yarnpkg.com/@types/color-name/-/color-name-1.1.1.tgz#1c1261bbeaa10a8055bbc5d8ab84b7b2afc846a0"
|
||||
integrity sha512-rr+OQyAjxze7GgWrSaJwydHStIhHq2lvY3BOC2Mj7KnzI7XK0Uw1TOOdI9lDoajEbSWLiYgoo4f1R51erQfhPQ==
|
||||
|
||||
"@types/eslint-visitor-keys@^1.0.0":
|
||||
version "1.0.0"
|
||||
resolved "https://registry.yarnpkg.com/@types/eslint-visitor-keys/-/eslint-visitor-keys-1.0.0.tgz#1ee30d79544ca84d68d4b3cdb0af4f205663dd2d"
|
||||
integrity sha512-OCutwjDZ4aFS6PB1UZ988C4YgwlBHJd6wCeQqaLdmadZ/7e+w79+hbMUFC1QXDNCmdyoRfAFdm0RypzwR+Qpag==
|
||||
|
||||
"@types/json-schema@^7.0.3":
|
||||
version "7.0.5"
|
||||
resolved "https://registry.yarnpkg.com/@types/json-schema/-/json-schema-7.0.5.tgz#dcce4430e64b443ba8945f0290fb564ad5bac6dd"
|
||||
integrity sha512-7+2BITlgjgDhH0vvwZU/HZJVyk+2XUlvxXe8dFMedNX/aMkaOq++rMAFXc0tM7ij15QaWlbdQASBR9dihi+bDQ==
|
||||
|
||||
"@typescript-eslint/eslint-plugin@^3.9.1":
|
||||
version "3.9.1"
|
||||
resolved "https://registry.yarnpkg.com/@typescript-eslint/eslint-plugin/-/eslint-plugin-3.9.1.tgz#8cf27b6227d12d66dd8dc1f1a4b04d1daad51c2e"
|
||||
integrity sha512-XIr+Mfv7i4paEdBf0JFdIl9/tVxyj+rlilWIfZ97Be0lZ7hPvUbS5iHt9Glc8kRI53dsr0PcAEudbf8rO2wGgg==
|
||||
dependencies:
|
||||
"@typescript-eslint/experimental-utils" "3.9.1"
|
||||
debug "^4.1.1"
|
||||
functional-red-black-tree "^1.0.1"
|
||||
regexpp "^3.0.0"
|
||||
semver "^7.3.2"
|
||||
tsutils "^3.17.1"
|
||||
|
||||
"@typescript-eslint/experimental-utils@3.9.1":
|
||||
version "3.9.1"
|
||||
resolved "https://registry.yarnpkg.com/@typescript-eslint/experimental-utils/-/experimental-utils-3.9.1.tgz#b140b2dc7a7554a44f8a86fb6fe7cbfe57ca059e"
|
||||
integrity sha512-lkiZ8iBBaYoyEKhCkkw4SAeatXyBq9Ece5bZXdLe1LWBUwTszGbmbiqmQbwWA8cSYDnjWXp9eDbXpf9Sn0hLAg==
|
||||
dependencies:
|
||||
"@types/json-schema" "^7.0.3"
|
||||
"@typescript-eslint/types" "3.9.1"
|
||||
"@typescript-eslint/typescript-estree" "3.9.1"
|
||||
eslint-scope "^5.0.0"
|
||||
eslint-utils "^2.0.0"
|
||||
|
||||
"@typescript-eslint/parser@^3.9.1":
|
||||
version "3.9.1"
|
||||
resolved "https://registry.yarnpkg.com/@typescript-eslint/parser/-/parser-3.9.1.tgz#ab7983abaea0ae138ff5671c7c7739d8a191b181"
|
||||
integrity sha512-y5QvPFUn4Vl4qM40lI+pNWhTcOWtpZAJ8pOEQ21fTTW4xTJkRplMjMRje7LYTXqVKKX9GJhcyweMz2+W1J5bMg==
|
||||
dependencies:
|
||||
"@types/eslint-visitor-keys" "^1.0.0"
|
||||
"@typescript-eslint/experimental-utils" "3.9.1"
|
||||
"@typescript-eslint/types" "3.9.1"
|
||||
"@typescript-eslint/typescript-estree" "3.9.1"
|
||||
eslint-visitor-keys "^1.1.0"
|
||||
|
||||
"@typescript-eslint/types@3.9.1":
|
||||
version "3.9.1"
|
||||
resolved "https://registry.yarnpkg.com/@typescript-eslint/types/-/types-3.9.1.tgz#b2a6eaac843cf2f2777b3f2464fb1fbce5111416"
|
||||
integrity sha512-15JcTlNQE1BsYy5NBhctnEhEoctjXOjOK+Q+rk8ugC+WXU9rAcS2BYhoh6X4rOaXJEpIYDl+p7ix+A5U0BqPTw==
|
||||
|
||||
"@typescript-eslint/typescript-estree@3.9.1":
|
||||
version "3.9.1"
|
||||
resolved "https://registry.yarnpkg.com/@typescript-eslint/typescript-estree/-/typescript-estree-3.9.1.tgz#fd81cada74bc8a7f3a2345b00897acb087935779"
|
||||
integrity sha512-IqM0gfGxOmIKPhiHW/iyAEXwSVqMmR2wJ9uXHNdFpqVvPaQ3dWg302vW127sBpAiqM9SfHhyS40NKLsoMpN2KA==
|
||||
dependencies:
|
||||
"@typescript-eslint/types" "3.9.1"
|
||||
"@typescript-eslint/visitor-keys" "3.9.1"
|
||||
debug "^4.1.1"
|
||||
glob "^7.1.6"
|
||||
is-glob "^4.0.1"
|
||||
lodash "^4.17.15"
|
||||
semver "^7.3.2"
|
||||
tsutils "^3.17.1"
|
||||
|
||||
"@typescript-eslint/visitor-keys@3.9.1":
|
||||
version "3.9.1"
|
||||
resolved "https://registry.yarnpkg.com/@typescript-eslint/visitor-keys/-/visitor-keys-3.9.1.tgz#92af3747cdb71509199a8f7a4f00b41d636551d1"
|
||||
integrity sha512-zxdtUjeoSh+prCpogswMwVUJfEFmCOjdzK9rpNjNBfm6EyPt99x3RrJoBOGZO23FCt0WPKUCOL5mb/9D5LjdwQ==
|
||||
dependencies:
|
||||
eslint-visitor-keys "^1.1.0"
|
||||
|
||||
acorn-jsx@^5.2.0:
|
||||
version "5.2.0"
|
||||
resolved "https://registry.yarnpkg.com/acorn-jsx/-/acorn-jsx-5.2.0.tgz#4c66069173d6fdd68ed85239fc256226182b2ebe"
|
||||
integrity sha512-HiUX/+K2YpkpJ+SzBffkM/AQ2YE03S0U1kjTLVpoJdhZMOWy8qvXVN9JdLqv2QsaQ6MPYQIuNmwD8zOiYUofLQ==
|
||||
|
||||
acorn@^7.3.1:
|
||||
version "7.4.0"
|
||||
resolved "https://registry.yarnpkg.com/acorn/-/acorn-7.4.0.tgz#e1ad486e6c54501634c6c397c5c121daa383607c"
|
||||
integrity sha512-+G7P8jJmCHr+S+cLfQxygbWhXy+8YTVGzAkpEbcLo2mLoL7tij/VG41QSHACSf5QgYRhMZYHuNc6drJaO0Da+w==
|
||||
|
||||
ajv@^6.10.0, ajv@^6.10.2:
|
||||
version "6.12.4"
|
||||
resolved "https://registry.yarnpkg.com/ajv/-/ajv-6.12.4.tgz#0614facc4522127fa713445c6bfd3ebd376e2234"
|
||||
integrity sha512-eienB2c9qVQs2KWexhkrdMLVDoIQCz5KSeLxwg9Lzk4DOfBtIK9PQwwufcsn1jjGuf9WZmqPMbGxOzfcuphJCQ==
|
||||
dependencies:
|
||||
fast-deep-equal "^3.1.1"
|
||||
fast-json-stable-stringify "^2.0.0"
|
||||
json-schema-traverse "^0.4.1"
|
||||
uri-js "^4.2.2"
|
||||
|
||||
ansi-colors@^4.1.1:
|
||||
version "4.1.1"
|
||||
resolved "https://registry.yarnpkg.com/ansi-colors/-/ansi-colors-4.1.1.tgz#cbb9ae256bf750af1eab344f229aa27fe94ba348"
|
||||
integrity sha512-JoX0apGbHaUJBNl6yF+p6JAFYZ666/hhCGKN5t9QFjbJQKUU/g8MNbFDbvfrgKXvI1QpZplPOnwIo99lX/AAmA==
|
||||
|
||||
ansi-regex@^4.1.0:
|
||||
version "4.1.0"
|
||||
resolved "https://registry.yarnpkg.com/ansi-regex/-/ansi-regex-4.1.0.tgz#8b9f8f08cf1acb843756a839ca8c7e3168c51997"
|
||||
integrity sha512-1apePfXM1UOSqw0o9IiFAovVz9M5S1Dg+4TrDwfMewQ6p/rmMueb7tWZjQ1rx4Loy1ArBggoqGpfqqdI4rondg==
|
||||
|
||||
ansi-regex@^5.0.0:
|
||||
version "5.0.0"
|
||||
resolved "https://registry.yarnpkg.com/ansi-regex/-/ansi-regex-5.0.0.tgz#388539f55179bf39339c81af30a654d69f87cb75"
|
||||
integrity sha512-bY6fj56OUQ0hU1KjFNDQuJFezqKdrAyFdIevADiqrWHwSlbmBNMHp5ak2f40Pm8JTFyM2mqxkG6ngkHO11f/lg==
|
||||
|
||||
ansi-styles@^3.2.0, ansi-styles@^3.2.1:
|
||||
version "3.2.1"
|
||||
resolved "https://registry.yarnpkg.com/ansi-styles/-/ansi-styles-3.2.1.tgz#41fbb20243e50b12be0f04b8dedbf07520ce841d"
|
||||
integrity sha512-VT0ZI6kZRdTh8YyJw3SMbYm/u+NqfsAxEpWO0Pf9sq8/e94WxxOpPKx9FR1FlyCtOVDNOQ+8ntlqFxiRc+r5qA==
|
||||
dependencies:
|
||||
color-convert "^1.9.0"
|
||||
|
||||
ansi-styles@^4.1.0:
|
||||
version "4.2.1"
|
||||
resolved "https://registry.yarnpkg.com/ansi-styles/-/ansi-styles-4.2.1.tgz#90ae75c424d008d2624c5bf29ead3177ebfcf359"
|
||||
integrity sha512-9VGjrMsG1vePxcSweQsN20KY/c4zN0h9fLjqAbwbPfahM3t+NL+M9HC8xeXG2I8pX5NoamTGNuomEUFI7fcUjA==
|
||||
dependencies:
|
||||
"@types/color-name" "^1.1.1"
|
||||
color-convert "^2.0.1"
|
||||
|
||||
argparse@^1.0.7:
|
||||
version "1.0.10"
|
||||
resolved "https://registry.yarnpkg.com/argparse/-/argparse-1.0.10.tgz#bcd6791ea5ae09725e17e5ad988134cd40b3d911"
|
||||
integrity sha512-o5Roy6tNG4SL/FOkCAN6RzjiakZS25RLYFrcMttJqbdd8BWrnA+fGz57iN5Pb06pvBGvl5gQ0B48dJlslXvoTg==
|
||||
dependencies:
|
||||
sprintf-js "~1.0.2"
|
||||
|
||||
astral-regex@^1.0.0:
|
||||
version "1.0.0"
|
||||
resolved "https://registry.yarnpkg.com/astral-regex/-/astral-regex-1.0.0.tgz#6c8c3fb827dd43ee3918f27b82782ab7658a6fd9"
|
||||
integrity sha512-+Ryf6g3BKoRc7jfp7ad8tM4TtMiaWvbF/1/sQcZPkkS7ag3D5nMBCe2UfOTONtAkaG0tO0ij3C5Lwmf1EiyjHg==
|
||||
|
||||
balanced-match@^1.0.0:
|
||||
version "1.0.0"
|
||||
resolved "https://registry.yarnpkg.com/balanced-match/-/balanced-match-1.0.0.tgz#89b4d199ab2bee49de164ea02b89ce462d71b767"
|
||||
integrity sha1-ibTRmasr7kneFk6gK4nORi1xt2c=
|
||||
|
||||
brace-expansion@^1.1.7:
|
||||
version "1.1.11"
|
||||
resolved "https://registry.yarnpkg.com/brace-expansion/-/brace-expansion-1.1.11.tgz#3c7fcbf529d87226f3d2f52b966ff5271eb441dd"
|
||||
integrity sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA==
|
||||
dependencies:
|
||||
balanced-match "^1.0.0"
|
||||
concat-map "0.0.1"
|
||||
|
||||
callsites@^3.0.0:
|
||||
version "3.1.0"
|
||||
resolved "https://registry.yarnpkg.com/callsites/-/callsites-3.1.0.tgz#b3630abd8943432f54b3f0519238e33cd7df2f73"
|
||||
integrity sha512-P8BjAsXvZS+VIDUI11hHCQEv74YT67YUi5JJFNWIqL235sBmjX4+qx9Muvls5ivyNENctx46xQLQ3aTuE7ssaQ==
|
||||
|
||||
chalk@^2.0.0:
|
||||
version "2.4.2"
|
||||
resolved "https://registry.yarnpkg.com/chalk/-/chalk-2.4.2.tgz#cd42541677a54333cf541a49108c1432b44c9424"
|
||||
integrity sha512-Mti+f9lpJNcwF4tWV8/OrTTtF1gZi+f8FqlyAdouralcFWFQWF2+NgCHShjkCb+IFBLq9buZwE1xckQU4peSuQ==
|
||||
dependencies:
|
||||
ansi-styles "^3.2.1"
|
||||
escape-string-regexp "^1.0.5"
|
||||
supports-color "^5.3.0"
|
||||
|
||||
chalk@^4.0.0:
|
||||
version "4.1.0"
|
||||
resolved "https://registry.yarnpkg.com/chalk/-/chalk-4.1.0.tgz#4e14870a618d9e2edd97dd8345fd9d9dc315646a"
|
||||
integrity sha512-qwx12AxXe2Q5xQ43Ac//I6v5aXTipYrSESdOgzrN+9XjgEpyjpKuvSGaN4qE93f7TQTlerQQ8S+EQ0EyDoVL1A==
|
||||
dependencies:
|
||||
ansi-styles "^4.1.0"
|
||||
supports-color "^7.1.0"
|
||||
|
||||
color-convert@^1.9.0:
|
||||
version "1.9.3"
|
||||
resolved "https://registry.yarnpkg.com/color-convert/-/color-convert-1.9.3.tgz#bb71850690e1f136567de629d2d5471deda4c1e8"
|
||||
integrity sha512-QfAUtd+vFdAtFQcC8CCyYt1fYWxSqAiK2cSD6zDB8N3cpsEBAvRxp9zOGg6G/SHHJYAT88/az/IuDGALsNVbGg==
|
||||
dependencies:
|
||||
color-name "1.1.3"
|
||||
|
||||
color-convert@^2.0.1:
|
||||
version "2.0.1"
|
||||
resolved "https://registry.yarnpkg.com/color-convert/-/color-convert-2.0.1.tgz#72d3a68d598c9bdb3af2ad1e84f21d896abd4de3"
|
||||
integrity sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==
|
||||
dependencies:
|
||||
color-name "~1.1.4"
|
||||
|
||||
color-name@1.1.3:
|
||||
version "1.1.3"
|
||||
resolved "https://registry.yarnpkg.com/color-name/-/color-name-1.1.3.tgz#a7d0558bd89c42f795dd42328f740831ca53bc25"
|
||||
integrity sha1-p9BVi9icQveV3UIyj3QIMcpTvCU=
|
||||
|
||||
color-name@~1.1.4:
|
||||
version "1.1.4"
|
||||
resolved "https://registry.yarnpkg.com/color-name/-/color-name-1.1.4.tgz#c2a09a87acbde69543de6f63fa3995c826c536a2"
|
||||
integrity sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==
|
||||
|
||||
concat-map@0.0.1:
|
||||
version "0.0.1"
|
||||
resolved "https://registry.yarnpkg.com/concat-map/-/concat-map-0.0.1.tgz#d8a96bd77fd68df7793a73036a3ba0d5405d477b"
|
||||
integrity sha1-2Klr13/Wjfd5OnMDajug1UBdR3s=
|
||||
|
||||
cross-spawn@^7.0.2:
|
||||
version "7.0.3"
|
||||
resolved "https://registry.yarnpkg.com/cross-spawn/-/cross-spawn-7.0.3.tgz#f73a85b9d5d41d045551c177e2882d4ac85728a6"
|
||||
integrity sha512-iRDPJKUPVEND7dHPO8rkbOnPpyDygcDFtWjpeWNCgy8WP2rXcxXL8TskReQl6OrB2G7+UJrags1q15Fudc7G6w==
|
||||
dependencies:
|
||||
path-key "^3.1.0"
|
||||
shebang-command "^2.0.0"
|
||||
which "^2.0.1"
|
||||
|
||||
debug@^4.0.1, debug@^4.1.1:
|
||||
version "4.1.1"
|
||||
resolved "https://registry.yarnpkg.com/debug/-/debug-4.1.1.tgz#3b72260255109c6b589cee050f1d516139664791"
|
||||
integrity sha512-pYAIzeRo8J6KPEaJ0VWOh5Pzkbw/RetuzehGM7QRRX5he4fPHx2rdKMB256ehJCkX+XRQm16eZLqLNS8RSZXZw==
|
||||
dependencies:
|
||||
ms "^2.1.1"
|
||||
|
||||
deep-is@^0.1.3:
|
||||
version "0.1.3"
|
||||
resolved "https://registry.yarnpkg.com/deep-is/-/deep-is-0.1.3.tgz#b369d6fb5dbc13eecf524f91b070feedc357cf34"
|
||||
integrity sha1-s2nW+128E+7PUk+RsHD+7cNXzzQ=
|
||||
|
||||
doctrine@^3.0.0:
|
||||
version "3.0.0"
|
||||
resolved "https://registry.yarnpkg.com/doctrine/-/doctrine-3.0.0.tgz#addebead72a6574db783639dc87a121773973961"
|
||||
integrity sha512-yS+Q5i3hBf7GBkd4KG8a7eBNNWNGLTaEwwYWUijIYM7zrlYDM0BFXHjjPWlWZ1Rg7UaddZeIDmi9jF3HmqiQ2w==
|
||||
dependencies:
|
||||
esutils "^2.0.2"
|
||||
|
||||
emoji-regex@^7.0.1:
|
||||
version "7.0.3"
|
||||
resolved "https://registry.yarnpkg.com/emoji-regex/-/emoji-regex-7.0.3.tgz#933a04052860c85e83c122479c4748a8e4c72156"
|
||||
integrity sha512-CwBLREIQ7LvYFB0WyRvwhq5N5qPhc6PMjD6bYggFlI5YyDgl+0vxq5VHbMOFqLg7hfWzmu8T5Z1QofhmTIhItA==
|
||||
|
||||
enquirer@^2.3.5:
|
||||
version "2.3.6"
|
||||
resolved "https://registry.yarnpkg.com/enquirer/-/enquirer-2.3.6.tgz#2a7fe5dd634a1e4125a975ec994ff5456dc3734d"
|
||||
integrity sha512-yjNnPr315/FjS4zIsUxYguYUPP2e1NK4d7E7ZOLiyYCcbFBiTMyID+2wvm2w6+pZ/odMA7cRkjhsPbltwBOrLg==
|
||||
dependencies:
|
||||
ansi-colors "^4.1.1"
|
||||
|
||||
escape-string-regexp@^1.0.5:
|
||||
version "1.0.5"
|
||||
resolved "https://registry.yarnpkg.com/escape-string-regexp/-/escape-string-regexp-1.0.5.tgz#1b61c0562190a8dff6ae3bb2cf0200ca130b86d4"
|
||||
integrity sha1-G2HAViGQqN/2rjuyzwIAyhMLhtQ=
|
||||
|
||||
eslint-scope@^5.0.0, eslint-scope@^5.1.0:
|
||||
version "5.1.0"
|
||||
resolved "https://registry.yarnpkg.com/eslint-scope/-/eslint-scope-5.1.0.tgz#d0f971dfe59c69e0cada684b23d49dbf82600ce5"
|
||||
integrity sha512-iiGRvtxWqgtx5m8EyQUJihBloE4EnYeGE/bz1wSPwJE6tZuJUtHlhqDM4Xj2ukE8Dyy1+HCZ4hE0fzIVMzb58w==
|
||||
dependencies:
|
||||
esrecurse "^4.1.0"
|
||||
estraverse "^4.1.1"
|
||||
|
||||
eslint-utils@^2.0.0, eslint-utils@^2.1.0:
|
||||
version "2.1.0"
|
||||
resolved "https://registry.yarnpkg.com/eslint-utils/-/eslint-utils-2.1.0.tgz#d2de5e03424e707dc10c74068ddedae708741b27"
|
||||
integrity sha512-w94dQYoauyvlDc43XnGB8lU3Zt713vNChgt4EWwhXAP2XkBvndfxF0AgIqKOOasjPIPzj9JqgwkwbCYD0/V3Zg==
|
||||
dependencies:
|
||||
eslint-visitor-keys "^1.1.0"
|
||||
|
||||
eslint-visitor-keys@^1.1.0, eslint-visitor-keys@^1.3.0:
|
||||
version "1.3.0"
|
||||
resolved "https://registry.yarnpkg.com/eslint-visitor-keys/-/eslint-visitor-keys-1.3.0.tgz#30ebd1ef7c2fdff01c3a4f151044af25fab0523e"
|
||||
integrity sha512-6J72N8UNa462wa/KFODt/PJ3IU60SDpC3QXC1Hjc1BXXpfL2C9R5+AU7jhe0F6GREqVMh4Juu+NY7xn+6dipUQ==
|
||||
|
||||
eslint@^7.7.0:
|
||||
version "7.7.0"
|
||||
resolved "https://registry.yarnpkg.com/eslint/-/eslint-7.7.0.tgz#18beba51411927c4b64da0a8ceadefe4030d6073"
|
||||
integrity sha512-1KUxLzos0ZVsyL81PnRN335nDtQ8/vZUD6uMtWbF+5zDtjKcsklIi78XoE0MVL93QvWTu+E5y44VyyCsOMBrIg==
|
||||
dependencies:
|
||||
"@babel/code-frame" "^7.0.0"
|
||||
ajv "^6.10.0"
|
||||
chalk "^4.0.0"
|
||||
cross-spawn "^7.0.2"
|
||||
debug "^4.0.1"
|
||||
doctrine "^3.0.0"
|
||||
enquirer "^2.3.5"
|
||||
eslint-scope "^5.1.0"
|
||||
eslint-utils "^2.1.0"
|
||||
eslint-visitor-keys "^1.3.0"
|
||||
espree "^7.2.0"
|
||||
esquery "^1.2.0"
|
||||
esutils "^2.0.2"
|
||||
file-entry-cache "^5.0.1"
|
||||
functional-red-black-tree "^1.0.1"
|
||||
glob-parent "^5.0.0"
|
||||
globals "^12.1.0"
|
||||
ignore "^4.0.6"
|
||||
import-fresh "^3.0.0"
|
||||
imurmurhash "^0.1.4"
|
||||
is-glob "^4.0.0"
|
||||
js-yaml "^3.13.1"
|
||||
json-stable-stringify-without-jsonify "^1.0.1"
|
||||
levn "^0.4.1"
|
||||
lodash "^4.17.19"
|
||||
minimatch "^3.0.4"
|
||||
natural-compare "^1.4.0"
|
||||
optionator "^0.9.1"
|
||||
progress "^2.0.0"
|
||||
regexpp "^3.1.0"
|
||||
semver "^7.2.1"
|
||||
strip-ansi "^6.0.0"
|
||||
strip-json-comments "^3.1.0"
|
||||
table "^5.2.3"
|
||||
text-table "^0.2.0"
|
||||
v8-compile-cache "^2.0.3"
|
||||
|
||||
espree@^7.2.0:
|
||||
version "7.2.0"
|
||||
resolved "https://registry.yarnpkg.com/espree/-/espree-7.2.0.tgz#1c263d5b513dbad0ac30c4991b93ac354e948d69"
|
||||
integrity sha512-H+cQ3+3JYRMEIOl87e7QdHX70ocly5iW4+dttuR8iYSPr/hXKFb+7dBsZ7+u1adC4VrnPlTkv0+OwuPnDop19g==
|
||||
dependencies:
|
||||
acorn "^7.3.1"
|
||||
acorn-jsx "^5.2.0"
|
||||
eslint-visitor-keys "^1.3.0"
|
||||
|
||||
esprima@^4.0.0:
|
||||
version "4.0.1"
|
||||
resolved "https://registry.yarnpkg.com/esprima/-/esprima-4.0.1.tgz#13b04cdb3e6c5d19df91ab6987a8695619b0aa71"
|
||||
integrity sha512-eGuFFw7Upda+g4p+QHvnW0RyTX/SVeJBDM/gCtMARO0cLuT2HcEKnTPvhjV6aGeqrCB/sbNop0Kszm0jsaWU4A==
|
||||
|
||||
esquery@^1.2.0:
|
||||
version "1.3.1"
|
||||
resolved "https://registry.yarnpkg.com/esquery/-/esquery-1.3.1.tgz#b78b5828aa8e214e29fb74c4d5b752e1c033da57"
|
||||
integrity sha512-olpvt9QG0vniUBZspVRN6lwB7hOZoTRtT+jzR+tS4ffYx2mzbw+z0XCOk44aaLYKApNX5nMm+E+P6o25ip/DHQ==
|
||||
dependencies:
|
||||
estraverse "^5.1.0"
|
||||
|
||||
esrecurse@^4.1.0:
|
||||
version "4.2.1"
|
||||
resolved "https://registry.yarnpkg.com/esrecurse/-/esrecurse-4.2.1.tgz#007a3b9fdbc2b3bb87e4879ea19c92fdbd3942cf"
|
||||
integrity sha512-64RBB++fIOAXPw3P9cy89qfMlvZEXZkqqJkjqqXIvzP5ezRZjW+lPWjw35UX/3EhUPFYbg5ER4JYgDw4007/DQ==
|
||||
dependencies:
|
||||
estraverse "^4.1.0"
|
||||
|
||||
estraverse@^4.1.0, estraverse@^4.1.1:
|
||||
version "4.3.0"
|
||||
resolved "https://registry.yarnpkg.com/estraverse/-/estraverse-4.3.0.tgz#398ad3f3c5a24948be7725e83d11a7de28cdbd1d"
|
||||
integrity sha512-39nnKffWz8xN1BU/2c79n9nB9HDzo0niYUqx6xyqUnyoAnQyyWpOTdZEeiCch8BBu515t4wp9ZmgVfVhn9EBpw==
|
||||
|
||||
estraverse@^5.1.0:
|
||||
version "5.2.0"
|
||||
resolved "https://registry.yarnpkg.com/estraverse/-/estraverse-5.2.0.tgz#307df42547e6cc7324d3cf03c155d5cdb8c53880"
|
||||
integrity sha512-BxbNGGNm0RyRYvUdHpIwv9IWzeM9XClbOxwoATuFdOE7ZE6wHL+HQ5T8hoPM+zHvmKzzsEqhgy0GrQ5X13afiQ==
|
||||
|
||||
esutils@^2.0.2:
|
||||
version "2.0.3"
|
||||
resolved "https://registry.yarnpkg.com/esutils/-/esutils-2.0.3.tgz#74d2eb4de0b8da1293711910d50775b9b710ef64"
|
||||
integrity sha512-kVscqXk4OCp68SZ0dkgEKVi6/8ij300KBWTJq32P/dYeWTSwK41WyTxalN1eRmA5Z9UU/LX9D7FWSmV9SAYx6g==
|
||||
|
||||
fast-deep-equal@^3.1.1:
|
||||
version "3.1.3"
|
||||
resolved "https://registry.yarnpkg.com/fast-deep-equal/-/fast-deep-equal-3.1.3.tgz#3a7d56b559d6cbc3eb512325244e619a65c6c525"
|
||||
integrity sha512-f3qQ9oQy9j2AhBe/H9VC91wLmKBCCU/gDOnKNAYG5hswO7BLKj09Hc5HYNz9cGI++xlpDCIgDaitVs03ATR84Q==
|
||||
|
||||
fast-json-stable-stringify@^2.0.0:
|
||||
version "2.1.0"
|
||||
resolved "https://registry.yarnpkg.com/fast-json-stable-stringify/-/fast-json-stable-stringify-2.1.0.tgz#874bf69c6f404c2b5d99c481341399fd55892633"
|
||||
integrity sha512-lhd/wF+Lk98HZoTCtlVraHtfh5XYijIjalXck7saUtuanSDyLMxnHhSXEDJqHxD7msR8D0uCmqlkwjCV8xvwHw==
|
||||
|
||||
fast-levenshtein@^2.0.6:
|
||||
version "2.0.6"
|
||||
resolved "https://registry.yarnpkg.com/fast-levenshtein/-/fast-levenshtein-2.0.6.tgz#3d8a5c66883a16a30ca8643e851f19baa7797917"
|
||||
integrity sha1-PYpcZog6FqMMqGQ+hR8Zuqd5eRc=
|
||||
|
||||
file-entry-cache@^5.0.1:
|
||||
version "5.0.1"
|
||||
resolved "https://registry.yarnpkg.com/file-entry-cache/-/file-entry-cache-5.0.1.tgz#ca0f6efa6dd3d561333fb14515065c2fafdf439c"
|
||||
integrity sha512-bCg29ictuBaKUwwArK4ouCaqDgLZcysCFLmM/Yn/FDoqndh/9vNuQfXRDvTuXKLxfD/JtZQGKFT8MGcJBK644g==
|
||||
dependencies:
|
||||
flat-cache "^2.0.1"
|
||||
|
||||
flat-cache@^2.0.1:
|
||||
version "2.0.1"
|
||||
resolved "https://registry.yarnpkg.com/flat-cache/-/flat-cache-2.0.1.tgz#5d296d6f04bda44a4630a301413bdbc2ec085ec0"
|
||||
integrity sha512-LoQe6yDuUMDzQAEH8sgmh4Md6oZnc/7PjtwjNFSzveXqSHt6ka9fPBuso7IGf9Rz4uqnSnWiFH2B/zj24a5ReA==
|
||||
dependencies:
|
||||
flatted "^2.0.0"
|
||||
rimraf "2.6.3"
|
||||
write "1.0.3"
|
||||
|
||||
flatted@^2.0.0:
|
||||
version "2.0.2"
|
||||
resolved "https://registry.yarnpkg.com/flatted/-/flatted-2.0.2.tgz#4575b21e2bcee7434aa9be662f4b7b5f9c2b5138"
|
||||
integrity sha512-r5wGx7YeOwNWNlCA0wQ86zKyDLMQr+/RB8xy74M4hTphfmjlijTSSXGuH8rnvKZnfT9i+75zmd8jcKdMR4O6jA==
|
||||
|
||||
fs.realpath@^1.0.0:
|
||||
version "1.0.0"
|
||||
resolved "https://registry.yarnpkg.com/fs.realpath/-/fs.realpath-1.0.0.tgz#1504ad2523158caa40db4a2787cb01411994ea4f"
|
||||
integrity sha1-FQStJSMVjKpA20onh8sBQRmU6k8=
|
||||
|
||||
functional-red-black-tree@^1.0.1:
|
||||
version "1.0.1"
|
||||
resolved "https://registry.yarnpkg.com/functional-red-black-tree/-/functional-red-black-tree-1.0.1.tgz#1b0ab3bd553b2a0d6399d29c0e3ea0b252078327"
|
||||
integrity sha1-GwqzvVU7Kg1jmdKcDj6gslIHgyc=
|
||||
|
||||
glob-parent@^5.0.0:
|
||||
version "5.1.1"
|
||||
resolved "https://registry.yarnpkg.com/glob-parent/-/glob-parent-5.1.1.tgz#b6c1ef417c4e5663ea498f1c45afac6916bbc229"
|
||||
integrity sha512-FnI+VGOpnlGHWZxthPGR+QhR78fuiK0sNLkHQv+bL9fQi57lNNdquIbna/WrfROrolq8GK5Ek6BiMwqL/voRYQ==
|
||||
dependencies:
|
||||
is-glob "^4.0.1"
|
||||
|
||||
glob@^7.1.3, glob@^7.1.6:
|
||||
version "7.1.6"
|
||||
resolved "https://registry.yarnpkg.com/glob/-/glob-7.1.6.tgz#141f33b81a7c2492e125594307480c46679278a6"
|
||||
integrity sha512-LwaxwyZ72Lk7vZINtNNrywX0ZuLyStrdDtabefZKAY5ZGJhVtgdznluResxNmPitE0SAO+O26sWTHeKSI2wMBA==
|
||||
dependencies:
|
||||
fs.realpath "^1.0.0"
|
||||
inflight "^1.0.4"
|
||||
inherits "2"
|
||||
minimatch "^3.0.4"
|
||||
once "^1.3.0"
|
||||
path-is-absolute "^1.0.0"
|
||||
|
||||
globals@^12.1.0:
|
||||
version "12.4.0"
|
||||
resolved "https://registry.yarnpkg.com/globals/-/globals-12.4.0.tgz#a18813576a41b00a24a97e7f815918c2e19925f8"
|
||||
integrity sha512-BWICuzzDvDoH54NHKCseDanAhE3CeDorgDL5MT6LMXXj2WCnd9UC2szdk4AWLfjdgNBCXLUanXYcpBBKOSWGwg==
|
||||
dependencies:
|
||||
type-fest "^0.8.1"
|
||||
|
||||
has-flag@^3.0.0:
|
||||
version "3.0.0"
|
||||
resolved "https://registry.yarnpkg.com/has-flag/-/has-flag-3.0.0.tgz#b5d454dc2199ae225699f3467e5a07f3b955bafd"
|
||||
integrity sha1-tdRU3CGZriJWmfNGfloH87lVuv0=
|
||||
|
||||
has-flag@^4.0.0:
|
||||
version "4.0.0"
|
||||
resolved "https://registry.yarnpkg.com/has-flag/-/has-flag-4.0.0.tgz#944771fd9c81c81265c4d6941860da06bb59479b"
|
||||
integrity sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==
|
||||
|
||||
ignore@^4.0.6:
|
||||
version "4.0.6"
|
||||
resolved "https://registry.yarnpkg.com/ignore/-/ignore-4.0.6.tgz#750e3db5862087b4737ebac8207ffd1ef27b25fc"
|
||||
integrity sha512-cyFDKrqc/YdcWFniJhzI42+AzS+gNwmUzOSFcRCQYwySuBBBy/KjuxWLZ/FHEH6Moq1NizMOBWyTcv8O4OZIMg==
|
||||
|
||||
import-fresh@^3.0.0:
|
||||
version "3.2.1"
|
||||
resolved "https://registry.yarnpkg.com/import-fresh/-/import-fresh-3.2.1.tgz#633ff618506e793af5ac91bf48b72677e15cbe66"
|
||||
integrity sha512-6e1q1cnWP2RXD9/keSkxHScg508CdXqXWgWBaETNhyuBFz+kUZlKboh+ISK+bU++DmbHimVBrOz/zzPe0sZ3sQ==
|
||||
dependencies:
|
||||
parent-module "^1.0.0"
|
||||
resolve-from "^4.0.0"
|
||||
|
||||
imurmurhash@^0.1.4:
|
||||
version "0.1.4"
|
||||
resolved "https://registry.yarnpkg.com/imurmurhash/-/imurmurhash-0.1.4.tgz#9218b9b2b928a238b13dc4fb6b6d576f231453ea"
|
||||
integrity sha1-khi5srkoojixPcT7a21XbyMUU+o=
|
||||
|
||||
inflight@^1.0.4:
|
||||
version "1.0.6"
|
||||
resolved "https://registry.yarnpkg.com/inflight/-/inflight-1.0.6.tgz#49bd6331d7d02d0c09bc910a1075ba8165b56df9"
|
||||
integrity sha1-Sb1jMdfQLQwJvJEKEHW6gWW1bfk=
|
||||
dependencies:
|
||||
once "^1.3.0"
|
||||
wrappy "1"
|
||||
|
||||
inherits@2:
|
||||
version "2.0.4"
|
||||
resolved "https://registry.yarnpkg.com/inherits/-/inherits-2.0.4.tgz#0fa2c64f932917c3433a0ded55363aae37416b7c"
|
||||
integrity sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ==
|
||||
|
||||
is-extglob@^2.1.1:
|
||||
version "2.1.1"
|
||||
resolved "https://registry.yarnpkg.com/is-extglob/-/is-extglob-2.1.1.tgz#a88c02535791f02ed37c76a1b9ea9773c833f8c2"
|
||||
integrity sha1-qIwCU1eR8C7TfHahueqXc8gz+MI=
|
||||
|
||||
is-fullwidth-code-point@^2.0.0:
|
||||
version "2.0.0"
|
||||
resolved "https://registry.yarnpkg.com/is-fullwidth-code-point/-/is-fullwidth-code-point-2.0.0.tgz#a3b30a5c4f199183167aaab93beefae3ddfb654f"
|
||||
integrity sha1-o7MKXE8ZkYMWeqq5O+764937ZU8=
|
||||
|
||||
is-glob@^4.0.0, is-glob@^4.0.1:
|
||||
version "4.0.1"
|
||||
resolved "https://registry.yarnpkg.com/is-glob/-/is-glob-4.0.1.tgz#7567dbe9f2f5e2467bc77ab83c4a29482407a5dc"
|
||||
integrity sha512-5G0tKtBTFImOqDnLB2hG6Bp2qcKEFduo4tZu9MT/H6NQv/ghhy30o55ufafxJ/LdH79LLs2Kfrn85TLKyA7BUg==
|
||||
dependencies:
|
||||
is-extglob "^2.1.1"
|
||||
|
||||
isexe@^2.0.0:
|
||||
version "2.0.0"
|
||||
resolved "https://registry.yarnpkg.com/isexe/-/isexe-2.0.0.tgz#e8fbf374dc556ff8947a10dcb0572d633f2cfa10"
|
||||
integrity sha1-6PvzdNxVb/iUehDcsFctYz8s+hA=
|
||||
|
||||
js-tokens@^4.0.0:
|
||||
version "4.0.0"
|
||||
resolved "https://registry.yarnpkg.com/js-tokens/-/js-tokens-4.0.0.tgz#19203fb59991df98e3a287050d4647cdeaf32499"
|
||||
integrity sha512-RdJUflcE3cUzKiMqQgsCu06FPu9UdIJO0beYbPhHN4k6apgJtifcoCtT9bcxOpYBtpD2kCM6Sbzg4CausW/PKQ==
|
||||
|
||||
js-yaml@^3.13.1:
|
||||
version "3.14.0"
|
||||
resolved "https://registry.yarnpkg.com/js-yaml/-/js-yaml-3.14.0.tgz#a7a34170f26a21bb162424d8adacb4113a69e482"
|
||||
integrity sha512-/4IbIeHcD9VMHFqDR/gQ7EdZdLimOvW2DdcxFjdyyZ9NsbS+ccrXqVWDtab/lRl5AlUqmpBx8EhPaWR+OtY17A==
|
||||
dependencies:
|
||||
argparse "^1.0.7"
|
||||
esprima "^4.0.0"
|
||||
|
||||
json-schema-traverse@^0.4.1:
|
||||
version "0.4.1"
|
||||
resolved "https://registry.yarnpkg.com/json-schema-traverse/-/json-schema-traverse-0.4.1.tgz#69f6a87d9513ab8bb8fe63bdb0979c448e684660"
|
||||
integrity sha512-xbbCH5dCYU5T8LcEhhuh7HJ88HXuW3qsI3Y0zOZFKfZEHcpWiHU/Jxzk629Brsab/mMiHQti9wMP+845RPe3Vg==
|
||||
|
||||
json-stable-stringify-without-jsonify@^1.0.1:
|
||||
version "1.0.1"
|
||||
resolved "https://registry.yarnpkg.com/json-stable-stringify-without-jsonify/-/json-stable-stringify-without-jsonify-1.0.1.tgz#9db7b59496ad3f3cfef30a75142d2d930ad72651"
|
||||
integrity sha1-nbe1lJatPzz+8wp1FC0tkwrXJlE=
|
||||
|
||||
levn@^0.4.1:
|
||||
version "0.4.1"
|
||||
resolved "https://registry.yarnpkg.com/levn/-/levn-0.4.1.tgz#ae4562c007473b932a6200d403268dd2fffc6ade"
|
||||
integrity sha512-+bT2uH4E5LGE7h/n3evcS/sQlJXCpIp6ym8OWJ5eV6+67Dsql/LaaT7qJBAt2rzfoa/5QBGBhxDix1dMt2kQKQ==
|
||||
dependencies:
|
||||
prelude-ls "^1.2.1"
|
||||
type-check "~0.4.0"
|
||||
|
||||
lodash@^4.17.14, lodash@^4.17.15, lodash@^4.17.19:
|
||||
version "4.17.20"
|
||||
resolved "https://registry.yarnpkg.com/lodash/-/lodash-4.17.20.tgz#b44a9b6297bcb698f1c51a3545a2b3b368d59c52"
|
||||
integrity sha512-PlhdFcillOINfeV7Ni6oF1TAEayyZBoZ8bcshTHqOYJYlrqzRK5hagpagky5o4HfCzzd1TRkXPMFq6cKk9rGmA==
|
||||
|
||||
minimatch@^3.0.4:
|
||||
version "3.0.4"
|
||||
resolved "https://registry.yarnpkg.com/minimatch/-/minimatch-3.0.4.tgz#5166e286457f03306064be5497e8dbb0c3d32083"
|
||||
integrity sha512-yJHVQEhyqPLUTgt9B83PXu6W3rx4MvvHvSUvToogpwoGDOUQ+yDrR0HRot+yOCdCO7u4hX3pWft6kWBBcqh0UA==
|
||||
dependencies:
|
||||
brace-expansion "^1.1.7"
|
||||
|
||||
minimist@^1.2.5:
|
||||
version "1.2.5"
|
||||
resolved "https://registry.yarnpkg.com/minimist/-/minimist-1.2.5.tgz#67d66014b66a6a8aaa0c083c5fd58df4e4e97602"
|
||||
integrity sha512-FM9nNUYrRBAELZQT3xeZQ7fmMOBg6nWNmJKTcgsJeaLstP/UODVpGsr5OhXhhXg6f+qtJ8uiZ+PUxkDWcgIXLw==
|
||||
|
||||
mkdirp@^0.5.1:
|
||||
version "0.5.5"
|
||||
resolved "https://registry.yarnpkg.com/mkdirp/-/mkdirp-0.5.5.tgz#d91cefd62d1436ca0f41620e251288d420099def"
|
||||
integrity sha512-NKmAlESf6jMGym1++R0Ra7wvhV+wFW63FaSOFPwRahvea0gMUcGUhVeAg/0BC0wiv9ih5NYPB1Wn1UEI1/L+xQ==
|
||||
dependencies:
|
||||
minimist "^1.2.5"
|
||||
|
||||
ms@^2.1.1:
|
||||
version "2.1.2"
|
||||
resolved "https://registry.yarnpkg.com/ms/-/ms-2.1.2.tgz#d09d1f357b443f493382a8eb3ccd183872ae6009"
|
||||
integrity sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w==
|
||||
|
||||
natural-compare@^1.4.0:
|
||||
version "1.4.0"
|
||||
resolved "https://registry.yarnpkg.com/natural-compare/-/natural-compare-1.4.0.tgz#4abebfeed7541f2c27acfb29bdbbd15c8d5ba4f7"
|
||||
integrity sha1-Sr6/7tdUHywnrPspvbvRXI1bpPc=
|
||||
|
||||
once@^1.3.0:
|
||||
version "1.4.0"
|
||||
resolved "https://registry.yarnpkg.com/once/-/once-1.4.0.tgz#583b1aa775961d4b113ac17d9c50baef9dd76bd1"
|
||||
integrity sha1-WDsap3WWHUsROsF9nFC6753Xa9E=
|
||||
dependencies:
|
||||
wrappy "1"
|
||||
|
||||
optionator@^0.9.1:
|
||||
version "0.9.1"
|
||||
resolved "https://registry.yarnpkg.com/optionator/-/optionator-0.9.1.tgz#4f236a6373dae0566a6d43e1326674f50c291499"
|
||||
integrity sha512-74RlY5FCnhq4jRxVUPKDaRwrVNXMqsGsiW6AJw4XK8hmtm10wC0ypZBLw5IIp85NZMr91+qd1RvvENwg7jjRFw==
|
||||
dependencies:
|
||||
deep-is "^0.1.3"
|
||||
fast-levenshtein "^2.0.6"
|
||||
levn "^0.4.1"
|
||||
prelude-ls "^1.2.1"
|
||||
type-check "^0.4.0"
|
||||
word-wrap "^1.2.3"
|
||||
|
||||
parent-module@^1.0.0:
|
||||
version "1.0.1"
|
||||
resolved "https://registry.yarnpkg.com/parent-module/-/parent-module-1.0.1.tgz#691d2709e78c79fae3a156622452d00762caaaa2"
|
||||
integrity sha512-GQ2EWRpQV8/o+Aw8YqtfZZPfNRWZYkbidE9k5rpl/hC3vtHHBfGm2Ifi6qWV+coDGkrUKZAxE3Lot5kcsRlh+g==
|
||||
dependencies:
|
||||
callsites "^3.0.0"
|
||||
|
||||
path-is-absolute@^1.0.0:
|
||||
version "1.0.1"
|
||||
resolved "https://registry.yarnpkg.com/path-is-absolute/-/path-is-absolute-1.0.1.tgz#174b9268735534ffbc7ace6bf53a5a9e1b5c5f5f"
|
||||
integrity sha1-F0uSaHNVNP+8es5r9TpanhtcX18=
|
||||
|
||||
path-key@^3.1.0:
|
||||
version "3.1.1"
|
||||
resolved "https://registry.yarnpkg.com/path-key/-/path-key-3.1.1.tgz#581f6ade658cbba65a0d3380de7753295054f375"
|
||||
integrity sha512-ojmeN0qd+y0jszEtoY48r0Peq5dwMEkIlCOu6Q5f41lfkswXuKtYrhgoTpLnyIcHm24Uhqx+5Tqm2InSwLhE6Q==
|
||||
|
||||
prelude-ls@^1.2.1:
|
||||
version "1.2.1"
|
||||
resolved "https://registry.yarnpkg.com/prelude-ls/-/prelude-ls-1.2.1.tgz#debc6489d7a6e6b0e7611888cec880337d316396"
|
||||
integrity sha512-vkcDPrRZo1QZLbn5RLGPpg/WmIQ65qoWWhcGKf/b5eplkkarX0m9z8ppCat4mlOqUsWpyNuYgO3VRyrYHSzX5g==
|
||||
|
||||
progress@^2.0.0:
|
||||
version "2.0.3"
|
||||
resolved "https://registry.yarnpkg.com/progress/-/progress-2.0.3.tgz#7e8cf8d8f5b8f239c1bc68beb4eb78567d572ef8"
|
||||
integrity sha512-7PiHtLll5LdnKIMw100I+8xJXR5gW2QwWYkT6iJva0bXitZKa/XMrSbdmg3r2Xnaidz9Qumd0VPaMrZlF9V9sA==
|
||||
|
||||
punycode@^2.1.0:
|
||||
version "2.1.1"
|
||||
resolved "https://registry.yarnpkg.com/punycode/-/punycode-2.1.1.tgz#b58b010ac40c22c5657616c8d2c2c02c7bf479ec"
|
||||
integrity sha512-XRsRjdf+j5ml+y/6GKHPZbrF/8p2Yga0JPtdqTIY2Xe5ohJPD9saDJJLPvp9+NSBprVvevdXZybnj2cv8OEd0A==
|
||||
|
||||
regexpp@^3.0.0, regexpp@^3.1.0:
|
||||
version "3.1.0"
|
||||
resolved "https://registry.yarnpkg.com/regexpp/-/regexpp-3.1.0.tgz#206d0ad0a5648cffbdb8ae46438f3dc51c9f78e2"
|
||||
integrity sha512-ZOIzd8yVsQQA7j8GCSlPGXwg5PfmA1mrq0JP4nGhh54LaKN3xdai/vHUDu74pKwV8OxseMS65u2NImosQcSD0Q==
|
||||
|
||||
resolve-from@^4.0.0:
|
||||
version "4.0.0"
|
||||
resolved "https://registry.yarnpkg.com/resolve-from/-/resolve-from-4.0.0.tgz#4abcd852ad32dd7baabfe9b40e00a36db5f392e6"
|
||||
integrity sha512-pb/MYmXstAkysRFx8piNI1tGFNQIFA3vkE3Gq4EuA1dF6gHp/+vgZqsCGJapvy8N3Q+4o7FwvquPJcnZ7RYy4g==
|
||||
|
||||
rimraf@2.6.3:
|
||||
version "2.6.3"
|
||||
resolved "https://registry.yarnpkg.com/rimraf/-/rimraf-2.6.3.tgz#b2d104fe0d8fb27cf9e0a1cda8262dd3833c6cab"
|
||||
integrity sha512-mwqeW5XsA2qAejG46gYdENaxXjx9onRNCfn7L0duuP4hCuTIi/QO7PDK07KJfp1d+izWPrzEJDcSqBa0OZQriA==
|
||||
dependencies:
|
||||
glob "^7.1.3"
|
||||
|
||||
semver@^7.2.1, semver@^7.3.2:
|
||||
version "7.3.2"
|
||||
resolved "https://registry.yarnpkg.com/semver/-/semver-7.3.2.tgz#604962b052b81ed0786aae84389ffba70ffd3938"
|
||||
integrity sha512-OrOb32TeeambH6UrhtShmF7CRDqhL6/5XpPNp2DuRH6+9QLw/orhp72j87v8Qa1ScDkvrrBNpZcDejAirJmfXQ==
|
||||
|
||||
shebang-command@^2.0.0:
|
||||
version "2.0.0"
|
||||
resolved "https://registry.yarnpkg.com/shebang-command/-/shebang-command-2.0.0.tgz#ccd0af4f8835fbdc265b82461aaf0c36663f34ea"
|
||||
integrity sha512-kHxr2zZpYtdmrN1qDjrrX/Z1rR1kG8Dx+gkpK1G4eXmvXswmcE1hTWBWYUzlraYw1/yZp6YuDY77YtvbN0dmDA==
|
||||
dependencies:
|
||||
shebang-regex "^3.0.0"
|
||||
|
||||
shebang-regex@^3.0.0:
|
||||
version "3.0.0"
|
||||
resolved "https://registry.yarnpkg.com/shebang-regex/-/shebang-regex-3.0.0.tgz#ae16f1644d873ecad843b0307b143362d4c42172"
|
||||
integrity sha512-7++dFhtcx3353uBaq8DDR4NuxBetBzC7ZQOhmTQInHEd6bSrXdiEyzCvG07Z44UYdLShWUyXt5M/yhz8ekcb1A==
|
||||
|
||||
slice-ansi@^2.1.0:
|
||||
version "2.1.0"
|
||||
resolved "https://registry.yarnpkg.com/slice-ansi/-/slice-ansi-2.1.0.tgz#cacd7693461a637a5788d92a7dd4fba068e81636"
|
||||
integrity sha512-Qu+VC3EwYLldKa1fCxuuvULvSJOKEgk9pi8dZeCVK7TqBfUNTH4sFkk4joj8afVSfAYgJoSOetjx9QWOJ5mYoQ==
|
||||
dependencies:
|
||||
ansi-styles "^3.2.0"
|
||||
astral-regex "^1.0.0"
|
||||
is-fullwidth-code-point "^2.0.0"
|
||||
|
||||
sprintf-js@~1.0.2:
|
||||
version "1.0.3"
|
||||
resolved "https://registry.yarnpkg.com/sprintf-js/-/sprintf-js-1.0.3.tgz#04e6926f662895354f3dd015203633b857297e2c"
|
||||
integrity sha1-BOaSb2YolTVPPdAVIDYzuFcpfiw=
|
||||
|
||||
string-width@^3.0.0:
|
||||
version "3.1.0"
|
||||
resolved "https://registry.yarnpkg.com/string-width/-/string-width-3.1.0.tgz#22767be21b62af1081574306f69ac51b62203961"
|
||||
integrity sha512-vafcv6KjVZKSgz06oM/H6GDBrAtz8vdhQakGjFIvNrHA6y3HCF1CInLy+QLq8dTJPQ1b+KDUqDFctkdRW44e1w==
|
||||
dependencies:
|
||||
emoji-regex "^7.0.1"
|
||||
is-fullwidth-code-point "^2.0.0"
|
||||
strip-ansi "^5.1.0"
|
||||
|
||||
strip-ansi@^5.1.0:
|
||||
version "5.2.0"
|
||||
resolved "https://registry.yarnpkg.com/strip-ansi/-/strip-ansi-5.2.0.tgz#8c9a536feb6afc962bdfa5b104a5091c1ad9c0ae"
|
||||
integrity sha512-DuRs1gKbBqsMKIZlrffwlug8MHkcnpjs5VPmL1PAh+mA30U0DTotfDZ0d2UUsXpPmPmMMJ6W773MaA3J+lbiWA==
|
||||
dependencies:
|
||||
ansi-regex "^4.1.0"
|
||||
|
||||
strip-ansi@^6.0.0:
|
||||
version "6.0.0"
|
||||
resolved "https://registry.yarnpkg.com/strip-ansi/-/strip-ansi-6.0.0.tgz#0b1571dd7669ccd4f3e06e14ef1eed26225ae532"
|
||||
integrity sha512-AuvKTrTfQNYNIctbR1K/YGTR1756GycPsg7b9bdV9Duqur4gv6aKqHXah67Z8ImS7WEz5QVcOtlfW2rZEugt6w==
|
||||
dependencies:
|
||||
ansi-regex "^5.0.0"
|
||||
|
||||
strip-json-comments@^3.1.0:
|
||||
version "3.1.1"
|
||||
resolved "https://registry.yarnpkg.com/strip-json-comments/-/strip-json-comments-3.1.1.tgz#31f1281b3832630434831c310c01cccda8cbe006"
|
||||
integrity sha512-6fPc+R4ihwqP6N/aIv2f1gMH8lOVtWQHoqC4yK6oSDVVocumAsfCqjkXnqiYMhmMwS/mEHLp7Vehlt3ql6lEig==
|
||||
|
||||
supports-color@^5.3.0:
|
||||
version "5.5.0"
|
||||
resolved "https://registry.yarnpkg.com/supports-color/-/supports-color-5.5.0.tgz#e2e69a44ac8772f78a1ec0b35b689df6530efc8f"
|
||||
integrity sha512-QjVjwdXIt408MIiAqCX4oUKsgU2EqAGzs2Ppkm4aQYbjm+ZEWEcW4SfFNTr4uMNZma0ey4f5lgLrkB0aX0QMow==
|
||||
dependencies:
|
||||
has-flag "^3.0.0"
|
||||
|
||||
supports-color@^7.1.0:
|
||||
version "7.1.0"
|
||||
resolved "https://registry.yarnpkg.com/supports-color/-/supports-color-7.1.0.tgz#68e32591df73e25ad1c4b49108a2ec507962bfd1"
|
||||
integrity sha512-oRSIpR8pxT1Wr2FquTNnGet79b3BWljqOuoW/h4oBhxJ/HUbX5nX6JSruTkvXDCFMwDPvsaTTbvMLKZWSy0R5g==
|
||||
dependencies:
|
||||
has-flag "^4.0.0"
|
||||
|
||||
table@^5.2.3:
|
||||
version "5.4.6"
|
||||
resolved "https://registry.yarnpkg.com/table/-/table-5.4.6.tgz#1292d19500ce3f86053b05f0e8e7e4a3bb21079e"
|
||||
integrity sha512-wmEc8m4fjnob4gt5riFRtTu/6+4rSe12TpAELNSqHMfF3IqnA+CH37USM6/YR3qRZv7e56kAEAtd6nKZaxe0Ug==
|
||||
dependencies:
|
||||
ajv "^6.10.2"
|
||||
lodash "^4.17.14"
|
||||
slice-ansi "^2.1.0"
|
||||
string-width "^3.0.0"
|
||||
|
||||
text-table@^0.2.0:
|
||||
version "0.2.0"
|
||||
resolved "https://registry.yarnpkg.com/text-table/-/text-table-0.2.0.tgz#7f5ee823ae805207c00af2df4a84ec3fcfa570b4"
|
||||
integrity sha1-f17oI66AUgfACvLfSoTsP8+lcLQ=
|
||||
|
||||
tslib@^1.8.1:
|
||||
version "1.13.0"
|
||||
resolved "https://registry.yarnpkg.com/tslib/-/tslib-1.13.0.tgz#c881e13cc7015894ed914862d276436fa9a47043"
|
||||
integrity sha512-i/6DQjL8Xf3be4K/E6Wgpekn5Qasl1usyw++dAA35Ue5orEn65VIxOA+YvNNl9HV3qv70T7CNwjODHZrLwvd1Q==
|
||||
|
||||
tsutils@^3.17.1:
|
||||
version "3.17.1"
|
||||
resolved "https://registry.yarnpkg.com/tsutils/-/tsutils-3.17.1.tgz#ed719917f11ca0dee586272b2ac49e015a2dd759"
|
||||
integrity sha512-kzeQ5B8H3w60nFY2g8cJIuH7JDpsALXySGtwGJ0p2LSjLgay3NdIpqq5SoOBe46bKDW2iq25irHCr8wjomUS2g==
|
||||
dependencies:
|
||||
tslib "^1.8.1"
|
||||
|
||||
type-check@^0.4.0, type-check@~0.4.0:
|
||||
version "0.4.0"
|
||||
resolved "https://registry.yarnpkg.com/type-check/-/type-check-0.4.0.tgz#07b8203bfa7056c0657050e3ccd2c37730bab8f1"
|
||||
integrity sha512-XleUoc9uwGXqjWwXaUTZAmzMcFZ5858QA2vvx1Ur5xIcixXIP+8LnFDgRplU30us6teqdlskFfu+ae4K79Ooew==
|
||||
dependencies:
|
||||
prelude-ls "^1.2.1"
|
||||
|
||||
type-fest@^0.8.1:
|
||||
version "0.8.1"
|
||||
resolved "https://registry.yarnpkg.com/type-fest/-/type-fest-0.8.1.tgz#09e249ebde851d3b1e48d27c105444667f17b83d"
|
||||
integrity sha512-4dbzIzqvjtgiM5rw1k5rEHtBANKmdudhGyBEajN01fEyhaAIhsoKNy6y7+IN93IfpFtwY9iqi7kD+xwKhQsNJA==
|
||||
|
||||
typescript@^4.0.2:
|
||||
version "4.0.2"
|
||||
resolved "https://registry.yarnpkg.com/typescript/-/typescript-4.0.2.tgz#7ea7c88777c723c681e33bf7988be5d008d05ac2"
|
||||
integrity sha512-e4ERvRV2wb+rRZ/IQeb3jm2VxBsirQLpQhdxplZ2MEzGvDkkMmPglecnNDfSUBivMjP93vRbngYYDQqQ/78bcQ==
|
||||
|
||||
uri-js@^4.2.2:
|
||||
version "4.2.2"
|
||||
resolved "https://registry.yarnpkg.com/uri-js/-/uri-js-4.2.2.tgz#94c540e1ff772956e2299507c010aea6c8838eb0"
|
||||
integrity sha512-KY9Frmirql91X2Qgjry0Wd4Y+YTdrdZheS8TFwvkbLWf/G5KNJDCh6pKL5OZctEW4+0Baa5idK2ZQuELRwPznQ==
|
||||
dependencies:
|
||||
punycode "^2.1.0"
|
||||
|
||||
v8-compile-cache@^2.0.3:
|
||||
version "2.1.1"
|
||||
resolved "https://registry.yarnpkg.com/v8-compile-cache/-/v8-compile-cache-2.1.1.tgz#54bc3cdd43317bca91e35dcaf305b1a7237de745"
|
||||
integrity sha512-8OQ9CL+VWyt3JStj7HX7/ciTL2V3Rl1Wf5OL+SNTm0yK1KvtReVulksyeRnCANHHuUxHlQig+JJDlUhBt1NQDQ==
|
||||
|
||||
which@^2.0.1:
|
||||
version "2.0.2"
|
||||
resolved "https://registry.yarnpkg.com/which/-/which-2.0.2.tgz#7c6a8dd0a636a0327e10b59c9286eee93f3f51b1"
|
||||
integrity sha512-BLI3Tl1TW3Pvl70l3yq3Y64i+awpwXqsGBYWkkqMtnbXgrMD+yj7rhW0kuEDxzJaYXGjEW5ogapKNMEKNMjibA==
|
||||
dependencies:
|
||||
isexe "^2.0.0"
|
||||
|
||||
word-wrap@^1.2.3:
|
||||
version "1.2.3"
|
||||
resolved "https://registry.yarnpkg.com/word-wrap/-/word-wrap-1.2.3.tgz#610636f6b1f703891bd34771ccb17fb93b47079c"
|
||||
integrity sha512-Hz/mrNwitNRh/HUAtM/VT/5VH+ygD6DV7mYKZAtHOrbs8U7lvPS6xf7EJKMF0uW1KJCl0H701g3ZGus+muE5vQ==
|
||||
|
||||
wrappy@1:
|
||||
version "1.0.2"
|
||||
resolved "https://registry.yarnpkg.com/wrappy/-/wrappy-1.0.2.tgz#b5243d8f3ec1aa35f1364605bc0d1036e30ab69f"
|
||||
integrity sha1-tSQ9jz7BqjXxNkYFvA0QNuMKtp8=
|
||||
|
||||
write@1.0.3:
|
||||
version "1.0.3"
|
||||
resolved "https://registry.yarnpkg.com/write/-/write-1.0.3.tgz#0800e14523b923a387e415123c865616aae0f5c3"
|
||||
integrity sha512-/lg70HAjtkUgWPVZhZcm+T4hkL8Zbtp1nFNOn3lRrxnlv50SRBv7cR7RqR+GMsd3hUXy9hWBo4CHTbFTcOYwig==
|
||||
dependencies:
|
||||
mkdirp "^0.5.1"
|
||||
Reference in New Issue
Block a user