From 5ab00d51df5279f1dc478a960a0bda20660ddc2f Mon Sep 17 00:00:00 2001 From: Adam DiCarlo Date: Mon, 23 Jun 2025 14:31:30 -0700 Subject: [PATCH 01/33] Move codegen API to separate Elm package --- codegen/elm.codegen.json | 4 +- elm-open-api-codegen/.gitignore | 1 + elm-open-api-codegen/codegen/Generate.elm | 24 + elm-open-api-codegen/codegen/elm.codegen.json | 22 + elm-open-api-codegen/codegen/elm.json | 33 + elm-open-api-codegen/elm.json | 33 + .../helpers}/Http.elm | 0 .../helpers}/Task.elm | 0 elm-open-api-codegen/scripts/sync-elm-codegen | 11 + .../src}/BackendTask/Extra.elm | 0 .../src}/CliMonad.elm | 0 {src => elm-open-api-codegen/src}/Common.elm | 0 .../src}/Elm/Declare/Extra.elm | 0 .../src}/Elm/Extra.elm | 0 .../src}/Elm/Op/Extra.elm | 0 elm-open-api-codegen/src/Gen/ApiRoute.elm | 1366 ++++ elm-open-api-codegen/src/Gen/Array.elm | 1185 ++++ elm-open-api-codegen/src/Gen/BackendTask.elm | 3583 +++++++++++ .../src/Gen/BackendTask/Custom.elm | 401 ++ .../src/Gen/BackendTask/Do.elm | 1198 ++++ .../src/Gen/BackendTask/Env.elm | 252 + .../src/Gen/BackendTask/File.elm | 981 +++ .../src/Gen/BackendTask/Glob.elm | 2137 +++++++ .../src/Gen/BackendTask/Http.elm | 1663 +++++ .../src/Gen/BackendTask/Random.elm | 166 + .../src/Gen/BackendTask/Stream.elm | 3163 ++++++++++ .../src/Gen/BackendTask/Time.elm | 73 + elm-open-api-codegen/src/Gen/Base64.elm | 369 ++ elm-open-api-codegen/src/Gen/Basics.elm | 1715 +++++ elm-open-api-codegen/src/Gen/Bitwise.elm | 302 + elm-open-api-codegen/src/Gen/Bytes.elm | 166 + elm-open-api-codegen/src/Gen/Bytes/Decode.elm | 1865 ++++++ elm-open-api-codegen/src/Gen/Bytes/Encode.elm | 863 +++ elm-open-api-codegen/src/Gen/Char.elm | 560 ++ elm-open-api-codegen/src/Gen/Date.elm | 2474 ++++++++ elm-open-api-codegen/src/Gen/Debug.elm | 201 + elm-open-api-codegen/src/Gen/Dict.elm | 1910 ++++++ elm-open-api-codegen/src/Gen/Effect/Http.elm | 3296 ++++++++++ elm-open-api-codegen/src/Gen/Effect/Task.elm | 1908 ++++++ elm-open-api-codegen/src/Gen/FatalError.elm | 265 + elm-open-api-codegen/src/Gen/Head.elm | 1046 ++++ elm-open-api-codegen/src/Gen/Head/Seo.elm | 1278 ++++ elm-open-api-codegen/src/Gen/Http.elm | 2996 +++++++++ elm-open-api-codegen/src/Gen/Json/Decode.elm | 3562 +++++++++++ elm-open-api-codegen/src/Gen/Json/Encode.elm | 789 +++ elm-open-api-codegen/src/Gen/List.elm | 2378 +++++++ elm-open-api-codegen/src/Gen/Maybe.elm | 759 +++ .../src/Gen/Pages/ConcurrentSubmission.elm | 283 + .../src/Gen/Pages/Fetcher.elm | 375 ++ elm-open-api-codegen/src/Gen/Pages/Flags.elm | 80 + elm-open-api-codegen/src/Gen/Pages/Form.elm | 1036 +++ .../src/Gen/Pages/FormData.elm | 71 + .../src/Gen/Pages/Internal/NotFoundReason.elm | 410 ++ .../src/Gen/Pages/Internal/Platform.elm | 2380 +++++++ .../src/Gen/Pages/Internal/Platform/Cli.elm | 730 +++ .../Platform/GeneratorApplication.elm | 701 +++ .../src/Gen/Pages/Internal/ResponseSketch.elm | 250 + .../src/Gen/Pages/Internal/RoutePattern.elm | 1196 ++++ .../src/Gen/Pages/Internal/Router.elm | 340 + .../src/Gen/Pages/Manifest.elm | 1391 +++++ .../src/Gen/Pages/Manifest/Category.elm | 1068 ++++ .../src/Gen/Pages/Navigation.elm | 194 + .../src/Gen/Pages/PageUrl.elm | 212 + elm-open-api-codegen/src/Gen/Pages/Script.elm | 1063 ++++ .../src/Gen/Pages/Script/Spinner.elm | 1230 ++++ elm-open-api-codegen/src/Gen/Pages/Url.elm | 228 + elm-open-api-codegen/src/Gen/PagesMsg.elm | 250 + elm-open-api-codegen/src/Gen/Parser.elm | 3210 ++++++++++ .../src/Gen/Parser/Advanced.elm | 3241 ++++++++++ elm-open-api-codegen/src/Gen/Platform.elm | 427 ++ elm-open-api-codegen/src/Gen/Platform/Cmd.elm | 183 + elm-open-api-codegen/src/Gen/Platform/Sub.elm | 181 + elm-open-api-codegen/src/Gen/Process.elm | 259 + elm-open-api-codegen/src/Gen/Result.elm | 1266 ++++ elm-open-api-codegen/src/Gen/Rfc3339.elm | 698 +++ .../src/Gen/Scaffold/Form.elm | 678 ++ .../src/Gen/Scaffold/Route.elm | 1962 ++++++ .../src/Gen/Server/Request.elm | 1502 +++++ .../src/Gen/Server/Response.elm | 1275 ++++ .../src/Gen/Server/Session.elm | 974 +++ .../src/Gen/Server/SetCookie.elm | 985 +++ elm-open-api-codegen/src/Gen/Set.elm | 1250 ++++ elm-open-api-codegen/src/Gen/String.elm | 2140 +++++++ elm-open-api-codegen/src/Gen/Task.elm | 1499 +++++ elm-open-api-codegen/src/Gen/Time.elm | 1267 ++++ elm-open-api-codegen/src/Gen/Time/Extra.elm | 976 +++ elm-open-api-codegen/src/Gen/Tuple.elm | 391 ++ elm-open-api-codegen/src/Gen/Url.elm | 407 ++ elm-open-api-codegen/src/Gen/Url/Builder.elm | 702 +++ elm-open-api-codegen/src/Gen/Url/Parser.elm | 849 +++ .../src/Gen/Url/Parser/Query.elm | 1922 ++++++ elm-open-api-codegen/src/Gen/UrlPath.elm | 276 + .../src}/JsonSchema/Generate.elm | 0 .../src/OpenApi/BackendTask.elm | 898 +++ .../src}/OpenApi/Common/Internal.elm | 0 .../src}/OpenApi/Config.elm | 0 .../src}/OpenApi/Generate.elm | 17 +- .../src}/SchemaUtils.elm | 0 elm-open-api-codegen/src/Util/List.elm | 11 + elm-open-api-codegen/src/Utils.elm | 75 + .../tests}/Test/OpenApi/Generate.elm | 0 .../tests}/TestCommon.elm | 0 elm.json | 15 +- example-using-api/openapi.yaml | 18 + example-using-api/package-lock.json | 5541 +++++++++++++++++ example-using-api/package.json | 15 + example-using-api/scripts/after-codegen.sh | 2 + example-using-api/scripts/before-codegen.sh | 2 + example-using-api/scripts/elm.json | 73 + .../scripts/src/CodeGenOpenApi.elm | 39 + package.json | 2 +- shell.nix | 2 +- src/Cli.elm | 892 +-- src/TestGenScript.elm | 4 +- 114 files changed, 93697 insertions(+), 915 deletions(-) create mode 100644 elm-open-api-codegen/.gitignore create mode 100644 elm-open-api-codegen/codegen/Generate.elm create mode 100644 elm-open-api-codegen/codegen/elm.codegen.json create mode 100644 elm-open-api-codegen/codegen/elm.json create mode 100644 elm-open-api-codegen/elm.json rename {helpers => elm-open-api-codegen/helpers}/Http.elm (100%) rename {helpers => elm-open-api-codegen/helpers}/Task.elm (100%) create mode 100755 elm-open-api-codegen/scripts/sync-elm-codegen rename {src => elm-open-api-codegen/src}/BackendTask/Extra.elm (100%) rename {src => elm-open-api-codegen/src}/CliMonad.elm (100%) rename {src => elm-open-api-codegen/src}/Common.elm (100%) rename {src => elm-open-api-codegen/src}/Elm/Declare/Extra.elm (100%) rename {src => elm-open-api-codegen/src}/Elm/Extra.elm (100%) rename {src => elm-open-api-codegen/src}/Elm/Op/Extra.elm (100%) create mode 100644 elm-open-api-codegen/src/Gen/ApiRoute.elm create mode 100644 elm-open-api-codegen/src/Gen/Array.elm create mode 100644 elm-open-api-codegen/src/Gen/BackendTask.elm create mode 100644 elm-open-api-codegen/src/Gen/BackendTask/Custom.elm create mode 100644 elm-open-api-codegen/src/Gen/BackendTask/Do.elm create mode 100644 elm-open-api-codegen/src/Gen/BackendTask/Env.elm create mode 100644 elm-open-api-codegen/src/Gen/BackendTask/File.elm create mode 100644 elm-open-api-codegen/src/Gen/BackendTask/Glob.elm create mode 100644 elm-open-api-codegen/src/Gen/BackendTask/Http.elm create mode 100644 elm-open-api-codegen/src/Gen/BackendTask/Random.elm create mode 100644 elm-open-api-codegen/src/Gen/BackendTask/Stream.elm create mode 100644 elm-open-api-codegen/src/Gen/BackendTask/Time.elm create mode 100644 elm-open-api-codegen/src/Gen/Base64.elm create mode 100644 elm-open-api-codegen/src/Gen/Basics.elm create mode 100644 elm-open-api-codegen/src/Gen/Bitwise.elm create mode 100644 elm-open-api-codegen/src/Gen/Bytes.elm create mode 100644 elm-open-api-codegen/src/Gen/Bytes/Decode.elm create mode 100644 elm-open-api-codegen/src/Gen/Bytes/Encode.elm create mode 100644 elm-open-api-codegen/src/Gen/Char.elm create mode 100644 elm-open-api-codegen/src/Gen/Date.elm create mode 100644 elm-open-api-codegen/src/Gen/Debug.elm create mode 100644 elm-open-api-codegen/src/Gen/Dict.elm create mode 100644 elm-open-api-codegen/src/Gen/Effect/Http.elm create mode 100644 elm-open-api-codegen/src/Gen/Effect/Task.elm create mode 100644 elm-open-api-codegen/src/Gen/FatalError.elm create mode 100644 elm-open-api-codegen/src/Gen/Head.elm create mode 100644 elm-open-api-codegen/src/Gen/Head/Seo.elm create mode 100644 elm-open-api-codegen/src/Gen/Http.elm create mode 100644 elm-open-api-codegen/src/Gen/Json/Decode.elm create mode 100644 elm-open-api-codegen/src/Gen/Json/Encode.elm create mode 100644 elm-open-api-codegen/src/Gen/List.elm create mode 100644 elm-open-api-codegen/src/Gen/Maybe.elm create mode 100644 elm-open-api-codegen/src/Gen/Pages/ConcurrentSubmission.elm create mode 100644 elm-open-api-codegen/src/Gen/Pages/Fetcher.elm create mode 100644 elm-open-api-codegen/src/Gen/Pages/Flags.elm create mode 100644 elm-open-api-codegen/src/Gen/Pages/Form.elm create mode 100644 elm-open-api-codegen/src/Gen/Pages/FormData.elm create mode 100644 elm-open-api-codegen/src/Gen/Pages/Internal/NotFoundReason.elm create mode 100644 elm-open-api-codegen/src/Gen/Pages/Internal/Platform.elm create mode 100644 elm-open-api-codegen/src/Gen/Pages/Internal/Platform/Cli.elm create mode 100644 elm-open-api-codegen/src/Gen/Pages/Internal/Platform/GeneratorApplication.elm create mode 100644 elm-open-api-codegen/src/Gen/Pages/Internal/ResponseSketch.elm create mode 100644 elm-open-api-codegen/src/Gen/Pages/Internal/RoutePattern.elm create mode 100644 elm-open-api-codegen/src/Gen/Pages/Internal/Router.elm create mode 100644 elm-open-api-codegen/src/Gen/Pages/Manifest.elm create mode 100644 elm-open-api-codegen/src/Gen/Pages/Manifest/Category.elm create mode 100644 elm-open-api-codegen/src/Gen/Pages/Navigation.elm create mode 100644 elm-open-api-codegen/src/Gen/Pages/PageUrl.elm create mode 100644 elm-open-api-codegen/src/Gen/Pages/Script.elm create mode 100644 elm-open-api-codegen/src/Gen/Pages/Script/Spinner.elm create mode 100644 elm-open-api-codegen/src/Gen/Pages/Url.elm create mode 100644 elm-open-api-codegen/src/Gen/PagesMsg.elm create mode 100644 elm-open-api-codegen/src/Gen/Parser.elm create mode 100644 elm-open-api-codegen/src/Gen/Parser/Advanced.elm create mode 100644 elm-open-api-codegen/src/Gen/Platform.elm create mode 100644 elm-open-api-codegen/src/Gen/Platform/Cmd.elm create mode 100644 elm-open-api-codegen/src/Gen/Platform/Sub.elm create mode 100644 elm-open-api-codegen/src/Gen/Process.elm create mode 100644 elm-open-api-codegen/src/Gen/Result.elm create mode 100644 elm-open-api-codegen/src/Gen/Rfc3339.elm create mode 100644 elm-open-api-codegen/src/Gen/Scaffold/Form.elm create mode 100644 elm-open-api-codegen/src/Gen/Scaffold/Route.elm create mode 100644 elm-open-api-codegen/src/Gen/Server/Request.elm create mode 100644 elm-open-api-codegen/src/Gen/Server/Response.elm create mode 100644 elm-open-api-codegen/src/Gen/Server/Session.elm create mode 100644 elm-open-api-codegen/src/Gen/Server/SetCookie.elm create mode 100644 elm-open-api-codegen/src/Gen/Set.elm create mode 100644 elm-open-api-codegen/src/Gen/String.elm create mode 100644 elm-open-api-codegen/src/Gen/Task.elm create mode 100644 elm-open-api-codegen/src/Gen/Time.elm create mode 100644 elm-open-api-codegen/src/Gen/Time/Extra.elm create mode 100644 elm-open-api-codegen/src/Gen/Tuple.elm create mode 100644 elm-open-api-codegen/src/Gen/Url.elm create mode 100644 elm-open-api-codegen/src/Gen/Url/Builder.elm create mode 100644 elm-open-api-codegen/src/Gen/Url/Parser.elm create mode 100644 elm-open-api-codegen/src/Gen/Url/Parser/Query.elm create mode 100644 elm-open-api-codegen/src/Gen/UrlPath.elm rename {src => elm-open-api-codegen/src}/JsonSchema/Generate.elm (100%) create mode 100644 elm-open-api-codegen/src/OpenApi/BackendTask.elm rename {src => elm-open-api-codegen/src}/OpenApi/Common/Internal.elm (100%) rename {src => elm-open-api-codegen/src}/OpenApi/Config.elm (100%) rename {src => elm-open-api-codegen/src}/OpenApi/Generate.elm (99%) rename {src => elm-open-api-codegen/src}/SchemaUtils.elm (100%) create mode 100644 elm-open-api-codegen/src/Util/List.elm create mode 100644 elm-open-api-codegen/src/Utils.elm rename {tests => elm-open-api-codegen/tests}/Test/OpenApi/Generate.elm (100%) rename {tests => elm-open-api-codegen/tests}/TestCommon.elm (100%) create mode 100644 example-using-api/openapi.yaml create mode 100644 example-using-api/package-lock.json create mode 100644 example-using-api/package.json create mode 100755 example-using-api/scripts/after-codegen.sh create mode 100755 example-using-api/scripts/before-codegen.sh create mode 100644 example-using-api/scripts/elm.json create mode 100644 example-using-api/scripts/src/CodeGenOpenApi.elm diff --git a/codegen/elm.codegen.json b/codegen/elm.codegen.json index 8e0c1ebb..b1298b8e 100644 --- a/codegen/elm.codegen.json +++ b/codegen/elm.codegen.json @@ -8,7 +8,7 @@ "elm/json": "1.1.3", "elm-community/json-extra": "4.3.0", "elm/url": "1.0.0", - "dillonkearns/elm-pages": "10.1.0", + "dillonkearns/elm-pages": "10.2.2", "justinmimbs/time-extra": "1.2.0", "justinmimbs/date": "4.1.0", "elm/time": "1.0.0", @@ -20,4 +20,4 @@ "helpers" ] } -} \ No newline at end of file +} diff --git a/elm-open-api-codegen/.gitignore b/elm-open-api-codegen/.gitignore new file mode 100644 index 00000000..00833584 --- /dev/null +++ b/elm-open-api-codegen/.gitignore @@ -0,0 +1 @@ +codegen/Gen diff --git a/elm-open-api-codegen/codegen/Generate.elm b/elm-open-api-codegen/codegen/Generate.elm new file mode 100644 index 00000000..6a0e0d1b --- /dev/null +++ b/elm-open-api-codegen/codegen/Generate.elm @@ -0,0 +1,24 @@ + +module Generate exposing (main) + +{-| -} + +import Elm +import Elm.Annotation as Type +import Gen.CodeGen.Generate as Generate + + +main : Program {} () () +main = + Generate.run + [ file + ] + + +file : Elm.File +file = + Elm.file [ "HelloWorld" ] + [ Elm.declaration "hello" + (Elm.string "World!") + ] + diff --git a/elm-open-api-codegen/codegen/elm.codegen.json b/elm-open-api-codegen/codegen/elm.codegen.json new file mode 100644 index 00000000..779c4711 --- /dev/null +++ b/elm-open-api-codegen/codegen/elm.codegen.json @@ -0,0 +1,22 @@ +{ + "elm-codegen-version": "0.6.1", + "codegen-helpers": { + "packages": { + "danfishgold/base64-bytes": "1.1.0", + "dillonkearns/elm-pages": "10.2.2", + "elm/bytes": "1.0.8", + "elm/core": "1.0.5", + "elm/http": "2.0.0", + "elm/json": "1.1.3", + "elm/parser": "1.1.0", + "elm/time": "1.0.0", + "elm/url": "1.0.0", + "justinmimbs/date": "4.1.0", + "justinmimbs/time-extra": "1.2.0", + "wolfadex/elm-rfc3339": "2.0.0" + }, + "local": [ + "helpers" + ] + } +} diff --git a/elm-open-api-codegen/codegen/elm.json b/elm-open-api-codegen/codegen/elm.json new file mode 100644 index 00000000..ee9ee2ae --- /dev/null +++ b/elm-open-api-codegen/codegen/elm.json @@ -0,0 +1,33 @@ + +{ + "type": "application", + "source-directories": ["."], + "elm-version": "0.19.1", + "dependencies": { + "direct": { + "elm/browser": "1.0.2", + "elm/core": "1.0.5", + "elm/html": "1.0.0", + "elm/json": "1.1.3", + "mdgriffith/elm-codegen": "5.1.1" + }, + "indirect": { + "elm/parser": "1.1.0", + "elm/time": "1.0.0", + "elm/url": "1.0.0", + "elm/virtual-dom": "1.0.2", + "elm-community/basics-extra": "4.1.0", + "elm-community/list-extra": "8.6.0", + "miniBill/elm-unicode": "1.0.2", + "rtfeldman/elm-hex": "1.0.0", + "stil4m/elm-syntax": "7.2.9", + "stil4m/structured-writer": "1.0.3", + "the-sett/elm-pretty-printer": "3.0.0" + } + }, + "test-dependencies": { + "direct": {}, + "indirect": {} + } + } + diff --git a/elm-open-api-codegen/elm.json b/elm-open-api-codegen/elm.json new file mode 100644 index 00000000..dc66d647 --- /dev/null +++ b/elm-open-api-codegen/elm.json @@ -0,0 +1,33 @@ +{ + "type": "package", + "name": "wolfadex/elm-open-api-codegen", + "summary": "Code generation API from elm-open-api-cli", + "license": "BSD-3-Clause", + "version": "1.0.0", + "exposed-modules": [ + "Common", + "OpenApi.BackendTask", + "OpenApi.Config" + ], + "elm-version": "0.19.0 <= v < 0.20.0", + "dependencies": { + "dillonkearns/elm-pages": "10.2.2 <= v < 11.0.0", + "elm/core": "1.0.5 <= v < 2.0.0", + "elm/json": "1.1.3 <= v < 2.0.0", + "elm/regex": "1.0.0 <= v < 2.0.0", + "elm/url": "1.0.0 <= v < 2.0.0", + "elmcraft/core-extra": "2.2.0 <= v < 3.0.0", + "json-tools/json-schema": "1.0.2 <= v < 2.0.0", + "json-tools/json-value": "1.0.1 <= v < 2.0.0", + "mdgriffith/elm-codegen": "5.2.0 <= v < 6.0.0", + "miniBill/elm-fast-dict": "1.2.4 <= v < 2.0.0", + "myrho/yaml": "1.0.0 <= v < 2.0.0", + "turboMaCk/non-empty-list-alias": "1.4.0 <= v < 2.0.0", + "wolfadex/elm-ansi": "3.0.0 <= v < 4.0.0", + "wolfadex/elm-open-api": "2.0.0 <= v < 3.0.0" + }, + "test-dependencies": { + "elm-explorations/test": "2.2.0 <= v < 3.0.0", + "miniBill/elm-unicode": "1.1.1 <= v < 2.0.0" + } +} diff --git a/helpers/Http.elm b/elm-open-api-codegen/helpers/Http.elm similarity index 100% rename from helpers/Http.elm rename to elm-open-api-codegen/helpers/Http.elm diff --git a/helpers/Task.elm b/elm-open-api-codegen/helpers/Task.elm similarity index 100% rename from helpers/Task.elm rename to elm-open-api-codegen/helpers/Task.elm diff --git a/elm-open-api-codegen/scripts/sync-elm-codegen b/elm-open-api-codegen/scripts/sync-elm-codegen new file mode 100755 index 00000000..114ec124 --- /dev/null +++ b/elm-open-api-codegen/scripts/sync-elm-codegen @@ -0,0 +1,11 @@ +#!/usr/bin/env bash +set -e + +# In order for the package to be able to import Gen.* modules, we must put them +# in `src/`, since Elm packages do not support multiple source directories. +rm -rf src/Gen 2>/dev/null +npx --no -- elm-codegen install +mv codegen/Gen src/ + +# Avoid clashing module name with root project. +rm src/Gen/CodeGen/Generate.elm diff --git a/src/BackendTask/Extra.elm b/elm-open-api-codegen/src/BackendTask/Extra.elm similarity index 100% rename from src/BackendTask/Extra.elm rename to elm-open-api-codegen/src/BackendTask/Extra.elm diff --git a/src/CliMonad.elm b/elm-open-api-codegen/src/CliMonad.elm similarity index 100% rename from src/CliMonad.elm rename to elm-open-api-codegen/src/CliMonad.elm diff --git a/src/Common.elm b/elm-open-api-codegen/src/Common.elm similarity index 100% rename from src/Common.elm rename to elm-open-api-codegen/src/Common.elm diff --git a/src/Elm/Declare/Extra.elm b/elm-open-api-codegen/src/Elm/Declare/Extra.elm similarity index 100% rename from src/Elm/Declare/Extra.elm rename to elm-open-api-codegen/src/Elm/Declare/Extra.elm diff --git a/src/Elm/Extra.elm b/elm-open-api-codegen/src/Elm/Extra.elm similarity index 100% rename from src/Elm/Extra.elm rename to elm-open-api-codegen/src/Elm/Extra.elm diff --git a/src/Elm/Op/Extra.elm b/elm-open-api-codegen/src/Elm/Op/Extra.elm similarity index 100% rename from src/Elm/Op/Extra.elm rename to elm-open-api-codegen/src/Elm/Op/Extra.elm diff --git a/elm-open-api-codegen/src/Gen/ApiRoute.elm b/elm-open-api-codegen/src/Gen/ApiRoute.elm new file mode 100644 index 00000000..1d2e658b --- /dev/null +++ b/elm-open-api-codegen/src/Gen/ApiRoute.elm @@ -0,0 +1,1366 @@ +module Gen.ApiRoute exposing + ( moduleName_, single, preRender, serverRender, preRenderWithFallback, capture + , literal, slash, succeed, withGlobalHeadTags, toJson, getBuildTimeRoutes, getGlobalHeadTagsBackendTask + , annotation_, call_, values_ + ) + +{-| +# Generated bindings for ApiRoute + +@docs moduleName_, single, preRender, serverRender, preRenderWithFallback, capture +@docs literal, slash, succeed, withGlobalHeadTags, toJson, getBuildTimeRoutes +@docs getGlobalHeadTagsBackendTask, annotation_, call_, values_ +-} + + +import Elm +import Elm.Annotation as Type + + +{-| The name of this module. -} +moduleName_ : List String +moduleName_ = + [ "ApiRoute" ] + + +{-| Same as [`preRender`](#preRender), but for an ApiRoute that has no dynamic segments. This is just a bit simpler because +since there are no dynamic segments, you don't need to provide a BackendTask with the list of dynamic segments to pre-render because there is only a single possible route. + +single: + ApiRoute.ApiRouteBuilder (BackendTask.BackendTask FatalError.FatalError String) (List String) + -> ApiRoute.ApiRoute ApiRoute.Response +-} +single : Elm.Expression -> Elm.Expression +single singleArg_ = + Elm.apply + (Elm.value + { importFrom = [ "ApiRoute" ] + , name = "single" + , annotation = + Just + (Type.function + [ Type.namedWith + [ "ApiRoute" ] + "ApiRouteBuilder" + [ Type.namedWith + [ "BackendTask" ] + "BackendTask" + [ Type.namedWith + [ "FatalError" ] + "FatalError" + [] + , Type.string + ] + , Type.list Type.string + ] + ] + (Type.namedWith + [ "ApiRoute" ] + "ApiRoute" + [ Type.namedWith [ "ApiRoute" ] "Response" [] ] + ) + ) + } + ) + [ singleArg_ ] + + +{-| Pre-render files for a given route pattern statically at build-time. If you only need to serve a single file, you can use [`single`](#single) instead. + + import ApiRoute + import BackendTask + import BackendTask.Http + import Json.Decode as Decode + import Json.Encode as Encode + + starsApi : ApiRoute ApiRoute.Response + starsApi = + ApiRoute.succeed + (\user repoName -> + BackendTask.Http.getJson + ("https://api.github.com/repos/" ++ user ++ "/" ++ repoName) + (Decode.field "stargazers_count" Decode.int) + |> BackendTask.allowFatal + |> BackendTask.map + (\stars -> + Encode.object + [ ( "repo", Encode.string repoName ) + , ( "stars", Encode.int stars ) + ] + |> Encode.encode 2 + ) + ) + |> ApiRoute.literal "repo" + |> ApiRoute.slash + |> ApiRoute.capture + |> ApiRoute.slash + |> ApiRoute.capture + |> ApiRoute.slash + |> ApiRoute.literal ".json" + |> ApiRoute.preRender + (\route -> + BackendTask.succeed + [ route "dillonkearns" "elm-graphql" + , route "dillonkearns" "elm-pages" + ] + ) + +You can view these files in the dev server at , and when you run `elm-pages build` this will result in the following files being generated: + + - `dist/repo/dillonkearns/elm-graphql.json` + - `dist/repo/dillonkearns/elm-pages.json` + +Note: `dist` is the output folder for `elm-pages build`, so this will be accessible in your hosted site at `/repo/dillonkearns/elm-graphql.json` and `/repo/dillonkearns/elm-pages.json`. + +preRender: + (constructor + -> BackendTask.BackendTask FatalError.FatalError (List (List String))) + -> ApiRoute.ApiRouteBuilder (BackendTask.BackendTask FatalError.FatalError String) constructor + -> ApiRoute.ApiRoute ApiRoute.Response +-} +preRender : + (Elm.Expression -> Elm.Expression) -> Elm.Expression -> Elm.Expression +preRender preRenderArg_ preRenderArg_0 = + Elm.apply + (Elm.value + { importFrom = [ "ApiRoute" ] + , name = "preRender" + , annotation = + Just + (Type.function + [ Type.function + [ Type.var "constructor" ] + (Type.namedWith + [ "BackendTask" ] + "BackendTask" + [ Type.namedWith + [ "FatalError" ] + "FatalError" + [] + , Type.list (Type.list Type.string) + ] + ) + , Type.namedWith + [ "ApiRoute" ] + "ApiRouteBuilder" + [ Type.namedWith + [ "BackendTask" ] + "BackendTask" + [ Type.namedWith + [ "FatalError" ] + "FatalError" + [] + , Type.string + ] + , Type.var "constructor" + ] + ] + (Type.namedWith + [ "ApiRoute" ] + "ApiRoute" + [ Type.namedWith [ "ApiRoute" ] "Response" [] ] + ) + ) + } + ) + [ Elm.functionReduced "preRenderUnpack" preRenderArg_, preRenderArg_0 ] + + +{-| serverRender: + ApiRoute.ApiRouteBuilder (Server.Request.Request + -> BackendTask.BackendTask FatalError.FatalError (Server.Response.Response Basics.Never Basics.Never)) constructor + -> ApiRoute.ApiRoute ApiRoute.Response +-} +serverRender : Elm.Expression -> Elm.Expression +serverRender serverRenderArg_ = + Elm.apply + (Elm.value + { importFrom = [ "ApiRoute" ] + , name = "serverRender" + , annotation = + Just + (Type.function + [ Type.namedWith + [ "ApiRoute" ] + "ApiRouteBuilder" + [ Type.function + [ Type.namedWith + [ "Server", "Request" ] + "Request" + [] + ] + (Type.namedWith + [ "BackendTask" ] + "BackendTask" + [ Type.namedWith + [ "FatalError" ] + "FatalError" + [] + , Type.namedWith + [ "Server", "Response" ] + "Response" + [ Type.namedWith + [ "Basics" ] + "Never" + [] + , Type.namedWith + [ "Basics" ] + "Never" + [] + ] + ] + ) + , Type.var "constructor" + ] + ] + (Type.namedWith + [ "ApiRoute" ] + "ApiRoute" + [ Type.namedWith [ "ApiRoute" ] "Response" [] ] + ) + ) + } + ) + [ serverRenderArg_ ] + + +{-| preRenderWithFallback: + (constructor + -> BackendTask.BackendTask FatalError.FatalError (List (List String))) + -> ApiRoute.ApiRouteBuilder (BackendTask.BackendTask FatalError.FatalError (Server.Response.Response Basics.Never Basics.Never)) constructor + -> ApiRoute.ApiRoute ApiRoute.Response +-} +preRenderWithFallback : + (Elm.Expression -> Elm.Expression) -> Elm.Expression -> Elm.Expression +preRenderWithFallback preRenderWithFallbackArg_ preRenderWithFallbackArg_0 = + Elm.apply + (Elm.value + { importFrom = [ "ApiRoute" ] + , name = "preRenderWithFallback" + , annotation = + Just + (Type.function + [ Type.function + [ Type.var "constructor" ] + (Type.namedWith + [ "BackendTask" ] + "BackendTask" + [ Type.namedWith + [ "FatalError" ] + "FatalError" + [] + , Type.list (Type.list Type.string) + ] + ) + , Type.namedWith + [ "ApiRoute" ] + "ApiRouteBuilder" + [ Type.namedWith + [ "BackendTask" ] + "BackendTask" + [ Type.namedWith + [ "FatalError" ] + "FatalError" + [] + , Type.namedWith + [ "Server", "Response" ] + "Response" + [ Type.namedWith [ "Basics" ] "Never" [] + , Type.namedWith [ "Basics" ] "Never" [] + ] + ] + , Type.var "constructor" + ] + ] + (Type.namedWith + [ "ApiRoute" ] + "ApiRoute" + [ Type.namedWith [ "ApiRoute" ] "Response" [] ] + ) + ) + } + ) + [ Elm.functionReduced + "preRenderWithFallbackUnpack" + preRenderWithFallbackArg_ + , preRenderWithFallbackArg_0 + ] + + +{-| Captures a dynamic segment from the route. + +capture: + ApiRoute.ApiRouteBuilder (String -> a) constructor + -> ApiRoute.ApiRouteBuilder a (String -> constructor) +-} +capture : Elm.Expression -> Elm.Expression +capture captureArg_ = + Elm.apply + (Elm.value + { importFrom = [ "ApiRoute" ] + , name = "capture" + , annotation = + Just + (Type.function + [ Type.namedWith + [ "ApiRoute" ] + "ApiRouteBuilder" + [ Type.function [ Type.string ] (Type.var "a") + , Type.var "constructor" + ] + ] + (Type.namedWith + [ "ApiRoute" ] + "ApiRouteBuilder" + [ Type.var "a" + , Type.function + [ Type.string ] + (Type.var "constructor") + ] + ) + ) + } + ) + [ captureArg_ ] + + +{-| A literal String segment of a route. + +literal: + String + -> ApiRoute.ApiRouteBuilder a constructor + -> ApiRoute.ApiRouteBuilder a constructor +-} +literal : String -> Elm.Expression -> Elm.Expression +literal literalArg_ literalArg_0 = + Elm.apply + (Elm.value + { importFrom = [ "ApiRoute" ] + , name = "literal" + , annotation = + Just + (Type.function + [ Type.string + , Type.namedWith + [ "ApiRoute" ] + "ApiRouteBuilder" + [ Type.var "a", Type.var "constructor" ] + ] + (Type.namedWith + [ "ApiRoute" ] + "ApiRouteBuilder" + [ Type.var "a", Type.var "constructor" ] + ) + ) + } + ) + [ Elm.string literalArg_, literalArg_0 ] + + +{-| A path separator within the route. + +slash: ApiRoute.ApiRouteBuilder a constructor -> ApiRoute.ApiRouteBuilder a constructor +-} +slash : Elm.Expression -> Elm.Expression +slash slashArg_ = + Elm.apply + (Elm.value + { importFrom = [ "ApiRoute" ] + , name = "slash" + , annotation = + Just + (Type.function + [ Type.namedWith + [ "ApiRoute" ] + "ApiRouteBuilder" + [ Type.var "a", Type.var "constructor" ] + ] + (Type.namedWith + [ "ApiRoute" ] + "ApiRouteBuilder" + [ Type.var "a", Type.var "constructor" ] + ) + ) + } + ) + [ slashArg_ ] + + +{-| Starts the definition of a route with any captured segments. + +succeed: a -> ApiRoute.ApiRouteBuilder a (List String) +-} +succeed : Elm.Expression -> Elm.Expression +succeed succeedArg_ = + Elm.apply + (Elm.value + { importFrom = [ "ApiRoute" ] + , name = "succeed" + , annotation = + Just + (Type.function + [ Type.var "a" ] + (Type.namedWith + [ "ApiRoute" ] + "ApiRouteBuilder" + [ Type.var "a", Type.list Type.string ] + ) + ) + } + ) + [ succeedArg_ ] + + +{-| Include head tags on every page's HTML. + +withGlobalHeadTags: + BackendTask.BackendTask FatalError.FatalError (List Head.Tag) + -> ApiRoute.ApiRoute response + -> ApiRoute.ApiRoute response +-} +withGlobalHeadTags : Elm.Expression -> Elm.Expression -> Elm.Expression +withGlobalHeadTags withGlobalHeadTagsArg_ withGlobalHeadTagsArg_0 = + Elm.apply + (Elm.value + { importFrom = [ "ApiRoute" ] + , name = "withGlobalHeadTags" + , annotation = + Just + (Type.function + [ Type.namedWith + [ "BackendTask" ] + "BackendTask" + [ Type.namedWith [ "FatalError" ] "FatalError" [] + , Type.list (Type.namedWith [ "Head" ] "Tag" []) + ] + , Type.namedWith + [ "ApiRoute" ] + "ApiRoute" + [ Type.var "response" ] + ] + (Type.namedWith + [ "ApiRoute" ] + "ApiRoute" + [ Type.var "response" ] + ) + ) + } + ) + [ withGlobalHeadTagsArg_, withGlobalHeadTagsArg_0 ] + + +{-| Turn the route into a pattern in JSON format. For internal uses. + +toJson: ApiRoute.ApiRoute response -> Json.Encode.Value +-} +toJson : Elm.Expression -> Elm.Expression +toJson toJsonArg_ = + Elm.apply + (Elm.value + { importFrom = [ "ApiRoute" ] + , name = "toJson" + , annotation = + Just + (Type.function + [ Type.namedWith + [ "ApiRoute" ] + "ApiRoute" + [ Type.var "response" ] + ] + (Type.namedWith [ "Json", "Encode" ] "Value" []) + ) + } + ) + [ toJsonArg_ ] + + +{-| For internal use by generated code. Not so useful in user-land. + +getBuildTimeRoutes: + ApiRoute.ApiRoute response + -> BackendTask.BackendTask FatalError.FatalError (List String) +-} +getBuildTimeRoutes : Elm.Expression -> Elm.Expression +getBuildTimeRoutes getBuildTimeRoutesArg_ = + Elm.apply + (Elm.value + { importFrom = [ "ApiRoute" ] + , name = "getBuildTimeRoutes" + , annotation = + Just + (Type.function + [ Type.namedWith + [ "ApiRoute" ] + "ApiRoute" + [ Type.var "response" ] + ] + (Type.namedWith + [ "BackendTask" ] + "BackendTask" + [ Type.namedWith [ "FatalError" ] "FatalError" [] + , Type.list Type.string + ] + ) + ) + } + ) + [ getBuildTimeRoutesArg_ ] + + +{-| For internal use. + +getGlobalHeadTagsBackendTask: + ApiRoute.ApiRoute response + -> Maybe (BackendTask.BackendTask FatalError.FatalError (List Head.Tag)) +-} +getGlobalHeadTagsBackendTask : Elm.Expression -> Elm.Expression +getGlobalHeadTagsBackendTask getGlobalHeadTagsBackendTaskArg_ = + Elm.apply + (Elm.value + { importFrom = [ "ApiRoute" ] + , name = "getGlobalHeadTagsBackendTask" + , annotation = + Just + (Type.function + [ Type.namedWith + [ "ApiRoute" ] + "ApiRoute" + [ Type.var "response" ] + ] + (Type.maybe + (Type.namedWith + [ "BackendTask" ] + "BackendTask" + [ Type.namedWith + [ "FatalError" ] + "FatalError" + [] + , Type.list + (Type.namedWith [ "Head" ] "Tag" []) + ] + ) + ) + ) + } + ) + [ getGlobalHeadTagsBackendTaskArg_ ] + + +annotation_ : + { apiRoute : Type.Annotation -> Type.Annotation + , apiRouteBuilder : Type.Annotation -> Type.Annotation -> Type.Annotation + , response : Type.Annotation + } +annotation_ = + { apiRoute = + \apiRouteArg0 -> + Type.alias + moduleName_ + "ApiRoute" + [ apiRouteArg0 ] + (Type.namedWith + [ "Internal", "ApiRoute" ] + "ApiRoute" + [ Type.var "response" ] + ) + , apiRouteBuilder = + \apiRouteBuilderArg0 apiRouteBuilderArg1 -> + Type.alias + moduleName_ + "ApiRouteBuilder" + [ apiRouteBuilderArg0, apiRouteBuilderArg1 ] + (Type.namedWith + [ "Internal", "ApiRoute" ] + "ApiRouteBuilder" + [ Type.var "a", Type.var "constructor" ] + ) + , response = + Type.alias + moduleName_ + "Response" + [] + (Type.namedWith [ "Json", "Encode" ] "Value" []) + } + + +call_ : + { single : Elm.Expression -> Elm.Expression + , preRender : Elm.Expression -> Elm.Expression -> Elm.Expression + , serverRender : Elm.Expression -> Elm.Expression + , preRenderWithFallback : Elm.Expression -> Elm.Expression -> Elm.Expression + , capture : Elm.Expression -> Elm.Expression + , literal : Elm.Expression -> Elm.Expression -> Elm.Expression + , slash : Elm.Expression -> Elm.Expression + , succeed : Elm.Expression -> Elm.Expression + , withGlobalHeadTags : Elm.Expression -> Elm.Expression -> Elm.Expression + , toJson : Elm.Expression -> Elm.Expression + , getBuildTimeRoutes : Elm.Expression -> Elm.Expression + , getGlobalHeadTagsBackendTask : Elm.Expression -> Elm.Expression + } +call_ = + { single = + \singleArg_ -> + Elm.apply + (Elm.value + { importFrom = [ "ApiRoute" ] + , name = "single" + , annotation = + Just + (Type.function + [ Type.namedWith + [ "ApiRoute" ] + "ApiRouteBuilder" + [ Type.namedWith + [ "BackendTask" ] + "BackendTask" + [ Type.namedWith + [ "FatalError" ] + "FatalError" + [] + , Type.string + ] + , Type.list Type.string + ] + ] + (Type.namedWith + [ "ApiRoute" ] + "ApiRoute" + [ Type.namedWith + [ "ApiRoute" ] + "Response" + [] + ] + ) + ) + } + ) + [ singleArg_ ] + , preRender = + \preRenderArg_ preRenderArg_0 -> + Elm.apply + (Elm.value + { importFrom = [ "ApiRoute" ] + , name = "preRender" + , annotation = + Just + (Type.function + [ Type.function + [ Type.var "constructor" ] + (Type.namedWith + [ "BackendTask" ] + "BackendTask" + [ Type.namedWith + [ "FatalError" ] + "FatalError" + [] + , Type.list (Type.list Type.string) + ] + ) + , Type.namedWith + [ "ApiRoute" ] + "ApiRouteBuilder" + [ Type.namedWith + [ "BackendTask" ] + "BackendTask" + [ Type.namedWith + [ "FatalError" ] + "FatalError" + [] + , Type.string + ] + , Type.var "constructor" + ] + ] + (Type.namedWith + [ "ApiRoute" ] + "ApiRoute" + [ Type.namedWith + [ "ApiRoute" ] + "Response" + [] + ] + ) + ) + } + ) + [ preRenderArg_, preRenderArg_0 ] + , serverRender = + \serverRenderArg_ -> + Elm.apply + (Elm.value + { importFrom = [ "ApiRoute" ] + , name = "serverRender" + , annotation = + Just + (Type.function + [ Type.namedWith + [ "ApiRoute" ] + "ApiRouteBuilder" + [ Type.function + [ Type.namedWith + [ "Server", "Request" ] + "Request" + [] + ] + (Type.namedWith + [ "BackendTask" ] + "BackendTask" + [ Type.namedWith + [ "FatalError" ] + "FatalError" + [] + , Type.namedWith + [ "Server", "Response" ] + "Response" + [ Type.namedWith + [ "Basics" ] + "Never" + [] + , Type.namedWith + [ "Basics" ] + "Never" + [] + ] + ] + ) + , Type.var "constructor" + ] + ] + (Type.namedWith + [ "ApiRoute" ] + "ApiRoute" + [ Type.namedWith + [ "ApiRoute" ] + "Response" + [] + ] + ) + ) + } + ) + [ serverRenderArg_ ] + , preRenderWithFallback = + \preRenderWithFallbackArg_ preRenderWithFallbackArg_0 -> + Elm.apply + (Elm.value + { importFrom = [ "ApiRoute" ] + , name = "preRenderWithFallback" + , annotation = + Just + (Type.function + [ Type.function + [ Type.var "constructor" ] + (Type.namedWith + [ "BackendTask" ] + "BackendTask" + [ Type.namedWith + [ "FatalError" ] + "FatalError" + [] + , Type.list (Type.list Type.string) + ] + ) + , Type.namedWith + [ "ApiRoute" ] + "ApiRouteBuilder" + [ Type.namedWith + [ "BackendTask" ] + "BackendTask" + [ Type.namedWith + [ "FatalError" ] + "FatalError" + [] + , Type.namedWith + [ "Server", "Response" ] + "Response" + [ Type.namedWith + [ "Basics" ] + "Never" + [] + , Type.namedWith + [ "Basics" ] + "Never" + [] + ] + ] + , Type.var "constructor" + ] + ] + (Type.namedWith + [ "ApiRoute" ] + "ApiRoute" + [ Type.namedWith + [ "ApiRoute" ] + "Response" + [] + ] + ) + ) + } + ) + [ preRenderWithFallbackArg_, preRenderWithFallbackArg_0 ] + , capture = + \captureArg_ -> + Elm.apply + (Elm.value + { importFrom = [ "ApiRoute" ] + , name = "capture" + , annotation = + Just + (Type.function + [ Type.namedWith + [ "ApiRoute" ] + "ApiRouteBuilder" + [ Type.function + [ Type.string ] + (Type.var "a") + , Type.var "constructor" + ] + ] + (Type.namedWith + [ "ApiRoute" ] + "ApiRouteBuilder" + [ Type.var "a" + , Type.function + [ Type.string ] + (Type.var "constructor") + ] + ) + ) + } + ) + [ captureArg_ ] + , literal = + \literalArg_ literalArg_0 -> + Elm.apply + (Elm.value + { importFrom = [ "ApiRoute" ] + , name = "literal" + , annotation = + Just + (Type.function + [ Type.string + , Type.namedWith + [ "ApiRoute" ] + "ApiRouteBuilder" + [ Type.var "a", Type.var "constructor" ] + ] + (Type.namedWith + [ "ApiRoute" ] + "ApiRouteBuilder" + [ Type.var "a", Type.var "constructor" ] + ) + ) + } + ) + [ literalArg_, literalArg_0 ] + , slash = + \slashArg_ -> + Elm.apply + (Elm.value + { importFrom = [ "ApiRoute" ] + , name = "slash" + , annotation = + Just + (Type.function + [ Type.namedWith + [ "ApiRoute" ] + "ApiRouteBuilder" + [ Type.var "a", Type.var "constructor" ] + ] + (Type.namedWith + [ "ApiRoute" ] + "ApiRouteBuilder" + [ Type.var "a", Type.var "constructor" ] + ) + ) + } + ) + [ slashArg_ ] + , succeed = + \succeedArg_ -> + Elm.apply + (Elm.value + { importFrom = [ "ApiRoute" ] + , name = "succeed" + , annotation = + Just + (Type.function + [ Type.var "a" ] + (Type.namedWith + [ "ApiRoute" ] + "ApiRouteBuilder" + [ Type.var "a", Type.list Type.string ] + ) + ) + } + ) + [ succeedArg_ ] + , withGlobalHeadTags = + \withGlobalHeadTagsArg_ withGlobalHeadTagsArg_0 -> + Elm.apply + (Elm.value + { importFrom = [ "ApiRoute" ] + , name = "withGlobalHeadTags" + , annotation = + Just + (Type.function + [ Type.namedWith + [ "BackendTask" ] + "BackendTask" + [ Type.namedWith + [ "FatalError" ] + "FatalError" + [] + , Type.list + (Type.namedWith [ "Head" ] "Tag" []) + ] + , Type.namedWith + [ "ApiRoute" ] + "ApiRoute" + [ Type.var "response" ] + ] + (Type.namedWith + [ "ApiRoute" ] + "ApiRoute" + [ Type.var "response" ] + ) + ) + } + ) + [ withGlobalHeadTagsArg_, withGlobalHeadTagsArg_0 ] + , toJson = + \toJsonArg_ -> + Elm.apply + (Elm.value + { importFrom = [ "ApiRoute" ] + , name = "toJson" + , annotation = + Just + (Type.function + [ Type.namedWith + [ "ApiRoute" ] + "ApiRoute" + [ Type.var "response" ] + ] + (Type.namedWith + [ "Json", "Encode" ] + "Value" + [] + ) + ) + } + ) + [ toJsonArg_ ] + , getBuildTimeRoutes = + \getBuildTimeRoutesArg_ -> + Elm.apply + (Elm.value + { importFrom = [ "ApiRoute" ] + , name = "getBuildTimeRoutes" + , annotation = + Just + (Type.function + [ Type.namedWith + [ "ApiRoute" ] + "ApiRoute" + [ Type.var "response" ] + ] + (Type.namedWith + [ "BackendTask" ] + "BackendTask" + [ Type.namedWith + [ "FatalError" ] + "FatalError" + [] + , Type.list Type.string + ] + ) + ) + } + ) + [ getBuildTimeRoutesArg_ ] + , getGlobalHeadTagsBackendTask = + \getGlobalHeadTagsBackendTaskArg_ -> + Elm.apply + (Elm.value + { importFrom = [ "ApiRoute" ] + , name = "getGlobalHeadTagsBackendTask" + , annotation = + Just + (Type.function + [ Type.namedWith + [ "ApiRoute" ] + "ApiRoute" + [ Type.var "response" ] + ] + (Type.maybe + (Type.namedWith + [ "BackendTask" ] + "BackendTask" + [ Type.namedWith + [ "FatalError" ] + "FatalError" + [] + , Type.list + (Type.namedWith + [ "Head" ] + "Tag" + [] + ) + ] + ) + ) + ) + } + ) + [ getGlobalHeadTagsBackendTaskArg_ ] + } + + +values_ : + { single : Elm.Expression + , preRender : Elm.Expression + , serverRender : Elm.Expression + , preRenderWithFallback : Elm.Expression + , capture : Elm.Expression + , literal : Elm.Expression + , slash : Elm.Expression + , succeed : Elm.Expression + , withGlobalHeadTags : Elm.Expression + , toJson : Elm.Expression + , getBuildTimeRoutes : Elm.Expression + , getGlobalHeadTagsBackendTask : Elm.Expression + } +values_ = + { single = + Elm.value + { importFrom = [ "ApiRoute" ] + , name = "single" + , annotation = + Just + (Type.function + [ Type.namedWith + [ "ApiRoute" ] + "ApiRouteBuilder" + [ Type.namedWith + [ "BackendTask" ] + "BackendTask" + [ Type.namedWith + [ "FatalError" ] + "FatalError" + [] + , Type.string + ] + , Type.list Type.string + ] + ] + (Type.namedWith + [ "ApiRoute" ] + "ApiRoute" + [ Type.namedWith [ "ApiRoute" ] "Response" [] ] + ) + ) + } + , preRender = + Elm.value + { importFrom = [ "ApiRoute" ] + , name = "preRender" + , annotation = + Just + (Type.function + [ Type.function + [ Type.var "constructor" ] + (Type.namedWith + [ "BackendTask" ] + "BackendTask" + [ Type.namedWith + [ "FatalError" ] + "FatalError" + [] + , Type.list (Type.list Type.string) + ] + ) + , Type.namedWith + [ "ApiRoute" ] + "ApiRouteBuilder" + [ Type.namedWith + [ "BackendTask" ] + "BackendTask" + [ Type.namedWith + [ "FatalError" ] + "FatalError" + [] + , Type.string + ] + , Type.var "constructor" + ] + ] + (Type.namedWith + [ "ApiRoute" ] + "ApiRoute" + [ Type.namedWith [ "ApiRoute" ] "Response" [] ] + ) + ) + } + , serverRender = + Elm.value + { importFrom = [ "ApiRoute" ] + , name = "serverRender" + , annotation = + Just + (Type.function + [ Type.namedWith + [ "ApiRoute" ] + "ApiRouteBuilder" + [ Type.function + [ Type.namedWith + [ "Server", "Request" ] + "Request" + [] + ] + (Type.namedWith + [ "BackendTask" ] + "BackendTask" + [ Type.namedWith + [ "FatalError" ] + "FatalError" + [] + , Type.namedWith + [ "Server", "Response" ] + "Response" + [ Type.namedWith + [ "Basics" ] + "Never" + [] + , Type.namedWith + [ "Basics" ] + "Never" + [] + ] + ] + ) + , Type.var "constructor" + ] + ] + (Type.namedWith + [ "ApiRoute" ] + "ApiRoute" + [ Type.namedWith [ "ApiRoute" ] "Response" [] ] + ) + ) + } + , preRenderWithFallback = + Elm.value + { importFrom = [ "ApiRoute" ] + , name = "preRenderWithFallback" + , annotation = + Just + (Type.function + [ Type.function + [ Type.var "constructor" ] + (Type.namedWith + [ "BackendTask" ] + "BackendTask" + [ Type.namedWith + [ "FatalError" ] + "FatalError" + [] + , Type.list (Type.list Type.string) + ] + ) + , Type.namedWith + [ "ApiRoute" ] + "ApiRouteBuilder" + [ Type.namedWith + [ "BackendTask" ] + "BackendTask" + [ Type.namedWith + [ "FatalError" ] + "FatalError" + [] + , Type.namedWith + [ "Server", "Response" ] + "Response" + [ Type.namedWith [ "Basics" ] "Never" [] + , Type.namedWith [ "Basics" ] "Never" [] + ] + ] + , Type.var "constructor" + ] + ] + (Type.namedWith + [ "ApiRoute" ] + "ApiRoute" + [ Type.namedWith [ "ApiRoute" ] "Response" [] ] + ) + ) + } + , capture = + Elm.value + { importFrom = [ "ApiRoute" ] + , name = "capture" + , annotation = + Just + (Type.function + [ Type.namedWith + [ "ApiRoute" ] + "ApiRouteBuilder" + [ Type.function [ Type.string ] (Type.var "a") + , Type.var "constructor" + ] + ] + (Type.namedWith + [ "ApiRoute" ] + "ApiRouteBuilder" + [ Type.var "a" + , Type.function + [ Type.string ] + (Type.var "constructor") + ] + ) + ) + } + , literal = + Elm.value + { importFrom = [ "ApiRoute" ] + , name = "literal" + , annotation = + Just + (Type.function + [ Type.string + , Type.namedWith + [ "ApiRoute" ] + "ApiRouteBuilder" + [ Type.var "a", Type.var "constructor" ] + ] + (Type.namedWith + [ "ApiRoute" ] + "ApiRouteBuilder" + [ Type.var "a", Type.var "constructor" ] + ) + ) + } + , slash = + Elm.value + { importFrom = [ "ApiRoute" ] + , name = "slash" + , annotation = + Just + (Type.function + [ Type.namedWith + [ "ApiRoute" ] + "ApiRouteBuilder" + [ Type.var "a", Type.var "constructor" ] + ] + (Type.namedWith + [ "ApiRoute" ] + "ApiRouteBuilder" + [ Type.var "a", Type.var "constructor" ] + ) + ) + } + , succeed = + Elm.value + { importFrom = [ "ApiRoute" ] + , name = "succeed" + , annotation = + Just + (Type.function + [ Type.var "a" ] + (Type.namedWith + [ "ApiRoute" ] + "ApiRouteBuilder" + [ Type.var "a", Type.list Type.string ] + ) + ) + } + , withGlobalHeadTags = + Elm.value + { importFrom = [ "ApiRoute" ] + , name = "withGlobalHeadTags" + , annotation = + Just + (Type.function + [ Type.namedWith + [ "BackendTask" ] + "BackendTask" + [ Type.namedWith [ "FatalError" ] "FatalError" [] + , Type.list (Type.namedWith [ "Head" ] "Tag" []) + ] + , Type.namedWith + [ "ApiRoute" ] + "ApiRoute" + [ Type.var "response" ] + ] + (Type.namedWith + [ "ApiRoute" ] + "ApiRoute" + [ Type.var "response" ] + ) + ) + } + , toJson = + Elm.value + { importFrom = [ "ApiRoute" ] + , name = "toJson" + , annotation = + Just + (Type.function + [ Type.namedWith + [ "ApiRoute" ] + "ApiRoute" + [ Type.var "response" ] + ] + (Type.namedWith [ "Json", "Encode" ] "Value" []) + ) + } + , getBuildTimeRoutes = + Elm.value + { importFrom = [ "ApiRoute" ] + , name = "getBuildTimeRoutes" + , annotation = + Just + (Type.function + [ Type.namedWith + [ "ApiRoute" ] + "ApiRoute" + [ Type.var "response" ] + ] + (Type.namedWith + [ "BackendTask" ] + "BackendTask" + [ Type.namedWith [ "FatalError" ] "FatalError" [] + , Type.list Type.string + ] + ) + ) + } + , getGlobalHeadTagsBackendTask = + Elm.value + { importFrom = [ "ApiRoute" ] + , name = "getGlobalHeadTagsBackendTask" + , annotation = + Just + (Type.function + [ Type.namedWith + [ "ApiRoute" ] + "ApiRoute" + [ Type.var "response" ] + ] + (Type.maybe + (Type.namedWith + [ "BackendTask" ] + "BackendTask" + [ Type.namedWith + [ "FatalError" ] + "FatalError" + [] + , Type.list + (Type.namedWith [ "Head" ] "Tag" []) + ] + ) + ) + ) + } + } \ No newline at end of file diff --git a/elm-open-api-codegen/src/Gen/Array.elm b/elm-open-api-codegen/src/Gen/Array.elm new file mode 100644 index 00000000..6003e08c --- /dev/null +++ b/elm-open-api-codegen/src/Gen/Array.elm @@ -0,0 +1,1185 @@ +module Gen.Array exposing + ( moduleName_, empty, initialize, repeat, fromList, isEmpty + , length, get, set, push, append, slice, toList + , toIndexedList, map, indexedMap, foldl, foldr, filter, annotation_ + , call_, values_ + ) + +{-| +# Generated bindings for Array + +@docs moduleName_, empty, initialize, repeat, fromList, isEmpty +@docs length, get, set, push, append, slice +@docs toList, toIndexedList, map, indexedMap, foldl, foldr +@docs filter, annotation_, call_, values_ +-} + + +import Elm +import Elm.Annotation as Type + + +{-| The name of this module. -} +moduleName_ : List String +moduleName_ = + [ "Array" ] + + +{-| Return an empty array. + + length empty == 0 + +empty: Array.Array a +-} +empty : Elm.Expression +empty = + Elm.value + { importFrom = [ "Array" ] + , name = "empty" + , annotation = + Just (Type.namedWith [ "Array" ] "Array" [ Type.var "a" ]) + } + + +{-| Initialize an array. `initialize n f` creates an array of length `n` with +the element at index `i` initialized to the result of `(f i)`. + + initialize 4 identity == fromList [0,1,2,3] + initialize 4 (\n -> n*n) == fromList [0,1,4,9] + initialize 4 (always 0) == fromList [0,0,0,0] + +initialize: Int -> (Int -> a) -> Array.Array a +-} +initialize : Int -> (Elm.Expression -> Elm.Expression) -> Elm.Expression +initialize initializeArg_ initializeArg_0 = + Elm.apply + (Elm.value + { importFrom = [ "Array" ] + , name = "initialize" + , annotation = + Just + (Type.function + [ Type.int + , Type.function [ Type.int ] (Type.var "a") + ] + (Type.namedWith [ "Array" ] "Array" [ Type.var "a" ]) + ) + } + ) + [ Elm.int initializeArg_ + , Elm.functionReduced "initializeUnpack" initializeArg_0 + ] + + +{-| Creates an array with a given length, filled with a default element. + + repeat 5 0 == fromList [0,0,0,0,0] + repeat 3 "cat" == fromList ["cat","cat","cat"] + +Notice that `repeat 3 x` is the same as `initialize 3 (always x)`. + +repeat: Int -> a -> Array.Array a +-} +repeat : Int -> Elm.Expression -> Elm.Expression +repeat repeatArg_ repeatArg_0 = + Elm.apply + (Elm.value + { importFrom = [ "Array" ] + , name = "repeat" + , annotation = + Just + (Type.function + [ Type.int, Type.var "a" ] + (Type.namedWith [ "Array" ] "Array" [ Type.var "a" ]) + ) + } + ) + [ Elm.int repeatArg_, repeatArg_0 ] + + +{-| Create an array from a `List`. + +fromList: List a -> Array.Array a +-} +fromList : List Elm.Expression -> Elm.Expression +fromList fromListArg_ = + Elm.apply + (Elm.value + { importFrom = [ "Array" ] + , name = "fromList" + , annotation = + Just + (Type.function + [ Type.list (Type.var "a") ] + (Type.namedWith [ "Array" ] "Array" [ Type.var "a" ]) + ) + } + ) + [ Elm.list fromListArg_ ] + + +{-| Determine if an array is empty. + + isEmpty empty == True + +isEmpty: Array.Array a -> Bool +-} +isEmpty : Elm.Expression -> Elm.Expression +isEmpty isEmptyArg_ = + Elm.apply + (Elm.value + { importFrom = [ "Array" ] + , name = "isEmpty" + , annotation = + Just + (Type.function + [ Type.namedWith [ "Array" ] "Array" [ Type.var "a" ] + ] + Type.bool + ) + } + ) + [ isEmptyArg_ ] + + +{-| Return the length of an array. + + length (fromList [1,2,3]) == 3 + +length: Array.Array a -> Int +-} +length : Elm.Expression -> Elm.Expression +length lengthArg_ = + Elm.apply + (Elm.value + { importFrom = [ "Array" ] + , name = "length" + , annotation = + Just + (Type.function + [ Type.namedWith [ "Array" ] "Array" [ Type.var "a" ] + ] + Type.int + ) + } + ) + [ lengthArg_ ] + + +{-| Return `Just` the element at the index or `Nothing` if the index is out of +range. + + get 0 (fromList [0,1,2]) == Just 0 + get 2 (fromList [0,1,2]) == Just 2 + get 5 (fromList [0,1,2]) == Nothing + get -1 (fromList [0,1,2]) == Nothing + +get: Int -> Array.Array a -> Maybe a +-} +get : Int -> Elm.Expression -> Elm.Expression +get getArg_ getArg_0 = + Elm.apply + (Elm.value + { importFrom = [ "Array" ] + , name = "get" + , annotation = + Just + (Type.function + [ Type.int + , Type.namedWith [ "Array" ] "Array" [ Type.var "a" ] + ] + (Type.maybe (Type.var "a")) + ) + } + ) + [ Elm.int getArg_, getArg_0 ] + + +{-| Set the element at a particular index. Returns an updated array. +If the index is out of range, the array is unaltered. + + set 1 7 (fromList [1,2,3]) == fromList [1,7,3] + +set: Int -> a -> Array.Array a -> Array.Array a +-} +set : Int -> Elm.Expression -> Elm.Expression -> Elm.Expression +set setArg_ setArg_0 setArg_1 = + Elm.apply + (Elm.value + { importFrom = [ "Array" ] + , name = "set" + , annotation = + Just + (Type.function + [ Type.int + , Type.var "a" + , Type.namedWith [ "Array" ] "Array" [ Type.var "a" ] + ] + (Type.namedWith [ "Array" ] "Array" [ Type.var "a" ]) + ) + } + ) + [ Elm.int setArg_, setArg_0, setArg_1 ] + + +{-| Push an element onto the end of an array. + + push 3 (fromList [1,2]) == fromList [1,2,3] + +push: a -> Array.Array a -> Array.Array a +-} +push : Elm.Expression -> Elm.Expression -> Elm.Expression +push pushArg_ pushArg_0 = + Elm.apply + (Elm.value + { importFrom = [ "Array" ] + , name = "push" + , annotation = + Just + (Type.function + [ Type.var "a" + , Type.namedWith [ "Array" ] "Array" [ Type.var "a" ] + ] + (Type.namedWith [ "Array" ] "Array" [ Type.var "a" ]) + ) + } + ) + [ pushArg_, pushArg_0 ] + + +{-| Append two arrays to a new one. + + append (repeat 2 42) (repeat 3 81) == fromList [42,42,81,81,81] + +append: Array.Array a -> Array.Array a -> Array.Array a +-} +append : Elm.Expression -> Elm.Expression -> Elm.Expression +append appendArg_ appendArg_0 = + Elm.apply + (Elm.value + { importFrom = [ "Array" ] + , name = "append" + , annotation = + Just + (Type.function + [ Type.namedWith [ "Array" ] "Array" [ Type.var "a" ] + , Type.namedWith [ "Array" ] "Array" [ Type.var "a" ] + ] + (Type.namedWith [ "Array" ] "Array" [ Type.var "a" ]) + ) + } + ) + [ appendArg_, appendArg_0 ] + + +{-| Get a sub-section of an array: `(slice start end array)`. The `start` is a +zero-based index where we will start our slice. The `end` is a zero-based index +that indicates the end of the slice. The slice extracts up to but not including +`end`. + + slice 0 3 (fromList [0,1,2,3,4]) == fromList [0,1,2] + slice 1 4 (fromList [0,1,2,3,4]) == fromList [1,2,3] + +Both the `start` and `end` indexes can be negative, indicating an offset from +the end of the array. + + slice 1 -1 (fromList [0,1,2,3,4]) == fromList [1,2,3] + slice -2 5 (fromList [0,1,2,3,4]) == fromList [3,4] + +This makes it pretty easy to `pop` the last element off of an array: +`slice 0 -1 array` + +slice: Int -> Int -> Array.Array a -> Array.Array a +-} +slice : Int -> Int -> Elm.Expression -> Elm.Expression +slice sliceArg_ sliceArg_0 sliceArg_1 = + Elm.apply + (Elm.value + { importFrom = [ "Array" ] + , name = "slice" + , annotation = + Just + (Type.function + [ Type.int + , Type.int + , Type.namedWith [ "Array" ] "Array" [ Type.var "a" ] + ] + (Type.namedWith [ "Array" ] "Array" [ Type.var "a" ]) + ) + } + ) + [ Elm.int sliceArg_, Elm.int sliceArg_0, sliceArg_1 ] + + +{-| Create a list of elements from an array. + + toList (fromList [3,5,8]) == [3,5,8] + +toList: Array.Array a -> List a +-} +toList : Elm.Expression -> Elm.Expression +toList toListArg_ = + Elm.apply + (Elm.value + { importFrom = [ "Array" ] + , name = "toList" + , annotation = + Just + (Type.function + [ Type.namedWith [ "Array" ] "Array" [ Type.var "a" ] + ] + (Type.list (Type.var "a")) + ) + } + ) + [ toListArg_ ] + + +{-| Create an indexed list from an array. Each element of the array will be +paired with its index. + + toIndexedList (fromList ["cat","dog"]) == [(0,"cat"), (1,"dog")] + +toIndexedList: Array.Array a -> List ( Int, a ) +-} +toIndexedList : Elm.Expression -> Elm.Expression +toIndexedList toIndexedListArg_ = + Elm.apply + (Elm.value + { importFrom = [ "Array" ] + , name = "toIndexedList" + , annotation = + Just + (Type.function + [ Type.namedWith [ "Array" ] "Array" [ Type.var "a" ] + ] + (Type.list (Type.tuple Type.int (Type.var "a"))) + ) + } + ) + [ toIndexedListArg_ ] + + +{-| Apply a function on every element in an array. + + map sqrt (fromList [1,4,9]) == fromList [1,2,3] + +map: (a -> b) -> Array.Array a -> Array.Array b +-} +map : (Elm.Expression -> Elm.Expression) -> Elm.Expression -> Elm.Expression +map mapArg_ mapArg_0 = + Elm.apply + (Elm.value + { importFrom = [ "Array" ] + , name = "map" + , annotation = + Just + (Type.function + [ Type.function [ Type.var "a" ] (Type.var "b") + , Type.namedWith [ "Array" ] "Array" [ Type.var "a" ] + ] + (Type.namedWith [ "Array" ] "Array" [ Type.var "b" ]) + ) + } + ) + [ Elm.functionReduced "mapUnpack" mapArg_, mapArg_0 ] + + +{-| Apply a function on every element with its index as first argument. + + indexedMap (*) (fromList [5,5,5]) == fromList [0,5,10] + +indexedMap: (Int -> a -> b) -> Array.Array a -> Array.Array b +-} +indexedMap : + (Elm.Expression -> Elm.Expression -> Elm.Expression) + -> Elm.Expression + -> Elm.Expression +indexedMap indexedMapArg_ indexedMapArg_0 = + Elm.apply + (Elm.value + { importFrom = [ "Array" ] + , name = "indexedMap" + , annotation = + Just + (Type.function + [ Type.function + [ Type.int, Type.var "a" ] + (Type.var "b") + , Type.namedWith [ "Array" ] "Array" [ Type.var "a" ] + ] + (Type.namedWith [ "Array" ] "Array" [ Type.var "b" ]) + ) + } + ) + [ Elm.functionReduced + "indexedMapUnpack" + (\functionReducedUnpack -> + Elm.functionReduced + "unpack" + (indexedMapArg_ functionReducedUnpack) + ) + , indexedMapArg_0 + ] + + +{-| Reduce an array from the left. Read `foldl` as fold from the left. + + foldl (::) [] (fromList [1,2,3]) == [3,2,1] + +foldl: (a -> b -> b) -> b -> Array.Array a -> b +-} +foldl : + (Elm.Expression -> Elm.Expression -> Elm.Expression) + -> Elm.Expression + -> Elm.Expression + -> Elm.Expression +foldl foldlArg_ foldlArg_0 foldlArg_1 = + Elm.apply + (Elm.value + { importFrom = [ "Array" ] + , name = "foldl" + , annotation = + Just + (Type.function + [ Type.function + [ Type.var "a", Type.var "b" ] + (Type.var "b") + , Type.var "b" + , Type.namedWith [ "Array" ] "Array" [ Type.var "a" ] + ] + (Type.var "b") + ) + } + ) + [ Elm.functionReduced + "foldlUnpack" + (\functionReducedUnpack -> + Elm.functionReduced "unpack" (foldlArg_ functionReducedUnpack) + ) + , foldlArg_0 + , foldlArg_1 + ] + + +{-| Reduce an array from the right. Read `foldr` as fold from the right. + + foldr (+) 0 (repeat 3 5) == 15 + +foldr: (a -> b -> b) -> b -> Array.Array a -> b +-} +foldr : + (Elm.Expression -> Elm.Expression -> Elm.Expression) + -> Elm.Expression + -> Elm.Expression + -> Elm.Expression +foldr foldrArg_ foldrArg_0 foldrArg_1 = + Elm.apply + (Elm.value + { importFrom = [ "Array" ] + , name = "foldr" + , annotation = + Just + (Type.function + [ Type.function + [ Type.var "a", Type.var "b" ] + (Type.var "b") + , Type.var "b" + , Type.namedWith [ "Array" ] "Array" [ Type.var "a" ] + ] + (Type.var "b") + ) + } + ) + [ Elm.functionReduced + "foldrUnpack" + (\functionReducedUnpack -> + Elm.functionReduced "unpack" (foldrArg_ functionReducedUnpack) + ) + , foldrArg_0 + , foldrArg_1 + ] + + +{-| Keep elements that pass the test. + + filter isEven (fromList [1,2,3,4,5,6]) == (fromList [2,4,6]) + +filter: (a -> Bool) -> Array.Array a -> Array.Array a +-} +filter : (Elm.Expression -> Elm.Expression) -> Elm.Expression -> Elm.Expression +filter filterArg_ filterArg_0 = + Elm.apply + (Elm.value + { importFrom = [ "Array" ] + , name = "filter" + , annotation = + Just + (Type.function + [ Type.function [ Type.var "a" ] Type.bool + , Type.namedWith [ "Array" ] "Array" [ Type.var "a" ] + ] + (Type.namedWith [ "Array" ] "Array" [ Type.var "a" ]) + ) + } + ) + [ Elm.functionReduced "filterUnpack" filterArg_, filterArg_0 ] + + +annotation_ : { array : Type.Annotation -> Type.Annotation } +annotation_ = + { array = \arrayArg0 -> Type.namedWith [ "Array" ] "Array" [ arrayArg0 ] } + + +call_ : + { initialize : Elm.Expression -> Elm.Expression -> Elm.Expression + , repeat : Elm.Expression -> Elm.Expression -> Elm.Expression + , fromList : Elm.Expression -> Elm.Expression + , isEmpty : Elm.Expression -> Elm.Expression + , length : Elm.Expression -> Elm.Expression + , get : Elm.Expression -> Elm.Expression -> Elm.Expression + , set : Elm.Expression -> Elm.Expression -> Elm.Expression -> Elm.Expression + , push : Elm.Expression -> Elm.Expression -> Elm.Expression + , append : Elm.Expression -> Elm.Expression -> Elm.Expression + , slice : + Elm.Expression -> Elm.Expression -> Elm.Expression -> Elm.Expression + , toList : Elm.Expression -> Elm.Expression + , toIndexedList : Elm.Expression -> Elm.Expression + , map : Elm.Expression -> Elm.Expression -> Elm.Expression + , indexedMap : Elm.Expression -> Elm.Expression -> Elm.Expression + , foldl : + Elm.Expression -> Elm.Expression -> Elm.Expression -> Elm.Expression + , foldr : + Elm.Expression -> Elm.Expression -> Elm.Expression -> Elm.Expression + , filter : Elm.Expression -> Elm.Expression -> Elm.Expression + } +call_ = + { initialize = + \initializeArg_ initializeArg_0 -> + Elm.apply + (Elm.value + { importFrom = [ "Array" ] + , name = "initialize" + , annotation = + Just + (Type.function + [ Type.int + , Type.function [ Type.int ] (Type.var "a") + ] + (Type.namedWith + [ "Array" ] + "Array" + [ Type.var "a" ] + ) + ) + } + ) + [ initializeArg_, initializeArg_0 ] + , repeat = + \repeatArg_ repeatArg_0 -> + Elm.apply + (Elm.value + { importFrom = [ "Array" ] + , name = "repeat" + , annotation = + Just + (Type.function + [ Type.int, Type.var "a" ] + (Type.namedWith + [ "Array" ] + "Array" + [ Type.var "a" ] + ) + ) + } + ) + [ repeatArg_, repeatArg_0 ] + , fromList = + \fromListArg_ -> + Elm.apply + (Elm.value + { importFrom = [ "Array" ] + , name = "fromList" + , annotation = + Just + (Type.function + [ Type.list (Type.var "a") ] + (Type.namedWith + [ "Array" ] + "Array" + [ Type.var "a" ] + ) + ) + } + ) + [ fromListArg_ ] + , isEmpty = + \isEmptyArg_ -> + Elm.apply + (Elm.value + { importFrom = [ "Array" ] + , name = "isEmpty" + , annotation = + Just + (Type.function + [ Type.namedWith + [ "Array" ] + "Array" + [ Type.var "a" ] + ] + Type.bool + ) + } + ) + [ isEmptyArg_ ] + , length = + \lengthArg_ -> + Elm.apply + (Elm.value + { importFrom = [ "Array" ] + , name = "length" + , annotation = + Just + (Type.function + [ Type.namedWith + [ "Array" ] + "Array" + [ Type.var "a" ] + ] + Type.int + ) + } + ) + [ lengthArg_ ] + , get = + \getArg_ getArg_0 -> + Elm.apply + (Elm.value + { importFrom = [ "Array" ] + , name = "get" + , annotation = + Just + (Type.function + [ Type.int + , Type.namedWith + [ "Array" ] + "Array" + [ Type.var "a" ] + ] + (Type.maybe (Type.var "a")) + ) + } + ) + [ getArg_, getArg_0 ] + , set = + \setArg_ setArg_0 setArg_1 -> + Elm.apply + (Elm.value + { importFrom = [ "Array" ] + , name = "set" + , annotation = + Just + (Type.function + [ Type.int + , Type.var "a" + , Type.namedWith + [ "Array" ] + "Array" + [ Type.var "a" ] + ] + (Type.namedWith + [ "Array" ] + "Array" + [ Type.var "a" ] + ) + ) + } + ) + [ setArg_, setArg_0, setArg_1 ] + , push = + \pushArg_ pushArg_0 -> + Elm.apply + (Elm.value + { importFrom = [ "Array" ] + , name = "push" + , annotation = + Just + (Type.function + [ Type.var "a" + , Type.namedWith + [ "Array" ] + "Array" + [ Type.var "a" ] + ] + (Type.namedWith + [ "Array" ] + "Array" + [ Type.var "a" ] + ) + ) + } + ) + [ pushArg_, pushArg_0 ] + , append = + \appendArg_ appendArg_0 -> + Elm.apply + (Elm.value + { importFrom = [ "Array" ] + , name = "append" + , annotation = + Just + (Type.function + [ Type.namedWith + [ "Array" ] + "Array" + [ Type.var "a" ] + , Type.namedWith + [ "Array" ] + "Array" + [ Type.var "a" ] + ] + (Type.namedWith + [ "Array" ] + "Array" + [ Type.var "a" ] + ) + ) + } + ) + [ appendArg_, appendArg_0 ] + , slice = + \sliceArg_ sliceArg_0 sliceArg_1 -> + Elm.apply + (Elm.value + { importFrom = [ "Array" ] + , name = "slice" + , annotation = + Just + (Type.function + [ Type.int + , Type.int + , Type.namedWith + [ "Array" ] + "Array" + [ Type.var "a" ] + ] + (Type.namedWith + [ "Array" ] + "Array" + [ Type.var "a" ] + ) + ) + } + ) + [ sliceArg_, sliceArg_0, sliceArg_1 ] + , toList = + \toListArg_ -> + Elm.apply + (Elm.value + { importFrom = [ "Array" ] + , name = "toList" + , annotation = + Just + (Type.function + [ Type.namedWith + [ "Array" ] + "Array" + [ Type.var "a" ] + ] + (Type.list (Type.var "a")) + ) + } + ) + [ toListArg_ ] + , toIndexedList = + \toIndexedListArg_ -> + Elm.apply + (Elm.value + { importFrom = [ "Array" ] + , name = "toIndexedList" + , annotation = + Just + (Type.function + [ Type.namedWith + [ "Array" ] + "Array" + [ Type.var "a" ] + ] + (Type.list + (Type.tuple Type.int (Type.var "a")) + ) + ) + } + ) + [ toIndexedListArg_ ] + , map = + \mapArg_ mapArg_0 -> + Elm.apply + (Elm.value + { importFrom = [ "Array" ] + , name = "map" + , annotation = + Just + (Type.function + [ Type.function + [ Type.var "a" ] + (Type.var "b") + , Type.namedWith + [ "Array" ] + "Array" + [ Type.var "a" ] + ] + (Type.namedWith + [ "Array" ] + "Array" + [ Type.var "b" ] + ) + ) + } + ) + [ mapArg_, mapArg_0 ] + , indexedMap = + \indexedMapArg_ indexedMapArg_0 -> + Elm.apply + (Elm.value + { importFrom = [ "Array" ] + , name = "indexedMap" + , annotation = + Just + (Type.function + [ Type.function + [ Type.int, Type.var "a" ] + (Type.var "b") + , Type.namedWith + [ "Array" ] + "Array" + [ Type.var "a" ] + ] + (Type.namedWith + [ "Array" ] + "Array" + [ Type.var "b" ] + ) + ) + } + ) + [ indexedMapArg_, indexedMapArg_0 ] + , foldl = + \foldlArg_ foldlArg_0 foldlArg_1 -> + Elm.apply + (Elm.value + { importFrom = [ "Array" ] + , name = "foldl" + , annotation = + Just + (Type.function + [ Type.function + [ Type.var "a", Type.var "b" ] + (Type.var "b") + , Type.var "b" + , Type.namedWith + [ "Array" ] + "Array" + [ Type.var "a" ] + ] + (Type.var "b") + ) + } + ) + [ foldlArg_, foldlArg_0, foldlArg_1 ] + , foldr = + \foldrArg_ foldrArg_0 foldrArg_1 -> + Elm.apply + (Elm.value + { importFrom = [ "Array" ] + , name = "foldr" + , annotation = + Just + (Type.function + [ Type.function + [ Type.var "a", Type.var "b" ] + (Type.var "b") + , Type.var "b" + , Type.namedWith + [ "Array" ] + "Array" + [ Type.var "a" ] + ] + (Type.var "b") + ) + } + ) + [ foldrArg_, foldrArg_0, foldrArg_1 ] + , filter = + \filterArg_ filterArg_0 -> + Elm.apply + (Elm.value + { importFrom = [ "Array" ] + , name = "filter" + , annotation = + Just + (Type.function + [ Type.function [ Type.var "a" ] Type.bool + , Type.namedWith + [ "Array" ] + "Array" + [ Type.var "a" ] + ] + (Type.namedWith + [ "Array" ] + "Array" + [ Type.var "a" ] + ) + ) + } + ) + [ filterArg_, filterArg_0 ] + } + + +values_ : + { empty : Elm.Expression + , initialize : Elm.Expression + , repeat : Elm.Expression + , fromList : Elm.Expression + , isEmpty : Elm.Expression + , length : Elm.Expression + , get : Elm.Expression + , set : Elm.Expression + , push : Elm.Expression + , append : Elm.Expression + , slice : Elm.Expression + , toList : Elm.Expression + , toIndexedList : Elm.Expression + , map : Elm.Expression + , indexedMap : Elm.Expression + , foldl : Elm.Expression + , foldr : Elm.Expression + , filter : Elm.Expression + } +values_ = + { empty = + Elm.value + { importFrom = [ "Array" ] + , name = "empty" + , annotation = + Just (Type.namedWith [ "Array" ] "Array" [ Type.var "a" ]) + } + , initialize = + Elm.value + { importFrom = [ "Array" ] + , name = "initialize" + , annotation = + Just + (Type.function + [ Type.int, Type.function [ Type.int ] (Type.var "a") ] + (Type.namedWith [ "Array" ] "Array" [ Type.var "a" ]) + ) + } + , repeat = + Elm.value + { importFrom = [ "Array" ] + , name = "repeat" + , annotation = + Just + (Type.function + [ Type.int, Type.var "a" ] + (Type.namedWith [ "Array" ] "Array" [ Type.var "a" ]) + ) + } + , fromList = + Elm.value + { importFrom = [ "Array" ] + , name = "fromList" + , annotation = + Just + (Type.function + [ Type.list (Type.var "a") ] + (Type.namedWith [ "Array" ] "Array" [ Type.var "a" ]) + ) + } + , isEmpty = + Elm.value + { importFrom = [ "Array" ] + , name = "isEmpty" + , annotation = + Just + (Type.function + [ Type.namedWith [ "Array" ] "Array" [ Type.var "a" ] ] + Type.bool + ) + } + , length = + Elm.value + { importFrom = [ "Array" ] + , name = "length" + , annotation = + Just + (Type.function + [ Type.namedWith [ "Array" ] "Array" [ Type.var "a" ] ] + Type.int + ) + } + , get = + Elm.value + { importFrom = [ "Array" ] + , name = "get" + , annotation = + Just + (Type.function + [ Type.int + , Type.namedWith [ "Array" ] "Array" [ Type.var "a" ] + ] + (Type.maybe (Type.var "a")) + ) + } + , set = + Elm.value + { importFrom = [ "Array" ] + , name = "set" + , annotation = + Just + (Type.function + [ Type.int + , Type.var "a" + , Type.namedWith [ "Array" ] "Array" [ Type.var "a" ] + ] + (Type.namedWith [ "Array" ] "Array" [ Type.var "a" ]) + ) + } + , push = + Elm.value + { importFrom = [ "Array" ] + , name = "push" + , annotation = + Just + (Type.function + [ Type.var "a" + , Type.namedWith [ "Array" ] "Array" [ Type.var "a" ] + ] + (Type.namedWith [ "Array" ] "Array" [ Type.var "a" ]) + ) + } + , append = + Elm.value + { importFrom = [ "Array" ] + , name = "append" + , annotation = + Just + (Type.function + [ Type.namedWith [ "Array" ] "Array" [ Type.var "a" ] + , Type.namedWith [ "Array" ] "Array" [ Type.var "a" ] + ] + (Type.namedWith [ "Array" ] "Array" [ Type.var "a" ]) + ) + } + , slice = + Elm.value + { importFrom = [ "Array" ] + , name = "slice" + , annotation = + Just + (Type.function + [ Type.int + , Type.int + , Type.namedWith [ "Array" ] "Array" [ Type.var "a" ] + ] + (Type.namedWith [ "Array" ] "Array" [ Type.var "a" ]) + ) + } + , toList = + Elm.value + { importFrom = [ "Array" ] + , name = "toList" + , annotation = + Just + (Type.function + [ Type.namedWith [ "Array" ] "Array" [ Type.var "a" ] ] + (Type.list (Type.var "a")) + ) + } + , toIndexedList = + Elm.value + { importFrom = [ "Array" ] + , name = "toIndexedList" + , annotation = + Just + (Type.function + [ Type.namedWith [ "Array" ] "Array" [ Type.var "a" ] ] + (Type.list (Type.tuple Type.int (Type.var "a"))) + ) + } + , map = + Elm.value + { importFrom = [ "Array" ] + , name = "map" + , annotation = + Just + (Type.function + [ Type.function [ Type.var "a" ] (Type.var "b") + , Type.namedWith [ "Array" ] "Array" [ Type.var "a" ] + ] + (Type.namedWith [ "Array" ] "Array" [ Type.var "b" ]) + ) + } + , indexedMap = + Elm.value + { importFrom = [ "Array" ] + , name = "indexedMap" + , annotation = + Just + (Type.function + [ Type.function + [ Type.int, Type.var "a" ] + (Type.var "b") + , Type.namedWith [ "Array" ] "Array" [ Type.var "a" ] + ] + (Type.namedWith [ "Array" ] "Array" [ Type.var "b" ]) + ) + } + , foldl = + Elm.value + { importFrom = [ "Array" ] + , name = "foldl" + , annotation = + Just + (Type.function + [ Type.function + [ Type.var "a", Type.var "b" ] + (Type.var "b") + , Type.var "b" + , Type.namedWith [ "Array" ] "Array" [ Type.var "a" ] + ] + (Type.var "b") + ) + } + , foldr = + Elm.value + { importFrom = [ "Array" ] + , name = "foldr" + , annotation = + Just + (Type.function + [ Type.function + [ Type.var "a", Type.var "b" ] + (Type.var "b") + , Type.var "b" + , Type.namedWith [ "Array" ] "Array" [ Type.var "a" ] + ] + (Type.var "b") + ) + } + , filter = + Elm.value + { importFrom = [ "Array" ] + , name = "filter" + , annotation = + Just + (Type.function + [ Type.function [ Type.var "a" ] Type.bool + , Type.namedWith [ "Array" ] "Array" [ Type.var "a" ] + ] + (Type.namedWith [ "Array" ] "Array" [ Type.var "a" ]) + ) + } + } \ No newline at end of file diff --git a/elm-open-api-codegen/src/Gen/BackendTask.elm b/elm-open-api-codegen/src/Gen/BackendTask.elm new file mode 100644 index 00000000..beb22a02 --- /dev/null +++ b/elm-open-api-codegen/src/Gen/BackendTask.elm @@ -0,0 +1,3583 @@ +module Gen.BackendTask exposing + ( moduleName_, map, succeed, fail, fromResult, andThen + , resolve, combine, andMap, map2, map3, map4, map5 + , map6, map7, map8, map9, allowFatal, mapError, onError + , toResult, do, doEach, sequence, failIf, inDir, quiet + , withEnv, annotation_, call_, values_ + ) + +{-| +# Generated bindings for BackendTask + +@docs moduleName_, map, succeed, fail, fromResult, andThen +@docs resolve, combine, andMap, map2, map3, map4 +@docs map5, map6, map7, map8, map9, allowFatal +@docs mapError, onError, toResult, do, doEach, sequence +@docs failIf, inDir, quiet, withEnv, annotation_, call_ +@docs values_ +-} + + +import Elm +import Elm.Annotation as Type + + +{-| The name of this module. -} +moduleName_ : List String +moduleName_ = + [ "BackendTask" ] + + +{-| Transform a request into an arbitrary value. The same underlying task will be performed, +but mapping allows you to change the resulting values by applying functions to the results. + + import BackendTask exposing (BackendTask) + import BackendTask.Http + import FatalError exposing (FatalError) + import Json.Decode as Decode + + starsMessage : BackendTask FatalError String + starsMessage = + BackendTask.Http.getJson + "https://api.github.com/repos/dillonkearns/elm-pages" + (Decode.field "stargazers_count" Decode.int) + |> BackendTask.map + (\stars -> "⭐️ " ++ String.fromInt stars) + |> BackendTask.allowFatal + +map: (a -> b) -> BackendTask.BackendTask error a -> BackendTask.BackendTask error b +-} +map : (Elm.Expression -> Elm.Expression) -> Elm.Expression -> Elm.Expression +map mapArg_ mapArg_0 = + Elm.apply + (Elm.value + { importFrom = [ "BackendTask" ] + , name = "map" + , annotation = + Just + (Type.function + [ Type.function [ Type.var "a" ] (Type.var "b") + , Type.namedWith + [ "BackendTask" ] + "BackendTask" + [ Type.var "error", Type.var "a" ] + ] + (Type.namedWith + [ "BackendTask" ] + "BackendTask" + [ Type.var "error", Type.var "b" ] + ) + ) + } + ) + [ Elm.functionReduced "mapUnpack" mapArg_, mapArg_0 ] + + +{-| This is useful for prototyping with some hardcoded data, or for having a view that doesn't have any BackendTask data. + + import BackendTask exposing (BackendTask) + + type alias RouteParams = + { name : String } + + pages : BackendTask error (List RouteParams) + pages = + BackendTask.succeed [ { name = "elm-pages" } ] + +succeed: a -> BackendTask.BackendTask error a +-} +succeed : Elm.Expression -> Elm.Expression +succeed succeedArg_ = + Elm.apply + (Elm.value + { importFrom = [ "BackendTask" ] + , name = "succeed" + , annotation = + Just + (Type.function + [ Type.var "a" ] + (Type.namedWith + [ "BackendTask" ] + "BackendTask" + [ Type.var "error", Type.var "a" ] + ) + ) + } + ) + [ succeedArg_ ] + + +{-| fail: error -> BackendTask.BackendTask error a -} +fail : Elm.Expression -> Elm.Expression +fail failArg_ = + Elm.apply + (Elm.value + { importFrom = [ "BackendTask" ] + , name = "fail" + , annotation = + Just + (Type.function + [ Type.var "error" ] + (Type.namedWith + [ "BackendTask" ] + "BackendTask" + [ Type.var "error", Type.var "a" ] + ) + ) + } + ) + [ failArg_ ] + + +{-| Turn `Ok` into `BackendTask.succeed` and `Err` into `BackendTask.fail`. + +fromResult: Result.Result error value -> BackendTask.BackendTask error value +-} +fromResult : Elm.Expression -> Elm.Expression +fromResult fromResultArg_ = + Elm.apply + (Elm.value + { importFrom = [ "BackendTask" ] + , name = "fromResult" + , annotation = + Just + (Type.function + [ Type.namedWith + [ "Result" ] + "Result" + [ Type.var "error", Type.var "value" ] + ] + (Type.namedWith + [ "BackendTask" ] + "BackendTask" + [ Type.var "error", Type.var "value" ] + ) + ) + } + ) + [ fromResultArg_ ] + + +{-| Build off of the response from a previous `BackendTask` request to build a follow-up request. You can use the data +from the previous response to build up the URL, headers, etc. that you send to the subsequent request. + + import BackendTask exposing (BackendTask) + import BackendTask.Http + import FatalError exposing (FatalError) + import Json.Decode as Decode + + licenseData : BackendTask FatalError String + licenseData = + BackendTask.Http.getJson + "https://api.github.com/repos/dillonkearns/elm-pages" + (Decode.at [ "license", "url" ] Decode.string) + |> BackendTask.andThen + (\licenseUrl -> + BackendTask.Http.getJson licenseUrl (Decode.field "description" Decode.string) + ) + |> BackendTask.allowFatal + +andThen: + (a -> BackendTask.BackendTask error b) + -> BackendTask.BackendTask error a + -> BackendTask.BackendTask error b +-} +andThen : (Elm.Expression -> Elm.Expression) -> Elm.Expression -> Elm.Expression +andThen andThenArg_ andThenArg_0 = + Elm.apply + (Elm.value + { importFrom = [ "BackendTask" ] + , name = "andThen" + , annotation = + Just + (Type.function + [ Type.function + [ Type.var "a" ] + (Type.namedWith + [ "BackendTask" ] + "BackendTask" + [ Type.var "error", Type.var "b" ] + ) + , Type.namedWith + [ "BackendTask" ] + "BackendTask" + [ Type.var "error", Type.var "a" ] + ] + (Type.namedWith + [ "BackendTask" ] + "BackendTask" + [ Type.var "error", Type.var "b" ] + ) + ) + } + ) + [ Elm.functionReduced "andThenUnpack" andThenArg_, andThenArg_0 ] + + +{-| Helper to remove an inner layer of Request wrapping. + +resolve: + BackendTask.BackendTask error (List (BackendTask.BackendTask error value)) + -> BackendTask.BackendTask error (List value) +-} +resolve : Elm.Expression -> Elm.Expression +resolve resolveArg_ = + Elm.apply + (Elm.value + { importFrom = [ "BackendTask" ] + , name = "resolve" + , annotation = + Just + (Type.function + [ Type.namedWith + [ "BackendTask" ] + "BackendTask" + [ Type.var "error" + , Type.list + (Type.namedWith + [ "BackendTask" ] + "BackendTask" + [ Type.var "error", Type.var "value" ] + ) + ] + ] + (Type.namedWith + [ "BackendTask" ] + "BackendTask" + [ Type.var "error" + , Type.list (Type.var "value") + ] + ) + ) + } + ) + [ resolveArg_ ] + + +{-| Turn a list of `BackendTask`s into a single one. + + import BackendTask exposing (BackendTask) + import BackendTask.Http + import FatalError exposing (FatalError) + import Json.Decode as Decode + + type alias Pokemon = + { name : String + , sprite : String + } + + pokemonDetailRequest : BackendTask FatalError (List Pokemon) + pokemonDetailRequest = + BackendTask.Http.getJson + "https://pokeapi.co/api/v2/pokemon/?limit=3" + (Decode.field "results" + (Decode.list + (Decode.map2 Tuple.pair + (Decode.field "name" Decode.string) + (Decode.field "url" Decode.string) + |> Decode.map + (\( name, url ) -> + BackendTask.Http.getJson url + (Decode.at + [ "sprites", "front_default" ] + Decode.string + |> Decode.map (Pokemon name) + ) + ) + ) + ) + ) + |> BackendTask.andThen BackendTask.combine + |> BackendTask.allowFatal + +combine: + List (BackendTask.BackendTask error value) + -> BackendTask.BackendTask error (List value) +-} +combine : List Elm.Expression -> Elm.Expression +combine combineArg_ = + Elm.apply + (Elm.value + { importFrom = [ "BackendTask" ] + , name = "combine" + , annotation = + Just + (Type.function + [ Type.list + (Type.namedWith + [ "BackendTask" ] + "BackendTask" + [ Type.var "error", Type.var "value" ] + ) + ] + (Type.namedWith + [ "BackendTask" ] + "BackendTask" + [ Type.var "error" + , Type.list (Type.var "value") + ] + ) + ) + } + ) + [ Elm.list combineArg_ ] + + +{-| A helper for combining `BackendTask`s in pipelines. + +andMap: + BackendTask.BackendTask error a + -> BackendTask.BackendTask error (a -> b) + -> BackendTask.BackendTask error b +-} +andMap : Elm.Expression -> Elm.Expression -> Elm.Expression +andMap andMapArg_ andMapArg_0 = + Elm.apply + (Elm.value + { importFrom = [ "BackendTask" ] + , name = "andMap" + , annotation = + Just + (Type.function + [ Type.namedWith + [ "BackendTask" ] + "BackendTask" + [ Type.var "error", Type.var "a" ] + , Type.namedWith + [ "BackendTask" ] + "BackendTask" + [ Type.var "error" + , Type.function [ Type.var "a" ] (Type.var "b") + ] + ] + (Type.namedWith + [ "BackendTask" ] + "BackendTask" + [ Type.var "error", Type.var "b" ] + ) + ) + } + ) + [ andMapArg_, andMapArg_0 ] + + +{-| Like map, but it takes in two `BackendTask`s. + + import BackendTask exposing (BackendTask) + import BackendTask.Env as Env + import BackendTask.Http + import FatalError exposing (FatalError) + import Json.Decode as Decode + + type alias Data = + { pokemon : List String, envValue : Maybe String } + + data : BackendTask FatalError Data + data = + BackendTask.map2 Data + (BackendTask.Http.getJson + "https://pokeapi.co/api/v2/pokemon/?limit=100&offset=0" + (Decode.field "results" + (Decode.list (Decode.field "name" Decode.string)) + ) + |> BackendTask.allowFatal + ) + (Env.get "HELLO") + +map2: + (a -> b -> c) + -> BackendTask.BackendTask error a + -> BackendTask.BackendTask error b + -> BackendTask.BackendTask error c +-} +map2 : + (Elm.Expression -> Elm.Expression -> Elm.Expression) + -> Elm.Expression + -> Elm.Expression + -> Elm.Expression +map2 map2Arg_ map2Arg_0 map2Arg_1 = + Elm.apply + (Elm.value + { importFrom = [ "BackendTask" ] + , name = "map2" + , annotation = + Just + (Type.function + [ Type.function + [ Type.var "a", Type.var "b" ] + (Type.var "c") + , Type.namedWith + [ "BackendTask" ] + "BackendTask" + [ Type.var "error", Type.var "a" ] + , Type.namedWith + [ "BackendTask" ] + "BackendTask" + [ Type.var "error", Type.var "b" ] + ] + (Type.namedWith + [ "BackendTask" ] + "BackendTask" + [ Type.var "error", Type.var "c" ] + ) + ) + } + ) + [ Elm.functionReduced + "map2Unpack" + (\functionReducedUnpack -> + Elm.functionReduced "unpack" (map2Arg_ functionReducedUnpack) + ) + , map2Arg_0 + , map2Arg_1 + ] + + +{-| map3: + (value1 -> value2 -> value3 -> valueCombined) + -> BackendTask.BackendTask error value1 + -> BackendTask.BackendTask error value2 + -> BackendTask.BackendTask error value3 + -> BackendTask.BackendTask error valueCombined +-} +map3 : + (Elm.Expression -> Elm.Expression -> Elm.Expression -> Elm.Expression) + -> Elm.Expression + -> Elm.Expression + -> Elm.Expression + -> Elm.Expression +map3 map3Arg_ map3Arg_0 map3Arg_1 map3Arg_2 = + Elm.apply + (Elm.value + { importFrom = [ "BackendTask" ] + , name = "map3" + , annotation = + Just + (Type.function + [ Type.function + [ Type.var "value1" + , Type.var "value2" + , Type.var "value3" + ] + (Type.var "valueCombined") + , Type.namedWith + [ "BackendTask" ] + "BackendTask" + [ Type.var "error", Type.var "value1" ] + , Type.namedWith + [ "BackendTask" ] + "BackendTask" + [ Type.var "error", Type.var "value2" ] + , Type.namedWith + [ "BackendTask" ] + "BackendTask" + [ Type.var "error", Type.var "value3" ] + ] + (Type.namedWith + [ "BackendTask" ] + "BackendTask" + [ Type.var "error", Type.var "valueCombined" ] + ) + ) + } + ) + [ Elm.functionReduced + "map3Unpack" + (\functionReducedUnpack -> + Elm.functionReduced + "unpack" + (\functionReducedUnpack0 -> + Elm.functionReduced + "unpack" + ((map3Arg_ functionReducedUnpack) + functionReducedUnpack0 + ) + ) + ) + , map3Arg_0 + , map3Arg_1 + , map3Arg_2 + ] + + +{-| map4: + (value1 -> value2 -> value3 -> value4 -> valueCombined) + -> BackendTask.BackendTask error value1 + -> BackendTask.BackendTask error value2 + -> BackendTask.BackendTask error value3 + -> BackendTask.BackendTask error value4 + -> BackendTask.BackendTask error valueCombined +-} +map4 : + (Elm.Expression + -> Elm.Expression + -> Elm.Expression + -> Elm.Expression + -> Elm.Expression) + -> Elm.Expression + -> Elm.Expression + -> Elm.Expression + -> Elm.Expression + -> Elm.Expression +map4 map4Arg_ map4Arg_0 map4Arg_1 map4Arg_2 map4Arg_3 = + Elm.apply + (Elm.value + { importFrom = [ "BackendTask" ] + , name = "map4" + , annotation = + Just + (Type.function + [ Type.function + [ Type.var "value1" + , Type.var "value2" + , Type.var "value3" + , Type.var "value4" + ] + (Type.var "valueCombined") + , Type.namedWith + [ "BackendTask" ] + "BackendTask" + [ Type.var "error", Type.var "value1" ] + , Type.namedWith + [ "BackendTask" ] + "BackendTask" + [ Type.var "error", Type.var "value2" ] + , Type.namedWith + [ "BackendTask" ] + "BackendTask" + [ Type.var "error", Type.var "value3" ] + , Type.namedWith + [ "BackendTask" ] + "BackendTask" + [ Type.var "error", Type.var "value4" ] + ] + (Type.namedWith + [ "BackendTask" ] + "BackendTask" + [ Type.var "error", Type.var "valueCombined" ] + ) + ) + } + ) + [ Elm.functionReduced + "map4Unpack" + (\functionReducedUnpack -> + Elm.functionReduced + "unpack" + (\functionReducedUnpack0 -> + Elm.functionReduced + "unpack" + (\functionReducedUnpack_2_1_2_0_2_0_2_0_0 -> + Elm.functionReduced + "unpack" + (((map4Arg_ functionReducedUnpack) + functionReducedUnpack0 + ) + functionReducedUnpack_2_1_2_0_2_0_2_0_0 + ) + ) + ) + ) + , map4Arg_0 + , map4Arg_1 + , map4Arg_2 + , map4Arg_3 + ] + + +{-| map5: + (value1 -> value2 -> value3 -> value4 -> value5 -> valueCombined) + -> BackendTask.BackendTask error value1 + -> BackendTask.BackendTask error value2 + -> BackendTask.BackendTask error value3 + -> BackendTask.BackendTask error value4 + -> BackendTask.BackendTask error value5 + -> BackendTask.BackendTask error valueCombined +-} +map5 : + (Elm.Expression + -> Elm.Expression + -> Elm.Expression + -> Elm.Expression + -> Elm.Expression + -> Elm.Expression) + -> Elm.Expression + -> Elm.Expression + -> Elm.Expression + -> Elm.Expression + -> Elm.Expression + -> Elm.Expression +map5 map5Arg_ map5Arg_0 map5Arg_1 map5Arg_2 map5Arg_3 map5Arg_4 = + Elm.apply + (Elm.value + { importFrom = [ "BackendTask" ] + , name = "map5" + , annotation = + Just + (Type.function + [ Type.function + [ Type.var "value1" + , Type.var "value2" + , Type.var "value3" + , Type.var "value4" + , Type.var "value5" + ] + (Type.var "valueCombined") + , Type.namedWith + [ "BackendTask" ] + "BackendTask" + [ Type.var "error", Type.var "value1" ] + , Type.namedWith + [ "BackendTask" ] + "BackendTask" + [ Type.var "error", Type.var "value2" ] + , Type.namedWith + [ "BackendTask" ] + "BackendTask" + [ Type.var "error", Type.var "value3" ] + , Type.namedWith + [ "BackendTask" ] + "BackendTask" + [ Type.var "error", Type.var "value4" ] + , Type.namedWith + [ "BackendTask" ] + "BackendTask" + [ Type.var "error", Type.var "value5" ] + ] + (Type.namedWith + [ "BackendTask" ] + "BackendTask" + [ Type.var "error", Type.var "valueCombined" ] + ) + ) + } + ) + [ Elm.functionReduced + "map5Unpack" + (\functionReducedUnpack -> + Elm.functionReduced + "unpack" + (\functionReducedUnpack0 -> + Elm.functionReduced + "unpack" + (\functionReducedUnpack_2_1_2_0_2_0_2_0_0 -> + Elm.functionReduced + "unpack" + (\functionReducedUnpack_2_1_2_1_2_0_2_0_2_0_0 -> + Elm.functionReduced + "unpack" + ((((map5Arg_ functionReducedUnpack + ) + functionReducedUnpack0 + ) + functionReducedUnpack_2_1_2_0_2_0_2_0_0 + ) + functionReducedUnpack_2_1_2_1_2_0_2_0_2_0_0 + ) + ) + ) + ) + ) + , map5Arg_0 + , map5Arg_1 + , map5Arg_2 + , map5Arg_3 + , map5Arg_4 + ] + + +{-| map6: + (value1 -> value2 -> value3 -> value4 -> value5 -> value6 -> valueCombined) + -> BackendTask.BackendTask error value1 + -> BackendTask.BackendTask error value2 + -> BackendTask.BackendTask error value3 + -> BackendTask.BackendTask error value4 + -> BackendTask.BackendTask error value5 + -> BackendTask.BackendTask error value6 + -> BackendTask.BackendTask error valueCombined +-} +map6 : + (Elm.Expression + -> Elm.Expression + -> Elm.Expression + -> Elm.Expression + -> Elm.Expression + -> Elm.Expression + -> Elm.Expression) + -> Elm.Expression + -> Elm.Expression + -> Elm.Expression + -> Elm.Expression + -> Elm.Expression + -> Elm.Expression + -> Elm.Expression +map6 map6Arg_ map6Arg_0 map6Arg_1 map6Arg_2 map6Arg_3 map6Arg_4 map6Arg_5 = + Elm.apply + (Elm.value + { importFrom = [ "BackendTask" ] + , name = "map6" + , annotation = + Just + (Type.function + [ Type.function + [ Type.var "value1" + , Type.var "value2" + , Type.var "value3" + , Type.var "value4" + , Type.var "value5" + , Type.var "value6" + ] + (Type.var "valueCombined") + , Type.namedWith + [ "BackendTask" ] + "BackendTask" + [ Type.var "error", Type.var "value1" ] + , Type.namedWith + [ "BackendTask" ] + "BackendTask" + [ Type.var "error", Type.var "value2" ] + , Type.namedWith + [ "BackendTask" ] + "BackendTask" + [ Type.var "error", Type.var "value3" ] + , Type.namedWith + [ "BackendTask" ] + "BackendTask" + [ Type.var "error", Type.var "value4" ] + , Type.namedWith + [ "BackendTask" ] + "BackendTask" + [ Type.var "error", Type.var "value5" ] + , Type.namedWith + [ "BackendTask" ] + "BackendTask" + [ Type.var "error", Type.var "value6" ] + ] + (Type.namedWith + [ "BackendTask" ] + "BackendTask" + [ Type.var "error", Type.var "valueCombined" ] + ) + ) + } + ) + [ Elm.functionReduced + "map6Unpack" + (\functionReducedUnpack -> + Elm.functionReduced + "unpack" + (\functionReducedUnpack0 -> + Elm.functionReduced + "unpack" + (\functionReducedUnpack_2_1_2_0_2_0_2_0_0 -> + Elm.functionReduced + "unpack" + (\functionReducedUnpack_2_1_2_1_2_0_2_0_2_0_0 -> + Elm.functionReduced + "unpack" + (\functionReducedUnpack_2_1_2_1_2_1_2_0_2_0_2_0_0 -> + Elm.functionReduced + "unpack" + (((((map6Arg_ + functionReducedUnpack + ) + functionReducedUnpack0 + ) + functionReducedUnpack_2_1_2_0_2_0_2_0_0 + ) + functionReducedUnpack_2_1_2_1_2_0_2_0_2_0_0 + ) + functionReducedUnpack_2_1_2_1_2_1_2_0_2_0_2_0_0 + ) + ) + ) + ) + ) + ) + , map6Arg_0 + , map6Arg_1 + , map6Arg_2 + , map6Arg_3 + , map6Arg_4 + , map6Arg_5 + ] + + +{-| map7: + (value1 + -> value2 + -> value3 + -> value4 + -> value5 + -> value6 + -> value7 + -> valueCombined) + -> BackendTask.BackendTask error value1 + -> BackendTask.BackendTask error value2 + -> BackendTask.BackendTask error value3 + -> BackendTask.BackendTask error value4 + -> BackendTask.BackendTask error value5 + -> BackendTask.BackendTask error value6 + -> BackendTask.BackendTask error value7 + -> BackendTask.BackendTask error valueCombined +-} +map7 : + (Elm.Expression + -> Elm.Expression + -> Elm.Expression + -> Elm.Expression + -> Elm.Expression + -> Elm.Expression + -> Elm.Expression + -> Elm.Expression) + -> Elm.Expression + -> Elm.Expression + -> Elm.Expression + -> Elm.Expression + -> Elm.Expression + -> Elm.Expression + -> Elm.Expression + -> Elm.Expression +map7 map7Arg_ map7Arg_0 map7Arg_1 map7Arg_2 map7Arg_3 map7Arg_4 map7Arg_5 map7Arg_6 = + Elm.apply + (Elm.value + { importFrom = [ "BackendTask" ] + , name = "map7" + , annotation = + Just + (Type.function + [ Type.function + [ Type.var "value1" + , Type.var "value2" + , Type.var "value3" + , Type.var "value4" + , Type.var "value5" + , Type.var "value6" + , Type.var "value7" + ] + (Type.var "valueCombined") + , Type.namedWith + [ "BackendTask" ] + "BackendTask" + [ Type.var "error", Type.var "value1" ] + , Type.namedWith + [ "BackendTask" ] + "BackendTask" + [ Type.var "error", Type.var "value2" ] + , Type.namedWith + [ "BackendTask" ] + "BackendTask" + [ Type.var "error", Type.var "value3" ] + , Type.namedWith + [ "BackendTask" ] + "BackendTask" + [ Type.var "error", Type.var "value4" ] + , Type.namedWith + [ "BackendTask" ] + "BackendTask" + [ Type.var "error", Type.var "value5" ] + , Type.namedWith + [ "BackendTask" ] + "BackendTask" + [ Type.var "error", Type.var "value6" ] + , Type.namedWith + [ "BackendTask" ] + "BackendTask" + [ Type.var "error", Type.var "value7" ] + ] + (Type.namedWith + [ "BackendTask" ] + "BackendTask" + [ Type.var "error", Type.var "valueCombined" ] + ) + ) + } + ) + [ Elm.functionReduced + "map7Unpack" + (\functionReducedUnpack -> + Elm.functionReduced + "unpack" + (\functionReducedUnpack0 -> + Elm.functionReduced + "unpack" + (\functionReducedUnpack_2_1_2_0_2_0_2_0_0 -> + Elm.functionReduced + "unpack" + (\functionReducedUnpack_2_1_2_1_2_0_2_0_2_0_0 -> + Elm.functionReduced + "unpack" + (\functionReducedUnpack_2_1_2_1_2_1_2_0_2_0_2_0_0 -> + Elm.functionReduced + "unpack" + (\functionReducedUnpack_2_1_2_1_2_1_2_1_2_0_2_0_2_0_0 -> + Elm.functionReduced + "unpack" + ((((((map7Arg_ + functionReducedUnpack + ) + functionReducedUnpack0 + ) + functionReducedUnpack_2_1_2_0_2_0_2_0_0 + ) + functionReducedUnpack_2_1_2_1_2_0_2_0_2_0_0 + ) + functionReducedUnpack_2_1_2_1_2_1_2_0_2_0_2_0_0 + ) + functionReducedUnpack_2_1_2_1_2_1_2_1_2_0_2_0_2_0_0 + ) + ) + ) + ) + ) + ) + ) + , map7Arg_0 + , map7Arg_1 + , map7Arg_2 + , map7Arg_3 + , map7Arg_4 + , map7Arg_5 + , map7Arg_6 + ] + + +{-| map8: + (value1 + -> value2 + -> value3 + -> value4 + -> value5 + -> value6 + -> value7 + -> value8 + -> valueCombined) + -> BackendTask.BackendTask error value1 + -> BackendTask.BackendTask error value2 + -> BackendTask.BackendTask error value3 + -> BackendTask.BackendTask error value4 + -> BackendTask.BackendTask error value5 + -> BackendTask.BackendTask error value6 + -> BackendTask.BackendTask error value7 + -> BackendTask.BackendTask error value8 + -> BackendTask.BackendTask error valueCombined +-} +map8 : + (Elm.Expression + -> Elm.Expression + -> Elm.Expression + -> Elm.Expression + -> Elm.Expression + -> Elm.Expression + -> Elm.Expression + -> Elm.Expression + -> Elm.Expression) + -> Elm.Expression + -> Elm.Expression + -> Elm.Expression + -> Elm.Expression + -> Elm.Expression + -> Elm.Expression + -> Elm.Expression + -> Elm.Expression + -> Elm.Expression +map8 map8Arg_ map8Arg_0 map8Arg_1 map8Arg_2 map8Arg_3 map8Arg_4 map8Arg_5 map8Arg_6 map8Arg_7 = + Elm.apply + (Elm.value + { importFrom = [ "BackendTask" ] + , name = "map8" + , annotation = + Just + (Type.function + [ Type.function + [ Type.var "value1" + , Type.var "value2" + , Type.var "value3" + , Type.var "value4" + , Type.var "value5" + , Type.var "value6" + , Type.var "value7" + , Type.var "value8" + ] + (Type.var "valueCombined") + , Type.namedWith + [ "BackendTask" ] + "BackendTask" + [ Type.var "error", Type.var "value1" ] + , Type.namedWith + [ "BackendTask" ] + "BackendTask" + [ Type.var "error", Type.var "value2" ] + , Type.namedWith + [ "BackendTask" ] + "BackendTask" + [ Type.var "error", Type.var "value3" ] + , Type.namedWith + [ "BackendTask" ] + "BackendTask" + [ Type.var "error", Type.var "value4" ] + , Type.namedWith + [ "BackendTask" ] + "BackendTask" + [ Type.var "error", Type.var "value5" ] + , Type.namedWith + [ "BackendTask" ] + "BackendTask" + [ Type.var "error", Type.var "value6" ] + , Type.namedWith + [ "BackendTask" ] + "BackendTask" + [ Type.var "error", Type.var "value7" ] + , Type.namedWith + [ "BackendTask" ] + "BackendTask" + [ Type.var "error", Type.var "value8" ] + ] + (Type.namedWith + [ "BackendTask" ] + "BackendTask" + [ Type.var "error", Type.var "valueCombined" ] + ) + ) + } + ) + [ Elm.functionReduced + "map8Unpack" + (\functionReducedUnpack -> + Elm.functionReduced + "unpack" + (\functionReducedUnpack0 -> + Elm.functionReduced + "unpack" + (\functionReducedUnpack_2_1_2_0_2_0_2_0_0 -> + Elm.functionReduced + "unpack" + (\functionReducedUnpack_2_1_2_1_2_0_2_0_2_0_0 -> + Elm.functionReduced + "unpack" + (\functionReducedUnpack_2_1_2_1_2_1_2_0_2_0_2_0_0 -> + Elm.functionReduced + "unpack" + (\functionReducedUnpack_2_1_2_1_2_1_2_1_2_0_2_0_2_0_0 -> + Elm.functionReduced + "unpack" + (\functionReducedUnpack_2_1_2_1_2_1_2_1_2_1_2_0_2_0_2_0_0 -> + Elm.functionReduced + "unpack" + (((((((map8Arg_ + functionReducedUnpack + ) + functionReducedUnpack0 + ) + functionReducedUnpack_2_1_2_0_2_0_2_0_0 + ) + functionReducedUnpack_2_1_2_1_2_0_2_0_2_0_0 + ) + functionReducedUnpack_2_1_2_1_2_1_2_0_2_0_2_0_0 + ) + functionReducedUnpack_2_1_2_1_2_1_2_1_2_0_2_0_2_0_0 + ) + functionReducedUnpack_2_1_2_1_2_1_2_1_2_1_2_0_2_0_2_0_0 + ) + ) + ) + ) + ) + ) + ) + ) + , map8Arg_0 + , map8Arg_1 + , map8Arg_2 + , map8Arg_3 + , map8Arg_4 + , map8Arg_5 + , map8Arg_6 + , map8Arg_7 + ] + + +{-| map9: + (value1 + -> value2 + -> value3 + -> value4 + -> value5 + -> value6 + -> value7 + -> value8 + -> value9 + -> valueCombined) + -> BackendTask.BackendTask error value1 + -> BackendTask.BackendTask error value2 + -> BackendTask.BackendTask error value3 + -> BackendTask.BackendTask error value4 + -> BackendTask.BackendTask error value5 + -> BackendTask.BackendTask error value6 + -> BackendTask.BackendTask error value7 + -> BackendTask.BackendTask error value8 + -> BackendTask.BackendTask error value9 + -> BackendTask.BackendTask error valueCombined +-} +map9 : + (Elm.Expression + -> Elm.Expression + -> Elm.Expression + -> Elm.Expression + -> Elm.Expression + -> Elm.Expression + -> Elm.Expression + -> Elm.Expression + -> Elm.Expression + -> Elm.Expression) + -> Elm.Expression + -> Elm.Expression + -> Elm.Expression + -> Elm.Expression + -> Elm.Expression + -> Elm.Expression + -> Elm.Expression + -> Elm.Expression + -> Elm.Expression + -> Elm.Expression +map9 map9Arg_ map9Arg_0 map9Arg_1 map9Arg_2 map9Arg_3 map9Arg_4 map9Arg_5 map9Arg_6 map9Arg_7 map9Arg_8 = + Elm.apply + (Elm.value + { importFrom = [ "BackendTask" ] + , name = "map9" + , annotation = + Just + (Type.function + [ Type.function + [ Type.var "value1" + , Type.var "value2" + , Type.var "value3" + , Type.var "value4" + , Type.var "value5" + , Type.var "value6" + , Type.var "value7" + , Type.var "value8" + , Type.var "value9" + ] + (Type.var "valueCombined") + , Type.namedWith + [ "BackendTask" ] + "BackendTask" + [ Type.var "error", Type.var "value1" ] + , Type.namedWith + [ "BackendTask" ] + "BackendTask" + [ Type.var "error", Type.var "value2" ] + , Type.namedWith + [ "BackendTask" ] + "BackendTask" + [ Type.var "error", Type.var "value3" ] + , Type.namedWith + [ "BackendTask" ] + "BackendTask" + [ Type.var "error", Type.var "value4" ] + , Type.namedWith + [ "BackendTask" ] + "BackendTask" + [ Type.var "error", Type.var "value5" ] + , Type.namedWith + [ "BackendTask" ] + "BackendTask" + [ Type.var "error", Type.var "value6" ] + , Type.namedWith + [ "BackendTask" ] + "BackendTask" + [ Type.var "error", Type.var "value7" ] + , Type.namedWith + [ "BackendTask" ] + "BackendTask" + [ Type.var "error", Type.var "value8" ] + , Type.namedWith + [ "BackendTask" ] + "BackendTask" + [ Type.var "error", Type.var "value9" ] + ] + (Type.namedWith + [ "BackendTask" ] + "BackendTask" + [ Type.var "error", Type.var "valueCombined" ] + ) + ) + } + ) + [ Elm.functionReduced + "map9Unpack" + (\functionReducedUnpack -> + Elm.functionReduced + "unpack" + (\functionReducedUnpack0 -> + Elm.functionReduced + "unpack" + (\functionReducedUnpack_2_1_2_0_2_0_2_0_0 -> + Elm.functionReduced + "unpack" + (\functionReducedUnpack_2_1_2_1_2_0_2_0_2_0_0 -> + Elm.functionReduced + "unpack" + (\functionReducedUnpack_2_1_2_1_2_1_2_0_2_0_2_0_0 -> + Elm.functionReduced + "unpack" + (\functionReducedUnpack_2_1_2_1_2_1_2_1_2_0_2_0_2_0_0 -> + Elm.functionReduced + "unpack" + (\functionReducedUnpack_2_1_2_1_2_1_2_1_2_1_2_0_2_0_2_0_0 -> + Elm.functionReduced + "unpack" + (\functionReducedUnpack_2_1_2_1_2_1_2_1_2_1_2_1_2_0_2_0_2_0_0 -> + Elm.functionReduced + "unpack" + ((((((((map9Arg_ + functionReducedUnpack + ) + functionReducedUnpack0 + ) + functionReducedUnpack_2_1_2_0_2_0_2_0_0 + ) + functionReducedUnpack_2_1_2_1_2_0_2_0_2_0_0 + ) + functionReducedUnpack_2_1_2_1_2_1_2_0_2_0_2_0_0 + ) + functionReducedUnpack_2_1_2_1_2_1_2_1_2_0_2_0_2_0_0 + ) + functionReducedUnpack_2_1_2_1_2_1_2_1_2_1_2_0_2_0_2_0_0 + ) + functionReducedUnpack_2_1_2_1_2_1_2_1_2_1_2_1_2_0_2_0_2_0_0 + ) + ) + ) + ) + ) + ) + ) + ) + ) + , map9Arg_0 + , map9Arg_1 + , map9Arg_2 + , map9Arg_3 + , map9Arg_4 + , map9Arg_5 + , map9Arg_6 + , map9Arg_7 + , map9Arg_8 + ] + + +{-| Ignore any recoverable error data and propagate the `FatalError`. Similar to a `Cmd` in The Elm Architecture, +a `FatalError` will not do anything except if it is returned at the top-level of your application. Read more +in the [`FatalError` docs](FatalError). + +allowFatal: + BackendTask.BackendTask { error | fatal : FatalError.FatalError } data + -> BackendTask.BackendTask FatalError.FatalError data +-} +allowFatal : Elm.Expression -> Elm.Expression +allowFatal allowFatalArg_ = + Elm.apply + (Elm.value + { importFrom = [ "BackendTask" ] + , name = "allowFatal" + , annotation = + Just + (Type.function + [ Type.namedWith + [ "BackendTask" ] + "BackendTask" + [ Type.extensible + "error" + [ ( "fatal" + , Type.namedWith + [ "FatalError" ] + "FatalError" + [] + ) + ] + , Type.var "data" + ] + ] + (Type.namedWith + [ "BackendTask" ] + "BackendTask" + [ Type.namedWith [ "FatalError" ] "FatalError" [] + , Type.var "data" + ] + ) + ) + } + ) + [ allowFatalArg_ ] + + +{-| mapError: + (error -> errorMapped) + -> BackendTask.BackendTask error value + -> BackendTask.BackendTask errorMapped value +-} +mapError : + (Elm.Expression -> Elm.Expression) -> Elm.Expression -> Elm.Expression +mapError mapErrorArg_ mapErrorArg_0 = + Elm.apply + (Elm.value + { importFrom = [ "BackendTask" ] + , name = "mapError" + , annotation = + Just + (Type.function + [ Type.function + [ Type.var "error" ] + (Type.var "errorMapped") + , Type.namedWith + [ "BackendTask" ] + "BackendTask" + [ Type.var "error", Type.var "value" ] + ] + (Type.namedWith + [ "BackendTask" ] + "BackendTask" + [ Type.var "errorMapped", Type.var "value" ] + ) + ) + } + ) + [ Elm.functionReduced "mapErrorUnpack" mapErrorArg_, mapErrorArg_0 ] + + +{-| onError: + (error -> BackendTask.BackendTask mappedError value) + -> BackendTask.BackendTask error value + -> BackendTask.BackendTask mappedError value +-} +onError : (Elm.Expression -> Elm.Expression) -> Elm.Expression -> Elm.Expression +onError onErrorArg_ onErrorArg_0 = + Elm.apply + (Elm.value + { importFrom = [ "BackendTask" ] + , name = "onError" + , annotation = + Just + (Type.function + [ Type.function + [ Type.var "error" ] + (Type.namedWith + [ "BackendTask" ] + "BackendTask" + [ Type.var "mappedError", Type.var "value" ] + ) + , Type.namedWith + [ "BackendTask" ] + "BackendTask" + [ Type.var "error", Type.var "value" ] + ] + (Type.namedWith + [ "BackendTask" ] + "BackendTask" + [ Type.var "mappedError", Type.var "value" ] + ) + ) + } + ) + [ Elm.functionReduced "onErrorUnpack" onErrorArg_, onErrorArg_0 ] + + +{-| toResult: + BackendTask.BackendTask error data + -> BackendTask.BackendTask noError (Result.Result error data) +-} +toResult : Elm.Expression -> Elm.Expression +toResult toResultArg_ = + Elm.apply + (Elm.value + { importFrom = [ "BackendTask" ] + , name = "toResult" + , annotation = + Just + (Type.function + [ Type.namedWith + [ "BackendTask" ] + "BackendTask" + [ Type.var "error", Type.var "data" ] + ] + (Type.namedWith + [ "BackendTask" ] + "BackendTask" + [ Type.var "noError" + , Type.namedWith + [ "Result" ] + "Result" + [ Type.var "error", Type.var "data" ] + ] + ) + ) + } + ) + [ toResultArg_ ] + + +{-| Ignore the resulting value of the BackendTask. + +do: BackendTask.BackendTask error value -> BackendTask.BackendTask error () +-} +do : Elm.Expression -> Elm.Expression +do doArg_ = + Elm.apply + (Elm.value + { importFrom = [ "BackendTask" ] + , name = "do" + , annotation = + Just + (Type.function + [ Type.namedWith + [ "BackendTask" ] + "BackendTask" + [ Type.var "error", Type.var "value" ] + ] + (Type.namedWith + [ "BackendTask" ] + "BackendTask" + [ Type.var "error", Type.unit ] + ) + ) + } + ) + [ doArg_ ] + + +{-| Perform a List of `BackendTask`s with no output, one-by-one sequentially. + +Same as [`sequence`](#sequence), except it ignores the resulting value of each `BackendTask`. + +doEach: List (BackendTask.BackendTask error ()) -> BackendTask.BackendTask error () +-} +doEach : List Elm.Expression -> Elm.Expression +doEach doEachArg_ = + Elm.apply + (Elm.value + { importFrom = [ "BackendTask" ] + , name = "doEach" + , annotation = + Just + (Type.function + [ Type.list + (Type.namedWith + [ "BackendTask" ] + "BackendTask" + [ Type.var "error", Type.unit ] + ) + ] + (Type.namedWith + [ "BackendTask" ] + "BackendTask" + [ Type.var "error", Type.unit ] + ) + ) + } + ) + [ Elm.list doEachArg_ ] + + +{-| Perform a List of `BackendTask`s one-by-one sequentially. [`combine`](#combine) will perform them all in parallel, which is +typically a better default when you aren't sure which you want. + +Same as [`doEach`](#doEach), except it ignores the resulting value of each `BackendTask`. + +sequence: + List (BackendTask.BackendTask error value) + -> BackendTask.BackendTask error (List value) +-} +sequence : List Elm.Expression -> Elm.Expression +sequence sequenceArg_ = + Elm.apply + (Elm.value + { importFrom = [ "BackendTask" ] + , name = "sequence" + , annotation = + Just + (Type.function + [ Type.list + (Type.namedWith + [ "BackendTask" ] + "BackendTask" + [ Type.var "error", Type.var "value" ] + ) + ] + (Type.namedWith + [ "BackendTask" ] + "BackendTask" + [ Type.var "error" + , Type.list (Type.var "value") + ] + ) + ) + } + ) + [ Elm.list sequenceArg_ ] + + +{-| If the condition is true, fail with the given `FatalError`. Otherwise, succeed with `()`. + +failIf: + Bool + -> FatalError.FatalError + -> BackendTask.BackendTask FatalError.FatalError () +-} +failIf : Bool -> Elm.Expression -> Elm.Expression +failIf failIfArg_ failIfArg_0 = + Elm.apply + (Elm.value + { importFrom = [ "BackendTask" ] + , name = "failIf" + , annotation = + Just + (Type.function + [ Type.bool + , Type.namedWith [ "FatalError" ] "FatalError" [] + ] + (Type.namedWith + [ "BackendTask" ] + "BackendTask" + [ Type.namedWith [ "FatalError" ] "FatalError" [] + , Type.unit + ] + ) + ) + } + ) + [ Elm.bool failIfArg_, failIfArg_0 ] + + +{-| `inDir` sets the working directory for a `BackendTask`. The working directory of a `BackendTask` will be used to resolve relative paths +and is relevant for the following types of `BackendTask`s: + + - Reading files ([`BackendTask.File`](BackendTask-File)) + - Running glob patterns ([`BackendTask.Glob`](BackendTask-Glob)) + - Executing shell commands ([`BackendTask.Stream.command`](BackendTask-Stream#command)) and [`Pages.Script.sh`](Pages-Script#command) + +See the BackendTask Context section for more about how setting context works. + +For example, these two values will produce the same result: + + import BackendTask.Glob as Glob + + example1 : BackendTask error (List String) + example1 = + Glob.fromString "src/**/*.elm" + + example2 : BackendTask error (List String) + example2 = + BackendTask.inDir "src" (Glob.fromString "**/*.elm") + +You can also nest the working directory by using `inDir` multiple times: + + import BackendTask.Glob as Glob + + example3 : BackendTask error (List String) + example3 = + BackendTask.map2 + (\routeModules specialModules -> + { routeModules = routeModules + , specialModules = specialModules + } + ) + (BackendTask.inDir "Route" (Glob.fromString "**/*.elm")) + (Glob.fromString "*.elm") + |> BackendTask.inDir "app" + +The above example will list out files from `app/Route/**/*.elm` and `app/*.elm` because `inDir "app"` is applied to the `BackendTask.map2` which combines together both of the Glob tasks. + +`inDir` supports absolute paths. In this example, we apply a relative path on top of an absolute path, so the relative path will be resolved relative to the absolute path. + + import BackendTask.Glob as Glob + + example3 : BackendTask error (List String) + example3 = + BackendTask.map2 + (\routeModules specialModules -> + { routeModules = routeModules + , specialModules = specialModules + } + ) + -- same as `Glob.fromString "/projects/my-elm-pages-blog/app/Route/**/*.elm"` + (BackendTask.inDir "Route" (Glob.fromString "**/*.elm")) + (Glob.fromString "*.elm") + |> BackendTask.inDir "/projects/my-elm-pages-blog/app" + +You can also use `BackendTask.inDir ".."` to go up a directory, or \`BackendTask.inDir "../.." to go up two directories, etc. + +Use of trailing slashes is optional and does not change the behavior of `inDir`. Leading slashes distinguish between +absolute and relative paths, so `BackendTask.inDir "./src"` is exactly the same as `BackendTask.inDir "src"`, etc. + +Each level of nesting with `inDir` will resolve using [NodeJS's `path.resolve`](https://nodejs.org/api/path.html#pathresolvepaths). + +inDir: + String + -> BackendTask.BackendTask error value + -> BackendTask.BackendTask error value +-} +inDir : String -> Elm.Expression -> Elm.Expression +inDir inDirArg_ inDirArg_0 = + Elm.apply + (Elm.value + { importFrom = [ "BackendTask" ] + , name = "inDir" + , annotation = + Just + (Type.function + [ Type.string + , Type.namedWith + [ "BackendTask" ] + "BackendTask" + [ Type.var "error", Type.var "value" ] + ] + (Type.namedWith + [ "BackendTask" ] + "BackendTask" + [ Type.var "error", Type.var "value" ] + ) + ) + } + ) + [ Elm.string inDirArg_, inDirArg_0 ] + + +{-| Sets the verbosity level to `quiet` in the context of the given `BackendTask` (including all nested `BackendTask`s and continuations within it). + +This will turn off performance timing logs. It will also prevent shell commands from printing their output to the console when they are run +(see [`BackendTask.Stream.command`](BackendTask-Stream#command)). + +quiet: BackendTask.BackendTask error value -> BackendTask.BackendTask error value +-} +quiet : Elm.Expression -> Elm.Expression +quiet quietArg_ = + Elm.apply + (Elm.value + { importFrom = [ "BackendTask" ] + , name = "quiet" + , annotation = + Just + (Type.function + [ Type.namedWith + [ "BackendTask" ] + "BackendTask" + [ Type.var "error", Type.var "value" ] + ] + (Type.namedWith + [ "BackendTask" ] + "BackendTask" + [ Type.var "error", Type.var "value" ] + ) + ) + } + ) + [ quietArg_ ] + + +{-| withEnv: + String + -> String + -> BackendTask.BackendTask error value + -> BackendTask.BackendTask error value +-} +withEnv : String -> String -> Elm.Expression -> Elm.Expression +withEnv withEnvArg_ withEnvArg_0 withEnvArg_1 = + Elm.apply + (Elm.value + { importFrom = [ "BackendTask" ] + , name = "withEnv" + , annotation = + Just + (Type.function + [ Type.string + , Type.string + , Type.namedWith + [ "BackendTask" ] + "BackendTask" + [ Type.var "error", Type.var "value" ] + ] + (Type.namedWith + [ "BackendTask" ] + "BackendTask" + [ Type.var "error", Type.var "value" ] + ) + ) + } + ) + [ Elm.string withEnvArg_, Elm.string withEnvArg_0, withEnvArg_1 ] + + +annotation_ : + { backendTask : Type.Annotation -> Type.Annotation -> Type.Annotation } +annotation_ = + { backendTask = + \backendTaskArg0 backendTaskArg1 -> + Type.alias + moduleName_ + "BackendTask" + [ backendTaskArg0, backendTaskArg1 ] + (Type.namedWith + [ "Pages", "StaticHttpRequest" ] + "RawRequest" + [ Type.var "error", Type.var "value" ] + ) + } + + +call_ : + { map : Elm.Expression -> Elm.Expression -> Elm.Expression + , succeed : Elm.Expression -> Elm.Expression + , fail : Elm.Expression -> Elm.Expression + , fromResult : Elm.Expression -> Elm.Expression + , andThen : Elm.Expression -> Elm.Expression -> Elm.Expression + , resolve : Elm.Expression -> Elm.Expression + , combine : Elm.Expression -> Elm.Expression + , andMap : Elm.Expression -> Elm.Expression -> Elm.Expression + , map2 : + Elm.Expression -> Elm.Expression -> Elm.Expression -> Elm.Expression + , map3 : + Elm.Expression + -> Elm.Expression + -> Elm.Expression + -> Elm.Expression + -> Elm.Expression + , map4 : + Elm.Expression + -> Elm.Expression + -> Elm.Expression + -> Elm.Expression + -> Elm.Expression + -> Elm.Expression + , map5 : + Elm.Expression + -> Elm.Expression + -> Elm.Expression + -> Elm.Expression + -> Elm.Expression + -> Elm.Expression + -> Elm.Expression + , map6 : + Elm.Expression + -> Elm.Expression + -> Elm.Expression + -> Elm.Expression + -> Elm.Expression + -> Elm.Expression + -> Elm.Expression + -> Elm.Expression + , map7 : + Elm.Expression + -> Elm.Expression + -> Elm.Expression + -> Elm.Expression + -> Elm.Expression + -> Elm.Expression + -> Elm.Expression + -> Elm.Expression + -> Elm.Expression + , map8 : + Elm.Expression + -> Elm.Expression + -> Elm.Expression + -> Elm.Expression + -> Elm.Expression + -> Elm.Expression + -> Elm.Expression + -> Elm.Expression + -> Elm.Expression + -> Elm.Expression + , map9 : + Elm.Expression + -> Elm.Expression + -> Elm.Expression + -> Elm.Expression + -> Elm.Expression + -> Elm.Expression + -> Elm.Expression + -> Elm.Expression + -> Elm.Expression + -> Elm.Expression + -> Elm.Expression + , allowFatal : Elm.Expression -> Elm.Expression + , mapError : Elm.Expression -> Elm.Expression -> Elm.Expression + , onError : Elm.Expression -> Elm.Expression -> Elm.Expression + , toResult : Elm.Expression -> Elm.Expression + , do : Elm.Expression -> Elm.Expression + , doEach : Elm.Expression -> Elm.Expression + , sequence : Elm.Expression -> Elm.Expression + , failIf : Elm.Expression -> Elm.Expression -> Elm.Expression + , inDir : Elm.Expression -> Elm.Expression -> Elm.Expression + , quiet : Elm.Expression -> Elm.Expression + , withEnv : + Elm.Expression -> Elm.Expression -> Elm.Expression -> Elm.Expression + } +call_ = + { map = + \mapArg_ mapArg_0 -> + Elm.apply + (Elm.value + { importFrom = [ "BackendTask" ] + , name = "map" + , annotation = + Just + (Type.function + [ Type.function + [ Type.var "a" ] + (Type.var "b") + , Type.namedWith + [ "BackendTask" ] + "BackendTask" + [ Type.var "error", Type.var "a" ] + ] + (Type.namedWith + [ "BackendTask" ] + "BackendTask" + [ Type.var "error", Type.var "b" ] + ) + ) + } + ) + [ mapArg_, mapArg_0 ] + , succeed = + \succeedArg_ -> + Elm.apply + (Elm.value + { importFrom = [ "BackendTask" ] + , name = "succeed" + , annotation = + Just + (Type.function + [ Type.var "a" ] + (Type.namedWith + [ "BackendTask" ] + "BackendTask" + [ Type.var "error", Type.var "a" ] + ) + ) + } + ) + [ succeedArg_ ] + , fail = + \failArg_ -> + Elm.apply + (Elm.value + { importFrom = [ "BackendTask" ] + , name = "fail" + , annotation = + Just + (Type.function + [ Type.var "error" ] + (Type.namedWith + [ "BackendTask" ] + "BackendTask" + [ Type.var "error", Type.var "a" ] + ) + ) + } + ) + [ failArg_ ] + , fromResult = + \fromResultArg_ -> + Elm.apply + (Elm.value + { importFrom = [ "BackendTask" ] + , name = "fromResult" + , annotation = + Just + (Type.function + [ Type.namedWith + [ "Result" ] + "Result" + [ Type.var "error", Type.var "value" ] + ] + (Type.namedWith + [ "BackendTask" ] + "BackendTask" + [ Type.var "error", Type.var "value" ] + ) + ) + } + ) + [ fromResultArg_ ] + , andThen = + \andThenArg_ andThenArg_0 -> + Elm.apply + (Elm.value + { importFrom = [ "BackendTask" ] + , name = "andThen" + , annotation = + Just + (Type.function + [ Type.function + [ Type.var "a" ] + (Type.namedWith + [ "BackendTask" ] + "BackendTask" + [ Type.var "error", Type.var "b" ] + ) + , Type.namedWith + [ "BackendTask" ] + "BackendTask" + [ Type.var "error", Type.var "a" ] + ] + (Type.namedWith + [ "BackendTask" ] + "BackendTask" + [ Type.var "error", Type.var "b" ] + ) + ) + } + ) + [ andThenArg_, andThenArg_0 ] + , resolve = + \resolveArg_ -> + Elm.apply + (Elm.value + { importFrom = [ "BackendTask" ] + , name = "resolve" + , annotation = + Just + (Type.function + [ Type.namedWith + [ "BackendTask" ] + "BackendTask" + [ Type.var "error" + , Type.list + (Type.namedWith + [ "BackendTask" ] + "BackendTask" + [ Type.var "error" + , Type.var "value" + ] + ) + ] + ] + (Type.namedWith + [ "BackendTask" ] + "BackendTask" + [ Type.var "error" + , Type.list (Type.var "value") + ] + ) + ) + } + ) + [ resolveArg_ ] + , combine = + \combineArg_ -> + Elm.apply + (Elm.value + { importFrom = [ "BackendTask" ] + , name = "combine" + , annotation = + Just + (Type.function + [ Type.list + (Type.namedWith + [ "BackendTask" ] + "BackendTask" + [ Type.var "error", Type.var "value" ] + ) + ] + (Type.namedWith + [ "BackendTask" ] + "BackendTask" + [ Type.var "error" + , Type.list (Type.var "value") + ] + ) + ) + } + ) + [ combineArg_ ] + , andMap = + \andMapArg_ andMapArg_0 -> + Elm.apply + (Elm.value + { importFrom = [ "BackendTask" ] + , name = "andMap" + , annotation = + Just + (Type.function + [ Type.namedWith + [ "BackendTask" ] + "BackendTask" + [ Type.var "error", Type.var "a" ] + , Type.namedWith + [ "BackendTask" ] + "BackendTask" + [ Type.var "error" + , Type.function + [ Type.var "a" ] + (Type.var "b") + ] + ] + (Type.namedWith + [ "BackendTask" ] + "BackendTask" + [ Type.var "error", Type.var "b" ] + ) + ) + } + ) + [ andMapArg_, andMapArg_0 ] + , map2 = + \map2Arg_ map2Arg_0 map2Arg_1 -> + Elm.apply + (Elm.value + { importFrom = [ "BackendTask" ] + , name = "map2" + , annotation = + Just + (Type.function + [ Type.function + [ Type.var "a", Type.var "b" ] + (Type.var "c") + , Type.namedWith + [ "BackendTask" ] + "BackendTask" + [ Type.var "error", Type.var "a" ] + , Type.namedWith + [ "BackendTask" ] + "BackendTask" + [ Type.var "error", Type.var "b" ] + ] + (Type.namedWith + [ "BackendTask" ] + "BackendTask" + [ Type.var "error", Type.var "c" ] + ) + ) + } + ) + [ map2Arg_, map2Arg_0, map2Arg_1 ] + , map3 = + \map3Arg_ map3Arg_0 map3Arg_1 map3Arg_2 -> + Elm.apply + (Elm.value + { importFrom = [ "BackendTask" ] + , name = "map3" + , annotation = + Just + (Type.function + [ Type.function + [ Type.var "value1" + , Type.var "value2" + , Type.var "value3" + ] + (Type.var "valueCombined") + , Type.namedWith + [ "BackendTask" ] + "BackendTask" + [ Type.var "error", Type.var "value1" ] + , Type.namedWith + [ "BackendTask" ] + "BackendTask" + [ Type.var "error", Type.var "value2" ] + , Type.namedWith + [ "BackendTask" ] + "BackendTask" + [ Type.var "error", Type.var "value3" ] + ] + (Type.namedWith + [ "BackendTask" ] + "BackendTask" + [ Type.var "error" + , Type.var "valueCombined" + ] + ) + ) + } + ) + [ map3Arg_, map3Arg_0, map3Arg_1, map3Arg_2 ] + , map4 = + \map4Arg_ map4Arg_0 map4Arg_1 map4Arg_2 map4Arg_3 -> + Elm.apply + (Elm.value + { importFrom = [ "BackendTask" ] + , name = "map4" + , annotation = + Just + (Type.function + [ Type.function + [ Type.var "value1" + , Type.var "value2" + , Type.var "value3" + , Type.var "value4" + ] + (Type.var "valueCombined") + , Type.namedWith + [ "BackendTask" ] + "BackendTask" + [ Type.var "error", Type.var "value1" ] + , Type.namedWith + [ "BackendTask" ] + "BackendTask" + [ Type.var "error", Type.var "value2" ] + , Type.namedWith + [ "BackendTask" ] + "BackendTask" + [ Type.var "error", Type.var "value3" ] + , Type.namedWith + [ "BackendTask" ] + "BackendTask" + [ Type.var "error", Type.var "value4" ] + ] + (Type.namedWith + [ "BackendTask" ] + "BackendTask" + [ Type.var "error" + , Type.var "valueCombined" + ] + ) + ) + } + ) + [ map4Arg_, map4Arg_0, map4Arg_1, map4Arg_2, map4Arg_3 ] + , map5 = + \map5Arg_ map5Arg_0 map5Arg_1 map5Arg_2 map5Arg_3 map5Arg_4 -> + Elm.apply + (Elm.value + { importFrom = [ "BackendTask" ] + , name = "map5" + , annotation = + Just + (Type.function + [ Type.function + [ Type.var "value1" + , Type.var "value2" + , Type.var "value3" + , Type.var "value4" + , Type.var "value5" + ] + (Type.var "valueCombined") + , Type.namedWith + [ "BackendTask" ] + "BackendTask" + [ Type.var "error", Type.var "value1" ] + , Type.namedWith + [ "BackendTask" ] + "BackendTask" + [ Type.var "error", Type.var "value2" ] + , Type.namedWith + [ "BackendTask" ] + "BackendTask" + [ Type.var "error", Type.var "value3" ] + , Type.namedWith + [ "BackendTask" ] + "BackendTask" + [ Type.var "error", Type.var "value4" ] + , Type.namedWith + [ "BackendTask" ] + "BackendTask" + [ Type.var "error", Type.var "value5" ] + ] + (Type.namedWith + [ "BackendTask" ] + "BackendTask" + [ Type.var "error" + , Type.var "valueCombined" + ] + ) + ) + } + ) + [ map5Arg_ + , map5Arg_0 + , map5Arg_1 + , map5Arg_2 + , map5Arg_3 + , map5Arg_4 + ] + , map6 = + \map6Arg_ map6Arg_0 map6Arg_1 map6Arg_2 map6Arg_3 map6Arg_4 map6Arg_5 -> + Elm.apply + (Elm.value + { importFrom = [ "BackendTask" ] + , name = "map6" + , annotation = + Just + (Type.function + [ Type.function + [ Type.var "value1" + , Type.var "value2" + , Type.var "value3" + , Type.var "value4" + , Type.var "value5" + , Type.var "value6" + ] + (Type.var "valueCombined") + , Type.namedWith + [ "BackendTask" ] + "BackendTask" + [ Type.var "error", Type.var "value1" ] + , Type.namedWith + [ "BackendTask" ] + "BackendTask" + [ Type.var "error", Type.var "value2" ] + , Type.namedWith + [ "BackendTask" ] + "BackendTask" + [ Type.var "error", Type.var "value3" ] + , Type.namedWith + [ "BackendTask" ] + "BackendTask" + [ Type.var "error", Type.var "value4" ] + , Type.namedWith + [ "BackendTask" ] + "BackendTask" + [ Type.var "error", Type.var "value5" ] + , Type.namedWith + [ "BackendTask" ] + "BackendTask" + [ Type.var "error", Type.var "value6" ] + ] + (Type.namedWith + [ "BackendTask" ] + "BackendTask" + [ Type.var "error" + , Type.var "valueCombined" + ] + ) + ) + } + ) + [ map6Arg_ + , map6Arg_0 + , map6Arg_1 + , map6Arg_2 + , map6Arg_3 + , map6Arg_4 + , map6Arg_5 + ] + , map7 = + \map7Arg_ map7Arg_0 map7Arg_1 map7Arg_2 map7Arg_3 map7Arg_4 map7Arg_5 map7Arg_6 -> + Elm.apply + (Elm.value + { importFrom = [ "BackendTask" ] + , name = "map7" + , annotation = + Just + (Type.function + [ Type.function + [ Type.var "value1" + , Type.var "value2" + , Type.var "value3" + , Type.var "value4" + , Type.var "value5" + , Type.var "value6" + , Type.var "value7" + ] + (Type.var "valueCombined") + , Type.namedWith + [ "BackendTask" ] + "BackendTask" + [ Type.var "error", Type.var "value1" ] + , Type.namedWith + [ "BackendTask" ] + "BackendTask" + [ Type.var "error", Type.var "value2" ] + , Type.namedWith + [ "BackendTask" ] + "BackendTask" + [ Type.var "error", Type.var "value3" ] + , Type.namedWith + [ "BackendTask" ] + "BackendTask" + [ Type.var "error", Type.var "value4" ] + , Type.namedWith + [ "BackendTask" ] + "BackendTask" + [ Type.var "error", Type.var "value5" ] + , Type.namedWith + [ "BackendTask" ] + "BackendTask" + [ Type.var "error", Type.var "value6" ] + , Type.namedWith + [ "BackendTask" ] + "BackendTask" + [ Type.var "error", Type.var "value7" ] + ] + (Type.namedWith + [ "BackendTask" ] + "BackendTask" + [ Type.var "error" + , Type.var "valueCombined" + ] + ) + ) + } + ) + [ map7Arg_ + , map7Arg_0 + , map7Arg_1 + , map7Arg_2 + , map7Arg_3 + , map7Arg_4 + , map7Arg_5 + , map7Arg_6 + ] + , map8 = + \map8Arg_ map8Arg_0 map8Arg_1 map8Arg_2 map8Arg_3 map8Arg_4 map8Arg_5 map8Arg_6 map8Arg_7 -> + Elm.apply + (Elm.value + { importFrom = [ "BackendTask" ] + , name = "map8" + , annotation = + Just + (Type.function + [ Type.function + [ Type.var "value1" + , Type.var "value2" + , Type.var "value3" + , Type.var "value4" + , Type.var "value5" + , Type.var "value6" + , Type.var "value7" + , Type.var "value8" + ] + (Type.var "valueCombined") + , Type.namedWith + [ "BackendTask" ] + "BackendTask" + [ Type.var "error", Type.var "value1" ] + , Type.namedWith + [ "BackendTask" ] + "BackendTask" + [ Type.var "error", Type.var "value2" ] + , Type.namedWith + [ "BackendTask" ] + "BackendTask" + [ Type.var "error", Type.var "value3" ] + , Type.namedWith + [ "BackendTask" ] + "BackendTask" + [ Type.var "error", Type.var "value4" ] + , Type.namedWith + [ "BackendTask" ] + "BackendTask" + [ Type.var "error", Type.var "value5" ] + , Type.namedWith + [ "BackendTask" ] + "BackendTask" + [ Type.var "error", Type.var "value6" ] + , Type.namedWith + [ "BackendTask" ] + "BackendTask" + [ Type.var "error", Type.var "value7" ] + , Type.namedWith + [ "BackendTask" ] + "BackendTask" + [ Type.var "error", Type.var "value8" ] + ] + (Type.namedWith + [ "BackendTask" ] + "BackendTask" + [ Type.var "error" + , Type.var "valueCombined" + ] + ) + ) + } + ) + [ map8Arg_ + , map8Arg_0 + , map8Arg_1 + , map8Arg_2 + , map8Arg_3 + , map8Arg_4 + , map8Arg_5 + , map8Arg_6 + , map8Arg_7 + ] + , map9 = + \map9Arg_ map9Arg_0 map9Arg_1 map9Arg_2 map9Arg_3 map9Arg_4 map9Arg_5 map9Arg_6 map9Arg_7 map9Arg_8 -> + Elm.apply + (Elm.value + { importFrom = [ "BackendTask" ] + , name = "map9" + , annotation = + Just + (Type.function + [ Type.function + [ Type.var "value1" + , Type.var "value2" + , Type.var "value3" + , Type.var "value4" + , Type.var "value5" + , Type.var "value6" + , Type.var "value7" + , Type.var "value8" + , Type.var "value9" + ] + (Type.var "valueCombined") + , Type.namedWith + [ "BackendTask" ] + "BackendTask" + [ Type.var "error", Type.var "value1" ] + , Type.namedWith + [ "BackendTask" ] + "BackendTask" + [ Type.var "error", Type.var "value2" ] + , Type.namedWith + [ "BackendTask" ] + "BackendTask" + [ Type.var "error", Type.var "value3" ] + , Type.namedWith + [ "BackendTask" ] + "BackendTask" + [ Type.var "error", Type.var "value4" ] + , Type.namedWith + [ "BackendTask" ] + "BackendTask" + [ Type.var "error", Type.var "value5" ] + , Type.namedWith + [ "BackendTask" ] + "BackendTask" + [ Type.var "error", Type.var "value6" ] + , Type.namedWith + [ "BackendTask" ] + "BackendTask" + [ Type.var "error", Type.var "value7" ] + , Type.namedWith + [ "BackendTask" ] + "BackendTask" + [ Type.var "error", Type.var "value8" ] + , Type.namedWith + [ "BackendTask" ] + "BackendTask" + [ Type.var "error", Type.var "value9" ] + ] + (Type.namedWith + [ "BackendTask" ] + "BackendTask" + [ Type.var "error" + , Type.var "valueCombined" + ] + ) + ) + } + ) + [ map9Arg_ + , map9Arg_0 + , map9Arg_1 + , map9Arg_2 + , map9Arg_3 + , map9Arg_4 + , map9Arg_5 + , map9Arg_6 + , map9Arg_7 + , map9Arg_8 + ] + , allowFatal = + \allowFatalArg_ -> + Elm.apply + (Elm.value + { importFrom = [ "BackendTask" ] + , name = "allowFatal" + , annotation = + Just + (Type.function + [ Type.namedWith + [ "BackendTask" ] + "BackendTask" + [ Type.extensible + "error" + [ ( "fatal" + , Type.namedWith + [ "FatalError" ] + "FatalError" + [] + ) + ] + , Type.var "data" + ] + ] + (Type.namedWith + [ "BackendTask" ] + "BackendTask" + [ Type.namedWith + [ "FatalError" ] + "FatalError" + [] + , Type.var "data" + ] + ) + ) + } + ) + [ allowFatalArg_ ] + , mapError = + \mapErrorArg_ mapErrorArg_0 -> + Elm.apply + (Elm.value + { importFrom = [ "BackendTask" ] + , name = "mapError" + , annotation = + Just + (Type.function + [ Type.function + [ Type.var "error" ] + (Type.var "errorMapped") + , Type.namedWith + [ "BackendTask" ] + "BackendTask" + [ Type.var "error", Type.var "value" ] + ] + (Type.namedWith + [ "BackendTask" ] + "BackendTask" + [ Type.var "errorMapped" + , Type.var "value" + ] + ) + ) + } + ) + [ mapErrorArg_, mapErrorArg_0 ] + , onError = + \onErrorArg_ onErrorArg_0 -> + Elm.apply + (Elm.value + { importFrom = [ "BackendTask" ] + , name = "onError" + , annotation = + Just + (Type.function + [ Type.function + [ Type.var "error" ] + (Type.namedWith + [ "BackendTask" ] + "BackendTask" + [ Type.var "mappedError" + , Type.var "value" + ] + ) + , Type.namedWith + [ "BackendTask" ] + "BackendTask" + [ Type.var "error", Type.var "value" ] + ] + (Type.namedWith + [ "BackendTask" ] + "BackendTask" + [ Type.var "mappedError" + , Type.var "value" + ] + ) + ) + } + ) + [ onErrorArg_, onErrorArg_0 ] + , toResult = + \toResultArg_ -> + Elm.apply + (Elm.value + { importFrom = [ "BackendTask" ] + , name = "toResult" + , annotation = + Just + (Type.function + [ Type.namedWith + [ "BackendTask" ] + "BackendTask" + [ Type.var "error", Type.var "data" ] + ] + (Type.namedWith + [ "BackendTask" ] + "BackendTask" + [ Type.var "noError" + , Type.namedWith + [ "Result" ] + "Result" + [ Type.var "error", Type.var "data" ] + ] + ) + ) + } + ) + [ toResultArg_ ] + , do = + \doArg_ -> + Elm.apply + (Elm.value + { importFrom = [ "BackendTask" ] + , name = "do" + , annotation = + Just + (Type.function + [ Type.namedWith + [ "BackendTask" ] + "BackendTask" + [ Type.var "error", Type.var "value" ] + ] + (Type.namedWith + [ "BackendTask" ] + "BackendTask" + [ Type.var "error", Type.unit ] + ) + ) + } + ) + [ doArg_ ] + , doEach = + \doEachArg_ -> + Elm.apply + (Elm.value + { importFrom = [ "BackendTask" ] + , name = "doEach" + , annotation = + Just + (Type.function + [ Type.list + (Type.namedWith + [ "BackendTask" ] + "BackendTask" + [ Type.var "error", Type.unit ] + ) + ] + (Type.namedWith + [ "BackendTask" ] + "BackendTask" + [ Type.var "error", Type.unit ] + ) + ) + } + ) + [ doEachArg_ ] + , sequence = + \sequenceArg_ -> + Elm.apply + (Elm.value + { importFrom = [ "BackendTask" ] + , name = "sequence" + , annotation = + Just + (Type.function + [ Type.list + (Type.namedWith + [ "BackendTask" ] + "BackendTask" + [ Type.var "error", Type.var "value" ] + ) + ] + (Type.namedWith + [ "BackendTask" ] + "BackendTask" + [ Type.var "error" + , Type.list (Type.var "value") + ] + ) + ) + } + ) + [ sequenceArg_ ] + , failIf = + \failIfArg_ failIfArg_0 -> + Elm.apply + (Elm.value + { importFrom = [ "BackendTask" ] + , name = "failIf" + , annotation = + Just + (Type.function + [ Type.bool + , Type.namedWith + [ "FatalError" ] + "FatalError" + [] + ] + (Type.namedWith + [ "BackendTask" ] + "BackendTask" + [ Type.namedWith + [ "FatalError" ] + "FatalError" + [] + , Type.unit + ] + ) + ) + } + ) + [ failIfArg_, failIfArg_0 ] + , inDir = + \inDirArg_ inDirArg_0 -> + Elm.apply + (Elm.value + { importFrom = [ "BackendTask" ] + , name = "inDir" + , annotation = + Just + (Type.function + [ Type.string + , Type.namedWith + [ "BackendTask" ] + "BackendTask" + [ Type.var "error", Type.var "value" ] + ] + (Type.namedWith + [ "BackendTask" ] + "BackendTask" + [ Type.var "error", Type.var "value" ] + ) + ) + } + ) + [ inDirArg_, inDirArg_0 ] + , quiet = + \quietArg_ -> + Elm.apply + (Elm.value + { importFrom = [ "BackendTask" ] + , name = "quiet" + , annotation = + Just + (Type.function + [ Type.namedWith + [ "BackendTask" ] + "BackendTask" + [ Type.var "error", Type.var "value" ] + ] + (Type.namedWith + [ "BackendTask" ] + "BackendTask" + [ Type.var "error", Type.var "value" ] + ) + ) + } + ) + [ quietArg_ ] + , withEnv = + \withEnvArg_ withEnvArg_0 withEnvArg_1 -> + Elm.apply + (Elm.value + { importFrom = [ "BackendTask" ] + , name = "withEnv" + , annotation = + Just + (Type.function + [ Type.string + , Type.string + , Type.namedWith + [ "BackendTask" ] + "BackendTask" + [ Type.var "error", Type.var "value" ] + ] + (Type.namedWith + [ "BackendTask" ] + "BackendTask" + [ Type.var "error", Type.var "value" ] + ) + ) + } + ) + [ withEnvArg_, withEnvArg_0, withEnvArg_1 ] + } + + +values_ : + { map : Elm.Expression + , succeed : Elm.Expression + , fail : Elm.Expression + , fromResult : Elm.Expression + , andThen : Elm.Expression + , resolve : Elm.Expression + , combine : Elm.Expression + , andMap : Elm.Expression + , map2 : Elm.Expression + , map3 : Elm.Expression + , map4 : Elm.Expression + , map5 : Elm.Expression + , map6 : Elm.Expression + , map7 : Elm.Expression + , map8 : Elm.Expression + , map9 : Elm.Expression + , allowFatal : Elm.Expression + , mapError : Elm.Expression + , onError : Elm.Expression + , toResult : Elm.Expression + , do : Elm.Expression + , doEach : Elm.Expression + , sequence : Elm.Expression + , failIf : Elm.Expression + , inDir : Elm.Expression + , quiet : Elm.Expression + , withEnv : Elm.Expression + } +values_ = + { map = + Elm.value + { importFrom = [ "BackendTask" ] + , name = "map" + , annotation = + Just + (Type.function + [ Type.function [ Type.var "a" ] (Type.var "b") + , Type.namedWith + [ "BackendTask" ] + "BackendTask" + [ Type.var "error", Type.var "a" ] + ] + (Type.namedWith + [ "BackendTask" ] + "BackendTask" + [ Type.var "error", Type.var "b" ] + ) + ) + } + , succeed = + Elm.value + { importFrom = [ "BackendTask" ] + , name = "succeed" + , annotation = + Just + (Type.function + [ Type.var "a" ] + (Type.namedWith + [ "BackendTask" ] + "BackendTask" + [ Type.var "error", Type.var "a" ] + ) + ) + } + , fail = + Elm.value + { importFrom = [ "BackendTask" ] + , name = "fail" + , annotation = + Just + (Type.function + [ Type.var "error" ] + (Type.namedWith + [ "BackendTask" ] + "BackendTask" + [ Type.var "error", Type.var "a" ] + ) + ) + } + , fromResult = + Elm.value + { importFrom = [ "BackendTask" ] + , name = "fromResult" + , annotation = + Just + (Type.function + [ Type.namedWith + [ "Result" ] + "Result" + [ Type.var "error", Type.var "value" ] + ] + (Type.namedWith + [ "BackendTask" ] + "BackendTask" + [ Type.var "error", Type.var "value" ] + ) + ) + } + , andThen = + Elm.value + { importFrom = [ "BackendTask" ] + , name = "andThen" + , annotation = + Just + (Type.function + [ Type.function + [ Type.var "a" ] + (Type.namedWith + [ "BackendTask" ] + "BackendTask" + [ Type.var "error", Type.var "b" ] + ) + , Type.namedWith + [ "BackendTask" ] + "BackendTask" + [ Type.var "error", Type.var "a" ] + ] + (Type.namedWith + [ "BackendTask" ] + "BackendTask" + [ Type.var "error", Type.var "b" ] + ) + ) + } + , resolve = + Elm.value + { importFrom = [ "BackendTask" ] + , name = "resolve" + , annotation = + Just + (Type.function + [ Type.namedWith + [ "BackendTask" ] + "BackendTask" + [ Type.var "error" + , Type.list + (Type.namedWith + [ "BackendTask" ] + "BackendTask" + [ Type.var "error", Type.var "value" ] + ) + ] + ] + (Type.namedWith + [ "BackendTask" ] + "BackendTask" + [ Type.var "error", Type.list (Type.var "value") ] + ) + ) + } + , combine = + Elm.value + { importFrom = [ "BackendTask" ] + , name = "combine" + , annotation = + Just + (Type.function + [ Type.list + (Type.namedWith + [ "BackendTask" ] + "BackendTask" + [ Type.var "error", Type.var "value" ] + ) + ] + (Type.namedWith + [ "BackendTask" ] + "BackendTask" + [ Type.var "error", Type.list (Type.var "value") ] + ) + ) + } + , andMap = + Elm.value + { importFrom = [ "BackendTask" ] + , name = "andMap" + , annotation = + Just + (Type.function + [ Type.namedWith + [ "BackendTask" ] + "BackendTask" + [ Type.var "error", Type.var "a" ] + , Type.namedWith + [ "BackendTask" ] + "BackendTask" + [ Type.var "error" + , Type.function [ Type.var "a" ] (Type.var "b") + ] + ] + (Type.namedWith + [ "BackendTask" ] + "BackendTask" + [ Type.var "error", Type.var "b" ] + ) + ) + } + , map2 = + Elm.value + { importFrom = [ "BackendTask" ] + , name = "map2" + , annotation = + Just + (Type.function + [ Type.function + [ Type.var "a", Type.var "b" ] + (Type.var "c") + , Type.namedWith + [ "BackendTask" ] + "BackendTask" + [ Type.var "error", Type.var "a" ] + , Type.namedWith + [ "BackendTask" ] + "BackendTask" + [ Type.var "error", Type.var "b" ] + ] + (Type.namedWith + [ "BackendTask" ] + "BackendTask" + [ Type.var "error", Type.var "c" ] + ) + ) + } + , map3 = + Elm.value + { importFrom = [ "BackendTask" ] + , name = "map3" + , annotation = + Just + (Type.function + [ Type.function + [ Type.var "value1" + , Type.var "value2" + , Type.var "value3" + ] + (Type.var "valueCombined") + , Type.namedWith + [ "BackendTask" ] + "BackendTask" + [ Type.var "error", Type.var "value1" ] + , Type.namedWith + [ "BackendTask" ] + "BackendTask" + [ Type.var "error", Type.var "value2" ] + , Type.namedWith + [ "BackendTask" ] + "BackendTask" + [ Type.var "error", Type.var "value3" ] + ] + (Type.namedWith + [ "BackendTask" ] + "BackendTask" + [ Type.var "error", Type.var "valueCombined" ] + ) + ) + } + , map4 = + Elm.value + { importFrom = [ "BackendTask" ] + , name = "map4" + , annotation = + Just + (Type.function + [ Type.function + [ Type.var "value1" + , Type.var "value2" + , Type.var "value3" + , Type.var "value4" + ] + (Type.var "valueCombined") + , Type.namedWith + [ "BackendTask" ] + "BackendTask" + [ Type.var "error", Type.var "value1" ] + , Type.namedWith + [ "BackendTask" ] + "BackendTask" + [ Type.var "error", Type.var "value2" ] + , Type.namedWith + [ "BackendTask" ] + "BackendTask" + [ Type.var "error", Type.var "value3" ] + , Type.namedWith + [ "BackendTask" ] + "BackendTask" + [ Type.var "error", Type.var "value4" ] + ] + (Type.namedWith + [ "BackendTask" ] + "BackendTask" + [ Type.var "error", Type.var "valueCombined" ] + ) + ) + } + , map5 = + Elm.value + { importFrom = [ "BackendTask" ] + , name = "map5" + , annotation = + Just + (Type.function + [ Type.function + [ Type.var "value1" + , Type.var "value2" + , Type.var "value3" + , Type.var "value4" + , Type.var "value5" + ] + (Type.var "valueCombined") + , Type.namedWith + [ "BackendTask" ] + "BackendTask" + [ Type.var "error", Type.var "value1" ] + , Type.namedWith + [ "BackendTask" ] + "BackendTask" + [ Type.var "error", Type.var "value2" ] + , Type.namedWith + [ "BackendTask" ] + "BackendTask" + [ Type.var "error", Type.var "value3" ] + , Type.namedWith + [ "BackendTask" ] + "BackendTask" + [ Type.var "error", Type.var "value4" ] + , Type.namedWith + [ "BackendTask" ] + "BackendTask" + [ Type.var "error", Type.var "value5" ] + ] + (Type.namedWith + [ "BackendTask" ] + "BackendTask" + [ Type.var "error", Type.var "valueCombined" ] + ) + ) + } + , map6 = + Elm.value + { importFrom = [ "BackendTask" ] + , name = "map6" + , annotation = + Just + (Type.function + [ Type.function + [ Type.var "value1" + , Type.var "value2" + , Type.var "value3" + , Type.var "value4" + , Type.var "value5" + , Type.var "value6" + ] + (Type.var "valueCombined") + , Type.namedWith + [ "BackendTask" ] + "BackendTask" + [ Type.var "error", Type.var "value1" ] + , Type.namedWith + [ "BackendTask" ] + "BackendTask" + [ Type.var "error", Type.var "value2" ] + , Type.namedWith + [ "BackendTask" ] + "BackendTask" + [ Type.var "error", Type.var "value3" ] + , Type.namedWith + [ "BackendTask" ] + "BackendTask" + [ Type.var "error", Type.var "value4" ] + , Type.namedWith + [ "BackendTask" ] + "BackendTask" + [ Type.var "error", Type.var "value5" ] + , Type.namedWith + [ "BackendTask" ] + "BackendTask" + [ Type.var "error", Type.var "value6" ] + ] + (Type.namedWith + [ "BackendTask" ] + "BackendTask" + [ Type.var "error", Type.var "valueCombined" ] + ) + ) + } + , map7 = + Elm.value + { importFrom = [ "BackendTask" ] + , name = "map7" + , annotation = + Just + (Type.function + [ Type.function + [ Type.var "value1" + , Type.var "value2" + , Type.var "value3" + , Type.var "value4" + , Type.var "value5" + , Type.var "value6" + , Type.var "value7" + ] + (Type.var "valueCombined") + , Type.namedWith + [ "BackendTask" ] + "BackendTask" + [ Type.var "error", Type.var "value1" ] + , Type.namedWith + [ "BackendTask" ] + "BackendTask" + [ Type.var "error", Type.var "value2" ] + , Type.namedWith + [ "BackendTask" ] + "BackendTask" + [ Type.var "error", Type.var "value3" ] + , Type.namedWith + [ "BackendTask" ] + "BackendTask" + [ Type.var "error", Type.var "value4" ] + , Type.namedWith + [ "BackendTask" ] + "BackendTask" + [ Type.var "error", Type.var "value5" ] + , Type.namedWith + [ "BackendTask" ] + "BackendTask" + [ Type.var "error", Type.var "value6" ] + , Type.namedWith + [ "BackendTask" ] + "BackendTask" + [ Type.var "error", Type.var "value7" ] + ] + (Type.namedWith + [ "BackendTask" ] + "BackendTask" + [ Type.var "error", Type.var "valueCombined" ] + ) + ) + } + , map8 = + Elm.value + { importFrom = [ "BackendTask" ] + , name = "map8" + , annotation = + Just + (Type.function + [ Type.function + [ Type.var "value1" + , Type.var "value2" + , Type.var "value3" + , Type.var "value4" + , Type.var "value5" + , Type.var "value6" + , Type.var "value7" + , Type.var "value8" + ] + (Type.var "valueCombined") + , Type.namedWith + [ "BackendTask" ] + "BackendTask" + [ Type.var "error", Type.var "value1" ] + , Type.namedWith + [ "BackendTask" ] + "BackendTask" + [ Type.var "error", Type.var "value2" ] + , Type.namedWith + [ "BackendTask" ] + "BackendTask" + [ Type.var "error", Type.var "value3" ] + , Type.namedWith + [ "BackendTask" ] + "BackendTask" + [ Type.var "error", Type.var "value4" ] + , Type.namedWith + [ "BackendTask" ] + "BackendTask" + [ Type.var "error", Type.var "value5" ] + , Type.namedWith + [ "BackendTask" ] + "BackendTask" + [ Type.var "error", Type.var "value6" ] + , Type.namedWith + [ "BackendTask" ] + "BackendTask" + [ Type.var "error", Type.var "value7" ] + , Type.namedWith + [ "BackendTask" ] + "BackendTask" + [ Type.var "error", Type.var "value8" ] + ] + (Type.namedWith + [ "BackendTask" ] + "BackendTask" + [ Type.var "error", Type.var "valueCombined" ] + ) + ) + } + , map9 = + Elm.value + { importFrom = [ "BackendTask" ] + , name = "map9" + , annotation = + Just + (Type.function + [ Type.function + [ Type.var "value1" + , Type.var "value2" + , Type.var "value3" + , Type.var "value4" + , Type.var "value5" + , Type.var "value6" + , Type.var "value7" + , Type.var "value8" + , Type.var "value9" + ] + (Type.var "valueCombined") + , Type.namedWith + [ "BackendTask" ] + "BackendTask" + [ Type.var "error", Type.var "value1" ] + , Type.namedWith + [ "BackendTask" ] + "BackendTask" + [ Type.var "error", Type.var "value2" ] + , Type.namedWith + [ "BackendTask" ] + "BackendTask" + [ Type.var "error", Type.var "value3" ] + , Type.namedWith + [ "BackendTask" ] + "BackendTask" + [ Type.var "error", Type.var "value4" ] + , Type.namedWith + [ "BackendTask" ] + "BackendTask" + [ Type.var "error", Type.var "value5" ] + , Type.namedWith + [ "BackendTask" ] + "BackendTask" + [ Type.var "error", Type.var "value6" ] + , Type.namedWith + [ "BackendTask" ] + "BackendTask" + [ Type.var "error", Type.var "value7" ] + , Type.namedWith + [ "BackendTask" ] + "BackendTask" + [ Type.var "error", Type.var "value8" ] + , Type.namedWith + [ "BackendTask" ] + "BackendTask" + [ Type.var "error", Type.var "value9" ] + ] + (Type.namedWith + [ "BackendTask" ] + "BackendTask" + [ Type.var "error", Type.var "valueCombined" ] + ) + ) + } + , allowFatal = + Elm.value + { importFrom = [ "BackendTask" ] + , name = "allowFatal" + , annotation = + Just + (Type.function + [ Type.namedWith + [ "BackendTask" ] + "BackendTask" + [ Type.extensible + "error" + [ ( "fatal" + , Type.namedWith + [ "FatalError" ] + "FatalError" + [] + ) + ] + , Type.var "data" + ] + ] + (Type.namedWith + [ "BackendTask" ] + "BackendTask" + [ Type.namedWith [ "FatalError" ] "FatalError" [] + , Type.var "data" + ] + ) + ) + } + , mapError = + Elm.value + { importFrom = [ "BackendTask" ] + , name = "mapError" + , annotation = + Just + (Type.function + [ Type.function + [ Type.var "error" ] + (Type.var "errorMapped") + , Type.namedWith + [ "BackendTask" ] + "BackendTask" + [ Type.var "error", Type.var "value" ] + ] + (Type.namedWith + [ "BackendTask" ] + "BackendTask" + [ Type.var "errorMapped", Type.var "value" ] + ) + ) + } + , onError = + Elm.value + { importFrom = [ "BackendTask" ] + , name = "onError" + , annotation = + Just + (Type.function + [ Type.function + [ Type.var "error" ] + (Type.namedWith + [ "BackendTask" ] + "BackendTask" + [ Type.var "mappedError", Type.var "value" ] + ) + , Type.namedWith + [ "BackendTask" ] + "BackendTask" + [ Type.var "error", Type.var "value" ] + ] + (Type.namedWith + [ "BackendTask" ] + "BackendTask" + [ Type.var "mappedError", Type.var "value" ] + ) + ) + } + , toResult = + Elm.value + { importFrom = [ "BackendTask" ] + , name = "toResult" + , annotation = + Just + (Type.function + [ Type.namedWith + [ "BackendTask" ] + "BackendTask" + [ Type.var "error", Type.var "data" ] + ] + (Type.namedWith + [ "BackendTask" ] + "BackendTask" + [ Type.var "noError" + , Type.namedWith + [ "Result" ] + "Result" + [ Type.var "error", Type.var "data" ] + ] + ) + ) + } + , do = + Elm.value + { importFrom = [ "BackendTask" ] + , name = "do" + , annotation = + Just + (Type.function + [ Type.namedWith + [ "BackendTask" ] + "BackendTask" + [ Type.var "error", Type.var "value" ] + ] + (Type.namedWith + [ "BackendTask" ] + "BackendTask" + [ Type.var "error", Type.unit ] + ) + ) + } + , doEach = + Elm.value + { importFrom = [ "BackendTask" ] + , name = "doEach" + , annotation = + Just + (Type.function + [ Type.list + (Type.namedWith + [ "BackendTask" ] + "BackendTask" + [ Type.var "error", Type.unit ] + ) + ] + (Type.namedWith + [ "BackendTask" ] + "BackendTask" + [ Type.var "error", Type.unit ] + ) + ) + } + , sequence = + Elm.value + { importFrom = [ "BackendTask" ] + , name = "sequence" + , annotation = + Just + (Type.function + [ Type.list + (Type.namedWith + [ "BackendTask" ] + "BackendTask" + [ Type.var "error", Type.var "value" ] + ) + ] + (Type.namedWith + [ "BackendTask" ] + "BackendTask" + [ Type.var "error", Type.list (Type.var "value") ] + ) + ) + } + , failIf = + Elm.value + { importFrom = [ "BackendTask" ] + , name = "failIf" + , annotation = + Just + (Type.function + [ Type.bool + , Type.namedWith [ "FatalError" ] "FatalError" [] + ] + (Type.namedWith + [ "BackendTask" ] + "BackendTask" + [ Type.namedWith [ "FatalError" ] "FatalError" [] + , Type.unit + ] + ) + ) + } + , inDir = + Elm.value + { importFrom = [ "BackendTask" ] + , name = "inDir" + , annotation = + Just + (Type.function + [ Type.string + , Type.namedWith + [ "BackendTask" ] + "BackendTask" + [ Type.var "error", Type.var "value" ] + ] + (Type.namedWith + [ "BackendTask" ] + "BackendTask" + [ Type.var "error", Type.var "value" ] + ) + ) + } + , quiet = + Elm.value + { importFrom = [ "BackendTask" ] + , name = "quiet" + , annotation = + Just + (Type.function + [ Type.namedWith + [ "BackendTask" ] + "BackendTask" + [ Type.var "error", Type.var "value" ] + ] + (Type.namedWith + [ "BackendTask" ] + "BackendTask" + [ Type.var "error", Type.var "value" ] + ) + ) + } + , withEnv = + Elm.value + { importFrom = [ "BackendTask" ] + , name = "withEnv" + , annotation = + Just + (Type.function + [ Type.string + , Type.string + , Type.namedWith + [ "BackendTask" ] + "BackendTask" + [ Type.var "error", Type.var "value" ] + ] + (Type.namedWith + [ "BackendTask" ] + "BackendTask" + [ Type.var "error", Type.var "value" ] + ) + ) + } + } \ No newline at end of file diff --git a/elm-open-api-codegen/src/Gen/BackendTask/Custom.elm b/elm-open-api-codegen/src/Gen/BackendTask/Custom.elm new file mode 100644 index 00000000..5df4db8f --- /dev/null +++ b/elm-open-api-codegen/src/Gen/BackendTask/Custom.elm @@ -0,0 +1,401 @@ +module Gen.BackendTask.Custom exposing + ( moduleName_, run, timeDecoder, dateDecoder, annotation_, make_ + , caseOf_, call_, values_ + ) + +{-| +# Generated bindings for BackendTask.Custom + +@docs moduleName_, run, timeDecoder, dateDecoder, annotation_, make_ +@docs caseOf_, call_, values_ +-} + + +import Elm +import Elm.Annotation as Type +import Elm.Arg +import Elm.Case + + +{-| The name of this module. -} +moduleName_ : List String +moduleName_ = + [ "BackendTask", "Custom" ] + + +{-| run: + String + -> Json.Encode.Value + -> Json.Decode.Decoder b + -> BackendTask.BackendTask { fatal : FatalError.FatalError + , recoverable : BackendTask.Custom.Error + } b +-} +run : String -> Elm.Expression -> Elm.Expression -> Elm.Expression +run runArg_ runArg_0 runArg_1 = + Elm.apply + (Elm.value + { importFrom = [ "BackendTask", "Custom" ] + , name = "run" + , annotation = + Just + (Type.function + [ Type.string + , Type.namedWith [ "Json", "Encode" ] "Value" [] + , Type.namedWith + [ "Json", "Decode" ] + "Decoder" + [ Type.var "b" ] + ] + (Type.namedWith + [ "BackendTask" ] + "BackendTask" + [ Type.record + [ ( "fatal" + , Type.namedWith + [ "FatalError" ] + "FatalError" + [] + ) + , ( "recoverable" + , Type.namedWith + [ "BackendTask", "Custom" ] + "Error" + [] + ) + ] + , Type.var "b" + ] + ) + ) + } + ) + [ Elm.string runArg_, runArg_0, runArg_1 ] + + +{-| timeDecoder: Json.Decode.Decoder Time.Posix -} +timeDecoder : Elm.Expression +timeDecoder = + Elm.value + { importFrom = [ "BackendTask", "Custom" ] + , name = "timeDecoder" + , annotation = + Just + (Type.namedWith + [ "Json", "Decode" ] + "Decoder" + [ Type.namedWith [ "Time" ] "Posix" [] ] + ) + } + + +{-| The same as `timeDecoder`, but it converts the decoded `Time.Posix` value into a `Date` with `Date.fromPosix Time.utc`. + +JavaScript `Date` objects don't distinguish between values with only a date vs. values with both a date and a time. So be sure +to use this decoder when you know the semantics represent a date with no associated time (or you're sure you don't care about the time). + +dateDecoder: Json.Decode.Decoder Date.Date +-} +dateDecoder : Elm.Expression +dateDecoder = + Elm.value + { importFrom = [ "BackendTask", "Custom" ] + , name = "dateDecoder" + , annotation = + Just + (Type.namedWith + [ "Json", "Decode" ] + "Decoder" + [ Type.namedWith [ "Date" ] "Date" [] ] + ) + } + + +annotation_ : { error : Type.Annotation } +annotation_ = + { error = Type.namedWith [ "BackendTask", "Custom" ] "Error" [] } + + +make_ : + { error : Elm.Expression + , errorInCustomBackendTaskFile : Elm.Expression + , missingCustomBackendTaskFile : Elm.Expression + , customBackendTaskNotDefined : Elm.Expression -> Elm.Expression + , customBackendTaskException : Elm.Expression -> Elm.Expression + , nonJsonException : Elm.Expression -> Elm.Expression + , exportIsNotFunction : Elm.Expression + , decodeError : Elm.Expression -> Elm.Expression + } +make_ = + { error = + Elm.value + { importFrom = [ "BackendTask", "Custom" ] + , name = "Error" + , annotation = Just (Type.namedWith [] "Error" []) + } + , errorInCustomBackendTaskFile = + Elm.value + { importFrom = [ "BackendTask", "Custom" ] + , name = "ErrorInCustomBackendTaskFile" + , annotation = Just (Type.namedWith [] "Error" []) + } + , missingCustomBackendTaskFile = + Elm.value + { importFrom = [ "BackendTask", "Custom" ] + , name = "MissingCustomBackendTaskFile" + , annotation = Just (Type.namedWith [] "Error" []) + } + , customBackendTaskNotDefined = + \ar0 -> + Elm.apply + (Elm.value + { importFrom = [ "BackendTask", "Custom" ] + , name = "CustomBackendTaskNotDefined" + , annotation = Just (Type.namedWith [] "Error" []) + } + ) + [ ar0 ] + , customBackendTaskException = + \ar0 -> + Elm.apply + (Elm.value + { importFrom = [ "BackendTask", "Custom" ] + , name = "CustomBackendTaskException" + , annotation = Just (Type.namedWith [] "Error" []) + } + ) + [ ar0 ] + , nonJsonException = + \ar0 -> + Elm.apply + (Elm.value + { importFrom = [ "BackendTask", "Custom" ] + , name = "NonJsonException" + , annotation = Just (Type.namedWith [] "Error" []) + } + ) + [ ar0 ] + , exportIsNotFunction = + Elm.value + { importFrom = [ "BackendTask", "Custom" ] + , name = "ExportIsNotFunction" + , annotation = Just (Type.namedWith [] "Error" []) + } + , decodeError = + \ar0 -> + Elm.apply + (Elm.value + { importFrom = [ "BackendTask", "Custom" ] + , name = "DecodeError" + , annotation = Just (Type.namedWith [] "Error" []) + } + ) + [ ar0 ] + } + + +caseOf_ = + { error = + \errorExpression errorTags -> + Elm.Case.custom + errorExpression + (Type.namedWith [ "BackendTask", "Custom" ] "Error" []) + [ Elm.Case.branch + (Elm.Arg.customType "Error" errorTags.error) + Basics.identity + , Elm.Case.branch + (Elm.Arg.customType + "ErrorInCustomBackendTaskFile" + errorTags.errorInCustomBackendTaskFile + ) + Basics.identity + , Elm.Case.branch + (Elm.Arg.customType + "MissingCustomBackendTaskFile" + errorTags.missingCustomBackendTaskFile + ) + Basics.identity + , Elm.Case.branch + (Elm.Arg.customType + "CustomBackendTaskNotDefined" + errorTags.customBackendTaskNotDefined |> Elm.Arg.item + (Elm.Arg.varWith + "arg_0" + (Type.record + [ ( "name" + , Type.string + ) + ] + ) + ) + ) + Basics.identity + , Elm.Case.branch + (Elm.Arg.customType + "CustomBackendTaskException" + errorTags.customBackendTaskException |> Elm.Arg.item + (Elm.Arg.varWith + "jsonDecodeValue" + (Type.namedWith + [ "Json" + , "Decode" + ] + "Value" + [] + ) + ) + ) + Basics.identity + , Elm.Case.branch + (Elm.Arg.customType + "NonJsonException" + errorTags.nonJsonException |> Elm.Arg.item + (Elm.Arg.varWith + "arg_0" + Type.string + ) + ) + Basics.identity + , Elm.Case.branch + (Elm.Arg.customType + "ExportIsNotFunction" + errorTags.exportIsNotFunction + ) + Basics.identity + , Elm.Case.branch + (Elm.Arg.customType + "DecodeError" + errorTags.decodeError |> Elm.Arg.item + (Elm.Arg.varWith + "jsonDecodeError" + (Type.namedWith + [ "Json" + , "Decode" + ] + "Error" + [] + ) + ) + ) + Basics.identity + ] + } + + +call_ : + { run : Elm.Expression -> Elm.Expression -> Elm.Expression -> Elm.Expression + } +call_ = + { run = + \runArg_ runArg_0 runArg_1 -> + Elm.apply + (Elm.value + { importFrom = [ "BackendTask", "Custom" ] + , name = "run" + , annotation = + Just + (Type.function + [ Type.string + , Type.namedWith + [ "Json", "Encode" ] + "Value" + [] + , Type.namedWith + [ "Json", "Decode" ] + "Decoder" + [ Type.var "b" ] + ] + (Type.namedWith + [ "BackendTask" ] + "BackendTask" + [ Type.record + [ ( "fatal" + , Type.namedWith + [ "FatalError" ] + "FatalError" + [] + ) + , ( "recoverable" + , Type.namedWith + [ "BackendTask", "Custom" ] + "Error" + [] + ) + ] + , Type.var "b" + ] + ) + ) + } + ) + [ runArg_, runArg_0, runArg_1 ] + } + + +values_ : + { run : Elm.Expression + , timeDecoder : Elm.Expression + , dateDecoder : Elm.Expression + } +values_ = + { run = + Elm.value + { importFrom = [ "BackendTask", "Custom" ] + , name = "run" + , annotation = + Just + (Type.function + [ Type.string + , Type.namedWith [ "Json", "Encode" ] "Value" [] + , Type.namedWith + [ "Json", "Decode" ] + "Decoder" + [ Type.var "b" ] + ] + (Type.namedWith + [ "BackendTask" ] + "BackendTask" + [ Type.record + [ ( "fatal" + , Type.namedWith + [ "FatalError" ] + "FatalError" + [] + ) + , ( "recoverable" + , Type.namedWith + [ "BackendTask", "Custom" ] + "Error" + [] + ) + ] + , Type.var "b" + ] + ) + ) + } + , timeDecoder = + Elm.value + { importFrom = [ "BackendTask", "Custom" ] + , name = "timeDecoder" + , annotation = + Just + (Type.namedWith + [ "Json", "Decode" ] + "Decoder" + [ Type.namedWith [ "Time" ] "Posix" [] ] + ) + } + , dateDecoder = + Elm.value + { importFrom = [ "BackendTask", "Custom" ] + , name = "dateDecoder" + , annotation = + Just + (Type.namedWith + [ "Json", "Decode" ] + "Decoder" + [ Type.namedWith [ "Date" ] "Date" [] ] + ) + } + } \ No newline at end of file diff --git a/elm-open-api-codegen/src/Gen/BackendTask/Do.elm b/elm-open-api-codegen/src/Gen/BackendTask/Do.elm new file mode 100644 index 00000000..8c7a6f0c --- /dev/null +++ b/elm-open-api-codegen/src/Gen/BackendTask/Do.elm @@ -0,0 +1,1198 @@ +module Gen.BackendTask.Do exposing + ( moduleName_, do, allowFatal, noop, exec, command + , glob, log, env, each, failIf, call_, values_ + ) + +{-| +# Generated bindings for BackendTask.Do + +@docs moduleName_, do, allowFatal, noop, exec, command +@docs glob, log, env, each, failIf, call_ +@docs values_ +-} + + +import Elm +import Elm.Annotation as Type + + +{-| The name of this module. -} +moduleName_ : List String +moduleName_ = + [ "BackendTask", "Do" ] + + +{-| Use any `BackendTask` into a continuation-style task. + + example : BackendTask FatalError () + example = + do + (Script.question "What is your name? ") + <| + \name -> + \() -> + Script.log ("Hello " ++ name ++ "!") + +do: + BackendTask.BackendTask error a + -> (a -> BackendTask.BackendTask error b) + -> BackendTask.BackendTask error b +-} +do : Elm.Expression -> (Elm.Expression -> Elm.Expression) -> Elm.Expression +do doArg_ doArg_0 = + Elm.apply + (Elm.value + { importFrom = [ "BackendTask", "Do" ] + , name = "do" + , annotation = + Just + (Type.function + [ Type.namedWith + [ "BackendTask" ] + "BackendTask" + [ Type.var "error", Type.var "a" ] + , Type.function + [ Type.var "a" ] + (Type.namedWith + [ "BackendTask" ] + "BackendTask" + [ Type.var "error", Type.var "b" ] + ) + ] + (Type.namedWith + [ "BackendTask" ] + "BackendTask" + [ Type.var "error", Type.var "b" ] + ) + ) + } + ) + [ doArg_, Elm.functionReduced "doUnpack" doArg_0 ] + + +{-| Same as [`do`](#do), but with a shorthand to call `BackendTask.allowFatal` on it. + + import BackendTask exposing (BackendTask) + import FatalError exposing (FatalError) + import BackendTask.File as BackendTask.File + import BackendTask.Do exposing (allowFatal, do) + + example : BackendTask FatalError () + example = + do (BackendTask.File.rawFile "post-1.md" |> BackendTask.allowFatal) <| + \post1 -> + allowFatal (BackendTask.File.rawFile "post-2.md") <| + \post2 -> + Script.log (post1 ++ "\n\n" ++ post2) + +allowFatal: + BackendTask.BackendTask { error | fatal : FatalError.FatalError } data + -> (data -> BackendTask.BackendTask FatalError.FatalError b) + -> BackendTask.BackendTask FatalError.FatalError b +-} +allowFatal : + Elm.Expression -> (Elm.Expression -> Elm.Expression) -> Elm.Expression +allowFatal allowFatalArg_ allowFatalArg_0 = + Elm.apply + (Elm.value + { importFrom = [ "BackendTask", "Do" ] + , name = "allowFatal" + , annotation = + Just + (Type.function + [ Type.namedWith + [ "BackendTask" ] + "BackendTask" + [ Type.extensible + "error" + [ ( "fatal" + , Type.namedWith + [ "FatalError" ] + "FatalError" + [] + ) + ] + , Type.var "data" + ] + , Type.function + [ Type.var "data" ] + (Type.namedWith + [ "BackendTask" ] + "BackendTask" + [ Type.namedWith + [ "FatalError" ] + "FatalError" + [] + , Type.var "b" + ] + ) + ] + (Type.namedWith + [ "BackendTask" ] + "BackendTask" + [ Type.namedWith [ "FatalError" ] "FatalError" [] + , Type.var "b" + ] + ) + ) + } + ) + [ allowFatalArg_ + , Elm.functionReduced "allowFatalUnpack" allowFatalArg_0 + ] + + +{-| A `BackendTask` that does nothing. Defined as `BackendTask.succeed ()`. + +It's a useful shorthand for when you want to end a continuation chain. + + example : BackendTask FatalError () + example = + exec "ls" [ "-l" ] <| + \() -> + log "Hello, world!" <| + \() -> + noop + +noop: BackendTask.BackendTask error () +-} +noop : Elm.Expression +noop = + Elm.value + { importFrom = [ "BackendTask", "Do" ] + , name = "noop" + , annotation = + Just + (Type.namedWith + [ "BackendTask" ] + "BackendTask" + [ Type.var "error", Type.unit ] + ) + } + + +{-| A do-style helper for [`Script.exec`](Pages-Script#exec). + +exec: + String + -> List String + -> (() -> BackendTask.BackendTask FatalError.FatalError b) + -> BackendTask.BackendTask FatalError.FatalError b +-} +exec : + String + -> List String + -> (Elm.Expression -> Elm.Expression) + -> Elm.Expression +exec execArg_ execArg_0 execArg_1 = + Elm.apply + (Elm.value + { importFrom = [ "BackendTask", "Do" ] + , name = "exec" + , annotation = + Just + (Type.function + [ Type.string + , Type.list Type.string + , Type.function + [ Type.unit ] + (Type.namedWith + [ "BackendTask" ] + "BackendTask" + [ Type.namedWith + [ "FatalError" ] + "FatalError" + [] + , Type.var "b" + ] + ) + ] + (Type.namedWith + [ "BackendTask" ] + "BackendTask" + [ Type.namedWith [ "FatalError" ] "FatalError" [] + , Type.var "b" + ] + ) + ) + } + ) + [ Elm.string execArg_ + , Elm.list (List.map Elm.string execArg_0) + , Elm.functionReduced "execUnpack" execArg_1 + ] + + +{-| A do-style helper for [`Script.command`](Pages-Script#command). + +command: + String + -> List String + -> (String -> BackendTask.BackendTask FatalError.FatalError b) + -> BackendTask.BackendTask FatalError.FatalError b +-} +command : + String + -> List String + -> (Elm.Expression -> Elm.Expression) + -> Elm.Expression +command commandArg_ commandArg_0 commandArg_1 = + Elm.apply + (Elm.value + { importFrom = [ "BackendTask", "Do" ] + , name = "command" + , annotation = + Just + (Type.function + [ Type.string + , Type.list Type.string + , Type.function + [ Type.string ] + (Type.namedWith + [ "BackendTask" ] + "BackendTask" + [ Type.namedWith + [ "FatalError" ] + "FatalError" + [] + , Type.var "b" + ] + ) + ] + (Type.namedWith + [ "BackendTask" ] + "BackendTask" + [ Type.namedWith [ "FatalError" ] "FatalError" [] + , Type.var "b" + ] + ) + ) + } + ) + [ Elm.string commandArg_ + , Elm.list (List.map Elm.string commandArg_0) + , Elm.functionReduced "commandUnpack" commandArg_1 + ] + + +{-| A continuation-style helper for [`Glob.fromString`](BackendTask-Glob#fromString). + +In a shell script, you can think of this as a stand-in for globbing files directly within a command. The [`BackendTask.Stream.command`](BackendTask-Stream#command) +which lets you run shell commands sanitizes and escapes all arguments passed, and does not do glob expansion, so this is helpful for translating +a shell script to Elm. + +This example passes a list of matching file paths along to an `rm -f` command. + + example : BackendTask FatalError () + example = + glob "src/**/*.elm" <| + \elmFiles -> + log ("Going to delete " ++ String.fromInt (List.length elmFiles) ++ " Elm files") <| + \() -> + exec "rm" ("-f" :: elmFiles) <| + \() -> + noop + +glob: + String + -> (List String -> BackendTask.BackendTask FatalError.FatalError a) + -> BackendTask.BackendTask FatalError.FatalError a +-} +glob : String -> (Elm.Expression -> Elm.Expression) -> Elm.Expression +glob globArg_ globArg_0 = + Elm.apply + (Elm.value + { importFrom = [ "BackendTask", "Do" ] + , name = "glob" + , annotation = + Just + (Type.function + [ Type.string + , Type.function + [ Type.list Type.string ] + (Type.namedWith + [ "BackendTask" ] + "BackendTask" + [ Type.namedWith + [ "FatalError" ] + "FatalError" + [] + , Type.var "a" + ] + ) + ] + (Type.namedWith + [ "BackendTask" ] + "BackendTask" + [ Type.namedWith [ "FatalError" ] "FatalError" [] + , Type.var "a" + ] + ) + ) + } + ) + [ Elm.string globArg_, Elm.functionReduced "globUnpack" globArg_0 ] + + +{-| A do-style helper for [`Script.log`](Pages-Script#log). + + example : BackendTask FatalError () + example = + log "Starting script..." <| + \() -> + -- ... + log "Done!" <| + \() -> + noop + +log: + String + -> (() -> BackendTask.BackendTask error b) + -> BackendTask.BackendTask error b +-} +log : String -> (Elm.Expression -> Elm.Expression) -> Elm.Expression +log logArg_ logArg_0 = + Elm.apply + (Elm.value + { importFrom = [ "BackendTask", "Do" ] + , name = "log" + , annotation = + Just + (Type.function + [ Type.string + , Type.function + [ Type.unit ] + (Type.namedWith + [ "BackendTask" ] + "BackendTask" + [ Type.var "error", Type.var "b" ] + ) + ] + (Type.namedWith + [ "BackendTask" ] + "BackendTask" + [ Type.var "error", Type.var "b" ] + ) + ) + } + ) + [ Elm.string logArg_, Elm.functionReduced "logUnpack" logArg_0 ] + + +{-| A do-style helper for [`Env.expect`](BackendTask-Env#expect). + + example : BackendTask FatalError () + example = + env "API_KEY" <| + \apiKey -> + allowFatal (apiRequest apiKey) <| + \() -> + noop + +env: + String + -> (String -> BackendTask.BackendTask FatalError.FatalError b) + -> BackendTask.BackendTask FatalError.FatalError b +-} +env : String -> (Elm.Expression -> Elm.Expression) -> Elm.Expression +env envArg_ envArg_0 = + Elm.apply + (Elm.value + { importFrom = [ "BackendTask", "Do" ] + , name = "env" + , annotation = + Just + (Type.function + [ Type.string + , Type.function + [ Type.string ] + (Type.namedWith + [ "BackendTask" ] + "BackendTask" + [ Type.namedWith + [ "FatalError" ] + "FatalError" + [] + , Type.var "b" + ] + ) + ] + (Type.namedWith + [ "BackendTask" ] + "BackendTask" + [ Type.namedWith [ "FatalError" ] "FatalError" [] + , Type.var "b" + ] + ) + ) + } + ) + [ Elm.string envArg_, Elm.functionReduced "envUnpack" envArg_0 ] + + +{-| checkCompilationInDir : String -> BackendTask FatalError () + checkCompilationInDir dir = + glob (dir ++ "/**/*.elm") <| + \elmFiles -> + each elmFiles + (\elmFile -> + Shell.sh "elm" [ "make", elmFile, "--output", "/dev/null" ] + |> BackendTask.quiet + ) + <| + \_ -> + noop + +each: + List a + -> (a -> BackendTask.BackendTask error b) + -> (List b -> BackendTask.BackendTask error c) + -> BackendTask.BackendTask error c +-} +each : + List Elm.Expression + -> (Elm.Expression -> Elm.Expression) + -> (Elm.Expression -> Elm.Expression) + -> Elm.Expression +each eachArg_ eachArg_0 eachArg_1 = + Elm.apply + (Elm.value + { importFrom = [ "BackendTask", "Do" ] + , name = "each" + , annotation = + Just + (Type.function + [ Type.list (Type.var "a") + , Type.function + [ Type.var "a" ] + (Type.namedWith + [ "BackendTask" ] + "BackendTask" + [ Type.var "error", Type.var "b" ] + ) + , Type.function + [ Type.list (Type.var "b") ] + (Type.namedWith + [ "BackendTask" ] + "BackendTask" + [ Type.var "error", Type.var "c" ] + ) + ] + (Type.namedWith + [ "BackendTask" ] + "BackendTask" + [ Type.var "error", Type.var "c" ] + ) + ) + } + ) + [ Elm.list eachArg_ + , Elm.functionReduced "eachUnpack" eachArg_0 + , Elm.functionReduced "eachUnpack" eachArg_1 + ] + + +{-| A do-style helper for [`BackendTask.failIf`](BackendTask#failIf). + +failIf: + Bool + -> FatalError.FatalError + -> (() -> BackendTask.BackendTask FatalError.FatalError b) + -> BackendTask.BackendTask FatalError.FatalError b +-} +failIf : + Bool + -> Elm.Expression + -> (Elm.Expression -> Elm.Expression) + -> Elm.Expression +failIf failIfArg_ failIfArg_0 failIfArg_1 = + Elm.apply + (Elm.value + { importFrom = [ "BackendTask", "Do" ] + , name = "failIf" + , annotation = + Just + (Type.function + [ Type.bool + , Type.namedWith [ "FatalError" ] "FatalError" [] + , Type.function + [ Type.unit ] + (Type.namedWith + [ "BackendTask" ] + "BackendTask" + [ Type.namedWith + [ "FatalError" ] + "FatalError" + [] + , Type.var "b" + ] + ) + ] + (Type.namedWith + [ "BackendTask" ] + "BackendTask" + [ Type.namedWith [ "FatalError" ] "FatalError" [] + , Type.var "b" + ] + ) + ) + } + ) + [ Elm.bool failIfArg_ + , failIfArg_0 + , Elm.functionReduced "failIfUnpack" failIfArg_1 + ] + + +call_ : + { do : Elm.Expression -> Elm.Expression -> Elm.Expression + , allowFatal : Elm.Expression -> Elm.Expression -> Elm.Expression + , exec : + Elm.Expression -> Elm.Expression -> Elm.Expression -> Elm.Expression + , command : + Elm.Expression -> Elm.Expression -> Elm.Expression -> Elm.Expression + , glob : Elm.Expression -> Elm.Expression -> Elm.Expression + , log : Elm.Expression -> Elm.Expression -> Elm.Expression + , env : Elm.Expression -> Elm.Expression -> Elm.Expression + , each : + Elm.Expression -> Elm.Expression -> Elm.Expression -> Elm.Expression + , failIf : + Elm.Expression -> Elm.Expression -> Elm.Expression -> Elm.Expression + } +call_ = + { do = + \doArg_ doArg_0 -> + Elm.apply + (Elm.value + { importFrom = [ "BackendTask", "Do" ] + , name = "do" + , annotation = + Just + (Type.function + [ Type.namedWith + [ "BackendTask" ] + "BackendTask" + [ Type.var "error", Type.var "a" ] + , Type.function + [ Type.var "a" ] + (Type.namedWith + [ "BackendTask" ] + "BackendTask" + [ Type.var "error", Type.var "b" ] + ) + ] + (Type.namedWith + [ "BackendTask" ] + "BackendTask" + [ Type.var "error", Type.var "b" ] + ) + ) + } + ) + [ doArg_, doArg_0 ] + , allowFatal = + \allowFatalArg_ allowFatalArg_0 -> + Elm.apply + (Elm.value + { importFrom = [ "BackendTask", "Do" ] + , name = "allowFatal" + , annotation = + Just + (Type.function + [ Type.namedWith + [ "BackendTask" ] + "BackendTask" + [ Type.extensible + "error" + [ ( "fatal" + , Type.namedWith + [ "FatalError" ] + "FatalError" + [] + ) + ] + , Type.var "data" + ] + , Type.function + [ Type.var "data" ] + (Type.namedWith + [ "BackendTask" ] + "BackendTask" + [ Type.namedWith + [ "FatalError" ] + "FatalError" + [] + , Type.var "b" + ] + ) + ] + (Type.namedWith + [ "BackendTask" ] + "BackendTask" + [ Type.namedWith + [ "FatalError" ] + "FatalError" + [] + , Type.var "b" + ] + ) + ) + } + ) + [ allowFatalArg_, allowFatalArg_0 ] + , exec = + \execArg_ execArg_0 execArg_1 -> + Elm.apply + (Elm.value + { importFrom = [ "BackendTask", "Do" ] + , name = "exec" + , annotation = + Just + (Type.function + [ Type.string + , Type.list Type.string + , Type.function + [ Type.unit ] + (Type.namedWith + [ "BackendTask" ] + "BackendTask" + [ Type.namedWith + [ "FatalError" ] + "FatalError" + [] + , Type.var "b" + ] + ) + ] + (Type.namedWith + [ "BackendTask" ] + "BackendTask" + [ Type.namedWith + [ "FatalError" ] + "FatalError" + [] + , Type.var "b" + ] + ) + ) + } + ) + [ execArg_, execArg_0, execArg_1 ] + , command = + \commandArg_ commandArg_0 commandArg_1 -> + Elm.apply + (Elm.value + { importFrom = [ "BackendTask", "Do" ] + , name = "command" + , annotation = + Just + (Type.function + [ Type.string + , Type.list Type.string + , Type.function + [ Type.string ] + (Type.namedWith + [ "BackendTask" ] + "BackendTask" + [ Type.namedWith + [ "FatalError" ] + "FatalError" + [] + , Type.var "b" + ] + ) + ] + (Type.namedWith + [ "BackendTask" ] + "BackendTask" + [ Type.namedWith + [ "FatalError" ] + "FatalError" + [] + , Type.var "b" + ] + ) + ) + } + ) + [ commandArg_, commandArg_0, commandArg_1 ] + , glob = + \globArg_ globArg_0 -> + Elm.apply + (Elm.value + { importFrom = [ "BackendTask", "Do" ] + , name = "glob" + , annotation = + Just + (Type.function + [ Type.string + , Type.function + [ Type.list Type.string ] + (Type.namedWith + [ "BackendTask" ] + "BackendTask" + [ Type.namedWith + [ "FatalError" ] + "FatalError" + [] + , Type.var "a" + ] + ) + ] + (Type.namedWith + [ "BackendTask" ] + "BackendTask" + [ Type.namedWith + [ "FatalError" ] + "FatalError" + [] + , Type.var "a" + ] + ) + ) + } + ) + [ globArg_, globArg_0 ] + , log = + \logArg_ logArg_0 -> + Elm.apply + (Elm.value + { importFrom = [ "BackendTask", "Do" ] + , name = "log" + , annotation = + Just + (Type.function + [ Type.string + , Type.function + [ Type.unit ] + (Type.namedWith + [ "BackendTask" ] + "BackendTask" + [ Type.var "error", Type.var "b" ] + ) + ] + (Type.namedWith + [ "BackendTask" ] + "BackendTask" + [ Type.var "error", Type.var "b" ] + ) + ) + } + ) + [ logArg_, logArg_0 ] + , env = + \envArg_ envArg_0 -> + Elm.apply + (Elm.value + { importFrom = [ "BackendTask", "Do" ] + , name = "env" + , annotation = + Just + (Type.function + [ Type.string + , Type.function + [ Type.string ] + (Type.namedWith + [ "BackendTask" ] + "BackendTask" + [ Type.namedWith + [ "FatalError" ] + "FatalError" + [] + , Type.var "b" + ] + ) + ] + (Type.namedWith + [ "BackendTask" ] + "BackendTask" + [ Type.namedWith + [ "FatalError" ] + "FatalError" + [] + , Type.var "b" + ] + ) + ) + } + ) + [ envArg_, envArg_0 ] + , each = + \eachArg_ eachArg_0 eachArg_1 -> + Elm.apply + (Elm.value + { importFrom = [ "BackendTask", "Do" ] + , name = "each" + , annotation = + Just + (Type.function + [ Type.list (Type.var "a") + , Type.function + [ Type.var "a" ] + (Type.namedWith + [ "BackendTask" ] + "BackendTask" + [ Type.var "error", Type.var "b" ] + ) + , Type.function + [ Type.list (Type.var "b") ] + (Type.namedWith + [ "BackendTask" ] + "BackendTask" + [ Type.var "error", Type.var "c" ] + ) + ] + (Type.namedWith + [ "BackendTask" ] + "BackendTask" + [ Type.var "error", Type.var "c" ] + ) + ) + } + ) + [ eachArg_, eachArg_0, eachArg_1 ] + , failIf = + \failIfArg_ failIfArg_0 failIfArg_1 -> + Elm.apply + (Elm.value + { importFrom = [ "BackendTask", "Do" ] + , name = "failIf" + , annotation = + Just + (Type.function + [ Type.bool + , Type.namedWith + [ "FatalError" ] + "FatalError" + [] + , Type.function + [ Type.unit ] + (Type.namedWith + [ "BackendTask" ] + "BackendTask" + [ Type.namedWith + [ "FatalError" ] + "FatalError" + [] + , Type.var "b" + ] + ) + ] + (Type.namedWith + [ "BackendTask" ] + "BackendTask" + [ Type.namedWith + [ "FatalError" ] + "FatalError" + [] + , Type.var "b" + ] + ) + ) + } + ) + [ failIfArg_, failIfArg_0, failIfArg_1 ] + } + + +values_ : + { do : Elm.Expression + , allowFatal : Elm.Expression + , noop : Elm.Expression + , exec : Elm.Expression + , command : Elm.Expression + , glob : Elm.Expression + , log : Elm.Expression + , env : Elm.Expression + , each : Elm.Expression + , failIf : Elm.Expression + } +values_ = + { do = + Elm.value + { importFrom = [ "BackendTask", "Do" ] + , name = "do" + , annotation = + Just + (Type.function + [ Type.namedWith + [ "BackendTask" ] + "BackendTask" + [ Type.var "error", Type.var "a" ] + , Type.function + [ Type.var "a" ] + (Type.namedWith + [ "BackendTask" ] + "BackendTask" + [ Type.var "error", Type.var "b" ] + ) + ] + (Type.namedWith + [ "BackendTask" ] + "BackendTask" + [ Type.var "error", Type.var "b" ] + ) + ) + } + , allowFatal = + Elm.value + { importFrom = [ "BackendTask", "Do" ] + , name = "allowFatal" + , annotation = + Just + (Type.function + [ Type.namedWith + [ "BackendTask" ] + "BackendTask" + [ Type.extensible + "error" + [ ( "fatal" + , Type.namedWith + [ "FatalError" ] + "FatalError" + [] + ) + ] + , Type.var "data" + ] + , Type.function + [ Type.var "data" ] + (Type.namedWith + [ "BackendTask" ] + "BackendTask" + [ Type.namedWith + [ "FatalError" ] + "FatalError" + [] + , Type.var "b" + ] + ) + ] + (Type.namedWith + [ "BackendTask" ] + "BackendTask" + [ Type.namedWith [ "FatalError" ] "FatalError" [] + , Type.var "b" + ] + ) + ) + } + , noop = + Elm.value + { importFrom = [ "BackendTask", "Do" ] + , name = "noop" + , annotation = + Just + (Type.namedWith + [ "BackendTask" ] + "BackendTask" + [ Type.var "error", Type.unit ] + ) + } + , exec = + Elm.value + { importFrom = [ "BackendTask", "Do" ] + , name = "exec" + , annotation = + Just + (Type.function + [ Type.string + , Type.list Type.string + , Type.function + [ Type.unit ] + (Type.namedWith + [ "BackendTask" ] + "BackendTask" + [ Type.namedWith + [ "FatalError" ] + "FatalError" + [] + , Type.var "b" + ] + ) + ] + (Type.namedWith + [ "BackendTask" ] + "BackendTask" + [ Type.namedWith [ "FatalError" ] "FatalError" [] + , Type.var "b" + ] + ) + ) + } + , command = + Elm.value + { importFrom = [ "BackendTask", "Do" ] + , name = "command" + , annotation = + Just + (Type.function + [ Type.string + , Type.list Type.string + , Type.function + [ Type.string ] + (Type.namedWith + [ "BackendTask" ] + "BackendTask" + [ Type.namedWith + [ "FatalError" ] + "FatalError" + [] + , Type.var "b" + ] + ) + ] + (Type.namedWith + [ "BackendTask" ] + "BackendTask" + [ Type.namedWith [ "FatalError" ] "FatalError" [] + , Type.var "b" + ] + ) + ) + } + , glob = + Elm.value + { importFrom = [ "BackendTask", "Do" ] + , name = "glob" + , annotation = + Just + (Type.function + [ Type.string + , Type.function + [ Type.list Type.string ] + (Type.namedWith + [ "BackendTask" ] + "BackendTask" + [ Type.namedWith + [ "FatalError" ] + "FatalError" + [] + , Type.var "a" + ] + ) + ] + (Type.namedWith + [ "BackendTask" ] + "BackendTask" + [ Type.namedWith [ "FatalError" ] "FatalError" [] + , Type.var "a" + ] + ) + ) + } + , log = + Elm.value + { importFrom = [ "BackendTask", "Do" ] + , name = "log" + , annotation = + Just + (Type.function + [ Type.string + , Type.function + [ Type.unit ] + (Type.namedWith + [ "BackendTask" ] + "BackendTask" + [ Type.var "error", Type.var "b" ] + ) + ] + (Type.namedWith + [ "BackendTask" ] + "BackendTask" + [ Type.var "error", Type.var "b" ] + ) + ) + } + , env = + Elm.value + { importFrom = [ "BackendTask", "Do" ] + , name = "env" + , annotation = + Just + (Type.function + [ Type.string + , Type.function + [ Type.string ] + (Type.namedWith + [ "BackendTask" ] + "BackendTask" + [ Type.namedWith + [ "FatalError" ] + "FatalError" + [] + , Type.var "b" + ] + ) + ] + (Type.namedWith + [ "BackendTask" ] + "BackendTask" + [ Type.namedWith [ "FatalError" ] "FatalError" [] + , Type.var "b" + ] + ) + ) + } + , each = + Elm.value + { importFrom = [ "BackendTask", "Do" ] + , name = "each" + , annotation = + Just + (Type.function + [ Type.list (Type.var "a") + , Type.function + [ Type.var "a" ] + (Type.namedWith + [ "BackendTask" ] + "BackendTask" + [ Type.var "error", Type.var "b" ] + ) + , Type.function + [ Type.list (Type.var "b") ] + (Type.namedWith + [ "BackendTask" ] + "BackendTask" + [ Type.var "error", Type.var "c" ] + ) + ] + (Type.namedWith + [ "BackendTask" ] + "BackendTask" + [ Type.var "error", Type.var "c" ] + ) + ) + } + , failIf = + Elm.value + { importFrom = [ "BackendTask", "Do" ] + , name = "failIf" + , annotation = + Just + (Type.function + [ Type.bool + , Type.namedWith [ "FatalError" ] "FatalError" [] + , Type.function + [ Type.unit ] + (Type.namedWith + [ "BackendTask" ] + "BackendTask" + [ Type.namedWith + [ "FatalError" ] + "FatalError" + [] + , Type.var "b" + ] + ) + ] + (Type.namedWith + [ "BackendTask" ] + "BackendTask" + [ Type.namedWith [ "FatalError" ] "FatalError" [] + , Type.var "b" + ] + ) + ) + } + } \ No newline at end of file diff --git a/elm-open-api-codegen/src/Gen/BackendTask/Env.elm b/elm-open-api-codegen/src/Gen/BackendTask/Env.elm new file mode 100644 index 00000000..1ada4874 --- /dev/null +++ b/elm-open-api-codegen/src/Gen/BackendTask/Env.elm @@ -0,0 +1,252 @@ +module Gen.BackendTask.Env exposing + ( moduleName_, get, expect, annotation_, make_, caseOf_ + , call_, values_ + ) + +{-| +# Generated bindings for BackendTask.Env + +@docs moduleName_, get, expect, annotation_, make_, caseOf_ +@docs call_, values_ +-} + + +import Elm +import Elm.Annotation as Type +import Elm.Arg +import Elm.Case + + +{-| The name of this module. -} +moduleName_ : List String +moduleName_ = + [ "BackendTask", "Env" ] + + +{-| Get an environment variable, or Nothing if there is no environment variable matching that name. This `BackendTask` +will never fail, but instead will return `Nothing` if the environment variable is missing. + +get: String -> BackendTask.BackendTask error (Maybe String) +-} +get : String -> Elm.Expression +get getArg_ = + Elm.apply + (Elm.value + { importFrom = [ "BackendTask", "Env" ] + , name = "get" + , annotation = + Just + (Type.function + [ Type.string ] + (Type.namedWith + [ "BackendTask" ] + "BackendTask" + [ Type.var "error", Type.maybe Type.string ] + ) + ) + } + ) + [ Elm.string getArg_ ] + + +{-| Get an environment variable, or a BackendTask FatalError if there is no environment variable matching that name. + +expect: + String + -> BackendTask.BackendTask { fatal : FatalError.FatalError + , recoverable : BackendTask.Env.Error + } String +-} +expect : String -> Elm.Expression +expect expectArg_ = + Elm.apply + (Elm.value + { importFrom = [ "BackendTask", "Env" ] + , name = "expect" + , annotation = + Just + (Type.function + [ Type.string ] + (Type.namedWith + [ "BackendTask" ] + "BackendTask" + [ Type.record + [ ( "fatal" + , Type.namedWith + [ "FatalError" ] + "FatalError" + [] + ) + , ( "recoverable" + , Type.namedWith + [ "BackendTask", "Env" ] + "Error" + [] + ) + ] + , Type.string + ] + ) + ) + } + ) + [ Elm.string expectArg_ ] + + +annotation_ : { error : Type.Annotation } +annotation_ = + { error = Type.namedWith [ "BackendTask", "Env" ] "Error" [] } + + +make_ : { missingEnvVariable : Elm.Expression -> Elm.Expression } +make_ = + { missingEnvVariable = + \ar0 -> + Elm.apply + (Elm.value + { importFrom = [ "BackendTask", "Env" ] + , name = "MissingEnvVariable" + , annotation = Just (Type.namedWith [] "Error" []) + } + ) + [ ar0 ] + } + + +caseOf_ : + { error : + Elm.Expression + -> { missingEnvVariable : Elm.Expression -> Elm.Expression } + -> Elm.Expression + } +caseOf_ = + { error = + \errorExpression errorTags -> + Elm.Case.custom + errorExpression + (Type.namedWith [ "BackendTask", "Env" ] "Error" []) + [ Elm.Case.branch + (Elm.Arg.customType + "MissingEnvVariable" + errorTags.missingEnvVariable |> Elm.Arg.item + (Elm.Arg.varWith + "arg_0" + Type.string + ) + ) + Basics.identity + ] + } + + +call_ : + { get : Elm.Expression -> Elm.Expression + , expect : Elm.Expression -> Elm.Expression + } +call_ = + { get = + \getArg_ -> + Elm.apply + (Elm.value + { importFrom = [ "BackendTask", "Env" ] + , name = "get" + , annotation = + Just + (Type.function + [ Type.string ] + (Type.namedWith + [ "BackendTask" ] + "BackendTask" + [ Type.var "error" + , Type.maybe Type.string + ] + ) + ) + } + ) + [ getArg_ ] + , expect = + \expectArg_ -> + Elm.apply + (Elm.value + { importFrom = [ "BackendTask", "Env" ] + , name = "expect" + , annotation = + Just + (Type.function + [ Type.string ] + (Type.namedWith + [ "BackendTask" ] + "BackendTask" + [ Type.record + [ ( "fatal" + , Type.namedWith + [ "FatalError" ] + "FatalError" + [] + ) + , ( "recoverable" + , Type.namedWith + [ "BackendTask", "Env" ] + "Error" + [] + ) + ] + , Type.string + ] + ) + ) + } + ) + [ expectArg_ ] + } + + +values_ : { get : Elm.Expression, expect : Elm.Expression } +values_ = + { get = + Elm.value + { importFrom = [ "BackendTask", "Env" ] + , name = "get" + , annotation = + Just + (Type.function + [ Type.string ] + (Type.namedWith + [ "BackendTask" ] + "BackendTask" + [ Type.var "error", Type.maybe Type.string ] + ) + ) + } + , expect = + Elm.value + { importFrom = [ "BackendTask", "Env" ] + , name = "expect" + , annotation = + Just + (Type.function + [ Type.string ] + (Type.namedWith + [ "BackendTask" ] + "BackendTask" + [ Type.record + [ ( "fatal" + , Type.namedWith + [ "FatalError" ] + "FatalError" + [] + ) + , ( "recoverable" + , Type.namedWith + [ "BackendTask", "Env" ] + "Error" + [] + ) + ] + , Type.string + ] + ) + ) + } + } \ No newline at end of file diff --git a/elm-open-api-codegen/src/Gen/BackendTask/File.elm b/elm-open-api-codegen/src/Gen/BackendTask/File.elm new file mode 100644 index 00000000..7d35b195 --- /dev/null +++ b/elm-open-api-codegen/src/Gen/BackendTask/File.elm @@ -0,0 +1,981 @@ +module Gen.BackendTask.File exposing + ( moduleName_, bodyWithFrontmatter, bodyWithoutFrontmatter, onlyFrontmatter, jsonFile, rawFile + , annotation_, make_, caseOf_, call_, values_ + ) + +{-| +# Generated bindings for BackendTask.File + +@docs moduleName_, bodyWithFrontmatter, bodyWithoutFrontmatter, onlyFrontmatter, jsonFile, rawFile +@docs annotation_, make_, caseOf_, call_, values_ +-} + + +import Elm +import Elm.Annotation as Type +import Elm.Arg +import Elm.Case + + +{-| The name of this module. -} +moduleName_ : List String +moduleName_ = + [ "BackendTask", "File" ] + + +{-| import BackendTask exposing (BackendTask) + import BackendTask.File as File + import FatalError exposing (FatalError) + import Json.Decode as Decode exposing (Decoder) + + blogPost : BackendTask FatalError BlogPostMetadata + blogPost = + File.bodyWithFrontmatter blogPostDecoder + "blog/hello-world.md" + |> BackendTask.allowFatal + + type alias BlogPostMetadata = + { body : String + , title : String + , tags : List String + } + + blogPostDecoder : String -> Decoder BlogPostMetadata + blogPostDecoder body = + Decode.map2 (BlogPostMetadata body) + (Decode.field "title" Decode.string) + (Decode.field "tags" tagsDecoder) + + tagsDecoder : Decoder (List String) + tagsDecoder = + Decode.map (String.split " ") + Decode.string + +This will give us a BackendTask that results in the following value: + + value = + { body = "Hey there! This is my first post :)" + , title = "Hello, World!" + , tags = [ "elm" ] + } + +It's common to parse the body with a markdown parser or other format. + + import BackendTask exposing (BackendTask) + import BackendTask.File as File + import FatalError exposing (FatalError) + import Html exposing (Html) + import Json.Decode as Decode + + example : + BackendTask + FatalError + { title : String + , body : List (Html msg) + } + example = + File.bodyWithFrontmatter + (\markdownString -> + Decode.map2 + (\title renderedMarkdown -> + { title = title + , body = renderedMarkdown + } + ) + (Decode.field "title" Decode.string) + (markdownString + |> markdownToView + |> Decode.fromResult + ) + ) + "foo.md" + |> BackendTask.allowFatal + + markdownToView : + String + -> Result String (List (Html msg)) + markdownToView markdownString = + markdownString + |> Markdown.Parser.parse + |> Result.mapError (\_ -> "Markdown error.") + |> Result.andThen + (\blocks -> + Markdown.Renderer.render + Markdown.Renderer.defaultHtmlRenderer + blocks + ) + +bodyWithFrontmatter: + (String -> Json.Decode.Decoder frontmatter) + -> String + -> BackendTask.BackendTask { fatal : FatalError.FatalError + , recoverable : BackendTask.File.FileReadError Json.Decode.Error + } frontmatter +-} +bodyWithFrontmatter : + (Elm.Expression -> Elm.Expression) -> String -> Elm.Expression +bodyWithFrontmatter bodyWithFrontmatterArg_ bodyWithFrontmatterArg_0 = + Elm.apply + (Elm.value + { importFrom = [ "BackendTask", "File" ] + , name = "bodyWithFrontmatter" + , annotation = + Just + (Type.function + [ Type.function + [ Type.string ] + (Type.namedWith + [ "Json", "Decode" ] + "Decoder" + [ Type.var "frontmatter" ] + ) + , Type.string + ] + (Type.namedWith + [ "BackendTask" ] + "BackendTask" + [ Type.record + [ ( "fatal" + , Type.namedWith + [ "FatalError" ] + "FatalError" + [] + ) + , ( "recoverable" + , Type.namedWith + [ "BackendTask", "File" ] + "FileReadError" + [ Type.namedWith + [ "Json", "Decode" ] + "Error" + [] + ] + ) + ] + , Type.var "frontmatter" + ] + ) + ) + } + ) + [ Elm.functionReduced + "bodyWithFrontmatterUnpack" + bodyWithFrontmatterArg_ + , Elm.string bodyWithFrontmatterArg_0 + ] + + +{-| Same as `bodyWithFrontmatter` except it doesn't include the frontmatter. + +For example, if you have a file called `blog/hello-world.md` with + +```markdown +--- +title: Hello, World! +tags: elm +--- +Hey there! This is my first post :) +``` + + import BackendTask exposing (BackendTask) + import BackendTask.File as File + import FatalError exposing (FatalError) + + data : BackendTask FatalError String + data = + File.bodyWithoutFrontmatter "blog/hello-world.md" + |> BackendTask.allowFatal + +Then data will yield the value `"Hey there! This is my first post :)"`. + +bodyWithoutFrontmatter: + String + -> BackendTask.BackendTask { fatal : FatalError.FatalError + , recoverable : BackendTask.File.FileReadError decoderError + } String +-} +bodyWithoutFrontmatter : String -> Elm.Expression +bodyWithoutFrontmatter bodyWithoutFrontmatterArg_ = + Elm.apply + (Elm.value + { importFrom = [ "BackendTask", "File" ] + , name = "bodyWithoutFrontmatter" + , annotation = + Just + (Type.function + [ Type.string ] + (Type.namedWith + [ "BackendTask" ] + "BackendTask" + [ Type.record + [ ( "fatal" + , Type.namedWith + [ "FatalError" ] + "FatalError" + [] + ) + , ( "recoverable" + , Type.namedWith + [ "BackendTask", "File" ] + "FileReadError" + [ Type.var "decoderError" ] + ) + ] + , Type.string + ] + ) + ) + } + ) + [ Elm.string bodyWithoutFrontmatterArg_ ] + + +{-| Same as `bodyWithFrontmatter` except it doesn't include the body. + +This is often useful when you're aggregating data, for example getting a listing of blog posts and need to extract +just the metadata. + + import BackendTask exposing (BackendTask) + import BackendTask.File as File + import FatalError exposing (FatalError) + import Json.Decode as Decode exposing (Decoder) + + blogPost : BackendTask FatalError BlogPostMetadata + blogPost = + File.onlyFrontmatter + blogPostDecoder + "blog/hello-world.md" + |> BackendTask.allowFatal + + type alias BlogPostMetadata = + { title : String + , tags : List String + } + + blogPostDecoder : Decoder BlogPostMetadata + blogPostDecoder = + Decode.map2 BlogPostMetadata + (Decode.field "title" Decode.string) + (Decode.field "tags" (Decode.list Decode.string)) + +If you wanted to use this to get this metadata for all blog posts in a folder, you could use +the [`BackendTask`](BackendTask) API along with [`BackendTask.Glob`](BackendTask-Glob). + + import BackendTask exposing (BackendTask) + import BackendTask.File as File + import Decode exposing (Decoder) + + blogPostFiles : BackendTask (List String) + blogPostFiles = + Glob.succeed identity + |> Glob.captureFilePath + |> Glob.match (Glob.literal "content/blog/") + |> Glob.match Glob.wildcard + |> Glob.match (Glob.literal ".md") + |> Glob.toBackendTask + + allMetadata : BackendTask (List BlogPostMetadata) + allMetadata = + blogPostFiles + |> BackendTask.map + (List.map + (File.onlyFrontmatter + blogPostDecoder + ) + ) + |> BackendTask.resolve + +onlyFrontmatter: + Json.Decode.Decoder frontmatter + -> String + -> BackendTask.BackendTask { fatal : FatalError.FatalError + , recoverable : BackendTask.File.FileReadError Json.Decode.Error + } frontmatter +-} +onlyFrontmatter : Elm.Expression -> String -> Elm.Expression +onlyFrontmatter onlyFrontmatterArg_ onlyFrontmatterArg_0 = + Elm.apply + (Elm.value + { importFrom = [ "BackendTask", "File" ] + , name = "onlyFrontmatter" + , annotation = + Just + (Type.function + [ Type.namedWith + [ "Json", "Decode" ] + "Decoder" + [ Type.var "frontmatter" ] + , Type.string + ] + (Type.namedWith + [ "BackendTask" ] + "BackendTask" + [ Type.record + [ ( "fatal" + , Type.namedWith + [ "FatalError" ] + "FatalError" + [] + ) + , ( "recoverable" + , Type.namedWith + [ "BackendTask", "File" ] + "FileReadError" + [ Type.namedWith + [ "Json", "Decode" ] + "Error" + [] + ] + ) + ] + , Type.var "frontmatter" + ] + ) + ) + } + ) + [ onlyFrontmatterArg_, Elm.string onlyFrontmatterArg_0 ] + + +{-| Read a file as JSON. + +The Decode will strip off any unused JSON data. + + import BackendTask exposing (BackendTask) + import BackendTask.File as File + import FatalError exposing (FatalError) + import Json.Decode as Decode + + sourceDirectories : BackendTask FatalError (List String) + sourceDirectories = + File.jsonFile + (Decode.field + "source-directories" + (Decode.list Decode.string) + ) + "elm.json" + |> BackendTask.allowFatal + +jsonFile: + Json.Decode.Decoder a + -> String + -> BackendTask.BackendTask { fatal : FatalError.FatalError + , recoverable : BackendTask.File.FileReadError Json.Decode.Error + } a +-} +jsonFile : Elm.Expression -> String -> Elm.Expression +jsonFile jsonFileArg_ jsonFileArg_0 = + Elm.apply + (Elm.value + { importFrom = [ "BackendTask", "File" ] + , name = "jsonFile" + , annotation = + Just + (Type.function + [ Type.namedWith + [ "Json", "Decode" ] + "Decoder" + [ Type.var "a" ] + , Type.string + ] + (Type.namedWith + [ "BackendTask" ] + "BackendTask" + [ Type.record + [ ( "fatal" + , Type.namedWith + [ "FatalError" ] + "FatalError" + [] + ) + , ( "recoverable" + , Type.namedWith + [ "BackendTask", "File" ] + "FileReadError" + [ Type.namedWith + [ "Json", "Decode" ] + "Error" + [] + ] + ) + ] + , Type.var "a" + ] + ) + ) + } + ) + [ jsonFileArg_, Elm.string jsonFileArg_0 ] + + +{-| Get the raw file content. Unlike the frontmatter helpers in this module, this function will not strip off frontmatter if there is any. + +This is the function you want if you are reading in a file directly. For example, if you read in a CSV file, a raw text file, or any other file that doesn't +have frontmatter. + +There's a special function for reading in JSON files, [`jsonFile`](#jsonFile). If you're reading a JSON file then be sure to +use `jsonFile` to get the benefits of the `Decode` here. + +You could read a file called `hello.txt` in your root project directory like this: + + import BackendTask exposing (BackendTask) + import BackendTask.File as File + import FatalError exposing (FatalError) + + elmJsonFile : BackendTask FatalError String + elmJsonFile = + File.rawFile "hello.txt" + |> BackendTask.allowFatal + +rawFile: + String + -> BackendTask.BackendTask { fatal : FatalError.FatalError + , recoverable : BackendTask.File.FileReadError decoderError + } String +-} +rawFile : String -> Elm.Expression +rawFile rawFileArg_ = + Elm.apply + (Elm.value + { importFrom = [ "BackendTask", "File" ] + , name = "rawFile" + , annotation = + Just + (Type.function + [ Type.string ] + (Type.namedWith + [ "BackendTask" ] + "BackendTask" + [ Type.record + [ ( "fatal" + , Type.namedWith + [ "FatalError" ] + "FatalError" + [] + ) + , ( "recoverable" + , Type.namedWith + [ "BackendTask", "File" ] + "FileReadError" + [ Type.var "decoderError" ] + ) + ] + , Type.string + ] + ) + ) + } + ) + [ Elm.string rawFileArg_ ] + + +annotation_ : { fileReadError : Type.Annotation -> Type.Annotation } +annotation_ = + { fileReadError = + \fileReadErrorArg0 -> + Type.namedWith + [ "BackendTask", "File" ] + "FileReadError" + [ fileReadErrorArg0 ] + } + + +make_ : + { fileDoesntExist : Elm.Expression + , fileReadError : Elm.Expression -> Elm.Expression + , decodingError : Elm.Expression -> Elm.Expression + } +make_ = + { fileDoesntExist = + Elm.value + { importFrom = [ "BackendTask", "File" ] + , name = "FileDoesntExist" + , annotation = + Just (Type.namedWith [] "FileReadError" [ Type.var "decoding" ]) + } + , fileReadError = + \ar0 -> + Elm.apply + (Elm.value + { importFrom = [ "BackendTask", "File" ] + , name = "FileReadError" + , annotation = + Just + (Type.namedWith + [] + "FileReadError" + [ Type.var "decoding" ] + ) + } + ) + [ ar0 ] + , decodingError = + \ar0 -> + Elm.apply + (Elm.value + { importFrom = [ "BackendTask", "File" ] + , name = "DecodingError" + , annotation = + Just + (Type.namedWith + [] + "FileReadError" + [ Type.var "decoding" ] + ) + } + ) + [ ar0 ] + } + + +caseOf_ : + { fileReadError : + Elm.Expression + -> { fileDoesntExist : Elm.Expression + , fileReadError : Elm.Expression -> Elm.Expression + , decodingError : Elm.Expression -> Elm.Expression + } + -> Elm.Expression + } +caseOf_ = + { fileReadError = + \fileReadErrorExpression fileReadErrorTags -> + Elm.Case.custom + fileReadErrorExpression + (Type.namedWith + [ "BackendTask", "File" ] + "FileReadError" + [ Type.var "decoding" ] + ) + [ Elm.Case.branch + (Elm.Arg.customType + "FileDoesntExist" + fileReadErrorTags.fileDoesntExist + ) + Basics.identity + , Elm.Case.branch + (Elm.Arg.customType + "FileReadError" + fileReadErrorTags.fileReadError |> Elm.Arg.item + (Elm.Arg.varWith + "arg_0" + Type.string + ) + ) + Basics.identity + , Elm.Case.branch + (Elm.Arg.customType + "DecodingError" + fileReadErrorTags.decodingError |> Elm.Arg.item + (Elm.Arg.varWith + "decoding" + (Type.var + "decoding" + ) + ) + ) + Basics.identity + ] + } + + +call_ : + { bodyWithFrontmatter : Elm.Expression -> Elm.Expression -> Elm.Expression + , bodyWithoutFrontmatter : Elm.Expression -> Elm.Expression + , onlyFrontmatter : Elm.Expression -> Elm.Expression -> Elm.Expression + , jsonFile : Elm.Expression -> Elm.Expression -> Elm.Expression + , rawFile : Elm.Expression -> Elm.Expression + } +call_ = + { bodyWithFrontmatter = + \bodyWithFrontmatterArg_ bodyWithFrontmatterArg_0 -> + Elm.apply + (Elm.value + { importFrom = [ "BackendTask", "File" ] + , name = "bodyWithFrontmatter" + , annotation = + Just + (Type.function + [ Type.function + [ Type.string ] + (Type.namedWith + [ "Json", "Decode" ] + "Decoder" + [ Type.var "frontmatter" ] + ) + , Type.string + ] + (Type.namedWith + [ "BackendTask" ] + "BackendTask" + [ Type.record + [ ( "fatal" + , Type.namedWith + [ "FatalError" ] + "FatalError" + [] + ) + , ( "recoverable" + , Type.namedWith + [ "BackendTask", "File" ] + "FileReadError" + [ Type.namedWith + [ "Json", "Decode" ] + "Error" + [] + ] + ) + ] + , Type.var "frontmatter" + ] + ) + ) + } + ) + [ bodyWithFrontmatterArg_, bodyWithFrontmatterArg_0 ] + , bodyWithoutFrontmatter = + \bodyWithoutFrontmatterArg_ -> + Elm.apply + (Elm.value + { importFrom = [ "BackendTask", "File" ] + , name = "bodyWithoutFrontmatter" + , annotation = + Just + (Type.function + [ Type.string ] + (Type.namedWith + [ "BackendTask" ] + "BackendTask" + [ Type.record + [ ( "fatal" + , Type.namedWith + [ "FatalError" ] + "FatalError" + [] + ) + , ( "recoverable" + , Type.namedWith + [ "BackendTask", "File" ] + "FileReadError" + [ Type.var "decoderError" ] + ) + ] + , Type.string + ] + ) + ) + } + ) + [ bodyWithoutFrontmatterArg_ ] + , onlyFrontmatter = + \onlyFrontmatterArg_ onlyFrontmatterArg_0 -> + Elm.apply + (Elm.value + { importFrom = [ "BackendTask", "File" ] + , name = "onlyFrontmatter" + , annotation = + Just + (Type.function + [ Type.namedWith + [ "Json", "Decode" ] + "Decoder" + [ Type.var "frontmatter" ] + , Type.string + ] + (Type.namedWith + [ "BackendTask" ] + "BackendTask" + [ Type.record + [ ( "fatal" + , Type.namedWith + [ "FatalError" ] + "FatalError" + [] + ) + , ( "recoverable" + , Type.namedWith + [ "BackendTask", "File" ] + "FileReadError" + [ Type.namedWith + [ "Json", "Decode" ] + "Error" + [] + ] + ) + ] + , Type.var "frontmatter" + ] + ) + ) + } + ) + [ onlyFrontmatterArg_, onlyFrontmatterArg_0 ] + , jsonFile = + \jsonFileArg_ jsonFileArg_0 -> + Elm.apply + (Elm.value + { importFrom = [ "BackendTask", "File" ] + , name = "jsonFile" + , annotation = + Just + (Type.function + [ Type.namedWith + [ "Json", "Decode" ] + "Decoder" + [ Type.var "a" ] + , Type.string + ] + (Type.namedWith + [ "BackendTask" ] + "BackendTask" + [ Type.record + [ ( "fatal" + , Type.namedWith + [ "FatalError" ] + "FatalError" + [] + ) + , ( "recoverable" + , Type.namedWith + [ "BackendTask", "File" ] + "FileReadError" + [ Type.namedWith + [ "Json", "Decode" ] + "Error" + [] + ] + ) + ] + , Type.var "a" + ] + ) + ) + } + ) + [ jsonFileArg_, jsonFileArg_0 ] + , rawFile = + \rawFileArg_ -> + Elm.apply + (Elm.value + { importFrom = [ "BackendTask", "File" ] + , name = "rawFile" + , annotation = + Just + (Type.function + [ Type.string ] + (Type.namedWith + [ "BackendTask" ] + "BackendTask" + [ Type.record + [ ( "fatal" + , Type.namedWith + [ "FatalError" ] + "FatalError" + [] + ) + , ( "recoverable" + , Type.namedWith + [ "BackendTask", "File" ] + "FileReadError" + [ Type.var "decoderError" ] + ) + ] + , Type.string + ] + ) + ) + } + ) + [ rawFileArg_ ] + } + + +values_ : + { bodyWithFrontmatter : Elm.Expression + , bodyWithoutFrontmatter : Elm.Expression + , onlyFrontmatter : Elm.Expression + , jsonFile : Elm.Expression + , rawFile : Elm.Expression + } +values_ = + { bodyWithFrontmatter = + Elm.value + { importFrom = [ "BackendTask", "File" ] + , name = "bodyWithFrontmatter" + , annotation = + Just + (Type.function + [ Type.function + [ Type.string ] + (Type.namedWith + [ "Json", "Decode" ] + "Decoder" + [ Type.var "frontmatter" ] + ) + , Type.string + ] + (Type.namedWith + [ "BackendTask" ] + "BackendTask" + [ Type.record + [ ( "fatal" + , Type.namedWith + [ "FatalError" ] + "FatalError" + [] + ) + , ( "recoverable" + , Type.namedWith + [ "BackendTask", "File" ] + "FileReadError" + [ Type.namedWith + [ "Json", "Decode" ] + "Error" + [] + ] + ) + ] + , Type.var "frontmatter" + ] + ) + ) + } + , bodyWithoutFrontmatter = + Elm.value + { importFrom = [ "BackendTask", "File" ] + , name = "bodyWithoutFrontmatter" + , annotation = + Just + (Type.function + [ Type.string ] + (Type.namedWith + [ "BackendTask" ] + "BackendTask" + [ Type.record + [ ( "fatal" + , Type.namedWith + [ "FatalError" ] + "FatalError" + [] + ) + , ( "recoverable" + , Type.namedWith + [ "BackendTask", "File" ] + "FileReadError" + [ Type.var "decoderError" ] + ) + ] + , Type.string + ] + ) + ) + } + , onlyFrontmatter = + Elm.value + { importFrom = [ "BackendTask", "File" ] + , name = "onlyFrontmatter" + , annotation = + Just + (Type.function + [ Type.namedWith + [ "Json", "Decode" ] + "Decoder" + [ Type.var "frontmatter" ] + , Type.string + ] + (Type.namedWith + [ "BackendTask" ] + "BackendTask" + [ Type.record + [ ( "fatal" + , Type.namedWith + [ "FatalError" ] + "FatalError" + [] + ) + , ( "recoverable" + , Type.namedWith + [ "BackendTask", "File" ] + "FileReadError" + [ Type.namedWith + [ "Json", "Decode" ] + "Error" + [] + ] + ) + ] + , Type.var "frontmatter" + ] + ) + ) + } + , jsonFile = + Elm.value + { importFrom = [ "BackendTask", "File" ] + , name = "jsonFile" + , annotation = + Just + (Type.function + [ Type.namedWith + [ "Json", "Decode" ] + "Decoder" + [ Type.var "a" ] + , Type.string + ] + (Type.namedWith + [ "BackendTask" ] + "BackendTask" + [ Type.record + [ ( "fatal" + , Type.namedWith + [ "FatalError" ] + "FatalError" + [] + ) + , ( "recoverable" + , Type.namedWith + [ "BackendTask", "File" ] + "FileReadError" + [ Type.namedWith + [ "Json", "Decode" ] + "Error" + [] + ] + ) + ] + , Type.var "a" + ] + ) + ) + } + , rawFile = + Elm.value + { importFrom = [ "BackendTask", "File" ] + , name = "rawFile" + , annotation = + Just + (Type.function + [ Type.string ] + (Type.namedWith + [ "BackendTask" ] + "BackendTask" + [ Type.record + [ ( "fatal" + , Type.namedWith + [ "FatalError" ] + "FatalError" + [] + ) + , ( "recoverable" + , Type.namedWith + [ "BackendTask", "File" ] + "FileReadError" + [ Type.var "decoderError" ] + ) + ] + , Type.string + ] + ) + ) + } + } \ No newline at end of file diff --git a/elm-open-api-codegen/src/Gen/BackendTask/Glob.elm b/elm-open-api-codegen/src/Gen/BackendTask/Glob.elm new file mode 100644 index 00000000..3e71274b --- /dev/null +++ b/elm-open-api-codegen/src/Gen/BackendTask/Glob.elm @@ -0,0 +1,2137 @@ +module Gen.BackendTask.Glob exposing + ( moduleName_, capture, match, fromString, fromStringWithOptions, captureFilePath + , wildcard, recursiveWildcard, int, digits, captureStats, expectUniqueMatch, expectUniqueMatchFromList + , literal, map, succeed, oneOf, zeroOrMore, atLeastOne, toBackendTask + , toBackendTaskWithOptions, defaultOptions, annotation_, make_, caseOf_, call_, values_ + ) + +{-| +# Generated bindings for BackendTask.Glob + +@docs moduleName_, capture, match, fromString, fromStringWithOptions, captureFilePath +@docs wildcard, recursiveWildcard, int, digits, captureStats, expectUniqueMatch +@docs expectUniqueMatchFromList, literal, map, succeed, oneOf, zeroOrMore +@docs atLeastOne, toBackendTask, toBackendTaskWithOptions, defaultOptions, annotation_, make_ +@docs caseOf_, call_, values_ +-} + + +import Elm +import Elm.Annotation as Type +import Elm.Arg +import Elm.Case + + +{-| The name of this module. -} +moduleName_ : List String +moduleName_ = + [ "BackendTask", "Glob" ] + + +{-| Adds on to the glob pattern, and captures it in the resulting Elm match value. That means this both changes which +files will match, and gives you the sub-match as Elm data for each matching file. + +Exactly the same as `match` except it also captures the matched sub-pattern. + + type alias ArchivesArticle = + { year : String + , month : String + , day : String + , slug : String + } + + archives : BackendTask error ArchivesArticle + archives = + Glob.succeed ArchivesArticle + |> Glob.match (Glob.literal "archive/") + |> Glob.capture Glob.int + |> Glob.match (Glob.literal "/") + |> Glob.capture Glob.int + |> Glob.match (Glob.literal "/") + |> Glob.capture Glob.int + |> Glob.match (Glob.literal "/") + |> Glob.capture Glob.wildcard + |> Glob.match (Glob.literal ".md") + |> Glob.toBackendTask + +The file `archive/1977/06/10/apple-2-released.md` will give us this match: + + matches : List error ArchivesArticle + matches = + BackendTask.succeed + [ { year = 1977 + , month = 6 + , day = 10 + , slug = "apple-2-released" + } + ] + +When possible, it's best to grab data and turn it into structured Elm data when you have it. That way, +you don't end up with duplicate validation logic and data normalization, and your code will be more robust. + +If you only care about getting the full matched file paths, you can use `match`. `capture` is very useful because +you can pick apart structured data as you build up your glob pattern. This follows the principle of +[Parse, Don't Validate](https://elm-radio.com/episode/parse-dont-validate/). + +capture: + BackendTask.Glob.Glob a + -> BackendTask.Glob.Glob (a -> value) + -> BackendTask.Glob.Glob value +-} +capture : Elm.Expression -> Elm.Expression -> Elm.Expression +capture captureArg_ captureArg_0 = + Elm.apply + (Elm.value + { importFrom = [ "BackendTask", "Glob" ] + , name = "capture" + , annotation = + Just + (Type.function + [ Type.namedWith + [ "BackendTask", "Glob" ] + "Glob" + [ Type.var "a" ] + , Type.namedWith + [ "BackendTask", "Glob" ] + "Glob" + [ Type.function + [ Type.var "a" ] + (Type.var "value") + ] + ] + (Type.namedWith + [ "BackendTask", "Glob" ] + "Glob" + [ Type.var "value" ] + ) + ) + } + ) + [ captureArg_, captureArg_0 ] + + +{-| Adds on to the glob pattern, but does not capture it in the resulting Elm match value. That means this changes which +files will match, but does not change the Elm data type you get for each matching file. + +Exactly the same as `capture` except it doesn't capture the matched sub-pattern. + +match: + BackendTask.Glob.Glob a + -> BackendTask.Glob.Glob value + -> BackendTask.Glob.Glob value +-} +match : Elm.Expression -> Elm.Expression -> Elm.Expression +match matchArg_ matchArg_0 = + Elm.apply + (Elm.value + { importFrom = [ "BackendTask", "Glob" ] + , name = "match" + , annotation = + Just + (Type.function + [ Type.namedWith + [ "BackendTask", "Glob" ] + "Glob" + [ Type.var "a" ] + , Type.namedWith + [ "BackendTask", "Glob" ] + "Glob" + [ Type.var "value" ] + ] + (Type.namedWith + [ "BackendTask", "Glob" ] + "Glob" + [ Type.var "value" ] + ) + ) + } + ) + [ matchArg_, matchArg_0 ] + + +{-| Runs a glob string directly, with `include = FilesAndFolders`. Behavior is similar to using glob patterns in a shell. + +If you need to capture specific parts of the path, you can use `capture` and `match` functions instead. `fromString` +only allows you to capture a list of matching file paths. + +The following glob syntax is supported: + + - `*` matches any number of characters except for `/` + - `**` matches any number of characters including `/` + +For example, if we have the following files: + +```shell +- src/ + - Main.elm + - Ui/ + - Icon.elm +- content/ + - blog/ + - first-post.md + - second-post.md +``` + + import BackendTask.Glob as Glob + + blogPosts : BackendTask error (List String) + blogPosts = + Glob.fromString "content/blog/*.md" + + --> BackendTask.succeed [ "content/blog/first-post.md", "content/blog/second-post.md" ] + elmFiles : BackendTask error (List String) + elmFiles = + Glob.fromString "src/**/*.elm" + + --> BackendTask.succeed [ "src/Main.elm", "src/Ui", "src/Ui/Icon.elm" ] + +fromString: String -> BackendTask.BackendTask error (List String) +-} +fromString : String -> Elm.Expression +fromString fromStringArg_ = + Elm.apply + (Elm.value + { importFrom = [ "BackendTask", "Glob" ] + , name = "fromString" + , annotation = + Just + (Type.function + [ Type.string ] + (Type.namedWith + [ "BackendTask" ] + "BackendTask" + [ Type.var "error", Type.list Type.string ] + ) + ) + } + ) + [ Elm.string fromStringArg_ ] + + +{-| Same as [`fromString`](#fromString), but with custom [`Options`](#Options). + +fromStringWithOptions: + BackendTask.Glob.Options + -> String + -> BackendTask.BackendTask error (List String) +-} +fromStringWithOptions : Elm.Expression -> String -> Elm.Expression +fromStringWithOptions fromStringWithOptionsArg_ fromStringWithOptionsArg_0 = + Elm.apply + (Elm.value + { importFrom = [ "BackendTask", "Glob" ] + , name = "fromStringWithOptions" + , annotation = + Just + (Type.function + [ Type.namedWith + [ "BackendTask", "Glob" ] + "Options" + [] + , Type.string + ] + (Type.namedWith + [ "BackendTask" ] + "BackendTask" + [ Type.var "error", Type.list Type.string ] + ) + ) + } + ) + [ fromStringWithOptionsArg_, Elm.string fromStringWithOptionsArg_0 ] + + +{-| import BackendTask exposing (BackendTask) + import BackendTask.Glob as Glob + + blogPosts : + BackendTask + error + (List + { filePath : String + , slug : String + } + ) + blogPosts = + Glob.succeed + (\filePath slug -> + { filePath = filePath + , slug = slug + } + ) + |> Glob.captureFilePath + |> Glob.match (Glob.literal "content/blog/") + |> Glob.capture Glob.wildcard + |> Glob.match (Glob.literal ".md") + |> Glob.toBackendTask + +This function does not change which files will or will not match. It just gives you the full matching +file path in your `Glob` pipeline. + +Whenever possible, it's a good idea to use function to make sure you have an accurate file path when you need to read a file. + +captureFilePath: BackendTask.Glob.Glob (String -> value) -> BackendTask.Glob.Glob value +-} +captureFilePath : Elm.Expression -> Elm.Expression +captureFilePath captureFilePathArg_ = + Elm.apply + (Elm.value + { importFrom = [ "BackendTask", "Glob" ] + , name = "captureFilePath" + , annotation = + Just + (Type.function + [ Type.namedWith + [ "BackendTask", "Glob" ] + "Glob" + [ Type.function [ Type.string ] (Type.var "value") + ] + ] + (Type.namedWith + [ "BackendTask", "Glob" ] + "Glob" + [ Type.var "value" ] + ) + ) + } + ) + [ captureFilePathArg_ ] + + +{-| Matches anything except for a `/` in a file path. You may be familiar with this syntax from shells like bash +where you can run commands like `rm client/*.js` to remove all `.js` files in the `client` directory. + +Just like a `*` glob pattern in bash, this `Glob.wildcard` function will only match within a path part. If you need to +match 0 or more path parts like, see `recursiveWildcard`. + + import BackendTask exposing (BackendTask) + import BackendTask.Glob as Glob + + type alias BlogPost = + { year : String + , month : String + , day : String + , slug : String + } + + example : BackendTask error (List BlogPost) + example = + Glob.succeed BlogPost + |> Glob.match (Glob.literal "blog/") + |> Glob.capture Glob.wildcard + |> Glob.match (Glob.literal "-") + |> Glob.capture Glob.wildcard + |> Glob.match (Glob.literal "-") + |> Glob.capture Glob.wildcard + |> Glob.match (Glob.literal "/") + |> Glob.capture Glob.wildcard + |> Glob.match (Glob.literal ".md") + |> Glob.toBackendTask + +```shell + +- blog/ + - 2021-05-27/ + - first-post.md +``` + +That will match to: + + results : BackendTask error (List BlogPost) + results = + BackendTask.succeed + [ { year = "2021" + , month = "05" + , day = "27" + , slug = "first-post" + } + ] + +Note that we can "destructure" the date part of this file path in the format `yyyy-mm-dd`. The `wildcard` matches +will match _within_ a path part (think between the slashes of a file path). `recursiveWildcard` can match across path parts. + +wildcard: BackendTask.Glob.Glob String +-} +wildcard : Elm.Expression +wildcard = + Elm.value + { importFrom = [ "BackendTask", "Glob" ] + , name = "wildcard" + , annotation = + Just + (Type.namedWith [ "BackendTask", "Glob" ] "Glob" [ Type.string ] + ) + } + + +{-| Matches any number of characters, including `/`, as long as it's the only thing in a path part. + +In contrast, `wildcard` will never match `/`, so it only matches within a single path part. + +This is the elm-pages equivalent of `**/*.txt` in standard shell syntax: + + import BackendTask exposing (BackendTask) + import BackendTask.Glob as Glob + + example : BackendTask error (List ( List String, String )) + example = + Glob.succeed Tuple.pair + |> Glob.match (Glob.literal "articles/") + |> Glob.capture Glob.recursiveWildcard + |> Glob.match (Glob.literal "/") + |> Glob.capture Glob.wildcard + |> Glob.match (Glob.literal ".txt") + |> Glob.toBackendTask + +With these files: + +```shell +- articles/ + - google-io-2021-recap.txt + - archive/ + - 1977/ + - 06/ + - 10/ + - apple-2-announced.txt +``` + +We would get the following matches: + + matches : BackendTask error (List ( List String, String )) + matches = + BackendTask.succeed + [ ( [ "archive", "1977", "06", "10" ], "apple-2-announced" ) + , ( [], "google-io-2021-recap" ) + ] + +Note that the recursive wildcard conveniently gives us a `List String`, where +each String is a path part with no slashes (like `archive`). + +And also note that it matches 0 path parts into an empty list. + +If we didn't include the `wildcard` after the `recursiveWildcard`, then we would only get +a single level of matches because it is followed by a file extension. + + example : BackendTask error (List String) + example = + Glob.succeed identity + |> Glob.match (Glob.literal "articles/") + |> Glob.capture Glob.recursiveWildcard + |> Glob.match (Glob.literal ".txt") + + matches : BackendTask error (List String) + matches = + BackendTask.succeed + [ "google-io-2021-recap" + ] + +This is usually not what is intended. Using `recursiveWildcard` is usually followed by a `wildcard` for this reason. + +recursiveWildcard: BackendTask.Glob.Glob (List String) +-} +recursiveWildcard : Elm.Expression +recursiveWildcard = + Elm.value + { importFrom = [ "BackendTask", "Glob" ] + , name = "recursiveWildcard" + , annotation = + Just + (Type.namedWith + [ "BackendTask", "Glob" ] + "Glob" + [ Type.list Type.string ] + ) + } + + +{-| Same as [`digits`](#digits), but it safely turns the digits String into an `Int`. + +Leading 0's are ignored. + + import BackendTask exposing (BackendTask) + import BackendTask.Glob as Glob + + slides : BackendTask error (List Int) + slides = + Glob.succeed identity + |> Glob.match (Glob.literal "slide-") + |> Glob.capture Glob.int + |> Glob.match (Glob.literal ".md") + |> Glob.toBackendTask + +With files + +```shell +- slide-no-match.md +- slide-.md +- slide-1.md +- slide-01.md +- slide-2.md +- slide-03.md +- slide-4.md +- slide-05.md +- slide-06.md +- slide-007.md +- slide-08.md +- slide-09.md +- slide-10.md +- slide-11.md +``` + +Yields + + matches : BackendTask error (List Int) + matches = + BackendTask.succeed + [ 1 + , 1 + , 2 + , 3 + , 4 + , 5 + , 6 + , 7 + , 8 + , 9 + , 10 + , 11 + ] + +Note that neither `slide-no-match.md` nor `slide-.md` match. +And both `slide-1.md` and `slide-01.md` match and turn into `1`. + +int: BackendTask.Glob.Glob Int +-} +int : Elm.Expression +int = + Elm.value + { importFrom = [ "BackendTask", "Glob" ] + , name = "int" + , annotation = + Just (Type.namedWith [ "BackendTask", "Glob" ] "Glob" [ Type.int ]) + } + + +{-| This is similar to [`wildcard`](#wildcard), but it will only match 1 or more digits (i.e. `[0-9]+`). + +See [`int`](#int) for a convenience function to get an Int value instead of a String of digits. + +digits: BackendTask.Glob.Glob String +-} +digits : Elm.Expression +digits = + Elm.value + { importFrom = [ "BackendTask", "Glob" ] + , name = "digits" + , annotation = + Just + (Type.namedWith [ "BackendTask", "Glob" ] "Glob" [ Type.string ] + ) + } + + +{-| import BackendTask.Glob as Glob + + recentlyChangedRouteModules : BackendTask error (List ( Time.Posix, List String )) + recentlyChangedRouteModules = + Glob.succeed + (\fileStats directoryName fileName -> + ( fileStats.lastContentChange + , directoryName ++ [ fileName ] + ) + ) + |> Glob.captureStats + |> Glob.match (Glob.literal "app/Route/") + |> Glob.capture Glob.recursiveWildcard + |> Glob.match (Glob.literal "/") + |> Glob.capture Glob.wildcard + |> Glob.match (Glob.literal ".elm") + |> Glob.toBackendTask + |> BackendTask.map + (\entries -> + entries + |> List.sortBy (\( lastChanged, _ ) -> Time.posixToMillis lastChanged) + |> List.reverse + ) + +captureStats: + BackendTask.Glob.Glob (BackendTask.Glob.FileStats -> value) + -> BackendTask.Glob.Glob value +-} +captureStats : Elm.Expression -> Elm.Expression +captureStats captureStatsArg_ = + Elm.apply + (Elm.value + { importFrom = [ "BackendTask", "Glob" ] + , name = "captureStats" + , annotation = + Just + (Type.function + [ Type.namedWith + [ "BackendTask", "Glob" ] + "Glob" + [ Type.function + [ Type.namedWith + [ "BackendTask", "Glob" ] + "FileStats" + [] + ] + (Type.var "value") + ] + ] + (Type.namedWith + [ "BackendTask", "Glob" ] + "Glob" + [ Type.var "value" ] + ) + ) + } + ) + [ captureStatsArg_ ] + + +{-| Sometimes you want to make sure there is a unique file matching a particular pattern. +This is a simple helper that will give you a `BackendTask` error if there isn't exactly 1 matching file. +If there is exactly 1, then you successfully get back that single match. + +For example, maybe you can have + + import BackendTask exposing (BackendTask) + import BackendTask.Glob as Glob + + findBlogBySlug : String -> BackendTask FatalError String + findBlogBySlug slug = + Glob.succeed identity + |> Glob.captureFilePath + |> Glob.match (Glob.literal "blog/") + |> Glob.match (Glob.literal slug) + |> Glob.match + (Glob.oneOf + ( ( "", () ) + , [ ( "/index", () ) ] + ) + ) + |> Glob.match (Glob.literal ".md") + |> Glob.expectUniqueMatch + |> BackendTask.allowFatal + +If we used `findBlogBySlug "first-post"` with these files: + +```markdown +- blog/ + - first-post/ + - index.md +``` + +This would give us: + + results : BackendTask FatalError String + results = + BackendTask.succeed "blog/first-post/index.md" + +If we used `findBlogBySlug "first-post"` with these files: + +```markdown +- blog/ + - first-post.md + - first-post/ + - index.md +``` + +Then we will get a `BackendTask` error saying `More than one file matched.` Keep in mind that `BackendTask` failures +in build-time routes will cause a build failure, giving you the opportunity to fix the problem before users see the issue, +so it's ideal to make this kind of assertion rather than having fallback behavior that could silently cover up +issues (like if we had instead ignored the case where there are two or more matching blog post files). + +expectUniqueMatch: + BackendTask.Glob.Glob a + -> BackendTask.BackendTask { fatal : FatalError.FatalError + , recoverable : String + } a +-} +expectUniqueMatch : Elm.Expression -> Elm.Expression +expectUniqueMatch expectUniqueMatchArg_ = + Elm.apply + (Elm.value + { importFrom = [ "BackendTask", "Glob" ] + , name = "expectUniqueMatch" + , annotation = + Just + (Type.function + [ Type.namedWith + [ "BackendTask", "Glob" ] + "Glob" + [ Type.var "a" ] + ] + (Type.namedWith + [ "BackendTask" ] + "BackendTask" + [ Type.record + [ ( "fatal" + , Type.namedWith + [ "FatalError" ] + "FatalError" + [] + ) + , ( "recoverable", Type.string ) + ] + , Type.var "a" + ] + ) + ) + } + ) + [ expectUniqueMatchArg_ ] + + +{-| expectUniqueMatchFromList: List (BackendTask.Glob.Glob a) -> BackendTask.BackendTask String a -} +expectUniqueMatchFromList : List Elm.Expression -> Elm.Expression +expectUniqueMatchFromList expectUniqueMatchFromListArg_ = + Elm.apply + (Elm.value + { importFrom = [ "BackendTask", "Glob" ] + , name = "expectUniqueMatchFromList" + , annotation = + Just + (Type.function + [ Type.list + (Type.namedWith + [ "BackendTask", "Glob" ] + "Glob" + [ Type.var "a" ] + ) + ] + (Type.namedWith + [ "BackendTask" ] + "BackendTask" + [ Type.string, Type.var "a" ] + ) + ) + } + ) + [ Elm.list expectUniqueMatchFromListArg_ ] + + +{-| Match a literal part of a path. Can include `/`s. + +Some common uses include + + - The leading part of a pattern, to say "starts with `content/blog/`" + - The ending part of a pattern, to say "ends with `.md`" + - In-between wildcards, to say "these dynamic parts are separated by `/`" + +```elm +import BackendTask exposing (BackendTask) +import BackendTask.Glob as Glob + +blogPosts = + Glob.succeed + (\section slug -> + { section = section, slug = slug } + ) + |> Glob.match (Glob.literal "content/blog/") + |> Glob.capture Glob.wildcard + |> Glob.match (Glob.literal "/") + |> Glob.capture Glob.wildcard + |> Glob.match (Glob.literal ".md") +``` + +literal: String -> BackendTask.Glob.Glob String +-} +literal : String -> Elm.Expression +literal literalArg_ = + Elm.apply + (Elm.value + { importFrom = [ "BackendTask", "Glob" ] + , name = "literal" + , annotation = + Just + (Type.function + [ Type.string ] + (Type.namedWith + [ "BackendTask", "Glob" ] + "Glob" + [ Type.string ] + ) + ) + } + ) + [ Elm.string literalArg_ ] + + +{-| A `Glob` can be mapped. This can be useful for transforming a sub-match in-place. + +For example, if you wanted to take the slugs for a blog post and make sure they are normalized to be all lowercase, you +could use + + import BackendTask exposing (BackendTask) + import BackendTask.Glob as Glob + + blogPostsGlob : BackendTask error (List String) + blogPostsGlob = + Glob.succeed (\slug -> slug) + |> Glob.match (Glob.literal "content/blog/") + |> Glob.capture (Glob.wildcard |> Glob.map String.toLower) + |> Glob.match (Glob.literal ".md") + |> Glob.toBackendTask + +If you want to validate file formats, you can combine that with some `BackendTask` helpers to turn a `Glob (Result String value)` into +a `BackendTask FatalError (List value)`. + +For example, you could take a date and parse it. + + import BackendTask exposing (BackendTask) + import BackendTask.Glob as Glob + + example : BackendTask FatalError (List ( String, String )) + example = + Glob.succeed + (\dateResult slug -> + dateResult + |> Result.map (\okDate -> ( okDate, slug )) + ) + |> Glob.match (Glob.literal "blog/") + |> Glob.capture (Glob.recursiveWildcard |> Glob.map expectDateFormat) + |> Glob.match (Glob.literal "/") + |> Glob.capture Glob.wildcard + |> Glob.match (Glob.literal ".md") + |> Glob.toBackendTask + |> BackendTask.map (List.map BackendTask.fromResult) + |> BackendTask.resolve + + expectDateFormat : List String -> Result FatalError String + expectDateFormat dateParts = + case dateParts of + [ year, month, date ] -> + Ok (String.join "-" [ year, month, date ]) + + _ -> + Err <| FatalError.fromString "Unexpected date format, expected yyyy/mm/dd folder structure." + +map: (a -> b) -> BackendTask.Glob.Glob a -> BackendTask.Glob.Glob b +-} +map : (Elm.Expression -> Elm.Expression) -> Elm.Expression -> Elm.Expression +map mapArg_ mapArg_0 = + Elm.apply + (Elm.value + { importFrom = [ "BackendTask", "Glob" ] + , name = "map" + , annotation = + Just + (Type.function + [ Type.function [ Type.var "a" ] (Type.var "b") + , Type.namedWith + [ "BackendTask", "Glob" ] + "Glob" + [ Type.var "a" ] + ] + (Type.namedWith + [ "BackendTask", "Glob" ] + "Glob" + [ Type.var "b" ] + ) + ) + } + ) + [ Elm.functionReduced "mapUnpack" mapArg_, mapArg_0 ] + + +{-| `succeed` is how you start a pipeline for a `Glob`. You will need one argument for each `capture` in your `Glob`. + +succeed: constructor -> BackendTask.Glob.Glob constructor +-} +succeed : Elm.Expression -> Elm.Expression +succeed succeedArg_ = + Elm.apply + (Elm.value + { importFrom = [ "BackendTask", "Glob" ] + , name = "succeed" + , annotation = + Just + (Type.function + [ Type.var "constructor" ] + (Type.namedWith + [ "BackendTask", "Glob" ] + "Glob" + [ Type.var "constructor" ] + ) + ) + } + ) + [ succeedArg_ ] + + +{-| import BackendTask.Glob as Glob + + type Extension + = Json + | Yml + + type alias DataFile = + { name : String + , extension : String + } + + dataFiles : BackendTask error (List DataFile) + dataFiles = + Glob.succeed DataFile + |> Glob.match (Glob.literal "my-data/") + |> Glob.capture Glob.wildcard + |> Glob.match (Glob.literal ".") + |> Glob.capture + (Glob.oneOf + ( ( "yml", Yml ) + , [ ( "json", Json ) + ] + ) + ) + +If we have the following files + +```shell +- my-data/ + - authors.yml + - events.json +``` + +That gives us + + results : BackendTask error (List DataFile) + results = + BackendTask.succeed + [ { name = "authors" + , extension = Yml + } + , { name = "events" + , extension = Json + } + ] + +You could also match an optional file path segment using `oneOf`. + + rootFilesMd : BackendTask error (List String) + rootFilesMd = + Glob.succeed (\slug -> slug) + |> Glob.match (Glob.literal "blog/") + |> Glob.capture Glob.wildcard + |> Glob.match + (Glob.oneOf + ( ( "", () ) + , [ ( "/index", () ) ] + ) + ) + |> Glob.match (Glob.literal ".md") + |> Glob.toBackendTask + +With these files: + +```markdown +- blog/ + - first-post.md + - second-post/ + - index.md +``` + +This would give us: + + results : BackendTask error (List String) + results = + BackendTask.succeed + [ "first-post" + , "second-post" + ] + +oneOf: ( ( String, a ), List ( String, a ) ) -> BackendTask.Glob.Glob a +-} +oneOf : Elm.Expression -> Elm.Expression +oneOf oneOfArg_ = + Elm.apply + (Elm.value + { importFrom = [ "BackendTask", "Glob" ] + , name = "oneOf" + , annotation = + Just + (Type.function + [ Type.tuple + (Type.tuple Type.string (Type.var "a")) + (Type.list (Type.tuple Type.string (Type.var "a")) + ) + ] + (Type.namedWith + [ "BackendTask", "Glob" ] + "Glob" + [ Type.var "a" ] + ) + ) + } + ) + [ oneOfArg_ ] + + +{-| zeroOrMore: List String -> BackendTask.Glob.Glob (Maybe String) -} +zeroOrMore : List String -> Elm.Expression +zeroOrMore zeroOrMoreArg_ = + Elm.apply + (Elm.value + { importFrom = [ "BackendTask", "Glob" ] + , name = "zeroOrMore" + , annotation = + Just + (Type.function + [ Type.list Type.string ] + (Type.namedWith + [ "BackendTask", "Glob" ] + "Glob" + [ Type.maybe Type.string ] + ) + ) + } + ) + [ Elm.list (List.map Elm.string zeroOrMoreArg_) ] + + +{-| atLeastOne: ( ( String, a ), List ( String, a ) ) -> BackendTask.Glob.Glob ( a, List a ) -} +atLeastOne : Elm.Expression -> Elm.Expression +atLeastOne atLeastOneArg_ = + Elm.apply + (Elm.value + { importFrom = [ "BackendTask", "Glob" ] + , name = "atLeastOne" + , annotation = + Just + (Type.function + [ Type.tuple + (Type.tuple Type.string (Type.var "a")) + (Type.list (Type.tuple Type.string (Type.var "a")) + ) + ] + (Type.namedWith + [ "BackendTask", "Glob" ] + "Glob" + [ Type.tuple + (Type.var "a") + (Type.list (Type.var "a")) + ] + ) + ) + } + ) + [ atLeastOneArg_ ] + + +{-| In order to get match data from your glob, turn it into a `BackendTask` with this function. + +toBackendTask: BackendTask.Glob.Glob a -> BackendTask.BackendTask error (List a) +-} +toBackendTask : Elm.Expression -> Elm.Expression +toBackendTask toBackendTaskArg_ = + Elm.apply + (Elm.value + { importFrom = [ "BackendTask", "Glob" ] + , name = "toBackendTask" + , annotation = + Just + (Type.function + [ Type.namedWith + [ "BackendTask", "Glob" ] + "Glob" + [ Type.var "a" ] + ] + (Type.namedWith + [ "BackendTask" ] + "BackendTask" + [ Type.var "error", Type.list (Type.var "a") ] + ) + ) + } + ) + [ toBackendTaskArg_ ] + + +{-| Same as toBackendTask, but lets you set custom glob options. For example, to list folders instead of files, + + import BackendTask.Glob as Glob exposing (OnlyFolders, defaultOptions) + + matchingFiles : Glob a -> BackendTask error (List a) + matchingFiles glob = + glob + |> Glob.toBackendTaskWithOptions { defaultOptions | include = OnlyFolders } + +toBackendTaskWithOptions: + BackendTask.Glob.Options + -> BackendTask.Glob.Glob a + -> BackendTask.BackendTask error (List a) +-} +toBackendTaskWithOptions : Elm.Expression -> Elm.Expression -> Elm.Expression +toBackendTaskWithOptions toBackendTaskWithOptionsArg_ toBackendTaskWithOptionsArg_0 = + Elm.apply + (Elm.value + { importFrom = [ "BackendTask", "Glob" ] + , name = "toBackendTaskWithOptions" + , annotation = + Just + (Type.function + [ Type.namedWith + [ "BackendTask", "Glob" ] + "Options" + [] + , Type.namedWith + [ "BackendTask", "Glob" ] + "Glob" + [ Type.var "a" ] + ] + (Type.namedWith + [ "BackendTask" ] + "BackendTask" + [ Type.var "error", Type.list (Type.var "a") ] + ) + ) + } + ) + [ toBackendTaskWithOptionsArg_, toBackendTaskWithOptionsArg_0 ] + + +{-| The default options used in [`toBackendTask`](#toBackendTask). To use a custom set of options, use [`toBackendTaskWithOptions`](#toBackendTaskWithOptions). + +defaultOptions: BackendTask.Glob.Options +-} +defaultOptions : Elm.Expression +defaultOptions = + Elm.value + { importFrom = [ "BackendTask", "Glob" ] + , name = "defaultOptions" + , annotation = + Just (Type.namedWith [ "BackendTask", "Glob" ] "Options" []) + } + + +annotation_ : + { glob : Type.Annotation -> Type.Annotation + , fileStats : Type.Annotation + , options : Type.Annotation + , include : Type.Annotation + } +annotation_ = + { glob = + \globArg0 -> + Type.alias + moduleName_ + "Glob" + [ globArg0 ] + (Type.namedWith + [ "BackendTask", "Internal", "Glob" ] + "Glob" + [ Type.var "a" ] + ) + , fileStats = + Type.alias + moduleName_ + "FileStats" + [] + (Type.record + [ ( "fullPath", Type.string ) + , ( "sizeInBytes", Type.int ) + , ( "lastContentChange", Type.namedWith [ "Time" ] "Posix" [] ) + , ( "lastAccess", Type.namedWith [ "Time" ] "Posix" [] ) + , ( "lastFileChange", Type.namedWith [ "Time" ] "Posix" [] ) + , ( "createdAt", Type.namedWith [ "Time" ] "Posix" [] ) + , ( "isDirectory", Type.bool ) + ] + ) + , options = + Type.alias + moduleName_ + "Options" + [] + (Type.record + [ ( "includeDotFiles", Type.bool ) + , ( "include" + , Type.namedWith [ "BackendTask", "Glob" ] "Include" [] + ) + , ( "followSymbolicLinks", Type.bool ) + , ( "caseSensitiveMatch", Type.bool ) + , ( "gitignore", Type.bool ) + , ( "maxDepth", Type.maybe Type.int ) + ] + ) + , include = Type.namedWith [ "BackendTask", "Glob" ] "Include" [] + } + + +make_ : + { fileStats : + { fullPath : Elm.Expression + , sizeInBytes : Elm.Expression + , lastContentChange : Elm.Expression + , lastAccess : Elm.Expression + , lastFileChange : Elm.Expression + , createdAt : Elm.Expression + , isDirectory : Elm.Expression + } + -> Elm.Expression + , options : + { includeDotFiles : Elm.Expression + , include : Elm.Expression + , followSymbolicLinks : Elm.Expression + , caseSensitiveMatch : Elm.Expression + , gitignore : Elm.Expression + , maxDepth : Elm.Expression + } + -> Elm.Expression + , onlyFiles : Elm.Expression + , onlyFolders : Elm.Expression + , filesAndFolders : Elm.Expression + } +make_ = + { fileStats = + \fileStats_args -> + Elm.withType + (Type.alias + [ "BackendTask", "Glob" ] + "FileStats" + [] + (Type.record + [ ( "fullPath", Type.string ) + , ( "sizeInBytes", Type.int ) + , ( "lastContentChange" + , Type.namedWith [ "Time" ] "Posix" [] + ) + , ( "lastAccess" + , Type.namedWith [ "Time" ] "Posix" [] + ) + , ( "lastFileChange" + , Type.namedWith [ "Time" ] "Posix" [] + ) + , ( "createdAt" + , Type.namedWith [ "Time" ] "Posix" [] + ) + , ( "isDirectory", Type.bool ) + ] + ) + ) + (Elm.record + [ Tuple.pair "fullPath" fileStats_args.fullPath + , Tuple.pair "sizeInBytes" fileStats_args.sizeInBytes + , Tuple.pair + "lastContentChange" + fileStats_args.lastContentChange + , Tuple.pair "lastAccess" fileStats_args.lastAccess + , Tuple.pair "lastFileChange" fileStats_args.lastFileChange + , Tuple.pair "createdAt" fileStats_args.createdAt + , Tuple.pair "isDirectory" fileStats_args.isDirectory + ] + ) + , options = + \options_args -> + Elm.withType + (Type.alias + [ "BackendTask", "Glob" ] + "Options" + [] + (Type.record + [ ( "includeDotFiles", Type.bool ) + , ( "include" + , Type.namedWith + [ "BackendTask", "Glob" ] + "Include" + [] + ) + , ( "followSymbolicLinks", Type.bool ) + , ( "caseSensitiveMatch", Type.bool ) + , ( "gitignore", Type.bool ) + , ( "maxDepth", Type.maybe Type.int ) + ] + ) + ) + (Elm.record + [ Tuple.pair "includeDotFiles" options_args.includeDotFiles + , Tuple.pair "include" options_args.include + , Tuple.pair + "followSymbolicLinks" + options_args.followSymbolicLinks + , Tuple.pair + "caseSensitiveMatch" + options_args.caseSensitiveMatch + , Tuple.pair "gitignore" options_args.gitignore + , Tuple.pair "maxDepth" options_args.maxDepth + ] + ) + , onlyFiles = + Elm.value + { importFrom = [ "BackendTask", "Glob" ] + , name = "OnlyFiles" + , annotation = Just (Type.namedWith [] "Include" []) + } + , onlyFolders = + Elm.value + { importFrom = [ "BackendTask", "Glob" ] + , name = "OnlyFolders" + , annotation = Just (Type.namedWith [] "Include" []) + } + , filesAndFolders = + Elm.value + { importFrom = [ "BackendTask", "Glob" ] + , name = "FilesAndFolders" + , annotation = Just (Type.namedWith [] "Include" []) + } + } + + +caseOf_ : + { include : + Elm.Expression + -> { onlyFiles : Elm.Expression + , onlyFolders : Elm.Expression + , filesAndFolders : Elm.Expression + } + -> Elm.Expression + } +caseOf_ = + { include = + \includeExpression includeTags -> + Elm.Case.custom + includeExpression + (Type.namedWith [ "BackendTask", "Glob" ] "Include" []) + [ Elm.Case.branch + (Elm.Arg.customType "OnlyFiles" includeTags.onlyFiles) + Basics.identity + , Elm.Case.branch + (Elm.Arg.customType "OnlyFolders" includeTags.onlyFolders) + Basics.identity + , Elm.Case.branch + (Elm.Arg.customType + "FilesAndFolders" + includeTags.filesAndFolders + ) + Basics.identity + ] + } + + +call_ : + { capture : Elm.Expression -> Elm.Expression -> Elm.Expression + , match : Elm.Expression -> Elm.Expression -> Elm.Expression + , fromString : Elm.Expression -> Elm.Expression + , fromStringWithOptions : Elm.Expression -> Elm.Expression -> Elm.Expression + , captureFilePath : Elm.Expression -> Elm.Expression + , captureStats : Elm.Expression -> Elm.Expression + , expectUniqueMatch : Elm.Expression -> Elm.Expression + , expectUniqueMatchFromList : Elm.Expression -> Elm.Expression + , literal : Elm.Expression -> Elm.Expression + , map : Elm.Expression -> Elm.Expression -> Elm.Expression + , succeed : Elm.Expression -> Elm.Expression + , oneOf : Elm.Expression -> Elm.Expression + , zeroOrMore : Elm.Expression -> Elm.Expression + , atLeastOne : Elm.Expression -> Elm.Expression + , toBackendTask : Elm.Expression -> Elm.Expression + , toBackendTaskWithOptions : + Elm.Expression -> Elm.Expression -> Elm.Expression + } +call_ = + { capture = + \captureArg_ captureArg_0 -> + Elm.apply + (Elm.value + { importFrom = [ "BackendTask", "Glob" ] + , name = "capture" + , annotation = + Just + (Type.function + [ Type.namedWith + [ "BackendTask", "Glob" ] + "Glob" + [ Type.var "a" ] + , Type.namedWith + [ "BackendTask", "Glob" ] + "Glob" + [ Type.function + [ Type.var "a" ] + (Type.var "value") + ] + ] + (Type.namedWith + [ "BackendTask", "Glob" ] + "Glob" + [ Type.var "value" ] + ) + ) + } + ) + [ captureArg_, captureArg_0 ] + , match = + \matchArg_ matchArg_0 -> + Elm.apply + (Elm.value + { importFrom = [ "BackendTask", "Glob" ] + , name = "match" + , annotation = + Just + (Type.function + [ Type.namedWith + [ "BackendTask", "Glob" ] + "Glob" + [ Type.var "a" ] + , Type.namedWith + [ "BackendTask", "Glob" ] + "Glob" + [ Type.var "value" ] + ] + (Type.namedWith + [ "BackendTask", "Glob" ] + "Glob" + [ Type.var "value" ] + ) + ) + } + ) + [ matchArg_, matchArg_0 ] + , fromString = + \fromStringArg_ -> + Elm.apply + (Elm.value + { importFrom = [ "BackendTask", "Glob" ] + , name = "fromString" + , annotation = + Just + (Type.function + [ Type.string ] + (Type.namedWith + [ "BackendTask" ] + "BackendTask" + [ Type.var "error" + , Type.list Type.string + ] + ) + ) + } + ) + [ fromStringArg_ ] + , fromStringWithOptions = + \fromStringWithOptionsArg_ fromStringWithOptionsArg_0 -> + Elm.apply + (Elm.value + { importFrom = [ "BackendTask", "Glob" ] + , name = "fromStringWithOptions" + , annotation = + Just + (Type.function + [ Type.namedWith + [ "BackendTask", "Glob" ] + "Options" + [] + , Type.string + ] + (Type.namedWith + [ "BackendTask" ] + "BackendTask" + [ Type.var "error" + , Type.list Type.string + ] + ) + ) + } + ) + [ fromStringWithOptionsArg_, fromStringWithOptionsArg_0 ] + , captureFilePath = + \captureFilePathArg_ -> + Elm.apply + (Elm.value + { importFrom = [ "BackendTask", "Glob" ] + , name = "captureFilePath" + , annotation = + Just + (Type.function + [ Type.namedWith + [ "BackendTask", "Glob" ] + "Glob" + [ Type.function + [ Type.string ] + (Type.var "value") + ] + ] + (Type.namedWith + [ "BackendTask", "Glob" ] + "Glob" + [ Type.var "value" ] + ) + ) + } + ) + [ captureFilePathArg_ ] + , captureStats = + \captureStatsArg_ -> + Elm.apply + (Elm.value + { importFrom = [ "BackendTask", "Glob" ] + , name = "captureStats" + , annotation = + Just + (Type.function + [ Type.namedWith + [ "BackendTask", "Glob" ] + "Glob" + [ Type.function + [ Type.namedWith + [ "BackendTask", "Glob" ] + "FileStats" + [] + ] + (Type.var "value") + ] + ] + (Type.namedWith + [ "BackendTask", "Glob" ] + "Glob" + [ Type.var "value" ] + ) + ) + } + ) + [ captureStatsArg_ ] + , expectUniqueMatch = + \expectUniqueMatchArg_ -> + Elm.apply + (Elm.value + { importFrom = [ "BackendTask", "Glob" ] + , name = "expectUniqueMatch" + , annotation = + Just + (Type.function + [ Type.namedWith + [ "BackendTask", "Glob" ] + "Glob" + [ Type.var "a" ] + ] + (Type.namedWith + [ "BackendTask" ] + "BackendTask" + [ Type.record + [ ( "fatal" + , Type.namedWith + [ "FatalError" ] + "FatalError" + [] + ) + , ( "recoverable", Type.string ) + ] + , Type.var "a" + ] + ) + ) + } + ) + [ expectUniqueMatchArg_ ] + , expectUniqueMatchFromList = + \expectUniqueMatchFromListArg_ -> + Elm.apply + (Elm.value + { importFrom = [ "BackendTask", "Glob" ] + , name = "expectUniqueMatchFromList" + , annotation = + Just + (Type.function + [ Type.list + (Type.namedWith + [ "BackendTask", "Glob" ] + "Glob" + [ Type.var "a" ] + ) + ] + (Type.namedWith + [ "BackendTask" ] + "BackendTask" + [ Type.string, Type.var "a" ] + ) + ) + } + ) + [ expectUniqueMatchFromListArg_ ] + , literal = + \literalArg_ -> + Elm.apply + (Elm.value + { importFrom = [ "BackendTask", "Glob" ] + , name = "literal" + , annotation = + Just + (Type.function + [ Type.string ] + (Type.namedWith + [ "BackendTask", "Glob" ] + "Glob" + [ Type.string ] + ) + ) + } + ) + [ literalArg_ ] + , map = + \mapArg_ mapArg_0 -> + Elm.apply + (Elm.value + { importFrom = [ "BackendTask", "Glob" ] + , name = "map" + , annotation = + Just + (Type.function + [ Type.function + [ Type.var "a" ] + (Type.var "b") + , Type.namedWith + [ "BackendTask", "Glob" ] + "Glob" + [ Type.var "a" ] + ] + (Type.namedWith + [ "BackendTask", "Glob" ] + "Glob" + [ Type.var "b" ] + ) + ) + } + ) + [ mapArg_, mapArg_0 ] + , succeed = + \succeedArg_ -> + Elm.apply + (Elm.value + { importFrom = [ "BackendTask", "Glob" ] + , name = "succeed" + , annotation = + Just + (Type.function + [ Type.var "constructor" ] + (Type.namedWith + [ "BackendTask", "Glob" ] + "Glob" + [ Type.var "constructor" ] + ) + ) + } + ) + [ succeedArg_ ] + , oneOf = + \oneOfArg_ -> + Elm.apply + (Elm.value + { importFrom = [ "BackendTask", "Glob" ] + , name = "oneOf" + , annotation = + Just + (Type.function + [ Type.tuple + (Type.tuple Type.string (Type.var "a")) + (Type.list + (Type.tuple Type.string (Type.var "a")) + ) + ] + (Type.namedWith + [ "BackendTask", "Glob" ] + "Glob" + [ Type.var "a" ] + ) + ) + } + ) + [ oneOfArg_ ] + , zeroOrMore = + \zeroOrMoreArg_ -> + Elm.apply + (Elm.value + { importFrom = [ "BackendTask", "Glob" ] + , name = "zeroOrMore" + , annotation = + Just + (Type.function + [ Type.list Type.string ] + (Type.namedWith + [ "BackendTask", "Glob" ] + "Glob" + [ Type.maybe Type.string ] + ) + ) + } + ) + [ zeroOrMoreArg_ ] + , atLeastOne = + \atLeastOneArg_ -> + Elm.apply + (Elm.value + { importFrom = [ "BackendTask", "Glob" ] + , name = "atLeastOne" + , annotation = + Just + (Type.function + [ Type.tuple + (Type.tuple Type.string (Type.var "a")) + (Type.list + (Type.tuple Type.string (Type.var "a")) + ) + ] + (Type.namedWith + [ "BackendTask", "Glob" ] + "Glob" + [ Type.tuple + (Type.var "a") + (Type.list (Type.var "a")) + ] + ) + ) + } + ) + [ atLeastOneArg_ ] + , toBackendTask = + \toBackendTaskArg_ -> + Elm.apply + (Elm.value + { importFrom = [ "BackendTask", "Glob" ] + , name = "toBackendTask" + , annotation = + Just + (Type.function + [ Type.namedWith + [ "BackendTask", "Glob" ] + "Glob" + [ Type.var "a" ] + ] + (Type.namedWith + [ "BackendTask" ] + "BackendTask" + [ Type.var "error" + , Type.list (Type.var "a") + ] + ) + ) + } + ) + [ toBackendTaskArg_ ] + , toBackendTaskWithOptions = + \toBackendTaskWithOptionsArg_ toBackendTaskWithOptionsArg_0 -> + Elm.apply + (Elm.value + { importFrom = [ "BackendTask", "Glob" ] + , name = "toBackendTaskWithOptions" + , annotation = + Just + (Type.function + [ Type.namedWith + [ "BackendTask", "Glob" ] + "Options" + [] + , Type.namedWith + [ "BackendTask", "Glob" ] + "Glob" + [ Type.var "a" ] + ] + (Type.namedWith + [ "BackendTask" ] + "BackendTask" + [ Type.var "error" + , Type.list (Type.var "a") + ] + ) + ) + } + ) + [ toBackendTaskWithOptionsArg_, toBackendTaskWithOptionsArg_0 ] + } + + +values_ : + { capture : Elm.Expression + , match : Elm.Expression + , fromString : Elm.Expression + , fromStringWithOptions : Elm.Expression + , captureFilePath : Elm.Expression + , wildcard : Elm.Expression + , recursiveWildcard : Elm.Expression + , int : Elm.Expression + , digits : Elm.Expression + , captureStats : Elm.Expression + , expectUniqueMatch : Elm.Expression + , expectUniqueMatchFromList : Elm.Expression + , literal : Elm.Expression + , map : Elm.Expression + , succeed : Elm.Expression + , oneOf : Elm.Expression + , zeroOrMore : Elm.Expression + , atLeastOne : Elm.Expression + , toBackendTask : Elm.Expression + , toBackendTaskWithOptions : Elm.Expression + , defaultOptions : Elm.Expression + } +values_ = + { capture = + Elm.value + { importFrom = [ "BackendTask", "Glob" ] + , name = "capture" + , annotation = + Just + (Type.function + [ Type.namedWith + [ "BackendTask", "Glob" ] + "Glob" + [ Type.var "a" ] + , Type.namedWith + [ "BackendTask", "Glob" ] + "Glob" + [ Type.function [ Type.var "a" ] (Type.var "value") + ] + ] + (Type.namedWith + [ "BackendTask", "Glob" ] + "Glob" + [ Type.var "value" ] + ) + ) + } + , match = + Elm.value + { importFrom = [ "BackendTask", "Glob" ] + , name = "match" + , annotation = + Just + (Type.function + [ Type.namedWith + [ "BackendTask", "Glob" ] + "Glob" + [ Type.var "a" ] + , Type.namedWith + [ "BackendTask", "Glob" ] + "Glob" + [ Type.var "value" ] + ] + (Type.namedWith + [ "BackendTask", "Glob" ] + "Glob" + [ Type.var "value" ] + ) + ) + } + , fromString = + Elm.value + { importFrom = [ "BackendTask", "Glob" ] + , name = "fromString" + , annotation = + Just + (Type.function + [ Type.string ] + (Type.namedWith + [ "BackendTask" ] + "BackendTask" + [ Type.var "error", Type.list Type.string ] + ) + ) + } + , fromStringWithOptions = + Elm.value + { importFrom = [ "BackendTask", "Glob" ] + , name = "fromStringWithOptions" + , annotation = + Just + (Type.function + [ Type.namedWith [ "BackendTask", "Glob" ] "Options" [] + , Type.string + ] + (Type.namedWith + [ "BackendTask" ] + "BackendTask" + [ Type.var "error", Type.list Type.string ] + ) + ) + } + , captureFilePath = + Elm.value + { importFrom = [ "BackendTask", "Glob" ] + , name = "captureFilePath" + , annotation = + Just + (Type.function + [ Type.namedWith + [ "BackendTask", "Glob" ] + "Glob" + [ Type.function [ Type.string ] (Type.var "value") + ] + ] + (Type.namedWith + [ "BackendTask", "Glob" ] + "Glob" + [ Type.var "value" ] + ) + ) + } + , wildcard = + Elm.value + { importFrom = [ "BackendTask", "Glob" ] + , name = "wildcard" + , annotation = + Just + (Type.namedWith + [ "BackendTask", "Glob" ] + "Glob" + [ Type.string ] + ) + } + , recursiveWildcard = + Elm.value + { importFrom = [ "BackendTask", "Glob" ] + , name = "recursiveWildcard" + , annotation = + Just + (Type.namedWith + [ "BackendTask", "Glob" ] + "Glob" + [ Type.list Type.string ] + ) + } + , int = + Elm.value + { importFrom = [ "BackendTask", "Glob" ] + , name = "int" + , annotation = + Just + (Type.namedWith + [ "BackendTask", "Glob" ] + "Glob" + [ Type.int ] + ) + } + , digits = + Elm.value + { importFrom = [ "BackendTask", "Glob" ] + , name = "digits" + , annotation = + Just + (Type.namedWith + [ "BackendTask", "Glob" ] + "Glob" + [ Type.string ] + ) + } + , captureStats = + Elm.value + { importFrom = [ "BackendTask", "Glob" ] + , name = "captureStats" + , annotation = + Just + (Type.function + [ Type.namedWith + [ "BackendTask", "Glob" ] + "Glob" + [ Type.function + [ Type.namedWith + [ "BackendTask", "Glob" ] + "FileStats" + [] + ] + (Type.var "value") + ] + ] + (Type.namedWith + [ "BackendTask", "Glob" ] + "Glob" + [ Type.var "value" ] + ) + ) + } + , expectUniqueMatch = + Elm.value + { importFrom = [ "BackendTask", "Glob" ] + , name = "expectUniqueMatch" + , annotation = + Just + (Type.function + [ Type.namedWith + [ "BackendTask", "Glob" ] + "Glob" + [ Type.var "a" ] + ] + (Type.namedWith + [ "BackendTask" ] + "BackendTask" + [ Type.record + [ ( "fatal" + , Type.namedWith + [ "FatalError" ] + "FatalError" + [] + ) + , ( "recoverable", Type.string ) + ] + , Type.var "a" + ] + ) + ) + } + , expectUniqueMatchFromList = + Elm.value + { importFrom = [ "BackendTask", "Glob" ] + , name = "expectUniqueMatchFromList" + , annotation = + Just + (Type.function + [ Type.list + (Type.namedWith + [ "BackendTask", "Glob" ] + "Glob" + [ Type.var "a" ] + ) + ] + (Type.namedWith + [ "BackendTask" ] + "BackendTask" + [ Type.string, Type.var "a" ] + ) + ) + } + , literal = + Elm.value + { importFrom = [ "BackendTask", "Glob" ] + , name = "literal" + , annotation = + Just + (Type.function + [ Type.string ] + (Type.namedWith + [ "BackendTask", "Glob" ] + "Glob" + [ Type.string ] + ) + ) + } + , map = + Elm.value + { importFrom = [ "BackendTask", "Glob" ] + , name = "map" + , annotation = + Just + (Type.function + [ Type.function [ Type.var "a" ] (Type.var "b") + , Type.namedWith + [ "BackendTask", "Glob" ] + "Glob" + [ Type.var "a" ] + ] + (Type.namedWith + [ "BackendTask", "Glob" ] + "Glob" + [ Type.var "b" ] + ) + ) + } + , succeed = + Elm.value + { importFrom = [ "BackendTask", "Glob" ] + , name = "succeed" + , annotation = + Just + (Type.function + [ Type.var "constructor" ] + (Type.namedWith + [ "BackendTask", "Glob" ] + "Glob" + [ Type.var "constructor" ] + ) + ) + } + , oneOf = + Elm.value + { importFrom = [ "BackendTask", "Glob" ] + , name = "oneOf" + , annotation = + Just + (Type.function + [ Type.tuple + (Type.tuple Type.string (Type.var "a")) + (Type.list (Type.tuple Type.string (Type.var "a"))) + ] + (Type.namedWith + [ "BackendTask", "Glob" ] + "Glob" + [ Type.var "a" ] + ) + ) + } + , zeroOrMore = + Elm.value + { importFrom = [ "BackendTask", "Glob" ] + , name = "zeroOrMore" + , annotation = + Just + (Type.function + [ Type.list Type.string ] + (Type.namedWith + [ "BackendTask", "Glob" ] + "Glob" + [ Type.maybe Type.string ] + ) + ) + } + , atLeastOne = + Elm.value + { importFrom = [ "BackendTask", "Glob" ] + , name = "atLeastOne" + , annotation = + Just + (Type.function + [ Type.tuple + (Type.tuple Type.string (Type.var "a")) + (Type.list (Type.tuple Type.string (Type.var "a"))) + ] + (Type.namedWith + [ "BackendTask", "Glob" ] + "Glob" + [ Type.tuple + (Type.var "a") + (Type.list (Type.var "a")) + ] + ) + ) + } + , toBackendTask = + Elm.value + { importFrom = [ "BackendTask", "Glob" ] + , name = "toBackendTask" + , annotation = + Just + (Type.function + [ Type.namedWith + [ "BackendTask", "Glob" ] + "Glob" + [ Type.var "a" ] + ] + (Type.namedWith + [ "BackendTask" ] + "BackendTask" + [ Type.var "error", Type.list (Type.var "a") ] + ) + ) + } + , toBackendTaskWithOptions = + Elm.value + { importFrom = [ "BackendTask", "Glob" ] + , name = "toBackendTaskWithOptions" + , annotation = + Just + (Type.function + [ Type.namedWith [ "BackendTask", "Glob" ] "Options" [] + , Type.namedWith + [ "BackendTask", "Glob" ] + "Glob" + [ Type.var "a" ] + ] + (Type.namedWith + [ "BackendTask" ] + "BackendTask" + [ Type.var "error", Type.list (Type.var "a") ] + ) + ) + } + , defaultOptions = + Elm.value + { importFrom = [ "BackendTask", "Glob" ] + , name = "defaultOptions" + , annotation = + Just (Type.namedWith [ "BackendTask", "Glob" ] "Options" []) + } + } \ No newline at end of file diff --git a/elm-open-api-codegen/src/Gen/BackendTask/Http.elm b/elm-open-api-codegen/src/Gen/BackendTask/Http.elm new file mode 100644 index 00000000..bc9b36df --- /dev/null +++ b/elm-open-api-codegen/src/Gen/BackendTask/Http.elm @@ -0,0 +1,1663 @@ +module Gen.BackendTask.Http exposing + ( moduleName_, get, getJson, post, expectString, expectJson + , expectBytes, expectWhatever, request, emptyBody, stringBody, jsonBody, bytesBody + , getWithOptions, withMetadata, annotation_, make_, caseOf_, call_, values_ + ) + +{-| +# Generated bindings for BackendTask.Http + +@docs moduleName_, get, getJson, post, expectString, expectJson +@docs expectBytes, expectWhatever, request, emptyBody, stringBody, jsonBody +@docs bytesBody, getWithOptions, withMetadata, annotation_, make_, caseOf_ +@docs call_, values_ +-} + + +import Elm +import Elm.Annotation as Type +import Elm.Arg +import Elm.Case + + +{-| The name of this module. -} +moduleName_ : List String +moduleName_ = + [ "BackendTask", "Http" ] + + +{-| A simplified helper around [`BackendTask.Http.getWithOptions`](#getWithOptions), which builds up a GET request with +the default retries, timeout, and HTTP caching options. If you need to configure those options or include HTTP request headers, +use the more flexible `getWithOptions`. + + import BackendTask + import BackendTask.Http + import FatalError exposing (FatalError) + + getRequest : BackendTask (FatalError Error) String + getRequest = + BackendTask.Http.get + "https://api.github.com/repos/dillonkearns/elm-pages" + BackendTask.Http.expectString + +get: + String + -> BackendTask.Http.Expect a + -> BackendTask.BackendTask { fatal : FatalError.FatalError + , recoverable : BackendTask.Http.Error + } a +-} +get : String -> Elm.Expression -> Elm.Expression +get getArg_ getArg_0 = + Elm.apply + (Elm.value + { importFrom = [ "BackendTask", "Http" ] + , name = "get" + , annotation = + Just + (Type.function + [ Type.string + , Type.namedWith + [ "BackendTask", "Http" ] + "Expect" + [ Type.var "a" ] + ] + (Type.namedWith + [ "BackendTask" ] + "BackendTask" + [ Type.record + [ ( "fatal" + , Type.namedWith + [ "FatalError" ] + "FatalError" + [] + ) + , ( "recoverable" + , Type.namedWith + [ "BackendTask", "Http" ] + "Error" + [] + ) + ] + , Type.var "a" + ] + ) + ) + } + ) + [ Elm.string getArg_, getArg_0 ] + + +{-| A simplified helper around [`BackendTask.Http.get`](#get), which builds up a BackendTask.Http GET request with `expectJson`. + + import BackendTask + import BackendTask.Http + import FatalError exposing (FatalError) + import Json.Decode as Decode exposing (Decoder) + + getRequest : BackendTask (FatalError Error) Int + getRequest = + BackendTask.Http.getJson + "https://api.github.com/repos/dillonkearns/elm-pages" + (Decode.field "stargazers_count" Decode.int) + +getJson: + String + -> Json.Decode.Decoder a + -> BackendTask.BackendTask { fatal : FatalError.FatalError + , recoverable : BackendTask.Http.Error + } a +-} +getJson : String -> Elm.Expression -> Elm.Expression +getJson getJsonArg_ getJsonArg_0 = + Elm.apply + (Elm.value + { importFrom = [ "BackendTask", "Http" ] + , name = "getJson" + , annotation = + Just + (Type.function + [ Type.string + , Type.namedWith + [ "Json", "Decode" ] + "Decoder" + [ Type.var "a" ] + ] + (Type.namedWith + [ "BackendTask" ] + "BackendTask" + [ Type.record + [ ( "fatal" + , Type.namedWith + [ "FatalError" ] + "FatalError" + [] + ) + , ( "recoverable" + , Type.namedWith + [ "BackendTask", "Http" ] + "Error" + [] + ) + ] + , Type.var "a" + ] + ) + ) + } + ) + [ Elm.string getJsonArg_, getJsonArg_0 ] + + +{-| post: + String + -> BackendTask.Http.Body + -> BackendTask.Http.Expect a + -> BackendTask.BackendTask { fatal : FatalError.FatalError + , recoverable : BackendTask.Http.Error + } a +-} +post : String -> Elm.Expression -> Elm.Expression -> Elm.Expression +post postArg_ postArg_0 postArg_1 = + Elm.apply + (Elm.value + { importFrom = [ "BackendTask", "Http" ] + , name = "post" + , annotation = + Just + (Type.function + [ Type.string + , Type.namedWith [ "BackendTask", "Http" ] "Body" [] + , Type.namedWith + [ "BackendTask", "Http" ] + "Expect" + [ Type.var "a" ] + ] + (Type.namedWith + [ "BackendTask" ] + "BackendTask" + [ Type.record + [ ( "fatal" + , Type.namedWith + [ "FatalError" ] + "FatalError" + [] + ) + , ( "recoverable" + , Type.namedWith + [ "BackendTask", "Http" ] + "Error" + [] + ) + ] + , Type.var "a" + ] + ) + ) + } + ) + [ Elm.string postArg_, postArg_0, postArg_1 ] + + +{-| Gives the HTTP response body as a raw String. + + import BackendTask exposing (BackendTask) + import BackendTask.Http + + request : BackendTask String + request = + BackendTask.Http.request + { url = "https://example.com/file.txt" + , method = "GET" + , headers = [] + , body = BackendTask.Http.emptyBody + } + BackendTask.Http.expectString + +expectString: BackendTask.Http.Expect String +-} +expectString : Elm.Expression +expectString = + Elm.value + { importFrom = [ "BackendTask", "Http" ] + , name = "expectString" + , annotation = + Just + (Type.namedWith + [ "BackendTask", "Http" ] + "Expect" + [ Type.string ] + ) + } + + +{-| Handle the incoming response as JSON and don't optimize the asset and strip out unused values. +Be sure to use the `BackendTask.Http.request` function if you want an optimized request that +strips out unused JSON to optimize your asset size. This function makes sense to use for things like a GraphQL request +where the JSON payload is already trimmed down to the data you explicitly requested. + +If the function you pass to `expectString` yields an `Err`, then you will get a build error that will +fail your `elm-pages` build and print out the String from the `Err`. + +expectJson: Json.Decode.Decoder value -> BackendTask.Http.Expect value +-} +expectJson : Elm.Expression -> Elm.Expression +expectJson expectJsonArg_ = + Elm.apply + (Elm.value + { importFrom = [ "BackendTask", "Http" ] + , name = "expectJson" + , annotation = + Just + (Type.function + [ Type.namedWith + [ "Json", "Decode" ] + "Decoder" + [ Type.var "value" ] + ] + (Type.namedWith + [ "BackendTask", "Http" ] + "Expect" + [ Type.var "value" ] + ) + ) + } + ) + [ expectJsonArg_ ] + + +{-| expectBytes: Bytes.Decode.Decoder value -> BackendTask.Http.Expect value -} +expectBytes : Elm.Expression -> Elm.Expression +expectBytes expectBytesArg_ = + Elm.apply + (Elm.value + { importFrom = [ "BackendTask", "Http" ] + , name = "expectBytes" + , annotation = + Just + (Type.function + [ Type.namedWith + [ "Bytes", "Decode" ] + "Decoder" + [ Type.var "value" ] + ] + (Type.namedWith + [ "BackendTask", "Http" ] + "Expect" + [ Type.var "value" ] + ) + ) + } + ) + [ expectBytesArg_ ] + + +{-| expectWhatever: value -> BackendTask.Http.Expect value -} +expectWhatever : Elm.Expression -> Elm.Expression +expectWhatever expectWhateverArg_ = + Elm.apply + (Elm.value + { importFrom = [ "BackendTask", "Http" ] + , name = "expectWhatever" + , annotation = + Just + (Type.function + [ Type.var "value" ] + (Type.namedWith + [ "BackendTask", "Http" ] + "Expect" + [ Type.var "value" ] + ) + ) + } + ) + [ expectWhateverArg_ ] + + +{-| request: + { url : String + , method : String + , headers : List ( String, String ) + , body : BackendTask.Http.Body + , retries : Maybe Int + , timeoutInMs : Maybe Int + } + -> BackendTask.Http.Expect a + -> BackendTask.BackendTask { fatal : FatalError.FatalError + , recoverable : BackendTask.Http.Error + } a +-} +request : + { url : String + , method : String + , headers : List Elm.Expression + , body : Elm.Expression + , retries : Elm.Expression + , timeoutInMs : Elm.Expression + } + -> Elm.Expression + -> Elm.Expression +request requestArg_ requestArg_0 = + Elm.apply + (Elm.value + { importFrom = [ "BackendTask", "Http" ] + , name = "request" + , annotation = + Just + (Type.function + [ Type.record + [ ( "url", Type.string ) + , ( "method", Type.string ) + , ( "headers" + , Type.list (Type.tuple Type.string Type.string) + ) + , ( "body" + , Type.namedWith + [ "BackendTask", "Http" ] + "Body" + [] + ) + , ( "retries", Type.maybe Type.int ) + , ( "timeoutInMs", Type.maybe Type.int ) + ] + , Type.namedWith + [ "BackendTask", "Http" ] + "Expect" + [ Type.var "a" ] + ] + (Type.namedWith + [ "BackendTask" ] + "BackendTask" + [ Type.record + [ ( "fatal" + , Type.namedWith + [ "FatalError" ] + "FatalError" + [] + ) + , ( "recoverable" + , Type.namedWith + [ "BackendTask", "Http" ] + "Error" + [] + ) + ] + , Type.var "a" + ] + ) + ) + } + ) + [ Elm.record + [ Tuple.pair "url" (Elm.string requestArg_.url) + , Tuple.pair "method" (Elm.string requestArg_.method) + , Tuple.pair "headers" (Elm.list requestArg_.headers) + , Tuple.pair "body" requestArg_.body + , Tuple.pair "retries" requestArg_.retries + , Tuple.pair "timeoutInMs" requestArg_.timeoutInMs + ] + , requestArg_0 + ] + + +{-| Build an empty body for a BackendTask.Http request. See [elm/http's `Http.emptyBody`](https://package.elm-lang.org/packages/elm/http/latest/Http#emptyBody). + +emptyBody: BackendTask.Http.Body +-} +emptyBody : Elm.Expression +emptyBody = + Elm.value + { importFrom = [ "BackendTask", "Http" ] + , name = "emptyBody" + , annotation = Just (Type.namedWith [ "BackendTask", "Http" ] "Body" []) + } + + +{-| Builds a string body for a BackendTask.Http request. See [elm/http's `Http.stringBody`](https://package.elm-lang.org/packages/elm/http/latest/Http#stringBody). + +Note from the `elm/http` docs: + +> The first argument is a [MIME type](https://en.wikipedia.org/wiki/Media_type) of the body. Some servers are strict about this! + +stringBody: String -> String -> BackendTask.Http.Body +-} +stringBody : String -> String -> Elm.Expression +stringBody stringBodyArg_ stringBodyArg_0 = + Elm.apply + (Elm.value + { importFrom = [ "BackendTask", "Http" ] + , name = "stringBody" + , annotation = + Just + (Type.function + [ Type.string, Type.string ] + (Type.namedWith [ "BackendTask", "Http" ] "Body" []) + ) + } + ) + [ Elm.string stringBodyArg_, Elm.string stringBodyArg_0 ] + + +{-| Builds a JSON body for a BackendTask.Http request. See [elm/http's `Http.jsonBody`](https://package.elm-lang.org/packages/elm/http/latest/Http#jsonBody). + +jsonBody: Json.Encode.Value -> BackendTask.Http.Body +-} +jsonBody : Elm.Expression -> Elm.Expression +jsonBody jsonBodyArg_ = + Elm.apply + (Elm.value + { importFrom = [ "BackendTask", "Http" ] + , name = "jsonBody" + , annotation = + Just + (Type.function + [ Type.namedWith [ "Json", "Encode" ] "Value" [] ] + (Type.namedWith [ "BackendTask", "Http" ] "Body" []) + ) + } + ) + [ jsonBodyArg_ ] + + +{-| Build a body from `Bytes` for a BackendTask.Http request. See [elm/http's `Http.bytesBody`](https://package.elm-lang.org/packages/elm/http/latest/Http#bytesBody). + +bytesBody: String -> Bytes.Bytes -> BackendTask.Http.Body +-} +bytesBody : String -> Elm.Expression -> Elm.Expression +bytesBody bytesBodyArg_ bytesBodyArg_0 = + Elm.apply + (Elm.value + { importFrom = [ "BackendTask", "Http" ] + , name = "bytesBody" + , annotation = + Just + (Type.function + [ Type.string, Type.namedWith [ "Bytes" ] "Bytes" [] ] + (Type.namedWith [ "BackendTask", "Http" ] "Body" []) + ) + } + ) + [ Elm.string bytesBodyArg_, bytesBodyArg_0 ] + + +{-| Perform a GET request, with some additional options for the HTTP request, including options for caching behavior. + + - `retries` - Default is 0. Will try performing request again if set to a number greater than 0. + - `timeoutInMs` - Default is no timeout. + - `cacheStrategy` - The [caching options are passed to the NPM package `make-fetch-happen`](https://github.com/npm/make-fetch-happen#opts-cache) + - `cachePath` - override the default directory for the local HTTP cache. This can be helpful if you want more granular control to clear some HTTP caches more or less frequently than others. Or you may want to preserve the local cache for some requests in your build server, but not store the cache for other requests. + +getWithOptions: + { url : String + , expect : BackendTask.Http.Expect a + , headers : List ( String, String ) + , cacheStrategy : Maybe BackendTask.Http.CacheStrategy + , retries : Maybe Int + , timeoutInMs : Maybe Int + , cachePath : Maybe String + } + -> BackendTask.BackendTask { fatal : FatalError.FatalError + , recoverable : BackendTask.Http.Error + } a +-} +getWithOptions : + { url : String + , expect : Elm.Expression + , headers : List Elm.Expression + , cacheStrategy : Elm.Expression + , retries : Elm.Expression + , timeoutInMs : Elm.Expression + , cachePath : Elm.Expression + } + -> Elm.Expression +getWithOptions getWithOptionsArg_ = + Elm.apply + (Elm.value + { importFrom = [ "BackendTask", "Http" ] + , name = "getWithOptions" + , annotation = + Just + (Type.function + [ Type.record + [ ( "url", Type.string ) + , ( "expect" + , Type.namedWith + [ "BackendTask", "Http" ] + "Expect" + [ Type.var "a" ] + ) + , ( "headers" + , Type.list (Type.tuple Type.string Type.string) + ) + , ( "cacheStrategy" + , Type.maybe + (Type.namedWith + [ "BackendTask", "Http" ] + "CacheStrategy" + [] + ) + ) + , ( "retries", Type.maybe Type.int ) + , ( "timeoutInMs", Type.maybe Type.int ) + , ( "cachePath", Type.maybe Type.string ) + ] + ] + (Type.namedWith + [ "BackendTask" ] + "BackendTask" + [ Type.record + [ ( "fatal" + , Type.namedWith + [ "FatalError" ] + "FatalError" + [] + ) + , ( "recoverable" + , Type.namedWith + [ "BackendTask", "Http" ] + "Error" + [] + ) + ] + , Type.var "a" + ] + ) + ) + } + ) + [ Elm.record + [ Tuple.pair "url" (Elm.string getWithOptionsArg_.url) + , Tuple.pair "expect" getWithOptionsArg_.expect + , Tuple.pair "headers" (Elm.list getWithOptionsArg_.headers) + , Tuple.pair "cacheStrategy" getWithOptionsArg_.cacheStrategy + , Tuple.pair "retries" getWithOptionsArg_.retries + , Tuple.pair "timeoutInMs" getWithOptionsArg_.timeoutInMs + , Tuple.pair "cachePath" getWithOptionsArg_.cachePath + ] + ] + + +{-| withMetadata: + (BackendTask.Http.Metadata -> value -> combined) + -> BackendTask.Http.Expect value + -> BackendTask.Http.Expect combined +-} +withMetadata : + (Elm.Expression -> Elm.Expression -> Elm.Expression) + -> Elm.Expression + -> Elm.Expression +withMetadata withMetadataArg_ withMetadataArg_0 = + Elm.apply + (Elm.value + { importFrom = [ "BackendTask", "Http" ] + , name = "withMetadata" + , annotation = + Just + (Type.function + [ Type.function + [ Type.namedWith + [ "BackendTask", "Http" ] + "Metadata" + [] + , Type.var "value" + ] + (Type.var "combined") + , Type.namedWith + [ "BackendTask", "Http" ] + "Expect" + [ Type.var "value" ] + ] + (Type.namedWith + [ "BackendTask", "Http" ] + "Expect" + [ Type.var "combined" ] + ) + ) + } + ) + [ Elm.functionReduced + "withMetadataUnpack" + (\functionReducedUnpack -> + Elm.functionReduced + "unpack" + (withMetadataArg_ functionReducedUnpack) + ) + , withMetadataArg_0 + ] + + +annotation_ : + { expect : Type.Annotation -> Type.Annotation + , error : Type.Annotation + , body : Type.Annotation + , cacheStrategy : Type.Annotation + , metadata : Type.Annotation + } +annotation_ = + { expect = + \expectArg0 -> + Type.namedWith [ "BackendTask", "Http" ] "Expect" [ expectArg0 ] + , error = Type.namedWith [ "BackendTask", "Http" ] "Error" [] + , body = + Type.alias + moduleName_ + "Body" + [] + (Type.namedWith [ "Pages", "Internal", "StaticHttpBody" ] "Body" []) + , cacheStrategy = + Type.namedWith [ "BackendTask", "Http" ] "CacheStrategy" [] + , metadata = + Type.alias + moduleName_ + "Metadata" + [] + (Type.record + [ ( "url", Type.string ) + , ( "statusCode", Type.int ) + , ( "statusText", Type.string ) + , ( "headers" + , Type.namedWith + [ "Dict" ] + "Dict" + [ Type.string, Type.string ] + ) + ] + ) + } + + +make_ : + { badUrl : Elm.Expression -> Elm.Expression + , timeout : Elm.Expression + , networkError : Elm.Expression + , badStatus : Elm.Expression -> Elm.Expression -> Elm.Expression + , badBody : Elm.Expression -> Elm.Expression -> Elm.Expression + , ignoreCache : Elm.Expression + , forceRevalidate : Elm.Expression + , forceReload : Elm.Expression + , forceCache : Elm.Expression + , errorUnlessCached : Elm.Expression + , metadata : + { url : Elm.Expression + , statusCode : Elm.Expression + , statusText : Elm.Expression + , headers : Elm.Expression + } + -> Elm.Expression + } +make_ = + { badUrl = + \ar0 -> + Elm.apply + (Elm.value + { importFrom = [ "BackendTask", "Http" ] + , name = "BadUrl" + , annotation = Just (Type.namedWith [] "Error" []) + } + ) + [ ar0 ] + , timeout = + Elm.value + { importFrom = [ "BackendTask", "Http" ] + , name = "Timeout" + , annotation = Just (Type.namedWith [] "Error" []) + } + , networkError = + Elm.value + { importFrom = [ "BackendTask", "Http" ] + , name = "NetworkError" + , annotation = Just (Type.namedWith [] "Error" []) + } + , badStatus = + \ar0 ar1 -> + Elm.apply + (Elm.value + { importFrom = [ "BackendTask", "Http" ] + , name = "BadStatus" + , annotation = Just (Type.namedWith [] "Error" []) + } + ) + [ ar0, ar1 ] + , badBody = + \ar0 ar1 -> + Elm.apply + (Elm.value + { importFrom = [ "BackendTask", "Http" ] + , name = "BadBody" + , annotation = Just (Type.namedWith [] "Error" []) + } + ) + [ ar0, ar1 ] + , ignoreCache = + Elm.value + { importFrom = [ "BackendTask", "Http" ] + , name = "IgnoreCache" + , annotation = Just (Type.namedWith [] "CacheStrategy" []) + } + , forceRevalidate = + Elm.value + { importFrom = [ "BackendTask", "Http" ] + , name = "ForceRevalidate" + , annotation = Just (Type.namedWith [] "CacheStrategy" []) + } + , forceReload = + Elm.value + { importFrom = [ "BackendTask", "Http" ] + , name = "ForceReload" + , annotation = Just (Type.namedWith [] "CacheStrategy" []) + } + , forceCache = + Elm.value + { importFrom = [ "BackendTask", "Http" ] + , name = "ForceCache" + , annotation = Just (Type.namedWith [] "CacheStrategy" []) + } + , errorUnlessCached = + Elm.value + { importFrom = [ "BackendTask", "Http" ] + , name = "ErrorUnlessCached" + , annotation = Just (Type.namedWith [] "CacheStrategy" []) + } + , metadata = + \metadata_args -> + Elm.withType + (Type.alias + [ "BackendTask", "Http" ] + "Metadata" + [] + (Type.record + [ ( "url", Type.string ) + , ( "statusCode", Type.int ) + , ( "statusText", Type.string ) + , ( "headers" + , Type.namedWith + [ "Dict" ] + "Dict" + [ Type.string, Type.string ] + ) + ] + ) + ) + (Elm.record + [ Tuple.pair "url" metadata_args.url + , Tuple.pair "statusCode" metadata_args.statusCode + , Tuple.pair "statusText" metadata_args.statusText + , Tuple.pair "headers" metadata_args.headers + ] + ) + } + + +caseOf_ = + { error = + \errorExpression errorTags -> + Elm.Case.custom + errorExpression + (Type.namedWith [ "BackendTask", "Http" ] "Error" []) + [ Elm.Case.branch + (Elm.Arg.customType + "BadUrl" + errorTags.badUrl |> Elm.Arg.item + (Elm.Arg.varWith + "arg_0" + Type.string + ) + ) + Basics.identity + , Elm.Case.branch + (Elm.Arg.customType "Timeout" errorTags.timeout) + Basics.identity + , Elm.Case.branch + (Elm.Arg.customType "NetworkError" errorTags.networkError) + Basics.identity + , Elm.Case.branch + (Elm.Arg.customType + "BadStatus" + errorTags.badStatus |> Elm.Arg.item + (Elm.Arg.varWith + "backendTaskHttpMetadata" + (Type.namedWith + [ "BackendTask" + , "Http" + ] + "Metadata" + [] + ) + ) |> Elm.Arg.item + (Elm.Arg.varWith + "arg_1" + Type.string + ) + ) + Basics.identity + , Elm.Case.branch + (Elm.Arg.customType + "BadBody" + errorTags.badBody |> Elm.Arg.item + (Elm.Arg.varWith + "maybeMaybe" + (Type.maybe + (Type.namedWith + [ "Json" + , "Decode" + ] + "Error" + [] + ) + ) + ) |> Elm.Arg.item + (Elm.Arg.varWith + "arg_1" + Type.string + ) + ) + Basics.identity + ] + , cacheStrategy = + \cacheStrategyExpression cacheStrategyTags -> + Elm.Case.custom + cacheStrategyExpression + (Type.namedWith [ "BackendTask", "Http" ] "CacheStrategy" []) + [ Elm.Case.branch + (Elm.Arg.customType + "IgnoreCache" + cacheStrategyTags.ignoreCache + ) + Basics.identity + , Elm.Case.branch + (Elm.Arg.customType + "ForceRevalidate" + cacheStrategyTags.forceRevalidate + ) + Basics.identity + , Elm.Case.branch + (Elm.Arg.customType + "ForceReload" + cacheStrategyTags.forceReload + ) + Basics.identity + , Elm.Case.branch + (Elm.Arg.customType + "ForceCache" + cacheStrategyTags.forceCache + ) + Basics.identity + , Elm.Case.branch + (Elm.Arg.customType + "ErrorUnlessCached" + cacheStrategyTags.errorUnlessCached + ) + Basics.identity + ] + } + + +call_ : + { get : Elm.Expression -> Elm.Expression -> Elm.Expression + , getJson : Elm.Expression -> Elm.Expression -> Elm.Expression + , post : + Elm.Expression -> Elm.Expression -> Elm.Expression -> Elm.Expression + , expectJson : Elm.Expression -> Elm.Expression + , expectBytes : Elm.Expression -> Elm.Expression + , expectWhatever : Elm.Expression -> Elm.Expression + , request : Elm.Expression -> Elm.Expression -> Elm.Expression + , stringBody : Elm.Expression -> Elm.Expression -> Elm.Expression + , jsonBody : Elm.Expression -> Elm.Expression + , bytesBody : Elm.Expression -> Elm.Expression -> Elm.Expression + , getWithOptions : Elm.Expression -> Elm.Expression + , withMetadata : Elm.Expression -> Elm.Expression -> Elm.Expression + } +call_ = + { get = + \getArg_ getArg_0 -> + Elm.apply + (Elm.value + { importFrom = [ "BackendTask", "Http" ] + , name = "get" + , annotation = + Just + (Type.function + [ Type.string + , Type.namedWith + [ "BackendTask", "Http" ] + "Expect" + [ Type.var "a" ] + ] + (Type.namedWith + [ "BackendTask" ] + "BackendTask" + [ Type.record + [ ( "fatal" + , Type.namedWith + [ "FatalError" ] + "FatalError" + [] + ) + , ( "recoverable" + , Type.namedWith + [ "BackendTask", "Http" ] + "Error" + [] + ) + ] + , Type.var "a" + ] + ) + ) + } + ) + [ getArg_, getArg_0 ] + , getJson = + \getJsonArg_ getJsonArg_0 -> + Elm.apply + (Elm.value + { importFrom = [ "BackendTask", "Http" ] + , name = "getJson" + , annotation = + Just + (Type.function + [ Type.string + , Type.namedWith + [ "Json", "Decode" ] + "Decoder" + [ Type.var "a" ] + ] + (Type.namedWith + [ "BackendTask" ] + "BackendTask" + [ Type.record + [ ( "fatal" + , Type.namedWith + [ "FatalError" ] + "FatalError" + [] + ) + , ( "recoverable" + , Type.namedWith + [ "BackendTask", "Http" ] + "Error" + [] + ) + ] + , Type.var "a" + ] + ) + ) + } + ) + [ getJsonArg_, getJsonArg_0 ] + , post = + \postArg_ postArg_0 postArg_1 -> + Elm.apply + (Elm.value + { importFrom = [ "BackendTask", "Http" ] + , name = "post" + , annotation = + Just + (Type.function + [ Type.string + , Type.namedWith + [ "BackendTask", "Http" ] + "Body" + [] + , Type.namedWith + [ "BackendTask", "Http" ] + "Expect" + [ Type.var "a" ] + ] + (Type.namedWith + [ "BackendTask" ] + "BackendTask" + [ Type.record + [ ( "fatal" + , Type.namedWith + [ "FatalError" ] + "FatalError" + [] + ) + , ( "recoverable" + , Type.namedWith + [ "BackendTask", "Http" ] + "Error" + [] + ) + ] + , Type.var "a" + ] + ) + ) + } + ) + [ postArg_, postArg_0, postArg_1 ] + , expectJson = + \expectJsonArg_ -> + Elm.apply + (Elm.value + { importFrom = [ "BackendTask", "Http" ] + , name = "expectJson" + , annotation = + Just + (Type.function + [ Type.namedWith + [ "Json", "Decode" ] + "Decoder" + [ Type.var "value" ] + ] + (Type.namedWith + [ "BackendTask", "Http" ] + "Expect" + [ Type.var "value" ] + ) + ) + } + ) + [ expectJsonArg_ ] + , expectBytes = + \expectBytesArg_ -> + Elm.apply + (Elm.value + { importFrom = [ "BackendTask", "Http" ] + , name = "expectBytes" + , annotation = + Just + (Type.function + [ Type.namedWith + [ "Bytes", "Decode" ] + "Decoder" + [ Type.var "value" ] + ] + (Type.namedWith + [ "BackendTask", "Http" ] + "Expect" + [ Type.var "value" ] + ) + ) + } + ) + [ expectBytesArg_ ] + , expectWhatever = + \expectWhateverArg_ -> + Elm.apply + (Elm.value + { importFrom = [ "BackendTask", "Http" ] + , name = "expectWhatever" + , annotation = + Just + (Type.function + [ Type.var "value" ] + (Type.namedWith + [ "BackendTask", "Http" ] + "Expect" + [ Type.var "value" ] + ) + ) + } + ) + [ expectWhateverArg_ ] + , request = + \requestArg_ requestArg_0 -> + Elm.apply + (Elm.value + { importFrom = [ "BackendTask", "Http" ] + , name = "request" + , annotation = + Just + (Type.function + [ Type.record + [ ( "url", Type.string ) + , ( "method", Type.string ) + , ( "headers" + , Type.list + (Type.tuple Type.string Type.string) + ) + , ( "body" + , Type.namedWith + [ "BackendTask", "Http" ] + "Body" + [] + ) + , ( "retries", Type.maybe Type.int ) + , ( "timeoutInMs", Type.maybe Type.int ) + ] + , Type.namedWith + [ "BackendTask", "Http" ] + "Expect" + [ Type.var "a" ] + ] + (Type.namedWith + [ "BackendTask" ] + "BackendTask" + [ Type.record + [ ( "fatal" + , Type.namedWith + [ "FatalError" ] + "FatalError" + [] + ) + , ( "recoverable" + , Type.namedWith + [ "BackendTask", "Http" ] + "Error" + [] + ) + ] + , Type.var "a" + ] + ) + ) + } + ) + [ requestArg_, requestArg_0 ] + , stringBody = + \stringBodyArg_ stringBodyArg_0 -> + Elm.apply + (Elm.value + { importFrom = [ "BackendTask", "Http" ] + , name = "stringBody" + , annotation = + Just + (Type.function + [ Type.string, Type.string ] + (Type.namedWith + [ "BackendTask", "Http" ] + "Body" + [] + ) + ) + } + ) + [ stringBodyArg_, stringBodyArg_0 ] + , jsonBody = + \jsonBodyArg_ -> + Elm.apply + (Elm.value + { importFrom = [ "BackendTask", "Http" ] + , name = "jsonBody" + , annotation = + Just + (Type.function + [ Type.namedWith + [ "Json", "Encode" ] + "Value" + [] + ] + (Type.namedWith + [ "BackendTask", "Http" ] + "Body" + [] + ) + ) + } + ) + [ jsonBodyArg_ ] + , bytesBody = + \bytesBodyArg_ bytesBodyArg_0 -> + Elm.apply + (Elm.value + { importFrom = [ "BackendTask", "Http" ] + , name = "bytesBody" + , annotation = + Just + (Type.function + [ Type.string + , Type.namedWith [ "Bytes" ] "Bytes" [] + ] + (Type.namedWith + [ "BackendTask", "Http" ] + "Body" + [] + ) + ) + } + ) + [ bytesBodyArg_, bytesBodyArg_0 ] + , getWithOptions = + \getWithOptionsArg_ -> + Elm.apply + (Elm.value + { importFrom = [ "BackendTask", "Http" ] + , name = "getWithOptions" + , annotation = + Just + (Type.function + [ Type.record + [ ( "url", Type.string ) + , ( "expect" + , Type.namedWith + [ "BackendTask", "Http" ] + "Expect" + [ Type.var "a" ] + ) + , ( "headers" + , Type.list + (Type.tuple Type.string Type.string) + ) + , ( "cacheStrategy" + , Type.maybe + (Type.namedWith + [ "BackendTask", "Http" ] + "CacheStrategy" + [] + ) + ) + , ( "retries", Type.maybe Type.int ) + , ( "timeoutInMs", Type.maybe Type.int ) + , ( "cachePath", Type.maybe Type.string ) + ] + ] + (Type.namedWith + [ "BackendTask" ] + "BackendTask" + [ Type.record + [ ( "fatal" + , Type.namedWith + [ "FatalError" ] + "FatalError" + [] + ) + , ( "recoverable" + , Type.namedWith + [ "BackendTask", "Http" ] + "Error" + [] + ) + ] + , Type.var "a" + ] + ) + ) + } + ) + [ getWithOptionsArg_ ] + , withMetadata = + \withMetadataArg_ withMetadataArg_0 -> + Elm.apply + (Elm.value + { importFrom = [ "BackendTask", "Http" ] + , name = "withMetadata" + , annotation = + Just + (Type.function + [ Type.function + [ Type.namedWith + [ "BackendTask", "Http" ] + "Metadata" + [] + , Type.var "value" + ] + (Type.var "combined") + , Type.namedWith + [ "BackendTask", "Http" ] + "Expect" + [ Type.var "value" ] + ] + (Type.namedWith + [ "BackendTask", "Http" ] + "Expect" + [ Type.var "combined" ] + ) + ) + } + ) + [ withMetadataArg_, withMetadataArg_0 ] + } + + +values_ : + { get : Elm.Expression + , getJson : Elm.Expression + , post : Elm.Expression + , expectString : Elm.Expression + , expectJson : Elm.Expression + , expectBytes : Elm.Expression + , expectWhatever : Elm.Expression + , request : Elm.Expression + , emptyBody : Elm.Expression + , stringBody : Elm.Expression + , jsonBody : Elm.Expression + , bytesBody : Elm.Expression + , getWithOptions : Elm.Expression + , withMetadata : Elm.Expression + } +values_ = + { get = + Elm.value + { importFrom = [ "BackendTask", "Http" ] + , name = "get" + , annotation = + Just + (Type.function + [ Type.string + , Type.namedWith + [ "BackendTask", "Http" ] + "Expect" + [ Type.var "a" ] + ] + (Type.namedWith + [ "BackendTask" ] + "BackendTask" + [ Type.record + [ ( "fatal" + , Type.namedWith + [ "FatalError" ] + "FatalError" + [] + ) + , ( "recoverable" + , Type.namedWith + [ "BackendTask", "Http" ] + "Error" + [] + ) + ] + , Type.var "a" + ] + ) + ) + } + , getJson = + Elm.value + { importFrom = [ "BackendTask", "Http" ] + , name = "getJson" + , annotation = + Just + (Type.function + [ Type.string + , Type.namedWith + [ "Json", "Decode" ] + "Decoder" + [ Type.var "a" ] + ] + (Type.namedWith + [ "BackendTask" ] + "BackendTask" + [ Type.record + [ ( "fatal" + , Type.namedWith + [ "FatalError" ] + "FatalError" + [] + ) + , ( "recoverable" + , Type.namedWith + [ "BackendTask", "Http" ] + "Error" + [] + ) + ] + , Type.var "a" + ] + ) + ) + } + , post = + Elm.value + { importFrom = [ "BackendTask", "Http" ] + , name = "post" + , annotation = + Just + (Type.function + [ Type.string + , Type.namedWith [ "BackendTask", "Http" ] "Body" [] + , Type.namedWith + [ "BackendTask", "Http" ] + "Expect" + [ Type.var "a" ] + ] + (Type.namedWith + [ "BackendTask" ] + "BackendTask" + [ Type.record + [ ( "fatal" + , Type.namedWith + [ "FatalError" ] + "FatalError" + [] + ) + , ( "recoverable" + , Type.namedWith + [ "BackendTask", "Http" ] + "Error" + [] + ) + ] + , Type.var "a" + ] + ) + ) + } + , expectString = + Elm.value + { importFrom = [ "BackendTask", "Http" ] + , name = "expectString" + , annotation = + Just + (Type.namedWith + [ "BackendTask", "Http" ] + "Expect" + [ Type.string ] + ) + } + , expectJson = + Elm.value + { importFrom = [ "BackendTask", "Http" ] + , name = "expectJson" + , annotation = + Just + (Type.function + [ Type.namedWith + [ "Json", "Decode" ] + "Decoder" + [ Type.var "value" ] + ] + (Type.namedWith + [ "BackendTask", "Http" ] + "Expect" + [ Type.var "value" ] + ) + ) + } + , expectBytes = + Elm.value + { importFrom = [ "BackendTask", "Http" ] + , name = "expectBytes" + , annotation = + Just + (Type.function + [ Type.namedWith + [ "Bytes", "Decode" ] + "Decoder" + [ Type.var "value" ] + ] + (Type.namedWith + [ "BackendTask", "Http" ] + "Expect" + [ Type.var "value" ] + ) + ) + } + , expectWhatever = + Elm.value + { importFrom = [ "BackendTask", "Http" ] + , name = "expectWhatever" + , annotation = + Just + (Type.function + [ Type.var "value" ] + (Type.namedWith + [ "BackendTask", "Http" ] + "Expect" + [ Type.var "value" ] + ) + ) + } + , request = + Elm.value + { importFrom = [ "BackendTask", "Http" ] + , name = "request" + , annotation = + Just + (Type.function + [ Type.record + [ ( "url", Type.string ) + , ( "method", Type.string ) + , ( "headers" + , Type.list (Type.tuple Type.string Type.string) + ) + , ( "body" + , Type.namedWith + [ "BackendTask", "Http" ] + "Body" + [] + ) + , ( "retries", Type.maybe Type.int ) + , ( "timeoutInMs", Type.maybe Type.int ) + ] + , Type.namedWith + [ "BackendTask", "Http" ] + "Expect" + [ Type.var "a" ] + ] + (Type.namedWith + [ "BackendTask" ] + "BackendTask" + [ Type.record + [ ( "fatal" + , Type.namedWith + [ "FatalError" ] + "FatalError" + [] + ) + , ( "recoverable" + , Type.namedWith + [ "BackendTask", "Http" ] + "Error" + [] + ) + ] + , Type.var "a" + ] + ) + ) + } + , emptyBody = + Elm.value + { importFrom = [ "BackendTask", "Http" ] + , name = "emptyBody" + , annotation = + Just (Type.namedWith [ "BackendTask", "Http" ] "Body" []) + } + , stringBody = + Elm.value + { importFrom = [ "BackendTask", "Http" ] + , name = "stringBody" + , annotation = + Just + (Type.function + [ Type.string, Type.string ] + (Type.namedWith [ "BackendTask", "Http" ] "Body" []) + ) + } + , jsonBody = + Elm.value + { importFrom = [ "BackendTask", "Http" ] + , name = "jsonBody" + , annotation = + Just + (Type.function + [ Type.namedWith [ "Json", "Encode" ] "Value" [] ] + (Type.namedWith [ "BackendTask", "Http" ] "Body" []) + ) + } + , bytesBody = + Elm.value + { importFrom = [ "BackendTask", "Http" ] + , name = "bytesBody" + , annotation = + Just + (Type.function + [ Type.string, Type.namedWith [ "Bytes" ] "Bytes" [] ] + (Type.namedWith [ "BackendTask", "Http" ] "Body" []) + ) + } + , getWithOptions = + Elm.value + { importFrom = [ "BackendTask", "Http" ] + , name = "getWithOptions" + , annotation = + Just + (Type.function + [ Type.record + [ ( "url", Type.string ) + , ( "expect" + , Type.namedWith + [ "BackendTask", "Http" ] + "Expect" + [ Type.var "a" ] + ) + , ( "headers" + , Type.list (Type.tuple Type.string Type.string) + ) + , ( "cacheStrategy" + , Type.maybe + (Type.namedWith + [ "BackendTask", "Http" ] + "CacheStrategy" + [] + ) + ) + , ( "retries", Type.maybe Type.int ) + , ( "timeoutInMs", Type.maybe Type.int ) + , ( "cachePath", Type.maybe Type.string ) + ] + ] + (Type.namedWith + [ "BackendTask" ] + "BackendTask" + [ Type.record + [ ( "fatal" + , Type.namedWith + [ "FatalError" ] + "FatalError" + [] + ) + , ( "recoverable" + , Type.namedWith + [ "BackendTask", "Http" ] + "Error" + [] + ) + ] + , Type.var "a" + ] + ) + ) + } + , withMetadata = + Elm.value + { importFrom = [ "BackendTask", "Http" ] + , name = "withMetadata" + , annotation = + Just + (Type.function + [ Type.function + [ Type.namedWith + [ "BackendTask", "Http" ] + "Metadata" + [] + , Type.var "value" + ] + (Type.var "combined") + , Type.namedWith + [ "BackendTask", "Http" ] + "Expect" + [ Type.var "value" ] + ] + (Type.namedWith + [ "BackendTask", "Http" ] + "Expect" + [ Type.var "combined" ] + ) + ) + } + } \ No newline at end of file diff --git a/elm-open-api-codegen/src/Gen/BackendTask/Random.elm b/elm-open-api-codegen/src/Gen/BackendTask/Random.elm new file mode 100644 index 00000000..c2a93ed8 --- /dev/null +++ b/elm-open-api-codegen/src/Gen/BackendTask/Random.elm @@ -0,0 +1,166 @@ +module Gen.BackendTask.Random exposing + ( moduleName_, generate, int32, call_, values_ + ) + +{-| +# Generated bindings for BackendTask.Random + +@docs moduleName_, generate, int32, call_, values_ +-} + + +import Elm +import Elm.Annotation as Type + + +{-| The name of this module. -} +moduleName_ : List String +moduleName_ = + [ "BackendTask", "Random" ] + + +{-| Takes an `elm/random` `Random.Generator` and runs it using a randomly generated initial seed. + + type alias Data = + { randomData : ( Int, Float ) + } + + data : BackendTask FatalError Data + data = + BackendTask.map Data + (BackendTask.Random.generate generator) + + generator : Random.Generator ( Int, Float ) + generator = + Random.map2 Tuple.pair (Random.int 0 100) (Random.float 0 100) + +The random initial seed is generated using +to generate a single 32-bit Integer. That 32-bit Integer is then used with `Random.initialSeed` to create an Elm Random.Seed value. +Then that `Seed` used to run the `Generator`. + +Note that this is different than `elm/random`'s `Random.generate`. This difference shouldn't be problematic, and in fact the `BackendTask` +random seed generation is more cryptographically independent because you can't determine the +random seed based solely on the time at which it is run. Each time you call `BackendTask.generate` it uses a newly +generated random seed to run the `Random.Generator` that is passed in. In contrast, `elm/random`'s `Random.generate` +generates an initial seed using `Time.now`, and then continues with that same seed using using [`Random.step`](https://package.elm-lang.org/packages/elm/random/latest/Random#step) +to get new random values after that. You can [see the implementation here](https://github.com/elm/random/blob/c1c9da4d861363cee1c93382d2687880279ed0dd/src/Random.elm#L865-L896). +However, `elm/random` is still not suitable in general for cryptographic uses of random because it uses 32-bits for when it +steps through new seeds while running a single `Random.Generator`. + +generate: Random.Generator value -> BackendTask.BackendTask error value +-} +generate : Elm.Expression -> Elm.Expression +generate generateArg_ = + Elm.apply + (Elm.value + { importFrom = [ "BackendTask", "Random" ] + , name = "generate" + , annotation = + Just + (Type.function + [ Type.namedWith + [ "Random" ] + "Generator" + [ Type.var "value" ] + ] + (Type.namedWith + [ "BackendTask" ] + "BackendTask" + [ Type.var "error", Type.var "value" ] + ) + ) + } + ) + [ generateArg_ ] + + +{-| Gives a random 32-bit Int. This can be useful if you want to do low-level things with a cryptographically sound +random 32-bit integer. + +The value comes from running this code in Node using : + +```js +import * as crypto from "node:crypto"; + +crypto.getRandomValues(new Uint32Array(1))[0] +``` + +int32: BackendTask.BackendTask error Int +-} +int32 : Elm.Expression +int32 = + Elm.value + { importFrom = [ "BackendTask", "Random" ] + , name = "int32" + , annotation = + Just + (Type.namedWith + [ "BackendTask" ] + "BackendTask" + [ Type.var "error", Type.int ] + ) + } + + +call_ : { generate : Elm.Expression -> Elm.Expression } +call_ = + { generate = + \generateArg_ -> + Elm.apply + (Elm.value + { importFrom = [ "BackendTask", "Random" ] + , name = "generate" + , annotation = + Just + (Type.function + [ Type.namedWith + [ "Random" ] + "Generator" + [ Type.var "value" ] + ] + (Type.namedWith + [ "BackendTask" ] + "BackendTask" + [ Type.var "error", Type.var "value" ] + ) + ) + } + ) + [ generateArg_ ] + } + + +values_ : { generate : Elm.Expression, int32 : Elm.Expression } +values_ = + { generate = + Elm.value + { importFrom = [ "BackendTask", "Random" ] + , name = "generate" + , annotation = + Just + (Type.function + [ Type.namedWith + [ "Random" ] + "Generator" + [ Type.var "value" ] + ] + (Type.namedWith + [ "BackendTask" ] + "BackendTask" + [ Type.var "error", Type.var "value" ] + ) + ) + } + , int32 = + Elm.value + { importFrom = [ "BackendTask", "Random" ] + , name = "int32" + , annotation = + Just + (Type.namedWith + [ "BackendTask" ] + "BackendTask" + [ Type.var "error", Type.int ] + ) + } + } \ No newline at end of file diff --git a/elm-open-api-codegen/src/Gen/BackendTask/Stream.elm b/elm-open-api-codegen/src/Gen/BackendTask/Stream.elm new file mode 100644 index 00000000..934f0f3d --- /dev/null +++ b/elm-open-api-codegen/src/Gen/BackendTask/Stream.elm @@ -0,0 +1,3163 @@ +module Gen.BackendTask.Stream exposing + ( moduleName_, pipe, fileRead, fileWrite, fromString, http + , httpWithInput, stdin, stdout, stderr, read, readJson, readMetadata + , run, command, commandWithOptions, defaultCommandOptions, allowNon0Status, withOutput, withTimeout + , gzip, unzip, customRead, customWrite, customDuplex, customReadWithMeta, customTransformWithMeta + , customWriteWithMeta, annotation_, make_, caseOf_, call_, values_ + ) + +{-| +# Generated bindings for BackendTask.Stream + +@docs moduleName_, pipe, fileRead, fileWrite, fromString, http +@docs httpWithInput, stdin, stdout, stderr, read, readJson +@docs readMetadata, run, command, commandWithOptions, defaultCommandOptions, allowNon0Status +@docs withOutput, withTimeout, gzip, unzip, customRead, customWrite +@docs customDuplex, customReadWithMeta, customTransformWithMeta, customWriteWithMeta, annotation_, make_ +@docs caseOf_, call_, values_ +-} + + +import Elm +import Elm.Annotation as Type +import Elm.Arg +import Elm.Case + + +{-| The name of this module. -} +moduleName_ : List String +moduleName_ = + [ "BackendTask", "Stream" ] + + +{-| You can build up a pipeline of streams by using the `pipe` function. + +The stream you are piping to must be writable (`{ write : () }`), +and the stream you are piping from must be readable (`{ read : () }`). + + module HelloWorld exposing (run) + + import BackendTask + import BackendTask.Stream as Stream + import Pages.Script as Script exposing (Script) + + run : Script + run = + Script.withoutCliOptions + (Stream.fromString "Hello, World!" + |> Stream.stdout + |> Stream.run + ) + +pipe: + BackendTask.Stream.Stream errorTo metaTo { read : toReadable, write : () } + -> BackendTask.Stream.Stream errorFrom metaFrom { read : () + , write : fromWriteable + } + -> BackendTask.Stream.Stream errorTo metaTo { read : toReadable + , write : fromWriteable + } +-} +pipe : Elm.Expression -> Elm.Expression -> Elm.Expression +pipe pipeArg_ pipeArg_0 = + Elm.apply + (Elm.value + { importFrom = [ "BackendTask", "Stream" ] + , name = "pipe" + , annotation = + Just + (Type.function + [ Type.namedWith + [ "BackendTask", "Stream" ] + "Stream" + [ Type.var "errorTo" + , Type.var "metaTo" + , Type.record + [ ( "read", Type.var "toReadable" ) + , ( "write", Type.unit ) + ] + ] + , Type.namedWith + [ "BackendTask", "Stream" ] + "Stream" + [ Type.var "errorFrom" + , Type.var "metaFrom" + , Type.record + [ ( "read", Type.unit ) + , ( "write", Type.var "fromWriteable" ) + ] + ] + ] + (Type.namedWith + [ "BackendTask", "Stream" ] + "Stream" + [ Type.var "errorTo" + , Type.var "metaTo" + , Type.record + [ ( "read", Type.var "toReadable" ) + , ( "write", Type.var "fromWriteable" ) + ] + ] + ) + ) + } + ) + [ pipeArg_, pipeArg_0 ] + + +{-| Open a file's contents as a Stream. + + module ReadFile exposing (run) + + import BackendTask + import BackendTask.Stream as Stream + import Pages.Script as Script exposing (Script) + + run : Script + run = + Script.withoutCliOptions + (Stream.fileRead "elm.json" + |> Stream.readJson (Decode.field "source-directories" (Decode.list Decode.string)) + |> BackendTask.allowFatal + |> BackendTask.andThen + (\{ body } -> + Script.log + ("The source directories are: " + ++ String.join ", " body + ) + ) + ) + +If you want to read a file but don't need to use any of the other Stream functions, you can use [`BackendTask.File.read`](BackendTask-File#rawFile) instead. + +fileRead: String -> BackendTask.Stream.Stream () () { read : (), write : Basics.Never } +-} +fileRead : String -> Elm.Expression +fileRead fileReadArg_ = + Elm.apply + (Elm.value + { importFrom = [ "BackendTask", "Stream" ] + , name = "fileRead" + , annotation = + Just + (Type.function + [ Type.string ] + (Type.namedWith + [ "BackendTask", "Stream" ] + "Stream" + [ Type.unit + , Type.unit + , Type.record + [ ( "read", Type.unit ) + , ( "write" + , Type.namedWith [ "Basics" ] "Never" [] + ) + ] + ] + ) + ) + } + ) + [ Elm.string fileReadArg_ ] + + +{-| Write a Stream to a file. + + module WriteFile exposing (run) + + import BackendTask + import BackendTask.Stream as Stream + import Pages.Script as Script exposing (Script) + + run : Script + run = + Script.withoutCliOptions + (Stream.fileRead "logs.txt" + |> Stream.pipe (Stream.command "grep" [ "error" ]) + |> Stream.pipe (Stream.fileWrite "errors.txt") + ) + +fileWrite: String -> BackendTask.Stream.Stream () () { read : Basics.Never, write : () } +-} +fileWrite : String -> Elm.Expression +fileWrite fileWriteArg_ = + Elm.apply + (Elm.value + { importFrom = [ "BackendTask", "Stream" ] + , name = "fileWrite" + , annotation = + Just + (Type.function + [ Type.string ] + (Type.namedWith + [ "BackendTask", "Stream" ] + "Stream" + [ Type.unit + , Type.unit + , Type.record + [ ( "read" + , Type.namedWith [ "Basics" ] "Never" [] + ) + , ( "write", Type.unit ) + ] + ] + ) + ) + } + ) + [ Elm.string fileWriteArg_ ] + + +{-| A handy way to turn either a hardcoded String, or any other value from Elm into a Stream. + + module HelloWorld exposing (run) + + import BackendTask + import BackendTask.Stream as Stream + import Pages.Script as Script exposing (Script) + + run : Script + run = + Script.withoutCliOptions + (Stream.fromString "Hello, World!" + |> Stream.stdout + |> Stream.run + |> BackendTask.allowFatal + ) + +A more programmatic use of `fromString` to use the result of a previous `BackendTask` to a `Stream`: + + module HelloWorld exposing (run) + + import BackendTask + import BackendTask.Stream as Stream + import Pages.Script as Script exposing (Script) + + run : Script + run = + Script.withoutCliOptions + (Glob.fromString "src/**/*.elm" + |> BackendTask.andThen + (\elmFiles -> + elmFiles + |> String.join ", " + |> Stream.fromString + |> Stream.pipe Stream.stdout + |> Stream.run + ) + ) + +fromString: String -> BackendTask.Stream.Stream () () { read : (), write : Basics.Never } +-} +fromString : String -> Elm.Expression +fromString fromStringArg_ = + Elm.apply + (Elm.value + { importFrom = [ "BackendTask", "Stream" ] + , name = "fromString" + , annotation = + Just + (Type.function + [ Type.string ] + (Type.namedWith + [ "BackendTask", "Stream" ] + "Stream" + [ Type.unit + , Type.unit + , Type.record + [ ( "read", Type.unit ) + , ( "write" + , Type.namedWith [ "Basics" ] "Never" [] + ) + ] + ] + ) + ) + } + ) + [ Elm.string fromStringArg_ ] + + +{-| Uses a regular HTTP request body (not a `Stream`). Streams the HTTP response body. + +If you want to pass a stream as the request body, use [`httpWithInput`](#httpWithInput) instead. + +If you don't need to stream the response body, you can use the functions from [`BackendTask.Http`](BackendTask-Http) instead. + +http: + { url : String + , method : String + , headers : List ( String, String ) + , body : BackendTask.Http.Body + , retries : Maybe Int + , timeoutInMs : Maybe Int + } + -> BackendTask.Stream.Stream BackendTask.Http.Error BackendTask.Http.Metadata { read : + () + , write : Basics.Never + } +-} +http : + { url : String + , method : String + , headers : List Elm.Expression + , body : Elm.Expression + , retries : Elm.Expression + , timeoutInMs : Elm.Expression + } + -> Elm.Expression +http httpArg_ = + Elm.apply + (Elm.value + { importFrom = [ "BackendTask", "Stream" ] + , name = "http" + , annotation = + Just + (Type.function + [ Type.record + [ ( "url", Type.string ) + , ( "method", Type.string ) + , ( "headers" + , Type.list (Type.tuple Type.string Type.string) + ) + , ( "body" + , Type.namedWith + [ "BackendTask", "Http" ] + "Body" + [] + ) + , ( "retries", Type.maybe Type.int ) + , ( "timeoutInMs", Type.maybe Type.int ) + ] + ] + (Type.namedWith + [ "BackendTask", "Stream" ] + "Stream" + [ Type.namedWith + [ "BackendTask", "Http" ] + "Error" + [] + , Type.namedWith + [ "BackendTask", "Http" ] + "Metadata" + [] + , Type.record + [ ( "read", Type.unit ) + , ( "write" + , Type.namedWith [ "Basics" ] "Never" [] + ) + ] + ] + ) + ) + } + ) + [ Elm.record + [ Tuple.pair "url" (Elm.string httpArg_.url) + , Tuple.pair "method" (Elm.string httpArg_.method) + , Tuple.pair "headers" (Elm.list httpArg_.headers) + , Tuple.pair "body" httpArg_.body + , Tuple.pair "retries" httpArg_.retries + , Tuple.pair "timeoutInMs" httpArg_.timeoutInMs + ] + ] + + +{-| Streams the data from the input stream as the body of the HTTP request. The HTTP response body becomes the output stream. + +httpWithInput: + { url : String + , method : String + , headers : List ( String, String ) + , retries : Maybe Int + , timeoutInMs : Maybe Int + } + -> BackendTask.Stream.Stream BackendTask.Http.Error BackendTask.Http.Metadata { read : + () + , write : () + } +-} +httpWithInput : + { url : String + , method : String + , headers : List Elm.Expression + , retries : Elm.Expression + , timeoutInMs : Elm.Expression + } + -> Elm.Expression +httpWithInput httpWithInputArg_ = + Elm.apply + (Elm.value + { importFrom = [ "BackendTask", "Stream" ] + , name = "httpWithInput" + , annotation = + Just + (Type.function + [ Type.record + [ ( "url", Type.string ) + , ( "method", Type.string ) + , ( "headers" + , Type.list (Type.tuple Type.string Type.string) + ) + , ( "retries", Type.maybe Type.int ) + , ( "timeoutInMs", Type.maybe Type.int ) + ] + ] + (Type.namedWith + [ "BackendTask", "Stream" ] + "Stream" + [ Type.namedWith + [ "BackendTask", "Http" ] + "Error" + [] + , Type.namedWith + [ "BackendTask", "Http" ] + "Metadata" + [] + , Type.record + [ ( "read", Type.unit ) + , ( "write", Type.unit ) + ] + ] + ) + ) + } + ) + [ Elm.record + [ Tuple.pair "url" (Elm.string httpWithInputArg_.url) + , Tuple.pair "method" (Elm.string httpWithInputArg_.method) + , Tuple.pair "headers" (Elm.list httpWithInputArg_.headers) + , Tuple.pair "retries" httpWithInputArg_.retries + , Tuple.pair "timeoutInMs" httpWithInputArg_.timeoutInMs + ] + ] + + +{-| The `stdin` from the process. When you execute an `elm-pages` script, this will be the value that is piped in to it. For example, given this script module: + + module CountLines exposing (run) + + import BackendTask + import BackendTask.Stream as Stream + import Pages.Script as Script exposing (Script) + + run : Script + run = + Script.withoutCliOptions + (Stream.stdin + |> Stream.read + |> BackendTask.allowFatal + |> BackendTask.andThen + (\{ body } -> + body + |> String.lines + |> List.length + |> String.fromInt + |> Script.log + ) + ) + +If you run the script without any stdin, it will wait until stdin is closed. + +```shell +elm-pages run script/src/CountLines.elm +# pressing ctrl-d (or your platform-specific way of closing stdin) will print the number of lines in the input +``` + +Or you can pipe to it and it will read that input: + +```shell +ls | elm-pages run script/src/CountLines.elm +# prints the number of files in the current directory +``` + +stdin: BackendTask.Stream.Stream () () { read : (), write : Basics.Never } +-} +stdin : Elm.Expression +stdin = + Elm.value + { importFrom = [ "BackendTask", "Stream" ] + , name = "stdin" + , annotation = + Just + (Type.namedWith + [ "BackendTask", "Stream" ] + "Stream" + [ Type.unit + , Type.unit + , Type.record + [ ( "read", Type.unit ) + , ( "write", Type.namedWith [ "Basics" ] "Never" [] ) + ] + ] + ) + } + + +{-| Streaming through to stdout can be a convenient way to print a pipeline directly without going through to Elm. + + module UnzipFile exposing (run) + + import BackendTask + import BackendTask.Stream as Stream + import Pages.Script as Script exposing (Script) + + run : Script + run = + Script.withoutCliOptions + (Stream.fileRead "data.gzip.txt" + |> Stream.pipe Stream.unzip + |> Stream.pipe Stream.stdout + |> Stream.run + |> BackendTask.allowFatal + ) + +stdout: BackendTask.Stream.Stream () () { read : Basics.Never, write : () } +-} +stdout : Elm.Expression +stdout = + Elm.value + { importFrom = [ "BackendTask", "Stream" ] + , name = "stdout" + , annotation = + Just + (Type.namedWith + [ "BackendTask", "Stream" ] + "Stream" + [ Type.unit + , Type.unit + , Type.record + [ ( "read", Type.namedWith [ "Basics" ] "Never" [] ) + , ( "write", Type.unit ) + ] + ] + ) + } + + +{-| Similar to [`stdout`](#stdout), but writes to `stderr` instead. + +stderr: BackendTask.Stream.Stream () () { read : Basics.Never, write : () } +-} +stderr : Elm.Expression +stderr = + Elm.value + { importFrom = [ "BackendTask", "Stream" ] + , name = "stderr" + , annotation = + Just + (Type.namedWith + [ "BackendTask", "Stream" ] + "Stream" + [ Type.unit + , Type.unit + , Type.record + [ ( "read", Type.namedWith [ "Basics" ] "Never" [] ) + , ( "write", Type.unit ) + ] + ] + ) + } + + +{-| Read the body of the `Stream` as text. + +read: + BackendTask.Stream.Stream error metadata { read : (), write : write } + -> BackendTask.BackendTask { fatal : FatalError.FatalError + , recoverable : BackendTask.Stream.Error error String + } { metadata : metadata, body : String } +-} +read : Elm.Expression -> Elm.Expression +read readArg_ = + Elm.apply + (Elm.value + { importFrom = [ "BackendTask", "Stream" ] + , name = "read" + , annotation = + Just + (Type.function + [ Type.namedWith + [ "BackendTask", "Stream" ] + "Stream" + [ Type.var "error" + , Type.var "metadata" + , Type.record + [ ( "read", Type.unit ) + , ( "write", Type.var "write" ) + ] + ] + ] + (Type.namedWith + [ "BackendTask" ] + "BackendTask" + [ Type.record + [ ( "fatal" + , Type.namedWith + [ "FatalError" ] + "FatalError" + [] + ) + , ( "recoverable" + , Type.namedWith + [ "BackendTask", "Stream" ] + "Error" + [ Type.var "error", Type.string ] + ) + ] + , Type.record + [ ( "metadata", Type.var "metadata" ) + , ( "body", Type.string ) + ] + ] + ) + ) + } + ) + [ readArg_ ] + + +{-| Read the body of the `Stream` as JSON. + + module ReadJson exposing (run) + + import BackendTask + import BackendTask.Stream as Stream + import Json.Decode as Decode + import Pages.Script as Script exposing (Script) + + run : Script + run = + Script.withoutCliOptions + (Stream.fileRead "data.json" + |> Stream.readJson (Decode.field "name" Decode.string) + |> BackendTask.allowFatal + |> BackendTask.andThen + (\{ body } -> + Script.log ("The name is: " ++ body) + ) + ) + +readJson: + Json.Decode.Decoder value + -> BackendTask.Stream.Stream error metadata { read : (), write : write } + -> BackendTask.BackendTask { fatal : FatalError.FatalError + , recoverable : BackendTask.Stream.Error error value + } { metadata : metadata, body : value } +-} +readJson : Elm.Expression -> Elm.Expression -> Elm.Expression +readJson readJsonArg_ readJsonArg_0 = + Elm.apply + (Elm.value + { importFrom = [ "BackendTask", "Stream" ] + , name = "readJson" + , annotation = + Just + (Type.function + [ Type.namedWith + [ "Json", "Decode" ] + "Decoder" + [ Type.var "value" ] + , Type.namedWith + [ "BackendTask", "Stream" ] + "Stream" + [ Type.var "error" + , Type.var "metadata" + , Type.record + [ ( "read", Type.unit ) + , ( "write", Type.var "write" ) + ] + ] + ] + (Type.namedWith + [ "BackendTask" ] + "BackendTask" + [ Type.record + [ ( "fatal" + , Type.namedWith + [ "FatalError" ] + "FatalError" + [] + ) + , ( "recoverable" + , Type.namedWith + [ "BackendTask", "Stream" ] + "Error" + [ Type.var "error", Type.var "value" ] + ) + ] + , Type.record + [ ( "metadata", Type.var "metadata" ) + , ( "body", Type.var "value" ) + ] + ] + ) + ) + } + ) + [ readJsonArg_, readJsonArg_0 ] + + +{-| Ignore the body of the `Stream`, while capturing the metadata from the final part of the Stream. + +readMetadata: + BackendTask.Stream.Stream error metadata { read : read, write : write } + -> BackendTask.BackendTask { fatal : FatalError.FatalError + , recoverable : BackendTask.Stream.Error error String + } metadata +-} +readMetadata : Elm.Expression -> Elm.Expression +readMetadata readMetadataArg_ = + Elm.apply + (Elm.value + { importFrom = [ "BackendTask", "Stream" ] + , name = "readMetadata" + , annotation = + Just + (Type.function + [ Type.namedWith + [ "BackendTask", "Stream" ] + "Stream" + [ Type.var "error" + , Type.var "metadata" + , Type.record + [ ( "read", Type.var "read" ) + , ( "write", Type.var "write" ) + ] + ] + ] + (Type.namedWith + [ "BackendTask" ] + "BackendTask" + [ Type.record + [ ( "fatal" + , Type.namedWith + [ "FatalError" ] + "FatalError" + [] + ) + , ( "recoverable" + , Type.namedWith + [ "BackendTask", "Stream" ] + "Error" + [ Type.var "error", Type.string ] + ) + ] + , Type.var "metadata" + ] + ) + ) + } + ) + [ readMetadataArg_ ] + + +{-| Gives a `BackendTask` to execute the `Stream`, ignoring its body and metadata. + +This is useful if you only want the side-effect from the `Stream` and don't need to programmatically use its +output. For example, if the end result you want is: + + - Printing to the console + - Writing to a file + - Making an HTTP request + +If you need to read the output of the `Stream`, use [`read`](#read), [`readJson`](#readJson), or [`readMetadata`](#readMetadata) instead. + +run: + BackendTask.Stream.Stream error metadata kind + -> BackendTask.BackendTask FatalError.FatalError () +-} +run : Elm.Expression -> Elm.Expression +run runArg_ = + Elm.apply + (Elm.value + { importFrom = [ "BackendTask", "Stream" ] + , name = "run" + , annotation = + Just + (Type.function + [ Type.namedWith + [ "BackendTask", "Stream" ] + "Stream" + [ Type.var "error" + , Type.var "metadata" + , Type.var "kind" + ] + ] + (Type.namedWith + [ "BackendTask" ] + "BackendTask" + [ Type.namedWith [ "FatalError" ] "FatalError" [] + , Type.unit + ] + ) + ) + } + ) + [ runArg_ ] + + +{-| Run a command (or `child_process`). The command's output becomes the body of the `Stream`. + +command: + String + -> List String + -> BackendTask.Stream.Stream Int () { read : read, write : write } +-} +command : String -> List String -> Elm.Expression +command commandArg_ commandArg_0 = + Elm.apply + (Elm.value + { importFrom = [ "BackendTask", "Stream" ] + , name = "command" + , annotation = + Just + (Type.function + [ Type.string, Type.list Type.string ] + (Type.namedWith + [ "BackendTask", "Stream" ] + "Stream" + [ Type.int + , Type.unit + , Type.record + [ ( "read", Type.var "read" ) + , ( "write", Type.var "write" ) + ] + ] + ) + ) + } + ) + [ Elm.string commandArg_, Elm.list (List.map Elm.string commandArg_0) ] + + +{-| Pass in custom [`CommandOptions`](#CommandOptions) to configure the behavior of the command. + +For example, `grep` will return a non-zero status code if it doesn't find any matches. To ignore the non-zero status code and proceed with +empty output, you can use `allowNon0Status`. + + module GrepErrors exposing (run) + + import BackendTask + import BackendTask.Stream as Stream + import Pages.Script as Script exposing (Script) + + run : Script + run = + Script.withoutCliOptions + (Stream.fileRead "log.txt" + |> Stream.pipe + (Stream.commandWithOptions + (Stream.defaultCommandOptions |> Stream.allowNon0Status) + "grep" + [ "error" ] + ) + |> Stream.pipe Stream.stdout + |> Stream.run + ) + +commandWithOptions: + BackendTask.Stream.CommandOptions + -> String + -> List String + -> BackendTask.Stream.Stream Int () { read : read, write : write } +-} +commandWithOptions : Elm.Expression -> String -> List String -> Elm.Expression +commandWithOptions commandWithOptionsArg_ commandWithOptionsArg_0 commandWithOptionsArg_1 = + Elm.apply + (Elm.value + { importFrom = [ "BackendTask", "Stream" ] + , name = "commandWithOptions" + , annotation = + Just + (Type.function + [ Type.namedWith + [ "BackendTask", "Stream" ] + "CommandOptions" + [] + , Type.string + , Type.list Type.string + ] + (Type.namedWith + [ "BackendTask", "Stream" ] + "Stream" + [ Type.int + , Type.unit + , Type.record + [ ( "read", Type.var "read" ) + , ( "write", Type.var "write" ) + ] + ] + ) + ) + } + ) + [ commandWithOptionsArg_ + , Elm.string commandWithOptionsArg_0 + , Elm.list (List.map Elm.string commandWithOptionsArg_1) + ] + + +{-| The default options that are used for [`command`](#command). Used to build up `CommandOptions` +to pass in to [`commandWithOptions`](#commandWithOptions). + +defaultCommandOptions: BackendTask.Stream.CommandOptions +-} +defaultCommandOptions : Elm.Expression +defaultCommandOptions = + Elm.value + { importFrom = [ "BackendTask", "Stream" ] + , name = "defaultCommandOptions" + , annotation = + Just + (Type.namedWith [ "BackendTask", "Stream" ] "CommandOptions" []) + } + + +{-| By default, the `Stream` will halt with an error if a command returns a non-zero status code. + +With `allowNon0Status`, the stream will continue without an error if the command returns a non-zero status code. + +allowNon0Status: BackendTask.Stream.CommandOptions -> BackendTask.Stream.CommandOptions +-} +allowNon0Status : Elm.Expression -> Elm.Expression +allowNon0Status allowNon0StatusArg_ = + Elm.apply + (Elm.value + { importFrom = [ "BackendTask", "Stream" ] + , name = "allowNon0Status" + , annotation = + Just + (Type.function + [ Type.namedWith + [ "BackendTask", "Stream" ] + "CommandOptions" + [] + ] + (Type.namedWith + [ "BackendTask", "Stream" ] + "CommandOptions" + [] + ) + ) + } + ) + [ allowNon0StatusArg_ ] + + +{-| Configure the [`StderrOutput`](#StderrOutput) behavior. + +withOutput: + BackendTask.Stream.StderrOutput + -> BackendTask.Stream.CommandOptions + -> BackendTask.Stream.CommandOptions +-} +withOutput : Elm.Expression -> Elm.Expression -> Elm.Expression +withOutput withOutputArg_ withOutputArg_0 = + Elm.apply + (Elm.value + { importFrom = [ "BackendTask", "Stream" ] + , name = "withOutput" + , annotation = + Just + (Type.function + [ Type.namedWith + [ "BackendTask", "Stream" ] + "StderrOutput" + [] + , Type.namedWith + [ "BackendTask", "Stream" ] + "CommandOptions" + [] + ] + (Type.namedWith + [ "BackendTask", "Stream" ] + "CommandOptions" + [] + ) + ) + } + ) + [ withOutputArg_, withOutputArg_0 ] + + +{-| By default, commands do not have a timeout. This will set the timeout, in milliseconds, for the given command. If that duration is exceeded, +the `Stream` will fail with an error. + +withTimeout: Int -> BackendTask.Stream.CommandOptions -> BackendTask.Stream.CommandOptions +-} +withTimeout : Int -> Elm.Expression -> Elm.Expression +withTimeout withTimeoutArg_ withTimeoutArg_0 = + Elm.apply + (Elm.value + { importFrom = [ "BackendTask", "Stream" ] + , name = "withTimeout" + , annotation = + Just + (Type.function + [ Type.int + , Type.namedWith + [ "BackendTask", "Stream" ] + "CommandOptions" + [] + ] + (Type.namedWith + [ "BackendTask", "Stream" ] + "CommandOptions" + [] + ) + ) + } + ) + [ Elm.int withTimeoutArg_, withTimeoutArg_0 ] + + +{-| Transforms the input with gzip compression. + +Under the hood this builds a Stream using Node's [`zlib.createGzip`](https://nodejs.org/api/zlib.html#zlibcreategzipoptions). + +gzip: BackendTask.Stream.Stream () () { read : (), write : () } +-} +gzip : Elm.Expression +gzip = + Elm.value + { importFrom = [ "BackendTask", "Stream" ] + , name = "gzip" + , annotation = + Just + (Type.namedWith + [ "BackendTask", "Stream" ] + "Stream" + [ Type.unit + , Type.unit + , Type.record + [ ( "read", Type.unit ), ( "write", Type.unit ) ] + ] + ) + } + + +{-| Transforms the input by auto-detecting the header and decompressing either a Gzip- or Deflate-compressed stream. + +Under the hood, this builds a Stream using Node's [`zlib.createUnzip`](https://nodejs.org/api/zlib.html#zlibcreateunzip). + +unzip: BackendTask.Stream.Stream () () { read : (), write : () } +-} +unzip : Elm.Expression +unzip = + Elm.value + { importFrom = [ "BackendTask", "Stream" ] + , name = "unzip" + , annotation = + Just + (Type.namedWith + [ "BackendTask", "Stream" ] + "Stream" + [ Type.unit + , Type.unit + , Type.record + [ ( "read", Type.unit ), ( "write", Type.unit ) ] + ] + ) + } + + +{-| Calls an async function from your `custom-backend-task` definitions and uses the NodeJS `ReadableStream` it returns. + +customRead: + String + -> Json.Encode.Value + -> BackendTask.Stream.Stream () () { read : (), write : Basics.Never } +-} +customRead : String -> Elm.Expression -> Elm.Expression +customRead customReadArg_ customReadArg_0 = + Elm.apply + (Elm.value + { importFrom = [ "BackendTask", "Stream" ] + , name = "customRead" + , annotation = + Just + (Type.function + [ Type.string + , Type.namedWith [ "Json", "Encode" ] "Value" [] + ] + (Type.namedWith + [ "BackendTask", "Stream" ] + "Stream" + [ Type.unit + , Type.unit + , Type.record + [ ( "read", Type.unit ) + , ( "write" + , Type.namedWith [ "Basics" ] "Never" [] + ) + ] + ] + ) + ) + } + ) + [ Elm.string customReadArg_, customReadArg_0 ] + + +{-| Calls an async function from your `custom-backend-task` definitions and uses the NodeJS `WritableStream` it returns. + +customWrite: + String + -> Json.Encode.Value + -> BackendTask.Stream.Stream () () { read : Basics.Never, write : () } +-} +customWrite : String -> Elm.Expression -> Elm.Expression +customWrite customWriteArg_ customWriteArg_0 = + Elm.apply + (Elm.value + { importFrom = [ "BackendTask", "Stream" ] + , name = "customWrite" + , annotation = + Just + (Type.function + [ Type.string + , Type.namedWith [ "Json", "Encode" ] "Value" [] + ] + (Type.namedWith + [ "BackendTask", "Stream" ] + "Stream" + [ Type.unit + , Type.unit + , Type.record + [ ( "read" + , Type.namedWith [ "Basics" ] "Never" [] + ) + , ( "write", Type.unit ) + ] + ] + ) + ) + } + ) + [ Elm.string customWriteArg_, customWriteArg_0 ] + + +{-| Calls an async function from your `custom-backend-task` definitions and uses the NodeJS `DuplexStream` it returns. + +customDuplex: + String + -> Json.Encode.Value + -> BackendTask.Stream.Stream () () { read : (), write : () } +-} +customDuplex : String -> Elm.Expression -> Elm.Expression +customDuplex customDuplexArg_ customDuplexArg_0 = + Elm.apply + (Elm.value + { importFrom = [ "BackendTask", "Stream" ] + , name = "customDuplex" + , annotation = + Just + (Type.function + [ Type.string + , Type.namedWith [ "Json", "Encode" ] "Value" [] + ] + (Type.namedWith + [ "BackendTask", "Stream" ] + "Stream" + [ Type.unit + , Type.unit + , Type.record + [ ( "read", Type.unit ) + , ( "write", Type.unit ) + ] + ] + ) + ) + } + ) + [ Elm.string customDuplexArg_, customDuplexArg_0 ] + + +{-| Calls an async function from your `custom-backend-task` definitions and uses the NodeJS `DuplexStream` it returns. + +customReadWithMeta: + String + -> Json.Encode.Value + -> Json.Decode.Decoder (Result.Result { fatal : FatalError.FatalError + , recoverable : error + } metadata) + -> BackendTask.Stream.Stream error metadata { read : (), write : Basics.Never } +-} +customReadWithMeta : + String -> Elm.Expression -> Elm.Expression -> Elm.Expression +customReadWithMeta customReadWithMetaArg_ customReadWithMetaArg_0 customReadWithMetaArg_1 = + Elm.apply + (Elm.value + { importFrom = [ "BackendTask", "Stream" ] + , name = "customReadWithMeta" + , annotation = + Just + (Type.function + [ Type.string + , Type.namedWith [ "Json", "Encode" ] "Value" [] + , Type.namedWith + [ "Json", "Decode" ] + "Decoder" + [ Type.namedWith + [ "Result" ] + "Result" + [ Type.record + [ ( "fatal" + , Type.namedWith + [ "FatalError" ] + "FatalError" + [] + ) + , ( "recoverable", Type.var "error" ) + ] + , Type.var "metadata" + ] + ] + ] + (Type.namedWith + [ "BackendTask", "Stream" ] + "Stream" + [ Type.var "error" + , Type.var "metadata" + , Type.record + [ ( "read", Type.unit ) + , ( "write" + , Type.namedWith [ "Basics" ] "Never" [] + ) + ] + ] + ) + ) + } + ) + [ Elm.string customReadWithMetaArg_ + , customReadWithMetaArg_0 + , customReadWithMetaArg_1 + ] + + +{-| Calls an async function from your `custom-backend-task` definitions and uses the NodeJS `DuplexStream` and metadata function it returns. + +customTransformWithMeta: + String + -> Json.Encode.Value + -> Json.Decode.Decoder (Result.Result { fatal : FatalError.FatalError + , recoverable : error + } metadata) + -> BackendTask.Stream.Stream error metadata { read : (), write : () } +-} +customTransformWithMeta : + String -> Elm.Expression -> Elm.Expression -> Elm.Expression +customTransformWithMeta customTransformWithMetaArg_ customTransformWithMetaArg_0 customTransformWithMetaArg_1 = + Elm.apply + (Elm.value + { importFrom = [ "BackendTask", "Stream" ] + , name = "customTransformWithMeta" + , annotation = + Just + (Type.function + [ Type.string + , Type.namedWith [ "Json", "Encode" ] "Value" [] + , Type.namedWith + [ "Json", "Decode" ] + "Decoder" + [ Type.namedWith + [ "Result" ] + "Result" + [ Type.record + [ ( "fatal" + , Type.namedWith + [ "FatalError" ] + "FatalError" + [] + ) + , ( "recoverable", Type.var "error" ) + ] + , Type.var "metadata" + ] + ] + ] + (Type.namedWith + [ "BackendTask", "Stream" ] + "Stream" + [ Type.var "error" + , Type.var "metadata" + , Type.record + [ ( "read", Type.unit ) + , ( "write", Type.unit ) + ] + ] + ) + ) + } + ) + [ Elm.string customTransformWithMetaArg_ + , customTransformWithMetaArg_0 + , customTransformWithMetaArg_1 + ] + + +{-| Calls an async function from your `custom-backend-task` definitions and uses the NodeJS `WritableStream` and metadata function it returns. + +customWriteWithMeta: + String + -> Json.Encode.Value + -> Json.Decode.Decoder (Result.Result { fatal : FatalError.FatalError + , recoverable : error + } metadata) + -> BackendTask.Stream.Stream error metadata { read : Basics.Never, write : () } +-} +customWriteWithMeta : + String -> Elm.Expression -> Elm.Expression -> Elm.Expression +customWriteWithMeta customWriteWithMetaArg_ customWriteWithMetaArg_0 customWriteWithMetaArg_1 = + Elm.apply + (Elm.value + { importFrom = [ "BackendTask", "Stream" ] + , name = "customWriteWithMeta" + , annotation = + Just + (Type.function + [ Type.string + , Type.namedWith [ "Json", "Encode" ] "Value" [] + , Type.namedWith + [ "Json", "Decode" ] + "Decoder" + [ Type.namedWith + [ "Result" ] + "Result" + [ Type.record + [ ( "fatal" + , Type.namedWith + [ "FatalError" ] + "FatalError" + [] + ) + , ( "recoverable", Type.var "error" ) + ] + , Type.var "metadata" + ] + ] + ] + (Type.namedWith + [ "BackendTask", "Stream" ] + "Stream" + [ Type.var "error" + , Type.var "metadata" + , Type.record + [ ( "read" + , Type.namedWith [ "Basics" ] "Never" [] + ) + , ( "write", Type.unit ) + ] + ] + ) + ) + } + ) + [ Elm.string customWriteWithMetaArg_ + , customWriteWithMetaArg_0 + , customWriteWithMetaArg_1 + ] + + +annotation_ : + { stream : + Type.Annotation -> Type.Annotation -> Type.Annotation -> Type.Annotation + , error : Type.Annotation -> Type.Annotation -> Type.Annotation + , stderrOutput : Type.Annotation + , commandOptions : Type.Annotation + } +annotation_ = + { stream = + \streamArg0 streamArg1 streamArg2 -> + Type.namedWith + [ "BackendTask", "Stream" ] + "Stream" + [ streamArg0, streamArg1, streamArg2 ] + , error = + \errorArg0 errorArg1 -> + Type.namedWith + [ "BackendTask", "Stream" ] + "Error" + [ errorArg0, errorArg1 ] + , stderrOutput = + Type.namedWith [ "BackendTask", "Stream" ] "StderrOutput" [] + , commandOptions = + Type.namedWith [ "BackendTask", "Stream" ] "CommandOptions" [] + } + + +make_ : + { streamError : Elm.Expression -> Elm.Expression + , customError : Elm.Expression -> Elm.Expression -> Elm.Expression + , printStderr : Elm.Expression + , ignoreStderr : Elm.Expression + , mergeStderrAndStdout : Elm.Expression + , stderrInsteadOfStdout : Elm.Expression + } +make_ = + { streamError = + \ar0 -> + Elm.apply + (Elm.value + { importFrom = [ "BackendTask", "Stream" ] + , name = "StreamError" + , annotation = + Just + (Type.namedWith + [] + "Error" + [ Type.var "error", Type.var "body" ] + ) + } + ) + [ ar0 ] + , customError = + \ar0 ar1 -> + Elm.apply + (Elm.value + { importFrom = [ "BackendTask", "Stream" ] + , name = "CustomError" + , annotation = + Just + (Type.namedWith + [] + "Error" + [ Type.var "error", Type.var "body" ] + ) + } + ) + [ ar0, ar1 ] + , printStderr = + Elm.value + { importFrom = [ "BackendTask", "Stream" ] + , name = "PrintStderr" + , annotation = Just (Type.namedWith [] "StderrOutput" []) + } + , ignoreStderr = + Elm.value + { importFrom = [ "BackendTask", "Stream" ] + , name = "IgnoreStderr" + , annotation = Just (Type.namedWith [] "StderrOutput" []) + } + , mergeStderrAndStdout = + Elm.value + { importFrom = [ "BackendTask", "Stream" ] + , name = "MergeStderrAndStdout" + , annotation = Just (Type.namedWith [] "StderrOutput" []) + } + , stderrInsteadOfStdout = + Elm.value + { importFrom = [ "BackendTask", "Stream" ] + , name = "StderrInsteadOfStdout" + , annotation = Just (Type.namedWith [] "StderrOutput" []) + } + } + + +caseOf_ = + { error = + \errorExpression errorTags -> + Elm.Case.custom + errorExpression + (Type.namedWith + [ "BackendTask", "Stream" ] + "Error" + [ Type.var "error", Type.var "body" ] + ) + [ Elm.Case.branch + (Elm.Arg.customType + "StreamError" + errorTags.streamError |> Elm.Arg.item + (Elm.Arg.varWith + "arg_0" + Type.string + ) + ) + Basics.identity + , Elm.Case.branch + (Elm.Arg.customType + "CustomError" + errorTags.customError |> Elm.Arg.item + (Elm.Arg.varWith + "error" + (Type.var "error") + ) |> Elm.Arg.item + (Elm.Arg.varWith + "maybeMaybe" + (Type.maybe + (Type.var + "body" + ) + ) + ) + ) + Basics.identity + ] + , stderrOutput = + \stderrOutputExpression stderrOutputTags -> + Elm.Case.custom + stderrOutputExpression + (Type.namedWith [ "BackendTask", "Stream" ] "StderrOutput" []) + [ Elm.Case.branch + (Elm.Arg.customType + "PrintStderr" + stderrOutputTags.printStderr + ) + Basics.identity + , Elm.Case.branch + (Elm.Arg.customType + "IgnoreStderr" + stderrOutputTags.ignoreStderr + ) + Basics.identity + , Elm.Case.branch + (Elm.Arg.customType + "MergeStderrAndStdout" + stderrOutputTags.mergeStderrAndStdout + ) + Basics.identity + , Elm.Case.branch + (Elm.Arg.customType + "StderrInsteadOfStdout" + stderrOutputTags.stderrInsteadOfStdout + ) + Basics.identity + ] + } + + +call_ : + { pipe : Elm.Expression -> Elm.Expression -> Elm.Expression + , fileRead : Elm.Expression -> Elm.Expression + , fileWrite : Elm.Expression -> Elm.Expression + , fromString : Elm.Expression -> Elm.Expression + , http : Elm.Expression -> Elm.Expression + , httpWithInput : Elm.Expression -> Elm.Expression + , read : Elm.Expression -> Elm.Expression + , readJson : Elm.Expression -> Elm.Expression -> Elm.Expression + , readMetadata : Elm.Expression -> Elm.Expression + , run : Elm.Expression -> Elm.Expression + , command : Elm.Expression -> Elm.Expression -> Elm.Expression + , commandWithOptions : + Elm.Expression -> Elm.Expression -> Elm.Expression -> Elm.Expression + , allowNon0Status : Elm.Expression -> Elm.Expression + , withOutput : Elm.Expression -> Elm.Expression -> Elm.Expression + , withTimeout : Elm.Expression -> Elm.Expression -> Elm.Expression + , customRead : Elm.Expression -> Elm.Expression -> Elm.Expression + , customWrite : Elm.Expression -> Elm.Expression -> Elm.Expression + , customDuplex : Elm.Expression -> Elm.Expression -> Elm.Expression + , customReadWithMeta : + Elm.Expression -> Elm.Expression -> Elm.Expression -> Elm.Expression + , customTransformWithMeta : + Elm.Expression -> Elm.Expression -> Elm.Expression -> Elm.Expression + , customWriteWithMeta : + Elm.Expression -> Elm.Expression -> Elm.Expression -> Elm.Expression + } +call_ = + { pipe = + \pipeArg_ pipeArg_0 -> + Elm.apply + (Elm.value + { importFrom = [ "BackendTask", "Stream" ] + , name = "pipe" + , annotation = + Just + (Type.function + [ Type.namedWith + [ "BackendTask", "Stream" ] + "Stream" + [ Type.var "errorTo" + , Type.var "metaTo" + , Type.record + [ ( "read", Type.var "toReadable" ) + , ( "write", Type.unit ) + ] + ] + , Type.namedWith + [ "BackendTask", "Stream" ] + "Stream" + [ Type.var "errorFrom" + , Type.var "metaFrom" + , Type.record + [ ( "read", Type.unit ) + , ( "write" + , Type.var "fromWriteable" + ) + ] + ] + ] + (Type.namedWith + [ "BackendTask", "Stream" ] + "Stream" + [ Type.var "errorTo" + , Type.var "metaTo" + , Type.record + [ ( "read", Type.var "toReadable" ) + , ( "write" + , Type.var "fromWriteable" + ) + ] + ] + ) + ) + } + ) + [ pipeArg_, pipeArg_0 ] + , fileRead = + \fileReadArg_ -> + Elm.apply + (Elm.value + { importFrom = [ "BackendTask", "Stream" ] + , name = "fileRead" + , annotation = + Just + (Type.function + [ Type.string ] + (Type.namedWith + [ "BackendTask", "Stream" ] + "Stream" + [ Type.unit + , Type.unit + , Type.record + [ ( "read", Type.unit ) + , ( "write" + , Type.namedWith + [ "Basics" ] + "Never" + [] + ) + ] + ] + ) + ) + } + ) + [ fileReadArg_ ] + , fileWrite = + \fileWriteArg_ -> + Elm.apply + (Elm.value + { importFrom = [ "BackendTask", "Stream" ] + , name = "fileWrite" + , annotation = + Just + (Type.function + [ Type.string ] + (Type.namedWith + [ "BackendTask", "Stream" ] + "Stream" + [ Type.unit + , Type.unit + , Type.record + [ ( "read" + , Type.namedWith + [ "Basics" ] + "Never" + [] + ) + , ( "write", Type.unit ) + ] + ] + ) + ) + } + ) + [ fileWriteArg_ ] + , fromString = + \fromStringArg_ -> + Elm.apply + (Elm.value + { importFrom = [ "BackendTask", "Stream" ] + , name = "fromString" + , annotation = + Just + (Type.function + [ Type.string ] + (Type.namedWith + [ "BackendTask", "Stream" ] + "Stream" + [ Type.unit + , Type.unit + , Type.record + [ ( "read", Type.unit ) + , ( "write" + , Type.namedWith + [ "Basics" ] + "Never" + [] + ) + ] + ] + ) + ) + } + ) + [ fromStringArg_ ] + , http = + \httpArg_ -> + Elm.apply + (Elm.value + { importFrom = [ "BackendTask", "Stream" ] + , name = "http" + , annotation = + Just + (Type.function + [ Type.record + [ ( "url", Type.string ) + , ( "method", Type.string ) + , ( "headers" + , Type.list + (Type.tuple Type.string Type.string) + ) + , ( "body" + , Type.namedWith + [ "BackendTask", "Http" ] + "Body" + [] + ) + , ( "retries", Type.maybe Type.int ) + , ( "timeoutInMs", Type.maybe Type.int ) + ] + ] + (Type.namedWith + [ "BackendTask", "Stream" ] + "Stream" + [ Type.namedWith + [ "BackendTask", "Http" ] + "Error" + [] + , Type.namedWith + [ "BackendTask", "Http" ] + "Metadata" + [] + , Type.record + [ ( "read", Type.unit ) + , ( "write" + , Type.namedWith + [ "Basics" ] + "Never" + [] + ) + ] + ] + ) + ) + } + ) + [ httpArg_ ] + , httpWithInput = + \httpWithInputArg_ -> + Elm.apply + (Elm.value + { importFrom = [ "BackendTask", "Stream" ] + , name = "httpWithInput" + , annotation = + Just + (Type.function + [ Type.record + [ ( "url", Type.string ) + , ( "method", Type.string ) + , ( "headers" + , Type.list + (Type.tuple Type.string Type.string) + ) + , ( "retries", Type.maybe Type.int ) + , ( "timeoutInMs", Type.maybe Type.int ) + ] + ] + (Type.namedWith + [ "BackendTask", "Stream" ] + "Stream" + [ Type.namedWith + [ "BackendTask", "Http" ] + "Error" + [] + , Type.namedWith + [ "BackendTask", "Http" ] + "Metadata" + [] + , Type.record + [ ( "read", Type.unit ) + , ( "write", Type.unit ) + ] + ] + ) + ) + } + ) + [ httpWithInputArg_ ] + , read = + \readArg_ -> + Elm.apply + (Elm.value + { importFrom = [ "BackendTask", "Stream" ] + , name = "read" + , annotation = + Just + (Type.function + [ Type.namedWith + [ "BackendTask", "Stream" ] + "Stream" + [ Type.var "error" + , Type.var "metadata" + , Type.record + [ ( "read", Type.unit ) + , ( "write", Type.var "write" ) + ] + ] + ] + (Type.namedWith + [ "BackendTask" ] + "BackendTask" + [ Type.record + [ ( "fatal" + , Type.namedWith + [ "FatalError" ] + "FatalError" + [] + ) + , ( "recoverable" + , Type.namedWith + [ "BackendTask", "Stream" ] + "Error" + [ Type.var "error" + , Type.string + ] + ) + ] + , Type.record + [ ( "metadata", Type.var "metadata" ) + , ( "body", Type.string ) + ] + ] + ) + ) + } + ) + [ readArg_ ] + , readJson = + \readJsonArg_ readJsonArg_0 -> + Elm.apply + (Elm.value + { importFrom = [ "BackendTask", "Stream" ] + , name = "readJson" + , annotation = + Just + (Type.function + [ Type.namedWith + [ "Json", "Decode" ] + "Decoder" + [ Type.var "value" ] + , Type.namedWith + [ "BackendTask", "Stream" ] + "Stream" + [ Type.var "error" + , Type.var "metadata" + , Type.record + [ ( "read", Type.unit ) + , ( "write", Type.var "write" ) + ] + ] + ] + (Type.namedWith + [ "BackendTask" ] + "BackendTask" + [ Type.record + [ ( "fatal" + , Type.namedWith + [ "FatalError" ] + "FatalError" + [] + ) + , ( "recoverable" + , Type.namedWith + [ "BackendTask", "Stream" ] + "Error" + [ Type.var "error" + , Type.var "value" + ] + ) + ] + , Type.record + [ ( "metadata", Type.var "metadata" ) + , ( "body", Type.var "value" ) + ] + ] + ) + ) + } + ) + [ readJsonArg_, readJsonArg_0 ] + , readMetadata = + \readMetadataArg_ -> + Elm.apply + (Elm.value + { importFrom = [ "BackendTask", "Stream" ] + , name = "readMetadata" + , annotation = + Just + (Type.function + [ Type.namedWith + [ "BackendTask", "Stream" ] + "Stream" + [ Type.var "error" + , Type.var "metadata" + , Type.record + [ ( "read", Type.var "read" ) + , ( "write", Type.var "write" ) + ] + ] + ] + (Type.namedWith + [ "BackendTask" ] + "BackendTask" + [ Type.record + [ ( "fatal" + , Type.namedWith + [ "FatalError" ] + "FatalError" + [] + ) + , ( "recoverable" + , Type.namedWith + [ "BackendTask", "Stream" ] + "Error" + [ Type.var "error" + , Type.string + ] + ) + ] + , Type.var "metadata" + ] + ) + ) + } + ) + [ readMetadataArg_ ] + , run = + \runArg_ -> + Elm.apply + (Elm.value + { importFrom = [ "BackendTask", "Stream" ] + , name = "run" + , annotation = + Just + (Type.function + [ Type.namedWith + [ "BackendTask", "Stream" ] + "Stream" + [ Type.var "error" + , Type.var "metadata" + , Type.var "kind" + ] + ] + (Type.namedWith + [ "BackendTask" ] + "BackendTask" + [ Type.namedWith + [ "FatalError" ] + "FatalError" + [] + , Type.unit + ] + ) + ) + } + ) + [ runArg_ ] + , command = + \commandArg_ commandArg_0 -> + Elm.apply + (Elm.value + { importFrom = [ "BackendTask", "Stream" ] + , name = "command" + , annotation = + Just + (Type.function + [ Type.string, Type.list Type.string ] + (Type.namedWith + [ "BackendTask", "Stream" ] + "Stream" + [ Type.int + , Type.unit + , Type.record + [ ( "read", Type.var "read" ) + , ( "write", Type.var "write" ) + ] + ] + ) + ) + } + ) + [ commandArg_, commandArg_0 ] + , commandWithOptions = + \commandWithOptionsArg_ commandWithOptionsArg_0 commandWithOptionsArg_1 -> + Elm.apply + (Elm.value + { importFrom = [ "BackendTask", "Stream" ] + , name = "commandWithOptions" + , annotation = + Just + (Type.function + [ Type.namedWith + [ "BackendTask", "Stream" ] + "CommandOptions" + [] + , Type.string + , Type.list Type.string + ] + (Type.namedWith + [ "BackendTask", "Stream" ] + "Stream" + [ Type.int + , Type.unit + , Type.record + [ ( "read", Type.var "read" ) + , ( "write", Type.var "write" ) + ] + ] + ) + ) + } + ) + [ commandWithOptionsArg_ + , commandWithOptionsArg_0 + , commandWithOptionsArg_1 + ] + , allowNon0Status = + \allowNon0StatusArg_ -> + Elm.apply + (Elm.value + { importFrom = [ "BackendTask", "Stream" ] + , name = "allowNon0Status" + , annotation = + Just + (Type.function + [ Type.namedWith + [ "BackendTask", "Stream" ] + "CommandOptions" + [] + ] + (Type.namedWith + [ "BackendTask", "Stream" ] + "CommandOptions" + [] + ) + ) + } + ) + [ allowNon0StatusArg_ ] + , withOutput = + \withOutputArg_ withOutputArg_0 -> + Elm.apply + (Elm.value + { importFrom = [ "BackendTask", "Stream" ] + , name = "withOutput" + , annotation = + Just + (Type.function + [ Type.namedWith + [ "BackendTask", "Stream" ] + "StderrOutput" + [] + , Type.namedWith + [ "BackendTask", "Stream" ] + "CommandOptions" + [] + ] + (Type.namedWith + [ "BackendTask", "Stream" ] + "CommandOptions" + [] + ) + ) + } + ) + [ withOutputArg_, withOutputArg_0 ] + , withTimeout = + \withTimeoutArg_ withTimeoutArg_0 -> + Elm.apply + (Elm.value + { importFrom = [ "BackendTask", "Stream" ] + , name = "withTimeout" + , annotation = + Just + (Type.function + [ Type.int + , Type.namedWith + [ "BackendTask", "Stream" ] + "CommandOptions" + [] + ] + (Type.namedWith + [ "BackendTask", "Stream" ] + "CommandOptions" + [] + ) + ) + } + ) + [ withTimeoutArg_, withTimeoutArg_0 ] + , customRead = + \customReadArg_ customReadArg_0 -> + Elm.apply + (Elm.value + { importFrom = [ "BackendTask", "Stream" ] + , name = "customRead" + , annotation = + Just + (Type.function + [ Type.string + , Type.namedWith + [ "Json", "Encode" ] + "Value" + [] + ] + (Type.namedWith + [ "BackendTask", "Stream" ] + "Stream" + [ Type.unit + , Type.unit + , Type.record + [ ( "read", Type.unit ) + , ( "write" + , Type.namedWith + [ "Basics" ] + "Never" + [] + ) + ] + ] + ) + ) + } + ) + [ customReadArg_, customReadArg_0 ] + , customWrite = + \customWriteArg_ customWriteArg_0 -> + Elm.apply + (Elm.value + { importFrom = [ "BackendTask", "Stream" ] + , name = "customWrite" + , annotation = + Just + (Type.function + [ Type.string + , Type.namedWith + [ "Json", "Encode" ] + "Value" + [] + ] + (Type.namedWith + [ "BackendTask", "Stream" ] + "Stream" + [ Type.unit + , Type.unit + , Type.record + [ ( "read" + , Type.namedWith + [ "Basics" ] + "Never" + [] + ) + , ( "write", Type.unit ) + ] + ] + ) + ) + } + ) + [ customWriteArg_, customWriteArg_0 ] + , customDuplex = + \customDuplexArg_ customDuplexArg_0 -> + Elm.apply + (Elm.value + { importFrom = [ "BackendTask", "Stream" ] + , name = "customDuplex" + , annotation = + Just + (Type.function + [ Type.string + , Type.namedWith + [ "Json", "Encode" ] + "Value" + [] + ] + (Type.namedWith + [ "BackendTask", "Stream" ] + "Stream" + [ Type.unit + , Type.unit + , Type.record + [ ( "read", Type.unit ) + , ( "write", Type.unit ) + ] + ] + ) + ) + } + ) + [ customDuplexArg_, customDuplexArg_0 ] + , customReadWithMeta = + \customReadWithMetaArg_ customReadWithMetaArg_0 customReadWithMetaArg_1 -> + Elm.apply + (Elm.value + { importFrom = [ "BackendTask", "Stream" ] + , name = "customReadWithMeta" + , annotation = + Just + (Type.function + [ Type.string + , Type.namedWith + [ "Json", "Encode" ] + "Value" + [] + , Type.namedWith + [ "Json", "Decode" ] + "Decoder" + [ Type.namedWith + [ "Result" ] + "Result" + [ Type.record + [ ( "fatal" + , Type.namedWith + [ "FatalError" ] + "FatalError" + [] + ) + , ( "recoverable" + , Type.var "error" + ) + ] + , Type.var "metadata" + ] + ] + ] + (Type.namedWith + [ "BackendTask", "Stream" ] + "Stream" + [ Type.var "error" + , Type.var "metadata" + , Type.record + [ ( "read", Type.unit ) + , ( "write" + , Type.namedWith + [ "Basics" ] + "Never" + [] + ) + ] + ] + ) + ) + } + ) + [ customReadWithMetaArg_ + , customReadWithMetaArg_0 + , customReadWithMetaArg_1 + ] + , customTransformWithMeta = + \customTransformWithMetaArg_ customTransformWithMetaArg_0 customTransformWithMetaArg_1 -> + Elm.apply + (Elm.value + { importFrom = [ "BackendTask", "Stream" ] + , name = "customTransformWithMeta" + , annotation = + Just + (Type.function + [ Type.string + , Type.namedWith + [ "Json", "Encode" ] + "Value" + [] + , Type.namedWith + [ "Json", "Decode" ] + "Decoder" + [ Type.namedWith + [ "Result" ] + "Result" + [ Type.record + [ ( "fatal" + , Type.namedWith + [ "FatalError" ] + "FatalError" + [] + ) + , ( "recoverable" + , Type.var "error" + ) + ] + , Type.var "metadata" + ] + ] + ] + (Type.namedWith + [ "BackendTask", "Stream" ] + "Stream" + [ Type.var "error" + , Type.var "metadata" + , Type.record + [ ( "read", Type.unit ) + , ( "write", Type.unit ) + ] + ] + ) + ) + } + ) + [ customTransformWithMetaArg_ + , customTransformWithMetaArg_0 + , customTransformWithMetaArg_1 + ] + , customWriteWithMeta = + \customWriteWithMetaArg_ customWriteWithMetaArg_0 customWriteWithMetaArg_1 -> + Elm.apply + (Elm.value + { importFrom = [ "BackendTask", "Stream" ] + , name = "customWriteWithMeta" + , annotation = + Just + (Type.function + [ Type.string + , Type.namedWith + [ "Json", "Encode" ] + "Value" + [] + , Type.namedWith + [ "Json", "Decode" ] + "Decoder" + [ Type.namedWith + [ "Result" ] + "Result" + [ Type.record + [ ( "fatal" + , Type.namedWith + [ "FatalError" ] + "FatalError" + [] + ) + , ( "recoverable" + , Type.var "error" + ) + ] + , Type.var "metadata" + ] + ] + ] + (Type.namedWith + [ "BackendTask", "Stream" ] + "Stream" + [ Type.var "error" + , Type.var "metadata" + , Type.record + [ ( "read" + , Type.namedWith + [ "Basics" ] + "Never" + [] + ) + , ( "write", Type.unit ) + ] + ] + ) + ) + } + ) + [ customWriteWithMetaArg_ + , customWriteWithMetaArg_0 + , customWriteWithMetaArg_1 + ] + } + + +values_ : + { pipe : Elm.Expression + , fileRead : Elm.Expression + , fileWrite : Elm.Expression + , fromString : Elm.Expression + , http : Elm.Expression + , httpWithInput : Elm.Expression + , stdin : Elm.Expression + , stdout : Elm.Expression + , stderr : Elm.Expression + , read : Elm.Expression + , readJson : Elm.Expression + , readMetadata : Elm.Expression + , run : Elm.Expression + , command : Elm.Expression + , commandWithOptions : Elm.Expression + , defaultCommandOptions : Elm.Expression + , allowNon0Status : Elm.Expression + , withOutput : Elm.Expression + , withTimeout : Elm.Expression + , gzip : Elm.Expression + , unzip : Elm.Expression + , customRead : Elm.Expression + , customWrite : Elm.Expression + , customDuplex : Elm.Expression + , customReadWithMeta : Elm.Expression + , customTransformWithMeta : Elm.Expression + , customWriteWithMeta : Elm.Expression + } +values_ = + { pipe = + Elm.value + { importFrom = [ "BackendTask", "Stream" ] + , name = "pipe" + , annotation = + Just + (Type.function + [ Type.namedWith + [ "BackendTask", "Stream" ] + "Stream" + [ Type.var "errorTo" + , Type.var "metaTo" + , Type.record + [ ( "read", Type.var "toReadable" ) + , ( "write", Type.unit ) + ] + ] + , Type.namedWith + [ "BackendTask", "Stream" ] + "Stream" + [ Type.var "errorFrom" + , Type.var "metaFrom" + , Type.record + [ ( "read", Type.unit ) + , ( "write", Type.var "fromWriteable" ) + ] + ] + ] + (Type.namedWith + [ "BackendTask", "Stream" ] + "Stream" + [ Type.var "errorTo" + , Type.var "metaTo" + , Type.record + [ ( "read", Type.var "toReadable" ) + , ( "write", Type.var "fromWriteable" ) + ] + ] + ) + ) + } + , fileRead = + Elm.value + { importFrom = [ "BackendTask", "Stream" ] + , name = "fileRead" + , annotation = + Just + (Type.function + [ Type.string ] + (Type.namedWith + [ "BackendTask", "Stream" ] + "Stream" + [ Type.unit + , Type.unit + , Type.record + [ ( "read", Type.unit ) + , ( "write" + , Type.namedWith [ "Basics" ] "Never" [] + ) + ] + ] + ) + ) + } + , fileWrite = + Elm.value + { importFrom = [ "BackendTask", "Stream" ] + , name = "fileWrite" + , annotation = + Just + (Type.function + [ Type.string ] + (Type.namedWith + [ "BackendTask", "Stream" ] + "Stream" + [ Type.unit + , Type.unit + , Type.record + [ ( "read" + , Type.namedWith [ "Basics" ] "Never" [] + ) + , ( "write", Type.unit ) + ] + ] + ) + ) + } + , fromString = + Elm.value + { importFrom = [ "BackendTask", "Stream" ] + , name = "fromString" + , annotation = + Just + (Type.function + [ Type.string ] + (Type.namedWith + [ "BackendTask", "Stream" ] + "Stream" + [ Type.unit + , Type.unit + , Type.record + [ ( "read", Type.unit ) + , ( "write" + , Type.namedWith [ "Basics" ] "Never" [] + ) + ] + ] + ) + ) + } + , http = + Elm.value + { importFrom = [ "BackendTask", "Stream" ] + , name = "http" + , annotation = + Just + (Type.function + [ Type.record + [ ( "url", Type.string ) + , ( "method", Type.string ) + , ( "headers" + , Type.list (Type.tuple Type.string Type.string) + ) + , ( "body" + , Type.namedWith + [ "BackendTask", "Http" ] + "Body" + [] + ) + , ( "retries", Type.maybe Type.int ) + , ( "timeoutInMs", Type.maybe Type.int ) + ] + ] + (Type.namedWith + [ "BackendTask", "Stream" ] + "Stream" + [ Type.namedWith + [ "BackendTask", "Http" ] + "Error" + [] + , Type.namedWith + [ "BackendTask", "Http" ] + "Metadata" + [] + , Type.record + [ ( "read", Type.unit ) + , ( "write" + , Type.namedWith [ "Basics" ] "Never" [] + ) + ] + ] + ) + ) + } + , httpWithInput = + Elm.value + { importFrom = [ "BackendTask", "Stream" ] + , name = "httpWithInput" + , annotation = + Just + (Type.function + [ Type.record + [ ( "url", Type.string ) + , ( "method", Type.string ) + , ( "headers" + , Type.list (Type.tuple Type.string Type.string) + ) + , ( "retries", Type.maybe Type.int ) + , ( "timeoutInMs", Type.maybe Type.int ) + ] + ] + (Type.namedWith + [ "BackendTask", "Stream" ] + "Stream" + [ Type.namedWith + [ "BackendTask", "Http" ] + "Error" + [] + , Type.namedWith + [ "BackendTask", "Http" ] + "Metadata" + [] + , Type.record + [ ( "read", Type.unit ) + , ( "write", Type.unit ) + ] + ] + ) + ) + } + , stdin = + Elm.value + { importFrom = [ "BackendTask", "Stream" ] + , name = "stdin" + , annotation = + Just + (Type.namedWith + [ "BackendTask", "Stream" ] + "Stream" + [ Type.unit + , Type.unit + , Type.record + [ ( "read", Type.unit ) + , ( "write" + , Type.namedWith [ "Basics" ] "Never" [] + ) + ] + ] + ) + } + , stdout = + Elm.value + { importFrom = [ "BackendTask", "Stream" ] + , name = "stdout" + , annotation = + Just + (Type.namedWith + [ "BackendTask", "Stream" ] + "Stream" + [ Type.unit + , Type.unit + , Type.record + [ ( "read" + , Type.namedWith [ "Basics" ] "Never" [] + ) + , ( "write", Type.unit ) + ] + ] + ) + } + , stderr = + Elm.value + { importFrom = [ "BackendTask", "Stream" ] + , name = "stderr" + , annotation = + Just + (Type.namedWith + [ "BackendTask", "Stream" ] + "Stream" + [ Type.unit + , Type.unit + , Type.record + [ ( "read" + , Type.namedWith [ "Basics" ] "Never" [] + ) + , ( "write", Type.unit ) + ] + ] + ) + } + , read = + Elm.value + { importFrom = [ "BackendTask", "Stream" ] + , name = "read" + , annotation = + Just + (Type.function + [ Type.namedWith + [ "BackendTask", "Stream" ] + "Stream" + [ Type.var "error" + , Type.var "metadata" + , Type.record + [ ( "read", Type.unit ) + , ( "write", Type.var "write" ) + ] + ] + ] + (Type.namedWith + [ "BackendTask" ] + "BackendTask" + [ Type.record + [ ( "fatal" + , Type.namedWith + [ "FatalError" ] + "FatalError" + [] + ) + , ( "recoverable" + , Type.namedWith + [ "BackendTask", "Stream" ] + "Error" + [ Type.var "error", Type.string ] + ) + ] + , Type.record + [ ( "metadata", Type.var "metadata" ) + , ( "body", Type.string ) + ] + ] + ) + ) + } + , readJson = + Elm.value + { importFrom = [ "BackendTask", "Stream" ] + , name = "readJson" + , annotation = + Just + (Type.function + [ Type.namedWith + [ "Json", "Decode" ] + "Decoder" + [ Type.var "value" ] + , Type.namedWith + [ "BackendTask", "Stream" ] + "Stream" + [ Type.var "error" + , Type.var "metadata" + , Type.record + [ ( "read", Type.unit ) + , ( "write", Type.var "write" ) + ] + ] + ] + (Type.namedWith + [ "BackendTask" ] + "BackendTask" + [ Type.record + [ ( "fatal" + , Type.namedWith + [ "FatalError" ] + "FatalError" + [] + ) + , ( "recoverable" + , Type.namedWith + [ "BackendTask", "Stream" ] + "Error" + [ Type.var "error", Type.var "value" ] + ) + ] + , Type.record + [ ( "metadata", Type.var "metadata" ) + , ( "body", Type.var "value" ) + ] + ] + ) + ) + } + , readMetadata = + Elm.value + { importFrom = [ "BackendTask", "Stream" ] + , name = "readMetadata" + , annotation = + Just + (Type.function + [ Type.namedWith + [ "BackendTask", "Stream" ] + "Stream" + [ Type.var "error" + , Type.var "metadata" + , Type.record + [ ( "read", Type.var "read" ) + , ( "write", Type.var "write" ) + ] + ] + ] + (Type.namedWith + [ "BackendTask" ] + "BackendTask" + [ Type.record + [ ( "fatal" + , Type.namedWith + [ "FatalError" ] + "FatalError" + [] + ) + , ( "recoverable" + , Type.namedWith + [ "BackendTask", "Stream" ] + "Error" + [ Type.var "error", Type.string ] + ) + ] + , Type.var "metadata" + ] + ) + ) + } + , run = + Elm.value + { importFrom = [ "BackendTask", "Stream" ] + , name = "run" + , annotation = + Just + (Type.function + [ Type.namedWith + [ "BackendTask", "Stream" ] + "Stream" + [ Type.var "error" + , Type.var "metadata" + , Type.var "kind" + ] + ] + (Type.namedWith + [ "BackendTask" ] + "BackendTask" + [ Type.namedWith [ "FatalError" ] "FatalError" [] + , Type.unit + ] + ) + ) + } + , command = + Elm.value + { importFrom = [ "BackendTask", "Stream" ] + , name = "command" + , annotation = + Just + (Type.function + [ Type.string, Type.list Type.string ] + (Type.namedWith + [ "BackendTask", "Stream" ] + "Stream" + [ Type.int + , Type.unit + , Type.record + [ ( "read", Type.var "read" ) + , ( "write", Type.var "write" ) + ] + ] + ) + ) + } + , commandWithOptions = + Elm.value + { importFrom = [ "BackendTask", "Stream" ] + , name = "commandWithOptions" + , annotation = + Just + (Type.function + [ Type.namedWith + [ "BackendTask", "Stream" ] + "CommandOptions" + [] + , Type.string + , Type.list Type.string + ] + (Type.namedWith + [ "BackendTask", "Stream" ] + "Stream" + [ Type.int + , Type.unit + , Type.record + [ ( "read", Type.var "read" ) + , ( "write", Type.var "write" ) + ] + ] + ) + ) + } + , defaultCommandOptions = + Elm.value + { importFrom = [ "BackendTask", "Stream" ] + , name = "defaultCommandOptions" + , annotation = + Just + (Type.namedWith + [ "BackendTask", "Stream" ] + "CommandOptions" + [] + ) + } + , allowNon0Status = + Elm.value + { importFrom = [ "BackendTask", "Stream" ] + , name = "allowNon0Status" + , annotation = + Just + (Type.function + [ Type.namedWith + [ "BackendTask", "Stream" ] + "CommandOptions" + [] + ] + (Type.namedWith + [ "BackendTask", "Stream" ] + "CommandOptions" + [] + ) + ) + } + , withOutput = + Elm.value + { importFrom = [ "BackendTask", "Stream" ] + , name = "withOutput" + , annotation = + Just + (Type.function + [ Type.namedWith + [ "BackendTask", "Stream" ] + "StderrOutput" + [] + , Type.namedWith + [ "BackendTask", "Stream" ] + "CommandOptions" + [] + ] + (Type.namedWith + [ "BackendTask", "Stream" ] + "CommandOptions" + [] + ) + ) + } + , withTimeout = + Elm.value + { importFrom = [ "BackendTask", "Stream" ] + , name = "withTimeout" + , annotation = + Just + (Type.function + [ Type.int + , Type.namedWith + [ "BackendTask", "Stream" ] + "CommandOptions" + [] + ] + (Type.namedWith + [ "BackendTask", "Stream" ] + "CommandOptions" + [] + ) + ) + } + , gzip = + Elm.value + { importFrom = [ "BackendTask", "Stream" ] + , name = "gzip" + , annotation = + Just + (Type.namedWith + [ "BackendTask", "Stream" ] + "Stream" + [ Type.unit + , Type.unit + , Type.record + [ ( "read", Type.unit ), ( "write", Type.unit ) ] + ] + ) + } + , unzip = + Elm.value + { importFrom = [ "BackendTask", "Stream" ] + , name = "unzip" + , annotation = + Just + (Type.namedWith + [ "BackendTask", "Stream" ] + "Stream" + [ Type.unit + , Type.unit + , Type.record + [ ( "read", Type.unit ), ( "write", Type.unit ) ] + ] + ) + } + , customRead = + Elm.value + { importFrom = [ "BackendTask", "Stream" ] + , name = "customRead" + , annotation = + Just + (Type.function + [ Type.string + , Type.namedWith [ "Json", "Encode" ] "Value" [] + ] + (Type.namedWith + [ "BackendTask", "Stream" ] + "Stream" + [ Type.unit + , Type.unit + , Type.record + [ ( "read", Type.unit ) + , ( "write" + , Type.namedWith [ "Basics" ] "Never" [] + ) + ] + ] + ) + ) + } + , customWrite = + Elm.value + { importFrom = [ "BackendTask", "Stream" ] + , name = "customWrite" + , annotation = + Just + (Type.function + [ Type.string + , Type.namedWith [ "Json", "Encode" ] "Value" [] + ] + (Type.namedWith + [ "BackendTask", "Stream" ] + "Stream" + [ Type.unit + , Type.unit + , Type.record + [ ( "read" + , Type.namedWith [ "Basics" ] "Never" [] + ) + , ( "write", Type.unit ) + ] + ] + ) + ) + } + , customDuplex = + Elm.value + { importFrom = [ "BackendTask", "Stream" ] + , name = "customDuplex" + , annotation = + Just + (Type.function + [ Type.string + , Type.namedWith [ "Json", "Encode" ] "Value" [] + ] + (Type.namedWith + [ "BackendTask", "Stream" ] + "Stream" + [ Type.unit + , Type.unit + , Type.record + [ ( "read", Type.unit ) + , ( "write", Type.unit ) + ] + ] + ) + ) + } + , customReadWithMeta = + Elm.value + { importFrom = [ "BackendTask", "Stream" ] + , name = "customReadWithMeta" + , annotation = + Just + (Type.function + [ Type.string + , Type.namedWith [ "Json", "Encode" ] "Value" [] + , Type.namedWith + [ "Json", "Decode" ] + "Decoder" + [ Type.namedWith + [ "Result" ] + "Result" + [ Type.record + [ ( "fatal" + , Type.namedWith + [ "FatalError" ] + "FatalError" + [] + ) + , ( "recoverable", Type.var "error" ) + ] + , Type.var "metadata" + ] + ] + ] + (Type.namedWith + [ "BackendTask", "Stream" ] + "Stream" + [ Type.var "error" + , Type.var "metadata" + , Type.record + [ ( "read", Type.unit ) + , ( "write" + , Type.namedWith [ "Basics" ] "Never" [] + ) + ] + ] + ) + ) + } + , customTransformWithMeta = + Elm.value + { importFrom = [ "BackendTask", "Stream" ] + , name = "customTransformWithMeta" + , annotation = + Just + (Type.function + [ Type.string + , Type.namedWith [ "Json", "Encode" ] "Value" [] + , Type.namedWith + [ "Json", "Decode" ] + "Decoder" + [ Type.namedWith + [ "Result" ] + "Result" + [ Type.record + [ ( "fatal" + , Type.namedWith + [ "FatalError" ] + "FatalError" + [] + ) + , ( "recoverable", Type.var "error" ) + ] + , Type.var "metadata" + ] + ] + ] + (Type.namedWith + [ "BackendTask", "Stream" ] + "Stream" + [ Type.var "error" + , Type.var "metadata" + , Type.record + [ ( "read", Type.unit ) + , ( "write", Type.unit ) + ] + ] + ) + ) + } + , customWriteWithMeta = + Elm.value + { importFrom = [ "BackendTask", "Stream" ] + , name = "customWriteWithMeta" + , annotation = + Just + (Type.function + [ Type.string + , Type.namedWith [ "Json", "Encode" ] "Value" [] + , Type.namedWith + [ "Json", "Decode" ] + "Decoder" + [ Type.namedWith + [ "Result" ] + "Result" + [ Type.record + [ ( "fatal" + , Type.namedWith + [ "FatalError" ] + "FatalError" + [] + ) + , ( "recoverable", Type.var "error" ) + ] + , Type.var "metadata" + ] + ] + ] + (Type.namedWith + [ "BackendTask", "Stream" ] + "Stream" + [ Type.var "error" + , Type.var "metadata" + , Type.record + [ ( "read" + , Type.namedWith [ "Basics" ] "Never" [] + ) + , ( "write", Type.unit ) + ] + ] + ) + ) + } + } \ No newline at end of file diff --git a/elm-open-api-codegen/src/Gen/BackendTask/Time.elm b/elm-open-api-codegen/src/Gen/BackendTask/Time.elm new file mode 100644 index 00000000..ec89104a --- /dev/null +++ b/elm-open-api-codegen/src/Gen/BackendTask/Time.elm @@ -0,0 +1,73 @@ +module Gen.BackendTask.Time exposing ( moduleName_, now, values_ ) + +{-| +# Generated bindings for BackendTask.Time + +@docs moduleName_, now, values_ +-} + + +import Elm +import Elm.Annotation as Type + + +{-| The name of this module. -} +moduleName_ : List String +moduleName_ = + [ "BackendTask", "Time" ] + + +{-| Gives a `Time.Posix` of when the `BackendTask` executes. + + type alias Data = + { time : Time.Posix + } + + data : BackendTask FatalError Data + data = + BackendTask.map Data + BackendTask.Time.now + +It's better to use [`Server.Request.requestTime`](Server-Request#requestTime) or `Pages.builtAt` when those are the semantics +you are looking for. `requestTime` gives you a single reliable and consistent time for when the incoming HTTP request was received in +a server-rendered Route or server-rendered API Route. `Pages.builtAt` gives a single reliable and consistent time when the +site was built. + +`BackendTask.Time.now` gives you the time that it happened to execute, which might give you what you need, but be +aware that the time you get is dependent on how BackendTask's are scheduled and executed internally in elm-pages, and +its best to avoid depending on that variation when possible. + +now: BackendTask.BackendTask error Time.Posix +-} +now : Elm.Expression +now = + Elm.value + { importFrom = [ "BackendTask", "Time" ] + , name = "now" + , annotation = + Just + (Type.namedWith + [ "BackendTask" ] + "BackendTask" + [ Type.var "error", Type.namedWith [ "Time" ] "Posix" [] ] + ) + } + + +values_ : { now : Elm.Expression } +values_ = + { now = + Elm.value + { importFrom = [ "BackendTask", "Time" ] + , name = "now" + , annotation = + Just + (Type.namedWith + [ "BackendTask" ] + "BackendTask" + [ Type.var "error" + , Type.namedWith [ "Time" ] "Posix" [] + ] + ) + } + } \ No newline at end of file diff --git a/elm-open-api-codegen/src/Gen/Base64.elm b/elm-open-api-codegen/src/Gen/Base64.elm new file mode 100644 index 00000000..26c463ad --- /dev/null +++ b/elm-open-api-codegen/src/Gen/Base64.elm @@ -0,0 +1,369 @@ +module Gen.Base64 exposing + ( moduleName_, fromBytes, fromString, toBytes, toString, encoder + , decoder, call_, values_ + ) + +{-| +# Generated bindings for Base64 + +@docs moduleName_, fromBytes, fromString, toBytes, toString, encoder +@docs decoder, call_, values_ +-} + + +import Elm +import Elm.Annotation as Type + + +{-| The name of this module. -} +moduleName_ : List String +moduleName_ = + [ "Base64" ] + + +{-| Convert bytes to a Base64 string. +If you want more control over the process, you should use [`decoder`](#decoder). + +This function should never return `Nothing`, but it uses +[`Bytes.Decode.decode`](https://package.elm-lang.org/packages/elm/bytes/latest/Bytes-Decode#decode), +which returns a `Maybe String`. + +fromBytes: Bytes.Bytes -> Maybe String +-} +fromBytes : Elm.Expression -> Elm.Expression +fromBytes fromBytesArg_ = + Elm.apply + (Elm.value + { importFrom = [ "Base64" ] + , name = "fromBytes" + , annotation = + Just + (Type.function + [ Type.namedWith [ "Bytes" ] "Bytes" [] ] + (Type.maybe Type.string) + ) + } + ) + [ fromBytesArg_ ] + + +{-| Encode a string into a Base64 string. +This function is a wrapper around [`fromBytes`](#fromBytes). + +Similarly, it should never return `Nothing`, but alas, [`Bytes.Decode.decode`](https://package.elm-lang.org/packages/elm/bytes/latest/Bytes-Decode#decode), +which [`fromBytes`](#fromBytes) uses, returns a `Maybe String`. + +fromString: String -> Maybe String +-} +fromString : String -> Elm.Expression +fromString fromStringArg_ = + Elm.apply + (Elm.value + { importFrom = [ "Base64" ] + , name = "fromString" + , annotation = + Just (Type.function [ Type.string ] (Type.maybe Type.string)) + } + ) + [ Elm.string fromStringArg_ ] + + +{-| Convert a Base64 string to bytes. +If you want more control over the process, you should use [`encoder`](#encoder). + +This function fails (returns `Nothing`) if you give it an invalid Base64 sequence. + +toBytes: String -> Maybe Bytes.Bytes +-} +toBytes : String -> Elm.Expression +toBytes toBytesArg_ = + Elm.apply + (Elm.value + { importFrom = [ "Base64" ] + , name = "toBytes" + , annotation = + Just + (Type.function + [ Type.string ] + (Type.maybe (Type.namedWith [ "Bytes" ] "Bytes" [])) + ) + } + ) + [ Elm.string toBytesArg_ ] + + +{-| Decode a Base64 string into a string. +This function is a wrapper around [`toBytes`](#toBytes). + +It will fail (return `Nothing`) if you give it an invalid Base64 sequence. + +toString: String -> Maybe String +-} +toString : String -> Elm.Expression +toString toStringArg_ = + Elm.apply + (Elm.value + { importFrom = [ "Base64" ] + , name = "toString" + , annotation = + Just (Type.function [ Type.string ] (Type.maybe Type.string)) + } + ) + [ Elm.string toStringArg_ ] + + +{-| `encoder` returns a bytes encoder. It fails if the string that is passed +to it is not a valid Base64 sequence. + +It's used in [`toBytes`](#toBytes): + + toBytes : String -> Maybe Bytes + toBytes string = + Maybe.map Bytes.Encode.encode (encoder string) + +encoder: String -> Maybe Bytes.Encode.Encoder +-} +encoder : String -> Elm.Expression +encoder encoderArg_ = + Elm.apply + (Elm.value + { importFrom = [ "Base64" ] + , name = "encoder" + , annotation = + Just + (Type.function + [ Type.string ] + (Type.maybe + (Type.namedWith + [ "Bytes", "Encode" ] + "Encoder" + [] + ) + ) + ) + } + ) + [ Elm.string encoderArg_ ] + + +{-| `decoder width` is a bytes decoder that will convert `width` bytes into a +Base64 string. + +It's used in [`fromBytes`](#fromBytes): + + fromBytes : Bytes -> Maybe String + fromBytes bytes = + Bytes.Decode.decode (decoder (Bytes.width bytes)) bytes + +decoder: Int -> Bytes.Decode.Decoder String +-} +decoder : Int -> Elm.Expression +decoder decoderArg_ = + Elm.apply + (Elm.value + { importFrom = [ "Base64" ] + , name = "decoder" + , annotation = + Just + (Type.function + [ Type.int ] + (Type.namedWith + [ "Bytes", "Decode" ] + "Decoder" + [ Type.string ] + ) + ) + } + ) + [ Elm.int decoderArg_ ] + + +call_ : + { fromBytes : Elm.Expression -> Elm.Expression + , fromString : Elm.Expression -> Elm.Expression + , toBytes : Elm.Expression -> Elm.Expression + , toString : Elm.Expression -> Elm.Expression + , encoder : Elm.Expression -> Elm.Expression + , decoder : Elm.Expression -> Elm.Expression + } +call_ = + { fromBytes = + \fromBytesArg_ -> + Elm.apply + (Elm.value + { importFrom = [ "Base64" ] + , name = "fromBytes" + , annotation = + Just + (Type.function + [ Type.namedWith [ "Bytes" ] "Bytes" [] ] + (Type.maybe Type.string) + ) + } + ) + [ fromBytesArg_ ] + , fromString = + \fromStringArg_ -> + Elm.apply + (Elm.value + { importFrom = [ "Base64" ] + , name = "fromString" + , annotation = + Just + (Type.function + [ Type.string ] + (Type.maybe Type.string) + ) + } + ) + [ fromStringArg_ ] + , toBytes = + \toBytesArg_ -> + Elm.apply + (Elm.value + { importFrom = [ "Base64" ] + , name = "toBytes" + , annotation = + Just + (Type.function + [ Type.string ] + (Type.maybe + (Type.namedWith [ "Bytes" ] "Bytes" []) + ) + ) + } + ) + [ toBytesArg_ ] + , toString = + \toStringArg_ -> + Elm.apply + (Elm.value + { importFrom = [ "Base64" ] + , name = "toString" + , annotation = + Just + (Type.function + [ Type.string ] + (Type.maybe Type.string) + ) + } + ) + [ toStringArg_ ] + , encoder = + \encoderArg_ -> + Elm.apply + (Elm.value + { importFrom = [ "Base64" ] + , name = "encoder" + , annotation = + Just + (Type.function + [ Type.string ] + (Type.maybe + (Type.namedWith + [ "Bytes", "Encode" ] + "Encoder" + [] + ) + ) + ) + } + ) + [ encoderArg_ ] + , decoder = + \decoderArg_ -> + Elm.apply + (Elm.value + { importFrom = [ "Base64" ] + , name = "decoder" + , annotation = + Just + (Type.function + [ Type.int ] + (Type.namedWith + [ "Bytes", "Decode" ] + "Decoder" + [ Type.string ] + ) + ) + } + ) + [ decoderArg_ ] + } + + +values_ : + { fromBytes : Elm.Expression + , fromString : Elm.Expression + , toBytes : Elm.Expression + , toString : Elm.Expression + , encoder : Elm.Expression + , decoder : Elm.Expression + } +values_ = + { fromBytes = + Elm.value + { importFrom = [ "Base64" ] + , name = "fromBytes" + , annotation = + Just + (Type.function + [ Type.namedWith [ "Bytes" ] "Bytes" [] ] + (Type.maybe Type.string) + ) + } + , fromString = + Elm.value + { importFrom = [ "Base64" ] + , name = "fromString" + , annotation = + Just (Type.function [ Type.string ] (Type.maybe Type.string)) + } + , toBytes = + Elm.value + { importFrom = [ "Base64" ] + , name = "toBytes" + , annotation = + Just + (Type.function + [ Type.string ] + (Type.maybe (Type.namedWith [ "Bytes" ] "Bytes" [])) + ) + } + , toString = + Elm.value + { importFrom = [ "Base64" ] + , name = "toString" + , annotation = + Just (Type.function [ Type.string ] (Type.maybe Type.string)) + } + , encoder = + Elm.value + { importFrom = [ "Base64" ] + , name = "encoder" + , annotation = + Just + (Type.function + [ Type.string ] + (Type.maybe + (Type.namedWith [ "Bytes", "Encode" ] "Encoder" [] + ) + ) + ) + } + , decoder = + Elm.value + { importFrom = [ "Base64" ] + , name = "decoder" + , annotation = + Just + (Type.function + [ Type.int ] + (Type.namedWith + [ "Bytes", "Decode" ] + "Decoder" + [ Type.string ] + ) + ) + } + } \ No newline at end of file diff --git a/elm-open-api-codegen/src/Gen/Basics.elm b/elm-open-api-codegen/src/Gen/Basics.elm new file mode 100644 index 00000000..02629e9b --- /dev/null +++ b/elm-open-api-codegen/src/Gen/Basics.elm @@ -0,0 +1,1715 @@ +module Gen.Basics exposing + ( moduleName_, toFloat, round, floor, ceiling, truncate + , max, min, compare, not, xor, modBy, remainderBy + , negate, abs, clamp, sqrt, logBase, e, degrees + , radians, turns, pi, cos, sin, tan, acos + , asin, atan, atan2, toPolar, fromPolar, isNaN, isInfinite + , identity, always, never, annotation_, make_, caseOf_, call_ + , values_ + ) + +{-| +# Generated bindings for Basics + +@docs moduleName_, toFloat, round, floor, ceiling, truncate +@docs max, min, compare, not, xor, modBy +@docs remainderBy, negate, abs, clamp, sqrt, logBase +@docs e, degrees, radians, turns, pi, cos +@docs sin, tan, acos, asin, atan, atan2 +@docs toPolar, fromPolar, isNaN, isInfinite, identity, always +@docs never, annotation_, make_, caseOf_, call_, values_ +-} + + +import Elm +import Elm.Annotation as Type +import Elm.Arg +import Elm.Case + + +{-| The name of this module. -} +moduleName_ : List String +moduleName_ = + [ "Basics" ] + + +{-| Convert an integer into a float. Useful when mixing `Int` and `Float` +values like this: + + halfOf : Int -> Float + halfOf number = + toFloat number / 2 + +toFloat: Int -> Float +-} +toFloat : Int -> Elm.Expression +toFloat toFloatArg_ = + Elm.apply + (Elm.value + { importFrom = [ "Basics" ] + , name = "toFloat" + , annotation = Just (Type.function [ Type.int ] Type.float) + } + ) + [ Elm.int toFloatArg_ ] + + +{-| Round a number to the nearest integer. + + round 1.0 == 1 + round 1.2 == 1 + round 1.5 == 2 + round 1.8 == 2 + + round -1.2 == -1 + round -1.5 == -1 + round -1.8 == -2 + +round: Float -> Int +-} +round : Float -> Elm.Expression +round roundArg_ = + Elm.apply + (Elm.value + { importFrom = [ "Basics" ] + , name = "round" + , annotation = Just (Type.function [ Type.float ] Type.int) + } + ) + [ Elm.float roundArg_ ] + + +{-| Floor function, rounding down. + + floor 1.0 == 1 + floor 1.2 == 1 + floor 1.5 == 1 + floor 1.8 == 1 + + floor -1.2 == -2 + floor -1.5 == -2 + floor -1.8 == -2 + +floor: Float -> Int +-} +floor : Float -> Elm.Expression +floor floorArg_ = + Elm.apply + (Elm.value + { importFrom = [ "Basics" ] + , name = "floor" + , annotation = Just (Type.function [ Type.float ] Type.int) + } + ) + [ Elm.float floorArg_ ] + + +{-| Ceiling function, rounding up. + + ceiling 1.0 == 1 + ceiling 1.2 == 2 + ceiling 1.5 == 2 + ceiling 1.8 == 2 + + ceiling -1.2 == -1 + ceiling -1.5 == -1 + ceiling -1.8 == -1 + +ceiling: Float -> Int +-} +ceiling : Float -> Elm.Expression +ceiling ceilingArg_ = + Elm.apply + (Elm.value + { importFrom = [ "Basics" ] + , name = "ceiling" + , annotation = Just (Type.function [ Type.float ] Type.int) + } + ) + [ Elm.float ceilingArg_ ] + + +{-| Truncate a number, rounding towards zero. + + truncate 1.0 == 1 + truncate 1.2 == 1 + truncate 1.5 == 1 + truncate 1.8 == 1 + + truncate -1.2 == -1 + truncate -1.5 == -1 + truncate -1.8 == -1 + +truncate: Float -> Int +-} +truncate : Float -> Elm.Expression +truncate truncateArg_ = + Elm.apply + (Elm.value + { importFrom = [ "Basics" ] + , name = "truncate" + , annotation = Just (Type.function [ Type.float ] Type.int) + } + ) + [ Elm.float truncateArg_ ] + + +{-| Find the larger of two comparables. + + max 42 12345678 == 12345678 + max "abc" "xyz" == "xyz" + +max: comparable -> comparable -> comparable +-} +max : Elm.Expression -> Elm.Expression -> Elm.Expression +max maxArg_ maxArg_0 = + Elm.apply + (Elm.value + { importFrom = [ "Basics" ] + , name = "max" + , annotation = + Just + (Type.function + [ Type.var "comparable", Type.var "comparable" ] + (Type.var "comparable") + ) + } + ) + [ maxArg_, maxArg_0 ] + + +{-| Find the smaller of two comparables. + + min 42 12345678 == 42 + min "abc" "xyz" == "abc" + +min: comparable -> comparable -> comparable +-} +min : Elm.Expression -> Elm.Expression -> Elm.Expression +min minArg_ minArg_0 = + Elm.apply + (Elm.value + { importFrom = [ "Basics" ] + , name = "min" + , annotation = + Just + (Type.function + [ Type.var "comparable", Type.var "comparable" ] + (Type.var "comparable") + ) + } + ) + [ minArg_, minArg_0 ] + + +{-| Compare any two comparable values. Comparable values include `String`, +`Char`, `Int`, `Float`, or a list or tuple containing comparable values. These +are also the only values that work as `Dict` keys or `Set` members. + + compare 3 4 == LT + compare 4 4 == EQ + compare 5 4 == GT + +compare: comparable -> comparable -> Basics.Order +-} +compare : Elm.Expression -> Elm.Expression -> Elm.Expression +compare compareArg_ compareArg_0 = + Elm.apply + (Elm.value + { importFrom = [ "Basics" ] + , name = "compare" + , annotation = + Just + (Type.function + [ Type.var "comparable", Type.var "comparable" ] + (Type.namedWith [ "Basics" ] "Order" []) + ) + } + ) + [ compareArg_, compareArg_0 ] + + +{-| Negate a boolean value. + + not True == False + not False == True + +not: Bool -> Bool +-} +not : Bool -> Elm.Expression +not notArg_ = + Elm.apply + (Elm.value + { importFrom = [ "Basics" ] + , name = "not" + , annotation = Just (Type.function [ Type.bool ] Type.bool) + } + ) + [ Elm.bool notArg_ ] + + +{-| The exclusive-or operator. `True` if exactly one input is `True`. + + xor True True == False + xor True False == True + xor False True == True + xor False False == False + +xor: Bool -> Bool -> Bool +-} +xor : Bool -> Bool -> Elm.Expression +xor xorArg_ xorArg_0 = + Elm.apply + (Elm.value + { importFrom = [ "Basics" ] + , name = "xor" + , annotation = + Just (Type.function [ Type.bool, Type.bool ] Type.bool) + } + ) + [ Elm.bool xorArg_, Elm.bool xorArg_0 ] + + +{-| Perform [modular arithmetic](https://en.wikipedia.org/wiki/Modular_arithmetic). +A common trick is to use (n mod 2) to detect even and odd numbers: + + modBy 2 0 == 0 + modBy 2 1 == 1 + modBy 2 2 == 0 + modBy 2 3 == 1 + +Our `modBy` function works in the typical mathematical way when you run into +negative numbers: + + List.map (modBy 4) [ -5, -4, -3, -2, -1, 0, 1, 2, 3, 4, 5 ] + -- [ 3, 0, 1, 2, 3, 0, 1, 2, 3, 0, 1 ] + +Use [`remainderBy`](#remainderBy) for a different treatment of negative numbers, +or read Daan Leijen’s [Division and Modulus for Computer Scientists][dm] for more +information. + +[dm]: https://www.microsoft.com/en-us/research/wp-content/uploads/2016/02/divmodnote-letter.pdf + +modBy: Int -> Int -> Int +-} +modBy : Int -> Int -> Elm.Expression +modBy modByArg_ modByArg_0 = + Elm.apply + (Elm.value + { importFrom = [ "Basics" ] + , name = "modBy" + , annotation = Just (Type.function [ Type.int, Type.int ] Type.int) + } + ) + [ Elm.int modByArg_, Elm.int modByArg_0 ] + + +{-| Get the remainder after division. Here are bunch of examples of dividing by four: + + List.map (remainderBy 4) [ -5, -4, -3, -2, -1, 0, 1, 2, 3, 4, 5 ] + -- [ -1, 0, -3, -2, -1, 0, 1, 2, 3, 0, 1 ] + +Use [`modBy`](#modBy) for a different treatment of negative numbers, +or read Daan Leijen’s [Division and Modulus for Computer Scientists][dm] for more +information. + +[dm]: https://www.microsoft.com/en-us/research/wp-content/uploads/2016/02/divmodnote-letter.pdf + +remainderBy: Int -> Int -> Int +-} +remainderBy : Int -> Int -> Elm.Expression +remainderBy remainderByArg_ remainderByArg_0 = + Elm.apply + (Elm.value + { importFrom = [ "Basics" ] + , name = "remainderBy" + , annotation = Just (Type.function [ Type.int, Type.int ] Type.int) + } + ) + [ Elm.int remainderByArg_, Elm.int remainderByArg_0 ] + + +{-| Negate a number. + + negate 42 == -42 + negate -42 == 42 + negate 0 == 0 + +negate: number -> number +-} +negate : Elm.Expression -> Elm.Expression +negate negateArg_ = + Elm.apply + (Elm.value + { importFrom = [ "Basics" ] + , name = "negate" + , annotation = + Just (Type.function [ Type.var "number" ] (Type.var "number")) + } + ) + [ negateArg_ ] + + +{-| Get the [absolute value][abs] of a number. + + abs 16 == 16 + abs -4 == 4 + abs -8.5 == 8.5 + abs 3.14 == 3.14 + +[abs]: https://en.wikipedia.org/wiki/Absolute_value + +abs: number -> number +-} +abs : Elm.Expression -> Elm.Expression +abs absArg_ = + Elm.apply + (Elm.value + { importFrom = [ "Basics" ] + , name = "abs" + , annotation = + Just (Type.function [ Type.var "number" ] (Type.var "number")) + } + ) + [ absArg_ ] + + +{-| Clamps a number within a given range. With the expression +`clamp 100 200 x` the results are as follows: + + 100 if x < 100 + x if 100 <= x < 200 + 200 if 200 <= x + +clamp: number -> number -> number -> number +-} +clamp : Elm.Expression -> Elm.Expression -> Elm.Expression -> Elm.Expression +clamp clampArg_ clampArg_0 clampArg_1 = + Elm.apply + (Elm.value + { importFrom = [ "Basics" ] + , name = "clamp" + , annotation = + Just + (Type.function + [ Type.var "number" + , Type.var "number" + , Type.var "number" + ] + (Type.var "number") + ) + } + ) + [ clampArg_, clampArg_0, clampArg_1 ] + + +{-| Take the square root of a number. + + sqrt 4 == 2 + sqrt 9 == 3 + sqrt 16 == 4 + sqrt 25 == 5 + +sqrt: Float -> Float +-} +sqrt : Float -> Elm.Expression +sqrt sqrtArg_ = + Elm.apply + (Elm.value + { importFrom = [ "Basics" ] + , name = "sqrt" + , annotation = Just (Type.function [ Type.float ] Type.float) + } + ) + [ Elm.float sqrtArg_ ] + + +{-| Calculate the logarithm of a number with a given base. + + logBase 10 100 == 2 + logBase 2 256 == 8 + +logBase: Float -> Float -> Float +-} +logBase : Float -> Float -> Elm.Expression +logBase logBaseArg_ logBaseArg_0 = + Elm.apply + (Elm.value + { importFrom = [ "Basics" ] + , name = "logBase" + , annotation = + Just (Type.function [ Type.float, Type.float ] Type.float) + } + ) + [ Elm.float logBaseArg_, Elm.float logBaseArg_0 ] + + +{-| An approximation of e. + +e: Float +-} +e : Elm.Expression +e = + Elm.value + { importFrom = [ "Basics" ], name = "e", annotation = Just Type.float } + + +{-| Convert degrees to standard Elm angles (radians). + + degrees 180 == 3.141592653589793 + +degrees: Float -> Float +-} +degrees : Float -> Elm.Expression +degrees degreesArg_ = + Elm.apply + (Elm.value + { importFrom = [ "Basics" ] + , name = "degrees" + , annotation = Just (Type.function [ Type.float ] Type.float) + } + ) + [ Elm.float degreesArg_ ] + + +{-| Convert radians to standard Elm angles (radians). + + radians pi == 3.141592653589793 + +radians: Float -> Float +-} +radians : Float -> Elm.Expression +radians radiansArg_ = + Elm.apply + (Elm.value + { importFrom = [ "Basics" ] + , name = "radians" + , annotation = Just (Type.function [ Type.float ] Type.float) + } + ) + [ Elm.float radiansArg_ ] + + +{-| Convert turns to standard Elm angles (radians). One turn is equal to 360°. + + turns (1/2) == 3.141592653589793 + +turns: Float -> Float +-} +turns : Float -> Elm.Expression +turns turnsArg_ = + Elm.apply + (Elm.value + { importFrom = [ "Basics" ] + , name = "turns" + , annotation = Just (Type.function [ Type.float ] Type.float) + } + ) + [ Elm.float turnsArg_ ] + + +{-| An approximation of pi. + +pi: Float +-} +pi : Elm.Expression +pi = + Elm.value + { importFrom = [ "Basics" ], name = "pi", annotation = Just Type.float } + + +{-| Figure out the cosine given an angle in radians. + + cos (degrees 60) == 0.5000000000000001 + cos (turns (1/6)) == 0.5000000000000001 + cos (radians (pi/3)) == 0.5000000000000001 + cos (pi/3) == 0.5000000000000001 + +cos: Float -> Float +-} +cos : Float -> Elm.Expression +cos cosArg_ = + Elm.apply + (Elm.value + { importFrom = [ "Basics" ] + , name = "cos" + , annotation = Just (Type.function [ Type.float ] Type.float) + } + ) + [ Elm.float cosArg_ ] + + +{-| Figure out the sine given an angle in radians. + + sin (degrees 30) == 0.49999999999999994 + sin (turns (1/12)) == 0.49999999999999994 + sin (radians (pi/6)) == 0.49999999999999994 + sin (pi/6) == 0.49999999999999994 + +sin: Float -> Float +-} +sin : Float -> Elm.Expression +sin sinArg_ = + Elm.apply + (Elm.value + { importFrom = [ "Basics" ] + , name = "sin" + , annotation = Just (Type.function [ Type.float ] Type.float) + } + ) + [ Elm.float sinArg_ ] + + +{-| Figure out the tangent given an angle in radians. + + tan (degrees 45) == 0.9999999999999999 + tan (turns (1/8)) == 0.9999999999999999 + tan (radians (pi/4)) == 0.9999999999999999 + tan (pi/4) == 0.9999999999999999 + +tan: Float -> Float +-} +tan : Float -> Elm.Expression +tan tanArg_ = + Elm.apply + (Elm.value + { importFrom = [ "Basics" ] + , name = "tan" + , annotation = Just (Type.function [ Type.float ] Type.float) + } + ) + [ Elm.float tanArg_ ] + + +{-| Figure out the arccosine for `adjacent / hypotenuse` in radians: + + acos (1/2) == 1.0471975511965979 -- 60° or pi/3 radians + +acos: Float -> Float +-} +acos : Float -> Elm.Expression +acos acosArg_ = + Elm.apply + (Elm.value + { importFrom = [ "Basics" ] + , name = "acos" + , annotation = Just (Type.function [ Type.float ] Type.float) + } + ) + [ Elm.float acosArg_ ] + + +{-| Figure out the arcsine for `opposite / hypotenuse` in radians: + + asin (1/2) == 0.5235987755982989 -- 30° or pi/6 radians + +asin: Float -> Float +-} +asin : Float -> Elm.Expression +asin asinArg_ = + Elm.apply + (Elm.value + { importFrom = [ "Basics" ] + , name = "asin" + , annotation = Just (Type.function [ Type.float ] Type.float) + } + ) + [ Elm.float asinArg_ ] + + +{-| This helps you find the angle (in radians) to an `(x,y)` coordinate, but +in a way that is rarely useful in programming. **You probably want +[`atan2`](#atan2) instead!** + +This version takes `y/x` as its argument, so there is no way to know whether +the negative signs comes from the `y` or `x` value. So as we go counter-clockwise +around the origin from point `(1,1)` to `(1,-1)` to `(-1,-1)` to `(-1,1)` we do +not get angles that go in the full circle: + + atan ( 1 / 1 ) == 0.7853981633974483 -- 45° or pi/4 radians + atan ( 1 / -1 ) == -0.7853981633974483 -- 315° or 7*pi/4 radians + atan ( -1 / -1 ) == 0.7853981633974483 -- 45° or pi/4 radians + atan ( -1 / 1 ) == -0.7853981633974483 -- 315° or 7*pi/4 radians + +Notice that everything is between `pi/2` and `-pi/2`. That is pretty useless +for figuring out angles in any sort of visualization, so again, check out +[`atan2`](#atan2) instead! + +atan: Float -> Float +-} +atan : Float -> Elm.Expression +atan atanArg_ = + Elm.apply + (Elm.value + { importFrom = [ "Basics" ] + , name = "atan" + , annotation = Just (Type.function [ Type.float ] Type.float) + } + ) + [ Elm.float atanArg_ ] + + +{-| This helps you find the angle (in radians) to an `(x,y)` coordinate. +So rather than saying `atan (y/x)` you say `atan2 y x` and you can get a full +range of angles: + + atan2 1 1 == 0.7853981633974483 -- 45° or pi/4 radians + atan2 1 -1 == 2.356194490192345 -- 135° or 3*pi/4 radians + atan2 -1 -1 == -2.356194490192345 -- 225° or 5*pi/4 radians + atan2 -1 1 == -0.7853981633974483 -- 315° or 7*pi/4 radians + +atan2: Float -> Float -> Float +-} +atan2 : Float -> Float -> Elm.Expression +atan2 atan2Arg_ atan2Arg_0 = + Elm.apply + (Elm.value + { importFrom = [ "Basics" ] + , name = "atan2" + , annotation = + Just (Type.function [ Type.float, Type.float ] Type.float) + } + ) + [ Elm.float atan2Arg_, Elm.float atan2Arg_0 ] + + +{-| Convert Cartesian coordinates (x,y) to polar coordinates (r,θ). + + toPolar (3, 4) == ( 5, 0.9272952180016122) + toPolar (5,12) == (13, 1.1760052070951352) + +toPolar: ( Float, Float ) -> ( Float, Float ) +-} +toPolar : Elm.Expression -> Elm.Expression +toPolar toPolarArg_ = + Elm.apply + (Elm.value + { importFrom = [ "Basics" ] + , name = "toPolar" + , annotation = + Just + (Type.function + [ Type.tuple Type.float Type.float ] + (Type.tuple Type.float Type.float) + ) + } + ) + [ toPolarArg_ ] + + +{-| Convert polar coordinates (r,θ) to Cartesian coordinates (x,y). + + fromPolar (sqrt 2, degrees 45) == (1, 1) + +fromPolar: ( Float, Float ) -> ( Float, Float ) +-} +fromPolar : Elm.Expression -> Elm.Expression +fromPolar fromPolarArg_ = + Elm.apply + (Elm.value + { importFrom = [ "Basics" ] + , name = "fromPolar" + , annotation = + Just + (Type.function + [ Type.tuple Type.float Type.float ] + (Type.tuple Type.float Type.float) + ) + } + ) + [ fromPolarArg_ ] + + +{-| Determine whether a float is an undefined or unrepresentable number. +NaN stands for *not a number* and it is [a standardized part of floating point +numbers](https://en.wikipedia.org/wiki/NaN). + + isNaN (0/0) == True + isNaN (sqrt -1) == True + isNaN (1/0) == False -- infinity is a number + isNaN 1 == False + +isNaN: Float -> Bool +-} +isNaN : Float -> Elm.Expression +isNaN isNaNArg_ = + Elm.apply + (Elm.value + { importFrom = [ "Basics" ] + , name = "isNaN" + , annotation = Just (Type.function [ Type.float ] Type.bool) + } + ) + [ Elm.float isNaNArg_ ] + + +{-| Determine whether a float is positive or negative infinity. + + isInfinite (0/0) == False + isInfinite (sqrt -1) == False + isInfinite (1/0) == True + isInfinite 1 == False + +Notice that NaN is not infinite! For float `n` to be finite implies that +`not (isInfinite n || isNaN n)` evaluates to `True`. + +isInfinite: Float -> Bool +-} +isInfinite : Float -> Elm.Expression +isInfinite isInfiniteArg_ = + Elm.apply + (Elm.value + { importFrom = [ "Basics" ] + , name = "isInfinite" + , annotation = Just (Type.function [ Type.float ] Type.bool) + } + ) + [ Elm.float isInfiniteArg_ ] + + +{-| Given a value, returns exactly the same value. This is called +[the identity function](https://en.wikipedia.org/wiki/Identity_function). + +identity: a -> a +-} +identity : Elm.Expression -> Elm.Expression +identity identityArg_ = + Elm.apply + (Elm.value + { importFrom = [ "Basics" ] + , name = "identity" + , annotation = Just (Type.function [ Type.var "a" ] (Type.var "a")) + } + ) + [ identityArg_ ] + + +{-| Create a function that *always* returns the same value. Useful with +functions like `map`: + + List.map (always 0) [1,2,3,4,5] == [0,0,0,0,0] + + -- List.map (\_ -> 0) [1,2,3,4,5] == [0,0,0,0,0] + -- always = (\x _ -> x) + +always: a -> b -> a +-} +always : Elm.Expression -> Elm.Expression -> Elm.Expression +always alwaysArg_ alwaysArg_0 = + Elm.apply + (Elm.value + { importFrom = [ "Basics" ] + , name = "always" + , annotation = + Just + (Type.function + [ Type.var "a", Type.var "b" ] + (Type.var "a") + ) + } + ) + [ alwaysArg_, alwaysArg_0 ] + + +{-| A function that can never be called. Seems extremely pointless, but it +*can* come in handy. Imagine you have some HTML that should never produce any +messages. And say you want to use it in some other HTML that *does* produce +messages. You could say: + + import Html exposing (..) + + embedHtml : Html Never -> Html msg + embedHtml staticStuff = + div [] + [ text "hello" + , Html.map never staticStuff + ] + +So the `never` function is basically telling the type system, make sure no one +ever calls me! + +never: Basics.Never -> a +-} +never : Elm.Expression -> Elm.Expression +never neverArg_ = + Elm.apply + (Elm.value + { importFrom = [ "Basics" ] + , name = "never" + , annotation = + Just + (Type.function + [ Type.namedWith [ "Basics" ] "Never" [] ] + (Type.var "a") + ) + } + ) + [ neverArg_ ] + + +annotation_ : + { int : Type.Annotation + , float : Type.Annotation + , order : Type.Annotation + , bool : Type.Annotation + , never : Type.Annotation + } +annotation_ = + { int = Type.namedWith [] "Int" [] + , float = Type.namedWith [] "Float" [] + , order = Type.namedWith [ "Basics" ] "Order" [] + , bool = Type.namedWith [] "Bool" [] + , never = Type.namedWith [] "Never" [] + } + + +make_ : + { lT : Elm.Expression + , eQ : Elm.Expression + , gT : Elm.Expression + , true : Elm.Expression + , false : Elm.Expression + } +make_ = + { lT = + Elm.value + { importFrom = [ "Basics" ] + , name = "LT" + , annotation = Just (Type.namedWith [] "Order" []) + } + , eQ = + Elm.value + { importFrom = [ "Basics" ] + , name = "EQ" + , annotation = Just (Type.namedWith [] "Order" []) + } + , gT = + Elm.value + { importFrom = [ "Basics" ] + , name = "GT" + , annotation = Just (Type.namedWith [] "Order" []) + } + , true = + Elm.value + { importFrom = [ "Basics" ] + , name = "True" + , annotation = Just (Type.namedWith [] "Bool" []) + } + , false = + Elm.value + { importFrom = [ "Basics" ] + , name = "False" + , annotation = Just (Type.namedWith [] "Bool" []) + } + } + + +caseOf_ : + { order : + Elm.Expression + -> { lT : Elm.Expression, eQ : Elm.Expression, gT : Elm.Expression } + -> Elm.Expression + , bool : + Elm.Expression + -> { true : Elm.Expression, false : Elm.Expression } + -> Elm.Expression + } +caseOf_ = + { order = + \orderExpression orderTags -> + Elm.Case.custom + orderExpression + (Type.namedWith [ "Basics" ] "Order" []) + [ Elm.Case.branch + (Elm.Arg.customType "LT" orderTags.lT) + Basics.identity + , Elm.Case.branch + (Elm.Arg.customType "EQ" orderTags.eQ) + Basics.identity + , Elm.Case.branch + (Elm.Arg.customType "GT" orderTags.gT) + Basics.identity + ] + , bool = + \boolExpression boolTags -> + Elm.Case.custom + boolExpression + (Type.namedWith [ "Basics" ] "Bool" []) + [ Elm.Case.branch + (Elm.Arg.customType "True" boolTags.true) + Basics.identity + , Elm.Case.branch + (Elm.Arg.customType "False" boolTags.false) + Basics.identity + ] + } + + +call_ : + { toFloat : Elm.Expression -> Elm.Expression + , round : Elm.Expression -> Elm.Expression + , floor : Elm.Expression -> Elm.Expression + , ceiling : Elm.Expression -> Elm.Expression + , truncate : Elm.Expression -> Elm.Expression + , max : Elm.Expression -> Elm.Expression -> Elm.Expression + , min : Elm.Expression -> Elm.Expression -> Elm.Expression + , compare : Elm.Expression -> Elm.Expression -> Elm.Expression + , not : Elm.Expression -> Elm.Expression + , xor : Elm.Expression -> Elm.Expression -> Elm.Expression + , modBy : Elm.Expression -> Elm.Expression -> Elm.Expression + , remainderBy : Elm.Expression -> Elm.Expression -> Elm.Expression + , negate : Elm.Expression -> Elm.Expression + , abs : Elm.Expression -> Elm.Expression + , clamp : + Elm.Expression -> Elm.Expression -> Elm.Expression -> Elm.Expression + , sqrt : Elm.Expression -> Elm.Expression + , logBase : Elm.Expression -> Elm.Expression -> Elm.Expression + , degrees : Elm.Expression -> Elm.Expression + , radians : Elm.Expression -> Elm.Expression + , turns : Elm.Expression -> Elm.Expression + , cos : Elm.Expression -> Elm.Expression + , sin : Elm.Expression -> Elm.Expression + , tan : Elm.Expression -> Elm.Expression + , acos : Elm.Expression -> Elm.Expression + , asin : Elm.Expression -> Elm.Expression + , atan : Elm.Expression -> Elm.Expression + , atan2 : Elm.Expression -> Elm.Expression -> Elm.Expression + , toPolar : Elm.Expression -> Elm.Expression + , fromPolar : Elm.Expression -> Elm.Expression + , isNaN : Elm.Expression -> Elm.Expression + , isInfinite : Elm.Expression -> Elm.Expression + , identity : Elm.Expression -> Elm.Expression + , always : Elm.Expression -> Elm.Expression -> Elm.Expression + , never : Elm.Expression -> Elm.Expression + } +call_ = + { toFloat = + \toFloatArg_ -> + Elm.apply + (Elm.value + { importFrom = [ "Basics" ] + , name = "toFloat" + , annotation = Just (Type.function [ Type.int ] Type.float) + } + ) + [ toFloatArg_ ] + , round = + \roundArg_ -> + Elm.apply + (Elm.value + { importFrom = [ "Basics" ] + , name = "round" + , annotation = Just (Type.function [ Type.float ] Type.int) + } + ) + [ roundArg_ ] + , floor = + \floorArg_ -> + Elm.apply + (Elm.value + { importFrom = [ "Basics" ] + , name = "floor" + , annotation = Just (Type.function [ Type.float ] Type.int) + } + ) + [ floorArg_ ] + , ceiling = + \ceilingArg_ -> + Elm.apply + (Elm.value + { importFrom = [ "Basics" ] + , name = "ceiling" + , annotation = Just (Type.function [ Type.float ] Type.int) + } + ) + [ ceilingArg_ ] + , truncate = + \truncateArg_ -> + Elm.apply + (Elm.value + { importFrom = [ "Basics" ] + , name = "truncate" + , annotation = Just (Type.function [ Type.float ] Type.int) + } + ) + [ truncateArg_ ] + , max = + \maxArg_ maxArg_0 -> + Elm.apply + (Elm.value + { importFrom = [ "Basics" ] + , name = "max" + , annotation = + Just + (Type.function + [ Type.var "comparable" + , Type.var "comparable" + ] + (Type.var "comparable") + ) + } + ) + [ maxArg_, maxArg_0 ] + , min = + \minArg_ minArg_0 -> + Elm.apply + (Elm.value + { importFrom = [ "Basics" ] + , name = "min" + , annotation = + Just + (Type.function + [ Type.var "comparable" + , Type.var "comparable" + ] + (Type.var "comparable") + ) + } + ) + [ minArg_, minArg_0 ] + , compare = + \compareArg_ compareArg_0 -> + Elm.apply + (Elm.value + { importFrom = [ "Basics" ] + , name = "compare" + , annotation = + Just + (Type.function + [ Type.var "comparable" + , Type.var "comparable" + ] + (Type.namedWith [ "Basics" ] "Order" []) + ) + } + ) + [ compareArg_, compareArg_0 ] + , not = + \notArg_ -> + Elm.apply + (Elm.value + { importFrom = [ "Basics" ] + , name = "not" + , annotation = Just (Type.function [ Type.bool ] Type.bool) + } + ) + [ notArg_ ] + , xor = + \xorArg_ xorArg_0 -> + Elm.apply + (Elm.value + { importFrom = [ "Basics" ] + , name = "xor" + , annotation = + Just (Type.function [ Type.bool, Type.bool ] Type.bool) + } + ) + [ xorArg_, xorArg_0 ] + , modBy = + \modByArg_ modByArg_0 -> + Elm.apply + (Elm.value + { importFrom = [ "Basics" ] + , name = "modBy" + , annotation = + Just (Type.function [ Type.int, Type.int ] Type.int) + } + ) + [ modByArg_, modByArg_0 ] + , remainderBy = + \remainderByArg_ remainderByArg_0 -> + Elm.apply + (Elm.value + { importFrom = [ "Basics" ] + , name = "remainderBy" + , annotation = + Just (Type.function [ Type.int, Type.int ] Type.int) + } + ) + [ remainderByArg_, remainderByArg_0 ] + , negate = + \negateArg_ -> + Elm.apply + (Elm.value + { importFrom = [ "Basics" ] + , name = "negate" + , annotation = + Just + (Type.function + [ Type.var "number" ] + (Type.var "number") + ) + } + ) + [ negateArg_ ] + , abs = + \absArg_ -> + Elm.apply + (Elm.value + { importFrom = [ "Basics" ] + , name = "abs" + , annotation = + Just + (Type.function + [ Type.var "number" ] + (Type.var "number") + ) + } + ) + [ absArg_ ] + , clamp = + \clampArg_ clampArg_0 clampArg_1 -> + Elm.apply + (Elm.value + { importFrom = [ "Basics" ] + , name = "clamp" + , annotation = + Just + (Type.function + [ Type.var "number" + , Type.var "number" + , Type.var "number" + ] + (Type.var "number") + ) + } + ) + [ clampArg_, clampArg_0, clampArg_1 ] + , sqrt = + \sqrtArg_ -> + Elm.apply + (Elm.value + { importFrom = [ "Basics" ] + , name = "sqrt" + , annotation = + Just (Type.function [ Type.float ] Type.float) + } + ) + [ sqrtArg_ ] + , logBase = + \logBaseArg_ logBaseArg_0 -> + Elm.apply + (Elm.value + { importFrom = [ "Basics" ] + , name = "logBase" + , annotation = + Just + (Type.function + [ Type.float, Type.float ] + Type.float + ) + } + ) + [ logBaseArg_, logBaseArg_0 ] + , degrees = + \degreesArg_ -> + Elm.apply + (Elm.value + { importFrom = [ "Basics" ] + , name = "degrees" + , annotation = + Just (Type.function [ Type.float ] Type.float) + } + ) + [ degreesArg_ ] + , radians = + \radiansArg_ -> + Elm.apply + (Elm.value + { importFrom = [ "Basics" ] + , name = "radians" + , annotation = + Just (Type.function [ Type.float ] Type.float) + } + ) + [ radiansArg_ ] + , turns = + \turnsArg_ -> + Elm.apply + (Elm.value + { importFrom = [ "Basics" ] + , name = "turns" + , annotation = + Just (Type.function [ Type.float ] Type.float) + } + ) + [ turnsArg_ ] + , cos = + \cosArg_ -> + Elm.apply + (Elm.value + { importFrom = [ "Basics" ] + , name = "cos" + , annotation = + Just (Type.function [ Type.float ] Type.float) + } + ) + [ cosArg_ ] + , sin = + \sinArg_ -> + Elm.apply + (Elm.value + { importFrom = [ "Basics" ] + , name = "sin" + , annotation = + Just (Type.function [ Type.float ] Type.float) + } + ) + [ sinArg_ ] + , tan = + \tanArg_ -> + Elm.apply + (Elm.value + { importFrom = [ "Basics" ] + , name = "tan" + , annotation = + Just (Type.function [ Type.float ] Type.float) + } + ) + [ tanArg_ ] + , acos = + \acosArg_ -> + Elm.apply + (Elm.value + { importFrom = [ "Basics" ] + , name = "acos" + , annotation = + Just (Type.function [ Type.float ] Type.float) + } + ) + [ acosArg_ ] + , asin = + \asinArg_ -> + Elm.apply + (Elm.value + { importFrom = [ "Basics" ] + , name = "asin" + , annotation = + Just (Type.function [ Type.float ] Type.float) + } + ) + [ asinArg_ ] + , atan = + \atanArg_ -> + Elm.apply + (Elm.value + { importFrom = [ "Basics" ] + , name = "atan" + , annotation = + Just (Type.function [ Type.float ] Type.float) + } + ) + [ atanArg_ ] + , atan2 = + \atan2Arg_ atan2Arg_0 -> + Elm.apply + (Elm.value + { importFrom = [ "Basics" ] + , name = "atan2" + , annotation = + Just + (Type.function + [ Type.float, Type.float ] + Type.float + ) + } + ) + [ atan2Arg_, atan2Arg_0 ] + , toPolar = + \toPolarArg_ -> + Elm.apply + (Elm.value + { importFrom = [ "Basics" ] + , name = "toPolar" + , annotation = + Just + (Type.function + [ Type.tuple Type.float Type.float ] + (Type.tuple Type.float Type.float) + ) + } + ) + [ toPolarArg_ ] + , fromPolar = + \fromPolarArg_ -> + Elm.apply + (Elm.value + { importFrom = [ "Basics" ] + , name = "fromPolar" + , annotation = + Just + (Type.function + [ Type.tuple Type.float Type.float ] + (Type.tuple Type.float Type.float) + ) + } + ) + [ fromPolarArg_ ] + , isNaN = + \isNaNArg_ -> + Elm.apply + (Elm.value + { importFrom = [ "Basics" ] + , name = "isNaN" + , annotation = + Just (Type.function [ Type.float ] Type.bool) + } + ) + [ isNaNArg_ ] + , isInfinite = + \isInfiniteArg_ -> + Elm.apply + (Elm.value + { importFrom = [ "Basics" ] + , name = "isInfinite" + , annotation = + Just (Type.function [ Type.float ] Type.bool) + } + ) + [ isInfiniteArg_ ] + , identity = + \identityArg_ -> + Elm.apply + (Elm.value + { importFrom = [ "Basics" ] + , name = "identity" + , annotation = + Just (Type.function [ Type.var "a" ] (Type.var "a")) + } + ) + [ identityArg_ ] + , always = + \alwaysArg_ alwaysArg_0 -> + Elm.apply + (Elm.value + { importFrom = [ "Basics" ] + , name = "always" + , annotation = + Just + (Type.function + [ Type.var "a", Type.var "b" ] + (Type.var "a") + ) + } + ) + [ alwaysArg_, alwaysArg_0 ] + , never = + \neverArg_ -> + Elm.apply + (Elm.value + { importFrom = [ "Basics" ] + , name = "never" + , annotation = + Just + (Type.function + [ Type.namedWith [ "Basics" ] "Never" [] ] + (Type.var "a") + ) + } + ) + [ neverArg_ ] + } + + +values_ : + { toFloat : Elm.Expression + , round : Elm.Expression + , floor : Elm.Expression + , ceiling : Elm.Expression + , truncate : Elm.Expression + , max : Elm.Expression + , min : Elm.Expression + , compare : Elm.Expression + , not : Elm.Expression + , xor : Elm.Expression + , modBy : Elm.Expression + , remainderBy : Elm.Expression + , negate : Elm.Expression + , abs : Elm.Expression + , clamp : Elm.Expression + , sqrt : Elm.Expression + , logBase : Elm.Expression + , e : Elm.Expression + , degrees : Elm.Expression + , radians : Elm.Expression + , turns : Elm.Expression + , pi : Elm.Expression + , cos : Elm.Expression + , sin : Elm.Expression + , tan : Elm.Expression + , acos : Elm.Expression + , asin : Elm.Expression + , atan : Elm.Expression + , atan2 : Elm.Expression + , toPolar : Elm.Expression + , fromPolar : Elm.Expression + , isNaN : Elm.Expression + , isInfinite : Elm.Expression + , identity : Elm.Expression + , always : Elm.Expression + , never : Elm.Expression + } +values_ = + { toFloat = + Elm.value + { importFrom = [ "Basics" ] + , name = "toFloat" + , annotation = Just (Type.function [ Type.int ] Type.float) + } + , round = + Elm.value + { importFrom = [ "Basics" ] + , name = "round" + , annotation = Just (Type.function [ Type.float ] Type.int) + } + , floor = + Elm.value + { importFrom = [ "Basics" ] + , name = "floor" + , annotation = Just (Type.function [ Type.float ] Type.int) + } + , ceiling = + Elm.value + { importFrom = [ "Basics" ] + , name = "ceiling" + , annotation = Just (Type.function [ Type.float ] Type.int) + } + , truncate = + Elm.value + { importFrom = [ "Basics" ] + , name = "truncate" + , annotation = Just (Type.function [ Type.float ] Type.int) + } + , max = + Elm.value + { importFrom = [ "Basics" ] + , name = "max" + , annotation = + Just + (Type.function + [ Type.var "comparable", Type.var "comparable" ] + (Type.var "comparable") + ) + } + , min = + Elm.value + { importFrom = [ "Basics" ] + , name = "min" + , annotation = + Just + (Type.function + [ Type.var "comparable", Type.var "comparable" ] + (Type.var "comparable") + ) + } + , compare = + Elm.value + { importFrom = [ "Basics" ] + , name = "compare" + , annotation = + Just + (Type.function + [ Type.var "comparable", Type.var "comparable" ] + (Type.namedWith [ "Basics" ] "Order" []) + ) + } + , not = + Elm.value + { importFrom = [ "Basics" ] + , name = "not" + , annotation = Just (Type.function [ Type.bool ] Type.bool) + } + , xor = + Elm.value + { importFrom = [ "Basics" ] + , name = "xor" + , annotation = + Just (Type.function [ Type.bool, Type.bool ] Type.bool) + } + , modBy = + Elm.value + { importFrom = [ "Basics" ] + , name = "modBy" + , annotation = Just (Type.function [ Type.int, Type.int ] Type.int) + } + , remainderBy = + Elm.value + { importFrom = [ "Basics" ] + , name = "remainderBy" + , annotation = Just (Type.function [ Type.int, Type.int ] Type.int) + } + , negate = + Elm.value + { importFrom = [ "Basics" ] + , name = "negate" + , annotation = + Just (Type.function [ Type.var "number" ] (Type.var "number")) + } + , abs = + Elm.value + { importFrom = [ "Basics" ] + , name = "abs" + , annotation = + Just (Type.function [ Type.var "number" ] (Type.var "number")) + } + , clamp = + Elm.value + { importFrom = [ "Basics" ] + , name = "clamp" + , annotation = + Just + (Type.function + [ Type.var "number" + , Type.var "number" + , Type.var "number" + ] + (Type.var "number") + ) + } + , sqrt = + Elm.value + { importFrom = [ "Basics" ] + , name = "sqrt" + , annotation = Just (Type.function [ Type.float ] Type.float) + } + , logBase = + Elm.value + { importFrom = [ "Basics" ] + , name = "logBase" + , annotation = + Just (Type.function [ Type.float, Type.float ] Type.float) + } + , e = + Elm.value + { importFrom = [ "Basics" ] + , name = "e" + , annotation = Just Type.float + } + , degrees = + Elm.value + { importFrom = [ "Basics" ] + , name = "degrees" + , annotation = Just (Type.function [ Type.float ] Type.float) + } + , radians = + Elm.value + { importFrom = [ "Basics" ] + , name = "radians" + , annotation = Just (Type.function [ Type.float ] Type.float) + } + , turns = + Elm.value + { importFrom = [ "Basics" ] + , name = "turns" + , annotation = Just (Type.function [ Type.float ] Type.float) + } + , pi = + Elm.value + { importFrom = [ "Basics" ] + , name = "pi" + , annotation = Just Type.float + } + , cos = + Elm.value + { importFrom = [ "Basics" ] + , name = "cos" + , annotation = Just (Type.function [ Type.float ] Type.float) + } + , sin = + Elm.value + { importFrom = [ "Basics" ] + , name = "sin" + , annotation = Just (Type.function [ Type.float ] Type.float) + } + , tan = + Elm.value + { importFrom = [ "Basics" ] + , name = "tan" + , annotation = Just (Type.function [ Type.float ] Type.float) + } + , acos = + Elm.value + { importFrom = [ "Basics" ] + , name = "acos" + , annotation = Just (Type.function [ Type.float ] Type.float) + } + , asin = + Elm.value + { importFrom = [ "Basics" ] + , name = "asin" + , annotation = Just (Type.function [ Type.float ] Type.float) + } + , atan = + Elm.value + { importFrom = [ "Basics" ] + , name = "atan" + , annotation = Just (Type.function [ Type.float ] Type.float) + } + , atan2 = + Elm.value + { importFrom = [ "Basics" ] + , name = "atan2" + , annotation = + Just (Type.function [ Type.float, Type.float ] Type.float) + } + , toPolar = + Elm.value + { importFrom = [ "Basics" ] + , name = "toPolar" + , annotation = + Just + (Type.function + [ Type.tuple Type.float Type.float ] + (Type.tuple Type.float Type.float) + ) + } + , fromPolar = + Elm.value + { importFrom = [ "Basics" ] + , name = "fromPolar" + , annotation = + Just + (Type.function + [ Type.tuple Type.float Type.float ] + (Type.tuple Type.float Type.float) + ) + } + , isNaN = + Elm.value + { importFrom = [ "Basics" ] + , name = "isNaN" + , annotation = Just (Type.function [ Type.float ] Type.bool) + } + , isInfinite = + Elm.value + { importFrom = [ "Basics" ] + , name = "isInfinite" + , annotation = Just (Type.function [ Type.float ] Type.bool) + } + , identity = + Elm.value + { importFrom = [ "Basics" ] + , name = "identity" + , annotation = Just (Type.function [ Type.var "a" ] (Type.var "a")) + } + , always = + Elm.value + { importFrom = [ "Basics" ] + , name = "always" + , annotation = + Just + (Type.function [ Type.var "a", Type.var "b" ] (Type.var "a") + ) + } + , never = + Elm.value + { importFrom = [ "Basics" ] + , name = "never" + , annotation = + Just + (Type.function + [ Type.namedWith [ "Basics" ] "Never" [] ] + (Type.var "a") + ) + } + } \ No newline at end of file diff --git a/elm-open-api-codegen/src/Gen/Bitwise.elm b/elm-open-api-codegen/src/Gen/Bitwise.elm new file mode 100644 index 00000000..d3fadc02 --- /dev/null +++ b/elm-open-api-codegen/src/Gen/Bitwise.elm @@ -0,0 +1,302 @@ +module Gen.Bitwise exposing + ( moduleName_, and, or, xor, complement, shiftLeftBy + , shiftRightBy, shiftRightZfBy, call_, values_ + ) + +{-| +# Generated bindings for Bitwise + +@docs moduleName_, and, or, xor, complement, shiftLeftBy +@docs shiftRightBy, shiftRightZfBy, call_, values_ +-} + + +import Elm +import Elm.Annotation as Type + + +{-| The name of this module. -} +moduleName_ : List String +moduleName_ = + [ "Bitwise" ] + + +{-| Bitwise AND + +and: Int -> Int -> Int +-} +and : Int -> Int -> Elm.Expression +and andArg_ andArg_0 = + Elm.apply + (Elm.value + { importFrom = [ "Bitwise" ] + , name = "and" + , annotation = Just (Type.function [ Type.int, Type.int ] Type.int) + } + ) + [ Elm.int andArg_, Elm.int andArg_0 ] + + +{-| Bitwise OR + +or: Int -> Int -> Int +-} +or : Int -> Int -> Elm.Expression +or orArg_ orArg_0 = + Elm.apply + (Elm.value + { importFrom = [ "Bitwise" ] + , name = "or" + , annotation = Just (Type.function [ Type.int, Type.int ] Type.int) + } + ) + [ Elm.int orArg_, Elm.int orArg_0 ] + + +{-| Bitwise XOR + +xor: Int -> Int -> Int +-} +xor : Int -> Int -> Elm.Expression +xor xorArg_ xorArg_0 = + Elm.apply + (Elm.value + { importFrom = [ "Bitwise" ] + , name = "xor" + , annotation = Just (Type.function [ Type.int, Type.int ] Type.int) + } + ) + [ Elm.int xorArg_, Elm.int xorArg_0 ] + + +{-| Flip each bit individually, often called bitwise NOT + +complement: Int -> Int +-} +complement : Int -> Elm.Expression +complement complementArg_ = + Elm.apply + (Elm.value + { importFrom = [ "Bitwise" ] + , name = "complement" + , annotation = Just (Type.function [ Type.int ] Type.int) + } + ) + [ Elm.int complementArg_ ] + + +{-| Shift bits to the left by a given offset, filling new bits with zeros. +This can be used to multiply numbers by powers of two. + + shiftLeftBy 1 5 == 10 + shiftLeftBy 5 1 == 32 + +shiftLeftBy: Int -> Int -> Int +-} +shiftLeftBy : Int -> Int -> Elm.Expression +shiftLeftBy shiftLeftByArg_ shiftLeftByArg_0 = + Elm.apply + (Elm.value + { importFrom = [ "Bitwise" ] + , name = "shiftLeftBy" + , annotation = Just (Type.function [ Type.int, Type.int ] Type.int) + } + ) + [ Elm.int shiftLeftByArg_, Elm.int shiftLeftByArg_0 ] + + +{-| Shift bits to the right by a given offset, filling new bits with +whatever is the topmost bit. This can be used to divide numbers by powers of two. + + shiftRightBy 1 32 == 16 + shiftRightBy 2 32 == 8 + shiftRightBy 1 -32 == -16 + +This is called an [arithmetic right shift][ars], often written `>>`, and +sometimes called a sign-propagating right shift because it fills empty spots +with copies of the highest bit. + +[ars]: https://en.wikipedia.org/wiki/Bitwise_operation#Arithmetic_shift + +shiftRightBy: Int -> Int -> Int +-} +shiftRightBy : Int -> Int -> Elm.Expression +shiftRightBy shiftRightByArg_ shiftRightByArg_0 = + Elm.apply + (Elm.value + { importFrom = [ "Bitwise" ] + , name = "shiftRightBy" + , annotation = Just (Type.function [ Type.int, Type.int ] Type.int) + } + ) + [ Elm.int shiftRightByArg_, Elm.int shiftRightByArg_0 ] + + +{-| Shift bits to the right by a given offset, filling new bits with zeros. + + shiftRightZfBy 1 32 == 16 + shiftRightZfBy 2 32 == 8 + shiftRightZfBy 1 -32 == 2147483632 + +This is called an [logical right shift][lrs], often written `>>>`, and +sometimes called a zero-fill right shift because it fills empty spots with +zeros. + +[lrs]: https://en.wikipedia.org/wiki/Bitwise_operation#Logical_shift + +shiftRightZfBy: Int -> Int -> Int +-} +shiftRightZfBy : Int -> Int -> Elm.Expression +shiftRightZfBy shiftRightZfByArg_ shiftRightZfByArg_0 = + Elm.apply + (Elm.value + { importFrom = [ "Bitwise" ] + , name = "shiftRightZfBy" + , annotation = Just (Type.function [ Type.int, Type.int ] Type.int) + } + ) + [ Elm.int shiftRightZfByArg_, Elm.int shiftRightZfByArg_0 ] + + +call_ : + { and : Elm.Expression -> Elm.Expression -> Elm.Expression + , or : Elm.Expression -> Elm.Expression -> Elm.Expression + , xor : Elm.Expression -> Elm.Expression -> Elm.Expression + , complement : Elm.Expression -> Elm.Expression + , shiftLeftBy : Elm.Expression -> Elm.Expression -> Elm.Expression + , shiftRightBy : Elm.Expression -> Elm.Expression -> Elm.Expression + , shiftRightZfBy : Elm.Expression -> Elm.Expression -> Elm.Expression + } +call_ = + { and = + \andArg_ andArg_0 -> + Elm.apply + (Elm.value + { importFrom = [ "Bitwise" ] + , name = "and" + , annotation = + Just (Type.function [ Type.int, Type.int ] Type.int) + } + ) + [ andArg_, andArg_0 ] + , or = + \orArg_ orArg_0 -> + Elm.apply + (Elm.value + { importFrom = [ "Bitwise" ] + , name = "or" + , annotation = + Just (Type.function [ Type.int, Type.int ] Type.int) + } + ) + [ orArg_, orArg_0 ] + , xor = + \xorArg_ xorArg_0 -> + Elm.apply + (Elm.value + { importFrom = [ "Bitwise" ] + , name = "xor" + , annotation = + Just (Type.function [ Type.int, Type.int ] Type.int) + } + ) + [ xorArg_, xorArg_0 ] + , complement = + \complementArg_ -> + Elm.apply + (Elm.value + { importFrom = [ "Bitwise" ] + , name = "complement" + , annotation = Just (Type.function [ Type.int ] Type.int) + } + ) + [ complementArg_ ] + , shiftLeftBy = + \shiftLeftByArg_ shiftLeftByArg_0 -> + Elm.apply + (Elm.value + { importFrom = [ "Bitwise" ] + , name = "shiftLeftBy" + , annotation = + Just (Type.function [ Type.int, Type.int ] Type.int) + } + ) + [ shiftLeftByArg_, shiftLeftByArg_0 ] + , shiftRightBy = + \shiftRightByArg_ shiftRightByArg_0 -> + Elm.apply + (Elm.value + { importFrom = [ "Bitwise" ] + , name = "shiftRightBy" + , annotation = + Just (Type.function [ Type.int, Type.int ] Type.int) + } + ) + [ shiftRightByArg_, shiftRightByArg_0 ] + , shiftRightZfBy = + \shiftRightZfByArg_ shiftRightZfByArg_0 -> + Elm.apply + (Elm.value + { importFrom = [ "Bitwise" ] + , name = "shiftRightZfBy" + , annotation = + Just (Type.function [ Type.int, Type.int ] Type.int) + } + ) + [ shiftRightZfByArg_, shiftRightZfByArg_0 ] + } + + +values_ : + { and : Elm.Expression + , or : Elm.Expression + , xor : Elm.Expression + , complement : Elm.Expression + , shiftLeftBy : Elm.Expression + , shiftRightBy : Elm.Expression + , shiftRightZfBy : Elm.Expression + } +values_ = + { and = + Elm.value + { importFrom = [ "Bitwise" ] + , name = "and" + , annotation = Just (Type.function [ Type.int, Type.int ] Type.int) + } + , or = + Elm.value + { importFrom = [ "Bitwise" ] + , name = "or" + , annotation = Just (Type.function [ Type.int, Type.int ] Type.int) + } + , xor = + Elm.value + { importFrom = [ "Bitwise" ] + , name = "xor" + , annotation = Just (Type.function [ Type.int, Type.int ] Type.int) + } + , complement = + Elm.value + { importFrom = [ "Bitwise" ] + , name = "complement" + , annotation = Just (Type.function [ Type.int ] Type.int) + } + , shiftLeftBy = + Elm.value + { importFrom = [ "Bitwise" ] + , name = "shiftLeftBy" + , annotation = Just (Type.function [ Type.int, Type.int ] Type.int) + } + , shiftRightBy = + Elm.value + { importFrom = [ "Bitwise" ] + , name = "shiftRightBy" + , annotation = Just (Type.function [ Type.int, Type.int ] Type.int) + } + , shiftRightZfBy = + Elm.value + { importFrom = [ "Bitwise" ] + , name = "shiftRightZfBy" + , annotation = Just (Type.function [ Type.int, Type.int ] Type.int) + } + } \ No newline at end of file diff --git a/elm-open-api-codegen/src/Gen/Bytes.elm b/elm-open-api-codegen/src/Gen/Bytes.elm new file mode 100644 index 00000000..89098047 --- /dev/null +++ b/elm-open-api-codegen/src/Gen/Bytes.elm @@ -0,0 +1,166 @@ +module Gen.Bytes exposing + ( moduleName_, width, getHostEndianness, annotation_, make_, caseOf_ + , call_, values_ + ) + +{-| +# Generated bindings for Bytes + +@docs moduleName_, width, getHostEndianness, annotation_, make_, caseOf_ +@docs call_, values_ +-} + + +import Elm +import Elm.Annotation as Type +import Elm.Arg +import Elm.Case + + +{-| The name of this module. -} +moduleName_ : List String +moduleName_ = + [ "Bytes" ] + + +{-| Get the width of a sequence of bytes. + +So if a sequence has four-hundred bytes, then `width bytes` would give back +`400`. That may be 400 unsigned 8-bit integers, 100 signed 32-bit integers, or +even a UTF-8 string. The content does not matter. This is just figuring out +how many bytes there are! + +width: Bytes.Bytes -> Int +-} +width : Elm.Expression -> Elm.Expression +width widthArg_ = + Elm.apply + (Elm.value + { importFrom = [ "Bytes" ] + , name = "width" + , annotation = + Just + (Type.function + [ Type.namedWith [ "Bytes" ] "Bytes" [] ] + Type.int + ) + } + ) + [ widthArg_ ] + + +{-| Is this program running on a big-endian or little-endian machine? + +getHostEndianness: Task.Task x Bytes.Endianness +-} +getHostEndianness : Elm.Expression +getHostEndianness = + Elm.value + { importFrom = [ "Bytes" ] + , name = "getHostEndianness" + , annotation = + Just + (Type.namedWith + [ "Task" ] + "Task" + [ Type.var "x" + , Type.namedWith [ "Bytes" ] "Endianness" [] + ] + ) + } + + +annotation_ : { bytes : Type.Annotation, endianness : Type.Annotation } +annotation_ = + { bytes = Type.namedWith [ "Bytes" ] "Bytes" [] + , endianness = Type.namedWith [ "Bytes" ] "Endianness" [] + } + + +make_ : { lE : Elm.Expression, bE : Elm.Expression } +make_ = + { lE = + Elm.value + { importFrom = [ "Bytes" ] + , name = "LE" + , annotation = Just (Type.namedWith [] "Endianness" []) + } + , bE = + Elm.value + { importFrom = [ "Bytes" ] + , name = "BE" + , annotation = Just (Type.namedWith [] "Endianness" []) + } + } + + +caseOf_ : + { endianness : + Elm.Expression + -> { lE : Elm.Expression, bE : Elm.Expression } + -> Elm.Expression + } +caseOf_ = + { endianness = + \endiannessExpression endiannessTags -> + Elm.Case.custom + endiannessExpression + (Type.namedWith [ "Bytes" ] "Endianness" []) + [ Elm.Case.branch + (Elm.Arg.customType "LE" endiannessTags.lE) + Basics.identity + , Elm.Case.branch + (Elm.Arg.customType "BE" endiannessTags.bE) + Basics.identity + ] + } + + +call_ : { width : Elm.Expression -> Elm.Expression } +call_ = + { width = + \widthArg_ -> + Elm.apply + (Elm.value + { importFrom = [ "Bytes" ] + , name = "width" + , annotation = + Just + (Type.function + [ Type.namedWith [ "Bytes" ] "Bytes" [] ] + Type.int + ) + } + ) + [ widthArg_ ] + } + + +values_ : { width : Elm.Expression, getHostEndianness : Elm.Expression } +values_ = + { width = + Elm.value + { importFrom = [ "Bytes" ] + , name = "width" + , annotation = + Just + (Type.function + [ Type.namedWith [ "Bytes" ] "Bytes" [] ] + Type.int + ) + } + , getHostEndianness = + Elm.value + { importFrom = [ "Bytes" ] + , name = "getHostEndianness" + , annotation = + Just + (Type.namedWith + [ "Task" ] + "Task" + [ Type.var "x" + , Type.namedWith [ "Bytes" ] "Endianness" [] + ] + ) + } + } \ No newline at end of file diff --git a/elm-open-api-codegen/src/Gen/Bytes/Decode.elm b/elm-open-api-codegen/src/Gen/Bytes/Decode.elm new file mode 100644 index 00000000..4bb8c479 --- /dev/null +++ b/elm-open-api-codegen/src/Gen/Bytes/Decode.elm @@ -0,0 +1,1865 @@ +module Gen.Bytes.Decode exposing + ( moduleName_, decode, signedInt8, signedInt16, signedInt32, unsignedInt8 + , unsignedInt16, unsignedInt32, float32, float64, bytes, string, map + , map2, map3, map4, map5, andThen, succeed, fail + , loop, annotation_, make_, caseOf_, call_, values_ + ) + +{-| +# Generated bindings for Bytes.Decode + +@docs moduleName_, decode, signedInt8, signedInt16, signedInt32, unsignedInt8 +@docs unsignedInt16, unsignedInt32, float32, float64, bytes, string +@docs map, map2, map3, map4, map5, andThen +@docs succeed, fail, loop, annotation_, make_, caseOf_ +@docs call_, values_ +-} + + +import Elm +import Elm.Annotation as Type +import Elm.Arg +import Elm.Case + + +{-| The name of this module. -} +moduleName_ : List String +moduleName_ = + [ "Bytes", "Decode" ] + + +{-| Turn a sequence of bytes into a nice Elm value. + + -- decode (unsignedInt16 BE) <0007> == Just 7 + -- decode (unsignedInt16 LE) <0700> == Just 7 + -- decode (unsignedInt16 BE) <0700> == Just 1792 + -- decode (unsignedInt32 BE) <0700> == Nothing + +The `Decoder` specifies exactly how this should happen. This process may fail +if the sequence of bytes is corrupted or unexpected somehow. The examples above +show a case where there are not enough bytes. + +decode: Bytes.Decode.Decoder a -> Bytes.Bytes -> Maybe a +-} +decode : Elm.Expression -> Elm.Expression -> Elm.Expression +decode decodeArg_ decodeArg_0 = + Elm.apply + (Elm.value + { importFrom = [ "Bytes", "Decode" ] + , name = "decode" + , annotation = + Just + (Type.function + [ Type.namedWith + [ "Bytes", "Decode" ] + "Decoder" + [ Type.var "a" ] + , Type.namedWith [ "Bytes" ] "Bytes" [] + ] + (Type.maybe (Type.var "a")) + ) + } + ) + [ decodeArg_, decodeArg_0 ] + + +{-| Decode one byte into an integer from `-128` to `127`. + +signedInt8: Bytes.Decode.Decoder Int +-} +signedInt8 : Elm.Expression +signedInt8 = + Elm.value + { importFrom = [ "Bytes", "Decode" ] + , name = "signedInt8" + , annotation = + Just (Type.namedWith [ "Bytes", "Decode" ] "Decoder" [ Type.int ]) + } + + +{-| Decode two bytes into an integer from `-32768` to `32767`. + +signedInt16: Bytes.Endianness -> Bytes.Decode.Decoder Int +-} +signedInt16 : Elm.Expression -> Elm.Expression +signedInt16 signedInt16Arg_ = + Elm.apply + (Elm.value + { importFrom = [ "Bytes", "Decode" ] + , name = "signedInt16" + , annotation = + Just + (Type.function + [ Type.namedWith [ "Bytes" ] "Endianness" [] ] + (Type.namedWith + [ "Bytes", "Decode" ] + "Decoder" + [ Type.int ] + ) + ) + } + ) + [ signedInt16Arg_ ] + + +{-| Decode four bytes into an integer from `-2147483648` to `2147483647`. + +signedInt32: Bytes.Endianness -> Bytes.Decode.Decoder Int +-} +signedInt32 : Elm.Expression -> Elm.Expression +signedInt32 signedInt32Arg_ = + Elm.apply + (Elm.value + { importFrom = [ "Bytes", "Decode" ] + , name = "signedInt32" + , annotation = + Just + (Type.function + [ Type.namedWith [ "Bytes" ] "Endianness" [] ] + (Type.namedWith + [ "Bytes", "Decode" ] + "Decoder" + [ Type.int ] + ) + ) + } + ) + [ signedInt32Arg_ ] + + +{-| Decode one byte into an integer from `0` to `255`. + +unsignedInt8: Bytes.Decode.Decoder Int +-} +unsignedInt8 : Elm.Expression +unsignedInt8 = + Elm.value + { importFrom = [ "Bytes", "Decode" ] + , name = "unsignedInt8" + , annotation = + Just (Type.namedWith [ "Bytes", "Decode" ] "Decoder" [ Type.int ]) + } + + +{-| Decode two bytes into an integer from `0` to `65535`. + +unsignedInt16: Bytes.Endianness -> Bytes.Decode.Decoder Int +-} +unsignedInt16 : Elm.Expression -> Elm.Expression +unsignedInt16 unsignedInt16Arg_ = + Elm.apply + (Elm.value + { importFrom = [ "Bytes", "Decode" ] + , name = "unsignedInt16" + , annotation = + Just + (Type.function + [ Type.namedWith [ "Bytes" ] "Endianness" [] ] + (Type.namedWith + [ "Bytes", "Decode" ] + "Decoder" + [ Type.int ] + ) + ) + } + ) + [ unsignedInt16Arg_ ] + + +{-| Decode four bytes into an integer from `0` to `4294967295`. + +unsignedInt32: Bytes.Endianness -> Bytes.Decode.Decoder Int +-} +unsignedInt32 : Elm.Expression -> Elm.Expression +unsignedInt32 unsignedInt32Arg_ = + Elm.apply + (Elm.value + { importFrom = [ "Bytes", "Decode" ] + , name = "unsignedInt32" + , annotation = + Just + (Type.function + [ Type.namedWith [ "Bytes" ] "Endianness" [] ] + (Type.namedWith + [ "Bytes", "Decode" ] + "Decoder" + [ Type.int ] + ) + ) + } + ) + [ unsignedInt32Arg_ ] + + +{-| Decode four bytes into a floating point number. + +float32: Bytes.Endianness -> Bytes.Decode.Decoder Float +-} +float32 : Elm.Expression -> Elm.Expression +float32 float32Arg_ = + Elm.apply + (Elm.value + { importFrom = [ "Bytes", "Decode" ] + , name = "float32" + , annotation = + Just + (Type.function + [ Type.namedWith [ "Bytes" ] "Endianness" [] ] + (Type.namedWith + [ "Bytes", "Decode" ] + "Decoder" + [ Type.float ] + ) + ) + } + ) + [ float32Arg_ ] + + +{-| Decode eight bytes into a floating point number. + +float64: Bytes.Endianness -> Bytes.Decode.Decoder Float +-} +float64 : Elm.Expression -> Elm.Expression +float64 float64Arg_ = + Elm.apply + (Elm.value + { importFrom = [ "Bytes", "Decode" ] + , name = "float64" + , annotation = + Just + (Type.function + [ Type.namedWith [ "Bytes" ] "Endianness" [] ] + (Type.namedWith + [ "Bytes", "Decode" ] + "Decoder" + [ Type.float ] + ) + ) + } + ) + [ float64Arg_ ] + + +{-| Copy a given number of bytes into a new `Bytes` sequence. + +bytes: Int -> Bytes.Decode.Decoder Bytes.Bytes +-} +bytes : Int -> Elm.Expression +bytes bytesArg_ = + Elm.apply + (Elm.value + { importFrom = [ "Bytes", "Decode" ] + , name = "bytes" + , annotation = + Just + (Type.function + [ Type.int ] + (Type.namedWith + [ "Bytes", "Decode" ] + "Decoder" + [ Type.namedWith [ "Bytes" ] "Bytes" [] ] + ) + ) + } + ) + [ Elm.int bytesArg_ ] + + +{-| Decode a given number of UTF-8 bytes into a `String`. + +Most protocols store the width of the string right before the content, so you +will probably write things like this: + + import Bytes exposing (Endianness(..)) + import Bytes.Decode as Decode + + sizedString : Decode.Decoder String + sizedString = + Decode.unsignedInt32 BE + |> Decode.andThen Decode.string + +In this case we read the width as a 32-bit unsigned integer, but you have the +leeway to read the width as a [Base 128 Varint][pb] for ProtoBuf, a +[Variable-Length Integer][sql] for SQLite, or whatever else they dream up. + +[pb]: https://developers.google.com/protocol-buffers/docs/encoding#varints +[sql]: https://www.sqlite.org/src4/doc/trunk/www/varint.wiki + +string: Int -> Bytes.Decode.Decoder String +-} +string : Int -> Elm.Expression +string stringArg_ = + Elm.apply + (Elm.value + { importFrom = [ "Bytes", "Decode" ] + , name = "string" + , annotation = + Just + (Type.function + [ Type.int ] + (Type.namedWith + [ "Bytes", "Decode" ] + "Decoder" + [ Type.string ] + ) + ) + } + ) + [ Elm.int stringArg_ ] + + +{-| Transform the value produced by a decoder. If you encode negative numbers +in a special way, you can say something like this: + + negativeInt8 : Decoder Int + negativeInt8 = + map negate unsignedInt8 + +In practice you may see something like ProtoBuf’s [ZigZag encoding][zz] which +decreases the size of small negative numbers. + +[zz]: https://developers.google.com/protocol-buffers/docs/encoding#types + +map: (a -> b) -> Bytes.Decode.Decoder a -> Bytes.Decode.Decoder b +-} +map : (Elm.Expression -> Elm.Expression) -> Elm.Expression -> Elm.Expression +map mapArg_ mapArg_0 = + Elm.apply + (Elm.value + { importFrom = [ "Bytes", "Decode" ] + , name = "map" + , annotation = + Just + (Type.function + [ Type.function [ Type.var "a" ] (Type.var "b") + , Type.namedWith + [ "Bytes", "Decode" ] + "Decoder" + [ Type.var "a" ] + ] + (Type.namedWith + [ "Bytes", "Decode" ] + "Decoder" + [ Type.var "b" ] + ) + ) + } + ) + [ Elm.functionReduced "mapUnpack" mapArg_, mapArg_0 ] + + +{-| Combine two decoders. + + import Bytes exposing (Endiannness(..)) + import Bytes.Decode as Decode + + type alias Point = { x : Float, y : Float } + + decoder : Decode.Decoder Point + decoder = + Decode.map2 Point + (Decode.float32 BE) + (Decode.float32 BE) + +map2: + (a -> b -> result) + -> Bytes.Decode.Decoder a + -> Bytes.Decode.Decoder b + -> Bytes.Decode.Decoder result +-} +map2 : + (Elm.Expression -> Elm.Expression -> Elm.Expression) + -> Elm.Expression + -> Elm.Expression + -> Elm.Expression +map2 map2Arg_ map2Arg_0 map2Arg_1 = + Elm.apply + (Elm.value + { importFrom = [ "Bytes", "Decode" ] + , name = "map2" + , annotation = + Just + (Type.function + [ Type.function + [ Type.var "a", Type.var "b" ] + (Type.var "result") + , Type.namedWith + [ "Bytes", "Decode" ] + "Decoder" + [ Type.var "a" ] + , Type.namedWith + [ "Bytes", "Decode" ] + "Decoder" + [ Type.var "b" ] + ] + (Type.namedWith + [ "Bytes", "Decode" ] + "Decoder" + [ Type.var "result" ] + ) + ) + } + ) + [ Elm.functionReduced + "map2Unpack" + (\functionReducedUnpack -> + Elm.functionReduced "unpack" (map2Arg_ functionReducedUnpack) + ) + , map2Arg_0 + , map2Arg_1 + ] + + +{-| Combine three decoders. + +map3: + (a -> b -> c -> result) + -> Bytes.Decode.Decoder a + -> Bytes.Decode.Decoder b + -> Bytes.Decode.Decoder c + -> Bytes.Decode.Decoder result +-} +map3 : + (Elm.Expression -> Elm.Expression -> Elm.Expression -> Elm.Expression) + -> Elm.Expression + -> Elm.Expression + -> Elm.Expression + -> Elm.Expression +map3 map3Arg_ map3Arg_0 map3Arg_1 map3Arg_2 = + Elm.apply + (Elm.value + { importFrom = [ "Bytes", "Decode" ] + , name = "map3" + , annotation = + Just + (Type.function + [ Type.function + [ Type.var "a", Type.var "b", Type.var "c" ] + (Type.var "result") + , Type.namedWith + [ "Bytes", "Decode" ] + "Decoder" + [ Type.var "a" ] + , Type.namedWith + [ "Bytes", "Decode" ] + "Decoder" + [ Type.var "b" ] + , Type.namedWith + [ "Bytes", "Decode" ] + "Decoder" + [ Type.var "c" ] + ] + (Type.namedWith + [ "Bytes", "Decode" ] + "Decoder" + [ Type.var "result" ] + ) + ) + } + ) + [ Elm.functionReduced + "map3Unpack" + (\functionReducedUnpack -> + Elm.functionReduced + "unpack" + (\functionReducedUnpack0 -> + Elm.functionReduced + "unpack" + ((map3Arg_ functionReducedUnpack) + functionReducedUnpack0 + ) + ) + ) + , map3Arg_0 + , map3Arg_1 + , map3Arg_2 + ] + + +{-| Combine four decoders. + +map4: + (a -> b -> c -> d -> result) + -> Bytes.Decode.Decoder a + -> Bytes.Decode.Decoder b + -> Bytes.Decode.Decoder c + -> Bytes.Decode.Decoder d + -> Bytes.Decode.Decoder result +-} +map4 : + (Elm.Expression + -> Elm.Expression + -> Elm.Expression + -> Elm.Expression + -> Elm.Expression) + -> Elm.Expression + -> Elm.Expression + -> Elm.Expression + -> Elm.Expression + -> Elm.Expression +map4 map4Arg_ map4Arg_0 map4Arg_1 map4Arg_2 map4Arg_3 = + Elm.apply + (Elm.value + { importFrom = [ "Bytes", "Decode" ] + , name = "map4" + , annotation = + Just + (Type.function + [ Type.function + [ Type.var "a" + , Type.var "b" + , Type.var "c" + , Type.var "d" + ] + (Type.var "result") + , Type.namedWith + [ "Bytes", "Decode" ] + "Decoder" + [ Type.var "a" ] + , Type.namedWith + [ "Bytes", "Decode" ] + "Decoder" + [ Type.var "b" ] + , Type.namedWith + [ "Bytes", "Decode" ] + "Decoder" + [ Type.var "c" ] + , Type.namedWith + [ "Bytes", "Decode" ] + "Decoder" + [ Type.var "d" ] + ] + (Type.namedWith + [ "Bytes", "Decode" ] + "Decoder" + [ Type.var "result" ] + ) + ) + } + ) + [ Elm.functionReduced + "map4Unpack" + (\functionReducedUnpack -> + Elm.functionReduced + "unpack" + (\functionReducedUnpack0 -> + Elm.functionReduced + "unpack" + (\functionReducedUnpack_2_1_2_0_2_0_2_0_0 -> + Elm.functionReduced + "unpack" + (((map4Arg_ functionReducedUnpack) + functionReducedUnpack0 + ) + functionReducedUnpack_2_1_2_0_2_0_2_0_0 + ) + ) + ) + ) + , map4Arg_0 + , map4Arg_1 + , map4Arg_2 + , map4Arg_3 + ] + + +{-| Combine five decoders. If you need to combine more things, it is possible +to define more of these with `map2` or `andThen`. + +map5: + (a -> b -> c -> d -> e -> result) + -> Bytes.Decode.Decoder a + -> Bytes.Decode.Decoder b + -> Bytes.Decode.Decoder c + -> Bytes.Decode.Decoder d + -> Bytes.Decode.Decoder e + -> Bytes.Decode.Decoder result +-} +map5 : + (Elm.Expression + -> Elm.Expression + -> Elm.Expression + -> Elm.Expression + -> Elm.Expression + -> Elm.Expression) + -> Elm.Expression + -> Elm.Expression + -> Elm.Expression + -> Elm.Expression + -> Elm.Expression + -> Elm.Expression +map5 map5Arg_ map5Arg_0 map5Arg_1 map5Arg_2 map5Arg_3 map5Arg_4 = + Elm.apply + (Elm.value + { importFrom = [ "Bytes", "Decode" ] + , name = "map5" + , annotation = + Just + (Type.function + [ Type.function + [ Type.var "a" + , Type.var "b" + , Type.var "c" + , Type.var "d" + , Type.var "e" + ] + (Type.var "result") + , Type.namedWith + [ "Bytes", "Decode" ] + "Decoder" + [ Type.var "a" ] + , Type.namedWith + [ "Bytes", "Decode" ] + "Decoder" + [ Type.var "b" ] + , Type.namedWith + [ "Bytes", "Decode" ] + "Decoder" + [ Type.var "c" ] + , Type.namedWith + [ "Bytes", "Decode" ] + "Decoder" + [ Type.var "d" ] + , Type.namedWith + [ "Bytes", "Decode" ] + "Decoder" + [ Type.var "e" ] + ] + (Type.namedWith + [ "Bytes", "Decode" ] + "Decoder" + [ Type.var "result" ] + ) + ) + } + ) + [ Elm.functionReduced + "map5Unpack" + (\functionReducedUnpack -> + Elm.functionReduced + "unpack" + (\functionReducedUnpack0 -> + Elm.functionReduced + "unpack" + (\functionReducedUnpack_2_1_2_0_2_0_2_0_0 -> + Elm.functionReduced + "unpack" + (\functionReducedUnpack_2_1_2_1_2_0_2_0_2_0_0 -> + Elm.functionReduced + "unpack" + ((((map5Arg_ functionReducedUnpack + ) + functionReducedUnpack0 + ) + functionReducedUnpack_2_1_2_0_2_0_2_0_0 + ) + functionReducedUnpack_2_1_2_1_2_0_2_0_2_0_0 + ) + ) + ) + ) + ) + , map5Arg_0 + , map5Arg_1 + , map5Arg_2 + , map5Arg_3 + , map5Arg_4 + ] + + +{-| Decode something **and then** use that information to decode something +else. This is most common with strings or sequences where you need to read +how long the value is going to be: + + import Bytes exposing (Endianness(..)) + import Bytes.Decode as Decode + + string : Decoder String + string = + Decode.unsignedInt32 BE + |> Decode.andThen Decode.string + +Check out the docs for [`succeed`](#succeed), [`fail`](#fail), and +[`loop`](#loop) to see `andThen` used in more ways! + +andThen: + (a -> Bytes.Decode.Decoder b) + -> Bytes.Decode.Decoder a + -> Bytes.Decode.Decoder b +-} +andThen : (Elm.Expression -> Elm.Expression) -> Elm.Expression -> Elm.Expression +andThen andThenArg_ andThenArg_0 = + Elm.apply + (Elm.value + { importFrom = [ "Bytes", "Decode" ] + , name = "andThen" + , annotation = + Just + (Type.function + [ Type.function + [ Type.var "a" ] + (Type.namedWith + [ "Bytes", "Decode" ] + "Decoder" + [ Type.var "b" ] + ) + , Type.namedWith + [ "Bytes", "Decode" ] + "Decoder" + [ Type.var "a" ] + ] + (Type.namedWith + [ "Bytes", "Decode" ] + "Decoder" + [ Type.var "b" ] + ) + ) + } + ) + [ Elm.functionReduced "andThenUnpack" andThenArg_, andThenArg_0 ] + + +{-| A decoder that always succeeds with a certain value. Maybe we are making +a `Maybe` decoder: + + import Bytes.Decode as Decode exposing (Decoder) + + maybe : Decoder a -> Decoder (Maybe a) + maybe decoder = + let + helper n = + if n == 0 then + Decode.succeed Nothing + else + Decode.map Just decoder + in + Decode.unsignedInt8 + |> Decode.andThen helper + +If the first byte is `00000000` then it is `Nothing`, otherwise we start +decoding the value and put it in a `Just`. + +succeed: a -> Bytes.Decode.Decoder a +-} +succeed : Elm.Expression -> Elm.Expression +succeed succeedArg_ = + Elm.apply + (Elm.value + { importFrom = [ "Bytes", "Decode" ] + , name = "succeed" + , annotation = + Just + (Type.function + [ Type.var "a" ] + (Type.namedWith + [ "Bytes", "Decode" ] + "Decoder" + [ Type.var "a" ] + ) + ) + } + ) + [ succeedArg_ ] + + +{-| A decoder that always fails. This can be useful when using `andThen` to +decode custom types: + + import Bytes exposing (Endianness(..)) + import Bytes.Encode as Encode + import Bytes.Decode as Decode + + type Distance = Yards Float | Meters Float + + toEncoder : Distance -> Encode.Encoder + toEncoder distance = + case distance of + Yards n -> Encode.sequence [ Encode.unsignedInt8 0, Encode.float32 BE n ] + Meters n -> Encode.sequence [ Encode.unsignedInt8 1, Encode.float32 BE n ] + + decoder : Decode.Decoder Distance + decoder = + Decode.unsignedInt8 + |> Decode.andThen pickDecoder + + pickDecoder : Int -> Decode.Decoder Distance + pickDecoder tag = + case tag of + 0 -> Decode.map Yards (Decode.float32 BE) + 1 -> Decode.map Meters (Decode.float32 BE) + _ -> Decode.fail + +The encoding chosen here uses an 8-bit unsigned integer to indicate which +variant we are working with. If we are working with yards do this, if we are +working with meters do that, and otherwise something went wrong! + +fail: Bytes.Decode.Decoder a +-} +fail : Elm.Expression +fail = + Elm.value + { importFrom = [ "Bytes", "Decode" ] + , name = "fail" + , annotation = + Just + (Type.namedWith [ "Bytes", "Decode" ] "Decoder" [ Type.var "a" ] + ) + } + + +{-| A decoder that can loop indefinitely. This can be helpful when parsing +repeated structures, like a list: + + import Bytes exposing (Endianness(..)) + import Bytes.Decode as Decode exposing (..) + + list : Decoder a -> Decoder (List a) + list decoder = + unsignedInt32 BE + |> andThen (\len -> loop (len, []) (listStep decoder)) + + listStep : Decoder a -> (Int, List a) -> Decoder (Step (Int, List a) (List a)) + listStep decoder (n, xs) = + if n <= 0 then + succeed (Done xs) + else + map (\x -> Loop (n - 1, x :: xs)) decoder + +The `list` decoder first reads a 32-bit unsigned integer. That determines how +many items will be decoded. From there we use [`loop`](#loop) to track all the +items we have parsed so far and figure out when to stop. + +loop: + state + -> (state -> Bytes.Decode.Decoder (Bytes.Decode.Step state a)) + -> Bytes.Decode.Decoder a +-} +loop : Elm.Expression -> (Elm.Expression -> Elm.Expression) -> Elm.Expression +loop loopArg_ loopArg_0 = + Elm.apply + (Elm.value + { importFrom = [ "Bytes", "Decode" ] + , name = "loop" + , annotation = + Just + (Type.function + [ Type.var "state" + , Type.function + [ Type.var "state" ] + (Type.namedWith + [ "Bytes", "Decode" ] + "Decoder" + [ Type.namedWith + [ "Bytes", "Decode" ] + "Step" + [ Type.var "state", Type.var "a" ] + ] + ) + ] + (Type.namedWith + [ "Bytes", "Decode" ] + "Decoder" + [ Type.var "a" ] + ) + ) + } + ) + [ loopArg_, Elm.functionReduced "loopUnpack" loopArg_0 ] + + +annotation_ : + { decoder : Type.Annotation -> Type.Annotation + , step : Type.Annotation -> Type.Annotation -> Type.Annotation + } +annotation_ = + { decoder = + \decoderArg0 -> + Type.namedWith [ "Bytes", "Decode" ] "Decoder" [ decoderArg0 ] + , step = + \stepArg0 stepArg1 -> + Type.namedWith [ "Bytes", "Decode" ] "Step" [ stepArg0, stepArg1 ] + } + + +make_ : + { loop : Elm.Expression -> Elm.Expression + , done : Elm.Expression -> Elm.Expression + } +make_ = + { loop = + \ar0 -> + Elm.apply + (Elm.value + { importFrom = [ "Bytes", "Decode" ] + , name = "Loop" + , annotation = + Just + (Type.namedWith + [] + "Step" + [ Type.var "state", Type.var "a" ] + ) + } + ) + [ ar0 ] + , done = + \ar0 -> + Elm.apply + (Elm.value + { importFrom = [ "Bytes", "Decode" ] + , name = "Done" + , annotation = + Just + (Type.namedWith + [] + "Step" + [ Type.var "state", Type.var "a" ] + ) + } + ) + [ ar0 ] + } + + +caseOf_ : + { step : + Elm.Expression + -> { loop : Elm.Expression -> Elm.Expression + , done : Elm.Expression -> Elm.Expression + } + -> Elm.Expression + } +caseOf_ = + { step = + \stepExpression stepTags -> + Elm.Case.custom + stepExpression + (Type.namedWith + [ "Bytes", "Decode" ] + "Step" + [ Type.var "state", Type.var "a" ] + ) + [ Elm.Case.branch + (Elm.Arg.customType "Loop" stepTags.loop |> Elm.Arg.item + (Elm.Arg.varWith + "state" + (Type.var + "state" + ) + ) + ) + Basics.identity + , Elm.Case.branch + (Elm.Arg.customType "Done" stepTags.done |> Elm.Arg.item + (Elm.Arg.varWith + "a" + (Type.var + "a" + ) + ) + ) + Basics.identity + ] + } + + +call_ : + { decode : Elm.Expression -> Elm.Expression -> Elm.Expression + , signedInt16 : Elm.Expression -> Elm.Expression + , signedInt32 : Elm.Expression -> Elm.Expression + , unsignedInt16 : Elm.Expression -> Elm.Expression + , unsignedInt32 : Elm.Expression -> Elm.Expression + , float32 : Elm.Expression -> Elm.Expression + , float64 : Elm.Expression -> Elm.Expression + , bytes : Elm.Expression -> Elm.Expression + , string : Elm.Expression -> Elm.Expression + , map : Elm.Expression -> Elm.Expression -> Elm.Expression + , map2 : + Elm.Expression -> Elm.Expression -> Elm.Expression -> Elm.Expression + , map3 : + Elm.Expression + -> Elm.Expression + -> Elm.Expression + -> Elm.Expression + -> Elm.Expression + , map4 : + Elm.Expression + -> Elm.Expression + -> Elm.Expression + -> Elm.Expression + -> Elm.Expression + -> Elm.Expression + , map5 : + Elm.Expression + -> Elm.Expression + -> Elm.Expression + -> Elm.Expression + -> Elm.Expression + -> Elm.Expression + -> Elm.Expression + , andThen : Elm.Expression -> Elm.Expression -> Elm.Expression + , succeed : Elm.Expression -> Elm.Expression + , loop : Elm.Expression -> Elm.Expression -> Elm.Expression + } +call_ = + { decode = + \decodeArg_ decodeArg_0 -> + Elm.apply + (Elm.value + { importFrom = [ "Bytes", "Decode" ] + , name = "decode" + , annotation = + Just + (Type.function + [ Type.namedWith + [ "Bytes", "Decode" ] + "Decoder" + [ Type.var "a" ] + , Type.namedWith [ "Bytes" ] "Bytes" [] + ] + (Type.maybe (Type.var "a")) + ) + } + ) + [ decodeArg_, decodeArg_0 ] + , signedInt16 = + \signedInt16Arg_ -> + Elm.apply + (Elm.value + { importFrom = [ "Bytes", "Decode" ] + , name = "signedInt16" + , annotation = + Just + (Type.function + [ Type.namedWith [ "Bytes" ] "Endianness" [] ] + (Type.namedWith + [ "Bytes", "Decode" ] + "Decoder" + [ Type.int ] + ) + ) + } + ) + [ signedInt16Arg_ ] + , signedInt32 = + \signedInt32Arg_ -> + Elm.apply + (Elm.value + { importFrom = [ "Bytes", "Decode" ] + , name = "signedInt32" + , annotation = + Just + (Type.function + [ Type.namedWith [ "Bytes" ] "Endianness" [] ] + (Type.namedWith + [ "Bytes", "Decode" ] + "Decoder" + [ Type.int ] + ) + ) + } + ) + [ signedInt32Arg_ ] + , unsignedInt16 = + \unsignedInt16Arg_ -> + Elm.apply + (Elm.value + { importFrom = [ "Bytes", "Decode" ] + , name = "unsignedInt16" + , annotation = + Just + (Type.function + [ Type.namedWith [ "Bytes" ] "Endianness" [] ] + (Type.namedWith + [ "Bytes", "Decode" ] + "Decoder" + [ Type.int ] + ) + ) + } + ) + [ unsignedInt16Arg_ ] + , unsignedInt32 = + \unsignedInt32Arg_ -> + Elm.apply + (Elm.value + { importFrom = [ "Bytes", "Decode" ] + , name = "unsignedInt32" + , annotation = + Just + (Type.function + [ Type.namedWith [ "Bytes" ] "Endianness" [] ] + (Type.namedWith + [ "Bytes", "Decode" ] + "Decoder" + [ Type.int ] + ) + ) + } + ) + [ unsignedInt32Arg_ ] + , float32 = + \float32Arg_ -> + Elm.apply + (Elm.value + { importFrom = [ "Bytes", "Decode" ] + , name = "float32" + , annotation = + Just + (Type.function + [ Type.namedWith [ "Bytes" ] "Endianness" [] ] + (Type.namedWith + [ "Bytes", "Decode" ] + "Decoder" + [ Type.float ] + ) + ) + } + ) + [ float32Arg_ ] + , float64 = + \float64Arg_ -> + Elm.apply + (Elm.value + { importFrom = [ "Bytes", "Decode" ] + , name = "float64" + , annotation = + Just + (Type.function + [ Type.namedWith [ "Bytes" ] "Endianness" [] ] + (Type.namedWith + [ "Bytes", "Decode" ] + "Decoder" + [ Type.float ] + ) + ) + } + ) + [ float64Arg_ ] + , bytes = + \bytesArg_ -> + Elm.apply + (Elm.value + { importFrom = [ "Bytes", "Decode" ] + , name = "bytes" + , annotation = + Just + (Type.function + [ Type.int ] + (Type.namedWith + [ "Bytes", "Decode" ] + "Decoder" + [ Type.namedWith [ "Bytes" ] "Bytes" [] ] + ) + ) + } + ) + [ bytesArg_ ] + , string = + \stringArg_ -> + Elm.apply + (Elm.value + { importFrom = [ "Bytes", "Decode" ] + , name = "string" + , annotation = + Just + (Type.function + [ Type.int ] + (Type.namedWith + [ "Bytes", "Decode" ] + "Decoder" + [ Type.string ] + ) + ) + } + ) + [ stringArg_ ] + , map = + \mapArg_ mapArg_0 -> + Elm.apply + (Elm.value + { importFrom = [ "Bytes", "Decode" ] + , name = "map" + , annotation = + Just + (Type.function + [ Type.function + [ Type.var "a" ] + (Type.var "b") + , Type.namedWith + [ "Bytes", "Decode" ] + "Decoder" + [ Type.var "a" ] + ] + (Type.namedWith + [ "Bytes", "Decode" ] + "Decoder" + [ Type.var "b" ] + ) + ) + } + ) + [ mapArg_, mapArg_0 ] + , map2 = + \map2Arg_ map2Arg_0 map2Arg_1 -> + Elm.apply + (Elm.value + { importFrom = [ "Bytes", "Decode" ] + , name = "map2" + , annotation = + Just + (Type.function + [ Type.function + [ Type.var "a", Type.var "b" ] + (Type.var "result") + , Type.namedWith + [ "Bytes", "Decode" ] + "Decoder" + [ Type.var "a" ] + , Type.namedWith + [ "Bytes", "Decode" ] + "Decoder" + [ Type.var "b" ] + ] + (Type.namedWith + [ "Bytes", "Decode" ] + "Decoder" + [ Type.var "result" ] + ) + ) + } + ) + [ map2Arg_, map2Arg_0, map2Arg_1 ] + , map3 = + \map3Arg_ map3Arg_0 map3Arg_1 map3Arg_2 -> + Elm.apply + (Elm.value + { importFrom = [ "Bytes", "Decode" ] + , name = "map3" + , annotation = + Just + (Type.function + [ Type.function + [ Type.var "a" + , Type.var "b" + , Type.var "c" + ] + (Type.var "result") + , Type.namedWith + [ "Bytes", "Decode" ] + "Decoder" + [ Type.var "a" ] + , Type.namedWith + [ "Bytes", "Decode" ] + "Decoder" + [ Type.var "b" ] + , Type.namedWith + [ "Bytes", "Decode" ] + "Decoder" + [ Type.var "c" ] + ] + (Type.namedWith + [ "Bytes", "Decode" ] + "Decoder" + [ Type.var "result" ] + ) + ) + } + ) + [ map3Arg_, map3Arg_0, map3Arg_1, map3Arg_2 ] + , map4 = + \map4Arg_ map4Arg_0 map4Arg_1 map4Arg_2 map4Arg_3 -> + Elm.apply + (Elm.value + { importFrom = [ "Bytes", "Decode" ] + , name = "map4" + , annotation = + Just + (Type.function + [ Type.function + [ Type.var "a" + , Type.var "b" + , Type.var "c" + , Type.var "d" + ] + (Type.var "result") + , Type.namedWith + [ "Bytes", "Decode" ] + "Decoder" + [ Type.var "a" ] + , Type.namedWith + [ "Bytes", "Decode" ] + "Decoder" + [ Type.var "b" ] + , Type.namedWith + [ "Bytes", "Decode" ] + "Decoder" + [ Type.var "c" ] + , Type.namedWith + [ "Bytes", "Decode" ] + "Decoder" + [ Type.var "d" ] + ] + (Type.namedWith + [ "Bytes", "Decode" ] + "Decoder" + [ Type.var "result" ] + ) + ) + } + ) + [ map4Arg_, map4Arg_0, map4Arg_1, map4Arg_2, map4Arg_3 ] + , map5 = + \map5Arg_ map5Arg_0 map5Arg_1 map5Arg_2 map5Arg_3 map5Arg_4 -> + Elm.apply + (Elm.value + { importFrom = [ "Bytes", "Decode" ] + , name = "map5" + , annotation = + Just + (Type.function + [ Type.function + [ Type.var "a" + , Type.var "b" + , Type.var "c" + , Type.var "d" + , Type.var "e" + ] + (Type.var "result") + , Type.namedWith + [ "Bytes", "Decode" ] + "Decoder" + [ Type.var "a" ] + , Type.namedWith + [ "Bytes", "Decode" ] + "Decoder" + [ Type.var "b" ] + , Type.namedWith + [ "Bytes", "Decode" ] + "Decoder" + [ Type.var "c" ] + , Type.namedWith + [ "Bytes", "Decode" ] + "Decoder" + [ Type.var "d" ] + , Type.namedWith + [ "Bytes", "Decode" ] + "Decoder" + [ Type.var "e" ] + ] + (Type.namedWith + [ "Bytes", "Decode" ] + "Decoder" + [ Type.var "result" ] + ) + ) + } + ) + [ map5Arg_ + , map5Arg_0 + , map5Arg_1 + , map5Arg_2 + , map5Arg_3 + , map5Arg_4 + ] + , andThen = + \andThenArg_ andThenArg_0 -> + Elm.apply + (Elm.value + { importFrom = [ "Bytes", "Decode" ] + , name = "andThen" + , annotation = + Just + (Type.function + [ Type.function + [ Type.var "a" ] + (Type.namedWith + [ "Bytes", "Decode" ] + "Decoder" + [ Type.var "b" ] + ) + , Type.namedWith + [ "Bytes", "Decode" ] + "Decoder" + [ Type.var "a" ] + ] + (Type.namedWith + [ "Bytes", "Decode" ] + "Decoder" + [ Type.var "b" ] + ) + ) + } + ) + [ andThenArg_, andThenArg_0 ] + , succeed = + \succeedArg_ -> + Elm.apply + (Elm.value + { importFrom = [ "Bytes", "Decode" ] + , name = "succeed" + , annotation = + Just + (Type.function + [ Type.var "a" ] + (Type.namedWith + [ "Bytes", "Decode" ] + "Decoder" + [ Type.var "a" ] + ) + ) + } + ) + [ succeedArg_ ] + , loop = + \loopArg_ loopArg_0 -> + Elm.apply + (Elm.value + { importFrom = [ "Bytes", "Decode" ] + , name = "loop" + , annotation = + Just + (Type.function + [ Type.var "state" + , Type.function + [ Type.var "state" ] + (Type.namedWith + [ "Bytes", "Decode" ] + "Decoder" + [ Type.namedWith + [ "Bytes", "Decode" ] + "Step" + [ Type.var "state" + , Type.var "a" + ] + ] + ) + ] + (Type.namedWith + [ "Bytes", "Decode" ] + "Decoder" + [ Type.var "a" ] + ) + ) + } + ) + [ loopArg_, loopArg_0 ] + } + + +values_ : + { decode : Elm.Expression + , signedInt8 : Elm.Expression + , signedInt16 : Elm.Expression + , signedInt32 : Elm.Expression + , unsignedInt8 : Elm.Expression + , unsignedInt16 : Elm.Expression + , unsignedInt32 : Elm.Expression + , float32 : Elm.Expression + , float64 : Elm.Expression + , bytes : Elm.Expression + , string : Elm.Expression + , map : Elm.Expression + , map2 : Elm.Expression + , map3 : Elm.Expression + , map4 : Elm.Expression + , map5 : Elm.Expression + , andThen : Elm.Expression + , succeed : Elm.Expression + , fail : Elm.Expression + , loop : Elm.Expression + } +values_ = + { decode = + Elm.value + { importFrom = [ "Bytes", "Decode" ] + , name = "decode" + , annotation = + Just + (Type.function + [ Type.namedWith + [ "Bytes", "Decode" ] + "Decoder" + [ Type.var "a" ] + , Type.namedWith [ "Bytes" ] "Bytes" [] + ] + (Type.maybe (Type.var "a")) + ) + } + , signedInt8 = + Elm.value + { importFrom = [ "Bytes", "Decode" ] + , name = "signedInt8" + , annotation = + Just + (Type.namedWith [ "Bytes", "Decode" ] "Decoder" [ Type.int ] + ) + } + , signedInt16 = + Elm.value + { importFrom = [ "Bytes", "Decode" ] + , name = "signedInt16" + , annotation = + Just + (Type.function + [ Type.namedWith [ "Bytes" ] "Endianness" [] ] + (Type.namedWith + [ "Bytes", "Decode" ] + "Decoder" + [ Type.int ] + ) + ) + } + , signedInt32 = + Elm.value + { importFrom = [ "Bytes", "Decode" ] + , name = "signedInt32" + , annotation = + Just + (Type.function + [ Type.namedWith [ "Bytes" ] "Endianness" [] ] + (Type.namedWith + [ "Bytes", "Decode" ] + "Decoder" + [ Type.int ] + ) + ) + } + , unsignedInt8 = + Elm.value + { importFrom = [ "Bytes", "Decode" ] + , name = "unsignedInt8" + , annotation = + Just + (Type.namedWith [ "Bytes", "Decode" ] "Decoder" [ Type.int ] + ) + } + , unsignedInt16 = + Elm.value + { importFrom = [ "Bytes", "Decode" ] + , name = "unsignedInt16" + , annotation = + Just + (Type.function + [ Type.namedWith [ "Bytes" ] "Endianness" [] ] + (Type.namedWith + [ "Bytes", "Decode" ] + "Decoder" + [ Type.int ] + ) + ) + } + , unsignedInt32 = + Elm.value + { importFrom = [ "Bytes", "Decode" ] + , name = "unsignedInt32" + , annotation = + Just + (Type.function + [ Type.namedWith [ "Bytes" ] "Endianness" [] ] + (Type.namedWith + [ "Bytes", "Decode" ] + "Decoder" + [ Type.int ] + ) + ) + } + , float32 = + Elm.value + { importFrom = [ "Bytes", "Decode" ] + , name = "float32" + , annotation = + Just + (Type.function + [ Type.namedWith [ "Bytes" ] "Endianness" [] ] + (Type.namedWith + [ "Bytes", "Decode" ] + "Decoder" + [ Type.float ] + ) + ) + } + , float64 = + Elm.value + { importFrom = [ "Bytes", "Decode" ] + , name = "float64" + , annotation = + Just + (Type.function + [ Type.namedWith [ "Bytes" ] "Endianness" [] ] + (Type.namedWith + [ "Bytes", "Decode" ] + "Decoder" + [ Type.float ] + ) + ) + } + , bytes = + Elm.value + { importFrom = [ "Bytes", "Decode" ] + , name = "bytes" + , annotation = + Just + (Type.function + [ Type.int ] + (Type.namedWith + [ "Bytes", "Decode" ] + "Decoder" + [ Type.namedWith [ "Bytes" ] "Bytes" [] ] + ) + ) + } + , string = + Elm.value + { importFrom = [ "Bytes", "Decode" ] + , name = "string" + , annotation = + Just + (Type.function + [ Type.int ] + (Type.namedWith + [ "Bytes", "Decode" ] + "Decoder" + [ Type.string ] + ) + ) + } + , map = + Elm.value + { importFrom = [ "Bytes", "Decode" ] + , name = "map" + , annotation = + Just + (Type.function + [ Type.function [ Type.var "a" ] (Type.var "b") + , Type.namedWith + [ "Bytes", "Decode" ] + "Decoder" + [ Type.var "a" ] + ] + (Type.namedWith + [ "Bytes", "Decode" ] + "Decoder" + [ Type.var "b" ] + ) + ) + } + , map2 = + Elm.value + { importFrom = [ "Bytes", "Decode" ] + , name = "map2" + , annotation = + Just + (Type.function + [ Type.function + [ Type.var "a", Type.var "b" ] + (Type.var "result") + , Type.namedWith + [ "Bytes", "Decode" ] + "Decoder" + [ Type.var "a" ] + , Type.namedWith + [ "Bytes", "Decode" ] + "Decoder" + [ Type.var "b" ] + ] + (Type.namedWith + [ "Bytes", "Decode" ] + "Decoder" + [ Type.var "result" ] + ) + ) + } + , map3 = + Elm.value + { importFrom = [ "Bytes", "Decode" ] + , name = "map3" + , annotation = + Just + (Type.function + [ Type.function + [ Type.var "a", Type.var "b", Type.var "c" ] + (Type.var "result") + , Type.namedWith + [ "Bytes", "Decode" ] + "Decoder" + [ Type.var "a" ] + , Type.namedWith + [ "Bytes", "Decode" ] + "Decoder" + [ Type.var "b" ] + , Type.namedWith + [ "Bytes", "Decode" ] + "Decoder" + [ Type.var "c" ] + ] + (Type.namedWith + [ "Bytes", "Decode" ] + "Decoder" + [ Type.var "result" ] + ) + ) + } + , map4 = + Elm.value + { importFrom = [ "Bytes", "Decode" ] + , name = "map4" + , annotation = + Just + (Type.function + [ Type.function + [ Type.var "a" + , Type.var "b" + , Type.var "c" + , Type.var "d" + ] + (Type.var "result") + , Type.namedWith + [ "Bytes", "Decode" ] + "Decoder" + [ Type.var "a" ] + , Type.namedWith + [ "Bytes", "Decode" ] + "Decoder" + [ Type.var "b" ] + , Type.namedWith + [ "Bytes", "Decode" ] + "Decoder" + [ Type.var "c" ] + , Type.namedWith + [ "Bytes", "Decode" ] + "Decoder" + [ Type.var "d" ] + ] + (Type.namedWith + [ "Bytes", "Decode" ] + "Decoder" + [ Type.var "result" ] + ) + ) + } + , map5 = + Elm.value + { importFrom = [ "Bytes", "Decode" ] + , name = "map5" + , annotation = + Just + (Type.function + [ Type.function + [ Type.var "a" + , Type.var "b" + , Type.var "c" + , Type.var "d" + , Type.var "e" + ] + (Type.var "result") + , Type.namedWith + [ "Bytes", "Decode" ] + "Decoder" + [ Type.var "a" ] + , Type.namedWith + [ "Bytes", "Decode" ] + "Decoder" + [ Type.var "b" ] + , Type.namedWith + [ "Bytes", "Decode" ] + "Decoder" + [ Type.var "c" ] + , Type.namedWith + [ "Bytes", "Decode" ] + "Decoder" + [ Type.var "d" ] + , Type.namedWith + [ "Bytes", "Decode" ] + "Decoder" + [ Type.var "e" ] + ] + (Type.namedWith + [ "Bytes", "Decode" ] + "Decoder" + [ Type.var "result" ] + ) + ) + } + , andThen = + Elm.value + { importFrom = [ "Bytes", "Decode" ] + , name = "andThen" + , annotation = + Just + (Type.function + [ Type.function + [ Type.var "a" ] + (Type.namedWith + [ "Bytes", "Decode" ] + "Decoder" + [ Type.var "b" ] + ) + , Type.namedWith + [ "Bytes", "Decode" ] + "Decoder" + [ Type.var "a" ] + ] + (Type.namedWith + [ "Bytes", "Decode" ] + "Decoder" + [ Type.var "b" ] + ) + ) + } + , succeed = + Elm.value + { importFrom = [ "Bytes", "Decode" ] + , name = "succeed" + , annotation = + Just + (Type.function + [ Type.var "a" ] + (Type.namedWith + [ "Bytes", "Decode" ] + "Decoder" + [ Type.var "a" ] + ) + ) + } + , fail = + Elm.value + { importFrom = [ "Bytes", "Decode" ] + , name = "fail" + , annotation = + Just + (Type.namedWith + [ "Bytes", "Decode" ] + "Decoder" + [ Type.var "a" ] + ) + } + , loop = + Elm.value + { importFrom = [ "Bytes", "Decode" ] + , name = "loop" + , annotation = + Just + (Type.function + [ Type.var "state" + , Type.function + [ Type.var "state" ] + (Type.namedWith + [ "Bytes", "Decode" ] + "Decoder" + [ Type.namedWith + [ "Bytes", "Decode" ] + "Step" + [ Type.var "state", Type.var "a" ] + ] + ) + ] + (Type.namedWith + [ "Bytes", "Decode" ] + "Decoder" + [ Type.var "a" ] + ) + ) + } + } \ No newline at end of file diff --git a/elm-open-api-codegen/src/Gen/Bytes/Encode.elm b/elm-open-api-codegen/src/Gen/Bytes/Encode.elm new file mode 100644 index 00000000..66e6513b --- /dev/null +++ b/elm-open-api-codegen/src/Gen/Bytes/Encode.elm @@ -0,0 +1,863 @@ +module Gen.Bytes.Encode exposing + ( moduleName_, encode, sequence, signedInt8, signedInt16, signedInt32 + , unsignedInt8, unsignedInt16, unsignedInt32, float32, float64, bytes, string + , getStringWidth, annotation_, call_, values_ + ) + +{-| +# Generated bindings for Bytes.Encode + +@docs moduleName_, encode, sequence, signedInt8, signedInt16, signedInt32 +@docs unsignedInt8, unsignedInt16, unsignedInt32, float32, float64, bytes +@docs string, getStringWidth, annotation_, call_, values_ +-} + + +import Elm +import Elm.Annotation as Type + + +{-| The name of this module. -} +moduleName_ : List String +moduleName_ = + [ "Bytes", "Encode" ] + + +{-| Turn an `Encoder` into `Bytes`. + + encode (unsignedInt8 7) -- <07> + encode (unsignedInt16 BE 7) -- <0007> + encode (unsignedInt16 LE 7) -- <0700> + +The `encode` function is designed to minimize allocation. It figures out the +exact width necessary to fit everything in `Bytes` and then generate that +value directly. This is valuable when you are encoding more elaborate data: + + import Bytes exposing (Endianness(..)) + import Bytes.Encode as Encode + + type alias Person = + { age : Int + , name : String + } + + toEncoder : Person -> Encode.Encoder + toEncoder person = + Encode.sequence + [ Encode.unsignedInt16 BE person.age + , Encode.unsignedInt16 BE (Encode.getStringWidth person.name) + , Encode.string person.name + ] + + -- encode (toEncoder (Person 33 "Tom")) == <00210003546F6D> + +Did you know it was going to be seven bytes? How about when you have a hundred +people to serialize? And when some have Japanese and Norwegian names? Having +this intermediate `Encoder` can help reduce allocation quite a lot! + +encode: Bytes.Encode.Encoder -> Bytes.Bytes +-} +encode : Elm.Expression -> Elm.Expression +encode encodeArg_ = + Elm.apply + (Elm.value + { importFrom = [ "Bytes", "Encode" ] + , name = "encode" + , annotation = + Just + (Type.function + [ Type.namedWith [ "Bytes", "Encode" ] "Encoder" [] ] + (Type.namedWith [ "Bytes" ] "Bytes" []) + ) + } + ) + [ encodeArg_ ] + + +{-| Put together a bunch of builders. So if you wanted to encode three `Float` +values for the position of a ball in 3D space, you could say: + + import Bytes exposing (Endianness(..)) + import Bytes.Encode as Encode + + type alias Ball = { x : Float, y : Float, z : Float } + + ball : Ball -> Encode.Encoder + ball {x,y,z} = + Encode.sequence + [ Encode.float32 BE x + , Encode.float32 BE y + , Encode.float32 BE z + ] + +sequence: List Bytes.Encode.Encoder -> Bytes.Encode.Encoder +-} +sequence : List Elm.Expression -> Elm.Expression +sequence sequenceArg_ = + Elm.apply + (Elm.value + { importFrom = [ "Bytes", "Encode" ] + , name = "sequence" + , annotation = + Just + (Type.function + [ Type.list + (Type.namedWith [ "Bytes", "Encode" ] "Encoder" [] + ) + ] + (Type.namedWith [ "Bytes", "Encode" ] "Encoder" []) + ) + } + ) + [ Elm.list sequenceArg_ ] + + +{-| Encode integers from `-128` to `127` in one byte. + +signedInt8: Int -> Bytes.Encode.Encoder +-} +signedInt8 : Int -> Elm.Expression +signedInt8 signedInt8Arg_ = + Elm.apply + (Elm.value + { importFrom = [ "Bytes", "Encode" ] + , name = "signedInt8" + , annotation = + Just + (Type.function + [ Type.int ] + (Type.namedWith [ "Bytes", "Encode" ] "Encoder" []) + ) + } + ) + [ Elm.int signedInt8Arg_ ] + + +{-| Encode integers from `-32768` to `32767` in two bytes. + +signedInt16: Bytes.Endianness -> Int -> Bytes.Encode.Encoder +-} +signedInt16 : Elm.Expression -> Int -> Elm.Expression +signedInt16 signedInt16Arg_ signedInt16Arg_0 = + Elm.apply + (Elm.value + { importFrom = [ "Bytes", "Encode" ] + , name = "signedInt16" + , annotation = + Just + (Type.function + [ Type.namedWith [ "Bytes" ] "Endianness" [] + , Type.int + ] + (Type.namedWith [ "Bytes", "Encode" ] "Encoder" []) + ) + } + ) + [ signedInt16Arg_, Elm.int signedInt16Arg_0 ] + + +{-| Encode integers from `-2147483648` to `2147483647` in four bytes. + +signedInt32: Bytes.Endianness -> Int -> Bytes.Encode.Encoder +-} +signedInt32 : Elm.Expression -> Int -> Elm.Expression +signedInt32 signedInt32Arg_ signedInt32Arg_0 = + Elm.apply + (Elm.value + { importFrom = [ "Bytes", "Encode" ] + , name = "signedInt32" + , annotation = + Just + (Type.function + [ Type.namedWith [ "Bytes" ] "Endianness" [] + , Type.int + ] + (Type.namedWith [ "Bytes", "Encode" ] "Encoder" []) + ) + } + ) + [ signedInt32Arg_, Elm.int signedInt32Arg_0 ] + + +{-| Encode integers from `0` to `255` in one byte. + +unsignedInt8: Int -> Bytes.Encode.Encoder +-} +unsignedInt8 : Int -> Elm.Expression +unsignedInt8 unsignedInt8Arg_ = + Elm.apply + (Elm.value + { importFrom = [ "Bytes", "Encode" ] + , name = "unsignedInt8" + , annotation = + Just + (Type.function + [ Type.int ] + (Type.namedWith [ "Bytes", "Encode" ] "Encoder" []) + ) + } + ) + [ Elm.int unsignedInt8Arg_ ] + + +{-| Encode integers from `0` to `65535` in two bytes. + +unsignedInt16: Bytes.Endianness -> Int -> Bytes.Encode.Encoder +-} +unsignedInt16 : Elm.Expression -> Int -> Elm.Expression +unsignedInt16 unsignedInt16Arg_ unsignedInt16Arg_0 = + Elm.apply + (Elm.value + { importFrom = [ "Bytes", "Encode" ] + , name = "unsignedInt16" + , annotation = + Just + (Type.function + [ Type.namedWith [ "Bytes" ] "Endianness" [] + , Type.int + ] + (Type.namedWith [ "Bytes", "Encode" ] "Encoder" []) + ) + } + ) + [ unsignedInt16Arg_, Elm.int unsignedInt16Arg_0 ] + + +{-| Encode integers from `0` to `4294967295` in four bytes. + +unsignedInt32: Bytes.Endianness -> Int -> Bytes.Encode.Encoder +-} +unsignedInt32 : Elm.Expression -> Int -> Elm.Expression +unsignedInt32 unsignedInt32Arg_ unsignedInt32Arg_0 = + Elm.apply + (Elm.value + { importFrom = [ "Bytes", "Encode" ] + , name = "unsignedInt32" + , annotation = + Just + (Type.function + [ Type.namedWith [ "Bytes" ] "Endianness" [] + , Type.int + ] + (Type.namedWith [ "Bytes", "Encode" ] "Encoder" []) + ) + } + ) + [ unsignedInt32Arg_, Elm.int unsignedInt32Arg_0 ] + + +{-| Encode 32-bit floating point numbers in four bytes. + +float32: Bytes.Endianness -> Float -> Bytes.Encode.Encoder +-} +float32 : Elm.Expression -> Float -> Elm.Expression +float32 float32Arg_ float32Arg_0 = + Elm.apply + (Elm.value + { importFrom = [ "Bytes", "Encode" ] + , name = "float32" + , annotation = + Just + (Type.function + [ Type.namedWith [ "Bytes" ] "Endianness" [] + , Type.float + ] + (Type.namedWith [ "Bytes", "Encode" ] "Encoder" []) + ) + } + ) + [ float32Arg_, Elm.float float32Arg_0 ] + + +{-| Encode 64-bit floating point numbers in eight bytes. + +float64: Bytes.Endianness -> Float -> Bytes.Encode.Encoder +-} +float64 : Elm.Expression -> Float -> Elm.Expression +float64 float64Arg_ float64Arg_0 = + Elm.apply + (Elm.value + { importFrom = [ "Bytes", "Encode" ] + , name = "float64" + , annotation = + Just + (Type.function + [ Type.namedWith [ "Bytes" ] "Endianness" [] + , Type.float + ] + (Type.namedWith [ "Bytes", "Encode" ] "Encoder" []) + ) + } + ) + [ float64Arg_, Elm.float float64Arg_0 ] + + +{-| Copy bytes directly into the new `Bytes` sequence. This does not record the +width though! You usually want to say something like this: + + import Bytes exposing (Bytes, Endianness(..)) + import Bytes.Encode as Encode + + png : Bytes -> Encode.Encoder + png imageData = + Encode.sequence + [ Encode.unsignedInt32 BE (Bytes.width imageData) + , Encode.bytes imageData + ] + +This allows you to represent the width however is necessary for your protocol. +For example, you can use [Base 128 Varints][pb] for ProtoBuf, +[Variable-Length Integers][sql] for SQLite, or whatever else they dream up. + +[pb]: https://developers.google.com/protocol-buffers/docs/encoding#varints +[sql]: https://www.sqlite.org/src4/doc/trunk/www/varint.wiki + +bytes: Bytes.Bytes -> Bytes.Encode.Encoder +-} +bytes : Elm.Expression -> Elm.Expression +bytes bytesArg_ = + Elm.apply + (Elm.value + { importFrom = [ "Bytes", "Encode" ] + , name = "bytes" + , annotation = + Just + (Type.function + [ Type.namedWith [ "Bytes" ] "Bytes" [] ] + (Type.namedWith [ "Bytes", "Encode" ] "Encoder" []) + ) + } + ) + [ bytesArg_ ] + + +{-| Encode a `String` as a bunch of UTF-8 bytes. + + encode (string "$20") -- <24 32 30> + encode (string "£20") -- + encode (string "€20") -- + encode (string "bread") -- <62 72 65 61 64> + encode (string "brød") -- <62 72 C3B8 64> + +Some characters take one byte, while others can take up to four. Read more +about [UTF-8](https://en.wikipedia.org/wiki/UTF-8) to learn the details! + +But if you just encode UTF-8 directly, how can you know when you get to the end +of the string when you are decoding? So most protocols have an integer saying +how many bytes follow, like this: + + sizedString : String -> Encoder + sizedString str = + sequence + [ unsignedInt32 BE (getStringWidth str) + , string str + ] + +You can choose whatever representation you want for the width, which is helpful +because many protocols use different integer representations to save space. For +example: + +- ProtoBuf uses [Base 128 Varints](https://developers.google.com/protocol-buffers/docs/encoding#varints) +- SQLite uses [Variable-Length Integers](https://www.sqlite.org/src4/doc/trunk/www/varint.wiki) + +In both cases, small numbers can fit just one byte, saving some space. (The +SQLite encoding has the benefit that the first byte tells you how long the +number is, making it faster to decode.) In both cases, it is sort of tricky +to make negative numbers small. + +string: String -> Bytes.Encode.Encoder +-} +string : String -> Elm.Expression +string stringArg_ = + Elm.apply + (Elm.value + { importFrom = [ "Bytes", "Encode" ] + , name = "string" + , annotation = + Just + (Type.function + [ Type.string ] + (Type.namedWith [ "Bytes", "Encode" ] "Encoder" []) + ) + } + ) + [ Elm.string stringArg_ ] + + +{-| Get the width of a `String` in UTF-8 bytes. + + getStringWidth "$20" == 3 + getStringWidth "£20" == 4 + getStringWidth "€20" == 5 + getStringWidth "bread" == 5 + getStringWidth "brød" == 5 + +Most protocols need this number to come directly before a chunk of UTF-8 bytes +as a way to know where the string ends! + +Read more about how UTF-8 works [here](https://en.wikipedia.org/wiki/UTF-8). + +getStringWidth: String -> Int +-} +getStringWidth : String -> Elm.Expression +getStringWidth getStringWidthArg_ = + Elm.apply + (Elm.value + { importFrom = [ "Bytes", "Encode" ] + , name = "getStringWidth" + , annotation = Just (Type.function [ Type.string ] Type.int) + } + ) + [ Elm.string getStringWidthArg_ ] + + +annotation_ : { encoder : Type.Annotation } +annotation_ = + { encoder = Type.namedWith [ "Bytes", "Encode" ] "Encoder" [] } + + +call_ : + { encode : Elm.Expression -> Elm.Expression + , sequence : Elm.Expression -> Elm.Expression + , signedInt8 : Elm.Expression -> Elm.Expression + , signedInt16 : Elm.Expression -> Elm.Expression -> Elm.Expression + , signedInt32 : Elm.Expression -> Elm.Expression -> Elm.Expression + , unsignedInt8 : Elm.Expression -> Elm.Expression + , unsignedInt16 : Elm.Expression -> Elm.Expression -> Elm.Expression + , unsignedInt32 : Elm.Expression -> Elm.Expression -> Elm.Expression + , float32 : Elm.Expression -> Elm.Expression -> Elm.Expression + , float64 : Elm.Expression -> Elm.Expression -> Elm.Expression + , bytes : Elm.Expression -> Elm.Expression + , string : Elm.Expression -> Elm.Expression + , getStringWidth : Elm.Expression -> Elm.Expression + } +call_ = + { encode = + \encodeArg_ -> + Elm.apply + (Elm.value + { importFrom = [ "Bytes", "Encode" ] + , name = "encode" + , annotation = + Just + (Type.function + [ Type.namedWith + [ "Bytes", "Encode" ] + "Encoder" + [] + ] + (Type.namedWith [ "Bytes" ] "Bytes" []) + ) + } + ) + [ encodeArg_ ] + , sequence = + \sequenceArg_ -> + Elm.apply + (Elm.value + { importFrom = [ "Bytes", "Encode" ] + , name = "sequence" + , annotation = + Just + (Type.function + [ Type.list + (Type.namedWith + [ "Bytes", "Encode" ] + "Encoder" + [] + ) + ] + (Type.namedWith + [ "Bytes", "Encode" ] + "Encoder" + [] + ) + ) + } + ) + [ sequenceArg_ ] + , signedInt8 = + \signedInt8Arg_ -> + Elm.apply + (Elm.value + { importFrom = [ "Bytes", "Encode" ] + , name = "signedInt8" + , annotation = + Just + (Type.function + [ Type.int ] + (Type.namedWith + [ "Bytes", "Encode" ] + "Encoder" + [] + ) + ) + } + ) + [ signedInt8Arg_ ] + , signedInt16 = + \signedInt16Arg_ signedInt16Arg_0 -> + Elm.apply + (Elm.value + { importFrom = [ "Bytes", "Encode" ] + , name = "signedInt16" + , annotation = + Just + (Type.function + [ Type.namedWith [ "Bytes" ] "Endianness" [] + , Type.int + ] + (Type.namedWith + [ "Bytes", "Encode" ] + "Encoder" + [] + ) + ) + } + ) + [ signedInt16Arg_, signedInt16Arg_0 ] + , signedInt32 = + \signedInt32Arg_ signedInt32Arg_0 -> + Elm.apply + (Elm.value + { importFrom = [ "Bytes", "Encode" ] + , name = "signedInt32" + , annotation = + Just + (Type.function + [ Type.namedWith [ "Bytes" ] "Endianness" [] + , Type.int + ] + (Type.namedWith + [ "Bytes", "Encode" ] + "Encoder" + [] + ) + ) + } + ) + [ signedInt32Arg_, signedInt32Arg_0 ] + , unsignedInt8 = + \unsignedInt8Arg_ -> + Elm.apply + (Elm.value + { importFrom = [ "Bytes", "Encode" ] + , name = "unsignedInt8" + , annotation = + Just + (Type.function + [ Type.int ] + (Type.namedWith + [ "Bytes", "Encode" ] + "Encoder" + [] + ) + ) + } + ) + [ unsignedInt8Arg_ ] + , unsignedInt16 = + \unsignedInt16Arg_ unsignedInt16Arg_0 -> + Elm.apply + (Elm.value + { importFrom = [ "Bytes", "Encode" ] + , name = "unsignedInt16" + , annotation = + Just + (Type.function + [ Type.namedWith [ "Bytes" ] "Endianness" [] + , Type.int + ] + (Type.namedWith + [ "Bytes", "Encode" ] + "Encoder" + [] + ) + ) + } + ) + [ unsignedInt16Arg_, unsignedInt16Arg_0 ] + , unsignedInt32 = + \unsignedInt32Arg_ unsignedInt32Arg_0 -> + Elm.apply + (Elm.value + { importFrom = [ "Bytes", "Encode" ] + , name = "unsignedInt32" + , annotation = + Just + (Type.function + [ Type.namedWith [ "Bytes" ] "Endianness" [] + , Type.int + ] + (Type.namedWith + [ "Bytes", "Encode" ] + "Encoder" + [] + ) + ) + } + ) + [ unsignedInt32Arg_, unsignedInt32Arg_0 ] + , float32 = + \float32Arg_ float32Arg_0 -> + Elm.apply + (Elm.value + { importFrom = [ "Bytes", "Encode" ] + , name = "float32" + , annotation = + Just + (Type.function + [ Type.namedWith [ "Bytes" ] "Endianness" [] + , Type.float + ] + (Type.namedWith + [ "Bytes", "Encode" ] + "Encoder" + [] + ) + ) + } + ) + [ float32Arg_, float32Arg_0 ] + , float64 = + \float64Arg_ float64Arg_0 -> + Elm.apply + (Elm.value + { importFrom = [ "Bytes", "Encode" ] + , name = "float64" + , annotation = + Just + (Type.function + [ Type.namedWith [ "Bytes" ] "Endianness" [] + , Type.float + ] + (Type.namedWith + [ "Bytes", "Encode" ] + "Encoder" + [] + ) + ) + } + ) + [ float64Arg_, float64Arg_0 ] + , bytes = + \bytesArg_ -> + Elm.apply + (Elm.value + { importFrom = [ "Bytes", "Encode" ] + , name = "bytes" + , annotation = + Just + (Type.function + [ Type.namedWith [ "Bytes" ] "Bytes" [] ] + (Type.namedWith + [ "Bytes", "Encode" ] + "Encoder" + [] + ) + ) + } + ) + [ bytesArg_ ] + , string = + \stringArg_ -> + Elm.apply + (Elm.value + { importFrom = [ "Bytes", "Encode" ] + , name = "string" + , annotation = + Just + (Type.function + [ Type.string ] + (Type.namedWith + [ "Bytes", "Encode" ] + "Encoder" + [] + ) + ) + } + ) + [ stringArg_ ] + , getStringWidth = + \getStringWidthArg_ -> + Elm.apply + (Elm.value + { importFrom = [ "Bytes", "Encode" ] + , name = "getStringWidth" + , annotation = + Just (Type.function [ Type.string ] Type.int) + } + ) + [ getStringWidthArg_ ] + } + + +values_ : + { encode : Elm.Expression + , sequence : Elm.Expression + , signedInt8 : Elm.Expression + , signedInt16 : Elm.Expression + , signedInt32 : Elm.Expression + , unsignedInt8 : Elm.Expression + , unsignedInt16 : Elm.Expression + , unsignedInt32 : Elm.Expression + , float32 : Elm.Expression + , float64 : Elm.Expression + , bytes : Elm.Expression + , string : Elm.Expression + , getStringWidth : Elm.Expression + } +values_ = + { encode = + Elm.value + { importFrom = [ "Bytes", "Encode" ] + , name = "encode" + , annotation = + Just + (Type.function + [ Type.namedWith [ "Bytes", "Encode" ] "Encoder" [] ] + (Type.namedWith [ "Bytes" ] "Bytes" []) + ) + } + , sequence = + Elm.value + { importFrom = [ "Bytes", "Encode" ] + , name = "sequence" + , annotation = + Just + (Type.function + [ Type.list + (Type.namedWith [ "Bytes", "Encode" ] "Encoder" []) + ] + (Type.namedWith [ "Bytes", "Encode" ] "Encoder" []) + ) + } + , signedInt8 = + Elm.value + { importFrom = [ "Bytes", "Encode" ] + , name = "signedInt8" + , annotation = + Just + (Type.function + [ Type.int ] + (Type.namedWith [ "Bytes", "Encode" ] "Encoder" []) + ) + } + , signedInt16 = + Elm.value + { importFrom = [ "Bytes", "Encode" ] + , name = "signedInt16" + , annotation = + Just + (Type.function + [ Type.namedWith [ "Bytes" ] "Endianness" [] + , Type.int + ] + (Type.namedWith [ "Bytes", "Encode" ] "Encoder" []) + ) + } + , signedInt32 = + Elm.value + { importFrom = [ "Bytes", "Encode" ] + , name = "signedInt32" + , annotation = + Just + (Type.function + [ Type.namedWith [ "Bytes" ] "Endianness" [] + , Type.int + ] + (Type.namedWith [ "Bytes", "Encode" ] "Encoder" []) + ) + } + , unsignedInt8 = + Elm.value + { importFrom = [ "Bytes", "Encode" ] + , name = "unsignedInt8" + , annotation = + Just + (Type.function + [ Type.int ] + (Type.namedWith [ "Bytes", "Encode" ] "Encoder" []) + ) + } + , unsignedInt16 = + Elm.value + { importFrom = [ "Bytes", "Encode" ] + , name = "unsignedInt16" + , annotation = + Just + (Type.function + [ Type.namedWith [ "Bytes" ] "Endianness" [] + , Type.int + ] + (Type.namedWith [ "Bytes", "Encode" ] "Encoder" []) + ) + } + , unsignedInt32 = + Elm.value + { importFrom = [ "Bytes", "Encode" ] + , name = "unsignedInt32" + , annotation = + Just + (Type.function + [ Type.namedWith [ "Bytes" ] "Endianness" [] + , Type.int + ] + (Type.namedWith [ "Bytes", "Encode" ] "Encoder" []) + ) + } + , float32 = + Elm.value + { importFrom = [ "Bytes", "Encode" ] + , name = "float32" + , annotation = + Just + (Type.function + [ Type.namedWith [ "Bytes" ] "Endianness" [] + , Type.float + ] + (Type.namedWith [ "Bytes", "Encode" ] "Encoder" []) + ) + } + , float64 = + Elm.value + { importFrom = [ "Bytes", "Encode" ] + , name = "float64" + , annotation = + Just + (Type.function + [ Type.namedWith [ "Bytes" ] "Endianness" [] + , Type.float + ] + (Type.namedWith [ "Bytes", "Encode" ] "Encoder" []) + ) + } + , bytes = + Elm.value + { importFrom = [ "Bytes", "Encode" ] + , name = "bytes" + , annotation = + Just + (Type.function + [ Type.namedWith [ "Bytes" ] "Bytes" [] ] + (Type.namedWith [ "Bytes", "Encode" ] "Encoder" []) + ) + } + , string = + Elm.value + { importFrom = [ "Bytes", "Encode" ] + , name = "string" + , annotation = + Just + (Type.function + [ Type.string ] + (Type.namedWith [ "Bytes", "Encode" ] "Encoder" []) + ) + } + , getStringWidth = + Elm.value + { importFrom = [ "Bytes", "Encode" ] + , name = "getStringWidth" + , annotation = Just (Type.function [ Type.string ] Type.int) + } + } \ No newline at end of file diff --git a/elm-open-api-codegen/src/Gen/Char.elm b/elm-open-api-codegen/src/Gen/Char.elm new file mode 100644 index 00000000..06af506e --- /dev/null +++ b/elm-open-api-codegen/src/Gen/Char.elm @@ -0,0 +1,560 @@ +module Gen.Char exposing + ( moduleName_, isUpper, isLower, isAlpha, isAlphaNum, isDigit + , isOctDigit, isHexDigit, toUpper, toLower, toLocaleUpper, toLocaleLower, toCode + , fromCode, annotation_, call_, values_ + ) + +{-| +# Generated bindings for Char + +@docs moduleName_, isUpper, isLower, isAlpha, isAlphaNum, isDigit +@docs isOctDigit, isHexDigit, toUpper, toLower, toLocaleUpper, toLocaleLower +@docs toCode, fromCode, annotation_, call_, values_ +-} + + +import Elm +import Elm.Annotation as Type + + +{-| The name of this module. -} +moduleName_ : List String +moduleName_ = + [ "Char" ] + + +{-| Detect upper case ASCII characters. + + isUpper 'A' == True + isUpper 'B' == True + ... + isUpper 'Z' == True + + isUpper '0' == False + isUpper 'a' == False + isUpper '-' == False + isUpper 'Σ' == False + +isUpper: Char.Char -> Bool +-} +isUpper : Char.Char -> Elm.Expression +isUpper isUpperArg_ = + Elm.apply + (Elm.value + { importFrom = [ "Char" ] + , name = "isUpper" + , annotation = Just (Type.function [ Type.char ] Type.bool) + } + ) + [ Elm.char isUpperArg_ ] + + +{-| Detect lower case ASCII characters. + + isLower 'a' == True + isLower 'b' == True + ... + isLower 'z' == True + + isLower '0' == False + isLower 'A' == False + isLower '-' == False + isLower 'π' == False + +isLower: Char.Char -> Bool +-} +isLower : Char.Char -> Elm.Expression +isLower isLowerArg_ = + Elm.apply + (Elm.value + { importFrom = [ "Char" ] + , name = "isLower" + , annotation = Just (Type.function [ Type.char ] Type.bool) + } + ) + [ Elm.char isLowerArg_ ] + + +{-| Detect upper case and lower case ASCII characters. + + isAlpha 'a' == True + isAlpha 'b' == True + isAlpha 'E' == True + isAlpha 'Y' == True + + isAlpha '0' == False + isAlpha '-' == False + isAlpha 'π' == False + +isAlpha: Char.Char -> Bool +-} +isAlpha : Char.Char -> Elm.Expression +isAlpha isAlphaArg_ = + Elm.apply + (Elm.value + { importFrom = [ "Char" ] + , name = "isAlpha" + , annotation = Just (Type.function [ Type.char ] Type.bool) + } + ) + [ Elm.char isAlphaArg_ ] + + +{-| Detect upper case and lower case ASCII characters. + + isAlphaNum 'a' == True + isAlphaNum 'b' == True + isAlphaNum 'E' == True + isAlphaNum 'Y' == True + isAlphaNum '0' == True + isAlphaNum '7' == True + + isAlphaNum '-' == False + isAlphaNum 'π' == False + +isAlphaNum: Char.Char -> Bool +-} +isAlphaNum : Char.Char -> Elm.Expression +isAlphaNum isAlphaNumArg_ = + Elm.apply + (Elm.value + { importFrom = [ "Char" ] + , name = "isAlphaNum" + , annotation = Just (Type.function [ Type.char ] Type.bool) + } + ) + [ Elm.char isAlphaNumArg_ ] + + +{-| Detect digits `0123456789` + + isDigit '0' == True + isDigit '1' == True + ... + isDigit '9' == True + + isDigit 'a' == False + isDigit 'b' == False + isDigit 'A' == False + +isDigit: Char.Char -> Bool +-} +isDigit : Char.Char -> Elm.Expression +isDigit isDigitArg_ = + Elm.apply + (Elm.value + { importFrom = [ "Char" ] + , name = "isDigit" + , annotation = Just (Type.function [ Type.char ] Type.bool) + } + ) + [ Elm.char isDigitArg_ ] + + +{-| Detect octal digits `01234567` + + isOctDigit '0' == True + isOctDigit '1' == True + ... + isOctDigit '7' == True + + isOctDigit '8' == False + isOctDigit 'a' == False + isOctDigit 'A' == False + +isOctDigit: Char.Char -> Bool +-} +isOctDigit : Char.Char -> Elm.Expression +isOctDigit isOctDigitArg_ = + Elm.apply + (Elm.value + { importFrom = [ "Char" ] + , name = "isOctDigit" + , annotation = Just (Type.function [ Type.char ] Type.bool) + } + ) + [ Elm.char isOctDigitArg_ ] + + +{-| Detect hexadecimal digits `0123456789abcdefABCDEF` + +isHexDigit: Char.Char -> Bool +-} +isHexDigit : Char.Char -> Elm.Expression +isHexDigit isHexDigitArg_ = + Elm.apply + (Elm.value + { importFrom = [ "Char" ] + , name = "isHexDigit" + , annotation = Just (Type.function [ Type.char ] Type.bool) + } + ) + [ Elm.char isHexDigitArg_ ] + + +{-| Convert to upper case. + +toUpper: Char.Char -> Char.Char +-} +toUpper : Char.Char -> Elm.Expression +toUpper toUpperArg_ = + Elm.apply + (Elm.value + { importFrom = [ "Char" ] + , name = "toUpper" + , annotation = Just (Type.function [ Type.char ] Type.char) + } + ) + [ Elm.char toUpperArg_ ] + + +{-| Convert to lower case. + +toLower: Char.Char -> Char.Char +-} +toLower : Char.Char -> Elm.Expression +toLower toLowerArg_ = + Elm.apply + (Elm.value + { importFrom = [ "Char" ] + , name = "toLower" + , annotation = Just (Type.function [ Type.char ] Type.char) + } + ) + [ Elm.char toLowerArg_ ] + + +{-| Convert to upper case, according to any locale-specific case mappings. + +toLocaleUpper: Char.Char -> Char.Char +-} +toLocaleUpper : Char.Char -> Elm.Expression +toLocaleUpper toLocaleUpperArg_ = + Elm.apply + (Elm.value + { importFrom = [ "Char" ] + , name = "toLocaleUpper" + , annotation = Just (Type.function [ Type.char ] Type.char) + } + ) + [ Elm.char toLocaleUpperArg_ ] + + +{-| Convert to lower case, according to any locale-specific case mappings. + +toLocaleLower: Char.Char -> Char.Char +-} +toLocaleLower : Char.Char -> Elm.Expression +toLocaleLower toLocaleLowerArg_ = + Elm.apply + (Elm.value + { importFrom = [ "Char" ] + , name = "toLocaleLower" + , annotation = Just (Type.function [ Type.char ] Type.char) + } + ) + [ Elm.char toLocaleLowerArg_ ] + + +{-| Convert to the corresponding Unicode [code point][cp]. + +[cp]: https://en.wikipedia.org/wiki/Code_point + + toCode 'A' == 65 + toCode 'B' == 66 + toCode '木' == 0x6728 + toCode '𝌆' == 0x1D306 + toCode '😃' == 0x1F603 + +toCode: Char.Char -> Int +-} +toCode : Char.Char -> Elm.Expression +toCode toCodeArg_ = + Elm.apply + (Elm.value + { importFrom = [ "Char" ] + , name = "toCode" + , annotation = Just (Type.function [ Type.char ] Type.int) + } + ) + [ Elm.char toCodeArg_ ] + + +{-| Convert a Unicode [code point][cp] to a character. + + fromCode 65 == 'A' + fromCode 66 == 'B' + fromCode 0x6728 == '木' + fromCode 0x1D306 == '𝌆' + fromCode 0x1F603 == '😃' + fromCode -1 == '�' + +The full range of unicode is from `0` to `0x10FFFF`. With numbers outside that +range, you get [the replacement character][fffd]. + +[cp]: https://en.wikipedia.org/wiki/Code_point +[fffd]: https://en.wikipedia.org/wiki/Specials_(Unicode_block)#Replacement_character + +fromCode: Int -> Char.Char +-} +fromCode : Int -> Elm.Expression +fromCode fromCodeArg_ = + Elm.apply + (Elm.value + { importFrom = [ "Char" ] + , name = "fromCode" + , annotation = Just (Type.function [ Type.int ] Type.char) + } + ) + [ Elm.int fromCodeArg_ ] + + +annotation_ : { char : Type.Annotation } +annotation_ = + { char = Type.namedWith [] "Char" [] } + + +call_ : + { isUpper : Elm.Expression -> Elm.Expression + , isLower : Elm.Expression -> Elm.Expression + , isAlpha : Elm.Expression -> Elm.Expression + , isAlphaNum : Elm.Expression -> Elm.Expression + , isDigit : Elm.Expression -> Elm.Expression + , isOctDigit : Elm.Expression -> Elm.Expression + , isHexDigit : Elm.Expression -> Elm.Expression + , toUpper : Elm.Expression -> Elm.Expression + , toLower : Elm.Expression -> Elm.Expression + , toLocaleUpper : Elm.Expression -> Elm.Expression + , toLocaleLower : Elm.Expression -> Elm.Expression + , toCode : Elm.Expression -> Elm.Expression + , fromCode : Elm.Expression -> Elm.Expression + } +call_ = + { isUpper = + \isUpperArg_ -> + Elm.apply + (Elm.value + { importFrom = [ "Char" ] + , name = "isUpper" + , annotation = Just (Type.function [ Type.char ] Type.bool) + } + ) + [ isUpperArg_ ] + , isLower = + \isLowerArg_ -> + Elm.apply + (Elm.value + { importFrom = [ "Char" ] + , name = "isLower" + , annotation = Just (Type.function [ Type.char ] Type.bool) + } + ) + [ isLowerArg_ ] + , isAlpha = + \isAlphaArg_ -> + Elm.apply + (Elm.value + { importFrom = [ "Char" ] + , name = "isAlpha" + , annotation = Just (Type.function [ Type.char ] Type.bool) + } + ) + [ isAlphaArg_ ] + , isAlphaNum = + \isAlphaNumArg_ -> + Elm.apply + (Elm.value + { importFrom = [ "Char" ] + , name = "isAlphaNum" + , annotation = Just (Type.function [ Type.char ] Type.bool) + } + ) + [ isAlphaNumArg_ ] + , isDigit = + \isDigitArg_ -> + Elm.apply + (Elm.value + { importFrom = [ "Char" ] + , name = "isDigit" + , annotation = Just (Type.function [ Type.char ] Type.bool) + } + ) + [ isDigitArg_ ] + , isOctDigit = + \isOctDigitArg_ -> + Elm.apply + (Elm.value + { importFrom = [ "Char" ] + , name = "isOctDigit" + , annotation = Just (Type.function [ Type.char ] Type.bool) + } + ) + [ isOctDigitArg_ ] + , isHexDigit = + \isHexDigitArg_ -> + Elm.apply + (Elm.value + { importFrom = [ "Char" ] + , name = "isHexDigit" + , annotation = Just (Type.function [ Type.char ] Type.bool) + } + ) + [ isHexDigitArg_ ] + , toUpper = + \toUpperArg_ -> + Elm.apply + (Elm.value + { importFrom = [ "Char" ] + , name = "toUpper" + , annotation = Just (Type.function [ Type.char ] Type.char) + } + ) + [ toUpperArg_ ] + , toLower = + \toLowerArg_ -> + Elm.apply + (Elm.value + { importFrom = [ "Char" ] + , name = "toLower" + , annotation = Just (Type.function [ Type.char ] Type.char) + } + ) + [ toLowerArg_ ] + , toLocaleUpper = + \toLocaleUpperArg_ -> + Elm.apply + (Elm.value + { importFrom = [ "Char" ] + , name = "toLocaleUpper" + , annotation = Just (Type.function [ Type.char ] Type.char) + } + ) + [ toLocaleUpperArg_ ] + , toLocaleLower = + \toLocaleLowerArg_ -> + Elm.apply + (Elm.value + { importFrom = [ "Char" ] + , name = "toLocaleLower" + , annotation = Just (Type.function [ Type.char ] Type.char) + } + ) + [ toLocaleLowerArg_ ] + , toCode = + \toCodeArg_ -> + Elm.apply + (Elm.value + { importFrom = [ "Char" ] + , name = "toCode" + , annotation = Just (Type.function [ Type.char ] Type.int) + } + ) + [ toCodeArg_ ] + , fromCode = + \fromCodeArg_ -> + Elm.apply + (Elm.value + { importFrom = [ "Char" ] + , name = "fromCode" + , annotation = Just (Type.function [ Type.int ] Type.char) + } + ) + [ fromCodeArg_ ] + } + + +values_ : + { isUpper : Elm.Expression + , isLower : Elm.Expression + , isAlpha : Elm.Expression + , isAlphaNum : Elm.Expression + , isDigit : Elm.Expression + , isOctDigit : Elm.Expression + , isHexDigit : Elm.Expression + , toUpper : Elm.Expression + , toLower : Elm.Expression + , toLocaleUpper : Elm.Expression + , toLocaleLower : Elm.Expression + , toCode : Elm.Expression + , fromCode : Elm.Expression + } +values_ = + { isUpper = + Elm.value + { importFrom = [ "Char" ] + , name = "isUpper" + , annotation = Just (Type.function [ Type.char ] Type.bool) + } + , isLower = + Elm.value + { importFrom = [ "Char" ] + , name = "isLower" + , annotation = Just (Type.function [ Type.char ] Type.bool) + } + , isAlpha = + Elm.value + { importFrom = [ "Char" ] + , name = "isAlpha" + , annotation = Just (Type.function [ Type.char ] Type.bool) + } + , isAlphaNum = + Elm.value + { importFrom = [ "Char" ] + , name = "isAlphaNum" + , annotation = Just (Type.function [ Type.char ] Type.bool) + } + , isDigit = + Elm.value + { importFrom = [ "Char" ] + , name = "isDigit" + , annotation = Just (Type.function [ Type.char ] Type.bool) + } + , isOctDigit = + Elm.value + { importFrom = [ "Char" ] + , name = "isOctDigit" + , annotation = Just (Type.function [ Type.char ] Type.bool) + } + , isHexDigit = + Elm.value + { importFrom = [ "Char" ] + , name = "isHexDigit" + , annotation = Just (Type.function [ Type.char ] Type.bool) + } + , toUpper = + Elm.value + { importFrom = [ "Char" ] + , name = "toUpper" + , annotation = Just (Type.function [ Type.char ] Type.char) + } + , toLower = + Elm.value + { importFrom = [ "Char" ] + , name = "toLower" + , annotation = Just (Type.function [ Type.char ] Type.char) + } + , toLocaleUpper = + Elm.value + { importFrom = [ "Char" ] + , name = "toLocaleUpper" + , annotation = Just (Type.function [ Type.char ] Type.char) + } + , toLocaleLower = + Elm.value + { importFrom = [ "Char" ] + , name = "toLocaleLower" + , annotation = Just (Type.function [ Type.char ] Type.char) + } + , toCode = + Elm.value + { importFrom = [ "Char" ] + , name = "toCode" + , annotation = Just (Type.function [ Type.char ] Type.int) + } + , fromCode = + Elm.value + { importFrom = [ "Char" ] + , name = "fromCode" + , annotation = Just (Type.function [ Type.int ] Type.char) + } + } \ No newline at end of file diff --git a/elm-open-api-codegen/src/Gen/Date.elm b/elm-open-api-codegen/src/Gen/Date.elm new file mode 100644 index 00000000..c713a49a --- /dev/null +++ b/elm-open-api-codegen/src/Gen/Date.elm @@ -0,0 +1,2474 @@ +module Gen.Date exposing + ( moduleName_, today, fromPosix, fromCalendarDate, fromWeekDate, fromOrdinalDate + , fromIsoString, fromRataDie, toIsoString, toRataDie, year, month, day + , weekYear, weekNumber, weekday, ordinalDay, quarter, monthNumber, weekdayNumber + , format, withOrdinalSuffix, formatWithLanguage, add, diff, ceiling, floor + , range, compare, isBetween, min, max, clamp, monthToNumber + , numberToMonth, weekdayToNumber, numberToWeekday, annotation_, make_, caseOf_, call_ + , values_ + ) + +{-| +# Generated bindings for Date + +@docs moduleName_, today, fromPosix, fromCalendarDate, fromWeekDate, fromOrdinalDate +@docs fromIsoString, fromRataDie, toIsoString, toRataDie, year, month +@docs day, weekYear, weekNumber, weekday, ordinalDay, quarter +@docs monthNumber, weekdayNumber, format, withOrdinalSuffix, formatWithLanguage, add +@docs diff, ceiling, floor, range, compare, isBetween +@docs min, max, clamp, monthToNumber, numberToMonth, weekdayToNumber +@docs numberToWeekday, annotation_, make_, caseOf_, call_, values_ +-} + + +import Elm +import Elm.Annotation as Type +import Elm.Arg +import Elm.Case + + +{-| The name of this module. -} +moduleName_ : List String +moduleName_ = + [ "Date" ] + + +{-| Get the current local date. See [this page][calendarexample] for a full example. + +[calendarexample]: https://github.com/justinmimbs/date/blob/master/examples/Calendar.elm + +today: Task.Task x Date.Date +-} +today : Elm.Expression +today = + Elm.value + { importFrom = [ "Date" ] + , name = "today" + , annotation = + Just + (Type.namedWith + [ "Task" ] + "Task" + [ Type.var "x", Type.namedWith [ "Date" ] "Date" [] ] + ) + } + + +{-| Create a date from a time [`Zone`][zone] and a [`Posix`][posix] time. This +conversion loses the time information associated with the `Posix` value. + + import Date exposing (fromCalendarDate, fromPosix) + import Time exposing (millisToPosix, utc, Month(..)) + + fromPosix utc (millisToPosix 0) + == fromCalendarDate 1970 Jan 1 + +[zone]: https://package.elm-lang.org/packages/elm/time/latest/Time#Zone +[posix]: https://package.elm-lang.org/packages/elm/time/latest/Time#Posix + +fromPosix: Time.Zone -> Time.Posix -> Date.Date +-} +fromPosix : Elm.Expression -> Elm.Expression -> Elm.Expression +fromPosix fromPosixArg_ fromPosixArg_0 = + Elm.apply + (Elm.value + { importFrom = [ "Date" ] + , name = "fromPosix" + , annotation = + Just + (Type.function + [ Type.namedWith [ "Time" ] "Zone" [] + , Type.namedWith [ "Time" ] "Posix" [] + ] + (Type.namedWith [ "Date" ] "Date" []) + ) + } + ) + [ fromPosixArg_, fromPosixArg_0 ] + + +{-| Create a date from a [calendar date][gregorian]: a year, month, and day of +the month. Out-of-range day values will be clamped. + + import Date exposing (fromCalendarDate) + import Time exposing (Month(..)) + + fromCalendarDate 2018 Sep 26 + +[gregorian]: https://en.wikipedia.org/wiki/Proleptic_Gregorian_calendar + +fromCalendarDate: Int -> Date.Month -> Int -> Date.Date +-} +fromCalendarDate : Int -> Elm.Expression -> Int -> Elm.Expression +fromCalendarDate fromCalendarDateArg_ fromCalendarDateArg_0 fromCalendarDateArg_1 = + Elm.apply + (Elm.value + { importFrom = [ "Date" ] + , name = "fromCalendarDate" + , annotation = + Just + (Type.function + [ Type.int + , Type.namedWith [ "Date" ] "Month" [] + , Type.int + ] + (Type.namedWith [ "Date" ] "Date" []) + ) + } + ) + [ Elm.int fromCalendarDateArg_ + , fromCalendarDateArg_0 + , Elm.int fromCalendarDateArg_1 + ] + + +{-| Create a date from an [ISO week date][weekdate]: a week-numbering year, +week number, and weekday. Out-of-range week number values will be clamped. + + import Date exposing (fromWeekDate) + import Time exposing (Weekday(..)) + + fromWeekDate 2018 39 Wed + +[weekdate]: https://en.wikipedia.org/wiki/ISO_week_date + +fromWeekDate: Int -> Int -> Date.Weekday -> Date.Date +-} +fromWeekDate : Int -> Int -> Elm.Expression -> Elm.Expression +fromWeekDate fromWeekDateArg_ fromWeekDateArg_0 fromWeekDateArg_1 = + Elm.apply + (Elm.value + { importFrom = [ "Date" ] + , name = "fromWeekDate" + , annotation = + Just + (Type.function + [ Type.int + , Type.int + , Type.namedWith [ "Date" ] "Weekday" [] + ] + (Type.namedWith [ "Date" ] "Date" []) + ) + } + ) + [ Elm.int fromWeekDateArg_ + , Elm.int fromWeekDateArg_0 + , fromWeekDateArg_1 + ] + + +{-| Create a date from an [ordinal date][ordinaldate]: a year and day of the +year. Out-of-range day values will be clamped. + + import Date exposing (fromOrdinalDate) + + fromOrdinalDate 2018 269 + +[ordinaldate]: https://en.wikipedia.org/wiki/Ordinal_date + +fromOrdinalDate: Int -> Int -> Date.Date +-} +fromOrdinalDate : Int -> Int -> Elm.Expression +fromOrdinalDate fromOrdinalDateArg_ fromOrdinalDateArg_0 = + Elm.apply + (Elm.value + { importFrom = [ "Date" ] + , name = "fromOrdinalDate" + , annotation = + Just + (Type.function + [ Type.int, Type.int ] + (Type.namedWith [ "Date" ] "Date" []) + ) + } + ) + [ Elm.int fromOrdinalDateArg_, Elm.int fromOrdinalDateArg_0 ] + + +{-| Attempt to create a date from a string in [ISO 8601][iso8601] format. +Calendar dates, week dates, and ordinal dates are all supported in extended +and basic format. + + import Date exposing (fromIsoString, fromCalendarDate, fromWeekDate, fromOrdinalDate) + import Time exposing (Month(..), Weekday(..)) + + -- calendar date + fromIsoString "2018-09-26" + == Ok (fromCalendarDate 2018 Sep 26) + + + -- week date + fromIsoString "2018-W39-3" + == Ok (fromWeekDate 2018 39 Wed) + + + -- ordinal date + fromIsoString "2018-269" + == Ok (fromOrdinalDate 2018 269) + +The string must represent a valid date; unlike `fromCalendarDate` and +friends, any out-of-range values will fail to produce a date. + + fromIsoString "2018-02-29" + == Err "Invalid calendar date (2018, 2, 29)" + +[iso8601]: https://en.wikipedia.org/wiki/ISO_8601 + +fromIsoString: String -> Result.Result String Date.Date +-} +fromIsoString : String -> Elm.Expression +fromIsoString fromIsoStringArg_ = + Elm.apply + (Elm.value + { importFrom = [ "Date" ] + , name = "fromIsoString" + , annotation = + Just + (Type.function + [ Type.string ] + (Type.namedWith + [ "Result" ] + "Result" + [ Type.string + , Type.namedWith [ "Date" ] "Date" [] + ] + ) + ) + } + ) + [ Elm.string fromIsoStringArg_ ] + + +{-| [Rata Die][ratadie] is a system for assigning numbers to calendar days, +where the number 1 represents the date _1 January 0001_. + +You can losslessly convert a `Date` to and from an `Int` representing the date +in Rata Die. This makes it a convenient representation for transporting dates +or using them as comparables. For all date values: + + (date |> toRataDie |> fromRataDie) + == date + +[ratadie]: https://en.wikipedia.org/wiki/Rata_Die + +fromRataDie: Int -> Date.Date +-} +fromRataDie : Int -> Elm.Expression +fromRataDie fromRataDieArg_ = + Elm.apply + (Elm.value + { importFrom = [ "Date" ] + , name = "fromRataDie" + , annotation = + Just + (Type.function + [ Type.int ] + (Type.namedWith [ "Date" ] "Date" []) + ) + } + ) + [ Elm.int fromRataDieArg_ ] + + +{-| Convert a date to a string in ISO 8601 extended format. + + import Date exposing (fromOrdinalDate, toIsoString) + + toIsoString (fromOrdinalDate 2001 1) + == "2001-01-01" + +toIsoString: Date.Date -> String +-} +toIsoString : Elm.Expression -> Elm.Expression +toIsoString toIsoStringArg_ = + Elm.apply + (Elm.value + { importFrom = [ "Date" ] + , name = "toIsoString" + , annotation = + Just + (Type.function + [ Type.namedWith [ "Date" ] "Date" [] ] + Type.string + ) + } + ) + [ toIsoStringArg_ ] + + +{-| Convert a date to its number representation in Rata Die (see +[`fromRataDie`](#fromRataDie)). For all date values: + + (date |> toRataDie |> fromRataDie) + == date + +toRataDie: Date.Date -> Int +-} +toRataDie : Elm.Expression -> Elm.Expression +toRataDie toRataDieArg_ = + Elm.apply + (Elm.value + { importFrom = [ "Date" ] + , name = "toRataDie" + , annotation = + Just + (Type.function + [ Type.namedWith [ "Date" ] "Date" [] ] + Type.int + ) + } + ) + [ toRataDieArg_ ] + + +{-| The calendar year. + +year: Date.Date -> Int +-} +year : Elm.Expression -> Elm.Expression +year yearArg_ = + Elm.apply + (Elm.value + { importFrom = [ "Date" ] + , name = "year" + , annotation = + Just + (Type.function + [ Type.namedWith [ "Date" ] "Date" [] ] + Type.int + ) + } + ) + [ yearArg_ ] + + +{-| The month as a [`Month`](https://package.elm-lang.org/packages/elm/time/latest/Time#Month) +value (`Jan`–`Dec`). + +month: Date.Date -> Date.Month +-} +month : Elm.Expression -> Elm.Expression +month monthArg_ = + Elm.apply + (Elm.value + { importFrom = [ "Date" ] + , name = "month" + , annotation = + Just + (Type.function + [ Type.namedWith [ "Date" ] "Date" [] ] + (Type.namedWith [ "Date" ] "Month" []) + ) + } + ) + [ monthArg_ ] + + +{-| The day of the month (1–31). + +day: Date.Date -> Int +-} +day : Elm.Expression -> Elm.Expression +day dayArg_ = + Elm.apply + (Elm.value + { importFrom = [ "Date" ] + , name = "day" + , annotation = + Just + (Type.function + [ Type.namedWith [ "Date" ] "Date" [] ] + Type.int + ) + } + ) + [ dayArg_ ] + + +{-| The ISO week-numbering year. This is not always the same as the +calendar year. + +weekYear: Date.Date -> Int +-} +weekYear : Elm.Expression -> Elm.Expression +weekYear weekYearArg_ = + Elm.apply + (Elm.value + { importFrom = [ "Date" ] + , name = "weekYear" + , annotation = + Just + (Type.function + [ Type.namedWith [ "Date" ] "Date" [] ] + Type.int + ) + } + ) + [ weekYearArg_ ] + + +{-| The ISO week number of the year (1–53). + +weekNumber: Date.Date -> Int +-} +weekNumber : Elm.Expression -> Elm.Expression +weekNumber weekNumberArg_ = + Elm.apply + (Elm.value + { importFrom = [ "Date" ] + , name = "weekNumber" + , annotation = + Just + (Type.function + [ Type.namedWith [ "Date" ] "Date" [] ] + Type.int + ) + } + ) + [ weekNumberArg_ ] + + +{-| The weekday as a [`Weekday`](https://package.elm-lang.org/packages/elm/time/latest/Time#Weekday) +value (`Mon`–`Sun`). + +weekday: Date.Date -> Date.Weekday +-} +weekday : Elm.Expression -> Elm.Expression +weekday weekdayArg_ = + Elm.apply + (Elm.value + { importFrom = [ "Date" ] + , name = "weekday" + , annotation = + Just + (Type.function + [ Type.namedWith [ "Date" ] "Date" [] ] + (Type.namedWith [ "Date" ] "Weekday" []) + ) + } + ) + [ weekdayArg_ ] + + +{-| The day of the year (1–366). + +ordinalDay: Date.Date -> Int +-} +ordinalDay : Elm.Expression -> Elm.Expression +ordinalDay ordinalDayArg_ = + Elm.apply + (Elm.value + { importFrom = [ "Date" ] + , name = "ordinalDay" + , annotation = + Just + (Type.function + [ Type.namedWith [ "Date" ] "Date" [] ] + Type.int + ) + } + ) + [ ordinalDayArg_ ] + + +{-| The quarter of the year (1–4). + +quarter: Date.Date -> Int +-} +quarter : Elm.Expression -> Elm.Expression +quarter quarterArg_ = + Elm.apply + (Elm.value + { importFrom = [ "Date" ] + , name = "quarter" + , annotation = + Just + (Type.function + [ Type.namedWith [ "Date" ] "Date" [] ] + Type.int + ) + } + ) + [ quarterArg_ ] + + +{-| The month number (1–12). + +monthNumber: Date.Date -> Int +-} +monthNumber : Elm.Expression -> Elm.Expression +monthNumber monthNumberArg_ = + Elm.apply + (Elm.value + { importFrom = [ "Date" ] + , name = "monthNumber" + , annotation = + Just + (Type.function + [ Type.namedWith [ "Date" ] "Date" [] ] + Type.int + ) + } + ) + [ monthNumberArg_ ] + + +{-| The weekday number (1–7), beginning with Monday. + +weekdayNumber: Date.Date -> Int +-} +weekdayNumber : Elm.Expression -> Elm.Expression +weekdayNumber weekdayNumberArg_ = + Elm.apply + (Elm.value + { importFrom = [ "Date" ] + , name = "weekdayNumber" + , annotation = + Just + (Type.function + [ Type.namedWith [ "Date" ] "Date" [] ] + Type.int + ) + } + ) + [ weekdayNumberArg_ ] + + +{-| Format a date using a string as a template. + + import Date exposing (fromOrdinalDate, format) + + format "EEEE, d MMMM y" (fromOrdinalDate 1970 1) + == "Thursday, 1 January 1970" + +Alphabetic characters in the template represent date information; the number of +times a character is repeated specifies the form of a name (e.g. `"Tue"`, +`"Tuesday"`) or the padding of a number (e.g. `"1"`, `"01"`). + +Alphabetic characters can be escaped within single-quotes; a single-quote can +be escaped as a sequence of two single-quotes, whether appearing inside or +outside an escaped sequence. + +Templates are based on Date Format Patterns in [Unicode Technical +Standard #35][uts35]. Only the following subset of formatting characters +are available: + + "y" -- year + + "Y" -- week-numbering year + + "Q" -- quarter + + "M" -- month (number or name) + + "w" -- week number + + "d" -- day + + "D" -- ordinal day + + "E" -- weekday name + + "e" -- weekday number + +[uts35]: http://www.unicode.org/reports/tr35/tr35-43/tr35-dates.html#Date_Format_Patterns + +The non-standard pattern field "ddd" is available to indicate the day of the +month with an ordinal suffix (e.g. `"1st"`, `"15th"`), as the current standard +does not include such a field. + + format "MMMM ddd, y" (fromOrdinalDate 1970 1) + == "January 1st, 1970" + +format: String -> Date.Date -> String +-} +format : String -> Elm.Expression -> Elm.Expression +format formatArg_ formatArg_0 = + Elm.apply + (Elm.value + { importFrom = [ "Date" ] + , name = "format" + , annotation = + Just + (Type.function + [ Type.string, Type.namedWith [ "Date" ] "Date" [] ] + Type.string + ) + } + ) + [ Elm.string formatArg_, formatArg_0 ] + + +{-| Convert an integer into an English ordinal number string (like `"4th"`). + + import Date exposing (withOrdinalSuffix) + + withOrdinalSuffix 21 == "21st" + withOrdinalSuffix 42 == "42nd" + withOrdinalSuffix 0 == "0th" + withOrdinalSuffix 23 == "23rd" + withOrdinalSuffix -1 == "-1st" + +withOrdinalSuffix: Int -> String +-} +withOrdinalSuffix : Int -> Elm.Expression +withOrdinalSuffix withOrdinalSuffixArg_ = + Elm.apply + (Elm.value + { importFrom = [ "Date" ] + , name = "withOrdinalSuffix" + , annotation = Just (Type.function [ Type.int ] Type.string) + } + ) + [ Elm.int withOrdinalSuffixArg_ ] + + +{-| Format a date in a custom language using a string as a template. + + import Date exposing (fromOrdinalDate, formatWithLanguage) + + formatWithLanguage fr "EEEE, ddd MMMM y" (fromOrdinalDate 1970 1) + == "jeudi, 1er janvier 1970" + + -- assuming `fr` is a custom `Date.Language` + +formatWithLanguage: Date.Language -> String -> Date.Date -> String +-} +formatWithLanguage : + Elm.Expression -> String -> Elm.Expression -> Elm.Expression +formatWithLanguage formatWithLanguageArg_ formatWithLanguageArg_0 formatWithLanguageArg_1 = + Elm.apply + (Elm.value + { importFrom = [ "Date" ] + , name = "formatWithLanguage" + , annotation = + Just + (Type.function + [ Type.namedWith [ "Date" ] "Language" [] + , Type.string + , Type.namedWith [ "Date" ] "Date" [] + ] + Type.string + ) + } + ) + [ formatWithLanguageArg_ + , Elm.string formatWithLanguageArg_0 + , formatWithLanguageArg_1 + ] + + +{-| Get a past or future date by adding a number of units to a date. + + import Date exposing (Unit(..), add, fromCalendarDate) + import Time exposing (Month(..)) + + add Weeks -2 (fromCalendarDate 2018 Sep 26) + == fromCalendarDate 2018 Sep 12 + +When adding `Years` or `Months`, day values are clamped to the end of the +month if necessary. + + add Months 1 (fromCalendarDate 2000 Jan 31) + == fromCalendarDate 2000 Feb 29 + +add: Date.Unit -> Int -> Date.Date -> Date.Date +-} +add : Elm.Expression -> Int -> Elm.Expression -> Elm.Expression +add addArg_ addArg_0 addArg_1 = + Elm.apply + (Elm.value + { importFrom = [ "Date" ] + , name = "add" + , annotation = + Just + (Type.function + [ Type.namedWith [ "Date" ] "Unit" [] + , Type.int + , Type.namedWith [ "Date" ] "Date" [] + ] + (Type.namedWith [ "Date" ] "Date" []) + ) + } + ) + [ addArg_, Elm.int addArg_0, addArg_1 ] + + +{-| Get the difference, as a number of whole units, between two dates. + + import Date exposing (Unit(..), diff, fromCalendarDate) + import Time exposing (Month(..)) + + diff Months + (fromCalendarDate 2020 Jan 2) + (fromCalendarDate 2020 Apr 1) + == 2 + +diff: Date.Unit -> Date.Date -> Date.Date -> Int +-} +diff : Elm.Expression -> Elm.Expression -> Elm.Expression -> Elm.Expression +diff diffArg_ diffArg_0 diffArg_1 = + Elm.apply + (Elm.value + { importFrom = [ "Date" ] + , name = "diff" + , annotation = + Just + (Type.function + [ Type.namedWith [ "Date" ] "Unit" [] + , Type.namedWith [ "Date" ] "Date" [] + , Type.namedWith [ "Date" ] "Date" [] + ] + Type.int + ) + } + ) + [ diffArg_, diffArg_0, diffArg_1 ] + + +{-| Round up a date to the beginning of the closest interval. The resulting +date will be greater than or equal to the one provided. + + import Date exposing (Interval(..), ceiling, fromCalendarDate) + import Time exposing (Month(..)) + + ceiling Tuesday (fromCalendarDate 2018 May 11) + == fromCalendarDate 2018 May 15 + +ceiling: Date.Interval -> Date.Date -> Date.Date +-} +ceiling : Elm.Expression -> Elm.Expression -> Elm.Expression +ceiling ceilingArg_ ceilingArg_0 = + Elm.apply + (Elm.value + { importFrom = [ "Date" ] + , name = "ceiling" + , annotation = + Just + (Type.function + [ Type.namedWith [ "Date" ] "Interval" [] + , Type.namedWith [ "Date" ] "Date" [] + ] + (Type.namedWith [ "Date" ] "Date" []) + ) + } + ) + [ ceilingArg_, ceilingArg_0 ] + + +{-| Round down a date to the beginning of the closest interval. The resulting +date will be less than or equal to the one provided. + + import Date exposing (Interval(..), floor, fromCalendarDate) + import Time exposing (Month(..)) + + floor Tuesday (fromCalendarDate 2018 May 11) + == fromCalendarDate 2018 May 8 + +floor: Date.Interval -> Date.Date -> Date.Date +-} +floor : Elm.Expression -> Elm.Expression -> Elm.Expression +floor floorArg_ floorArg_0 = + Elm.apply + (Elm.value + { importFrom = [ "Date" ] + , name = "floor" + , annotation = + Just + (Type.function + [ Type.namedWith [ "Date" ] "Interval" [] + , Type.namedWith [ "Date" ] "Date" [] + ] + (Type.namedWith [ "Date" ] "Date" []) + ) + } + ) + [ floorArg_, floorArg_0 ] + + +{-| Create a list of dates, at rounded intervals, increasing by a step value, +between two dates. The list will start on or after the first date, and end +before the second date. + + import Date exposing (Interval(..), range, fromCalendarDate) + import Time exposing (Month(..)) + + start = fromCalendarDate 2018 May 8 + until = fromCalendarDate 2018 May 14 + + range Day 2 start until + == [ fromCalendarDate 2018 May 8 + , fromCalendarDate 2018 May 10 + , fromCalendarDate 2018 May 12 + ] + +range: Date.Interval -> Int -> Date.Date -> Date.Date -> List Date.Date +-} +range : + Elm.Expression -> Int -> Elm.Expression -> Elm.Expression -> Elm.Expression +range rangeArg_ rangeArg_0 rangeArg_1 rangeArg_2 = + Elm.apply + (Elm.value + { importFrom = [ "Date" ] + , name = "range" + , annotation = + Just + (Type.function + [ Type.namedWith [ "Date" ] "Interval" [] + , Type.int + , Type.namedWith [ "Date" ] "Date" [] + , Type.namedWith [ "Date" ] "Date" [] + ] + (Type.list (Type.namedWith [ "Date" ] "Date" [])) + ) + } + ) + [ rangeArg_, Elm.int rangeArg_0, rangeArg_1, rangeArg_2 ] + + +{-| Compare two dates. This can be used as the compare function for +`List.sortWith`. + + import Date exposing (fromOrdinalDate, compare) + + compare (fromOrdinalDate 1970 1) (fromOrdinalDate 2038 1) + == LT + +compare: Date.Date -> Date.Date -> Basics.Order +-} +compare : Elm.Expression -> Elm.Expression -> Elm.Expression +compare compareArg_ compareArg_0 = + Elm.apply + (Elm.value + { importFrom = [ "Date" ] + , name = "compare" + , annotation = + Just + (Type.function + [ Type.namedWith [ "Date" ] "Date" [] + , Type.namedWith [ "Date" ] "Date" [] + ] + (Type.namedWith [ "Basics" ] "Order" []) + ) + } + ) + [ compareArg_, compareArg_0 ] + + +{-| Test if a date is within a range, inclusive of the range values. + + import Date exposing (fromOrdinalDate, isBetween) + + minimum = fromOrdinalDate 1970 1 + maximum = fromOrdinalDate 2038 1 + + isBetween minimum maximum (fromOrdinalDate 1969 201) + == False + +isBetween: Date.Date -> Date.Date -> Date.Date -> Bool +-} +isBetween : Elm.Expression -> Elm.Expression -> Elm.Expression -> Elm.Expression +isBetween isBetweenArg_ isBetweenArg_0 isBetweenArg_1 = + Elm.apply + (Elm.value + { importFrom = [ "Date" ] + , name = "isBetween" + , annotation = + Just + (Type.function + [ Type.namedWith [ "Date" ] "Date" [] + , Type.namedWith [ "Date" ] "Date" [] + , Type.namedWith [ "Date" ] "Date" [] + ] + Type.bool + ) + } + ) + [ isBetweenArg_, isBetweenArg_0, isBetweenArg_1 ] + + +{-| Find the lesser of two dates. + + import Date exposing (fromOrdinalDate, min) + + min (fromOrdinalDate 1970 1) (fromOrdinalDate 2038 1) + == (fromOrdinalDate 1970 1) + +min: Date.Date -> Date.Date -> Date.Date +-} +min : Elm.Expression -> Elm.Expression -> Elm.Expression +min minArg_ minArg_0 = + Elm.apply + (Elm.value + { importFrom = [ "Date" ] + , name = "min" + , annotation = + Just + (Type.function + [ Type.namedWith [ "Date" ] "Date" [] + , Type.namedWith [ "Date" ] "Date" [] + ] + (Type.namedWith [ "Date" ] "Date" []) + ) + } + ) + [ minArg_, minArg_0 ] + + +{-| Find the greater of two dates. + + import Date exposing (fromOrdinalDate, max) + + max (fromOrdinalDate 1970 1) (fromOrdinalDate 2038 1) + == (fromOrdinalDate 2038 1) + +max: Date.Date -> Date.Date -> Date.Date +-} +max : Elm.Expression -> Elm.Expression -> Elm.Expression +max maxArg_ maxArg_0 = + Elm.apply + (Elm.value + { importFrom = [ "Date" ] + , name = "max" + , annotation = + Just + (Type.function + [ Type.namedWith [ "Date" ] "Date" [] + , Type.namedWith [ "Date" ] "Date" [] + ] + (Type.namedWith [ "Date" ] "Date" []) + ) + } + ) + [ maxArg_, maxArg_0 ] + + +{-| Clamp a date within a range. + + import Date exposing (fromOrdinalDate, clamp) + + minimum = fromOrdinalDate 1970 1 + maximum = fromOrdinalDate 2038 1 + + clamp minimum maximum (fromOrdinalDate 1969 201) + == fromOrdinalDate 1970 1 + +clamp: Date.Date -> Date.Date -> Date.Date -> Date.Date +-} +clamp : Elm.Expression -> Elm.Expression -> Elm.Expression -> Elm.Expression +clamp clampArg_ clampArg_0 clampArg_1 = + Elm.apply + (Elm.value + { importFrom = [ "Date" ] + , name = "clamp" + , annotation = + Just + (Type.function + [ Type.namedWith [ "Date" ] "Date" [] + , Type.namedWith [ "Date" ] "Date" [] + , Type.namedWith [ "Date" ] "Date" [] + ] + (Type.namedWith [ "Date" ] "Date" []) + ) + } + ) + [ clampArg_, clampArg_0, clampArg_1 ] + + +{-| Maps `Jan`–`Dec` to 1–12. + +monthToNumber: Date.Month -> Int +-} +monthToNumber : Elm.Expression -> Elm.Expression +monthToNumber monthToNumberArg_ = + Elm.apply + (Elm.value + { importFrom = [ "Date" ] + , name = "monthToNumber" + , annotation = + Just + (Type.function + [ Type.namedWith [ "Date" ] "Month" [] ] + Type.int + ) + } + ) + [ monthToNumberArg_ ] + + +{-| Maps 1–12 to `Jan`–`Dec`. + +numberToMonth: Int -> Date.Month +-} +numberToMonth : Int -> Elm.Expression +numberToMonth numberToMonthArg_ = + Elm.apply + (Elm.value + { importFrom = [ "Date" ] + , name = "numberToMonth" + , annotation = + Just + (Type.function + [ Type.int ] + (Type.namedWith [ "Date" ] "Month" []) + ) + } + ) + [ Elm.int numberToMonthArg_ ] + + +{-| Maps `Mon`–`Sun` to 1-7. + +weekdayToNumber: Date.Weekday -> Int +-} +weekdayToNumber : Elm.Expression -> Elm.Expression +weekdayToNumber weekdayToNumberArg_ = + Elm.apply + (Elm.value + { importFrom = [ "Date" ] + , name = "weekdayToNumber" + , annotation = + Just + (Type.function + [ Type.namedWith [ "Date" ] "Weekday" [] ] + Type.int + ) + } + ) + [ weekdayToNumberArg_ ] + + +{-| Maps 1-7 to `Mon`–`Sun`. + +numberToWeekday: Int -> Date.Weekday +-} +numberToWeekday : Int -> Elm.Expression +numberToWeekday numberToWeekdayArg_ = + Elm.apply + (Elm.value + { importFrom = [ "Date" ] + , name = "numberToWeekday" + , annotation = + Just + (Type.function + [ Type.int ] + (Type.namedWith [ "Date" ] "Weekday" []) + ) + } + ) + [ Elm.int numberToWeekdayArg_ ] + + +annotation_ : + { date : Type.Annotation + , month : Type.Annotation + , weekday : Type.Annotation + , language : Type.Annotation + , unit : Type.Annotation + , interval : Type.Annotation + } +annotation_ = + { date = Type.namedWith [ "Date" ] "Date" [] + , month = + Type.alias moduleName_ "Month" [] (Type.namedWith [ "Time" ] "Month" []) + , weekday = + Type.alias + moduleName_ + "Weekday" + [] + (Type.namedWith [ "Time" ] "Weekday" []) + , language = + Type.alias + moduleName_ + "Language" + [] + (Type.record + [ ( "monthName" + , Type.function + [ Type.namedWith [ "Date" ] "Month" [] ] + Type.string + ) + , ( "monthNameShort" + , Type.function + [ Type.namedWith [ "Date" ] "Month" [] ] + Type.string + ) + , ( "weekdayName" + , Type.function + [ Type.namedWith [ "Date" ] "Weekday" [] ] + Type.string + ) + , ( "weekdayNameShort" + , Type.function + [ Type.namedWith [ "Date" ] "Weekday" [] ] + Type.string + ) + , ( "dayWithSuffix", Type.function [ Type.int ] Type.string ) + ] + ) + , unit = Type.namedWith [ "Date" ] "Unit" [] + , interval = Type.namedWith [ "Date" ] "Interval" [] + } + + +make_ : + { language : + { monthName : Elm.Expression + , monthNameShort : Elm.Expression + , weekdayName : Elm.Expression + , weekdayNameShort : Elm.Expression + , dayWithSuffix : Elm.Expression + } + -> Elm.Expression + , years : Elm.Expression + , months : Elm.Expression + , weeks : Elm.Expression + , days : Elm.Expression + , year : Elm.Expression + , quarter : Elm.Expression + , month : Elm.Expression + , week : Elm.Expression + , monday : Elm.Expression + , tuesday : Elm.Expression + , wednesday : Elm.Expression + , thursday : Elm.Expression + , friday : Elm.Expression + , saturday : Elm.Expression + , sunday : Elm.Expression + , day : Elm.Expression + } +make_ = + { language = + \language_args -> + Elm.withType + (Type.alias + [ "Date" ] + "Language" + [] + (Type.record + [ ( "monthName" + , Type.function + [ Type.namedWith [ "Date" ] "Month" [] ] + Type.string + ) + , ( "monthNameShort" + , Type.function + [ Type.namedWith [ "Date" ] "Month" [] ] + Type.string + ) + , ( "weekdayName" + , Type.function + [ Type.namedWith [ "Date" ] "Weekday" [] ] + Type.string + ) + , ( "weekdayNameShort" + , Type.function + [ Type.namedWith [ "Date" ] "Weekday" [] ] + Type.string + ) + , ( "dayWithSuffix" + , Type.function [ Type.int ] Type.string + ) + ] + ) + ) + (Elm.record + [ Tuple.pair "monthName" language_args.monthName + , Tuple.pair "monthNameShort" language_args.monthNameShort + , Tuple.pair "weekdayName" language_args.weekdayName + , Tuple.pair + "weekdayNameShort" + language_args.weekdayNameShort + , Tuple.pair "dayWithSuffix" language_args.dayWithSuffix + ] + ) + , years = + Elm.value + { importFrom = [ "Date" ] + , name = "Years" + , annotation = Just (Type.namedWith [] "Unit" []) + } + , months = + Elm.value + { importFrom = [ "Date" ] + , name = "Months" + , annotation = Just (Type.namedWith [] "Unit" []) + } + , weeks = + Elm.value + { importFrom = [ "Date" ] + , name = "Weeks" + , annotation = Just (Type.namedWith [] "Unit" []) + } + , days = + Elm.value + { importFrom = [ "Date" ] + , name = "Days" + , annotation = Just (Type.namedWith [] "Unit" []) + } + , year = + Elm.value + { importFrom = [ "Date" ] + , name = "Year" + , annotation = Just (Type.namedWith [] "Interval" []) + } + , quarter = + Elm.value + { importFrom = [ "Date" ] + , name = "Quarter" + , annotation = Just (Type.namedWith [] "Interval" []) + } + , month = + Elm.value + { importFrom = [ "Date" ] + , name = "Month" + , annotation = Just (Type.namedWith [] "Interval" []) + } + , week = + Elm.value + { importFrom = [ "Date" ] + , name = "Week" + , annotation = Just (Type.namedWith [] "Interval" []) + } + , monday = + Elm.value + { importFrom = [ "Date" ] + , name = "Monday" + , annotation = Just (Type.namedWith [] "Interval" []) + } + , tuesday = + Elm.value + { importFrom = [ "Date" ] + , name = "Tuesday" + , annotation = Just (Type.namedWith [] "Interval" []) + } + , wednesday = + Elm.value + { importFrom = [ "Date" ] + , name = "Wednesday" + , annotation = Just (Type.namedWith [] "Interval" []) + } + , thursday = + Elm.value + { importFrom = [ "Date" ] + , name = "Thursday" + , annotation = Just (Type.namedWith [] "Interval" []) + } + , friday = + Elm.value + { importFrom = [ "Date" ] + , name = "Friday" + , annotation = Just (Type.namedWith [] "Interval" []) + } + , saturday = + Elm.value + { importFrom = [ "Date" ] + , name = "Saturday" + , annotation = Just (Type.namedWith [] "Interval" []) + } + , sunday = + Elm.value + { importFrom = [ "Date" ] + , name = "Sunday" + , annotation = Just (Type.namedWith [] "Interval" []) + } + , day = + Elm.value + { importFrom = [ "Date" ] + , name = "Day" + , annotation = Just (Type.namedWith [] "Interval" []) + } + } + + +caseOf_ : + { unit : + Elm.Expression + -> { years : Elm.Expression + , months : Elm.Expression + , weeks : Elm.Expression + , days : Elm.Expression + } + -> Elm.Expression + , interval : + Elm.Expression + -> { year : Elm.Expression + , quarter : Elm.Expression + , month : Elm.Expression + , week : Elm.Expression + , monday : Elm.Expression + , tuesday : Elm.Expression + , wednesday : Elm.Expression + , thursday : Elm.Expression + , friday : Elm.Expression + , saturday : Elm.Expression + , sunday : Elm.Expression + , day : Elm.Expression + } + -> Elm.Expression + } +caseOf_ = + { unit = + \unitExpression unitTags -> + Elm.Case.custom + unitExpression + (Type.namedWith [ "Date" ] "Unit" []) + [ Elm.Case.branch + (Elm.Arg.customType "Years" unitTags.years) + Basics.identity + , Elm.Case.branch + (Elm.Arg.customType "Months" unitTags.months) + Basics.identity + , Elm.Case.branch + (Elm.Arg.customType "Weeks" unitTags.weeks) + Basics.identity + , Elm.Case.branch + (Elm.Arg.customType "Days" unitTags.days) + Basics.identity + ] + , interval = + \intervalExpression intervalTags -> + Elm.Case.custom + intervalExpression + (Type.namedWith [ "Date" ] "Interval" []) + [ Elm.Case.branch + (Elm.Arg.customType "Year" intervalTags.year) + Basics.identity + , Elm.Case.branch + (Elm.Arg.customType "Quarter" intervalTags.quarter) + Basics.identity + , Elm.Case.branch + (Elm.Arg.customType "Month" intervalTags.month) + Basics.identity + , Elm.Case.branch + (Elm.Arg.customType "Week" intervalTags.week) + Basics.identity + , Elm.Case.branch + (Elm.Arg.customType "Monday" intervalTags.monday) + Basics.identity + , Elm.Case.branch + (Elm.Arg.customType "Tuesday" intervalTags.tuesday) + Basics.identity + , Elm.Case.branch + (Elm.Arg.customType "Wednesday" intervalTags.wednesday) + Basics.identity + , Elm.Case.branch + (Elm.Arg.customType "Thursday" intervalTags.thursday) + Basics.identity + , Elm.Case.branch + (Elm.Arg.customType "Friday" intervalTags.friday) + Basics.identity + , Elm.Case.branch + (Elm.Arg.customType "Saturday" intervalTags.saturday) + Basics.identity + , Elm.Case.branch + (Elm.Arg.customType "Sunday" intervalTags.sunday) + Basics.identity + , Elm.Case.branch + (Elm.Arg.customType "Day" intervalTags.day) + Basics.identity + ] + } + + +call_ : + { fromPosix : Elm.Expression -> Elm.Expression -> Elm.Expression + , fromCalendarDate : + Elm.Expression -> Elm.Expression -> Elm.Expression -> Elm.Expression + , fromWeekDate : + Elm.Expression -> Elm.Expression -> Elm.Expression -> Elm.Expression + , fromOrdinalDate : Elm.Expression -> Elm.Expression -> Elm.Expression + , fromIsoString : Elm.Expression -> Elm.Expression + , fromRataDie : Elm.Expression -> Elm.Expression + , toIsoString : Elm.Expression -> Elm.Expression + , toRataDie : Elm.Expression -> Elm.Expression + , year : Elm.Expression -> Elm.Expression + , month : Elm.Expression -> Elm.Expression + , day : Elm.Expression -> Elm.Expression + , weekYear : Elm.Expression -> Elm.Expression + , weekNumber : Elm.Expression -> Elm.Expression + , weekday : Elm.Expression -> Elm.Expression + , ordinalDay : Elm.Expression -> Elm.Expression + , quarter : Elm.Expression -> Elm.Expression + , monthNumber : Elm.Expression -> Elm.Expression + , weekdayNumber : Elm.Expression -> Elm.Expression + , format : Elm.Expression -> Elm.Expression -> Elm.Expression + , withOrdinalSuffix : Elm.Expression -> Elm.Expression + , formatWithLanguage : + Elm.Expression -> Elm.Expression -> Elm.Expression -> Elm.Expression + , add : Elm.Expression -> Elm.Expression -> Elm.Expression -> Elm.Expression + , diff : + Elm.Expression -> Elm.Expression -> Elm.Expression -> Elm.Expression + , ceiling : Elm.Expression -> Elm.Expression -> Elm.Expression + , floor : Elm.Expression -> Elm.Expression -> Elm.Expression + , range : + Elm.Expression + -> Elm.Expression + -> Elm.Expression + -> Elm.Expression + -> Elm.Expression + , compare : Elm.Expression -> Elm.Expression -> Elm.Expression + , isBetween : + Elm.Expression -> Elm.Expression -> Elm.Expression -> Elm.Expression + , min : Elm.Expression -> Elm.Expression -> Elm.Expression + , max : Elm.Expression -> Elm.Expression -> Elm.Expression + , clamp : + Elm.Expression -> Elm.Expression -> Elm.Expression -> Elm.Expression + , monthToNumber : Elm.Expression -> Elm.Expression + , numberToMonth : Elm.Expression -> Elm.Expression + , weekdayToNumber : Elm.Expression -> Elm.Expression + , numberToWeekday : Elm.Expression -> Elm.Expression + } +call_ = + { fromPosix = + \fromPosixArg_ fromPosixArg_0 -> + Elm.apply + (Elm.value + { importFrom = [ "Date" ] + , name = "fromPosix" + , annotation = + Just + (Type.function + [ Type.namedWith [ "Time" ] "Zone" [] + , Type.namedWith [ "Time" ] "Posix" [] + ] + (Type.namedWith [ "Date" ] "Date" []) + ) + } + ) + [ fromPosixArg_, fromPosixArg_0 ] + , fromCalendarDate = + \fromCalendarDateArg_ fromCalendarDateArg_0 fromCalendarDateArg_1 -> + Elm.apply + (Elm.value + { importFrom = [ "Date" ] + , name = "fromCalendarDate" + , annotation = + Just + (Type.function + [ Type.int + , Type.namedWith [ "Date" ] "Month" [] + , Type.int + ] + (Type.namedWith [ "Date" ] "Date" []) + ) + } + ) + [ fromCalendarDateArg_ + , fromCalendarDateArg_0 + , fromCalendarDateArg_1 + ] + , fromWeekDate = + \fromWeekDateArg_ fromWeekDateArg_0 fromWeekDateArg_1 -> + Elm.apply + (Elm.value + { importFrom = [ "Date" ] + , name = "fromWeekDate" + , annotation = + Just + (Type.function + [ Type.int + , Type.int + , Type.namedWith [ "Date" ] "Weekday" [] + ] + (Type.namedWith [ "Date" ] "Date" []) + ) + } + ) + [ fromWeekDateArg_, fromWeekDateArg_0, fromWeekDateArg_1 ] + , fromOrdinalDate = + \fromOrdinalDateArg_ fromOrdinalDateArg_0 -> + Elm.apply + (Elm.value + { importFrom = [ "Date" ] + , name = "fromOrdinalDate" + , annotation = + Just + (Type.function + [ Type.int, Type.int ] + (Type.namedWith [ "Date" ] "Date" []) + ) + } + ) + [ fromOrdinalDateArg_, fromOrdinalDateArg_0 ] + , fromIsoString = + \fromIsoStringArg_ -> + Elm.apply + (Elm.value + { importFrom = [ "Date" ] + , name = "fromIsoString" + , annotation = + Just + (Type.function + [ Type.string ] + (Type.namedWith + [ "Result" ] + "Result" + [ Type.string + , Type.namedWith [ "Date" ] "Date" [] + ] + ) + ) + } + ) + [ fromIsoStringArg_ ] + , fromRataDie = + \fromRataDieArg_ -> + Elm.apply + (Elm.value + { importFrom = [ "Date" ] + , name = "fromRataDie" + , annotation = + Just + (Type.function + [ Type.int ] + (Type.namedWith [ "Date" ] "Date" []) + ) + } + ) + [ fromRataDieArg_ ] + , toIsoString = + \toIsoStringArg_ -> + Elm.apply + (Elm.value + { importFrom = [ "Date" ] + , name = "toIsoString" + , annotation = + Just + (Type.function + [ Type.namedWith [ "Date" ] "Date" [] ] + Type.string + ) + } + ) + [ toIsoStringArg_ ] + , toRataDie = + \toRataDieArg_ -> + Elm.apply + (Elm.value + { importFrom = [ "Date" ] + , name = "toRataDie" + , annotation = + Just + (Type.function + [ Type.namedWith [ "Date" ] "Date" [] ] + Type.int + ) + } + ) + [ toRataDieArg_ ] + , year = + \yearArg_ -> + Elm.apply + (Elm.value + { importFrom = [ "Date" ] + , name = "year" + , annotation = + Just + (Type.function + [ Type.namedWith [ "Date" ] "Date" [] ] + Type.int + ) + } + ) + [ yearArg_ ] + , month = + \monthArg_ -> + Elm.apply + (Elm.value + { importFrom = [ "Date" ] + , name = "month" + , annotation = + Just + (Type.function + [ Type.namedWith [ "Date" ] "Date" [] ] + (Type.namedWith [ "Date" ] "Month" []) + ) + } + ) + [ monthArg_ ] + , day = + \dayArg_ -> + Elm.apply + (Elm.value + { importFrom = [ "Date" ] + , name = "day" + , annotation = + Just + (Type.function + [ Type.namedWith [ "Date" ] "Date" [] ] + Type.int + ) + } + ) + [ dayArg_ ] + , weekYear = + \weekYearArg_ -> + Elm.apply + (Elm.value + { importFrom = [ "Date" ] + , name = "weekYear" + , annotation = + Just + (Type.function + [ Type.namedWith [ "Date" ] "Date" [] ] + Type.int + ) + } + ) + [ weekYearArg_ ] + , weekNumber = + \weekNumberArg_ -> + Elm.apply + (Elm.value + { importFrom = [ "Date" ] + , name = "weekNumber" + , annotation = + Just + (Type.function + [ Type.namedWith [ "Date" ] "Date" [] ] + Type.int + ) + } + ) + [ weekNumberArg_ ] + , weekday = + \weekdayArg_ -> + Elm.apply + (Elm.value + { importFrom = [ "Date" ] + , name = "weekday" + , annotation = + Just + (Type.function + [ Type.namedWith [ "Date" ] "Date" [] ] + (Type.namedWith [ "Date" ] "Weekday" []) + ) + } + ) + [ weekdayArg_ ] + , ordinalDay = + \ordinalDayArg_ -> + Elm.apply + (Elm.value + { importFrom = [ "Date" ] + , name = "ordinalDay" + , annotation = + Just + (Type.function + [ Type.namedWith [ "Date" ] "Date" [] ] + Type.int + ) + } + ) + [ ordinalDayArg_ ] + , quarter = + \quarterArg_ -> + Elm.apply + (Elm.value + { importFrom = [ "Date" ] + , name = "quarter" + , annotation = + Just + (Type.function + [ Type.namedWith [ "Date" ] "Date" [] ] + Type.int + ) + } + ) + [ quarterArg_ ] + , monthNumber = + \monthNumberArg_ -> + Elm.apply + (Elm.value + { importFrom = [ "Date" ] + , name = "monthNumber" + , annotation = + Just + (Type.function + [ Type.namedWith [ "Date" ] "Date" [] ] + Type.int + ) + } + ) + [ monthNumberArg_ ] + , weekdayNumber = + \weekdayNumberArg_ -> + Elm.apply + (Elm.value + { importFrom = [ "Date" ] + , name = "weekdayNumber" + , annotation = + Just + (Type.function + [ Type.namedWith [ "Date" ] "Date" [] ] + Type.int + ) + } + ) + [ weekdayNumberArg_ ] + , format = + \formatArg_ formatArg_0 -> + Elm.apply + (Elm.value + { importFrom = [ "Date" ] + , name = "format" + , annotation = + Just + (Type.function + [ Type.string + , Type.namedWith [ "Date" ] "Date" [] + ] + Type.string + ) + } + ) + [ formatArg_, formatArg_0 ] + , withOrdinalSuffix = + \withOrdinalSuffixArg_ -> + Elm.apply + (Elm.value + { importFrom = [ "Date" ] + , name = "withOrdinalSuffix" + , annotation = + Just (Type.function [ Type.int ] Type.string) + } + ) + [ withOrdinalSuffixArg_ ] + , formatWithLanguage = + \formatWithLanguageArg_ formatWithLanguageArg_0 formatWithLanguageArg_1 -> + Elm.apply + (Elm.value + { importFrom = [ "Date" ] + , name = "formatWithLanguage" + , annotation = + Just + (Type.function + [ Type.namedWith [ "Date" ] "Language" [] + , Type.string + , Type.namedWith [ "Date" ] "Date" [] + ] + Type.string + ) + } + ) + [ formatWithLanguageArg_ + , formatWithLanguageArg_0 + , formatWithLanguageArg_1 + ] + , add = + \addArg_ addArg_0 addArg_1 -> + Elm.apply + (Elm.value + { importFrom = [ "Date" ] + , name = "add" + , annotation = + Just + (Type.function + [ Type.namedWith [ "Date" ] "Unit" [] + , Type.int + , Type.namedWith [ "Date" ] "Date" [] + ] + (Type.namedWith [ "Date" ] "Date" []) + ) + } + ) + [ addArg_, addArg_0, addArg_1 ] + , diff = + \diffArg_ diffArg_0 diffArg_1 -> + Elm.apply + (Elm.value + { importFrom = [ "Date" ] + , name = "diff" + , annotation = + Just + (Type.function + [ Type.namedWith [ "Date" ] "Unit" [] + , Type.namedWith [ "Date" ] "Date" [] + , Type.namedWith [ "Date" ] "Date" [] + ] + Type.int + ) + } + ) + [ diffArg_, diffArg_0, diffArg_1 ] + , ceiling = + \ceilingArg_ ceilingArg_0 -> + Elm.apply + (Elm.value + { importFrom = [ "Date" ] + , name = "ceiling" + , annotation = + Just + (Type.function + [ Type.namedWith [ "Date" ] "Interval" [] + , Type.namedWith [ "Date" ] "Date" [] + ] + (Type.namedWith [ "Date" ] "Date" []) + ) + } + ) + [ ceilingArg_, ceilingArg_0 ] + , floor = + \floorArg_ floorArg_0 -> + Elm.apply + (Elm.value + { importFrom = [ "Date" ] + , name = "floor" + , annotation = + Just + (Type.function + [ Type.namedWith [ "Date" ] "Interval" [] + , Type.namedWith [ "Date" ] "Date" [] + ] + (Type.namedWith [ "Date" ] "Date" []) + ) + } + ) + [ floorArg_, floorArg_0 ] + , range = + \rangeArg_ rangeArg_0 rangeArg_1 rangeArg_2 -> + Elm.apply + (Elm.value + { importFrom = [ "Date" ] + , name = "range" + , annotation = + Just + (Type.function + [ Type.namedWith [ "Date" ] "Interval" [] + , Type.int + , Type.namedWith [ "Date" ] "Date" [] + , Type.namedWith [ "Date" ] "Date" [] + ] + (Type.list + (Type.namedWith [ "Date" ] "Date" []) + ) + ) + } + ) + [ rangeArg_, rangeArg_0, rangeArg_1, rangeArg_2 ] + , compare = + \compareArg_ compareArg_0 -> + Elm.apply + (Elm.value + { importFrom = [ "Date" ] + , name = "compare" + , annotation = + Just + (Type.function + [ Type.namedWith [ "Date" ] "Date" [] + , Type.namedWith [ "Date" ] "Date" [] + ] + (Type.namedWith [ "Basics" ] "Order" []) + ) + } + ) + [ compareArg_, compareArg_0 ] + , isBetween = + \isBetweenArg_ isBetweenArg_0 isBetweenArg_1 -> + Elm.apply + (Elm.value + { importFrom = [ "Date" ] + , name = "isBetween" + , annotation = + Just + (Type.function + [ Type.namedWith [ "Date" ] "Date" [] + , Type.namedWith [ "Date" ] "Date" [] + , Type.namedWith [ "Date" ] "Date" [] + ] + Type.bool + ) + } + ) + [ isBetweenArg_, isBetweenArg_0, isBetweenArg_1 ] + , min = + \minArg_ minArg_0 -> + Elm.apply + (Elm.value + { importFrom = [ "Date" ] + , name = "min" + , annotation = + Just + (Type.function + [ Type.namedWith [ "Date" ] "Date" [] + , Type.namedWith [ "Date" ] "Date" [] + ] + (Type.namedWith [ "Date" ] "Date" []) + ) + } + ) + [ minArg_, minArg_0 ] + , max = + \maxArg_ maxArg_0 -> + Elm.apply + (Elm.value + { importFrom = [ "Date" ] + , name = "max" + , annotation = + Just + (Type.function + [ Type.namedWith [ "Date" ] "Date" [] + , Type.namedWith [ "Date" ] "Date" [] + ] + (Type.namedWith [ "Date" ] "Date" []) + ) + } + ) + [ maxArg_, maxArg_0 ] + , clamp = + \clampArg_ clampArg_0 clampArg_1 -> + Elm.apply + (Elm.value + { importFrom = [ "Date" ] + , name = "clamp" + , annotation = + Just + (Type.function + [ Type.namedWith [ "Date" ] "Date" [] + , Type.namedWith [ "Date" ] "Date" [] + , Type.namedWith [ "Date" ] "Date" [] + ] + (Type.namedWith [ "Date" ] "Date" []) + ) + } + ) + [ clampArg_, clampArg_0, clampArg_1 ] + , monthToNumber = + \monthToNumberArg_ -> + Elm.apply + (Elm.value + { importFrom = [ "Date" ] + , name = "monthToNumber" + , annotation = + Just + (Type.function + [ Type.namedWith [ "Date" ] "Month" [] ] + Type.int + ) + } + ) + [ monthToNumberArg_ ] + , numberToMonth = + \numberToMonthArg_ -> + Elm.apply + (Elm.value + { importFrom = [ "Date" ] + , name = "numberToMonth" + , annotation = + Just + (Type.function + [ Type.int ] + (Type.namedWith [ "Date" ] "Month" []) + ) + } + ) + [ numberToMonthArg_ ] + , weekdayToNumber = + \weekdayToNumberArg_ -> + Elm.apply + (Elm.value + { importFrom = [ "Date" ] + , name = "weekdayToNumber" + , annotation = + Just + (Type.function + [ Type.namedWith [ "Date" ] "Weekday" [] ] + Type.int + ) + } + ) + [ weekdayToNumberArg_ ] + , numberToWeekday = + \numberToWeekdayArg_ -> + Elm.apply + (Elm.value + { importFrom = [ "Date" ] + , name = "numberToWeekday" + , annotation = + Just + (Type.function + [ Type.int ] + (Type.namedWith [ "Date" ] "Weekday" []) + ) + } + ) + [ numberToWeekdayArg_ ] + } + + +values_ : + { today : Elm.Expression + , fromPosix : Elm.Expression + , fromCalendarDate : Elm.Expression + , fromWeekDate : Elm.Expression + , fromOrdinalDate : Elm.Expression + , fromIsoString : Elm.Expression + , fromRataDie : Elm.Expression + , toIsoString : Elm.Expression + , toRataDie : Elm.Expression + , year : Elm.Expression + , month : Elm.Expression + , day : Elm.Expression + , weekYear : Elm.Expression + , weekNumber : Elm.Expression + , weekday : Elm.Expression + , ordinalDay : Elm.Expression + , quarter : Elm.Expression + , monthNumber : Elm.Expression + , weekdayNumber : Elm.Expression + , format : Elm.Expression + , withOrdinalSuffix : Elm.Expression + , formatWithLanguage : Elm.Expression + , add : Elm.Expression + , diff : Elm.Expression + , ceiling : Elm.Expression + , floor : Elm.Expression + , range : Elm.Expression + , compare : Elm.Expression + , isBetween : Elm.Expression + , min : Elm.Expression + , max : Elm.Expression + , clamp : Elm.Expression + , monthToNumber : Elm.Expression + , numberToMonth : Elm.Expression + , weekdayToNumber : Elm.Expression + , numberToWeekday : Elm.Expression + } +values_ = + { today = + Elm.value + { importFrom = [ "Date" ] + , name = "today" + , annotation = + Just + (Type.namedWith + [ "Task" ] + "Task" + [ Type.var "x", Type.namedWith [ "Date" ] "Date" [] ] + ) + } + , fromPosix = + Elm.value + { importFrom = [ "Date" ] + , name = "fromPosix" + , annotation = + Just + (Type.function + [ Type.namedWith [ "Time" ] "Zone" [] + , Type.namedWith [ "Time" ] "Posix" [] + ] + (Type.namedWith [ "Date" ] "Date" []) + ) + } + , fromCalendarDate = + Elm.value + { importFrom = [ "Date" ] + , name = "fromCalendarDate" + , annotation = + Just + (Type.function + [ Type.int + , Type.namedWith [ "Date" ] "Month" [] + , Type.int + ] + (Type.namedWith [ "Date" ] "Date" []) + ) + } + , fromWeekDate = + Elm.value + { importFrom = [ "Date" ] + , name = "fromWeekDate" + , annotation = + Just + (Type.function + [ Type.int + , Type.int + , Type.namedWith [ "Date" ] "Weekday" [] + ] + (Type.namedWith [ "Date" ] "Date" []) + ) + } + , fromOrdinalDate = + Elm.value + { importFrom = [ "Date" ] + , name = "fromOrdinalDate" + , annotation = + Just + (Type.function + [ Type.int, Type.int ] + (Type.namedWith [ "Date" ] "Date" []) + ) + } + , fromIsoString = + Elm.value + { importFrom = [ "Date" ] + , name = "fromIsoString" + , annotation = + Just + (Type.function + [ Type.string ] + (Type.namedWith + [ "Result" ] + "Result" + [ Type.string + , Type.namedWith [ "Date" ] "Date" [] + ] + ) + ) + } + , fromRataDie = + Elm.value + { importFrom = [ "Date" ] + , name = "fromRataDie" + , annotation = + Just + (Type.function + [ Type.int ] + (Type.namedWith [ "Date" ] "Date" []) + ) + } + , toIsoString = + Elm.value + { importFrom = [ "Date" ] + , name = "toIsoString" + , annotation = + Just + (Type.function + [ Type.namedWith [ "Date" ] "Date" [] ] + Type.string + ) + } + , toRataDie = + Elm.value + { importFrom = [ "Date" ] + , name = "toRataDie" + , annotation = + Just + (Type.function + [ Type.namedWith [ "Date" ] "Date" [] ] + Type.int + ) + } + , year = + Elm.value + { importFrom = [ "Date" ] + , name = "year" + , annotation = + Just + (Type.function + [ Type.namedWith [ "Date" ] "Date" [] ] + Type.int + ) + } + , month = + Elm.value + { importFrom = [ "Date" ] + , name = "month" + , annotation = + Just + (Type.function + [ Type.namedWith [ "Date" ] "Date" [] ] + (Type.namedWith [ "Date" ] "Month" []) + ) + } + , day = + Elm.value + { importFrom = [ "Date" ] + , name = "day" + , annotation = + Just + (Type.function + [ Type.namedWith [ "Date" ] "Date" [] ] + Type.int + ) + } + , weekYear = + Elm.value + { importFrom = [ "Date" ] + , name = "weekYear" + , annotation = + Just + (Type.function + [ Type.namedWith [ "Date" ] "Date" [] ] + Type.int + ) + } + , weekNumber = + Elm.value + { importFrom = [ "Date" ] + , name = "weekNumber" + , annotation = + Just + (Type.function + [ Type.namedWith [ "Date" ] "Date" [] ] + Type.int + ) + } + , weekday = + Elm.value + { importFrom = [ "Date" ] + , name = "weekday" + , annotation = + Just + (Type.function + [ Type.namedWith [ "Date" ] "Date" [] ] + (Type.namedWith [ "Date" ] "Weekday" []) + ) + } + , ordinalDay = + Elm.value + { importFrom = [ "Date" ] + , name = "ordinalDay" + , annotation = + Just + (Type.function + [ Type.namedWith [ "Date" ] "Date" [] ] + Type.int + ) + } + , quarter = + Elm.value + { importFrom = [ "Date" ] + , name = "quarter" + , annotation = + Just + (Type.function + [ Type.namedWith [ "Date" ] "Date" [] ] + Type.int + ) + } + , monthNumber = + Elm.value + { importFrom = [ "Date" ] + , name = "monthNumber" + , annotation = + Just + (Type.function + [ Type.namedWith [ "Date" ] "Date" [] ] + Type.int + ) + } + , weekdayNumber = + Elm.value + { importFrom = [ "Date" ] + , name = "weekdayNumber" + , annotation = + Just + (Type.function + [ Type.namedWith [ "Date" ] "Date" [] ] + Type.int + ) + } + , format = + Elm.value + { importFrom = [ "Date" ] + , name = "format" + , annotation = + Just + (Type.function + [ Type.string, Type.namedWith [ "Date" ] "Date" [] ] + Type.string + ) + } + , withOrdinalSuffix = + Elm.value + { importFrom = [ "Date" ] + , name = "withOrdinalSuffix" + , annotation = Just (Type.function [ Type.int ] Type.string) + } + , formatWithLanguage = + Elm.value + { importFrom = [ "Date" ] + , name = "formatWithLanguage" + , annotation = + Just + (Type.function + [ Type.namedWith [ "Date" ] "Language" [] + , Type.string + , Type.namedWith [ "Date" ] "Date" [] + ] + Type.string + ) + } + , add = + Elm.value + { importFrom = [ "Date" ] + , name = "add" + , annotation = + Just + (Type.function + [ Type.namedWith [ "Date" ] "Unit" [] + , Type.int + , Type.namedWith [ "Date" ] "Date" [] + ] + (Type.namedWith [ "Date" ] "Date" []) + ) + } + , diff = + Elm.value + { importFrom = [ "Date" ] + , name = "diff" + , annotation = + Just + (Type.function + [ Type.namedWith [ "Date" ] "Unit" [] + , Type.namedWith [ "Date" ] "Date" [] + , Type.namedWith [ "Date" ] "Date" [] + ] + Type.int + ) + } + , ceiling = + Elm.value + { importFrom = [ "Date" ] + , name = "ceiling" + , annotation = + Just + (Type.function + [ Type.namedWith [ "Date" ] "Interval" [] + , Type.namedWith [ "Date" ] "Date" [] + ] + (Type.namedWith [ "Date" ] "Date" []) + ) + } + , floor = + Elm.value + { importFrom = [ "Date" ] + , name = "floor" + , annotation = + Just + (Type.function + [ Type.namedWith [ "Date" ] "Interval" [] + , Type.namedWith [ "Date" ] "Date" [] + ] + (Type.namedWith [ "Date" ] "Date" []) + ) + } + , range = + Elm.value + { importFrom = [ "Date" ] + , name = "range" + , annotation = + Just + (Type.function + [ Type.namedWith [ "Date" ] "Interval" [] + , Type.int + , Type.namedWith [ "Date" ] "Date" [] + , Type.namedWith [ "Date" ] "Date" [] + ] + (Type.list (Type.namedWith [ "Date" ] "Date" [])) + ) + } + , compare = + Elm.value + { importFrom = [ "Date" ] + , name = "compare" + , annotation = + Just + (Type.function + [ Type.namedWith [ "Date" ] "Date" [] + , Type.namedWith [ "Date" ] "Date" [] + ] + (Type.namedWith [ "Basics" ] "Order" []) + ) + } + , isBetween = + Elm.value + { importFrom = [ "Date" ] + , name = "isBetween" + , annotation = + Just + (Type.function + [ Type.namedWith [ "Date" ] "Date" [] + , Type.namedWith [ "Date" ] "Date" [] + , Type.namedWith [ "Date" ] "Date" [] + ] + Type.bool + ) + } + , min = + Elm.value + { importFrom = [ "Date" ] + , name = "min" + , annotation = + Just + (Type.function + [ Type.namedWith [ "Date" ] "Date" [] + , Type.namedWith [ "Date" ] "Date" [] + ] + (Type.namedWith [ "Date" ] "Date" []) + ) + } + , max = + Elm.value + { importFrom = [ "Date" ] + , name = "max" + , annotation = + Just + (Type.function + [ Type.namedWith [ "Date" ] "Date" [] + , Type.namedWith [ "Date" ] "Date" [] + ] + (Type.namedWith [ "Date" ] "Date" []) + ) + } + , clamp = + Elm.value + { importFrom = [ "Date" ] + , name = "clamp" + , annotation = + Just + (Type.function + [ Type.namedWith [ "Date" ] "Date" [] + , Type.namedWith [ "Date" ] "Date" [] + , Type.namedWith [ "Date" ] "Date" [] + ] + (Type.namedWith [ "Date" ] "Date" []) + ) + } + , monthToNumber = + Elm.value + { importFrom = [ "Date" ] + , name = "monthToNumber" + , annotation = + Just + (Type.function + [ Type.namedWith [ "Date" ] "Month" [] ] + Type.int + ) + } + , numberToMonth = + Elm.value + { importFrom = [ "Date" ] + , name = "numberToMonth" + , annotation = + Just + (Type.function + [ Type.int ] + (Type.namedWith [ "Date" ] "Month" []) + ) + } + , weekdayToNumber = + Elm.value + { importFrom = [ "Date" ] + , name = "weekdayToNumber" + , annotation = + Just + (Type.function + [ Type.namedWith [ "Date" ] "Weekday" [] ] + Type.int + ) + } + , numberToWeekday = + Elm.value + { importFrom = [ "Date" ] + , name = "numberToWeekday" + , annotation = + Just + (Type.function + [ Type.int ] + (Type.namedWith [ "Date" ] "Weekday" []) + ) + } + } \ No newline at end of file diff --git a/elm-open-api-codegen/src/Gen/Debug.elm b/elm-open-api-codegen/src/Gen/Debug.elm new file mode 100644 index 00000000..6bd8cb24 --- /dev/null +++ b/elm-open-api-codegen/src/Gen/Debug.elm @@ -0,0 +1,201 @@ +module Gen.Debug exposing + ( moduleName_, toString, log, todo, call_, values_ + ) + +{-| +# Generated bindings for Debug + +@docs moduleName_, toString, log, todo, call_, values_ +-} + + +import Elm +import Elm.Annotation as Type + + +{-| The name of this module. -} +moduleName_ : List String +moduleName_ = + [ "Debug" ] + + +{-| Turn any kind of value into a string. + + toString 42 == "42" + toString [1,2] == "[1,2]" + toString ('a', "cat", 13) == "('a', \"cat\", 13)" + toString "he said, \"hi\"" == "\"he said, \\\"hi\\\"\"" + +Notice that with strings, this is not the `identity` function. It escapes +characters so if you say `Html.text (toString "he said, \"hi\"")` it will +show `"he said, \"hi\""` rather than `he said, "hi"`. This makes it nice +for viewing Elm data structures. + +**Note:** This is not available with `elm make --optimize` which gets rid of +a bunch of runtime metadata. For example, it shortens record field names, and +we need that info to `toString` the value! As a consequence, packages cannot +use `toString` because they may be used in `--optimize` mode. + +toString: a -> String +-} +toString : Elm.Expression -> Elm.Expression +toString toStringArg_ = + Elm.apply + (Elm.value + { importFrom = [ "Debug" ] + , name = "toString" + , annotation = Just (Type.function [ Type.var "a" ] Type.string) + } + ) + [ toStringArg_ ] + + +{-| Log a tagged value on the developer console, and then return the value. + + 1 + log "number" 1 -- equals 2, logs "number: 1" + length (log "start" []) -- equals 0, logs "start: []" + +It is often possible to sprinkle this around to see if values are what you +expect. It is kind of old-school to do it this way, but it works! + +**Note:** This is not available with `elm make --optimize` because (1) it +relies on `toString` which has the same restriction and (2) it is not a pure +function and would therefore have unpredictable behavior when paired with +compiler optimizations that move code around. + +**Note:** If you want to create a terminal application that prints stuff out, +use ports for now. That will give you full access to reading and writing in the +terminal. We may have a package in Elm for this someday, but browser +applications are the primary focus of platform development for now. + +log: String -> a -> a +-} +log : String -> Elm.Expression -> Elm.Expression +log logArg_ logArg_0 = + Elm.apply + (Elm.value + { importFrom = [ "Debug" ] + , name = "log" + , annotation = + Just + (Type.function [ Type.string, Type.var "a" ] (Type.var "a") + ) + } + ) + [ Elm.string logArg_, logArg_0 ] + + +{-| This is a placeholder for code that you will write later. + +For example, if you are working with a large union type and have partially +completed a case expression, it may make sense to do this: + + type Entity = Ship | Fish | Captain | Seagull + + drawEntity entity = + case entity of + Ship -> + ... + + Fish -> + ... + + _ -> + Debug.todo "handle Captain and Seagull" + +The Elm compiler recognizes each `Debug.todo` so if you run into it, you get +an **uncatchable runtime exception** that includes the module name and line +number. + +**Note:** This is not available with `elm make --optimize` or packages. The +idea is that a `todo` can be useful during development, but uncatchable runtime +exceptions should not appear in the resulting applications. + +**Note:** For the equivalent of try/catch error handling in Elm, use modules +like [`Maybe`](#Maybe) and [`Result`](#Result) which guarantee that no error +goes unhandled! + +todo: String -> a +-} +todo : String -> Elm.Expression +todo todoArg_ = + Elm.apply + (Elm.value + { importFrom = [ "Debug" ] + , name = "todo" + , annotation = Just (Type.function [ Type.string ] (Type.var "a")) + } + ) + [ Elm.string todoArg_ ] + + +call_ : + { toString : Elm.Expression -> Elm.Expression + , log : Elm.Expression -> Elm.Expression -> Elm.Expression + , todo : Elm.Expression -> Elm.Expression + } +call_ = + { toString = + \toStringArg_ -> + Elm.apply + (Elm.value + { importFrom = [ "Debug" ] + , name = "toString" + , annotation = + Just (Type.function [ Type.var "a" ] Type.string) + } + ) + [ toStringArg_ ] + , log = + \logArg_ logArg_0 -> + Elm.apply + (Elm.value + { importFrom = [ "Debug" ] + , name = "log" + , annotation = + Just + (Type.function + [ Type.string, Type.var "a" ] + (Type.var "a") + ) + } + ) + [ logArg_, logArg_0 ] + , todo = + \todoArg_ -> + Elm.apply + (Elm.value + { importFrom = [ "Debug" ] + , name = "todo" + , annotation = + Just (Type.function [ Type.string ] (Type.var "a")) + } + ) + [ todoArg_ ] + } + + +values_ : + { toString : Elm.Expression, log : Elm.Expression, todo : Elm.Expression } +values_ = + { toString = + Elm.value + { importFrom = [ "Debug" ] + , name = "toString" + , annotation = Just (Type.function [ Type.var "a" ] Type.string) + } + , log = + Elm.value + { importFrom = [ "Debug" ] + , name = "log" + , annotation = + Just + (Type.function [ Type.string, Type.var "a" ] (Type.var "a")) + } + , todo = + Elm.value + { importFrom = [ "Debug" ] + , name = "todo" + , annotation = Just (Type.function [ Type.string ] (Type.var "a")) + } + } \ No newline at end of file diff --git a/elm-open-api-codegen/src/Gen/Dict.elm b/elm-open-api-codegen/src/Gen/Dict.elm new file mode 100644 index 00000000..38cf6889 --- /dev/null +++ b/elm-open-api-codegen/src/Gen/Dict.elm @@ -0,0 +1,1910 @@ +module Gen.Dict exposing + ( moduleName_, empty, singleton, insert, update, remove + , isEmpty, member, get, size, keys, values, toList + , fromList, map, foldl, foldr, filter, partition, union + , intersect, diff, merge, annotation_, call_, values_ + ) + +{-| +# Generated bindings for Dict + +@docs moduleName_, empty, singleton, insert, update, remove +@docs isEmpty, member, get, size, keys, values +@docs toList, fromList, map, foldl, foldr, filter +@docs partition, union, intersect, diff, merge, annotation_ +@docs call_, values_ +-} + + +import Elm +import Elm.Annotation as Type + + +{-| The name of this module. -} +moduleName_ : List String +moduleName_ = + [ "Dict" ] + + +{-| Create an empty dictionary. + +empty: Dict.Dict k v +-} +empty : Elm.Expression +empty = + Elm.value + { importFrom = [ "Dict" ] + , name = "empty" + , annotation = + Just + (Type.namedWith [ "Dict" ] "Dict" [ Type.var "k", Type.var "v" ] + ) + } + + +{-| Create a dictionary with one key-value pair. + +singleton: comparable -> v -> Dict.Dict comparable v +-} +singleton : Elm.Expression -> Elm.Expression -> Elm.Expression +singleton singletonArg_ singletonArg_0 = + Elm.apply + (Elm.value + { importFrom = [ "Dict" ] + , name = "singleton" + , annotation = + Just + (Type.function + [ Type.var "comparable", Type.var "v" ] + (Type.namedWith + [ "Dict" ] + "Dict" + [ Type.var "comparable", Type.var "v" ] + ) + ) + } + ) + [ singletonArg_, singletonArg_0 ] + + +{-| Insert a key-value pair into a dictionary. Replaces value when there is +a collision. + +insert: comparable -> v -> Dict.Dict comparable v -> Dict.Dict comparable v +-} +insert : Elm.Expression -> Elm.Expression -> Elm.Expression -> Elm.Expression +insert insertArg_ insertArg_0 insertArg_1 = + Elm.apply + (Elm.value + { importFrom = [ "Dict" ] + , name = "insert" + , annotation = + Just + (Type.function + [ Type.var "comparable" + , Type.var "v" + , Type.namedWith + [ "Dict" ] + "Dict" + [ Type.var "comparable", Type.var "v" ] + ] + (Type.namedWith + [ "Dict" ] + "Dict" + [ Type.var "comparable", Type.var "v" ] + ) + ) + } + ) + [ insertArg_, insertArg_0, insertArg_1 ] + + +{-| Update the value of a dictionary for a specific key with a given function. + +update: + comparable + -> (Maybe v -> Maybe v) + -> Dict.Dict comparable v + -> Dict.Dict comparable v +-} +update : + Elm.Expression + -> (Elm.Expression -> Elm.Expression) + -> Elm.Expression + -> Elm.Expression +update updateArg_ updateArg_0 updateArg_1 = + Elm.apply + (Elm.value + { importFrom = [ "Dict" ] + , name = "update" + , annotation = + Just + (Type.function + [ Type.var "comparable" + , Type.function + [ Type.maybe (Type.var "v") ] + (Type.maybe (Type.var "v")) + , Type.namedWith + [ "Dict" ] + "Dict" + [ Type.var "comparable", Type.var "v" ] + ] + (Type.namedWith + [ "Dict" ] + "Dict" + [ Type.var "comparable", Type.var "v" ] + ) + ) + } + ) + [ updateArg_ + , Elm.functionReduced "updateUnpack" updateArg_0 + , updateArg_1 + ] + + +{-| Remove a key-value pair from a dictionary. If the key is not found, +no changes are made. + +remove: comparable -> Dict.Dict comparable v -> Dict.Dict comparable v +-} +remove : Elm.Expression -> Elm.Expression -> Elm.Expression +remove removeArg_ removeArg_0 = + Elm.apply + (Elm.value + { importFrom = [ "Dict" ] + , name = "remove" + , annotation = + Just + (Type.function + [ Type.var "comparable" + , Type.namedWith + [ "Dict" ] + "Dict" + [ Type.var "comparable", Type.var "v" ] + ] + (Type.namedWith + [ "Dict" ] + "Dict" + [ Type.var "comparable", Type.var "v" ] + ) + ) + } + ) + [ removeArg_, removeArg_0 ] + + +{-| Determine if a dictionary is empty. + + isEmpty empty == True + +isEmpty: Dict.Dict k v -> Bool +-} +isEmpty : Elm.Expression -> Elm.Expression +isEmpty isEmptyArg_ = + Elm.apply + (Elm.value + { importFrom = [ "Dict" ] + , name = "isEmpty" + , annotation = + Just + (Type.function + [ Type.namedWith + [ "Dict" ] + "Dict" + [ Type.var "k", Type.var "v" ] + ] + Type.bool + ) + } + ) + [ isEmptyArg_ ] + + +{-| Determine if a key is in a dictionary. + +member: comparable -> Dict.Dict comparable v -> Bool +-} +member : Elm.Expression -> Elm.Expression -> Elm.Expression +member memberArg_ memberArg_0 = + Elm.apply + (Elm.value + { importFrom = [ "Dict" ] + , name = "member" + , annotation = + Just + (Type.function + [ Type.var "comparable" + , Type.namedWith + [ "Dict" ] + "Dict" + [ Type.var "comparable", Type.var "v" ] + ] + Type.bool + ) + } + ) + [ memberArg_, memberArg_0 ] + + +{-| Get the value associated with a key. If the key is not found, return +`Nothing`. This is useful when you are not sure if a key will be in the +dictionary. + + animals = fromList [ ("Tom", Cat), ("Jerry", Mouse) ] + + get "Tom" animals == Just Cat + get "Jerry" animals == Just Mouse + get "Spike" animals == Nothing + +get: comparable -> Dict.Dict comparable v -> Maybe v +-} +get : Elm.Expression -> Elm.Expression -> Elm.Expression +get getArg_ getArg_0 = + Elm.apply + (Elm.value + { importFrom = [ "Dict" ] + , name = "get" + , annotation = + Just + (Type.function + [ Type.var "comparable" + , Type.namedWith + [ "Dict" ] + "Dict" + [ Type.var "comparable", Type.var "v" ] + ] + (Type.maybe (Type.var "v")) + ) + } + ) + [ getArg_, getArg_0 ] + + +{-| Determine the number of key-value pairs in the dictionary. + +size: Dict.Dict k v -> Int +-} +size : Elm.Expression -> Elm.Expression +size sizeArg_ = + Elm.apply + (Elm.value + { importFrom = [ "Dict" ] + , name = "size" + , annotation = + Just + (Type.function + [ Type.namedWith + [ "Dict" ] + "Dict" + [ Type.var "k", Type.var "v" ] + ] + Type.int + ) + } + ) + [ sizeArg_ ] + + +{-| Get all of the keys in a dictionary, sorted from lowest to highest. + + keys (fromList [(0,"Alice"),(1,"Bob")]) == [0,1] + +keys: Dict.Dict k v -> List k +-} +keys : Elm.Expression -> Elm.Expression +keys keysArg_ = + Elm.apply + (Elm.value + { importFrom = [ "Dict" ] + , name = "keys" + , annotation = + Just + (Type.function + [ Type.namedWith + [ "Dict" ] + "Dict" + [ Type.var "k", Type.var "v" ] + ] + (Type.list (Type.var "k")) + ) + } + ) + [ keysArg_ ] + + +{-| Get all of the values in a dictionary, in the order of their keys. + + values (fromList [(0,"Alice"),(1,"Bob")]) == ["Alice", "Bob"] + +values: Dict.Dict k v -> List v +-} +values : Elm.Expression -> Elm.Expression +values valuesArg_ = + Elm.apply + (Elm.value + { importFrom = [ "Dict" ] + , name = "values" + , annotation = + Just + (Type.function + [ Type.namedWith + [ "Dict" ] + "Dict" + [ Type.var "k", Type.var "v" ] + ] + (Type.list (Type.var "v")) + ) + } + ) + [ valuesArg_ ] + + +{-| Convert a dictionary into an association list of key-value pairs, sorted by keys. + +toList: Dict.Dict k v -> List ( k, v ) +-} +toList : Elm.Expression -> Elm.Expression +toList toListArg_ = + Elm.apply + (Elm.value + { importFrom = [ "Dict" ] + , name = "toList" + , annotation = + Just + (Type.function + [ Type.namedWith + [ "Dict" ] + "Dict" + [ Type.var "k", Type.var "v" ] + ] + (Type.list (Type.tuple (Type.var "k") (Type.var "v"))) + ) + } + ) + [ toListArg_ ] + + +{-| Convert an association list into a dictionary. + +fromList: List ( comparable, v ) -> Dict.Dict comparable v +-} +fromList : List Elm.Expression -> Elm.Expression +fromList fromListArg_ = + Elm.apply + (Elm.value + { importFrom = [ "Dict" ] + , name = "fromList" + , annotation = + Just + (Type.function + [ Type.list + (Type.tuple (Type.var "comparable") (Type.var "v") + ) + ] + (Type.namedWith + [ "Dict" ] + "Dict" + [ Type.var "comparable", Type.var "v" ] + ) + ) + } + ) + [ Elm.list fromListArg_ ] + + +{-| Apply a function to all values in a dictionary. + +map: (k -> a -> b) -> Dict.Dict k a -> Dict.Dict k b +-} +map : + (Elm.Expression -> Elm.Expression -> Elm.Expression) + -> Elm.Expression + -> Elm.Expression +map mapArg_ mapArg_0 = + Elm.apply + (Elm.value + { importFrom = [ "Dict" ] + , name = "map" + , annotation = + Just + (Type.function + [ Type.function + [ Type.var "k", Type.var "a" ] + (Type.var "b") + , Type.namedWith + [ "Dict" ] + "Dict" + [ Type.var "k", Type.var "a" ] + ] + (Type.namedWith + [ "Dict" ] + "Dict" + [ Type.var "k", Type.var "b" ] + ) + ) + } + ) + [ Elm.functionReduced + "mapUnpack" + (\functionReducedUnpack -> + Elm.functionReduced "unpack" (mapArg_ functionReducedUnpack) + ) + , mapArg_0 + ] + + +{-| Fold over the key-value pairs in a dictionary from lowest key to highest key. + + import Dict exposing (Dict) + + getAges : Dict String User -> List String + getAges users = + Dict.foldl addAge [] users + + addAge : String -> User -> List String -> List String + addAge _ user ages = + user.age :: ages + + -- getAges users == [33,19,28] + +foldl: (k -> v -> b -> b) -> b -> Dict.Dict k v -> b +-} +foldl : + (Elm.Expression -> Elm.Expression -> Elm.Expression -> Elm.Expression) + -> Elm.Expression + -> Elm.Expression + -> Elm.Expression +foldl foldlArg_ foldlArg_0 foldlArg_1 = + Elm.apply + (Elm.value + { importFrom = [ "Dict" ] + , name = "foldl" + , annotation = + Just + (Type.function + [ Type.function + [ Type.var "k", Type.var "v", Type.var "b" ] + (Type.var "b") + , Type.var "b" + , Type.namedWith + [ "Dict" ] + "Dict" + [ Type.var "k", Type.var "v" ] + ] + (Type.var "b") + ) + } + ) + [ Elm.functionReduced + "foldlUnpack" + (\functionReducedUnpack -> + Elm.functionReduced + "unpack" + (\functionReducedUnpack0 -> + Elm.functionReduced + "unpack" + ((foldlArg_ functionReducedUnpack) + functionReducedUnpack0 + ) + ) + ) + , foldlArg_0 + , foldlArg_1 + ] + + +{-| Fold over the key-value pairs in a dictionary from highest key to lowest key. + + import Dict exposing (Dict) + + getAges : Dict String User -> List String + getAges users = + Dict.foldr addAge [] users + + addAge : String -> User -> List String -> List String + addAge _ user ages = + user.age :: ages + + -- getAges users == [28,19,33] + +foldr: (k -> v -> b -> b) -> b -> Dict.Dict k v -> b +-} +foldr : + (Elm.Expression -> Elm.Expression -> Elm.Expression -> Elm.Expression) + -> Elm.Expression + -> Elm.Expression + -> Elm.Expression +foldr foldrArg_ foldrArg_0 foldrArg_1 = + Elm.apply + (Elm.value + { importFrom = [ "Dict" ] + , name = "foldr" + , annotation = + Just + (Type.function + [ Type.function + [ Type.var "k", Type.var "v", Type.var "b" ] + (Type.var "b") + , Type.var "b" + , Type.namedWith + [ "Dict" ] + "Dict" + [ Type.var "k", Type.var "v" ] + ] + (Type.var "b") + ) + } + ) + [ Elm.functionReduced + "foldrUnpack" + (\functionReducedUnpack -> + Elm.functionReduced + "unpack" + (\functionReducedUnpack0 -> + Elm.functionReduced + "unpack" + ((foldrArg_ functionReducedUnpack) + functionReducedUnpack0 + ) + ) + ) + , foldrArg_0 + , foldrArg_1 + ] + + +{-| Keep only the key-value pairs that pass the given test. + +filter: (comparable -> v -> Bool) -> Dict.Dict comparable v -> Dict.Dict comparable v +-} +filter : + (Elm.Expression -> Elm.Expression -> Elm.Expression) + -> Elm.Expression + -> Elm.Expression +filter filterArg_ filterArg_0 = + Elm.apply + (Elm.value + { importFrom = [ "Dict" ] + , name = "filter" + , annotation = + Just + (Type.function + [ Type.function + [ Type.var "comparable", Type.var "v" ] + Type.bool + , Type.namedWith + [ "Dict" ] + "Dict" + [ Type.var "comparable", Type.var "v" ] + ] + (Type.namedWith + [ "Dict" ] + "Dict" + [ Type.var "comparable", Type.var "v" ] + ) + ) + } + ) + [ Elm.functionReduced + "filterUnpack" + (\functionReducedUnpack -> + Elm.functionReduced "unpack" (filterArg_ functionReducedUnpack) + ) + , filterArg_0 + ] + + +{-| Partition a dictionary according to some test. The first dictionary +contains all key-value pairs which passed the test, and the second contains +the pairs that did not. + +partition: + (comparable -> v -> Bool) + -> Dict.Dict comparable v + -> ( Dict.Dict comparable v, Dict.Dict comparable v ) +-} +partition : + (Elm.Expression -> Elm.Expression -> Elm.Expression) + -> Elm.Expression + -> Elm.Expression +partition partitionArg_ partitionArg_0 = + Elm.apply + (Elm.value + { importFrom = [ "Dict" ] + , name = "partition" + , annotation = + Just + (Type.function + [ Type.function + [ Type.var "comparable", Type.var "v" ] + Type.bool + , Type.namedWith + [ "Dict" ] + "Dict" + [ Type.var "comparable", Type.var "v" ] + ] + (Type.tuple + (Type.namedWith + [ "Dict" ] + "Dict" + [ Type.var "comparable", Type.var "v" ] + ) + (Type.namedWith + [ "Dict" ] + "Dict" + [ Type.var "comparable", Type.var "v" ] + ) + ) + ) + } + ) + [ Elm.functionReduced + "partitionUnpack" + (\functionReducedUnpack -> + Elm.functionReduced + "unpack" + (partitionArg_ functionReducedUnpack) + ) + , partitionArg_0 + ] + + +{-| Combine two dictionaries. If there is a collision, preference is given +to the first dictionary. + +union: Dict.Dict comparable v -> Dict.Dict comparable v -> Dict.Dict comparable v +-} +union : Elm.Expression -> Elm.Expression -> Elm.Expression +union unionArg_ unionArg_0 = + Elm.apply + (Elm.value + { importFrom = [ "Dict" ] + , name = "union" + , annotation = + Just + (Type.function + [ Type.namedWith + [ "Dict" ] + "Dict" + [ Type.var "comparable", Type.var "v" ] + , Type.namedWith + [ "Dict" ] + "Dict" + [ Type.var "comparable", Type.var "v" ] + ] + (Type.namedWith + [ "Dict" ] + "Dict" + [ Type.var "comparable", Type.var "v" ] + ) + ) + } + ) + [ unionArg_, unionArg_0 ] + + +{-| Keep a key-value pair when its key appears in the second dictionary. +Preference is given to values in the first dictionary. + +intersect: Dict.Dict comparable v -> Dict.Dict comparable v -> Dict.Dict comparable v +-} +intersect : Elm.Expression -> Elm.Expression -> Elm.Expression +intersect intersectArg_ intersectArg_0 = + Elm.apply + (Elm.value + { importFrom = [ "Dict" ] + , name = "intersect" + , annotation = + Just + (Type.function + [ Type.namedWith + [ "Dict" ] + "Dict" + [ Type.var "comparable", Type.var "v" ] + , Type.namedWith + [ "Dict" ] + "Dict" + [ Type.var "comparable", Type.var "v" ] + ] + (Type.namedWith + [ "Dict" ] + "Dict" + [ Type.var "comparable", Type.var "v" ] + ) + ) + } + ) + [ intersectArg_, intersectArg_0 ] + + +{-| Keep a key-value pair when its key does not appear in the second dictionary. + +diff: Dict.Dict comparable a -> Dict.Dict comparable b -> Dict.Dict comparable a +-} +diff : Elm.Expression -> Elm.Expression -> Elm.Expression +diff diffArg_ diffArg_0 = + Elm.apply + (Elm.value + { importFrom = [ "Dict" ] + , name = "diff" + , annotation = + Just + (Type.function + [ Type.namedWith + [ "Dict" ] + "Dict" + [ Type.var "comparable", Type.var "a" ] + , Type.namedWith + [ "Dict" ] + "Dict" + [ Type.var "comparable", Type.var "b" ] + ] + (Type.namedWith + [ "Dict" ] + "Dict" + [ Type.var "comparable", Type.var "a" ] + ) + ) + } + ) + [ diffArg_, diffArg_0 ] + + +{-| The most general way of combining two dictionaries. You provide three +accumulators for when a given key appears: + + 1. Only in the left dictionary. + 2. In both dictionaries. + 3. Only in the right dictionary. + +You then traverse all the keys from lowest to highest, building up whatever +you want. + +merge: + (comparable -> a -> result -> result) + -> (comparable -> a -> b -> result -> result) + -> (comparable -> b -> result -> result) + -> Dict.Dict comparable a + -> Dict.Dict comparable b + -> result + -> result +-} +merge : + (Elm.Expression -> Elm.Expression -> Elm.Expression -> Elm.Expression) + -> (Elm.Expression + -> Elm.Expression + -> Elm.Expression + -> Elm.Expression + -> Elm.Expression) + -> (Elm.Expression -> Elm.Expression -> Elm.Expression -> Elm.Expression) + -> Elm.Expression + -> Elm.Expression + -> Elm.Expression + -> Elm.Expression +merge mergeArg_ mergeArg_0 mergeArg_1 mergeArg_2 mergeArg_3 mergeArg_4 = + Elm.apply + (Elm.value + { importFrom = [ "Dict" ] + , name = "merge" + , annotation = + Just + (Type.function + [ Type.function + [ Type.var "comparable" + , Type.var "a" + , Type.var "result" + ] + (Type.var "result") + , Type.function + [ Type.var "comparable" + , Type.var "a" + , Type.var "b" + , Type.var "result" + ] + (Type.var "result") + , Type.function + [ Type.var "comparable" + , Type.var "b" + , Type.var "result" + ] + (Type.var "result") + , Type.namedWith + [ "Dict" ] + "Dict" + [ Type.var "comparable", Type.var "a" ] + , Type.namedWith + [ "Dict" ] + "Dict" + [ Type.var "comparable", Type.var "b" ] + , Type.var "result" + ] + (Type.var "result") + ) + } + ) + [ Elm.functionReduced + "mergeUnpack" + (\functionReducedUnpack -> + Elm.functionReduced + "unpack" + (\functionReducedUnpack0 -> + Elm.functionReduced + "unpack" + ((mergeArg_ functionReducedUnpack) + functionReducedUnpack0 + ) + ) + ) + , Elm.functionReduced + "mergeUnpack" + (\functionReducedUnpack -> + Elm.functionReduced + "unpack" + (\functionReducedUnpack0 -> + Elm.functionReduced + "unpack" + (\functionReducedUnpack_2_1_2_0_2_1_2_0_0 -> + Elm.functionReduced + "unpack" + (((mergeArg_0 functionReducedUnpack) + functionReducedUnpack0 + ) + functionReducedUnpack_2_1_2_0_2_1_2_0_0 + ) + ) + ) + ) + , Elm.functionReduced + "mergeUnpack" + (\functionReducedUnpack -> + Elm.functionReduced + "unpack" + (\functionReducedUnpack0 -> + Elm.functionReduced + "unpack" + ((mergeArg_1 functionReducedUnpack) + functionReducedUnpack0 + ) + ) + ) + , mergeArg_2 + , mergeArg_3 + , mergeArg_4 + ] + + +annotation_ : { dict : Type.Annotation -> Type.Annotation -> Type.Annotation } +annotation_ = + { dict = + \dictArg0 dictArg1 -> + Type.namedWith [ "Dict" ] "Dict" [ dictArg0, dictArg1 ] + } + + +call_ : + { singleton : Elm.Expression -> Elm.Expression -> Elm.Expression + , insert : + Elm.Expression -> Elm.Expression -> Elm.Expression -> Elm.Expression + , update : + Elm.Expression -> Elm.Expression -> Elm.Expression -> Elm.Expression + , remove : Elm.Expression -> Elm.Expression -> Elm.Expression + , isEmpty : Elm.Expression -> Elm.Expression + , member : Elm.Expression -> Elm.Expression -> Elm.Expression + , get : Elm.Expression -> Elm.Expression -> Elm.Expression + , size : Elm.Expression -> Elm.Expression + , keys : Elm.Expression -> Elm.Expression + , values : Elm.Expression -> Elm.Expression + , toList : Elm.Expression -> Elm.Expression + , fromList : Elm.Expression -> Elm.Expression + , map : Elm.Expression -> Elm.Expression -> Elm.Expression + , foldl : + Elm.Expression -> Elm.Expression -> Elm.Expression -> Elm.Expression + , foldr : + Elm.Expression -> Elm.Expression -> Elm.Expression -> Elm.Expression + , filter : Elm.Expression -> Elm.Expression -> Elm.Expression + , partition : Elm.Expression -> Elm.Expression -> Elm.Expression + , union : Elm.Expression -> Elm.Expression -> Elm.Expression + , intersect : Elm.Expression -> Elm.Expression -> Elm.Expression + , diff : Elm.Expression -> Elm.Expression -> Elm.Expression + , merge : + Elm.Expression + -> Elm.Expression + -> Elm.Expression + -> Elm.Expression + -> Elm.Expression + -> Elm.Expression + -> Elm.Expression + } +call_ = + { singleton = + \singletonArg_ singletonArg_0 -> + Elm.apply + (Elm.value + { importFrom = [ "Dict" ] + , name = "singleton" + , annotation = + Just + (Type.function + [ Type.var "comparable", Type.var "v" ] + (Type.namedWith + [ "Dict" ] + "Dict" + [ Type.var "comparable", Type.var "v" ] + ) + ) + } + ) + [ singletonArg_, singletonArg_0 ] + , insert = + \insertArg_ insertArg_0 insertArg_1 -> + Elm.apply + (Elm.value + { importFrom = [ "Dict" ] + , name = "insert" + , annotation = + Just + (Type.function + [ Type.var "comparable" + , Type.var "v" + , Type.namedWith + [ "Dict" ] + "Dict" + [ Type.var "comparable", Type.var "v" ] + ] + (Type.namedWith + [ "Dict" ] + "Dict" + [ Type.var "comparable", Type.var "v" ] + ) + ) + } + ) + [ insertArg_, insertArg_0, insertArg_1 ] + , update = + \updateArg_ updateArg_0 updateArg_1 -> + Elm.apply + (Elm.value + { importFrom = [ "Dict" ] + , name = "update" + , annotation = + Just + (Type.function + [ Type.var "comparable" + , Type.function + [ Type.maybe (Type.var "v") ] + (Type.maybe (Type.var "v")) + , Type.namedWith + [ "Dict" ] + "Dict" + [ Type.var "comparable", Type.var "v" ] + ] + (Type.namedWith + [ "Dict" ] + "Dict" + [ Type.var "comparable", Type.var "v" ] + ) + ) + } + ) + [ updateArg_, updateArg_0, updateArg_1 ] + , remove = + \removeArg_ removeArg_0 -> + Elm.apply + (Elm.value + { importFrom = [ "Dict" ] + , name = "remove" + , annotation = + Just + (Type.function + [ Type.var "comparable" + , Type.namedWith + [ "Dict" ] + "Dict" + [ Type.var "comparable", Type.var "v" ] + ] + (Type.namedWith + [ "Dict" ] + "Dict" + [ Type.var "comparable", Type.var "v" ] + ) + ) + } + ) + [ removeArg_, removeArg_0 ] + , isEmpty = + \isEmptyArg_ -> + Elm.apply + (Elm.value + { importFrom = [ "Dict" ] + , name = "isEmpty" + , annotation = + Just + (Type.function + [ Type.namedWith + [ "Dict" ] + "Dict" + [ Type.var "k", Type.var "v" ] + ] + Type.bool + ) + } + ) + [ isEmptyArg_ ] + , member = + \memberArg_ memberArg_0 -> + Elm.apply + (Elm.value + { importFrom = [ "Dict" ] + , name = "member" + , annotation = + Just + (Type.function + [ Type.var "comparable" + , Type.namedWith + [ "Dict" ] + "Dict" + [ Type.var "comparable", Type.var "v" ] + ] + Type.bool + ) + } + ) + [ memberArg_, memberArg_0 ] + , get = + \getArg_ getArg_0 -> + Elm.apply + (Elm.value + { importFrom = [ "Dict" ] + , name = "get" + , annotation = + Just + (Type.function + [ Type.var "comparable" + , Type.namedWith + [ "Dict" ] + "Dict" + [ Type.var "comparable", Type.var "v" ] + ] + (Type.maybe (Type.var "v")) + ) + } + ) + [ getArg_, getArg_0 ] + , size = + \sizeArg_ -> + Elm.apply + (Elm.value + { importFrom = [ "Dict" ] + , name = "size" + , annotation = + Just + (Type.function + [ Type.namedWith + [ "Dict" ] + "Dict" + [ Type.var "k", Type.var "v" ] + ] + Type.int + ) + } + ) + [ sizeArg_ ] + , keys = + \keysArg_ -> + Elm.apply + (Elm.value + { importFrom = [ "Dict" ] + , name = "keys" + , annotation = + Just + (Type.function + [ Type.namedWith + [ "Dict" ] + "Dict" + [ Type.var "k", Type.var "v" ] + ] + (Type.list (Type.var "k")) + ) + } + ) + [ keysArg_ ] + , values = + \valuesArg_ -> + Elm.apply + (Elm.value + { importFrom = [ "Dict" ] + , name = "values" + , annotation = + Just + (Type.function + [ Type.namedWith + [ "Dict" ] + "Dict" + [ Type.var "k", Type.var "v" ] + ] + (Type.list (Type.var "v")) + ) + } + ) + [ valuesArg_ ] + , toList = + \toListArg_ -> + Elm.apply + (Elm.value + { importFrom = [ "Dict" ] + , name = "toList" + , annotation = + Just + (Type.function + [ Type.namedWith + [ "Dict" ] + "Dict" + [ Type.var "k", Type.var "v" ] + ] + (Type.list + (Type.tuple (Type.var "k") (Type.var "v") + ) + ) + ) + } + ) + [ toListArg_ ] + , fromList = + \fromListArg_ -> + Elm.apply + (Elm.value + { importFrom = [ "Dict" ] + , name = "fromList" + , annotation = + Just + (Type.function + [ Type.list + (Type.tuple + (Type.var "comparable") + (Type.var "v") + ) + ] + (Type.namedWith + [ "Dict" ] + "Dict" + [ Type.var "comparable", Type.var "v" ] + ) + ) + } + ) + [ fromListArg_ ] + , map = + \mapArg_ mapArg_0 -> + Elm.apply + (Elm.value + { importFrom = [ "Dict" ] + , name = "map" + , annotation = + Just + (Type.function + [ Type.function + [ Type.var "k", Type.var "a" ] + (Type.var "b") + , Type.namedWith + [ "Dict" ] + "Dict" + [ Type.var "k", Type.var "a" ] + ] + (Type.namedWith + [ "Dict" ] + "Dict" + [ Type.var "k", Type.var "b" ] + ) + ) + } + ) + [ mapArg_, mapArg_0 ] + , foldl = + \foldlArg_ foldlArg_0 foldlArg_1 -> + Elm.apply + (Elm.value + { importFrom = [ "Dict" ] + , name = "foldl" + , annotation = + Just + (Type.function + [ Type.function + [ Type.var "k" + , Type.var "v" + , Type.var "b" + ] + (Type.var "b") + , Type.var "b" + , Type.namedWith + [ "Dict" ] + "Dict" + [ Type.var "k", Type.var "v" ] + ] + (Type.var "b") + ) + } + ) + [ foldlArg_, foldlArg_0, foldlArg_1 ] + , foldr = + \foldrArg_ foldrArg_0 foldrArg_1 -> + Elm.apply + (Elm.value + { importFrom = [ "Dict" ] + , name = "foldr" + , annotation = + Just + (Type.function + [ Type.function + [ Type.var "k" + , Type.var "v" + , Type.var "b" + ] + (Type.var "b") + , Type.var "b" + , Type.namedWith + [ "Dict" ] + "Dict" + [ Type.var "k", Type.var "v" ] + ] + (Type.var "b") + ) + } + ) + [ foldrArg_, foldrArg_0, foldrArg_1 ] + , filter = + \filterArg_ filterArg_0 -> + Elm.apply + (Elm.value + { importFrom = [ "Dict" ] + , name = "filter" + , annotation = + Just + (Type.function + [ Type.function + [ Type.var "comparable", Type.var "v" ] + Type.bool + , Type.namedWith + [ "Dict" ] + "Dict" + [ Type.var "comparable", Type.var "v" ] + ] + (Type.namedWith + [ "Dict" ] + "Dict" + [ Type.var "comparable", Type.var "v" ] + ) + ) + } + ) + [ filterArg_, filterArg_0 ] + , partition = + \partitionArg_ partitionArg_0 -> + Elm.apply + (Elm.value + { importFrom = [ "Dict" ] + , name = "partition" + , annotation = + Just + (Type.function + [ Type.function + [ Type.var "comparable", Type.var "v" ] + Type.bool + , Type.namedWith + [ "Dict" ] + "Dict" + [ Type.var "comparable", Type.var "v" ] + ] + (Type.tuple + (Type.namedWith + [ "Dict" ] + "Dict" + [ Type.var "comparable" + , Type.var "v" + ] + ) + (Type.namedWith + [ "Dict" ] + "Dict" + [ Type.var "comparable" + , Type.var "v" + ] + ) + ) + ) + } + ) + [ partitionArg_, partitionArg_0 ] + , union = + \unionArg_ unionArg_0 -> + Elm.apply + (Elm.value + { importFrom = [ "Dict" ] + , name = "union" + , annotation = + Just + (Type.function + [ Type.namedWith + [ "Dict" ] + "Dict" + [ Type.var "comparable", Type.var "v" ] + , Type.namedWith + [ "Dict" ] + "Dict" + [ Type.var "comparable", Type.var "v" ] + ] + (Type.namedWith + [ "Dict" ] + "Dict" + [ Type.var "comparable", Type.var "v" ] + ) + ) + } + ) + [ unionArg_, unionArg_0 ] + , intersect = + \intersectArg_ intersectArg_0 -> + Elm.apply + (Elm.value + { importFrom = [ "Dict" ] + , name = "intersect" + , annotation = + Just + (Type.function + [ Type.namedWith + [ "Dict" ] + "Dict" + [ Type.var "comparable", Type.var "v" ] + , Type.namedWith + [ "Dict" ] + "Dict" + [ Type.var "comparable", Type.var "v" ] + ] + (Type.namedWith + [ "Dict" ] + "Dict" + [ Type.var "comparable", Type.var "v" ] + ) + ) + } + ) + [ intersectArg_, intersectArg_0 ] + , diff = + \diffArg_ diffArg_0 -> + Elm.apply + (Elm.value + { importFrom = [ "Dict" ] + , name = "diff" + , annotation = + Just + (Type.function + [ Type.namedWith + [ "Dict" ] + "Dict" + [ Type.var "comparable", Type.var "a" ] + , Type.namedWith + [ "Dict" ] + "Dict" + [ Type.var "comparable", Type.var "b" ] + ] + (Type.namedWith + [ "Dict" ] + "Dict" + [ Type.var "comparable", Type.var "a" ] + ) + ) + } + ) + [ diffArg_, diffArg_0 ] + , merge = + \mergeArg_ mergeArg_0 mergeArg_1 mergeArg_2 mergeArg_3 mergeArg_4 -> + Elm.apply + (Elm.value + { importFrom = [ "Dict" ] + , name = "merge" + , annotation = + Just + (Type.function + [ Type.function + [ Type.var "comparable" + , Type.var "a" + , Type.var "result" + ] + (Type.var "result") + , Type.function + [ Type.var "comparable" + , Type.var "a" + , Type.var "b" + , Type.var "result" + ] + (Type.var "result") + , Type.function + [ Type.var "comparable" + , Type.var "b" + , Type.var "result" + ] + (Type.var "result") + , Type.namedWith + [ "Dict" ] + "Dict" + [ Type.var "comparable", Type.var "a" ] + , Type.namedWith + [ "Dict" ] + "Dict" + [ Type.var "comparable", Type.var "b" ] + , Type.var "result" + ] + (Type.var "result") + ) + } + ) + [ mergeArg_ + , mergeArg_0 + , mergeArg_1 + , mergeArg_2 + , mergeArg_3 + , mergeArg_4 + ] + } + + +values_ : + { empty : Elm.Expression + , singleton : Elm.Expression + , insert : Elm.Expression + , update : Elm.Expression + , remove : Elm.Expression + , isEmpty : Elm.Expression + , member : Elm.Expression + , get : Elm.Expression + , size : Elm.Expression + , keys : Elm.Expression + , values : Elm.Expression + , toList : Elm.Expression + , fromList : Elm.Expression + , map : Elm.Expression + , foldl : Elm.Expression + , foldr : Elm.Expression + , filter : Elm.Expression + , partition : Elm.Expression + , union : Elm.Expression + , intersect : Elm.Expression + , diff : Elm.Expression + , merge : Elm.Expression + } +values_ = + { empty = + Elm.value + { importFrom = [ "Dict" ] + , name = "empty" + , annotation = + Just + (Type.namedWith + [ "Dict" ] + "Dict" + [ Type.var "k", Type.var "v" ] + ) + } + , singleton = + Elm.value + { importFrom = [ "Dict" ] + , name = "singleton" + , annotation = + Just + (Type.function + [ Type.var "comparable", Type.var "v" ] + (Type.namedWith + [ "Dict" ] + "Dict" + [ Type.var "comparable", Type.var "v" ] + ) + ) + } + , insert = + Elm.value + { importFrom = [ "Dict" ] + , name = "insert" + , annotation = + Just + (Type.function + [ Type.var "comparable" + , Type.var "v" + , Type.namedWith + [ "Dict" ] + "Dict" + [ Type.var "comparable", Type.var "v" ] + ] + (Type.namedWith + [ "Dict" ] + "Dict" + [ Type.var "comparable", Type.var "v" ] + ) + ) + } + , update = + Elm.value + { importFrom = [ "Dict" ] + , name = "update" + , annotation = + Just + (Type.function + [ Type.var "comparable" + , Type.function + [ Type.maybe (Type.var "v") ] + (Type.maybe (Type.var "v")) + , Type.namedWith + [ "Dict" ] + "Dict" + [ Type.var "comparable", Type.var "v" ] + ] + (Type.namedWith + [ "Dict" ] + "Dict" + [ Type.var "comparable", Type.var "v" ] + ) + ) + } + , remove = + Elm.value + { importFrom = [ "Dict" ] + , name = "remove" + , annotation = + Just + (Type.function + [ Type.var "comparable" + , Type.namedWith + [ "Dict" ] + "Dict" + [ Type.var "comparable", Type.var "v" ] + ] + (Type.namedWith + [ "Dict" ] + "Dict" + [ Type.var "comparable", Type.var "v" ] + ) + ) + } + , isEmpty = + Elm.value + { importFrom = [ "Dict" ] + , name = "isEmpty" + , annotation = + Just + (Type.function + [ Type.namedWith + [ "Dict" ] + "Dict" + [ Type.var "k", Type.var "v" ] + ] + Type.bool + ) + } + , member = + Elm.value + { importFrom = [ "Dict" ] + , name = "member" + , annotation = + Just + (Type.function + [ Type.var "comparable" + , Type.namedWith + [ "Dict" ] + "Dict" + [ Type.var "comparable", Type.var "v" ] + ] + Type.bool + ) + } + , get = + Elm.value + { importFrom = [ "Dict" ] + , name = "get" + , annotation = + Just + (Type.function + [ Type.var "comparable" + , Type.namedWith + [ "Dict" ] + "Dict" + [ Type.var "comparable", Type.var "v" ] + ] + (Type.maybe (Type.var "v")) + ) + } + , size = + Elm.value + { importFrom = [ "Dict" ] + , name = "size" + , annotation = + Just + (Type.function + [ Type.namedWith + [ "Dict" ] + "Dict" + [ Type.var "k", Type.var "v" ] + ] + Type.int + ) + } + , keys = + Elm.value + { importFrom = [ "Dict" ] + , name = "keys" + , annotation = + Just + (Type.function + [ Type.namedWith + [ "Dict" ] + "Dict" + [ Type.var "k", Type.var "v" ] + ] + (Type.list (Type.var "k")) + ) + } + , values = + Elm.value + { importFrom = [ "Dict" ] + , name = "values" + , annotation = + Just + (Type.function + [ Type.namedWith + [ "Dict" ] + "Dict" + [ Type.var "k", Type.var "v" ] + ] + (Type.list (Type.var "v")) + ) + } + , toList = + Elm.value + { importFrom = [ "Dict" ] + , name = "toList" + , annotation = + Just + (Type.function + [ Type.namedWith + [ "Dict" ] + "Dict" + [ Type.var "k", Type.var "v" ] + ] + (Type.list (Type.tuple (Type.var "k") (Type.var "v"))) + ) + } + , fromList = + Elm.value + { importFrom = [ "Dict" ] + , name = "fromList" + , annotation = + Just + (Type.function + [ Type.list + (Type.tuple (Type.var "comparable") (Type.var "v")) + ] + (Type.namedWith + [ "Dict" ] + "Dict" + [ Type.var "comparable", Type.var "v" ] + ) + ) + } + , map = + Elm.value + { importFrom = [ "Dict" ] + , name = "map" + , annotation = + Just + (Type.function + [ Type.function + [ Type.var "k", Type.var "a" ] + (Type.var "b") + , Type.namedWith + [ "Dict" ] + "Dict" + [ Type.var "k", Type.var "a" ] + ] + (Type.namedWith + [ "Dict" ] + "Dict" + [ Type.var "k", Type.var "b" ] + ) + ) + } + , foldl = + Elm.value + { importFrom = [ "Dict" ] + , name = "foldl" + , annotation = + Just + (Type.function + [ Type.function + [ Type.var "k", Type.var "v", Type.var "b" ] + (Type.var "b") + , Type.var "b" + , Type.namedWith + [ "Dict" ] + "Dict" + [ Type.var "k", Type.var "v" ] + ] + (Type.var "b") + ) + } + , foldr = + Elm.value + { importFrom = [ "Dict" ] + , name = "foldr" + , annotation = + Just + (Type.function + [ Type.function + [ Type.var "k", Type.var "v", Type.var "b" ] + (Type.var "b") + , Type.var "b" + , Type.namedWith + [ "Dict" ] + "Dict" + [ Type.var "k", Type.var "v" ] + ] + (Type.var "b") + ) + } + , filter = + Elm.value + { importFrom = [ "Dict" ] + , name = "filter" + , annotation = + Just + (Type.function + [ Type.function + [ Type.var "comparable", Type.var "v" ] + Type.bool + , Type.namedWith + [ "Dict" ] + "Dict" + [ Type.var "comparable", Type.var "v" ] + ] + (Type.namedWith + [ "Dict" ] + "Dict" + [ Type.var "comparable", Type.var "v" ] + ) + ) + } + , partition = + Elm.value + { importFrom = [ "Dict" ] + , name = "partition" + , annotation = + Just + (Type.function + [ Type.function + [ Type.var "comparable", Type.var "v" ] + Type.bool + , Type.namedWith + [ "Dict" ] + "Dict" + [ Type.var "comparable", Type.var "v" ] + ] + (Type.tuple + (Type.namedWith + [ "Dict" ] + "Dict" + [ Type.var "comparable", Type.var "v" ] + ) + (Type.namedWith + [ "Dict" ] + "Dict" + [ Type.var "comparable", Type.var "v" ] + ) + ) + ) + } + , union = + Elm.value + { importFrom = [ "Dict" ] + , name = "union" + , annotation = + Just + (Type.function + [ Type.namedWith + [ "Dict" ] + "Dict" + [ Type.var "comparable", Type.var "v" ] + , Type.namedWith + [ "Dict" ] + "Dict" + [ Type.var "comparable", Type.var "v" ] + ] + (Type.namedWith + [ "Dict" ] + "Dict" + [ Type.var "comparable", Type.var "v" ] + ) + ) + } + , intersect = + Elm.value + { importFrom = [ "Dict" ] + , name = "intersect" + , annotation = + Just + (Type.function + [ Type.namedWith + [ "Dict" ] + "Dict" + [ Type.var "comparable", Type.var "v" ] + , Type.namedWith + [ "Dict" ] + "Dict" + [ Type.var "comparable", Type.var "v" ] + ] + (Type.namedWith + [ "Dict" ] + "Dict" + [ Type.var "comparable", Type.var "v" ] + ) + ) + } + , diff = + Elm.value + { importFrom = [ "Dict" ] + , name = "diff" + , annotation = + Just + (Type.function + [ Type.namedWith + [ "Dict" ] + "Dict" + [ Type.var "comparable", Type.var "a" ] + , Type.namedWith + [ "Dict" ] + "Dict" + [ Type.var "comparable", Type.var "b" ] + ] + (Type.namedWith + [ "Dict" ] + "Dict" + [ Type.var "comparable", Type.var "a" ] + ) + ) + } + , merge = + Elm.value + { importFrom = [ "Dict" ] + , name = "merge" + , annotation = + Just + (Type.function + [ Type.function + [ Type.var "comparable" + , Type.var "a" + , Type.var "result" + ] + (Type.var "result") + , Type.function + [ Type.var "comparable" + , Type.var "a" + , Type.var "b" + , Type.var "result" + ] + (Type.var "result") + , Type.function + [ Type.var "comparable" + , Type.var "b" + , Type.var "result" + ] + (Type.var "result") + , Type.namedWith + [ "Dict" ] + "Dict" + [ Type.var "comparable", Type.var "a" ] + , Type.namedWith + [ "Dict" ] + "Dict" + [ Type.var "comparable", Type.var "b" ] + , Type.var "result" + ] + (Type.var "result") + ) + } + } \ No newline at end of file diff --git a/elm-open-api-codegen/src/Gen/Effect/Http.elm b/elm-open-api-codegen/src/Gen/Effect/Http.elm new file mode 100644 index 00000000..dac177b2 --- /dev/null +++ b/elm-open-api-codegen/src/Gen/Effect/Http.elm @@ -0,0 +1,3296 @@ +module Gen.Effect.Http exposing + ( moduleName_, riskyTask, bytesResolver, stringResolver, task, expectWhatever + , expectBytes, expectJson, expectBytesResponse, expectStringResponse, expectString, riskyRequest, fractionReceived + , fractionSent, track, cancel, bytesPart, filePart, stringPart, multipartBody + , fileBody, bytesBody, stringBody, jsonBody, emptyBody, header, request + , post, get, annotation_, make_, caseOf_, call_, values_ + ) + +{-| +# Generated bindings for Effect.Http + +@docs moduleName_, riskyTask, bytesResolver, stringResolver, task, expectWhatever +@docs expectBytes, expectJson, expectBytesResponse, expectStringResponse, expectString, riskyRequest +@docs fractionReceived, fractionSent, track, cancel, bytesPart, filePart +@docs stringPart, multipartBody, fileBody, bytesBody, stringBody, jsonBody +@docs emptyBody, header, request, post, get, annotation_ +@docs make_, caseOf_, call_, values_ +-} + + +import Elm +import Elm.Annotation as Type +import Elm.Arg +import Elm.Case + + +{-| The name of this module. -} +moduleName_ : List String +moduleName_ = + [ "Effect", "Http" ] + + +{-| {-| Just like [`riskyRequest`](#riskyRequest), but it creates a `Task`. **Use +with caution!** This has all the same security concerns as `riskyRequest`. +-} + +riskyTask: + { method : String + , headers : List Effect.Http.Header + , url : String + , body : Effect.Http.Body + , resolver : Effect.Http.Resolver restriction x a + , timeout : Maybe Duration.Duration + } + -> Effect.Task.Task restriction x a +-} +riskyTask : + { method : String + , headers : List Elm.Expression + , url : String + , body : Elm.Expression + , resolver : Elm.Expression + , timeout : Elm.Expression + } + -> Elm.Expression +riskyTask riskyTaskArg_ = + Elm.apply + (Elm.value + { importFrom = [ "Effect", "Http" ] + , name = "riskyTask" + , annotation = + Just + (Type.function + [ Type.record + [ ( "method", Type.string ) + , ( "headers" + , Type.list + (Type.namedWith + [ "Effect", "Http" ] + "Header" + [] + ) + ) + , ( "url", Type.string ) + , ( "body" + , Type.namedWith [ "Effect", "Http" ] "Body" [] + ) + , ( "resolver" + , Type.namedWith + [ "Effect", "Http" ] + "Resolver" + [ Type.var "restriction" + , Type.var "x" + , Type.var "a" + ] + ) + , ( "timeout" + , Type.maybe + (Type.namedWith [ "Duration" ] "Duration" [] + ) + ) + ] + ] + (Type.namedWith + [ "Effect", "Task" ] + "Task" + [ Type.var "restriction" + , Type.var "x" + , Type.var "a" + ] + ) + ) + } + ) + [ Elm.record + [ Tuple.pair "method" (Elm.string riskyTaskArg_.method) + , Tuple.pair "headers" (Elm.list riskyTaskArg_.headers) + , Tuple.pair "url" (Elm.string riskyTaskArg_.url) + , Tuple.pair "body" riskyTaskArg_.body + , Tuple.pair "resolver" riskyTaskArg_.resolver + , Tuple.pair "timeout" riskyTaskArg_.timeout + ] + ] + + +{-| {-| Turn a response with a `Bytes` body into a result. +Similar to [`expectBytesResponse`](#expectBytesResponse). +-} + +bytesResolver: + (Effect.Http.Response Bytes.Bytes -> Result.Result x a) + -> Effect.Http.Resolver restriction x a +-} +bytesResolver : (Elm.Expression -> Elm.Expression) -> Elm.Expression +bytesResolver bytesResolverArg_ = + Elm.apply + (Elm.value + { importFrom = [ "Effect", "Http" ] + , name = "bytesResolver" + , annotation = + Just + (Type.function + [ Type.function + [ Type.namedWith + [ "Effect", "Http" ] + "Response" + [ Type.namedWith [ "Bytes" ] "Bytes" [] ] + ] + (Type.namedWith + [ "Result" ] + "Result" + [ Type.var "x", Type.var "a" ] + ) + ] + (Type.namedWith + [ "Effect", "Http" ] + "Resolver" + [ Type.var "restriction" + , Type.var "x" + , Type.var "a" + ] + ) + ) + } + ) + [ Elm.functionReduced "bytesResolverUnpack" bytesResolverArg_ ] + + +{-| {-| Turn a response with a `String` body into a result. +-} + +stringResolver: + (Effect.Http.Response String -> Result.Result x a) + -> Effect.Http.Resolver restriction x a +-} +stringResolver : (Elm.Expression -> Elm.Expression) -> Elm.Expression +stringResolver stringResolverArg_ = + Elm.apply + (Elm.value + { importFrom = [ "Effect", "Http" ] + , name = "stringResolver" + , annotation = + Just + (Type.function + [ Type.function + [ Type.namedWith + [ "Effect", "Http" ] + "Response" + [ Type.string ] + ] + (Type.namedWith + [ "Result" ] + "Result" + [ Type.var "x", Type.var "a" ] + ) + ] + (Type.namedWith + [ "Effect", "Http" ] + "Resolver" + [ Type.var "restriction" + , Type.var "x" + , Type.var "a" + ] + ) + ) + } + ) + [ Elm.functionReduced "stringResolverUnpack" stringResolverArg_ ] + + +{-| {-| Just like [`request`](#request), but it creates a `Task`. +-} + +task: + { method : String + , headers : List Effect.Http.Header + , url : String + , body : Effect.Http.Body + , resolver : Effect.Http.Resolver restriction x a + , timeout : Maybe Duration.Duration + } + -> Effect.Task.Task restriction x a +-} +task : + { method : String + , headers : List Elm.Expression + , url : String + , body : Elm.Expression + , resolver : Elm.Expression + , timeout : Elm.Expression + } + -> Elm.Expression +task taskArg_ = + Elm.apply + (Elm.value + { importFrom = [ "Effect", "Http" ] + , name = "task" + , annotation = + Just + (Type.function + [ Type.record + [ ( "method", Type.string ) + , ( "headers" + , Type.list + (Type.namedWith + [ "Effect", "Http" ] + "Header" + [] + ) + ) + , ( "url", Type.string ) + , ( "body" + , Type.namedWith [ "Effect", "Http" ] "Body" [] + ) + , ( "resolver" + , Type.namedWith + [ "Effect", "Http" ] + "Resolver" + [ Type.var "restriction" + , Type.var "x" + , Type.var "a" + ] + ) + , ( "timeout" + , Type.maybe + (Type.namedWith [ "Duration" ] "Duration" [] + ) + ) + ] + ] + (Type.namedWith + [ "Effect", "Task" ] + "Task" + [ Type.var "restriction" + , Type.var "x" + , Type.var "a" + ] + ) + ) + } + ) + [ Elm.record + [ Tuple.pair "method" (Elm.string taskArg_.method) + , Tuple.pair "headers" (Elm.list taskArg_.headers) + , Tuple.pair "url" (Elm.string taskArg_.url) + , Tuple.pair "body" taskArg_.body + , Tuple.pair "resolver" taskArg_.resolver + , Tuple.pair "timeout" taskArg_.timeout + ] + ] + + +{-| {-| Expect the response body to be whatever. +-} + +expectWhatever: (Result.Result Effect.Http.Error () -> msg) -> Effect.Http.Expect msg +-} +expectWhatever : (Elm.Expression -> Elm.Expression) -> Elm.Expression +expectWhatever expectWhateverArg_ = + Elm.apply + (Elm.value + { importFrom = [ "Effect", "Http" ] + , name = "expectWhatever" + , annotation = + Just + (Type.function + [ Type.function + [ Type.namedWith + [ "Result" ] + "Result" + [ Type.namedWith + [ "Effect", "Http" ] + "Error" + [] + , Type.unit + ] + ] + (Type.var "msg") + ] + (Type.namedWith + [ "Effect", "Http" ] + "Expect" + [ Type.var "msg" ] + ) + ) + } + ) + [ Elm.functionReduced "expectWhateverUnpack" expectWhateverArg_ ] + + +{-| {-| Expect the response body to be binary data. For example, maybe you are +talking to an endpoint that gives back ProtoBuf data: + + import Bytes.Decode as Bytes + import Http + + type Msg + = GotData (Result Http.Error Data) + + getData : Cmd Msg + getData = + Http.get + { url = "/data" + , expect = Http.expectBytes GotData dataDecoder + } + + -- dataDecoder : Bytes.Decoder Data + +You would use [`elm/bytes`](/packages/elm/bytes/latest/) to decode the binary +data according to a proto definition file like `example.proto`. + +If the decoder fails, you get a `BadBody` error that just indicates that +_something_ went wrong. It probably makes sense to debug by peeking at the +bytes you are getting in the browser developer tools or something. + +-} + +expectBytes: + (Result.Result Effect.Http.Error a -> msg) + -> Bytes.Decode.Decoder a + -> Effect.Http.Expect msg +-} +expectBytes : + (Elm.Expression -> Elm.Expression) -> Elm.Expression -> Elm.Expression +expectBytes expectBytesArg_ expectBytesArg_0 = + Elm.apply + (Elm.value + { importFrom = [ "Effect", "Http" ] + , name = "expectBytes" + , annotation = + Just + (Type.function + [ Type.function + [ Type.namedWith + [ "Result" ] + "Result" + [ Type.namedWith + [ "Effect", "Http" ] + "Error" + [] + , Type.var "a" + ] + ] + (Type.var "msg") + , Type.namedWith + [ "Bytes", "Decode" ] + "Decoder" + [ Type.var "a" ] + ] + (Type.namedWith + [ "Effect", "Http" ] + "Expect" + [ Type.var "msg" ] + ) + ) + } + ) + [ Elm.functionReduced "expectBytesUnpack" expectBytesArg_ + , expectBytesArg_0 + ] + + +{-| {-| Expect the response body to be JSON. +-} + +expectJson: + (Result.Result Effect.Http.Error a -> msg) + -> Json.Decode.Decoder a + -> Effect.Http.Expect msg +-} +expectJson : + (Elm.Expression -> Elm.Expression) -> Elm.Expression -> Elm.Expression +expectJson expectJsonArg_ expectJsonArg_0 = + Elm.apply + (Elm.value + { importFrom = [ "Effect", "Http" ] + , name = "expectJson" + , annotation = + Just + (Type.function + [ Type.function + [ Type.namedWith + [ "Result" ] + "Result" + [ Type.namedWith + [ "Effect", "Http" ] + "Error" + [] + , Type.var "a" + ] + ] + (Type.var "msg") + , Type.namedWith + [ "Json", "Decode" ] + "Decoder" + [ Type.var "a" ] + ] + (Type.namedWith + [ "Effect", "Http" ] + "Expect" + [ Type.var "msg" ] + ) + ) + } + ) + [ Elm.functionReduced "expectJsonUnpack" expectJsonArg_ + , expectJsonArg_0 + ] + + +{-| {-| Expect a [`Response`](#Response) with a `Bytes` body. + +It works just like [`expectStringResponse`](#expectStringResponse), giving you +more access to headers and more leeway in defining your own errors. + +-} + +expectBytesResponse: + (Result.Result x a -> msg) + -> (Effect.Http.Response Bytes.Bytes -> Result.Result x a) + -> Effect.Http.Expect msg +-} +expectBytesResponse : + (Elm.Expression -> Elm.Expression) + -> (Elm.Expression -> Elm.Expression) + -> Elm.Expression +expectBytesResponse expectBytesResponseArg_ expectBytesResponseArg_0 = + Elm.apply + (Elm.value + { importFrom = [ "Effect", "Http" ] + , name = "expectBytesResponse" + , annotation = + Just + (Type.function + [ Type.function + [ Type.namedWith + [ "Result" ] + "Result" + [ Type.var "x", Type.var "a" ] + ] + (Type.var "msg") + , Type.function + [ Type.namedWith + [ "Effect", "Http" ] + "Response" + [ Type.namedWith [ "Bytes" ] "Bytes" [] ] + ] + (Type.namedWith + [ "Result" ] + "Result" + [ Type.var "x", Type.var "a" ] + ) + ] + (Type.namedWith + [ "Effect", "Http" ] + "Expect" + [ Type.var "msg" ] + ) + ) + } + ) + [ Elm.functionReduced + "expectBytesResponseUnpack" + expectBytesResponseArg_ + , Elm.functionReduced + "expectBytesResponseUnpack" + expectBytesResponseArg_0 + ] + + +{-| {-| Expect a Response with a String body. +-} + +expectStringResponse: + (Result.Result x a -> msg) + -> (Effect.Http.Response String -> Result.Result x a) + -> Effect.Http.Expect msg +-} +expectStringResponse : + (Elm.Expression -> Elm.Expression) + -> (Elm.Expression -> Elm.Expression) + -> Elm.Expression +expectStringResponse expectStringResponseArg_ expectStringResponseArg_0 = + Elm.apply + (Elm.value + { importFrom = [ "Effect", "Http" ] + , name = "expectStringResponse" + , annotation = + Just + (Type.function + [ Type.function + [ Type.namedWith + [ "Result" ] + "Result" + [ Type.var "x", Type.var "a" ] + ] + (Type.var "msg") + , Type.function + [ Type.namedWith + [ "Effect", "Http" ] + "Response" + [ Type.string ] + ] + (Type.namedWith + [ "Result" ] + "Result" + [ Type.var "x", Type.var "a" ] + ) + ] + (Type.namedWith + [ "Effect", "Http" ] + "Expect" + [ Type.var "msg" ] + ) + ) + } + ) + [ Elm.functionReduced + "expectStringResponseUnpack" + expectStringResponseArg_ + , Elm.functionReduced + "expectStringResponseUnpack" + expectStringResponseArg_0 + ] + + +{-| {-| Expect the response body to be a `String`. +-} + +expectString: (Result.Result Effect.Http.Error String -> msg) -> Effect.Http.Expect msg +-} +expectString : (Elm.Expression -> Elm.Expression) -> Elm.Expression +expectString expectStringArg_ = + Elm.apply + (Elm.value + { importFrom = [ "Effect", "Http" ] + , name = "expectString" + , annotation = + Just + (Type.function + [ Type.function + [ Type.namedWith + [ "Result" ] + "Result" + [ Type.namedWith + [ "Effect", "Http" ] + "Error" + [] + , Type.string + ] + ] + (Type.var "msg") + ] + (Type.namedWith + [ "Effect", "Http" ] + "Expect" + [ Type.var "msg" ] + ) + ) + } + ) + [ Elm.functionReduced "expectStringUnpack" expectStringArg_ ] + + +{-| {-| Create a request with a risky security policy. Things like: + + - Allow responses from other domains to set cookies. + - Include cookies in requests to other domains. + +This is called [`withCredentials`][wc] in JavaScript, and it allows a couple +other risky things as well. It can be useful if `www.example.com` needs to +talk to `uploads.example.com`, but it should be used very carefully! + +For example, every HTTP request includes a `Host` header revealing the domain, +so any request to `facebook.com` reveals the website that sent it. From there, +cookies can be used to correlate browsing habits with specific users. “Oh, it +looks like they visited `example.com`. Maybe they want ads about examples!” +This is why you can get shoe ads for months without saying anything about it +on any social networks. **This risk exists even for people who do not have an +account.** Servers can set a new cookie to uniquely identify the browser and +build a profile around that. Same kind of tricks for logged out users. + +**Context:** A significantly worse version of this can happen when trying to +add integrations with Google, Facebook, Pinterest, Twitter, etc. “Add our share +button. It is super easy. Just add this ` +``` + +To get that data, you would write this in your `elm-pages` head tags: + + import Json.Encode as Encode + + {-| + -} + encodeArticle : + { title : String + , description : String + , author : StructuredDataHelper { authorMemberOf | personOrOrganization : () } authorPossibleFields + , publisher : StructuredDataHelper { publisherMemberOf | personOrOrganization : () } publisherPossibleFields + , url : String + , imageUrl : String + , datePublished : String + , mainEntityOfPage : Encode.Value + } + -> Head.Tag + encodeArticle info = + Encode.object + [ ( "@context", Encode.string "http://schema.org/" ) + , ( "@type", Encode.string "Article" ) + , ( "headline", Encode.string info.title ) + , ( "description", Encode.string info.description ) + , ( "image", Encode.string info.imageUrl ) + , ( "author", encode info.author ) + , ( "publisher", encode info.publisher ) + , ( "url", Encode.string info.url ) + , ( "datePublished", Encode.string info.datePublished ) + , ( "mainEntityOfPage", info.mainEntityOfPage ) + ] + |> Head.structuredData + +Take a look at this [Google Search Gallery](https://developers.google.com/search/docs/guides/search-gallery) +to see some examples of how structured data can be used by search engines to give rich search results. It can help boost +your rankings, get better engagement for your content, and also make your content more accessible. For example, +voice assistant devices can make use of structured data. If you're hosting a conference and want to make the event +date and location easy for attendees to find, this can make that information more accessible. + +For the current version of API, you'll need to make sure that the format is correct and contains the required and recommended +structure. + +Check out for a comprehensive listing of possible data types and fields. And take a look at +Google's [Structured Data Testing Tool](https://search.google.com/structured-data/testing-tool) +too make sure that your structured data is valid and includes the recommended values. + +In the future, `elm-pages` will likely support a typed API, but schema.org is a massive spec, and changes frequently. +And there are multiple sources of information on the possible and recommended structure. So it will take some time +for the right API design to evolve. In the meantime, this allows you to make use of this for SEO purposes. + +structuredData: Json.Encode.Value -> Head.Tag +-} +structuredData : Elm.Expression -> Elm.Expression +structuredData structuredDataArg_ = + Elm.apply + (Elm.value + { importFrom = [ "Head" ] + , name = "structuredData" + , annotation = + Just + (Type.function + [ Type.namedWith [ "Json", "Encode" ] "Value" [] ] + (Type.namedWith [ "Head" ] "Tag" []) + ) + } + ) + [ structuredDataArg_ ] + + +{-| Create an `AttributeValue` representing the current page's full url. + +currentPageFullUrl: Head.AttributeValue +-} +currentPageFullUrl : Elm.Expression +currentPageFullUrl = + Elm.value + { importFrom = [ "Head" ] + , name = "currentPageFullUrl" + , annotation = Just (Type.namedWith [ "Head" ] "AttributeValue" []) + } + + +{-| Create an `AttributeValue` from an `ImagePath`. + +urlAttribute: Pages.Url.Url -> Head.AttributeValue +-} +urlAttribute : Elm.Expression -> Elm.Expression +urlAttribute urlAttributeArg_ = + Elm.apply + (Elm.value + { importFrom = [ "Head" ] + , name = "urlAttribute" + , annotation = + Just + (Type.function + [ Type.namedWith [ "Pages", "Url" ] "Url" [] ] + (Type.namedWith [ "Head" ] "AttributeValue" []) + ) + } + ) + [ urlAttributeArg_ ] + + +{-| Create a raw `AttributeValue` (as opposed to some kind of absolute URL). + +raw: String -> Head.AttributeValue +-} +raw : String -> Elm.Expression +raw rawArg_ = + Elm.apply + (Elm.value + { importFrom = [ "Head" ] + , name = "raw" + , annotation = + Just + (Type.function + [ Type.string ] + (Type.namedWith [ "Head" ] "AttributeValue" []) + ) + } + ) + [ Elm.string rawArg_ ] + + +{-| Note: the type must be png. +See . + +If a size is provided, it will be turned into square dimensions as per the recommendations here: + +Images must be png's, and non-transparent images are recommended. Current recommended dimensions are 180px and 192px. + +appleTouchIcon: Maybe Int -> Pages.Url.Url -> Head.Tag +-} +appleTouchIcon : Elm.Expression -> Elm.Expression -> Elm.Expression +appleTouchIcon appleTouchIconArg_ appleTouchIconArg_0 = + Elm.apply + (Elm.value + { importFrom = [ "Head" ] + , name = "appleTouchIcon" + , annotation = + Just + (Type.function + [ Type.maybe Type.int + , Type.namedWith [ "Pages", "Url" ] "Url" [] + ] + (Type.namedWith [ "Head" ] "Tag" []) + ) + } + ) + [ appleTouchIconArg_, appleTouchIconArg_0 ] + + +{-| icon: List ( Int, Int ) -> MimeType.MimeImage -> Pages.Url.Url -> Head.Tag -} +icon : List Elm.Expression -> Elm.Expression -> Elm.Expression -> Elm.Expression +icon iconArg_ iconArg_0 iconArg_1 = + Elm.apply + (Elm.value + { importFrom = [ "Head" ] + , name = "icon" + , annotation = + Just + (Type.function + [ Type.list (Type.tuple Type.int Type.int) + , Type.namedWith [ "MimeType" ] "MimeImage" [] + , Type.namedWith [ "Pages", "Url" ] "Url" [] + ] + (Type.namedWith [ "Head" ] "Tag" []) + ) + } + ) + [ Elm.list iconArg_, iconArg_0, iconArg_1 ] + + +{-| Feel free to use this, but in 99% of cases you won't need it. The generated +code will run this for you to generate your `manifest.json` file automatically! + +toJson: String -> String -> Head.Tag -> Json.Encode.Value +-} +toJson : String -> String -> Elm.Expression -> Elm.Expression +toJson toJsonArg_ toJsonArg_0 toJsonArg_1 = + Elm.apply + (Elm.value + { importFrom = [ "Head" ] + , name = "toJson" + , annotation = + Just + (Type.function + [ Type.string + , Type.string + , Type.namedWith [ "Head" ] "Tag" [] + ] + (Type.namedWith [ "Json", "Encode" ] "Value" []) + ) + } + ) + [ Elm.string toJsonArg_, Elm.string toJsonArg_0, toJsonArg_1 ] + + +{-| It's recommended that you use the `Seo` module helpers, which will provide this +for you, rather than directly using this. + +Example: + + Head.canonicalLink "https://elm-pages.com" + +canonicalLink: Maybe String -> Head.Tag +-} +canonicalLink : Elm.Expression -> Elm.Expression +canonicalLink canonicalLinkArg_ = + Elm.apply + (Elm.value + { importFrom = [ "Head" ] + , name = "canonicalLink" + , annotation = + Just + (Type.function + [ Type.maybe Type.string ] + (Type.namedWith [ "Head" ] "Tag" []) + ) + } + ) + [ canonicalLinkArg_ ] + + +annotation_ : { tag : Type.Annotation, attributeValue : Type.Annotation } +annotation_ = + { tag = Type.namedWith [ "Head" ] "Tag" [] + , attributeValue = Type.namedWith [ "Head" ] "AttributeValue" [] + } + + +call_ : + { metaName : Elm.Expression -> Elm.Expression -> Elm.Expression + , metaProperty : Elm.Expression -> Elm.Expression -> Elm.Expression + , metaRedirect : Elm.Expression -> Elm.Expression + , rssLink : Elm.Expression -> Elm.Expression + , sitemapLink : Elm.Expression -> Elm.Expression + , rootLanguage : Elm.Expression -> Elm.Expression + , manifestLink : Elm.Expression -> Elm.Expression + , nonLoadingNode : Elm.Expression -> Elm.Expression -> Elm.Expression + , structuredData : Elm.Expression -> Elm.Expression + , urlAttribute : Elm.Expression -> Elm.Expression + , raw : Elm.Expression -> Elm.Expression + , appleTouchIcon : Elm.Expression -> Elm.Expression -> Elm.Expression + , icon : + Elm.Expression -> Elm.Expression -> Elm.Expression -> Elm.Expression + , toJson : + Elm.Expression -> Elm.Expression -> Elm.Expression -> Elm.Expression + , canonicalLink : Elm.Expression -> Elm.Expression + } +call_ = + { metaName = + \metaNameArg_ metaNameArg_0 -> + Elm.apply + (Elm.value + { importFrom = [ "Head" ] + , name = "metaName" + , annotation = + Just + (Type.function + [ Type.string + , Type.namedWith + [ "Head" ] + "AttributeValue" + [] + ] + (Type.namedWith [ "Head" ] "Tag" []) + ) + } + ) + [ metaNameArg_, metaNameArg_0 ] + , metaProperty = + \metaPropertyArg_ metaPropertyArg_0 -> + Elm.apply + (Elm.value + { importFrom = [ "Head" ] + , name = "metaProperty" + , annotation = + Just + (Type.function + [ Type.string + , Type.namedWith + [ "Head" ] + "AttributeValue" + [] + ] + (Type.namedWith [ "Head" ] "Tag" []) + ) + } + ) + [ metaPropertyArg_, metaPropertyArg_0 ] + , metaRedirect = + \metaRedirectArg_ -> + Elm.apply + (Elm.value + { importFrom = [ "Head" ] + , name = "metaRedirect" + , annotation = + Just + (Type.function + [ Type.namedWith + [ "Head" ] + "AttributeValue" + [] + ] + (Type.namedWith [ "Head" ] "Tag" []) + ) + } + ) + [ metaRedirectArg_ ] + , rssLink = + \rssLinkArg_ -> + Elm.apply + (Elm.value + { importFrom = [ "Head" ] + , name = "rssLink" + , annotation = + Just + (Type.function + [ Type.string ] + (Type.namedWith [ "Head" ] "Tag" []) + ) + } + ) + [ rssLinkArg_ ] + , sitemapLink = + \sitemapLinkArg_ -> + Elm.apply + (Elm.value + { importFrom = [ "Head" ] + , name = "sitemapLink" + , annotation = + Just + (Type.function + [ Type.string ] + (Type.namedWith [ "Head" ] "Tag" []) + ) + } + ) + [ sitemapLinkArg_ ] + , rootLanguage = + \rootLanguageArg_ -> + Elm.apply + (Elm.value + { importFrom = [ "Head" ] + , name = "rootLanguage" + , annotation = + Just + (Type.function + [ Type.namedWith + [ "LanguageTag" ] + "LanguageTag" + [] + ] + (Type.namedWith [ "Head" ] "Tag" []) + ) + } + ) + [ rootLanguageArg_ ] + , manifestLink = + \manifestLinkArg_ -> + Elm.apply + (Elm.value + { importFrom = [ "Head" ] + , name = "manifestLink" + , annotation = + Just + (Type.function + [ Type.string ] + (Type.namedWith [ "Head" ] "Tag" []) + ) + } + ) + [ manifestLinkArg_ ] + , nonLoadingNode = + \nonLoadingNodeArg_ nonLoadingNodeArg_0 -> + Elm.apply + (Elm.value + { importFrom = [ "Head" ] + , name = "nonLoadingNode" + , annotation = + Just + (Type.function + [ Type.string + , Type.list + (Type.tuple + Type.string + (Type.namedWith + [ "Head" ] + "AttributeValue" + [] + ) + ) + ] + (Type.namedWith [ "Head" ] "Tag" []) + ) + } + ) + [ nonLoadingNodeArg_, nonLoadingNodeArg_0 ] + , structuredData = + \structuredDataArg_ -> + Elm.apply + (Elm.value + { importFrom = [ "Head" ] + , name = "structuredData" + , annotation = + Just + (Type.function + [ Type.namedWith + [ "Json", "Encode" ] + "Value" + [] + ] + (Type.namedWith [ "Head" ] "Tag" []) + ) + } + ) + [ structuredDataArg_ ] + , urlAttribute = + \urlAttributeArg_ -> + Elm.apply + (Elm.value + { importFrom = [ "Head" ] + , name = "urlAttribute" + , annotation = + Just + (Type.function + [ Type.namedWith [ "Pages", "Url" ] "Url" [] ] + (Type.namedWith [ "Head" ] "AttributeValue" [] + ) + ) + } + ) + [ urlAttributeArg_ ] + , raw = + \rawArg_ -> + Elm.apply + (Elm.value + { importFrom = [ "Head" ] + , name = "raw" + , annotation = + Just + (Type.function + [ Type.string ] + (Type.namedWith [ "Head" ] "AttributeValue" [] + ) + ) + } + ) + [ rawArg_ ] + , appleTouchIcon = + \appleTouchIconArg_ appleTouchIconArg_0 -> + Elm.apply + (Elm.value + { importFrom = [ "Head" ] + , name = "appleTouchIcon" + , annotation = + Just + (Type.function + [ Type.maybe Type.int + , Type.namedWith [ "Pages", "Url" ] "Url" [] + ] + (Type.namedWith [ "Head" ] "Tag" []) + ) + } + ) + [ appleTouchIconArg_, appleTouchIconArg_0 ] + , icon = + \iconArg_ iconArg_0 iconArg_1 -> + Elm.apply + (Elm.value + { importFrom = [ "Head" ] + , name = "icon" + , annotation = + Just + (Type.function + [ Type.list (Type.tuple Type.int Type.int) + , Type.namedWith [ "MimeType" ] "MimeImage" [] + , Type.namedWith [ "Pages", "Url" ] "Url" [] + ] + (Type.namedWith [ "Head" ] "Tag" []) + ) + } + ) + [ iconArg_, iconArg_0, iconArg_1 ] + , toJson = + \toJsonArg_ toJsonArg_0 toJsonArg_1 -> + Elm.apply + (Elm.value + { importFrom = [ "Head" ] + , name = "toJson" + , annotation = + Just + (Type.function + [ Type.string + , Type.string + , Type.namedWith [ "Head" ] "Tag" [] + ] + (Type.namedWith + [ "Json", "Encode" ] + "Value" + [] + ) + ) + } + ) + [ toJsonArg_, toJsonArg_0, toJsonArg_1 ] + , canonicalLink = + \canonicalLinkArg_ -> + Elm.apply + (Elm.value + { importFrom = [ "Head" ] + , name = "canonicalLink" + , annotation = + Just + (Type.function + [ Type.maybe Type.string ] + (Type.namedWith [ "Head" ] "Tag" []) + ) + } + ) + [ canonicalLinkArg_ ] + } + + +values_ : + { metaName : Elm.Expression + , metaProperty : Elm.Expression + , metaRedirect : Elm.Expression + , rssLink : Elm.Expression + , sitemapLink : Elm.Expression + , rootLanguage : Elm.Expression + , manifestLink : Elm.Expression + , nonLoadingNode : Elm.Expression + , structuredData : Elm.Expression + , currentPageFullUrl : Elm.Expression + , urlAttribute : Elm.Expression + , raw : Elm.Expression + , appleTouchIcon : Elm.Expression + , icon : Elm.Expression + , toJson : Elm.Expression + , canonicalLink : Elm.Expression + } +values_ = + { metaName = + Elm.value + { importFrom = [ "Head" ] + , name = "metaName" + , annotation = + Just + (Type.function + [ Type.string + , Type.namedWith [ "Head" ] "AttributeValue" [] + ] + (Type.namedWith [ "Head" ] "Tag" []) + ) + } + , metaProperty = + Elm.value + { importFrom = [ "Head" ] + , name = "metaProperty" + , annotation = + Just + (Type.function + [ Type.string + , Type.namedWith [ "Head" ] "AttributeValue" [] + ] + (Type.namedWith [ "Head" ] "Tag" []) + ) + } + , metaRedirect = + Elm.value + { importFrom = [ "Head" ] + , name = "metaRedirect" + , annotation = + Just + (Type.function + [ Type.namedWith [ "Head" ] "AttributeValue" [] ] + (Type.namedWith [ "Head" ] "Tag" []) + ) + } + , rssLink = + Elm.value + { importFrom = [ "Head" ] + , name = "rssLink" + , annotation = + Just + (Type.function + [ Type.string ] + (Type.namedWith [ "Head" ] "Tag" []) + ) + } + , sitemapLink = + Elm.value + { importFrom = [ "Head" ] + , name = "sitemapLink" + , annotation = + Just + (Type.function + [ Type.string ] + (Type.namedWith [ "Head" ] "Tag" []) + ) + } + , rootLanguage = + Elm.value + { importFrom = [ "Head" ] + , name = "rootLanguage" + , annotation = + Just + (Type.function + [ Type.namedWith [ "LanguageTag" ] "LanguageTag" [] ] + (Type.namedWith [ "Head" ] "Tag" []) + ) + } + , manifestLink = + Elm.value + { importFrom = [ "Head" ] + , name = "manifestLink" + , annotation = + Just + (Type.function + [ Type.string ] + (Type.namedWith [ "Head" ] "Tag" []) + ) + } + , nonLoadingNode = + Elm.value + { importFrom = [ "Head" ] + , name = "nonLoadingNode" + , annotation = + Just + (Type.function + [ Type.string + , Type.list + (Type.tuple + Type.string + (Type.namedWith [ "Head" ] "AttributeValue" []) + ) + ] + (Type.namedWith [ "Head" ] "Tag" []) + ) + } + , structuredData = + Elm.value + { importFrom = [ "Head" ] + , name = "structuredData" + , annotation = + Just + (Type.function + [ Type.namedWith [ "Json", "Encode" ] "Value" [] ] + (Type.namedWith [ "Head" ] "Tag" []) + ) + } + , currentPageFullUrl = + Elm.value + { importFrom = [ "Head" ] + , name = "currentPageFullUrl" + , annotation = Just (Type.namedWith [ "Head" ] "AttributeValue" []) + } + , urlAttribute = + Elm.value + { importFrom = [ "Head" ] + , name = "urlAttribute" + , annotation = + Just + (Type.function + [ Type.namedWith [ "Pages", "Url" ] "Url" [] ] + (Type.namedWith [ "Head" ] "AttributeValue" []) + ) + } + , raw = + Elm.value + { importFrom = [ "Head" ] + , name = "raw" + , annotation = + Just + (Type.function + [ Type.string ] + (Type.namedWith [ "Head" ] "AttributeValue" []) + ) + } + , appleTouchIcon = + Elm.value + { importFrom = [ "Head" ] + , name = "appleTouchIcon" + , annotation = + Just + (Type.function + [ Type.maybe Type.int + , Type.namedWith [ "Pages", "Url" ] "Url" [] + ] + (Type.namedWith [ "Head" ] "Tag" []) + ) + } + , icon = + Elm.value + { importFrom = [ "Head" ] + , name = "icon" + , annotation = + Just + (Type.function + [ Type.list (Type.tuple Type.int Type.int) + , Type.namedWith [ "MimeType" ] "MimeImage" [] + , Type.namedWith [ "Pages", "Url" ] "Url" [] + ] + (Type.namedWith [ "Head" ] "Tag" []) + ) + } + , toJson = + Elm.value + { importFrom = [ "Head" ] + , name = "toJson" + , annotation = + Just + (Type.function + [ Type.string + , Type.string + , Type.namedWith [ "Head" ] "Tag" [] + ] + (Type.namedWith [ "Json", "Encode" ] "Value" []) + ) + } + , canonicalLink = + Elm.value + { importFrom = [ "Head" ] + , name = "canonicalLink" + , annotation = + Just + (Type.function + [ Type.maybe Type.string ] + (Type.namedWith [ "Head" ] "Tag" []) + ) + } + } \ No newline at end of file diff --git a/elm-open-api-codegen/src/Gen/Head/Seo.elm b/elm-open-api-codegen/src/Gen/Head/Seo.elm new file mode 100644 index 00000000..cbe3e71a --- /dev/null +++ b/elm-open-api-codegen/src/Gen/Head/Seo.elm @@ -0,0 +1,1278 @@ +module Gen.Head.Seo exposing + ( moduleName_, article, audioPlayer, book, profile, song + , summary, summaryLarge, videoPlayer, website, annotation_, make_, call_ + , values_ + ) + +{-| +# Generated bindings for Head.Seo + +@docs moduleName_, article, audioPlayer, book, profile, song +@docs summary, summaryLarge, videoPlayer, website, annotation_, make_ +@docs call_, values_ +-} + + +import Elm +import Elm.Annotation as Type + + +{-| The name of this module. -} +moduleName_ : List String +moduleName_ = + [ "Head", "Seo" ] + + +{-| See + +article: + { tags : List String + , section : Maybe String + , publishedTime : Maybe DateOrDateTime.DateOrDateTime + , modifiedTime : Maybe DateOrDateTime.DateOrDateTime + , expirationTime : Maybe DateOrDateTime.DateOrDateTime + } + -> Head.Seo.Common + -> List Head.Tag +-} +article : + { tags : List String + , section : Elm.Expression + , publishedTime : Elm.Expression + , modifiedTime : Elm.Expression + , expirationTime : Elm.Expression + } + -> Elm.Expression + -> Elm.Expression +article articleArg_ articleArg_0 = + Elm.apply + (Elm.value + { importFrom = [ "Head", "Seo" ] + , name = "article" + , annotation = + Just + (Type.function + [ Type.record + [ ( "tags", Type.list Type.string ) + , ( "section", Type.maybe Type.string ) + , ( "publishedTime" + , Type.maybe + (Type.namedWith + [ "DateOrDateTime" ] + "DateOrDateTime" + [] + ) + ) + , ( "modifiedTime" + , Type.maybe + (Type.namedWith + [ "DateOrDateTime" ] + "DateOrDateTime" + [] + ) + ) + , ( "expirationTime" + , Type.maybe + (Type.namedWith + [ "DateOrDateTime" ] + "DateOrDateTime" + [] + ) + ) + ] + , Type.namedWith [ "Head", "Seo" ] "Common" [] + ] + (Type.list (Type.namedWith [ "Head" ] "Tag" [])) + ) + } + ) + [ Elm.record + [ Tuple.pair + "tags" + (Elm.list (List.map Elm.string articleArg_.tags)) + , Tuple.pair "section" articleArg_.section + , Tuple.pair "publishedTime" articleArg_.publishedTime + , Tuple.pair "modifiedTime" articleArg_.modifiedTime + , Tuple.pair "expirationTime" articleArg_.expirationTime + ] + , articleArg_0 + ] + + +{-| Will be displayed as a Player card in twitter +See: + +OpenGraph audio will also be included. +The options will also be used to build up the appropriate OpenGraph `` tags. + +audioPlayer: + { canonicalUrlOverride : Maybe String + , siteName : String + , image : Head.Seo.Image + , description : String + , title : String + , audio : Head.Seo.Audio + , locale : Maybe Head.Seo.Locale + } + -> Head.Seo.Common +-} +audioPlayer : + { canonicalUrlOverride : Elm.Expression + , siteName : String + , image : Elm.Expression + , description : String + , title : String + , audio : Elm.Expression + , locale : Elm.Expression + } + -> Elm.Expression +audioPlayer audioPlayerArg_ = + Elm.apply + (Elm.value + { importFrom = [ "Head", "Seo" ] + , name = "audioPlayer" + , annotation = + Just + (Type.function + [ Type.record + [ ( "canonicalUrlOverride" + , Type.maybe Type.string + ) + , ( "siteName", Type.string ) + , ( "image" + , Type.namedWith [ "Head", "Seo" ] "Image" [] + ) + , ( "description", Type.string ) + , ( "title", Type.string ) + , ( "audio" + , Type.namedWith [ "Head", "Seo" ] "Audio" [] + ) + , ( "locale" + , Type.maybe + (Type.namedWith + [ "Head", "Seo" ] + "Locale" + [] + ) + ) + ] + ] + (Type.namedWith [ "Head", "Seo" ] "Common" []) + ) + } + ) + [ Elm.record + [ Tuple.pair + "canonicalUrlOverride" + audioPlayerArg_.canonicalUrlOverride + , Tuple.pair "siteName" (Elm.string audioPlayerArg_.siteName) + , Tuple.pair "image" audioPlayerArg_.image + , Tuple.pair "description" (Elm.string audioPlayerArg_.description) + , Tuple.pair "title" (Elm.string audioPlayerArg_.title) + , Tuple.pair "audio" audioPlayerArg_.audio + , Tuple.pair "locale" audioPlayerArg_.locale + ] + ] + + +{-| See + +book: + Head.Seo.Common + -> { tags : List String + , isbn : Maybe String + , releaseDate : Maybe DateOrDateTime.DateOrDateTime + } + -> List Head.Tag +-} +book : + Elm.Expression + -> { tags : List String + , isbn : Elm.Expression + , releaseDate : Elm.Expression + } + -> Elm.Expression +book bookArg_ bookArg_0 = + Elm.apply + (Elm.value + { importFrom = [ "Head", "Seo" ] + , name = "book" + , annotation = + Just + (Type.function + [ Type.namedWith [ "Head", "Seo" ] "Common" [] + , Type.record + [ ( "tags", Type.list Type.string ) + , ( "isbn", Type.maybe Type.string ) + , ( "releaseDate" + , Type.maybe + (Type.namedWith + [ "DateOrDateTime" ] + "DateOrDateTime" + [] + ) + ) + ] + ] + (Type.list (Type.namedWith [ "Head" ] "Tag" [])) + ) + } + ) + [ bookArg_ + , Elm.record + [ Tuple.pair "tags" (Elm.list (List.map Elm.string bookArg_0.tags)) + , Tuple.pair "isbn" bookArg_0.isbn + , Tuple.pair "releaseDate" bookArg_0.releaseDate + ] + ] + + +{-| See + +profile: + { firstName : String, lastName : String, username : Maybe String } + -> Head.Seo.Common + -> List Head.Tag +-} +profile : + { firstName : String, lastName : String, username : Elm.Expression } + -> Elm.Expression + -> Elm.Expression +profile profileArg_ profileArg_0 = + Elm.apply + (Elm.value + { importFrom = [ "Head", "Seo" ] + , name = "profile" + , annotation = + Just + (Type.function + [ Type.record + [ ( "firstName", Type.string ) + , ( "lastName", Type.string ) + , ( "username", Type.maybe Type.string ) + ] + , Type.namedWith [ "Head", "Seo" ] "Common" [] + ] + (Type.list (Type.namedWith [ "Head" ] "Tag" [])) + ) + } + ) + [ Elm.record + [ Tuple.pair "firstName" (Elm.string profileArg_.firstName) + , Tuple.pair "lastName" (Elm.string profileArg_.lastName) + , Tuple.pair "username" profileArg_.username + ] + , profileArg_0 + ] + + +{-| See + +song: + Head.Seo.Common + -> { duration : Maybe Int + , album : Maybe Int + , disc : Maybe Int + , track : Maybe Int + } + -> List Head.Tag +-} +song : + Elm.Expression + -> { duration : Elm.Expression + , album : Elm.Expression + , disc : Elm.Expression + , track : Elm.Expression + } + -> Elm.Expression +song songArg_ songArg_0 = + Elm.apply + (Elm.value + { importFrom = [ "Head", "Seo" ] + , name = "song" + , annotation = + Just + (Type.function + [ Type.namedWith [ "Head", "Seo" ] "Common" [] + , Type.record + [ ( "duration", Type.maybe Type.int ) + , ( "album", Type.maybe Type.int ) + , ( "disc", Type.maybe Type.int ) + , ( "track", Type.maybe Type.int ) + ] + ] + (Type.list (Type.namedWith [ "Head" ] "Tag" [])) + ) + } + ) + [ songArg_ + , Elm.record + [ Tuple.pair "duration" songArg_0.duration + , Tuple.pair "album" songArg_0.album + , Tuple.pair "disc" songArg_0.disc + , Tuple.pair "track" songArg_0.track + ] + ] + + +{-| Will be displayed as a large card in twitter +See: + +The options will also be used to build up the appropriate OpenGraph `` tags. + +Note: You cannot include audio or video tags with summaries. +If you want one of those, use `audioPlayer` or `videoPlayer` + +summary: + { canonicalUrlOverride : Maybe String + , siteName : String + , image : Head.Seo.Image + , description : String + , title : String + , locale : Maybe Head.Seo.Locale + } + -> Head.Seo.Common +-} +summary : + { canonicalUrlOverride : Elm.Expression + , siteName : String + , image : Elm.Expression + , description : String + , title : String + , locale : Elm.Expression + } + -> Elm.Expression +summary summaryArg_ = + Elm.apply + (Elm.value + { importFrom = [ "Head", "Seo" ] + , name = "summary" + , annotation = + Just + (Type.function + [ Type.record + [ ( "canonicalUrlOverride" + , Type.maybe Type.string + ) + , ( "siteName", Type.string ) + , ( "image" + , Type.namedWith [ "Head", "Seo" ] "Image" [] + ) + , ( "description", Type.string ) + , ( "title", Type.string ) + , ( "locale" + , Type.maybe + (Type.namedWith + [ "Head", "Seo" ] + "Locale" + [] + ) + ) + ] + ] + (Type.namedWith [ "Head", "Seo" ] "Common" []) + ) + } + ) + [ Elm.record + [ Tuple.pair "canonicalUrlOverride" summaryArg_.canonicalUrlOverride + , Tuple.pair "siteName" (Elm.string summaryArg_.siteName) + , Tuple.pair "image" summaryArg_.image + , Tuple.pair "description" (Elm.string summaryArg_.description) + , Tuple.pair "title" (Elm.string summaryArg_.title) + , Tuple.pair "locale" summaryArg_.locale + ] + ] + + +{-| Will be displayed as a large card in twitter +See: + +The options will also be used to build up the appropriate OpenGraph `` tags. + +Note: You cannot include audio or video tags with summaries. +If you want one of those, use `audioPlayer` or `videoPlayer` + +summaryLarge: + { canonicalUrlOverride : Maybe String + , siteName : String + , image : Head.Seo.Image + , description : String + , title : String + , locale : Maybe Head.Seo.Locale + } + -> Head.Seo.Common +-} +summaryLarge : + { canonicalUrlOverride : Elm.Expression + , siteName : String + , image : Elm.Expression + , description : String + , title : String + , locale : Elm.Expression + } + -> Elm.Expression +summaryLarge summaryLargeArg_ = + Elm.apply + (Elm.value + { importFrom = [ "Head", "Seo" ] + , name = "summaryLarge" + , annotation = + Just + (Type.function + [ Type.record + [ ( "canonicalUrlOverride" + , Type.maybe Type.string + ) + , ( "siteName", Type.string ) + , ( "image" + , Type.namedWith [ "Head", "Seo" ] "Image" [] + ) + , ( "description", Type.string ) + , ( "title", Type.string ) + , ( "locale" + , Type.maybe + (Type.namedWith + [ "Head", "Seo" ] + "Locale" + [] + ) + ) + ] + ] + (Type.namedWith [ "Head", "Seo" ] "Common" []) + ) + } + ) + [ Elm.record + [ Tuple.pair + "canonicalUrlOverride" + summaryLargeArg_.canonicalUrlOverride + , Tuple.pair "siteName" (Elm.string summaryLargeArg_.siteName) + , Tuple.pair "image" summaryLargeArg_.image + , Tuple.pair "description" (Elm.string summaryLargeArg_.description) + , Tuple.pair "title" (Elm.string summaryLargeArg_.title) + , Tuple.pair "locale" summaryLargeArg_.locale + ] + ] + + +{-| Will be displayed as a Player card in twitter +See: + +OpenGraph video will also be included. +The options will also be used to build up the appropriate OpenGraph `` tags. + +videoPlayer: + { canonicalUrlOverride : Maybe String + , siteName : String + , image : Head.Seo.Image + , description : String + , title : String + , video : Head.Seo.Video + , locale : Maybe Head.Seo.Locale + } + -> Head.Seo.Common +-} +videoPlayer : + { canonicalUrlOverride : Elm.Expression + , siteName : String + , image : Elm.Expression + , description : String + , title : String + , video : Elm.Expression + , locale : Elm.Expression + } + -> Elm.Expression +videoPlayer videoPlayerArg_ = + Elm.apply + (Elm.value + { importFrom = [ "Head", "Seo" ] + , name = "videoPlayer" + , annotation = + Just + (Type.function + [ Type.record + [ ( "canonicalUrlOverride" + , Type.maybe Type.string + ) + , ( "siteName", Type.string ) + , ( "image" + , Type.namedWith [ "Head", "Seo" ] "Image" [] + ) + , ( "description", Type.string ) + , ( "title", Type.string ) + , ( "video" + , Type.namedWith [ "Head", "Seo" ] "Video" [] + ) + , ( "locale" + , Type.maybe + (Type.namedWith + [ "Head", "Seo" ] + "Locale" + [] + ) + ) + ] + ] + (Type.namedWith [ "Head", "Seo" ] "Common" []) + ) + } + ) + [ Elm.record + [ Tuple.pair + "canonicalUrlOverride" + videoPlayerArg_.canonicalUrlOverride + , Tuple.pair "siteName" (Elm.string videoPlayerArg_.siteName) + , Tuple.pair "image" videoPlayerArg_.image + , Tuple.pair "description" (Elm.string videoPlayerArg_.description) + , Tuple.pair "title" (Elm.string videoPlayerArg_.title) + , Tuple.pair "video" videoPlayerArg_.video + , Tuple.pair "locale" videoPlayerArg_.locale + ] + ] + + +{-| + +website: Head.Seo.Common -> List Head.Tag +-} +website : Elm.Expression -> Elm.Expression +website websiteArg_ = + Elm.apply + (Elm.value + { importFrom = [ "Head", "Seo" ] + , name = "website" + , annotation = + Just + (Type.function + [ Type.namedWith [ "Head", "Seo" ] "Common" [] ] + (Type.list (Type.namedWith [ "Head" ] "Tag" [])) + ) + } + ) + [ websiteArg_ ] + + +annotation_ : { common : Type.Annotation, image : Type.Annotation } +annotation_ = + { common = + Type.alias + moduleName_ + "Common" + [] + (Type.record + [ ( "title", Type.string ) + , ( "image", Type.namedWith [ "Head", "Seo" ] "Image" [] ) + , ( "canonicalUrlOverride", Type.maybe Type.string ) + , ( "description", Type.string ) + , ( "siteName", Type.string ) + , ( "audio" + , Type.maybe (Type.namedWith [ "Head", "Seo" ] "Audio" []) + ) + , ( "video" + , Type.maybe (Type.namedWith [ "Head", "Seo" ] "Video" []) + ) + , ( "locale" + , Type.maybe (Type.namedWith [ "Head", "Seo" ] "Locale" []) + ) + , ( "alternateLocales" + , Type.list (Type.namedWith [ "Head", "Seo" ] "Locale" []) + ) + , ( "twitterCard" + , Type.namedWith [ "Head", "Twitter" ] "TwitterCard" [] + ) + ] + ) + , image = + Type.alias + moduleName_ + "Image" + [] + (Type.record + [ ( "url", Type.namedWith [ "Pages", "Url" ] "Url" [] ) + , ( "alt", Type.string ) + , ( "dimensions" + , Type.maybe + (Type.record + [ ( "width", Type.int ), ( "height", Type.int ) ] + ) + ) + , ( "mimeType" + , Type.maybe (Type.namedWith [ "MimeType" ] "MimeType" []) + ) + ] + ) + } + + +make_ : + { common : + { title : Elm.Expression + , image : Elm.Expression + , canonicalUrlOverride : Elm.Expression + , description : Elm.Expression + , siteName : Elm.Expression + , audio : Elm.Expression + , video : Elm.Expression + , locale : Elm.Expression + , alternateLocales : Elm.Expression + , twitterCard : Elm.Expression + } + -> Elm.Expression + , image : + { url : Elm.Expression + , alt : Elm.Expression + , dimensions : Elm.Expression + , mimeType : Elm.Expression + } + -> Elm.Expression + } +make_ = + { common = + \common_args -> + Elm.withType + (Type.alias + [ "Head", "Seo" ] + "Common" + [] + (Type.record + [ ( "title", Type.string ) + , ( "image" + , Type.namedWith [ "Head", "Seo" ] "Image" [] + ) + , ( "canonicalUrlOverride", Type.maybe Type.string ) + , ( "description", Type.string ) + , ( "siteName", Type.string ) + , ( "audio" + , Type.maybe + (Type.namedWith [ "Head", "Seo" ] "Audio" []) + ) + , ( "video" + , Type.maybe + (Type.namedWith [ "Head", "Seo" ] "Video" []) + ) + , ( "locale" + , Type.maybe + (Type.namedWith [ "Head", "Seo" ] "Locale" []) + ) + , ( "alternateLocales" + , Type.list + (Type.namedWith [ "Head", "Seo" ] "Locale" []) + ) + , ( "twitterCard" + , Type.namedWith + [ "Head", "Twitter" ] + "TwitterCard" + [] + ) + ] + ) + ) + (Elm.record + [ Tuple.pair "title" common_args.title + , Tuple.pair "image" common_args.image + , Tuple.pair + "canonicalUrlOverride" + common_args.canonicalUrlOverride + , Tuple.pair "description" common_args.description + , Tuple.pair "siteName" common_args.siteName + , Tuple.pair "audio" common_args.audio + , Tuple.pair "video" common_args.video + , Tuple.pair "locale" common_args.locale + , Tuple.pair + "alternateLocales" + common_args.alternateLocales + , Tuple.pair "twitterCard" common_args.twitterCard + ] + ) + , image = + \image_args -> + Elm.withType + (Type.alias + [ "Head", "Seo" ] + "Image" + [] + (Type.record + [ ( "url" + , Type.namedWith [ "Pages", "Url" ] "Url" [] + ) + , ( "alt", Type.string ) + , ( "dimensions" + , Type.maybe + (Type.record + [ ( "width", Type.int ) + , ( "height", Type.int ) + ] + ) + ) + , ( "mimeType" + , Type.maybe + (Type.namedWith [ "MimeType" ] "MimeType" []) + ) + ] + ) + ) + (Elm.record + [ Tuple.pair "url" image_args.url + , Tuple.pair "alt" image_args.alt + , Tuple.pair "dimensions" image_args.dimensions + , Tuple.pair "mimeType" image_args.mimeType + ] + ) + } + + +call_ : + { article : Elm.Expression -> Elm.Expression -> Elm.Expression + , audioPlayer : Elm.Expression -> Elm.Expression + , book : Elm.Expression -> Elm.Expression -> Elm.Expression + , profile : Elm.Expression -> Elm.Expression -> Elm.Expression + , song : Elm.Expression -> Elm.Expression -> Elm.Expression + , summary : Elm.Expression -> Elm.Expression + , summaryLarge : Elm.Expression -> Elm.Expression + , videoPlayer : Elm.Expression -> Elm.Expression + , website : Elm.Expression -> Elm.Expression + } +call_ = + { article = + \articleArg_ articleArg_0 -> + Elm.apply + (Elm.value + { importFrom = [ "Head", "Seo" ] + , name = "article" + , annotation = + Just + (Type.function + [ Type.record + [ ( "tags", Type.list Type.string ) + , ( "section", Type.maybe Type.string ) + , ( "publishedTime" + , Type.maybe + (Type.namedWith + [ "DateOrDateTime" ] + "DateOrDateTime" + [] + ) + ) + , ( "modifiedTime" + , Type.maybe + (Type.namedWith + [ "DateOrDateTime" ] + "DateOrDateTime" + [] + ) + ) + , ( "expirationTime" + , Type.maybe + (Type.namedWith + [ "DateOrDateTime" ] + "DateOrDateTime" + [] + ) + ) + ] + , Type.namedWith [ "Head", "Seo" ] "Common" [] + ] + (Type.list + (Type.namedWith [ "Head" ] "Tag" []) + ) + ) + } + ) + [ articleArg_, articleArg_0 ] + , audioPlayer = + \audioPlayerArg_ -> + Elm.apply + (Elm.value + { importFrom = [ "Head", "Seo" ] + , name = "audioPlayer" + , annotation = + Just + (Type.function + [ Type.record + [ ( "canonicalUrlOverride" + , Type.maybe Type.string + ) + , ( "siteName", Type.string ) + , ( "image" + , Type.namedWith + [ "Head", "Seo" ] + "Image" + [] + ) + , ( "description", Type.string ) + , ( "title", Type.string ) + , ( "audio" + , Type.namedWith + [ "Head", "Seo" ] + "Audio" + [] + ) + , ( "locale" + , Type.maybe + (Type.namedWith + [ "Head", "Seo" ] + "Locale" + [] + ) + ) + ] + ] + (Type.namedWith [ "Head", "Seo" ] "Common" []) + ) + } + ) + [ audioPlayerArg_ ] + , book = + \bookArg_ bookArg_0 -> + Elm.apply + (Elm.value + { importFrom = [ "Head", "Seo" ] + , name = "book" + , annotation = + Just + (Type.function + [ Type.namedWith [ "Head", "Seo" ] "Common" [] + , Type.record + [ ( "tags", Type.list Type.string ) + , ( "isbn", Type.maybe Type.string ) + , ( "releaseDate" + , Type.maybe + (Type.namedWith + [ "DateOrDateTime" ] + "DateOrDateTime" + [] + ) + ) + ] + ] + (Type.list + (Type.namedWith [ "Head" ] "Tag" []) + ) + ) + } + ) + [ bookArg_, bookArg_0 ] + , profile = + \profileArg_ profileArg_0 -> + Elm.apply + (Elm.value + { importFrom = [ "Head", "Seo" ] + , name = "profile" + , annotation = + Just + (Type.function + [ Type.record + [ ( "firstName", Type.string ) + , ( "lastName", Type.string ) + , ( "username", Type.maybe Type.string ) + ] + , Type.namedWith [ "Head", "Seo" ] "Common" [] + ] + (Type.list + (Type.namedWith [ "Head" ] "Tag" []) + ) + ) + } + ) + [ profileArg_, profileArg_0 ] + , song = + \songArg_ songArg_0 -> + Elm.apply + (Elm.value + { importFrom = [ "Head", "Seo" ] + , name = "song" + , annotation = + Just + (Type.function + [ Type.namedWith [ "Head", "Seo" ] "Common" [] + , Type.record + [ ( "duration", Type.maybe Type.int ) + , ( "album", Type.maybe Type.int ) + , ( "disc", Type.maybe Type.int ) + , ( "track", Type.maybe Type.int ) + ] + ] + (Type.list + (Type.namedWith [ "Head" ] "Tag" []) + ) + ) + } + ) + [ songArg_, songArg_0 ] + , summary = + \summaryArg_ -> + Elm.apply + (Elm.value + { importFrom = [ "Head", "Seo" ] + , name = "summary" + , annotation = + Just + (Type.function + [ Type.record + [ ( "canonicalUrlOverride" + , Type.maybe Type.string + ) + , ( "siteName", Type.string ) + , ( "image" + , Type.namedWith + [ "Head", "Seo" ] + "Image" + [] + ) + , ( "description", Type.string ) + , ( "title", Type.string ) + , ( "locale" + , Type.maybe + (Type.namedWith + [ "Head", "Seo" ] + "Locale" + [] + ) + ) + ] + ] + (Type.namedWith [ "Head", "Seo" ] "Common" []) + ) + } + ) + [ summaryArg_ ] + , summaryLarge = + \summaryLargeArg_ -> + Elm.apply + (Elm.value + { importFrom = [ "Head", "Seo" ] + , name = "summaryLarge" + , annotation = + Just + (Type.function + [ Type.record + [ ( "canonicalUrlOverride" + , Type.maybe Type.string + ) + , ( "siteName", Type.string ) + , ( "image" + , Type.namedWith + [ "Head", "Seo" ] + "Image" + [] + ) + , ( "description", Type.string ) + , ( "title", Type.string ) + , ( "locale" + , Type.maybe + (Type.namedWith + [ "Head", "Seo" ] + "Locale" + [] + ) + ) + ] + ] + (Type.namedWith [ "Head", "Seo" ] "Common" []) + ) + } + ) + [ summaryLargeArg_ ] + , videoPlayer = + \videoPlayerArg_ -> + Elm.apply + (Elm.value + { importFrom = [ "Head", "Seo" ] + , name = "videoPlayer" + , annotation = + Just + (Type.function + [ Type.record + [ ( "canonicalUrlOverride" + , Type.maybe Type.string + ) + , ( "siteName", Type.string ) + , ( "image" + , Type.namedWith + [ "Head", "Seo" ] + "Image" + [] + ) + , ( "description", Type.string ) + , ( "title", Type.string ) + , ( "video" + , Type.namedWith + [ "Head", "Seo" ] + "Video" + [] + ) + , ( "locale" + , Type.maybe + (Type.namedWith + [ "Head", "Seo" ] + "Locale" + [] + ) + ) + ] + ] + (Type.namedWith [ "Head", "Seo" ] "Common" []) + ) + } + ) + [ videoPlayerArg_ ] + , website = + \websiteArg_ -> + Elm.apply + (Elm.value + { importFrom = [ "Head", "Seo" ] + , name = "website" + , annotation = + Just + (Type.function + [ Type.namedWith [ "Head", "Seo" ] "Common" [] + ] + (Type.list + (Type.namedWith [ "Head" ] "Tag" []) + ) + ) + } + ) + [ websiteArg_ ] + } + + +values_ : + { article : Elm.Expression + , audioPlayer : Elm.Expression + , book : Elm.Expression + , profile : Elm.Expression + , song : Elm.Expression + , summary : Elm.Expression + , summaryLarge : Elm.Expression + , videoPlayer : Elm.Expression + , website : Elm.Expression + } +values_ = + { article = + Elm.value + { importFrom = [ "Head", "Seo" ] + , name = "article" + , annotation = + Just + (Type.function + [ Type.record + [ ( "tags", Type.list Type.string ) + , ( "section", Type.maybe Type.string ) + , ( "publishedTime" + , Type.maybe + (Type.namedWith + [ "DateOrDateTime" ] + "DateOrDateTime" + [] + ) + ) + , ( "modifiedTime" + , Type.maybe + (Type.namedWith + [ "DateOrDateTime" ] + "DateOrDateTime" + [] + ) + ) + , ( "expirationTime" + , Type.maybe + (Type.namedWith + [ "DateOrDateTime" ] + "DateOrDateTime" + [] + ) + ) + ] + , Type.namedWith [ "Head", "Seo" ] "Common" [] + ] + (Type.list (Type.namedWith [ "Head" ] "Tag" [])) + ) + } + , audioPlayer = + Elm.value + { importFrom = [ "Head", "Seo" ] + , name = "audioPlayer" + , annotation = + Just + (Type.function + [ Type.record + [ ( "canonicalUrlOverride" + , Type.maybe Type.string + ) + , ( "siteName", Type.string ) + , ( "image" + , Type.namedWith [ "Head", "Seo" ] "Image" [] + ) + , ( "description", Type.string ) + , ( "title", Type.string ) + , ( "audio" + , Type.namedWith [ "Head", "Seo" ] "Audio" [] + ) + , ( "locale" + , Type.maybe + (Type.namedWith [ "Head", "Seo" ] "Locale" [] + ) + ) + ] + ] + (Type.namedWith [ "Head", "Seo" ] "Common" []) + ) + } + , book = + Elm.value + { importFrom = [ "Head", "Seo" ] + , name = "book" + , annotation = + Just + (Type.function + [ Type.namedWith [ "Head", "Seo" ] "Common" [] + , Type.record + [ ( "tags", Type.list Type.string ) + , ( "isbn", Type.maybe Type.string ) + , ( "releaseDate" + , Type.maybe + (Type.namedWith + [ "DateOrDateTime" ] + "DateOrDateTime" + [] + ) + ) + ] + ] + (Type.list (Type.namedWith [ "Head" ] "Tag" [])) + ) + } + , profile = + Elm.value + { importFrom = [ "Head", "Seo" ] + , name = "profile" + , annotation = + Just + (Type.function + [ Type.record + [ ( "firstName", Type.string ) + , ( "lastName", Type.string ) + , ( "username", Type.maybe Type.string ) + ] + , Type.namedWith [ "Head", "Seo" ] "Common" [] + ] + (Type.list (Type.namedWith [ "Head" ] "Tag" [])) + ) + } + , song = + Elm.value + { importFrom = [ "Head", "Seo" ] + , name = "song" + , annotation = + Just + (Type.function + [ Type.namedWith [ "Head", "Seo" ] "Common" [] + , Type.record + [ ( "duration", Type.maybe Type.int ) + , ( "album", Type.maybe Type.int ) + , ( "disc", Type.maybe Type.int ) + , ( "track", Type.maybe Type.int ) + ] + ] + (Type.list (Type.namedWith [ "Head" ] "Tag" [])) + ) + } + , summary = + Elm.value + { importFrom = [ "Head", "Seo" ] + , name = "summary" + , annotation = + Just + (Type.function + [ Type.record + [ ( "canonicalUrlOverride" + , Type.maybe Type.string + ) + , ( "siteName", Type.string ) + , ( "image" + , Type.namedWith [ "Head", "Seo" ] "Image" [] + ) + , ( "description", Type.string ) + , ( "title", Type.string ) + , ( "locale" + , Type.maybe + (Type.namedWith [ "Head", "Seo" ] "Locale" [] + ) + ) + ] + ] + (Type.namedWith [ "Head", "Seo" ] "Common" []) + ) + } + , summaryLarge = + Elm.value + { importFrom = [ "Head", "Seo" ] + , name = "summaryLarge" + , annotation = + Just + (Type.function + [ Type.record + [ ( "canonicalUrlOverride" + , Type.maybe Type.string + ) + , ( "siteName", Type.string ) + , ( "image" + , Type.namedWith [ "Head", "Seo" ] "Image" [] + ) + , ( "description", Type.string ) + , ( "title", Type.string ) + , ( "locale" + , Type.maybe + (Type.namedWith [ "Head", "Seo" ] "Locale" [] + ) + ) + ] + ] + (Type.namedWith [ "Head", "Seo" ] "Common" []) + ) + } + , videoPlayer = + Elm.value + { importFrom = [ "Head", "Seo" ] + , name = "videoPlayer" + , annotation = + Just + (Type.function + [ Type.record + [ ( "canonicalUrlOverride" + , Type.maybe Type.string + ) + , ( "siteName", Type.string ) + , ( "image" + , Type.namedWith [ "Head", "Seo" ] "Image" [] + ) + , ( "description", Type.string ) + , ( "title", Type.string ) + , ( "video" + , Type.namedWith [ "Head", "Seo" ] "Video" [] + ) + , ( "locale" + , Type.maybe + (Type.namedWith [ "Head", "Seo" ] "Locale" [] + ) + ) + ] + ] + (Type.namedWith [ "Head", "Seo" ] "Common" []) + ) + } + , website = + Elm.value + { importFrom = [ "Head", "Seo" ] + , name = "website" + , annotation = + Just + (Type.function + [ Type.namedWith [ "Head", "Seo" ] "Common" [] ] + (Type.list (Type.namedWith [ "Head" ] "Tag" [])) + ) + } + } \ No newline at end of file diff --git a/elm-open-api-codegen/src/Gen/Http.elm b/elm-open-api-codegen/src/Gen/Http.elm new file mode 100644 index 00000000..3b31a825 --- /dev/null +++ b/elm-open-api-codegen/src/Gen/Http.elm @@ -0,0 +1,2996 @@ +module Gen.Http exposing + ( moduleName_, get, post, request, header, emptyBody + , stringBody, jsonBody, fileBody, bytesBody, multipartBody, stringPart, filePart + , bytesPart, expectString, expectJson, expectBytes, expectWhatever, track, fractionSent + , fractionReceived, cancel, riskyRequest, expectStringResponse, expectBytesResponse, task, stringResolver + , bytesResolver, riskyTask, annotation_, make_, caseOf_, call_, values_ + ) + +{-| +# Generated bindings for Http + +@docs moduleName_, get, post, request, header, emptyBody +@docs stringBody, jsonBody, fileBody, bytesBody, multipartBody, stringPart +@docs filePart, bytesPart, expectString, expectJson, expectBytes, expectWhatever +@docs track, fractionSent, fractionReceived, cancel, riskyRequest, expectStringResponse +@docs expectBytesResponse, task, stringResolver, bytesResolver, riskyTask, annotation_ +@docs make_, caseOf_, call_, values_ +-} + + +import Elm +import Elm.Annotation as Type +import Elm.Arg +import Elm.Case + + +{-| The name of this module. -} +moduleName_ : List String +moduleName_ = + [ "Http" ] + + +{-| Create a `GET` request. + + import Http + + type Msg + = GotText (Result Http.Error String) + + getPublicOpinion : Cmd Msg + getPublicOpinion = + Http.get + { url = "https://elm-lang.org/assets/public-opinion.txt" + , expect = Http.expectString GotText + } + +You can use functions like [`expectString`](#expectString) and +[`expectJson`](#expectJson) to interpret the response in different ways. In +this example, we are expecting the response body to be a `String` containing +the full text of _Public Opinion_ by Walter Lippmann. + +**Note:** Use [`elm/url`](/packages/elm/url/latest) to build reliable URLs. + +get: { url : String, expect : Http.Expect msg } -> Platform.Cmd.Cmd msg +-} +get : { url : String, expect : Elm.Expression } -> Elm.Expression +get getArg_ = + Elm.apply + (Elm.value + { importFrom = [ "Http" ] + , name = "get" + , annotation = + Just + (Type.function + [ Type.record + [ ( "url", Type.string ) + , ( "expect" + , Type.namedWith + [ "Http" ] + "Expect" + [ Type.var "msg" ] + ) + ] + ] + (Type.namedWith [] "Cmd" [ Type.var "msg" ]) + ) + } + ) + [ Elm.record + [ Tuple.pair "url" (Elm.string getArg_.url) + , Tuple.pair "expect" getArg_.expect + ] + ] + + +{-| Create a `POST` request. So imagine we want to send a POST request for +some JSON data. It might look like this: + + import Http + import Json.Decode exposing (list, string) + + type Msg + = GotBooks (Result Http.Error (List String)) + + postBooks : Cmd Msg + postBooks = + Http.post + { url = "https://example.com/books" + , body = Http.emptyBody + , expect = Http.expectJson GotBooks (list string) + } + +Notice that we are using [`expectJson`](#expectJson) to interpret the response +as JSON. You can learn more about how JSON decoders work [here][] in the guide. + +We did not put anything in the body of our request, but you can use functions +like [`stringBody`](#stringBody) and [`jsonBody`](#jsonBody) if you need to +send information to the server. + +[here]: https://guide.elm-lang.org/interop/json.html + +post: + { url : String, body : Http.Body, expect : Http.Expect msg } + -> Platform.Cmd.Cmd msg +-} +post : + { url : String, body : Elm.Expression, expect : Elm.Expression } + -> Elm.Expression +post postArg_ = + Elm.apply + (Elm.value + { importFrom = [ "Http" ] + , name = "post" + , annotation = + Just + (Type.function + [ Type.record + [ ( "url", Type.string ) + , ( "body", Type.namedWith [ "Http" ] "Body" [] ) + , ( "expect" + , Type.namedWith + [ "Http" ] + "Expect" + [ Type.var "msg" ] + ) + ] + ] + (Type.namedWith [] "Cmd" [ Type.var "msg" ]) + ) + } + ) + [ Elm.record + [ Tuple.pair "url" (Elm.string postArg_.url) + , Tuple.pair "body" postArg_.body + , Tuple.pair "expect" postArg_.expect + ] + ] + + +{-| Create a custom request. For example, a PUT for files might look like this: + + import File + import Http + + type Msg = Uploaded (Result Http.Error ()) + + upload : File.File -> Cmd Msg + upload file = + Http.request + { method = "PUT" + , headers = [] + , url = "https://example.com/publish" + , body = Http.fileBody file + , expect = Http.expectWhatever Uploaded + , timeout = Nothing + , tracker = Nothing + } + +It lets you set custom `headers` as needed. The `timeout` is the number of +milliseconds you are willing to wait before giving up. The `tracker` lets you +[`cancel`](#cancel) and [`track`](#track) requests. + +request: + { method : String + , headers : List Http.Header + , url : String + , body : Http.Body + , expect : Http.Expect msg + , timeout : Maybe Float + , tracker : Maybe String + } + -> Platform.Cmd.Cmd msg +-} +request : + { method : String + , headers : List Elm.Expression + , url : String + , body : Elm.Expression + , expect : Elm.Expression + , timeout : Elm.Expression + , tracker : Elm.Expression + } + -> Elm.Expression +request requestArg_ = + Elm.apply + (Elm.value + { importFrom = [ "Http" ] + , name = "request" + , annotation = + Just + (Type.function + [ Type.record + [ ( "method", Type.string ) + , ( "headers" + , Type.list + (Type.namedWith [ "Http" ] "Header" []) + ) + , ( "url", Type.string ) + , ( "body", Type.namedWith [ "Http" ] "Body" [] ) + , ( "expect" + , Type.namedWith + [ "Http" ] + "Expect" + [ Type.var "msg" ] + ) + , ( "timeout", Type.maybe Type.float ) + , ( "tracker", Type.maybe Type.string ) + ] + ] + (Type.namedWith [] "Cmd" [ Type.var "msg" ]) + ) + } + ) + [ Elm.record + [ Tuple.pair "method" (Elm.string requestArg_.method) + , Tuple.pair "headers" (Elm.list requestArg_.headers) + , Tuple.pair "url" (Elm.string requestArg_.url) + , Tuple.pair "body" requestArg_.body + , Tuple.pair "expect" requestArg_.expect + , Tuple.pair "timeout" requestArg_.timeout + , Tuple.pair "tracker" requestArg_.tracker + ] + ] + + +{-| Create a `Header`. + + header "If-Modified-Since" "Sat 29 Oct 1994 19:43:31 GMT" + header "Max-Forwards" "10" + header "X-Requested-With" "XMLHttpRequest" + +header: String -> String -> Http.Header +-} +header : String -> String -> Elm.Expression +header headerArg_ headerArg_0 = + Elm.apply + (Elm.value + { importFrom = [ "Http" ] + , name = "header" + , annotation = + Just + (Type.function + [ Type.string, Type.string ] + (Type.namedWith [ "Http" ] "Header" []) + ) + } + ) + [ Elm.string headerArg_, Elm.string headerArg_0 ] + + +{-| Create an empty body for your `Request`. This is useful for GET requests +and POST requests where you are not sending any data. + +emptyBody: Http.Body +-} +emptyBody : Elm.Expression +emptyBody = + Elm.value + { importFrom = [ "Http" ] + , name = "emptyBody" + , annotation = Just (Type.namedWith [ "Http" ] "Body" []) + } + + +{-| Put some string in the body of your `Request`. Defining `jsonBody` looks +like this: + + import Json.Encode as Encode + + jsonBody : Encode.Value -> Body + jsonBody value = + stringBody "application/json" (Encode.encode 0 value) + +The first argument is a [MIME type](https://en.wikipedia.org/wiki/Media_type) +of the body. Some servers are strict about this! + +stringBody: String -> String -> Http.Body +-} +stringBody : String -> String -> Elm.Expression +stringBody stringBodyArg_ stringBodyArg_0 = + Elm.apply + (Elm.value + { importFrom = [ "Http" ] + , name = "stringBody" + , annotation = + Just + (Type.function + [ Type.string, Type.string ] + (Type.namedWith [ "Http" ] "Body" []) + ) + } + ) + [ Elm.string stringBodyArg_, Elm.string stringBodyArg_0 ] + + +{-| Put some JSON value in the body of your `Request`. This will automatically +add the `Content-Type: application/json` header. + +jsonBody: Json.Encode.Value -> Http.Body +-} +jsonBody : Elm.Expression -> Elm.Expression +jsonBody jsonBodyArg_ = + Elm.apply + (Elm.value + { importFrom = [ "Http" ] + , name = "jsonBody" + , annotation = + Just + (Type.function + [ Type.namedWith [ "Json", "Encode" ] "Value" [] ] + (Type.namedWith [ "Http" ] "Body" []) + ) + } + ) + [ jsonBodyArg_ ] + + +{-| Use a file as the body of your `Request`. When someone uploads an image +into the browser with [`elm/file`](/packages/elm/file/latest) you can forward +it to a server. + +This will automatically set the `Content-Type` to the MIME type of the file. + +**Note:** Use [`track`](#track) to track upload progress. + +fileBody: File.File -> Http.Body +-} +fileBody : Elm.Expression -> Elm.Expression +fileBody fileBodyArg_ = + Elm.apply + (Elm.value + { importFrom = [ "Http" ] + , name = "fileBody" + , annotation = + Just + (Type.function + [ Type.namedWith [ "File" ] "File" [] ] + (Type.namedWith [ "Http" ] "Body" []) + ) + } + ) + [ fileBodyArg_ ] + + +{-| Put some `Bytes` in the body of your `Request`. This allows you to use +[`elm/bytes`](/packages/elm/bytes/latest) to have full control over the binary +representation of the data you are sending. For example, you could create an +`archive.zip` file and send it along like this: + + import Bytes exposing (Bytes) + + zipBody : Bytes -> Body + zipBody bytes = + bytesBody "application/zip" bytes + +The first argument is a [MIME type](https://en.wikipedia.org/wiki/Media_type) +of the body. In other scenarios you may want to use MIME types like `image/png` +or `image/jpeg` instead. + +**Note:** Use [`track`](#track) to track upload progress. + +bytesBody: String -> Bytes.Bytes -> Http.Body +-} +bytesBody : String -> Elm.Expression -> Elm.Expression +bytesBody bytesBodyArg_ bytesBodyArg_0 = + Elm.apply + (Elm.value + { importFrom = [ "Http" ] + , name = "bytesBody" + , annotation = + Just + (Type.function + [ Type.string, Type.namedWith [ "Bytes" ] "Bytes" [] ] + (Type.namedWith [ "Http" ] "Body" []) + ) + } + ) + [ Elm.string bytesBodyArg_, bytesBodyArg_0 ] + + +{-| When someone clicks submit on the `
`, browsers send a special HTTP +request with all the form data. Something like this: + +``` +POST /test.html HTTP/1.1 +Host: example.org +Content-Type: multipart/form-data;boundary="7MA4YWxkTrZu0gW" + +--7MA4YWxkTrZu0gW +Content-Disposition: form-data; name="title" + +Trip to London +--7MA4YWxkTrZu0gW +Content-Disposition: form-data; name="album[]"; filename="parliment.jpg" + +...RAW...IMAGE...BITS... +--7MA4YWxkTrZu0gW-- +``` + +This was the only way to send files for a long time, so many servers expect +data in this format. **The `multipartBody` function lets you create these +requests.** For example, to upload a photo album all at once, you could create +a body like this: + + multipartBody + [ stringPart "title" "Trip to London" + , filePart "album[]" file1 + , filePart "album[]" file2 + , filePart "album[]" file3 + ] + +All of the body parts need to have a name. Names can be repeated. Adding the +`[]` on repeated names is a convention from PHP. It seems weird, but I see it +enough to mention it. You do not have to do it that way, especially if your +server uses some other convention! + +The `Content-Type: multipart/form-data` header is automatically set when +creating a body this way. + +**Note:** Use [`track`](#track) to track upload progress. + +multipartBody: List Http.Part -> Http.Body +-} +multipartBody : List Elm.Expression -> Elm.Expression +multipartBody multipartBodyArg_ = + Elm.apply + (Elm.value + { importFrom = [ "Http" ] + , name = "multipartBody" + , annotation = + Just + (Type.function + [ Type.list (Type.namedWith [ "Http" ] "Part" []) ] + (Type.namedWith [ "Http" ] "Body" []) + ) + } + ) + [ Elm.list multipartBodyArg_ ] + + +{-| A part that contains `String` data. + + multipartBody + [ stringPart "title" "Tom" + , filePart "photo" tomPng + ] + +stringPart: String -> String -> Http.Part +-} +stringPart : String -> String -> Elm.Expression +stringPart stringPartArg_ stringPartArg_0 = + Elm.apply + (Elm.value + { importFrom = [ "Http" ] + , name = "stringPart" + , annotation = + Just + (Type.function + [ Type.string, Type.string ] + (Type.namedWith [ "Http" ] "Part" []) + ) + } + ) + [ Elm.string stringPartArg_, Elm.string stringPartArg_0 ] + + +{-| A part that contains a file. You can use +[`elm/file`](/packages/elm/file/latest) to get files loaded into the +browser. From there, you can send it along to a server like this: + + multipartBody + [ stringPart "product" "Ikea Bekant" + , stringPart "description" "Great desk for home office." + , filePart "image[]" file1 + , filePart "image[]" file2 + , filePart "image[]" file3 + ] + +filePart: String -> File.File -> Http.Part +-} +filePart : String -> Elm.Expression -> Elm.Expression +filePart filePartArg_ filePartArg_0 = + Elm.apply + (Elm.value + { importFrom = [ "Http" ] + , name = "filePart" + , annotation = + Just + (Type.function + [ Type.string, Type.namedWith [ "File" ] "File" [] ] + (Type.namedWith [ "Http" ] "Part" []) + ) + } + ) + [ Elm.string filePartArg_, filePartArg_0 ] + + +{-| A part that contains bytes, allowing you to use +[`elm/bytes`](/packages/elm/bytes/latest) to encode data exactly in the format +you need. + + multipartBody + [ stringPart "title" "Tom" + , bytesPart "photo" "image/png" bytes + ] + +**Note:** You must provide a MIME type so that the receiver has clues about +how to interpret the bytes. + +bytesPart: String -> String -> Bytes.Bytes -> Http.Part +-} +bytesPart : String -> String -> Elm.Expression -> Elm.Expression +bytesPart bytesPartArg_ bytesPartArg_0 bytesPartArg_1 = + Elm.apply + (Elm.value + { importFrom = [ "Http" ] + , name = "bytesPart" + , annotation = + Just + (Type.function + [ Type.string + , Type.string + , Type.namedWith [ "Bytes" ] "Bytes" [] + ] + (Type.namedWith [ "Http" ] "Part" []) + ) + } + ) + [ Elm.string bytesPartArg_, Elm.string bytesPartArg_0, bytesPartArg_1 ] + + +{-| Expect the response body to be a `String`. Like when getting the full text +of a book: + + import Http + + type Msg + = GotText (Result Http.Error String) + + getPublicOpinion : Cmd Msg + getPublicOpinion = + Http.get + { url = "https://elm-lang.org/assets/public-opinion.txt" + , expect = Http.expectString GotText + } + +The response body is always some sequence of bytes, but in this case, we +expect it to be UTF-8 encoded text that can be turned into a `String`. + +expectString: (Result.Result Http.Error String -> msg) -> Http.Expect msg +-} +expectString : (Elm.Expression -> Elm.Expression) -> Elm.Expression +expectString expectStringArg_ = + Elm.apply + (Elm.value + { importFrom = [ "Http" ] + , name = "expectString" + , annotation = + Just + (Type.function + [ Type.function + [ Type.namedWith + [ "Result" ] + "Result" + [ Type.namedWith [ "Http" ] "Error" [] + , Type.string + ] + ] + (Type.var "msg") + ] + (Type.namedWith [ "Http" ] "Expect" [ Type.var "msg" ] + ) + ) + } + ) + [ Elm.functionReduced "expectStringUnpack" expectStringArg_ ] + + +{-| Expect the response body to be JSON. Like if you want to get a random cat +GIF you might say: + + import Http + import Json.Decode exposing (Decoder, field, string) + + type Msg + = GotGif (Result Http.Error String) + + getRandomCatGif : Cmd Msg + getRandomCatGif = + Http.get + { url = "https://api.giphy.com/v1/gifs/random?api_key=dc6zaTOxFJmzC&tag=cat" + , expect = Http.expectJson GotGif gifDecoder + } + + gifDecoder : Decoder String + gifDecoder = + field "data" (field "image_url" string) + +The official guide goes through this particular example [here][]. That page +also introduces [`elm/json`][json] to help you get started turning JSON into +Elm values in other situations. + +[here]: https://guide.elm-lang.org/interop/json.html +[json]: /packages/elm/json/latest/ + +If the JSON decoder fails, you get a `BadBody` error that tries to explain +what went wrong. + +expectJson: (Result.Result Http.Error a -> msg) -> Json.Decode.Decoder a -> Http.Expect msg +-} +expectJson : + (Elm.Expression -> Elm.Expression) -> Elm.Expression -> Elm.Expression +expectJson expectJsonArg_ expectJsonArg_0 = + Elm.apply + (Elm.value + { importFrom = [ "Http" ] + , name = "expectJson" + , annotation = + Just + (Type.function + [ Type.function + [ Type.namedWith + [ "Result" ] + "Result" + [ Type.namedWith [ "Http" ] "Error" [] + , Type.var "a" + ] + ] + (Type.var "msg") + , Type.namedWith + [ "Json", "Decode" ] + "Decoder" + [ Type.var "a" ] + ] + (Type.namedWith [ "Http" ] "Expect" [ Type.var "msg" ] + ) + ) + } + ) + [ Elm.functionReduced "expectJsonUnpack" expectJsonArg_ + , expectJsonArg_0 + ] + + +{-| Expect the response body to be binary data. For example, maybe you are +talking to an endpoint that gives back ProtoBuf data: + + import Bytes.Decode as Bytes + import Http + + type Msg + = GotData (Result Http.Error Data) + + getData : Cmd Msg + getData = + Http.get + { url = "/data" + , expect = Http.expectBytes GotData dataDecoder + } + + -- dataDecoder : Bytes.Decoder Data + +You would use [`elm/bytes`](/packages/elm/bytes/latest/) to decode the binary +data according to a proto definition file like `example.proto`. + +If the decoder fails, you get a `BadBody` error that just indicates that +_something_ went wrong. It probably makes sense to debug by peeking at the +bytes you are getting in the browser developer tools or something. + +expectBytes: (Result.Result Http.Error a -> msg) -> Bytes.Decode.Decoder a -> Http.Expect msg +-} +expectBytes : + (Elm.Expression -> Elm.Expression) -> Elm.Expression -> Elm.Expression +expectBytes expectBytesArg_ expectBytesArg_0 = + Elm.apply + (Elm.value + { importFrom = [ "Http" ] + , name = "expectBytes" + , annotation = + Just + (Type.function + [ Type.function + [ Type.namedWith + [ "Result" ] + "Result" + [ Type.namedWith [ "Http" ] "Error" [] + , Type.var "a" + ] + ] + (Type.var "msg") + , Type.namedWith + [ "Bytes", "Decode" ] + "Decoder" + [ Type.var "a" ] + ] + (Type.namedWith [ "Http" ] "Expect" [ Type.var "msg" ] + ) + ) + } + ) + [ Elm.functionReduced "expectBytesUnpack" expectBytesArg_ + , expectBytesArg_0 + ] + + +{-| Expect the response body to be whatever. It does not matter. Ignore it! +For example, you might want this when uploading files: + + import Http + + type Msg + = Uploaded (Result Http.Error ()) + + upload : File -> Cmd Msg + upload file = + Http.post + { url = "/upload" + , body = Http.fileBody file + , expect = Http.expectWhatever Uploaded + } + +The server may be giving back a response body, but we do not care about it. + +expectWhatever: (Result.Result Http.Error () -> msg) -> Http.Expect msg +-} +expectWhatever : (Elm.Expression -> Elm.Expression) -> Elm.Expression +expectWhatever expectWhateverArg_ = + Elm.apply + (Elm.value + { importFrom = [ "Http" ] + , name = "expectWhatever" + , annotation = + Just + (Type.function + [ Type.function + [ Type.namedWith + [ "Result" ] + "Result" + [ Type.namedWith [ "Http" ] "Error" [] + , Type.unit + ] + ] + (Type.var "msg") + ] + (Type.namedWith [ "Http" ] "Expect" [ Type.var "msg" ] + ) + ) + } + ) + [ Elm.functionReduced "expectWhateverUnpack" expectWhateverArg_ ] + + +{-| Track the progress of a request. Create a [`request`](#request) where +`tracker = Just "form.pdf"` and you can track it with a subscription like +`track "form.pdf" GotProgress`. + +track: String -> (Http.Progress -> msg) -> Platform.Sub.Sub msg +-} +track : String -> (Elm.Expression -> Elm.Expression) -> Elm.Expression +track trackArg_ trackArg_0 = + Elm.apply + (Elm.value + { importFrom = [ "Http" ] + , name = "track" + , annotation = + Just + (Type.function + [ Type.string + , Type.function + [ Type.namedWith [ "Http" ] "Progress" [] ] + (Type.var "msg") + ] + (Type.namedWith [] "Sub" [ Type.var "msg" ]) + ) + } + ) + [ Elm.string trackArg_, Elm.functionReduced "trackUnpack" trackArg_0 ] + + +{-| Turn `Sending` progress into a useful fraction. + + fractionSent { sent = 0, size = 1024 } == 0.0 + fractionSent { sent = 256, size = 1024 } == 0.25 + fractionSent { sent = 512, size = 1024 } == 0.5 + + -- fractionSent { sent = 0, size = 0 } == 1.0 + +The result is always between `0.0` and `1.0`, ensuring that any progress bar +animations never go out of bounds. + +And notice that `size` can be zero. That means you are sending a request with +an empty body. Very common! When `size` is zero, the result is always `1.0`. + +**Note:** If you create your own function to compute this fraction, watch out +for divide-by-zero errors! + +fractionSent: { sent : Int, size : Int } -> Float +-} +fractionSent : { sent : Int, size : Int } -> Elm.Expression +fractionSent fractionSentArg_ = + Elm.apply + (Elm.value + { importFrom = [ "Http" ] + , name = "fractionSent" + , annotation = + Just + (Type.function + [ Type.record + [ ( "sent", Type.int ), ( "size", Type.int ) ] + ] + Type.float + ) + } + ) + [ Elm.record + [ Tuple.pair "sent" (Elm.int fractionSentArg_.sent) + , Tuple.pair "size" (Elm.int fractionSentArg_.size) + ] + ] + + +{-| Turn `Receiving` progress into a useful fraction for progress bars. + + fractionReceived { received = 0, size = Just 1024 } == 0.0 + fractionReceived { received = 256, size = Just 1024 } == 0.25 + fractionReceived { received = 512, size = Just 1024 } == 0.5 + + -- fractionReceived { received = 0, size = Nothing } == 0.0 + -- fractionReceived { received = 256, size = Nothing } == 0.0 + -- fractionReceived { received = 512, size = Nothing } == 0.0 + +The `size` here is based on the [`Content-Length`][cl] header which may be +missing in some cases. A server may be misconfigured or it may be streaming +data and not actually know the final size. Whatever the case, this function +will always give `0.0` when the final size is unknown. + +Furthermore, the `Content-Length` header may be incorrect! The implementation +clamps the fraction between `0.0` and `1.0`, so you will just get `1.0` if +you ever receive more bytes than promised. + +**Note:** If you are streaming something, you can write a custom version of +this function that just tracks bytes received. Maybe you show that 22kb or 83kb +have been downloaded, without a specific fraction. If you do this, be wary of +divide-by-zero errors because `size` can always be zero! + +[cl]: https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Content-Length + +fractionReceived: { received : Int, size : Maybe Int } -> Float +-} +fractionReceived : { received : Int, size : Elm.Expression } -> Elm.Expression +fractionReceived fractionReceivedArg_ = + Elm.apply + (Elm.value + { importFrom = [ "Http" ] + , name = "fractionReceived" + , annotation = + Just + (Type.function + [ Type.record + [ ( "received", Type.int ) + , ( "size", Type.maybe Type.int ) + ] + ] + Type.float + ) + } + ) + [ Elm.record + [ Tuple.pair "received" (Elm.int fractionReceivedArg_.received) + , Tuple.pair "size" fractionReceivedArg_.size + ] + ] + + +{-| Try to cancel an ongoing request based on a `tracker`. + +cancel: String -> Platform.Cmd.Cmd msg +-} +cancel : String -> Elm.Expression +cancel cancelArg_ = + Elm.apply + (Elm.value + { importFrom = [ "Http" ] + , name = "cancel" + , annotation = + Just + (Type.function + [ Type.string ] + (Type.namedWith [] "Cmd" [ Type.var "msg" ]) + ) + } + ) + [ Elm.string cancelArg_ ] + + +{-| Create a request with a risky security policy. Things like: + +- Allow responses from other domains to set cookies. +- Include cookies in requests to other domains. + +This is called [`withCredentials`][wc] in JavaScript, and it allows a couple +other risky things as well. It can be useful if `www.example.com` needs to +talk to `uploads.example.com`, but it should be used very carefully! + +For example, every HTTP request includes a `Host` header revealing the domain, +so any request to `facebook.com` reveals the website that sent it. From there, +cookies can be used to correlate browsing habits with specific users. “Oh, it +looks like they visited `example.com`. Maybe they want ads about examples!” +This is why you can get shoe ads for months without saying anything about it +on any social networks. **This risk exists even for people who do not have an +account.** Servers can set a new cookie to uniquely identify the browser and +build a profile around that. Same kind of tricks for logged out users. + +**Context:** A significantly worse version of this can happen when trying to +add integrations with Google, Facebook, Pinterest, Twitter, etc. “Add our share +button. It is super easy. Just add this ` -``` - -To get that data, you would write this in your `elm-pages` head tags: - - import Json.Encode as Encode - - {-| - -} - encodeArticle : - { title : String - , description : String - , author : StructuredDataHelper { authorMemberOf | personOrOrganization : () } authorPossibleFields - , publisher : StructuredDataHelper { publisherMemberOf | personOrOrganization : () } publisherPossibleFields - , url : String - , imageUrl : String - , datePublished : String - , mainEntityOfPage : Encode.Value - } - -> Head.Tag - encodeArticle info = - Encode.object - [ ( "@context", Encode.string "http://schema.org/" ) - , ( "@type", Encode.string "Article" ) - , ( "headline", Encode.string info.title ) - , ( "description", Encode.string info.description ) - , ( "image", Encode.string info.imageUrl ) - , ( "author", encode info.author ) - , ( "publisher", encode info.publisher ) - , ( "url", Encode.string info.url ) - , ( "datePublished", Encode.string info.datePublished ) - , ( "mainEntityOfPage", info.mainEntityOfPage ) - ] - |> Head.structuredData - -Take a look at this [Google Search Gallery](https://developers.google.com/search/docs/guides/search-gallery) -to see some examples of how structured data can be used by search engines to give rich search results. It can help boost -your rankings, get better engagement for your content, and also make your content more accessible. For example, -voice assistant devices can make use of structured data. If you're hosting a conference and want to make the event -date and location easy for attendees to find, this can make that information more accessible. - -For the current version of API, you'll need to make sure that the format is correct and contains the required and recommended -structure. - -Check out for a comprehensive listing of possible data types and fields. And take a look at -Google's [Structured Data Testing Tool](https://search.google.com/structured-data/testing-tool) -too make sure that your structured data is valid and includes the recommended values. - -In the future, `elm-pages` will likely support a typed API, but schema.org is a massive spec, and changes frequently. -And there are multiple sources of information on the possible and recommended structure. So it will take some time -for the right API design to evolve. In the meantime, this allows you to make use of this for SEO purposes. - -structuredData: Json.Encode.Value -> Head.Tag --} -structuredData : Elm.Expression -> Elm.Expression -structuredData structuredDataArg_ = - Elm.apply - (Elm.value - { importFrom = [ "Head" ] - , name = "structuredData" - , annotation = - Just - (Type.function - [ Type.namedWith [ "Json", "Encode" ] "Value" [] ] - (Type.namedWith [ "Head" ] "Tag" []) - ) - } - ) - [ structuredDataArg_ ] - - -{-| Create an `AttributeValue` representing the current page's full url. - -currentPageFullUrl: Head.AttributeValue --} -currentPageFullUrl : Elm.Expression -currentPageFullUrl = - Elm.value - { importFrom = [ "Head" ] - , name = "currentPageFullUrl" - , annotation = Just (Type.namedWith [ "Head" ] "AttributeValue" []) - } - - -{-| Create an `AttributeValue` from an `ImagePath`. - -urlAttribute: Pages.Url.Url -> Head.AttributeValue --} -urlAttribute : Elm.Expression -> Elm.Expression -urlAttribute urlAttributeArg_ = - Elm.apply - (Elm.value - { importFrom = [ "Head" ] - , name = "urlAttribute" - , annotation = - Just - (Type.function - [ Type.namedWith [ "Pages", "Url" ] "Url" [] ] - (Type.namedWith [ "Head" ] "AttributeValue" []) - ) - } - ) - [ urlAttributeArg_ ] - - -{-| Create a raw `AttributeValue` (as opposed to some kind of absolute URL). - -raw: String -> Head.AttributeValue --} -raw : String -> Elm.Expression -raw rawArg_ = - Elm.apply - (Elm.value - { importFrom = [ "Head" ] - , name = "raw" - , annotation = - Just - (Type.function - [ Type.string ] - (Type.namedWith [ "Head" ] "AttributeValue" []) - ) - } - ) - [ Elm.string rawArg_ ] - - -{-| Note: the type must be png. -See . - -If a size is provided, it will be turned into square dimensions as per the recommendations here: - -Images must be png's, and non-transparent images are recommended. Current recommended dimensions are 180px and 192px. - -appleTouchIcon: Maybe Int -> Pages.Url.Url -> Head.Tag --} -appleTouchIcon : Elm.Expression -> Elm.Expression -> Elm.Expression -appleTouchIcon appleTouchIconArg_ appleTouchIconArg_0 = - Elm.apply - (Elm.value - { importFrom = [ "Head" ] - , name = "appleTouchIcon" - , annotation = - Just - (Type.function - [ Type.maybe Type.int - , Type.namedWith [ "Pages", "Url" ] "Url" [] - ] - (Type.namedWith [ "Head" ] "Tag" []) - ) - } - ) - [ appleTouchIconArg_, appleTouchIconArg_0 ] - - -{-| icon: List ( Int, Int ) -> MimeType.MimeImage -> Pages.Url.Url -> Head.Tag -} -icon : List Elm.Expression -> Elm.Expression -> Elm.Expression -> Elm.Expression -icon iconArg_ iconArg_0 iconArg_1 = - Elm.apply - (Elm.value - { importFrom = [ "Head" ] - , name = "icon" - , annotation = - Just - (Type.function - [ Type.list (Type.tuple Type.int Type.int) - , Type.namedWith [ "MimeType" ] "MimeImage" [] - , Type.namedWith [ "Pages", "Url" ] "Url" [] - ] - (Type.namedWith [ "Head" ] "Tag" []) - ) - } - ) - [ Elm.list iconArg_, iconArg_0, iconArg_1 ] - - -{-| Feel free to use this, but in 99% of cases you won't need it. The generated -code will run this for you to generate your `manifest.json` file automatically! - -toJson: String -> String -> Head.Tag -> Json.Encode.Value --} -toJson : String -> String -> Elm.Expression -> Elm.Expression -toJson toJsonArg_ toJsonArg_0 toJsonArg_1 = - Elm.apply - (Elm.value - { importFrom = [ "Head" ] - , name = "toJson" - , annotation = - Just - (Type.function - [ Type.string - , Type.string - , Type.namedWith [ "Head" ] "Tag" [] - ] - (Type.namedWith [ "Json", "Encode" ] "Value" []) - ) - } - ) - [ Elm.string toJsonArg_, Elm.string toJsonArg_0, toJsonArg_1 ] - - -{-| It's recommended that you use the `Seo` module helpers, which will provide this -for you, rather than directly using this. - -Example: - - Head.canonicalLink "https://elm-pages.com" - -canonicalLink: Maybe String -> Head.Tag --} -canonicalLink : Elm.Expression -> Elm.Expression -canonicalLink canonicalLinkArg_ = - Elm.apply - (Elm.value - { importFrom = [ "Head" ] - , name = "canonicalLink" - , annotation = - Just - (Type.function - [ Type.maybe Type.string ] - (Type.namedWith [ "Head" ] "Tag" []) - ) - } - ) - [ canonicalLinkArg_ ] - - -annotation_ : { tag : Type.Annotation, attributeValue : Type.Annotation } -annotation_ = - { tag = Type.namedWith [ "Head" ] "Tag" [] - , attributeValue = Type.namedWith [ "Head" ] "AttributeValue" [] - } - - -call_ : - { metaName : Elm.Expression -> Elm.Expression -> Elm.Expression - , metaProperty : Elm.Expression -> Elm.Expression -> Elm.Expression - , metaRedirect : Elm.Expression -> Elm.Expression - , rssLink : Elm.Expression -> Elm.Expression - , sitemapLink : Elm.Expression -> Elm.Expression - , rootLanguage : Elm.Expression -> Elm.Expression - , manifestLink : Elm.Expression -> Elm.Expression - , nonLoadingNode : Elm.Expression -> Elm.Expression -> Elm.Expression - , structuredData : Elm.Expression -> Elm.Expression - , urlAttribute : Elm.Expression -> Elm.Expression - , raw : Elm.Expression -> Elm.Expression - , appleTouchIcon : Elm.Expression -> Elm.Expression -> Elm.Expression - , icon : - Elm.Expression -> Elm.Expression -> Elm.Expression -> Elm.Expression - , toJson : - Elm.Expression -> Elm.Expression -> Elm.Expression -> Elm.Expression - , canonicalLink : Elm.Expression -> Elm.Expression - } -call_ = - { metaName = - \metaNameArg_ metaNameArg_0 -> - Elm.apply - (Elm.value - { importFrom = [ "Head" ] - , name = "metaName" - , annotation = - Just - (Type.function - [ Type.string - , Type.namedWith - [ "Head" ] - "AttributeValue" - [] - ] - (Type.namedWith [ "Head" ] "Tag" []) - ) - } - ) - [ metaNameArg_, metaNameArg_0 ] - , metaProperty = - \metaPropertyArg_ metaPropertyArg_0 -> - Elm.apply - (Elm.value - { importFrom = [ "Head" ] - , name = "metaProperty" - , annotation = - Just - (Type.function - [ Type.string - , Type.namedWith - [ "Head" ] - "AttributeValue" - [] - ] - (Type.namedWith [ "Head" ] "Tag" []) - ) - } - ) - [ metaPropertyArg_, metaPropertyArg_0 ] - , metaRedirect = - \metaRedirectArg_ -> - Elm.apply - (Elm.value - { importFrom = [ "Head" ] - , name = "metaRedirect" - , annotation = - Just - (Type.function - [ Type.namedWith - [ "Head" ] - "AttributeValue" - [] - ] - (Type.namedWith [ "Head" ] "Tag" []) - ) - } - ) - [ metaRedirectArg_ ] - , rssLink = - \rssLinkArg_ -> - Elm.apply - (Elm.value - { importFrom = [ "Head" ] - , name = "rssLink" - , annotation = - Just - (Type.function - [ Type.string ] - (Type.namedWith [ "Head" ] "Tag" []) - ) - } - ) - [ rssLinkArg_ ] - , sitemapLink = - \sitemapLinkArg_ -> - Elm.apply - (Elm.value - { importFrom = [ "Head" ] - , name = "sitemapLink" - , annotation = - Just - (Type.function - [ Type.string ] - (Type.namedWith [ "Head" ] "Tag" []) - ) - } - ) - [ sitemapLinkArg_ ] - , rootLanguage = - \rootLanguageArg_ -> - Elm.apply - (Elm.value - { importFrom = [ "Head" ] - , name = "rootLanguage" - , annotation = - Just - (Type.function - [ Type.namedWith - [ "LanguageTag" ] - "LanguageTag" - [] - ] - (Type.namedWith [ "Head" ] "Tag" []) - ) - } - ) - [ rootLanguageArg_ ] - , manifestLink = - \manifestLinkArg_ -> - Elm.apply - (Elm.value - { importFrom = [ "Head" ] - , name = "manifestLink" - , annotation = - Just - (Type.function - [ Type.string ] - (Type.namedWith [ "Head" ] "Tag" []) - ) - } - ) - [ manifestLinkArg_ ] - , nonLoadingNode = - \nonLoadingNodeArg_ nonLoadingNodeArg_0 -> - Elm.apply - (Elm.value - { importFrom = [ "Head" ] - , name = "nonLoadingNode" - , annotation = - Just - (Type.function - [ Type.string - , Type.list - (Type.tuple - Type.string - (Type.namedWith - [ "Head" ] - "AttributeValue" - [] - ) - ) - ] - (Type.namedWith [ "Head" ] "Tag" []) - ) - } - ) - [ nonLoadingNodeArg_, nonLoadingNodeArg_0 ] - , structuredData = - \structuredDataArg_ -> - Elm.apply - (Elm.value - { importFrom = [ "Head" ] - , name = "structuredData" - , annotation = - Just - (Type.function - [ Type.namedWith - [ "Json", "Encode" ] - "Value" - [] - ] - (Type.namedWith [ "Head" ] "Tag" []) - ) - } - ) - [ structuredDataArg_ ] - , urlAttribute = - \urlAttributeArg_ -> - Elm.apply - (Elm.value - { importFrom = [ "Head" ] - , name = "urlAttribute" - , annotation = - Just - (Type.function - [ Type.namedWith [ "Pages", "Url" ] "Url" [] ] - (Type.namedWith [ "Head" ] "AttributeValue" [] - ) - ) - } - ) - [ urlAttributeArg_ ] - , raw = - \rawArg_ -> - Elm.apply - (Elm.value - { importFrom = [ "Head" ] - , name = "raw" - , annotation = - Just - (Type.function - [ Type.string ] - (Type.namedWith [ "Head" ] "AttributeValue" [] - ) - ) - } - ) - [ rawArg_ ] - , appleTouchIcon = - \appleTouchIconArg_ appleTouchIconArg_0 -> - Elm.apply - (Elm.value - { importFrom = [ "Head" ] - , name = "appleTouchIcon" - , annotation = - Just - (Type.function - [ Type.maybe Type.int - , Type.namedWith [ "Pages", "Url" ] "Url" [] - ] - (Type.namedWith [ "Head" ] "Tag" []) - ) - } - ) - [ appleTouchIconArg_, appleTouchIconArg_0 ] - , icon = - \iconArg_ iconArg_0 iconArg_1 -> - Elm.apply - (Elm.value - { importFrom = [ "Head" ] - , name = "icon" - , annotation = - Just - (Type.function - [ Type.list (Type.tuple Type.int Type.int) - , Type.namedWith [ "MimeType" ] "MimeImage" [] - , Type.namedWith [ "Pages", "Url" ] "Url" [] - ] - (Type.namedWith [ "Head" ] "Tag" []) - ) - } - ) - [ iconArg_, iconArg_0, iconArg_1 ] - , toJson = - \toJsonArg_ toJsonArg_0 toJsonArg_1 -> - Elm.apply - (Elm.value - { importFrom = [ "Head" ] - , name = "toJson" - , annotation = - Just - (Type.function - [ Type.string - , Type.string - , Type.namedWith [ "Head" ] "Tag" [] - ] - (Type.namedWith - [ "Json", "Encode" ] - "Value" - [] - ) - ) - } - ) - [ toJsonArg_, toJsonArg_0, toJsonArg_1 ] - , canonicalLink = - \canonicalLinkArg_ -> - Elm.apply - (Elm.value - { importFrom = [ "Head" ] - , name = "canonicalLink" - , annotation = - Just - (Type.function - [ Type.maybe Type.string ] - (Type.namedWith [ "Head" ] "Tag" []) - ) - } - ) - [ canonicalLinkArg_ ] - } - - -values_ : - { metaName : Elm.Expression - , metaProperty : Elm.Expression - , metaRedirect : Elm.Expression - , rssLink : Elm.Expression - , sitemapLink : Elm.Expression - , rootLanguage : Elm.Expression - , manifestLink : Elm.Expression - , nonLoadingNode : Elm.Expression - , structuredData : Elm.Expression - , currentPageFullUrl : Elm.Expression - , urlAttribute : Elm.Expression - , raw : Elm.Expression - , appleTouchIcon : Elm.Expression - , icon : Elm.Expression - , toJson : Elm.Expression - , canonicalLink : Elm.Expression - } -values_ = - { metaName = - Elm.value - { importFrom = [ "Head" ] - , name = "metaName" - , annotation = - Just - (Type.function - [ Type.string - , Type.namedWith [ "Head" ] "AttributeValue" [] - ] - (Type.namedWith [ "Head" ] "Tag" []) - ) - } - , metaProperty = - Elm.value - { importFrom = [ "Head" ] - , name = "metaProperty" - , annotation = - Just - (Type.function - [ Type.string - , Type.namedWith [ "Head" ] "AttributeValue" [] - ] - (Type.namedWith [ "Head" ] "Tag" []) - ) - } - , metaRedirect = - Elm.value - { importFrom = [ "Head" ] - , name = "metaRedirect" - , annotation = - Just - (Type.function - [ Type.namedWith [ "Head" ] "AttributeValue" [] ] - (Type.namedWith [ "Head" ] "Tag" []) - ) - } - , rssLink = - Elm.value - { importFrom = [ "Head" ] - , name = "rssLink" - , annotation = - Just - (Type.function - [ Type.string ] - (Type.namedWith [ "Head" ] "Tag" []) - ) - } - , sitemapLink = - Elm.value - { importFrom = [ "Head" ] - , name = "sitemapLink" - , annotation = - Just - (Type.function - [ Type.string ] - (Type.namedWith [ "Head" ] "Tag" []) - ) - } - , rootLanguage = - Elm.value - { importFrom = [ "Head" ] - , name = "rootLanguage" - , annotation = - Just - (Type.function - [ Type.namedWith [ "LanguageTag" ] "LanguageTag" [] ] - (Type.namedWith [ "Head" ] "Tag" []) - ) - } - , manifestLink = - Elm.value - { importFrom = [ "Head" ] - , name = "manifestLink" - , annotation = - Just - (Type.function - [ Type.string ] - (Type.namedWith [ "Head" ] "Tag" []) - ) - } - , nonLoadingNode = - Elm.value - { importFrom = [ "Head" ] - , name = "nonLoadingNode" - , annotation = - Just - (Type.function - [ Type.string - , Type.list - (Type.tuple - Type.string - (Type.namedWith [ "Head" ] "AttributeValue" []) - ) - ] - (Type.namedWith [ "Head" ] "Tag" []) - ) - } - , structuredData = - Elm.value - { importFrom = [ "Head" ] - , name = "structuredData" - , annotation = - Just - (Type.function - [ Type.namedWith [ "Json", "Encode" ] "Value" [] ] - (Type.namedWith [ "Head" ] "Tag" []) - ) - } - , currentPageFullUrl = - Elm.value - { importFrom = [ "Head" ] - , name = "currentPageFullUrl" - , annotation = Just (Type.namedWith [ "Head" ] "AttributeValue" []) - } - , urlAttribute = - Elm.value - { importFrom = [ "Head" ] - , name = "urlAttribute" - , annotation = - Just - (Type.function - [ Type.namedWith [ "Pages", "Url" ] "Url" [] ] - (Type.namedWith [ "Head" ] "AttributeValue" []) - ) - } - , raw = - Elm.value - { importFrom = [ "Head" ] - , name = "raw" - , annotation = - Just - (Type.function - [ Type.string ] - (Type.namedWith [ "Head" ] "AttributeValue" []) - ) - } - , appleTouchIcon = - Elm.value - { importFrom = [ "Head" ] - , name = "appleTouchIcon" - , annotation = - Just - (Type.function - [ Type.maybe Type.int - , Type.namedWith [ "Pages", "Url" ] "Url" [] - ] - (Type.namedWith [ "Head" ] "Tag" []) - ) - } - , icon = - Elm.value - { importFrom = [ "Head" ] - , name = "icon" - , annotation = - Just - (Type.function - [ Type.list (Type.tuple Type.int Type.int) - , Type.namedWith [ "MimeType" ] "MimeImage" [] - , Type.namedWith [ "Pages", "Url" ] "Url" [] - ] - (Type.namedWith [ "Head" ] "Tag" []) - ) - } - , toJson = - Elm.value - { importFrom = [ "Head" ] - , name = "toJson" - , annotation = - Just - (Type.function - [ Type.string - , Type.string - , Type.namedWith [ "Head" ] "Tag" [] - ] - (Type.namedWith [ "Json", "Encode" ] "Value" []) - ) - } - , canonicalLink = - Elm.value - { importFrom = [ "Head" ] - , name = "canonicalLink" - , annotation = - Just - (Type.function - [ Type.maybe Type.string ] - (Type.namedWith [ "Head" ] "Tag" []) - ) - } - } \ No newline at end of file diff --git a/codegen/Gen/Head/Seo.elm b/codegen/Gen/Head/Seo.elm deleted file mode 100644 index cbe3e71a..00000000 --- a/codegen/Gen/Head/Seo.elm +++ /dev/null @@ -1,1278 +0,0 @@ -module Gen.Head.Seo exposing - ( moduleName_, article, audioPlayer, book, profile, song - , summary, summaryLarge, videoPlayer, website, annotation_, make_, call_ - , values_ - ) - -{-| -# Generated bindings for Head.Seo - -@docs moduleName_, article, audioPlayer, book, profile, song -@docs summary, summaryLarge, videoPlayer, website, annotation_, make_ -@docs call_, values_ --} - - -import Elm -import Elm.Annotation as Type - - -{-| The name of this module. -} -moduleName_ : List String -moduleName_ = - [ "Head", "Seo" ] - - -{-| See - -article: - { tags : List String - , section : Maybe String - , publishedTime : Maybe DateOrDateTime.DateOrDateTime - , modifiedTime : Maybe DateOrDateTime.DateOrDateTime - , expirationTime : Maybe DateOrDateTime.DateOrDateTime - } - -> Head.Seo.Common - -> List Head.Tag --} -article : - { tags : List String - , section : Elm.Expression - , publishedTime : Elm.Expression - , modifiedTime : Elm.Expression - , expirationTime : Elm.Expression - } - -> Elm.Expression - -> Elm.Expression -article articleArg_ articleArg_0 = - Elm.apply - (Elm.value - { importFrom = [ "Head", "Seo" ] - , name = "article" - , annotation = - Just - (Type.function - [ Type.record - [ ( "tags", Type.list Type.string ) - , ( "section", Type.maybe Type.string ) - , ( "publishedTime" - , Type.maybe - (Type.namedWith - [ "DateOrDateTime" ] - "DateOrDateTime" - [] - ) - ) - , ( "modifiedTime" - , Type.maybe - (Type.namedWith - [ "DateOrDateTime" ] - "DateOrDateTime" - [] - ) - ) - , ( "expirationTime" - , Type.maybe - (Type.namedWith - [ "DateOrDateTime" ] - "DateOrDateTime" - [] - ) - ) - ] - , Type.namedWith [ "Head", "Seo" ] "Common" [] - ] - (Type.list (Type.namedWith [ "Head" ] "Tag" [])) - ) - } - ) - [ Elm.record - [ Tuple.pair - "tags" - (Elm.list (List.map Elm.string articleArg_.tags)) - , Tuple.pair "section" articleArg_.section - , Tuple.pair "publishedTime" articleArg_.publishedTime - , Tuple.pair "modifiedTime" articleArg_.modifiedTime - , Tuple.pair "expirationTime" articleArg_.expirationTime - ] - , articleArg_0 - ] - - -{-| Will be displayed as a Player card in twitter -See: - -OpenGraph audio will also be included. -The options will also be used to build up the appropriate OpenGraph `` tags. - -audioPlayer: - { canonicalUrlOverride : Maybe String - , siteName : String - , image : Head.Seo.Image - , description : String - , title : String - , audio : Head.Seo.Audio - , locale : Maybe Head.Seo.Locale - } - -> Head.Seo.Common --} -audioPlayer : - { canonicalUrlOverride : Elm.Expression - , siteName : String - , image : Elm.Expression - , description : String - , title : String - , audio : Elm.Expression - , locale : Elm.Expression - } - -> Elm.Expression -audioPlayer audioPlayerArg_ = - Elm.apply - (Elm.value - { importFrom = [ "Head", "Seo" ] - , name = "audioPlayer" - , annotation = - Just - (Type.function - [ Type.record - [ ( "canonicalUrlOverride" - , Type.maybe Type.string - ) - , ( "siteName", Type.string ) - , ( "image" - , Type.namedWith [ "Head", "Seo" ] "Image" [] - ) - , ( "description", Type.string ) - , ( "title", Type.string ) - , ( "audio" - , Type.namedWith [ "Head", "Seo" ] "Audio" [] - ) - , ( "locale" - , Type.maybe - (Type.namedWith - [ "Head", "Seo" ] - "Locale" - [] - ) - ) - ] - ] - (Type.namedWith [ "Head", "Seo" ] "Common" []) - ) - } - ) - [ Elm.record - [ Tuple.pair - "canonicalUrlOverride" - audioPlayerArg_.canonicalUrlOverride - , Tuple.pair "siteName" (Elm.string audioPlayerArg_.siteName) - , Tuple.pair "image" audioPlayerArg_.image - , Tuple.pair "description" (Elm.string audioPlayerArg_.description) - , Tuple.pair "title" (Elm.string audioPlayerArg_.title) - , Tuple.pair "audio" audioPlayerArg_.audio - , Tuple.pair "locale" audioPlayerArg_.locale - ] - ] - - -{-| See - -book: - Head.Seo.Common - -> { tags : List String - , isbn : Maybe String - , releaseDate : Maybe DateOrDateTime.DateOrDateTime - } - -> List Head.Tag --} -book : - Elm.Expression - -> { tags : List String - , isbn : Elm.Expression - , releaseDate : Elm.Expression - } - -> Elm.Expression -book bookArg_ bookArg_0 = - Elm.apply - (Elm.value - { importFrom = [ "Head", "Seo" ] - , name = "book" - , annotation = - Just - (Type.function - [ Type.namedWith [ "Head", "Seo" ] "Common" [] - , Type.record - [ ( "tags", Type.list Type.string ) - , ( "isbn", Type.maybe Type.string ) - , ( "releaseDate" - , Type.maybe - (Type.namedWith - [ "DateOrDateTime" ] - "DateOrDateTime" - [] - ) - ) - ] - ] - (Type.list (Type.namedWith [ "Head" ] "Tag" [])) - ) - } - ) - [ bookArg_ - , Elm.record - [ Tuple.pair "tags" (Elm.list (List.map Elm.string bookArg_0.tags)) - , Tuple.pair "isbn" bookArg_0.isbn - , Tuple.pair "releaseDate" bookArg_0.releaseDate - ] - ] - - -{-| See - -profile: - { firstName : String, lastName : String, username : Maybe String } - -> Head.Seo.Common - -> List Head.Tag --} -profile : - { firstName : String, lastName : String, username : Elm.Expression } - -> Elm.Expression - -> Elm.Expression -profile profileArg_ profileArg_0 = - Elm.apply - (Elm.value - { importFrom = [ "Head", "Seo" ] - , name = "profile" - , annotation = - Just - (Type.function - [ Type.record - [ ( "firstName", Type.string ) - , ( "lastName", Type.string ) - , ( "username", Type.maybe Type.string ) - ] - , Type.namedWith [ "Head", "Seo" ] "Common" [] - ] - (Type.list (Type.namedWith [ "Head" ] "Tag" [])) - ) - } - ) - [ Elm.record - [ Tuple.pair "firstName" (Elm.string profileArg_.firstName) - , Tuple.pair "lastName" (Elm.string profileArg_.lastName) - , Tuple.pair "username" profileArg_.username - ] - , profileArg_0 - ] - - -{-| See - -song: - Head.Seo.Common - -> { duration : Maybe Int - , album : Maybe Int - , disc : Maybe Int - , track : Maybe Int - } - -> List Head.Tag --} -song : - Elm.Expression - -> { duration : Elm.Expression - , album : Elm.Expression - , disc : Elm.Expression - , track : Elm.Expression - } - -> Elm.Expression -song songArg_ songArg_0 = - Elm.apply - (Elm.value - { importFrom = [ "Head", "Seo" ] - , name = "song" - , annotation = - Just - (Type.function - [ Type.namedWith [ "Head", "Seo" ] "Common" [] - , Type.record - [ ( "duration", Type.maybe Type.int ) - , ( "album", Type.maybe Type.int ) - , ( "disc", Type.maybe Type.int ) - , ( "track", Type.maybe Type.int ) - ] - ] - (Type.list (Type.namedWith [ "Head" ] "Tag" [])) - ) - } - ) - [ songArg_ - , Elm.record - [ Tuple.pair "duration" songArg_0.duration - , Tuple.pair "album" songArg_0.album - , Tuple.pair "disc" songArg_0.disc - , Tuple.pair "track" songArg_0.track - ] - ] - - -{-| Will be displayed as a large card in twitter -See: - -The options will also be used to build up the appropriate OpenGraph `` tags. - -Note: You cannot include audio or video tags with summaries. -If you want one of those, use `audioPlayer` or `videoPlayer` - -summary: - { canonicalUrlOverride : Maybe String - , siteName : String - , image : Head.Seo.Image - , description : String - , title : String - , locale : Maybe Head.Seo.Locale - } - -> Head.Seo.Common --} -summary : - { canonicalUrlOverride : Elm.Expression - , siteName : String - , image : Elm.Expression - , description : String - , title : String - , locale : Elm.Expression - } - -> Elm.Expression -summary summaryArg_ = - Elm.apply - (Elm.value - { importFrom = [ "Head", "Seo" ] - , name = "summary" - , annotation = - Just - (Type.function - [ Type.record - [ ( "canonicalUrlOverride" - , Type.maybe Type.string - ) - , ( "siteName", Type.string ) - , ( "image" - , Type.namedWith [ "Head", "Seo" ] "Image" [] - ) - , ( "description", Type.string ) - , ( "title", Type.string ) - , ( "locale" - , Type.maybe - (Type.namedWith - [ "Head", "Seo" ] - "Locale" - [] - ) - ) - ] - ] - (Type.namedWith [ "Head", "Seo" ] "Common" []) - ) - } - ) - [ Elm.record - [ Tuple.pair "canonicalUrlOverride" summaryArg_.canonicalUrlOverride - , Tuple.pair "siteName" (Elm.string summaryArg_.siteName) - , Tuple.pair "image" summaryArg_.image - , Tuple.pair "description" (Elm.string summaryArg_.description) - , Tuple.pair "title" (Elm.string summaryArg_.title) - , Tuple.pair "locale" summaryArg_.locale - ] - ] - - -{-| Will be displayed as a large card in twitter -See: - -The options will also be used to build up the appropriate OpenGraph `` tags. - -Note: You cannot include audio or video tags with summaries. -If you want one of those, use `audioPlayer` or `videoPlayer` - -summaryLarge: - { canonicalUrlOverride : Maybe String - , siteName : String - , image : Head.Seo.Image - , description : String - , title : String - , locale : Maybe Head.Seo.Locale - } - -> Head.Seo.Common --} -summaryLarge : - { canonicalUrlOverride : Elm.Expression - , siteName : String - , image : Elm.Expression - , description : String - , title : String - , locale : Elm.Expression - } - -> Elm.Expression -summaryLarge summaryLargeArg_ = - Elm.apply - (Elm.value - { importFrom = [ "Head", "Seo" ] - , name = "summaryLarge" - , annotation = - Just - (Type.function - [ Type.record - [ ( "canonicalUrlOverride" - , Type.maybe Type.string - ) - , ( "siteName", Type.string ) - , ( "image" - , Type.namedWith [ "Head", "Seo" ] "Image" [] - ) - , ( "description", Type.string ) - , ( "title", Type.string ) - , ( "locale" - , Type.maybe - (Type.namedWith - [ "Head", "Seo" ] - "Locale" - [] - ) - ) - ] - ] - (Type.namedWith [ "Head", "Seo" ] "Common" []) - ) - } - ) - [ Elm.record - [ Tuple.pair - "canonicalUrlOverride" - summaryLargeArg_.canonicalUrlOverride - , Tuple.pair "siteName" (Elm.string summaryLargeArg_.siteName) - , Tuple.pair "image" summaryLargeArg_.image - , Tuple.pair "description" (Elm.string summaryLargeArg_.description) - , Tuple.pair "title" (Elm.string summaryLargeArg_.title) - , Tuple.pair "locale" summaryLargeArg_.locale - ] - ] - - -{-| Will be displayed as a Player card in twitter -See: - -OpenGraph video will also be included. -The options will also be used to build up the appropriate OpenGraph `` tags. - -videoPlayer: - { canonicalUrlOverride : Maybe String - , siteName : String - , image : Head.Seo.Image - , description : String - , title : String - , video : Head.Seo.Video - , locale : Maybe Head.Seo.Locale - } - -> Head.Seo.Common --} -videoPlayer : - { canonicalUrlOverride : Elm.Expression - , siteName : String - , image : Elm.Expression - , description : String - , title : String - , video : Elm.Expression - , locale : Elm.Expression - } - -> Elm.Expression -videoPlayer videoPlayerArg_ = - Elm.apply - (Elm.value - { importFrom = [ "Head", "Seo" ] - , name = "videoPlayer" - , annotation = - Just - (Type.function - [ Type.record - [ ( "canonicalUrlOverride" - , Type.maybe Type.string - ) - , ( "siteName", Type.string ) - , ( "image" - , Type.namedWith [ "Head", "Seo" ] "Image" [] - ) - , ( "description", Type.string ) - , ( "title", Type.string ) - , ( "video" - , Type.namedWith [ "Head", "Seo" ] "Video" [] - ) - , ( "locale" - , Type.maybe - (Type.namedWith - [ "Head", "Seo" ] - "Locale" - [] - ) - ) - ] - ] - (Type.namedWith [ "Head", "Seo" ] "Common" []) - ) - } - ) - [ Elm.record - [ Tuple.pair - "canonicalUrlOverride" - videoPlayerArg_.canonicalUrlOverride - , Tuple.pair "siteName" (Elm.string videoPlayerArg_.siteName) - , Tuple.pair "image" videoPlayerArg_.image - , Tuple.pair "description" (Elm.string videoPlayerArg_.description) - , Tuple.pair "title" (Elm.string videoPlayerArg_.title) - , Tuple.pair "video" videoPlayerArg_.video - , Tuple.pair "locale" videoPlayerArg_.locale - ] - ] - - -{-| - -website: Head.Seo.Common -> List Head.Tag --} -website : Elm.Expression -> Elm.Expression -website websiteArg_ = - Elm.apply - (Elm.value - { importFrom = [ "Head", "Seo" ] - , name = "website" - , annotation = - Just - (Type.function - [ Type.namedWith [ "Head", "Seo" ] "Common" [] ] - (Type.list (Type.namedWith [ "Head" ] "Tag" [])) - ) - } - ) - [ websiteArg_ ] - - -annotation_ : { common : Type.Annotation, image : Type.Annotation } -annotation_ = - { common = - Type.alias - moduleName_ - "Common" - [] - (Type.record - [ ( "title", Type.string ) - , ( "image", Type.namedWith [ "Head", "Seo" ] "Image" [] ) - , ( "canonicalUrlOverride", Type.maybe Type.string ) - , ( "description", Type.string ) - , ( "siteName", Type.string ) - , ( "audio" - , Type.maybe (Type.namedWith [ "Head", "Seo" ] "Audio" []) - ) - , ( "video" - , Type.maybe (Type.namedWith [ "Head", "Seo" ] "Video" []) - ) - , ( "locale" - , Type.maybe (Type.namedWith [ "Head", "Seo" ] "Locale" []) - ) - , ( "alternateLocales" - , Type.list (Type.namedWith [ "Head", "Seo" ] "Locale" []) - ) - , ( "twitterCard" - , Type.namedWith [ "Head", "Twitter" ] "TwitterCard" [] - ) - ] - ) - , image = - Type.alias - moduleName_ - "Image" - [] - (Type.record - [ ( "url", Type.namedWith [ "Pages", "Url" ] "Url" [] ) - , ( "alt", Type.string ) - , ( "dimensions" - , Type.maybe - (Type.record - [ ( "width", Type.int ), ( "height", Type.int ) ] - ) - ) - , ( "mimeType" - , Type.maybe (Type.namedWith [ "MimeType" ] "MimeType" []) - ) - ] - ) - } - - -make_ : - { common : - { title : Elm.Expression - , image : Elm.Expression - , canonicalUrlOverride : Elm.Expression - , description : Elm.Expression - , siteName : Elm.Expression - , audio : Elm.Expression - , video : Elm.Expression - , locale : Elm.Expression - , alternateLocales : Elm.Expression - , twitterCard : Elm.Expression - } - -> Elm.Expression - , image : - { url : Elm.Expression - , alt : Elm.Expression - , dimensions : Elm.Expression - , mimeType : Elm.Expression - } - -> Elm.Expression - } -make_ = - { common = - \common_args -> - Elm.withType - (Type.alias - [ "Head", "Seo" ] - "Common" - [] - (Type.record - [ ( "title", Type.string ) - , ( "image" - , Type.namedWith [ "Head", "Seo" ] "Image" [] - ) - , ( "canonicalUrlOverride", Type.maybe Type.string ) - , ( "description", Type.string ) - , ( "siteName", Type.string ) - , ( "audio" - , Type.maybe - (Type.namedWith [ "Head", "Seo" ] "Audio" []) - ) - , ( "video" - , Type.maybe - (Type.namedWith [ "Head", "Seo" ] "Video" []) - ) - , ( "locale" - , Type.maybe - (Type.namedWith [ "Head", "Seo" ] "Locale" []) - ) - , ( "alternateLocales" - , Type.list - (Type.namedWith [ "Head", "Seo" ] "Locale" []) - ) - , ( "twitterCard" - , Type.namedWith - [ "Head", "Twitter" ] - "TwitterCard" - [] - ) - ] - ) - ) - (Elm.record - [ Tuple.pair "title" common_args.title - , Tuple.pair "image" common_args.image - , Tuple.pair - "canonicalUrlOverride" - common_args.canonicalUrlOverride - , Tuple.pair "description" common_args.description - , Tuple.pair "siteName" common_args.siteName - , Tuple.pair "audio" common_args.audio - , Tuple.pair "video" common_args.video - , Tuple.pair "locale" common_args.locale - , Tuple.pair - "alternateLocales" - common_args.alternateLocales - , Tuple.pair "twitterCard" common_args.twitterCard - ] - ) - , image = - \image_args -> - Elm.withType - (Type.alias - [ "Head", "Seo" ] - "Image" - [] - (Type.record - [ ( "url" - , Type.namedWith [ "Pages", "Url" ] "Url" [] - ) - , ( "alt", Type.string ) - , ( "dimensions" - , Type.maybe - (Type.record - [ ( "width", Type.int ) - , ( "height", Type.int ) - ] - ) - ) - , ( "mimeType" - , Type.maybe - (Type.namedWith [ "MimeType" ] "MimeType" []) - ) - ] - ) - ) - (Elm.record - [ Tuple.pair "url" image_args.url - , Tuple.pair "alt" image_args.alt - , Tuple.pair "dimensions" image_args.dimensions - , Tuple.pair "mimeType" image_args.mimeType - ] - ) - } - - -call_ : - { article : Elm.Expression -> Elm.Expression -> Elm.Expression - , audioPlayer : Elm.Expression -> Elm.Expression - , book : Elm.Expression -> Elm.Expression -> Elm.Expression - , profile : Elm.Expression -> Elm.Expression -> Elm.Expression - , song : Elm.Expression -> Elm.Expression -> Elm.Expression - , summary : Elm.Expression -> Elm.Expression - , summaryLarge : Elm.Expression -> Elm.Expression - , videoPlayer : Elm.Expression -> Elm.Expression - , website : Elm.Expression -> Elm.Expression - } -call_ = - { article = - \articleArg_ articleArg_0 -> - Elm.apply - (Elm.value - { importFrom = [ "Head", "Seo" ] - , name = "article" - , annotation = - Just - (Type.function - [ Type.record - [ ( "tags", Type.list Type.string ) - , ( "section", Type.maybe Type.string ) - , ( "publishedTime" - , Type.maybe - (Type.namedWith - [ "DateOrDateTime" ] - "DateOrDateTime" - [] - ) - ) - , ( "modifiedTime" - , Type.maybe - (Type.namedWith - [ "DateOrDateTime" ] - "DateOrDateTime" - [] - ) - ) - , ( "expirationTime" - , Type.maybe - (Type.namedWith - [ "DateOrDateTime" ] - "DateOrDateTime" - [] - ) - ) - ] - , Type.namedWith [ "Head", "Seo" ] "Common" [] - ] - (Type.list - (Type.namedWith [ "Head" ] "Tag" []) - ) - ) - } - ) - [ articleArg_, articleArg_0 ] - , audioPlayer = - \audioPlayerArg_ -> - Elm.apply - (Elm.value - { importFrom = [ "Head", "Seo" ] - , name = "audioPlayer" - , annotation = - Just - (Type.function - [ Type.record - [ ( "canonicalUrlOverride" - , Type.maybe Type.string - ) - , ( "siteName", Type.string ) - , ( "image" - , Type.namedWith - [ "Head", "Seo" ] - "Image" - [] - ) - , ( "description", Type.string ) - , ( "title", Type.string ) - , ( "audio" - , Type.namedWith - [ "Head", "Seo" ] - "Audio" - [] - ) - , ( "locale" - , Type.maybe - (Type.namedWith - [ "Head", "Seo" ] - "Locale" - [] - ) - ) - ] - ] - (Type.namedWith [ "Head", "Seo" ] "Common" []) - ) - } - ) - [ audioPlayerArg_ ] - , book = - \bookArg_ bookArg_0 -> - Elm.apply - (Elm.value - { importFrom = [ "Head", "Seo" ] - , name = "book" - , annotation = - Just - (Type.function - [ Type.namedWith [ "Head", "Seo" ] "Common" [] - , Type.record - [ ( "tags", Type.list Type.string ) - , ( "isbn", Type.maybe Type.string ) - , ( "releaseDate" - , Type.maybe - (Type.namedWith - [ "DateOrDateTime" ] - "DateOrDateTime" - [] - ) - ) - ] - ] - (Type.list - (Type.namedWith [ "Head" ] "Tag" []) - ) - ) - } - ) - [ bookArg_, bookArg_0 ] - , profile = - \profileArg_ profileArg_0 -> - Elm.apply - (Elm.value - { importFrom = [ "Head", "Seo" ] - , name = "profile" - , annotation = - Just - (Type.function - [ Type.record - [ ( "firstName", Type.string ) - , ( "lastName", Type.string ) - , ( "username", Type.maybe Type.string ) - ] - , Type.namedWith [ "Head", "Seo" ] "Common" [] - ] - (Type.list - (Type.namedWith [ "Head" ] "Tag" []) - ) - ) - } - ) - [ profileArg_, profileArg_0 ] - , song = - \songArg_ songArg_0 -> - Elm.apply - (Elm.value - { importFrom = [ "Head", "Seo" ] - , name = "song" - , annotation = - Just - (Type.function - [ Type.namedWith [ "Head", "Seo" ] "Common" [] - , Type.record - [ ( "duration", Type.maybe Type.int ) - , ( "album", Type.maybe Type.int ) - , ( "disc", Type.maybe Type.int ) - , ( "track", Type.maybe Type.int ) - ] - ] - (Type.list - (Type.namedWith [ "Head" ] "Tag" []) - ) - ) - } - ) - [ songArg_, songArg_0 ] - , summary = - \summaryArg_ -> - Elm.apply - (Elm.value - { importFrom = [ "Head", "Seo" ] - , name = "summary" - , annotation = - Just - (Type.function - [ Type.record - [ ( "canonicalUrlOverride" - , Type.maybe Type.string - ) - , ( "siteName", Type.string ) - , ( "image" - , Type.namedWith - [ "Head", "Seo" ] - "Image" - [] - ) - , ( "description", Type.string ) - , ( "title", Type.string ) - , ( "locale" - , Type.maybe - (Type.namedWith - [ "Head", "Seo" ] - "Locale" - [] - ) - ) - ] - ] - (Type.namedWith [ "Head", "Seo" ] "Common" []) - ) - } - ) - [ summaryArg_ ] - , summaryLarge = - \summaryLargeArg_ -> - Elm.apply - (Elm.value - { importFrom = [ "Head", "Seo" ] - , name = "summaryLarge" - , annotation = - Just - (Type.function - [ Type.record - [ ( "canonicalUrlOverride" - , Type.maybe Type.string - ) - , ( "siteName", Type.string ) - , ( "image" - , Type.namedWith - [ "Head", "Seo" ] - "Image" - [] - ) - , ( "description", Type.string ) - , ( "title", Type.string ) - , ( "locale" - , Type.maybe - (Type.namedWith - [ "Head", "Seo" ] - "Locale" - [] - ) - ) - ] - ] - (Type.namedWith [ "Head", "Seo" ] "Common" []) - ) - } - ) - [ summaryLargeArg_ ] - , videoPlayer = - \videoPlayerArg_ -> - Elm.apply - (Elm.value - { importFrom = [ "Head", "Seo" ] - , name = "videoPlayer" - , annotation = - Just - (Type.function - [ Type.record - [ ( "canonicalUrlOverride" - , Type.maybe Type.string - ) - , ( "siteName", Type.string ) - , ( "image" - , Type.namedWith - [ "Head", "Seo" ] - "Image" - [] - ) - , ( "description", Type.string ) - , ( "title", Type.string ) - , ( "video" - , Type.namedWith - [ "Head", "Seo" ] - "Video" - [] - ) - , ( "locale" - , Type.maybe - (Type.namedWith - [ "Head", "Seo" ] - "Locale" - [] - ) - ) - ] - ] - (Type.namedWith [ "Head", "Seo" ] "Common" []) - ) - } - ) - [ videoPlayerArg_ ] - , website = - \websiteArg_ -> - Elm.apply - (Elm.value - { importFrom = [ "Head", "Seo" ] - , name = "website" - , annotation = - Just - (Type.function - [ Type.namedWith [ "Head", "Seo" ] "Common" [] - ] - (Type.list - (Type.namedWith [ "Head" ] "Tag" []) - ) - ) - } - ) - [ websiteArg_ ] - } - - -values_ : - { article : Elm.Expression - , audioPlayer : Elm.Expression - , book : Elm.Expression - , profile : Elm.Expression - , song : Elm.Expression - , summary : Elm.Expression - , summaryLarge : Elm.Expression - , videoPlayer : Elm.Expression - , website : Elm.Expression - } -values_ = - { article = - Elm.value - { importFrom = [ "Head", "Seo" ] - , name = "article" - , annotation = - Just - (Type.function - [ Type.record - [ ( "tags", Type.list Type.string ) - , ( "section", Type.maybe Type.string ) - , ( "publishedTime" - , Type.maybe - (Type.namedWith - [ "DateOrDateTime" ] - "DateOrDateTime" - [] - ) - ) - , ( "modifiedTime" - , Type.maybe - (Type.namedWith - [ "DateOrDateTime" ] - "DateOrDateTime" - [] - ) - ) - , ( "expirationTime" - , Type.maybe - (Type.namedWith - [ "DateOrDateTime" ] - "DateOrDateTime" - [] - ) - ) - ] - , Type.namedWith [ "Head", "Seo" ] "Common" [] - ] - (Type.list (Type.namedWith [ "Head" ] "Tag" [])) - ) - } - , audioPlayer = - Elm.value - { importFrom = [ "Head", "Seo" ] - , name = "audioPlayer" - , annotation = - Just - (Type.function - [ Type.record - [ ( "canonicalUrlOverride" - , Type.maybe Type.string - ) - , ( "siteName", Type.string ) - , ( "image" - , Type.namedWith [ "Head", "Seo" ] "Image" [] - ) - , ( "description", Type.string ) - , ( "title", Type.string ) - , ( "audio" - , Type.namedWith [ "Head", "Seo" ] "Audio" [] - ) - , ( "locale" - , Type.maybe - (Type.namedWith [ "Head", "Seo" ] "Locale" [] - ) - ) - ] - ] - (Type.namedWith [ "Head", "Seo" ] "Common" []) - ) - } - , book = - Elm.value - { importFrom = [ "Head", "Seo" ] - , name = "book" - , annotation = - Just - (Type.function - [ Type.namedWith [ "Head", "Seo" ] "Common" [] - , Type.record - [ ( "tags", Type.list Type.string ) - , ( "isbn", Type.maybe Type.string ) - , ( "releaseDate" - , Type.maybe - (Type.namedWith - [ "DateOrDateTime" ] - "DateOrDateTime" - [] - ) - ) - ] - ] - (Type.list (Type.namedWith [ "Head" ] "Tag" [])) - ) - } - , profile = - Elm.value - { importFrom = [ "Head", "Seo" ] - , name = "profile" - , annotation = - Just - (Type.function - [ Type.record - [ ( "firstName", Type.string ) - , ( "lastName", Type.string ) - , ( "username", Type.maybe Type.string ) - ] - , Type.namedWith [ "Head", "Seo" ] "Common" [] - ] - (Type.list (Type.namedWith [ "Head" ] "Tag" [])) - ) - } - , song = - Elm.value - { importFrom = [ "Head", "Seo" ] - , name = "song" - , annotation = - Just - (Type.function - [ Type.namedWith [ "Head", "Seo" ] "Common" [] - , Type.record - [ ( "duration", Type.maybe Type.int ) - , ( "album", Type.maybe Type.int ) - , ( "disc", Type.maybe Type.int ) - , ( "track", Type.maybe Type.int ) - ] - ] - (Type.list (Type.namedWith [ "Head" ] "Tag" [])) - ) - } - , summary = - Elm.value - { importFrom = [ "Head", "Seo" ] - , name = "summary" - , annotation = - Just - (Type.function - [ Type.record - [ ( "canonicalUrlOverride" - , Type.maybe Type.string - ) - , ( "siteName", Type.string ) - , ( "image" - , Type.namedWith [ "Head", "Seo" ] "Image" [] - ) - , ( "description", Type.string ) - , ( "title", Type.string ) - , ( "locale" - , Type.maybe - (Type.namedWith [ "Head", "Seo" ] "Locale" [] - ) - ) - ] - ] - (Type.namedWith [ "Head", "Seo" ] "Common" []) - ) - } - , summaryLarge = - Elm.value - { importFrom = [ "Head", "Seo" ] - , name = "summaryLarge" - , annotation = - Just - (Type.function - [ Type.record - [ ( "canonicalUrlOverride" - , Type.maybe Type.string - ) - , ( "siteName", Type.string ) - , ( "image" - , Type.namedWith [ "Head", "Seo" ] "Image" [] - ) - , ( "description", Type.string ) - , ( "title", Type.string ) - , ( "locale" - , Type.maybe - (Type.namedWith [ "Head", "Seo" ] "Locale" [] - ) - ) - ] - ] - (Type.namedWith [ "Head", "Seo" ] "Common" []) - ) - } - , videoPlayer = - Elm.value - { importFrom = [ "Head", "Seo" ] - , name = "videoPlayer" - , annotation = - Just - (Type.function - [ Type.record - [ ( "canonicalUrlOverride" - , Type.maybe Type.string - ) - , ( "siteName", Type.string ) - , ( "image" - , Type.namedWith [ "Head", "Seo" ] "Image" [] - ) - , ( "description", Type.string ) - , ( "title", Type.string ) - , ( "video" - , Type.namedWith [ "Head", "Seo" ] "Video" [] - ) - , ( "locale" - , Type.maybe - (Type.namedWith [ "Head", "Seo" ] "Locale" [] - ) - ) - ] - ] - (Type.namedWith [ "Head", "Seo" ] "Common" []) - ) - } - , website = - Elm.value - { importFrom = [ "Head", "Seo" ] - , name = "website" - , annotation = - Just - (Type.function - [ Type.namedWith [ "Head", "Seo" ] "Common" [] ] - (Type.list (Type.namedWith [ "Head" ] "Tag" [])) - ) - } - } \ No newline at end of file diff --git a/codegen/Gen/Http.elm b/codegen/Gen/Http.elm deleted file mode 100644 index 3b31a825..00000000 --- a/codegen/Gen/Http.elm +++ /dev/null @@ -1,2996 +0,0 @@ -module Gen.Http exposing - ( moduleName_, get, post, request, header, emptyBody - , stringBody, jsonBody, fileBody, bytesBody, multipartBody, stringPart, filePart - , bytesPart, expectString, expectJson, expectBytes, expectWhatever, track, fractionSent - , fractionReceived, cancel, riskyRequest, expectStringResponse, expectBytesResponse, task, stringResolver - , bytesResolver, riskyTask, annotation_, make_, caseOf_, call_, values_ - ) - -{-| -# Generated bindings for Http - -@docs moduleName_, get, post, request, header, emptyBody -@docs stringBody, jsonBody, fileBody, bytesBody, multipartBody, stringPart -@docs filePart, bytesPart, expectString, expectJson, expectBytes, expectWhatever -@docs track, fractionSent, fractionReceived, cancel, riskyRequest, expectStringResponse -@docs expectBytesResponse, task, stringResolver, bytesResolver, riskyTask, annotation_ -@docs make_, caseOf_, call_, values_ --} - - -import Elm -import Elm.Annotation as Type -import Elm.Arg -import Elm.Case - - -{-| The name of this module. -} -moduleName_ : List String -moduleName_ = - [ "Http" ] - - -{-| Create a `GET` request. - - import Http - - type Msg - = GotText (Result Http.Error String) - - getPublicOpinion : Cmd Msg - getPublicOpinion = - Http.get - { url = "https://elm-lang.org/assets/public-opinion.txt" - , expect = Http.expectString GotText - } - -You can use functions like [`expectString`](#expectString) and -[`expectJson`](#expectJson) to interpret the response in different ways. In -this example, we are expecting the response body to be a `String` containing -the full text of _Public Opinion_ by Walter Lippmann. - -**Note:** Use [`elm/url`](/packages/elm/url/latest) to build reliable URLs. - -get: { url : String, expect : Http.Expect msg } -> Platform.Cmd.Cmd msg --} -get : { url : String, expect : Elm.Expression } -> Elm.Expression -get getArg_ = - Elm.apply - (Elm.value - { importFrom = [ "Http" ] - , name = "get" - , annotation = - Just - (Type.function - [ Type.record - [ ( "url", Type.string ) - , ( "expect" - , Type.namedWith - [ "Http" ] - "Expect" - [ Type.var "msg" ] - ) - ] - ] - (Type.namedWith [] "Cmd" [ Type.var "msg" ]) - ) - } - ) - [ Elm.record - [ Tuple.pair "url" (Elm.string getArg_.url) - , Tuple.pair "expect" getArg_.expect - ] - ] - - -{-| Create a `POST` request. So imagine we want to send a POST request for -some JSON data. It might look like this: - - import Http - import Json.Decode exposing (list, string) - - type Msg - = GotBooks (Result Http.Error (List String)) - - postBooks : Cmd Msg - postBooks = - Http.post - { url = "https://example.com/books" - , body = Http.emptyBody - , expect = Http.expectJson GotBooks (list string) - } - -Notice that we are using [`expectJson`](#expectJson) to interpret the response -as JSON. You can learn more about how JSON decoders work [here][] in the guide. - -We did not put anything in the body of our request, but you can use functions -like [`stringBody`](#stringBody) and [`jsonBody`](#jsonBody) if you need to -send information to the server. - -[here]: https://guide.elm-lang.org/interop/json.html - -post: - { url : String, body : Http.Body, expect : Http.Expect msg } - -> Platform.Cmd.Cmd msg --} -post : - { url : String, body : Elm.Expression, expect : Elm.Expression } - -> Elm.Expression -post postArg_ = - Elm.apply - (Elm.value - { importFrom = [ "Http" ] - , name = "post" - , annotation = - Just - (Type.function - [ Type.record - [ ( "url", Type.string ) - , ( "body", Type.namedWith [ "Http" ] "Body" [] ) - , ( "expect" - , Type.namedWith - [ "Http" ] - "Expect" - [ Type.var "msg" ] - ) - ] - ] - (Type.namedWith [] "Cmd" [ Type.var "msg" ]) - ) - } - ) - [ Elm.record - [ Tuple.pair "url" (Elm.string postArg_.url) - , Tuple.pair "body" postArg_.body - , Tuple.pair "expect" postArg_.expect - ] - ] - - -{-| Create a custom request. For example, a PUT for files might look like this: - - import File - import Http - - type Msg = Uploaded (Result Http.Error ()) - - upload : File.File -> Cmd Msg - upload file = - Http.request - { method = "PUT" - , headers = [] - , url = "https://example.com/publish" - , body = Http.fileBody file - , expect = Http.expectWhatever Uploaded - , timeout = Nothing - , tracker = Nothing - } - -It lets you set custom `headers` as needed. The `timeout` is the number of -milliseconds you are willing to wait before giving up. The `tracker` lets you -[`cancel`](#cancel) and [`track`](#track) requests. - -request: - { method : String - , headers : List Http.Header - , url : String - , body : Http.Body - , expect : Http.Expect msg - , timeout : Maybe Float - , tracker : Maybe String - } - -> Platform.Cmd.Cmd msg --} -request : - { method : String - , headers : List Elm.Expression - , url : String - , body : Elm.Expression - , expect : Elm.Expression - , timeout : Elm.Expression - , tracker : Elm.Expression - } - -> Elm.Expression -request requestArg_ = - Elm.apply - (Elm.value - { importFrom = [ "Http" ] - , name = "request" - , annotation = - Just - (Type.function - [ Type.record - [ ( "method", Type.string ) - , ( "headers" - , Type.list - (Type.namedWith [ "Http" ] "Header" []) - ) - , ( "url", Type.string ) - , ( "body", Type.namedWith [ "Http" ] "Body" [] ) - , ( "expect" - , Type.namedWith - [ "Http" ] - "Expect" - [ Type.var "msg" ] - ) - , ( "timeout", Type.maybe Type.float ) - , ( "tracker", Type.maybe Type.string ) - ] - ] - (Type.namedWith [] "Cmd" [ Type.var "msg" ]) - ) - } - ) - [ Elm.record - [ Tuple.pair "method" (Elm.string requestArg_.method) - , Tuple.pair "headers" (Elm.list requestArg_.headers) - , Tuple.pair "url" (Elm.string requestArg_.url) - , Tuple.pair "body" requestArg_.body - , Tuple.pair "expect" requestArg_.expect - , Tuple.pair "timeout" requestArg_.timeout - , Tuple.pair "tracker" requestArg_.tracker - ] - ] - - -{-| Create a `Header`. - - header "If-Modified-Since" "Sat 29 Oct 1994 19:43:31 GMT" - header "Max-Forwards" "10" - header "X-Requested-With" "XMLHttpRequest" - -header: String -> String -> Http.Header --} -header : String -> String -> Elm.Expression -header headerArg_ headerArg_0 = - Elm.apply - (Elm.value - { importFrom = [ "Http" ] - , name = "header" - , annotation = - Just - (Type.function - [ Type.string, Type.string ] - (Type.namedWith [ "Http" ] "Header" []) - ) - } - ) - [ Elm.string headerArg_, Elm.string headerArg_0 ] - - -{-| Create an empty body for your `Request`. This is useful for GET requests -and POST requests where you are not sending any data. - -emptyBody: Http.Body --} -emptyBody : Elm.Expression -emptyBody = - Elm.value - { importFrom = [ "Http" ] - , name = "emptyBody" - , annotation = Just (Type.namedWith [ "Http" ] "Body" []) - } - - -{-| Put some string in the body of your `Request`. Defining `jsonBody` looks -like this: - - import Json.Encode as Encode - - jsonBody : Encode.Value -> Body - jsonBody value = - stringBody "application/json" (Encode.encode 0 value) - -The first argument is a [MIME type](https://en.wikipedia.org/wiki/Media_type) -of the body. Some servers are strict about this! - -stringBody: String -> String -> Http.Body --} -stringBody : String -> String -> Elm.Expression -stringBody stringBodyArg_ stringBodyArg_0 = - Elm.apply - (Elm.value - { importFrom = [ "Http" ] - , name = "stringBody" - , annotation = - Just - (Type.function - [ Type.string, Type.string ] - (Type.namedWith [ "Http" ] "Body" []) - ) - } - ) - [ Elm.string stringBodyArg_, Elm.string stringBodyArg_0 ] - - -{-| Put some JSON value in the body of your `Request`. This will automatically -add the `Content-Type: application/json` header. - -jsonBody: Json.Encode.Value -> Http.Body --} -jsonBody : Elm.Expression -> Elm.Expression -jsonBody jsonBodyArg_ = - Elm.apply - (Elm.value - { importFrom = [ "Http" ] - , name = "jsonBody" - , annotation = - Just - (Type.function - [ Type.namedWith [ "Json", "Encode" ] "Value" [] ] - (Type.namedWith [ "Http" ] "Body" []) - ) - } - ) - [ jsonBodyArg_ ] - - -{-| Use a file as the body of your `Request`. When someone uploads an image -into the browser with [`elm/file`](/packages/elm/file/latest) you can forward -it to a server. - -This will automatically set the `Content-Type` to the MIME type of the file. - -**Note:** Use [`track`](#track) to track upload progress. - -fileBody: File.File -> Http.Body --} -fileBody : Elm.Expression -> Elm.Expression -fileBody fileBodyArg_ = - Elm.apply - (Elm.value - { importFrom = [ "Http" ] - , name = "fileBody" - , annotation = - Just - (Type.function - [ Type.namedWith [ "File" ] "File" [] ] - (Type.namedWith [ "Http" ] "Body" []) - ) - } - ) - [ fileBodyArg_ ] - - -{-| Put some `Bytes` in the body of your `Request`. This allows you to use -[`elm/bytes`](/packages/elm/bytes/latest) to have full control over the binary -representation of the data you are sending. For example, you could create an -`archive.zip` file and send it along like this: - - import Bytes exposing (Bytes) - - zipBody : Bytes -> Body - zipBody bytes = - bytesBody "application/zip" bytes - -The first argument is a [MIME type](https://en.wikipedia.org/wiki/Media_type) -of the body. In other scenarios you may want to use MIME types like `image/png` -or `image/jpeg` instead. - -**Note:** Use [`track`](#track) to track upload progress. - -bytesBody: String -> Bytes.Bytes -> Http.Body --} -bytesBody : String -> Elm.Expression -> Elm.Expression -bytesBody bytesBodyArg_ bytesBodyArg_0 = - Elm.apply - (Elm.value - { importFrom = [ "Http" ] - , name = "bytesBody" - , annotation = - Just - (Type.function - [ Type.string, Type.namedWith [ "Bytes" ] "Bytes" [] ] - (Type.namedWith [ "Http" ] "Body" []) - ) - } - ) - [ Elm.string bytesBodyArg_, bytesBodyArg_0 ] - - -{-| When someone clicks submit on the ``, browsers send a special HTTP -request with all the form data. Something like this: - -``` -POST /test.html HTTP/1.1 -Host: example.org -Content-Type: multipart/form-data;boundary="7MA4YWxkTrZu0gW" - ---7MA4YWxkTrZu0gW -Content-Disposition: form-data; name="title" - -Trip to London ---7MA4YWxkTrZu0gW -Content-Disposition: form-data; name="album[]"; filename="parliment.jpg" - -...RAW...IMAGE...BITS... ---7MA4YWxkTrZu0gW-- -``` - -This was the only way to send files for a long time, so many servers expect -data in this format. **The `multipartBody` function lets you create these -requests.** For example, to upload a photo album all at once, you could create -a body like this: - - multipartBody - [ stringPart "title" "Trip to London" - , filePart "album[]" file1 - , filePart "album[]" file2 - , filePart "album[]" file3 - ] - -All of the body parts need to have a name. Names can be repeated. Adding the -`[]` on repeated names is a convention from PHP. It seems weird, but I see it -enough to mention it. You do not have to do it that way, especially if your -server uses some other convention! - -The `Content-Type: multipart/form-data` header is automatically set when -creating a body this way. - -**Note:** Use [`track`](#track) to track upload progress. - -multipartBody: List Http.Part -> Http.Body --} -multipartBody : List Elm.Expression -> Elm.Expression -multipartBody multipartBodyArg_ = - Elm.apply - (Elm.value - { importFrom = [ "Http" ] - , name = "multipartBody" - , annotation = - Just - (Type.function - [ Type.list (Type.namedWith [ "Http" ] "Part" []) ] - (Type.namedWith [ "Http" ] "Body" []) - ) - } - ) - [ Elm.list multipartBodyArg_ ] - - -{-| A part that contains `String` data. - - multipartBody - [ stringPart "title" "Tom" - , filePart "photo" tomPng - ] - -stringPart: String -> String -> Http.Part --} -stringPart : String -> String -> Elm.Expression -stringPart stringPartArg_ stringPartArg_0 = - Elm.apply - (Elm.value - { importFrom = [ "Http" ] - , name = "stringPart" - , annotation = - Just - (Type.function - [ Type.string, Type.string ] - (Type.namedWith [ "Http" ] "Part" []) - ) - } - ) - [ Elm.string stringPartArg_, Elm.string stringPartArg_0 ] - - -{-| A part that contains a file. You can use -[`elm/file`](/packages/elm/file/latest) to get files loaded into the -browser. From there, you can send it along to a server like this: - - multipartBody - [ stringPart "product" "Ikea Bekant" - , stringPart "description" "Great desk for home office." - , filePart "image[]" file1 - , filePart "image[]" file2 - , filePart "image[]" file3 - ] - -filePart: String -> File.File -> Http.Part --} -filePart : String -> Elm.Expression -> Elm.Expression -filePart filePartArg_ filePartArg_0 = - Elm.apply - (Elm.value - { importFrom = [ "Http" ] - , name = "filePart" - , annotation = - Just - (Type.function - [ Type.string, Type.namedWith [ "File" ] "File" [] ] - (Type.namedWith [ "Http" ] "Part" []) - ) - } - ) - [ Elm.string filePartArg_, filePartArg_0 ] - - -{-| A part that contains bytes, allowing you to use -[`elm/bytes`](/packages/elm/bytes/latest) to encode data exactly in the format -you need. - - multipartBody - [ stringPart "title" "Tom" - , bytesPart "photo" "image/png" bytes - ] - -**Note:** You must provide a MIME type so that the receiver has clues about -how to interpret the bytes. - -bytesPart: String -> String -> Bytes.Bytes -> Http.Part --} -bytesPart : String -> String -> Elm.Expression -> Elm.Expression -bytesPart bytesPartArg_ bytesPartArg_0 bytesPartArg_1 = - Elm.apply - (Elm.value - { importFrom = [ "Http" ] - , name = "bytesPart" - , annotation = - Just - (Type.function - [ Type.string - , Type.string - , Type.namedWith [ "Bytes" ] "Bytes" [] - ] - (Type.namedWith [ "Http" ] "Part" []) - ) - } - ) - [ Elm.string bytesPartArg_, Elm.string bytesPartArg_0, bytesPartArg_1 ] - - -{-| Expect the response body to be a `String`. Like when getting the full text -of a book: - - import Http - - type Msg - = GotText (Result Http.Error String) - - getPublicOpinion : Cmd Msg - getPublicOpinion = - Http.get - { url = "https://elm-lang.org/assets/public-opinion.txt" - , expect = Http.expectString GotText - } - -The response body is always some sequence of bytes, but in this case, we -expect it to be UTF-8 encoded text that can be turned into a `String`. - -expectString: (Result.Result Http.Error String -> msg) -> Http.Expect msg --} -expectString : (Elm.Expression -> Elm.Expression) -> Elm.Expression -expectString expectStringArg_ = - Elm.apply - (Elm.value - { importFrom = [ "Http" ] - , name = "expectString" - , annotation = - Just - (Type.function - [ Type.function - [ Type.namedWith - [ "Result" ] - "Result" - [ Type.namedWith [ "Http" ] "Error" [] - , Type.string - ] - ] - (Type.var "msg") - ] - (Type.namedWith [ "Http" ] "Expect" [ Type.var "msg" ] - ) - ) - } - ) - [ Elm.functionReduced "expectStringUnpack" expectStringArg_ ] - - -{-| Expect the response body to be JSON. Like if you want to get a random cat -GIF you might say: - - import Http - import Json.Decode exposing (Decoder, field, string) - - type Msg - = GotGif (Result Http.Error String) - - getRandomCatGif : Cmd Msg - getRandomCatGif = - Http.get - { url = "https://api.giphy.com/v1/gifs/random?api_key=dc6zaTOxFJmzC&tag=cat" - , expect = Http.expectJson GotGif gifDecoder - } - - gifDecoder : Decoder String - gifDecoder = - field "data" (field "image_url" string) - -The official guide goes through this particular example [here][]. That page -also introduces [`elm/json`][json] to help you get started turning JSON into -Elm values in other situations. - -[here]: https://guide.elm-lang.org/interop/json.html -[json]: /packages/elm/json/latest/ - -If the JSON decoder fails, you get a `BadBody` error that tries to explain -what went wrong. - -expectJson: (Result.Result Http.Error a -> msg) -> Json.Decode.Decoder a -> Http.Expect msg --} -expectJson : - (Elm.Expression -> Elm.Expression) -> Elm.Expression -> Elm.Expression -expectJson expectJsonArg_ expectJsonArg_0 = - Elm.apply - (Elm.value - { importFrom = [ "Http" ] - , name = "expectJson" - , annotation = - Just - (Type.function - [ Type.function - [ Type.namedWith - [ "Result" ] - "Result" - [ Type.namedWith [ "Http" ] "Error" [] - , Type.var "a" - ] - ] - (Type.var "msg") - , Type.namedWith - [ "Json", "Decode" ] - "Decoder" - [ Type.var "a" ] - ] - (Type.namedWith [ "Http" ] "Expect" [ Type.var "msg" ] - ) - ) - } - ) - [ Elm.functionReduced "expectJsonUnpack" expectJsonArg_ - , expectJsonArg_0 - ] - - -{-| Expect the response body to be binary data. For example, maybe you are -talking to an endpoint that gives back ProtoBuf data: - - import Bytes.Decode as Bytes - import Http - - type Msg - = GotData (Result Http.Error Data) - - getData : Cmd Msg - getData = - Http.get - { url = "/data" - , expect = Http.expectBytes GotData dataDecoder - } - - -- dataDecoder : Bytes.Decoder Data - -You would use [`elm/bytes`](/packages/elm/bytes/latest/) to decode the binary -data according to a proto definition file like `example.proto`. - -If the decoder fails, you get a `BadBody` error that just indicates that -_something_ went wrong. It probably makes sense to debug by peeking at the -bytes you are getting in the browser developer tools or something. - -expectBytes: (Result.Result Http.Error a -> msg) -> Bytes.Decode.Decoder a -> Http.Expect msg --} -expectBytes : - (Elm.Expression -> Elm.Expression) -> Elm.Expression -> Elm.Expression -expectBytes expectBytesArg_ expectBytesArg_0 = - Elm.apply - (Elm.value - { importFrom = [ "Http" ] - , name = "expectBytes" - , annotation = - Just - (Type.function - [ Type.function - [ Type.namedWith - [ "Result" ] - "Result" - [ Type.namedWith [ "Http" ] "Error" [] - , Type.var "a" - ] - ] - (Type.var "msg") - , Type.namedWith - [ "Bytes", "Decode" ] - "Decoder" - [ Type.var "a" ] - ] - (Type.namedWith [ "Http" ] "Expect" [ Type.var "msg" ] - ) - ) - } - ) - [ Elm.functionReduced "expectBytesUnpack" expectBytesArg_ - , expectBytesArg_0 - ] - - -{-| Expect the response body to be whatever. It does not matter. Ignore it! -For example, you might want this when uploading files: - - import Http - - type Msg - = Uploaded (Result Http.Error ()) - - upload : File -> Cmd Msg - upload file = - Http.post - { url = "/upload" - , body = Http.fileBody file - , expect = Http.expectWhatever Uploaded - } - -The server may be giving back a response body, but we do not care about it. - -expectWhatever: (Result.Result Http.Error () -> msg) -> Http.Expect msg --} -expectWhatever : (Elm.Expression -> Elm.Expression) -> Elm.Expression -expectWhatever expectWhateverArg_ = - Elm.apply - (Elm.value - { importFrom = [ "Http" ] - , name = "expectWhatever" - , annotation = - Just - (Type.function - [ Type.function - [ Type.namedWith - [ "Result" ] - "Result" - [ Type.namedWith [ "Http" ] "Error" [] - , Type.unit - ] - ] - (Type.var "msg") - ] - (Type.namedWith [ "Http" ] "Expect" [ Type.var "msg" ] - ) - ) - } - ) - [ Elm.functionReduced "expectWhateverUnpack" expectWhateverArg_ ] - - -{-| Track the progress of a request. Create a [`request`](#request) where -`tracker = Just "form.pdf"` and you can track it with a subscription like -`track "form.pdf" GotProgress`. - -track: String -> (Http.Progress -> msg) -> Platform.Sub.Sub msg --} -track : String -> (Elm.Expression -> Elm.Expression) -> Elm.Expression -track trackArg_ trackArg_0 = - Elm.apply - (Elm.value - { importFrom = [ "Http" ] - , name = "track" - , annotation = - Just - (Type.function - [ Type.string - , Type.function - [ Type.namedWith [ "Http" ] "Progress" [] ] - (Type.var "msg") - ] - (Type.namedWith [] "Sub" [ Type.var "msg" ]) - ) - } - ) - [ Elm.string trackArg_, Elm.functionReduced "trackUnpack" trackArg_0 ] - - -{-| Turn `Sending` progress into a useful fraction. - - fractionSent { sent = 0, size = 1024 } == 0.0 - fractionSent { sent = 256, size = 1024 } == 0.25 - fractionSent { sent = 512, size = 1024 } == 0.5 - - -- fractionSent { sent = 0, size = 0 } == 1.0 - -The result is always between `0.0` and `1.0`, ensuring that any progress bar -animations never go out of bounds. - -And notice that `size` can be zero. That means you are sending a request with -an empty body. Very common! When `size` is zero, the result is always `1.0`. - -**Note:** If you create your own function to compute this fraction, watch out -for divide-by-zero errors! - -fractionSent: { sent : Int, size : Int } -> Float --} -fractionSent : { sent : Int, size : Int } -> Elm.Expression -fractionSent fractionSentArg_ = - Elm.apply - (Elm.value - { importFrom = [ "Http" ] - , name = "fractionSent" - , annotation = - Just - (Type.function - [ Type.record - [ ( "sent", Type.int ), ( "size", Type.int ) ] - ] - Type.float - ) - } - ) - [ Elm.record - [ Tuple.pair "sent" (Elm.int fractionSentArg_.sent) - , Tuple.pair "size" (Elm.int fractionSentArg_.size) - ] - ] - - -{-| Turn `Receiving` progress into a useful fraction for progress bars. - - fractionReceived { received = 0, size = Just 1024 } == 0.0 - fractionReceived { received = 256, size = Just 1024 } == 0.25 - fractionReceived { received = 512, size = Just 1024 } == 0.5 - - -- fractionReceived { received = 0, size = Nothing } == 0.0 - -- fractionReceived { received = 256, size = Nothing } == 0.0 - -- fractionReceived { received = 512, size = Nothing } == 0.0 - -The `size` here is based on the [`Content-Length`][cl] header which may be -missing in some cases. A server may be misconfigured or it may be streaming -data and not actually know the final size. Whatever the case, this function -will always give `0.0` when the final size is unknown. - -Furthermore, the `Content-Length` header may be incorrect! The implementation -clamps the fraction between `0.0` and `1.0`, so you will just get `1.0` if -you ever receive more bytes than promised. - -**Note:** If you are streaming something, you can write a custom version of -this function that just tracks bytes received. Maybe you show that 22kb or 83kb -have been downloaded, without a specific fraction. If you do this, be wary of -divide-by-zero errors because `size` can always be zero! - -[cl]: https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Content-Length - -fractionReceived: { received : Int, size : Maybe Int } -> Float --} -fractionReceived : { received : Int, size : Elm.Expression } -> Elm.Expression -fractionReceived fractionReceivedArg_ = - Elm.apply - (Elm.value - { importFrom = [ "Http" ] - , name = "fractionReceived" - , annotation = - Just - (Type.function - [ Type.record - [ ( "received", Type.int ) - , ( "size", Type.maybe Type.int ) - ] - ] - Type.float - ) - } - ) - [ Elm.record - [ Tuple.pair "received" (Elm.int fractionReceivedArg_.received) - , Tuple.pair "size" fractionReceivedArg_.size - ] - ] - - -{-| Try to cancel an ongoing request based on a `tracker`. - -cancel: String -> Platform.Cmd.Cmd msg --} -cancel : String -> Elm.Expression -cancel cancelArg_ = - Elm.apply - (Elm.value - { importFrom = [ "Http" ] - , name = "cancel" - , annotation = - Just - (Type.function - [ Type.string ] - (Type.namedWith [] "Cmd" [ Type.var "msg" ]) - ) - } - ) - [ Elm.string cancelArg_ ] - - -{-| Create a request with a risky security policy. Things like: - -- Allow responses from other domains to set cookies. -- Include cookies in requests to other domains. - -This is called [`withCredentials`][wc] in JavaScript, and it allows a couple -other risky things as well. It can be useful if `www.example.com` needs to -talk to `uploads.example.com`, but it should be used very carefully! - -For example, every HTTP request includes a `Host` header revealing the domain, -so any request to `facebook.com` reveals the website that sent it. From there, -cookies can be used to correlate browsing habits with specific users. “Oh, it -looks like they visited `example.com`. Maybe they want ads about examples!” -This is why you can get shoe ads for months without saying anything about it -on any social networks. **This risk exists even for people who do not have an -account.** Servers can set a new cookie to uniquely identify the browser and -build a profile around that. Same kind of tricks for logged out users. - -**Context:** A significantly worse version of this can happen when trying to -add integrations with Google, Facebook, Pinterest, Twitter, etc. “Add our share -button. It is super easy. Just add this ` -``` - -To get that data, you would write this in your `elm-pages` head tags: - - import Json.Encode as Encode - - {-| - -} - encodeArticle : - { title : String - , description : String - , author : StructuredDataHelper { authorMemberOf | personOrOrganization : () } authorPossibleFields - , publisher : StructuredDataHelper { publisherMemberOf | personOrOrganization : () } publisherPossibleFields - , url : String - , imageUrl : String - , datePublished : String - , mainEntityOfPage : Encode.Value - } - -> Head.Tag - encodeArticle info = - Encode.object - [ ( "@context", Encode.string "http://schema.org/" ) - , ( "@type", Encode.string "Article" ) - , ( "headline", Encode.string info.title ) - , ( "description", Encode.string info.description ) - , ( "image", Encode.string info.imageUrl ) - , ( "author", encode info.author ) - , ( "publisher", encode info.publisher ) - , ( "url", Encode.string info.url ) - , ( "datePublished", Encode.string info.datePublished ) - , ( "mainEntityOfPage", info.mainEntityOfPage ) - ] - |> Head.structuredData - -Take a look at this [Google Search Gallery](https://developers.google.com/search/docs/guides/search-gallery) -to see some examples of how structured data can be used by search engines to give rich search results. It can help boost -your rankings, get better engagement for your content, and also make your content more accessible. For example, -voice assistant devices can make use of structured data. If you're hosting a conference and want to make the event -date and location easy for attendees to find, this can make that information more accessible. - -For the current version of API, you'll need to make sure that the format is correct and contains the required and recommended -structure. - -Check out for a comprehensive listing of possible data types and fields. And take a look at -Google's [Structured Data Testing Tool](https://search.google.com/structured-data/testing-tool) -too make sure that your structured data is valid and includes the recommended values. - -In the future, `elm-pages` will likely support a typed API, but schema.org is a massive spec, and changes frequently. -And there are multiple sources of information on the possible and recommended structure. So it will take some time -for the right API design to evolve. In the meantime, this allows you to make use of this for SEO purposes. - -structuredData: Json.Encode.Value -> Head.Tag --} -structuredData : Elm.Expression -> Elm.Expression -structuredData structuredDataArg_ = - Elm.apply - (Elm.value - { importFrom = [ "Head" ] - , name = "structuredData" - , annotation = - Just - (Type.function - [ Type.namedWith [ "Json", "Encode" ] "Value" [] ] - (Type.namedWith [ "Head" ] "Tag" []) - ) - } - ) - [ structuredDataArg_ ] - - -{-| Create an `AttributeValue` representing the current page's full url. - -currentPageFullUrl: Head.AttributeValue --} -currentPageFullUrl : Elm.Expression -currentPageFullUrl = - Elm.value - { importFrom = [ "Head" ] - , name = "currentPageFullUrl" - , annotation = Just (Type.namedWith [ "Head" ] "AttributeValue" []) - } - - -{-| Create an `AttributeValue` from an `ImagePath`. - -urlAttribute: Pages.Url.Url -> Head.AttributeValue --} -urlAttribute : Elm.Expression -> Elm.Expression -urlAttribute urlAttributeArg_ = - Elm.apply - (Elm.value - { importFrom = [ "Head" ] - , name = "urlAttribute" - , annotation = - Just - (Type.function - [ Type.namedWith [ "Pages", "Url" ] "Url" [] ] - (Type.namedWith [ "Head" ] "AttributeValue" []) - ) - } - ) - [ urlAttributeArg_ ] - - -{-| Create a raw `AttributeValue` (as opposed to some kind of absolute URL). - -raw: String -> Head.AttributeValue --} -raw : String -> Elm.Expression -raw rawArg_ = - Elm.apply - (Elm.value - { importFrom = [ "Head" ] - , name = "raw" - , annotation = - Just - (Type.function - [ Type.string ] - (Type.namedWith [ "Head" ] "AttributeValue" []) - ) - } - ) - [ Elm.string rawArg_ ] - - -{-| Note: the type must be png. -See . - -If a size is provided, it will be turned into square dimensions as per the recommendations here: - -Images must be png's, and non-transparent images are recommended. Current recommended dimensions are 180px and 192px. - -appleTouchIcon: Maybe Int -> Pages.Url.Url -> Head.Tag --} -appleTouchIcon : Elm.Expression -> Elm.Expression -> Elm.Expression -appleTouchIcon appleTouchIconArg_ appleTouchIconArg_0 = - Elm.apply - (Elm.value - { importFrom = [ "Head" ] - , name = "appleTouchIcon" - , annotation = - Just - (Type.function - [ Type.maybe Type.int - , Type.namedWith [ "Pages", "Url" ] "Url" [] - ] - (Type.namedWith [ "Head" ] "Tag" []) - ) - } - ) - [ appleTouchIconArg_, appleTouchIconArg_0 ] - - -{-| icon: List ( Int, Int ) -> MimeType.MimeImage -> Pages.Url.Url -> Head.Tag -} -icon : List Elm.Expression -> Elm.Expression -> Elm.Expression -> Elm.Expression -icon iconArg_ iconArg_0 iconArg_1 = - Elm.apply - (Elm.value - { importFrom = [ "Head" ] - , name = "icon" - , annotation = - Just - (Type.function - [ Type.list (Type.tuple Type.int Type.int) - , Type.namedWith [ "MimeType" ] "MimeImage" [] - , Type.namedWith [ "Pages", "Url" ] "Url" [] - ] - (Type.namedWith [ "Head" ] "Tag" []) - ) - } - ) - [ Elm.list iconArg_, iconArg_0, iconArg_1 ] - - -{-| Feel free to use this, but in 99% of cases you won't need it. The generated -code will run this for you to generate your `manifest.json` file automatically! - -toJson: String -> String -> Head.Tag -> Json.Encode.Value --} -toJson : String -> String -> Elm.Expression -> Elm.Expression -toJson toJsonArg_ toJsonArg_0 toJsonArg_1 = - Elm.apply - (Elm.value - { importFrom = [ "Head" ] - , name = "toJson" - , annotation = - Just - (Type.function - [ Type.string - , Type.string - , Type.namedWith [ "Head" ] "Tag" [] - ] - (Type.namedWith [ "Json", "Encode" ] "Value" []) - ) - } - ) - [ Elm.string toJsonArg_, Elm.string toJsonArg_0, toJsonArg_1 ] - - -{-| It's recommended that you use the `Seo` module helpers, which will provide this -for you, rather than directly using this. - -Example: - - Head.canonicalLink "https://elm-pages.com" - -canonicalLink: Maybe String -> Head.Tag --} -canonicalLink : Elm.Expression -> Elm.Expression -canonicalLink canonicalLinkArg_ = - Elm.apply - (Elm.value - { importFrom = [ "Head" ] - , name = "canonicalLink" - , annotation = - Just - (Type.function - [ Type.maybe Type.string ] - (Type.namedWith [ "Head" ] "Tag" []) - ) - } - ) - [ canonicalLinkArg_ ] - - -annotation_ : { tag : Type.Annotation, attributeValue : Type.Annotation } -annotation_ = - { tag = Type.namedWith [ "Head" ] "Tag" [] - , attributeValue = Type.namedWith [ "Head" ] "AttributeValue" [] - } - - -call_ : - { metaName : Elm.Expression -> Elm.Expression -> Elm.Expression - , metaProperty : Elm.Expression -> Elm.Expression -> Elm.Expression - , metaRedirect : Elm.Expression -> Elm.Expression - , rssLink : Elm.Expression -> Elm.Expression - , sitemapLink : Elm.Expression -> Elm.Expression - , rootLanguage : Elm.Expression -> Elm.Expression - , manifestLink : Elm.Expression -> Elm.Expression - , nonLoadingNode : Elm.Expression -> Elm.Expression -> Elm.Expression - , structuredData : Elm.Expression -> Elm.Expression - , urlAttribute : Elm.Expression -> Elm.Expression - , raw : Elm.Expression -> Elm.Expression - , appleTouchIcon : Elm.Expression -> Elm.Expression -> Elm.Expression - , icon : - Elm.Expression -> Elm.Expression -> Elm.Expression -> Elm.Expression - , toJson : - Elm.Expression -> Elm.Expression -> Elm.Expression -> Elm.Expression - , canonicalLink : Elm.Expression -> Elm.Expression - } -call_ = - { metaName = - \metaNameArg_ metaNameArg_0 -> - Elm.apply - (Elm.value - { importFrom = [ "Head" ] - , name = "metaName" - , annotation = - Just - (Type.function - [ Type.string - , Type.namedWith - [ "Head" ] - "AttributeValue" - [] - ] - (Type.namedWith [ "Head" ] "Tag" []) - ) - } - ) - [ metaNameArg_, metaNameArg_0 ] - , metaProperty = - \metaPropertyArg_ metaPropertyArg_0 -> - Elm.apply - (Elm.value - { importFrom = [ "Head" ] - , name = "metaProperty" - , annotation = - Just - (Type.function - [ Type.string - , Type.namedWith - [ "Head" ] - "AttributeValue" - [] - ] - (Type.namedWith [ "Head" ] "Tag" []) - ) - } - ) - [ metaPropertyArg_, metaPropertyArg_0 ] - , metaRedirect = - \metaRedirectArg_ -> - Elm.apply - (Elm.value - { importFrom = [ "Head" ] - , name = "metaRedirect" - , annotation = - Just - (Type.function - [ Type.namedWith - [ "Head" ] - "AttributeValue" - [] - ] - (Type.namedWith [ "Head" ] "Tag" []) - ) - } - ) - [ metaRedirectArg_ ] - , rssLink = - \rssLinkArg_ -> - Elm.apply - (Elm.value - { importFrom = [ "Head" ] - , name = "rssLink" - , annotation = - Just - (Type.function - [ Type.string ] - (Type.namedWith [ "Head" ] "Tag" []) - ) - } - ) - [ rssLinkArg_ ] - , sitemapLink = - \sitemapLinkArg_ -> - Elm.apply - (Elm.value - { importFrom = [ "Head" ] - , name = "sitemapLink" - , annotation = - Just - (Type.function - [ Type.string ] - (Type.namedWith [ "Head" ] "Tag" []) - ) - } - ) - [ sitemapLinkArg_ ] - , rootLanguage = - \rootLanguageArg_ -> - Elm.apply - (Elm.value - { importFrom = [ "Head" ] - , name = "rootLanguage" - , annotation = - Just - (Type.function - [ Type.namedWith - [ "LanguageTag" ] - "LanguageTag" - [] - ] - (Type.namedWith [ "Head" ] "Tag" []) - ) - } - ) - [ rootLanguageArg_ ] - , manifestLink = - \manifestLinkArg_ -> - Elm.apply - (Elm.value - { importFrom = [ "Head" ] - , name = "manifestLink" - , annotation = - Just - (Type.function - [ Type.string ] - (Type.namedWith [ "Head" ] "Tag" []) - ) - } - ) - [ manifestLinkArg_ ] - , nonLoadingNode = - \nonLoadingNodeArg_ nonLoadingNodeArg_0 -> - Elm.apply - (Elm.value - { importFrom = [ "Head" ] - , name = "nonLoadingNode" - , annotation = - Just - (Type.function - [ Type.string - , Type.list - (Type.tuple - Type.string - (Type.namedWith - [ "Head" ] - "AttributeValue" - [] - ) - ) - ] - (Type.namedWith [ "Head" ] "Tag" []) - ) - } - ) - [ nonLoadingNodeArg_, nonLoadingNodeArg_0 ] - , structuredData = - \structuredDataArg_ -> - Elm.apply - (Elm.value - { importFrom = [ "Head" ] - , name = "structuredData" - , annotation = - Just - (Type.function - [ Type.namedWith - [ "Json", "Encode" ] - "Value" - [] - ] - (Type.namedWith [ "Head" ] "Tag" []) - ) - } - ) - [ structuredDataArg_ ] - , urlAttribute = - \urlAttributeArg_ -> - Elm.apply - (Elm.value - { importFrom = [ "Head" ] - , name = "urlAttribute" - , annotation = - Just - (Type.function - [ Type.namedWith [ "Pages", "Url" ] "Url" [] ] - (Type.namedWith [ "Head" ] "AttributeValue" [] - ) - ) - } - ) - [ urlAttributeArg_ ] - , raw = - \rawArg_ -> - Elm.apply - (Elm.value - { importFrom = [ "Head" ] - , name = "raw" - , annotation = - Just - (Type.function - [ Type.string ] - (Type.namedWith [ "Head" ] "AttributeValue" [] - ) - ) - } - ) - [ rawArg_ ] - , appleTouchIcon = - \appleTouchIconArg_ appleTouchIconArg_0 -> - Elm.apply - (Elm.value - { importFrom = [ "Head" ] - , name = "appleTouchIcon" - , annotation = - Just - (Type.function - [ Type.maybe Type.int - , Type.namedWith [ "Pages", "Url" ] "Url" [] - ] - (Type.namedWith [ "Head" ] "Tag" []) - ) - } - ) - [ appleTouchIconArg_, appleTouchIconArg_0 ] - , icon = - \iconArg_ iconArg_0 iconArg_1 -> - Elm.apply - (Elm.value - { importFrom = [ "Head" ] - , name = "icon" - , annotation = - Just - (Type.function - [ Type.list (Type.tuple Type.int Type.int) - , Type.namedWith [ "MimeType" ] "MimeImage" [] - , Type.namedWith [ "Pages", "Url" ] "Url" [] - ] - (Type.namedWith [ "Head" ] "Tag" []) - ) - } - ) - [ iconArg_, iconArg_0, iconArg_1 ] - , toJson = - \toJsonArg_ toJsonArg_0 toJsonArg_1 -> - Elm.apply - (Elm.value - { importFrom = [ "Head" ] - , name = "toJson" - , annotation = - Just - (Type.function - [ Type.string - , Type.string - , Type.namedWith [ "Head" ] "Tag" [] - ] - (Type.namedWith - [ "Json", "Encode" ] - "Value" - [] - ) - ) - } - ) - [ toJsonArg_, toJsonArg_0, toJsonArg_1 ] - , canonicalLink = - \canonicalLinkArg_ -> - Elm.apply - (Elm.value - { importFrom = [ "Head" ] - , name = "canonicalLink" - , annotation = - Just - (Type.function - [ Type.maybe Type.string ] - (Type.namedWith [ "Head" ] "Tag" []) - ) - } - ) - [ canonicalLinkArg_ ] - } - - -values_ : - { metaName : Elm.Expression - , metaProperty : Elm.Expression - , metaRedirect : Elm.Expression - , rssLink : Elm.Expression - , sitemapLink : Elm.Expression - , rootLanguage : Elm.Expression - , manifestLink : Elm.Expression - , nonLoadingNode : Elm.Expression - , structuredData : Elm.Expression - , currentPageFullUrl : Elm.Expression - , urlAttribute : Elm.Expression - , raw : Elm.Expression - , appleTouchIcon : Elm.Expression - , icon : Elm.Expression - , toJson : Elm.Expression - , canonicalLink : Elm.Expression - } -values_ = - { metaName = - Elm.value - { importFrom = [ "Head" ] - , name = "metaName" - , annotation = - Just - (Type.function - [ Type.string - , Type.namedWith [ "Head" ] "AttributeValue" [] - ] - (Type.namedWith [ "Head" ] "Tag" []) - ) - } - , metaProperty = - Elm.value - { importFrom = [ "Head" ] - , name = "metaProperty" - , annotation = - Just - (Type.function - [ Type.string - , Type.namedWith [ "Head" ] "AttributeValue" [] - ] - (Type.namedWith [ "Head" ] "Tag" []) - ) - } - , metaRedirect = - Elm.value - { importFrom = [ "Head" ] - , name = "metaRedirect" - , annotation = - Just - (Type.function - [ Type.namedWith [ "Head" ] "AttributeValue" [] ] - (Type.namedWith [ "Head" ] "Tag" []) - ) - } - , rssLink = - Elm.value - { importFrom = [ "Head" ] - , name = "rssLink" - , annotation = - Just - (Type.function - [ Type.string ] - (Type.namedWith [ "Head" ] "Tag" []) - ) - } - , sitemapLink = - Elm.value - { importFrom = [ "Head" ] - , name = "sitemapLink" - , annotation = - Just - (Type.function - [ Type.string ] - (Type.namedWith [ "Head" ] "Tag" []) - ) - } - , rootLanguage = - Elm.value - { importFrom = [ "Head" ] - , name = "rootLanguage" - , annotation = - Just - (Type.function - [ Type.namedWith [ "LanguageTag" ] "LanguageTag" [] ] - (Type.namedWith [ "Head" ] "Tag" []) - ) - } - , manifestLink = - Elm.value - { importFrom = [ "Head" ] - , name = "manifestLink" - , annotation = - Just - (Type.function - [ Type.string ] - (Type.namedWith [ "Head" ] "Tag" []) - ) - } - , nonLoadingNode = - Elm.value - { importFrom = [ "Head" ] - , name = "nonLoadingNode" - , annotation = - Just - (Type.function - [ Type.string - , Type.list - (Type.tuple - Type.string - (Type.namedWith [ "Head" ] "AttributeValue" []) - ) - ] - (Type.namedWith [ "Head" ] "Tag" []) - ) - } - , structuredData = - Elm.value - { importFrom = [ "Head" ] - , name = "structuredData" - , annotation = - Just - (Type.function - [ Type.namedWith [ "Json", "Encode" ] "Value" [] ] - (Type.namedWith [ "Head" ] "Tag" []) - ) - } - , currentPageFullUrl = - Elm.value - { importFrom = [ "Head" ] - , name = "currentPageFullUrl" - , annotation = Just (Type.namedWith [ "Head" ] "AttributeValue" []) - } - , urlAttribute = - Elm.value - { importFrom = [ "Head" ] - , name = "urlAttribute" - , annotation = - Just - (Type.function - [ Type.namedWith [ "Pages", "Url" ] "Url" [] ] - (Type.namedWith [ "Head" ] "AttributeValue" []) - ) - } - , raw = - Elm.value - { importFrom = [ "Head" ] - , name = "raw" - , annotation = - Just - (Type.function - [ Type.string ] - (Type.namedWith [ "Head" ] "AttributeValue" []) - ) - } - , appleTouchIcon = - Elm.value - { importFrom = [ "Head" ] - , name = "appleTouchIcon" - , annotation = - Just - (Type.function - [ Type.maybe Type.int - , Type.namedWith [ "Pages", "Url" ] "Url" [] - ] - (Type.namedWith [ "Head" ] "Tag" []) - ) - } - , icon = - Elm.value - { importFrom = [ "Head" ] - , name = "icon" - , annotation = - Just - (Type.function - [ Type.list (Type.tuple Type.int Type.int) - , Type.namedWith [ "MimeType" ] "MimeImage" [] - , Type.namedWith [ "Pages", "Url" ] "Url" [] - ] - (Type.namedWith [ "Head" ] "Tag" []) - ) - } - , toJson = - Elm.value - { importFrom = [ "Head" ] - , name = "toJson" - , annotation = - Just - (Type.function - [ Type.string - , Type.string - , Type.namedWith [ "Head" ] "Tag" [] - ] - (Type.namedWith [ "Json", "Encode" ] "Value" []) - ) - } - , canonicalLink = - Elm.value - { importFrom = [ "Head" ] - , name = "canonicalLink" - , annotation = - Just - (Type.function - [ Type.maybe Type.string ] - (Type.namedWith [ "Head" ] "Tag" []) - ) - } - } \ No newline at end of file diff --git a/elm-open-api-codegen/src/Gen/Head/Seo.elm b/elm-open-api-codegen/src/Gen/Head/Seo.elm deleted file mode 100644 index cbe3e71a..00000000 --- a/elm-open-api-codegen/src/Gen/Head/Seo.elm +++ /dev/null @@ -1,1278 +0,0 @@ -module Gen.Head.Seo exposing - ( moduleName_, article, audioPlayer, book, profile, song - , summary, summaryLarge, videoPlayer, website, annotation_, make_, call_ - , values_ - ) - -{-| -# Generated bindings for Head.Seo - -@docs moduleName_, article, audioPlayer, book, profile, song -@docs summary, summaryLarge, videoPlayer, website, annotation_, make_ -@docs call_, values_ --} - - -import Elm -import Elm.Annotation as Type - - -{-| The name of this module. -} -moduleName_ : List String -moduleName_ = - [ "Head", "Seo" ] - - -{-| See - -article: - { tags : List String - , section : Maybe String - , publishedTime : Maybe DateOrDateTime.DateOrDateTime - , modifiedTime : Maybe DateOrDateTime.DateOrDateTime - , expirationTime : Maybe DateOrDateTime.DateOrDateTime - } - -> Head.Seo.Common - -> List Head.Tag --} -article : - { tags : List String - , section : Elm.Expression - , publishedTime : Elm.Expression - , modifiedTime : Elm.Expression - , expirationTime : Elm.Expression - } - -> Elm.Expression - -> Elm.Expression -article articleArg_ articleArg_0 = - Elm.apply - (Elm.value - { importFrom = [ "Head", "Seo" ] - , name = "article" - , annotation = - Just - (Type.function - [ Type.record - [ ( "tags", Type.list Type.string ) - , ( "section", Type.maybe Type.string ) - , ( "publishedTime" - , Type.maybe - (Type.namedWith - [ "DateOrDateTime" ] - "DateOrDateTime" - [] - ) - ) - , ( "modifiedTime" - , Type.maybe - (Type.namedWith - [ "DateOrDateTime" ] - "DateOrDateTime" - [] - ) - ) - , ( "expirationTime" - , Type.maybe - (Type.namedWith - [ "DateOrDateTime" ] - "DateOrDateTime" - [] - ) - ) - ] - , Type.namedWith [ "Head", "Seo" ] "Common" [] - ] - (Type.list (Type.namedWith [ "Head" ] "Tag" [])) - ) - } - ) - [ Elm.record - [ Tuple.pair - "tags" - (Elm.list (List.map Elm.string articleArg_.tags)) - , Tuple.pair "section" articleArg_.section - , Tuple.pair "publishedTime" articleArg_.publishedTime - , Tuple.pair "modifiedTime" articleArg_.modifiedTime - , Tuple.pair "expirationTime" articleArg_.expirationTime - ] - , articleArg_0 - ] - - -{-| Will be displayed as a Player card in twitter -See: - -OpenGraph audio will also be included. -The options will also be used to build up the appropriate OpenGraph `` tags. - -audioPlayer: - { canonicalUrlOverride : Maybe String - , siteName : String - , image : Head.Seo.Image - , description : String - , title : String - , audio : Head.Seo.Audio - , locale : Maybe Head.Seo.Locale - } - -> Head.Seo.Common --} -audioPlayer : - { canonicalUrlOverride : Elm.Expression - , siteName : String - , image : Elm.Expression - , description : String - , title : String - , audio : Elm.Expression - , locale : Elm.Expression - } - -> Elm.Expression -audioPlayer audioPlayerArg_ = - Elm.apply - (Elm.value - { importFrom = [ "Head", "Seo" ] - , name = "audioPlayer" - , annotation = - Just - (Type.function - [ Type.record - [ ( "canonicalUrlOverride" - , Type.maybe Type.string - ) - , ( "siteName", Type.string ) - , ( "image" - , Type.namedWith [ "Head", "Seo" ] "Image" [] - ) - , ( "description", Type.string ) - , ( "title", Type.string ) - , ( "audio" - , Type.namedWith [ "Head", "Seo" ] "Audio" [] - ) - , ( "locale" - , Type.maybe - (Type.namedWith - [ "Head", "Seo" ] - "Locale" - [] - ) - ) - ] - ] - (Type.namedWith [ "Head", "Seo" ] "Common" []) - ) - } - ) - [ Elm.record - [ Tuple.pair - "canonicalUrlOverride" - audioPlayerArg_.canonicalUrlOverride - , Tuple.pair "siteName" (Elm.string audioPlayerArg_.siteName) - , Tuple.pair "image" audioPlayerArg_.image - , Tuple.pair "description" (Elm.string audioPlayerArg_.description) - , Tuple.pair "title" (Elm.string audioPlayerArg_.title) - , Tuple.pair "audio" audioPlayerArg_.audio - , Tuple.pair "locale" audioPlayerArg_.locale - ] - ] - - -{-| See - -book: - Head.Seo.Common - -> { tags : List String - , isbn : Maybe String - , releaseDate : Maybe DateOrDateTime.DateOrDateTime - } - -> List Head.Tag --} -book : - Elm.Expression - -> { tags : List String - , isbn : Elm.Expression - , releaseDate : Elm.Expression - } - -> Elm.Expression -book bookArg_ bookArg_0 = - Elm.apply - (Elm.value - { importFrom = [ "Head", "Seo" ] - , name = "book" - , annotation = - Just - (Type.function - [ Type.namedWith [ "Head", "Seo" ] "Common" [] - , Type.record - [ ( "tags", Type.list Type.string ) - , ( "isbn", Type.maybe Type.string ) - , ( "releaseDate" - , Type.maybe - (Type.namedWith - [ "DateOrDateTime" ] - "DateOrDateTime" - [] - ) - ) - ] - ] - (Type.list (Type.namedWith [ "Head" ] "Tag" [])) - ) - } - ) - [ bookArg_ - , Elm.record - [ Tuple.pair "tags" (Elm.list (List.map Elm.string bookArg_0.tags)) - , Tuple.pair "isbn" bookArg_0.isbn - , Tuple.pair "releaseDate" bookArg_0.releaseDate - ] - ] - - -{-| See - -profile: - { firstName : String, lastName : String, username : Maybe String } - -> Head.Seo.Common - -> List Head.Tag --} -profile : - { firstName : String, lastName : String, username : Elm.Expression } - -> Elm.Expression - -> Elm.Expression -profile profileArg_ profileArg_0 = - Elm.apply - (Elm.value - { importFrom = [ "Head", "Seo" ] - , name = "profile" - , annotation = - Just - (Type.function - [ Type.record - [ ( "firstName", Type.string ) - , ( "lastName", Type.string ) - , ( "username", Type.maybe Type.string ) - ] - , Type.namedWith [ "Head", "Seo" ] "Common" [] - ] - (Type.list (Type.namedWith [ "Head" ] "Tag" [])) - ) - } - ) - [ Elm.record - [ Tuple.pair "firstName" (Elm.string profileArg_.firstName) - , Tuple.pair "lastName" (Elm.string profileArg_.lastName) - , Tuple.pair "username" profileArg_.username - ] - , profileArg_0 - ] - - -{-| See - -song: - Head.Seo.Common - -> { duration : Maybe Int - , album : Maybe Int - , disc : Maybe Int - , track : Maybe Int - } - -> List Head.Tag --} -song : - Elm.Expression - -> { duration : Elm.Expression - , album : Elm.Expression - , disc : Elm.Expression - , track : Elm.Expression - } - -> Elm.Expression -song songArg_ songArg_0 = - Elm.apply - (Elm.value - { importFrom = [ "Head", "Seo" ] - , name = "song" - , annotation = - Just - (Type.function - [ Type.namedWith [ "Head", "Seo" ] "Common" [] - , Type.record - [ ( "duration", Type.maybe Type.int ) - , ( "album", Type.maybe Type.int ) - , ( "disc", Type.maybe Type.int ) - , ( "track", Type.maybe Type.int ) - ] - ] - (Type.list (Type.namedWith [ "Head" ] "Tag" [])) - ) - } - ) - [ songArg_ - , Elm.record - [ Tuple.pair "duration" songArg_0.duration - , Tuple.pair "album" songArg_0.album - , Tuple.pair "disc" songArg_0.disc - , Tuple.pair "track" songArg_0.track - ] - ] - - -{-| Will be displayed as a large card in twitter -See: - -The options will also be used to build up the appropriate OpenGraph `` tags. - -Note: You cannot include audio or video tags with summaries. -If you want one of those, use `audioPlayer` or `videoPlayer` - -summary: - { canonicalUrlOverride : Maybe String - , siteName : String - , image : Head.Seo.Image - , description : String - , title : String - , locale : Maybe Head.Seo.Locale - } - -> Head.Seo.Common --} -summary : - { canonicalUrlOverride : Elm.Expression - , siteName : String - , image : Elm.Expression - , description : String - , title : String - , locale : Elm.Expression - } - -> Elm.Expression -summary summaryArg_ = - Elm.apply - (Elm.value - { importFrom = [ "Head", "Seo" ] - , name = "summary" - , annotation = - Just - (Type.function - [ Type.record - [ ( "canonicalUrlOverride" - , Type.maybe Type.string - ) - , ( "siteName", Type.string ) - , ( "image" - , Type.namedWith [ "Head", "Seo" ] "Image" [] - ) - , ( "description", Type.string ) - , ( "title", Type.string ) - , ( "locale" - , Type.maybe - (Type.namedWith - [ "Head", "Seo" ] - "Locale" - [] - ) - ) - ] - ] - (Type.namedWith [ "Head", "Seo" ] "Common" []) - ) - } - ) - [ Elm.record - [ Tuple.pair "canonicalUrlOverride" summaryArg_.canonicalUrlOverride - , Tuple.pair "siteName" (Elm.string summaryArg_.siteName) - , Tuple.pair "image" summaryArg_.image - , Tuple.pair "description" (Elm.string summaryArg_.description) - , Tuple.pair "title" (Elm.string summaryArg_.title) - , Tuple.pair "locale" summaryArg_.locale - ] - ] - - -{-| Will be displayed as a large card in twitter -See: - -The options will also be used to build up the appropriate OpenGraph `` tags. - -Note: You cannot include audio or video tags with summaries. -If you want one of those, use `audioPlayer` or `videoPlayer` - -summaryLarge: - { canonicalUrlOverride : Maybe String - , siteName : String - , image : Head.Seo.Image - , description : String - , title : String - , locale : Maybe Head.Seo.Locale - } - -> Head.Seo.Common --} -summaryLarge : - { canonicalUrlOverride : Elm.Expression - , siteName : String - , image : Elm.Expression - , description : String - , title : String - , locale : Elm.Expression - } - -> Elm.Expression -summaryLarge summaryLargeArg_ = - Elm.apply - (Elm.value - { importFrom = [ "Head", "Seo" ] - , name = "summaryLarge" - , annotation = - Just - (Type.function - [ Type.record - [ ( "canonicalUrlOverride" - , Type.maybe Type.string - ) - , ( "siteName", Type.string ) - , ( "image" - , Type.namedWith [ "Head", "Seo" ] "Image" [] - ) - , ( "description", Type.string ) - , ( "title", Type.string ) - , ( "locale" - , Type.maybe - (Type.namedWith - [ "Head", "Seo" ] - "Locale" - [] - ) - ) - ] - ] - (Type.namedWith [ "Head", "Seo" ] "Common" []) - ) - } - ) - [ Elm.record - [ Tuple.pair - "canonicalUrlOverride" - summaryLargeArg_.canonicalUrlOverride - , Tuple.pair "siteName" (Elm.string summaryLargeArg_.siteName) - , Tuple.pair "image" summaryLargeArg_.image - , Tuple.pair "description" (Elm.string summaryLargeArg_.description) - , Tuple.pair "title" (Elm.string summaryLargeArg_.title) - , Tuple.pair "locale" summaryLargeArg_.locale - ] - ] - - -{-| Will be displayed as a Player card in twitter -See: - -OpenGraph video will also be included. -The options will also be used to build up the appropriate OpenGraph `` tags. - -videoPlayer: - { canonicalUrlOverride : Maybe String - , siteName : String - , image : Head.Seo.Image - , description : String - , title : String - , video : Head.Seo.Video - , locale : Maybe Head.Seo.Locale - } - -> Head.Seo.Common --} -videoPlayer : - { canonicalUrlOverride : Elm.Expression - , siteName : String - , image : Elm.Expression - , description : String - , title : String - , video : Elm.Expression - , locale : Elm.Expression - } - -> Elm.Expression -videoPlayer videoPlayerArg_ = - Elm.apply - (Elm.value - { importFrom = [ "Head", "Seo" ] - , name = "videoPlayer" - , annotation = - Just - (Type.function - [ Type.record - [ ( "canonicalUrlOverride" - , Type.maybe Type.string - ) - , ( "siteName", Type.string ) - , ( "image" - , Type.namedWith [ "Head", "Seo" ] "Image" [] - ) - , ( "description", Type.string ) - , ( "title", Type.string ) - , ( "video" - , Type.namedWith [ "Head", "Seo" ] "Video" [] - ) - , ( "locale" - , Type.maybe - (Type.namedWith - [ "Head", "Seo" ] - "Locale" - [] - ) - ) - ] - ] - (Type.namedWith [ "Head", "Seo" ] "Common" []) - ) - } - ) - [ Elm.record - [ Tuple.pair - "canonicalUrlOverride" - videoPlayerArg_.canonicalUrlOverride - , Tuple.pair "siteName" (Elm.string videoPlayerArg_.siteName) - , Tuple.pair "image" videoPlayerArg_.image - , Tuple.pair "description" (Elm.string videoPlayerArg_.description) - , Tuple.pair "title" (Elm.string videoPlayerArg_.title) - , Tuple.pair "video" videoPlayerArg_.video - , Tuple.pair "locale" videoPlayerArg_.locale - ] - ] - - -{-| - -website: Head.Seo.Common -> List Head.Tag --} -website : Elm.Expression -> Elm.Expression -website websiteArg_ = - Elm.apply - (Elm.value - { importFrom = [ "Head", "Seo" ] - , name = "website" - , annotation = - Just - (Type.function - [ Type.namedWith [ "Head", "Seo" ] "Common" [] ] - (Type.list (Type.namedWith [ "Head" ] "Tag" [])) - ) - } - ) - [ websiteArg_ ] - - -annotation_ : { common : Type.Annotation, image : Type.Annotation } -annotation_ = - { common = - Type.alias - moduleName_ - "Common" - [] - (Type.record - [ ( "title", Type.string ) - , ( "image", Type.namedWith [ "Head", "Seo" ] "Image" [] ) - , ( "canonicalUrlOverride", Type.maybe Type.string ) - , ( "description", Type.string ) - , ( "siteName", Type.string ) - , ( "audio" - , Type.maybe (Type.namedWith [ "Head", "Seo" ] "Audio" []) - ) - , ( "video" - , Type.maybe (Type.namedWith [ "Head", "Seo" ] "Video" []) - ) - , ( "locale" - , Type.maybe (Type.namedWith [ "Head", "Seo" ] "Locale" []) - ) - , ( "alternateLocales" - , Type.list (Type.namedWith [ "Head", "Seo" ] "Locale" []) - ) - , ( "twitterCard" - , Type.namedWith [ "Head", "Twitter" ] "TwitterCard" [] - ) - ] - ) - , image = - Type.alias - moduleName_ - "Image" - [] - (Type.record - [ ( "url", Type.namedWith [ "Pages", "Url" ] "Url" [] ) - , ( "alt", Type.string ) - , ( "dimensions" - , Type.maybe - (Type.record - [ ( "width", Type.int ), ( "height", Type.int ) ] - ) - ) - , ( "mimeType" - , Type.maybe (Type.namedWith [ "MimeType" ] "MimeType" []) - ) - ] - ) - } - - -make_ : - { common : - { title : Elm.Expression - , image : Elm.Expression - , canonicalUrlOverride : Elm.Expression - , description : Elm.Expression - , siteName : Elm.Expression - , audio : Elm.Expression - , video : Elm.Expression - , locale : Elm.Expression - , alternateLocales : Elm.Expression - , twitterCard : Elm.Expression - } - -> Elm.Expression - , image : - { url : Elm.Expression - , alt : Elm.Expression - , dimensions : Elm.Expression - , mimeType : Elm.Expression - } - -> Elm.Expression - } -make_ = - { common = - \common_args -> - Elm.withType - (Type.alias - [ "Head", "Seo" ] - "Common" - [] - (Type.record - [ ( "title", Type.string ) - , ( "image" - , Type.namedWith [ "Head", "Seo" ] "Image" [] - ) - , ( "canonicalUrlOverride", Type.maybe Type.string ) - , ( "description", Type.string ) - , ( "siteName", Type.string ) - , ( "audio" - , Type.maybe - (Type.namedWith [ "Head", "Seo" ] "Audio" []) - ) - , ( "video" - , Type.maybe - (Type.namedWith [ "Head", "Seo" ] "Video" []) - ) - , ( "locale" - , Type.maybe - (Type.namedWith [ "Head", "Seo" ] "Locale" []) - ) - , ( "alternateLocales" - , Type.list - (Type.namedWith [ "Head", "Seo" ] "Locale" []) - ) - , ( "twitterCard" - , Type.namedWith - [ "Head", "Twitter" ] - "TwitterCard" - [] - ) - ] - ) - ) - (Elm.record - [ Tuple.pair "title" common_args.title - , Tuple.pair "image" common_args.image - , Tuple.pair - "canonicalUrlOverride" - common_args.canonicalUrlOverride - , Tuple.pair "description" common_args.description - , Tuple.pair "siteName" common_args.siteName - , Tuple.pair "audio" common_args.audio - , Tuple.pair "video" common_args.video - , Tuple.pair "locale" common_args.locale - , Tuple.pair - "alternateLocales" - common_args.alternateLocales - , Tuple.pair "twitterCard" common_args.twitterCard - ] - ) - , image = - \image_args -> - Elm.withType - (Type.alias - [ "Head", "Seo" ] - "Image" - [] - (Type.record - [ ( "url" - , Type.namedWith [ "Pages", "Url" ] "Url" [] - ) - , ( "alt", Type.string ) - , ( "dimensions" - , Type.maybe - (Type.record - [ ( "width", Type.int ) - , ( "height", Type.int ) - ] - ) - ) - , ( "mimeType" - , Type.maybe - (Type.namedWith [ "MimeType" ] "MimeType" []) - ) - ] - ) - ) - (Elm.record - [ Tuple.pair "url" image_args.url - , Tuple.pair "alt" image_args.alt - , Tuple.pair "dimensions" image_args.dimensions - , Tuple.pair "mimeType" image_args.mimeType - ] - ) - } - - -call_ : - { article : Elm.Expression -> Elm.Expression -> Elm.Expression - , audioPlayer : Elm.Expression -> Elm.Expression - , book : Elm.Expression -> Elm.Expression -> Elm.Expression - , profile : Elm.Expression -> Elm.Expression -> Elm.Expression - , song : Elm.Expression -> Elm.Expression -> Elm.Expression - , summary : Elm.Expression -> Elm.Expression - , summaryLarge : Elm.Expression -> Elm.Expression - , videoPlayer : Elm.Expression -> Elm.Expression - , website : Elm.Expression -> Elm.Expression - } -call_ = - { article = - \articleArg_ articleArg_0 -> - Elm.apply - (Elm.value - { importFrom = [ "Head", "Seo" ] - , name = "article" - , annotation = - Just - (Type.function - [ Type.record - [ ( "tags", Type.list Type.string ) - , ( "section", Type.maybe Type.string ) - , ( "publishedTime" - , Type.maybe - (Type.namedWith - [ "DateOrDateTime" ] - "DateOrDateTime" - [] - ) - ) - , ( "modifiedTime" - , Type.maybe - (Type.namedWith - [ "DateOrDateTime" ] - "DateOrDateTime" - [] - ) - ) - , ( "expirationTime" - , Type.maybe - (Type.namedWith - [ "DateOrDateTime" ] - "DateOrDateTime" - [] - ) - ) - ] - , Type.namedWith [ "Head", "Seo" ] "Common" [] - ] - (Type.list - (Type.namedWith [ "Head" ] "Tag" []) - ) - ) - } - ) - [ articleArg_, articleArg_0 ] - , audioPlayer = - \audioPlayerArg_ -> - Elm.apply - (Elm.value - { importFrom = [ "Head", "Seo" ] - , name = "audioPlayer" - , annotation = - Just - (Type.function - [ Type.record - [ ( "canonicalUrlOverride" - , Type.maybe Type.string - ) - , ( "siteName", Type.string ) - , ( "image" - , Type.namedWith - [ "Head", "Seo" ] - "Image" - [] - ) - , ( "description", Type.string ) - , ( "title", Type.string ) - , ( "audio" - , Type.namedWith - [ "Head", "Seo" ] - "Audio" - [] - ) - , ( "locale" - , Type.maybe - (Type.namedWith - [ "Head", "Seo" ] - "Locale" - [] - ) - ) - ] - ] - (Type.namedWith [ "Head", "Seo" ] "Common" []) - ) - } - ) - [ audioPlayerArg_ ] - , book = - \bookArg_ bookArg_0 -> - Elm.apply - (Elm.value - { importFrom = [ "Head", "Seo" ] - , name = "book" - , annotation = - Just - (Type.function - [ Type.namedWith [ "Head", "Seo" ] "Common" [] - , Type.record - [ ( "tags", Type.list Type.string ) - , ( "isbn", Type.maybe Type.string ) - , ( "releaseDate" - , Type.maybe - (Type.namedWith - [ "DateOrDateTime" ] - "DateOrDateTime" - [] - ) - ) - ] - ] - (Type.list - (Type.namedWith [ "Head" ] "Tag" []) - ) - ) - } - ) - [ bookArg_, bookArg_0 ] - , profile = - \profileArg_ profileArg_0 -> - Elm.apply - (Elm.value - { importFrom = [ "Head", "Seo" ] - , name = "profile" - , annotation = - Just - (Type.function - [ Type.record - [ ( "firstName", Type.string ) - , ( "lastName", Type.string ) - , ( "username", Type.maybe Type.string ) - ] - , Type.namedWith [ "Head", "Seo" ] "Common" [] - ] - (Type.list - (Type.namedWith [ "Head" ] "Tag" []) - ) - ) - } - ) - [ profileArg_, profileArg_0 ] - , song = - \songArg_ songArg_0 -> - Elm.apply - (Elm.value - { importFrom = [ "Head", "Seo" ] - , name = "song" - , annotation = - Just - (Type.function - [ Type.namedWith [ "Head", "Seo" ] "Common" [] - , Type.record - [ ( "duration", Type.maybe Type.int ) - , ( "album", Type.maybe Type.int ) - , ( "disc", Type.maybe Type.int ) - , ( "track", Type.maybe Type.int ) - ] - ] - (Type.list - (Type.namedWith [ "Head" ] "Tag" []) - ) - ) - } - ) - [ songArg_, songArg_0 ] - , summary = - \summaryArg_ -> - Elm.apply - (Elm.value - { importFrom = [ "Head", "Seo" ] - , name = "summary" - , annotation = - Just - (Type.function - [ Type.record - [ ( "canonicalUrlOverride" - , Type.maybe Type.string - ) - , ( "siteName", Type.string ) - , ( "image" - , Type.namedWith - [ "Head", "Seo" ] - "Image" - [] - ) - , ( "description", Type.string ) - , ( "title", Type.string ) - , ( "locale" - , Type.maybe - (Type.namedWith - [ "Head", "Seo" ] - "Locale" - [] - ) - ) - ] - ] - (Type.namedWith [ "Head", "Seo" ] "Common" []) - ) - } - ) - [ summaryArg_ ] - , summaryLarge = - \summaryLargeArg_ -> - Elm.apply - (Elm.value - { importFrom = [ "Head", "Seo" ] - , name = "summaryLarge" - , annotation = - Just - (Type.function - [ Type.record - [ ( "canonicalUrlOverride" - , Type.maybe Type.string - ) - , ( "siteName", Type.string ) - , ( "image" - , Type.namedWith - [ "Head", "Seo" ] - "Image" - [] - ) - , ( "description", Type.string ) - , ( "title", Type.string ) - , ( "locale" - , Type.maybe - (Type.namedWith - [ "Head", "Seo" ] - "Locale" - [] - ) - ) - ] - ] - (Type.namedWith [ "Head", "Seo" ] "Common" []) - ) - } - ) - [ summaryLargeArg_ ] - , videoPlayer = - \videoPlayerArg_ -> - Elm.apply - (Elm.value - { importFrom = [ "Head", "Seo" ] - , name = "videoPlayer" - , annotation = - Just - (Type.function - [ Type.record - [ ( "canonicalUrlOverride" - , Type.maybe Type.string - ) - , ( "siteName", Type.string ) - , ( "image" - , Type.namedWith - [ "Head", "Seo" ] - "Image" - [] - ) - , ( "description", Type.string ) - , ( "title", Type.string ) - , ( "video" - , Type.namedWith - [ "Head", "Seo" ] - "Video" - [] - ) - , ( "locale" - , Type.maybe - (Type.namedWith - [ "Head", "Seo" ] - "Locale" - [] - ) - ) - ] - ] - (Type.namedWith [ "Head", "Seo" ] "Common" []) - ) - } - ) - [ videoPlayerArg_ ] - , website = - \websiteArg_ -> - Elm.apply - (Elm.value - { importFrom = [ "Head", "Seo" ] - , name = "website" - , annotation = - Just - (Type.function - [ Type.namedWith [ "Head", "Seo" ] "Common" [] - ] - (Type.list - (Type.namedWith [ "Head" ] "Tag" []) - ) - ) - } - ) - [ websiteArg_ ] - } - - -values_ : - { article : Elm.Expression - , audioPlayer : Elm.Expression - , book : Elm.Expression - , profile : Elm.Expression - , song : Elm.Expression - , summary : Elm.Expression - , summaryLarge : Elm.Expression - , videoPlayer : Elm.Expression - , website : Elm.Expression - } -values_ = - { article = - Elm.value - { importFrom = [ "Head", "Seo" ] - , name = "article" - , annotation = - Just - (Type.function - [ Type.record - [ ( "tags", Type.list Type.string ) - , ( "section", Type.maybe Type.string ) - , ( "publishedTime" - , Type.maybe - (Type.namedWith - [ "DateOrDateTime" ] - "DateOrDateTime" - [] - ) - ) - , ( "modifiedTime" - , Type.maybe - (Type.namedWith - [ "DateOrDateTime" ] - "DateOrDateTime" - [] - ) - ) - , ( "expirationTime" - , Type.maybe - (Type.namedWith - [ "DateOrDateTime" ] - "DateOrDateTime" - [] - ) - ) - ] - , Type.namedWith [ "Head", "Seo" ] "Common" [] - ] - (Type.list (Type.namedWith [ "Head" ] "Tag" [])) - ) - } - , audioPlayer = - Elm.value - { importFrom = [ "Head", "Seo" ] - , name = "audioPlayer" - , annotation = - Just - (Type.function - [ Type.record - [ ( "canonicalUrlOverride" - , Type.maybe Type.string - ) - , ( "siteName", Type.string ) - , ( "image" - , Type.namedWith [ "Head", "Seo" ] "Image" [] - ) - , ( "description", Type.string ) - , ( "title", Type.string ) - , ( "audio" - , Type.namedWith [ "Head", "Seo" ] "Audio" [] - ) - , ( "locale" - , Type.maybe - (Type.namedWith [ "Head", "Seo" ] "Locale" [] - ) - ) - ] - ] - (Type.namedWith [ "Head", "Seo" ] "Common" []) - ) - } - , book = - Elm.value - { importFrom = [ "Head", "Seo" ] - , name = "book" - , annotation = - Just - (Type.function - [ Type.namedWith [ "Head", "Seo" ] "Common" [] - , Type.record - [ ( "tags", Type.list Type.string ) - , ( "isbn", Type.maybe Type.string ) - , ( "releaseDate" - , Type.maybe - (Type.namedWith - [ "DateOrDateTime" ] - "DateOrDateTime" - [] - ) - ) - ] - ] - (Type.list (Type.namedWith [ "Head" ] "Tag" [])) - ) - } - , profile = - Elm.value - { importFrom = [ "Head", "Seo" ] - , name = "profile" - , annotation = - Just - (Type.function - [ Type.record - [ ( "firstName", Type.string ) - , ( "lastName", Type.string ) - , ( "username", Type.maybe Type.string ) - ] - , Type.namedWith [ "Head", "Seo" ] "Common" [] - ] - (Type.list (Type.namedWith [ "Head" ] "Tag" [])) - ) - } - , song = - Elm.value - { importFrom = [ "Head", "Seo" ] - , name = "song" - , annotation = - Just - (Type.function - [ Type.namedWith [ "Head", "Seo" ] "Common" [] - , Type.record - [ ( "duration", Type.maybe Type.int ) - , ( "album", Type.maybe Type.int ) - , ( "disc", Type.maybe Type.int ) - , ( "track", Type.maybe Type.int ) - ] - ] - (Type.list (Type.namedWith [ "Head" ] "Tag" [])) - ) - } - , summary = - Elm.value - { importFrom = [ "Head", "Seo" ] - , name = "summary" - , annotation = - Just - (Type.function - [ Type.record - [ ( "canonicalUrlOverride" - , Type.maybe Type.string - ) - , ( "siteName", Type.string ) - , ( "image" - , Type.namedWith [ "Head", "Seo" ] "Image" [] - ) - , ( "description", Type.string ) - , ( "title", Type.string ) - , ( "locale" - , Type.maybe - (Type.namedWith [ "Head", "Seo" ] "Locale" [] - ) - ) - ] - ] - (Type.namedWith [ "Head", "Seo" ] "Common" []) - ) - } - , summaryLarge = - Elm.value - { importFrom = [ "Head", "Seo" ] - , name = "summaryLarge" - , annotation = - Just - (Type.function - [ Type.record - [ ( "canonicalUrlOverride" - , Type.maybe Type.string - ) - , ( "siteName", Type.string ) - , ( "image" - , Type.namedWith [ "Head", "Seo" ] "Image" [] - ) - , ( "description", Type.string ) - , ( "title", Type.string ) - , ( "locale" - , Type.maybe - (Type.namedWith [ "Head", "Seo" ] "Locale" [] - ) - ) - ] - ] - (Type.namedWith [ "Head", "Seo" ] "Common" []) - ) - } - , videoPlayer = - Elm.value - { importFrom = [ "Head", "Seo" ] - , name = "videoPlayer" - , annotation = - Just - (Type.function - [ Type.record - [ ( "canonicalUrlOverride" - , Type.maybe Type.string - ) - , ( "siteName", Type.string ) - , ( "image" - , Type.namedWith [ "Head", "Seo" ] "Image" [] - ) - , ( "description", Type.string ) - , ( "title", Type.string ) - , ( "video" - , Type.namedWith [ "Head", "Seo" ] "Video" [] - ) - , ( "locale" - , Type.maybe - (Type.namedWith [ "Head", "Seo" ] "Locale" [] - ) - ) - ] - ] - (Type.namedWith [ "Head", "Seo" ] "Common" []) - ) - } - , website = - Elm.value - { importFrom = [ "Head", "Seo" ] - , name = "website" - , annotation = - Just - (Type.function - [ Type.namedWith [ "Head", "Seo" ] "Common" [] ] - (Type.list (Type.namedWith [ "Head" ] "Tag" [])) - ) - } - } \ No newline at end of file diff --git a/elm-open-api-codegen/src/Gen/Pages/ConcurrentSubmission.elm b/elm-open-api-codegen/src/Gen/Pages/ConcurrentSubmission.elm deleted file mode 100644 index 4ac7c6d6..00000000 --- a/elm-open-api-codegen/src/Gen/Pages/ConcurrentSubmission.elm +++ /dev/null @@ -1,283 +0,0 @@ -module Gen.Pages.ConcurrentSubmission exposing - ( moduleName_, map, annotation_, make_, caseOf_, call_ - , values_ - ) - -{-| -# Generated bindings for Pages.ConcurrentSubmission - -@docs moduleName_, map, annotation_, make_, caseOf_, call_ -@docs values_ --} - - -import Elm -import Elm.Annotation as Type -import Elm.Arg -import Elm.Case - - -{-| The name of this module. -} -moduleName_ : List String -moduleName_ = - [ "Pages", "ConcurrentSubmission" ] - - -{-| `map` a `ConcurrentSubmission`. Not needed for most high-level cases since this state is managed by the `elm-pages` framework for you. - -map: - (a -> b) - -> Pages.ConcurrentSubmission.ConcurrentSubmission a - -> Pages.ConcurrentSubmission.ConcurrentSubmission b --} -map : (Elm.Expression -> Elm.Expression) -> Elm.Expression -> Elm.Expression -map mapArg_ mapArg_0 = - Elm.apply - (Elm.value - { importFrom = [ "Pages", "ConcurrentSubmission" ] - , name = "map" - , annotation = - Just - (Type.function - [ Type.function [ Type.var "a" ] (Type.var "b") - , Type.namedWith - [ "Pages", "ConcurrentSubmission" ] - "ConcurrentSubmission" - [ Type.var "a" ] - ] - (Type.namedWith - [ "Pages", "ConcurrentSubmission" ] - "ConcurrentSubmission" - [ Type.var "b" ] - ) - ) - } - ) - [ Elm.functionReduced "mapUnpack" mapArg_, mapArg_0 ] - - -annotation_ : - { concurrentSubmission : Type.Annotation -> Type.Annotation - , status : Type.Annotation -> Type.Annotation - } -annotation_ = - { concurrentSubmission = - \concurrentSubmissionArg0 -> - Type.alias - moduleName_ - "ConcurrentSubmission" - [ concurrentSubmissionArg0 ] - (Type.record - [ ( "status" - , Type.namedWith - [ "Pages", "ConcurrentSubmission" ] - "Status" - [ Type.var "actionData" ] - ) - , ( "payload" - , Type.namedWith [ "Pages", "FormData" ] "FormData" [] - ) - , ( "initiatedAt", Type.namedWith [ "Time" ] "Posix" [] ) - ] - ) - , status = - \statusArg0 -> - Type.namedWith - [ "Pages", "ConcurrentSubmission" ] - "Status" - [ statusArg0 ] - } - - -make_ : - { concurrentSubmission : - { status : Elm.Expression - , payload : Elm.Expression - , initiatedAt : Elm.Expression - } - -> Elm.Expression - , submitting : Elm.Expression - , reloading : Elm.Expression -> Elm.Expression - , complete : Elm.Expression -> Elm.Expression - } -make_ = - { concurrentSubmission = - \concurrentSubmission_args -> - Elm.withType - (Type.alias - [ "Pages", "ConcurrentSubmission" ] - "ConcurrentSubmission" - [ Type.var "actionData" ] - (Type.record - [ ( "status" - , Type.namedWith - [ "Pages", "ConcurrentSubmission" ] - "Status" - [ Type.var "actionData" ] - ) - , ( "payload" - , Type.namedWith - [ "Pages", "FormData" ] - "FormData" - [] - ) - , ( "initiatedAt" - , Type.namedWith [ "Time" ] "Posix" [] - ) - ] - ) - ) - (Elm.record - [ Tuple.pair "status" concurrentSubmission_args.status - , Tuple.pair "payload" concurrentSubmission_args.payload - , Tuple.pair - "initiatedAt" - concurrentSubmission_args.initiatedAt - ] - ) - , submitting = - Elm.value - { importFrom = [ "Pages", "ConcurrentSubmission" ] - , name = "Submitting" - , annotation = - Just (Type.namedWith [] "Status" [ Type.var "actionData" ]) - } - , reloading = - \ar0 -> - Elm.apply - (Elm.value - { importFrom = [ "Pages", "ConcurrentSubmission" ] - , name = "Reloading" - , annotation = - Just - (Type.namedWith - [] - "Status" - [ Type.var "actionData" ] - ) - } - ) - [ ar0 ] - , complete = - \ar0 -> - Elm.apply - (Elm.value - { importFrom = [ "Pages", "ConcurrentSubmission" ] - , name = "Complete" - , annotation = - Just - (Type.namedWith - [] - "Status" - [ Type.var "actionData" ] - ) - } - ) - [ ar0 ] - } - - -caseOf_ : - { status : - Elm.Expression - -> { submitting : Elm.Expression - , reloading : Elm.Expression -> Elm.Expression - , complete : Elm.Expression -> Elm.Expression - } - -> Elm.Expression - } -caseOf_ = - { status = - \statusExpression statusTags -> - Elm.Case.custom - statusExpression - (Type.namedWith - [ "Pages", "ConcurrentSubmission" ] - "Status" - [ Type.var "actionData" ] - ) - [ Elm.Case.branch - (Elm.Arg.customType "Submitting" statusTags.submitting) - Basics.identity - , Elm.Case.branch - (Elm.Arg.customType - "Reloading" - statusTags.reloading |> Elm.Arg.item - (Elm.Arg.varWith - "actionData" - (Type.var - "actionData" - ) - ) - ) - Basics.identity - , Elm.Case.branch - (Elm.Arg.customType - "Complete" - statusTags.complete |> Elm.Arg.item - (Elm.Arg.varWith - "actionData" - (Type.var - "actionData" - ) - ) - ) - Basics.identity - ] - } - - -call_ : { map : Elm.Expression -> Elm.Expression -> Elm.Expression } -call_ = - { map = - \mapArg_ mapArg_0 -> - Elm.apply - (Elm.value - { importFrom = [ "Pages", "ConcurrentSubmission" ] - , name = "map" - , annotation = - Just - (Type.function - [ Type.function - [ Type.var "a" ] - (Type.var "b") - , Type.namedWith - [ "Pages", "ConcurrentSubmission" ] - "ConcurrentSubmission" - [ Type.var "a" ] - ] - (Type.namedWith - [ "Pages", "ConcurrentSubmission" ] - "ConcurrentSubmission" - [ Type.var "b" ] - ) - ) - } - ) - [ mapArg_, mapArg_0 ] - } - - -values_ : { map : Elm.Expression } -values_ = - { map = - Elm.value - { importFrom = [ "Pages", "ConcurrentSubmission" ] - , name = "map" - , annotation = - Just - (Type.function - [ Type.function [ Type.var "a" ] (Type.var "b") - , Type.namedWith - [ "Pages", "ConcurrentSubmission" ] - "ConcurrentSubmission" - [ Type.var "a" ] - ] - (Type.namedWith - [ "Pages", "ConcurrentSubmission" ] - "ConcurrentSubmission" - [ Type.var "b" ] - ) - ) - } - } \ No newline at end of file diff --git a/elm-open-api-codegen/src/Gen/Pages/Fetcher.elm b/elm-open-api-codegen/src/Gen/Pages/Fetcher.elm deleted file mode 100644 index 8c6df589..00000000 --- a/elm-open-api-codegen/src/Gen/Pages/Fetcher.elm +++ /dev/null @@ -1,375 +0,0 @@ -module Gen.Pages.Fetcher exposing - ( moduleName_, submit, map, annotation_, make_, caseOf_ - , call_, values_ - ) - -{-| -# Generated bindings for Pages.Fetcher - -@docs moduleName_, submit, map, annotation_, make_, caseOf_ -@docs call_, values_ --} - - -import Elm -import Elm.Annotation as Type -import Elm.Arg -import Elm.Case - - -{-| The name of this module. -} -moduleName_ : List String -moduleName_ = - [ "Pages", "Fetcher" ] - - -{-| submit: - Bytes.Decode.Decoder decoded - -> { fields : List ( String, String ), headers : List ( String, String ) } - -> Pages.Fetcher.Fetcher (Result.Result Http.Error decoded) --} -submit : - Elm.Expression - -> { fields : List Elm.Expression, headers : List Elm.Expression } - -> Elm.Expression -submit submitArg_ submitArg_0 = - Elm.apply - (Elm.value - { importFrom = [ "Pages", "Fetcher" ] - , name = "submit" - , annotation = - Just - (Type.function - [ Type.namedWith - [ "Bytes", "Decode" ] - "Decoder" - [ Type.var "decoded" ] - , Type.record - [ ( "fields" - , Type.list (Type.tuple Type.string Type.string) - ) - , ( "headers" - , Type.list (Type.tuple Type.string Type.string) - ) - ] - ] - (Type.namedWith - [ "Pages", "Fetcher" ] - "Fetcher" - [ Type.namedWith - [ "Result" ] - "Result" - [ Type.namedWith [ "Http" ] "Error" [] - , Type.var "decoded" - ] - ] - ) - ) - } - ) - [ submitArg_ - , Elm.record - [ Tuple.pair "fields" (Elm.list submitArg_0.fields) - , Tuple.pair "headers" (Elm.list submitArg_0.headers) - ] - ] - - -{-| map: (a -> b) -> Pages.Fetcher.Fetcher a -> Pages.Fetcher.Fetcher b -} -map : (Elm.Expression -> Elm.Expression) -> Elm.Expression -> Elm.Expression -map mapArg_ mapArg_0 = - Elm.apply - (Elm.value - { importFrom = [ "Pages", "Fetcher" ] - , name = "map" - , annotation = - Just - (Type.function - [ Type.function [ Type.var "a" ] (Type.var "b") - , Type.namedWith - [ "Pages", "Fetcher" ] - "Fetcher" - [ Type.var "a" ] - ] - (Type.namedWith - [ "Pages", "Fetcher" ] - "Fetcher" - [ Type.var "b" ] - ) - ) - } - ) - [ Elm.functionReduced "mapUnpack" mapArg_, mapArg_0 ] - - -annotation_ : - { fetcher : Type.Annotation -> Type.Annotation - , fetcherInfo : Type.Annotation -> Type.Annotation - } -annotation_ = - { fetcher = - \fetcherArg0 -> - Type.namedWith [ "Pages", "Fetcher" ] "Fetcher" [ fetcherArg0 ] - , fetcherInfo = - \fetcherInfoArg0 -> - Type.alias - moduleName_ - "FetcherInfo" - [ fetcherInfoArg0 ] - (Type.record - [ ( "decoder" - , Type.function - [ Type.namedWith - [ "Result" ] - "Result" - [ Type.namedWith [ "Http" ] "Error" [] - , Type.namedWith [ "Bytes" ] "Bytes" [] - ] - ] - (Type.var "decoded") - ) - , ( "fields" - , Type.list (Type.tuple Type.string Type.string) - ) - , ( "headers" - , Type.list (Type.tuple Type.string Type.string) - ) - , ( "url", Type.maybe Type.string ) - ] - ) - } - - -make_ : - { fetcher : Elm.Expression -> Elm.Expression - , fetcherInfo : - { decoder : Elm.Expression - , fields : Elm.Expression - , headers : Elm.Expression - , url : Elm.Expression - } - -> Elm.Expression - } -make_ = - { fetcher = - \ar0 -> - Elm.apply - (Elm.value - { importFrom = [ "Pages", "Fetcher" ] - , name = "Fetcher" - , annotation = - Just - (Type.namedWith [] "Fetcher" [ Type.var "decoded" ] - ) - } - ) - [ ar0 ] - , fetcherInfo = - \fetcherInfo_args -> - Elm.withType - (Type.alias - [ "Pages", "Fetcher" ] - "FetcherInfo" - [ Type.var "decoded" ] - (Type.record - [ ( "decoder" - , Type.function - [ Type.namedWith - [ "Result" ] - "Result" - [ Type.namedWith [ "Http" ] "Error" [] - , Type.namedWith [ "Bytes" ] "Bytes" [] - ] - ] - (Type.var "decoded") - ) - , ( "fields" - , Type.list (Type.tuple Type.string Type.string) - ) - , ( "headers" - , Type.list (Type.tuple Type.string Type.string) - ) - , ( "url", Type.maybe Type.string ) - ] - ) - ) - (Elm.record - [ Tuple.pair "decoder" fetcherInfo_args.decoder - , Tuple.pair "fields" fetcherInfo_args.fields - , Tuple.pair "headers" fetcherInfo_args.headers - , Tuple.pair "url" fetcherInfo_args.url - ] - ) - } - - -caseOf_ : - { fetcher : - Elm.Expression - -> { fetcher : Elm.Expression -> Elm.Expression } - -> Elm.Expression - } -caseOf_ = - { fetcher = - \fetcherExpression fetcherTags -> - Elm.Case.custom - fetcherExpression - (Type.namedWith - [ "Pages", "Fetcher" ] - "Fetcher" - [ Type.var "decoded" ] - ) - [ Elm.Case.branch - (Elm.Arg.customType - "Fetcher" - fetcherTags.fetcher |> Elm.Arg.item - (Elm.Arg.varWith - "pagesFetcherFetcherInfo" - (Type.namedWith - [ "Pages" - , "Fetcher" - ] - "FetcherInfo" - [ Type.var - "decoded" - ] - ) - ) - ) - Basics.identity - ] - } - - -call_ : - { submit : Elm.Expression -> Elm.Expression -> Elm.Expression - , map : Elm.Expression -> Elm.Expression -> Elm.Expression - } -call_ = - { submit = - \submitArg_ submitArg_0 -> - Elm.apply - (Elm.value - { importFrom = [ "Pages", "Fetcher" ] - , name = "submit" - , annotation = - Just - (Type.function - [ Type.namedWith - [ "Bytes", "Decode" ] - "Decoder" - [ Type.var "decoded" ] - , Type.record - [ ( "fields" - , Type.list - (Type.tuple Type.string Type.string) - ) - , ( "headers" - , Type.list - (Type.tuple Type.string Type.string) - ) - ] - ] - (Type.namedWith - [ "Pages", "Fetcher" ] - "Fetcher" - [ Type.namedWith - [ "Result" ] - "Result" - [ Type.namedWith - [ "Http" ] - "Error" - [] - , Type.var "decoded" - ] - ] - ) - ) - } - ) - [ submitArg_, submitArg_0 ] - , map = - \mapArg_ mapArg_0 -> - Elm.apply - (Elm.value - { importFrom = [ "Pages", "Fetcher" ] - , name = "map" - , annotation = - Just - (Type.function - [ Type.function - [ Type.var "a" ] - (Type.var "b") - , Type.namedWith - [ "Pages", "Fetcher" ] - "Fetcher" - [ Type.var "a" ] - ] - (Type.namedWith - [ "Pages", "Fetcher" ] - "Fetcher" - [ Type.var "b" ] - ) - ) - } - ) - [ mapArg_, mapArg_0 ] - } - - -values_ : { submit : Elm.Expression, map : Elm.Expression } -values_ = - { submit = - Elm.value - { importFrom = [ "Pages", "Fetcher" ] - , name = "submit" - , annotation = - Just - (Type.function - [ Type.namedWith - [ "Bytes", "Decode" ] - "Decoder" - [ Type.var "decoded" ] - , Type.record - [ ( "fields" - , Type.list (Type.tuple Type.string Type.string) - ) - , ( "headers" - , Type.list (Type.tuple Type.string Type.string) - ) - ] - ] - (Type.namedWith - [ "Pages", "Fetcher" ] - "Fetcher" - [ Type.namedWith - [ "Result" ] - "Result" - [ Type.namedWith [ "Http" ] "Error" [] - , Type.var "decoded" - ] - ] - ) - ) - } - , map = - Elm.value - { importFrom = [ "Pages", "Fetcher" ] - , name = "map" - , annotation = - Just - (Type.function - [ Type.function [ Type.var "a" ] (Type.var "b") - , Type.namedWith - [ "Pages", "Fetcher" ] - "Fetcher" - [ Type.var "a" ] - ] - (Type.namedWith - [ "Pages", "Fetcher" ] - "Fetcher" - [ Type.var "b" ] - ) - ) - } - } \ No newline at end of file diff --git a/elm-open-api-codegen/src/Gen/Pages/Flags.elm b/elm-open-api-codegen/src/Gen/Pages/Flags.elm deleted file mode 100644 index 7b364709..00000000 --- a/elm-open-api-codegen/src/Gen/Pages/Flags.elm +++ /dev/null @@ -1,80 +0,0 @@ -module Gen.Pages.Flags exposing ( moduleName_, annotation_, make_, caseOf_ ) - -{-| -# Generated bindings for Pages.Flags - -@docs moduleName_, annotation_, make_, caseOf_ --} - - -import Elm -import Elm.Annotation as Type -import Elm.Arg -import Elm.Case - - -{-| The name of this module. -} -moduleName_ : List String -moduleName_ = - [ "Pages", "Flags" ] - - -annotation_ : { flags : Type.Annotation } -annotation_ = - { flags = Type.namedWith [ "Pages", "Flags" ] "Flags" [] } - - -make_ : - { browserFlags : Elm.Expression -> Elm.Expression - , preRenderFlags : Elm.Expression - } -make_ = - { browserFlags = - \ar0 -> - Elm.apply - (Elm.value - { importFrom = [ "Pages", "Flags" ] - , name = "BrowserFlags" - , annotation = Just (Type.namedWith [] "Flags" []) - } - ) - [ ar0 ] - , preRenderFlags = - Elm.value - { importFrom = [ "Pages", "Flags" ] - , name = "PreRenderFlags" - , annotation = Just (Type.namedWith [] "Flags" []) - } - } - - -caseOf_ = - { flags = - \flagsExpression flagsTags -> - Elm.Case.custom - flagsExpression - (Type.namedWith [ "Pages", "Flags" ] "Flags" []) - [ Elm.Case.branch - (Elm.Arg.customType - "BrowserFlags" - flagsTags.browserFlags |> Elm.Arg.item - (Elm.Arg.varWith - "jsonDecodeValue" - (Type.namedWith - [ "Json" - , "Decode" - ] - "Value" - [] - ) - ) - ) - Basics.identity - , Elm.Case.branch - (Elm.Arg.customType - "PreRenderFlags" - flagsTags.preRenderFlags - ) - Basics.identity - ] - } \ No newline at end of file diff --git a/elm-open-api-codegen/src/Gen/Pages/Form.elm b/elm-open-api-codegen/src/Gen/Pages/Form.elm deleted file mode 100644 index bee2445f..00000000 --- a/elm-open-api-codegen/src/Gen/Pages/Form.elm +++ /dev/null @@ -1,1036 +0,0 @@ -module Gen.Pages.Form exposing - ( moduleName_, renderHtml, renderStyledHtml, withConcurrent, annotation_, call_ - , values_ - ) - -{-| -# Generated bindings for Pages.Form - -@docs moduleName_, renderHtml, renderStyledHtml, withConcurrent, annotation_, call_ -@docs values_ --} - - -import Elm -import Elm.Annotation as Type - - -{-| The name of this module. -} -moduleName_ : List String -moduleName_ = - [ "Pages", "Form" ] - - -{-| A replacement for `Form.renderHtml` from `dillonkearns/elm-form` that integrates with `elm-pages`. Use this to render your [`Form`](https://package.elm-lang.org/packages/dillonkearns/elm-form/latest/Form) -as `elm/html` `Html`. - -renderHtml: - List (Html.Attribute (PagesMsg.PagesMsg userMsg)) - -> Pages.Form.Options error parsed input userMsg - -> { app - | pageFormState : Form.Model - , navigation : Maybe Pages.Navigation.Navigation - , concurrentSubmissions : - Dict.Dict String (Pages.ConcurrentSubmission.ConcurrentSubmission (Maybe action)) - } - -> Form.Form error { combine : - Form.Validation.Validation error parsed named constraints - , view : - Form.Context error input -> List (Html.Html (PagesMsg.PagesMsg userMsg)) - } parsed input - -> Html.Html (PagesMsg.PagesMsg userMsg) --} -renderHtml : - List Elm.Expression - -> Elm.Expression - -> { app - | pageFormState : Elm.Expression - , navigation : Elm.Expression - , concurrentSubmissions : Elm.Expression - } - -> Elm.Expression - -> Elm.Expression -renderHtml renderHtmlArg_ renderHtmlArg_0 renderHtmlArg_1 renderHtmlArg_2 = - Elm.apply - (Elm.value - { importFrom = [ "Pages", "Form" ] - , name = "renderHtml" - , annotation = - Just - (Type.function - [ Type.list - (Type.namedWith - [ "Html" ] - "Attribute" - [ Type.namedWith - [ "PagesMsg" ] - "PagesMsg" - [ Type.var "userMsg" ] - ] - ) - , Type.namedWith - [ "Pages", "Form" ] - "Options" - [ Type.var "error" - , Type.var "parsed" - , Type.var "input" - , Type.var "userMsg" - ] - , Type.extensible - "app" - [ ( "pageFormState" - , Type.namedWith [ "Form" ] "Model" [] - ) - , ( "navigation" - , Type.maybe - (Type.namedWith - [ "Pages", "Navigation" ] - "Navigation" - [] - ) - ) - , ( "concurrentSubmissions" - , Type.namedWith - [ "Dict" ] - "Dict" - [ Type.string - , Type.namedWith - [ "Pages", "ConcurrentSubmission" ] - "ConcurrentSubmission" - [ Type.maybe (Type.var "action") ] - ] - ) - ] - , Type.namedWith - [ "Form" ] - "Form" - [ Type.var "error" - , Type.record - [ ( "combine" - , Type.namedWith - [ "Form", "Validation" ] - "Validation" - [ Type.var "error" - , Type.var "parsed" - , Type.var "named" - , Type.var "constraints" - ] - ) - , ( "view" - , Type.function - [ Type.namedWith - [ "Form" ] - "Context" - [ Type.var "error" - , Type.var "input" - ] - ] - (Type.list - (Type.namedWith - [ "Html" ] - "Html" - [ Type.namedWith - [ "PagesMsg" ] - "PagesMsg" - [ Type.var "userMsg" ] - ] - ) - ) - ) - ] - , Type.var "parsed" - , Type.var "input" - ] - ] - (Type.namedWith - [ "Html" ] - "Html" - [ Type.namedWith - [ "PagesMsg" ] - "PagesMsg" - [ Type.var "userMsg" ] - ] - ) - ) - } - ) - [ Elm.list renderHtmlArg_ - , renderHtmlArg_0 - , Elm.record - [ Tuple.pair "pageFormState" renderHtmlArg_1.pageFormState - , Tuple.pair "navigation" renderHtmlArg_1.navigation - , Tuple.pair - "concurrentSubmissions" - renderHtmlArg_1.concurrentSubmissions - ] - , renderHtmlArg_2 - ] - - -{-| A replacement for `Form.renderStyledHtml` from `dillonkearns/elm-form` that integrates with `elm-pages`. Use this to render your [`Form`](https://package.elm-lang.org/packages/dillonkearns/elm-form/latest/Form) -as `rtfeldman/elm-css` `Html.Styled.Html`. - -renderStyledHtml: - List (Html.Styled.Attribute (PagesMsg.PagesMsg userMsg)) - -> Pages.Form.Options error parsed input userMsg - -> { app - | pageFormState : Form.Model - , navigation : Maybe Pages.Navigation.Navigation - , concurrentSubmissions : - Dict.Dict String (Pages.ConcurrentSubmission.ConcurrentSubmission (Maybe action)) - } - -> Form.Form error { combine : - Form.Validation.Validation error parsed named constraints - , view : - Form.Context error input - -> List (Html.Styled.Html (PagesMsg.PagesMsg userMsg)) - } parsed input - -> Html.Styled.Html (PagesMsg.PagesMsg userMsg) --} -renderStyledHtml : - List Elm.Expression - -> Elm.Expression - -> { app - | pageFormState : Elm.Expression - , navigation : Elm.Expression - , concurrentSubmissions : Elm.Expression - } - -> Elm.Expression - -> Elm.Expression -renderStyledHtml renderStyledHtmlArg_ renderStyledHtmlArg_0 renderStyledHtmlArg_1 renderStyledHtmlArg_2 = - Elm.apply - (Elm.value - { importFrom = [ "Pages", "Form" ] - , name = "renderStyledHtml" - , annotation = - Just - (Type.function - [ Type.list - (Type.namedWith - [ "Html", "Styled" ] - "Attribute" - [ Type.namedWith - [ "PagesMsg" ] - "PagesMsg" - [ Type.var "userMsg" ] - ] - ) - , Type.namedWith - [ "Pages", "Form" ] - "Options" - [ Type.var "error" - , Type.var "parsed" - , Type.var "input" - , Type.var "userMsg" - ] - , Type.extensible - "app" - [ ( "pageFormState" - , Type.namedWith [ "Form" ] "Model" [] - ) - , ( "navigation" - , Type.maybe - (Type.namedWith - [ "Pages", "Navigation" ] - "Navigation" - [] - ) - ) - , ( "concurrentSubmissions" - , Type.namedWith - [ "Dict" ] - "Dict" - [ Type.string - , Type.namedWith - [ "Pages", "ConcurrentSubmission" ] - "ConcurrentSubmission" - [ Type.maybe (Type.var "action") ] - ] - ) - ] - , Type.namedWith - [ "Form" ] - "Form" - [ Type.var "error" - , Type.record - [ ( "combine" - , Type.namedWith - [ "Form", "Validation" ] - "Validation" - [ Type.var "error" - , Type.var "parsed" - , Type.var "named" - , Type.var "constraints" - ] - ) - , ( "view" - , Type.function - [ Type.namedWith - [ "Form" ] - "Context" - [ Type.var "error" - , Type.var "input" - ] - ] - (Type.list - (Type.namedWith - [ "Html", "Styled" ] - "Html" - [ Type.namedWith - [ "PagesMsg" ] - "PagesMsg" - [ Type.var "userMsg" ] - ] - ) - ) - ) - ] - , Type.var "parsed" - , Type.var "input" - ] - ] - (Type.namedWith - [ "Html", "Styled" ] - "Html" - [ Type.namedWith - [ "PagesMsg" ] - "PagesMsg" - [ Type.var "userMsg" ] - ] - ) - ) - } - ) - [ Elm.list renderStyledHtmlArg_ - , renderStyledHtmlArg_0 - , Elm.record - [ Tuple.pair "pageFormState" renderStyledHtmlArg_1.pageFormState - , Tuple.pair "navigation" renderStyledHtmlArg_1.navigation - , Tuple.pair - "concurrentSubmissions" - renderStyledHtmlArg_1.concurrentSubmissions - ] - , renderStyledHtmlArg_2 - ] - - -{-| Instead of using the default submission strategy (tied to the page's navigation state), you can use `withConcurrent`. -`withConcurrent` allows multiple form submissions to be in flight at the same time. It is useful for more dynamic applications. A good rule of thumb -is if you could have multiple pending spinners on the page at the same time, you should use `withConcurrent`. For example, if you have a page with a list of items, -say a Twitter clone. If you click the like button on a Tweet, it won't result in a page navigation. You can click the like button on multiple Tweets at the same time -and they will all submit independently. - -In the case of Twitter, there isn't an indication of a loading spinner on the like button because it is expected that it will succeed. This is an example of a User Experience (UX) pattern -called Optimistic UI. Since it is very likely that liking a Tweet will be successful, the UI will update the UI as if it has immediately succeeded even though the request is still in flight. -If the request fails, the UI will be updated to reflect the failure with an animation to show that something went wrong. - -The `withConcurrent` is a good fit for either of these UX patterns (Optimistic UI or Pending UI, i.e. showing a loading spinner). You can derive either of these -visual states from the `app.concurrentSubmissions` field in your `Route` module. - -You can call `withConcurrent` on your `Form.Options`. Note that while `withConcurrent` will allow multiple form submissions to be in flight at the same time independently, -the ID of the Form will still have a unique submission. For example, if you click submit on a form with the ID `"edit-123"` and then submit it again before the first submission has completed, -the second submission will cancel the first submission. So it is important to use unique IDs for forms that represent unique operations. - - import Form - import Pages.Form - - todoItemView app todo = - deleteItemForm - |> Pages.Form.renderHtml [] - (Form.options ("delete-" ++ todo.id) - |> Form.withInput todo - |> Pages.Form.withConcurrent - ) - app - -withConcurrent: - Pages.Form.Options error parsed input msg - -> Pages.Form.Options error parsed input msg --} -withConcurrent : Elm.Expression -> Elm.Expression -withConcurrent withConcurrentArg_ = - Elm.apply - (Elm.value - { importFrom = [ "Pages", "Form" ] - , name = "withConcurrent" - , annotation = - Just - (Type.function - [ Type.namedWith - [ "Pages", "Form" ] - "Options" - [ Type.var "error" - , Type.var "parsed" - , Type.var "input" - , Type.var "msg" - ] - ] - (Type.namedWith - [ "Pages", "Form" ] - "Options" - [ Type.var "error" - , Type.var "parsed" - , Type.var "input" - , Type.var "msg" - ] - ) - ) - } - ) - [ withConcurrentArg_ ] - - -annotation_ : - { options : - Type.Annotation - -> Type.Annotation - -> Type.Annotation - -> Type.Annotation - -> Type.Annotation - , formWithServerValidations : - Type.Annotation - -> Type.Annotation - -> Type.Annotation - -> Type.Annotation - -> Type.Annotation - , handler : Type.Annotation -> Type.Annotation -> Type.Annotation - } -annotation_ = - { options = - \optionsArg0 optionsArg1 optionsArg2 optionsArg3 -> - Type.alias - moduleName_ - "Options" - [ optionsArg0, optionsArg1, optionsArg2, optionsArg3 ] - (Type.namedWith - [ "Form" ] - "Options" - [ Type.var "error" - , Type.var "parsed" - , Type.var "input" - , Type.var "msg" - , Type.record [ ( "concurrent", Type.bool ) ] - ] - ) - , formWithServerValidations = - \formWithServerValidationsArg0 formWithServerValidationsArg1 formWithServerValidationsArg2 formWithServerValidationsArg3 -> - Type.alias - moduleName_ - "FormWithServerValidations" - [ formWithServerValidationsArg0 - , formWithServerValidationsArg1 - , formWithServerValidationsArg2 - , formWithServerValidationsArg3 - ] - (Type.namedWith - [ "Form" ] - "Form" - [ Type.var "error" - , Type.record - [ ( "combine" - , Type.namedWith - [ "Form", "Validation" ] - "Validation" - [ Type.var "error" - , Type.namedWith - [ "BackendTask" ] - "BackendTask" - [ Type.namedWith - [ "FatalError" ] - "FatalError" - [] - , Type.namedWith - [ "Form", "Validation" ] - "Validation" - [ Type.var "error" - , Type.var "combined" - , Type.namedWith - [ "Basics" ] - "Never" - [] - , Type.namedWith - [ "Basics" ] - "Never" - [] - ] - ] - , Type.namedWith [ "Basics" ] "Never" [] - , Type.namedWith [ "Basics" ] "Never" [] - ] - ) - , ( "view" - , Type.function - [ Type.namedWith - [ "Form" ] - "Context" - [ Type.var "error", Type.var "input" ] - ] - (Type.var "view") - ) - ] - , Type.namedWith - [ "BackendTask" ] - "BackendTask" - [ Type.namedWith [ "FatalError" ] "FatalError" [] - , Type.namedWith - [ "Form", "Validation" ] - "Validation" - [ Type.var "error" - , Type.var "combined" - , Type.namedWith [ "Basics" ] "Never" [] - , Type.namedWith [ "Basics" ] "Never" [] - ] - ] - , Type.var "input" - ] - ) - , handler = - \handlerArg0 handlerArg1 -> - Type.alias - moduleName_ - "Handler" - [ handlerArg0, handlerArg1 ] - (Type.namedWith - [ "Form", "Handler" ] - "Handler" - [ Type.var "error" - , Type.namedWith - [ "BackendTask" ] - "BackendTask" - [ Type.namedWith [ "FatalError" ] "FatalError" [] - , Type.namedWith - [ "Form", "Validation" ] - "Validation" - [ Type.var "error" - , Type.var "combined" - , Type.namedWith [ "Basics" ] "Never" [] - , Type.namedWith [ "Basics" ] "Never" [] - ] - ] - ] - ) - } - - -call_ : - { renderHtml : - Elm.Expression - -> Elm.Expression - -> Elm.Expression - -> Elm.Expression - -> Elm.Expression - , renderStyledHtml : - Elm.Expression - -> Elm.Expression - -> Elm.Expression - -> Elm.Expression - -> Elm.Expression - , withConcurrent : Elm.Expression -> Elm.Expression - } -call_ = - { renderHtml = - \renderHtmlArg_ renderHtmlArg_0 renderHtmlArg_1 renderHtmlArg_2 -> - Elm.apply - (Elm.value - { importFrom = [ "Pages", "Form" ] - , name = "renderHtml" - , annotation = - Just - (Type.function - [ Type.list - (Type.namedWith - [ "Html" ] - "Attribute" - [ Type.namedWith - [ "PagesMsg" ] - "PagesMsg" - [ Type.var "userMsg" ] - ] - ) - , Type.namedWith - [ "Pages", "Form" ] - "Options" - [ Type.var "error" - , Type.var "parsed" - , Type.var "input" - , Type.var "userMsg" - ] - , Type.extensible - "app" - [ ( "pageFormState" - , Type.namedWith [ "Form" ] "Model" [] - ) - , ( "navigation" - , Type.maybe - (Type.namedWith - [ "Pages", "Navigation" ] - "Navigation" - [] - ) - ) - , ( "concurrentSubmissions" - , Type.namedWith - [ "Dict" ] - "Dict" - [ Type.string - , Type.namedWith - [ "Pages" - , "ConcurrentSubmission" - ] - "ConcurrentSubmission" - [ Type.maybe - (Type.var "action") - ] - ] - ) - ] - , Type.namedWith - [ "Form" ] - "Form" - [ Type.var "error" - , Type.record - [ ( "combine" - , Type.namedWith - [ "Form", "Validation" ] - "Validation" - [ Type.var "error" - , Type.var "parsed" - , Type.var "named" - , Type.var "constraints" - ] - ) - , ( "view" - , Type.function - [ Type.namedWith - [ "Form" ] - "Context" - [ Type.var "error" - , Type.var "input" - ] - ] - (Type.list - (Type.namedWith - [ "Html" ] - "Html" - [ Type.namedWith - [ "PagesMsg" ] - "PagesMsg" - [ Type.var - "userMsg" - ] - ] - ) - ) - ) - ] - , Type.var "parsed" - , Type.var "input" - ] - ] - (Type.namedWith - [ "Html" ] - "Html" - [ Type.namedWith - [ "PagesMsg" ] - "PagesMsg" - [ Type.var "userMsg" ] - ] - ) - ) - } - ) - [ renderHtmlArg_ - , renderHtmlArg_0 - , renderHtmlArg_1 - , renderHtmlArg_2 - ] - , renderStyledHtml = - \renderStyledHtmlArg_ renderStyledHtmlArg_0 renderStyledHtmlArg_1 renderStyledHtmlArg_2 -> - Elm.apply - (Elm.value - { importFrom = [ "Pages", "Form" ] - , name = "renderStyledHtml" - , annotation = - Just - (Type.function - [ Type.list - (Type.namedWith - [ "Html", "Styled" ] - "Attribute" - [ Type.namedWith - [ "PagesMsg" ] - "PagesMsg" - [ Type.var "userMsg" ] - ] - ) - , Type.namedWith - [ "Pages", "Form" ] - "Options" - [ Type.var "error" - , Type.var "parsed" - , Type.var "input" - , Type.var "userMsg" - ] - , Type.extensible - "app" - [ ( "pageFormState" - , Type.namedWith [ "Form" ] "Model" [] - ) - , ( "navigation" - , Type.maybe - (Type.namedWith - [ "Pages", "Navigation" ] - "Navigation" - [] - ) - ) - , ( "concurrentSubmissions" - , Type.namedWith - [ "Dict" ] - "Dict" - [ Type.string - , Type.namedWith - [ "Pages" - , "ConcurrentSubmission" - ] - "ConcurrentSubmission" - [ Type.maybe - (Type.var "action") - ] - ] - ) - ] - , Type.namedWith - [ "Form" ] - "Form" - [ Type.var "error" - , Type.record - [ ( "combine" - , Type.namedWith - [ "Form", "Validation" ] - "Validation" - [ Type.var "error" - , Type.var "parsed" - , Type.var "named" - , Type.var "constraints" - ] - ) - , ( "view" - , Type.function - [ Type.namedWith - [ "Form" ] - "Context" - [ Type.var "error" - , Type.var "input" - ] - ] - (Type.list - (Type.namedWith - [ "Html" - , "Styled" - ] - "Html" - [ Type.namedWith - [ "PagesMsg" ] - "PagesMsg" - [ Type.var - "userMsg" - ] - ] - ) - ) - ) - ] - , Type.var "parsed" - , Type.var "input" - ] - ] - (Type.namedWith - [ "Html", "Styled" ] - "Html" - [ Type.namedWith - [ "PagesMsg" ] - "PagesMsg" - [ Type.var "userMsg" ] - ] - ) - ) - } - ) - [ renderStyledHtmlArg_ - , renderStyledHtmlArg_0 - , renderStyledHtmlArg_1 - , renderStyledHtmlArg_2 - ] - , withConcurrent = - \withConcurrentArg_ -> - Elm.apply - (Elm.value - { importFrom = [ "Pages", "Form" ] - , name = "withConcurrent" - , annotation = - Just - (Type.function - [ Type.namedWith - [ "Pages", "Form" ] - "Options" - [ Type.var "error" - , Type.var "parsed" - , Type.var "input" - , Type.var "msg" - ] - ] - (Type.namedWith - [ "Pages", "Form" ] - "Options" - [ Type.var "error" - , Type.var "parsed" - , Type.var "input" - , Type.var "msg" - ] - ) - ) - } - ) - [ withConcurrentArg_ ] - } - - -values_ : - { renderHtml : Elm.Expression - , renderStyledHtml : Elm.Expression - , withConcurrent : Elm.Expression - } -values_ = - { renderHtml = - Elm.value - { importFrom = [ "Pages", "Form" ] - , name = "renderHtml" - , annotation = - Just - (Type.function - [ Type.list - (Type.namedWith - [ "Html" ] - "Attribute" - [ Type.namedWith - [ "PagesMsg" ] - "PagesMsg" - [ Type.var "userMsg" ] - ] - ) - , Type.namedWith - [ "Pages", "Form" ] - "Options" - [ Type.var "error" - , Type.var "parsed" - , Type.var "input" - , Type.var "userMsg" - ] - , Type.extensible - "app" - [ ( "pageFormState" - , Type.namedWith [ "Form" ] "Model" [] - ) - , ( "navigation" - , Type.maybe - (Type.namedWith - [ "Pages", "Navigation" ] - "Navigation" - [] - ) - ) - , ( "concurrentSubmissions" - , Type.namedWith - [ "Dict" ] - "Dict" - [ Type.string - , Type.namedWith - [ "Pages", "ConcurrentSubmission" ] - "ConcurrentSubmission" - [ Type.maybe (Type.var "action") ] - ] - ) - ] - , Type.namedWith - [ "Form" ] - "Form" - [ Type.var "error" - , Type.record - [ ( "combine" - , Type.namedWith - [ "Form", "Validation" ] - "Validation" - [ Type.var "error" - , Type.var "parsed" - , Type.var "named" - , Type.var "constraints" - ] - ) - , ( "view" - , Type.function - [ Type.namedWith - [ "Form" ] - "Context" - [ Type.var "error" - , Type.var "input" - ] - ] - (Type.list - (Type.namedWith - [ "Html" ] - "Html" - [ Type.namedWith - [ "PagesMsg" ] - "PagesMsg" - [ Type.var "userMsg" ] - ] - ) - ) - ) - ] - , Type.var "parsed" - , Type.var "input" - ] - ] - (Type.namedWith - [ "Html" ] - "Html" - [ Type.namedWith - [ "PagesMsg" ] - "PagesMsg" - [ Type.var "userMsg" ] - ] - ) - ) - } - , renderStyledHtml = - Elm.value - { importFrom = [ "Pages", "Form" ] - , name = "renderStyledHtml" - , annotation = - Just - (Type.function - [ Type.list - (Type.namedWith - [ "Html", "Styled" ] - "Attribute" - [ Type.namedWith - [ "PagesMsg" ] - "PagesMsg" - [ Type.var "userMsg" ] - ] - ) - , Type.namedWith - [ "Pages", "Form" ] - "Options" - [ Type.var "error" - , Type.var "parsed" - , Type.var "input" - , Type.var "userMsg" - ] - , Type.extensible - "app" - [ ( "pageFormState" - , Type.namedWith [ "Form" ] "Model" [] - ) - , ( "navigation" - , Type.maybe - (Type.namedWith - [ "Pages", "Navigation" ] - "Navigation" - [] - ) - ) - , ( "concurrentSubmissions" - , Type.namedWith - [ "Dict" ] - "Dict" - [ Type.string - , Type.namedWith - [ "Pages", "ConcurrentSubmission" ] - "ConcurrentSubmission" - [ Type.maybe (Type.var "action") ] - ] - ) - ] - , Type.namedWith - [ "Form" ] - "Form" - [ Type.var "error" - , Type.record - [ ( "combine" - , Type.namedWith - [ "Form", "Validation" ] - "Validation" - [ Type.var "error" - , Type.var "parsed" - , Type.var "named" - , Type.var "constraints" - ] - ) - , ( "view" - , Type.function - [ Type.namedWith - [ "Form" ] - "Context" - [ Type.var "error" - , Type.var "input" - ] - ] - (Type.list - (Type.namedWith - [ "Html", "Styled" ] - "Html" - [ Type.namedWith - [ "PagesMsg" ] - "PagesMsg" - [ Type.var "userMsg" ] - ] - ) - ) - ) - ] - , Type.var "parsed" - , Type.var "input" - ] - ] - (Type.namedWith - [ "Html", "Styled" ] - "Html" - [ Type.namedWith - [ "PagesMsg" ] - "PagesMsg" - [ Type.var "userMsg" ] - ] - ) - ) - } - , withConcurrent = - Elm.value - { importFrom = [ "Pages", "Form" ] - , name = "withConcurrent" - , annotation = - Just - (Type.function - [ Type.namedWith - [ "Pages", "Form" ] - "Options" - [ Type.var "error" - , Type.var "parsed" - , Type.var "input" - , Type.var "msg" - ] - ] - (Type.namedWith - [ "Pages", "Form" ] - "Options" - [ Type.var "error" - , Type.var "parsed" - , Type.var "input" - , Type.var "msg" - ] - ) - ) - } - } \ No newline at end of file diff --git a/elm-open-api-codegen/src/Gen/Pages/FormData.elm b/elm-open-api-codegen/src/Gen/Pages/FormData.elm deleted file mode 100644 index 8b3b6625..00000000 --- a/elm-open-api-codegen/src/Gen/Pages/FormData.elm +++ /dev/null @@ -1,71 +0,0 @@ -module Gen.Pages.FormData exposing ( moduleName_, annotation_, make_ ) - -{-| -# Generated bindings for Pages.FormData - -@docs moduleName_, annotation_, make_ --} - - -import Elm -import Elm.Annotation as Type - - -{-| The name of this module. -} -moduleName_ : List String -moduleName_ = - [ "Pages", "FormData" ] - - -annotation_ : { formData : Type.Annotation } -annotation_ = - { formData = - Type.alias - moduleName_ - "FormData" - [] - (Type.record - [ ( "fields", Type.list (Type.tuple Type.string Type.string) ) - , ( "method", Type.namedWith [ "Form" ] "Method" [] ) - , ( "action", Type.string ) - , ( "id", Type.maybe Type.string ) - ] - ) - } - - -make_ : - { formData : - { fields : Elm.Expression - , method : Elm.Expression - , action : Elm.Expression - , id : Elm.Expression - } - -> Elm.Expression - } -make_ = - { formData = - \formData_args -> - Elm.withType - (Type.alias - [ "Pages", "FormData" ] - "FormData" - [] - (Type.record - [ ( "fields" - , Type.list (Type.tuple Type.string Type.string) - ) - , ( "method", Type.namedWith [ "Form" ] "Method" [] ) - , ( "action", Type.string ) - , ( "id", Type.maybe Type.string ) - ] - ) - ) - (Elm.record - [ Tuple.pair "fields" formData_args.fields - , Tuple.pair "method" formData_args.method - , Tuple.pair "action" formData_args.action - , Tuple.pair "id" formData_args.id - ] - ) - } \ No newline at end of file diff --git a/elm-open-api-codegen/src/Gen/Pages/Internal/NotFoundReason.elm b/elm-open-api-codegen/src/Gen/Pages/Internal/NotFoundReason.elm deleted file mode 100644 index 55f843eb..00000000 --- a/elm-open-api-codegen/src/Gen/Pages/Internal/NotFoundReason.elm +++ /dev/null @@ -1,410 +0,0 @@ -module Gen.Pages.Internal.NotFoundReason exposing - ( moduleName_, document, annotation_, make_, caseOf_, call_ - , values_ - ) - -{-| -# Generated bindings for Pages.Internal.NotFoundReason - -@docs moduleName_, document, annotation_, make_, caseOf_, call_ -@docs values_ --} - - -import Elm -import Elm.Annotation as Type -import Elm.Arg -import Elm.Case - - -{-| The name of this module. -} -moduleName_ : List String -moduleName_ = - [ "Pages", "Internal", "NotFoundReason" ] - - -{-| document: - List Pages.Internal.RoutePattern.RoutePattern - -> Pages.Internal.NotFoundReason.Payload - -> { title : String, body : List (Html.Html msg) } --} -document : List Elm.Expression -> Elm.Expression -> Elm.Expression -document documentArg_ documentArg_0 = - Elm.apply - (Elm.value - { importFrom = [ "Pages", "Internal", "NotFoundReason" ] - , name = "document" - , annotation = - Just - (Type.function - [ Type.list - (Type.namedWith - [ "Pages", "Internal", "RoutePattern" ] - "RoutePattern" - [] - ) - , Type.namedWith - [ "Pages", "Internal", "NotFoundReason" ] - "Payload" - [] - ] - (Type.record - [ ( "title", Type.string ) - , ( "body" - , Type.list - (Type.namedWith - [ "Html" ] - "Html" - [ Type.var "msg" ] - ) - ) - ] - ) - ) - } - ) - [ Elm.list documentArg_, documentArg_0 ] - - -annotation_ : - { moduleContext : Type.Annotation - , notFoundReason : Type.Annotation - , payload : Type.Annotation - , record : Type.Annotation - } -annotation_ = - { moduleContext = - Type.alias - moduleName_ - "ModuleContext" - [] - (Type.record - [ ( "moduleName", Type.list Type.string ) - , ( "routePattern" - , Type.namedWith - [ "Pages", "Internal", "RoutePattern" ] - "RoutePattern" - [] - ) - , ( "matchedRouteParams" - , Type.namedWith - [ "Pages", "Internal", "NotFoundReason" ] - "Record" - [] - ) - ] - ) - , notFoundReason = - Type.namedWith - [ "Pages", "Internal", "NotFoundReason" ] - "NotFoundReason" - [] - , payload = - Type.alias - moduleName_ - "Payload" - [] - (Type.record - [ ( "path", Type.namedWith [ "UrlPath" ] "UrlPath" [] ) - , ( "reason" - , Type.namedWith - [ "Pages", "Internal", "NotFoundReason" ] - "NotFoundReason" - [] - ) - ] - ) - , record = - Type.alias - moduleName_ - "Record" - [] - (Type.list (Type.tuple Type.string Type.string)) - } - - -make_ : - { moduleContext : - { moduleName : Elm.Expression - , routePattern : Elm.Expression - , matchedRouteParams : Elm.Expression - } - -> Elm.Expression - , noMatchingRoute : Elm.Expression - , notPrerendered : Elm.Expression -> Elm.Expression -> Elm.Expression - , notPrerenderedOrHandledByFallback : - Elm.Expression -> Elm.Expression -> Elm.Expression - , unhandledServerRoute : Elm.Expression -> Elm.Expression - , payload : - { path : Elm.Expression, reason : Elm.Expression } -> Elm.Expression - } -make_ = - { moduleContext = - \moduleContext_args -> - Elm.withType - (Type.alias - [ "Pages", "Internal", "NotFoundReason" ] - "ModuleContext" - [] - (Type.record - [ ( "moduleName", Type.list Type.string ) - , ( "routePattern" - , Type.namedWith - [ "Pages", "Internal", "RoutePattern" ] - "RoutePattern" - [] - ) - , ( "matchedRouteParams" - , Type.namedWith - [ "Pages", "Internal", "NotFoundReason" ] - "Record" - [] - ) - ] - ) - ) - (Elm.record - [ Tuple.pair "moduleName" moduleContext_args.moduleName - , Tuple.pair "routePattern" moduleContext_args.routePattern - , Tuple.pair - "matchedRouteParams" - moduleContext_args.matchedRouteParams - ] - ) - , noMatchingRoute = - Elm.value - { importFrom = [ "Pages", "Internal", "NotFoundReason" ] - , name = "NoMatchingRoute" - , annotation = Just (Type.namedWith [] "NotFoundReason" []) - } - , notPrerendered = - \ar0 ar1 -> - Elm.apply - (Elm.value - { importFrom = [ "Pages", "Internal", "NotFoundReason" ] - , name = "NotPrerendered" - , annotation = Just (Type.namedWith [] "NotFoundReason" []) - } - ) - [ ar0, ar1 ] - , notPrerenderedOrHandledByFallback = - \ar0 ar1 -> - Elm.apply - (Elm.value - { importFrom = [ "Pages", "Internal", "NotFoundReason" ] - , name = "NotPrerenderedOrHandledByFallback" - , annotation = Just (Type.namedWith [] "NotFoundReason" []) - } - ) - [ ar0, ar1 ] - , unhandledServerRoute = - \ar0 -> - Elm.apply - (Elm.value - { importFrom = [ "Pages", "Internal", "NotFoundReason" ] - , name = "UnhandledServerRoute" - , annotation = Just (Type.namedWith [] "NotFoundReason" []) - } - ) - [ ar0 ] - , payload = - \payload_args -> - Elm.withType - (Type.alias - [ "Pages", "Internal", "NotFoundReason" ] - "Payload" - [] - (Type.record - [ ( "path" - , Type.namedWith [ "UrlPath" ] "UrlPath" [] - ) - , ( "reason" - , Type.namedWith - [ "Pages", "Internal", "NotFoundReason" ] - "NotFoundReason" - [] - ) - ] - ) - ) - (Elm.record - [ Tuple.pair "path" payload_args.path - , Tuple.pair "reason" payload_args.reason - ] - ) - } - - -caseOf_ = - { notFoundReason = - \notFoundReasonExpression notFoundReasonTags -> - Elm.Case.custom - notFoundReasonExpression - (Type.namedWith - [ "Pages", "Internal", "NotFoundReason" ] - "NotFoundReason" - [] - ) - [ Elm.Case.branch - (Elm.Arg.customType - "NoMatchingRoute" - notFoundReasonTags.noMatchingRoute - ) - Basics.identity - , Elm.Case.branch - (Elm.Arg.customType - "NotPrerendered" - notFoundReasonTags.notPrerendered |> Elm.Arg.item - (Elm.Arg.varWith - "pagesInternalNotFoundReasonModuleContext" - (Type.namedWith - [ "Pages" - , "Internal" - , "NotFoundReason" - ] - "ModuleContext" - [] - ) - ) |> Elm.Arg.item - (Elm.Arg.varWith - "arg_1" - (Type.list - (Type.namedWith - [ "Pages" - , "Internal" - , "NotFoundReason" - ] - "Record" - [] - ) - ) - ) - ) - Basics.identity - , Elm.Case.branch - (Elm.Arg.customType - "NotPrerenderedOrHandledByFallback" - notFoundReasonTags.notPrerenderedOrHandledByFallback |> Elm.Arg.item - (Elm.Arg.varWith - "pagesInternalNotFoundReasonModuleContext" - (Type.namedWith - [ "Pages" - , "Internal" - , "NotFoundReason" - ] - "ModuleContext" - [] - ) - ) |> Elm.Arg.item - (Elm.Arg.varWith - "arg_1" - (Type.list - (Type.namedWith - [ "Pages" - , "Internal" - , "NotFoundReason" - ] - "Record" - [] - ) - ) - ) - ) - Basics.identity - , Elm.Case.branch - (Elm.Arg.customType - "UnhandledServerRoute" - notFoundReasonTags.unhandledServerRoute |> Elm.Arg.item - (Elm.Arg.varWith - "pagesInternalNotFoundReasonModuleContext" - (Type.namedWith - [ "Pages" - , "Internal" - , "NotFoundReason" - ] - "ModuleContext" - [] - ) - ) - ) - Basics.identity - ] - } - - -call_ : { document : Elm.Expression -> Elm.Expression -> Elm.Expression } -call_ = - { document = - \documentArg_ documentArg_0 -> - Elm.apply - (Elm.value - { importFrom = [ "Pages", "Internal", "NotFoundReason" ] - , name = "document" - , annotation = - Just - (Type.function - [ Type.list - (Type.namedWith - [ "Pages", "Internal", "RoutePattern" ] - "RoutePattern" - [] - ) - , Type.namedWith - [ "Pages", "Internal", "NotFoundReason" ] - "Payload" - [] - ] - (Type.record - [ ( "title", Type.string ) - , ( "body" - , Type.list - (Type.namedWith - [ "Html" ] - "Html" - [ Type.var "msg" ] - ) - ) - ] - ) - ) - } - ) - [ documentArg_, documentArg_0 ] - } - - -values_ : { document : Elm.Expression } -values_ = - { document = - Elm.value - { importFrom = [ "Pages", "Internal", "NotFoundReason" ] - , name = "document" - , annotation = - Just - (Type.function - [ Type.list - (Type.namedWith - [ "Pages", "Internal", "RoutePattern" ] - "RoutePattern" - [] - ) - , Type.namedWith - [ "Pages", "Internal", "NotFoundReason" ] - "Payload" - [] - ] - (Type.record - [ ( "title", Type.string ) - , ( "body" - , Type.list - (Type.namedWith - [ "Html" ] - "Html" - [ Type.var "msg" ] - ) - ) - ] - ) - ) - } - } \ No newline at end of file diff --git a/elm-open-api-codegen/src/Gen/Pages/Internal/Platform.elm b/elm-open-api-codegen/src/Gen/Pages/Internal/Platform.elm deleted file mode 100644 index 821ffaa1..00000000 --- a/elm-open-api-codegen/src/Gen/Pages/Internal/Platform.elm +++ /dev/null @@ -1,2380 +0,0 @@ -module Gen.Pages.Internal.Platform exposing - ( moduleName_, application, init, update, view, annotation_ - , make_, caseOf_, call_, values_ - ) - -{-| -# Generated bindings for Pages.Internal.Platform - -@docs moduleName_, application, init, update, view, annotation_ -@docs make_, caseOf_, call_, values_ --} - - -import Elm -import Elm.Annotation as Type -import Elm.Arg -import Elm.Case - - -{-| The name of this module. -} -moduleName_ : List String -moduleName_ = - [ "Pages", "Internal", "Platform" ] - - -{-| application: - Pages.Internal.Platform.ProgramConfig userMsg userModel route pageData actionData sharedData effect (Pages.Internal.Platform.Msg userMsg pageData actionData sharedData errorPage) errorPage - -> Platform.Program Pages.Internal.Platform.Flags (Pages.Internal.Platform.Model userModel pageData actionData sharedData) (Pages.Internal.Platform.Msg userMsg pageData actionData sharedData errorPage) --} -application : Elm.Expression -> Elm.Expression -application applicationArg_ = - Elm.apply - (Elm.value - { importFrom = [ "Pages", "Internal", "Platform" ] - , name = "application" - , annotation = - Just - (Type.function - [ Type.namedWith - [ "Pages", "Internal", "Platform" ] - "ProgramConfig" - [ Type.var "userMsg" - , Type.var "userModel" - , Type.var "route" - , Type.var "pageData" - , Type.var "actionData" - , Type.var "sharedData" - , Type.var "effect" - , Type.namedWith - [ "Pages", "Internal", "Platform" ] - "Msg" - [ Type.var "userMsg" - , Type.var "pageData" - , Type.var "actionData" - , Type.var "sharedData" - , Type.var "errorPage" - ] - , Type.var "errorPage" - ] - ] - (Type.namedWith - [ "Platform" ] - "Program" - [ Type.namedWith - [ "Pages", "Internal", "Platform" ] - "Flags" - [] - , Type.namedWith - [ "Pages", "Internal", "Platform" ] - "Model" - [ Type.var "userModel" - , Type.var "pageData" - , Type.var "actionData" - , Type.var "sharedData" - ] - , Type.namedWith - [ "Pages", "Internal", "Platform" ] - "Msg" - [ Type.var "userMsg" - , Type.var "pageData" - , Type.var "actionData" - , Type.var "sharedData" - , Type.var "errorPage" - ] - ] - ) - ) - } - ) - [ applicationArg_ ] - - -{-| init: - Pages.Internal.Platform.ProgramConfig userMsg userModel route pageData actionData sharedData userEffect (Pages.Internal.Platform.Msg userMsg pageData actionData sharedData errorPage) errorPage - -> Pages.Internal.Platform.Flags - -> Url.Url - -> Maybe Browser.Navigation.Key - -> ( Pages.Internal.Platform.Model userModel pageData actionData sharedData, Pages.Internal.Platform.Effect userMsg pageData actionData sharedData userEffect errorPage ) --} -init : - Elm.Expression - -> Elm.Expression - -> Elm.Expression - -> Elm.Expression - -> Elm.Expression -init initArg_ initArg_0 initArg_1 initArg_2 = - Elm.apply - (Elm.value - { importFrom = [ "Pages", "Internal", "Platform" ] - , name = "init" - , annotation = - Just - (Type.function - [ Type.namedWith - [ "Pages", "Internal", "Platform" ] - "ProgramConfig" - [ Type.var "userMsg" - , Type.var "userModel" - , Type.var "route" - , Type.var "pageData" - , Type.var "actionData" - , Type.var "sharedData" - , Type.var "userEffect" - , Type.namedWith - [ "Pages", "Internal", "Platform" ] - "Msg" - [ Type.var "userMsg" - , Type.var "pageData" - , Type.var "actionData" - , Type.var "sharedData" - , Type.var "errorPage" - ] - , Type.var "errorPage" - ] - , Type.namedWith - [ "Pages", "Internal", "Platform" ] - "Flags" - [] - , Type.namedWith [ "Url" ] "Url" [] - , Type.maybe - (Type.namedWith - [ "Browser", "Navigation" ] - "Key" - [] - ) - ] - (Type.tuple - (Type.namedWith - [ "Pages", "Internal", "Platform" ] - "Model" - [ Type.var "userModel" - , Type.var "pageData" - , Type.var "actionData" - , Type.var "sharedData" - ] - ) - (Type.namedWith - [ "Pages", "Internal", "Platform" ] - "Effect" - [ Type.var "userMsg" - , Type.var "pageData" - , Type.var "actionData" - , Type.var "sharedData" - , Type.var "userEffect" - , Type.var "errorPage" - ] - ) - ) - ) - } - ) - [ initArg_, initArg_0, initArg_1, initArg_2 ] - - -{-| update: - Pages.Internal.Platform.ProgramConfig userMsg userModel route pageData actionData sharedData userEffect (Pages.Internal.Platform.Msg userMsg pageData actionData sharedData errorPage) errorPage - -> Pages.Internal.Platform.Msg userMsg pageData actionData sharedData errorPage - -> Pages.Internal.Platform.Model userModel pageData actionData sharedData - -> ( Pages.Internal.Platform.Model userModel pageData actionData sharedData, Pages.Internal.Platform.Effect userMsg pageData actionData sharedData userEffect errorPage ) --} -update : Elm.Expression -> Elm.Expression -> Elm.Expression -> Elm.Expression -update updateArg_ updateArg_0 updateArg_1 = - Elm.apply - (Elm.value - { importFrom = [ "Pages", "Internal", "Platform" ] - , name = "update" - , annotation = - Just - (Type.function - [ Type.namedWith - [ "Pages", "Internal", "Platform" ] - "ProgramConfig" - [ Type.var "userMsg" - , Type.var "userModel" - , Type.var "route" - , Type.var "pageData" - , Type.var "actionData" - , Type.var "sharedData" - , Type.var "userEffect" - , Type.namedWith - [ "Pages", "Internal", "Platform" ] - "Msg" - [ Type.var "userMsg" - , Type.var "pageData" - , Type.var "actionData" - , Type.var "sharedData" - , Type.var "errorPage" - ] - , Type.var "errorPage" - ] - , Type.namedWith - [ "Pages", "Internal", "Platform" ] - "Msg" - [ Type.var "userMsg" - , Type.var "pageData" - , Type.var "actionData" - , Type.var "sharedData" - , Type.var "errorPage" - ] - , Type.namedWith - [ "Pages", "Internal", "Platform" ] - "Model" - [ Type.var "userModel" - , Type.var "pageData" - , Type.var "actionData" - , Type.var "sharedData" - ] - ] - (Type.tuple - (Type.namedWith - [ "Pages", "Internal", "Platform" ] - "Model" - [ Type.var "userModel" - , Type.var "pageData" - , Type.var "actionData" - , Type.var "sharedData" - ] - ) - (Type.namedWith - [ "Pages", "Internal", "Platform" ] - "Effect" - [ Type.var "userMsg" - , Type.var "pageData" - , Type.var "actionData" - , Type.var "sharedData" - , Type.var "userEffect" - , Type.var "errorPage" - ] - ) - ) - ) - } - ) - [ updateArg_, updateArg_0, updateArg_1 ] - - -{-| view: - Pages.Internal.Platform.ProgramConfig userMsg userModel route pageData actionData sharedData effect (Pages.Internal.Platform.Msg userMsg pageData actionData sharedData errorPage) errorPage - -> Pages.Internal.Platform.Model userModel pageData actionData sharedData - -> Browser.Document (Pages.Internal.Platform.Msg userMsg pageData actionData sharedData errorPage) --} -view : Elm.Expression -> Elm.Expression -> Elm.Expression -view viewArg_ viewArg_0 = - Elm.apply - (Elm.value - { importFrom = [ "Pages", "Internal", "Platform" ] - , name = "view" - , annotation = - Just - (Type.function - [ Type.namedWith - [ "Pages", "Internal", "Platform" ] - "ProgramConfig" - [ Type.var "userMsg" - , Type.var "userModel" - , Type.var "route" - , Type.var "pageData" - , Type.var "actionData" - , Type.var "sharedData" - , Type.var "effect" - , Type.namedWith - [ "Pages", "Internal", "Platform" ] - "Msg" - [ Type.var "userMsg" - , Type.var "pageData" - , Type.var "actionData" - , Type.var "sharedData" - , Type.var "errorPage" - ] - , Type.var "errorPage" - ] - , Type.namedWith - [ "Pages", "Internal", "Platform" ] - "Model" - [ Type.var "userModel" - , Type.var "pageData" - , Type.var "actionData" - , Type.var "sharedData" - ] - ] - (Type.namedWith - [ "Browser" ] - "Document" - [ Type.namedWith - [ "Pages", "Internal", "Platform" ] - "Msg" - [ Type.var "userMsg" - , Type.var "pageData" - , Type.var "actionData" - , Type.var "sharedData" - , Type.var "errorPage" - ] - ] - ) - ) - } - ) - [ viewArg_, viewArg_0 ] - - -annotation_ : - { flags : Type.Annotation - , model : - Type.Annotation - -> Type.Annotation - -> Type.Annotation - -> Type.Annotation - -> Type.Annotation - , msg : - Type.Annotation - -> Type.Annotation - -> Type.Annotation - -> Type.Annotation - -> Type.Annotation - -> Type.Annotation - , program : - Type.Annotation - -> Type.Annotation - -> Type.Annotation - -> Type.Annotation - -> Type.Annotation - -> Type.Annotation - -> Type.Annotation - , programConfig : - Type.Annotation - -> Type.Annotation - -> Type.Annotation - -> Type.Annotation - -> Type.Annotation - -> Type.Annotation - -> Type.Annotation - -> Type.Annotation - -> Type.Annotation - -> Type.Annotation - , effect : - Type.Annotation - -> Type.Annotation - -> Type.Annotation - -> Type.Annotation - -> Type.Annotation - -> Type.Annotation - -> Type.Annotation - , requestInfo : Type.Annotation - } -annotation_ = - { flags = - Type.alias - moduleName_ - "Flags" - [] - (Type.namedWith [ "Json", "Decode" ] "Value" []) - , model = - \modelArg0 modelArg1 modelArg2 modelArg3 -> - Type.alias - moduleName_ - "Model" - [ modelArg0, modelArg1, modelArg2, modelArg3 ] - (Type.record - [ ( "key" - , Type.maybe - (Type.namedWith - [ "Browser", "Navigation" ] - "Key" - [] - ) - ) - , ( "url", Type.namedWith [ "Url" ] "Url" [] ) - , ( "currentPath", Type.string ) - , ( "ariaNavigationAnnouncement", Type.string ) - , ( "pageData" - , Type.namedWith - [ "Result" ] - "Result" - [ Type.string - , Type.record - [ ( "userModel", Type.var "userModel" ) - , ( "pageData", Type.var "pageData" ) - , ( "sharedData", Type.var "sharedData" ) - , ( "actionData" - , Type.maybe (Type.var "actionData") - ) - ] - ] - ) - , ( "notFound" - , Type.maybe - (Type.record - [ ( "reason" - , Type.namedWith - [ "Pages" - , "Internal" - , "NotFoundReason" - ] - "NotFoundReason" - [] - ) - , ( "path" - , Type.namedWith [ "UrlPath" ] "UrlPath" [] - ) - ] - ) - ) - , ( "userFlags" - , Type.namedWith [ "Json", "Decode" ] "Value" [] - ) - , ( "transition" - , Type.maybe - (Type.tuple - Type.int - (Type.namedWith - [ "Pages", "Navigation" ] - "Navigation" - [] - ) - ) - ) - , ( "nextTransitionKey", Type.int ) - , ( "inFlightFetchers" - , Type.namedWith - [ "Dict" ] - "Dict" - [ Type.string - , Type.tuple - Type.int - (Type.namedWith - [ "Pages", "ConcurrentSubmission" ] - "ConcurrentSubmission" - [ Type.var "actionData" ] - ) - ] - ) - , ( "pageFormState", Type.namedWith [ "Form" ] "Model" [] ) - , ( "pendingRedirect", Type.bool ) - , ( "pendingData" - , Type.maybe - (Type.triple - (Type.var "pageData") - (Type.var "sharedData") - (Type.maybe (Type.var "actionData")) - ) - ) - ] - ) - , msg = - \msgArg0 msgArg1 msgArg2 msgArg3 msgArg4 -> - Type.namedWith - [ "Pages", "Internal", "Platform" ] - "Msg" - [ msgArg0, msgArg1, msgArg2, msgArg3, msgArg4 ] - , program = - \programArg0 programArg1 programArg2 programArg3 programArg4 programArg5 -> - Type.alias - moduleName_ - "Program" - [ programArg0 - , programArg1 - , programArg2 - , programArg3 - , programArg4 - , programArg5 - ] - (Type.namedWith - [ "Platform" ] - "Program" - [ Type.namedWith - [ "Pages", "Internal", "Platform" ] - "Flags" - [] - , Type.namedWith - [ "Pages", "Internal", "Platform" ] - "Model" - [ Type.var "userModel" - , Type.var "pageData" - , Type.var "actionData" - , Type.var "sharedData" - ] - , Type.namedWith - [ "Pages", "Internal", "Platform" ] - "Msg" - [ Type.var "userMsg" - , Type.var "pageData" - , Type.var "actionData" - , Type.var "sharedData" - , Type.var "errorPage" - ] - ] - ) - , programConfig = - \programConfigArg0 programConfigArg1 programConfigArg2 programConfigArg3 programConfigArg4 programConfigArg5 programConfigArg6 programConfigArg7 programConfigArg8 -> - Type.alias - moduleName_ - "ProgramConfig" - [ programConfigArg0 - , programConfigArg1 - , programConfigArg2 - , programConfigArg3 - , programConfigArg4 - , programConfigArg5 - , programConfigArg6 - , programConfigArg7 - , programConfigArg8 - ] - (Type.namedWith - [ "Pages", "ProgramConfig" ] - "ProgramConfig" - [ Type.var "userMsg" - , Type.var "userModel" - , Type.var "route" - , Type.var "pageData" - , Type.var "actionData" - , Type.var "sharedData" - , Type.var "effect" - , Type.var "mappedMsg" - , Type.var "errorPage" - ] - ) - , effect = - \effectArg0 effectArg1 effectArg2 effectArg3 effectArg4 effectArg5 -> - Type.namedWith - [ "Pages", "Internal", "Platform" ] - "Effect" - [ effectArg0 - , effectArg1 - , effectArg2 - , effectArg3 - , effectArg4 - , effectArg5 - ] - , requestInfo = - Type.alias - moduleName_ - "RequestInfo" - [] - (Type.record - [ ( "contentType", Type.string ), ( "body", Type.string ) ] - ) - } - - -make_ : - { model : - { key : Elm.Expression - , url : Elm.Expression - , currentPath : Elm.Expression - , ariaNavigationAnnouncement : Elm.Expression - , pageData : Elm.Expression - , notFound : Elm.Expression - , userFlags : Elm.Expression - , transition : Elm.Expression - , nextTransitionKey : Elm.Expression - , inFlightFetchers : Elm.Expression - , pageFormState : Elm.Expression - , pendingRedirect : Elm.Expression - , pendingData : Elm.Expression - } - -> Elm.Expression - , linkClicked : Elm.Expression -> Elm.Expression - , urlChanged : Elm.Expression -> Elm.Expression - , userMsg : Elm.Expression -> Elm.Expression - , formMsg : Elm.Expression -> Elm.Expression - , updateCacheAndUrlNew : - Elm.Expression - -> Elm.Expression - -> Elm.Expression - -> Elm.Expression - -> Elm.Expression - , fetcherComplete : - Elm.Expression - -> Elm.Expression - -> Elm.Expression - -> Elm.Expression - -> Elm.Expression - , fetcherStarted : - Elm.Expression - -> Elm.Expression - -> Elm.Expression - -> Elm.Expression - -> Elm.Expression - , pageScrollComplete : Elm.Expression - , hotReloadCompleteNew : Elm.Expression -> Elm.Expression - , processFetchResponse : - Elm.Expression -> Elm.Expression -> Elm.Expression -> Elm.Expression - , scrollToTop : Elm.Expression - , noEffect : Elm.Expression - , browserLoadUrl : Elm.Expression -> Elm.Expression - , browserPushUrl : Elm.Expression -> Elm.Expression - , browserReplaceUrl : Elm.Expression -> Elm.Expression - , fetchPageData : - Elm.Expression - -> Elm.Expression - -> Elm.Expression - -> Elm.Expression - -> Elm.Expression - , submit : Elm.Expression -> Elm.Expression - , submitFetcher : - Elm.Expression -> Elm.Expression -> Elm.Expression -> Elm.Expression - , batch : Elm.Expression -> Elm.Expression - , userCmd : Elm.Expression -> Elm.Expression - , cancelRequest : Elm.Expression -> Elm.Expression - , runCmd : Elm.Expression -> Elm.Expression - , requestInfo : - { contentType : Elm.Expression, body : Elm.Expression } - -> Elm.Expression - } -make_ = - { model = - \model_args -> - Elm.withType - (Type.alias - [ "Pages", "Internal", "Platform" ] - "Model" - [ Type.var "userModel" - , Type.var "pageData" - , Type.var "actionData" - , Type.var "sharedData" - ] - (Type.record - [ ( "key" - , Type.maybe - (Type.namedWith - [ "Browser", "Navigation" ] - "Key" - [] - ) - ) - , ( "url", Type.namedWith [ "Url" ] "Url" [] ) - , ( "currentPath", Type.string ) - , ( "ariaNavigationAnnouncement", Type.string ) - , ( "pageData" - , Type.namedWith - [ "Result" ] - "Result" - [ Type.string - , Type.record - [ ( "userModel", Type.var "userModel" ) - , ( "pageData", Type.var "pageData" ) - , ( "sharedData", Type.var "sharedData" ) - , ( "actionData" - , Type.maybe (Type.var "actionData") - ) - ] - ] - ) - , ( "notFound" - , Type.maybe - (Type.record - [ ( "reason" - , Type.namedWith - [ "Pages" - , "Internal" - , "NotFoundReason" - ] - "NotFoundReason" - [] - ) - , ( "path" - , Type.namedWith - [ "UrlPath" ] - "UrlPath" - [] - ) - ] - ) - ) - , ( "userFlags" - , Type.namedWith [ "Json", "Decode" ] "Value" [] - ) - , ( "transition" - , Type.maybe - (Type.tuple - Type.int - (Type.namedWith - [ "Pages", "Navigation" ] - "Navigation" - [] - ) - ) - ) - , ( "nextTransitionKey", Type.int ) - , ( "inFlightFetchers" - , Type.namedWith - [ "Dict" ] - "Dict" - [ Type.string - , Type.tuple - Type.int - (Type.namedWith - [ "Pages", "ConcurrentSubmission" ] - "ConcurrentSubmission" - [ Type.var "actionData" ] - ) - ] - ) - , ( "pageFormState" - , Type.namedWith [ "Form" ] "Model" [] - ) - , ( "pendingRedirect", Type.bool ) - , ( "pendingData" - , Type.maybe - (Type.triple - (Type.var "pageData") - (Type.var "sharedData") - (Type.maybe (Type.var "actionData")) - ) - ) - ] - ) - ) - (Elm.record - [ Tuple.pair "key" model_args.key - , Tuple.pair "url" model_args.url - , Tuple.pair "currentPath" model_args.currentPath - , Tuple.pair - "ariaNavigationAnnouncement" - model_args.ariaNavigationAnnouncement - , Tuple.pair "pageData" model_args.pageData - , Tuple.pair "notFound" model_args.notFound - , Tuple.pair "userFlags" model_args.userFlags - , Tuple.pair "transition" model_args.transition - , Tuple.pair - "nextTransitionKey" - model_args.nextTransitionKey - , Tuple.pair "inFlightFetchers" model_args.inFlightFetchers - , Tuple.pair "pageFormState" model_args.pageFormState - , Tuple.pair "pendingRedirect" model_args.pendingRedirect - , Tuple.pair "pendingData" model_args.pendingData - ] - ) - , linkClicked = - \ar0 -> - Elm.apply - (Elm.value - { importFrom = [ "Pages", "Internal", "Platform" ] - , name = "LinkClicked" - , annotation = - Just - (Type.namedWith - [] - "Msg" - [ Type.var "userMsg" - , Type.var "pageData" - , Type.var "actionData" - , Type.var "sharedData" - , Type.var "errorPage" - ] - ) - } - ) - [ ar0 ] - , urlChanged = - \ar0 -> - Elm.apply - (Elm.value - { importFrom = [ "Pages", "Internal", "Platform" ] - , name = "UrlChanged" - , annotation = - Just - (Type.namedWith - [] - "Msg" - [ Type.var "userMsg" - , Type.var "pageData" - , Type.var "actionData" - , Type.var "sharedData" - , Type.var "errorPage" - ] - ) - } - ) - [ ar0 ] - , userMsg = - \ar0 -> - Elm.apply - (Elm.value - { importFrom = [ "Pages", "Internal", "Platform" ] - , name = "UserMsg" - , annotation = - Just - (Type.namedWith - [] - "Msg" - [ Type.var "userMsg" - , Type.var "pageData" - , Type.var "actionData" - , Type.var "sharedData" - , Type.var "errorPage" - ] - ) - } - ) - [ ar0 ] - , formMsg = - \ar0 -> - Elm.apply - (Elm.value - { importFrom = [ "Pages", "Internal", "Platform" ] - , name = "FormMsg" - , annotation = - Just - (Type.namedWith - [] - "Msg" - [ Type.var "userMsg" - , Type.var "pageData" - , Type.var "actionData" - , Type.var "sharedData" - , Type.var "errorPage" - ] - ) - } - ) - [ ar0 ] - , updateCacheAndUrlNew = - \ar0 ar1 ar2 ar3 -> - Elm.apply - (Elm.value - { importFrom = [ "Pages", "Internal", "Platform" ] - , name = "UpdateCacheAndUrlNew" - , annotation = - Just - (Type.namedWith - [] - "Msg" - [ Type.var "userMsg" - , Type.var "pageData" - , Type.var "actionData" - , Type.var "sharedData" - , Type.var "errorPage" - ] - ) - } - ) - [ ar0, ar1, ar2, ar3 ] - , fetcherComplete = - \ar0 ar1 ar2 ar3 -> - Elm.apply - (Elm.value - { importFrom = [ "Pages", "Internal", "Platform" ] - , name = "FetcherComplete" - , annotation = - Just - (Type.namedWith - [] - "Msg" - [ Type.var "userMsg" - , Type.var "pageData" - , Type.var "actionData" - , Type.var "sharedData" - , Type.var "errorPage" - ] - ) - } - ) - [ ar0, ar1, ar2, ar3 ] - , fetcherStarted = - \ar0 ar1 ar2 ar3 -> - Elm.apply - (Elm.value - { importFrom = [ "Pages", "Internal", "Platform" ] - , name = "FetcherStarted" - , annotation = - Just - (Type.namedWith - [] - "Msg" - [ Type.var "userMsg" - , Type.var "pageData" - , Type.var "actionData" - , Type.var "sharedData" - , Type.var "errorPage" - ] - ) - } - ) - [ ar0, ar1, ar2, ar3 ] - , pageScrollComplete = - Elm.value - { importFrom = [ "Pages", "Internal", "Platform" ] - , name = "PageScrollComplete" - , annotation = - Just - (Type.namedWith - [] - "Msg" - [ Type.var "userMsg" - , Type.var "pageData" - , Type.var "actionData" - , Type.var "sharedData" - , Type.var "errorPage" - ] - ) - } - , hotReloadCompleteNew = - \ar0 -> - Elm.apply - (Elm.value - { importFrom = [ "Pages", "Internal", "Platform" ] - , name = "HotReloadCompleteNew" - , annotation = - Just - (Type.namedWith - [] - "Msg" - [ Type.var "userMsg" - , Type.var "pageData" - , Type.var "actionData" - , Type.var "sharedData" - , Type.var "errorPage" - ] - ) - } - ) - [ ar0 ] - , processFetchResponse = - \ar0 ar1 ar2 -> - Elm.apply - (Elm.value - { importFrom = [ "Pages", "Internal", "Platform" ] - , name = "ProcessFetchResponse" - , annotation = - Just - (Type.namedWith - [] - "Msg" - [ Type.var "userMsg" - , Type.var "pageData" - , Type.var "actionData" - , Type.var "sharedData" - , Type.var "errorPage" - ] - ) - } - ) - [ ar0, ar1, ar2 ] - , scrollToTop = - Elm.value - { importFrom = [ "Pages", "Internal", "Platform" ] - , name = "ScrollToTop" - , annotation = - Just - (Type.namedWith - [] - "Effect" - [ Type.var "userMsg" - , Type.var "pageData" - , Type.var "actionData" - , Type.var "sharedData" - , Type.var "userEffect" - , Type.var "errorPage" - ] - ) - } - , noEffect = - Elm.value - { importFrom = [ "Pages", "Internal", "Platform" ] - , name = "NoEffect" - , annotation = - Just - (Type.namedWith - [] - "Effect" - [ Type.var "userMsg" - , Type.var "pageData" - , Type.var "actionData" - , Type.var "sharedData" - , Type.var "userEffect" - , Type.var "errorPage" - ] - ) - } - , browserLoadUrl = - \ar0 -> - Elm.apply - (Elm.value - { importFrom = [ "Pages", "Internal", "Platform" ] - , name = "BrowserLoadUrl" - , annotation = - Just - (Type.namedWith - [] - "Effect" - [ Type.var "userMsg" - , Type.var "pageData" - , Type.var "actionData" - , Type.var "sharedData" - , Type.var "userEffect" - , Type.var "errorPage" - ] - ) - } - ) - [ ar0 ] - , browserPushUrl = - \ar0 -> - Elm.apply - (Elm.value - { importFrom = [ "Pages", "Internal", "Platform" ] - , name = "BrowserPushUrl" - , annotation = - Just - (Type.namedWith - [] - "Effect" - [ Type.var "userMsg" - , Type.var "pageData" - , Type.var "actionData" - , Type.var "sharedData" - , Type.var "userEffect" - , Type.var "errorPage" - ] - ) - } - ) - [ ar0 ] - , browserReplaceUrl = - \ar0 -> - Elm.apply - (Elm.value - { importFrom = [ "Pages", "Internal", "Platform" ] - , name = "BrowserReplaceUrl" - , annotation = - Just - (Type.namedWith - [] - "Effect" - [ Type.var "userMsg" - , Type.var "pageData" - , Type.var "actionData" - , Type.var "sharedData" - , Type.var "userEffect" - , Type.var "errorPage" - ] - ) - } - ) - [ ar0 ] - , fetchPageData = - \ar0 ar1 ar2 ar3 -> - Elm.apply - (Elm.value - { importFrom = [ "Pages", "Internal", "Platform" ] - , name = "FetchPageData" - , annotation = - Just - (Type.namedWith - [] - "Effect" - [ Type.var "userMsg" - , Type.var "pageData" - , Type.var "actionData" - , Type.var "sharedData" - , Type.var "userEffect" - , Type.var "errorPage" - ] - ) - } - ) - [ ar0, ar1, ar2, ar3 ] - , submit = - \ar0 -> - Elm.apply - (Elm.value - { importFrom = [ "Pages", "Internal", "Platform" ] - , name = "Submit" - , annotation = - Just - (Type.namedWith - [] - "Effect" - [ Type.var "userMsg" - , Type.var "pageData" - , Type.var "actionData" - , Type.var "sharedData" - , Type.var "userEffect" - , Type.var "errorPage" - ] - ) - } - ) - [ ar0 ] - , submitFetcher = - \ar0 ar1 ar2 -> - Elm.apply - (Elm.value - { importFrom = [ "Pages", "Internal", "Platform" ] - , name = "SubmitFetcher" - , annotation = - Just - (Type.namedWith - [] - "Effect" - [ Type.var "userMsg" - , Type.var "pageData" - , Type.var "actionData" - , Type.var "sharedData" - , Type.var "userEffect" - , Type.var "errorPage" - ] - ) - } - ) - [ ar0, ar1, ar2 ] - , batch = - \ar0 -> - Elm.apply - (Elm.value - { importFrom = [ "Pages", "Internal", "Platform" ] - , name = "Batch" - , annotation = - Just - (Type.namedWith - [] - "Effect" - [ Type.var "userMsg" - , Type.var "pageData" - , Type.var "actionData" - , Type.var "sharedData" - , Type.var "userEffect" - , Type.var "errorPage" - ] - ) - } - ) - [ ar0 ] - , userCmd = - \ar0 -> - Elm.apply - (Elm.value - { importFrom = [ "Pages", "Internal", "Platform" ] - , name = "UserCmd" - , annotation = - Just - (Type.namedWith - [] - "Effect" - [ Type.var "userMsg" - , Type.var "pageData" - , Type.var "actionData" - , Type.var "sharedData" - , Type.var "userEffect" - , Type.var "errorPage" - ] - ) - } - ) - [ ar0 ] - , cancelRequest = - \ar0 -> - Elm.apply - (Elm.value - { importFrom = [ "Pages", "Internal", "Platform" ] - , name = "CancelRequest" - , annotation = - Just - (Type.namedWith - [] - "Effect" - [ Type.var "userMsg" - , Type.var "pageData" - , Type.var "actionData" - , Type.var "sharedData" - , Type.var "userEffect" - , Type.var "errorPage" - ] - ) - } - ) - [ ar0 ] - , runCmd = - \ar0 -> - Elm.apply - (Elm.value - { importFrom = [ "Pages", "Internal", "Platform" ] - , name = "RunCmd" - , annotation = - Just - (Type.namedWith - [] - "Effect" - [ Type.var "userMsg" - , Type.var "pageData" - , Type.var "actionData" - , Type.var "sharedData" - , Type.var "userEffect" - , Type.var "errorPage" - ] - ) - } - ) - [ ar0 ] - , requestInfo = - \requestInfo_args -> - Elm.withType - (Type.alias - [ "Pages", "Internal", "Platform" ] - "RequestInfo" - [] - (Type.record - [ ( "contentType", Type.string ) - , ( "body", Type.string ) - ] - ) - ) - (Elm.record - [ Tuple.pair "contentType" requestInfo_args.contentType - , Tuple.pair "body" requestInfo_args.body - ] - ) - } - - -caseOf_ = - { msg = - \msgExpression msgTags -> - Elm.Case.custom - msgExpression - (Type.namedWith - [ "Pages", "Internal", "Platform" ] - "Msg" - [ Type.var "userMsg" - , Type.var "pageData" - , Type.var "actionData" - , Type.var "sharedData" - , Type.var "errorPage" - ] - ) - [ Elm.Case.branch - (Elm.Arg.customType - "LinkClicked" - msgTags.linkClicked |> Elm.Arg.item - (Elm.Arg.varWith - "browserUrlRequest" - (Type.namedWith - [ "Browser" ] - "UrlRequest" - [] - ) - ) - ) - Basics.identity - , Elm.Case.branch - (Elm.Arg.customType - "UrlChanged" - msgTags.urlChanged |> Elm.Arg.item - (Elm.Arg.varWith - "urlUrl" - (Type.namedWith - [ "Url" ] - "Url" - [] - ) - ) - ) - Basics.identity - , Elm.Case.branch - (Elm.Arg.customType - "UserMsg" - msgTags.userMsg |> Elm.Arg.item - (Elm.Arg.varWith - "pagesMsgPagesMsg" - (Type.namedWith - [ "PagesMsg" ] - "PagesMsg" - [ Type.var - "userMsg" - ] - ) - ) - ) - Basics.identity - , Elm.Case.branch - (Elm.Arg.customType - "FormMsg" - msgTags.formMsg |> Elm.Arg.item - (Elm.Arg.varWith - "formMsg" - (Type.namedWith - [ "Form" ] - "Msg" - [ Type.namedWith - [ "Pages" - , "Internal" - , "Platform" - ] - "Msg" - [ Type.var - "userMsg" - , Type.var - "pageData" - , Type.var - "actionData" - , Type.var - "sharedData" - , Type.var - "errorPage" - ] - ] - ) - ) - ) - Basics.identity - , Elm.Case.branch - (Elm.Arg.customType - "UpdateCacheAndUrlNew" - msgTags.updateCacheAndUrlNew |> Elm.Arg.item - (Elm.Arg.varWith - "arg_0" - Type.bool - ) |> Elm.Arg.item - (Elm.Arg.varWith - "urlUrl" - (Type.namedWith - [ "Url" - ] - "Url" - [] - ) - ) |> Elm.Arg.item - (Elm.Arg.varWith - "maybeMaybe" - (Type.maybe - (Type.var - "userMsg" - ) - ) - ) |> Elm.Arg.item - (Elm.Arg.varWith - "resultResult" - (Type.namedWith - [ "Result" - ] - "Result" - [ Type.namedWith - [ "Http" - ] - "Error" - [] - , Type.tuple - (Type.namedWith - [ "Url" - ] - "Url" - [] - ) - (Type.namedWith - [ "Pages" - , "Internal" - , "ResponseSketch" - ] - "ResponseSketch" - [ Type.var - "pageData" - , Type.var - "actionData" - , Type.var - "sharedData" - ] - ) - ] - ) - ) - ) - Basics.identity - , Elm.Case.branch - (Elm.Arg.customType - "FetcherComplete" - msgTags.fetcherComplete |> Elm.Arg.item - (Elm.Arg.varWith - "arg_0" - Type.bool - ) |> Elm.Arg.item - (Elm.Arg.varWith - "arg_1" - Type.string - ) |> Elm.Arg.item - (Elm.Arg.varWith - "arg_2" - Type.int - ) |> Elm.Arg.item - (Elm.Arg.varWith - "resultResult" - (Type.namedWith - [ "Result" - ] - "Result" - [ Type.namedWith - [ "Http" - ] - "Error" - [] - , Type.tuple - (Type.maybe - (Type.var - "userMsg" - ) - ) - (Type.namedWith - [ "Pages" - , "Internal" - , "Platform" - ] - "ActionDataOrRedirect" - [ Type.var - "actionData" - ] - ) - ] - ) - ) - ) - Basics.identity - , Elm.Case.branch - (Elm.Arg.customType - "FetcherStarted" - msgTags.fetcherStarted |> Elm.Arg.item - (Elm.Arg.varWith - "arg_0" - Type.string - ) |> Elm.Arg.item - (Elm.Arg.varWith - "arg_1" - Type.int - ) |> Elm.Arg.item - (Elm.Arg.varWith - "pagesInternalPlatformFormData" - (Type.namedWith - [ "Pages" - , "Internal" - , "Platform" - ] - "FormData" - [] - ) - ) |> Elm.Arg.item - (Elm.Arg.varWith - "timePosix" - (Type.namedWith - [ "Time" - ] - "Posix" - [] - ) - ) - ) - Basics.identity - , Elm.Case.branch - (Elm.Arg.customType - "PageScrollComplete" - msgTags.pageScrollComplete - ) - Basics.identity - , Elm.Case.branch - (Elm.Arg.customType - "HotReloadCompleteNew" - msgTags.hotReloadCompleteNew |> Elm.Arg.item - (Elm.Arg.varWith - "bytesBytes" - (Type.namedWith - [ "Bytes" - ] - "Bytes" - [] - ) - ) - ) - Basics.identity - , Elm.Case.branch - (Elm.Arg.customType - "ProcessFetchResponse" - msgTags.processFetchResponse |> Elm.Arg.item - (Elm.Arg.varWith - "arg_0" - Type.int - ) |> Elm.Arg.item - (Elm.Arg.varWith - "resultResult" - (Type.namedWith - [ "Result" - ] - "Result" - [ Type.namedWith - [ "Http" - ] - "Error" - [] - , Type.tuple - (Type.namedWith - [ "Url" - ] - "Url" - [] - ) - (Type.namedWith - [ "Pages" - , "Internal" - , "ResponseSketch" - ] - "ResponseSketch" - [ Type.var - "pageData" - , Type.var - "actionData" - , Type.var - "sharedData" - ] - ) - ] - ) - ) |> Elm.Arg.item - (Elm.Arg.varWith - "arg_2" - (Type.function - [ Type.namedWith - [ "Result" - ] - "Result" - [ Type.namedWith - [ "Http" - ] - "Error" - [] - , Type.tuple - (Type.namedWith - [ "Url" - ] - "Url" - [] - ) - (Type.namedWith - [ "Pages" - , "Internal" - , "ResponseSketch" - ] - "ResponseSketch" - [ Type.var - "pageData" - , Type.var - "actionData" - , Type.var - "sharedData" - ] - ) - ] - ] - (Type.namedWith - [ "Pages" - , "Internal" - , "Platform" - ] - "Msg" - [ Type.var - "userMsg" - , Type.var - "pageData" - , Type.var - "actionData" - , Type.var - "sharedData" - , Type.var - "errorPage" - ] - ) - ) - ) - ) - Basics.identity - ] - , effect = - \effectExpression effectTags -> - Elm.Case.custom - effectExpression - (Type.namedWith - [ "Pages", "Internal", "Platform" ] - "Effect" - [ Type.var "userMsg" - , Type.var "pageData" - , Type.var "actionData" - , Type.var "sharedData" - , Type.var "userEffect" - , Type.var "errorPage" - ] - ) - [ Elm.Case.branch - (Elm.Arg.customType "ScrollToTop" effectTags.scrollToTop) - Basics.identity - , Elm.Case.branch - (Elm.Arg.customType "NoEffect" effectTags.noEffect) - Basics.identity - , Elm.Case.branch - (Elm.Arg.customType - "BrowserLoadUrl" - effectTags.browserLoadUrl |> Elm.Arg.item - (Elm.Arg.varWith - "arg_0" - Type.string - ) - ) - Basics.identity - , Elm.Case.branch - (Elm.Arg.customType - "BrowserPushUrl" - effectTags.browserPushUrl |> Elm.Arg.item - (Elm.Arg.varWith - "arg_0" - Type.string - ) - ) - Basics.identity - , Elm.Case.branch - (Elm.Arg.customType - "BrowserReplaceUrl" - effectTags.browserReplaceUrl |> Elm.Arg.item - (Elm.Arg.varWith - "arg_0" - Type.string - ) - ) - Basics.identity - , Elm.Case.branch - (Elm.Arg.customType - "FetchPageData" - effectTags.fetchPageData |> Elm.Arg.item - (Elm.Arg.varWith - "arg_0" - Type.int - ) |> Elm.Arg.item - (Elm.Arg.varWith - "maybeMaybe" - (Type.maybe - (Type.namedWith - [ "Pages" - , "Internal" - , "Platform" - ] - "FormData" - [] - ) - ) - ) |> Elm.Arg.item - (Elm.Arg.varWith - "urlUrl" - (Type.namedWith - [ "Url" - ] - "Url" - [] - ) - ) |> Elm.Arg.item - (Elm.Arg.varWith - "arg_3" - (Type.function - [ Type.namedWith - [ "Result" - ] - "Result" - [ Type.namedWith - [ "Http" - ] - "Error" - [] - , Type.tuple - (Type.namedWith - [ "Url" - ] - "Url" - [] - ) - (Type.namedWith - [ "Pages" - , "Internal" - , "ResponseSketch" - ] - "ResponseSketch" - [ Type.var - "pageData" - , Type.var - "actionData" - , Type.var - "sharedData" - ] - ) - ] - ] - (Type.namedWith - [ "Pages" - , "Internal" - , "Platform" - ] - "Msg" - [ Type.var - "userMsg" - , Type.var - "pageData" - , Type.var - "actionData" - , Type.var - "sharedData" - , Type.var - "errorPage" - ] - ) - ) - ) - ) - Basics.identity - , Elm.Case.branch - (Elm.Arg.customType - "Submit" - effectTags.submit |> Elm.Arg.item - (Elm.Arg.varWith - "pagesInternalPlatformFormData" - (Type.namedWith - [ "Pages" - , "Internal" - , "Platform" - ] - "FormData" - [] - ) - ) - ) - Basics.identity - , Elm.Case.branch - (Elm.Arg.customType - "SubmitFetcher" - effectTags.submitFetcher |> Elm.Arg.item - (Elm.Arg.varWith - "arg_0" - Type.string - ) |> Elm.Arg.item - (Elm.Arg.varWith - "arg_1" - Type.int - ) |> Elm.Arg.item - (Elm.Arg.varWith - "pagesInternalPlatformFormData" - (Type.namedWith - [ "Pages" - , "Internal" - , "Platform" - ] - "FormData" - [] - ) - ) - ) - Basics.identity - , Elm.Case.branch - (Elm.Arg.customType "Batch" effectTags.batch |> Elm.Arg.item - (Elm.Arg.varWith - "arg_0" - (Type.list - (Type.namedWith - [ "Pages" - , "Internal" - , "Platform" - ] - "Effect" - [ Type.var - "userMsg" - , Type.var - "pageData" - , Type.var - "actionData" - , Type.var - "sharedData" - , Type.var - "userEffect" - , Type.var - "errorPage" - ] - ) - ) - ) - ) - Basics.identity - , Elm.Case.branch - (Elm.Arg.customType - "UserCmd" - effectTags.userCmd |> Elm.Arg.item - (Elm.Arg.varWith - "userEffect" - (Type.var "userEffect" - ) - ) - ) - Basics.identity - , Elm.Case.branch - (Elm.Arg.customType - "CancelRequest" - effectTags.cancelRequest |> Elm.Arg.item - (Elm.Arg.varWith - "arg_0" - Type.int - ) - ) - Basics.identity - , Elm.Case.branch - (Elm.Arg.customType - "RunCmd" - effectTags.runCmd |> Elm.Arg.item - (Elm.Arg.varWith - "platformCmdCmd" - (Type.namedWith - [] - "Cmd" - [ Type.namedWith - [ "Pages" - , "Internal" - , "Platform" - ] - "Msg" - [ Type.var - "userMsg" - , Type.var - "pageData" - , Type.var - "actionData" - , Type.var - "sharedData" - , Type.var - "errorPage" - ] - ] - ) - ) - ) - Basics.identity - ] - } - - -call_ : - { application : Elm.Expression -> Elm.Expression - , init : - Elm.Expression - -> Elm.Expression - -> Elm.Expression - -> Elm.Expression - -> Elm.Expression - , update : - Elm.Expression -> Elm.Expression -> Elm.Expression -> Elm.Expression - , view : Elm.Expression -> Elm.Expression -> Elm.Expression - } -call_ = - { application = - \applicationArg_ -> - Elm.apply - (Elm.value - { importFrom = [ "Pages", "Internal", "Platform" ] - , name = "application" - , annotation = - Just - (Type.function - [ Type.namedWith - [ "Pages", "Internal", "Platform" ] - "ProgramConfig" - [ Type.var "userMsg" - , Type.var "userModel" - , Type.var "route" - , Type.var "pageData" - , Type.var "actionData" - , Type.var "sharedData" - , Type.var "effect" - , Type.namedWith - [ "Pages", "Internal", "Platform" ] - "Msg" - [ Type.var "userMsg" - , Type.var "pageData" - , Type.var "actionData" - , Type.var "sharedData" - , Type.var "errorPage" - ] - , Type.var "errorPage" - ] - ] - (Type.namedWith - [ "Platform" ] - "Program" - [ Type.namedWith - [ "Pages", "Internal", "Platform" ] - "Flags" - [] - , Type.namedWith - [ "Pages", "Internal", "Platform" ] - "Model" - [ Type.var "userModel" - , Type.var "pageData" - , Type.var "actionData" - , Type.var "sharedData" - ] - , Type.namedWith - [ "Pages", "Internal", "Platform" ] - "Msg" - [ Type.var "userMsg" - , Type.var "pageData" - , Type.var "actionData" - , Type.var "sharedData" - , Type.var "errorPage" - ] - ] - ) - ) - } - ) - [ applicationArg_ ] - , init = - \initArg_ initArg_0 initArg_1 initArg_2 -> - Elm.apply - (Elm.value - { importFrom = [ "Pages", "Internal", "Platform" ] - , name = "init" - , annotation = - Just - (Type.function - [ Type.namedWith - [ "Pages", "Internal", "Platform" ] - "ProgramConfig" - [ Type.var "userMsg" - , Type.var "userModel" - , Type.var "route" - , Type.var "pageData" - , Type.var "actionData" - , Type.var "sharedData" - , Type.var "userEffect" - , Type.namedWith - [ "Pages", "Internal", "Platform" ] - "Msg" - [ Type.var "userMsg" - , Type.var "pageData" - , Type.var "actionData" - , Type.var "sharedData" - , Type.var "errorPage" - ] - , Type.var "errorPage" - ] - , Type.namedWith - [ "Pages", "Internal", "Platform" ] - "Flags" - [] - , Type.namedWith [ "Url" ] "Url" [] - , Type.maybe - (Type.namedWith - [ "Browser", "Navigation" ] - "Key" - [] - ) - ] - (Type.tuple - (Type.namedWith - [ "Pages", "Internal", "Platform" ] - "Model" - [ Type.var "userModel" - , Type.var "pageData" - , Type.var "actionData" - , Type.var "sharedData" - ] - ) - (Type.namedWith - [ "Pages", "Internal", "Platform" ] - "Effect" - [ Type.var "userMsg" - , Type.var "pageData" - , Type.var "actionData" - , Type.var "sharedData" - , Type.var "userEffect" - , Type.var "errorPage" - ] - ) - ) - ) - } - ) - [ initArg_, initArg_0, initArg_1, initArg_2 ] - , update = - \updateArg_ updateArg_0 updateArg_1 -> - Elm.apply - (Elm.value - { importFrom = [ "Pages", "Internal", "Platform" ] - , name = "update" - , annotation = - Just - (Type.function - [ Type.namedWith - [ "Pages", "Internal", "Platform" ] - "ProgramConfig" - [ Type.var "userMsg" - , Type.var "userModel" - , Type.var "route" - , Type.var "pageData" - , Type.var "actionData" - , Type.var "sharedData" - , Type.var "userEffect" - , Type.namedWith - [ "Pages", "Internal", "Platform" ] - "Msg" - [ Type.var "userMsg" - , Type.var "pageData" - , Type.var "actionData" - , Type.var "sharedData" - , Type.var "errorPage" - ] - , Type.var "errorPage" - ] - , Type.namedWith - [ "Pages", "Internal", "Platform" ] - "Msg" - [ Type.var "userMsg" - , Type.var "pageData" - , Type.var "actionData" - , Type.var "sharedData" - , Type.var "errorPage" - ] - , Type.namedWith - [ "Pages", "Internal", "Platform" ] - "Model" - [ Type.var "userModel" - , Type.var "pageData" - , Type.var "actionData" - , Type.var "sharedData" - ] - ] - (Type.tuple - (Type.namedWith - [ "Pages", "Internal", "Platform" ] - "Model" - [ Type.var "userModel" - , Type.var "pageData" - , Type.var "actionData" - , Type.var "sharedData" - ] - ) - (Type.namedWith - [ "Pages", "Internal", "Platform" ] - "Effect" - [ Type.var "userMsg" - , Type.var "pageData" - , Type.var "actionData" - , Type.var "sharedData" - , Type.var "userEffect" - , Type.var "errorPage" - ] - ) - ) - ) - } - ) - [ updateArg_, updateArg_0, updateArg_1 ] - , view = - \viewArg_ viewArg_0 -> - Elm.apply - (Elm.value - { importFrom = [ "Pages", "Internal", "Platform" ] - , name = "view" - , annotation = - Just - (Type.function - [ Type.namedWith - [ "Pages", "Internal", "Platform" ] - "ProgramConfig" - [ Type.var "userMsg" - , Type.var "userModel" - , Type.var "route" - , Type.var "pageData" - , Type.var "actionData" - , Type.var "sharedData" - , Type.var "effect" - , Type.namedWith - [ "Pages", "Internal", "Platform" ] - "Msg" - [ Type.var "userMsg" - , Type.var "pageData" - , Type.var "actionData" - , Type.var "sharedData" - , Type.var "errorPage" - ] - , Type.var "errorPage" - ] - , Type.namedWith - [ "Pages", "Internal", "Platform" ] - "Model" - [ Type.var "userModel" - , Type.var "pageData" - , Type.var "actionData" - , Type.var "sharedData" - ] - ] - (Type.namedWith - [ "Browser" ] - "Document" - [ Type.namedWith - [ "Pages", "Internal", "Platform" ] - "Msg" - [ Type.var "userMsg" - , Type.var "pageData" - , Type.var "actionData" - , Type.var "sharedData" - , Type.var "errorPage" - ] - ] - ) - ) - } - ) - [ viewArg_, viewArg_0 ] - } - - -values_ : - { application : Elm.Expression - , init : Elm.Expression - , update : Elm.Expression - , view : Elm.Expression - } -values_ = - { application = - Elm.value - { importFrom = [ "Pages", "Internal", "Platform" ] - , name = "application" - , annotation = - Just - (Type.function - [ Type.namedWith - [ "Pages", "Internal", "Platform" ] - "ProgramConfig" - [ Type.var "userMsg" - , Type.var "userModel" - , Type.var "route" - , Type.var "pageData" - , Type.var "actionData" - , Type.var "sharedData" - , Type.var "effect" - , Type.namedWith - [ "Pages", "Internal", "Platform" ] - "Msg" - [ Type.var "userMsg" - , Type.var "pageData" - , Type.var "actionData" - , Type.var "sharedData" - , Type.var "errorPage" - ] - , Type.var "errorPage" - ] - ] - (Type.namedWith - [ "Platform" ] - "Program" - [ Type.namedWith - [ "Pages", "Internal", "Platform" ] - "Flags" - [] - , Type.namedWith - [ "Pages", "Internal", "Platform" ] - "Model" - [ Type.var "userModel" - , Type.var "pageData" - , Type.var "actionData" - , Type.var "sharedData" - ] - , Type.namedWith - [ "Pages", "Internal", "Platform" ] - "Msg" - [ Type.var "userMsg" - , Type.var "pageData" - , Type.var "actionData" - , Type.var "sharedData" - , Type.var "errorPage" - ] - ] - ) - ) - } - , init = - Elm.value - { importFrom = [ "Pages", "Internal", "Platform" ] - , name = "init" - , annotation = - Just - (Type.function - [ Type.namedWith - [ "Pages", "Internal", "Platform" ] - "ProgramConfig" - [ Type.var "userMsg" - , Type.var "userModel" - , Type.var "route" - , Type.var "pageData" - , Type.var "actionData" - , Type.var "sharedData" - , Type.var "userEffect" - , Type.namedWith - [ "Pages", "Internal", "Platform" ] - "Msg" - [ Type.var "userMsg" - , Type.var "pageData" - , Type.var "actionData" - , Type.var "sharedData" - , Type.var "errorPage" - ] - , Type.var "errorPage" - ] - , Type.namedWith - [ "Pages", "Internal", "Platform" ] - "Flags" - [] - , Type.namedWith [ "Url" ] "Url" [] - , Type.maybe - (Type.namedWith - [ "Browser", "Navigation" ] - "Key" - [] - ) - ] - (Type.tuple - (Type.namedWith - [ "Pages", "Internal", "Platform" ] - "Model" - [ Type.var "userModel" - , Type.var "pageData" - , Type.var "actionData" - , Type.var "sharedData" - ] - ) - (Type.namedWith - [ "Pages", "Internal", "Platform" ] - "Effect" - [ Type.var "userMsg" - , Type.var "pageData" - , Type.var "actionData" - , Type.var "sharedData" - , Type.var "userEffect" - , Type.var "errorPage" - ] - ) - ) - ) - } - , update = - Elm.value - { importFrom = [ "Pages", "Internal", "Platform" ] - , name = "update" - , annotation = - Just - (Type.function - [ Type.namedWith - [ "Pages", "Internal", "Platform" ] - "ProgramConfig" - [ Type.var "userMsg" - , Type.var "userModel" - , Type.var "route" - , Type.var "pageData" - , Type.var "actionData" - , Type.var "sharedData" - , Type.var "userEffect" - , Type.namedWith - [ "Pages", "Internal", "Platform" ] - "Msg" - [ Type.var "userMsg" - , Type.var "pageData" - , Type.var "actionData" - , Type.var "sharedData" - , Type.var "errorPage" - ] - , Type.var "errorPage" - ] - , Type.namedWith - [ "Pages", "Internal", "Platform" ] - "Msg" - [ Type.var "userMsg" - , Type.var "pageData" - , Type.var "actionData" - , Type.var "sharedData" - , Type.var "errorPage" - ] - , Type.namedWith - [ "Pages", "Internal", "Platform" ] - "Model" - [ Type.var "userModel" - , Type.var "pageData" - , Type.var "actionData" - , Type.var "sharedData" - ] - ] - (Type.tuple - (Type.namedWith - [ "Pages", "Internal", "Platform" ] - "Model" - [ Type.var "userModel" - , Type.var "pageData" - , Type.var "actionData" - , Type.var "sharedData" - ] - ) - (Type.namedWith - [ "Pages", "Internal", "Platform" ] - "Effect" - [ Type.var "userMsg" - , Type.var "pageData" - , Type.var "actionData" - , Type.var "sharedData" - , Type.var "userEffect" - , Type.var "errorPage" - ] - ) - ) - ) - } - , view = - Elm.value - { importFrom = [ "Pages", "Internal", "Platform" ] - , name = "view" - , annotation = - Just - (Type.function - [ Type.namedWith - [ "Pages", "Internal", "Platform" ] - "ProgramConfig" - [ Type.var "userMsg" - , Type.var "userModel" - , Type.var "route" - , Type.var "pageData" - , Type.var "actionData" - , Type.var "sharedData" - , Type.var "effect" - , Type.namedWith - [ "Pages", "Internal", "Platform" ] - "Msg" - [ Type.var "userMsg" - , Type.var "pageData" - , Type.var "actionData" - , Type.var "sharedData" - , Type.var "errorPage" - ] - , Type.var "errorPage" - ] - , Type.namedWith - [ "Pages", "Internal", "Platform" ] - "Model" - [ Type.var "userModel" - , Type.var "pageData" - , Type.var "actionData" - , Type.var "sharedData" - ] - ] - (Type.namedWith - [ "Browser" ] - "Document" - [ Type.namedWith - [ "Pages", "Internal", "Platform" ] - "Msg" - [ Type.var "userMsg" - , Type.var "pageData" - , Type.var "actionData" - , Type.var "sharedData" - , Type.var "errorPage" - ] - ] - ) - ) - } - } \ No newline at end of file diff --git a/elm-open-api-codegen/src/Gen/Pages/Internal/Platform/Cli.elm b/elm-open-api-codegen/src/Gen/Pages/Internal/Platform/Cli.elm deleted file mode 100644 index af127dd5..00000000 --- a/elm-open-api-codegen/src/Gen/Pages/Internal/Platform/Cli.elm +++ /dev/null @@ -1,730 +0,0 @@ -module Gen.Pages.Internal.Platform.Cli exposing - ( moduleName_, cliApplication, init, requestDecoder, update, currentCompatibilityKey - , annotation_, make_, caseOf_, call_, values_ - ) - -{-| -# Generated bindings for Pages.Internal.Platform.Cli - -@docs moduleName_, cliApplication, init, requestDecoder, update, currentCompatibilityKey -@docs annotation_, make_, caseOf_, call_, values_ --} - - -import Elm -import Elm.Annotation as Type -import Elm.Arg -import Elm.Case - - -{-| The name of this module. -} -moduleName_ : List String -moduleName_ = - [ "Pages", "Internal", "Platform", "Cli" ] - - -{-| cliApplication: - Pages.Internal.Platform.Cli.ProgramConfig userMsg userModel (Maybe route) pageData actionData sharedData effect mappedMsg errorPage - -> Pages.Internal.Platform.Cli.Program (Maybe route) --} -cliApplication : Elm.Expression -> Elm.Expression -cliApplication cliApplicationArg_ = - Elm.apply - (Elm.value - { importFrom = [ "Pages", "Internal", "Platform", "Cli" ] - , name = "cliApplication" - , annotation = - Just - (Type.function - [ Type.namedWith - [ "Pages", "Internal", "Platform", "Cli" ] - "ProgramConfig" - [ Type.var "userMsg" - , Type.var "userModel" - , Type.maybe (Type.var "route") - , Type.var "pageData" - , Type.var "actionData" - , Type.var "sharedData" - , Type.var "effect" - , Type.var "mappedMsg" - , Type.var "errorPage" - ] - ] - (Type.namedWith - [ "Pages", "Internal", "Platform", "Cli" ] - "Program" - [ Type.maybe (Type.var "route") ] - ) - ) - } - ) - [ cliApplicationArg_ ] - - -{-| init: - Pages.SiteConfig.SiteConfig - -> RenderRequest.RenderRequest route - -> Pages.Internal.Platform.Cli.ProgramConfig userMsg userModel route pageData actionData sharedData effect mappedMsg errorPage - -> Json.Decode.Value - -> ( Pages.Internal.Platform.Cli.Model route, Pages.Internal.Platform.Effect.Effect ) --} -init : - Elm.Expression - -> Elm.Expression - -> Elm.Expression - -> Elm.Expression - -> Elm.Expression -init initArg_ initArg_0 initArg_1 initArg_2 = - Elm.apply - (Elm.value - { importFrom = [ "Pages", "Internal", "Platform", "Cli" ] - , name = "init" - , annotation = - Just - (Type.function - [ Type.namedWith - [ "Pages", "SiteConfig" ] - "SiteConfig" - [] - , Type.namedWith - [ "RenderRequest" ] - "RenderRequest" - [ Type.var "route" ] - , Type.namedWith - [ "Pages", "Internal", "Platform", "Cli" ] - "ProgramConfig" - [ Type.var "userMsg" - , Type.var "userModel" - , Type.var "route" - , Type.var "pageData" - , Type.var "actionData" - , Type.var "sharedData" - , Type.var "effect" - , Type.var "mappedMsg" - , Type.var "errorPage" - ] - , Type.namedWith [ "Json", "Decode" ] "Value" [] - ] - (Type.tuple - (Type.namedWith - [ "Pages", "Internal", "Platform", "Cli" ] - "Model" - [ Type.var "route" ] - ) - (Type.namedWith - [ "Pages" - , "Internal" - , "Platform" - , "Effect" - ] - "Effect" - [] - ) - ) - ) - } - ) - [ initArg_, initArg_0, initArg_1, initArg_2 ] - - -{-| requestDecoder: Json.Decode.Decoder Pages.StaticHttp.Request.Request -} -requestDecoder : Elm.Expression -requestDecoder = - Elm.value - { importFrom = [ "Pages", "Internal", "Platform", "Cli" ] - , name = "requestDecoder" - , annotation = - Just - (Type.namedWith - [ "Json", "Decode" ] - "Decoder" - [ Type.namedWith - [ "Pages", "StaticHttp", "Request" ] - "Request" - [] - ] - ) - } - - -{-| update: - Pages.Internal.Platform.Cli.Msg - -> Pages.Internal.Platform.Cli.Model route - -> ( Pages.Internal.Platform.Cli.Model route, Pages.Internal.Platform.Effect.Effect ) --} -update : Elm.Expression -> Elm.Expression -> Elm.Expression -update updateArg_ updateArg_0 = - Elm.apply - (Elm.value - { importFrom = [ "Pages", "Internal", "Platform", "Cli" ] - , name = "update" - , annotation = - Just - (Type.function - [ Type.namedWith - [ "Pages", "Internal", "Platform", "Cli" ] - "Msg" - [] - , Type.namedWith - [ "Pages", "Internal", "Platform", "Cli" ] - "Model" - [ Type.var "route" ] - ] - (Type.tuple - (Type.namedWith - [ "Pages", "Internal", "Platform", "Cli" ] - "Model" - [ Type.var "route" ] - ) - (Type.namedWith - [ "Pages" - , "Internal" - , "Platform" - , "Effect" - ] - "Effect" - [] - ) - ) - ) - } - ) - [ updateArg_, updateArg_0 ] - - -{-| currentCompatibilityKey: Int -} -currentCompatibilityKey : Elm.Expression -currentCompatibilityKey = - Elm.value - { importFrom = [ "Pages", "Internal", "Platform", "Cli" ] - , name = "currentCompatibilityKey" - , annotation = Just Type.int - } - - -annotation_ : - { flags : Type.Annotation - , model : Type.Annotation -> Type.Annotation - , msg : Type.Annotation - , programConfig : - Type.Annotation - -> Type.Annotation - -> Type.Annotation - -> Type.Annotation - -> Type.Annotation - -> Type.Annotation - -> Type.Annotation - -> Type.Annotation - -> Type.Annotation - -> Type.Annotation - , program : Type.Annotation -> Type.Annotation - } -annotation_ = - { flags = - Type.alias - moduleName_ - "Flags" - [] - (Type.namedWith [ "Json", "Decode" ] "Value" []) - , model = - \modelArg0 -> - Type.alias - moduleName_ - "Model" - [ modelArg0 ] - (Type.record - [ ( "staticResponses" - , Type.namedWith - [ "BackendTask" ] - "BackendTask" - [ Type.namedWith [ "FatalError" ] "FatalError" [] - , Type.namedWith - [ "Pages", "Internal", "Platform", "Effect" ] - "Effect" - [] - ] - ) - , ( "errors" - , Type.list - (Type.namedWith [ "BuildError" ] "BuildError" []) - ) - , ( "maybeRequestJson" - , Type.namedWith - [ "RenderRequest" ] - "RenderRequest" - [ Type.var "route" ] - ) - , ( "isDevServer", Type.bool ) - ] - ) - , msg = Type.namedWith [ "Pages", "Internal", "Platform", "Cli" ] "Msg" [] - , programConfig = - \programConfigArg0 programConfigArg1 programConfigArg2 programConfigArg3 programConfigArg4 programConfigArg5 programConfigArg6 programConfigArg7 programConfigArg8 -> - Type.alias - moduleName_ - "ProgramConfig" - [ programConfigArg0 - , programConfigArg1 - , programConfigArg2 - , programConfigArg3 - , programConfigArg4 - , programConfigArg5 - , programConfigArg6 - , programConfigArg7 - , programConfigArg8 - ] - (Type.namedWith - [ "Pages", "ProgramConfig" ] - "ProgramConfig" - [ Type.var "userMsg" - , Type.var "userModel" - , Type.var "route" - , Type.var "pageData" - , Type.var "actionData" - , Type.var "sharedData" - , Type.var "effect" - , Type.var "mappedMsg" - , Type.var "errorPage" - ] - ) - , program = - \programArg0 -> - Type.alias - moduleName_ - "Program" - [ programArg0 ] - (Type.namedWith - [ "Platform" ] - "Program" - [ Type.namedWith - [ "Pages", "Internal", "Platform", "Cli" ] - "Flags" - [] - , Type.namedWith - [ "Pages", "Internal", "Platform", "Cli" ] - "Model" - [ Type.var "route" ] - , Type.namedWith - [ "Pages", "Internal", "Platform", "Cli" ] - "Msg" - [] - ] - ) - } - - -make_ : - { model : - { staticResponses : Elm.Expression - , errors : Elm.Expression - , maybeRequestJson : Elm.Expression - , isDevServer : Elm.Expression - } - -> Elm.Expression - , gotDataBatch : Elm.Expression -> Elm.Expression - , gotBuildError : Elm.Expression -> Elm.Expression - } -make_ = - { model = - \model_args -> - Elm.withType - (Type.alias - [ "Pages", "Internal", "Platform", "Cli" ] - "Model" - [ Type.var "route" ] - (Type.record - [ ( "staticResponses" - , Type.namedWith - [ "BackendTask" ] - "BackendTask" - [ Type.namedWith - [ "FatalError" ] - "FatalError" - [] - , Type.namedWith - [ "Pages" - , "Internal" - , "Platform" - , "Effect" - ] - "Effect" - [] - ] - ) - , ( "errors" - , Type.list - (Type.namedWith - [ "BuildError" ] - "BuildError" - [] - ) - ) - , ( "maybeRequestJson" - , Type.namedWith - [ "RenderRequest" ] - "RenderRequest" - [ Type.var "route" ] - ) - , ( "isDevServer", Type.bool ) - ] - ) - ) - (Elm.record - [ Tuple.pair "staticResponses" model_args.staticResponses - , Tuple.pair "errors" model_args.errors - , Tuple.pair "maybeRequestJson" model_args.maybeRequestJson - , Tuple.pair "isDevServer" model_args.isDevServer - ] - ) - , gotDataBatch = - \ar0 -> - Elm.apply - (Elm.value - { importFrom = [ "Pages", "Internal", "Platform", "Cli" ] - , name = "GotDataBatch" - , annotation = Just (Type.namedWith [] "Msg" []) - } - ) - [ ar0 ] - , gotBuildError = - \ar0 -> - Elm.apply - (Elm.value - { importFrom = [ "Pages", "Internal", "Platform", "Cli" ] - , name = "GotBuildError" - , annotation = Just (Type.namedWith [] "Msg" []) - } - ) - [ ar0 ] - } - - -caseOf_ = - { msg = - \msgExpression msgTags -> - Elm.Case.custom - msgExpression - (Type.namedWith - [ "Pages", "Internal", "Platform", "Cli" ] - "Msg" - [] - ) - [ Elm.Case.branch - (Elm.Arg.customType - "GotDataBatch" - msgTags.gotDataBatch |> Elm.Arg.item - (Elm.Arg.varWith - "jsonDecodeValue" - (Type.namedWith - [ "Json" - , "Decode" - ] - "Value" - [] - ) - ) - ) - Basics.identity - , Elm.Case.branch - (Elm.Arg.customType - "GotBuildError" - msgTags.gotBuildError |> Elm.Arg.item - (Elm.Arg.varWith - "buildErrorBuildError" - (Type.namedWith - [ "BuildError" - ] - "BuildError" - [] - ) - ) - ) - Basics.identity - ] - } - - -call_ : - { cliApplication : Elm.Expression -> Elm.Expression - , init : - Elm.Expression - -> Elm.Expression - -> Elm.Expression - -> Elm.Expression - -> Elm.Expression - , update : Elm.Expression -> Elm.Expression -> Elm.Expression - } -call_ = - { cliApplication = - \cliApplicationArg_ -> - Elm.apply - (Elm.value - { importFrom = [ "Pages", "Internal", "Platform", "Cli" ] - , name = "cliApplication" - , annotation = - Just - (Type.function - [ Type.namedWith - [ "Pages", "Internal", "Platform", "Cli" ] - "ProgramConfig" - [ Type.var "userMsg" - , Type.var "userModel" - , Type.maybe (Type.var "route") - , Type.var "pageData" - , Type.var "actionData" - , Type.var "sharedData" - , Type.var "effect" - , Type.var "mappedMsg" - , Type.var "errorPage" - ] - ] - (Type.namedWith - [ "Pages" - , "Internal" - , "Platform" - , "Cli" - ] - "Program" - [ Type.maybe (Type.var "route") ] - ) - ) - } - ) - [ cliApplicationArg_ ] - , init = - \initArg_ initArg_0 initArg_1 initArg_2 -> - Elm.apply - (Elm.value - { importFrom = [ "Pages", "Internal", "Platform", "Cli" ] - , name = "init" - , annotation = - Just - (Type.function - [ Type.namedWith - [ "Pages", "SiteConfig" ] - "SiteConfig" - [] - , Type.namedWith - [ "RenderRequest" ] - "RenderRequest" - [ Type.var "route" ] - , Type.namedWith - [ "Pages", "Internal", "Platform", "Cli" ] - "ProgramConfig" - [ Type.var "userMsg" - , Type.var "userModel" - , Type.var "route" - , Type.var "pageData" - , Type.var "actionData" - , Type.var "sharedData" - , Type.var "effect" - , Type.var "mappedMsg" - , Type.var "errorPage" - ] - , Type.namedWith - [ "Json", "Decode" ] - "Value" - [] - ] - (Type.tuple - (Type.namedWith - [ "Pages" - , "Internal" - , "Platform" - , "Cli" - ] - "Model" - [ Type.var "route" ] - ) - (Type.namedWith - [ "Pages" - , "Internal" - , "Platform" - , "Effect" - ] - "Effect" - [] - ) - ) - ) - } - ) - [ initArg_, initArg_0, initArg_1, initArg_2 ] - , update = - \updateArg_ updateArg_0 -> - Elm.apply - (Elm.value - { importFrom = [ "Pages", "Internal", "Platform", "Cli" ] - , name = "update" - , annotation = - Just - (Type.function - [ Type.namedWith - [ "Pages", "Internal", "Platform", "Cli" ] - "Msg" - [] - , Type.namedWith - [ "Pages", "Internal", "Platform", "Cli" ] - "Model" - [ Type.var "route" ] - ] - (Type.tuple - (Type.namedWith - [ "Pages" - , "Internal" - , "Platform" - , "Cli" - ] - "Model" - [ Type.var "route" ] - ) - (Type.namedWith - [ "Pages" - , "Internal" - , "Platform" - , "Effect" - ] - "Effect" - [] - ) - ) - ) - } - ) - [ updateArg_, updateArg_0 ] - } - - -values_ : - { cliApplication : Elm.Expression - , init : Elm.Expression - , requestDecoder : Elm.Expression - , update : Elm.Expression - , currentCompatibilityKey : Elm.Expression - } -values_ = - { cliApplication = - Elm.value - { importFrom = [ "Pages", "Internal", "Platform", "Cli" ] - , name = "cliApplication" - , annotation = - Just - (Type.function - [ Type.namedWith - [ "Pages", "Internal", "Platform", "Cli" ] - "ProgramConfig" - [ Type.var "userMsg" - , Type.var "userModel" - , Type.maybe (Type.var "route") - , Type.var "pageData" - , Type.var "actionData" - , Type.var "sharedData" - , Type.var "effect" - , Type.var "mappedMsg" - , Type.var "errorPage" - ] - ] - (Type.namedWith - [ "Pages", "Internal", "Platform", "Cli" ] - "Program" - [ Type.maybe (Type.var "route") ] - ) - ) - } - , init = - Elm.value - { importFrom = [ "Pages", "Internal", "Platform", "Cli" ] - , name = "init" - , annotation = - Just - (Type.function - [ Type.namedWith - [ "Pages", "SiteConfig" ] - "SiteConfig" - [] - , Type.namedWith - [ "RenderRequest" ] - "RenderRequest" - [ Type.var "route" ] - , Type.namedWith - [ "Pages", "Internal", "Platform", "Cli" ] - "ProgramConfig" - [ Type.var "userMsg" - , Type.var "userModel" - , Type.var "route" - , Type.var "pageData" - , Type.var "actionData" - , Type.var "sharedData" - , Type.var "effect" - , Type.var "mappedMsg" - , Type.var "errorPage" - ] - , Type.namedWith [ "Json", "Decode" ] "Value" [] - ] - (Type.tuple - (Type.namedWith - [ "Pages", "Internal", "Platform", "Cli" ] - "Model" - [ Type.var "route" ] - ) - (Type.namedWith - [ "Pages", "Internal", "Platform", "Effect" ] - "Effect" - [] - ) - ) - ) - } - , requestDecoder = - Elm.value - { importFrom = [ "Pages", "Internal", "Platform", "Cli" ] - , name = "requestDecoder" - , annotation = - Just - (Type.namedWith - [ "Json", "Decode" ] - "Decoder" - [ Type.namedWith - [ "Pages", "StaticHttp", "Request" ] - "Request" - [] - ] - ) - } - , update = - Elm.value - { importFrom = [ "Pages", "Internal", "Platform", "Cli" ] - , name = "update" - , annotation = - Just - (Type.function - [ Type.namedWith - [ "Pages", "Internal", "Platform", "Cli" ] - "Msg" - [] - , Type.namedWith - [ "Pages", "Internal", "Platform", "Cli" ] - "Model" - [ Type.var "route" ] - ] - (Type.tuple - (Type.namedWith - [ "Pages", "Internal", "Platform", "Cli" ] - "Model" - [ Type.var "route" ] - ) - (Type.namedWith - [ "Pages", "Internal", "Platform", "Effect" ] - "Effect" - [] - ) - ) - ) - } - , currentCompatibilityKey = - Elm.value - { importFrom = [ "Pages", "Internal", "Platform", "Cli" ] - , name = "currentCompatibilityKey" - , annotation = Just Type.int - } - } \ No newline at end of file diff --git a/elm-open-api-codegen/src/Gen/Pages/Internal/Platform/GeneratorApplication.elm b/elm-open-api-codegen/src/Gen/Pages/Internal/Platform/GeneratorApplication.elm deleted file mode 100644 index caf90648..00000000 --- a/elm-open-api-codegen/src/Gen/Pages/Internal/Platform/GeneratorApplication.elm +++ /dev/null @@ -1,701 +0,0 @@ -module Gen.Pages.Internal.Platform.GeneratorApplication exposing - ( moduleName_, init, requestDecoder, update, app, annotation_ - , make_, caseOf_, call_, values_ - ) - -{-| -# Generated bindings for Pages.Internal.Platform.GeneratorApplication - -@docs moduleName_, init, requestDecoder, update, app, annotation_ -@docs make_, caseOf_, call_, values_ --} - - -import Elm -import Elm.Annotation as Type -import Elm.Arg -import Elm.Case - - -{-| The name of this module. -} -moduleName_ : List String -moduleName_ = - [ "Pages", "Internal", "Platform", "GeneratorApplication" ] - - -{-| init: - BackendTask.BackendTask FatalError.FatalError () - -> Cli.Program.FlagsIncludingArgv Pages.Internal.Platform.GeneratorApplication.Flags - -> ( Pages.Internal.Platform.GeneratorApplication.Model, Pages.Internal.Platform.Effect.Effect ) --} -init : Elm.Expression -> Elm.Expression -> Elm.Expression -init initArg_ initArg_0 = - Elm.apply - (Elm.value - { importFrom = - [ "Pages", "Internal", "Platform", "GeneratorApplication" ] - , name = "init" - , annotation = - Just - (Type.function - [ Type.namedWith - [ "BackendTask" ] - "BackendTask" - [ Type.namedWith [ "FatalError" ] "FatalError" [] - , Type.unit - ] - , Type.namedWith - [ "Cli", "Program" ] - "FlagsIncludingArgv" - [ Type.namedWith - [ "Pages" - , "Internal" - , "Platform" - , "GeneratorApplication" - ] - "Flags" - [] - ] - ] - (Type.tuple - (Type.namedWith - [ "Pages" - , "Internal" - , "Platform" - , "GeneratorApplication" - ] - "Model" - [] - ) - (Type.namedWith - [ "Pages" - , "Internal" - , "Platform" - , "Effect" - ] - "Effect" - [] - ) - ) - ) - } - ) - [ initArg_, initArg_0 ] - - -{-| requestDecoder: Json.Decode.Decoder Pages.StaticHttp.Request.Request -} -requestDecoder : Elm.Expression -requestDecoder = - Elm.value - { importFrom = - [ "Pages", "Internal", "Platform", "GeneratorApplication" ] - , name = "requestDecoder" - , annotation = - Just - (Type.namedWith - [ "Json", "Decode" ] - "Decoder" - [ Type.namedWith - [ "Pages", "StaticHttp", "Request" ] - "Request" - [] - ] - ) - } - - -{-| update: - Pages.Internal.Platform.GeneratorApplication.Msg - -> Pages.Internal.Platform.GeneratorApplication.Model - -> ( Pages.Internal.Platform.GeneratorApplication.Model, Pages.Internal.Platform.Effect.Effect ) --} -update : Elm.Expression -> Elm.Expression -> Elm.Expression -update updateArg_ updateArg_0 = - Elm.apply - (Elm.value - { importFrom = - [ "Pages", "Internal", "Platform", "GeneratorApplication" ] - , name = "update" - , annotation = - Just - (Type.function - [ Type.namedWith - [ "Pages" - , "Internal" - , "Platform" - , "GeneratorApplication" - ] - "Msg" - [] - , Type.namedWith - [ "Pages" - , "Internal" - , "Platform" - , "GeneratorApplication" - ] - "Model" - [] - ] - (Type.tuple - (Type.namedWith - [ "Pages" - , "Internal" - , "Platform" - , "GeneratorApplication" - ] - "Model" - [] - ) - (Type.namedWith - [ "Pages" - , "Internal" - , "Platform" - , "Effect" - ] - "Effect" - [] - ) - ) - ) - } - ) - [ updateArg_, updateArg_0 ] - - -{-| app: - Pages.GeneratorProgramConfig.GeneratorProgramConfig - -> Pages.Internal.Platform.GeneratorApplication.Program --} -app : Elm.Expression -> Elm.Expression -app appArg_ = - Elm.apply - (Elm.value - { importFrom = - [ "Pages", "Internal", "Platform", "GeneratorApplication" ] - , name = "app" - , annotation = - Just - (Type.function - [ Type.namedWith - [ "Pages", "GeneratorProgramConfig" ] - "GeneratorProgramConfig" - [] - ] - (Type.namedWith - [ "Pages" - , "Internal" - , "Platform" - , "GeneratorApplication" - ] - "Program" - [] - ) - ) - } - ) - [ appArg_ ] - - -annotation_ : - { program : Type.Annotation - , flags : Type.Annotation - , model : Type.Annotation - , msg : Type.Annotation - , jsonValue : Type.Annotation - } -annotation_ = - { program = - Type.alias - moduleName_ - "Program" - [] - (Type.namedWith - [ "Cli", "Program" ] - "StatefulProgram" - [ Type.namedWith - [ "Pages", "Internal", "Platform", "GeneratorApplication" ] - "Model" - [] - , Type.namedWith - [ "Pages", "Internal", "Platform", "GeneratorApplication" ] - "Msg" - [] - , Type.namedWith - [ "BackendTask" ] - "BackendTask" - [ Type.namedWith [ "FatalError" ] "FatalError" [] - , Type.unit - ] - , Type.namedWith - [ "Pages", "Internal", "Platform", "GeneratorApplication" ] - "Flags" - [] - ] - ) - , flags = - Type.alias - moduleName_ - "Flags" - [] - (Type.record [ ( "compatibilityKey", Type.int ) ]) - , model = - Type.alias - moduleName_ - "Model" - [] - (Type.record - [ ( "staticResponses" - , Type.namedWith - [ "BackendTask" ] - "BackendTask" - [ Type.namedWith [ "FatalError" ] "FatalError" [] - , Type.unit - ] - ) - , ( "errors" - , Type.list (Type.namedWith [ "BuildError" ] "BuildError" []) - ) - ] - ) - , msg = - Type.namedWith - [ "Pages", "Internal", "Platform", "GeneratorApplication" ] - "Msg" - [] - , jsonValue = - Type.alias - moduleName_ - "JsonValue" - [] - (Type.namedWith [ "Json", "Decode" ] "Value" []) - } - - -make_ : - { flags : { compatibilityKey : Elm.Expression } -> Elm.Expression - , model : - { staticResponses : Elm.Expression, errors : Elm.Expression } - -> Elm.Expression - , gotDataBatch : Elm.Expression -> Elm.Expression - , gotBuildError : Elm.Expression -> Elm.Expression - } -make_ = - { flags = - \flags_args -> - Elm.withType - (Type.alias - [ "Pages", "Internal", "Platform", "GeneratorApplication" ] - "Flags" - [] - (Type.record [ ( "compatibilityKey", Type.int ) ]) - ) - (Elm.record - [ Tuple.pair "compatibilityKey" flags_args.compatibilityKey - ] - ) - , model = - \model_args -> - Elm.withType - (Type.alias - [ "Pages", "Internal", "Platform", "GeneratorApplication" ] - "Model" - [] - (Type.record - [ ( "staticResponses" - , Type.namedWith - [ "BackendTask" ] - "BackendTask" - [ Type.namedWith - [ "FatalError" ] - "FatalError" - [] - , Type.unit - ] - ) - , ( "errors" - , Type.list - (Type.namedWith - [ "BuildError" ] - "BuildError" - [] - ) - ) - ] - ) - ) - (Elm.record - [ Tuple.pair "staticResponses" model_args.staticResponses - , Tuple.pair "errors" model_args.errors - ] - ) - , gotDataBatch = - \ar0 -> - Elm.apply - (Elm.value - { importFrom = - [ "Pages" - , "Internal" - , "Platform" - , "GeneratorApplication" - ] - , name = "GotDataBatch" - , annotation = Just (Type.namedWith [] "Msg" []) - } - ) - [ ar0 ] - , gotBuildError = - \ar0 -> - Elm.apply - (Elm.value - { importFrom = - [ "Pages" - , "Internal" - , "Platform" - , "GeneratorApplication" - ] - , name = "GotBuildError" - , annotation = Just (Type.namedWith [] "Msg" []) - } - ) - [ ar0 ] - } - - -caseOf_ = - { msg = - \msgExpression msgTags -> - Elm.Case.custom - msgExpression - (Type.namedWith - [ "Pages", "Internal", "Platform", "GeneratorApplication" ] - "Msg" - [] - ) - [ Elm.Case.branch - (Elm.Arg.customType - "GotDataBatch" - msgTags.gotDataBatch |> Elm.Arg.item - (Elm.Arg.varWith - "jsonDecodeValue" - (Type.namedWith - [ "Json" - , "Decode" - ] - "Value" - [] - ) - ) - ) - Basics.identity - , Elm.Case.branch - (Elm.Arg.customType - "GotBuildError" - msgTags.gotBuildError |> Elm.Arg.item - (Elm.Arg.varWith - "buildErrorBuildError" - (Type.namedWith - [ "BuildError" - ] - "BuildError" - [] - ) - ) - ) - Basics.identity - ] - } - - -call_ : - { init : Elm.Expression -> Elm.Expression -> Elm.Expression - , update : Elm.Expression -> Elm.Expression -> Elm.Expression - , app : Elm.Expression -> Elm.Expression - } -call_ = - { init = - \initArg_ initArg_0 -> - Elm.apply - (Elm.value - { importFrom = - [ "Pages" - , "Internal" - , "Platform" - , "GeneratorApplication" - ] - , name = "init" - , annotation = - Just - (Type.function - [ Type.namedWith - [ "BackendTask" ] - "BackendTask" - [ Type.namedWith - [ "FatalError" ] - "FatalError" - [] - , Type.unit - ] - , Type.namedWith - [ "Cli", "Program" ] - "FlagsIncludingArgv" - [ Type.namedWith - [ "Pages" - , "Internal" - , "Platform" - , "GeneratorApplication" - ] - "Flags" - [] - ] - ] - (Type.tuple - (Type.namedWith - [ "Pages" - , "Internal" - , "Platform" - , "GeneratorApplication" - ] - "Model" - [] - ) - (Type.namedWith - [ "Pages" - , "Internal" - , "Platform" - , "Effect" - ] - "Effect" - [] - ) - ) - ) - } - ) - [ initArg_, initArg_0 ] - , update = - \updateArg_ updateArg_0 -> - Elm.apply - (Elm.value - { importFrom = - [ "Pages" - , "Internal" - , "Platform" - , "GeneratorApplication" - ] - , name = "update" - , annotation = - Just - (Type.function - [ Type.namedWith - [ "Pages" - , "Internal" - , "Platform" - , "GeneratorApplication" - ] - "Msg" - [] - , Type.namedWith - [ "Pages" - , "Internal" - , "Platform" - , "GeneratorApplication" - ] - "Model" - [] - ] - (Type.tuple - (Type.namedWith - [ "Pages" - , "Internal" - , "Platform" - , "GeneratorApplication" - ] - "Model" - [] - ) - (Type.namedWith - [ "Pages" - , "Internal" - , "Platform" - , "Effect" - ] - "Effect" - [] - ) - ) - ) - } - ) - [ updateArg_, updateArg_0 ] - , app = - \appArg_ -> - Elm.apply - (Elm.value - { importFrom = - [ "Pages" - , "Internal" - , "Platform" - , "GeneratorApplication" - ] - , name = "app" - , annotation = - Just - (Type.function - [ Type.namedWith - [ "Pages", "GeneratorProgramConfig" ] - "GeneratorProgramConfig" - [] - ] - (Type.namedWith - [ "Pages" - , "Internal" - , "Platform" - , "GeneratorApplication" - ] - "Program" - [] - ) - ) - } - ) - [ appArg_ ] - } - - -values_ : - { init : Elm.Expression - , requestDecoder : Elm.Expression - , update : Elm.Expression - , app : Elm.Expression - } -values_ = - { init = - Elm.value - { importFrom = - [ "Pages", "Internal", "Platform", "GeneratorApplication" ] - , name = "init" - , annotation = - Just - (Type.function - [ Type.namedWith - [ "BackendTask" ] - "BackendTask" - [ Type.namedWith [ "FatalError" ] "FatalError" [] - , Type.unit - ] - , Type.namedWith - [ "Cli", "Program" ] - "FlagsIncludingArgv" - [ Type.namedWith - [ "Pages" - , "Internal" - , "Platform" - , "GeneratorApplication" - ] - "Flags" - [] - ] - ] - (Type.tuple - (Type.namedWith - [ "Pages" - , "Internal" - , "Platform" - , "GeneratorApplication" - ] - "Model" - [] - ) - (Type.namedWith - [ "Pages", "Internal", "Platform", "Effect" ] - "Effect" - [] - ) - ) - ) - } - , requestDecoder = - Elm.value - { importFrom = - [ "Pages", "Internal", "Platform", "GeneratorApplication" ] - , name = "requestDecoder" - , annotation = - Just - (Type.namedWith - [ "Json", "Decode" ] - "Decoder" - [ Type.namedWith - [ "Pages", "StaticHttp", "Request" ] - "Request" - [] - ] - ) - } - , update = - Elm.value - { importFrom = - [ "Pages", "Internal", "Platform", "GeneratorApplication" ] - , name = "update" - , annotation = - Just - (Type.function - [ Type.namedWith - [ "Pages" - , "Internal" - , "Platform" - , "GeneratorApplication" - ] - "Msg" - [] - , Type.namedWith - [ "Pages" - , "Internal" - , "Platform" - , "GeneratorApplication" - ] - "Model" - [] - ] - (Type.tuple - (Type.namedWith - [ "Pages" - , "Internal" - , "Platform" - , "GeneratorApplication" - ] - "Model" - [] - ) - (Type.namedWith - [ "Pages", "Internal", "Platform", "Effect" ] - "Effect" - [] - ) - ) - ) - } - , app = - Elm.value - { importFrom = - [ "Pages", "Internal", "Platform", "GeneratorApplication" ] - , name = "app" - , annotation = - Just - (Type.function - [ Type.namedWith - [ "Pages", "GeneratorProgramConfig" ] - "GeneratorProgramConfig" - [] - ] - (Type.namedWith - [ "Pages" - , "Internal" - , "Platform" - , "GeneratorApplication" - ] - "Program" - [] - ) - ) - } - } \ No newline at end of file diff --git a/elm-open-api-codegen/src/Gen/Pages/Internal/ResponseSketch.elm b/elm-open-api-codegen/src/Gen/Pages/Internal/ResponseSketch.elm deleted file mode 100644 index cf2488db..00000000 --- a/elm-open-api-codegen/src/Gen/Pages/Internal/ResponseSketch.elm +++ /dev/null @@ -1,250 +0,0 @@ -module Gen.Pages.Internal.ResponseSketch exposing ( moduleName_, annotation_, make_, caseOf_ ) - -{-| -# Generated bindings for Pages.Internal.ResponseSketch - -@docs moduleName_, annotation_, make_, caseOf_ --} - - -import Elm -import Elm.Annotation as Type -import Elm.Arg -import Elm.Case - - -{-| The name of this module. -} -moduleName_ : List String -moduleName_ = - [ "Pages", "Internal", "ResponseSketch" ] - - -annotation_ : - { responseSketch : - Type.Annotation -> Type.Annotation -> Type.Annotation -> Type.Annotation - } -annotation_ = - { responseSketch = - \responseSketchArg0 responseSketchArg1 responseSketchArg2 -> - Type.namedWith - [ "Pages", "Internal", "ResponseSketch" ] - "ResponseSketch" - [ responseSketchArg0, responseSketchArg1, responseSketchArg2 ] - } - - -make_ : - { renderPage : Elm.Expression -> Elm.Expression -> Elm.Expression - , hotUpdate : - Elm.Expression -> Elm.Expression -> Elm.Expression -> Elm.Expression - , redirect : Elm.Expression -> Elm.Expression - , notFound : Elm.Expression -> Elm.Expression - , action : Elm.Expression -> Elm.Expression - } -make_ = - { renderPage = - \ar0 ar1 -> - Elm.apply - (Elm.value - { importFrom = [ "Pages", "Internal", "ResponseSketch" ] - , name = "RenderPage" - , annotation = - Just - (Type.namedWith - [] - "ResponseSketch" - [ Type.var "data" - , Type.var "action" - , Type.var "shared" - ] - ) - } - ) - [ ar0, ar1 ] - , hotUpdate = - \ar0 ar1 ar2 -> - Elm.apply - (Elm.value - { importFrom = [ "Pages", "Internal", "ResponseSketch" ] - , name = "HotUpdate" - , annotation = - Just - (Type.namedWith - [] - "ResponseSketch" - [ Type.var "data" - , Type.var "action" - , Type.var "shared" - ] - ) - } - ) - [ ar0, ar1, ar2 ] - , redirect = - \ar0 -> - Elm.apply - (Elm.value - { importFrom = [ "Pages", "Internal", "ResponseSketch" ] - , name = "Redirect" - , annotation = - Just - (Type.namedWith - [] - "ResponseSketch" - [ Type.var "data" - , Type.var "action" - , Type.var "shared" - ] - ) - } - ) - [ ar0 ] - , notFound = - \ar0 -> - Elm.apply - (Elm.value - { importFrom = [ "Pages", "Internal", "ResponseSketch" ] - , name = "NotFound" - , annotation = - Just - (Type.namedWith - [] - "ResponseSketch" - [ Type.var "data" - , Type.var "action" - , Type.var "shared" - ] - ) - } - ) - [ ar0 ] - , action = - \ar0 -> - Elm.apply - (Elm.value - { importFrom = [ "Pages", "Internal", "ResponseSketch" ] - , name = "Action" - , annotation = - Just - (Type.namedWith - [] - "ResponseSketch" - [ Type.var "data" - , Type.var "action" - , Type.var "shared" - ] - ) - } - ) - [ ar0 ] - } - - -caseOf_ = - { responseSketch = - \responseSketchExpression responseSketchTags -> - Elm.Case.custom - responseSketchExpression - (Type.namedWith - [ "Pages", "Internal", "ResponseSketch" ] - "ResponseSketch" - [ Type.var "data", Type.var "action", Type.var "shared" ] - ) - [ Elm.Case.branch - (Elm.Arg.customType - "RenderPage" - responseSketchTags.renderPage |> Elm.Arg.item - (Elm.Arg.varWith - "data" - (Type.var - "data" - ) - ) |> Elm.Arg.item - (Elm.Arg.varWith - "maybeMaybe" - (Type.maybe - (Type.var - "action" - ) - ) - ) - ) - Basics.identity - , Elm.Case.branch - (Elm.Arg.customType - "HotUpdate" - responseSketchTags.hotUpdate |> Elm.Arg.item - (Elm.Arg.varWith - "data" - (Type.var - "data" - ) - ) |> Elm.Arg.item - (Elm.Arg.varWith - "shared" - (Type.var - "shared" - ) - ) |> Elm.Arg.item - (Elm.Arg.varWith - "maybeMaybe" - (Type.maybe - (Type.var - "action" - ) - ) - ) - ) - Basics.identity - , Elm.Case.branch - (Elm.Arg.customType - "Redirect" - responseSketchTags.redirect |> Elm.Arg.item - (Elm.Arg.varWith - "arg_0" - Type.string - ) - ) - Basics.identity - , Elm.Case.branch - (Elm.Arg.customType - "NotFound" - responseSketchTags.notFound |> Elm.Arg.item - (Elm.Arg.varWith - "arg_0" - (Type.record - [ ( "reason" - , Type.namedWith - [ "Pages" - , "Internal" - , "NotFoundReason" - ] - "NotFoundReason" - [] - ) - , ( "path" - , Type.namedWith - [ "UrlPath" - ] - "UrlPath" - [] - ) - ] - ) - ) - ) - Basics.identity - , Elm.Case.branch - (Elm.Arg.customType - "Action" - responseSketchTags.action |> Elm.Arg.item - (Elm.Arg.varWith - "action" - (Type.var - "action" - ) - ) - ) - Basics.identity - ] - } \ No newline at end of file diff --git a/elm-open-api-codegen/src/Gen/Pages/Internal/RoutePattern.elm b/elm-open-api-codegen/src/Gen/Pages/Internal/RoutePattern.elm deleted file mode 100644 index ca453ef9..00000000 --- a/elm-open-api-codegen/src/Gen/Pages/Internal/RoutePattern.elm +++ /dev/null @@ -1,1196 +0,0 @@ -module Gen.Pages.Internal.RoutePattern exposing - ( moduleName_, view, toVariant, routeToBranch, fromModuleName, hasRouteParams - , repeatWithoutOptionalEnding, toModuleName, toRouteParamTypes, toRouteParamsRecord, toVariantName, annotation_, make_ - , caseOf_, call_, values_ - ) - -{-| -# Generated bindings for Pages.Internal.RoutePattern - -@docs moduleName_, view, toVariant, routeToBranch, fromModuleName, hasRouteParams -@docs repeatWithoutOptionalEnding, toModuleName, toRouteParamTypes, toRouteParamsRecord, toVariantName, annotation_ -@docs make_, caseOf_, call_, values_ --} - - -import Elm -import Elm.Annotation as Type -import Elm.Arg -import Elm.Case - - -{-| The name of this module. -} -moduleName_ : List String -moduleName_ = - [ "Pages", "Internal", "RoutePattern" ] - - -{-| view: Pages.Internal.RoutePattern.RoutePattern -> Html.Html msg -} -view : Elm.Expression -> Elm.Expression -view viewArg_ = - Elm.apply - (Elm.value - { importFrom = [ "Pages", "Internal", "RoutePattern" ] - , name = "view" - , annotation = - Just - (Type.function - [ Type.namedWith - [ "Pages", "Internal", "RoutePattern" ] - "RoutePattern" - [] - ] - (Type.namedWith [ "Html" ] "Html" [ Type.var "msg" ]) - ) - } - ) - [ viewArg_ ] - - -{-| toVariant: Pages.Internal.RoutePattern.RoutePattern -> Elm.Variant -} -toVariant : Elm.Expression -> Elm.Expression -toVariant toVariantArg_ = - Elm.apply - (Elm.value - { importFrom = [ "Pages", "Internal", "RoutePattern" ] - , name = "toVariant" - , annotation = - Just - (Type.function - [ Type.namedWith - [ "Pages", "Internal", "RoutePattern" ] - "RoutePattern" - [] - ] - (Type.namedWith [ "Elm" ] "Variant" []) - ) - } - ) - [ toVariantArg_ ] - - -{-| routeToBranch: - Pages.Internal.RoutePattern.RoutePattern - -> List ( Elm.CodeGen.Pattern, Elm.CodeGen.Expression ) --} -routeToBranch : Elm.Expression -> Elm.Expression -routeToBranch routeToBranchArg_ = - Elm.apply - (Elm.value - { importFrom = [ "Pages", "Internal", "RoutePattern" ] - , name = "routeToBranch" - , annotation = - Just - (Type.function - [ Type.namedWith - [ "Pages", "Internal", "RoutePattern" ] - "RoutePattern" - [] - ] - (Type.list - (Type.tuple - (Type.namedWith - [ "Elm", "CodeGen" ] - "Pattern" - [] - ) - (Type.namedWith - [ "Elm", "CodeGen" ] - "Expression" - [] - ) - ) - ) - ) - } - ) - [ routeToBranchArg_ ] - - -{-| fromModuleName: List String -> Maybe Pages.Internal.RoutePattern.RoutePattern -} -fromModuleName : List String -> Elm.Expression -fromModuleName fromModuleNameArg_ = - Elm.apply - (Elm.value - { importFrom = [ "Pages", "Internal", "RoutePattern" ] - , name = "fromModuleName" - , annotation = - Just - (Type.function - [ Type.list Type.string ] - (Type.maybe - (Type.namedWith - [ "Pages", "Internal", "RoutePattern" ] - "RoutePattern" - [] - ) - ) - ) - } - ) - [ Elm.list (List.map Elm.string fromModuleNameArg_) ] - - -{-| hasRouteParams: Pages.Internal.RoutePattern.RoutePattern -> Bool -} -hasRouteParams : Elm.Expression -> Elm.Expression -hasRouteParams hasRouteParamsArg_ = - Elm.apply - (Elm.value - { importFrom = [ "Pages", "Internal", "RoutePattern" ] - , name = "hasRouteParams" - , annotation = - Just - (Type.function - [ Type.namedWith - [ "Pages", "Internal", "RoutePattern" ] - "RoutePattern" - [] - ] - Type.bool - ) - } - ) - [ hasRouteParamsArg_ ] - - -{-| repeatWithoutOptionalEnding: - List Pages.Internal.RoutePattern.RouteParam - -> Maybe (List Pages.Internal.RoutePattern.RouteParam) --} -repeatWithoutOptionalEnding : List Elm.Expression -> Elm.Expression -repeatWithoutOptionalEnding repeatWithoutOptionalEndingArg_ = - Elm.apply - (Elm.value - { importFrom = [ "Pages", "Internal", "RoutePattern" ] - , name = "repeatWithoutOptionalEnding" - , annotation = - Just - (Type.function - [ Type.list - (Type.namedWith - [ "Pages", "Internal", "RoutePattern" ] - "RouteParam" - [] - ) - ] - (Type.maybe - (Type.list - (Type.namedWith - [ "Pages", "Internal", "RoutePattern" ] - "RouteParam" - [] - ) - ) - ) - ) - } - ) - [ Elm.list repeatWithoutOptionalEndingArg_ ] - - -{-| toModuleName: Pages.Internal.RoutePattern.RoutePattern -> List String -} -toModuleName : Elm.Expression -> Elm.Expression -toModuleName toModuleNameArg_ = - Elm.apply - (Elm.value - { importFrom = [ "Pages", "Internal", "RoutePattern" ] - , name = "toModuleName" - , annotation = - Just - (Type.function - [ Type.namedWith - [ "Pages", "Internal", "RoutePattern" ] - "RoutePattern" - [] - ] - (Type.list Type.string) - ) - } - ) - [ toModuleNameArg_ ] - - -{-| toRouteParamTypes: - Pages.Internal.RoutePattern.RoutePattern - -> List ( String, Pages.Internal.RoutePattern.Param ) --} -toRouteParamTypes : Elm.Expression -> Elm.Expression -toRouteParamTypes toRouteParamTypesArg_ = - Elm.apply - (Elm.value - { importFrom = [ "Pages", "Internal", "RoutePattern" ] - , name = "toRouteParamTypes" - , annotation = - Just - (Type.function - [ Type.namedWith - [ "Pages", "Internal", "RoutePattern" ] - "RoutePattern" - [] - ] - (Type.list - (Type.tuple - Type.string - (Type.namedWith - [ "Pages", "Internal", "RoutePattern" ] - "Param" - [] - ) - ) - ) - ) - } - ) - [ toRouteParamTypesArg_ ] - - -{-| toRouteParamsRecord: - Pages.Internal.RoutePattern.RoutePattern - -> List ( String, Elm.Annotation.Annotation ) --} -toRouteParamsRecord : Elm.Expression -> Elm.Expression -toRouteParamsRecord toRouteParamsRecordArg_ = - Elm.apply - (Elm.value - { importFrom = [ "Pages", "Internal", "RoutePattern" ] - , name = "toRouteParamsRecord" - , annotation = - Just - (Type.function - [ Type.namedWith - [ "Pages", "Internal", "RoutePattern" ] - "RoutePattern" - [] - ] - (Type.list - (Type.tuple - Type.string - (Type.namedWith - [ "Elm", "Annotation" ] - "Annotation" - [] - ) - ) - ) - ) - } - ) - [ toRouteParamsRecordArg_ ] - - -{-| toVariantName: - Pages.Internal.RoutePattern.RoutePattern - -> { variantName : String - , params : List Pages.Internal.RoutePattern.RouteParam - } --} -toVariantName : Elm.Expression -> Elm.Expression -toVariantName toVariantNameArg_ = - Elm.apply - (Elm.value - { importFrom = [ "Pages", "Internal", "RoutePattern" ] - , name = "toVariantName" - , annotation = - Just - (Type.function - [ Type.namedWith - [ "Pages", "Internal", "RoutePattern" ] - "RoutePattern" - [] - ] - (Type.record - [ ( "variantName", Type.string ) - , ( "params" - , Type.list - (Type.namedWith - [ "Pages" - , "Internal" - , "RoutePattern" - ] - "RouteParam" - [] - ) - ) - ] - ) - ) - } - ) - [ toVariantNameArg_ ] - - -annotation_ : - { ending : Type.Annotation - , routePattern : Type.Annotation - , segment : Type.Annotation - , param : Type.Annotation - , routeParam : Type.Annotation - } -annotation_ = - { ending = - Type.namedWith [ "Pages", "Internal", "RoutePattern" ] "Ending" [] - , routePattern = - Type.alias - moduleName_ - "RoutePattern" - [] - (Type.record - [ ( "segments" - , Type.list - (Type.namedWith - [ "Pages", "Internal", "RoutePattern" ] - "Segment" - [] - ) - ) - , ( "ending" - , Type.maybe - (Type.namedWith - [ "Pages", "Internal", "RoutePattern" ] - "Ending" - [] - ) - ) - ] - ) - , segment = - Type.namedWith [ "Pages", "Internal", "RoutePattern" ] "Segment" [] - , param = Type.namedWith [ "Pages", "Internal", "RoutePattern" ] "Param" [] - , routeParam = - Type.namedWith [ "Pages", "Internal", "RoutePattern" ] "RouteParam" [] - } - - -make_ : - { optional : Elm.Expression -> Elm.Expression - , requiredSplat : Elm.Expression - , optionalSplat : Elm.Expression - , routePattern : - { segments : Elm.Expression, ending : Elm.Expression } -> Elm.Expression - , staticSegment : Elm.Expression -> Elm.Expression - , dynamicSegment : Elm.Expression -> Elm.Expression - , requiredParam : Elm.Expression - , optionalParam : Elm.Expression - , requiredSplatParam : Elm.Expression - , optionalSplatParam : Elm.Expression - , staticParam : Elm.Expression -> Elm.Expression - , dynamicParam : Elm.Expression -> Elm.Expression - , optionalParam2 : Elm.Expression -> Elm.Expression - , requiredSplatParam2 : Elm.Expression - , optionalSplatParam2 : Elm.Expression - } -make_ = - { optional = - \ar0 -> - Elm.apply - (Elm.value - { importFrom = [ "Pages", "Internal", "RoutePattern" ] - , name = "Optional" - , annotation = Just (Type.namedWith [] "Ending" []) - } - ) - [ ar0 ] - , requiredSplat = - Elm.value - { importFrom = [ "Pages", "Internal", "RoutePattern" ] - , name = "RequiredSplat" - , annotation = Just (Type.namedWith [] "Ending" []) - } - , optionalSplat = - Elm.value - { importFrom = [ "Pages", "Internal", "RoutePattern" ] - , name = "OptionalSplat" - , annotation = Just (Type.namedWith [] "Ending" []) - } - , routePattern = - \routePattern_args -> - Elm.withType - (Type.alias - [ "Pages", "Internal", "RoutePattern" ] - "RoutePattern" - [] - (Type.record - [ ( "segments" - , Type.list - (Type.namedWith - [ "Pages", "Internal", "RoutePattern" ] - "Segment" - [] - ) - ) - , ( "ending" - , Type.maybe - (Type.namedWith - [ "Pages", "Internal", "RoutePattern" ] - "Ending" - [] - ) - ) - ] - ) - ) - (Elm.record - [ Tuple.pair "segments" routePattern_args.segments - , Tuple.pair "ending" routePattern_args.ending - ] - ) - , staticSegment = - \ar0 -> - Elm.apply - (Elm.value - { importFrom = [ "Pages", "Internal", "RoutePattern" ] - , name = "StaticSegment" - , annotation = Just (Type.namedWith [] "Segment" []) - } - ) - [ ar0 ] - , dynamicSegment = - \ar0 -> - Elm.apply - (Elm.value - { importFrom = [ "Pages", "Internal", "RoutePattern" ] - , name = "DynamicSegment" - , annotation = Just (Type.namedWith [] "Segment" []) - } - ) - [ ar0 ] - , requiredParam = - Elm.value - { importFrom = [ "Pages", "Internal", "RoutePattern" ] - , name = "RequiredParam" - , annotation = Just (Type.namedWith [] "Param" []) - } - , optionalParam = - Elm.value - { importFrom = [ "Pages", "Internal", "RoutePattern" ] - , name = "OptionalParam" - , annotation = Just (Type.namedWith [] "Param" []) - } - , requiredSplatParam = - Elm.value - { importFrom = [ "Pages", "Internal", "RoutePattern" ] - , name = "RequiredSplatParam" - , annotation = Just (Type.namedWith [] "Param" []) - } - , optionalSplatParam = - Elm.value - { importFrom = [ "Pages", "Internal", "RoutePattern" ] - , name = "OptionalSplatParam" - , annotation = Just (Type.namedWith [] "Param" []) - } - , staticParam = - \ar0 -> - Elm.apply - (Elm.value - { importFrom = [ "Pages", "Internal", "RoutePattern" ] - , name = "StaticParam" - , annotation = Just (Type.namedWith [] "RouteParam" []) - } - ) - [ ar0 ] - , dynamicParam = - \ar0 -> - Elm.apply - (Elm.value - { importFrom = [ "Pages", "Internal", "RoutePattern" ] - , name = "DynamicParam" - , annotation = Just (Type.namedWith [] "RouteParam" []) - } - ) - [ ar0 ] - , optionalParam2 = - \ar0 -> - Elm.apply - (Elm.value - { importFrom = [ "Pages", "Internal", "RoutePattern" ] - , name = "OptionalParam2" - , annotation = Just (Type.namedWith [] "RouteParam" []) - } - ) - [ ar0 ] - , requiredSplatParam2 = - Elm.value - { importFrom = [ "Pages", "Internal", "RoutePattern" ] - , name = "RequiredSplatParam2" - , annotation = Just (Type.namedWith [] "RouteParam" []) - } - , optionalSplatParam2 = - Elm.value - { importFrom = [ "Pages", "Internal", "RoutePattern" ] - , name = "OptionalSplatParam2" - , annotation = Just (Type.namedWith [] "RouteParam" []) - } - } - - -caseOf_ : - { ending : - Elm.Expression - -> { optional : Elm.Expression -> Elm.Expression - , requiredSplat : Elm.Expression - , optionalSplat : Elm.Expression - } - -> Elm.Expression - , segment : - Elm.Expression - -> { staticSegment : Elm.Expression -> Elm.Expression - , dynamicSegment : Elm.Expression -> Elm.Expression - } - -> Elm.Expression - , param : - Elm.Expression - -> { requiredParam : Elm.Expression - , optionalParam : Elm.Expression - , requiredSplatParam : Elm.Expression - , optionalSplatParam : Elm.Expression - } - -> Elm.Expression - , routeParam : - Elm.Expression - -> { staticParam : Elm.Expression -> Elm.Expression - , dynamicParam : Elm.Expression -> Elm.Expression - , optionalParam2 : Elm.Expression -> Elm.Expression - , requiredSplatParam2 : Elm.Expression - , optionalSplatParam2 : Elm.Expression - } - -> Elm.Expression - } -caseOf_ = - { ending = - \endingExpression endingTags -> - Elm.Case.custom - endingExpression - (Type.namedWith - [ "Pages", "Internal", "RoutePattern" ] - "Ending" - [] - ) - [ Elm.Case.branch - (Elm.Arg.customType - "Optional" - endingTags.optional |> Elm.Arg.item - (Elm.Arg.varWith - "arg_0" - Type.string - ) - ) - Basics.identity - , Elm.Case.branch - (Elm.Arg.customType "RequiredSplat" endingTags.requiredSplat - ) - Basics.identity - , Elm.Case.branch - (Elm.Arg.customType "OptionalSplat" endingTags.optionalSplat - ) - Basics.identity - ] - , segment = - \segmentExpression segmentTags -> - Elm.Case.custom - segmentExpression - (Type.namedWith - [ "Pages", "Internal", "RoutePattern" ] - "Segment" - [] - ) - [ Elm.Case.branch - (Elm.Arg.customType - "StaticSegment" - segmentTags.staticSegment |> Elm.Arg.item - (Elm.Arg.varWith - "arg_0" - Type.string - ) - ) - Basics.identity - , Elm.Case.branch - (Elm.Arg.customType - "DynamicSegment" - segmentTags.dynamicSegment |> Elm.Arg.item - (Elm.Arg.varWith - "arg_0" - Type.string - ) - ) - Basics.identity - ] - , param = - \paramExpression paramTags -> - Elm.Case.custom - paramExpression - (Type.namedWith - [ "Pages", "Internal", "RoutePattern" ] - "Param" - [] - ) - [ Elm.Case.branch - (Elm.Arg.customType "RequiredParam" paramTags.requiredParam) - Basics.identity - , Elm.Case.branch - (Elm.Arg.customType "OptionalParam" paramTags.optionalParam) - Basics.identity - , Elm.Case.branch - (Elm.Arg.customType - "RequiredSplatParam" - paramTags.requiredSplatParam - ) - Basics.identity - , Elm.Case.branch - (Elm.Arg.customType - "OptionalSplatParam" - paramTags.optionalSplatParam - ) - Basics.identity - ] - , routeParam = - \routeParamExpression routeParamTags -> - Elm.Case.custom - routeParamExpression - (Type.namedWith - [ "Pages", "Internal", "RoutePattern" ] - "RouteParam" - [] - ) - [ Elm.Case.branch - (Elm.Arg.customType - "StaticParam" - routeParamTags.staticParam |> Elm.Arg.item - (Elm.Arg.varWith - "arg_0" - Type.string - ) - ) - Basics.identity - , Elm.Case.branch - (Elm.Arg.customType - "DynamicParam" - routeParamTags.dynamicParam |> Elm.Arg.item - (Elm.Arg.varWith - "arg_0" - Type.string - ) - ) - Basics.identity - , Elm.Case.branch - (Elm.Arg.customType - "OptionalParam2" - routeParamTags.optionalParam2 |> Elm.Arg.item - (Elm.Arg.varWith - "arg_0" - Type.string - ) - ) - Basics.identity - , Elm.Case.branch - (Elm.Arg.customType - "RequiredSplatParam2" - routeParamTags.requiredSplatParam2 - ) - Basics.identity - , Elm.Case.branch - (Elm.Arg.customType - "OptionalSplatParam2" - routeParamTags.optionalSplatParam2 - ) - Basics.identity - ] - } - - -call_ : - { view : Elm.Expression -> Elm.Expression - , toVariant : Elm.Expression -> Elm.Expression - , routeToBranch : Elm.Expression -> Elm.Expression - , fromModuleName : Elm.Expression -> Elm.Expression - , hasRouteParams : Elm.Expression -> Elm.Expression - , repeatWithoutOptionalEnding : Elm.Expression -> Elm.Expression - , toModuleName : Elm.Expression -> Elm.Expression - , toRouteParamTypes : Elm.Expression -> Elm.Expression - , toRouteParamsRecord : Elm.Expression -> Elm.Expression - , toVariantName : Elm.Expression -> Elm.Expression - } -call_ = - { view = - \viewArg_ -> - Elm.apply - (Elm.value - { importFrom = [ "Pages", "Internal", "RoutePattern" ] - , name = "view" - , annotation = - Just - (Type.function - [ Type.namedWith - [ "Pages", "Internal", "RoutePattern" ] - "RoutePattern" - [] - ] - (Type.namedWith - [ "Html" ] - "Html" - [ Type.var "msg" ] - ) - ) - } - ) - [ viewArg_ ] - , toVariant = - \toVariantArg_ -> - Elm.apply - (Elm.value - { importFrom = [ "Pages", "Internal", "RoutePattern" ] - , name = "toVariant" - , annotation = - Just - (Type.function - [ Type.namedWith - [ "Pages", "Internal", "RoutePattern" ] - "RoutePattern" - [] - ] - (Type.namedWith [ "Elm" ] "Variant" []) - ) - } - ) - [ toVariantArg_ ] - , routeToBranch = - \routeToBranchArg_ -> - Elm.apply - (Elm.value - { importFrom = [ "Pages", "Internal", "RoutePattern" ] - , name = "routeToBranch" - , annotation = - Just - (Type.function - [ Type.namedWith - [ "Pages", "Internal", "RoutePattern" ] - "RoutePattern" - [] - ] - (Type.list - (Type.tuple - (Type.namedWith - [ "Elm", "CodeGen" ] - "Pattern" - [] - ) - (Type.namedWith - [ "Elm", "CodeGen" ] - "Expression" - [] - ) - ) - ) - ) - } - ) - [ routeToBranchArg_ ] - , fromModuleName = - \fromModuleNameArg_ -> - Elm.apply - (Elm.value - { importFrom = [ "Pages", "Internal", "RoutePattern" ] - , name = "fromModuleName" - , annotation = - Just - (Type.function - [ Type.list Type.string ] - (Type.maybe - (Type.namedWith - [ "Pages" - , "Internal" - , "RoutePattern" - ] - "RoutePattern" - [] - ) - ) - ) - } - ) - [ fromModuleNameArg_ ] - , hasRouteParams = - \hasRouteParamsArg_ -> - Elm.apply - (Elm.value - { importFrom = [ "Pages", "Internal", "RoutePattern" ] - , name = "hasRouteParams" - , annotation = - Just - (Type.function - [ Type.namedWith - [ "Pages", "Internal", "RoutePattern" ] - "RoutePattern" - [] - ] - Type.bool - ) - } - ) - [ hasRouteParamsArg_ ] - , repeatWithoutOptionalEnding = - \repeatWithoutOptionalEndingArg_ -> - Elm.apply - (Elm.value - { importFrom = [ "Pages", "Internal", "RoutePattern" ] - , name = "repeatWithoutOptionalEnding" - , annotation = - Just - (Type.function - [ Type.list - (Type.namedWith - [ "Pages", "Internal", "RoutePattern" ] - "RouteParam" - [] - ) - ] - (Type.maybe - (Type.list - (Type.namedWith - [ "Pages" - , "Internal" - , "RoutePattern" - ] - "RouteParam" - [] - ) - ) - ) - ) - } - ) - [ repeatWithoutOptionalEndingArg_ ] - , toModuleName = - \toModuleNameArg_ -> - Elm.apply - (Elm.value - { importFrom = [ "Pages", "Internal", "RoutePattern" ] - , name = "toModuleName" - , annotation = - Just - (Type.function - [ Type.namedWith - [ "Pages", "Internal", "RoutePattern" ] - "RoutePattern" - [] - ] - (Type.list Type.string) - ) - } - ) - [ toModuleNameArg_ ] - , toRouteParamTypes = - \toRouteParamTypesArg_ -> - Elm.apply - (Elm.value - { importFrom = [ "Pages", "Internal", "RoutePattern" ] - , name = "toRouteParamTypes" - , annotation = - Just - (Type.function - [ Type.namedWith - [ "Pages", "Internal", "RoutePattern" ] - "RoutePattern" - [] - ] - (Type.list - (Type.tuple - Type.string - (Type.namedWith - [ "Pages" - , "Internal" - , "RoutePattern" - ] - "Param" - [] - ) - ) - ) - ) - } - ) - [ toRouteParamTypesArg_ ] - , toRouteParamsRecord = - \toRouteParamsRecordArg_ -> - Elm.apply - (Elm.value - { importFrom = [ "Pages", "Internal", "RoutePattern" ] - , name = "toRouteParamsRecord" - , annotation = - Just - (Type.function - [ Type.namedWith - [ "Pages", "Internal", "RoutePattern" ] - "RoutePattern" - [] - ] - (Type.list - (Type.tuple - Type.string - (Type.namedWith - [ "Elm", "Annotation" ] - "Annotation" - [] - ) - ) - ) - ) - } - ) - [ toRouteParamsRecordArg_ ] - , toVariantName = - \toVariantNameArg_ -> - Elm.apply - (Elm.value - { importFrom = [ "Pages", "Internal", "RoutePattern" ] - , name = "toVariantName" - , annotation = - Just - (Type.function - [ Type.namedWith - [ "Pages", "Internal", "RoutePattern" ] - "RoutePattern" - [] - ] - (Type.record - [ ( "variantName", Type.string ) - , ( "params" - , Type.list - (Type.namedWith - [ "Pages" - , "Internal" - , "RoutePattern" - ] - "RouteParam" - [] - ) - ) - ] - ) - ) - } - ) - [ toVariantNameArg_ ] - } - - -values_ : - { view : Elm.Expression - , toVariant : Elm.Expression - , routeToBranch : Elm.Expression - , fromModuleName : Elm.Expression - , hasRouteParams : Elm.Expression - , repeatWithoutOptionalEnding : Elm.Expression - , toModuleName : Elm.Expression - , toRouteParamTypes : Elm.Expression - , toRouteParamsRecord : Elm.Expression - , toVariantName : Elm.Expression - } -values_ = - { view = - Elm.value - { importFrom = [ "Pages", "Internal", "RoutePattern" ] - , name = "view" - , annotation = - Just - (Type.function - [ Type.namedWith - [ "Pages", "Internal", "RoutePattern" ] - "RoutePattern" - [] - ] - (Type.namedWith [ "Html" ] "Html" [ Type.var "msg" ]) - ) - } - , toVariant = - Elm.value - { importFrom = [ "Pages", "Internal", "RoutePattern" ] - , name = "toVariant" - , annotation = - Just - (Type.function - [ Type.namedWith - [ "Pages", "Internal", "RoutePattern" ] - "RoutePattern" - [] - ] - (Type.namedWith [ "Elm" ] "Variant" []) - ) - } - , routeToBranch = - Elm.value - { importFrom = [ "Pages", "Internal", "RoutePattern" ] - , name = "routeToBranch" - , annotation = - Just - (Type.function - [ Type.namedWith - [ "Pages", "Internal", "RoutePattern" ] - "RoutePattern" - [] - ] - (Type.list - (Type.tuple - (Type.namedWith - [ "Elm", "CodeGen" ] - "Pattern" - [] - ) - (Type.namedWith - [ "Elm", "CodeGen" ] - "Expression" - [] - ) - ) - ) - ) - } - , fromModuleName = - Elm.value - { importFrom = [ "Pages", "Internal", "RoutePattern" ] - , name = "fromModuleName" - , annotation = - Just - (Type.function - [ Type.list Type.string ] - (Type.maybe - (Type.namedWith - [ "Pages", "Internal", "RoutePattern" ] - "RoutePattern" - [] - ) - ) - ) - } - , hasRouteParams = - Elm.value - { importFrom = [ "Pages", "Internal", "RoutePattern" ] - , name = "hasRouteParams" - , annotation = - Just - (Type.function - [ Type.namedWith - [ "Pages", "Internal", "RoutePattern" ] - "RoutePattern" - [] - ] - Type.bool - ) - } - , repeatWithoutOptionalEnding = - Elm.value - { importFrom = [ "Pages", "Internal", "RoutePattern" ] - , name = "repeatWithoutOptionalEnding" - , annotation = - Just - (Type.function - [ Type.list - (Type.namedWith - [ "Pages", "Internal", "RoutePattern" ] - "RouteParam" - [] - ) - ] - (Type.maybe - (Type.list - (Type.namedWith - [ "Pages", "Internal", "RoutePattern" ] - "RouteParam" - [] - ) - ) - ) - ) - } - , toModuleName = - Elm.value - { importFrom = [ "Pages", "Internal", "RoutePattern" ] - , name = "toModuleName" - , annotation = - Just - (Type.function - [ Type.namedWith - [ "Pages", "Internal", "RoutePattern" ] - "RoutePattern" - [] - ] - (Type.list Type.string) - ) - } - , toRouteParamTypes = - Elm.value - { importFrom = [ "Pages", "Internal", "RoutePattern" ] - , name = "toRouteParamTypes" - , annotation = - Just - (Type.function - [ Type.namedWith - [ "Pages", "Internal", "RoutePattern" ] - "RoutePattern" - [] - ] - (Type.list - (Type.tuple - Type.string - (Type.namedWith - [ "Pages", "Internal", "RoutePattern" ] - "Param" - [] - ) - ) - ) - ) - } - , toRouteParamsRecord = - Elm.value - { importFrom = [ "Pages", "Internal", "RoutePattern" ] - , name = "toRouteParamsRecord" - , annotation = - Just - (Type.function - [ Type.namedWith - [ "Pages", "Internal", "RoutePattern" ] - "RoutePattern" - [] - ] - (Type.list - (Type.tuple - Type.string - (Type.namedWith - [ "Elm", "Annotation" ] - "Annotation" - [] - ) - ) - ) - ) - } - , toVariantName = - Elm.value - { importFrom = [ "Pages", "Internal", "RoutePattern" ] - , name = "toVariantName" - , annotation = - Just - (Type.function - [ Type.namedWith - [ "Pages", "Internal", "RoutePattern" ] - "RoutePattern" - [] - ] - (Type.record - [ ( "variantName", Type.string ) - , ( "params" - , Type.list - (Type.namedWith - [ "Pages" - , "Internal" - , "RoutePattern" - ] - "RouteParam" - [] - ) - ) - ] - ) - ) - } - } \ No newline at end of file diff --git a/elm-open-api-codegen/src/Gen/Pages/Internal/Router.elm b/elm-open-api-codegen/src/Gen/Pages/Internal/Router.elm deleted file mode 100644 index 07c43fe6..00000000 --- a/elm-open-api-codegen/src/Gen/Pages/Internal/Router.elm +++ /dev/null @@ -1,340 +0,0 @@ -module Gen.Pages.Internal.Router exposing - ( moduleName_, firstMatch, fromOptionalSplat, maybeToList, nonEmptyToList, toNonEmpty - , annotation_, make_, call_, values_ - ) - -{-| -# Generated bindings for Pages.Internal.Router - -@docs moduleName_, firstMatch, fromOptionalSplat, maybeToList, nonEmptyToList, toNonEmpty -@docs annotation_, make_, call_, values_ --} - - -import Elm -import Elm.Annotation as Type - - -{-| The name of this module. -} -moduleName_ : List String -moduleName_ = - [ "Pages", "Internal", "Router" ] - - -{-| firstMatch: List (Pages.Internal.Router.Matcher route) -> String -> Maybe route -} -firstMatch : List Elm.Expression -> String -> Elm.Expression -firstMatch firstMatchArg_ firstMatchArg_0 = - Elm.apply - (Elm.value - { importFrom = [ "Pages", "Internal", "Router" ] - , name = "firstMatch" - , annotation = - Just - (Type.function - [ Type.list - (Type.namedWith - [ "Pages", "Internal", "Router" ] - "Matcher" - [ Type.var "route" ] - ) - , Type.string - ] - (Type.maybe (Type.var "route")) - ) - } - ) - [ Elm.list firstMatchArg_, Elm.string firstMatchArg_0 ] - - -{-| fromOptionalSplat: Maybe String -> List String -} -fromOptionalSplat : Elm.Expression -> Elm.Expression -fromOptionalSplat fromOptionalSplatArg_ = - Elm.apply - (Elm.value - { importFrom = [ "Pages", "Internal", "Router" ] - , name = "fromOptionalSplat" - , annotation = - Just - (Type.function - [ Type.maybe Type.string ] - (Type.list Type.string) - ) - } - ) - [ fromOptionalSplatArg_ ] - - -{-| maybeToList: Maybe String -> List String -} -maybeToList : Elm.Expression -> Elm.Expression -maybeToList maybeToListArg_ = - Elm.apply - (Elm.value - { importFrom = [ "Pages", "Internal", "Router" ] - , name = "maybeToList" - , annotation = - Just - (Type.function - [ Type.maybe Type.string ] - (Type.list Type.string) - ) - } - ) - [ maybeToListArg_ ] - - -{-| nonEmptyToList: ( String, List String ) -> List String -} -nonEmptyToList : Elm.Expression -> Elm.Expression -nonEmptyToList nonEmptyToListArg_ = - Elm.apply - (Elm.value - { importFrom = [ "Pages", "Internal", "Router" ] - , name = "nonEmptyToList" - , annotation = - Just - (Type.function - [ Type.tuple Type.string (Type.list Type.string) ] - (Type.list Type.string) - ) - } - ) - [ nonEmptyToListArg_ ] - - -{-| toNonEmpty: String -> ( String, List String ) -} -toNonEmpty : String -> Elm.Expression -toNonEmpty toNonEmptyArg_ = - Elm.apply - (Elm.value - { importFrom = [ "Pages", "Internal", "Router" ] - , name = "toNonEmpty" - , annotation = - Just - (Type.function - [ Type.string ] - (Type.tuple Type.string (Type.list Type.string)) - ) - } - ) - [ Elm.string toNonEmptyArg_ ] - - -annotation_ : { matcher : Type.Annotation -> Type.Annotation } -annotation_ = - { matcher = - \matcherArg0 -> - Type.alias - moduleName_ - "Matcher" - [ matcherArg0 ] - (Type.record - [ ( "pattern", Type.string ) - , ( "toRoute" - , Type.function - [ Type.list (Type.maybe Type.string) ] - (Type.maybe (Type.var "route")) - ) - ] - ) - } - - -make_ : - { matcher : - { pattern : Elm.Expression, toRoute : Elm.Expression } -> Elm.Expression - } -make_ = - { matcher = - \matcher_args -> - Elm.withType - (Type.alias - [ "Pages", "Internal", "Router" ] - "Matcher" - [ Type.var "route" ] - (Type.record - [ ( "pattern", Type.string ) - , ( "toRoute" - , Type.function - [ Type.list (Type.maybe Type.string) ] - (Type.maybe (Type.var "route")) - ) - ] - ) - ) - (Elm.record - [ Tuple.pair "pattern" matcher_args.pattern - , Tuple.pair "toRoute" matcher_args.toRoute - ] - ) - } - - -call_ : - { firstMatch : Elm.Expression -> Elm.Expression -> Elm.Expression - , fromOptionalSplat : Elm.Expression -> Elm.Expression - , maybeToList : Elm.Expression -> Elm.Expression - , nonEmptyToList : Elm.Expression -> Elm.Expression - , toNonEmpty : Elm.Expression -> Elm.Expression - } -call_ = - { firstMatch = - \firstMatchArg_ firstMatchArg_0 -> - Elm.apply - (Elm.value - { importFrom = [ "Pages", "Internal", "Router" ] - , name = "firstMatch" - , annotation = - Just - (Type.function - [ Type.list - (Type.namedWith - [ "Pages", "Internal", "Router" ] - "Matcher" - [ Type.var "route" ] - ) - , Type.string - ] - (Type.maybe (Type.var "route")) - ) - } - ) - [ firstMatchArg_, firstMatchArg_0 ] - , fromOptionalSplat = - \fromOptionalSplatArg_ -> - Elm.apply - (Elm.value - { importFrom = [ "Pages", "Internal", "Router" ] - , name = "fromOptionalSplat" - , annotation = - Just - (Type.function - [ Type.maybe Type.string ] - (Type.list Type.string) - ) - } - ) - [ fromOptionalSplatArg_ ] - , maybeToList = - \maybeToListArg_ -> - Elm.apply - (Elm.value - { importFrom = [ "Pages", "Internal", "Router" ] - , name = "maybeToList" - , annotation = - Just - (Type.function - [ Type.maybe Type.string ] - (Type.list Type.string) - ) - } - ) - [ maybeToListArg_ ] - , nonEmptyToList = - \nonEmptyToListArg_ -> - Elm.apply - (Elm.value - { importFrom = [ "Pages", "Internal", "Router" ] - , name = "nonEmptyToList" - , annotation = - Just - (Type.function - [ Type.tuple - Type.string - (Type.list Type.string) - ] - (Type.list Type.string) - ) - } - ) - [ nonEmptyToListArg_ ] - , toNonEmpty = - \toNonEmptyArg_ -> - Elm.apply - (Elm.value - { importFrom = [ "Pages", "Internal", "Router" ] - , name = "toNonEmpty" - , annotation = - Just - (Type.function - [ Type.string ] - (Type.tuple - Type.string - (Type.list Type.string) - ) - ) - } - ) - [ toNonEmptyArg_ ] - } - - -values_ : - { firstMatch : Elm.Expression - , fromOptionalSplat : Elm.Expression - , maybeToList : Elm.Expression - , nonEmptyToList : Elm.Expression - , toNonEmpty : Elm.Expression - } -values_ = - { firstMatch = - Elm.value - { importFrom = [ "Pages", "Internal", "Router" ] - , name = "firstMatch" - , annotation = - Just - (Type.function - [ Type.list - (Type.namedWith - [ "Pages", "Internal", "Router" ] - "Matcher" - [ Type.var "route" ] - ) - , Type.string - ] - (Type.maybe (Type.var "route")) - ) - } - , fromOptionalSplat = - Elm.value - { importFrom = [ "Pages", "Internal", "Router" ] - , name = "fromOptionalSplat" - , annotation = - Just - (Type.function - [ Type.maybe Type.string ] - (Type.list Type.string) - ) - } - , maybeToList = - Elm.value - { importFrom = [ "Pages", "Internal", "Router" ] - , name = "maybeToList" - , annotation = - Just - (Type.function - [ Type.maybe Type.string ] - (Type.list Type.string) - ) - } - , nonEmptyToList = - Elm.value - { importFrom = [ "Pages", "Internal", "Router" ] - , name = "nonEmptyToList" - , annotation = - Just - (Type.function - [ Type.tuple Type.string (Type.list Type.string) ] - (Type.list Type.string) - ) - } - , toNonEmpty = - Elm.value - { importFrom = [ "Pages", "Internal", "Router" ] - , name = "toNonEmpty" - , annotation = - Just - (Type.function - [ Type.string ] - (Type.tuple Type.string (Type.list Type.string)) - ) - } - } \ No newline at end of file diff --git a/elm-open-api-codegen/src/Gen/Pages/Manifest.elm b/elm-open-api-codegen/src/Gen/Pages/Manifest.elm deleted file mode 100644 index a893938a..00000000 --- a/elm-open-api-codegen/src/Gen/Pages/Manifest.elm +++ /dev/null @@ -1,1391 +0,0 @@ -module Gen.Pages.Manifest exposing - ( moduleName_, init, withBackgroundColor, withCategories, withDisplayMode, withIarcRatingId - , withLang, withOrientation, withShortName, withThemeColor, withField, generator, toJson - , annotation_, make_, caseOf_, call_, values_ - ) - -{-| -# Generated bindings for Pages.Manifest - -@docs moduleName_, init, withBackgroundColor, withCategories, withDisplayMode, withIarcRatingId -@docs withLang, withOrientation, withShortName, withThemeColor, withField, generator -@docs toJson, annotation_, make_, caseOf_, call_, values_ --} - - -import Elm -import Elm.Annotation as Type -import Elm.Arg -import Elm.Case - - -{-| The name of this module. -} -moduleName_ : List String -moduleName_ = - [ "Pages", "Manifest" ] - - -{-| Setup a minimal Manifest.Config. You can then use the `with...` builder functions to set additional options. - -init: - { description : String - , name : String - , startUrl : UrlPath.UrlPath - , icons : List Pages.Manifest.Icon - } - -> Pages.Manifest.Config --} -init : - { description : String - , name : String - , startUrl : Elm.Expression - , icons : List Elm.Expression - } - -> Elm.Expression -init initArg_ = - Elm.apply - (Elm.value - { importFrom = [ "Pages", "Manifest" ] - , name = "init" - , annotation = - Just - (Type.function - [ Type.record - [ ( "description", Type.string ) - , ( "name", Type.string ) - , ( "startUrl" - , Type.namedWith [ "UrlPath" ] "UrlPath" [] - ) - , ( "icons" - , Type.list - (Type.namedWith - [ "Pages", "Manifest" ] - "Icon" - [] - ) - ) - ] - ] - (Type.namedWith [ "Pages", "Manifest" ] "Config" []) - ) - } - ) - [ Elm.record - [ Tuple.pair "description" (Elm.string initArg_.description) - , Tuple.pair "name" (Elm.string initArg_.name) - , Tuple.pair "startUrl" initArg_.startUrl - , Tuple.pair "icons" (Elm.list initArg_.icons) - ] - ] - - -{-| Set . - -withBackgroundColor: Color.Color -> Pages.Manifest.Config -> Pages.Manifest.Config --} -withBackgroundColor : Elm.Expression -> Elm.Expression -> Elm.Expression -withBackgroundColor withBackgroundColorArg_ withBackgroundColorArg_0 = - Elm.apply - (Elm.value - { importFrom = [ "Pages", "Manifest" ] - , name = "withBackgroundColor" - , annotation = - Just - (Type.function - [ Type.namedWith [ "Color" ] "Color" [] - , Type.namedWith [ "Pages", "Manifest" ] "Config" [] - ] - (Type.namedWith [ "Pages", "Manifest" ] "Config" []) - ) - } - ) - [ withBackgroundColorArg_, withBackgroundColorArg_0 ] - - -{-| Set . - -withCategories: - List Pages.Manifest.Category.Category - -> Pages.Manifest.Config - -> Pages.Manifest.Config --} -withCategories : List Elm.Expression -> Elm.Expression -> Elm.Expression -withCategories withCategoriesArg_ withCategoriesArg_0 = - Elm.apply - (Elm.value - { importFrom = [ "Pages", "Manifest" ] - , name = "withCategories" - , annotation = - Just - (Type.function - [ Type.list - (Type.namedWith - [ "Pages", "Manifest", "Category" ] - "Category" - [] - ) - , Type.namedWith [ "Pages", "Manifest" ] "Config" [] - ] - (Type.namedWith [ "Pages", "Manifest" ] "Config" []) - ) - } - ) - [ Elm.list withCategoriesArg_, withCategoriesArg_0 ] - - -{-| Set . - -withDisplayMode: Pages.Manifest.DisplayMode -> Pages.Manifest.Config -> Pages.Manifest.Config --} -withDisplayMode : Elm.Expression -> Elm.Expression -> Elm.Expression -withDisplayMode withDisplayModeArg_ withDisplayModeArg_0 = - Elm.apply - (Elm.value - { importFrom = [ "Pages", "Manifest" ] - , name = "withDisplayMode" - , annotation = - Just - (Type.function - [ Type.namedWith - [ "Pages", "Manifest" ] - "DisplayMode" - [] - , Type.namedWith [ "Pages", "Manifest" ] "Config" [] - ] - (Type.namedWith [ "Pages", "Manifest" ] "Config" []) - ) - } - ) - [ withDisplayModeArg_, withDisplayModeArg_0 ] - - -{-| Set . - -withIarcRatingId: String -> Pages.Manifest.Config -> Pages.Manifest.Config --} -withIarcRatingId : String -> Elm.Expression -> Elm.Expression -withIarcRatingId withIarcRatingIdArg_ withIarcRatingIdArg_0 = - Elm.apply - (Elm.value - { importFrom = [ "Pages", "Manifest" ] - , name = "withIarcRatingId" - , annotation = - Just - (Type.function - [ Type.string - , Type.namedWith [ "Pages", "Manifest" ] "Config" [] - ] - (Type.namedWith [ "Pages", "Manifest" ] "Config" []) - ) - } - ) - [ Elm.string withIarcRatingIdArg_, withIarcRatingIdArg_0 ] - - -{-| Set . - -withLang: LanguageTag.LanguageTag -> Pages.Manifest.Config -> Pages.Manifest.Config --} -withLang : Elm.Expression -> Elm.Expression -> Elm.Expression -withLang withLangArg_ withLangArg_0 = - Elm.apply - (Elm.value - { importFrom = [ "Pages", "Manifest" ] - , name = "withLang" - , annotation = - Just - (Type.function - [ Type.namedWith [ "LanguageTag" ] "LanguageTag" [] - , Type.namedWith [ "Pages", "Manifest" ] "Config" [] - ] - (Type.namedWith [ "Pages", "Manifest" ] "Config" []) - ) - } - ) - [ withLangArg_, withLangArg_0 ] - - -{-| Set . - -withOrientation: Pages.Manifest.Orientation -> Pages.Manifest.Config -> Pages.Manifest.Config --} -withOrientation : Elm.Expression -> Elm.Expression -> Elm.Expression -withOrientation withOrientationArg_ withOrientationArg_0 = - Elm.apply - (Elm.value - { importFrom = [ "Pages", "Manifest" ] - , name = "withOrientation" - , annotation = - Just - (Type.function - [ Type.namedWith - [ "Pages", "Manifest" ] - "Orientation" - [] - , Type.namedWith [ "Pages", "Manifest" ] "Config" [] - ] - (Type.namedWith [ "Pages", "Manifest" ] "Config" []) - ) - } - ) - [ withOrientationArg_, withOrientationArg_0 ] - - -{-| Set . - -withShortName: String -> Pages.Manifest.Config -> Pages.Manifest.Config --} -withShortName : String -> Elm.Expression -> Elm.Expression -withShortName withShortNameArg_ withShortNameArg_0 = - Elm.apply - (Elm.value - { importFrom = [ "Pages", "Manifest" ] - , name = "withShortName" - , annotation = - Just - (Type.function - [ Type.string - , Type.namedWith [ "Pages", "Manifest" ] "Config" [] - ] - (Type.namedWith [ "Pages", "Manifest" ] "Config" []) - ) - } - ) - [ Elm.string withShortNameArg_, withShortNameArg_0 ] - - -{-| Set . - -withThemeColor: Color.Color -> Pages.Manifest.Config -> Pages.Manifest.Config --} -withThemeColor : Elm.Expression -> Elm.Expression -> Elm.Expression -withThemeColor withThemeColorArg_ withThemeColorArg_0 = - Elm.apply - (Elm.value - { importFrom = [ "Pages", "Manifest" ] - , name = "withThemeColor" - , annotation = - Just - (Type.function - [ Type.namedWith [ "Color" ] "Color" [] - , Type.namedWith [ "Pages", "Manifest" ] "Config" [] - ] - (Type.namedWith [ "Pages", "Manifest" ] "Config" []) - ) - } - ) - [ withThemeColorArg_, withThemeColorArg_0 ] - - -{-| Escape hatch for specifying fields that aren't exposed through this module otherwise. The possible supported properties -in a manifest file can change over time, so see [MDN manifest.json docs](https://developer.mozilla.org/en-US/docs/Mozilla/Add-ons/WebExtensions/manifest.json) -for a full listing of the current supported properties. - -withField: String -> Json.Encode.Value -> Pages.Manifest.Config -> Pages.Manifest.Config --} -withField : String -> Elm.Expression -> Elm.Expression -> Elm.Expression -withField withFieldArg_ withFieldArg_0 withFieldArg_1 = - Elm.apply - (Elm.value - { importFrom = [ "Pages", "Manifest" ] - , name = "withField" - , annotation = - Just - (Type.function - [ Type.string - , Type.namedWith [ "Json", "Encode" ] "Value" [] - , Type.namedWith [ "Pages", "Manifest" ] "Config" [] - ] - (Type.namedWith [ "Pages", "Manifest" ] "Config" []) - ) - } - ) - [ Elm.string withFieldArg_, withFieldArg_0, withFieldArg_1 ] - - -{-| A generator for `Api.elm` to include a manifest.json. The String argument is the canonical URL of the site. - - module Api exposing (routes) - - import ApiRoute - import Pages.Manifest - - routes : - BackendTask FatalError (List Route) - -> (Maybe { indent : Int, newLines : Bool } -> Html Never -> String) - -> List (ApiRoute.ApiRoute ApiRoute.Response) - routes getStaticRoutes htmlToString = - [ Pages.Manifest.generator - Site.canonicalUrl - Manifest.config - ] - -generator: - String - -> BackendTask.BackendTask FatalError.FatalError Pages.Manifest.Config - -> ApiRoute.ApiRoute ApiRoute.Response --} -generator : String -> Elm.Expression -> Elm.Expression -generator generatorArg_ generatorArg_0 = - Elm.apply - (Elm.value - { importFrom = [ "Pages", "Manifest" ] - , name = "generator" - , annotation = - Just - (Type.function - [ Type.string - , Type.namedWith - [ "BackendTask" ] - "BackendTask" - [ Type.namedWith [ "FatalError" ] "FatalError" [] - , Type.namedWith - [ "Pages", "Manifest" ] - "Config" - [] - ] - ] - (Type.namedWith - [ "ApiRoute" ] - "ApiRoute" - [ Type.namedWith [ "ApiRoute" ] "Response" [] ] - ) - ) - } - ) - [ Elm.string generatorArg_, generatorArg_0 ] - - -{-| Feel free to use this, but in 99% of cases you won't need it. The generated -code will run this for you to generate your `manifest.json` file automatically! - -toJson: String -> Pages.Manifest.Config -> Json.Encode.Value --} -toJson : String -> Elm.Expression -> Elm.Expression -toJson toJsonArg_ toJsonArg_0 = - Elm.apply - (Elm.value - { importFrom = [ "Pages", "Manifest" ] - , name = "toJson" - , annotation = - Just - (Type.function - [ Type.string - , Type.namedWith [ "Pages", "Manifest" ] "Config" [] - ] - (Type.namedWith [ "Json", "Encode" ] "Value" []) - ) - } - ) - [ Elm.string toJsonArg_, toJsonArg_0 ] - - -annotation_ : - { config : Type.Annotation - , icon : Type.Annotation - , displayMode : Type.Annotation - , orientation : Type.Annotation - , iconPurpose : Type.Annotation - } -annotation_ = - { config = - Type.alias - moduleName_ - "Config" - [] - (Type.record - [ ( "backgroundColor" - , Type.maybe (Type.namedWith [ "Color" ] "Color" []) - ) - , ( "categories" - , Type.list - (Type.namedWith - [ "Pages", "Manifest", "Category" ] - "Category" - [] - ) - ) - , ( "displayMode" - , Type.namedWith [ "Pages", "Manifest" ] "DisplayMode" [] - ) - , ( "orientation" - , Type.namedWith [ "Pages", "Manifest" ] "Orientation" [] - ) - , ( "description", Type.string ) - , ( "iarcRatingId", Type.maybe Type.string ) - , ( "name", Type.string ) - , ( "themeColor" - , Type.maybe (Type.namedWith [ "Color" ] "Color" []) - ) - , ( "startUrl", Type.namedWith [ "UrlPath" ] "UrlPath" [] ) - , ( "shortName", Type.maybe Type.string ) - , ( "icons" - , Type.list - (Type.namedWith [ "Pages", "Manifest" ] "Icon" []) - ) - , ( "lang", Type.namedWith [ "LanguageTag" ] "LanguageTag" [] ) - , ( "otherFields" - , Type.namedWith - [ "Dict" ] - "Dict" - [ Type.string - , Type.namedWith [ "Json", "Encode" ] "Value" [] - ] - ) - ] - ) - , icon = - Type.alias - moduleName_ - "Icon" - [] - (Type.record - [ ( "src", Type.namedWith [ "Pages", "Url" ] "Url" [] ) - , ( "sizes", Type.list (Type.tuple Type.int Type.int) ) - , ( "mimeType" - , Type.maybe (Type.namedWith [ "MimeType" ] "MimeImage" []) - ) - , ( "purposes" - , Type.list - (Type.namedWith - [ "Pages", "Manifest" ] - "IconPurpose" - [] - ) - ) - ] - ) - , displayMode = Type.namedWith [ "Pages", "Manifest" ] "DisplayMode" [] - , orientation = Type.namedWith [ "Pages", "Manifest" ] "Orientation" [] - , iconPurpose = Type.namedWith [ "Pages", "Manifest" ] "IconPurpose" [] - } - - -make_ : - { config : - { backgroundColor : Elm.Expression - , categories : Elm.Expression - , displayMode : Elm.Expression - , orientation : Elm.Expression - , description : Elm.Expression - , iarcRatingId : Elm.Expression - , name : Elm.Expression - , themeColor : Elm.Expression - , startUrl : Elm.Expression - , shortName : Elm.Expression - , icons : Elm.Expression - , lang : Elm.Expression - , otherFields : Elm.Expression - } - -> Elm.Expression - , icon : - { src : Elm.Expression - , sizes : Elm.Expression - , mimeType : Elm.Expression - , purposes : Elm.Expression - } - -> Elm.Expression - , fullscreen : Elm.Expression - , standalone : Elm.Expression - , minimalUi : Elm.Expression - , browser : Elm.Expression - , any : Elm.Expression - , natural : Elm.Expression - , landscape : Elm.Expression - , landscapePrimary : Elm.Expression - , landscapeSecondary : Elm.Expression - , portrait : Elm.Expression - , portraitPrimary : Elm.Expression - , portraitSecondary : Elm.Expression - , iconPurposeMonochrome : Elm.Expression - , iconPurposeMaskable : Elm.Expression - , iconPurposeAny : Elm.Expression - } -make_ = - { config = - \config_args -> - Elm.withType - (Type.alias - [ "Pages", "Manifest" ] - "Config" - [] - (Type.record - [ ( "backgroundColor" - , Type.maybe (Type.namedWith [ "Color" ] "Color" []) - ) - , ( "categories" - , Type.list - (Type.namedWith - [ "Pages", "Manifest", "Category" ] - "Category" - [] - ) - ) - , ( "displayMode" - , Type.namedWith - [ "Pages", "Manifest" ] - "DisplayMode" - [] - ) - , ( "orientation" - , Type.namedWith - [ "Pages", "Manifest" ] - "Orientation" - [] - ) - , ( "description", Type.string ) - , ( "iarcRatingId", Type.maybe Type.string ) - , ( "name", Type.string ) - , ( "themeColor" - , Type.maybe (Type.namedWith [ "Color" ] "Color" []) - ) - , ( "startUrl" - , Type.namedWith [ "UrlPath" ] "UrlPath" [] - ) - , ( "shortName", Type.maybe Type.string ) - , ( "icons" - , Type.list - (Type.namedWith - [ "Pages", "Manifest" ] - "Icon" - [] - ) - ) - , ( "lang" - , Type.namedWith [ "LanguageTag" ] "LanguageTag" [] - ) - , ( "otherFields" - , Type.namedWith - [ "Dict" ] - "Dict" - [ Type.string - , Type.namedWith - [ "Json", "Encode" ] - "Value" - [] - ] - ) - ] - ) - ) - (Elm.record - [ Tuple.pair "backgroundColor" config_args.backgroundColor - , Tuple.pair "categories" config_args.categories - , Tuple.pair "displayMode" config_args.displayMode - , Tuple.pair "orientation" config_args.orientation - , Tuple.pair "description" config_args.description - , Tuple.pair "iarcRatingId" config_args.iarcRatingId - , Tuple.pair "name" config_args.name - , Tuple.pair "themeColor" config_args.themeColor - , Tuple.pair "startUrl" config_args.startUrl - , Tuple.pair "shortName" config_args.shortName - , Tuple.pair "icons" config_args.icons - , Tuple.pair "lang" config_args.lang - , Tuple.pair "otherFields" config_args.otherFields - ] - ) - , icon = - \icon_args -> - Elm.withType - (Type.alias - [ "Pages", "Manifest" ] - "Icon" - [] - (Type.record - [ ( "src" - , Type.namedWith [ "Pages", "Url" ] "Url" [] - ) - , ( "sizes" - , Type.list (Type.tuple Type.int Type.int) - ) - , ( "mimeType" - , Type.maybe - (Type.namedWith [ "MimeType" ] "MimeImage" []) - ) - , ( "purposes" - , Type.list - (Type.namedWith - [ "Pages", "Manifest" ] - "IconPurpose" - [] - ) - ) - ] - ) - ) - (Elm.record - [ Tuple.pair "src" icon_args.src - , Tuple.pair "sizes" icon_args.sizes - , Tuple.pair "mimeType" icon_args.mimeType - , Tuple.pair "purposes" icon_args.purposes - ] - ) - , fullscreen = - Elm.value - { importFrom = [ "Pages", "Manifest" ] - , name = "Fullscreen" - , annotation = Just (Type.namedWith [] "DisplayMode" []) - } - , standalone = - Elm.value - { importFrom = [ "Pages", "Manifest" ] - , name = "Standalone" - , annotation = Just (Type.namedWith [] "DisplayMode" []) - } - , minimalUi = - Elm.value - { importFrom = [ "Pages", "Manifest" ] - , name = "MinimalUi" - , annotation = Just (Type.namedWith [] "DisplayMode" []) - } - , browser = - Elm.value - { importFrom = [ "Pages", "Manifest" ] - , name = "Browser" - , annotation = Just (Type.namedWith [] "DisplayMode" []) - } - , any = - Elm.value - { importFrom = [ "Pages", "Manifest" ] - , name = "Any" - , annotation = Just (Type.namedWith [] "Orientation" []) - } - , natural = - Elm.value - { importFrom = [ "Pages", "Manifest" ] - , name = "Natural" - , annotation = Just (Type.namedWith [] "Orientation" []) - } - , landscape = - Elm.value - { importFrom = [ "Pages", "Manifest" ] - , name = "Landscape" - , annotation = Just (Type.namedWith [] "Orientation" []) - } - , landscapePrimary = - Elm.value - { importFrom = [ "Pages", "Manifest" ] - , name = "LandscapePrimary" - , annotation = Just (Type.namedWith [] "Orientation" []) - } - , landscapeSecondary = - Elm.value - { importFrom = [ "Pages", "Manifest" ] - , name = "LandscapeSecondary" - , annotation = Just (Type.namedWith [] "Orientation" []) - } - , portrait = - Elm.value - { importFrom = [ "Pages", "Manifest" ] - , name = "Portrait" - , annotation = Just (Type.namedWith [] "Orientation" []) - } - , portraitPrimary = - Elm.value - { importFrom = [ "Pages", "Manifest" ] - , name = "PortraitPrimary" - , annotation = Just (Type.namedWith [] "Orientation" []) - } - , portraitSecondary = - Elm.value - { importFrom = [ "Pages", "Manifest" ] - , name = "PortraitSecondary" - , annotation = Just (Type.namedWith [] "Orientation" []) - } - , iconPurposeMonochrome = - Elm.value - { importFrom = [ "Pages", "Manifest" ] - , name = "IconPurposeMonochrome" - , annotation = Just (Type.namedWith [] "IconPurpose" []) - } - , iconPurposeMaskable = - Elm.value - { importFrom = [ "Pages", "Manifest" ] - , name = "IconPurposeMaskable" - , annotation = Just (Type.namedWith [] "IconPurpose" []) - } - , iconPurposeAny = - Elm.value - { importFrom = [ "Pages", "Manifest" ] - , name = "IconPurposeAny" - , annotation = Just (Type.namedWith [] "IconPurpose" []) - } - } - - -caseOf_ : - { displayMode : - Elm.Expression - -> { fullscreen : Elm.Expression - , standalone : Elm.Expression - , minimalUi : Elm.Expression - , browser : Elm.Expression - } - -> Elm.Expression - , orientation : - Elm.Expression - -> { any : Elm.Expression - , natural : Elm.Expression - , landscape : Elm.Expression - , landscapePrimary : Elm.Expression - , landscapeSecondary : Elm.Expression - , portrait : Elm.Expression - , portraitPrimary : Elm.Expression - , portraitSecondary : Elm.Expression - } - -> Elm.Expression - , iconPurpose : - Elm.Expression - -> { iconPurposeMonochrome : Elm.Expression - , iconPurposeMaskable : Elm.Expression - , iconPurposeAny : Elm.Expression - } - -> Elm.Expression - } -caseOf_ = - { displayMode = - \displayModeExpression displayModeTags -> - Elm.Case.custom - displayModeExpression - (Type.namedWith [ "Pages", "Manifest" ] "DisplayMode" []) - [ Elm.Case.branch - (Elm.Arg.customType "Fullscreen" displayModeTags.fullscreen) - Basics.identity - , Elm.Case.branch - (Elm.Arg.customType "Standalone" displayModeTags.standalone) - Basics.identity - , Elm.Case.branch - (Elm.Arg.customType "MinimalUi" displayModeTags.minimalUi) - Basics.identity - , Elm.Case.branch - (Elm.Arg.customType "Browser" displayModeTags.browser) - Basics.identity - ] - , orientation = - \orientationExpression orientationTags -> - Elm.Case.custom - orientationExpression - (Type.namedWith [ "Pages", "Manifest" ] "Orientation" []) - [ Elm.Case.branch - (Elm.Arg.customType "Any" orientationTags.any) - Basics.identity - , Elm.Case.branch - (Elm.Arg.customType "Natural" orientationTags.natural) - Basics.identity - , Elm.Case.branch - (Elm.Arg.customType "Landscape" orientationTags.landscape) - Basics.identity - , Elm.Case.branch - (Elm.Arg.customType - "LandscapePrimary" - orientationTags.landscapePrimary - ) - Basics.identity - , Elm.Case.branch - (Elm.Arg.customType - "LandscapeSecondary" - orientationTags.landscapeSecondary - ) - Basics.identity - , Elm.Case.branch - (Elm.Arg.customType "Portrait" orientationTags.portrait) - Basics.identity - , Elm.Case.branch - (Elm.Arg.customType - "PortraitPrimary" - orientationTags.portraitPrimary - ) - Basics.identity - , Elm.Case.branch - (Elm.Arg.customType - "PortraitSecondary" - orientationTags.portraitSecondary - ) - Basics.identity - ] - , iconPurpose = - \iconPurposeExpression iconPurposeTags -> - Elm.Case.custom - iconPurposeExpression - (Type.namedWith [ "Pages", "Manifest" ] "IconPurpose" []) - [ Elm.Case.branch - (Elm.Arg.customType - "IconPurposeMonochrome" - iconPurposeTags.iconPurposeMonochrome - ) - Basics.identity - , Elm.Case.branch - (Elm.Arg.customType - "IconPurposeMaskable" - iconPurposeTags.iconPurposeMaskable - ) - Basics.identity - , Elm.Case.branch - (Elm.Arg.customType - "IconPurposeAny" - iconPurposeTags.iconPurposeAny - ) - Basics.identity - ] - } - - -call_ : - { init : Elm.Expression -> Elm.Expression - , withBackgroundColor : Elm.Expression -> Elm.Expression -> Elm.Expression - , withCategories : Elm.Expression -> Elm.Expression -> Elm.Expression - , withDisplayMode : Elm.Expression -> Elm.Expression -> Elm.Expression - , withIarcRatingId : Elm.Expression -> Elm.Expression -> Elm.Expression - , withLang : Elm.Expression -> Elm.Expression -> Elm.Expression - , withOrientation : Elm.Expression -> Elm.Expression -> Elm.Expression - , withShortName : Elm.Expression -> Elm.Expression -> Elm.Expression - , withThemeColor : Elm.Expression -> Elm.Expression -> Elm.Expression - , withField : - Elm.Expression -> Elm.Expression -> Elm.Expression -> Elm.Expression - , generator : Elm.Expression -> Elm.Expression -> Elm.Expression - , toJson : Elm.Expression -> Elm.Expression -> Elm.Expression - } -call_ = - { init = - \initArg_ -> - Elm.apply - (Elm.value - { importFrom = [ "Pages", "Manifest" ] - , name = "init" - , annotation = - Just - (Type.function - [ Type.record - [ ( "description", Type.string ) - , ( "name", Type.string ) - , ( "startUrl" - , Type.namedWith - [ "UrlPath" ] - "UrlPath" - [] - ) - , ( "icons" - , Type.list - (Type.namedWith - [ "Pages", "Manifest" ] - "Icon" - [] - ) - ) - ] - ] - (Type.namedWith - [ "Pages", "Manifest" ] - "Config" - [] - ) - ) - } - ) - [ initArg_ ] - , withBackgroundColor = - \withBackgroundColorArg_ withBackgroundColorArg_0 -> - Elm.apply - (Elm.value - { importFrom = [ "Pages", "Manifest" ] - , name = "withBackgroundColor" - , annotation = - Just - (Type.function - [ Type.namedWith [ "Color" ] "Color" [] - , Type.namedWith - [ "Pages", "Manifest" ] - "Config" - [] - ] - (Type.namedWith - [ "Pages", "Manifest" ] - "Config" - [] - ) - ) - } - ) - [ withBackgroundColorArg_, withBackgroundColorArg_0 ] - , withCategories = - \withCategoriesArg_ withCategoriesArg_0 -> - Elm.apply - (Elm.value - { importFrom = [ "Pages", "Manifest" ] - , name = "withCategories" - , annotation = - Just - (Type.function - [ Type.list - (Type.namedWith - [ "Pages", "Manifest", "Category" ] - "Category" - [] - ) - , Type.namedWith - [ "Pages", "Manifest" ] - "Config" - [] - ] - (Type.namedWith - [ "Pages", "Manifest" ] - "Config" - [] - ) - ) - } - ) - [ withCategoriesArg_, withCategoriesArg_0 ] - , withDisplayMode = - \withDisplayModeArg_ withDisplayModeArg_0 -> - Elm.apply - (Elm.value - { importFrom = [ "Pages", "Manifest" ] - , name = "withDisplayMode" - , annotation = - Just - (Type.function - [ Type.namedWith - [ "Pages", "Manifest" ] - "DisplayMode" - [] - , Type.namedWith - [ "Pages", "Manifest" ] - "Config" - [] - ] - (Type.namedWith - [ "Pages", "Manifest" ] - "Config" - [] - ) - ) - } - ) - [ withDisplayModeArg_, withDisplayModeArg_0 ] - , withIarcRatingId = - \withIarcRatingIdArg_ withIarcRatingIdArg_0 -> - Elm.apply - (Elm.value - { importFrom = [ "Pages", "Manifest" ] - , name = "withIarcRatingId" - , annotation = - Just - (Type.function - [ Type.string - , Type.namedWith - [ "Pages", "Manifest" ] - "Config" - [] - ] - (Type.namedWith - [ "Pages", "Manifest" ] - "Config" - [] - ) - ) - } - ) - [ withIarcRatingIdArg_, withIarcRatingIdArg_0 ] - , withLang = - \withLangArg_ withLangArg_0 -> - Elm.apply - (Elm.value - { importFrom = [ "Pages", "Manifest" ] - , name = "withLang" - , annotation = - Just - (Type.function - [ Type.namedWith - [ "LanguageTag" ] - "LanguageTag" - [] - , Type.namedWith - [ "Pages", "Manifest" ] - "Config" - [] - ] - (Type.namedWith - [ "Pages", "Manifest" ] - "Config" - [] - ) - ) - } - ) - [ withLangArg_, withLangArg_0 ] - , withOrientation = - \withOrientationArg_ withOrientationArg_0 -> - Elm.apply - (Elm.value - { importFrom = [ "Pages", "Manifest" ] - , name = "withOrientation" - , annotation = - Just - (Type.function - [ Type.namedWith - [ "Pages", "Manifest" ] - "Orientation" - [] - , Type.namedWith - [ "Pages", "Manifest" ] - "Config" - [] - ] - (Type.namedWith - [ "Pages", "Manifest" ] - "Config" - [] - ) - ) - } - ) - [ withOrientationArg_, withOrientationArg_0 ] - , withShortName = - \withShortNameArg_ withShortNameArg_0 -> - Elm.apply - (Elm.value - { importFrom = [ "Pages", "Manifest" ] - , name = "withShortName" - , annotation = - Just - (Type.function - [ Type.string - , Type.namedWith - [ "Pages", "Manifest" ] - "Config" - [] - ] - (Type.namedWith - [ "Pages", "Manifest" ] - "Config" - [] - ) - ) - } - ) - [ withShortNameArg_, withShortNameArg_0 ] - , withThemeColor = - \withThemeColorArg_ withThemeColorArg_0 -> - Elm.apply - (Elm.value - { importFrom = [ "Pages", "Manifest" ] - , name = "withThemeColor" - , annotation = - Just - (Type.function - [ Type.namedWith [ "Color" ] "Color" [] - , Type.namedWith - [ "Pages", "Manifest" ] - "Config" - [] - ] - (Type.namedWith - [ "Pages", "Manifest" ] - "Config" - [] - ) - ) - } - ) - [ withThemeColorArg_, withThemeColorArg_0 ] - , withField = - \withFieldArg_ withFieldArg_0 withFieldArg_1 -> - Elm.apply - (Elm.value - { importFrom = [ "Pages", "Manifest" ] - , name = "withField" - , annotation = - Just - (Type.function - [ Type.string - , Type.namedWith - [ "Json", "Encode" ] - "Value" - [] - , Type.namedWith - [ "Pages", "Manifest" ] - "Config" - [] - ] - (Type.namedWith - [ "Pages", "Manifest" ] - "Config" - [] - ) - ) - } - ) - [ withFieldArg_, withFieldArg_0, withFieldArg_1 ] - , generator = - \generatorArg_ generatorArg_0 -> - Elm.apply - (Elm.value - { importFrom = [ "Pages", "Manifest" ] - , name = "generator" - , annotation = - Just - (Type.function - [ Type.string - , Type.namedWith - [ "BackendTask" ] - "BackendTask" - [ Type.namedWith - [ "FatalError" ] - "FatalError" - [] - , Type.namedWith - [ "Pages", "Manifest" ] - "Config" - [] - ] - ] - (Type.namedWith - [ "ApiRoute" ] - "ApiRoute" - [ Type.namedWith - [ "ApiRoute" ] - "Response" - [] - ] - ) - ) - } - ) - [ generatorArg_, generatorArg_0 ] - , toJson = - \toJsonArg_ toJsonArg_0 -> - Elm.apply - (Elm.value - { importFrom = [ "Pages", "Manifest" ] - , name = "toJson" - , annotation = - Just - (Type.function - [ Type.string - , Type.namedWith - [ "Pages", "Manifest" ] - "Config" - [] - ] - (Type.namedWith - [ "Json", "Encode" ] - "Value" - [] - ) - ) - } - ) - [ toJsonArg_, toJsonArg_0 ] - } - - -values_ : - { init : Elm.Expression - , withBackgroundColor : Elm.Expression - , withCategories : Elm.Expression - , withDisplayMode : Elm.Expression - , withIarcRatingId : Elm.Expression - , withLang : Elm.Expression - , withOrientation : Elm.Expression - , withShortName : Elm.Expression - , withThemeColor : Elm.Expression - , withField : Elm.Expression - , generator : Elm.Expression - , toJson : Elm.Expression - } -values_ = - { init = - Elm.value - { importFrom = [ "Pages", "Manifest" ] - , name = "init" - , annotation = - Just - (Type.function - [ Type.record - [ ( "description", Type.string ) - , ( "name", Type.string ) - , ( "startUrl" - , Type.namedWith [ "UrlPath" ] "UrlPath" [] - ) - , ( "icons" - , Type.list - (Type.namedWith - [ "Pages", "Manifest" ] - "Icon" - [] - ) - ) - ] - ] - (Type.namedWith [ "Pages", "Manifest" ] "Config" []) - ) - } - , withBackgroundColor = - Elm.value - { importFrom = [ "Pages", "Manifest" ] - , name = "withBackgroundColor" - , annotation = - Just - (Type.function - [ Type.namedWith [ "Color" ] "Color" [] - , Type.namedWith [ "Pages", "Manifest" ] "Config" [] - ] - (Type.namedWith [ "Pages", "Manifest" ] "Config" []) - ) - } - , withCategories = - Elm.value - { importFrom = [ "Pages", "Manifest" ] - , name = "withCategories" - , annotation = - Just - (Type.function - [ Type.list - (Type.namedWith - [ "Pages", "Manifest", "Category" ] - "Category" - [] - ) - , Type.namedWith [ "Pages", "Manifest" ] "Config" [] - ] - (Type.namedWith [ "Pages", "Manifest" ] "Config" []) - ) - } - , withDisplayMode = - Elm.value - { importFrom = [ "Pages", "Manifest" ] - , name = "withDisplayMode" - , annotation = - Just - (Type.function - [ Type.namedWith - [ "Pages", "Manifest" ] - "DisplayMode" - [] - , Type.namedWith [ "Pages", "Manifest" ] "Config" [] - ] - (Type.namedWith [ "Pages", "Manifest" ] "Config" []) - ) - } - , withIarcRatingId = - Elm.value - { importFrom = [ "Pages", "Manifest" ] - , name = "withIarcRatingId" - , annotation = - Just - (Type.function - [ Type.string - , Type.namedWith [ "Pages", "Manifest" ] "Config" [] - ] - (Type.namedWith [ "Pages", "Manifest" ] "Config" []) - ) - } - , withLang = - Elm.value - { importFrom = [ "Pages", "Manifest" ] - , name = "withLang" - , annotation = - Just - (Type.function - [ Type.namedWith [ "LanguageTag" ] "LanguageTag" [] - , Type.namedWith [ "Pages", "Manifest" ] "Config" [] - ] - (Type.namedWith [ "Pages", "Manifest" ] "Config" []) - ) - } - , withOrientation = - Elm.value - { importFrom = [ "Pages", "Manifest" ] - , name = "withOrientation" - , annotation = - Just - (Type.function - [ Type.namedWith - [ "Pages", "Manifest" ] - "Orientation" - [] - , Type.namedWith [ "Pages", "Manifest" ] "Config" [] - ] - (Type.namedWith [ "Pages", "Manifest" ] "Config" []) - ) - } - , withShortName = - Elm.value - { importFrom = [ "Pages", "Manifest" ] - , name = "withShortName" - , annotation = - Just - (Type.function - [ Type.string - , Type.namedWith [ "Pages", "Manifest" ] "Config" [] - ] - (Type.namedWith [ "Pages", "Manifest" ] "Config" []) - ) - } - , withThemeColor = - Elm.value - { importFrom = [ "Pages", "Manifest" ] - , name = "withThemeColor" - , annotation = - Just - (Type.function - [ Type.namedWith [ "Color" ] "Color" [] - , Type.namedWith [ "Pages", "Manifest" ] "Config" [] - ] - (Type.namedWith [ "Pages", "Manifest" ] "Config" []) - ) - } - , withField = - Elm.value - { importFrom = [ "Pages", "Manifest" ] - , name = "withField" - , annotation = - Just - (Type.function - [ Type.string - , Type.namedWith [ "Json", "Encode" ] "Value" [] - , Type.namedWith [ "Pages", "Manifest" ] "Config" [] - ] - (Type.namedWith [ "Pages", "Manifest" ] "Config" []) - ) - } - , generator = - Elm.value - { importFrom = [ "Pages", "Manifest" ] - , name = "generator" - , annotation = - Just - (Type.function - [ Type.string - , Type.namedWith - [ "BackendTask" ] - "BackendTask" - [ Type.namedWith [ "FatalError" ] "FatalError" [] - , Type.namedWith - [ "Pages", "Manifest" ] - "Config" - [] - ] - ] - (Type.namedWith - [ "ApiRoute" ] - "ApiRoute" - [ Type.namedWith [ "ApiRoute" ] "Response" [] ] - ) - ) - } - , toJson = - Elm.value - { importFrom = [ "Pages", "Manifest" ] - , name = "toJson" - , annotation = - Just - (Type.function - [ Type.string - , Type.namedWith [ "Pages", "Manifest" ] "Config" [] - ] - (Type.namedWith [ "Json", "Encode" ] "Value" []) - ) - } - } \ No newline at end of file diff --git a/elm-open-api-codegen/src/Gen/Pages/Manifest/Category.elm b/elm-open-api-codegen/src/Gen/Pages/Manifest/Category.elm deleted file mode 100644 index d67f57cd..00000000 --- a/elm-open-api-codegen/src/Gen/Pages/Manifest/Category.elm +++ /dev/null @@ -1,1068 +0,0 @@ -module Gen.Pages.Manifest.Category exposing - ( moduleName_, toString, books, business, education, entertainment - , finance, fitness, food, games, government, health, kids - , lifestyle, magazines, medical, music, navigation, news, personalization - , photo, politics, productivity, security, shopping, social, sports - , travel, utilities, weather, custom, annotation_, call_, values_ - ) - -{-| -# Generated bindings for Pages.Manifest.Category - -@docs moduleName_, toString, books, business, education, entertainment -@docs finance, fitness, food, games, government, health -@docs kids, lifestyle, magazines, medical, music, navigation -@docs news, personalization, photo, politics, productivity, security -@docs shopping, social, sports, travel, utilities, weather -@docs custom, annotation_, call_, values_ --} - - -import Elm -import Elm.Annotation as Type - - -{-| The name of this module. -} -moduleName_ : List String -moduleName_ = - [ "Pages", "Manifest", "Category" ] - - -{-| Turn a category into its official String representation, as seen -here: . - -toString: Pages.Manifest.Category.Category -> String --} -toString : Elm.Expression -> Elm.Expression -toString toStringArg_ = - Elm.apply - (Elm.value - { importFrom = [ "Pages", "Manifest", "Category" ] - , name = "toString" - , annotation = - Just - (Type.function - [ Type.namedWith - [ "Pages", "Manifest", "Category" ] - "Category" - [] - ] - Type.string - ) - } - ) - [ toStringArg_ ] - - -{-| Creates the described category. - -books: Pages.Manifest.Category.Category --} -books : Elm.Expression -books = - Elm.value - { importFrom = [ "Pages", "Manifest", "Category" ] - , name = "books" - , annotation = - Just - (Type.namedWith - [ "Pages", "Manifest", "Category" ] - "Category" - [] - ) - } - - -{-| Creates the described category. - -business: Pages.Manifest.Category.Category --} -business : Elm.Expression -business = - Elm.value - { importFrom = [ "Pages", "Manifest", "Category" ] - , name = "business" - , annotation = - Just - (Type.namedWith - [ "Pages", "Manifest", "Category" ] - "Category" - [] - ) - } - - -{-| Creates the described category. - -education: Pages.Manifest.Category.Category --} -education : Elm.Expression -education = - Elm.value - { importFrom = [ "Pages", "Manifest", "Category" ] - , name = "education" - , annotation = - Just - (Type.namedWith - [ "Pages", "Manifest", "Category" ] - "Category" - [] - ) - } - - -{-| Creates the described category. - -entertainment: Pages.Manifest.Category.Category --} -entertainment : Elm.Expression -entertainment = - Elm.value - { importFrom = [ "Pages", "Manifest", "Category" ] - , name = "entertainment" - , annotation = - Just - (Type.namedWith - [ "Pages", "Manifest", "Category" ] - "Category" - [] - ) - } - - -{-| Creates the described category. - -finance: Pages.Manifest.Category.Category --} -finance : Elm.Expression -finance = - Elm.value - { importFrom = [ "Pages", "Manifest", "Category" ] - , name = "finance" - , annotation = - Just - (Type.namedWith - [ "Pages", "Manifest", "Category" ] - "Category" - [] - ) - } - - -{-| Creates the described category. - -fitness: Pages.Manifest.Category.Category --} -fitness : Elm.Expression -fitness = - Elm.value - { importFrom = [ "Pages", "Manifest", "Category" ] - , name = "fitness" - , annotation = - Just - (Type.namedWith - [ "Pages", "Manifest", "Category" ] - "Category" - [] - ) - } - - -{-| Creates the described category. - -food: Pages.Manifest.Category.Category --} -food : Elm.Expression -food = - Elm.value - { importFrom = [ "Pages", "Manifest", "Category" ] - , name = "food" - , annotation = - Just - (Type.namedWith - [ "Pages", "Manifest", "Category" ] - "Category" - [] - ) - } - - -{-| Creates the described category. - -games: Pages.Manifest.Category.Category --} -games : Elm.Expression -games = - Elm.value - { importFrom = [ "Pages", "Manifest", "Category" ] - , name = "games" - , annotation = - Just - (Type.namedWith - [ "Pages", "Manifest", "Category" ] - "Category" - [] - ) - } - - -{-| Creates the described category. - -government: Pages.Manifest.Category.Category --} -government : Elm.Expression -government = - Elm.value - { importFrom = [ "Pages", "Manifest", "Category" ] - , name = "government" - , annotation = - Just - (Type.namedWith - [ "Pages", "Manifest", "Category" ] - "Category" - [] - ) - } - - -{-| Creates the described category. - -health: Pages.Manifest.Category.Category --} -health : Elm.Expression -health = - Elm.value - { importFrom = [ "Pages", "Manifest", "Category" ] - , name = "health" - , annotation = - Just - (Type.namedWith - [ "Pages", "Manifest", "Category" ] - "Category" - [] - ) - } - - -{-| Creates the described category. - -kids: Pages.Manifest.Category.Category --} -kids : Elm.Expression -kids = - Elm.value - { importFrom = [ "Pages", "Manifest", "Category" ] - , name = "kids" - , annotation = - Just - (Type.namedWith - [ "Pages", "Manifest", "Category" ] - "Category" - [] - ) - } - - -{-| Creates the described category. - -lifestyle: Pages.Manifest.Category.Category --} -lifestyle : Elm.Expression -lifestyle = - Elm.value - { importFrom = [ "Pages", "Manifest", "Category" ] - , name = "lifestyle" - , annotation = - Just - (Type.namedWith - [ "Pages", "Manifest", "Category" ] - "Category" - [] - ) - } - - -{-| Creates the described category. - -magazines: Pages.Manifest.Category.Category --} -magazines : Elm.Expression -magazines = - Elm.value - { importFrom = [ "Pages", "Manifest", "Category" ] - , name = "magazines" - , annotation = - Just - (Type.namedWith - [ "Pages", "Manifest", "Category" ] - "Category" - [] - ) - } - - -{-| Creates the described category. - -medical: Pages.Manifest.Category.Category --} -medical : Elm.Expression -medical = - Elm.value - { importFrom = [ "Pages", "Manifest", "Category" ] - , name = "medical" - , annotation = - Just - (Type.namedWith - [ "Pages", "Manifest", "Category" ] - "Category" - [] - ) - } - - -{-| Creates the described category. - -music: Pages.Manifest.Category.Category --} -music : Elm.Expression -music = - Elm.value - { importFrom = [ "Pages", "Manifest", "Category" ] - , name = "music" - , annotation = - Just - (Type.namedWith - [ "Pages", "Manifest", "Category" ] - "Category" - [] - ) - } - - -{-| Creates the described category. - -navigation: Pages.Manifest.Category.Category --} -navigation : Elm.Expression -navigation = - Elm.value - { importFrom = [ "Pages", "Manifest", "Category" ] - , name = "navigation" - , annotation = - Just - (Type.namedWith - [ "Pages", "Manifest", "Category" ] - "Category" - [] - ) - } - - -{-| Creates the described category. - -news: Pages.Manifest.Category.Category --} -news : Elm.Expression -news = - Elm.value - { importFrom = [ "Pages", "Manifest", "Category" ] - , name = "news" - , annotation = - Just - (Type.namedWith - [ "Pages", "Manifest", "Category" ] - "Category" - [] - ) - } - - -{-| Creates the described category. - -personalization: Pages.Manifest.Category.Category --} -personalization : Elm.Expression -personalization = - Elm.value - { importFrom = [ "Pages", "Manifest", "Category" ] - , name = "personalization" - , annotation = - Just - (Type.namedWith - [ "Pages", "Manifest", "Category" ] - "Category" - [] - ) - } - - -{-| Creates the described category. - -photo: Pages.Manifest.Category.Category --} -photo : Elm.Expression -photo = - Elm.value - { importFrom = [ "Pages", "Manifest", "Category" ] - , name = "photo" - , annotation = - Just - (Type.namedWith - [ "Pages", "Manifest", "Category" ] - "Category" - [] - ) - } - - -{-| Creates the described category. - -politics: Pages.Manifest.Category.Category --} -politics : Elm.Expression -politics = - Elm.value - { importFrom = [ "Pages", "Manifest", "Category" ] - , name = "politics" - , annotation = - Just - (Type.namedWith - [ "Pages", "Manifest", "Category" ] - "Category" - [] - ) - } - - -{-| Creates the described category. - -productivity: Pages.Manifest.Category.Category --} -productivity : Elm.Expression -productivity = - Elm.value - { importFrom = [ "Pages", "Manifest", "Category" ] - , name = "productivity" - , annotation = - Just - (Type.namedWith - [ "Pages", "Manifest", "Category" ] - "Category" - [] - ) - } - - -{-| Creates the described category. - -security: Pages.Manifest.Category.Category --} -security : Elm.Expression -security = - Elm.value - { importFrom = [ "Pages", "Manifest", "Category" ] - , name = "security" - , annotation = - Just - (Type.namedWith - [ "Pages", "Manifest", "Category" ] - "Category" - [] - ) - } - - -{-| Creates the described category. - -shopping: Pages.Manifest.Category.Category --} -shopping : Elm.Expression -shopping = - Elm.value - { importFrom = [ "Pages", "Manifest", "Category" ] - , name = "shopping" - , annotation = - Just - (Type.namedWith - [ "Pages", "Manifest", "Category" ] - "Category" - [] - ) - } - - -{-| Creates the described category. - -social: Pages.Manifest.Category.Category --} -social : Elm.Expression -social = - Elm.value - { importFrom = [ "Pages", "Manifest", "Category" ] - , name = "social" - , annotation = - Just - (Type.namedWith - [ "Pages", "Manifest", "Category" ] - "Category" - [] - ) - } - - -{-| Creates the described category. - -sports: Pages.Manifest.Category.Category --} -sports : Elm.Expression -sports = - Elm.value - { importFrom = [ "Pages", "Manifest", "Category" ] - , name = "sports" - , annotation = - Just - (Type.namedWith - [ "Pages", "Manifest", "Category" ] - "Category" - [] - ) - } - - -{-| Creates the described category. - -travel: Pages.Manifest.Category.Category --} -travel : Elm.Expression -travel = - Elm.value - { importFrom = [ "Pages", "Manifest", "Category" ] - , name = "travel" - , annotation = - Just - (Type.namedWith - [ "Pages", "Manifest", "Category" ] - "Category" - [] - ) - } - - -{-| Creates the described category. - -utilities: Pages.Manifest.Category.Category --} -utilities : Elm.Expression -utilities = - Elm.value - { importFrom = [ "Pages", "Manifest", "Category" ] - , name = "utilities" - , annotation = - Just - (Type.namedWith - [ "Pages", "Manifest", "Category" ] - "Category" - [] - ) - } - - -{-| Creates the described category. - -weather: Pages.Manifest.Category.Category --} -weather : Elm.Expression -weather = - Elm.value - { importFrom = [ "Pages", "Manifest", "Category" ] - , name = "weather" - , annotation = - Just - (Type.namedWith - [ "Pages", "Manifest", "Category" ] - "Category" - [] - ) - } - - -{-| It's best to use the pre-defined categories to ensure that clients (Android, iOS, -Chrome, Windows app store, etc.) are aware of it and can handle it appropriately. -But, if you're confident about using a custom one, you can do so with `Pages.Manifest.custom`. - -custom: String -> Pages.Manifest.Category.Category --} -custom : String -> Elm.Expression -custom customArg_ = - Elm.apply - (Elm.value - { importFrom = [ "Pages", "Manifest", "Category" ] - , name = "custom" - , annotation = - Just - (Type.function - [ Type.string ] - (Type.namedWith - [ "Pages", "Manifest", "Category" ] - "Category" - [] - ) - ) - } - ) - [ Elm.string customArg_ ] - - -annotation_ : { category : Type.Annotation } -annotation_ = - { category = - Type.namedWith [ "Pages", "Manifest", "Category" ] "Category" [] - } - - -call_ : - { toString : Elm.Expression -> Elm.Expression - , custom : Elm.Expression -> Elm.Expression - } -call_ = - { toString = - \toStringArg_ -> - Elm.apply - (Elm.value - { importFrom = [ "Pages", "Manifest", "Category" ] - , name = "toString" - , annotation = - Just - (Type.function - [ Type.namedWith - [ "Pages", "Manifest", "Category" ] - "Category" - [] - ] - Type.string - ) - } - ) - [ toStringArg_ ] - , custom = - \customArg_ -> - Elm.apply - (Elm.value - { importFrom = [ "Pages", "Manifest", "Category" ] - , name = "custom" - , annotation = - Just - (Type.function - [ Type.string ] - (Type.namedWith - [ "Pages", "Manifest", "Category" ] - "Category" - [] - ) - ) - } - ) - [ customArg_ ] - } - - -values_ : - { toString : Elm.Expression - , books : Elm.Expression - , business : Elm.Expression - , education : Elm.Expression - , entertainment : Elm.Expression - , finance : Elm.Expression - , fitness : Elm.Expression - , food : Elm.Expression - , games : Elm.Expression - , government : Elm.Expression - , health : Elm.Expression - , kids : Elm.Expression - , lifestyle : Elm.Expression - , magazines : Elm.Expression - , medical : Elm.Expression - , music : Elm.Expression - , navigation : Elm.Expression - , news : Elm.Expression - , personalization : Elm.Expression - , photo : Elm.Expression - , politics : Elm.Expression - , productivity : Elm.Expression - , security : Elm.Expression - , shopping : Elm.Expression - , social : Elm.Expression - , sports : Elm.Expression - , travel : Elm.Expression - , utilities : Elm.Expression - , weather : Elm.Expression - , custom : Elm.Expression - } -values_ = - { toString = - Elm.value - { importFrom = [ "Pages", "Manifest", "Category" ] - , name = "toString" - , annotation = - Just - (Type.function - [ Type.namedWith - [ "Pages", "Manifest", "Category" ] - "Category" - [] - ] - Type.string - ) - } - , books = - Elm.value - { importFrom = [ "Pages", "Manifest", "Category" ] - , name = "books" - , annotation = - Just - (Type.namedWith - [ "Pages", "Manifest", "Category" ] - "Category" - [] - ) - } - , business = - Elm.value - { importFrom = [ "Pages", "Manifest", "Category" ] - , name = "business" - , annotation = - Just - (Type.namedWith - [ "Pages", "Manifest", "Category" ] - "Category" - [] - ) - } - , education = - Elm.value - { importFrom = [ "Pages", "Manifest", "Category" ] - , name = "education" - , annotation = - Just - (Type.namedWith - [ "Pages", "Manifest", "Category" ] - "Category" - [] - ) - } - , entertainment = - Elm.value - { importFrom = [ "Pages", "Manifest", "Category" ] - , name = "entertainment" - , annotation = - Just - (Type.namedWith - [ "Pages", "Manifest", "Category" ] - "Category" - [] - ) - } - , finance = - Elm.value - { importFrom = [ "Pages", "Manifest", "Category" ] - , name = "finance" - , annotation = - Just - (Type.namedWith - [ "Pages", "Manifest", "Category" ] - "Category" - [] - ) - } - , fitness = - Elm.value - { importFrom = [ "Pages", "Manifest", "Category" ] - , name = "fitness" - , annotation = - Just - (Type.namedWith - [ "Pages", "Manifest", "Category" ] - "Category" - [] - ) - } - , food = - Elm.value - { importFrom = [ "Pages", "Manifest", "Category" ] - , name = "food" - , annotation = - Just - (Type.namedWith - [ "Pages", "Manifest", "Category" ] - "Category" - [] - ) - } - , games = - Elm.value - { importFrom = [ "Pages", "Manifest", "Category" ] - , name = "games" - , annotation = - Just - (Type.namedWith - [ "Pages", "Manifest", "Category" ] - "Category" - [] - ) - } - , government = - Elm.value - { importFrom = [ "Pages", "Manifest", "Category" ] - , name = "government" - , annotation = - Just - (Type.namedWith - [ "Pages", "Manifest", "Category" ] - "Category" - [] - ) - } - , health = - Elm.value - { importFrom = [ "Pages", "Manifest", "Category" ] - , name = "health" - , annotation = - Just - (Type.namedWith - [ "Pages", "Manifest", "Category" ] - "Category" - [] - ) - } - , kids = - Elm.value - { importFrom = [ "Pages", "Manifest", "Category" ] - , name = "kids" - , annotation = - Just - (Type.namedWith - [ "Pages", "Manifest", "Category" ] - "Category" - [] - ) - } - , lifestyle = - Elm.value - { importFrom = [ "Pages", "Manifest", "Category" ] - , name = "lifestyle" - , annotation = - Just - (Type.namedWith - [ "Pages", "Manifest", "Category" ] - "Category" - [] - ) - } - , magazines = - Elm.value - { importFrom = [ "Pages", "Manifest", "Category" ] - , name = "magazines" - , annotation = - Just - (Type.namedWith - [ "Pages", "Manifest", "Category" ] - "Category" - [] - ) - } - , medical = - Elm.value - { importFrom = [ "Pages", "Manifest", "Category" ] - , name = "medical" - , annotation = - Just - (Type.namedWith - [ "Pages", "Manifest", "Category" ] - "Category" - [] - ) - } - , music = - Elm.value - { importFrom = [ "Pages", "Manifest", "Category" ] - , name = "music" - , annotation = - Just - (Type.namedWith - [ "Pages", "Manifest", "Category" ] - "Category" - [] - ) - } - , navigation = - Elm.value - { importFrom = [ "Pages", "Manifest", "Category" ] - , name = "navigation" - , annotation = - Just - (Type.namedWith - [ "Pages", "Manifest", "Category" ] - "Category" - [] - ) - } - , news = - Elm.value - { importFrom = [ "Pages", "Manifest", "Category" ] - , name = "news" - , annotation = - Just - (Type.namedWith - [ "Pages", "Manifest", "Category" ] - "Category" - [] - ) - } - , personalization = - Elm.value - { importFrom = [ "Pages", "Manifest", "Category" ] - , name = "personalization" - , annotation = - Just - (Type.namedWith - [ "Pages", "Manifest", "Category" ] - "Category" - [] - ) - } - , photo = - Elm.value - { importFrom = [ "Pages", "Manifest", "Category" ] - , name = "photo" - , annotation = - Just - (Type.namedWith - [ "Pages", "Manifest", "Category" ] - "Category" - [] - ) - } - , politics = - Elm.value - { importFrom = [ "Pages", "Manifest", "Category" ] - , name = "politics" - , annotation = - Just - (Type.namedWith - [ "Pages", "Manifest", "Category" ] - "Category" - [] - ) - } - , productivity = - Elm.value - { importFrom = [ "Pages", "Manifest", "Category" ] - , name = "productivity" - , annotation = - Just - (Type.namedWith - [ "Pages", "Manifest", "Category" ] - "Category" - [] - ) - } - , security = - Elm.value - { importFrom = [ "Pages", "Manifest", "Category" ] - , name = "security" - , annotation = - Just - (Type.namedWith - [ "Pages", "Manifest", "Category" ] - "Category" - [] - ) - } - , shopping = - Elm.value - { importFrom = [ "Pages", "Manifest", "Category" ] - , name = "shopping" - , annotation = - Just - (Type.namedWith - [ "Pages", "Manifest", "Category" ] - "Category" - [] - ) - } - , social = - Elm.value - { importFrom = [ "Pages", "Manifest", "Category" ] - , name = "social" - , annotation = - Just - (Type.namedWith - [ "Pages", "Manifest", "Category" ] - "Category" - [] - ) - } - , sports = - Elm.value - { importFrom = [ "Pages", "Manifest", "Category" ] - , name = "sports" - , annotation = - Just - (Type.namedWith - [ "Pages", "Manifest", "Category" ] - "Category" - [] - ) - } - , travel = - Elm.value - { importFrom = [ "Pages", "Manifest", "Category" ] - , name = "travel" - , annotation = - Just - (Type.namedWith - [ "Pages", "Manifest", "Category" ] - "Category" - [] - ) - } - , utilities = - Elm.value - { importFrom = [ "Pages", "Manifest", "Category" ] - , name = "utilities" - , annotation = - Just - (Type.namedWith - [ "Pages", "Manifest", "Category" ] - "Category" - [] - ) - } - , weather = - Elm.value - { importFrom = [ "Pages", "Manifest", "Category" ] - , name = "weather" - , annotation = - Just - (Type.namedWith - [ "Pages", "Manifest", "Category" ] - "Category" - [] - ) - } - , custom = - Elm.value - { importFrom = [ "Pages", "Manifest", "Category" ] - , name = "custom" - , annotation = - Just - (Type.function - [ Type.string ] - (Type.namedWith - [ "Pages", "Manifest", "Category" ] - "Category" - [] - ) - ) - } - } \ No newline at end of file diff --git a/elm-open-api-codegen/src/Gen/Pages/Navigation.elm b/elm-open-api-codegen/src/Gen/Pages/Navigation.elm deleted file mode 100644 index 3828e233..00000000 --- a/elm-open-api-codegen/src/Gen/Pages/Navigation.elm +++ /dev/null @@ -1,194 +0,0 @@ -module Gen.Pages.Navigation exposing ( moduleName_, annotation_, make_, caseOf_ ) - -{-| -# Generated bindings for Pages.Navigation - -@docs moduleName_, annotation_, make_, caseOf_ --} - - -import Elm -import Elm.Annotation as Type -import Elm.Arg -import Elm.Case - - -{-| The name of this module. -} -moduleName_ : List String -moduleName_ = - [ "Pages", "Navigation" ] - - -annotation_ : { navigation : Type.Annotation, loadingState : Type.Annotation } -annotation_ = - { navigation = Type.namedWith [ "Pages", "Navigation" ] "Navigation" [] - , loadingState = Type.namedWith [ "Pages", "Navigation" ] "LoadingState" [] - } - - -make_ : - { submitting : Elm.Expression -> Elm.Expression - , loadAfterSubmit : - Elm.Expression -> Elm.Expression -> Elm.Expression -> Elm.Expression - , loading : Elm.Expression -> Elm.Expression -> Elm.Expression - , redirecting : Elm.Expression - , load : Elm.Expression - , actionRedirect : Elm.Expression - } -make_ = - { submitting = - \ar0 -> - Elm.apply - (Elm.value - { importFrom = [ "Pages", "Navigation" ] - , name = "Submitting" - , annotation = Just (Type.namedWith [] "Navigation" []) - } - ) - [ ar0 ] - , loadAfterSubmit = - \ar0 ar1 ar2 -> - Elm.apply - (Elm.value - { importFrom = [ "Pages", "Navigation" ] - , name = "LoadAfterSubmit" - , annotation = Just (Type.namedWith [] "Navigation" []) - } - ) - [ ar0, ar1, ar2 ] - , loading = - \ar0 ar1 -> - Elm.apply - (Elm.value - { importFrom = [ "Pages", "Navigation" ] - , name = "Loading" - , annotation = Just (Type.namedWith [] "Navigation" []) - } - ) - [ ar0, ar1 ] - , redirecting = - Elm.value - { importFrom = [ "Pages", "Navigation" ] - , name = "Redirecting" - , annotation = Just (Type.namedWith [] "LoadingState" []) - } - , load = - Elm.value - { importFrom = [ "Pages", "Navigation" ] - , name = "Load" - , annotation = Just (Type.namedWith [] "LoadingState" []) - } - , actionRedirect = - Elm.value - { importFrom = [ "Pages", "Navigation" ] - , name = "ActionRedirect" - , annotation = Just (Type.namedWith [] "LoadingState" []) - } - } - - -caseOf_ = - { navigation = - \navigationExpression navigationTags -> - Elm.Case.custom - navigationExpression - (Type.namedWith [ "Pages", "Navigation" ] "Navigation" []) - [ Elm.Case.branch - (Elm.Arg.customType - "Submitting" - navigationTags.submitting |> Elm.Arg.item - (Elm.Arg.varWith - "pagesFormDataFormData" - (Type.namedWith - [ "Pages" - , "FormData" - ] - "FormData" - [] - ) - ) - ) - Basics.identity - , Elm.Case.branch - (Elm.Arg.customType - "LoadAfterSubmit" - navigationTags.loadAfterSubmit |> Elm.Arg.item - (Elm.Arg.varWith - "pagesFormDataFormData" - (Type.namedWith - [ "Pages" - , "FormData" - ] - "FormData" - [] - ) - ) |> Elm.Arg.item - (Elm.Arg.varWith - "urlPathUrlPath" - (Type.namedWith - [ "UrlPath" - ] - "UrlPath" - [] - ) - ) |> Elm.Arg.item - (Elm.Arg.varWith - "pagesNavigationLoadingState" - (Type.namedWith - [ "Pages" - , "Navigation" - ] - "LoadingState" - [] - ) - ) - ) - Basics.identity - , Elm.Case.branch - (Elm.Arg.customType - "Loading" - navigationTags.loading |> Elm.Arg.item - (Elm.Arg.varWith - "urlPathUrlPath" - (Type.namedWith - [ "UrlPath" - ] - "UrlPath" - [] - ) - ) |> Elm.Arg.item - (Elm.Arg.varWith - "pagesNavigationLoadingState" - (Type.namedWith - [ "Pages" - , "Navigation" - ] - "LoadingState" - [] - ) - ) - ) - Basics.identity - ] - , loadingState = - \loadingStateExpression loadingStateTags -> - Elm.Case.custom - loadingStateExpression - (Type.namedWith [ "Pages", "Navigation" ] "LoadingState" []) - [ Elm.Case.branch - (Elm.Arg.customType - "Redirecting" - loadingStateTags.redirecting - ) - Basics.identity - , Elm.Case.branch - (Elm.Arg.customType "Load" loadingStateTags.load) - Basics.identity - , Elm.Case.branch - (Elm.Arg.customType - "ActionRedirect" - loadingStateTags.actionRedirect - ) - Basics.identity - ] - } \ No newline at end of file diff --git a/elm-open-api-codegen/src/Gen/Pages/PageUrl.elm b/elm-open-api-codegen/src/Gen/Pages/PageUrl.elm deleted file mode 100644 index 56107042..00000000 --- a/elm-open-api-codegen/src/Gen/Pages/PageUrl.elm +++ /dev/null @@ -1,212 +0,0 @@ -module Gen.Pages.PageUrl exposing - ( moduleName_, toUrl, parseQueryParams, annotation_, make_, call_ - , values_ - ) - -{-| -# Generated bindings for Pages.PageUrl - -@docs moduleName_, toUrl, parseQueryParams, annotation_, make_, call_ -@docs values_ --} - - -import Elm -import Elm.Annotation as Type - - -{-| The name of this module. -} -moduleName_ : List String -moduleName_ = - [ "Pages", "PageUrl" ] - - -{-| toUrl: Pages.PageUrl.PageUrl -> Url.Url -} -toUrl : Elm.Expression -> Elm.Expression -toUrl toUrlArg_ = - Elm.apply - (Elm.value - { importFrom = [ "Pages", "PageUrl" ] - , name = "toUrl" - , annotation = - Just - (Type.function - [ Type.namedWith [ "Pages", "PageUrl" ] "PageUrl" [] ] - (Type.namedWith [ "Url" ] "Url" []) - ) - } - ) - [ toUrlArg_ ] - - -{-| parseQueryParams: String -> Dict.Dict String (List String) -} -parseQueryParams : String -> Elm.Expression -parseQueryParams parseQueryParamsArg_ = - Elm.apply - (Elm.value - { importFrom = [ "Pages", "PageUrl" ] - , name = "parseQueryParams" - , annotation = - Just - (Type.function - [ Type.string ] - (Type.namedWith - [ "Dict" ] - "Dict" - [ Type.string, Type.list Type.string ] - ) - ) - } - ) - [ Elm.string parseQueryParamsArg_ ] - - -annotation_ : { pageUrl : Type.Annotation } -annotation_ = - { pageUrl = - Type.alias - moduleName_ - "PageUrl" - [] - (Type.record - [ ( "protocol", Type.namedWith [ "Url" ] "Protocol" [] ) - , ( "host", Type.string ) - , ( "port_", Type.maybe Type.int ) - , ( "path", Type.namedWith [ "UrlPath" ] "UrlPath" [] ) - , ( "query" - , Type.namedWith - [ "Dict" ] - "Dict" - [ Type.string, Type.list Type.string ] - ) - , ( "fragment", Type.maybe Type.string ) - ] - ) - } - - -make_ : - { pageUrl : - { protocol : Elm.Expression - , host : Elm.Expression - , port_ : Elm.Expression - , path : Elm.Expression - , query : Elm.Expression - , fragment : Elm.Expression - } - -> Elm.Expression - } -make_ = - { pageUrl = - \pageUrl_args -> - Elm.withType - (Type.alias - [ "Pages", "PageUrl" ] - "PageUrl" - [] - (Type.record - [ ( "protocol" - , Type.namedWith [ "Url" ] "Protocol" [] - ) - , ( "host", Type.string ) - , ( "port_", Type.maybe Type.int ) - , ( "path" - , Type.namedWith [ "UrlPath" ] "UrlPath" [] - ) - , ( "query" - , Type.namedWith - [ "Dict" ] - "Dict" - [ Type.string, Type.list Type.string ] - ) - , ( "fragment", Type.maybe Type.string ) - ] - ) - ) - (Elm.record - [ Tuple.pair "protocol" pageUrl_args.protocol - , Tuple.pair "host" pageUrl_args.host - , Tuple.pair "port_" pageUrl_args.port_ - , Tuple.pair "path" pageUrl_args.path - , Tuple.pair "query" pageUrl_args.query - , Tuple.pair "fragment" pageUrl_args.fragment - ] - ) - } - - -call_ : - { toUrl : Elm.Expression -> Elm.Expression - , parseQueryParams : Elm.Expression -> Elm.Expression - } -call_ = - { toUrl = - \toUrlArg_ -> - Elm.apply - (Elm.value - { importFrom = [ "Pages", "PageUrl" ] - , name = "toUrl" - , annotation = - Just - (Type.function - [ Type.namedWith - [ "Pages", "PageUrl" ] - "PageUrl" - [] - ] - (Type.namedWith [ "Url" ] "Url" []) - ) - } - ) - [ toUrlArg_ ] - , parseQueryParams = - \parseQueryParamsArg_ -> - Elm.apply - (Elm.value - { importFrom = [ "Pages", "PageUrl" ] - , name = "parseQueryParams" - , annotation = - Just - (Type.function - [ Type.string ] - (Type.namedWith - [ "Dict" ] - "Dict" - [ Type.string, Type.list Type.string ] - ) - ) - } - ) - [ parseQueryParamsArg_ ] - } - - -values_ : { toUrl : Elm.Expression, parseQueryParams : Elm.Expression } -values_ = - { toUrl = - Elm.value - { importFrom = [ "Pages", "PageUrl" ] - , name = "toUrl" - , annotation = - Just - (Type.function - [ Type.namedWith [ "Pages", "PageUrl" ] "PageUrl" [] ] - (Type.namedWith [ "Url" ] "Url" []) - ) - } - , parseQueryParams = - Elm.value - { importFrom = [ "Pages", "PageUrl" ] - , name = "parseQueryParams" - , annotation = - Just - (Type.function - [ Type.string ] - (Type.namedWith - [ "Dict" ] - "Dict" - [ Type.string, Type.list Type.string ] - ) - ) - } - } \ No newline at end of file diff --git a/elm-open-api-codegen/src/Gen/Pages/Script.elm b/elm-open-api-codegen/src/Gen/Pages/Script.elm deleted file mode 100644 index 598b6eff..00000000 --- a/elm-open-api-codegen/src/Gen/Pages/Script.elm +++ /dev/null @@ -1,1063 +0,0 @@ -module Gen.Pages.Script exposing - ( moduleName_, withCliOptions, withoutCliOptions, writeFile, command, exec - , log, sleep, doThen, which, expectWhich, question, annotation_ - , make_, caseOf_, call_, values_ - ) - -{-| -# Generated bindings for Pages.Script - -@docs moduleName_, withCliOptions, withoutCliOptions, writeFile, command, exec -@docs log, sleep, doThen, which, expectWhich, question -@docs annotation_, make_, caseOf_, call_, values_ --} - - -import Elm -import Elm.Annotation as Type -import Elm.Arg -import Elm.Case - - -{-| The name of this module. -} -moduleName_ : List String -moduleName_ = - [ "Pages", "Script" ] - - -{-| Same as [`withoutCliOptions`](#withoutCliOptions), but allows you to define a CLI Options Parser so the user can -pass in additional options for the script. - -Uses . - -Read more at . - -withCliOptions: - Cli.Program.Config cliOptions - -> (cliOptions -> BackendTask.BackendTask FatalError.FatalError ()) - -> Pages.Script.Script --} -withCliOptions : - Elm.Expression -> (Elm.Expression -> Elm.Expression) -> Elm.Expression -withCliOptions withCliOptionsArg_ withCliOptionsArg_0 = - Elm.apply - (Elm.value - { importFrom = [ "Pages", "Script" ] - , name = "withCliOptions" - , annotation = - Just - (Type.function - [ Type.namedWith - [ "Cli", "Program" ] - "Config" - [ Type.var "cliOptions" ] - , Type.function - [ Type.var "cliOptions" ] - (Type.namedWith - [ "BackendTask" ] - "BackendTask" - [ Type.namedWith - [ "FatalError" ] - "FatalError" - [] - , Type.unit - ] - ) - ] - (Type.namedWith [ "Pages", "Script" ] "Script" []) - ) - } - ) - [ withCliOptionsArg_ - , Elm.functionReduced "withCliOptionsUnpack" withCliOptionsArg_0 - ] - - -{-| Define a simple Script (no CLI Options). - - module MyScript exposing (run) - - import BackendTask - import Pages.Script as Script - - run = - Script.withoutCliOptions - (Script.log "Hello!" - |> BackendTask.allowFatal - ) - -withoutCliOptions: BackendTask.BackendTask FatalError.FatalError () -> Pages.Script.Script --} -withoutCliOptions : Elm.Expression -> Elm.Expression -withoutCliOptions withoutCliOptionsArg_ = - Elm.apply - (Elm.value - { importFrom = [ "Pages", "Script" ] - , name = "withoutCliOptions" - , annotation = - Just - (Type.function - [ Type.namedWith - [ "BackendTask" ] - "BackendTask" - [ Type.namedWith [ "FatalError" ] "FatalError" [] - , Type.unit - ] - ] - (Type.namedWith [ "Pages", "Script" ] "Script" []) - ) - } - ) - [ withoutCliOptionsArg_ ] - - -{-| Write a file to the file system. - -File paths are relative to the root of your `elm-pages` project (next to the `elm.json` file and `src/` directory), or you can pass in absolute paths beginning with a `/`. - - module MyScript exposing (run) - - import BackendTask - import Pages.Script as Script - - run = - Script.withoutCliOptions - (Script.writeFile - { path = "hello.json" - , body = """{ "message": "Hello, World!" }""" - } - |> BackendTask.allowFatal - ) - -writeFile: - { path : String, body : String } - -> BackendTask.BackendTask { fatal : FatalError.FatalError - , recoverable : Pages.Script.Error - } () --} -writeFile : { path : String, body : String } -> Elm.Expression -writeFile writeFileArg_ = - Elm.apply - (Elm.value - { importFrom = [ "Pages", "Script" ] - , name = "writeFile" - , annotation = - Just - (Type.function - [ Type.record - [ ( "path", Type.string ) - , ( "body", Type.string ) - ] - ] - (Type.namedWith - [ "BackendTask" ] - "BackendTask" - [ Type.record - [ ( "fatal" - , Type.namedWith - [ "FatalError" ] - "FatalError" - [] - ) - , ( "recoverable" - , Type.namedWith - [ "Pages", "Script" ] - "Error" - [] - ) - ] - , Type.unit - ] - ) - ) - } - ) - [ Elm.record - [ Tuple.pair "path" (Elm.string writeFileArg_.path) - , Tuple.pair "body" (Elm.string writeFileArg_.body) - ] - ] - - -{-| Run a single command and return stderr and stdout combined as a single String. - -If you want to do more advanced things like piping together multiple commands in a pipeline, or piping in a file to a command, etc., see the [`Stream`](BackendTask-Stream) module. - - module MyScript exposing (run) - - import BackendTask - import Pages.Script as Script exposing (Script) - - run : Script - run = - Script.withoutCliOptions - (Script.command "ls" [] - |> BackendTask.andThen - (\files -> - Script.log ("Files: " ++ files) - ) - ) - -command: String -> List String -> BackendTask.BackendTask FatalError.FatalError String --} -command : String -> List String -> Elm.Expression -command commandArg_ commandArg_0 = - Elm.apply - (Elm.value - { importFrom = [ "Pages", "Script" ] - , name = "command" - , annotation = - Just - (Type.function - [ Type.string, Type.list Type.string ] - (Type.namedWith - [ "BackendTask" ] - "BackendTask" - [ Type.namedWith [ "FatalError" ] "FatalError" [] - , Type.string - ] - ) - ) - } - ) - [ Elm.string commandArg_, Elm.list (List.map Elm.string commandArg_0) ] - - -{-| Like [`command`](#command), but prints stderr and stdout to the console as the command runs instead of capturing them. - - module MyScript exposing (run) - - import BackendTask - import Pages.Script as Script exposing (Script) - - run : Script - run = - Script.withoutCliOptions - (Script.exec "ls" []) - -exec: String -> List String -> BackendTask.BackendTask FatalError.FatalError () --} -exec : String -> List String -> Elm.Expression -exec execArg_ execArg_0 = - Elm.apply - (Elm.value - { importFrom = [ "Pages", "Script" ] - , name = "exec" - , annotation = - Just - (Type.function - [ Type.string, Type.list Type.string ] - (Type.namedWith - [ "BackendTask" ] - "BackendTask" - [ Type.namedWith [ "FatalError" ] "FatalError" [] - , Type.unit - ] - ) - ) - } - ) - [ Elm.string execArg_, Elm.list (List.map Elm.string execArg_0) ] - - -{-| Log to stdout. - - module MyScript exposing (run) - - import BackendTask - import Pages.Script as Script - - run = - Script.withoutCliOptions - (Script.log "Hello!" - |> BackendTask.allowFatal - ) - -log: String -> BackendTask.BackendTask error () --} -log : String -> Elm.Expression -log logArg_ = - Elm.apply - (Elm.value - { importFrom = [ "Pages", "Script" ] - , name = "log" - , annotation = - Just - (Type.function - [ Type.string ] - (Type.namedWith - [ "BackendTask" ] - "BackendTask" - [ Type.var "error", Type.unit ] - ) - ) - } - ) - [ Elm.string logArg_ ] - - -{-| Sleep for a number of milliseconds. - - module MyScript exposing (run) - - import BackendTask - import Pages.Script as Script - - run = - Script.withoutCliOptions - (Script.log "Hello..." - |> Script.doThen - (Script.sleep 1000) - |> Script.doThen - (Script.log "World!") - ) - -sleep: Int -> BackendTask.BackendTask error () --} -sleep : Int -> Elm.Expression -sleep sleepArg_ = - Elm.apply - (Elm.value - { importFrom = [ "Pages", "Script" ] - , name = "sleep" - , annotation = - Just - (Type.function - [ Type.int ] - (Type.namedWith - [ "BackendTask" ] - "BackendTask" - [ Type.var "error", Type.unit ] - ) - ) - } - ) - [ Elm.int sleepArg_ ] - - -{-| Run a command with no output, then run another command. - - module MyScript exposing (run) - - import BackendTask - import Pages.Script as Script - - run = - Script.withoutCliOptions - (Script.log "Hello!" - |> Script.doThen - (Script.log "World!") - ) - -doThen: - BackendTask.BackendTask error value - -> BackendTask.BackendTask error () - -> BackendTask.BackendTask error value --} -doThen : Elm.Expression -> Elm.Expression -> Elm.Expression -doThen doThenArg_ doThenArg_0 = - Elm.apply - (Elm.value - { importFrom = [ "Pages", "Script" ] - , name = "doThen" - , annotation = - Just - (Type.function - [ Type.namedWith - [ "BackendTask" ] - "BackendTask" - [ Type.var "error", Type.var "value" ] - , Type.namedWith - [ "BackendTask" ] - "BackendTask" - [ Type.var "error", Type.unit ] - ] - (Type.namedWith - [ "BackendTask" ] - "BackendTask" - [ Type.var "error", Type.var "value" ] - ) - ) - } - ) - [ doThenArg_, doThenArg_0 ] - - -{-| Same as [`expectWhich`](#expectWhich), but returns `Nothing` if the command is not found instead of failing with a [`FatalError`](FatalError). - -which: String -> BackendTask.BackendTask error (Maybe String) --} -which : String -> Elm.Expression -which whichArg_ = - Elm.apply - (Elm.value - { importFrom = [ "Pages", "Script" ] - , name = "which" - , annotation = - Just - (Type.function - [ Type.string ] - (Type.namedWith - [ "BackendTask" ] - "BackendTask" - [ Type.var "error", Type.maybe Type.string ] - ) - ) - } - ) - [ Elm.string whichArg_ ] - - -{-| Check if a command is available on the system. If it is, return the full path to the command, otherwise fail with a [`FatalError`](FatalError). - - module MyScript exposing (run) - - import BackendTask - import Pages.Script as Script - - run : Script - run = - Script.withoutCliOptions - (Script.expectWhich "elm-review" - |> BackendTask.andThen - (\path -> - Script.log ("The path to `elm-review` is: " ++ path) - ) - ) - -If you run it with a command that is not available, you will see an error like this: - - Script.expectWhich "hype-script" - -```shell --- COMMAND NOT FOUND --------------- -I expected to find `hype-script`, but it was not on your PATH. Make sure it is installed and included in your PATH. -``` - -expectWhich: String -> BackendTask.BackendTask FatalError.FatalError String --} -expectWhich : String -> Elm.Expression -expectWhich expectWhichArg_ = - Elm.apply - (Elm.value - { importFrom = [ "Pages", "Script" ] - , name = "expectWhich" - , annotation = - Just - (Type.function - [ Type.string ] - (Type.namedWith - [ "BackendTask" ] - "BackendTask" - [ Type.namedWith [ "FatalError" ] "FatalError" [] - , Type.string - ] - ) - ) - } - ) - [ Elm.string expectWhichArg_ ] - - -{-| module QuestionDemo exposing (run) - - import BackendTask - - run : Script - run = - Script.withoutCliOptions - (Script.question "What is your name? " - |> BackendTask.andThen - (\name -> - Script.log ("Hello, " ++ name ++ "!") - ) - ) - -question: String -> BackendTask.BackendTask error String --} -question : String -> Elm.Expression -question questionArg_ = - Elm.apply - (Elm.value - { importFrom = [ "Pages", "Script" ] - , name = "question" - , annotation = - Just - (Type.function - [ Type.string ] - (Type.namedWith - [ "BackendTask" ] - "BackendTask" - [ Type.var "error", Type.string ] - ) - ) - } - ) - [ Elm.string questionArg_ ] - - -annotation_ : { script : Type.Annotation, error : Type.Annotation } -annotation_ = - { script = - Type.alias - moduleName_ - "Script" - [] - (Type.namedWith [ "Pages", "Internal", "Script" ] "Script" []) - , error = Type.namedWith [ "Pages", "Script" ] "Error" [] - } - - -make_ : { fileWriteError : Elm.Expression } -make_ = - { fileWriteError = - Elm.value - { importFrom = [ "Pages", "Script" ] - , name = "FileWriteError" - , annotation = Just (Type.namedWith [] "Error" []) - } - } - - -caseOf_ : - { error : - Elm.Expression -> { fileWriteError : Elm.Expression } -> Elm.Expression - } -caseOf_ = - { error = - \errorExpression errorTags -> - Elm.Case.custom - errorExpression - (Type.namedWith [ "Pages", "Script" ] "Error" []) - [ Elm.Case.branch - (Elm.Arg.customType - "FileWriteError" - errorTags.fileWriteError - ) - Basics.identity - ] - } - - -call_ : - { withCliOptions : Elm.Expression -> Elm.Expression -> Elm.Expression - , withoutCliOptions : Elm.Expression -> Elm.Expression - , writeFile : Elm.Expression -> Elm.Expression - , command : Elm.Expression -> Elm.Expression -> Elm.Expression - , exec : Elm.Expression -> Elm.Expression -> Elm.Expression - , log : Elm.Expression -> Elm.Expression - , sleep : Elm.Expression -> Elm.Expression - , doThen : Elm.Expression -> Elm.Expression -> Elm.Expression - , which : Elm.Expression -> Elm.Expression - , expectWhich : Elm.Expression -> Elm.Expression - , question : Elm.Expression -> Elm.Expression - } -call_ = - { withCliOptions = - \withCliOptionsArg_ withCliOptionsArg_0 -> - Elm.apply - (Elm.value - { importFrom = [ "Pages", "Script" ] - , name = "withCliOptions" - , annotation = - Just - (Type.function - [ Type.namedWith - [ "Cli", "Program" ] - "Config" - [ Type.var "cliOptions" ] - , Type.function - [ Type.var "cliOptions" ] - (Type.namedWith - [ "BackendTask" ] - "BackendTask" - [ Type.namedWith - [ "FatalError" ] - "FatalError" - [] - , Type.unit - ] - ) - ] - (Type.namedWith - [ "Pages", "Script" ] - "Script" - [] - ) - ) - } - ) - [ withCliOptionsArg_, withCliOptionsArg_0 ] - , withoutCliOptions = - \withoutCliOptionsArg_ -> - Elm.apply - (Elm.value - { importFrom = [ "Pages", "Script" ] - , name = "withoutCliOptions" - , annotation = - Just - (Type.function - [ Type.namedWith - [ "BackendTask" ] - "BackendTask" - [ Type.namedWith - [ "FatalError" ] - "FatalError" - [] - , Type.unit - ] - ] - (Type.namedWith - [ "Pages", "Script" ] - "Script" - [] - ) - ) - } - ) - [ withoutCliOptionsArg_ ] - , writeFile = - \writeFileArg_ -> - Elm.apply - (Elm.value - { importFrom = [ "Pages", "Script" ] - , name = "writeFile" - , annotation = - Just - (Type.function - [ Type.record - [ ( "path", Type.string ) - , ( "body", Type.string ) - ] - ] - (Type.namedWith - [ "BackendTask" ] - "BackendTask" - [ Type.record - [ ( "fatal" - , Type.namedWith - [ "FatalError" ] - "FatalError" - [] - ) - , ( "recoverable" - , Type.namedWith - [ "Pages", "Script" ] - "Error" - [] - ) - ] - , Type.unit - ] - ) - ) - } - ) - [ writeFileArg_ ] - , command = - \commandArg_ commandArg_0 -> - Elm.apply - (Elm.value - { importFrom = [ "Pages", "Script" ] - , name = "command" - , annotation = - Just - (Type.function - [ Type.string, Type.list Type.string ] - (Type.namedWith - [ "BackendTask" ] - "BackendTask" - [ Type.namedWith - [ "FatalError" ] - "FatalError" - [] - , Type.string - ] - ) - ) - } - ) - [ commandArg_, commandArg_0 ] - , exec = - \execArg_ execArg_0 -> - Elm.apply - (Elm.value - { importFrom = [ "Pages", "Script" ] - , name = "exec" - , annotation = - Just - (Type.function - [ Type.string, Type.list Type.string ] - (Type.namedWith - [ "BackendTask" ] - "BackendTask" - [ Type.namedWith - [ "FatalError" ] - "FatalError" - [] - , Type.unit - ] - ) - ) - } - ) - [ execArg_, execArg_0 ] - , log = - \logArg_ -> - Elm.apply - (Elm.value - { importFrom = [ "Pages", "Script" ] - , name = "log" - , annotation = - Just - (Type.function - [ Type.string ] - (Type.namedWith - [ "BackendTask" ] - "BackendTask" - [ Type.var "error", Type.unit ] - ) - ) - } - ) - [ logArg_ ] - , sleep = - \sleepArg_ -> - Elm.apply - (Elm.value - { importFrom = [ "Pages", "Script" ] - , name = "sleep" - , annotation = - Just - (Type.function - [ Type.int ] - (Type.namedWith - [ "BackendTask" ] - "BackendTask" - [ Type.var "error", Type.unit ] - ) - ) - } - ) - [ sleepArg_ ] - , doThen = - \doThenArg_ doThenArg_0 -> - Elm.apply - (Elm.value - { importFrom = [ "Pages", "Script" ] - , name = "doThen" - , annotation = - Just - (Type.function - [ Type.namedWith - [ "BackendTask" ] - "BackendTask" - [ Type.var "error", Type.var "value" ] - , Type.namedWith - [ "BackendTask" ] - "BackendTask" - [ Type.var "error", Type.unit ] - ] - (Type.namedWith - [ "BackendTask" ] - "BackendTask" - [ Type.var "error", Type.var "value" ] - ) - ) - } - ) - [ doThenArg_, doThenArg_0 ] - , which = - \whichArg_ -> - Elm.apply - (Elm.value - { importFrom = [ "Pages", "Script" ] - , name = "which" - , annotation = - Just - (Type.function - [ Type.string ] - (Type.namedWith - [ "BackendTask" ] - "BackendTask" - [ Type.var "error" - , Type.maybe Type.string - ] - ) - ) - } - ) - [ whichArg_ ] - , expectWhich = - \expectWhichArg_ -> - Elm.apply - (Elm.value - { importFrom = [ "Pages", "Script" ] - , name = "expectWhich" - , annotation = - Just - (Type.function - [ Type.string ] - (Type.namedWith - [ "BackendTask" ] - "BackendTask" - [ Type.namedWith - [ "FatalError" ] - "FatalError" - [] - , Type.string - ] - ) - ) - } - ) - [ expectWhichArg_ ] - , question = - \questionArg_ -> - Elm.apply - (Elm.value - { importFrom = [ "Pages", "Script" ] - , name = "question" - , annotation = - Just - (Type.function - [ Type.string ] - (Type.namedWith - [ "BackendTask" ] - "BackendTask" - [ Type.var "error", Type.string ] - ) - ) - } - ) - [ questionArg_ ] - } - - -values_ : - { withCliOptions : Elm.Expression - , withoutCliOptions : Elm.Expression - , writeFile : Elm.Expression - , command : Elm.Expression - , exec : Elm.Expression - , log : Elm.Expression - , sleep : Elm.Expression - , doThen : Elm.Expression - , which : Elm.Expression - , expectWhich : Elm.Expression - , question : Elm.Expression - } -values_ = - { withCliOptions = - Elm.value - { importFrom = [ "Pages", "Script" ] - , name = "withCliOptions" - , annotation = - Just - (Type.function - [ Type.namedWith - [ "Cli", "Program" ] - "Config" - [ Type.var "cliOptions" ] - , Type.function - [ Type.var "cliOptions" ] - (Type.namedWith - [ "BackendTask" ] - "BackendTask" - [ Type.namedWith - [ "FatalError" ] - "FatalError" - [] - , Type.unit - ] - ) - ] - (Type.namedWith [ "Pages", "Script" ] "Script" []) - ) - } - , withoutCliOptions = - Elm.value - { importFrom = [ "Pages", "Script" ] - , name = "withoutCliOptions" - , annotation = - Just - (Type.function - [ Type.namedWith - [ "BackendTask" ] - "BackendTask" - [ Type.namedWith [ "FatalError" ] "FatalError" [] - , Type.unit - ] - ] - (Type.namedWith [ "Pages", "Script" ] "Script" []) - ) - } - , writeFile = - Elm.value - { importFrom = [ "Pages", "Script" ] - , name = "writeFile" - , annotation = - Just - (Type.function - [ Type.record - [ ( "path", Type.string ) - , ( "body", Type.string ) - ] - ] - (Type.namedWith - [ "BackendTask" ] - "BackendTask" - [ Type.record - [ ( "fatal" - , Type.namedWith - [ "FatalError" ] - "FatalError" - [] - ) - , ( "recoverable" - , Type.namedWith - [ "Pages", "Script" ] - "Error" - [] - ) - ] - , Type.unit - ] - ) - ) - } - , command = - Elm.value - { importFrom = [ "Pages", "Script" ] - , name = "command" - , annotation = - Just - (Type.function - [ Type.string, Type.list Type.string ] - (Type.namedWith - [ "BackendTask" ] - "BackendTask" - [ Type.namedWith [ "FatalError" ] "FatalError" [] - , Type.string - ] - ) - ) - } - , exec = - Elm.value - { importFrom = [ "Pages", "Script" ] - , name = "exec" - , annotation = - Just - (Type.function - [ Type.string, Type.list Type.string ] - (Type.namedWith - [ "BackendTask" ] - "BackendTask" - [ Type.namedWith [ "FatalError" ] "FatalError" [] - , Type.unit - ] - ) - ) - } - , log = - Elm.value - { importFrom = [ "Pages", "Script" ] - , name = "log" - , annotation = - Just - (Type.function - [ Type.string ] - (Type.namedWith - [ "BackendTask" ] - "BackendTask" - [ Type.var "error", Type.unit ] - ) - ) - } - , sleep = - Elm.value - { importFrom = [ "Pages", "Script" ] - , name = "sleep" - , annotation = - Just - (Type.function - [ Type.int ] - (Type.namedWith - [ "BackendTask" ] - "BackendTask" - [ Type.var "error", Type.unit ] - ) - ) - } - , doThen = - Elm.value - { importFrom = [ "Pages", "Script" ] - , name = "doThen" - , annotation = - Just - (Type.function - [ Type.namedWith - [ "BackendTask" ] - "BackendTask" - [ Type.var "error", Type.var "value" ] - , Type.namedWith - [ "BackendTask" ] - "BackendTask" - [ Type.var "error", Type.unit ] - ] - (Type.namedWith - [ "BackendTask" ] - "BackendTask" - [ Type.var "error", Type.var "value" ] - ) - ) - } - , which = - Elm.value - { importFrom = [ "Pages", "Script" ] - , name = "which" - , annotation = - Just - (Type.function - [ Type.string ] - (Type.namedWith - [ "BackendTask" ] - "BackendTask" - [ Type.var "error", Type.maybe Type.string ] - ) - ) - } - , expectWhich = - Elm.value - { importFrom = [ "Pages", "Script" ] - , name = "expectWhich" - , annotation = - Just - (Type.function - [ Type.string ] - (Type.namedWith - [ "BackendTask" ] - "BackendTask" - [ Type.namedWith [ "FatalError" ] "FatalError" [] - , Type.string - ] - ) - ) - } - , question = - Elm.value - { importFrom = [ "Pages", "Script" ] - , name = "question" - , annotation = - Just - (Type.function - [ Type.string ] - (Type.namedWith - [ "BackendTask" ] - "BackendTask" - [ Type.var "error", Type.string ] - ) - ) - } - } \ No newline at end of file diff --git a/elm-open-api-codegen/src/Gen/Pages/Script/Spinner.elm b/elm-open-api-codegen/src/Gen/Pages/Script/Spinner.elm deleted file mode 100644 index 98877f11..00000000 --- a/elm-open-api-codegen/src/Gen/Pages/Script/Spinner.elm +++ /dev/null @@ -1,1230 +0,0 @@ -module Gen.Pages.Script.Spinner exposing - ( moduleName_, steps, withStep, withStepWithOptions, runSteps, options - , withOnCompletion, runTask, runTaskWithOptions, showStep, runSpinnerWithTask, annotation_, make_ - , caseOf_, call_, values_ - ) - -{-| -# Generated bindings for Pages.Script.Spinner - -@docs moduleName_, steps, withStep, withStepWithOptions, runSteps, options -@docs withOnCompletion, runTask, runTaskWithOptions, showStep, runSpinnerWithTask, annotation_ -@docs make_, caseOf_, call_, values_ --} - - -import Elm -import Elm.Annotation as Type -import Elm.Arg -import Elm.Case - - -{-| The name of this module. -} -moduleName_ : List String -moduleName_ = - [ "Pages", "Script", "Spinner" ] - - -{-| Initialize an empty series of `Steps`. - -steps: Pages.Script.Spinner.Steps FatalError.FatalError () --} -steps : Elm.Expression -steps = - Elm.value - { importFrom = [ "Pages", "Script", "Spinner" ] - , name = "steps" - , annotation = - Just - (Type.namedWith - [ "Pages", "Script", "Spinner" ] - "Steps" - [ Type.namedWith [ "FatalError" ] "FatalError" [] - , Type.unit - ] - ) - } - - -{-| Add a `Step`. See [`withStepWithOptions`](#withStepWithOptions) to configure the step's spinner. - -withStep: - String - -> (oldValue -> BackendTask.BackendTask FatalError.FatalError newValue) - -> Pages.Script.Spinner.Steps FatalError.FatalError oldValue - -> Pages.Script.Spinner.Steps FatalError.FatalError newValue --} -withStep : - String - -> (Elm.Expression -> Elm.Expression) - -> Elm.Expression - -> Elm.Expression -withStep withStepArg_ withStepArg_0 withStepArg_1 = - Elm.apply - (Elm.value - { importFrom = [ "Pages", "Script", "Spinner" ] - , name = "withStep" - , annotation = - Just - (Type.function - [ Type.string - , Type.function - [ Type.var "oldValue" ] - (Type.namedWith - [ "BackendTask" ] - "BackendTask" - [ Type.namedWith - [ "FatalError" ] - "FatalError" - [] - , Type.var "newValue" - ] - ) - , Type.namedWith - [ "Pages", "Script", "Spinner" ] - "Steps" - [ Type.namedWith [ "FatalError" ] "FatalError" [] - , Type.var "oldValue" - ] - ] - (Type.namedWith - [ "Pages", "Script", "Spinner" ] - "Steps" - [ Type.namedWith [ "FatalError" ] "FatalError" [] - , Type.var "newValue" - ] - ) - ) - } - ) - [ Elm.string withStepArg_ - , Elm.functionReduced "withStepUnpack" withStepArg_0 - , withStepArg_1 - ] - - -{-| Add a step with custom [`Options`](#Options). - -withStepWithOptions: - Pages.Script.Spinner.Options FatalError.FatalError newValue - -> (oldValue -> BackendTask.BackendTask FatalError.FatalError newValue) - -> Pages.Script.Spinner.Steps FatalError.FatalError oldValue - -> Pages.Script.Spinner.Steps FatalError.FatalError newValue --} -withStepWithOptions : - Elm.Expression - -> (Elm.Expression -> Elm.Expression) - -> Elm.Expression - -> Elm.Expression -withStepWithOptions withStepWithOptionsArg_ withStepWithOptionsArg_0 withStepWithOptionsArg_1 = - Elm.apply - (Elm.value - { importFrom = [ "Pages", "Script", "Spinner" ] - , name = "withStepWithOptions" - , annotation = - Just - (Type.function - [ Type.namedWith - [ "Pages", "Script", "Spinner" ] - "Options" - [ Type.namedWith [ "FatalError" ] "FatalError" [] - , Type.var "newValue" - ] - , Type.function - [ Type.var "oldValue" ] - (Type.namedWith - [ "BackendTask" ] - "BackendTask" - [ Type.namedWith - [ "FatalError" ] - "FatalError" - [] - , Type.var "newValue" - ] - ) - , Type.namedWith - [ "Pages", "Script", "Spinner" ] - "Steps" - [ Type.namedWith [ "FatalError" ] "FatalError" [] - , Type.var "oldValue" - ] - ] - (Type.namedWith - [ "Pages", "Script", "Spinner" ] - "Steps" - [ Type.namedWith [ "FatalError" ] "FatalError" [] - , Type.var "newValue" - ] - ) - ) - } - ) - [ withStepWithOptionsArg_ - , Elm.functionReduced - "withStepWithOptionsUnpack" - withStepWithOptionsArg_0 - , withStepWithOptionsArg_1 - ] - - -{-| Perform the `Steps` in sequence. - -runSteps: - Pages.Script.Spinner.Steps FatalError.FatalError value - -> BackendTask.BackendTask FatalError.FatalError value --} -runSteps : Elm.Expression -> Elm.Expression -runSteps runStepsArg_ = - Elm.apply - (Elm.value - { importFrom = [ "Pages", "Script", "Spinner" ] - , name = "runSteps" - , annotation = - Just - (Type.function - [ Type.namedWith - [ "Pages", "Script", "Spinner" ] - "Steps" - [ Type.namedWith [ "FatalError" ] "FatalError" [] - , Type.var "value" - ] - ] - (Type.namedWith - [ "BackendTask" ] - "BackendTask" - [ Type.namedWith [ "FatalError" ] "FatalError" [] - , Type.var "value" - ] - ) - ) - } - ) - [ runStepsArg_ ] - - -{-| The default options for a spinner. The spinner `text` is a required argument and will be displayed as the step name. - - import Pages.Script.Spinner as Spinner - - example = - Spinner.options "Compile Main.elm" - -options: String -> Pages.Script.Spinner.Options error value --} -options : String -> Elm.Expression -options optionsArg_ = - Elm.apply - (Elm.value - { importFrom = [ "Pages", "Script", "Spinner" ] - , name = "options" - , annotation = - Just - (Type.function - [ Type.string ] - (Type.namedWith - [ "Pages", "Script", "Spinner" ] - "Options" - [ Type.var "error", Type.var "value" ] - ) - ) - } - ) - [ Elm.string optionsArg_ ] - - -{-| Set the completion icon and text based on the result of the task. - - import Pages.Script.Spinner as Spinner - - example = - Spinner.options "Fetching data" - |> Spinner.withOnCompletion - (\result -> - case result of - Ok _ -> - ( Spinner.Succeed, "Fetched data!" ) - - Err _ -> - ( Spinner.Fail - , Just "Could not fetch data." - ) - ) - -withOnCompletion: - (Result.Result error value - -> ( Pages.Script.Spinner.CompletionIcon, Maybe String )) - -> Pages.Script.Spinner.Options error value - -> Pages.Script.Spinner.Options error value --} -withOnCompletion : - (Elm.Expression -> Elm.Expression) -> Elm.Expression -> Elm.Expression -withOnCompletion withOnCompletionArg_ withOnCompletionArg_0 = - Elm.apply - (Elm.value - { importFrom = [ "Pages", "Script", "Spinner" ] - , name = "withOnCompletion" - , annotation = - Just - (Type.function - [ Type.function - [ Type.namedWith - [ "Result" ] - "Result" - [ Type.var "error", Type.var "value" ] - ] - (Type.tuple - (Type.namedWith - [ "Pages", "Script", "Spinner" ] - "CompletionIcon" - [] - ) - (Type.maybe Type.string) - ) - , Type.namedWith - [ "Pages", "Script", "Spinner" ] - "Options" - [ Type.var "error", Type.var "value" ] - ] - (Type.namedWith - [ "Pages", "Script", "Spinner" ] - "Options" - [ Type.var "error", Type.var "value" ] - ) - ) - } - ) - [ Elm.functionReduced "withOnCompletionUnpack" withOnCompletionArg_ - , withOnCompletionArg_0 - ] - - -{-| Run a `BackendTask` with a spinner. The spinner will show a success icon if the task succeeds, and a failure icon if the task fails. - -It's often easier to use [`steps`](#steps) when possible. - - module SequentialSteps exposing (run) - - import Pages.Script as Script exposing (Script, doThen, sleep) - import Pages.Script.Spinner as Spinner - - - run : Script - run = - Script.withoutCliOptions - (sleep 3000 - |> Spinner.runTask "Step 1..." - |> doThen - (sleep 3000 - |> Spinner.runTask "Step 2..." - |> doThen - (sleep 3000 - |> Spinner.runTask "Step 3..." - ) - ) - ) - -runTask: - String - -> BackendTask.BackendTask error value - -> BackendTask.BackendTask error value --} -runTask : String -> Elm.Expression -> Elm.Expression -runTask runTaskArg_ runTaskArg_0 = - Elm.apply - (Elm.value - { importFrom = [ "Pages", "Script", "Spinner" ] - , name = "runTask" - , annotation = - Just - (Type.function - [ Type.string - , Type.namedWith - [ "BackendTask" ] - "BackendTask" - [ Type.var "error", Type.var "value" ] - ] - (Type.namedWith - [ "BackendTask" ] - "BackendTask" - [ Type.var "error", Type.var "value" ] - ) - ) - } - ) - [ Elm.string runTaskArg_, runTaskArg_0 ] - - -{-| runTaskWithOptions: - Pages.Script.Spinner.Options error value - -> BackendTask.BackendTask error value - -> BackendTask.BackendTask error value --} -runTaskWithOptions : Elm.Expression -> Elm.Expression -> Elm.Expression -runTaskWithOptions runTaskWithOptionsArg_ runTaskWithOptionsArg_0 = - Elm.apply - (Elm.value - { importFrom = [ "Pages", "Script", "Spinner" ] - , name = "runTaskWithOptions" - , annotation = - Just - (Type.function - [ Type.namedWith - [ "Pages", "Script", "Spinner" ] - "Options" - [ Type.var "error", Type.var "value" ] - , Type.namedWith - [ "BackendTask" ] - "BackendTask" - [ Type.var "error", Type.var "value" ] - ] - (Type.namedWith - [ "BackendTask" ] - "BackendTask" - [ Type.var "error", Type.var "value" ] - ) - ) - } - ) - [ runTaskWithOptionsArg_, runTaskWithOptionsArg_0 ] - - -{-| `showStep` gives you a `Spinner` reference which you can use to start the spinner later with `runSpinnerWithTask`. - -Most use cases can be achieved more easily using more high-level helpers, like [`runTask`](#runTask) or [`steps`](#steps). -`showStep` can be useful if you have more dynamic steps that you want to reveal over time. - - module ShowStepDemo exposing (run) - - import BackendTask exposing (BackendTask) - import Pages.Script as Script exposing (Script, doThen, sleep) - import Pages.Script.Spinner as Spinner - - run : Script - run = - Script.withoutCliOptions - (BackendTask.succeed - (\spinner1 spinner2 spinner3 -> - sleep 3000 - |> Spinner.runSpinnerWithTask spinner1 - |> doThen - (sleep 3000 - |> Spinner.runSpinnerWithTask spinner2 - |> doThen - (sleep 3000 - |> Spinner.runSpinnerWithTask spinner3 - ) - ) - ) - |> BackendTask.andMap - (Spinner.options "Step 1" |> Spinner.showStep) - |> BackendTask.andMap - (Spinner.options "Step 2" |> Spinner.showStep) - |> BackendTask.andMap - (Spinner.options "Step 3" |> Spinner.showStep) - |> BackendTask.andThen identity - ) - -showStep: - Pages.Script.Spinner.Options error value - -> BackendTask.BackendTask error (Pages.Script.Spinner.Spinner error value) --} -showStep : Elm.Expression -> Elm.Expression -showStep showStepArg_ = - Elm.apply - (Elm.value - { importFrom = [ "Pages", "Script", "Spinner" ] - , name = "showStep" - , annotation = - Just - (Type.function - [ Type.namedWith - [ "Pages", "Script", "Spinner" ] - "Options" - [ Type.var "error", Type.var "value" ] - ] - (Type.namedWith - [ "BackendTask" ] - "BackendTask" - [ Type.var "error" - , Type.namedWith - [ "Pages", "Script", "Spinner" ] - "Spinner" - [ Type.var "error", Type.var "value" ] - ] - ) - ) - } - ) - [ showStepArg_ ] - - -{-| After calling `showStep` to get a reference to a `Spinner`, use `runSpinnerWithTask` to run a `BackendTask` and show a failure or success -completion status once it is done. - -runSpinnerWithTask: - Pages.Script.Spinner.Spinner error value - -> BackendTask.BackendTask error value - -> BackendTask.BackendTask error value --} -runSpinnerWithTask : Elm.Expression -> Elm.Expression -> Elm.Expression -runSpinnerWithTask runSpinnerWithTaskArg_ runSpinnerWithTaskArg_0 = - Elm.apply - (Elm.value - { importFrom = [ "Pages", "Script", "Spinner" ] - , name = "runSpinnerWithTask" - , annotation = - Just - (Type.function - [ Type.namedWith - [ "Pages", "Script", "Spinner" ] - "Spinner" - [ Type.var "error", Type.var "value" ] - , Type.namedWith - [ "BackendTask" ] - "BackendTask" - [ Type.var "error", Type.var "value" ] - ] - (Type.namedWith - [ "BackendTask" ] - "BackendTask" - [ Type.var "error", Type.var "value" ] - ) - ) - } - ) - [ runSpinnerWithTaskArg_, runSpinnerWithTaskArg_0 ] - - -annotation_ : - { steps : Type.Annotation -> Type.Annotation -> Type.Annotation - , options : Type.Annotation -> Type.Annotation -> Type.Annotation - , completionIcon : Type.Annotation - , spinner : Type.Annotation -> Type.Annotation -> Type.Annotation - } -annotation_ = - { steps = - \stepsArg0 stepsArg1 -> - Type.namedWith - [ "Pages", "Script", "Spinner" ] - "Steps" - [ stepsArg0, stepsArg1 ] - , options = - \optionsArg0 optionsArg1 -> - Type.namedWith - [ "Pages", "Script", "Spinner" ] - "Options" - [ optionsArg0, optionsArg1 ] - , completionIcon = - Type.namedWith [ "Pages", "Script", "Spinner" ] "CompletionIcon" [] - , spinner = - \spinnerArg0 spinnerArg1 -> - Type.namedWith - [ "Pages", "Script", "Spinner" ] - "Spinner" - [ spinnerArg0, spinnerArg1 ] - } - - -make_ : - { steps : Elm.Expression -> Elm.Expression - , succeed : Elm.Expression - , fail : Elm.Expression - , warn : Elm.Expression - , info : Elm.Expression - } -make_ = - { steps = - \ar0 -> - Elm.apply - (Elm.value - { importFrom = [ "Pages", "Script", "Spinner" ] - , name = "Steps" - , annotation = - Just - (Type.namedWith - [] - "Steps" - [ Type.var "error", Type.var "value" ] - ) - } - ) - [ ar0 ] - , succeed = - Elm.value - { importFrom = [ "Pages", "Script", "Spinner" ] - , name = "Succeed" - , annotation = Just (Type.namedWith [] "CompletionIcon" []) - } - , fail = - Elm.value - { importFrom = [ "Pages", "Script", "Spinner" ] - , name = "Fail" - , annotation = Just (Type.namedWith [] "CompletionIcon" []) - } - , warn = - Elm.value - { importFrom = [ "Pages", "Script", "Spinner" ] - , name = "Warn" - , annotation = Just (Type.namedWith [] "CompletionIcon" []) - } - , info = - Elm.value - { importFrom = [ "Pages", "Script", "Spinner" ] - , name = "Info" - , annotation = Just (Type.namedWith [] "CompletionIcon" []) - } - } - - -caseOf_ : - { steps : - Elm.Expression - -> { steps : Elm.Expression -> Elm.Expression } - -> Elm.Expression - , completionIcon : - Elm.Expression - -> { succeed : Elm.Expression - , fail : Elm.Expression - , warn : Elm.Expression - , info : Elm.Expression - } - -> Elm.Expression - } -caseOf_ = - { steps = - \stepsExpression stepsTags -> - Elm.Case.custom - stepsExpression - (Type.namedWith - [ "Pages", "Script", "Spinner" ] - "Steps" - [ Type.var "error", Type.var "value" ] - ) - [ Elm.Case.branch - (Elm.Arg.customType "Steps" stepsTags.steps |> Elm.Arg.item - (Elm.Arg.varWith - "backendTaskBackendTask" - (Type.namedWith - [ "BackendTask" - ] - "BackendTask" - [ Type.var - "error" - , Type.var - "value" - ] - ) - ) - ) - Basics.identity - ] - , completionIcon = - \completionIconExpression completionIconTags -> - Elm.Case.custom - completionIconExpression - (Type.namedWith - [ "Pages", "Script", "Spinner" ] - "CompletionIcon" - [] - ) - [ Elm.Case.branch - (Elm.Arg.customType "Succeed" completionIconTags.succeed) - Basics.identity - , Elm.Case.branch - (Elm.Arg.customType "Fail" completionIconTags.fail) - Basics.identity - , Elm.Case.branch - (Elm.Arg.customType "Warn" completionIconTags.warn) - Basics.identity - , Elm.Case.branch - (Elm.Arg.customType "Info" completionIconTags.info) - Basics.identity - ] - } - - -call_ : - { withStep : - Elm.Expression -> Elm.Expression -> Elm.Expression -> Elm.Expression - , withStepWithOptions : - Elm.Expression -> Elm.Expression -> Elm.Expression -> Elm.Expression - , runSteps : Elm.Expression -> Elm.Expression - , options : Elm.Expression -> Elm.Expression - , withOnCompletion : Elm.Expression -> Elm.Expression -> Elm.Expression - , runTask : Elm.Expression -> Elm.Expression -> Elm.Expression - , runTaskWithOptions : Elm.Expression -> Elm.Expression -> Elm.Expression - , showStep : Elm.Expression -> Elm.Expression - , runSpinnerWithTask : Elm.Expression -> Elm.Expression -> Elm.Expression - } -call_ = - { withStep = - \withStepArg_ withStepArg_0 withStepArg_1 -> - Elm.apply - (Elm.value - { importFrom = [ "Pages", "Script", "Spinner" ] - , name = "withStep" - , annotation = - Just - (Type.function - [ Type.string - , Type.function - [ Type.var "oldValue" ] - (Type.namedWith - [ "BackendTask" ] - "BackendTask" - [ Type.namedWith - [ "FatalError" ] - "FatalError" - [] - , Type.var "newValue" - ] - ) - , Type.namedWith - [ "Pages", "Script", "Spinner" ] - "Steps" - [ Type.namedWith - [ "FatalError" ] - "FatalError" - [] - , Type.var "oldValue" - ] - ] - (Type.namedWith - [ "Pages", "Script", "Spinner" ] - "Steps" - [ Type.namedWith - [ "FatalError" ] - "FatalError" - [] - , Type.var "newValue" - ] - ) - ) - } - ) - [ withStepArg_, withStepArg_0, withStepArg_1 ] - , withStepWithOptions = - \withStepWithOptionsArg_ withStepWithOptionsArg_0 withStepWithOptionsArg_1 -> - Elm.apply - (Elm.value - { importFrom = [ "Pages", "Script", "Spinner" ] - , name = "withStepWithOptions" - , annotation = - Just - (Type.function - [ Type.namedWith - [ "Pages", "Script", "Spinner" ] - "Options" - [ Type.namedWith - [ "FatalError" ] - "FatalError" - [] - , Type.var "newValue" - ] - , Type.function - [ Type.var "oldValue" ] - (Type.namedWith - [ "BackendTask" ] - "BackendTask" - [ Type.namedWith - [ "FatalError" ] - "FatalError" - [] - , Type.var "newValue" - ] - ) - , Type.namedWith - [ "Pages", "Script", "Spinner" ] - "Steps" - [ Type.namedWith - [ "FatalError" ] - "FatalError" - [] - , Type.var "oldValue" - ] - ] - (Type.namedWith - [ "Pages", "Script", "Spinner" ] - "Steps" - [ Type.namedWith - [ "FatalError" ] - "FatalError" - [] - , Type.var "newValue" - ] - ) - ) - } - ) - [ withStepWithOptionsArg_ - , withStepWithOptionsArg_0 - , withStepWithOptionsArg_1 - ] - , runSteps = - \runStepsArg_ -> - Elm.apply - (Elm.value - { importFrom = [ "Pages", "Script", "Spinner" ] - , name = "runSteps" - , annotation = - Just - (Type.function - [ Type.namedWith - [ "Pages", "Script", "Spinner" ] - "Steps" - [ Type.namedWith - [ "FatalError" ] - "FatalError" - [] - , Type.var "value" - ] - ] - (Type.namedWith - [ "BackendTask" ] - "BackendTask" - [ Type.namedWith - [ "FatalError" ] - "FatalError" - [] - , Type.var "value" - ] - ) - ) - } - ) - [ runStepsArg_ ] - , options = - \optionsArg_ -> - Elm.apply - (Elm.value - { importFrom = [ "Pages", "Script", "Spinner" ] - , name = "options" - , annotation = - Just - (Type.function - [ Type.string ] - (Type.namedWith - [ "Pages", "Script", "Spinner" ] - "Options" - [ Type.var "error", Type.var "value" ] - ) - ) - } - ) - [ optionsArg_ ] - , withOnCompletion = - \withOnCompletionArg_ withOnCompletionArg_0 -> - Elm.apply - (Elm.value - { importFrom = [ "Pages", "Script", "Spinner" ] - , name = "withOnCompletion" - , annotation = - Just - (Type.function - [ Type.function - [ Type.namedWith - [ "Result" ] - "Result" - [ Type.var "error" - , Type.var "value" - ] - ] - (Type.tuple - (Type.namedWith - [ "Pages", "Script", "Spinner" ] - "CompletionIcon" - [] - ) - (Type.maybe Type.string) - ) - , Type.namedWith - [ "Pages", "Script", "Spinner" ] - "Options" - [ Type.var "error", Type.var "value" ] - ] - (Type.namedWith - [ "Pages", "Script", "Spinner" ] - "Options" - [ Type.var "error", Type.var "value" ] - ) - ) - } - ) - [ withOnCompletionArg_, withOnCompletionArg_0 ] - , runTask = - \runTaskArg_ runTaskArg_0 -> - Elm.apply - (Elm.value - { importFrom = [ "Pages", "Script", "Spinner" ] - , name = "runTask" - , annotation = - Just - (Type.function - [ Type.string - , Type.namedWith - [ "BackendTask" ] - "BackendTask" - [ Type.var "error", Type.var "value" ] - ] - (Type.namedWith - [ "BackendTask" ] - "BackendTask" - [ Type.var "error", Type.var "value" ] - ) - ) - } - ) - [ runTaskArg_, runTaskArg_0 ] - , runTaskWithOptions = - \runTaskWithOptionsArg_ runTaskWithOptionsArg_0 -> - Elm.apply - (Elm.value - { importFrom = [ "Pages", "Script", "Spinner" ] - , name = "runTaskWithOptions" - , annotation = - Just - (Type.function - [ Type.namedWith - [ "Pages", "Script", "Spinner" ] - "Options" - [ Type.var "error", Type.var "value" ] - , Type.namedWith - [ "BackendTask" ] - "BackendTask" - [ Type.var "error", Type.var "value" ] - ] - (Type.namedWith - [ "BackendTask" ] - "BackendTask" - [ Type.var "error", Type.var "value" ] - ) - ) - } - ) - [ runTaskWithOptionsArg_, runTaskWithOptionsArg_0 ] - , showStep = - \showStepArg_ -> - Elm.apply - (Elm.value - { importFrom = [ "Pages", "Script", "Spinner" ] - , name = "showStep" - , annotation = - Just - (Type.function - [ Type.namedWith - [ "Pages", "Script", "Spinner" ] - "Options" - [ Type.var "error", Type.var "value" ] - ] - (Type.namedWith - [ "BackendTask" ] - "BackendTask" - [ Type.var "error" - , Type.namedWith - [ "Pages", "Script", "Spinner" ] - "Spinner" - [ Type.var "error" - , Type.var "value" - ] - ] - ) - ) - } - ) - [ showStepArg_ ] - , runSpinnerWithTask = - \runSpinnerWithTaskArg_ runSpinnerWithTaskArg_0 -> - Elm.apply - (Elm.value - { importFrom = [ "Pages", "Script", "Spinner" ] - , name = "runSpinnerWithTask" - , annotation = - Just - (Type.function - [ Type.namedWith - [ "Pages", "Script", "Spinner" ] - "Spinner" - [ Type.var "error", Type.var "value" ] - , Type.namedWith - [ "BackendTask" ] - "BackendTask" - [ Type.var "error", Type.var "value" ] - ] - (Type.namedWith - [ "BackendTask" ] - "BackendTask" - [ Type.var "error", Type.var "value" ] - ) - ) - } - ) - [ runSpinnerWithTaskArg_, runSpinnerWithTaskArg_0 ] - } - - -values_ : - { steps : Elm.Expression - , withStep : Elm.Expression - , withStepWithOptions : Elm.Expression - , runSteps : Elm.Expression - , options : Elm.Expression - , withOnCompletion : Elm.Expression - , runTask : Elm.Expression - , runTaskWithOptions : Elm.Expression - , showStep : Elm.Expression - , runSpinnerWithTask : Elm.Expression - } -values_ = - { steps = - Elm.value - { importFrom = [ "Pages", "Script", "Spinner" ] - , name = "steps" - , annotation = - Just - (Type.namedWith - [ "Pages", "Script", "Spinner" ] - "Steps" - [ Type.namedWith [ "FatalError" ] "FatalError" [] - , Type.unit - ] - ) - } - , withStep = - Elm.value - { importFrom = [ "Pages", "Script", "Spinner" ] - , name = "withStep" - , annotation = - Just - (Type.function - [ Type.string - , Type.function - [ Type.var "oldValue" ] - (Type.namedWith - [ "BackendTask" ] - "BackendTask" - [ Type.namedWith - [ "FatalError" ] - "FatalError" - [] - , Type.var "newValue" - ] - ) - , Type.namedWith - [ "Pages", "Script", "Spinner" ] - "Steps" - [ Type.namedWith [ "FatalError" ] "FatalError" [] - , Type.var "oldValue" - ] - ] - (Type.namedWith - [ "Pages", "Script", "Spinner" ] - "Steps" - [ Type.namedWith [ "FatalError" ] "FatalError" [] - , Type.var "newValue" - ] - ) - ) - } - , withStepWithOptions = - Elm.value - { importFrom = [ "Pages", "Script", "Spinner" ] - , name = "withStepWithOptions" - , annotation = - Just - (Type.function - [ Type.namedWith - [ "Pages", "Script", "Spinner" ] - "Options" - [ Type.namedWith [ "FatalError" ] "FatalError" [] - , Type.var "newValue" - ] - , Type.function - [ Type.var "oldValue" ] - (Type.namedWith - [ "BackendTask" ] - "BackendTask" - [ Type.namedWith - [ "FatalError" ] - "FatalError" - [] - , Type.var "newValue" - ] - ) - , Type.namedWith - [ "Pages", "Script", "Spinner" ] - "Steps" - [ Type.namedWith [ "FatalError" ] "FatalError" [] - , Type.var "oldValue" - ] - ] - (Type.namedWith - [ "Pages", "Script", "Spinner" ] - "Steps" - [ Type.namedWith [ "FatalError" ] "FatalError" [] - , Type.var "newValue" - ] - ) - ) - } - , runSteps = - Elm.value - { importFrom = [ "Pages", "Script", "Spinner" ] - , name = "runSteps" - , annotation = - Just - (Type.function - [ Type.namedWith - [ "Pages", "Script", "Spinner" ] - "Steps" - [ Type.namedWith [ "FatalError" ] "FatalError" [] - , Type.var "value" - ] - ] - (Type.namedWith - [ "BackendTask" ] - "BackendTask" - [ Type.namedWith [ "FatalError" ] "FatalError" [] - , Type.var "value" - ] - ) - ) - } - , options = - Elm.value - { importFrom = [ "Pages", "Script", "Spinner" ] - , name = "options" - , annotation = - Just - (Type.function - [ Type.string ] - (Type.namedWith - [ "Pages", "Script", "Spinner" ] - "Options" - [ Type.var "error", Type.var "value" ] - ) - ) - } - , withOnCompletion = - Elm.value - { importFrom = [ "Pages", "Script", "Spinner" ] - , name = "withOnCompletion" - , annotation = - Just - (Type.function - [ Type.function - [ Type.namedWith - [ "Result" ] - "Result" - [ Type.var "error", Type.var "value" ] - ] - (Type.tuple - (Type.namedWith - [ "Pages", "Script", "Spinner" ] - "CompletionIcon" - [] - ) - (Type.maybe Type.string) - ) - , Type.namedWith - [ "Pages", "Script", "Spinner" ] - "Options" - [ Type.var "error", Type.var "value" ] - ] - (Type.namedWith - [ "Pages", "Script", "Spinner" ] - "Options" - [ Type.var "error", Type.var "value" ] - ) - ) - } - , runTask = - Elm.value - { importFrom = [ "Pages", "Script", "Spinner" ] - , name = "runTask" - , annotation = - Just - (Type.function - [ Type.string - , Type.namedWith - [ "BackendTask" ] - "BackendTask" - [ Type.var "error", Type.var "value" ] - ] - (Type.namedWith - [ "BackendTask" ] - "BackendTask" - [ Type.var "error", Type.var "value" ] - ) - ) - } - , runTaskWithOptions = - Elm.value - { importFrom = [ "Pages", "Script", "Spinner" ] - , name = "runTaskWithOptions" - , annotation = - Just - (Type.function - [ Type.namedWith - [ "Pages", "Script", "Spinner" ] - "Options" - [ Type.var "error", Type.var "value" ] - , Type.namedWith - [ "BackendTask" ] - "BackendTask" - [ Type.var "error", Type.var "value" ] - ] - (Type.namedWith - [ "BackendTask" ] - "BackendTask" - [ Type.var "error", Type.var "value" ] - ) - ) - } - , showStep = - Elm.value - { importFrom = [ "Pages", "Script", "Spinner" ] - , name = "showStep" - , annotation = - Just - (Type.function - [ Type.namedWith - [ "Pages", "Script", "Spinner" ] - "Options" - [ Type.var "error", Type.var "value" ] - ] - (Type.namedWith - [ "BackendTask" ] - "BackendTask" - [ Type.var "error" - , Type.namedWith - [ "Pages", "Script", "Spinner" ] - "Spinner" - [ Type.var "error", Type.var "value" ] - ] - ) - ) - } - , runSpinnerWithTask = - Elm.value - { importFrom = [ "Pages", "Script", "Spinner" ] - , name = "runSpinnerWithTask" - , annotation = - Just - (Type.function - [ Type.namedWith - [ "Pages", "Script", "Spinner" ] - "Spinner" - [ Type.var "error", Type.var "value" ] - , Type.namedWith - [ "BackendTask" ] - "BackendTask" - [ Type.var "error", Type.var "value" ] - ] - (Type.namedWith - [ "BackendTask" ] - "BackendTask" - [ Type.var "error", Type.var "value" ] - ) - ) - } - } \ No newline at end of file diff --git a/elm-open-api-codegen/src/Gen/Pages/Url.elm b/elm-open-api-codegen/src/Gen/Pages/Url.elm deleted file mode 100644 index afb27878..00000000 --- a/elm-open-api-codegen/src/Gen/Pages/Url.elm +++ /dev/null @@ -1,228 +0,0 @@ -module Gen.Pages.Url exposing - ( moduleName_, external, fromPath, toAbsoluteUrl, toString, annotation_ - , call_, values_ - ) - -{-| -# Generated bindings for Pages.Url - -@docs moduleName_, external, fromPath, toAbsoluteUrl, toString, annotation_ -@docs call_, values_ --} - - -import Elm -import Elm.Annotation as Type - - -{-| The name of this module. -} -moduleName_ : List String -moduleName_ = - [ "Pages", "Url" ] - - -{-| external: String -> Pages.Url.Url -} -external : String -> Elm.Expression -external externalArg_ = - Elm.apply - (Elm.value - { importFrom = [ "Pages", "Url" ] - , name = "external" - , annotation = - Just - (Type.function - [ Type.string ] - (Type.namedWith [ "Pages", "Url" ] "Url" []) - ) - } - ) - [ Elm.string externalArg_ ] - - -{-| fromPath: UrlPath.UrlPath -> Pages.Url.Url -} -fromPath : Elm.Expression -> Elm.Expression -fromPath fromPathArg_ = - Elm.apply - (Elm.value - { importFrom = [ "Pages", "Url" ] - , name = "fromPath" - , annotation = - Just - (Type.function - [ Type.namedWith [ "UrlPath" ] "UrlPath" [] ] - (Type.namedWith [ "Pages", "Url" ] "Url" []) - ) - } - ) - [ fromPathArg_ ] - - -{-| toAbsoluteUrl: String -> Pages.Url.Url -> String -} -toAbsoluteUrl : String -> Elm.Expression -> Elm.Expression -toAbsoluteUrl toAbsoluteUrlArg_ toAbsoluteUrlArg_0 = - Elm.apply - (Elm.value - { importFrom = [ "Pages", "Url" ] - , name = "toAbsoluteUrl" - , annotation = - Just - (Type.function - [ Type.string - , Type.namedWith [ "Pages", "Url" ] "Url" [] - ] - Type.string - ) - } - ) - [ Elm.string toAbsoluteUrlArg_, toAbsoluteUrlArg_0 ] - - -{-| toString: Pages.Url.Url -> String -} -toString : Elm.Expression -> Elm.Expression -toString toStringArg_ = - Elm.apply - (Elm.value - { importFrom = [ "Pages", "Url" ] - , name = "toString" - , annotation = - Just - (Type.function - [ Type.namedWith [ "Pages", "Url" ] "Url" [] ] - Type.string - ) - } - ) - [ toStringArg_ ] - - -annotation_ : { url : Type.Annotation } -annotation_ = - { url = Type.namedWith [ "Pages", "Url" ] "Url" [] } - - -call_ : - { external : Elm.Expression -> Elm.Expression - , fromPath : Elm.Expression -> Elm.Expression - , toAbsoluteUrl : Elm.Expression -> Elm.Expression -> Elm.Expression - , toString : Elm.Expression -> Elm.Expression - } -call_ = - { external = - \externalArg_ -> - Elm.apply - (Elm.value - { importFrom = [ "Pages", "Url" ] - , name = "external" - , annotation = - Just - (Type.function - [ Type.string ] - (Type.namedWith [ "Pages", "Url" ] "Url" []) - ) - } - ) - [ externalArg_ ] - , fromPath = - \fromPathArg_ -> - Elm.apply - (Elm.value - { importFrom = [ "Pages", "Url" ] - , name = "fromPath" - , annotation = - Just - (Type.function - [ Type.namedWith [ "UrlPath" ] "UrlPath" [] ] - (Type.namedWith [ "Pages", "Url" ] "Url" []) - ) - } - ) - [ fromPathArg_ ] - , toAbsoluteUrl = - \toAbsoluteUrlArg_ toAbsoluteUrlArg_0 -> - Elm.apply - (Elm.value - { importFrom = [ "Pages", "Url" ] - , name = "toAbsoluteUrl" - , annotation = - Just - (Type.function - [ Type.string - , Type.namedWith [ "Pages", "Url" ] "Url" [] - ] - Type.string - ) - } - ) - [ toAbsoluteUrlArg_, toAbsoluteUrlArg_0 ] - , toString = - \toStringArg_ -> - Elm.apply - (Elm.value - { importFrom = [ "Pages", "Url" ] - , name = "toString" - , annotation = - Just - (Type.function - [ Type.namedWith [ "Pages", "Url" ] "Url" [] ] - Type.string - ) - } - ) - [ toStringArg_ ] - } - - -values_ : - { external : Elm.Expression - , fromPath : Elm.Expression - , toAbsoluteUrl : Elm.Expression - , toString : Elm.Expression - } -values_ = - { external = - Elm.value - { importFrom = [ "Pages", "Url" ] - , name = "external" - , annotation = - Just - (Type.function - [ Type.string ] - (Type.namedWith [ "Pages", "Url" ] "Url" []) - ) - } - , fromPath = - Elm.value - { importFrom = [ "Pages", "Url" ] - , name = "fromPath" - , annotation = - Just - (Type.function - [ Type.namedWith [ "UrlPath" ] "UrlPath" [] ] - (Type.namedWith [ "Pages", "Url" ] "Url" []) - ) - } - , toAbsoluteUrl = - Elm.value - { importFrom = [ "Pages", "Url" ] - , name = "toAbsoluteUrl" - , annotation = - Just - (Type.function - [ Type.string - , Type.namedWith [ "Pages", "Url" ] "Url" [] - ] - Type.string - ) - } - , toString = - Elm.value - { importFrom = [ "Pages", "Url" ] - , name = "toString" - , annotation = - Just - (Type.function - [ Type.namedWith [ "Pages", "Url" ] "Url" [] ] - Type.string - ) - } - } \ No newline at end of file diff --git a/elm-open-api-codegen/src/Gen/PagesMsg.elm b/elm-open-api-codegen/src/Gen/PagesMsg.elm deleted file mode 100644 index 0f7dea25..00000000 --- a/elm-open-api-codegen/src/Gen/PagesMsg.elm +++ /dev/null @@ -1,250 +0,0 @@ -module Gen.PagesMsg exposing - ( moduleName_, fromMsg, map, noOp, annotation_, call_ - , values_ - ) - -{-| -# Generated bindings for PagesMsg - -@docs moduleName_, fromMsg, map, noOp, annotation_, call_ -@docs values_ --} - - -import Elm -import Elm.Annotation as Type - - -{-| The name of this module. -} -moduleName_ : List String -moduleName_ = - [ "PagesMsg" ] - - -{-| import Form - import Pages.Form - import PagesMsg exposing (PagesMsg) - - type Msg - = ToggleMenu - - view : - Maybe PageUrl - -> Shared.Model - -> Model - -> App Data ActionData RouteParams - -> View (PagesMsg Msg) - view maybeUrl sharedModel model app = - { title = "My Page" - , view = - [ button - -- we need to wrap our Route module's `Msg` here so we have a `PagesMsg Msg` - [ onClick (PagesMsg.fromMsg ToggleMenu) ] - [] - - -- `Pages.Form.renderHtml` gives us `Html (PagesMsg msg)`, so we don't need to wrap its Msg type - , logoutForm - |> Pages.Form.renderHtml [] - Pages.Form.Serial - (Form.options "logout" - |> Form.withOnSubmit (\_ -> NewItemSubmitted) - ) - app - ] - } - -fromMsg: userMsg -> PagesMsg.PagesMsg userMsg --} -fromMsg : Elm.Expression -> Elm.Expression -fromMsg fromMsgArg_ = - Elm.apply - (Elm.value - { importFrom = [ "PagesMsg" ] - , name = "fromMsg" - , annotation = - Just - (Type.function - [ Type.var "userMsg" ] - (Type.namedWith - [ "PagesMsg" ] - "PagesMsg" - [ Type.var "userMsg" ] - ) - ) - } - ) - [ fromMsgArg_ ] - - -{-| map: (a -> b) -> PagesMsg.PagesMsg a -> PagesMsg.PagesMsg b -} -map : (Elm.Expression -> Elm.Expression) -> Elm.Expression -> Elm.Expression -map mapArg_ mapArg_0 = - Elm.apply - (Elm.value - { importFrom = [ "PagesMsg" ] - , name = "map" - , annotation = - Just - (Type.function - [ Type.function [ Type.var "a" ] (Type.var "b") - , Type.namedWith - [ "PagesMsg" ] - "PagesMsg" - [ Type.var "a" ] - ] - (Type.namedWith - [ "PagesMsg" ] - "PagesMsg" - [ Type.var "b" ] - ) - ) - } - ) - [ Elm.functionReduced "mapUnpack" mapArg_, mapArg_0 ] - - -{-| A Msg that is handled by the elm-pages framework and does nothing. Helpful for when you don't want to register a callback. - - import Browser.Dom as Dom - import PagesMsg exposing (PagesMsg) - import Task - - resetViewport : Cmd (PagesMsg msg) - resetViewport = - Dom.setViewport 0 0 - |> Task.perform (\() -> PagesMsg.noOp) - -noOp: PagesMsg.PagesMsg userMsg --} -noOp : Elm.Expression -noOp = - Elm.value - { importFrom = [ "PagesMsg" ] - , name = "noOp" - , annotation = - Just - (Type.namedWith [ "PagesMsg" ] "PagesMsg" [ Type.var "userMsg" ] - ) - } - - -annotation_ : { pagesMsg : Type.Annotation -> Type.Annotation } -annotation_ = - { pagesMsg = - \pagesMsgArg0 -> - Type.alias - moduleName_ - "PagesMsg" - [ pagesMsgArg0 ] - (Type.namedWith - [ "Pages", "Internal", "Msg" ] - "Msg" - [ Type.var "userMsg" ] - ) - } - - -call_ : - { fromMsg : Elm.Expression -> Elm.Expression - , map : Elm.Expression -> Elm.Expression -> Elm.Expression - } -call_ = - { fromMsg = - \fromMsgArg_ -> - Elm.apply - (Elm.value - { importFrom = [ "PagesMsg" ] - , name = "fromMsg" - , annotation = - Just - (Type.function - [ Type.var "userMsg" ] - (Type.namedWith - [ "PagesMsg" ] - "PagesMsg" - [ Type.var "userMsg" ] - ) - ) - } - ) - [ fromMsgArg_ ] - , map = - \mapArg_ mapArg_0 -> - Elm.apply - (Elm.value - { importFrom = [ "PagesMsg" ] - , name = "map" - , annotation = - Just - (Type.function - [ Type.function - [ Type.var "a" ] - (Type.var "b") - , Type.namedWith - [ "PagesMsg" ] - "PagesMsg" - [ Type.var "a" ] - ] - (Type.namedWith - [ "PagesMsg" ] - "PagesMsg" - [ Type.var "b" ] - ) - ) - } - ) - [ mapArg_, mapArg_0 ] - } - - -values_ : - { fromMsg : Elm.Expression, map : Elm.Expression, noOp : Elm.Expression } -values_ = - { fromMsg = - Elm.value - { importFrom = [ "PagesMsg" ] - , name = "fromMsg" - , annotation = - Just - (Type.function - [ Type.var "userMsg" ] - (Type.namedWith - [ "PagesMsg" ] - "PagesMsg" - [ Type.var "userMsg" ] - ) - ) - } - , map = - Elm.value - { importFrom = [ "PagesMsg" ] - , name = "map" - , annotation = - Just - (Type.function - [ Type.function [ Type.var "a" ] (Type.var "b") - , Type.namedWith - [ "PagesMsg" ] - "PagesMsg" - [ Type.var "a" ] - ] - (Type.namedWith - [ "PagesMsg" ] - "PagesMsg" - [ Type.var "b" ] - ) - ) - } - , noOp = - Elm.value - { importFrom = [ "PagesMsg" ] - , name = "noOp" - , annotation = - Just - (Type.namedWith - [ "PagesMsg" ] - "PagesMsg" - [ Type.var "userMsg" ] - ) - } - } \ No newline at end of file diff --git a/elm-open-api-codegen/src/Gen/Parser.elm b/elm-open-api-codegen/src/Gen/Parser.elm deleted file mode 100644 index 742e4994..00000000 --- a/elm-open-api-codegen/src/Gen/Parser.elm +++ /dev/null @@ -1,3210 +0,0 @@ -module Gen.Parser exposing - ( moduleName_, run, int, float, number, symbol - , keyword, variable, end, succeed, lazy, andThen, problem - , oneOf, map, backtrackable, commit, token, sequence, loop - , spaces, lineComment, multiComment, getChompedString, chompIf, chompWhile, chompUntil - , chompUntilEndOr, mapChompedString, deadEndsToString, withIndent, getIndent, getPosition, getRow - , getCol, getOffset, getSource, annotation_, make_, caseOf_, call_ - , values_ - ) - -{-| -# Generated bindings for Parser - -@docs moduleName_, run, int, float, number, symbol -@docs keyword, variable, end, succeed, lazy, andThen -@docs problem, oneOf, map, backtrackable, commit, token -@docs sequence, loop, spaces, lineComment, multiComment, getChompedString -@docs chompIf, chompWhile, chompUntil, chompUntilEndOr, mapChompedString, deadEndsToString -@docs withIndent, getIndent, getPosition, getRow, getCol, getOffset -@docs getSource, annotation_, make_, caseOf_, call_, values_ --} - - -import Elm -import Elm.Annotation as Type -import Elm.Arg -import Elm.Case - - -{-| The name of this module. -} -moduleName_ : List String -moduleName_ = - [ "Parser" ] - - -{-| Try a parser. Here are some examples using the [`keyword`](#keyword) -parser: - - run (keyword "true") "true" == Ok () - run (keyword "true") "True" == Err ... - run (keyword "true") "false" == Err ... - run (keyword "true") "true!" == Ok () - -Notice the last case! A `Parser` will chomp as much as possible and not worry -about the rest. Use the [`end`](#end) parser to ensure you made it to the end -of the string! - -run: Parser.Parser a -> String -> Result.Result (List Parser.DeadEnd) a --} -run : Elm.Expression -> String -> Elm.Expression -run runArg_ runArg_0 = - Elm.apply - (Elm.value - { importFrom = [ "Parser" ] - , name = "run" - , annotation = - Just - (Type.function - [ Type.namedWith - [ "Parser" ] - "Parser" - [ Type.var "a" ] - , Type.string - ] - (Type.namedWith - [ "Result" ] - "Result" - [ Type.list - (Type.namedWith [ "Parser" ] "DeadEnd" []) - , Type.var "a" - ] - ) - ) - } - ) - [ runArg_, Elm.string runArg_0 ] - - -{-| Parse integers. - - run int "1" == Ok 1 - run int "1234" == Ok 1234 - - run int "-789" == Err ... - run int "0123" == Err ... - run int "1.34" == Err ... - run int "1e31" == Err ... - run int "123a" == Err ... - run int "0x1A" == Err ... - -If you want to handle a leading `+` or `-` you should do it with a custom -parser like this: - - myInt : Parser Int - myInt = - oneOf - [ succeed negate - |. symbol "-" - |= int - , int - ] - -**Note:** If you want a parser for both `Int` and `Float` literals, check out -[`number`](#number) below. It will be faster than using `oneOf` to combining -`int` and `float` yourself. - -int: Parser.Parser Int --} -int : Elm.Expression -int = - Elm.value - { importFrom = [ "Parser" ] - , name = "int" - , annotation = Just (Type.namedWith [ "Parser" ] "Parser" [ Type.int ]) - } - - -{-| Parse floats. - - run float "123" == Ok 123 - run float "3.1415" == Ok 3.1415 - run float "0.1234" == Ok 0.1234 - run float ".1234" == Ok 0.1234 - run float "1e-42" == Ok 1e-42 - run float "6.022e23" == Ok 6.022e23 - run float "6.022E23" == Ok 6.022e23 - run float "6.022e+23" == Ok 6.022e23 - -If you want to disable literals like `.123` (like in Elm) you could write -something like this: - - elmFloat : Parser Float - elmFloat = - oneOf - [ symbol "." - |. problem "floating point numbers must start with a digit, like 0.25" - , float - ] - -**Note:** If you want a parser for both `Int` and `Float` literals, check out -[`number`](#number) below. It will be faster than using `oneOf` to combining -`int` and `float` yourself. - -float: Parser.Parser Float --} -float : Elm.Expression -float = - Elm.value - { importFrom = [ "Parser" ] - , name = "float" - , annotation = - Just (Type.namedWith [ "Parser" ] "Parser" [ Type.float ]) - } - - -{-| Parse a bunch of different kinds of numbers without backtracking. A parser -for Elm would need to handle integers, floats, and hexadecimal like this: - - type Expr - = Variable String - | Int Int - | Float Float - | Apply Expr Expr - - elmNumber : Parser Expr - elmNumber = - number - { int = Just Int - , hex = Just Int -- 0x001A is allowed - , octal = Nothing -- 0o0731 is not - , binary = Nothing -- 0b1101 is not - , float = Just Float - } - -If you wanted to implement the [`float`](#float) parser, it would be like this: - - float : Parser Float - float = - number - { int = Just toFloat - , hex = Nothing - , octal = Nothing - , binary = Nothing - , float = Just identity - } - -Notice that it actually is processing `int` results! This is because `123` -looks like an integer to me, but maybe it looks like a float to you. If you had -`int = Nothing`, floats would need a decimal like `1.0` in every case. If you -like explicitness, that may actually be preferable! - -**Note:** This function does not check for weird trailing characters in the -current implementation, so parsing `123abc` can succeed up to `123` and then -move on. This is helpful for people who want to parse things like `40px` or -`3m`, but it requires a bit of extra code to rule out trailing characters in -other cases. - -number: - { int : Maybe (Int -> a) - , hex : Maybe (Int -> a) - , octal : Maybe (Int -> a) - , binary : Maybe (Int -> a) - , float : Maybe (Float -> a) - } - -> Parser.Parser a --} -number : - { int : Elm.Expression - , hex : Elm.Expression - , octal : Elm.Expression - , binary : Elm.Expression - , float : Elm.Expression - } - -> Elm.Expression -number numberArg_ = - Elm.apply - (Elm.value - { importFrom = [ "Parser" ] - , name = "number" - , annotation = - Just - (Type.function - [ Type.record - [ ( "int" - , Type.maybe - (Type.function [ Type.int ] (Type.var "a")) - ) - , ( "hex" - , Type.maybe - (Type.function [ Type.int ] (Type.var "a")) - ) - , ( "octal" - , Type.maybe - (Type.function [ Type.int ] (Type.var "a")) - ) - , ( "binary" - , Type.maybe - (Type.function [ Type.int ] (Type.var "a")) - ) - , ( "float" - , Type.maybe - (Type.function [ Type.float ] (Type.var "a") - ) - ) - ] - ] - (Type.namedWith [ "Parser" ] "Parser" [ Type.var "a" ] - ) - ) - } - ) - [ Elm.record - [ Tuple.pair "int" numberArg_.int - , Tuple.pair "hex" numberArg_.hex - , Tuple.pair "octal" numberArg_.octal - , Tuple.pair "binary" numberArg_.binary - , Tuple.pair "float" numberArg_.float - ] - ] - - -{-| Parse symbols like `(` and `,`. - - run (symbol "[") "[" == Ok () - run (symbol "[") "4" == Err ... (ExpectingSymbol "[") ... - -**Note:** This is good for stuff like brackets and semicolons, but it probably -should not be used for binary operators like `+` and `-` because you can find -yourself in weird situations. For example, is `3--4` a typo? Or is it `3 - -4`? -I have had better luck with `chompWhile isSymbol` and sorting out which -operator it is afterwards. - -symbol: String -> Parser.Parser () --} -symbol : String -> Elm.Expression -symbol symbolArg_ = - Elm.apply - (Elm.value - { importFrom = [ "Parser" ] - , name = "symbol" - , annotation = - Just - (Type.function - [ Type.string ] - (Type.namedWith [ "Parser" ] "Parser" [ Type.unit ]) - ) - } - ) - [ Elm.string symbolArg_ ] - - -{-| Parse keywords like `let`, `case`, and `type`. - - run (keyword "let") "let" == Ok () - run (keyword "let") "var" == Err ... (ExpectingKeyword "let") ... - run (keyword "let") "letters" == Err ... (ExpectingKeyword "let") ... - -**Note:** Notice the third case there! `keyword` actually looks ahead one -character to make sure it is not a letter, number, or underscore. The goal is -to help with parsers like this: - - succeed identity - |. keyword "let" - |. spaces - |= elmVar - |. spaces - |. symbol "=" - -The trouble is that `spaces` may chomp zero characters (to handle expressions -like `[1,2]` and `[ 1 , 2 ]`) and in this case, it would mean `letters` could -be parsed as `let ters` and then wonder where the equals sign is! Check out the -[`token`](#token) docs if you need to customize this! - -keyword: String -> Parser.Parser () --} -keyword : String -> Elm.Expression -keyword keywordArg_ = - Elm.apply - (Elm.value - { importFrom = [ "Parser" ] - , name = "keyword" - , annotation = - Just - (Type.function - [ Type.string ] - (Type.namedWith [ "Parser" ] "Parser" [ Type.unit ]) - ) - } - ) - [ Elm.string keywordArg_ ] - - -{-| Create a parser for variables. If we wanted to parse type variables in Elm, -we could try something like this: - - import Char - import Parser exposing (..) - import Set - - typeVar : Parser String - typeVar = - variable - { start = Char.isLower - , inner = \c -> Char.isAlphaNum c || c == '_' - , reserved = Set.fromList [ "let", "in", "case", "of" ] - } - -This is saying it _must_ start with a lower-case character. After that, -characters can be letters, numbers, or underscores. It is also saying that if -you run into any of these reserved names, it is definitely not a variable. - -variable: - { start : Char.Char -> Bool - , inner : Char.Char -> Bool - , reserved : Set.Set String - } - -> Parser.Parser String --} -variable : - { start : Elm.Expression -> Elm.Expression - , inner : Elm.Expression -> Elm.Expression - , reserved : Elm.Expression - } - -> Elm.Expression -variable variableArg_ = - Elm.apply - (Elm.value - { importFrom = [ "Parser" ] - , name = "variable" - , annotation = - Just - (Type.function - [ Type.record - [ ( "start" - , Type.function [ Type.char ] Type.bool - ) - , ( "inner" - , Type.function [ Type.char ] Type.bool - ) - , ( "reserved" - , Type.namedWith [ "Set" ] "Set" [ Type.string ] - ) - ] - ] - (Type.namedWith [ "Parser" ] "Parser" [ Type.string ]) - ) - } - ) - [ Elm.record - [ Tuple.pair - "start" - (Elm.functionReduced "variableUnpack" variableArg_.start) - , Tuple.pair - "inner" - (Elm.functionReduced "variableUnpack" variableArg_.inner) - , Tuple.pair "reserved" variableArg_.reserved - ] - ] - - -{-| Check if you have reached the end of the string you are parsing. - - justAnInt : Parser Int - justAnInt = - succeed identity - |= int - |. end - - -- run justAnInt "90210" == Ok 90210 - -- run justAnInt "1 + 2" == Err ... - -- run int "1 + 2" == Ok 1 - -Parsers can succeed without parsing the whole string. Ending your parser -with `end` guarantees that you have successfully parsed the whole string. - -end: Parser.Parser () --} -end : Elm.Expression -end = - Elm.value - { importFrom = [ "Parser" ] - , name = "end" - , annotation = Just (Type.namedWith [ "Parser" ] "Parser" [ Type.unit ]) - } - - -{-| A parser that succeeds without chomping any characters. - - run (succeed 90210 ) "mississippi" == Ok 90210 - run (succeed 3.141 ) "mississippi" == Ok 3.141 - run (succeed () ) "mississippi" == Ok () - run (succeed Nothing) "mississippi" == Ok Nothing - -Seems weird on its own, but it is very useful in combination with other -functions. The docs for [`(|=)`](#|=) and [`andThen`](#andThen) have some neat -examples. - -succeed: a -> Parser.Parser a --} -succeed : Elm.Expression -> Elm.Expression -succeed succeedArg_ = - Elm.apply - (Elm.value - { importFrom = [ "Parser" ] - , name = "succeed" - , annotation = - Just - (Type.function - [ Type.var "a" ] - (Type.namedWith [ "Parser" ] "Parser" [ Type.var "a" ] - ) - ) - } - ) - [ succeedArg_ ] - - -{-| Helper to define recursive parsers. Say we want a parser for simple -boolean expressions: - - true - false - (true || false) - (true || (true || false)) - -Notice that a boolean expression might contain *other* boolean expressions. -That means we will want to define our parser in terms of itself: - - type Boolean - = MyTrue - | MyFalse - | MyOr Boolean Boolean - - boolean : Parser Boolean - boolean = - oneOf - [ succeed MyTrue - |. keyword "true" - , succeed MyFalse - |. keyword "false" - , succeed MyOr - |. symbol "(" - |. spaces - |= lazy (\_ -> boolean) - |. spaces - |. symbol "||" - |. spaces - |= lazy (\_ -> boolean) - |. spaces - |. symbol ")" - ] - -**Notice that `boolean` uses `boolean` in its definition!** In Elm, you can -only define a value in terms of itself it is behind a function call. So -`lazy` helps us define these self-referential parsers. (`andThen` can be used -for this as well!) - -lazy: (() -> Parser.Parser a) -> Parser.Parser a --} -lazy : (Elm.Expression -> Elm.Expression) -> Elm.Expression -lazy lazyArg_ = - Elm.apply - (Elm.value - { importFrom = [ "Parser" ] - , name = "lazy" - , annotation = - Just - (Type.function - [ Type.function - [ Type.unit ] - (Type.namedWith - [ "Parser" ] - "Parser" - [ Type.var "a" ] - ) - ] - (Type.namedWith [ "Parser" ] "Parser" [ Type.var "a" ] - ) - ) - } - ) - [ Elm.functionReduced "lazyUnpack" lazyArg_ ] - - -{-| Parse one thing `andThen` parse another thing. This is useful when you want -to check on what you just parsed. For example, maybe you want U.S. zip codes -and `int` is not suitable because it does not allow leading zeros. You could -say: - - zipCode : Parser String - zipCode = - getChompedString (chompWhile Char.isDigit) - |> andThen checkZipCode - - checkZipCode : String -> Parser String - checkZipCode code = - if String.length code == 5 then - succeed code - else - problem "a U.S. zip code has exactly 5 digits" - -First we chomp digits `andThen` we check if it is a valid U.S. zip code. We -`succeed` if it has exactly five digits and report a `problem` if not. - -Check out [`examples/DoubleQuoteString.elm`](https://github.com/elm/parser/blob/master/examples/DoubleQuoteString.elm) -for another example, this time using `andThen` to verify unicode code points. - -**Note:** If you are using `andThen` recursively and blowing the stack, check -out the [`loop`](#loop) function to limit stack usage. - -andThen: (a -> Parser.Parser b) -> Parser.Parser a -> Parser.Parser b --} -andThen : (Elm.Expression -> Elm.Expression) -> Elm.Expression -> Elm.Expression -andThen andThenArg_ andThenArg_0 = - Elm.apply - (Elm.value - { importFrom = [ "Parser" ] - , name = "andThen" - , annotation = - Just - (Type.function - [ Type.function - [ Type.var "a" ] - (Type.namedWith - [ "Parser" ] - "Parser" - [ Type.var "b" ] - ) - , Type.namedWith - [ "Parser" ] - "Parser" - [ Type.var "a" ] - ] - (Type.namedWith [ "Parser" ] "Parser" [ Type.var "b" ] - ) - ) - } - ) - [ Elm.functionReduced "andThenUnpack" andThenArg_, andThenArg_0 ] - - -{-| Indicate that a parser has reached a dead end. "Everything was going fine -until I ran into this problem." Check out the [`andThen`](#andThen) docs to see -an example usage. - -problem: String -> Parser.Parser a --} -problem : String -> Elm.Expression -problem problemArg_ = - Elm.apply - (Elm.value - { importFrom = [ "Parser" ] - , name = "problem" - , annotation = - Just - (Type.function - [ Type.string ] - (Type.namedWith [ "Parser" ] "Parser" [ Type.var "a" ] - ) - ) - } - ) - [ Elm.string problemArg_ ] - - -{-| If you are parsing JSON, the values can be strings, floats, booleans, -arrays, objects, or null. You need a way to pick `oneOf` them! Here is a -sample of what that code might look like: - - type Json - = Number Float - | Boolean Bool - | Null - - json : Parser Json - json = - oneOf - [ map Number float - , map (\_ -> Boolean True) (keyword "true") - , map (\_ -> Boolean False) (keyword "false") - , map (\_ -> Null) keyword "null" - ] - -This parser will keep trying parsers until `oneOf` them starts chomping -characters. Once a path is chosen, it does not come back and try the others. - -**Note:** I highly recommend reading [this document][semantics] to learn how -`oneOf` and `backtrackable` interact. It is subtle and important! - -[semantics]: https://github.com/elm/parser/blob/master/semantics.md - -oneOf: List (Parser.Parser a) -> Parser.Parser a --} -oneOf : List Elm.Expression -> Elm.Expression -oneOf oneOfArg_ = - Elm.apply - (Elm.value - { importFrom = [ "Parser" ] - , name = "oneOf" - , annotation = - Just - (Type.function - [ Type.list - (Type.namedWith - [ "Parser" ] - "Parser" - [ Type.var "a" ] - ) - ] - (Type.namedWith [ "Parser" ] "Parser" [ Type.var "a" ] - ) - ) - } - ) - [ Elm.list oneOfArg_ ] - - -{-| Transform the result of a parser. Maybe you have a value that is -an integer or `null`: - - nullOrInt : Parser (Maybe Int) - nullOrInt = - oneOf - [ map Just int - , map (\_ -> Nothing) (keyword "null") - ] - - -- run nullOrInt "0" == Ok (Just 0) - -- run nullOrInt "13" == Ok (Just 13) - -- run nullOrInt "null" == Ok Nothing - -- run nullOrInt "zero" == Err ... - -map: (a -> b) -> Parser.Parser a -> Parser.Parser b --} -map : (Elm.Expression -> Elm.Expression) -> Elm.Expression -> Elm.Expression -map mapArg_ mapArg_0 = - Elm.apply - (Elm.value - { importFrom = [ "Parser" ] - , name = "map" - , annotation = - Just - (Type.function - [ Type.function [ Type.var "a" ] (Type.var "b") - , Type.namedWith - [ "Parser" ] - "Parser" - [ Type.var "a" ] - ] - (Type.namedWith [ "Parser" ] "Parser" [ Type.var "b" ] - ) - ) - } - ) - [ Elm.functionReduced "mapUnpack" mapArg_, mapArg_0 ] - - -{-| It is quite tricky to use `backtrackable` well! It can be very useful, but -also can degrade performance and error message quality. - -Read [this document](https://github.com/elm/parser/blob/master/semantics.md) -to learn how `oneOf`, `backtrackable`, and `commit` work and interact with -each other. It is subtle and important! - -backtrackable: Parser.Parser a -> Parser.Parser a --} -backtrackable : Elm.Expression -> Elm.Expression -backtrackable backtrackableArg_ = - Elm.apply - (Elm.value - { importFrom = [ "Parser" ] - , name = "backtrackable" - , annotation = - Just - (Type.function - [ Type.namedWith - [ "Parser" ] - "Parser" - [ Type.var "a" ] - ] - (Type.namedWith [ "Parser" ] "Parser" [ Type.var "a" ] - ) - ) - } - ) - [ backtrackableArg_ ] - - -{-| `commit` is almost always paired with `backtrackable` in some way, and it -is tricky to use well. - -Read [this document](https://github.com/elm/parser/blob/master/semantics.md) -to learn how `oneOf`, `backtrackable`, and `commit` work and interact with -each other. It is subtle and important! - -commit: a -> Parser.Parser a --} -commit : Elm.Expression -> Elm.Expression -commit commitArg_ = - Elm.apply - (Elm.value - { importFrom = [ "Parser" ] - , name = "commit" - , annotation = - Just - (Type.function - [ Type.var "a" ] - (Type.namedWith [ "Parser" ] "Parser" [ Type.var "a" ] - ) - ) - } - ) - [ commitArg_ ] - - -{-| Parse exactly the given string, without any regard to what comes next. - -A potential pitfall when parsing keywords is getting tricked by variables that -start with a keyword, like `let` in `letters` or `import` in `important`. This -is especially likely if you have a whitespace parser that can consume zero -charcters. So the [`keyword`](#keyword) parser is defined with `token` and a -trick to peek ahead a bit: - - keyword : String -> Parser () - keyword kwd = - succeed identity - |. backtrackable (token kwd) - |= oneOf - [ map (\_ -> True) (backtrackable (chompIf isVarChar)) - , succeed False - ] - |> andThen (checkEnding kwd) - - checkEnding : String -> Bool -> Parser () - checkEnding kwd isBadEnding = - if isBadEnding then - problem ("expecting the `" ++ kwd ++ "` keyword") - else - commit () - - isVarChar : Char -> Bool - isVarChar char = - Char.isAlphaNum char || char == '_' - -This definition is specially designed so that (1) if you really see `let` you -commit to that path and (2) if you see `letters` instead you can backtrack and -try other options. If I had just put a `backtrackable` around the whole thing -you would not get (1) anymore. - -token: String -> Parser.Parser () --} -token : String -> Elm.Expression -token tokenArg_ = - Elm.apply - (Elm.value - { importFrom = [ "Parser" ] - , name = "token" - , annotation = - Just - (Type.function - [ Type.string ] - (Type.namedWith [ "Parser" ] "Parser" [ Type.unit ]) - ) - } - ) - [ Elm.string tokenArg_ ] - - -{-| Handle things like lists and records, but you can customize the details -however you need. Say you want to parse C-style code blocks: - - import Parser exposing (Parser, Trailing(..)) - - block : Parser (List Stmt) - block = - Parser.sequence - { start = "{" - , separator = ";" - , end = "}" - , spaces = spaces - , item = statement - , trailing = Mandatory -- demand a trailing semi-colon - } - - -- statement : Parser Stmt - -**Note:** If you need something more custom, do not be afraid to check -out the implementation and customize it for your case. It is better to -get nice error messages with a lower-level implementation than to try -to hack high-level parsers to do things they are not made for. - -sequence: - { start : String - , separator : String - , end : String - , spaces : Parser.Parser () - , item : Parser.Parser a - , trailing : Parser.Trailing - } - -> Parser.Parser (List a) --} -sequence : - { start : String - , separator : String - , end : String - , spaces : Elm.Expression - , item : Elm.Expression - , trailing : Elm.Expression - } - -> Elm.Expression -sequence sequenceArg_ = - Elm.apply - (Elm.value - { importFrom = [ "Parser" ] - , name = "sequence" - , annotation = - Just - (Type.function - [ Type.record - [ ( "start", Type.string ) - , ( "separator", Type.string ) - , ( "end", Type.string ) - , ( "spaces" - , Type.namedWith - [ "Parser" ] - "Parser" - [ Type.unit ] - ) - , ( "item" - , Type.namedWith - [ "Parser" ] - "Parser" - [ Type.var "a" ] - ) - , ( "trailing" - , Type.namedWith [ "Parser" ] "Trailing" [] - ) - ] - ] - (Type.namedWith - [ "Parser" ] - "Parser" - [ Type.list (Type.var "a") ] - ) - ) - } - ) - [ Elm.record - [ Tuple.pair "start" (Elm.string sequenceArg_.start) - , Tuple.pair "separator" (Elm.string sequenceArg_.separator) - , Tuple.pair "end" (Elm.string sequenceArg_.end) - , Tuple.pair "spaces" sequenceArg_.spaces - , Tuple.pair "item" sequenceArg_.item - , Tuple.pair "trailing" sequenceArg_.trailing - ] - ] - - -{-| A parser that can loop indefinitely. This can be helpful when parsing -repeated structures, like a bunch of statements: - - statements : Parser (List Stmt) - statements = - loop [] statementsHelp - - statementsHelp : List Stmt -> Parser (Step (List Stmt) (List Stmt)) - statementsHelp revStmts = - oneOf - [ succeed (\stmt -> Loop (stmt :: revStmts)) - |= statement - |. spaces - |. symbol ";" - |. spaces - , succeed () - |> map (\_ -> Done (List.reverse revStmts)) - ] - - -- statement : Parser Stmt - -Notice that the statements are tracked in reverse as we `Loop`, and we reorder -them only once we are `Done`. This is a very common pattern with `loop`! - -Check out [`examples/DoubleQuoteString.elm`](https://github.com/elm/parser/blob/master/examples/DoubleQuoteString.elm) -for another example. - -**IMPORTANT NOTE:** Parsers like `succeed ()` and `chompWhile Char.isAlpha` can -succeed without consuming any characters. So in some cases you may want to use -[`getOffset`](#getOffset) to ensure that each step actually consumed characters. -Otherwise you could end up in an infinite loop! - -**Note:** Anything you can write with `loop`, you can also write as a parser -that chomps some characters `andThen` calls itself with new arguments. The -problem with calling `andThen` recursively is that it grows the stack, so you -cannot do it indefinitely. So `loop` is important because enables tail-call -elimination, allowing you to parse however many repeats you want. - -loop: state -> (state -> Parser.Parser (Parser.Step state a)) -> Parser.Parser a --} -loop : Elm.Expression -> (Elm.Expression -> Elm.Expression) -> Elm.Expression -loop loopArg_ loopArg_0 = - Elm.apply - (Elm.value - { importFrom = [ "Parser" ] - , name = "loop" - , annotation = - Just - (Type.function - [ Type.var "state" - , Type.function - [ Type.var "state" ] - (Type.namedWith - [ "Parser" ] - "Parser" - [ Type.namedWith - [ "Parser" ] - "Step" - [ Type.var "state", Type.var "a" ] - ] - ) - ] - (Type.namedWith [ "Parser" ] "Parser" [ Type.var "a" ] - ) - ) - } - ) - [ loopArg_, Elm.functionReduced "loopUnpack" loopArg_0 ] - - -{-| Parse zero or more `' '`, `'\n'`, and `'\r'` characters. - -The implementation is pretty simple: - - spaces : Parser () - spaces = - chompWhile (\c -> c == ' ' || c == '\n' || c == '\r') - -So if you need something different (like tabs) just define an alternative with -the necessary tweaks! Check out [`lineComment`](#lineComment) and -[`multiComment`](#multiComment) for more complex situations. - -spaces: Parser.Parser () --} -spaces : Elm.Expression -spaces = - Elm.value - { importFrom = [ "Parser" ] - , name = "spaces" - , annotation = Just (Type.namedWith [ "Parser" ] "Parser" [ Type.unit ]) - } - - -{-| Parse single-line comments: - - elm : Parser () - elm = - lineComment "--" - - js : Parser () - js = - lineComment "//" - - python : Parser () - python = - lineComment "#" - -This parser is defined like this: - - lineComment : String -> Parser () - lineComment str = - symbol str - |. chompUntilEndOr "\n" - -So it will consume the remainder of the line. If the file ends before you see -a newline, that is fine too. - -lineComment: String -> Parser.Parser () --} -lineComment : String -> Elm.Expression -lineComment lineCommentArg_ = - Elm.apply - (Elm.value - { importFrom = [ "Parser" ] - , name = "lineComment" - , annotation = - Just - (Type.function - [ Type.string ] - (Type.namedWith [ "Parser" ] "Parser" [ Type.unit ]) - ) - } - ) - [ Elm.string lineCommentArg_ ] - - -{-| Parse multi-line comments. So if you wanted to parse Elm whitespace or -JS whitespace, you could say: - - elm : Parser () - elm = - loop 0 <| ifProgress <| - oneOf - [ lineComment "--" - , multiComment "{-" "-}" Nestable - , spaces - ] - - js : Parser () - js = - loop 0 <| ifProgress <| - oneOf - [ lineComment "//" - , multiComment "/*" "*/" NotNestable - , chompWhile (\c -> c == ' ' || c == '\n' || c == '\r' || c == '\t') - ] - - ifProgress : Parser a -> Int -> Parser (Step Int ()) - ifProgress parser offset = - succeed identity - |. parser - |= getOffset - |> map (\newOffset -> if offset == newOffset then Done () else Loop newOffset) - -**Note:** The fact that `spaces` comes last in the definition of `elm` is very -important! It can succeed without consuming any characters, so if it were the -first option, it would always succeed and bypass the others! (Same is true of -`chompWhile` in `js`.) This possibility of success without consumption is also -why wee need the `ifProgress` helper. It detects if there is no more whitespace -to consume. - -multiComment: String -> String -> Parser.Nestable -> Parser.Parser () --} -multiComment : String -> String -> Elm.Expression -> Elm.Expression -multiComment multiCommentArg_ multiCommentArg_0 multiCommentArg_1 = - Elm.apply - (Elm.value - { importFrom = [ "Parser" ] - , name = "multiComment" - , annotation = - Just - (Type.function - [ Type.string - , Type.string - , Type.namedWith [ "Parser" ] "Nestable" [] - ] - (Type.namedWith [ "Parser" ] "Parser" [ Type.unit ]) - ) - } - ) - [ Elm.string multiCommentArg_ - , Elm.string multiCommentArg_0 - , multiCommentArg_1 - ] - - -{-| Sometimes parsers like `int` or `variable` cannot do exactly what you -need. The "chomping" family of functions is meant for that case! Maybe you -need to parse [valid PHP variables][php] like `$x` and `$txt`: - - php : Parser String - php = - getChompedString <| - succeed () - |. chompIf (\c -> c == '$') - |. chompIf (\c -> Char.isAlpha c || c == '_') - |. chompWhile (\c -> Char.isAlphaNum c || c == '_') - -The idea is that you create a bunch of chompers that validate the underlying -characters. Then `getChompedString` extracts the underlying `String` efficiently. - -**Note:** Maybe it is helpful to see how you can use [`getOffset`](#getOffset) -and [`getSource`](#getSource) to implement this function: - - getChompedString : Parser a -> Parser String - getChompedString parser = - succeed String.slice - |= getOffset - |. parser - |= getOffset - |= getSource - -[php]: https://www.w3schools.com/php/php_variables.asp - -getChompedString: Parser.Parser a -> Parser.Parser String --} -getChompedString : Elm.Expression -> Elm.Expression -getChompedString getChompedStringArg_ = - Elm.apply - (Elm.value - { importFrom = [ "Parser" ] - , name = "getChompedString" - , annotation = - Just - (Type.function - [ Type.namedWith - [ "Parser" ] - "Parser" - [ Type.var "a" ] - ] - (Type.namedWith [ "Parser" ] "Parser" [ Type.string ]) - ) - } - ) - [ getChompedStringArg_ ] - - -{-| Chomp one character if it passes the test. - - chompUpper : Parser () - chompUpper = - chompIf Char.isUpper - -So this can chomp a character like `T` and produces a `()` value. - -chompIf: (Char.Char -> Bool) -> Parser.Parser () --} -chompIf : (Elm.Expression -> Elm.Expression) -> Elm.Expression -chompIf chompIfArg_ = - Elm.apply - (Elm.value - { importFrom = [ "Parser" ] - , name = "chompIf" - , annotation = - Just - (Type.function - [ Type.function [ Type.char ] Type.bool ] - (Type.namedWith [ "Parser" ] "Parser" [ Type.unit ]) - ) - } - ) - [ Elm.functionReduced "chompIfUnpack" chompIfArg_ ] - - -{-| Chomp zero or more characters if they pass the test. This is commonly -useful for chomping whitespace or variable names: - - whitespace : Parser () - whitespace = - chompWhile (\c -> c == ' ' || c == '\t' || c == '\n' || c == '\r') - - elmVar : Parser String - elmVar = - getChompedString <| - succeed () - |. chompIf Char.isLower - |. chompWhile (\c -> Char.isAlphaNum c || c == '_') - -**Note:** a `chompWhile` parser always succeeds! This can lead to tricky -situations, especially if you define your whitespace with it. In that case, -you could accidentally interpret `letx` as the keyword `let` followed by -"spaces" followed by the variable `x`. This is why the `keyword` and `number` -parsers peek ahead, making sure they are not followed by anything unexpected. - -chompWhile: (Char.Char -> Bool) -> Parser.Parser () --} -chompWhile : (Elm.Expression -> Elm.Expression) -> Elm.Expression -chompWhile chompWhileArg_ = - Elm.apply - (Elm.value - { importFrom = [ "Parser" ] - , name = "chompWhile" - , annotation = - Just - (Type.function - [ Type.function [ Type.char ] Type.bool ] - (Type.namedWith [ "Parser" ] "Parser" [ Type.unit ]) - ) - } - ) - [ Elm.functionReduced "chompWhileUnpack" chompWhileArg_ ] - - -{-| Chomp until you see a certain string. You could define C-style multi-line -comments like this: - - comment : Parser () - comment = - symbol "/*" - |. chompUntil "*/" - -I recommend using [`multiComment`](#multiComment) for this particular scenario -though. It can be trickier than it looks! - -chompUntil: String -> Parser.Parser () --} -chompUntil : String -> Elm.Expression -chompUntil chompUntilArg_ = - Elm.apply - (Elm.value - { importFrom = [ "Parser" ] - , name = "chompUntil" - , annotation = - Just - (Type.function - [ Type.string ] - (Type.namedWith [ "Parser" ] "Parser" [ Type.unit ]) - ) - } - ) - [ Elm.string chompUntilArg_ ] - - -{-| Chomp until you see a certain string or until you run out of characters to -chomp! You could define single-line comments like this: - - elm : Parser () - elm = - symbol "--" - |. chompUntilEndOr "\n" - -A file may end with a single-line comment, so the file can end before you see -a newline. Tricky! - -I recommend just using [`lineComment`](#lineComment) for this particular -scenario. - -chompUntilEndOr: String -> Parser.Parser () --} -chompUntilEndOr : String -> Elm.Expression -chompUntilEndOr chompUntilEndOrArg_ = - Elm.apply - (Elm.value - { importFrom = [ "Parser" ] - , name = "chompUntilEndOr" - , annotation = - Just - (Type.function - [ Type.string ] - (Type.namedWith [ "Parser" ] "Parser" [ Type.unit ]) - ) - } - ) - [ Elm.string chompUntilEndOrArg_ ] - - -{-| This works just like [`getChompedString`](#getChompedString) but gives -a bit more flexibility. For example, maybe you want to parse Elm doc comments -and get (1) the full comment and (2) all of the names listed in the docs. - -You could implement `mapChompedString` like this: - - mapChompedString : (String -> a -> b) -> Parser a -> Parser String - mapChompedString func parser = - succeed (\start value end src -> func (String.slice start end src) value) - |= getOffset - |= parser - |= getOffset - |= getSource - -mapChompedString: (String -> a -> b) -> Parser.Parser a -> Parser.Parser b --} -mapChompedString : - (Elm.Expression -> Elm.Expression -> Elm.Expression) - -> Elm.Expression - -> Elm.Expression -mapChompedString mapChompedStringArg_ mapChompedStringArg_0 = - Elm.apply - (Elm.value - { importFrom = [ "Parser" ] - , name = "mapChompedString" - , annotation = - Just - (Type.function - [ Type.function - [ Type.string, Type.var "a" ] - (Type.var "b") - , Type.namedWith - [ "Parser" ] - "Parser" - [ Type.var "a" ] - ] - (Type.namedWith [ "Parser" ] "Parser" [ Type.var "b" ] - ) - ) - } - ) - [ Elm.functionReduced - "mapChompedStringUnpack" - (\functionReducedUnpack -> - Elm.functionReduced - "unpack" - (mapChompedStringArg_ functionReducedUnpack) - ) - , mapChompedStringArg_0 - ] - - -{-| Turn all the `DeadEnd` data into a string that is easier for people to -read. - -**Note:** This is just a baseline of quality. It cannot do anything with colors. -It is not interactivite. It just turns the raw data into strings. I really hope -folks will check out the source code for some inspiration on how to turn errors -into `Html` with nice colors and interaction! The `Parser.Advanced` module lets -you work with context as well, which really unlocks another level of quality! -The "context" technique is how the Elm compiler can say "I think I am parsing a -list, so I was expecting a closing `]` here." Telling users what the parser -_thinks_ is happening can be really helpful! - -deadEndsToString: List Parser.DeadEnd -> String --} -deadEndsToString : List Elm.Expression -> Elm.Expression -deadEndsToString deadEndsToStringArg_ = - Elm.apply - (Elm.value - { importFrom = [ "Parser" ] - , name = "deadEndsToString" - , annotation = - Just - (Type.function - [ Type.list (Type.namedWith [ "Parser" ] "DeadEnd" []) - ] - Type.string - ) - } - ) - [ Elm.list deadEndsToStringArg_ ] - - -{-| Some languages are indentation sensitive. Python cares about tabs. Elm -cares about spaces sometimes. `withIndent` and `getIndent` allow you to manage -"indentation state" yourself, however is necessary in your scenario. - -withIndent: Int -> Parser.Parser a -> Parser.Parser a --} -withIndent : Int -> Elm.Expression -> Elm.Expression -withIndent withIndentArg_ withIndentArg_0 = - Elm.apply - (Elm.value - { importFrom = [ "Parser" ] - , name = "withIndent" - , annotation = - Just - (Type.function - [ Type.int - , Type.namedWith - [ "Parser" ] - "Parser" - [ Type.var "a" ] - ] - (Type.namedWith [ "Parser" ] "Parser" [ Type.var "a" ] - ) - ) - } - ) - [ Elm.int withIndentArg_, withIndentArg_0 ] - - -{-| When someone said `withIndent` earlier, what number did they put in there? - -- `getIndent` results in `0`, the default value -- `withIndent 4 getIndent` results in `4` - -So you are just asking about things you said earlier. These numbers do not leak -out of `withIndent`, so say we have: - - succeed Tuple.pair - |= withIndent 4 getIndent - |= getIndent - -Assuming there are no `withIndent` above this, you would get `(4,0)` from this. - -getIndent: Parser.Parser Int --} -getIndent : Elm.Expression -getIndent = - Elm.value - { importFrom = [ "Parser" ] - , name = "getIndent" - , annotation = Just (Type.namedWith [ "Parser" ] "Parser" [ Type.int ]) - } - - -{-| Code editors treat code like a grid, with rows and columns. The start is -`row=1` and `col=1`. As you chomp characters, the `col` increments. When you -run into a `\n` character, the `row` increments and `col` goes back to `1`. - -In the Elm compiler, I track the start and end position of every expression -like this: - - type alias Located a = - { start : (Int, Int) - , value : a - , end : (Int, Int) - } - - located : Parser a -> Parser (Located a) - located parser = - succeed Located - |= getPosition - |= parser - |= getPosition - -So if there is a problem during type inference, I use this saved position -information to underline the exact problem! - -**Note:** Tabs count as one character, so if you are parsing something like -Python, I recommend sorting that out *after* parsing. So if I wanted the `^^^^` -underline like in Elm, I would find the `row` in the source code and do -something like this: - - makeUnderline : String -> Int -> Int -> String - makeUnderline row minCol maxCol = - String.toList row - |> List.indexedMap (toUnderlineChar minCol maxCol) - |> String.fromList - - toUnderlineChar : Int -> Int -> Int -> Char -> Char - toUnderlineChar minCol maxCol col char = - if minCol <= col && col <= maxCol then - '^' - else if char == '\t' then - '\t' - else - ' ' - -So it would preserve any tabs from the source line. There are tons of other -ways to do this though. The point is just that you handle the tabs after -parsing but before anyone looks at the numbers in a context where tabs may -equal 2, 4, or 8. - -getPosition: Parser.Parser ( Int, Int ) --} -getPosition : Elm.Expression -getPosition = - Elm.value - { importFrom = [ "Parser" ] - , name = "getPosition" - , annotation = - Just - (Type.namedWith - [ "Parser" ] - "Parser" - [ Type.tuple Type.int Type.int ] - ) - } - - -{-| This is a more efficient version of `map Tuple.first getPosition`. Maybe -you just want to track the line number for some reason? This lets you do that. - -See [`getPosition`](#getPosition) for an explanation of rows and columns. - -getRow: Parser.Parser Int --} -getRow : Elm.Expression -getRow = - Elm.value - { importFrom = [ "Parser" ] - , name = "getRow" - , annotation = Just (Type.namedWith [ "Parser" ] "Parser" [ Type.int ]) - } - - -{-| This is a more efficient version of `map Tuple.second getPosition`. This -can be useful in combination with [`withIndent`](#withIndent) and -[`getIndent`](#getIndent), like this: - - checkIndent : Parser () - checkIndent = - succeed (\indent column -> indent <= column) - |= getIndent - |= getCol - |> andThen checkIndentHelp - - checkIndentHelp : Bool -> Parser () - checkIndentHelp isIndented = - if isIndented then - succeed () - else - problem "expecting more spaces" - -So the `checkIndent` parser only succeeds when you are "deeper" than the -current indent level. You could use this to parse Elm-style `let` expressions. - -getCol: Parser.Parser Int --} -getCol : Elm.Expression -getCol = - Elm.value - { importFrom = [ "Parser" ] - , name = "getCol" - , annotation = Just (Type.namedWith [ "Parser" ] "Parser" [ Type.int ]) - } - - -{-| Editors think of code as a grid, but behind the scenes it is just a flat -array of UTF-16 characters. `getOffset` tells you your index in that flat -array. So if you chomp `"\n\n\n\n"` you are on row 5, column 1, and offset 4. - -**Note:** JavaScript uses a somewhat odd version of UTF-16 strings, so a single -character may take two slots. So in JavaScript, `'abc'.length === 3` but -`'🙈🙉🙊'.length === 6`. Try it out! And since Elm runs in JavaScript, the offset -moves by those rules. - -getOffset: Parser.Parser Int --} -getOffset : Elm.Expression -getOffset = - Elm.value - { importFrom = [ "Parser" ] - , name = "getOffset" - , annotation = Just (Type.namedWith [ "Parser" ] "Parser" [ Type.int ]) - } - - -{-| Get the full string that is being parsed. You could use this to define -`getChompedString` or `mapChompedString` if you wanted: - - getChompedString : Parser a -> Parser String - getChompedString parser = - succeed String.slice - |= getOffset - |. parser - |= getOffset - |= getSource - -getSource: Parser.Parser String --} -getSource : Elm.Expression -getSource = - Elm.value - { importFrom = [ "Parser" ] - , name = "getSource" - , annotation = - Just (Type.namedWith [ "Parser" ] "Parser" [ Type.string ]) - } - - -annotation_ : - { parser : Type.Annotation -> Type.Annotation - , trailing : Type.Annotation - , step : Type.Annotation -> Type.Annotation -> Type.Annotation - , nestable : Type.Annotation - , deadEnd : Type.Annotation - , problem : Type.Annotation - } -annotation_ = - { parser = - \parserArg0 -> - Type.alias - moduleName_ - "Parser" - [ parserArg0 ] - (Type.namedWith - [ "Parser", "Advanced" ] - "Parser" - [ Type.namedWith [ "Basics" ] "Never" [] - , Type.namedWith [ "Parser" ] "Problem" [] - , Type.var "a" - ] - ) - , trailing = Type.namedWith [ "Parser" ] "Trailing" [] - , step = - \stepArg0 stepArg1 -> - Type.namedWith [ "Parser" ] "Step" [ stepArg0, stepArg1 ] - , nestable = Type.namedWith [ "Parser" ] "Nestable" [] - , deadEnd = - Type.alias - moduleName_ - "DeadEnd" - [] - (Type.record - [ ( "row", Type.int ) - , ( "col", Type.int ) - , ( "problem", Type.namedWith [ "Parser" ] "Problem" [] ) - ] - ) - , problem = Type.namedWith [ "Parser" ] "Problem" [] - } - - -make_ : - { forbidden : Elm.Expression - , optional : Elm.Expression - , mandatory : Elm.Expression - , loop : Elm.Expression -> Elm.Expression - , done : Elm.Expression -> Elm.Expression - , notNestable : Elm.Expression - , nestable : Elm.Expression - , deadEnd : - { row : Elm.Expression, col : Elm.Expression, problem : Elm.Expression } - -> Elm.Expression - , expecting : Elm.Expression -> Elm.Expression - , expectingInt : Elm.Expression - , expectingHex : Elm.Expression - , expectingOctal : Elm.Expression - , expectingBinary : Elm.Expression - , expectingFloat : Elm.Expression - , expectingNumber : Elm.Expression - , expectingVariable : Elm.Expression - , expectingSymbol : Elm.Expression -> Elm.Expression - , expectingKeyword : Elm.Expression -> Elm.Expression - , expectingEnd : Elm.Expression - , unexpectedChar : Elm.Expression - , problem : Elm.Expression -> Elm.Expression - , badRepeat : Elm.Expression - } -make_ = - { forbidden = - Elm.value - { importFrom = [ "Parser" ] - , name = "Forbidden" - , annotation = Just (Type.namedWith [] "Trailing" []) - } - , optional = - Elm.value - { importFrom = [ "Parser" ] - , name = "Optional" - , annotation = Just (Type.namedWith [] "Trailing" []) - } - , mandatory = - Elm.value - { importFrom = [ "Parser" ] - , name = "Mandatory" - , annotation = Just (Type.namedWith [] "Trailing" []) - } - , loop = - \ar0 -> - Elm.apply - (Elm.value - { importFrom = [ "Parser" ] - , name = "Loop" - , annotation = - Just - (Type.namedWith - [] - "Step" - [ Type.var "state", Type.var "a" ] - ) - } - ) - [ ar0 ] - , done = - \ar0 -> - Elm.apply - (Elm.value - { importFrom = [ "Parser" ] - , name = "Done" - , annotation = - Just - (Type.namedWith - [] - "Step" - [ Type.var "state", Type.var "a" ] - ) - } - ) - [ ar0 ] - , notNestable = - Elm.value - { importFrom = [ "Parser" ] - , name = "NotNestable" - , annotation = Just (Type.namedWith [] "Nestable" []) - } - , nestable = - Elm.value - { importFrom = [ "Parser" ] - , name = "Nestable" - , annotation = Just (Type.namedWith [] "Nestable" []) - } - , deadEnd = - \deadEnd_args -> - Elm.withType - (Type.alias - [ "Parser" ] - "DeadEnd" - [] - (Type.record - [ ( "row", Type.int ) - , ( "col", Type.int ) - , ( "problem" - , Type.namedWith [ "Parser" ] "Problem" [] - ) - ] - ) - ) - (Elm.record - [ Tuple.pair "row" deadEnd_args.row - , Tuple.pair "col" deadEnd_args.col - , Tuple.pair "problem" deadEnd_args.problem - ] - ) - , expecting = - \ar0 -> - Elm.apply - (Elm.value - { importFrom = [ "Parser" ] - , name = "Expecting" - , annotation = Just (Type.namedWith [] "Problem" []) - } - ) - [ ar0 ] - , expectingInt = - Elm.value - { importFrom = [ "Parser" ] - , name = "ExpectingInt" - , annotation = Just (Type.namedWith [] "Problem" []) - } - , expectingHex = - Elm.value - { importFrom = [ "Parser" ] - , name = "ExpectingHex" - , annotation = Just (Type.namedWith [] "Problem" []) - } - , expectingOctal = - Elm.value - { importFrom = [ "Parser" ] - , name = "ExpectingOctal" - , annotation = Just (Type.namedWith [] "Problem" []) - } - , expectingBinary = - Elm.value - { importFrom = [ "Parser" ] - , name = "ExpectingBinary" - , annotation = Just (Type.namedWith [] "Problem" []) - } - , expectingFloat = - Elm.value - { importFrom = [ "Parser" ] - , name = "ExpectingFloat" - , annotation = Just (Type.namedWith [] "Problem" []) - } - , expectingNumber = - Elm.value - { importFrom = [ "Parser" ] - , name = "ExpectingNumber" - , annotation = Just (Type.namedWith [] "Problem" []) - } - , expectingVariable = - Elm.value - { importFrom = [ "Parser" ] - , name = "ExpectingVariable" - , annotation = Just (Type.namedWith [] "Problem" []) - } - , expectingSymbol = - \ar0 -> - Elm.apply - (Elm.value - { importFrom = [ "Parser" ] - , name = "ExpectingSymbol" - , annotation = Just (Type.namedWith [] "Problem" []) - } - ) - [ ar0 ] - , expectingKeyword = - \ar0 -> - Elm.apply - (Elm.value - { importFrom = [ "Parser" ] - , name = "ExpectingKeyword" - , annotation = Just (Type.namedWith [] "Problem" []) - } - ) - [ ar0 ] - , expectingEnd = - Elm.value - { importFrom = [ "Parser" ] - , name = "ExpectingEnd" - , annotation = Just (Type.namedWith [] "Problem" []) - } - , unexpectedChar = - Elm.value - { importFrom = [ "Parser" ] - , name = "UnexpectedChar" - , annotation = Just (Type.namedWith [] "Problem" []) - } - , problem = - \ar0 -> - Elm.apply - (Elm.value - { importFrom = [ "Parser" ] - , name = "Problem" - , annotation = Just (Type.namedWith [] "Problem" []) - } - ) - [ ar0 ] - , badRepeat = - Elm.value - { importFrom = [ "Parser" ] - , name = "BadRepeat" - , annotation = Just (Type.namedWith [] "Problem" []) - } - } - - -caseOf_ : - { trailing : - Elm.Expression - -> { forbidden : Elm.Expression - , optional : Elm.Expression - , mandatory : Elm.Expression - } - -> Elm.Expression - , step : - Elm.Expression - -> { loop : Elm.Expression -> Elm.Expression - , done : Elm.Expression -> Elm.Expression - } - -> Elm.Expression - , nestable : - Elm.Expression - -> { notNestable : Elm.Expression, nestable : Elm.Expression } - -> Elm.Expression - , problem : - Elm.Expression - -> { expecting : Elm.Expression -> Elm.Expression - , expectingInt : Elm.Expression - , expectingHex : Elm.Expression - , expectingOctal : Elm.Expression - , expectingBinary : Elm.Expression - , expectingFloat : Elm.Expression - , expectingNumber : Elm.Expression - , expectingVariable : Elm.Expression - , expectingSymbol : Elm.Expression -> Elm.Expression - , expectingKeyword : Elm.Expression -> Elm.Expression - , expectingEnd : Elm.Expression - , unexpectedChar : Elm.Expression - , problem : Elm.Expression -> Elm.Expression - , badRepeat : Elm.Expression - } - -> Elm.Expression - } -caseOf_ = - { trailing = - \trailingExpression trailingTags -> - Elm.Case.custom - trailingExpression - (Type.namedWith [ "Parser" ] "Trailing" []) - [ Elm.Case.branch - (Elm.Arg.customType "Forbidden" trailingTags.forbidden) - Basics.identity - , Elm.Case.branch - (Elm.Arg.customType "Optional" trailingTags.optional) - Basics.identity - , Elm.Case.branch - (Elm.Arg.customType "Mandatory" trailingTags.mandatory) - Basics.identity - ] - , step = - \stepExpression stepTags -> - Elm.Case.custom - stepExpression - (Type.namedWith - [ "Parser" ] - "Step" - [ Type.var "state", Type.var "a" ] - ) - [ Elm.Case.branch - (Elm.Arg.customType "Loop" stepTags.loop |> Elm.Arg.item - (Elm.Arg.varWith - "state" - (Type.var - "state" - ) - ) - ) - Basics.identity - , Elm.Case.branch - (Elm.Arg.customType "Done" stepTags.done |> Elm.Arg.item - (Elm.Arg.varWith - "a" - (Type.var - "a" - ) - ) - ) - Basics.identity - ] - , nestable = - \nestableExpression nestableTags -> - Elm.Case.custom - nestableExpression - (Type.namedWith [ "Parser" ] "Nestable" []) - [ Elm.Case.branch - (Elm.Arg.customType "NotNestable" nestableTags.notNestable) - Basics.identity - , Elm.Case.branch - (Elm.Arg.customType "Nestable" nestableTags.nestable) - Basics.identity - ] - , problem = - \problemExpression problemTags -> - Elm.Case.custom - problemExpression - (Type.namedWith [ "Parser" ] "Problem" []) - [ Elm.Case.branch - (Elm.Arg.customType - "Expecting" - problemTags.expecting |> Elm.Arg.item - (Elm.Arg.varWith - "arg_0" - Type.string - ) - ) - Basics.identity - , Elm.Case.branch - (Elm.Arg.customType "ExpectingInt" problemTags.expectingInt) - Basics.identity - , Elm.Case.branch - (Elm.Arg.customType "ExpectingHex" problemTags.expectingHex) - Basics.identity - , Elm.Case.branch - (Elm.Arg.customType - "ExpectingOctal" - problemTags.expectingOctal - ) - Basics.identity - , Elm.Case.branch - (Elm.Arg.customType - "ExpectingBinary" - problemTags.expectingBinary - ) - Basics.identity - , Elm.Case.branch - (Elm.Arg.customType - "ExpectingFloat" - problemTags.expectingFloat - ) - Basics.identity - , Elm.Case.branch - (Elm.Arg.customType - "ExpectingNumber" - problemTags.expectingNumber - ) - Basics.identity - , Elm.Case.branch - (Elm.Arg.customType - "ExpectingVariable" - problemTags.expectingVariable - ) - Basics.identity - , Elm.Case.branch - (Elm.Arg.customType - "ExpectingSymbol" - problemTags.expectingSymbol |> Elm.Arg.item - (Elm.Arg.varWith - "arg_0" - Type.string - ) - ) - Basics.identity - , Elm.Case.branch - (Elm.Arg.customType - "ExpectingKeyword" - problemTags.expectingKeyword |> Elm.Arg.item - (Elm.Arg.varWith - "arg_0" - Type.string - ) - ) - Basics.identity - , Elm.Case.branch - (Elm.Arg.customType "ExpectingEnd" problemTags.expectingEnd) - Basics.identity - , Elm.Case.branch - (Elm.Arg.customType - "UnexpectedChar" - problemTags.unexpectedChar - ) - Basics.identity - , Elm.Case.branch - (Elm.Arg.customType - "Problem" - problemTags.problem |> Elm.Arg.item - (Elm.Arg.varWith - "arg_0" - Type.string - ) - ) - Basics.identity - , Elm.Case.branch - (Elm.Arg.customType "BadRepeat" problemTags.badRepeat) - Basics.identity - ] - } - - -call_ : - { run : Elm.Expression -> Elm.Expression -> Elm.Expression - , number : Elm.Expression -> Elm.Expression - , symbol : Elm.Expression -> Elm.Expression - , keyword : Elm.Expression -> Elm.Expression - , variable : Elm.Expression -> Elm.Expression - , succeed : Elm.Expression -> Elm.Expression - , lazy : Elm.Expression -> Elm.Expression - , andThen : Elm.Expression -> Elm.Expression -> Elm.Expression - , problem : Elm.Expression -> Elm.Expression - , oneOf : Elm.Expression -> Elm.Expression - , map : Elm.Expression -> Elm.Expression -> Elm.Expression - , backtrackable : Elm.Expression -> Elm.Expression - , commit : Elm.Expression -> Elm.Expression - , token : Elm.Expression -> Elm.Expression - , sequence : Elm.Expression -> Elm.Expression - , loop : Elm.Expression -> Elm.Expression -> Elm.Expression - , lineComment : Elm.Expression -> Elm.Expression - , multiComment : - Elm.Expression -> Elm.Expression -> Elm.Expression -> Elm.Expression - , getChompedString : Elm.Expression -> Elm.Expression - , chompIf : Elm.Expression -> Elm.Expression - , chompWhile : Elm.Expression -> Elm.Expression - , chompUntil : Elm.Expression -> Elm.Expression - , chompUntilEndOr : Elm.Expression -> Elm.Expression - , mapChompedString : Elm.Expression -> Elm.Expression -> Elm.Expression - , deadEndsToString : Elm.Expression -> Elm.Expression - , withIndent : Elm.Expression -> Elm.Expression -> Elm.Expression - } -call_ = - { run = - \runArg_ runArg_0 -> - Elm.apply - (Elm.value - { importFrom = [ "Parser" ] - , name = "run" - , annotation = - Just - (Type.function - [ Type.namedWith - [ "Parser" ] - "Parser" - [ Type.var "a" ] - , Type.string - ] - (Type.namedWith - [ "Result" ] - "Result" - [ Type.list - (Type.namedWith - [ "Parser" ] - "DeadEnd" - [] - ) - , Type.var "a" - ] - ) - ) - } - ) - [ runArg_, runArg_0 ] - , number = - \numberArg_ -> - Elm.apply - (Elm.value - { importFrom = [ "Parser" ] - , name = "number" - , annotation = - Just - (Type.function - [ Type.record - [ ( "int" - , Type.maybe - (Type.function - [ Type.int ] - (Type.var "a") - ) - ) - , ( "hex" - , Type.maybe - (Type.function - [ Type.int ] - (Type.var "a") - ) - ) - , ( "octal" - , Type.maybe - (Type.function - [ Type.int ] - (Type.var "a") - ) - ) - , ( "binary" - , Type.maybe - (Type.function - [ Type.int ] - (Type.var "a") - ) - ) - , ( "float" - , Type.maybe - (Type.function - [ Type.float ] - (Type.var "a") - ) - ) - ] - ] - (Type.namedWith - [ "Parser" ] - "Parser" - [ Type.var "a" ] - ) - ) - } - ) - [ numberArg_ ] - , symbol = - \symbolArg_ -> - Elm.apply - (Elm.value - { importFrom = [ "Parser" ] - , name = "symbol" - , annotation = - Just - (Type.function - [ Type.string ] - (Type.namedWith - [ "Parser" ] - "Parser" - [ Type.unit ] - ) - ) - } - ) - [ symbolArg_ ] - , keyword = - \keywordArg_ -> - Elm.apply - (Elm.value - { importFrom = [ "Parser" ] - , name = "keyword" - , annotation = - Just - (Type.function - [ Type.string ] - (Type.namedWith - [ "Parser" ] - "Parser" - [ Type.unit ] - ) - ) - } - ) - [ keywordArg_ ] - , variable = - \variableArg_ -> - Elm.apply - (Elm.value - { importFrom = [ "Parser" ] - , name = "variable" - , annotation = - Just - (Type.function - [ Type.record - [ ( "start" - , Type.function [ Type.char ] Type.bool - ) - , ( "inner" - , Type.function [ Type.char ] Type.bool - ) - , ( "reserved" - , Type.namedWith - [ "Set" ] - "Set" - [ Type.string ] - ) - ] - ] - (Type.namedWith - [ "Parser" ] - "Parser" - [ Type.string ] - ) - ) - } - ) - [ variableArg_ ] - , succeed = - \succeedArg_ -> - Elm.apply - (Elm.value - { importFrom = [ "Parser" ] - , name = "succeed" - , annotation = - Just - (Type.function - [ Type.var "a" ] - (Type.namedWith - [ "Parser" ] - "Parser" - [ Type.var "a" ] - ) - ) - } - ) - [ succeedArg_ ] - , lazy = - \lazyArg_ -> - Elm.apply - (Elm.value - { importFrom = [ "Parser" ] - , name = "lazy" - , annotation = - Just - (Type.function - [ Type.function - [ Type.unit ] - (Type.namedWith - [ "Parser" ] - "Parser" - [ Type.var "a" ] - ) - ] - (Type.namedWith - [ "Parser" ] - "Parser" - [ Type.var "a" ] - ) - ) - } - ) - [ lazyArg_ ] - , andThen = - \andThenArg_ andThenArg_0 -> - Elm.apply - (Elm.value - { importFrom = [ "Parser" ] - , name = "andThen" - , annotation = - Just - (Type.function - [ Type.function - [ Type.var "a" ] - (Type.namedWith - [ "Parser" ] - "Parser" - [ Type.var "b" ] - ) - , Type.namedWith - [ "Parser" ] - "Parser" - [ Type.var "a" ] - ] - (Type.namedWith - [ "Parser" ] - "Parser" - [ Type.var "b" ] - ) - ) - } - ) - [ andThenArg_, andThenArg_0 ] - , problem = - \problemArg_ -> - Elm.apply - (Elm.value - { importFrom = [ "Parser" ] - , name = "problem" - , annotation = - Just - (Type.function - [ Type.string ] - (Type.namedWith - [ "Parser" ] - "Parser" - [ Type.var "a" ] - ) - ) - } - ) - [ problemArg_ ] - , oneOf = - \oneOfArg_ -> - Elm.apply - (Elm.value - { importFrom = [ "Parser" ] - , name = "oneOf" - , annotation = - Just - (Type.function - [ Type.list - (Type.namedWith - [ "Parser" ] - "Parser" - [ Type.var "a" ] - ) - ] - (Type.namedWith - [ "Parser" ] - "Parser" - [ Type.var "a" ] - ) - ) - } - ) - [ oneOfArg_ ] - , map = - \mapArg_ mapArg_0 -> - Elm.apply - (Elm.value - { importFrom = [ "Parser" ] - , name = "map" - , annotation = - Just - (Type.function - [ Type.function - [ Type.var "a" ] - (Type.var "b") - , Type.namedWith - [ "Parser" ] - "Parser" - [ Type.var "a" ] - ] - (Type.namedWith - [ "Parser" ] - "Parser" - [ Type.var "b" ] - ) - ) - } - ) - [ mapArg_, mapArg_0 ] - , backtrackable = - \backtrackableArg_ -> - Elm.apply - (Elm.value - { importFrom = [ "Parser" ] - , name = "backtrackable" - , annotation = - Just - (Type.function - [ Type.namedWith - [ "Parser" ] - "Parser" - [ Type.var "a" ] - ] - (Type.namedWith - [ "Parser" ] - "Parser" - [ Type.var "a" ] - ) - ) - } - ) - [ backtrackableArg_ ] - , commit = - \commitArg_ -> - Elm.apply - (Elm.value - { importFrom = [ "Parser" ] - , name = "commit" - , annotation = - Just - (Type.function - [ Type.var "a" ] - (Type.namedWith - [ "Parser" ] - "Parser" - [ Type.var "a" ] - ) - ) - } - ) - [ commitArg_ ] - , token = - \tokenArg_ -> - Elm.apply - (Elm.value - { importFrom = [ "Parser" ] - , name = "token" - , annotation = - Just - (Type.function - [ Type.string ] - (Type.namedWith - [ "Parser" ] - "Parser" - [ Type.unit ] - ) - ) - } - ) - [ tokenArg_ ] - , sequence = - \sequenceArg_ -> - Elm.apply - (Elm.value - { importFrom = [ "Parser" ] - , name = "sequence" - , annotation = - Just - (Type.function - [ Type.record - [ ( "start", Type.string ) - , ( "separator", Type.string ) - , ( "end", Type.string ) - , ( "spaces" - , Type.namedWith - [ "Parser" ] - "Parser" - [ Type.unit ] - ) - , ( "item" - , Type.namedWith - [ "Parser" ] - "Parser" - [ Type.var "a" ] - ) - , ( "trailing" - , Type.namedWith - [ "Parser" ] - "Trailing" - [] - ) - ] - ] - (Type.namedWith - [ "Parser" ] - "Parser" - [ Type.list (Type.var "a") ] - ) - ) - } - ) - [ sequenceArg_ ] - , loop = - \loopArg_ loopArg_0 -> - Elm.apply - (Elm.value - { importFrom = [ "Parser" ] - , name = "loop" - , annotation = - Just - (Type.function - [ Type.var "state" - , Type.function - [ Type.var "state" ] - (Type.namedWith - [ "Parser" ] - "Parser" - [ Type.namedWith - [ "Parser" ] - "Step" - [ Type.var "state" - , Type.var "a" - ] - ] - ) - ] - (Type.namedWith - [ "Parser" ] - "Parser" - [ Type.var "a" ] - ) - ) - } - ) - [ loopArg_, loopArg_0 ] - , lineComment = - \lineCommentArg_ -> - Elm.apply - (Elm.value - { importFrom = [ "Parser" ] - , name = "lineComment" - , annotation = - Just - (Type.function - [ Type.string ] - (Type.namedWith - [ "Parser" ] - "Parser" - [ Type.unit ] - ) - ) - } - ) - [ lineCommentArg_ ] - , multiComment = - \multiCommentArg_ multiCommentArg_0 multiCommentArg_1 -> - Elm.apply - (Elm.value - { importFrom = [ "Parser" ] - , name = "multiComment" - , annotation = - Just - (Type.function - [ Type.string - , Type.string - , Type.namedWith [ "Parser" ] "Nestable" [] - ] - (Type.namedWith - [ "Parser" ] - "Parser" - [ Type.unit ] - ) - ) - } - ) - [ multiCommentArg_, multiCommentArg_0, multiCommentArg_1 ] - , getChompedString = - \getChompedStringArg_ -> - Elm.apply - (Elm.value - { importFrom = [ "Parser" ] - , name = "getChompedString" - , annotation = - Just - (Type.function - [ Type.namedWith - [ "Parser" ] - "Parser" - [ Type.var "a" ] - ] - (Type.namedWith - [ "Parser" ] - "Parser" - [ Type.string ] - ) - ) - } - ) - [ getChompedStringArg_ ] - , chompIf = - \chompIfArg_ -> - Elm.apply - (Elm.value - { importFrom = [ "Parser" ] - , name = "chompIf" - , annotation = - Just - (Type.function - [ Type.function [ Type.char ] Type.bool ] - (Type.namedWith - [ "Parser" ] - "Parser" - [ Type.unit ] - ) - ) - } - ) - [ chompIfArg_ ] - , chompWhile = - \chompWhileArg_ -> - Elm.apply - (Elm.value - { importFrom = [ "Parser" ] - , name = "chompWhile" - , annotation = - Just - (Type.function - [ Type.function [ Type.char ] Type.bool ] - (Type.namedWith - [ "Parser" ] - "Parser" - [ Type.unit ] - ) - ) - } - ) - [ chompWhileArg_ ] - , chompUntil = - \chompUntilArg_ -> - Elm.apply - (Elm.value - { importFrom = [ "Parser" ] - , name = "chompUntil" - , annotation = - Just - (Type.function - [ Type.string ] - (Type.namedWith - [ "Parser" ] - "Parser" - [ Type.unit ] - ) - ) - } - ) - [ chompUntilArg_ ] - , chompUntilEndOr = - \chompUntilEndOrArg_ -> - Elm.apply - (Elm.value - { importFrom = [ "Parser" ] - , name = "chompUntilEndOr" - , annotation = - Just - (Type.function - [ Type.string ] - (Type.namedWith - [ "Parser" ] - "Parser" - [ Type.unit ] - ) - ) - } - ) - [ chompUntilEndOrArg_ ] - , mapChompedString = - \mapChompedStringArg_ mapChompedStringArg_0 -> - Elm.apply - (Elm.value - { importFrom = [ "Parser" ] - , name = "mapChompedString" - , annotation = - Just - (Type.function - [ Type.function - [ Type.string, Type.var "a" ] - (Type.var "b") - , Type.namedWith - [ "Parser" ] - "Parser" - [ Type.var "a" ] - ] - (Type.namedWith - [ "Parser" ] - "Parser" - [ Type.var "b" ] - ) - ) - } - ) - [ mapChompedStringArg_, mapChompedStringArg_0 ] - , deadEndsToString = - \deadEndsToStringArg_ -> - Elm.apply - (Elm.value - { importFrom = [ "Parser" ] - , name = "deadEndsToString" - , annotation = - Just - (Type.function - [ Type.list - (Type.namedWith [ "Parser" ] "DeadEnd" []) - ] - Type.string - ) - } - ) - [ deadEndsToStringArg_ ] - , withIndent = - \withIndentArg_ withIndentArg_0 -> - Elm.apply - (Elm.value - { importFrom = [ "Parser" ] - , name = "withIndent" - , annotation = - Just - (Type.function - [ Type.int - , Type.namedWith - [ "Parser" ] - "Parser" - [ Type.var "a" ] - ] - (Type.namedWith - [ "Parser" ] - "Parser" - [ Type.var "a" ] - ) - ) - } - ) - [ withIndentArg_, withIndentArg_0 ] - } - - -values_ : - { run : Elm.Expression - , int : Elm.Expression - , float : Elm.Expression - , number : Elm.Expression - , symbol : Elm.Expression - , keyword : Elm.Expression - , variable : Elm.Expression - , end : Elm.Expression - , succeed : Elm.Expression - , lazy : Elm.Expression - , andThen : Elm.Expression - , problem : Elm.Expression - , oneOf : Elm.Expression - , map : Elm.Expression - , backtrackable : Elm.Expression - , commit : Elm.Expression - , token : Elm.Expression - , sequence : Elm.Expression - , loop : Elm.Expression - , spaces : Elm.Expression - , lineComment : Elm.Expression - , multiComment : Elm.Expression - , getChompedString : Elm.Expression - , chompIf : Elm.Expression - , chompWhile : Elm.Expression - , chompUntil : Elm.Expression - , chompUntilEndOr : Elm.Expression - , mapChompedString : Elm.Expression - , deadEndsToString : Elm.Expression - , withIndent : Elm.Expression - , getIndent : Elm.Expression - , getPosition : Elm.Expression - , getRow : Elm.Expression - , getCol : Elm.Expression - , getOffset : Elm.Expression - , getSource : Elm.Expression - } -values_ = - { run = - Elm.value - { importFrom = [ "Parser" ] - , name = "run" - , annotation = - Just - (Type.function - [ Type.namedWith [ "Parser" ] "Parser" [ Type.var "a" ] - , Type.string - ] - (Type.namedWith - [ "Result" ] - "Result" - [ Type.list - (Type.namedWith [ "Parser" ] "DeadEnd" []) - , Type.var "a" - ] - ) - ) - } - , int = - Elm.value - { importFrom = [ "Parser" ] - , name = "int" - , annotation = - Just (Type.namedWith [ "Parser" ] "Parser" [ Type.int ]) - } - , float = - Elm.value - { importFrom = [ "Parser" ] - , name = "float" - , annotation = - Just (Type.namedWith [ "Parser" ] "Parser" [ Type.float ]) - } - , number = - Elm.value - { importFrom = [ "Parser" ] - , name = "number" - , annotation = - Just - (Type.function - [ Type.record - [ ( "int" - , Type.maybe - (Type.function [ Type.int ] (Type.var "a")) - ) - , ( "hex" - , Type.maybe - (Type.function [ Type.int ] (Type.var "a")) - ) - , ( "octal" - , Type.maybe - (Type.function [ Type.int ] (Type.var "a")) - ) - , ( "binary" - , Type.maybe - (Type.function [ Type.int ] (Type.var "a")) - ) - , ( "float" - , Type.maybe - (Type.function [ Type.float ] (Type.var "a")) - ) - ] - ] - (Type.namedWith [ "Parser" ] "Parser" [ Type.var "a" ]) - ) - } - , symbol = - Elm.value - { importFrom = [ "Parser" ] - , name = "symbol" - , annotation = - Just - (Type.function - [ Type.string ] - (Type.namedWith [ "Parser" ] "Parser" [ Type.unit ]) - ) - } - , keyword = - Elm.value - { importFrom = [ "Parser" ] - , name = "keyword" - , annotation = - Just - (Type.function - [ Type.string ] - (Type.namedWith [ "Parser" ] "Parser" [ Type.unit ]) - ) - } - , variable = - Elm.value - { importFrom = [ "Parser" ] - , name = "variable" - , annotation = - Just - (Type.function - [ Type.record - [ ( "start" - , Type.function [ Type.char ] Type.bool - ) - , ( "inner" - , Type.function [ Type.char ] Type.bool - ) - , ( "reserved" - , Type.namedWith [ "Set" ] "Set" [ Type.string ] - ) - ] - ] - (Type.namedWith [ "Parser" ] "Parser" [ Type.string ]) - ) - } - , end = - Elm.value - { importFrom = [ "Parser" ] - , name = "end" - , annotation = - Just (Type.namedWith [ "Parser" ] "Parser" [ Type.unit ]) - } - , succeed = - Elm.value - { importFrom = [ "Parser" ] - , name = "succeed" - , annotation = - Just - (Type.function - [ Type.var "a" ] - (Type.namedWith [ "Parser" ] "Parser" [ Type.var "a" ]) - ) - } - , lazy = - Elm.value - { importFrom = [ "Parser" ] - , name = "lazy" - , annotation = - Just - (Type.function - [ Type.function - [ Type.unit ] - (Type.namedWith - [ "Parser" ] - "Parser" - [ Type.var "a" ] - ) - ] - (Type.namedWith [ "Parser" ] "Parser" [ Type.var "a" ]) - ) - } - , andThen = - Elm.value - { importFrom = [ "Parser" ] - , name = "andThen" - , annotation = - Just - (Type.function - [ Type.function - [ Type.var "a" ] - (Type.namedWith - [ "Parser" ] - "Parser" - [ Type.var "b" ] - ) - , Type.namedWith [ "Parser" ] "Parser" [ Type.var "a" ] - ] - (Type.namedWith [ "Parser" ] "Parser" [ Type.var "b" ]) - ) - } - , problem = - Elm.value - { importFrom = [ "Parser" ] - , name = "problem" - , annotation = - Just - (Type.function - [ Type.string ] - (Type.namedWith [ "Parser" ] "Parser" [ Type.var "a" ]) - ) - } - , oneOf = - Elm.value - { importFrom = [ "Parser" ] - , name = "oneOf" - , annotation = - Just - (Type.function - [ Type.list - (Type.namedWith - [ "Parser" ] - "Parser" - [ Type.var "a" ] - ) - ] - (Type.namedWith [ "Parser" ] "Parser" [ Type.var "a" ]) - ) - } - , map = - Elm.value - { importFrom = [ "Parser" ] - , name = "map" - , annotation = - Just - (Type.function - [ Type.function [ Type.var "a" ] (Type.var "b") - , Type.namedWith [ "Parser" ] "Parser" [ Type.var "a" ] - ] - (Type.namedWith [ "Parser" ] "Parser" [ Type.var "b" ]) - ) - } - , backtrackable = - Elm.value - { importFrom = [ "Parser" ] - , name = "backtrackable" - , annotation = - Just - (Type.function - [ Type.namedWith [ "Parser" ] "Parser" [ Type.var "a" ] - ] - (Type.namedWith [ "Parser" ] "Parser" [ Type.var "a" ]) - ) - } - , commit = - Elm.value - { importFrom = [ "Parser" ] - , name = "commit" - , annotation = - Just - (Type.function - [ Type.var "a" ] - (Type.namedWith [ "Parser" ] "Parser" [ Type.var "a" ]) - ) - } - , token = - Elm.value - { importFrom = [ "Parser" ] - , name = "token" - , annotation = - Just - (Type.function - [ Type.string ] - (Type.namedWith [ "Parser" ] "Parser" [ Type.unit ]) - ) - } - , sequence = - Elm.value - { importFrom = [ "Parser" ] - , name = "sequence" - , annotation = - Just - (Type.function - [ Type.record - [ ( "start", Type.string ) - , ( "separator", Type.string ) - , ( "end", Type.string ) - , ( "spaces" - , Type.namedWith - [ "Parser" ] - "Parser" - [ Type.unit ] - ) - , ( "item" - , Type.namedWith - [ "Parser" ] - "Parser" - [ Type.var "a" ] - ) - , ( "trailing" - , Type.namedWith [ "Parser" ] "Trailing" [] - ) - ] - ] - (Type.namedWith - [ "Parser" ] - "Parser" - [ Type.list (Type.var "a") ] - ) - ) - } - , loop = - Elm.value - { importFrom = [ "Parser" ] - , name = "loop" - , annotation = - Just - (Type.function - [ Type.var "state" - , Type.function - [ Type.var "state" ] - (Type.namedWith - [ "Parser" ] - "Parser" - [ Type.namedWith - [ "Parser" ] - "Step" - [ Type.var "state", Type.var "a" ] - ] - ) - ] - (Type.namedWith [ "Parser" ] "Parser" [ Type.var "a" ]) - ) - } - , spaces = - Elm.value - { importFrom = [ "Parser" ] - , name = "spaces" - , annotation = - Just (Type.namedWith [ "Parser" ] "Parser" [ Type.unit ]) - } - , lineComment = - Elm.value - { importFrom = [ "Parser" ] - , name = "lineComment" - , annotation = - Just - (Type.function - [ Type.string ] - (Type.namedWith [ "Parser" ] "Parser" [ Type.unit ]) - ) - } - , multiComment = - Elm.value - { importFrom = [ "Parser" ] - , name = "multiComment" - , annotation = - Just - (Type.function - [ Type.string - , Type.string - , Type.namedWith [ "Parser" ] "Nestable" [] - ] - (Type.namedWith [ "Parser" ] "Parser" [ Type.unit ]) - ) - } - , getChompedString = - Elm.value - { importFrom = [ "Parser" ] - , name = "getChompedString" - , annotation = - Just - (Type.function - [ Type.namedWith [ "Parser" ] "Parser" [ Type.var "a" ] - ] - (Type.namedWith [ "Parser" ] "Parser" [ Type.string ]) - ) - } - , chompIf = - Elm.value - { importFrom = [ "Parser" ] - , name = "chompIf" - , annotation = - Just - (Type.function - [ Type.function [ Type.char ] Type.bool ] - (Type.namedWith [ "Parser" ] "Parser" [ Type.unit ]) - ) - } - , chompWhile = - Elm.value - { importFrom = [ "Parser" ] - , name = "chompWhile" - , annotation = - Just - (Type.function - [ Type.function [ Type.char ] Type.bool ] - (Type.namedWith [ "Parser" ] "Parser" [ Type.unit ]) - ) - } - , chompUntil = - Elm.value - { importFrom = [ "Parser" ] - , name = "chompUntil" - , annotation = - Just - (Type.function - [ Type.string ] - (Type.namedWith [ "Parser" ] "Parser" [ Type.unit ]) - ) - } - , chompUntilEndOr = - Elm.value - { importFrom = [ "Parser" ] - , name = "chompUntilEndOr" - , annotation = - Just - (Type.function - [ Type.string ] - (Type.namedWith [ "Parser" ] "Parser" [ Type.unit ]) - ) - } - , mapChompedString = - Elm.value - { importFrom = [ "Parser" ] - , name = "mapChompedString" - , annotation = - Just - (Type.function - [ Type.function - [ Type.string, Type.var "a" ] - (Type.var "b") - , Type.namedWith [ "Parser" ] "Parser" [ Type.var "a" ] - ] - (Type.namedWith [ "Parser" ] "Parser" [ Type.var "b" ]) - ) - } - , deadEndsToString = - Elm.value - { importFrom = [ "Parser" ] - , name = "deadEndsToString" - , annotation = - Just - (Type.function - [ Type.list (Type.namedWith [ "Parser" ] "DeadEnd" []) - ] - Type.string - ) - } - , withIndent = - Elm.value - { importFrom = [ "Parser" ] - , name = "withIndent" - , annotation = - Just - (Type.function - [ Type.int - , Type.namedWith [ "Parser" ] "Parser" [ Type.var "a" ] - ] - (Type.namedWith [ "Parser" ] "Parser" [ Type.var "a" ]) - ) - } - , getIndent = - Elm.value - { importFrom = [ "Parser" ] - , name = "getIndent" - , annotation = - Just (Type.namedWith [ "Parser" ] "Parser" [ Type.int ]) - } - , getPosition = - Elm.value - { importFrom = [ "Parser" ] - , name = "getPosition" - , annotation = - Just - (Type.namedWith - [ "Parser" ] - "Parser" - [ Type.tuple Type.int Type.int ] - ) - } - , getRow = - Elm.value - { importFrom = [ "Parser" ] - , name = "getRow" - , annotation = - Just (Type.namedWith [ "Parser" ] "Parser" [ Type.int ]) - } - , getCol = - Elm.value - { importFrom = [ "Parser" ] - , name = "getCol" - , annotation = - Just (Type.namedWith [ "Parser" ] "Parser" [ Type.int ]) - } - , getOffset = - Elm.value - { importFrom = [ "Parser" ] - , name = "getOffset" - , annotation = - Just (Type.namedWith [ "Parser" ] "Parser" [ Type.int ]) - } - , getSource = - Elm.value - { importFrom = [ "Parser" ] - , name = "getSource" - , annotation = - Just (Type.namedWith [ "Parser" ] "Parser" [ Type.string ]) - } - } \ No newline at end of file diff --git a/elm-open-api-codegen/src/Gen/Platform.elm b/elm-open-api-codegen/src/Gen/Platform.elm deleted file mode 100644 index 2078e448..00000000 --- a/elm-open-api-codegen/src/Gen/Platform.elm +++ /dev/null @@ -1,427 +0,0 @@ -module Gen.Platform exposing - ( moduleName_, worker, sendToApp, sendToSelf, annotation_, call_ - , values_ - ) - -{-| -# Generated bindings for Platform - -@docs moduleName_, worker, sendToApp, sendToSelf, annotation_, call_ -@docs values_ --} - - -import Elm -import Elm.Annotation as Type - - -{-| The name of this module. -} -moduleName_ : List String -moduleName_ = - [ "Platform" ] - - -{-| Create a [headless][] program with no user interface. - -This is great if you want to use Elm as the “brain” for something -else. For example, you could send messages out ports to modify the DOM, but do -all the complex logic in Elm. - -[headless]: https://en.wikipedia.org/wiki/Headless_software - -Initializing a headless program from JavaScript looks like this: - -```javascript -var app = Elm.MyThing.init(); -``` - -If you _do_ want to control the user interface in Elm, the [`Browser`][browser] -module has a few ways to create that kind of `Program` instead! - -[headless]: https://en.wikipedia.org/wiki/Headless_software -[browser]: /packages/elm/browser/latest/Browser - -worker: - { init : flags -> ( model, Platform.Cmd.Cmd msg ) - , update : msg -> model -> ( model, Platform.Cmd.Cmd msg ) - , subscriptions : model -> Platform.Sub.Sub msg - } - -> Platform.Program flags model msg --} -worker : - { init : Elm.Expression -> Elm.Expression - , update : Elm.Expression -> Elm.Expression -> Elm.Expression - , subscriptions : Elm.Expression -> Elm.Expression - } - -> Elm.Expression -worker workerArg_ = - Elm.apply - (Elm.value - { importFrom = [ "Platform" ] - , name = "worker" - , annotation = - Just - (Type.function - [ Type.record - [ ( "init" - , Type.function - [ Type.var "flags" ] - (Type.tuple - (Type.var "model") - (Type.namedWith - [] - "Cmd" - [ Type.var "msg" ] - ) - ) - ) - , ( "update" - , Type.function - [ Type.var "msg", Type.var "model" ] - (Type.tuple - (Type.var "model") - (Type.namedWith - [] - "Cmd" - [ Type.var "msg" ] - ) - ) - ) - , ( "subscriptions" - , Type.function - [ Type.var "model" ] - (Type.namedWith [] "Sub" [ Type.var "msg" ]) - ) - ] - ] - (Type.namedWith - [ "Platform" ] - "Program" - [ Type.var "flags" - , Type.var "model" - , Type.var "msg" - ] - ) - ) - } - ) - [ Elm.record - [ Tuple.pair - "init" - (Elm.functionReduced "workerUnpack" workerArg_.init) - , Tuple.pair - "update" - (Elm.functionReduced - "workerUnpack" - (\functionReducedUnpack -> - Elm.functionReduced - "unpack" - (workerArg_.update functionReducedUnpack) - ) - ) - , Tuple.pair - "subscriptions" - (Elm.functionReduced "workerUnpack" workerArg_.subscriptions) - ] - ] - - -{-| Send the router a message for the main loop of your app. This message will -be handled by the overall `update` function, just like events from `Html`. - -sendToApp: Platform.Router msg a -> msg -> Platform.Task x () --} -sendToApp : Elm.Expression -> Elm.Expression -> Elm.Expression -sendToApp sendToAppArg_ sendToAppArg_0 = - Elm.apply - (Elm.value - { importFrom = [ "Platform" ] - , name = "sendToApp" - , annotation = - Just - (Type.function - [ Type.namedWith - [ "Platform" ] - "Router" - [ Type.var "msg", Type.var "a" ] - , Type.var "msg" - ] - (Type.namedWith - [ "Platform" ] - "Task" - [ Type.var "x", Type.unit ] - ) - ) - } - ) - [ sendToAppArg_, sendToAppArg_0 ] - - -{-| Send the router a message for your effect manager. This message will -be routed to the `onSelfMsg` function, where you can update the state of your -effect manager as necessary. - -As an example, the effect manager for web sockets - -sendToSelf: Platform.Router a msg -> msg -> Platform.Task x () --} -sendToSelf : Elm.Expression -> Elm.Expression -> Elm.Expression -sendToSelf sendToSelfArg_ sendToSelfArg_0 = - Elm.apply - (Elm.value - { importFrom = [ "Platform" ] - , name = "sendToSelf" - , annotation = - Just - (Type.function - [ Type.namedWith - [ "Platform" ] - "Router" - [ Type.var "a", Type.var "msg" ] - , Type.var "msg" - ] - (Type.namedWith - [ "Platform" ] - "Task" - [ Type.var "x", Type.unit ] - ) - ) - } - ) - [ sendToSelfArg_, sendToSelfArg_0 ] - - -annotation_ : - { program : - Type.Annotation -> Type.Annotation -> Type.Annotation -> Type.Annotation - , task : Type.Annotation -> Type.Annotation -> Type.Annotation - , processId : Type.Annotation - , router : Type.Annotation -> Type.Annotation -> Type.Annotation - } -annotation_ = - { program = - \programArg0 programArg1 programArg2 -> - Type.namedWith - [] - "Program" - [ programArg0, programArg1, programArg2 ] - , task = - \taskArg0 taskArg1 -> - Type.namedWith [ "Platform" ] "Task" [ taskArg0, taskArg1 ] - , processId = Type.namedWith [ "Platform" ] "ProcessId" [] - , router = - \routerArg0 routerArg1 -> - Type.namedWith [ "Platform" ] "Router" [ routerArg0, routerArg1 ] - } - - -call_ : - { worker : Elm.Expression -> Elm.Expression - , sendToApp : Elm.Expression -> Elm.Expression -> Elm.Expression - , sendToSelf : Elm.Expression -> Elm.Expression -> Elm.Expression - } -call_ = - { worker = - \workerArg_ -> - Elm.apply - (Elm.value - { importFrom = [ "Platform" ] - , name = "worker" - , annotation = - Just - (Type.function - [ Type.record - [ ( "init" - , Type.function - [ Type.var "flags" ] - (Type.tuple - (Type.var "model") - (Type.namedWith - [] - "Cmd" - [ Type.var "msg" ] - ) - ) - ) - , ( "update" - , Type.function - [ Type.var "msg", Type.var "model" ] - (Type.tuple - (Type.var "model") - (Type.namedWith - [] - "Cmd" - [ Type.var "msg" ] - ) - ) - ) - , ( "subscriptions" - , Type.function - [ Type.var "model" ] - (Type.namedWith - [] - "Sub" - [ Type.var "msg" ] - ) - ) - ] - ] - (Type.namedWith - [ "Platform" ] - "Program" - [ Type.var "flags" - , Type.var "model" - , Type.var "msg" - ] - ) - ) - } - ) - [ workerArg_ ] - , sendToApp = - \sendToAppArg_ sendToAppArg_0 -> - Elm.apply - (Elm.value - { importFrom = [ "Platform" ] - , name = "sendToApp" - , annotation = - Just - (Type.function - [ Type.namedWith - [ "Platform" ] - "Router" - [ Type.var "msg", Type.var "a" ] - , Type.var "msg" - ] - (Type.namedWith - [ "Platform" ] - "Task" - [ Type.var "x", Type.unit ] - ) - ) - } - ) - [ sendToAppArg_, sendToAppArg_0 ] - , sendToSelf = - \sendToSelfArg_ sendToSelfArg_0 -> - Elm.apply - (Elm.value - { importFrom = [ "Platform" ] - , name = "sendToSelf" - , annotation = - Just - (Type.function - [ Type.namedWith - [ "Platform" ] - "Router" - [ Type.var "a", Type.var "msg" ] - , Type.var "msg" - ] - (Type.namedWith - [ "Platform" ] - "Task" - [ Type.var "x", Type.unit ] - ) - ) - } - ) - [ sendToSelfArg_, sendToSelfArg_0 ] - } - - -values_ : - { worker : Elm.Expression - , sendToApp : Elm.Expression - , sendToSelf : Elm.Expression - } -values_ = - { worker = - Elm.value - { importFrom = [ "Platform" ] - , name = "worker" - , annotation = - Just - (Type.function - [ Type.record - [ ( "init" - , Type.function - [ Type.var "flags" ] - (Type.tuple - (Type.var "model") - (Type.namedWith - [] - "Cmd" - [ Type.var "msg" ] - ) - ) - ) - , ( "update" - , Type.function - [ Type.var "msg", Type.var "model" ] - (Type.tuple - (Type.var "model") - (Type.namedWith - [] - "Cmd" - [ Type.var "msg" ] - ) - ) - ) - , ( "subscriptions" - , Type.function - [ Type.var "model" ] - (Type.namedWith [] "Sub" [ Type.var "msg" ]) - ) - ] - ] - (Type.namedWith - [ "Platform" ] - "Program" - [ Type.var "flags" - , Type.var "model" - , Type.var "msg" - ] - ) - ) - } - , sendToApp = - Elm.value - { importFrom = [ "Platform" ] - , name = "sendToApp" - , annotation = - Just - (Type.function - [ Type.namedWith - [ "Platform" ] - "Router" - [ Type.var "msg", Type.var "a" ] - , Type.var "msg" - ] - (Type.namedWith - [ "Platform" ] - "Task" - [ Type.var "x", Type.unit ] - ) - ) - } - , sendToSelf = - Elm.value - { importFrom = [ "Platform" ] - , name = "sendToSelf" - , annotation = - Just - (Type.function - [ Type.namedWith - [ "Platform" ] - "Router" - [ Type.var "a", Type.var "msg" ] - , Type.var "msg" - ] - (Type.namedWith - [ "Platform" ] - "Task" - [ Type.var "x", Type.unit ] - ) - ) - } - } \ No newline at end of file diff --git a/elm-open-api-codegen/src/Gen/Platform/Cmd.elm b/elm-open-api-codegen/src/Gen/Platform/Cmd.elm deleted file mode 100644 index 9e408f36..00000000 --- a/elm-open-api-codegen/src/Gen/Platform/Cmd.elm +++ /dev/null @@ -1,183 +0,0 @@ -module Gen.Platform.Cmd exposing - ( moduleName_, none, batch, map, annotation_, call_ - , values_ - ) - -{-| -# Generated bindings for Cmd - -@docs moduleName_, none, batch, map, annotation_, call_ -@docs values_ --} - - -import Elm -import Elm.Annotation as Type - - -{-| The name of this module. -} -moduleName_ : List String -moduleName_ = - [ "Cmd" ] - - -{-| Tell the runtime that there are no commands. - -none: Platform.Cmd.Cmd msg --} -none : Elm.Expression -none = - Elm.value - { importFrom = [ "Cmd" ] - , name = "none" - , annotation = Just (Type.namedWith [] "Cmd" [ Type.var "msg" ]) - } - - -{-| When you need the runtime system to perform a couple commands, you -can batch them together. Each is handed to the runtime at the same time, -and since each can perform arbitrary operations in the world, there are -no ordering guarantees about the results. - -**Note:** `Cmd.none` and `Cmd.batch [ Cmd.none, Cmd.none ]` and `Cmd.batch []` -all do the same thing. - -batch: List (Platform.Cmd.Cmd msg) -> Platform.Cmd.Cmd msg --} -batch : List Elm.Expression -> Elm.Expression -batch batchArg_ = - Elm.apply - (Elm.value - { importFrom = [ "Cmd" ] - , name = "batch" - , annotation = - Just - (Type.function - [ Type.list - (Type.namedWith [] "Cmd" [ Type.var "msg" ]) - ] - (Type.namedWith [] "Cmd" [ Type.var "msg" ]) - ) - } - ) - [ Elm.list batchArg_ ] - - -{-| Transform the messages produced by a command. -Very similar to [`Html.map`](/packages/elm/html/latest/Html#map). - -This is very rarely useful in well-structured Elm code, so definitely read the -section on [structure][] in the guide before reaching for this! - -[structure]: https://guide.elm-lang.org/webapps/structure.html - -map: (a -> msg) -> Platform.Cmd.Cmd a -> Platform.Cmd.Cmd msg --} -map : (Elm.Expression -> Elm.Expression) -> Elm.Expression -> Elm.Expression -map mapArg_ mapArg_0 = - Elm.apply - (Elm.value - { importFrom = [ "Cmd" ] - , name = "map" - , annotation = - Just - (Type.function - [ Type.function [ Type.var "a" ] (Type.var "msg") - , Type.namedWith [] "Cmd" [ Type.var "a" ] - ] - (Type.namedWith [] "Cmd" [ Type.var "msg" ]) - ) - } - ) - [ Elm.functionReduced "mapUnpack" mapArg_, mapArg_0 ] - - -annotation_ : { cmd : Type.Annotation -> Type.Annotation } -annotation_ = - { cmd = \cmdArg0 -> Type.namedWith [ "Cmd" ] "Cmd" [ cmdArg0 ] } - - -call_ : - { batch : Elm.Expression -> Elm.Expression - , map : Elm.Expression -> Elm.Expression -> Elm.Expression - } -call_ = - { batch = - \batchArg_ -> - Elm.apply - (Elm.value - { importFrom = [ "Cmd" ] - , name = "batch" - , annotation = - Just - (Type.function - [ Type.list - (Type.namedWith - [] - "Cmd" - [ Type.var "msg" ] - ) - ] - (Type.namedWith [] "Cmd" [ Type.var "msg" ]) - ) - } - ) - [ batchArg_ ] - , map = - \mapArg_ mapArg_0 -> - Elm.apply - (Elm.value - { importFrom = [ "Cmd" ] - , name = "map" - , annotation = - Just - (Type.function - [ Type.function - [ Type.var "a" ] - (Type.var "msg") - , Type.namedWith [] "Cmd" [ Type.var "a" ] - ] - (Type.namedWith [] "Cmd" [ Type.var "msg" ]) - ) - } - ) - [ mapArg_, mapArg_0 ] - } - - -values_ : - { none : Elm.Expression, batch : Elm.Expression, map : Elm.Expression } -values_ = - { none = - Elm.value - { importFrom = [ "Cmd" ] - , name = "none" - , annotation = Just (Type.namedWith [] "Cmd" [ Type.var "msg" ]) - } - , batch = - Elm.value - { importFrom = [ "Cmd" ] - , name = "batch" - , annotation = - Just - (Type.function - [ Type.list - (Type.namedWith [] "Cmd" [ Type.var "msg" ]) - ] - (Type.namedWith [] "Cmd" [ Type.var "msg" ]) - ) - } - , map = - Elm.value - { importFrom = [ "Cmd" ] - , name = "map" - , annotation = - Just - (Type.function - [ Type.function [ Type.var "a" ] (Type.var "msg") - , Type.namedWith [] "Cmd" [ Type.var "a" ] - ] - (Type.namedWith [] "Cmd" [ Type.var "msg" ]) - ) - } - } \ No newline at end of file diff --git a/elm-open-api-codegen/src/Gen/Platform/Sub.elm b/elm-open-api-codegen/src/Gen/Platform/Sub.elm deleted file mode 100644 index 702ac712..00000000 --- a/elm-open-api-codegen/src/Gen/Platform/Sub.elm +++ /dev/null @@ -1,181 +0,0 @@ -module Gen.Platform.Sub exposing - ( moduleName_, none, batch, map, annotation_, call_ - , values_ - ) - -{-| -# Generated bindings for Sub - -@docs moduleName_, none, batch, map, annotation_, call_ -@docs values_ --} - - -import Elm -import Elm.Annotation as Type - - -{-| The name of this module. -} -moduleName_ : List String -moduleName_ = - [ "Sub" ] - - -{-| Tell the runtime that there are no subscriptions. - -none: Platform.Sub.Sub msg --} -none : Elm.Expression -none = - Elm.value - { importFrom = [ "Sub" ] - , name = "none" - , annotation = Just (Type.namedWith [] "Sub" [ Type.var "msg" ]) - } - - -{-| When you need to subscribe to multiple things, you can create a `batch` of -subscriptions. - -**Note:** `Sub.none` and `Sub.batch [ Sub.none, Sub.none ]` and -`Sub.batch []` all do the same thing. - -batch: List (Platform.Sub.Sub msg) -> Platform.Sub.Sub msg --} -batch : List Elm.Expression -> Elm.Expression -batch batchArg_ = - Elm.apply - (Elm.value - { importFrom = [ "Sub" ] - , name = "batch" - , annotation = - Just - (Type.function - [ Type.list - (Type.namedWith [] "Sub" [ Type.var "msg" ]) - ] - (Type.namedWith [] "Sub" [ Type.var "msg" ]) - ) - } - ) - [ Elm.list batchArg_ ] - - -{-| Transform the messages produced by a subscription. -Very similar to [`Html.map`](/packages/elm/html/latest/Html#map). - -This is very rarely useful in well-structured Elm code, so definitely read the -section on [structure][] in the guide before reaching for this! - -[structure]: https://guide.elm-lang.org/webapps/structure.html - -map: (a -> msg) -> Platform.Sub.Sub a -> Platform.Sub.Sub msg --} -map : (Elm.Expression -> Elm.Expression) -> Elm.Expression -> Elm.Expression -map mapArg_ mapArg_0 = - Elm.apply - (Elm.value - { importFrom = [ "Sub" ] - , name = "map" - , annotation = - Just - (Type.function - [ Type.function [ Type.var "a" ] (Type.var "msg") - , Type.namedWith [] "Sub" [ Type.var "a" ] - ] - (Type.namedWith [] "Sub" [ Type.var "msg" ]) - ) - } - ) - [ Elm.functionReduced "mapUnpack" mapArg_, mapArg_0 ] - - -annotation_ : { sub : Type.Annotation -> Type.Annotation } -annotation_ = - { sub = \subArg0 -> Type.namedWith [ "Sub" ] "Sub" [ subArg0 ] } - - -call_ : - { batch : Elm.Expression -> Elm.Expression - , map : Elm.Expression -> Elm.Expression -> Elm.Expression - } -call_ = - { batch = - \batchArg_ -> - Elm.apply - (Elm.value - { importFrom = [ "Sub" ] - , name = "batch" - , annotation = - Just - (Type.function - [ Type.list - (Type.namedWith - [] - "Sub" - [ Type.var "msg" ] - ) - ] - (Type.namedWith [] "Sub" [ Type.var "msg" ]) - ) - } - ) - [ batchArg_ ] - , map = - \mapArg_ mapArg_0 -> - Elm.apply - (Elm.value - { importFrom = [ "Sub" ] - , name = "map" - , annotation = - Just - (Type.function - [ Type.function - [ Type.var "a" ] - (Type.var "msg") - , Type.namedWith [] "Sub" [ Type.var "a" ] - ] - (Type.namedWith [] "Sub" [ Type.var "msg" ]) - ) - } - ) - [ mapArg_, mapArg_0 ] - } - - -values_ : - { none : Elm.Expression, batch : Elm.Expression, map : Elm.Expression } -values_ = - { none = - Elm.value - { importFrom = [ "Sub" ] - , name = "none" - , annotation = Just (Type.namedWith [] "Sub" [ Type.var "msg" ]) - } - , batch = - Elm.value - { importFrom = [ "Sub" ] - , name = "batch" - , annotation = - Just - (Type.function - [ Type.list - (Type.namedWith [] "Sub" [ Type.var "msg" ]) - ] - (Type.namedWith [] "Sub" [ Type.var "msg" ]) - ) - } - , map = - Elm.value - { importFrom = [ "Sub" ] - , name = "map" - , annotation = - Just - (Type.function - [ Type.function [ Type.var "a" ] (Type.var "msg") - , Type.namedWith [] "Sub" [ Type.var "a" ] - ] - (Type.namedWith [] "Sub" [ Type.var "msg" ]) - ) - } - } \ No newline at end of file diff --git a/elm-open-api-codegen/src/Gen/Process.elm b/elm-open-api-codegen/src/Gen/Process.elm deleted file mode 100644 index 6f868d7b..00000000 --- a/elm-open-api-codegen/src/Gen/Process.elm +++ /dev/null @@ -1,259 +0,0 @@ -module Gen.Process exposing - ( moduleName_, spawn, sleep, kill, annotation_, call_ - , values_ - ) - -{-| -# Generated bindings for Process - -@docs moduleName_, spawn, sleep, kill, annotation_, call_ -@docs values_ --} - - -import Elm -import Elm.Annotation as Type - - -{-| The name of this module. -} -moduleName_ : List String -moduleName_ = - [ "Process" ] - - -{-| Run a task in its own light-weight process. In the following example, -`task1` and `task2` will be interleaved. If `task1` makes a long HTTP request -or is just taking a long time, we can hop over to `task2` and do some work -there. - - spawn task1 - |> Task.andThen (\_ -> spawn task2) - -**Note:** This creates a relatively restricted kind of `Process` because it -cannot receive any messages. More flexibility for user-defined processes will -come in a later release! - -spawn: Task.Task x a -> Task.Task y Process.Id --} -spawn : Elm.Expression -> Elm.Expression -spawn spawnArg_ = - Elm.apply - (Elm.value - { importFrom = [ "Process" ] - , name = "spawn" - , annotation = - Just - (Type.function - [ Type.namedWith - [ "Task" ] - "Task" - [ Type.var "x", Type.var "a" ] - ] - (Type.namedWith - [ "Task" ] - "Task" - [ Type.var "y" - , Type.namedWith [ "Process" ] "Id" [] - ] - ) - ) - } - ) - [ spawnArg_ ] - - -{-| Block progress on the current process for the given number of milliseconds. -The JavaScript equivalent of this is [`setTimeout`][setTimeout] which lets you -delay work until later. - -[setTimeout]: https://developer.mozilla.org/en-US/docs/Web/API/WindowTimers/setTimeout - -sleep: Float -> Task.Task x () --} -sleep : Float -> Elm.Expression -sleep sleepArg_ = - Elm.apply - (Elm.value - { importFrom = [ "Process" ] - , name = "sleep" - , annotation = - Just - (Type.function - [ Type.float ] - (Type.namedWith - [ "Task" ] - "Task" - [ Type.var "x", Type.unit ] - ) - ) - } - ) - [ Elm.float sleepArg_ ] - - -{-| Sometimes you `spawn` a process, but later decide it would be a waste to -have it keep running and doing stuff. The `kill` function will force a process -to bail on whatever task it is running. So if there is an HTTP request in -flight, it will also abort the request. - -kill: Process.Id -> Task.Task x () --} -kill : Elm.Expression -> Elm.Expression -kill killArg_ = - Elm.apply - (Elm.value - { importFrom = [ "Process" ] - , name = "kill" - , annotation = - Just - (Type.function - [ Type.namedWith [ "Process" ] "Id" [] ] - (Type.namedWith - [ "Task" ] - "Task" - [ Type.var "x", Type.unit ] - ) - ) - } - ) - [ killArg_ ] - - -annotation_ : { id : Type.Annotation } -annotation_ = - { id = - Type.alias - moduleName_ - "Id" - [] - (Type.namedWith [ "Platform" ] "ProcessId" []) - } - - -call_ : - { spawn : Elm.Expression -> Elm.Expression - , sleep : Elm.Expression -> Elm.Expression - , kill : Elm.Expression -> Elm.Expression - } -call_ = - { spawn = - \spawnArg_ -> - Elm.apply - (Elm.value - { importFrom = [ "Process" ] - , name = "spawn" - , annotation = - Just - (Type.function - [ Type.namedWith - [ "Task" ] - "Task" - [ Type.var "x", Type.var "a" ] - ] - (Type.namedWith - [ "Task" ] - "Task" - [ Type.var "y" - , Type.namedWith [ "Process" ] "Id" [] - ] - ) - ) - } - ) - [ spawnArg_ ] - , sleep = - \sleepArg_ -> - Elm.apply - (Elm.value - { importFrom = [ "Process" ] - , name = "sleep" - , annotation = - Just - (Type.function - [ Type.float ] - (Type.namedWith - [ "Task" ] - "Task" - [ Type.var "x", Type.unit ] - ) - ) - } - ) - [ sleepArg_ ] - , kill = - \killArg_ -> - Elm.apply - (Elm.value - { importFrom = [ "Process" ] - , name = "kill" - , annotation = - Just - (Type.function - [ Type.namedWith [ "Process" ] "Id" [] ] - (Type.namedWith - [ "Task" ] - "Task" - [ Type.var "x", Type.unit ] - ) - ) - } - ) - [ killArg_ ] - } - - -values_ : - { spawn : Elm.Expression, sleep : Elm.Expression, kill : Elm.Expression } -values_ = - { spawn = - Elm.value - { importFrom = [ "Process" ] - , name = "spawn" - , annotation = - Just - (Type.function - [ Type.namedWith - [ "Task" ] - "Task" - [ Type.var "x", Type.var "a" ] - ] - (Type.namedWith - [ "Task" ] - "Task" - [ Type.var "y" - , Type.namedWith [ "Process" ] "Id" [] - ] - ) - ) - } - , sleep = - Elm.value - { importFrom = [ "Process" ] - , name = "sleep" - , annotation = - Just - (Type.function - [ Type.float ] - (Type.namedWith - [ "Task" ] - "Task" - [ Type.var "x", Type.unit ] - ) - ) - } - , kill = - Elm.value - { importFrom = [ "Process" ] - , name = "kill" - , annotation = - Just - (Type.function - [ Type.namedWith [ "Process" ] "Id" [] ] - (Type.namedWith - [ "Task" ] - "Task" - [ Type.var "x", Type.unit ] - ) - ) - } - } \ No newline at end of file diff --git a/elm-open-api-codegen/src/Gen/Scaffold/Form.elm b/elm-open-api-codegen/src/Gen/Scaffold/Form.elm deleted file mode 100644 index 16322aa3..00000000 --- a/elm-open-api-codegen/src/Gen/Scaffold/Form.elm +++ /dev/null @@ -1,678 +0,0 @@ -module Gen.Scaffold.Form exposing - ( moduleName_, provide, restArgsParser, recordEncoder, fieldEncoder, annotation_ - , make_, caseOf_, call_, values_ - ) - -{-| -# Generated bindings for Scaffold.Form - -@docs moduleName_, provide, restArgsParser, recordEncoder, fieldEncoder, annotation_ -@docs make_, caseOf_, call_, values_ --} - - -import Elm -import Elm.Annotation as Type -import Elm.Arg -import Elm.Case - - -{-| The name of this module. -} -moduleName_ : List String -moduleName_ = - [ "Scaffold", "Form" ] - - -{-| provide: - { fields : List ( String, Scaffold.Form.Kind ) - , elmCssView : Bool - , view : - { formState : Scaffold.Form.Context - , params : - List { name : String - , kind : Scaffold.Form.Kind - , param : Elm.Expression - } - } - -> Elm.Expression - } - -> Maybe { formHandlers : Elm.Expression - , form : Elm.Expression - , declarations : List Elm.Declaration - } --} -provide : - { fields : List Elm.Expression - , elmCssView : Bool - , view : Elm.Expression -> Elm.Expression - } - -> Elm.Expression -provide provideArg_ = - Elm.apply - (Elm.value - { importFrom = [ "Scaffold", "Form" ] - , name = "provide" - , annotation = - Just - (Type.function - [ Type.record - [ ( "fields" - , Type.list - (Type.tuple - Type.string - (Type.namedWith - [ "Scaffold", "Form" ] - "Kind" - [] - ) - ) - ) - , ( "elmCssView", Type.bool ) - , ( "view" - , Type.function - [ Type.record - [ ( "formState" - , Type.namedWith - [ "Scaffold", "Form" ] - "Context" - [] - ) - , ( "params" - , Type.list - (Type.record - [ ( "name", Type.string ) - , ( "kind" - , Type.namedWith - [ "Scaffold" - , "Form" - ] - "Kind" - [] - ) - , ( "param" - , Type.namedWith - [ "Elm" ] - "Expression" - [] - ) - ] - ) - ) - ] - ] - (Type.namedWith [ "Elm" ] "Expression" []) - ) - ] - ] - (Type.maybe - (Type.record - [ ( "formHandlers" - , Type.namedWith [ "Elm" ] "Expression" [] - ) - , ( "form" - , Type.namedWith [ "Elm" ] "Expression" [] - ) - , ( "declarations" - , Type.list - (Type.namedWith - [ "Elm" ] - "Declaration" - [] - ) - ) - ] - ) - ) - ) - } - ) - [ Elm.record - [ Tuple.pair "fields" (Elm.list provideArg_.fields) - , Tuple.pair "elmCssView" (Elm.bool provideArg_.elmCssView) - , Tuple.pair - "view" - (Elm.functionReduced "provideUnpack" provideArg_.view) - ] - ] - - -{-| This parser handles the following field types (or `text` if none is provided): - - - `text` - - `textarea` - - `checkbox` - - `time` - - `date` - -The naming convention follows the same naming as the HTML form field elements or attributes that are used to represent them. -In addition to using the appropriate field type, this will also give you an Elm type with the corresponding base type (like `Date` for `date` or `Bool` for `checkbox`). - -restArgsParser: Cli.Option.Option (List String) (List ( String, Scaffold.Form.Kind )) Cli.Option.RestArgsOption --} -restArgsParser : Elm.Expression -restArgsParser = - Elm.value - { importFrom = [ "Scaffold", "Form" ] - , name = "restArgsParser" - , annotation = - Just - (Type.namedWith - [ "Cli", "Option" ] - "Option" - [ Type.list Type.string - , Type.list - (Type.tuple - Type.string - (Type.namedWith [ "Scaffold", "Form" ] "Kind" []) - ) - , Type.namedWith [ "Cli", "Option" ] "RestArgsOption" [] - ] - ) - } - - -{-| Generate a JSON Encoder for the form fields. This can be helpful for sending the validated form data through a -BackendTask.Custom or to an external API from your scaffolded Route Module code. - -recordEncoder: Elm.Expression -> List ( String, Scaffold.Form.Kind ) -> Elm.Expression --} -recordEncoder : Elm.Expression -> List Elm.Expression -> Elm.Expression -recordEncoder recordEncoderArg_ recordEncoderArg_0 = - Elm.apply - (Elm.value - { importFrom = [ "Scaffold", "Form" ] - , name = "recordEncoder" - , annotation = - Just - (Type.function - [ Type.namedWith [ "Elm" ] "Expression" [] - , Type.list - (Type.tuple - Type.string - (Type.namedWith - [ "Scaffold", "Form" ] - "Kind" - [] - ) - ) - ] - (Type.namedWith [ "Elm" ] "Expression" []) - ) - } - ) - [ recordEncoderArg_, Elm.list recordEncoderArg_0 ] - - -{-| A lower-level, more granular version of `recordEncoder` - lets you generate a JSON Encoder `Expression` for an individual Field rather than a group of Fields. - -fieldEncoder: Elm.Expression -> String -> Scaffold.Form.Kind -> Elm.Expression --} -fieldEncoder : Elm.Expression -> String -> Elm.Expression -> Elm.Expression -fieldEncoder fieldEncoderArg_ fieldEncoderArg_0 fieldEncoderArg_1 = - Elm.apply - (Elm.value - { importFrom = [ "Scaffold", "Form" ] - , name = "fieldEncoder" - , annotation = - Just - (Type.function - [ Type.namedWith [ "Elm" ] "Expression" [] - , Type.string - , Type.namedWith [ "Scaffold", "Form" ] "Kind" [] - ] - (Type.namedWith [ "Elm" ] "Expression" []) - ) - } - ) - [ fieldEncoderArg_, Elm.string fieldEncoderArg_0, fieldEncoderArg_1 ] - - -annotation_ : { kind : Type.Annotation, context : Type.Annotation } -annotation_ = - { kind = Type.namedWith [ "Scaffold", "Form" ] "Kind" [] - , context = - Type.alias - moduleName_ - "Context" - [] - (Type.record - [ ( "errors", Type.namedWith [ "Elm" ] "Expression" [] ) - , ( "submitting", Type.namedWith [ "Elm" ] "Expression" [] ) - , ( "submitAttempted" - , Type.namedWith [ "Elm" ] "Expression" [] - ) - , ( "data", Type.namedWith [ "Elm" ] "Expression" [] ) - , ( "expression", Type.namedWith [ "Elm" ] "Expression" [] ) - ] - ) - } - - -make_ : - { fieldInt : Elm.Expression - , fieldText : Elm.Expression - , fieldTextarea : Elm.Expression - , fieldFloat : Elm.Expression - , fieldTime : Elm.Expression - , fieldDate : Elm.Expression - , fieldCheckbox : Elm.Expression - , context : - { errors : Elm.Expression - , submitting : Elm.Expression - , submitAttempted : Elm.Expression - , data : Elm.Expression - , expression : Elm.Expression - } - -> Elm.Expression - } -make_ = - { fieldInt = - Elm.value - { importFrom = [ "Scaffold", "Form" ] - , name = "FieldInt" - , annotation = Just (Type.namedWith [] "Kind" []) - } - , fieldText = - Elm.value - { importFrom = [ "Scaffold", "Form" ] - , name = "FieldText" - , annotation = Just (Type.namedWith [] "Kind" []) - } - , fieldTextarea = - Elm.value - { importFrom = [ "Scaffold", "Form" ] - , name = "FieldTextarea" - , annotation = Just (Type.namedWith [] "Kind" []) - } - , fieldFloat = - Elm.value - { importFrom = [ "Scaffold", "Form" ] - , name = "FieldFloat" - , annotation = Just (Type.namedWith [] "Kind" []) - } - , fieldTime = - Elm.value - { importFrom = [ "Scaffold", "Form" ] - , name = "FieldTime" - , annotation = Just (Type.namedWith [] "Kind" []) - } - , fieldDate = - Elm.value - { importFrom = [ "Scaffold", "Form" ] - , name = "FieldDate" - , annotation = Just (Type.namedWith [] "Kind" []) - } - , fieldCheckbox = - Elm.value - { importFrom = [ "Scaffold", "Form" ] - , name = "FieldCheckbox" - , annotation = Just (Type.namedWith [] "Kind" []) - } - , context = - \context_args -> - Elm.withType - (Type.alias - [ "Scaffold", "Form" ] - "Context" - [] - (Type.record - [ ( "errors" - , Type.namedWith [ "Elm" ] "Expression" [] - ) - , ( "submitting" - , Type.namedWith [ "Elm" ] "Expression" [] - ) - , ( "submitAttempted" - , Type.namedWith [ "Elm" ] "Expression" [] - ) - , ( "data", Type.namedWith [ "Elm" ] "Expression" [] ) - , ( "expression" - , Type.namedWith [ "Elm" ] "Expression" [] - ) - ] - ) - ) - (Elm.record - [ Tuple.pair "errors" context_args.errors - , Tuple.pair "submitting" context_args.submitting - , Tuple.pair "submitAttempted" context_args.submitAttempted - , Tuple.pair "data" context_args.data - , Tuple.pair "expression" context_args.expression - ] - ) - } - - -caseOf_ : - { kind : - Elm.Expression - -> { fieldInt : Elm.Expression - , fieldText : Elm.Expression - , fieldTextarea : Elm.Expression - , fieldFloat : Elm.Expression - , fieldTime : Elm.Expression - , fieldDate : Elm.Expression - , fieldCheckbox : Elm.Expression - } - -> Elm.Expression - } -caseOf_ = - { kind = - \kindExpression kindTags -> - Elm.Case.custom - kindExpression - (Type.namedWith [ "Scaffold", "Form" ] "Kind" []) - [ Elm.Case.branch - (Elm.Arg.customType "FieldInt" kindTags.fieldInt) - Basics.identity - , Elm.Case.branch - (Elm.Arg.customType "FieldText" kindTags.fieldText) - Basics.identity - , Elm.Case.branch - (Elm.Arg.customType "FieldTextarea" kindTags.fieldTextarea) - Basics.identity - , Elm.Case.branch - (Elm.Arg.customType "FieldFloat" kindTags.fieldFloat) - Basics.identity - , Elm.Case.branch - (Elm.Arg.customType "FieldTime" kindTags.fieldTime) - Basics.identity - , Elm.Case.branch - (Elm.Arg.customType "FieldDate" kindTags.fieldDate) - Basics.identity - , Elm.Case.branch - (Elm.Arg.customType "FieldCheckbox" kindTags.fieldCheckbox) - Basics.identity - ] - } - - -call_ : - { provide : Elm.Expression -> Elm.Expression - , recordEncoder : Elm.Expression -> Elm.Expression -> Elm.Expression - , fieldEncoder : - Elm.Expression -> Elm.Expression -> Elm.Expression -> Elm.Expression - } -call_ = - { provide = - \provideArg_ -> - Elm.apply - (Elm.value - { importFrom = [ "Scaffold", "Form" ] - , name = "provide" - , annotation = - Just - (Type.function - [ Type.record - [ ( "fields" - , Type.list - (Type.tuple - Type.string - (Type.namedWith - [ "Scaffold", "Form" ] - "Kind" - [] - ) - ) - ) - , ( "elmCssView", Type.bool ) - , ( "view" - , Type.function - [ Type.record - [ ( "formState" - , Type.namedWith - [ "Scaffold", "Form" ] - "Context" - [] - ) - , ( "params" - , Type.list - (Type.record - [ ( "name" - , Type.string - ) - , ( "kind" - , Type.namedWith - [ "Scaffold" - , "Form" - ] - "Kind" - [] - ) - , ( "param" - , Type.namedWith - [ "Elm" ] - "Expression" - [] - ) - ] - ) - ) - ] - ] - (Type.namedWith - [ "Elm" ] - "Expression" - [] - ) - ) - ] - ] - (Type.maybe - (Type.record - [ ( "formHandlers" - , Type.namedWith - [ "Elm" ] - "Expression" - [] - ) - , ( "form" - , Type.namedWith - [ "Elm" ] - "Expression" - [] - ) - , ( "declarations" - , Type.list - (Type.namedWith - [ "Elm" ] - "Declaration" - [] - ) - ) - ] - ) - ) - ) - } - ) - [ provideArg_ ] - , recordEncoder = - \recordEncoderArg_ recordEncoderArg_0 -> - Elm.apply - (Elm.value - { importFrom = [ "Scaffold", "Form" ] - , name = "recordEncoder" - , annotation = - Just - (Type.function - [ Type.namedWith [ "Elm" ] "Expression" [] - , Type.list - (Type.tuple - Type.string - (Type.namedWith - [ "Scaffold", "Form" ] - "Kind" - [] - ) - ) - ] - (Type.namedWith [ "Elm" ] "Expression" []) - ) - } - ) - [ recordEncoderArg_, recordEncoderArg_0 ] - , fieldEncoder = - \fieldEncoderArg_ fieldEncoderArg_0 fieldEncoderArg_1 -> - Elm.apply - (Elm.value - { importFrom = [ "Scaffold", "Form" ] - , name = "fieldEncoder" - , annotation = - Just - (Type.function - [ Type.namedWith [ "Elm" ] "Expression" [] - , Type.string - , Type.namedWith - [ "Scaffold", "Form" ] - "Kind" - [] - ] - (Type.namedWith [ "Elm" ] "Expression" []) - ) - } - ) - [ fieldEncoderArg_, fieldEncoderArg_0, fieldEncoderArg_1 ] - } - - -values_ : - { provide : Elm.Expression - , restArgsParser : Elm.Expression - , recordEncoder : Elm.Expression - , fieldEncoder : Elm.Expression - } -values_ = - { provide = - Elm.value - { importFrom = [ "Scaffold", "Form" ] - , name = "provide" - , annotation = - Just - (Type.function - [ Type.record - [ ( "fields" - , Type.list - (Type.tuple - Type.string - (Type.namedWith - [ "Scaffold", "Form" ] - "Kind" - [] - ) - ) - ) - , ( "elmCssView", Type.bool ) - , ( "view" - , Type.function - [ Type.record - [ ( "formState" - , Type.namedWith - [ "Scaffold", "Form" ] - "Context" - [] - ) - , ( "params" - , Type.list - (Type.record - [ ( "name", Type.string ) - , ( "kind" - , Type.namedWith - [ "Scaffold" - , "Form" - ] - "Kind" - [] - ) - , ( "param" - , Type.namedWith - [ "Elm" ] - "Expression" - [] - ) - ] - ) - ) - ] - ] - (Type.namedWith [ "Elm" ] "Expression" []) - ) - ] - ] - (Type.maybe - (Type.record - [ ( "formHandlers" - , Type.namedWith [ "Elm" ] "Expression" [] - ) - , ( "form" - , Type.namedWith [ "Elm" ] "Expression" [] - ) - , ( "declarations" - , Type.list - (Type.namedWith - [ "Elm" ] - "Declaration" - [] - ) - ) - ] - ) - ) - ) - } - , restArgsParser = - Elm.value - { importFrom = [ "Scaffold", "Form" ] - , name = "restArgsParser" - , annotation = - Just - (Type.namedWith - [ "Cli", "Option" ] - "Option" - [ Type.list Type.string - , Type.list - (Type.tuple - Type.string - (Type.namedWith [ "Scaffold", "Form" ] "Kind" [] - ) - ) - , Type.namedWith - [ "Cli", "Option" ] - "RestArgsOption" - [] - ] - ) - } - , recordEncoder = - Elm.value - { importFrom = [ "Scaffold", "Form" ] - , name = "recordEncoder" - , annotation = - Just - (Type.function - [ Type.namedWith [ "Elm" ] "Expression" [] - , Type.list - (Type.tuple - Type.string - (Type.namedWith [ "Scaffold", "Form" ] "Kind" [] - ) - ) - ] - (Type.namedWith [ "Elm" ] "Expression" []) - ) - } - , fieldEncoder = - Elm.value - { importFrom = [ "Scaffold", "Form" ] - , name = "fieldEncoder" - , annotation = - Just - (Type.function - [ Type.namedWith [ "Elm" ] "Expression" [] - , Type.string - , Type.namedWith [ "Scaffold", "Form" ] "Kind" [] - ] - (Type.namedWith [ "Elm" ] "Expression" []) - ) - } - } \ No newline at end of file diff --git a/elm-open-api-codegen/src/Gen/Scaffold/Route.elm b/elm-open-api-codegen/src/Gen/Scaffold/Route.elm deleted file mode 100644 index 8567444a..00000000 --- a/elm-open-api-codegen/src/Gen/Scaffold/Route.elm +++ /dev/null @@ -1,1962 +0,0 @@ -module Gen.Scaffold.Route exposing - ( moduleName_, buildWithLocalState, buildWithSharedState, buildNoState, serverRender, preRender - , single, addDeclarations, moduleNameCliArg, annotation_, make_, caseOf_, call_ - , values_ - ) - -{-| -# Generated bindings for Scaffold.Route - -@docs moduleName_, buildWithLocalState, buildWithSharedState, buildNoState, serverRender, preRender -@docs single, addDeclarations, moduleNameCliArg, annotation_, make_, caseOf_ -@docs call_, values_ --} - - -import Elm -import Elm.Annotation as Type -import Elm.Arg -import Elm.Case - - -{-| The name of this module. -} -moduleName_ : List String -moduleName_ = - [ "Scaffold", "Route" ] - - -{-| buildWithLocalState: - { view : - { shared : Elm.Expression, model : Elm.Expression, app : Elm.Expression } - -> Elm.Expression - , update : - { shared : Elm.Expression - , app : Elm.Expression - , msg : Elm.Expression - , model : Elm.Expression - } - -> Elm.Expression - , init : { shared : Elm.Expression, app : Elm.Expression } -> Elm.Expression - , subscriptions : - { routeParams : Elm.Expression - , path : Elm.Expression - , shared : Elm.Expression - , model : Elm.Expression - } - -> Elm.Expression - , msg : Scaffold.Route.Type - , model : Scaffold.Route.Type - } - -> Scaffold.Route.Builder - -> { path : String, body : String } --} -buildWithLocalState : - { view : Elm.Expression -> Elm.Expression - , update : Elm.Expression -> Elm.Expression - , init : Elm.Expression -> Elm.Expression - , subscriptions : Elm.Expression -> Elm.Expression - , msg : Elm.Expression - , model : Elm.Expression - } - -> Elm.Expression - -> Elm.Expression -buildWithLocalState buildWithLocalStateArg_ buildWithLocalStateArg_0 = - Elm.apply - (Elm.value - { importFrom = [ "Scaffold", "Route" ] - , name = "buildWithLocalState" - , annotation = - Just - (Type.function - [ Type.record - [ ( "view" - , Type.function - [ Type.record - [ ( "shared" - , Type.namedWith - [ "Elm" ] - "Expression" - [] - ) - , ( "model" - , Type.namedWith - [ "Elm" ] - "Expression" - [] - ) - , ( "app" - , Type.namedWith - [ "Elm" ] - "Expression" - [] - ) - ] - ] - (Type.namedWith [ "Elm" ] "Expression" []) - ) - , ( "update" - , Type.function - [ Type.record - [ ( "shared" - , Type.namedWith - [ "Elm" ] - "Expression" - [] - ) - , ( "app" - , Type.namedWith - [ "Elm" ] - "Expression" - [] - ) - , ( "msg" - , Type.namedWith - [ "Elm" ] - "Expression" - [] - ) - , ( "model" - , Type.namedWith - [ "Elm" ] - "Expression" - [] - ) - ] - ] - (Type.namedWith [ "Elm" ] "Expression" []) - ) - , ( "init" - , Type.function - [ Type.record - [ ( "shared" - , Type.namedWith - [ "Elm" ] - "Expression" - [] - ) - , ( "app" - , Type.namedWith - [ "Elm" ] - "Expression" - [] - ) - ] - ] - (Type.namedWith [ "Elm" ] "Expression" []) - ) - , ( "subscriptions" - , Type.function - [ Type.record - [ ( "routeParams" - , Type.namedWith - [ "Elm" ] - "Expression" - [] - ) - , ( "path" - , Type.namedWith - [ "Elm" ] - "Expression" - [] - ) - , ( "shared" - , Type.namedWith - [ "Elm" ] - "Expression" - [] - ) - , ( "model" - , Type.namedWith - [ "Elm" ] - "Expression" - [] - ) - ] - ] - (Type.namedWith [ "Elm" ] "Expression" []) - ) - , ( "msg" - , Type.namedWith - [ "Scaffold", "Route" ] - "Type" - [] - ) - , ( "model" - , Type.namedWith - [ "Scaffold", "Route" ] - "Type" - [] - ) - ] - , Type.namedWith [ "Scaffold", "Route" ] "Builder" [] - ] - (Type.record - [ ( "path", Type.string ) - , ( "body", Type.string ) - ] - ) - ) - } - ) - [ Elm.record - [ Tuple.pair - "view" - (Elm.functionReduced - "buildWithLocalStateUnpack" - buildWithLocalStateArg_.view - ) - , Tuple.pair - "update" - (Elm.functionReduced - "buildWithLocalStateUnpack" - buildWithLocalStateArg_.update - ) - , Tuple.pair - "init" - (Elm.functionReduced - "buildWithLocalStateUnpack" - buildWithLocalStateArg_.init - ) - , Tuple.pair - "subscriptions" - (Elm.functionReduced - "buildWithLocalStateUnpack" - buildWithLocalStateArg_.subscriptions - ) - , Tuple.pair "msg" buildWithLocalStateArg_.msg - , Tuple.pair "model" buildWithLocalStateArg_.model - ] - , buildWithLocalStateArg_0 - ] - - -{-| buildWithSharedState: - { view : - { shared : Elm.Expression, model : Elm.Expression, app : Elm.Expression } - -> Elm.Expression - , update : - { shared : Elm.Expression - , app : Elm.Expression - , msg : Elm.Expression - , model : Elm.Expression - } - -> Elm.Expression - , init : { shared : Elm.Expression, app : Elm.Expression } -> Elm.Expression - , subscriptions : - { routeParams : Elm.Expression - , path : Elm.Expression - , shared : Elm.Expression - , model : Elm.Expression - } - -> Elm.Expression - , msg : Scaffold.Route.Type - , model : Scaffold.Route.Type - } - -> Scaffold.Route.Builder - -> { path : String, body : String } --} -buildWithSharedState : - { view : Elm.Expression -> Elm.Expression - , update : Elm.Expression -> Elm.Expression - , init : Elm.Expression -> Elm.Expression - , subscriptions : Elm.Expression -> Elm.Expression - , msg : Elm.Expression - , model : Elm.Expression - } - -> Elm.Expression - -> Elm.Expression -buildWithSharedState buildWithSharedStateArg_ buildWithSharedStateArg_0 = - Elm.apply - (Elm.value - { importFrom = [ "Scaffold", "Route" ] - , name = "buildWithSharedState" - , annotation = - Just - (Type.function - [ Type.record - [ ( "view" - , Type.function - [ Type.record - [ ( "shared" - , Type.namedWith - [ "Elm" ] - "Expression" - [] - ) - , ( "model" - , Type.namedWith - [ "Elm" ] - "Expression" - [] - ) - , ( "app" - , Type.namedWith - [ "Elm" ] - "Expression" - [] - ) - ] - ] - (Type.namedWith [ "Elm" ] "Expression" []) - ) - , ( "update" - , Type.function - [ Type.record - [ ( "shared" - , Type.namedWith - [ "Elm" ] - "Expression" - [] - ) - , ( "app" - , Type.namedWith - [ "Elm" ] - "Expression" - [] - ) - , ( "msg" - , Type.namedWith - [ "Elm" ] - "Expression" - [] - ) - , ( "model" - , Type.namedWith - [ "Elm" ] - "Expression" - [] - ) - ] - ] - (Type.namedWith [ "Elm" ] "Expression" []) - ) - , ( "init" - , Type.function - [ Type.record - [ ( "shared" - , Type.namedWith - [ "Elm" ] - "Expression" - [] - ) - , ( "app" - , Type.namedWith - [ "Elm" ] - "Expression" - [] - ) - ] - ] - (Type.namedWith [ "Elm" ] "Expression" []) - ) - , ( "subscriptions" - , Type.function - [ Type.record - [ ( "routeParams" - , Type.namedWith - [ "Elm" ] - "Expression" - [] - ) - , ( "path" - , Type.namedWith - [ "Elm" ] - "Expression" - [] - ) - , ( "shared" - , Type.namedWith - [ "Elm" ] - "Expression" - [] - ) - , ( "model" - , Type.namedWith - [ "Elm" ] - "Expression" - [] - ) - ] - ] - (Type.namedWith [ "Elm" ] "Expression" []) - ) - , ( "msg" - , Type.namedWith - [ "Scaffold", "Route" ] - "Type" - [] - ) - , ( "model" - , Type.namedWith - [ "Scaffold", "Route" ] - "Type" - [] - ) - ] - , Type.namedWith [ "Scaffold", "Route" ] "Builder" [] - ] - (Type.record - [ ( "path", Type.string ) - , ( "body", Type.string ) - ] - ) - ) - } - ) - [ Elm.record - [ Tuple.pair - "view" - (Elm.functionReduced - "buildWithSharedStateUnpack" - buildWithSharedStateArg_.view - ) - , Tuple.pair - "update" - (Elm.functionReduced - "buildWithSharedStateUnpack" - buildWithSharedStateArg_.update - ) - , Tuple.pair - "init" - (Elm.functionReduced - "buildWithSharedStateUnpack" - buildWithSharedStateArg_.init - ) - , Tuple.pair - "subscriptions" - (Elm.functionReduced - "buildWithSharedStateUnpack" - buildWithSharedStateArg_.subscriptions - ) - , Tuple.pair "msg" buildWithSharedStateArg_.msg - , Tuple.pair "model" buildWithSharedStateArg_.model - ] - , buildWithSharedStateArg_0 - ] - - -{-| buildNoState: - { view : { shared : Elm.Expression, app : Elm.Expression } -> Elm.Expression } - -> Scaffold.Route.Builder - -> { path : String, body : String } --} -buildNoState : - { view : Elm.Expression -> Elm.Expression } - -> Elm.Expression - -> Elm.Expression -buildNoState buildNoStateArg_ buildNoStateArg_0 = - Elm.apply - (Elm.value - { importFrom = [ "Scaffold", "Route" ] - , name = "buildNoState" - , annotation = - Just - (Type.function - [ Type.record - [ ( "view" - , Type.function - [ Type.record - [ ( "shared" - , Type.namedWith - [ "Elm" ] - "Expression" - [] - ) - , ( "app" - , Type.namedWith - [ "Elm" ] - "Expression" - [] - ) - ] - ] - (Type.namedWith [ "Elm" ] "Expression" []) - ) - ] - , Type.namedWith [ "Scaffold", "Route" ] "Builder" [] - ] - (Type.record - [ ( "path", Type.string ) - , ( "body", Type.string ) - ] - ) - ) - } - ) - [ Elm.record - [ Tuple.pair - "view" - (Elm.functionReduced - "buildNoStateUnpack" - buildNoStateArg_.view - ) - ] - , buildNoStateArg_0 - ] - - -{-| serverRender: - { data : - ( Scaffold.Route.Type, Elm.Expression -> Elm.Expression -> Elm.Expression ) - , action : - ( Scaffold.Route.Type, Elm.Expression -> Elm.Expression -> Elm.Expression ) - , head : Elm.Expression -> Elm.Expression - , moduleName : List String - } - -> Scaffold.Route.Builder --} -serverRender : - { data : Elm.Expression - , action : Elm.Expression - , head : Elm.Expression -> Elm.Expression - , moduleName : List String - } - -> Elm.Expression -serverRender serverRenderArg_ = - Elm.apply - (Elm.value - { importFrom = [ "Scaffold", "Route" ] - , name = "serverRender" - , annotation = - Just - (Type.function - [ Type.record - [ ( "data" - , Type.tuple - (Type.namedWith - [ "Scaffold", "Route" ] - "Type" - [] - ) - (Type.function - [ Type.namedWith - [ "Elm" ] - "Expression" - [] - , Type.namedWith - [ "Elm" ] - "Expression" - [] - ] - (Type.namedWith [ "Elm" ] "Expression" [] - ) - ) - ) - , ( "action" - , Type.tuple - (Type.namedWith - [ "Scaffold", "Route" ] - "Type" - [] - ) - (Type.function - [ Type.namedWith - [ "Elm" ] - "Expression" - [] - , Type.namedWith - [ "Elm" ] - "Expression" - [] - ] - (Type.namedWith [ "Elm" ] "Expression" [] - ) - ) - ) - , ( "head" - , Type.function - [ Type.namedWith [ "Elm" ] "Expression" [] ] - (Type.namedWith [ "Elm" ] "Expression" []) - ) - , ( "moduleName", Type.list Type.string ) - ] - ] - (Type.namedWith [ "Scaffold", "Route" ] "Builder" []) - ) - } - ) - [ Elm.record - [ Tuple.pair "data" serverRenderArg_.data - , Tuple.pair "action" serverRenderArg_.action - , Tuple.pair - "head" - (Elm.functionReduced - "serverRenderUnpack" - serverRenderArg_.head - ) - , Tuple.pair - "moduleName" - (Elm.list (List.map Elm.string serverRenderArg_.moduleName)) - ] - ] - - -{-| Will scaffold using `RouteBuilder.preRender` if there are any dynamic segments (as in `Company.Team.Name_`), -or using `RouteBuilder.single` if there are no dynamic segments (as in `Company.AboutUs`). - -When there are no dynamic segments, the `pages` field will be ignored as it is only relevant for Routes with dynamic segments. - -For dynamic segments, the `routeParams` parameter in the `data` function will be an `Elm.Expression` with the `RouteParams` parameter in the `data` function. -For static segments, it will be a hardcoded empty record (`{}`). - -preRender: - { data : ( Scaffold.Route.Type, Elm.Expression -> Elm.Expression ) - , pages : Elm.Expression - , head : Elm.Expression -> Elm.Expression - , moduleName : List String - } - -> Scaffold.Route.Builder --} -preRender : - { data : Elm.Expression - , pages : Elm.Expression - , head : Elm.Expression -> Elm.Expression - , moduleName : List String - } - -> Elm.Expression -preRender preRenderArg_ = - Elm.apply - (Elm.value - { importFrom = [ "Scaffold", "Route" ] - , name = "preRender" - , annotation = - Just - (Type.function - [ Type.record - [ ( "data" - , Type.tuple - (Type.namedWith - [ "Scaffold", "Route" ] - "Type" - [] - ) - (Type.function - [ Type.namedWith - [ "Elm" ] - "Expression" - [] - ] - (Type.namedWith [ "Elm" ] "Expression" [] - ) - ) - ) - , ( "pages" - , Type.namedWith [ "Elm" ] "Expression" [] - ) - , ( "head" - , Type.function - [ Type.namedWith [ "Elm" ] "Expression" [] ] - (Type.namedWith [ "Elm" ] "Expression" []) - ) - , ( "moduleName", Type.list Type.string ) - ] - ] - (Type.namedWith [ "Scaffold", "Route" ] "Builder" []) - ) - } - ) - [ Elm.record - [ Tuple.pair "data" preRenderArg_.data - , Tuple.pair "pages" preRenderArg_.pages - , Tuple.pair - "head" - (Elm.functionReduced "preRenderUnpack" preRenderArg_.head) - , Tuple.pair - "moduleName" - (Elm.list (List.map Elm.string preRenderArg_.moduleName)) - ] - ] - - -{-| @depreacted. This is obsolete and will be removed in a future release. Use [`preRender`](#preRender) instead. - -If you pass in only static route segments as the `moduleName` to `preRender` it will yield the same result as `single`. - -single: - { data : ( Scaffold.Route.Type, Elm.Expression ) - , head : Elm.Expression -> Elm.Expression - , moduleName : List String - } - -> Scaffold.Route.Builder --} -single : - { data : Elm.Expression - , head : Elm.Expression -> Elm.Expression - , moduleName : List String - } - -> Elm.Expression -single singleArg_ = - Elm.apply - (Elm.value - { importFrom = [ "Scaffold", "Route" ] - , name = "single" - , annotation = - Just - (Type.function - [ Type.record - [ ( "data" - , Type.tuple - (Type.namedWith - [ "Scaffold", "Route" ] - "Type" - [] - ) - (Type.namedWith [ "Elm" ] "Expression" []) - ) - , ( "head" - , Type.function - [ Type.namedWith [ "Elm" ] "Expression" [] ] - (Type.namedWith [ "Elm" ] "Expression" []) - ) - , ( "moduleName", Type.list Type.string ) - ] - ] - (Type.namedWith [ "Scaffold", "Route" ] "Builder" []) - ) - } - ) - [ Elm.record - [ Tuple.pair "data" singleArg_.data - , Tuple.pair - "head" - (Elm.functionReduced "singleUnpack" singleArg_.head) - , Tuple.pair - "moduleName" - (Elm.list (List.map Elm.string singleArg_.moduleName)) - ] - ] - - -{-| The helpers in this module help you generate a Route module file with the core boilerplate abstracted away. - -You can also define additional top-level declarations in the generated Route module using this helper. - -addDeclarations: List Elm.Declaration -> Scaffold.Route.Builder -> Scaffold.Route.Builder --} -addDeclarations : List Elm.Expression -> Elm.Expression -> Elm.Expression -addDeclarations addDeclarationsArg_ addDeclarationsArg_0 = - Elm.apply - (Elm.value - { importFrom = [ "Scaffold", "Route" ] - , name = "addDeclarations" - , annotation = - Just - (Type.function - [ Type.list - (Type.namedWith [ "Elm" ] "Declaration" []) - , Type.namedWith [ "Scaffold", "Route" ] "Builder" [] - ] - (Type.namedWith [ "Scaffold", "Route" ] "Builder" []) - ) - } - ) - [ Elm.list addDeclarationsArg_, addDeclarationsArg_0 ] - - -{-| A positional argument for elm-cli-options-parser that does a Regex validation to check that the module name is a valid Elm Route module name. - -moduleNameCliArg: - Cli.Option.Option from String builderState - -> Cli.Option.Option from (List String) builderState --} -moduleNameCliArg : Elm.Expression -> Elm.Expression -moduleNameCliArg moduleNameCliArgArg_ = - Elm.apply - (Elm.value - { importFrom = [ "Scaffold", "Route" ] - , name = "moduleNameCliArg" - , annotation = - Just - (Type.function - [ Type.namedWith - [ "Cli", "Option" ] - "Option" - [ Type.var "from" - , Type.string - , Type.var "builderState" - ] - ] - (Type.namedWith - [ "Cli", "Option" ] - "Option" - [ Type.var "from" - , Type.list Type.string - , Type.var "builderState" - ] - ) - ) - } - ) - [ moduleNameCliArgArg_ ] - - -annotation_ : { builder : Type.Annotation, type_ : Type.Annotation } -annotation_ = - { builder = Type.namedWith [ "Scaffold", "Route" ] "Builder" [] - , type_ = Type.namedWith [ "Scaffold", "Route" ] "Type" [] - } - - -make_ : - { alias : Elm.Expression -> Elm.Expression - , custom : Elm.Expression -> Elm.Expression - } -make_ = - { alias = - \ar0 -> - Elm.apply - (Elm.value - { importFrom = [ "Scaffold", "Route" ] - , name = "Alias" - , annotation = Just (Type.namedWith [] "Type" []) - } - ) - [ ar0 ] - , custom = - \ar0 -> - Elm.apply - (Elm.value - { importFrom = [ "Scaffold", "Route" ] - , name = "Custom" - , annotation = Just (Type.namedWith [] "Type" []) - } - ) - [ ar0 ] - } - - -caseOf_ = - { type_ = - \typeExpression typeTags -> - Elm.Case.custom - typeExpression - (Type.namedWith [ "Scaffold", "Route" ] "Type" []) - [ Elm.Case.branch - (Elm.Arg.customType "Alias" typeTags.alias |> Elm.Arg.item - (Elm.Arg.varWith - "elmAnnotationAnnotation" - (Type.namedWith - [ "Elm" - , "Annotation" - ] - "Annotation" - [] - ) - ) - ) - Basics.identity - , Elm.Case.branch - (Elm.Arg.customType "Custom" typeTags.custom |> Elm.Arg.item - (Elm.Arg.varWith - "arg_0" - (Type.list - (Type.namedWith - [ "Elm" - ] - "Variant" - [] - ) - ) - ) - ) - Basics.identity - ] - } - - -call_ : - { buildWithLocalState : Elm.Expression -> Elm.Expression -> Elm.Expression - , buildWithSharedState : Elm.Expression -> Elm.Expression -> Elm.Expression - , buildNoState : Elm.Expression -> Elm.Expression -> Elm.Expression - , serverRender : Elm.Expression -> Elm.Expression - , preRender : Elm.Expression -> Elm.Expression - , single : Elm.Expression -> Elm.Expression - , addDeclarations : Elm.Expression -> Elm.Expression -> Elm.Expression - , moduleNameCliArg : Elm.Expression -> Elm.Expression - } -call_ = - { buildWithLocalState = - \buildWithLocalStateArg_ buildWithLocalStateArg_0 -> - Elm.apply - (Elm.value - { importFrom = [ "Scaffold", "Route" ] - , name = "buildWithLocalState" - , annotation = - Just - (Type.function - [ Type.record - [ ( "view" - , Type.function - [ Type.record - [ ( "shared" - , Type.namedWith - [ "Elm" ] - "Expression" - [] - ) - , ( "model" - , Type.namedWith - [ "Elm" ] - "Expression" - [] - ) - , ( "app" - , Type.namedWith - [ "Elm" ] - "Expression" - [] - ) - ] - ] - (Type.namedWith - [ "Elm" ] - "Expression" - [] - ) - ) - , ( "update" - , Type.function - [ Type.record - [ ( "shared" - , Type.namedWith - [ "Elm" ] - "Expression" - [] - ) - , ( "app" - , Type.namedWith - [ "Elm" ] - "Expression" - [] - ) - , ( "msg" - , Type.namedWith - [ "Elm" ] - "Expression" - [] - ) - , ( "model" - , Type.namedWith - [ "Elm" ] - "Expression" - [] - ) - ] - ] - (Type.namedWith - [ "Elm" ] - "Expression" - [] - ) - ) - , ( "init" - , Type.function - [ Type.record - [ ( "shared" - , Type.namedWith - [ "Elm" ] - "Expression" - [] - ) - , ( "app" - , Type.namedWith - [ "Elm" ] - "Expression" - [] - ) - ] - ] - (Type.namedWith - [ "Elm" ] - "Expression" - [] - ) - ) - , ( "subscriptions" - , Type.function - [ Type.record - [ ( "routeParams" - , Type.namedWith - [ "Elm" ] - "Expression" - [] - ) - , ( "path" - , Type.namedWith - [ "Elm" ] - "Expression" - [] - ) - , ( "shared" - , Type.namedWith - [ "Elm" ] - "Expression" - [] - ) - , ( "model" - , Type.namedWith - [ "Elm" ] - "Expression" - [] - ) - ] - ] - (Type.namedWith - [ "Elm" ] - "Expression" - [] - ) - ) - , ( "msg" - , Type.namedWith - [ "Scaffold", "Route" ] - "Type" - [] - ) - , ( "model" - , Type.namedWith - [ "Scaffold", "Route" ] - "Type" - [] - ) - ] - , Type.namedWith - [ "Scaffold", "Route" ] - "Builder" - [] - ] - (Type.record - [ ( "path", Type.string ) - , ( "body", Type.string ) - ] - ) - ) - } - ) - [ buildWithLocalStateArg_, buildWithLocalStateArg_0 ] - , buildWithSharedState = - \buildWithSharedStateArg_ buildWithSharedStateArg_0 -> - Elm.apply - (Elm.value - { importFrom = [ "Scaffold", "Route" ] - , name = "buildWithSharedState" - , annotation = - Just - (Type.function - [ Type.record - [ ( "view" - , Type.function - [ Type.record - [ ( "shared" - , Type.namedWith - [ "Elm" ] - "Expression" - [] - ) - , ( "model" - , Type.namedWith - [ "Elm" ] - "Expression" - [] - ) - , ( "app" - , Type.namedWith - [ "Elm" ] - "Expression" - [] - ) - ] - ] - (Type.namedWith - [ "Elm" ] - "Expression" - [] - ) - ) - , ( "update" - , Type.function - [ Type.record - [ ( "shared" - , Type.namedWith - [ "Elm" ] - "Expression" - [] - ) - , ( "app" - , Type.namedWith - [ "Elm" ] - "Expression" - [] - ) - , ( "msg" - , Type.namedWith - [ "Elm" ] - "Expression" - [] - ) - , ( "model" - , Type.namedWith - [ "Elm" ] - "Expression" - [] - ) - ] - ] - (Type.namedWith - [ "Elm" ] - "Expression" - [] - ) - ) - , ( "init" - , Type.function - [ Type.record - [ ( "shared" - , Type.namedWith - [ "Elm" ] - "Expression" - [] - ) - , ( "app" - , Type.namedWith - [ "Elm" ] - "Expression" - [] - ) - ] - ] - (Type.namedWith - [ "Elm" ] - "Expression" - [] - ) - ) - , ( "subscriptions" - , Type.function - [ Type.record - [ ( "routeParams" - , Type.namedWith - [ "Elm" ] - "Expression" - [] - ) - , ( "path" - , Type.namedWith - [ "Elm" ] - "Expression" - [] - ) - , ( "shared" - , Type.namedWith - [ "Elm" ] - "Expression" - [] - ) - , ( "model" - , Type.namedWith - [ "Elm" ] - "Expression" - [] - ) - ] - ] - (Type.namedWith - [ "Elm" ] - "Expression" - [] - ) - ) - , ( "msg" - , Type.namedWith - [ "Scaffold", "Route" ] - "Type" - [] - ) - , ( "model" - , Type.namedWith - [ "Scaffold", "Route" ] - "Type" - [] - ) - ] - , Type.namedWith - [ "Scaffold", "Route" ] - "Builder" - [] - ] - (Type.record - [ ( "path", Type.string ) - , ( "body", Type.string ) - ] - ) - ) - } - ) - [ buildWithSharedStateArg_, buildWithSharedStateArg_0 ] - , buildNoState = - \buildNoStateArg_ buildNoStateArg_0 -> - Elm.apply - (Elm.value - { importFrom = [ "Scaffold", "Route" ] - , name = "buildNoState" - , annotation = - Just - (Type.function - [ Type.record - [ ( "view" - , Type.function - [ Type.record - [ ( "shared" - , Type.namedWith - [ "Elm" ] - "Expression" - [] - ) - , ( "app" - , Type.namedWith - [ "Elm" ] - "Expression" - [] - ) - ] - ] - (Type.namedWith - [ "Elm" ] - "Expression" - [] - ) - ) - ] - , Type.namedWith - [ "Scaffold", "Route" ] - "Builder" - [] - ] - (Type.record - [ ( "path", Type.string ) - , ( "body", Type.string ) - ] - ) - ) - } - ) - [ buildNoStateArg_, buildNoStateArg_0 ] - , serverRender = - \serverRenderArg_ -> - Elm.apply - (Elm.value - { importFrom = [ "Scaffold", "Route" ] - , name = "serverRender" - , annotation = - Just - (Type.function - [ Type.record - [ ( "data" - , Type.tuple - (Type.namedWith - [ "Scaffold", "Route" ] - "Type" - [] - ) - (Type.function - [ Type.namedWith - [ "Elm" ] - "Expression" - [] - , Type.namedWith - [ "Elm" ] - "Expression" - [] - ] - (Type.namedWith - [ "Elm" ] - "Expression" - [] - ) - ) - ) - , ( "action" - , Type.tuple - (Type.namedWith - [ "Scaffold", "Route" ] - "Type" - [] - ) - (Type.function - [ Type.namedWith - [ "Elm" ] - "Expression" - [] - , Type.namedWith - [ "Elm" ] - "Expression" - [] - ] - (Type.namedWith - [ "Elm" ] - "Expression" - [] - ) - ) - ) - , ( "head" - , Type.function - [ Type.namedWith - [ "Elm" ] - "Expression" - [] - ] - (Type.namedWith - [ "Elm" ] - "Expression" - [] - ) - ) - , ( "moduleName", Type.list Type.string ) - ] - ] - (Type.namedWith - [ "Scaffold", "Route" ] - "Builder" - [] - ) - ) - } - ) - [ serverRenderArg_ ] - , preRender = - \preRenderArg_ -> - Elm.apply - (Elm.value - { importFrom = [ "Scaffold", "Route" ] - , name = "preRender" - , annotation = - Just - (Type.function - [ Type.record - [ ( "data" - , Type.tuple - (Type.namedWith - [ "Scaffold", "Route" ] - "Type" - [] - ) - (Type.function - [ Type.namedWith - [ "Elm" ] - "Expression" - [] - ] - (Type.namedWith - [ "Elm" ] - "Expression" - [] - ) - ) - ) - , ( "pages" - , Type.namedWith - [ "Elm" ] - "Expression" - [] - ) - , ( "head" - , Type.function - [ Type.namedWith - [ "Elm" ] - "Expression" - [] - ] - (Type.namedWith - [ "Elm" ] - "Expression" - [] - ) - ) - , ( "moduleName", Type.list Type.string ) - ] - ] - (Type.namedWith - [ "Scaffold", "Route" ] - "Builder" - [] - ) - ) - } - ) - [ preRenderArg_ ] - , single = - \singleArg_ -> - Elm.apply - (Elm.value - { importFrom = [ "Scaffold", "Route" ] - , name = "single" - , annotation = - Just - (Type.function - [ Type.record - [ ( "data" - , Type.tuple - (Type.namedWith - [ "Scaffold", "Route" ] - "Type" - [] - ) - (Type.namedWith - [ "Elm" ] - "Expression" - [] - ) - ) - , ( "head" - , Type.function - [ Type.namedWith - [ "Elm" ] - "Expression" - [] - ] - (Type.namedWith - [ "Elm" ] - "Expression" - [] - ) - ) - , ( "moduleName", Type.list Type.string ) - ] - ] - (Type.namedWith - [ "Scaffold", "Route" ] - "Builder" - [] - ) - ) - } - ) - [ singleArg_ ] - , addDeclarations = - \addDeclarationsArg_ addDeclarationsArg_0 -> - Elm.apply - (Elm.value - { importFrom = [ "Scaffold", "Route" ] - , name = "addDeclarations" - , annotation = - Just - (Type.function - [ Type.list - (Type.namedWith [ "Elm" ] "Declaration" [] - ) - , Type.namedWith - [ "Scaffold", "Route" ] - "Builder" - [] - ] - (Type.namedWith - [ "Scaffold", "Route" ] - "Builder" - [] - ) - ) - } - ) - [ addDeclarationsArg_, addDeclarationsArg_0 ] - , moduleNameCliArg = - \moduleNameCliArgArg_ -> - Elm.apply - (Elm.value - { importFrom = [ "Scaffold", "Route" ] - , name = "moduleNameCliArg" - , annotation = - Just - (Type.function - [ Type.namedWith - [ "Cli", "Option" ] - "Option" - [ Type.var "from" - , Type.string - , Type.var "builderState" - ] - ] - (Type.namedWith - [ "Cli", "Option" ] - "Option" - [ Type.var "from" - , Type.list Type.string - , Type.var "builderState" - ] - ) - ) - } - ) - [ moduleNameCliArgArg_ ] - } - - -values_ : - { buildWithLocalState : Elm.Expression - , buildWithSharedState : Elm.Expression - , buildNoState : Elm.Expression - , serverRender : Elm.Expression - , preRender : Elm.Expression - , single : Elm.Expression - , addDeclarations : Elm.Expression - , moduleNameCliArg : Elm.Expression - } -values_ = - { buildWithLocalState = - Elm.value - { importFrom = [ "Scaffold", "Route" ] - , name = "buildWithLocalState" - , annotation = - Just - (Type.function - [ Type.record - [ ( "view" - , Type.function - [ Type.record - [ ( "shared" - , Type.namedWith - [ "Elm" ] - "Expression" - [] - ) - , ( "model" - , Type.namedWith - [ "Elm" ] - "Expression" - [] - ) - , ( "app" - , Type.namedWith - [ "Elm" ] - "Expression" - [] - ) - ] - ] - (Type.namedWith [ "Elm" ] "Expression" []) - ) - , ( "update" - , Type.function - [ Type.record - [ ( "shared" - , Type.namedWith - [ "Elm" ] - "Expression" - [] - ) - , ( "app" - , Type.namedWith - [ "Elm" ] - "Expression" - [] - ) - , ( "msg" - , Type.namedWith - [ "Elm" ] - "Expression" - [] - ) - , ( "model" - , Type.namedWith - [ "Elm" ] - "Expression" - [] - ) - ] - ] - (Type.namedWith [ "Elm" ] "Expression" []) - ) - , ( "init" - , Type.function - [ Type.record - [ ( "shared" - , Type.namedWith - [ "Elm" ] - "Expression" - [] - ) - , ( "app" - , Type.namedWith - [ "Elm" ] - "Expression" - [] - ) - ] - ] - (Type.namedWith [ "Elm" ] "Expression" []) - ) - , ( "subscriptions" - , Type.function - [ Type.record - [ ( "routeParams" - , Type.namedWith - [ "Elm" ] - "Expression" - [] - ) - , ( "path" - , Type.namedWith - [ "Elm" ] - "Expression" - [] - ) - , ( "shared" - , Type.namedWith - [ "Elm" ] - "Expression" - [] - ) - , ( "model" - , Type.namedWith - [ "Elm" ] - "Expression" - [] - ) - ] - ] - (Type.namedWith [ "Elm" ] "Expression" []) - ) - , ( "msg" - , Type.namedWith - [ "Scaffold", "Route" ] - "Type" - [] - ) - , ( "model" - , Type.namedWith - [ "Scaffold", "Route" ] - "Type" - [] - ) - ] - , Type.namedWith [ "Scaffold", "Route" ] "Builder" [] - ] - (Type.record - [ ( "path", Type.string ) - , ( "body", Type.string ) - ] - ) - ) - } - , buildWithSharedState = - Elm.value - { importFrom = [ "Scaffold", "Route" ] - , name = "buildWithSharedState" - , annotation = - Just - (Type.function - [ Type.record - [ ( "view" - , Type.function - [ Type.record - [ ( "shared" - , Type.namedWith - [ "Elm" ] - "Expression" - [] - ) - , ( "model" - , Type.namedWith - [ "Elm" ] - "Expression" - [] - ) - , ( "app" - , Type.namedWith - [ "Elm" ] - "Expression" - [] - ) - ] - ] - (Type.namedWith [ "Elm" ] "Expression" []) - ) - , ( "update" - , Type.function - [ Type.record - [ ( "shared" - , Type.namedWith - [ "Elm" ] - "Expression" - [] - ) - , ( "app" - , Type.namedWith - [ "Elm" ] - "Expression" - [] - ) - , ( "msg" - , Type.namedWith - [ "Elm" ] - "Expression" - [] - ) - , ( "model" - , Type.namedWith - [ "Elm" ] - "Expression" - [] - ) - ] - ] - (Type.namedWith [ "Elm" ] "Expression" []) - ) - , ( "init" - , Type.function - [ Type.record - [ ( "shared" - , Type.namedWith - [ "Elm" ] - "Expression" - [] - ) - , ( "app" - , Type.namedWith - [ "Elm" ] - "Expression" - [] - ) - ] - ] - (Type.namedWith [ "Elm" ] "Expression" []) - ) - , ( "subscriptions" - , Type.function - [ Type.record - [ ( "routeParams" - , Type.namedWith - [ "Elm" ] - "Expression" - [] - ) - , ( "path" - , Type.namedWith - [ "Elm" ] - "Expression" - [] - ) - , ( "shared" - , Type.namedWith - [ "Elm" ] - "Expression" - [] - ) - , ( "model" - , Type.namedWith - [ "Elm" ] - "Expression" - [] - ) - ] - ] - (Type.namedWith [ "Elm" ] "Expression" []) - ) - , ( "msg" - , Type.namedWith - [ "Scaffold", "Route" ] - "Type" - [] - ) - , ( "model" - , Type.namedWith - [ "Scaffold", "Route" ] - "Type" - [] - ) - ] - , Type.namedWith [ "Scaffold", "Route" ] "Builder" [] - ] - (Type.record - [ ( "path", Type.string ) - , ( "body", Type.string ) - ] - ) - ) - } - , buildNoState = - Elm.value - { importFrom = [ "Scaffold", "Route" ] - , name = "buildNoState" - , annotation = - Just - (Type.function - [ Type.record - [ ( "view" - , Type.function - [ Type.record - [ ( "shared" - , Type.namedWith - [ "Elm" ] - "Expression" - [] - ) - , ( "app" - , Type.namedWith - [ "Elm" ] - "Expression" - [] - ) - ] - ] - (Type.namedWith [ "Elm" ] "Expression" []) - ) - ] - , Type.namedWith [ "Scaffold", "Route" ] "Builder" [] - ] - (Type.record - [ ( "path", Type.string ) - , ( "body", Type.string ) - ] - ) - ) - } - , serverRender = - Elm.value - { importFrom = [ "Scaffold", "Route" ] - , name = "serverRender" - , annotation = - Just - (Type.function - [ Type.record - [ ( "data" - , Type.tuple - (Type.namedWith - [ "Scaffold", "Route" ] - "Type" - [] - ) - (Type.function - [ Type.namedWith [ "Elm" ] "Expression" [] - , Type.namedWith [ "Elm" ] "Expression" [] - ] - (Type.namedWith [ "Elm" ] "Expression" []) - ) - ) - , ( "action" - , Type.tuple - (Type.namedWith - [ "Scaffold", "Route" ] - "Type" - [] - ) - (Type.function - [ Type.namedWith [ "Elm" ] "Expression" [] - , Type.namedWith [ "Elm" ] "Expression" [] - ] - (Type.namedWith [ "Elm" ] "Expression" []) - ) - ) - , ( "head" - , Type.function - [ Type.namedWith [ "Elm" ] "Expression" [] ] - (Type.namedWith [ "Elm" ] "Expression" []) - ) - , ( "moduleName", Type.list Type.string ) - ] - ] - (Type.namedWith [ "Scaffold", "Route" ] "Builder" []) - ) - } - , preRender = - Elm.value - { importFrom = [ "Scaffold", "Route" ] - , name = "preRender" - , annotation = - Just - (Type.function - [ Type.record - [ ( "data" - , Type.tuple - (Type.namedWith - [ "Scaffold", "Route" ] - "Type" - [] - ) - (Type.function - [ Type.namedWith [ "Elm" ] "Expression" [] - ] - (Type.namedWith [ "Elm" ] "Expression" []) - ) - ) - , ( "pages" - , Type.namedWith [ "Elm" ] "Expression" [] - ) - , ( "head" - , Type.function - [ Type.namedWith [ "Elm" ] "Expression" [] ] - (Type.namedWith [ "Elm" ] "Expression" []) - ) - , ( "moduleName", Type.list Type.string ) - ] - ] - (Type.namedWith [ "Scaffold", "Route" ] "Builder" []) - ) - } - , single = - Elm.value - { importFrom = [ "Scaffold", "Route" ] - , name = "single" - , annotation = - Just - (Type.function - [ Type.record - [ ( "data" - , Type.tuple - (Type.namedWith - [ "Scaffold", "Route" ] - "Type" - [] - ) - (Type.namedWith [ "Elm" ] "Expression" []) - ) - , ( "head" - , Type.function - [ Type.namedWith [ "Elm" ] "Expression" [] ] - (Type.namedWith [ "Elm" ] "Expression" []) - ) - , ( "moduleName", Type.list Type.string ) - ] - ] - (Type.namedWith [ "Scaffold", "Route" ] "Builder" []) - ) - } - , addDeclarations = - Elm.value - { importFrom = [ "Scaffold", "Route" ] - , name = "addDeclarations" - , annotation = - Just - (Type.function - [ Type.list (Type.namedWith [ "Elm" ] "Declaration" []) - , Type.namedWith [ "Scaffold", "Route" ] "Builder" [] - ] - (Type.namedWith [ "Scaffold", "Route" ] "Builder" []) - ) - } - , moduleNameCliArg = - Elm.value - { importFrom = [ "Scaffold", "Route" ] - , name = "moduleNameCliArg" - , annotation = - Just - (Type.function - [ Type.namedWith - [ "Cli", "Option" ] - "Option" - [ Type.var "from" - , Type.string - , Type.var "builderState" - ] - ] - (Type.namedWith - [ "Cli", "Option" ] - "Option" - [ Type.var "from" - , Type.list Type.string - , Type.var "builderState" - ] - ) - ) - } - } \ No newline at end of file diff --git a/elm-open-api-codegen/src/Gen/Server/Request.elm b/elm-open-api-codegen/src/Gen/Server/Request.elm deleted file mode 100644 index cfe1569f..00000000 --- a/elm-open-api-codegen/src/Gen/Server/Request.elm +++ /dev/null @@ -1,1502 +0,0 @@ -module Gen.Server.Request exposing - ( moduleName_, requestTime, header, headers, method, methodToString - , body, jsonBody, formData, formDataWithServerValidation, rawFormData, rawUrl, queryParam - , queryParams, matchesContentType, cookie, cookies, annotation_, make_, caseOf_ - , call_, values_ - ) - -{-| -# Generated bindings for Server.Request - -@docs moduleName_, requestTime, header, headers, method, methodToString -@docs body, jsonBody, formData, formDataWithServerValidation, rawFormData, rawUrl -@docs queryParam, queryParams, matchesContentType, cookie, cookies, annotation_ -@docs make_, caseOf_, call_, values_ --} - - -import Elm -import Elm.Annotation as Type -import Elm.Arg -import Elm.Case - - -{-| The name of this module. -} -moduleName_ : List String -moduleName_ = - [ "Server", "Request" ] - - -{-| Get the `Time.Posix` when the incoming HTTP request was received. - -requestTime: Server.Request.Request -> Time.Posix --} -requestTime : Elm.Expression -> Elm.Expression -requestTime requestTimeArg_ = - Elm.apply - (Elm.value - { importFrom = [ "Server", "Request" ] - , name = "requestTime" - , annotation = - Just - (Type.function - [ Type.namedWith [ "Server", "Request" ] "Request" [] - ] - (Type.namedWith [ "Time" ] "Posix" []) - ) - } - ) - [ requestTimeArg_ ] - - -{-| Get a header from the request. The header name is case-insensitive. - -Header: Accept-Language: en-US,en;q=0.5 - - request |> Request.header "Accept-Language" - -- Just "Accept-Language: en-US,en;q=0.5" - -header: String -> Server.Request.Request -> Maybe String --} -header : String -> Elm.Expression -> Elm.Expression -header headerArg_ headerArg_0 = - Elm.apply - (Elm.value - { importFrom = [ "Server", "Request" ] - , name = "header" - , annotation = - Just - (Type.function - [ Type.string - , Type.namedWith [ "Server", "Request" ] "Request" [] - ] - (Type.maybe Type.string) - ) - } - ) - [ Elm.string headerArg_, headerArg_0 ] - - -{-| headers: Server.Request.Request -> Dict.Dict String String -} -headers : Elm.Expression -> Elm.Expression -headers headersArg_ = - Elm.apply - (Elm.value - { importFrom = [ "Server", "Request" ] - , name = "headers" - , annotation = - Just - (Type.function - [ Type.namedWith [ "Server", "Request" ] "Request" [] - ] - (Type.namedWith - [ "Dict" ] - "Dict" - [ Type.string, Type.string ] - ) - ) - } - ) - [ headersArg_ ] - - -{-| The [HTTP request method](https://developer.mozilla.org/en-US/docs/Web/HTTP/Methods) of the incoming request. - -Note that Route modules `data` is run for `GET` requests, and `action` is run for other request methods (including `POST`, `PUT`, `DELETE`). -So you don't need to check the `method` in your Route Module's `data` function, though you can choose to do so in its `action`. - -method: Server.Request.Request -> Server.Request.Method --} -method : Elm.Expression -> Elm.Expression -method methodArg_ = - Elm.apply - (Elm.value - { importFrom = [ "Server", "Request" ] - , name = "method" - , annotation = - Just - (Type.function - [ Type.namedWith [ "Server", "Request" ] "Request" [] - ] - (Type.namedWith [ "Server", "Request" ] "Method" []) - ) - } - ) - [ methodArg_ ] - - -{-| Gets the HTTP Method as an uppercase String. - -Examples: - - Get - |> methodToString - -- "GET" - -methodToString: Server.Request.Method -> String --} -methodToString : Elm.Expression -> Elm.Expression -methodToString methodToStringArg_ = - Elm.apply - (Elm.value - { importFrom = [ "Server", "Request" ] - , name = "methodToString" - , annotation = - Just - (Type.function - [ Type.namedWith [ "Server", "Request" ] "Method" [] ] - Type.string - ) - } - ) - [ methodToStringArg_ ] - - -{-| The Request body, if present (or `Nothing` if there is no request body). - -body: Server.Request.Request -> Maybe String --} -body : Elm.Expression -> Elm.Expression -body bodyArg_ = - Elm.apply - (Elm.value - { importFrom = [ "Server", "Request" ] - , name = "body" - , annotation = - Just - (Type.function - [ Type.namedWith [ "Server", "Request" ] "Request" [] - ] - (Type.maybe Type.string) - ) - } - ) - [ bodyArg_ ] - - -{-| If the request has a body and its `Content-Type` matches JSON, then -try running a JSON decoder on the body of the request. Otherwise, return `Nothing`. - -Example: - - Body: { "name": "John" } - Headers: - Content-Type: application/json - request |> jsonBody (Json.Decode.field "name" Json.Decode.string) - -- Just (Ok "John") - - Body: { "name": "John" } - No Headers - jsonBody (Json.Decode.field "name" Json.Decode.string) request - -- Nothing - - No Body - No Headers - jsonBody (Json.Decode.field "name" Json.Decode.string) request - -- Nothing - -jsonBody: - Json.Decode.Decoder value - -> Server.Request.Request - -> Maybe (Result.Result Json.Decode.Error value) --} -jsonBody : Elm.Expression -> Elm.Expression -> Elm.Expression -jsonBody jsonBodyArg_ jsonBodyArg_0 = - Elm.apply - (Elm.value - { importFrom = [ "Server", "Request" ] - , name = "jsonBody" - , annotation = - Just - (Type.function - [ Type.namedWith - [ "Json", "Decode" ] - "Decoder" - [ Type.var "value" ] - , Type.namedWith [ "Server", "Request" ] "Request" [] - ] - (Type.maybe - (Type.namedWith - [ "Result" ] - "Result" - [ Type.namedWith - [ "Json", "Decode" ] - "Error" - [] - , Type.var "value" - ] - ) - ) - ) - } - ) - [ jsonBodyArg_, jsonBodyArg_0 ] - - -{-| Takes a [`Form.Handler.Handler`](https://package.elm-lang.org/packages/dillonkearns/elm-form/latest/Form-Handler) and -parses the raw form data into a [`Form.Validated`](https://package.elm-lang.org/packages/dillonkearns/elm-form/latest/Form#Validated) value. - -This is the standard pattern for dealing with form data in `elm-pages`. You can share your code for your [`Form`](https://package.elm-lang.org/packages/dillonkearns/elm-form/latest/Form#Form) -definitions between your client and server code, using this function to parse the raw form data into a `Form.Validated` value for the backend, -and [`Pages.Form`](Pages-Form) to render the `Form` on the client. - -Since we are sharing the `Form` definition between frontend and backend, we get to re-use the same validation logic so we gain confidence that -the validation errors that the user sees on the client are protected on our backend, and vice versa. - - import BackendTask exposing (BackendTask) - import FatalError exposing (FatalError) - import Form - import Server.Request as Request exposing (Request) - import Server.Response as Response exposing (Response) - - type Action - = Delete - | CreateOrUpdate Post - - formHandlers : Form.Handler.Handler String Action - formHandlers = - deleteForm - |> Form.Handler.init (\() -> Delete) - |> Form.Handler.with CreateOrUpdate createOrUpdateForm - - deleteForm : Form.HtmlForm String () input msg - - createOrUpdateForm : Form.HtmlForm String Post Post msg - - action : - RouteParams - -> Request - -> BackendTask FatalError (Response ActionData ErrorPage) - action routeParams request = - case request |> Server.Request.formData formHandlers of - Nothing -> - BackendTask.fail (FatalError.fromString "Missing form data") - - Just ( formResponse, parsedForm ) -> - case parsedForm of - Form.Valid Delete -> - deletePostBySlug routeParams.slug - |> BackendTask.map - (\() -> Route.redirectTo Route.Index) - - Form.Valid (CreateOrUpdate post) -> - let - createPost : Bool - createPost = - okForm.slug == "new" - in - createOrUpdatePost post - |> BackendTask.map - (\() -> - Route.redirectTo - (Route.Admin__Slug_ { slug = okForm.slug }) - ) - - Form.Invalid _ invalidForm -> - BackendTask.succeed - (Server.Response.render - { errors = formResponse } - ) - -You can handle form submissions as either GET or POST requests. Note that for security reasons, it's important to performing mutations with care from GET requests, -since a GET request can be performed from an outside origin by embedding an image that points to the given URL. So a logout submission should be protected by -using `POST` to ensure that you can't log users out by embedding an image with a logout URL in it. - -If the request has HTTP method `GET`, the form data will come from the query parameters. - -If the request has the HTTP method `POST` _and_ the `Content-Type` is `application/x-www-form-urlencoded`, it will return the -decoded form data from the body of the request. - -Otherwise, this `Parser` will not match. - -Note that in server-rendered Route modules, your `data` function will handle `GET` requests (and will _not_ receive any `POST` requests), -while your `action` will receive POST (and other non-GET) requests. - -By default, [`Form`]'s are rendered with a `POST` method, and you can configure them to submit `GET` requests using [`withGetMethod`](https://package.elm-lang.org/packages/dillonkearns/elm-form/latest/Form#withGetMethod). -So you will want to handle any `Form`'s rendered using `withGetMethod` in your Route's `data` function, or otherwise handle forms in `action`. - -formData: - Form.Handler.Handler error combined - -> Server.Request.Request - -> Maybe ( Form.ServerResponse error, Form.Validated error combined ) --} -formData : Elm.Expression -> Elm.Expression -> Elm.Expression -formData formDataArg_ formDataArg_0 = - Elm.apply - (Elm.value - { importFrom = [ "Server", "Request" ] - , name = "formData" - , annotation = - Just - (Type.function - [ Type.namedWith - [ "Form", "Handler" ] - "Handler" - [ Type.var "error", Type.var "combined" ] - , Type.namedWith [ "Server", "Request" ] "Request" [] - ] - (Type.maybe - (Type.tuple - (Type.namedWith - [ "Form" ] - "ServerResponse" - [ Type.var "error" ] - ) - (Type.namedWith - [ "Form" ] - "Validated" - [ Type.var "error" - , Type.var "combined" - ] - ) - ) - ) - ) - } - ) - [ formDataArg_, formDataArg_0 ] - - -{-| formDataWithServerValidation: - Pages.Form.Handler error combined - -> Server.Request.Request - -> Maybe (BackendTask.BackendTask FatalError.FatalError (Result.Result (Form.ServerResponse error) ( Form.ServerResponse error, combined ))) --} -formDataWithServerValidation : - Elm.Expression -> Elm.Expression -> Elm.Expression -formDataWithServerValidation formDataWithServerValidationArg_ formDataWithServerValidationArg_0 = - Elm.apply - (Elm.value - { importFrom = [ "Server", "Request" ] - , name = "formDataWithServerValidation" - , annotation = - Just - (Type.function - [ Type.namedWith - [ "Pages", "Form" ] - "Handler" - [ Type.var "error", Type.var "combined" ] - , Type.namedWith [ "Server", "Request" ] "Request" [] - ] - (Type.maybe - (Type.namedWith - [ "BackendTask" ] - "BackendTask" - [ Type.namedWith - [ "FatalError" ] - "FatalError" - [] - , Type.namedWith - [ "Result" ] - "Result" - [ Type.namedWith - [ "Form" ] - "ServerResponse" - [ Type.var "error" ] - , Type.tuple - (Type.namedWith - [ "Form" ] - "ServerResponse" - [ Type.var "error" ] - ) - (Type.var "combined") - ] - ] - ) - ) - ) - } - ) - [ formDataWithServerValidationArg_, formDataWithServerValidationArg_0 ] - - -{-| Get the raw key-value pairs from a form submission. - -If the request has the HTTP method `GET`, it will return the query parameters. - -If the request has the HTTP method `POST` _and_ the `Content-Type` is `application/x-www-form-urlencoded`, it will return the -decoded form data from the body of the request. - -Otherwise, this `Parser` will not match. - -Note that in server-rendered Route modules, your `data` function will handle `GET` requests (and will _not_ receive any `POST` requests), -while your `action` will receive POST (and other non-GET) requests. - -By default, [`Form`]'s are rendered with a `POST` method, and you can configure them to submit `GET` requests using [`withGetMethod`](https://package.elm-lang.org/packages/dillonkearns/elm-form/latest/Form#withGetMethod). -So you will want to handle any `Form`'s rendered using `withGetMethod` in your Route's `data` function, or otherwise handle forms in `action`. - -rawFormData: Server.Request.Request -> Maybe (List ( String, String )) --} -rawFormData : Elm.Expression -> Elm.Expression -rawFormData rawFormDataArg_ = - Elm.apply - (Elm.value - { importFrom = [ "Server", "Request" ] - , name = "rawFormData" - , annotation = - Just - (Type.function - [ Type.namedWith [ "Server", "Request" ] "Request" [] - ] - (Type.maybe - (Type.list (Type.tuple Type.string Type.string)) - ) - ) - } - ) - [ rawFormDataArg_ ] - - -{-| The full URL of the incoming HTTP request, including the query params. - -Note that the fragment is not included because this is client-only (not sent to the server). - - rawUrl request - - -- url: http://example.com?coupon=abc - -- parses into: "http://example.com?coupon=abc" - - rawUrl request - - -- url: https://example.com?coupon=abc&coupon=xyz - -- parses into: "https://example.com?coupon=abc&coupon=xyz" - -rawUrl: Server.Request.Request -> String --} -rawUrl : Elm.Expression -> Elm.Expression -rawUrl rawUrlArg_ = - Elm.apply - (Elm.value - { importFrom = [ "Server", "Request" ] - , name = "rawUrl" - , annotation = - Just - (Type.function - [ Type.namedWith [ "Server", "Request" ] "Request" [] - ] - Type.string - ) - } - ) - [ rawUrlArg_ ] - - -{-| Get `Nothing` if the query param with the given name is missing, or `Just` the value if it is present. - -If there are multiple query params with the same name, the first one is returned. - - queryParam "coupon" - - -- url: http://example.com?coupon=abc - -- parses into: Just "abc" - - queryParam "coupon" - - -- url: http://example.com?coupon=abc&coupon=xyz - -- parses into: Just "abc" - - queryParam "coupon" - - -- url: http://example.com - -- parses into: Nothing - -See also [`queryParams`](#queryParams), or [`rawUrl`](#rawUrl) if you need something more low-level. - -queryParam: String -> Server.Request.Request -> Maybe String --} -queryParam : String -> Elm.Expression -> Elm.Expression -queryParam queryParamArg_ queryParamArg_0 = - Elm.apply - (Elm.value - { importFrom = [ "Server", "Request" ] - , name = "queryParam" - , annotation = - Just - (Type.function - [ Type.string - , Type.namedWith [ "Server", "Request" ] "Request" [] - ] - (Type.maybe Type.string) - ) - } - ) - [ Elm.string queryParamArg_, queryParamArg_0 ] - - -{-| Gives all query params from the URL. - - queryParam "coupon" - - -- url: http://example.com?coupon=abc - -- parses into: Dict.fromList [("coupon", ["abc"])] - - queryParam "coupon" - - -- url: http://example.com?coupon=abc&coupon=xyz - -- parses into: Dict.fromList [("coupon", ["abc", "xyz"])] - -queryParams: Server.Request.Request -> Dict.Dict String (List String) --} -queryParams : Elm.Expression -> Elm.Expression -queryParams queryParamsArg_ = - Elm.apply - (Elm.value - { importFrom = [ "Server", "Request" ] - , name = "queryParams" - , annotation = - Just - (Type.function - [ Type.namedWith [ "Server", "Request" ] "Request" [] - ] - (Type.namedWith - [ "Dict" ] - "Dict" - [ Type.string, Type.list Type.string ] - ) - ) - } - ) - [ queryParamsArg_ ] - - -{-| True if the `content-type` header is present AND matches the given argument. - -Examples: - - Content-Type: application/json; charset=utf-8 - request |> matchesContentType "application/json" - -- True - - Content-Type: application/json - request |> matchesContentType "application/json" - -- True - - Content-Type: application/json - request |> matchesContentType "application/xml" - -- False - -matchesContentType: String -> Server.Request.Request -> Bool --} -matchesContentType : String -> Elm.Expression -> Elm.Expression -matchesContentType matchesContentTypeArg_ matchesContentTypeArg_0 = - Elm.apply - (Elm.value - { importFrom = [ "Server", "Request" ] - , name = "matchesContentType" - , annotation = - Just - (Type.function - [ Type.string - , Type.namedWith [ "Server", "Request" ] "Request" [] - ] - Type.bool - ) - } - ) - [ Elm.string matchesContentTypeArg_, matchesContentTypeArg_0 ] - - -{-| Get a cookie from the request. For a more high-level API, see [`Server.Session`](Server-Session). - -cookie: String -> Server.Request.Request -> Maybe String --} -cookie : String -> Elm.Expression -> Elm.Expression -cookie cookieArg_ cookieArg_0 = - Elm.apply - (Elm.value - { importFrom = [ "Server", "Request" ] - , name = "cookie" - , annotation = - Just - (Type.function - [ Type.string - , Type.namedWith [ "Server", "Request" ] "Request" [] - ] - (Type.maybe Type.string) - ) - } - ) - [ Elm.string cookieArg_, cookieArg_0 ] - - -{-| Get all of the cookies from the incoming HTTP request. For a more high-level API, see [`Server.Session`](Server-Session). - -cookies: Server.Request.Request -> Dict.Dict String String --} -cookies : Elm.Expression -> Elm.Expression -cookies cookiesArg_ = - Elm.apply - (Elm.value - { importFrom = [ "Server", "Request" ] - , name = "cookies" - , annotation = - Just - (Type.function - [ Type.namedWith [ "Server", "Request" ] "Request" [] - ] - (Type.namedWith - [ "Dict" ] - "Dict" - [ Type.string, Type.string ] - ) - ) - } - ) - [ cookiesArg_ ] - - -annotation_ : { request : Type.Annotation, method : Type.Annotation } -annotation_ = - { request = - Type.alias - moduleName_ - "Request" - [] - (Type.namedWith [ "Internal", "Request" ] "Request" []) - , method = Type.namedWith [ "Server", "Request" ] "Method" [] - } - - -make_ : - { connect : Elm.Expression - , delete : Elm.Expression - , get : Elm.Expression - , head : Elm.Expression - , options : Elm.Expression - , patch : Elm.Expression - , post : Elm.Expression - , put : Elm.Expression - , trace : Elm.Expression - , nonStandard : Elm.Expression -> Elm.Expression - } -make_ = - { connect = - Elm.value - { importFrom = [ "Server", "Request" ] - , name = "Connect" - , annotation = Just (Type.namedWith [] "Method" []) - } - , delete = - Elm.value - { importFrom = [ "Server", "Request" ] - , name = "Delete" - , annotation = Just (Type.namedWith [] "Method" []) - } - , get = - Elm.value - { importFrom = [ "Server", "Request" ] - , name = "Get" - , annotation = Just (Type.namedWith [] "Method" []) - } - , head = - Elm.value - { importFrom = [ "Server", "Request" ] - , name = "Head" - , annotation = Just (Type.namedWith [] "Method" []) - } - , options = - Elm.value - { importFrom = [ "Server", "Request" ] - , name = "Options" - , annotation = Just (Type.namedWith [] "Method" []) - } - , patch = - Elm.value - { importFrom = [ "Server", "Request" ] - , name = "Patch" - , annotation = Just (Type.namedWith [] "Method" []) - } - , post = - Elm.value - { importFrom = [ "Server", "Request" ] - , name = "Post" - , annotation = Just (Type.namedWith [] "Method" []) - } - , put = - Elm.value - { importFrom = [ "Server", "Request" ] - , name = "Put" - , annotation = Just (Type.namedWith [] "Method" []) - } - , trace = - Elm.value - { importFrom = [ "Server", "Request" ] - , name = "Trace" - , annotation = Just (Type.namedWith [] "Method" []) - } - , nonStandard = - \ar0 -> - Elm.apply - (Elm.value - { importFrom = [ "Server", "Request" ] - , name = "NonStandard" - , annotation = Just (Type.namedWith [] "Method" []) - } - ) - [ ar0 ] - } - - -caseOf_ : - { method : - Elm.Expression - -> { connect : Elm.Expression - , delete : Elm.Expression - , get : Elm.Expression - , head : Elm.Expression - , options : Elm.Expression - , patch : Elm.Expression - , post : Elm.Expression - , put : Elm.Expression - , trace : Elm.Expression - , nonStandard : Elm.Expression -> Elm.Expression - } - -> Elm.Expression - } -caseOf_ = - { method = - \methodExpression methodTags -> - Elm.Case.custom - methodExpression - (Type.namedWith [ "Server", "Request" ] "Method" []) - [ Elm.Case.branch - (Elm.Arg.customType "Connect" methodTags.connect) - Basics.identity - , Elm.Case.branch - (Elm.Arg.customType "Delete" methodTags.delete) - Basics.identity - , Elm.Case.branch - (Elm.Arg.customType "Get" methodTags.get) - Basics.identity - , Elm.Case.branch - (Elm.Arg.customType "Head" methodTags.head) - Basics.identity - , Elm.Case.branch - (Elm.Arg.customType "Options" methodTags.options) - Basics.identity - , Elm.Case.branch - (Elm.Arg.customType "Patch" methodTags.patch) - Basics.identity - , Elm.Case.branch - (Elm.Arg.customType "Post" methodTags.post) - Basics.identity - , Elm.Case.branch - (Elm.Arg.customType "Put" methodTags.put) - Basics.identity - , Elm.Case.branch - (Elm.Arg.customType "Trace" methodTags.trace) - Basics.identity - , Elm.Case.branch - (Elm.Arg.customType - "NonStandard" - methodTags.nonStandard |> Elm.Arg.item - (Elm.Arg.varWith - "arg_0" - Type.string - ) - ) - Basics.identity - ] - } - - -call_ : - { requestTime : Elm.Expression -> Elm.Expression - , header : Elm.Expression -> Elm.Expression -> Elm.Expression - , headers : Elm.Expression -> Elm.Expression - , method : Elm.Expression -> Elm.Expression - , methodToString : Elm.Expression -> Elm.Expression - , body : Elm.Expression -> Elm.Expression - , jsonBody : Elm.Expression -> Elm.Expression -> Elm.Expression - , formData : Elm.Expression -> Elm.Expression -> Elm.Expression - , formDataWithServerValidation : - Elm.Expression -> Elm.Expression -> Elm.Expression - , rawFormData : Elm.Expression -> Elm.Expression - , rawUrl : Elm.Expression -> Elm.Expression - , queryParam : Elm.Expression -> Elm.Expression -> Elm.Expression - , queryParams : Elm.Expression -> Elm.Expression - , matchesContentType : Elm.Expression -> Elm.Expression -> Elm.Expression - , cookie : Elm.Expression -> Elm.Expression -> Elm.Expression - , cookies : Elm.Expression -> Elm.Expression - } -call_ = - { requestTime = - \requestTimeArg_ -> - Elm.apply - (Elm.value - { importFrom = [ "Server", "Request" ] - , name = "requestTime" - , annotation = - Just - (Type.function - [ Type.namedWith - [ "Server", "Request" ] - "Request" - [] - ] - (Type.namedWith [ "Time" ] "Posix" []) - ) - } - ) - [ requestTimeArg_ ] - , header = - \headerArg_ headerArg_0 -> - Elm.apply - (Elm.value - { importFrom = [ "Server", "Request" ] - , name = "header" - , annotation = - Just - (Type.function - [ Type.string - , Type.namedWith - [ "Server", "Request" ] - "Request" - [] - ] - (Type.maybe Type.string) - ) - } - ) - [ headerArg_, headerArg_0 ] - , headers = - \headersArg_ -> - Elm.apply - (Elm.value - { importFrom = [ "Server", "Request" ] - , name = "headers" - , annotation = - Just - (Type.function - [ Type.namedWith - [ "Server", "Request" ] - "Request" - [] - ] - (Type.namedWith - [ "Dict" ] - "Dict" - [ Type.string, Type.string ] - ) - ) - } - ) - [ headersArg_ ] - , method = - \methodArg_ -> - Elm.apply - (Elm.value - { importFrom = [ "Server", "Request" ] - , name = "method" - , annotation = - Just - (Type.function - [ Type.namedWith - [ "Server", "Request" ] - "Request" - [] - ] - (Type.namedWith - [ "Server", "Request" ] - "Method" - [] - ) - ) - } - ) - [ methodArg_ ] - , methodToString = - \methodToStringArg_ -> - Elm.apply - (Elm.value - { importFrom = [ "Server", "Request" ] - , name = "methodToString" - , annotation = - Just - (Type.function - [ Type.namedWith - [ "Server", "Request" ] - "Method" - [] - ] - Type.string - ) - } - ) - [ methodToStringArg_ ] - , body = - \bodyArg_ -> - Elm.apply - (Elm.value - { importFrom = [ "Server", "Request" ] - , name = "body" - , annotation = - Just - (Type.function - [ Type.namedWith - [ "Server", "Request" ] - "Request" - [] - ] - (Type.maybe Type.string) - ) - } - ) - [ bodyArg_ ] - , jsonBody = - \jsonBodyArg_ jsonBodyArg_0 -> - Elm.apply - (Elm.value - { importFrom = [ "Server", "Request" ] - , name = "jsonBody" - , annotation = - Just - (Type.function - [ Type.namedWith - [ "Json", "Decode" ] - "Decoder" - [ Type.var "value" ] - , Type.namedWith - [ "Server", "Request" ] - "Request" - [] - ] - (Type.maybe - (Type.namedWith - [ "Result" ] - "Result" - [ Type.namedWith - [ "Json", "Decode" ] - "Error" - [] - , Type.var "value" - ] - ) - ) - ) - } - ) - [ jsonBodyArg_, jsonBodyArg_0 ] - , formData = - \formDataArg_ formDataArg_0 -> - Elm.apply - (Elm.value - { importFrom = [ "Server", "Request" ] - , name = "formData" - , annotation = - Just - (Type.function - [ Type.namedWith - [ "Form", "Handler" ] - "Handler" - [ Type.var "error", Type.var "combined" ] - , Type.namedWith - [ "Server", "Request" ] - "Request" - [] - ] - (Type.maybe - (Type.tuple - (Type.namedWith - [ "Form" ] - "ServerResponse" - [ Type.var "error" ] - ) - (Type.namedWith - [ "Form" ] - "Validated" - [ Type.var "error" - , Type.var "combined" - ] - ) - ) - ) - ) - } - ) - [ formDataArg_, formDataArg_0 ] - , formDataWithServerValidation = - \formDataWithServerValidationArg_ formDataWithServerValidationArg_0 -> - Elm.apply - (Elm.value - { importFrom = [ "Server", "Request" ] - , name = "formDataWithServerValidation" - , annotation = - Just - (Type.function - [ Type.namedWith - [ "Pages", "Form" ] - "Handler" - [ Type.var "error", Type.var "combined" ] - , Type.namedWith - [ "Server", "Request" ] - "Request" - [] - ] - (Type.maybe - (Type.namedWith - [ "BackendTask" ] - "BackendTask" - [ Type.namedWith - [ "FatalError" ] - "FatalError" - [] - , Type.namedWith - [ "Result" ] - "Result" - [ Type.namedWith - [ "Form" ] - "ServerResponse" - [ Type.var "error" ] - , Type.tuple - (Type.namedWith - [ "Form" ] - "ServerResponse" - [ Type.var "error" ] - ) - (Type.var "combined") - ] - ] - ) - ) - ) - } - ) - [ formDataWithServerValidationArg_ - , formDataWithServerValidationArg_0 - ] - , rawFormData = - \rawFormDataArg_ -> - Elm.apply - (Elm.value - { importFrom = [ "Server", "Request" ] - , name = "rawFormData" - , annotation = - Just - (Type.function - [ Type.namedWith - [ "Server", "Request" ] - "Request" - [] - ] - (Type.maybe - (Type.list - (Type.tuple Type.string Type.string) - ) - ) - ) - } - ) - [ rawFormDataArg_ ] - , rawUrl = - \rawUrlArg_ -> - Elm.apply - (Elm.value - { importFrom = [ "Server", "Request" ] - , name = "rawUrl" - , annotation = - Just - (Type.function - [ Type.namedWith - [ "Server", "Request" ] - "Request" - [] - ] - Type.string - ) - } - ) - [ rawUrlArg_ ] - , queryParam = - \queryParamArg_ queryParamArg_0 -> - Elm.apply - (Elm.value - { importFrom = [ "Server", "Request" ] - , name = "queryParam" - , annotation = - Just - (Type.function - [ Type.string - , Type.namedWith - [ "Server", "Request" ] - "Request" - [] - ] - (Type.maybe Type.string) - ) - } - ) - [ queryParamArg_, queryParamArg_0 ] - , queryParams = - \queryParamsArg_ -> - Elm.apply - (Elm.value - { importFrom = [ "Server", "Request" ] - , name = "queryParams" - , annotation = - Just - (Type.function - [ Type.namedWith - [ "Server", "Request" ] - "Request" - [] - ] - (Type.namedWith - [ "Dict" ] - "Dict" - [ Type.string, Type.list Type.string ] - ) - ) - } - ) - [ queryParamsArg_ ] - , matchesContentType = - \matchesContentTypeArg_ matchesContentTypeArg_0 -> - Elm.apply - (Elm.value - { importFrom = [ "Server", "Request" ] - , name = "matchesContentType" - , annotation = - Just - (Type.function - [ Type.string - , Type.namedWith - [ "Server", "Request" ] - "Request" - [] - ] - Type.bool - ) - } - ) - [ matchesContentTypeArg_, matchesContentTypeArg_0 ] - , cookie = - \cookieArg_ cookieArg_0 -> - Elm.apply - (Elm.value - { importFrom = [ "Server", "Request" ] - , name = "cookie" - , annotation = - Just - (Type.function - [ Type.string - , Type.namedWith - [ "Server", "Request" ] - "Request" - [] - ] - (Type.maybe Type.string) - ) - } - ) - [ cookieArg_, cookieArg_0 ] - , cookies = - \cookiesArg_ -> - Elm.apply - (Elm.value - { importFrom = [ "Server", "Request" ] - , name = "cookies" - , annotation = - Just - (Type.function - [ Type.namedWith - [ "Server", "Request" ] - "Request" - [] - ] - (Type.namedWith - [ "Dict" ] - "Dict" - [ Type.string, Type.string ] - ) - ) - } - ) - [ cookiesArg_ ] - } - - -values_ : - { requestTime : Elm.Expression - , header : Elm.Expression - , headers : Elm.Expression - , method : Elm.Expression - , methodToString : Elm.Expression - , body : Elm.Expression - , jsonBody : Elm.Expression - , formData : Elm.Expression - , formDataWithServerValidation : Elm.Expression - , rawFormData : Elm.Expression - , rawUrl : Elm.Expression - , queryParam : Elm.Expression - , queryParams : Elm.Expression - , matchesContentType : Elm.Expression - , cookie : Elm.Expression - , cookies : Elm.Expression - } -values_ = - { requestTime = - Elm.value - { importFrom = [ "Server", "Request" ] - , name = "requestTime" - , annotation = - Just - (Type.function - [ Type.namedWith [ "Server", "Request" ] "Request" [] ] - (Type.namedWith [ "Time" ] "Posix" []) - ) - } - , header = - Elm.value - { importFrom = [ "Server", "Request" ] - , name = "header" - , annotation = - Just - (Type.function - [ Type.string - , Type.namedWith [ "Server", "Request" ] "Request" [] - ] - (Type.maybe Type.string) - ) - } - , headers = - Elm.value - { importFrom = [ "Server", "Request" ] - , name = "headers" - , annotation = - Just - (Type.function - [ Type.namedWith [ "Server", "Request" ] "Request" [] ] - (Type.namedWith - [ "Dict" ] - "Dict" - [ Type.string, Type.string ] - ) - ) - } - , method = - Elm.value - { importFrom = [ "Server", "Request" ] - , name = "method" - , annotation = - Just - (Type.function - [ Type.namedWith [ "Server", "Request" ] "Request" [] ] - (Type.namedWith [ "Server", "Request" ] "Method" []) - ) - } - , methodToString = - Elm.value - { importFrom = [ "Server", "Request" ] - , name = "methodToString" - , annotation = - Just - (Type.function - [ Type.namedWith [ "Server", "Request" ] "Method" [] ] - Type.string - ) - } - , body = - Elm.value - { importFrom = [ "Server", "Request" ] - , name = "body" - , annotation = - Just - (Type.function - [ Type.namedWith [ "Server", "Request" ] "Request" [] ] - (Type.maybe Type.string) - ) - } - , jsonBody = - Elm.value - { importFrom = [ "Server", "Request" ] - , name = "jsonBody" - , annotation = - Just - (Type.function - [ Type.namedWith - [ "Json", "Decode" ] - "Decoder" - [ Type.var "value" ] - , Type.namedWith [ "Server", "Request" ] "Request" [] - ] - (Type.maybe - (Type.namedWith - [ "Result" ] - "Result" - [ Type.namedWith - [ "Json", "Decode" ] - "Error" - [] - , Type.var "value" - ] - ) - ) - ) - } - , formData = - Elm.value - { importFrom = [ "Server", "Request" ] - , name = "formData" - , annotation = - Just - (Type.function - [ Type.namedWith - [ "Form", "Handler" ] - "Handler" - [ Type.var "error", Type.var "combined" ] - , Type.namedWith [ "Server", "Request" ] "Request" [] - ] - (Type.maybe - (Type.tuple - (Type.namedWith - [ "Form" ] - "ServerResponse" - [ Type.var "error" ] - ) - (Type.namedWith - [ "Form" ] - "Validated" - [ Type.var "error" - , Type.var "combined" - ] - ) - ) - ) - ) - } - , formDataWithServerValidation = - Elm.value - { importFrom = [ "Server", "Request" ] - , name = "formDataWithServerValidation" - , annotation = - Just - (Type.function - [ Type.namedWith - [ "Pages", "Form" ] - "Handler" - [ Type.var "error", Type.var "combined" ] - , Type.namedWith [ "Server", "Request" ] "Request" [] - ] - (Type.maybe - (Type.namedWith - [ "BackendTask" ] - "BackendTask" - [ Type.namedWith - [ "FatalError" ] - "FatalError" - [] - , Type.namedWith - [ "Result" ] - "Result" - [ Type.namedWith - [ "Form" ] - "ServerResponse" - [ Type.var "error" ] - , Type.tuple - (Type.namedWith - [ "Form" ] - "ServerResponse" - [ Type.var "error" ] - ) - (Type.var "combined") - ] - ] - ) - ) - ) - } - , rawFormData = - Elm.value - { importFrom = [ "Server", "Request" ] - , name = "rawFormData" - , annotation = - Just - (Type.function - [ Type.namedWith [ "Server", "Request" ] "Request" [] ] - (Type.maybe - (Type.list (Type.tuple Type.string Type.string)) - ) - ) - } - , rawUrl = - Elm.value - { importFrom = [ "Server", "Request" ] - , name = "rawUrl" - , annotation = - Just - (Type.function - [ Type.namedWith [ "Server", "Request" ] "Request" [] ] - Type.string - ) - } - , queryParam = - Elm.value - { importFrom = [ "Server", "Request" ] - , name = "queryParam" - , annotation = - Just - (Type.function - [ Type.string - , Type.namedWith [ "Server", "Request" ] "Request" [] - ] - (Type.maybe Type.string) - ) - } - , queryParams = - Elm.value - { importFrom = [ "Server", "Request" ] - , name = "queryParams" - , annotation = - Just - (Type.function - [ Type.namedWith [ "Server", "Request" ] "Request" [] ] - (Type.namedWith - [ "Dict" ] - "Dict" - [ Type.string, Type.list Type.string ] - ) - ) - } - , matchesContentType = - Elm.value - { importFrom = [ "Server", "Request" ] - , name = "matchesContentType" - , annotation = - Just - (Type.function - [ Type.string - , Type.namedWith [ "Server", "Request" ] "Request" [] - ] - Type.bool - ) - } - , cookie = - Elm.value - { importFrom = [ "Server", "Request" ] - , name = "cookie" - , annotation = - Just - (Type.function - [ Type.string - , Type.namedWith [ "Server", "Request" ] "Request" [] - ] - (Type.maybe Type.string) - ) - } - , cookies = - Elm.value - { importFrom = [ "Server", "Request" ] - , name = "cookies" - , annotation = - Just - (Type.function - [ Type.namedWith [ "Server", "Request" ] "Request" [] ] - (Type.namedWith - [ "Dict" ] - "Dict" - [ Type.string, Type.string ] - ) - ) - } - } \ No newline at end of file diff --git a/elm-open-api-codegen/src/Gen/Server/Response.elm b/elm-open-api-codegen/src/Gen/Server/Response.elm deleted file mode 100644 index 489fcee5..00000000 --- a/elm-open-api-codegen/src/Gen/Server/Response.elm +++ /dev/null @@ -1,1275 +0,0 @@ -module Gen.Server.Response exposing - ( moduleName_, render, map, errorPage, mapError, temporaryRedirect - , permanentRedirect, json, plainText, emptyBody, body, bytesBody, base64Body - , withHeader, withHeaders, withStatusCode, withSetCookieHeader, toJson, annotation_, call_ - , values_ - ) - -{-| -# Generated bindings for Server.Response - -@docs moduleName_, render, map, errorPage, mapError, temporaryRedirect -@docs permanentRedirect, json, plainText, emptyBody, body, bytesBody -@docs base64Body, withHeader, withHeaders, withStatusCode, withSetCookieHeader, toJson -@docs annotation_, call_, values_ --} - - -import Elm -import Elm.Annotation as Type - - -{-| The name of this module. -} -moduleName_ : List String -moduleName_ = - [ "Server", "Response" ] - - -{-| Render the Route Module with the supplied data. Used for both the `data` and `action` functions in a server-rendered Route Module. - - Response.render project - -render: data -> Server.Response.Response data error --} -render : Elm.Expression -> Elm.Expression -render renderArg_ = - Elm.apply - (Elm.value - { importFrom = [ "Server", "Response" ] - , name = "render" - , annotation = - Just - (Type.function - [ Type.var "data" ] - (Type.namedWith - [ "Server", "Response" ] - "Response" - [ Type.var "data", Type.var "error" ] - ) - ) - } - ) - [ renderArg_ ] - - -{-| Maps the `data` for a Render response. Usually not needed, but always good to have the option. - -map: - (data -> mappedData) - -> Server.Response.Response data error - -> Server.Response.Response mappedData error --} -map : (Elm.Expression -> Elm.Expression) -> Elm.Expression -> Elm.Expression -map mapArg_ mapArg_0 = - Elm.apply - (Elm.value - { importFrom = [ "Server", "Response" ] - , name = "map" - , annotation = - Just - (Type.function - [ Type.function - [ Type.var "data" ] - (Type.var "mappedData") - , Type.namedWith - [ "Server", "Response" ] - "Response" - [ Type.var "data", Type.var "error" ] - ] - (Type.namedWith - [ "Server", "Response" ] - "Response" - [ Type.var "mappedData", Type.var "error" ] - ) - ) - } - ) - [ Elm.functionReduced "mapUnpack" mapArg_, mapArg_0 ] - - -{-| Instead of rendering the current Route Module, you can render an `ErrorPage` such as a 404 page or a 500 error page. - -[Read more about Error Pages](https://elm-pages.com/docs/error-pages) to learn about -defining and rendering your custom ErrorPage type. - -errorPage: errorPage -> Server.Response.Response data errorPage --} -errorPage : Elm.Expression -> Elm.Expression -errorPage errorPageArg_ = - Elm.apply - (Elm.value - { importFrom = [ "Server", "Response" ] - , name = "errorPage" - , annotation = - Just - (Type.function - [ Type.var "errorPage" ] - (Type.namedWith - [ "Server", "Response" ] - "Response" - [ Type.var "data", Type.var "errorPage" ] - ) - ) - } - ) - [ errorPageArg_ ] - - -{-| Maps the `error` for an ErrorPage response. Usually not needed, but always good to have the option. - -mapError: - (errorPage -> mappedErrorPage) - -> Server.Response.Response data errorPage - -> Server.Response.Response data mappedErrorPage --} -mapError : - (Elm.Expression -> Elm.Expression) -> Elm.Expression -> Elm.Expression -mapError mapErrorArg_ mapErrorArg_0 = - Elm.apply - (Elm.value - { importFrom = [ "Server", "Response" ] - , name = "mapError" - , annotation = - Just - (Type.function - [ Type.function - [ Type.var "errorPage" ] - (Type.var "mappedErrorPage") - , Type.namedWith - [ "Server", "Response" ] - "Response" - [ Type.var "data", Type.var "errorPage" ] - ] - (Type.namedWith - [ "Server", "Response" ] - "Response" - [ Type.var "data", Type.var "mappedErrorPage" ] - ) - ) - } - ) - [ Elm.functionReduced "mapErrorUnpack" mapErrorArg_, mapErrorArg_0 ] - - -{-| temporaryRedirect: String -> Server.Response.Response data error -} -temporaryRedirect : String -> Elm.Expression -temporaryRedirect temporaryRedirectArg_ = - Elm.apply - (Elm.value - { importFrom = [ "Server", "Response" ] - , name = "temporaryRedirect" - , annotation = - Just - (Type.function - [ Type.string ] - (Type.namedWith - [ "Server", "Response" ] - "Response" - [ Type.var "data", Type.var "error" ] - ) - ) - } - ) - [ Elm.string temporaryRedirectArg_ ] - - -{-| Build a 308 permanent redirect response. - -Permanent redirects tell the browser that a resource has permanently moved. If you redirect because a user is not logged in, -then you **do not** want to use a permanent redirect because the page they are looking for hasn't changed, you are just -temporarily pointing them to a new page since they need to authenticate. - -Permanent redirects are aggressively cached so be careful not to use them when you mean to use temporary redirects instead. - -If you need to specifically rely on a 301 permanent redirect (see on the difference between 301 and 308), -use `customResponse` instead. - -permanentRedirect: String -> Server.Response.Response data error --} -permanentRedirect : String -> Elm.Expression -permanentRedirect permanentRedirectArg_ = - Elm.apply - (Elm.value - { importFrom = [ "Server", "Response" ] - , name = "permanentRedirect" - , annotation = - Just - (Type.function - [ Type.string ] - (Type.namedWith - [ "Server", "Response" ] - "Response" - [ Type.var "data", Type.var "error" ] - ) - ) - } - ) - [ Elm.string permanentRedirectArg_ ] - - -{-| Build a JSON body from a `Json.Encode.Value`. - - Json.Encode.object - [ ( "message", Json.Encode.string "Hello" ) ] - |> Response.json - -Sets the `Content-Type` to `application/json`. - -json: Json.Encode.Value -> Server.Response.Response data error --} -json : Elm.Expression -> Elm.Expression -json jsonArg_ = - Elm.apply - (Elm.value - { importFrom = [ "Server", "Response" ] - , name = "json" - , annotation = - Just - (Type.function - [ Type.namedWith [ "Json", "Encode" ] "Value" [] ] - (Type.namedWith - [ "Server", "Response" ] - "Response" - [ Type.var "data", Type.var "error" ] - ) - ) - } - ) - [ jsonArg_ ] - - -{-| Build a `Response` with a String body. Sets the `Content-Type` to `text/plain`. - - Response.plainText "Hello" - -plainText: String -> Server.Response.Response data error --} -plainText : String -> Elm.Expression -plainText plainTextArg_ = - Elm.apply - (Elm.value - { importFrom = [ "Server", "Response" ] - , name = "plainText" - , annotation = - Just - (Type.function - [ Type.string ] - (Type.namedWith - [ "Server", "Response" ] - "Response" - [ Type.var "data", Type.var "error" ] - ) - ) - } - ) - [ Elm.string plainTextArg_ ] - - -{-| Build a `Response` with no HTTP response body. - -emptyBody: Server.Response.Response data error --} -emptyBody : Elm.Expression -emptyBody = - Elm.value - { importFrom = [ "Server", "Response" ] - , name = "emptyBody" - , annotation = - Just - (Type.namedWith - [ "Server", "Response" ] - "Response" - [ Type.var "data", Type.var "error" ] - ) - } - - -{-| Same as [`plainText`](#plainText), but doesn't set a `Content-Type`. - -body: String -> Server.Response.Response data error --} -body : String -> Elm.Expression -body bodyArg_ = - Elm.apply - (Elm.value - { importFrom = [ "Server", "Response" ] - , name = "body" - , annotation = - Just - (Type.function - [ Type.string ] - (Type.namedWith - [ "Server", "Response" ] - "Response" - [ Type.var "data", Type.var "error" ] - ) - ) - } - ) - [ Elm.string bodyArg_ ] - - -{-| Build a `Response` with a `Bytes`. - -Under the hood, it will be converted to a base64 encoded String with `isBase64Encoded = True`. -Your adapter will need to handle `isBase64Encoded` to turn it into the appropriate response. - -bytesBody: Bytes.Bytes -> Server.Response.Response data error --} -bytesBody : Elm.Expression -> Elm.Expression -bytesBody bytesBodyArg_ = - Elm.apply - (Elm.value - { importFrom = [ "Server", "Response" ] - , name = "bytesBody" - , annotation = - Just - (Type.function - [ Type.namedWith [ "Bytes" ] "Bytes" [] ] - (Type.namedWith - [ "Server", "Response" ] - "Response" - [ Type.var "data", Type.var "error" ] - ) - ) - } - ) - [ bytesBodyArg_ ] - - -{-| Build a `Response` with a String that should represent a base64 encoded value. - -Your adapter will need to handle `isBase64Encoded` to turn it into the appropriate response. - - Response.base64Body "SGVsbG8gV29ybGQ=" - -base64Body: String -> Server.Response.Response data error --} -base64Body : String -> Elm.Expression -base64Body base64BodyArg_ = - Elm.apply - (Elm.value - { importFrom = [ "Server", "Response" ] - , name = "base64Body" - , annotation = - Just - (Type.function - [ Type.string ] - (Type.namedWith - [ "Server", "Response" ] - "Response" - [ Type.var "data", Type.var "error" ] - ) - ) - } - ) - [ Elm.string base64BodyArg_ ] - - -{-| Add a header to the response. - - Response.plainText "Hello!" - -- allow CORS requests - |> Response.withHeader "Access-Control-Allow-Origin" "*" - |> Response.withHeader "Access-Control-Allow-Methods" "GET, POST, OPTIONS" - -withHeader: - String - -> String - -> Server.Response.Response data error - -> Server.Response.Response data error --} -withHeader : String -> String -> Elm.Expression -> Elm.Expression -withHeader withHeaderArg_ withHeaderArg_0 withHeaderArg_1 = - Elm.apply - (Elm.value - { importFrom = [ "Server", "Response" ] - , name = "withHeader" - , annotation = - Just - (Type.function - [ Type.string - , Type.string - , Type.namedWith - [ "Server", "Response" ] - "Response" - [ Type.var "data", Type.var "error" ] - ] - (Type.namedWith - [ "Server", "Response" ] - "Response" - [ Type.var "data", Type.var "error" ] - ) - ) - } - ) - [ Elm.string withHeaderArg_ - , Elm.string withHeaderArg_0 - , withHeaderArg_1 - ] - - -{-| Same as [`withHeader`](#withHeader), but allows you to add multiple headers at once. - - Response.plainText "Hello!" - -- allow CORS requests - |> Response.withHeaders - [ ( "Access-Control-Allow-Origin", "*" ) - , ( "Access-Control-Allow-Methods", "GET, POST, OPTIONS" ) - ] - -withHeaders: - List ( String, String ) - -> Server.Response.Response data error - -> Server.Response.Response data error --} -withHeaders : List Elm.Expression -> Elm.Expression -> Elm.Expression -withHeaders withHeadersArg_ withHeadersArg_0 = - Elm.apply - (Elm.value - { importFrom = [ "Server", "Response" ] - , name = "withHeaders" - , annotation = - Just - (Type.function - [ Type.list (Type.tuple Type.string Type.string) - , Type.namedWith - [ "Server", "Response" ] - "Response" - [ Type.var "data", Type.var "error" ] - ] - (Type.namedWith - [ "Server", "Response" ] - "Response" - [ Type.var "data", Type.var "error" ] - ) - ) - } - ) - [ Elm.list withHeadersArg_, withHeadersArg_0 ] - - -{-| Set the [HTTP Response status code](https://developer.mozilla.org/en-US/docs/Web/HTTP/Status) for the `Response`. - - Response.plainText "Not Authorized" - |> Response.withStatusCode 401 - -withStatusCode: - Int - -> Server.Response.Response data Basics.Never - -> Server.Response.Response data Basics.Never --} -withStatusCode : Int -> Elm.Expression -> Elm.Expression -withStatusCode withStatusCodeArg_ withStatusCodeArg_0 = - Elm.apply - (Elm.value - { importFrom = [ "Server", "Response" ] - , name = "withStatusCode" - , annotation = - Just - (Type.function - [ Type.int - , Type.namedWith - [ "Server", "Response" ] - "Response" - [ Type.var "data" - , Type.namedWith [ "Basics" ] "Never" [] - ] - ] - (Type.namedWith - [ "Server", "Response" ] - "Response" - [ Type.var "data" - , Type.namedWith [ "Basics" ] "Never" [] - ] - ) - ) - } - ) - [ Elm.int withStatusCodeArg_, withStatusCodeArg_0 ] - - -{-| Set a [`Server.SetCookie`](Server-SetCookie) value on the response. - -The easiest way to manage cookies in your Routes is through the [`Server.Session`](Server-Session) API, but this -provides a more granular way to set cookies. - -withSetCookieHeader: - Server.SetCookie.SetCookie - -> Server.Response.Response data error - -> Server.Response.Response data error --} -withSetCookieHeader : Elm.Expression -> Elm.Expression -> Elm.Expression -withSetCookieHeader withSetCookieHeaderArg_ withSetCookieHeaderArg_0 = - Elm.apply - (Elm.value - { importFrom = [ "Server", "Response" ] - , name = "withSetCookieHeader" - , annotation = - Just - (Type.function - [ Type.namedWith - [ "Server", "SetCookie" ] - "SetCookie" - [] - , Type.namedWith - [ "Server", "Response" ] - "Response" - [ Type.var "data", Type.var "error" ] - ] - (Type.namedWith - [ "Server", "Response" ] - "Response" - [ Type.var "data", Type.var "error" ] - ) - ) - } - ) - [ withSetCookieHeaderArg_, withSetCookieHeaderArg_0 ] - - -{-| For internal use or more advanced use cases for meta frameworks. - -toJson: Server.Response.Response Basics.Never Basics.Never -> Json.Encode.Value --} -toJson : Elm.Expression -> Elm.Expression -toJson toJsonArg_ = - Elm.apply - (Elm.value - { importFrom = [ "Server", "Response" ] - , name = "toJson" - , annotation = - Just - (Type.function - [ Type.namedWith - [ "Server", "Response" ] - "Response" - [ Type.namedWith [ "Basics" ] "Never" [] - , Type.namedWith [ "Basics" ] "Never" [] - ] - ] - (Type.namedWith [ "Json", "Encode" ] "Value" []) - ) - } - ) - [ toJsonArg_ ] - - -annotation_ : - { response : Type.Annotation -> Type.Annotation -> Type.Annotation } -annotation_ = - { response = - \responseArg0 responseArg1 -> - Type.alias - moduleName_ - "Response" - [ responseArg0, responseArg1 ] - (Type.namedWith - [ "PageServerResponse" ] - "PageServerResponse" - [ Type.var "data", Type.var "error" ] - ) - } - - -call_ : - { render : Elm.Expression -> Elm.Expression - , map : Elm.Expression -> Elm.Expression -> Elm.Expression - , errorPage : Elm.Expression -> Elm.Expression - , mapError : Elm.Expression -> Elm.Expression -> Elm.Expression - , temporaryRedirect : Elm.Expression -> Elm.Expression - , permanentRedirect : Elm.Expression -> Elm.Expression - , json : Elm.Expression -> Elm.Expression - , plainText : Elm.Expression -> Elm.Expression - , body : Elm.Expression -> Elm.Expression - , bytesBody : Elm.Expression -> Elm.Expression - , base64Body : Elm.Expression -> Elm.Expression - , withHeader : - Elm.Expression -> Elm.Expression -> Elm.Expression -> Elm.Expression - , withHeaders : Elm.Expression -> Elm.Expression -> Elm.Expression - , withStatusCode : Elm.Expression -> Elm.Expression -> Elm.Expression - , withSetCookieHeader : Elm.Expression -> Elm.Expression -> Elm.Expression - , toJson : Elm.Expression -> Elm.Expression - } -call_ = - { render = - \renderArg_ -> - Elm.apply - (Elm.value - { importFrom = [ "Server", "Response" ] - , name = "render" - , annotation = - Just - (Type.function - [ Type.var "data" ] - (Type.namedWith - [ "Server", "Response" ] - "Response" - [ Type.var "data", Type.var "error" ] - ) - ) - } - ) - [ renderArg_ ] - , map = - \mapArg_ mapArg_0 -> - Elm.apply - (Elm.value - { importFrom = [ "Server", "Response" ] - , name = "map" - , annotation = - Just - (Type.function - [ Type.function - [ Type.var "data" ] - (Type.var "mappedData") - , Type.namedWith - [ "Server", "Response" ] - "Response" - [ Type.var "data", Type.var "error" ] - ] - (Type.namedWith - [ "Server", "Response" ] - "Response" - [ Type.var "mappedData" - , Type.var "error" - ] - ) - ) - } - ) - [ mapArg_, mapArg_0 ] - , errorPage = - \errorPageArg_ -> - Elm.apply - (Elm.value - { importFrom = [ "Server", "Response" ] - , name = "errorPage" - , annotation = - Just - (Type.function - [ Type.var "errorPage" ] - (Type.namedWith - [ "Server", "Response" ] - "Response" - [ Type.var "data", Type.var "errorPage" ] - ) - ) - } - ) - [ errorPageArg_ ] - , mapError = - \mapErrorArg_ mapErrorArg_0 -> - Elm.apply - (Elm.value - { importFrom = [ "Server", "Response" ] - , name = "mapError" - , annotation = - Just - (Type.function - [ Type.function - [ Type.var "errorPage" ] - (Type.var "mappedErrorPage") - , Type.namedWith - [ "Server", "Response" ] - "Response" - [ Type.var "data", Type.var "errorPage" ] - ] - (Type.namedWith - [ "Server", "Response" ] - "Response" - [ Type.var "data" - , Type.var "mappedErrorPage" - ] - ) - ) - } - ) - [ mapErrorArg_, mapErrorArg_0 ] - , temporaryRedirect = - \temporaryRedirectArg_ -> - Elm.apply - (Elm.value - { importFrom = [ "Server", "Response" ] - , name = "temporaryRedirect" - , annotation = - Just - (Type.function - [ Type.string ] - (Type.namedWith - [ "Server", "Response" ] - "Response" - [ Type.var "data", Type.var "error" ] - ) - ) - } - ) - [ temporaryRedirectArg_ ] - , permanentRedirect = - \permanentRedirectArg_ -> - Elm.apply - (Elm.value - { importFrom = [ "Server", "Response" ] - , name = "permanentRedirect" - , annotation = - Just - (Type.function - [ Type.string ] - (Type.namedWith - [ "Server", "Response" ] - "Response" - [ Type.var "data", Type.var "error" ] - ) - ) - } - ) - [ permanentRedirectArg_ ] - , json = - \jsonArg_ -> - Elm.apply - (Elm.value - { importFrom = [ "Server", "Response" ] - , name = "json" - , annotation = - Just - (Type.function - [ Type.namedWith - [ "Json", "Encode" ] - "Value" - [] - ] - (Type.namedWith - [ "Server", "Response" ] - "Response" - [ Type.var "data", Type.var "error" ] - ) - ) - } - ) - [ jsonArg_ ] - , plainText = - \plainTextArg_ -> - Elm.apply - (Elm.value - { importFrom = [ "Server", "Response" ] - , name = "plainText" - , annotation = - Just - (Type.function - [ Type.string ] - (Type.namedWith - [ "Server", "Response" ] - "Response" - [ Type.var "data", Type.var "error" ] - ) - ) - } - ) - [ plainTextArg_ ] - , body = - \bodyArg_ -> - Elm.apply - (Elm.value - { importFrom = [ "Server", "Response" ] - , name = "body" - , annotation = - Just - (Type.function - [ Type.string ] - (Type.namedWith - [ "Server", "Response" ] - "Response" - [ Type.var "data", Type.var "error" ] - ) - ) - } - ) - [ bodyArg_ ] - , bytesBody = - \bytesBodyArg_ -> - Elm.apply - (Elm.value - { importFrom = [ "Server", "Response" ] - , name = "bytesBody" - , annotation = - Just - (Type.function - [ Type.namedWith [ "Bytes" ] "Bytes" [] ] - (Type.namedWith - [ "Server", "Response" ] - "Response" - [ Type.var "data", Type.var "error" ] - ) - ) - } - ) - [ bytesBodyArg_ ] - , base64Body = - \base64BodyArg_ -> - Elm.apply - (Elm.value - { importFrom = [ "Server", "Response" ] - , name = "base64Body" - , annotation = - Just - (Type.function - [ Type.string ] - (Type.namedWith - [ "Server", "Response" ] - "Response" - [ Type.var "data", Type.var "error" ] - ) - ) - } - ) - [ base64BodyArg_ ] - , withHeader = - \withHeaderArg_ withHeaderArg_0 withHeaderArg_1 -> - Elm.apply - (Elm.value - { importFrom = [ "Server", "Response" ] - , name = "withHeader" - , annotation = - Just - (Type.function - [ Type.string - , Type.string - , Type.namedWith - [ "Server", "Response" ] - "Response" - [ Type.var "data", Type.var "error" ] - ] - (Type.namedWith - [ "Server", "Response" ] - "Response" - [ Type.var "data", Type.var "error" ] - ) - ) - } - ) - [ withHeaderArg_, withHeaderArg_0, withHeaderArg_1 ] - , withHeaders = - \withHeadersArg_ withHeadersArg_0 -> - Elm.apply - (Elm.value - { importFrom = [ "Server", "Response" ] - , name = "withHeaders" - , annotation = - Just - (Type.function - [ Type.list - (Type.tuple Type.string Type.string) - , Type.namedWith - [ "Server", "Response" ] - "Response" - [ Type.var "data", Type.var "error" ] - ] - (Type.namedWith - [ "Server", "Response" ] - "Response" - [ Type.var "data", Type.var "error" ] - ) - ) - } - ) - [ withHeadersArg_, withHeadersArg_0 ] - , withStatusCode = - \withStatusCodeArg_ withStatusCodeArg_0 -> - Elm.apply - (Elm.value - { importFrom = [ "Server", "Response" ] - , name = "withStatusCode" - , annotation = - Just - (Type.function - [ Type.int - , Type.namedWith - [ "Server", "Response" ] - "Response" - [ Type.var "data" - , Type.namedWith [ "Basics" ] "Never" [] - ] - ] - (Type.namedWith - [ "Server", "Response" ] - "Response" - [ Type.var "data" - , Type.namedWith [ "Basics" ] "Never" [] - ] - ) - ) - } - ) - [ withStatusCodeArg_, withStatusCodeArg_0 ] - , withSetCookieHeader = - \withSetCookieHeaderArg_ withSetCookieHeaderArg_0 -> - Elm.apply - (Elm.value - { importFrom = [ "Server", "Response" ] - , name = "withSetCookieHeader" - , annotation = - Just - (Type.function - [ Type.namedWith - [ "Server", "SetCookie" ] - "SetCookie" - [] - , Type.namedWith - [ "Server", "Response" ] - "Response" - [ Type.var "data", Type.var "error" ] - ] - (Type.namedWith - [ "Server", "Response" ] - "Response" - [ Type.var "data", Type.var "error" ] - ) - ) - } - ) - [ withSetCookieHeaderArg_, withSetCookieHeaderArg_0 ] - , toJson = - \toJsonArg_ -> - Elm.apply - (Elm.value - { importFrom = [ "Server", "Response" ] - , name = "toJson" - , annotation = - Just - (Type.function - [ Type.namedWith - [ "Server", "Response" ] - "Response" - [ Type.namedWith [ "Basics" ] "Never" [] - , Type.namedWith [ "Basics" ] "Never" [] - ] - ] - (Type.namedWith - [ "Json", "Encode" ] - "Value" - [] - ) - ) - } - ) - [ toJsonArg_ ] - } - - -values_ : - { render : Elm.Expression - , map : Elm.Expression - , errorPage : Elm.Expression - , mapError : Elm.Expression - , temporaryRedirect : Elm.Expression - , permanentRedirect : Elm.Expression - , json : Elm.Expression - , plainText : Elm.Expression - , emptyBody : Elm.Expression - , body : Elm.Expression - , bytesBody : Elm.Expression - , base64Body : Elm.Expression - , withHeader : Elm.Expression - , withHeaders : Elm.Expression - , withStatusCode : Elm.Expression - , withSetCookieHeader : Elm.Expression - , toJson : Elm.Expression - } -values_ = - { render = - Elm.value - { importFrom = [ "Server", "Response" ] - , name = "render" - , annotation = - Just - (Type.function - [ Type.var "data" ] - (Type.namedWith - [ "Server", "Response" ] - "Response" - [ Type.var "data", Type.var "error" ] - ) - ) - } - , map = - Elm.value - { importFrom = [ "Server", "Response" ] - , name = "map" - , annotation = - Just - (Type.function - [ Type.function - [ Type.var "data" ] - (Type.var "mappedData") - , Type.namedWith - [ "Server", "Response" ] - "Response" - [ Type.var "data", Type.var "error" ] - ] - (Type.namedWith - [ "Server", "Response" ] - "Response" - [ Type.var "mappedData", Type.var "error" ] - ) - ) - } - , errorPage = - Elm.value - { importFrom = [ "Server", "Response" ] - , name = "errorPage" - , annotation = - Just - (Type.function - [ Type.var "errorPage" ] - (Type.namedWith - [ "Server", "Response" ] - "Response" - [ Type.var "data", Type.var "errorPage" ] - ) - ) - } - , mapError = - Elm.value - { importFrom = [ "Server", "Response" ] - , name = "mapError" - , annotation = - Just - (Type.function - [ Type.function - [ Type.var "errorPage" ] - (Type.var "mappedErrorPage") - , Type.namedWith - [ "Server", "Response" ] - "Response" - [ Type.var "data", Type.var "errorPage" ] - ] - (Type.namedWith - [ "Server", "Response" ] - "Response" - [ Type.var "data", Type.var "mappedErrorPage" ] - ) - ) - } - , temporaryRedirect = - Elm.value - { importFrom = [ "Server", "Response" ] - , name = "temporaryRedirect" - , annotation = - Just - (Type.function - [ Type.string ] - (Type.namedWith - [ "Server", "Response" ] - "Response" - [ Type.var "data", Type.var "error" ] - ) - ) - } - , permanentRedirect = - Elm.value - { importFrom = [ "Server", "Response" ] - , name = "permanentRedirect" - , annotation = - Just - (Type.function - [ Type.string ] - (Type.namedWith - [ "Server", "Response" ] - "Response" - [ Type.var "data", Type.var "error" ] - ) - ) - } - , json = - Elm.value - { importFrom = [ "Server", "Response" ] - , name = "json" - , annotation = - Just - (Type.function - [ Type.namedWith [ "Json", "Encode" ] "Value" [] ] - (Type.namedWith - [ "Server", "Response" ] - "Response" - [ Type.var "data", Type.var "error" ] - ) - ) - } - , plainText = - Elm.value - { importFrom = [ "Server", "Response" ] - , name = "plainText" - , annotation = - Just - (Type.function - [ Type.string ] - (Type.namedWith - [ "Server", "Response" ] - "Response" - [ Type.var "data", Type.var "error" ] - ) - ) - } - , emptyBody = - Elm.value - { importFrom = [ "Server", "Response" ] - , name = "emptyBody" - , annotation = - Just - (Type.namedWith - [ "Server", "Response" ] - "Response" - [ Type.var "data", Type.var "error" ] - ) - } - , body = - Elm.value - { importFrom = [ "Server", "Response" ] - , name = "body" - , annotation = - Just - (Type.function - [ Type.string ] - (Type.namedWith - [ "Server", "Response" ] - "Response" - [ Type.var "data", Type.var "error" ] - ) - ) - } - , bytesBody = - Elm.value - { importFrom = [ "Server", "Response" ] - , name = "bytesBody" - , annotation = - Just - (Type.function - [ Type.namedWith [ "Bytes" ] "Bytes" [] ] - (Type.namedWith - [ "Server", "Response" ] - "Response" - [ Type.var "data", Type.var "error" ] - ) - ) - } - , base64Body = - Elm.value - { importFrom = [ "Server", "Response" ] - , name = "base64Body" - , annotation = - Just - (Type.function - [ Type.string ] - (Type.namedWith - [ "Server", "Response" ] - "Response" - [ Type.var "data", Type.var "error" ] - ) - ) - } - , withHeader = - Elm.value - { importFrom = [ "Server", "Response" ] - , name = "withHeader" - , annotation = - Just - (Type.function - [ Type.string - , Type.string - , Type.namedWith - [ "Server", "Response" ] - "Response" - [ Type.var "data", Type.var "error" ] - ] - (Type.namedWith - [ "Server", "Response" ] - "Response" - [ Type.var "data", Type.var "error" ] - ) - ) - } - , withHeaders = - Elm.value - { importFrom = [ "Server", "Response" ] - , name = "withHeaders" - , annotation = - Just - (Type.function - [ Type.list (Type.tuple Type.string Type.string) - , Type.namedWith - [ "Server", "Response" ] - "Response" - [ Type.var "data", Type.var "error" ] - ] - (Type.namedWith - [ "Server", "Response" ] - "Response" - [ Type.var "data", Type.var "error" ] - ) - ) - } - , withStatusCode = - Elm.value - { importFrom = [ "Server", "Response" ] - , name = "withStatusCode" - , annotation = - Just - (Type.function - [ Type.int - , Type.namedWith - [ "Server", "Response" ] - "Response" - [ Type.var "data" - , Type.namedWith [ "Basics" ] "Never" [] - ] - ] - (Type.namedWith - [ "Server", "Response" ] - "Response" - [ Type.var "data" - , Type.namedWith [ "Basics" ] "Never" [] - ] - ) - ) - } - , withSetCookieHeader = - Elm.value - { importFrom = [ "Server", "Response" ] - , name = "withSetCookieHeader" - , annotation = - Just - (Type.function - [ Type.namedWith - [ "Server", "SetCookie" ] - "SetCookie" - [] - , Type.namedWith - [ "Server", "Response" ] - "Response" - [ Type.var "data", Type.var "error" ] - ] - (Type.namedWith - [ "Server", "Response" ] - "Response" - [ Type.var "data", Type.var "error" ] - ) - ) - } - , toJson = - Elm.value - { importFrom = [ "Server", "Response" ] - , name = "toJson" - , annotation = - Just - (Type.function - [ Type.namedWith - [ "Server", "Response" ] - "Response" - [ Type.namedWith [ "Basics" ] "Never" [] - , Type.namedWith [ "Basics" ] "Never" [] - ] - ] - (Type.namedWith [ "Json", "Encode" ] "Value" []) - ) - } - } \ No newline at end of file diff --git a/elm-open-api-codegen/src/Gen/Server/Session.elm b/elm-open-api-codegen/src/Gen/Server/Session.elm deleted file mode 100644 index b9aa0911..00000000 --- a/elm-open-api-codegen/src/Gen/Server/Session.elm +++ /dev/null @@ -1,974 +0,0 @@ -module Gen.Server.Session exposing - ( moduleName_, withSession, withSessionResult, empty, get, insert - , remove, update, withFlash, annotation_, make_, caseOf_, call_ - , values_ - ) - -{-| -# Generated bindings for Server.Session - -@docs moduleName_, withSession, withSessionResult, empty, get, insert -@docs remove, update, withFlash, annotation_, make_, caseOf_ -@docs call_, values_ --} - - -import Elm -import Elm.Annotation as Type -import Elm.Arg -import Elm.Case - - -{-| The name of this module. -} -moduleName_ : List String -moduleName_ = - [ "Server", "Session" ] - - -{-| The main function for using sessions. If you need more fine-grained control over cases where a session can't be loaded, see -[`withSessionResult`](#withSessionResult). - -withSession: - { name : String - , secrets : BackendTask.BackendTask error (List String) - , options : Maybe Server.SetCookie.Options - } - -> (Server.Session.Session - -> BackendTask.BackendTask error ( Server.Session.Session, Server.Response.Response data errorPage )) - -> Server.Request.Request - -> BackendTask.BackendTask error (Server.Response.Response data errorPage) --} -withSession : - { name : String, secrets : Elm.Expression, options : Elm.Expression } - -> (Elm.Expression -> Elm.Expression) - -> Elm.Expression - -> Elm.Expression -withSession withSessionArg_ withSessionArg_0 withSessionArg_1 = - Elm.apply - (Elm.value - { importFrom = [ "Server", "Session" ] - , name = "withSession" - , annotation = - Just - (Type.function - [ Type.record - [ ( "name", Type.string ) - , ( "secrets" - , Type.namedWith - [ "BackendTask" ] - "BackendTask" - [ Type.var "error", Type.list Type.string ] - ) - , ( "options" - , Type.maybe - (Type.namedWith - [ "Server", "SetCookie" ] - "Options" - [] - ) - ) - ] - , Type.function - [ Type.namedWith - [ "Server", "Session" ] - "Session" - [] - ] - (Type.namedWith - [ "BackendTask" ] - "BackendTask" - [ Type.var "error" - , Type.tuple - (Type.namedWith - [ "Server", "Session" ] - "Session" - [] - ) - (Type.namedWith - [ "Server", "Response" ] - "Response" - [ Type.var "data" - , Type.var "errorPage" - ] - ) - ] - ) - , Type.namedWith [ "Server", "Request" ] "Request" [] - ] - (Type.namedWith - [ "BackendTask" ] - "BackendTask" - [ Type.var "error" - , Type.namedWith - [ "Server", "Response" ] - "Response" - [ Type.var "data", Type.var "errorPage" ] - ] - ) - ) - } - ) - [ Elm.record - [ Tuple.pair "name" (Elm.string withSessionArg_.name) - , Tuple.pair "secrets" withSessionArg_.secrets - , Tuple.pair "options" withSessionArg_.options - ] - , Elm.functionReduced "withSessionUnpack" withSessionArg_0 - , withSessionArg_1 - ] - - -{-| Same as `withSession`, but gives you an `Err` with the reason why the Session couldn't be loaded instead of -using `Session.empty` as a default in the cases where there is an error loading the session. - -A session won't load if there is no session, or if it cannot be unsigned with your secrets. This could be because the cookie was tampered with -or otherwise corrupted, or because the cookie was signed with a secret that is no longer in the rotation. - -withSessionResult: - { name : String - , secrets : BackendTask.BackendTask error (List String) - , options : Maybe Server.SetCookie.Options - } - -> (Result.Result Server.Session.NotLoadedReason Server.Session.Session - -> BackendTask.BackendTask error ( Server.Session.Session, Server.Response.Response data errorPage )) - -> Server.Request.Request - -> BackendTask.BackendTask error (Server.Response.Response data errorPage) --} -withSessionResult : - { name : String, secrets : Elm.Expression, options : Elm.Expression } - -> (Elm.Expression -> Elm.Expression) - -> Elm.Expression - -> Elm.Expression -withSessionResult withSessionResultArg_ withSessionResultArg_0 withSessionResultArg_1 = - Elm.apply - (Elm.value - { importFrom = [ "Server", "Session" ] - , name = "withSessionResult" - , annotation = - Just - (Type.function - [ Type.record - [ ( "name", Type.string ) - , ( "secrets" - , Type.namedWith - [ "BackendTask" ] - "BackendTask" - [ Type.var "error", Type.list Type.string ] - ) - , ( "options" - , Type.maybe - (Type.namedWith - [ "Server", "SetCookie" ] - "Options" - [] - ) - ) - ] - , Type.function - [ Type.namedWith - [ "Result" ] - "Result" - [ Type.namedWith - [ "Server", "Session" ] - "NotLoadedReason" - [] - , Type.namedWith - [ "Server", "Session" ] - "Session" - [] - ] - ] - (Type.namedWith - [ "BackendTask" ] - "BackendTask" - [ Type.var "error" - , Type.tuple - (Type.namedWith - [ "Server", "Session" ] - "Session" - [] - ) - (Type.namedWith - [ "Server", "Response" ] - "Response" - [ Type.var "data" - , Type.var "errorPage" - ] - ) - ] - ) - , Type.namedWith [ "Server", "Request" ] "Request" [] - ] - (Type.namedWith - [ "BackendTask" ] - "BackendTask" - [ Type.var "error" - , Type.namedWith - [ "Server", "Response" ] - "Response" - [ Type.var "data", Type.var "errorPage" ] - ] - ) - ) - } - ) - [ Elm.record - [ Tuple.pair "name" (Elm.string withSessionResultArg_.name) - , Tuple.pair "secrets" withSessionResultArg_.secrets - , Tuple.pair "options" withSessionResultArg_.options - ] - , Elm.functionReduced "withSessionResultUnpack" withSessionResultArg_0 - , withSessionResultArg_1 - ] - - -{-| An empty `Session` with no key-value pairs. - -empty: Server.Session.Session --} -empty : Elm.Expression -empty = - Elm.value - { importFrom = [ "Server", "Session" ] - , name = "empty" - , annotation = - Just (Type.namedWith [ "Server", "Session" ] "Session" []) - } - - -{-| Retrieve a String value from the session for the given key (or `Nothing` if the key is not present). - - (session - |> Session.get "mode" - |> Maybe.withDefault "light" - ) - == "dark" - -get: String -> Server.Session.Session -> Maybe String --} -get : String -> Elm.Expression -> Elm.Expression -get getArg_ getArg_0 = - Elm.apply - (Elm.value - { importFrom = [ "Server", "Session" ] - , name = "get" - , annotation = - Just - (Type.function - [ Type.string - , Type.namedWith [ "Server", "Session" ] "Session" [] - ] - (Type.maybe Type.string) - ) - } - ) - [ Elm.string getArg_, getArg_0 ] - - -{-| Insert a value under the given key in the `Session`. - - session - |> Session.insert "mode" "dark" - -insert: String -> String -> Server.Session.Session -> Server.Session.Session --} -insert : String -> String -> Elm.Expression -> Elm.Expression -insert insertArg_ insertArg_0 insertArg_1 = - Elm.apply - (Elm.value - { importFrom = [ "Server", "Session" ] - , name = "insert" - , annotation = - Just - (Type.function - [ Type.string - , Type.string - , Type.namedWith [ "Server", "Session" ] "Session" [] - ] - (Type.namedWith [ "Server", "Session" ] "Session" []) - ) - } - ) - [ Elm.string insertArg_, Elm.string insertArg_0, insertArg_1 ] - - -{-| Remove a key from the `Session`. - -remove: String -> Server.Session.Session -> Server.Session.Session --} -remove : String -> Elm.Expression -> Elm.Expression -remove removeArg_ removeArg_0 = - Elm.apply - (Elm.value - { importFrom = [ "Server", "Session" ] - , name = "remove" - , annotation = - Just - (Type.function - [ Type.string - , Type.namedWith [ "Server", "Session" ] "Session" [] - ] - (Type.namedWith [ "Server", "Session" ] "Session" []) - ) - } - ) - [ Elm.string removeArg_, removeArg_0 ] - - -{-| Update the `Session`, given a `Maybe String` of the current value for the given key, and returning a `Maybe String`. - -If you return `Nothing`, the key-value pair will be removed from the `Session` (or left out if it didn't exist in the first place). - - session - |> Session.update "mode" - (\mode -> - case mode of - Just "dark" -> - Just "light" - - Just "light" -> - Just "dark" - - Nothing -> - Just "dark" - ) - -update: - String - -> (Maybe String -> Maybe String) - -> Server.Session.Session - -> Server.Session.Session --} -update : - String - -> (Elm.Expression -> Elm.Expression) - -> Elm.Expression - -> Elm.Expression -update updateArg_ updateArg_0 updateArg_1 = - Elm.apply - (Elm.value - { importFrom = [ "Server", "Session" ] - , name = "update" - , annotation = - Just - (Type.function - [ Type.string - , Type.function - [ Type.maybe Type.string ] - (Type.maybe Type.string) - , Type.namedWith [ "Server", "Session" ] "Session" [] - ] - (Type.namedWith [ "Server", "Session" ] "Session" []) - ) - } - ) - [ Elm.string updateArg_ - , Elm.functionReduced "updateUnpack" updateArg_0 - , updateArg_1 - ] - - -{-| Flash session values are values that are only available for the next request. - - session - |> Session.withFlash "message" "Your payment was successful!" - -withFlash: String -> String -> Server.Session.Session -> Server.Session.Session --} -withFlash : String -> String -> Elm.Expression -> Elm.Expression -withFlash withFlashArg_ withFlashArg_0 withFlashArg_1 = - Elm.apply - (Elm.value - { importFrom = [ "Server", "Session" ] - , name = "withFlash" - , annotation = - Just - (Type.function - [ Type.string - , Type.string - , Type.namedWith [ "Server", "Session" ] "Session" [] - ] - (Type.namedWith [ "Server", "Session" ] "Session" []) - ) - } - ) - [ Elm.string withFlashArg_, Elm.string withFlashArg_0, withFlashArg_1 ] - - -annotation_ : { notLoadedReason : Type.Annotation, session : Type.Annotation } -annotation_ = - { notLoadedReason = - Type.namedWith [ "Server", "Session" ] "NotLoadedReason" [] - , session = Type.namedWith [ "Server", "Session" ] "Session" [] - } - - -make_ : - { noSessionCookie : Elm.Expression, invalidSessionCookie : Elm.Expression } -make_ = - { noSessionCookie = - Elm.value - { importFrom = [ "Server", "Session" ] - , name = "NoSessionCookie" - , annotation = Just (Type.namedWith [] "NotLoadedReason" []) - } - , invalidSessionCookie = - Elm.value - { importFrom = [ "Server", "Session" ] - , name = "InvalidSessionCookie" - , annotation = Just (Type.namedWith [] "NotLoadedReason" []) - } - } - - -caseOf_ : - { notLoadedReason : - Elm.Expression - -> { noSessionCookie : Elm.Expression - , invalidSessionCookie : Elm.Expression - } - -> Elm.Expression - } -caseOf_ = - { notLoadedReason = - \notLoadedReasonExpression notLoadedReasonTags -> - Elm.Case.custom - notLoadedReasonExpression - (Type.namedWith [ "Server", "Session" ] "NotLoadedReason" []) - [ Elm.Case.branch - (Elm.Arg.customType - "NoSessionCookie" - notLoadedReasonTags.noSessionCookie - ) - Basics.identity - , Elm.Case.branch - (Elm.Arg.customType - "InvalidSessionCookie" - notLoadedReasonTags.invalidSessionCookie - ) - Basics.identity - ] - } - - -call_ : - { withSession : - Elm.Expression -> Elm.Expression -> Elm.Expression -> Elm.Expression - , withSessionResult : - Elm.Expression -> Elm.Expression -> Elm.Expression -> Elm.Expression - , get : Elm.Expression -> Elm.Expression -> Elm.Expression - , insert : - Elm.Expression -> Elm.Expression -> Elm.Expression -> Elm.Expression - , remove : Elm.Expression -> Elm.Expression -> Elm.Expression - , update : - Elm.Expression -> Elm.Expression -> Elm.Expression -> Elm.Expression - , withFlash : - Elm.Expression -> Elm.Expression -> Elm.Expression -> Elm.Expression - } -call_ = - { withSession = - \withSessionArg_ withSessionArg_0 withSessionArg_1 -> - Elm.apply - (Elm.value - { importFrom = [ "Server", "Session" ] - , name = "withSession" - , annotation = - Just - (Type.function - [ Type.record - [ ( "name", Type.string ) - , ( "secrets" - , Type.namedWith - [ "BackendTask" ] - "BackendTask" - [ Type.var "error" - , Type.list Type.string - ] - ) - , ( "options" - , Type.maybe - (Type.namedWith - [ "Server", "SetCookie" ] - "Options" - [] - ) - ) - ] - , Type.function - [ Type.namedWith - [ "Server", "Session" ] - "Session" - [] - ] - (Type.namedWith - [ "BackendTask" ] - "BackendTask" - [ Type.var "error" - , Type.tuple - (Type.namedWith - [ "Server", "Session" ] - "Session" - [] - ) - (Type.namedWith - [ "Server", "Response" ] - "Response" - [ Type.var "data" - , Type.var "errorPage" - ] - ) - ] - ) - , Type.namedWith - [ "Server", "Request" ] - "Request" - [] - ] - (Type.namedWith - [ "BackendTask" ] - "BackendTask" - [ Type.var "error" - , Type.namedWith - [ "Server", "Response" ] - "Response" - [ Type.var "data" - , Type.var "errorPage" - ] - ] - ) - ) - } - ) - [ withSessionArg_, withSessionArg_0, withSessionArg_1 ] - , withSessionResult = - \withSessionResultArg_ withSessionResultArg_0 withSessionResultArg_1 -> - Elm.apply - (Elm.value - { importFrom = [ "Server", "Session" ] - , name = "withSessionResult" - , annotation = - Just - (Type.function - [ Type.record - [ ( "name", Type.string ) - , ( "secrets" - , Type.namedWith - [ "BackendTask" ] - "BackendTask" - [ Type.var "error" - , Type.list Type.string - ] - ) - , ( "options" - , Type.maybe - (Type.namedWith - [ "Server", "SetCookie" ] - "Options" - [] - ) - ) - ] - , Type.function - [ Type.namedWith - [ "Result" ] - "Result" - [ Type.namedWith - [ "Server", "Session" ] - "NotLoadedReason" - [] - , Type.namedWith - [ "Server", "Session" ] - "Session" - [] - ] - ] - (Type.namedWith - [ "BackendTask" ] - "BackendTask" - [ Type.var "error" - , Type.tuple - (Type.namedWith - [ "Server", "Session" ] - "Session" - [] - ) - (Type.namedWith - [ "Server", "Response" ] - "Response" - [ Type.var "data" - , Type.var "errorPage" - ] - ) - ] - ) - , Type.namedWith - [ "Server", "Request" ] - "Request" - [] - ] - (Type.namedWith - [ "BackendTask" ] - "BackendTask" - [ Type.var "error" - , Type.namedWith - [ "Server", "Response" ] - "Response" - [ Type.var "data" - , Type.var "errorPage" - ] - ] - ) - ) - } - ) - [ withSessionResultArg_ - , withSessionResultArg_0 - , withSessionResultArg_1 - ] - , get = - \getArg_ getArg_0 -> - Elm.apply - (Elm.value - { importFrom = [ "Server", "Session" ] - , name = "get" - , annotation = - Just - (Type.function - [ Type.string - , Type.namedWith - [ "Server", "Session" ] - "Session" - [] - ] - (Type.maybe Type.string) - ) - } - ) - [ getArg_, getArg_0 ] - , insert = - \insertArg_ insertArg_0 insertArg_1 -> - Elm.apply - (Elm.value - { importFrom = [ "Server", "Session" ] - , name = "insert" - , annotation = - Just - (Type.function - [ Type.string - , Type.string - , Type.namedWith - [ "Server", "Session" ] - "Session" - [] - ] - (Type.namedWith - [ "Server", "Session" ] - "Session" - [] - ) - ) - } - ) - [ insertArg_, insertArg_0, insertArg_1 ] - , remove = - \removeArg_ removeArg_0 -> - Elm.apply - (Elm.value - { importFrom = [ "Server", "Session" ] - , name = "remove" - , annotation = - Just - (Type.function - [ Type.string - , Type.namedWith - [ "Server", "Session" ] - "Session" - [] - ] - (Type.namedWith - [ "Server", "Session" ] - "Session" - [] - ) - ) - } - ) - [ removeArg_, removeArg_0 ] - , update = - \updateArg_ updateArg_0 updateArg_1 -> - Elm.apply - (Elm.value - { importFrom = [ "Server", "Session" ] - , name = "update" - , annotation = - Just - (Type.function - [ Type.string - , Type.function - [ Type.maybe Type.string ] - (Type.maybe Type.string) - , Type.namedWith - [ "Server", "Session" ] - "Session" - [] - ] - (Type.namedWith - [ "Server", "Session" ] - "Session" - [] - ) - ) - } - ) - [ updateArg_, updateArg_0, updateArg_1 ] - , withFlash = - \withFlashArg_ withFlashArg_0 withFlashArg_1 -> - Elm.apply - (Elm.value - { importFrom = [ "Server", "Session" ] - , name = "withFlash" - , annotation = - Just - (Type.function - [ Type.string - , Type.string - , Type.namedWith - [ "Server", "Session" ] - "Session" - [] - ] - (Type.namedWith - [ "Server", "Session" ] - "Session" - [] - ) - ) - } - ) - [ withFlashArg_, withFlashArg_0, withFlashArg_1 ] - } - - -values_ : - { withSession : Elm.Expression - , withSessionResult : Elm.Expression - , empty : Elm.Expression - , get : Elm.Expression - , insert : Elm.Expression - , remove : Elm.Expression - , update : Elm.Expression - , withFlash : Elm.Expression - } -values_ = - { withSession = - Elm.value - { importFrom = [ "Server", "Session" ] - , name = "withSession" - , annotation = - Just - (Type.function - [ Type.record - [ ( "name", Type.string ) - , ( "secrets" - , Type.namedWith - [ "BackendTask" ] - "BackendTask" - [ Type.var "error", Type.list Type.string ] - ) - , ( "options" - , Type.maybe - (Type.namedWith - [ "Server", "SetCookie" ] - "Options" - [] - ) - ) - ] - , Type.function - [ Type.namedWith - [ "Server", "Session" ] - "Session" - [] - ] - (Type.namedWith - [ "BackendTask" ] - "BackendTask" - [ Type.var "error" - , Type.tuple - (Type.namedWith - [ "Server", "Session" ] - "Session" - [] - ) - (Type.namedWith - [ "Server", "Response" ] - "Response" - [ Type.var "data" - , Type.var "errorPage" - ] - ) - ] - ) - , Type.namedWith [ "Server", "Request" ] "Request" [] - ] - (Type.namedWith - [ "BackendTask" ] - "BackendTask" - [ Type.var "error" - , Type.namedWith - [ "Server", "Response" ] - "Response" - [ Type.var "data", Type.var "errorPage" ] - ] - ) - ) - } - , withSessionResult = - Elm.value - { importFrom = [ "Server", "Session" ] - , name = "withSessionResult" - , annotation = - Just - (Type.function - [ Type.record - [ ( "name", Type.string ) - , ( "secrets" - , Type.namedWith - [ "BackendTask" ] - "BackendTask" - [ Type.var "error", Type.list Type.string ] - ) - , ( "options" - , Type.maybe - (Type.namedWith - [ "Server", "SetCookie" ] - "Options" - [] - ) - ) - ] - , Type.function - [ Type.namedWith - [ "Result" ] - "Result" - [ Type.namedWith - [ "Server", "Session" ] - "NotLoadedReason" - [] - , Type.namedWith - [ "Server", "Session" ] - "Session" - [] - ] - ] - (Type.namedWith - [ "BackendTask" ] - "BackendTask" - [ Type.var "error" - , Type.tuple - (Type.namedWith - [ "Server", "Session" ] - "Session" - [] - ) - (Type.namedWith - [ "Server", "Response" ] - "Response" - [ Type.var "data" - , Type.var "errorPage" - ] - ) - ] - ) - , Type.namedWith [ "Server", "Request" ] "Request" [] - ] - (Type.namedWith - [ "BackendTask" ] - "BackendTask" - [ Type.var "error" - , Type.namedWith - [ "Server", "Response" ] - "Response" - [ Type.var "data", Type.var "errorPage" ] - ] - ) - ) - } - , empty = - Elm.value - { importFrom = [ "Server", "Session" ] - , name = "empty" - , annotation = - Just (Type.namedWith [ "Server", "Session" ] "Session" []) - } - , get = - Elm.value - { importFrom = [ "Server", "Session" ] - , name = "get" - , annotation = - Just - (Type.function - [ Type.string - , Type.namedWith [ "Server", "Session" ] "Session" [] - ] - (Type.maybe Type.string) - ) - } - , insert = - Elm.value - { importFrom = [ "Server", "Session" ] - , name = "insert" - , annotation = - Just - (Type.function - [ Type.string - , Type.string - , Type.namedWith [ "Server", "Session" ] "Session" [] - ] - (Type.namedWith [ "Server", "Session" ] "Session" []) - ) - } - , remove = - Elm.value - { importFrom = [ "Server", "Session" ] - , name = "remove" - , annotation = - Just - (Type.function - [ Type.string - , Type.namedWith [ "Server", "Session" ] "Session" [] - ] - (Type.namedWith [ "Server", "Session" ] "Session" []) - ) - } - , update = - Elm.value - { importFrom = [ "Server", "Session" ] - , name = "update" - , annotation = - Just - (Type.function - [ Type.string - , Type.function - [ Type.maybe Type.string ] - (Type.maybe Type.string) - , Type.namedWith [ "Server", "Session" ] "Session" [] - ] - (Type.namedWith [ "Server", "Session" ] "Session" []) - ) - } - , withFlash = - Elm.value - { importFrom = [ "Server", "Session" ] - , name = "withFlash" - , annotation = - Just - (Type.function - [ Type.string - , Type.string - , Type.namedWith [ "Server", "Session" ] "Session" [] - ] - (Type.namedWith [ "Server", "Session" ] "Session" []) - ) - } - } \ No newline at end of file diff --git a/elm-open-api-codegen/src/Gen/Server/SetCookie.elm b/elm-open-api-codegen/src/Gen/Server/SetCookie.elm deleted file mode 100644 index 18f0fe6d..00000000 --- a/elm-open-api-codegen/src/Gen/Server/SetCookie.elm +++ /dev/null @@ -1,985 +0,0 @@ -module Gen.Server.SetCookie exposing - ( moduleName_, setCookie, options, withSameSite, withImmediateExpiration, makeVisibleToJavaScript - , nonSecure, withDomain, withExpiration, withMaxAge, withPath, withoutPath, toString - , annotation_, make_, caseOf_, call_, values_ - ) - -{-| -# Generated bindings for Server.SetCookie - -@docs moduleName_, setCookie, options, withSameSite, withImmediateExpiration, makeVisibleToJavaScript -@docs nonSecure, withDomain, withExpiration, withMaxAge, withPath, withoutPath -@docs toString, annotation_, make_, caseOf_, call_, values_ --} - - -import Elm -import Elm.Annotation as Type -import Elm.Arg -import Elm.Case - - -{-| The name of this module. -} -moduleName_ : List String -moduleName_ = - [ "Server", "SetCookie" ] - - -{-| Create a `SetCookie` record with the given name, value, and [`Options`](Options]. To add a `Set-Cookie` header, you can -pass this value with [`Server.Response.withSetCookieHeader`](Server-Response#withSetCookieHeader). Or for more low-level -uses you can stringify the value manually with [`toString`](#toString). - -setCookie: String -> String -> Server.SetCookie.Options -> Server.SetCookie.SetCookie --} -setCookie : String -> String -> Elm.Expression -> Elm.Expression -setCookie setCookieArg_ setCookieArg_0 setCookieArg_1 = - Elm.apply - (Elm.value - { importFrom = [ "Server", "SetCookie" ] - , name = "setCookie" - , annotation = - Just - (Type.function - [ Type.string - , Type.string - , Type.namedWith - [ "Server", "SetCookie" ] - "Options" - [] - ] - (Type.namedWith - [ "Server", "SetCookie" ] - "SetCookie" - [] - ) - ) - } - ) - [ Elm.string setCookieArg_, Elm.string setCookieArg_0, setCookieArg_1 ] - - -{-| Initialize the default `SetCookie` `Options`. Can be configured directly through a record update, or with `withExpiration`, etc. - -options: Server.SetCookie.Options --} -options : Elm.Expression -options = - Elm.value - { importFrom = [ "Server", "SetCookie" ] - , name = "options" - , annotation = - Just (Type.namedWith [ "Server", "SetCookie" ] "Options" []) - } - - -{-| The default SameSite policy is Lax if one is not explicitly set. See the SameSite section in . - -withSameSite: - Server.SetCookie.SameSite - -> Server.SetCookie.Options - -> Server.SetCookie.Options --} -withSameSite : Elm.Expression -> Elm.Expression -> Elm.Expression -withSameSite withSameSiteArg_ withSameSiteArg_0 = - Elm.apply - (Elm.value - { importFrom = [ "Server", "SetCookie" ] - , name = "withSameSite" - , annotation = - Just - (Type.function - [ Type.namedWith - [ "Server", "SetCookie" ] - "SameSite" - [] - , Type.namedWith - [ "Server", "SetCookie" ] - "Options" - [] - ] - (Type.namedWith [ "Server", "SetCookie" ] "Options" [] - ) - ) - } - ) - [ withSameSiteArg_, withSameSiteArg_0 ] - - -{-| Sets [`Expires`](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Set-Cookie#expiresdate) to `Time.millisToPosix 0`, -which effectively tells the browser to delete the cookie immediately (by giving it an expiration date in the past). - -withImmediateExpiration: Server.SetCookie.Options -> Server.SetCookie.Options --} -withImmediateExpiration : Elm.Expression -> Elm.Expression -withImmediateExpiration withImmediateExpirationArg_ = - Elm.apply - (Elm.value - { importFrom = [ "Server", "SetCookie" ] - , name = "withImmediateExpiration" - , annotation = - Just - (Type.function - [ Type.namedWith - [ "Server", "SetCookie" ] - "Options" - [] - ] - (Type.namedWith [ "Server", "SetCookie" ] "Options" [] - ) - ) - } - ) - [ withImmediateExpirationArg_ ] - - -{-| The default option in this API is for HttpOnly cookies . - -Cookies can be exposed so you can read them from JavaScript using `Document.cookie`. When this is intended and understood -then there's nothing unsafe about that (for example, if you are setting a `darkMode` cookie and what to access that -dynamically). In this API you opt into exposing a cookie you set to JavaScript to ensure cookies aren't exposed to JS unintentionally. - -In general if you can accomplish your goal using HttpOnly cookies (i.e. not using `makeVisibleToJavaScript`) then -it's a good practice. With server-rendered `elm-pages` applications you can often manage your session state by pulling -in session data from cookies in a `BackendTask` (which is resolved server-side before it ever reaches the browser). - -makeVisibleToJavaScript: Server.SetCookie.Options -> Server.SetCookie.Options --} -makeVisibleToJavaScript : Elm.Expression -> Elm.Expression -makeVisibleToJavaScript makeVisibleToJavaScriptArg_ = - Elm.apply - (Elm.value - { importFrom = [ "Server", "SetCookie" ] - , name = "makeVisibleToJavaScript" - , annotation = - Just - (Type.function - [ Type.namedWith - [ "Server", "SetCookie" ] - "Options" - [] - ] - (Type.namedWith [ "Server", "SetCookie" ] "Options" [] - ) - ) - } - ) - [ makeVisibleToJavaScriptArg_ ] - - -{-| Secure (only sent over https, or localhost on http) is the default. This overrides that and -removes the `Secure` attribute from the cookie. - -nonSecure: Server.SetCookie.Options -> Server.SetCookie.Options --} -nonSecure : Elm.Expression -> Elm.Expression -nonSecure nonSecureArg_ = - Elm.apply - (Elm.value - { importFrom = [ "Server", "SetCookie" ] - , name = "nonSecure" - , annotation = - Just - (Type.function - [ Type.namedWith - [ "Server", "SetCookie" ] - "Options" - [] - ] - (Type.namedWith [ "Server", "SetCookie" ] "Options" [] - ) - ) - } - ) - [ nonSecureArg_ ] - - -{-| Sets the `Set-Cookie`'s [`Domain`](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Set-Cookie#domaindomain-value). - -withDomain: String -> Server.SetCookie.Options -> Server.SetCookie.Options --} -withDomain : String -> Elm.Expression -> Elm.Expression -withDomain withDomainArg_ withDomainArg_0 = - Elm.apply - (Elm.value - { importFrom = [ "Server", "SetCookie" ] - , name = "withDomain" - , annotation = - Just - (Type.function - [ Type.string - , Type.namedWith - [ "Server", "SetCookie" ] - "Options" - [] - ] - (Type.namedWith [ "Server", "SetCookie" ] "Options" [] - ) - ) - } - ) - [ Elm.string withDomainArg_, withDomainArg_0 ] - - -{-| withExpiration: Time.Posix -> Server.SetCookie.Options -> Server.SetCookie.Options -} -withExpiration : Elm.Expression -> Elm.Expression -> Elm.Expression -withExpiration withExpirationArg_ withExpirationArg_0 = - Elm.apply - (Elm.value - { importFrom = [ "Server", "SetCookie" ] - , name = "withExpiration" - , annotation = - Just - (Type.function - [ Type.namedWith [ "Time" ] "Posix" [] - , Type.namedWith - [ "Server", "SetCookie" ] - "Options" - [] - ] - (Type.namedWith [ "Server", "SetCookie" ] "Options" [] - ) - ) - } - ) - [ withExpirationArg_, withExpirationArg_0 ] - - -{-| Sets the `Set-Cookie`'s [`Max-Age`](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Set-Cookie#max-agenumber). - -withMaxAge: Int -> Server.SetCookie.Options -> Server.SetCookie.Options --} -withMaxAge : Int -> Elm.Expression -> Elm.Expression -withMaxAge withMaxAgeArg_ withMaxAgeArg_0 = - Elm.apply - (Elm.value - { importFrom = [ "Server", "SetCookie" ] - , name = "withMaxAge" - , annotation = - Just - (Type.function - [ Type.int - , Type.namedWith - [ "Server", "SetCookie" ] - "Options" - [] - ] - (Type.namedWith [ "Server", "SetCookie" ] "Options" [] - ) - ) - } - ) - [ Elm.int withMaxAgeArg_, withMaxAgeArg_0 ] - - -{-| Sets the `Set-Cookie`'s [`Path`](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Set-Cookie#pathpath-value). - -The default value is `/`, which will match any sub-directories or the root directory. See also [\`withoutPath](#withoutPath) - -withPath: String -> Server.SetCookie.Options -> Server.SetCookie.Options --} -withPath : String -> Elm.Expression -> Elm.Expression -withPath withPathArg_ withPathArg_0 = - Elm.apply - (Elm.value - { importFrom = [ "Server", "SetCookie" ] - , name = "withPath" - , annotation = - Just - (Type.function - [ Type.string - , Type.namedWith - [ "Server", "SetCookie" ] - "Options" - [] - ] - (Type.namedWith [ "Server", "SetCookie" ] "Options" [] - ) - ) - } - ) - [ Elm.string withPathArg_, withPathArg_0 ] - - -{-| > If the server omits the Path attribute, the user agent will use the "directory" of the request-uri's path component as the default value. - -Source: . See . - -withoutPath: Server.SetCookie.Options -> Server.SetCookie.Options --} -withoutPath : Elm.Expression -> Elm.Expression -withoutPath withoutPathArg_ = - Elm.apply - (Elm.value - { importFrom = [ "Server", "SetCookie" ] - , name = "withoutPath" - , annotation = - Just - (Type.function - [ Type.namedWith - [ "Server", "SetCookie" ] - "Options" - [] - ] - (Type.namedWith [ "Server", "SetCookie" ] "Options" [] - ) - ) - } - ) - [ withoutPathArg_ ] - - -{-| Usually you'll want to use [`Server.Response.withSetCookieHeader`](Server-Response#withSetCookieHeader) instead. - -This is a low-level helper that's there in case you want it but most users will never need this. - -toString: Server.SetCookie.SetCookie -> String --} -toString : Elm.Expression -> Elm.Expression -toString toStringArg_ = - Elm.apply - (Elm.value - { importFrom = [ "Server", "SetCookie" ] - , name = "toString" - , annotation = - Just - (Type.function - [ Type.namedWith - [ "Server", "SetCookie" ] - "SetCookie" - [] - ] - Type.string - ) - } - ) - [ toStringArg_ ] - - -annotation_ : - { setCookie : Type.Annotation - , options : Type.Annotation - , sameSite : Type.Annotation - } -annotation_ = - { setCookie = - Type.alias - moduleName_ - "SetCookie" - [] - (Type.record - [ ( "name", Type.string ) - , ( "value", Type.string ) - , ( "options" - , Type.namedWith [ "Server", "SetCookie" ] "Options" [] - ) - ] - ) - , options = - Type.alias - moduleName_ - "Options" - [] - (Type.record - [ ( "expiration" - , Type.maybe (Type.namedWith [ "Time" ] "Posix" []) - ) - , ( "visibleToJavaScript", Type.bool ) - , ( "maxAge", Type.maybe Type.int ) - , ( "path", Type.maybe Type.string ) - , ( "domain", Type.maybe Type.string ) - , ( "secure", Type.bool ) - , ( "sameSite" - , Type.maybe - (Type.namedWith [ "Server", "SetCookie" ] "SameSite" [] - ) - ) - ] - ) - , sameSite = Type.namedWith [ "Server", "SetCookie" ] "SameSite" [] - } - - -make_ : - { setCookie : - { name : Elm.Expression - , value : Elm.Expression - , options : Elm.Expression - } - -> Elm.Expression - , options : - { expiration : Elm.Expression - , visibleToJavaScript : Elm.Expression - , maxAge : Elm.Expression - , path : Elm.Expression - , domain : Elm.Expression - , secure : Elm.Expression - , sameSite : Elm.Expression - } - -> Elm.Expression - , strict : Elm.Expression - , lax : Elm.Expression - , none : Elm.Expression - } -make_ = - { setCookie = - \setCookie_args -> - Elm.withType - (Type.alias - [ "Server", "SetCookie" ] - "SetCookie" - [] - (Type.record - [ ( "name", Type.string ) - , ( "value", Type.string ) - , ( "options" - , Type.namedWith - [ "Server", "SetCookie" ] - "Options" - [] - ) - ] - ) - ) - (Elm.record - [ Tuple.pair "name" setCookie_args.name - , Tuple.pair "value" setCookie_args.value - , Tuple.pair "options" setCookie_args.options - ] - ) - , options = - \options_args -> - Elm.withType - (Type.alias - [ "Server", "SetCookie" ] - "Options" - [] - (Type.record - [ ( "expiration" - , Type.maybe (Type.namedWith [ "Time" ] "Posix" []) - ) - , ( "visibleToJavaScript", Type.bool ) - , ( "maxAge", Type.maybe Type.int ) - , ( "path", Type.maybe Type.string ) - , ( "domain", Type.maybe Type.string ) - , ( "secure", Type.bool ) - , ( "sameSite" - , Type.maybe - (Type.namedWith - [ "Server", "SetCookie" ] - "SameSite" - [] - ) - ) - ] - ) - ) - (Elm.record - [ Tuple.pair "expiration" options_args.expiration - , Tuple.pair - "visibleToJavaScript" - options_args.visibleToJavaScript - , Tuple.pair "maxAge" options_args.maxAge - , Tuple.pair "path" options_args.path - , Tuple.pair "domain" options_args.domain - , Tuple.pair "secure" options_args.secure - , Tuple.pair "sameSite" options_args.sameSite - ] - ) - , strict = - Elm.value - { importFrom = [ "Server", "SetCookie" ] - , name = "Strict" - , annotation = Just (Type.namedWith [] "SameSite" []) - } - , lax = - Elm.value - { importFrom = [ "Server", "SetCookie" ] - , name = "Lax" - , annotation = Just (Type.namedWith [] "SameSite" []) - } - , none = - Elm.value - { importFrom = [ "Server", "SetCookie" ] - , name = "None" - , annotation = Just (Type.namedWith [] "SameSite" []) - } - } - - -caseOf_ : - { sameSite : - Elm.Expression - -> { strict : Elm.Expression - , lax : Elm.Expression - , none : Elm.Expression - } - -> Elm.Expression - } -caseOf_ = - { sameSite = - \sameSiteExpression sameSiteTags -> - Elm.Case.custom - sameSiteExpression - (Type.namedWith [ "Server", "SetCookie" ] "SameSite" []) - [ Elm.Case.branch - (Elm.Arg.customType "Strict" sameSiteTags.strict) - Basics.identity - , Elm.Case.branch - (Elm.Arg.customType "Lax" sameSiteTags.lax) - Basics.identity - , Elm.Case.branch - (Elm.Arg.customType "None" sameSiteTags.none) - Basics.identity - ] - } - - -call_ : - { setCookie : - Elm.Expression -> Elm.Expression -> Elm.Expression -> Elm.Expression - , withSameSite : Elm.Expression -> Elm.Expression -> Elm.Expression - , withImmediateExpiration : Elm.Expression -> Elm.Expression - , makeVisibleToJavaScript : Elm.Expression -> Elm.Expression - , nonSecure : Elm.Expression -> Elm.Expression - , withDomain : Elm.Expression -> Elm.Expression -> Elm.Expression - , withExpiration : Elm.Expression -> Elm.Expression -> Elm.Expression - , withMaxAge : Elm.Expression -> Elm.Expression -> Elm.Expression - , withPath : Elm.Expression -> Elm.Expression -> Elm.Expression - , withoutPath : Elm.Expression -> Elm.Expression - , toString : Elm.Expression -> Elm.Expression - } -call_ = - { setCookie = - \setCookieArg_ setCookieArg_0 setCookieArg_1 -> - Elm.apply - (Elm.value - { importFrom = [ "Server", "SetCookie" ] - , name = "setCookie" - , annotation = - Just - (Type.function - [ Type.string - , Type.string - , Type.namedWith - [ "Server", "SetCookie" ] - "Options" - [] - ] - (Type.namedWith - [ "Server", "SetCookie" ] - "SetCookie" - [] - ) - ) - } - ) - [ setCookieArg_, setCookieArg_0, setCookieArg_1 ] - , withSameSite = - \withSameSiteArg_ withSameSiteArg_0 -> - Elm.apply - (Elm.value - { importFrom = [ "Server", "SetCookie" ] - , name = "withSameSite" - , annotation = - Just - (Type.function - [ Type.namedWith - [ "Server", "SetCookie" ] - "SameSite" - [] - , Type.namedWith - [ "Server", "SetCookie" ] - "Options" - [] - ] - (Type.namedWith - [ "Server", "SetCookie" ] - "Options" - [] - ) - ) - } - ) - [ withSameSiteArg_, withSameSiteArg_0 ] - , withImmediateExpiration = - \withImmediateExpirationArg_ -> - Elm.apply - (Elm.value - { importFrom = [ "Server", "SetCookie" ] - , name = "withImmediateExpiration" - , annotation = - Just - (Type.function - [ Type.namedWith - [ "Server", "SetCookie" ] - "Options" - [] - ] - (Type.namedWith - [ "Server", "SetCookie" ] - "Options" - [] - ) - ) - } - ) - [ withImmediateExpirationArg_ ] - , makeVisibleToJavaScript = - \makeVisibleToJavaScriptArg_ -> - Elm.apply - (Elm.value - { importFrom = [ "Server", "SetCookie" ] - , name = "makeVisibleToJavaScript" - , annotation = - Just - (Type.function - [ Type.namedWith - [ "Server", "SetCookie" ] - "Options" - [] - ] - (Type.namedWith - [ "Server", "SetCookie" ] - "Options" - [] - ) - ) - } - ) - [ makeVisibleToJavaScriptArg_ ] - , nonSecure = - \nonSecureArg_ -> - Elm.apply - (Elm.value - { importFrom = [ "Server", "SetCookie" ] - , name = "nonSecure" - , annotation = - Just - (Type.function - [ Type.namedWith - [ "Server", "SetCookie" ] - "Options" - [] - ] - (Type.namedWith - [ "Server", "SetCookie" ] - "Options" - [] - ) - ) - } - ) - [ nonSecureArg_ ] - , withDomain = - \withDomainArg_ withDomainArg_0 -> - Elm.apply - (Elm.value - { importFrom = [ "Server", "SetCookie" ] - , name = "withDomain" - , annotation = - Just - (Type.function - [ Type.string - , Type.namedWith - [ "Server", "SetCookie" ] - "Options" - [] - ] - (Type.namedWith - [ "Server", "SetCookie" ] - "Options" - [] - ) - ) - } - ) - [ withDomainArg_, withDomainArg_0 ] - , withExpiration = - \withExpirationArg_ withExpirationArg_0 -> - Elm.apply - (Elm.value - { importFrom = [ "Server", "SetCookie" ] - , name = "withExpiration" - , annotation = - Just - (Type.function - [ Type.namedWith [ "Time" ] "Posix" [] - , Type.namedWith - [ "Server", "SetCookie" ] - "Options" - [] - ] - (Type.namedWith - [ "Server", "SetCookie" ] - "Options" - [] - ) - ) - } - ) - [ withExpirationArg_, withExpirationArg_0 ] - , withMaxAge = - \withMaxAgeArg_ withMaxAgeArg_0 -> - Elm.apply - (Elm.value - { importFrom = [ "Server", "SetCookie" ] - , name = "withMaxAge" - , annotation = - Just - (Type.function - [ Type.int - , Type.namedWith - [ "Server", "SetCookie" ] - "Options" - [] - ] - (Type.namedWith - [ "Server", "SetCookie" ] - "Options" - [] - ) - ) - } - ) - [ withMaxAgeArg_, withMaxAgeArg_0 ] - , withPath = - \withPathArg_ withPathArg_0 -> - Elm.apply - (Elm.value - { importFrom = [ "Server", "SetCookie" ] - , name = "withPath" - , annotation = - Just - (Type.function - [ Type.string - , Type.namedWith - [ "Server", "SetCookie" ] - "Options" - [] - ] - (Type.namedWith - [ "Server", "SetCookie" ] - "Options" - [] - ) - ) - } - ) - [ withPathArg_, withPathArg_0 ] - , withoutPath = - \withoutPathArg_ -> - Elm.apply - (Elm.value - { importFrom = [ "Server", "SetCookie" ] - , name = "withoutPath" - , annotation = - Just - (Type.function - [ Type.namedWith - [ "Server", "SetCookie" ] - "Options" - [] - ] - (Type.namedWith - [ "Server", "SetCookie" ] - "Options" - [] - ) - ) - } - ) - [ withoutPathArg_ ] - , toString = - \toStringArg_ -> - Elm.apply - (Elm.value - { importFrom = [ "Server", "SetCookie" ] - , name = "toString" - , annotation = - Just - (Type.function - [ Type.namedWith - [ "Server", "SetCookie" ] - "SetCookie" - [] - ] - Type.string - ) - } - ) - [ toStringArg_ ] - } - - -values_ : - { setCookie : Elm.Expression - , options : Elm.Expression - , withSameSite : Elm.Expression - , withImmediateExpiration : Elm.Expression - , makeVisibleToJavaScript : Elm.Expression - , nonSecure : Elm.Expression - , withDomain : Elm.Expression - , withExpiration : Elm.Expression - , withMaxAge : Elm.Expression - , withPath : Elm.Expression - , withoutPath : Elm.Expression - , toString : Elm.Expression - } -values_ = - { setCookie = - Elm.value - { importFrom = [ "Server", "SetCookie" ] - , name = "setCookie" - , annotation = - Just - (Type.function - [ Type.string - , Type.string - , Type.namedWith [ "Server", "SetCookie" ] "Options" [] - ] - (Type.namedWith - [ "Server", "SetCookie" ] - "SetCookie" - [] - ) - ) - } - , options = - Elm.value - { importFrom = [ "Server", "SetCookie" ] - , name = "options" - , annotation = - Just (Type.namedWith [ "Server", "SetCookie" ] "Options" []) - } - , withSameSite = - Elm.value - { importFrom = [ "Server", "SetCookie" ] - , name = "withSameSite" - , annotation = - Just - (Type.function - [ Type.namedWith - [ "Server", "SetCookie" ] - "SameSite" - [] - , Type.namedWith [ "Server", "SetCookie" ] "Options" [] - ] - (Type.namedWith [ "Server", "SetCookie" ] "Options" []) - ) - } - , withImmediateExpiration = - Elm.value - { importFrom = [ "Server", "SetCookie" ] - , name = "withImmediateExpiration" - , annotation = - Just - (Type.function - [ Type.namedWith [ "Server", "SetCookie" ] "Options" [] - ] - (Type.namedWith [ "Server", "SetCookie" ] "Options" []) - ) - } - , makeVisibleToJavaScript = - Elm.value - { importFrom = [ "Server", "SetCookie" ] - , name = "makeVisibleToJavaScript" - , annotation = - Just - (Type.function - [ Type.namedWith [ "Server", "SetCookie" ] "Options" [] - ] - (Type.namedWith [ "Server", "SetCookie" ] "Options" []) - ) - } - , nonSecure = - Elm.value - { importFrom = [ "Server", "SetCookie" ] - , name = "nonSecure" - , annotation = - Just - (Type.function - [ Type.namedWith [ "Server", "SetCookie" ] "Options" [] - ] - (Type.namedWith [ "Server", "SetCookie" ] "Options" []) - ) - } - , withDomain = - Elm.value - { importFrom = [ "Server", "SetCookie" ] - , name = "withDomain" - , annotation = - Just - (Type.function - [ Type.string - , Type.namedWith [ "Server", "SetCookie" ] "Options" [] - ] - (Type.namedWith [ "Server", "SetCookie" ] "Options" []) - ) - } - , withExpiration = - Elm.value - { importFrom = [ "Server", "SetCookie" ] - , name = "withExpiration" - , annotation = - Just - (Type.function - [ Type.namedWith [ "Time" ] "Posix" [] - , Type.namedWith [ "Server", "SetCookie" ] "Options" [] - ] - (Type.namedWith [ "Server", "SetCookie" ] "Options" []) - ) - } - , withMaxAge = - Elm.value - { importFrom = [ "Server", "SetCookie" ] - , name = "withMaxAge" - , annotation = - Just - (Type.function - [ Type.int - , Type.namedWith [ "Server", "SetCookie" ] "Options" [] - ] - (Type.namedWith [ "Server", "SetCookie" ] "Options" []) - ) - } - , withPath = - Elm.value - { importFrom = [ "Server", "SetCookie" ] - , name = "withPath" - , annotation = - Just - (Type.function - [ Type.string - , Type.namedWith [ "Server", "SetCookie" ] "Options" [] - ] - (Type.namedWith [ "Server", "SetCookie" ] "Options" []) - ) - } - , withoutPath = - Elm.value - { importFrom = [ "Server", "SetCookie" ] - , name = "withoutPath" - , annotation = - Just - (Type.function - [ Type.namedWith [ "Server", "SetCookie" ] "Options" [] - ] - (Type.namedWith [ "Server", "SetCookie" ] "Options" []) - ) - } - , toString = - Elm.value - { importFrom = [ "Server", "SetCookie" ] - , name = "toString" - , annotation = - Just - (Type.function - [ Type.namedWith - [ "Server", "SetCookie" ] - "SetCookie" - [] - ] - Type.string - ) - } - } \ No newline at end of file diff --git a/elm-open-api-codegen/src/Gen/Set.elm b/elm-open-api-codegen/src/Gen/Set.elm deleted file mode 100644 index 91093a12..00000000 --- a/elm-open-api-codegen/src/Gen/Set.elm +++ /dev/null @@ -1,1250 +0,0 @@ -module Gen.Set exposing - ( moduleName_, empty, singleton, insert, remove, isEmpty - , member, size, union, intersect, diff, toList, fromList - , map, foldl, foldr, filter, partition, annotation_, call_ - , values_ - ) - -{-| -# Generated bindings for Set - -@docs moduleName_, empty, singleton, insert, remove, isEmpty -@docs member, size, union, intersect, diff, toList -@docs fromList, map, foldl, foldr, filter, partition -@docs annotation_, call_, values_ --} - - -import Elm -import Elm.Annotation as Type - - -{-| The name of this module. -} -moduleName_ : List String -moduleName_ = - [ "Set" ] - - -{-| Create an empty set. - -empty: Set.Set a --} -empty : Elm.Expression -empty = - Elm.value - { importFrom = [ "Set" ] - , name = "empty" - , annotation = Just (Type.namedWith [ "Set" ] "Set" [ Type.var "a" ]) - } - - -{-| Create a set with one value. - -singleton: comparable -> Set.Set comparable --} -singleton : Elm.Expression -> Elm.Expression -singleton singletonArg_ = - Elm.apply - (Elm.value - { importFrom = [ "Set" ] - , name = "singleton" - , annotation = - Just - (Type.function - [ Type.var "comparable" ] - (Type.namedWith - [ "Set" ] - "Set" - [ Type.var "comparable" ] - ) - ) - } - ) - [ singletonArg_ ] - - -{-| Insert a value into a set. - -insert: comparable -> Set.Set comparable -> Set.Set comparable --} -insert : Elm.Expression -> Elm.Expression -> Elm.Expression -insert insertArg_ insertArg_0 = - Elm.apply - (Elm.value - { importFrom = [ "Set" ] - , name = "insert" - , annotation = - Just - (Type.function - [ Type.var "comparable" - , Type.namedWith - [ "Set" ] - "Set" - [ Type.var "comparable" ] - ] - (Type.namedWith - [ "Set" ] - "Set" - [ Type.var "comparable" ] - ) - ) - } - ) - [ insertArg_, insertArg_0 ] - - -{-| Remove a value from a set. If the value is not found, no changes are made. - -remove: comparable -> Set.Set comparable -> Set.Set comparable --} -remove : Elm.Expression -> Elm.Expression -> Elm.Expression -remove removeArg_ removeArg_0 = - Elm.apply - (Elm.value - { importFrom = [ "Set" ] - , name = "remove" - , annotation = - Just - (Type.function - [ Type.var "comparable" - , Type.namedWith - [ "Set" ] - "Set" - [ Type.var "comparable" ] - ] - (Type.namedWith - [ "Set" ] - "Set" - [ Type.var "comparable" ] - ) - ) - } - ) - [ removeArg_, removeArg_0 ] - - -{-| Determine if a set is empty. - -isEmpty: Set.Set a -> Bool --} -isEmpty : Elm.Expression -> Elm.Expression -isEmpty isEmptyArg_ = - Elm.apply - (Elm.value - { importFrom = [ "Set" ] - , name = "isEmpty" - , annotation = - Just - (Type.function - [ Type.namedWith [ "Set" ] "Set" [ Type.var "a" ] ] - Type.bool - ) - } - ) - [ isEmptyArg_ ] - - -{-| Determine if a value is in a set. - -member: comparable -> Set.Set comparable -> Bool --} -member : Elm.Expression -> Elm.Expression -> Elm.Expression -member memberArg_ memberArg_0 = - Elm.apply - (Elm.value - { importFrom = [ "Set" ] - , name = "member" - , annotation = - Just - (Type.function - [ Type.var "comparable" - , Type.namedWith - [ "Set" ] - "Set" - [ Type.var "comparable" ] - ] - Type.bool - ) - } - ) - [ memberArg_, memberArg_0 ] - - -{-| Determine the number of elements in a set. - -size: Set.Set a -> Int --} -size : Elm.Expression -> Elm.Expression -size sizeArg_ = - Elm.apply - (Elm.value - { importFrom = [ "Set" ] - , name = "size" - , annotation = - Just - (Type.function - [ Type.namedWith [ "Set" ] "Set" [ Type.var "a" ] ] - Type.int - ) - } - ) - [ sizeArg_ ] - - -{-| Get the union of two sets. Keep all values. - -union: Set.Set comparable -> Set.Set comparable -> Set.Set comparable --} -union : Elm.Expression -> Elm.Expression -> Elm.Expression -union unionArg_ unionArg_0 = - Elm.apply - (Elm.value - { importFrom = [ "Set" ] - , name = "union" - , annotation = - Just - (Type.function - [ Type.namedWith - [ "Set" ] - "Set" - [ Type.var "comparable" ] - , Type.namedWith - [ "Set" ] - "Set" - [ Type.var "comparable" ] - ] - (Type.namedWith - [ "Set" ] - "Set" - [ Type.var "comparable" ] - ) - ) - } - ) - [ unionArg_, unionArg_0 ] - - -{-| Get the intersection of two sets. Keeps values that appear in both sets. - -intersect: Set.Set comparable -> Set.Set comparable -> Set.Set comparable --} -intersect : Elm.Expression -> Elm.Expression -> Elm.Expression -intersect intersectArg_ intersectArg_0 = - Elm.apply - (Elm.value - { importFrom = [ "Set" ] - , name = "intersect" - , annotation = - Just - (Type.function - [ Type.namedWith - [ "Set" ] - "Set" - [ Type.var "comparable" ] - , Type.namedWith - [ "Set" ] - "Set" - [ Type.var "comparable" ] - ] - (Type.namedWith - [ "Set" ] - "Set" - [ Type.var "comparable" ] - ) - ) - } - ) - [ intersectArg_, intersectArg_0 ] - - -{-| Get the difference between the first set and the second. Keeps values -that do not appear in the second set. - -diff: Set.Set comparable -> Set.Set comparable -> Set.Set comparable --} -diff : Elm.Expression -> Elm.Expression -> Elm.Expression -diff diffArg_ diffArg_0 = - Elm.apply - (Elm.value - { importFrom = [ "Set" ] - , name = "diff" - , annotation = - Just - (Type.function - [ Type.namedWith - [ "Set" ] - "Set" - [ Type.var "comparable" ] - , Type.namedWith - [ "Set" ] - "Set" - [ Type.var "comparable" ] - ] - (Type.namedWith - [ "Set" ] - "Set" - [ Type.var "comparable" ] - ) - ) - } - ) - [ diffArg_, diffArg_0 ] - - -{-| Convert a set into a list, sorted from lowest to highest. - -toList: Set.Set a -> List a --} -toList : Elm.Expression -> Elm.Expression -toList toListArg_ = - Elm.apply - (Elm.value - { importFrom = [ "Set" ] - , name = "toList" - , annotation = - Just - (Type.function - [ Type.namedWith [ "Set" ] "Set" [ Type.var "a" ] ] - (Type.list (Type.var "a")) - ) - } - ) - [ toListArg_ ] - - -{-| Convert a list into a set, removing any duplicates. - -fromList: List comparable -> Set.Set comparable --} -fromList : List Elm.Expression -> Elm.Expression -fromList fromListArg_ = - Elm.apply - (Elm.value - { importFrom = [ "Set" ] - , name = "fromList" - , annotation = - Just - (Type.function - [ Type.list (Type.var "comparable") ] - (Type.namedWith - [ "Set" ] - "Set" - [ Type.var "comparable" ] - ) - ) - } - ) - [ Elm.list fromListArg_ ] - - -{-| Map a function onto a set, creating a new set with no duplicates. - -map: (comparable -> comparable2) -> Set.Set comparable -> Set.Set comparable2 --} -map : (Elm.Expression -> Elm.Expression) -> Elm.Expression -> Elm.Expression -map mapArg_ mapArg_0 = - Elm.apply - (Elm.value - { importFrom = [ "Set" ] - , name = "map" - , annotation = - Just - (Type.function - [ Type.function - [ Type.var "comparable" ] - (Type.var "comparable2") - , Type.namedWith - [ "Set" ] - "Set" - [ Type.var "comparable" ] - ] - (Type.namedWith - [ "Set" ] - "Set" - [ Type.var "comparable2" ] - ) - ) - } - ) - [ Elm.functionReduced "mapUnpack" mapArg_, mapArg_0 ] - - -{-| Fold over the values in a set, in order from lowest to highest. - -foldl: (a -> b -> b) -> b -> Set.Set a -> b --} -foldl : - (Elm.Expression -> Elm.Expression -> Elm.Expression) - -> Elm.Expression - -> Elm.Expression - -> Elm.Expression -foldl foldlArg_ foldlArg_0 foldlArg_1 = - Elm.apply - (Elm.value - { importFrom = [ "Set" ] - , name = "foldl" - , annotation = - Just - (Type.function - [ Type.function - [ Type.var "a", Type.var "b" ] - (Type.var "b") - , Type.var "b" - , Type.namedWith [ "Set" ] "Set" [ Type.var "a" ] - ] - (Type.var "b") - ) - } - ) - [ Elm.functionReduced - "foldlUnpack" - (\functionReducedUnpack -> - Elm.functionReduced "unpack" (foldlArg_ functionReducedUnpack) - ) - , foldlArg_0 - , foldlArg_1 - ] - - -{-| Fold over the values in a set, in order from highest to lowest. - -foldr: (a -> b -> b) -> b -> Set.Set a -> b --} -foldr : - (Elm.Expression -> Elm.Expression -> Elm.Expression) - -> Elm.Expression - -> Elm.Expression - -> Elm.Expression -foldr foldrArg_ foldrArg_0 foldrArg_1 = - Elm.apply - (Elm.value - { importFrom = [ "Set" ] - , name = "foldr" - , annotation = - Just - (Type.function - [ Type.function - [ Type.var "a", Type.var "b" ] - (Type.var "b") - , Type.var "b" - , Type.namedWith [ "Set" ] "Set" [ Type.var "a" ] - ] - (Type.var "b") - ) - } - ) - [ Elm.functionReduced - "foldrUnpack" - (\functionReducedUnpack -> - Elm.functionReduced "unpack" (foldrArg_ functionReducedUnpack) - ) - , foldrArg_0 - , foldrArg_1 - ] - - -{-| Only keep elements that pass the given test. - - import Set exposing (Set) - - numbers : Set Int - numbers = - Set.fromList [-2,-1,0,1,2] - - positives : Set Int - positives = - Set.filter (\x -> x > 0) numbers - - -- positives == Set.fromList [1,2] - -filter: (comparable -> Bool) -> Set.Set comparable -> Set.Set comparable --} -filter : (Elm.Expression -> Elm.Expression) -> Elm.Expression -> Elm.Expression -filter filterArg_ filterArg_0 = - Elm.apply - (Elm.value - { importFrom = [ "Set" ] - , name = "filter" - , annotation = - Just - (Type.function - [ Type.function [ Type.var "comparable" ] Type.bool - , Type.namedWith - [ "Set" ] - "Set" - [ Type.var "comparable" ] - ] - (Type.namedWith - [ "Set" ] - "Set" - [ Type.var "comparable" ] - ) - ) - } - ) - [ Elm.functionReduced "filterUnpack" filterArg_, filterArg_0 ] - - -{-| Create two new sets. The first contains all the elements that passed the -given test, and the second contains all the elements that did not. - -partition: - (comparable -> Bool) - -> Set.Set comparable - -> ( Set.Set comparable, Set.Set comparable ) --} -partition : - (Elm.Expression -> Elm.Expression) -> Elm.Expression -> Elm.Expression -partition partitionArg_ partitionArg_0 = - Elm.apply - (Elm.value - { importFrom = [ "Set" ] - , name = "partition" - , annotation = - Just - (Type.function - [ Type.function [ Type.var "comparable" ] Type.bool - , Type.namedWith - [ "Set" ] - "Set" - [ Type.var "comparable" ] - ] - (Type.tuple - (Type.namedWith - [ "Set" ] - "Set" - [ Type.var "comparable" ] - ) - (Type.namedWith - [ "Set" ] - "Set" - [ Type.var "comparable" ] - ) - ) - ) - } - ) - [ Elm.functionReduced "partitionUnpack" partitionArg_, partitionArg_0 ] - - -annotation_ : { set : Type.Annotation -> Type.Annotation } -annotation_ = - { set = \setArg0 -> Type.namedWith [ "Set" ] "Set" [ setArg0 ] } - - -call_ : - { singleton : Elm.Expression -> Elm.Expression - , insert : Elm.Expression -> Elm.Expression -> Elm.Expression - , remove : Elm.Expression -> Elm.Expression -> Elm.Expression - , isEmpty : Elm.Expression -> Elm.Expression - , member : Elm.Expression -> Elm.Expression -> Elm.Expression - , size : Elm.Expression -> Elm.Expression - , union : Elm.Expression -> Elm.Expression -> Elm.Expression - , intersect : Elm.Expression -> Elm.Expression -> Elm.Expression - , diff : Elm.Expression -> Elm.Expression -> Elm.Expression - , toList : Elm.Expression -> Elm.Expression - , fromList : Elm.Expression -> Elm.Expression - , map : Elm.Expression -> Elm.Expression -> Elm.Expression - , foldl : - Elm.Expression -> Elm.Expression -> Elm.Expression -> Elm.Expression - , foldr : - Elm.Expression -> Elm.Expression -> Elm.Expression -> Elm.Expression - , filter : Elm.Expression -> Elm.Expression -> Elm.Expression - , partition : Elm.Expression -> Elm.Expression -> Elm.Expression - } -call_ = - { singleton = - \singletonArg_ -> - Elm.apply - (Elm.value - { importFrom = [ "Set" ] - , name = "singleton" - , annotation = - Just - (Type.function - [ Type.var "comparable" ] - (Type.namedWith - [ "Set" ] - "Set" - [ Type.var "comparable" ] - ) - ) - } - ) - [ singletonArg_ ] - , insert = - \insertArg_ insertArg_0 -> - Elm.apply - (Elm.value - { importFrom = [ "Set" ] - , name = "insert" - , annotation = - Just - (Type.function - [ Type.var "comparable" - , Type.namedWith - [ "Set" ] - "Set" - [ Type.var "comparable" ] - ] - (Type.namedWith - [ "Set" ] - "Set" - [ Type.var "comparable" ] - ) - ) - } - ) - [ insertArg_, insertArg_0 ] - , remove = - \removeArg_ removeArg_0 -> - Elm.apply - (Elm.value - { importFrom = [ "Set" ] - , name = "remove" - , annotation = - Just - (Type.function - [ Type.var "comparable" - , Type.namedWith - [ "Set" ] - "Set" - [ Type.var "comparable" ] - ] - (Type.namedWith - [ "Set" ] - "Set" - [ Type.var "comparable" ] - ) - ) - } - ) - [ removeArg_, removeArg_0 ] - , isEmpty = - \isEmptyArg_ -> - Elm.apply - (Elm.value - { importFrom = [ "Set" ] - , name = "isEmpty" - , annotation = - Just - (Type.function - [ Type.namedWith - [ "Set" ] - "Set" - [ Type.var "a" ] - ] - Type.bool - ) - } - ) - [ isEmptyArg_ ] - , member = - \memberArg_ memberArg_0 -> - Elm.apply - (Elm.value - { importFrom = [ "Set" ] - , name = "member" - , annotation = - Just - (Type.function - [ Type.var "comparable" - , Type.namedWith - [ "Set" ] - "Set" - [ Type.var "comparable" ] - ] - Type.bool - ) - } - ) - [ memberArg_, memberArg_0 ] - , size = - \sizeArg_ -> - Elm.apply - (Elm.value - { importFrom = [ "Set" ] - , name = "size" - , annotation = - Just - (Type.function - [ Type.namedWith - [ "Set" ] - "Set" - [ Type.var "a" ] - ] - Type.int - ) - } - ) - [ sizeArg_ ] - , union = - \unionArg_ unionArg_0 -> - Elm.apply - (Elm.value - { importFrom = [ "Set" ] - , name = "union" - , annotation = - Just - (Type.function - [ Type.namedWith - [ "Set" ] - "Set" - [ Type.var "comparable" ] - , Type.namedWith - [ "Set" ] - "Set" - [ Type.var "comparable" ] - ] - (Type.namedWith - [ "Set" ] - "Set" - [ Type.var "comparable" ] - ) - ) - } - ) - [ unionArg_, unionArg_0 ] - , intersect = - \intersectArg_ intersectArg_0 -> - Elm.apply - (Elm.value - { importFrom = [ "Set" ] - , name = "intersect" - , annotation = - Just - (Type.function - [ Type.namedWith - [ "Set" ] - "Set" - [ Type.var "comparable" ] - , Type.namedWith - [ "Set" ] - "Set" - [ Type.var "comparable" ] - ] - (Type.namedWith - [ "Set" ] - "Set" - [ Type.var "comparable" ] - ) - ) - } - ) - [ intersectArg_, intersectArg_0 ] - , diff = - \diffArg_ diffArg_0 -> - Elm.apply - (Elm.value - { importFrom = [ "Set" ] - , name = "diff" - , annotation = - Just - (Type.function - [ Type.namedWith - [ "Set" ] - "Set" - [ Type.var "comparable" ] - , Type.namedWith - [ "Set" ] - "Set" - [ Type.var "comparable" ] - ] - (Type.namedWith - [ "Set" ] - "Set" - [ Type.var "comparable" ] - ) - ) - } - ) - [ diffArg_, diffArg_0 ] - , toList = - \toListArg_ -> - Elm.apply - (Elm.value - { importFrom = [ "Set" ] - , name = "toList" - , annotation = - Just - (Type.function - [ Type.namedWith - [ "Set" ] - "Set" - [ Type.var "a" ] - ] - (Type.list (Type.var "a")) - ) - } - ) - [ toListArg_ ] - , fromList = - \fromListArg_ -> - Elm.apply - (Elm.value - { importFrom = [ "Set" ] - , name = "fromList" - , annotation = - Just - (Type.function - [ Type.list (Type.var "comparable") ] - (Type.namedWith - [ "Set" ] - "Set" - [ Type.var "comparable" ] - ) - ) - } - ) - [ fromListArg_ ] - , map = - \mapArg_ mapArg_0 -> - Elm.apply - (Elm.value - { importFrom = [ "Set" ] - , name = "map" - , annotation = - Just - (Type.function - [ Type.function - [ Type.var "comparable" ] - (Type.var "comparable2") - , Type.namedWith - [ "Set" ] - "Set" - [ Type.var "comparable" ] - ] - (Type.namedWith - [ "Set" ] - "Set" - [ Type.var "comparable2" ] - ) - ) - } - ) - [ mapArg_, mapArg_0 ] - , foldl = - \foldlArg_ foldlArg_0 foldlArg_1 -> - Elm.apply - (Elm.value - { importFrom = [ "Set" ] - , name = "foldl" - , annotation = - Just - (Type.function - [ Type.function - [ Type.var "a", Type.var "b" ] - (Type.var "b") - , Type.var "b" - , Type.namedWith - [ "Set" ] - "Set" - [ Type.var "a" ] - ] - (Type.var "b") - ) - } - ) - [ foldlArg_, foldlArg_0, foldlArg_1 ] - , foldr = - \foldrArg_ foldrArg_0 foldrArg_1 -> - Elm.apply - (Elm.value - { importFrom = [ "Set" ] - , name = "foldr" - , annotation = - Just - (Type.function - [ Type.function - [ Type.var "a", Type.var "b" ] - (Type.var "b") - , Type.var "b" - , Type.namedWith - [ "Set" ] - "Set" - [ Type.var "a" ] - ] - (Type.var "b") - ) - } - ) - [ foldrArg_, foldrArg_0, foldrArg_1 ] - , filter = - \filterArg_ filterArg_0 -> - Elm.apply - (Elm.value - { importFrom = [ "Set" ] - , name = "filter" - , annotation = - Just - (Type.function - [ Type.function - [ Type.var "comparable" ] - Type.bool - , Type.namedWith - [ "Set" ] - "Set" - [ Type.var "comparable" ] - ] - (Type.namedWith - [ "Set" ] - "Set" - [ Type.var "comparable" ] - ) - ) - } - ) - [ filterArg_, filterArg_0 ] - , partition = - \partitionArg_ partitionArg_0 -> - Elm.apply - (Elm.value - { importFrom = [ "Set" ] - , name = "partition" - , annotation = - Just - (Type.function - [ Type.function - [ Type.var "comparable" ] - Type.bool - , Type.namedWith - [ "Set" ] - "Set" - [ Type.var "comparable" ] - ] - (Type.tuple - (Type.namedWith - [ "Set" ] - "Set" - [ Type.var "comparable" ] - ) - (Type.namedWith - [ "Set" ] - "Set" - [ Type.var "comparable" ] - ) - ) - ) - } - ) - [ partitionArg_, partitionArg_0 ] - } - - -values_ : - { empty : Elm.Expression - , singleton : Elm.Expression - , insert : Elm.Expression - , remove : Elm.Expression - , isEmpty : Elm.Expression - , member : Elm.Expression - , size : Elm.Expression - , union : Elm.Expression - , intersect : Elm.Expression - , diff : Elm.Expression - , toList : Elm.Expression - , fromList : Elm.Expression - , map : Elm.Expression - , foldl : Elm.Expression - , foldr : Elm.Expression - , filter : Elm.Expression - , partition : Elm.Expression - } -values_ = - { empty = - Elm.value - { importFrom = [ "Set" ] - , name = "empty" - , annotation = - Just (Type.namedWith [ "Set" ] "Set" [ Type.var "a" ]) - } - , singleton = - Elm.value - { importFrom = [ "Set" ] - , name = "singleton" - , annotation = - Just - (Type.function - [ Type.var "comparable" ] - (Type.namedWith - [ "Set" ] - "Set" - [ Type.var "comparable" ] - ) - ) - } - , insert = - Elm.value - { importFrom = [ "Set" ] - , name = "insert" - , annotation = - Just - (Type.function - [ Type.var "comparable" - , Type.namedWith - [ "Set" ] - "Set" - [ Type.var "comparable" ] - ] - (Type.namedWith - [ "Set" ] - "Set" - [ Type.var "comparable" ] - ) - ) - } - , remove = - Elm.value - { importFrom = [ "Set" ] - , name = "remove" - , annotation = - Just - (Type.function - [ Type.var "comparable" - , Type.namedWith - [ "Set" ] - "Set" - [ Type.var "comparable" ] - ] - (Type.namedWith - [ "Set" ] - "Set" - [ Type.var "comparable" ] - ) - ) - } - , isEmpty = - Elm.value - { importFrom = [ "Set" ] - , name = "isEmpty" - , annotation = - Just - (Type.function - [ Type.namedWith [ "Set" ] "Set" [ Type.var "a" ] ] - Type.bool - ) - } - , member = - Elm.value - { importFrom = [ "Set" ] - , name = "member" - , annotation = - Just - (Type.function - [ Type.var "comparable" - , Type.namedWith - [ "Set" ] - "Set" - [ Type.var "comparable" ] - ] - Type.bool - ) - } - , size = - Elm.value - { importFrom = [ "Set" ] - , name = "size" - , annotation = - Just - (Type.function - [ Type.namedWith [ "Set" ] "Set" [ Type.var "a" ] ] - Type.int - ) - } - , union = - Elm.value - { importFrom = [ "Set" ] - , name = "union" - , annotation = - Just - (Type.function - [ Type.namedWith - [ "Set" ] - "Set" - [ Type.var "comparable" ] - , Type.namedWith - [ "Set" ] - "Set" - [ Type.var "comparable" ] - ] - (Type.namedWith - [ "Set" ] - "Set" - [ Type.var "comparable" ] - ) - ) - } - , intersect = - Elm.value - { importFrom = [ "Set" ] - , name = "intersect" - , annotation = - Just - (Type.function - [ Type.namedWith - [ "Set" ] - "Set" - [ Type.var "comparable" ] - , Type.namedWith - [ "Set" ] - "Set" - [ Type.var "comparable" ] - ] - (Type.namedWith - [ "Set" ] - "Set" - [ Type.var "comparable" ] - ) - ) - } - , diff = - Elm.value - { importFrom = [ "Set" ] - , name = "diff" - , annotation = - Just - (Type.function - [ Type.namedWith - [ "Set" ] - "Set" - [ Type.var "comparable" ] - , Type.namedWith - [ "Set" ] - "Set" - [ Type.var "comparable" ] - ] - (Type.namedWith - [ "Set" ] - "Set" - [ Type.var "comparable" ] - ) - ) - } - , toList = - Elm.value - { importFrom = [ "Set" ] - , name = "toList" - , annotation = - Just - (Type.function - [ Type.namedWith [ "Set" ] "Set" [ Type.var "a" ] ] - (Type.list (Type.var "a")) - ) - } - , fromList = - Elm.value - { importFrom = [ "Set" ] - , name = "fromList" - , annotation = - Just - (Type.function - [ Type.list (Type.var "comparable") ] - (Type.namedWith - [ "Set" ] - "Set" - [ Type.var "comparable" ] - ) - ) - } - , map = - Elm.value - { importFrom = [ "Set" ] - , name = "map" - , annotation = - Just - (Type.function - [ Type.function - [ Type.var "comparable" ] - (Type.var "comparable2") - , Type.namedWith - [ "Set" ] - "Set" - [ Type.var "comparable" ] - ] - (Type.namedWith - [ "Set" ] - "Set" - [ Type.var "comparable2" ] - ) - ) - } - , foldl = - Elm.value - { importFrom = [ "Set" ] - , name = "foldl" - , annotation = - Just - (Type.function - [ Type.function - [ Type.var "a", Type.var "b" ] - (Type.var "b") - , Type.var "b" - , Type.namedWith [ "Set" ] "Set" [ Type.var "a" ] - ] - (Type.var "b") - ) - } - , foldr = - Elm.value - { importFrom = [ "Set" ] - , name = "foldr" - , annotation = - Just - (Type.function - [ Type.function - [ Type.var "a", Type.var "b" ] - (Type.var "b") - , Type.var "b" - , Type.namedWith [ "Set" ] "Set" [ Type.var "a" ] - ] - (Type.var "b") - ) - } - , filter = - Elm.value - { importFrom = [ "Set" ] - , name = "filter" - , annotation = - Just - (Type.function - [ Type.function [ Type.var "comparable" ] Type.bool - , Type.namedWith - [ "Set" ] - "Set" - [ Type.var "comparable" ] - ] - (Type.namedWith - [ "Set" ] - "Set" - [ Type.var "comparable" ] - ) - ) - } - , partition = - Elm.value - { importFrom = [ "Set" ] - , name = "partition" - , annotation = - Just - (Type.function - [ Type.function [ Type.var "comparable" ] Type.bool - , Type.namedWith - [ "Set" ] - "Set" - [ Type.var "comparable" ] - ] - (Type.tuple - (Type.namedWith - [ "Set" ] - "Set" - [ Type.var "comparable" ] - ) - (Type.namedWith - [ "Set" ] - "Set" - [ Type.var "comparable" ] - ) - ) - ) - } - } \ No newline at end of file diff --git a/elm-open-api-codegen/src/Gen/Time/Extra.elm b/elm-open-api-codegen/src/Gen/Time/Extra.elm deleted file mode 100644 index a1216681..00000000 --- a/elm-open-api-codegen/src/Gen/Time/Extra.elm +++ /dev/null @@ -1,976 +0,0 @@ -module Gen.Time.Extra exposing - ( moduleName_, partsToPosix, posixToParts, compare, diff, add - , floor, ceiling, range, toOffset, annotation_, make_, caseOf_ - , call_, values_ - ) - -{-| -# Generated bindings for Time.Extra - -@docs moduleName_, partsToPosix, posixToParts, compare, diff, add -@docs floor, ceiling, range, toOffset, annotation_, make_ -@docs caseOf_, call_, values_ --} - - -import Elm -import Elm.Annotation as Type -import Elm.Arg -import Elm.Case - - -{-| The name of this module. -} -moduleName_ : List String -moduleName_ = - [ "Time", "Extra" ] - - -{-| Create a `Posix` from a description of a time and a specific time zone. - - import Time exposing (Month(..), utc) - import Time.Extra exposing (Parts, partsToPosix) - - partsToPosix utc (Parts 2018 Sep 26 14 30 0 0) - -Any out-of-range day or time values will be clamped within range. - - partsToPosix utc (Parts 2018 Sep 31 24 60 -60 -500) - == partsToPosix utc (Parts 2018 Sep 30 23 59 0 0) - -partsToPosix: Time.Zone -> Time.Extra.Parts -> Time.Posix --} -partsToPosix : Elm.Expression -> Elm.Expression -> Elm.Expression -partsToPosix partsToPosixArg_ partsToPosixArg_0 = - Elm.apply - (Elm.value - { importFrom = [ "Time", "Extra" ] - , name = "partsToPosix" - , annotation = - Just - (Type.function - [ Type.namedWith [ "Time" ] "Zone" [] - , Type.namedWith [ "Time", "Extra" ] "Parts" [] - ] - (Type.namedWith [ "Time" ] "Posix" []) - ) - } - ) - [ partsToPosixArg_, partsToPosixArg_0 ] - - -{-| Convert a `Posix` to a description of a time in a specific time zone. This -is a convenience function for extracting parts of a time into a single record. - - import Time exposing (Month(..), utc) - import Time.Extra exposing (Parts, partsToPosix, posixToParts) - - posixToParts - utc - (partsToPosix utc (Parts 2018 Sep 26 14 30 0 0)) - == { year = 2018 - , month = Sep - , day = 26 - , hour = 14 - , minute = 30 - , second = 0 - , millisecond = 0 - } - -posixToParts: Time.Zone -> Time.Posix -> Time.Extra.Parts --} -posixToParts : Elm.Expression -> Elm.Expression -> Elm.Expression -posixToParts posixToPartsArg_ posixToPartsArg_0 = - Elm.apply - (Elm.value - { importFrom = [ "Time", "Extra" ] - , name = "posixToParts" - , annotation = - Just - (Type.function - [ Type.namedWith [ "Time" ] "Zone" [] - , Type.namedWith [ "Time" ] "Posix" [] - ] - (Type.namedWith [ "Time", "Extra" ] "Parts" []) - ) - } - ) - [ posixToPartsArg_, posixToPartsArg_0 ] - - -{-| Compare the first time to the second time. - - import Time - import Time.Extra as Time - - Time.compare (Time.millisToPosix 0) (Time.millisToPosix 1000) - == LT - -compare: Time.Posix -> Time.Posix -> Basics.Order --} -compare : Elm.Expression -> Elm.Expression -> Elm.Expression -compare compareArg_ compareArg_0 = - Elm.apply - (Elm.value - { importFrom = [ "Time", "Extra" ] - , name = "compare" - , annotation = - Just - (Type.function - [ Type.namedWith [ "Time" ] "Posix" [] - , Type.namedWith [ "Time" ] "Posix" [] - ] - (Type.namedWith [ "Basics" ] "Order" []) - ) - } - ) - [ compareArg_, compareArg_0 ] - - -{-| Get the difference, as a number of whole intervals, between two times. - - import Time exposing (Month(..), utc) - import Time.Extra exposing (Interval(..), Parts, partsToPosix, diff) - - diff Month utc - (partsToPosix utc (Parts 2020 Jan 2 0 0 0 0)) - (partsToPosix utc (Parts 2020 Apr 1 0 0 0 0)) - == 2 - -diff: Time.Extra.Interval -> Time.Zone -> Time.Posix -> Time.Posix -> Int --} -diff : - Elm.Expression - -> Elm.Expression - -> Elm.Expression - -> Elm.Expression - -> Elm.Expression -diff diffArg_ diffArg_0 diffArg_1 diffArg_2 = - Elm.apply - (Elm.value - { importFrom = [ "Time", "Extra" ] - , name = "diff" - , annotation = - Just - (Type.function - [ Type.namedWith [ "Time", "Extra" ] "Interval" [] - , Type.namedWith [ "Time" ] "Zone" [] - , Type.namedWith [ "Time" ] "Posix" [] - , Type.namedWith [ "Time" ] "Posix" [] - ] - Type.int - ) - } - ) - [ diffArg_, diffArg_0, diffArg_1, diffArg_2 ] - - -{-| Shift a time into the past or future by adding a number of whole intervals. - - import Time exposing (Month(..), utc) - import Time.Extra exposing (Interval(..), Parts, partsToPosix, add) - - add Week 2 utc (partsToPosix utc (Parts 2018 Sep 1 11 55 0 0)) - == partsToPosix utc (Parts 2018 Sep 15 11 55 0 0) - -When adding `Month`, `Quarter`, or `Year` intervals, day values are clamped to -the end of the month if necessary. - - add Month 1 utc (partsToPosix utc (Parts 2020 Jan 31 0 0 0 0)) - == partsToPosix utc (Parts 2020 Feb 29 0 0 0 0) - -add: Time.Extra.Interval -> Int -> Time.Zone -> Time.Posix -> Time.Posix --} -add : - Elm.Expression -> Int -> Elm.Expression -> Elm.Expression -> Elm.Expression -add addArg_ addArg_0 addArg_1 addArg_2 = - Elm.apply - (Elm.value - { importFrom = [ "Time", "Extra" ] - , name = "add" - , annotation = - Just - (Type.function - [ Type.namedWith [ "Time", "Extra" ] "Interval" [] - , Type.int - , Type.namedWith [ "Time" ] "Zone" [] - , Type.namedWith [ "Time" ] "Posix" [] - ] - (Type.namedWith [ "Time" ] "Posix" []) - ) - } - ) - [ addArg_, Elm.int addArg_0, addArg_1, addArg_2 ] - - -{-| Round down a time to the beginning of the closest interval. The resulting -time will be less than or equal to the one provided. - - import Time exposing (Month(..), utc) - import Time.Extra exposing (Interval(..), Parts, partsToPosix, floor) - - floor Hour utc - (partsToPosix utc (Parts 1999 Dec 31 23 59 59 999)) - == (partsToPosix utc (Parts 1999 Dec 31 23 0 0 0)) - -floor: Time.Extra.Interval -> Time.Zone -> Time.Posix -> Time.Posix --} -floor : Elm.Expression -> Elm.Expression -> Elm.Expression -> Elm.Expression -floor floorArg_ floorArg_0 floorArg_1 = - Elm.apply - (Elm.value - { importFrom = [ "Time", "Extra" ] - , name = "floor" - , annotation = - Just - (Type.function - [ Type.namedWith [ "Time", "Extra" ] "Interval" [] - , Type.namedWith [ "Time" ] "Zone" [] - , Type.namedWith [ "Time" ] "Posix" [] - ] - (Type.namedWith [ "Time" ] "Posix" []) - ) - } - ) - [ floorArg_, floorArg_0, floorArg_1 ] - - -{-| Round up a time to the beginning of the closest interval. The resulting -time will be greater than or equal to the one provided. - - import Time exposing (Month(..), utc) - import Time.Extra exposing (Interval(..), Parts, partsToPosix, ceiling) - - ceiling Hour utc - (partsToPosix utc (Parts 1999 Dec 31 23 59 59 999)) - == (partsToPosix utc (Parts 2000 Jan 1 0 0 0 0)) - -ceiling: Time.Extra.Interval -> Time.Zone -> Time.Posix -> Time.Posix --} -ceiling : Elm.Expression -> Elm.Expression -> Elm.Expression -> Elm.Expression -ceiling ceilingArg_ ceilingArg_0 ceilingArg_1 = - Elm.apply - (Elm.value - { importFrom = [ "Time", "Extra" ] - , name = "ceiling" - , annotation = - Just - (Type.function - [ Type.namedWith [ "Time", "Extra" ] "Interval" [] - , Type.namedWith [ "Time" ] "Zone" [] - , Type.namedWith [ "Time" ] "Posix" [] - ] - (Type.namedWith [ "Time" ] "Posix" []) - ) - } - ) - [ ceilingArg_, ceilingArg_0, ceilingArg_1 ] - - -{-| Create a list of times, at rounded intervals, increasing by a step value, -between two times. The list will start on or after the first time, and end -before the second time. - - import Time exposing (Month(..), utc) - import Time.Extra exposing (Interval(..), Parts, partsToPosix, range) - - start = Parts 2020 Jan 1 12 0 0 0 - until = Parts 2020 Jan 8 0 0 0 0 - - range Day 2 utc (partsToPosix utc start) (partsToPosix utc until) - == List.map (partsToPosix utc) - [ Parts 2020 Jan 2 0 0 0 0 - , Parts 2020 Jan 4 0 0 0 0 - , Parts 2020 Jan 6 0 0 0 0 - ] - -range: - Time.Extra.Interval - -> Int - -> Time.Zone - -> Time.Posix - -> Time.Posix - -> List Time.Posix --} -range : - Elm.Expression - -> Int - -> Elm.Expression - -> Elm.Expression - -> Elm.Expression - -> Elm.Expression -range rangeArg_ rangeArg_0 rangeArg_1 rangeArg_2 rangeArg_3 = - Elm.apply - (Elm.value - { importFrom = [ "Time", "Extra" ] - , name = "range" - , annotation = - Just - (Type.function - [ Type.namedWith [ "Time", "Extra" ] "Interval" [] - , Type.int - , Type.namedWith [ "Time" ] "Zone" [] - , Type.namedWith [ "Time" ] "Posix" [] - , Type.namedWith [ "Time" ] "Posix" [] - ] - (Type.list (Type.namedWith [ "Time" ] "Posix" [])) - ) - } - ) - [ rangeArg_, Elm.int rangeArg_0, rangeArg_1, rangeArg_2, rangeArg_3 ] - - -{-| What is the offset from UTC, in minutes, for this `Zone` at this -`Posix` time? - - import Time exposing (Month(..)) - import Time.Extra exposing (Parts, partsToPosix, toOffset) - - toOffset nyc - (partsToPosix nyc (Parts 2018 Sep 26 10 30 0 0)) - == -240 - - -- assuming `nyc` is a `Zone` for America/New_York - -**Note:** It's possible to verify the example above by using time zone data -from the package [justinmimbs/timezone-data][tzdata] to define `nyc`: - - import TimeZone - - nyc = - TimeZone.america__new_york () - -[tzdata]: https://package.elm-lang.org/packages/justinmimbs/timezone-data/latest/ - -toOffset: Time.Zone -> Time.Posix -> Int --} -toOffset : Elm.Expression -> Elm.Expression -> Elm.Expression -toOffset toOffsetArg_ toOffsetArg_0 = - Elm.apply - (Elm.value - { importFrom = [ "Time", "Extra" ] - , name = "toOffset" - , annotation = - Just - (Type.function - [ Type.namedWith [ "Time" ] "Zone" [] - , Type.namedWith [ "Time" ] "Posix" [] - ] - Type.int - ) - } - ) - [ toOffsetArg_, toOffsetArg_0 ] - - -annotation_ : { parts : Type.Annotation, interval : Type.Annotation } -annotation_ = - { parts = - Type.alias - moduleName_ - "Parts" - [] - (Type.record - [ ( "year", Type.int ) - , ( "month", Type.namedWith [ "Time" ] "Month" [] ) - , ( "day", Type.int ) - , ( "hour", Type.int ) - , ( "minute", Type.int ) - , ( "second", Type.int ) - , ( "millisecond", Type.int ) - ] - ) - , interval = Type.namedWith [ "Time", "Extra" ] "Interval" [] - } - - -make_ : - { parts : - { year : Elm.Expression - , month : Elm.Expression - , day : Elm.Expression - , hour : Elm.Expression - , minute : Elm.Expression - , second : Elm.Expression - , millisecond : Elm.Expression - } - -> Elm.Expression - , year : Elm.Expression - , quarter : Elm.Expression - , month : Elm.Expression - , week : Elm.Expression - , monday : Elm.Expression - , tuesday : Elm.Expression - , wednesday : Elm.Expression - , thursday : Elm.Expression - , friday : Elm.Expression - , saturday : Elm.Expression - , sunday : Elm.Expression - , day : Elm.Expression - , hour : Elm.Expression - , minute : Elm.Expression - , second : Elm.Expression - , millisecond : Elm.Expression - } -make_ = - { parts = - \parts_args -> - Elm.withType - (Type.alias - [ "Time", "Extra" ] - "Parts" - [] - (Type.record - [ ( "year", Type.int ) - , ( "month", Type.namedWith [ "Time" ] "Month" [] ) - , ( "day", Type.int ) - , ( "hour", Type.int ) - , ( "minute", Type.int ) - , ( "second", Type.int ) - , ( "millisecond", Type.int ) - ] - ) - ) - (Elm.record - [ Tuple.pair "year" parts_args.year - , Tuple.pair "month" parts_args.month - , Tuple.pair "day" parts_args.day - , Tuple.pair "hour" parts_args.hour - , Tuple.pair "minute" parts_args.minute - , Tuple.pair "second" parts_args.second - , Tuple.pair "millisecond" parts_args.millisecond - ] - ) - , year = - Elm.value - { importFrom = [ "Time", "Extra" ] - , name = "Year" - , annotation = Just (Type.namedWith [] "Interval" []) - } - , quarter = - Elm.value - { importFrom = [ "Time", "Extra" ] - , name = "Quarter" - , annotation = Just (Type.namedWith [] "Interval" []) - } - , month = - Elm.value - { importFrom = [ "Time", "Extra" ] - , name = "Month" - , annotation = Just (Type.namedWith [] "Interval" []) - } - , week = - Elm.value - { importFrom = [ "Time", "Extra" ] - , name = "Week" - , annotation = Just (Type.namedWith [] "Interval" []) - } - , monday = - Elm.value - { importFrom = [ "Time", "Extra" ] - , name = "Monday" - , annotation = Just (Type.namedWith [] "Interval" []) - } - , tuesday = - Elm.value - { importFrom = [ "Time", "Extra" ] - , name = "Tuesday" - , annotation = Just (Type.namedWith [] "Interval" []) - } - , wednesday = - Elm.value - { importFrom = [ "Time", "Extra" ] - , name = "Wednesday" - , annotation = Just (Type.namedWith [] "Interval" []) - } - , thursday = - Elm.value - { importFrom = [ "Time", "Extra" ] - , name = "Thursday" - , annotation = Just (Type.namedWith [] "Interval" []) - } - , friday = - Elm.value - { importFrom = [ "Time", "Extra" ] - , name = "Friday" - , annotation = Just (Type.namedWith [] "Interval" []) - } - , saturday = - Elm.value - { importFrom = [ "Time", "Extra" ] - , name = "Saturday" - , annotation = Just (Type.namedWith [] "Interval" []) - } - , sunday = - Elm.value - { importFrom = [ "Time", "Extra" ] - , name = "Sunday" - , annotation = Just (Type.namedWith [] "Interval" []) - } - , day = - Elm.value - { importFrom = [ "Time", "Extra" ] - , name = "Day" - , annotation = Just (Type.namedWith [] "Interval" []) - } - , hour = - Elm.value - { importFrom = [ "Time", "Extra" ] - , name = "Hour" - , annotation = Just (Type.namedWith [] "Interval" []) - } - , minute = - Elm.value - { importFrom = [ "Time", "Extra" ] - , name = "Minute" - , annotation = Just (Type.namedWith [] "Interval" []) - } - , second = - Elm.value - { importFrom = [ "Time", "Extra" ] - , name = "Second" - , annotation = Just (Type.namedWith [] "Interval" []) - } - , millisecond = - Elm.value - { importFrom = [ "Time", "Extra" ] - , name = "Millisecond" - , annotation = Just (Type.namedWith [] "Interval" []) - } - } - - -caseOf_ : - { interval : - Elm.Expression - -> { year : Elm.Expression - , quarter : Elm.Expression - , month : Elm.Expression - , week : Elm.Expression - , monday : Elm.Expression - , tuesday : Elm.Expression - , wednesday : Elm.Expression - , thursday : Elm.Expression - , friday : Elm.Expression - , saturday : Elm.Expression - , sunday : Elm.Expression - , day : Elm.Expression - , hour : Elm.Expression - , minute : Elm.Expression - , second : Elm.Expression - , millisecond : Elm.Expression - } - -> Elm.Expression - } -caseOf_ = - { interval = - \intervalExpression intervalTags -> - Elm.Case.custom - intervalExpression - (Type.namedWith [ "Time", "Extra" ] "Interval" []) - [ Elm.Case.branch - (Elm.Arg.customType "Year" intervalTags.year) - Basics.identity - , Elm.Case.branch - (Elm.Arg.customType "Quarter" intervalTags.quarter) - Basics.identity - , Elm.Case.branch - (Elm.Arg.customType "Month" intervalTags.month) - Basics.identity - , Elm.Case.branch - (Elm.Arg.customType "Week" intervalTags.week) - Basics.identity - , Elm.Case.branch - (Elm.Arg.customType "Monday" intervalTags.monday) - Basics.identity - , Elm.Case.branch - (Elm.Arg.customType "Tuesday" intervalTags.tuesday) - Basics.identity - , Elm.Case.branch - (Elm.Arg.customType "Wednesday" intervalTags.wednesday) - Basics.identity - , Elm.Case.branch - (Elm.Arg.customType "Thursday" intervalTags.thursday) - Basics.identity - , Elm.Case.branch - (Elm.Arg.customType "Friday" intervalTags.friday) - Basics.identity - , Elm.Case.branch - (Elm.Arg.customType "Saturday" intervalTags.saturday) - Basics.identity - , Elm.Case.branch - (Elm.Arg.customType "Sunday" intervalTags.sunday) - Basics.identity - , Elm.Case.branch - (Elm.Arg.customType "Day" intervalTags.day) - Basics.identity - , Elm.Case.branch - (Elm.Arg.customType "Hour" intervalTags.hour) - Basics.identity - , Elm.Case.branch - (Elm.Arg.customType "Minute" intervalTags.minute) - Basics.identity - , Elm.Case.branch - (Elm.Arg.customType "Second" intervalTags.second) - Basics.identity - , Elm.Case.branch - (Elm.Arg.customType "Millisecond" intervalTags.millisecond) - Basics.identity - ] - } - - -call_ : - { partsToPosix : Elm.Expression -> Elm.Expression -> Elm.Expression - , posixToParts : Elm.Expression -> Elm.Expression -> Elm.Expression - , compare : Elm.Expression -> Elm.Expression -> Elm.Expression - , diff : - Elm.Expression - -> Elm.Expression - -> Elm.Expression - -> Elm.Expression - -> Elm.Expression - , add : - Elm.Expression - -> Elm.Expression - -> Elm.Expression - -> Elm.Expression - -> Elm.Expression - , floor : - Elm.Expression -> Elm.Expression -> Elm.Expression -> Elm.Expression - , ceiling : - Elm.Expression -> Elm.Expression -> Elm.Expression -> Elm.Expression - , range : - Elm.Expression - -> Elm.Expression - -> Elm.Expression - -> Elm.Expression - -> Elm.Expression - -> Elm.Expression - , toOffset : Elm.Expression -> Elm.Expression -> Elm.Expression - } -call_ = - { partsToPosix = - \partsToPosixArg_ partsToPosixArg_0 -> - Elm.apply - (Elm.value - { importFrom = [ "Time", "Extra" ] - , name = "partsToPosix" - , annotation = - Just - (Type.function - [ Type.namedWith [ "Time" ] "Zone" [] - , Type.namedWith - [ "Time", "Extra" ] - "Parts" - [] - ] - (Type.namedWith [ "Time" ] "Posix" []) - ) - } - ) - [ partsToPosixArg_, partsToPosixArg_0 ] - , posixToParts = - \posixToPartsArg_ posixToPartsArg_0 -> - Elm.apply - (Elm.value - { importFrom = [ "Time", "Extra" ] - , name = "posixToParts" - , annotation = - Just - (Type.function - [ Type.namedWith [ "Time" ] "Zone" [] - , Type.namedWith [ "Time" ] "Posix" [] - ] - (Type.namedWith [ "Time", "Extra" ] "Parts" [] - ) - ) - } - ) - [ posixToPartsArg_, posixToPartsArg_0 ] - , compare = - \compareArg_ compareArg_0 -> - Elm.apply - (Elm.value - { importFrom = [ "Time", "Extra" ] - , name = "compare" - , annotation = - Just - (Type.function - [ Type.namedWith [ "Time" ] "Posix" [] - , Type.namedWith [ "Time" ] "Posix" [] - ] - (Type.namedWith [ "Basics" ] "Order" []) - ) - } - ) - [ compareArg_, compareArg_0 ] - , diff = - \diffArg_ diffArg_0 diffArg_1 diffArg_2 -> - Elm.apply - (Elm.value - { importFrom = [ "Time", "Extra" ] - , name = "diff" - , annotation = - Just - (Type.function - [ Type.namedWith - [ "Time", "Extra" ] - "Interval" - [] - , Type.namedWith [ "Time" ] "Zone" [] - , Type.namedWith [ "Time" ] "Posix" [] - , Type.namedWith [ "Time" ] "Posix" [] - ] - Type.int - ) - } - ) - [ diffArg_, diffArg_0, diffArg_1, diffArg_2 ] - , add = - \addArg_ addArg_0 addArg_1 addArg_2 -> - Elm.apply - (Elm.value - { importFrom = [ "Time", "Extra" ] - , name = "add" - , annotation = - Just - (Type.function - [ Type.namedWith - [ "Time", "Extra" ] - "Interval" - [] - , Type.int - , Type.namedWith [ "Time" ] "Zone" [] - , Type.namedWith [ "Time" ] "Posix" [] - ] - (Type.namedWith [ "Time" ] "Posix" []) - ) - } - ) - [ addArg_, addArg_0, addArg_1, addArg_2 ] - , floor = - \floorArg_ floorArg_0 floorArg_1 -> - Elm.apply - (Elm.value - { importFrom = [ "Time", "Extra" ] - , name = "floor" - , annotation = - Just - (Type.function - [ Type.namedWith - [ "Time", "Extra" ] - "Interval" - [] - , Type.namedWith [ "Time" ] "Zone" [] - , Type.namedWith [ "Time" ] "Posix" [] - ] - (Type.namedWith [ "Time" ] "Posix" []) - ) - } - ) - [ floorArg_, floorArg_0, floorArg_1 ] - , ceiling = - \ceilingArg_ ceilingArg_0 ceilingArg_1 -> - Elm.apply - (Elm.value - { importFrom = [ "Time", "Extra" ] - , name = "ceiling" - , annotation = - Just - (Type.function - [ Type.namedWith - [ "Time", "Extra" ] - "Interval" - [] - , Type.namedWith [ "Time" ] "Zone" [] - , Type.namedWith [ "Time" ] "Posix" [] - ] - (Type.namedWith [ "Time" ] "Posix" []) - ) - } - ) - [ ceilingArg_, ceilingArg_0, ceilingArg_1 ] - , range = - \rangeArg_ rangeArg_0 rangeArg_1 rangeArg_2 rangeArg_3 -> - Elm.apply - (Elm.value - { importFrom = [ "Time", "Extra" ] - , name = "range" - , annotation = - Just - (Type.function - [ Type.namedWith - [ "Time", "Extra" ] - "Interval" - [] - , Type.int - , Type.namedWith [ "Time" ] "Zone" [] - , Type.namedWith [ "Time" ] "Posix" [] - , Type.namedWith [ "Time" ] "Posix" [] - ] - (Type.list - (Type.namedWith [ "Time" ] "Posix" []) - ) - ) - } - ) - [ rangeArg_, rangeArg_0, rangeArg_1, rangeArg_2, rangeArg_3 ] - , toOffset = - \toOffsetArg_ toOffsetArg_0 -> - Elm.apply - (Elm.value - { importFrom = [ "Time", "Extra" ] - , name = "toOffset" - , annotation = - Just - (Type.function - [ Type.namedWith [ "Time" ] "Zone" [] - , Type.namedWith [ "Time" ] "Posix" [] - ] - Type.int - ) - } - ) - [ toOffsetArg_, toOffsetArg_0 ] - } - - -values_ : - { partsToPosix : Elm.Expression - , posixToParts : Elm.Expression - , compare : Elm.Expression - , diff : Elm.Expression - , add : Elm.Expression - , floor : Elm.Expression - , ceiling : Elm.Expression - , range : Elm.Expression - , toOffset : Elm.Expression - } -values_ = - { partsToPosix = - Elm.value - { importFrom = [ "Time", "Extra" ] - , name = "partsToPosix" - , annotation = - Just - (Type.function - [ Type.namedWith [ "Time" ] "Zone" [] - , Type.namedWith [ "Time", "Extra" ] "Parts" [] - ] - (Type.namedWith [ "Time" ] "Posix" []) - ) - } - , posixToParts = - Elm.value - { importFrom = [ "Time", "Extra" ] - , name = "posixToParts" - , annotation = - Just - (Type.function - [ Type.namedWith [ "Time" ] "Zone" [] - , Type.namedWith [ "Time" ] "Posix" [] - ] - (Type.namedWith [ "Time", "Extra" ] "Parts" []) - ) - } - , compare = - Elm.value - { importFrom = [ "Time", "Extra" ] - , name = "compare" - , annotation = - Just - (Type.function - [ Type.namedWith [ "Time" ] "Posix" [] - , Type.namedWith [ "Time" ] "Posix" [] - ] - (Type.namedWith [ "Basics" ] "Order" []) - ) - } - , diff = - Elm.value - { importFrom = [ "Time", "Extra" ] - , name = "diff" - , annotation = - Just - (Type.function - [ Type.namedWith [ "Time", "Extra" ] "Interval" [] - , Type.namedWith [ "Time" ] "Zone" [] - , Type.namedWith [ "Time" ] "Posix" [] - , Type.namedWith [ "Time" ] "Posix" [] - ] - Type.int - ) - } - , add = - Elm.value - { importFrom = [ "Time", "Extra" ] - , name = "add" - , annotation = - Just - (Type.function - [ Type.namedWith [ "Time", "Extra" ] "Interval" [] - , Type.int - , Type.namedWith [ "Time" ] "Zone" [] - , Type.namedWith [ "Time" ] "Posix" [] - ] - (Type.namedWith [ "Time" ] "Posix" []) - ) - } - , floor = - Elm.value - { importFrom = [ "Time", "Extra" ] - , name = "floor" - , annotation = - Just - (Type.function - [ Type.namedWith [ "Time", "Extra" ] "Interval" [] - , Type.namedWith [ "Time" ] "Zone" [] - , Type.namedWith [ "Time" ] "Posix" [] - ] - (Type.namedWith [ "Time" ] "Posix" []) - ) - } - , ceiling = - Elm.value - { importFrom = [ "Time", "Extra" ] - , name = "ceiling" - , annotation = - Just - (Type.function - [ Type.namedWith [ "Time", "Extra" ] "Interval" [] - , Type.namedWith [ "Time" ] "Zone" [] - , Type.namedWith [ "Time" ] "Posix" [] - ] - (Type.namedWith [ "Time" ] "Posix" []) - ) - } - , range = - Elm.value - { importFrom = [ "Time", "Extra" ] - , name = "range" - , annotation = - Just - (Type.function - [ Type.namedWith [ "Time", "Extra" ] "Interval" [] - , Type.int - , Type.namedWith [ "Time" ] "Zone" [] - , Type.namedWith [ "Time" ] "Posix" [] - , Type.namedWith [ "Time" ] "Posix" [] - ] - (Type.list (Type.namedWith [ "Time" ] "Posix" [])) - ) - } - , toOffset = - Elm.value - { importFrom = [ "Time", "Extra" ] - , name = "toOffset" - , annotation = - Just - (Type.function - [ Type.namedWith [ "Time" ] "Zone" [] - , Type.namedWith [ "Time" ] "Posix" [] - ] - Type.int - ) - } - } \ No newline at end of file diff --git a/elm-open-api-codegen/src/Gen/Tuple.elm b/elm-open-api-codegen/src/Gen/Tuple.elm deleted file mode 100644 index 3676e6a3..00000000 --- a/elm-open-api-codegen/src/Gen/Tuple.elm +++ /dev/null @@ -1,391 +0,0 @@ -module Gen.Tuple exposing - ( moduleName_, pair, first, second, mapFirst, mapSecond - , mapBoth, call_, values_ - ) - -{-| -# Generated bindings for Tuple - -@docs moduleName_, pair, first, second, mapFirst, mapSecond -@docs mapBoth, call_, values_ --} - - -import Elm -import Elm.Annotation as Type - - -{-| The name of this module. -} -moduleName_ : List String -moduleName_ = - [ "Tuple" ] - - -{-| Create a 2-tuple. - - -- pair 3 4 == (3, 4) - - zip : List a -> List b -> List (a, b) - zip xs ys = - List.map2 Tuple.pair xs ys - -pair: a -> b -> ( a, b ) --} -pair : Elm.Expression -> Elm.Expression -> Elm.Expression -pair pairArg_ pairArg_0 = - Elm.apply - (Elm.value - { importFrom = [ "Tuple" ] - , name = "pair" - , annotation = - Just - (Type.function - [ Type.var "a", Type.var "b" ] - (Type.tuple (Type.var "a") (Type.var "b")) - ) - } - ) - [ pairArg_, pairArg_0 ] - - -{-| Extract the first value from a tuple. - - first (3, 4) == 3 - first ("john", "doe") == "john" - -first: ( a, b ) -> a --} -first : Elm.Expression -> Elm.Expression -first firstArg_ = - Elm.apply - (Elm.value - { importFrom = [ "Tuple" ] - , name = "first" - , annotation = - Just - (Type.function - [ Type.tuple (Type.var "a") (Type.var "b") ] - (Type.var "a") - ) - } - ) - [ firstArg_ ] - - -{-| Extract the second value from a tuple. - - second (3, 4) == 4 - second ("john", "doe") == "doe" - -second: ( a, b ) -> b --} -second : Elm.Expression -> Elm.Expression -second secondArg_ = - Elm.apply - (Elm.value - { importFrom = [ "Tuple" ] - , name = "second" - , annotation = - Just - (Type.function - [ Type.tuple (Type.var "a") (Type.var "b") ] - (Type.var "b") - ) - } - ) - [ secondArg_ ] - - -{-| Transform the first value in a tuple. - - import String - - mapFirst String.reverse ("stressed", 16) == ("desserts", 16) - mapFirst String.length ("stressed", 16) == (8, 16) - -mapFirst: (a -> x) -> ( a, b ) -> ( x, b ) --} -mapFirst : - (Elm.Expression -> Elm.Expression) -> Elm.Expression -> Elm.Expression -mapFirst mapFirstArg_ mapFirstArg_0 = - Elm.apply - (Elm.value - { importFrom = [ "Tuple" ] - , name = "mapFirst" - , annotation = - Just - (Type.function - [ Type.function [ Type.var "a" ] (Type.var "x") - , Type.tuple (Type.var "a") (Type.var "b") - ] - (Type.tuple (Type.var "x") (Type.var "b")) - ) - } - ) - [ Elm.functionReduced "mapFirstUnpack" mapFirstArg_, mapFirstArg_0 ] - - -{-| Transform the second value in a tuple. - - mapSecond sqrt ("stressed", 16) == ("stressed", 4) - mapSecond negate ("stressed", 16) == ("stressed", -16) - -mapSecond: (b -> y) -> ( a, b ) -> ( a, y ) --} -mapSecond : - (Elm.Expression -> Elm.Expression) -> Elm.Expression -> Elm.Expression -mapSecond mapSecondArg_ mapSecondArg_0 = - Elm.apply - (Elm.value - { importFrom = [ "Tuple" ] - , name = "mapSecond" - , annotation = - Just - (Type.function - [ Type.function [ Type.var "b" ] (Type.var "y") - , Type.tuple (Type.var "a") (Type.var "b") - ] - (Type.tuple (Type.var "a") (Type.var "y")) - ) - } - ) - [ Elm.functionReduced "mapSecondUnpack" mapSecondArg_, mapSecondArg_0 ] - - -{-| Transform both parts of a tuple. - - import String - - mapBoth String.reverse sqrt ("stressed", 16) == ("desserts", 4) - mapBoth String.length negate ("stressed", 16) == (8, -16) - -mapBoth: (a -> x) -> (b -> y) -> ( a, b ) -> ( x, y ) --} -mapBoth : - (Elm.Expression -> Elm.Expression) - -> (Elm.Expression -> Elm.Expression) - -> Elm.Expression - -> Elm.Expression -mapBoth mapBothArg_ mapBothArg_0 mapBothArg_1 = - Elm.apply - (Elm.value - { importFrom = [ "Tuple" ] - , name = "mapBoth" - , annotation = - Just - (Type.function - [ Type.function [ Type.var "a" ] (Type.var "x") - , Type.function [ Type.var "b" ] (Type.var "y") - , Type.tuple (Type.var "a") (Type.var "b") - ] - (Type.tuple (Type.var "x") (Type.var "y")) - ) - } - ) - [ Elm.functionReduced "mapBothUnpack" mapBothArg_ - , Elm.functionReduced "mapBothUnpack" mapBothArg_0 - , mapBothArg_1 - ] - - -call_ : - { pair : Elm.Expression -> Elm.Expression -> Elm.Expression - , first : Elm.Expression -> Elm.Expression - , second : Elm.Expression -> Elm.Expression - , mapFirst : Elm.Expression -> Elm.Expression -> Elm.Expression - , mapSecond : Elm.Expression -> Elm.Expression -> Elm.Expression - , mapBoth : - Elm.Expression -> Elm.Expression -> Elm.Expression -> Elm.Expression - } -call_ = - { pair = - \pairArg_ pairArg_0 -> - Elm.apply - (Elm.value - { importFrom = [ "Tuple" ] - , name = "pair" - , annotation = - Just - (Type.function - [ Type.var "a", Type.var "b" ] - (Type.tuple (Type.var "a") (Type.var "b")) - ) - } - ) - [ pairArg_, pairArg_0 ] - , first = - \firstArg_ -> - Elm.apply - (Elm.value - { importFrom = [ "Tuple" ] - , name = "first" - , annotation = - Just - (Type.function - [ Type.tuple (Type.var "a") (Type.var "b") ] - (Type.var "a") - ) - } - ) - [ firstArg_ ] - , second = - \secondArg_ -> - Elm.apply - (Elm.value - { importFrom = [ "Tuple" ] - , name = "second" - , annotation = - Just - (Type.function - [ Type.tuple (Type.var "a") (Type.var "b") ] - (Type.var "b") - ) - } - ) - [ secondArg_ ] - , mapFirst = - \mapFirstArg_ mapFirstArg_0 -> - Elm.apply - (Elm.value - { importFrom = [ "Tuple" ] - , name = "mapFirst" - , annotation = - Just - (Type.function - [ Type.function - [ Type.var "a" ] - (Type.var "x") - , Type.tuple (Type.var "a") (Type.var "b") - ] - (Type.tuple (Type.var "x") (Type.var "b")) - ) - } - ) - [ mapFirstArg_, mapFirstArg_0 ] - , mapSecond = - \mapSecondArg_ mapSecondArg_0 -> - Elm.apply - (Elm.value - { importFrom = [ "Tuple" ] - , name = "mapSecond" - , annotation = - Just - (Type.function - [ Type.function - [ Type.var "b" ] - (Type.var "y") - , Type.tuple (Type.var "a") (Type.var "b") - ] - (Type.tuple (Type.var "a") (Type.var "y")) - ) - } - ) - [ mapSecondArg_, mapSecondArg_0 ] - , mapBoth = - \mapBothArg_ mapBothArg_0 mapBothArg_1 -> - Elm.apply - (Elm.value - { importFrom = [ "Tuple" ] - , name = "mapBoth" - , annotation = - Just - (Type.function - [ Type.function - [ Type.var "a" ] - (Type.var "x") - , Type.function - [ Type.var "b" ] - (Type.var "y") - , Type.tuple (Type.var "a") (Type.var "b") - ] - (Type.tuple (Type.var "x") (Type.var "y")) - ) - } - ) - [ mapBothArg_, mapBothArg_0, mapBothArg_1 ] - } - - -values_ : - { pair : Elm.Expression - , first : Elm.Expression - , second : Elm.Expression - , mapFirst : Elm.Expression - , mapSecond : Elm.Expression - , mapBoth : Elm.Expression - } -values_ = - { pair = - Elm.value - { importFrom = [ "Tuple" ] - , name = "pair" - , annotation = - Just - (Type.function - [ Type.var "a", Type.var "b" ] - (Type.tuple (Type.var "a") (Type.var "b")) - ) - } - , first = - Elm.value - { importFrom = [ "Tuple" ] - , name = "first" - , annotation = - Just - (Type.function - [ Type.tuple (Type.var "a") (Type.var "b") ] - (Type.var "a") - ) - } - , second = - Elm.value - { importFrom = [ "Tuple" ] - , name = "second" - , annotation = - Just - (Type.function - [ Type.tuple (Type.var "a") (Type.var "b") ] - (Type.var "b") - ) - } - , mapFirst = - Elm.value - { importFrom = [ "Tuple" ] - , name = "mapFirst" - , annotation = - Just - (Type.function - [ Type.function [ Type.var "a" ] (Type.var "x") - , Type.tuple (Type.var "a") (Type.var "b") - ] - (Type.tuple (Type.var "x") (Type.var "b")) - ) - } - , mapSecond = - Elm.value - { importFrom = [ "Tuple" ] - , name = "mapSecond" - , annotation = - Just - (Type.function - [ Type.function [ Type.var "b" ] (Type.var "y") - , Type.tuple (Type.var "a") (Type.var "b") - ] - (Type.tuple (Type.var "a") (Type.var "y")) - ) - } - , mapBoth = - Elm.value - { importFrom = [ "Tuple" ] - , name = "mapBoth" - , annotation = - Just - (Type.function - [ Type.function [ Type.var "a" ] (Type.var "x") - , Type.function [ Type.var "b" ] (Type.var "y") - , Type.tuple (Type.var "a") (Type.var "b") - ] - (Type.tuple (Type.var "x") (Type.var "y")) - ) - } - } \ No newline at end of file diff --git a/elm-open-api-codegen/src/Gen/Url/Parser.elm b/elm-open-api-codegen/src/Gen/Url/Parser.elm deleted file mode 100644 index 02714377..00000000 --- a/elm-open-api-codegen/src/Gen/Url/Parser.elm +++ /dev/null @@ -1,849 +0,0 @@ -module Gen.Url.Parser exposing - ( moduleName_, string, int, s, map, oneOf - , top, custom, query, fragment, parse, annotation_, call_ - , values_ - ) - -{-| -# Generated bindings for Url.Parser - -@docs moduleName_, string, int, s, map, oneOf -@docs top, custom, query, fragment, parse, annotation_ -@docs call_, values_ --} - - -import Elm -import Elm.Annotation as Type - - -{-| The name of this module. -} -moduleName_ : List String -moduleName_ = - [ "Url", "Parser" ] - - -{-| Parse a segment of the path as a `String`. - - -- /alice/ ==> Just "alice" - -- /bob ==> Just "bob" - -- /42/ ==> Just "42" - -- / ==> Nothing - -string: Url.Parser.Parser (String -> a) a --} -string : Elm.Expression -string = - Elm.value - { importFrom = [ "Url", "Parser" ] - , name = "string" - , annotation = - Just - (Type.namedWith - [ "Url", "Parser" ] - "Parser" - [ Type.function [ Type.string ] (Type.var "a") - , Type.var "a" - ] - ) - } - - -{-| Parse a segment of the path as an `Int`. - - -- /alice/ ==> Nothing - -- /bob ==> Nothing - -- /42/ ==> Just 42 - -- / ==> Nothing - -int: Url.Parser.Parser (Int -> a) a --} -int : Elm.Expression -int = - Elm.value - { importFrom = [ "Url", "Parser" ] - , name = "int" - , annotation = - Just - (Type.namedWith - [ "Url", "Parser" ] - "Parser" - [ Type.function [ Type.int ] (Type.var "a"), Type.var "a" ] - ) - } - - -{-| Parse a segment of the path if it matches a given string. It is almost -always used with [``](#) or [`oneOf`](#oneOf). For example: - - blog : Parser (Int -> a) a - blog = - s "blog" int - - -- /blog/42 ==> Just 42 - -- /tree/42 ==> Nothing - -The path segment must be an exact match! - -s: String -> Url.Parser.Parser a a --} -s : String -> Elm.Expression -s sArg_ = - Elm.apply - (Elm.value - { importFrom = [ "Url", "Parser" ] - , name = "s" - , annotation = - Just - (Type.function - [ Type.string ] - (Type.namedWith - [ "Url", "Parser" ] - "Parser" - [ Type.var "a", Type.var "a" ] - ) - ) - } - ) - [ Elm.string sArg_ ] - - -{-| Transform a path parser. - - type alias Comment = { user : String, id : Int } - - userAndId : Parser (String -> Int -> a) a - userAndId = - s "user" string s "comment" int - - comment : Parser (Comment -> a) a - comment = - map Comment userAndId - - -- /user/bob/comment/42 ==> Just { user = "bob", id = 42 } - -- /user/tom/comment/35 ==> Just { user = "tom", id = 35 } - -- /user/sam/ ==> Nothing - -map: a -> Url.Parser.Parser a b -> Url.Parser.Parser (b -> c) c --} -map : Elm.Expression -> Elm.Expression -> Elm.Expression -map mapArg_ mapArg_0 = - Elm.apply - (Elm.value - { importFrom = [ "Url", "Parser" ] - , name = "map" - , annotation = - Just - (Type.function - [ Type.var "a" - , Type.namedWith - [ "Url", "Parser" ] - "Parser" - [ Type.var "a", Type.var "b" ] - ] - (Type.namedWith - [ "Url", "Parser" ] - "Parser" - [ Type.function [ Type.var "b" ] (Type.var "c") - , Type.var "c" - ] - ) - ) - } - ) - [ mapArg_, mapArg_0 ] - - -{-| Try a bunch of different path parsers. - - type Route - = Topic String - | Blog Int - | User String - | Comment String Int - - route : Parser (Route -> a) a - route = - oneOf - [ map Topic (s "topic" string) - , map Blog (s "blog" int) - , map User (s "user" string) - , map Comment (s "user" string s "comment" int) - ] - - -- /topic/wolf ==> Just (Topic "wolf") - -- /topic/ ==> Nothing - - -- /blog/42 ==> Just (Blog 42) - -- /blog/wolf ==> Nothing - - -- /user/sam/ ==> Just (User "sam") - -- /user/bob/comment/42 ==> Just (Comment "bob" 42) - -- /user/tom/comment/35 ==> Just (Comment "tom" 35) - -- /user/ ==> Nothing - -If there are multiple parsers that could succeed, the first one wins. - -oneOf: List (Url.Parser.Parser a b) -> Url.Parser.Parser a b --} -oneOf : List Elm.Expression -> Elm.Expression -oneOf oneOfArg_ = - Elm.apply - (Elm.value - { importFrom = [ "Url", "Parser" ] - , name = "oneOf" - , annotation = - Just - (Type.function - [ Type.list - (Type.namedWith - [ "Url", "Parser" ] - "Parser" - [ Type.var "a", Type.var "b" ] - ) - ] - (Type.namedWith - [ "Url", "Parser" ] - "Parser" - [ Type.var "a", Type.var "b" ] - ) - ) - } - ) - [ Elm.list oneOfArg_ ] - - -{-| A parser that does not consume any path segments. - - type Route = Overview | Post Int - - blog : Parser (BlogRoute -> a) a - blog = - s "blog" - oneOf - [ map Overview top - , map Post (s "post" int) - ] - - -- /blog/ ==> Just Overview - -- /blog/post/42 ==> Just (Post 42) - -top: Url.Parser.Parser a a --} -top : Elm.Expression -top = - Elm.value - { importFrom = [ "Url", "Parser" ] - , name = "top" - , annotation = - Just - (Type.namedWith - [ "Url", "Parser" ] - "Parser" - [ Type.var "a", Type.var "a" ] - ) - } - - -{-| Create a custom path segment parser. Here is how it is used to define the -`int` parser: - - int : Parser (Int -> a) a - int = - custom "NUMBER" String.toInt - -You can use it to define something like “only CSS files” like this: - - css : Parser (String -> a) a - css = - custom "CSS_FILE" <| \segment -> - if String.endsWith ".css" segment then - Just segment - else - Nothing - -custom: String -> (String -> Maybe a) -> Url.Parser.Parser (a -> b) b --} -custom : String -> (Elm.Expression -> Elm.Expression) -> Elm.Expression -custom customArg_ customArg_0 = - Elm.apply - (Elm.value - { importFrom = [ "Url", "Parser" ] - , name = "custom" - , annotation = - Just - (Type.function - [ Type.string - , Type.function - [ Type.string ] - (Type.maybe (Type.var "a")) - ] - (Type.namedWith - [ "Url", "Parser" ] - "Parser" - [ Type.function [ Type.var "a" ] (Type.var "b") - , Type.var "b" - ] - ) - ) - } - ) - [ Elm.string customArg_ - , Elm.functionReduced "customUnpack" customArg_0 - ] - - -{-| The [`Url.Parser.Query`](Url-Parser-Query) module defines its own -[`Parser`](Url-Parser-Query#Parser) type. This function is a helper to convert -those into normal parsers. - - import Url.Parser.Query as Query - - -- the following expressions are both the same! - -- - -- s "blog" Query.string "search" - -- s "blog" query (Query.string "search") - -This may be handy if you need query parameters but are not parsing any path -segments. - -query: Url.Parser.Query.Parser query -> Url.Parser.Parser (query -> a) a --} -query : Elm.Expression -> Elm.Expression -query queryArg_ = - Elm.apply - (Elm.value - { importFrom = [ "Url", "Parser" ] - , name = "query" - , annotation = - Just - (Type.function - [ Type.namedWith - [ "Url", "Parser", "Query" ] - "Parser" - [ Type.var "query" ] - ] - (Type.namedWith - [ "Url", "Parser" ] - "Parser" - [ Type.function - [ Type.var "query" ] - (Type.var "a") - , Type.var "a" - ] - ) - ) - } - ) - [ queryArg_ ] - - -{-| Create a parser for the URL fragment, the stuff after the `#`. This can -be handy for handling links to DOM elements within a page. Pages like this one! - - type alias Docs = - (String, Maybe String) - - docs : Parser (Docs -> a) a - docs = - map Tuple.pair (string fragment identity) - - -- /List/map ==> Nothing - -- /List/#map ==> Just ("List", Just "map") - -- /List#map ==> Just ("List", Just "map") - -- /List# ==> Just ("List", Just "") - -- /List ==> Just ("List", Nothing) - -- / ==> Nothing - -fragment: (Maybe String -> fragment) -> Url.Parser.Parser (fragment -> a) a --} -fragment : (Elm.Expression -> Elm.Expression) -> Elm.Expression -fragment fragmentArg_ = - Elm.apply - (Elm.value - { importFrom = [ "Url", "Parser" ] - , name = "fragment" - , annotation = - Just - (Type.function - [ Type.function - [ Type.maybe Type.string ] - (Type.var "fragment") - ] - (Type.namedWith - [ "Url", "Parser" ] - "Parser" - [ Type.function - [ Type.var "fragment" ] - (Type.var "a") - , Type.var "a" - ] - ) - ) - } - ) - [ Elm.functionReduced "fragmentUnpack" fragmentArg_ ] - - -{-| Actually run a parser! You provide some [`Url`](Url#Url) that -represent a valid URL. From there `parse` runs your parser on the path, query -parameters, and fragment. - - import Url - import Url.Parser exposing (Parser, parse, int, map, oneOf, s, top) - - type Route = Home | Blog Int | NotFound - - route : Parser (Route -> a) a - route = - oneOf - [ map Home top - , map Blog (s "blog" int) - ] - - toRoute : String -> Route - toRoute string = - case Url.fromString string of - Nothing -> - NotFound - - Just url -> - Maybe.withDefault NotFound (parse route url) - - -- toRoute "/blog/42" == NotFound - -- toRoute "https://example.com/" == Home - -- toRoute "https://example.com/blog" == NotFound - -- toRoute "https://example.com/blog/42" == Blog 42 - -- toRoute "https://example.com/blog/42/" == Blog 42 - -- toRoute "https://example.com/blog/42#wolf" == Blog 42 - -- toRoute "https://example.com/blog/42?q=wolf" == Blog 42 - -- toRoute "https://example.com/settings" == NotFound - -Functions like `toRoute` are useful when creating single-page apps with -[`Browser.fullscreen`][fs]. I use them in `init` and `onNavigation` to handle -the initial URL and any changes. - -[fs]: /packages/elm/browser/latest/Browser#fullscreen - -parse: Url.Parser.Parser (a -> a) a -> Url.Url -> Maybe a --} -parse : Elm.Expression -> Elm.Expression -> Elm.Expression -parse parseArg_ parseArg_0 = - Elm.apply - (Elm.value - { importFrom = [ "Url", "Parser" ] - , name = "parse" - , annotation = - Just - (Type.function - [ Type.namedWith - [ "Url", "Parser" ] - "Parser" - [ Type.function [ Type.var "a" ] (Type.var "a") - , Type.var "a" - ] - , Type.namedWith [ "Url" ] "Url" [] - ] - (Type.maybe (Type.var "a")) - ) - } - ) - [ parseArg_, parseArg_0 ] - - -annotation_ : { parser : Type.Annotation -> Type.Annotation -> Type.Annotation } -annotation_ = - { parser = - \parserArg0 parserArg1 -> - Type.namedWith - [ "Url", "Parser" ] - "Parser" - [ parserArg0, parserArg1 ] - } - - -call_ : - { s : Elm.Expression -> Elm.Expression - , map : Elm.Expression -> Elm.Expression -> Elm.Expression - , oneOf : Elm.Expression -> Elm.Expression - , custom : Elm.Expression -> Elm.Expression -> Elm.Expression - , query : Elm.Expression -> Elm.Expression - , fragment : Elm.Expression -> Elm.Expression - , parse : Elm.Expression -> Elm.Expression -> Elm.Expression - } -call_ = - { s = - \sArg_ -> - Elm.apply - (Elm.value - { importFrom = [ "Url", "Parser" ] - , name = "s" - , annotation = - Just - (Type.function - [ Type.string ] - (Type.namedWith - [ "Url", "Parser" ] - "Parser" - [ Type.var "a", Type.var "a" ] - ) - ) - } - ) - [ sArg_ ] - , map = - \mapArg_ mapArg_0 -> - Elm.apply - (Elm.value - { importFrom = [ "Url", "Parser" ] - , name = "map" - , annotation = - Just - (Type.function - [ Type.var "a" - , Type.namedWith - [ "Url", "Parser" ] - "Parser" - [ Type.var "a", Type.var "b" ] - ] - (Type.namedWith - [ "Url", "Parser" ] - "Parser" - [ Type.function - [ Type.var "b" ] - (Type.var "c") - , Type.var "c" - ] - ) - ) - } - ) - [ mapArg_, mapArg_0 ] - , oneOf = - \oneOfArg_ -> - Elm.apply - (Elm.value - { importFrom = [ "Url", "Parser" ] - , name = "oneOf" - , annotation = - Just - (Type.function - [ Type.list - (Type.namedWith - [ "Url", "Parser" ] - "Parser" - [ Type.var "a", Type.var "b" ] - ) - ] - (Type.namedWith - [ "Url", "Parser" ] - "Parser" - [ Type.var "a", Type.var "b" ] - ) - ) - } - ) - [ oneOfArg_ ] - , custom = - \customArg_ customArg_0 -> - Elm.apply - (Elm.value - { importFrom = [ "Url", "Parser" ] - , name = "custom" - , annotation = - Just - (Type.function - [ Type.string - , Type.function - [ Type.string ] - (Type.maybe (Type.var "a")) - ] - (Type.namedWith - [ "Url", "Parser" ] - "Parser" - [ Type.function - [ Type.var "a" ] - (Type.var "b") - , Type.var "b" - ] - ) - ) - } - ) - [ customArg_, customArg_0 ] - , query = - \queryArg_ -> - Elm.apply - (Elm.value - { importFrom = [ "Url", "Parser" ] - , name = "query" - , annotation = - Just - (Type.function - [ Type.namedWith - [ "Url", "Parser", "Query" ] - "Parser" - [ Type.var "query" ] - ] - (Type.namedWith - [ "Url", "Parser" ] - "Parser" - [ Type.function - [ Type.var "query" ] - (Type.var "a") - , Type.var "a" - ] - ) - ) - } - ) - [ queryArg_ ] - , fragment = - \fragmentArg_ -> - Elm.apply - (Elm.value - { importFrom = [ "Url", "Parser" ] - , name = "fragment" - , annotation = - Just - (Type.function - [ Type.function - [ Type.maybe Type.string ] - (Type.var "fragment") - ] - (Type.namedWith - [ "Url", "Parser" ] - "Parser" - [ Type.function - [ Type.var "fragment" ] - (Type.var "a") - , Type.var "a" - ] - ) - ) - } - ) - [ fragmentArg_ ] - , parse = - \parseArg_ parseArg_0 -> - Elm.apply - (Elm.value - { importFrom = [ "Url", "Parser" ] - , name = "parse" - , annotation = - Just - (Type.function - [ Type.namedWith - [ "Url", "Parser" ] - "Parser" - [ Type.function - [ Type.var "a" ] - (Type.var "a") - , Type.var "a" - ] - , Type.namedWith [ "Url" ] "Url" [] - ] - (Type.maybe (Type.var "a")) - ) - } - ) - [ parseArg_, parseArg_0 ] - } - - -values_ : - { string : Elm.Expression - , int : Elm.Expression - , s : Elm.Expression - , map : Elm.Expression - , oneOf : Elm.Expression - , top : Elm.Expression - , custom : Elm.Expression - , query : Elm.Expression - , fragment : Elm.Expression - , parse : Elm.Expression - } -values_ = - { string = - Elm.value - { importFrom = [ "Url", "Parser" ] - , name = "string" - , annotation = - Just - (Type.namedWith - [ "Url", "Parser" ] - "Parser" - [ Type.function [ Type.string ] (Type.var "a") - , Type.var "a" - ] - ) - } - , int = - Elm.value - { importFrom = [ "Url", "Parser" ] - , name = "int" - , annotation = - Just - (Type.namedWith - [ "Url", "Parser" ] - "Parser" - [ Type.function [ Type.int ] (Type.var "a") - , Type.var "a" - ] - ) - } - , s = - Elm.value - { importFrom = [ "Url", "Parser" ] - , name = "s" - , annotation = - Just - (Type.function - [ Type.string ] - (Type.namedWith - [ "Url", "Parser" ] - "Parser" - [ Type.var "a", Type.var "a" ] - ) - ) - } - , map = - Elm.value - { importFrom = [ "Url", "Parser" ] - , name = "map" - , annotation = - Just - (Type.function - [ Type.var "a" - , Type.namedWith - [ "Url", "Parser" ] - "Parser" - [ Type.var "a", Type.var "b" ] - ] - (Type.namedWith - [ "Url", "Parser" ] - "Parser" - [ Type.function [ Type.var "b" ] (Type.var "c") - , Type.var "c" - ] - ) - ) - } - , oneOf = - Elm.value - { importFrom = [ "Url", "Parser" ] - , name = "oneOf" - , annotation = - Just - (Type.function - [ Type.list - (Type.namedWith - [ "Url", "Parser" ] - "Parser" - [ Type.var "a", Type.var "b" ] - ) - ] - (Type.namedWith - [ "Url", "Parser" ] - "Parser" - [ Type.var "a", Type.var "b" ] - ) - ) - } - , top = - Elm.value - { importFrom = [ "Url", "Parser" ] - , name = "top" - , annotation = - Just - (Type.namedWith - [ "Url", "Parser" ] - "Parser" - [ Type.var "a", Type.var "a" ] - ) - } - , custom = - Elm.value - { importFrom = [ "Url", "Parser" ] - , name = "custom" - , annotation = - Just - (Type.function - [ Type.string - , Type.function - [ Type.string ] - (Type.maybe (Type.var "a")) - ] - (Type.namedWith - [ "Url", "Parser" ] - "Parser" - [ Type.function [ Type.var "a" ] (Type.var "b") - , Type.var "b" - ] - ) - ) - } - , query = - Elm.value - { importFrom = [ "Url", "Parser" ] - , name = "query" - , annotation = - Just - (Type.function - [ Type.namedWith - [ "Url", "Parser", "Query" ] - "Parser" - [ Type.var "query" ] - ] - (Type.namedWith - [ "Url", "Parser" ] - "Parser" - [ Type.function - [ Type.var "query" ] - (Type.var "a") - , Type.var "a" - ] - ) - ) - } - , fragment = - Elm.value - { importFrom = [ "Url", "Parser" ] - , name = "fragment" - , annotation = - Just - (Type.function - [ Type.function - [ Type.maybe Type.string ] - (Type.var "fragment") - ] - (Type.namedWith - [ "Url", "Parser" ] - "Parser" - [ Type.function - [ Type.var "fragment" ] - (Type.var "a") - , Type.var "a" - ] - ) - ) - } - , parse = - Elm.value - { importFrom = [ "Url", "Parser" ] - , name = "parse" - , annotation = - Just - (Type.function - [ Type.namedWith - [ "Url", "Parser" ] - "Parser" - [ Type.function [ Type.var "a" ] (Type.var "a") - , Type.var "a" - ] - , Type.namedWith [ "Url" ] "Url" [] - ] - (Type.maybe (Type.var "a")) - ) - } - } \ No newline at end of file diff --git a/elm-open-api-codegen/src/Gen/Url/Parser/Query.elm b/elm-open-api-codegen/src/Gen/Url/Parser/Query.elm deleted file mode 100644 index 76c35b9e..00000000 --- a/elm-open-api-codegen/src/Gen/Url/Parser/Query.elm +++ /dev/null @@ -1,1922 +0,0 @@ -module Gen.Url.Parser.Query exposing - ( moduleName_, string, int, enum, custom, map - , map2, map3, map4, map5, map6, map7, map8 - , annotation_, call_, values_ - ) - -{-| -# Generated bindings for Url.Parser.Query - -@docs moduleName_, string, int, enum, custom, map -@docs map2, map3, map4, map5, map6, map7 -@docs map8, annotation_, call_, values_ --} - - -import Elm -import Elm.Annotation as Type - - -{-| The name of this module. -} -moduleName_ : List String -moduleName_ = - [ "Url", "Parser", "Query" ] - - -{-| Handle `String` parameters. - - search : Parser (Maybe String) - search = - string "search" - - -- ?search=cats == Just "cats" - -- ?search=42 == Just "42" - -- ?branch=left == Nothing - -- ?search=cats&search=dogs == Nothing - -Check out [`custom`](#custom) if you need to handle multiple `search` -parameters for some reason. - -string: String -> Url.Parser.Query.Parser (Maybe String) --} -string : String -> Elm.Expression -string stringArg_ = - Elm.apply - (Elm.value - { importFrom = [ "Url", "Parser", "Query" ] - , name = "string" - , annotation = - Just - (Type.function - [ Type.string ] - (Type.namedWith - [ "Url", "Parser", "Query" ] - "Parser" - [ Type.maybe Type.string ] - ) - ) - } - ) - [ Elm.string stringArg_ ] - - -{-| Handle `Int` parameters. Maybe you want to show paginated search results: - - page : Parser (Maybe Int) - page = - int "page" - - -- ?page=2 == Just 2 - -- ?page=17 == Just 17 - -- ?page=two == Nothing - -- ?sort=date == Nothing - -- ?page=2&page=3 == Nothing - -Check out [`custom`](#custom) if you need to handle multiple `page` parameters -or something like that. - -int: String -> Url.Parser.Query.Parser (Maybe Int) --} -int : String -> Elm.Expression -int intArg_ = - Elm.apply - (Elm.value - { importFrom = [ "Url", "Parser", "Query" ] - , name = "int" - , annotation = - Just - (Type.function - [ Type.string ] - (Type.namedWith - [ "Url", "Parser", "Query" ] - "Parser" - [ Type.maybe Type.int ] - ) - ) - } - ) - [ Elm.string intArg_ ] - - -{-| Handle enumerated parameters. Maybe you want a true-or-false parameter: - - import Dict - - debug : Parser (Maybe Bool) - debug = - enum "debug" (Dict.fromList [ ("true", True), ("false", False) ]) - - -- ?debug=true == Just True - -- ?debug=false == Just False - -- ?debug=1 == Nothing - -- ?debug=0 == Nothing - -- ?true=true == Nothing - -- ?debug=true&debug=true == Nothing - -You could add `0` and `1` to the dictionary if you want to handle those as -well. You can also use [`map`](#map) to say `map (Result.withDefault False) debug` -to get a parser of type `Parser Bool` that swallows any errors and defaults to -`False`. - -**Note:** Parameters like `?debug` with no `=` are not supported by this library. - -enum: String -> Dict.Dict String a -> Url.Parser.Query.Parser (Maybe a) --} -enum : String -> Elm.Expression -> Elm.Expression -enum enumArg_ enumArg_0 = - Elm.apply - (Elm.value - { importFrom = [ "Url", "Parser", "Query" ] - , name = "enum" - , annotation = - Just - (Type.function - [ Type.string - , Type.namedWith - [ "Dict" ] - "Dict" - [ Type.string, Type.var "a" ] - ] - (Type.namedWith - [ "Url", "Parser", "Query" ] - "Parser" - [ Type.maybe (Type.var "a") ] - ) - ) - } - ) - [ Elm.string enumArg_, enumArg_0 ] - - -{-| Create a custom query parser. The [`string`](#string), [`int`](#int), and -[`enum`](#enum) parsers are defined using this function. It can help you handle -anything though! - -Say you are unlucky enough to need to handle `?post=2&post=7` to show a couple -posts on screen at once. You could say: - - posts : Parser (Maybe (List Int)) - posts = - custom "post" (List.maybeMap String.toInt) - - -- ?post=2 == [2] - -- ?post=2&post=7 == [2, 7] - -- ?post=2&post=x == [2] - -- ?hats=2 == [] - -custom: String -> (List String -> a) -> Url.Parser.Query.Parser a --} -custom : String -> (Elm.Expression -> Elm.Expression) -> Elm.Expression -custom customArg_ customArg_0 = - Elm.apply - (Elm.value - { importFrom = [ "Url", "Parser", "Query" ] - , name = "custom" - , annotation = - Just - (Type.function - [ Type.string - , Type.function - [ Type.list Type.string ] - (Type.var "a") - ] - (Type.namedWith - [ "Url", "Parser", "Query" ] - "Parser" - [ Type.var "a" ] - ) - ) - } - ) - [ Elm.string customArg_ - , Elm.functionReduced "customUnpack" customArg_0 - ] - - -{-| Transform a parser in some way. Maybe you want your `page` query parser to -default to `1` if there is any problem? - - page : Parser Int - page = - map (Result.withDefault 1) (int "page") - -map: (a -> b) -> Url.Parser.Query.Parser a -> Url.Parser.Query.Parser b --} -map : (Elm.Expression -> Elm.Expression) -> Elm.Expression -> Elm.Expression -map mapArg_ mapArg_0 = - Elm.apply - (Elm.value - { importFrom = [ "Url", "Parser", "Query" ] - , name = "map" - , annotation = - Just - (Type.function - [ Type.function [ Type.var "a" ] (Type.var "b") - , Type.namedWith - [ "Url", "Parser", "Query" ] - "Parser" - [ Type.var "a" ] - ] - (Type.namedWith - [ "Url", "Parser", "Query" ] - "Parser" - [ Type.var "b" ] - ) - ) - } - ) - [ Elm.functionReduced "mapUnpack" mapArg_, mapArg_0 ] - - -{-| Combine two parsers. A query like `?search=hats&page=2` could be parsed -with something like this: - - type alias Query = - { search : Maybe String - , page : Maybe Int - } - - query : Parser Query - query = - map2 Query (string "search") (int "page") - -map2: - (a -> b -> result) - -> Url.Parser.Query.Parser a - -> Url.Parser.Query.Parser b - -> Url.Parser.Query.Parser result --} -map2 : - (Elm.Expression -> Elm.Expression -> Elm.Expression) - -> Elm.Expression - -> Elm.Expression - -> Elm.Expression -map2 map2Arg_ map2Arg_0 map2Arg_1 = - Elm.apply - (Elm.value - { importFrom = [ "Url", "Parser", "Query" ] - , name = "map2" - , annotation = - Just - (Type.function - [ Type.function - [ Type.var "a", Type.var "b" ] - (Type.var "result") - , Type.namedWith - [ "Url", "Parser", "Query" ] - "Parser" - [ Type.var "a" ] - , Type.namedWith - [ "Url", "Parser", "Query" ] - "Parser" - [ Type.var "b" ] - ] - (Type.namedWith - [ "Url", "Parser", "Query" ] - "Parser" - [ Type.var "result" ] - ) - ) - } - ) - [ Elm.functionReduced - "map2Unpack" - (\functionReducedUnpack -> - Elm.functionReduced "unpack" (map2Arg_ functionReducedUnpack) - ) - , map2Arg_0 - , map2Arg_1 - ] - - -{-| Combine three parsers. A query like `?search=hats&page=2&sort=ascending` -could be parsed with something like this: - - import Dict - - type alias Query = - { search : Maybe String - , page : Maybe Int - , sort : Maybe Order - } - - type Order = Ascending | Descending - - query : Parser Query - query = - map3 Query (string "search") (int "page") (enum "sort" order) - - order : Dict.Dict String Order - order = - Dict.fromList - [ ( "ascending", Ascending ) - , ( "descending", Descending ) - ] - -map3: - (a -> b -> c -> result) - -> Url.Parser.Query.Parser a - -> Url.Parser.Query.Parser b - -> Url.Parser.Query.Parser c - -> Url.Parser.Query.Parser result --} -map3 : - (Elm.Expression -> Elm.Expression -> Elm.Expression -> Elm.Expression) - -> Elm.Expression - -> Elm.Expression - -> Elm.Expression - -> Elm.Expression -map3 map3Arg_ map3Arg_0 map3Arg_1 map3Arg_2 = - Elm.apply - (Elm.value - { importFrom = [ "Url", "Parser", "Query" ] - , name = "map3" - , annotation = - Just - (Type.function - [ Type.function - [ Type.var "a", Type.var "b", Type.var "c" ] - (Type.var "result") - , Type.namedWith - [ "Url", "Parser", "Query" ] - "Parser" - [ Type.var "a" ] - , Type.namedWith - [ "Url", "Parser", "Query" ] - "Parser" - [ Type.var "b" ] - , Type.namedWith - [ "Url", "Parser", "Query" ] - "Parser" - [ Type.var "c" ] - ] - (Type.namedWith - [ "Url", "Parser", "Query" ] - "Parser" - [ Type.var "result" ] - ) - ) - } - ) - [ Elm.functionReduced - "map3Unpack" - (\functionReducedUnpack -> - Elm.functionReduced - "unpack" - (\functionReducedUnpack0 -> - Elm.functionReduced - "unpack" - ((map3Arg_ functionReducedUnpack) - functionReducedUnpack0 - ) - ) - ) - , map3Arg_0 - , map3Arg_1 - , map3Arg_2 - ] - - -{-| map4: - (a -> b -> c -> d -> result) - -> Url.Parser.Query.Parser a - -> Url.Parser.Query.Parser b - -> Url.Parser.Query.Parser c - -> Url.Parser.Query.Parser d - -> Url.Parser.Query.Parser result --} -map4 : - (Elm.Expression - -> Elm.Expression - -> Elm.Expression - -> Elm.Expression - -> Elm.Expression) - -> Elm.Expression - -> Elm.Expression - -> Elm.Expression - -> Elm.Expression - -> Elm.Expression -map4 map4Arg_ map4Arg_0 map4Arg_1 map4Arg_2 map4Arg_3 = - Elm.apply - (Elm.value - { importFrom = [ "Url", "Parser", "Query" ] - , name = "map4" - , annotation = - Just - (Type.function - [ Type.function - [ Type.var "a" - , Type.var "b" - , Type.var "c" - , Type.var "d" - ] - (Type.var "result") - , Type.namedWith - [ "Url", "Parser", "Query" ] - "Parser" - [ Type.var "a" ] - , Type.namedWith - [ "Url", "Parser", "Query" ] - "Parser" - [ Type.var "b" ] - , Type.namedWith - [ "Url", "Parser", "Query" ] - "Parser" - [ Type.var "c" ] - , Type.namedWith - [ "Url", "Parser", "Query" ] - "Parser" - [ Type.var "d" ] - ] - (Type.namedWith - [ "Url", "Parser", "Query" ] - "Parser" - [ Type.var "result" ] - ) - ) - } - ) - [ Elm.functionReduced - "map4Unpack" - (\functionReducedUnpack -> - Elm.functionReduced - "unpack" - (\functionReducedUnpack0 -> - Elm.functionReduced - "unpack" - (\functionReducedUnpack_2_1_2_0_2_0_2_0_0 -> - Elm.functionReduced - "unpack" - (((map4Arg_ functionReducedUnpack) - functionReducedUnpack0 - ) - functionReducedUnpack_2_1_2_0_2_0_2_0_0 - ) - ) - ) - ) - , map4Arg_0 - , map4Arg_1 - , map4Arg_2 - , map4Arg_3 - ] - - -{-| map5: - (a -> b -> c -> d -> e -> result) - -> Url.Parser.Query.Parser a - -> Url.Parser.Query.Parser b - -> Url.Parser.Query.Parser c - -> Url.Parser.Query.Parser d - -> Url.Parser.Query.Parser e - -> Url.Parser.Query.Parser result --} -map5 : - (Elm.Expression - -> Elm.Expression - -> Elm.Expression - -> Elm.Expression - -> Elm.Expression - -> Elm.Expression) - -> Elm.Expression - -> Elm.Expression - -> Elm.Expression - -> Elm.Expression - -> Elm.Expression - -> Elm.Expression -map5 map5Arg_ map5Arg_0 map5Arg_1 map5Arg_2 map5Arg_3 map5Arg_4 = - Elm.apply - (Elm.value - { importFrom = [ "Url", "Parser", "Query" ] - , name = "map5" - , annotation = - Just - (Type.function - [ Type.function - [ Type.var "a" - , Type.var "b" - , Type.var "c" - , Type.var "d" - , Type.var "e" - ] - (Type.var "result") - , Type.namedWith - [ "Url", "Parser", "Query" ] - "Parser" - [ Type.var "a" ] - , Type.namedWith - [ "Url", "Parser", "Query" ] - "Parser" - [ Type.var "b" ] - , Type.namedWith - [ "Url", "Parser", "Query" ] - "Parser" - [ Type.var "c" ] - , Type.namedWith - [ "Url", "Parser", "Query" ] - "Parser" - [ Type.var "d" ] - , Type.namedWith - [ "Url", "Parser", "Query" ] - "Parser" - [ Type.var "e" ] - ] - (Type.namedWith - [ "Url", "Parser", "Query" ] - "Parser" - [ Type.var "result" ] - ) - ) - } - ) - [ Elm.functionReduced - "map5Unpack" - (\functionReducedUnpack -> - Elm.functionReduced - "unpack" - (\functionReducedUnpack0 -> - Elm.functionReduced - "unpack" - (\functionReducedUnpack_2_1_2_0_2_0_2_0_0 -> - Elm.functionReduced - "unpack" - (\functionReducedUnpack_2_1_2_1_2_0_2_0_2_0_0 -> - Elm.functionReduced - "unpack" - ((((map5Arg_ functionReducedUnpack - ) - functionReducedUnpack0 - ) - functionReducedUnpack_2_1_2_0_2_0_2_0_0 - ) - functionReducedUnpack_2_1_2_1_2_0_2_0_2_0_0 - ) - ) - ) - ) - ) - , map5Arg_0 - , map5Arg_1 - , map5Arg_2 - , map5Arg_3 - , map5Arg_4 - ] - - -{-| map6: - (a -> b -> c -> d -> e -> f -> result) - -> Url.Parser.Query.Parser a - -> Url.Parser.Query.Parser b - -> Url.Parser.Query.Parser c - -> Url.Parser.Query.Parser d - -> Url.Parser.Query.Parser e - -> Url.Parser.Query.Parser f - -> Url.Parser.Query.Parser result --} -map6 : - (Elm.Expression - -> Elm.Expression - -> Elm.Expression - -> Elm.Expression - -> Elm.Expression - -> Elm.Expression - -> Elm.Expression) - -> Elm.Expression - -> Elm.Expression - -> Elm.Expression - -> Elm.Expression - -> Elm.Expression - -> Elm.Expression - -> Elm.Expression -map6 map6Arg_ map6Arg_0 map6Arg_1 map6Arg_2 map6Arg_3 map6Arg_4 map6Arg_5 = - Elm.apply - (Elm.value - { importFrom = [ "Url", "Parser", "Query" ] - , name = "map6" - , annotation = - Just - (Type.function - [ Type.function - [ Type.var "a" - , Type.var "b" - , Type.var "c" - , Type.var "d" - , Type.var "e" - , Type.var "f" - ] - (Type.var "result") - , Type.namedWith - [ "Url", "Parser", "Query" ] - "Parser" - [ Type.var "a" ] - , Type.namedWith - [ "Url", "Parser", "Query" ] - "Parser" - [ Type.var "b" ] - , Type.namedWith - [ "Url", "Parser", "Query" ] - "Parser" - [ Type.var "c" ] - , Type.namedWith - [ "Url", "Parser", "Query" ] - "Parser" - [ Type.var "d" ] - , Type.namedWith - [ "Url", "Parser", "Query" ] - "Parser" - [ Type.var "e" ] - , Type.namedWith - [ "Url", "Parser", "Query" ] - "Parser" - [ Type.var "f" ] - ] - (Type.namedWith - [ "Url", "Parser", "Query" ] - "Parser" - [ Type.var "result" ] - ) - ) - } - ) - [ Elm.functionReduced - "map6Unpack" - (\functionReducedUnpack -> - Elm.functionReduced - "unpack" - (\functionReducedUnpack0 -> - Elm.functionReduced - "unpack" - (\functionReducedUnpack_2_1_2_0_2_0_2_0_0 -> - Elm.functionReduced - "unpack" - (\functionReducedUnpack_2_1_2_1_2_0_2_0_2_0_0 -> - Elm.functionReduced - "unpack" - (\functionReducedUnpack_2_1_2_1_2_1_2_0_2_0_2_0_0 -> - Elm.functionReduced - "unpack" - (((((map6Arg_ - functionReducedUnpack - ) - functionReducedUnpack0 - ) - functionReducedUnpack_2_1_2_0_2_0_2_0_0 - ) - functionReducedUnpack_2_1_2_1_2_0_2_0_2_0_0 - ) - functionReducedUnpack_2_1_2_1_2_1_2_0_2_0_2_0_0 - ) - ) - ) - ) - ) - ) - , map6Arg_0 - , map6Arg_1 - , map6Arg_2 - , map6Arg_3 - , map6Arg_4 - , map6Arg_5 - ] - - -{-| map7: - (a -> b -> c -> d -> e -> f -> g -> result) - -> Url.Parser.Query.Parser a - -> Url.Parser.Query.Parser b - -> Url.Parser.Query.Parser c - -> Url.Parser.Query.Parser d - -> Url.Parser.Query.Parser e - -> Url.Parser.Query.Parser f - -> Url.Parser.Query.Parser g - -> Url.Parser.Query.Parser result --} -map7 : - (Elm.Expression - -> Elm.Expression - -> Elm.Expression - -> Elm.Expression - -> Elm.Expression - -> Elm.Expression - -> Elm.Expression - -> Elm.Expression) - -> Elm.Expression - -> Elm.Expression - -> Elm.Expression - -> Elm.Expression - -> Elm.Expression - -> Elm.Expression - -> Elm.Expression - -> Elm.Expression -map7 map7Arg_ map7Arg_0 map7Arg_1 map7Arg_2 map7Arg_3 map7Arg_4 map7Arg_5 map7Arg_6 = - Elm.apply - (Elm.value - { importFrom = [ "Url", "Parser", "Query" ] - , name = "map7" - , annotation = - Just - (Type.function - [ Type.function - [ Type.var "a" - , Type.var "b" - , Type.var "c" - , Type.var "d" - , Type.var "e" - , Type.var "f" - , Type.var "g" - ] - (Type.var "result") - , Type.namedWith - [ "Url", "Parser", "Query" ] - "Parser" - [ Type.var "a" ] - , Type.namedWith - [ "Url", "Parser", "Query" ] - "Parser" - [ Type.var "b" ] - , Type.namedWith - [ "Url", "Parser", "Query" ] - "Parser" - [ Type.var "c" ] - , Type.namedWith - [ "Url", "Parser", "Query" ] - "Parser" - [ Type.var "d" ] - , Type.namedWith - [ "Url", "Parser", "Query" ] - "Parser" - [ Type.var "e" ] - , Type.namedWith - [ "Url", "Parser", "Query" ] - "Parser" - [ Type.var "f" ] - , Type.namedWith - [ "Url", "Parser", "Query" ] - "Parser" - [ Type.var "g" ] - ] - (Type.namedWith - [ "Url", "Parser", "Query" ] - "Parser" - [ Type.var "result" ] - ) - ) - } - ) - [ Elm.functionReduced - "map7Unpack" - (\functionReducedUnpack -> - Elm.functionReduced - "unpack" - (\functionReducedUnpack0 -> - Elm.functionReduced - "unpack" - (\functionReducedUnpack_2_1_2_0_2_0_2_0_0 -> - Elm.functionReduced - "unpack" - (\functionReducedUnpack_2_1_2_1_2_0_2_0_2_0_0 -> - Elm.functionReduced - "unpack" - (\functionReducedUnpack_2_1_2_1_2_1_2_0_2_0_2_0_0 -> - Elm.functionReduced - "unpack" - (\functionReducedUnpack_2_1_2_1_2_1_2_1_2_0_2_0_2_0_0 -> - Elm.functionReduced - "unpack" - ((((((map7Arg_ - functionReducedUnpack - ) - functionReducedUnpack0 - ) - functionReducedUnpack_2_1_2_0_2_0_2_0_0 - ) - functionReducedUnpack_2_1_2_1_2_0_2_0_2_0_0 - ) - functionReducedUnpack_2_1_2_1_2_1_2_0_2_0_2_0_0 - ) - functionReducedUnpack_2_1_2_1_2_1_2_1_2_0_2_0_2_0_0 - ) - ) - ) - ) - ) - ) - ) - , map7Arg_0 - , map7Arg_1 - , map7Arg_2 - , map7Arg_3 - , map7Arg_4 - , map7Arg_5 - , map7Arg_6 - ] - - -{-| If you need higher than eight, you can define a function like this: - - apply : Parser a -> Parser (a -> b) -> Parser b - apply argParser funcParser = - map2 (<|) funcParser argParser - -And then you can chain it to do as many of these as you would like: - - map func (string "search") - |> apply (int "page") - |> apply (int "per-page") - -map8: - (a -> b -> c -> d -> e -> f -> g -> h -> result) - -> Url.Parser.Query.Parser a - -> Url.Parser.Query.Parser b - -> Url.Parser.Query.Parser c - -> Url.Parser.Query.Parser d - -> Url.Parser.Query.Parser e - -> Url.Parser.Query.Parser f - -> Url.Parser.Query.Parser g - -> Url.Parser.Query.Parser h - -> Url.Parser.Query.Parser result --} -map8 : - (Elm.Expression - -> Elm.Expression - -> Elm.Expression - -> Elm.Expression - -> Elm.Expression - -> Elm.Expression - -> Elm.Expression - -> Elm.Expression - -> Elm.Expression) - -> Elm.Expression - -> Elm.Expression - -> Elm.Expression - -> Elm.Expression - -> Elm.Expression - -> Elm.Expression - -> Elm.Expression - -> Elm.Expression - -> Elm.Expression -map8 map8Arg_ map8Arg_0 map8Arg_1 map8Arg_2 map8Arg_3 map8Arg_4 map8Arg_5 map8Arg_6 map8Arg_7 = - Elm.apply - (Elm.value - { importFrom = [ "Url", "Parser", "Query" ] - , name = "map8" - , annotation = - Just - (Type.function - [ Type.function - [ Type.var "a" - , Type.var "b" - , Type.var "c" - , Type.var "d" - , Type.var "e" - , Type.var "f" - , Type.var "g" - , Type.var "h" - ] - (Type.var "result") - , Type.namedWith - [ "Url", "Parser", "Query" ] - "Parser" - [ Type.var "a" ] - , Type.namedWith - [ "Url", "Parser", "Query" ] - "Parser" - [ Type.var "b" ] - , Type.namedWith - [ "Url", "Parser", "Query" ] - "Parser" - [ Type.var "c" ] - , Type.namedWith - [ "Url", "Parser", "Query" ] - "Parser" - [ Type.var "d" ] - , Type.namedWith - [ "Url", "Parser", "Query" ] - "Parser" - [ Type.var "e" ] - , Type.namedWith - [ "Url", "Parser", "Query" ] - "Parser" - [ Type.var "f" ] - , Type.namedWith - [ "Url", "Parser", "Query" ] - "Parser" - [ Type.var "g" ] - , Type.namedWith - [ "Url", "Parser", "Query" ] - "Parser" - [ Type.var "h" ] - ] - (Type.namedWith - [ "Url", "Parser", "Query" ] - "Parser" - [ Type.var "result" ] - ) - ) - } - ) - [ Elm.functionReduced - "map8Unpack" - (\functionReducedUnpack -> - Elm.functionReduced - "unpack" - (\functionReducedUnpack0 -> - Elm.functionReduced - "unpack" - (\functionReducedUnpack_2_1_2_0_2_0_2_0_0 -> - Elm.functionReduced - "unpack" - (\functionReducedUnpack_2_1_2_1_2_0_2_0_2_0_0 -> - Elm.functionReduced - "unpack" - (\functionReducedUnpack_2_1_2_1_2_1_2_0_2_0_2_0_0 -> - Elm.functionReduced - "unpack" - (\functionReducedUnpack_2_1_2_1_2_1_2_1_2_0_2_0_2_0_0 -> - Elm.functionReduced - "unpack" - (\functionReducedUnpack_2_1_2_1_2_1_2_1_2_1_2_0_2_0_2_0_0 -> - Elm.functionReduced - "unpack" - (((((((map8Arg_ - functionReducedUnpack - ) - functionReducedUnpack0 - ) - functionReducedUnpack_2_1_2_0_2_0_2_0_0 - ) - functionReducedUnpack_2_1_2_1_2_0_2_0_2_0_0 - ) - functionReducedUnpack_2_1_2_1_2_1_2_0_2_0_2_0_0 - ) - functionReducedUnpack_2_1_2_1_2_1_2_1_2_0_2_0_2_0_0 - ) - functionReducedUnpack_2_1_2_1_2_1_2_1_2_1_2_0_2_0_2_0_0 - ) - ) - ) - ) - ) - ) - ) - ) - , map8Arg_0 - , map8Arg_1 - , map8Arg_2 - , map8Arg_3 - , map8Arg_4 - , map8Arg_5 - , map8Arg_6 - , map8Arg_7 - ] - - -annotation_ : { parser : Type.Annotation -> Type.Annotation } -annotation_ = - { parser = - \parserArg0 -> - Type.alias - moduleName_ - "Parser" - [ parserArg0 ] - (Type.namedWith - [ "Url", "Parser", "Internal" ] - "QueryParser" - [ Type.var "a" ] - ) - } - - -call_ : - { string : Elm.Expression -> Elm.Expression - , int : Elm.Expression -> Elm.Expression - , enum : Elm.Expression -> Elm.Expression -> Elm.Expression - , custom : Elm.Expression -> Elm.Expression -> Elm.Expression - , map : Elm.Expression -> Elm.Expression -> Elm.Expression - , map2 : - Elm.Expression -> Elm.Expression -> Elm.Expression -> Elm.Expression - , map3 : - Elm.Expression - -> Elm.Expression - -> Elm.Expression - -> Elm.Expression - -> Elm.Expression - , map4 : - Elm.Expression - -> Elm.Expression - -> Elm.Expression - -> Elm.Expression - -> Elm.Expression - -> Elm.Expression - , map5 : - Elm.Expression - -> Elm.Expression - -> Elm.Expression - -> Elm.Expression - -> Elm.Expression - -> Elm.Expression - -> Elm.Expression - , map6 : - Elm.Expression - -> Elm.Expression - -> Elm.Expression - -> Elm.Expression - -> Elm.Expression - -> Elm.Expression - -> Elm.Expression - -> Elm.Expression - , map7 : - Elm.Expression - -> Elm.Expression - -> Elm.Expression - -> Elm.Expression - -> Elm.Expression - -> Elm.Expression - -> Elm.Expression - -> Elm.Expression - -> Elm.Expression - , map8 : - Elm.Expression - -> Elm.Expression - -> Elm.Expression - -> Elm.Expression - -> Elm.Expression - -> Elm.Expression - -> Elm.Expression - -> Elm.Expression - -> Elm.Expression - -> Elm.Expression - } -call_ = - { string = - \stringArg_ -> - Elm.apply - (Elm.value - { importFrom = [ "Url", "Parser", "Query" ] - , name = "string" - , annotation = - Just - (Type.function - [ Type.string ] - (Type.namedWith - [ "Url", "Parser", "Query" ] - "Parser" - [ Type.maybe Type.string ] - ) - ) - } - ) - [ stringArg_ ] - , int = - \intArg_ -> - Elm.apply - (Elm.value - { importFrom = [ "Url", "Parser", "Query" ] - , name = "int" - , annotation = - Just - (Type.function - [ Type.string ] - (Type.namedWith - [ "Url", "Parser", "Query" ] - "Parser" - [ Type.maybe Type.int ] - ) - ) - } - ) - [ intArg_ ] - , enum = - \enumArg_ enumArg_0 -> - Elm.apply - (Elm.value - { importFrom = [ "Url", "Parser", "Query" ] - , name = "enum" - , annotation = - Just - (Type.function - [ Type.string - , Type.namedWith - [ "Dict" ] - "Dict" - [ Type.string, Type.var "a" ] - ] - (Type.namedWith - [ "Url", "Parser", "Query" ] - "Parser" - [ Type.maybe (Type.var "a") ] - ) - ) - } - ) - [ enumArg_, enumArg_0 ] - , custom = - \customArg_ customArg_0 -> - Elm.apply - (Elm.value - { importFrom = [ "Url", "Parser", "Query" ] - , name = "custom" - , annotation = - Just - (Type.function - [ Type.string - , Type.function - [ Type.list Type.string ] - (Type.var "a") - ] - (Type.namedWith - [ "Url", "Parser", "Query" ] - "Parser" - [ Type.var "a" ] - ) - ) - } - ) - [ customArg_, customArg_0 ] - , map = - \mapArg_ mapArg_0 -> - Elm.apply - (Elm.value - { importFrom = [ "Url", "Parser", "Query" ] - , name = "map" - , annotation = - Just - (Type.function - [ Type.function - [ Type.var "a" ] - (Type.var "b") - , Type.namedWith - [ "Url", "Parser", "Query" ] - "Parser" - [ Type.var "a" ] - ] - (Type.namedWith - [ "Url", "Parser", "Query" ] - "Parser" - [ Type.var "b" ] - ) - ) - } - ) - [ mapArg_, mapArg_0 ] - , map2 = - \map2Arg_ map2Arg_0 map2Arg_1 -> - Elm.apply - (Elm.value - { importFrom = [ "Url", "Parser", "Query" ] - , name = "map2" - , annotation = - Just - (Type.function - [ Type.function - [ Type.var "a", Type.var "b" ] - (Type.var "result") - , Type.namedWith - [ "Url", "Parser", "Query" ] - "Parser" - [ Type.var "a" ] - , Type.namedWith - [ "Url", "Parser", "Query" ] - "Parser" - [ Type.var "b" ] - ] - (Type.namedWith - [ "Url", "Parser", "Query" ] - "Parser" - [ Type.var "result" ] - ) - ) - } - ) - [ map2Arg_, map2Arg_0, map2Arg_1 ] - , map3 = - \map3Arg_ map3Arg_0 map3Arg_1 map3Arg_2 -> - Elm.apply - (Elm.value - { importFrom = [ "Url", "Parser", "Query" ] - , name = "map3" - , annotation = - Just - (Type.function - [ Type.function - [ Type.var "a" - , Type.var "b" - , Type.var "c" - ] - (Type.var "result") - , Type.namedWith - [ "Url", "Parser", "Query" ] - "Parser" - [ Type.var "a" ] - , Type.namedWith - [ "Url", "Parser", "Query" ] - "Parser" - [ Type.var "b" ] - , Type.namedWith - [ "Url", "Parser", "Query" ] - "Parser" - [ Type.var "c" ] - ] - (Type.namedWith - [ "Url", "Parser", "Query" ] - "Parser" - [ Type.var "result" ] - ) - ) - } - ) - [ map3Arg_, map3Arg_0, map3Arg_1, map3Arg_2 ] - , map4 = - \map4Arg_ map4Arg_0 map4Arg_1 map4Arg_2 map4Arg_3 -> - Elm.apply - (Elm.value - { importFrom = [ "Url", "Parser", "Query" ] - , name = "map4" - , annotation = - Just - (Type.function - [ Type.function - [ Type.var "a" - , Type.var "b" - , Type.var "c" - , Type.var "d" - ] - (Type.var "result") - , Type.namedWith - [ "Url", "Parser", "Query" ] - "Parser" - [ Type.var "a" ] - , Type.namedWith - [ "Url", "Parser", "Query" ] - "Parser" - [ Type.var "b" ] - , Type.namedWith - [ "Url", "Parser", "Query" ] - "Parser" - [ Type.var "c" ] - , Type.namedWith - [ "Url", "Parser", "Query" ] - "Parser" - [ Type.var "d" ] - ] - (Type.namedWith - [ "Url", "Parser", "Query" ] - "Parser" - [ Type.var "result" ] - ) - ) - } - ) - [ map4Arg_, map4Arg_0, map4Arg_1, map4Arg_2, map4Arg_3 ] - , map5 = - \map5Arg_ map5Arg_0 map5Arg_1 map5Arg_2 map5Arg_3 map5Arg_4 -> - Elm.apply - (Elm.value - { importFrom = [ "Url", "Parser", "Query" ] - , name = "map5" - , annotation = - Just - (Type.function - [ Type.function - [ Type.var "a" - , Type.var "b" - , Type.var "c" - , Type.var "d" - , Type.var "e" - ] - (Type.var "result") - , Type.namedWith - [ "Url", "Parser", "Query" ] - "Parser" - [ Type.var "a" ] - , Type.namedWith - [ "Url", "Parser", "Query" ] - "Parser" - [ Type.var "b" ] - , Type.namedWith - [ "Url", "Parser", "Query" ] - "Parser" - [ Type.var "c" ] - , Type.namedWith - [ "Url", "Parser", "Query" ] - "Parser" - [ Type.var "d" ] - , Type.namedWith - [ "Url", "Parser", "Query" ] - "Parser" - [ Type.var "e" ] - ] - (Type.namedWith - [ "Url", "Parser", "Query" ] - "Parser" - [ Type.var "result" ] - ) - ) - } - ) - [ map5Arg_ - , map5Arg_0 - , map5Arg_1 - , map5Arg_2 - , map5Arg_3 - , map5Arg_4 - ] - , map6 = - \map6Arg_ map6Arg_0 map6Arg_1 map6Arg_2 map6Arg_3 map6Arg_4 map6Arg_5 -> - Elm.apply - (Elm.value - { importFrom = [ "Url", "Parser", "Query" ] - , name = "map6" - , annotation = - Just - (Type.function - [ Type.function - [ Type.var "a" - , Type.var "b" - , Type.var "c" - , Type.var "d" - , Type.var "e" - , Type.var "f" - ] - (Type.var "result") - , Type.namedWith - [ "Url", "Parser", "Query" ] - "Parser" - [ Type.var "a" ] - , Type.namedWith - [ "Url", "Parser", "Query" ] - "Parser" - [ Type.var "b" ] - , Type.namedWith - [ "Url", "Parser", "Query" ] - "Parser" - [ Type.var "c" ] - , Type.namedWith - [ "Url", "Parser", "Query" ] - "Parser" - [ Type.var "d" ] - , Type.namedWith - [ "Url", "Parser", "Query" ] - "Parser" - [ Type.var "e" ] - , Type.namedWith - [ "Url", "Parser", "Query" ] - "Parser" - [ Type.var "f" ] - ] - (Type.namedWith - [ "Url", "Parser", "Query" ] - "Parser" - [ Type.var "result" ] - ) - ) - } - ) - [ map6Arg_ - , map6Arg_0 - , map6Arg_1 - , map6Arg_2 - , map6Arg_3 - , map6Arg_4 - , map6Arg_5 - ] - , map7 = - \map7Arg_ map7Arg_0 map7Arg_1 map7Arg_2 map7Arg_3 map7Arg_4 map7Arg_5 map7Arg_6 -> - Elm.apply - (Elm.value - { importFrom = [ "Url", "Parser", "Query" ] - , name = "map7" - , annotation = - Just - (Type.function - [ Type.function - [ Type.var "a" - , Type.var "b" - , Type.var "c" - , Type.var "d" - , Type.var "e" - , Type.var "f" - , Type.var "g" - ] - (Type.var "result") - , Type.namedWith - [ "Url", "Parser", "Query" ] - "Parser" - [ Type.var "a" ] - , Type.namedWith - [ "Url", "Parser", "Query" ] - "Parser" - [ Type.var "b" ] - , Type.namedWith - [ "Url", "Parser", "Query" ] - "Parser" - [ Type.var "c" ] - , Type.namedWith - [ "Url", "Parser", "Query" ] - "Parser" - [ Type.var "d" ] - , Type.namedWith - [ "Url", "Parser", "Query" ] - "Parser" - [ Type.var "e" ] - , Type.namedWith - [ "Url", "Parser", "Query" ] - "Parser" - [ Type.var "f" ] - , Type.namedWith - [ "Url", "Parser", "Query" ] - "Parser" - [ Type.var "g" ] - ] - (Type.namedWith - [ "Url", "Parser", "Query" ] - "Parser" - [ Type.var "result" ] - ) - ) - } - ) - [ map7Arg_ - , map7Arg_0 - , map7Arg_1 - , map7Arg_2 - , map7Arg_3 - , map7Arg_4 - , map7Arg_5 - , map7Arg_6 - ] - , map8 = - \map8Arg_ map8Arg_0 map8Arg_1 map8Arg_2 map8Arg_3 map8Arg_4 map8Arg_5 map8Arg_6 map8Arg_7 -> - Elm.apply - (Elm.value - { importFrom = [ "Url", "Parser", "Query" ] - , name = "map8" - , annotation = - Just - (Type.function - [ Type.function - [ Type.var "a" - , Type.var "b" - , Type.var "c" - , Type.var "d" - , Type.var "e" - , Type.var "f" - , Type.var "g" - , Type.var "h" - ] - (Type.var "result") - , Type.namedWith - [ "Url", "Parser", "Query" ] - "Parser" - [ Type.var "a" ] - , Type.namedWith - [ "Url", "Parser", "Query" ] - "Parser" - [ Type.var "b" ] - , Type.namedWith - [ "Url", "Parser", "Query" ] - "Parser" - [ Type.var "c" ] - , Type.namedWith - [ "Url", "Parser", "Query" ] - "Parser" - [ Type.var "d" ] - , Type.namedWith - [ "Url", "Parser", "Query" ] - "Parser" - [ Type.var "e" ] - , Type.namedWith - [ "Url", "Parser", "Query" ] - "Parser" - [ Type.var "f" ] - , Type.namedWith - [ "Url", "Parser", "Query" ] - "Parser" - [ Type.var "g" ] - , Type.namedWith - [ "Url", "Parser", "Query" ] - "Parser" - [ Type.var "h" ] - ] - (Type.namedWith - [ "Url", "Parser", "Query" ] - "Parser" - [ Type.var "result" ] - ) - ) - } - ) - [ map8Arg_ - , map8Arg_0 - , map8Arg_1 - , map8Arg_2 - , map8Arg_3 - , map8Arg_4 - , map8Arg_5 - , map8Arg_6 - , map8Arg_7 - ] - } - - -values_ : - { string : Elm.Expression - , int : Elm.Expression - , enum : Elm.Expression - , custom : Elm.Expression - , map : Elm.Expression - , map2 : Elm.Expression - , map3 : Elm.Expression - , map4 : Elm.Expression - , map5 : Elm.Expression - , map6 : Elm.Expression - , map7 : Elm.Expression - , map8 : Elm.Expression - } -values_ = - { string = - Elm.value - { importFrom = [ "Url", "Parser", "Query" ] - , name = "string" - , annotation = - Just - (Type.function - [ Type.string ] - (Type.namedWith - [ "Url", "Parser", "Query" ] - "Parser" - [ Type.maybe Type.string ] - ) - ) - } - , int = - Elm.value - { importFrom = [ "Url", "Parser", "Query" ] - , name = "int" - , annotation = - Just - (Type.function - [ Type.string ] - (Type.namedWith - [ "Url", "Parser", "Query" ] - "Parser" - [ Type.maybe Type.int ] - ) - ) - } - , enum = - Elm.value - { importFrom = [ "Url", "Parser", "Query" ] - , name = "enum" - , annotation = - Just - (Type.function - [ Type.string - , Type.namedWith - [ "Dict" ] - "Dict" - [ Type.string, Type.var "a" ] - ] - (Type.namedWith - [ "Url", "Parser", "Query" ] - "Parser" - [ Type.maybe (Type.var "a") ] - ) - ) - } - , custom = - Elm.value - { importFrom = [ "Url", "Parser", "Query" ] - , name = "custom" - , annotation = - Just - (Type.function - [ Type.string - , Type.function - [ Type.list Type.string ] - (Type.var "a") - ] - (Type.namedWith - [ "Url", "Parser", "Query" ] - "Parser" - [ Type.var "a" ] - ) - ) - } - , map = - Elm.value - { importFrom = [ "Url", "Parser", "Query" ] - , name = "map" - , annotation = - Just - (Type.function - [ Type.function [ Type.var "a" ] (Type.var "b") - , Type.namedWith - [ "Url", "Parser", "Query" ] - "Parser" - [ Type.var "a" ] - ] - (Type.namedWith - [ "Url", "Parser", "Query" ] - "Parser" - [ Type.var "b" ] - ) - ) - } - , map2 = - Elm.value - { importFrom = [ "Url", "Parser", "Query" ] - , name = "map2" - , annotation = - Just - (Type.function - [ Type.function - [ Type.var "a", Type.var "b" ] - (Type.var "result") - , Type.namedWith - [ "Url", "Parser", "Query" ] - "Parser" - [ Type.var "a" ] - , Type.namedWith - [ "Url", "Parser", "Query" ] - "Parser" - [ Type.var "b" ] - ] - (Type.namedWith - [ "Url", "Parser", "Query" ] - "Parser" - [ Type.var "result" ] - ) - ) - } - , map3 = - Elm.value - { importFrom = [ "Url", "Parser", "Query" ] - , name = "map3" - , annotation = - Just - (Type.function - [ Type.function - [ Type.var "a", Type.var "b", Type.var "c" ] - (Type.var "result") - , Type.namedWith - [ "Url", "Parser", "Query" ] - "Parser" - [ Type.var "a" ] - , Type.namedWith - [ "Url", "Parser", "Query" ] - "Parser" - [ Type.var "b" ] - , Type.namedWith - [ "Url", "Parser", "Query" ] - "Parser" - [ Type.var "c" ] - ] - (Type.namedWith - [ "Url", "Parser", "Query" ] - "Parser" - [ Type.var "result" ] - ) - ) - } - , map4 = - Elm.value - { importFrom = [ "Url", "Parser", "Query" ] - , name = "map4" - , annotation = - Just - (Type.function - [ Type.function - [ Type.var "a" - , Type.var "b" - , Type.var "c" - , Type.var "d" - ] - (Type.var "result") - , Type.namedWith - [ "Url", "Parser", "Query" ] - "Parser" - [ Type.var "a" ] - , Type.namedWith - [ "Url", "Parser", "Query" ] - "Parser" - [ Type.var "b" ] - , Type.namedWith - [ "Url", "Parser", "Query" ] - "Parser" - [ Type.var "c" ] - , Type.namedWith - [ "Url", "Parser", "Query" ] - "Parser" - [ Type.var "d" ] - ] - (Type.namedWith - [ "Url", "Parser", "Query" ] - "Parser" - [ Type.var "result" ] - ) - ) - } - , map5 = - Elm.value - { importFrom = [ "Url", "Parser", "Query" ] - , name = "map5" - , annotation = - Just - (Type.function - [ Type.function - [ Type.var "a" - , Type.var "b" - , Type.var "c" - , Type.var "d" - , Type.var "e" - ] - (Type.var "result") - , Type.namedWith - [ "Url", "Parser", "Query" ] - "Parser" - [ Type.var "a" ] - , Type.namedWith - [ "Url", "Parser", "Query" ] - "Parser" - [ Type.var "b" ] - , Type.namedWith - [ "Url", "Parser", "Query" ] - "Parser" - [ Type.var "c" ] - , Type.namedWith - [ "Url", "Parser", "Query" ] - "Parser" - [ Type.var "d" ] - , Type.namedWith - [ "Url", "Parser", "Query" ] - "Parser" - [ Type.var "e" ] - ] - (Type.namedWith - [ "Url", "Parser", "Query" ] - "Parser" - [ Type.var "result" ] - ) - ) - } - , map6 = - Elm.value - { importFrom = [ "Url", "Parser", "Query" ] - , name = "map6" - , annotation = - Just - (Type.function - [ Type.function - [ Type.var "a" - , Type.var "b" - , Type.var "c" - , Type.var "d" - , Type.var "e" - , Type.var "f" - ] - (Type.var "result") - , Type.namedWith - [ "Url", "Parser", "Query" ] - "Parser" - [ Type.var "a" ] - , Type.namedWith - [ "Url", "Parser", "Query" ] - "Parser" - [ Type.var "b" ] - , Type.namedWith - [ "Url", "Parser", "Query" ] - "Parser" - [ Type.var "c" ] - , Type.namedWith - [ "Url", "Parser", "Query" ] - "Parser" - [ Type.var "d" ] - , Type.namedWith - [ "Url", "Parser", "Query" ] - "Parser" - [ Type.var "e" ] - , Type.namedWith - [ "Url", "Parser", "Query" ] - "Parser" - [ Type.var "f" ] - ] - (Type.namedWith - [ "Url", "Parser", "Query" ] - "Parser" - [ Type.var "result" ] - ) - ) - } - , map7 = - Elm.value - { importFrom = [ "Url", "Parser", "Query" ] - , name = "map7" - , annotation = - Just - (Type.function - [ Type.function - [ Type.var "a" - , Type.var "b" - , Type.var "c" - , Type.var "d" - , Type.var "e" - , Type.var "f" - , Type.var "g" - ] - (Type.var "result") - , Type.namedWith - [ "Url", "Parser", "Query" ] - "Parser" - [ Type.var "a" ] - , Type.namedWith - [ "Url", "Parser", "Query" ] - "Parser" - [ Type.var "b" ] - , Type.namedWith - [ "Url", "Parser", "Query" ] - "Parser" - [ Type.var "c" ] - , Type.namedWith - [ "Url", "Parser", "Query" ] - "Parser" - [ Type.var "d" ] - , Type.namedWith - [ "Url", "Parser", "Query" ] - "Parser" - [ Type.var "e" ] - , Type.namedWith - [ "Url", "Parser", "Query" ] - "Parser" - [ Type.var "f" ] - , Type.namedWith - [ "Url", "Parser", "Query" ] - "Parser" - [ Type.var "g" ] - ] - (Type.namedWith - [ "Url", "Parser", "Query" ] - "Parser" - [ Type.var "result" ] - ) - ) - } - , map8 = - Elm.value - { importFrom = [ "Url", "Parser", "Query" ] - , name = "map8" - , annotation = - Just - (Type.function - [ Type.function - [ Type.var "a" - , Type.var "b" - , Type.var "c" - , Type.var "d" - , Type.var "e" - , Type.var "f" - , Type.var "g" - , Type.var "h" - ] - (Type.var "result") - , Type.namedWith - [ "Url", "Parser", "Query" ] - "Parser" - [ Type.var "a" ] - , Type.namedWith - [ "Url", "Parser", "Query" ] - "Parser" - [ Type.var "b" ] - , Type.namedWith - [ "Url", "Parser", "Query" ] - "Parser" - [ Type.var "c" ] - , Type.namedWith - [ "Url", "Parser", "Query" ] - "Parser" - [ Type.var "d" ] - , Type.namedWith - [ "Url", "Parser", "Query" ] - "Parser" - [ Type.var "e" ] - , Type.namedWith - [ "Url", "Parser", "Query" ] - "Parser" - [ Type.var "f" ] - , Type.namedWith - [ "Url", "Parser", "Query" ] - "Parser" - [ Type.var "g" ] - , Type.namedWith - [ "Url", "Parser", "Query" ] - "Parser" - [ Type.var "h" ] - ] - (Type.namedWith - [ "Url", "Parser", "Query" ] - "Parser" - [ Type.var "result" ] - ) - ) - } - } \ No newline at end of file diff --git a/elm-open-api-codegen/src/Gen/UrlPath.elm b/elm-open-api-codegen/src/Gen/UrlPath.elm deleted file mode 100644 index 643049c1..00000000 --- a/elm-open-api-codegen/src/Gen/UrlPath.elm +++ /dev/null @@ -1,276 +0,0 @@ -module Gen.UrlPath exposing - ( moduleName_, join, fromString, toAbsolute, toRelative, toSegments - , annotation_, call_, values_ - ) - -{-| -# Generated bindings for UrlPath - -@docs moduleName_, join, fromString, toAbsolute, toRelative, toSegments -@docs annotation_, call_, values_ --} - - -import Elm -import Elm.Annotation as Type - - -{-| The name of this module. -} -moduleName_ : List String -moduleName_ = - [ "UrlPath" ] - - -{-| Turn a Path to a relative URL. - -join: UrlPath.UrlPath -> UrlPath.UrlPath --} -join : Elm.Expression -> Elm.Expression -join joinArg_ = - Elm.apply - (Elm.value - { importFrom = [ "UrlPath" ] - , name = "join" - , annotation = - Just - (Type.function - [ Type.namedWith [ "UrlPath" ] "UrlPath" [] ] - (Type.namedWith [ "UrlPath" ] "UrlPath" []) - ) - } - ) - [ joinArg_ ] - - -{-| Create a UrlPath from a path String. - - UrlPath.fromString "blog/post-1/" - |> UrlPath.toAbsolute - |> Expect.equal "/blog/post-1" - -fromString: String -> UrlPath.UrlPath --} -fromString : String -> Elm.Expression -fromString fromStringArg_ = - Elm.apply - (Elm.value - { importFrom = [ "UrlPath" ] - , name = "fromString" - , annotation = - Just - (Type.function - [ Type.string ] - (Type.namedWith [ "UrlPath" ] "UrlPath" []) - ) - } - ) - [ Elm.string fromStringArg_ ] - - -{-| Turn a UrlPath to an absolute URL (with no trailing slash). - -toAbsolute: UrlPath.UrlPath -> String --} -toAbsolute : Elm.Expression -> Elm.Expression -toAbsolute toAbsoluteArg_ = - Elm.apply - (Elm.value - { importFrom = [ "UrlPath" ] - , name = "toAbsolute" - , annotation = - Just - (Type.function - [ Type.namedWith [ "UrlPath" ] "UrlPath" [] ] - Type.string - ) - } - ) - [ toAbsoluteArg_ ] - - -{-| Turn a UrlPath to a relative URL. - -toRelative: UrlPath.UrlPath -> String --} -toRelative : Elm.Expression -> Elm.Expression -toRelative toRelativeArg_ = - Elm.apply - (Elm.value - { importFrom = [ "UrlPath" ] - , name = "toRelative" - , annotation = - Just - (Type.function - [ Type.namedWith [ "UrlPath" ] "UrlPath" [] ] - Type.string - ) - } - ) - [ toRelativeArg_ ] - - -{-| toSegments: String -> List String -} -toSegments : String -> Elm.Expression -toSegments toSegmentsArg_ = - Elm.apply - (Elm.value - { importFrom = [ "UrlPath" ] - , name = "toSegments" - , annotation = - Just (Type.function [ Type.string ] (Type.list Type.string)) - } - ) - [ Elm.string toSegmentsArg_ ] - - -annotation_ : { urlPath : Type.Annotation } -annotation_ = - { urlPath = Type.alias moduleName_ "UrlPath" [] (Type.list Type.string) } - - -call_ : - { join : Elm.Expression -> Elm.Expression - , fromString : Elm.Expression -> Elm.Expression - , toAbsolute : Elm.Expression -> Elm.Expression - , toRelative : Elm.Expression -> Elm.Expression - , toSegments : Elm.Expression -> Elm.Expression - } -call_ = - { join = - \joinArg_ -> - Elm.apply - (Elm.value - { importFrom = [ "UrlPath" ] - , name = "join" - , annotation = - Just - (Type.function - [ Type.namedWith [ "UrlPath" ] "UrlPath" [] ] - (Type.namedWith [ "UrlPath" ] "UrlPath" []) - ) - } - ) - [ joinArg_ ] - , fromString = - \fromStringArg_ -> - Elm.apply - (Elm.value - { importFrom = [ "UrlPath" ] - , name = "fromString" - , annotation = - Just - (Type.function - [ Type.string ] - (Type.namedWith [ "UrlPath" ] "UrlPath" []) - ) - } - ) - [ fromStringArg_ ] - , toAbsolute = - \toAbsoluteArg_ -> - Elm.apply - (Elm.value - { importFrom = [ "UrlPath" ] - , name = "toAbsolute" - , annotation = - Just - (Type.function - [ Type.namedWith [ "UrlPath" ] "UrlPath" [] ] - Type.string - ) - } - ) - [ toAbsoluteArg_ ] - , toRelative = - \toRelativeArg_ -> - Elm.apply - (Elm.value - { importFrom = [ "UrlPath" ] - , name = "toRelative" - , annotation = - Just - (Type.function - [ Type.namedWith [ "UrlPath" ] "UrlPath" [] ] - Type.string - ) - } - ) - [ toRelativeArg_ ] - , toSegments = - \toSegmentsArg_ -> - Elm.apply - (Elm.value - { importFrom = [ "UrlPath" ] - , name = "toSegments" - , annotation = - Just - (Type.function - [ Type.string ] - (Type.list Type.string) - ) - } - ) - [ toSegmentsArg_ ] - } - - -values_ : - { join : Elm.Expression - , fromString : Elm.Expression - , toAbsolute : Elm.Expression - , toRelative : Elm.Expression - , toSegments : Elm.Expression - } -values_ = - { join = - Elm.value - { importFrom = [ "UrlPath" ] - , name = "join" - , annotation = - Just - (Type.function - [ Type.namedWith [ "UrlPath" ] "UrlPath" [] ] - (Type.namedWith [ "UrlPath" ] "UrlPath" []) - ) - } - , fromString = - Elm.value - { importFrom = [ "UrlPath" ] - , name = "fromString" - , annotation = - Just - (Type.function - [ Type.string ] - (Type.namedWith [ "UrlPath" ] "UrlPath" []) - ) - } - , toAbsolute = - Elm.value - { importFrom = [ "UrlPath" ] - , name = "toAbsolute" - , annotation = - Just - (Type.function - [ Type.namedWith [ "UrlPath" ] "UrlPath" [] ] - Type.string - ) - } - , toRelative = - Elm.value - { importFrom = [ "UrlPath" ] - , name = "toRelative" - , annotation = - Just - (Type.function - [ Type.namedWith [ "UrlPath" ] "UrlPath" [] ] - Type.string - ) - } - , toSegments = - Elm.value - { importFrom = [ "UrlPath" ] - , name = "toSegments" - , annotation = - Just (Type.function [ Type.string ] (Type.list Type.string)) - } - } \ No newline at end of file From 1d4cdb29b8589e1bf126def48c13ce607ce119eb Mon Sep 17 00:00:00 2001 From: Adam DiCarlo Date: Wed, 2 Jul 2025 18:37:23 -0700 Subject: [PATCH 32/33] Resolve security vulnerabilities in dependencies --- package-lock.json | 3371 +++++++++++++++++++++------------------------ package.json | 7 +- 2 files changed, 1538 insertions(+), 1840 deletions(-) diff --git a/package-lock.json b/package-lock.json index 2983a8ba..184ca669 100644 --- a/package-lock.json +++ b/package-lock.json @@ -13,44 +13,53 @@ }, "devDependencies": { "@lydell/elm-json": "0.2.13-1", - "@redocly/cli": "1.11.0", + "@redocly/cli": "^1.34.4", "elm-codegen": "^0.6.1", - "elm-optimize-level-2": "0.3.5", + "elm-optimize-level-2": "^0.3.5", "elm-pages": "^3.0.24", "run-pty": "^5.0.0", "vite": "^6.0.3" } }, - "node_modules/@babel/runtime": { - "version": "7.26.0", + "node_modules/@babel/code-frame": { + "version": "7.27.1", + "resolved": "https://registry.npmjs.org/@babel/code-frame/-/code-frame-7.27.1.tgz", + "integrity": "sha512-cjQ7ZlQ0Mv3b47hABuTevyTuYN4i+loJKGeV9flcCgIK37cCXRh+L1bd3iBHlynerhQ7BhCkn2BPbQUL+rGqFg==", "dev": true, "license": "MIT", "dependencies": { - "regenerator-runtime": "^0.14.0" + "@babel/helper-validator-identifier": "^7.27.1", + "js-tokens": "^4.0.0", + "picocolors": "^1.1.1" }, "engines": { "node": ">=6.9.0" } }, - "node_modules/@cfaester/enzyme-adapter-react-18": { - "version": "0.8.0", + "node_modules/@babel/helper-validator-identifier": { + "version": "7.27.1", + "resolved": "https://registry.npmjs.org/@babel/helper-validator-identifier/-/helper-validator-identifier-7.27.1.tgz", + "integrity": "sha512-D2hP9eA+Sqx1kBZgzxZh0y1trbuU+JoDkiEwqhQ36nodYqJwyEIhPSdMNd7lOm/4io72luTPWH20Yda0xOuUow==", "dev": true, "license": "MIT", - "dependencies": { - "enzyme-shallow-equal": "^1.0.0", - "function.prototype.name": "^1.1.6", - "has": "^1.0.4", - "react-is": "^18.2.0", - "react-shallow-renderer": "^16.15.0" - }, - "peerDependencies": { - "enzyme": "^3.11.0", - "react": ">=18", - "react-dom": ">=18" + "engines": { + "node": ">=6.9.0" + } + }, + "node_modules/@babel/runtime": { + "version": "7.27.6", + "resolved": "https://registry.npmjs.org/@babel/runtime/-/runtime-7.27.6.tgz", + "integrity": "sha512-vbavdySgbTTrmFE+EsiqUTzlOr5bzlnJtUv9PynGCAKvfQqjIXbvFdumPM/GxMDfyuGMJaJAU6TO4zc1Jf1i8Q==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=6.9.0" } }, "node_modules/@emotion/is-prop-valid": { "version": "1.2.2", + "resolved": "https://registry.npmjs.org/@emotion/is-prop-valid/-/is-prop-valid-1.2.2.tgz", + "integrity": "sha512-uNsoYd37AFmaCdXlg6EYD1KaPOaRWRByMCYzbKUX4+hhMfrxdVSelShywL4JVaAeM/eHUOSprYBQls+/neX3pw==", "dev": true, "license": "MIT", "dependencies": { @@ -59,11 +68,15 @@ }, "node_modules/@emotion/memoize": { "version": "0.8.1", + "resolved": "https://registry.npmjs.org/@emotion/memoize/-/memoize-0.8.1.tgz", + "integrity": "sha512-W2P2c/VRW1/1tLox0mVUalvnWXxavmv/Oum2aPsRcoDJuob75FC3Y8FbpfLwUegRcxINtGUMPq0tFCvYNTBXNA==", "dev": true, "license": "MIT" }, "node_modules/@emotion/unitless": { "version": "0.8.1", + "resolved": "https://registry.npmjs.org/@emotion/unitless/-/unitless-0.8.1.tgz", + "integrity": "sha512-KOEGMu6dmJZtpadb476IsZBclKvILjopjUii3V+7MnXIQCYh8W3NgNcgwo21n9LXZX6EDIKvqfjYxXebDwxKmQ==", "dev": true, "license": "MIT" }, @@ -494,9 +507,32 @@ }, "node_modules/@exodus/schemasafe": { "version": "1.3.0", + "resolved": "https://registry.npmjs.org/@exodus/schemasafe/-/schemasafe-1.3.0.tgz", + "integrity": "sha512-5Aap/GaRupgNx/feGBwLLTVv8OQFfv3pq2lPRzPg9R+IOBnDgghTGW7l7EuVXOvg5cc/xSAlRW8rBrjIC3Nvqw==", "dev": true, "license": "MIT" }, + "node_modules/@faker-js/faker": { + "version": "7.6.0", + "resolved": "https://registry.npmjs.org/@faker-js/faker/-/faker-7.6.0.tgz", + "integrity": "sha512-XK6BTq1NDMo9Xqw/YkYyGjSsg44fbNwYRx7QK2CuoQgyy+f1rrTDHoExVM5PsyXCtfl2vs2vVJ0MN0yN6LppRw==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=14.0.0", + "npm": ">=6.0.0" + } + }, + "node_modules/@humanwhocodes/momoa": { + "version": "2.0.4", + "resolved": "https://registry.npmjs.org/@humanwhocodes/momoa/-/momoa-2.0.4.tgz", + "integrity": "sha512-RE815I4arJFtt+FVeU1Tgp9/Xvecacji8w/V6XtXsWWH/wz/eNkNbhb+ny/+PlVZjV0rxQpRSQKNKE3lcktHEA==", + "dev": true, + "license": "Apache-2.0", + "engines": { + "node": ">=10.10.0" + } + }, "node_modules/@isaacs/balanced-match": { "version": "4.0.1", "resolved": "https://registry.npmjs.org/@isaacs/balanced-match/-/balanced-match-4.0.1.tgz", @@ -620,29 +656,32 @@ "node": ">=18.0.0" } }, - "node_modules/@jridgewell/gen-mapping": { - "version": "0.3.8", + "node_modules/@jest/schemas": { + "version": "29.6.3", + "resolved": "https://registry.npmjs.org/@jest/schemas/-/schemas-29.6.3.tgz", + "integrity": "sha512-mo5j5X+jIZmJQveBKeS/clAueipV7KgiX1vMgCxam1RNYiqE1w62n0/tJJnHtjW8ZHcQco5gY85jA3mi0L+nSA==", "dev": true, "license": "MIT", "dependencies": { - "@jridgewell/set-array": "^1.2.1", - "@jridgewell/sourcemap-codec": "^1.4.10", - "@jridgewell/trace-mapping": "^0.3.24" + "@sinclair/typebox": "^0.27.8" }, "engines": { - "node": ">=6.0.0" + "node": "^14.15.0 || ^16.10.0 || >=18.0.0" } }, - "node_modules/@jridgewell/resolve-uri": { - "version": "3.1.2", + "node_modules/@jridgewell/gen-mapping": { + "version": "0.3.12", + "resolved": "https://registry.npmjs.org/@jridgewell/gen-mapping/-/gen-mapping-0.3.12.tgz", + "integrity": "sha512-OuLGC46TjB5BbN1dH8JULVVZY4WTdkF7tV9Ys6wLL1rubZnCMstOhNHueU5bLCrnRuDhKPDM4g6sw4Bel5Gzqg==", "dev": true, "license": "MIT", - "engines": { - "node": ">=6.0.0" + "dependencies": { + "@jridgewell/sourcemap-codec": "^1.5.0", + "@jridgewell/trace-mapping": "^0.3.24" } }, - "node_modules/@jridgewell/set-array": { - "version": "1.2.1", + "node_modules/@jridgewell/resolve-uri": { + "version": "3.1.2", "dev": true, "license": "MIT", "engines": { @@ -664,7 +703,9 @@ "license": "MIT" }, "node_modules/@jridgewell/trace-mapping": { - "version": "0.3.25", + "version": "0.3.29", + "resolved": "https://registry.npmjs.org/@jridgewell/trace-mapping/-/trace-mapping-0.3.29.tgz", + "integrity": "sha512-uw6guiW/gcAGPDhLmd77/6lW8QLeiV5RUTsAX46Db6oLhGaVj4lhnPwb184s1bkc8kdVg/+h988dro8GRDpmYQ==", "dev": true, "license": "MIT", "dependencies": { @@ -672,6 +713,32 @@ "@jridgewell/sourcemap-codec": "^1.4.14" } }, + "node_modules/@jsep-plugin/assignment": { + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/@jsep-plugin/assignment/-/assignment-1.3.0.tgz", + "integrity": "sha512-VVgV+CXrhbMI3aSusQyclHkenWSAm95WaiKrMxRFam3JSUiIaQjoMIw2sEs/OX4XifnqeQUN4DYbJjlA8EfktQ==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">= 10.16.0" + }, + "peerDependencies": { + "jsep": "^0.4.0||^1.0.0" + } + }, + "node_modules/@jsep-plugin/regex": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/@jsep-plugin/regex/-/regex-1.0.4.tgz", + "integrity": "sha512-q7qL4Mgjs1vByCaTnDFcBnV9HS7GVPJX5vyVoCgZHNSC9rjwIlmbXG5sUuorR5ndfHAIlJ8pVStxvjXHbNvtUg==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">= 10.16.0" + }, + "peerDependencies": { + "jsep": "^0.4.0||^1.0.0" + } + }, "node_modules/@jsonjoy.com/base64": { "version": "1.1.2", "resolved": "https://registry.npmjs.org/@jsonjoy.com/base64/-/base64-1.1.2.tgz", @@ -920,6 +987,250 @@ "node": "^18.17.0 || >=20.5.0" } }, + "node_modules/@opentelemetry/api": { + "version": "1.9.0", + "resolved": "https://registry.npmjs.org/@opentelemetry/api/-/api-1.9.0.tgz", + "integrity": "sha512-3giAOQvZiH5F9bMlMiv8+GSPMeqg0dbaeo58/0SlA9sxSqZhnUtxzX9/2FzyhS9sWQf5S0GJE0AKBrFqjpeYcg==", + "dev": true, + "license": "Apache-2.0", + "engines": { + "node": ">=8.0.0" + } + }, + "node_modules/@opentelemetry/api-logs": { + "version": "0.53.0", + "resolved": "https://registry.npmjs.org/@opentelemetry/api-logs/-/api-logs-0.53.0.tgz", + "integrity": "sha512-8HArjKx+RaAI8uEIgcORbZIPklyh1YLjPSBus8hjRmvLi6DeFzgOcdZ7KwPabKj8mXF8dX0hyfAyGfycz0DbFw==", + "dev": true, + "license": "Apache-2.0", + "dependencies": { + "@opentelemetry/api": "^1.0.0" + }, + "engines": { + "node": ">=14" + } + }, + "node_modules/@opentelemetry/context-async-hooks": { + "version": "1.26.0", + "resolved": "https://registry.npmjs.org/@opentelemetry/context-async-hooks/-/context-async-hooks-1.26.0.tgz", + "integrity": "sha512-HedpXXYzzbaoutw6DFLWLDket2FwLkLpil4hGCZ1xYEIMTcivdfwEOISgdbLEWyG3HW52gTq2V9mOVJrONgiwg==", + "dev": true, + "license": "Apache-2.0", + "engines": { + "node": ">=14" + }, + "peerDependencies": { + "@opentelemetry/api": ">=1.0.0 <1.10.0" + } + }, + "node_modules/@opentelemetry/core": { + "version": "1.26.0", + "resolved": "https://registry.npmjs.org/@opentelemetry/core/-/core-1.26.0.tgz", + "integrity": "sha512-1iKxXXE8415Cdv0yjG3G6hQnB5eVEsJce3QaawX8SjDn0mAS0ZM8fAbZZJD4ajvhC15cePvosSCut404KrIIvQ==", + "dev": true, + "license": "Apache-2.0", + "dependencies": { + "@opentelemetry/semantic-conventions": "1.27.0" + }, + "engines": { + "node": ">=14" + }, + "peerDependencies": { + "@opentelemetry/api": ">=1.0.0 <1.10.0" + } + }, + "node_modules/@opentelemetry/exporter-trace-otlp-http": { + "version": "0.53.0", + "resolved": "https://registry.npmjs.org/@opentelemetry/exporter-trace-otlp-http/-/exporter-trace-otlp-http-0.53.0.tgz", + "integrity": "sha512-m7F5ZTq+V9mKGWYpX8EnZ7NjoqAU7VemQ1E2HAG+W/u0wpY1x0OmbxAXfGKFHCspdJk8UKlwPGrpcB8nay3P8A==", + "dev": true, + "license": "Apache-2.0", + "dependencies": { + "@opentelemetry/core": "1.26.0", + "@opentelemetry/otlp-exporter-base": "0.53.0", + "@opentelemetry/otlp-transformer": "0.53.0", + "@opentelemetry/resources": "1.26.0", + "@opentelemetry/sdk-trace-base": "1.26.0" + }, + "engines": { + "node": ">=14" + }, + "peerDependencies": { + "@opentelemetry/api": "^1.0.0" + } + }, + "node_modules/@opentelemetry/otlp-exporter-base": { + "version": "0.53.0", + "resolved": "https://registry.npmjs.org/@opentelemetry/otlp-exporter-base/-/otlp-exporter-base-0.53.0.tgz", + "integrity": "sha512-UCWPreGQEhD6FjBaeDuXhiMf6kkBODF0ZQzrk/tuQcaVDJ+dDQ/xhJp192H9yWnKxVpEjFrSSLnpqmX4VwX+eA==", + "dev": true, + "license": "Apache-2.0", + "dependencies": { + "@opentelemetry/core": "1.26.0", + "@opentelemetry/otlp-transformer": "0.53.0" + }, + "engines": { + "node": ">=14" + }, + "peerDependencies": { + "@opentelemetry/api": "^1.0.0" + } + }, + "node_modules/@opentelemetry/otlp-transformer": { + "version": "0.53.0", + "resolved": "https://registry.npmjs.org/@opentelemetry/otlp-transformer/-/otlp-transformer-0.53.0.tgz", + "integrity": "sha512-rM0sDA9HD8dluwuBxLetUmoqGJKSAbWenwD65KY9iZhUxdBHRLrIdrABfNDP7aiTjcgK8XFyTn5fhDz7N+W6DA==", + "dev": true, + "license": "Apache-2.0", + "dependencies": { + "@opentelemetry/api-logs": "0.53.0", + "@opentelemetry/core": "1.26.0", + "@opentelemetry/resources": "1.26.0", + "@opentelemetry/sdk-logs": "0.53.0", + "@opentelemetry/sdk-metrics": "1.26.0", + "@opentelemetry/sdk-trace-base": "1.26.0", + "protobufjs": "^7.3.0" + }, + "engines": { + "node": ">=14" + }, + "peerDependencies": { + "@opentelemetry/api": "^1.3.0" + } + }, + "node_modules/@opentelemetry/propagator-b3": { + "version": "1.26.0", + "resolved": "https://registry.npmjs.org/@opentelemetry/propagator-b3/-/propagator-b3-1.26.0.tgz", + "integrity": "sha512-vvVkQLQ/lGGyEy9GT8uFnI047pajSOVnZI2poJqVGD3nJ+B9sFGdlHNnQKophE3lHfnIH0pw2ubrCTjZCgIj+Q==", + "dev": true, + "license": "Apache-2.0", + "dependencies": { + "@opentelemetry/core": "1.26.0" + }, + "engines": { + "node": ">=14" + }, + "peerDependencies": { + "@opentelemetry/api": ">=1.0.0 <1.10.0" + } + }, + "node_modules/@opentelemetry/propagator-jaeger": { + "version": "1.26.0", + "resolved": "https://registry.npmjs.org/@opentelemetry/propagator-jaeger/-/propagator-jaeger-1.26.0.tgz", + "integrity": "sha512-DelFGkCdaxA1C/QA0Xilszfr0t4YbGd3DjxiCDPh34lfnFr+VkkrjV9S8ZTJvAzfdKERXhfOxIKBoGPJwoSz7Q==", + "dev": true, + "license": "Apache-2.0", + "dependencies": { + "@opentelemetry/core": "1.26.0" + }, + "engines": { + "node": ">=14" + }, + "peerDependencies": { + "@opentelemetry/api": ">=1.0.0 <1.10.0" + } + }, + "node_modules/@opentelemetry/resources": { + "version": "1.26.0", + "resolved": "https://registry.npmjs.org/@opentelemetry/resources/-/resources-1.26.0.tgz", + "integrity": "sha512-CPNYchBE7MBecCSVy0HKpUISEeJOniWqcHaAHpmasZ3j9o6V3AyBzhRc90jdmemq0HOxDr6ylhUbDhBqqPpeNw==", + "dev": true, + "license": "Apache-2.0", + "dependencies": { + "@opentelemetry/core": "1.26.0", + "@opentelemetry/semantic-conventions": "1.27.0" + }, + "engines": { + "node": ">=14" + }, + "peerDependencies": { + "@opentelemetry/api": ">=1.0.0 <1.10.0" + } + }, + "node_modules/@opentelemetry/sdk-logs": { + "version": "0.53.0", + "resolved": "https://registry.npmjs.org/@opentelemetry/sdk-logs/-/sdk-logs-0.53.0.tgz", + "integrity": "sha512-dhSisnEgIj/vJZXZV6f6KcTnyLDx/VuQ6l3ejuZpMpPlh9S1qMHiZU9NMmOkVkwwHkMy3G6mEBwdP23vUZVr4g==", + "dev": true, + "license": "Apache-2.0", + "dependencies": { + "@opentelemetry/api-logs": "0.53.0", + "@opentelemetry/core": "1.26.0", + "@opentelemetry/resources": "1.26.0" + }, + "engines": { + "node": ">=14" + }, + "peerDependencies": { + "@opentelemetry/api": ">=1.4.0 <1.10.0" + } + }, + "node_modules/@opentelemetry/sdk-metrics": { + "version": "1.26.0", + "resolved": "https://registry.npmjs.org/@opentelemetry/sdk-metrics/-/sdk-metrics-1.26.0.tgz", + "integrity": "sha512-0SvDXmou/JjzSDOjUmetAAvcKQW6ZrvosU0rkbDGpXvvZN+pQF6JbK/Kd4hNdK4q/22yeruqvukXEJyySTzyTQ==", + "dev": true, + "license": "Apache-2.0", + "dependencies": { + "@opentelemetry/core": "1.26.0", + "@opentelemetry/resources": "1.26.0" + }, + "engines": { + "node": ">=14" + }, + "peerDependencies": { + "@opentelemetry/api": ">=1.3.0 <1.10.0" + } + }, + "node_modules/@opentelemetry/sdk-trace-base": { + "version": "1.26.0", + "resolved": "https://registry.npmjs.org/@opentelemetry/sdk-trace-base/-/sdk-trace-base-1.26.0.tgz", + "integrity": "sha512-olWQldtvbK4v22ymrKLbIcBi9L2SpMO84sCPY54IVsJhP9fRsxJT194C/AVaAuJzLE30EdhhM1VmvVYR7az+cw==", + "dev": true, + "license": "Apache-2.0", + "dependencies": { + "@opentelemetry/core": "1.26.0", + "@opentelemetry/resources": "1.26.0", + "@opentelemetry/semantic-conventions": "1.27.0" + }, + "engines": { + "node": ">=14" + }, + "peerDependencies": { + "@opentelemetry/api": ">=1.0.0 <1.10.0" + } + }, + "node_modules/@opentelemetry/sdk-trace-node": { + "version": "1.26.0", + "resolved": "https://registry.npmjs.org/@opentelemetry/sdk-trace-node/-/sdk-trace-node-1.26.0.tgz", + "integrity": "sha512-Fj5IVKrj0yeUwlewCRwzOVcr5avTuNnMHWf7GPc1t6WaT78J6CJyF3saZ/0RkZfdeNO8IcBl/bNcWMVZBMRW8Q==", + "dev": true, + "license": "Apache-2.0", + "dependencies": { + "@opentelemetry/context-async-hooks": "1.26.0", + "@opentelemetry/core": "1.26.0", + "@opentelemetry/propagator-b3": "1.26.0", + "@opentelemetry/propagator-jaeger": "1.26.0", + "@opentelemetry/sdk-trace-base": "1.26.0", + "semver": "^7.5.2" + }, + "engines": { + "node": ">=14" + }, + "peerDependencies": { + "@opentelemetry/api": ">=1.0.0 <1.10.0" + } + }, + "node_modules/@opentelemetry/semantic-conventions": { + "version": "1.27.0", + "resolved": "https://registry.npmjs.org/@opentelemetry/semantic-conventions/-/semantic-conventions-1.27.0.tgz", + "integrity": "sha512-sAay1RrB+ONOem0OZanAR1ZI/k7yDpnOQSQmTMuGImUQb2y8EbSaCJ94FQluM74xoU03vlb2d2U90hZluL6nQg==", + "dev": true, + "license": "Apache-2.0", + "engines": { + "node": ">=14" + } + }, "node_modules/@pkgjs/parseargs": { "version": "0.11.0", "dev": true, @@ -974,8 +1285,84 @@ "node": ">=12" } }, + "node_modules/@protobufjs/aspromise": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/@protobufjs/aspromise/-/aspromise-1.1.2.tgz", + "integrity": "sha512-j+gKExEuLmKwvz3OgROXtrJ2UG2x8Ch2YZUxahh+s1F2HZ+wAceUNLkvy6zKCPVRkU++ZWQrdxsUeQXmcg4uoQ==", + "dev": true, + "license": "BSD-3-Clause" + }, + "node_modules/@protobufjs/base64": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/@protobufjs/base64/-/base64-1.1.2.tgz", + "integrity": "sha512-AZkcAA5vnN/v4PDqKyMR5lx7hZttPDgClv83E//FMNhR2TMcLUhfRUBHCmSl0oi9zMgDDqRUJkSxO3wm85+XLg==", + "dev": true, + "license": "BSD-3-Clause" + }, + "node_modules/@protobufjs/codegen": { + "version": "2.0.4", + "resolved": "https://registry.npmjs.org/@protobufjs/codegen/-/codegen-2.0.4.tgz", + "integrity": "sha512-YyFaikqM5sH0ziFZCN3xDC7zeGaB/d0IUb9CATugHWbd1FRFwWwt4ld4OYMPWu5a3Xe01mGAULCdqhMlPl29Jg==", + "dev": true, + "license": "BSD-3-Clause" + }, + "node_modules/@protobufjs/eventemitter": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/@protobufjs/eventemitter/-/eventemitter-1.1.0.tgz", + "integrity": "sha512-j9ednRT81vYJ9OfVuXG6ERSTdEL1xVsNgqpkxMsbIabzSo3goCjDIveeGv5d03om39ML71RdmrGNjG5SReBP/Q==", + "dev": true, + "license": "BSD-3-Clause" + }, + "node_modules/@protobufjs/fetch": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/@protobufjs/fetch/-/fetch-1.1.0.tgz", + "integrity": "sha512-lljVXpqXebpsijW71PZaCYeIcE5on1w5DlQy5WH6GLbFryLUrBD4932W/E2BSpfRJWseIL4v/KPgBFxDOIdKpQ==", + "dev": true, + "license": "BSD-3-Clause", + "dependencies": { + "@protobufjs/aspromise": "^1.1.1", + "@protobufjs/inquire": "^1.1.0" + } + }, + "node_modules/@protobufjs/float": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/@protobufjs/float/-/float-1.0.2.tgz", + "integrity": "sha512-Ddb+kVXlXst9d+R9PfTIxh1EdNkgoRe5tOX6t01f1lYWOvJnSPDBlG241QLzcyPdoNTsblLUdujGSE4RzrTZGQ==", + "dev": true, + "license": "BSD-3-Clause" + }, + "node_modules/@protobufjs/inquire": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/@protobufjs/inquire/-/inquire-1.1.0.tgz", + "integrity": "sha512-kdSefcPdruJiFMVSbn801t4vFK7KB/5gd2fYvrxhuJYg8ILrmn9SKSX2tZdV6V+ksulWqS7aXjBcRXl3wHoD9Q==", + "dev": true, + "license": "BSD-3-Clause" + }, + "node_modules/@protobufjs/path": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/@protobufjs/path/-/path-1.1.2.tgz", + "integrity": "sha512-6JOcJ5Tm08dOHAbdR3GrvP+yUUfkjG5ePsHYczMFLq3ZmMkAD98cDgcT2iA1lJ9NVwFd4tH/iSSoe44YWkltEA==", + "dev": true, + "license": "BSD-3-Clause" + }, + "node_modules/@protobufjs/pool": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/@protobufjs/pool/-/pool-1.1.0.tgz", + "integrity": "sha512-0kELaGSIDBKvcgS4zkjz1PeddatrjYcmMWOlAuAPwAeccUrPHdUqo/J6LiymHHEiJT5NrF1UVwxY14f+fy4WQw==", + "dev": true, + "license": "BSD-3-Clause" + }, + "node_modules/@protobufjs/utf8": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/@protobufjs/utf8/-/utf8-1.1.0.tgz", + "integrity": "sha512-Vvn3zZrhQZkkBE8LSuW3em98c0FwgO4nxzv6OdSxPKJIEKY2bGbHn+mhGIPerzI4twdxaP8/0+06HBpwf345Lw==", + "dev": true, + "license": "BSD-3-Clause" + }, "node_modules/@redocly/ajv": { "version": "8.11.2", + "resolved": "https://registry.npmjs.org/@redocly/ajv/-/ajv-8.11.2.tgz", + "integrity": "sha512-io1JpnwtIcvojV7QKDUSIuMN/ikdOUd1ReEnUnMKGfDVridQZ31J0MmIuqwuRjWDZfmvr+Q0MqCcfHM2gTivOg==", "dev": true, "license": "MIT", "dependencies": { @@ -990,24 +1377,34 @@ } }, "node_modules/@redocly/cli": { - "version": "1.11.0", + "version": "1.34.4", + "resolved": "https://registry.npmjs.org/@redocly/cli/-/cli-1.34.4.tgz", + "integrity": "sha512-seH/GgrjSB1EeOsgJ/4Ct6Jk2N7sh12POn/7G8UQFARMyUMJpe1oHtBwT2ndfp4EFCpgBAbZ/82Iw6dwczNxEA==", "dev": true, "license": "MIT", "dependencies": { - "@redocly/openapi-core": "1.11.0", + "@opentelemetry/api": "1.9.0", + "@opentelemetry/exporter-trace-otlp-http": "0.53.0", + "@opentelemetry/resources": "1.26.0", + "@opentelemetry/sdk-trace-node": "1.26.0", + "@opentelemetry/semantic-conventions": "1.27.0", + "@redocly/config": "^0.22.0", + "@redocly/openapi-core": "1.34.4", + "@redocly/respect-core": "1.34.4", "abort-controller": "^3.0.0", "chokidar": "^3.5.1", "colorette": "^1.2.0", "core-js": "^3.32.1", + "dotenv": "16.4.7", "form-data": "^4.0.0", "get-port-please": "^3.0.1", "glob": "^7.1.6", "handlebars": "^4.7.6", "mobx": "^6.0.4", - "node-fetch": "^2.6.1", - "react": "^17.0.0 || ^18.2.0", - "react-dom": "^17.0.0 || ^18.2.0", - "redoc": "~2.1.3", + "pluralize": "^8.0.0", + "react": "^17.0.0 || ^18.2.0 || ^19.0.0", + "react-dom": "^17.0.0 || ^18.2.0 || ^19.0.0", + "redoc": "2.5.0", "semver": "^7.5.2", "simple-websocket": "^9.0.0", "styled-components": "^6.0.7", @@ -1018,8 +1415,8 @@ "redocly": "bin/cli.js" }, "engines": { - "node": ">=14.19.0", - "npm": ">=7.0.0" + "node": ">=18.17.0", + "npm": ">=9.5.0" } }, "node_modules/@redocly/cli/node_modules/cliui": { @@ -1049,42 +1446,101 @@ "node": ">=12" } }, - "node_modules/@redocly/cli/node_modules/yargs-parser": { - "version": "20.2.9", - "dev": true, - "license": "ISC", - "engines": { - "node": ">=10" - } - }, "node_modules/@redocly/config": { - "version": "0.2.0", + "version": "0.22.2", + "resolved": "https://registry.npmjs.org/@redocly/config/-/config-0.22.2.tgz", + "integrity": "sha512-roRDai8/zr2S9YfmzUfNhKjOF0NdcOIqF7bhf4MVC5UxpjIysDjyudvlAiVbpPHp3eDRWbdzUgtkK1a7YiDNyQ==", "dev": true, "license": "MIT" }, "node_modules/@redocly/openapi-core": { - "version": "1.11.0", + "version": "1.34.4", + "resolved": "https://registry.npmjs.org/@redocly/openapi-core/-/openapi-core-1.34.4.tgz", + "integrity": "sha512-hf53xEgpXIgWl3b275PgZU3OTpYh1RoD2LHdIfQ1JzBNTWsiNKczTEsI/4Tmh2N1oq9YcphhSMyk3lDh85oDjg==", "dev": true, "license": "MIT", "dependencies": { - "@redocly/ajv": "^8.11.0", - "@redocly/config": "^0.2.0", + "@redocly/ajv": "^8.11.2", + "@redocly/config": "^0.22.0", "colorette": "^1.2.0", + "https-proxy-agent": "^7.0.5", "js-levenshtein": "^1.1.6", "js-yaml": "^4.1.0", - "lodash.isequal": "^4.5.0", "minimatch": "^5.0.1", - "node-fetch": "^2.6.1", "pluralize": "^8.0.0", "yaml-ast-parser": "0.0.43" }, "engines": { - "node": ">=14.19.0", - "npm": ">=7.0.0" + "node": ">=18.17.0", + "npm": ">=9.5.0" } }, - "node_modules/@rollup/rollup-android-arm-eabi": { - "version": "4.44.0", + "node_modules/@redocly/respect-core": { + "version": "1.34.4", + "resolved": "https://registry.npmjs.org/@redocly/respect-core/-/respect-core-1.34.4.tgz", + "integrity": "sha512-MitKyKyQpsizA4qCVv+MjXL4WltfhFQAoiKiAzrVR1Kusro3VhYb6yJuzoXjiJhR0ukLP5QOP19Vcs7qmj9dZg==", + "dev": true, + "license": "MIT", + "dependencies": { + "@faker-js/faker": "^7.6.0", + "@redocly/ajv": "8.11.2", + "@redocly/openapi-core": "1.34.4", + "better-ajv-errors": "^1.2.0", + "colorette": "^2.0.20", + "concat-stream": "^2.0.0", + "cookie": "^0.7.2", + "dotenv": "16.4.7", + "form-data": "4.0.0", + "jest-diff": "^29.3.1", + "jest-matcher-utils": "^29.3.1", + "js-yaml": "4.1.0", + "json-pointer": "^0.6.2", + "jsonpath-plus": "^10.0.6", + "open": "^10.1.0", + "openapi-sampler": "^1.6.1", + "outdent": "^0.8.0", + "set-cookie-parser": "^2.3.5", + "undici": "^6.21.1" + }, + "engines": { + "node": ">=18.17.0", + "npm": ">=9.5.0" + } + }, + "node_modules/@redocly/respect-core/node_modules/colorette": { + "version": "2.0.20", + "resolved": "https://registry.npmjs.org/colorette/-/colorette-2.0.20.tgz", + "integrity": "sha512-IfEDxwoWIjkeXL1eXcDiow4UbKjhLdq6/EuSVR9GMN7KVH3r9gQ83e73hsz1Nd1T3ijd5xv1wcWRYO+D6kCI2w==", + "dev": true, + "license": "MIT" + }, + "node_modules/@redocly/respect-core/node_modules/cookie": { + "version": "0.7.2", + "resolved": "https://registry.npmjs.org/cookie/-/cookie-0.7.2.tgz", + "integrity": "sha512-yki5XnKuf750l50uGTllt6kKILY4nQ1eNIQatoXEByZ5dWgnKqbnqmTrBE5B4N7lrMJKQ2ytWMiTO2o0v6Ew/w==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">= 0.6" + } + }, + "node_modules/@redocly/respect-core/node_modules/form-data": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/form-data/-/form-data-4.0.0.tgz", + "integrity": "sha512-ETEklSGi5t0QMZuiXoA/Q6vcnxcLQP5vdugSpuAyi6SVGi2clPPp+xgEhuMaHC+zGgn31Kd235W35f7Hykkaww==", + "dev": true, + "license": "MIT", + "dependencies": { + "asynckit": "^0.4.0", + "combined-stream": "^1.0.8", + "mime-types": "^2.1.12" + }, + "engines": { + "node": ">= 6" + } + }, + "node_modules/@rollup/rollup-android-arm-eabi": { + "version": "4.44.0", "resolved": "https://registry.npmjs.org/@rollup/rollup-android-arm-eabi/-/rollup-android-arm-eabi-4.44.0.tgz", "integrity": "sha512-xEiEE5oDW6tK4jXCAyliuntGR+amEMO7HLtdSshVuhFnKTYoeYMyXQK7pLouAJJj5KHdwdn87bfHAR2nSdNAUA==", "cpu": [ @@ -1363,6 +1819,13 @@ "win32" ] }, + "node_modules/@sinclair/typebox": { + "version": "0.27.8", + "resolved": "https://registry.npmjs.org/@sinclair/typebox/-/typebox-0.27.8.tgz", + "integrity": "sha512-+Fj43pSMwJs4KRrH/938Uf+uAELIgVBmQzg/q1YG10djyfA3TnrU8N8XzqCh/okZdszqBQTZf96idMfE5lnwTA==", + "dev": true, + "license": "MIT" + }, "node_modules/@sindresorhus/merge-streams": { "version": "4.0.0", "dev": true, @@ -1407,6 +1870,8 @@ }, "node_modules/@types/jest": { "version": "27.5.2", + "resolved": "https://registry.npmjs.org/@types/jest/-/jest-27.5.2.tgz", + "integrity": "sha512-mpT8LJJ4CMeeahobofYWIjFo0xonRS/HfxnVEPMPFSQdGUt1uHCnoPT7Zhb+sjDU2wz0oKV0OLUR0WzrHNgfeA==", "dev": true, "license": "MIT", "dependencies": { @@ -1414,8 +1879,52 @@ "pretty-format": "^27.0.0" } }, + "node_modules/@types/jest/node_modules/diff-sequences": { + "version": "27.5.1", + "resolved": "https://registry.npmjs.org/diff-sequences/-/diff-sequences-27.5.1.tgz", + "integrity": "sha512-k1gCAXAsNgLwEL+Y8Wvl+M6oEFj5bgazfZULpS5CneoPPXRaCCW7dm+q21Ky2VEE5X+VeRDBVg1Pcvvsr4TtNQ==", + "dev": true, + "license": "MIT", + "engines": { + "node": "^10.13.0 || ^12.13.0 || ^14.15.0 || >=15.0.0" + } + }, + "node_modules/@types/jest/node_modules/jest-diff": { + "version": "27.5.1", + "resolved": "https://registry.npmjs.org/jest-diff/-/jest-diff-27.5.1.tgz", + "integrity": "sha512-m0NvkX55LDt9T4mctTEgnZk3fmEg3NRYutvMPWM/0iPnkFj2wIeF45O1718cMSOFO1vINkqmxqD8vE37uTEbqw==", + "dev": true, + "license": "MIT", + "dependencies": { + "chalk": "^4.0.0", + "diff-sequences": "^27.5.1", + "jest-get-type": "^27.5.1", + "pretty-format": "^27.5.1" + }, + "engines": { + "node": "^10.13.0 || ^12.13.0 || ^14.15.0 || >=15.0.0" + } + }, + "node_modules/@types/jest/node_modules/jest-matcher-utils": { + "version": "27.5.1", + "resolved": "https://registry.npmjs.org/jest-matcher-utils/-/jest-matcher-utils-27.5.1.tgz", + "integrity": "sha512-z2uTx/T6LBaCoNWNFWwChLBKYxTMcGBRjAt+2SbP929/Fflb9aa5LGma654Rz8z9HLxsrUaYzxE9T/EFIL/PAw==", + "dev": true, + "license": "MIT", + "dependencies": { + "chalk": "^4.0.0", + "jest-diff": "^27.5.1", + "jest-get-type": "^27.5.1", + "pretty-format": "^27.5.1" + }, + "engines": { + "node": "^10.13.0 || ^12.13.0 || ^14.15.0 || >=15.0.0" + } + }, "node_modules/@types/json-schema": { "version": "7.0.15", + "resolved": "https://registry.npmjs.org/@types/json-schema/-/json-schema-7.0.15.tgz", + "integrity": "sha512-5+fP8P8MFNC+AyZCDxrB2pkZFPGzqQWUzpSeuuVLvm8VMcorNYavBqoFcxK8bQz4Qsbn4oUEEem4wDLfcysGHA==", "dev": true, "license": "MIT" }, @@ -1465,6 +1974,8 @@ }, "node_modules/@types/stylis": { "version": "4.2.5", + "resolved": "https://registry.npmjs.org/@types/stylis/-/stylis-4.2.5.tgz", + "integrity": "sha512-1Xve+NMN7FWjY14vLoY5tL3BVEQ/n42YLwaqJIPYhotZ9uBHt87VceMwWQpzmdEt2TNXIorIFG+YeCUUW7RInw==", "dev": true, "license": "MIT" }, @@ -1475,6 +1986,8 @@ }, "node_modules/@types/trusted-types": { "version": "2.0.7", + "resolved": "https://registry.npmjs.org/@types/trusted-types/-/trusted-types-2.0.7.tgz", + "integrity": "sha512-ScaPdn1dQczgbl0QFTeTOmVHFULt394XJgOQNoyVhZ6r2vLnMLJfBPd53SB52T/3G36VI1/g2MZaX0cwDuXsfw==", "dev": true, "license": "MIT", "optional": true @@ -1533,6 +2046,24 @@ "node": ">= 14" } }, + "node_modules/ajv": { + "version": "8.17.1", + "resolved": "https://registry.npmjs.org/ajv/-/ajv-8.17.1.tgz", + "integrity": "sha512-B/gBuNg5SiMTrPkC+A2+cW0RszwxYmn6VYxB/inlBStS5nx6xHIt/ehKRhIMhqusl7a8LjQoZnjCs5vhwxOQ1g==", + "dev": true, + "license": "MIT", + "peer": true, + "dependencies": { + "fast-deep-equal": "^3.1.3", + "fast-uri": "^3.0.1", + "json-schema-traverse": "^1.0.0", + "require-from-string": "^2.0.2" + }, + "funding": { + "type": "github", + "url": "https://github.com/sponsors/epoberezkin" + } + }, "node_modules/ansi-escapes": { "version": "4.3.2", "dev": true, @@ -1588,24 +2119,11 @@ }, "node_modules/argparse": { "version": "2.0.1", + "resolved": "https://registry.npmjs.org/argparse/-/argparse-2.0.1.tgz", + "integrity": "sha512-8+9WqebbFzpX9OR+Wa6O29asIogeRMzcGtAINdpMHHyAg10f05aSFVBbcEqGf/PXw1EjAZ+q2/bEBg3DvurK3Q==", "dev": true, "license": "Python-2.0" }, - "node_modules/array-buffer-byte-length": { - "version": "1.0.1", - "dev": true, - "license": "MIT", - "dependencies": { - "call-bind": "^1.0.5", - "is-array-buffer": "^3.0.4" - }, - "engines": { - "node": ">= 0.4" - }, - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, "node_modules/array-flatten": { "version": "1.1.1", "resolved": "https://registry.npmjs.org/array-flatten/-/array-flatten-1.1.1.tgz", @@ -1613,86 +2131,11 @@ "dev": true, "license": "MIT" }, - "node_modules/array.prototype.filter": { - "version": "1.0.4", - "resolved": "https://registry.npmjs.org/array.prototype.filter/-/array.prototype.filter-1.0.4.tgz", - "integrity": "sha512-r+mCJ7zXgXElgR4IRC+fkvNCeoaavWBs6EdCso5Tbcf+iEMKzBU/His60lt34WEZ9vlb8wDkZvQGcVI5GwkfoQ==", - "dev": true, - "peer": true, - "dependencies": { - "call-bind": "^1.0.7", - "define-properties": "^1.2.1", - "es-abstract": "^1.23.2", - "es-array-method-boxes-properly": "^1.0.0", - "es-object-atoms": "^1.0.0", - "is-string": "^1.0.7" - }, - "engines": { - "node": ">= 0.4" - }, - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, - "node_modules/array.prototype.flat": { - "version": "1.3.2", - "resolved": "https://registry.npmjs.org/array.prototype.flat/-/array.prototype.flat-1.3.2.tgz", - "integrity": "sha512-djYB+Zx2vLewY8RWlNCUdHjDXs2XOgm602S9E7P/UpHgfeHL00cRiIF+IN/G/aUJ7kGPb6yO/ErDI5V2s8iycA==", - "dev": true, - "peer": true, - "dependencies": { - "call-bind": "^1.0.2", - "define-properties": "^1.2.0", - "es-abstract": "^1.22.1", - "es-shim-unscopables": "^1.0.0" - }, - "engines": { - "node": ">= 0.4" - }, - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, - "node_modules/arraybuffer.prototype.slice": { - "version": "1.0.3", - "dev": true, - "license": "MIT", - "dependencies": { - "array-buffer-byte-length": "^1.0.1", - "call-bind": "^1.0.5", - "define-properties": "^1.2.1", - "es-abstract": "^1.22.3", - "es-errors": "^1.2.1", - "get-intrinsic": "^1.2.3", - "is-array-buffer": "^3.0.4", - "is-shared-array-buffer": "^1.0.2" - }, - "engines": { - "node": ">= 0.4" - }, - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, "node_modules/asynckit": { "version": "0.4.0", "dev": true, "license": "MIT" }, - "node_modules/available-typed-arrays": { - "version": "1.0.7", - "dev": true, - "license": "MIT", - "dependencies": { - "possible-typed-array-names": "^1.0.0" - }, - "engines": { - "node": ">= 0.4" - }, - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, "node_modules/balanced-match": { "version": "1.0.2", "dev": true, @@ -1705,6 +2148,26 @@ "dev": true, "license": "MIT" }, + "node_modules/better-ajv-errors": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/better-ajv-errors/-/better-ajv-errors-1.2.0.tgz", + "integrity": "sha512-UW+IsFycygIo7bclP9h5ugkNH8EjCSgqyFB/yQ4Hqqa1OEYDtb0uFIkYE0b6+CjkgJYVM5UKI/pJPxjYe9EZlA==", + "dev": true, + "license": "Apache-2.0", + "dependencies": { + "@babel/code-frame": "^7.16.0", + "@humanwhocodes/momoa": "^2.0.2", + "chalk": "^4.1.2", + "jsonpointer": "^5.0.0", + "leven": "^3.1.0 < 4" + }, + "engines": { + "node": ">= 12.13.0" + }, + "peerDependencies": { + "ajv": "4.11.8 - 8" + } + }, "node_modules/binary-extensions": { "version": "2.3.0", "dev": true, @@ -1741,15 +2204,10 @@ "npm": "1.2.8000 || >= 1.4.16" } }, - "node_modules/boolbase": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/boolbase/-/boolbase-1.0.0.tgz", - "integrity": "sha512-JZOSA7Mo9sNGB8+UjSgzdLtokWAky1zbztM3WRLCbZ70/3cTANmQmOdR7y2g+J0e2WXywy1yS468tY+IruqEww==", - "dev": true, - "peer": true - }, "node_modules/brace-expansion": { - "version": "1.1.11", + "version": "1.1.12", + "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.12.tgz", + "integrity": "sha512-9T9UjW3r0UW5c1Q7GTwllptXwhvYmEzFhzMfZ9H7FQWt+uZePjZPjBP/W1ZEyZ1twGWom5/56TF4lPcqjnDHcg==", "dev": true, "license": "MIT", "dependencies": { @@ -1832,7 +2290,9 @@ } }, "node_modules/cacache/node_modules/brace-expansion": { - "version": "2.0.1", + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-2.0.2.tgz", + "integrity": "sha512-Jt0vHyM+jmUBqojB7E1NIYadt0vI0Qxjxd2TErW94wDz+E2LAm5vKMXXwg6ZZBTHPuUlDgQHKXvjGBdfcF1ZDQ==", "dev": true, "license": "MIT", "dependencies": { @@ -1918,11 +2378,15 @@ }, "node_modules/call-me-maybe": { "version": "1.0.2", + "resolved": "https://registry.npmjs.org/call-me-maybe/-/call-me-maybe-1.0.2.tgz", + "integrity": "sha512-HpX65o1Hnr9HH25ojC1YGs7HCQLq0GCOibSaWER0eNpgJ/Z1MZv2mTc7+xh6WOPxbRVcmgbv4hGU+uSQ/2xFZQ==", "dev": true, "license": "MIT" }, "node_modules/camelize": { "version": "1.0.1", + "resolved": "https://registry.npmjs.org/camelize/-/camelize-1.0.1.tgz", + "integrity": "sha512-dU+Tx2fsypxTgtLoE36npi3UqcjSSMNYfkqgmoEhtZrraP5VWq0K7FkWVTYa8eMPtnU/G2txVsfdCJTn9uzpuQ==", "dev": true, "license": "MIT", "funding": { @@ -1944,50 +2408,6 @@ "url": "https://github.com/chalk/chalk?sponsor=1" } }, - "node_modules/cheerio": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/cheerio/-/cheerio-1.0.0.tgz", - "integrity": "sha512-quS9HgjQpdaXOvsZz82Oz7uxtXiy6UIsIQcpBj7HRw2M63Skasm9qlDocAM7jNuaxdhpPU7c4kJN+gA5MCu4ww==", - "dev": true, - "peer": true, - "dependencies": { - "cheerio-select": "^2.1.0", - "dom-serializer": "^2.0.0", - "domhandler": "^5.0.3", - "domutils": "^3.1.0", - "encoding-sniffer": "^0.2.0", - "htmlparser2": "^9.1.0", - "parse5": "^7.1.2", - "parse5-htmlparser2-tree-adapter": "^7.0.0", - "parse5-parser-stream": "^7.1.2", - "undici": "^6.19.5", - "whatwg-mimetype": "^4.0.0" - }, - "engines": { - "node": ">=18.17" - }, - "funding": { - "url": "https://github.com/cheeriojs/cheerio?sponsor=1" - } - }, - "node_modules/cheerio-select": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/cheerio-select/-/cheerio-select-2.1.0.tgz", - "integrity": "sha512-9v9kG0LvzrlcungtnJtpGNxY+fzECQKhK4EGJX2vByejiMX84MFNQw4UxPJl3bFbTMw+Dfs37XaIkCwTZfLh4g==", - "dev": true, - "peer": true, - "dependencies": { - "boolbase": "^1.0.0", - "css-select": "^5.1.0", - "css-what": "^6.1.0", - "domelementtype": "^2.3.0", - "domhandler": "^5.0.3", - "domutils": "^3.0.1" - }, - "funding": { - "url": "https://github.com/sponsors/fb55" - } - }, "node_modules/chokidar": { "version": "3.6.0", "dev": true, @@ -2021,6 +2441,8 @@ }, "node_modules/classnames": { "version": "2.5.1", + "resolved": "https://registry.npmjs.org/classnames/-/classnames-2.5.1.tgz", + "integrity": "sha512-saHYOzhIQs6wy2sVxTM6bUDsQO4F50V9RQ22qBpEdCW+I+/Wmke2HOl6lS6dTpdxVhb88/I6+Hs+438c3lfUow==", "dev": true, "license": "MIT" }, @@ -2038,21 +2460,10 @@ "url": "https://github.com/sponsors/sindresorhus" } }, - "node_modules/cliui": { - "version": "8.0.1", - "dev": true, - "license": "ISC", - "dependencies": { - "string-width": "^4.2.0", - "strip-ansi": "^6.0.1", - "wrap-ansi": "^7.0.0" - }, - "engines": { - "node": ">=12" - } - }, "node_modules/clsx": { "version": "2.1.1", + "resolved": "https://registry.npmjs.org/clsx/-/clsx-2.1.1.tgz", + "integrity": "sha512-eYm0QWBtUrBWZWG0d386OGAw16Z995PiOVo2B7bjWSbHedGl5e0ZWaq65kOGgUSNesEIDkB9ISbTg/JK9dhCZA==", "dev": true, "license": "MIT", "engines": { @@ -2077,6 +2488,8 @@ }, "node_modules/colorette": { "version": "1.4.0", + "resolved": "https://registry.npmjs.org/colorette/-/colorette-1.4.0.tgz", + "integrity": "sha512-Y2oEozpomLn7Q3HFP7dpww7AtMJplbM9lGZP6RDfHqmbeRjiwRg4n6VM6j4KLmRke85uWEI7JqF17f3pqdRA0g==", "dev": true, "license": "MIT" }, @@ -2111,6 +2524,22 @@ "dev": true, "license": "MIT" }, + "node_modules/concat-stream": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/concat-stream/-/concat-stream-2.0.0.tgz", + "integrity": "sha512-MWufYdFw53ccGjCA+Ol7XJYpAlW6/prSMzuPOTRnJGcGzuhLn4Scrz7qf6o8bROZ514ltazcIFJZevcfbo0x7A==", + "dev": true, + "engines": [ + "node >= 6.0" + ], + "license": "MIT", + "dependencies": { + "buffer-from": "^1.0.0", + "inherits": "^2.0.3", + "readable-stream": "^3.0.2", + "typedarray": "^0.0.6" + } + }, "node_modules/config-chain": { "version": "1.1.13", "resolved": "https://registry.npmjs.org/config-chain/-/config-chain-1.1.13.tgz", @@ -2178,7 +2607,9 @@ } }, "node_modules/core-js": { - "version": "3.39.0", + "version": "3.43.0", + "resolved": "https://registry.npmjs.org/core-js/-/core-js-3.43.0.tgz", + "integrity": "sha512-N6wEbTTZSYOY2rYAn85CuvWWkCK6QweMn7/4Nr3w+gDBeBhk/x4EJeY6FPo4QzDoJZxVTv8U7CMvgWk6pOHHqA==", "dev": true, "hasInstallScript": true, "license": "MIT", @@ -2187,46 +2618,20 @@ "url": "https://opencollective.com/core-js" } }, - "node_modules/cross-spawn": { - "version": "7.0.6", - "dev": true, - "license": "MIT", - "dependencies": { - "path-key": "^3.1.0", - "shebang-command": "^2.0.0", - "which": "^2.0.1" - }, - "engines": { - "node": ">= 8" - } - }, "node_modules/css-color-keywords": { "version": "1.0.0", + "resolved": "https://registry.npmjs.org/css-color-keywords/-/css-color-keywords-1.0.0.tgz", + "integrity": "sha512-FyyrDHZKEjXDpNJYvVsV960FiqQyXc/LlYmsxl2BcdMb2WPx0OGRVgTg55rPSyLSNMqP52R9r8geSp7apN3Ofg==", "dev": true, "license": "ISC", "engines": { "node": ">=4" } }, - "node_modules/css-select": { - "version": "5.1.0", - "resolved": "https://registry.npmjs.org/css-select/-/css-select-5.1.0.tgz", - "integrity": "sha512-nwoRF1rvRRnnCqqY7updORDsuqKzqYJ28+oSMaJMMgOauh3fvwHqMS7EZpIPqK8GL+g9mKxF1vP/ZjSeNjEVHg==", - "dev": true, - "peer": true, - "dependencies": { - "boolbase": "^1.0.0", - "css-what": "^6.1.0", - "domhandler": "^5.0.2", - "domutils": "^3.0.1", - "nth-check": "^2.0.1" - }, - "funding": { - "url": "https://github.com/sponsors/fb55" - } - }, "node_modules/css-to-react-native": { "version": "3.2.0", + "resolved": "https://registry.npmjs.org/css-to-react-native/-/css-to-react-native-3.2.0.tgz", + "integrity": "sha512-e8RKaLXMOFii+02mOlqwjbD00KSEKqblnpO9e++1aXS1fPQOpS1YoqdVHBqPjHNoxeF2mimzVqawm2KCbEdtHQ==", "dev": true, "license": "MIT", "dependencies": { @@ -2235,108 +2640,51 @@ "postcss-value-parser": "^4.0.2" } }, - "node_modules/css-what": { - "version": "6.1.0", - "resolved": "https://registry.npmjs.org/css-what/-/css-what-6.1.0.tgz", - "integrity": "sha512-HTUrgRJ7r4dsZKU6GjmpfRK1O76h97Z8MfS1G0FozR+oF2kG6Vfe8JE6zwrkbxigziPHinCJ+gCPjA9EaBDtRw==", - "dev": true, - "peer": true, - "engines": { - "node": ">= 6" - }, - "funding": { - "url": "https://github.com/sponsors/fb55" - } - }, "node_modules/csstype": { "version": "3.1.3", + "resolved": "https://registry.npmjs.org/csstype/-/csstype-3.1.3.tgz", + "integrity": "sha512-M1uQkMl8rQK/szD0LNhtqxIPLpimGm8sOBwU7lLnCpSbTyY3yeU1Vc7l4KT5zT4s/yOxHH5O7tIuuLOCnLADRw==", "dev": true, "license": "MIT" }, - "node_modules/data-view-buffer": { - "version": "1.0.1", + "node_modules/debug": { + "version": "2.6.9", "dev": true, "license": "MIT", "dependencies": { - "call-bind": "^1.0.6", - "es-errors": "^1.3.0", - "is-data-view": "^1.0.1" - }, + "ms": "2.0.0" + } + }, + "node_modules/debug/node_modules/ms": { + "version": "2.0.0", + "dev": true, + "license": "MIT" + }, + "node_modules/decko": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/decko/-/decko-1.2.0.tgz", + "integrity": "sha512-m8FnyHXV1QX+S1cl+KPFDIl6NMkxtKsy6+U/aYyjrOqWMuwAwYWu7ePqrsUHtDR5Y8Yk2pi/KIDSgF+vT4cPOQ==", + "dev": true + }, + "node_modules/deep-extend": { + "version": "0.6.0", + "resolved": "https://registry.npmjs.org/deep-extend/-/deep-extend-0.6.0.tgz", + "integrity": "sha512-LOHxIOaPYdHlJRtCQfDIVZtfw/ufM8+rVj649RIHzcm/vGwQRXFt6OPqIFWsm2XEMrNIEtWR64sY1LEKD2vAOA==", + "dev": true, + "license": "MIT", "engines": { - "node": ">= 0.4" - }, - "funding": { - "url": "https://github.com/sponsors/ljharb" + "node": ">=4.0.0" } }, - "node_modules/data-view-byte-length": { - "version": "1.0.1", + "node_modules/default-browser": { + "version": "5.2.1", + "resolved": "https://registry.npmjs.org/default-browser/-/default-browser-5.2.1.tgz", + "integrity": "sha512-WY/3TUME0x3KPYdRRxEJJvXRHV4PyPoUsxtZa78lwItwRQRHhd2U9xOscaT/YTf8uCXIAjeJOFBVEh/7FtD8Xg==", "dev": true, "license": "MIT", "dependencies": { - "call-bind": "^1.0.7", - "es-errors": "^1.3.0", - "is-data-view": "^1.0.1" - }, - "engines": { - "node": ">= 0.4" - }, - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, - "node_modules/data-view-byte-offset": { - "version": "1.0.0", - "dev": true, - "license": "MIT", - "dependencies": { - "call-bind": "^1.0.6", - "es-errors": "^1.3.0", - "is-data-view": "^1.0.1" - }, - "engines": { - "node": ">= 0.4" - }, - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, - "node_modules/debug": { - "version": "2.6.9", - "dev": true, - "license": "MIT", - "dependencies": { - "ms": "2.0.0" - } - }, - "node_modules/debug/node_modules/ms": { - "version": "2.0.0", - "dev": true, - "license": "MIT" - }, - "node_modules/decko": { - "version": "1.2.0", - "dev": true - }, - "node_modules/deep-extend": { - "version": "0.6.0", - "resolved": "https://registry.npmjs.org/deep-extend/-/deep-extend-0.6.0.tgz", - "integrity": "sha512-LOHxIOaPYdHlJRtCQfDIVZtfw/ufM8+rVj649RIHzcm/vGwQRXFt6OPqIFWsm2XEMrNIEtWR64sY1LEKD2vAOA==", - "dev": true, - "license": "MIT", - "engines": { - "node": ">=4.0.0" - } - }, - "node_modules/default-browser": { - "version": "5.2.1", - "resolved": "https://registry.npmjs.org/default-browser/-/default-browser-5.2.1.tgz", - "integrity": "sha512-WY/3TUME0x3KPYdRRxEJJvXRHV4PyPoUsxtZa78lwItwRQRHhd2U9xOscaT/YTf8uCXIAjeJOFBVEh/7FtD8Xg==", - "dev": true, - "license": "MIT", - "dependencies": { - "bundle-name": "^4.1.0", - "default-browser-id": "^5.0.0" + "bundle-name": "^4.1.0", + "default-browser-id": "^5.0.0" }, "engines": { "node": ">=18" @@ -2387,22 +2735,6 @@ "url": "https://github.com/sponsors/sindresorhus" } }, - "node_modules/define-properties": { - "version": "1.2.1", - "dev": true, - "license": "MIT", - "dependencies": { - "define-data-property": "^1.0.1", - "has-property-descriptors": "^1.0.0", - "object-keys": "^1.1.1" - }, - "engines": { - "node": ">= 0.4" - }, - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, "node_modules/delayed-stream": { "version": "1.0.0", "dev": true, @@ -2492,85 +2824,36 @@ "license": "0BSD" }, "node_modules/diff-sequences": { - "version": "27.5.1", + "version": "29.6.3", + "resolved": "https://registry.npmjs.org/diff-sequences/-/diff-sequences-29.6.3.tgz", + "integrity": "sha512-EjePK1srD3P08o2j4f0ExnylqRs5B9tJjcp9t1krH2qRi8CCdsYfwe9JgSLurFBWwq4uOlipzfk5fHNvwFKr8Q==", "dev": true, "license": "MIT", "engines": { - "node": "^10.13.0 || ^12.13.0 || ^14.15.0 || >=15.0.0" - } - }, - "node_modules/discontinuous-range": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/discontinuous-range/-/discontinuous-range-1.0.0.tgz", - "integrity": "sha512-c68LpLbO+7kP/b1Hr1qs8/BJ09F5khZGTxqxZuhzxpmwJKOgRFHJWIb9/KmqnqHhLdO55aOxFH/EGBvUQbL/RQ==", - "dev": true, - "peer": true - }, - "node_modules/dom-serializer": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/dom-serializer/-/dom-serializer-2.0.0.tgz", - "integrity": "sha512-wIkAryiqt/nV5EQKqQpo3SToSOV9J0DnbJqwK7Wv/Trc92zIAYZ4FlMu+JPFW1DfGFt81ZTCGgDEabffXeLyJg==", - "dev": true, - "peer": true, - "dependencies": { - "domelementtype": "^2.3.0", - "domhandler": "^5.0.2", - "entities": "^4.2.0" - }, - "funding": { - "url": "https://github.com/cheeriojs/dom-serializer?sponsor=1" - } - }, - "node_modules/domelementtype": { - "version": "2.3.0", - "resolved": "https://registry.npmjs.org/domelementtype/-/domelementtype-2.3.0.tgz", - "integrity": "sha512-OLETBj6w0OsagBwdXnPdN0cnMfF9opN69co+7ZrbfPGrdpPVNBUj02spi6B1N7wChLQiPn4CSH/zJvXw56gmHw==", - "dev": true, - "funding": [ - { - "type": "github", - "url": "https://github.com/sponsors/fb55" - } - ], - "peer": true - }, - "node_modules/domhandler": { - "version": "5.0.3", - "resolved": "https://registry.npmjs.org/domhandler/-/domhandler-5.0.3.tgz", - "integrity": "sha512-cgwlv/1iFQiFnU96XXgROh8xTeetsnJiDsTc7TYCLFd9+/WNkIqPTxiM/8pSd8VIrhXGTf1Ny1q1hquVqDJB5w==", - "dev": true, - "peer": true, - "dependencies": { - "domelementtype": "^2.3.0" - }, - "engines": { - "node": ">= 4" - }, - "funding": { - "url": "https://github.com/fb55/domhandler?sponsor=1" + "node": "^14.15.0 || ^16.10.0 || >=18.0.0" } }, "node_modules/dompurify": { - "version": "3.2.3", + "version": "3.2.6", + "resolved": "https://registry.npmjs.org/dompurify/-/dompurify-3.2.6.tgz", + "integrity": "sha512-/2GogDQlohXPZe6D6NOgQvXLPSYBqIWMnZ8zzOhn09REE4eyAzb+Hed3jhoM9OkuaJ8P6ZGTTVWQKAi8ieIzfQ==", "dev": true, "license": "(MPL-2.0 OR Apache-2.0)", "optionalDependencies": { "@types/trusted-types": "^2.0.7" } }, - "node_modules/domutils": { - "version": "3.1.0", - "resolved": "https://registry.npmjs.org/domutils/-/domutils-3.1.0.tgz", - "integrity": "sha512-H78uMmQtI2AhgDJjWeQmHwJJ2bLPD3GMmO7Zja/ZZh84wkm+4ut+IUnUdRa8uCGX88DiVx1j6FRe1XfxEgjEZA==", + "node_modules/dotenv": { + "version": "16.4.7", + "resolved": "https://registry.npmjs.org/dotenv/-/dotenv-16.4.7.tgz", + "integrity": "sha512-47qPchRCykZC03FhkYAhrvwU4xDBFIj1QPqaarj6mdM/hgUzfPHcpkHJOn3mJAufFeeAxAzeGsr5X0M4k6fLZQ==", "dev": true, - "peer": true, - "dependencies": { - "dom-serializer": "^2.0.0", - "domelementtype": "^2.3.0", - "domhandler": "^5.0.3" + "license": "BSD-2-Clause", + "engines": { + "node": ">=12" }, "funding": { - "url": "https://github.com/fb55/domutils?sponsor=1" + "url": "https://dotenvx.com" } }, "node_modules/dunder-proto": { @@ -2674,6 +2957,23 @@ "node": ">=18" } }, + "node_modules/elm-doc-preview/node_modules/cross-spawn": { + "version": "6.0.6", + "resolved": "https://registry.npmjs.org/cross-spawn/-/cross-spawn-6.0.6.tgz", + "integrity": "sha512-VqCUuhcd1iB+dsv8gxPttb5iZh/D0iubSP21g36KXdEuf6I5JiioesUVjpCdHV9MZRUfVFlvwtIUyPfxo5trtw==", + "dev": true, + "license": "MIT", + "dependencies": { + "nice-try": "^1.0.4", + "path-key": "^2.0.1", + "semver": "^5.5.0", + "shebang-command": "^1.2.0", + "which": "^1.2.9" + }, + "engines": { + "node": ">=4.8" + } + }, "node_modules/elm-doc-preview/node_modules/glob": { "version": "11.0.3", "resolved": "https://registry.npmjs.org/glob/-/glob-11.0.3.tgz", @@ -2740,6 +3040,16 @@ "url": "https://github.com/sponsors/isaacs" } }, + "node_modules/elm-doc-preview/node_modules/path-key": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/path-key/-/path-key-2.0.1.tgz", + "integrity": "sha512-fEHGKCSmUSDPv4uoj8AlD+joPlq3peND+HRYyxFz4KPw4z926S/b8rIuFs2FYJg3BwsxJf6A9/3eIdLaYC+9Dw==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=4" + } + }, "node_modules/elm-doc-preview/node_modules/path-scurry": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/path-scurry/-/path-scurry-2.0.0.tgz", @@ -2757,6 +3067,52 @@ "url": "https://github.com/sponsors/isaacs" } }, + "node_modules/elm-doc-preview/node_modules/semver": { + "version": "5.7.2", + "resolved": "https://registry.npmjs.org/semver/-/semver-5.7.2.tgz", + "integrity": "sha512-cBznnQ9KjJqU67B52RMC65CMarK2600WFnbkcaiwWq3xy/5haFJlshgnpjovMVJ+Hff49d8GEn0b87C5pDQ10g==", + "dev": true, + "license": "ISC", + "bin": { + "semver": "bin/semver" + } + }, + "node_modules/elm-doc-preview/node_modules/shebang-command": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/shebang-command/-/shebang-command-1.2.0.tgz", + "integrity": "sha512-EV3L1+UQWGor21OmnvojK36mhg+TyIKDh3iFBKBohr5xeXIhNBcx8oWdgkTEEQ+BEFFYdLRuqMfd5L84N1V5Vg==", + "dev": true, + "license": "MIT", + "dependencies": { + "shebang-regex": "^1.0.0" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/elm-doc-preview/node_modules/shebang-regex": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/shebang-regex/-/shebang-regex-1.0.0.tgz", + "integrity": "sha512-wpoSFAxys6b2a2wHZ1XpDSgD7N9iVjg29Ph9uV/uaP9Ex/KXlkTZTeddxDPSYQpgvzKLGJke2UU0AzoGCjNIvQ==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/elm-doc-preview/node_modules/which": { + "version": "1.3.1", + "resolved": "https://registry.npmjs.org/which/-/which-1.3.1.tgz", + "integrity": "sha512-HxJdYWq1MTIQbJ3nw0cqssHoTNU267KlrDuGZ1WYlxDStUtKUhOaJmh112/TZmHxxUfuJqPXSOm7tDyas0OSIQ==", + "dev": true, + "license": "ISC", + "dependencies": { + "isexe": "^2.0.0" + }, + "bin": { + "which": "bin/which" + } + }, "node_modules/elm-doc-preview/node_modules/ws": { "version": "8.18.2", "resolved": "https://registry.npmjs.org/ws/-/ws-8.18.2.tgz", @@ -2786,6 +3142,8 @@ }, "node_modules/elm-optimize-level-2": { "version": "0.3.5", + "resolved": "https://registry.npmjs.org/elm-optimize-level-2/-/elm-optimize-level-2-0.3.5.tgz", + "integrity": "sha512-t1xl8zR9UBspdmEMuLBE/qTLP+Ew3L4PzKLhSY/PsO21HU3jZ1ULmKxDtZmJPVG4ciqsY1JSl/GFbaSdQ1sX9Q==", "dev": true, "license": "BSD-3-Clause", "dependencies": { @@ -2863,6 +3221,43 @@ "url": "https://paulmillr.com/funding/" } }, + "node_modules/elm-pages/node_modules/cross-spawn": { + "version": "6.0.6", + "resolved": "https://registry.npmjs.org/cross-spawn/-/cross-spawn-6.0.6.tgz", + "integrity": "sha512-VqCUuhcd1iB+dsv8gxPttb5iZh/D0iubSP21g36KXdEuf6I5JiioesUVjpCdHV9MZRUfVFlvwtIUyPfxo5trtw==", + "dev": true, + "license": "MIT", + "dependencies": { + "nice-try": "^1.0.4", + "path-key": "^2.0.1", + "semver": "^5.5.0", + "shebang-command": "^1.2.0", + "which": "^1.2.9" + }, + "engines": { + "node": ">=4.8" + } + }, + "node_modules/elm-pages/node_modules/cross-spawn/node_modules/isexe": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/isexe/-/isexe-2.0.0.tgz", + "integrity": "sha512-RHxMLp9lnKHGHRng9QFhRCMbYAcVpn69smSGcq3f36xjgVVWThj4qqLbTLlq7Ssj8B+fIQ1EuCEGI2lKsyQeIw==", + "dev": true, + "license": "ISC" + }, + "node_modules/elm-pages/node_modules/cross-spawn/node_modules/which": { + "version": "1.3.1", + "resolved": "https://registry.npmjs.org/which/-/which-1.3.1.tgz", + "integrity": "sha512-HxJdYWq1MTIQbJ3nw0cqssHoTNU267KlrDuGZ1WYlxDStUtKUhOaJmh112/TZmHxxUfuJqPXSOm7tDyas0OSIQ==", + "dev": true, + "license": "ISC", + "dependencies": { + "isexe": "^2.0.0" + }, + "bin": { + "which": "bin/which" + } + }, "node_modules/elm-pages/node_modules/isexe": { "version": "3.1.1", "dev": true, @@ -2871,6 +3266,16 @@ "node": ">=16" } }, + "node_modules/elm-pages/node_modules/path-key": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/path-key/-/path-key-2.0.1.tgz", + "integrity": "sha512-fEHGKCSmUSDPv4uoj8AlD+joPlq3peND+HRYyxFz4KPw4z926S/b8rIuFs2FYJg3BwsxJf6A9/3eIdLaYC+9Dw==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=4" + } + }, "node_modules/elm-pages/node_modules/readdirp": { "version": "4.1.2", "resolved": "https://registry.npmjs.org/readdirp/-/readdirp-4.1.2.tgz", @@ -2885,6 +3290,39 @@ "url": "https://paulmillr.com/funding/" } }, + "node_modules/elm-pages/node_modules/semver": { + "version": "5.7.2", + "resolved": "https://registry.npmjs.org/semver/-/semver-5.7.2.tgz", + "integrity": "sha512-cBznnQ9KjJqU67B52RMC65CMarK2600WFnbkcaiwWq3xy/5haFJlshgnpjovMVJ+Hff49d8GEn0b87C5pDQ10g==", + "dev": true, + "license": "ISC", + "bin": { + "semver": "bin/semver" + } + }, + "node_modules/elm-pages/node_modules/shebang-command": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/shebang-command/-/shebang-command-1.2.0.tgz", + "integrity": "sha512-EV3L1+UQWGor21OmnvojK36mhg+TyIKDh3iFBKBohr5xeXIhNBcx8oWdgkTEEQ+BEFFYdLRuqMfd5L84N1V5Vg==", + "dev": true, + "license": "MIT", + "dependencies": { + "shebang-regex": "^1.0.0" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/elm-pages/node_modules/shebang-regex": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/shebang-regex/-/shebang-regex-1.0.0.tgz", + "integrity": "sha512-wpoSFAxys6b2a2wHZ1XpDSgD7N9iVjg29Ph9uV/uaP9Ex/KXlkTZTeddxDPSYQpgvzKLGJke2UU0AzoGCjNIvQ==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=0.10.0" + } + }, "node_modules/elm-pages/node_modules/which": { "version": "5.0.0", "dev": true, @@ -2923,33 +3361,6 @@ "iconv-lite": "^0.6.2" } }, - "node_modules/encoding-sniffer": { - "version": "0.2.0", - "resolved": "https://registry.npmjs.org/encoding-sniffer/-/encoding-sniffer-0.2.0.tgz", - "integrity": "sha512-ju7Wq1kg04I3HtiYIOrUrdfdDvkyO9s5XM8QAj/bN61Yo/Vb4vgJxy5vi4Yxk01gWHbrofpPtpxM8bKger9jhg==", - "dev": true, - "peer": true, - "dependencies": { - "iconv-lite": "^0.6.3", - "whatwg-encoding": "^3.1.1" - }, - "funding": { - "url": "https://github.com/fb55/encoding-sniffer?sponsor=1" - } - }, - "node_modules/encoding-sniffer/node_modules/iconv-lite": { - "version": "0.6.3", - "resolved": "https://registry.npmjs.org/iconv-lite/-/iconv-lite-0.6.3.tgz", - "integrity": "sha512-4fCk79wshMdzMp2rH06qWrJE4iolqLhCUH+OiuIgU++RB0+94NlDL81atO7GX55uUKueo0txHNtvEyI6D7WdMw==", - "dev": true, - "peer": true, - "dependencies": { - "safer-buffer": ">= 2.1.2 < 3.0.0" - }, - "engines": { - "node": ">=0.10.0" - } - }, "node_modules/encoding/node_modules/iconv-lite": { "version": "0.6.3", "dev": true, @@ -2962,140 +3373,15 @@ "node": ">=0.10.0" } }, - "node_modules/entities": { - "version": "4.5.0", - "resolved": "https://registry.npmjs.org/entities/-/entities-4.5.0.tgz", - "integrity": "sha512-V0hjH4dGPh9Ao5p0MoRY6BVqtwCjhz6vI5LT8AJ55H+4g9/4vbHx1I54fS0XuclLhDHArPQCiMjDxjaL8fPxhw==", + "node_modules/eol": { + "version": "0.9.1", "dev": true, - "peer": true, - "engines": { - "node": ">=0.12" - }, - "funding": { - "url": "https://github.com/fb55/entities?sponsor=1" - } + "license": "MIT" }, - "node_modules/enzyme": { - "version": "3.11.0", - "resolved": "https://registry.npmjs.org/enzyme/-/enzyme-3.11.0.tgz", - "integrity": "sha512-Dw8/Gs4vRjxY6/6i9wU0V+utmQO9kvh9XLnz3LIudviOnVYDEe2ec+0k+NQoMamn1VrjKgCUOWj5jG/5M5M0Qw==", + "node_modules/err-code": { + "version": "2.0.3", "dev": true, - "peer": true, - "dependencies": { - "array.prototype.flat": "^1.2.3", - "cheerio": "^1.0.0-rc.3", - "enzyme-shallow-equal": "^1.0.1", - "function.prototype.name": "^1.1.2", - "has": "^1.0.3", - "html-element-map": "^1.2.0", - "is-boolean-object": "^1.0.1", - "is-callable": "^1.1.5", - "is-number-object": "^1.0.4", - "is-regex": "^1.0.5", - "is-string": "^1.0.5", - "is-subset": "^0.1.1", - "lodash.escape": "^4.0.1", - "lodash.isequal": "^4.5.0", - "object-inspect": "^1.7.0", - "object-is": "^1.0.2", - "object.assign": "^4.1.0", - "object.entries": "^1.1.1", - "object.values": "^1.1.1", - "raf": "^3.4.1", - "rst-selector-parser": "^2.2.3", - "string.prototype.trim": "^1.2.1" - }, - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, - "node_modules/enzyme-shallow-equal": { - "version": "1.0.7", - "dev": true, - "license": "MIT", - "dependencies": { - "hasown": "^2.0.0", - "object-is": "^1.1.5" - }, - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, - "node_modules/eol": { - "version": "0.9.1", - "dev": true, - "license": "MIT" - }, - "node_modules/err-code": { - "version": "2.0.3", - "dev": true, - "license": "MIT" - }, - "node_modules/es-abstract": { - "version": "1.23.5", - "dev": true, - "license": "MIT", - "dependencies": { - "array-buffer-byte-length": "^1.0.1", - "arraybuffer.prototype.slice": "^1.0.3", - "available-typed-arrays": "^1.0.7", - "call-bind": "^1.0.7", - "data-view-buffer": "^1.0.1", - "data-view-byte-length": "^1.0.1", - "data-view-byte-offset": "^1.0.0", - "es-define-property": "^1.0.0", - "es-errors": "^1.3.0", - "es-object-atoms": "^1.0.0", - "es-set-tostringtag": "^2.0.3", - "es-to-primitive": "^1.2.1", - "function.prototype.name": "^1.1.6", - "get-intrinsic": "^1.2.4", - "get-symbol-description": "^1.0.2", - "globalthis": "^1.0.4", - "gopd": "^1.0.1", - "has-property-descriptors": "^1.0.2", - "has-proto": "^1.0.3", - "has-symbols": "^1.0.3", - "hasown": "^2.0.2", - "internal-slot": "^1.0.7", - "is-array-buffer": "^3.0.4", - "is-callable": "^1.2.7", - "is-data-view": "^1.0.1", - "is-negative-zero": "^2.0.3", - "is-regex": "^1.1.4", - "is-shared-array-buffer": "^1.0.3", - "is-string": "^1.0.7", - "is-typed-array": "^1.1.13", - "is-weakref": "^1.0.2", - "object-inspect": "^1.13.3", - "object-keys": "^1.1.1", - "object.assign": "^4.1.5", - "regexp.prototype.flags": "^1.5.3", - "safe-array-concat": "^1.1.2", - "safe-regex-test": "^1.0.3", - "string.prototype.trim": "^1.2.9", - "string.prototype.trimend": "^1.0.8", - "string.prototype.trimstart": "^1.0.8", - "typed-array-buffer": "^1.0.2", - "typed-array-byte-length": "^1.0.1", - "typed-array-byte-offset": "^1.0.2", - "typed-array-length": "^1.0.6", - "unbox-primitive": "^1.0.2", - "which-typed-array": "^1.1.15" - }, - "engines": { - "node": ">= 0.4" - }, - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, - "node_modules/es-array-method-boxes-properly": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/es-array-method-boxes-properly/-/es-array-method-boxes-properly-1.0.0.tgz", - "integrity": "sha512-wd6JXUmyHmt8T5a2xreUwKcGPq6f1f+WwIJkijUqiGcJz1qqnZgP6XIK+QyIWU5lT7imeNxUll48bziG+TSYcA==", - "dev": true, - "peer": true + "license": "MIT" }, "node_modules/es-define-property": { "version": "1.0.1", @@ -3124,47 +3410,10 @@ "node": ">= 0.4" } }, - "node_modules/es-set-tostringtag": { - "version": "2.0.3", - "dev": true, - "license": "MIT", - "dependencies": { - "get-intrinsic": "^1.2.4", - "has-tostringtag": "^1.0.2", - "hasown": "^2.0.1" - }, - "engines": { - "node": ">= 0.4" - } - }, - "node_modules/es-shim-unscopables": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/es-shim-unscopables/-/es-shim-unscopables-1.0.2.tgz", - "integrity": "sha512-J3yBRXCzDu4ULnQwxyToo/OjdMx6akgVC7K6few0a7F/0wLtmKKN7I73AH5T2836UuXRqN7Qg+IIUw/+YJksRw==", - "dev": true, - "peer": true, - "dependencies": { - "hasown": "^2.0.0" - } - }, - "node_modules/es-to-primitive": { - "version": "1.3.0", - "dev": true, - "license": "MIT", - "dependencies": { - "is-callable": "^1.2.7", - "is-date-object": "^1.0.5", - "is-symbol": "^1.0.4" - }, - "engines": { - "node": ">= 0.4" - }, - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, "node_modules/es6-promise": { "version": "3.3.1", + "resolved": "https://registry.npmjs.org/es6-promise/-/es6-promise-3.3.1.tgz", + "integrity": "sha512-SOp9Phqvqn7jtEUxPWdWfWoLmyt2VaJ6MpvP9Comy1MceMXqE6bxvaTu4iaxpYYPzhny28Lc+M87/c2cPK6lDg==", "dev": true, "license": "MIT" }, @@ -3254,6 +3503,8 @@ }, "node_modules/eventemitter3": { "version": "5.0.1", + "resolved": "https://registry.npmjs.org/eventemitter3/-/eventemitter3-5.0.1.tgz", + "integrity": "sha512-GWkBvjiSZK87ELrYOSESUYeVIc9mvLLf/nXalMOS5dYrgZq9o5OVkbZAVM06CVxYsCwH9BDZFPlQTlPA1j4ahA==", "dev": true, "license": "MIT" }, @@ -3359,6 +3610,8 @@ }, "node_modules/fast-deep-equal": { "version": "3.1.3", + "resolved": "https://registry.npmjs.org/fast-deep-equal/-/fast-deep-equal-3.1.3.tgz", + "integrity": "sha512-f3qQ9oQy9j2AhBe/H9VC91wLmKBCCU/gDOnKNAYG5hswO7BLKj09Hc5HYNz9cGI++xlpDCIgDaitVs03ATR84Q==", "dev": true, "license": "MIT" }, @@ -3381,25 +3634,43 @@ }, "node_modules/fast-safe-stringify": { "version": "2.1.1", + "resolved": "https://registry.npmjs.org/fast-safe-stringify/-/fast-safe-stringify-2.1.1.tgz", + "integrity": "sha512-W+KJc2dmILlPplD/H4K9l9LcAHAfPtP6BY84uVLXQ6Evcz9Lcg33Y2z1IVblT6xdY54PXYVHEv+0Wpq8Io6zkA==", "dev": true, "license": "MIT" }, - "node_modules/fast-xml-parser": { - "version": "4.5.0", + "node_modules/fast-uri": { + "version": "3.0.6", + "resolved": "https://registry.npmjs.org/fast-uri/-/fast-uri-3.0.6.tgz", + "integrity": "sha512-Atfo14OibSv5wAp4VWNsFYE1AchQRTv9cBGWET4pZWHzYshFSS9NQI6I57rdKn9croWVMbYFbLhJ+yJvmZIIHw==", "dev": true, "funding": [ { "type": "github", - "url": "https://github.com/sponsors/NaturalIntelligence" + "url": "https://github.com/sponsors/fastify" }, { - "type": "paypal", - "url": "https://paypal.me/naturalintelligence" + "type": "opencollective", + "url": "https://opencollective.com/fastify" + } + ], + "license": "BSD-3-Clause", + "peer": true + }, + "node_modules/fast-xml-parser": { + "version": "4.5.3", + "resolved": "https://registry.npmjs.org/fast-xml-parser/-/fast-xml-parser-4.5.3.tgz", + "integrity": "sha512-RKihhV+SHsIUGXObeVy9AXiBbFwkVk7Syp8XgwN5U3JV416+Gwp/GO9i0JYKmikykgz/UHRrrV4ROuZEo/T0ig==", + "dev": true, + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/NaturalIntelligence" } ], "license": "MIT", "dependencies": { - "strnum": "^1.0.5" + "strnum": "^1.1.1" }, "bin": { "fxparser": "src/cli/cli.js" @@ -3493,16 +3764,10 @@ "node": ">=6.4.0" } }, - "node_modules/for-each": { - "version": "0.3.3", - "dev": true, - "license": "MIT", - "dependencies": { - "is-callable": "^1.1.3" - } - }, "node_modules/foreach": { "version": "2.0.6", + "resolved": "https://registry.npmjs.org/foreach/-/foreach-2.0.6.tgz", + "integrity": "sha512-k6GAGDyqLe9JaebCsFCoudPPWfihKu8pylYXRlqP1J7ms39iPoTtk2fviNglIeQEwdh0bQeKJ01ZPyuyQvKzwg==", "dev": true, "license": "MIT" }, @@ -3523,6 +3788,79 @@ "url": "https://github.com/sponsors/isaacs" } }, + "node_modules/foreground-child/node_modules/cross-spawn": { + "version": "6.0.6", + "resolved": "https://registry.npmjs.org/cross-spawn/-/cross-spawn-6.0.6.tgz", + "integrity": "sha512-VqCUuhcd1iB+dsv8gxPttb5iZh/D0iubSP21g36KXdEuf6I5JiioesUVjpCdHV9MZRUfVFlvwtIUyPfxo5trtw==", + "dev": true, + "license": "MIT", + "dependencies": { + "nice-try": "^1.0.4", + "path-key": "^2.0.1", + "semver": "^5.5.0", + "shebang-command": "^1.2.0", + "which": "^1.2.9" + }, + "engines": { + "node": ">=4.8" + } + }, + "node_modules/foreground-child/node_modules/path-key": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/path-key/-/path-key-2.0.1.tgz", + "integrity": "sha512-fEHGKCSmUSDPv4uoj8AlD+joPlq3peND+HRYyxFz4KPw4z926S/b8rIuFs2FYJg3BwsxJf6A9/3eIdLaYC+9Dw==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=4" + } + }, + "node_modules/foreground-child/node_modules/semver": { + "version": "5.7.2", + "resolved": "https://registry.npmjs.org/semver/-/semver-5.7.2.tgz", + "integrity": "sha512-cBznnQ9KjJqU67B52RMC65CMarK2600WFnbkcaiwWq3xy/5haFJlshgnpjovMVJ+Hff49d8GEn0b87C5pDQ10g==", + "dev": true, + "license": "ISC", + "bin": { + "semver": "bin/semver" + } + }, + "node_modules/foreground-child/node_modules/shebang-command": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/shebang-command/-/shebang-command-1.2.0.tgz", + "integrity": "sha512-EV3L1+UQWGor21OmnvojK36mhg+TyIKDh3iFBKBohr5xeXIhNBcx8oWdgkTEEQ+BEFFYdLRuqMfd5L84N1V5Vg==", + "dev": true, + "license": "MIT", + "dependencies": { + "shebang-regex": "^1.0.0" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/foreground-child/node_modules/shebang-regex": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/shebang-regex/-/shebang-regex-1.0.0.tgz", + "integrity": "sha512-wpoSFAxys6b2a2wHZ1XpDSgD7N9iVjg29Ph9uV/uaP9Ex/KXlkTZTeddxDPSYQpgvzKLGJke2UU0AzoGCjNIvQ==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/foreground-child/node_modules/which": { + "version": "1.3.1", + "resolved": "https://registry.npmjs.org/which/-/which-1.3.1.tgz", + "integrity": "sha512-HxJdYWq1MTIQbJ3nw0cqssHoTNU267KlrDuGZ1WYlxDStUtKUhOaJmh112/TZmHxxUfuJqPXSOm7tDyas0OSIQ==", + "dev": true, + "license": "ISC", + "dependencies": { + "isexe": "^2.0.0" + }, + "bin": { + "which": "bin/which" + } + }, "node_modules/form-data": { "version": "4.0.1", "dev": true, @@ -3609,31 +3947,6 @@ "url": "https://github.com/sponsors/ljharb" } }, - "node_modules/function.prototype.name": { - "version": "1.1.6", - "dev": true, - "license": "MIT", - "dependencies": { - "call-bind": "^1.0.2", - "define-properties": "^1.2.0", - "es-abstract": "^1.22.1", - "functions-have-names": "^1.2.3" - }, - "engines": { - "node": ">= 0.4" - }, - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, - "node_modules/functions-have-names": { - "version": "1.2.3", - "dev": true, - "license": "MIT", - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, "node_modules/get-caller-file": { "version": "2.0.5", "dev": true, @@ -3678,22 +3991,6 @@ "dev": true, "license": "MIT" }, - "node_modules/get-symbol-description": { - "version": "1.0.2", - "dev": true, - "license": "MIT", - "dependencies": { - "call-bind": "^1.0.5", - "es-errors": "^1.3.0", - "get-intrinsic": "^1.2.4" - }, - "engines": { - "node": ">= 0.4" - }, - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, "node_modules/glob": { "version": "7.2.3", "dev": true, @@ -3735,21 +4032,6 @@ "node": "*" } }, - "node_modules/globalthis": { - "version": "1.0.4", - "dev": true, - "license": "MIT", - "dependencies": { - "define-properties": "^1.2.1", - "gopd": "^1.0.1" - }, - "engines": { - "node": ">= 0.4" - }, - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, "node_modules/globby": { "version": "14.1.0", "resolved": "https://registry.npmjs.org/globby/-/globby-14.1.0.tgz", @@ -3856,22 +4138,6 @@ "uglify-js": "^3.1.4" } }, - "node_modules/has": { - "version": "1.0.4", - "dev": true, - "license": "MIT", - "engines": { - "node": ">= 0.4.0" - } - }, - "node_modules/has-bigints": { - "version": "1.0.2", - "dev": true, - "license": "MIT", - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, "node_modules/has-flag": { "version": "4.0.0", "dev": true, @@ -3891,20 +4157,6 @@ "url": "https://github.com/sponsors/ljharb" } }, - "node_modules/has-proto": { - "version": "1.2.0", - "dev": true, - "license": "MIT", - "dependencies": { - "dunder-proto": "^1.0.0" - }, - "engines": { - "node": ">= 0.4" - }, - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, "node_modules/has-symbols": { "version": "1.1.0", "dev": true, @@ -3916,20 +4168,6 @@ "url": "https://github.com/sponsors/ljharb" } }, - "node_modules/has-tostringtag": { - "version": "1.0.2", - "dev": true, - "license": "MIT", - "dependencies": { - "has-symbols": "^1.0.3" - }, - "engines": { - "node": ">= 0.4" - }, - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, "node_modules/hasown": { "version": "2.0.2", "dev": true, @@ -3941,40 +4179,6 @@ "node": ">= 0.4" } }, - "node_modules/html-element-map": { - "version": "1.3.1", - "resolved": "https://registry.npmjs.org/html-element-map/-/html-element-map-1.3.1.tgz", - "integrity": "sha512-6XMlxrAFX4UEEGxctfFnmrFaaZFNf9i5fNuV5wZ3WWQ4FVaNP1aX1LkX9j2mfEx1NpjeE/rL3nmgEn23GdFmrg==", - "dev": true, - "peer": true, - "dependencies": { - "array.prototype.filter": "^1.0.0", - "call-bind": "^1.0.2" - }, - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, - "node_modules/htmlparser2": { - "version": "9.1.0", - "resolved": "https://registry.npmjs.org/htmlparser2/-/htmlparser2-9.1.0.tgz", - "integrity": "sha512-5zfg6mHUoaer/97TxnGpxmbR7zJtPwIYFMZ/H5ucTlPZhKvtum05yiPK3Mgai3a0DyVxv7qYqoweaEd2nrYQzQ==", - "dev": true, - "funding": [ - "https://github.com/fb55/htmlparser2?sponsor=1", - { - "type": "github", - "url": "https://github.com/sponsors/fb55" - } - ], - "peer": true, - "dependencies": { - "domelementtype": "^2.3.0", - "domhandler": "^5.0.3", - "domutils": "^3.1.0", - "entities": "^4.5.0" - } - }, "node_modules/http-cache-semantics": { "version": "4.1.1", "dev": true, @@ -4027,6 +4231,8 @@ }, "node_modules/http2-client": { "version": "1.3.5", + "resolved": "https://registry.npmjs.org/http2-client/-/http2-client-1.3.5.tgz", + "integrity": "sha512-EC2utToWl4RKfs5zd36Mxq7nzHHBuomZboI0yYL6Y0RmBgT7Sgkq4rQ0ezFTYoIsSs7Tm9SJe+o2FcAg6GBhGA==", "dev": true, "license": "MIT" }, @@ -4120,19 +4326,6 @@ "dev": true, "license": "ISC" }, - "node_modules/internal-slot": { - "version": "1.0.7", - "dev": true, - "license": "MIT", - "dependencies": { - "es-errors": "^1.3.0", - "hasown": "^2.0.0", - "side-channel": "^1.0.4" - }, - "engines": { - "node": ">= 0.4" - } - }, "node_modules/ip-address": { "version": "9.0.5", "dev": true, @@ -4160,117 +4353,17 @@ "node": ">= 0.10" } }, - "node_modules/is-array-buffer": { - "version": "3.0.4", + "node_modules/is-binary-path": { + "version": "2.1.0", "dev": true, "license": "MIT", "dependencies": { - "call-bind": "^1.0.2", - "get-intrinsic": "^1.2.1" - }, - "engines": { - "node": ">= 0.4" - }, - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, - "node_modules/is-async-function": { - "version": "2.0.0", - "dev": true, - "license": "MIT", - "dependencies": { - "has-tostringtag": "^1.0.0" - }, - "engines": { - "node": ">= 0.4" - }, - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, - "node_modules/is-bigint": { - "version": "1.1.0", - "dev": true, - "license": "MIT", - "dependencies": { - "has-bigints": "^1.0.2" - }, - "engines": { - "node": ">= 0.4" - }, - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, - "node_modules/is-binary-path": { - "version": "2.1.0", - "dev": true, - "license": "MIT", - "dependencies": { - "binary-extensions": "^2.0.0" + "binary-extensions": "^2.0.0" }, "engines": { "node": ">=8" } }, - "node_modules/is-boolean-object": { - "version": "1.2.1", - "dev": true, - "license": "MIT", - "dependencies": { - "call-bound": "^1.0.2", - "has-tostringtag": "^1.0.2" - }, - "engines": { - "node": ">= 0.4" - }, - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, - "node_modules/is-callable": { - "version": "1.2.7", - "dev": true, - "license": "MIT", - "engines": { - "node": ">= 0.4" - }, - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, - "node_modules/is-data-view": { - "version": "1.0.2", - "dev": true, - "license": "MIT", - "dependencies": { - "call-bound": "^1.0.2", - "get-intrinsic": "^1.2.6", - "is-typed-array": "^1.1.13" - }, - "engines": { - "node": ">= 0.4" - }, - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, - "node_modules/is-date-object": { - "version": "1.1.0", - "dev": true, - "license": "MIT", - "dependencies": { - "call-bound": "^1.0.2", - "has-tostringtag": "^1.0.2" - }, - "engines": { - "node": ">= 0.4" - }, - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, "node_modules/is-docker": { "version": "3.0.0", "resolved": "https://registry.npmjs.org/is-docker/-/is-docker-3.0.0.tgz", @@ -4303,20 +4396,6 @@ "node": ">=0.10.0" } }, - "node_modules/is-finalizationregistry": { - "version": "1.1.0", - "dev": true, - "license": "MIT", - "dependencies": { - "call-bind": "^1.0.7" - }, - "engines": { - "node": ">= 0.4" - }, - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, "node_modules/is-fullwidth-code-point": { "version": "3.0.0", "dev": true, @@ -4325,20 +4404,6 @@ "node": ">=8" } }, - "node_modules/is-generator-function": { - "version": "1.0.10", - "dev": true, - "license": "MIT", - "dependencies": { - "has-tostringtag": "^1.0.0" - }, - "engines": { - "node": ">= 0.4" - }, - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, "node_modules/is-glob": { "version": "4.0.3", "dev": true, @@ -4369,28 +4434,6 @@ "url": "https://github.com/sponsors/sindresorhus" } }, - "node_modules/is-map": { - "version": "2.0.3", - "dev": true, - "license": "MIT", - "engines": { - "node": ">= 0.4" - }, - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, - "node_modules/is-negative-zero": { - "version": "2.0.3", - "dev": true, - "license": "MIT", - "engines": { - "node": ">= 0.4" - }, - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, "node_modules/is-number": { "version": "7.0.0", "dev": true, @@ -4399,238 +4442,185 @@ "node": ">=0.12.0" } }, - "node_modules/is-number-object": { - "version": "1.1.0", + "node_modules/is-valid-domain": { + "version": "0.1.6", "dev": true, "license": "MIT", "dependencies": { - "call-bind": "^1.0.7", - "has-tostringtag": "^1.0.2" - }, - "engines": { - "node": ">= 0.4" - }, - "funding": { - "url": "https://github.com/sponsors/ljharb" + "punycode": "^2.1.1" } }, - "node_modules/is-regex": { - "version": "1.2.1", + "node_modules/is-wsl": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/is-wsl/-/is-wsl-3.1.0.tgz", + "integrity": "sha512-UcVfVfaK4Sc4m7X3dUSoHoozQGBEFeDC+zVo06t98xe8CzHSZZBekNXH+tu0NalHolcJ/QAGqS46Hef7QXBIMw==", "dev": true, "license": "MIT", "dependencies": { - "call-bound": "^1.0.2", - "gopd": "^1.2.0", - "has-tostringtag": "^1.0.2", - "hasown": "^2.0.2" + "is-inside-container": "^1.0.0" }, "engines": { - "node": ">= 0.4" - }, - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, - "node_modules/is-set": { - "version": "2.0.3", - "dev": true, - "license": "MIT", - "engines": { - "node": ">= 0.4" + "node": ">=16" }, "funding": { - "url": "https://github.com/sponsors/ljharb" + "url": "https://github.com/sponsors/sindresorhus" } }, - "node_modules/is-shared-array-buffer": { - "version": "1.0.3", + "node_modules/isexe": { + "version": "2.0.0", "dev": true, - "license": "MIT", - "dependencies": { - "call-bind": "^1.0.7" - }, - "engines": { - "node": ">= 0.4" - }, - "funding": { - "url": "https://github.com/sponsors/ljharb" - } + "license": "ISC" }, - "node_modules/is-string": { - "version": "1.1.0", + "node_modules/jackspeak": { + "version": "3.4.3", "dev": true, - "license": "MIT", + "license": "BlueOak-1.0.0", "dependencies": { - "call-bind": "^1.0.7", - "has-tostringtag": "^1.0.2" - }, - "engines": { - "node": ">= 0.4" + "@isaacs/cliui": "^8.0.2" }, "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, - "node_modules/is-subset": { - "version": "0.1.1", - "resolved": "https://registry.npmjs.org/is-subset/-/is-subset-0.1.1.tgz", - "integrity": "sha512-6Ybun0IkarhmEqxXCNw/C0bna6Zb/TkfUX9UbwJtK6ObwAVCxmAP308WWTHviM/zAqXk05cdhYsUsZeGQh99iw==", - "dev": true, - "peer": true - }, - "node_modules/is-symbol": { - "version": "1.1.1", - "dev": true, - "license": "MIT", - "dependencies": { - "call-bound": "^1.0.2", - "has-symbols": "^1.1.0", - "safe-regex-test": "^1.1.0" - }, - "engines": { - "node": ">= 0.4" + "url": "https://github.com/sponsors/isaacs" }, - "funding": { - "url": "https://github.com/sponsors/ljharb" + "optionalDependencies": { + "@pkgjs/parseargs": "^0.11.0" } }, - "node_modules/is-typed-array": { - "version": "1.1.13", + "node_modules/jest-diff": { + "version": "29.7.0", + "resolved": "https://registry.npmjs.org/jest-diff/-/jest-diff-29.7.0.tgz", + "integrity": "sha512-LMIgiIrhigmPrs03JHpxUh2yISK3vLFPkAodPeo0+BuF7wA2FoQbkEg1u8gBYBThncu7e1oEDUfIXVuTqLRUjw==", "dev": true, "license": "MIT", "dependencies": { - "which-typed-array": "^1.1.14" + "chalk": "^4.0.0", + "diff-sequences": "^29.6.3", + "jest-get-type": "^29.6.3", + "pretty-format": "^29.7.0" }, "engines": { - "node": ">= 0.4" - }, - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, - "node_modules/is-valid-domain": { - "version": "0.1.6", - "dev": true, - "license": "MIT", - "dependencies": { - "punycode": "^2.1.1" + "node": "^14.15.0 || ^16.10.0 || >=18.0.0" } }, - "node_modules/is-weakmap": { - "version": "2.0.2", + "node_modules/jest-diff/node_modules/ansi-styles": { + "version": "5.2.0", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-5.2.0.tgz", + "integrity": "sha512-Cxwpt2SfTzTtXcfOlzGEee8O+c+MmUgGrNiBcXnuWxuFJHe6a5Hz7qwhwe5OgaSYI0IJvkLqWX1ASG+cJOkEiA==", "dev": true, "license": "MIT", "engines": { - "node": ">= 0.4" - }, - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, - "node_modules/is-weakref": { - "version": "1.0.2", - "dev": true, - "license": "MIT", - "dependencies": { - "call-bind": "^1.0.2" + "node": ">=10" }, "funding": { - "url": "https://github.com/sponsors/ljharb" + "url": "https://github.com/chalk/ansi-styles?sponsor=1" } }, - "node_modules/is-weakset": { - "version": "2.0.3", + "node_modules/jest-diff/node_modules/jest-get-type": { + "version": "29.6.3", + "resolved": "https://registry.npmjs.org/jest-get-type/-/jest-get-type-29.6.3.tgz", + "integrity": "sha512-zrteXnqYxfQh7l5FHyL38jL39di8H8rHoecLH3JNxH3BwOrBsNeabdap5e0I23lD4HHI8W5VFBZqG4Eaq5LNcw==", "dev": true, "license": "MIT", - "dependencies": { - "call-bind": "^1.0.7", - "get-intrinsic": "^1.2.4" - }, "engines": { - "node": ">= 0.4" - }, - "funding": { - "url": "https://github.com/sponsors/ljharb" + "node": "^14.15.0 || ^16.10.0 || >=18.0.0" } }, - "node_modules/is-wsl": { - "version": "3.1.0", - "resolved": "https://registry.npmjs.org/is-wsl/-/is-wsl-3.1.0.tgz", - "integrity": "sha512-UcVfVfaK4Sc4m7X3dUSoHoozQGBEFeDC+zVo06t98xe8CzHSZZBekNXH+tu0NalHolcJ/QAGqS46Hef7QXBIMw==", + "node_modules/jest-diff/node_modules/pretty-format": { + "version": "29.7.0", + "resolved": "https://registry.npmjs.org/pretty-format/-/pretty-format-29.7.0.tgz", + "integrity": "sha512-Pdlw/oPxN+aXdmM9R00JVC9WVFoCLTKJvDVLgmJ+qAffBMxsV85l/Lu7sNx4zSzPyoL2euImuEwHhOXdEgNFZQ==", "dev": true, "license": "MIT", "dependencies": { - "is-inside-container": "^1.0.0" + "@jest/schemas": "^29.6.3", + "ansi-styles": "^5.0.0", + "react-is": "^18.0.0" }, "engines": { - "node": ">=16" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" + "node": "^14.15.0 || ^16.10.0 || >=18.0.0" } }, - "node_modules/isarray": { - "version": "2.0.5", + "node_modules/jest-diff/node_modules/react-is": { + "version": "18.3.1", + "resolved": "https://registry.npmjs.org/react-is/-/react-is-18.3.1.tgz", + "integrity": "sha512-/LLMVyas0ljjAtoYiPqYiL8VWXzUUdThrmU5+n20DZv+a+ClRoevUzw5JxU+Ieh5/c87ytoTBV9G1FiKfNJdmg==", "dev": true, "license": "MIT" }, - "node_modules/isexe": { - "version": "2.0.0", - "dev": true, - "license": "ISC" - }, - "node_modules/jackspeak": { - "version": "3.4.3", + "node_modules/jest-get-type": { + "version": "27.5.1", + "resolved": "https://registry.npmjs.org/jest-get-type/-/jest-get-type-27.5.1.tgz", + "integrity": "sha512-2KY95ksYSaK7DMBWQn6dQz3kqAf3BB64y2udeG+hv4KfSOb9qwcYQstTJc1KCbsix+wLZWZYN8t7nwX3GOBLRw==", "dev": true, - "license": "BlueOak-1.0.0", - "dependencies": { - "@isaacs/cliui": "^8.0.2" - }, - "funding": { - "url": "https://github.com/sponsors/isaacs" - }, - "optionalDependencies": { - "@pkgjs/parseargs": "^0.11.0" + "license": "MIT", + "engines": { + "node": "^10.13.0 || ^12.13.0 || ^14.15.0 || >=15.0.0" } }, - "node_modules/jest-diff": { - "version": "27.5.1", + "node_modules/jest-matcher-utils": { + "version": "29.7.0", + "resolved": "https://registry.npmjs.org/jest-matcher-utils/-/jest-matcher-utils-29.7.0.tgz", + "integrity": "sha512-sBkD+Xi9DtcChsI3L3u0+N0opgPYnCRPtGcQYrgXmR+hmt/fYfWAL0xRXYU8eWOdfuLgBe0YCW3AFtnRLagq/g==", "dev": true, "license": "MIT", "dependencies": { "chalk": "^4.0.0", - "diff-sequences": "^27.5.1", - "jest-get-type": "^27.5.1", - "pretty-format": "^27.5.1" + "jest-diff": "^29.7.0", + "jest-get-type": "^29.6.3", + "pretty-format": "^29.7.0" }, "engines": { - "node": "^10.13.0 || ^12.13.0 || ^14.15.0 || >=15.0.0" + "node": "^14.15.0 || ^16.10.0 || >=18.0.0" } }, - "node_modules/jest-get-type": { - "version": "27.5.1", + "node_modules/jest-matcher-utils/node_modules/ansi-styles": { + "version": "5.2.0", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-5.2.0.tgz", + "integrity": "sha512-Cxwpt2SfTzTtXcfOlzGEee8O+c+MmUgGrNiBcXnuWxuFJHe6a5Hz7qwhwe5OgaSYI0IJvkLqWX1ASG+cJOkEiA==", "dev": true, "license": "MIT", "engines": { - "node": "^10.13.0 || ^12.13.0 || ^14.15.0 || >=15.0.0" + "node": ">=10" + }, + "funding": { + "url": "https://github.com/chalk/ansi-styles?sponsor=1" } }, - "node_modules/jest-matcher-utils": { - "version": "27.5.1", + "node_modules/jest-matcher-utils/node_modules/jest-get-type": { + "version": "29.6.3", + "resolved": "https://registry.npmjs.org/jest-get-type/-/jest-get-type-29.6.3.tgz", + "integrity": "sha512-zrteXnqYxfQh7l5FHyL38jL39di8H8rHoecLH3JNxH3BwOrBsNeabdap5e0I23lD4HHI8W5VFBZqG4Eaq5LNcw==", + "dev": true, + "license": "MIT", + "engines": { + "node": "^14.15.0 || ^16.10.0 || >=18.0.0" + } + }, + "node_modules/jest-matcher-utils/node_modules/pretty-format": { + "version": "29.7.0", + "resolved": "https://registry.npmjs.org/pretty-format/-/pretty-format-29.7.0.tgz", + "integrity": "sha512-Pdlw/oPxN+aXdmM9R00JVC9WVFoCLTKJvDVLgmJ+qAffBMxsV85l/Lu7sNx4zSzPyoL2euImuEwHhOXdEgNFZQ==", "dev": true, "license": "MIT", "dependencies": { - "chalk": "^4.0.0", - "jest-diff": "^27.5.1", - "jest-get-type": "^27.5.1", - "pretty-format": "^27.5.1" + "@jest/schemas": "^29.6.3", + "ansi-styles": "^5.0.0", + "react-is": "^18.0.0" }, "engines": { - "node": "^10.13.0 || ^12.13.0 || ^14.15.0 || >=15.0.0" + "node": "^14.15.0 || ^16.10.0 || >=18.0.0" } }, + "node_modules/jest-matcher-utils/node_modules/react-is": { + "version": "18.3.1", + "resolved": "https://registry.npmjs.org/react-is/-/react-is-18.3.1.tgz", + "integrity": "sha512-/LLMVyas0ljjAtoYiPqYiL8VWXzUUdThrmU5+n20DZv+a+ClRoevUzw5JxU+Ieh5/c87ytoTBV9G1FiKfNJdmg==", + "dev": true, + "license": "MIT" + }, "node_modules/js-levenshtein": { "version": "1.1.6", + "resolved": "https://registry.npmjs.org/js-levenshtein/-/js-levenshtein-1.1.6.tgz", + "integrity": "sha512-X2BB11YZtrRqY4EnQcLX5Rh373zbK4alC1FW7D7MBhL2gtcC17cTnr6DmfHZeS0s2rTHjUTMMHfG7gO8SSdw+g==", "dev": true, "license": "MIT", "engines": { @@ -4639,11 +4629,15 @@ }, "node_modules/js-tokens": { "version": "4.0.0", + "resolved": "https://registry.npmjs.org/js-tokens/-/js-tokens-4.0.0.tgz", + "integrity": "sha512-RdJUflcE3cUzKiMqQgsCu06FPu9UdIJO0beYbPhHN4k6apgJtifcoCtT9bcxOpYBtpD2kCM6Sbzg4CausW/PKQ==", "dev": true, "license": "MIT" }, "node_modules/js-yaml": { "version": "4.1.0", + "resolved": "https://registry.npmjs.org/js-yaml/-/js-yaml-4.1.0.tgz", + "integrity": "sha512-wpxZs9NoxZaJESJGIZTyDEaYpl0FKSA+FB9aJiyemKhMwkxQg63h4T1KJgUGHpTqPDNRcmmYLugrRjJlBtWvRA==", "dev": true, "license": "MIT", "dependencies": { @@ -4658,6 +4652,16 @@ "dev": true, "license": "MIT" }, + "node_modules/jsep": { + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/jsep/-/jsep-1.4.0.tgz", + "integrity": "sha512-B7qPcEVE3NVkmSJbaYxvv4cHkVW7DQsZz13pUMrfS8z8Q/BuShN+gcTXrUlPiGqM2/t/EEaI030bpxMqY8gMlw==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">= 10.16.0" + } + }, "node_modules/jsesc": { "version": "3.1.0", "dev": true, @@ -4671,6 +4675,8 @@ }, "node_modules/json-pointer": { "version": "0.6.2", + "resolved": "https://registry.npmjs.org/json-pointer/-/json-pointer-0.6.2.tgz", + "integrity": "sha512-vLWcKbOaXlO+jvRy4qNd+TI1QUPZzfJj1tpJ3vAXDych5XJf93ftpUKe5pKCrzyIIwgBJcOcCVRUfqQP25afBw==", "dev": true, "license": "MIT", "dependencies": { @@ -4679,6 +4685,8 @@ }, "node_modules/json-schema-traverse": { "version": "1.0.0", + "resolved": "https://registry.npmjs.org/json-schema-traverse/-/json-schema-traverse-1.0.0.tgz", + "integrity": "sha512-NM8/P9n3XjXhIZn1lLhkFaACTOURQXjWhV4BA/RnOv8xvgqtqpAX9IO4mRQxSx1Rlo4tqzeqb0sOlruaOy3dug==", "dev": true, "license": "MIT" }, @@ -4695,6 +4703,35 @@ "graceful-fs": "^4.1.6" } }, + "node_modules/jsonpath-plus": { + "version": "10.3.0", + "resolved": "https://registry.npmjs.org/jsonpath-plus/-/jsonpath-plus-10.3.0.tgz", + "integrity": "sha512-8TNmfeTCk2Le33A3vRRwtuworG/L5RrgMvdjhKZxvyShO+mBu2fP50OWUjRLNtvw344DdDarFh9buFAZs5ujeA==", + "dev": true, + "license": "MIT", + "dependencies": { + "@jsep-plugin/assignment": "^1.3.0", + "@jsep-plugin/regex": "^1.0.4", + "jsep": "^1.4.0" + }, + "bin": { + "jsonpath": "bin/jsonpath-cli.js", + "jsonpath-plus": "bin/jsonpath-cli.js" + }, + "engines": { + "node": ">=18.0.0" + } + }, + "node_modules/jsonpointer": { + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/jsonpointer/-/jsonpointer-5.0.1.tgz", + "integrity": "sha512-p/nXbhSEcu3pZRdkW1OfJhpsVtW1gd4Wa1fnQc9YLiTfAjn0312eMKimbdIQzuZl9aa9xUGaRlP9T/CJE/ditQ==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=0.10.0" + } + }, "node_modules/kind-of": { "version": "6.0.3", "dev": true, @@ -4740,32 +4777,32 @@ "url": "https://github.com/sponsors/sindresorhus" } }, + "node_modules/leven": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/leven/-/leven-3.1.0.tgz", + "integrity": "sha512-qsda+H8jTaUaN/x5vzW2rzc+8Rw4TAQ/4KjB46IwK5VH+IlVeeeje/EoZRpiXvIqjFgK84QffqPztGI3VBLG1A==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=6" + } + }, "node_modules/lodash": { "version": "4.17.21", "dev": true, "license": "MIT" }, - "node_modules/lodash.escape": { - "version": "4.0.1", - "resolved": "https://registry.npmjs.org/lodash.escape/-/lodash.escape-4.0.1.tgz", - "integrity": "sha512-nXEOnb/jK9g0DYMr1/Xvq6l5xMD7GDG55+GSYIYmS0G4tBk/hURD4JR9WCavs04t33WmJx9kCyp9vJ+mr4BOUw==", - "dev": true, - "peer": true - }, - "node_modules/lodash.flattendeep": { - "version": "4.4.0", - "resolved": "https://registry.npmjs.org/lodash.flattendeep/-/lodash.flattendeep-4.4.0.tgz", - "integrity": "sha512-uHaJFihxmJcEX3kT4I23ABqKKalJ/zDrDg0lsFtc1h+3uw49SIJ5beyhx5ExVRti3AvKoOJngIj7xz3oylPdWQ==", - "dev": true, - "peer": true - }, - "node_modules/lodash.isequal": { - "version": "4.5.0", + "node_modules/long": { + "version": "5.3.2", + "resolved": "https://registry.npmjs.org/long/-/long-5.3.2.tgz", + "integrity": "sha512-mNAgZ1GmyNhD7AuqnTG3/VQ26o760+ZYBPKjPvugO8+nLbYfX6TVpJPseBvopbdY+qpZ/lKUnmEc1LeZYS3QAA==", "dev": true, - "license": "MIT" + "license": "Apache-2.0" }, "node_modules/loose-envify": { "version": "1.4.0", + "resolved": "https://registry.npmjs.org/loose-envify/-/loose-envify-1.4.0.tgz", + "integrity": "sha512-lyuxPGr/Wfhrlem2CL/UcnUc1zcqKAImBDzukY7Y5F/yQiNdko6+fRLevlw1HgMySw7f611UIY408EtxRSoK3Q==", "dev": true, "license": "MIT", "dependencies": { @@ -4782,6 +4819,8 @@ }, "node_modules/lunr": { "version": "2.3.9", + "resolved": "https://registry.npmjs.org/lunr/-/lunr-2.3.9.tgz", + "integrity": "sha512-zTU3DaZaF3Rt9rhN3uBMGQD3dD2/vFQqnvZCDv4dl5iOzq2IZQqTxu90r4E5J+nP70J3ilqVCrbho2eWaeW8Ow==", "dev": true, "license": "MIT" }, @@ -4808,11 +4847,15 @@ }, "node_modules/mark.js": { "version": "8.11.1", + "resolved": "https://registry.npmjs.org/mark.js/-/mark.js-8.11.1.tgz", + "integrity": "sha512-1I+1qpDt4idfgLQG+BNWmrqku+7/2bi5nLf4YwF8y8zXvmfiTBY3PV3ZibfrjBueCByROpuBjLLFCajqkgYoLQ==", "dev": true, "license": "MIT" }, "node_modules/marked": { "version": "4.3.0", + "resolved": "https://registry.npmjs.org/marked/-/marked-4.3.0.tgz", + "integrity": "sha512-PRsaiG84bK+AMvxziE/lCFss8juXjNaWzVbN5tXAm4XjeaS9NAHhop+PjQxz2A9h8Q4M/xGmzP8vqNwy6JeK0A==", "dev": true, "license": "MIT", "bin": { @@ -4949,6 +4992,8 @@ }, "node_modules/minimatch": { "version": "5.1.6", + "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-5.1.6.tgz", + "integrity": "sha512-lKwV/1brpG6mBUFHtb7NUmtABCb2WZZmm2wNiOA5hAb8VdCS4B3dtMWyvcoViccwAW/COERjXLt0zP1zXUN26g==", "dev": true, "license": "ISC", "dependencies": { @@ -4959,7 +5004,9 @@ } }, "node_modules/minimatch/node_modules/brace-expansion": { - "version": "2.0.1", + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-2.0.2.tgz", + "integrity": "sha512-Jt0vHyM+jmUBqojB7E1NIYadt0vI0Qxjxd2TErW94wDz+E2LAm5vKMXXwg6ZZBTHPuUlDgQHKXvjGBdfcF1ZDQ==", "dev": true, "license": "MIT", "dependencies": { @@ -5088,7 +5135,9 @@ } }, "node_modules/minizlib/node_modules/brace-expansion": { - "version": "2.0.1", + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-2.0.2.tgz", + "integrity": "sha512-Jt0vHyM+jmUBqojB7E1NIYadt0vI0Qxjxd2TErW94wDz+E2LAm5vKMXXwg6ZZBTHPuUlDgQHKXvjGBdfcF1ZDQ==", "dev": true, "license": "MIT", "dependencies": { @@ -5154,7 +5203,9 @@ } }, "node_modules/mobx": { - "version": "6.13.5", + "version": "6.13.7", + "resolved": "https://registry.npmjs.org/mobx/-/mobx-6.13.7.tgz", + "integrity": "sha512-aChaVU/DO5aRPmk1GX8L+whocagUUpBQqoPtJk+cm7UOXUk87J4PeWCh6nNmTTIfEhiR9DI/+FnA8dln/hTK7g==", "dev": true, "license": "MIT", "funding": { @@ -5164,6 +5215,8 @@ }, "node_modules/mobx-react": { "version": "9.2.0", + "resolved": "https://registry.npmjs.org/mobx-react/-/mobx-react-9.2.0.tgz", + "integrity": "sha512-dkGWCx+S0/1mfiuFfHRH8D9cplmwhxOV5CkXMp38u6rQGG2Pv3FWYztS0M7ncR6TyPRQKaTG/pnitInoYE9Vrw==", "dev": true, "license": "MIT", "dependencies": { @@ -5188,6 +5241,8 @@ }, "node_modules/mobx-react-lite": { "version": "4.1.0", + "resolved": "https://registry.npmjs.org/mobx-react-lite/-/mobx-react-lite-4.1.0.tgz", + "integrity": "sha512-QEP10dpHHBeQNv1pks3WnHRCem2Zp636lq54M2nKO2Sarr13pL4u6diQXf65yzXUn0mkk18SyIDCm9UOJYTi1w==", "dev": true, "license": "MIT", "dependencies": { @@ -5210,13 +5265,6 @@ } } }, - "node_modules/moo": { - "version": "0.5.2", - "resolved": "https://registry.npmjs.org/moo/-/moo-0.5.2.tgz", - "integrity": "sha512-iSAJLHYKnX41mKcJKjqvnAN9sf0LMDTXDEvFv+ffuRR9a1MIuXLjMNL6EsnDHSkKLTWNqQQ5uo61P4EbU4NU+Q==", - "dev": true, - "peer": true - }, "node_modules/ms": { "version": "2.1.3", "dev": true, @@ -5241,36 +5289,6 @@ "node": "^10 || ^12 || ^13.7 || ^14 || >=15.0.1" } }, - "node_modules/nearley": { - "version": "2.20.1", - "resolved": "https://registry.npmjs.org/nearley/-/nearley-2.20.1.tgz", - "integrity": "sha512-+Mc8UaAebFzgV+KpI5n7DasuuQCHA89dmwm7JXw3TV43ukfNQ9DnBH3Mdb2g/I4Fdxc26pwimBWvjIw0UAILSQ==", - "dev": true, - "peer": true, - "dependencies": { - "commander": "^2.19.0", - "moo": "^0.5.0", - "railroad-diagrams": "^1.0.0", - "randexp": "0.4.6" - }, - "bin": { - "nearley-railroad": "bin/nearley-railroad.js", - "nearley-test": "bin/nearley-test.js", - "nearley-unparse": "bin/nearley-unparse.js", - "nearleyc": "bin/nearleyc.js" - }, - "funding": { - "type": "individual", - "url": "https://nearley.js.org/#give-to-nearley" - } - }, - "node_modules/nearley/node_modules/commander": { - "version": "2.20.3", - "resolved": "https://registry.npmjs.org/commander/-/commander-2.20.3.tgz", - "integrity": "sha512-GpVkmM8vF2vQUkj2LvZmD35JxeJOLCwJ9cUkugyk2nuhbv3+mJvpLYYt+0+USMxE+oj+ey/lJEnhZw75x/OMcQ==", - "dev": true, - "peer": true - }, "node_modules/negotiator": { "version": "1.0.0", "dev": true, @@ -5304,7 +5322,9 @@ } }, "node_modules/node-elm-compiler/node_modules/cross-spawn": { - "version": "6.0.5", + "version": "6.0.6", + "resolved": "https://registry.npmjs.org/cross-spawn/-/cross-spawn-6.0.6.tgz", + "integrity": "sha512-VqCUuhcd1iB+dsv8gxPttb5iZh/D0iubSP21g36KXdEuf6I5JiioesUVjpCdHV9MZRUfVFlvwtIUyPfxo5trtw==", "dev": true, "license": "MIT", "dependencies": { @@ -5366,6 +5386,8 @@ }, "node_modules/node-fetch": { "version": "2.7.0", + "resolved": "https://registry.npmjs.org/node-fetch/-/node-fetch-2.7.0.tgz", + "integrity": "sha512-c4FRfUm/dbcWZ7U+1Wq0AwCyFL+3nt2bEw05wfxSz+DWpWsitgmSgYmy2dQdWyKC1694ELPqMs/YzUSNozLt8A==", "dev": true, "license": "MIT", "dependencies": { @@ -5385,6 +5407,8 @@ }, "node_modules/node-fetch-h2": { "version": "2.3.0", + "resolved": "https://registry.npmjs.org/node-fetch-h2/-/node-fetch-h2-2.3.0.tgz", + "integrity": "sha512-ofRW94Ab0T4AOh5Fk8t0h8OBWrmjb0SSB20xh1H8YnPV9EJ+f5AMoYSUQ2zgJ4Iq2HAK0I2l5/Nequ8YzFS3Hg==", "dev": true, "license": "MIT", "dependencies": { @@ -5394,8 +5418,35 @@ "node": "4.x || >=6.0.0" } }, + "node_modules/node-fetch/node_modules/tr46": { + "version": "0.0.3", + "resolved": "https://registry.npmjs.org/tr46/-/tr46-0.0.3.tgz", + "integrity": "sha512-N3WMsuqV66lT30CrXNbEjx4GEwlow3v6rr4mCcv6prnfwhS01rkgyFdjPNBYd9br7LpXV1+Emh01fHnq2Gdgrw==", + "dev": true, + "license": "MIT" + }, + "node_modules/node-fetch/node_modules/webidl-conversions": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/webidl-conversions/-/webidl-conversions-3.0.1.tgz", + "integrity": "sha512-2JAn3z8AR6rjK8Sm8orRC0h/bcl/DqL7tRPdGZ4I1CjdF+EaMLmYxBHyXuKL849eucPFhvBoxMsflfOb8kxaeQ==", + "dev": true, + "license": "BSD-2-Clause" + }, + "node_modules/node-fetch/node_modules/whatwg-url": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/whatwg-url/-/whatwg-url-5.0.0.tgz", + "integrity": "sha512-saE57nupxk6v3HY35+jzBwYa0rKSy0XR8JSxZPwgLr7ys0IBzhGviA1/TUGJLmSVqs8pb9AnvICXEuOHLprYTw==", + "dev": true, + "license": "MIT", + "dependencies": { + "tr46": "~0.0.3", + "webidl-conversions": "^3.0.0" + } + }, "node_modules/node-readfiles": { "version": "0.2.0", + "resolved": "https://registry.npmjs.org/node-readfiles/-/node-readfiles-0.2.0.tgz", + "integrity": "sha512-SU00ZarexNlE4Rjdm83vglt5Y9yiQ+XI1XpflWlb7q7UTN1JUItm69xMeiQCTxtTfnzt+83T8Cx+vI2ED++VDA==", "dev": true, "license": "MIT", "dependencies": { @@ -5410,21 +5461,10 @@ "node": ">=0.10.0" } }, - "node_modules/nth-check": { - "version": "2.1.1", - "resolved": "https://registry.npmjs.org/nth-check/-/nth-check-2.1.1.tgz", - "integrity": "sha512-lqjrjmaOoAnWfMmBPL+XNnynZh2+swxiX3WUE0s4yEHI6m+AwrK2UZOimIRl3X/4QctVqS8AiZjFqyOGrMXb/w==", - "dev": true, - "peer": true, - "dependencies": { - "boolbase": "^1.0.0" - }, - "funding": { - "url": "https://github.com/fb55/nth-check?sponsor=1" - } - }, "node_modules/oas-kit-common": { "version": "1.0.8", + "resolved": "https://registry.npmjs.org/oas-kit-common/-/oas-kit-common-1.0.8.tgz", + "integrity": "sha512-pJTS2+T0oGIwgjGpw7sIRU8RQMcUoKCDWFLdBqKB2BNmGpbBMH2sdqAaOXUg8OzonZHU0L7vfJu1mJFEiYDWOQ==", "dev": true, "license": "BSD-3-Clause", "dependencies": { @@ -5433,6 +5473,8 @@ }, "node_modules/oas-linter": { "version": "3.2.2", + "resolved": "https://registry.npmjs.org/oas-linter/-/oas-linter-3.2.2.tgz", + "integrity": "sha512-KEGjPDVoU5K6swgo9hJVA/qYGlwfbFx+Kg2QB/kd7rzV5N8N5Mg6PlsoCMohVnQmo+pzJap/F610qTodKzecGQ==", "dev": true, "license": "BSD-3-Clause", "dependencies": { @@ -5449,12 +5491,15 @@ "resolved": "https://registry.npmjs.org/yaml/-/yaml-1.10.2.tgz", "integrity": "sha512-r3vXyErRCYJ7wg28yvBY5VSoAF8ZvlcW9/BwUzEtUsjvX/DKs24dIkuwjtuprwJJHsbyUbLApepYTR1BN4uHrg==", "dev": true, + "license": "ISC", "engines": { "node": ">= 6" } }, "node_modules/oas-resolver": { "version": "2.5.6", + "resolved": "https://registry.npmjs.org/oas-resolver/-/oas-resolver-2.5.6.tgz", + "integrity": "sha512-Yx5PWQNZomfEhPPOphFbZKi9W93CocQj18NlD2Pa4GWZzdZpSJvYwoiuurRI7m3SpcChrnO08hkuQDL3FGsVFQ==", "dev": true, "license": "BSD-3-Clause", "dependencies": { @@ -5471,17 +5516,64 @@ "url": "https://github.com/Mermade/oas-kit?sponsor=1" } }, + "node_modules/oas-resolver/node_modules/cliui": { + "version": "8.0.1", + "resolved": "https://registry.npmjs.org/cliui/-/cliui-8.0.1.tgz", + "integrity": "sha512-BSeNnyus75C4//NQ9gQt1/csTXyo/8Sb+afLAkzAptFuMsod9HFokGNudZpi/oQV73hnVK+sR+5PVRMd+Dr7YQ==", + "dev": true, + "license": "ISC", + "dependencies": { + "string-width": "^4.2.0", + "strip-ansi": "^6.0.1", + "wrap-ansi": "^7.0.0" + }, + "engines": { + "node": ">=12" + } + }, "node_modules/oas-resolver/node_modules/yaml": { "version": "1.10.2", "resolved": "https://registry.npmjs.org/yaml/-/yaml-1.10.2.tgz", "integrity": "sha512-r3vXyErRCYJ7wg28yvBY5VSoAF8ZvlcW9/BwUzEtUsjvX/DKs24dIkuwjtuprwJJHsbyUbLApepYTR1BN4uHrg==", "dev": true, + "license": "ISC", "engines": { "node": ">= 6" } }, + "node_modules/oas-resolver/node_modules/yargs": { + "version": "17.7.2", + "resolved": "https://registry.npmjs.org/yargs/-/yargs-17.7.2.tgz", + "integrity": "sha512-7dSzzRQ++CKnNI/krKnYRV7JKKPUXMEh61soaHKg9mrWEhzFWhFnxPxGl+69cD1Ou63C13NUPCnmIcrvqCuM6w==", + "dev": true, + "license": "MIT", + "dependencies": { + "cliui": "^8.0.1", + "escalade": "^3.1.1", + "get-caller-file": "^2.0.5", + "require-directory": "^2.1.1", + "string-width": "^4.2.3", + "y18n": "^5.0.5", + "yargs-parser": "^21.1.1" + }, + "engines": { + "node": ">=12" + } + }, + "node_modules/oas-resolver/node_modules/yargs-parser": { + "version": "21.1.1", + "resolved": "https://registry.npmjs.org/yargs-parser/-/yargs-parser-21.1.1.tgz", + "integrity": "sha512-tVpsJW7DdjecAiFpbIB1e3qxIQsE6NoPc5/eTdrbbIC4h0LVsWhnoa3g+m2HclBIujHzsxZ4VJVA+GUuc2/LBw==", + "dev": true, + "license": "ISC", + "engines": { + "node": ">=12" + } + }, "node_modules/oas-schema-walker": { "version": "1.1.5", + "resolved": "https://registry.npmjs.org/oas-schema-walker/-/oas-schema-walker-1.1.5.tgz", + "integrity": "sha512-2yucenq1a9YPmeNExoUa9Qwrt9RFkjqaMAA1X+U7sbb0AqBeTIdMHky9SQQ6iN94bO5NW0W4TRYXerG+BdAvAQ==", "dev": true, "license": "BSD-3-Clause", "funding": { @@ -5490,6 +5582,8 @@ }, "node_modules/oas-validator": { "version": "5.0.8", + "resolved": "https://registry.npmjs.org/oas-validator/-/oas-validator-5.0.8.tgz", + "integrity": "sha512-cu20/HE5N5HKqVygs3dt94eYJfBi0TsZvPVXDhbXQHiEityDN+RROTleefoKRKKJ9dFAF2JBkDHgvWj0sjKGmw==", "dev": true, "license": "BSD-3-Clause", "dependencies": { @@ -5511,12 +5605,15 @@ "resolved": "https://registry.npmjs.org/yaml/-/yaml-1.10.2.tgz", "integrity": "sha512-r3vXyErRCYJ7wg28yvBY5VSoAF8ZvlcW9/BwUzEtUsjvX/DKs24dIkuwjtuprwJJHsbyUbLApepYTR1BN4uHrg==", "dev": true, + "license": "ISC", "engines": { "node": ">= 6" } }, "node_modules/object-assign": { "version": "4.1.1", + "resolved": "https://registry.npmjs.org/object-assign/-/object-assign-4.1.1.tgz", + "integrity": "sha512-rJgTQnkUnH1sFw8yT6VSU3zD3sWmu6sZhIseY8VX+GRu3P6F7Fu+JNDoXfklElbLJSnc3FUQHVe4cU5hj+BcUg==", "dev": true, "license": "MIT", "engines": { @@ -5534,79 +5631,6 @@ "url": "https://github.com/sponsors/ljharb" } }, - "node_modules/object-is": { - "version": "1.1.6", - "dev": true, - "license": "MIT", - "dependencies": { - "call-bind": "^1.0.7", - "define-properties": "^1.2.1" - }, - "engines": { - "node": ">= 0.4" - }, - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, - "node_modules/object-keys": { - "version": "1.1.1", - "dev": true, - "license": "MIT", - "engines": { - "node": ">= 0.4" - } - }, - "node_modules/object.assign": { - "version": "4.1.5", - "dev": true, - "license": "MIT", - "dependencies": { - "call-bind": "^1.0.5", - "define-properties": "^1.2.1", - "has-symbols": "^1.0.3", - "object-keys": "^1.1.1" - }, - "engines": { - "node": ">= 0.4" - }, - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, - "node_modules/object.entries": { - "version": "1.1.8", - "resolved": "https://registry.npmjs.org/object.entries/-/object.entries-1.1.8.tgz", - "integrity": "sha512-cmopxi8VwRIAw/fkijJohSfpef5PdN0pMQJN6VC/ZKvn0LIknWD8KtgY6KlQdEc4tIjcQ3HxSMmnvtzIscdaYQ==", - "dev": true, - "peer": true, - "dependencies": { - "call-bind": "^1.0.7", - "define-properties": "^1.2.1", - "es-object-atoms": "^1.0.0" - }, - "engines": { - "node": ">= 0.4" - } - }, - "node_modules/object.values": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/object.values/-/object.values-1.2.0.tgz", - "integrity": "sha512-yBYjY9QX2hnRmZHAjG/f13MzmBzxzYgQhFrke06TTyKY5zSTEqkOeukBzIdVA3j3ulu8Qa3MbVFShV7T2RmGtQ==", - "dev": true, - "peer": true, - "dependencies": { - "call-bind": "^1.0.7", - "define-properties": "^1.2.1", - "es-object-atoms": "^1.0.0" - }, - "engines": { - "node": ">= 0.4" - }, - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, "node_modules/on-finished": { "version": "2.4.1", "resolved": "https://registry.npmjs.org/on-finished/-/on-finished-2.4.1.tgz", @@ -5663,6 +5687,8 @@ }, "node_modules/openapi-sampler": { "version": "1.6.1", + "resolved": "https://registry.npmjs.org/openapi-sampler/-/openapi-sampler-1.6.1.tgz", + "integrity": "sha512-s1cIatOqrrhSj2tmJ4abFYZQK6l5v+V4toO5q1Pa0DyN8mtyqy2I+Qrj5W9vOELEtybIMQs/TBZGVO/DtTFK8w==", "dev": true, "license": "MIT", "dependencies": { @@ -5679,6 +5705,13 @@ "node": ">=0.10.0" } }, + "node_modules/outdent": { + "version": "0.8.0", + "resolved": "https://registry.npmjs.org/outdent/-/outdent-0.8.0.tgz", + "integrity": "sha512-KiOAIsdpUTcAXuykya5fnVVT+/5uS0Q1mrkRHcF89tpieSmY33O/tmc54CqwA+bfhbtEfZUNLHaPUiB9X3jt1A==", + "dev": true, + "license": "MIT" + }, "node_modules/p-map": { "version": "7.0.3", "dev": true, @@ -5714,65 +5747,100 @@ "dev": true, "license": "BlueOak-1.0.0" }, - "node_modules/parse5": { - "version": "7.2.1", - "resolved": "https://registry.npmjs.org/parse5/-/parse5-7.2.1.tgz", - "integrity": "sha512-BuBYQYlv1ckiPdQi/ohiivi9Sagc9JG+Ozs0r7b/0iK3sKmrb0b9FdWdBbOdx6hBCM/F9Ir82ofnBhtZOjCRPQ==", + "node_modules/parseurl": { + "version": "1.3.3", "dev": true, - "peer": true, + "license": "MIT", + "engines": { + "node": ">= 0.8" + } + }, + "node_modules/password-prompt": { + "version": "1.1.3", + "dev": true, + "license": "0BSD", "dependencies": { - "entities": "^4.5.0" - }, - "funding": { - "url": "https://github.com/inikulin/parse5?sponsor=1" + "ansi-escapes": "^4.3.2", + "cross-spawn": "^7.0.3" } }, - "node_modules/parse5-htmlparser2-tree-adapter": { - "version": "7.1.0", - "resolved": "https://registry.npmjs.org/parse5-htmlparser2-tree-adapter/-/parse5-htmlparser2-tree-adapter-7.1.0.tgz", - "integrity": "sha512-ruw5xyKs6lrpo9x9rCZqZZnIUntICjQAd0Wsmp396Ul9lN/h+ifgVV1x1gZHi8euej6wTfpqX8j+BFQxF0NS/g==", + "node_modules/password-prompt/node_modules/cross-spawn": { + "version": "6.0.6", + "resolved": "https://registry.npmjs.org/cross-spawn/-/cross-spawn-6.0.6.tgz", + "integrity": "sha512-VqCUuhcd1iB+dsv8gxPttb5iZh/D0iubSP21g36KXdEuf6I5JiioesUVjpCdHV9MZRUfVFlvwtIUyPfxo5trtw==", "dev": true, - "peer": true, + "license": "MIT", "dependencies": { - "domhandler": "^5.0.3", - "parse5": "^7.0.0" + "nice-try": "^1.0.4", + "path-key": "^2.0.1", + "semver": "^5.5.0", + "shebang-command": "^1.2.0", + "which": "^1.2.9" }, - "funding": { - "url": "https://github.com/inikulin/parse5?sponsor=1" + "engines": { + "node": ">=4.8" } }, - "node_modules/parse5-parser-stream": { - "version": "7.1.2", - "resolved": "https://registry.npmjs.org/parse5-parser-stream/-/parse5-parser-stream-7.1.2.tgz", - "integrity": "sha512-JyeQc9iwFLn5TbvvqACIF/VXG6abODeB3Fwmv/TGdLk2LfbWkaySGY72at4+Ty7EkPZj854u4CrICqNk2qIbow==", + "node_modules/password-prompt/node_modules/path-key": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/path-key/-/path-key-2.0.1.tgz", + "integrity": "sha512-fEHGKCSmUSDPv4uoj8AlD+joPlq3peND+HRYyxFz4KPw4z926S/b8rIuFs2FYJg3BwsxJf6A9/3eIdLaYC+9Dw==", "dev": true, - "peer": true, + "license": "MIT", + "engines": { + "node": ">=4" + } + }, + "node_modules/password-prompt/node_modules/semver": { + "version": "5.7.2", + "resolved": "https://registry.npmjs.org/semver/-/semver-5.7.2.tgz", + "integrity": "sha512-cBznnQ9KjJqU67B52RMC65CMarK2600WFnbkcaiwWq3xy/5haFJlshgnpjovMVJ+Hff49d8GEn0b87C5pDQ10g==", + "dev": true, + "license": "ISC", + "bin": { + "semver": "bin/semver" + } + }, + "node_modules/password-prompt/node_modules/shebang-command": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/shebang-command/-/shebang-command-1.2.0.tgz", + "integrity": "sha512-EV3L1+UQWGor21OmnvojK36mhg+TyIKDh3iFBKBohr5xeXIhNBcx8oWdgkTEEQ+BEFFYdLRuqMfd5L84N1V5Vg==", + "dev": true, + "license": "MIT", "dependencies": { - "parse5": "^7.0.0" + "shebang-regex": "^1.0.0" }, - "funding": { - "url": "https://github.com/inikulin/parse5?sponsor=1" + "engines": { + "node": ">=0.10.0" } }, - "node_modules/parseurl": { - "version": "1.3.3", + "node_modules/password-prompt/node_modules/shebang-regex": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/shebang-regex/-/shebang-regex-1.0.0.tgz", + "integrity": "sha512-wpoSFAxys6b2a2wHZ1XpDSgD7N9iVjg29Ph9uV/uaP9Ex/KXlkTZTeddxDPSYQpgvzKLGJke2UU0AzoGCjNIvQ==", "dev": true, "license": "MIT", "engines": { - "node": ">= 0.8" + "node": ">=0.10.0" } }, - "node_modules/password-prompt": { - "version": "1.1.3", + "node_modules/password-prompt/node_modules/which": { + "version": "1.3.1", + "resolved": "https://registry.npmjs.org/which/-/which-1.3.1.tgz", + "integrity": "sha512-HxJdYWq1MTIQbJ3nw0cqssHoTNU267KlrDuGZ1WYlxDStUtKUhOaJmh112/TZmHxxUfuJqPXSOm7tDyas0OSIQ==", "dev": true, - "license": "0BSD", + "license": "ISC", "dependencies": { - "ansi-escapes": "^4.3.2", - "cross-spawn": "^7.0.3" + "isexe": "^2.0.0" + }, + "bin": { + "which": "bin/which" } }, "node_modules/path-browserify": { "version": "1.0.1", + "resolved": "https://registry.npmjs.org/path-browserify/-/path-browserify-1.0.1.tgz", + "integrity": "sha512-b7uo2UCUOYZcnF/3ID0lulOJi/bafxa1xPe7ZPsammBSpjSWQkjNxlt635YGS2MiR9GjvuXCtz2emr3jbsz98g==", "dev": true, "license": "MIT" }, @@ -5784,14 +5852,6 @@ "node": ">=0.10.0" } }, - "node_modules/path-key": { - "version": "3.1.1", - "dev": true, - "license": "MIT", - "engines": { - "node": ">=8" - } - }, "node_modules/path-scurry": { "version": "1.11.1", "dev": true, @@ -5829,16 +5889,11 @@ }, "node_modules/perfect-scrollbar": { "version": "1.5.6", + "resolved": "https://registry.npmjs.org/perfect-scrollbar/-/perfect-scrollbar-1.5.6.tgz", + "integrity": "sha512-rixgxw3SxyJbCaSpo1n35A/fwI1r2rdwMKOTCg/AcG+xOEyZcE8UHVjpZMFCVImzsFoCZeJTT+M/rdEIQYO2nw==", "dev": true, "license": "MIT" }, - "node_modules/performance-now": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/performance-now/-/performance-now-2.1.0.tgz", - "integrity": "sha512-7EAHlyLHI56VEIdK57uwHdHKIaAGbnXPiw0yWbarQZOKaKpvUIgW0jWRVLiatnM+XXlSwsanIBH/hzGMJulMow==", - "dev": true, - "peer": true - }, "node_modules/picocolors": { "version": "1.1.1", "dev": true, @@ -5857,6 +5912,8 @@ }, "node_modules/pluralize": { "version": "8.0.0", + "resolved": "https://registry.npmjs.org/pluralize/-/pluralize-8.0.0.tgz", + "integrity": "sha512-Nc3IT5yHzflTfbjgqWcCPpo7DaKy4FnpB0l/zCAW0Tc7jxAiuqSxHasntB3D7887LSrA93kDJ9IXovxJYxyLCA==", "dev": true, "license": "MIT", "engines": { @@ -5865,6 +5922,8 @@ }, "node_modules/polished": { "version": "4.3.1", + "resolved": "https://registry.npmjs.org/polished/-/polished-4.3.1.tgz", + "integrity": "sha512-OBatVyC/N7SCW/FaDHrSd+vn0o5cS855TOmYi4OkdWUMSJCET/xip//ch8xGUvtr3i44X9LVyWwQlRMTN3pwSA==", "dev": true, "license": "MIT", "dependencies": { @@ -5874,16 +5933,10 @@ "node": ">=10" } }, - "node_modules/possible-typed-array-names": { - "version": "1.0.0", - "dev": true, - "license": "MIT", - "engines": { - "node": ">= 0.4" - } - }, "node_modules/postcss": { - "version": "8.4.38", + "version": "8.4.49", + "resolved": "https://registry.npmjs.org/postcss/-/postcss-8.4.49.tgz", + "integrity": "sha512-OCVPnIObs4N29kxTjzLfUryOkvZEq+pf8jTF0lg8E7uETuWHA+v7j3c/xJmiqpX450191LlmZfUKkXxkTry7nA==", "dev": true, "funding": [ { @@ -5902,8 +5955,8 @@ "license": "MIT", "dependencies": { "nanoid": "^3.3.7", - "picocolors": "^1.0.0", - "source-map-js": "^1.2.0" + "picocolors": "^1.1.1", + "source-map-js": "^1.2.1" }, "engines": { "node": "^10 || ^12 || >=14" @@ -5911,11 +5964,15 @@ }, "node_modules/postcss-value-parser": { "version": "4.2.0", + "resolved": "https://registry.npmjs.org/postcss-value-parser/-/postcss-value-parser-4.2.0.tgz", + "integrity": "sha512-1NNCs6uurfkVbeXG4S8JFT9t19m45ICnif8zWLd5oPSZ50QnwMfK+H3jv408d4jw/7Bttv5axS5IiHoLaVNHeQ==", "dev": true, "license": "MIT" }, "node_modules/pretty-format": { "version": "27.5.1", + "resolved": "https://registry.npmjs.org/pretty-format/-/pretty-format-27.5.1.tgz", + "integrity": "sha512-Qb1gy5OrP5+zDf2Bvnzdl3jsTf1qXVMazbvCoKhtKqVs4/YK4ozX4gKQJJVyNe+cajNPn0KoC0MC3FUmaHWEmQ==", "dev": true, "license": "MIT", "dependencies": { @@ -5929,6 +5986,8 @@ }, "node_modules/pretty-format/node_modules/ansi-styles": { "version": "5.2.0", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-5.2.0.tgz", + "integrity": "sha512-Cxwpt2SfTzTtXcfOlzGEee8O+c+MmUgGrNiBcXnuWxuFJHe6a5Hz7qwhwe5OgaSYI0IJvkLqWX1ASG+cJOkEiA==", "dev": true, "license": "MIT", "engines": { @@ -5938,13 +5997,10 @@ "url": "https://github.com/chalk/ansi-styles?sponsor=1" } }, - "node_modules/pretty-format/node_modules/react-is": { - "version": "17.0.2", - "dev": true, - "license": "MIT" - }, "node_modules/prismjs": { - "version": "1.29.0", + "version": "1.30.0", + "resolved": "https://registry.npmjs.org/prismjs/-/prismjs-1.30.0.tgz", + "integrity": "sha512-DEvV2ZF2r2/63V+tK8hQvrR2ZGn10srHbXviTlcv7Kpzw8jWiNTqbVgjO3IY8RxrrOUF8VPMQQFysYYYv0YZxw==", "dev": true, "license": "MIT", "engines": { @@ -5973,6 +6029,8 @@ }, "node_modules/prop-types": { "version": "15.8.1", + "resolved": "https://registry.npmjs.org/prop-types/-/prop-types-15.8.1.tgz", + "integrity": "sha512-oj87CgZICdulUohogVAR7AjlC0327U4el4L6eAvOqCeudMDVU0NThNaV+b9Df4dXgSP1gXMTnPdhfe/2qDH5cg==", "dev": true, "license": "MIT", "dependencies": { @@ -5983,6 +6041,8 @@ }, "node_modules/prop-types/node_modules/react-is": { "version": "16.13.1", + "resolved": "https://registry.npmjs.org/react-is/-/react-is-16.13.1.tgz", + "integrity": "sha512-24e6ynE2H+OKt4kqsOvNd8kBpV65zoxbA4BVsEOB3ARVWQki/DHzaUoC5KuON/BiccDaCCTZBuOcfZs70kR8bQ==", "dev": true, "license": "MIT" }, @@ -5993,6 +6053,31 @@ "dev": true, "license": "ISC" }, + "node_modules/protobufjs": { + "version": "7.5.3", + "resolved": "https://registry.npmjs.org/protobufjs/-/protobufjs-7.5.3.tgz", + "integrity": "sha512-sildjKwVqOI2kmFDiXQ6aEB0fjYTafpEvIBs8tOR8qI4spuL9OPROLVu2qZqi/xgCfsHIwVqlaF8JBjWFHnKbw==", + "dev": true, + "hasInstallScript": true, + "license": "BSD-3-Clause", + "dependencies": { + "@protobufjs/aspromise": "^1.1.2", + "@protobufjs/base64": "^1.1.2", + "@protobufjs/codegen": "^2.0.4", + "@protobufjs/eventemitter": "^1.1.0", + "@protobufjs/fetch": "^1.1.0", + "@protobufjs/float": "^1.0.2", + "@protobufjs/inquire": "^1.1.0", + "@protobufjs/path": "^1.1.2", + "@protobufjs/pool": "^1.1.0", + "@protobufjs/utf8": "^1.1.0", + "@types/node": ">=13.7.0", + "long": "^5.0.0" + }, + "engines": { + "node": ">=12.0.0" + } + }, "node_modules/proxy-addr": { "version": "2.0.7", "resolved": "https://registry.npmjs.org/proxy-addr/-/proxy-addr-2.0.7.tgz", @@ -6050,37 +6135,6 @@ ], "license": "MIT" }, - "node_modules/raf": { - "version": "3.4.1", - "resolved": "https://registry.npmjs.org/raf/-/raf-3.4.1.tgz", - "integrity": "sha512-Sq4CW4QhwOHE8ucn6J34MqtZCeWFP2aQSmrlroYgqAV1PjStIhJXxYuTgUIfkEk7zTLjmIjLmU5q+fbD1NnOJA==", - "dev": true, - "peer": true, - "dependencies": { - "performance-now": "^2.1.0" - } - }, - "node_modules/railroad-diagrams": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/railroad-diagrams/-/railroad-diagrams-1.0.0.tgz", - "integrity": "sha512-cz93DjNeLY0idrCNOH6PviZGRN9GJhsdm9hpn1YCS879fj4W+x5IFJhhkRZcwVgMmFF7R82UA/7Oh+R8lLZg6A==", - "dev": true, - "peer": true - }, - "node_modules/randexp": { - "version": "0.4.6", - "resolved": "https://registry.npmjs.org/randexp/-/randexp-0.4.6.tgz", - "integrity": "sha512-80WNmd9DA0tmZrw9qQa62GPPWfuXJknrmVmLcxvq4uZBdYqb1wYoKTmnlGUchvVWe0XiLupYkBoXVOxz3C8DYQ==", - "dev": true, - "peer": true, - "dependencies": { - "discontinuous-range": "1.0.0", - "ret": "~0.1.10" - }, - "engines": { - "node": ">=0.12" - } - }, "node_modules/randombytes": { "version": "2.1.0", "dev": true, @@ -6132,47 +6186,39 @@ } }, "node_modules/react": { - "version": "18.3.1", + "version": "19.1.0", + "resolved": "https://registry.npmjs.org/react/-/react-19.1.0.tgz", + "integrity": "sha512-FS+XFBNvn3GTAWq26joslQgWNoFu08F4kl0J4CgdNKADkdSGXQyTCnKteIAJy96Br6YbpEU1LSzV5dYtjMkMDg==", "dev": true, "license": "MIT", - "dependencies": { - "loose-envify": "^1.1.0" - }, "engines": { "node": ">=0.10.0" } }, "node_modules/react-dom": { - "version": "18.3.1", + "version": "19.1.0", + "resolved": "https://registry.npmjs.org/react-dom/-/react-dom-19.1.0.tgz", + "integrity": "sha512-Xs1hdnE+DyKgeHJeJznQmYMIBG3TKIHJJT95Q58nHLSrElKlGQqDTR2HQ9fx5CN/Gk6Vh/kupBTDLU11/nDk/g==", "dev": true, "license": "MIT", "dependencies": { - "loose-envify": "^1.1.0", - "scheduler": "^0.23.2" + "scheduler": "^0.26.0" }, "peerDependencies": { - "react": "^18.3.1" + "react": "^19.1.0" } }, "node_modules/react-is": { - "version": "18.3.1", + "version": "17.0.2", + "resolved": "https://registry.npmjs.org/react-is/-/react-is-17.0.2.tgz", + "integrity": "sha512-w2GsyukL62IJnlaff/nRegPQR94C/XXamvMWmSHRJ4y7Ts/4ocGRmTHvOs8PSE6pB3dWOrD/nueuU5sduBsQ4w==", "dev": true, "license": "MIT" }, - "node_modules/react-shallow-renderer": { - "version": "16.15.0", - "dev": true, - "license": "MIT", - "dependencies": { - "object-assign": "^4.1.1", - "react-is": "^16.12.0 || ^17.0.0 || ^18.0.0" - }, - "peerDependencies": { - "react": "^16.0.0 || ^17.0.0 || ^18.0.0" - } - }, "node_modules/react-tabs": { - "version": "6.0.2", + "version": "6.1.0", + "resolved": "https://registry.npmjs.org/react-tabs/-/react-tabs-6.1.0.tgz", + "integrity": "sha512-6QtbTRDKM+jA/MZTTefvigNxo0zz+gnBTVFw2CFVvq+f2BuH0nF0vDLNClL045nuTAdOoK/IL1vTP0ZLX0DAyQ==", "dev": true, "license": "MIT", "dependencies": { @@ -6180,7 +6226,7 @@ "prop-types": "^15.5.0" }, "peerDependencies": { - "react": "^18.0.0" + "react": "^18.0.0 || ^19.0.0" } }, "node_modules/readable-stream": { @@ -6208,15 +6254,16 @@ } }, "node_modules/redoc": { - "version": "2.1.5", + "version": "2.5.0", + "resolved": "https://registry.npmjs.org/redoc/-/redoc-2.5.0.tgz", + "integrity": "sha512-NpYsOZ1PD9qFdjbLVBZJWptqE+4Y6TkUuvEOqPUmoH7AKOmPcE+hYjotLxQNTqVoWL4z0T2uxILmcc8JGDci+Q==", "dev": true, "license": "MIT", "dependencies": { - "@cfaester/enzyme-adapter-react-18": "^0.8.0", "@redocly/openapi-core": "^1.4.0", "classnames": "^2.3.2", "decko": "^1.2.0", - "dompurify": "^3.0.6", + "dompurify": "^3.2.4", "eventemitter3": "^5.0.1", "json-pointer": "^0.6.2", "lunr": "^2.3.9", @@ -6242,89 +6289,21 @@ "peerDependencies": { "core-js": "^3.1.4", "mobx": "^6.0.4", - "react": "^16.8.4 || ^17.0.0 || ^18.0.0", - "react-dom": "^16.8.4 || ^17.0.0 || ^18.0.0", + "react": "^16.8.4 || ^17.0.0 || ^18.0.0 || ^19.0.0", + "react-dom": "^16.8.4 || ^17.0.0 || ^18.0.0 || ^19.0.0", "styled-components": "^4.1.1 || ^5.1.1 || ^6.0.5" } }, - "node_modules/redoc/node_modules/@redocly/config": { - "version": "0.17.1", - "dev": true, - "license": "MIT" - }, - "node_modules/redoc/node_modules/@redocly/openapi-core": { - "version": "1.26.0", - "dev": true, - "license": "MIT", - "dependencies": { - "@redocly/ajv": "^8.11.2", - "@redocly/config": "^0.17.0", - "colorette": "^1.2.0", - "https-proxy-agent": "^7.0.4", - "js-levenshtein": "^1.1.6", - "js-yaml": "^4.1.0", - "lodash.isequal": "^4.5.0", - "minimatch": "^5.0.1", - "node-fetch": "^2.6.1", - "pluralize": "^8.0.0", - "yaml-ast-parser": "0.0.43" - }, - "engines": { - "node": ">=14.19.0", - "npm": ">=7.0.0" - } - }, - "node_modules/reflect.getprototypeof": { - "version": "1.0.8", - "dev": true, - "license": "MIT", - "dependencies": { - "call-bind": "^1.0.8", - "define-properties": "^1.2.1", - "dunder-proto": "^1.0.0", - "es-abstract": "^1.23.5", - "es-errors": "^1.3.0", - "get-intrinsic": "^1.2.4", - "gopd": "^1.2.0", - "which-builtin-type": "^1.2.0" - }, - "engines": { - "node": ">= 0.4" - }, - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, "node_modules/reftools": { "version": "1.1.9", + "resolved": "https://registry.npmjs.org/reftools/-/reftools-1.1.9.tgz", + "integrity": "sha512-OVede/NQE13xBQ+ob5CKd5KyeJYU2YInb1bmV4nRoOfquZPkAkxuOXicSe1PvqIuZZ4kD13sPKBbR7UFDmli6w==", "dev": true, "license": "BSD-3-Clause", "funding": { "url": "https://github.com/Mermade/oas-kit?sponsor=1" } }, - "node_modules/regenerator-runtime": { - "version": "0.14.1", - "dev": true, - "license": "MIT" - }, - "node_modules/regexp.prototype.flags": { - "version": "1.5.3", - "dev": true, - "license": "MIT", - "dependencies": { - "call-bind": "^1.0.7", - "define-properties": "^1.2.1", - "es-errors": "^1.3.0", - "set-function-name": "^2.0.2" - }, - "engines": { - "node": ">= 0.4" - }, - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, "node_modules/registry-auth-token": { "version": "5.1.0", "resolved": "https://registry.npmjs.org/registry-auth-token/-/registry-auth-token-5.1.0.tgz", @@ -6364,6 +6343,8 @@ }, "node_modules/require-from-string": { "version": "2.0.2", + "resolved": "https://registry.npmjs.org/require-from-string/-/require-from-string-2.0.2.tgz", + "integrity": "sha512-Xf0nWe6RseziFMu+Ap9biiUbmplq6S9/p+7w7YXP/JBHhrUDDUhwa+vANyubuqfZWTveU//DYVGsDG7RKL/vEw==", "dev": true, "license": "MIT", "engines": { @@ -6385,16 +6366,6 @@ "url": "https://github.com/sponsors/sindresorhus" } }, - "node_modules/ret": { - "version": "0.1.15", - "resolved": "https://registry.npmjs.org/ret/-/ret-0.1.15.tgz", - "integrity": "sha512-TTlYpa+OL+vMMNG24xSlQGEJ3B/RzEfUlLct7b5G/ytav+wPrplCpVMFuwzXbkecJrb6IYo1iFb0S9v37754mg==", - "dev": true, - "peer": true, - "engines": { - "node": ">=0.12" - } - }, "node_modules/retry": { "version": "0.12.0", "dev": true, @@ -6465,17 +6436,6 @@ "fsevents": "~2.3.2" } }, - "node_modules/rst-selector-parser": { - "version": "2.2.3", - "resolved": "https://registry.npmjs.org/rst-selector-parser/-/rst-selector-parser-2.2.3.tgz", - "integrity": "sha512-nDG1rZeP6oFTLN6yNDV/uiAvs1+FS/KlrEwh7+y7dpuApDBy6bI2HTBcc0/V8lv9OTqfyD34eF7au2pm8aBbhA==", - "dev": true, - "peer": true, - "dependencies": { - "lodash.flattendeep": "^4.4.0", - "nearley": "^2.7.10" - } - }, "node_modules/run-applescript": { "version": "7.0.0", "resolved": "https://registry.npmjs.org/run-applescript/-/run-applescript-7.0.0.tgz", @@ -6527,24 +6487,6 @@ "run-pty": "run-pty-bin.js" } }, - "node_modules/safe-array-concat": { - "version": "1.1.3", - "dev": true, - "license": "MIT", - "dependencies": { - "call-bind": "^1.0.8", - "call-bound": "^1.0.2", - "get-intrinsic": "^1.2.6", - "has-symbols": "^1.1.0", - "isarray": "^2.0.5" - }, - "engines": { - "node": ">=0.4" - }, - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, "node_modules/safe-buffer": { "version": "5.2.1", "dev": true, @@ -6564,34 +6506,17 @@ ], "license": "MIT" }, - "node_modules/safe-regex-test": { - "version": "1.1.0", - "dev": true, - "license": "MIT", - "dependencies": { - "call-bound": "^1.0.2", - "es-errors": "^1.3.0", - "is-regex": "^1.2.1" - }, - "engines": { - "node": ">= 0.4" - }, - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, "node_modules/safer-buffer": { "version": "2.1.2", "dev": true, "license": "MIT" }, "node_modules/scheduler": { - "version": "0.23.2", + "version": "0.26.0", + "resolved": "https://registry.npmjs.org/scheduler/-/scheduler-0.26.0.tgz", + "integrity": "sha512-NlHwttCI/l5gCPR3D1nNXtWABUmBwvZpEQiD4IXSbIDq8BzLIK/7Ir5gTFSGZDUu37K5cMNp0hFtzO38sC7gWA==", "dev": true, - "license": "MIT", - "dependencies": { - "loose-envify": "^1.1.0" - } + "license": "MIT" }, "node_modules/section-matter": { "version": "1.0.0", @@ -6736,6 +6661,13 @@ "node": ">= 0.8.0" } }, + "node_modules/set-cookie-parser": { + "version": "2.7.1", + "resolved": "https://registry.npmjs.org/set-cookie-parser/-/set-cookie-parser-2.7.1.tgz", + "integrity": "sha512-IOc8uWeOZgnb3ptbCURJWNjWUPcO3ZnTTdzsurqERrP6nPyv+paC55vJM0LpOlT2ne+Ix+9+CRG1MNLlyZ4GjQ==", + "dev": true, + "license": "MIT" + }, "node_modules/set-function-length": { "version": "1.2.2", "dev": true, @@ -6752,20 +6684,6 @@ "node": ">= 0.4" } }, - "node_modules/set-function-name": { - "version": "2.0.2", - "dev": true, - "license": "MIT", - "dependencies": { - "define-data-property": "^1.1.4", - "es-errors": "^1.3.0", - "functions-have-names": "^1.2.3", - "has-property-descriptors": "^1.0.2" - }, - "engines": { - "node": ">= 0.4" - } - }, "node_modules/setprototypeof": { "version": "1.2.0", "resolved": "https://registry.npmjs.org/setprototypeof/-/setprototypeof-1.2.0.tgz", @@ -6775,30 +6693,15 @@ }, "node_modules/shallowequal": { "version": "1.1.0", + "resolved": "https://registry.npmjs.org/shallowequal/-/shallowequal-1.1.0.tgz", + "integrity": "sha512-y0m1JoUZSlPAjXVtPPW70aZWfIL/dSP7AFkRnniLCrK/8MDKog3TySTBmckD+RObVxH0v4Tox67+F14PdED2oQ==", "dev": true, "license": "MIT" }, - "node_modules/shebang-command": { - "version": "2.0.0", - "dev": true, - "license": "MIT", - "dependencies": { - "shebang-regex": "^3.0.0" - }, - "engines": { - "node": ">=8" - } - }, - "node_modules/shebang-regex": { - "version": "3.0.0", - "dev": true, - "license": "MIT", - "engines": { - "node": ">=8" - } - }, "node_modules/should": { "version": "13.2.3", + "resolved": "https://registry.npmjs.org/should/-/should-13.2.3.tgz", + "integrity": "sha512-ggLesLtu2xp+ZxI+ysJTmNjh2U0TsC+rQ/pfED9bUZZ4DKefP27D+7YJVVTvKsmjLpIi9jAa7itwDGkDDmt1GQ==", "dev": true, "license": "MIT", "dependencies": { @@ -6811,6 +6714,8 @@ }, "node_modules/should-equal": { "version": "2.0.0", + "resolved": "https://registry.npmjs.org/should-equal/-/should-equal-2.0.0.tgz", + "integrity": "sha512-ZP36TMrK9euEuWQYBig9W55WPC7uo37qzAEmbjHz4gfyuXrEUgF8cUvQVO+w+d3OMfPvSRQJ22lSm8MQJ43LTA==", "dev": true, "license": "MIT", "dependencies": { @@ -6819,6 +6724,8 @@ }, "node_modules/should-format": { "version": "3.0.3", + "resolved": "https://registry.npmjs.org/should-format/-/should-format-3.0.3.tgz", + "integrity": "sha512-hZ58adtulAk0gKtua7QxevgUaXTTXxIi8t41L3zo9AHvjXO1/7sdLECuHeIN2SRtYXpNkmhoUP2pdeWgricQ+Q==", "dev": true, "license": "MIT", "dependencies": { @@ -6828,11 +6735,15 @@ }, "node_modules/should-type": { "version": "1.4.0", + "resolved": "https://registry.npmjs.org/should-type/-/should-type-1.4.0.tgz", + "integrity": "sha512-MdAsTu3n25yDbIe1NeN69G4n6mUnJGtSJHygX3+oN0ZbO3DTiATnf7XnYJdGT42JCXurTb1JI0qOBR65shvhPQ==", "dev": true, "license": "MIT" }, "node_modules/should-type-adaptors": { "version": "1.1.0", + "resolved": "https://registry.npmjs.org/should-type-adaptors/-/should-type-adaptors-1.1.0.tgz", + "integrity": "sha512-JA4hdoLnN+kebEp2Vs8eBe9g7uy0zbRo+RMcU0EsNy+R+k049Ki+N5tT5Jagst2g7EAja+euFuoXFCa8vIklfA==", "dev": true, "license": "MIT", "dependencies": { @@ -6842,6 +6753,8 @@ }, "node_modules/should-util": { "version": "1.0.1", + "resolved": "https://registry.npmjs.org/should-util/-/should-util-1.0.1.tgz", + "integrity": "sha512-oXF8tfxx5cDk8r2kYqlkUJzZpDBqVY/II2WhvU0n9Y3XYvAYRmeaf1PvvIvTgPnv4KJ+ES5M0PyDq5Jp+Ygy2g==", "dev": true, "license": "MIT" }, @@ -6981,6 +6894,8 @@ }, "node_modules/slugify": { "version": "1.4.7", + "resolved": "https://registry.npmjs.org/slugify/-/slugify-1.4.7.tgz", + "integrity": "sha512-tf+h5W1IrjNm/9rKKj0JU2MDMruiopx0jjVA5zCdBtcGjfp0+c5rHw/zADLC3IeKlGHtVbHtpfzvYA0OYT+HKg==", "dev": true, "license": "MIT", "engines": { @@ -7091,6 +7006,8 @@ }, "node_modules/stickyfill": { "version": "1.1.1", + "resolved": "https://registry.npmjs.org/stickyfill/-/stickyfill-1.1.1.tgz", + "integrity": "sha512-GCp7vHAfpao+Qh/3Flh9DXEJ/qSi0KJwJw6zYlZOtRYXWUIpMM6mC2rIep/dK8RQqwW0KxGJIllmjPIBOGN8AA==", "dev": true }, "node_modules/streamsearch": { @@ -7101,91 +7018,38 @@ } }, "node_modules/string_decoder": { - "version": "1.3.0", - "dev": true, - "license": "MIT", - "dependencies": { - "safe-buffer": "~5.2.0" - } - }, - "node_modules/string-width": { - "version": "4.2.3", - "dev": true, - "license": "MIT", - "dependencies": { - "emoji-regex": "^8.0.0", - "is-fullwidth-code-point": "^3.0.0", - "strip-ansi": "^6.0.1" - }, - "engines": { - "node": ">=8" - } - }, - "node_modules/string-width-cjs": { - "name": "string-width", - "version": "4.2.3", - "dev": true, - "license": "MIT", - "dependencies": { - "emoji-regex": "^8.0.0", - "is-fullwidth-code-point": "^3.0.0", - "strip-ansi": "^6.0.1" - }, - "engines": { - "node": ">=8" - } - }, - "node_modules/string.prototype.trim": { - "version": "1.2.10", - "dev": true, - "license": "MIT", - "dependencies": { - "call-bind": "^1.0.8", - "call-bound": "^1.0.2", - "define-data-property": "^1.1.4", - "define-properties": "^1.2.1", - "es-abstract": "^1.23.5", - "es-object-atoms": "^1.0.0", - "has-property-descriptors": "^1.0.2" - }, - "engines": { - "node": ">= 0.4" - }, - "funding": { - "url": "https://github.com/sponsors/ljharb" + "version": "1.3.0", + "dev": true, + "license": "MIT", + "dependencies": { + "safe-buffer": "~5.2.0" } }, - "node_modules/string.prototype.trimend": { - "version": "1.0.9", + "node_modules/string-width": { + "version": "4.2.3", "dev": true, "license": "MIT", "dependencies": { - "call-bind": "^1.0.8", - "call-bound": "^1.0.2", - "define-properties": "^1.2.1", - "es-object-atoms": "^1.0.0" + "emoji-regex": "^8.0.0", + "is-fullwidth-code-point": "^3.0.0", + "strip-ansi": "^6.0.1" }, "engines": { - "node": ">= 0.4" - }, - "funding": { - "url": "https://github.com/sponsors/ljharb" + "node": ">=8" } }, - "node_modules/string.prototype.trimstart": { - "version": "1.0.8", + "node_modules/string-width-cjs": { + "name": "string-width", + "version": "4.2.3", "dev": true, "license": "MIT", "dependencies": { - "call-bind": "^1.0.7", - "define-properties": "^1.2.1", - "es-object-atoms": "^1.0.0" + "emoji-regex": "^8.0.0", + "is-fullwidth-code-point": "^3.0.0", + "strip-ansi": "^6.0.1" }, "engines": { - "node": ">= 0.4" - }, - "funding": { - "url": "https://github.com/sponsors/ljharb" + "node": ">=8" } }, "node_modules/strip-ansi": { @@ -7230,12 +7094,22 @@ } }, "node_modules/strnum": { - "version": "1.0.5", + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/strnum/-/strnum-1.1.2.tgz", + "integrity": "sha512-vrN+B7DBIoTTZjnPNewwhx6cBA/H+IS7rfW68n7XxC1y7uoiGQBxaKzqucGUgavX15dJgiGztLJ8vxuEzwqBdA==", "dev": true, + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/NaturalIntelligence" + } + ], "license": "MIT" }, "node_modules/styled-components": { - "version": "6.1.13", + "version": "6.1.19", + "resolved": "https://registry.npmjs.org/styled-components/-/styled-components-6.1.19.tgz", + "integrity": "sha512-1v/e3Dl1BknC37cXMhwGomhO8AkYmN41CqyX9xhUDxry1ns3BFQy2lLDRQXJRdVVWB9OHemv/53xaStimvWyuA==", "dev": true, "license": "MIT", "dependencies": { @@ -7244,7 +7118,7 @@ "@types/stylis": "4.2.5", "css-to-react-native": "3.2.0", "csstype": "3.1.3", - "postcss": "8.4.38", + "postcss": "8.4.49", "shallowequal": "1.1.0", "stylis": "4.3.2", "tslib": "2.6.2" @@ -7263,11 +7137,15 @@ }, "node_modules/styled-components/node_modules/tslib": { "version": "2.6.2", + "resolved": "https://registry.npmjs.org/tslib/-/tslib-2.6.2.tgz", + "integrity": "sha512-AEYxH93jGFPn/a2iVAwW87VuUIkR1FVUKB77NwMF7nBTDkDrrT/Hpt/IrCJ0QXhW27jTBDcf5ZY7w6RiqTMw2Q==", "dev": true, "license": "0BSD" }, "node_modules/stylis": { "version": "4.3.2", + "resolved": "https://registry.npmjs.org/stylis/-/stylis-4.3.2.tgz", + "integrity": "sha512-bhtUjWd/z6ltJiQwg0dUfxEJ+W+jdqQd8TbWLWyeIJHlnsqmGLRFFd8e5mA0AZi/zx90smXRlN66YMTcaSFifg==", "dev": true, "license": "MIT" }, @@ -7289,6 +7167,8 @@ }, "node_modules/swagger2openapi": { "version": "7.0.8", + "resolved": "https://registry.npmjs.org/swagger2openapi/-/swagger2openapi-7.0.8.tgz", + "integrity": "sha512-upi/0ZGkYgEcLeGieoz8gT74oWHA0E7JivX7aN9mAf+Tc7BQoRBvnIGHoPDw+f9TXTW4s6kGYCZJtauP6OYp7g==", "dev": true, "license": "BSD-3-Clause", "dependencies": { @@ -7313,15 +7193,60 @@ "url": "https://github.com/Mermade/oas-kit?sponsor=1" } }, + "node_modules/swagger2openapi/node_modules/cliui": { + "version": "8.0.1", + "resolved": "https://registry.npmjs.org/cliui/-/cliui-8.0.1.tgz", + "integrity": "sha512-BSeNnyus75C4//NQ9gQt1/csTXyo/8Sb+afLAkzAptFuMsod9HFokGNudZpi/oQV73hnVK+sR+5PVRMd+Dr7YQ==", + "dev": true, + "license": "ISC", + "dependencies": { + "string-width": "^4.2.0", + "strip-ansi": "^6.0.1", + "wrap-ansi": "^7.0.0" + }, + "engines": { + "node": ">=12" + } + }, "node_modules/swagger2openapi/node_modules/yaml": { "version": "1.10.2", "resolved": "https://registry.npmjs.org/yaml/-/yaml-1.10.2.tgz", "integrity": "sha512-r3vXyErRCYJ7wg28yvBY5VSoAF8ZvlcW9/BwUzEtUsjvX/DKs24dIkuwjtuprwJJHsbyUbLApepYTR1BN4uHrg==", "dev": true, + "license": "ISC", "engines": { "node": ">= 6" } }, + "node_modules/swagger2openapi/node_modules/yargs": { + "version": "17.7.2", + "resolved": "https://registry.npmjs.org/yargs/-/yargs-17.7.2.tgz", + "integrity": "sha512-7dSzzRQ++CKnNI/krKnYRV7JKKPUXMEh61soaHKg9mrWEhzFWhFnxPxGl+69cD1Ou63C13NUPCnmIcrvqCuM6w==", + "dev": true, + "license": "MIT", + "dependencies": { + "cliui": "^8.0.1", + "escalade": "^3.1.1", + "get-caller-file": "^2.0.5", + "require-directory": "^2.1.1", + "string-width": "^4.2.3", + "y18n": "^5.0.5", + "yargs-parser": "^21.1.1" + }, + "engines": { + "node": ">=12" + } + }, + "node_modules/swagger2openapi/node_modules/yargs-parser": { + "version": "21.1.1", + "resolved": "https://registry.npmjs.org/yargs-parser/-/yargs-parser-21.1.1.tgz", + "integrity": "sha512-tVpsJW7DdjecAiFpbIB1e3qxIQsE6NoPc5/eTdrbbIC4h0LVsWhnoa3g+m2HclBIujHzsxZ4VJVA+GUuc2/LBw==", + "dev": true, + "license": "ISC", + "engines": { + "node": ">=12" + } + }, "node_modules/tar": { "version": "7.4.3", "dev": true, @@ -7503,11 +7428,6 @@ "node": ">=0.6" } }, - "node_modules/tr46": { - "version": "0.0.3", - "dev": true, - "license": "MIT" - }, "node_modules/tree-dump": { "version": "1.0.3", "resolved": "https://registry.npmjs.org/tree-dump/-/tree-dump-1.0.3.tgz", @@ -7562,78 +7482,17 @@ "node": ">= 0.6" } }, - "node_modules/typed-array-buffer": { - "version": "1.0.2", - "dev": true, - "license": "MIT", - "dependencies": { - "call-bind": "^1.0.7", - "es-errors": "^1.3.0", - "is-typed-array": "^1.1.13" - }, - "engines": { - "node": ">= 0.4" - } - }, - "node_modules/typed-array-byte-length": { - "version": "1.0.1", - "dev": true, - "license": "MIT", - "dependencies": { - "call-bind": "^1.0.7", - "for-each": "^0.3.3", - "gopd": "^1.0.1", - "has-proto": "^1.0.3", - "is-typed-array": "^1.1.13" - }, - "engines": { - "node": ">= 0.4" - }, - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, - "node_modules/typed-array-byte-offset": { - "version": "1.0.3", - "dev": true, - "license": "MIT", - "dependencies": { - "available-typed-arrays": "^1.0.7", - "call-bind": "^1.0.7", - "for-each": "^0.3.3", - "gopd": "^1.0.1", - "has-proto": "^1.0.3", - "is-typed-array": "^1.1.13", - "reflect.getprototypeof": "^1.0.6" - }, - "engines": { - "node": ">= 0.4" - }, - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, - "node_modules/typed-array-length": { - "version": "1.0.7", + "node_modules/typedarray": { + "version": "0.0.6", + "resolved": "https://registry.npmjs.org/typedarray/-/typedarray-0.0.6.tgz", + "integrity": "sha512-/aCDEGatGvZ2BIk+HmLf4ifCJFwvKFNb9/JeZPMulfgFracn9QFcAf5GO8B/mweUjSoblS5In0cWhqpfs/5PQA==", "dev": true, - "license": "MIT", - "dependencies": { - "call-bind": "^1.0.7", - "for-each": "^0.3.3", - "gopd": "^1.0.1", - "is-typed-array": "^1.1.13", - "possible-typed-array-names": "^1.0.0", - "reflect.getprototypeof": "^1.0.6" - }, - "engines": { - "node": ">= 0.4" - }, - "funding": { - "url": "https://github.com/sponsors/ljharb" - } + "license": "MIT" }, "node_modules/typescript": { "version": "4.9.5", + "resolved": "https://registry.npmjs.org/typescript/-/typescript-4.9.5.tgz", + "integrity": "sha512-1FXk9E2Hm+QzZQ7z+McJiHL4NW1F2EzMu9Nq9i3zAaGqibafqYwCVU6WyWAuyQRRzOlxou8xZSyXLEN8oKj24g==", "dev": true, "license": "Apache-2.0", "bin": { @@ -7656,26 +7515,12 @@ "node": ">=0.8.0" } }, - "node_modules/unbox-primitive": { - "version": "1.0.2", - "dev": true, - "license": "MIT", - "dependencies": { - "call-bind": "^1.0.2", - "has-bigints": "^1.0.2", - "has-symbols": "^1.0.3", - "which-boxed-primitive": "^1.0.2" - }, - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, "node_modules/undici": { - "version": "6.21.0", - "resolved": "https://registry.npmjs.org/undici/-/undici-6.21.0.tgz", - "integrity": "sha512-BUgJXc752Kou3oOIuU1i+yZZypyZRqNPW0vqoMPl8VaoalSfeR0D8/t4iAS3yirs79SSMTxTag+ZC86uswv+Cw==", + "version": "6.21.3", + "resolved": "https://registry.npmjs.org/undici/-/undici-6.21.3.tgz", + "integrity": "sha512-gBLkYIlEnSp8pFbT64yFgGE6UIB9tAkhukC23PmMDCe5Nd+cRqKxSjw5y54MK2AZMgZfJWMaNE4nYUHgi1XEOw==", "dev": true, - "peer": true, + "license": "MIT", "engines": { "node": ">=18.17" } @@ -7740,16 +7585,22 @@ }, "node_modules/uri-js-replace": { "version": "1.0.1", + "resolved": "https://registry.npmjs.org/uri-js-replace/-/uri-js-replace-1.0.1.tgz", + "integrity": "sha512-W+C9NWNLFOoBI2QWDp4UT9pv65r2w5Cx+3sTYFvtMdDBxkKt1syCqsUdSFAChbEe1uK5TfS04wt/nGwmaeIQ0g==", "dev": true, "license": "MIT" }, "node_modules/url-template": { "version": "2.0.8", + "resolved": "https://registry.npmjs.org/url-template/-/url-template-2.0.8.tgz", + "integrity": "sha512-XdVKMF4SJ0nP/O7XIPB0JwAEuT9lDIYnNsK8yGVe43y0AWoKeJNdv3ZNWh7ksJ6KqQFjOO6ox/VEitLnaVNufw==", "dev": true, "license": "BSD" }, "node_modules/use-sync-external-store": { - "version": "1.4.0", + "version": "1.5.0", + "resolved": "https://registry.npmjs.org/use-sync-external-store/-/use-sync-external-store-1.5.0.tgz", + "integrity": "sha512-Rb46I4cGGVBmjamjphe8L/UnvJD+uPPtTkNvX5mZgqdbavhI4EbgIWJiIHXJ8bc/i9EQGPRh4DwEURJ552Do0A==", "dev": true, "license": "MIT", "peerDependencies": { @@ -7911,149 +7762,6 @@ "node": "^10 || ^12 || >=14" } }, - "node_modules/webidl-conversions": { - "version": "3.0.1", - "dev": true, - "license": "BSD-2-Clause" - }, - "node_modules/whatwg-encoding": { - "version": "3.1.1", - "resolved": "https://registry.npmjs.org/whatwg-encoding/-/whatwg-encoding-3.1.1.tgz", - "integrity": "sha512-6qN4hJdMwfYBtE3YBTTHhoeuUrDBPZmbQaxWAqSALV/MeEnR5z1xd8UKud2RAkFoPkmB+hli1TZSnyi84xz1vQ==", - "dev": true, - "peer": true, - "dependencies": { - "iconv-lite": "0.6.3" - }, - "engines": { - "node": ">=18" - } - }, - "node_modules/whatwg-encoding/node_modules/iconv-lite": { - "version": "0.6.3", - "resolved": "https://registry.npmjs.org/iconv-lite/-/iconv-lite-0.6.3.tgz", - "integrity": "sha512-4fCk79wshMdzMp2rH06qWrJE4iolqLhCUH+OiuIgU++RB0+94NlDL81atO7GX55uUKueo0txHNtvEyI6D7WdMw==", - "dev": true, - "peer": true, - "dependencies": { - "safer-buffer": ">= 2.1.2 < 3.0.0" - }, - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/whatwg-mimetype": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/whatwg-mimetype/-/whatwg-mimetype-4.0.0.tgz", - "integrity": "sha512-QaKxh0eNIi2mE9p2vEdzfagOKHCcj1pJ56EEHGQOVxp8r9/iszLUUV7v89x9O1p/T+NlTM5W7jW6+cz4Fq1YVg==", - "dev": true, - "peer": true, - "engines": { - "node": ">=18" - } - }, - "node_modules/whatwg-url": { - "version": "5.0.0", - "dev": true, - "license": "MIT", - "dependencies": { - "tr46": "~0.0.3", - "webidl-conversions": "^3.0.0" - } - }, - "node_modules/which": { - "version": "2.0.2", - "dev": true, - "license": "ISC", - "dependencies": { - "isexe": "^2.0.0" - }, - "bin": { - "node-which": "bin/node-which" - }, - "engines": { - "node": ">= 8" - } - }, - "node_modules/which-boxed-primitive": { - "version": "1.1.0", - "dev": true, - "license": "MIT", - "dependencies": { - "is-bigint": "^1.1.0", - "is-boolean-object": "^1.2.0", - "is-number-object": "^1.1.0", - "is-string": "^1.1.0", - "is-symbol": "^1.1.0" - }, - "engines": { - "node": ">= 0.4" - }, - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, - "node_modules/which-builtin-type": { - "version": "1.2.1", - "dev": true, - "license": "MIT", - "dependencies": { - "call-bound": "^1.0.2", - "function.prototype.name": "^1.1.6", - "has-tostringtag": "^1.0.2", - "is-async-function": "^2.0.0", - "is-date-object": "^1.1.0", - "is-finalizationregistry": "^1.1.0", - "is-generator-function": "^1.0.10", - "is-regex": "^1.2.1", - "is-weakref": "^1.0.2", - "isarray": "^2.0.5", - "which-boxed-primitive": "^1.1.0", - "which-collection": "^1.0.2", - "which-typed-array": "^1.1.16" - }, - "engines": { - "node": ">= 0.4" - }, - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, - "node_modules/which-collection": { - "version": "1.0.2", - "dev": true, - "license": "MIT", - "dependencies": { - "is-map": "^2.0.3", - "is-set": "^2.0.3", - "is-weakmap": "^2.0.2", - "is-weakset": "^2.0.3" - }, - "engines": { - "node": ">= 0.4" - }, - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, - "node_modules/which-typed-array": { - "version": "1.1.16", - "dev": true, - "license": "MIT", - "dependencies": { - "available-typed-arrays": "^1.0.7", - "call-bind": "^1.0.7", - "for-each": "^0.3.3", - "gopd": "^1.0.1", - "has-tostringtag": "^1.0.2" - }, - "engines": { - "node": ">= 0.4" - }, - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, "node_modules/wordwrap": { "version": "1.0.0", "dev": true, @@ -8146,32 +7854,19 @@ }, "node_modules/yaml-ast-parser": { "version": "0.0.43", + "resolved": "https://registry.npmjs.org/yaml-ast-parser/-/yaml-ast-parser-0.0.43.tgz", + "integrity": "sha512-2PTINUwsRqSd+s8XxKaJWQlUuEMHJQyEuh2edBbW8KNJz0SJPwUSD2zRWqezFEdN7IzAgeuYHFUCF7o8zRdZ0A==", "dev": true, "license": "Apache-2.0" }, - "node_modules/yargs": { - "version": "17.7.2", - "dev": true, - "license": "MIT", - "dependencies": { - "cliui": "^8.0.1", - "escalade": "^3.1.1", - "get-caller-file": "^2.0.5", - "require-directory": "^2.1.1", - "string-width": "^4.2.3", - "y18n": "^5.0.5", - "yargs-parser": "^21.1.1" - }, - "engines": { - "node": ">=12" - } - }, "node_modules/yargs-parser": { - "version": "21.1.1", + "version": "20.2.9", + "resolved": "https://registry.npmjs.org/yargs-parser/-/yargs-parser-20.2.9.tgz", + "integrity": "sha512-y11nGElTIV+CT3Zv9t7VKl+Q3hTQoT9a1Qzezhhl6Rp21gJ/IVTW7Z3y9EWXhuUBC2Shnf+DX0antecpAwSP8w==", "dev": true, "license": "ISC", "engines": { - "node": ">=12" + "node": ">=10" } } } diff --git a/package.json b/package.json index 498bee37..2c1f2292 100644 --- a/package.json +++ b/package.json @@ -23,13 +23,16 @@ "license": "MIT", "devDependencies": { "@lydell/elm-json": "0.2.13-1", - "@redocly/cli": "1.11.0", + "@redocly/cli": "^1.34.4", "elm-codegen": "^0.6.1", - "elm-optimize-level-2": "0.3.5", + "elm-optimize-level-2": "^0.3.5", "elm-pages": "^3.0.24", "run-pty": "^5.0.0", "vite": "^6.0.3" }, + "overrides": { + "cross-spawn": "6.0.6" + }, "volta": { "node": "20.11.0" } From 0dad6d00473b07f480d8c20788b3a1712cdfeea0 Mon Sep 17 00:00:00 2001 From: Adam DiCarlo Date: Mon, 28 Jul 2025 15:48:48 -0700 Subject: [PATCH 33/33] Simplify example-using-api, improve new READMEs --- elm-open-api-codegen/README.md | 17 +- example-using-api/README.md | 41 +- example-using-api/codegen/Gen/ArticleId.elm | 238 ++++++++++++ example-using-api/codegen/Gen/Data/Id.elm | 359 ------------------ example-using-api/codegen/elm.codegen.json | 4 +- example-using-api/openapi.yaml | 36 +- example-using-api/scripts/after-codegen.sh | 3 - example-using-api/scripts/before-codegen.sh | 3 - .../scripts/src/CodeGenOpenApi.elm | 71 +--- example-using-api/scripts/test | 2 +- example-using-api/src/ArticleId.elm | 45 +++ example-using-api/src/Data/Id.elm | 85 ----- example-using-api/src/Data/Id/Dict.elm | 262 ------------- example-using-api/src/Data/Id/Internal.elm | 19 - 14 files changed, 344 insertions(+), 841 deletions(-) create mode 100644 example-using-api/codegen/Gen/ArticleId.elm delete mode 100644 example-using-api/codegen/Gen/Data/Id.elm delete mode 100755 example-using-api/scripts/after-codegen.sh delete mode 100755 example-using-api/scripts/before-codegen.sh create mode 100644 example-using-api/src/ArticleId.elm delete mode 100644 example-using-api/src/Data/Id.elm delete mode 100644 example-using-api/src/Data/Id/Dict.elm delete mode 100644 example-using-api/src/Data/Id/Internal.elm diff --git a/elm-open-api-codegen/README.md b/elm-open-api-codegen/README.md index c9237828..b91d619a 100644 --- a/elm-open-api-codegen/README.md +++ b/elm-open-api-codegen/README.md @@ -1,18 +1,22 @@ # elm-open-api-codegen Generate Elm code for OpenAPI schemas. This powers -[elm-open-api-cli][elm-open-api-cli], but can be used directly for more powerful -customized code generation. +[elm-open-api-cli][elm-open-api-cli], but can be used directly, via an Elm Pages +script, for more powerful customized code generation. The main advantage of using this package directly is that you can define your own custom formats in Elm, which means you can customize the types and generated code based on the `format` listed in your OpenAPI schema. -See the [example of using this package][example], located in the `-cli` -repository. +See the included [example of using this package][example]. + +[elm-open-api-cli]: https://github.com/wolfadex/elm-open-api-cli +[example]: https://github.com/wolfadex/elm-open-api-codegen/tree/main/example-using-api + +## CONTRIBUTING The `elm.codegen.json` file in this project is located in the `src` directory. -Since this isn't the standard directory, you'll need to tell elm-codegen where +Since this isn't the standard directory, you'll need to tell `elm-codegen` where it is. You can run `elm-codegen install --cwd=src` or use this wrapper script: ./scripts/codegen @@ -23,6 +27,3 @@ Elm _package_, and unlike Elm applications, Elm packages do not support specifying extra source directories. Note that `elm-codegen run` isn't used (there is no `Generate.elm` file). - -[elm-open-api-cli]: https://github.com/wolfadex/elm-open-api-cli -[example]: https://github.com/wolfadex/elm-open-api-cli/tree/main/example-using-api diff --git a/example-using-api/README.md b/example-using-api/README.md index 9aebc279..13a9ab35 100644 --- a/example-using-api/README.md +++ b/example-using-api/README.md @@ -1,12 +1,37 @@ # elm-open-api-codegen example -This example uses `elm-open-api-codegen` to generate Elm code for an API schema, -customizing some of the generated code in the process, by use of the -`OpenApi.Config.withFormat` function. +OpenAPI has built-in formats, such as `date-time`, but you can define your own +custom ones, too--and with the `elm-open-api-codegen` package, you can control +how data with your custom format is decoded, encoded, and transformed into a URL +param! -The "project" includes a `Data.Id` module that defines an opaque id type for API -entities. `elm-codegen install src/Data/Id.elm` has been run in order to be able -to generate code using this custom module, when defining how to generate code -for custom formats in the main script. +OpenAPI formats are specified by setting `format` alongside `type` in a spec. +For example, this looks like: -See [the main generation script here](scripts/src/CodeGenOpenApi.elm). +```yaml +components: + schemas: + ArticleId: + type: string + format: article-id +``` + +To define a custom format, we use an Elm Pages script that calls the +`elm-open-api-codegen` package to generate Elm code for an API schema, rather +than using the `elm-open-api` CLI. This allows us to configure the code +generator by using, for example, the `OpenApi.Config.withFormat` function. + +This example includes an `ArticleId` module that defines an opaque id type for +"articles" retrieved through a hypothetical API. We'd like the OpenAPI code +generator to use our `ArticleId.decode` and `ArticleId.encode` functions when +serializing Article IDs, so we need to define a custom format. + +We have already run `elm-codegen install src/ArticleId.elm` in order to create +the `codegen/Gen/ArticleId.elm` module. This is an `elm-codegen` helper module +that makes it easier to generate code that uses the types and functions defined +in `src/ArticleId.elm`. We use this helper module in our main script when +telling the OpenAPI code generator what code should be generated for decoding +and encoding our custom `article-id` OpenAPI format. + +Take a look at [the example Elm Pages script](scripts/src/CodeGenOpenApi.elm) to +see the code. diff --git a/example-using-api/codegen/Gen/ArticleId.elm b/example-using-api/codegen/Gen/ArticleId.elm new file mode 100644 index 00000000..90698bf5 --- /dev/null +++ b/example-using-api/codegen/Gen/ArticleId.elm @@ -0,0 +1,238 @@ +module Gen.ArticleId exposing + ( moduleName_, encode, decode, parse, toString, annotation_ + , call_, values_ + ) + +{-| +# Generated bindings for ArticleId + +@docs moduleName_, encode, decode, parse, toString, annotation_ +@docs call_, values_ +-} + + +import Elm +import Elm.Annotation as Type + + +{-| The name of this module. -} +moduleName_ : List String +moduleName_ = + [ "ArticleId" ] + + +{-| encode: ArticleId.ArticleId -> Json.Encode.Value -} +encode : Elm.Expression -> Elm.Expression +encode encodeArg_ = + Elm.apply + (Elm.value + { importFrom = [ "ArticleId" ] + , name = "encode" + , annotation = + Just + (Type.function + [ Type.namedWith [ "ArticleId" ] "ArticleId" [] ] + (Type.namedWith [ "Json", "Encode" ] "Value" []) + ) + } + ) + [ encodeArg_ ] + + +{-| decode: Json.Decode.Decoder ArticleId.ArticleId -} +decode : Elm.Expression +decode = + Elm.value + { importFrom = [ "ArticleId" ] + , name = "decode" + , annotation = + Just + (Type.namedWith + [ "Json", "Decode" ] + "Decoder" + [ Type.namedWith [ "ArticleId" ] "ArticleId" [] ] + ) + } + + +{-| parse: String -> Result.Result String ArticleId.ArticleId -} +parse : String -> Elm.Expression +parse parseArg_ = + Elm.apply + (Elm.value + { importFrom = [ "ArticleId" ] + , name = "parse" + , annotation = + Just + (Type.function + [ Type.string ] + (Type.namedWith + [ "Result" ] + "Result" + [ Type.string + , Type.namedWith [ "ArticleId" ] "ArticleId" [] + ] + ) + ) + } + ) + [ Elm.string parseArg_ ] + + +{-| toString: ArticleId.ArticleId -> String -} +toString : Elm.Expression -> Elm.Expression +toString toStringArg_ = + Elm.apply + (Elm.value + { importFrom = [ "ArticleId" ] + , name = "toString" + , annotation = + Just + (Type.function + [ Type.namedWith [ "ArticleId" ] "ArticleId" [] ] + Type.string + ) + } + ) + [ toStringArg_ ] + + +annotation_ : { articleId : Type.Annotation } +annotation_ = + { articleId = Type.namedWith [ "ArticleId" ] "ArticleId" [] } + + +call_ : + { encode : Elm.Expression -> Elm.Expression + , parse : Elm.Expression -> Elm.Expression + , toString : Elm.Expression -> Elm.Expression + } +call_ = + { encode = + \encodeArg_ -> + Elm.apply + (Elm.value + { importFrom = [ "ArticleId" ] + , name = "encode" + , annotation = + Just + (Type.function + [ Type.namedWith + [ "ArticleId" ] + "ArticleId" + [] + ] + (Type.namedWith + [ "Json", "Encode" ] + "Value" + [] + ) + ) + } + ) + [ encodeArg_ ] + , parse = + \parseArg_ -> + Elm.apply + (Elm.value + { importFrom = [ "ArticleId" ] + , name = "parse" + , annotation = + Just + (Type.function + [ Type.string ] + (Type.namedWith + [ "Result" ] + "Result" + [ Type.string + , Type.namedWith + [ "ArticleId" ] + "ArticleId" + [] + ] + ) + ) + } + ) + [ parseArg_ ] + , toString = + \toStringArg_ -> + Elm.apply + (Elm.value + { importFrom = [ "ArticleId" ] + , name = "toString" + , annotation = + Just + (Type.function + [ Type.namedWith + [ "ArticleId" ] + "ArticleId" + [] + ] + Type.string + ) + } + ) + [ toStringArg_ ] + } + + +values_ : + { encode : Elm.Expression + , decode : Elm.Expression + , parse : Elm.Expression + , toString : Elm.Expression + } +values_ = + { encode = + Elm.value + { importFrom = [ "ArticleId" ] + , name = "encode" + , annotation = + Just + (Type.function + [ Type.namedWith [ "ArticleId" ] "ArticleId" [] ] + (Type.namedWith [ "Json", "Encode" ] "Value" []) + ) + } + , decode = + Elm.value + { importFrom = [ "ArticleId" ] + , name = "decode" + , annotation = + Just + (Type.namedWith + [ "Json", "Decode" ] + "Decoder" + [ Type.namedWith [ "ArticleId" ] "ArticleId" [] ] + ) + } + , parse = + Elm.value + { importFrom = [ "ArticleId" ] + , name = "parse" + , annotation = + Just + (Type.function + [ Type.string ] + (Type.namedWith + [ "Result" ] + "Result" + [ Type.string + , Type.namedWith [ "ArticleId" ] "ArticleId" [] + ] + ) + ) + } + , toString = + Elm.value + { importFrom = [ "ArticleId" ] + , name = "toString" + , annotation = + Just + (Type.function + [ Type.namedWith [ "ArticleId" ] "ArticleId" [] ] + Type.string + ) + } + } \ No newline at end of file diff --git a/example-using-api/codegen/Gen/Data/Id.elm b/example-using-api/codegen/Gen/Data/Id.elm deleted file mode 100644 index 42004a90..00000000 --- a/example-using-api/codegen/Gen/Data/Id.elm +++ /dev/null @@ -1,359 +0,0 @@ -module Gen.Data.Id exposing - ( moduleName_, test_fromString, encode, parse, decode, toString - , annotation_, call_, values_ - ) - -{-| -# Generated bindings for Data.Id - -@docs moduleName_, test_fromString, encode, parse, decode, toString -@docs annotation_, call_, values_ --} - - -import Elm -import Elm.Annotation as Type - - -{-| The name of this module. -} -moduleName_ : List String -moduleName_ = - [ "Data", "Id" ] - - -{-| test_fromString: String -> Data.Id.Id kind -} -test_fromString : String -> Elm.Expression -test_fromString test_fromStringArg_ = - Elm.apply - (Elm.value - { importFrom = [ "Data", "Id" ] - , name = "test_fromString" - , annotation = - Just - (Type.function - [ Type.string ] - (Type.namedWith - [ "Data", "Id" ] - "Id" - [ Type.var "kind" ] - ) - ) - } - ) - [ Elm.string test_fromStringArg_ ] - - -{-| encode: Data.Id.Id kind -> Json.Encode.Value -} -encode : Elm.Expression -> Elm.Expression -encode encodeArg_ = - Elm.apply - (Elm.value - { importFrom = [ "Data", "Id" ] - , name = "encode" - , annotation = - Just - (Type.function - [ Type.namedWith - [ "Data", "Id" ] - "Id" - [ Type.var "kind" ] - ] - (Type.namedWith [ "Json", "Encode" ] "Value" []) - ) - } - ) - [ encodeArg_ ] - - -{-| parse: String -> Result.Result String (Data.Id.Id kind) -} -parse : String -> Elm.Expression -parse parseArg_ = - Elm.apply - (Elm.value - { importFrom = [ "Data", "Id" ] - , name = "parse" - , annotation = - Just - (Type.function - [ Type.string ] - (Type.namedWith - [ "Result" ] - "Result" - [ Type.string - , Type.namedWith - [ "Data", "Id" ] - "Id" - [ Type.var "kind" ] - ] - ) - ) - } - ) - [ Elm.string parseArg_ ] - - -{-| decode: Json.Decode.Decoder (Data.Id.Id kind) -} -decode : Elm.Expression -decode = - Elm.value - { importFrom = [ "Data", "Id" ] - , name = "decode" - , annotation = - Just - (Type.namedWith - [ "Json", "Decode" ] - "Decoder" - [ Type.namedWith [ "Data", "Id" ] "Id" [ Type.var "kind" ] - ] - ) - } - - -{-| toString: Data.Id.Id kind -> String -} -toString : Elm.Expression -> Elm.Expression -toString toStringArg_ = - Elm.apply - (Elm.value - { importFrom = [ "Data", "Id" ] - , name = "toString" - , annotation = - Just - (Type.function - [ Type.namedWith - [ "Data", "Id" ] - "Id" - [ Type.var "kind" ] - ] - Type.string - ) - } - ) - [ toStringArg_ ] - - -annotation_ : - { userId : Type.Annotation - , threadId : Type.Annotation - , messageId : Type.Annotation - , id : Type.Annotation -> Type.Annotation - } -annotation_ = - { userId = - Type.alias - moduleName_ - "UserId" - [] - (Type.namedWith - [ "Data", "Id" ] - "Id" - [ Type.namedWith [ "Data", "Id", "Internal" ] "UserTag" [] ] - ) - , threadId = - Type.alias - moduleName_ - "ThreadId" - [] - (Type.namedWith - [ "Data", "Id" ] - "Id" - [ Type.namedWith [ "Data", "Id", "Internal" ] "ThreadTag" [] ] - ) - , messageId = - Type.alias - moduleName_ - "MessageId" - [] - (Type.namedWith - [ "Data", "Id" ] - "Id" - [ Type.namedWith [ "Data", "Id", "Internal" ] "MessageTag" [] ] - ) - , id = \idArg0 -> Type.namedWith [ "Data", "Id" ] "Id" [ idArg0 ] - } - - -call_ : - { test_fromString : Elm.Expression -> Elm.Expression - , encode : Elm.Expression -> Elm.Expression - , parse : Elm.Expression -> Elm.Expression - , toString : Elm.Expression -> Elm.Expression - } -call_ = - { test_fromString = - \test_fromStringArg_ -> - Elm.apply - (Elm.value - { importFrom = [ "Data", "Id" ] - , name = "test_fromString" - , annotation = - Just - (Type.function - [ Type.string ] - (Type.namedWith - [ "Data", "Id" ] - "Id" - [ Type.var "kind" ] - ) - ) - } - ) - [ test_fromStringArg_ ] - , encode = - \encodeArg_ -> - Elm.apply - (Elm.value - { importFrom = [ "Data", "Id" ] - , name = "encode" - , annotation = - Just - (Type.function - [ Type.namedWith - [ "Data", "Id" ] - "Id" - [ Type.var "kind" ] - ] - (Type.namedWith - [ "Json", "Encode" ] - "Value" - [] - ) - ) - } - ) - [ encodeArg_ ] - , parse = - \parseArg_ -> - Elm.apply - (Elm.value - { importFrom = [ "Data", "Id" ] - , name = "parse" - , annotation = - Just - (Type.function - [ Type.string ] - (Type.namedWith - [ "Result" ] - "Result" - [ Type.string - , Type.namedWith - [ "Data", "Id" ] - "Id" - [ Type.var "kind" ] - ] - ) - ) - } - ) - [ parseArg_ ] - , toString = - \toStringArg_ -> - Elm.apply - (Elm.value - { importFrom = [ "Data", "Id" ] - , name = "toString" - , annotation = - Just - (Type.function - [ Type.namedWith - [ "Data", "Id" ] - "Id" - [ Type.var "kind" ] - ] - Type.string - ) - } - ) - [ toStringArg_ ] - } - - -values_ : - { test_fromString : Elm.Expression - , encode : Elm.Expression - , parse : Elm.Expression - , decode : Elm.Expression - , toString : Elm.Expression - } -values_ = - { test_fromString = - Elm.value - { importFrom = [ "Data", "Id" ] - , name = "test_fromString" - , annotation = - Just - (Type.function - [ Type.string ] - (Type.namedWith - [ "Data", "Id" ] - "Id" - [ Type.var "kind" ] - ) - ) - } - , encode = - Elm.value - { importFrom = [ "Data", "Id" ] - , name = "encode" - , annotation = - Just - (Type.function - [ Type.namedWith - [ "Data", "Id" ] - "Id" - [ Type.var "kind" ] - ] - (Type.namedWith [ "Json", "Encode" ] "Value" []) - ) - } - , parse = - Elm.value - { importFrom = [ "Data", "Id" ] - , name = "parse" - , annotation = - Just - (Type.function - [ Type.string ] - (Type.namedWith - [ "Result" ] - "Result" - [ Type.string - , Type.namedWith - [ "Data", "Id" ] - "Id" - [ Type.var "kind" ] - ] - ) - ) - } - , decode = - Elm.value - { importFrom = [ "Data", "Id" ] - , name = "decode" - , annotation = - Just - (Type.namedWith - [ "Json", "Decode" ] - "Decoder" - [ Type.namedWith - [ "Data", "Id" ] - "Id" - [ Type.var "kind" ] - ] - ) - } - , toString = - Elm.value - { importFrom = [ "Data", "Id" ] - , name = "toString" - , annotation = - Just - (Type.function - [ Type.namedWith - [ "Data", "Id" ] - "Id" - [ Type.var "kind" ] - ] - Type.string - ) - } - } \ No newline at end of file diff --git a/example-using-api/codegen/elm.codegen.json b/example-using-api/codegen/elm.codegen.json index cdce6783..5d2f4695 100644 --- a/example-using-api/codegen/elm.codegen.json +++ b/example-using-api/codegen/elm.codegen.json @@ -7,7 +7,7 @@ "elm/time": "1.0.0" }, "local": [ - "src/Data/Id.elm" + "src/ArticleId.elm" ] } -} \ No newline at end of file +} diff --git a/example-using-api/openapi.yaml b/example-using-api/openapi.yaml index e77a6b91..e30bc220 100644 --- a/example-using-api/openapi.yaml +++ b/example-using-api/openapi.yaml @@ -4,45 +4,15 @@ info: version: "1" components: schemas: - User: - description: User - type: object - properties: - email: - type: string - format: email - additionalProperties: - type: array - items: - type: string - required: - - email - Thread: - description: Chat thread - type: object - properties: - id: - type: string - format: thread-id - created-at: - type: integer - format: unix-seconds - required: - - id - - created-at - Message: - description: Message in a chat thread + Article: + description: Article type: object properties: id: type: string - format: message-id - created-at: - type: integer - format: unix-seconds + format: article-id content: type: string required: - id - - created-at - content diff --git a/example-using-api/scripts/after-codegen.sh b/example-using-api/scripts/after-codegen.sh deleted file mode 100755 index 3bc5fe2a..00000000 --- a/example-using-api/scripts/after-codegen.sh +++ /dev/null @@ -1,3 +0,0 @@ -#!/usr/bin/env bash -set -e -echo "Example shell script that runs after OpenAPI codegen." diff --git a/example-using-api/scripts/before-codegen.sh b/example-using-api/scripts/before-codegen.sh deleted file mode 100755 index c6c766d0..00000000 --- a/example-using-api/scripts/before-codegen.sh +++ /dev/null @@ -1,3 +0,0 @@ -#!/usr/bin/env bash -set -e -echo "Example shell script that runs before OpenAPI codegen." diff --git a/example-using-api/scripts/src/CodeGenOpenApi.elm b/example-using-api/scripts/src/CodeGenOpenApi.elm index 4aa8342c..9f88d443 100644 --- a/example-using-api/scripts/src/CodeGenOpenApi.elm +++ b/example-using-api/scripts/src/CodeGenOpenApi.elm @@ -3,21 +3,13 @@ module CodeGenOpenApi exposing (run) import Ansi.Color import BackendTask import Common -import Elm -import Elm.Annotation -import Elm.Arg -import Elm.Op -import Gen.Data.Id -import Gen.Json.Decode -import Gen.Json.Encode -import Gen.String -import Gen.Time +import Gen.ArticleId import OpenApi.BackendTask import OpenApi.Config import Pages.Script -{-| Generate an Elm "SDK" for an example OpenAPI service. +{-| Generate an Elm "SDK" for a hypothetical OpenAPI service. -} run : Pages.Script.Script run = @@ -28,70 +20,33 @@ run = |> OpenApi.Config.withOutputModuleName [ "ExampleApi" ] |> OpenApi.Config.withEffectTypes [ OpenApi.Config.ElmHttpCmd ] - timeFormat : OpenApi.Config.Format - timeFormat = - { basicType = Common.Integer - , format = "unix-seconds" - , encode = - \posix -> - Elm.Op.intDivide (Gen.Time.call_.posixToMillis posix) (Elm.int 1000) - |> Gen.Json.Encode.call_.int - , decoder = - Gen.Json.Decode.int - |> Elm.Op.pipe - (Elm.apply Gen.Json.Decode.values_.map - [ Elm.fn - (Elm.Arg.var "seconds") - (\seconds -> - Gen.Time.call_.millisToPosix (Elm.Op.multiply seconds (Elm.int 1000)) - ) - ] - ) - , annotation = Gen.Time.annotation_.posix - , requiresPackages = [ "elm/time" ] - , sharedDeclarations = [] - , toParamString = - \posix -> - Elm.Op.intDivide (Gen.Time.call_.posixToMillis posix) (Elm.int 1000) - |> Gen.String.call_.fromInt - } - - makeIdFormat : String -> Elm.Annotation.Annotation -> OpenApi.Config.Format - makeIdFormat format idAnnotation = + articleIdFormat : OpenApi.Config.Format + articleIdFormat = { basicType = Common.String - , format = format + , format = "article-id" , encode = - \id -> - Gen.Data.Id.call_.toString id - |> Gen.Json.Encode.call_.string + Gen.ArticleId.call_.encode , decoder = - Gen.Data.Id.decode - , annotation = idAnnotation - , requiresPackages = [ "elm/json" ] + Gen.ArticleId.decode + , annotation = + Gen.ArticleId.annotation_.articleId + , requiresPackages = [] , sharedDeclarations = [] , toParamString = - Gen.Data.Id.call_.toString + Gen.ArticleId.call_.toString } config : OpenApi.Config.Config config = OpenApi.Config.init "./generated" |> OpenApi.Config.withInput exampleApi - |> OpenApi.Config.withFormat timeFormat - |> OpenApi.Config.withFormat (makeIdFormat "thread-id" Gen.Data.Id.annotation_.threadId) - |> OpenApi.Config.withFormat (makeIdFormat "message-id" Gen.Data.Id.annotation_.messageId) - |> OpenApi.Config.withFormat (makeIdFormat "email" Gen.Data.Id.annotation_.userId) + |> OpenApi.Config.withFormat articleIdFormat in Pages.Script.withoutCliOptions (BackendTask.doEach - [ -- Remove this `exec` if you don't need to run a "before" script - Pages.Script.exec "./scripts/before-codegen.sh" [] - , "Generating OpenAPI code" + [ "Generating OpenAPI code" |> Ansi.Color.fontColor Ansi.Color.brightGreen |> Pages.Script.log , OpenApi.BackendTask.withConfig config - - -- Remove this `exec` if you don't need to run an "after" script - , Pages.Script.exec "./scripts/after-codegen.sh" [] ] ) diff --git a/example-using-api/scripts/test b/example-using-api/scripts/test index d9eef545..1f6a883d 100755 --- a/example-using-api/scripts/test +++ b/example-using-api/scripts/test @@ -3,4 +3,4 @@ if ! [ -d node_modules ]; then # elm-pages will crash with a vague error if elm-codegen is not in PATH. npm install fi -elm-pages run ./scripts/src/CodeGenOpenApi.elm +npx --no -- elm-pages run ./scripts/src/CodeGenOpenApi.elm diff --git a/example-using-api/src/ArticleId.elm b/example-using-api/src/ArticleId.elm new file mode 100644 index 00000000..78664e9f --- /dev/null +++ b/example-using-api/src/ArticleId.elm @@ -0,0 +1,45 @@ +module ArticleId exposing + ( ArticleId + , decode + , encode + , parse + , toString + ) + +{-| Defines an opaque Id type for Articles +-} + +import Json.Decode +import Json.Encode + + +type ArticleId + = ArticleId String + + +toString : ArticleId -> String +toString (ArticleId id) = + id + + +parse : String -> Result String ArticleId +parse raw = + if String.isEmpty raw then + Err "Article id must not be empty" + + else if String.contains "%" raw then + -- Just an example ID format rule + Err "Article id must not contain % character" + + else + Ok (ArticleId raw) + + +decode : Json.Decode.Decoder ArticleId +decode = + Json.Decode.map ArticleId Json.Decode.string + + +encode : ArticleId -> Json.Encode.Value +encode (ArticleId id) = + Json.Encode.string id diff --git a/example-using-api/src/Data/Id.elm b/example-using-api/src/Data/Id.elm deleted file mode 100644 index a5f6204c..00000000 --- a/example-using-api/src/Data/Id.elm +++ /dev/null @@ -1,85 +0,0 @@ -module Data.Id exposing - ( Id - , MessageId - , ThreadId - , UserId - , decode - , encode - , parse - , test_fromString - , toString - ) - -{-| Defines opaque Id types for each kind of API entity --} - -import Data.Id.Internal - exposing - ( MessageTag - , ThreadTag - , UserTag - ) -import Json.Decode -import Json.Encode -import Regex exposing (Regex) -import Time - - -type Id kind - = Id String - - - --- ID TYPES - - -type alias MessageId = - Id MessageTag - - -type alias ThreadId = - Id ThreadTag - - -type alias UserId = - Id UserTag - - -toString : Id kind -> String -toString (Id id) = - id - - -decode : Json.Decode.Decoder (Id kind) -decode = - Json.Decode.string |> Json.Decode.map Id - - -invalidIdPattern : Regex -invalidIdPattern = - Regex.fromString "[^a-z0-9-]" - |> Maybe.withDefault Regex.never - - -parse : String -> Result String (Id kind) -parse raw = - case raw of - "" -> - Err "Empty id" - - nonEmpty -> - if Regex.contains invalidIdPattern nonEmpty then - Err "Id contains invalid characters" - - else - Ok (Id nonEmpty) - - -encode : Id kind -> Json.Encode.Value -encode (Id id) = - Json.Encode.string id - - -test_fromString : String -> Id kind -test_fromString id = - Id id diff --git a/example-using-api/src/Data/Id/Dict.elm b/example-using-api/src/Data/Id/Dict.elm deleted file mode 100644 index b0e69d86..00000000 --- a/example-using-api/src/Data/Id/Dict.elm +++ /dev/null @@ -1,262 +0,0 @@ -module Data.Id.Dict exposing - ( empty, singleton, insert, update, remove - , IdDict - , MessageIdDict - , ThreadIdDict - , UserIdDict - , keys, values, toList, fromList - , isEmpty, member, get, size - , map, foldl, foldr, filter, partition - ) - -{-| Dict types keyed by an opaque Id. - -Mostly generated by miniBill/elm-generic-dict. - - -## Build - -@docs empty, singleton, insert, update, remove - - -## Dictionaries - -@docs IdDict - -@docs MessageIdDict -@docs ThreadIdDict -@docs UserIdDict - - -## Lists - -@docs keys, values, toList, fromList - - -## Query - -@docs isEmpty, member, get, size - - -## Transform - -@docs map, foldl, foldr, filter, partition - --} - -import Data.Id as Id exposing (Id) -import Data.Id.Internal as Internal -import Dict - - -type alias MessageIdDict v = - IdDict Internal.MessageTag v - - -type alias ThreadIdDict v = - IdDict Internal.ThreadTag v - - -type alias UserIdDict v = - IdDict Internal.UserTag v - - -type IdDict tag v - = IdDict (Dict.Dict String ( Id tag, v )) - - -empty : IdDict tag v -empty = - IdDict Dict.empty - - -singleton : Id tag -> v -> IdDict tag v -singleton key value = - IdDict (Dict.singleton (Id.toString key) ( key, value )) - - -insert : Id tag -> v -> IdDict tag v -> IdDict tag v -insert key value d = - case d of - IdDict dict -> - IdDict (Dict.insert (Id.toString key) ( key, value ) dict) - - -update : Id tag -> (Maybe b -> Maybe b) -> IdDict tag b -> IdDict tag b -update key f d = - case d of - IdDict dict -> - IdDict - (Dict.update - (Data.Id.toString key) - (\updateUnpack -> - Maybe.map - (Tuple.pair key) - (f (Maybe.map Tuple.second updateUnpack)) - ) - dict - ) - - -remove : Id tag -> IdDict tag v -> IdDict tag v -remove key d = - case d of - IdDict dict -> - IdDict (Dict.remove (Data.Id.toString key) dict) - - -isEmpty : IdDict tag v -> Bool -isEmpty d = - case d of - IdDict dict -> - Dict.isEmpty dict - - -member : Id tag -> IdDict tag v -> Bool -member key d = - case d of - IdDict dict -> - Dict.member (Data.Id.toString key) dict - - -get : Id tag -> IdDict tag b -> Maybe b -get key d = - case d of - IdDict dict -> - Maybe.map Tuple.second (Dict.get (Data.Id.toString key) dict) - - -size : IdDict tag v -> Int -size d = - case d of - IdDict dict -> - Dict.size dict - - -keys : IdDict tag v -> List (Id tag) -keys d = - case d of - IdDict dict -> - List.map Tuple.first (Dict.values dict) - - -values : IdDict tag v -> List v -values d = - case d of - IdDict dict -> - List.map Tuple.second (Dict.values dict) - - -toList : IdDict tag v -> List ( Id tag, v ) -toList d = - case d of - IdDict dict -> - Dict.values dict - - -fromList : List ( Id tag, v ) -> IdDict tag v -fromList l = - IdDict - (Dict.fromList - (List.map - (\e -> - let - ( k, _ ) = - e - in - ( Data.Id.toString k, e ) - ) - l - ) - ) - - -map : (Id tag -> a -> b) -> IdDict tag a -> IdDict tag b -map f d = - case d of - IdDict dict -> - IdDict - (Dict.map - (\_ -> - \unpack -> - let - ( k, a ) = - unpack - in - ( k, f k a ) - ) - dict - ) - - -foldl : (Id tag -> v -> b -> b) -> b -> IdDict tag v -> b -foldl f b0 d = - case d of - IdDict dict -> - Dict.foldl - (\_ kv b -> - let - ( k, v ) = - kv - in - f k v b - ) - b0 - dict - - -foldr : (Id tag -> v -> b -> b) -> b -> IdDict tag v -> b -foldr f b0 d = - case d of - IdDict dict -> - Dict.foldr - (\_ kv b -> - let - ( k, v ) = - kv - in - f k v b - ) - b0 - dict - - -filter : (Id tag -> v -> Bool) -> IdDict tag v -> IdDict tag v -filter f d = - IdDict - (case d of - IdDict dict -> - Dict.filter - (\_ -> - \unpack -> - let - ( k, v ) = - unpack - in - f k v - ) - dict - ) - - -partition : - (Id tag -> v -> Bool) - -> IdDict tag v - -> ( IdDict tag v, IdDict tag v ) -partition f d = - case d of - IdDict dict -> - Tuple.mapBoth - IdDict - IdDict - (Dict.partition - (\_ -> - \unpack -> - let - ( k, v ) = - unpack - in - f k v - ) - dict - ) diff --git a/example-using-api/src/Data/Id/Internal.elm b/example-using-api/src/Data/Id/Internal.elm deleted file mode 100644 index 70c04f77..00000000 --- a/example-using-api/src/Data/Id/Internal.elm +++ /dev/null @@ -1,19 +0,0 @@ -module Data.Id.Internal exposing - ( MessageTag(..) - , ThreadTag(..) - , UserTag(..) - ) - --- PHANTOM TYPE TAGS - - -type MessageTag - = MessageTag - - -type ThreadTag - = ThreadTag - - -type UserTag - = UserTag