Bonfire.Boundaries.API.GraphQLMasto.Adapter (Bonfire v1.0.1-social-alpha.28)

View Source

Mutes/Blocks API endpoints for Mastodon-compatible client apps, powered by the GraphQL API

Summary

Functions

Add accounts to a list.

Block an account

List blocked accounts for current user

Build a Mastodon Relationship object by querying actual state. This is used by both block/mute endpoints and the relationships endpoint.

Create a new list.

Get accounts in a list.

Get the timeline for a list (posts from list members).

Get all lists owned by the authenticated user.

Mute an account

List muted accounts for current user

Remove accounts from a list.

Get a specific list by ID.

Unblock an account

Unmute an account

Update a list (change title).

Functions

add_to_list(id, params, conn)

Add accounts to a list.

Expects account_ids param with an array of account IDs to add.

Endpoint: POST /api/v1/lists/:id/accounts

block_account(map, conn)

Block an account

blocks(params, conn)

List blocked accounts for current user

build_relationship(current_user, target_id)

Build a Mastodon Relationship object by querying actual state. This is used by both block/mute endpoints and the relationships endpoint.

create_list(params, conn)

Create a new list.

Endpoint: POST /api/v1/lists

delete_list(id, params, conn)

Delete a list.

Endpoint: DELETE /api/v1/lists/:id

do_block_user(conn, id)

do_mute_user(conn, id)

do_unblock_user(conn, id)

do_unmute_user(conn, id)

graphql(conn_or_socket, name \\ nil, params \\ %{})

list_accounts(id, params, conn)

Get accounts in a list.

Returns an array of Mastodon Account objects for all members of the list.

Endpoint: GET /api/v1/lists/:id/accounts

list_timeline(list_id, params, conn)

Get the timeline for a list (posts from list members).

Returns statuses from accounts in the specified list. Delegates to Social adapter's feed function with subject_circles filter.

Endpoint: GET /api/v1/timelines/list/:list_id

lists(params, conn)

Get all lists owned by the authenticated user.

Returns an array of Mastodon List objects. System circles (built-in and stereotypes like followers/blocked) are filtered out, only user-created circles are returned.

Endpoint: GET /api/v1/lists

liveql(socket, name \\ nil, params \\ %{})

mute_account(map, conn)

Mute an account

mutes(params, conn)

List muted accounts for current user

remove_from_list(id, params, conn)

Remove accounts from a list.

Expects account_ids param with an array of account IDs to remove.

Endpoint: DELETE /api/v1/lists/:id/accounts

show_list(id, params, conn)

Get a specific list by ID.

Endpoint: GET /api/v1/lists/:id

unblock_account(map, conn)

Unblock an account

unmute_account(map, conn)

Unmute an account

update_list(id, params, conn)

Update a list (change title).

Endpoint: PUT /api/v1/lists/:id