notion-sdk-ruby 0.2.1 → 0.2.2

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 4491885de234786385349badac10c8224bd15c576f63ddc6073bf6593566727b
4
- data.tar.gz: 8b4bd58bf052bf6a5612990a0521442b82ff9e8e400afbb92a10b9dd1c3afcca
3
+ metadata.gz: 876930491da71b978c0a95bb00e5d8838eb1ad4655489ab10d7d66e291708bba
4
+ data.tar.gz: e4a1998ecbc4719fc3697fc0e562d31f59830d9f736a2b29e825a908fde368a1
5
5
  SHA512:
6
- metadata.gz: b139926f4ee0a376d5507d7025a72c89c528461012dfe8ab03c245080c487fece19ce45754bb907bfd0d53f9503a0b48ff8a02052eaa8917862de01347be8549
7
- data.tar.gz: e06fed554747d0bbaf0f7d81224474e642ff540151d136ca59fb2916fa33ba492279ddb166cd25c441aedf2cf0c542802f1737a34538a3d2f5cbc2f732c2e442
6
+ metadata.gz: 318989ffe70cd56b2c91fa08ee04a265fd246cb0b36c9b0a1b72b78d60532159a30412ad2d0e74291af723dc1044acc19737692d2ccc10bf1c91c6830a2cf735
7
+ data.tar.gz: d3e6a6101aeb1c53667c4402498c6b6594170d40fb84513c8375ca4371bbf1dc8600bb0ce28d7ca97c89daf371ae8948f91fafca9abc3b52f8590f1748510526
data/Gemfile CHANGED
@@ -2,14 +2,3 @@ source "https://rubygems.org"
2
2
 
3
3
  # Specify your gem's dependencies in notion-sdk-ruby.gemspec
4
4
  gemspec
5
-
6
- gem "httparty", "~> 0.18.1"
7
-
8
- group :development, :test do
9
- gem "rake", "~> 12.0"
10
- gem "rspec", "~> 3.0"
11
- gem "standardrb", "~> 1.0"
12
- gem "webmock", "~> 3.12"
13
- gem "pry", "~> 0.14.1"
14
- gem "dotenv", "~> 2.7"
15
- end
data/Gemfile.lock CHANGED
@@ -1,7 +1,8 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- notion-sdk-ruby (0.2.1)
4
+ notion-sdk-ruby (0.2.2)
5
+ httparty (~> 0.18.1)
5
6
 
6
7
  GEM
7
8
  remote: https://rubygems.org/
@@ -79,7 +80,6 @@ PLATFORMS
79
80
 
80
81
  DEPENDENCIES
81
82
  dotenv (~> 2.7)
82
- httparty (~> 0.18.1)
83
83
  notion-sdk-ruby!
84
84
  pry (~> 0.14.1)
85
85
  rake (~> 12.0)
data/README.md CHANGED
@@ -1,5 +1,7 @@
1
1
  # Notion Ruby SDK
2
2
 
3
+ Unofficial Ruby client for the [Notion APIs](https://developers.notion.com/).
4
+
3
5
  ## Installation
4
6
 
5
7
  Add this line to your application's Gemfile:
@@ -18,8 +20,14 @@ Or install it yourself as:
18
20
 
19
21
  ## Usage
20
22
 
23
+ Initialize `Notion::Client` with your app's [integration secret](https://developers.notion.com/docs/getting-started#create-a-new-integration).
24
+
21
25
  ```rb
22
- cilent = Notion::Client.new(token: ENV["NOTION_API_SECRET"])
26
+ require "notion-sdk-ruby"
27
+ client = Notion::Client.new(token: ENV["NOTION_API_SECRET"])
28
+
29
+ # get users
30
+ client.get_users
23
31
  ```
24
32
 
25
33
  ### Databases
data/lib/notion/client.rb CHANGED
@@ -2,6 +2,7 @@ module Notion
2
2
  class Client
3
3
  include Endpoints
4
4
  include HTTParty
5
+ headers 'Content-Type': "application/json"
5
6
  base_uri "https://api.notion.com"
6
7
 
7
8
  def initialize(token:)
@@ -6,7 +6,7 @@ module Notion
6
6
  end
7
7
 
8
8
  def append_block_children(id, body)
9
- self.class.patch("/v1/blocks/#{id}/children", body: body)
9
+ self.class.patch("/v1/blocks/#{id}/children", body: body.to_json)
10
10
  end
11
11
  end
12
12
  end
@@ -10,7 +10,7 @@ module Notion
10
10
  end
11
11
 
12
12
  def query_database(id, body)
13
- self.class.post("/v1/databases/#{id}/query", body: body)
13
+ self.class.post("/v1/databases/#{id}/query", body: body.to_json)
14
14
  end
15
15
  end
16
16
  end
@@ -6,11 +6,11 @@ module Notion
6
6
  end
7
7
 
8
8
  def create_page(body)
9
- self.class.post("/v1/pages", body: body)
9
+ self.class.post("/v1/pages", body: body.to_json)
10
10
  end
11
11
 
12
12
  def update_page(id, body)
13
- self.class.patch("/v1/pages/#{id}", body: body)
13
+ self.class.patch("/v1/pages/#{id}", body: body.to_json)
14
14
  end
15
15
  end
16
16
  end
@@ -2,7 +2,7 @@ module Notion
2
2
  module Endpoints
3
3
  module Search
4
4
  def search(body)
5
- self.class.post("/v1/search", body: body)
5
+ self.class.post("/v1/search", body: body.to_json)
6
6
  end
7
7
  end
8
8
  end
@@ -1,3 +1,3 @@
1
1
  module Notion
2
- VERSION = "0.2.1"
2
+ VERSION = "0.2.2"
3
3
  end
@@ -23,4 +23,13 @@ Gem::Specification.new do |spec|
23
23
  spec.bindir = "exe"
24
24
  spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
25
25
  spec.require_paths = ["lib"]
26
+
27
+ spec.add_dependency 'httparty', "~> 0.18.1"
28
+
29
+ spec.add_development_dependency 'rake', "~> 12.0"
30
+ spec.add_development_dependency 'rspec', "~> 3.0"
31
+ spec.add_development_dependency 'standardrb', "~> 1.0"
32
+ spec.add_development_dependency 'webmock', "~> 3.12"
33
+ spec.add_development_dependency 'pry', "~> 0.14.1"
34
+ spec.add_development_dependency 'dotenv', "~> 2.7"
26
35
  end
metadata CHANGED
@@ -1,15 +1,113 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: notion-sdk-ruby
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.1
4
+ version: 0.2.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Graham Marlow
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2021-05-14 00:00:00.000000000 Z
12
- dependencies: []
11
+ date: 2021-05-17 00:00:00.000000000 Z
12
+ dependencies:
13
+ - !ruby/object:Gem::Dependency
14
+ name: httparty
15
+ requirement: !ruby/object:Gem::Requirement
16
+ requirements:
17
+ - - "~>"
18
+ - !ruby/object:Gem::Version
19
+ version: 0.18.1
20
+ type: :runtime
21
+ prerelease: false
22
+ version_requirements: !ruby/object:Gem::Requirement
23
+ requirements:
24
+ - - "~>"
25
+ - !ruby/object:Gem::Version
26
+ version: 0.18.1
27
+ - !ruby/object:Gem::Dependency
28
+ name: rake
29
+ requirement: !ruby/object:Gem::Requirement
30
+ requirements:
31
+ - - "~>"
32
+ - !ruby/object:Gem::Version
33
+ version: '12.0'
34
+ type: :development
35
+ prerelease: false
36
+ version_requirements: !ruby/object:Gem::Requirement
37
+ requirements:
38
+ - - "~>"
39
+ - !ruby/object:Gem::Version
40
+ version: '12.0'
41
+ - !ruby/object:Gem::Dependency
42
+ name: rspec
43
+ requirement: !ruby/object:Gem::Requirement
44
+ requirements:
45
+ - - "~>"
46
+ - !ruby/object:Gem::Version
47
+ version: '3.0'
48
+ type: :development
49
+ prerelease: false
50
+ version_requirements: !ruby/object:Gem::Requirement
51
+ requirements:
52
+ - - "~>"
53
+ - !ruby/object:Gem::Version
54
+ version: '3.0'
55
+ - !ruby/object:Gem::Dependency
56
+ name: standardrb
57
+ requirement: !ruby/object:Gem::Requirement
58
+ requirements:
59
+ - - "~>"
60
+ - !ruby/object:Gem::Version
61
+ version: '1.0'
62
+ type: :development
63
+ prerelease: false
64
+ version_requirements: !ruby/object:Gem::Requirement
65
+ requirements:
66
+ - - "~>"
67
+ - !ruby/object:Gem::Version
68
+ version: '1.0'
69
+ - !ruby/object:Gem::Dependency
70
+ name: webmock
71
+ requirement: !ruby/object:Gem::Requirement
72
+ requirements:
73
+ - - "~>"
74
+ - !ruby/object:Gem::Version
75
+ version: '3.12'
76
+ type: :development
77
+ prerelease: false
78
+ version_requirements: !ruby/object:Gem::Requirement
79
+ requirements:
80
+ - - "~>"
81
+ - !ruby/object:Gem::Version
82
+ version: '3.12'
83
+ - !ruby/object:Gem::Dependency
84
+ name: pry
85
+ requirement: !ruby/object:Gem::Requirement
86
+ requirements:
87
+ - - "~>"
88
+ - !ruby/object:Gem::Version
89
+ version: 0.14.1
90
+ type: :development
91
+ prerelease: false
92
+ version_requirements: !ruby/object:Gem::Requirement
93
+ requirements:
94
+ - - "~>"
95
+ - !ruby/object:Gem::Version
96
+ version: 0.14.1
97
+ - !ruby/object:Gem::Dependency
98
+ name: dotenv
99
+ requirement: !ruby/object:Gem::Requirement
100
+ requirements:
101
+ - - "~>"
102
+ - !ruby/object:Gem::Version
103
+ version: '2.7'
104
+ type: :development
105
+ prerelease: false
106
+ version_requirements: !ruby/object:Gem::Requirement
107
+ requirements:
108
+ - - "~>"
109
+ - !ruby/object:Gem::Version
110
+ version: '2.7'
13
111
  description:
14
112
  email:
15
113
  - mgmarlow@hey.com