[
    {
        "name": "Kinto",
        "comment": " [Kinto](http://www.kinto-storage.org/) client to ease communicating with\nthe REST API.\n\nKinto is the backend for your next application. It's a generic JSON document\nstore with sharing and synchronisation capabilities. It's open source. It's\neasy to deploy. You can host it yourself, own your data and keep it out of\nsilos.\n\n\n# Configure a client and resources\n\n@docs Client, client, Auth, headersForAuth, Resource, bucketResource, collectionResource, recordResource, decodeData, encodeData, errorDecoder\n\n\n# Creating requests\n\nYou create requests on either an item or a plural (list) endpoint.\n[Kinto concepts](http://kinto.readthedocs.io/en/stable/concepts.html) explain\nthat in details.\n\nPlural (list) endpoints are:\n\n  - buckets: `buckets/`\n  - collections: `buckets/:bucketId/collections/`\n  - records: `buckets/:bucketId/collections/:collectionId/records/`\n\nItem endpoints are:\n\n  - bucket: `buckets/:bucketId`\n  - collection: `buckets/:bucketId/collections/:collectionId`\n  - record: `buckets/:bucketId/collections/:collectionId/records/:recordId`\n\n@docs Request\n\n\n## Single item requests\n\n@docs get, create, update, replace, delete\n\n\n## Resource list requests\n\n@docs getList\n\n\n### Paginated list\n\n@docs Pager, emptyPager, updatePager, loadNextPage\n\n\n# Sorting, limiting, filtering\n\n@docs sortBy, limit, withFilter, Filter\n\n\n# Types and Errors\n\n@docs Endpoint, endpointUrl, ErrorDetail, Error, extractError, toResponse\n\n\n# Sending requests\n\n@docs send, toRequest\n\n",
        "unions": [
            {
                "name": "Auth",
                "comment": " A type for authentication\n\n    Basic \"username\" \"password\"\n    Bearer \"<token>\"\n    Custom \"customType\" \"customString\"\n\n",
                "args": [],
                "cases": [
                    [
                        "NoAuth",
                        []
                    ],
                    [
                        "Basic",
                        [
                            "String",
                            "String"
                        ]
                    ],
                    [
                        "Bearer",
                        [
                            "String"
                        ]
                    ],
                    [
                        "Custom",
                        [
                            "String",
                            "String"
                        ]
                    ]
                ]
            },
            {
                "name": "Endpoint",
                "comment": " A type for Kinto API endpoints.\n\n    RecordEndpoint \"bucket-name\" \"collection-name\" \"item-id\"\n\n",
                "args": [],
                "cases": [
                    [
                        "RootEndpoint",
                        []
                    ],
                    [
                        "BucketListEndpoint",
                        []
                    ],
                    [
                        "BucketEndpoint",
                        [
                            "BucketName"
                        ]
                    ],
                    [
                        "CollectionListEndpoint",
                        [
                            "BucketName"
                        ]
                    ],
                    [
                        "CollectionEndpoint",
                        [
                            "BucketName",
                            "CollectionName"
                        ]
                    ],
                    [
                        "RecordListEndpoint",
                        [
                            "BucketName",
                            "CollectionName"
                        ]
                    ],
                    [
                        "RecordEndpoint",
                        [
                            "BucketName",
                            "CollectionName",
                            "RecordId"
                        ]
                    ]
                ]
            },
            {
                "name": "Error",
                "comment": " A type for all errors that the elm-client may return.\n",
                "args": [],
                "cases": [
                    [
                        "ServerError",
                        [
                            "StatusCode",
                            "StatusMsg",
                            "String"
                        ]
                    ],
                    [
                        "KintoError",
                        [
                            "StatusCode",
                            "StatusMsg",
                            "ErrorDetail"
                        ]
                    ],
                    [
                        "NetworkError",
                        [
                            "Error"
                        ]
                    ]
                ]
            },
            {
                "name": "Filter",
                "comment": " A type for filtering, used with `withFilter`\n",
                "args": [],
                "cases": [
                    [
                        "EQUAL",
                        [
                            "String",
                            "String"
                        ]
                    ],
                    [
                        "MIN",
                        [
                            "String",
                            "String"
                        ]
                    ],
                    [
                        "MAX",
                        [
                            "String",
                            "String"
                        ]
                    ],
                    [
                        "LT",
                        [
                            "String",
                            "String"
                        ]
                    ],
                    [
                        "GT",
                        [
                            "String",
                            "String"
                        ]
                    ],
                    [
                        "IN",
                        [
                            "String",
                            "List String"
                        ]
                    ],
                    [
                        "NOT",
                        [
                            "String",
                            "String"
                        ]
                    ],
                    [
                        "LIKE",
                        [
                            "String",
                            "String"
                        ]
                    ],
                    [
                        "SINCE",
                        [
                            "String"
                        ]
                    ],
                    [
                        "BEFORE",
                        [
                            "String"
                        ]
                    ]
                ]
            }
        ],
        "aliases": [
            {
                "name": "Client",
                "comment": " A Kinto Client. Constructed using the `client` helper.\n",
                "args": [],
                "type": "{ baseUrl : String, headers : List ( String, String ) }"
            },
            {
                "name": "ErrorDetail",
                "comment": " A type for Kinto error details.\n",
                "args": [],
                "type": "{ errno : Int, message : String, code : Int, error : String }"
            },
            {
                "name": "Pager",
                "comment": " A stateful accumulator for a paginated list of objects.\n",
                "args": [
                    "a"
                ],
                "type": "{ client : Client, objects : List a, decoder : Decoder (List a), total : Int, nextPage : Maybe Url }"
            },
            {
                "name": "Request",
                "comment": " A type describing a Kinto request. Basically an alias for an\n[elm-http-builder](https://package.elm-lang.org/packages/lukewestby/elm-http-builder/latest)\nrequest builder.\n",
                "args": [
                    "a"
                ],
                "type": "RequestBuilder a"
            },
            {
                "name": "Resource",
                "comment": " A type for a Kinto resource. Usually constructed using one of `bucketResource`,\n`collectionResource` or `recordResource`.\n",
                "args": [
                    "a"
                ],
                "type": "{ itemEndpoint : String -> Endpoint, listEndpoint : Endpoint, itemDecoder : Decoder a, listDecoder : Decoder (List a) }"
            }
        ],
        "values": [
            {
                "name": "bucketResource",
                "comment": " A constructor for a bucket resource.\n\n    bucketResource bucketDecoder\n\n",
                "type": "Decoder a -> Resource a"
            },
            {
                "name": "client",
                "comment": " A constructor for a `Client`.\n\n    client\n        \"https://kinto.dev.mozaws.net/v1/\"\n        (Basic \"username\" \"password\")\n\n",
                "type": "Url -> Auth -> Client"
            },
            {
                "name": "collectionResource",
                "comment": " A constructor for a collection resource.\n\n    collectionResource \"bucket-name\" collectionDecoder\n\n",
                "type": "BucketName -> Decoder a -> Resource a"
            },
            {
                "name": "create",
                "comment": " Create a POST request on a plural endpoint:\n\n    client\n        |> create resource itemId data\n\n",
                "type": "Resource a -> Body -> Client -> Request a"
            },
            {
                "name": "decodeData",
                "comment": " A decoder for a basic Kinto response.\n",
                "type": "Decoder a -> Decoder a"
            },
            {
                "name": "delete",
                "comment": " Create a DELETE request on an item endpoint:\n\n    client\n        |> delete resource itemId\n\n",
                "type": "Resource a -> String -> Client -> Request a"
            },
            {
                "name": "emptyPager",
                "comment": " Initialize a `Pager`.\n\n    emptyPager resource\n\n",
                "type": "Client -> Resource a -> Pager a"
            },
            {
                "name": "encodeData",
                "comment": " An encoder for a basic Kinto query.\n",
                "type": "Value -> Value"
            },
            {
                "name": "endpointUrl",
                "comment": " Get the full url to an endpoint.\n\n    endpointUrl \"https://kinto.dev.mozaws.net/v1/\" (RecordListEndpoint \"default\" \"test-items\")\n\n",
                "type": "String -> Endpoint -> Url"
            },
            {
                "name": "errorDecoder",
                "comment": " A decoder for `ErrorDetail`. This is the kind of json message answered by Kinto when there's an error:\n\n    {\"errno\":104,\n     \"message\":\"Please authenticate yourself to use this endpoint.\",\n     \"code\":401,\n     \"error\":\"Unauthorized\"}\n\n",
                "type": "Decoder ErrorDetail"
            },
            {
                "name": "extractError",
                "comment": " Extract an `Error` from an `Http.Error`.\n",
                "type": "Error -> Error"
            },
            {
                "name": "get",
                "comment": " Create a GET request on an item endpoint\n\n    client\n        |> get resource itemId\n\n",
                "type": "Resource a -> String -> Client -> Request a"
            },
            {
                "name": "getList",
                "comment": " Create a GET request on one of the plural endpoints. As lists are always\npossibly paginated, When the request is succesful, a `Pager` is attached to the\nreponse message.\n\n    client\n        |> getList resource\n\n",
                "type": "Resource a -> Client -> RequestBuilder (Pager a)"
            },
            {
                "name": "headersForAuth",
                "comment": " Return the header name and value for the given `Auth`.\n\n    headersForAuth (Basic \"username\" \"password\")\n\n",
                "type": "Auth -> ( String, String )"
            },
            {
                "name": "limit",
                "comment": " Add [limit query parameters](http://kinto.readthedocs.io/en/stable/api/1.x/pagination.html) to the request sent to the Kinto server.\n\n    client\n        |> getList recordResource\n        |> limit 10\n        |> send TodosFetched\n\n",
                "type": "Int -> Request a -> Request a"
            },
            {
                "name": "loadNextPage",
                "comment": " If a pager has a `nextPage`, creates a GET request to retrieve the next page of objects.\nWhen the request is succesful, a `Pager` with new objects appended is attached to the\nreponse message.\n\n    client\n        |> loadNextPage pager\n\n",
                "type": "Pager a -> Maybe (RequestBuilder (Pager a))"
            },
            {
                "name": "recordResource",
                "comment": " A constructor for a record resource.\n",
                "type": "BucketName -> CollectionName -> Decoder a -> Resource a"
            },
            {
                "name": "replace",
                "comment": " Create a PUT request on an item endpoint:\n\n    client\n        |> replace resource itemId data\n\n",
                "type": "Resource a -> String -> Body -> Client -> Request a"
            },
            {
                "name": "send",
                "comment": " Send a request to the Kinto server.\n\n    client\n        |> create resource data\n        |> send TodosCreated\n\n",
                "type": "(Result Error a -> msg) -> Request a -> Cmd msg"
            },
            {
                "name": "sortBy",
                "comment": " Add [sorting query parameters](http://kinto.readthedocs.io/en/stable/api/1.x/sorting.html) to the request sent to the Kinto server.\n\n    client\n        |> getList recordResource\n        |> sortBy [\"title\", \"description\"]\n        |> send TodosFetched\n\n",
                "type": "List String -> Request a -> Request a"
            },
            {
                "name": "toRequest",
                "comment": " Extract the Http.Request component of the request, for introspection,\ntesting, or converting to a `Task` using `Http.toTask`.\n\n    client\n        |> create resource data\n        |> toRequest\n\n",
                "type": "Request a -> Request a"
            },
            {
                "name": "toResponse",
                "comment": " Change the error from an `Http.Error` to an `Error`.\n",
                "type": "Result Error a -> Result Error a"
            },
            {
                "name": "update",
                "comment": " Create a PATCH request on an item endpoint:\n\n    client\n        |> update resource itemId data\n\n",
                "type": "Resource a -> String -> Body -> Client -> Request a"
            },
            {
                "name": "updatePager",
                "comment": " Update a previous pager with data from a new one, appending new objects\nto the previous list.\n\n    updatePager nextPager previousPager\n\n",
                "type": "Pager a -> Pager a -> Pager a"
            },
            {
                "name": "withFilter",
                "comment": " Add [filtering query parameters](http://kinto.readthedocs.io/en/stable/api/1.x/filtering.html) to the request sent to the Kinto server.\n\n    client\n        |> getList recordResource\n        |> withFilter (NOT \"title\" \"test\")\n        |> send TodosFetched\n\n",
                "type": "Filter -> Request a -> Request a"
            }
        ],
        "binops": []
    }
]