View Source API Reference Bonfire v0.9.10-classic-beta.156

Modules

Supports use of GraphQL documents from with app containing the Absinthe schema

ActivityPub Library for elixir.

An ActivityPub Actor type and functions for dealing with actors.

Contract for ActivityPub module adapters

Handles fetching AS2 objects from remote instances.

Module for building and performing HTTP requests.

Specifies connection options for HTTP requests

Rate limit middleware for Tesla using Hammer Based on TeslaExtra.RateLimit and TeslaExtra.RetryAfter

Helper functions for building HTTP requests

Takes into account the Retry-After header returned by the server when the rate limit is exceeded.

Defines the contract used by federation implementations to publish messages to their peers.

This module normalises outgoing data to conform with AS2/AP specs and handles incoming objects and activities

Serves and fetches data (mainly actor URI) necessary for federation when only the username and host is known.

Helpers for workers to use

Instances context.

Message Rewrite Facility

Filter activities depending on their origin instance or other criteria.

Prunes objects from the database.

The worker to prune old data from the database.

Contains queries for Object.

This module contains some useful functions for containing objects to specific origins and determining those origins. They previously lived in the ActivityPub Transformer module.

Handles RSA keys for Actors & helpers for HTTP signatures

Implementation for behaviour from HTTPSignatures library

Misc functions used for federation

The entrypoint for defining your web interface, such as controllers, views, channels and so on.

Endpoints for serving objects and collections, so the ActivityPub API can be used to read information from the server.

Conveniences for translating and building error messages.

Standard error view

Endpoints for the ActivityPub inbox

Ensures HTTP signature has been validated by previous plugs on ActivityPub requests.

Generate SVG avatars from a string seed. It should always return the same avatar for the corresponding seed.

A handful of (mostly) arrow macros with superpowers.

GraphQL Introduction

Go to http://your-instance-url/api/ to start playing with the GraphQL API. The GraphiQL UI should autocomplete types, queries and mutations for you, and you can also explore the schema there.

The Json scalar type allows arbitrary JSON values to be passed in and out. Requires { :jason, "~> 1.1" } package: https://github.com/michalmuskala/jason

Information about this page's relation to a larger result set

GraphQL Plug to add current user to the context

Helpful functions for preparing to query or test Absinthe applications.

Encapsulates the flow for resolving a field in the absence of multiple parents.

Encapsulates the flow for resolving a field for potentially multiple parents.

Encapsulates the flow of resolving a page in the presence of a single parent. We also currently use this as a stopgap while we finish implementing some things, trading speed for correctness.

Encapsulates the flow of resolving a page in the presence of a single parent. We also currently use this as a stopgap while we finish implementing some things, trading speed for correctness.

Encapsulates the flow of resolving a page in the absence of parents.

Bonfire's boundaries framework provides a flexible way to control user access to specific actions and data. It ensures that users can only see and do what they're authorized to.

Provides functionality for managing Access Control Lists (ACLs) in the Bonfire system.

Handles blocking of users and instances

Functions to create, query, and manage circles, which are used to group users (for the purpose of control access to various resources).

An object is linked to one or more Acls by the Controlled multimixin, which pairs an object ID with an ACL ID. Because it is a multimixin, a given object can have multiple ACLs applied. In the case of overlap, permissions are combined with false being prioritised.

Debug utilities for Bonfire Boundaries.

Provides functions to create default boundary fixtures for the instance.

A grant defines a permission (value boolean on a Verb) for a subject, within the context of an Acl. It defines the access rights for a specific user or circle in relation to a particular action.

Helpers for writing common boundary-related queries, particularly for applying access control to queries.

Roles are groups of verbs associated with permissions. While not stored in the database, they are defined at the configuration level to enhance readability and user experience.

View that facilities the querying of objects' boundaries. See Bonfire.Boundaries.Queries for how it is used.

Reads fixtures in configuration and creates a default boundaries setup for a user

This module structures the information about the default boundaries for a newly created user before they are inserted in the database. It takes care of reading the configuration about the default boundaries and prepare the information for the Bonfire.Boundaries.Users module.

Verbs represent actions users can perform, such as reading a post or replying to a message. Each verb has a unique ID and are defined in configuration.

An extension for Bonfire that handles

An extension for Bonfire that handles

A mixin used to record parent/child relationships between categories (eg. a topic that belongs to a group) and between objects and categories (eg. a post was published in a topic)

A library of common utils and helpers used across Bonfire extensions.

Module to load the service adapter defined inside the configuration.

Integration with Akismet.com for spam detection

Mock for Anti-spam Provider implementations.

Provider Behaviour for anti-spam detection.

Simple way to measure the execution time of functions. It is preferred to use @decorate from Untangle instead.

Helpers for caching data and operations

Helpers to get app/extension OTP config, or to override a config key. Basically a wrapper of Application.get_env/3 and Application.put_env/3.

Loads instance Settings from DB into Elixir's Config

A global cache of runtime config modules to be loaded at app startup.

Find a context or query module via its schema, backed by a global cache of known modules.

Date/time helpers

Helper to extract data nested in an object

Extra functions to manipulate enumerables, basically an extension of Enum

Helpers for handling error messages and exceptions

Helpers for using and managing the extensibility of Bonfire, such as checking if a module or extension is enabled or hot-swapped, or loading code or docs. See also Bonfire.Common.Extensions.

A Global cache of known Behaviours in Bonfire

A global cache of known Bonfire extensions and their metadata.

Helpers for managing Bonfire extensions, e.g., enabling/disabling a module or extension, or listing available extensions and their metadata.

Provides functionality to generate and parse diffs from git repositories.

Module for building and performing HTTP requests.

Specifies connection options for HTTP requests

Helper functions for building HTTP requests

Various helpers for localisation

Provides the core functions to retrieve and manage the CLDR data that supports formatting and localisation.

Parses HTTP Accept-Language header values as defined in rfc2616.

Data functions to retrieve localised calendar information.

Interval formats allow for software to format intervals like "Jan 10-12, 2008" as a shorter and more natural format than "Jan 10, 2008 - Jan 12, 2008". They are designed to take a start and end date, time or datetime plus a formatting pattern and use that information to produce a localized format.

Manages the Date, TIme and DateTime formats defined by CLDR.

Implements the compilation and execution of date, time and datetime formats.

Interval formats allow for software to format intervals like "Jan 10-12, 2008" as a shorter and more natural format than "Jan 10, 2008 - Jan 12, 2008". They are designed to take a start and end date, time or datetime plus a formatting pattern and use that information to produce a localized format.

Interval formats allow for software to format intervals like "Jan 10-12, 2008" as a shorter and more natural format than "Jan 10, 2008 - Jan 12, 2008". They are designed to take a start and end date, time or datetime plus a formatting pattern and use that information to produce a localized format.

Cldr backend module that formats lists.

Backend module that provides functions to define new locales and display human-readable locale names for presentation purposes.

Manages the display name data for language tags and presents a public API for rendering display names for locales.

Formats numbers and currencies based upon CLDR's decimal formats specification.

Implements cardinal plural rules for numbers.

Functions to manage the collection of number patterns defined in Cldr.

Implements ordinal plural rules for numbers.

Implements plural rules for ranges

Transliteration for digits and separators.

Functions to implement the number system rule-based-number-format rules of CLDR.

Functions to implement the ordinal rule-based-number-format rules of CLDR.

Functions to implement the spellout rule-based-number-format rules of CLDR.

Interval formats allow for software to format intervals like "Jan 10-12, 2008" as a shorter and more natural format than "Jan 10, 2008 - Jan 12, 2008". They are designed to take a start and end date, time or datetime plus a formatting pattern and use that information to produce a localized format.

Supports the CLDR Units definitions which provide for the localization of many unit types.

Default Gettext module It is recommended to use the more convenient macros in Bonfire.Common.Localise.Gettext.Helpers instead.

A module providing Internationalization with a gettext-based API.

Defines a plural forms module for Gettext that uses CLDR plural rules https://cldr.unicode.org/index/cldr-spec/plural-rules

Helpers for handling images and other media

This module implements a GenServer that monitors the memory usage of a process. It periodically checks the memory consumption.

Helpers for declaring the existence of an extension (i.e., so it gets included in extension settings and nav).

Utility to clone a module under a new name

Helpers for handling Needle Pointers

Helpers for preloading Needle Pointer associations. See also Bonfire.Common.Repo.Preload

Helpers for querying Needle types/tables

Helpers to handle functions' opts parameter (usually a Keyword list)

Pub/sub helpers for subscribing and broadcasting to topics

Properly query some data using the appropriate module depending on its schema. Back by a global cache of known query_modules to be queried by their schema, or vice versa.

Main Ecto Repo.

Helpers for deleting Ecto data

query_filter brings convenience and shortens the boilterplate of ecto queries

Helpers for preloading Ecto struct associations

Helper functions for changesets

Common functions useful in Ecto Repos

Config and helpers for this library

Find a context or query module via its schema, backed by a global cache of known schema modules to be queried by their schema, or vice versa (eg. via ContextModule).

Helpers to get app/extension settings, or to override a config key.

Loads instance Settings (see Bonfire.Common.Settings) from DB into OTP config / application env (see Bonfire.Common.Config)

Fake data generators

Open the console without starting the app: iex -S mix run --no-start or just imix run --no-start

This utility allows to get the same effect of using fcwatch | mix test --stale --listen-on-stdin to watch for code changes and run stale tests, but with more control and without the starting time penalty.

Special Ecto Repo used for federation testing.

Helpers for handling plain or rich text (markdown, HTML, etc)

Helpers for handling the type of objects (structs and more)

URI/URL/path helpers

Various very commonly used utility functions for the Bonfire application.

Conceptually, a complete list of all permissions for everybody. In practice, it's a partial specification, and anything not explicitly granted is assumed to be denied.

An object is linked to one or more Acls by the Controlled multimixin, which pairs an object ID with an ACL ID. Because it is a multimixin, a given object can have multiple ACLs applied. In the case of overlap, permissions are combined with false being prioritised.

A marker that identifies special context-dependent semantics to the system.

Federated instances

Federated actors or objects

A reusable table to link child or related items and also rank sibling items.

An account is an identity for authentication purposes. An account has one or more credentials with which it may identify.

A mixin for an account ID, indicating ownership

A mixin that stores a second factor secret to authenticate an account.

A recursive view of all entities taken care of by their root entities.

The entity responsible for something. In practice, it means that something is deleted when its caretaker is deleted.

A username mixin that denies reuse of the same or similar usernames even when the username has been deleted.

A Mixin that provides a password for local login.

A mixin that stores settings (of the instance, account, user, etc) as an Erlang Term (typically a map or keyword list) encoded to binary.

A custom Ecto type (based on EctoSparkles.JSONSerdeData) for handling the serialization of arbitrary data types stored as JSON data in the database. Requires the underlying DB field to be a map / JSONB field.

A persona. A person (account) may have more than one user, but this is not exposed publicly (except to local instance administrators), so it is as if they are different people.

A mixin for shared user personas (which multiple accounts can use)

A multimixin for an activity/object appearing in a feed.

Track seen/unseen (similar to read/unread, but only indicates that it was displayed in a feed or other listing for the user, not that they actually read it) status of things (usually an Activity)

Bonfire.Ecto contains Ecto transactional support as acts for Bonfire.Epics

An Act that enters a transaction unless it senses that it would be futile.

A placeholder marker used by Bonfire.Ecto.Acts.Begin to identify when to commit the transaction.

An act that performs queued up work in a transaction.

Epics are a extensible way of structuring tasks.

Represents an individual Act within an Epic.

Represents and manages an Epic, which is a sequence of Acts to be executed.

An extension for Bonfire that handles

Adapter functions delegated from the ActivityPub Library

Filter activities depending on their origin instance, actor, or other criteria

A automatically-generated global list of federation modules which can queried by activity and/or object type.

File management extension for Bonfire.

Saves uploaded files as attachments to the post.

An act that deletes media

Fetch and save metadata of URLs

Uploader for larger images, for example, a profile page banner.

Extension to Waffle.Definition, adding support for checking against media types parsed through magic bytes instead of file extensions, which can be modified by the user.

Uploader for larger images, for example, a profile page banner.

Resizes images at compile time (when possible) or runtime

An extension for Bonfire that handles

An extension for Bonfire to generate invite links

Bonfire.Label is a powerful and flexible extension designed to enhance content moderation and improve online safety. Inspired by the design principles outlined by Prosocial Design (specifically the Label Misleading Content & Add Links to Reliable Related Content pattern), this library enables the addition of custom labels and descriptions to user-generated posts.

Takes an object and label and returns a changeset for labeling that object. Implements Bonfire.Epics.Act.

Runs at compile-time to include dynamic strings (like verb names and object types) in localisation string extraction.

Email delivery is a crucial component of many web applications, including your Bonfire instance. It's used for various purposes such as

Functions for checking the validity of email addresses and domains

An extension for Bonfire that handles

An account represents a private identity within the system, and can have many User identities (see Bonfire.Me.Accounts). An account usually has an Bonfire.Data.Identity.Email and a Bonfire.Data.Identity.Credential user for login.

A changeset for changing an account's email address

A changeset for changing an account's password

A changeset for confirming an email address

A changeset for requesting a password reset

A changeset for logging in

Support for second-factor authentication. Powered by NimbleTOTP.

An act that deals with maintaining a Caretaker record for a changeset.

An act that deals with maintaining a Created record for a changeset.

Shared helpers for character types (such as User or Category)

Handles queued deletion of a user and its data.

Handles email sending functionality for accounts and users

Shared helpers for profiles (such as the profile of a User or Category)

Enables multiple people to share one identity, by associating one User with many Accounts. Context for Bonfire.Data.SharedUser

A User represents a visible identity within the system belonging to an Account (see Bonfire.Me.Accounts) and having a Profile (see Bonfire.Me.Profiles) and a Character identified by a username (see Bonfire.Me.Characters).

An extension for Bonfire that handles

An extension to enable

Basic CMS

Creates a changeset for publishing a page

Creates a changeset for publishing a section

An extensions for asking questions, collecting options, and conducting ranked voting on Bonfire

Creates a changeset for publishing choice(s) for a question

Creates a changeset for publishing a page

An extension for Bonfire that handles

Creates a changeset for publishing a post

An extension for Bonfire that handles

An extension for Bonfire to handle

An act that enqueues publish/update/delete requests to meilisearch via an oban job queue.

Handles matching of needs & offers

A way to have data seeds that work similarly to migrations.

An extension for Bonfire that handles

A special type of activity object that stores federated JSON data as-is.

Helpers to create or query (though that's usually done through Bonfire.Social.FeedActivities) activities, preload relevant associations, and otherwise massage activity-related data.

An Act (as specified by Bonfire.Epics) that translates creates an activity for a object (eg. post) or changeset.

An Act (as specified by Bonfire.Epics) that marks the sensitivity level of a object (eg. post) or changeset.

An Act (as specified by Bonfire.Epics) that translates an object (eg. a post) or changeset into some jobs for the AP publish worker. Handles creation, update and delete.

NOT USED - Finds a list of appropriate feeds into which to post.

An Act (as specified by Bonfire.Epics) that translates creates an activity for a object (eg. post) or changeset.

Delete something + specified associations with a changeset

An Act (as specified by Bonfire.Epics) that translates creates a the post contents for a object (eg. post) or changeset.

An Act (as specified by Bonfire.Epics) that marks the sensitivity level of a object (eg. post) or changeset.

An Act (as specified by Bonfire.Epics) that sets the thread and/or reply_to for a object (eg. post) or changeset.

Answers are just another kind of Bonfire.Social.Pins, please refer to that module.

Mutate or query bookmarks (similar to likes but only visible to the creator of the bookmark)

Mutate, query, and federate boosts (re-sharing an activity or object).

Shared helpers for modules that implemented Edges to mutate or query them, preload relevant associations, etc.

Helpers to create or query a feed's activities.

Helpers to create or query (though that's usually done through Bonfire.Social.FeedActivities) feeds.

Flagging functionality

An extension for Bonfire that handles

Implements aliases (i.e. "also known as") for characters in Bonfire.

Module for handling follow relationships in the Bonfire social graph.

Mutate, query, and federate likes (indicating appreciation for an activity or object).

Generic helpers for querying and mutating objects.

Mutate or query pins (which make an activity or object appear at the beginning of feeds or other lists).

Query, manipulate, and federate post contents. See also Bonfire.Social.Posts for directly handling posts.

Handles social requests (e.g. follows requests), including creating, accepting, ignoring, and managing requests.

Track seen/unseen status of things (usually Activities).

Helpers for tagging things. Mostly wrappers around functions in Bonfire.Tag and Bonfire.Classify extensions.

Handle mutating and querying discussion threads and replies.

An extension for Bonfire that handles tagging posts or other things

An act that optionally tags an object.

Functions to lookup and autocomplete tag names

GraphQL tag/category queries

A virtual schema used for hashtags

A mixin used for associating tags with an object

An act that optionally boosts an activity as a category. This is a way to auto-post in a category/group when tagged (and the author has permission).

A library of common utils and helpers used across Bonfire extensions

Conveniences for translating and building error messages.

Like a plug, but for a liveview

Like a plug, but for a liveview

Add items to extensions' navigation sidebar.

WIP for tracking online users. Used by PersistentLive

A special 'modal' for previewing objects from a feed without redirecting to a new view (so we can go back to where we were in the feed)

Settings nav & components

Find a smart input module via the object type(s) it can create, or vice versa. Backed by a global cache of known smart input modules.

Static-site generator which can take a list of URLs served by the current Phoenix server and output static HTML for them

Widgets: components that can be added to the dashboard or sidebards

An extension for Bonfire that handles

Pages and UI components for groups in Bonfire.

An extension for Bonfire that handles

Handles pushing activities (via PubSub) to active feeds and notifications

Upcycle supports a network of high school fablabs in Milwaukee that receive contributions of materials from organizations in the community and share these with each other. It is implemented as a UI for ValueFlows, which are both available as extensions for Bonfire. Upcycle was initially created for LearnDeep by students at MSOE, and is now being maintained by the Bonfire team.

Handy aliases and imports to add to your iex CLI session

Some helpers to sparkle on top of Ecto

Runs ecto migrations automatically on startup (add this to your app's supervision tree)

A behaviour implemented by our data migrations (generally backfills).

Configuration for a DataMigration behaviour module, used by the DataMigration.Runner.

Runs a DataMigration

A custom Ecto type for handling the serialization of arbitrary data types stored as binary data in the database. Requires the underlying DB field to be a binary.

A custom Ecto type for handling the serialization of arbitrary data types stored as JSON data in the database. Requires the underlying DB field to be a map / JSONB field.

Log Ecto queries, and output warnings for slow or possible n+1 queries

Checks a query against the previous one and increments counter of collisions or swaps previous query with the last one.

Provides functions for sanitising input on Ecto.Changeset string fields.

Minimal, composable file upload, storage, and streamed data migrations for Elixir apps, flexibly and with minimal dependencies.

Ecto integration for Entrepôt

A struct representing a stored file's location and metadata.

A behaviour module defining the interface for storage backends.

A protocol defining the interface for file uploads.

A behaviour module for implementing custom uploaders.

Phoenix helpers for using 100,000+ SVG icons from 100+ icon sets compiled by Iconify (visit that site to browse the sets available and preview the icons)

A Surface component for rendering icons using various methods.

One foreign key to rule them all and in the darkness, bind them. - Gandalf, paraphrased.

Helpers for writing Pointer-aware migrations.

If a Pointer represents an object, mixins represent data about the object. Mixins collate optional additional information about an object. Different types of object will typically make use of different mixins. You can see these as aspects of the data if you like.

We could not find the requested object

Sets up an Ecto Schema for a Pointable table.

A Pointer is any object that can be referenced by its id.

A context for working with Needle, a sort of global foreign key scheme.

A securely randomly generated UUID keyed table. Not pointable.

One Table to rule them all. A record of a table participating in the pointers abstraction - mandatory if participating.

A Global cache of Tables to be queried by their (Pointer) IDs, table names or Ecto Schema module names.

Has a UID primary key but is not pointable.

Sets up an Ecto Schema for a Virtual Pointable

Defines a paginator.

Defines a page.

Defines page page_info.

Track and record all the changes in your database. Revert back to anytime in history.

Serialization functions to create a version struct

Logging/inspecting data, and timing functions, with code location information.

ValueFlows is a Bonfire extension that implements ValueFlows for federated networks to conduct economic activities.

Catch-all migrations intended to be used to initialise new Bonfire apps. Add any new up/down ecto migrations in VF modules to the bottom of these two functions.

Schema for proposal, using Needle.Pointable

Voodoo is a drop-in replacement for the old-style Phoenix path helpers (before Phoenix.VerifiedRoutes was introduced) which is more convenient to use.

Mix Tasks

Creates an account in the database, automatically activated

(re)compiles dependencies.

Generates docs for your app and all of its deps

Extracts translations by recompiling the Elixir source code.

Generates secrets and prints to the terminal.

Promotes a user to an administrator

Creates an user in the database (and an account, automatically activated)

just mix bonfire.widget.new Bonfire.MyUIExtension.MyWidget