yuzuha 0.2.0 → 0.3.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +29 -1
- package/README.md +22 -14
- package/VERSIONING.md +56 -7
- package/benchmarks/parser.mjs +1 -1
- package/benchmarks/run.mjs +3 -2
- package/dist/canvas/card.d.ts +10 -0
- package/dist/canvas/card.d.ts.map +1 -0
- package/dist/canvas/card.js +11 -0
- package/dist/canvas/card.js.map +1 -0
- package/dist/canvas.d.ts +30 -9
- package/dist/canvas.d.ts.map +1 -1
- package/dist/canvas.js +64 -9
- package/dist/canvas.js.map +1 -1
- package/dist/cli/config.d.ts.map +1 -1
- package/dist/cli/config.js +2 -1
- package/dist/cli/config.js.map +1 -1
- package/dist/cli/lint.d.ts.map +1 -1
- package/dist/cli/lint.js +1 -2
- package/dist/cli/lint.js.map +1 -1
- package/dist/cli/main.d.ts.map +1 -1
- package/dist/cli/main.js +8 -9
- package/dist/cli/main.js.map +1 -1
- package/dist/cli/scaffold.js +1 -1
- package/dist/cli/scaffold.js.map +1 -1
- package/dist/cli/scenarios.d.ts.map +1 -1
- package/dist/cli/scenarios.js +2 -1
- package/dist/cli/scenarios.js.map +1 -1
- package/dist/commands/context.d.ts.map +1 -1
- package/dist/commands/context.js +7 -2
- package/dist/commands/context.js.map +1 -1
- package/dist/domain/resource-batches.d.ts +6 -0
- package/dist/domain/resource-batches.d.ts.map +1 -1
- package/dist/domain/resource-batches.js +31 -0
- package/dist/domain/resource-batches.js.map +1 -1
- package/dist/framework/bot.d.ts +9 -5
- package/dist/framework/bot.d.ts.map +1 -1
- package/dist/framework/bot.js +51 -27
- package/dist/framework/bot.js.map +1 -1
- package/dist/framework/command-registry.d.ts +8 -7
- package/dist/framework/command-registry.d.ts.map +1 -1
- package/dist/framework/command-registry.js +14 -11
- package/dist/framework/command-registry.js.map +1 -1
- package/dist/framework/options.d.ts +3 -3
- package/dist/framework/options.d.ts.map +1 -1
- package/dist/framework/options.js.map +1 -1
- package/dist/{scripting → functions}/builtins/arguments.d.ts.map +1 -1
- package/dist/{scripting → functions}/builtins/arguments.js.map +1 -1
- package/dist/functions/builtins/canvas.d.ts +2 -0
- package/dist/functions/builtins/canvas.d.ts.map +1 -0
- package/dist/{scripting → functions}/builtins/canvas.js +1 -1
- package/dist/{scripting → functions}/builtins/canvas.js.map +1 -1
- package/dist/functions/builtins/context.d.ts +2 -0
- package/dist/functions/builtins/context.d.ts.map +1 -0
- package/dist/{scripting → functions}/builtins/context.js.map +1 -1
- package/dist/{scripting → functions}/builtins/definition.d.ts +1 -1
- package/dist/functions/builtins/definition.d.ts.map +1 -0
- package/dist/functions/builtins/definition.js.map +1 -0
- package/dist/functions/builtins/embeds.d.ts +3 -0
- package/dist/{scripting → functions}/builtins/embeds.d.ts.map +1 -1
- package/dist/{scripting → functions}/builtins/embeds.js +1 -1
- package/dist/functions/builtins/embeds.js.map +1 -0
- package/dist/functions/builtins/events.d.ts +2 -0
- package/dist/functions/builtins/events.d.ts.map +1 -0
- package/dist/{scripting → functions}/builtins/events.js.map +1 -1
- package/dist/functions/builtins/flow.d.ts +2 -0
- package/dist/functions/builtins/flow.d.ts.map +1 -0
- package/dist/{scripting → functions}/builtins/flow.js +2 -2
- package/dist/functions/builtins/flow.js.map +1 -0
- package/dist/functions/builtins/guards.d.ts +2 -0
- package/dist/functions/builtins/guards.d.ts.map +1 -0
- package/dist/{scripting → functions}/builtins/guards.js +1 -1
- package/dist/functions/builtins/guards.js.map +1 -0
- package/dist/functions/builtins/http.d.ts +2 -0
- package/dist/functions/builtins/http.d.ts.map +1 -0
- package/dist/{scripting → functions}/builtins/http.js +2 -2
- package/dist/functions/builtins/http.js.map +1 -0
- package/dist/functions/builtins/index.d.ts +5 -0
- package/dist/functions/builtins/index.d.ts.map +1 -0
- package/dist/functions/builtins/index.js.map +1 -0
- package/dist/functions/builtins/language/array-callbacks.d.ts +2 -0
- package/dist/functions/builtins/language/array-callbacks.d.ts.map +1 -0
- package/dist/{scripting → functions}/builtins/language/array-callbacks.js +1 -1
- package/dist/{scripting → functions}/builtins/language/array-callbacks.js.map +1 -1
- package/dist/functions/builtins/language/arrays.d.ts +2 -0
- package/dist/functions/builtins/language/arrays.d.ts.map +1 -0
- package/dist/{scripting → functions}/builtins/language/arrays.js +1 -1
- package/dist/{scripting → functions}/builtins/language/arrays.js.map +1 -1
- package/dist/{scripting → functions}/builtins/language/common.d.ts.map +1 -1
- package/dist/{scripting → functions}/builtins/language/common.js.map +1 -1
- package/dist/functions/builtins/language/decimals.d.ts +2 -0
- package/dist/functions/builtins/language/decimals.d.ts.map +1 -0
- package/dist/{scripting → functions}/builtins/language/decimals.js.map +1 -1
- package/dist/functions/builtins/language/index.d.ts +3 -0
- package/dist/functions/builtins/language/index.d.ts.map +1 -0
- package/dist/functions/builtins/language/index.js.map +1 -0
- package/dist/functions/builtins/language/loops.d.ts +4 -0
- package/dist/{scripting → functions}/builtins/language/loops.d.ts.map +1 -1
- package/dist/{scripting → functions}/builtins/language/loops.js +3 -3
- package/dist/{scripting → functions}/builtins/language/loops.js.map +1 -1
- package/dist/functions/builtins/language/numbers.d.ts +2 -0
- package/dist/functions/builtins/language/numbers.d.ts.map +1 -0
- package/dist/{scripting → functions}/builtins/language/numbers.js.map +1 -1
- package/dist/{scripting → functions}/builtins/language/objects.d.ts +1 -1
- package/dist/{scripting → functions}/builtins/language/objects.d.ts.map +1 -1
- package/dist/{scripting → functions}/builtins/language/objects.js.map +1 -1
- package/dist/functions/builtins/language/regex.d.ts +2 -0
- package/dist/functions/builtins/language/regex.d.ts.map +1 -0
- package/dist/{scripting → functions}/builtins/language/regex.js +1 -1
- package/dist/{scripting → functions}/builtins/language/regex.js.map +1 -1
- package/dist/functions/builtins/language/sort.d.ts +2 -0
- package/dist/functions/builtins/language/sort.d.ts.map +1 -0
- package/dist/{scripting → functions}/builtins/language/sort.js.map +1 -1
- package/dist/{scripting → functions}/builtins/language/state.d.ts +1 -1
- package/dist/{scripting → functions}/builtins/language/state.d.ts.map +1 -1
- package/dist/{scripting → functions}/builtins/language/state.js.map +1 -1
- package/dist/functions/builtins/language/texts.d.ts +2 -0
- package/dist/functions/builtins/language/texts.d.ts.map +1 -0
- package/dist/{scripting → functions}/builtins/language/texts.js.map +1 -1
- package/dist/functions/builtins/messages.d.ts +2 -0
- package/dist/functions/builtins/messages.d.ts.map +1 -0
- package/dist/{scripting → functions}/builtins/messages.js.map +1 -1
- package/dist/functions/builtins/moderation.d.ts +2 -0
- package/dist/functions/builtins/moderation.d.ts.map +1 -0
- package/dist/{scripting → functions}/builtins/moderation.js.map +1 -1
- package/dist/functions/builtins/native-channels.d.ts +2 -0
- package/dist/functions/builtins/native-channels.d.ts.map +1 -0
- package/dist/{scripting → functions}/builtins/native-channels.js.map +1 -1
- package/dist/functions/builtins/native-collectors.d.ts +2 -0
- package/dist/functions/builtins/native-collectors.d.ts.map +1 -0
- package/dist/{scripting → functions}/builtins/native-collectors.js.map +1 -1
- package/dist/functions/builtins/native-expressions.d.ts +2 -0
- package/dist/functions/builtins/native-expressions.d.ts.map +1 -0
- package/dist/{scripting → functions}/builtins/native-expressions.js.map +1 -1
- package/dist/functions/builtins/native-invites.d.ts +2 -0
- package/dist/functions/builtins/native-invites.d.ts.map +1 -0
- package/dist/{scripting → functions}/builtins/native-invites.js.map +1 -1
- package/dist/functions/builtins/native-messages.d.ts +2 -0
- package/dist/functions/builtins/native-messages.d.ts.map +1 -0
- package/dist/{scripting → functions}/builtins/native-messages.js.map +1 -1
- package/dist/functions/builtins/native-roles.d.ts +2 -0
- package/dist/functions/builtins/native-roles.d.ts.map +1 -0
- package/dist/{scripting → functions}/builtins/native-roles.js.map +1 -1
- package/dist/functions/builtins/native-threads.d.ts +2 -0
- package/dist/functions/builtins/native-threads.d.ts.map +1 -0
- package/dist/{scripting → functions}/builtins/native-threads.js.map +1 -1
- package/dist/functions/builtins/native-users.d.ts +2 -0
- package/dist/functions/builtins/native-users.d.ts.map +1 -0
- package/dist/{scripting → functions}/builtins/native-users.js.map +1 -1
- package/dist/functions/builtins/native-webhooks.d.ts +2 -0
- package/dist/functions/builtins/native-webhooks.d.ts.map +1 -0
- package/dist/{scripting → functions}/builtins/native-webhooks.js.map +1 -1
- package/dist/{scripting → functions}/builtins/payload.d.ts +2 -2
- package/dist/functions/builtins/payload.d.ts.map +1 -0
- package/dist/{scripting → functions}/builtins/payload.js +1 -1
- package/dist/functions/builtins/payload.js.map +1 -0
- package/dist/functions/builtins/resource-extras.d.ts +2 -0
- package/dist/functions/builtins/resource-extras.d.ts.map +1 -0
- package/dist/{scripting → functions}/builtins/resource-extras.js.map +1 -1
- package/dist/functions/builtins/schedule.d.ts +2 -0
- package/dist/functions/builtins/schedule.d.ts.map +1 -0
- package/dist/{scripting → functions}/builtins/schedule.js.map +1 -1
- package/dist/functions/builtins/storage.d.ts +2 -0
- package/dist/functions/builtins/storage.d.ts.map +1 -0
- package/dist/{scripting → functions}/builtins/storage.js.map +1 -1
- package/dist/functions/builtins/values.d.ts +2 -0
- package/dist/functions/builtins/values.d.ts.map +1 -0
- package/dist/{scripting → functions}/builtins/values.js +1 -1
- package/dist/functions/builtins/values.js.map +1 -0
- package/dist/functions/runtime/ast.d.ts.map +1 -0
- package/dist/functions/runtime/ast.js.map +1 -0
- package/dist/{scripting → functions/runtime}/canvas-execution.d.ts +1 -1
- package/dist/functions/runtime/canvas-execution.d.ts.map +1 -0
- package/dist/functions/runtime/canvas-execution.js.map +1 -0
- package/dist/functions/runtime/control-flow.d.ts.map +1 -0
- package/dist/functions/runtime/control-flow.js.map +1 -0
- package/dist/{scripting → functions/runtime}/evaluator.d.ts +1 -1
- package/dist/functions/runtime/evaluator.d.ts.map +1 -0
- package/dist/{scripting → functions/runtime}/evaluator.js +1 -1
- package/dist/functions/runtime/evaluator.js.map +1 -0
- package/dist/functions/runtime/limits.d.ts.map +1 -0
- package/dist/{scripting → functions/runtime}/limits.js +1 -1
- package/dist/functions/runtime/limits.js.map +1 -0
- package/dist/functions/runtime/parser.d.ts.map +1 -0
- package/dist/{scripting → functions/runtime}/parser.js +1 -1
- package/dist/functions/runtime/parser.js.map +1 -0
- package/dist/functions/runtime/regex.d.ts.map +1 -0
- package/dist/{scripting → functions/runtime}/regex.js +1 -1
- package/dist/functions/runtime/regex.js.map +1 -0
- package/dist/functions/runtime/registry.d.ts.map +1 -0
- package/dist/{scripting → functions/runtime}/registry.js +1 -1
- package/dist/functions/runtime/registry.js.map +1 -0
- package/dist/{scripting → functions/runtime}/runtime.d.ts +3 -1
- package/dist/functions/runtime/runtime.d.ts.map +1 -0
- package/dist/{scripting → functions/runtime}/runtime.js +3 -0
- package/dist/functions/runtime/runtime.js.map +1 -0
- package/dist/{scripting → functions/runtime}/types.d.ts +1 -1
- package/dist/functions/runtime/types.d.ts.map +1 -0
- package/dist/functions/runtime/types.js.map +1 -0
- package/dist/functions/runtime/values.d.ts.map +1 -0
- package/dist/functions/runtime/values.js.map +1 -0
- package/dist/functions.d.ts +19 -8
- package/dist/functions.d.ts.map +1 -1
- package/dist/functions.js +18 -6
- package/dist/functions.js.map +1 -1
- package/dist/index.d.ts +7 -2
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js.map +1 -1
- package/dist/infrastructure/canvas/napi.d.ts +4 -0
- package/dist/infrastructure/canvas/napi.d.ts.map +1 -0
- package/dist/infrastructure/canvas/napi.js +17 -0
- package/dist/infrastructure/canvas/napi.js.map +1 -0
- package/dist/infrastructure/fluxer/resources/cache.d.ts +4 -0
- package/dist/infrastructure/fluxer/resources/cache.d.ts.map +1 -0
- package/dist/infrastructure/fluxer/resources/cache.js +68 -0
- package/dist/infrastructure/fluxer/resources/cache.js.map +1 -0
- package/dist/infrastructure/fluxer/resources/channels.d.ts +3 -2
- package/dist/infrastructure/fluxer/resources/channels.d.ts.map +1 -1
- package/dist/infrastructure/fluxer/resources/channels.js +54 -2
- package/dist/infrastructure/fluxer/resources/channels.js.map +1 -1
- package/dist/infrastructure/fluxer/resources/collectors.d.ts.map +1 -1
- package/dist/infrastructure/fluxer/resources/collectors.js +86 -4
- package/dist/infrastructure/fluxer/resources/collectors.js.map +1 -1
- package/dist/infrastructure/fluxer/resources/expressions.d.ts.map +1 -1
- package/dist/infrastructure/fluxer/resources/expressions.js +8 -1
- package/dist/infrastructure/fluxer/resources/expressions.js.map +1 -1
- package/dist/infrastructure/fluxer/resources/gateway.d.ts +4 -0
- package/dist/infrastructure/fluxer/resources/gateway.d.ts.map +1 -0
- package/dist/infrastructure/fluxer/resources/gateway.js +31 -0
- package/dist/infrastructure/fluxer/resources/gateway.js.map +1 -0
- package/dist/infrastructure/fluxer/resources/instance.d.ts +4 -0
- package/dist/infrastructure/fluxer/resources/instance.d.ts.map +1 -0
- package/dist/infrastructure/fluxer/resources/instance.js +96 -0
- package/dist/infrastructure/fluxer/resources/instance.js.map +1 -0
- package/dist/infrastructure/fluxer/resources/messages.d.ts +3 -1
- package/dist/infrastructure/fluxer/resources/messages.d.ts.map +1 -1
- package/dist/infrastructure/fluxer/resources/messages.js +91 -36
- package/dist/infrastructure/fluxer/resources/messages.js.map +1 -1
- package/dist/infrastructure/fluxer/resources/roles.d.ts.map +1 -1
- package/dist/infrastructure/fluxer/resources/roles.js +8 -0
- package/dist/infrastructure/fluxer/resources/roles.js.map +1 -1
- package/dist/infrastructure/fluxer/resources/self.d.ts +4 -0
- package/dist/infrastructure/fluxer/resources/self.d.ts.map +1 -0
- package/dist/infrastructure/fluxer/resources/self.js +36 -0
- package/dist/infrastructure/fluxer/resources/self.js.map +1 -0
- package/dist/infrastructure/fluxer/resources/threads.d.ts.map +1 -1
- package/dist/infrastructure/fluxer/resources/threads.js +15 -0
- package/dist/infrastructure/fluxer/resources/threads.js.map +1 -1
- package/dist/infrastructure/fluxer/resources/users.d.ts +5 -2
- package/dist/infrastructure/fluxer/resources/users.d.ts.map +1 -1
- package/dist/infrastructure/fluxer/resources/users.js +36 -3
- package/dist/infrastructure/fluxer/resources/users.js.map +1 -1
- package/dist/infrastructure/fluxer/resources/webhooks.d.ts.map +1 -1
- package/dist/infrastructure/fluxer/resources/webhooks.js +9 -0
- package/dist/infrastructure/fluxer/resources/webhooks.js.map +1 -1
- package/dist/infrastructure/fluxer/resources.d.ts +4 -0
- package/dist/infrastructure/fluxer/resources.d.ts.map +1 -1
- package/dist/infrastructure/fluxer/resources.js +12 -0
- package/dist/infrastructure/fluxer/resources.js.map +1 -1
- package/dist/ports/resources/cache.d.ts +74 -0
- package/dist/ports/resources/cache.d.ts.map +1 -0
- package/dist/ports/resources/cache.js +2 -0
- package/dist/ports/resources/cache.js.map +1 -0
- package/dist/ports/resources/channels.d.ts +17 -0
- package/dist/ports/resources/channels.d.ts.map +1 -1
- package/dist/ports/resources/channels.js.map +1 -1
- package/dist/ports/resources/collectors.d.ts +18 -0
- package/dist/ports/resources/collectors.d.ts.map +1 -1
- package/dist/ports/resources/collectors.js.map +1 -1
- package/dist/ports/resources/common.d.ts +2 -0
- package/dist/ports/resources/common.d.ts.map +1 -1
- package/dist/ports/resources/common.js.map +1 -1
- package/dist/ports/resources/expressions.d.ts +8 -0
- package/dist/ports/resources/expressions.d.ts.map +1 -1
- package/dist/ports/resources/expressions.js.map +1 -1
- package/dist/ports/resources/gateway.d.ts +48 -0
- package/dist/ports/resources/gateway.d.ts.map +1 -0
- package/dist/ports/resources/gateway.js +2 -0
- package/dist/ports/resources/gateway.js.map +1 -0
- package/dist/ports/resources/instance.d.ts +101 -0
- package/dist/ports/resources/instance.d.ts.map +1 -0
- package/dist/ports/resources/instance.js +2 -0
- package/dist/ports/resources/instance.js.map +1 -0
- package/dist/ports/resources/messages.d.ts +27 -0
- package/dist/ports/resources/messages.d.ts.map +1 -1
- package/dist/ports/resources/messages.js.map +1 -1
- package/dist/ports/resources/roles.d.ts +6 -0
- package/dist/ports/resources/roles.d.ts.map +1 -1
- package/dist/ports/resources/roles.js.map +1 -1
- package/dist/ports/resources/self.d.ts +30 -0
- package/dist/ports/resources/self.d.ts.map +1 -0
- package/dist/ports/resources/self.js +2 -0
- package/dist/ports/resources/self.js.map +1 -0
- package/dist/ports/resources/threads.d.ts +16 -0
- package/dist/ports/resources/threads.d.ts.map +1 -1
- package/dist/ports/resources/threads.js.map +1 -1
- package/dist/ports/resources/users.d.ts +30 -0
- package/dist/ports/resources/users.d.ts.map +1 -1
- package/dist/ports/resources/users.js.map +1 -1
- package/dist/ports/resources/webhooks.d.ts +5 -0
- package/dist/ports/resources/webhooks.d.ts.map +1 -1
- package/dist/ports/resources/webhooks.js.map +1 -1
- package/dist/ports/resources.d.ts +8 -0
- package/dist/ports/resources.d.ts.map +1 -1
- package/dist/ports/resources.js.map +1 -1
- package/dist/ports/script-engine.d.ts +45 -0
- package/dist/ports/script-engine.d.ts.map +1 -0
- package/dist/ports/script-engine.js +2 -0
- package/dist/ports/script-engine.js.map +1 -0
- package/dist/sdk/builders.d.ts +2 -0
- package/dist/sdk/builders.d.ts.map +1 -0
- package/dist/sdk/builders.js +2 -0
- package/dist/sdk/builders.js.map +1 -0
- package/dist/sdk/client.d.ts +2 -0
- package/dist/sdk/client.d.ts.map +1 -0
- package/dist/sdk/client.js +2 -0
- package/dist/sdk/client.js.map +1 -0
- package/dist/sdk/cluster.d.ts +2 -0
- package/dist/sdk/cluster.d.ts.map +1 -0
- package/dist/sdk/cluster.js +2 -0
- package/dist/sdk/cluster.js.map +1 -0
- package/dist/sdk/collection.d.ts +2 -0
- package/dist/sdk/collection.d.ts.map +1 -0
- package/dist/sdk/collection.js +2 -0
- package/dist/sdk/collection.js.map +1 -0
- package/dist/sdk/errors.d.ts +2 -0
- package/dist/sdk/errors.d.ts.map +1 -0
- package/dist/sdk/errors.js +2 -0
- package/dist/sdk/errors.js.map +1 -0
- package/dist/sdk/internal.d.ts +2 -0
- package/dist/sdk/internal.d.ts.map +1 -0
- package/dist/sdk/internal.js +2 -0
- package/dist/sdk/internal.js.map +1 -0
- package/dist/sdk/message.d.ts +2 -0
- package/dist/sdk/message.d.ts.map +1 -0
- package/dist/sdk/message.js +2 -0
- package/dist/sdk/message.js.map +1 -0
- package/dist/sdk/rest/request-manager.d.ts +2 -0
- package/dist/sdk/rest/request-manager.d.ts.map +1 -0
- package/dist/sdk/rest/request-manager.js +2 -0
- package/dist/sdk/rest/request-manager.js.map +1 -0
- package/dist/sdk/rest.d.ts +2 -0
- package/dist/sdk/rest.d.ts.map +1 -0
- package/dist/sdk/rest.js +2 -0
- package/dist/sdk/rest.js.map +1 -0
- package/dist/sdk/sharding.d.ts +2 -0
- package/dist/sdk/sharding.d.ts.map +1 -0
- package/dist/sdk/sharding.js +2 -0
- package/dist/sdk/sharding.js.map +1 -0
- package/dist/sdk/types/routes.d.ts +2 -0
- package/dist/sdk/types/routes.d.ts.map +1 -0
- package/dist/sdk/types/routes.js +2 -0
- package/dist/sdk/types/routes.js.map +1 -0
- package/dist/sdk/types.d.ts +2 -0
- package/dist/sdk/types.d.ts.map +1 -0
- package/dist/sdk/types.js +2 -0
- package/dist/sdk/types.js.map +1 -0
- package/dist/sdk/util.d.ts +2 -0
- package/dist/sdk/util.d.ts.map +1 -0
- package/dist/sdk/util.js +2 -0
- package/dist/sdk/util.js.map +1 -0
- package/dist/sdk/voice.d.ts +2 -0
- package/dist/sdk/voice.d.ts.map +1 -0
- package/dist/sdk/voice.js +2 -0
- package/dist/sdk/voice.js.map +1 -0
- package/dist/sdk/ws.d.ts +2 -0
- package/dist/sdk/ws.d.ts.map +1 -0
- package/dist/sdk/ws.js +2 -0
- package/dist/sdk/ws.js.map +1 -0
- package/dist/services/canvas-image.d.ts +12 -0
- package/dist/services/canvas-image.d.ts.map +1 -0
- package/dist/services/canvas-image.js +56 -0
- package/dist/services/canvas-image.js.map +1 -0
- package/dist/services/canvas.d.ts +12 -2
- package/dist/services/canvas.d.ts.map +1 -1
- package/dist/services/canvas.js +91 -5
- package/dist/services/canvas.js.map +1 -1
- package/dist/services/moderation.d.ts +1 -0
- package/dist/services/moderation.d.ts.map +1 -1
- package/dist/services/moderation.js +11 -0
- package/dist/services/moderation.js.map +1 -1
- package/dist/services/native-moderation.d.ts +6 -1
- package/dist/services/native-moderation.d.ts.map +1 -1
- package/dist/services/native-moderation.js +11 -1
- package/dist/services/native-moderation.js.map +1 -1
- package/dist/services/resource-authorization.d.ts.map +1 -1
- package/dist/services/resource-authorization.js +95 -3
- package/dist/services/resource-authorization.js.map +1 -1
- package/dist/testing.d.ts.map +1 -1
- package/dist/testing.js +4 -0
- package/dist/testing.js.map +1 -1
- package/docs/API.md +8 -7
- package/docs/ARCHITECTURE.md +14 -9
- package/docs/BENCHMARKS.md +1 -1
- package/docs/CANVAS.md +70 -15
- package/docs/EDITOR.md +1 -1
- package/docs/FRAMEWORK.md +2 -3
- package/docs/HTTP.md +1 -1
- package/docs/IMAGES.md +2 -1
- package/docs/NATIVE.md +45 -14
- package/docs/PARITY-MATRIX.md +853 -843
- package/docs/PARITY.md +24 -12
- package/docs/PLAN.md +14 -3
- package/docs/QUICKSTART.md +5 -5
- package/docs/README.md +7 -7
- package/docs/REPOSITORY.md +1 -1
- package/docs/SCHEDULER.md +1 -1
- package/docs/TROUBLESHOOTING.md +1 -1
- package/docs/VALIDATION.md +5 -5
- package/docs/{FUNCTION-GAPS.md → functions/FUNCTION-GAPS.md} +18 -13
- package/docs/{LANGUAGE.md → functions/LANGUAGE.md} +7 -7
- package/docs/functions/README.md +33 -0
- package/docs/tutorials/DATA.md +2 -2
- package/docs/tutorials/FUNCTION-MODE.md +2 -2
- package/examples/canvas/napi-style.ts +24 -0
- package/examples/canvas/output/napi-style.png +0 -0
- package/examples/canvas/profile.d.mts +1 -1
- package/examples/canvas/profile.mjs +2 -2
- package/examples/canvas/profile.ts +3 -3
- package/examples/canvas/ranking.d.mts +1 -1
- package/examples/canvas/ranking.mjs +2 -2
- package/examples/canvas/ranking.ts +3 -3
- package/examples/canvas/render.ts +2 -1
- package/examples/canvas/welcome.d.mts +1 -1
- package/examples/canvas/welcome.mjs +2 -2
- package/examples/canvas/welcome.ts +3 -3
- package/examples/embeds/complete-embed-functions.ts +2 -2
- package/examples/function-mode.ts +3 -3
- package/examples/yuzuha.config.js +2 -0
- package/package.json +26 -1
- package/src/canvas/card.ts +20 -0
- package/src/canvas.ts +69 -17
- package/src/cli/config.ts +2 -1
- package/src/cli/lint.ts +1 -2
- package/src/cli/main.ts +8 -9
- package/src/cli/scaffold.ts +1 -1
- package/src/cli/scenarios.ts +2 -1
- package/src/commands/context.ts +9 -2
- package/src/domain/resource-batches.ts +31 -0
- package/src/framework/bot.ts +44 -27
- package/src/framework/command-registry.ts +15 -10
- package/src/framework/options.ts +3 -3
- package/src/{scripting → functions}/builtins/canvas.ts +2 -2
- package/src/{scripting → functions}/builtins/context.ts +1 -1
- package/src/{scripting → functions}/builtins/definition.ts +1 -1
- package/src/{scripting → functions}/builtins/embeds.ts +1 -1
- package/src/{scripting → functions}/builtins/flow.ts +2 -2
- package/src/{scripting → functions}/builtins/guards.ts +1 -1
- package/src/{scripting → functions}/builtins/http.ts +2 -2
- package/src/{scripting → functions}/builtins/index.ts +2 -2
- package/src/{scripting → functions}/builtins/language/array-callbacks.ts +2 -2
- package/src/{scripting → functions}/builtins/language/arrays.ts +1 -1
- package/src/{scripting → functions}/builtins/language/index.ts +1 -1
- package/src/{scripting → functions}/builtins/language/loops.ts +4 -4
- package/src/{scripting → functions}/builtins/language/regex.ts +1 -1
- package/src/{scripting → functions}/builtins/moderation.ts +1 -1
- package/src/{scripting → functions}/builtins/native-channels.ts +1 -1
- package/src/{scripting → functions}/builtins/native-roles.ts +1 -1
- package/src/{scripting → functions}/builtins/native-users.ts +1 -1
- package/src/{scripting → functions}/builtins/payload.ts +2 -2
- package/src/{scripting → functions}/builtins/resource-extras.ts +1 -1
- package/src/{scripting → functions}/builtins/values.ts +1 -1
- package/src/{scripting → functions/runtime}/canvas-execution.ts +1 -1
- package/src/{scripting → functions/runtime}/evaluator.ts +2 -2
- package/src/{scripting → functions/runtime}/limits.ts +1 -1
- package/src/{scripting → functions/runtime}/parser.ts +1 -1
- package/src/{scripting → functions/runtime}/regex.ts +1 -1
- package/src/{scripting → functions/runtime}/registry.ts +1 -1
- package/src/{scripting → functions/runtime}/runtime.ts +6 -1
- package/src/{scripting → functions/runtime}/types.ts +1 -1
- package/src/functions.ts +28 -8
- package/src/index.ts +9 -2
- package/src/infrastructure/canvas/napi.ts +17 -0
- package/src/infrastructure/fluxer/resources/cache.ts +69 -0
- package/src/infrastructure/fluxer/resources/channels.ts +51 -3
- package/src/infrastructure/fluxer/resources/collectors.ts +87 -4
- package/src/infrastructure/fluxer/resources/expressions.ts +7 -1
- package/src/infrastructure/fluxer/resources/gateway.ts +33 -0
- package/src/infrastructure/fluxer/resources/instance.ts +105 -0
- package/src/infrastructure/fluxer/resources/messages.ts +84 -36
- package/src/infrastructure/fluxer/resources/roles.ts +8 -0
- package/src/infrastructure/fluxer/resources/self.ts +39 -0
- package/src/infrastructure/fluxer/resources/threads.ts +14 -0
- package/src/infrastructure/fluxer/resources/users.ts +40 -4
- package/src/infrastructure/fluxer/resources/webhooks.ts +9 -0
- package/src/infrastructure/fluxer/resources.ts +12 -0
- package/src/ports/resources/cache.ts +81 -0
- package/src/ports/resources/channels.ts +12 -0
- package/src/ports/resources/collectors.ts +20 -0
- package/src/ports/resources/common.ts +2 -0
- package/src/ports/resources/expressions.ts +6 -0
- package/src/ports/resources/gateway.ts +49 -0
- package/src/ports/resources/instance.ts +109 -0
- package/src/ports/resources/messages.ts +30 -0
- package/src/ports/resources/roles.ts +3 -0
- package/src/ports/resources/self.ts +30 -0
- package/src/ports/resources/threads.ts +15 -0
- package/src/ports/resources/users.ts +33 -0
- package/src/ports/resources/webhooks.ts +6 -0
- package/src/ports/resources.ts +8 -0
- package/src/ports/script-engine.ts +42 -0
- package/src/sdk/builders.ts +1 -0
- package/src/sdk/client.ts +1 -0
- package/src/sdk/cluster.ts +1 -0
- package/src/sdk/collection.ts +1 -0
- package/src/sdk/errors.ts +1 -0
- package/src/sdk/internal.ts +1 -0
- package/src/sdk/message.ts +1 -0
- package/src/sdk/rest/request-manager.ts +1 -0
- package/src/sdk/rest.ts +1 -0
- package/src/sdk/sharding.ts +1 -0
- package/src/sdk/types/routes.ts +1 -0
- package/src/sdk/types.ts +1 -0
- package/src/sdk/util.ts +1 -0
- package/src/sdk/voice.ts +1 -0
- package/src/sdk/ws.ts +1 -0
- package/src/services/canvas-image.ts +54 -0
- package/src/services/canvas.ts +89 -6
- package/src/services/moderation.ts +4 -0
- package/src/services/native-moderation.ts +11 -1
- package/src/services/resource-authorization.ts +89 -3
- package/src/testing.ts +4 -0
- package/dist/parser.d.ts +0 -3
- package/dist/parser.d.ts.map +0 -1
- package/dist/parser.js +0 -2
- package/dist/parser.js.map +0 -1
- package/dist/runtime.d.ts +0 -5
- package/dist/runtime.d.ts.map +0 -1
- package/dist/runtime.js +0 -4
- package/dist/runtime.js.map +0 -1
- package/dist/scripting/ast.d.ts.map +0 -1
- package/dist/scripting/ast.js.map +0 -1
- package/dist/scripting/builtins/canvas.d.ts +0 -2
- package/dist/scripting/builtins/canvas.d.ts.map +0 -1
- package/dist/scripting/builtins/context.d.ts +0 -2
- package/dist/scripting/builtins/context.d.ts.map +0 -1
- package/dist/scripting/builtins/definition.d.ts.map +0 -1
- package/dist/scripting/builtins/definition.js.map +0 -1
- package/dist/scripting/builtins/embeds.d.ts +0 -3
- package/dist/scripting/builtins/embeds.js.map +0 -1
- package/dist/scripting/builtins/events.d.ts +0 -2
- package/dist/scripting/builtins/events.d.ts.map +0 -1
- package/dist/scripting/builtins/flow.d.ts +0 -2
- package/dist/scripting/builtins/flow.d.ts.map +0 -1
- package/dist/scripting/builtins/flow.js.map +0 -1
- package/dist/scripting/builtins/guards.d.ts +0 -2
- package/dist/scripting/builtins/guards.d.ts.map +0 -1
- package/dist/scripting/builtins/guards.js.map +0 -1
- package/dist/scripting/builtins/http.d.ts +0 -2
- package/dist/scripting/builtins/http.d.ts.map +0 -1
- package/dist/scripting/builtins/http.js.map +0 -1
- package/dist/scripting/builtins/index.d.ts +0 -5
- package/dist/scripting/builtins/index.d.ts.map +0 -1
- package/dist/scripting/builtins/index.js.map +0 -1
- package/dist/scripting/builtins/language/array-callbacks.d.ts +0 -2
- package/dist/scripting/builtins/language/array-callbacks.d.ts.map +0 -1
- package/dist/scripting/builtins/language/arrays.d.ts +0 -2
- package/dist/scripting/builtins/language/arrays.d.ts.map +0 -1
- package/dist/scripting/builtins/language/decimals.d.ts +0 -2
- package/dist/scripting/builtins/language/decimals.d.ts.map +0 -1
- package/dist/scripting/builtins/language/index.d.ts +0 -3
- package/dist/scripting/builtins/language/index.d.ts.map +0 -1
- package/dist/scripting/builtins/language/index.js.map +0 -1
- package/dist/scripting/builtins/language/loops.d.ts +0 -4
- package/dist/scripting/builtins/language/numbers.d.ts +0 -2
- package/dist/scripting/builtins/language/numbers.d.ts.map +0 -1
- package/dist/scripting/builtins/language/regex.d.ts +0 -2
- package/dist/scripting/builtins/language/regex.d.ts.map +0 -1
- package/dist/scripting/builtins/language/sort.d.ts +0 -2
- package/dist/scripting/builtins/language/sort.d.ts.map +0 -1
- package/dist/scripting/builtins/language/texts.d.ts +0 -2
- package/dist/scripting/builtins/language/texts.d.ts.map +0 -1
- package/dist/scripting/builtins/messages.d.ts +0 -2
- package/dist/scripting/builtins/messages.d.ts.map +0 -1
- package/dist/scripting/builtins/moderation.d.ts +0 -2
- package/dist/scripting/builtins/moderation.d.ts.map +0 -1
- package/dist/scripting/builtins/native-channels.d.ts +0 -2
- package/dist/scripting/builtins/native-channels.d.ts.map +0 -1
- package/dist/scripting/builtins/native-collectors.d.ts +0 -2
- package/dist/scripting/builtins/native-collectors.d.ts.map +0 -1
- package/dist/scripting/builtins/native-expressions.d.ts +0 -2
- package/dist/scripting/builtins/native-expressions.d.ts.map +0 -1
- package/dist/scripting/builtins/native-invites.d.ts +0 -2
- package/dist/scripting/builtins/native-invites.d.ts.map +0 -1
- package/dist/scripting/builtins/native-messages.d.ts +0 -2
- package/dist/scripting/builtins/native-messages.d.ts.map +0 -1
- package/dist/scripting/builtins/native-roles.d.ts +0 -2
- package/dist/scripting/builtins/native-roles.d.ts.map +0 -1
- package/dist/scripting/builtins/native-threads.d.ts +0 -2
- package/dist/scripting/builtins/native-threads.d.ts.map +0 -1
- package/dist/scripting/builtins/native-users.d.ts +0 -2
- package/dist/scripting/builtins/native-users.d.ts.map +0 -1
- package/dist/scripting/builtins/native-webhooks.d.ts +0 -2
- package/dist/scripting/builtins/native-webhooks.d.ts.map +0 -1
- package/dist/scripting/builtins/payload.d.ts.map +0 -1
- package/dist/scripting/builtins/payload.js.map +0 -1
- package/dist/scripting/builtins/resource-extras.d.ts +0 -2
- package/dist/scripting/builtins/resource-extras.d.ts.map +0 -1
- package/dist/scripting/builtins/schedule.d.ts +0 -2
- package/dist/scripting/builtins/schedule.d.ts.map +0 -1
- package/dist/scripting/builtins/storage.d.ts +0 -2
- package/dist/scripting/builtins/storage.d.ts.map +0 -1
- package/dist/scripting/builtins/values.d.ts +0 -2
- package/dist/scripting/builtins/values.d.ts.map +0 -1
- package/dist/scripting/builtins/values.js.map +0 -1
- package/dist/scripting/canvas-execution.d.ts.map +0 -1
- package/dist/scripting/canvas-execution.js.map +0 -1
- package/dist/scripting/control-flow.d.ts.map +0 -1
- package/dist/scripting/control-flow.js.map +0 -1
- package/dist/scripting/evaluator.d.ts.map +0 -1
- package/dist/scripting/evaluator.js.map +0 -1
- package/dist/scripting/limits.d.ts.map +0 -1
- package/dist/scripting/limits.js.map +0 -1
- package/dist/scripting/parser.d.ts.map +0 -1
- package/dist/scripting/parser.js.map +0 -1
- package/dist/scripting/regex.d.ts.map +0 -1
- package/dist/scripting/regex.js.map +0 -1
- package/dist/scripting/registry.d.ts.map +0 -1
- package/dist/scripting/registry.js.map +0 -1
- package/dist/scripting/runtime.d.ts.map +0 -1
- package/dist/scripting/runtime.js.map +0 -1
- package/dist/scripting/types.d.ts.map +0 -1
- package/dist/scripting/types.js.map +0 -1
- package/dist/scripting/values.d.ts.map +0 -1
- package/dist/scripting/values.js.map +0 -1
- package/src/parser.ts +0 -2
- package/src/runtime.ts +0 -4
- /package/dist/{scripting → functions}/builtins/arguments.d.ts +0 -0
- /package/dist/{scripting → functions}/builtins/arguments.js +0 -0
- /package/dist/{scripting → functions}/builtins/context.js +0 -0
- /package/dist/{scripting → functions}/builtins/definition.js +0 -0
- /package/dist/{scripting → functions}/builtins/events.js +0 -0
- /package/dist/{scripting → functions}/builtins/index.js +0 -0
- /package/dist/{scripting → functions}/builtins/language/common.d.ts +0 -0
- /package/dist/{scripting → functions}/builtins/language/common.js +0 -0
- /package/dist/{scripting → functions}/builtins/language/decimals.js +0 -0
- /package/dist/{scripting → functions}/builtins/language/index.js +0 -0
- /package/dist/{scripting → functions}/builtins/language/numbers.js +0 -0
- /package/dist/{scripting → functions}/builtins/language/objects.js +0 -0
- /package/dist/{scripting → functions}/builtins/language/sort.js +0 -0
- /package/dist/{scripting → functions}/builtins/language/state.js +0 -0
- /package/dist/{scripting → functions}/builtins/language/texts.js +0 -0
- /package/dist/{scripting → functions}/builtins/messages.js +0 -0
- /package/dist/{scripting → functions}/builtins/moderation.js +0 -0
- /package/dist/{scripting → functions}/builtins/native-channels.js +0 -0
- /package/dist/{scripting → functions}/builtins/native-collectors.js +0 -0
- /package/dist/{scripting → functions}/builtins/native-expressions.js +0 -0
- /package/dist/{scripting → functions}/builtins/native-invites.js +0 -0
- /package/dist/{scripting → functions}/builtins/native-messages.js +0 -0
- /package/dist/{scripting → functions}/builtins/native-roles.js +0 -0
- /package/dist/{scripting → functions}/builtins/native-threads.js +0 -0
- /package/dist/{scripting → functions}/builtins/native-users.js +0 -0
- /package/dist/{scripting → functions}/builtins/native-webhooks.js +0 -0
- /package/dist/{scripting → functions}/builtins/resource-extras.js +0 -0
- /package/dist/{scripting → functions}/builtins/schedule.js +0 -0
- /package/dist/{scripting → functions}/builtins/storage.js +0 -0
- /package/dist/{scripting → functions/runtime}/ast.d.ts +0 -0
- /package/dist/{scripting → functions/runtime}/ast.js +0 -0
- /package/dist/{scripting → functions/runtime}/canvas-execution.js +0 -0
- /package/dist/{scripting → functions/runtime}/control-flow.d.ts +0 -0
- /package/dist/{scripting → functions/runtime}/control-flow.js +0 -0
- /package/dist/{scripting → functions/runtime}/limits.d.ts +0 -0
- /package/dist/{scripting → functions/runtime}/parser.d.ts +0 -0
- /package/dist/{scripting → functions/runtime}/regex-worker.mjs +0 -0
- /package/dist/{scripting → functions/runtime}/regex.d.ts +0 -0
- /package/dist/{scripting → functions/runtime}/registry.d.ts +0 -0
- /package/dist/{scripting → functions/runtime}/types.js +0 -0
- /package/dist/{scripting → functions/runtime}/values.d.ts +0 -0
- /package/dist/{scripting → functions/runtime}/values.js +0 -0
- /package/docs/{FUNCTIONS.md → functions/FUNCTIONS.md} +0 -0
- /package/docs/{LANGUAGE-EXTENSIONS.md → functions/LANGUAGE-EXTENSIONS.md} +0 -0
- /package/src/{scripting → functions}/builtins/arguments.ts +0 -0
- /package/src/{scripting → functions}/builtins/events.ts +0 -0
- /package/src/{scripting → functions}/builtins/language/common.ts +0 -0
- /package/src/{scripting → functions}/builtins/language/decimals.ts +0 -0
- /package/src/{scripting → functions}/builtins/language/numbers.ts +0 -0
- /package/src/{scripting → functions}/builtins/language/objects.ts +0 -0
- /package/src/{scripting → functions}/builtins/language/sort.ts +0 -0
- /package/src/{scripting → functions}/builtins/language/state.ts +0 -0
- /package/src/{scripting → functions}/builtins/language/texts.ts +0 -0
- /package/src/{scripting → functions}/builtins/messages.ts +0 -0
- /package/src/{scripting → functions}/builtins/native-collectors.ts +0 -0
- /package/src/{scripting → functions}/builtins/native-expressions.ts +0 -0
- /package/src/{scripting → functions}/builtins/native-invites.ts +0 -0
- /package/src/{scripting → functions}/builtins/native-messages.ts +0 -0
- /package/src/{scripting → functions}/builtins/native-threads.ts +0 -0
- /package/src/{scripting → functions}/builtins/native-webhooks.ts +0 -0
- /package/src/{scripting → functions}/builtins/schedule.ts +0 -0
- /package/src/{scripting → functions}/builtins/storage.ts +0 -0
- /package/src/{scripting → functions/runtime}/ast.ts +0 -0
- /package/src/{scripting → functions/runtime}/control-flow.ts +0 -0
- /package/src/{scripting → functions/runtime}/regex-worker.mjs +0 -0
- /package/src/{scripting → functions/runtime}/values.ts +0 -0
|
@@ -1,11 +1,15 @@
|
|
|
1
1
|
import type { Client } from '@fluxerjs/core';
|
|
2
2
|
import type { Resources } from '../../ports/resources.js';
|
|
3
|
+
import { createCacheResources } from './resources/cache.js';
|
|
3
4
|
import { createChannelsResources } from './resources/channels.js';
|
|
4
5
|
import { createCollectorsResources } from './resources/collectors.js';
|
|
5
6
|
import { createExpressionsResources } from './resources/expressions.js';
|
|
7
|
+
import { createGatewayResources } from './resources/gateway.js';
|
|
8
|
+
import { createInstanceResources } from './resources/instance.js';
|
|
6
9
|
import { createInvitesResources } from './resources/invites.js';
|
|
7
10
|
import { createMessagesResources } from './resources/messages.js';
|
|
8
11
|
import { createRolesResources } from './resources/roles.js';
|
|
12
|
+
import { createSelfResources } from './resources/self.js';
|
|
9
13
|
import { createThreadsResources } from './resources/threads.js';
|
|
10
14
|
import { createUsersResources } from './resources/users.js';
|
|
11
15
|
import { createWebhooksResources } from './resources/webhooks.js';
|
|
@@ -21,6 +25,10 @@ export class FluxerResources implements Resources {
|
|
|
21
25
|
readonly expressions;
|
|
22
26
|
readonly threads;
|
|
23
27
|
readonly invites;
|
|
28
|
+
readonly gateway;
|
|
29
|
+
readonly instance;
|
|
30
|
+
readonly self;
|
|
31
|
+
readonly cache;
|
|
24
32
|
|
|
25
33
|
constructor(client: Client) {
|
|
26
34
|
this.users = createUsersResources(client);
|
|
@@ -32,5 +40,9 @@ export class FluxerResources implements Resources {
|
|
|
32
40
|
this.expressions = createExpressionsResources(client);
|
|
33
41
|
this.threads = createThreadsResources(client);
|
|
34
42
|
this.invites = createInvitesResources(client);
|
|
43
|
+
this.gateway = createGatewayResources(client);
|
|
44
|
+
this.instance = createInstanceResources(client);
|
|
45
|
+
this.self = createSelfResources(client);
|
|
46
|
+
this.cache = createCacheResources(client);
|
|
35
47
|
}
|
|
36
48
|
}
|
|
@@ -0,0 +1,81 @@
|
|
|
1
|
+
import type { MessageInfo } from './messages.js';
|
|
2
|
+
import type { ChannelInfo } from './channels.js';
|
|
3
|
+
import type { GuildInfo, MemberInfo, UserInfo } from './users.js';
|
|
4
|
+
|
|
5
|
+
/** Limites resolvidos do cache; `null` indica ilimitado. */
|
|
6
|
+
export interface CacheLimitsInfo {
|
|
7
|
+
guilds: number | null;
|
|
8
|
+
channels: number | null;
|
|
9
|
+
users: number | null;
|
|
10
|
+
members: number | null;
|
|
11
|
+
/** `false` quando o cache de mensagens está desabilitado. */
|
|
12
|
+
messages: number | false | null;
|
|
13
|
+
roles: number | null;
|
|
14
|
+
emojis: number | null;
|
|
15
|
+
stickers: number | null;
|
|
16
|
+
cascading?: boolean;
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
/** Tamanhos atuais dos buckets de cache com os limites aplicados. */
|
|
20
|
+
export interface CacheStatsInfo {
|
|
21
|
+
guilds: number;
|
|
22
|
+
channels: number;
|
|
23
|
+
users: number;
|
|
24
|
+
members: number;
|
|
25
|
+
messages: number;
|
|
26
|
+
messageChannels: number;
|
|
27
|
+
roles: number;
|
|
28
|
+
emojis: number;
|
|
29
|
+
stickers: number;
|
|
30
|
+
limits: CacheLimitsInfo;
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
/**
|
|
34
|
+
* Filtro de limpeza do cache de mensagens. Sem `maxAgeMs` nem `keep`,
|
|
35
|
+
* todas as mensagens do escopo são removidas. `keep` retorna verdadeiro
|
|
36
|
+
* para manter a mensagem no cache.
|
|
37
|
+
*/
|
|
38
|
+
export interface MessageSweepInput {
|
|
39
|
+
channelID?: string;
|
|
40
|
+
maxAgeMs?: number;
|
|
41
|
+
keep?: (message: MessageInfo, channelID: string) => boolean;
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
/**
|
|
45
|
+
* Filtro de limpeza do cache de membros. Sem `keep`, todos os membros
|
|
46
|
+
* do escopo são removidos. `keep` retorna verdadeiro para manter o membro.
|
|
47
|
+
*/
|
|
48
|
+
export interface MemberSweepInput {
|
|
49
|
+
guildID?: string;
|
|
50
|
+
keep?: (member: MemberInfo, guildID: string) => boolean;
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
/**
|
|
54
|
+
* Filtro de limpeza do cache de usuários. Sem `keep`, todos os usuários
|
|
55
|
+
* do escopo são removidos. `keep` retorna verdadeiro para manter o usuário.
|
|
56
|
+
*/
|
|
57
|
+
export interface UserSweepInput {
|
|
58
|
+
keep?: (user: UserInfo, userID: string) => boolean;
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
/** Filtro de limpeza do cache de canais. `keep` retorna verdadeiro para manter o canal. */
|
|
62
|
+
export interface ChannelSweepInput {
|
|
63
|
+
keep?: (channel: ChannelInfo, channelID: string) => boolean;
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
/** Filtro de limpeza do cache de servidores. `keep` retorna verdadeiro para manter o servidor. */
|
|
67
|
+
export interface GuildSweepInput {
|
|
68
|
+
keep?: (guild: GuildInfo, guildID: string) => boolean;
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
/** Inspeção e limpeza dos caches locais do client. */
|
|
72
|
+
export interface CacheResources {
|
|
73
|
+
stats(): Promise<CacheStatsInfo>;
|
|
74
|
+
sweepMessages(input?: MessageSweepInput): Promise<number>;
|
|
75
|
+
sweepMembers(input?: MemberSweepInput): Promise<number>;
|
|
76
|
+
sweepUsers(input?: UserSweepInput): Promise<number>;
|
|
77
|
+
sweepChannels(input?: ChannelSweepInput): Promise<number>;
|
|
78
|
+
sweepGuilds(input?: GuildSweepInput): Promise<number>;
|
|
79
|
+
cascadeChannel(channelID: string): Promise<void>;
|
|
80
|
+
cascadeGuild(guildID: string): Promise<void>;
|
|
81
|
+
}
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import type { ThreadDefaultsInput } from './threads.js';
|
|
1
2
|
export interface ChannelInfo {
|
|
2
3
|
id: string;
|
|
3
4
|
name: string;
|
|
@@ -9,6 +10,8 @@ export interface ChannelInfo {
|
|
|
9
10
|
slowmode: number;
|
|
10
11
|
nsfw: boolean;
|
|
11
12
|
url?: string | null;
|
|
13
|
+
recipientIDs?: string[];
|
|
14
|
+
ownerID?: string | null;
|
|
12
15
|
contentWarningLevel?: number | null;
|
|
13
16
|
contentWarningText?: string | null;
|
|
14
17
|
}
|
|
@@ -47,13 +50,22 @@ export interface ChannelOverwriteInput {
|
|
|
47
50
|
|
|
48
51
|
export interface ChannelsResources {
|
|
49
52
|
get(channelID: string): Promise<ChannelInfo>;
|
|
53
|
+
addRecipient(channelID: string, userID: string): Promise<void>;
|
|
54
|
+
removeRecipient(channelID: string, userID: string, options?: { silent?: boolean }): Promise<void>;
|
|
50
55
|
list(guildID: string, limit?: number): Promise<ChannelInfo[]>;
|
|
51
56
|
create(guildID: string, input: ChannelCreateInput): Promise<ChannelInfo>;
|
|
52
57
|
edit(channelID: string, input: ChannelEditInput): Promise<ChannelInfo>;
|
|
53
58
|
delete(channelID: string, reason?: string): Promise<void>;
|
|
54
59
|
setSlowmode(channelID: string, seconds: number, reason?: string): Promise<void>;
|
|
60
|
+
slowmode(channelID: string): Promise<number>;
|
|
61
|
+
sendTyping(channelID: string): Promise<void>;
|
|
62
|
+
rtcRegions(channelID: string): Promise<RtcRegionInfo[]>;
|
|
55
63
|
overwrite(channelID: string, targetID: string, input: ChannelOverwriteInput): Promise<void>;
|
|
56
64
|
permissionsFor(guildID: string, channelID: string, userID: string): Promise<string>;
|
|
65
|
+
editThreadDefaults(channelID: string, input: ThreadDefaultsInput): Promise<void>;
|
|
66
|
+
setDefaultForumLayout(channelID: string, layout: 'default' | 'list' | 'grid' | null, reason?: string): Promise<void>;
|
|
57
67
|
move(channelID: string, position: number): Promise<void>;
|
|
58
68
|
setCategory(channelID: string, parentID: string | null, reason?: string): Promise<ChannelInfo>;
|
|
59
69
|
}
|
|
70
|
+
|
|
71
|
+
export interface RtcRegionInfo { id: string; name: string; emoji: string }
|
|
@@ -5,6 +5,23 @@ export interface AwaitMessageInput {
|
|
|
5
5
|
signal?: AbortSignal;
|
|
6
6
|
}
|
|
7
7
|
|
|
8
|
+
export interface CollectMessagesInput {
|
|
9
|
+
userID?: string;
|
|
10
|
+
contains?: string;
|
|
11
|
+
timeMs?: number;
|
|
12
|
+
max?: number;
|
|
13
|
+
signal?: AbortSignal;
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
export interface CollectReactionsInput {
|
|
17
|
+
messageID: string;
|
|
18
|
+
emojis?: string | string[];
|
|
19
|
+
userID?: string;
|
|
20
|
+
timeMs?: number;
|
|
21
|
+
max?: number;
|
|
22
|
+
signal?: AbortSignal;
|
|
23
|
+
}
|
|
24
|
+
|
|
8
25
|
export interface CollectedMessageInfo {
|
|
9
26
|
id: string;
|
|
10
27
|
channelID: string;
|
|
@@ -15,10 +32,13 @@ export interface CollectedMessageInfo {
|
|
|
15
32
|
export interface ReactionVote {
|
|
16
33
|
userID: string;
|
|
17
34
|
emoji: string;
|
|
35
|
+
messageID?: string;
|
|
18
36
|
}
|
|
19
37
|
|
|
20
38
|
export interface CollectorsResources {
|
|
21
39
|
awaitMessage(channelID: string, input: AwaitMessageInput): Promise<CollectedMessageInfo | null>;
|
|
22
40
|
awaitReaction(channelID: string, messageID: string, emojis: string | string[],
|
|
23
41
|
timeMs: number, userID?: string, signal?: AbortSignal): Promise<ReactionVote | null>;
|
|
42
|
+
collectMessages(channelID: string, input: CollectMessagesInput): AsyncIterable<CollectedMessageInfo>;
|
|
43
|
+
collectReactions(channelID: string, input: CollectReactionsInput): AsyncIterable<ReactionVote>;
|
|
24
44
|
}
|
|
@@ -3,12 +3,14 @@ export interface AttachmentSpec {
|
|
|
3
3
|
url: string;
|
|
4
4
|
name: string;
|
|
5
5
|
description?: string;
|
|
6
|
+
spoiler?: boolean;
|
|
6
7
|
}
|
|
7
8
|
|
|
8
9
|
export interface BinaryAttachmentSpec {
|
|
9
10
|
data: Uint8Array;
|
|
10
11
|
name: string;
|
|
11
12
|
description?: string;
|
|
13
|
+
spoiler?: boolean;
|
|
12
14
|
}
|
|
13
15
|
|
|
14
16
|
export type PresenceStatus = 'online' | 'idle' | 'dnd' | 'invisible';
|
|
@@ -22,6 +22,7 @@ export interface ExpressionsResources {
|
|
|
22
22
|
stickers(guildID: string): Promise<StickerInfo[]>;
|
|
23
23
|
editEmoji(guildID: string, nameOrID: string, name: string, reason?: string): Promise<EmojiInfo>;
|
|
24
24
|
createSticker(guildID: string, input: StickerCreateInput): Promise<StickerInfo>;
|
|
25
|
+
createStickersBulk(guildID: string, inputs: StickerCreateInput[]): Promise<StickerBulkResult>;
|
|
25
26
|
editSticker(guildID: string, nameOrID: string, input: StickerEditInput): Promise<StickerInfo>;
|
|
26
27
|
deleteSticker(guildID: string, nameOrID: string, reason?: string): Promise<void>;
|
|
27
28
|
cloneEmoji(guildID: string, sourceID: string): Promise<EmojiInfo>;
|
|
@@ -34,6 +35,11 @@ export interface EmojiBulkResult {
|
|
|
34
35
|
failed: { name: string; error: string }[];
|
|
35
36
|
}
|
|
36
37
|
|
|
38
|
+
export interface StickerBulkResult {
|
|
39
|
+
success: StickerInfo[];
|
|
40
|
+
failed: { name: string; error: string }[];
|
|
41
|
+
}
|
|
42
|
+
|
|
37
43
|
export interface StickerEditInput {
|
|
38
44
|
name?: string;
|
|
39
45
|
description?: string;
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
import type { GatewaySendPayload } from '@fluxerjs/types';
|
|
2
|
+
|
|
3
|
+
/** Pedido de membros de servidor pelo gateway (opcode 8). */
|
|
4
|
+
export interface GatewayMembersRequest {
|
|
5
|
+
guildID?: string;
|
|
6
|
+
guildIDs?: string[];
|
|
7
|
+
query?: string;
|
|
8
|
+
limit?: number;
|
|
9
|
+
userIDs?: string[];
|
|
10
|
+
presences?: boolean;
|
|
11
|
+
nonce?: string;
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
/** Pedido de contagens de membros por canal dentro de um servidor (opcode 16). */
|
|
15
|
+
export interface ChannelCountsRequest {
|
|
16
|
+
guildID: string;
|
|
17
|
+
channelID?: string;
|
|
18
|
+
channelIDs?: string[];
|
|
19
|
+
nonce?: string;
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
/** Pedido de não lidos de posts em um canal de fórum ou mídia (opcode 28). */
|
|
23
|
+
export interface ForumUnreadsRequest {
|
|
24
|
+
guildID: string;
|
|
25
|
+
channelID: string;
|
|
26
|
+
threads: { threadID: string; ackMessageID?: string }[];
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
/** Assinatura de tráfego de threads em um servidor (opcode 14). */
|
|
30
|
+
export interface ThreadSubscriptionInput {
|
|
31
|
+
guildID: string;
|
|
32
|
+
threads?: boolean;
|
|
33
|
+
threadIDs?: string[];
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
/**
|
|
37
|
+
* Pedidos brutos ao gateway. São fire-and-forget: os resultados chegam por
|
|
38
|
+
* eventos do client (ex.: `guildCountsUpdate`, `channelMemberCountsUpdate`,
|
|
39
|
+
* `forumUnreads`, `threadMemberListUpdate`). Para aguardar a resposta use
|
|
40
|
+
* `users.guildCounts` e `users.channelCounts`, que encapsulam pedido e espera.
|
|
41
|
+
*/
|
|
42
|
+
export interface GatewayResources {
|
|
43
|
+
requestMembers(input: GatewayMembersRequest): void;
|
|
44
|
+
requestGuildCounts(guildIDs: string[], nonce?: string): void;
|
|
45
|
+
requestChannelCounts(input: ChannelCountsRequest): void;
|
|
46
|
+
requestForumUnreads(input: ForumUnreadsRequest): void;
|
|
47
|
+
subscribeThreads(input: ThreadSubscriptionInput): void;
|
|
48
|
+
send(shardID: number, payload: GatewaySendPayload): void;
|
|
49
|
+
}
|
|
@@ -0,0 +1,109 @@
|
|
|
1
|
+
/** URLs de endpoint resolvidas da instância Fluxer. */
|
|
2
|
+
export interface InstanceEndpointsInfo {
|
|
3
|
+
api: string;
|
|
4
|
+
apiClient: string;
|
|
5
|
+
apiPublic: string;
|
|
6
|
+
gateway: string;
|
|
7
|
+
media: string;
|
|
8
|
+
staticCDN: string;
|
|
9
|
+
marketing: string;
|
|
10
|
+
admin: string;
|
|
11
|
+
invite: string;
|
|
12
|
+
gift: string;
|
|
13
|
+
webapp: string;
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
/** Flags de recursos do documento de descoberta da instância. */
|
|
17
|
+
export interface InstanceFeaturesInfo {
|
|
18
|
+
voiceEnabled: boolean;
|
|
19
|
+
stripeEnabled: boolean;
|
|
20
|
+
selfHosted: boolean;
|
|
21
|
+
presignedAttachmentUploads: boolean;
|
|
22
|
+
emailsEnabled: boolean;
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
/** Integrações opcionais de terceiros habilitadas na instância. */
|
|
26
|
+
export interface InstanceServicesInfo {
|
|
27
|
+
gif: boolean;
|
|
28
|
+
youtube: boolean;
|
|
29
|
+
bluesky: boolean;
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
/** Descrição normalizada da instância: endpoints resolvidos e descoberta. */
|
|
33
|
+
export interface InstanceInfo {
|
|
34
|
+
apiCodeVersion: number | null;
|
|
35
|
+
codename: string | null;
|
|
36
|
+
endpoints: InstanceEndpointsInfo;
|
|
37
|
+
features: InstanceFeaturesInfo | null;
|
|
38
|
+
registrationMode: 'open' | 'approval' | 'closed' | null;
|
|
39
|
+
ssoEnabled: boolean | null;
|
|
40
|
+
ssoEnforced: boolean | null;
|
|
41
|
+
singleCommunity: boolean | null;
|
|
42
|
+
singleCommunityGuildID: string | null;
|
|
43
|
+
directMessagesDisabled: boolean | null;
|
|
44
|
+
services: InstanceServicesInfo | null;
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
/** Informações de conexão do gateway (`GET /gateway/bot`). */
|
|
48
|
+
export interface GatewayInfo {
|
|
49
|
+
url: string;
|
|
50
|
+
shards: number;
|
|
51
|
+
sessionStartLimit: {
|
|
52
|
+
total: number;
|
|
53
|
+
remaining: number;
|
|
54
|
+
resetAfter: number;
|
|
55
|
+
maxConcurrency: number;
|
|
56
|
+
} | null;
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
/** Aplicação normalizada de `applications/@me` e `oauth2/applications/@me`. */
|
|
60
|
+
export interface ApplicationInfo {
|
|
61
|
+
id: string;
|
|
62
|
+
name: string;
|
|
63
|
+
icon: string | null;
|
|
64
|
+
description: string | null;
|
|
65
|
+
botPublic: boolean | null;
|
|
66
|
+
botRequireCodeGrant: boolean | null;
|
|
67
|
+
verifyKey: string | null;
|
|
68
|
+
flags: number | null;
|
|
69
|
+
ownerID: string | null;
|
|
70
|
+
botID: string | null;
|
|
71
|
+
redirectURIs: string[];
|
|
72
|
+
clientSecret: string | null;
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
/** Metadados de emoji (`GET /emojis/{id}/metadata`). */
|
|
76
|
+
export interface EmojiMetadataInfo {
|
|
77
|
+
id: string;
|
|
78
|
+
guildID: string;
|
|
79
|
+
name: string;
|
|
80
|
+
animated: boolean;
|
|
81
|
+
allowCloning: boolean;
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
/** Metadados de sticker (`GET /stickers/{id}/metadata`). */
|
|
85
|
+
export interface StickerMetadataInfo {
|
|
86
|
+
id: string;
|
|
87
|
+
guildID: string;
|
|
88
|
+
name: string;
|
|
89
|
+
animated: boolean;
|
|
90
|
+
allowCloning: boolean;
|
|
91
|
+
}
|
|
92
|
+
|
|
93
|
+
/** Referência de emoji aceita por `resolveEmoji` além do texto. */
|
|
94
|
+
export interface EmojiReference {
|
|
95
|
+
name: string;
|
|
96
|
+
id?: string;
|
|
97
|
+
animated?: boolean;
|
|
98
|
+
}
|
|
99
|
+
|
|
100
|
+
/** Introspecção da instância, do gateway e da aplicação do client. */
|
|
101
|
+
export interface InstanceResources {
|
|
102
|
+
describe(): Promise<InstanceInfo>;
|
|
103
|
+
gatewayInfo(): Promise<GatewayInfo>;
|
|
104
|
+
application(): Promise<ApplicationInfo>;
|
|
105
|
+
oauthApplications(): Promise<ApplicationInfo[]>;
|
|
106
|
+
emojiMetadata(emojiID: string): Promise<EmojiMetadataInfo>;
|
|
107
|
+
stickerMetadata(stickerID: string): Promise<StickerMetadataInfo>;
|
|
108
|
+
resolveEmoji(emoji: string | EmojiReference, guildID?: string): Promise<string>;
|
|
109
|
+
}
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import type { AttachmentSpec, BinaryAttachmentSpec } from './common.js';
|
|
2
|
+
import type { APIMessage } from '@fluxerjs/types';
|
|
2
3
|
import type { MessageSearchInput, PinnedMessagesInput } from '../../domain/message-query.js';
|
|
3
4
|
import type { ReceivedEmbed } from '../../domain/messages.js';
|
|
4
5
|
export type { MessageSearchInput, PinnedMessagesInput } from '../../domain/message-query.js';
|
|
@@ -40,8 +41,17 @@ export interface MessagesResources {
|
|
|
40
41
|
dm(userID: string, content: string): Promise<string>;
|
|
41
42
|
forward(channelID: string, sourceChannelID: string, messageID: string): Promise<string>;
|
|
42
43
|
search(input: MessageSearchInput): Promise<MessageSearchPage>;
|
|
44
|
+
searchAll(input: MessageSearchInput): Promise<MessageSearchPage>;
|
|
45
|
+
bulkFetch(requests: BulkFetchRequest[], input?: BulkFetchInput): Promise<MessageInfo[] | BulkFetchRawChannel[]>;
|
|
43
46
|
sendBytes(channelID: string, files: BinaryAttachmentSpec[], content?: string): Promise<string>;
|
|
44
47
|
sendAttachments(channelID: string, files: (AttachmentSpec | BinaryAttachmentSpec)[], content?: string): Promise<string>;
|
|
48
|
+
deleteAttachment(channelID: string, messageID: string, attachmentID: string): Promise<void>;
|
|
49
|
+
sendTo(channelID: string, content: string): Promise<string>;
|
|
50
|
+
bulkDelete(channelID: string, messageIDs: string[]): Promise<string[]>;
|
|
51
|
+
bulkDeleteOwn(channelID: string): Promise<void>;
|
|
52
|
+
acknowledgePins(channelID: string): Promise<void>;
|
|
53
|
+
clearReadState(channelID: string): Promise<void>;
|
|
54
|
+
purgeDM(channelID: string): Promise<number>;
|
|
45
55
|
}
|
|
46
56
|
|
|
47
57
|
export interface MessageCursor { before?: string; after?: string; around?: string }
|
|
@@ -62,3 +72,23 @@ export interface MessageSearchPage {
|
|
|
62
72
|
total: number;
|
|
63
73
|
cursor: string[] | null;
|
|
64
74
|
}
|
|
75
|
+
|
|
76
|
+
/** Janela de mensagens de um canal dentro de um `bulkFetch`. */
|
|
77
|
+
export interface BulkFetchRequest {
|
|
78
|
+
channelID: string;
|
|
79
|
+
limit: number;
|
|
80
|
+
before?: string;
|
|
81
|
+
after?: string;
|
|
82
|
+
around?: string;
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
export interface BulkFetchInput {
|
|
86
|
+
/** `false` retorna o payload bruto da API; o padrão hidrata e normaliza. */
|
|
87
|
+
hydrate?: boolean;
|
|
88
|
+
}
|
|
89
|
+
|
|
90
|
+
/** Canal do retorno bruto de `bulkFetch` quando `hydrate` é `false`. */
|
|
91
|
+
export interface BulkFetchRawChannel {
|
|
92
|
+
channelID: string;
|
|
93
|
+
messages: APIMessage[];
|
|
94
|
+
}
|
|
@@ -5,6 +5,7 @@ export interface RoleInfo {
|
|
|
5
5
|
position: number;
|
|
6
6
|
permissions: string;
|
|
7
7
|
hoist: boolean;
|
|
8
|
+
hoistPosition?: number | null;
|
|
8
9
|
mentionable: boolean;
|
|
9
10
|
unicodeEmoji: string | null;
|
|
10
11
|
managed: boolean;
|
|
@@ -38,4 +39,6 @@ export interface RolesResources {
|
|
|
38
39
|
edit(guildID: string, role: string, input: RoleEditInput): Promise<RoleInfo>;
|
|
39
40
|
delete(guildID: string, role: string, reason?: string): Promise<void>;
|
|
40
41
|
move(guildID: string, role: string, position: number): Promise<void>;
|
|
42
|
+
setRoleHoistPositions(guildID: string, updates: { id: string; position: number | null }[]): Promise<RoleInfo[]>;
|
|
43
|
+
resetRoleHoistPositions(guildID: string): Promise<RoleInfo[]>;
|
|
41
44
|
}
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import type { UserInfo } from './users.js';
|
|
2
|
+
|
|
3
|
+
/** Credenciais para verificação sudo (ações elevadas): senha e/ou MFA. */
|
|
4
|
+
export interface SudoVerification {
|
|
5
|
+
password?: string;
|
|
6
|
+
mfaMethod?: 'totp' | 'webauthn';
|
|
7
|
+
mfaCode?: string;
|
|
8
|
+
webauthnResponse?: Record<string, unknown>;
|
|
9
|
+
webauthnChallenge?: string;
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
/** Servidor parcial retornado por `GET /users/@me/guilds`. */
|
|
13
|
+
export interface SelfGuildInfo {
|
|
14
|
+
id: string;
|
|
15
|
+
name: string;
|
|
16
|
+
icon: string | null;
|
|
17
|
+
owner: boolean;
|
|
18
|
+
permissions: string | null;
|
|
19
|
+
features: string[];
|
|
20
|
+
memberCount: number | null;
|
|
21
|
+
onlineCount: number | null;
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
/** Operações sobre o usuário autenticado (`client.user`). */
|
|
25
|
+
export interface SelfResources {
|
|
26
|
+
fetch(): Promise<UserInfo>;
|
|
27
|
+
guilds(input?: { withCounts?: boolean }): Promise<SelfGuildInfo[]>;
|
|
28
|
+
leaveGuild(guildID: string, verification?: SudoVerification): Promise<void>;
|
|
29
|
+
deleteMyMessages(guildID: string, verification?: SudoVerification): Promise<void>;
|
|
30
|
+
}
|
|
@@ -48,11 +48,26 @@ export interface ThreadsResources {
|
|
|
48
48
|
edit(threadID: string, input: ThreadEditInput): Promise<ThreadInfo>;
|
|
49
49
|
join(threadID: string): Promise<void>;
|
|
50
50
|
leave(threadID: string): Promise<void>;
|
|
51
|
+
setLocked(threadID: string, locked: boolean, reason?: string): Promise<void>;
|
|
52
|
+
editSelf(threadID: string, input: ThreadSelfEditInput): Promise<ThreadMemberInfo | null>;
|
|
53
|
+
editDefaults(parentID: string, input: ThreadDefaultsInput): Promise<void>;
|
|
51
54
|
search(channelID: string, input: ThreadSearchInput): Promise<ThreadSearchPage>;
|
|
52
55
|
active(guildID: string): Promise<ThreadListPage>;
|
|
53
56
|
archived(channelID: string, input?: ArchivedThreadsInput): Promise<ThreadListPage>;
|
|
54
57
|
}
|
|
55
58
|
|
|
59
|
+
export interface ThreadSelfEditInput {
|
|
60
|
+
flags?: number;
|
|
61
|
+
muted?: boolean;
|
|
62
|
+
muteConfig?: { endTime?: string | number | null; selectedTimeWindow: number } | null;
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
export interface ThreadDefaultsInput {
|
|
66
|
+
autoArchiveDuration?: number | null;
|
|
67
|
+
slowmode?: number | null;
|
|
68
|
+
reason?: string;
|
|
69
|
+
}
|
|
70
|
+
|
|
56
71
|
export interface ThreadEditInput {
|
|
57
72
|
name?: string;
|
|
58
73
|
archived?: boolean;
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import type { ActivityInfo, PresenceStatus } from './common.js';
|
|
2
|
+
import type { ChannelInfo } from './channels.js';
|
|
2
3
|
|
|
3
4
|
export interface UserInfo {
|
|
4
5
|
id: string;
|
|
@@ -59,6 +60,13 @@ export interface UsersResources {
|
|
|
59
60
|
searchMembers(guildID: string, query: string, limit?: number, offset?: number): Promise<MemberSearchPage>;
|
|
60
61
|
setNickname(guildID: string, userID: string, nickname: string | null, reason: string): Promise<MemberInfo>;
|
|
61
62
|
editGuild(guildID: string, input: GuildEditInput): Promise<GuildInfo>;
|
|
63
|
+
me(guildID: string): Promise<MemberInfo>;
|
|
64
|
+
transferOwnership(guildID: string, userID: string): Promise<void>;
|
|
65
|
+
withdrawDiscoveryApplication(guildID: string): Promise<void>;
|
|
66
|
+
discoveryStatus(guildID: string): Promise<DiscoveryStatusInfo>;
|
|
67
|
+
applyForDiscovery(guildID: string, input: DiscoveryApplicationInput): Promise<DiscoveryApplicationInfo>;
|
|
68
|
+
editDiscoveryApplication(guildID: string, input: DiscoveryApplicationInput): Promise<DiscoveryApplicationInfo>;
|
|
69
|
+
createDM(userID: string): Promise<ChannelInfo>;
|
|
62
70
|
leaveGuild?(guildID: string): Promise<void>;
|
|
63
71
|
}
|
|
64
72
|
|
|
@@ -101,6 +109,31 @@ export interface MemberSearchPage {
|
|
|
101
109
|
hasMore: boolean;
|
|
102
110
|
indexing: boolean;
|
|
103
111
|
}
|
|
112
|
+
export interface DiscoveryApplicationInput {
|
|
113
|
+
description?: string;
|
|
114
|
+
primaryCategoryId?: number | string;
|
|
115
|
+
keywords?: string[];
|
|
116
|
+
primaryLanguage?: string;
|
|
117
|
+
}
|
|
118
|
+
|
|
119
|
+
export interface DiscoveryApplicationInfo {
|
|
120
|
+
guildID: string;
|
|
121
|
+
status: string;
|
|
122
|
+
description: string;
|
|
123
|
+
categoryType: number;
|
|
124
|
+
primaryLanguage?: string | null;
|
|
125
|
+
customTags?: string[];
|
|
126
|
+
appliedAt?: string;
|
|
127
|
+
reviewedAt?: string | null;
|
|
128
|
+
guildNsfwLevel?: number | null;
|
|
129
|
+
}
|
|
130
|
+
|
|
131
|
+
export interface DiscoveryStatusInfo {
|
|
132
|
+
application: DiscoveryApplicationInfo | null;
|
|
133
|
+
eligible: boolean;
|
|
134
|
+
minMemberCount: number;
|
|
135
|
+
}
|
|
136
|
+
|
|
104
137
|
export interface GuildEditInput {
|
|
105
138
|
name?: string;
|
|
106
139
|
icon?: string | null;
|
|
@@ -12,6 +12,10 @@ export interface WebhookSendInput {
|
|
|
12
12
|
avatarURL?: string;
|
|
13
13
|
}
|
|
14
14
|
|
|
15
|
+
export interface WebhookMessageEditInput {
|
|
16
|
+
content?: string;
|
|
17
|
+
}
|
|
18
|
+
|
|
15
19
|
export interface WebhooksResources {
|
|
16
20
|
fetch(webhookID: string): Promise<WebhookInfo>;
|
|
17
21
|
create(channelID: string, name: string, reason?: string): Promise<WebhookInfo>;
|
|
@@ -19,4 +23,6 @@ export interface WebhooksResources {
|
|
|
19
23
|
send(webhookID: string, token: string, input: WebhookSendInput): Promise<string | null>;
|
|
20
24
|
edit(webhookID: string, token: string | null, name: string): Promise<void>;
|
|
21
25
|
delete(webhookID: string, token: string | null): Promise<void>;
|
|
26
|
+
editMessage(webhookID: string, token: string, messageID: string, input: WebhookMessageEditInput): Promise<string>;
|
|
27
|
+
deleteMessage(webhookID: string, token: string, messageID: string): Promise<void>;
|
|
22
28
|
}
|
package/src/ports/resources.ts
CHANGED
|
@@ -1,9 +1,13 @@
|
|
|
1
|
+
import type { CacheResources } from './resources/cache.js';
|
|
1
2
|
import type { ChannelsResources } from './resources/channels.js';
|
|
2
3
|
import type { CollectorsResources } from './resources/collectors.js';
|
|
3
4
|
import type { ExpressionsResources } from './resources/expressions.js';
|
|
5
|
+
import type { GatewayResources } from './resources/gateway.js';
|
|
6
|
+
import type { InstanceResources } from './resources/instance.js';
|
|
4
7
|
import type { InvitesResources } from './resources/invites.js';
|
|
5
8
|
import type { MessagesResources } from './resources/messages.js';
|
|
6
9
|
import type { RolesResources } from './resources/roles.js';
|
|
10
|
+
import type { SelfResources } from './resources/self.js';
|
|
7
11
|
import type { ThreadsResources } from './resources/threads.js';
|
|
8
12
|
import type { UsersResources } from './resources/users.js';
|
|
9
13
|
import type { WebhooksResources } from './resources/webhooks.js';
|
|
@@ -19,4 +23,8 @@ export interface Resources {
|
|
|
19
23
|
readonly expressions: ExpressionsResources;
|
|
20
24
|
readonly threads: ThreadsResources;
|
|
21
25
|
readonly invites: InvitesResources;
|
|
26
|
+
readonly gateway: GatewayResources;
|
|
27
|
+
readonly instance: InstanceResources;
|
|
28
|
+
readonly self: SelfResources;
|
|
29
|
+
readonly cache: CacheResources;
|
|
22
30
|
}
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
export interface ScriptLimits { calls: number; depth: number; output: number; timeoutMs: number }
|
|
2
|
+
|
|
3
|
+
/** Chamada de função `$` vista pela framework; a forma completa vive em `yuzuha/functions`. */
|
|
4
|
+
export interface ScriptFunctionCall {
|
|
5
|
+
/** O contexto concreto é fornecido pelo engine; em `yuzuha/functions` ele é tipado. */
|
|
6
|
+
ctx: any;
|
|
7
|
+
count: number;
|
|
8
|
+
arg(index: number): Promise<unknown>;
|
|
9
|
+
fresh(index: number): Promise<unknown>;
|
|
10
|
+
text(index: number): Promise<string>;
|
|
11
|
+
all(): Promise<unknown[]>;
|
|
12
|
+
checkOutput(value: unknown): void;
|
|
13
|
+
wait<T>(promise: Promise<T>): Promise<T>;
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
export interface ScriptFunctionDefinition {
|
|
17
|
+
name: string;
|
|
18
|
+
aliases?: string[];
|
|
19
|
+
description: string;
|
|
20
|
+
category: string;
|
|
21
|
+
minArgs: number;
|
|
22
|
+
maxArgs: number;
|
|
23
|
+
usage: string;
|
|
24
|
+
execute: (call: ScriptFunctionCall) => unknown | Promise<unknown>;
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
/**
|
|
28
|
+
* Motor de function mode instalado no bot. O programa compilado e o contexto
|
|
29
|
+
* de execução são opacos para a framework; `yuzuha/functions` provê a
|
|
30
|
+
* implementação de referência via `functions()`.
|
|
31
|
+
*/
|
|
32
|
+
/** Programas compilados executam na engine que compilou o programa. */
|
|
33
|
+
export interface ScriptEngine {
|
|
34
|
+
readonly limits: Readonly<ScriptLimits>;
|
|
35
|
+
compile(code: string, name?: string): unknown;
|
|
36
|
+
execute(program: unknown, ctx: unknown): Promise<unknown>;
|
|
37
|
+
functions(): ScriptFunctionDefinition[];
|
|
38
|
+
registerAll(definitions: ScriptFunctionDefinition[]): unknown;
|
|
39
|
+
/** Cópia temporária para validar instalações antes de confirmá-las. */
|
|
40
|
+
fork(): ScriptEngine;
|
|
41
|
+
text(value: unknown): string;
|
|
42
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from '@fluxerjs/builders';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from '@fluxerjs/core/client';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from '@fluxerjs/core/cluster';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from '@fluxerjs/collection';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from '@fluxerjs/core/errors';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from '@fluxerjs/core/internal';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from '@fluxerjs/core/message';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from '@fluxerjs/rest/request-manager';
|
package/src/sdk/rest.ts
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from '@fluxerjs/rest';
|