[{"name":"Cqrs.Command","comment":"\n\n@docs StandardRequestConfig, TaskRequestConfig, CommandResponse\n\n\n## HTTP\n\n@docs request, requestWithConfig, requestTask, requestTaskWithConfig\n\n\n## Constructors\n\n@docs succeed, fail, fromResult, fromRemoteData\n\n\n## State\n\n@docs reason\n\n\n## Mappers\n\n@docs mapError, unwrap, unpack, partition, toResult, toMaybe\n\n\n## Helpers\n\n@docs succeeded, failed\n\n\n## Codec\n\n@docs decoder\n\n","unions":[{"name":"CommandResponse","comment":" Represents the possible states of a command.\n","args":["e"],"cases":[]}],"aliases":[{"name":"StandardRequestConfig","comment":" Configuration for requests resulting in a `Cmd`\n","args":[],"type":"{ headers : List.List Http.Header, timeout : Maybe.Maybe Basics.Float, tracker : Maybe.Maybe String.String, risky : Basics.Bool }"},{"name":"TaskRequestConfig","comment":" Configuration for requests resulting in a `Task`\n","args":[],"type":"{ headers : List.List Http.Header, timeout : Maybe.Maybe Basics.Float, risky : Basics.Bool }"}],"values":[{"name":"decoder","comment":" Decodes a given payload into a `Cqrs.Command.CommandResponse e`.\n","type":"Json.Decode.Decoder e -> Json.Decode.Decoder (Cqrs.Command.CommandResponse e)"},{"name":"fail","comment":" Constructs the `Failed` variant of a `Cqrs.Command.CommandResponse e`.\n\nThis is useful for testing how your UI will respond to the sad path, without actually sending a command.\n\n","type":"e -> Cqrs.Command.CommandResponse e"},{"name":"failed","comment":" Checks if a given `Cqrs.Command.CommandResponse e` is a `Failed` variant.\n\n    failed Succeeded --> False\n\n    failed (Failed \"reason\") --> True\n\n","type":"Cqrs.Command.CommandResponse e -> Basics.Bool"},{"name":"fromRemoteData","comment":" Converts a given `RemoteData x (CommandResponse e)` into a `Cqrs.Command.CommandResponse e`.\n","type":"(e -> f) -> f -> RemoteData.RemoteData x (Cqrs.Command.CommandResponse e) -> Cqrs.Command.CommandResponse f"},{"name":"fromResult","comment":" Converts a `Result e a` to a `Cqrs.Command.CommandResponse e`\n","type":"Result.Result e a -> Cqrs.Command.CommandResponse e"},{"name":"mapError","comment":" Maps the `Failed` variant of a given `Cqrs.Command.CommandResponse e`.\n","type":"(e -> f) -> Cqrs.Command.CommandResponse e -> Cqrs.Command.CommandResponse f"},{"name":"partition","comment":" Partitions a series of `CommandResponse e` instances into a tuple of successful and unsuccessful responses.\n","type":"List.List (Cqrs.Command.CommandResponse e) -> ( List.List (), List.List e )"},{"name":"reason","comment":" If a given `Cqrs.Command.CommandResponse e` was unsuccessful, the reason for the failure will be returned.\n\n    reason Succeeded --> Nothing\n\n    reason (Failed \"reason\") --> Just \"reason\"\n\n","type":"Cqrs.Command.CommandResponse e -> Maybe.Maybe e"},{"name":"request","comment":" Sends a command to the given URL with the provided body and returns a parsed `Cqrs.Command.CommandResponse e` in turn.\n","type":"String.String -> (e -> f) -> f -> Json.Encode.Value -> Json.Decode.Decoder e -> (Cqrs.Command.CommandResponse f -> msg) -> Platform.Cmd.Cmd msg"},{"name":"requestTask","comment":" Sends a command to the given URL and returns a `Task` containing the parsed `Cqrs.Command.CommandResponse e`.\nThe value contained within the `Cqrs.Command.CommandResponse e`, will be the value parsed via the provided decoder.\n","type":"String.String -> (e -> f) -> f -> Json.Encode.Value -> Json.Decode.Decoder e -> Task.Task () (Cqrs.Command.CommandResponse f)"},{"name":"requestTaskWithConfig","comment":" Similar to `requestTask` but a `TaskRequestConfig` can be passed in for cases where customisation of the request headers, etc are desired.\n","type":"Cqrs.Command.TaskRequestConfig -> String.String -> (e -> f) -> f -> Json.Encode.Value -> Json.Decode.Decoder e -> Task.Task () (Cqrs.Command.CommandResponse f)"},{"name":"requestWithConfig","comment":" Similar to `request` but a `StandardRequestConfig` can be passed in for cases where customisation of the request headers, etc are desired.\n","type":"Cqrs.Command.StandardRequestConfig -> String.String -> (e -> f) -> f -> Json.Encode.Value -> Json.Decode.Decoder e -> (Cqrs.Command.CommandResponse f -> msg) -> Platform.Cmd.Cmd msg"},{"name":"succeed","comment":" Constructs the `Succeeded` variant of a `Cqrs.Command.CommandResponse e`.\n\nThis is useful for testing how your UI will respond to the happy path, without actually sending a command.\n\n","type":"Cqrs.Command.CommandResponse e"},{"name":"succeeded","comment":" Checks if a given `Cqrs.Command.CommandResponse e` is a `Succeeded` variant.\n\n    succeeded Succeeded --> True\n\n    succeeded (Failed \"reason\") --> False\n\n","type":"Cqrs.Command.CommandResponse e -> Basics.Bool"},{"name":"toMaybe","comment":" Converts a `Cqrs.Command.CommandResponse e` to a `Maybe a`\n","type":"Cqrs.Command.CommandResponse e -> Maybe.Maybe ()"},{"name":"toResult","comment":" Converts a `Cqrs.Command.CommandResponse e` to a `Result e a`\n","type":"Cqrs.Command.CommandResponse e -> Result.Result e ()"},{"name":"unpack","comment":" Convert a `CommandResponse e` to an `a` by applying either the first function if the `CommandResponse e` is an `Failed` variant or the second function if the `CommandResponse e` is a `Succeeded` variant.\n","type":"(e -> b) -> (() -> b) -> Cqrs.Command.CommandResponse e -> b"},{"name":"unwrap","comment":" Convert a `CommandResponse e` to an `a` by applying a function if the `CommandResponse e` is a `Succeeded` variant or using the provided default value if it is an `Failed` variant.\n","type":"b -> (() -> b) -> Cqrs.Command.CommandResponse e -> b"}],"binops":[]},{"name":"Cqrs.Query","comment":"\n\n@docs StandardRequestConfig, TaskRequestConfig, QueryResponse\n\n\n## HTTP\n\n@docs request, requestWithConfig, requestTask, requestTaskWithConfig\n\n\n## Constructors\n\n@docs succeed, fail, fromResult, fromRemoteData\n\n\n## State\n\n@docs data, reason\n\n\n## Mappers\n\n@docs map, mapError, mapBoth, unwrap, unpack, partition, merge, filter, toResult, toMaybe\n\n\n## Helpers\n\n@docs withDefault, succeeded, failed\n\n\n## Codec\n\n@docs decoder\n\n","unions":[{"name":"QueryResponse","comment":" Represents the possible states of a query.\n","args":["e","a"],"cases":[]}],"aliases":[{"name":"StandardRequestConfig","comment":" Configuration for requests resulting in a `Cmd`\n","args":[],"type":"{ headers : List.List Http.Header, timeout : Maybe.Maybe Basics.Float, tracker : Maybe.Maybe String.String, risky : Basics.Bool }"},{"name":"TaskRequestConfig","comment":" Configuration for requests resulting in a `Task`\n","args":[],"type":"{ headers : List.List Http.Header, timeout : Maybe.Maybe Basics.Float, risky : Basics.Bool }"}],"values":[{"name":"data","comment":" If a given `Cqrs.Query.QueryResponse e a` was successful, the data it contains will be returned.\n\n    data (Data []) --> Just []\n\n    data (Error \"reason\") --> Nothing\n\n","type":"Cqrs.Query.QueryResponse e a -> Maybe.Maybe a"},{"name":"decoder","comment":" Decodes a given payload into a `Cqrs.Query.QueryResponse e a`.\n","type":"Json.Decode.Decoder a -> Json.Decode.Decoder e -> Json.Decode.Decoder (Cqrs.Query.QueryResponse e a)"},{"name":"fail","comment":" Constructs the `Error` variant of a `Cqrs.Query.QueryResponse e a`.\n\nThis is useful for testing how your UI will respond to the sad path, without actually sending a query.\n\n","type":"e -> Cqrs.Query.QueryResponse e a"},{"name":"failed","comment":" Checks if a given `Cqrs.Query.QueryResponse e a` is an `Error` variant.\n\n    failed (Data []) --> False\n\n    failed (Error \"reason\") --> True\n\n","type":"Cqrs.Query.QueryResponse e a -> Basics.Bool"},{"name":"filter","comment":" Filter a given `QueryResponse e a` if it is in the `Data` variant and should the predicate not pass, map to a `Error` variant with the given error. Useful for error value mapping within a given domain.\n","type":"e -> (a -> Basics.Bool) -> Cqrs.Query.QueryResponse e a -> Cqrs.Query.QueryResponse e a"},{"name":"fromRemoteData","comment":" Converts a given `RemoteData x (Cqrs.Query.QueryResponse e a)` into a `Cqrs.Query.QueryResponse f a`.\n","type":"(e -> f) -> f -> RemoteData.RemoteData x (Cqrs.Query.QueryResponse e a) -> Cqrs.Query.QueryResponse f a"},{"name":"fromResult","comment":" Converts a `Result e a` to a `Cqrs.Query.QueryResponse e a`\n","type":"Result.Result e a -> Cqrs.Query.QueryResponse e a"},{"name":"map","comment":" Maps the `Data` variant of a given `Cqrs.Query.QueryResponse e a` and returns a `Cqrs.Query.Response b`.\n","type":"(a -> b) -> Cqrs.Query.QueryResponse e a -> Cqrs.Query.QueryResponse e b"},{"name":"mapBoth","comment":" Maps both the `Data` and the `Error` variant of a given `Cqrs.Query.QueryResponse e a`.\n","type":"(e -> f) -> (a -> b) -> Cqrs.Query.QueryResponse e a -> Cqrs.Query.QueryResponse f b"},{"name":"mapError","comment":" Maps the `Error` variant of a given `Cqrs.Query.QueryResponse e a`.\n","type":"(e -> f) -> Cqrs.Query.QueryResponse e a -> Cqrs.Query.QueryResponse f a"},{"name":"merge","comment":" When a given `Cqrs.Query.QueryResponse e a` is actually in the form `Cqrs.Query.QueryResponse a a` then we can return the underlying value from either state. This is especially useful when the error and value have been mapped to domain types.\n","type":"Cqrs.Query.QueryResponse a a -> a"},{"name":"partition","comment":" Partitions a series of `QueryResponse e a` instances into a tuple of successful and unsuccessful responses.\n","type":"List.List (Cqrs.Query.QueryResponse e a) -> ( List.List a, List.List e )"},{"name":"reason","comment":" If a given `Cqrs.Query.QueryResponse e a` was unsuccessful, the reason for the failure will be returned.\n\n    reason (Data []) --> Nothing\n\n    reason (Error \"reason\") --> Just \"reason\"\n\n","type":"Cqrs.Query.QueryResponse e a -> Maybe.Maybe e"},{"name":"request","comment":" Sends a query to the given URL and returns a `Cmd` for the given `msg` containing the parsed `Cqrs.Query.QueryResponse e a`.\nThe value contained within the `Cqrs.Query.QueryResponse e a`, will be the value parsed via the provided decoder.\n","type":"String.String -> (e -> f) -> f -> (Cqrs.Query.QueryResponse f a -> msg) -> Json.Decode.Decoder a -> Json.Decode.Decoder e -> Platform.Cmd.Cmd msg"},{"name":"requestTask","comment":" Sends a query to the given URL and returns a `Task` which will contain the parsed `Cqrs.Query.QueryResponse e a`.\nThe value contained within the `Cqrs.Query.QueryResponse e a`, will be the value parsed via the provided decoder.\n","type":"String.String -> (e -> f) -> f -> Json.Decode.Decoder a -> Json.Decode.Decoder e -> Task.Task () (Cqrs.Query.QueryResponse f a)"},{"name":"requestTaskWithConfig","comment":" Similar to `requestTask` but a `TaskRequestConfig` can be passed in for cases where customisation of the request headers, etc are desired.\n","type":"Cqrs.Query.TaskRequestConfig -> String.String -> (e -> f) -> f -> Json.Decode.Decoder a -> Json.Decode.Decoder e -> Task.Task () (Cqrs.Query.QueryResponse f a)"},{"name":"requestWithConfig","comment":" Similar to `request` but a `StandardRequestConfig` can be passed in for cases where customisation of the request headers, etc are desired.\n","type":"Cqrs.Query.StandardRequestConfig -> String.String -> (e -> f) -> f -> (Cqrs.Query.QueryResponse f a -> msg) -> Json.Decode.Decoder a -> Json.Decode.Decoder e -> Platform.Cmd.Cmd msg"},{"name":"succeed","comment":" Constructs the `Data` variant of a `Cqrs.Query.QueryResponse e a`.\n\nThis is useful for testing how your UI will respond to the happy path, without actually sending a query.\n\n","type":"a -> Cqrs.Query.QueryResponse e a"},{"name":"succeeded","comment":" Checks if a given `Cqrs.Query.QueryResponse e a` is a `Data` variant.\n\n    succeeded (Data []) --> True\n\n    succeeded (Error \"reason\") --> False\n\n","type":"Cqrs.Query.QueryResponse e a -> Basics.Bool"},{"name":"toMaybe","comment":" Converts a `Cqrs.Query.QueryResponse e a` to a `Maybe a`\n","type":"Cqrs.Query.QueryResponse e a -> Maybe.Maybe a"},{"name":"toResult","comment":" Converts a `Cqrs.Query.QueryResponse e a` to a `Result e a`\n","type":"Cqrs.Query.QueryResponse e a -> Result.Result e a"},{"name":"unpack","comment":" Convert a `QueryResponse e a` to an `a` by applying either the first function if the `QueryResponse e a` is an `Error` variant or the second function if the `QueryResponse e a` is a `Data` variant.\n","type":"(e -> b) -> (a -> b) -> Cqrs.Query.QueryResponse e a -> b"},{"name":"unwrap","comment":" Convert a `QueryResponse e a` to an `a` by applying a function if the `QueryResponse e a` is a `Data` variant or using the provided default value if it is an `Error` variant.\n","type":"b -> (a -> b) -> Cqrs.Query.QueryResponse e a -> b"},{"name":"withDefault","comment":" Provides a default case for a `Cqrs.Query.QueryResponse e a` in place of the value held within the `Error` variant.\n","type":"a -> Cqrs.Query.QueryResponse e a -> a"}],"binops":[]}]