28 symbols from @neontechspace/fluxerly/effect
Functions#
createWebhookClient #
Create a webhook-only client for hosted Fluxer or an explicitly selected self-hosted instance, from { id, token } or redacted creation credentials
Validate the inputs locally without requests. The client copies the credential into its own redacted reference. Creation starts when the Effect executes. Closing its Scope shuts down the client. The Effect Clock available when creation executes owns this client's request queue and deadlines. Providing a different Clock around a later operation does not replace that owner Clock. The SDK does not persist the token, connect a gateway or authenticate as a bot. Reuse one client per credential to share request slots, queue limits and rate-limit waits. Invalid configuration is misuse and dies with Configuration, and other defects retain their Cause
createWebhookClient(
options: WebhookClientOptions
): Effect<WebhookClient, never, Scope>createWebhookClient(
options: WebhookClientOptions
): Effect<
WebhookClient, never, Scope
>Parameters
options-
WebhookClientOptions
- Returns
Effect<WebhookClient, never, Scope>
import { Effect } from "effect"
import { createWebhookClient } from "@neontechspace/fluxerly/effect"
export const webhookExample = (id: string, token: string) => Effect.scoped(Effect.gen(function* () {
const webhook = yield* createWebhookClient({ id, token })
const message = yield* webhook.send({ content: "Deploying…" })
return yield* webhook.editMessage(message.id, { content: "Deployed" })
}))
Interfaces#
Invites#
Inspect, create, list or revoke invite codes without joining their destinations
Methods return Effects and do not connect the gateway or cache invites. Reads retry eligible transient failures at most twice. Writes retry only confirmed 429 rejections. Fluxer checks destination visibility, invite permissions and capacity. Failures use Guild. Effects start when executed. Interruption waits for owned cleanup and defects remain in Cause. Closing clients fail with Client. Lost responses can leave mutations applied. Do not replay them blindly
interface Invitescreate#
Create an invite for an accessible channel, including an existing group direct message
Defaults are a new code, 86,400 seconds, unlimited uses and non-temporary membership. The result is invite metadata. The SDK does not send the code, create a group or add members. Cancellation cannot revoke an invite that was already created. After an unknown outcome, list the destination's invites before deciding whether to create again
create(
channelId: string,
input?: InviteCreate,
options?: AuditedRequestOptions
): Effect<InviteMetadata, GuildOperationFailure>create(
channelId: string,
input?: InviteCreate,
options?: AuditedRequestOptions
): Effect<
InviteMetadata,
GuildOperationFailure
>Parameters
channelId -
string inputoptional-
InviteCreate optionsoptional-
AuditedRequestOptions
- Fails with
delete#
Revoke an invite code, succeeding with no value after HTTP 204
Fluxer checks creator or management permissions. Existing members remain. A missing code is an error, not proof a previous delete succeeded
delete(
code: string,
options?: AuditedRequestOptions
): Effect<void, GuildOperationFailure>delete(
code: string,
options?: AuditedRequestOptions
): Effect<
void,
GuildOperationFailure
>Parameters
code-
string optionsoptional-
AuditedRequestOptions
- Returns
Effect<void, GuildOperationFailure>- Fails with
fetch#
Look up an invite code without using it or joining its destination
Pass the code, not its full URL. Expired, revoked or inaccessible codes fail remotely. Fluxer may normalize the case of a vanity code
fetch(
code: string,
options?: RequestOptions
): Effect<Invite, GuildOperationFailure>fetch(
code: string,
options?: RequestOptions
): Effect<
Invite,
GuildOperationFailure
>Parameters
code-
string optionsoptional-
RequestOptions
- Returns
Effect<Invite, GuildOperationFailure>- Fails with
fetchForChannel #
List a channel's management-visible invites in Fluxer's order
Channel permissions determine access. Concurrent changes can make the list stale, so it is not a stable snapshot
fetchForChannel(
channelId: string,
options?: RequestOptions
): Effect<readonly InviteMetadata[], GuildOperationFailure>fetchForChannel(
channelId: string,
options?: RequestOptions
): Effect<
readonly InviteMetadata[],
GuildOperationFailure
>Parameters
channelId -
string optionsoptional-
RequestOptions
- Returns
Effect<readonly InviteMetadata[], GuildOperationFailure>Effect< readonly InviteMetadata[], GuildOperationFailure >- Fails with
fetchForGuild #
List a community's management-visible invites with ManageGuild permission
The community's vanity invite is excluded
fetchForGuild(
guildId: string,
options?: RequestOptions
): Effect<readonly InviteMetadata[], GuildOperationFailure>fetchForGuild(
guildId: string,
options?: RequestOptions
): Effect<
readonly InviteMetadata[],
GuildOperationFailure
>Parameters
guildId -
string optionsoptional-
RequestOptions
- Returns
Effect<readonly InviteMetadata[], GuildOperationFailure>Effect< readonly InviteMetadata[], GuildOperationFailure >- Fails with
WebhookClient #
Send and manage one incoming webhook's messages using its webhook token
Follower webhooks have no exposed token and Fluxer rejects their token-authenticated operations with UNKNOWN_WEBHOOK. This client does not use a bot token, connect the gateway, cache resources or store tokens persistently
interface WebhookClientOperations start when executed and preserve unexpected faults/interruption. Cleanup defects stop retries and preserve any operation failure or interruption alongside the defect in Cause
Requests default to a 30-second total deadline across queue waits, rate-limit waits, retries and HTTP.
Confirmed HTTP 429 responses use this client's shared rate-limit state as described on Client.
Cancellation interrupts only that operation and awaits request/body cleanup, without rolling back remote effects
Errors contain only safe categories and status, never credential-bearing paths or upstream bodies
Successful JSON bodies are capped at 16 MiB of response-body bytes before parsing, not total heap usage. Oversized successes fail with reason response. A response failure after a mutation request was sent leaves an unknown outcome and never retries automatically
Other client caches are not updated by this token-only client
delete#
Delete this webhook remotely using its token, succeeding after HTTP 204
This does not close the client or release its local credential reference. Later requests normally fail with not because the token was revoked. Call shutdown separately to release the client's local resources
delete(
options?: RequestOptions
): Effect<void, WebhookOperationFailure>delete(
options?: RequestOptions
): Effect<
void,
WebhookOperationFailure
>Parameters
optionsoptional-
RequestOptions
- Returns
Effect<void, WebhookOperationFailure>- Fails with
deleteMessage #
Delete this webhook's message, succeeding with no value after HTTP 204
For a message in a thread, including a forum post, set options to the thread's ID. Success does not prove the message previously existed. A failure with an unknown outcome can leave the message deleted
deleteMessage(
messageId: string,
options?: WebhookMessageOperationOptions
): Effect<void, WebhookOperationFailure>deleteMessage(
messageId: string,
options?:
WebhookMessageOperationOptions
): Effect<
void,
WebhookOperationFailure
>Parameters
messageId -
string optionsoptional-
WebhookMessageOperationOptions
- Returns
Effect<void, WebhookOperationFailure>- Fails with
edit#
Change this webhook's name or avatar using its token and return metadata without credentials
To move it to another channel, use a bot client's webhooks. A failed or cancelled write can still have applied. This method does not close the client
edit(
input: WebhookTokenEdit,
options?: RequestOptions
): Effect<IncomingWebhook, WebhookOperationFailure>edit(
input: WebhookTokenEdit,
options?: RequestOptions
): Effect<
IncomingWebhook,
WebhookOperationFailure
>Parameters
input-
WebhookTokenEdit optionsoptional-
RequestOptions
editMessage #
Change this webhook's message and return its updated snapshot
A plain string replaces only the text, as shorthand for { content }. Omitted fields stay unchanged. Mentions default off and attachments cannot be replaced. A flags-only edit replaces only Message and Message, and 0 clears them. Crossposted, IsCrosspost and SourceMessageDeleted are server-managed. Those bits and VoiceMessage fail locally before dispatch. Embed input cannot resolve existing file references. For a message in a thread, including a forum post, set options to the thread's ID
editMessage(
messageId: string,
input: string | WebhookMessageEdit,
options?: WebhookMessageOperationOptions
): Effect<Message, WebhookOperationFailure>editMessage(
messageId: string,
input:
| string | WebhookMessageEdit,
options?:
WebhookMessageOperationOptions
): Effect<
Message,
WebhookOperationFailure
>Parameters
messageId -
string input-
string | WebhookMessageEdit optionsoptional-
WebhookMessageOperationOptions
- Fails with
fetch#
Fetch this incoming webhook's current metadata using its token, not bot authentication
Creator and private fields are not retained
fetch(
options?: RequestOptions
): Effect<IncomingWebhook, WebhookOperationFailure>fetch(
options?: RequestOptions
): Effect<
IncomingWebhook,
WebhookOperationFailure
>Parameters
optionsoptional-
RequestOptions
fetchMessage #
Fetch a message authored by this webhook in its current channel, using a decimal message ID
For a message in a thread, including a forum post, set options to the thread's ID. Eligible transient read failures have bounded retries
fetchMessage(
messageId: string,
options?: WebhookMessageOperationOptions
): Effect<Message, WebhookOperationFailure>fetchMessage(
messageId: string,
options?:
WebhookMessageOperationOptions
): Effect<
Message,
WebhookOperationFailure
>Parameters
messageId -
string optionsoptional-
WebhookMessageOperationOptions
- Fails with
send#
Send a webhook message and return the created message after Fluxer's HTTP response
A plain string sends only that text, as shorthand for { content }. The SDK uses wait=true, and mentions are disabled by default. A supplied nonce requests best-effort duplicate suppression for five minutes, not exactly-once delivery. Without a nonce, none is sent unless a forward source supplies one, and a nonce on both the message and its forward source fails before dispatch. Reply references can include files. Forward references preserve only the source snapshot and reject new content or uploads
send(
input: string | WebhookMessageInput,
options?: RequestOptions
): Effect<Message, WebhookOperationFailure>send(
input:
| string | WebhookMessageInput,
options?: RequestOptions
): Effect<
Message,
WebhookOperationFailure
>Set thread to post into an existing thread. In a forum or media channel, set thread, with optional
applied, to start a new post instead. The result is then the post's first message, whose channel is the
new post's ID. See Webhook for the rules that the SDK checks before dispatch
Each attachment supplies data bytes, a sized Blob or File source, or a finite stream with its exact size.
Metadata and data bytes are copied when execution starts, before waiting.
File and stream sources are read when the multipart upload begins, without copying or spooling.
Keep file data stable, and supply a fresh stream for each operation because a stream is consumed at most once and must deliver exactly its declared size.
Cleanup cancels unfinished readers and awaits lock release, without closing caller paths or FileHandles.
Multipart file uploads are streamed with a maximum of 50 MiB per file and share the configured upload-byte budget.
An attachment:// image or thumbnail URL must match one new upload whose filename maps to an image or video MIME type.
The flags input accepts only Message and Message.
Crossposted, IsCrosspost and SourceMessageDeleted are server-managed.
Those bits and VoiceMessage fail locally before dispatch
A failure with an unknown outcome can leave the message posted and is never replayed automatically.
A confirmed inline HTTP 429 can replay copied data bytes, but file and stream inputs fail with rate without being reopened or reread
Parameters
input-
string | WebhookMessageInput optionsoptional-
RequestOptions
- Fails with
shutdown#
Permanently stop this local client, reject new work, cancel active work and await transport cleanup
The client's token reference is released, but the remote webhook and caller-held credentials remain. Concurrent calls wait for the same pending cleanup. No expected failure is returned
shutdown(): Effect<void>- Returns
Effect<void>
Cleanup defects remain in the Cause
Webhooks#
Create and manage webhooks with the bot token, without a gateway connection
There is no webhook cache or hidden credential persistence, and no events are synthesized. Successful JSON responses are limited to 16 MiB before parsing. This is not a total memory limit. Malformed or larger responses fail with reason response. If a response fails after a write was sent, the write may still have applied. The SDK does not retry it automatically. Each Effect starts when executed, with Effect interruption and defects. The default total deadline, rest (30,000 ms unless configured), includes capacity, rate-limit and retry waits. Reads have bounded retries, and writes retry only after a confirmed rate-limit rejection. Shutdown rejects new work and awaits accepted request cleanup. Separate clients do not coordinate rate limits
interface Webhookscreate#
Create an incoming webhook in a text, voice or announcement channel using the bot's permissions
The result separates metadata from redacted credentials, which expose the token only through reveal. Credentials passed to create must remain private. An unknown outcome may have left the webhook created
create(
channelId: string,
input: WebhookCreate,
options?: AuditedRequestOptions
): Effect<CreatedWebhook, WebhookOperationFailure>create(
channelId: string,
input: WebhookCreate,
options?: AuditedRequestOptions
): Effect<
CreatedWebhook,
WebhookOperationFailure
>Parameters
channelId -
string input-
WebhookCreate optionsoptional-
AuditedRequestOptions
delete#
Delete an incoming webhook and revoke its credential, or delete a follower webhook to unfollow its source
Existing webhook messages remain. Fluxer emits Webhooks Update for the destination channel. The SDK does not synthesize that event. A failure does not restore a deleted follow or revoked credential
delete(
id: string,
options?: AuditedRequestOptions
): Effect<void, WebhookOperationFailure>delete(
id: string,
options?: AuditedRequestOptions
): Effect<
void,
WebhookOperationFailure
>Parameters
id-
string optionsoptional-
AuditedRequestOptions
- Returns
Effect<void, WebhookOperationFailure>- Fails with
edit#
Change the supplied incoming or follower webhook settings, including its destination channel
Followers can be renamed or moved to a text channel in the same community, but an avatar change fails with field avatar and Fluxer code INVALID_FORMAT. Incoming webhooks allow text, voice or announcement destinations. Moving emits Webhooks Update for the old and new channel. The SDK does not synthesize those events. Returned metadata excludes credentials. A failed response does not guarantee the changes were rolled back
edit(
id: string,
input: WebhookEdit,
options?: AuditedRequestOptions
): Effect<Webhook, WebhookOperationFailure>edit(
id: string,
input: WebhookEdit,
options?: AuditedRequestOptions
): Effect<
Webhook,
WebhookOperationFailure
>Parameters
id-
string input-
WebhookEdit optionsoptional-
AuditedRequestOptions
- Fails with
fetch#
Fetch incoming, follower or unknown-kind metadata by decimal ID, discarding any returned token
Follower sources are present only while they exist and the original creator can view them. Missing source metadata does not prove deletion. A missing webhook fails with reason not
fetch(
id: string,
options?: AuditedRequestOptions
): Effect<Webhook, WebhookOperationFailure>fetch(
id: string,
options?: AuditedRequestOptions
): Effect<
Webhook,
WebhookOperationFailure
>Parameters
id-
string optionsoptional-
AuditedRequestOptions
- Fails with
fetchForChannel #
List the channel's accessible incoming, follower and unknown-kind webhook metadata without pagination
fetchForChannel(
channelId: string,
options?: AuditedRequestOptions
): Effect<readonly Webhook[], WebhookOperationFailure>fetchForChannel(
channelId: string,
options?: AuditedRequestOptions
): Effect<
readonly Webhook[],
WebhookOperationFailure
>Parameters
channelId -
string optionsoptional-
AuditedRequestOptions
- Returns
Effect<readonly Webhook[], WebhookOperationFailure>Effect< readonly Webhook[], WebhookOperationFailure >- Fails with
fetchForGuild #
List the community's accessible incoming, follower and unknown-kind webhook metadata
Fluxer permissions determine visibility. Concurrent changes mean this is not a stable snapshot
fetchForGuild(
guildId: string,
options?: AuditedRequestOptions
): Effect<readonly Webhook[], WebhookOperationFailure>fetchForGuild(
guildId: string,
options?: AuditedRequestOptions
): Effect<
readonly Webhook[],
WebhookOperationFailure
>Parameters
guildId -
string optionsoptional-
AuditedRequestOptions
- Returns
Effect<readonly Webhook[], WebhookOperationFailure>Effect< readonly Webhook[], WebhookOperationFailure >- Fails with
Re-Exports#
Declared in JavaScript & TypeScript and documented there. Import them from @neontechspace/fluxerly/effect as well
Webhook#Type - Select a received webhook's shape by comparing its type with these constants
Channel#Follower Webhook - A webhook that delivers published messages from a followed announcement channel, selected by type ===
WebhookType .Channel Follower Created#Webhook - Result of creating a webhook, including the secret needed to use it without a bot token
Incoming#Webhook - A webhook that accepts token-authenticated operations, selected by type ===
WebhookType .Incoming Invite#Create - Set how long an invite lasts, how many times it can be used and whether Fluxer may reuse an existing code
Invite#Metadata - Invite details returned by creation and management lists, including creation time and use limits
Unknown#Webhook - A webhook kind this SDK version does not know, selected by type === "unknown"
Webhook#Base - Identity, appearance and destination shared by every received webhook kind, without credentials
Webhook#Create - Settings for a webhook that will post messages to the channel selected in the create call
Webhook#Credentials - The secret returned when an incoming webhook is created, kept separate from its public details
Webhook#Edit - Changes to an existing webhook made through a bot client's
webhooksoperation.edit Webhook#Forum Post Options - Settings for starting a new post in a forum or media channel through a webhook
Webhook#Forward Reference - Ask Fluxer to copy an existing message into a forwarded webhook message in the same channel
Webhook#Message Edit - Changes to a message previously sent by this webhook
Webhook#Reply Reference - Attach a webhook message as a reply to an existing message in the webhook's destination channel
Webhook#Source Channel - A frozen snapshot of a followed announcement channel
Webhook#Source Guild - A frozen snapshot of the community that owns a followed announcement channel
Webhook#Token Edit - Change an incoming webhook's default name or avatar through its token-only client
Webhook#- A frozen snapshot of a webhook's kind, appearance and destination when Fluxer last returned it
Webhook#Client Options - Credentials and limits for
createWebhook Client Webhook#Message Input - A message to send through a webhook client, using the webhook's token rather than a bot token
Webhook#Message Options - Delivery settings shared by new, reply and forward webhook messages
Webhook#Message Reference - Choose a reply with new content or a forward copied from an existing message when calling
webhook.send