seyfert 4.4.1 → 4.6.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +7 -1
- package/lib/api/Routes/guilds.d.ts +12 -1
- package/lib/api/Routes/index.d.ts +3 -1
- package/lib/api/Routes/invites.d.ts +1 -1
- package/lib/api/Routes/oauth2.d.ts +11 -0
- package/lib/api/Routes/oauth2.js +2 -0
- package/lib/api/Routes/skus.d.ts +11 -4
- package/lib/api/Routes/users.d.ts +2 -1
- package/lib/api/Routes/voice.d.ts +4 -0
- package/lib/api/Routes/webhooks.d.ts +1 -1
- package/lib/api/api.d.ts +15 -5
- package/lib/api/api.js +243 -114
- package/lib/api/bucket.js +13 -7
- package/lib/api/shared.d.ts +3 -1
- package/lib/api/utils/constants.d.ts +1 -1
- package/lib/api/utils/constants.js +1 -1
- package/lib/builders/Attachment.d.ts +6 -1
- package/lib/builders/Attachment.js +13 -9
- package/lib/builders/CheckboxGroup.js +1 -1
- package/lib/builders/FileUpload.d.ts +8 -1
- package/lib/builders/FileUpload.js +9 -0
- package/lib/builders/RadioGroup.js +1 -1
- package/lib/client/base.d.ts +3 -3
- package/lib/client/client.d.ts +1 -1
- package/lib/client/client.js +5 -4
- package/lib/client/collectors.d.ts +10 -8
- package/lib/client/transformers.d.ts +5 -0
- package/lib/client/workerclient.d.ts +8 -1
- package/lib/client/workerclient.js +34 -14
- package/lib/commands/applications/chat.d.ts +6 -4
- package/lib/commands/applications/options.d.ts +6 -4
- package/lib/commands/applications/shared.d.ts +2 -2
- package/lib/commands/handle.d.ts +7 -3
- package/lib/commands/handle.js +36 -11
- package/lib/commands/handler.js +11 -0
- package/lib/commands/optionresolver.d.ts +6 -7
- package/lib/common/it/error.d.ts +13 -0
- package/lib/common/it/error.js +15 -1
- package/lib/common/it/logger.js +12 -9
- package/lib/common/shorters/application.d.ts +1 -1
- package/lib/common/shorters/application.js +1 -1
- package/lib/common/shorters/bans.js +1 -1
- package/lib/common/shorters/guilds.js +5 -1
- package/lib/common/shorters/interaction.js +7 -4
- package/lib/common/shorters/invites.d.ts +5 -0
- package/lib/common/shorters/members.js +2 -1
- package/lib/common/shorters/messages.js +2 -2
- package/lib/common/shorters/threads.js +1 -1
- package/lib/common/shorters/webhook.js +3 -3
- package/lib/common/types/util.d.ts +7 -0
- package/lib/components/componentcommand.js +2 -2
- package/lib/components/customId.d.ts +3 -0
- package/lib/components/customId.js +11 -0
- package/lib/components/handler.js +2 -3
- package/lib/components/modalcommand.js +2 -2
- package/lib/events/hooks/invite.d.ts +1 -0
- package/lib/events/hooks/presence.d.ts +1 -0
- package/lib/events/hooks/thread.d.ts +1 -0
- package/lib/index.d.ts +1 -1
- package/lib/index.js +2 -1
- package/lib/structures/AnonymousGuild.d.ts +1 -1
- package/lib/structures/AnonymousGuild.js +1 -1
- package/lib/structures/Guild.d.ts +3 -0
- package/lib/structures/GuildMember.d.ts +2 -2
- package/lib/structures/GuildMember.js +22 -4
- package/lib/structures/GuildPreview.d.ts +1 -1
- package/lib/structures/GuildPreview.js +1 -1
- package/lib/structures/GuildRole.d.ts +13 -0
- package/lib/structures/GuildRole.js +21 -0
- package/lib/structures/GuildTemplate.js +1 -1
- package/lib/structures/Interaction.d.ts +7 -7
- package/lib/structures/Interaction.js +35 -21
- package/lib/structures/Message.d.ts +2 -1
- package/lib/structures/channels.d.ts +29 -16
- package/lib/structures/channels.js +59 -19
- package/lib/structures/extra/BaseGuild.d.ts +4 -4
- package/lib/structures/extra/BaseGuild.js +4 -4
- package/lib/types/gateway.d.ts +243 -239
- package/lib/types/index.d.ts +2 -2
- package/lib/types/payloads/_interactions/_applicationCommands/_chatInput/attachment.d.ts +5 -2
- package/lib/types/payloads/_interactions/_applicationCommands/_chatInput/shared.d.ts +2 -2
- package/lib/types/payloads/_interactions/_applicationCommands/_chatInput/shared.js +1 -1
- package/lib/types/payloads/_interactions/_applicationCommands/chatInput.d.ts +7 -7
- package/lib/types/payloads/_interactions/_applicationCommands/contextMenu.d.ts +13 -13
- package/lib/types/payloads/_interactions/_applicationCommands/permissions.d.ts +4 -4
- package/lib/types/payloads/_interactions/_applicationCommands/permissions.js +2 -2
- package/lib/types/payloads/_interactions/applicationCommands.d.ts +10 -10
- package/lib/types/payloads/_interactions/applicationCommands.js +4 -4
- package/lib/types/payloads/_interactions/autocomplete.d.ts +2 -2
- package/lib/types/payloads/_interactions/base.d.ts +13 -7
- package/lib/types/payloads/_interactions/modalSubmit.d.ts +4 -4
- package/lib/types/payloads/_interactions/responses.d.ts +10 -10
- package/lib/types/payloads/_interactions/responses.js +2 -2
- package/lib/types/payloads/application.d.ts +21 -15
- package/lib/types/payloads/application.js +7 -7
- package/lib/types/payloads/auditLog.d.ts +22 -17
- package/lib/types/payloads/auditLog.js +7 -2
- package/lib/types/payloads/autoModeration.d.ts +11 -11
- package/lib/types/payloads/autoModeration.js +5 -5
- package/lib/types/payloads/channel.d.ts +87 -78
- package/lib/types/payloads/channel.js +16 -11
- package/lib/types/payloads/components.d.ts +41 -31
- package/lib/types/payloads/components.js +9 -5
- package/lib/types/payloads/emoji.d.ts +2 -2
- package/lib/types/payloads/emoji.js +1 -1
- package/lib/types/payloads/gateway.d.ts +33 -29
- package/lib/types/payloads/gateway.js +5 -5
- package/lib/types/payloads/guild.d.ts +68 -68
- package/lib/types/payloads/guild.js +14 -14
- package/lib/types/payloads/guildScheduledEvent.d.ts +11 -11
- package/lib/types/payloads/guildScheduledEvent.js +3 -3
- package/lib/types/payloads/index.d.ts +2 -2
- package/lib/types/payloads/interactions.d.ts +3 -3
- package/lib/types/payloads/invite.d.ts +11 -11
- package/lib/types/payloads/invite.js +3 -3
- package/lib/types/payloads/monetization.d.ts +4 -4
- package/lib/types/payloads/monetization.js +2 -2
- package/lib/types/payloads/oauth2.d.ts +21 -17
- package/lib/types/payloads/oauth2.js +21 -17
- package/lib/types/payloads/permissions.d.ts +5 -5
- package/lib/types/payloads/permissions.js +2 -2
- package/lib/types/payloads/poll.d.ts +7 -7
- package/lib/types/payloads/poll.js +2 -2
- package/lib/types/payloads/soundboard.d.ts +2 -2
- package/lib/types/payloads/soundboard.js +1 -1
- package/lib/types/payloads/stageInstance.d.ts +5 -5
- package/lib/types/payloads/stageInstance.js +1 -1
- package/lib/types/payloads/sticker.d.ts +8 -8
- package/lib/types/payloads/sticker.js +3 -3
- package/lib/types/payloads/teams.d.ts +8 -8
- package/lib/types/payloads/teams.js +3 -3
- package/lib/types/payloads/template.d.ts +3 -3
- package/lib/types/payloads/template.js +1 -1
- package/lib/types/payloads/user.d.ts +24 -22
- package/lib/types/payloads/user.js +7 -5
- package/lib/types/payloads/voice.d.ts +4 -4
- package/lib/types/payloads/voice.js +1 -1
- package/lib/types/payloads/webhokEvents.d.ts +5 -5
- package/lib/types/payloads/webhokEvents.js +2 -2
- package/lib/types/payloads/webhook.d.ts +4 -4
- package/lib/types/payloads/webhook.js +1 -1
- package/lib/types/rest/application.d.ts +14 -14
- package/lib/types/rest/auditLog.d.ts +1 -1
- package/lib/types/rest/autoModeration.d.ts +7 -7
- package/lib/types/rest/channel.d.ts +79 -74
- package/lib/types/rest/channel.js +1 -1
- package/lib/types/rest/emoji.d.ts +8 -8
- package/lib/types/rest/gateway.d.ts +2 -2
- package/lib/types/rest/guild.d.ts +98 -98
- package/lib/types/rest/guild.js +5 -5
- package/lib/types/rest/guildScheduledEvent.d.ts +11 -11
- package/lib/types/rest/index.d.ts +34 -3
- package/lib/types/rest/index.js +33 -2
- package/lib/types/rest/interactions.d.ts +48 -48
- package/lib/types/rest/invite.d.ts +5 -5
- package/lib/types/rest/monetization.d.ts +9 -9
- package/lib/types/rest/monetization.js +1 -1
- package/lib/types/rest/oauth2.d.ts +22 -18
- package/lib/types/rest/poll.d.ts +4 -4
- package/lib/types/rest/soundboard.d.ts +8 -8
- package/lib/types/rest/stageInstance.d.ts +6 -6
- package/lib/types/rest/sticker.d.ts +10 -10
- package/lib/types/rest/template.d.ts +11 -11
- package/lib/types/rest/user.d.ts +18 -14
- package/lib/types/rest/voice.d.ts +5 -5
- package/lib/types/rest/webhook.d.ts +38 -38
- package/lib/types/utils/index.d.ts +19 -19
- package/lib/types/utils/index.js +19 -19
- package/lib/websocket/SharedTypes.d.ts +2 -2
- package/lib/websocket/constants/index.js +2 -2
- package/lib/websocket/discord/heartbeater.d.ts +1 -0
- package/lib/websocket/discord/heartbeater.js +8 -0
- package/lib/websocket/discord/shard.d.ts +19 -10
- package/lib/websocket/discord/shard.js +255 -122
- package/lib/websocket/discord/sharder.d.ts +2 -2
- package/lib/websocket/discord/sharder.js +2 -2
- package/lib/websocket/discord/shared.d.ts +7 -2
- package/lib/websocket/discord/workermanager.d.ts +3 -1
- package/lib/websocket/discord/workermanager.js +31 -24
- package/package.json +3 -3
package/README.md
CHANGED
|
@@ -71,4 +71,10 @@ For validation errors, metadata follows this convention:
|
|
|
71
71
|
- [Website](https://seyfert.dev)
|
|
72
72
|
- [Documentation](https://seyfert.dev/guide)
|
|
73
73
|
|
|
74
|
-
|
|
74
|
+
<a href="https://www.star-history.com/?repos=tiramisulabs%2Fseyfert&type=date&legend=top-left">
|
|
75
|
+
<picture>
|
|
76
|
+
<source media="(prefers-color-scheme: dark)" srcset="https://api.star-history.com/chart?repos=tiramisulabs/seyfert&type=date&theme=dark&legend=top-left&sealed_token=UNrJ9iHEmmnlVRygDYxO2q0eWbqNUrt2kUF-SYwj3laAXxzq7eXDFXQzWAZc8uovRAdLFcDUjWqz7gpb1Nf8J0I9JzVfcsnjT4rBcMPO46-6t4msr0kZwwxDgbhwcK07h4U_-i1Q80fEaA-V9gc27ZHUf646ucLdm8QeOT0AIshgiALFD7C5HUjY1do7" />
|
|
77
|
+
<source media="(prefers-color-scheme: light)" srcset="https://api.star-history.com/chart?repos=tiramisulabs/seyfert&type=date&legend=top-left&sealed_token=UNrJ9iHEmmnlVRygDYxO2q0eWbqNUrt2kUF-SYwj3laAXxzq7eXDFXQzWAZc8uovRAdLFcDUjWqz7gpb1Nf8J0I9JzVfcsnjT4rBcMPO46-6t4msr0kZwwxDgbhwcK07h4U_-i1Q80fEaA-V9gc27ZHUf646ucLdm8QeOT0AIshgiALFD7C5HUjY1do7" />
|
|
78
|
+
<img alt="Star History Chart" src="https://api.star-history.com/chart?repos=tiramisulabs/seyfert&type=date&legend=top-left&sealed_token=UNrJ9iHEmmnlVRygDYxO2q0eWbqNUrt2kUF-SYwj3laAXxzq7eXDFXQzWAZc8uovRAdLFcDUjWqz7gpb1Nf8J0I9JzVfcsnjT4rBcMPO46-6t4msr0kZwwxDgbhwcK07h4U_-i1Q80fEaA-V9gc27ZHUf646ucLdm8QeOT0AIshgiALFD7C5HUjY1do7" />
|
|
79
|
+
</picture>
|
|
80
|
+
</a>
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { Identify, OmitInsert } from '../../common';
|
|
2
|
-
import type { APIThreadChannel, RESTDeleteAPIAutoModerationRuleResult, RESTDeleteAPIGuildBanResult, RESTDeleteAPIGuildEmojiResult, RESTDeleteAPIGuildIntegrationResult, RESTDeleteAPIGuildMemberResult, RESTDeleteAPIGuildMemberRoleResult, RESTDeleteAPIGuildResult, RESTDeleteAPIGuildRoleResult, RESTDeleteAPIGuildScheduledEventResult, RESTDeleteAPIGuildStickerResult, RESTDeleteAPIGuildTemplateResult, RESTGetAPIAuditLogQuery, RESTGetAPIAuditLogResult, RESTGetAPIAutoModerationRuleResult, RESTGetAPIAutoModerationRulesResult, RESTGetAPIGuildBanResult, RESTGetAPIGuildBansQuery, RESTGetAPIGuildBansResult, RESTGetAPIGuildChannelsResult, RESTGetAPIGuildEmojiResult, RESTGetAPIGuildEmojisResult, RESTGetAPIGuildIntegrationsResult, RESTGetAPIGuildInvitesResult, RESTGetAPIGuildMemberResult, RESTGetAPIGuildMembersQuery, RESTGetAPIGuildMembersResult, RESTGetAPIGuildMembersSearchQuery, RESTGetAPIGuildMembersSearchResult, RESTGetAPIGuildMessagesSearchQuery, RESTGetAPIGuildMessagesSearchResult, RESTGetAPIGuildPreviewResult, RESTGetAPIGuildPruneCountQuery, RESTGetAPIGuildPruneCountResult, RESTGetAPIGuildQuery, RESTGetAPIGuildResult, RESTGetAPIGuildRoleMemberCountsResult, RESTGetAPIGuildRoleResult, RESTGetAPIGuildRolesResult, RESTGetAPIGuildScheduledEventQuery, RESTGetAPIGuildScheduledEventResult, RESTGetAPIGuildScheduledEventsQuery, RESTGetAPIGuildScheduledEventsResult, RESTGetAPIGuildScheduledEventUsersQuery, RESTGetAPIGuildScheduledEventUsersResult, RESTGetAPIGuildSoundboardSoundsResult, RESTGetAPIGuildStickerResult, RESTGetAPIGuildStickersResult, RESTGetAPIGuildTemplatesResult, RESTGetAPIGuildThreadsResult, RESTGetAPIGuildVanityUrlResult, RESTGetAPIGuildVoiceRegionsResult, RESTGetAPIGuildVoiceStateCurrentMemberResult, RESTGetAPIGuildVoiceStateUserResult, RESTGetAPIGuildWebhooksResult, RESTGetAPIGuildWelcomeScreenResult, RESTGetAPIGuildWidgetImageQuery, RESTGetAPIGuildWidgetImageResult, RESTGetAPIGuildWidgetJSONResult, RESTGetAPIGuildWidgetSettingsResult, RESTGetAPITemplateResult, RESTPatchAPIAutoModerationRuleJSONBody, RESTPatchAPIAutoModerationRuleResult, RESTPatchAPICurrentGuildMemberJSONBody, RESTPatchAPIGuildChannelPositionsJSONBody, RESTPatchAPIGuildChannelPositionsResult, RESTPatchAPIGuildEmojiJSONBody, RESTPatchAPIGuildEmojiResult, RESTPatchAPIGuildJSONBody, RESTPatchAPIGuildMemberJSONBody, RESTPatchAPIGuildMemberResult, RESTPatchAPIGuildResult, RESTPatchAPIGuildRoleJSONBody, RESTPatchAPIGuildRolePositionsJSONBody, RESTPatchAPIGuildRolePositionsResult, RESTPatchAPIGuildRoleResult, RESTPatchAPIGuildScheduledEventJSONBody, RESTPatchAPIGuildScheduledEventResult, RESTPatchAPIGuildSoundboardSoundJSONBody, RESTPatchAPIGuildSoundboardSoundResult, RESTPatchAPIGuildStickerJSONBody, RESTPatchAPIGuildStickerResult, RESTPatchAPIGuildTemplateJSONBody, RESTPatchAPIGuildTemplateResult, RESTPatchAPIGuildVoiceStateCurrentMemberJSONBody, RESTPatchAPIGuildVoiceStateCurrentMemberResult, RESTPatchAPIGuildVoiceStateUserJSONBody, RESTPatchAPIGuildVoiceStateUserResult, RESTPatchAPIGuildWelcomeScreenJSONBody, RESTPatchAPIGuildWelcomeScreenResult, RESTPatchAPIGuildWidgetSettingsJSONBody, RESTPatchAPIGuildWidgetSettingsResult, RESTPostAPIAutoModerationRuleJSONBody, RESTPostAPIAutoModerationRuleResult, RESTPostAPIGuildBulkBanJSONBody, RESTPostAPIGuildBulkBanResult, RESTPostAPIGuildChannelJSONBody, RESTPostAPIGuildChannelResult, RESTPostAPIGuildEmojiJSONBody, RESTPostAPIGuildEmojiResult, RESTPostAPIGuildPruneJSONBody, RESTPostAPIGuildPruneResult, RESTPostAPIGuildRoleJSONBody, RESTPostAPIGuildRoleResult, RESTPostAPIGuildScheduledEventJSONBody, RESTPostAPIGuildScheduledEventResult, RESTPostAPIGuildSoundboardSoundJSONBody, RESTPostAPIGuildSoundboardSoundResult, RESTPostAPIGuildStickerFormDataBody, RESTPostAPIGuildStickerResult, RESTPostAPIGuildsMFAJSONBody, RESTPostAPIGuildsMFAResult, RESTPostAPIGuildTemplatesJSONBody, RESTPostAPIGuildTemplatesResult, RESTPostAPITemplateCreateGuildJSONBody, RESTPostAPITemplateCreateGuildResult, RESTPutAPIGuildBanJSONBody, RESTPutAPIGuildBanResult, RESTPutAPIGuildMemberJSONBody, RESTPutAPIGuildMemberResult, RESTPutAPIGuildMemberRoleResult, RESTPutAPIGuildTemplateSyncResult } from '../../types';
|
|
2
|
+
import type { APIThreadChannel, RESTDeleteAPIAutoModerationRuleResult, RESTDeleteAPIGuildBanResult, RESTDeleteAPIGuildEmojiResult, RESTDeleteAPIGuildIntegrationResult, RESTDeleteAPIGuildMemberResult, RESTDeleteAPIGuildMemberRoleResult, RESTDeleteAPIGuildResult, RESTDeleteAPIGuildRoleResult, RESTDeleteAPIGuildScheduledEventResult, RESTDeleteAPIGuildStickerResult, RESTDeleteAPIGuildTemplateResult, RESTGetAPIAuditLogQuery, RESTGetAPIAuditLogResult, RESTGetAPIAutoModerationRuleResult, RESTGetAPIAutoModerationRulesResult, RESTGetAPIGuildBanResult, RESTGetAPIGuildBansQuery, RESTGetAPIGuildBansResult, RESTGetAPIGuildChannelsResult, RESTGetAPIGuildEmojiResult, RESTGetAPIGuildEmojisResult, RESTGetAPIGuildIntegrationsResult, RESTGetAPIGuildInvitesResult, RESTGetAPIGuildMemberResult, RESTGetAPIGuildMembersQuery, RESTGetAPIGuildMembersResult, RESTGetAPIGuildMembersSearchQuery, RESTGetAPIGuildMembersSearchResult, RESTGetAPIGuildMessagesSearchQuery, RESTGetAPIGuildMessagesSearchResult, RESTGetAPIGuildOnboardingResult, RESTGetAPIGuildPreviewResult, RESTGetAPIGuildPruneCountQuery, RESTGetAPIGuildPruneCountResult, RESTGetAPIGuildQuery, RESTGetAPIGuildResult, RESTGetAPIGuildRoleMemberCountsResult, RESTGetAPIGuildRoleResult, RESTGetAPIGuildRolesResult, RESTGetAPIGuildScheduledEventQuery, RESTGetAPIGuildScheduledEventResult, RESTGetAPIGuildScheduledEventsQuery, RESTGetAPIGuildScheduledEventsResult, RESTGetAPIGuildScheduledEventUsersQuery, RESTGetAPIGuildScheduledEventUsersResult, RESTGetAPIGuildSoundboardSoundsResult, RESTGetAPIGuildStickerResult, RESTGetAPIGuildStickersResult, RESTGetAPIGuildTemplatesResult, RESTGetAPIGuildThreadsResult, RESTGetAPIGuildVanityUrlResult, RESTGetAPIGuildVoiceRegionsResult, RESTGetAPIGuildVoiceStateCurrentMemberResult, RESTGetAPIGuildVoiceStateUserResult, RESTGetAPIGuildWebhooksResult, RESTGetAPIGuildWelcomeScreenResult, RESTGetAPIGuildWidgetImageQuery, RESTGetAPIGuildWidgetImageResult, RESTGetAPIGuildWidgetJSONResult, RESTGetAPIGuildWidgetSettingsResult, RESTGetAPITemplateResult, RESTPatchAPIAutoModerationRuleJSONBody, RESTPatchAPIAutoModerationRuleResult, RESTPatchAPICurrentGuildMemberJSONBody, RESTPatchAPIGuildChannelPositionsJSONBody, RESTPatchAPIGuildChannelPositionsResult, RESTPatchAPIGuildEmojiJSONBody, RESTPatchAPIGuildEmojiResult, RESTPatchAPIGuildJSONBody, RESTPatchAPIGuildMemberJSONBody, RESTPatchAPIGuildMemberResult, RESTPatchAPIGuildResult, RESTPatchAPIGuildRoleJSONBody, RESTPatchAPIGuildRolePositionsJSONBody, RESTPatchAPIGuildRolePositionsResult, RESTPatchAPIGuildRoleResult, RESTPatchAPIGuildScheduledEventJSONBody, RESTPatchAPIGuildScheduledEventResult, RESTPatchAPIGuildSoundboardSoundJSONBody, RESTPatchAPIGuildSoundboardSoundResult, RESTPatchAPIGuildStickerJSONBody, RESTPatchAPIGuildStickerResult, RESTPatchAPIGuildTemplateJSONBody, RESTPatchAPIGuildTemplateResult, RESTPatchAPIGuildVoiceStateCurrentMemberJSONBody, RESTPatchAPIGuildVoiceStateCurrentMemberResult, RESTPatchAPIGuildVoiceStateUserJSONBody, RESTPatchAPIGuildVoiceStateUserResult, RESTPatchAPIGuildWelcomeScreenJSONBody, RESTPatchAPIGuildWelcomeScreenResult, RESTPatchAPIGuildWidgetSettingsJSONBody, RESTPatchAPIGuildWidgetSettingsResult, RESTPostAPIAutoModerationRuleJSONBody, RESTPostAPIAutoModerationRuleResult, RESTPostAPIGuildBulkBanJSONBody, RESTPostAPIGuildBulkBanResult, RESTPostAPIGuildChannelJSONBody, RESTPostAPIGuildChannelResult, RESTPostAPIGuildEmojiJSONBody, RESTPostAPIGuildEmojiResult, RESTPostAPIGuildPruneJSONBody, RESTPostAPIGuildPruneResult, RESTPostAPIGuildRoleJSONBody, RESTPostAPIGuildRoleResult, RESTPostAPIGuildScheduledEventJSONBody, RESTPostAPIGuildScheduledEventResult, RESTPostAPIGuildSoundboardSoundJSONBody, RESTPostAPIGuildSoundboardSoundResult, RESTPostAPIGuildStickerFormDataBody, RESTPostAPIGuildStickerResult, RESTPostAPIGuildsMFAJSONBody, RESTPostAPIGuildsMFAResult, RESTPostAPIGuildTemplatesJSONBody, RESTPostAPIGuildTemplatesResult, RESTPostAPITemplateCreateGuildJSONBody, RESTPostAPITemplateCreateGuildResult, RESTPutAPIGuildBanJSONBody, RESTPutAPIGuildBanResult, RESTPutAPIGuildIncidentActionsJSONBody, RESTPutAPIGuildIncidentActionsResult, RESTPutAPIGuildMemberJSONBody, RESTPutAPIGuildMemberResult, RESTPutAPIGuildMemberRoleResult, RESTPutAPIGuildOnboardingJSONBody, RESTPutAPIGuildOnboardingResult, RESTPutAPIGuildTemplateSyncResult } from '../../types';
|
|
3
3
|
import type { RestArguments, RestArgumentsNoBody } from '../api';
|
|
4
4
|
import type { RawFile } from '../shared';
|
|
5
5
|
export interface GuildRoutes {
|
|
@@ -89,9 +89,13 @@ export interface GuildRoutes {
|
|
|
89
89
|
delete(args?: RestArgumentsNoBody): Promise<RESTDeleteAPIGuildBanResult>;
|
|
90
90
|
};
|
|
91
91
|
};
|
|
92
|
+
/** @deprecated Discord uses `bulk-ban`; this legacy path is retained for v4 compatibility. */
|
|
92
93
|
'bulk-bans': {
|
|
93
94
|
post(args: RestArguments<RESTPostAPIGuildBulkBanJSONBody>): Promise<RESTPostAPIGuildBulkBanResult>;
|
|
94
95
|
};
|
|
96
|
+
'bulk-ban': {
|
|
97
|
+
post(args: RestArguments<RESTPostAPIGuildBulkBanJSONBody>): Promise<RESTPostAPIGuildBulkBanResult>;
|
|
98
|
+
};
|
|
95
99
|
mfa: {
|
|
96
100
|
post(args: RestArguments<RESTPostAPIGuildsMFAJSONBody>): Promise<RESTPostAPIGuildsMFAResult>;
|
|
97
101
|
};
|
|
@@ -130,6 +134,13 @@ export interface GuildRoutes {
|
|
|
130
134
|
get(args?: RestArgumentsNoBody): Promise<RESTGetAPIGuildWelcomeScreenResult>;
|
|
131
135
|
patch(args: RestArguments<RESTPatchAPIGuildWelcomeScreenJSONBody>): Promise<RESTPatchAPIGuildWelcomeScreenResult>;
|
|
132
136
|
};
|
|
137
|
+
onboarding: {
|
|
138
|
+
get(args?: RestArgumentsNoBody): Promise<RESTGetAPIGuildOnboardingResult>;
|
|
139
|
+
put(args: RestArguments<RESTPutAPIGuildOnboardingJSONBody>): Promise<RESTPutAPIGuildOnboardingResult>;
|
|
140
|
+
};
|
|
141
|
+
'incident-actions': {
|
|
142
|
+
put(args: RestArguments<RESTPutAPIGuildIncidentActionsJSONBody>): Promise<RESTPutAPIGuildIncidentActionsResult>;
|
|
143
|
+
};
|
|
133
144
|
emojis: {
|
|
134
145
|
get(args?: RestArgumentsNoBody): Promise<RESTGetAPIGuildEmojisResult>;
|
|
135
146
|
post(args: RestArguments<RESTPostAPIGuildEmojiJSONBody>): Promise<RESTPostAPIGuildEmojiResult>;
|
|
@@ -4,6 +4,8 @@ import type { GatewayRoutes } from './gateway';
|
|
|
4
4
|
import type { GuildRoutes } from './guilds';
|
|
5
5
|
import type { InteractionRoutes } from './interactions';
|
|
6
6
|
import type { InviteRoutes } from './invites';
|
|
7
|
+
import type { OAuth2Routes } from './oauth2';
|
|
8
|
+
import type { SKURoutes } from './skus';
|
|
7
9
|
import type { SoundboardRoutes } from './soundboard';
|
|
8
10
|
import type { StageInstanceRoutes } from './stage-instances';
|
|
9
11
|
import type { StickerRoutes } from './stickers';
|
|
@@ -11,5 +13,5 @@ import type { UserRoutes } from './users';
|
|
|
11
13
|
import type { VoiceRoutes } from './voice';
|
|
12
14
|
import type { WebhookRoutes } from './webhooks';
|
|
13
15
|
export * from './cdn';
|
|
14
|
-
export interface APIRoutes extends ApplicationRoutes, ChannelRoutes, GatewayRoutes, GuildRoutes, InteractionRoutes, InviteRoutes, StageInstanceRoutes, StickerRoutes, UserRoutes, VoiceRoutes, WebhookRoutes, SoundboardRoutes {
|
|
16
|
+
export interface APIRoutes extends ApplicationRoutes, ChannelRoutes, GatewayRoutes, GuildRoutes, InteractionRoutes, InviteRoutes, OAuth2Routes, SKURoutes, StageInstanceRoutes, StickerRoutes, UserRoutes, VoiceRoutes, WebhookRoutes, SoundboardRoutes {
|
|
15
17
|
}
|
|
@@ -3,7 +3,7 @@ import type { RESTDeleteAPIInviteResult, RESTGetAPIInviteQuery, RESTGetAPIInvite
|
|
|
3
3
|
import type { RestArguments, RestArgumentsNoBody } from '../api';
|
|
4
4
|
export interface InviteRoutes {
|
|
5
5
|
invites(id: string): {
|
|
6
|
-
get(args?: RestArguments<RESTGetAPIInviteQuery>): Promise<RESTGetAPIInviteResult>;
|
|
6
|
+
get(args?: RestArguments<RESTGetAPIInviteQuery> | RestArgumentsNoBody<RESTGetAPIInviteQuery>): Promise<RESTGetAPIInviteResult>;
|
|
7
7
|
delete(args?: RestArgumentsNoBody): Promise<RESTDeleteAPIInviteResult>;
|
|
8
8
|
['target-users']: {
|
|
9
9
|
get(args?: RestArgumentsNoBody): Promise<RESTGetTargetUsersResult>;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import type { RESTGetAPIOAuth2CurrentApplicationResult } from '../../types';
|
|
2
|
+
import type { RestArgumentsNoBody } from '../api';
|
|
3
|
+
export interface OAuth2Routes {
|
|
4
|
+
oauth2: {
|
|
5
|
+
applications: {
|
|
6
|
+
'@me': {
|
|
7
|
+
get(args?: RestArgumentsNoBody): Promise<RESTGetAPIOAuth2CurrentApplicationResult>;
|
|
8
|
+
};
|
|
9
|
+
};
|
|
10
|
+
};
|
|
11
|
+
}
|
package/lib/api/Routes/skus.d.ts
CHANGED
|
@@ -1,10 +1,17 @@
|
|
|
1
1
|
import type { RESTGetAPISKUSubscriptionResult, RESTGetAPISKUSubscriptionsQuery, RESTGetAPISKUSubscriptionsResult } from '../../types';
|
|
2
2
|
import type { RestArguments, RestArgumentsNoBody } from '../api';
|
|
3
|
-
export interface
|
|
3
|
+
export interface SKURoutes {
|
|
4
4
|
skus(id: string): {
|
|
5
|
-
get
|
|
6
|
-
|
|
7
|
-
|
|
5
|
+
/** @deprecated Use `subscriptions.get(...)` to list subscriptions. */
|
|
6
|
+
get(args?: RestArguments<RESTGetAPISKUSubscriptionsQuery>): Promise<RESTGetAPISKUSubscriptionsResult>;
|
|
7
|
+
subscriptions: {
|
|
8
|
+
get(args?: RestArgumentsNoBody<RESTGetAPISKUSubscriptionsQuery>): Promise<RESTGetAPISKUSubscriptionsResult>;
|
|
9
|
+
(id: string): {
|
|
10
|
+
get(args?: RestArgumentsNoBody): Promise<RESTGetAPISKUSubscriptionResult>;
|
|
11
|
+
};
|
|
8
12
|
};
|
|
9
13
|
};
|
|
10
14
|
}
|
|
15
|
+
/** @deprecated Use {@link SKURoutes}. */
|
|
16
|
+
export interface SKuRoutes extends SKURoutes {
|
|
17
|
+
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { APIDMChannel, RESTDeleteAPIGuildResult, RESTGetAPICurrentUserApplicationRoleConnectionResult, RESTGetAPICurrentUserConnectionsResult, RESTGetAPICurrentUserGuildsQuery, RESTGetAPICurrentUserGuildsResult, RESTGetAPICurrentUserResult, RESTGetAPIUserResult, RESTGetCurrentUserGuildMemberResult, RESTPatchAPICurrentUserJSONBody, RESTPatchAPICurrentUserResult, RESTPostAPICurrentUserCreateDMChannelJSONBody, RESTPutAPICurrentUserApplicationRoleConnectionJSONBody, RESTPutAPICurrentUserApplicationRoleConnectionResult } from '../../types';
|
|
1
|
+
import type { APIDMChannel, RESTDeleteAPICurrentUserApplicationRoleConnectionResult, RESTDeleteAPIGuildResult, RESTGetAPICurrentUserApplicationRoleConnectionResult, RESTGetAPICurrentUserConnectionsResult, RESTGetAPICurrentUserGuildsQuery, RESTGetAPICurrentUserGuildsResult, RESTGetAPICurrentUserResult, RESTGetAPIUserResult, RESTGetCurrentUserGuildMemberResult, RESTPatchAPICurrentUserJSONBody, RESTPatchAPICurrentUserResult, RESTPostAPICurrentUserCreateDMChannelJSONBody, RESTPutAPICurrentUserApplicationRoleConnectionJSONBody, RESTPutAPICurrentUserApplicationRoleConnectionResult } from '../../types';
|
|
2
2
|
import type { RestArguments, RestArgumentsNoBody } from '../api';
|
|
3
3
|
export interface UserRoutes {
|
|
4
4
|
users: {
|
|
@@ -26,6 +26,7 @@ export interface UserRoutes {
|
|
|
26
26
|
applications(applicationId: string): {
|
|
27
27
|
'role-connection': {
|
|
28
28
|
get(args?: RestArgumentsNoBody): Promise<RESTGetAPICurrentUserApplicationRoleConnectionResult>;
|
|
29
|
+
delete(args?: RestArgumentsNoBody): Promise<RESTDeleteAPICurrentUserApplicationRoleConnectionResult>;
|
|
29
30
|
put(args: RestArguments<RESTPutAPICurrentUserApplicationRoleConnectionJSONBody>): Promise<RESTPutAPICurrentUserApplicationRoleConnectionResult>;
|
|
30
31
|
};
|
|
31
32
|
};
|
|
@@ -2,8 +2,12 @@ import type { RESTGetAPIVoiceRegionsResult } from '../../types';
|
|
|
2
2
|
import type { RestArgumentsNoBody } from '../api';
|
|
3
3
|
export interface VoiceRoutes {
|
|
4
4
|
voice: {
|
|
5
|
+
/** @deprecated Discord uses `regions`; this legacy path is retained for v4 compatibility. */
|
|
5
6
|
region: {
|
|
6
7
|
get(args?: RestArgumentsNoBody): Promise<RESTGetAPIVoiceRegionsResult>;
|
|
7
8
|
};
|
|
9
|
+
regions: {
|
|
10
|
+
get(args?: RestArgumentsNoBody): Promise<RESTGetAPIVoiceRegionsResult>;
|
|
11
|
+
};
|
|
8
12
|
};
|
|
9
13
|
}
|
|
@@ -18,7 +18,7 @@ export interface WebhookRoutes {
|
|
|
18
18
|
};
|
|
19
19
|
messages: (id: string) => {
|
|
20
20
|
get(args?: RestArgumentsNoBody<RESTGetAPIWebhookWithTokenMessageQuery>): Promise<RESTGetAPIWebhookWithTokenMessageResult>;
|
|
21
|
-
patch(args: RestArguments<RESTPatchAPIWebhookWithTokenMessageJSONBody>): Promise<RESTPatchAPIWebhookWithTokenMessageResult>;
|
|
21
|
+
patch(args: RestArguments<RESTPatchAPIWebhookWithTokenMessageJSONBody, RESTPatchAPIWebhookWithTokenMessageQuery>): Promise<RESTPatchAPIWebhookWithTokenMessageResult>;
|
|
22
22
|
delete(args?: RestArgumentsNoBody<RESTDeleteAPIWebhookWithTokenMessageQuery>): Promise<RESTDeleteAPIWebhookWithTokenMessageResult>;
|
|
23
23
|
};
|
|
24
24
|
};
|
package/lib/api/api.d.ts
CHANGED
|
@@ -3,7 +3,7 @@ import { type Awaitable, Logger, SeyfertError } from '../common';
|
|
|
3
3
|
import type { WorkerSendApiRequest } from '../websocket/discord/worker';
|
|
4
4
|
import { Bucket } from './bucket';
|
|
5
5
|
import type { APIRoutes } from './Routes';
|
|
6
|
-
import { type ApiHandlerInternalOptions, type ApiHandlerOptions, type ApiRequestOptions, type HttpMethods, type RawFile, type RequestHeaders } from './shared';
|
|
6
|
+
import { type ApiHandlerInternalOptions, type ApiHandlerOptions, type ApiRequestBody, type ApiRequestOptions, type HttpMethods, type RawFile, type RequestHeaders } from './shared';
|
|
7
7
|
export interface ApiHandler {
|
|
8
8
|
debugger?: Logger;
|
|
9
9
|
}
|
|
@@ -15,6 +15,9 @@ export declare class ApiHandler {
|
|
|
15
15
|
globalBlock: boolean;
|
|
16
16
|
ratelimits: Map<string, Bucket>;
|
|
17
17
|
readyQueue: (() => void)[];
|
|
18
|
+
private bucketAliases;
|
|
19
|
+
private globalBlocks;
|
|
20
|
+
private globalTimers;
|
|
18
21
|
cdn: import("./Routes").CDNRoute;
|
|
19
22
|
workerPromises?: Map<string, {
|
|
20
23
|
resolve: (value: any) => any;
|
|
@@ -32,15 +35,19 @@ export declare class ApiHandler {
|
|
|
32
35
|
protected postMessage<T = unknown>(body: WorkerSendApiRequest): Promise<T>;
|
|
33
36
|
private notifySuccessRequest;
|
|
34
37
|
private notifyFailRequest;
|
|
35
|
-
request<T = unknown>(method: HttpMethods, url: `/${string}`,
|
|
38
|
+
request<T = unknown>(method: HttpMethods, url: `/${string}`, request?: ApiRequestOptions): Promise<T>;
|
|
39
|
+
private learnBucket;
|
|
40
|
+
private globalRateLimitKey;
|
|
41
|
+
private blockGlobal;
|
|
42
|
+
private unblockGlobal;
|
|
36
43
|
parseError(method: HttpMethods, route: `/${string}`, response: Response, result: string | Record<string, any>, originTrace?: {
|
|
37
44
|
stack?: string;
|
|
38
45
|
}): SeyfertError;
|
|
39
46
|
parseValidationError(data: Record<string, any>, path?: string, errors?: string[]): string[];
|
|
40
|
-
handle50X(method: HttpMethods, url: `/${string}`, request: ApiRequestOptions, next: () => void): Promise<unknown>;
|
|
47
|
+
handle50X(method: HttpMethods, url: `/${string}`, request: ApiRequestOptions, attempts: number | (() => void), next?: () => void, resolve?: (value: unknown) => void, reject?: (err: unknown) => void): Promise<unknown>;
|
|
41
48
|
handle429(route: string, method: HttpMethods, url: `/${string}`, request: ApiRequestOptions, response: Response, result: string, next: () => void, reject: (err: unknown) => void, now: number): Promise<unknown>;
|
|
42
49
|
clearResetInterval(route: string): void;
|
|
43
|
-
setResetBucket(route: string, resp: Response, now: number, headerNow: number): void;
|
|
50
|
+
setResetBucket(route: string, resp: Response, now: number, headerNow: number, normalizedRoute?: string): void;
|
|
44
51
|
setRatelimitsBucket(route: string, resp: Response): void;
|
|
45
52
|
parseRequest(options: {
|
|
46
53
|
url: string;
|
|
@@ -53,7 +60,7 @@ export declare class ApiHandler {
|
|
|
53
60
|
routefy(url: string, method: HttpMethods): `/${string}`;
|
|
54
61
|
}
|
|
55
62
|
export type RequestOptions = Pick<ApiRequestOptions, 'reason' | 'auth' | 'appendToFormData' | 'token'>;
|
|
56
|
-
export type RestArguments<B extends
|
|
63
|
+
export type RestArguments<B extends ApiRequestBody | undefined, Q extends never | Record<string, any> = never, F extends RawFile[] = RawFile[]> = ({
|
|
57
64
|
body: B;
|
|
58
65
|
files?: F;
|
|
59
66
|
} | (Q extends never | undefined ? {} : {
|
|
@@ -63,3 +70,6 @@ export type RestArgumentsNoBody<Q extends never | Record<string, any> = never> =
|
|
|
63
70
|
query?: Q;
|
|
64
71
|
files?: RawFile[];
|
|
65
72
|
} & RequestOptions;
|
|
73
|
+
export type RestArgumentsRequiredQuery<Q extends Record<string, any>> = Omit<RestArgumentsNoBody<Q>, 'query'> & {
|
|
74
|
+
query: Q;
|
|
75
|
+
};
|