mirror of
https://github.com/ash-project/ash_json_api_wrapper.git
synced 2024-09-19 21:02:50 +12:00
chore: credo/ci
This commit is contained in:
parent
f91087bbb6
commit
e22fb218e8
9 changed files with 17 additions and 2 deletions
|
@ -123,7 +123,7 @@
|
|||
{Credo.Check.Refactor.MatchInCondition, []},
|
||||
{Credo.Check.Refactor.NegatedConditionsInUnless, []},
|
||||
{Credo.Check.Refactor.NegatedConditionsWithElse, []},
|
||||
{Credo.Check.Refactor.Nesting, [max_nesting: 6]},
|
||||
{Credo.Check.Refactor.Nesting, [max_nesting: 8]},
|
||||
{Credo.Check.Refactor.UnlessWithElse, []},
|
||||
{Credo.Check.Refactor.WithClauses, []},
|
||||
|
||||
|
|
|
@ -1,5 +1,6 @@
|
|||
defmodule AshJsonApiWrapper do
|
||||
@moduledoc """
|
||||
Functions for interacting with AshJsonApiWrapper changesets and queries.
|
||||
"""
|
||||
|
||||
@spec set_body_param(query_or_changeset, String.t(), any) :: query_or_changeset
|
||||
|
|
|
@ -1,4 +1,8 @@
|
|||
defmodule AshJsonApiWrapper.DataLayer do
|
||||
@moduledoc """
|
||||
A data layer for wrapping external JSON APIs.
|
||||
"""
|
||||
|
||||
@field %Spark.Dsl.Entity{
|
||||
name: :field,
|
||||
target: AshJsonApiWrapper.Field,
|
||||
|
@ -127,6 +131,7 @@ defmodule AshJsonApiWrapper.DataLayer do
|
|||
transformers: [AshJsonApiWrapper.DataLayer.Transformers.SetEndpointDefaults]
|
||||
|
||||
defmodule Query do
|
||||
@moduledoc false
|
||||
defstruct [
|
||||
:api,
|
||||
:context,
|
||||
|
|
|
@ -1,4 +1,5 @@
|
|||
defmodule AshJsonApiWrapper.DataLayer.Transformers.SetEndpointDefaults do
|
||||
@moduledoc false
|
||||
use Spark.Dsl.Transformer
|
||||
|
||||
alias Spark.Dsl.Transformer
|
||||
|
|
|
@ -1,4 +1,8 @@
|
|||
defmodule AshJsonApiWrapper.DefaultTesla do
|
||||
@moduledoc """
|
||||
A bare bones tesla implementation used by default if one is not provided.
|
||||
"""
|
||||
|
||||
use Tesla
|
||||
|
||||
plug(Tesla.Middleware.FollowRedirects)
|
||||
|
|
|
@ -1,4 +1,5 @@
|
|||
defmodule AshJsonApiWrapper.Field do
|
||||
@moduledoc "Represents a field mapped in the target api."
|
||||
defstruct [:name, :path, :write_path, :filter_handler]
|
||||
|
||||
@type t :: %__MODULE__{}
|
||||
|
|
|
@ -1,4 +1,6 @@
|
|||
defmodule AshJsonApiWrapper.OpenApi.ResourceGenerator do
|
||||
@moduledoc "Generates resources from an open api specification"
|
||||
|
||||
def generate(json, main_config) do
|
||||
main_config[:resources]
|
||||
|> Enum.map(fn {resource, config} ->
|
||||
|
|
|
@ -1,4 +1,5 @@
|
|||
defmodule AshJsonApiWrapper.Paginator.ContinuationProperty do
|
||||
@moduledoc "A paginator that uses a continuation property to paginate"
|
||||
use AshJsonApiWrapper.Paginator
|
||||
|
||||
def continue(_response, [], _), do: :halt
|
||||
|
|
2
mix.exs
2
mix.exs
|
@ -133,7 +133,7 @@ defmodule AshJsonApiWrapper.MixProject do
|
|||
# Run "mix help deps" to learn about dependencies.
|
||||
defp deps do
|
||||
[
|
||||
{:ash, "~> 2.15"},
|
||||
{:ash, ash_version("~> 2.15")},
|
||||
{:tesla, "~> 1.7"},
|
||||
{:exjsonpath, "~> 0.1"},
|
||||
# Dev/Test dependencies
|
||||
|
|
Loading…
Reference in a new issue