notion-ruby-client 0.0.5 → 0.0.6
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.rspec_status +15 -15
- data/CHANGELOG.md +4 -0
- data/CODE_OF_CONDUCT.md +128 -0
- data/Gemfile.lock +9 -5
- data/README.md +29 -0
- data/lib/notion/faraday/request.rb +1 -0
- data/lib/notion/version.rb +3 -2
- metadata +8 -7
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: bd3cbaed3ecdcad5d726f9632b32e3fb6d5001b2d8b930ad2043fd9c93127679
|
4
|
+
data.tar.gz: 92d5c3d2c7bf7fb3d14e4a9bd67342fddc53f96bb0d577c64b71fb77d92fc1f7
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 375bf7dc3cc88cf1778b9cfd66482dc9626701d4a56475d12c4e7e252093fec9b613e53f8e53f0a4b2d170df8b3d5b81bf73fc46a49629753ccdf32f563b8170
|
7
|
+
data.tar.gz: 342f1801e73fcd0d043cdaadf77aaebe88ed5ebfd4d3612a5e4df5118850cfe552463db3e162a53d599236c4f161f7a1ed26f7035fbd85847a200333b052c574
|
data/.rspec_status
CHANGED
@@ -1,18 +1,18 @@
|
|
1
1
|
example_id | status | run_time |
|
2
2
|
---------------------------------------------------- | ------ | --------------- |
|
3
|
-
./spec/notion/api/endpoints/blocks_spec.rb[1:1:1] | passed | 0.
|
4
|
-
./spec/notion/api/endpoints/blocks_spec.rb[1:1:2] | passed | 0.
|
5
|
-
./spec/notion/api/endpoints/blocks_spec.rb[1:1:3] | passed | 0.
|
6
|
-
./spec/notion/api/endpoints/databases_spec.rb[1:1:1] | passed | 0.
|
7
|
-
./spec/notion/api/endpoints/databases_spec.rb[1:1:2] | passed | 0.
|
8
|
-
./spec/notion/api/endpoints/databases_spec.rb[1:1:3] | passed | 0.
|
9
|
-
./spec/notion/api/endpoints/databases_spec.rb[1:1:4] | passed | 0.
|
10
|
-
./spec/notion/api/endpoints/databases_spec.rb[1:1:5] | passed | 0.
|
11
|
-
./spec/notion/api/endpoints/pages_spec.rb[1:1:1] | passed | 0.
|
12
|
-
./spec/notion/api/endpoints/pages_spec.rb[1:1:2] | passed | 0.
|
13
|
-
./spec/notion/api/endpoints/pages_spec.rb[1:1:3] | passed | 0.
|
14
|
-
./spec/notion/api/endpoints/users_spec.rb[1:1:1] | passed | 0.
|
15
|
-
./spec/notion/api/endpoints/users_spec.rb[1:1:2] | passed | 0.
|
16
|
-
./spec/notion/api/endpoints/users_spec.rb[1:1:3] | passed | 0.
|
17
|
-
./spec/notion/config_spec.rb[1:1:1] | passed | 0.
|
3
|
+
./spec/notion/api/endpoints/blocks_spec.rb[1:1:1] | passed | 0.01423 seconds |
|
4
|
+
./spec/notion/api/endpoints/blocks_spec.rb[1:1:2] | passed | 0.02323 seconds |
|
5
|
+
./spec/notion/api/endpoints/blocks_spec.rb[1:1:3] | passed | 0.00704 seconds |
|
6
|
+
./spec/notion/api/endpoints/databases_spec.rb[1:1:1] | passed | 0.00598 seconds |
|
7
|
+
./spec/notion/api/endpoints/databases_spec.rb[1:1:2] | passed | 0.00628 seconds |
|
8
|
+
./spec/notion/api/endpoints/databases_spec.rb[1:1:3] | passed | 0.00548 seconds |
|
9
|
+
./spec/notion/api/endpoints/databases_spec.rb[1:1:4] | passed | 0.00596 seconds |
|
10
|
+
./spec/notion/api/endpoints/databases_spec.rb[1:1:5] | passed | 0.00606 seconds |
|
11
|
+
./spec/notion/api/endpoints/pages_spec.rb[1:1:1] | passed | 0.00581 seconds |
|
12
|
+
./spec/notion/api/endpoints/pages_spec.rb[1:1:2] | passed | 0.00598 seconds |
|
13
|
+
./spec/notion/api/endpoints/pages_spec.rb[1:1:3] | passed | 0.00717 seconds |
|
14
|
+
./spec/notion/api/endpoints/users_spec.rb[1:1:1] | passed | 0.00637 seconds |
|
15
|
+
./spec/notion/api/endpoints/users_spec.rb[1:1:2] | passed | 0.00671 seconds |
|
16
|
+
./spec/notion/api/endpoints/users_spec.rb[1:1:3] | passed | 0.00567 seconds |
|
17
|
+
./spec/notion/config_spec.rb[1:1:1] | passed | 0.00005 seconds |
|
18
18
|
./spec/notion/version_spec.rb[1:1] | passed | 0.00005 seconds |
|
data/CHANGELOG.md
CHANGED
data/CODE_OF_CONDUCT.md
ADDED
@@ -0,0 +1,128 @@
|
|
1
|
+
# Contributor Covenant Code of Conduct
|
2
|
+
|
3
|
+
## Our Pledge
|
4
|
+
|
5
|
+
We as members, contributors, and leaders pledge to make participation in our
|
6
|
+
community a harassment-free experience for everyone, regardless of age, body
|
7
|
+
size, visible or invisible disability, ethnicity, sex characteristics, gender
|
8
|
+
identity and expression, level of experience, education, socio-economic status,
|
9
|
+
nationality, personal appearance, race, religion, or sexual identity
|
10
|
+
and orientation.
|
11
|
+
|
12
|
+
We pledge to act and interact in ways that contribute to an open, welcoming,
|
13
|
+
diverse, inclusive, and healthy community.
|
14
|
+
|
15
|
+
## Our Standards
|
16
|
+
|
17
|
+
Examples of behavior that contributes to a positive environment for our
|
18
|
+
community include:
|
19
|
+
|
20
|
+
* Demonstrating empathy and kindness toward other people
|
21
|
+
* Being respectful of differing opinions, viewpoints, and experiences
|
22
|
+
* Giving and gracefully accepting constructive feedback
|
23
|
+
* Accepting responsibility and apologizing to those affected by our mistakes,
|
24
|
+
and learning from the experience
|
25
|
+
* Focusing on what is best not just for us as individuals, but for the
|
26
|
+
overall community
|
27
|
+
|
28
|
+
Examples of unacceptable behavior include:
|
29
|
+
|
30
|
+
* The use of sexualized language or imagery, and sexual attention or
|
31
|
+
advances of any kind
|
32
|
+
* Trolling, insulting or derogatory comments, and personal or political attacks
|
33
|
+
* Public or private harassment
|
34
|
+
* Publishing others' private information, such as a physical or email
|
35
|
+
address, without their explicit permission
|
36
|
+
* Other conduct which could reasonably be considered inappropriate in a
|
37
|
+
professional setting
|
38
|
+
|
39
|
+
## Enforcement Responsibilities
|
40
|
+
|
41
|
+
Community leaders are responsible for clarifying and enforcing our standards of
|
42
|
+
acceptable behavior and will take appropriate and fair corrective action in
|
43
|
+
response to any behavior that they deem inappropriate, threatening, offensive,
|
44
|
+
or harmful.
|
45
|
+
|
46
|
+
Community leaders have the right and responsibility to remove, edit, or reject
|
47
|
+
comments, commits, code, wiki edits, issues, and other contributions that are
|
48
|
+
not aligned to this Code of Conduct, and will communicate reasons for moderation
|
49
|
+
decisions when appropriate.
|
50
|
+
|
51
|
+
## Scope
|
52
|
+
|
53
|
+
This Code of Conduct applies within all community spaces, and also applies when
|
54
|
+
an individual is officially representing the community in public spaces.
|
55
|
+
Examples of representing our community include using an official e-mail address,
|
56
|
+
posting via an official social media account, or acting as an appointed
|
57
|
+
representative at an online or offline event.
|
58
|
+
|
59
|
+
## Enforcement
|
60
|
+
|
61
|
+
Instances of abusive, harassing, or otherwise unacceptable behavior may be
|
62
|
+
reported to the community leaders responsible for enforcement at
|
63
|
+
nicolas@orbit.love.
|
64
|
+
All complaints will be reviewed and investigated promptly and fairly.
|
65
|
+
|
66
|
+
All community leaders are obligated to respect the privacy and security of the
|
67
|
+
reporter of any incident.
|
68
|
+
|
69
|
+
## Enforcement Guidelines
|
70
|
+
|
71
|
+
Community leaders will follow these Community Impact Guidelines in determining
|
72
|
+
the consequences for any action they deem in violation of this Code of Conduct:
|
73
|
+
|
74
|
+
### 1. Correction
|
75
|
+
|
76
|
+
**Community Impact**: Use of inappropriate language or other behavior deemed
|
77
|
+
unprofessional or unwelcome in the community.
|
78
|
+
|
79
|
+
**Consequence**: A private, written warning from community leaders, providing
|
80
|
+
clarity around the nature of the violation and an explanation of why the
|
81
|
+
behavior was inappropriate. A public apology may be requested.
|
82
|
+
|
83
|
+
### 2. Warning
|
84
|
+
|
85
|
+
**Community Impact**: A violation through a single incident or series
|
86
|
+
of actions.
|
87
|
+
|
88
|
+
**Consequence**: A warning with consequences for continued behavior. No
|
89
|
+
interaction with the people involved, including unsolicited interaction with
|
90
|
+
those enforcing the Code of Conduct, for a specified period of time. This
|
91
|
+
includes avoiding interactions in community spaces as well as external channels
|
92
|
+
like social media. Violating these terms may lead to a temporary or
|
93
|
+
permanent ban.
|
94
|
+
|
95
|
+
### 3. Temporary Ban
|
96
|
+
|
97
|
+
**Community Impact**: A serious violation of community standards, including
|
98
|
+
sustained inappropriate behavior.
|
99
|
+
|
100
|
+
**Consequence**: A temporary ban from any sort of interaction or public
|
101
|
+
communication with the community for a specified period of time. No public or
|
102
|
+
private interaction with the people involved, including unsolicited interaction
|
103
|
+
with those enforcing the Code of Conduct, is allowed during this period.
|
104
|
+
Violating these terms may lead to a permanent ban.
|
105
|
+
|
106
|
+
### 4. Permanent Ban
|
107
|
+
|
108
|
+
**Community Impact**: Demonstrating a pattern of violation of community
|
109
|
+
standards, including sustained inappropriate behavior, harassment of an
|
110
|
+
individual, or aggression toward or disparagement of classes of individuals.
|
111
|
+
|
112
|
+
**Consequence**: A permanent ban from any sort of public interaction within
|
113
|
+
the community.
|
114
|
+
|
115
|
+
## Attribution
|
116
|
+
|
117
|
+
This Code of Conduct is adapted from the [Contributor Covenant][homepage],
|
118
|
+
version 2.0, available at
|
119
|
+
https://www.contributor-covenant.org/version/2/0/code_of_conduct.html.
|
120
|
+
|
121
|
+
Community Impact Guidelines were inspired by [Mozilla's code of conduct
|
122
|
+
enforcement ladder](https://github.com/mozilla/diversity).
|
123
|
+
|
124
|
+
[homepage]: https://www.contributor-covenant.org
|
125
|
+
|
126
|
+
For answers to common questions about this code of conduct, see the FAQ at
|
127
|
+
https://www.contributor-covenant.org/faq. Translations are available at
|
128
|
+
https://www.contributor-covenant.org/translations.
|
data/Gemfile.lock
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
PATH
|
2
2
|
remote: .
|
3
3
|
specs:
|
4
|
-
notion-ruby-client (0.0.
|
4
|
+
notion-ruby-client (0.0.6)
|
5
5
|
faraday (>= 1.0)
|
6
6
|
faraday_middleware
|
7
7
|
hashie
|
@@ -15,12 +15,16 @@ GEM
|
|
15
15
|
crack (0.4.5)
|
16
16
|
rexml
|
17
17
|
diff-lcs (1.4.4)
|
18
|
-
faraday (1.4.
|
18
|
+
faraday (1.4.2)
|
19
|
+
faraday-em_http (~> 1.0)
|
20
|
+
faraday-em_synchrony (~> 1.0)
|
19
21
|
faraday-excon (~> 1.1)
|
20
22
|
faraday-net_http (~> 1.0)
|
21
23
|
faraday-net_http_persistent (~> 1.1)
|
22
24
|
multipart-post (>= 1.2, < 3)
|
23
25
|
ruby2_keywords (>= 0.0.4)
|
26
|
+
faraday-em_http (1.0.0)
|
27
|
+
faraday-em_synchrony (1.0.0)
|
24
28
|
faraday-excon (1.1.0)
|
25
29
|
faraday-net_http (1.0.1)
|
26
30
|
faraday-net_http_persistent (1.1.0)
|
@@ -31,7 +35,7 @@ GEM
|
|
31
35
|
jaro_winkler (1.5.4)
|
32
36
|
multipart-post (2.1.1)
|
33
37
|
parallel (1.20.1)
|
34
|
-
parser (3.0.1.
|
38
|
+
parser (3.0.1.1)
|
35
39
|
ast (~> 2.4.1)
|
36
40
|
public_suffix (4.0.6)
|
37
41
|
rainbow (3.0.0)
|
@@ -67,7 +71,7 @@ GEM
|
|
67
71
|
timecop (0.9.4)
|
68
72
|
unicode-display_width (1.7.0)
|
69
73
|
vcr (6.0.0)
|
70
|
-
webmock (3.
|
74
|
+
webmock (3.13.0)
|
71
75
|
addressable (>= 2.3.6)
|
72
76
|
crack (>= 0.3.2)
|
73
77
|
hashdiff (>= 0.4.0, < 2.0.0)
|
@@ -88,4 +92,4 @@ DEPENDENCIES
|
|
88
92
|
webmock
|
89
93
|
|
90
94
|
BUNDLED WITH
|
91
|
-
2.2.
|
95
|
+
2.2.16
|
data/README.md
CHANGED
@@ -203,3 +203,32 @@ properties = {
|
|
203
203
|
}
|
204
204
|
client.update_page(id: 'b55c9c91-384d-452b-81db-d1ef79372b75', properties: properties)
|
205
205
|
```
|
206
|
+
|
207
|
+
#### Blocks
|
208
|
+
|
209
|
+
Retrieve children Block objects at the requested path:
|
210
|
+
|
211
|
+
```ruby
|
212
|
+
client.block_children(id: 'b55c9c91-384d-452b-81db-d1ef79372b75')
|
213
|
+
|
214
|
+
client.block_children(start_cursor: 'fe2cc560-036c-44cd-90e8-294d5a74cebc')
|
215
|
+
|
216
|
+
client.block_children_list do |page|
|
217
|
+
# paginate through all children
|
218
|
+
end
|
219
|
+
```
|
220
|
+
|
221
|
+
Creates and appends new children blocks to the parent block in the requested path:
|
222
|
+
|
223
|
+
```ruby
|
224
|
+
children = [
|
225
|
+
{
|
226
|
+
"object": 'block',
|
227
|
+
"type": 'heading_2',
|
228
|
+
"heading_2": {
|
229
|
+
"text": [{ "type": 'text', "text": { "content": 'A Second-level Heading' } }]
|
230
|
+
}
|
231
|
+
}
|
232
|
+
]
|
233
|
+
client.block_append_children(id: 'b55c9c91-384d-452b-81db-d1ef79372b75', children: children)
|
234
|
+
```
|
@@ -27,6 +27,7 @@ module Notion
|
|
27
27
|
def request(method, path, options)
|
28
28
|
response = connection.send(method) do |request|
|
29
29
|
request.headers['Authorization'] = "Bearer #{token}"
|
30
|
+
request.headers['Notion-Version'] = Notion::NOTION_REQUEST_VERSION
|
30
31
|
case method
|
31
32
|
when :get, :delete
|
32
33
|
request.url(path, options)
|
data/lib/notion/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: notion-ruby-client
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.6
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Nicolas Goutay
|
8
|
-
autorequire:
|
8
|
+
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2021-
|
11
|
+
date: 2021-06-10 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: faraday
|
@@ -164,7 +164,7 @@ dependencies:
|
|
164
164
|
- - ">="
|
165
165
|
- !ruby/object:Gem::Version
|
166
166
|
version: '0'
|
167
|
-
description:
|
167
|
+
description:
|
168
168
|
email: nicolas@orbit.love
|
169
169
|
executables: []
|
170
170
|
extensions: []
|
@@ -176,6 +176,7 @@ files:
|
|
176
176
|
- ".rubocop.yml"
|
177
177
|
- ".rubocop_todo.yml"
|
178
178
|
- CHANGELOG.md
|
179
|
+
- CODE_OF_CONDUCT.md
|
179
180
|
- Gemfile
|
180
181
|
- Gemfile.lock
|
181
182
|
- LICENSE.md
|
@@ -234,7 +235,7 @@ homepage: http://github.com/orbit-love/notion-ruby-client
|
|
234
235
|
licenses:
|
235
236
|
- MIT
|
236
237
|
metadata: {}
|
237
|
-
post_install_message:
|
238
|
+
post_install_message:
|
238
239
|
rdoc_options: []
|
239
240
|
require_paths:
|
240
241
|
- lib
|
@@ -249,8 +250,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
249
250
|
- !ruby/object:Gem::Version
|
250
251
|
version: 1.3.6
|
251
252
|
requirements: []
|
252
|
-
rubygems_version: 3.
|
253
|
-
signing_key:
|
253
|
+
rubygems_version: 3.2.15
|
254
|
+
signing_key:
|
254
255
|
specification_version: 4
|
255
256
|
summary: Notion API client for Ruby.
|
256
257
|
test_files:
|