Skip to content

Releases: SpaceEEC/crux_rest

0.2.2

10 Oct 15:13
0.2.2
1a99081
Compare
Choose a tag to compare

Fixes

  • Replace all non-CDN references of discordapp.com with discord.com. [061c85e]

0.2.1

21 Nov 13:30
0.2.1
66752b8
Compare
Choose a tag to compare

Deprecations

  • The through Rest.__using__/1 injected request/2 and request!/2 are now deprecated in favor of their single arity counter parts [b84ed09]
  • c:Rest.get_guild_vanity_url is now deprecated in favor of c:Rest.get_guild_vanity_invite [9b6dc0b]

Fixes

  • Convert data to a map in Rest.Functions.create_message/2,3 [bee289c]
  • Fix invalid typespecs of t:Util.channel_position_resolvable/0 and t:Rest.modify_guild_emoji_data /0 [1d96805]
  • Handle non-JSON responses properly [6c23b5f]
  • Make reason nilable and optional everywhere [5ccb48b]
  • Use :patch when editing the current user via modify_current_user/1 [23deae3]
  • roles in emoji creating and editing functions are now actually optional [c0f2724]
  • Use :patch in modify_current_user/1 [23deae3]
  • Allow c:Rest.get_current_user_guilds/1 to be called as /0 and query-string the parameters [fed13ad]
  • t:Rest.create_message_data/0's nonce can be negative or a string [185075f]
  • Satisfy / Silence the dialyzer everywhere [b7fd6ba...00a553b]

Features

  • Use new X-RateLimit-Reset-After header with millisecond X-RateLimit-Precision [d8c9c82]
    This removes the need to calculate the time offset to Discord's servers and therefore also :timex.
    This also removes the need to hard code sub second rate limits (was only done for creating reactions).
  • Add c:Rest.get_current_user/0 to fetch the current user [fcc7474]
  • Add transform option to Rest.__using__ to allow obtaining untransformed data [b644f9f]
  • Allow String.t snowflakes being used by using the new resolvables from Crux.Structs [33e5301]
  • Add c:Rest.get_guild_vanity_invite/1 [9b6dc0b]
  • Document flags property of t:Rrest.message_edit_data/0 allowing to (un-)suppress embeds [dda771f]

Dependencies

0.2.0

03 Apr 11:45
0.2.0
0a1549a
Compare
Choose a tag to compare

Breaking Changes

  • There no longer is an application; You need to supervise a module using Crux.Rest yourself.

  • Crux.Rest is now a behaviour specifying rest functions
    Crux.Rest now provides a __using__ macro in order to inject those into your own module.

  • Configuration is now done via child spec / arg (t:Crux.Rest.options/0)

Crux.Rest.Util

  • Removed resolve_file/1, use resolve_image/1-2 instead
  • Removed encode_map_key/2, use resolve_image_in_map/2 instead
  • Removed map_file/1, use transform_attachment/1 instead
  • Removed t:resolved_file/0, no new type exists for it.
  • Add t:attachment/0 used when sending files (and images) in messages as part of multipart
  • Add t:image/0 used for images as part of the json as data uris
  • Both new types only accept binary or data uris
    Local paths and http(s) are no longer accepted.
    You need to obtain the binary yourself.

Additions

  • Add support for guild banners [c7ae875]
  • Add Crux.Rest.Request struct holding all necessary details required to make requests
  • Add Crux.Rest.Functions implementing Crux.Rest's specified functions returning Crux.Requests
    (Using it is optional, may come in handy where requests should be executed multiple times)
  • Add bunch of functions to Crux.Rest.Endpoints

Fixes

  • Add closing ) to user agent [5e526dc]
  • Document Crux.Rest.ApiError's method as the atom it actually is.

0.1.7

07 Nov 16:48
0.1.7
7379f6a
Compare
Choose a tag to compare

Deprecations

  • Crux.Rest.Endpoints.cdn/0 is deprecated, please use Crux.Rest.CDN.base_url/0 instead. [39c2149], [0e67edb]
  • Crux.Rest.Endpoints.api/0 is deprecated, please use Crux.Rest.Endpoints.base_url/0 instead. [0e67edb]

Additions

  • Add support for rate_limit_per_user [fa50db8]
  • Add support for AuditLogs [a54c107]
  • Add support for Webhooks [a54c107]

Fixes

  • Less strict matching of http success codes [f2f0090]
  • Remove trailing slash at the users route [2ffd550]
  • Properly resolve files as data uris [de08648]

0.1.6

16 Aug 18:50
0.1.6
2c44b31
Compare
Choose a tag to compare

Deprecations

  • Crux.Rest.Endpoints.cdn/0 is deprecated, please use Crux.Rest.CDN.base_url/0 instead. [39c2149], [0e67edb]
  • Crux.Rest.Endpoints.api/0 is deprecated, please use Crux.Rest.Endpoints.base_url/0 instead. [0e67edb]

Fixes

  • Properly let HTTPoison errors bubble up [6493795]
  • Properly resolve files when using Crux.Rest.create_message/2 with a keyword [bc450a7...aab5e95]

0.1.5

16 Jul 11:02
0.1.5
81c552e
Compare
Choose a tag to compare

Deprecations

  • Crux.Rest.Endpoints.cdn/0 is deprecated, please use Crux.Rest.CDN.base_url/0 instead. [39c2149], [0e67edb]
  • Crux.Rest.Endpoints.api/0 is deprecated, please use Crux.Rest.Endpoints.base_url/0 instead. [0e67edb]

Additions

Fixes

  • Account for the time offset when calculating the reset time [3f0ca72]
  • Properly resolve file attachments [7b7a1ab], [5230c0f]

0.1.4

17 Jun 18:39
0.1.4
0e450fd
Compare
Choose a tag to compare

Additions

Fixes

  • Add with_counts query string parameter for Crux.Rest.get_invite/1 [d9c6a50]
  • No longer retry indefinitely when getting a 5xx response [697e6dc]

0.1.3

13 Jun 11:37
0.1.3
c8a54fd
Compare
Choose a tag to compare

Additions

  • Set a proper user agent when making request [01010bc]
  • Updated crux_structs dependency [568c001]

0.1.2

22 May 18:00
Compare
Choose a tag to compare

Additions

  • Add more missing guild endpoints: roles, bans, and integrations.

0.1.1

19 May 09:29
Compare
Choose a tag to compare

Additions

  • Add Tests for almost all API independent functions
  • Add a few endpoints that were missing
  • Add unified types for resolvables
  • Add unified functions for resolving

Fixes

  • Fix a few incorrect typedocs and specs
  • Fixed a few incorrect resolving or incorrect default args