[{"name":"Cqrs","comment":"\n\n@docs Response, Operation\n\n\n## Actions\n\n@docs batch\n\n","unions":[{"name":"Operation","comment":" Represents a CQRS operation.\n","args":["data","error","msg"],"cases":[["Query",["Cqrs.Query.QueryRequest data error msg"]],["Command",["Cqrs.Command.CommandRequest error msg"]]]},{"name":"Response","comment":" Represents the responses for the batched operations.\n","args":["error","data","msg"],"cases":[["QueryCmd",["Platform.Cmd.Cmd msg"]],["QueryTask",["Task.Task () (Cqrs.Query.QueryResponse error data)"]],["CommandCmd",["Platform.Cmd.Cmd msg"]],["CommandTask",["Task.Task () (Cqrs.Command.CommandResponse error)"]]]}],"aliases":[],"values":[{"name":"batch","comment":" Batches a list of queries and commands to be executed in unison.\n","type":"List.List (Cqrs.Operation data error msg) -> List.List (Cqrs.Response error data msg)"}],"binops":[]},{"name":"Cqrs.Command","comment":"\n\n@docs StandardRequestConfiguration, TaskRequestConfiguration, RequestSettings, RequestWithConfigurationSettings, RequestTaskSettings, RequestTaskWithConfigurationSettings, CommandRequest, CommandResponse\n\n\n## HTTP\n\n@docs request, requestWithConfiguration, requestTask, requestTaskWithConfiguration\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":"CommandRequest","comment":" Represents the possible types of query which can be executed depending on your needs.\n","args":["error","msg"],"cases":[["Request",["Cqrs.Command.RequestSettings error msg"]],["RequestWithConfig",["Cqrs.Command.RequestWithConfigurationSettings error msg"]],["Task",["Cqrs.Command.RequestTaskSettings error"]],["TaskWithConfig",["Cqrs.Command.RequestTaskWithConfigurationSettings error"]]]},{"name":"CommandResponse","comment":" Represents the possible states of a command.\n","args":["error"],"cases":[]}],"aliases":[{"name":"RequestSettings","comment":" Configuration settings for a `Cqrs.Command.request`\n","args":["error","msg"],"type":"{ body : Json.Encode.Value, defaultError : error, toError : Json.Decode.Decoder error, toMsg : Cqrs.Command.CommandResponse error -> msg, url : String.String }"},{"name":"RequestTaskSettings","comment":" Configuration settings for a `Cqrs.Command.requestTask`\n","args":["error"],"type":"{ body : Json.Encode.Value, defaultError : error, toError : Json.Decode.Decoder error, url : String.String }"},{"name":"RequestTaskWithConfigurationSettings","comment":" Configuration settings for a `Cqrs.Command.requestTaskWithConfig`\n","args":["error"],"type":"{ body : Json.Encode.Value, config : Cqrs.Command.TaskRequestConfiguration, defaultError : error, toError : Json.Decode.Decoder error, url : String.String }"},{"name":"RequestWithConfigurationSettings","comment":" Configuration settings for a `Cqrs.Command.requestWithConfig`\n","args":["error","msg"],"type":"{ body : Json.Encode.Value, config : Cqrs.Command.StandardRequestConfiguration, defaultError : error, toError : Json.Decode.Decoder error, toMsg : Cqrs.Command.CommandResponse error -> msg, url : String.String }"},{"name":"StandardRequestConfiguration","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":"TaskRequestConfiguration","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 error`.\n","type":"Json.Decode.Decoder error -> Json.Decode.Decoder (Cqrs.Command.CommandResponse error)"},{"name":"fail","comment":" Constructs the `Failed` variant of a `Cqrs.Command.CommandResponse error`.\n\nThis is useful for testing how your UI will respond to the sad path, without actually sending a command.\n\n","type":"error -> Cqrs.Command.CommandResponse error"},{"name":"failed","comment":" Checks if a given `Cqrs.Command.CommandResponse error` is a `Failed` variant.\n\n    failed Succeeded --> False\n\n    failed (Failed \"reason\") --> True\n\n","type":"Cqrs.Command.CommandResponse error -> Basics.Bool"},{"name":"fromRemoteData","comment":" Converts a given `WebData (CommandResponse error)` into a `Cqrs.Command.CommandResponse error`.\n","type":"error -> RemoteData.WebData (Cqrs.Command.CommandResponse error) -> Cqrs.Command.CommandResponse error"},{"name":"fromResult","comment":" Converts a `Result error data` to a `Cqrs.Command.CommandResponse error`\n","type":"Result.Result error data -> Cqrs.Command.CommandResponse error"},{"name":"mapError","comment":" Maps the `Failed` variant of a given `Cqrs.Command.CommandResponse error`.\n","type":"(error -> nextError) -> Cqrs.Command.CommandResponse error -> Cqrs.Command.CommandResponse nextError"},{"name":"partition","comment":" Partitions a series of `CommandResponse error` instances into a tuple of successful and unsuccessful responses.\n","type":"List.List (Cqrs.Command.CommandResponse error) -> ( List.List (), List.List error )"},{"name":"reason","comment":" If a given `Cqrs.Command.CommandResponse error` 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 error -> Maybe.Maybe error"},{"name":"request","comment":" Sends a command to the given URL with the provided body and returns a parsed `Cqrs.Command.CommandResponse error` in turn.\n","type":"Cqrs.Command.RequestSettings error 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 error`.\nThe value contained within the `Cqrs.Command.CommandResponse error`, will be the value parsed via the provided decoder.\n","type":"Cqrs.Command.RequestTaskSettings error -> Task.Task () (Cqrs.Command.CommandResponse error)"},{"name":"requestTaskWithConfiguration","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.RequestTaskWithConfigurationSettings error -> Task.Task () (Cqrs.Command.CommandResponse error)"},{"name":"requestWithConfiguration","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.RequestWithConfigurationSettings error msg -> Platform.Cmd.Cmd msg"},{"name":"succeed","comment":" Constructs the `Succeeded` variant of a `Cqrs.Command.CommandResponse error`.\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 error"},{"name":"succeeded","comment":" Checks if a given `Cqrs.Command.CommandResponse error` is a `Succeeded` variant.\n\n    succeeded Succeeded --> True\n\n    succeeded (Failed \"reason\") --> False\n\n","type":"Cqrs.Command.CommandResponse error -> Basics.Bool"},{"name":"toMaybe","comment":" Converts a `Cqrs.Command.CommandResponse error` to a `Maybe ()`\n","type":"Cqrs.Command.CommandResponse error -> Maybe.Maybe ()"},{"name":"toResult","comment":" Converts a `Cqrs.Command.CommandResponse error` to a `Result error data`\n","type":"Cqrs.Command.CommandResponse error -> Result.Result error ()"},{"name":"unpack","comment":" Convert a `CommandResponse error` to a `value` by applying either the first function if the `CommandResponse error` is an `Failed` variant or the second function if the `CommandResponse error` is a `Succeeded` variant.\n","type":"(error -> value) -> (() -> value) -> Cqrs.Command.CommandResponse error -> value"},{"name":"unwrap","comment":" Convert a `CommandResponse error` to a `value` by applying a function if the `CommandResponse error` is a `Succeeded` variant or using the provided default value if it is an `Failed` variant.\n","type":"value -> (() -> value) -> Cqrs.Command.CommandResponse error -> value"}],"binops":[]},{"name":"Cqrs.Query","comment":"\n\n@docs StandardRequestConfiguration, TaskRequestConfiguration, RequestSettings, RequestWithConfigurationSettings, RequestTaskSettings, RequestTaskWithConfigurationSettings, QueryRequest, QueryResponse\n\n\n## HTTP\n\n@docs request, requestWithConfiguration, requestTask, requestTaskWithConfiguration\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":"QueryRequest","comment":" Represents the possible types of query which can be executed depending on your needs.\n","args":["data","error","msg"],"cases":[["Request",["Cqrs.Query.RequestSettings data error msg"]],["RequestWithConfig",["Cqrs.Query.RequestWithConfigurationSettings data error msg"]],["Task",["Cqrs.Query.RequestTaskSettings data error"]],["TaskWithConfig",["Cqrs.Query.RequestTaskWithConfigurationSettings data error"]]]},{"name":"QueryResponse","comment":" Represents the possible states of a query.\n","args":["error","data"],"cases":[]}],"aliases":[{"name":"RequestSettings","comment":" Configuration settings for a `request`\n","args":["data","error","msg"],"type":"{ defaultError : error, toData : Json.Decode.Decoder data, toError : Json.Decode.Decoder error, toMsg : Cqrs.Query.QueryResponse error data -> msg, url : String.String }"},{"name":"RequestTaskSettings","comment":" Configuration settings for a `requestTask`\n","args":["data","error"],"type":"{ defaultError : error, toData : Json.Decode.Decoder data, toError : Json.Decode.Decoder error, url : String.String }"},{"name":"RequestTaskWithConfigurationSettings","comment":" Configuration settings for a `requestTaskWithConfig`\n","args":["data","error"],"type":"{ config : Cqrs.Query.TaskRequestConfiguration, defaultError : error, toData : Json.Decode.Decoder data, toError : Json.Decode.Decoder error, url : String.String }"},{"name":"RequestWithConfigurationSettings","comment":" Configuration settings for a `requestWithConfig`\n","args":["data","error","msg"],"type":"{ config : Cqrs.Query.StandardRequestConfiguration, defaultError : error, toData : Json.Decode.Decoder data, toError : Json.Decode.Decoder error, toMsg : Cqrs.Query.QueryResponse error data -> msg, url : String.String }"},{"name":"StandardRequestConfiguration","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":"TaskRequestConfiguration","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 `QueryResponse error data` 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 error data -> Maybe.Maybe data"},{"name":"decoder","comment":" Decodes a given payload into a `QueryResponse error data`.\n","type":"Json.Decode.Decoder data -> Json.Decode.Decoder error -> Json.Decode.Decoder (Cqrs.Query.QueryResponse error data)"},{"name":"fail","comment":" Constructs the `Error` variant of a `QueryResponse error data`.\n\nThis is useful for testing how your UI will respond to the sad path, without actually sending a query, for example.\n\n","type":"error -> Cqrs.Query.QueryResponse error data"},{"name":"failed","comment":" Checks if a given `QueryResponse error data` is an `Error` variant.\n\n    failed (Data []) --> False\n\n    failed (Error \"reason\") --> True\n\n","type":"Cqrs.Query.QueryResponse error data -> Basics.Bool"},{"name":"filter","comment":" Filter a given `QueryResponse error data` 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":"error -> (data -> Basics.Bool) -> Cqrs.Query.QueryResponse error data -> Cqrs.Query.QueryResponse error data"},{"name":"fromRemoteData","comment":" Converts a given `WebData (QueryResponse issue data)` into a `QueryResponse error data`.\n","type":"error -> RemoteData.WebData (Cqrs.Query.QueryResponse error data) -> Cqrs.Query.QueryResponse error data"},{"name":"fromResult","comment":" Converts a `Result error data` to a `QueryResponse error data`\n","type":"Result.Result error data -> Cqrs.Query.QueryResponse error data"},{"name":"map","comment":" Maps the `Data` variant of a given `QueryResponse error data`.\n","type":"(data -> nextData) -> Cqrs.Query.QueryResponse error data -> Cqrs.Query.QueryResponse error nextData"},{"name":"mapBoth","comment":" Maps both the `Data` and the `Error` variant of a given `QueryResponse error data`.\n","type":"(error -> nextError) -> (data -> nextData) -> Cqrs.Query.QueryResponse error data -> Cqrs.Query.QueryResponse nextError nextData"},{"name":"mapError","comment":" Maps the `Error` variant of a given `QueryResponse error data`.\n","type":"(error -> nextError) -> Cqrs.Query.QueryResponse error data -> Cqrs.Query.QueryResponse nextError data"},{"name":"merge","comment":" When a given `QueryResponse error data` is actually in the form `QueryResponse value value` 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 value value -> value"},{"name":"partition","comment":" Partitions a series of `QueryResponse error data` instances into a tuple of successful and unsuccessful responses.\n","type":"List.List (Cqrs.Query.QueryResponse error data) -> ( List.List data, List.List error )"},{"name":"reason","comment":" If a given `QueryResponse error data` 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 error data -> Maybe.Maybe error"},{"name":"request","comment":" Sends a query to the given URL and returns a `Cmd` for the given `msg` containing the parsed `QueryResponse error data`.\n","type":"Cqrs.Query.RequestSettings data error msg -> Platform.Cmd.Cmd msg"},{"name":"requestTask","comment":" Sends a query to the given URL and returns a `Task` which will contain the parsed `QueryResponse error data`.\n","type":"Cqrs.Query.RequestTaskSettings data error -> Task.Task () (Cqrs.Query.QueryResponse error data)"},{"name":"requestTaskWithConfiguration","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.RequestTaskWithConfigurationSettings data error -> Task.Task () (Cqrs.Query.QueryResponse error data)"},{"name":"requestWithConfiguration","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.RequestWithConfigurationSettings data error msg -> Platform.Cmd.Cmd msg"},{"name":"succeed","comment":" Constructs the `Data` variant of a `QueryResponse error data`.\n\nThis is useful for testing how your UI will respond to the happy path, without actually sending a query, for example.\n\n","type":"data -> Cqrs.Query.QueryResponse error data"},{"name":"succeeded","comment":" Checks if a given `QueryResponse error data` is a `Data` variant.\n\n    succeeded (Data []) --> True\n\n    succeeded (Error \"reason\") --> False\n\n","type":"Cqrs.Query.QueryResponse error data -> Basics.Bool"},{"name":"toMaybe","comment":" Converts a `QueryResponse error data` to a `Maybe data`\n","type":"Cqrs.Query.QueryResponse error data -> Maybe.Maybe data"},{"name":"toResult","comment":" Converts a `QueryResponse error data` to a `Result error data`\n","type":"Cqrs.Query.QueryResponse error data -> Result.Result error data"},{"name":"unpack","comment":" Convert a `QueryResponse error data` to a `value` by applying either the first function if the `QueryResponse error data` is an `Error` variant or the second function if the `QueryResponse error data` is a `Data` variant.\n","type":"(error -> value) -> (data -> value) -> Cqrs.Query.QueryResponse error data -> value"},{"name":"unwrap","comment":" Convert a `QueryResponse error data` to a `value` by applying a function if the `QueryResponse error data` is a `Data` variant or using the provided default value if it is an `Error` variant.\n","type":"value -> (data -> value) -> Cqrs.Query.QueryResponse error data -> value"},{"name":"withDefault","comment":" Provides a default case for a `QueryResponse error data` in place of the value held within the `Error` variant.\n","type":"data -> Cqrs.Query.QueryResponse error data -> data"}],"binops":[]}]