connections module acts on the logged-in user’s own mutual connections — bidirectional relationships, similar to “friends.” Use it to list accepted connections, inspect outgoing and incoming pending requests, and accept, decline, or remove connections.
fetchConnections
Returns a paginated list of your accepted connections.Results per page: a whole number from
1 to 100. Defaults to 20. A larger value is rejected with 400 connection/invalid-query, never lowered to 100.Optional search term. Filters the list to connections whose other user’s username or name contains this text (case-insensitive). When omitted, no filtering is applied.
Restricts which field
query matches against — username or name. When omitted, query matches either field.Promise<PaginatedResponse<AcceptedConnectionRow>>, where AcceptedConnectionRow is { id, user, status: "accepted", createdAt, respondedAt } and user is the other user in the connection.
fetchConnectionsCount
Returns the number of your accepted connections.Promise<{ count: number }>
fetchSentPendingConnections
Returns a paginated list of your outgoing connection requests that are still pending.Results per page: a whole number from
1 to 100. Defaults to 20. A larger value is rejected with 400 connection/invalid-query, never lowered to 100.Promise<PaginatedResponse<ConnectionRow>>, where ConnectionRow is { id, user, type, message, status, createdAt, respondedAt }. Here user is the user the request was sent to, type is "sent", status is "pending" and respondedAt is null.
fetchReceivedPendingConnections
Returns a paginated list of incoming connection requests you have received.Results per page: a whole number from
1 to 100. Defaults to 20. A larger value is rejected with 400 connection/invalid-query, never lowered to 100.Promise<PaginatedResponse<ConnectionRow>>. Here user is the user who sent the request, type is "received", status is "pending" and respondedAt is null.
acceptConnection
Accepts a pending incoming connection request.Promise<ConnectionRow>: the accepted connection from your side (user is the requester, type is "received", status is "accepted"). See ConnectionRow.
declineConnection
Declines a pending incoming connection request.Promise<ConnectionRow>: the declined connection from your side (user is the requester, type is "received", status is "declined"). See ConnectionRow.
removeConnection
Removes a connection by its connection ID: withdraws a pending request you sent, or disconnects an accepted connection (either user can).Promise<void>. It resolves with no value once the connection is removed (the server answers 204 No Content).
