Skip to content

Releases: mgmarlow/notion-sdk-ruby

v0.6.1

13 Jun 00:02
Compare
Choose a tag to compare

Fix: Include json stdlib for #to_json support.

v0.6.0

12 Jun 16:40
Compare
Choose a tag to compare

What's Changed

Breaking changes

Upcoming

  • New endpoints: Blocks#delete and Pages#properties#retrieve
  • More helpful pagination APIs
  • Examples

Full Changelog: v0.5.0...v0.6.0

v0.5.0

30 Sep 00:13
Compare
Choose a tag to compare

v0.5.0 is a big update that introduces some much-needed changes.

New features & breaking changes

All SDK methods now return proper Ruby objects (for now, just simple OpenStruct wrappers). You no longer need to deal with HTTP responses yourself when using the SDK (whew!).

Here are the new models:

  • Notion::User
  • Notion::Database
  • Notion::Page
  • Notion::Block
  • Notion::List

Example use:

client = Notion::Client.new(token: "secret_token")

users = client.users.list
=> <Notion::List @data=[...]>

users.data
=> [<Notion::User object="user" id="...">, ...]

puts users.data.first.name
=> "Luke Skywalker"

my_page = client.pages.retrieve("page-id")
my_page.properties
=> {"title"=>
  {"id"=>"title",
   "type"=>"title",
   "title"=>
    [{"type"=>"text",
      "text"=>{"content"=>"test", "link"=>nil},
      "annotations"=>
       {"bold"=>false, "italic"=>false, "strikethrough"=>false, "underline"=>false, "code"=>false, "color"=>"default"},
      "plain_text"=>"test",
      "href"=>nil}]}}

Other updates

  • Switched from httparty to faraday for HTTP handling
  • Greatly increased test coverage and improved quality of fixture-based testing

v0.4.1

28 Sep 23:44
Compare
Choose a tag to compare

Misc updates:

  • Updated default version to "2021-08-16"

New endpoints:

  • Add databases#update
  • Add blocks#retrieve
  • Add blocks#update

New deprecation notice:

  • Add deprecation notice to databases#list

0.4.0

23 Jul 00:01
Compare
Choose a tag to compare

You can now create databases! Check out the official release post: https://developers.notion.com/changelog/create-new-databases-with-post-databases

v0.3.1

09 Jun 05:20
Compare
Choose a tag to compare

Changelog

Thanks

Thanks to @cjavilla-stripe for fixing this issue!

v0.3.0

23 May 18:20
Compare
Choose a tag to compare

Lots of adjustments in this new release. The goal is to bridge some of the delta between this SDK and the official JS SDK.

1. Error handling overhaul

When 4xx/5xx errors occur, they no longer return JSON responses to the client method. Instead, they raise an appropriate Notion error.

Example using the new error classes:

def list_users
  client.users.retrieve("invalid-id")
rescue Notion::APIResponseError => e
  puts e.code
  # "object_not_found"
end

2. Namespace updates to match notion-sdk-js

All Notion::Client methods have been updated to match the JS SDK counterpart and align better with the official Notion API documentation. For example,

client.get_users

is now

client.users.list

and so on for all other methods in the SDK. The only method that wasn't changed was client#search, since that already matched the Notion API.

v0.2.3

17 May 05:30
Compare
Choose a tag to compare
Version 0.2.3

v0.2.2

17 May 05:19
Compare
Choose a tag to compare
Version 0.2.2

v0.2.1

14 May 04:39
Compare
Choose a tag to compare
Version 0.2.1