git.iko.soy/rowtype-yoga/purescript-lunapark
on main help sign in
Bump dependencies
commit3f7f0007aad5fd48b92ed1fcff1ab5f759edd437 authorGary Burgess <gary.burgess@gmail.com> dateThu 28 Feb 2019, 18:31 (8 years ago) parent780f320
4 files changed+32−32
bower.json+2−2 src/Lunapark/Endpoint.purs+2−2 src/Lunapark/Error.purs+5−5 src/Lunapark/Types.purs+23−23
bower.json+2−2
@@ -26,8 +26,8 @@
2626 "dependencies": {
2727 "purescript-xpath": "cryogenian/purescript-xpath#compiler/0.12",
2828 "purescript-argonaut-core": "^4.0.0",
29− "purescript-argonaut-codecs": "^4.0.0",
30− "purescript-affjax": "^7.0.0",
29+ "purescript-argonaut-codecs": "^5.1.2",
30+ "purescript-affjax": "^8.0.0",
3131 "purescript-css": "^4.0.0",
3232 "purescript-node-fs-aff": "^6.0.0",
3333 "purescript-run": "cryogenian/purescript-run#compiler/0.12"
src/Lunapark/Endpoint.purs+2−2
@@ -13,7 +13,7 @@ import Affjax.ResponseFormat as NR
1313import Affjax.StatusCode (StatusCode(..))
1414import Data.Argonaut.Core (Json)
1515import Data.Argonaut.Decode.Class (decodeJson) as J
16−import Data.Argonaut.Decode.Combinators ((.?)) as J
16+import Data.Argonaut.Decode.Combinators ((.:)) as J
1717import Data.Bifunctor (lmap)
1818import Data.Either (Either(..), either)
1919import Data.Foldable as F
@@ -174,7 +174,7 @@ handleAPIError
174174handleAPIError r = case r.status of
175175 StatusCode 200 → lmap LE.unknownError do
176176 obj ← J.decodeJson =<< lmap N.printResponseFormatError r.body
177− obj J..? "value"
177+ obj J..: "value"
178178 code →
179179 Left $ either (LE.unknownError <<< N.printResponseFormatError) LE.fromJson r.body
180180
src/Lunapark/Error.purs+5−5
@@ -3,7 +3,7 @@ module Lunapark.Error where
33import Prelude
44
55import Data.Argonaut.Core (Json) as J
6−import Data.Argonaut.Decode.Combinators ((.?)) as J
6+import Data.Argonaut.Decode.Combinators ((.:)) as J
77import Data.Argonaut.Decode.Class (decodeJson) as J
88import Data.Either (Either(..), either)
99
@@ -109,10 +109,10 @@ type Error =
109109fromJson ∷ J.Json → Error
110110fromJson js = either unknownError identity do
111111 obj ← J.decodeJson js
112− value ← obj J..? "value"
113− error ← fromStringCode =<< value J..? "error"
114− message ← value J..? "message"
115− stacktrace ← value J..? "stacktrace"
112+ value ← obj J..: "value"
113+ error ← fromStringCode =<< value J..: "error"
114+ message ← value J..: "message"
115+ stacktrace ← value J..: "stacktrace"
116116 pure { error, message, stacktrace }
117117
118118unknownError ∷ String → Error
src/Lunapark/Types.purs+23−23
@@ -11,7 +11,7 @@ import Control.Alt ((<|>))
1111import Data.Argonaut.Core (Json)
1212import Data.Argonaut.Core (Json, jsonEmptyObject, jsonNull) as J
1313import Data.Argonaut.Decode.Class (decodeJson) as J
14−import Data.Argonaut.Decode.Combinators ((.?))
14+import Data.Argonaut.Decode.Combinators ((.:))
1515import Data.Argonaut.Encode.Class (class EncodeJson, encodeJson) as J
1616import Data.Argonaut.Encode.Combinators (extend) as J
1717import Data.Array as A
@@ -59,7 +59,7 @@ derive newtype instance ordElement ∷ Ord Element
5959
6060decodeElement ∷ Json → Either String Element
6161decodeElement = J.decodeJson >=> \obj →
62− map Element $ obj .? "element-6066-11e4-a52e-4f735466cecf" <|> obj .? "ELEMENT"
62+ map Element $ obj .: "element-6066-11e4-a52e-4f735466cecf" <|> obj .: "ELEMENT"
6363
6464encodeElement ∷ Element → Json
6565encodeElement (Element eid) = J.encodeJson $ FO.fromFoldable
@@ -77,8 +77,8 @@ type CreateSessionResponse =
7777
7878decodeCreateSessionResponse ∷ Json → Either String CreateSessionResponse
7979decodeCreateSessionResponse = J.decodeJson >=> \obj → do
80− session ← decodeSessionId =<< obj .? "sessionId"
81− capabilities ← decodeCapabilities =<< obj .? "capabilities"
80+ session ← decodeSessionId =<< obj .: "sessionId"
81+ capabilities ← decodeCapabilities =<< obj .: "capabilities"
8282 pure { session, capabilities }
8383
8484type ServerStatus =
@@ -87,7 +87,7 @@ type ServerStatus =
8787 }
8888
8989decodeServerStatus ∷ Json → Either String ServerStatus
90−decodeServerStatus = J.decodeJson >=> \obj → { ready: _, message: _ } <$> obj .? "ready" <*> obj .? "message"
90+decodeServerStatus = J.decodeJson >=> \obj → { ready: _, message: _ } <$> obj .: "ready" <*> obj .: "message"
9191
9292type Timeouts =
9393 { script ∷ Milliseconds
@@ -97,9 +97,9 @@ type Timeouts =
9797
9898decodeTimeouts ∷ Json → Either String Timeouts
9999decodeTimeouts = J.decodeJson >=> \obj → do
100− script ← map Milliseconds $ obj .? "script"
101− pageLoad ← map Milliseconds $ obj .? "pageLoad"
102− implicit ← map Milliseconds $ obj .? "implicit"
100+ script ← map Milliseconds $ obj .: "script"
101+ pageLoad ← map Milliseconds $ obj .: "pageLoad"
102+ implicit ← map Milliseconds $ obj .: "implicit"
103103 pure { script, pageLoad, implicit }
104104
105105encodeTimeouts ∷ Timeouts → Json
@@ -142,20 +142,20 @@ type Rectangle =
142142
143143decodeRectangle ∷ Json → Either String Rectangle
144144decodeRectangle = J.decodeJson >=> \obj → do
145− width ← obj .? "width"
146− height ← obj .? "height"
147− x ← obj .? "x"
148− y ← obj .? "y"
145+ width ← obj .: "width"
146+ height ← obj .: "height"
147+ x ← obj .: "x"
148+ y ← obj .: "y"
149149 pure { width, height, x, y }
150150
151151decodeRectangleLegacy ∷ { size ∷ Json, position ∷ Json } → Either String Rectangle
152152decodeRectangleLegacy { size, position } = do
153153 sobj ← J.decodeJson size
154154 pobj ← J.decodeJson position
155− x ← pobj .? "x"
156− y ← pobj .? "y"
157− width ← sobj .? "width"
158− height ← sobj .? "height"
155+ x ← pobj .: "x"
156+ y ← pobj .: "y"
157+ width ← sobj .: "width"
158+ height ← sobj .: "height"
159159 pure { width, height, x, y }
160160
161161encodeRectangleLegacy ∷ Rectangle → { size ∷ Json, position ∷ Json }
@@ -254,13 +254,13 @@ encodeCookie r = J.encodeJson $ FO.fromFoldable
254254
255255decodeCookie ∷ Json → Either String Cookie
256256decodeCookie = J.decodeJson >=> \obj → do
257− name ← obj .? "name"
258− value ← obj .? "value"
259− path ← maybify $ obj .? "path"
260− domain ← maybify $ obj .? "domain"
261− secure ← maybify $ obj .? "secure"
262− httpOnly ← maybify $ obj .? "httpOnly"
263− expiry ← maybify $ obj .? "expiry"
257+ name ← obj .: "name"
258+ value ← obj .: "value"
259+ path ← maybify $ obj .: "path"
260+ domain ← maybify $ obj .: "domain"
261+ secure ← maybify $ obj .: "secure"
262+ httpOnly ← maybify $ obj .: "httpOnly"
263+ expiry ← maybify $ obj .: "expiry"
264264 pure
265265 { name
266266 , value