View Source Plausible.Sites (Plausible v0.0.1)

Summary

Types

@type list_opt() :: {:filter_by_domain, String.t()}

Functions

Link to this function

create_shared_link(site, name, password \\ nil)

View Source
Link to this function

get_for_user(user_id, domain, roles \\ [:owner, :admin, :viewer])

View Source
Link to this function

get_for_user!(user_id, domain, roles \\ [:owner, :admin, :viewer])

View Source
Link to this function

has_admin_access?(user_id, site)

View Source
Link to this function

is_member?(user_id, site)

View Source
Link to this function

list(user, pagination_params, opts \\ [])

View Source
@spec list(Plausible.Auth.User.t(), map(), [list_opt()]) :: Scrivener.Page.t()
Link to this function

owned_sites_domains(user)

View Source
@spec stats_start_date(Plausible.Site.t()) :: Date.t() | nil

Returns the date of the first event of the given site, or nil if the site does not have stats yet.

If this is the first time the function is called for the site, it queries Clickhouse and saves the date in the sites table.