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
package/docs/CANVAS.md
CHANGED
|
@@ -1,24 +1,77 @@
|
|
|
1
1
|
# Canvas para cartões
|
|
2
2
|
|
|
3
|
-
`yuzuha/canvas`
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
com
|
|
3
|
+
`yuzuha/canvas` é a API de desenho compatível com `@napi-rs/canvas` —
|
|
4
|
+
`createCanvas`, `loadImage`, `GlobalFonts`, `Path2D`, `ImageData`, `DOMMatrix`
|
|
5
|
+
e os demais exports do pacote — rodando em processo para código confiável.
|
|
6
|
+
`yuzuha/canvas/card` mantém o builder de cartões com texto, imagens, formas,
|
|
7
|
+
badges e barras, renderizado em processo filho. Use Canvas para montar uma
|
|
8
|
+
imagem nova; use [`yuzuha/images`](IMAGES.md) quando já tiver uma imagem e
|
|
9
|
+
quiser transformá-la com Sharp.
|
|
7
10
|
|
|
8
11
|
## Instalação
|
|
9
12
|
|
|
10
13
|
O backend é um peer opcional. Instale-o somente nos bots que renderizam Canvas:
|
|
11
14
|
|
|
12
15
|
```sh
|
|
13
|
-
npm install yuzuha@0.
|
|
16
|
+
npm install yuzuha@0.3.0 @napi-rs/canvas@^1.0.13
|
|
14
17
|
```
|
|
15
18
|
|
|
16
|
-
Os imports `yuzuha`, `yuzuha/functions` e `yuzuha/canvas` continuam
|
|
17
|
-
sem o peer. Criar um bot
|
|
18
|
-
inicia um processo.
|
|
19
|
-
|
|
20
|
-
`CANVAS_DEPENDENCY` e
|
|
21
|
-
|
|
19
|
+
Os imports `yuzuha`, `yuzuha/functions` e `yuzuha/canvas/card` continuam
|
|
20
|
+
disponíveis sem o peer. Criar um bot ou um `CanvasBuilder` não carrega Skia nem
|
|
21
|
+
inicia um processo. `import 'yuzuha/canvas'` tenta carregar o peer; sem uma
|
|
22
|
+
versão compatível, as funções e classes exportadas falham com
|
|
23
|
+
`CANVAS_DEPENDENCY` e informam a instalação necessária. O renderer do builder
|
|
24
|
+
só é importado pelo processo filho quando `render()` começa. Canvas não
|
|
25
|
+
depende de Sharp.
|
|
26
|
+
|
|
27
|
+
## API napi em processo
|
|
28
|
+
|
|
29
|
+
`yuzuha/canvas` cobre os mesmos exports de `@napi-rs/canvas`, para desenho
|
|
30
|
+
direto em código confiável do bot:
|
|
31
|
+
|
|
32
|
+
```ts
|
|
33
|
+
import { createCanvas, loadImage, registerFonts } from 'yuzuha/canvas';
|
|
34
|
+
|
|
35
|
+
registerFonts('./assets/fonts');
|
|
36
|
+
const canvas = createCanvas(640, 240);
|
|
37
|
+
const ctx = canvas.getContext('2d');
|
|
38
|
+
ctx.fillStyle = '#101722';
|
|
39
|
+
ctx.fillRect(0, 0, 640, 240);
|
|
40
|
+
ctx.font = '700 52px Inter';
|
|
41
|
+
ctx.fillStyle = '#f2f4f5';
|
|
42
|
+
ctx.fillText('Perfil demonstrativo', 32, 120);
|
|
43
|
+
const avatar = await loadImage('https://exemplo.dev/avatar.png');
|
|
44
|
+
ctx.drawImage(avatar, 24, 56, 128, 128);
|
|
45
|
+
const png = await canvas.encode('png');
|
|
46
|
+
```
|
|
47
|
+
|
|
48
|
+
`createCanvas` valida as dimensões contra `CANVAS_LIMITS` (4096 px por eixo,
|
|
49
|
+
16.777.216 pixels) com `CANVAS_OPTIONS` antes de criar o canvas. `loadImage`
|
|
50
|
+
aceita `Buffer`, `Uint8Array`, caminhos, data URLs e imagens como o original;
|
|
51
|
+
URLs `http(s)` são baixadas via `HttpService` — com guarda de rede privada,
|
|
52
|
+
limite de bytes e cancelamento — e inspecionadas como PNG, JPEG ou WebP
|
|
53
|
+
estáticos antes do decode. As opções aceitam `http`, `signal` e `timeoutMs`.
|
|
54
|
+
`registerFonts(dir)` registra cada `.ttf`, `.otf`, `.woff` e `.woff2` do
|
|
55
|
+
diretório via `GlobalFonts` e retorna a contagem; diretório ausente retorna 0.
|
|
56
|
+
|
|
57
|
+
No contexto de comando ou evento, `ctx.canvas.send(canvas)` codifica e envia um
|
|
58
|
+
canvas napi como anexo, com as mesmas opções `name`, `channelID`, `content`,
|
|
59
|
+
`description`, `format` e `quality` do builder. `ctx.canvas.loadImage(source)`
|
|
60
|
+
é o wrapper acima já vinculado ao `ctx.http` e ao sinal do contexto:
|
|
61
|
+
|
|
62
|
+
```ts
|
|
63
|
+
const canvas = createCanvas(320, 120);
|
|
64
|
+
const context = canvas.getContext('2d');
|
|
65
|
+
context.fillStyle = '#111923'; context.fillRect(0, 0, 320, 120);
|
|
66
|
+
context.fillStyle = '#ffffff'; context.font = '700 32px Inter';
|
|
67
|
+
context.fillText(`Olá, ${ctx.authorName}`, 16, 64);
|
|
68
|
+
await ctx.canvas.send(canvas, { name: 'cartao.png' });
|
|
69
|
+
```
|
|
70
|
+
|
|
71
|
+
Esta rota executa Skia no próprio processo, sem isolamento — reserve-a para
|
|
72
|
+
código do bot. O function mode (`$canvas*`) e o builder de
|
|
73
|
+
`yuzuha/canvas/card` continuam renderizando em processo filho com prazo,
|
|
74
|
+
limites e orçamento de processos.
|
|
22
75
|
|
|
23
76
|
## Um cartão nativo
|
|
24
77
|
|
|
@@ -67,14 +120,16 @@ bot.contextEvent({
|
|
|
67
120
|
|
|
68
121
|
## Uso independente
|
|
69
122
|
|
|
70
|
-
`
|
|
123
|
+
`createCard()` de `yuzuha/canvas/card` cria o mesmo builder sem contexto de bot
|
|
124
|
+
(na 0.3.0, o antigo `createCanvas()` de `yuzuha/canvas` virou a API napi;
|
|
125
|
+
migre para `createCard`):
|
|
71
126
|
|
|
72
127
|
```ts
|
|
73
|
-
import {
|
|
128
|
+
import { createCard } from 'yuzuha/canvas/card';
|
|
74
129
|
import { readFile, writeFile } from 'node:fs/promises';
|
|
75
130
|
|
|
76
131
|
const avatar = new Uint8Array(await readFile('./avatar.png'));
|
|
77
|
-
const image = await
|
|
132
|
+
const image = await createCard(640, 240, { scale: 2, background: '#101722' })
|
|
78
133
|
.avatar(avatar, { x: 24, y: 56, size: 128 })
|
|
79
134
|
.text('Perfil demonstrativo', { x: 184, y: 64, maxWidth: 420, fontSize: 36, weight: 700 })
|
|
80
135
|
.render();
|
|
@@ -83,7 +138,7 @@ await writeFile('./perfil.png', image.data);
|
|
|
83
138
|
|
|
84
139
|
Para buscar fontes ou imagens remotas no uso independente, passe `http` e,
|
|
85
140
|
opcionalmente, `signal`, `assets`, `fonts` e `timeoutMs` nas opções de
|
|
86
|
-
`
|
|
141
|
+
`createCard`. Sem `http`, fontes remotas são recusadas. Não são aceitos
|
|
87
142
|
caminhos, `file:` ou data URLs.
|
|
88
143
|
|
|
89
144
|
## Builder
|
package/docs/EDITOR.md
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
A extensão VS Code da 0.1.5 fornece autocomplete com argumentos em snippets,
|
|
4
4
|
hover, assinatura/argumento ativo e diagnósticos durante a edição. Reconhece arquivos
|
|
5
5
|
`.yz`/`.yuzuha` e strings JS/TS, incluindo JSX/TSX. Os metadados vêm do mesmo
|
|
6
|
-
registro usado pelo runtime e pela [referência de funções](FUNCTIONS.md).
|
|
6
|
+
registro usado pelo runtime e pela [referência de funções](functions/FUNCTIONS.md).
|
|
7
7
|
|
|
8
8
|
## Usar a extensão
|
|
9
9
|
|
package/docs/FRAMEWORK.md
CHANGED
|
@@ -155,10 +155,9 @@ lazy e memoizados, inclusive promessas. `call.ctx` expõe o contexto e
|
|
|
155
155
|
|
|
156
156
|
Plugins podem incluir `commands`, `events` e `middleware`. A instalação valida
|
|
157
157
|
o lote antes de alterar os registros; funções do próprio plugin já são
|
|
158
|
-
consideradas ao compilar seus scripts.
|
|
159
|
-
os builtins são registrados antes da compilação. Nomes de plugin, funções e comandos não
|
|
158
|
+
consideradas ao compilar seus scripts. Nomes de plugin, funções e comandos não
|
|
160
159
|
podem colidir nos respectivos registros. Também é
|
|
161
|
-
possível usar `bot.
|
|
160
|
+
possível usar `bot.engine.registerAll(...)` diretamente.
|
|
162
161
|
Registre as funções antes de carregar comandos que as utilizam.
|
|
163
162
|
|
|
164
163
|
## Middleware
|
package/docs/HTTP.md
CHANGED
|
@@ -140,7 +140,7 @@ Os erros incluem `HTTP_HOST`, `HTTP_PRIVATE`, `HTTP_TIMEOUT`,
|
|
|
140
140
|
`HTTP_POLICY`. Cancelamento externo produz `EXECUTION_ABORTED` e não pode ser
|
|
141
141
|
capturado por `$try`.
|
|
142
142
|
|
|
143
|
-
Veja [guia nativo](NATIVE.md) e [referência de funções](FUNCTIONS.md).
|
|
143
|
+
Veja [guia nativo](NATIVE.md) e [referência de funções](functions/FUNCTIONS.md).
|
|
144
144
|
|
|
145
145
|
## Streaming em scripts
|
|
146
146
|
|
package/docs/IMAGES.md
CHANGED
|
@@ -71,7 +71,8 @@ transformação não compõe cenas nem oferece texto, fontes ou acesso ao filesy
|
|
|
71
71
|
|
|
72
72
|
O peer opcional permite usar o restante do Yuzuha sem instalar Sharp. Para compor
|
|
73
73
|
cartões com texto, avatares, fontes, gradientes, badges ou barras, use o módulo
|
|
74
|
-
separado [`yuzuha/canvas`](CANVAS.md), que tem seu próprio peer opcional
|
|
74
|
+
separado [`yuzuha/canvas`](CANVAS.md), que tem seu próprio peer opcional —
|
|
75
|
+
`yuzuha/canvas/card` para o builder de cartões. Sharp
|
|
75
76
|
transforma uma imagem existente; Canvas monta uma cena nova. Ambos compartilham
|
|
76
77
|
o limite de dois processos simultâneos. O sistema
|
|
77
78
|
operacional e a arquitetura precisam ser suportados pelos binários da versão
|
package/docs/NATIVE.md
CHANGED
|
@@ -187,6 +187,15 @@ Yuzuha. Chamadas diretas ao client exigem mocks ou fixtures próprios.
|
|
|
187
187
|
importar `Events`, `AttachmentBuilder`, `EmbedBuilder` e os tipos do Fluxer.js.
|
|
188
188
|
A assinatura completa dessas classes pertence ao SDK fixado em 3.3.0.
|
|
189
189
|
|
|
190
|
+
Os subpaths do SDK também são espelhados: `yuzuha/sdk/client`, `yuzuha/sdk/errors`,
|
|
191
|
+
`yuzuha/sdk/message`, `yuzuha/sdk/cluster` e `yuzuha/sdk/internal` equivalem aos
|
|
192
|
+
caminhos homônimos de `@fluxerjs/core`. Os pacotes satélites aparecem como
|
|
193
|
+
`yuzuha/sdk/types` (com `yuzuha/sdk/types/routes`), `yuzuha/sdk/rest` (com
|
|
194
|
+
`yuzuha/sdk/rest/request-manager`), `yuzuha/sdk/ws`, `yuzuha/sdk/builders`,
|
|
195
|
+
`yuzuha/sdk/collection` e `yuzuha/sdk/util`. `yuzuha/sdk/voice` e
|
|
196
|
+
`yuzuha/sdk/sharding` reexportam os pacotes opcionais homônimos e só funcionam
|
|
197
|
+
quando o peer correspondente está instalado.
|
|
198
|
+
|
|
190
199
|
## Recursos nativos
|
|
191
200
|
|
|
192
201
|
As funções `$...` de usuários, cargos, canais, mensagens, coletores, webhooks,
|
|
@@ -203,20 +212,27 @@ await ctx.reply(`${membro.displayName}: ${canais.length} canais, ${fixadas.lengt
|
|
|
203
212
|
|
|
204
213
|
| Área | Operações principais |
|
|
205
214
|
|---|---|
|
|
206
|
-
| `users` | `user`, `member`, `members`, `memberCount`, `guild`, `bans`, `auditLogs`, `setPresence`, `searchMembers`, `setNickname`, `editGuild` |
|
|
207
|
-
| `roles` | `list`, `resolve`, `has`, `create`, `edit`, `delete`, `add`, `remove`, `move` |
|
|
208
|
-
| `channels` | `list`, `get`, `create`, `edit`, `delete`, `setSlowmode`, `overwrite`, `permissionsFor`, `move`, `setCategory` |
|
|
209
|
-
| `messages` | Histórico com cursores, `pinnedPage`, `reactionUsersPage`, `dm`, `forward`, `search` com filtros avançados, `sendFiles`, `sendBytes`, `sendAttachments` |
|
|
210
|
-
| `collectors` | `awaitMessage`, `awaitReaction` |
|
|
211
|
-
| `
|
|
212
|
-
| `
|
|
213
|
-
| `
|
|
215
|
+
| `users` | `user`, `member`, `members`, `memberCount`, `guild`, `bans`, `auditLogs`, `setPresence`, `searchMembers`, `setNickname`, `editGuild`, `me`, `transferOwnership`, `discoveryStatus`, `applyForDiscovery`, `editDiscoveryApplication`, `withdrawDiscoveryApplication` |
|
|
216
|
+
| `roles` | `list`, `resolve`, `has`, `create`, `edit`, `delete`, `add`, `remove`, `move`, `setRoleHoistPositions`, `resetRoleHoistPositions` |
|
|
217
|
+
| `channels` | `list`, `get`, `create`, `edit`, `delete`, `setSlowmode`, `slowmode`, `sendTyping`, `rtcRegions`, `addRecipient`/`removeRecipient` em grupos de DM, `editThreadDefaults`, `setDefaultForumLayout`, `overwrite`, `permissionsFor`, `move`, `setCategory` |
|
|
218
|
+
| `messages` | Histórico com cursores, `pinnedPage`, `reactionUsersPage`, `dm`, `forward`, `search`/`searchAll` com filtros avançados, `bulkFetch`, `bulkDelete`, `bulkDeleteOwn`, `acknowledgePins`, `clearReadState`, `purgeDM`, `deleteAttachment`, `sendTo`, `sendFiles`, `sendBytes`, `sendAttachments` |
|
|
219
|
+
| `collectors` | `awaitMessage`, `awaitReaction`, streams `collectMessages`/`collectReactions` (AsyncIterable) |
|
|
220
|
+
| `gateway` | `requestMembers`, `requestGuildCounts`, `requestChannelCounts`, `requestForumUnreads`, `subscribeThreads`, `send` (fire-and-forget) |
|
|
221
|
+
| `instance` | `describe`, `gatewayInfo`, `application`, `oauthApplications`, `emojiMetadata`, `stickerMetadata`, `resolveEmoji` |
|
|
222
|
+
| `self` | `fetch`, `guilds`, `leaveGuild` e `deleteMyMessages` com verificação sudo |
|
|
223
|
+
| `cache` | `stats`, `sweepMessages`, `sweepMembers`, `sweepUsers`, `sweepChannels`, `sweepGuilds`, `cascadeChannel`, `cascadeGuild` |
|
|
224
|
+
| `webhooks` | `list`, `create`, `send`, `edit`, `delete`, `editMessage`, `deleteMessage` |
|
|
225
|
+
| `expressions` | CRUD de emojis/stickers, `createEmojisBulk`, `createStickersBulk`, `cloneEmoji`, `cloneSticker` |
|
|
226
|
+
| `threads` | `create`, `archive`, `unarchive`, `forumPost`, `addMember`, `removeMember`, `members`, `member`, `edit`, `join`, `leave`, `setLocked`, `editSelf`, `editDefaults`, `search` |
|
|
214
227
|
| `invites` | `get`, `create`, `delete`, `list`, `vanity`, `setVanity` |
|
|
215
228
|
|
|
229
|
+
`purgeDM` em canais de anotações pessoais (tipo 999) só pode ser chamado por
|
|
230
|
+
`bot.resources`, sem wrapper de autorização.
|
|
231
|
+
|
|
216
232
|
Os retornos são objetos normalizados e serializáveis (`UserInfo`, `MemberInfo`,
|
|
217
233
|
`MessageInfo` etc.), não instâncias do SDK. Isso mantém os mesmos dados nos
|
|
218
234
|
scripts, nos testes e no contexto nativo. Para métodos não cobertos, use
|
|
219
|
-
`ctx.client`; a lista de lacunas está em [FUNCTION-GAPS.md](FUNCTION-GAPS.md).
|
|
235
|
+
`ctx.client`; a lista de lacunas está em [FUNCTION-GAPS.md](functions/FUNCTION-GAPS.md).
|
|
220
236
|
|
|
221
237
|
`messages.pinnedPage(canal, { limit, before })` mantém a ordem de fixação e retorna
|
|
222
238
|
`messages`, `pinnedAt`, `hasMore` e `nextBefore`. `messages.reactionUsersPage`
|
|
@@ -252,9 +268,23 @@ o SDK. `$createEmoji[nome;url]` faz o download e a conversão com `ctx.http`;
|
|
|
252
268
|
`$createSticker` recebe base64 diretamente. Edição de sticker suporta nome,
|
|
253
269
|
descrição e motivo; tags são aceitas na criação.
|
|
254
270
|
|
|
255
|
-
|
|
256
|
-
`
|
|
257
|
-
|
|
271
|
+
`collectors.collectMessages` e `collectors.collectReactions` retornam um
|
|
272
|
+
`AsyncIterable` que emite cada item coletado até o limite (`timeMs`, `max` ou
|
|
273
|
+
`signal`) ou o cancelamento do comando. Reações exigem `messageID`: o coletor do
|
|
274
|
+
SDK é por mensagem. Iteradores são de uso único; cada chamada cria um novo stream.
|
|
275
|
+
|
|
276
|
+
`messages.bulkFetch` agrupa pedidos de janela por canal e hidrata as mensagens
|
|
277
|
+
por padrão; `hydrate: false` devolve os payloads brutos da API. `searchAll` é a
|
|
278
|
+
busca global do client com os mesmos filtros e paginação de `search`.
|
|
279
|
+
|
|
280
|
+
`gateway` envia pedidos brutos ao gateway sem aguardar resposta — os resultados
|
|
281
|
+
chegam pelos eventos do client. `users.guildCounts` e `users.channelCounts`
|
|
282
|
+
continuam sendo o caminho quando se espera o valor de volta.
|
|
283
|
+
|
|
284
|
+
Implementações próprias dos contratos `Resources` devem fornecer as áreas
|
|
285
|
+
`gateway`, `instance`, `self` e `cache` além das anteriores; `CollectorsResources`
|
|
286
|
+
ganhou `collectMessages`/`collectReactions` e `MessagesResources` ganhou
|
|
287
|
+
`searchAll`/`bulkFetch`. Para testes que exercitam apenas parte dos recursos,
|
|
258
288
|
use `mockResources`, que aceita implementações parciais por método.
|
|
259
289
|
|
|
260
290
|
## Membros, mensagens e transações
|
|
@@ -593,8 +623,9 @@ conflitos de comandos/funções e eventos inválidos são rejeitados antes de
|
|
|
593
623
|
registrar as capacidades do plugin.
|
|
594
624
|
|
|
595
625
|
O comando nativo e o comando com `code` usam a mesma registry: nomes e aliases
|
|
596
|
-
não podem disputar o mesmo espaço.
|
|
597
|
-
|
|
626
|
+
não podem disputar o mesmo espaço. Comandos com `code` e eventos de script
|
|
627
|
+
exigem um engine instalado: `engine: functions()` nas opções ou `bot.useEngine(...)`.
|
|
628
|
+
Plugins não constituem um sandbox de JS/TS;
|
|
598
629
|
seu código tem as permissões normais do processo Node.
|
|
599
630
|
|
|
600
631
|
A [referência do framework](FRAMEWORK.md) detalha carregamento de diretórios,
|