View Source Plausible.Sites (Plausible v0.0.1)

Sites context functions.

Summary

Functions

Link to this function

clear_stats_start_date!(site)

View Source
@spec clear_stats_start_date!(Plausible.Site.t()) :: Plausible.Site.t()
Link to this function

create_shared_link(site, name, password \\ nil)

View Source
@spec for_user_query(Plausible.Auth.User.t()) :: Ecto.Query.t()
Link to this function

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

View Source
@spec get_for_user(Plausible.Auth.User.t() | pos_integer(), String.t(), [
  :super_admin | :owner | :admin | :viewer
]) :: Plausible.Site.t() | nil
Link to this function

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

View Source
@spec get_for_user!(Plausible.Auth.User.t() | pos_integer(), String.t(), [
  :super_admin | :owner | :admin | :viewer
]) :: Plausible.Site.t()
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

See Plausible.Teams.Adapter.Read.Sites.list/3.

Link to this function

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

View Source

See Plausible.Teams.Adapter.Read.Sites.list_with_invitations/3.

Link to this function

native_stats_start_date(site)

View Source
@spec native_stats_start_date(Plausible.Site.t()) :: Date.t() | nil
Link to this function

owned_sites_domains(user)

View Source
Link to this function

owned_sites_locked?(user)

View Source
Link to this function

set_option(user, site, option, value)

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 imported stats and Clickhouse, choosing the earliest start date and saves it in the sites table.

@spec toggle_pin(Plausible.Auth.User.t(), Plausible.Site.t()) ::
  {:ok, Plausible.Site.UserPreference.t()} | {:error, :too_many_pins}
Link to this function

update_installation_meta!(site, meta)

View Source