slack-web 1.5.0.0 → 1.5.0.1
raw patch · 6 files changed
+168/−2 lines, 6 filesPVP ok
version bump matches the API change (PVP)
API changes (from Hackage documentation)
Files
- CHANGELOG.md +5/−0
- slack-web.cabal +1/−1
- src/Web/Slack/Experimental/Blocks/Types.hs +1/−1
- tests/Web/Slack/Experimental/Events/TypesSpec.hs +1/−0
- tests/golden/SlackWebhookEvent/message_rich_text.golden +84/−0
- tests/golden/SlackWebhookEvent/message_rich_text.json +76/−0
CHANGELOG.md view
@@ -1,3 +1,8 @@+# 1.5.0.1++* [#119](https://github.com/MercuryTechnologies/slack-web/pull/119) Fix a typo+ in rich text decoding.+ # 1.5.0.0 ## Breaking changes
slack-web.cabal view
@@ -1,6 +1,6 @@ cabal-version: 2.2 name: slack-web-version: 1.5.0.0+version: 1.5.0.1 build-type: Simple
src/Web/Slack/Experimental/Blocks/Types.hs view
@@ -302,7 +302,7 @@ text <- obj .: "text" pure $ RichItemText text style "channel" -> do- channelId <- obj .: "chanel_id"+ channelId <- obj .: "channel_id" pure $ RichItemChannel channelId "emoji" -> do name <- obj .: "name"
tests/Web/Slack/Experimental/Events/TypesSpec.hs view
@@ -12,6 +12,7 @@ (oneGoldenTestDecode @SlackWebhookEvent) [ "messageExample" , "messageChange"+ , "message_rich_text" , "link" , "botMessage" , "joinChannel"
+ tests/golden/SlackWebhookEvent/message_rich_text.golden view
@@ -0,0 +1,84 @@+EventEventCallback+ ( EventCallback+ { eventId = EventId+ { unEventId = "Ev04EPCGMFLL" }+ , teamId = TeamId+ { unTeamId = "T043DB835ML" }+ , eventTime = MkSystemTime+ { systemSeconds = 1670625739+ , systemNanoseconds = 0+ }+ , event = EventMessage+ ( MessageEvent+ { blocks = Just+ [ RichText+ { blockId = Just+ ( NonEmptyText "6r5Zo" )+ , elements =+ [ RichTextSectionItemRichText+ [ RichItemChannel+ ( ConversationId+ { unConversationId = "C043YJGBY49" }+ )+ , RichItemText " "+ ( RichStyle+ { rsBold = False+ , rsItalic = False+ }+ )+ , RichItemEmoji "cat"+ , RichItemText " "+ ( RichStyle+ { rsBold = False+ , rsItalic = False+ }+ )+ , RichItemUser+ ( UserId+ { unUserId = "U043H11ES4V" }+ )+ ( RichStyle+ { rsBold = False+ , rsItalic = False+ }+ )+ , RichItemText " "+ ( RichStyle+ { rsBold = False+ , rsItalic = False+ }+ )+ , RichItemLink+ ( RichLinkAttrs+ { style = RichStyle+ { rsBold = False+ , rsItalic = False+ }+ , url = "https://google.com"+ , text = Nothing+ }+ )+ , RichItemText " text text text"+ ( RichStyle+ { rsBold = False+ , rsItalic = False+ }+ )+ ]+ ]+ }+ ]+ , channel = ConversationId+ { unConversationId = "C045V0VJT16" }+ , text = "<#C043YJGBY49|general> :cat: <@U043H11ES4V> <https://google.com> text text text"+ , channelType = Channel+ , user = UserId+ { unUserId = "U043H11ES4V" }+ , ts = "1670625739.704049"+ , threadTs = Nothing+ , appId = Nothing+ , botId = Nothing+ }+ )+ }+ )
+ tests/golden/SlackWebhookEvent/message_rich_text.json view
@@ -0,0 +1,76 @@+{+ "token": "aaaa",+ "team_id": "T043DB835ML",+ "api_app_id": "A0442TUPHGR",+ "event": {+ "client_msg_id": "93e27a88-b87f-48e9-9b41-4a28af2a25ad",+ "type": "message",+ "text": "<#C043YJGBY49|general> :cat: <@U043H11ES4V> <https://google.com> text text text",+ "user": "U043H11ES4V",+ "ts": "1670625739.704049",+ "blocks": [+ {+ "type": "rich_text",+ "block_id": "6r5Zo",+ "elements": [+ {+ "type": "rich_text_section",+ "elements": [+ {+ "type": "channel",+ "channel_id": "C043YJGBY49"+ },+ {+ "type": "text",+ "text": " "+ },+ {+ "type": "emoji",+ "name": "cat",+ "unicode": "1f431"+ },+ {+ "type": "text",+ "text": " "+ },+ {+ "type": "user",+ "user_id": "U043H11ES4V"+ },+ {+ "type": "text",+ "text": " "+ },+ {+ "type": "link",+ "url": "https://google.com"+ },+ {+ "type": "text",+ "text": " text text text"+ }+ ]+ }+ ]+ }+ ],+ "team": "T043DB835ML",+ "channel": "C045V0VJT16",+ "event_ts": "1670625739.704049",+ "channel_type": "channel"+ },+ "type": "event_callback",+ "event_id": "Ev04EPCGMFLL",+ "event_time": 1670625739,+ "authorizations": [+ {+ "enterprise_id": null,+ "team_id": "T043DB835ML",+ "user_id": "U0442US8QGH",+ "is_bot": true,+ "is_enterprise_install": false+ }+ ],+ "is_ext_shared_channel": false,+ "event_context": "aaaa"+}