diff --git a/elm.json b/elm.json index 95d8038f..bfd2c6b2 100644 --- a/elm.json +++ b/elm.json @@ -11,7 +11,7 @@ "Pages.ImagePath", "Pages.PagePath", "StaticHttp", - "Secrets", + "Pages.Secrets", "Pages.Directory", "Pages.Platform", "Pages.Internal", diff --git a/src/Pages/Secrets.elm b/src/Pages/Secrets.elm new file mode 100644 index 00000000..3c81f5f7 --- /dev/null +++ b/src/Pages/Secrets.elm @@ -0,0 +1,36 @@ +module Pages.Secrets exposing (Value, map, succeed, with) + +{-| TODO + +@docs Value, map, succeed, with + +-} + +import Secrets + + +{-| TODO +-} +type alias Value value = + Secrets.Value value + + +{-| TODO +-} +succeed : value -> Value value +succeed = + Secrets.succeed + + +{-| TODO +-} +map : (valueA -> valueB) -> Value valueA -> Value valueB +map = + Secrets.map + + +{-| TODO +-} +with : String -> Value (String -> value) -> Value value +with = + Secrets.with diff --git a/src/StaticHttp.elm b/src/StaticHttp.elm index b3bef19f..29f3a019 100644 --- a/src/StaticHttp.elm +++ b/src/StaticHttp.elm @@ -24,6 +24,7 @@ module StaticHttp exposing import Dict exposing (Dict) import Dict.Extra import Json.Decode.Exploration as Decode exposing (Decoder) +import Pages.Secrets import Pages.StaticHttpRequest exposing (Request(..)) import Secrets @@ -189,7 +190,7 @@ lookup requestInfo rawResponses = Ok ( rawResponses, value ) -addUrls : List (Secrets.Value { url : String, method : String, headers : List ( String, String ) }) -> Pages.StaticHttpRequest.Request value -> Pages.StaticHttpRequest.Request value +addUrls : List (Pages.Secrets.Value { url : String, method : String, headers : List ( String, String ) }) -> Pages.StaticHttpRequest.Request value -> Pages.StaticHttpRequest.Request value addUrls urlsToAdd requestInfo = case requestInfo of Request ( initialUrls, function ) -> @@ -199,7 +200,7 @@ addUrls urlsToAdd requestInfo = Done value -lookupUrls : Pages.StaticHttpRequest.Request value -> List (Secrets.Value RequestDetails) +lookupUrls : Pages.StaticHttpRequest.Request value -> List (Pages.Secrets.Value RequestDetails) lookupUrls requestInfo = case requestInfo of Request ( urls, lookupFn ) -> @@ -244,7 +245,7 @@ succeed value = {-| TODO -} get : - Secrets.Value String + Pages.Secrets.Value String -> Decoder a -> Request a get url decoder = @@ -279,7 +280,7 @@ requestToString requestDetails = {-| TODO -} request : - Secrets.Value RequestDetails + Pages.Secrets.Value RequestDetails -> Decoder a -> Request a request urlWithSecrets decoder =