2020-01-26 19:34:25 +00:00
|
|
|
defmodule Mobilizon.GraphQL.Schema.ConfigType do
|
2019-03-22 09:53:38 +00:00
|
|
|
@moduledoc """
|
|
|
|
Schema representation for User
|
|
|
|
"""
|
|
|
|
use Absinthe.Schema.Notation
|
|
|
|
|
2020-01-26 19:34:25 +00:00
|
|
|
alias Mobilizon.GraphQL.Resolvers.Config
|
2019-03-22 09:53:38 +00:00
|
|
|
|
|
|
|
@desc "A config object"
|
|
|
|
object :config do
|
|
|
|
# Instance name
|
|
|
|
field(:name, :string)
|
2019-04-03 15:29:03 +00:00
|
|
|
field(:description, :string)
|
2020-06-19 17:27:10 +00:00
|
|
|
field(:long_description, :string)
|
|
|
|
field(:contact, :string)
|
2019-03-22 09:53:38 +00:00
|
|
|
|
2020-10-07 13:37:23 +00:00
|
|
|
field(:languages, list_of(:string))
|
2019-03-22 09:53:38 +00:00
|
|
|
field(:registrations_open, :boolean)
|
2020-09-29 07:53:48 +00:00
|
|
|
field(:registrations_allowlist, :boolean)
|
2019-11-21 15:07:43 +00:00
|
|
|
field(:demo_mode, :boolean)
|
2019-11-08 18:37:14 +00:00
|
|
|
field(:country_code, :string)
|
|
|
|
field(:location, :lonlat)
|
2019-11-20 12:49:57 +00:00
|
|
|
field(:geocoding, :geocoding)
|
|
|
|
field(:maps, :maps)
|
2019-12-20 12:04:34 +00:00
|
|
|
field(:anonymous, :anonymous)
|
2020-02-18 07:57:00 +00:00
|
|
|
field(:resource_providers, list_of(:resource_provider))
|
|
|
|
field(:timezones, list_of(:string))
|
2020-06-08 14:47:57 +00:00
|
|
|
field(:features, :features)
|
2020-06-19 17:27:10 +00:00
|
|
|
field(:version, :string)
|
|
|
|
field(:federating, :boolean)
|
2019-12-20 12:04:34 +00:00
|
|
|
|
|
|
|
field(:terms, :terms, description: "The instance's terms") do
|
|
|
|
arg(:locale, :string, default_value: "en")
|
|
|
|
resolve(&Config.terms/3)
|
|
|
|
end
|
2020-06-15 09:01:49 +00:00
|
|
|
|
2020-06-19 17:27:10 +00:00
|
|
|
field(:privacy, :privacy, description: "The instance's privacy policy") do
|
|
|
|
arg(:locale, :string, default_value: "en")
|
|
|
|
resolve(&Config.privacy/3)
|
|
|
|
end
|
|
|
|
|
2020-06-15 09:01:49 +00:00
|
|
|
field(:rules, :string, description: "The instance's rules")
|
2020-06-27 17:12:45 +00:00
|
|
|
field(:auth, :auth, description: "The instance auth methods")
|
2019-12-20 12:04:34 +00:00
|
|
|
end
|
|
|
|
|
|
|
|
object :terms do
|
|
|
|
field(:url, :string)
|
|
|
|
field(:type, :instance_terms_type)
|
|
|
|
field(:body_html, :string)
|
2019-11-08 18:37:14 +00:00
|
|
|
end
|
|
|
|
|
2020-06-19 17:27:10 +00:00
|
|
|
object :privacy do
|
|
|
|
field(:url, :string)
|
|
|
|
field(:type, :instance_privacy_type)
|
|
|
|
field(:body_html, :string)
|
|
|
|
end
|
|
|
|
|
2019-11-08 18:37:14 +00:00
|
|
|
object :lonlat do
|
|
|
|
field(:longitude, :float)
|
|
|
|
field(:latitude, :float)
|
2020-06-09 13:20:07 +00:00
|
|
|
# field(:accuracy_radius, :integer)
|
2019-03-22 09:53:38 +00:00
|
|
|
end
|
|
|
|
|
2019-11-20 12:49:57 +00:00
|
|
|
object :geocoding do
|
|
|
|
field(:autocomplete, :boolean)
|
|
|
|
field(:provider, :string)
|
|
|
|
end
|
|
|
|
|
|
|
|
object :maps do
|
|
|
|
field(:tiles, :tiles)
|
|
|
|
end
|
|
|
|
|
|
|
|
object :tiles do
|
|
|
|
field(:endpoint, :string)
|
|
|
|
field(:attribution, :string)
|
|
|
|
end
|
|
|
|
|
2019-12-20 12:04:34 +00:00
|
|
|
object :anonymous do
|
|
|
|
field(:participation, :anonymous_participation)
|
|
|
|
field(:event_creation, :anonymous_event_creation)
|
2020-06-09 12:07:49 +00:00
|
|
|
field(:reports, :anonymous_reports)
|
2019-12-20 12:04:34 +00:00
|
|
|
field(:actor_id, :id)
|
|
|
|
end
|
|
|
|
|
|
|
|
object :anonymous_participation do
|
|
|
|
field(:allowed, :boolean)
|
|
|
|
field(:validation, :anonymous_participation_validation)
|
|
|
|
end
|
|
|
|
|
|
|
|
object :anonymous_participation_validation do
|
|
|
|
field(:email, :anonymous_participation_validation_email)
|
|
|
|
field(:captcha, :anonymous_participation_validation_captcha)
|
|
|
|
end
|
|
|
|
|
|
|
|
object :anonymous_participation_validation_email do
|
|
|
|
field(:enabled, :boolean)
|
|
|
|
field(:confirmation_required, :boolean)
|
|
|
|
end
|
|
|
|
|
|
|
|
object :anonymous_participation_validation_captcha do
|
|
|
|
field(:enabled, :boolean)
|
|
|
|
end
|
|
|
|
|
|
|
|
object :anonymous_event_creation do
|
|
|
|
field(:allowed, :boolean)
|
|
|
|
field(:validation, :anonymous_event_creation_validation)
|
|
|
|
end
|
|
|
|
|
|
|
|
object :anonymous_event_creation_validation do
|
|
|
|
field(:email, :anonymous_event_creation_validation_email)
|
|
|
|
field(:captcha, :anonymous_event_creation_validation_captcha)
|
|
|
|
end
|
|
|
|
|
|
|
|
object :anonymous_event_creation_validation_email do
|
|
|
|
field(:enabled, :boolean)
|
|
|
|
field(:confirmation_required, :boolean)
|
|
|
|
end
|
|
|
|
|
|
|
|
object :anonymous_event_creation_validation_captcha do
|
|
|
|
field(:enabled, :boolean)
|
|
|
|
end
|
|
|
|
|
2020-06-09 12:07:49 +00:00
|
|
|
object :anonymous_reports do
|
|
|
|
field(:allowed, :boolean)
|
|
|
|
end
|
|
|
|
|
2020-02-18 07:57:00 +00:00
|
|
|
object :resource_provider do
|
|
|
|
field(:type, :string)
|
|
|
|
field(:endpoint, :string)
|
|
|
|
field(:software, :string)
|
|
|
|
end
|
|
|
|
|
2020-06-08 14:47:57 +00:00
|
|
|
object :features do
|
|
|
|
field(:groups, :boolean)
|
2020-09-02 13:08:47 +00:00
|
|
|
field(:event_creation, :boolean)
|
2020-06-08 14:47:57 +00:00
|
|
|
end
|
|
|
|
|
2020-06-27 17:12:45 +00:00
|
|
|
object :auth do
|
|
|
|
field(:ldap, :boolean, description: "Whether or not LDAP auth is enabled")
|
|
|
|
field(:oauth_providers, list_of(:oauth_provider), description: "List of oauth providers")
|
|
|
|
end
|
|
|
|
|
|
|
|
object :oauth_provider do
|
|
|
|
field(:id, :string, description: "The provider ID")
|
|
|
|
field(:label, :string, description: "The label for the auth provider")
|
|
|
|
end
|
|
|
|
|
2019-03-22 09:53:38 +00:00
|
|
|
object :config_queries do
|
|
|
|
@desc "Get the instance config"
|
|
|
|
field :config, :config do
|
|
|
|
resolve(&Config.get_config/3)
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|