@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,293 @@
|
|
|
1
|
+
import type { GuildListQuery, GuildListSummary } from "#sdk/guilds"
|
|
2
|
+
import * as Effect from "effect/Effect"
|
|
3
|
+
import * as Exit from "effect/Exit"
|
|
4
|
+
import * as Scope from "effect/Scope"
|
|
5
|
+
import { ok, ResultAsync } from "neverthrow"
|
|
6
|
+
import { causeReasons, suspendInput } from "#sdk/internal/defects"
|
|
7
|
+
import {
|
|
8
|
+
createPkce,
|
|
9
|
+
type OAuthPkce,
|
|
10
|
+
type OAuthAuthorizationInput,
|
|
11
|
+
type OAuthConnection,
|
|
12
|
+
type OAuthCodeExchangeInput,
|
|
13
|
+
type OAuthConfig,
|
|
14
|
+
type OAuthIdentity,
|
|
15
|
+
type OAuthIntrospection,
|
|
16
|
+
type OAuthOperationFailure,
|
|
17
|
+
type OAuthTokens,
|
|
18
|
+
type DefaultOAuthOperationOptions,
|
|
19
|
+
} from "#sdk/oauth"
|
|
20
|
+
import { makeOAuthOwner } from "#sdk/internal/oauth"
|
|
21
|
+
import { CancelledError, ConfigurationError, SdkDefect } from "#sdk/errors"
|
|
22
|
+
import { executeOperation, fromExit } from "#sdk/internal/binding/execute"
|
|
23
|
+
|
|
24
|
+
function oauthOwnerOptions(options: DefaultOAuthOperationOptions | undefined) {
|
|
25
|
+
if (Array.isArray(options)) return options
|
|
26
|
+
if (typeof options !== "object" || options === null || !("signal" in options)) return options
|
|
27
|
+
const { signal: _signal, ...ownerOptions } = options
|
|
28
|
+
return ownerOptions
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
/**
|
|
32
|
+
* Use a standalone OAuth client to exchange authorization codes, refresh or revoke tokens, and read delegated user data.
|
|
33
|
+
* This confidential client requires a server-held client secret, not a bot token.
|
|
34
|
+
* It does not open a browser, handle callbacks, compare state, store tokens or run a gateway.
|
|
35
|
+
* The application owns those steps and coordinates refreshes
|
|
36
|
+
*
|
|
37
|
+
* @remarks
|
|
38
|
+
* The secret is copied until shutdown.
|
|
39
|
+
* Calls start immediately and return ResultAsync.
|
|
40
|
+
* At most eight operations run at once.
|
|
41
|
+
* While eight are running, another operation fails at once with OAuthOperationError reason busy instead of waiting.
|
|
42
|
+
* The timeoutMs option defaults to 30,000 for discovery and the operation, with request cleanup awaited afterward.
|
|
43
|
+
* Responses are capped at 1 MiB and requests are never retried automatically.
|
|
44
|
+
* Discovery throttling returns OAuthOperationError with reason rateLimit, outcome notDispatched, status 429 and the server's retryAfterMs when available
|
|
45
|
+
*
|
|
46
|
+
* Expected failures return Err.
|
|
47
|
+
* A throw while reading input or option properties rejects with SdkDefect code application.defect and the thrown value
|
|
48
|
+
* as its cause, and unexpected cleanup failures reject with SdkDefect.
|
|
49
|
+
* It keeps the original cleanup failure, never response text, and its message and toJSON mask credential patterns
|
|
50
|
+
*
|
|
51
|
+
* @category OAuth
|
|
52
|
+
*/
|
|
53
|
+
export interface OAuthClient extends AsyncDisposable {
|
|
54
|
+
/**
|
|
55
|
+
* Build an authorization URL for the selected instance using its discovered web application URL, including its path.
|
|
56
|
+
* Supply the redirect URI, scopes, caller-generated state and S256 PKCE challenge, which binds the callback code to the private verifier.
|
|
57
|
+
* The application must retain state correlation and the PKCE verifier.
|
|
58
|
+
* Bot community and permission parameters are consent hints, not proof of installation or authorization.
|
|
59
|
+
* This returns the URL without opening it.
|
|
60
|
+
* Network failures retain only sanitized transport facts in cause
|
|
61
|
+
*/
|
|
62
|
+
authorizationUrl(
|
|
63
|
+
input: OAuthAuthorizationInput,
|
|
64
|
+
options?: DefaultOAuthOperationOptions,
|
|
65
|
+
): ResultAsync<string, OAuthOperationFailure | CancelledError | ConfigurationError>
|
|
66
|
+
/**
|
|
67
|
+
* Exchange the code from an authorization callback for access and refresh tokens.
|
|
68
|
+
* Supply the matching redirect URI and PKCE verifier.
|
|
69
|
+
* The application must store the returned tokens.
|
|
70
|
+
* After dispatch, cancellation or a lost response cannot tell whether Fluxer consumed the one-use code.
|
|
71
|
+
* Do not retry that exchange when its outcome is unknown.
|
|
72
|
+
* Network failures retain only sanitized transport facts in cause
|
|
73
|
+
*/
|
|
74
|
+
exchangeCode(
|
|
75
|
+
input: OAuthCodeExchangeInput,
|
|
76
|
+
options?: DefaultOAuthOperationOptions,
|
|
77
|
+
): ResultAsync<OAuthTokens, OAuthOperationFailure | CancelledError | ConfigurationError>
|
|
78
|
+
/**
|
|
79
|
+
* Exchange a refresh token for a new access and refresh token pair.
|
|
80
|
+
* Form tokens must contain 1–256 well-formed UTF-16 units without surrounding whitespace, U+000C or U+202E.
|
|
81
|
+
* Invalid values fail locally rather than being normalized, and this also applies to revoke and introspect tokens.
|
|
82
|
+
* Fluxer rotates refresh tokens.
|
|
83
|
+
* The application must coordinate refreshes and atomically replace both stored tokens after success, so it never stores a mixed pair.
|
|
84
|
+
* A refresh with an unknown outcome must not be retried, because it may have rotated the token.
|
|
85
|
+
* Network failures retain only sanitized transport facts in cause
|
|
86
|
+
*/
|
|
87
|
+
refresh(
|
|
88
|
+
refreshToken: string,
|
|
89
|
+
options?: DefaultOAuthOperationOptions,
|
|
90
|
+
): ResultAsync<OAuthTokens, OAuthOperationFailure | CancelledError | ConfigurationError>
|
|
91
|
+
/**
|
|
92
|
+
* Revoke an access or refresh token, with an optional token-type hint.
|
|
93
|
+
* The token and hint are captured once when execution starts, then validated and transmitted from that snapshot.
|
|
94
|
+
* A lost response can still mean the token was revoked.
|
|
95
|
+
* Network failures retain only sanitized transport facts in cause
|
|
96
|
+
*/
|
|
97
|
+
revoke(
|
|
98
|
+
input: {
|
|
99
|
+
/** Access or refresh token to invalidate. Keep this secret out of logs */
|
|
100
|
+
readonly token: string
|
|
101
|
+
/** Identify the token as an access token or a refresh token. Omit when the kind is unknown */
|
|
102
|
+
readonly tokenTypeHint?: "access_token" | "refresh_token"
|
|
103
|
+
},
|
|
104
|
+
options?: DefaultOAuthOperationOptions,
|
|
105
|
+
): ResultAsync<void, OAuthOperationFailure | CancelledError | ConfigurationError>
|
|
106
|
+
/**
|
|
107
|
+
* Fetch the delegated user's identity with an access token granted the identify scope.
|
|
108
|
+
* Additional identity fields depend on the token's scopes.
|
|
109
|
+
* The access token is not retained by this client.
|
|
110
|
+
* Failures identify a read in details.read, so errors.isRetryable can classify transient failures without implying a token change.
|
|
111
|
+
* Requests are not retried automatically, and network causes retain only sanitized transport facts
|
|
112
|
+
*/
|
|
113
|
+
fetchIdentity(
|
|
114
|
+
accessToken: string,
|
|
115
|
+
options?: DefaultOAuthOperationOptions,
|
|
116
|
+
): ResultAsync<OAuthIdentity, OAuthOperationFailure | CancelledError | ConfigurationError>
|
|
117
|
+
/**
|
|
118
|
+
* Fetch one bounded page of the delegated user's community memberships.
|
|
119
|
+
* Use an access token with Fluxer's guilds scope.
|
|
120
|
+
* Optionally supply pagination settings in GuildListQuery, where limit defaults to 200 and accepts 1–200, and before and after are mutually exclusive cursors.
|
|
121
|
+
* This uses bearer authentication with the supplied access token, never the bot token.
|
|
122
|
+
* Failures identify a read in details.read for errors.isRetryable. Requests are not retried automatically,
|
|
123
|
+
* and network causes retain only sanitized transport facts
|
|
124
|
+
*/
|
|
125
|
+
fetchGuilds(
|
|
126
|
+
accessToken: string,
|
|
127
|
+
query?: GuildListQuery,
|
|
128
|
+
options?: DefaultOAuthOperationOptions,
|
|
129
|
+
): ResultAsync<readonly GuildListSummary[], OAuthOperationFailure | CancelledError | ConfigurationError>
|
|
130
|
+
/**
|
|
131
|
+
* Fetch the delegated user's full connections list with a connections-scoped access token.
|
|
132
|
+
* The client neither creates, verifies, reorders nor retains those connections.
|
|
133
|
+
* Failures identify a read in details.read for errors.isRetryable. Requests are not retried automatically,
|
|
134
|
+
* and network causes retain only sanitized transport facts
|
|
135
|
+
*/
|
|
136
|
+
fetchConnections(
|
|
137
|
+
accessToken: string,
|
|
138
|
+
options?: DefaultOAuthOperationOptions,
|
|
139
|
+
): ResultAsync<readonly OAuthConnection[], OAuthOperationFailure | CancelledError | ConfigurationError>
|
|
140
|
+
/**
|
|
141
|
+
* Inspect an access or refresh token using this client's ID and secret through HTTP Basic authentication.
|
|
142
|
+
* An inactive result does not explain expiry or revocation, prove token ownership or establish whether it ever existed.
|
|
143
|
+
* Failures identify a read in details.read for errors.isRetryable. Requests are not retried automatically,
|
|
144
|
+
* and network causes retain only sanitized transport facts
|
|
145
|
+
*/
|
|
146
|
+
introspect(
|
|
147
|
+
token: string,
|
|
148
|
+
options?: DefaultOAuthOperationOptions,
|
|
149
|
+
): ResultAsync<OAuthIntrospection, OAuthOperationFailure | CancelledError | ConfigurationError>
|
|
150
|
+
/**
|
|
151
|
+
* Permanently stop OAuth work, reject new work, release the client's copied secret and abort active requests.
|
|
152
|
+
* Shutdown waits for fetch and response-reader cleanup.
|
|
153
|
+
* A response-cleanup failure in an active operation fails that operation, while shutdown waits for it and may itself succeed.
|
|
154
|
+
* A failure in shutdown's own discovery cleanup fails shutdown
|
|
155
|
+
*
|
|
156
|
+
* @remarks
|
|
157
|
+
* Those cleanup failures reject with SdkDefect
|
|
158
|
+
*/
|
|
159
|
+
shutdown(): ResultAsync<void, never>
|
|
160
|
+
/**
|
|
161
|
+
* Shut down this client and wait for cleanup, as `await using` does at the end of a block.
|
|
162
|
+
* Unexpected cleanup failures reject with SdkDefect, as shutdown does
|
|
163
|
+
*/
|
|
164
|
+
[Symbol.asyncDispose](): Promise<void>
|
|
165
|
+
}
|
|
166
|
+
|
|
167
|
+
/**
|
|
168
|
+
* Create confidential OAuth clients and generate PKCE values for authorization-code flows.
|
|
169
|
+
* Use these helpers on a trusted server where the client secret is not exposed to a browser
|
|
170
|
+
*
|
|
171
|
+
* @remarks
|
|
172
|
+
* The application handles browser navigation, callbacks, state correlation, consent and token storage.
|
|
173
|
+
* It also decides installation policy and coordinates refreshes.
|
|
174
|
+
* The create method returns the client synchronously without making a request, and throws ConfigurationError for invalid settings.
|
|
175
|
+
* The createPkce method returns a new verifier and S256 challenge for the same authorization flow.
|
|
176
|
+
* PKCE links authorization to the code exchange using a private random verifier and its public SHA-256 hash challenge.
|
|
177
|
+
* Keep the verifier private and send only the challenge to authorizationUrl
|
|
178
|
+
*
|
|
179
|
+
* @example
|
|
180
|
+
* ```ts
|
|
181
|
+
* import { oauth, OAuthScopes } from "@neontechspace/fluxerly"
|
|
182
|
+
*
|
|
183
|
+
* export async function oauthExample(clientId: string, clientSecret: string, redirectUri: string, state: string) {
|
|
184
|
+
* const client = oauth.create({ clientId, clientSecret })
|
|
185
|
+
* try {
|
|
186
|
+
* const pkce = oauth.createPkce()
|
|
187
|
+
* return await client.authorizationUrl({
|
|
188
|
+
* redirectUri,
|
|
189
|
+
* scopes: [OAuthScopes.Identify, OAuthScopes.Bot],
|
|
190
|
+
* state,
|
|
191
|
+
* codeChallenge: pkce.challenge,
|
|
192
|
+
* guildId: "456",
|
|
193
|
+
* permissions: 0n,
|
|
194
|
+
* })
|
|
195
|
+
* } finally {
|
|
196
|
+
* await client.shutdown()
|
|
197
|
+
* }
|
|
198
|
+
* }
|
|
199
|
+
* ```
|
|
200
|
+
*
|
|
201
|
+
* @category OAuth
|
|
202
|
+
*/
|
|
203
|
+
export const oauth: Readonly<{
|
|
204
|
+
/**
|
|
205
|
+
* Create a standalone OAuth client with a clientId and server-held clientSecret.
|
|
206
|
+
* Creation checks configuration synchronously without requests and copies the secret until shutdown.
|
|
207
|
+
* Invalid settings throw ConfigurationError.
|
|
208
|
+
* Unexpected creation failures throw SdkDefect with operation oauth.create and without configuration details.
|
|
209
|
+
* A throwing configuration getter uses code application.defect with the thrown value as its cause
|
|
210
|
+
*/
|
|
211
|
+
create(config: OAuthConfig): OAuthClient
|
|
212
|
+
/**
|
|
213
|
+
* Generate a private verifier and matching S256 challenge for one authorization-code flow.
|
|
214
|
+
* Send challenge to authorizationUrl and keep verifier privately for exchangeCode.
|
|
215
|
+
* This synchronous helper returns the values immediately, without a request or token storage.
|
|
216
|
+
* It does not generate or verify the callback's state value
|
|
217
|
+
*/
|
|
218
|
+
createPkce: () => OAuthPkce
|
|
219
|
+
}> = Object.freeze({
|
|
220
|
+
create(config: OAuthConfig): OAuthClient {
|
|
221
|
+
const scope = Scope.makeUnsafe()
|
|
222
|
+
const created = fromExit(Effect.runSyncExit(makeOAuthOwner(config, scope)), "oauth.create")
|
|
223
|
+
if (created.isErr()) throw created.error
|
|
224
|
+
const owner = created.value
|
|
225
|
+
const shutdown = () =>
|
|
226
|
+
new ResultAsync<void, never>(
|
|
227
|
+
Effect.runPromiseExit(owner.shutdown()).then((exit) => {
|
|
228
|
+
const result = fromExit(exit, "shutdown")
|
|
229
|
+
if (result.isErr())
|
|
230
|
+
throw new SdkDefect("shutdown", Exit.isFailure(exit) ? causeReasons(exit.cause) : [])
|
|
231
|
+
return ok(undefined)
|
|
232
|
+
}),
|
|
233
|
+
)
|
|
234
|
+
return Object.freeze({
|
|
235
|
+
authorizationUrl: (input: OAuthAuthorizationInput, options?: DefaultOAuthOperationOptions) =>
|
|
236
|
+
executeOperation(
|
|
237
|
+
suspendInput(() => owner.authorizationUrl(input, oauthOwnerOptions(options))),
|
|
238
|
+
"oauth.authorizationUrl",
|
|
239
|
+
options,
|
|
240
|
+
),
|
|
241
|
+
exchangeCode: (input: OAuthCodeExchangeInput, options?: DefaultOAuthOperationOptions) =>
|
|
242
|
+
executeOperation(
|
|
243
|
+
suspendInput(() => owner.exchangeCode(input, oauthOwnerOptions(options))),
|
|
244
|
+
"oauth.exchangeCode",
|
|
245
|
+
options,
|
|
246
|
+
),
|
|
247
|
+
refresh: (refreshToken: string, options?: DefaultOAuthOperationOptions) =>
|
|
248
|
+
executeOperation(
|
|
249
|
+
suspendInput(() => owner.refresh(refreshToken, oauthOwnerOptions(options))),
|
|
250
|
+
"oauth.refresh",
|
|
251
|
+
options,
|
|
252
|
+
),
|
|
253
|
+
revoke: (
|
|
254
|
+
input: { readonly token: string; readonly tokenTypeHint?: "access_token" | "refresh_token" },
|
|
255
|
+
options?: DefaultOAuthOperationOptions,
|
|
256
|
+
) =>
|
|
257
|
+
executeOperation(
|
|
258
|
+
suspendInput(() => owner.revoke(input, oauthOwnerOptions(options))),
|
|
259
|
+
"oauth.revoke",
|
|
260
|
+
options,
|
|
261
|
+
),
|
|
262
|
+
fetchIdentity: (accessToken: string, options?: DefaultOAuthOperationOptions) =>
|
|
263
|
+
executeOperation(
|
|
264
|
+
suspendInput(() => owner.fetchIdentity(accessToken, oauthOwnerOptions(options))),
|
|
265
|
+
"oauth.fetchIdentity",
|
|
266
|
+
options,
|
|
267
|
+
),
|
|
268
|
+
fetchGuilds: (accessToken: string, query?: GuildListQuery, options?: DefaultOAuthOperationOptions) =>
|
|
269
|
+
executeOperation(
|
|
270
|
+
suspendInput(() => owner.fetchGuilds(accessToken, query, oauthOwnerOptions(options))),
|
|
271
|
+
"oauth.fetchGuilds",
|
|
272
|
+
options,
|
|
273
|
+
),
|
|
274
|
+
fetchConnections: (accessToken: string, options?: DefaultOAuthOperationOptions) =>
|
|
275
|
+
executeOperation(
|
|
276
|
+
suspendInput(() => owner.fetchConnections(accessToken, oauthOwnerOptions(options))),
|
|
277
|
+
"oauth.fetchConnections",
|
|
278
|
+
options,
|
|
279
|
+
),
|
|
280
|
+
introspect: (token: string, options?: DefaultOAuthOperationOptions) =>
|
|
281
|
+
executeOperation(
|
|
282
|
+
suspendInput(() => owner.introspect(token, oauthOwnerOptions(options))),
|
|
283
|
+
"oauth.introspect",
|
|
284
|
+
options,
|
|
285
|
+
),
|
|
286
|
+
shutdown,
|
|
287
|
+
[Symbol.asyncDispose]: async () => {
|
|
288
|
+
await shutdown()
|
|
289
|
+
},
|
|
290
|
+
})
|
|
291
|
+
},
|
|
292
|
+
createPkce,
|
|
293
|
+
})
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
import type { PermissionInput, PermissionTarget } from "#sdk/permissions"
|
|
2
|
+
import type { ResultAsync } from "neverthrow"
|
|
3
|
+
import type { ChannelOperationFailure } from "#sdk/channels"
|
|
4
|
+
import type { GuildOperationFailure, DefaultGuildOperationOptions } from "#sdk/guilds"
|
|
5
|
+
import type { CancelledError, ConfigurationError } from "#sdk/errors"
|
|
6
|
+
|
|
7
|
+
/**
|
|
8
|
+
* Calculate permission flags from supplied data or fresh reads.
|
|
9
|
+
* A permission value alone does not determine channel visibility, role hierarchy, timeouts or authorization for an action
|
|
10
|
+
*
|
|
11
|
+
* @category Roles and permissions
|
|
12
|
+
*/
|
|
13
|
+
export interface PermissionHelpers {
|
|
14
|
+
/**
|
|
15
|
+
* Calculate permission flags from supplied guild, member, role and optional channel data.
|
|
16
|
+
* No request or cache read is made, and connection state is irrelevant, including after client shutdown.
|
|
17
|
+
* The bigint result ranges from 0n through 18_446_744_073_709_551_615n and preserves unknown flags.
|
|
18
|
+
* Community owner or base Administrator gets all flags.
|
|
19
|
+
* Otherwise the calculation applies everyone, combined roles, then member overwrites.
|
|
20
|
+
* Only the target channel's stored overwrites are used, not its parent category's.
|
|
21
|
+
* A thread uses the overwrites of the parentChannel supplied with it, then grants SendMessages exactly when
|
|
22
|
+
* SendMessagesInThreads is granted, as Fluxer does. A thread without its parentChannel, or with any other channel as
|
|
23
|
+
* parentChannel, is rejected.
|
|
24
|
+
* Missing or inconsistent input is misuse and throws GuildOperationError for permissions.calculate with reason input in both APIs
|
|
25
|
+
*
|
|
26
|
+
* @remarks
|
|
27
|
+
* Returns the value synchronously.
|
|
28
|
+
* Unexpected failures throw SdkDefect
|
|
29
|
+
*/
|
|
30
|
+
calculate(input: PermissionInput): bigint
|
|
31
|
+
/**
|
|
32
|
+
* Fetch guild, member, role and optional channel data, then calculate their permission flags.
|
|
33
|
+
* No gateway connection or cache-first lookup is needed.
|
|
34
|
+
* A thread channel adds a read of its parent channel, and the result follows Fluxer's thread rule as in calculate.
|
|
35
|
+
* Underlying reads can enter enabled caches, but the calculated result is not cached.
|
|
36
|
+
* The sequential reads are separate observations, so the result does not guarantee a later action will succeed.
|
|
37
|
+
* The default deadline, rest.defaultTimeoutMs (30,000 ms unless configured), covers the whole helper with shared read retries and awaited cancellation cleanup.
|
|
38
|
+
* Invalid target or deadline fails with permissions.fetch reason input.
|
|
39
|
+
* Resource errors keep their GuildOperationError or ChannelOperationError.
|
|
40
|
+
* A channel from another community fails instead of mixing guild data.
|
|
41
|
+
* Client closure fails with ClientClosedError
|
|
42
|
+
*/
|
|
43
|
+
fetch(
|
|
44
|
+
target: PermissionTarget,
|
|
45
|
+
options?: DefaultGuildOperationOptions,
|
|
46
|
+
): ResultAsync<bigint, GuildOperationFailure | ChannelOperationFailure | CancelledError | ConfigurationError>
|
|
47
|
+
}
|
|
@@ -0,0 +1,88 @@
|
|
|
1
|
+
import type { PresenceInput, PresenceFailure } from "#sdk/presence"
|
|
2
|
+
import type { Result } from "neverthrow"
|
|
3
|
+
|
|
4
|
+
/**
|
|
5
|
+
* Set the bot's displayed status or request updates for selected community members.
|
|
6
|
+
* Outgoing status is sent to live shards assigned to this client, at least four seconds apart per shard.
|
|
7
|
+
* Member selections use separate bounded gateway requests.
|
|
8
|
+
* Neither operation has a provider acknowledgement or recipient-delivery guarantee.
|
|
9
|
+
* The SDK does not fetch membership or filter out self.
|
|
10
|
+
* Fluxer decides access and which updates are visible
|
|
11
|
+
*
|
|
12
|
+
* @category Client and lifecycle
|
|
13
|
+
*/
|
|
14
|
+
export interface Presence {
|
|
15
|
+
/**
|
|
16
|
+
* Set the bot's requested status and optional custom status, including before connecting.
|
|
17
|
+
* The input is validated and frozen when the call runs.
|
|
18
|
+
* Omitted customStatus keeps the previous request, and null clears it.
|
|
19
|
+
* Expired custom statuses are not restored after reconnect.
|
|
20
|
+
* Each shard retains at most one unsent status update, replacing it with the latest intent even while gateway pacing waits.
|
|
21
|
+
* The four-second interval starts when an update reaches the socket, not when it is queued.
|
|
22
|
+
* Success means the request was accepted locally and scheduled for each shard, not acknowledged by Fluxer.
|
|
23
|
+
* Shutdown releases this intent and its timer
|
|
24
|
+
*
|
|
25
|
+
* @remarks
|
|
26
|
+
* Returns a Result synchronously.
|
|
27
|
+
* A throwing input getter throws SdkDefect with code application.defect and the thrown value as its cause, and other
|
|
28
|
+
* unexpected failures throw SdkDefect with code sdk.defect
|
|
29
|
+
*
|
|
30
|
+
* @example
|
|
31
|
+
* ```ts
|
|
32
|
+
* import { MemberMentionPreferences, type Client } from "@neontechspace/fluxerly"
|
|
33
|
+
* export async function botProfileExample(client: Client, guildId: string) {
|
|
34
|
+
* const presence = client.presence.set({ status: "online", customStatus: { text: "Ready", emoji: { name: "🌱" } } })
|
|
35
|
+
* if (presence.isErr()) return presence
|
|
36
|
+
* return client.members.editSelf(guildId, { nickname: "Support", mentionFlags: MemberMentionPreferences.PreferNoMention })
|
|
37
|
+
* }
|
|
38
|
+
* ```
|
|
39
|
+
*/
|
|
40
|
+
set(input: PresenceInput): Result<void, PresenceFailure>
|
|
41
|
+
/**
|
|
42
|
+
* Request presence updates for selected members in one community.
|
|
43
|
+
* Register a presenceUpdate listener, then pass accessible non-self member IDs.
|
|
44
|
+
* Pass [] to clear the selection.
|
|
45
|
+
* Closing the listener does not clear it.
|
|
46
|
+
* No full-member subscription, member lookup or presence cache is created, and Fluxer remains authoritative for access and filtering.
|
|
47
|
+
* The community must belong to a shard assigned to this client, or the call fails with PresenceError reason input
|
|
48
|
+
*
|
|
49
|
+
* Inputs are copied and retained when the call runs.
|
|
50
|
+
* Up to 1,000 distinct decimal IDs are accepted, but the full UTF-8 gateway frame must fit 4,096 bytes.
|
|
51
|
+
* Long IDs therefore reduce the effective per-community maximum.
|
|
52
|
+
* The client retains selections for at most 100 communities and 10,000 IDs.
|
|
53
|
+
* Clearing an unsent selection withdraws its queued command and releases its slot immediately.
|
|
54
|
+
* Changes to a selection that has not reached the socket replace that unsent request.
|
|
55
|
+
* Clearing a selection already sent keeps one bounded session slot until fresh Identify or confirmed community leave, because a local socket write cannot confirm that Fluxer applied a clear
|
|
56
|
+
*
|
|
57
|
+
* After READY or RESUMED, the latest selection or clear is combined and sent at most once per 125 ms per shard.
|
|
58
|
+
* This interval starts at actual socket transmission, and at most one member-selection command waits per shard.
|
|
59
|
+
* Sending the same list again deliberately requests a refresh.
|
|
60
|
+
* A matching guild creation also retries the latest selection or a previously sent clear.
|
|
61
|
+
* None of these attempts guarantees an event or proves provider acceptance.
|
|
62
|
+
* Initial state and transitions can be missed during recovery.
|
|
63
|
+
* Loss of shared channel visibility can remove the provider subscription, so resend the selection after access returns.
|
|
64
|
+
* Clear explicitly or shut down the client to release local intent.
|
|
65
|
+
* Input or limit failures fail with PresenceError, and closing clients fail with ClientClosedError.
|
|
66
|
+
* The community and member IDs must be positive decimal strings without leading zeros, no greater than 9223372036854775807.
|
|
67
|
+
* The member IDs are copied once, and that copy is validated and subscribed
|
|
68
|
+
*
|
|
69
|
+
* @remarks
|
|
70
|
+
* Returns a Result synchronously.
|
|
71
|
+
* A throwing ID getter throws SdkDefect with code application.defect and the thrown value as its cause, and other
|
|
72
|
+
* unexpected failures throw SdkDefect with code sdk.defect
|
|
73
|
+
*
|
|
74
|
+
* @example
|
|
75
|
+
* ```ts
|
|
76
|
+
* import type { Client } from "@neontechspace/fluxerly"
|
|
77
|
+
* export function watchSelectedMember(client: Client, guildId: string, memberId: string) {
|
|
78
|
+
* const subscription = client.on("presenceUpdate", (presence) => {
|
|
79
|
+
* if (presence.guildId === guildId && presence.userId === memberId) void presence.status
|
|
80
|
+
* })
|
|
81
|
+
* const selected = client.presence.setMembers(guildId, [memberId])
|
|
82
|
+
* if (selected.isErr()) subscription.close()
|
|
83
|
+
* return selected.map(() => subscription)
|
|
84
|
+
* }
|
|
85
|
+
* ```
|
|
86
|
+
*/
|
|
87
|
+
setMembers(guildId: string, memberIds: readonly string[]): Result<void, PresenceFailure>
|
|
88
|
+
}
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import type { ResultAsync } from "neverthrow"
|
|
2
|
+
import type { CancelledError, ConfigurationError } from "#sdk/errors"
|
|
3
|
+
import type { DefaultRestRequest, RestRequestFailure, RestResponse } from "#sdk/rest"
|
|
4
|
+
|
|
5
|
+
/**
|
|
6
|
+
* Send requests to Fluxer API routes that the SDK does not wrap, with the client's bot credential and its REST scheduler.
|
|
7
|
+
* Calls start immediately, need no gateway connection and default to the client's rest.defaultTimeoutMs deadline.
|
|
8
|
+
* Abort waits for cleanup and returns CancelledError. Unexpected failures reject with SdkDefect
|
|
9
|
+
*
|
|
10
|
+
* @category Client and lifecycle
|
|
11
|
+
*/
|
|
12
|
+
export interface RestRequests {
|
|
13
|
+
/**
|
|
14
|
+
* Send one request to a route under /v1 and resolve with its status, lower-case headers and parsed JSON body.
|
|
15
|
+
* The request waits in the client's queue and learned rate-limit windows like wrapped operations, and fails at once
|
|
16
|
+
* with reason rateLimit and the remaining wait as retryAfterMs when a window outlasts the deadline. A 429 is waited
|
|
17
|
+
* out and sent again while the deadline allows. A GET is also retried at most twice after a network error, including
|
|
18
|
+
* a connection lost while the response body arrives, or HTTP 500, 502, 503 or 504. Another method is never sent
|
|
19
|
+
* again after an uncertain outcome.
|
|
20
|
+
* Invalid input fails with RestRequestError reason input before any request, a non-2xx status fails with its status
|
|
21
|
+
* and sanitized apiError, and closure fails with ClientClosedError. Message and resource caches are not updated.
|
|
22
|
+
* Percent-encoded unreserved letters cannot bypass the reserved /v1 prefix or token-webhook route checks, which remain case-sensitive.
|
|
23
|
+
* Network causes retain sanitized transport facts, not raw errors. Unknown uppercase provider codes remain in details.providerCode,
|
|
24
|
+
* including on HTTP 429 when its wait exceeds the deadline.
|
|
25
|
+
* Logs, metrics and spans name only the route template, never the query, body or response
|
|
26
|
+
*/
|
|
27
|
+
request<T = unknown>(
|
|
28
|
+
input: DefaultRestRequest,
|
|
29
|
+
): ResultAsync<RestResponse<T>, RestRequestFailure | CancelledError | ConfigurationError>
|
|
30
|
+
}
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
import type { Result } from "neverthrow"
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* Return the value of an Ok result, or throw the error of an Err result.
|
|
5
|
+
* Use it where a failure should end the surrounding function, such as a command handler whose thrown error is
|
|
6
|
+
* reported with the command name, or a startup script that should stop with the SDK's message and hint.
|
|
7
|
+
* The thrown value is the operation's own error, so its message, hint, code and cause remain available
|
|
8
|
+
*
|
|
9
|
+
* @remarks
|
|
10
|
+
* A ResultAsync, or any promise of a Result, returns a Promise that resolves with the value or rejects with the error.
|
|
11
|
+
* Keep checking isErr() where the application must recover from a particular failure instead
|
|
12
|
+
*
|
|
13
|
+
* @example
|
|
14
|
+
* ```ts
|
|
15
|
+
* import { orThrow, type Client } from "@neontechspace/fluxerly"
|
|
16
|
+
*
|
|
17
|
+
* export async function greet(client: Client, channelId: string) {
|
|
18
|
+
* const message = orThrow(await client.messages.send(channelId, { content: "Hello" }))
|
|
19
|
+
* return orThrow(client.messages.edit(message, { content: "Hello again" }))
|
|
20
|
+
* }
|
|
21
|
+
* ```
|
|
22
|
+
*
|
|
23
|
+
* @category Errors
|
|
24
|
+
*/
|
|
25
|
+
export function orThrow<T, E>(result: Result<T, E>): T
|
|
26
|
+
/**
|
|
27
|
+
* Wait for a ResultAsync, or any promise of a Result, and resolve with its value or reject with its error
|
|
28
|
+
*
|
|
29
|
+
* @category Errors
|
|
30
|
+
*/
|
|
31
|
+
export function orThrow<T, E>(result: PromiseLike<Result<T, E>>): Promise<T>
|
|
32
|
+
export function orThrow<T, E>(result: Result<T, E> | PromiseLike<Result<T, E>>): T | Promise<T> {
|
|
33
|
+
if (isPromiseLike(result)) return Promise.resolve(result).then(unwrap)
|
|
34
|
+
return unwrap(result)
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
function unwrap<T, E>(result: Result<T, E>): T {
|
|
38
|
+
if (result.isErr()) throw result.error
|
|
39
|
+
return result.value
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
function isPromiseLike<A>(value: A | PromiseLike<A>): value is PromiseLike<A> {
|
|
43
|
+
return typeof (value as { then?: unknown }).then === "function"
|
|
44
|
+
}
|
|
@@ -0,0 +1,154 @@
|
|
|
1
|
+
import type { ResultAsync } from "neverthrow"
|
|
2
|
+
import type {
|
|
3
|
+
GuildRole,
|
|
4
|
+
RoleReference,
|
|
5
|
+
RolePosition,
|
|
6
|
+
RoleHoistPosition,
|
|
7
|
+
RoleCreate,
|
|
8
|
+
RoleEdit,
|
|
9
|
+
GuildOperationFailure,
|
|
10
|
+
DefaultGuildOperationOptions,
|
|
11
|
+
DefaultGuildAuditOperationOptions,
|
|
12
|
+
} from "#sdk/guilds"
|
|
13
|
+
import type { CancelledError, ConfigurationError } from "#sdk/errors"
|
|
14
|
+
|
|
15
|
+
/**
|
|
16
|
+
* Create, edit, order and delete community roles, or read their current or cached data.
|
|
17
|
+
* Shared Guilds request limits, deadlines and read retries apply.
|
|
18
|
+
* Fluxer enforces permissions and hierarchy.
|
|
19
|
+
* No local permission prediction is performed
|
|
20
|
+
*
|
|
21
|
+
* Writes retry only confirmed HTTP 429 rejection.
|
|
22
|
+
* Abort waits for request cleanup but cannot undo a dispatched write
|
|
23
|
+
*
|
|
24
|
+
* Expected failures return GuildOperationError or ClientClosedError.
|
|
25
|
+
* Unexpected failures reject with SdkDefect.
|
|
26
|
+
* Inputs are copied when called.
|
|
27
|
+
* Results are snapshots, not gateway acknowledgement.
|
|
28
|
+
* Role permissions use bigint, which requires explicit conversion before JSON serialization.
|
|
29
|
+
* Every remote role mutation accepts DefaultGuildAuditOperationOptions. The fetchAll method rejects auditReason
|
|
30
|
+
*
|
|
31
|
+
* @category Roles and permissions
|
|
32
|
+
*/
|
|
33
|
+
export interface Roles {
|
|
34
|
+
/**
|
|
35
|
+
* Look up a role by decimal guildId and id in the enabled cache, including the everyone role.
|
|
36
|
+
* No request is made.
|
|
37
|
+
* The cache misses, stale-snapshot warnings, misuse and recency rules of guilds.get apply
|
|
38
|
+
*
|
|
39
|
+
* @remarks
|
|
40
|
+
* Returns the value synchronously.
|
|
41
|
+
* Unexpected failures throw SdkDefect
|
|
42
|
+
*/
|
|
43
|
+
get(role: RoleReference): GuildRole | undefined
|
|
44
|
+
/**
|
|
45
|
+
* Fetch the community's current role list, including everyone, in server order.
|
|
46
|
+
* This always reads remotely, without pagination or background refresh
|
|
47
|
+
*/
|
|
48
|
+
fetchAll(
|
|
49
|
+
guildId: string,
|
|
50
|
+
options?: DefaultGuildOperationOptions,
|
|
51
|
+
): ResultAsync<readonly GuildRole[], GuildOperationFailure | CancelledError | ConfigurationError>
|
|
52
|
+
/**
|
|
53
|
+
* Create a role with a name, optional color and permission flags.
|
|
54
|
+
* The permissions input defaults to 0n, rather than copying the everyone role's grants.
|
|
55
|
+
* Supplied permissions must be from 0n through 9_223_372_036_854_775_807n.
|
|
56
|
+
* Explicit permissions use Fluxer's feature opt-in for ViewChannelMembers.
|
|
57
|
+
* The result reports the actual server grants, which can differ from the request.
|
|
58
|
+
* Use a separate edit to change hoist or mentionable settings.
|
|
59
|
+
* The application manages the created role afterward.
|
|
60
|
+
* After an unknown outcome, use fetchAll before deciding whether to create again
|
|
61
|
+
*
|
|
62
|
+
* @example
|
|
63
|
+
* ```ts
|
|
64
|
+
* import { Permissions, type Client } from "@neontechspace/fluxerly"
|
|
65
|
+
* export async function createRoleExample(client: Client, guildId: string) {
|
|
66
|
+
* const result = await client.roles.create(guildId, {
|
|
67
|
+
* name: "Readers",
|
|
68
|
+
* permissions: Permissions.ViewChannel | Permissions.ReadMessageHistory,
|
|
69
|
+
* })
|
|
70
|
+
* if (result.isErr()) throw result.error
|
|
71
|
+
* return result.value
|
|
72
|
+
* }
|
|
73
|
+
* ```
|
|
74
|
+
*/
|
|
75
|
+
create(
|
|
76
|
+
guildId: string,
|
|
77
|
+
input: RoleCreate,
|
|
78
|
+
options?: DefaultGuildAuditOperationOptions,
|
|
79
|
+
): ResultAsync<GuildRole, GuildOperationFailure | CancelledError | ConfigurationError>
|
|
80
|
+
/**
|
|
81
|
+
* Change only supplied role fields and return the server's snapshot.
|
|
82
|
+
* Empty inputs and unknown fields fail locally.
|
|
83
|
+
* The permissions input replaces all raw grants rather than adding flags, and can set or clear ViewChannelMembers.
|
|
84
|
+
* The replacement must be from 0n through 9_223_372_036_854_775_807n, and larger received masks cannot be written unchanged.
|
|
85
|
+
* The everyone role accepts only color and permissions.
|
|
86
|
+
* Other supplied fields fail, even in a mixed input
|
|
87
|
+
*/
|
|
88
|
+
edit(
|
|
89
|
+
role: RoleReference,
|
|
90
|
+
input: RoleEdit,
|
|
91
|
+
options?: DefaultGuildAuditOperationOptions,
|
|
92
|
+
): ResultAsync<GuildRole, GuildOperationFailure | CancelledError | ConfigurationError>
|
|
93
|
+
/**
|
|
94
|
+
* Delete a role and remove its member assignments in Fluxer.
|
|
95
|
+
* The everyone role cannot be deleted.
|
|
96
|
+
* Fluxer removes the role from each member in separate writes before it deletes the role, and does not roll them back.
|
|
97
|
+
* A failure can leave the role in place after some members already lost it, so fetch the role and the affected members again before retrying.
|
|
98
|
+
* HTTP 204 succeeds with no value, without proving member-event delivery.
|
|
99
|
+
* Snapshots already returned to the caller remain unchanged
|
|
100
|
+
*/
|
|
101
|
+
delete(
|
|
102
|
+
role: RoleReference,
|
|
103
|
+
options?: DefaultGuildAuditOperationOptions,
|
|
104
|
+
): ResultAsync<void, GuildOperationFailure | CancelledError | ConfigurationError>
|
|
105
|
+
/**
|
|
106
|
+
* Change role hierarchy positions using distinct role IDs and nonnegative safe-integer positions.
|
|
107
|
+
* The everyone role cannot move.
|
|
108
|
+
* HTTP 204 succeeds with no value and no new role list.
|
|
109
|
+
* Fluxer normalizes manageable positions, so use fetchAll if final order matters.
|
|
110
|
+
* This is not a transaction.
|
|
111
|
+
* A failure can leave partial changes, requiring a fresh read before recovery
|
|
112
|
+
*/
|
|
113
|
+
reorder(
|
|
114
|
+
guildId: string,
|
|
115
|
+
positions: readonly RolePosition[],
|
|
116
|
+
options?: DefaultGuildAuditOperationOptions,
|
|
117
|
+
): ResultAsync<void, GuildOperationFailure | CancelledError | ConfigurationError>
|
|
118
|
+
/**
|
|
119
|
+
* Set roles' display positions without changing their permission hierarchy or enabling hoist.
|
|
120
|
+
* Pass a nonempty list of distinct role IDs with integer hoistPosition values from -2,147,483,648 through 2,147,483,647.
|
|
121
|
+
* The everyone role is excluded.
|
|
122
|
+
* Fluxer checks ManageRoles and hierarchy.
|
|
123
|
+
* HTTP 204 succeeds with no value, not a role list.
|
|
124
|
+
* Successful writes and writes with unknown outcomes invalidate cached guild roles and conflicting pending reads.
|
|
125
|
+
* Failure or cancellation can leave partial changes.
|
|
126
|
+
* Refetch before deciding to replay
|
|
127
|
+
*
|
|
128
|
+
* @example
|
|
129
|
+
* ```ts
|
|
130
|
+
* import { type Client } from "@neontechspace/fluxerly"
|
|
131
|
+
* export function orderRoleDisplay(client: Client, guildId: string, roleId: string) {
|
|
132
|
+
* return client.roles.setHoistPositions(guildId, [{ id: roleId, hoistPosition: 0 }])
|
|
133
|
+
* }
|
|
134
|
+
* ```
|
|
135
|
+
*/
|
|
136
|
+
setHoistPositions(
|
|
137
|
+
guildId: string,
|
|
138
|
+
positions: readonly RoleHoistPosition[],
|
|
139
|
+
options?: DefaultGuildAuditOperationOptions,
|
|
140
|
+
): ResultAsync<void, GuildOperationFailure | CancelledError | ConfigurationError>
|
|
141
|
+
/**
|
|
142
|
+
* Clear display-position assignments across the community, including roles above the bot.
|
|
143
|
+
* Fluxer requires ManageRoles.
|
|
144
|
+
* Permission hierarchy and hoist flags remain unchanged.
|
|
145
|
+
* HTTP 204 succeeds with no value, not a role list.
|
|
146
|
+
* Changes are not transactional and a failure can be partial.
|
|
147
|
+
* Successful writes and writes with unknown outcomes invalidate cached guild roles.
|
|
148
|
+
* Refetch to resolve an unknown outcome
|
|
149
|
+
*/
|
|
150
|
+
resetHoistPositions(
|
|
151
|
+
guildId: string,
|
|
152
|
+
options?: DefaultGuildAuditOperationOptions,
|
|
153
|
+
): ResultAsync<void, GuildOperationFailure | CancelledError | ConfigurationError>
|
|
154
|
+
}
|