Skip to content
This repository was archived by the owner on Jun 15, 2023. It is now read-only.

Commit bf569de

Browse files
authored
Merge pull request #6 from garyb/bump-dependencies
Bump dependencies
2 parents 0f2e689 + 3f7f000 commit bf569de

File tree

4 files changed

+32
-32
lines changed

4 files changed

+32
-32
lines changed

bower.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,8 +27,8 @@
2727
"dependencies": {
2828
"purescript-xpath": "cryogenian/purescript-xpath#compiler/0.12",
2929
"purescript-argonaut-core": "^4.0.0",
30-
"purescript-argonaut-codecs": "^4.0.0",
31-
"purescript-affjax": "^7.0.0",
30+
"purescript-argonaut-codecs": "^5.1.2",
31+
"purescript-affjax": "^8.0.0",
3232
"purescript-css": "^4.0.0",
3333
"purescript-node-fs-aff": "^6.0.0",
3434
"purescript-run": "cryogenian/purescript-run#compiler/0.12"

src/Lunapark/Endpoint.purs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ import Affjax.ResponseFormat as NR
1313
import Affjax.StatusCode (StatusCode(..))
1414
import Data.Argonaut.Core (Json)
1515
import Data.Argonaut.Decode.Class (decodeJson) as J
16-
import Data.Argonaut.Decode.Combinators ((.?)) as J
16+
import Data.Argonaut.Decode.Combinators ((.:)) as J
1717
import Data.Bifunctor (lmap)
1818
import Data.Either (Either(..), either)
1919
import Data.Foldable as F
@@ -174,7 +174,7 @@ handleAPIError
174174
handleAPIError 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

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ module Lunapark.Error where
33
import Prelude
44

55
import Data.Argonaut.Core (Json) as J
6-
import Data.Argonaut.Decode.Combinators ((.?)) as J
6+
import Data.Argonaut.Decode.Combinators ((.:)) as J
77
import Data.Argonaut.Decode.Class (decodeJson) as J
88
import Data.Either (Either(..), either)
99

@@ -109,10 +109,10 @@ type Error =
109109
fromJson J.Json Error
110110
fromJson 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

118118
unknownError String Error

src/Lunapark/Types.purs

Lines changed: 23 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ import Control.Alt ((<|>))
1111
import Data.Argonaut.Core (Json)
1212
import Data.Argonaut.Core (Json, jsonEmptyObject, jsonNull) as J
1313
import Data.Argonaut.Decode.Class (decodeJson) as J
14-
import Data.Argonaut.Decode.Combinators ((.?))
14+
import Data.Argonaut.Decode.Combinators ((.:))
1515
import Data.Argonaut.Encode.Class (class EncodeJson, encodeJson) as J
1616
import Data.Argonaut.Encode.Combinators (extend) as J
1717
import Data.Array as A
@@ -59,7 +59,7 @@ derive newtype instance ordElement ∷ Ord Element
5959

6060
decodeElement Json Either String Element
6161
decodeElement = 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

6464
encodeElement Element Json
6565
encodeElement (Element eid) = J.encodeJson $ FO.fromFoldable
@@ -77,8 +77,8 @@ type CreateSessionResponse =
7777

7878
decodeCreateSessionResponse Json Either String CreateSessionResponse
7979
decodeCreateSessionResponse = 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

8484
type ServerStatus =
@@ -87,7 +87,7 @@ type ServerStatus =
8787
}
8888

8989
decodeServerStatus 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

9292
type Timeouts =
9393
{ script Milliseconds
@@ -97,9 +97,9 @@ type Timeouts =
9797

9898
decodeTimeouts Json Either String Timeouts
9999
decodeTimeouts = 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

105105
encodeTimeouts Timeouts Json
@@ -142,20 +142,20 @@ type Rectangle =
142142

143143
decodeRectangle Json Either String Rectangle
144144
decodeRectangle = 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

151151
decodeRectangleLegacy { size Json, position Json } Either String Rectangle
152152
decodeRectangleLegacy { 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

161161
encodeRectangleLegacy Rectangle { size Json, position Json }
@@ -254,13 +254,13 @@ encodeCookie r = J.encodeJson $ FO.fromFoldable
254254

255255
decodeCookie Json Either String Cookie
256256
decodeCookie = 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

0 commit comments

Comments
 (0)