[{"name":"Webnative","comment":" Interface for [webnative](https://github.com/fission-suite/webnative#readme).\n\n1.  [Getting Started](#getting-started)\n2.  [Ports](#ports)\n3.  [Authorisation](#authorisation)\n4.  [Authentication](#authentication)\n5.  [Filesystem](#filesystem)\n6.  [Miscellaneous](#miscellaneous)\n\n\n# Getting Started\n\n@docs init, InitOptions, initWithOptions, initialise, initialize\n\n\n# Ports\n\nData flowing through the ports. See `🚀` in the `decodeResponse` example on how to handle the result from `init`.\n\n@docs decodeResponse, DecodedResponse, Artifact, NoArtifact, Request, Response, Error, error\n\n\n# Authorisation\n\n@docs redirectToLobby, RedirectTo, AppPermissions, FileSystemPermissions, Permissions\n\n\n# Authentication\n\n@docs isAuthenticated, State, AuthSucceededState, AuthCancelledState, ContinuationState\n\n\n# Filesystem\n\n@docs loadFilesystem\n\n","unions":[{"name":"Artifact","comment":" Artifact we receive in the response.\n","args":[],"cases":[["Initialisation",["Webnative.State"]],["NoArtifact",["Webnative.NoArtifact"]]]},{"name":"DecodedResponse","comment":" Request, or response, context.\n","args":["tag"],"cases":[["Webnative",["Webnative.Artifact"]],["WebnativeError",["Webnative.Error"]],["Wnfs",["tag","Wnfs.Artifact"]],["WnfsError",["Wnfs.Error"]]]},{"name":"Error","comment":" Possible errors.\n","args":[],"cases":[["DecodingError",["String.String"]],["InvalidMethod",["String.String"]],["InsecureContext",[]],["JavascriptError",["String.String"]],["UnsupportedBrowser",[]]]},{"name":"NoArtifact","comment":" Not really artifacts, but kind of.\nPart of the `Artifact` type.\n","args":[],"cases":[["LoadedFilesystemManually",[]],["RedirectingToLobby",[]]]},{"name":"RedirectTo","comment":" Where the authorisation lobby should redirect to after authorisation.\n","args":[],"cases":[["CurrentUrl",[]],["RedirectTo",["Url.Url"]]]},{"name":"State","comment":" Initialisation state, result from `init`.\n","args":[],"cases":[["NotAuthorised",[]],["AuthSucceeded",["Webnative.AuthSucceededState"]],["AuthCancelled",["Webnative.AuthCancelledState"]],["Continuation",["Webnative.ContinuationState"]]]}],"aliases":[{"name":"AppPermissions","comment":" Application permissions.\n","args":[],"type":"{ creator : String.String, name : String.String }"},{"name":"AuthCancelledState","comment":" State attributes when auth was cancelled.\n","args":[],"type":"{ cancellationReason : String.String, throughLobby : Basics.Bool }"},{"name":"AuthSucceededState","comment":" State attributes when auth has succeeded.\n","args":[],"type":"{ newUser : Basics.Bool, throughLobby : Basics.Bool, username : String.String }"},{"name":"ContinuationState","comment":" State attributes when continueing a session.\n","args":[],"type":"{ newUser : Basics.Bool, throughLobby : Basics.Bool, username : String.String }"},{"name":"FileSystemPermissions","comment":" Filesystem permissions.\n","args":[],"type":"{ privatePaths : List.List String.String, publicPaths : List.List String.String }"},{"name":"InitOptions","comment":" Options for `initWithOptions`.\n","args":[],"type":"{ autoRemoveUrlParams : Basics.Bool, loadFilesystem : Basics.Bool }"},{"name":"Permissions","comment":" Permissions to ask the user.\n","args":[],"type":"{ app : Maybe.Maybe Webnative.AppPermissions, fs : Maybe.Maybe Webnative.FileSystemPermissions }"},{"name":"Request","comment":" Request from webnative.\n","args":[],"type":"{ context : String.String, tag : String.String, method : String.String, arguments : List.List Json.Encode.Value }"},{"name":"Response","comment":" Response from webnative.\n","args":[],"type":"{ context : String.String, error : Maybe.Maybe String.String, tag : String.String, method : String.String, data : Json.Encode.Value }"}],"values":[{"name":"decodeResponse","comment":" Decode the result, the `Response`, from our `Request`.\nConnect this up with `webnativeResponse` subscription port.\n\n    subscriptions =\n        Ports.webnativeResponse GotWebnativeResponse\n\nAnd then in `update` use this function.\n\n    GotWebnativeResponse response ->\n      case Webnative.decodeResponse tagFromString response of\n        -----------------------------------------\n        -- 🚀\n        -----------------------------------------\n        Webnative ( Initialisation state ) ->\n          if Webnative.isAuthenticated state then\n            loadUserData\n          else\n            welcome\n\n        -----------------------------------------\n        -- 💾\n        -----------------------------------------\n        Wnfs ReadHelloTxt ( Utf8Content helloContents ) ->\n          -- Do something with content from hello.txt\n\n        Wnfs Mutation _ ->\n          ( model\n          , { tag = PointerUpdated }\n              |> Wnfs.publish\n              |> Ports.webnativeRequest\n          )\n\n        -----------------------------------------\n        -- 🥵\n        -----------------------------------------\n        WebnativeError err -> Webnative.error err\n        WnfsError err -> Wnfs.error err\n\nSee the [README](../) for the full example.\n\n","type":"(String.String -> Result.Result String.String tag) -> Webnative.Response -> Webnative.DecodedResponse tag"},{"name":"error","comment":" `Error` message.\n","type":"Webnative.Error -> String.String"},{"name":"init","comment":" 🚀 **Start here**\n\nCheck if we're authenticated, process any lobby query-parameters present in the URL, and initiate the user's filesystem if authenticated (can be disabled using `initWithOptions`).\n\nSee `loadFileSystem` if you want to load the user's filesystem yourself.\n**NOTE**, this only works on the main/ui thread, as it uses `window.location`.\n\nSee the [README](../) for an example.\n\n","type":"Webnative.Permissions -> Webnative.Request"},{"name":"initWithOptions","comment":" Initialise webnative, with options.\n","type":"Webnative.InitOptions -> Webnative.Permissions -> Webnative.Request"},{"name":"initialise","comment":" Alias for `init`.\n","type":"Webnative.Permissions -> Webnative.Request"},{"name":"initialize","comment":" Alias for `init`.\n","type":"Webnative.Permissions -> Webnative.Request"},{"name":"isAuthenticated","comment":" Are we authenticated?\n","type":"Webnative.State -> Basics.Bool"},{"name":"loadFilesystem","comment":" Load in the filesystem manually.\n","type":"Webnative.Permissions -> Webnative.Request"},{"name":"redirectToLobby","comment":" Redirect to the authorisation lobby.\n","type":"Webnative.RedirectTo -> Webnative.Permissions -> Webnative.Request"}],"binops":[]},{"name":"Wnfs","comment":" Interact with your webnative [filesystem](https://guide.fission.codes/developers/webnative#file-system).\n\n\n# Actions\n\n@docs publish\n\n\n## Mutations\n\n@docs mkdir, mv, rm, write, writeUtf8\n\n\n## Queries\n\n@docs exists, ls, read, readUtf8\n\n\n## Aliases\n\n@docs add, cat\n\n\n# Requests & Responses\n\n@docs Base, Attributes, Artifact, Kind, Entry\n\n\n# Errors\n\n@docs Error, error\n\n","unions":[{"name":"Artifact","comment":" Artifact we receive in the response.\n","args":[],"cases":[["NoArtifact",[]],["Boolean",["Basics.Bool"]],["CID",["String.String"]],["DirectoryContent",["List.List Wnfs.Entry"]],["FileContent",["Bytes.Bytes"]],["Utf8Content",["String.String"]]]},{"name":"Base","comment":" Base of the WNFS action.\n","args":[],"cases":[["AppData",["Wnfs.AppPermissions"]],["Private",[]],["Public",[]]]},{"name":"Error","comment":" Possible errors.\n","args":[],"cases":[["DecodingError",["String.String"]],["InvalidMethod",["String.String"]],["TagParsingError",["String.String"]],["JavascriptError",["String.String"]]]},{"name":"Kind","comment":" Kind of `Entry`.\n","args":[],"cases":[["Directory",[]],["File",[]]]}],"aliases":[{"name":"Attributes","comment":" WNFS action attributes.\n","args":[],"type":"{ path : List.List String.String, tag : String.String }"},{"name":"Entry","comment":" Directory `Entry`.\n","args":[],"type":"{ cid : String.String, name : String.String, kind : Wnfs.Kind, size : Basics.Int }"}],"values":[{"name":"add","comment":" Alias for `write`.\n","type":"Wnfs.Base -> Wnfs.Attributes -> Bytes.Bytes -> Wnfs.Request"},{"name":"cat","comment":" Alias for `read`.\n","type":"Wnfs.Base -> Wnfs.Attributes -> Wnfs.Request"},{"name":"error","comment":" `Error` message.\n","type":"Wnfs.Error -> String.String"},{"name":"exists","comment":" Check if something exists in the filesystem.\n","type":"Wnfs.Base -> Wnfs.Attributes -> Wnfs.Request"},{"name":"ls","comment":" List a directory.\n","type":"Wnfs.Base -> Wnfs.Attributes -> Wnfs.Request"},{"name":"mkdir","comment":" Create a directory.\n","type":"Wnfs.Base -> Wnfs.Attributes -> Wnfs.Request"},{"name":"mv","comment":" Move.\n","type":"Wnfs.Base -> { from : List.List String.String, to : List.List String.String, tag : String.String } -> Wnfs.Request"},{"name":"publish","comment":" Publish your changes to your filesystem.\n**📢 You should run this after doing mutations.**\nSee [README](../) examples for more info.\n","type":"{ tag : String.String } -> Wnfs.Request"},{"name":"read","comment":" Read something from the filesystem in the form of `Bytes`.\n","type":"Wnfs.Base -> Wnfs.Attributes -> Wnfs.Request"},{"name":"readUtf8","comment":" Read something from the filesystem in the form of a `String`.\n","type":"Wnfs.Base -> Wnfs.Attributes -> Wnfs.Request"},{"name":"rm","comment":" Remove.\n","type":"Wnfs.Base -> Wnfs.Attributes -> Wnfs.Request"},{"name":"write","comment":" Write to the filesystem using `Bytes`.\n","type":"Wnfs.Base -> Wnfs.Attributes -> Bytes.Bytes -> Wnfs.Request"},{"name":"writeUtf8","comment":" Write to the filesystem using a `String`.\n","type":"Wnfs.Base -> Wnfs.Attributes -> String.String -> Wnfs.Request"}],"binops":[]}]