[{"name":"ReponoStorage","comment":" Enables access to the Repono Storage server. These methods and types are simple wrappers over\nthe REST api.\n\n\n# Error\n\n@docs Error\n\n\n# Container\n\n@docs ContainerId, ContainerInfo, Container, getContainer, newContainer\n\n\n# File\n\n@docs FileId, FilePath, FileInfo, getFile, getFileJson, getFileString, putFile, deleteFile\n\n\n# Token\n\n@docs TokenId, TokenInfo, getToken, newToken\n\n\n# Report\n\n@docs ReportId, Report, ReportInfo, getReports, postReport\n\n","unions":[{"name":"Container","comment":" Contains the information of the container information request.\n\nThe variant `EncryptedInfo` will be used if the container is encrypted and no password was given\nduring the request.\n\n","args":[],"cases":[["FullInfo",["ReponoStorage.ContainerInfo"]],["EncryptedInfo",["ReponoStorage.ContainerId"]]]},{"name":"Error","comment":" The error states that can happen during the requests.\n\n  - `InvalidPassword`: An invalid password was provided. This error will also returned if no password\n    was provided if one was expected or a password was provided if none was expected.\n  - `InvalidToken`: The token doesn't meet the criteria. Try to use another one.\n  - `NotFound`: A requested object wasn't found. Maybe it was deleted?\n  - `StorageLimitReached`: This upload cannot be done because this will conflict with the storage\n    limitations. Try to use to delete a file first or use a different container.\n  - `TokenExhaused`: The token can no longer be used for this operation.\n  - `HttpError`: The returned HTTP error cannot be expressed with one of the above.\n\n","args":[],"cases":[["HttpError",["Http.Error"]],["InvalidPassword",[]],["InvalidToken",[]],["NotFound",[]],["StorageLimitReached",[]],["TokenExhaused",[]]]}],"aliases":[{"name":"ContainerId","comment":" An alias for the container id. This is used to make the api more readable.\n","args":[],"type":"String.String"},{"name":"ContainerInfo","comment":" Contains the information about the storage container\n","args":[],"type":"{ id : ReponoStorage.ContainerId, created : Time.Posix, modified : Time.Posix, encrypted : Basics.Bool, storageLimit : Basics.Int, files : List.List ReponoStorage.FileInfo }"},{"name":"FileId","comment":" An alias for the file id. This is used to make the api more readable.\n","args":[],"type":"String.String"},{"name":"FileInfo","comment":" Contains the information about a file inside a container\n","args":[],"type":"{ id : ReponoStorage.FileId, path : ReponoStorage.FilePath, created : Time.Posix, modified : Time.Posix, size : Basics.Int, mime : String.String }"},{"name":"FilePath","comment":" An alias for the file path. This is used to make the api more readable.\n","args":[],"type":"String.String"},{"name":"Report","comment":" The information of a single report that was submitted.\n","args":[],"type":"{ reason : String.String, files : List.List ReponoStorage.FilePath }"},{"name":"ReportId","comment":" An alias for the report id. This is used to make the api more readable.\n","args":[],"type":"String.String"},{"name":"ReportInfo","comment":" The stored meta information including the full report that was submitted.\n","args":[],"type":"{ id : ReponoStorage.ReportId, containerId : ReponoStorage.ContainerId, created : Time.Posix, report : ReponoStorage.Report }"},{"name":"TokenId","comment":" An alias for the token id. This is used to make the api more readable.\n","args":[],"type":"String.String"},{"name":"TokenInfo","comment":" Contains the information about a token that can be used to create container.\n\n  - `id`: The id of this token\n  - `parent`: The parent token id\n  - `childTokens`: The direct child tokens\n  - `childContainer`: The container that are created with this token\n  - `storageLimit`: The maximum storage limit for subsequent containers and tokens. If this field is\n    null than this token has an unlimited storage capacity and cannot be used to create containers\n    directly.\n  - `tokenLimit`: The remaining number of tokens that can be created with this one. Only the root\n    token can have an unlimited number of null.\n  - `expired`: States if this token is expired and can be used to create more tokens and containers.\n  - `created`: The creation date of this token.\n  - `used`: The last date this token was used.\n  - `hint`: The hint that was provided durring creation\n\n","args":[],"type":"{ id : ReponoStorage.TokenId, parent : Maybe.Maybe ReponoStorage.TokenId, childTokens : List.List ReponoStorage.TokenId, childContainer : List.List ReponoStorage.ContainerId, storageLimit : Maybe.Maybe Basics.Int, tokenLimit : Maybe.Maybe Basics.Int, expired : Basics.Bool, created : Time.Posix, used : Time.Posix, hint : Maybe.Maybe String.String }"}],"values":[{"name":"deleteFile","comment":" Deletes a stored file.\n\n**Expected Errors:**\n\n  - `InvalidPassword`: The password is wrong or not provided (if required).\n  - `NotFound`: File not found.\n\n","type":"String.String -> (Result.Result ReponoStorage.Error () -> msg) -> ReponoStorage.ContainerId -> ReponoStorage.FilePath -> Maybe.Maybe String.String -> Platform.Cmd.Cmd msg"},{"name":"getContainer","comment":" Returns the information of the container.\n\n**Expected Errors:**\n\n  - `InvalidPassword`: Invalid password for this container. This will also return if the container is\n    not encrypted and a password was given.\n  - `NotFound`: No container with this id found\n\n","type":"String.String -> (Result.Result ReponoStorage.Error ReponoStorage.Container -> msg) -> ReponoStorage.ContainerId -> Maybe.Maybe String.String -> Platform.Cmd.Cmd msg"},{"name":"getFile","comment":" Get the binary content of a file.\n\nExpected Errors:\n\n  - `InvalidPassword`: The password is wrong or not provided (if required).\n  - `NotFound`: The file or container not found.\n\n","type":"String.String -> (Result.Result ReponoStorage.Error a -> msg) -> ReponoStorage.ContainerId -> ReponoStorage.FilePath -> Maybe.Maybe String.String -> Bytes.Decode.Decoder a -> Platform.Cmd.Cmd msg"},{"name":"getFileJson","comment":" Get the json content of a file.\n\nExpected Errors:\n\n  - `InvalidPassword`: The password is wrong or not provided (if required).\n  - `NotFound`: The file or container not found.\n\n","type":"String.String -> (Result.Result ReponoStorage.Error a -> msg) -> ReponoStorage.ContainerId -> ReponoStorage.FilePath -> Maybe.Maybe String.String -> Json.Decode.Decoder a -> Platform.Cmd.Cmd msg"},{"name":"getFileString","comment":" Get the text content of a file.\n\nExpected Errors:\n\n  - `InvalidPassword`: The password is wrong or not provided (if required).\n  - `NotFound`: The file or container not found.\n\n","type":"String.String -> (Result.Result ReponoStorage.Error String.String -> msg) -> ReponoStorage.ContainerId -> ReponoStorage.FilePath -> Maybe.Maybe String.String -> Platform.Cmd.Cmd msg"},{"name":"getReports","comment":" Search for open reports. These reports can be limited to a specific container or file that\nshould be contained.\n\n**Expected Errors:** _none_\n\n","type":"String.String -> (Result.Result ReponoStorage.Error (List.List ReponoStorage.ReportInfo) -> msg) -> Maybe.Maybe ReponoStorage.ContainerId -> Maybe.Maybe ReponoStorage.FilePath -> Platform.Cmd.Cmd msg"},{"name":"getToken","comment":" Returns the information of the Token\n\n**Expected Errors:**\n\n  - `NotFound`: No token with this id found\n\n","type":"String.String -> (Result.Result ReponoStorage.Error ReponoStorage.TokenInfo -> msg) -> ReponoStorage.TokenId -> Platform.Cmd.Cmd msg"},{"name":"newContainer","comment":" Create a new container which can store a specific amount of data. For this a token has to be\nprovided that has a storage limit.\n\nExpected Errors:\n\n  - `InvalidToken`: A container cannot be created. This can be the reason of one of the following:\n      - The creation token is expired or does not exists\n      - The creation token has no specified storage limit\n      - The creation token is exhaused and cannot create more container\n\n","type":"String.String -> (Result.Result ReponoStorage.Error ReponoStorage.ContainerInfo -> msg) -> ReponoStorage.TokenId -> Maybe.Maybe String.String -> Platform.Cmd.Cmd msg"},{"name":"newToken","comment":" Creates a new token. The new token is a child of the parent token.\n\n**Expected Errors:**\n\n  - `NotFound`: No parent token with this id found\n  - `TokenExhaused`: The parent token cannot create a new child token. That can be the reason\n    of:\n      - parent token has no remaining tokens to create (token limit is 0).\n      - parent token is expired\n      - requested storage limit is larger than the storage limit of the header token\n      - requested token limit is larger than the token limit of the header token\n\n","type":"String.String -> (Result.Result ReponoStorage.Error ReponoStorage.TokenInfo -> msg) -> ReponoStorage.TokenId -> Basics.Int -> Basics.Int -> Maybe.Maybe String.String -> Platform.Cmd.Cmd msg"},{"name":"postReport","comment":" Creates a new report for a container. This report will be stored and will be checked by a\nmoderator. If a report is accepted the corresponding files or container will be deleted. After a\nreport is solved (successful or not) they will be removed from the list.\n\nIf is possible to block creation tokens because of reports.\n\nIf the container is password protected it is required to add the correct password. This password\nwill be stored in clear text on the server until the report is resolved.\n\n**Expected Errors:**\n\n  - `InvalidPassword`: Invalid password for the container\n  - `NotFound`: Container not found\n\n","type":"String.String -> (Result.Result ReponoStorage.Error ReponoStorage.ReportInfo -> msg) -> ReponoStorage.ContainerId -> Maybe.Maybe String.String -> ReponoStorage.Report -> Platform.Cmd.Cmd msg"},{"name":"putFile","comment":" Replace or upload the new content of a file.\n\n**Limitations:**\n\n  - The given file path exceed the maximum length of 1024 bytes.\n  - The new file size won't make the total size of the container larger than it's maximum allowence.\n  - File sizes smaller than 1024 bytes will be counted as they will use 1024 bytes.\n  - Each container can have a maximum of 1024 files. After that adding new files to the container is\n    not allowed until some are deleted.\n\n**Expected Errors:**\n\n  - `InvalidPassword`: The password is wrong or not provided (if required).\n  - `NotFound`: File not found.\n  - `StorageLimitReached`: Replacing or adding this file will make the container larger than its\n    allowed to be. This code will also returned if the provided path is larger than 1024 bytes.\n\n","type":"String.String -> (Result.Result ReponoStorage.Error () -> msg) -> ReponoStorage.ContainerId -> ReponoStorage.FilePath -> Maybe.Maybe String.String -> Http.Body -> Platform.Cmd.Cmd msg"}],"binops":[]}]