DripDrop (DripDrop v0.1.0)

Copy Markdown View Source

Public entry point for DripDrop.

DripDrop is a backend-first, database-driven messaging sequence engine. The foundation currently exposes boot-time validation while the domain APIs are implemented capability by capability.

Summary

Functions

Activates a sequence version and archives the previously active version.

Adds an adapter to an outbound pool.

Creates an outbound adapter pool.

Creates a channel adapter.

Creates a condition attached to a step by default, or to a transition when transition_id is provided.

Creates an HTTP hook for a sequence.

Creates a sequence.

Creates a sequence version.

Creates a step in a sequence version.

Creates a transition in a sequence version.

Deletes an outbound adapter pool.

Enrolls a subscriber into the active version of a sequence.

Gets the active default adapter for a channel and tenant, falling back to the global default.

Gets an enrollment by sequence, subscriber identity, and explicit tenant scope.

Ingests a normalized inbound email from host-owned inbox infrastructure.

Lists active enrollments.

Lists outbound adapter pools.

Lists channel adapters.

Deprecated unscoped HTTP hook listing. Use list_http_hooks/2.

Lists HTTP hooks for a sequence and explicit tenant scope.

Lists outbound pool members.

Deprecated unscoped pause. Use pause_enrollment/2.

Pauses an enrollment scoped by tenant.

Removes an adapter from an outbound pool.

Reassigns an enrollment to a different outbound adapter.

Replays a failed step execution with a fresh idempotency key.

Deprecated unscoped resume. Use resume_enrollment/2.

Resumes an enrollment scoped by tenant.

Sets an adapter health state from a host-supplied external signal.

Creates or updates an outbound adapter sequence budget.

Validates the host application's DripDrop runtime configuration.

Creates or updates a suppression for a channel recipient.

Runs an HTTP hook out of band and stores its redacted test result.

Tracks an event by subscriber identity (tenant_key in the map) or deprecated unscoped enrollment id.

Tracks an event for a tenant-scoped enrollment id.

Deprecated unscoped cancel. Use unenroll/2.

Cancels an enrollment scoped by tenant.

Updates an outbound adapter pool.

Updates a channel adapter.

Updates an HTTP hook.

Validates a sequence version before activation.

Returns webhook routes declared by active channel adapters.

Functions

activate_sequence_version(version_id)

@spec activate_sequence_version(Ecto.UUID.t()) ::
  {:ok, Ecto.Schema.t()} | {:error, term()}

Activates a sequence version and archives the previously active version.

add_pool_member(pool_or_id, attrs)

@spec add_pool_member(Ecto.Schema.t() | Ecto.UUID.t(), map()) ::
  {:ok, Ecto.Schema.t()} | {:error, Ecto.Changeset.t()}

Adds an adapter to an outbound pool.

create_adapter_pool(attrs)

@spec create_adapter_pool(map()) ::
  {:ok, Ecto.Schema.t()} | {:error, Ecto.Changeset.t()}

Creates an outbound adapter pool.

create_channel_adapter(attrs)

@spec create_channel_adapter(map()) ::
  {:ok, Ecto.Schema.t()} | {:error, Ecto.Changeset.t()}

Creates a channel adapter.

create_condition(owner_id, attrs)

@spec create_condition(Ecto.UUID.t(), map()) ::
  {:ok, Ecto.Schema.t()} | {:error, Ecto.Changeset.t()}

Creates a condition attached to a step by default, or to a transition when transition_id is provided.

create_http_hook(sequence_id, attrs)

@spec create_http_hook(Ecto.UUID.t(), map()) ::
  {:ok, Ecto.Schema.t()} | {:error, Ecto.Changeset.t()}

Creates an HTTP hook for a sequence.

create_sequence(attrs)

@spec create_sequence(map()) :: {:ok, Ecto.Schema.t()} | {:error, Ecto.Changeset.t()}

Creates a sequence.

create_sequence_version(sequence_id, attrs)

@spec create_sequence_version(Ecto.UUID.t(), map()) ::
  {:ok, Ecto.Schema.t()} | {:error, Ecto.Changeset.t()}

Creates a sequence version.

create_step(version_id, attrs)

@spec create_step(Ecto.UUID.t(), map()) ::
  {:ok, Ecto.Schema.t()} | {:error, Ecto.Changeset.t()}

Creates a step in a sequence version.

create_step_transition(version_id, attrs)

@spec create_step_transition(Ecto.UUID.t(), map()) ::
  {:ok, Ecto.Schema.t()} | {:error, Ecto.Changeset.t()}

Creates a transition in a sequence version.

delete_adapter_pool(pool_or_id, opts)

@spec delete_adapter_pool(Ecto.Schema.t() | Ecto.UUID.t(), map() | keyword()) ::
  {:ok, Ecto.Schema.t()} | {:error, map()}

Deletes an outbound adapter pool.

enroll(attrs)

@spec enroll(map()) :: {:ok, Ecto.Schema.t()} | {:error, term()}

Enrolls a subscriber into the active version of a sequence.

get_default_adapter(channel, tenant_key)

@spec get_default_adapter(binary() | atom(), binary() | nil) :: Ecto.Schema.t() | nil

Gets the active default adapter for a channel and tenant, falling back to the global default.

get_enrollment(sequence_id, subscriber_type, subscriber_id)

@spec get_enrollment(Ecto.UUID.t(), binary(), binary()) :: no_return()

Deprecated unscoped enrollment lookup. Use get_enrollment/4.

get_enrollment(sequence_id, subscriber_type, subscriber_id, tenant_key)

@spec get_enrollment(Ecto.UUID.t(), binary(), binary(), binary() | nil) ::
  Ecto.Schema.t() | nil

Gets an enrollment by sequence, subscriber identity, and explicit tenant scope.

ingest_inbound_message(adapter_id_or_scope, normalized_message)

@spec ingest_inbound_message(Ecto.UUID.t() | map(), map()) :: :ok | {:error, term()}

Ingests a normalized inbound email from host-owned inbox infrastructure.

Example:

DripDrop.ingest_inbound_message(adapter.id, %{
  message_id: "reply@gmail.com",
  in_reply_to: "0197...@example.com",
  references: ["0197...@example.com"],
  from: "prospect@example.org",
  to: "sales@example.com",
  body_text: "Sure, let's talk.",
  received_at: DateTime.utc_now(),
  intent: :reply
})

Hosts can feed this from IMAP, Gmail API watches, or Microsoft Graph subscriptions after normalizing provider-specific payloads into this map.

list_active_enrollments(filters \\ %{})

@spec list_active_enrollments(map()) :: [Ecto.Schema.t()]

Lists active enrollments.

list_adapter_pools(filters)

@spec list_adapter_pools(map()) :: [Ecto.Schema.t()]

Lists outbound adapter pools.

list_channel_adapters(filters \\ %{})

@spec list_channel_adapters(map()) :: [Ecto.Schema.t()]

Lists channel adapters.

list_http_hooks(sequence_id)

@spec list_http_hooks(Ecto.UUID.t()) :: no_return()

Deprecated unscoped HTTP hook listing. Use list_http_hooks/2.

list_http_hooks(sequence_id, tenant_key)

@spec list_http_hooks(Ecto.UUID.t(), binary() | nil) :: [Ecto.Schema.t()]

Lists HTTP hooks for a sequence and explicit tenant scope.

list_pool_members(pool_or_filters)

@spec list_pool_members(Ecto.Schema.t() | Ecto.UUID.t() | map()) :: [Ecto.Schema.t()]

Lists outbound pool members.

pause_enrollment(enrollment_id)

@spec pause_enrollment(Ecto.UUID.t()) :: no_return()

Deprecated unscoped pause. Use pause_enrollment/2.

pause_enrollment(enrollment_id, tenant_key)

@spec pause_enrollment(Ecto.UUID.t(), binary() | nil) ::
  {:ok, Ecto.Schema.t()} | {:error, term()}

Pauses an enrollment scoped by tenant.

remove_pool_member(pool_or_id, attrs)

@spec remove_pool_member(Ecto.Schema.t() | Ecto.UUID.t(), map()) ::
  {:ok, Ecto.Schema.t()} | {:error, :not_found}

Removes an adapter from an outbound pool.

repin_enrollment(enrollment_id, new_adapter_id, opts \\ [])

@spec repin_enrollment(Ecto.UUID.t(), Ecto.UUID.t(), keyword() | map()) ::
  {:ok, Ecto.Schema.t()} | {:error, term()}

Reassigns an enrollment to a different outbound adapter.

replay(step_execution_id)

@spec replay(Ecto.UUID.t()) :: {:ok, Ecto.Schema.t()} | {:error, term()}

Replays a failed step execution with a fresh idempotency key.

resume_enrollment(enrollment_id)

@spec resume_enrollment(Ecto.UUID.t()) :: no_return()

Deprecated unscoped resume. Use resume_enrollment/2.

resume_enrollment(enrollment_id, tenant_key)

@spec resume_enrollment(Ecto.UUID.t(), binary() | nil) ::
  {:ok, Ecto.Schema.t()} | {:error, term()}

Resumes an enrollment scoped by tenant.

set_adapter_health(adapter_id, attrs)

@spec set_adapter_health(Ecto.UUID.t(), map()) ::
  {:ok, Ecto.Schema.t()} | {:error, term()}

Sets an adapter health state from a host-supplied external signal.

set_adapter_sequence_budget(adapter_id, sequence_version_id, attrs \\ %{})

@spec set_adapter_sequence_budget(Ecto.UUID.t(), Ecto.UUID.t(), map()) ::
  {:ok, Ecto.Schema.t()} | {:error, Ecto.Changeset.t()}

Creates or updates an outbound adapter sequence budget.

startup_check()

@spec startup_check() :: :ok | {:error, [DripDrop.StartupCheck.error()]}

Validates the host application's DripDrop runtime configuration.

This check is intended for host Application.start/2 callbacks after the host Repo, PgFlow supervisor, and custom channel registrations have been configured.

suppress(attrs)

@spec suppress(map()) :: {:ok, Ecto.Schema.t()} | {:error, Ecto.Changeset.t()}

Creates or updates a suppression for a channel recipient.

test_http_hook(hook_id, test_data)

@spec test_http_hook(Ecto.UUID.t(), map()) :: {:ok, term()} | {:error, term()}

Runs an HTTP hook out of band and stores its redacted test result.

track_event(identity, event_key, event_data)

@spec track_event(Ecto.UUID.t() | map(), binary(), map()) ::
  {:ok, Ecto.Schema.t()} | {:error, Ecto.Changeset.t()} | no_return()

Tracks an event by subscriber identity (tenant_key in the map) or deprecated unscoped enrollment id.

track_event(enrollment_id, event_key, event_data, tenant_key)

@spec track_event(Ecto.UUID.t(), binary(), map(), binary() | nil) ::
  {:ok, Ecto.Schema.t()} | {:error, Ecto.Changeset.t()}

Tracks an event for a tenant-scoped enrollment id.

unenroll(enrollment_id)

@spec unenroll(Ecto.UUID.t()) :: no_return()

Deprecated unscoped cancel. Use unenroll/2.

unenroll(enrollment_id, tenant_key)

@spec unenroll(Ecto.UUID.t(), binary() | nil) ::
  {:ok, Ecto.Schema.t()} | {:error, term()}

Cancels an enrollment scoped by tenant.

update_adapter_pool(pool_or_id, attrs)

@spec update_adapter_pool(Ecto.Schema.t() | Ecto.UUID.t(), map()) ::
  {:ok, Ecto.Schema.t()} | {:error, Ecto.Changeset.t()}

Updates an outbound adapter pool.

update_channel_adapter(adapter, attrs)

@spec update_channel_adapter(Ecto.Schema.t(), map()) ::
  {:ok, Ecto.Schema.t()} | {:error, Ecto.Changeset.t()}

Updates a channel adapter.

update_http_hook(hook, attrs)

@spec update_http_hook(Ecto.Schema.t(), map()) ::
  {:ok, Ecto.Schema.t()} | {:error, Ecto.Changeset.t()}

Updates an HTTP hook.

validate_sequence_version(version_id)

@spec validate_sequence_version(Ecto.UUID.t()) ::
  {:ok, Ecto.Schema.t()} | {:error, list()}

Validates a sequence version before activation.

webhook_routes()

@spec webhook_routes() :: [DripDrop.Channel.webhook_route()]

Returns webhook routes declared by active channel adapters.