Context for creating, updating, and selecting channel adapters.
Summary
Functions
Creates a channel adapter and atomically promotes it when is_default is true.
Gets an active channel adapter by id.
Returns the active default adapter for a channel, preferring the tenant default.
Lists channel adapters using optional tenant, channel, and active filters.
Selects the adapter for a step using explicit, rotation, sequence, and default fallbacks.
Selects the pinned outbound adapter, allowing a per-step override.
Updates a channel adapter and demotes the previous scoped default when needed.
Returns webhook routes exposed by active provider adapters.
Types
Functions
@spec create_channel_adapter(map()) :: {:ok, Ecto.Schema.t()} | {:error, Ecto.Changeset.t()}
Creates a channel adapter and atomically promotes it when is_default is true.
@spec get_active_adapter(Ecto.UUID.t() | binary()) :: Ecto.Schema.t() | nil
Gets an active channel adapter by id.
@spec get_default_adapter(binary() | atom(), binary() | nil) :: Ecto.Schema.t() | nil
Returns the active default adapter for a channel, preferring the tenant default.
@spec list_channel_adapters(list_filters()) :: [Ecto.Schema.t()]
Lists channel adapters using optional tenant, channel, and active filters.
@spec select(term(), term(), term()) :: {:ok, Ecto.Schema.t()} | {:error, %{kind: :permanent, reason: :no_adapter}}
Selects the adapter for a step using explicit, rotation, sequence, and default fallbacks.
@spec select_outbound(term(), term()) :: {:ok, Ecto.Schema.t()} | {:error, %{kind: :permanent, reason: :no_outbound_pin | :no_adapter}}
Selects the pinned outbound adapter, allowing a per-step override.
@spec update_channel_adapter(Ecto.Schema.t(), map()) :: {:ok, Ecto.Schema.t()} | {:error, Ecto.Changeset.t()}
Updates a channel adapter and demotes the previous scoped default when needed.
@spec webhook_routes() :: [DripDrop.Channel.webhook_route()]
Returns webhook routes exposed by active provider adapters.