From 24d8037c47262876f2a2a24ffa5d8cc98c884407 Mon Sep 17 00:00:00 2001 From: Vlad Frangu Date: Sun, 11 Apr 2021 21:45:23 +0300 Subject: [PATCH] feat(*): Polish Week - Discord API Types Edition (#110) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: Antonio Román Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> --- .gitignore | 54 +- .npmrc | 2 + CHANGELOG.md | 289 +++ README.md | 56 +- common/index.ts | 226 -- default/index.ts | 4 - deno/README.md | 56 +- deno/common/mod.ts | 226 -- deno/gateway/common.ts | 8 + deno/gateway/mod.ts | 4 + deno/{v6/gateway/mod.ts => gateway/v6.ts} | 4 +- deno/{v8/gateway/mod.ts => gateway/v8.ts} | 226 +- deno/globals.ts | 70 + deno/payloads/mod.ts | 4 + deno/{v6/payloads => payloads/v6}/auditLog.ts | 0 deno/{v6/payloads => payloads/v6}/channel.ts | 0 deno/{v6/payloads => payloads/v6}/emoji.ts | 0 deno/{v6/payloads => payloads/v6}/gateway.ts | 0 deno/{v6/payloads => payloads/v6}/guild.ts | 0 deno/{v6/payloads => payloads/v6}/invite.ts | 0 deno/{v6/payloads => payloads/v6}/mod.ts | 0 deno/{v6/payloads => payloads/v6}/oauth2.ts | 0 .../payloads => payloads/v6}/permissions.ts | 0 deno/{v6/payloads => payloads/v6}/teams.ts | 0 deno/{v6/payloads => payloads/v6}/user.ts | 0 deno/{v6/payloads => payloads/v6}/voice.ts | 0 deno/{v6/payloads => payloads/v6}/webhook.ts | 0 deno/{v8/payloads => payloads/v8}/auditLog.ts | 5 +- deno/{v8/payloads => payloads/v8}/channel.ts | 41 +- deno/{v8/payloads => payloads/v8}/emoji.ts | 2 +- deno/{v8/payloads => payloads/v8}/gateway.ts | 11 +- deno/{v8/payloads => payloads/v8}/guild.ts | 6 +- .../payloads => payloads/v8}/interactions.ts | 106 +- deno/{v8/payloads => payloads/v8}/invite.ts | 20 +- deno/{v8/payloads => payloads/v8}/mod.ts | 0 deno/{v8/payloads => payloads/v8}/oauth2.ts | 18 +- .../payloads/v8}/permissions.ts | 4 +- deno/{v8/payloads => payloads/v8}/teams.ts | 2 +- deno/{v8/payloads => payloads/v8}/template.ts | 4 +- deno/{v8/payloads => payloads/v8}/user.ts | 3 +- deno/{v8/payloads => payloads/v8}/voice.ts | 2 +- deno/{v8/payloads => payloads/v8}/webhook.ts | 12 +- deno/rest/common.ts | 112 + deno/rest/mod.ts | 4 + {v6/rest => deno/rest/v6}/auditLog.ts | 2 +- deno/{v6/rest => rest/v6}/channel.ts | 2 +- {v6/rest => deno/rest/v6}/emoji.ts | 2 +- deno/{v6/rest => rest/v6}/gateway.ts | 2 +- deno/{v6/rest => rest/v6}/guild.ts | 2 +- deno/{v6/rest => rest/v6}/invite.ts | 2 +- deno/{v6/rest => rest/v6}/mod.ts | 2 + {v6/rest => deno/rest/v6}/oauth2.ts | 2 +- deno/{v6/rest => rest/v6}/user.ts | 2 +- deno/{v6/rest => rest/v6}/voice.ts | 2 +- deno/{v6/rest => rest/v6}/webhook.ts | 2 +- deno/{v8/rest => rest/v8}/auditLog.ts | 4 +- deno/{v8/rest => rest/v8}/channel.ts | 24 +- deno/{v8/rest => rest/v8}/emoji.ts | 4 +- deno/{v8/rest => rest/v8}/gateway.ts | 2 +- deno/{v8/rest => rest/v8}/guild.ts | 68 +- deno/{v8/rest => rest/v8}/interactions.ts | 62 +- deno/{v8/rest => rest/v8}/invite.ts | 2 +- deno/{v8/rest => rest/v8}/mod.ts | 44 +- {v8/rest => deno/rest/v8}/oauth2.ts | 7 +- deno/{v8/rest => rest/v8}/template.ts | 2 +- deno/{v8/rest => rest/v8}/user.ts | 4 +- {v8/rest => deno/rest/v8}/voice.ts | 2 +- deno/{v8/rest => rest/v8}/webhook.ts | 20 +- deno/rpc/mod.ts | 4 + deno/rpc/v8.ts | 33 + deno/shortcuts/v6.ts | 4 + deno/shortcuts/v8.ts | 6 + deno/utils/mod.ts | 4 + deno/utils/v8.ts | 48 + deno/v6/mod.ts | 4 - deno/v8/mod.ts | 4 - deno/voice/mod.ts | 4 + deno/voice/v4.ts | 109 + gateway/common.ts | 8 + gateway/index.ts | 4 + v6/gateway/index.ts => gateway/v6.ts | 4 +- v8/gateway/index.ts => gateway/v8.ts | 226 +- globals.ts | 70 + package-lock.json | 2294 +++++++++++++++-- package.json | 123 +- payloads/index.ts | 4 + {v6/payloads => payloads/v6}/auditLog.ts | 0 {v6/payloads => payloads/v6}/channel.ts | 0 {v6/payloads => payloads/v6}/emoji.ts | 0 {v6/payloads => payloads/v6}/gateway.ts | 0 {v6/payloads => payloads/v6}/guild.ts | 0 {v6/payloads => payloads/v6}/index.ts | 0 {v6/payloads => payloads/v6}/invite.ts | 0 {v6/payloads => payloads/v6}/oauth2.ts | 0 {v6/payloads => payloads/v6}/permissions.ts | 0 {v6/payloads => payloads/v6}/teams.ts | 0 {v6/payloads => payloads/v6}/user.ts | 0 {v6/payloads => payloads/v6}/voice.ts | 0 {v6/payloads => payloads/v6}/webhook.ts | 0 {v8/payloads => payloads/v8}/auditLog.ts | 5 +- {v8/payloads => payloads/v8}/channel.ts | 41 +- {v8/payloads => payloads/v8}/emoji.ts | 2 +- {v8/payloads => payloads/v8}/gateway.ts | 11 +- {v8/payloads => payloads/v8}/guild.ts | 6 +- {v8/payloads => payloads/v8}/index.ts | 0 {v8/payloads => payloads/v8}/interactions.ts | 106 +- {v8/payloads => payloads/v8}/invite.ts | 20 +- {v8/payloads => payloads/v8}/oauth2.ts | 18 +- .../payloads => payloads/v8}/permissions.ts | 4 +- {v8/payloads => payloads/v8}/teams.ts | 2 +- {v8/payloads => payloads/v8}/template.ts | 4 +- {v8/payloads => payloads/v8}/user.ts | 3 +- {v8/payloads => payloads/v8}/voice.ts | 2 +- {v8/payloads => payloads/v8}/webhook.ts | 12 +- rest/common.ts | 112 + rest/index.ts | 4 + {deno/v6/rest => rest/v6}/auditLog.ts | 2 +- {v6/rest => rest/v6}/channel.ts | 2 +- {deno/v6/rest => rest/v6}/emoji.ts | 2 +- {v6/rest => rest/v6}/gateway.ts | 2 +- {v6/rest => rest/v6}/guild.ts | 2 +- {v6/rest => rest/v6}/index.ts | 2 + {v6/rest => rest/v6}/invite.ts | 2 +- {deno/v6/rest => rest/v6}/oauth2.ts | 2 +- {v6/rest => rest/v6}/user.ts | 2 +- {v6/rest => rest/v6}/voice.ts | 2 +- {v6/rest => rest/v6}/webhook.ts | 2 +- {v8/rest => rest/v8}/auditLog.ts | 4 +- {v8/rest => rest/v8}/channel.ts | 24 +- {v8/rest => rest/v8}/emoji.ts | 4 +- {v8/rest => rest/v8}/gateway.ts | 2 +- {v8/rest => rest/v8}/guild.ts | 68 +- {v8/rest => rest/v8}/index.ts | 44 +- {v8/rest => rest/v8}/interactions.ts | 62 +- {v8/rest => rest/v8}/invite.ts | 2 +- {deno/v8/rest => rest/v8}/oauth2.ts | 7 +- {v8/rest => rest/v8}/template.ts | 2 +- {v8/rest => rest/v8}/user.ts | 4 +- {deno/v8/rest => rest/v8}/voice.ts | 2 +- {v8/rest => rest/v8}/webhook.ts | 20 +- rpc/index.ts | 4 + rpc/v8.ts | 33 + scripts/deno.mjs | 17 +- scripts/versions.mjs | 35 + shortcuts/v6.ts | 4 + shortcuts/v8.ts | 6 + tsconfig.eslint.json | 13 +- tsconfig.json | 13 +- utils/index.ts | 4 + utils/v8.ts | 48 + v6/index.ts | 4 - v8/index.ts | 4 - voice/index.ts | 4 + voice/v4.ts | 109 + 154 files changed, 4257 insertions(+), 1461 deletions(-) create mode 100644 CHANGELOG.md delete mode 100644 common/index.ts delete mode 100644 default/index.ts delete mode 100644 deno/common/mod.ts create mode 100644 deno/gateway/common.ts create mode 100644 deno/gateway/mod.ts rename deno/{v6/gateway/mod.ts => gateway/v6.ts} (99%) rename deno/{v8/gateway/mod.ts => gateway/v8.ts} (93%) create mode 100644 deno/globals.ts create mode 100644 deno/payloads/mod.ts rename deno/{v6/payloads => payloads/v6}/auditLog.ts (100%) rename deno/{v6/payloads => payloads/v6}/channel.ts (100%) rename deno/{v6/payloads => payloads/v6}/emoji.ts (100%) rename deno/{v6/payloads => payloads/v6}/gateway.ts (100%) rename deno/{v6/payloads => payloads/v6}/guild.ts (100%) rename deno/{v6/payloads => payloads/v6}/invite.ts (100%) rename deno/{v6/payloads => payloads/v6}/mod.ts (100%) rename deno/{v6/payloads => payloads/v6}/oauth2.ts (100%) rename deno/{v6/payloads => payloads/v6}/permissions.ts (100%) rename deno/{v6/payloads => payloads/v6}/teams.ts (100%) rename deno/{v6/payloads => payloads/v6}/user.ts (100%) rename deno/{v6/payloads => payloads/v6}/voice.ts (100%) rename deno/{v6/payloads => payloads/v6}/webhook.ts (100%) rename deno/{v8/payloads => payloads/v8}/auditLog.ts (98%) rename deno/{v8/payloads => payloads/v8}/channel.ts (97%) rename deno/{v8/payloads => payloads/v8}/emoji.ts (94%) rename deno/{v8/payloads => payloads/v8}/gateway.ts (96%) rename deno/{v8/payloads => payloads/v8}/guild.ts (99%) rename deno/{v8/payloads => payloads/v8}/interactions.ts (80%) rename deno/{v8/payloads => payloads/v8}/invite.ts (74%) rename deno/{v8/payloads => payloads/v8}/mod.ts (100%) rename deno/{v8/payloads => payloads/v8}/oauth2.ts (94%) rename {v8/payloads => deno/payloads/v8}/permissions.ts (96%) rename deno/{v8/payloads => payloads/v8}/teams.ts (96%) rename deno/{v8/payloads => payloads/v8}/template.ts (91%) rename deno/{v8/payloads => payloads/v8}/user.ts (97%) rename deno/{v8/payloads => payloads/v8}/voice.ts (97%) rename deno/{v8/payloads => payloads/v8}/webhook.ts (80%) create mode 100644 deno/rest/common.ts create mode 100644 deno/rest/mod.ts rename {v6/rest => deno/rest/v6}/auditLog.ts (85%) rename deno/{v6/rest => rest/v6}/channel.ts (99%) rename {v6/rest => deno/rest/v6}/emoji.ts (96%) rename deno/{v6/rest => rest/v6}/gateway.ts (85%) rename deno/{v6/rest => rest/v6}/guild.ts (99%) rename deno/{v6/rest => rest/v6}/invite.ts (91%) rename deno/{v6/rest => rest/v6}/mod.ts (99%) rename {v6/rest => deno/rest/v6}/oauth2.ts (98%) rename deno/{v6/rest => rest/v6}/user.ts (98%) rename deno/{v6/rest => rest/v6}/voice.ts (79%) rename deno/{v6/rest => rest/v6}/webhook.ts (98%) rename deno/{v8/rest => rest/v8}/auditLog.ts (80%) rename deno/{v8/rest => rest/v8}/channel.ts (95%) rename deno/{v8/rest => rest/v8}/emoji.ts (92%) rename deno/{v8/rest => rest/v8}/gateway.ts (76%) rename deno/{v8/rest => rest/v8}/guild.ts (94%) rename deno/{v8/rest => rest/v8}/interactions.ts (55%) rename deno/{v8/rest => rest/v8}/invite.ts (87%) rename deno/{v8/rest => rest/v8}/mod.ts (93%) rename {v8/rest => deno/rest/v8}/oauth2.ts (97%) rename deno/{v8/rest => rest/v8}/template.ts (96%) rename deno/{v8/rest => rest/v8}/user.ts (95%) rename {v8/rest => deno/rest/v8}/voice.ts (68%) rename deno/{v8/rest => rest/v8}/webhook.ts (94%) create mode 100644 deno/rpc/mod.ts create mode 100644 deno/rpc/v8.ts create mode 100644 deno/shortcuts/v6.ts create mode 100644 deno/shortcuts/v8.ts create mode 100644 deno/utils/mod.ts create mode 100644 deno/utils/v8.ts delete mode 100644 deno/v6/mod.ts delete mode 100644 deno/v8/mod.ts create mode 100644 deno/voice/mod.ts create mode 100644 deno/voice/v4.ts create mode 100644 gateway/common.ts create mode 100644 gateway/index.ts rename v6/gateway/index.ts => gateway/v6.ts (99%) rename v8/gateway/index.ts => gateway/v8.ts (93%) create mode 100644 globals.ts create mode 100644 payloads/index.ts rename {v6/payloads => payloads/v6}/auditLog.ts (100%) rename {v6/payloads => payloads/v6}/channel.ts (100%) rename {v6/payloads => payloads/v6}/emoji.ts (100%) rename {v6/payloads => payloads/v6}/gateway.ts (100%) rename {v6/payloads => payloads/v6}/guild.ts (100%) rename {v6/payloads => payloads/v6}/index.ts (100%) rename {v6/payloads => payloads/v6}/invite.ts (100%) rename {v6/payloads => payloads/v6}/oauth2.ts (100%) rename {v6/payloads => payloads/v6}/permissions.ts (100%) rename {v6/payloads => payloads/v6}/teams.ts (100%) rename {v6/payloads => payloads/v6}/user.ts (100%) rename {v6/payloads => payloads/v6}/voice.ts (100%) rename {v6/payloads => payloads/v6}/webhook.ts (100%) rename {v8/payloads => payloads/v8}/auditLog.ts (98%) rename {v8/payloads => payloads/v8}/channel.ts (97%) rename {v8/payloads => payloads/v8}/emoji.ts (94%) rename {v8/payloads => payloads/v8}/gateway.ts (96%) rename {v8/payloads => payloads/v8}/guild.ts (99%) rename {v8/payloads => payloads/v8}/index.ts (100%) rename {v8/payloads => payloads/v8}/interactions.ts (80%) rename {v8/payloads => payloads/v8}/invite.ts (74%) rename {v8/payloads => payloads/v8}/oauth2.ts (94%) rename {deno/v8/payloads => payloads/v8}/permissions.ts (96%) rename {v8/payloads => payloads/v8}/teams.ts (96%) rename {v8/payloads => payloads/v8}/template.ts (91%) rename {v8/payloads => payloads/v8}/user.ts (97%) rename {v8/payloads => payloads/v8}/voice.ts (97%) rename {v8/payloads => payloads/v8}/webhook.ts (80%) create mode 100644 rest/common.ts create mode 100644 rest/index.ts rename {deno/v6/rest => rest/v6}/auditLog.ts (86%) rename {v6/rest => rest/v6}/channel.ts (99%) rename {deno/v6/rest => rest/v6}/emoji.ts (96%) rename {v6/rest => rest/v6}/gateway.ts (85%) rename {v6/rest => rest/v6}/guild.ts (99%) rename {v6/rest => rest/v6}/index.ts (99%) rename {v6/rest => rest/v6}/invite.ts (91%) rename {deno/v6/rest => rest/v6}/oauth2.ts (98%) rename {v6/rest => rest/v6}/user.ts (98%) rename {v6/rest => rest/v6}/voice.ts (79%) rename {v6/rest => rest/v6}/webhook.ts (98%) rename {v8/rest => rest/v8}/auditLog.ts (80%) rename {v8/rest => rest/v8}/channel.ts (95%) rename {v8/rest => rest/v8}/emoji.ts (92%) rename {v8/rest => rest/v8}/gateway.ts (76%) rename {v8/rest => rest/v8}/guild.ts (94%) rename {v8/rest => rest/v8}/index.ts (93%) rename {v8/rest => rest/v8}/interactions.ts (55%) rename {v8/rest => rest/v8}/invite.ts (87%) rename {deno/v8/rest => rest/v8}/oauth2.ts (97%) rename {v8/rest => rest/v8}/template.ts (96%) rename {v8/rest => rest/v8}/user.ts (95%) rename {deno/v8/rest => rest/v8}/voice.ts (68%) rename {v8/rest => rest/v8}/webhook.ts (95%) create mode 100644 rpc/index.ts create mode 100644 rpc/v8.ts create mode 100644 scripts/versions.mjs create mode 100644 shortcuts/v6.ts create mode 100644 shortcuts/v8.ts create mode 100644 utils/index.ts create mode 100644 utils/v8.ts delete mode 100644 v6/index.ts delete mode 100644 v8/index.ts create mode 100644 voice/index.ts create mode 100644 voice/v4.ts diff --git a/.gitignore b/.gitignore index f28c7257..be36f14b 100644 --- a/.gitignore +++ b/.gitignore @@ -1,24 +1,42 @@ node_modules/ -out/ -coverage/ -.nyc_output/ - -debug.log - # Don't commit build outputs +globals.js +globals.*map +globals.d.ts +globals.mjs -v*/**/*.js -v*/**/*.map -v*/**/*.d.ts -v*/**/*.mjs +gateway/**/*.js +gateway/**/*.map +gateway/**/*.d.ts +gateway/**/*.mjs -default/*.js -default/*.map -default/*.d.ts -default/*.mjs +payloads/**/*.js +payloads/**/*.map +payloads/**/*.d.ts +payloads/**/*.mjs -common/*.js -common/*.map -common/*.d.ts -common/*.mjs +rest/**/*.js +rest/**/*.map +rest/**/*.d.ts +rest/**/*.mjs + +rpc/**/*.js +rpc/**/*.map +rpc/**/*.d.ts +rpc/**/*.mjs + +shortcuts/**/*.js +shortcuts/**/*.map +shortcuts/**/*.d.ts +shortcuts/**/*.mjs + +utils/**/*.js +utils/**/*.map +utils/**/*.d.ts +utils/**/*.mjs + +voice/**/*.js +voice/**/*.map +voice/**/*.d.ts +voice/**/*.mjs diff --git a/.npmrc b/.npmrc index 81a88365..af41443c 100644 --- a/.npmrc +++ b/.npmrc @@ -1,3 +1,5 @@ audit=false fund=false legacy-peer-deps=true +tag-version-prefix="" +message="chore(release): %s :tada:" diff --git a/CHANGELOG.md b/CHANGELOG.md new file mode 100644 index 00000000..9c0c5beb --- /dev/null +++ b/CHANGELOG.md @@ -0,0 +1,289 @@ +# [0.14.0](https://github.com/discordjs/discord-api-types/compare/0.13.3...0.14.0) (2021-04-11) + +### Bug Fixes + +- **APIMessage:** correct type for `application` ([ed2cbe8](https://github.com/discordjs/discord-api-types/commit/ed2cbe82c56f872ee01a9eb6991ef70dc22d8c1f)) +- **GatewayGuildMemberUpdateDispatchData:** correct types ([14f14e2](https://github.com/discordjs/discord-api-types/commit/14f14e227955af41ed2823f11c6e8d03d12549ba)) +- **GatewayPresenceUpdateData:** `activities` may not be `null` ([bb3cb04](https://github.com/discordjs/discord-api-types/commit/bb3cb04e016840f66eecbe39c2e07aea8ea12bc8)) +- **GatewayVoiceServerUpdateDispatchData:** `endpoint` is nullable ([e8203a1](https://github.com/discordjs/discord-api-types/commit/e8203a1112a834ce9aaae4ab95f711d3aaffc20f)) +- **GuildWelcomeScreenChannel:** document missing `description` property ([238695b](https://github.com/discordjs/discord-api-types/commit/238695b44d8547d51782e3d9d9729e2db85bc444)) +- **OAuth2:** `scope` can be optional / not required ([bbe56a9](https://github.com/discordjs/discord-api-types/commit/bbe56a97564ce8c317f291080327484f0d987e1c)) +- **OAuth2:** remove invalid parameters from refresh token request ([1c02450](https://github.com/discordjs/discord-api-types/commit/1c024507f3f55b922565845c2bedac615ffa24d5)) +- **RPC:** version `RPC` same as` rest`, export again in `shortcuts` ([67e0ba1](https://github.com/discordjs/discord-api-types/commit/67e0ba1834e6d9de9ad00bd452f5e8da59ff1cc6)) +- **Utils:** correct import for deno users ([42dd75f](https://github.com/discordjs/discord-api-types/commit/42dd75f2581b2a8862e4f0446b42ff838f923de0)) + +### chore + +- **Gateway:** remove `guild_subscriptions` ([ab8b289](https://github.com/discordjs/discord-api-types/commit/ab8b289ac8f99fe1a998ef06320ad9046aafa1d2)) +- **GatewayReady:** un-document `private_channels` ([457edf4](https://github.com/discordjs/discord-api-types/commit/457edf4ed43327fb871d3b1638745b905518ef91)) +- **Integrations:** remove routes that bots can no longer interact with ([577c5bd](https://github.com/discordjs/discord-api-types/commit/577c5bd040dd1dc258ca6c414cf6ac69ae84916c)) +- **MessageGetReactions:** remove `before` pagination ([0ec26b7](https://github.com/discordjs/discord-api-types/commit/0ec26b731cda570f34e59e05a8c21f272b1fd64e)) +- **Oauth2Scopes:** remove `rpc.api` ([7ee8511](https://github.com/discordjs/discord-api-types/commit/7ee85113ea8107106460889a2eaa42b251ee05d0)) +- **Permissions:** rename `USE_APPLICATION_COMMANDS` to `USE_SLASH_COMMANDS` ([2aa7f7a](https://github.com/discordjs/discord-api-types/commit/2aa7f7a7b8da3d4d46a7743830562d996d32120b)) +- **UserFlags:** un-document `SYSTEM` flag ([1774d4c](https://github.com/discordjs/discord-api-types/commit/1774d4c4749d303f24bfb3c754cf79a4ca7ef699)) + +### Code Refactoring + +- restructure module ([81cdfc2](https://github.com/discordjs/discord-api-types/commit/81cdfc2d9c523d98edd0a69f976879e848e1167b)) + +### Features + +- **APIApplication:** document `terms_of_service` and `privacy_policy` ([598cbfb](https://github.com/discordjs/discord-api-types/commit/598cbfb958a67d5ba61696ba877ea0bae4c4be55)) +- **APIAttachment:** add `content_type` ([2d432d1](https://github.com/discordjs/discord-api-types/commit/2d432d145eb8a009b092b27b6231252d7b2f2823)) +- **APIChannel:** add `rtc_region` ([#108](https://github.com/discordjs/discord-api-types/issues/108)) ([07ba907](https://github.com/discordjs/discord-api-types/commit/07ba9072429dec85a13479dc211ec1f9d8788acf)) +- **APIChannel:** add `video_quality_mode` ([#106](https://github.com/discordjs/discord-api-types/issues/106)) ([d8d7bcc](https://github.com/discordjs/discord-api-types/commit/d8d7bccea617ad0d1150b9d2aed3b26ec1e4f99a)) +- **APIInteraction:** add type-check utilities ([3307201](https://github.com/discordjs/discord-api-types/commit/33072011c2ea9ace8350dedc0cd1068660dc2ece)) +- **Exports:** add `globals` to the exported sub-modules ([5d35f61](https://github.com/discordjs/discord-api-types/commit/5d35f61334480af983c4767373ef05e395da2e18)) +- **Gateway:** add `INTEGRATION_*` events ([9c3fab0](https://github.com/discordjs/discord-api-types/commit/9c3fab052619609eb543ff400c2b813b69c6b99f)) +- **GuildWelcomeScreen:** document `welcome-screen` endpoint ([169ecde](https://github.com/discordjs/discord-api-types/commit/169ecde47a6a911309630e952ab26b805ac87cf0)) +- **Interactions:** add batch command create / update ([edfe70a](https://github.com/discordjs/discord-api-types/commit/edfe70a1eeec9be1104ec68a20d95e83512b3268)) +- **Interactions:** add Slash Command Permissions ([f517f35](https://github.com/discordjs/discord-api-types/commit/f517f3596f458a2c2e4c4a26d5c13bbed4c4a71f)) +- **Invites:** document `target_application` & correct property names ([97c8ab3](https://github.com/discordjs/discord-api-types/commit/97c8ab3f5165c6f161e9338e944cff8b296756d5)) +- **MessageFlags:** `EPHEMERAL` desc and added `LOADING` ([#109](https://github.com/discordjs/discord-api-types/issues/109)) ([4462255](https://github.com/discordjs/discord-api-types/commit/4462255168af2ad66c9c7405500e80d3fa41de33)) +- **PatchAPIWebhookMessage:** add `file` property ([fc2f3c5](https://github.com/discordjs/discord-api-types/commit/fc2f3c58cf5ea2a8c0a1a14a62a16f432b1776e2)) +- **Webhook:** add & document `url` property ([77e5bb6](https://github.com/discordjs/discord-api-types/commit/77e5bb624d86e4bc8696c8dac4f513c27eb8aff1)) +- invite reminder system message type and flag ([#105](https://github.com/discordjs/discord-api-types/issues/105)) ([b90714f](https://github.com/discordjs/discord-api-types/commit/b90714f677c67c009ddb6d00734ab8998c194350)) +- stage channels! ([#107](https://github.com/discordjs/discord-api-types/issues/107)) ([6cd7542](https://github.com/discordjs/discord-api-types/commit/6cd75426c6d7da145b40a656e4c1a1d3d26bfb1f)) + +### BREAKING CHANGES + +- **APIInteraction:** This commit removes the `guild_id` property from `APIDMInteraction` + which allows type-checks to work with the `in` operator. + Because of that, we also provide utility functions that help with those type checks. + Use them in your code by importing the `Utils` object, or by directly importing them. + Check the README for examples +- **OAuth2:** This commit removes parameters that are not expected + in the refresh token request body + +Reference: https://github.com/discord/discord-api-docs/commit/eaa12cbc8f96cf7cfe8c530f88e60582c24ca5dd + +- **GatewayReady:** This property has been deprecated for a while, and was + returning an empty array for bot users. This commit removes it entirely + +Reference: https://github.com/discord/discord-api-docs/commit/f36156dbb641f5c4d4f4593f345bfd6e27fdee08 + +- **Permissions:** This commit brings consistency with the documentation, + where the permission is documented as `USE_SLASH_COMMANDS`, whereas the + client has it as `USE_APPLICATION_COMMANDS` internally + +Reference: https://github.com/discord/discord-api-docs/commit/c7d25885c5cd80a49b31609a40b70603b35f9dec + +- **MessageGetReactions:** This query parameter is not usable and was not respected + by the API. + +Reference: https://github.com/discord/discord-api-docs/commit/f72b084773d4d3989fb19be4fb4d9cf276a1e6b3 + +- **OAuth2:** This removes the `scope` property from the authorization + code flow, as it is not expected there. + +Reference: https://github.com/discord/discord-api-docs/commit/57965033ab4216a0bb853e85d6912531cd5a9981 + +- **Gateway:** This removes `guild_subscriptions`, as it has been + deprecated in favor of `intents`. + +Reference: https://github.com/discord/discord-api-docs/commit/8de017436d37e56fab14cb8f68f0448a45ebc731 + +- **Oauth2Scopes:** This removes the `rpc.api` scope, as it has been removed + from the documentation. + +Reference: https://github.com/discord/discord-api-docs/commit/2641d9808f676e7316483d152cdb37ed1168f968 + +- **APIMessage:** This removes the `APIMessageApplication` interface, as it has + been removed from the documentation, being replaced with the OAuth2 application. + +Reference: https://github.com/discord/discord-api-docs/commit/ff0c831e424f1bc17dd3cde62da48d5c3d933e88 + +- **APIApplication:** This renames the `GatewayPresenceLimit` flag to + `GatewayPresenceLimited`, for consistency with `GatewayGuildMembersLimited` + and the documented name. + +Reference: https://github.com/discord/discord-api-docs/commit/39b254bed1cc396c475e508a3f2bf328815605c9 + +- **GatewayVoiceServerUpdateDispatchData:** Any code that expects `endpoint` to never be null needs + to be updated, and the conditions specified in the documentation need + to be respected regarding that. + +Reference: https://github.com/discord/discord-api-docs/commit/e887382fafd4c4417f7ba62963984f25bcb643f6 + +- **Invites:** This renames `target_user_type` to `target_type`, + the actual value the API expects. + +Reference: https://github.com/discord/discord-api-docs/commit/1b4e363e324eb1f49a47e32cb0108fbe276c8e0e + +- **GatewayPresenceUpdateData:** Clearing `activities` is done by setting them to an empty + array, not by setting them to `null`. + +Reference: https://github.com/discord/discord-api-docs/commit/5bf598b864fb89262fce07137f68ce6e7e583432 + +- **UserFlags:** This removes a flag that bots should not use, as Discord + said this is an internal flag. + +Reference: https://github.com/discord/discord-api-docs/commit/9293f0d490ac6acf9d627e429e5a8131b303b528 + +- **Integrations:** This removes the 3 routes that bots can no longer access. + +Reference: https://github.com/discord/discord-api-docs/commit/efe4e5808b6826d40302e265a5ae9b5b65d92fe7 + +- **Exports:** Certain objects from this file have been moved to their + appropriate spot (such as JSON Error Codes) +- Files have been moved around in order to keep them + organized. Exports might also be missing, so please report if that is the + case. + +## [0.13.3](https://github.com/discordjs/discord-api-types/compare/0.13.2...0.13.3) (2021-03-28) + +## [0.13.2](https://github.com/discordjs/discord-api-types/compare/0.13.1...0.13.2) (2021-03-28) + +### Bug Fixes + +- **ApplicationCommandInteractionDataOptionSubCommandGroup:** typo ([#102](https://github.com/discordjs/discord-api-types/issues/102)) ([15c171c](https://github.com/discordjs/discord-api-types/commit/15c171c558a10cd6d1c4880e725af0e63dd82255)) + +## [0.13.1](https://github.com/discordjs/discord-api-types/compare/0.13.0...0.13.1) (2021-03-27) + +### Bug Fixes + +- **APIInteractionResponse:** `data` should not always be present ([#100](https://github.com/discordjs/discord-api-types/issues/100)) ([ffcd95d](https://github.com/discordjs/discord-api-types/commit/ffcd95d597a5d1c5b3ea072cd1dfb44f079de4b7)) + +# [0.13.0](https://github.com/discordjs/discord-api-types/compare/0.12.1...0.13.0) (2021-03-27) + +### Bug Fixes + +- **deno:** replace `const enum` exports in deno with normal `enum`s ([#89](https://github.com/discordjs/discord-api-types/issues/89)) ([7343fab](https://github.com/discordjs/discord-api-types/commit/7343fabe82e4321808bac784aed600afa8cf4249)) +- **RESTPostAPIChannelMessageJSONBody:** mark `tts` as a full boolean ([#96](https://github.com/discordjs/discord-api-types/issues/96)) ([9d8d090](https://github.com/discordjs/discord-api-types/commit/9d8d090c9c6cd5be1f7b578b2f6a6387544f3359)) +- **RESTPostAPIGuildsJSONBody:** make some fields nullable ([#91](https://github.com/discordjs/discord-api-types/issues/91)) ([ae1900d](https://github.com/discordjs/discord-api-types/commit/ae1900dc2f65065153b1bf2437348e63b63db49e)) + +### Features + +- **APIApplication:** add ApplicationFlags ([#92](https://github.com/discordjs/discord-api-types/issues/92)) ([92f76f1](https://github.com/discordjs/discord-api-types/commit/92f76f1a3c8acf80689b994e9bfaec70d198aaa1)) +- **APIApplicationCommandInteractionData:** add `resolved` ([#86](https://github.com/discordjs/discord-api-types/issues/86)) ([24155ae](https://github.com/discordjs/discord-api-types/commit/24155aeb71d46de48353ce01bfb48e197a84e59b)) +- **APIBaseInteraction:** add application_id ([#98](https://github.com/discordjs/discord-api-types/issues/98)) ([0582f88](https://github.com/discordjs/discord-api-types/commit/0582f883c517e5fdc2373ac0a85717a7bfeec018)) +- **APIInteraction:** DM slash commands and property descriptions ([#84](https://github.com/discordjs/discord-api-types/issues/84)) ([d0b3106](https://github.com/discordjs/discord-api-types/commit/d0b310675848f4724e47c490b06d828f7ede204c)) +- **APIInteractionResponse, APIInteractionResponseType:** update for UI changes ([#90](https://github.com/discordjs/discord-api-types/issues/90)) ([eafe7ba](https://github.com/discordjs/discord-api-types/commit/eafe7ba96fc6e771579850a8a7de36adade8efdc)) +- **APIMessage:** add `interaction` ([#93](https://github.com/discordjs/discord-api-types/issues/93)) ([0f29b32](https://github.com/discordjs/discord-api-types/commit/0f29b32e05abe89f70f72989024b9c63493782fa)) +- **APIMessageReferenceSend:** add `fail_if_not_exists` ([#82](https://github.com/discordjs/discord-api-types/issues/82)) ([855f36d](https://github.com/discordjs/discord-api-types/commit/855f36d9309ae69f57da723648d3791e3134089e)) +- **PermissionFlagsBits:** add `USE_APPLICATION_COMMANDS` ([#85](https://github.com/discordjs/discord-api-types/issues/85)) ([ceb787b](https://github.com/discordjs/discord-api-types/commit/ceb787ba36ed05f25f9acab86496d3054cb15013)) +- **rest:** api base routes ([#87](https://github.com/discordjs/discord-api-types/issues/87)) ([466fa95](https://github.com/discordjs/discord-api-types/commit/466fa95b0e239b7984275959886b995a5020640a)) +- add Application Command events ([#75](https://github.com/discordjs/discord-api-types/issues/75)) ([da2c2e9](https://github.com/discordjs/discord-api-types/commit/da2c2e9ada39482fce095c47339b40d6c24e683a)) +- add GET single Application Command ([#76](https://github.com/discordjs/discord-api-types/issues/76)) ([5826da2](https://github.com/discordjs/discord-api-types/commit/5826da22e30839b1f9fcd73479f8bc0f213001bd)) +- implement FormatPatterns ([#79](https://github.com/discordjs/discord-api-types/issues/79)) ([4e4a084](https://github.com/discordjs/discord-api-types/commit/4e4a0840036eddb89a1d49d69f59905dba206afb)) +- **OAuth2:** add `/oauth2/[@me](https://github.com/me)` route ([#73](https://github.com/discordjs/discord-api-types/issues/73)) ([84759d1](https://github.com/discordjs/discord-api-types/commit/84759d19bc4cd0f33f0a94608c1af2b4d6a820c6)) +- **Webhook:** add Edit Webhook Message result and error 50027 ([#71](https://github.com/discordjs/discord-api-types/issues/71)) ([4c77a5d](https://github.com/discordjs/discord-api-types/commit/4c77a5d90acf627574eff571a92a6703c6ea2d13)) + +## [0.12.1](https://github.com/discordjs/discord-api-types/compare/0.12.0...0.12.1) (2021-01-05) + +### Bug Fixes + +- run deno workflow only on branch push ([#66](https://github.com/discordjs/discord-api-types/issues/66)) ([0ef4620](https://github.com/discordjs/discord-api-types/commit/0ef46202f6c8c257e6300e634b675e7e1b6ffa90)) + +### Features + +- add Snowflake and Permissions types ([#69](https://github.com/discordjs/discord-api-types/issues/69)) ([549a6f0](https://github.com/discordjs/discord-api-types/commit/549a6f023698f05829f1dfdf1190c027a994d6cd)) + +# [0.12.0](https://github.com/discordjs/discord-api-types/compare/0.11.2...0.12.0) (2021-01-01) + +### Bug Fixes + +- **APIApplication:** flags should be omitted in REST, not optional everywhere ([#57](https://github.com/discordjs/discord-api-types/issues/57)) ([664ad80](https://github.com/discordjs/discord-api-types/commit/664ad800ccdfb84cc1547dd151c0f6e16157e04b)) +- **RESTPatchAPIChannelJSONBody:** add missing bitrate field ([#60](https://github.com/discordjs/discord-api-types/issues/60)) ([15892ec](https://github.com/discordjs/discord-api-types/commit/15892ec870ff818d7f66bd9b57969638e5f17e1f)) + +### Features + +- **GatewayActivity:** add missing fields ([#39](https://github.com/discordjs/discord-api-types/issues/39)) ([dccdfe0](https://github.com/discordjs/discord-api-types/commit/dccdfe044fb4c02b6cfc910e2d39e469ebd9c75a)) + +## [0.11.2](https://github.com/discordjs/discord-api-types/compare/0.11.1...0.11.2) (2020-12-20) + +## [0.11.1](https://github.com/discordjs/discord-api-types/compare/0.11.0...0.11.1) (2020-12-19) + +### Bug Fixes + +- **APIAuditLogEntry:** user_id is not nullable ([#52](https://github.com/discordjs/discord-api-types/issues/52)) ([2b89beb](https://github.com/discordjs/discord-api-types/commit/2b89beb52b66a4865124b75069ca6bc3d5886c48)) +- **RESTPostAPIGuildsJSONBody:** system_channel_flags is optional ([#53](https://github.com/discordjs/discord-api-types/issues/53)) ([ba4c0d7](https://github.com/discordjs/discord-api-types/commit/ba4c0d78f4ba3755f524b5f63420a36580a1a08e)) + +# [0.11.0](https://github.com/discordjs/discord-api-types/compare/0.10.0...0.11.0) (2020-12-19) + +### Bug Fixes + +- **APIGuildMember:** drop nullability of `pending` prop ([#49](https://github.com/discordjs/discord-api-types/issues/49)) ([c2f0dee](https://github.com/discordjs/discord-api-types/commit/c2f0deeebd28fa3a09f795d1b263ff8fd5d9ae4d)) +- **RESTPatchAPIGuildJSONBody:** multiple properties are actually nullable ([#48](https://github.com/discordjs/discord-api-types/issues/48)) ([018fc4f](https://github.com/discordjs/discord-api-types/commit/018fc4f8ea4d50f719820001822778079a055fa3)) + +# [0.10.0](https://github.com/discordjs/discord-api-types/compare/0.9.1...0.10.0) (2020-12-09) + +### Features + +- server templates ([#25](https://github.com/discordjs/discord-api-types/issues/25)) ([7d873f7](https://github.com/discordjs/discord-api-types/commit/7d873f73c7a8c64630c57d3eaf33d8c4913ed835)) + +## [0.9.1](https://github.com/discordjs/discord-api-types/compare/0.9.0...0.9.1) (2020-11-22) + +# [0.9.0](https://github.com/discordjs/discord-api-types/compare/0.8.0...0.9.0) (2020-11-22) + +### Features + +- **Message:** reply updates ([#34](https://github.com/discordjs/discord-api-types/issues/34)) ([21b9ae4](https://github.com/discordjs/discord-api-types/commit/21b9ae4aaf29c276d1a6ccc4c79ace8d64a53e9d)) +- **Message:** Stickers ([#32](https://github.com/discordjs/discord-api-types/issues/32)) ([39ea1f4](https://github.com/discordjs/discord-api-types/commit/39ea1f4429e5194576200635f885ab102763060b)) + +# [0.8.0](https://github.com/discordjs/discord-api-types/compare/0.7.0...0.8.0) (2020-11-03) + +### Bug Fixes + +- webhookPlatform route ([#36](https://github.com/discordjs/discord-api-types/issues/36)) ([666a0c7](https://github.com/discordjs/discord-api-types/commit/666a0c71528e385677570b5359ba266276202a95)) +- **GatewayPresence:** correct type for sent activity objects ([#30](https://github.com/discordjs/discord-api-types/issues/30)) ([61db1ee](https://github.com/discordjs/discord-api-types/commit/61db1eee256037588ef27533c234cb01f1f699a4)) + +# [0.7.0](https://github.com/discordjs/discord-api-types/compare/0.6.0...0.7.0) (2020-10-18) + +### Bug Fixes + +- **GatewayHeartbeat:** d is nullable ([#26](https://github.com/discordjs/discord-api-types/issues/26)) ([0982610](https://github.com/discordjs/discord-api-types/commit/098261073163eeb4fcfc217dea3511ccea1f27c5)) +- **GatewayIdentify:** use correct presence interface ([#28](https://github.com/discordjs/discord-api-types/issues/28)) ([91c63f0](https://github.com/discordjs/discord-api-types/commit/91c63f05ca1e8e92c4c1df124365405fe8d34108)) + +### Features + +- **APIGuildWidgetMember:** add activity and use proper status type ([#24](https://github.com/discordjs/discord-api-types/issues/24)) ([f058ed6](https://github.com/discordjs/discord-api-types/commit/f058ed6aa1f7593c22e4a3f0c9dd2f4bbd0190dc)) + +# [0.6.0](https://github.com/discordjs/discord-api-types/compare/0.5.0...0.6.0) (2020-10-04) + +### Bug Fixes + +- **APIChannel:** position is optional ([#21](https://github.com/discordjs/discord-api-types/issues/21)) ([061a147](https://github.com/discordjs/discord-api-types/commit/061a147fbb381738b28ca3fb73fa1a7be0e1b108)) +- **RESTPostAPIGuildsJSONBody:** use correct types ([#22](https://github.com/discordjs/discord-api-types/issues/22)) ([dcf8ddf](https://github.com/discordjs/discord-api-types/commit/dcf8ddf25b26a9c72dbb1b5712503e6d5e516ad1)) + +### Features + +- v8 support ([#14](https://github.com/discordjs/discord-api-types/issues/14)) ([11b95c8](https://github.com/discordjs/discord-api-types/commit/11b95c86099e609128a8ca76d06d43498fae72f5)) + +# [0.5.0](https://github.com/discordjs/discord-api-types/compare/0.4.1...0.5.0) (2020-09-19) + +### Bug Fixes + +- correct typos ([#18](https://github.com/discordjs/discord-api-types/issues/18)) ([97c7b4e](https://github.com/discordjs/discord-api-types/commit/97c7b4ea24852f49b5f952e81a0e6f21ed405316)) +- **APIUser:** premium_type is optional ([#19](https://github.com/discordjs/discord-api-types/issues/19)) ([8cf1ba3](https://github.com/discordjs/discord-api-types/commit/8cf1ba3f4f3c28f962afad4bfcc02f5bb897286a)) +- **GatewayIdentifyProperties:** rename `device` to `$device` ([#17](https://github.com/discordjs/discord-api-types/issues/17)) ([9e5c5b5](https://github.com/discordjs/discord-api-types/commit/9e5c5b5aac30e931255f39790123b4bd3458a16f)) + +## [0.4.1](https://github.com/discordjs/discord-api-types/compare/0.4.0...0.4.1) (2020-09-18) + +### Features + +- add oauth2 types ([#16](https://github.com/discordjs/discord-api-types/issues/16)) ([10fdeba](https://github.com/discordjs/discord-api-types/commit/10fdeba1286e385e087d6c9405872f948507f183)) + +# [0.4.0](https://github.com/discordjs/discord-api-types/compare/0.3.0...0.4.0) (2020-09-16) + +### Features + +- **ActivityType:** add Competing activity type ([#11](https://github.com/discordjs/discord-api-types/issues/11)) ([94d0a16](https://github.com/discordjs/discord-api-types/commit/94d0a1680532412c8d5f9659056f87a37d1def7d)) + +# [0.3.0](https://github.com/discordjs/discord-api-types/compare/v0.2.0...0.3.0) (2020-09-14) + +### Bug Fixes + +- **APIMessage:** Correct APIMessage#mentions type ([#9](https://github.com/discordjs/discord-api-types/issues/9)) ([fe1868b](https://github.com/discordjs/discord-api-types/commit/fe1868b04f8a9f4be1c09ffba0afa60f4def8595)) + +# [0.2.0](https://github.com/discordjs/discord-api-types/compare/v0.1.1...v0.2.0) (2020-09-10) + +### Bug Fixes + +- **Readme:** add missing semicolon ([#1](https://github.com/discordjs/discord-api-types/issues/1)) ([5e3e101](https://github.com/discordjs/discord-api-types/commit/5e3e1016b5fe274d33503d36771fc276fd384ccf)) + +## [0.1.1](https://github.com/discordjs/discord-api-types/compare/767a833a12a8268b9f1b780f338da6f28cefa5cd...v0.1.1) (2020-08-22) + +### Bug Fixes + +- set target version to ES2020 ([767a833](https://github.com/discordjs/discord-api-types/commit/767a833a12a8268b9f1b780f338da6f28cefa5cd)) diff --git a/README.md b/README.md index c6f7412f..e8be1811 100644 --- a/README.md +++ b/README.md @@ -19,30 +19,55 @@ yarn add discord-api-types pnpm add discord-api-types ``` +### Usage + +You can only import this module by specifying the API version you want to target. Append `/v*` to the import path, where the `*` represents the API version. Below are some examples + +```js +const { APIUser } = require('discord-api-types/v8'); +``` + +```ts +// TypeScript/ES Module support +import { APIUser } from 'discord-api-types/v8'; +``` + +You may also import just certain parts of the module that you need. The possible values are: `globals`, `gateway`, `gateway/v*`, `payloads`, `payloads/v*`, `rest`, `rest/v*`, `rpc`, `rpc/v*`, `utils`, `utils/v*`, `voice`, and `voice/v*`. Below are some examples + +```js +const { GatewayVersion } = require('discord-api-types/gateway/v8'); +``` + +```ts +// TypeScript/ES Module support +import { GatewayVersion } from 'discord-api-types/gateway/v8'; +``` + +> _**Note:** The `v*` exports (`discord-api-type/v*`) include the appropriate version of `gateway`, `payloads`, `rest`, `rpc`, and `utils` you specified, alongside the `globals` exports_ + +### Deno + We also provide typings compatible with the [deno](https://deno.land/) runtime. You have 3 ways you can import them: 1. Directly from GitHub ```ts -// Importing the default API version -import { APIUser } from 'https://raw.githubusercontent.com/discordjs/discord-api-types/main/deno/mod.ts'; - // Importing a specific API version -import { APIUser } from 'https://raw.githubusercontent.com/discordjs/discord-api-types/main/deno/v8/mod.ts'; +import { APIUser } from 'https://raw.githubusercontent.com/discordjs/discord-api-types/main/deno/shortcuts/v8/mod.ts'; ``` 2. From [deno.land/x](https://deno.land/x) ```ts // Importing a specific API version -import { APIUser } from 'https://deno.land/x/discord_api_types/v8/mod.ts'; +import { APIUser } from 'https://deno.land/x/discord_api_types/shortcuts/v8.ts'; ``` 3. From [skypack.dev](https://www.skypack.dev/) ```ts // Importing a specific API version -import { APIUser } from 'https://cdn.skypack.dev/discord-api-types/v8?dts'; +import { APIUser } from 'https://cdn.skypack.dev/discord-api-types/shortcuts/v8?dts'; ``` ## Project Structure @@ -67,21 +92,6 @@ The exports of each API version is split into three main parts: - Anything else that is miscellaneous will be exported based on what it represents (for example the `REST` route object). -- There may be types exported that are identical for all versions. These will be exported as is and can be found in the `common` directory. They will still be prefixed accordingly as described above. +- There may be types exported that are identical for all versions. These will be exported as is and can be found in the `globals` file. They will still be prefixed accordingly as described above. -**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 in an open Pull Request 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_). For clarification's sake, this means that properties that are only known through the process of data mining and have not yet been confirmed in a way as described will NOT be included. - -## Usage - -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 will be updated according to Discord's default API version; this means it may break at any point in time. - -You can only import this module by specifying the API version you want to target. Append `/v*` to the import path, where the `*` represents the API version. Below are some examples - -```js -const { APIUser } = require('discord-api-types/v8'); -``` - -```ts -// TypeScript/ES Module support -import { APIUser } from 'discord-api-types/v8'; -``` +**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 in an open Pull Request 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_). For clarification's sake, this means that properties that are only known through the process of data mining and have not yet been confirmed in a way as described will **NOT** be included. diff --git a/common/index.ts b/common/index.ts deleted file mode 100644 index 09aae408..00000000 --- a/common/index.ts +++ /dev/null @@ -1,226 +0,0 @@ -/** - * https://discord.com/developers/docs/topics/opcodes-and-status-codes#json-json-error-codes - */ -export const enum RESTJSONErrorCodes { - GeneralError, - - UnknownAccount = 10001, - UnknownApplication, - UnknownChannel, - UnknownGuild, - UnknownIntegration, - UnknownInvite, - UnknownMember, - UnknownMessage, - UnknownPermissionOverwrite, - UnknownProvider, - UnknownRole, - UnknownToken, - UnknownUser, - UnknownEmoji, - UnknownWebhook, - - UnknownBan = 10026, - UnknownSKU, - UnknownStoreListing, - UnknownEntitlement, - UnknownBuild, - UnknownLobby, - UnknownBranch, - - UnknownRedistributable = 10036, - - UnknownGuildTemplate = 10057, - - UnknownApplicationCommand = 10063, - - BotsCannotUseThisEndpoint = 20001, - OnlyBotsCanUseThisEndpoint, - - AnnouncementEditLimitExceeded = 20022, - - ChannelSendRateLimit = 20028, - - MaximumNumberOfGuildsReached = 30001, - MaximumNumberOfFriendsReached, - MaximumNumberOfPinsReachedForTheChannel, - - MaximumNumberOfGuildRolesReached = 30005, - - MaximumNumberOfWebhooksReached = 30007, - - MaximumNumberOfReactionsReached = 30010, - - MaximumNumberOfGuildChannelsReached = 30013, - - MaximumNumberOfAttachmentsInAMessageReached = 30015, - MaximumNumberOfInvitesReached, - - GuildAlreadyHasTemplate = 30031, - - Unauthorized = 40001, - VerifyYourAccount, - - RequestEntityTooLarge = 40005, - FeatureTemporarilyDisabledServerSide, - UserBannedFromThisGuild, - - ThisMessageWasAlreadyCrossposted = 40033, - - MissingAccess = 50001, - InvalidAccountType, - CannotExecuteActionOnDMChannel, - GuildWidgetDisabled, - CannotEditMessageAuthoredByAnotherUser, - CannotSendAnEmptyMessage, - CannotSendMessagesToThisUser, - CannotSendMessagesInVoiceChannel, - ChannelVerificationLevelTooHighForYouToGainAccess, - Oauth2ApplicationDoesNotHaveBot, - Oauth2ApplicationLimitReached, - InvalidOauth2State, - MissingPermissions, - InvalidToken, - NoteWasTooLong, - ProvidedTooFewOrTooManyMessagesToDelete, - - MessageCanOnlyBePinnedInTheChannelItWasSentIn = 50019, - InviteCodeInvalidOrTaken, - CannotExecuteActionOnSystemMessage, - - CannotExecuteActionOnThisChannelType = 50024, - InvalidOauth2AccessToken, - - InvalidWebhookToken = 50027, - - InvalidRecipients = 50033, - OneOfTheMessagesProvidedWasTooOldForBulkDelete, - InvalidFormBodyOrContentType, - InviteAcceptedToGuildWithoutTheBotBeingIn, - - InvalidAPIVersion = 50041, - - CannotDeleteChannelRequiredForCommunityGuilds = 50074, - - InvalidStickerSent = 50081, - - TwoFactorAuthenticationIsRequired = 60003, - - ReactionWasBlocked = 90001, - - APIResourceOverloaded = 130000, -} - -/** - * https://discord.com/developers/docs/topics/opcodes-and-status-codes#rpc-rpc-error-codes - */ -export const 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 const 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'; -} - -/** - * https://discord.com/developers/docs/reference#snowflakes - */ -export type Snowflake = `${bigint}`; - -/** - * https://discord.com/developers/docs/topics/permissions - * @internal - */ -export type Permissions = `${bigint}`; - -/** - * https://discord.com/developers/docs/reference#message-formatting-formats - */ -export const FormattingPatterns = { - /** - * Regular expression for matching a user mention, strictly without a nickname - * - * The `id` group property is present on the `exec` result of this expression - */ - User: /<@(?\d{17,20})>/, - /** - * Regular expression for matching a user mention, strictly with a nickname - * - * The `id` group property is present on the `exec` result of this expression - */ - UserWithNickname: /<@!(?\d{17,20})>/, - /** - * Regular expression for matching a user mention, with or without a nickname - * - * The `id` group property is present on the `exec` result of this expression - */ - UserWithOptionalNickname: /<@!?(?\d{17,20})>/, - /** - * Regular expression for matching a channel mention - * - * The `id` group property is present on the `exec` result of this expression - */ - Channel: /<#(?\d{17,20})>/, - /** - * Regular expression for matching a role mention - * - * The `id` group property is present on the `exec` result of this expression - */ - Role: /<@&(?\d{17,20})>/, - /** - * Regular expression for matching a custom emoji, either static or animated - * - * The `animated`, `name` and `id` group properties are present on the `exec` result of this expression - */ - Emoji: /<(?a)?:(?\w{2,32}):(?\d{17,20})>/, - /** - * Regular expression for matching strictly an animated custom emoji - * - * The `animated`, `name` and `id` group properties are present on the `exec` result of this expression - */ - AnimatedEmoji: /<(?a):(?\w{2,32}):(?\d{17,20})>/, - /** - * Regular expression for matching strictly a static custom emoji - * - * The `name` and `id` group properties are present on the `exec` result of this expression - */ - StaticEmoji: /<:(?\w{2,32}):(?\d{17,20})>/, -} as const; - -/** - * Freezes the formatting patterns - * @internal - */ -Object.freeze(FormattingPatterns); diff --git a/default/index.ts b/default/index.ts deleted file mode 100644 index 4057428f..00000000 --- a/default/index.ts +++ /dev/null @@ -1,4 +0,0 @@ -// This file exports all the types available in the default API version -// Thereby, things MAY break in the future - -export * from '../v8/index'; diff --git a/deno/README.md b/deno/README.md index c6f7412f..e8be1811 100644 --- a/deno/README.md +++ b/deno/README.md @@ -19,30 +19,55 @@ yarn add discord-api-types pnpm add discord-api-types ``` +### Usage + +You can only import this module by specifying the API version you want to target. Append `/v*` to the import path, where the `*` represents the API version. Below are some examples + +```js +const { APIUser } = require('discord-api-types/v8'); +``` + +```ts +// TypeScript/ES Module support +import { APIUser } from 'discord-api-types/v8'; +``` + +You may also import just certain parts of the module that you need. The possible values are: `globals`, `gateway`, `gateway/v*`, `payloads`, `payloads/v*`, `rest`, `rest/v*`, `rpc`, `rpc/v*`, `utils`, `utils/v*`, `voice`, and `voice/v*`. Below are some examples + +```js +const { GatewayVersion } = require('discord-api-types/gateway/v8'); +``` + +```ts +// TypeScript/ES Module support +import { GatewayVersion } from 'discord-api-types/gateway/v8'; +``` + +> _**Note:** The `v*` exports (`discord-api-type/v*`) include the appropriate version of `gateway`, `payloads`, `rest`, `rpc`, and `utils` you specified, alongside the `globals` exports_ + +### Deno + We also provide typings compatible with the [deno](https://deno.land/) runtime. You have 3 ways you can import them: 1. Directly from GitHub ```ts -// Importing the default API version -import { APIUser } from 'https://raw.githubusercontent.com/discordjs/discord-api-types/main/deno/mod.ts'; - // Importing a specific API version -import { APIUser } from 'https://raw.githubusercontent.com/discordjs/discord-api-types/main/deno/v8/mod.ts'; +import { APIUser } from 'https://raw.githubusercontent.com/discordjs/discord-api-types/main/deno/shortcuts/v8/mod.ts'; ``` 2. From [deno.land/x](https://deno.land/x) ```ts // Importing a specific API version -import { APIUser } from 'https://deno.land/x/discord_api_types/v8/mod.ts'; +import { APIUser } from 'https://deno.land/x/discord_api_types/shortcuts/v8.ts'; ``` 3. From [skypack.dev](https://www.skypack.dev/) ```ts // Importing a specific API version -import { APIUser } from 'https://cdn.skypack.dev/discord-api-types/v8?dts'; +import { APIUser } from 'https://cdn.skypack.dev/discord-api-types/shortcuts/v8?dts'; ``` ## Project Structure @@ -67,21 +92,6 @@ The exports of each API version is split into three main parts: - Anything else that is miscellaneous will be exported based on what it represents (for example the `REST` route object). -- There may be types exported that are identical for all versions. These will be exported as is and can be found in the `common` directory. They will still be prefixed accordingly as described above. +- There may be types exported that are identical for all versions. These will be exported as is and can be found in the `globals` file. They will still be prefixed accordingly as described above. -**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 in an open Pull Request 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_). For clarification's sake, this means that properties that are only known through the process of data mining and have not yet been confirmed in a way as described will NOT be included. - -## Usage - -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 will be updated according to Discord's default API version; this means it may break at any point in time. - -You can only import this module by specifying the API version you want to target. Append `/v*` to the import path, where the `*` represents the API version. Below are some examples - -```js -const { APIUser } = require('discord-api-types/v8'); -``` - -```ts -// TypeScript/ES Module support -import { APIUser } from 'discord-api-types/v8'; -``` +**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 in an open Pull Request 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_). For clarification's sake, this means that properties that are only known through the process of data mining and have not yet been confirmed in a way as described will **NOT** be included. diff --git a/deno/common/mod.ts b/deno/common/mod.ts deleted file mode 100644 index b1a49704..00000000 --- a/deno/common/mod.ts +++ /dev/null @@ -1,226 +0,0 @@ -/** - * 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, - UnknownWebhook, - - UnknownBan = 10026, - UnknownSKU, - UnknownStoreListing, - UnknownEntitlement, - UnknownBuild, - UnknownLobby, - UnknownBranch, - - UnknownRedistributable = 10036, - - UnknownGuildTemplate = 10057, - - UnknownApplicationCommand = 10063, - - BotsCannotUseThisEndpoint = 20001, - OnlyBotsCanUseThisEndpoint, - - AnnouncementEditLimitExceeded = 20022, - - ChannelSendRateLimit = 20028, - - MaximumNumberOfGuildsReached = 30001, - MaximumNumberOfFriendsReached, - MaximumNumberOfPinsReachedForTheChannel, - - MaximumNumberOfGuildRolesReached = 30005, - - MaximumNumberOfWebhooksReached = 30007, - - MaximumNumberOfReactionsReached = 30010, - - MaximumNumberOfGuildChannelsReached = 30013, - - MaximumNumberOfAttachmentsInAMessageReached = 30015, - MaximumNumberOfInvitesReached, - - GuildAlreadyHasTemplate = 30031, - - Unauthorized = 40001, - VerifyYourAccount, - - RequestEntityTooLarge = 40005, - FeatureTemporarilyDisabledServerSide, - UserBannedFromThisGuild, - - ThisMessageWasAlreadyCrossposted = 40033, - - MissingAccess = 50001, - InvalidAccountType, - CannotExecuteActionOnDMChannel, - GuildWidgetDisabled, - CannotEditMessageAuthoredByAnotherUser, - CannotSendAnEmptyMessage, - CannotSendMessagesToThisUser, - CannotSendMessagesInVoiceChannel, - ChannelVerificationLevelTooHighForYouToGainAccess, - Oauth2ApplicationDoesNotHaveBot, - Oauth2ApplicationLimitReached, - InvalidOauth2State, - MissingPermissions, - InvalidToken, - NoteWasTooLong, - ProvidedTooFewOrTooManyMessagesToDelete, - - MessageCanOnlyBePinnedInTheChannelItWasSentIn = 50019, - InviteCodeInvalidOrTaken, - CannotExecuteActionOnSystemMessage, - - CannotExecuteActionOnThisChannelType = 50024, - InvalidOauth2AccessToken, - - InvalidWebhookToken = 50027, - - InvalidRecipients = 50033, - OneOfTheMessagesProvidedWasTooOldForBulkDelete, - InvalidFormBodyOrContentType, - InviteAcceptedToGuildWithoutTheBotBeingIn, - - InvalidAPIVersion = 50041, - - CannotDeleteChannelRequiredForCommunityGuilds = 50074, - - InvalidStickerSent = 50081, - - 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'; -} - -/** - * https://discord.com/developers/docs/reference#snowflakes - */ -export type Snowflake = `${bigint}`; - -/** - * https://discord.com/developers/docs/topics/permissions - * @internal - */ -export type Permissions = `${bigint}`; - -/** - * https://discord.com/developers/docs/reference#message-formatting-formats - */ -export const FormattingPatterns = { - /** - * Regular expression for matching a user mention, strictly without a nickname - * - * The `id` group property is present on the `exec` result of this expression - */ - User: /<@(?\d{17,20})>/, - /** - * Regular expression for matching a user mention, strictly with a nickname - * - * The `id` group property is present on the `exec` result of this expression - */ - UserWithNickname: /<@!(?\d{17,20})>/, - /** - * Regular expression for matching a user mention, with or without a nickname - * - * The `id` group property is present on the `exec` result of this expression - */ - UserWithOptionalNickname: /<@!?(?\d{17,20})>/, - /** - * Regular expression for matching a channel mention - * - * The `id` group property is present on the `exec` result of this expression - */ - Channel: /<#(?\d{17,20})>/, - /** - * Regular expression for matching a role mention - * - * The `id` group property is present on the `exec` result of this expression - */ - Role: /<@&(?\d{17,20})>/, - /** - * Regular expression for matching a custom emoji, either static or animated - * - * The `animated`, `name` and `id` group properties are present on the `exec` result of this expression - */ - Emoji: /<(?a)?:(?\w{2,32}):(?\d{17,20})>/, - /** - * Regular expression for matching strictly an animated custom emoji - * - * The `animated`, `name` and `id` group properties are present on the `exec` result of this expression - */ - AnimatedEmoji: /<(?a):(?\w{2,32}):(?\d{17,20})>/, - /** - * Regular expression for matching strictly a static custom emoji - * - * The `name` and `id` group properties are present on the `exec` result of this expression - */ - StaticEmoji: /<:(?\w{2,32}):(?\d{17,20})>/, -} as const; - -/** - * Freezes the formatting patterns - * @internal - */ -Object.freeze(FormattingPatterns); diff --git a/deno/gateway/common.ts b/deno/gateway/common.ts new file mode 100644 index 00000000..bb2bfcb8 --- /dev/null +++ b/deno/gateway/common.ts @@ -0,0 +1,8 @@ +/** + * https://discord.com/developers/docs/topics/gateway#connecting-gateway-url-params + */ +export interface GatewayURLQuery { + v: string; + encoding: 'json' | 'etf'; + compress?: 'zlib-stream'; +} diff --git a/deno/gateway/mod.ts b/deno/gateway/mod.ts new file mode 100644 index 00000000..e7137942 --- /dev/null +++ b/deno/gateway/mod.ts @@ -0,0 +1,4 @@ +// This file exports all the types available in the recommended gateway version +// Thereby, things MAY break in the future. Try sticking to imports from a specific version + +export * from './v8.ts'; diff --git a/deno/v6/gateway/mod.ts b/deno/gateway/v6.ts similarity index 99% rename from deno/v6/gateway/mod.ts rename to deno/gateway/v6.ts index 7c8f88c8..eea1343e 100644 --- a/deno/v6/gateway/mod.ts +++ b/deno/gateway/v6.ts @@ -16,7 +16,9 @@ import type { GatewayVoiceState, InviteTargetUserType, PresenceUpdateStatus, -} from '../payloads/mod.ts'; +} from '../payloads/v6/mod.ts'; + +export * from './common.ts'; /** * @deprecated Gateway v6 is deprecated and the types will not receive further updates, please update to v8. diff --git a/deno/v8/gateway/mod.ts b/deno/gateway/v8.ts similarity index 93% rename from deno/v8/gateway/mod.ts rename to deno/gateway/v8.ts index 8c294ca9..40734f17 100644 --- a/deno/v8/gateway/mod.ts +++ b/deno/gateway/v8.ts @@ -2,7 +2,7 @@ * Types extracted from https://discord.com/developers/docs/topics/gateway */ -import type { Snowflake } from '../../common/mod.ts'; +import type { Snowflake } from '../globals.ts'; import type { APIApplication, APIApplicationCommand, @@ -10,6 +10,7 @@ import type { APIChannel, APIEmoji, APIGuild, + APIGuildIntegration, APIGuildMember, APIMessage, APIRole, @@ -20,7 +21,9 @@ import type { GatewayVoiceState, InviteTargetUserType, PresenceUpdateStatus, -} from '../payloads/mod.ts'; +} from '../payloads/v8/mod.ts'; + +export * from './common.ts'; export const GatewayVersion = '8'; @@ -158,114 +161,6 @@ export enum GatewayCloseCodes { DisallowedIntents, } -/** - * https://discord.com/developers/docs/topics/opcodes-and-status-codes#voice-voice-opcodes - */ -export enum VoiceOPCodes { - /** - * Begin a voice websocket connection - */ - Identify, - /** - * Select the voice protocol - */ - SelectProtocol, - /** - * Complete the websocket handshake - */ - Ready, - /** - * Keep the websocket connection alive - */ - Heartbeat, - /** - * Describe the session - */ - SessionDescription, - /** - * Indicate which users are speaking - */ - Speaking, - /** - * Sent to acknowledge a received client heartbeat - */ - HeartbeatAck, - /** - * Resume a connection - */ - Resume, - /** - * Time to wait between sending heartbeats in milliseconds - */ - Hello, - /** - * Acknowledge a successful session resume - */ - Resumed, - /** - * A client has connected to the voice channel - */ - ClientConnect = 12, - /** - * A client has disconnected from the voice channel - */ - ClientDisconnect, -} - -/** - * https://discord.com/developers/docs/topics/opcodes-and-status-codes#voice-voice-close-event-codes - */ -export enum VoiceCloseCodes { - /** - * You sent an invalid opcode - */ - UnknownOpCode = 4001, - /** - * You sent a invalid payload in your identifying to the Gateway - */ - FailedToDecode, - /** - * You sent a payload before identifying with the Gateway - */ - NotAuthenticated, - /** - * The token you sent in your identify payload is incorrect - */ - AuthenticationFailed, - /** - * You sent more than one identify payload. Stahp - */ - AlreadyAuthenticated, - /** - * Your session is no longer valid - */ - SessionNoLongerValid, - /** - * Your session has timed out - */ - SessionTimeout = 4009, - /** - * We can't find the server you're trying to connect to - */ - ServerNotFound = 4011, - /** - * We didn't recognize the protocol you sent - */ - UnknownProtocol, - /** - * Either the channel was deleted or you were kicked. Should not reconnect - */ - Disconnected = 4014, - /** - * The server crashed. Our bad! Try resuming - */ - VoiceServerCrashed, - /** - * We didn't recognize your encryption - */ - UnknownEncryptionMode, -} - /** * https://discord.com/developers/docs/topics/gateway#list-of-intents */ @@ -292,8 +187,8 @@ export enum GatewayIntentBits { */ export enum GatewayDispatchEvents { ApplicationCommandCreate = 'APPLICATION_COMMAND_CREATE', - ApplicationCommandUpdate = 'APPLICATION_COMMAND_UPDATE', ApplicationCommandDelete = 'APPLICATION_COMMAND_DELETE', + ApplicationCommandUpdate = 'APPLICATION_COMMAND_UPDATE', ChannelCreate = 'CHANNEL_CREATE', ChannelDelete = 'CHANNEL_DELETE', ChannelPinsUpdate = 'CHANNEL_PINS_UPDATE', @@ -312,6 +207,9 @@ export enum GatewayDispatchEvents { GuildRoleDelete = 'GUILD_ROLE_DELETE', GuildRoleUpdate = 'GUILD_ROLE_UPDATE', GuildUpdate = 'GUILD_UPDATE', + IntegrationCreate = 'INTEGRATION_CREATE', + IntegrationDelete = 'INTEGRATION_DELETE', + IntegrationUpdate = 'INTEGRATION_UPDATE', InteractionCreate = 'INTERACTION_CREATE', InviteCreate = 'INVITE_CREATE', InviteDelete = 'INVITE_DELETE', @@ -363,6 +261,9 @@ export type GatewayDispatchPayload = | GatewayGuildModifyDispatch | GatewayGuildRoleDeleteDispatch | GatewayGuildRoleModifyDispatch + | GatewayIntegrationCreateDispatch + | GatewayIntegrationDeleteDispatch + | GatewayIntegrationUpdateDispatch | GatewayInteractionCreateDispatch | GatewayInviteCreateDispatch | GatewayInviteDeleteDispatch @@ -512,10 +413,6 @@ export interface GatewayReadyDispatchData { * See https://discord.com/developers/docs/resources/user#user-object */ user: APIUser; - /** - * Empty array - */ - private_channels: []; /** * The guilds the user is in * @@ -804,12 +701,14 @@ export type GatewayGuildMemberUpdateDispatch = DataPayload< /** * https://discord.com/developers/docs/topics/gateway#guild-member-update */ -export type GatewayGuildMemberUpdateDispatchData = Omit & { - /** - * The id of the guild - */ - guild_id: Snowflake; -}; +export type GatewayGuildMemberUpdateDispatchData = Omit & + Partial> & + Required> & { + /** + * The id of the guild + */ + guild_id: Snowflake; + }; /** * https://discord.com/developers/docs/topics/gateway#guild-members-chunk @@ -927,6 +826,58 @@ export interface GatewayGuildRoleDeleteDispatchData { role_id: Snowflake; } +/** + * https://discord.com/developers/docs/topics/gateway#integration-create + */ +export type GatewayIntegrationCreateDispatch = DataPayload< + GatewayDispatchEvents.IntegrationCreate, + GatewayIntegrationCreateDispatchData +>; + +/** + * https://discord.com/developers/docs/topics/gateway#integration-create + */ +export type GatewayIntegrationCreateDispatchData = APIGuildIntegration & { guild_id: Snowflake }; + +/** + * https://discord.com/developers/docs/topics/gateway#integration-update + */ +export type GatewayIntegrationUpdateDispatch = DataPayload< + GatewayDispatchEvents.IntegrationUpdate, + GatewayIntegrationUpdateDispatchData +>; + +/** + * https://discord.com/developers/docs/topics/gateway#integration-update + */ +export type GatewayIntegrationUpdateDispatchData = APIGuildIntegration & { guild_id: Snowflake }; + +/** + * https://discord.com/developers/docs/topics/gateway#integration-update + */ +export type GatewayIntegrationDeleteDispatch = DataPayload< + GatewayDispatchEvents.IntegrationDelete, + GatewayIntegrationDeleteDispatchData +>; + +/** + * https://discord.com/developers/docs/topics/gateway#integration-delete + */ +export interface GatewayIntegrationDeleteDispatchData { + /** + * Integration id + */ + id: Snowflake; + /** + * ID of the guild + */ + guild_id: Snowflake; + /** + * ID of the bot/OAuth2 application for this Discord integration + */ + application_id?: Snowflake; +} + /** * https://discord.com/developers/docs/topics/gateway#interaction-create */ @@ -985,17 +936,21 @@ export interface GatewayInviteCreateDispatchData { */ max_uses: number; /** - * The target user for this invite + * The type of user target for this voice channel invite + * + * See https://discord.com/developers/docs/resources/invite#invite-object-target-user-types + */ + target_type?: InviteTargetUserType; + /** + * The user whose stream to display for this voice channel stream invite * * See https://discord.com/developers/docs/resources/user#user-object */ target_user?: APIUser; /** - * The type of user target for this invite - * - * See https://discord.com/developers/docs/resources/invite#invite-object-target-user-types + * The embedded application to open for this voice channel embedded application invite */ - target_user_type?: InviteTargetUserType; + target_application?: Partial; /** * Whether or not the invite is temporary (invited users will be kicked on disconnect unless they're assigned a role) */ @@ -1257,8 +1212,12 @@ export interface GatewayVoiceServerUpdateDispatchData { guild_id: Snowflake; /** * The voice server host + * + * A `null` endpoint means that the voice server allocated has gone away and is trying to be reallocated. + * You should attempt to disconnect from the currently connected voice server, and not attempt to reconnect + * until a new voice server is allocated */ - endpoint: string; + endpoint: string | null; } /** @@ -1347,13 +1306,6 @@ export interface GatewayIdentifyData { * See https://discord.com/developers/docs/topics/gateway#update-status */ presence?: GatewayPresenceUpdateData; - /** - * Enables dispatching of guild subscription events (presence and typing events) - * - * @default true - * @deprecated Use `intents` instead - */ - guild_subscriptions?: boolean; /** * The Gateway Intents you wish to receive * @@ -1442,6 +1394,8 @@ export interface GatewayRequestGuildMembersData { /** * Nonce to identify the Guild Members Chunk response * + * Nonce can only be up to 32 bytes. If you send an invalid nonce it will be ignored and the reply member_chunk(s) will not have a `nonce` set. + * * See https://discord.com/developers/docs/topics/gateway#guild-members-chunk */ nonce?: string; @@ -1494,11 +1448,11 @@ export interface GatewayPresenceUpdateData { */ since: number | null; /** - * `null`, or the user's activities + * The user's activities * * See https://discord.com/developers/docs/topics/gateway#activity-object */ - activities: GatewayActivityUpdateData[] | null; + activities: GatewayActivityUpdateData[]; /** * The user's new status * diff --git a/deno/globals.ts b/deno/globals.ts new file mode 100644 index 00000000..f433bea4 --- /dev/null +++ b/deno/globals.ts @@ -0,0 +1,70 @@ +/** + * https://discord.com/developers/docs/reference#snowflakes + */ +export type Snowflake = `${bigint}`; + +/** + * https://discord.com/developers/docs/topics/permissions + * @internal + */ +export type Permissions = `${bigint}`; + +/** + * https://discord.com/developers/docs/reference#message-formatting-formats + */ +export const FormattingPatterns = { + /** + * Regular expression for matching a user mention, strictly without a nickname + * + * The `id` group property is present on the `exec` result of this expression + */ + User: /<@(?\d{17,20})>/, + /** + * Regular expression for matching a user mention, strictly with a nickname + * + * The `id` group property is present on the `exec` result of this expression + */ + UserWithNickname: /<@!(?\d{17,20})>/, + /** + * Regular expression for matching a user mention, with or without a nickname + * + * The `id` group property is present on the `exec` result of this expression + */ + UserWithOptionalNickname: /<@!?(?\d{17,20})>/, + /** + * Regular expression for matching a channel mention + * + * The `id` group property is present on the `exec` result of this expression + */ + Channel: /<#(?\d{17,20})>/, + /** + * Regular expression for matching a role mention + * + * The `id` group property is present on the `exec` result of this expression + */ + Role: /<@&(?\d{17,20})>/, + /** + * Regular expression for matching a custom emoji, either static or animated + * + * The `animated`, `name` and `id` group properties are present on the `exec` result of this expression + */ + Emoji: /<(?a)?:(?\w{2,32}):(?\d{17,20})>/, + /** + * Regular expression for matching strictly an animated custom emoji + * + * The `animated`, `name` and `id` group properties are present on the `exec` result of this expression + */ + AnimatedEmoji: /<(?a):(?\w{2,32}):(?\d{17,20})>/, + /** + * Regular expression for matching strictly a static custom emoji + * + * The `name` and `id` group properties are present on the `exec` result of this expression + */ + StaticEmoji: /<:(?\w{2,32}):(?\d{17,20})>/, +} as const; + +/** + * Freezes the formatting patterns + * @internal + */ +Object.freeze(FormattingPatterns); diff --git a/deno/payloads/mod.ts b/deno/payloads/mod.ts new file mode 100644 index 00000000..8f499952 --- /dev/null +++ b/deno/payloads/mod.ts @@ -0,0 +1,4 @@ +// This file exports all the payloads available in the recommended API version +// Thereby, things MAY break in the future. Try sticking to imports from a specific version + +export * from './v8/mod.ts'; diff --git a/deno/v6/payloads/auditLog.ts b/deno/payloads/v6/auditLog.ts similarity index 100% rename from deno/v6/payloads/auditLog.ts rename to deno/payloads/v6/auditLog.ts diff --git a/deno/v6/payloads/channel.ts b/deno/payloads/v6/channel.ts similarity index 100% rename from deno/v6/payloads/channel.ts rename to deno/payloads/v6/channel.ts diff --git a/deno/v6/payloads/emoji.ts b/deno/payloads/v6/emoji.ts similarity index 100% rename from deno/v6/payloads/emoji.ts rename to deno/payloads/v6/emoji.ts diff --git a/deno/v6/payloads/gateway.ts b/deno/payloads/v6/gateway.ts similarity index 100% rename from deno/v6/payloads/gateway.ts rename to deno/payloads/v6/gateway.ts diff --git a/deno/v6/payloads/guild.ts b/deno/payloads/v6/guild.ts similarity index 100% rename from deno/v6/payloads/guild.ts rename to deno/payloads/v6/guild.ts diff --git a/deno/v6/payloads/invite.ts b/deno/payloads/v6/invite.ts similarity index 100% rename from deno/v6/payloads/invite.ts rename to deno/payloads/v6/invite.ts diff --git a/deno/v6/payloads/mod.ts b/deno/payloads/v6/mod.ts similarity index 100% rename from deno/v6/payloads/mod.ts rename to deno/payloads/v6/mod.ts diff --git a/deno/v6/payloads/oauth2.ts b/deno/payloads/v6/oauth2.ts similarity index 100% rename from deno/v6/payloads/oauth2.ts rename to deno/payloads/v6/oauth2.ts diff --git a/deno/v6/payloads/permissions.ts b/deno/payloads/v6/permissions.ts similarity index 100% rename from deno/v6/payloads/permissions.ts rename to deno/payloads/v6/permissions.ts diff --git a/deno/v6/payloads/teams.ts b/deno/payloads/v6/teams.ts similarity index 100% rename from deno/v6/payloads/teams.ts rename to deno/payloads/v6/teams.ts diff --git a/deno/v6/payloads/user.ts b/deno/payloads/v6/user.ts similarity index 100% rename from deno/v6/payloads/user.ts rename to deno/payloads/v6/user.ts diff --git a/deno/v6/payloads/voice.ts b/deno/payloads/v6/voice.ts similarity index 100% rename from deno/v6/payloads/voice.ts rename to deno/payloads/v6/voice.ts diff --git a/deno/v6/payloads/webhook.ts b/deno/payloads/v6/webhook.ts similarity index 100% rename from deno/v6/payloads/webhook.ts rename to deno/payloads/v6/webhook.ts diff --git a/deno/v8/payloads/auditLog.ts b/deno/payloads/v8/auditLog.ts similarity index 98% rename from deno/v8/payloads/auditLog.ts rename to deno/payloads/v8/auditLog.ts index 8b668f13..5cf9174a 100644 --- a/deno/v8/payloads/auditLog.ts +++ b/deno/payloads/v8/auditLog.ts @@ -2,7 +2,7 @@ * Types extracted from https://discord.com/developers/docs/resources/audit-log */ -import type { Snowflake } from '../../common/mod.ts'; +import type { Snowflake } from '../../globals.ts'; import type { APIOverwrite, ChannelType } from './channel.ts'; import type { APIGuildIntegration, @@ -63,8 +63,7 @@ export interface APIAuditLogEntry { /** * The user who made the changes * - * *Against all odds, this can be `null` in some cases (webhooks deleting themselves - * by using their own token, for example)* + * This can be `null` in some cases (webhooks deleting themselves by using their own token, for example) */ user_id: Snowflake | null; /** diff --git a/deno/v8/payloads/channel.ts b/deno/payloads/v8/channel.ts similarity index 97% rename from deno/v8/payloads/channel.ts rename to deno/payloads/v8/channel.ts index ddfb9f26..40405200 100644 --- a/deno/v8/payloads/channel.ts +++ b/deno/payloads/v8/channel.ts @@ -2,10 +2,11 @@ * Types extracted from https://discord.com/developers/docs/resources/channel */ -import type { Permissions, Snowflake } from '../../common/mod.ts'; +import type { Permissions, Snowflake } from '../../globals.ts'; import type { APIPartialEmoji } from './emoji.ts'; import type { APIGuildMember } from './guild.ts'; import type { APIMessageInteraction } from './interactions.ts'; +import { APIApplication } from './oauth2.ts'; import type { APIRole } from './permissions.ts'; import type { APIUser } from './user.ts'; @@ -34,7 +35,7 @@ export interface APIPartialChannel { */ export interface APIChannel extends APIPartialChannel { /** - * The id of the guild + * The id of the guild (may be missing for some channel objects received over gateway guild dispatches) */ guild_id?: Snowflake; /** @@ -271,7 +272,7 @@ export interface APIMessage { */ reactions?: APIReaction[]; /** - * Used for validating a message was sent + * A nonce that can be used for optimistic message sending (up to 25 characters) * * **You will not receive this from further fetches. This is received only once from a `MESSAGE_CREATE` * event to ensure it got sent** @@ -302,7 +303,7 @@ export interface APIMessage { * * See https://discord.com/developers/docs/resources/channel#message-object-message-application-structure */ - application?: APIMessageApplication; + application?: Partial; /** * Reference data sent with crossposted messages and replies * @@ -387,32 +388,6 @@ export interface APIMessageActivity { party_id?: string; } -/** - * https://discord.com/developers/docs/resources/channel#message-object-message-application-structure - */ -export interface APIMessageApplication { - /** - * ID of the application - */ - id: Snowflake; - /** - * ID of the embed's image asset - */ - cover_image?: string; - /** - * Application's description - */ - description: string; - /** - * ID of the application's icon - */ - icon: string | null; - /** - * Name of the application - */ - name: string; -} - /** * https://discord.com/developers/docs/resources/channel#message-object-message-reference-structure */ @@ -864,6 +839,12 @@ export interface APIAttachment { * Name of file attached */ filename: string; + /** + * The attachment's media type + * + * See https://en.wikipedia.org/wiki/Media_type + */ + content_type?: string; /** * Size of file in bytes */ diff --git a/deno/v8/payloads/emoji.ts b/deno/payloads/v8/emoji.ts similarity index 94% rename from deno/v8/payloads/emoji.ts rename to deno/payloads/v8/emoji.ts index d13023e8..583a5428 100644 --- a/deno/v8/payloads/emoji.ts +++ b/deno/payloads/v8/emoji.ts @@ -2,7 +2,7 @@ * Types extracted from https://discord.com/developers/docs/resources/emoji */ -import type { Snowflake } from '../../common/mod.ts'; +import type { Snowflake } from '../../globals.ts'; import type { APIRole } from './permissions.ts'; import type { APIUser } from './user.ts'; diff --git a/deno/v8/payloads/gateway.ts b/deno/payloads/v8/gateway.ts similarity index 96% rename from deno/v8/payloads/gateway.ts rename to deno/payloads/v8/gateway.ts index b9f9582e..e083700c 100644 --- a/deno/v8/payloads/gateway.ts +++ b/deno/payloads/v8/gateway.ts @@ -2,7 +2,7 @@ * Types extracted from https://discord.com/developers/docs/topics/gateway */ -import type { Snowflake } from '../../common/mod.ts'; +import type { Snowflake } from '../../globals.ts'; import type { APIEmoji } from './emoji.ts'; import type { APIUser } from './user.ts'; @@ -201,6 +201,9 @@ export interface GatewayActivity { * See https://en.wikipedia.org/wiki/Bit_field */ flags?: ActivityFlags; + /** + * The custom buttons shown in the Rich Presence (max 2) + */ buttons?: string[] | GatewayActivityButton[]; } @@ -298,6 +301,12 @@ export enum ActivityFlags { } export interface GatewayActivityButton { + /** + * The text shown on the button (1-32 characters) + */ label: string; + /** + * The url opened when clicking the button (1-512 characters) + */ url: string; } diff --git a/deno/v8/payloads/guild.ts b/deno/payloads/v8/guild.ts similarity index 99% rename from deno/v8/payloads/guild.ts rename to deno/payloads/v8/guild.ts index e1d625b7..fa2c0b0f 100644 --- a/deno/v8/payloads/guild.ts +++ b/deno/payloads/v8/guild.ts @@ -2,7 +2,7 @@ * Types extracted from https://discord.com/developers/docs/resources/guild */ -import type { Permissions, Snowflake } from '../../common/mod.ts'; +import type { Permissions, Snowflake } from '../../globals.ts'; import type { APIChannel } from './channel.ts'; import type { APIEmoji } from './emoji.ts'; import type { GatewayPresenceUpdate, PresenceUpdateStatus } from './gateway.ts'; @@ -807,6 +807,10 @@ export interface APIGuildWelcomeScreenChannel { * The channel id that is suggested */ channel_id: Snowflake; + /** + * The description shown for the channel + */ + description: string; /** * The emoji id of the emoji that is shown on the left of the channel */ diff --git a/deno/v8/payloads/interactions.ts b/deno/payloads/v8/interactions.ts similarity index 80% rename from deno/v8/payloads/interactions.ts rename to deno/payloads/v8/interactions.ts index 3001f782..c8ce3a11 100644 --- a/deno/v8/payloads/interactions.ts +++ b/deno/payloads/v8/interactions.ts @@ -1,16 +1,37 @@ -import type { Permissions, Snowflake } from '../../common/mod.ts'; -import type { RESTPostAPIWebhookWithTokenJSONBody } from '../rest/mod.ts'; +import type { Permissions, Snowflake } from '../../globals.ts'; +import type { RESTPostAPIWebhookWithTokenJSONBody } from '../../rest/v8/mod.ts'; import type { APIGuildMember, APIPartialChannel, APIRole, APIUser, MessageFlags } from './mod.ts'; /** * https://discord.com/developers/docs/interactions/slash-commands#applicationcommand */ export interface APIApplicationCommand { + /** + * Unique id of the command + */ id: Snowflake; + /** + * Unique id of the parent application + */ application_id: Snowflake; + /** + * 1-32 character name matching `^[\w-]{1,32}$` + */ name: string; + /** + * 1-100 character description + */ description: string; + /** + * The parameters for the command + */ options?: APIApplicationCommandOption[]; + /** + * Whether the command is enabled by default when the app is added to a guild + * + * If missing, this property should be assumed as `true` + */ + default_permissions?: boolean; } interface APIApplicationCommandOptionBase { @@ -114,6 +135,11 @@ export interface APIBaseInteraction { * https://discord.com/developers/docs/interactions/slash-commands#interaction */ export interface APIGuildInteraction extends APIBaseInteraction { + /** + * The guild it was sent from + * + * In the case of an `APIDMInteraction`, this will not be present + */ guild_id: Snowflake; /** * Guild member data for the invoking user, including permissions @@ -126,12 +152,6 @@ export interface APIGuildInteraction extends APIBaseInteraction { * https://discord.com/developers/docs/interactions/slash-commands#interaction */ export interface APIDMInteraction extends APIBaseInteraction { - /** - * The guild it was sent from - * - * In the case of an `APIDMInteraction`, this will not be present - */ - guild_id?: never; /** * User object for the invoking user, if invoked in a DM */ @@ -145,9 +165,27 @@ export interface APIDMInteraction extends APIBaseInteraction { export type APIInteraction = APIGuildInteraction | APIDMInteraction; /** - * Like APIInteraction, only with the `data` property always present + * Like APIGuildInteraction, only with the `data` property always present + * + * @see APIGuildInteraction */ -export type APIApplicationCommandInteraction = Required; +export type APIApplicationCommandGuildInteraction = Required; + +/** + * Like APIDMInteraction, only with the `data` property always present + * + * @see APIDMInteraction + */ +export type APIApplicationCommandDMInteraction = Required; + +/** + * Like APIInteraction, only with the `data` property always present + * + * @see APIInteraction + */ +export type APIApplicationCommandInteraction = + | APIApplicationCommandGuildInteraction + | APIApplicationCommandDMInteraction; /** * https://discord.com/developers/docs/interactions/slash-commands#interaction-interactiontype @@ -157,6 +195,54 @@ export enum InteractionType { ApplicationCommand, } +/** + * https://discord.com/developers/docs/interactions/slash-commands#guildapplicationcommandpermissions + */ +export interface APIGuildApplicationCommandPermissions { + /** + * The id of the command + */ + id: Snowflake; + /** + * The id of the application the command belongs to + */ + application_id: Snowflake; + /** + * The id of the guild + */ + guild_id: Snowflake; + /** + * The permissions for the command in the guild + */ + permissions: APIApplicationCommandPermission[]; +} + +/** + * https://discord.com/developers/docs/interactions/slash-commands#applicationcommandpermissions + */ +export interface APIApplicationCommandPermission { + /** + * The id of the role or user + */ + id: Snowflake; + /** + * Role or user + */ + type: ApplicationCommandPermissionType; + /** + * `true` to allow, `false`, to disallow + */ + permission: boolean; +} + +/** + * https://discord.com/developers/docs/interactions/slash-commands#applicationcommandpermissiontype + */ +export enum ApplicationCommandPermissionType { + ROLE = 1, + USER, +} + /** * https://discord.com/developers/docs/interactions/slash-commands#interaction-applicationcommandinteractiondata */ diff --git a/deno/v8/payloads/invite.ts b/deno/payloads/v8/invite.ts similarity index 74% rename from deno/v8/payloads/invite.ts rename to deno/payloads/v8/invite.ts index a4bc3bb1..de7821c0 100644 --- a/deno/v8/payloads/invite.ts +++ b/deno/payloads/v8/invite.ts @@ -4,6 +4,7 @@ import type { APIPartialChannel } from './channel.ts'; import type { APIPartialGuild } from './guild.ts'; +import type { APIApplication } from './oauth2.ts'; import type { APIUser } from './user.ts'; /** @@ -33,23 +34,27 @@ export interface APIInvite { */ inviter?: APIUser; /** - * The target user for this invite + * The type of user target for this voice channel invite + * + * See https://discord.com/developers/docs/resources/invite#invite-object-target-user-types + */ + target_type?: InviteTargetUserType; + /** + * The user whose stream to display for this voice channel stream invite * * See https://discord.com/developers/docs/resources/user#user-object */ target_user?: APIUser; /** - * The type of user target for this invite - * - * See https://discord.com/developers/docs/resources/invite#invite-object-target-user-types + * The embedded application to open for this voice channel embedded application invite */ - target_user_type?: InviteTargetUserType; + target_application?: Partial; /** - * Approximate count of online members (only present when `target_user` is set) + * Approximate count of online members, returned from the `GET /invites/` endpoint when `with_counts` is `true` */ approximate_presence_count?: number; /** - * Approximate count of total members + * Approximate count of total members, returned from the `GET /invites/` endpoint when `with_counts` is `true` */ approximate_member_count?: number; } @@ -59,6 +64,7 @@ export interface APIInvite { */ export enum InviteTargetUserType { STREAM = 1, + EMBEDDED_APPLICATION, } /** diff --git a/deno/v8/payloads/mod.ts b/deno/payloads/v8/mod.ts similarity index 100% rename from deno/v8/payloads/mod.ts rename to deno/payloads/v8/mod.ts diff --git a/deno/v8/payloads/oauth2.ts b/deno/payloads/v8/oauth2.ts similarity index 94% rename from deno/v8/payloads/oauth2.ts rename to deno/payloads/v8/oauth2.ts index de1b7123..7364b614 100644 --- a/deno/v8/payloads/oauth2.ts +++ b/deno/payloads/v8/oauth2.ts @@ -2,7 +2,7 @@ * Types extracted from https://discord.com/developers/docs/topics/oauth2 */ -import type { Snowflake } from '../../common/mod.ts'; +import type { Snowflake } from '../../globals.ts'; import type { APITeam } from './teams.ts'; import type { APIUser } from './user.ts'; @@ -38,6 +38,14 @@ export interface APIApplication { * When `true` the app's bot will only join upon completion of the full oauth2 code grant flow */ bot_require_code_grant: boolean; + /** + * The url of the application's terms of service + */ + terms_of_service_url?: string; + /** + * The url of the application's privacy policy + */ + privacy_policy_url?: string; /** * Partial user object containing info on the owner of the application * @@ -50,7 +58,7 @@ export interface APIApplication { */ summary: string; /** - * The base64 encoded key for the GameSDK's GetTicket + * The hexadecimal encoded key for verification in interactions and the GameSDK's GetTicket function * * See https://discord.com/developers/docs/game-sdk/applications#get-ticket */ @@ -88,7 +96,7 @@ export enum ApplicationFlags { GroupDMCreate = 1 << 4, RPCHasConnected = 1 << 11, GatewayPresence = 1 << 12, - GatewayPresenceLimit = 1 << 13, + GatewayPresenceLimited = 1 << 13, GatewayGuildMembers = 1 << 14, GatewayGuildMembersLimited = 1 << 15, VerificationPendingGuildLimit = 1 << 16, @@ -148,10 +156,6 @@ export enum OAuth2Scopes { * For local rpc server access, this allows you to control a user's local Discord client - whitelist only */ RPC = 'rpc', - /** - * For local rpc server api access, this allows you to access the API as the local user - whitelist only - */ - RPCApi = 'rpc.api', /** * For local rpc server api access, this allows you to receive notifications pushed out to the user - whitelist only */ diff --git a/v8/payloads/permissions.ts b/deno/payloads/v8/permissions.ts similarity index 96% rename from v8/payloads/permissions.ts rename to deno/payloads/v8/permissions.ts index 13974023..c8e2131f 100644 --- a/v8/payloads/permissions.ts +++ b/deno/payloads/v8/permissions.ts @@ -2,7 +2,7 @@ * Types extracted from https://discord.com/developers/docs/topics/permissions */ -import type { Permissions, Snowflake } from '../../common/index'; +import type { Permissions, Snowflake } from '../../globals.ts'; /** * https://discord.com/developers/docs/topics/permissions#permissions-bitwise-permission-flags @@ -43,7 +43,7 @@ export const PermissionFlagsBits = { MANAGE_ROLES: 1n << 28n, MANAGE_WEBHOOKS: 1n << 29n, MANAGE_EMOJIS: 1n << 30n, - USE_APPLICATION_COMMANDS: 1n << 31n, + USE_SLASH_COMMANDS: 1n << 31n, REQUEST_TO_SPEAK: 1n << 32n, } as const; diff --git a/deno/v8/payloads/teams.ts b/deno/payloads/v8/teams.ts similarity index 96% rename from deno/v8/payloads/teams.ts rename to deno/payloads/v8/teams.ts index 842f839c..b9d5f00c 100644 --- a/deno/v8/payloads/teams.ts +++ b/deno/payloads/v8/teams.ts @@ -2,7 +2,7 @@ * Types extracted from https://discord.com/developers/docs/topics/teams */ -import type { Snowflake } from '../../common/mod.ts'; +import type { Snowflake } from '../../globals.ts'; import type { APIUser } from './user.ts'; /** diff --git a/deno/v8/payloads/template.ts b/deno/payloads/v8/template.ts similarity index 91% rename from deno/v8/payloads/template.ts rename to deno/payloads/v8/template.ts index e1090d7e..b0eb8130 100644 --- a/deno/v8/payloads/template.ts +++ b/deno/payloads/v8/template.ts @@ -2,8 +2,8 @@ * Types extracted from https://discord.com/developers/docs/resources/template */ -import type { Snowflake } from '../../common/mod.ts'; -import type { RESTPostAPIGuildsJSONBody } from '../rest/mod.ts'; +import type { Snowflake } from '../../globals.ts'; +import type { RESTPostAPIGuildsJSONBody } from '../../rest/v8/mod.ts'; import type { APIUser } from './user.ts'; /** diff --git a/deno/v8/payloads/user.ts b/deno/payloads/v8/user.ts similarity index 97% rename from deno/v8/payloads/user.ts rename to deno/payloads/v8/user.ts index 10bce683..cf601923 100644 --- a/deno/v8/payloads/user.ts +++ b/deno/payloads/v8/user.ts @@ -2,7 +2,7 @@ * Types extracted from https://discord.com/developers/docs/resources/user */ -import type { Snowflake } from '../../common/mod.ts'; +import type { Snowflake } from '../../globals.ts'; import type { APIGuildIntegration } from './guild.ts'; /** @@ -85,7 +85,6 @@ export enum UserFlags { HypeSquadHouseBalance = 1 << 8, EarlySupporter = 1 << 9, TeamUser = 1 << 10, - System = 1 << 12, BugHunterLevel2 = 1 << 14, VerifiedBot = 1 << 16, EarlyVerifiedBotDeveloper = 1 << 17, diff --git a/deno/v8/payloads/voice.ts b/deno/payloads/v8/voice.ts similarity index 97% rename from deno/v8/payloads/voice.ts rename to deno/payloads/v8/voice.ts index 8c8a1569..26895ba4 100644 --- a/deno/v8/payloads/voice.ts +++ b/deno/payloads/v8/voice.ts @@ -2,7 +2,7 @@ * Types extracted from https://discord.com/developers/docs/resources/voice */ -import type { Snowflake } from '../../common/mod.ts'; +import type { Snowflake } from '../../globals.ts'; import type { APIGuildMember } from './guild.ts'; /** diff --git a/deno/v8/payloads/webhook.ts b/deno/payloads/v8/webhook.ts similarity index 80% rename from deno/v8/payloads/webhook.ts rename to deno/payloads/v8/webhook.ts index 01bb3aab..2eb05935 100644 --- a/deno/v8/payloads/webhook.ts +++ b/deno/payloads/v8/webhook.ts @@ -2,7 +2,7 @@ * Types extracted from https://discord.com/developers/docs/resources/webhook */ -import type { Snowflake } from '../../common/mod.ts'; +import type { Snowflake } from '../../globals.ts'; import type { APIPartialChannel, APIPartialGuild, APIUser } from './mod.ts'; /** @@ -49,8 +49,18 @@ export interface APIWebhook { * The bot/OAuth2 application that created this webhook */ application_id: Snowflake | null; + /** + * The guild of the channel that this webhook is following (returned for Channel Follower Webhooks) + */ source_guild?: APIPartialGuild; + /** + * The channel that this webhook is following (returned for Channel Follower Webhooks) + */ source_channel?: APIPartialChannel; + /** + * The url used for executing the webhook (returned by the webhooks OAuth2 flow) + */ + url?: string; } export enum WebhookType { diff --git a/deno/rest/common.ts b/deno/rest/common.ts new file mode 100644 index 00000000..9d02ac50 --- /dev/null +++ b/deno/rest/common.ts @@ -0,0 +1,112 @@ +/** + * 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, + UnknownWebhook, + + UnknownBan = 10026, + UnknownSKU, + UnknownStoreListing, + UnknownEntitlement, + UnknownBuild, + UnknownLobby, + UnknownBranch, + + UnknownRedistributable = 10036, + + UnknownGuildTemplate = 10057, + + UnknownApplicationCommand = 10063, + + BotsCannotUseThisEndpoint = 20001, + OnlyBotsCanUseThisEndpoint, + + AnnouncementEditLimitExceeded = 20022, + + ChannelSendRateLimit = 20028, + + MaximumNumberOfGuildsReached = 30001, + MaximumNumberOfFriendsReached, + MaximumNumberOfPinsReachedForTheChannel, + + MaximumNumberOfGuildRolesReached = 30005, + + MaximumNumberOfWebhooksReached = 30007, + + MaximumNumberOfReactionsReached = 30010, + + MaximumNumberOfGuildChannelsReached = 30013, + + MaximumNumberOfAttachmentsInAMessageReached = 30015, + MaximumNumberOfInvitesReached, + + GuildAlreadyHasTemplate = 30031, + + Unauthorized = 40001, + VerifyYourAccount, + + RequestEntityTooLarge = 40005, + FeatureTemporarilyDisabledServerSide, + UserBannedFromThisGuild, + + ThisMessageWasAlreadyCrossposted = 40033, + + MissingAccess = 50001, + InvalidAccountType, + CannotExecuteActionOnDMChannel, + GuildWidgetDisabled, + CannotEditMessageAuthoredByAnotherUser, + CannotSendAnEmptyMessage, + CannotSendMessagesToThisUser, + CannotSendMessagesInVoiceChannel, + ChannelVerificationLevelTooHighForYouToGainAccess, + Oauth2ApplicationDoesNotHaveBot, + Oauth2ApplicationLimitReached, + InvalidOauth2State, + MissingPermissions, + InvalidToken, + NoteWasTooLong, + ProvidedTooFewOrTooManyMessagesToDelete, + + MessageCanOnlyBePinnedInTheChannelItWasSentIn = 50019, + InviteCodeInvalidOrTaken, + CannotExecuteActionOnSystemMessage, + + CannotExecuteActionOnThisChannelType = 50024, + InvalidOauth2AccessToken, + + InvalidWebhookToken = 50027, + + InvalidRecipients = 50033, + OneOfTheMessagesProvidedWasTooOldForBulkDelete, + InvalidFormBodyOrContentType, + InviteAcceptedToGuildWithoutTheBotBeingIn, + + InvalidAPIVersion = 50041, + + CannotDeleteChannelRequiredForCommunityGuilds = 50074, + + InvalidStickerSent = 50081, + + TwoFactorAuthenticationIsRequired = 60003, + + ReactionWasBlocked = 90001, + + APIResourceOverloaded = 130000, +} diff --git a/deno/rest/mod.ts b/deno/rest/mod.ts new file mode 100644 index 00000000..4fe447ba --- /dev/null +++ b/deno/rest/mod.ts @@ -0,0 +1,4 @@ +// This file exports all the types available in the recommended API version +// Thereby, things MAY break in the future. Try sticking to imports from a specific version + +export * from './v8/mod.ts'; diff --git a/v6/rest/auditLog.ts b/deno/rest/v6/auditLog.ts similarity index 85% rename from v6/rest/auditLog.ts rename to deno/rest/v6/auditLog.ts index 68255de5..f834d2ed 100644 --- a/v6/rest/auditLog.ts +++ b/deno/rest/v6/auditLog.ts @@ -1,4 +1,4 @@ -import type { APIAuditLog, AuditLogEvent } from '../payloads/auditLog'; +import type { APIAuditLog, AuditLogEvent } from '../../payloads/v6/auditLog.ts'; /** * https://discord.com/developers/docs/resources/audit-log#get-guild-audit-log diff --git a/deno/v6/rest/channel.ts b/deno/rest/v6/channel.ts similarity index 99% rename from deno/v6/rest/channel.ts rename to deno/rest/v6/channel.ts index 59c11edb..b3a3b515 100644 --- a/deno/v6/rest/channel.ts +++ b/deno/rest/v6/channel.ts @@ -11,7 +11,7 @@ import type { InviteTargetUserType, MessageFlags, OverwriteType, -} from '../payloads/mod.ts'; +} from '../../payloads/v6/mod.ts'; // #region TypeDefs diff --git a/v6/rest/emoji.ts b/deno/rest/v6/emoji.ts similarity index 96% rename from v6/rest/emoji.ts rename to deno/rest/v6/emoji.ts index 8f1bb2c8..69b47a91 100644 --- a/v6/rest/emoji.ts +++ b/deno/rest/v6/emoji.ts @@ -1,4 +1,4 @@ -import type { APIEmoji } from '../payloads/index'; +import type { APIEmoji } from '../../payloads/v6/mod.ts'; /** * https://discord.com/developers/docs/resources/emoji#list-guild-emojis diff --git a/deno/v6/rest/gateway.ts b/deno/rest/v6/gateway.ts similarity index 85% rename from deno/v6/rest/gateway.ts rename to deno/rest/v6/gateway.ts index b395eeae..8e8501a7 100644 --- a/deno/v6/rest/gateway.ts +++ b/deno/rest/v6/gateway.ts @@ -1,4 +1,4 @@ -import type { APIGatewayBotInfo, APIGatewayInfo } from '../payloads/mod.ts'; +import type { APIGatewayBotInfo, APIGatewayInfo } from '../../payloads/v6/mod.ts'; /** * https://discord.com/developers/docs/topics/gateway#get-gateway diff --git a/deno/v6/rest/guild.ts b/deno/rest/v6/guild.ts similarity index 99% rename from deno/v6/rest/guild.ts rename to deno/rest/v6/guild.ts index a0a46c29..4cc4056b 100644 --- a/deno/v6/rest/guild.ts +++ b/deno/rest/v6/guild.ts @@ -15,7 +15,7 @@ import type { GuildVerificationLevel, GuildWidgetStyle, IntegrationExpireBehavior, -} from '../payloads/mod.ts'; +} from '../../payloads/v6/mod.ts'; import type { RESTPutAPIChannelPermissionsJSONBody } from './channel.ts'; /** diff --git a/deno/v6/rest/invite.ts b/deno/rest/v6/invite.ts similarity index 91% rename from deno/v6/rest/invite.ts rename to deno/rest/v6/invite.ts index 4e90f0f0..8fec6546 100644 --- a/deno/v6/rest/invite.ts +++ b/deno/rest/v6/invite.ts @@ -1,4 +1,4 @@ -import type { APIInvite } from '../payloads/mod.ts'; +import type { APIInvite } from '../../payloads/v6/mod.ts'; /** * https://discord.com/developers/docs/resources/invite#get-invite diff --git a/deno/v6/rest/mod.ts b/deno/rest/v6/mod.ts similarity index 99% rename from deno/v6/rest/mod.ts rename to deno/rest/v6/mod.ts index b2bdf620..3399b104 100644 --- a/deno/v6/rest/mod.ts +++ b/deno/rest/v6/mod.ts @@ -1,3 +1,5 @@ +export * from '../common.ts'; + export * from './auditLog.ts'; export * from './channel.ts'; export * from './emoji.ts'; diff --git a/v6/rest/oauth2.ts b/deno/rest/v6/oauth2.ts similarity index 98% rename from v6/rest/oauth2.ts rename to deno/rest/v6/oauth2.ts index 13a9ca13..7bcd3590 100644 --- a/v6/rest/oauth2.ts +++ b/deno/rest/v6/oauth2.ts @@ -1,4 +1,4 @@ -import type { APIApplication, APIGuild, APIWebhook } from '../payloads/index'; +import type { APIApplication, APIGuild, APIWebhook } from '../../payloads/v6/mod.ts'; /** * https://discord.com/developers/docs/topics/oauth2#get-current-application-information diff --git a/deno/v6/rest/user.ts b/deno/rest/v6/user.ts similarity index 98% rename from deno/v6/rest/user.ts rename to deno/rest/v6/user.ts index caa5c4d6..811222d3 100644 --- a/deno/v6/rest/user.ts +++ b/deno/rest/v6/user.ts @@ -1,4 +1,4 @@ -import type { APIChannel, APIConnection, APIUser, GuildFeature } from '../payloads/mod.ts'; +import type { APIChannel, APIConnection, APIUser, GuildFeature } from '../../payloads/v6/mod.ts'; /** * https://discord.com/developers/docs/resources/user#get-current-user diff --git a/deno/v6/rest/voice.ts b/deno/rest/v6/voice.ts similarity index 79% rename from deno/v6/rest/voice.ts rename to deno/rest/v6/voice.ts index a6390189..543ed285 100644 --- a/deno/v6/rest/voice.ts +++ b/deno/rest/v6/voice.ts @@ -1,4 +1,4 @@ -import type { APIVoiceRegion } from '../payloads/mod.ts'; +import type { APIVoiceRegion } from '../../payloads/v6/mod.ts'; /** * https://discord.com/developers/docs/resources/voice#list-voice-regions diff --git a/deno/v6/rest/webhook.ts b/deno/rest/v6/webhook.ts similarity index 98% rename from deno/v6/rest/webhook.ts rename to deno/rest/v6/webhook.ts index 1b53e3e6..51951eea 100644 --- a/deno/v6/rest/webhook.ts +++ b/deno/rest/v6/webhook.ts @@ -1,5 +1,5 @@ import type { APIAllowedMentionsSend } from './channel.ts'; -import type { APIEmbed, APIMessage, APIWebhook } from '../payloads/mod.ts'; +import type { APIEmbed, APIMessage, APIWebhook } from '../../payloads/v6/mod.ts'; /** * https://discord.com/developers/docs/resources/webhook#create-webhook diff --git a/deno/v8/rest/auditLog.ts b/deno/rest/v8/auditLog.ts similarity index 80% rename from deno/v8/rest/auditLog.ts rename to deno/rest/v8/auditLog.ts index 1b54f186..0a943c13 100644 --- a/deno/v8/rest/auditLog.ts +++ b/deno/rest/v8/auditLog.ts @@ -1,5 +1,5 @@ -import type { Snowflake } from '../../common/mod.ts'; -import type { APIAuditLog, AuditLogEvent } from '../payloads/auditLog.ts'; +import type { Snowflake } from '../../globals.ts'; +import type { APIAuditLog, AuditLogEvent } from '../../payloads/v8/auditLog.ts'; /** * https://discord.com/developers/docs/resources/audit-log#get-guild-audit-log diff --git a/deno/v8/rest/channel.ts b/deno/rest/v8/channel.ts similarity index 95% rename from deno/v8/rest/channel.ts rename to deno/rest/v8/channel.ts index eb76895c..93d50154 100644 --- a/deno/v8/rest/channel.ts +++ b/deno/rest/v8/channel.ts @@ -1,4 +1,4 @@ -import type { Permissions, Snowflake } from '../../common/mod.ts'; +import type { Permissions, Snowflake } from '../../globals.ts'; import type { APIAllowedMentions, APIChannel, @@ -14,7 +14,7 @@ import type { MessageFlags, OverwriteType, VideoQualityMode, -} from '../payloads/mod.ts'; +} from '../../payloads/v8/mod.ts'; /** * https://discord.com/developers/docs/resources/channel#get-channel @@ -246,10 +246,6 @@ export type RESTDeleteAPIChannelMessageUserReactionResult = never; * https://discord.com/developers/docs/resources/channel#get-reactions */ export interface RESTGetAPIChannelMessageReactionUsersQuery { - /** - * Get users before this user ID - */ - before?: Snowflake; /** * Get users after this user ID */ @@ -389,13 +385,21 @@ export interface RESTPostAPIChannelInviteJSONBody { */ unique?: boolean; /** - * The target user id for this invite + * The type of target user for this voice channel invite */ - target_user_id?: string; + target_type?: InviteTargetUserType; /** - * The type of target user for this invite + * The id of the user whose stream to display for this invite + * - Required if `target_type` is 1 + * - The user must be streaming in the channel */ - target_user_type?: InviteTargetUserType; + target_user_id?: Snowflake; + /** + * The id of the embedded application to open for this invite + * - Required if `target_type` is 2 + * - The application must have the `EMBEDDED` flag + */ + target_application_id?: Snowflake; } /** diff --git a/deno/v8/rest/emoji.ts b/deno/rest/v8/emoji.ts similarity index 92% rename from deno/v8/rest/emoji.ts rename to deno/rest/v8/emoji.ts index cdbd9e32..ec9886fe 100644 --- a/deno/v8/rest/emoji.ts +++ b/deno/rest/v8/emoji.ts @@ -1,5 +1,5 @@ -import type { Snowflake } from '../../common/mod.ts'; -import type { APIEmoji } from '../payloads/mod.ts'; +import type { Snowflake } from '../../globals.ts'; +import type { APIEmoji } from '../../payloads/v8/mod.ts'; /** * https://discord.com/developers/docs/resources/emoji#list-guild-emojis diff --git a/deno/v8/rest/gateway.ts b/deno/rest/v8/gateway.ts similarity index 76% rename from deno/v8/rest/gateway.ts rename to deno/rest/v8/gateway.ts index c939050b..4897147d 100644 --- a/deno/v8/rest/gateway.ts +++ b/deno/rest/v8/gateway.ts @@ -1,4 +1,4 @@ -import type { APIGatewayBotInfo, APIGatewayInfo } from '../payloads/mod.ts'; +import type { APIGatewayBotInfo, APIGatewayInfo } from '../../payloads/v8/mod.ts'; /** * https://discord.com/developers/docs/topics/gateway#get-gateway diff --git a/deno/v8/rest/guild.ts b/deno/rest/v8/guild.ts similarity index 94% rename from deno/v8/rest/guild.ts rename to deno/rest/v8/guild.ts index 39bf98a5..7cb63a96 100644 --- a/deno/v8/rest/guild.ts +++ b/deno/rest/v8/guild.ts @@ -1,4 +1,4 @@ -import type { Permissions, Snowflake } from '../../common/mod.ts'; +import type { Permissions, Snowflake } from '../../globals.ts'; import type { APIBan, APIChannel, @@ -8,6 +8,7 @@ import type { APIGuildMember, APIGuildMembershipScreening, APIGuildPreview, + APIGuildWelcomeScreen, APIGuildWidget, APIGuildWidgetSettings, APIRole, @@ -18,8 +19,7 @@ import type { GuildSystemChannelFlags, GuildVerificationLevel, GuildWidgetStyle, - IntegrationExpireBehavior, -} from '../payloads/mod.ts'; +} from '../../payloads/v8/mod.ts'; import type { RESTPutAPIChannelPermissionJSONBody } from './channel.ts'; export interface APIGuildCreateOverwrite extends RESTPutAPIChannelPermissionJSONBody { @@ -330,6 +330,9 @@ export interface RESTGetAPIGuildMembersQuery { */ export type RESTGetAPIGuildMembersResult = APIGuildMember[]; +/** + * https://discord.com/developers/docs/resources/guild#search-guild-members + */ export interface RESTGetAPIGuildMembersSearchQuery { /** * Query string to match username(s) and nickname(s) against @@ -661,51 +664,11 @@ export type RESTGetAPIGuildInvitesResult = APIExtendedInvite[]; */ export type RESTGetAPIGuildIntegrationsResult = APIGuildIntegration[]; -/** - * https://discord.com/developers/docs/resources/guild#create-guild-integration - */ -export interface RESTPostAPIGuildIntegrationJSONBody { - type: string; - id: Snowflake; -} - -export type RESTPostAPIGuildIntegrationResult = never; - -/** - * https://discord.com/developers/docs/resources/guild#modify-guild-integration - */ -export interface RESTPatchAPIGuildIntegrationJSONBody { - /** - * The behavior when an integration subscription lapses - * - * See https://discord.com/developers/docs/resources/guild#integration-object-integration-expire-behaviors - */ - expire_behavior?: IntegrationExpireBehavior | null; - /** - * Period (in days) where the integration will ignore lapsed subscriptions - */ - expire_grace_period?: number | null; - /** - * Whether emoticons should be synced for this integration (`twitch` only currently) - */ - enable_emoticons?: boolean | null; -} - -/** - * https://discord.com/developers/docs/resources/guild#modify-guild-integration - */ -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-settings */ @@ -796,3 +759,22 @@ export interface RESTPatchAPIGuildVoiceStateUserJSONBody { */ suppress?: boolean; } + +/** + * https://discord.com/developers/docs/resources/guild#get-guild-welcome-screen + */ +export type RESTGetAPIGuildWelcomeScreenResult = APIGuildWelcomeScreen; + +/** + * https://discord.com/developers/docs/resources/guild#modify-guild-welcome-screen + */ +export interface RESTPatchAPIGuildWelcomeScreenJSONBody extends Nullable> { + /** + * Whether the welcome screen is enabled + */ + enabled?: boolean | null; +} + +type Nullable = { + [P in keyof T]: T[P] | null; +}; diff --git a/deno/v8/rest/interactions.ts b/deno/rest/v8/interactions.ts similarity index 55% rename from deno/v8/rest/interactions.ts rename to deno/rest/v8/interactions.ts index 4d807ac1..e4cdbd29 100644 --- a/deno/v8/rest/interactions.ts +++ b/deno/rest/v8/interactions.ts @@ -1,4 +1,9 @@ -import type { APIApplicationCommand, APIInteractionResponse } from '../payloads/mod.ts'; +import type { + APIApplicationCommand, + APIApplicationCommandPermission, + APIGuildApplicationCommandPermissions, + APIInteractionResponse, +} from '../../payloads/v8/mod.ts'; /** * https://discord.com/developers/docs/interactions/slash-commands#get-global-application-commands @@ -30,6 +35,16 @@ export type RESTPatchAPIApplicationCommandJSONBody = Partial[]; + +/** + * https://discord.com/developers/docs/interactions/slash-commands#batch-edit-application-command-permissions + */ +export type RESTPutAPIGuildApplicationCommandsPermissionsResult = APIGuildApplicationCommandPermissions[]; diff --git a/deno/v8/rest/invite.ts b/deno/rest/v8/invite.ts similarity index 87% rename from deno/v8/rest/invite.ts rename to deno/rest/v8/invite.ts index 90c4a58b..063c7758 100644 --- a/deno/v8/rest/invite.ts +++ b/deno/rest/v8/invite.ts @@ -1,4 +1,4 @@ -import type { APIInvite } from '../payloads/mod.ts'; +import type { APIInvite } from '../../payloads/v8/mod.ts'; /** * https://discord.com/developers/docs/resources/invite#get-invite diff --git a/deno/v8/rest/mod.ts b/deno/rest/v8/mod.ts similarity index 93% rename from deno/v8/rest/mod.ts rename to deno/rest/v8/mod.ts index 37ad248b..9455bac0 100644 --- a/deno/v8/rest/mod.ts +++ b/deno/rest/v8/mod.ts @@ -1,4 +1,6 @@ -import type { Snowflake } from '../../common/mod.ts'; +import type { Snowflake } from '../../globals.ts'; + +export * from '../common.ts'; export * from './auditLog.ts'; export * from './channel.ts'; @@ -14,6 +16,7 @@ export * from './voice.ts'; export * from './webhook.ts'; export const APIVersion = '8'; + export const Routes = { /** * Route for: @@ -332,7 +335,6 @@ export const Routes = { /** * Route for: * - GET `/guilds/{guild.id}/integrations` - * - POST `/guilds/{guild.id}/integrations` */ guildIntegrations(guildID: Snowflake) { return `/guilds/${guildID}/integrations` as const; @@ -340,21 +342,12 @@ export const Routes = { /** * Route for: - * - PATCH `/guilds/{guild.id}/integrations/{integration.id}` * - DELETE `/guilds/{guild.id}/integrations/{integration.id}` */ guildIntegration(guildID: Snowflake, integrationID: Snowflake) { return `/guilds/${guildID}/integrations/${integrationID}` as const; }, - /** - * Route for: - * - POST `/guilds/{guild.id}/integrations/{integration.id}/sync` - */ - guildIntegrationSync(guildID: Snowflake, integrationID: Snowflake) { - return `/guilds/${guildID}/integrations/${integrationID}/sync` as const; - }, - /** * Route for: * - GET `/guilds/{guild.id}/widget` @@ -575,6 +568,7 @@ export const Routes = { /** * Route for: * - GET `/applications/{application.id}/commands` + * - PUT `/applications/{application.id}/commands` * - POST `/applications/{application.id}/commands` */ applicationCommands(applicationID: Snowflake) { @@ -594,6 +588,7 @@ export const Routes = { /** * Route for: * - GET `/applications/{application.id}/guilds/{guild.id}/commands` + * - PUT `/applications/{application.id}/guilds/{guild.id}/commands` * - POST `/applications/{application.id}/guilds/{guild.id}/commands` */ applicationGuildCommands(applicationID: Snowflake, guildID: Snowflake) { @@ -635,6 +630,33 @@ export const Routes = { guildVoiceState(guildID: Snowflake, userID: Snowflake | '@me' = '@me') { return `/guilds/${guildID}/voice-states/${userID}` as const; }, + + /** + * Route for: + * - GET `/applications/{application.id}/guilds/{guild.id}/commands/permissions` + * - PUT `/applications/{application.id}/guilds/{guild.id}/commands/permissions` + */ + guildApplicationCommandsPermissions(applicationID: Snowflake, guildID: Snowflake) { + return `/applications/${applicationID}/guilds/${guildID}/commands/permissions` as const; + }, + + /** + * Route for: + * - GET `/applications/{application.id}/guilds/{guild.id}/commands/{command.id}/permissions` + * - PUT `/applications/{application.id}/guilds/{guild.id}/commands/{command.id}/permissions` + */ + applicationCommandPermissions(applicationID: Snowflake, guildID: Snowflake, commandID: Snowflake) { + return `/applications/${applicationID}/guilds/${guildID}/commands/${commandID}/permissions` as const; + }, + + /** + * Route for: + * - GET `/guilds/{guild.id}/welcome-screen` + * - PATCH `/guilds/{guild.id}/welcome-screen` + */ + guildWelcomeScreen(guildID: Snowflake) { + return `/guilds/${guildID}/welcome-screen` as const; + }, }; export const RouteBases = { diff --git a/v8/rest/oauth2.ts b/deno/rest/v8/oauth2.ts similarity index 97% rename from v8/rest/oauth2.ts rename to deno/rest/v8/oauth2.ts index 3541ad35..50d3ec19 100644 --- a/v8/rest/oauth2.ts +++ b/deno/rest/v8/oauth2.ts @@ -1,5 +1,5 @@ -import type { Permissions, Snowflake } from '../../common/index'; -import type { APIApplication, APIGuild, APIUser, APIWebhook, OAuth2Scopes } from '../payloads/index'; +import type { Permissions, Snowflake } from '../../globals.ts'; +import type { APIApplication, APIGuild, APIUser, APIWebhook, OAuth2Scopes } from '../../payloads/v8/mod.ts'; /** * https://discord.com/developers/docs/topics/oauth2#get-current-application-information @@ -57,7 +57,6 @@ export interface RESTPostOAuth2AccessTokenURLEncodedData { grant_type: 'authorization_code'; code: string; redirect_uri?: string; - scope: string; } /** @@ -79,8 +78,6 @@ export interface RESTPostOAuth2RefreshTokenURLEncodedData { client_secret: string; grant_type: 'refresh_token'; refresh_token: string; - redirect_uri?: string; - scope: string; } export type RESTPostOAuth2RefreshTokenResult = RESTPostOAuth2AccessTokenResult; diff --git a/deno/v8/rest/template.ts b/deno/rest/v8/template.ts similarity index 96% rename from deno/v8/rest/template.ts rename to deno/rest/v8/template.ts index ceb89eb2..3090da90 100644 --- a/deno/v8/rest/template.ts +++ b/deno/rest/v8/template.ts @@ -1,4 +1,4 @@ -import type { APIGuild, APITemplate } from '../payloads/mod.ts'; +import type { APIGuild, APITemplate } from '../../payloads/v8/mod.ts'; /** * https://discord.com/developers/docs/resources/template#get-template diff --git a/deno/v8/rest/user.ts b/deno/rest/v8/user.ts similarity index 95% rename from deno/v8/rest/user.ts rename to deno/rest/v8/user.ts index 317d8f35..66c78120 100644 --- a/deno/v8/rest/user.ts +++ b/deno/rest/v8/user.ts @@ -1,5 +1,5 @@ -import type { Permissions, Snowflake } from '../../common/mod.ts'; -import type { APIChannel, APIConnection, APIUser, GuildFeature } from '../payloads/mod.ts'; +import type { Permissions, Snowflake } from '../../globals.ts'; +import type { APIChannel, APIConnection, APIUser, GuildFeature } from '../../payloads/v8/mod.ts'; /** * https://discord.com/developers/docs/resources/user#get-current-user diff --git a/v8/rest/voice.ts b/deno/rest/v8/voice.ts similarity index 68% rename from v8/rest/voice.ts rename to deno/rest/v8/voice.ts index e6fde8f3..b0136518 100644 --- a/v8/rest/voice.ts +++ b/deno/rest/v8/voice.ts @@ -1,4 +1,4 @@ -import type { APIVoiceRegion } from '../payloads/index'; +import type { APIVoiceRegion } from '../../payloads/v8/mod.ts'; /** * https://discord.com/developers/docs/resources/voice#list-voice-regions diff --git a/deno/v8/rest/webhook.ts b/deno/rest/v8/webhook.ts similarity index 94% rename from deno/v8/rest/webhook.ts rename to deno/rest/v8/webhook.ts index 57248965..336c18a5 100644 --- a/deno/v8/rest/webhook.ts +++ b/deno/rest/v8/webhook.ts @@ -1,5 +1,5 @@ -import type { Snowflake } from '../../common/mod.ts'; -import type { APIAllowedMentions, APIEmbed, APIMessage, APIWebhook } from '../payloads/mod.ts'; +import type { Snowflake } from '../../globals.ts'; +import type { APIAllowedMentions, APIEmbed, APIMessage, APIWebhook } from '../../payloads/v8/mod.ts'; /** * https://discord.com/developers/docs/resources/webhook#create-webhook @@ -212,9 +212,21 @@ export type RESTPatchAPIWebhookWithTokenMessageJSONBody = Nullable< */ export type RESTPatchAPIWebhookWithTokenMessageFormDataBody = | { - payload_json: string; + /** + * JSON stringified message body + */ + payload_json?: string; + /** + * The file contents + */ + file: unknown; } - | RESTPatchAPIWebhookWithTokenMessageJSONBody; + | (RESTPatchAPIWebhookWithTokenMessageJSONBody & { + /** + * The file contents + */ + file: unknown; + }); /** * https://discord.com/developers/docs/resources/webhook#edit-webhook-message diff --git a/deno/rpc/mod.ts b/deno/rpc/mod.ts new file mode 100644 index 00000000..567a4e3d --- /dev/null +++ b/deno/rpc/mod.ts @@ -0,0 +1,4 @@ +// This file exports all the types available in the recommended API version +// Thereby, things MAY break in the future. Try sticking to imports from a specific version + +export * from './v8.ts'; diff --git a/deno/rpc/v8.ts b/deno/rpc/v8.ts new file mode 100644 index 00000000..8798138c --- /dev/null +++ b/deno/rpc/v8.ts @@ -0,0 +1,33 @@ +/** + * 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, +} diff --git a/deno/shortcuts/v6.ts b/deno/shortcuts/v6.ts new file mode 100644 index 00000000..99140f36 --- /dev/null +++ b/deno/shortcuts/v6.ts @@ -0,0 +1,4 @@ +export * from '../globals.ts'; +export * from '../gateway/v6.ts'; +export * from '../payloads/v6/mod.ts'; +export * from '../rest/v6/mod.ts'; diff --git a/deno/shortcuts/v8.ts b/deno/shortcuts/v8.ts new file mode 100644 index 00000000..6c7be3c7 --- /dev/null +++ b/deno/shortcuts/v8.ts @@ -0,0 +1,6 @@ +export * from '../globals.ts'; +export * from '../gateway/v8.ts'; +export * from '../payloads/v8/mod.ts'; +export * from '../rest/v8/mod.ts'; +export * from '../rpc/v8.ts'; +export * as Utils from '../utils/v8.ts'; diff --git a/deno/utils/mod.ts b/deno/utils/mod.ts new file mode 100644 index 00000000..d644c6ab --- /dev/null +++ b/deno/utils/mod.ts @@ -0,0 +1,4 @@ +// This file exports all the utility functions available in the recommended API / Gateway version +// Thereby, things MAY break in the future. Try sticking to imports from a specific version + +export * from './v8.ts'; diff --git a/deno/utils/v8.ts b/deno/utils/v8.ts new file mode 100644 index 00000000..9b1732fa --- /dev/null +++ b/deno/utils/v8.ts @@ -0,0 +1,48 @@ +import { + APIApplicationCommandDMInteraction, + APIApplicationCommandGuildInteraction, + APIApplicationCommandInteraction, + APIDMInteraction, + APIGuildInteraction, + APIInteraction, +} from '../payloads/v8/mod.ts'; + +/** + * A type-guard check for guild interactions. + * @param interaction The interaction to check against the + * @returns A boolean that indicates if the interaction was received from a guild + */ +export function isGuildInteraction(interaction: APIInteraction): interaction is APIGuildInteraction { + return Reflect.has(interaction, 'guild_id'); +} + +/** + * A type-guard check for DM interactions. + * @param interaction The interaction to check against + * @returns A boolean that indicates if the interaction was received from a direct message + */ +export function isDMInteraction(interaction: APIInteraction): interaction is APIDMInteraction { + return !isGuildInteraction(interaction); +} + +/** + * A type-guard check for guild application command interactions. + * @param interaction The interaction to check against + * @returns A boolean that indicates if the command interaction was received from a guild + */ +export function isApplicationCommandGuildInteraction( + interaction: APIApplicationCommandInteraction, +): interaction is APIApplicationCommandGuildInteraction { + return isGuildInteraction(interaction); +} + +/** + * A type-guard check for direct message application command interactions. + * @param interaction The interaction to check against + * @returns A boolean that indicates if the command interaction was received from a direct message + */ +export function isApplicationCommandDMInteraction( + interaction: APIApplicationCommandInteraction, +): interaction is APIApplicationCommandDMInteraction { + return !isGuildInteraction(interaction); +} diff --git a/deno/v6/mod.ts b/deno/v6/mod.ts deleted file mode 100644 index d00f5b1f..00000000 --- a/deno/v6/mod.ts +++ /dev/null @@ -1,4 +0,0 @@ -export * from '../common/mod.ts'; -export * from './gateway/mod.ts'; -export * from './payloads/mod.ts'; -export * from './rest/mod.ts'; diff --git a/deno/v8/mod.ts b/deno/v8/mod.ts deleted file mode 100644 index d00f5b1f..00000000 --- a/deno/v8/mod.ts +++ /dev/null @@ -1,4 +0,0 @@ -export * from '../common/mod.ts'; -export * from './gateway/mod.ts'; -export * from './payloads/mod.ts'; -export * from './rest/mod.ts'; diff --git a/deno/voice/mod.ts b/deno/voice/mod.ts new file mode 100644 index 00000000..37c52356 --- /dev/null +++ b/deno/voice/mod.ts @@ -0,0 +1,4 @@ +// This file exports all the types available in the recommended voice gateway version +// Thereby, things MAY break in the future. Try sticking to imports from a specific version + +export * from './v4.ts'; diff --git a/deno/voice/v4.ts b/deno/voice/v4.ts new file mode 100644 index 00000000..b81a9196 --- /dev/null +++ b/deno/voice/v4.ts @@ -0,0 +1,109 @@ +export const VoiceGatewayVersion = '4'; + +/** + * https://discord.com/developers/docs/topics/opcodes-and-status-codes#voice-voice-opcodes + */ +export enum VoiceOPCodes { + /** + * Begin a voice websocket connection + */ + Identify, + /** + * Select the voice protocol + */ + SelectProtocol, + /** + * Complete the websocket handshake + */ + Ready, + /** + * Keep the websocket connection alive + */ + Heartbeat, + /** + * Describe the session + */ + SessionDescription, + /** + * Indicate which users are speaking + */ + Speaking, + /** + * Sent to acknowledge a received client heartbeat + */ + HeartbeatAck, + /** + * Resume a connection + */ + Resume, + /** + * Time to wait between sending heartbeats in milliseconds + */ + Hello, + /** + * Acknowledge a successful session resume + */ + Resumed, + /** + * A client has connected to the voice channel + */ + ClientConnect = 12, + /** + * A client has disconnected from the voice channel + */ + ClientDisconnect, +} + +/** + * https://discord.com/developers/docs/topics/opcodes-and-status-codes#voice-voice-close-event-codes + */ +export enum VoiceCloseCodes { + /** + * You sent an invalid opcode + */ + UnknownOpCode = 4001, + /** + * You sent a invalid payload in your identifying to the Gateway + */ + FailedToDecode, + /** + * You sent a payload before identifying with the Gateway + */ + NotAuthenticated, + /** + * The token you sent in your identify payload is incorrect + */ + AuthenticationFailed, + /** + * You sent more than one identify payload. Stahp + */ + AlreadyAuthenticated, + /** + * Your session is no longer valid + */ + SessionNoLongerValid, + /** + * Your session has timed out + */ + SessionTimeout = 4009, + /** + * We can't find the server you're trying to connect to + */ + ServerNotFound = 4011, + /** + * We didn't recognize the protocol you sent + */ + UnknownProtocol, + /** + * Either the channel was deleted, you were kicked, or the main gateway session was dropped. Should not reconnect + */ + Disconnected = 4014, + /** + * The server crashed. Our bad! Try resuming + */ + VoiceServerCrashed, + /** + * We didn't recognize your encryption + */ + UnknownEncryptionMode, +} diff --git a/gateway/common.ts b/gateway/common.ts new file mode 100644 index 00000000..bb2bfcb8 --- /dev/null +++ b/gateway/common.ts @@ -0,0 +1,8 @@ +/** + * https://discord.com/developers/docs/topics/gateway#connecting-gateway-url-params + */ +export interface GatewayURLQuery { + v: string; + encoding: 'json' | 'etf'; + compress?: 'zlib-stream'; +} diff --git a/gateway/index.ts b/gateway/index.ts new file mode 100644 index 00000000..a0be17f6 --- /dev/null +++ b/gateway/index.ts @@ -0,0 +1,4 @@ +// This file exports all the types available in the recommended gateway version +// Thereby, things MAY break in the future. Try sticking to imports from a specific version + +export * from './v8'; diff --git a/v6/gateway/index.ts b/gateway/v6.ts similarity index 99% rename from v6/gateway/index.ts rename to gateway/v6.ts index 4d809fcf..1d1e94e0 100644 --- a/v6/gateway/index.ts +++ b/gateway/v6.ts @@ -16,7 +16,9 @@ import type { GatewayVoiceState, InviteTargetUserType, PresenceUpdateStatus, -} from '../payloads/index'; +} from '../payloads/v6/index'; + +export * from './common'; /** * @deprecated Gateway v6 is deprecated and the types will not receive further updates, please update to v8. diff --git a/v8/gateway/index.ts b/gateway/v8.ts similarity index 93% rename from v8/gateway/index.ts rename to gateway/v8.ts index 8bae994d..c87e415f 100644 --- a/v8/gateway/index.ts +++ b/gateway/v8.ts @@ -2,7 +2,7 @@ * Types extracted from https://discord.com/developers/docs/topics/gateway */ -import type { Snowflake } from '../../common/index'; +import type { Snowflake } from '../globals'; import type { APIApplication, APIApplicationCommand, @@ -10,6 +10,7 @@ import type { APIChannel, APIEmoji, APIGuild, + APIGuildIntegration, APIGuildMember, APIMessage, APIRole, @@ -20,7 +21,9 @@ import type { GatewayVoiceState, InviteTargetUserType, PresenceUpdateStatus, -} from '../payloads/index'; +} from '../payloads/v8/index'; + +export * from './common'; export const GatewayVersion = '8'; @@ -158,114 +161,6 @@ export const enum GatewayCloseCodes { DisallowedIntents, } -/** - * https://discord.com/developers/docs/topics/opcodes-and-status-codes#voice-voice-opcodes - */ -export const enum VoiceOPCodes { - /** - * Begin a voice websocket connection - */ - Identify, - /** - * Select the voice protocol - */ - SelectProtocol, - /** - * Complete the websocket handshake - */ - Ready, - /** - * Keep the websocket connection alive - */ - Heartbeat, - /** - * Describe the session - */ - SessionDescription, - /** - * Indicate which users are speaking - */ - Speaking, - /** - * Sent to acknowledge a received client heartbeat - */ - HeartbeatAck, - /** - * Resume a connection - */ - Resume, - /** - * Time to wait between sending heartbeats in milliseconds - */ - Hello, - /** - * Acknowledge a successful session resume - */ - Resumed, - /** - * A client has connected to the voice channel - */ - ClientConnect = 12, - /** - * A client has disconnected from the voice channel - */ - ClientDisconnect, -} - -/** - * https://discord.com/developers/docs/topics/opcodes-and-status-codes#voice-voice-close-event-codes - */ -export const enum VoiceCloseCodes { - /** - * You sent an invalid opcode - */ - UnknownOpCode = 4001, - /** - * You sent a invalid payload in your identifying to the Gateway - */ - FailedToDecode, - /** - * You sent a payload before identifying with the Gateway - */ - NotAuthenticated, - /** - * The token you sent in your identify payload is incorrect - */ - AuthenticationFailed, - /** - * You sent more than one identify payload. Stahp - */ - AlreadyAuthenticated, - /** - * Your session is no longer valid - */ - SessionNoLongerValid, - /** - * Your session has timed out - */ - SessionTimeout = 4009, - /** - * We can't find the server you're trying to connect to - */ - ServerNotFound = 4011, - /** - * We didn't recognize the protocol you sent - */ - UnknownProtocol, - /** - * Either the channel was deleted or you were kicked. Should not reconnect - */ - Disconnected = 4014, - /** - * The server crashed. Our bad! Try resuming - */ - VoiceServerCrashed, - /** - * We didn't recognize your encryption - */ - UnknownEncryptionMode, -} - /** * https://discord.com/developers/docs/topics/gateway#list-of-intents */ @@ -292,8 +187,8 @@ export const enum GatewayIntentBits { */ export const enum GatewayDispatchEvents { ApplicationCommandCreate = 'APPLICATION_COMMAND_CREATE', - ApplicationCommandUpdate = 'APPLICATION_COMMAND_UPDATE', ApplicationCommandDelete = 'APPLICATION_COMMAND_DELETE', + ApplicationCommandUpdate = 'APPLICATION_COMMAND_UPDATE', ChannelCreate = 'CHANNEL_CREATE', ChannelDelete = 'CHANNEL_DELETE', ChannelPinsUpdate = 'CHANNEL_PINS_UPDATE', @@ -312,6 +207,9 @@ export const enum GatewayDispatchEvents { GuildRoleDelete = 'GUILD_ROLE_DELETE', GuildRoleUpdate = 'GUILD_ROLE_UPDATE', GuildUpdate = 'GUILD_UPDATE', + IntegrationCreate = 'INTEGRATION_CREATE', + IntegrationDelete = 'INTEGRATION_DELETE', + IntegrationUpdate = 'INTEGRATION_UPDATE', InteractionCreate = 'INTERACTION_CREATE', InviteCreate = 'INVITE_CREATE', InviteDelete = 'INVITE_DELETE', @@ -363,6 +261,9 @@ export type GatewayDispatchPayload = | GatewayGuildModifyDispatch | GatewayGuildRoleDeleteDispatch | GatewayGuildRoleModifyDispatch + | GatewayIntegrationCreateDispatch + | GatewayIntegrationDeleteDispatch + | GatewayIntegrationUpdateDispatch | GatewayInteractionCreateDispatch | GatewayInviteCreateDispatch | GatewayInviteDeleteDispatch @@ -512,10 +413,6 @@ export interface GatewayReadyDispatchData { * See https://discord.com/developers/docs/resources/user#user-object */ user: APIUser; - /** - * Empty array - */ - private_channels: []; /** * The guilds the user is in * @@ -804,12 +701,14 @@ export type GatewayGuildMemberUpdateDispatch = DataPayload< /** * https://discord.com/developers/docs/topics/gateway#guild-member-update */ -export type GatewayGuildMemberUpdateDispatchData = Omit & { - /** - * The id of the guild - */ - guild_id: Snowflake; -}; +export type GatewayGuildMemberUpdateDispatchData = Omit & + Partial> & + Required> & { + /** + * The id of the guild + */ + guild_id: Snowflake; + }; /** * https://discord.com/developers/docs/topics/gateway#guild-members-chunk @@ -927,6 +826,58 @@ export interface GatewayGuildRoleDeleteDispatchData { role_id: Snowflake; } +/** + * https://discord.com/developers/docs/topics/gateway#integration-create + */ +export type GatewayIntegrationCreateDispatch = DataPayload< + GatewayDispatchEvents.IntegrationCreate, + GatewayIntegrationCreateDispatchData +>; + +/** + * https://discord.com/developers/docs/topics/gateway#integration-create + */ +export type GatewayIntegrationCreateDispatchData = APIGuildIntegration & { guild_id: Snowflake }; + +/** + * https://discord.com/developers/docs/topics/gateway#integration-update + */ +export type GatewayIntegrationUpdateDispatch = DataPayload< + GatewayDispatchEvents.IntegrationUpdate, + GatewayIntegrationUpdateDispatchData +>; + +/** + * https://discord.com/developers/docs/topics/gateway#integration-update + */ +export type GatewayIntegrationUpdateDispatchData = APIGuildIntegration & { guild_id: Snowflake }; + +/** + * https://discord.com/developers/docs/topics/gateway#integration-update + */ +export type GatewayIntegrationDeleteDispatch = DataPayload< + GatewayDispatchEvents.IntegrationDelete, + GatewayIntegrationDeleteDispatchData +>; + +/** + * https://discord.com/developers/docs/topics/gateway#integration-delete + */ +export interface GatewayIntegrationDeleteDispatchData { + /** + * Integration id + */ + id: Snowflake; + /** + * ID of the guild + */ + guild_id: Snowflake; + /** + * ID of the bot/OAuth2 application for this Discord integration + */ + application_id?: Snowflake; +} + /** * https://discord.com/developers/docs/topics/gateway#interaction-create */ @@ -985,17 +936,21 @@ export interface GatewayInviteCreateDispatchData { */ max_uses: number; /** - * The target user for this invite + * The type of user target for this voice channel invite + * + * See https://discord.com/developers/docs/resources/invite#invite-object-target-user-types + */ + target_type?: InviteTargetUserType; + /** + * The user whose stream to display for this voice channel stream invite * * See https://discord.com/developers/docs/resources/user#user-object */ target_user?: APIUser; /** - * The type of user target for this invite - * - * See https://discord.com/developers/docs/resources/invite#invite-object-target-user-types + * The embedded application to open for this voice channel embedded application invite */ - target_user_type?: InviteTargetUserType; + target_application?: Partial; /** * Whether or not the invite is temporary (invited users will be kicked on disconnect unless they're assigned a role) */ @@ -1257,8 +1212,12 @@ export interface GatewayVoiceServerUpdateDispatchData { guild_id: Snowflake; /** * The voice server host + * + * A `null` endpoint means that the voice server allocated has gone away and is trying to be reallocated. + * You should attempt to disconnect from the currently connected voice server, and not attempt to reconnect + * until a new voice server is allocated */ - endpoint: string; + endpoint: string | null; } /** @@ -1347,13 +1306,6 @@ export interface GatewayIdentifyData { * See https://discord.com/developers/docs/topics/gateway#update-status */ presence?: GatewayPresenceUpdateData; - /** - * Enables dispatching of guild subscription events (presence and typing events) - * - * @default true - * @deprecated Use `intents` instead - */ - guild_subscriptions?: boolean; /** * The Gateway Intents you wish to receive * @@ -1442,6 +1394,8 @@ export interface GatewayRequestGuildMembersData { /** * Nonce to identify the Guild Members Chunk response * + * Nonce can only be up to 32 bytes. If you send an invalid nonce it will be ignored and the reply member_chunk(s) will not have a `nonce` set. + * * See https://discord.com/developers/docs/topics/gateway#guild-members-chunk */ nonce?: string; @@ -1494,11 +1448,11 @@ export interface GatewayPresenceUpdateData { */ since: number | null; /** - * `null`, or the user's activities + * The user's activities * * See https://discord.com/developers/docs/topics/gateway#activity-object */ - activities: GatewayActivityUpdateData[] | null; + activities: GatewayActivityUpdateData[]; /** * The user's new status * diff --git a/globals.ts b/globals.ts new file mode 100644 index 00000000..f433bea4 --- /dev/null +++ b/globals.ts @@ -0,0 +1,70 @@ +/** + * https://discord.com/developers/docs/reference#snowflakes + */ +export type Snowflake = `${bigint}`; + +/** + * https://discord.com/developers/docs/topics/permissions + * @internal + */ +export type Permissions = `${bigint}`; + +/** + * https://discord.com/developers/docs/reference#message-formatting-formats + */ +export const FormattingPatterns = { + /** + * Regular expression for matching a user mention, strictly without a nickname + * + * The `id` group property is present on the `exec` result of this expression + */ + User: /<@(?\d{17,20})>/, + /** + * Regular expression for matching a user mention, strictly with a nickname + * + * The `id` group property is present on the `exec` result of this expression + */ + UserWithNickname: /<@!(?\d{17,20})>/, + /** + * Regular expression for matching a user mention, with or without a nickname + * + * The `id` group property is present on the `exec` result of this expression + */ + UserWithOptionalNickname: /<@!?(?\d{17,20})>/, + /** + * Regular expression for matching a channel mention + * + * The `id` group property is present on the `exec` result of this expression + */ + Channel: /<#(?\d{17,20})>/, + /** + * Regular expression for matching a role mention + * + * The `id` group property is present on the `exec` result of this expression + */ + Role: /<@&(?\d{17,20})>/, + /** + * Regular expression for matching a custom emoji, either static or animated + * + * The `animated`, `name` and `id` group properties are present on the `exec` result of this expression + */ + Emoji: /<(?a)?:(?\w{2,32}):(?\d{17,20})>/, + /** + * Regular expression for matching strictly an animated custom emoji + * + * The `animated`, `name` and `id` group properties are present on the `exec` result of this expression + */ + AnimatedEmoji: /<(?a):(?\w{2,32}):(?\d{17,20})>/, + /** + * Regular expression for matching strictly a static custom emoji + * + * The `name` and `id` group properties are present on the `exec` result of this expression + */ + StaticEmoji: /<:(?\w{2,32}):(?\d{17,20})>/, +} as const; + +/** + * Freezes the formatting patterns + * @internal + */ +Object.freeze(FormattingPatterns); diff --git a/package-lock.json b/package-lock.json index 5dbad017..2f6c5ca2 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,18 +1,20 @@ { "name": "discord-api-types", - "version": "0.13.3", + "version": "0.14.0", "lockfileVersion": 2, "requires": true, "packages": { "": { - "version": "0.13.3", + "version": "0.14.0", "license": "MIT", "devDependencies": { - "@commitlint/cli": "^12.0.1", - "@commitlint/config-angular": "^12.0.1", - "@typescript-eslint/eslint-plugin": "^4.18.0", - "@typescript-eslint/parser": "^4.18.0", - "eslint": "^7.22.0", + "@commitlint/cli": "^12.1.1", + "@commitlint/config-angular": "^12.1.1", + "@types/node": "^14.14.37", + "@typescript-eslint/eslint-plugin": "^4.21.0", + "@typescript-eslint/parser": "^4.21.0", + "conventional-changelog-cli": "^2.1.1", + "eslint": "^7.24.0", "eslint-config-marine": "^8.3.2", "eslint-config-prettier": "^8.1.0", "eslint-plugin-prettier": "^3.3.1", @@ -23,7 +25,7 @@ "prettier": "^2.2.1", "pretty-quick": "^3.1.0", "rimraf": "^3.0.2", - "typescript": "^4.2.3" + "typescript": "^4.2.4" }, "engines": { "node": ">=12" @@ -118,16 +120,16 @@ } }, "node_modules/@commitlint/cli": { - "version": "12.0.1", - "resolved": "https://registry.npmjs.org/@commitlint/cli/-/cli-12.0.1.tgz", - "integrity": "sha512-V+cMYNHJOr40XT9Kvz3Vrz1Eh7QE1rjQrUbifawDAqcOrBJFuoXwU2SAcRtYFCSqFy9EhbreQGhZFs8dYb90KA==", + "version": "12.1.1", + "resolved": "https://registry.npmjs.org/@commitlint/cli/-/cli-12.1.1.tgz", + "integrity": "sha512-SB67/s6VJ50seoPx/Sr2gj1fMzKrx+udgarecGdr8h43ah+M2e22gjQJ7xHv5KwyPQ+6ug1YOMCL34ubT4zupQ==", "dev": true, "dependencies": { - "@commitlint/format": "^12.0.1", - "@commitlint/lint": "^12.0.1", - "@commitlint/load": "^12.0.1", - "@commitlint/read": "^12.0.1", - "@commitlint/types": "^12.0.1", + "@commitlint/format": "^12.1.1", + "@commitlint/lint": "^12.1.1", + "@commitlint/load": "^12.1.1", + "@commitlint/read": "^12.1.1", + "@commitlint/types": "^12.1.1", "get-stdin": "8.0.0", "lodash": "^4.17.19", "resolve-from": "5.0.0", @@ -142,33 +144,33 @@ } }, "node_modules/@commitlint/config-angular": { - "version": "12.0.1", - "resolved": "https://registry.npmjs.org/@commitlint/config-angular/-/config-angular-12.0.1.tgz", - "integrity": "sha512-LuhglC8lh+5zdl+hjNunhH1b4Uj70w/TbdWna6CTvpuR59WSZSFZhIxutN2Fjuf1jlHGkx2bC9ZiOQW01YQNTA==", + "version": "12.1.1", + "resolved": "https://registry.npmjs.org/@commitlint/config-angular/-/config-angular-12.1.1.tgz", + "integrity": "sha512-aOWhOXjqWhQ91LQPLNf+mupQdcF7P/5DSAz4jDURlR44O94kl80FzX0ygykhQk+xeKosVuApfSYiE1kGzTeSsw==", "dev": true, "dependencies": { - "@commitlint/config-angular-type-enum": "^12.0.1" + "@commitlint/config-angular-type-enum": "^12.1.1" }, "engines": { "node": ">=v10" } }, "node_modules/@commitlint/config-angular-type-enum": { - "version": "12.0.1", - "resolved": "https://registry.npmjs.org/@commitlint/config-angular-type-enum/-/config-angular-type-enum-12.0.1.tgz", - "integrity": "sha512-0qETLi7f7BineQruIBjyzHFfvDfh9FTEbMs+oTAfl+cDKTLJYI5W6eKGjI3MPg5+8sxUtzh6pJ+Dp3LFOpawTQ==", + "version": "12.1.1", + "resolved": "https://registry.npmjs.org/@commitlint/config-angular-type-enum/-/config-angular-type-enum-12.1.1.tgz", + "integrity": "sha512-cOIRod65IOmjUyLTapGoqTKl8RtQnWZTGU+rNoTqx3dqd5LmTM+/w9CUehuflBbo9NWKa36iV6SJcbeMfvYH9A==", "dev": true, "engines": { "node": ">=v10" } }, "node_modules/@commitlint/ensure": { - "version": "12.0.1", - "resolved": "https://registry.npmjs.org/@commitlint/ensure/-/ensure-12.0.1.tgz", - "integrity": "sha512-XdBq+q1YBBDxWIAEjE3Y1YMbzhUnUuSLAEWD8SU1xsvEpQXWRYwDlMBRkjO7funNWTdL0ZQSkZDzme70imYjbw==", + "version": "12.1.1", + "resolved": "https://registry.npmjs.org/@commitlint/ensure/-/ensure-12.1.1.tgz", + "integrity": "sha512-XEUQvUjzBVQM7Uv8vYz+c7PDukFvx0AvQEyX/V+PaTkCK/xPvexu7FLbFwvypjSt9BPMf+T/rhB1hVmldkd6lw==", "dev": true, "dependencies": { - "@commitlint/types": "^12.0.1", + "@commitlint/types": "^12.1.1", "lodash": "^4.17.19" }, "engines": { @@ -176,21 +178,21 @@ } }, "node_modules/@commitlint/execute-rule": { - "version": "12.0.1", - "resolved": "https://registry.npmjs.org/@commitlint/execute-rule/-/execute-rule-12.0.1.tgz", - "integrity": "sha512-JzyweYfZlFLtXpgP+btzSY3YAkGPg61TqUSYQqBr4+5IaVf1FruMm5v4D5eLu9dAJuNKUfHbM3AEfuEPiZ79pg==", + "version": "12.1.1", + "resolved": "https://registry.npmjs.org/@commitlint/execute-rule/-/execute-rule-12.1.1.tgz", + "integrity": "sha512-6mplMGvLCKF5LieL7BRhydpg32tm6LICnWQADrWU4S5g9PKi2utNvhiaiuNPoHUXr29RdbNaGNcyyPv8DSjJsQ==", "dev": true, "engines": { "node": ">=v10" } }, "node_modules/@commitlint/format": { - "version": "12.0.1", - "resolved": "https://registry.npmjs.org/@commitlint/format/-/format-12.0.1.tgz", - "integrity": "sha512-rF79ipAxR8yFzPzG5tRoEZ//MRkyxCXj4JhpEjtdaCMBAXMssI8uazn3e5D8z4UFgSDe9qOnL0OmQvql7HTMoA==", + "version": "12.1.1", + "resolved": "https://registry.npmjs.org/@commitlint/format/-/format-12.1.1.tgz", + "integrity": "sha512-bTAoOryTFLqls17JTaRwk2WDVOP0NwuG4F/JPK8RaF6DMZNVQTfajkgTxFENNZRnESfau1BvivvEXfUAW2ZsvA==", "dev": true, "dependencies": { - "@commitlint/types": "^12.0.1", + "@commitlint/types": "^12.1.1", "chalk": "^4.0.0" }, "engines": { @@ -198,42 +200,42 @@ } }, "node_modules/@commitlint/is-ignored": { - "version": "12.0.1", - "resolved": "https://registry.npmjs.org/@commitlint/is-ignored/-/is-ignored-12.0.1.tgz", - "integrity": "sha512-AplfLn5mX/kWTIiSolcOhTYcgphuGLX8FUr+HmyHBEqUkO36jt0z9caysH47fqU71ePtH63v1DWm+RYQ5RPDjg==", + "version": "12.1.1", + "resolved": "https://registry.npmjs.org/@commitlint/is-ignored/-/is-ignored-12.1.1.tgz", + "integrity": "sha512-Sn4fsnWX+wLAJOD/UZeoVruB98te1TyPYRiDEq0MhRJAQIrP+7jE/O3/ass68AAMq00HvH3OK9kt4UBXggcGjA==", "dev": true, "dependencies": { - "@commitlint/types": "^12.0.1", - "semver": "7.3.4" + "@commitlint/types": "^12.1.1", + "semver": "7.3.5" }, "engines": { "node": ">=v10" } }, "node_modules/@commitlint/lint": { - "version": "12.0.1", - "resolved": "https://registry.npmjs.org/@commitlint/lint/-/lint-12.0.1.tgz", - "integrity": "sha512-1lKyRCq4ahJrY+Xxo8LsqCbALeJkodtEfpmYHeA5HpPMnK7lRSplLqOLcTCjoPfd4vO+gl6aDEZN+ow3YGQBOg==", + "version": "12.1.1", + "resolved": "https://registry.npmjs.org/@commitlint/lint/-/lint-12.1.1.tgz", + "integrity": "sha512-FFFPpku/E0svL1jaUVqosuZJDDWiNWYBlUw5ZEljh3MwWRcoaWtMIX5bseX+IvHpFZsCTAiBs1kCgNulCi0UvA==", "dev": true, "dependencies": { - "@commitlint/is-ignored": "^12.0.1", - "@commitlint/parse": "^12.0.1", - "@commitlint/rules": "^12.0.1", - "@commitlint/types": "^12.0.1" + "@commitlint/is-ignored": "^12.1.1", + "@commitlint/parse": "^12.1.1", + "@commitlint/rules": "^12.1.1", + "@commitlint/types": "^12.1.1" }, "engines": { "node": ">=v10" } }, "node_modules/@commitlint/load": { - "version": "12.0.1", - "resolved": "https://registry.npmjs.org/@commitlint/load/-/load-12.0.1.tgz", - "integrity": "sha512-dX8KdCWn7w0bTkkk3zKQpe9X8vsTRa5EM+1ffF313wCX9b6tGa9vujhEHCkSzKAbbE2tFV64CHZygE7rtlHdIA==", + "version": "12.1.1", + "resolved": "https://registry.npmjs.org/@commitlint/load/-/load-12.1.1.tgz", + "integrity": "sha512-qOQtgNdJRULUQWP9jkpTwhj7aEtnqUtqeUpbQ9rjS+GIUST65HZbteNUX4S0mAEGPWqy2aK5xGd73cUfFSvuuw==", "dev": true, "dependencies": { - "@commitlint/execute-rule": "^12.0.1", - "@commitlint/resolve-extends": "^12.0.1", - "@commitlint/types": "^12.0.1", + "@commitlint/execute-rule": "^12.1.1", + "@commitlint/resolve-extends": "^12.1.1", + "@commitlint/types": "^12.1.1", "chalk": "^4.0.0", "cosmiconfig": "^7.0.0", "lodash": "^4.17.19", @@ -244,21 +246,21 @@ } }, "node_modules/@commitlint/message": { - "version": "12.0.1", - "resolved": "https://registry.npmjs.org/@commitlint/message/-/message-12.0.1.tgz", - "integrity": "sha512-fXuoxRC+NT1wEQi6p8oHfT7wvWIRgTk+udlRJnWTjmMpiYzVnMmmZfasdShirWr4TtxQtMyL+5DVgh7Y98kURw==", + "version": "12.1.1", + "resolved": "https://registry.npmjs.org/@commitlint/message/-/message-12.1.1.tgz", + "integrity": "sha512-RakDSLAiOligXjhbLahV8HowF4K75pZIcs0+Ii9Q8Gz5H3DWf1Ngit7alFTWfcbf/+DTjSzVPov5HiwQZPIBUg==", "dev": true, "engines": { "node": ">=v10" } }, "node_modules/@commitlint/parse": { - "version": "12.0.1", - "resolved": "https://registry.npmjs.org/@commitlint/parse/-/parse-12.0.1.tgz", - "integrity": "sha512-7oEGASmzBnHir5jSIR7KephXrKh7rIi9a6RpH1tOT+CIENYvhe8EDtIy29qMt+RLa2LlaPF7YrAgaJRfzG0YDQ==", + "version": "12.1.1", + "resolved": "https://registry.npmjs.org/@commitlint/parse/-/parse-12.1.1.tgz", + "integrity": "sha512-nuljIvAbBDr93DgL0wCArftEIhjSghawAwhvrKNV9FFcqAJqfVqitwMxJrNDCQ5pgUMCSKULLOEv+dA0bLlTEQ==", "dev": true, "dependencies": { - "@commitlint/types": "^12.0.1", + "@commitlint/types": "^12.1.1", "conventional-changelog-angular": "^5.0.11", "conventional-commits-parser": "^3.0.0" }, @@ -267,13 +269,13 @@ } }, "node_modules/@commitlint/read": { - "version": "12.0.1", - "resolved": "https://registry.npmjs.org/@commitlint/read/-/read-12.0.1.tgz", - "integrity": "sha512-baa0YeD4QOctEuthLpExQSi9xPiw0kDPfUVHqp8I88iuIXJECeS8S1+1GBiz89e8dLN9zmEE+sN9vtJHdAp9YA==", + "version": "12.1.1", + "resolved": "https://registry.npmjs.org/@commitlint/read/-/read-12.1.1.tgz", + "integrity": "sha512-1k0CQEoZIdixvmqZRKEcWdj2XiKS7SlizEOJ1SE99Qui5d5FlBey8eaooTGgmpR6zObpIHJehtEPzM3VzUT3qA==", "dev": true, "dependencies": { - "@commitlint/top-level": "^12.0.1", - "@commitlint/types": "^12.0.1", + "@commitlint/top-level": "^12.1.1", + "@commitlint/types": "^12.1.1", "fs-extra": "^9.0.0", "git-raw-commits": "^2.0.0" }, @@ -282,9 +284,9 @@ } }, "node_modules/@commitlint/resolve-extends": { - "version": "12.0.1", - "resolved": "https://registry.npmjs.org/@commitlint/resolve-extends/-/resolve-extends-12.0.1.tgz", - "integrity": "sha512-Mvg0GDi/68Cqw893ha8uhxE8myHfPmiSSSi7d1x4VJNR4hoS37lBdX89kyx4i9NPmLfviY2cUJKTyK8ZrFznZw==", + "version": "12.1.1", + "resolved": "https://registry.npmjs.org/@commitlint/resolve-extends/-/resolve-extends-12.1.1.tgz", + "integrity": "sha512-/DXRt0S0U3o9lq5cc8OL1Lkx0IjW0HcDWjUkUXshAajBIKBYSJB8x/loNCi1krNEJ8SwLXUEFt5OLxNO6wE9yQ==", "dev": true, "dependencies": { "import-fresh": "^3.0.0", @@ -297,33 +299,33 @@ } }, "node_modules/@commitlint/rules": { - "version": "12.0.1", - "resolved": "https://registry.npmjs.org/@commitlint/rules/-/rules-12.0.1.tgz", - "integrity": "sha512-A5O0ubNGugZR9WWxk5IVOLo07lpdUwhG5WkAW2lYpgZ7Z/2U4PLob9b4Ih1eHbQu+gnVeFr91k7F0DrpM7B8EQ==", + "version": "12.1.1", + "resolved": "https://registry.npmjs.org/@commitlint/rules/-/rules-12.1.1.tgz", + "integrity": "sha512-oCcLF/ykcJfhM2DeeaDyrgdaiuKsqIPNocugdPj2WEyhSYqmx1/u18CV96LAtW+WyyiOLCCeiZwiQutx3T5nXg==", "dev": true, "dependencies": { - "@commitlint/ensure": "^12.0.1", - "@commitlint/message": "^12.0.1", - "@commitlint/to-lines": "^12.0.1", - "@commitlint/types": "^12.0.1" + "@commitlint/ensure": "^12.1.1", + "@commitlint/message": "^12.1.1", + "@commitlint/to-lines": "^12.1.1", + "@commitlint/types": "^12.1.1" }, "engines": { "node": ">=v10" } }, "node_modules/@commitlint/to-lines": { - "version": "12.0.1", - "resolved": "https://registry.npmjs.org/@commitlint/to-lines/-/to-lines-12.0.1.tgz", - "integrity": "sha512-XwcJ1jY7x2fhudzbGMpNQkTSMVrxWrI8bRMbVe3Abuu7RfYpFf7VXAlhtnLfxBoagaK7RxjC2+eRidp/3txQBg==", + "version": "12.1.1", + "resolved": "https://registry.npmjs.org/@commitlint/to-lines/-/to-lines-12.1.1.tgz", + "integrity": "sha512-W23AH2XF5rI27MOAPSSr0TUDoRe7ZbFoRtYhFnPu2MBmcuDA9Tmfd9N5sM2tBXtdE26uq3SazwKqGt1OoGAilQ==", "dev": true, "engines": { "node": ">=v10" } }, "node_modules/@commitlint/top-level": { - "version": "12.0.1", - "resolved": "https://registry.npmjs.org/@commitlint/top-level/-/top-level-12.0.1.tgz", - "integrity": "sha512-rHdgt7U24GEau2/9i2vEAbksxkBRiVjHj5ECFL5dd0AJOIvaK++vMg4EF/ME0X/1yd9qVTHTNOl2Q4tTFK7VBQ==", + "version": "12.1.1", + "resolved": "https://registry.npmjs.org/@commitlint/top-level/-/top-level-12.1.1.tgz", + "integrity": "sha512-g7uRbr81QEIg+pbii0OkE17Zh/2C/f6dSmiMDVRn1S0+hNHR1bENCh18hVUKcV/qKTUsKkFlhhWXM9mQBfxQJw==", "dev": true, "dependencies": { "find-up": "^5.0.0" @@ -333,9 +335,9 @@ } }, "node_modules/@commitlint/types": { - "version": "12.0.1", - "resolved": "https://registry.npmjs.org/@commitlint/types/-/types-12.0.1.tgz", - "integrity": "sha512-FsNDMV0W7D19/ZbR412klpqAilXASx75Neqh7jPtK278IEwdukOg3vth1r5kTm+BjDScM7wMUEOwIW3NNfAtwg==", + "version": "12.1.1", + "resolved": "https://registry.npmjs.org/@commitlint/types/-/types-12.1.1.tgz", + "integrity": "sha512-+qGH+s2Lo6qwacV2X3/ZypZwaAI84ift+1HBjXdXtI/q0F5NtmXucV3lcQOTviMTNiJhq4qWON2fjci2NItASw==", "dev": true, "dependencies": { "chalk": "^4.0.0" @@ -441,6 +443,12 @@ "integrity": "sha512-fZQQafSREFyuZcdWFAExYjBiCL7AUCdgsk80iO0q4yihYYdcIiH28CcuPTGFgLOCC8RlW49GSQxdHwZP+I7CNg==", "dev": true }, + "node_modules/@types/node": { + "version": "14.14.37", + "resolved": "https://registry.npmjs.org/@types/node/-/node-14.14.37.tgz", + "integrity": "sha512-XYmBiy+ohOR4Lh5jE379fV2IU+6Jn4g5qASinhitfyO71b/sCo6MKsMLF5tc7Zf2CE8hViVQyYSobJNke8OvUw==", + "dev": true + }, "node_modules/@types/normalize-package-data": { "version": "2.4.0", "resolved": "https://registry.npmjs.org/@types/normalize-package-data/-/normalize-package-data-2.4.0.tgz", @@ -454,13 +462,13 @@ "dev": true }, "node_modules/@typescript-eslint/eslint-plugin": { - "version": "4.18.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/eslint-plugin/-/eslint-plugin-4.18.0.tgz", - "integrity": "sha512-Lzkc/2+7EoH7+NjIWLS2lVuKKqbEmJhtXe3rmfA8cyiKnZm3IfLf51irnBcmow8Q/AptVV0XBZmBJKuUJTe6cQ==", + "version": "4.21.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/eslint-plugin/-/eslint-plugin-4.21.0.tgz", + "integrity": "sha512-FPUyCPKZbVGexmbCFI3EQHzCZdy2/5f+jv6k2EDljGdXSRc0cKvbndd2nHZkSLqCNOPk0jB6lGzwIkglXcYVsQ==", "dev": true, "dependencies": { - "@typescript-eslint/experimental-utils": "4.18.0", - "@typescript-eslint/scope-manager": "4.18.0", + "@typescript-eslint/experimental-utils": "4.21.0", + "@typescript-eslint/scope-manager": "4.21.0", "debug": "^4.1.1", "functional-red-black-tree": "^1.0.1", "lodash": "^4.17.15", @@ -486,15 +494,15 @@ } }, "node_modules/@typescript-eslint/experimental-utils": { - "version": "4.18.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/experimental-utils/-/experimental-utils-4.18.0.tgz", - "integrity": "sha512-92h723Kblt9JcT2RRY3QS2xefFKar4ZQFVs3GityOKWQYgtajxt/tuXIzL7sVCUlM1hgreiV5gkGYyBpdOwO6A==", + "version": "4.21.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/experimental-utils/-/experimental-utils-4.21.0.tgz", + "integrity": "sha512-cEbgosW/tUFvKmkg3cU7LBoZhvUs+ZPVM9alb25XvR0dal4qHL3SiUqHNrzoWSxaXA9gsifrYrS1xdDV6w/gIA==", "dev": true, "dependencies": { "@types/json-schema": "^7.0.3", - "@typescript-eslint/scope-manager": "4.18.0", - "@typescript-eslint/types": "4.18.0", - "@typescript-eslint/typescript-estree": "4.18.0", + "@typescript-eslint/scope-manager": "4.21.0", + "@typescript-eslint/types": "4.21.0", + "@typescript-eslint/typescript-estree": "4.21.0", "eslint-scope": "^5.0.0", "eslint-utils": "^2.0.0" }, @@ -510,14 +518,14 @@ } }, "node_modules/@typescript-eslint/parser": { - "version": "4.18.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/parser/-/parser-4.18.0.tgz", - "integrity": "sha512-W3z5S0ZbecwX3PhJEAnq4mnjK5JJXvXUDBYIYGoweCyWyuvAKfGHvzmpUzgB5L4cRBb+cTu9U/ro66dx7dIimA==", + "version": "4.21.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/parser/-/parser-4.21.0.tgz", + "integrity": "sha512-eyNf7QmE5O/l1smaQgN0Lj2M/1jOuNg2NrBm1dqqQN0sVngTLyw8tdCbih96ixlhbF1oINoN8fDCyEH9SjLeIA==", "dev": true, "dependencies": { - "@typescript-eslint/scope-manager": "4.18.0", - "@typescript-eslint/types": "4.18.0", - "@typescript-eslint/typescript-estree": "4.18.0", + "@typescript-eslint/scope-manager": "4.21.0", + "@typescript-eslint/types": "4.21.0", + "@typescript-eslint/typescript-estree": "4.21.0", "debug": "^4.1.1" }, "engines": { @@ -537,13 +545,13 @@ } }, "node_modules/@typescript-eslint/scope-manager": { - "version": "4.18.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/scope-manager/-/scope-manager-4.18.0.tgz", - "integrity": "sha512-olX4yN6rvHR2eyFOcb6E4vmhDPsfdMyfQ3qR+oQNkAv8emKKlfxTWUXU5Mqxs2Fwe3Pf1BoPvrwZtwngxDzYzQ==", + "version": "4.21.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/scope-manager/-/scope-manager-4.21.0.tgz", + "integrity": "sha512-kfOjF0w1Ix7+a5T1knOw00f7uAP9Gx44+OEsNQi0PvvTPLYeXJlsCJ4tYnDj5PQEYfpcgOH5yBlw7K+UEI9Agw==", "dev": true, "dependencies": { - "@typescript-eslint/types": "4.18.0", - "@typescript-eslint/visitor-keys": "4.18.0" + "@typescript-eslint/types": "4.21.0", + "@typescript-eslint/visitor-keys": "4.21.0" }, "engines": { "node": "^8.10.0 || ^10.13.0 || >=11.10.1" @@ -554,9 +562,9 @@ } }, "node_modules/@typescript-eslint/types": { - "version": "4.18.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/types/-/types-4.18.0.tgz", - "integrity": "sha512-/BRociARpj5E+9yQ7cwCF/SNOWwXJ3qhjurMuK2hIFUbr9vTuDeu476Zpu+ptxY2kSxUHDGLLKy+qGq2sOg37A==", + "version": "4.21.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/types/-/types-4.21.0.tgz", + "integrity": "sha512-+OQaupjGVVc8iXbt6M1oZMwyKQNehAfLYJJ3SdvnofK2qcjfor9pEM62rVjBknhowTkh+2HF+/KdRAc/wGBN2w==", "dev": true, "engines": { "node": "^8.10.0 || ^10.13.0 || >=11.10.1" @@ -567,13 +575,13 @@ } }, "node_modules/@typescript-eslint/typescript-estree": { - "version": "4.18.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/typescript-estree/-/typescript-estree-4.18.0.tgz", - "integrity": "sha512-wt4xvF6vvJI7epz+rEqxmoNQ4ZADArGQO9gDU+cM0U5fdVv7N+IAuVoVAoZSOZxzGHBfvE3XQMLdy+scsqFfeg==", + "version": "4.21.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/typescript-estree/-/typescript-estree-4.21.0.tgz", + "integrity": "sha512-ZD3M7yLaVGVYLw4nkkoGKumb7Rog7QID9YOWobFDMQKNl+vPxqVIW/uDk+MDeGc+OHcoG2nJ2HphwiPNajKw3w==", "dev": true, "dependencies": { - "@typescript-eslint/types": "4.18.0", - "@typescript-eslint/visitor-keys": "4.18.0", + "@typescript-eslint/types": "4.21.0", + "@typescript-eslint/visitor-keys": "4.21.0", "debug": "^4.1.1", "globby": "^11.0.1", "is-glob": "^4.0.1", @@ -594,12 +602,12 @@ } }, "node_modules/@typescript-eslint/visitor-keys": { - "version": "4.18.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/visitor-keys/-/visitor-keys-4.18.0.tgz", - "integrity": "sha512-Q9t90JCvfYaN0OfFUgaLqByOfz8yPeTAdotn/XYNm5q9eHax90gzdb+RJ6E9T5s97Kv/UHWKERTmqA0jTKAEHw==", + "version": "4.21.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/visitor-keys/-/visitor-keys-4.21.0.tgz", + "integrity": "sha512-dH22dROWGi5Z6p+Igc8bLVLmwy7vEe8r+8c+raPQU0LxgogPUrRAtRGtvBWmlr9waTu3n+QLt/qrS/hWzk1x5w==", "dev": true, "dependencies": { - "@typescript-eslint/types": "4.18.0", + "@typescript-eslint/types": "4.21.0", "eslint-visitor-keys": "^2.0.0" }, "engines": { @@ -631,6 +639,12 @@ "acorn": "^6.0.0 || ^7.0.0 || ^8.0.0" } }, + "node_modules/add-stream": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/add-stream/-/add-stream-1.0.0.tgz", + "integrity": "sha1-anmQQ3ynNtXhKI25K9MmbV9csqo=", + "dev": true + }, "node_modules/aggregate-error": { "version": "3.1.0", "resolved": "https://registry.npmjs.org/aggregate-error/-/aggregate-error-3.1.0.tgz", @@ -738,6 +752,15 @@ "node": ">=8" } }, + "node_modules/array-find-index": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/array-find-index/-/array-find-index-1.0.2.tgz", + "integrity": "sha1-3wEKoSh+Fku9pvlyOwqWoexBh6E=", + "dev": true, + "engines": { + "node": ">=0.10.0" + } + }, "node_modules/array-ify": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/array-ify/-/array-ify-1.0.0.tgz", @@ -985,6 +1008,28 @@ "integrity": "sha1-2Klr13/Wjfd5OnMDajug1UBdR3s=", "dev": true }, + "node_modules/conventional-changelog": { + "version": "3.1.24", + "resolved": "https://registry.npmjs.org/conventional-changelog/-/conventional-changelog-3.1.24.tgz", + "integrity": "sha512-ed6k8PO00UVvhExYohroVPXcOJ/K1N0/drJHx/faTH37OIZthlecuLIRX/T6uOp682CAoVoFpu+sSEaeuH6Asg==", + "dev": true, + "dependencies": { + "conventional-changelog-angular": "^5.0.12", + "conventional-changelog-atom": "^2.0.8", + "conventional-changelog-codemirror": "^2.0.8", + "conventional-changelog-conventionalcommits": "^4.5.0", + "conventional-changelog-core": "^4.2.1", + "conventional-changelog-ember": "^2.0.9", + "conventional-changelog-eslint": "^3.0.9", + "conventional-changelog-express": "^2.0.6", + "conventional-changelog-jquery": "^3.0.11", + "conventional-changelog-jshint": "^2.0.9", + "conventional-changelog-preset-loader": "^2.3.4" + }, + "engines": { + "node": ">=10" + } + }, "node_modules/conventional-changelog-angular": { "version": "5.0.12", "resolved": "https://registry.npmjs.org/conventional-changelog-angular/-/conventional-changelog-angular-5.0.12.tgz", @@ -998,6 +1043,285 @@ "node": ">=10" } }, + "node_modules/conventional-changelog-atom": { + "version": "2.0.8", + "resolved": "https://registry.npmjs.org/conventional-changelog-atom/-/conventional-changelog-atom-2.0.8.tgz", + "integrity": "sha512-xo6v46icsFTK3bb7dY/8m2qvc8sZemRgdqLb/bjpBsH2UyOS8rKNTgcb5025Hri6IpANPApbXMg15QLb1LJpBw==", + "dev": true, + "dependencies": { + "q": "^1.5.1" + }, + "engines": { + "node": ">=10" + } + }, + "node_modules/conventional-changelog-cli": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/conventional-changelog-cli/-/conventional-changelog-cli-2.1.1.tgz", + "integrity": "sha512-xMGQdKJ+4XFDDgfX5aK7UNFduvJMbvF5BB+g0OdVhA3rYdYyhctrIE2Al+WYdZeKTdg9YzMWF2iFPT8MupIwng==", + "dev": true, + "dependencies": { + "add-stream": "^1.0.0", + "conventional-changelog": "^3.1.24", + "lodash": "^4.17.15", + "meow": "^8.0.0", + "tempfile": "^3.0.0" + }, + "bin": { + "conventional-changelog": "cli.js" + }, + "engines": { + "node": ">=10" + } + }, + "node_modules/conventional-changelog-codemirror": { + "version": "2.0.8", + "resolved": "https://registry.npmjs.org/conventional-changelog-codemirror/-/conventional-changelog-codemirror-2.0.8.tgz", + "integrity": "sha512-z5DAsn3uj1Vfp7po3gpt2Boc+Bdwmw2++ZHa5Ak9k0UKsYAO5mH1UBTN0qSCuJZREIhX6WU4E1p3IW2oRCNzQw==", + "dev": true, + "dependencies": { + "q": "^1.5.1" + }, + "engines": { + "node": ">=10" + } + }, + "node_modules/conventional-changelog-conventionalcommits": { + "version": "4.5.0", + "resolved": "https://registry.npmjs.org/conventional-changelog-conventionalcommits/-/conventional-changelog-conventionalcommits-4.5.0.tgz", + "integrity": "sha512-buge9xDvjjOxJlyxUnar/+6i/aVEVGA7EEh4OafBCXPlLUQPGbRUBhBUveWRxzvR8TEjhKEP4BdepnpG2FSZXw==", + "dev": true, + "dependencies": { + "compare-func": "^2.0.0", + "lodash": "^4.17.15", + "q": "^1.5.1" + }, + "engines": { + "node": ">=10" + } + }, + "node_modules/conventional-changelog-core": { + "version": "4.2.2", + "resolved": "https://registry.npmjs.org/conventional-changelog-core/-/conventional-changelog-core-4.2.2.tgz", + "integrity": "sha512-7pDpRUiobQDNkwHyJG7k9f6maPo9tfPzkSWbRq97GGiZqisElhnvUZSvyQH20ogfOjntB5aadvv6NNcKL1sReg==", + "dev": true, + "dependencies": { + "add-stream": "^1.0.0", + "conventional-changelog-writer": "^4.0.18", + "conventional-commits-parser": "^3.2.0", + "dateformat": "^3.0.0", + "get-pkg-repo": "^1.0.0", + "git-raw-commits": "^2.0.8", + "git-remote-origin-url": "^2.0.0", + "git-semver-tags": "^4.1.1", + "lodash": "^4.17.15", + "normalize-package-data": "^3.0.0", + "q": "^1.5.1", + "read-pkg": "^3.0.0", + "read-pkg-up": "^3.0.0", + "shelljs": "^0.8.3", + "through2": "^4.0.0" + }, + "engines": { + "node": ">=10" + } + }, + "node_modules/conventional-changelog-core/node_modules/find-up": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/find-up/-/find-up-2.1.0.tgz", + "integrity": "sha1-RdG35QbHF93UgndaK3eSCjwMV6c=", + "dev": true, + "dependencies": { + "locate-path": "^2.0.0" + }, + "engines": { + "node": ">=4" + } + }, + "node_modules/conventional-changelog-core/node_modules/locate-path": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/locate-path/-/locate-path-2.0.0.tgz", + "integrity": "sha1-K1aLJl7slExtnA3pw9u7ygNUzY4=", + "dev": true, + "dependencies": { + "p-locate": "^2.0.0", + "path-exists": "^3.0.0" + }, + "engines": { + "node": ">=4" + } + }, + "node_modules/conventional-changelog-core/node_modules/p-limit": { + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/p-limit/-/p-limit-1.3.0.tgz", + "integrity": "sha512-vvcXsLAJ9Dr5rQOPk7toZQZJApBl2K4J6dANSsEuh6QI41JYcsS/qhTGa9ErIUUgK3WNQoJYvylxvjqmiqEA9Q==", + "dev": true, + "dependencies": { + "p-try": "^1.0.0" + }, + "engines": { + "node": ">=4" + } + }, + "node_modules/conventional-changelog-core/node_modules/p-locate": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/p-locate/-/p-locate-2.0.0.tgz", + "integrity": "sha1-IKAQOyIqcMj9OcwuWAaA893l7EM=", + "dev": true, + "dependencies": { + "p-limit": "^1.1.0" + }, + "engines": { + "node": ">=4" + } + }, + "node_modules/conventional-changelog-core/node_modules/p-try": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/p-try/-/p-try-1.0.0.tgz", + "integrity": "sha1-y8ec26+P1CKOE/Yh8rGiN8GyB7M=", + "dev": true, + "engines": { + "node": ">=4" + } + }, + "node_modules/conventional-changelog-core/node_modules/path-exists": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/path-exists/-/path-exists-3.0.0.tgz", + "integrity": "sha1-zg6+ql94yxiSXqfYENe1mwEP1RU=", + "dev": true, + "engines": { + "node": ">=4" + } + }, + "node_modules/conventional-changelog-core/node_modules/read-pkg-up": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/read-pkg-up/-/read-pkg-up-3.0.0.tgz", + "integrity": "sha1-PtSWaF26D4/hGNBpHcUfSh/5bwc=", + "dev": true, + "dependencies": { + "find-up": "^2.0.0", + "read-pkg": "^3.0.0" + }, + "engines": { + "node": ">=4" + } + }, + "node_modules/conventional-changelog-ember": { + "version": "2.0.9", + "resolved": "https://registry.npmjs.org/conventional-changelog-ember/-/conventional-changelog-ember-2.0.9.tgz", + "integrity": "sha512-ulzIReoZEvZCBDhcNYfDIsLTHzYHc7awh+eI44ZtV5cx6LVxLlVtEmcO+2/kGIHGtw+qVabJYjdI5cJOQgXh1A==", + "dev": true, + "dependencies": { + "q": "^1.5.1" + }, + "engines": { + "node": ">=10" + } + }, + "node_modules/conventional-changelog-eslint": { + "version": "3.0.9", + "resolved": "https://registry.npmjs.org/conventional-changelog-eslint/-/conventional-changelog-eslint-3.0.9.tgz", + "integrity": "sha512-6NpUCMgU8qmWmyAMSZO5NrRd7rTgErjrm4VASam2u5jrZS0n38V7Y9CzTtLT2qwz5xEChDR4BduoWIr8TfwvXA==", + "dev": true, + "dependencies": { + "q": "^1.5.1" + }, + "engines": { + "node": ">=10" + } + }, + "node_modules/conventional-changelog-express": { + "version": "2.0.6", + "resolved": "https://registry.npmjs.org/conventional-changelog-express/-/conventional-changelog-express-2.0.6.tgz", + "integrity": "sha512-SDez2f3iVJw6V563O3pRtNwXtQaSmEfTCaTBPCqn0oG0mfkq0rX4hHBq5P7De2MncoRixrALj3u3oQsNK+Q0pQ==", + "dev": true, + "dependencies": { + "q": "^1.5.1" + }, + "engines": { + "node": ">=10" + } + }, + "node_modules/conventional-changelog-jquery": { + "version": "3.0.11", + "resolved": "https://registry.npmjs.org/conventional-changelog-jquery/-/conventional-changelog-jquery-3.0.11.tgz", + "integrity": "sha512-x8AWz5/Td55F7+o/9LQ6cQIPwrCjfJQ5Zmfqi8thwUEKHstEn4kTIofXub7plf1xvFA2TqhZlq7fy5OmV6BOMw==", + "dev": true, + "dependencies": { + "q": "^1.5.1" + }, + "engines": { + "node": ">=10" + } + }, + "node_modules/conventional-changelog-jshint": { + "version": "2.0.9", + "resolved": "https://registry.npmjs.org/conventional-changelog-jshint/-/conventional-changelog-jshint-2.0.9.tgz", + "integrity": "sha512-wMLdaIzq6TNnMHMy31hql02OEQ8nCQfExw1SE0hYL5KvU+JCTuPaDO+7JiogGT2gJAxiUGATdtYYfh+nT+6riA==", + "dev": true, + "dependencies": { + "compare-func": "^2.0.0", + "q": "^1.5.1" + }, + "engines": { + "node": ">=10" + } + }, + "node_modules/conventional-changelog-preset-loader": { + "version": "2.3.4", + "resolved": "https://registry.npmjs.org/conventional-changelog-preset-loader/-/conventional-changelog-preset-loader-2.3.4.tgz", + "integrity": "sha512-GEKRWkrSAZeTq5+YjUZOYxdHq+ci4dNwHvpaBC3+ENalzFWuCWa9EZXSuZBpkr72sMdKB+1fyDV4takK1Lf58g==", + "dev": true, + "engines": { + "node": ">=10" + } + }, + "node_modules/conventional-changelog-writer": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/conventional-changelog-writer/-/conventional-changelog-writer-4.1.0.tgz", + "integrity": "sha512-WwKcUp7WyXYGQmkLsX4QmU42AZ1lqlvRW9mqoyiQzdD+rJWbTepdWoKJuwXTS+yq79XKnQNa93/roViPQrAQgw==", + "dev": true, + "dependencies": { + "compare-func": "^2.0.0", + "conventional-commits-filter": "^2.0.7", + "dateformat": "^3.0.0", + "handlebars": "^4.7.6", + "json-stringify-safe": "^5.0.1", + "lodash": "^4.17.15", + "meow": "^8.0.0", + "semver": "^6.0.0", + "split": "^1.0.0", + "through2": "^4.0.0" + }, + "bin": { + "conventional-changelog-writer": "cli.js" + }, + "engines": { + "node": ">=10" + } + }, + "node_modules/conventional-changelog-writer/node_modules/semver": { + "version": "6.3.0", + "resolved": "https://registry.npmjs.org/semver/-/semver-6.3.0.tgz", + "integrity": "sha512-b39TBaTSfV6yBrapU89p5fKekE2m/NwnDocOVruQFS1/veMgdzuPcnOM34M6CwxW8jH/lxEa5rBoDeUwu5HHTw==", + "dev": true, + "bin": { + "semver": "bin/semver.js" + } + }, + "node_modules/conventional-commits-filter": { + "version": "2.0.7", + "resolved": "https://registry.npmjs.org/conventional-commits-filter/-/conventional-commits-filter-2.0.7.tgz", + "integrity": "sha512-ASS9SamOP4TbCClsRHxIHXRfcGCnIoQqkvAzCSbZzTFLfcTqJVugB0agRgsEELsqaeWgsXv513eS116wnlSSPA==", + "dev": true, + "dependencies": { + "lodash.ismatch": "^4.4.0", + "modify-values": "^1.0.0" + }, + "engines": { + "node": ">=10" + } + }, "node_modules/conventional-commits-parser": { "version": "3.2.1", "resolved": "https://registry.npmjs.org/conventional-commits-parser/-/conventional-commits-parser-3.2.1.tgz", @@ -1019,6 +1343,12 @@ "node": ">=10" } }, + "node_modules/core-util-is": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/core-util-is/-/core-util-is-1.0.2.tgz", + "integrity": "sha1-tf1UIgqivFq1eqtxQMlAdUUDwac=", + "dev": true + }, "node_modules/cosmiconfig": { "version": "7.0.0", "resolved": "https://registry.npmjs.org/cosmiconfig/-/cosmiconfig-7.0.0.tgz", @@ -1049,6 +1379,18 @@ "node": ">= 8" } }, + "node_modules/currently-unhandled": { + "version": "0.4.1", + "resolved": "https://registry.npmjs.org/currently-unhandled/-/currently-unhandled-0.4.1.tgz", + "integrity": "sha1-mI3zP+qxke95mmE2nddsF635V+o=", + "dev": true, + "dependencies": { + "array-find-index": "^1.0.1" + }, + "engines": { + "node": ">=0.10.0" + } + }, "node_modules/dargs": { "version": "7.0.0", "resolved": "https://registry.npmjs.org/dargs/-/dargs-7.0.0.tgz", @@ -1058,6 +1400,15 @@ "node": ">=8" } }, + "node_modules/dateformat": { + "version": "3.0.3", + "resolved": "https://registry.npmjs.org/dateformat/-/dateformat-3.0.3.tgz", + "integrity": "sha512-jyCETtSl3VMZMWeRo7iY1FL19ges1t55hMo5yaam4Jrsm5EPL89UQkoQRyiI+Yf4k8r2ZpdngkV8hr1lIdjb3Q==", + "dev": true, + "engines": { + "node": "*" + } + }, "node_modules/debug": { "version": "4.3.1", "resolved": "https://registry.npmjs.org/debug/-/debug-4.3.1.tgz", @@ -1268,9 +1619,9 @@ } }, "node_modules/eslint": { - "version": "7.22.0", - "resolved": "https://registry.npmjs.org/eslint/-/eslint-7.22.0.tgz", - "integrity": "sha512-3VawOtjSJUQiiqac8MQc+w457iGLfuNGLFn8JmF051tTKbh5/x/0vlcEj8OgDCaw7Ysa2Jn8paGshV7x2abKXg==", + "version": "7.24.0", + "resolved": "https://registry.npmjs.org/eslint/-/eslint-7.24.0.tgz", + "integrity": "sha512-k9gaHeHiFmGCDQ2rEfvULlSLruz6tgfA8DEn+rY9/oYPFFTlz55mM/Q/Rij1b2Y42jwZiK3lXvNTw6w6TXzcKQ==", "dev": true, "dependencies": { "@babel/code-frame": "7.12.11", @@ -1750,6 +2101,314 @@ "integrity": "sha512-I0UBV/XOz1XkIJHEUDMZAbzCThU/H8DxmSfmdGcKPnVhu2VfFqr34jr9777IyaTYvxjedWhqVIilEDsCdP5G6g==", "dev": true }, + "node_modules/get-pkg-repo": { + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/get-pkg-repo/-/get-pkg-repo-1.4.0.tgz", + "integrity": "sha1-xztInAbYDMVTbCyFP54FIyBWly0=", + "dev": true, + "dependencies": { + "hosted-git-info": "^2.1.4", + "meow": "^3.3.0", + "normalize-package-data": "^2.3.0", + "parse-github-repo-url": "^1.3.0", + "through2": "^2.0.0" + }, + "bin": { + "get-pkg-repo": "cli.js" + } + }, + "node_modules/get-pkg-repo/node_modules/camelcase": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/camelcase/-/camelcase-2.1.1.tgz", + "integrity": "sha1-fB0W1nmhu+WcoCys7PsBHiAfWh8=", + "dev": true, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/get-pkg-repo/node_modules/camelcase-keys": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/camelcase-keys/-/camelcase-keys-2.1.0.tgz", + "integrity": "sha1-MIvur/3ygRkFHvodkyITyRuPkuc=", + "dev": true, + "dependencies": { + "camelcase": "^2.0.0", + "map-obj": "^1.0.0" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/get-pkg-repo/node_modules/find-up": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/find-up/-/find-up-1.1.2.tgz", + "integrity": "sha1-ay6YIrGizgpgq2TWEOzK1TyyTQ8=", + "dev": true, + "dependencies": { + "path-exists": "^2.0.0", + "pinkie-promise": "^2.0.0" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/get-pkg-repo/node_modules/get-stdin": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/get-stdin/-/get-stdin-4.0.1.tgz", + "integrity": "sha1-uWjGsKBDhDJJAui/Gl3zJXmkUP4=", + "dev": true, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/get-pkg-repo/node_modules/hosted-git-info": { + "version": "2.8.9", + "resolved": "https://registry.npmjs.org/hosted-git-info/-/hosted-git-info-2.8.9.tgz", + "integrity": "sha512-mxIDAb9Lsm6DoOJ7xH+5+X4y1LU/4Hi50L9C5sIswK3JzULS4bwk1FvjdBgvYR4bzT4tuUQiC15FE2f5HbLvYw==", + "dev": true + }, + "node_modules/get-pkg-repo/node_modules/indent-string": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/indent-string/-/indent-string-2.1.0.tgz", + "integrity": "sha1-ji1INIdCEhtKghi3oTfppSBJ3IA=", + "dev": true, + "dependencies": { + "repeating": "^2.0.0" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/get-pkg-repo/node_modules/load-json-file": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/load-json-file/-/load-json-file-1.1.0.tgz", + "integrity": "sha1-lWkFcI1YtLq0wiYbBPWfMcmTdMA=", + "dev": true, + "dependencies": { + "graceful-fs": "^4.1.2", + "parse-json": "^2.2.0", + "pify": "^2.0.0", + "pinkie-promise": "^2.0.0", + "strip-bom": "^2.0.0" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/get-pkg-repo/node_modules/map-obj": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/map-obj/-/map-obj-1.0.1.tgz", + "integrity": "sha1-2TPOuSBdgr3PSIb2dCvcK03qFG0=", + "dev": true, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/get-pkg-repo/node_modules/meow": { + "version": "3.7.0", + "resolved": "https://registry.npmjs.org/meow/-/meow-3.7.0.tgz", + "integrity": "sha1-cstmi0JSKCkKu/qFaJJYcwioAfs=", + "dev": true, + "dependencies": { + "camelcase-keys": "^2.0.0", + "decamelize": "^1.1.2", + "loud-rejection": "^1.0.0", + "map-obj": "^1.0.1", + "minimist": "^1.1.3", + "normalize-package-data": "^2.3.4", + "object-assign": "^4.0.1", + "read-pkg-up": "^1.0.1", + "redent": "^1.0.0", + "trim-newlines": "^1.0.0" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/get-pkg-repo/node_modules/normalize-package-data": { + "version": "2.5.0", + "resolved": "https://registry.npmjs.org/normalize-package-data/-/normalize-package-data-2.5.0.tgz", + "integrity": "sha512-/5CMN3T0R4XTj4DcGaexo+roZSdSFW/0AOOTROrjxzCG1wrWXEsGbRKevjlIL+ZDE4sZlJr5ED4YW0yqmkK+eA==", + "dev": true, + "dependencies": { + "hosted-git-info": "^2.1.4", + "resolve": "^1.10.0", + "semver": "2 || 3 || 4 || 5", + "validate-npm-package-license": "^3.0.1" + } + }, + "node_modules/get-pkg-repo/node_modules/parse-json": { + "version": "2.2.0", + "resolved": "https://registry.npmjs.org/parse-json/-/parse-json-2.2.0.tgz", + "integrity": "sha1-9ID0BDTvgHQfhGkJn43qGPVaTck=", + "dev": true, + "dependencies": { + "error-ex": "^1.2.0" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/get-pkg-repo/node_modules/path-exists": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/path-exists/-/path-exists-2.1.0.tgz", + "integrity": "sha1-D+tsZPD8UY2adU3V77YscCJ2H0s=", + "dev": true, + "dependencies": { + "pinkie-promise": "^2.0.0" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/get-pkg-repo/node_modules/path-type": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/path-type/-/path-type-1.1.0.tgz", + "integrity": "sha1-WcRPfuSR2nBNpBXaWkBwuk+P5EE=", + "dev": true, + "dependencies": { + "graceful-fs": "^4.1.2", + "pify": "^2.0.0", + "pinkie-promise": "^2.0.0" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/get-pkg-repo/node_modules/pify": { + "version": "2.3.0", + "resolved": "https://registry.npmjs.org/pify/-/pify-2.3.0.tgz", + "integrity": "sha1-7RQaasBDqEnqWISY59yosVMw6Qw=", + "dev": true, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/get-pkg-repo/node_modules/read-pkg": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/read-pkg/-/read-pkg-1.1.0.tgz", + "integrity": "sha1-9f+qXs0pyzHAR0vKfXVra7KePyg=", + "dev": true, + "dependencies": { + "load-json-file": "^1.0.0", + "normalize-package-data": "^2.3.2", + "path-type": "^1.0.0" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/get-pkg-repo/node_modules/read-pkg-up": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/read-pkg-up/-/read-pkg-up-1.0.1.tgz", + "integrity": "sha1-nWPBMnbAZZGNV/ACpX9AobZD+wI=", + "dev": true, + "dependencies": { + "find-up": "^1.0.0", + "read-pkg": "^1.0.0" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/get-pkg-repo/node_modules/readable-stream": { + "version": "2.3.7", + "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-2.3.7.tgz", + "integrity": "sha512-Ebho8K4jIbHAxnuxi7o42OrZgF/ZTNcsZj6nRKyUmkhLFq8CHItp/fy6hQZuZmP/n3yZ9VBUbp4zz/mX8hmYPw==", + "dev": true, + "dependencies": { + "core-util-is": "~1.0.0", + "inherits": "~2.0.3", + "isarray": "~1.0.0", + "process-nextick-args": "~2.0.0", + "safe-buffer": "~5.1.1", + "string_decoder": "~1.1.1", + "util-deprecate": "~1.0.1" + } + }, + "node_modules/get-pkg-repo/node_modules/redent": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/redent/-/redent-1.0.0.tgz", + "integrity": "sha1-z5Fqsf1fHxbfsggi3W7H9zDCr94=", + "dev": true, + "dependencies": { + "indent-string": "^2.1.0", + "strip-indent": "^1.0.1" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/get-pkg-repo/node_modules/safe-buffer": { + "version": "5.1.2", + "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.1.2.tgz", + "integrity": "sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g==", + "dev": true + }, + "node_modules/get-pkg-repo/node_modules/semver": { + "version": "5.7.1", + "resolved": "https://registry.npmjs.org/semver/-/semver-5.7.1.tgz", + "integrity": "sha512-sauaDf/PZdVgrLTNYHRtpXa1iRiKcaebiKQ1BJdpQlWH2lCvexQdX55snPFyK7QzpudqbCI0qXFfOasHdyNDGQ==", + "dev": true, + "bin": { + "semver": "bin/semver" + } + }, + "node_modules/get-pkg-repo/node_modules/string_decoder": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.1.1.tgz", + "integrity": "sha512-n/ShnvDi6FHbbVfviro+WojiFzv+s8MPMHBczVePfUpDJLwoLT0ht1l4YwBCbi8pJAveEEdnkHyPyTP/mzRfwg==", + "dev": true, + "dependencies": { + "safe-buffer": "~5.1.0" + } + }, + "node_modules/get-pkg-repo/node_modules/strip-bom": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/strip-bom/-/strip-bom-2.0.0.tgz", + "integrity": "sha1-YhmoVhZSBJHzV4i9vxRHqZx+aw4=", + "dev": true, + "dependencies": { + "is-utf8": "^0.2.0" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/get-pkg-repo/node_modules/strip-indent": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/strip-indent/-/strip-indent-1.0.1.tgz", + "integrity": "sha1-DHlipq3vp7vUrDZkYKY4VSrhoKI=", + "dev": true, + "dependencies": { + "get-stdin": "^4.0.1" + }, + "bin": { + "strip-indent": "cli.js" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/get-pkg-repo/node_modules/through2": { + "version": "2.0.5", + "resolved": "https://registry.npmjs.org/through2/-/through2-2.0.5.tgz", + "integrity": "sha512-/mrRod8xqpA+IHSLyGCQ2s8SPHiCDEeQJSep1jqLYeEUClOFG2Qsh+4FU6G9VeqpZnGW/Su8LQGc4YKni5rYSQ==", + "dev": true, + "dependencies": { + "readable-stream": "~2.3.6", + "xtend": "~4.0.1" + } + }, + "node_modules/get-pkg-repo/node_modules/trim-newlines": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/trim-newlines/-/trim-newlines-1.0.0.tgz", + "integrity": "sha1-WIeWa7WCpFA6QetST301ARgVphM=", + "dev": true, + "engines": { + "node": ">=0.10.0" + } + }, "node_modules/get-stdin": { "version": "8.0.0", "resolved": "https://registry.npmjs.org/get-stdin/-/get-stdin-8.0.0.tgz", @@ -1796,6 +2455,62 @@ "node": ">=10" } }, + "node_modules/git-remote-origin-url": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/git-remote-origin-url/-/git-remote-origin-url-2.0.0.tgz", + "integrity": "sha1-UoJlna4hBxRaERJhEq0yFuxfpl8=", + "dev": true, + "dependencies": { + "gitconfiglocal": "^1.0.0", + "pify": "^2.3.0" + }, + "engines": { + "node": ">=4" + } + }, + "node_modules/git-remote-origin-url/node_modules/pify": { + "version": "2.3.0", + "resolved": "https://registry.npmjs.org/pify/-/pify-2.3.0.tgz", + "integrity": "sha1-7RQaasBDqEnqWISY59yosVMw6Qw=", + "dev": true, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/git-semver-tags": { + "version": "4.1.1", + "resolved": "https://registry.npmjs.org/git-semver-tags/-/git-semver-tags-4.1.1.tgz", + "integrity": "sha512-OWyMt5zBe7xFs8vglMmhM9lRQzCWL3WjHtxNNfJTMngGym7pC1kh8sP6jevfydJ6LP3ZvGxfb6ABYgPUM0mtsA==", + "dev": true, + "dependencies": { + "meow": "^8.0.0", + "semver": "^6.0.0" + }, + "bin": { + "git-semver-tags": "cli.js" + }, + "engines": { + "node": ">=10" + } + }, + "node_modules/git-semver-tags/node_modules/semver": { + "version": "6.3.0", + "resolved": "https://registry.npmjs.org/semver/-/semver-6.3.0.tgz", + "integrity": "sha512-b39TBaTSfV6yBrapU89p5fKekE2m/NwnDocOVruQFS1/veMgdzuPcnOM34M6CwxW8jH/lxEa5rBoDeUwu5HHTw==", + "dev": true, + "bin": { + "semver": "bin/semver.js" + } + }, + "node_modules/gitconfiglocal": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/gitconfiglocal/-/gitconfiglocal-1.0.0.tgz", + "integrity": "sha1-QdBF84UaXqiPA/JMocYXgRRGS5s=", + "dev": true, + "dependencies": { + "ini": "^1.3.2" + } + }, "node_modules/glob": { "version": "7.1.6", "resolved": "https://registry.npmjs.org/glob/-/glob-7.1.6.tgz", @@ -1856,9 +2571,9 @@ } }, "node_modules/globby": { - "version": "11.0.2", - "resolved": "https://registry.npmjs.org/globby/-/globby-11.0.2.tgz", - "integrity": "sha512-2ZThXDvvV8fYFRVIxnrMQBipZQDr7MxKAmQK1vujaj9/7eF0efG7BPUKJ7jP7G5SLF37xKDXvO4S/KKLj/Z0og==", + "version": "11.0.3", + "resolved": "https://registry.npmjs.org/globby/-/globby-11.0.3.tgz", + "integrity": "sha512-ffdmosjA807y7+lA1NM0jELARVmYul/715xiILEjo3hBLPTcirgQNnXECn5g3mtR8TOLCVbkfua1Hpen25/Xcg==", "dev": true, "dependencies": { "array-union": "^2.1.0", @@ -1890,6 +2605,27 @@ "integrity": "sha512-nTnJ528pbqxYanhpDYsi4Rd8MAeaBA67+RZ10CM1m3bTAVFEDcd5AuA4a6W5YkGZ1iNXHzZz8T6TBKLeBuNriQ==", "dev": true }, + "node_modules/handlebars": { + "version": "4.7.7", + "resolved": "https://registry.npmjs.org/handlebars/-/handlebars-4.7.7.tgz", + "integrity": "sha512-aAcXm5OAfE/8IXkcZvCepKU3VzW1/39Fb5ZuqMtgI/hT8X2YgoMvBY5dLhq/cpOvw7Lk1nK/UF71aLG/ZnVYRA==", + "dev": true, + "dependencies": { + "minimist": "^1.2.5", + "neo-async": "^2.6.0", + "source-map": "^0.6.1", + "wordwrap": "^1.0.0" + }, + "bin": { + "handlebars": "bin/handlebars" + }, + "engines": { + "node": ">=0.4.7" + }, + "optionalDependencies": { + "uglify-js": "^3.1.4" + } + }, "node_modules/hard-rejection": { "version": "2.1.0", "resolved": "https://registry.npmjs.org/hard-rejection/-/hard-rejection-2.1.0.tgz", @@ -1942,9 +2678,9 @@ } }, "node_modules/hosted-git-info": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/hosted-git-info/-/hosted-git-info-4.0.0.tgz", - "integrity": "sha512-fqhGdjk4av7mT9fU/B01dUtZ+WZSc/XEXMoLXDVZukiQRXxeHSSz3AqbeWRJHtF8EQYHlAgB1NSAHU0Cm7aqZA==", + "version": "4.0.2", + "resolved": "https://registry.npmjs.org/hosted-git-info/-/hosted-git-info-4.0.2.tgz", + "integrity": "sha512-c9OGXbZ3guC/xOlCg1Ci/VgWlwsqDv1yMQL1CWqXDL0hDjXuNcq0zuR4xqPSuasI3kqFDhqSyTjREz5gzq0fXg==", "dev": true, "dependencies": { "lru-cache": "^6.0.0" @@ -2066,6 +2802,15 @@ "integrity": "sha512-JV/yugV2uzW5iMRSiZAyDtQd+nxtUnjeLt0acNdw98kKLrvuRVyB80tsREOE7yvGVgalhZ6RNXCmEHkUKBKxew==", "dev": true }, + "node_modules/interpret": { + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/interpret/-/interpret-1.4.0.tgz", + "integrity": "sha512-agE4QfB2Lkp9uICn7BAqoscw4SZP9kTE2hxiFI3jBPmXJfdqiahTbUuKGsMoN2GtqL9AxhYioAcVvgsb1HvRbA==", + "dev": true, + "engines": { + "node": ">= 0.10" + } + }, "node_modules/is-arrayish": { "version": "0.2.1", "resolved": "https://registry.npmjs.org/is-arrayish/-/is-arrayish-0.2.1.tgz", @@ -2141,6 +2886,18 @@ "node": ">=0.10.0" } }, + "node_modules/is-finite": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/is-finite/-/is-finite-1.1.0.tgz", + "integrity": "sha512-cdyMtqX/BOqqNBBiKlIVkytNHm49MtMlYyn1zxzvJKWmFMlGzm+ry5BBfYyeY9YmNKbRSo/o7OX9w9ale0wg3w==", + "dev": true, + "engines": { + "node": ">=0.10.0" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, "node_modules/is-fullwidth-code-point": { "version": "3.0.0", "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-3.0.0.tgz", @@ -2286,6 +3043,12 @@ "node": ">=0.10.0" } }, + "node_modules/is-utf8": { + "version": "0.2.1", + "resolved": "https://registry.npmjs.org/is-utf8/-/is-utf8-0.2.1.tgz", + "integrity": "sha1-Sw2hRCEE0bM2NA6AeX6GXPOffXI=", + "dev": true + }, "node_modules/is-valid-identifier": { "version": "2.0.2", "resolved": "https://registry.npmjs.org/is-valid-identifier/-/is-valid-identifier-2.0.2.tgz", @@ -2295,6 +3058,12 @@ "assert": "^1.4.1" } }, + "node_modules/isarray": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/isarray/-/isarray-1.0.0.tgz", + "integrity": "sha1-u5NdSFgsuhaMBoNJV6VKPgcSTxE=", + "dev": true + }, "node_modules/isexe": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/isexe/-/isexe-2.0.0.tgz", @@ -2344,6 +3113,12 @@ "integrity": "sha1-nbe1lJatPzz+8wp1FC0tkwrXJlE=", "dev": true }, + "node_modules/json-stringify-safe": { + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/json-stringify-safe/-/json-stringify-safe-5.0.1.tgz", + "integrity": "sha1-Epai1Y/UXxmg9s4B1lcB4sc1tus=", + "dev": true + }, "node_modules/jsonfile": { "version": "6.1.0", "resolved": "https://registry.npmjs.org/jsonfile/-/jsonfile-6.1.0.tgz", @@ -2510,6 +3285,12 @@ "integrity": "sha512-v2kDEe57lecTulaDIuNTPy3Ry4gLGJ6Z1O3vE1krgXZNrsQ+LFTGHVxVjcXPs17LhbZVGedAJv8XZ1tvj5FvSg==", "dev": true }, + "node_modules/lodash.ismatch": { + "version": "4.4.0", + "resolved": "https://registry.npmjs.org/lodash.ismatch/-/lodash.ismatch-4.4.0.tgz", + "integrity": "sha1-dWy1FQyjum8RCFp4hJZF8Yj4Xzc=", + "dev": true + }, "node_modules/log-symbols": { "version": "4.0.0", "resolved": "https://registry.npmjs.org/log-symbols/-/log-symbols-4.0.0.tgz", @@ -2571,6 +3352,19 @@ "node": ">=8" } }, + "node_modules/loud-rejection": { + "version": "1.6.0", + "resolved": "https://registry.npmjs.org/loud-rejection/-/loud-rejection-1.6.0.tgz", + "integrity": "sha1-W0b4AUft7leIcPCG0Eghz5mOVR8=", + "dev": true, + "dependencies": { + "currently-unhandled": "^0.4.1", + "signal-exit": "^3.0.0" + }, + "engines": { + "node": ">=0.10.0" + } + }, "node_modules/lru-cache": { "version": "6.0.0", "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-6.0.0.tgz", @@ -2584,9 +3378,9 @@ } }, "node_modules/map-obj": { - "version": "4.2.0", - "resolved": "https://registry.npmjs.org/map-obj/-/map-obj-4.2.0.tgz", - "integrity": "sha512-NAq0fCmZYGz9UFEQyndp7sisrow4GroyGeKluyKC/chuITZsPyOyC1UJZPJlVFImhXdROIP5xqouRLThT3BbpQ==", + "version": "4.2.1", + "resolved": "https://registry.npmjs.org/map-obj/-/map-obj-4.2.1.tgz", + "integrity": "sha512-+WA2/1sPmDj1dlvvJmB5G6JKfY9dpn7EVBUL06+y6PoljPkh+6V1QihwxNkbcGxCRjt2b0F9K0taiCuo7MbdFQ==", "dev": true, "engines": { "node": ">=8" @@ -2699,6 +3493,12 @@ "node": "*" } }, + "node_modules/minimist": { + "version": "1.2.5", + "resolved": "https://registry.npmjs.org/minimist/-/minimist-1.2.5.tgz", + "integrity": "sha512-FM9nNUYrRBAELZQT3xeZQ7fmMOBg6nWNmJKTcgsJeaLstP/UODVpGsr5OhXhhXg6f+qtJ8uiZ+PUxkDWcgIXLw==", + "dev": true + }, "node_modules/minimist-options": { "version": "4.1.0", "resolved": "https://registry.npmjs.org/minimist-options/-/minimist-options-4.1.0.tgz", @@ -2713,6 +3513,15 @@ "node": ">= 6" } }, + "node_modules/modify-values": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/modify-values/-/modify-values-1.0.1.tgz", + "integrity": "sha512-xV2bxeN6F7oYjZWTe/YPAy6MN2M+sL4u/Rlm2AHCIVGfo2p1yGmBHQ6vHehl4bRTZBdHu3TSkWdYgkwpYzAGSw==", + "dev": true, + "engines": { + "node": ">=0.10.0" + } + }, "node_modules/mri": { "version": "1.1.6", "resolved": "https://registry.npmjs.org/mri/-/mri-1.1.6.tgz", @@ -2759,6 +3568,12 @@ "integrity": "sha1-Sr6/7tdUHywnrPspvbvRXI1bpPc=", "dev": true }, + "node_modules/neo-async": { + "version": "2.6.2", + "resolved": "https://registry.npmjs.org/neo-async/-/neo-async-2.6.2.tgz", + "integrity": "sha512-Yd3UES5mWCSqR+qNT93S3UoYUkqAZ9lLg8a7g9rimsWmYGK8cVToA4/sF3RrshdyV3sAGMXVUmpMYOw+dLpOuw==", + "dev": true + }, "node_modules/nice-try": { "version": "1.0.5", "resolved": "https://registry.npmjs.org/nice-try/-/nice-try-1.0.5.tgz", @@ -2766,14 +3581,14 @@ "dev": true }, "node_modules/normalize-package-data": { - "version": "3.0.1", - "resolved": "https://registry.npmjs.org/normalize-package-data/-/normalize-package-data-3.0.1.tgz", - "integrity": "sha512-D/ttLdxo71msR4FF3VgSwK4blHfE3/vGByz1NCeE7/Dh8reQOKNJJjk5L10mLq9jxa+ZHzT1/HLgxljzbXE7Fw==", + "version": "3.0.2", + "resolved": "https://registry.npmjs.org/normalize-package-data/-/normalize-package-data-3.0.2.tgz", + "integrity": "sha512-6CdZocmfGaKnIHPVFhJJZ3GuR8SsLKvDANFp47Jmy51aKIr8akjAWTSxtpI+MBgBFdSMRyo4hMpDlT6dTffgZg==", "dev": true, "dependencies": { - "hosted-git-info": "^4.0.0", - "resolve": "^1.17.0", - "semver": "^7.3.2", + "hosted-git-info": "^4.0.1", + "resolve": "^1.20.0", + "semver": "^7.3.4", "validate-npm-package-license": "^3.0.1" }, "engines": { @@ -3116,6 +3931,12 @@ "node": ">=6" } }, + "node_modules/parse-github-repo-url": { + "version": "1.4.1", + "resolved": "https://registry.npmjs.org/parse-github-repo-url/-/parse-github-repo-url-1.4.1.tgz", + "integrity": "sha1-nn2LslKmy2ukJZUGC3v23z28H1A=", + "dev": true + }, "node_modules/parse-json": { "version": "5.2.0", "resolved": "https://registry.npmjs.org/parse-json/-/parse-json-5.2.0.tgz", @@ -3209,6 +4030,27 @@ "node": ">=4" } }, + "node_modules/pinkie": { + "version": "2.0.4", + "resolved": "https://registry.npmjs.org/pinkie/-/pinkie-2.0.4.tgz", + "integrity": "sha1-clVrgM+g1IqXToDnckjoDtT3+HA=", + "dev": true, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/pinkie-promise": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/pinkie-promise/-/pinkie-promise-2.0.1.tgz", + "integrity": "sha1-ITXW36ejWMBprJsXh3YogihFD/o=", + "dev": true, + "dependencies": { + "pinkie": "^2.0.0" + }, + "engines": { + "node": ">=0.10.0" + } + }, "node_modules/pkg-dir": { "version": "5.0.0", "resolved": "https://registry.npmjs.org/pkg-dir/-/pkg-dir-5.0.0.tgz", @@ -3360,6 +4202,12 @@ "node": ">=8" } }, + "node_modules/process-nextick-args": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/process-nextick-args/-/process-nextick-args-2.0.1.tgz", + "integrity": "sha512-3ouUOpQhtgrbOa17J7+uxOTpITYWaGP7/AhoR3+A+/1e9skrzelGi/dXzEYyvbxubEF6Wn2ypscTKiKJFFn1ag==", + "dev": true + }, "node_modules/progress": { "version": "2.0.3", "resolved": "https://registry.npmjs.org/progress/-/progress-2.0.3.tgz", @@ -3399,9 +4247,9 @@ } }, "node_modules/queue-microtask": { - "version": "1.2.2", - "resolved": "https://registry.npmjs.org/queue-microtask/-/queue-microtask-1.2.2.tgz", - "integrity": "sha512-dB15eXv3p2jDlbOiNLyMabYg1/sXvppd8DP2J3EOCQ0AkuSXCW2tP7mnVouVLJKgUMY6yP0kcQDVpLCN13h4Xg==", + "version": "1.2.3", + "resolved": "https://registry.npmjs.org/queue-microtask/-/queue-microtask-1.2.3.tgz", + "integrity": "sha512-NuaNSa6flKT5JaSYQzJok04JzTL1CA6aGhv5rfLW3PgqA+M2ChpZQnAC8h8i4ZFkBS8X5RqkDBHA7r4hej3K9A==", "dev": true, "funding": [ { @@ -3472,9 +4320,9 @@ } }, "node_modules/read-pkg-up/node_modules/hosted-git-info": { - "version": "2.8.8", - "resolved": "https://registry.npmjs.org/hosted-git-info/-/hosted-git-info-2.8.8.tgz", - "integrity": "sha512-f/wzC2QaWBs7t9IYqB4T3sR1xviIViXJRJTWBlx2Gf3g0Xi5vI7Yy4koXQ1c9OYDGHN9sBy1DQ2AB8fqZBWhUg==", + "version": "2.8.9", + "resolved": "https://registry.npmjs.org/hosted-git-info/-/hosted-git-info-2.8.9.tgz", + "integrity": "sha512-mxIDAb9Lsm6DoOJ7xH+5+X4y1LU/4Hi50L9C5sIswK3JzULS4bwk1FvjdBgvYR4bzT4tuUQiC15FE2f5HbLvYw==", "dev": true }, "node_modules/read-pkg-up/node_modules/locate-path": { @@ -3623,6 +4471,18 @@ "node": ">= 6" } }, + "node_modules/rechoir": { + "version": "0.6.2", + "resolved": "https://registry.npmjs.org/rechoir/-/rechoir-0.6.2.tgz", + "integrity": "sha1-hSBLVNuoLVdC4oyWdW70OvUOM4Q=", + "dev": true, + "dependencies": { + "resolve": "^1.1.6" + }, + "engines": { + "node": ">= 0.10" + } + }, "node_modules/redent": { "version": "3.0.0", "resolved": "https://registry.npmjs.org/redent/-/redent-3.0.0.tgz", @@ -3648,6 +4508,18 @@ "url": "https://github.com/sponsors/mysticatea" } }, + "node_modules/repeating": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/repeating/-/repeating-2.0.1.tgz", + "integrity": "sha1-UhTFOpJtNVJwdSf7q0FdvAjQbdo=", + "dev": true, + "dependencies": { + "is-finite": "^1.0.0" + }, + "engines": { + "node": ">=0.10.0" + } + }, "node_modules/require-directory": { "version": "2.1.1", "resolved": "https://registry.npmjs.org/require-directory/-/require-directory-2.1.1.tgz", @@ -3794,9 +4666,9 @@ ] }, "node_modules/semver": { - "version": "7.3.4", - "resolved": "https://registry.npmjs.org/semver/-/semver-7.3.4.tgz", - "integrity": "sha512-tCfb2WLjqFAtXn4KEdxIhalnRtoKFN7nAwj0B3ZXCbQloV2tq5eDbcTmT68JJD3nRJq24/XgxtQKFIpQdtvmVw==", + "version": "7.3.5", + "resolved": "https://registry.npmjs.org/semver/-/semver-7.3.5.tgz", + "integrity": "sha512-PoeGJYh8HK4BTO/a9Tf6ZG3veo/A7ZVsYrSA6J8ny9nb3B1VrpkuN+z9OE5wfE5p6H4LchYZsegiQgbJD94ZFQ==", "dev": true, "dependencies": { "lru-cache": "^6.0.0" @@ -3853,6 +4725,23 @@ "integrity": "sha512-mRz/m/JVscCrkMyPqHc/bczi3OQHkLTqXHEFu0zDhK/qfv3UcOA4SVmRCLmos4bhjr9ekVQubj/R7waKapmiQg==", "dev": true }, + "node_modules/shelljs": { + "version": "0.8.4", + "resolved": "https://registry.npmjs.org/shelljs/-/shelljs-0.8.4.tgz", + "integrity": "sha512-7gk3UZ9kOfPLIAbslLzyWeGiEqx9e3rxwZM0KE6EL8GlGwjym9Mrlx5/p33bWTu9YG6vcS4MBxYZDHYr5lr8BQ==", + "dev": true, + "dependencies": { + "glob": "^7.0.0", + "interpret": "^1.0.0", + "rechoir": "^0.6.2" + }, + "bin": { + "shjs": "bin/shjs" + }, + "engines": { + "node": ">=4" + } + }, "node_modules/signal-exit": { "version": "3.0.3", "resolved": "https://registry.npmjs.org/signal-exit/-/signal-exit-3.0.3.tgz", @@ -3882,6 +4771,15 @@ "node": ">=8" } }, + "node_modules/source-map": { + "version": "0.6.1", + "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.6.1.tgz", + "integrity": "sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g==", + "dev": true, + "engines": { + "node": ">=0.10.0" + } + }, "node_modules/spdx-correct": { "version": "3.1.1", "resolved": "https://registry.npmjs.org/spdx-correct/-/spdx-correct-3.1.1.tgz", @@ -3914,6 +4812,18 @@ "integrity": "sha512-U+MTEOO0AiDzxwFvoa4JVnMV6mZlJKk2sBLt90s7G0Gd0Mlknc7kxEn3nuDPNZRta7O2uy8oLcZLVT+4sqNZHQ==", "dev": true }, + "node_modules/split": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/split/-/split-1.0.1.tgz", + "integrity": "sha512-mTyOoPbrivtXnwnIxZRFYRrPNtEFKlpB2fvjSnCQUiAA6qAZzqwna5envK4uk6OIeP17CsdF3rSBGYVBsU0Tkg==", + "dev": true, + "dependencies": { + "through": "2" + }, + "engines": { + "node": "*" + } + }, "node_modules/split2": { "version": "3.2.2", "resolved": "https://registry.npmjs.org/split2/-/split2-3.2.2.tgz", @@ -4147,6 +5057,28 @@ "url": "https://github.com/chalk/slice-ansi?sponsor=1" } }, + "node_modules/temp-dir": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/temp-dir/-/temp-dir-2.0.0.tgz", + "integrity": "sha512-aoBAniQmmwtcKp/7BzsH8Cxzv8OL736p7v1ihGb5e9DJ9kTwGWHrQrVB5+lfVDzfGrdRzXch+ig7LHaY1JTOrg==", + "dev": true, + "engines": { + "node": ">=8" + } + }, + "node_modules/tempfile": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/tempfile/-/tempfile-3.0.0.tgz", + "integrity": "sha512-uNFCg478XovRi85iD42egu+eSFUmmka750Jy7L5tfHI5hQKKtbPnxaSaXAbBqCDYrw3wx4tXjKwci4/QmsZJxw==", + "dev": true, + "dependencies": { + "temp-dir": "^2.0.0", + "uuid": "^3.3.2" + }, + "engines": { + "node": ">=8" + } + }, "node_modules/text-extensions": { "version": "1.9.0", "resolved": "https://registry.npmjs.org/text-extensions/-/text-extensions-1.9.0.tgz", @@ -4253,9 +5185,9 @@ } }, "node_modules/typescript": { - "version": "4.2.3", - "resolved": "https://registry.npmjs.org/typescript/-/typescript-4.2.3.tgz", - "integrity": "sha512-qOcYwxaByStAWrBf4x0fibwZvMRG+r4cQoTjbPtUlrWjBHbmCAww1i448U0GJ+3cNNEtebDteo/cHOR3xJ4wEw==", + "version": "4.2.4", + "resolved": "https://registry.npmjs.org/typescript/-/typescript-4.2.4.tgz", + "integrity": "sha512-V+evlYHZnQkaz8TRBuxTA92yZBPotr5H+WhQ7bD3hZUndx5tGOa1fuCgeSjxAzM1RiN5IzvadIXTVefuuwZCRg==", "dev": true, "bin": { "tsc": "bin/tsc", @@ -4265,6 +5197,19 @@ "node": ">=4.2.0" } }, + "node_modules/uglify-js": { + "version": "3.13.3", + "resolved": "https://registry.npmjs.org/uglify-js/-/uglify-js-3.13.3.tgz", + "integrity": "sha512-otIc7O9LyxpUcQoXzj2hL4LPWKklO6LJWoJUzNa8A17Xgi4fOeDC8FBDOLHnC/Slo1CQgsZMcM6as0M76BZaig==", + "dev": true, + "optional": true, + "bin": { + "uglifyjs": "bin/uglifyjs" + }, + "engines": { + "node": ">=0.8.0" + } + }, "node_modules/unbox-primitive": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/unbox-primitive/-/unbox-primitive-1.0.0.tgz", @@ -4316,6 +5261,15 @@ "integrity": "sha1-sX0I0ya0Qj5Wjv9xn5GwscvfafE=", "dev": true }, + "node_modules/uuid": { + "version": "3.4.0", + "resolved": "https://registry.npmjs.org/uuid/-/uuid-3.4.0.tgz", + "integrity": "sha512-HjSDRw6gZE5JMggctHBcjVak08+KEVhSIiDzFnT9S9aegmp85S/bReBVTb4QTFaRNptJ9kuYaNhnbNEOkbKb/A==", + "dev": true, + "bin": { + "uuid": "bin/uuid" + } + }, "node_modules/v8-compile-cache": { "version": "2.3.0", "resolved": "https://registry.npmjs.org/v8-compile-cache/-/v8-compile-cache-2.3.0.tgz", @@ -4378,6 +5332,12 @@ "node": ">=0.10.0" } }, + "node_modules/wordwrap": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/wordwrap/-/wordwrap-1.0.0.tgz", + "integrity": "sha1-J1hIEIkUVqQXHI0CJkQa3pDLyus=", + "dev": true + }, "node_modules/wrap-ansi": { "version": "7.0.0", "resolved": "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-7.0.0.tgz", @@ -4401,6 +5361,15 @@ "integrity": "sha1-tSQ9jz7BqjXxNkYFvA0QNuMKtp8=", "dev": true }, + "node_modules/xtend": { + "version": "4.0.2", + "resolved": "https://registry.npmjs.org/xtend/-/xtend-4.0.2.tgz", + "integrity": "sha512-LKYU1iAXJXUgAXn9URjiu+MWhyUXHsvfp7mcuYm9dSUKK0/CjtrUwFAxD82/mCWbtLsGjFIad0wIsod4zrTAEQ==", + "dev": true, + "engines": { + "node": ">=0.4" + } + }, "node_modules/y18n": { "version": "5.0.5", "resolved": "https://registry.npmjs.org/y18n/-/y18n-5.0.5.tgz", @@ -4545,16 +5514,16 @@ } }, "@commitlint/cli": { - "version": "12.0.1", - "resolved": "https://registry.npmjs.org/@commitlint/cli/-/cli-12.0.1.tgz", - "integrity": "sha512-V+cMYNHJOr40XT9Kvz3Vrz1Eh7QE1rjQrUbifawDAqcOrBJFuoXwU2SAcRtYFCSqFy9EhbreQGhZFs8dYb90KA==", + "version": "12.1.1", + "resolved": "https://registry.npmjs.org/@commitlint/cli/-/cli-12.1.1.tgz", + "integrity": "sha512-SB67/s6VJ50seoPx/Sr2gj1fMzKrx+udgarecGdr8h43ah+M2e22gjQJ7xHv5KwyPQ+6ug1YOMCL34ubT4zupQ==", "dev": true, "requires": { - "@commitlint/format": "^12.0.1", - "@commitlint/lint": "^12.0.1", - "@commitlint/load": "^12.0.1", - "@commitlint/read": "^12.0.1", - "@commitlint/types": "^12.0.1", + "@commitlint/format": "^12.1.1", + "@commitlint/lint": "^12.1.1", + "@commitlint/load": "^12.1.1", + "@commitlint/read": "^12.1.1", + "@commitlint/types": "^12.1.1", "get-stdin": "8.0.0", "lodash": "^4.17.19", "resolve-from": "5.0.0", @@ -4563,77 +5532,77 @@ } }, "@commitlint/config-angular": { - "version": "12.0.1", - "resolved": "https://registry.npmjs.org/@commitlint/config-angular/-/config-angular-12.0.1.tgz", - "integrity": "sha512-LuhglC8lh+5zdl+hjNunhH1b4Uj70w/TbdWna6CTvpuR59WSZSFZhIxutN2Fjuf1jlHGkx2bC9ZiOQW01YQNTA==", + "version": "12.1.1", + "resolved": "https://registry.npmjs.org/@commitlint/config-angular/-/config-angular-12.1.1.tgz", + "integrity": "sha512-aOWhOXjqWhQ91LQPLNf+mupQdcF7P/5DSAz4jDURlR44O94kl80FzX0ygykhQk+xeKosVuApfSYiE1kGzTeSsw==", "dev": true, "requires": { - "@commitlint/config-angular-type-enum": "^12.0.1" + "@commitlint/config-angular-type-enum": "^12.1.1" } }, "@commitlint/config-angular-type-enum": { - "version": "12.0.1", - "resolved": "https://registry.npmjs.org/@commitlint/config-angular-type-enum/-/config-angular-type-enum-12.0.1.tgz", - "integrity": "sha512-0qETLi7f7BineQruIBjyzHFfvDfh9FTEbMs+oTAfl+cDKTLJYI5W6eKGjI3MPg5+8sxUtzh6pJ+Dp3LFOpawTQ==", + "version": "12.1.1", + "resolved": "https://registry.npmjs.org/@commitlint/config-angular-type-enum/-/config-angular-type-enum-12.1.1.tgz", + "integrity": "sha512-cOIRod65IOmjUyLTapGoqTKl8RtQnWZTGU+rNoTqx3dqd5LmTM+/w9CUehuflBbo9NWKa36iV6SJcbeMfvYH9A==", "dev": true }, "@commitlint/ensure": { - "version": "12.0.1", - "resolved": "https://registry.npmjs.org/@commitlint/ensure/-/ensure-12.0.1.tgz", - "integrity": "sha512-XdBq+q1YBBDxWIAEjE3Y1YMbzhUnUuSLAEWD8SU1xsvEpQXWRYwDlMBRkjO7funNWTdL0ZQSkZDzme70imYjbw==", + "version": "12.1.1", + "resolved": "https://registry.npmjs.org/@commitlint/ensure/-/ensure-12.1.1.tgz", + "integrity": "sha512-XEUQvUjzBVQM7Uv8vYz+c7PDukFvx0AvQEyX/V+PaTkCK/xPvexu7FLbFwvypjSt9BPMf+T/rhB1hVmldkd6lw==", "dev": true, "requires": { - "@commitlint/types": "^12.0.1", + "@commitlint/types": "^12.1.1", "lodash": "^4.17.19" } }, "@commitlint/execute-rule": { - "version": "12.0.1", - "resolved": "https://registry.npmjs.org/@commitlint/execute-rule/-/execute-rule-12.0.1.tgz", - "integrity": "sha512-JzyweYfZlFLtXpgP+btzSY3YAkGPg61TqUSYQqBr4+5IaVf1FruMm5v4D5eLu9dAJuNKUfHbM3AEfuEPiZ79pg==", + "version": "12.1.1", + "resolved": "https://registry.npmjs.org/@commitlint/execute-rule/-/execute-rule-12.1.1.tgz", + "integrity": "sha512-6mplMGvLCKF5LieL7BRhydpg32tm6LICnWQADrWU4S5g9PKi2utNvhiaiuNPoHUXr29RdbNaGNcyyPv8DSjJsQ==", "dev": true }, "@commitlint/format": { - "version": "12.0.1", - "resolved": "https://registry.npmjs.org/@commitlint/format/-/format-12.0.1.tgz", - "integrity": "sha512-rF79ipAxR8yFzPzG5tRoEZ//MRkyxCXj4JhpEjtdaCMBAXMssI8uazn3e5D8z4UFgSDe9qOnL0OmQvql7HTMoA==", + "version": "12.1.1", + "resolved": "https://registry.npmjs.org/@commitlint/format/-/format-12.1.1.tgz", + "integrity": "sha512-bTAoOryTFLqls17JTaRwk2WDVOP0NwuG4F/JPK8RaF6DMZNVQTfajkgTxFENNZRnESfau1BvivvEXfUAW2ZsvA==", "dev": true, "requires": { - "@commitlint/types": "^12.0.1", + "@commitlint/types": "^12.1.1", "chalk": "^4.0.0" } }, "@commitlint/is-ignored": { - "version": "12.0.1", - "resolved": "https://registry.npmjs.org/@commitlint/is-ignored/-/is-ignored-12.0.1.tgz", - "integrity": "sha512-AplfLn5mX/kWTIiSolcOhTYcgphuGLX8FUr+HmyHBEqUkO36jt0z9caysH47fqU71ePtH63v1DWm+RYQ5RPDjg==", + "version": "12.1.1", + "resolved": "https://registry.npmjs.org/@commitlint/is-ignored/-/is-ignored-12.1.1.tgz", + "integrity": "sha512-Sn4fsnWX+wLAJOD/UZeoVruB98te1TyPYRiDEq0MhRJAQIrP+7jE/O3/ass68AAMq00HvH3OK9kt4UBXggcGjA==", "dev": true, "requires": { - "@commitlint/types": "^12.0.1", - "semver": "7.3.4" + "@commitlint/types": "^12.1.1", + "semver": "7.3.5" } }, "@commitlint/lint": { - "version": "12.0.1", - "resolved": "https://registry.npmjs.org/@commitlint/lint/-/lint-12.0.1.tgz", - "integrity": "sha512-1lKyRCq4ahJrY+Xxo8LsqCbALeJkodtEfpmYHeA5HpPMnK7lRSplLqOLcTCjoPfd4vO+gl6aDEZN+ow3YGQBOg==", + "version": "12.1.1", + "resolved": "https://registry.npmjs.org/@commitlint/lint/-/lint-12.1.1.tgz", + "integrity": "sha512-FFFPpku/E0svL1jaUVqosuZJDDWiNWYBlUw5ZEljh3MwWRcoaWtMIX5bseX+IvHpFZsCTAiBs1kCgNulCi0UvA==", "dev": true, "requires": { - "@commitlint/is-ignored": "^12.0.1", - "@commitlint/parse": "^12.0.1", - "@commitlint/rules": "^12.0.1", - "@commitlint/types": "^12.0.1" + "@commitlint/is-ignored": "^12.1.1", + "@commitlint/parse": "^12.1.1", + "@commitlint/rules": "^12.1.1", + "@commitlint/types": "^12.1.1" } }, "@commitlint/load": { - "version": "12.0.1", - "resolved": "https://registry.npmjs.org/@commitlint/load/-/load-12.0.1.tgz", - "integrity": "sha512-dX8KdCWn7w0bTkkk3zKQpe9X8vsTRa5EM+1ffF313wCX9b6tGa9vujhEHCkSzKAbbE2tFV64CHZygE7rtlHdIA==", + "version": "12.1.1", + "resolved": "https://registry.npmjs.org/@commitlint/load/-/load-12.1.1.tgz", + "integrity": "sha512-qOQtgNdJRULUQWP9jkpTwhj7aEtnqUtqeUpbQ9rjS+GIUST65HZbteNUX4S0mAEGPWqy2aK5xGd73cUfFSvuuw==", "dev": true, "requires": { - "@commitlint/execute-rule": "^12.0.1", - "@commitlint/resolve-extends": "^12.0.1", - "@commitlint/types": "^12.0.1", + "@commitlint/execute-rule": "^12.1.1", + "@commitlint/resolve-extends": "^12.1.1", + "@commitlint/types": "^12.1.1", "chalk": "^4.0.0", "cosmiconfig": "^7.0.0", "lodash": "^4.17.19", @@ -4641,38 +5610,38 @@ } }, "@commitlint/message": { - "version": "12.0.1", - "resolved": "https://registry.npmjs.org/@commitlint/message/-/message-12.0.1.tgz", - "integrity": "sha512-fXuoxRC+NT1wEQi6p8oHfT7wvWIRgTk+udlRJnWTjmMpiYzVnMmmZfasdShirWr4TtxQtMyL+5DVgh7Y98kURw==", + "version": "12.1.1", + "resolved": "https://registry.npmjs.org/@commitlint/message/-/message-12.1.1.tgz", + "integrity": "sha512-RakDSLAiOligXjhbLahV8HowF4K75pZIcs0+Ii9Q8Gz5H3DWf1Ngit7alFTWfcbf/+DTjSzVPov5HiwQZPIBUg==", "dev": true }, "@commitlint/parse": { - "version": "12.0.1", - "resolved": "https://registry.npmjs.org/@commitlint/parse/-/parse-12.0.1.tgz", - "integrity": "sha512-7oEGASmzBnHir5jSIR7KephXrKh7rIi9a6RpH1tOT+CIENYvhe8EDtIy29qMt+RLa2LlaPF7YrAgaJRfzG0YDQ==", + "version": "12.1.1", + "resolved": "https://registry.npmjs.org/@commitlint/parse/-/parse-12.1.1.tgz", + "integrity": "sha512-nuljIvAbBDr93DgL0wCArftEIhjSghawAwhvrKNV9FFcqAJqfVqitwMxJrNDCQ5pgUMCSKULLOEv+dA0bLlTEQ==", "dev": true, "requires": { - "@commitlint/types": "^12.0.1", + "@commitlint/types": "^12.1.1", "conventional-changelog-angular": "^5.0.11", "conventional-commits-parser": "^3.0.0" } }, "@commitlint/read": { - "version": "12.0.1", - "resolved": "https://registry.npmjs.org/@commitlint/read/-/read-12.0.1.tgz", - "integrity": "sha512-baa0YeD4QOctEuthLpExQSi9xPiw0kDPfUVHqp8I88iuIXJECeS8S1+1GBiz89e8dLN9zmEE+sN9vtJHdAp9YA==", + "version": "12.1.1", + "resolved": "https://registry.npmjs.org/@commitlint/read/-/read-12.1.1.tgz", + "integrity": "sha512-1k0CQEoZIdixvmqZRKEcWdj2XiKS7SlizEOJ1SE99Qui5d5FlBey8eaooTGgmpR6zObpIHJehtEPzM3VzUT3qA==", "dev": true, "requires": { - "@commitlint/top-level": "^12.0.1", - "@commitlint/types": "^12.0.1", + "@commitlint/top-level": "^12.1.1", + "@commitlint/types": "^12.1.1", "fs-extra": "^9.0.0", "git-raw-commits": "^2.0.0" } }, "@commitlint/resolve-extends": { - "version": "12.0.1", - "resolved": "https://registry.npmjs.org/@commitlint/resolve-extends/-/resolve-extends-12.0.1.tgz", - "integrity": "sha512-Mvg0GDi/68Cqw893ha8uhxE8myHfPmiSSSi7d1x4VJNR4hoS37lBdX89kyx4i9NPmLfviY2cUJKTyK8ZrFznZw==", + "version": "12.1.1", + "resolved": "https://registry.npmjs.org/@commitlint/resolve-extends/-/resolve-extends-12.1.1.tgz", + "integrity": "sha512-/DXRt0S0U3o9lq5cc8OL1Lkx0IjW0HcDWjUkUXshAajBIKBYSJB8x/loNCi1krNEJ8SwLXUEFt5OLxNO6wE9yQ==", "dev": true, "requires": { "import-fresh": "^3.0.0", @@ -4682,36 +5651,36 @@ } }, "@commitlint/rules": { - "version": "12.0.1", - "resolved": "https://registry.npmjs.org/@commitlint/rules/-/rules-12.0.1.tgz", - "integrity": "sha512-A5O0ubNGugZR9WWxk5IVOLo07lpdUwhG5WkAW2lYpgZ7Z/2U4PLob9b4Ih1eHbQu+gnVeFr91k7F0DrpM7B8EQ==", + "version": "12.1.1", + "resolved": "https://registry.npmjs.org/@commitlint/rules/-/rules-12.1.1.tgz", + "integrity": "sha512-oCcLF/ykcJfhM2DeeaDyrgdaiuKsqIPNocugdPj2WEyhSYqmx1/u18CV96LAtW+WyyiOLCCeiZwiQutx3T5nXg==", "dev": true, "requires": { - "@commitlint/ensure": "^12.0.1", - "@commitlint/message": "^12.0.1", - "@commitlint/to-lines": "^12.0.1", - "@commitlint/types": "^12.0.1" + "@commitlint/ensure": "^12.1.1", + "@commitlint/message": "^12.1.1", + "@commitlint/to-lines": "^12.1.1", + "@commitlint/types": "^12.1.1" } }, "@commitlint/to-lines": { - "version": "12.0.1", - "resolved": "https://registry.npmjs.org/@commitlint/to-lines/-/to-lines-12.0.1.tgz", - "integrity": "sha512-XwcJ1jY7x2fhudzbGMpNQkTSMVrxWrI8bRMbVe3Abuu7RfYpFf7VXAlhtnLfxBoagaK7RxjC2+eRidp/3txQBg==", + "version": "12.1.1", + "resolved": "https://registry.npmjs.org/@commitlint/to-lines/-/to-lines-12.1.1.tgz", + "integrity": "sha512-W23AH2XF5rI27MOAPSSr0TUDoRe7ZbFoRtYhFnPu2MBmcuDA9Tmfd9N5sM2tBXtdE26uq3SazwKqGt1OoGAilQ==", "dev": true }, "@commitlint/top-level": { - "version": "12.0.1", - "resolved": "https://registry.npmjs.org/@commitlint/top-level/-/top-level-12.0.1.tgz", - "integrity": "sha512-rHdgt7U24GEau2/9i2vEAbksxkBRiVjHj5ECFL5dd0AJOIvaK++vMg4EF/ME0X/1yd9qVTHTNOl2Q4tTFK7VBQ==", + "version": "12.1.1", + "resolved": "https://registry.npmjs.org/@commitlint/top-level/-/top-level-12.1.1.tgz", + "integrity": "sha512-g7uRbr81QEIg+pbii0OkE17Zh/2C/f6dSmiMDVRn1S0+hNHR1bENCh18hVUKcV/qKTUsKkFlhhWXM9mQBfxQJw==", "dev": true, "requires": { "find-up": "^5.0.0" } }, "@commitlint/types": { - "version": "12.0.1", - "resolved": "https://registry.npmjs.org/@commitlint/types/-/types-12.0.1.tgz", - "integrity": "sha512-FsNDMV0W7D19/ZbR412klpqAilXASx75Neqh7jPtK278IEwdukOg3vth1r5kTm+BjDScM7wMUEOwIW3NNfAtwg==", + "version": "12.1.1", + "resolved": "https://registry.npmjs.org/@commitlint/types/-/types-12.1.1.tgz", + "integrity": "sha512-+qGH+s2Lo6qwacV2X3/ZypZwaAI84ift+1HBjXdXtI/q0F5NtmXucV3lcQOTviMTNiJhq4qWON2fjci2NItASw==", "dev": true, "requires": { "chalk": "^4.0.0" @@ -4795,6 +5764,12 @@ "integrity": "sha512-fZQQafSREFyuZcdWFAExYjBiCL7AUCdgsk80iO0q4yihYYdcIiH28CcuPTGFgLOCC8RlW49GSQxdHwZP+I7CNg==", "dev": true }, + "@types/node": { + "version": "14.14.37", + "resolved": "https://registry.npmjs.org/@types/node/-/node-14.14.37.tgz", + "integrity": "sha512-XYmBiy+ohOR4Lh5jE379fV2IU+6Jn4g5qASinhitfyO71b/sCo6MKsMLF5tc7Zf2CE8hViVQyYSobJNke8OvUw==", + "dev": true + }, "@types/normalize-package-data": { "version": "2.4.0", "resolved": "https://registry.npmjs.org/@types/normalize-package-data/-/normalize-package-data-2.4.0.tgz", @@ -4808,13 +5783,13 @@ "dev": true }, "@typescript-eslint/eslint-plugin": { - "version": "4.18.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/eslint-plugin/-/eslint-plugin-4.18.0.tgz", - "integrity": "sha512-Lzkc/2+7EoH7+NjIWLS2lVuKKqbEmJhtXe3rmfA8cyiKnZm3IfLf51irnBcmow8Q/AptVV0XBZmBJKuUJTe6cQ==", + "version": "4.21.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/eslint-plugin/-/eslint-plugin-4.21.0.tgz", + "integrity": "sha512-FPUyCPKZbVGexmbCFI3EQHzCZdy2/5f+jv6k2EDljGdXSRc0cKvbndd2nHZkSLqCNOPk0jB6lGzwIkglXcYVsQ==", "dev": true, "requires": { - "@typescript-eslint/experimental-utils": "4.18.0", - "@typescript-eslint/scope-manager": "4.18.0", + "@typescript-eslint/experimental-utils": "4.21.0", + "@typescript-eslint/scope-manager": "4.21.0", "debug": "^4.1.1", "functional-red-black-tree": "^1.0.1", "lodash": "^4.17.15", @@ -4824,55 +5799,55 @@ } }, "@typescript-eslint/experimental-utils": { - "version": "4.18.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/experimental-utils/-/experimental-utils-4.18.0.tgz", - "integrity": "sha512-92h723Kblt9JcT2RRY3QS2xefFKar4ZQFVs3GityOKWQYgtajxt/tuXIzL7sVCUlM1hgreiV5gkGYyBpdOwO6A==", + "version": "4.21.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/experimental-utils/-/experimental-utils-4.21.0.tgz", + "integrity": "sha512-cEbgosW/tUFvKmkg3cU7LBoZhvUs+ZPVM9alb25XvR0dal4qHL3SiUqHNrzoWSxaXA9gsifrYrS1xdDV6w/gIA==", "dev": true, "requires": { "@types/json-schema": "^7.0.3", - "@typescript-eslint/scope-manager": "4.18.0", - "@typescript-eslint/types": "4.18.0", - "@typescript-eslint/typescript-estree": "4.18.0", + "@typescript-eslint/scope-manager": "4.21.0", + "@typescript-eslint/types": "4.21.0", + "@typescript-eslint/typescript-estree": "4.21.0", "eslint-scope": "^5.0.0", "eslint-utils": "^2.0.0" } }, "@typescript-eslint/parser": { - "version": "4.18.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/parser/-/parser-4.18.0.tgz", - "integrity": "sha512-W3z5S0ZbecwX3PhJEAnq4mnjK5JJXvXUDBYIYGoweCyWyuvAKfGHvzmpUzgB5L4cRBb+cTu9U/ro66dx7dIimA==", + "version": "4.21.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/parser/-/parser-4.21.0.tgz", + "integrity": "sha512-eyNf7QmE5O/l1smaQgN0Lj2M/1jOuNg2NrBm1dqqQN0sVngTLyw8tdCbih96ixlhbF1oINoN8fDCyEH9SjLeIA==", "dev": true, "requires": { - "@typescript-eslint/scope-manager": "4.18.0", - "@typescript-eslint/types": "4.18.0", - "@typescript-eslint/typescript-estree": "4.18.0", + "@typescript-eslint/scope-manager": "4.21.0", + "@typescript-eslint/types": "4.21.0", + "@typescript-eslint/typescript-estree": "4.21.0", "debug": "^4.1.1" } }, "@typescript-eslint/scope-manager": { - "version": "4.18.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/scope-manager/-/scope-manager-4.18.0.tgz", - "integrity": "sha512-olX4yN6rvHR2eyFOcb6E4vmhDPsfdMyfQ3qR+oQNkAv8emKKlfxTWUXU5Mqxs2Fwe3Pf1BoPvrwZtwngxDzYzQ==", + "version": "4.21.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/scope-manager/-/scope-manager-4.21.0.tgz", + "integrity": "sha512-kfOjF0w1Ix7+a5T1knOw00f7uAP9Gx44+OEsNQi0PvvTPLYeXJlsCJ4tYnDj5PQEYfpcgOH5yBlw7K+UEI9Agw==", "dev": true, "requires": { - "@typescript-eslint/types": "4.18.0", - "@typescript-eslint/visitor-keys": "4.18.0" + "@typescript-eslint/types": "4.21.0", + "@typescript-eslint/visitor-keys": "4.21.0" } }, "@typescript-eslint/types": { - "version": "4.18.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/types/-/types-4.18.0.tgz", - "integrity": "sha512-/BRociARpj5E+9yQ7cwCF/SNOWwXJ3qhjurMuK2hIFUbr9vTuDeu476Zpu+ptxY2kSxUHDGLLKy+qGq2sOg37A==", + "version": "4.21.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/types/-/types-4.21.0.tgz", + "integrity": "sha512-+OQaupjGVVc8iXbt6M1oZMwyKQNehAfLYJJ3SdvnofK2qcjfor9pEM62rVjBknhowTkh+2HF+/KdRAc/wGBN2w==", "dev": true }, "@typescript-eslint/typescript-estree": { - "version": "4.18.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/typescript-estree/-/typescript-estree-4.18.0.tgz", - "integrity": "sha512-wt4xvF6vvJI7epz+rEqxmoNQ4ZADArGQO9gDU+cM0U5fdVv7N+IAuVoVAoZSOZxzGHBfvE3XQMLdy+scsqFfeg==", + "version": "4.21.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/typescript-estree/-/typescript-estree-4.21.0.tgz", + "integrity": "sha512-ZD3M7yLaVGVYLw4nkkoGKumb7Rog7QID9YOWobFDMQKNl+vPxqVIW/uDk+MDeGc+OHcoG2nJ2HphwiPNajKw3w==", "dev": true, "requires": { - "@typescript-eslint/types": "4.18.0", - "@typescript-eslint/visitor-keys": "4.18.0", + "@typescript-eslint/types": "4.21.0", + "@typescript-eslint/visitor-keys": "4.21.0", "debug": "^4.1.1", "globby": "^11.0.1", "is-glob": "^4.0.1", @@ -4881,12 +5856,12 @@ } }, "@typescript-eslint/visitor-keys": { - "version": "4.18.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/visitor-keys/-/visitor-keys-4.18.0.tgz", - "integrity": "sha512-Q9t90JCvfYaN0OfFUgaLqByOfz8yPeTAdotn/XYNm5q9eHax90gzdb+RJ6E9T5s97Kv/UHWKERTmqA0jTKAEHw==", + "version": "4.21.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/visitor-keys/-/visitor-keys-4.21.0.tgz", + "integrity": "sha512-dH22dROWGi5Z6p+Igc8bLVLmwy7vEe8r+8c+raPQU0LxgogPUrRAtRGtvBWmlr9waTu3n+QLt/qrS/hWzk1x5w==", "dev": true, "requires": { - "@typescript-eslint/types": "4.18.0", + "@typescript-eslint/types": "4.21.0", "eslint-visitor-keys": "^2.0.0" } }, @@ -4902,6 +5877,12 @@ "integrity": "sha512-K0Ptm/47OKfQRpNQ2J/oIN/3QYiK6FwW+eJbILhsdxh2WTLdl+30o8aGdTbm5JbffpFFAg/g+zi1E+jvJha5ng==", "dev": true }, + "add-stream": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/add-stream/-/add-stream-1.0.0.tgz", + "integrity": "sha1-anmQQ3ynNtXhKI25K9MmbV9csqo=", + "dev": true + }, "aggregate-error": { "version": "3.1.0", "resolved": "https://registry.npmjs.org/aggregate-error/-/aggregate-error-3.1.0.tgz", @@ -4977,6 +5958,12 @@ "integrity": "sha512-THtfYS6KtME/yIAhKjZ2ul7XI96lQGHRputJQHO80LAWQnuGP4iCIN8vdMRboGbIEYBwU33q8Tch1os2+X0kMg==", "dev": true }, + "array-find-index": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/array-find-index/-/array-find-index-1.0.2.tgz", + "integrity": "sha1-3wEKoSh+Fku9pvlyOwqWoexBh6E=", + "dev": true + }, "array-ify": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/array-ify/-/array-ify-1.0.0.tgz", @@ -5170,6 +6157,25 @@ "integrity": "sha1-2Klr13/Wjfd5OnMDajug1UBdR3s=", "dev": true }, + "conventional-changelog": { + "version": "3.1.24", + "resolved": "https://registry.npmjs.org/conventional-changelog/-/conventional-changelog-3.1.24.tgz", + "integrity": "sha512-ed6k8PO00UVvhExYohroVPXcOJ/K1N0/drJHx/faTH37OIZthlecuLIRX/T6uOp682CAoVoFpu+sSEaeuH6Asg==", + "dev": true, + "requires": { + "conventional-changelog-angular": "^5.0.12", + "conventional-changelog-atom": "^2.0.8", + "conventional-changelog-codemirror": "^2.0.8", + "conventional-changelog-conventionalcommits": "^4.5.0", + "conventional-changelog-core": "^4.2.1", + "conventional-changelog-ember": "^2.0.9", + "conventional-changelog-eslint": "^3.0.9", + "conventional-changelog-express": "^2.0.6", + "conventional-changelog-jquery": "^3.0.11", + "conventional-changelog-jshint": "^2.0.9", + "conventional-changelog-preset-loader": "^2.3.4" + } + }, "conventional-changelog-angular": { "version": "5.0.12", "resolved": "https://registry.npmjs.org/conventional-changelog-angular/-/conventional-changelog-angular-5.0.12.tgz", @@ -5180,6 +6186,220 @@ "q": "^1.5.1" } }, + "conventional-changelog-atom": { + "version": "2.0.8", + "resolved": "https://registry.npmjs.org/conventional-changelog-atom/-/conventional-changelog-atom-2.0.8.tgz", + "integrity": "sha512-xo6v46icsFTK3bb7dY/8m2qvc8sZemRgdqLb/bjpBsH2UyOS8rKNTgcb5025Hri6IpANPApbXMg15QLb1LJpBw==", + "dev": true, + "requires": { + "q": "^1.5.1" + } + }, + "conventional-changelog-cli": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/conventional-changelog-cli/-/conventional-changelog-cli-2.1.1.tgz", + "integrity": "sha512-xMGQdKJ+4XFDDgfX5aK7UNFduvJMbvF5BB+g0OdVhA3rYdYyhctrIE2Al+WYdZeKTdg9YzMWF2iFPT8MupIwng==", + "dev": true, + "requires": { + "add-stream": "^1.0.0", + "conventional-changelog": "^3.1.24", + "lodash": "^4.17.15", + "meow": "^8.0.0", + "tempfile": "^3.0.0" + } + }, + "conventional-changelog-codemirror": { + "version": "2.0.8", + "resolved": "https://registry.npmjs.org/conventional-changelog-codemirror/-/conventional-changelog-codemirror-2.0.8.tgz", + "integrity": "sha512-z5DAsn3uj1Vfp7po3gpt2Boc+Bdwmw2++ZHa5Ak9k0UKsYAO5mH1UBTN0qSCuJZREIhX6WU4E1p3IW2oRCNzQw==", + "dev": true, + "requires": { + "q": "^1.5.1" + } + }, + "conventional-changelog-conventionalcommits": { + "version": "4.5.0", + "resolved": "https://registry.npmjs.org/conventional-changelog-conventionalcommits/-/conventional-changelog-conventionalcommits-4.5.0.tgz", + "integrity": "sha512-buge9xDvjjOxJlyxUnar/+6i/aVEVGA7EEh4OafBCXPlLUQPGbRUBhBUveWRxzvR8TEjhKEP4BdepnpG2FSZXw==", + "dev": true, + "requires": { + "compare-func": "^2.0.0", + "lodash": "^4.17.15", + "q": "^1.5.1" + } + }, + "conventional-changelog-core": { + "version": "4.2.2", + "resolved": "https://registry.npmjs.org/conventional-changelog-core/-/conventional-changelog-core-4.2.2.tgz", + "integrity": "sha512-7pDpRUiobQDNkwHyJG7k9f6maPo9tfPzkSWbRq97GGiZqisElhnvUZSvyQH20ogfOjntB5aadvv6NNcKL1sReg==", + "dev": true, + "requires": { + "add-stream": "^1.0.0", + "conventional-changelog-writer": "^4.0.18", + "conventional-commits-parser": "^3.2.0", + "dateformat": "^3.0.0", + "get-pkg-repo": "^1.0.0", + "git-raw-commits": "^2.0.8", + "git-remote-origin-url": "^2.0.0", + "git-semver-tags": "^4.1.1", + "lodash": "^4.17.15", + "normalize-package-data": "^3.0.0", + "q": "^1.5.1", + "read-pkg": "^3.0.0", + "read-pkg-up": "^3.0.0", + "shelljs": "^0.8.3", + "through2": "^4.0.0" + }, + "dependencies": { + "find-up": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/find-up/-/find-up-2.1.0.tgz", + "integrity": "sha1-RdG35QbHF93UgndaK3eSCjwMV6c=", + "dev": true, + "requires": { + "locate-path": "^2.0.0" + } + }, + "locate-path": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/locate-path/-/locate-path-2.0.0.tgz", + "integrity": "sha1-K1aLJl7slExtnA3pw9u7ygNUzY4=", + "dev": true, + "requires": { + "p-locate": "^2.0.0", + "path-exists": "^3.0.0" + } + }, + "p-limit": { + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/p-limit/-/p-limit-1.3.0.tgz", + "integrity": "sha512-vvcXsLAJ9Dr5rQOPk7toZQZJApBl2K4J6dANSsEuh6QI41JYcsS/qhTGa9ErIUUgK3WNQoJYvylxvjqmiqEA9Q==", + "dev": true, + "requires": { + "p-try": "^1.0.0" + } + }, + "p-locate": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/p-locate/-/p-locate-2.0.0.tgz", + "integrity": "sha1-IKAQOyIqcMj9OcwuWAaA893l7EM=", + "dev": true, + "requires": { + "p-limit": "^1.1.0" + } + }, + "p-try": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/p-try/-/p-try-1.0.0.tgz", + "integrity": "sha1-y8ec26+P1CKOE/Yh8rGiN8GyB7M=", + "dev": true + }, + "path-exists": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/path-exists/-/path-exists-3.0.0.tgz", + "integrity": "sha1-zg6+ql94yxiSXqfYENe1mwEP1RU=", + "dev": true + }, + "read-pkg-up": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/read-pkg-up/-/read-pkg-up-3.0.0.tgz", + "integrity": "sha1-PtSWaF26D4/hGNBpHcUfSh/5bwc=", + "dev": true, + "requires": { + "find-up": "^2.0.0", + "read-pkg": "^3.0.0" + } + } + } + }, + "conventional-changelog-ember": { + "version": "2.0.9", + "resolved": "https://registry.npmjs.org/conventional-changelog-ember/-/conventional-changelog-ember-2.0.9.tgz", + "integrity": "sha512-ulzIReoZEvZCBDhcNYfDIsLTHzYHc7awh+eI44ZtV5cx6LVxLlVtEmcO+2/kGIHGtw+qVabJYjdI5cJOQgXh1A==", + "dev": true, + "requires": { + "q": "^1.5.1" + } + }, + "conventional-changelog-eslint": { + "version": "3.0.9", + "resolved": "https://registry.npmjs.org/conventional-changelog-eslint/-/conventional-changelog-eslint-3.0.9.tgz", + "integrity": "sha512-6NpUCMgU8qmWmyAMSZO5NrRd7rTgErjrm4VASam2u5jrZS0n38V7Y9CzTtLT2qwz5xEChDR4BduoWIr8TfwvXA==", + "dev": true, + "requires": { + "q": "^1.5.1" + } + }, + "conventional-changelog-express": { + "version": "2.0.6", + "resolved": "https://registry.npmjs.org/conventional-changelog-express/-/conventional-changelog-express-2.0.6.tgz", + "integrity": "sha512-SDez2f3iVJw6V563O3pRtNwXtQaSmEfTCaTBPCqn0oG0mfkq0rX4hHBq5P7De2MncoRixrALj3u3oQsNK+Q0pQ==", + "dev": true, + "requires": { + "q": "^1.5.1" + } + }, + "conventional-changelog-jquery": { + "version": "3.0.11", + "resolved": "https://registry.npmjs.org/conventional-changelog-jquery/-/conventional-changelog-jquery-3.0.11.tgz", + "integrity": "sha512-x8AWz5/Td55F7+o/9LQ6cQIPwrCjfJQ5Zmfqi8thwUEKHstEn4kTIofXub7plf1xvFA2TqhZlq7fy5OmV6BOMw==", + "dev": true, + "requires": { + "q": "^1.5.1" + } + }, + "conventional-changelog-jshint": { + "version": "2.0.9", + "resolved": "https://registry.npmjs.org/conventional-changelog-jshint/-/conventional-changelog-jshint-2.0.9.tgz", + "integrity": "sha512-wMLdaIzq6TNnMHMy31hql02OEQ8nCQfExw1SE0hYL5KvU+JCTuPaDO+7JiogGT2gJAxiUGATdtYYfh+nT+6riA==", + "dev": true, + "requires": { + "compare-func": "^2.0.0", + "q": "^1.5.1" + } + }, + "conventional-changelog-preset-loader": { + "version": "2.3.4", + "resolved": "https://registry.npmjs.org/conventional-changelog-preset-loader/-/conventional-changelog-preset-loader-2.3.4.tgz", + "integrity": "sha512-GEKRWkrSAZeTq5+YjUZOYxdHq+ci4dNwHvpaBC3+ENalzFWuCWa9EZXSuZBpkr72sMdKB+1fyDV4takK1Lf58g==", + "dev": true + }, + "conventional-changelog-writer": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/conventional-changelog-writer/-/conventional-changelog-writer-4.1.0.tgz", + "integrity": "sha512-WwKcUp7WyXYGQmkLsX4QmU42AZ1lqlvRW9mqoyiQzdD+rJWbTepdWoKJuwXTS+yq79XKnQNa93/roViPQrAQgw==", + "dev": true, + "requires": { + "compare-func": "^2.0.0", + "conventional-commits-filter": "^2.0.7", + "dateformat": "^3.0.0", + "handlebars": "^4.7.6", + "json-stringify-safe": "^5.0.1", + "lodash": "^4.17.15", + "meow": "^8.0.0", + "semver": "^6.0.0", + "split": "^1.0.0", + "through2": "^4.0.0" + }, + "dependencies": { + "semver": { + "version": "6.3.0", + "resolved": "https://registry.npmjs.org/semver/-/semver-6.3.0.tgz", + "integrity": "sha512-b39TBaTSfV6yBrapU89p5fKekE2m/NwnDocOVruQFS1/veMgdzuPcnOM34M6CwxW8jH/lxEa5rBoDeUwu5HHTw==", + "dev": true + } + } + }, + "conventional-commits-filter": { + "version": "2.0.7", + "resolved": "https://registry.npmjs.org/conventional-commits-filter/-/conventional-commits-filter-2.0.7.tgz", + "integrity": "sha512-ASS9SamOP4TbCClsRHxIHXRfcGCnIoQqkvAzCSbZzTFLfcTqJVugB0agRgsEELsqaeWgsXv513eS116wnlSSPA==", + "dev": true, + "requires": { + "lodash.ismatch": "^4.4.0", + "modify-values": "^1.0.0" + } + }, "conventional-commits-parser": { "version": "3.2.1", "resolved": "https://registry.npmjs.org/conventional-commits-parser/-/conventional-commits-parser-3.2.1.tgz", @@ -5195,6 +6415,12 @@ "trim-off-newlines": "^1.0.0" } }, + "core-util-is": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/core-util-is/-/core-util-is-1.0.2.tgz", + "integrity": "sha1-tf1UIgqivFq1eqtxQMlAdUUDwac=", + "dev": true + }, "cosmiconfig": { "version": "7.0.0", "resolved": "https://registry.npmjs.org/cosmiconfig/-/cosmiconfig-7.0.0.tgz", @@ -5219,12 +6445,27 @@ "which": "^2.0.1" } }, + "currently-unhandled": { + "version": "0.4.1", + "resolved": "https://registry.npmjs.org/currently-unhandled/-/currently-unhandled-0.4.1.tgz", + "integrity": "sha1-mI3zP+qxke95mmE2nddsF635V+o=", + "dev": true, + "requires": { + "array-find-index": "^1.0.1" + } + }, "dargs": { "version": "7.0.0", "resolved": "https://registry.npmjs.org/dargs/-/dargs-7.0.0.tgz", "integrity": "sha512-2iy1EkLdlBzQGvbweYRFxmFath8+K7+AKB0TlhHWkNuH+TmovaMH/Wp7V7R4u7f4SnX3OgLsU9t1NI9ioDnUpg==", "dev": true }, + "dateformat": { + "version": "3.0.3", + "resolved": "https://registry.npmjs.org/dateformat/-/dateformat-3.0.3.tgz", + "integrity": "sha512-jyCETtSl3VMZMWeRo7iY1FL19ges1t55hMo5yaam4Jrsm5EPL89UQkoQRyiI+Yf4k8r2ZpdngkV8hr1lIdjb3Q==", + "dev": true + }, "debug": { "version": "4.3.1", "resolved": "https://registry.npmjs.org/debug/-/debug-4.3.1.tgz", @@ -5387,9 +6628,9 @@ "dev": true }, "eslint": { - "version": "7.22.0", - "resolved": "https://registry.npmjs.org/eslint/-/eslint-7.22.0.tgz", - "integrity": "sha512-3VawOtjSJUQiiqac8MQc+w457iGLfuNGLFn8JmF051tTKbh5/x/0vlcEj8OgDCaw7Ysa2Jn8paGshV7x2abKXg==", + "version": "7.24.0", + "resolved": "https://registry.npmjs.org/eslint/-/eslint-7.24.0.tgz", + "integrity": "sha512-k9gaHeHiFmGCDQ2rEfvULlSLruz6tgfA8DEn+rY9/oYPFFTlz55mM/Q/Rij1b2Y42jwZiK3lXvNTw6w6TXzcKQ==", "dev": true, "requires": { "@babel/code-frame": "7.12.11", @@ -5753,6 +6994,253 @@ "integrity": "sha512-I0UBV/XOz1XkIJHEUDMZAbzCThU/H8DxmSfmdGcKPnVhu2VfFqr34jr9777IyaTYvxjedWhqVIilEDsCdP5G6g==", "dev": true }, + "get-pkg-repo": { + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/get-pkg-repo/-/get-pkg-repo-1.4.0.tgz", + "integrity": "sha1-xztInAbYDMVTbCyFP54FIyBWly0=", + "dev": true, + "requires": { + "hosted-git-info": "^2.1.4", + "meow": "^3.3.0", + "normalize-package-data": "^2.3.0", + "parse-github-repo-url": "^1.3.0", + "through2": "^2.0.0" + }, + "dependencies": { + "camelcase": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/camelcase/-/camelcase-2.1.1.tgz", + "integrity": "sha1-fB0W1nmhu+WcoCys7PsBHiAfWh8=", + "dev": true + }, + "camelcase-keys": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/camelcase-keys/-/camelcase-keys-2.1.0.tgz", + "integrity": "sha1-MIvur/3ygRkFHvodkyITyRuPkuc=", + "dev": true, + "requires": { + "camelcase": "^2.0.0", + "map-obj": "^1.0.0" + } + }, + "find-up": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/find-up/-/find-up-1.1.2.tgz", + "integrity": "sha1-ay6YIrGizgpgq2TWEOzK1TyyTQ8=", + "dev": true, + "requires": { + "path-exists": "^2.0.0", + "pinkie-promise": "^2.0.0" + } + }, + "get-stdin": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/get-stdin/-/get-stdin-4.0.1.tgz", + "integrity": "sha1-uWjGsKBDhDJJAui/Gl3zJXmkUP4=", + "dev": true + }, + "hosted-git-info": { + "version": "2.8.9", + "resolved": "https://registry.npmjs.org/hosted-git-info/-/hosted-git-info-2.8.9.tgz", + "integrity": "sha512-mxIDAb9Lsm6DoOJ7xH+5+X4y1LU/4Hi50L9C5sIswK3JzULS4bwk1FvjdBgvYR4bzT4tuUQiC15FE2f5HbLvYw==", + "dev": true + }, + "indent-string": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/indent-string/-/indent-string-2.1.0.tgz", + "integrity": "sha1-ji1INIdCEhtKghi3oTfppSBJ3IA=", + "dev": true, + "requires": { + "repeating": "^2.0.0" + } + }, + "load-json-file": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/load-json-file/-/load-json-file-1.1.0.tgz", + "integrity": "sha1-lWkFcI1YtLq0wiYbBPWfMcmTdMA=", + "dev": true, + "requires": { + "graceful-fs": "^4.1.2", + "parse-json": "^2.2.0", + "pify": "^2.0.0", + "pinkie-promise": "^2.0.0", + "strip-bom": "^2.0.0" + } + }, + "map-obj": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/map-obj/-/map-obj-1.0.1.tgz", + "integrity": "sha1-2TPOuSBdgr3PSIb2dCvcK03qFG0=", + "dev": true + }, + "meow": { + "version": "3.7.0", + "resolved": "https://registry.npmjs.org/meow/-/meow-3.7.0.tgz", + "integrity": "sha1-cstmi0JSKCkKu/qFaJJYcwioAfs=", + "dev": true, + "requires": { + "camelcase-keys": "^2.0.0", + "decamelize": "^1.1.2", + "loud-rejection": "^1.0.0", + "map-obj": "^1.0.1", + "minimist": "^1.1.3", + "normalize-package-data": "^2.3.4", + "object-assign": "^4.0.1", + "read-pkg-up": "^1.0.1", + "redent": "^1.0.0", + "trim-newlines": "^1.0.0" + } + }, + "normalize-package-data": { + "version": "2.5.0", + "resolved": "https://registry.npmjs.org/normalize-package-data/-/normalize-package-data-2.5.0.tgz", + "integrity": "sha512-/5CMN3T0R4XTj4DcGaexo+roZSdSFW/0AOOTROrjxzCG1wrWXEsGbRKevjlIL+ZDE4sZlJr5ED4YW0yqmkK+eA==", + "dev": true, + "requires": { + "hosted-git-info": "^2.1.4", + "resolve": "^1.10.0", + "semver": "2 || 3 || 4 || 5", + "validate-npm-package-license": "^3.0.1" + } + }, + "parse-json": { + "version": "2.2.0", + "resolved": "https://registry.npmjs.org/parse-json/-/parse-json-2.2.0.tgz", + "integrity": "sha1-9ID0BDTvgHQfhGkJn43qGPVaTck=", + "dev": true, + "requires": { + "error-ex": "^1.2.0" + } + }, + "path-exists": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/path-exists/-/path-exists-2.1.0.tgz", + "integrity": "sha1-D+tsZPD8UY2adU3V77YscCJ2H0s=", + "dev": true, + "requires": { + "pinkie-promise": "^2.0.0" + } + }, + "path-type": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/path-type/-/path-type-1.1.0.tgz", + "integrity": "sha1-WcRPfuSR2nBNpBXaWkBwuk+P5EE=", + "dev": true, + "requires": { + "graceful-fs": "^4.1.2", + "pify": "^2.0.0", + "pinkie-promise": "^2.0.0" + } + }, + "pify": { + "version": "2.3.0", + "resolved": "https://registry.npmjs.org/pify/-/pify-2.3.0.tgz", + "integrity": "sha1-7RQaasBDqEnqWISY59yosVMw6Qw=", + "dev": true + }, + "read-pkg": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/read-pkg/-/read-pkg-1.1.0.tgz", + "integrity": "sha1-9f+qXs0pyzHAR0vKfXVra7KePyg=", + "dev": true, + "requires": { + "load-json-file": "^1.0.0", + "normalize-package-data": "^2.3.2", + "path-type": "^1.0.0" + } + }, + "read-pkg-up": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/read-pkg-up/-/read-pkg-up-1.0.1.tgz", + "integrity": "sha1-nWPBMnbAZZGNV/ACpX9AobZD+wI=", + "dev": true, + "requires": { + "find-up": "^1.0.0", + "read-pkg": "^1.0.0" + } + }, + "readable-stream": { + "version": "2.3.7", + "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-2.3.7.tgz", + "integrity": "sha512-Ebho8K4jIbHAxnuxi7o42OrZgF/ZTNcsZj6nRKyUmkhLFq8CHItp/fy6hQZuZmP/n3yZ9VBUbp4zz/mX8hmYPw==", + "dev": true, + "requires": { + "core-util-is": "~1.0.0", + "inherits": "~2.0.3", + "isarray": "~1.0.0", + "process-nextick-args": "~2.0.0", + "safe-buffer": "~5.1.1", + "string_decoder": "~1.1.1", + "util-deprecate": "~1.0.1" + } + }, + "redent": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/redent/-/redent-1.0.0.tgz", + "integrity": "sha1-z5Fqsf1fHxbfsggi3W7H9zDCr94=", + "dev": true, + "requires": { + "indent-string": "^2.1.0", + "strip-indent": "^1.0.1" + } + }, + "safe-buffer": { + "version": "5.1.2", + "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.1.2.tgz", + "integrity": "sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g==", + "dev": true + }, + "semver": { + "version": "5.7.1", + "resolved": "https://registry.npmjs.org/semver/-/semver-5.7.1.tgz", + "integrity": "sha512-sauaDf/PZdVgrLTNYHRtpXa1iRiKcaebiKQ1BJdpQlWH2lCvexQdX55snPFyK7QzpudqbCI0qXFfOasHdyNDGQ==", + "dev": true + }, + "string_decoder": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.1.1.tgz", + "integrity": "sha512-n/ShnvDi6FHbbVfviro+WojiFzv+s8MPMHBczVePfUpDJLwoLT0ht1l4YwBCbi8pJAveEEdnkHyPyTP/mzRfwg==", + "dev": true, + "requires": { + "safe-buffer": "~5.1.0" + } + }, + "strip-bom": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/strip-bom/-/strip-bom-2.0.0.tgz", + "integrity": "sha1-YhmoVhZSBJHzV4i9vxRHqZx+aw4=", + "dev": true, + "requires": { + "is-utf8": "^0.2.0" + } + }, + "strip-indent": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/strip-indent/-/strip-indent-1.0.1.tgz", + "integrity": "sha1-DHlipq3vp7vUrDZkYKY4VSrhoKI=", + "dev": true, + "requires": { + "get-stdin": "^4.0.1" + } + }, + "through2": { + "version": "2.0.5", + "resolved": "https://registry.npmjs.org/through2/-/through2-2.0.5.tgz", + "integrity": "sha512-/mrRod8xqpA+IHSLyGCQ2s8SPHiCDEeQJSep1jqLYeEUClOFG2Qsh+4FU6G9VeqpZnGW/Su8LQGc4YKni5rYSQ==", + "dev": true, + "requires": { + "readable-stream": "~2.3.6", + "xtend": "~4.0.1" + } + }, + "trim-newlines": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/trim-newlines/-/trim-newlines-1.0.0.tgz", + "integrity": "sha1-WIeWa7WCpFA6QetST301ARgVphM=", + "dev": true + } + } + }, "get-stdin": { "version": "8.0.0", "resolved": "https://registry.npmjs.org/get-stdin/-/get-stdin-8.0.0.tgz", @@ -5781,6 +7269,51 @@ "through2": "^4.0.0" } }, + "git-remote-origin-url": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/git-remote-origin-url/-/git-remote-origin-url-2.0.0.tgz", + "integrity": "sha1-UoJlna4hBxRaERJhEq0yFuxfpl8=", + "dev": true, + "requires": { + "gitconfiglocal": "^1.0.0", + "pify": "^2.3.0" + }, + "dependencies": { + "pify": { + "version": "2.3.0", + "resolved": "https://registry.npmjs.org/pify/-/pify-2.3.0.tgz", + "integrity": "sha1-7RQaasBDqEnqWISY59yosVMw6Qw=", + "dev": true + } + } + }, + "git-semver-tags": { + "version": "4.1.1", + "resolved": "https://registry.npmjs.org/git-semver-tags/-/git-semver-tags-4.1.1.tgz", + "integrity": "sha512-OWyMt5zBe7xFs8vglMmhM9lRQzCWL3WjHtxNNfJTMngGym7pC1kh8sP6jevfydJ6LP3ZvGxfb6ABYgPUM0mtsA==", + "dev": true, + "requires": { + "meow": "^8.0.0", + "semver": "^6.0.0" + }, + "dependencies": { + "semver": { + "version": "6.3.0", + "resolved": "https://registry.npmjs.org/semver/-/semver-6.3.0.tgz", + "integrity": "sha512-b39TBaTSfV6yBrapU89p5fKekE2m/NwnDocOVruQFS1/veMgdzuPcnOM34M6CwxW8jH/lxEa5rBoDeUwu5HHTw==", + "dev": true + } + } + }, + "gitconfiglocal": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/gitconfiglocal/-/gitconfiglocal-1.0.0.tgz", + "integrity": "sha1-QdBF84UaXqiPA/JMocYXgRRGS5s=", + "dev": true, + "requires": { + "ini": "^1.3.2" + } + }, "glob": { "version": "7.1.6", "resolved": "https://registry.npmjs.org/glob/-/glob-7.1.6.tgz", @@ -5823,9 +7356,9 @@ } }, "globby": { - "version": "11.0.2", - "resolved": "https://registry.npmjs.org/globby/-/globby-11.0.2.tgz", - "integrity": "sha512-2ZThXDvvV8fYFRVIxnrMQBipZQDr7MxKAmQK1vujaj9/7eF0efG7BPUKJ7jP7G5SLF37xKDXvO4S/KKLj/Z0og==", + "version": "11.0.3", + "resolved": "https://registry.npmjs.org/globby/-/globby-11.0.3.tgz", + "integrity": "sha512-ffdmosjA807y7+lA1NM0jELARVmYul/715xiILEjo3hBLPTcirgQNnXECn5g3mtR8TOLCVbkfua1Hpen25/Xcg==", "dev": true, "requires": { "array-union": "^2.1.0", @@ -5850,6 +7383,19 @@ "integrity": "sha512-nTnJ528pbqxYanhpDYsi4Rd8MAeaBA67+RZ10CM1m3bTAVFEDcd5AuA4a6W5YkGZ1iNXHzZz8T6TBKLeBuNriQ==", "dev": true }, + "handlebars": { + "version": "4.7.7", + "resolved": "https://registry.npmjs.org/handlebars/-/handlebars-4.7.7.tgz", + "integrity": "sha512-aAcXm5OAfE/8IXkcZvCepKU3VzW1/39Fb5ZuqMtgI/hT8X2YgoMvBY5dLhq/cpOvw7Lk1nK/UF71aLG/ZnVYRA==", + "dev": true, + "requires": { + "minimist": "^1.2.5", + "neo-async": "^2.6.0", + "source-map": "^0.6.1", + "uglify-js": "^3.1.4", + "wordwrap": "^1.0.0" + } + }, "hard-rejection": { "version": "2.1.0", "resolved": "https://registry.npmjs.org/hard-rejection/-/hard-rejection-2.1.0.tgz", @@ -5884,9 +7430,9 @@ "dev": true }, "hosted-git-info": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/hosted-git-info/-/hosted-git-info-4.0.0.tgz", - "integrity": "sha512-fqhGdjk4av7mT9fU/B01dUtZ+WZSc/XEXMoLXDVZukiQRXxeHSSz3AqbeWRJHtF8EQYHlAgB1NSAHU0Cm7aqZA==", + "version": "4.0.2", + "resolved": "https://registry.npmjs.org/hosted-git-info/-/hosted-git-info-4.0.2.tgz", + "integrity": "sha512-c9OGXbZ3guC/xOlCg1Ci/VgWlwsqDv1yMQL1CWqXDL0hDjXuNcq0zuR4xqPSuasI3kqFDhqSyTjREz5gzq0fXg==", "dev": true, "requires": { "lru-cache": "^6.0.0" @@ -5974,6 +7520,12 @@ "integrity": "sha512-JV/yugV2uzW5iMRSiZAyDtQd+nxtUnjeLt0acNdw98kKLrvuRVyB80tsREOE7yvGVgalhZ6RNXCmEHkUKBKxew==", "dev": true }, + "interpret": { + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/interpret/-/interpret-1.4.0.tgz", + "integrity": "sha512-agE4QfB2Lkp9uICn7BAqoscw4SZP9kTE2hxiFI3jBPmXJfdqiahTbUuKGsMoN2GtqL9AxhYioAcVvgsb1HvRbA==", + "dev": true + }, "is-arrayish": { "version": "0.2.1", "resolved": "https://registry.npmjs.org/is-arrayish/-/is-arrayish-0.2.1.tgz", @@ -6022,6 +7574,12 @@ "integrity": "sha1-qIwCU1eR8C7TfHahueqXc8gz+MI=", "dev": true }, + "is-finite": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/is-finite/-/is-finite-1.1.0.tgz", + "integrity": "sha512-cdyMtqX/BOqqNBBiKlIVkytNHm49MtMlYyn1zxzvJKWmFMlGzm+ry5BBfYyeY9YmNKbRSo/o7OX9w9ale0wg3w==", + "dev": true + }, "is-fullwidth-code-point": { "version": "3.0.0", "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-3.0.0.tgz", @@ -6113,6 +7671,12 @@ "text-extensions": "^1.0.0" } }, + "is-utf8": { + "version": "0.2.1", + "resolved": "https://registry.npmjs.org/is-utf8/-/is-utf8-0.2.1.tgz", + "integrity": "sha1-Sw2hRCEE0bM2NA6AeX6GXPOffXI=", + "dev": true + }, "is-valid-identifier": { "version": "2.0.2", "resolved": "https://registry.npmjs.org/is-valid-identifier/-/is-valid-identifier-2.0.2.tgz", @@ -6122,6 +7686,12 @@ "assert": "^1.4.1" } }, + "isarray": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/isarray/-/isarray-1.0.0.tgz", + "integrity": "sha1-u5NdSFgsuhaMBoNJV6VKPgcSTxE=", + "dev": true + }, "isexe": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/isexe/-/isexe-2.0.0.tgz", @@ -6168,6 +7738,12 @@ "integrity": "sha1-nbe1lJatPzz+8wp1FC0tkwrXJlE=", "dev": true }, + "json-stringify-safe": { + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/json-stringify-safe/-/json-stringify-safe-5.0.1.tgz", + "integrity": "sha1-Epai1Y/UXxmg9s4B1lcB4sc1tus=", + "dev": true + }, "jsonfile": { "version": "6.1.0", "resolved": "https://registry.npmjs.org/jsonfile/-/jsonfile-6.1.0.tgz", @@ -6295,6 +7871,12 @@ "integrity": "sha512-v2kDEe57lecTulaDIuNTPy3Ry4gLGJ6Z1O3vE1krgXZNrsQ+LFTGHVxVjcXPs17LhbZVGedAJv8XZ1tvj5FvSg==", "dev": true }, + "lodash.ismatch": { + "version": "4.4.0", + "resolved": "https://registry.npmjs.org/lodash.ismatch/-/lodash.ismatch-4.4.0.tgz", + "integrity": "sha1-dWy1FQyjum8RCFp4hJZF8Yj4Xzc=", + "dev": true + }, "log-symbols": { "version": "4.0.0", "resolved": "https://registry.npmjs.org/log-symbols/-/log-symbols-4.0.0.tgz", @@ -6340,6 +7922,16 @@ } } }, + "loud-rejection": { + "version": "1.6.0", + "resolved": "https://registry.npmjs.org/loud-rejection/-/loud-rejection-1.6.0.tgz", + "integrity": "sha1-W0b4AUft7leIcPCG0Eghz5mOVR8=", + "dev": true, + "requires": { + "currently-unhandled": "^0.4.1", + "signal-exit": "^3.0.0" + } + }, "lru-cache": { "version": "6.0.0", "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-6.0.0.tgz", @@ -6350,9 +7942,9 @@ } }, "map-obj": { - "version": "4.2.0", - "resolved": "https://registry.npmjs.org/map-obj/-/map-obj-4.2.0.tgz", - "integrity": "sha512-NAq0fCmZYGz9UFEQyndp7sisrow4GroyGeKluyKC/chuITZsPyOyC1UJZPJlVFImhXdROIP5xqouRLThT3BbpQ==", + "version": "4.2.1", + "resolved": "https://registry.npmjs.org/map-obj/-/map-obj-4.2.1.tgz", + "integrity": "sha512-+WA2/1sPmDj1dlvvJmB5G6JKfY9dpn7EVBUL06+y6PoljPkh+6V1QihwxNkbcGxCRjt2b0F9K0taiCuo7MbdFQ==", "dev": true }, "memorystream": { @@ -6431,6 +8023,12 @@ "brace-expansion": "^1.1.7" } }, + "minimist": { + "version": "1.2.5", + "resolved": "https://registry.npmjs.org/minimist/-/minimist-1.2.5.tgz", + "integrity": "sha512-FM9nNUYrRBAELZQT3xeZQ7fmMOBg6nWNmJKTcgsJeaLstP/UODVpGsr5OhXhhXg6f+qtJ8uiZ+PUxkDWcgIXLw==", + "dev": true + }, "minimist-options": { "version": "4.1.0", "resolved": "https://registry.npmjs.org/minimist-options/-/minimist-options-4.1.0.tgz", @@ -6442,6 +8040,12 @@ "kind-of": "^6.0.3" } }, + "modify-values": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/modify-values/-/modify-values-1.0.1.tgz", + "integrity": "sha512-xV2bxeN6F7oYjZWTe/YPAy6MN2M+sL4u/Rlm2AHCIVGfo2p1yGmBHQ6vHehl4bRTZBdHu3TSkWdYgkwpYzAGSw==", + "dev": true + }, "mri": { "version": "1.1.6", "resolved": "https://registry.npmjs.org/mri/-/mri-1.1.6.tgz", @@ -6481,6 +8085,12 @@ "integrity": "sha1-Sr6/7tdUHywnrPspvbvRXI1bpPc=", "dev": true }, + "neo-async": { + "version": "2.6.2", + "resolved": "https://registry.npmjs.org/neo-async/-/neo-async-2.6.2.tgz", + "integrity": "sha512-Yd3UES5mWCSqR+qNT93S3UoYUkqAZ9lLg8a7g9rimsWmYGK8cVToA4/sF3RrshdyV3sAGMXVUmpMYOw+dLpOuw==", + "dev": true + }, "nice-try": { "version": "1.0.5", "resolved": "https://registry.npmjs.org/nice-try/-/nice-try-1.0.5.tgz", @@ -6488,14 +8098,14 @@ "dev": true }, "normalize-package-data": { - "version": "3.0.1", - "resolved": "https://registry.npmjs.org/normalize-package-data/-/normalize-package-data-3.0.1.tgz", - "integrity": "sha512-D/ttLdxo71msR4FF3VgSwK4blHfE3/vGByz1NCeE7/Dh8reQOKNJJjk5L10mLq9jxa+ZHzT1/HLgxljzbXE7Fw==", + "version": "3.0.2", + "resolved": "https://registry.npmjs.org/normalize-package-data/-/normalize-package-data-3.0.2.tgz", + "integrity": "sha512-6CdZocmfGaKnIHPVFhJJZ3GuR8SsLKvDANFp47Jmy51aKIr8akjAWTSxtpI+MBgBFdSMRyo4hMpDlT6dTffgZg==", "dev": true, "requires": { - "hosted-git-info": "^4.0.0", - "resolve": "^1.17.0", - "semver": "^7.3.2", + "hosted-git-info": "^4.0.1", + "resolve": "^1.20.0", + "semver": "^7.3.4", "validate-npm-package-license": "^3.0.1" } }, @@ -6742,6 +8352,12 @@ "callsites": "^3.0.0" } }, + "parse-github-repo-url": { + "version": "1.4.1", + "resolved": "https://registry.npmjs.org/parse-github-repo-url/-/parse-github-repo-url-1.4.1.tgz", + "integrity": "sha1-nn2LslKmy2ukJZUGC3v23z28H1A=", + "dev": true + }, "parse-json": { "version": "5.2.0", "resolved": "https://registry.npmjs.org/parse-json/-/parse-json-5.2.0.tgz", @@ -6802,6 +8418,21 @@ "integrity": "sha1-5aSs0sEB/fPZpNB/DbxNtJ3SgXY=", "dev": true }, + "pinkie": { + "version": "2.0.4", + "resolved": "https://registry.npmjs.org/pinkie/-/pinkie-2.0.4.tgz", + "integrity": "sha1-clVrgM+g1IqXToDnckjoDtT3+HA=", + "dev": true + }, + "pinkie-promise": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/pinkie-promise/-/pinkie-promise-2.0.1.tgz", + "integrity": "sha1-ITXW36ejWMBprJsXh3YogihFD/o=", + "dev": true, + "requires": { + "pinkie": "^2.0.0" + } + }, "pkg-dir": { "version": "5.0.0", "resolved": "https://registry.npmjs.org/pkg-dir/-/pkg-dir-5.0.0.tgz", @@ -6910,6 +8541,12 @@ } } }, + "process-nextick-args": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/process-nextick-args/-/process-nextick-args-2.0.1.tgz", + "integrity": "sha512-3ouUOpQhtgrbOa17J7+uxOTpITYWaGP7/AhoR3+A+/1e9skrzelGi/dXzEYyvbxubEF6Wn2ypscTKiKJFFn1ag==", + "dev": true + }, "progress": { "version": "2.0.3", "resolved": "https://registry.npmjs.org/progress/-/progress-2.0.3.tgz", @@ -6939,9 +8576,9 @@ "dev": true }, "queue-microtask": { - "version": "1.2.2", - "resolved": "https://registry.npmjs.org/queue-microtask/-/queue-microtask-1.2.2.tgz", - "integrity": "sha512-dB15eXv3p2jDlbOiNLyMabYg1/sXvppd8DP2J3EOCQ0AkuSXCW2tP7mnVouVLJKgUMY6yP0kcQDVpLCN13h4Xg==", + "version": "1.2.3", + "resolved": "https://registry.npmjs.org/queue-microtask/-/queue-microtask-1.2.3.tgz", + "integrity": "sha512-NuaNSa6flKT5JaSYQzJok04JzTL1CA6aGhv5rfLW3PgqA+M2ChpZQnAC8h8i4ZFkBS8X5RqkDBHA7r4hej3K9A==", "dev": true }, "quick-lru": { @@ -7018,9 +8655,9 @@ } }, "hosted-git-info": { - "version": "2.8.8", - "resolved": "https://registry.npmjs.org/hosted-git-info/-/hosted-git-info-2.8.8.tgz", - "integrity": "sha512-f/wzC2QaWBs7t9IYqB4T3sR1xviIViXJRJTWBlx2Gf3g0Xi5vI7Yy4koXQ1c9OYDGHN9sBy1DQ2AB8fqZBWhUg==", + "version": "2.8.9", + "resolved": "https://registry.npmjs.org/hosted-git-info/-/hosted-git-info-2.8.9.tgz", + "integrity": "sha512-mxIDAb9Lsm6DoOJ7xH+5+X4y1LU/4Hi50L9C5sIswK3JzULS4bwk1FvjdBgvYR4bzT4tuUQiC15FE2f5HbLvYw==", "dev": true }, "locate-path": { @@ -7107,6 +8744,15 @@ "util-deprecate": "^1.0.1" } }, + "rechoir": { + "version": "0.6.2", + "resolved": "https://registry.npmjs.org/rechoir/-/rechoir-0.6.2.tgz", + "integrity": "sha1-hSBLVNuoLVdC4oyWdW70OvUOM4Q=", + "dev": true, + "requires": { + "resolve": "^1.1.6" + } + }, "redent": { "version": "3.0.0", "resolved": "https://registry.npmjs.org/redent/-/redent-3.0.0.tgz", @@ -7123,6 +8769,15 @@ "integrity": "sha512-ZOIzd8yVsQQA7j8GCSlPGXwg5PfmA1mrq0JP4nGhh54LaKN3xdai/vHUDu74pKwV8OxseMS65u2NImosQcSD0Q==", "dev": true }, + "repeating": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/repeating/-/repeating-2.0.1.tgz", + "integrity": "sha1-UhTFOpJtNVJwdSf7q0FdvAjQbdo=", + "dev": true, + "requires": { + "is-finite": "^1.0.0" + } + }, "require-directory": { "version": "2.1.1", "resolved": "https://registry.npmjs.org/require-directory/-/require-directory-2.1.1.tgz", @@ -7210,9 +8865,9 @@ "dev": true }, "semver": { - "version": "7.3.4", - "resolved": "https://registry.npmjs.org/semver/-/semver-7.3.4.tgz", - "integrity": "sha512-tCfb2WLjqFAtXn4KEdxIhalnRtoKFN7nAwj0B3ZXCbQloV2tq5eDbcTmT68JJD3nRJq24/XgxtQKFIpQdtvmVw==", + "version": "7.3.5", + "resolved": "https://registry.npmjs.org/semver/-/semver-7.3.5.tgz", + "integrity": "sha512-PoeGJYh8HK4BTO/a9Tf6ZG3veo/A7ZVsYrSA6J8ny9nb3B1VrpkuN+z9OE5wfE5p6H4LchYZsegiQgbJD94ZFQ==", "dev": true, "requires": { "lru-cache": "^6.0.0" @@ -7251,6 +8906,17 @@ "integrity": "sha512-mRz/m/JVscCrkMyPqHc/bczi3OQHkLTqXHEFu0zDhK/qfv3UcOA4SVmRCLmos4bhjr9ekVQubj/R7waKapmiQg==", "dev": true }, + "shelljs": { + "version": "0.8.4", + "resolved": "https://registry.npmjs.org/shelljs/-/shelljs-0.8.4.tgz", + "integrity": "sha512-7gk3UZ9kOfPLIAbslLzyWeGiEqx9e3rxwZM0KE6EL8GlGwjym9Mrlx5/p33bWTu9YG6vcS4MBxYZDHYr5lr8BQ==", + "dev": true, + "requires": { + "glob": "^7.0.0", + "interpret": "^1.0.0", + "rechoir": "^0.6.2" + } + }, "signal-exit": { "version": "3.0.3", "resolved": "https://registry.npmjs.org/signal-exit/-/signal-exit-3.0.3.tgz", @@ -7274,6 +8940,12 @@ "is-fullwidth-code-point": "^3.0.0" } }, + "source-map": { + "version": "0.6.1", + "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.6.1.tgz", + "integrity": "sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g==", + "dev": true + }, "spdx-correct": { "version": "3.1.1", "resolved": "https://registry.npmjs.org/spdx-correct/-/spdx-correct-3.1.1.tgz", @@ -7306,6 +8978,15 @@ "integrity": "sha512-U+MTEOO0AiDzxwFvoa4JVnMV6mZlJKk2sBLt90s7G0Gd0Mlknc7kxEn3nuDPNZRta7O2uy8oLcZLVT+4sqNZHQ==", "dev": true }, + "split": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/split/-/split-1.0.1.tgz", + "integrity": "sha512-mTyOoPbrivtXnwnIxZRFYRrPNtEFKlpB2fvjSnCQUiAA6qAZzqwna5envK4uk6OIeP17CsdF3rSBGYVBsU0Tkg==", + "dev": true, + "requires": { + "through": "2" + } + }, "split2": { "version": "3.2.2", "resolved": "https://registry.npmjs.org/split2/-/split2-3.2.2.tgz", @@ -7485,6 +9166,22 @@ } } }, + "temp-dir": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/temp-dir/-/temp-dir-2.0.0.tgz", + "integrity": "sha512-aoBAniQmmwtcKp/7BzsH8Cxzv8OL736p7v1ihGb5e9DJ9kTwGWHrQrVB5+lfVDzfGrdRzXch+ig7LHaY1JTOrg==", + "dev": true + }, + "tempfile": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/tempfile/-/tempfile-3.0.0.tgz", + "integrity": "sha512-uNFCg478XovRi85iD42egu+eSFUmmka750Jy7L5tfHI5hQKKtbPnxaSaXAbBqCDYrw3wx4tXjKwci4/QmsZJxw==", + "dev": true, + "requires": { + "temp-dir": "^2.0.0", + "uuid": "^3.3.2" + } + }, "text-extensions": { "version": "1.9.0", "resolved": "https://registry.npmjs.org/text-extensions/-/text-extensions-1.9.0.tgz", @@ -7564,11 +9261,18 @@ "dev": true }, "typescript": { - "version": "4.2.3", - "resolved": "https://registry.npmjs.org/typescript/-/typescript-4.2.3.tgz", - "integrity": "sha512-qOcYwxaByStAWrBf4x0fibwZvMRG+r4cQoTjbPtUlrWjBHbmCAww1i448U0GJ+3cNNEtebDteo/cHOR3xJ4wEw==", + "version": "4.2.4", + "resolved": "https://registry.npmjs.org/typescript/-/typescript-4.2.4.tgz", + "integrity": "sha512-V+evlYHZnQkaz8TRBuxTA92yZBPotr5H+WhQ7bD3hZUndx5tGOa1fuCgeSjxAzM1RiN5IzvadIXTVefuuwZCRg==", "dev": true }, + "uglify-js": { + "version": "3.13.3", + "resolved": "https://registry.npmjs.org/uglify-js/-/uglify-js-3.13.3.tgz", + "integrity": "sha512-otIc7O9LyxpUcQoXzj2hL4LPWKklO6LJWoJUzNa8A17Xgi4fOeDC8FBDOLHnC/Slo1CQgsZMcM6as0M76BZaig==", + "dev": true, + "optional": true + }, "unbox-primitive": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/unbox-primitive/-/unbox-primitive-1.0.0.tgz", @@ -7619,6 +9323,12 @@ "integrity": "sha1-RQ1Nyfpw3nMnYvvS1KKJgUGaDM8=", "dev": true }, + "uuid": { + "version": "3.4.0", + "resolved": "https://registry.npmjs.org/uuid/-/uuid-3.4.0.tgz", + "integrity": "sha512-HjSDRw6gZE5JMggctHBcjVak08+KEVhSIiDzFnT9S9aegmp85S/bReBVTb4QTFaRNptJ9kuYaNhnbNEOkbKb/A==", + "dev": true + }, "v8-compile-cache": { "version": "2.3.0", "resolved": "https://registry.npmjs.org/v8-compile-cache/-/v8-compile-cache-2.3.0.tgz", @@ -7669,6 +9379,12 @@ "integrity": "sha512-Hz/mrNwitNRh/HUAtM/VT/5VH+ygD6DV7mYKZAtHOrbs8U7lvPS6xf7EJKMF0uW1KJCl0H701g3ZGus+muE5vQ==", "dev": true }, + "wordwrap": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/wordwrap/-/wordwrap-1.0.0.tgz", + "integrity": "sha1-J1hIEIkUVqQXHI0CJkQa3pDLyus=", + "dev": true + }, "wrap-ansi": { "version": "7.0.0", "resolved": "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-7.0.0.tgz", @@ -7686,6 +9402,12 @@ "integrity": "sha1-tSQ9jz7BqjXxNkYFvA0QNuMKtp8=", "dev": true }, + "xtend": { + "version": "4.0.2", + "resolved": "https://registry.npmjs.org/xtend/-/xtend-4.0.2.tgz", + "integrity": "sha512-LKYU1iAXJXUgAXn9URjiu+MWhyUXHsvfp7mcuYm9dSUKK0/CjtrUwFAxD82/mCWbtLsGjFIad0wIsod4zrTAEQ==", + "dev": true + }, "y18n": { "version": "5.0.5", "resolved": "https://registry.npmjs.org/y18n/-/y18n-5.0.5.tgz", diff --git a/package.json b/package.json index 80fdc04e..d16c1287 100644 --- a/package.json +++ b/package.json @@ -1,21 +1,70 @@ { "name": "discord-api-types", - "version": "0.13.3", + "version": "0.14.0", "description": "Discord API typings that are kept up to date for use in bot library creation.", - "main": "./default/index.js", - "types": "./default/index.d.ts", + "main": "./shortcuts/v8.js", + "module": "./shortcuts/v8.mjs", + "types": "./shortcuts/v8.d.ts", "exports": { - "./common": { - "require": "./common/index.js", - "import": "./common/index.mjs" + "./globals": { + "require": "./globals.js", + "import": "./globals.mjs" }, "./v6": { - "require": "./v6/index.js", - "import": "./v6/index.mjs" + "require": "./shortcuts/v6.js", + "import": "./shortcuts/v6.mjs" }, "./v8": { - "require": "./v8/index.js", - "import": "./v8/index.mjs" + "require": "./shortcuts/v8.js", + "import": "./shortcuts/v8.mjs" + }, + "./gateway": { + "require": "./gateway/index.js", + "import": "./gateway/index.mjs" + }, + "./gateway/v*": { + "require": "./gateway/v*.js", + "import": "./gateway/v*.mjs" + }, + "./payloads": { + "require": "./payloads/index.js", + "import": "./payloads/index.mjs" + }, + "./payloads/v*": { + "require": "./payloads/v*/index.js", + "import": "./payloads/v*/index.mjs" + }, + "./rest": { + "require": "./rest/index.js", + "import": "./rest/index.mjs" + }, + "./rest/v*": { + "require": "./rest/v*/index.js", + "import": "./rest/v*/index.mjs" + }, + "./rpc": { + "require": "./rpc/index.js", + "import": "./rpc/index.mjs" + }, + "./rpc/v*": { + "require": "./rpc/v*.js", + "import": "./rpc/v*.mjs" + }, + "./voice": { + "require": "./voice/index.js", + "import": "./voice/index.mjs" + }, + "./voice/v*": { + "require": "./voice/v*.js", + "import": "./voice/v*.mjs" + }, + "./utils": { + "require": "./utils/index.js", + "import": "./utils/index.mjs" + }, + "./utils/v*": { + "require": "./utils/v*.js", + "import": "./utils/v*.mjs" } }, "scripts": { @@ -23,15 +72,21 @@ "build:deno": "node ./scripts/deno.mjs", "build:node": "tsc && run-p esm:*", "clean:deno": "rimraf deno/", - "clean:node": "rimraf {v*,default,common}/**/*.{js,mjs,d.ts,map}", + "clean:node": "rimraf {gateway,payloads,rest,rpc,voice,shortcuts,utils}/**/*.{js,mjs,d.ts,map} globals.{js,mjs,d.ts,*map}", "clean": "run-p clean:*", - "esm:common": "gen-esm-wrapper ./common/index.js ./common/index.mjs", - "esm:v6": "gen-esm-wrapper ./v6/index.js ./v6/index.mjs", - "esm:v8": "gen-esm-wrapper ./v8/index.js ./v8/index.mjs", - "lint": "eslint --fix --ext mjs,js,ts {v*,default,common}/**", - "postpublish": "run-s clean:node build:deno", + "esm:gateway": "gen-esm-wrapper ./gateway/index.js ./gateway/index.mjs", + "esm:payloads": "gen-esm-wrapper ./payloads/index.js ./payloads/index.mjs", + "esm:rest": "gen-esm-wrapper ./rest/index.js ./rest/index.mjs", + "esm:rpc": "gen-esm-wrapper ./rpc/index.js ./rpc/index.mjs", + "esm:utils": "gen-esm-wrapper ./utils/index.js ./utils/index.mjs", + "esm:voice": "gen-esm-wrapper ./voice/index.js ./voice/index.mjs", + "esm:globals": "gen-esm-wrapper ./globals.js ./globals.mjs", + "esm:versions": "node ./scripts/versions.mjs", + "lint": "eslint --fix --ext mjs,ts {gateway,payloads,rest,rpc,voice,shortcuts,utils}/** globals.ts", + "test:lint": "eslint --ext mjs,ts {gateway,payloads,rest,rpc,voice,shortcuts,utils}/** globals.ts", "prepublishOnly": "run-s clean test:lint build:node", - "test:lint": "eslint --ext mjs,js,ts {v*,default,common}/**" + "postpublish": "run-s clean:node build:deno", + "version": "conventional-changelog -p angular -i CHANGELOG.md -s && git add CHANGELOG.md" }, "keywords": [ "discord", @@ -42,19 +97,20 @@ "author": "Vlad Frangu ", "license": "MIT", "files": [ - "v*/**/*.{js,js.map,d.ts,d.ts.map,mjs}", - "default/*.{js,js.map,d.ts,d.ts.map,mjs}", - "common/*.{js,js.map,d.ts,d.ts.map,mjs}" + "{gateway,payloads,rest,rpc,voice,shortcuts,utils}/**/*.{js,js.map,d.ts,d.ts.map,mjs}", + "globals.{js,js.map,d.ts,d.ts.map,mjs}" ], "engines": { "node": ">=12" }, "devDependencies": { - "@commitlint/cli": "^12.0.1", - "@commitlint/config-angular": "^12.0.1", - "@typescript-eslint/eslint-plugin": "^4.18.0", - "@typescript-eslint/parser": "^4.18.0", - "eslint": "^7.22.0", + "@commitlint/cli": "^12.1.1", + "@commitlint/config-angular": "^12.1.1", + "@types/node": "^14.14.37", + "@typescript-eslint/eslint-plugin": "^4.21.0", + "@typescript-eslint/parser": "^4.21.0", + "conventional-changelog-cli": "^2.1.1", + "eslint": "^7.24.0", "eslint-config-marine": "^8.3.2", "eslint-config-prettier": "^8.1.0", "eslint-plugin-prettier": "^3.3.1", @@ -65,7 +121,7 @@ "prettier": "^2.2.1", "pretty-quick": "^3.1.0", "rimraf": "^3.0.2", - "typescript": "^4.2.3" + "typescript": "^4.2.4" }, "repository": { "type": "git", @@ -81,7 +137,17 @@ }, "rules": { "@typescript-eslint/naming-convention": 0 - } + }, + "overrides": [ + { + "files": [ + "scripts/**/*.mjs" + ], + "parserOptions": { + "sourceType": "module" + } + } + ] }, "husky": { "hooks": { @@ -90,7 +156,8 @@ } }, "lint-staged": { - "{v*,default,common}/**/*.{mjs,js,ts}": "eslint --fix --ext mjs,js,ts" + "{gateway,payloads,rest,rpc,voice,shortcuts,utils}/**/*.{mjs,js,ts}": "eslint --fix --ext mjs,js,ts", + "globals.ts": "eslint --fix --ext mjs,js,ts" }, "commitlint": { "extends": [ diff --git a/payloads/index.ts b/payloads/index.ts new file mode 100644 index 00000000..8e20aaf8 --- /dev/null +++ b/payloads/index.ts @@ -0,0 +1,4 @@ +// This file exports all the payloads available in the recommended API version +// Thereby, things MAY break in the future. Try sticking to imports from a specific version + +export * from './v8/index'; diff --git a/v6/payloads/auditLog.ts b/payloads/v6/auditLog.ts similarity index 100% rename from v6/payloads/auditLog.ts rename to payloads/v6/auditLog.ts diff --git a/v6/payloads/channel.ts b/payloads/v6/channel.ts similarity index 100% rename from v6/payloads/channel.ts rename to payloads/v6/channel.ts diff --git a/v6/payloads/emoji.ts b/payloads/v6/emoji.ts similarity index 100% rename from v6/payloads/emoji.ts rename to payloads/v6/emoji.ts diff --git a/v6/payloads/gateway.ts b/payloads/v6/gateway.ts similarity index 100% rename from v6/payloads/gateway.ts rename to payloads/v6/gateway.ts diff --git a/v6/payloads/guild.ts b/payloads/v6/guild.ts similarity index 100% rename from v6/payloads/guild.ts rename to payloads/v6/guild.ts diff --git a/v6/payloads/index.ts b/payloads/v6/index.ts similarity index 100% rename from v6/payloads/index.ts rename to payloads/v6/index.ts diff --git a/v6/payloads/invite.ts b/payloads/v6/invite.ts similarity index 100% rename from v6/payloads/invite.ts rename to payloads/v6/invite.ts diff --git a/v6/payloads/oauth2.ts b/payloads/v6/oauth2.ts similarity index 100% rename from v6/payloads/oauth2.ts rename to payloads/v6/oauth2.ts diff --git a/v6/payloads/permissions.ts b/payloads/v6/permissions.ts similarity index 100% rename from v6/payloads/permissions.ts rename to payloads/v6/permissions.ts diff --git a/v6/payloads/teams.ts b/payloads/v6/teams.ts similarity index 100% rename from v6/payloads/teams.ts rename to payloads/v6/teams.ts diff --git a/v6/payloads/user.ts b/payloads/v6/user.ts similarity index 100% rename from v6/payloads/user.ts rename to payloads/v6/user.ts diff --git a/v6/payloads/voice.ts b/payloads/v6/voice.ts similarity index 100% rename from v6/payloads/voice.ts rename to payloads/v6/voice.ts diff --git a/v6/payloads/webhook.ts b/payloads/v6/webhook.ts similarity index 100% rename from v6/payloads/webhook.ts rename to payloads/v6/webhook.ts diff --git a/v8/payloads/auditLog.ts b/payloads/v8/auditLog.ts similarity index 98% rename from v8/payloads/auditLog.ts rename to payloads/v8/auditLog.ts index d82a2169..1ffe7d5a 100644 --- a/v8/payloads/auditLog.ts +++ b/payloads/v8/auditLog.ts @@ -2,7 +2,7 @@ * Types extracted from https://discord.com/developers/docs/resources/audit-log */ -import type { Snowflake } from '../../common/index'; +import type { Snowflake } from '../../globals'; import type { APIOverwrite, ChannelType } from './channel'; import type { APIGuildIntegration, @@ -63,8 +63,7 @@ export interface APIAuditLogEntry { /** * The user who made the changes * - * *Against all odds, this can be `null` in some cases (webhooks deleting themselves - * by using their own token, for example)* + * This can be `null` in some cases (webhooks deleting themselves by using their own token, for example) */ user_id: Snowflake | null; /** diff --git a/v8/payloads/channel.ts b/payloads/v8/channel.ts similarity index 97% rename from v8/payloads/channel.ts rename to payloads/v8/channel.ts index c8f7e206..538abec9 100644 --- a/v8/payloads/channel.ts +++ b/payloads/v8/channel.ts @@ -2,10 +2,11 @@ * Types extracted from https://discord.com/developers/docs/resources/channel */ -import type { Permissions, Snowflake } from '../../common/index'; +import type { Permissions, Snowflake } from '../../globals'; import type { APIPartialEmoji } from './emoji'; import type { APIGuildMember } from './guild'; import type { APIMessageInteraction } from './interactions'; +import { APIApplication } from './oauth2'; import type { APIRole } from './permissions'; import type { APIUser } from './user'; @@ -34,7 +35,7 @@ export interface APIPartialChannel { */ export interface APIChannel extends APIPartialChannel { /** - * The id of the guild + * The id of the guild (may be missing for some channel objects received over gateway guild dispatches) */ guild_id?: Snowflake; /** @@ -271,7 +272,7 @@ export interface APIMessage { */ reactions?: APIReaction[]; /** - * Used for validating a message was sent + * A nonce that can be used for optimistic message sending (up to 25 characters) * * **You will not receive this from further fetches. This is received only once from a `MESSAGE_CREATE` * event to ensure it got sent** @@ -302,7 +303,7 @@ export interface APIMessage { * * See https://discord.com/developers/docs/resources/channel#message-object-message-application-structure */ - application?: APIMessageApplication; + application?: Partial; /** * Reference data sent with crossposted messages and replies * @@ -387,32 +388,6 @@ export interface APIMessageActivity { party_id?: string; } -/** - * https://discord.com/developers/docs/resources/channel#message-object-message-application-structure - */ -export interface APIMessageApplication { - /** - * ID of the application - */ - id: Snowflake; - /** - * ID of the embed's image asset - */ - cover_image?: string; - /** - * Application's description - */ - description: string; - /** - * ID of the application's icon - */ - icon: string | null; - /** - * Name of the application - */ - name: string; -} - /** * https://discord.com/developers/docs/resources/channel#message-object-message-reference-structure */ @@ -864,6 +839,12 @@ export interface APIAttachment { * Name of file attached */ filename: string; + /** + * The attachment's media type + * + * See https://en.wikipedia.org/wiki/Media_type + */ + content_type?: string; /** * Size of file in bytes */ diff --git a/v8/payloads/emoji.ts b/payloads/v8/emoji.ts similarity index 94% rename from v8/payloads/emoji.ts rename to payloads/v8/emoji.ts index c3418db5..3db04800 100644 --- a/v8/payloads/emoji.ts +++ b/payloads/v8/emoji.ts @@ -2,7 +2,7 @@ * Types extracted from https://discord.com/developers/docs/resources/emoji */ -import type { Snowflake } from '../../common/index'; +import type { Snowflake } from '../../globals'; import type { APIRole } from './permissions'; import type { APIUser } from './user'; diff --git a/v8/payloads/gateway.ts b/payloads/v8/gateway.ts similarity index 96% rename from v8/payloads/gateway.ts rename to payloads/v8/gateway.ts index 24597c0d..6d3705dc 100644 --- a/v8/payloads/gateway.ts +++ b/payloads/v8/gateway.ts @@ -2,7 +2,7 @@ * Types extracted from https://discord.com/developers/docs/topics/gateway */ -import type { Snowflake } from '../../common/index'; +import type { Snowflake } from '../../globals'; import type { APIEmoji } from './emoji'; import type { APIUser } from './user'; @@ -201,6 +201,9 @@ export interface GatewayActivity { * See https://en.wikipedia.org/wiki/Bit_field */ flags?: ActivityFlags; + /** + * The custom buttons shown in the Rich Presence (max 2) + */ buttons?: string[] | GatewayActivityButton[]; } @@ -298,6 +301,12 @@ export const enum ActivityFlags { } export interface GatewayActivityButton { + /** + * The text shown on the button (1-32 characters) + */ label: string; + /** + * The url opened when clicking the button (1-512 characters) + */ url: string; } diff --git a/v8/payloads/guild.ts b/payloads/v8/guild.ts similarity index 99% rename from v8/payloads/guild.ts rename to payloads/v8/guild.ts index 57fc5348..80f44783 100644 --- a/v8/payloads/guild.ts +++ b/payloads/v8/guild.ts @@ -2,7 +2,7 @@ * Types extracted from https://discord.com/developers/docs/resources/guild */ -import type { Permissions, Snowflake } from '../../common/index'; +import type { Permissions, Snowflake } from '../../globals'; import type { APIChannel } from './channel'; import type { APIEmoji } from './emoji'; import type { GatewayPresenceUpdate, PresenceUpdateStatus } from './gateway'; @@ -807,6 +807,10 @@ export interface APIGuildWelcomeScreenChannel { * The channel id that is suggested */ channel_id: Snowflake; + /** + * The description shown for the channel + */ + description: string; /** * The emoji id of the emoji that is shown on the left of the channel */ diff --git a/v8/payloads/index.ts b/payloads/v8/index.ts similarity index 100% rename from v8/payloads/index.ts rename to payloads/v8/index.ts diff --git a/v8/payloads/interactions.ts b/payloads/v8/interactions.ts similarity index 80% rename from v8/payloads/interactions.ts rename to payloads/v8/interactions.ts index 3ec9fffb..d7a2cdba 100644 --- a/v8/payloads/interactions.ts +++ b/payloads/v8/interactions.ts @@ -1,16 +1,37 @@ -import type { Permissions, Snowflake } from '../../common/index'; -import type { RESTPostAPIWebhookWithTokenJSONBody } from '../rest/index'; +import type { Permissions, Snowflake } from '../../globals'; +import type { RESTPostAPIWebhookWithTokenJSONBody } from '../../rest/v8/index'; import type { APIGuildMember, APIPartialChannel, APIRole, APIUser, MessageFlags } from './index'; /** * https://discord.com/developers/docs/interactions/slash-commands#applicationcommand */ export interface APIApplicationCommand { + /** + * Unique id of the command + */ id: Snowflake; + /** + * Unique id of the parent application + */ application_id: Snowflake; + /** + * 1-32 character name matching `^[\w-]{1,32}$` + */ name: string; + /** + * 1-100 character description + */ description: string; + /** + * The parameters for the command + */ options?: APIApplicationCommandOption[]; + /** + * Whether the command is enabled by default when the app is added to a guild + * + * If missing, this property should be assumed as `true` + */ + default_permissions?: boolean; } interface APIApplicationCommandOptionBase { @@ -114,6 +135,11 @@ export interface APIBaseInteraction { * https://discord.com/developers/docs/interactions/slash-commands#interaction */ export interface APIGuildInteraction extends APIBaseInteraction { + /** + * The guild it was sent from + * + * In the case of an `APIDMInteraction`, this will not be present + */ guild_id: Snowflake; /** * Guild member data for the invoking user, including permissions @@ -126,12 +152,6 @@ export interface APIGuildInteraction extends APIBaseInteraction { * https://discord.com/developers/docs/interactions/slash-commands#interaction */ export interface APIDMInteraction extends APIBaseInteraction { - /** - * The guild it was sent from - * - * In the case of an `APIDMInteraction`, this will not be present - */ - guild_id?: never; /** * User object for the invoking user, if invoked in a DM */ @@ -145,9 +165,27 @@ export interface APIDMInteraction extends APIBaseInteraction { export type APIInteraction = APIGuildInteraction | APIDMInteraction; /** - * Like APIInteraction, only with the `data` property always present + * Like APIGuildInteraction, only with the `data` property always present + * + * @see APIGuildInteraction */ -export type APIApplicationCommandInteraction = Required; +export type APIApplicationCommandGuildInteraction = Required; + +/** + * Like APIDMInteraction, only with the `data` property always present + * + * @see APIDMInteraction + */ +export type APIApplicationCommandDMInteraction = Required; + +/** + * Like APIInteraction, only with the `data` property always present + * + * @see APIInteraction + */ +export type APIApplicationCommandInteraction = + | APIApplicationCommandGuildInteraction + | APIApplicationCommandDMInteraction; /** * https://discord.com/developers/docs/interactions/slash-commands#interaction-interactiontype @@ -157,6 +195,54 @@ export const enum InteractionType { ApplicationCommand, } +/** + * https://discord.com/developers/docs/interactions/slash-commands#guildapplicationcommandpermissions + */ +export interface APIGuildApplicationCommandPermissions { + /** + * The id of the command + */ + id: Snowflake; + /** + * The id of the application the command belongs to + */ + application_id: Snowflake; + /** + * The id of the guild + */ + guild_id: Snowflake; + /** + * The permissions for the command in the guild + */ + permissions: APIApplicationCommandPermission[]; +} + +/** + * https://discord.com/developers/docs/interactions/slash-commands#applicationcommandpermissions + */ +export interface APIApplicationCommandPermission { + /** + * The id of the role or user + */ + id: Snowflake; + /** + * Role or user + */ + type: ApplicationCommandPermissionType; + /** + * `true` to allow, `false`, to disallow + */ + permission: boolean; +} + +/** + * https://discord.com/developers/docs/interactions/slash-commands#applicationcommandpermissiontype + */ +export const enum ApplicationCommandPermissionType { + ROLE = 1, + USER, +} + /** * https://discord.com/developers/docs/interactions/slash-commands#interaction-applicationcommandinteractiondata */ diff --git a/v8/payloads/invite.ts b/payloads/v8/invite.ts similarity index 74% rename from v8/payloads/invite.ts rename to payloads/v8/invite.ts index eba1d409..cb5cab68 100644 --- a/v8/payloads/invite.ts +++ b/payloads/v8/invite.ts @@ -4,6 +4,7 @@ import type { APIPartialChannel } from './channel'; import type { APIPartialGuild } from './guild'; +import type { APIApplication } from './oauth2'; import type { APIUser } from './user'; /** @@ -33,23 +34,27 @@ export interface APIInvite { */ inviter?: APIUser; /** - * The target user for this invite + * The type of user target for this voice channel invite + * + * See https://discord.com/developers/docs/resources/invite#invite-object-target-user-types + */ + target_type?: InviteTargetUserType; + /** + * The user whose stream to display for this voice channel stream invite * * See https://discord.com/developers/docs/resources/user#user-object */ target_user?: APIUser; /** - * The type of user target for this invite - * - * See https://discord.com/developers/docs/resources/invite#invite-object-target-user-types + * The embedded application to open for this voice channel embedded application invite */ - target_user_type?: InviteTargetUserType; + target_application?: Partial; /** - * Approximate count of online members (only present when `target_user` is set) + * Approximate count of online members, returned from the `GET /invites/` endpoint when `with_counts` is `true` */ approximate_presence_count?: number; /** - * Approximate count of total members + * Approximate count of total members, returned from the `GET /invites/` endpoint when `with_counts` is `true` */ approximate_member_count?: number; } @@ -59,6 +64,7 @@ export interface APIInvite { */ export const enum InviteTargetUserType { STREAM = 1, + EMBEDDED_APPLICATION, } /** diff --git a/v8/payloads/oauth2.ts b/payloads/v8/oauth2.ts similarity index 94% rename from v8/payloads/oauth2.ts rename to payloads/v8/oauth2.ts index 103def75..a0a45bb2 100644 --- a/v8/payloads/oauth2.ts +++ b/payloads/v8/oauth2.ts @@ -2,7 +2,7 @@ * Types extracted from https://discord.com/developers/docs/topics/oauth2 */ -import type { Snowflake } from '../../common/index'; +import type { Snowflake } from '../../globals'; import type { APITeam } from './teams'; import type { APIUser } from './user'; @@ -38,6 +38,14 @@ export interface APIApplication { * When `true` the app's bot will only join upon completion of the full oauth2 code grant flow */ bot_require_code_grant: boolean; + /** + * The url of the application's terms of service + */ + terms_of_service_url?: string; + /** + * The url of the application's privacy policy + */ + privacy_policy_url?: string; /** * Partial user object containing info on the owner of the application * @@ -50,7 +58,7 @@ export interface APIApplication { */ summary: string; /** - * The base64 encoded key for the GameSDK's GetTicket + * The hexadecimal encoded key for verification in interactions and the GameSDK's GetTicket function * * See https://discord.com/developers/docs/game-sdk/applications#get-ticket */ @@ -88,7 +96,7 @@ export const enum ApplicationFlags { GroupDMCreate = 1 << 4, RPCHasConnected = 1 << 11, GatewayPresence = 1 << 12, - GatewayPresenceLimit = 1 << 13, + GatewayPresenceLimited = 1 << 13, GatewayGuildMembers = 1 << 14, GatewayGuildMembersLimited = 1 << 15, VerificationPendingGuildLimit = 1 << 16, @@ -148,10 +156,6 @@ export const enum OAuth2Scopes { * For local rpc server access, this allows you to control a user's local Discord client - whitelist only */ RPC = 'rpc', - /** - * For local rpc server api access, this allows you to access the API as the local user - whitelist only - */ - RPCApi = 'rpc.api', /** * For local rpc server api access, this allows you to receive notifications pushed out to the user - whitelist only */ diff --git a/deno/v8/payloads/permissions.ts b/payloads/v8/permissions.ts similarity index 96% rename from deno/v8/payloads/permissions.ts rename to payloads/v8/permissions.ts index 7a0517c6..07f11be0 100644 --- a/deno/v8/payloads/permissions.ts +++ b/payloads/v8/permissions.ts @@ -2,7 +2,7 @@ * Types extracted from https://discord.com/developers/docs/topics/permissions */ -import type { Permissions, Snowflake } from '../../common/mod.ts'; +import type { Permissions, Snowflake } from '../../globals'; /** * https://discord.com/developers/docs/topics/permissions#permissions-bitwise-permission-flags @@ -43,7 +43,7 @@ export const PermissionFlagsBits = { MANAGE_ROLES: 1n << 28n, MANAGE_WEBHOOKS: 1n << 29n, MANAGE_EMOJIS: 1n << 30n, - USE_APPLICATION_COMMANDS: 1n << 31n, + USE_SLASH_COMMANDS: 1n << 31n, REQUEST_TO_SPEAK: 1n << 32n, } as const; diff --git a/v8/payloads/teams.ts b/payloads/v8/teams.ts similarity index 96% rename from v8/payloads/teams.ts rename to payloads/v8/teams.ts index 8bc09f28..d2d7f7dc 100644 --- a/v8/payloads/teams.ts +++ b/payloads/v8/teams.ts @@ -2,7 +2,7 @@ * Types extracted from https://discord.com/developers/docs/topics/teams */ -import type { Snowflake } from '../../common/index'; +import type { Snowflake } from '../../globals'; import type { APIUser } from './user'; /** diff --git a/v8/payloads/template.ts b/payloads/v8/template.ts similarity index 91% rename from v8/payloads/template.ts rename to payloads/v8/template.ts index 544ee4b0..98e56e09 100644 --- a/v8/payloads/template.ts +++ b/payloads/v8/template.ts @@ -2,8 +2,8 @@ * Types extracted from https://discord.com/developers/docs/resources/template */ -import type { Snowflake } from '../../common/index'; -import type { RESTPostAPIGuildsJSONBody } from '../rest/index'; +import type { Snowflake } from '../../globals'; +import type { RESTPostAPIGuildsJSONBody } from '../../rest/v8/index'; import type { APIUser } from './user'; /** diff --git a/v8/payloads/user.ts b/payloads/v8/user.ts similarity index 97% rename from v8/payloads/user.ts rename to payloads/v8/user.ts index 452237f2..15b1914e 100644 --- a/v8/payloads/user.ts +++ b/payloads/v8/user.ts @@ -2,7 +2,7 @@ * Types extracted from https://discord.com/developers/docs/resources/user */ -import type { Snowflake } from '../../common/index'; +import type { Snowflake } from '../../globals'; import type { APIGuildIntegration } from './guild'; /** @@ -85,7 +85,6 @@ export const enum UserFlags { HypeSquadHouseBalance = 1 << 8, EarlySupporter = 1 << 9, TeamUser = 1 << 10, - System = 1 << 12, BugHunterLevel2 = 1 << 14, VerifiedBot = 1 << 16, EarlyVerifiedBotDeveloper = 1 << 17, diff --git a/v8/payloads/voice.ts b/payloads/v8/voice.ts similarity index 97% rename from v8/payloads/voice.ts rename to payloads/v8/voice.ts index c65a3467..4e7d68ce 100644 --- a/v8/payloads/voice.ts +++ b/payloads/v8/voice.ts @@ -2,7 +2,7 @@ * Types extracted from https://discord.com/developers/docs/resources/voice */ -import type { Snowflake } from '../../common/index'; +import type { Snowflake } from '../../globals'; import type { APIGuildMember } from './guild'; /** diff --git a/v8/payloads/webhook.ts b/payloads/v8/webhook.ts similarity index 80% rename from v8/payloads/webhook.ts rename to payloads/v8/webhook.ts index 6d90857e..b63549d7 100644 --- a/v8/payloads/webhook.ts +++ b/payloads/v8/webhook.ts @@ -2,7 +2,7 @@ * Types extracted from https://discord.com/developers/docs/resources/webhook */ -import type { Snowflake } from '../../common/index'; +import type { Snowflake } from '../../globals'; import type { APIPartialChannel, APIPartialGuild, APIUser } from './index'; /** @@ -49,8 +49,18 @@ export interface APIWebhook { * The bot/OAuth2 application that created this webhook */ application_id: Snowflake | null; + /** + * The guild of the channel that this webhook is following (returned for Channel Follower Webhooks) + */ source_guild?: APIPartialGuild; + /** + * The channel that this webhook is following (returned for Channel Follower Webhooks) + */ source_channel?: APIPartialChannel; + /** + * The url used for executing the webhook (returned by the webhooks OAuth2 flow) + */ + url?: string; } export const enum WebhookType { diff --git a/rest/common.ts b/rest/common.ts new file mode 100644 index 00000000..a7138a35 --- /dev/null +++ b/rest/common.ts @@ -0,0 +1,112 @@ +/** + * https://discord.com/developers/docs/topics/opcodes-and-status-codes#json-json-error-codes + */ +export const enum RESTJSONErrorCodes { + GeneralError, + + UnknownAccount = 10001, + UnknownApplication, + UnknownChannel, + UnknownGuild, + UnknownIntegration, + UnknownInvite, + UnknownMember, + UnknownMessage, + UnknownPermissionOverwrite, + UnknownProvider, + UnknownRole, + UnknownToken, + UnknownUser, + UnknownEmoji, + UnknownWebhook, + + UnknownBan = 10026, + UnknownSKU, + UnknownStoreListing, + UnknownEntitlement, + UnknownBuild, + UnknownLobby, + UnknownBranch, + + UnknownRedistributable = 10036, + + UnknownGuildTemplate = 10057, + + UnknownApplicationCommand = 10063, + + BotsCannotUseThisEndpoint = 20001, + OnlyBotsCanUseThisEndpoint, + + AnnouncementEditLimitExceeded = 20022, + + ChannelSendRateLimit = 20028, + + MaximumNumberOfGuildsReached = 30001, + MaximumNumberOfFriendsReached, + MaximumNumberOfPinsReachedForTheChannel, + + MaximumNumberOfGuildRolesReached = 30005, + + MaximumNumberOfWebhooksReached = 30007, + + MaximumNumberOfReactionsReached = 30010, + + MaximumNumberOfGuildChannelsReached = 30013, + + MaximumNumberOfAttachmentsInAMessageReached = 30015, + MaximumNumberOfInvitesReached, + + GuildAlreadyHasTemplate = 30031, + + Unauthorized = 40001, + VerifyYourAccount, + + RequestEntityTooLarge = 40005, + FeatureTemporarilyDisabledServerSide, + UserBannedFromThisGuild, + + ThisMessageWasAlreadyCrossposted = 40033, + + MissingAccess = 50001, + InvalidAccountType, + CannotExecuteActionOnDMChannel, + GuildWidgetDisabled, + CannotEditMessageAuthoredByAnotherUser, + CannotSendAnEmptyMessage, + CannotSendMessagesToThisUser, + CannotSendMessagesInVoiceChannel, + ChannelVerificationLevelTooHighForYouToGainAccess, + Oauth2ApplicationDoesNotHaveBot, + Oauth2ApplicationLimitReached, + InvalidOauth2State, + MissingPermissions, + InvalidToken, + NoteWasTooLong, + ProvidedTooFewOrTooManyMessagesToDelete, + + MessageCanOnlyBePinnedInTheChannelItWasSentIn = 50019, + InviteCodeInvalidOrTaken, + CannotExecuteActionOnSystemMessage, + + CannotExecuteActionOnThisChannelType = 50024, + InvalidOauth2AccessToken, + + InvalidWebhookToken = 50027, + + InvalidRecipients = 50033, + OneOfTheMessagesProvidedWasTooOldForBulkDelete, + InvalidFormBodyOrContentType, + InviteAcceptedToGuildWithoutTheBotBeingIn, + + InvalidAPIVersion = 50041, + + CannotDeleteChannelRequiredForCommunityGuilds = 50074, + + InvalidStickerSent = 50081, + + TwoFactorAuthenticationIsRequired = 60003, + + ReactionWasBlocked = 90001, + + APIResourceOverloaded = 130000, +} diff --git a/rest/index.ts b/rest/index.ts new file mode 100644 index 00000000..d1dccbf4 --- /dev/null +++ b/rest/index.ts @@ -0,0 +1,4 @@ +// This file exports all the types available in the recommended API version +// Thereby, things MAY break in the future. Try sticking to imports from a specific version + +export * from './v8/index'; diff --git a/deno/v6/rest/auditLog.ts b/rest/v6/auditLog.ts similarity index 86% rename from deno/v6/rest/auditLog.ts rename to rest/v6/auditLog.ts index 61dde45a..91014a38 100644 --- a/deno/v6/rest/auditLog.ts +++ b/rest/v6/auditLog.ts @@ -1,4 +1,4 @@ -import type { APIAuditLog, AuditLogEvent } from '../payloads/auditLog.ts'; +import type { APIAuditLog, AuditLogEvent } from '../../payloads/v6/auditLog'; /** * https://discord.com/developers/docs/resources/audit-log#get-guild-audit-log diff --git a/v6/rest/channel.ts b/rest/v6/channel.ts similarity index 99% rename from v6/rest/channel.ts rename to rest/v6/channel.ts index f3783ad5..557b2ff1 100644 --- a/v6/rest/channel.ts +++ b/rest/v6/channel.ts @@ -11,7 +11,7 @@ import type { InviteTargetUserType, MessageFlags, OverwriteType, -} from '../payloads/index'; +} from '../../payloads/v6/index'; // #region TypeDefs diff --git a/deno/v6/rest/emoji.ts b/rest/v6/emoji.ts similarity index 96% rename from deno/v6/rest/emoji.ts rename to rest/v6/emoji.ts index 91abcb76..6a06c81c 100644 --- a/deno/v6/rest/emoji.ts +++ b/rest/v6/emoji.ts @@ -1,4 +1,4 @@ -import type { APIEmoji } from '../payloads/mod.ts'; +import type { APIEmoji } from '../../payloads/v6/index'; /** * https://discord.com/developers/docs/resources/emoji#list-guild-emojis diff --git a/v6/rest/gateway.ts b/rest/v6/gateway.ts similarity index 85% rename from v6/rest/gateway.ts rename to rest/v6/gateway.ts index 6cf2aba8..945acf4f 100644 --- a/v6/rest/gateway.ts +++ b/rest/v6/gateway.ts @@ -1,4 +1,4 @@ -import type { APIGatewayBotInfo, APIGatewayInfo } from '../payloads/index'; +import type { APIGatewayBotInfo, APIGatewayInfo } from '../../payloads/v6/index'; /** * https://discord.com/developers/docs/topics/gateway#get-gateway diff --git a/v6/rest/guild.ts b/rest/v6/guild.ts similarity index 99% rename from v6/rest/guild.ts rename to rest/v6/guild.ts index d6b0f8a1..43ce4f7d 100644 --- a/v6/rest/guild.ts +++ b/rest/v6/guild.ts @@ -15,7 +15,7 @@ import type { GuildVerificationLevel, GuildWidgetStyle, IntegrationExpireBehavior, -} from '../payloads/index'; +} from '../../payloads/v6/index'; import type { RESTPutAPIChannelPermissionsJSONBody } from './channel'; /** diff --git a/v6/rest/index.ts b/rest/v6/index.ts similarity index 99% rename from v6/rest/index.ts rename to rest/v6/index.ts index dd95d2be..cdd4a580 100644 --- a/v6/rest/index.ts +++ b/rest/v6/index.ts @@ -1,3 +1,5 @@ +export * from '../common'; + export * from './auditLog'; export * from './channel'; export * from './emoji'; diff --git a/v6/rest/invite.ts b/rest/v6/invite.ts similarity index 91% rename from v6/rest/invite.ts rename to rest/v6/invite.ts index 658f6d33..8b84814e 100644 --- a/v6/rest/invite.ts +++ b/rest/v6/invite.ts @@ -1,4 +1,4 @@ -import type { APIInvite } from '../payloads/index'; +import type { APIInvite } from '../../payloads/v6/index'; /** * https://discord.com/developers/docs/resources/invite#get-invite diff --git a/deno/v6/rest/oauth2.ts b/rest/v6/oauth2.ts similarity index 98% rename from deno/v6/rest/oauth2.ts rename to rest/v6/oauth2.ts index a535190f..4115ce31 100644 --- a/deno/v6/rest/oauth2.ts +++ b/rest/v6/oauth2.ts @@ -1,4 +1,4 @@ -import type { APIApplication, APIGuild, APIWebhook } from '../payloads/mod.ts'; +import type { APIApplication, APIGuild, APIWebhook } from '../../payloads/v6/index'; /** * https://discord.com/developers/docs/topics/oauth2#get-current-application-information diff --git a/v6/rest/user.ts b/rest/v6/user.ts similarity index 98% rename from v6/rest/user.ts rename to rest/v6/user.ts index 19b716c1..a1b6837f 100644 --- a/v6/rest/user.ts +++ b/rest/v6/user.ts @@ -1,4 +1,4 @@ -import type { APIChannel, APIConnection, APIUser, GuildFeature } from '../payloads/index'; +import type { APIChannel, APIConnection, APIUser, GuildFeature } from '../../payloads/v6/index'; /** * https://discord.com/developers/docs/resources/user#get-current-user diff --git a/v6/rest/voice.ts b/rest/v6/voice.ts similarity index 79% rename from v6/rest/voice.ts rename to rest/v6/voice.ts index f0201adb..106af953 100644 --- a/v6/rest/voice.ts +++ b/rest/v6/voice.ts @@ -1,4 +1,4 @@ -import type { APIVoiceRegion } from '../payloads/index'; +import type { APIVoiceRegion } from '../../payloads/v6/index'; /** * https://discord.com/developers/docs/resources/voice#list-voice-regions diff --git a/v6/rest/webhook.ts b/rest/v6/webhook.ts similarity index 98% rename from v6/rest/webhook.ts rename to rest/v6/webhook.ts index e96a3a7f..a3bda4f1 100644 --- a/v6/rest/webhook.ts +++ b/rest/v6/webhook.ts @@ -1,5 +1,5 @@ import type { APIAllowedMentionsSend } from './channel'; -import type { APIEmbed, APIMessage, APIWebhook } from '../payloads/index'; +import type { APIEmbed, APIMessage, APIWebhook } from '../../payloads/v6/index'; /** * https://discord.com/developers/docs/resources/webhook#create-webhook diff --git a/v8/rest/auditLog.ts b/rest/v8/auditLog.ts similarity index 80% rename from v8/rest/auditLog.ts rename to rest/v8/auditLog.ts index 70b006c0..adfc441f 100644 --- a/v8/rest/auditLog.ts +++ b/rest/v8/auditLog.ts @@ -1,5 +1,5 @@ -import type { Snowflake } from '../../common/index'; -import type { APIAuditLog, AuditLogEvent } from '../payloads/auditLog'; +import type { Snowflake } from '../../globals'; +import type { APIAuditLog, AuditLogEvent } from '../../payloads/v8/auditLog'; /** * https://discord.com/developers/docs/resources/audit-log#get-guild-audit-log diff --git a/v8/rest/channel.ts b/rest/v8/channel.ts similarity index 95% rename from v8/rest/channel.ts rename to rest/v8/channel.ts index 0430442f..0a1bb6e7 100644 --- a/v8/rest/channel.ts +++ b/rest/v8/channel.ts @@ -1,4 +1,4 @@ -import type { Permissions, Snowflake } from '../../common/index'; +import type { Permissions, Snowflake } from '../../globals'; import type { APIAllowedMentions, APIChannel, @@ -14,7 +14,7 @@ import type { MessageFlags, OverwriteType, VideoQualityMode, -} from '../payloads/index'; +} from '../../payloads/v8/index'; /** * https://discord.com/developers/docs/resources/channel#get-channel @@ -246,10 +246,6 @@ export type RESTDeleteAPIChannelMessageUserReactionResult = never; * https://discord.com/developers/docs/resources/channel#get-reactions */ export interface RESTGetAPIChannelMessageReactionUsersQuery { - /** - * Get users before this user ID - */ - before?: Snowflake; /** * Get users after this user ID */ @@ -389,13 +385,21 @@ export interface RESTPostAPIChannelInviteJSONBody { */ unique?: boolean; /** - * The target user id for this invite + * The type of target user for this voice channel invite */ - target_user_id?: string; + target_type?: InviteTargetUserType; /** - * The type of target user for this invite + * The id of the user whose stream to display for this invite + * - Required if `target_type` is 1 + * - The user must be streaming in the channel */ - target_user_type?: InviteTargetUserType; + target_user_id?: Snowflake; + /** + * The id of the embedded application to open for this invite + * - Required if `target_type` is 2 + * - The application must have the `EMBEDDED` flag + */ + target_application_id?: Snowflake; } /** diff --git a/v8/rest/emoji.ts b/rest/v8/emoji.ts similarity index 92% rename from v8/rest/emoji.ts rename to rest/v8/emoji.ts index 9c895fd9..718080cf 100644 --- a/v8/rest/emoji.ts +++ b/rest/v8/emoji.ts @@ -1,5 +1,5 @@ -import type { Snowflake } from '../../common/index'; -import type { APIEmoji } from '../payloads/index'; +import type { Snowflake } from '../../globals'; +import type { APIEmoji } from '../../payloads/v8/index'; /** * https://discord.com/developers/docs/resources/emoji#list-guild-emojis diff --git a/v8/rest/gateway.ts b/rest/v8/gateway.ts similarity index 76% rename from v8/rest/gateway.ts rename to rest/v8/gateway.ts index fa0fa720..85423c2a 100644 --- a/v8/rest/gateway.ts +++ b/rest/v8/gateway.ts @@ -1,4 +1,4 @@ -import type { APIGatewayBotInfo, APIGatewayInfo } from '../payloads/index'; +import type { APIGatewayBotInfo, APIGatewayInfo } from '../../payloads/v8/index'; /** * https://discord.com/developers/docs/topics/gateway#get-gateway diff --git a/v8/rest/guild.ts b/rest/v8/guild.ts similarity index 94% rename from v8/rest/guild.ts rename to rest/v8/guild.ts index f943a68c..b3522f3a 100644 --- a/v8/rest/guild.ts +++ b/rest/v8/guild.ts @@ -1,4 +1,4 @@ -import type { Permissions, Snowflake } from '../../common/index'; +import type { Permissions, Snowflake } from '../../globals'; import type { APIBan, APIChannel, @@ -8,6 +8,7 @@ import type { APIGuildMember, APIGuildMembershipScreening, APIGuildPreview, + APIGuildWelcomeScreen, APIGuildWidget, APIGuildWidgetSettings, APIRole, @@ -18,8 +19,7 @@ import type { GuildSystemChannelFlags, GuildVerificationLevel, GuildWidgetStyle, - IntegrationExpireBehavior, -} from '../payloads/index'; +} from '../../payloads/v8/index'; import type { RESTPutAPIChannelPermissionJSONBody } from './channel'; export interface APIGuildCreateOverwrite extends RESTPutAPIChannelPermissionJSONBody { @@ -330,6 +330,9 @@ export interface RESTGetAPIGuildMembersQuery { */ export type RESTGetAPIGuildMembersResult = APIGuildMember[]; +/** + * https://discord.com/developers/docs/resources/guild#search-guild-members + */ export interface RESTGetAPIGuildMembersSearchQuery { /** * Query string to match username(s) and nickname(s) against @@ -661,51 +664,11 @@ export type RESTGetAPIGuildInvitesResult = APIExtendedInvite[]; */ export type RESTGetAPIGuildIntegrationsResult = APIGuildIntegration[]; -/** - * https://discord.com/developers/docs/resources/guild#create-guild-integration - */ -export interface RESTPostAPIGuildIntegrationJSONBody { - type: string; - id: Snowflake; -} - -export type RESTPostAPIGuildIntegrationResult = never; - -/** - * https://discord.com/developers/docs/resources/guild#modify-guild-integration - */ -export interface RESTPatchAPIGuildIntegrationJSONBody { - /** - * The behavior when an integration subscription lapses - * - * See https://discord.com/developers/docs/resources/guild#integration-object-integration-expire-behaviors - */ - expire_behavior?: IntegrationExpireBehavior | null; - /** - * Period (in days) where the integration will ignore lapsed subscriptions - */ - expire_grace_period?: number | null; - /** - * Whether emoticons should be synced for this integration (`twitch` only currently) - */ - enable_emoticons?: boolean | null; -} - -/** - * https://discord.com/developers/docs/resources/guild#modify-guild-integration - */ -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-settings */ @@ -796,3 +759,22 @@ export interface RESTPatchAPIGuildVoiceStateUserJSONBody { */ suppress?: boolean; } + +/** + * https://discord.com/developers/docs/resources/guild#get-guild-welcome-screen + */ +export type RESTGetAPIGuildWelcomeScreenResult = APIGuildWelcomeScreen; + +/** + * https://discord.com/developers/docs/resources/guild#modify-guild-welcome-screen + */ +export interface RESTPatchAPIGuildWelcomeScreenJSONBody extends Nullable> { + /** + * Whether the welcome screen is enabled + */ + enabled?: boolean | null; +} + +type Nullable = { + [P in keyof T]: T[P] | null; +}; diff --git a/v8/rest/index.ts b/rest/v8/index.ts similarity index 93% rename from v8/rest/index.ts rename to rest/v8/index.ts index c7b2efd2..58b6ad80 100644 --- a/v8/rest/index.ts +++ b/rest/v8/index.ts @@ -1,4 +1,6 @@ -import type { Snowflake } from '../../common/index'; +import type { Snowflake } from '../../globals'; + +export * from '../common'; export * from './auditLog'; export * from './channel'; @@ -14,6 +16,7 @@ export * from './voice'; export * from './webhook'; export const APIVersion = '8'; + export const Routes = { /** * Route for: @@ -332,7 +335,6 @@ export const Routes = { /** * Route for: * - GET `/guilds/{guild.id}/integrations` - * - POST `/guilds/{guild.id}/integrations` */ guildIntegrations(guildID: Snowflake) { return `/guilds/${guildID}/integrations` as const; @@ -340,21 +342,12 @@ export const Routes = { /** * Route for: - * - PATCH `/guilds/{guild.id}/integrations/{integration.id}` * - DELETE `/guilds/{guild.id}/integrations/{integration.id}` */ guildIntegration(guildID: Snowflake, integrationID: Snowflake) { return `/guilds/${guildID}/integrations/${integrationID}` as const; }, - /** - * Route for: - * - POST `/guilds/{guild.id}/integrations/{integration.id}/sync` - */ - guildIntegrationSync(guildID: Snowflake, integrationID: Snowflake) { - return `/guilds/${guildID}/integrations/${integrationID}/sync` as const; - }, - /** * Route for: * - GET `/guilds/{guild.id}/widget` @@ -575,6 +568,7 @@ export const Routes = { /** * Route for: * - GET `/applications/{application.id}/commands` + * - PUT `/applications/{application.id}/commands` * - POST `/applications/{application.id}/commands` */ applicationCommands(applicationID: Snowflake) { @@ -594,6 +588,7 @@ export const Routes = { /** * Route for: * - GET `/applications/{application.id}/guilds/{guild.id}/commands` + * - PUT `/applications/{application.id}/guilds/{guild.id}/commands` * - POST `/applications/{application.id}/guilds/{guild.id}/commands` */ applicationGuildCommands(applicationID: Snowflake, guildID: Snowflake) { @@ -635,6 +630,33 @@ export const Routes = { guildVoiceState(guildID: Snowflake, userID: Snowflake | '@me' = '@me') { return `/guilds/${guildID}/voice-states/${userID}` as const; }, + + /** + * Route for: + * - GET `/applications/{application.id}/guilds/{guild.id}/commands/permissions` + * - PUT `/applications/{application.id}/guilds/{guild.id}/commands/permissions` + */ + guildApplicationCommandsPermissions(applicationID: Snowflake, guildID: Snowflake) { + return `/applications/${applicationID}/guilds/${guildID}/commands/permissions` as const; + }, + + /** + * Route for: + * - GET `/applications/{application.id}/guilds/{guild.id}/commands/{command.id}/permissions` + * - PUT `/applications/{application.id}/guilds/{guild.id}/commands/{command.id}/permissions` + */ + applicationCommandPermissions(applicationID: Snowflake, guildID: Snowflake, commandID: Snowflake) { + return `/applications/${applicationID}/guilds/${guildID}/commands/${commandID}/permissions` as const; + }, + + /** + * Route for: + * - GET `/guilds/{guild.id}/welcome-screen` + * - PATCH `/guilds/{guild.id}/welcome-screen` + */ + guildWelcomeScreen(guildID: Snowflake) { + return `/guilds/${guildID}/welcome-screen` as const; + }, }; export const RouteBases = { diff --git a/v8/rest/interactions.ts b/rest/v8/interactions.ts similarity index 55% rename from v8/rest/interactions.ts rename to rest/v8/interactions.ts index ac04e31b..bd342f59 100644 --- a/v8/rest/interactions.ts +++ b/rest/v8/interactions.ts @@ -1,4 +1,9 @@ -import type { APIApplicationCommand, APIInteractionResponse } from '../payloads/index'; +import type { + APIApplicationCommand, + APIApplicationCommandPermission, + APIGuildApplicationCommandPermissions, + APIInteractionResponse, +} from '../../payloads/v8/index'; /** * https://discord.com/developers/docs/interactions/slash-commands#get-global-application-commands @@ -30,6 +35,16 @@ export type RESTPatchAPIApplicationCommandJSONBody = Partial[]; + +/** + * https://discord.com/developers/docs/interactions/slash-commands#batch-edit-application-command-permissions + */ +export type RESTPutAPIGuildApplicationCommandsPermissionsResult = APIGuildApplicationCommandPermissions[]; diff --git a/v8/rest/invite.ts b/rest/v8/invite.ts similarity index 87% rename from v8/rest/invite.ts rename to rest/v8/invite.ts index 7da16a48..734dfecc 100644 --- a/v8/rest/invite.ts +++ b/rest/v8/invite.ts @@ -1,4 +1,4 @@ -import type { APIInvite } from '../payloads/index'; +import type { APIInvite } from '../../payloads/v8/index'; /** * https://discord.com/developers/docs/resources/invite#get-invite diff --git a/deno/v8/rest/oauth2.ts b/rest/v8/oauth2.ts similarity index 97% rename from deno/v8/rest/oauth2.ts rename to rest/v8/oauth2.ts index 0f339237..e8aa8d2f 100644 --- a/deno/v8/rest/oauth2.ts +++ b/rest/v8/oauth2.ts @@ -1,5 +1,5 @@ -import type { Permissions, Snowflake } from '../../common/mod.ts'; -import type { APIApplication, APIGuild, APIUser, APIWebhook, OAuth2Scopes } from '../payloads/mod.ts'; +import type { Permissions, Snowflake } from '../../globals'; +import type { APIApplication, APIGuild, APIUser, APIWebhook, OAuth2Scopes } from '../../payloads/v8/index'; /** * https://discord.com/developers/docs/topics/oauth2#get-current-application-information @@ -57,7 +57,6 @@ export interface RESTPostOAuth2AccessTokenURLEncodedData { grant_type: 'authorization_code'; code: string; redirect_uri?: string; - scope: string; } /** @@ -79,8 +78,6 @@ export interface RESTPostOAuth2RefreshTokenURLEncodedData { client_secret: string; grant_type: 'refresh_token'; refresh_token: string; - redirect_uri?: string; - scope: string; } export type RESTPostOAuth2RefreshTokenResult = RESTPostOAuth2AccessTokenResult; diff --git a/v8/rest/template.ts b/rest/v8/template.ts similarity index 96% rename from v8/rest/template.ts rename to rest/v8/template.ts index d5f4673f..b3a1aceb 100644 --- a/v8/rest/template.ts +++ b/rest/v8/template.ts @@ -1,4 +1,4 @@ -import type { APIGuild, APITemplate } from '../payloads/index'; +import type { APIGuild, APITemplate } from '../../payloads/v8/index'; /** * https://discord.com/developers/docs/resources/template#get-template diff --git a/v8/rest/user.ts b/rest/v8/user.ts similarity index 95% rename from v8/rest/user.ts rename to rest/v8/user.ts index 268bcc0a..81d8e9f3 100644 --- a/v8/rest/user.ts +++ b/rest/v8/user.ts @@ -1,5 +1,5 @@ -import type { Permissions, Snowflake } from '../../common/index'; -import type { APIChannel, APIConnection, APIUser, GuildFeature } from '../payloads/index'; +import type { Permissions, Snowflake } from '../../globals'; +import type { APIChannel, APIConnection, APIUser, GuildFeature } from '../../payloads/v8/index'; /** * https://discord.com/developers/docs/resources/user#get-current-user diff --git a/deno/v8/rest/voice.ts b/rest/v8/voice.ts similarity index 68% rename from deno/v8/rest/voice.ts rename to rest/v8/voice.ts index 4fabe2c4..1466f811 100644 --- a/deno/v8/rest/voice.ts +++ b/rest/v8/voice.ts @@ -1,4 +1,4 @@ -import type { APIVoiceRegion } from '../payloads/mod.ts'; +import type { APIVoiceRegion } from '../../payloads/v8/index'; /** * https://discord.com/developers/docs/resources/voice#list-voice-regions diff --git a/v8/rest/webhook.ts b/rest/v8/webhook.ts similarity index 95% rename from v8/rest/webhook.ts rename to rest/v8/webhook.ts index 98df6f88..ef30d6a6 100644 --- a/v8/rest/webhook.ts +++ b/rest/v8/webhook.ts @@ -1,5 +1,5 @@ -import type { Snowflake } from '../../common/index'; -import type { APIAllowedMentions, APIEmbed, APIMessage, APIWebhook } from '../payloads/index'; +import type { Snowflake } from '../../globals'; +import type { APIAllowedMentions, APIEmbed, APIMessage, APIWebhook } from '../../payloads/v8/index'; /** * https://discord.com/developers/docs/resources/webhook#create-webhook @@ -212,9 +212,21 @@ export type RESTPatchAPIWebhookWithTokenMessageJSONBody = Nullable< */ export type RESTPatchAPIWebhookWithTokenMessageFormDataBody = | { - payload_json: string; + /** + * JSON stringified message body + */ + payload_json?: string; + /** + * The file contents + */ + file: unknown; } - | RESTPatchAPIWebhookWithTokenMessageJSONBody; + | (RESTPatchAPIWebhookWithTokenMessageJSONBody & { + /** + * The file contents + */ + file: unknown; + }); /** * https://discord.com/developers/docs/resources/webhook#edit-webhook-message diff --git a/rpc/index.ts b/rpc/index.ts new file mode 100644 index 00000000..3c7abb25 --- /dev/null +++ b/rpc/index.ts @@ -0,0 +1,4 @@ +// This file exports all the types available in the recommended API version +// Thereby, things MAY break in the future. Try sticking to imports from a specific version + +export * from './v8'; diff --git a/rpc/v8.ts b/rpc/v8.ts new file mode 100644 index 00000000..89812d85 --- /dev/null +++ b/rpc/v8.ts @@ -0,0 +1,33 @@ +/** + * https://discord.com/developers/docs/topics/opcodes-and-status-codes#rpc-rpc-error-codes + */ +export const 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 const enum RPCCloseEventCodes { + InvalidClientID = 4000, + InvalidOrigin, + RateLimited, + TokenRevoked, + InvalidVersion, + InvalidEncoding, +} diff --git a/scripts/deno.mjs b/scripts/deno.mjs index 5b94bea3..ee467898 100644 --- a/scripts/deno.mjs +++ b/scripts/deno.mjs @@ -1,5 +1,5 @@ /* eslint-disable @typescript-eslint/restrict-template-expressions */ -import { copyFile, mkdir, opendir, readFile, rm, writeFile } from 'fs/promises'; +import { copyFile, mkdir, opendir, readFile, rm, writeFile } from 'node:fs/promises'; const baseDirectory = new URL('../', import.meta.url); const denoPath = new URL('deno/', baseDirectory); @@ -71,15 +71,16 @@ async function adaptFolderToDeno(folderName, node = baseDirectory, deno = denoPa await Promise.all( [ - 'common/', // - 'v6/', - 'v8/', + 'gateway/', // + 'payloads/', + 'rest/', + 'rpc/', + 'shortcuts/', + 'utils/', + 'voice/', ].map((item) => adaptFolderToDeno(item)), ); await Promise.all( - [ - 'LICENSE', // - 'README.md', - ].map((item) => copyFile(new URL(item, baseDirectory), new URL(item, denoPath))), + ['LICENSE', 'README.md', 'globals.ts'].map((item) => copyFile(new URL(item, baseDirectory), new URL(item, denoPath))), ); diff --git a/scripts/versions.mjs b/scripts/versions.mjs new file mode 100644 index 00000000..e42a140d --- /dev/null +++ b/scripts/versions.mjs @@ -0,0 +1,35 @@ +import { exec } from 'node:child_process'; +import { promisify } from 'node:util'; + +const execAsync = promisify(exec); + +const fileToESMWrapperCall = (path, version) => + execAsync(`npx gen-esm-wrapper ./${path}/${version}.js ./${path}/${version}.mjs`); + +Promise.allSettled( + [ + 'v6', // + 'v8', + + // Voice + 'v4', + ] + .map((version) => [ + fileToESMWrapperCall('gateway', version), + fileToESMWrapperCall(`payloads/${version}`, 'index'), + fileToESMWrapperCall(`rest/${version}`, 'index'), + + // Voice + fileToESMWrapperCall('voice', version), + + // RPC + fileToESMWrapperCall('rpc', version), + + // Utils + fileToESMWrapperCall('utils', version), + + // Shortcuts + fileToESMWrapperCall('shortcuts', version), + ]) + .flat(), +); diff --git a/shortcuts/v6.ts b/shortcuts/v6.ts new file mode 100644 index 00000000..544d6b6b --- /dev/null +++ b/shortcuts/v6.ts @@ -0,0 +1,4 @@ +export * from '../globals'; +export * from '../gateway/v6'; +export * from '../payloads/v6/index'; +export * from '../rest/v6/index'; diff --git a/shortcuts/v8.ts b/shortcuts/v8.ts new file mode 100644 index 00000000..56999fa8 --- /dev/null +++ b/shortcuts/v8.ts @@ -0,0 +1,6 @@ +export * from '../globals'; +export * from '../gateway/v8'; +export * from '../payloads/v8/index'; +export * from '../rest/v8/index'; +export * from '../rpc/v8'; +export * as Utils from '../utils/v8'; diff --git a/tsconfig.eslint.json b/tsconfig.eslint.json index a2d2e825..f378f0b2 100644 --- a/tsconfig.eslint.json +++ b/tsconfig.eslint.json @@ -4,5 +4,16 @@ "allowJs": true, "checkJs": true }, - "include": ["common", "default", "v6", "v8", "scripts", "deno"] + "include": [ + "globals.ts", + "gateway/**/*.ts", + "payloads/**/*.ts", + "rest/**/*.ts", + "rpc/**/*.ts", + "shortcuts/**/*.ts", + "utils/**/*.ts", + "voice/**/*.ts", + "scripts", + "deno" + ] } diff --git a/tsconfig.json b/tsconfig.json index 7c259e86..8a1fc82a 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -11,9 +11,18 @@ "noUnusedLocals": true, "removeComments": false, "target": "ES2020", - "importsNotUsedAsValues": "error", + "importsNotUsedAsValues": "remove", "strictNullChecks": true, "preserveConstEnums": true }, - "include": ["v*/**/*", "default/**/*", "common/**/*"] + "include": [ + "globals.ts", + "gateway/**/*.ts", + "payloads/**/*.ts", + "rest/**/*.ts", + "rpc/**/*.ts", + "shortcuts/**/*.ts", + "utils/**/*.ts", + "voice/**/*.ts" + ] } diff --git a/utils/index.ts b/utils/index.ts new file mode 100644 index 00000000..e508a181 --- /dev/null +++ b/utils/index.ts @@ -0,0 +1,4 @@ +// This file exports all the utility functions available in the recommended API / Gateway version +// Thereby, things MAY break in the future. Try sticking to imports from a specific version + +export * from './v8'; diff --git a/utils/v8.ts b/utils/v8.ts new file mode 100644 index 00000000..6c39c076 --- /dev/null +++ b/utils/v8.ts @@ -0,0 +1,48 @@ +import { + APIApplicationCommandDMInteraction, + APIApplicationCommandGuildInteraction, + APIApplicationCommandInteraction, + APIDMInteraction, + APIGuildInteraction, + APIInteraction, +} from '../payloads/v8/index'; + +/** + * A type-guard check for guild interactions. + * @param interaction The interaction to check against the + * @returns A boolean that indicates if the interaction was received from a guild + */ +export function isGuildInteraction(interaction: APIInteraction): interaction is APIGuildInteraction { + return Reflect.has(interaction, 'guild_id'); +} + +/** + * A type-guard check for DM interactions. + * @param interaction The interaction to check against + * @returns A boolean that indicates if the interaction was received from a direct message + */ +export function isDMInteraction(interaction: APIInteraction): interaction is APIDMInteraction { + return !isGuildInteraction(interaction); +} + +/** + * A type-guard check for guild application command interactions. + * @param interaction The interaction to check against + * @returns A boolean that indicates if the command interaction was received from a guild + */ +export function isApplicationCommandGuildInteraction( + interaction: APIApplicationCommandInteraction, +): interaction is APIApplicationCommandGuildInteraction { + return isGuildInteraction(interaction); +} + +/** + * A type-guard check for direct message application command interactions. + * @param interaction The interaction to check against + * @returns A boolean that indicates if the command interaction was received from a direct message + */ +export function isApplicationCommandDMInteraction( + interaction: APIApplicationCommandInteraction, +): interaction is APIApplicationCommandDMInteraction { + return !isGuildInteraction(interaction); +} diff --git a/v6/index.ts b/v6/index.ts deleted file mode 100644 index fa07576b..00000000 --- a/v6/index.ts +++ /dev/null @@ -1,4 +0,0 @@ -export * from '../common/index'; -export * from './gateway/index'; -export * from './payloads/index'; -export * from './rest/index'; diff --git a/v8/index.ts b/v8/index.ts deleted file mode 100644 index fa07576b..00000000 --- a/v8/index.ts +++ /dev/null @@ -1,4 +0,0 @@ -export * from '../common/index'; -export * from './gateway/index'; -export * from './payloads/index'; -export * from './rest/index'; diff --git a/voice/index.ts b/voice/index.ts new file mode 100644 index 00000000..919f2b63 --- /dev/null +++ b/voice/index.ts @@ -0,0 +1,4 @@ +// This file exports all the types available in the recommended voice gateway version +// Thereby, things MAY break in the future. Try sticking to imports from a specific version + +export * from './v4'; diff --git a/voice/v4.ts b/voice/v4.ts new file mode 100644 index 00000000..4a2397d6 --- /dev/null +++ b/voice/v4.ts @@ -0,0 +1,109 @@ +export const VoiceGatewayVersion = '4'; + +/** + * https://discord.com/developers/docs/topics/opcodes-and-status-codes#voice-voice-opcodes + */ +export const enum VoiceOPCodes { + /** + * Begin a voice websocket connection + */ + Identify, + /** + * Select the voice protocol + */ + SelectProtocol, + /** + * Complete the websocket handshake + */ + Ready, + /** + * Keep the websocket connection alive + */ + Heartbeat, + /** + * Describe the session + */ + SessionDescription, + /** + * Indicate which users are speaking + */ + Speaking, + /** + * Sent to acknowledge a received client heartbeat + */ + HeartbeatAck, + /** + * Resume a connection + */ + Resume, + /** + * Time to wait between sending heartbeats in milliseconds + */ + Hello, + /** + * Acknowledge a successful session resume + */ + Resumed, + /** + * A client has connected to the voice channel + */ + ClientConnect = 12, + /** + * A client has disconnected from the voice channel + */ + ClientDisconnect, +} + +/** + * https://discord.com/developers/docs/topics/opcodes-and-status-codes#voice-voice-close-event-codes + */ +export const enum VoiceCloseCodes { + /** + * You sent an invalid opcode + */ + UnknownOpCode = 4001, + /** + * You sent a invalid payload in your identifying to the Gateway + */ + FailedToDecode, + /** + * You sent a payload before identifying with the Gateway + */ + NotAuthenticated, + /** + * The token you sent in your identify payload is incorrect + */ + AuthenticationFailed, + /** + * You sent more than one identify payload. Stahp + */ + AlreadyAuthenticated, + /** + * Your session is no longer valid + */ + SessionNoLongerValid, + /** + * Your session has timed out + */ + SessionTimeout = 4009, + /** + * We can't find the server you're trying to connect to + */ + ServerNotFound = 4011, + /** + * We didn't recognize the protocol you sent + */ + UnknownProtocol, + /** + * Either the channel was deleted, you were kicked, or the main gateway session was dropped. Should not reconnect + */ + Disconnected = 4014, + /** + * The server crashed. Our bad! Try resuming + */ + VoiceServerCrashed, + /** + * We didn't recognize your encryption + */ + UnknownEncryptionMode, +}