git.iko.soy/rowtype-yoga/purescript-lunapark
on main help sign in
Bump dependencies
3f7f000Gary Burgess
bower.json+2−2
@@ -26,8 +26,8 @@
26 "dependencies": {
26 "dependencies": {
27 "purescript-xpath": "cryogenian/purescript-xpath#compiler/0.12",
27 "purescript-xpath": "cryogenian/purescript-xpath#compiler/0.12",
28 "purescript-argonaut-core": "^4.0.0",
28 "purescript-argonaut-core": "^4.0.0",
29− "purescript-argonaut-codecs": "^4.0.0",
29+ "purescript-argonaut-codecs": "^5.1.2",
30− "purescript-affjax": "^7.0.0",
30+ "purescript-affjax": "^8.0.0",
31 "purescript-css": "^4.0.0",
31 "purescript-css": "^4.0.0",
32 "purescript-node-fs-aff": "^6.0.0",
32 "purescript-node-fs-aff": "^6.0.0",
33 "purescript-run": "cryogenian/purescript-run#compiler/0.12"
33 "purescript-run": "cryogenian/purescript-run#compiler/0.12"
src/Lunapark/Endpoint.purs+2−2
@@ -13,7 +13,7 @@ import Affjax.ResponseFormat as NR
13import Affjax.StatusCode (StatusCode(..))
13import Affjax.StatusCode (StatusCode(..))
14import Data.Argonaut.Core (Json)
14import Data.Argonaut.Core (Json)
15import Data.Argonaut.Decode.Class (decodeJson) as J
15import Data.Argonaut.Decode.Class (decodeJson) as J
16−import Data.Argonaut.Decode.Combinators ((.?)) as J
16+import Data.Argonaut.Decode.Combinators ((.:)) as J
17import Data.Bifunctor (lmap)
17import Data.Bifunctor (lmap)
18import Data.Either (Either(..), either)
18import Data.Either (Either(..), either)
19import Data.Foldable as F
19import Data.Foldable as F
@@ -174,7 +174,7 @@ handleAPIError
174handleAPIError r = case r.status of
174handleAPIError r = case r.status of
175 StatusCode 200 → lmap LE.unknownError do
175 StatusCode 200 → lmap LE.unknownError do
176 obj ← J.decodeJson =<< lmap N.printResponseFormatError r.body
176 obj ← J.decodeJson =<< lmap N.printResponseFormatError r.body
177− obj J..? "value"
177+ obj J..: "value"
178 code →
178 code →
179 Left $ either (LE.unknownError <<< N.printResponseFormatError) LE.fromJson r.body
179 Left $ either (LE.unknownError <<< N.printResponseFormatError) LE.fromJson r.body
180
180
src/Lunapark/Error.purs+5−5
@@ -3,7 +3,7 @@ module Lunapark.Error where
3import Prelude
3import Prelude
4
4
5import Data.Argonaut.Core (Json) as J
5import Data.Argonaut.Core (Json) as J
6−import Data.Argonaut.Decode.Combinators ((.?)) as J
6+import Data.Argonaut.Decode.Combinators ((.:)) as J
7import Data.Argonaut.Decode.Class (decodeJson) as J
7import Data.Argonaut.Decode.Class (decodeJson) as J
8import Data.Either (Either(..), either)
8import Data.Either (Either(..), either)
9
9
@@ -109,10 +109,10 @@ type Error =
109fromJson ∷ J.Json → Error
109fromJson ∷ J.Json → Error
110fromJson js = either unknownError identity do
110fromJson js = either unknownError identity do
111 obj ← J.decodeJson js
111 obj ← J.decodeJson js
112− value ← obj J..? "value"
112+ value ← obj J..: "value"
113− error ← fromStringCode =<< value J..? "error"
113+ error ← fromStringCode =<< value J..: "error"
114− message ← value J..? "message"
114+ message ← value J..: "message"
115− stacktrace ← value J..? "stacktrace"
115+ stacktrace ← value J..: "stacktrace"
116 pure { error, message, stacktrace }
116 pure { error, message, stacktrace }
117
117
118unknownError ∷ String → Error
118unknownError ∷ String → Error
src/Lunapark/Types.purs+23−23
@@ -11,7 +11,7 @@ import Control.Alt ((<|>))
11import Data.Argonaut.Core (Json)
11import Data.Argonaut.Core (Json)
12import Data.Argonaut.Core (Json, jsonEmptyObject, jsonNull) as J
12import Data.Argonaut.Core (Json, jsonEmptyObject, jsonNull) as J
13import Data.Argonaut.Decode.Class (decodeJson) as J
13import Data.Argonaut.Decode.Class (decodeJson) as J
14−import Data.Argonaut.Decode.Combinators ((.?))
14+import Data.Argonaut.Decode.Combinators ((.:))
15import Data.Argonaut.Encode.Class (class EncodeJson, encodeJson) as J
15import Data.Argonaut.Encode.Class (class EncodeJson, encodeJson) as J
16import Data.Argonaut.Encode.Combinators (extend) as J
16import Data.Argonaut.Encode.Combinators (extend) as J
17import Data.Array as A
17import Data.Array as A
@@ -59,7 +59,7 @@ derive newtype instance ordElement ∷ Ord Element
59
59
60decodeElement ∷ Json → Either String Element
60decodeElement ∷ Json → Either String Element
61decodeElement = J.decodeJson >=> \obj →
61decodeElement = 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"
63
63
64encodeElement ∷ Element → Json
64encodeElement ∷ Element → Json
65encodeElement (Element eid) = J.encodeJson $ FO.fromFoldable
65encodeElement (Element eid) = J.encodeJson $ FO.fromFoldable
@@ -77,8 +77,8 @@ type CreateSessionResponse =
77
77
78decodeCreateSessionResponse ∷ Json → Either String CreateSessionResponse
78decodeCreateSessionResponse ∷ Json → Either String CreateSessionResponse
79decodeCreateSessionResponse = J.decodeJson >=> \obj → do
79decodeCreateSessionResponse = J.decodeJson >=> \obj → do
80− session ← decodeSessionId =<< obj .? "sessionId"
80+ session ← decodeSessionId =<< obj .: "sessionId"
81− capabilities ← decodeCapabilities =<< obj .? "capabilities"
81+ capabilities ← decodeCapabilities =<< obj .: "capabilities"
82 pure { session, capabilities }
82 pure { session, capabilities }
83
83
84type ServerStatus =
84type ServerStatus =
@@ -87,7 +87,7 @@ type ServerStatus =
87 }
87 }
88
88
89decodeServerStatus ∷ Json → Either String ServerStatus
89decodeServerStatus ∷ 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"
91
91
92type Timeouts =
92type Timeouts =
93 { script ∷ Milliseconds
93 { script ∷ Milliseconds
@@ -97,9 +97,9 @@ type Timeouts =
97
97
98decodeTimeouts ∷ Json → Either String Timeouts
98decodeTimeouts ∷ Json → Either String Timeouts
99decodeTimeouts = J.decodeJson >=> \obj → do
99decodeTimeouts = J.decodeJson >=> \obj → do
100− script ← map Milliseconds $ obj .? "script"
100+ script ← map Milliseconds $ obj .: "script"
101− pageLoad ← map Milliseconds $ obj .? "pageLoad"
101+ pageLoad ← map Milliseconds $ obj .: "pageLoad"
102− implicit ← map Milliseconds $ obj .? "implicit"
102+ implicit ← map Milliseconds $ obj .: "implicit"
103 pure { script, pageLoad, implicit }
103 pure { script, pageLoad, implicit }
104
104
105encodeTimeouts ∷ Timeouts → Json
105encodeTimeouts ∷ Timeouts → Json
@@ -142,20 +142,20 @@ type Rectangle =
142
142
143decodeRectangle ∷ Json → Either String Rectangle
143decodeRectangle ∷ Json → Either String Rectangle
144decodeRectangle = J.decodeJson >=> \obj → do
144decodeRectangle = J.decodeJson >=> \obj → do
145− width ← obj .? "width"
145+ width ← obj .: "width"
146− height ← obj .? "height"
146+ height ← obj .: "height"
147− x ← obj .? "x"
147+ x ← obj .: "x"
148− y ← obj .? "y"
148+ y ← obj .: "y"
149 pure { width, height, x, y }
149 pure { width, height, x, y }
150
150
151decodeRectangleLegacy ∷ { size ∷ Json, position ∷ Json } → Either String Rectangle
151decodeRectangleLegacy ∷ { size ∷ Json, position ∷ Json } → Either String Rectangle
152decodeRectangleLegacy { size, position } = do
152decodeRectangleLegacy { size, position } = do
153 sobj ← J.decodeJson size
153 sobj ← J.decodeJson size
154 pobj ← J.decodeJson position
154 pobj ← J.decodeJson position
155− x ← pobj .? "x"
155+ x ← pobj .: "x"
156− y ← pobj .? "y"
156+ y ← pobj .: "y"
157− width ← sobj .? "width"
157+ width ← sobj .: "width"
158− height ← sobj .? "height"
158+ height ← sobj .: "height"
159 pure { width, height, x, y }
159 pure { width, height, x, y }
160
160
161encodeRectangleLegacy ∷ Rectangle → { size ∷ Json, position ∷ Json }
161encodeRectangleLegacy ∷ Rectangle → { size ∷ Json, position ∷ Json }
@@ -254,13 +254,13 @@ encodeCookie r = J.encodeJson $ FO.fromFoldable
254
254
255decodeCookie ∷ Json → Either String Cookie
255decodeCookie ∷ Json → Either String Cookie
256decodeCookie = J.decodeJson >=> \obj → do
256decodeCookie = J.decodeJson >=> \obj → do
257− name ← obj .? "name"
257+ name ← obj .: "name"
258− value ← obj .? "value"
258+ value ← obj .: "value"
259− path ← maybify $ obj .? "path"
259+ path ← maybify $ obj .: "path"
260− domain ← maybify $ obj .? "domain"
260+ domain ← maybify $ obj .: "domain"
261− secure ← maybify $ obj .? "secure"
261+ secure ← maybify $ obj .: "secure"
262− httpOnly ← maybify $ obj .? "httpOnly"
262+ httpOnly ← maybify $ obj .: "httpOnly"
263− expiry ← maybify $ obj .? "expiry"
263+ expiry ← maybify $ obj .: "expiry"
264 pure
264 pure
265 { name
265 { name
266 , value
266 , value