@neontechspace/fluxerly 1000.0.0-nightly.12
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +833 -0
- package/LICENSE +201 -0
- package/README.md +129 -0
- package/agents/AGENTS.md +195 -0
- package/dist/api/default/application.d.ts +34 -0
- package/dist/api/default/application.d.ts.map +1 -0
- package/dist/api/default/application.js +2 -0
- package/dist/api/default/application.js.map +1 -0
- package/dist/api/default/attachments.d.ts +89 -0
- package/dist/api/default/attachments.d.ts.map +1 -0
- package/dist/api/default/attachments.js +2 -0
- package/dist/api/default/attachments.js.map +1 -0
- package/dist/api/default/audit-logs.d.ts +48 -0
- package/dist/api/default/audit-logs.d.ts.map +1 -0
- package/dist/api/default/audit-logs.js +2 -0
- package/dist/api/default/audit-logs.js.map +1 -0
- package/dist/api/default/bot.d.ts +200 -0
- package/dist/api/default/bot.d.ts.map +1 -0
- package/dist/api/default/bot.js +309 -0
- package/dist/api/default/bot.js.map +1 -0
- package/dist/api/default/cache.d.ts +105 -0
- package/dist/api/default/cache.d.ts.map +1 -0
- package/dist/api/default/cache.js +2 -0
- package/dist/api/default/cache.js.map +1 -0
- package/dist/api/default/channels.d.ts +249 -0
- package/dist/api/default/channels.d.ts.map +1 -0
- package/dist/api/default/channels.js +2 -0
- package/dist/api/default/channels.js.map +1 -0
- package/dist/api/default/client.d.ts +528 -0
- package/dist/api/default/client.d.ts.map +1 -0
- package/dist/api/default/client.js +301 -0
- package/dist/api/default/client.js.map +1 -0
- package/dist/api/default/collectors.d.ts +76 -0
- package/dist/api/default/collectors.d.ts.map +1 -0
- package/dist/api/default/collectors.js +2 -0
- package/dist/api/default/collectors.js.map +1 -0
- package/dist/api/default/commands.d.ts +91 -0
- package/dist/api/default/commands.d.ts.map +1 -0
- package/dist/api/default/commands.js +92 -0
- package/dist/api/default/commands.js.map +1 -0
- package/dist/api/default/direct-messages.d.ts +111 -0
- package/dist/api/default/direct-messages.d.ts.map +1 -0
- package/dist/api/default/direct-messages.js +2 -0
- package/dist/api/default/direct-messages.js.map +1 -0
- package/dist/api/default/discovery.d.ts +76 -0
- package/dist/api/default/discovery.d.ts.map +1 -0
- package/dist/api/default/discovery.js +2 -0
- package/dist/api/default/discovery.js.map +1 -0
- package/dist/api/default/emojis.d.ts +88 -0
- package/dist/api/default/emojis.d.ts.map +1 -0
- package/dist/api/default/emojis.js +2 -0
- package/dist/api/default/emojis.js.map +1 -0
- package/dist/api/default/events.d.ts +127 -0
- package/dist/api/default/events.d.ts.map +1 -0
- package/dist/api/default/events.js +2 -0
- package/dist/api/default/events.js.map +1 -0
- package/dist/api/default/gateway.d.ts +62 -0
- package/dist/api/default/gateway.d.ts.map +1 -0
- package/dist/api/default/gateway.js +2 -0
- package/dist/api/default/gateway.js.map +1 -0
- package/dist/api/default/guards.d.ts +87 -0
- package/dist/api/default/guards.d.ts.map +1 -0
- package/dist/api/default/guards.js +78 -0
- package/dist/api/default/guards.js.map +1 -0
- package/dist/api/default/guilds.d.ts +230 -0
- package/dist/api/default/guilds.d.ts.map +1 -0
- package/dist/api/default/guilds.js +2 -0
- package/dist/api/default/guilds.js.map +1 -0
- package/dist/api/default/helpers.d.ts +79 -0
- package/dist/api/default/helpers.d.ts.map +1 -0
- package/dist/api/default/helpers.js +79 -0
- package/dist/api/default/helpers.js.map +1 -0
- package/dist/api/default/instance.d.ts +47 -0
- package/dist/api/default/instance.d.ts.map +1 -0
- package/dist/api/default/instance.js +2 -0
- package/dist/api/default/instance.js.map +1 -0
- package/dist/api/default/invites.d.ts +57 -0
- package/dist/api/default/invites.d.ts.map +1 -0
- package/dist/api/default/invites.js +2 -0
- package/dist/api/default/invites.js.map +1 -0
- package/dist/api/default/logging.d.ts +37 -0
- package/dist/api/default/logging.d.ts.map +1 -0
- package/dist/api/default/logging.js +2 -0
- package/dist/api/default/logging.js.map +1 -0
- package/dist/api/default/members.d.ts +442 -0
- package/dist/api/default/members.d.ts.map +1 -0
- package/dist/api/default/members.js +2 -0
- package/dist/api/default/members.js.map +1 -0
- package/dist/api/default/messages.d.ts +898 -0
- package/dist/api/default/messages.d.ts.map +1 -0
- package/dist/api/default/messages.js +2 -0
- package/dist/api/default/messages.js.map +1 -0
- package/dist/api/default/oauth.d.ts +168 -0
- package/dist/api/default/oauth.d.ts.map +1 -0
- package/dist/api/default/oauth.js +84 -0
- package/dist/api/default/oauth.js.map +1 -0
- package/dist/api/default/permissions.d.ts +44 -0
- package/dist/api/default/permissions.d.ts.map +1 -0
- package/dist/api/default/permissions.js +2 -0
- package/dist/api/default/permissions.js.map +1 -0
- package/dist/api/default/presence.d.ts +88 -0
- package/dist/api/default/presence.d.ts.map +1 -0
- package/dist/api/default/presence.js +2 -0
- package/dist/api/default/presence.js.map +1 -0
- package/dist/api/default/rest.d.ts +28 -0
- package/dist/api/default/rest.d.ts.map +1 -0
- package/dist/api/default/rest.js +2 -0
- package/dist/api/default/rest.js.map +1 -0
- package/dist/api/default/results.d.ts +31 -0
- package/dist/api/default/results.d.ts.map +1 -0
- package/dist/api/default/results.js +14 -0
- package/dist/api/default/results.js.map +1 -0
- package/dist/api/default/roles.d.ts +119 -0
- package/dist/api/default/roles.d.ts.map +1 -0
- package/dist/api/default/roles.js +2 -0
- package/dist/api/default/roles.js.map +1 -0
- package/dist/api/default/stickers.d.ts +92 -0
- package/dist/api/default/stickers.d.ts.map +1 -0
- package/dist/api/default/stickers.js +2 -0
- package/dist/api/default/stickers.js.map +1 -0
- package/dist/api/default/supervisor.d.ts +51 -0
- package/dist/api/default/supervisor.d.ts.map +1 -0
- package/dist/api/default/supervisor.js +53 -0
- package/dist/api/default/supervisor.js.map +1 -0
- package/dist/api/default/threads.d.ts +158 -0
- package/dist/api/default/threads.d.ts.map +1 -0
- package/dist/api/default/threads.js +2 -0
- package/dist/api/default/threads.js.map +1 -0
- package/dist/api/default/users.d.ts +73 -0
- package/dist/api/default/users.d.ts.map +1 -0
- package/dist/api/default/users.js +2 -0
- package/dist/api/default/users.js.map +1 -0
- package/dist/api/default/webhook-client.d.ts +149 -0
- package/dist/api/default/webhook-client.d.ts.map +1 -0
- package/dist/api/default/webhook-client.js +69 -0
- package/dist/api/default/webhook-client.js.map +1 -0
- package/dist/api/default/webhooks.d.ts +62 -0
- package/dist/api/default/webhooks.d.ts.map +1 -0
- package/dist/api/default/webhooks.js +2 -0
- package/dist/api/default/webhooks.js.map +1 -0
- package/dist/api/effect/application.d.ts +29 -0
- package/dist/api/effect/application.d.ts.map +1 -0
- package/dist/api/effect/application.js +2 -0
- package/dist/api/effect/application.js.map +1 -0
- package/dist/api/effect/attachments.d.ts +84 -0
- package/dist/api/effect/attachments.d.ts.map +1 -0
- package/dist/api/effect/attachments.js +2 -0
- package/dist/api/effect/attachments.js.map +1 -0
- package/dist/api/effect/audit-logs.d.ts +42 -0
- package/dist/api/effect/audit-logs.d.ts.map +1 -0
- package/dist/api/effect/audit-logs.js +2 -0
- package/dist/api/effect/audit-logs.js.map +1 -0
- package/dist/api/effect/bot.d.ts +233 -0
- package/dist/api/effect/bot.d.ts.map +1 -0
- package/dist/api/effect/bot.js +230 -0
- package/dist/api/effect/bot.js.map +1 -0
- package/dist/api/effect/cache.d.ts +103 -0
- package/dist/api/effect/cache.d.ts.map +1 -0
- package/dist/api/effect/cache.js +2 -0
- package/dist/api/effect/cache.js.map +1 -0
- package/dist/api/effect/channels.d.ts +231 -0
- package/dist/api/effect/channels.d.ts.map +1 -0
- package/dist/api/effect/channels.js +2 -0
- package/dist/api/effect/channels.js.map +1 -0
- package/dist/api/effect/client.d.ts +622 -0
- package/dist/api/effect/client.d.ts.map +1 -0
- package/dist/api/effect/client.js +191 -0
- package/dist/api/effect/client.js.map +1 -0
- package/dist/api/effect/collectors.d.ts +90 -0
- package/dist/api/effect/collectors.d.ts.map +1 -0
- package/dist/api/effect/collectors.js +2 -0
- package/dist/api/effect/collectors.js.map +1 -0
- package/dist/api/effect/commands.d.ts +86 -0
- package/dist/api/effect/commands.d.ts.map +1 -0
- package/dist/api/effect/commands.js +87 -0
- package/dist/api/effect/commands.js.map +1 -0
- package/dist/api/effect/direct-messages.d.ts +102 -0
- package/dist/api/effect/direct-messages.d.ts.map +1 -0
- package/dist/api/effect/direct-messages.js +2 -0
- package/dist/api/effect/direct-messages.js.map +1 -0
- package/dist/api/effect/discovery.d.ts +68 -0
- package/dist/api/effect/discovery.d.ts.map +1 -0
- package/dist/api/effect/discovery.js +2 -0
- package/dist/api/effect/discovery.js.map +1 -0
- package/dist/api/effect/emojis.d.ts +77 -0
- package/dist/api/effect/emojis.d.ts.map +1 -0
- package/dist/api/effect/emojis.js +2 -0
- package/dist/api/effect/emojis.js.map +1 -0
- package/dist/api/effect/events.d.ts +78 -0
- package/dist/api/effect/events.d.ts.map +1 -0
- package/dist/api/effect/events.js +12 -0
- package/dist/api/effect/events.js.map +1 -0
- package/dist/api/effect/failures.d.ts +14 -0
- package/dist/api/effect/failures.d.ts.map +1 -0
- package/dist/api/effect/failures.js +2 -0
- package/dist/api/effect/failures.js.map +1 -0
- package/dist/api/effect/gateway.d.ts +63 -0
- package/dist/api/effect/gateway.d.ts.map +1 -0
- package/dist/api/effect/gateway.js +2 -0
- package/dist/api/effect/gateway.js.map +1 -0
- package/dist/api/effect/guards.d.ts +91 -0
- package/dist/api/effect/guards.d.ts.map +1 -0
- package/dist/api/effect/guards.js +94 -0
- package/dist/api/effect/guards.js.map +1 -0
- package/dist/api/effect/guilds.d.ts +221 -0
- package/dist/api/effect/guilds.d.ts.map +1 -0
- package/dist/api/effect/guilds.js +2 -0
- package/dist/api/effect/guilds.js.map +1 -0
- package/dist/api/effect/helpers.d.ts +300 -0
- package/dist/api/effect/helpers.d.ts.map +1 -0
- package/dist/api/effect/helpers.js +156 -0
- package/dist/api/effect/helpers.js.map +1 -0
- package/dist/api/effect/hierarchy.d.ts +26 -0
- package/dist/api/effect/hierarchy.d.ts.map +1 -0
- package/dist/api/effect/hierarchy.js +26 -0
- package/dist/api/effect/hierarchy.js.map +1 -0
- package/dist/api/effect/instance.d.ts +46 -0
- package/dist/api/effect/instance.d.ts.map +1 -0
- package/dist/api/effect/instance.js +8 -0
- package/dist/api/effect/instance.js.map +1 -0
- package/dist/api/effect/invites.d.ts +49 -0
- package/dist/api/effect/invites.d.ts.map +1 -0
- package/dist/api/effect/invites.js +2 -0
- package/dist/api/effect/invites.js.map +1 -0
- package/dist/api/effect/logging.d.ts +37 -0
- package/dist/api/effect/logging.d.ts.map +1 -0
- package/dist/api/effect/logging.js +2 -0
- package/dist/api/effect/logging.js.map +1 -0
- package/dist/api/effect/members.d.ts +433 -0
- package/dist/api/effect/members.d.ts.map +1 -0
- package/dist/api/effect/members.js +2 -0
- package/dist/api/effect/members.js.map +1 -0
- package/dist/api/effect/messages.d.ts +877 -0
- package/dist/api/effect/messages.d.ts.map +1 -0
- package/dist/api/effect/messages.js +2 -0
- package/dist/api/effect/messages.js.map +1 -0
- package/dist/api/effect/oauth.d.ts +148 -0
- package/dist/api/effect/oauth.d.ts.map +1 -0
- package/dist/api/effect/oauth.js +51 -0
- package/dist/api/effect/oauth.js.map +1 -0
- package/dist/api/effect/permissions.d.ts +41 -0
- package/dist/api/effect/permissions.d.ts.map +1 -0
- package/dist/api/effect/permissions.js +2 -0
- package/dist/api/effect/permissions.js.map +1 -0
- package/dist/api/effect/presence.d.ts +83 -0
- package/dist/api/effect/presence.d.ts.map +1 -0
- package/dist/api/effect/presence.js +2 -0
- package/dist/api/effect/presence.js.map +1 -0
- package/dist/api/effect/rest.d.ts +27 -0
- package/dist/api/effect/rest.d.ts.map +1 -0
- package/dist/api/effect/rest.js +2 -0
- package/dist/api/effect/rest.js.map +1 -0
- package/dist/api/effect/roles.d.ts +104 -0
- package/dist/api/effect/roles.d.ts.map +1 -0
- package/dist/api/effect/roles.js +2 -0
- package/dist/api/effect/roles.js.map +1 -0
- package/dist/api/effect/service.d.ts +76 -0
- package/dist/api/effect/service.d.ts.map +1 -0
- package/dist/api/effect/service.js +79 -0
- package/dist/api/effect/service.js.map +1 -0
- package/dist/api/effect/stickers.d.ts +81 -0
- package/dist/api/effect/stickers.d.ts.map +1 -0
- package/dist/api/effect/stickers.js +2 -0
- package/dist/api/effect/stickers.js.map +1 -0
- package/dist/api/effect/supervisor.d.ts +56 -0
- package/dist/api/effect/supervisor.d.ts.map +1 -0
- package/dist/api/effect/supervisor.js +58 -0
- package/dist/api/effect/supervisor.js.map +1 -0
- package/dist/api/effect/threads.d.ts +154 -0
- package/dist/api/effect/threads.d.ts.map +1 -0
- package/dist/api/effect/threads.js +2 -0
- package/dist/api/effect/threads.js.map +1 -0
- package/dist/api/effect/users.d.ts +62 -0
- package/dist/api/effect/users.d.ts.map +1 -0
- package/dist/api/effect/users.js +2 -0
- package/dist/api/effect/users.js.map +1 -0
- package/dist/api/effect/webhook-client.d.ts +140 -0
- package/dist/api/effect/webhook-client.d.ts.map +1 -0
- package/dist/api/effect/webhook-client.js +50 -0
- package/dist/api/effect/webhook-client.js.map +1 -0
- package/dist/api/effect/webhooks.d.ts +54 -0
- package/dist/api/effect/webhooks.d.ts.map +1 -0
- package/dist/api/effect/webhooks.js +2 -0
- package/dist/api/effect/webhooks.js.map +1 -0
- package/dist/api-errors.d.ts +609 -0
- package/dist/api-errors.d.ts.map +1 -0
- package/dist/api-errors.js +589 -0
- package/dist/api-errors.js.map +1 -0
- package/dist/application.d.ts +85 -0
- package/dist/application.d.ts.map +1 -0
- package/dist/application.js +44 -0
- package/dist/application.js.map +1 -0
- package/dist/assets.d.ts +197 -0
- package/dist/assets.d.ts.map +1 -0
- package/dist/assets.js +419 -0
- package/dist/assets.js.map +1 -0
- package/dist/attachments.d.ts +400 -0
- package/dist/attachments.d.ts.map +1 -0
- package/dist/attachments.js +88 -0
- package/dist/attachments.js.map +1 -0
- package/dist/audit-logs.d.ts +292 -0
- package/dist/audit-logs.d.ts.map +1 -0
- package/dist/audit-logs.js +46 -0
- package/dist/audit-logs.js.map +1 -0
- package/dist/bot-runner.d.ts +69 -0
- package/dist/bot-runner.d.ts.map +1 -0
- package/dist/bot-runner.js +41 -0
- package/dist/bot-runner.js.map +1 -0
- package/dist/builders.d.ts +153 -0
- package/dist/builders.d.ts.map +1 -0
- package/dist/builders.js +326 -0
- package/dist/builders.js.map +1 -0
- package/dist/cache.d.ts +187 -0
- package/dist/cache.d.ts.map +1 -0
- package/dist/cache.js +2 -0
- package/dist/cache.js.map +1 -0
- package/dist/channels.d.ts +903 -0
- package/dist/channels.d.ts.map +1 -0
- package/dist/channels.js +125 -0
- package/dist/channels.js.map +1 -0
- package/dist/cli.d.ts +9 -0
- package/dist/cli.d.ts.map +1 -0
- package/dist/cli.js +65 -0
- package/dist/cli.js.map +1 -0
- package/dist/client.d.ts +645 -0
- package/dist/client.d.ts.map +1 -0
- package/dist/client.js +2 -0
- package/dist/client.js.map +1 -0
- package/dist/collectors.d.ts +205 -0
- package/dist/collectors.d.ts.map +1 -0
- package/dist/collectors.js +71 -0
- package/dist/collectors.js.map +1 -0
- package/dist/colors.d.ts +55 -0
- package/dist/colors.d.ts.map +1 -0
- package/dist/colors.js +40 -0
- package/dist/colors.js.map +1 -0
- package/dist/command-arguments.d.ts +353 -0
- package/dist/command-arguments.d.ts.map +1 -0
- package/dist/command-arguments.js +2 -0
- package/dist/command-arguments.js.map +1 -0
- package/dist/command-help.d.ts +54 -0
- package/dist/command-help.d.ts.map +1 -0
- package/dist/command-help.js +2 -0
- package/dist/command-help.js.map +1 -0
- package/dist/commands.d.ts +328 -0
- package/dist/commands.d.ts.map +1 -0
- package/dist/commands.js +62 -0
- package/dist/commands.js.map +1 -0
- package/dist/counts.d.ts +124 -0
- package/dist/counts.d.ts.map +1 -0
- package/dist/counts.js +52 -0
- package/dist/counts.js.map +1 -0
- package/dist/default-commands.d.ts +400 -0
- package/dist/default-commands.d.ts.map +1 -0
- package/dist/default-commands.js +488 -0
- package/dist/default-commands.js.map +1 -0
- package/dist/default-supervisor.d.ts +111 -0
- package/dist/default-supervisor.d.ts.map +1 -0
- package/dist/default-supervisor.js +277 -0
- package/dist/default-supervisor.js.map +1 -0
- package/dist/discovery.d.ts +223 -0
- package/dist/discovery.d.ts.map +1 -0
- package/dist/discovery.js +18 -0
- package/dist/discovery.js.map +1 -0
- package/dist/effect-testing.d.ts +388 -0
- package/dist/effect-testing.d.ts.map +1 -0
- package/dist/effect-testing.js +261 -0
- package/dist/effect-testing.js.map +1 -0
- package/dist/effect.d.ts +220 -0
- package/dist/effect.d.ts.map +1 -0
- package/dist/effect.js +101 -0
- package/dist/effect.js.map +1 -0
- package/dist/embeds.d.ts +243 -0
- package/dist/embeds.d.ts.map +1 -0
- package/dist/embeds.js +2 -0
- package/dist/embeds.js.map +1 -0
- package/dist/error-tools.d.ts +101 -0
- package/dist/error-tools.d.ts.map +1 -0
- package/dist/error-tools.js +125 -0
- package/dist/error-tools.js.map +1 -0
- package/dist/errors.d.ts +386 -0
- package/dist/errors.d.ts.map +1 -0
- package/dist/errors.js +440 -0
- package/dist/errors.js.map +1 -0
- package/dist/events.d.ts +798 -0
- package/dist/events.d.ts.map +1 -0
- package/dist/events.js +2 -0
- package/dist/events.js.map +1 -0
- package/dist/expressions.d.ts +188 -0
- package/dist/expressions.d.ts.map +1 -0
- package/dist/expressions.js +2 -0
- package/dist/expressions.js.map +1 -0
- package/dist/failures.d.ts +53 -0
- package/dist/failures.d.ts.map +1 -0
- package/dist/failures.js +2 -0
- package/dist/failures.js.map +1 -0
- package/dist/gateway.d.ts +48 -0
- package/dist/gateway.d.ts.map +1 -0
- package/dist/gateway.js +60 -0
- package/dist/gateway.js.map +1 -0
- package/dist/guilds.d.ts +923 -0
- package/dist/guilds.d.ts.map +1 -0
- package/dist/guilds.js +204 -0
- package/dist/guilds.js.map +1 -0
- package/dist/helpers.d.ts +423 -0
- package/dist/helpers.d.ts.map +1 -0
- package/dist/helpers.js +434 -0
- package/dist/helpers.js.map +1 -0
- package/dist/index.d.ts +228 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +109 -0
- package/dist/index.js.map +1 -0
- package/dist/input-validation.d.ts +51 -0
- package/dist/input-validation.d.ts.map +1 -0
- package/dist/input-validation.js +34 -0
- package/dist/input-validation.js.map +1 -0
- package/dist/instance.d.ts +101 -0
- package/dist/instance.d.ts.map +1 -0
- package/dist/instance.js +2 -0
- package/dist/instance.js.map +1 -0
- package/dist/internal/agents-section.d.ts +22 -0
- package/dist/internal/agents-section.d.ts.map +1 -0
- package/dist/internal/agents-section.js +101 -0
- package/dist/internal/agents-section.js.map +1 -0
- package/dist/internal/application.d.ts +16 -0
- package/dist/internal/application.d.ts.map +1 -0
- package/dist/internal/application.js +33 -0
- package/dist/internal/application.js.map +1 -0
- package/dist/internal/attachment-refresh.d.ts +18 -0
- package/dist/internal/attachment-refresh.d.ts.map +1 -0
- package/dist/internal/attachment-refresh.js +39 -0
- package/dist/internal/attachment-refresh.js.map +1 -0
- package/dist/internal/attachments.d.ts +45 -0
- package/dist/internal/attachments.d.ts.map +1 -0
- package/dist/internal/attachments.js +230 -0
- package/dist/internal/attachments.js.map +1 -0
- package/dist/internal/audit-logs.d.ts +13 -0
- package/dist/internal/audit-logs.d.ts.map +1 -0
- package/dist/internal/audit-logs.js +295 -0
- package/dist/internal/audit-logs.js.map +1 -0
- package/dist/internal/audit.d.ts +12 -0
- package/dist/internal/audit.d.ts.map +1 -0
- package/dist/internal/audit.js +22 -0
- package/dist/internal/audit.js.map +1 -0
- package/dist/internal/binding/default-adapters.d.ts +22 -0
- package/dist/internal/binding/default-adapters.d.ts.map +1 -0
- package/dist/internal/binding/default-adapters.js +304 -0
- package/dist/internal/binding/default-adapters.js.map +1 -0
- package/dist/internal/binding/default.d.ts +45 -0
- package/dist/internal/binding/default.d.ts.map +1 -0
- package/dist/internal/binding/default.js +86 -0
- package/dist/internal/binding/default.js.map +1 -0
- package/dist/internal/binding/execute.d.ts +51 -0
- package/dist/internal/binding/execute.d.ts.map +1 -0
- package/dist/internal/binding/execute.js +123 -0
- package/dist/internal/binding/execute.js.map +1 -0
- package/dist/internal/binding/native-adapters.d.ts +23 -0
- package/dist/internal/binding/native-adapters.d.ts.map +1 -0
- package/dist/internal/binding/native-adapters.js +90 -0
- package/dist/internal/binding/native-adapters.js.map +1 -0
- package/dist/internal/binding/native.d.ts +41 -0
- package/dist/internal/binding/native.d.ts.map +1 -0
- package/dist/internal/binding/native.js +34 -0
- package/dist/internal/binding/native.js.map +1 -0
- package/dist/internal/binding/operations.d.ts +361 -0
- package/dist/internal/binding/operations.d.ts.map +1 -0
- package/dist/internal/binding/operations.js +272 -0
- package/dist/internal/binding/operations.js.map +1 -0
- package/dist/internal/bot-runner.d.ts +65 -0
- package/dist/internal/bot-runner.d.ts.map +1 -0
- package/dist/internal/bot-runner.js +363 -0
- package/dist/internal/bot-runner.js.map +1 -0
- package/dist/internal/cache-changes.d.ts +43 -0
- package/dist/internal/cache-changes.d.ts.map +1 -0
- package/dist/internal/cache-changes.js +320 -0
- package/dist/internal/cache-changes.js.map +1 -0
- package/dist/internal/cache.d.ts +57 -0
- package/dist/internal/cache.d.ts.map +1 -0
- package/dist/internal/cache.js +318 -0
- package/dist/internal/cache.js.map +1 -0
- package/dist/internal/calls.d.ts +16 -0
- package/dist/internal/calls.d.ts.map +1 -0
- package/dist/internal/calls.js +108 -0
- package/dist/internal/calls.js.map +1 -0
- package/dist/internal/channel-cache.d.ts +69 -0
- package/dist/internal/channel-cache.d.ts.map +1 -0
- package/dist/internal/channel-cache.js +413 -0
- package/dist/internal/channel-cache.js.map +1 -0
- package/dist/internal/channel-decode.d.ts +44 -0
- package/dist/internal/channel-decode.d.ts.map +1 -0
- package/dist/internal/channel-decode.js +377 -0
- package/dist/internal/channel-decode.js.map +1 -0
- package/dist/internal/channels.d.ts +60 -0
- package/dist/internal/channels.d.ts.map +1 -0
- package/dist/internal/channels.js +605 -0
- package/dist/internal/channels.js.map +1 -0
- package/dist/internal/client/backoff.d.ts +42 -0
- package/dist/internal/client/backoff.d.ts.map +1 -0
- package/dist/internal/client/backoff.js +36 -0
- package/dist/internal/client/backoff.js.map +1 -0
- package/dist/internal/client/configuration-fields.d.ts +14 -0
- package/dist/internal/client/configuration-fields.d.ts.map +1 -0
- package/dist/internal/client/configuration-fields.js +11 -0
- package/dist/internal/client/configuration-fields.js.map +1 -0
- package/dist/internal/client/drain.d.ts +33 -0
- package/dist/internal/client/drain.d.ts.map +1 -0
- package/dist/internal/client/drain.js +109 -0
- package/dist/internal/client/drain.js.map +1 -0
- package/dist/internal/client/intake.d.ts +27 -0
- package/dist/internal/client/intake.d.ts.map +1 -0
- package/dist/internal/client/intake.js +198 -0
- package/dist/internal/client/intake.js.map +1 -0
- package/dist/internal/client/lifetime.d.ts +35 -0
- package/dist/internal/client/lifetime.d.ts.map +1 -0
- package/dist/internal/client/lifetime.js +109 -0
- package/dist/internal/client/lifetime.js.map +1 -0
- package/dist/internal/client/shard-loop.d.ts +93 -0
- package/dist/internal/client/shard-loop.d.ts.map +1 -0
- package/dist/internal/client/shard-loop.js +452 -0
- package/dist/internal/client/shard-loop.js.map +1 -0
- package/dist/internal/client-registry.d.ts +26 -0
- package/dist/internal/client-registry.d.ts.map +1 -0
- package/dist/internal/client-registry.js +11 -0
- package/dist/internal/client-registry.js.map +1 -0
- package/dist/internal/client.d.ts +189 -0
- package/dist/internal/client.d.ts.map +1 -0
- package/dist/internal/client.js +1935 -0
- package/dist/internal/client.js.map +1 -0
- package/dist/internal/clock.d.ts +9 -0
- package/dist/internal/clock.d.ts.map +1 -0
- package/dist/internal/clock.js +5 -0
- package/dist/internal/clock.js.map +1 -0
- package/dist/internal/code-catalogue.d.ts +712 -0
- package/dist/internal/code-catalogue.d.ts.map +1 -0
- package/dist/internal/code-catalogue.js +655 -0
- package/dist/internal/code-catalogue.js.map +1 -0
- package/dist/internal/collector.d.ts +34 -0
- package/dist/internal/collector.d.ts.map +1 -0
- package/dist/internal/collector.js +400 -0
- package/dist/internal/collector.js.map +1 -0
- package/dist/internal/command-arguments.d.ts +29 -0
- package/dist/internal/command-arguments.d.ts.map +1 -0
- package/dist/internal/command-arguments.js +484 -0
- package/dist/internal/command-arguments.js.map +1 -0
- package/dist/internal/command-guards.d.ts +57 -0
- package/dist/internal/command-guards.d.ts.map +1 -0
- package/dist/internal/command-guards.js +81 -0
- package/dist/internal/command-guards.js.map +1 -0
- package/dist/internal/command-help.d.ts +15 -0
- package/dist/internal/command-help.d.ts.map +1 -0
- package/dist/internal/command-help.js +121 -0
- package/dist/internal/command-help.js.map +1 -0
- package/dist/internal/commands.d.ts +212 -0
- package/dist/internal/commands.d.ts.map +1 -0
- package/dist/internal/commands.js +1004 -0
- package/dist/internal/commands.js.map +1 -0
- package/dist/internal/configuration.d.ts +86 -0
- package/dist/internal/configuration.d.ts.map +1 -0
- package/dist/internal/configuration.js +401 -0
- package/dist/internal/configuration.js.map +1 -0
- package/dist/internal/counts.d.ts +33 -0
- package/dist/internal/counts.d.ts.map +1 -0
- package/dist/internal/counts.js +348 -0
- package/dist/internal/counts.js.map +1 -0
- package/dist/internal/decode/primitives.d.ts +30 -0
- package/dist/internal/decode/primitives.d.ts.map +1 -0
- package/dist/internal/decode/primitives.js +56 -0
- package/dist/internal/decode/primitives.js.map +1 -0
- package/dist/internal/decode/timestamp.d.ts +13 -0
- package/dist/internal/decode/timestamp.d.ts.map +1 -0
- package/dist/internal/decode/timestamp.js +27 -0
- package/dist/internal/decode/timestamp.js.map +1 -0
- package/dist/internal/decode/trace.d.ts +11 -0
- package/dist/internal/decode/trace.d.ts.map +1 -0
- package/dist/internal/decode/trace.js +69 -0
- package/dist/internal/decode/trace.js.map +1 -0
- package/dist/internal/defects.d.ts +48 -0
- package/dist/internal/defects.d.ts.map +1 -0
- package/dist/internal/defects.js +100 -0
- package/dist/internal/defects.js.map +1 -0
- package/dist/internal/effect-failures.d.ts +12 -0
- package/dist/internal/effect-failures.d.ts.map +1 -0
- package/dist/internal/effect-failures.js +45 -0
- package/dist/internal/effect-failures.js.map +1 -0
- package/dist/internal/embeds.d.ts +12 -0
- package/dist/internal/embeds.d.ts.map +1 -0
- package/dist/internal/embeds.js +308 -0
- package/dist/internal/embeds.js.map +1 -0
- package/dist/internal/events.d.ts +156 -0
- package/dist/internal/events.d.ts.map +1 -0
- package/dist/internal/events.js +1071 -0
- package/dist/internal/events.js.map +1 -0
- package/dist/internal/expiry-queue.d.ts +42 -0
- package/dist/internal/expiry-queue.d.ts.map +1 -0
- package/dist/internal/expiry-queue.js +138 -0
- package/dist/internal/expiry-queue.js.map +1 -0
- package/dist/internal/expressions.d.ts +35 -0
- package/dist/internal/expressions.d.ts.map +1 -0
- package/dist/internal/expressions.js +311 -0
- package/dist/internal/expressions.js.map +1 -0
- package/dist/internal/failures.d.ts +107 -0
- package/dist/internal/failures.d.ts.map +1 -0
- package/dist/internal/failures.js +416 -0
- package/dist/internal/failures.js.map +1 -0
- package/dist/internal/field-text.d.ts +10 -0
- package/dist/internal/field-text.d.ts.map +1 -0
- package/dist/internal/field-text.js +37 -0
- package/dist/internal/field-text.js.map +1 -0
- package/dist/internal/gateway/commands.d.ts +92 -0
- package/dist/internal/gateway/commands.d.ts.map +1 -0
- package/dist/internal/gateway/commands.js +223 -0
- package/dist/internal/gateway/commands.js.map +1 -0
- package/dist/internal/gateway/dispatch-table.d.ts +42 -0
- package/dist/internal/gateway/dispatch-table.d.ts.map +1 -0
- package/dist/internal/gateway/dispatch-table.js +288 -0
- package/dist/internal/gateway/dispatch-table.js.map +1 -0
- package/dist/internal/gateway/event-dispatches.d.ts +97 -0
- package/dist/internal/gateway/event-dispatches.d.ts.map +1 -0
- package/dist/internal/gateway/event-dispatches.js +172 -0
- package/dist/internal/gateway/event-dispatches.js.map +1 -0
- package/dist/internal/gateway/frames.d.ts +45 -0
- package/dist/internal/gateway/frames.d.ts.map +1 -0
- package/dist/internal/gateway/frames.js +121 -0
- package/dist/internal/gateway/frames.js.map +1 -0
- package/dist/internal/gateway/options.d.ts +24 -0
- package/dist/internal/gateway/options.d.ts.map +1 -0
- package/dist/internal/gateway/options.js +103 -0
- package/dist/internal/gateway/options.js.map +1 -0
- package/dist/internal/gateway/session.d.ts +104 -0
- package/dist/internal/gateway/session.d.ts.map +1 -0
- package/dist/internal/gateway/session.js +420 -0
- package/dist/internal/gateway/session.js.map +1 -0
- package/dist/internal/gateway-requests.d.ts +10 -0
- package/dist/internal/gateway-requests.d.ts.map +1 -0
- package/dist/internal/gateway-requests.js +26 -0
- package/dist/internal/gateway-requests.js.map +1 -0
- package/dist/internal/gateway.d.ts +19 -0
- package/dist/internal/gateway.d.ts.map +1 -0
- package/dist/internal/gateway.js +11 -0
- package/dist/internal/gateway.js.map +1 -0
- package/dist/internal/guild-cache.d.ts +69 -0
- package/dist/internal/guild-cache.d.ts.map +1 -0
- package/dist/internal/guild-cache.js +402 -0
- package/dist/internal/guild-cache.js.map +1 -0
- package/dist/internal/guild-discovery.d.ts +15 -0
- package/dist/internal/guild-discovery.d.ts.map +1 -0
- package/dist/internal/guild-discovery.js +258 -0
- package/dist/internal/guild-discovery.js.map +1 -0
- package/dist/internal/guild-lifecycle.d.ts +18 -0
- package/dist/internal/guild-lifecycle.d.ts.map +1 -0
- package/dist/internal/guild-lifecycle.js +119 -0
- package/dist/internal/guild-lifecycle.js.map +1 -0
- package/dist/internal/guild-settings.d.ts +11 -0
- package/dist/internal/guild-settings.d.ts.map +1 -0
- package/dist/internal/guild-settings.js +150 -0
- package/dist/internal/guild-settings.js.map +1 -0
- package/dist/internal/guilds.d.ts +94 -0
- package/dist/internal/guilds.d.ts.map +1 -0
- package/dist/internal/guilds.js +785 -0
- package/dist/internal/guilds.js.map +1 -0
- package/dist/internal/init-command.d.ts +54 -0
- package/dist/internal/init-command.d.ts.map +1 -0
- package/dist/internal/init-command.js +248 -0
- package/dist/internal/init-command.js.map +1 -0
- package/dist/internal/instance.d.ts +69 -0
- package/dist/internal/instance.d.ts.map +1 -0
- package/dist/internal/instance.js +455 -0
- package/dist/internal/instance.js.map +1 -0
- package/dist/internal/invalid-callback-return.d.ts +3 -0
- package/dist/internal/invalid-callback-return.d.ts.map +1 -0
- package/dist/internal/invalid-callback-return.js +26 -0
- package/dist/internal/invalid-callback-return.js.map +1 -0
- package/dist/internal/invites.d.ts +19 -0
- package/dist/internal/invites.d.ts.map +1 -0
- package/dist/internal/invites.js +182 -0
- package/dist/internal/invites.js.map +1 -0
- package/dist/internal/logging.d.ts +129 -0
- package/dist/internal/logging.d.ts.map +1 -0
- package/dist/internal/logging.js +868 -0
- package/dist/internal/logging.js.map +1 -0
- package/dist/internal/logical-scheduler.d.ts +27 -0
- package/dist/internal/logical-scheduler.d.ts.map +1 -0
- package/dist/internal/logical-scheduler.js +102 -0
- package/dist/internal/logical-scheduler.js.map +1 -0
- package/dist/internal/masking.d.ts +13 -0
- package/dist/internal/masking.d.ts.map +1 -0
- package/dist/internal/masking.js +235 -0
- package/dist/internal/masking.js.map +1 -0
- package/dist/internal/member-chunks.d.ts +96 -0
- package/dist/internal/member-chunks.d.ts.map +1 -0
- package/dist/internal/member-chunks.js +557 -0
- package/dist/internal/member-chunks.js.map +1 -0
- package/dist/internal/member-search-workflow.d.ts +19 -0
- package/dist/internal/member-search-workflow.d.ts.map +1 -0
- package/dist/internal/member-search-workflow.js +143 -0
- package/dist/internal/member-search-workflow.js.map +1 -0
- package/dist/internal/member-search.d.ts +20 -0
- package/dist/internal/member-search.d.ts.map +1 -0
- package/dist/internal/member-search.js +201 -0
- package/dist/internal/member-search.js.map +1 -0
- package/dist/internal/message-cleanup.d.ts +9 -0
- package/dist/internal/message-cleanup.d.ts.map +1 -0
- package/dist/internal/message-cleanup.js +368 -0
- package/dist/internal/message-cleanup.js.map +1 -0
- package/dist/internal/message-fields.d.ts +9 -0
- package/dist/internal/message-fields.d.ts.map +1 -0
- package/dist/internal/message-fields.js +55 -0
- package/dist/internal/message-fields.js.map +1 -0
- package/dist/internal/message-search-workflow.d.ts +14 -0
- package/dist/internal/message-search-workflow.d.ts.map +1 -0
- package/dist/internal/message-search-workflow.js +101 -0
- package/dist/internal/message-search-workflow.js.map +1 -0
- package/dist/internal/message-search.d.ts +19 -0
- package/dist/internal/message-search.d.ts.map +1 -0
- package/dist/internal/message-search.js +317 -0
- package/dist/internal/message-search.js.map +1 -0
- package/dist/internal/message.d.ts +34 -0
- package/dist/internal/message.d.ts.map +1 -0
- package/dist/internal/message.js +723 -0
- package/dist/internal/message.js.map +1 -0
- package/dist/internal/metrics.d.ts +16 -0
- package/dist/internal/metrics.d.ts.map +1 -0
- package/dist/internal/metrics.js +49 -0
- package/dist/internal/metrics.js.map +1 -0
- package/dist/internal/moderation.d.ts +20 -0
- package/dist/internal/moderation.d.ts.map +1 -0
- package/dist/internal/moderation.js +219 -0
- package/dist/internal/moderation.js.map +1 -0
- package/dist/internal/multipart.d.ts +10 -0
- package/dist/internal/multipart.d.ts.map +1 -0
- package/dist/internal/multipart.js +156 -0
- package/dist/internal/multipart.js.map +1 -0
- package/dist/internal/node-version.d.ts +10 -0
- package/dist/internal/node-version.d.ts.map +1 -0
- package/dist/internal/node-version.js +21 -0
- package/dist/internal/node-version.js.map +1 -0
- package/dist/internal/oauth.d.ts +29 -0
- package/dist/internal/oauth.d.ts.map +1 -0
- package/dist/internal/oauth.js +721 -0
- package/dist/internal/oauth.js.map +1 -0
- package/dist/internal/observer.d.ts +21 -0
- package/dist/internal/observer.d.ts.map +1 -0
- package/dist/internal/observer.js +48 -0
- package/dist/internal/observer.js.map +1 -0
- package/dist/internal/operation-signal.d.ts +9 -0
- package/dist/internal/operation-signal.d.ts.map +1 -0
- package/dist/internal/operation-signal.js +19 -0
- package/dist/internal/operation-signal.js.map +1 -0
- package/dist/internal/pagination.d.ts +67 -0
- package/dist/internal/pagination.d.ts.map +1 -0
- package/dist/internal/pagination.js +306 -0
- package/dist/internal/pagination.js.map +1 -0
- package/dist/internal/permission-requirements.d.ts +34 -0
- package/dist/internal/permission-requirements.d.ts.map +1 -0
- package/dist/internal/permission-requirements.js +204 -0
- package/dist/internal/permission-requirements.js.map +1 -0
- package/dist/internal/permissions.d.ts +28 -0
- package/dist/internal/permissions.d.ts.map +1 -0
- package/dist/internal/permissions.js +314 -0
- package/dist/internal/permissions.js.map +1 -0
- package/dist/internal/pins.d.ts +24 -0
- package/dist/internal/pins.d.ts.map +1 -0
- package/dist/internal/pins.js +83 -0
- package/dist/internal/pins.js.map +1 -0
- package/dist/internal/presence.d.ts +101 -0
- package/dist/internal/presence.d.ts.map +1 -0
- package/dist/internal/presence.js +581 -0
- package/dist/internal/presence.js.map +1 -0
- package/dist/internal/protocol/gateway.d.ts +116 -0
- package/dist/internal/protocol/gateway.d.ts.map +1 -0
- package/dist/internal/protocol/gateway.js +258 -0
- package/dist/internal/protocol/gateway.js.map +1 -0
- package/dist/internal/rate-limit-templates.d.ts +2 -0
- package/dist/internal/rate-limit-templates.d.ts.map +1 -0
- package/dist/internal/rate-limit-templates.js +132 -0
- package/dist/internal/rate-limit-templates.js.map +1 -0
- package/dist/internal/rate-limits.d.ts +32 -0
- package/dist/internal/rate-limits.d.ts.map +1 -0
- package/dist/internal/rate-limits.js +306 -0
- package/dist/internal/rate-limits.js.map +1 -0
- package/dist/internal/reaction-collector.d.ts +39 -0
- package/dist/internal/reaction-collector.d.ts.map +1 -0
- package/dist/internal/reaction-collector.js +441 -0
- package/dist/internal/reaction-collector.js.map +1 -0
- package/dist/internal/reaction-pages.d.ts +18 -0
- package/dist/internal/reaction-pages.d.ts.map +1 -0
- package/dist/internal/reaction-pages.js +213 -0
- package/dist/internal/reaction-pages.js.map +1 -0
- package/dist/internal/reactions.d.ts +30 -0
- package/dist/internal/reactions.d.ts.map +1 -0
- package/dist/internal/reactions.js +160 -0
- package/dist/internal/reactions.js.map +1 -0
- package/dist/internal/rejection-scope.d.ts +25 -0
- package/dist/internal/rejection-scope.d.ts.map +1 -0
- package/dist/internal/rejection-scope.js +103 -0
- package/dist/internal/rejection-scope.js.map +1 -0
- package/dist/internal/response-json.d.ts +12 -0
- package/dist/internal/response-json.d.ts.map +1 -0
- package/dist/internal/response-json.js +74 -0
- package/dist/internal/response-json.js.map +1 -0
- package/dist/internal/rest/admission.d.ts +77 -0
- package/dist/internal/rest/admission.d.ts.map +1 -0
- package/dist/internal/rest/admission.js +178 -0
- package/dist/internal/rest/admission.js.map +1 -0
- package/dist/internal/rest/attempt.d.ts +124 -0
- package/dist/internal/rest/attempt.d.ts.map +1 -0
- package/dist/internal/rest/attempt.js +410 -0
- package/dist/internal/rest/attempt.js.map +1 -0
- package/dist/internal/rest/classify.d.ts +93 -0
- package/dist/internal/rest/classify.d.ts.map +1 -0
- package/dist/internal/rest/classify.js +304 -0
- package/dist/internal/rest/classify.js.map +1 -0
- package/dist/internal/rest/download.d.ts +66 -0
- package/dist/internal/rest/download.d.ts.map +1 -0
- package/dist/internal/rest/download.js +552 -0
- package/dist/internal/rest/download.js.map +1 -0
- package/dist/internal/rest/options.d.ts +42 -0
- package/dist/internal/rest/options.d.ts.map +1 -0
- package/dist/internal/rest/options.js +99 -0
- package/dist/internal/rest/options.js.map +1 -0
- package/dist/internal/rest/owner.d.ts +154 -0
- package/dist/internal/rest/owner.d.ts.map +1 -0
- package/dist/internal/rest/owner.js +1292 -0
- package/dist/internal/rest/owner.js.map +1 -0
- package/dist/internal/rest/request.d.ts +31 -0
- package/dist/internal/rest/request.d.ts.map +1 -0
- package/dist/internal/rest/request.js +227 -0
- package/dist/internal/rest/request.js.map +1 -0
- package/dist/internal/rest.d.ts +10 -0
- package/dist/internal/rest.d.ts.map +1 -0
- package/dist/internal/rest.js +9 -0
- package/dist/internal/rest.js.map +1 -0
- package/dist/internal/retention-age.d.ts +11 -0
- package/dist/internal/retention-age.d.ts.map +1 -0
- package/dist/internal/retention-age.js +29 -0
- package/dist/internal/retention-age.js.map +1 -0
- package/dist/internal/role-hierarchy-workflow.d.ts +15 -0
- package/dist/internal/role-hierarchy-workflow.d.ts.map +1 -0
- package/dist/internal/role-hierarchy-workflow.js +122 -0
- package/dist/internal/role-hierarchy-workflow.js.map +1 -0
- package/dist/internal/role-hierarchy.d.ts +11 -0
- package/dist/internal/role-hierarchy.d.ts.map +1 -0
- package/dist/internal/role-hierarchy.js +87 -0
- package/dist/internal/role-hierarchy.js.map +1 -0
- package/dist/internal/scheduled-tasks.d.ts +46 -0
- package/dist/internal/scheduled-tasks.d.ts.map +1 -0
- package/dist/internal/scheduled-tasks.js +190 -0
- package/dist/internal/scheduled-tasks.js.map +1 -0
- package/dist/internal/sharding.d.ts +62 -0
- package/dist/internal/sharding.d.ts.map +1 -0
- package/dist/internal/sharding.js +205 -0
- package/dist/internal/sharding.js.map +1 -0
- package/dist/internal/starter-project.d.ts +27 -0
- package/dist/internal/starter-project.d.ts.map +1 -0
- package/dist/internal/starter-project.js +224 -0
- package/dist/internal/starter-project.js.map +1 -0
- package/dist/internal/suggest.d.ts +12 -0
- package/dist/internal/suggest.d.ts.map +1 -0
- package/dist/internal/suggest.js +51 -0
- package/dist/internal/suggest.js.map +1 -0
- package/dist/internal/supervisor.d.ts +95 -0
- package/dist/internal/supervisor.d.ts.map +1 -0
- package/dist/internal/supervisor.js +1829 -0
- package/dist/internal/supervisor.js.map +1 -0
- package/dist/internal/testing/discovery.d.ts +24 -0
- package/dist/internal/testing/discovery.d.ts.map +1 -0
- package/dist/internal/testing/discovery.js +22 -0
- package/dist/internal/testing/discovery.js.map +1 -0
- package/dist/internal/testing/errors.d.ts +43 -0
- package/dist/internal/testing/errors.d.ts.map +1 -0
- package/dist/internal/testing/errors.js +63 -0
- package/dist/internal/testing/errors.js.map +1 -0
- package/dist/internal/testing/fixtures.d.ts +477 -0
- package/dist/internal/testing/fixtures.d.ts.map +1 -0
- package/dist/internal/testing/fixtures.js +233 -0
- package/dist/internal/testing/fixtures.js.map +1 -0
- package/dist/internal/testing/gateway.d.ts +51 -0
- package/dist/internal/testing/gateway.d.ts.map +1 -0
- package/dist/internal/testing/gateway.js +265 -0
- package/dist/internal/testing/gateway.js.map +1 -0
- package/dist/internal/testing/harness.d.ts +60 -0
- package/dist/internal/testing/harness.d.ts.map +1 -0
- package/dist/internal/testing/harness.js +280 -0
- package/dist/internal/testing/harness.js.map +1 -0
- package/dist/internal/testing/http.d.ts +31 -0
- package/dist/internal/testing/http.d.ts.map +1 -0
- package/dist/internal/testing/http.js +347 -0
- package/dist/internal/testing/http.js.map +1 -0
- package/dist/internal/testing/types.d.ts +222 -0
- package/dist/internal/testing/types.d.ts.map +1 -0
- package/dist/internal/testing/types.js +2 -0
- package/dist/internal/testing/types.js.map +1 -0
- package/dist/internal/testing/wait.d.ts +16 -0
- package/dist/internal/testing/wait.d.ts.map +1 -0
- package/dist/internal/testing/wait.js +55 -0
- package/dist/internal/testing/wait.js.map +1 -0
- package/dist/internal/thread-events.d.ts +40 -0
- package/dist/internal/thread-events.d.ts.map +1 -0
- package/dist/internal/thread-events.js +121 -0
- package/dist/internal/thread-events.js.map +1 -0
- package/dist/internal/threads.d.ts +47 -0
- package/dist/internal/threads.d.ts.map +1 -0
- package/dist/internal/threads.js +587 -0
- package/dist/internal/threads.js.map +1 -0
- package/dist/internal/transfer-source.d.ts +29 -0
- package/dist/internal/transfer-source.d.ts.map +1 -0
- package/dist/internal/transfer-source.js +347 -0
- package/dist/internal/transfer-source.js.map +1 -0
- package/dist/internal/transport/http.d.ts +12 -0
- package/dist/internal/transport/http.d.ts.map +1 -0
- package/dist/internal/transport/http.js +44 -0
- package/dist/internal/transport/http.js.map +1 -0
- package/dist/internal/transport/index.d.ts +21 -0
- package/dist/internal/transport/index.d.ts.map +1 -0
- package/dist/internal/transport/index.js +15 -0
- package/dist/internal/transport/index.js.map +1 -0
- package/dist/internal/transport/socket.d.ts +51 -0
- package/dist/internal/transport/socket.d.ts.map +1 -0
- package/dist/internal/transport/socket.js +27 -0
- package/dist/internal/transport/socket.js.map +1 -0
- package/dist/internal/transport/user-agent.d.ts +7 -0
- package/dist/internal/transport/user-agent.d.ts.map +1 -0
- package/dist/internal/transport/user-agent.js +42 -0
- package/dist/internal/transport/user-agent.js.map +1 -0
- package/dist/internal/uploads.d.ts +23 -0
- package/dist/internal/uploads.d.ts.map +1 -0
- package/dist/internal/uploads.js +89 -0
- package/dist/internal/uploads.js.map +1 -0
- package/dist/internal/user-cache.d.ts +50 -0
- package/dist/internal/user-cache.d.ts.map +1 -0
- package/dist/internal/user-cache.js +273 -0
- package/dist/internal/user-cache.js.map +1 -0
- package/dist/internal/users.d.ts +41 -0
- package/dist/internal/users.d.ts.map +1 -0
- package/dist/internal/users.js +333 -0
- package/dist/internal/users.js.map +1 -0
- package/dist/internal/vanity-url.d.ts +11 -0
- package/dist/internal/vanity-url.d.ts.map +1 -0
- package/dist/internal/vanity-url.js +58 -0
- package/dist/internal/vanity-url.js.map +1 -0
- package/dist/internal/webhooks.d.ts +58 -0
- package/dist/internal/webhooks.d.ts.map +1 -0
- package/dist/internal/webhooks.js +490 -0
- package/dist/internal/webhooks.js.map +1 -0
- package/dist/invites.d.ts +86 -0
- package/dist/invites.d.ts.map +1 -0
- package/dist/invites.js +2 -0
- package/dist/invites.js.map +1 -0
- package/dist/logging.d.ts +228 -0
- package/dist/logging.d.ts.map +1 -0
- package/dist/logging.js +2 -0
- package/dist/logging.js.map +1 -0
- package/dist/member-chunks.d.ts +145 -0
- package/dist/member-chunks.d.ts.map +1 -0
- package/dist/member-chunks.js +68 -0
- package/dist/member-chunks.js.map +1 -0
- package/dist/member-search.d.ts +140 -0
- package/dist/member-search.d.ts.map +1 -0
- package/dist/member-search.js +14 -0
- package/dist/member-search.js.map +1 -0
- package/dist/message-cleanup.d.ts +227 -0
- package/dist/message-cleanup.d.ts.map +1 -0
- package/dist/message-cleanup.js +101 -0
- package/dist/message-cleanup.js.map +1 -0
- package/dist/message-errors.d.ts +172 -0
- package/dist/message-errors.d.ts.map +1 -0
- package/dist/message-errors.js +173 -0
- package/dist/message-errors.js.map +1 -0
- package/dist/message-search.d.ts +201 -0
- package/dist/message-search.d.ts.map +1 -0
- package/dist/message-search.js +2 -0
- package/dist/message-search.js.map +1 -0
- package/dist/messages.d.ts +694 -0
- package/dist/messages.d.ts.map +1 -0
- package/dist/messages.js +37 -0
- package/dist/messages.js.map +1 -0
- package/dist/native-commands.d.ts +451 -0
- package/dist/native-commands.d.ts.map +1 -0
- package/dist/native-commands.js +432 -0
- package/dist/native-commands.js.map +1 -0
- package/dist/native-supervisor.d.ts +125 -0
- package/dist/native-supervisor.d.ts.map +1 -0
- package/dist/native-supervisor.js +126 -0
- package/dist/native-supervisor.js.map +1 -0
- package/dist/oauth.d.ts +298 -0
- package/dist/oauth.d.ts.map +1 -0
- package/dist/oauth.js +128 -0
- package/dist/oauth.js.map +1 -0
- package/dist/observer.d.ts +111 -0
- package/dist/observer.d.ts.map +1 -0
- package/dist/observer.js +2 -0
- package/dist/observer.js.map +1 -0
- package/dist/pagination.d.ts +117 -0
- package/dist/pagination.d.ts.map +1 -0
- package/dist/pagination.js +61 -0
- package/dist/pagination.js.map +1 -0
- package/dist/permissions.d.ts +73 -0
- package/dist/permissions.d.ts.map +1 -0
- package/dist/permissions.js +2 -0
- package/dist/permissions.js.map +1 -0
- package/dist/pins.d.ts +62 -0
- package/dist/pins.d.ts.map +1 -0
- package/dist/pins.js +2 -0
- package/dist/pins.js.map +1 -0
- package/dist/presence.d.ts +84 -0
- package/dist/presence.d.ts.map +1 -0
- package/dist/presence.js +46 -0
- package/dist/presence.js.map +1 -0
- package/dist/reaction-pages.d.ts +99 -0
- package/dist/reaction-pages.d.ts.map +1 -0
- package/dist/reaction-pages.js +2 -0
- package/dist/reaction-pages.js.map +1 -0
- package/dist/reactions.d.ts +118 -0
- package/dist/reactions.d.ts.map +1 -0
- package/dist/reactions.js +2 -0
- package/dist/reactions.js.map +1 -0
- package/dist/rest.d.ts +260 -0
- package/dist/rest.d.ts.map +1 -0
- package/dist/rest.js +46 -0
- package/dist/rest.js.map +1 -0
- package/dist/role-hierarchy.d.ts +81 -0
- package/dist/role-hierarchy.d.ts.map +1 -0
- package/dist/role-hierarchy.js +53 -0
- package/dist/role-hierarchy.js.map +1 -0
- package/dist/sharding.d.ts +219 -0
- package/dist/sharding.d.ts.map +1 -0
- package/dist/sharding.js +86 -0
- package/dist/sharding.js.map +1 -0
- package/dist/supervisor.d.ts +392 -0
- package/dist/supervisor.d.ts.map +1 -0
- package/dist/supervisor.js +101 -0
- package/dist/supervisor.js.map +1 -0
- package/dist/testing.d.ts +258 -0
- package/dist/testing.d.ts.map +1 -0
- package/dist/testing.js +202 -0
- package/dist/testing.js.map +1 -0
- package/dist/text.d.ts +38 -0
- package/dist/text.d.ts.map +1 -0
- package/dist/text.js +46 -0
- package/dist/text.js.map +1 -0
- package/dist/threads.d.ts +258 -0
- package/dist/threads.d.ts.map +1 -0
- package/dist/threads.js +2 -0
- package/dist/threads.js.map +1 -0
- package/dist/users.d.ts +204 -0
- package/dist/users.d.ts.map +1 -0
- package/dist/users.js +44 -0
- package/dist/users.js.map +1 -0
- package/dist/webhooks.d.ts +423 -0
- package/dist/webhooks.d.ts.map +1 -0
- package/dist/webhooks.js +68 -0
- package/dist/webhooks.js.map +1 -0
- package/esm-only.cjs +3 -0
- package/examples/starter/bot-effect.ts +17 -0
- package/examples/starter/bot.js +13 -0
- package/examples/starter/bot.ts +13 -0
- package/package.json +82 -0
- package/src/api/default/application.ts +40 -0
- package/src/api/default/attachments.ts +106 -0
- package/src/api/default/audit-logs.ts +58 -0
- package/src/api/default/bot.ts +586 -0
- package/src/api/default/cache.ts +106 -0
- package/src/api/default/channels.ts +317 -0
- package/src/api/default/client.ts +829 -0
- package/src/api/default/collectors.ts +81 -0
- package/src/api/default/commands.ts +92 -0
- package/src/api/default/direct-messages.ts +143 -0
- package/src/api/default/discovery.ts +103 -0
- package/src/api/default/emojis.ts +125 -0
- package/src/api/default/events.ts +144 -0
- package/src/api/default/gateway.ts +67 -0
- package/src/api/default/guards.ts +173 -0
- package/src/api/default/guilds.ts +271 -0
- package/src/api/default/helpers.ts +97 -0
- package/src/api/default/instance.ts +49 -0
- package/src/api/default/invites.ts +73 -0
- package/src/api/default/logging.ts +37 -0
- package/src/api/default/members.ts +550 -0
- package/src/api/default/messages.ts +1053 -0
- package/src/api/default/oauth.ts +293 -0
- package/src/api/default/permissions.ts +47 -0
- package/src/api/default/presence.ts +88 -0
- package/src/api/default/rest.ts +30 -0
- package/src/api/default/results.ts +44 -0
- package/src/api/default/roles.ts +154 -0
- package/src/api/default/stickers.ts +129 -0
- package/src/api/default/supervisor.ts +53 -0
- package/src/api/default/threads.ts +233 -0
- package/src/api/default/users.ts +82 -0
- package/src/api/default/webhook-client.ts +266 -0
- package/src/api/default/webhooks.ts +89 -0
- package/src/api/effect/application.ts +29 -0
- package/src/api/effect/attachments.ts +100 -0
- package/src/api/effect/audit-logs.ts +50 -0
- package/src/api/effect/bot.ts +546 -0
- package/src/api/effect/cache.ts +110 -0
- package/src/api/effect/channels.ts +293 -0
- package/src/api/effect/client.ts +792 -0
- package/src/api/effect/collectors.ts +103 -0
- package/src/api/effect/commands.ts +87 -0
- package/src/api/effect/direct-messages.ts +119 -0
- package/src/api/effect/discovery.ts +87 -0
- package/src/api/effect/emojis.ts +108 -0
- package/src/api/effect/events.ts +92 -0
- package/src/api/effect/failures.ts +14 -0
- package/src/api/effect/gateway.ts +63 -0
- package/src/api/effect/guards.ts +194 -0
- package/src/api/effect/guilds.ts +247 -0
- package/src/api/effect/helpers.ts +359 -0
- package/src/api/effect/hierarchy.ts +26 -0
- package/src/api/effect/instance.ts +50 -0
- package/src/api/effect/invites.ts +59 -0
- package/src/api/effect/logging.ts +37 -0
- package/src/api/effect/members.ts +521 -0
- package/src/api/effect/messages.ts +1003 -0
- package/src/api/effect/oauth.ts +208 -0
- package/src/api/effect/permissions.ts +44 -0
- package/src/api/effect/presence.ts +83 -0
- package/src/api/effect/rest.ts +27 -0
- package/src/api/effect/roles.ts +136 -0
- package/src/api/effect/service.ts +104 -0
- package/src/api/effect/stickers.ts +112 -0
- package/src/api/effect/supervisor.ts +58 -0
- package/src/api/effect/threads.ts +221 -0
- package/src/api/effect/users.ts +66 -0
- package/src/api/effect/webhook-client.ts +206 -0
- package/src/api/effect/webhooks.ts +75 -0
- package/src/api-errors.ts +985 -0
- package/src/application.ts +103 -0
- package/src/assets.ts +731 -0
- package/src/attachments.ts +469 -0
- package/src/audit-logs.ts +355 -0
- package/src/bot-runner.ts +91 -0
- package/src/builders.ts +390 -0
- package/src/cache.ts +190 -0
- package/src/channels.ts +1051 -0
- package/src/cli.ts +60 -0
- package/src/client.ts +663 -0
- package/src/collectors.ts +248 -0
- package/src/colors.ts +91 -0
- package/src/command-arguments.ts +432 -0
- package/src/command-help.ts +55 -0
- package/src/commands.ts +403 -0
- package/src/counts.ts +160 -0
- package/src/default-commands.ts +1147 -0
- package/src/default-supervisor.ts +484 -0
- package/src/discovery.ts +241 -0
- package/src/effect-testing.ts +603 -0
- package/src/effect.ts +751 -0
- package/src/embeds.ts +253 -0
- package/src/error-tools.ts +191 -0
- package/src/errors.ts +849 -0
- package/src/events.ts +830 -0
- package/src/expressions.ts +198 -0
- package/src/failures.ts +55 -0
- package/src/gateway.ts +86 -0
- package/src/guilds.ts +1108 -0
- package/src/helpers.ts +836 -0
- package/src/index.ts +796 -0
- package/src/input-validation.ts +94 -0
- package/src/instance.ts +111 -0
- package/src/internal/agents-section.ts +114 -0
- package/src/internal/application.ts +51 -0
- package/src/internal/attachment-refresh.ts +57 -0
- package/src/internal/attachments.ts +313 -0
- package/src/internal/audit-logs.ts +336 -0
- package/src/internal/audit.ts +33 -0
- package/src/internal/binding/default-adapters.ts +482 -0
- package/src/internal/binding/default.ts +155 -0
- package/src/internal/binding/execute.ts +221 -0
- package/src/internal/binding/native-adapters.ts +199 -0
- package/src/internal/binding/native.ts +72 -0
- package/src/internal/binding/operations.ts +1171 -0
- package/src/internal/bot-runner.ts +480 -0
- package/src/internal/cache-changes.ts +363 -0
- package/src/internal/cache.ts +323 -0
- package/src/internal/calls.ts +119 -0
- package/src/internal/channel-cache.ts +435 -0
- package/src/internal/channel-decode.ts +399 -0
- package/src/internal/channels.ts +874 -0
- package/src/internal/client/backoff.ts +69 -0
- package/src/internal/client/configuration-fields.ts +18 -0
- package/src/internal/client/drain.ts +150 -0
- package/src/internal/client/intake.ts +228 -0
- package/src/internal/client/lifetime.ts +165 -0
- package/src/internal/client/shard-loop.ts +586 -0
- package/src/internal/client-registry.ts +35 -0
- package/src/internal/client.ts +2448 -0
- package/src/internal/clock.ts +11 -0
- package/src/internal/code-catalogue.ts +739 -0
- package/src/internal/collector.ts +452 -0
- package/src/internal/command-arguments.ts +585 -0
- package/src/internal/command-guards.ts +96 -0
- package/src/internal/command-help.ts +156 -0
- package/src/internal/commands.ts +1319 -0
- package/src/internal/configuration.ts +529 -0
- package/src/internal/counts.ts +471 -0
- package/src/internal/decode/primitives.ts +67 -0
- package/src/internal/decode/timestamp.ts +29 -0
- package/src/internal/decode/trace.ts +65 -0
- package/src/internal/defects.ts +115 -0
- package/src/internal/effect-failures.ts +65 -0
- package/src/internal/embeds.ts +355 -0
- package/src/internal/events.ts +1345 -0
- package/src/internal/expiry-queue.ts +148 -0
- package/src/internal/expressions.ts +415 -0
- package/src/internal/failures.ts +492 -0
- package/src/internal/field-text.ts +40 -0
- package/src/internal/gateway/commands.ts +328 -0
- package/src/internal/gateway/dispatch-table.ts +383 -0
- package/src/internal/gateway/event-dispatches.ts +201 -0
- package/src/internal/gateway/frames.ts +176 -0
- package/src/internal/gateway/options.ts +144 -0
- package/src/internal/gateway/session.ts +625 -0
- package/src/internal/gateway-requests.ts +26 -0
- package/src/internal/gateway.ts +22 -0
- package/src/internal/guild-cache.ts +424 -0
- package/src/internal/guild-discovery.ts +332 -0
- package/src/internal/guild-lifecycle.ts +128 -0
- package/src/internal/guild-settings.ts +209 -0
- package/src/internal/guilds.ts +949 -0
- package/src/internal/init-command.ts +305 -0
- package/src/internal/instance.ts +645 -0
- package/src/internal/invalid-callback-return.ts +28 -0
- package/src/internal/invites.ts +234 -0
- package/src/internal/logging.ts +1007 -0
- package/src/internal/logical-scheduler.ts +139 -0
- package/src/internal/masking.ts +224 -0
- package/src/internal/member-chunks.ts +649 -0
- package/src/internal/member-search-workflow.ts +237 -0
- package/src/internal/member-search.ts +272 -0
- package/src/internal/message-cleanup.ts +515 -0
- package/src/internal/message-fields.ts +71 -0
- package/src/internal/message-search-workflow.ts +166 -0
- package/src/internal/message-search.ts +476 -0
- package/src/internal/message.ts +879 -0
- package/src/internal/metrics.ts +55 -0
- package/src/internal/moderation.ts +288 -0
- package/src/internal/multipart.ts +171 -0
- package/src/internal/node-version.ts +22 -0
- package/src/internal/oauth.ts +1146 -0
- package/src/internal/observer.ts +62 -0
- package/src/internal/operation-signal.ts +26 -0
- package/src/internal/pagination.ts +494 -0
- package/src/internal/permission-requirements.ts +359 -0
- package/src/internal/permissions.ts +417 -0
- package/src/internal/pins.ts +115 -0
- package/src/internal/presence.ts +745 -0
- package/src/internal/protocol/gateway.ts +299 -0
- package/src/internal/rate-limit-templates.ts +138 -0
- package/src/internal/rate-limits.ts +346 -0
- package/src/internal/reaction-collector.ts +499 -0
- package/src/internal/reaction-pages.ts +260 -0
- package/src/internal/reactions.ts +174 -0
- package/src/internal/rejection-scope.ts +119 -0
- package/src/internal/response-json.ts +76 -0
- package/src/internal/rest/admission.ts +210 -0
- package/src/internal/rest/attempt.ts +617 -0
- package/src/internal/rest/classify.ts +391 -0
- package/src/internal/rest/download.ts +658 -0
- package/src/internal/rest/options.ts +145 -0
- package/src/internal/rest/owner.ts +1828 -0
- package/src/internal/rest/request.ts +289 -0
- package/src/internal/rest.ts +9 -0
- package/src/internal/retention-age.ts +33 -0
- package/src/internal/role-hierarchy-workflow.ts +150 -0
- package/src/internal/role-hierarchy.ts +93 -0
- package/src/internal/scheduled-tasks.ts +217 -0
- package/src/internal/sharding.ts +270 -0
- package/src/internal/starter-project.ts +251 -0
- package/src/internal/suggest.ts +50 -0
- package/src/internal/supervisor.ts +2253 -0
- package/src/internal/testing/discovery.ts +23 -0
- package/src/internal/testing/errors.ts +67 -0
- package/src/internal/testing/fixtures.ts +714 -0
- package/src/internal/testing/gateway.ts +305 -0
- package/src/internal/testing/harness.ts +328 -0
- package/src/internal/testing/http.ts +395 -0
- package/src/internal/testing/types.ts +240 -0
- package/src/internal/testing/wait.ts +63 -0
- package/src/internal/thread-events.ts +128 -0
- package/src/internal/threads.ts +718 -0
- package/src/internal/transfer-source.ts +359 -0
- package/src/internal/transport/http.ts +46 -0
- package/src/internal/transport/index.ts +23 -0
- package/src/internal/transport/socket.ts +71 -0
- package/src/internal/transport/user-agent.ts +46 -0
- package/src/internal/uploads.ts +111 -0
- package/src/internal/user-cache.ts +294 -0
- package/src/internal/users.ts +402 -0
- package/src/internal/vanity-url.ts +80 -0
- package/src/internal/webhooks.ts +690 -0
- package/src/invites.ts +87 -0
- package/src/logging.ts +247 -0
- package/src/member-chunks.ts +195 -0
- package/src/member-search.ts +152 -0
- package/src/message-cleanup.ts +308 -0
- package/src/message-errors.ts +245 -0
- package/src/message-search.ts +213 -0
- package/src/messages.ts +768 -0
- package/src/native-commands.ts +1249 -0
- package/src/native-supervisor.ts +345 -0
- package/src/oauth.ts +413 -0
- package/src/observer.ts +118 -0
- package/src/pagination.ts +172 -0
- package/src/permissions.ts +74 -0
- package/src/pins.ts +65 -0
- package/src/presence.ts +124 -0
- package/src/reaction-pages.ts +106 -0
- package/src/reactions.ts +126 -0
- package/src/rest.ts +282 -0
- package/src/role-hierarchy.ts +127 -0
- package/src/sharding.ts +272 -0
- package/src/supervisor.ts +460 -0
- package/src/testing.ts +424 -0
- package/src/text.ts +76 -0
- package/src/threads.ts +274 -0
- package/src/users.ts +237 -0
- package/src/webhooks.ts +512 -0
|
@@ -0,0 +1,985 @@
|
|
|
1
|
+
import {
|
|
2
|
+
operationDetails,
|
|
3
|
+
operationHint,
|
|
4
|
+
type FluxerlyErrorOptions,
|
|
5
|
+
type OperationErrorOptions,
|
|
6
|
+
type OperationOutcome,
|
|
7
|
+
} from "./errors.js"
|
|
8
|
+
import type { InputValidationDetail } from "./input-validation.js"
|
|
9
|
+
import { record } from "#sdk/internal/decode/primitives"
|
|
10
|
+
import {
|
|
11
|
+
permissionRequirement,
|
|
12
|
+
requiredPermissionsHint,
|
|
13
|
+
type PermissionRequirement,
|
|
14
|
+
} from "#sdk/internal/permission-requirements"
|
|
15
|
+
/**
|
|
16
|
+
* @internal Reviewed Fluxer codes behind ApiErrorDetail. Not part of the supported API
|
|
17
|
+
*
|
|
18
|
+
* @category Errors
|
|
19
|
+
*/
|
|
20
|
+
export const apiErrorMappings = {
|
|
21
|
+
MISSING_ACCESS: { code: "missingAccess", explanation: "Fluxer denied access to the requested resource" },
|
|
22
|
+
MISSING_PERMISSIONS: {
|
|
23
|
+
code: "missingPermissions",
|
|
24
|
+
explanation: "Fluxer reports that the bot lacks a required permission",
|
|
25
|
+
},
|
|
26
|
+
COMMUNICATION_DISABLED: {
|
|
27
|
+
code: "communicationDisabled",
|
|
28
|
+
explanation: "Fluxer reports that communication is disabled for this operation",
|
|
29
|
+
},
|
|
30
|
+
CANNOT_SEND_MESSAGES_TO_USER: {
|
|
31
|
+
code: "cannotSendMessagesToUser",
|
|
32
|
+
explanation: "Fluxer rejected delivery of this message to the requested user",
|
|
33
|
+
},
|
|
34
|
+
CANNOT_SEND_EMPTY_MESSAGE: {
|
|
35
|
+
code: "cannotSendEmptyMessage",
|
|
36
|
+
explanation: "Fluxer requires message content, an embed, an attachment, or a sticker",
|
|
37
|
+
},
|
|
38
|
+
CANNOT_MODIFY_SYSTEM_WEBHOOK: {
|
|
39
|
+
code: "cannotModifySystemWebhook",
|
|
40
|
+
explanation: "Fluxer does not allow modifying a system webhook",
|
|
41
|
+
},
|
|
42
|
+
ANNOUNCEMENT_CHANNEL_REQUIRED: {
|
|
43
|
+
code: "announcementChannelRequired",
|
|
44
|
+
explanation: "Fluxer requires an announcement channel for this operation",
|
|
45
|
+
},
|
|
46
|
+
CHANNEL_ALREADY_FOLLOWED: {
|
|
47
|
+
code: "channelAlreadyFollowed",
|
|
48
|
+
explanation: "The destination channel already receives updates from this announcement channel",
|
|
49
|
+
},
|
|
50
|
+
CHANNEL_HAS_FOLLOWED_CHANNELS: {
|
|
51
|
+
code: "channelHasFollowedChannels",
|
|
52
|
+
explanation: "The channel receives followed-channel updates and cannot become an announcement channel",
|
|
53
|
+
},
|
|
54
|
+
CHANNEL_TYPE_CONVERSION_NOT_SUPPORTED: {
|
|
55
|
+
code: "channelTypeConversionNotSupported",
|
|
56
|
+
explanation: "Fluxer rejected the requested channel type conversion",
|
|
57
|
+
},
|
|
58
|
+
FOLLOW_TARGET_CONTENT_WARNING_REQUIRED: {
|
|
59
|
+
code: "followTargetContentWarningRequired",
|
|
60
|
+
explanation:
|
|
61
|
+
"The announcement source has a content warning but the destination has no warning or age restriction",
|
|
62
|
+
},
|
|
63
|
+
FOLLOW_TARGET_NOT_AGE_RESTRICTED: {
|
|
64
|
+
code: "followTargetNotAgeRestricted",
|
|
65
|
+
explanation: "The announcement source is age-restricted but the destination is not",
|
|
66
|
+
},
|
|
67
|
+
INVALID_FOLLOW_TARGET_CHANNEL: {
|
|
68
|
+
code: "invalidFollowTargetChannel",
|
|
69
|
+
explanation: "Fluxer requires a community text channel as the follow destination",
|
|
70
|
+
},
|
|
71
|
+
MESSAGE_ALREADY_CROSSPOSTED: {
|
|
72
|
+
code: "messageAlreadyCrossposted",
|
|
73
|
+
explanation: "The message has already been published",
|
|
74
|
+
},
|
|
75
|
+
MESSAGE_NOT_CROSSPOSTABLE: {
|
|
76
|
+
code: "messageNotCrosspostable",
|
|
77
|
+
explanation: "Fluxer cannot publish replies, system messages, forwarded messages or received crosspost copies",
|
|
78
|
+
},
|
|
79
|
+
MESSAGE_CROSSPOST_RATE_LIMITED: {
|
|
80
|
+
code: "messageCrosspostRateLimited",
|
|
81
|
+
explanation: "The announcement channel has reached its publishing rate limit",
|
|
82
|
+
},
|
|
83
|
+
PUBLISHED_MESSAGE_EDIT_RATE_LIMITED: {
|
|
84
|
+
code: "publishedMessageEditRateLimited",
|
|
85
|
+
explanation: "The published message has reached its editing rate limit",
|
|
86
|
+
},
|
|
87
|
+
INVALID_CHANNEL_TYPE: {
|
|
88
|
+
code: "invalidChannelType",
|
|
89
|
+
explanation: "Fluxer does not allow this operation for the type of this channel",
|
|
90
|
+
},
|
|
91
|
+
CHANNEL_HAS_THREADS: {
|
|
92
|
+
code: "channelHasThreads",
|
|
93
|
+
explanation: "The channel has private threads and cannot become an announcement channel",
|
|
94
|
+
},
|
|
95
|
+
THREAD_ALREADY_CREATED_FOR_MESSAGE: {
|
|
96
|
+
code: "threadAlreadyCreated",
|
|
97
|
+
explanation: "The message already has a thread",
|
|
98
|
+
},
|
|
99
|
+
THREAD_ARCHIVED: {
|
|
100
|
+
code: "threadArchived",
|
|
101
|
+
explanation: "Fluxer does not allow this operation in an archived thread",
|
|
102
|
+
},
|
|
103
|
+
THREAD_LOCKED: {
|
|
104
|
+
code: "threadLocked",
|
|
105
|
+
explanation: "Fluxer allows only members who can manage threads to act in a locked thread",
|
|
106
|
+
},
|
|
107
|
+
FORUM_TAG_NAMES_MUST_BE_UNIQUE: {
|
|
108
|
+
code: "forumTagNamesNotUnique",
|
|
109
|
+
explanation: "Fluxer requires every tag of a forum or media channel to have a different name",
|
|
110
|
+
},
|
|
111
|
+
FORUM_TAG_REQUIRED: {
|
|
112
|
+
code: "forumTagRequired",
|
|
113
|
+
explanation: "The forum or media channel requires every post to have at least one tag",
|
|
114
|
+
},
|
|
115
|
+
NO_TAGS_AVAILABLE_TO_NON_MODERATORS: {
|
|
116
|
+
code: "noTagsAvailable",
|
|
117
|
+
explanation: "The channel requires a tag on every post but has no tag that is not moderated",
|
|
118
|
+
},
|
|
119
|
+
HIDE_MEDIA_DOWNLOAD_OPTION_MEDIA_ONLY: {
|
|
120
|
+
code: "mediaChannelRequired",
|
|
121
|
+
explanation: "Fluxer accepts the flag that hides download options only on a media channel",
|
|
122
|
+
},
|
|
123
|
+
WEBHOOK_FORUM_TARGET_REQUIRED: {
|
|
124
|
+
code: "webhookForumTargetRequired",
|
|
125
|
+
explanation: "A webhook in a forum or media channel needs either a post name or an existing post to send to",
|
|
126
|
+
},
|
|
127
|
+
WEBHOOK_THREAD_NAME_REQUIRES_FORUM: {
|
|
128
|
+
code: "webhookThreadNameRequiresForum",
|
|
129
|
+
explanation: "Fluxer accepts a post name and tags only from a webhook in a forum or media channel",
|
|
130
|
+
},
|
|
131
|
+
CAPTCHA_REQUIRED: { code: "captchaRequired", explanation: "Fluxer requires CAPTCHA verification" },
|
|
132
|
+
INVALID_CAPTCHA: { code: "invalidCaptcha", explanation: "Fluxer rejected the CAPTCHA verification" },
|
|
133
|
+
INVALID_FORM_BODY: { code: "invalidFormBody", explanation: "Fluxer rejected one or more request fields" },
|
|
134
|
+
VALIDATION_ERROR: { code: "invalidFormBody", explanation: "Fluxer rejected one or more request fields" },
|
|
135
|
+
UNKNOWN_APPLICATION: { code: "unknownResource", explanation: "The requested application was not found" },
|
|
136
|
+
UNKNOWN_CHANNEL: { code: "unknownResource", explanation: "The requested channel was not found" },
|
|
137
|
+
UNKNOWN_EMOJI: { code: "unknownResource", explanation: "The requested emoji was not found" },
|
|
138
|
+
UNKNOWN_FORUM_TAG: { code: "unknownResource", explanation: "The requested forum tag was not found" },
|
|
139
|
+
UNKNOWN_GUILD: { code: "unknownResource", explanation: "The requested community was not found" },
|
|
140
|
+
UNKNOWN_INVITE: { code: "unknownResource", explanation: "The requested invite was not found" },
|
|
141
|
+
UNKNOWN_MEMBER: { code: "unknownResource", explanation: "The requested member was not found" },
|
|
142
|
+
UNKNOWN_MESSAGE: { code: "unknownResource", explanation: "The requested message was not found" },
|
|
143
|
+
UNKNOWN_ROLE: { code: "unknownResource", explanation: "The requested role was not found" },
|
|
144
|
+
UNKNOWN_STICKER: { code: "unknownResource", explanation: "The requested sticker was not found" },
|
|
145
|
+
UNKNOWN_THREAD_MEMBER: { code: "unknownResource", explanation: "The requested thread member was not found" },
|
|
146
|
+
UNKNOWN_USER: { code: "unknownResource", explanation: "The requested user was not found" },
|
|
147
|
+
UNKNOWN_WEBHOOK: { code: "unknownResource", explanation: "The requested webhook was not found" },
|
|
148
|
+
MISSING_OAUTH_SCOPE: { code: "missingOAuthScope", explanation: "The OAuth token lacks a required scope" },
|
|
149
|
+
CANNOT_EDIT_OTHER_USER_MESSAGE: {
|
|
150
|
+
code: "cannotEditOtherUserMessage",
|
|
151
|
+
explanation: "Fluxer does not allow editing another user's message",
|
|
152
|
+
},
|
|
153
|
+
CANNOT_SEND_MESSAGES_IN_NON_TEXT_CHANNEL: {
|
|
154
|
+
code: "cannotSendMessagesInNonTextChannel",
|
|
155
|
+
explanation: "Fluxer does not allow messages in the requested channel type",
|
|
156
|
+
},
|
|
157
|
+
CONTENT_BLOCKED: { code: "contentBlocked", explanation: "Fluxer blocked the submitted content" },
|
|
158
|
+
DIRECT_MESSAGES_DISABLED: {
|
|
159
|
+
code: "directMessagesDisabled",
|
|
160
|
+
explanation: "The recipient does not accept direct messages",
|
|
161
|
+
},
|
|
162
|
+
EXPLICIT_CONTENT_CANNOT_BE_SENT: {
|
|
163
|
+
code: "explicitContentCannotBeSent",
|
|
164
|
+
explanation: "Fluxer blocked explicit content for this delivery",
|
|
165
|
+
},
|
|
166
|
+
FILE_SIZE_TOO_LARGE: { code: "fileSizeTooLarge", explanation: "A submitted file exceeds Fluxer's limit" },
|
|
167
|
+
FEATURE_TEMPORARILY_DISABLED: {
|
|
168
|
+
code: "featureTemporarilyDisabled",
|
|
169
|
+
explanation: "Fluxer has temporarily disabled this feature",
|
|
170
|
+
},
|
|
171
|
+
SLOWMODE_RATE_LIMITED: { code: "slowmodeRateLimited", explanation: "Fluxer's channel slowmode is active" },
|
|
172
|
+
GUILD_VERIFICATION_REQUIRED: {
|
|
173
|
+
code: "guildVerificationRequired",
|
|
174
|
+
explanation: "Fluxer requires community verification for this operation",
|
|
175
|
+
},
|
|
176
|
+
GUILD_EMAIL_VERIFICATION_REQUIRED: {
|
|
177
|
+
code: "guildVerificationRequired",
|
|
178
|
+
explanation: "Fluxer requires community email verification for this operation",
|
|
179
|
+
},
|
|
180
|
+
TWO_FACTOR_REQUIRED: {
|
|
181
|
+
code: "twoFactorRequired",
|
|
182
|
+
explanation: "Fluxer requires two-factor authentication on the calling account for this operation",
|
|
183
|
+
},
|
|
184
|
+
BOT_ALREADY_IN_GUILD: { code: "botAlreadyInGuild", explanation: "The bot is already in the requested community" },
|
|
185
|
+
BOT_IS_PRIVATE: { code: "botIsPrivate", explanation: "Fluxer does not allow adding this private bot" },
|
|
186
|
+
NOT_A_BOT_APPLICATION: { code: "notBotApplication", explanation: "The requested application is not a bot" },
|
|
187
|
+
APPLICATION_NOT_OWNED: {
|
|
188
|
+
code: "applicationNotOwned",
|
|
189
|
+
explanation: "The caller does not own the requested application",
|
|
190
|
+
},
|
|
191
|
+
RESOURCE_LOCKED: {
|
|
192
|
+
code: "resourceLocked",
|
|
193
|
+
explanation: "Fluxer has temporarily locked the requested resource",
|
|
194
|
+
},
|
|
195
|
+
ACCESS_DENIED: { code: "accessDenied", explanation: "Fluxer denied this request" },
|
|
196
|
+
BAD_REQUEST: {
|
|
197
|
+
code: "badRequest",
|
|
198
|
+
explanation: "The request was malformed or failed a Fluxer precondition",
|
|
199
|
+
},
|
|
200
|
+
CONFLICT: { code: "conflict", explanation: "The request conflicts with Fluxer's current resource state" },
|
|
201
|
+
FORBIDDEN: { code: "forbidden", explanation: "Fluxer forbids this request" },
|
|
202
|
+
NOT_FOUND: { code: "notFound", explanation: "Fluxer could not find the requested resource" },
|
|
203
|
+
RATE_LIMITED: { code: "rateLimited", explanation: "Fluxer rate-limited this request" },
|
|
204
|
+
SERVICE_UNAVAILABLE: { code: "serviceUnavailable", explanation: "Fluxer service is temporarily unavailable" },
|
|
205
|
+
UNAUTHORIZED: { code: "unauthorized", explanation: "Fluxer rejected the request credentials" },
|
|
206
|
+
INVALID_TOKEN: { code: "unauthorized", explanation: "Fluxer rejected the request token" },
|
|
207
|
+
MISSING_AUTHORIZATION: { code: "unauthorized", explanation: "Fluxer requires request credentials" },
|
|
208
|
+
GONE: { code: "gone", explanation: "Fluxer reports that this resource is no longer available" },
|
|
209
|
+
BAD_GATEWAY: { code: "serviceFailure", explanation: "Fluxer's gateway returned an invalid upstream response" },
|
|
210
|
+
GATEWAY_TIMEOUT: { code: "serviceFailure", explanation: "Fluxer's gateway timed out" },
|
|
211
|
+
INTERNAL_SERVER_ERROR: { code: "serviceFailure", explanation: "Fluxer encountered an internal error" },
|
|
212
|
+
NOT_IMPLEMENTED: { code: "notImplemented", explanation: "Fluxer does not implement this operation" },
|
|
213
|
+
CANNOT_EXECUTE_ON_DM: {
|
|
214
|
+
code: "cannotExecuteOnDirectMessage",
|
|
215
|
+
explanation: "Fluxer does not allow this operation in a direct message",
|
|
216
|
+
},
|
|
217
|
+
INVITES_DISABLED: { code: "invitesDisabled", explanation: "Fluxer has disabled invites for this community" },
|
|
218
|
+
FEATURE_NOT_AVAILABLE_SELF_HOSTED: {
|
|
219
|
+
code: "featureNotAvailableSelfHosted",
|
|
220
|
+
explanation: "Fluxer does not offer this feature on this self-hosted instance",
|
|
221
|
+
},
|
|
222
|
+
MAX_ACTIVE_THREADS: { code: "resourceLimit", explanation: "Fluxer's community active-thread limit was reached" },
|
|
223
|
+
MAX_CATEGORY_CHANNELS: { code: "resourceLimit", explanation: "Fluxer's category-channel limit was reached" },
|
|
224
|
+
MAX_EMOJIS: { code: "resourceLimit", explanation: "Fluxer's emoji limit was reached" },
|
|
225
|
+
MAX_FORUM_TAGS: { code: "resourceLimit", explanation: "Fluxer's forum-tag limit was reached" },
|
|
226
|
+
MAX_GUILD_CHANNELS: { code: "resourceLimit", explanation: "Fluxer's community channel limit was reached" },
|
|
227
|
+
MAX_GUILD_MEMBERS: { code: "resourceLimit", explanation: "Fluxer's community member limit was reached" },
|
|
228
|
+
MAX_GUILD_ROLES: { code: "resourceLimit", explanation: "Fluxer's community role limit was reached" },
|
|
229
|
+
MAX_INVITES: { code: "resourceLimit", explanation: "Fluxer's community invite limit was reached" },
|
|
230
|
+
MAX_PINNED_THREADS_IN_FORUM: {
|
|
231
|
+
code: "resourceLimit",
|
|
232
|
+
explanation: "Fluxer's pinned-post limit for a forum or media channel was reached",
|
|
233
|
+
},
|
|
234
|
+
MAX_REACTIONS: { code: "resourceLimit", explanation: "Fluxer's reaction limit was reached" },
|
|
235
|
+
MAX_STICKERS: { code: "resourceLimit", explanation: "Fluxer's sticker limit was reached" },
|
|
236
|
+
MAX_THREAD_MEMBERS: { code: "resourceLimit", explanation: "Fluxer's thread member limit was reached" },
|
|
237
|
+
MAX_WEBHOOKS_PER_CHANNEL: {
|
|
238
|
+
code: "resourceLimit",
|
|
239
|
+
explanation: "Fluxer's channel-webhook limit was reached",
|
|
240
|
+
},
|
|
241
|
+
MAX_WEBHOOKS_PER_GUILD: { code: "resourceLimit", explanation: "Fluxer's community webhook limit was reached" },
|
|
242
|
+
} as const satisfies Readonly<Record<ApiProviderCode, { readonly code: ApiErrorCode; readonly explanation: string }>>
|
|
243
|
+
|
|
244
|
+
/**
|
|
245
|
+
* @internal Reviewed validation codes behind ApiValidationErrorDetail. Not part of the supported API
|
|
246
|
+
*
|
|
247
|
+
* @category Errors
|
|
248
|
+
*/
|
|
249
|
+
export const validationErrorMappings = {
|
|
250
|
+
ATTACHMENTS_NOT_ALLOWED_FOR_MESSAGE: "Attachments are not allowed for this message",
|
|
251
|
+
CANNOT_DELETE_MORE_THAN_100_MESSAGES: "Fluxer allows at most 100 messages in one deletion request",
|
|
252
|
+
CANNOT_SEND_EMPTY_MESSAGE: "Fluxer requires message content, an embed, an attachment, or a sticker",
|
|
253
|
+
CANNOT_SPECIFY_BOTH_BEFORE_AND_AFTER: "Fluxer does not allow both before and after pagination bounds",
|
|
254
|
+
CONTENT_EXCEEDS_MAX_LENGTH: "Submitted text exceeds Fluxer's limit",
|
|
255
|
+
DUPLICATE_ATTACHMENT_IDS_NOT_ALLOWED: "Attachment identifiers must be unique",
|
|
256
|
+
DUPLICATE_FILE_INDEX: "Attachment file indexes must be unique",
|
|
257
|
+
EMBEDS_EXCEED_MAX_CHARACTERS: "Submitted embeds exceed Fluxer's combined text limit",
|
|
258
|
+
FILE_INDEX_EXCEEDS_MAXIMUM: "An attachment file index exceeds Fluxer's limit",
|
|
259
|
+
INVALID_AUDIT_LOG_REASON: "The audit-log reason is invalid",
|
|
260
|
+
INVALID_FORMAT: "A submitted value has an invalid format",
|
|
261
|
+
INVALID_MESSAGE_DATA: "The submitted message data is invalid",
|
|
262
|
+
INVALID_SNOWFLAKE: "A submitted identifier is invalid",
|
|
263
|
+
INVALID_SNOWFLAKE_FORMAT: "A submitted identifier has an invalid format",
|
|
264
|
+
MESSAGE_IDS_CANNOT_BE_EMPTY: "At least one message identifier is required",
|
|
265
|
+
STRING_LENGTH_INVALID: "A submitted string has an invalid length",
|
|
266
|
+
TOO_MANY_EMBEDS: "Too many embeds were submitted",
|
|
267
|
+
TOO_MANY_FILES: "Too many files were submitted",
|
|
268
|
+
TOO_LARGE: "Submitted data exceeds Fluxer's limit",
|
|
269
|
+
ATTACHMENT_FIELDS_REQUIRED: "Required attachment fields are missing",
|
|
270
|
+
INVALID_TIMEOUT_VALUE: "The requested timeout is invalid",
|
|
271
|
+
TIMEOUT_CANNOT_EXCEED_365_DAYS: "The requested timeout exceeds Fluxer's limit",
|
|
272
|
+
RECIPIENT_IDS_CANNOT_BE_EMPTY: "At least one recipient identifier is required",
|
|
273
|
+
DUPLICATE_RECIPIENTS_NOT_ALLOWED: "Recipient identifiers must be unique",
|
|
274
|
+
VANITY_URL_CODE_ALREADY_TAKEN: "The vanity URL code is already taken",
|
|
275
|
+
VANITY_URL_CODE_LENGTH_INVALID: "The vanity URL code has an invalid length",
|
|
276
|
+
VANITY_URL_INVALID_CHARACTERS: "The vanity URL code has invalid characters",
|
|
277
|
+
} as const satisfies Readonly<Record<ApiValidationCode, string>>
|
|
278
|
+
|
|
279
|
+
/**
|
|
280
|
+
* Stable SDK category of a recognized Fluxer API rejection, read from ApiErrorDetail.code.
|
|
281
|
+
* Branch on this rather than on providerCode when several server codes mean the same thing, such as every resource limit.
|
|
282
|
+
* Announcement, follow, channel conversion and publishing preconditions have distinct categories. Publishing and
|
|
283
|
+
* published-message editing limits are separate from the general rateLimited category. Thread state, forum tag and
|
|
284
|
+
* webhook post preconditions also have distinct categories, while the thread, tag and pinned-post limits join
|
|
285
|
+
* resourceLimit and a missing forum tag or thread member joins unknownResource
|
|
286
|
+
*
|
|
287
|
+
* @category Errors
|
|
288
|
+
*/
|
|
289
|
+
export type ApiErrorCode =
|
|
290
|
+
| "missingAccess"
|
|
291
|
+
| "missingPermissions"
|
|
292
|
+
| "communicationDisabled"
|
|
293
|
+
| "cannotSendMessagesToUser"
|
|
294
|
+
| "cannotSendEmptyMessage"
|
|
295
|
+
| "cannotModifySystemWebhook"
|
|
296
|
+
| "announcementChannelRequired"
|
|
297
|
+
| "channelAlreadyFollowed"
|
|
298
|
+
| "channelHasFollowedChannels"
|
|
299
|
+
| "channelTypeConversionNotSupported"
|
|
300
|
+
| "followTargetContentWarningRequired"
|
|
301
|
+
| "followTargetNotAgeRestricted"
|
|
302
|
+
| "invalidFollowTargetChannel"
|
|
303
|
+
| "messageAlreadyCrossposted"
|
|
304
|
+
| "messageNotCrosspostable"
|
|
305
|
+
| "messageCrosspostRateLimited"
|
|
306
|
+
| "publishedMessageEditRateLimited"
|
|
307
|
+
| "invalidChannelType"
|
|
308
|
+
| "channelHasThreads"
|
|
309
|
+
| "threadAlreadyCreated"
|
|
310
|
+
| "threadArchived"
|
|
311
|
+
| "threadLocked"
|
|
312
|
+
| "forumTagNamesNotUnique"
|
|
313
|
+
| "forumTagRequired"
|
|
314
|
+
| "noTagsAvailable"
|
|
315
|
+
| "mediaChannelRequired"
|
|
316
|
+
| "webhookForumTargetRequired"
|
|
317
|
+
| "webhookThreadNameRequiresForum"
|
|
318
|
+
| "captchaRequired"
|
|
319
|
+
| "invalidCaptcha"
|
|
320
|
+
| "invalidFormBody"
|
|
321
|
+
| "unknownResource"
|
|
322
|
+
| "missingOAuthScope"
|
|
323
|
+
| "cannotEditOtherUserMessage"
|
|
324
|
+
| "cannotSendMessagesInNonTextChannel"
|
|
325
|
+
| "contentBlocked"
|
|
326
|
+
| "directMessagesDisabled"
|
|
327
|
+
| "explicitContentCannotBeSent"
|
|
328
|
+
| "fileSizeTooLarge"
|
|
329
|
+
| "featureTemporarilyDisabled"
|
|
330
|
+
| "slowmodeRateLimited"
|
|
331
|
+
| "guildVerificationRequired"
|
|
332
|
+
| "twoFactorRequired"
|
|
333
|
+
| "botAlreadyInGuild"
|
|
334
|
+
| "botIsPrivate"
|
|
335
|
+
| "notBotApplication"
|
|
336
|
+
| "applicationNotOwned"
|
|
337
|
+
| "resourceLocked"
|
|
338
|
+
| "accessDenied"
|
|
339
|
+
| "badRequest"
|
|
340
|
+
| "conflict"
|
|
341
|
+
| "forbidden"
|
|
342
|
+
| "notFound"
|
|
343
|
+
| "rateLimited"
|
|
344
|
+
| "serviceUnavailable"
|
|
345
|
+
| "unauthorized"
|
|
346
|
+
| "gone"
|
|
347
|
+
| "serviceFailure"
|
|
348
|
+
| "notImplemented"
|
|
349
|
+
| "cannotExecuteOnDirectMessage"
|
|
350
|
+
| "invitesDisabled"
|
|
351
|
+
| "featureNotAvailableSelfHosted"
|
|
352
|
+
| "resourceLimit"
|
|
353
|
+
|
|
354
|
+
/**
|
|
355
|
+
* Exact Fluxer server code that the SDK recognizes, read from ApiErrorDetail.providerCode.
|
|
356
|
+
* An unrecognized server code produces no ApiErrorDetail
|
|
357
|
+
*
|
|
358
|
+
* @category Errors
|
|
359
|
+
*/
|
|
360
|
+
export type ApiProviderCode =
|
|
361
|
+
| "MISSING_ACCESS"
|
|
362
|
+
| "MISSING_PERMISSIONS"
|
|
363
|
+
| "COMMUNICATION_DISABLED"
|
|
364
|
+
| "CANNOT_SEND_MESSAGES_TO_USER"
|
|
365
|
+
| "CANNOT_SEND_EMPTY_MESSAGE"
|
|
366
|
+
| "CANNOT_MODIFY_SYSTEM_WEBHOOK"
|
|
367
|
+
| "ANNOUNCEMENT_CHANNEL_REQUIRED"
|
|
368
|
+
| "CHANNEL_ALREADY_FOLLOWED"
|
|
369
|
+
| "CHANNEL_HAS_FOLLOWED_CHANNELS"
|
|
370
|
+
| "CHANNEL_TYPE_CONVERSION_NOT_SUPPORTED"
|
|
371
|
+
| "FOLLOW_TARGET_CONTENT_WARNING_REQUIRED"
|
|
372
|
+
| "FOLLOW_TARGET_NOT_AGE_RESTRICTED"
|
|
373
|
+
| "INVALID_FOLLOW_TARGET_CHANNEL"
|
|
374
|
+
| "MESSAGE_ALREADY_CROSSPOSTED"
|
|
375
|
+
| "MESSAGE_NOT_CROSSPOSTABLE"
|
|
376
|
+
| "MESSAGE_CROSSPOST_RATE_LIMITED"
|
|
377
|
+
| "PUBLISHED_MESSAGE_EDIT_RATE_LIMITED"
|
|
378
|
+
| "INVALID_CHANNEL_TYPE"
|
|
379
|
+
| "CHANNEL_HAS_THREADS"
|
|
380
|
+
| "THREAD_ALREADY_CREATED_FOR_MESSAGE"
|
|
381
|
+
| "THREAD_ARCHIVED"
|
|
382
|
+
| "THREAD_LOCKED"
|
|
383
|
+
| "FORUM_TAG_NAMES_MUST_BE_UNIQUE"
|
|
384
|
+
| "FORUM_TAG_REQUIRED"
|
|
385
|
+
| "NO_TAGS_AVAILABLE_TO_NON_MODERATORS"
|
|
386
|
+
| "HIDE_MEDIA_DOWNLOAD_OPTION_MEDIA_ONLY"
|
|
387
|
+
| "WEBHOOK_FORUM_TARGET_REQUIRED"
|
|
388
|
+
| "WEBHOOK_THREAD_NAME_REQUIRES_FORUM"
|
|
389
|
+
| "CAPTCHA_REQUIRED"
|
|
390
|
+
| "INVALID_CAPTCHA"
|
|
391
|
+
| "INVALID_FORM_BODY"
|
|
392
|
+
| "VALIDATION_ERROR"
|
|
393
|
+
| "UNKNOWN_APPLICATION"
|
|
394
|
+
| "UNKNOWN_CHANNEL"
|
|
395
|
+
| "UNKNOWN_EMOJI"
|
|
396
|
+
| "UNKNOWN_FORUM_TAG"
|
|
397
|
+
| "UNKNOWN_GUILD"
|
|
398
|
+
| "UNKNOWN_INVITE"
|
|
399
|
+
| "UNKNOWN_MEMBER"
|
|
400
|
+
| "UNKNOWN_MESSAGE"
|
|
401
|
+
| "UNKNOWN_ROLE"
|
|
402
|
+
| "UNKNOWN_STICKER"
|
|
403
|
+
| "UNKNOWN_THREAD_MEMBER"
|
|
404
|
+
| "UNKNOWN_USER"
|
|
405
|
+
| "UNKNOWN_WEBHOOK"
|
|
406
|
+
| "MISSING_OAUTH_SCOPE"
|
|
407
|
+
| "CANNOT_EDIT_OTHER_USER_MESSAGE"
|
|
408
|
+
| "CANNOT_SEND_MESSAGES_IN_NON_TEXT_CHANNEL"
|
|
409
|
+
| "CONTENT_BLOCKED"
|
|
410
|
+
| "DIRECT_MESSAGES_DISABLED"
|
|
411
|
+
| "EXPLICIT_CONTENT_CANNOT_BE_SENT"
|
|
412
|
+
| "FILE_SIZE_TOO_LARGE"
|
|
413
|
+
| "FEATURE_TEMPORARILY_DISABLED"
|
|
414
|
+
| "SLOWMODE_RATE_LIMITED"
|
|
415
|
+
| "GUILD_VERIFICATION_REQUIRED"
|
|
416
|
+
| "GUILD_EMAIL_VERIFICATION_REQUIRED"
|
|
417
|
+
| "TWO_FACTOR_REQUIRED"
|
|
418
|
+
| "BOT_ALREADY_IN_GUILD"
|
|
419
|
+
| "BOT_IS_PRIVATE"
|
|
420
|
+
| "NOT_A_BOT_APPLICATION"
|
|
421
|
+
| "APPLICATION_NOT_OWNED"
|
|
422
|
+
| "RESOURCE_LOCKED"
|
|
423
|
+
| "ACCESS_DENIED"
|
|
424
|
+
| "BAD_REQUEST"
|
|
425
|
+
| "CONFLICT"
|
|
426
|
+
| "FORBIDDEN"
|
|
427
|
+
| "NOT_FOUND"
|
|
428
|
+
| "RATE_LIMITED"
|
|
429
|
+
| "SERVICE_UNAVAILABLE"
|
|
430
|
+
| "UNAUTHORIZED"
|
|
431
|
+
| "INVALID_TOKEN"
|
|
432
|
+
| "MISSING_AUTHORIZATION"
|
|
433
|
+
| "GONE"
|
|
434
|
+
| "BAD_GATEWAY"
|
|
435
|
+
| "GATEWAY_TIMEOUT"
|
|
436
|
+
| "INTERNAL_SERVER_ERROR"
|
|
437
|
+
| "NOT_IMPLEMENTED"
|
|
438
|
+
| "CANNOT_EXECUTE_ON_DM"
|
|
439
|
+
| "INVITES_DISABLED"
|
|
440
|
+
| "FEATURE_NOT_AVAILABLE_SELF_HOSTED"
|
|
441
|
+
| "MAX_ACTIVE_THREADS"
|
|
442
|
+
| "MAX_CATEGORY_CHANNELS"
|
|
443
|
+
| "MAX_EMOJIS"
|
|
444
|
+
| "MAX_FORUM_TAGS"
|
|
445
|
+
| "MAX_GUILD_CHANNELS"
|
|
446
|
+
| "MAX_GUILD_MEMBERS"
|
|
447
|
+
| "MAX_GUILD_ROLES"
|
|
448
|
+
| "MAX_INVITES"
|
|
449
|
+
| "MAX_PINNED_THREADS_IN_FORUM"
|
|
450
|
+
| "MAX_REACTIONS"
|
|
451
|
+
| "MAX_STICKERS"
|
|
452
|
+
| "MAX_THREAD_MEMBERS"
|
|
453
|
+
| "MAX_WEBHOOKS_PER_CHANNEL"
|
|
454
|
+
| "MAX_WEBHOOKS_PER_GUILD"
|
|
455
|
+
|
|
456
|
+
/**
|
|
457
|
+
* Exact Fluxer validation code that the SDK recognizes, read from ApiValidationErrorDetail.providerCode.
|
|
458
|
+
* An unrecognized validation code stays in validationErrors with a generic explanation when it has a safe code shape
|
|
459
|
+
*
|
|
460
|
+
* @category Errors
|
|
461
|
+
*/
|
|
462
|
+
export type ApiValidationCode =
|
|
463
|
+
| "ATTACHMENTS_NOT_ALLOWED_FOR_MESSAGE"
|
|
464
|
+
| "CANNOT_DELETE_MORE_THAN_100_MESSAGES"
|
|
465
|
+
| "CANNOT_SEND_EMPTY_MESSAGE"
|
|
466
|
+
| "CANNOT_SPECIFY_BOTH_BEFORE_AND_AFTER"
|
|
467
|
+
| "CONTENT_EXCEEDS_MAX_LENGTH"
|
|
468
|
+
| "DUPLICATE_ATTACHMENT_IDS_NOT_ALLOWED"
|
|
469
|
+
| "DUPLICATE_FILE_INDEX"
|
|
470
|
+
| "EMBEDS_EXCEED_MAX_CHARACTERS"
|
|
471
|
+
| "FILE_INDEX_EXCEEDS_MAXIMUM"
|
|
472
|
+
| "INVALID_AUDIT_LOG_REASON"
|
|
473
|
+
| "INVALID_FORMAT"
|
|
474
|
+
| "INVALID_MESSAGE_DATA"
|
|
475
|
+
| "INVALID_SNOWFLAKE"
|
|
476
|
+
| "INVALID_SNOWFLAKE_FORMAT"
|
|
477
|
+
| "MESSAGE_IDS_CANNOT_BE_EMPTY"
|
|
478
|
+
| "STRING_LENGTH_INVALID"
|
|
479
|
+
| "TOO_MANY_EMBEDS"
|
|
480
|
+
| "TOO_MANY_FILES"
|
|
481
|
+
| "TOO_LARGE"
|
|
482
|
+
| "ATTACHMENT_FIELDS_REQUIRED"
|
|
483
|
+
| "INVALID_TIMEOUT_VALUE"
|
|
484
|
+
| "TIMEOUT_CANNOT_EXCEED_365_DAYS"
|
|
485
|
+
| "RECIPIENT_IDS_CANNOT_BE_EMPTY"
|
|
486
|
+
| "DUPLICATE_RECIPIENTS_NOT_ALLOWED"
|
|
487
|
+
| "VANITY_URL_CODE_ALREADY_TAKEN"
|
|
488
|
+
| "VANITY_URL_CODE_LENGTH_INVALID"
|
|
489
|
+
| "VANITY_URL_INVALID_CHARACTERS"
|
|
490
|
+
|
|
491
|
+
/** A validation error reported by Fluxer, with a fixed SDK explanation.
|
|
492
|
+
* This is a server rejection, not a problem found by local input checks.
|
|
493
|
+
* It includes the rejected field path when Fluxer supplied one, but never the rejected value or localized server message
|
|
494
|
+
*
|
|
495
|
+
* @category Errors
|
|
496
|
+
*/
|
|
497
|
+
export interface ApiValidationErrorDetail {
|
|
498
|
+
/**
|
|
499
|
+
* Fluxer validation code. A code this SDK version does not recognize is kept when it is an uppercase code of at most
|
|
500
|
+
* 64 characters, with a generic explanation, so its field path is not lost
|
|
501
|
+
*/
|
|
502
|
+
readonly providerCode: ApiValidationCode | (string & {})
|
|
503
|
+
/** Fixed SDK explanation of the validation code */
|
|
504
|
+
readonly explanation: string
|
|
505
|
+
/** Request field path that Fluxer rejected, such as embeds.0.title, when supplied in a plain dotted form */
|
|
506
|
+
readonly path?: string
|
|
507
|
+
}
|
|
508
|
+
|
|
509
|
+
/**
|
|
510
|
+
* Safe details about a Fluxer API rejection, available in an operation error's apiError field.
|
|
511
|
+
* The code is the SDK's category. The providerCode is the exact server code that the SDK recognizes.
|
|
512
|
+
* The explanation is fixed SDK text, not the server's message or text to show directly to users.
|
|
513
|
+
* If the SDK does not recognize the server code, apiError is null rather than containing unreviewed text, and the
|
|
514
|
+
* error's details.providerCode names the unrecognized code when it is an uppercase code of at most 64 characters.
|
|
515
|
+
* For form errors, validationErrors contains at most 32 validation codes with their field paths, without messages or rejected values.
|
|
516
|
+
* These details never contain the response body, localized message, rejected value or private caller data.
|
|
517
|
+
* Responses from presigned upload destinations do not receive this classification
|
|
518
|
+
*
|
|
519
|
+
* For code missingPermissions, the operation error's details.requiredPermissions lists the permissions that Fluxer
|
|
520
|
+
* checks for the failed operation, as keys of Permissions such as ViewChannel, and the error's hint names them.
|
|
521
|
+
* Fluxer does not report which one is missing, so the bot may already have some of them. The list covers the
|
|
522
|
+
* operation's usual path, and the hint adds other checks behind the same rejection, such as role hierarchy or a
|
|
523
|
+
* permission that only some inputs need. Other rejections, rest.request and operations whose checks depend on data the
|
|
524
|
+
* SDK does not have, such as who created an emoji, carry no details.requiredPermissions and keep a general hint
|
|
525
|
+
*
|
|
526
|
+
* @example
|
|
527
|
+
* ```ts
|
|
528
|
+
* import type { ApiErrorDetail } from "@neontechspace/fluxerly"
|
|
529
|
+
*
|
|
530
|
+
* export function formatApiErrorDetail(detail: ApiErrorDetail): string {
|
|
531
|
+
* // Branch on the category, which groups related server codes such as every resource limit
|
|
532
|
+
* if (detail.code === "resourceLimit") return `Limit reached: ${detail.explanation}`
|
|
533
|
+
* const fields = detail.validationErrors?.map((error) => error.path ?? error.providerCode) ?? []
|
|
534
|
+
* return `${detail.providerCode}: ${detail.explanation}${fields.length > 0 ? ` (${fields.join(", ")})` : ""}`
|
|
535
|
+
* }
|
|
536
|
+
* ```
|
|
537
|
+
*
|
|
538
|
+
* @category Errors
|
|
539
|
+
*/
|
|
540
|
+
export interface ApiErrorDetail {
|
|
541
|
+
/** Stable SDK category for this recognized rejection. Several Fluxer codes can share one category */
|
|
542
|
+
readonly code: ApiErrorCode
|
|
543
|
+
/** Exact recognized Fluxer server code */
|
|
544
|
+
readonly providerCode: ApiProviderCode
|
|
545
|
+
/** Fixed SDK explanation, never Fluxer's localized response text */
|
|
546
|
+
readonly explanation: string
|
|
547
|
+
/**
|
|
548
|
+
* Present only when code is invalidFormBody. Holds at most 32 validation codes with field paths, without Fluxer
|
|
549
|
+
* messages or rejected values
|
|
550
|
+
*/
|
|
551
|
+
readonly validationErrors?: readonly ApiValidationErrorDetail[]
|
|
552
|
+
}
|
|
553
|
+
|
|
554
|
+
/** Shape of a Fluxer error code that is safe to keep even when this SDK version does not describe it */
|
|
555
|
+
const providerCodePattern = /^[A-Z][A-Z0-9_]{0,63}$/
|
|
556
|
+
|
|
557
|
+
function validationDetails(value: unknown): readonly ApiValidationErrorDetail[] {
|
|
558
|
+
if (!Array.isArray(value)) return Object.freeze([])
|
|
559
|
+
const details: ApiValidationErrorDetail[] = []
|
|
560
|
+
for (const item of value) {
|
|
561
|
+
if (details.length === 32 || !record(item) || typeof item.code !== "string") continue
|
|
562
|
+
const known = Object.hasOwn(validationErrorMappings, item.code)
|
|
563
|
+
if (!known && !providerCodePattern.test(item.code)) continue
|
|
564
|
+
const explanation = known
|
|
565
|
+
? validationErrorMappings[item.code as keyof typeof validationErrorMappings]
|
|
566
|
+
: "Fluxer rejected this field with a code that this SDK version does not describe"
|
|
567
|
+
const path =
|
|
568
|
+
typeof item.path === "string" &&
|
|
569
|
+
/^[A-Za-z_][A-Za-z0-9_]*(?:\.(?:[A-Za-z_][A-Za-z0-9_]*|\d{1,4})){0,8}$/.test(item.path)
|
|
570
|
+
? item.path
|
|
571
|
+
: undefined
|
|
572
|
+
details.push(
|
|
573
|
+
Object.freeze({
|
|
574
|
+
providerCode: item.code,
|
|
575
|
+
explanation,
|
|
576
|
+
...(path === undefined ? {} : { path }),
|
|
577
|
+
}),
|
|
578
|
+
)
|
|
579
|
+
}
|
|
580
|
+
return Object.freeze(details)
|
|
581
|
+
}
|
|
582
|
+
|
|
583
|
+
/** Return frozen, SDK-written details only for recognized Fluxer response codes. Return null for unknown codes */
|
|
584
|
+
export function apiErrorDetail(body: unknown): ApiErrorDetail | null {
|
|
585
|
+
if (!record(body) || typeof body.code !== "string") return null
|
|
586
|
+
if (!Object.hasOwn(apiErrorMappings, body.code)) return null
|
|
587
|
+
const mapped = apiErrorMappings[body.code as keyof typeof apiErrorMappings]
|
|
588
|
+
const detail = {
|
|
589
|
+
code: mapped.code,
|
|
590
|
+
providerCode: body.code,
|
|
591
|
+
explanation: mapped.explanation,
|
|
592
|
+
...(body.code === "INVALID_FORM_BODY" || body.code === "VALIDATION_ERROR"
|
|
593
|
+
? { validationErrors: validationDetails(body.errors) }
|
|
594
|
+
: {}),
|
|
595
|
+
}
|
|
596
|
+
return Object.freeze(detail) as ApiErrorDetail
|
|
597
|
+
}
|
|
598
|
+
|
|
599
|
+
/** @internal A Fluxer error code that apiErrorDetail does not recognize but that is safe to show, or null */
|
|
600
|
+
export function unrecognizedProviderCode(body: unknown): string | null {
|
|
601
|
+
if (!record(body) || typeof body.code !== "string" || Object.hasOwn(apiErrorMappings, body.code)) return null
|
|
602
|
+
return providerCodePattern.test(body.code) ? body.code : null
|
|
603
|
+
}
|
|
604
|
+
|
|
605
|
+
/**
|
|
606
|
+
* @internal Suggested fixes by API error category. The rejection's explanation says what Fluxer refused, and this text
|
|
607
|
+
* says what to change. Categories without an actionable fix have no entry
|
|
608
|
+
*/
|
|
609
|
+
const apiErrorHints: Readonly<Partial<Record<ApiErrorCode, string>>> = {
|
|
610
|
+
missingPermissions:
|
|
611
|
+
"Grant the bot's role the permission this operation needs in the community settings or the channel's permission overrides",
|
|
612
|
+
missingAccess:
|
|
613
|
+
"Give the bot's role View Channel for this channel or its category, and check that the bot is still in the community",
|
|
614
|
+
unknownResource: "Check the ID. The resource may be deleted or not visible to this bot",
|
|
615
|
+
notFound: "Check the ID. The resource may be deleted or not visible to this bot",
|
|
616
|
+
unauthorized:
|
|
617
|
+
"Check the configured credential. A valid bot token can also be rejected when the application owner's account is closed or disabled. For OAuth, check whether the authorizing user's account is closed or temporarily banned. A new token does not fix an account-standing rejection. The rejection alone does not identify the cause",
|
|
618
|
+
invalidFormBody:
|
|
619
|
+
"Correct the fields named in the message. The error's apiError.validationErrors lists them as data",
|
|
620
|
+
cannotSendMessagesToUser: "The user does not accept direct messages from this bot, so retrying does not help",
|
|
621
|
+
directMessagesDisabled: "The user does not accept direct messages from this bot, so retrying does not help",
|
|
622
|
+
cannotSendEmptyMessage: "Include content, an embed, an attachment or a sticker",
|
|
623
|
+
announcementChannelRequired: "Use an announcement channel as the source of this operation",
|
|
624
|
+
channelAlreadyFollowed: "Keep the existing follow or choose a destination that does not already follow this source",
|
|
625
|
+
channelHasFollowedChannels: "Remove the channel-follower webhooks from this channel before converting it",
|
|
626
|
+
channelTypeConversionNotSupported:
|
|
627
|
+
"Convert only between community text and announcement channels, using the channel's current type as the source",
|
|
628
|
+
followTargetContentWarningRequired:
|
|
629
|
+
"Use a destination with a content warning or an age restriction, including inherited category or community settings",
|
|
630
|
+
followTargetNotAgeRestricted:
|
|
631
|
+
"Use an age-restricted destination, including inherited category or community settings",
|
|
632
|
+
invalidFollowTargetChannel: "Use a community text channel as the follow destination",
|
|
633
|
+
messageAlreadyCrossposted: "Edit the source message to update its published copies instead of publishing it again",
|
|
634
|
+
messageNotCrosspostable:
|
|
635
|
+
"Publish an ordinary source message rather than a reply, forwarded message or received crosspost copy",
|
|
636
|
+
messageCrosspostRateLimited: "Wait at least retryAfterMs before publishing another message in this channel",
|
|
637
|
+
publishedMessageEditRateLimited: "Wait at least retryAfterMs before editing this published message again",
|
|
638
|
+
invalidChannelType: "Check the channel's type, because this operation does not accept it",
|
|
639
|
+
channelHasThreads: "Delete the channel's private threads before converting it to an announcement channel",
|
|
640
|
+
threadAlreadyCreated: "Use the existing thread, which has the same ID as the message",
|
|
641
|
+
threadArchived: "Unarchive the thread first, by editing it with archived set to false, then repeat the operation",
|
|
642
|
+
threadLocked: "Grant the bot's role Manage Threads, or ask a member who has it to unlock the thread",
|
|
643
|
+
forumTagNamesNotUnique: "Give every tag of the channel a different name",
|
|
644
|
+
forumTagRequired: "Include at least one of the channel's tag IDs, because the channel requires a tag on every post",
|
|
645
|
+
noTagsAvailable: "Add a tag that is not moderated to the channel, or turn off ChannelFlags.RequireTag",
|
|
646
|
+
mediaChannelRequired: "Remove ChannelFlags.HideMediaDownloadOptions, because only a media channel accepts it",
|
|
647
|
+
webhookForumTargetRequired: "Set threadName to start a post, or threadId to send into an existing post",
|
|
648
|
+
webhookThreadNameRequiresForum:
|
|
649
|
+
"Remove threadName and appliedTagIds, because only a webhook in a forum or media channel starts posts",
|
|
650
|
+
cannotSendMessagesInNonTextChannel: "Send the message to a text channel",
|
|
651
|
+
cannotEditOtherUserMessage: "Only messages that the bot sent can be edited",
|
|
652
|
+
twoFactorRequired: "The application owner's account needs two-factor authentication enabled for this operation",
|
|
653
|
+
slowmodeRateLimited: "Wait for the channel's slowmode interval before sending again",
|
|
654
|
+
resourceLimit: "Remove unused items before creating more. Fluxer sets this limit",
|
|
655
|
+
missingOAuthScope: "Request the missing scope when the user authorizes the application",
|
|
656
|
+
fileSizeTooLarge: "Send a smaller file",
|
|
657
|
+
serviceUnavailable: "Fluxer had a temporary problem. Retry later",
|
|
658
|
+
serviceFailure: "Fluxer had a temporary problem. Retry later",
|
|
659
|
+
featureTemporarilyDisabled: "Retry later",
|
|
660
|
+
resourceLocked: "Retry later",
|
|
661
|
+
cannotExecuteOnDirectMessage: "Use this operation in a community channel",
|
|
662
|
+
}
|
|
663
|
+
|
|
664
|
+
/** Suggested fixes for the standard OAuth error codes that the SDK keeps in oauthError */
|
|
665
|
+
const oauthErrorHints: Readonly<Record<string, string>> = {
|
|
666
|
+
invalid_grant:
|
|
667
|
+
"Check the authorization code or refresh token for expiry, prior use and the correct redirect URI. Also check whether the authorizing user's account is closed or temporarily banned. A new token or repeated authorization does not fix an account-standing rejection. The rejection alone does not identify the cause",
|
|
668
|
+
invalid_client: "Check the configured OAuth client ID and client secret",
|
|
669
|
+
invalid_request: "Check the request parameters, such as the code and redirectUri",
|
|
670
|
+
invalid_scope: "Request only scopes that the application may use",
|
|
671
|
+
unauthorized_client: "This application may not use this grant type. Check its OAuth settings",
|
|
672
|
+
unsupported_grant_type: "Use a grant type that Fluxer supports",
|
|
673
|
+
}
|
|
674
|
+
|
|
675
|
+
/** The suggested fix for a standard OAuth error code, when the SDK has one */
|
|
676
|
+
function oauthErrorHint(oauthError: string | null): string | undefined {
|
|
677
|
+
return oauthError !== null && Object.hasOwn(oauthErrorHints, oauthError) ? oauthErrorHints[oauthError] : undefined
|
|
678
|
+
}
|
|
679
|
+
|
|
680
|
+
/** Suggested fixes for rejections without a recognized code, by HTTP status */
|
|
681
|
+
const statusHints: Readonly<Record<number, string | undefined>> = {
|
|
682
|
+
401: apiErrorHints.unauthorized,
|
|
683
|
+
403: "Check the bot's permissions and role position for this resource",
|
|
684
|
+
404: apiErrorHints.unknownResource,
|
|
685
|
+
}
|
|
686
|
+
|
|
687
|
+
/**
|
|
688
|
+
* @internal The credential a request sent: The bot token, a webhook token, the OAuth client ID and secret, or an OAuth
|
|
689
|
+
* user access token. A rejected credential needs a different fix for each
|
|
690
|
+
*/
|
|
691
|
+
export type RequestCredential = "bot" | "webhook" | "oauthClient" | "oauthUser"
|
|
692
|
+
|
|
693
|
+
/** Suggested fixes for a rejected credential other than the bot token */
|
|
694
|
+
const credentialHints: Readonly<Record<Exclude<RequestCredential, "bot">, string>> = {
|
|
695
|
+
webhook: "Check the webhook ID and token, or recreate the webhook and use its new token",
|
|
696
|
+
oauthClient: "Check the configured OAuth client ID and client secret",
|
|
697
|
+
oauthUser: "Refresh the user's access token, or ask the user to authorize the application again",
|
|
698
|
+
}
|
|
699
|
+
|
|
700
|
+
/**
|
|
701
|
+
* @internal What a rejected REST route does, so a logged missing-permission hint names what that route needs.
|
|
702
|
+
* Operation errors name the permissions of their operation instead
|
|
703
|
+
*/
|
|
704
|
+
export type RequestAction = "message" | "moderation" | "other"
|
|
705
|
+
|
|
706
|
+
/** Missing-permission fixes for actions whose needs are known */
|
|
707
|
+
const missingPermissionHints: Readonly<Record<Exclude<RequestAction, "other">, string>> = {
|
|
708
|
+
message:
|
|
709
|
+
"Grant the bot's role View Channel and Send Messages in this channel, plus Embed Links or Attach Files when the message has them, in the community settings or the channel's permission overrides",
|
|
710
|
+
moderation:
|
|
711
|
+
"Grant the bot's role the permission this operation needs in the community settings, and move the bot's highest role above the highest role of the member it acts on",
|
|
712
|
+
}
|
|
713
|
+
|
|
714
|
+
/** @internal The action of a REST route template, such as /channels/:id/messages or /guilds/:id/bans/:id */
|
|
715
|
+
export function routeAction(template: string): RequestAction {
|
|
716
|
+
if (/\/(members|bans|roles)(\/|$)/.test(template)) return "moderation"
|
|
717
|
+
if (/\/messages(\/|$)/.test(template)) return "message"
|
|
718
|
+
return "other"
|
|
719
|
+
}
|
|
720
|
+
|
|
721
|
+
/**
|
|
722
|
+
* @internal The suggested fix for a Fluxer rejection, from its recognized category or else its HTTP status.
|
|
723
|
+
* A rejected credential is described for the credential the request sent, which defaults to the bot token, and a
|
|
724
|
+
* missing permission for the action the request tried
|
|
725
|
+
*/
|
|
726
|
+
export function apiErrorHint(
|
|
727
|
+
apiError: ApiErrorDetail | null,
|
|
728
|
+
status: number | null,
|
|
729
|
+
credential: RequestCredential = "bot",
|
|
730
|
+
action: RequestAction = "other",
|
|
731
|
+
): string | undefined {
|
|
732
|
+
if (credential !== "bot" && (apiError === null ? status === 401 : apiError.code === "unauthorized"))
|
|
733
|
+
return credentialHints[credential]
|
|
734
|
+
if (apiError?.code === "missingPermissions" && action !== "other") return missingPermissionHints[action]
|
|
735
|
+
const categoryHint = apiError === null ? undefined : apiErrorHints[apiError.code]
|
|
736
|
+
return categoryHint ?? (status === null ? undefined : statusHints[status])
|
|
737
|
+
}
|
|
738
|
+
|
|
739
|
+
/** @internal Safe response facts that extend an operation-error message */
|
|
740
|
+
export interface OperationMessageFacts {
|
|
741
|
+
/** Unrecognized Fluxer error code that matched the safe code shape */
|
|
742
|
+
readonly providerCode?: string | null | undefined
|
|
743
|
+
/** Response field path or named check that failed, for reason response */
|
|
744
|
+
readonly responseField?: string | null | undefined
|
|
745
|
+
/** Whether the request only read data, so an unknown outcome needs no mention */
|
|
746
|
+
readonly read?: boolean | undefined
|
|
747
|
+
}
|
|
748
|
+
|
|
749
|
+
/** What each failure reason means when neither Fluxer nor local validation supplied a more specific explanation */
|
|
750
|
+
const reasonExplanations: Readonly<Record<string, string>> = {
|
|
751
|
+
input: "The input is invalid",
|
|
752
|
+
busy: "Too many requests of this kind are already pending in this client",
|
|
753
|
+
network: "A network error interrupted the request",
|
|
754
|
+
notFound: "Fluxer could not find the requested resource",
|
|
755
|
+
rateLimit: "Fluxer rate-limited the request, and the SDK could not wait and retry it",
|
|
756
|
+
rejected: "Fluxer rejected the request",
|
|
757
|
+
response: "Fluxer's answer did not have the expected format",
|
|
758
|
+
timeout: "The operation did not finish within its timeout",
|
|
759
|
+
tooLarge: "The response is larger than the maxBytes limit",
|
|
760
|
+
untrustedUrl: "The attachment URL is not on this Fluxer instance's media host",
|
|
761
|
+
notConnected: "The client is not connected to the gateway for this community",
|
|
762
|
+
connectionLost: "The gateway connection was lost before Fluxer answered",
|
|
763
|
+
overflow: "Unread member batches exceeded the maxPendingBytes limit",
|
|
764
|
+
filter: "The selection filter threw or returned a value that is not a boolean",
|
|
765
|
+
closed: "The client shut down",
|
|
766
|
+
}
|
|
767
|
+
|
|
768
|
+
/** Readable text for the named response checks, which are not field paths */
|
|
769
|
+
const responseChecks: Readonly<Record<string, string>> = {
|
|
770
|
+
body: "The response body has the wrong type",
|
|
771
|
+
tooMany: "It returned more items than requested",
|
|
772
|
+
order: "Its items are out of order",
|
|
773
|
+
channelMismatch: "The returned message belongs to a different channel",
|
|
774
|
+
idMismatch: "The returned message has a different ID",
|
|
775
|
+
}
|
|
776
|
+
|
|
777
|
+
/** @internal Describe the response field path or named check that failed, for messages and log records */
|
|
778
|
+
export function responseFieldText(responseField: string): string {
|
|
779
|
+
return Object.hasOwn(responseChecks, responseField)
|
|
780
|
+
? (responseChecks[responseField] as string)
|
|
781
|
+
: `Field ${responseField} is missing or has the wrong type`
|
|
782
|
+
}
|
|
783
|
+
|
|
784
|
+
/**
|
|
785
|
+
* Build an operation-error message from SDK-written facts, without copying server text or unreviewed response data.
|
|
786
|
+
* The message leads with the failed operation and what happened, puts Fluxer's code, the HTTP status and the retry wait
|
|
787
|
+
* in parentheses, then lists rejected fields and says when a write may have been applied
|
|
788
|
+
*/
|
|
789
|
+
export function operationErrorMessage(input: {
|
|
790
|
+
/** Resource or workflow named first, such as "Message cleanup" */
|
|
791
|
+
readonly subject: string
|
|
792
|
+
readonly operation: string
|
|
793
|
+
readonly reason: string
|
|
794
|
+
readonly outcome: string
|
|
795
|
+
readonly status?: number | null
|
|
796
|
+
readonly apiError?: ApiErrorDetail | null
|
|
797
|
+
/** Explanation of a local input rejection, used when Fluxer supplied no detail */
|
|
798
|
+
readonly inputExplanation?: string | null
|
|
799
|
+
readonly retryAfterMs?: number | null
|
|
800
|
+
readonly facts?: OperationMessageFacts
|
|
801
|
+
}): string {
|
|
802
|
+
const { subject, operation, reason, outcome, facts = {} } = input
|
|
803
|
+
const status = input.status ?? null
|
|
804
|
+
const apiError = input.apiError ?? null
|
|
805
|
+
const inputExplanation = input.inputExplanation ?? null
|
|
806
|
+
const retryAfterMs = input.retryAfterMs ?? null
|
|
807
|
+
const fallback = reasonExplanations[reason] ?? `The operation failed with reason ${reason}`
|
|
808
|
+
const providerCode = facts.providerCode ?? null
|
|
809
|
+
const responseField = facts.responseField ?? null
|
|
810
|
+
const detail =
|
|
811
|
+
apiError !== null && reason !== "rateLimit"
|
|
812
|
+
? apiError.explanation
|
|
813
|
+
: providerCode !== null
|
|
814
|
+
? `Fluxer returned ${providerCode}, a code this SDK version does not describe yet`
|
|
815
|
+
: reason === "response" && responseField !== null
|
|
816
|
+
? `${fallback}. ${responseFieldText(responseField)}`
|
|
817
|
+
: (inputExplanation ?? fallback)
|
|
818
|
+
const validation = (apiError?.validationErrors ?? []).map((error) => {
|
|
819
|
+
const text = Object.hasOwn(validationErrorMappings, error.providerCode)
|
|
820
|
+
? `${error.explanation} (${error.providerCode})`
|
|
821
|
+
: `Fluxer returned ${error.providerCode}, a code this SDK version does not describe yet`
|
|
822
|
+
return error.path === undefined ? text : `Field ${error.path}: ${text}`
|
|
823
|
+
})
|
|
824
|
+
const parts = [
|
|
825
|
+
apiError?.providerCode ?? null,
|
|
826
|
+
status === null ? null : `HTTP ${status}`,
|
|
827
|
+
retryAfterMs === null ? null : `retry after ${retryAfterMs} ms`,
|
|
828
|
+
].filter((part): part is string => part !== null && part !== "")
|
|
829
|
+
const label = operation.includes(".") ? `${subject} operation ${operation}` : `${subject} ${operation}`
|
|
830
|
+
return [
|
|
831
|
+
`${label} failed: ${detail}${parts.length ? ` (${parts.join(", ")})` : ""}`,
|
|
832
|
+
...validation,
|
|
833
|
+
...(outcome === "unknown" && facts.read !== true ? ["The change may still have been applied"] : []),
|
|
834
|
+
].join(". ")
|
|
835
|
+
}
|
|
836
|
+
|
|
837
|
+
/**
|
|
838
|
+
* @internal The suggested next step for an operation failure: A possibly applied write first, then Fluxer's rejection
|
|
839
|
+
* category or HTTP status, then the failure reason. An input failure names the rejected path when known, and a
|
|
840
|
+
* missing permission names the permissions of a supplied requirement
|
|
841
|
+
*/
|
|
842
|
+
export function operationFailureHint(input: {
|
|
843
|
+
readonly reason: string
|
|
844
|
+
readonly outcome: string
|
|
845
|
+
readonly status?: number | null
|
|
846
|
+
readonly retryAfterMs?: number | null
|
|
847
|
+
readonly apiError?: ApiErrorDetail | null
|
|
848
|
+
readonly read?: boolean
|
|
849
|
+
readonly inputPath?: string | null | undefined
|
|
850
|
+
readonly oauthError?: string | null
|
|
851
|
+
readonly credential?: RequestCredential
|
|
852
|
+
/** What the failed operation requires, supplied only for a missing-permission rejection */
|
|
853
|
+
readonly requirement?: PermissionRequirement | undefined
|
|
854
|
+
}): string | undefined {
|
|
855
|
+
const { reason, outcome } = input
|
|
856
|
+
const read = input.read === true
|
|
857
|
+
const general = operationHint(reason, outcome, input.retryAfterMs ?? null, read)
|
|
858
|
+
if (reason === "rateLimit" || (outcome === "unknown" && !read)) return general
|
|
859
|
+
if (reason === "rejected" || reason === "notFound")
|
|
860
|
+
return (
|
|
861
|
+
(input.requirement === undefined ? undefined : requiredPermissionsHint(input.requirement)) ??
|
|
862
|
+
oauthErrorHint(input.oauthError ?? null) ??
|
|
863
|
+
apiErrorHint(input.apiError ?? null, input.status ?? null, input.credential) ??
|
|
864
|
+
(reason === "notFound" ? apiErrorHints.unknownResource : undefined)
|
|
865
|
+
)
|
|
866
|
+
if (reason === "input" && input.inputPath) return `Correct ${input.inputPath}. Nothing was sent to Fluxer`
|
|
867
|
+
return general
|
|
868
|
+
}
|
|
869
|
+
|
|
870
|
+
/** @internal Normalized operation-error fields with null defaults */
|
|
871
|
+
export interface OperationErrorFields<
|
|
872
|
+
Operation extends string,
|
|
873
|
+
Reason extends string,
|
|
874
|
+
Outcome extends string = OperationOutcome,
|
|
875
|
+
> {
|
|
876
|
+
readonly operation: Operation
|
|
877
|
+
readonly reason: Reason
|
|
878
|
+
readonly outcome: Outcome
|
|
879
|
+
readonly status: number | null
|
|
880
|
+
readonly retryAfterMs: number | null
|
|
881
|
+
readonly apiError: ApiErrorDetail | null
|
|
882
|
+
readonly inputValidation: InputValidationDetail | null
|
|
883
|
+
readonly read: boolean
|
|
884
|
+
readonly providerCode: string | null
|
|
885
|
+
readonly responseField: string | null
|
|
886
|
+
}
|
|
887
|
+
|
|
888
|
+
/**
|
|
889
|
+
* @internal Facts a composed operation keeps when it reports a failed step under its own operation name: The
|
|
890
|
+
* unrecognized Fluxer code, the failing response field, the read marker and the step's error as the cause
|
|
891
|
+
*/
|
|
892
|
+
export function composedStepFacts(error: {
|
|
893
|
+
readonly details: Readonly<Record<string, unknown>>
|
|
894
|
+
}): Pick<OperationErrorOptions<string>, "providerCode" | "responseField" | "read" | "cause"> {
|
|
895
|
+
const { providerCode, responseField, read } = error.details
|
|
896
|
+
return {
|
|
897
|
+
providerCode: typeof providerCode === "string" ? providerCode : null,
|
|
898
|
+
responseField: typeof responseField === "string" ? responseField : null,
|
|
899
|
+
read: read === true,
|
|
900
|
+
cause: error,
|
|
901
|
+
}
|
|
902
|
+
}
|
|
903
|
+
|
|
904
|
+
/** @internal An unrecognized Fluxer code with the safe shape, or null. A recognized apiError wins over it */
|
|
905
|
+
export function safeProviderCode(apiError: ApiErrorDetail | null, providerCode: string | null): string | null {
|
|
906
|
+
return apiError === null && providerCode !== null && providerCodePattern.test(providerCode) ? providerCode : null
|
|
907
|
+
}
|
|
908
|
+
|
|
909
|
+
/** @internal A response field path or check name with the safe shape, or null */
|
|
910
|
+
export function safeResponseField(responseField: string | null): string | null {
|
|
911
|
+
return responseField !== null && /^[A-Za-z0-9_.]{1,128}$/.test(responseField) ? responseField : null
|
|
912
|
+
}
|
|
913
|
+
|
|
914
|
+
/** @internal Apply null defaults to operation-error options, keeping only safe code and field shapes */
|
|
915
|
+
export function operationErrorFields<Operation extends string, Reason extends string>(
|
|
916
|
+
options: OperationErrorOptions<Operation, Reason>,
|
|
917
|
+
): OperationErrorFields<Operation, Reason> {
|
|
918
|
+
const apiError = options.apiError ?? null
|
|
919
|
+
const providerCode = options.providerCode ?? null
|
|
920
|
+
const responseField = options.responseField ?? null
|
|
921
|
+
return {
|
|
922
|
+
operation: options.operation,
|
|
923
|
+
reason: options.reason,
|
|
924
|
+
outcome: options.outcome,
|
|
925
|
+
status: options.status ?? null,
|
|
926
|
+
retryAfterMs: options.retryAfterMs ?? null,
|
|
927
|
+
apiError,
|
|
928
|
+
inputValidation: options.inputValidation ?? null,
|
|
929
|
+
read: options.read === true,
|
|
930
|
+
providerCode: safeProviderCode(apiError, providerCode),
|
|
931
|
+
responseField: safeResponseField(responseField),
|
|
932
|
+
}
|
|
933
|
+
}
|
|
934
|
+
|
|
935
|
+
/** @internal The readable message for a resource operation error */
|
|
936
|
+
export function operationErrorText(subject: string, fields: OperationErrorFields<string, string, string>): string {
|
|
937
|
+
return operationErrorMessage({
|
|
938
|
+
subject,
|
|
939
|
+
operation: fields.operation,
|
|
940
|
+
reason: fields.reason,
|
|
941
|
+
outcome: fields.outcome,
|
|
942
|
+
status: fields.status,
|
|
943
|
+
apiError: fields.apiError,
|
|
944
|
+
inputExplanation: fields.inputValidation?.explanation ?? null,
|
|
945
|
+
retryAfterMs: fields.retryAfterMs,
|
|
946
|
+
facts: fields,
|
|
947
|
+
})
|
|
948
|
+
}
|
|
949
|
+
|
|
950
|
+
/**
|
|
951
|
+
* @internal Code, hint, cause and safe details for a resource operation error. A missing-permission rejection of an
|
|
952
|
+
* operation with a known requirement names its permissions in the hint and in details.requiredPermissions
|
|
953
|
+
*/
|
|
954
|
+
export function operationErrorSettings(
|
|
955
|
+
prefix: string,
|
|
956
|
+
fields: OperationErrorFields<string, string, string>,
|
|
957
|
+
cause: unknown,
|
|
958
|
+
credential: RequestCredential = "bot",
|
|
959
|
+
): FluxerlyErrorOptions {
|
|
960
|
+
const requirement =
|
|
961
|
+
fields.apiError?.code === "missingPermissions" ? permissionRequirement(fields.operation) : undefined
|
|
962
|
+
return {
|
|
963
|
+
code: `${prefix}.${fields.reason}`,
|
|
964
|
+
hint: operationFailureHint({
|
|
965
|
+
...fields,
|
|
966
|
+
inputPath: fields.inputValidation?.path ?? null,
|
|
967
|
+
credential,
|
|
968
|
+
requirement,
|
|
969
|
+
}),
|
|
970
|
+
cause,
|
|
971
|
+
details: operationDetails({
|
|
972
|
+
operation: fields.operation,
|
|
973
|
+
reason: fields.reason,
|
|
974
|
+
outcome: fields.outcome,
|
|
975
|
+
status: fields.status,
|
|
976
|
+
retryAfterMs: fields.retryAfterMs,
|
|
977
|
+
apiError: fields.apiError?.providerCode,
|
|
978
|
+
providerCode: fields.providerCode,
|
|
979
|
+
responseField: fields.responseField,
|
|
980
|
+
inputPath: fields.inputValidation?.path,
|
|
981
|
+
read: fields.read || undefined,
|
|
982
|
+
requiredPermissions: requirement?.permissions,
|
|
983
|
+
}),
|
|
984
|
+
}
|
|
985
|
+
}
|